Commit 006ae32b authored by Vincent Bechu's avatar Vincent Bechu Committed by Vincent Bechu

erp5_officejs: add codemirror gadget

parent 82b09fe8
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Codemirror Gadget</title>
<script src="rsvp.js" type="text/javascript"></script>
<script src="renderjs.js" type="text/javascript"></script>
<link rel="stylesheet" href="codemirror/lib/codemirror.css">
<link rel="stylesheet" href="codemirror/addon/dialog/dialog.css">
<link rel="stylesheet" href="codemirror/addon/search/matchesonscrollbar.css">
<script src="codemirror/lib/codemirror.js"></script>
<script src="codemirror/mode/css/css.js"></script>
<script src="codemirror/mode/xml/xml.js"></script>
<script src="codemirror/mode/javascript/javascript.js"></script>
<script src="codemirror/mode/htmlmixed/htmlmixed.js"></script>
<script src="codemirror/addon/dialog/dialog.js"></script>
<script src="codemirror/addon/search/searchcursor.js"></script>
<script src="codemirror/addon/search/search.js"></script>
<script src="codemirror/addon/scroll/annotatescrollbar.js"></script>
<script src="codemirror/addon/search/matchesonscrollbar.js"></script>
<script src="gadget_code_mirror_editor.js" type="text/javascript"></script>
</head>
<body>
<div class="codemirror_gadget"><textarea name="code"></textarea></div>
</body>
</html>
\ No newline at end of file
/*jslint nomen: true, indent: 2, maxerr: 3 */
/*global window, rJS, CodeMirror, RSVP */
(function (window, rJS, CodeMirror, RSVP) {
"use strict";
rJS(window)
.declareAcquiredMethod("saveContent", "triggerSubmit")
.declareMethod('render', function (options) {
this.props.key = options.key || {};
this.props.editor.setOption("mode", options.mode || "htmlmixed");
this.props.editor.setValue(options.value || "");
})
.declareMethod('getContent', function () {
var result = {};
result[this.props.key || "text_content"] = this.props.editor.getValue();
return result;
})
.declareService(function () {
this.props.editor.refresh();
this.props.editor.focus();
})
.ready(function (g) {
g.props = {};
return g.getElement()
.push(function (element) {
g.props.element = element;
CodeMirror.commands.save = function () {
return new RSVP.Queue()
.push(function () {
return g.saveContent();
});
};
g.props.editor = CodeMirror.fromTextArea(g.props.element.querySelector("textarea"), {
lineNumbers: true,
mode: "text/html",
matchBrackets: true,
showCursorWhenSelecting: true,
extraKeys: {"Alt-F": "findPersistent"}
});
// XXX custom styling for CribJS, should be put somewhere else-
g.props.element.querySelector('.CodeMirror').setAttribute('style', 'min-height: 800px;');
});
});
}(window, rJS, CodeMirror, RSVP));
\ No newline at end of file
<!DOCTYPE html>
<html manifest="gadget_code_mirror_editor.appcache">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Codemirror Gadget</title>
<script src="rsvp.js" type="text/javascript"></script>
<script src="renderjs.js" type="text/javascript"></script>
<link rel="stylesheet" href="codemirror/lib/codemirror.css">
<link rel="stylesheet" href="codemirror/addon/dialog/dialog.css">
<link rel="stylesheet" href="codemirror/addon/search/matchesonscrollbar.css">
<script src="codemirror/lib/codemirror.js"></script>
<script src="codemirror/mode/css/css.js"></script>
<script src="codemirror/mode/xml/xml.js"></script>
<script src="codemirror/mode/javascript/javascript.js"></script>
<script src="codemirror/mode/htmlmixed/htmlmixed.js"></script>
<script src="codemirror/addon/dialog/dialog.js"></script>
<script src="codemirror/addon/search/searchcursor.js"></script>
<script src="codemirror/addon/search/search.js"></script>
<script src="codemirror/addon/scroll/annotatescrollbar.js"></script>
<script src="codemirror/addon/search/matchesonscrollbar.js"></script>
<script src="gadget_code_mirror_editor.js" type="text/javascript"></script>
</head>
<body>
<div class="codemirror_gadget"><textarea name="code"></textarea></div>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html manifest="gadget_officejs_codemirror_install.appcache">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="gadget_erp5_nojqm.css">
<title> OfficeJS Install </title>
<script src="rsvp.js"></script>
<script src="renderjs.js"></script>
<script src="jiodev.js"></script>
<script src="gadget_officejs_install.js"></script>
</head>
<body>
<script data-install-configuration="document_version" type="text/x-renderjs-configuration">codemirror</script>
<script data-install-configuration="version_url" type="text/x-renderjs-configuration">codemirror/</script>
<script data-install-configuration="redirect_url" type="text/x-renderjs-configuration">code_mirror/</script>
<script data-install-configuration="cache_file" type="text/x-renderjs-configuration">gadget_code_mirror_editor.appcache</script>
<script data-install-configuration="app_name" type="text/x-renderjs-configuration">CodeMirror Editor</script>
</body>
</html>
\ No newline at end of file
erp5_officejs_connector
\ No newline at end of file
erp5_officejs_connector
erp5_code_mirror
\ No newline at end of file
web_page_module/gadget_ckeditor_*
web_page_module/gadget_officejs_*
web_page_module/gadget_ooffice_*
web_page_module/codemirror_*
web_page_module/codeeditor_*
web_site_module/officejs_text_editor
web_site_module/officejs_text_editor/**
web_site_module/officejs_spreadsheet
web_site_module/officejs_spreadsheet/**
web_site_module/officejs_setting_gadget
web_site_module/officejs_setting_gadget/**
\ No newline at end of file
web_site_module/officejs_setting_gadget/**
web_site_module/officejs_gadget_codemirror
web_site_module/officejs_gadget_codemirror/**
web_site_module/officejs_code_editor
web_site_module/officejs_code_editor/**
\ No newline at end of file
web_page_module/gadget_ckeditor_*
web_page_module/gadget_officejs_*
web_page_module/gadget_ooffice_*
web_page_module/codemirror_*
web_page_module/codeeditor_*
web_site_module/officejs_text_editor
web_site_module/officejs_text_editor/**
web_site_module/officejs_spreadsheet
web_site_module/officejs_spreadsheet/**
web_site_module/officejs_setting_gadget
web_site_module/officejs_setting_gadget/**
\ No newline at end of file
web_site_module/officejs_setting_gadget/**
web_site_module/officejs_gadget_codemirror
web_site_module/officejs_gadget_codemirror/**
web_site_module/officejs_code_editor
web_site_module/officejs_code_editor/**
\ No newline at end of file
web_page_module/codeeditor_*
web_page_module/codemirror_*
web_page_module/gadget_ckeditor_*
web_page_module/gadget_officejs_*
web_page_module/gadget_ooffice_*
web_site_module/officejs_code_editor
web_site_module/officejs_code_editor/**
web_site_module/officejs_gadget_codemirror
web_site_module/officejs_gadget_codemirror/**
web_site_module/officejs_setting_gadget
web_site_module/officejs_setting_gadget/**
web_site_module/officejs_spreadsheet
......
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