Commit 6edf1415 authored by Romain Courteaud's avatar Romain Courteaud

[erp5_code_mirror] Active syntax highlighting. Add cache manifest

parent 0d347352
CACHE MANIFEST
# generated on Thu, 07 Feb 2017 15:00:00 GMT
CACHE:
favicon.ico
renderjs.js
rsvp.js
codemirror/lib/codemirror.js
codemirror/lib/codemirror.css
codemirror/addon/cm_edit/matchbrackets.js
codemirror/addon/cm_edit/trailingspace.js
codemirror/addon/dialog/dialog.css
codemirror/addon/dialog/dialog.js
codemirror/addon/search/searchcursor.js
codemirror/addon/search/search.js
codemirror/addon/search/jump-to-line.js
codemirror/addon/selection/active-line.js
codemirror/addon/hint/show-hint.css
codemirror/addon/hint/show-hint.js
codemirror/addon/hint/anyword-hint.js
codemirror/addon/fold/foldgutter.css
codemirror/addon/fold/foldcode.js
codemirror/addon/fold/foldgutter.js
codemirror/addon/fold/indent-fold.js
codemirror/addon/fold/comment-fold.js
codemirror/addon/merge/merge.css
diff_match_patch/javascript/diff_match_patch_uncompressed.js
codemirror/addon/merge/merge.js
codemirror/addon/lint/lint.css
codemirror/addon/lint/lint.js
jshint.js
codemirror/addon/lint/javascript-lint.js
csslint.js
codemirror/addon/lint/css-lint.js
codemirror/mode/xml/xml.js
codemirror/mode/javascript/javascript.js
codemirror/mode/css/css.js
codemirror/mode/htmlmixed/htmlmixed.js
codemirror.gadget.js
NETWORK:
*
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__name__</string> </key>
<value> <string>codemirror.gadget.appcache</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/cache-manifest</string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<!DOCTYPE html>
<html>
<html manifest=codemirror.gadget.appcache>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
......@@ -59,15 +59,19 @@
<link rel="stylesheet" href="codemirror/addon/lint/lint.css" />
<script src="codemirror/addon/lint/lint.js"></script>
<!--link rel="stylesheet" href="codemirror/lib/codemirror.css" />
<link rel="stylesheet" href="codemirror/addon/display/fullscreen.css" /-->
<!-- link rel="stylesheet" href="addon/dialog/dialog.css" / -->
<script type="text/javascript" src="jshint.js"></script>
<script type="text/javascript" src="codemirror/addon/lint/javascript-lint.js"></script>
<!-- script src="addon/search/searchcursor.js"></script>
<script src="addon/cm_edit/matchbrackets.js"></script -->
<script type="text/javascript" src="csslint.js"></script>
<script type="text/javascript" src="codemirror/addon/lint/css-lint.js"></script>
<script type="text/javascript" src="codemirror/mode/xml/xml.js"></script>
<script type="text/javascript" src="codemirror/mode/javascript/javascript.js"></script>
<script type="text/javascript" src="codemirror/mode/css/css.js"></script>
<script type="text/javascript" src="codemirror/mode/htmlmixed/htmlmixed.js"></script>
<!--link rel="stylesheet" href="codemirror/addon/display/fullscreen.css" /-->
<!--script src="codemirror/addon/display/fullscreen.js"></script-->
<!-- script src="addon/dialog/dialog.js"></script>
<script src="mode/javascript/javascript.js"></script -->
<script src="codemirror.gadget.js"></script>
</head>
......
......@@ -45,10 +45,19 @@
})
.declareMethod('render', function (options) {
var mode;
if (options.portal_type === 'Web Page') {
mode = 'htmlmixed';
} else if (options.portal_type === 'Web Script') {
mode = 'javascript';
} else if (options.portal_type === 'Web Style') {
mode = 'css';
}
return this.changeState({
key: options.key,
value: options.value || "",
editable: options.editable === undefined ? true : options.editable
editable: options.editable === undefined ? true : options.editable,
mode: mode
});
})
......@@ -56,6 +65,9 @@
if (modification_dict.hasOwnProperty('value')) {
this.editor.setValue(this.state.value);
}
if (modification_dict.hasOwnProperty('mode')) {
this.editor.setOption("mode", this.state.mode);
}
})
.declareMethod('getContent', function () {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment