mirror of
https://github.com/overleaf/overleaf.git
synced 2025-01-11 16:34:28 +00:00
upgrade pdfjs to 1.6.210p1
This commit is contained in:
parent
5748d1e7ec
commit
27a8dc1dfd
4 changed files with 11 additions and 13 deletions
|
@ -160,10 +160,10 @@ module.exports = (grunt) ->
|
|||
paths:
|
||||
"moment": "libs/#{PackageVersions.lib('moment')}"
|
||||
"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')}"
|
||||
shim:
|
||||
"libs/pdf":
|
||||
"pdfjs-dist/build/pdf":
|
||||
deps: ["libs/#{PackageVersions.lib('pdfjs')}/compatibility"]
|
||||
|
||||
skipDirOptimize: true
|
||||
|
@ -173,7 +173,7 @@ module.exports = (grunt) ->
|
|||
exclude: ["libs"]
|
||||
}, {
|
||||
name: "ide",
|
||||
exclude: ["libs", "libs/pdf"]
|
||||
exclude: ["libs", "pdfjs-dist/build/pdf"]
|
||||
}, {
|
||||
name: "libs"
|
||||
},{
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
version = {
|
||||
"pdfjs": "1.3.91p1"
|
||||
"pdfjs": "1.6.210p1"
|
||||
"moment": "2.9.0"
|
||||
"ace": "1.2.5"
|
||||
}
|
||||
|
|
|
@ -87,6 +87,10 @@ block content
|
|||
|
||||
block requirejs
|
||||
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>'
|
||||
//- and doesn't prematurely end the script tag.
|
||||
script(type='text/javascript').
|
||||
|
@ -101,13 +105,14 @@ block requirejs
|
|||
"paths" : {
|
||||
"mathjax": "#{buildJsPath('/libs/mathjax/MathJax.js', {cdn:false, fingerprint:false, qs:{config:'TeX-AMS_HTML'}})}",
|
||||
"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')}"
|
||||
},
|
||||
"urlArgs" : "fingerprint=#{fingerprint(jsPath + 'ide.js')}-#{fingerprint(jsPath + 'libs.js')}",
|
||||
"waitSeconds": 0,
|
||||
"shim": {
|
||||
"libs/pdf": {
|
||||
"pdfjs-dist/build/pdf": {
|
||||
"deps": ["libs/#{lib('pdfjs')}/compatibility"]
|
||||
},
|
||||
"ace/ext-searchbox": {
|
||||
|
@ -125,13 +130,9 @@ block requirejs
|
|||
};
|
||||
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
|
||||
|
||||
script(type='text/javascript').
|
||||
window.pdfJsWorkerPath = "#{pdfJsWorkerPath}";
|
||||
window.aceWorkerPath = "#{aceWorkerPath}";
|
||||
|
||||
script(
|
||||
|
|
|
@ -6,9 +6,6 @@ define [
|
|||
pdfViewer
|
||||
|
||||
) ->
|
||||
if PDFJS?
|
||||
PDFJS.workerSrc = window.pdfJsWorkerPath
|
||||
|
||||
App.directive "pdfng", ["$timeout", "localStorage", ($timeout, localStorage) ->
|
||||
return {
|
||||
scope: {
|
||||
|
|
Loading…
Reference in a new issue