Commit e8b75933 authored by Romain Courteaud's avatar Romain Courteaud

Add aloha editor gadget.

parent ffb9eb4a
...@@ -193,6 +193,16 @@ module.exports = function (grunt) { ...@@ -193,6 +193,16 @@ module.exports = function (grunt) {
relative_dest: 'lib/dygraphdata.js', relative_dest: 'lib/dygraphdata.js',
dest: '<%= global_config.dest %>/<%= curl.dygraphdata.relative_dest %>' dest: '<%= global_config.dest %>/<%= curl.dygraphdata.relative_dest %>'
}, },
aloha: {
src: 'http://aloha-editor.org/builds/stable/alohaeditor-0.25.7.zip',
relative_url: "lib/ace-builds-3bfda31096cf3f42b77aac64eb788584ea796822/src-min/ace.js",
directory: "alohaeditor-0.25.7/aloha",
css_relative_dest: "lib/<%= curl.aloha.directory %>/css/aloha.css",
require_relative_dest: "lib/<%= curl.aloha.directory %>/lib/require.js",
jquery_relative_dest: "lib/<%= curl.aloha.directory %>/lib/vendor/jquery-1.7.2.js",
js_relative_dest: "lib/<%= curl.aloha.directory %>/lib/aloha.js",
dest: '<%= global_config.tmp %>/alohaeditor.zip'
},
ace: { ace: {
src: 'https://github.com/ajaxorg/ace-builds/archive/3bfda31096cf3f42b77aac64eb788584ea796822.zip', src: 'https://github.com/ajaxorg/ace-builds/archive/3bfda31096cf3f42b77aac64eb788584ea796822.zip',
relative_url: "lib/ace-builds-3bfda31096cf3f42b77aac64eb788584ea796822/src-min/ace.js", relative_url: "lib/ace-builds-3bfda31096cf3f42b77aac64eb788584ea796822/src-min/ace.js",
...@@ -248,6 +258,10 @@ module.exports = function (grunt) { ...@@ -248,6 +258,10 @@ module.exports = function (grunt) {
}, },
unzip: { unzip: {
aloha: {
src: '<%= curl.aloha.dest %>',
dest: '<%= global_config.dest %>/lib/'
},
ace: { ace: {
src: '<%= curl.ace.dest %>', src: '<%= curl.ace.dest %>',
dest: '<%= global_config.dest %>/lib/' dest: '<%= global_config.dest %>/lib/'
......
/*global Aloha, rJS, jQuery */
(function (window, rJS, Aloha, $) {
"use strict";
rJS(window)
.declareMethod('setContent', function (value) {
$('#editor').empty().append(value);
})
.declareMethod('getContent', function () {
return $('#editor').html();
})
.ready(function (g) {
Aloha.ready(function () {
Aloha.jQuery('#editor').aloha();
});
});
}(window, rJS, Aloha, jQuery));
<!DOCTYPE html>
<html lang="en">
<head>
<title>Aloha Editor</title>
<!-- Load Aloha Editor css and js -->
<link rel="stylesheet" href="../<%= curl.aloha.css_relative_dest %>" type="text/css"/>
<!-- exports require() and define() into the global namespace -->
<script src="../<%= curl.aloha.require_relative_dest %>" type="text/javascript"></script>
<!-- defines the 'jquery' module -->
<script src="../<%= curl.aloha.jquery_relative_dest %>" type="text/javascript"></script>
<!-- uses the 'jquery' module defined above -->
<script src="../<%= curl.aloha.js_relative_dest %>"
data-aloha-plugins="common/ui,common/format,common/highlighteditables,common/link,common/image,common/list,common/table"></script>
<script src="../<%= copy.rsvp.relative_dest %>" type="text/javascript"></script>
<script src="../<%= copy.renderjs.relative_dest %>" type="text/javascript"></script>
<script src="aloha.js"></script>
</head>
<body>
<div id="editor"></div>
</body>
</html>
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