mirror of
https://github.com/overleaf/overleaf.git
synced 2025-03-13 09:33:06 +00:00
use separate jade template block for requirejs
removes the need to suppressDefaultJs
This commit is contained in:
parent
0f2959eb3b
commit
380487abf0
4 changed files with 21 additions and 34 deletions
|
@ -52,6 +52,7 @@ html(itemscope, itemtype='http://schema.org/Product')
|
|||
window.csrfToken = "#{csrfToken}";
|
||||
|
||||
block scripts
|
||||
|
||||
script(src=buildJsPath("libs/jquery-1.11.1.min.js", {fingerprint:false}))
|
||||
script(type="text/javascript").
|
||||
var noCdnKey = "nocdn=true"
|
||||
|
@ -109,41 +110,36 @@ html(itemscope, itemtype='http://schema.org/Product')
|
|||
- if(typeof(suppressNavbar) == "undefined")
|
||||
include layout/navbar
|
||||
|
||||
script(type='text/javascript').
|
||||
// minimal requirejs configuration (can be extended/overridden)
|
||||
window.requirejs = {
|
||||
"paths" : {
|
||||
"moment": "libs/#{lib('moment')}"
|
||||
},
|
||||
"config":{
|
||||
"moment":{
|
||||
"noGlobal": true
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
block content
|
||||
|
||||
div(ng-controller="AbTestController")
|
||||
- if(typeof(suppressFooter) == "undefined")
|
||||
include layout/footer
|
||||
|
||||
|
||||
|
||||
- if (typeof(lookingForScribtex) != "undefined" && lookingForScribtex)
|
||||
span(ng-controller="ScribtexPopupController")
|
||||
include scribtex-modal
|
||||
|
||||
- if(typeof(suppressDefaultJs) == "undefined")
|
||||
block requirejs
|
||||
script(type='text/javascript').
|
||||
// extend requirejs config
|
||||
window.requirejs.urlArgs = "fingerprint=#{fingerprint(jsPath + 'main.js')}-#{fingerprint(jsPath + 'libs.js')}"
|
||||
// minimal requirejs configuration (can be extended/overridden)
|
||||
window.requirejs = {
|
||||
"paths" : {
|
||||
"moment": "libs/#{lib('moment')}"
|
||||
},
|
||||
"urlArgs": "fingerprint=#{fingerprint(jsPath + 'main.js')}-#{fingerprint(jsPath + 'libs.js')}",
|
||||
"config":{
|
||||
"moment":{
|
||||
"noGlobal": true
|
||||
}
|
||||
}
|
||||
};
|
||||
script(
|
||||
data-main=buildJsPath('main.js', {fingerprint:false}),
|
||||
baseurl=fullJsPath,
|
||||
src=buildJsPath('libs/require.js')
|
||||
)
|
||||
|
||||
|
||||
include contact-us-modal
|
||||
include sentry
|
||||
|
||||
|
|
|
@ -3,7 +3,6 @@ extends ../layout
|
|||
block vars
|
||||
- var suppressNavbar = true
|
||||
- var suppressFooter = true
|
||||
- var suppressDefaultJs = true
|
||||
- var suppressSystemMessages = true
|
||||
|
||||
block content
|
||||
|
@ -86,8 +85,8 @@ block content
|
|||
.modal-footer
|
||||
button.btn.btn-info(ng-click="done()") #{translate("ok")}
|
||||
|
||||
script(src='/socket.io/socket.io.js')
|
||||
|
||||
block requirejs
|
||||
script(type="text/javascript" src='/socket.io/socket.io.js')
|
||||
//- We need to do .replace(/\//g, '\\/') do that '</script>' -> '<\/script>'
|
||||
//- and doesn't prematurely end the script tag.
|
||||
script(type='text/javascript').
|
||||
|
@ -126,8 +125,6 @@ block content
|
|||
};
|
||||
window.aceFingerprint = "#{fingerprint(jsPath + lib('ace') + '/ace.js')}"
|
||||
|
||||
- locals.suppressDefaultJs = true
|
||||
|
||||
- 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
|
||||
|
@ -144,5 +141,4 @@ block content
|
|||
src=buildJsPath('libs/require.js')
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,10 +1,9 @@
|
|||
extends ../layout
|
||||
|
||||
block content
|
||||
- locals.suppressDefaultJs = true
|
||||
script(data-main=jsPath+'main.js', src=jsPath+'libs/require.js', baseurl=jsPath)
|
||||
block scripts
|
||||
script(src=buildJsPath('libs/recurly.min.js', {fingerprint:false}))
|
||||
|
||||
block content
|
||||
.content.content-alt
|
||||
.container
|
||||
.row
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
extends ../layout
|
||||
block scripts
|
||||
|
||||
block scripts
|
||||
script(src="https://js.recurly.com/v3/recurly.js")
|
||||
|
||||
script(type='text/javascript').
|
||||
|
@ -11,10 +11,6 @@ block scripts
|
|||
window.couponCode = "#{couponCode}"
|
||||
|
||||
block content
|
||||
- locals.suppressDefaultJs = true
|
||||
script(data-main=jsPath+'main.js', src=jsPath+'libs/require.js', baseurl=jsPath)
|
||||
|
||||
|
||||
.content.content-alt
|
||||
.container(ng-controller="NewSubscriptionController" ng-cloak)
|
||||
.row.card-group
|
||||
|
|
Loading…
Reference in a new issue