This repository has been archived by the owner on Nov 9, 2017. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prevent browsers from caching old codemirror when it is updated
- Loading branch information
Showing
5 changed files
with
40 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
...ar/src/main/resources/org/zanata/webtrans/public/codemirror/README-codemirror-updates.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
The codemirror version number is incorporated in the filename to enable | ||
correct caching in browsers. | ||
|
||
When updating codemirror, be sure to change the filenames for | ||
codemirror-*.cache.css and codemirror-compressed-*.cache.js and the | ||
references to them in Application.xhtml and Dummy.html. | ||
|
||
|
||
Recipe for codemirror-compressed.js: | ||
|
||
codemirror-compressed.js is generated at http://codemirror.net/doc/compress.html | ||
includes: | ||
- codemirror.js | ||
- css.js | ||
- htmlmixed.js | ||
- javascript.js | ||
- xml.js | ||
- runmode.js | ||
- searchcursor.js (to enable highlight search term within codemirror" | ||
- overlay.js (to support visible space) | ||
|
||
added following custom code when generating the codemirror-compressed.js (to support visible space): | ||
|
||
CodeMirror.defineMode("visibleSpace", function(config, parserConfig) { | ||
var visibleSpaceOverlay = { | ||
token: function(stream, state) { | ||
var ch = stream.next(); | ||
if (ch == " ") { | ||
return "space"; | ||
} else { | ||
return null; | ||
} | ||
} | ||
}; | ||
return CodeMirror.overlayMode(CodeMirror.getMode(config, parserConfig.backdrop || "htmlmixed"), visibleSpaceOverlay); | ||
}); |
File renamed without changes.
File renamed without changes.