diff --git a/services/web/app/coffee/infrastructure/ExpressLocals.coffee b/services/web/app/coffee/infrastructure/ExpressLocals.coffee index 023ac86ad9..af67ae93c5 100644 --- a/services/web/app/coffee/infrastructure/ExpressLocals.coffee +++ b/services/web/app/coffee/infrastructure/ExpressLocals.coffee @@ -23,9 +23,6 @@ for path in [ "#{jsPath}main.js", "#{jsPath}libs.js", "#{jsPath}ace/ace.js", - "#{jsPath}libs/pdf.js", - "#{jsPath}libs/pdf.worker.js", - "#{jsPath}libs/compatibility.js", "#{jsPath}libs/pdfjs-1.0.712/pdf.js", "#{jsPath}libs/pdfjs-1.0.712/pdf.worker.js", "#{jsPath}libs/pdfjs-1.0.712/compatibility.js", diff --git a/services/web/app/views/project/editor.jade b/services/web/app/views/project/editor.jade index 3a04e01d4b..8d49bbf9d2 100644 --- a/services/web/app/views/project/editor.jade +++ b/services/web/app/views/project/editor.jade @@ -89,14 +89,14 @@ block content window.requirejs = { "paths" : { "mathjax": "/js/libs/mathjax/MathJax.js?config=TeX-AMS_HTML", - "moment": "libs/moment-2.7.0" + "moment": "libs/moment-2.7.0", + "libs/pdf": "libs/pdfjs-1.0.712/pdf", + "libs/compatibility": "libs/pdfjs-1.0.712/compatibility" + }, "urlArgs" : "fingerprint=#{fingerprint(jsPath + 'ide.js')}-#{fingerprint(jsPath + 'libs.js')}", "waitSeconds": 0, "shim": { - "libs/pdfListView/PdfListView": { - deps: ["libs/pdf"] - }, "libs/pdf": { deps: ["libs/compatibility"] }, @@ -117,21 +117,12 @@ block content - locals.suppressDefaultJs = true - - // user.featureSwitches = {} // override - - var usePdfNG = user.featureSwitches && user.featureSwitches.pdfng; - - var pdfPath = 'libs/pdf.worker.js'; - - if (usePdfNG) { pdfPath = 'libs/pdfjs-1.0.712/pdf.worker.js'; } + - var pdfPath = 'libs/pdfjs-1.0.712/pdf.worker.js' - var fingerprintedPath = fingerprint(jsPath+pdfPath) - var pdfJsWorkerPath = jsPath+pdfPath+'?fingerprint='+fingerprintedPath script(type='text/javascript'). window.pdfJsWorkerPath = "#{pdfJsWorkerPath}"; - // when using pdfng we need a different pdfjs version - if usePdfNG - script(type='text/javascript'). - window.requirejs.paths['libs/pdf'] = 'libs/pdfjs-1.0.712/pdf' - window.requirejs.paths['libs/compatibility'] = 'libs/pdfjs-1.0.712/compatibility' - script( data-main=jsPath+"ide.js", baseurl=jsPath, diff --git a/services/web/app/views/project/editor/pdf.jade b/services/web/app/views/project/editor/pdf.jade index cbfeece827..747092cb0b 100644 --- a/services/web/app/views/project/editor/pdf.jade +++ b/services/web/app/views/project/editor/pdf.jade @@ -58,30 +58,16 @@ div.full-size.pdf(ng-controller="PdfController") i.split-screen .pdf-viewer(ng-show="pdf.url && pdf.view == 'pdf' && !pdf.failure && !pdf.timeout && !pdf.error") - - // user.featureSwitches = {} // override - - var usePdfNG = user.featureSwitches && user.featureSwitches.pdfng; - if !usePdfNG - div( - pdfjs - ng-if="settings.pdfViewer == 'pdfjs'" - pdf-src="pdf.url" - key="{{ project_id }}" - resize-on="layout:main:resize,layout:pdf:resize" - highlights="pdf.highlights" - position="pdf.position" - dbl-click-callback="syncToCode" - ) - else - div( - pdfng - ng-if="settings.pdfViewer == 'pdfjs'" - pdf-src="pdf.url" - key="{{ project_id }}" - resize-on="layout:main:resize,layout:pdf:resize" - highlights="pdf.highlights" - position="pdf.position" - dbl-click-callback="syncToCode" - ) + div( + pdfng + ng-if="settings.pdfViewer == 'pdfjs'" + pdf-src="pdf.url" + key="{{ project_id }}" + resize-on="layout:main:resize,layout:pdf:resize" + highlights="pdf.highlights" + position="pdf.position" + dbl-click-callback="syncToCode" + ) iframe( ng-src="{{ pdf.url }}" diff --git a/services/web/public/coffee/ide/pdf/PdfManager.coffee b/services/web/public/coffee/ide/pdf/PdfManager.coffee index b9e3fe5e88..56fe7b1e68 100644 --- a/services/web/public/coffee/ide/pdf/PdfManager.coffee +++ b/services/web/public/coffee/ide/pdf/PdfManager.coffee @@ -1,8 +1,7 @@ define [ "ide/pdf/controllers/PdfController" "ide/pdf/controllers/PdfViewToggleController" - "ide/pdf/directives/pdfJs" - "ide/pdfng/directives/pdfJs" # alternative incremental viewer + "ide/pdfng/directives/pdfJs" ], () -> class PdfManager constructor: (@ide, @$scope) -> diff --git a/services/web/public/coffee/ide/pdf/directives/pdfJs.coffee b/services/web/public/coffee/ide/pdf/directives/pdfJs.coffee deleted file mode 100644 index bc62ba9061..0000000000 --- a/services/web/public/coffee/ide/pdf/directives/pdfJs.coffee +++ /dev/null @@ -1,193 +0,0 @@ -define [ - "base" - "libs/pdfListView/PdfListView" - "libs/pdfListView/TextLayerBuilder" - "libs/pdfListView/AnnotationsLayerBuilder" - "libs/pdfListView/HighlightsLayerBuilder" - "text!libs/pdfListView/TextLayer.css" - "text!libs/pdfListView/AnnotationsLayer.css" - "text!libs/pdfListView/HighlightsLayer.css" -], ( - App - PDFListView - TextLayerBuilder - AnnotationsLayerBuilder - HighlightsLayerBuilder - textLayerCss - annotationsLayerCss - highlightsLayerCss -) -> - if PDFJS? - PDFJS.workerSrc = window.pdfJsWorkerPath - - style = $("