upgrade pdfjs to 1.6.210p1

This commit is contained in:
Brian Gough 2016-10-13 14:51:21 +01:00
parent 5748d1e7ec
commit 27a8dc1dfd
4 changed files with 11 additions and 13 deletions

View file

@ -160,10 +160,10 @@ module.exports = (grunt) ->
paths: paths:
"moment": "libs/#{PackageVersions.lib('moment')}" "moment": "libs/#{PackageVersions.lib('moment')}"
"mathjax": "/js/libs/mathjax/MathJax.js?config=TeX-AMS_HTML" "mathjax": "/js/libs/mathjax/MathJax.js?config=TeX-AMS_HTML"
"libs/pdf": "libs/#{PackageVersions.lib('pdfjs')}/pdf" "pdfjs-dist/build/pdf": "libs/#{PackageVersions.lib('pdfjs')}/pdf"
"ace": "#{PackageVersions.lib('ace')}" "ace": "#{PackageVersions.lib('ace')}"
shim: shim:
"libs/pdf": "pdfjs-dist/build/pdf":
deps: ["libs/#{PackageVersions.lib('pdfjs')}/compatibility"] deps: ["libs/#{PackageVersions.lib('pdfjs')}/compatibility"]
skipDirOptimize: true skipDirOptimize: true
@ -173,7 +173,7 @@ module.exports = (grunt) ->
exclude: ["libs"] exclude: ["libs"]
}, { }, {
name: "ide", name: "ide",
exclude: ["libs", "libs/pdf"] exclude: ["libs", "pdfjs-dist/build/pdf"]
}, { }, {
name: "libs" name: "libs"
},{ },{

View file

@ -1,5 +1,5 @@
version = { version = {
"pdfjs": "1.3.91p1" "pdfjs": "1.6.210p1"
"moment": "2.9.0" "moment": "2.9.0"
"ace": "1.2.5" "ace": "1.2.5"
} }

View file

@ -87,6 +87,10 @@ block content
block requirejs block requirejs
script(type="text/javascript" src='/socket.io/socket.io.js') script(type="text/javascript" src='/socket.io/socket.io.js')
//- don't use cdn for worker
- var pdfWorkerPath = buildJsPath('/libs/' + lib('pdfjs') + '/pdf.worker', {cdn:false,fingerprint:false})
//- We need to do .replace(/\//g, '\\/') do that '</script>' -> '<\/script>' //- We need to do .replace(/\//g, '\\/') do that '</script>' -> '<\/script>'
//- and doesn't prematurely end the script tag. //- and doesn't prematurely end the script tag.
script(type='text/javascript'). script(type='text/javascript').
@ -101,13 +105,14 @@ block requirejs
"paths" : { "paths" : {
"mathjax": "#{buildJsPath('/libs/mathjax/MathJax.js', {cdn:false, fingerprint:false, qs:{config:'TeX-AMS_HTML'}})}", "mathjax": "#{buildJsPath('/libs/mathjax/MathJax.js', {cdn:false, fingerprint:false, qs:{config:'TeX-AMS_HTML'}})}",
"moment": "libs/#{lib('moment')}", "moment": "libs/#{lib('moment')}",
"libs/pdf": "libs/#{lib('pdfjs')}/pdf", "pdfjs-dist/build/pdf": "libs/#{lib('pdfjs')}/pdf",
"pdfjs-dist/build/pdf.worker": "#{pdfWorkerPath}",
"ace": "#{lib('ace')}" "ace": "#{lib('ace')}"
}, },
"urlArgs" : "fingerprint=#{fingerprint(jsPath + 'ide.js')}-#{fingerprint(jsPath + 'libs.js')}", "urlArgs" : "fingerprint=#{fingerprint(jsPath + 'ide.js')}-#{fingerprint(jsPath + 'libs.js')}",
"waitSeconds": 0, "waitSeconds": 0,
"shim": { "shim": {
"libs/pdf": { "pdfjs-dist/build/pdf": {
"deps": ["libs/#{lib('pdfjs')}/compatibility"] "deps": ["libs/#{lib('pdfjs')}/compatibility"]
}, },
"ace/ext-searchbox": { "ace/ext-searchbox": {
@ -125,13 +130,9 @@ block requirejs
}; };
window.aceFingerprint = "#{fingerprint(jsPath + lib('ace') + '/ace.js')}" window.aceFingerprint = "#{fingerprint(jsPath + lib('ace') + '/ace.js')}"
- var pdfPath = "libs/" + lib('pdfjs') + "/pdf.worker.js"
- var fingerprintedPath = fingerprint(jsPath+pdfPath)
- var pdfJsWorkerPath = buildJsPath(pdfPath, {cdn:false,qs:{fingerprint:fingerprintedPath}}) // don't use worker for cdn
- var aceWorkerPath = user.betaProgram ? buildJsPath(lib('ace'), {cdn:false,fingerprint:false}) : "" // don't use worker for cdn - var aceWorkerPath = user.betaProgram ? buildJsPath(lib('ace'), {cdn:false,fingerprint:false}) : "" // don't use worker for cdn
script(type='text/javascript'). script(type='text/javascript').
window.pdfJsWorkerPath = "#{pdfJsWorkerPath}";
window.aceWorkerPath = "#{aceWorkerPath}"; window.aceWorkerPath = "#{aceWorkerPath}";
script( script(

View file

@ -6,9 +6,6 @@ define [
pdfViewer pdfViewer
) -> ) ->
if PDFJS?
PDFJS.workerSrc = window.pdfJsWorkerPath
App.directive "pdfng", ["$timeout", "localStorage", ($timeout, localStorage) -> App.directive "pdfng", ["$timeout", "localStorage", ($timeout, localStorage) ->
return { return {
scope: { scope: {