mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Finger print Ace files
This commit is contained in:
parent
d641be70a4
commit
462403bb4f
6 changed files with 19 additions and 4 deletions
|
@ -18,6 +18,8 @@ for path in [
|
|||
"#{jsPath}libs/require.js",
|
||||
"#{jsPath}ide.js",
|
||||
"#{jsPath}main.js",
|
||||
"#{jsPath}libs.js",
|
||||
"#{jsPath}ace/ace.js",
|
||||
"#{jsPath}libs/pdf.js",
|
||||
"#{jsPath}libs/pdf.worker.js",
|
||||
"/stylesheets/style.css"
|
||||
|
|
|
@ -55,7 +55,8 @@ html(itemscope, itemtype='http://schema.org/Product')
|
|||
window.requirejs = {
|
||||
"urlArgs" : "fingerprint=#{fingerprint(jsPath + 'app/main.js')}",
|
||||
"paths" : {
|
||||
"moment": "libs/moment-2.7.0"
|
||||
"moment": "libs/moment-2.7.0",
|
||||
"libs": "#{jsPath}/libs.js?fingerprint=#{fingerprint(jsPath + 'libs.js')}"
|
||||
}
|
||||
};
|
||||
script(
|
||||
|
|
|
@ -91,7 +91,7 @@ block content
|
|||
"mathjax": "https://c328740.ssl.cf1.rackcdn.com/mathjax/latest/MathJax.js?config=TeX-AMS_HTML",
|
||||
"moment": "libs/moment-2.7.0"
|
||||
},
|
||||
"urlArgs" : "fingerprint=#{fingerprint(jsPath + 'ide.js')}",
|
||||
"urlArgs" : "fingerprint=#{fingerprint(jsPath + 'ide.js')}-#{fingerprint(jsPath + 'libs.js')}",
|
||||
"waitSeconds": 0,
|
||||
"shim": {
|
||||
"libs/pdfListView/PdfListView": {
|
||||
|
@ -105,6 +105,7 @@ block content
|
|||
}
|
||||
}
|
||||
};
|
||||
window.aceFingerprint = "#{fingerprint(jsPath + 'ace/ace.js')}"
|
||||
|
||||
script(type='text/javascript').
|
||||
ga('send', 'event', 'editor-interaction', 'editor-opened')
|
||||
|
@ -117,7 +118,7 @@ block content
|
|||
window.pdfJsWorkerPath = "#{pdfJsWorkerPath}";
|
||||
|
||||
script(
|
||||
data-main=jsPath+'ide.js',
|
||||
data-main=jsPath+"ide.js",
|
||||
baseurl=jsPath,
|
||||
data-ace-base=jsPath+'ace',
|
||||
src=jsPath+'libs/require.js?fingerprint='+fingerprint(jsPath + 'libs/require.js')
|
||||
|
|
|
@ -3,6 +3,7 @@ define [
|
|||
"modules/recursionHelper"
|
||||
"utils/underscore"
|
||||
], () ->
|
||||
console.log "LOADING BASE"
|
||||
App = angular.module("SharelatexApp", [
|
||||
"ui.bootstrap"
|
||||
"autocomplete"
|
||||
|
|
|
@ -9,6 +9,15 @@ define [
|
|||
"ide/editor/directives/aceEditor/cursor-position/CursorPositionManager"
|
||||
], (App, Ace, SearchBox, UndoManager, AutoCompleteManager, SpellCheckManager, HighlightsManager, CursorPositionManager) ->
|
||||
EditSession = ace.require('ace/edit_session').EditSession
|
||||
|
||||
# Ace loads its script itself, so we need to hook in to be able to clear
|
||||
# the cache.
|
||||
if !ace.config._moduleUrl?
|
||||
ace.config._moduleUrl = ace.config.moduleUrl
|
||||
ace.config.moduleUrl = (args...) ->
|
||||
url = ace.config._moduleUrl(args...) + "?fingerprint=#{window.aceFingerprint}"
|
||||
console.log "URL", url
|
||||
return url
|
||||
|
||||
App.directive "aceEditor", ["$timeout", "$compile", "$rootScope", ($timeout, $compile, $rootScope) ->
|
||||
monkeyPatchSearch($rootScope, $compile)
|
||||
|
@ -73,7 +82,7 @@ define [
|
|||
# Make '/' work for search in vim mode.
|
||||
editor.showCommandLine = (arg) =>
|
||||
if arg == "/"
|
||||
Ace.require("ace/ext/searchbox").Search(editor, true)
|
||||
ace.require("ace/ext/searchbox").Search(editor, true)
|
||||
|
||||
if attrs.resizeOn?
|
||||
for event in attrs.resizeOn.split(",")
|
||||
|
|
|
@ -3465,6 +3465,7 @@ exports.moduleUrl = function(name, component) {
|
|||
}
|
||||
if (path && path.slice(-1) != "/")
|
||||
path += "/";
|
||||
console.log(path, component, sep, base);
|
||||
return path + component + sep + base + this.get("suffix");
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue