Commit 89f44c5c authored by Thibaut Frain's avatar Thibaut Frain

Added jquery.sheet gadget

parent 1d25262f
...@@ -226,6 +226,10 @@ module.exports = function (grunt) { ...@@ -226,6 +226,10 @@ module.exports = function (grunt) {
js_relative_url: "lib/<%= curl.jqueryte.directory %>/jquery-te-<%= curl.jqueryte.version %>.min.js", js_relative_url: "lib/<%= curl.jqueryte.directory %>/jquery-te-<%= curl.jqueryte.version %>.min.js",
dest: '<%= global_config.tmp %>/jQuery-TE.zip' dest: '<%= global_config.tmp %>/jQuery-TE.zip'
}, },
jquerysheet: {
src: 'https://jquerysheet.googlecode.com/files/jquery.sheet-2.0.0.zip',
dest: '<%= global_config.tmp %>/jquery_sheet.zip'
},
jquery: { jquery: {
src: 'http://code.jquery.com/jquery-2.0.3.js', src: 'http://code.jquery.com/jquery-2.0.3.js',
relative_dest: 'lib/jquery.js', relative_dest: 'lib/jquery.js',
...@@ -279,6 +283,10 @@ module.exports = function (grunt) { ...@@ -279,6 +283,10 @@ module.exports = function (grunt) {
jqueryte: { jqueryte: {
src: '<%= curl.jqueryte.dest %>', src: '<%= curl.jqueryte.dest %>',
dest: '<%= global_config.dest %>/lib/' dest: '<%= global_config.dest %>/lib/'
},
jquery_sheet: {
src: '<%= curl.jquerysheet.dest %>',
dest: '<%= global_config.dest %>/lib/'
} }
}, },
......
<!DOCTYPE html>
<html>
<head>
<meta content="text/html;charset=utf-8" http-equiv="Content-Type"/>
<meta content="utf-8" http-equiv="encoding"/>
<title>Jquery sheet</title>
<link rel="stylesheet" href="../lib/jquery.sheet-2.0.0/jquery.sheet.css">
<link rel="stylesheet" href="../lib/jquery.sheet-2.0.0/jquery-ui/theme/jquery-ui.css">
<script src="../lib/jquery.sheet-2.0.0/jquery-1.5.2.min.js"></script>
<script src="../lib/rsvp.min.js"></script>
<script src="../lib/renderjs.min.js"></script>
<script src="../lib/jquery.sheet-2.0.0/jquery.sheet.js"></script>
<script src="../lib/jquery.sheet-2.0.0/parser.js"></script>
<script src="jquery_sheet.js"></script>
</head>
<body>
<div class="jQuerySheet"></div>
</body>
</html>
/*global window, jQuery, rJS*/
(function (window, $, rJS) {
"use strict";
function init(config) {
this.parent = $('.jQuerySheet');
this.parent.sheet(config);
this.instance = this.parent.getSheet();
}
var default_config = {
id: "jquerysheet-div",
style: '',
jquerySheet: true,
jquerySheetCss: true,
parser: true,
jqueryUiCss: true,
scrollTo: false,
jQueryUI: false,
raphaelJs: false,
gRaphaelJs: false,
colorPicker: false,
colorPickerCss: false,
elastic: false,
advancedMath: false,
finance: false,
editable: true,
autoFiller: true,
urlMenu: '../lib/jquery.sheet-2.0.0/menu.html',
urlGet: 'new_spreadsheet.html'
};
rJS(window)
.declareMethod('getContent', function () {
var content = JSON.stringify($.sheet.instance[0].exportSheet.json());
return content;
})
.declareMethod('setContent', function (content) {
var config = $.extend({
buildSheet: $.sheet.makeTable.json(JSON.parse(content))
}, default_config);
init.apply(this, [config]);
})
.declareMethod('clearContent', function () {
$.sheet.killAll();
init.apply(this, [default_config]);
})
.ready(function (g) {
init.apply(g, [default_config]);
});
}(window, jQuery, rJS));
<TABLE title="Spreadsheet 1"
class="jSheet ui-widget-content"
border="1px"
cellpadding="0"
cellspacing="0">
<TBODY>
<TR height="18" style="height: 18px;">
<TD id="0_table0_cell_c0_r0" class=""></TD>
<TD id="0_table0_cell_c1_r0" class=""></TD>
<TD id="0_table0_cell_c2_r0" class=""></TD>
<TD id="0_table0_cell_c3_r0" class=""></TD>
<TD id="0_table0_cell_c4_r0" class=""></TD>
<TD id="0_table0_cell_c5_r0" class=""></TD>
</TR>
<TR height="18" style="height: 18px;">
<TD id="0_table0_cell_c0_r1" class=""></TD>
<TD id="0_table0_cell_c1_r1" class=""></TD>
<TD id="0_table0_cell_c2_r1" class=""></TD>
<TD id="0_table0_cell_c3_r1" class=""></TD>
<TD id="0_table0_cell_c4_r1" class=""></TD>
<TD id="0_table0_cell_c5_r1" class=""></TD>
</TR>
<TR height="18" style="height: 18px;">
<TD id="0_table0_cell_c0_r2" class=""></TD>
<TD id="0_table0_cell_c1_r2" class=""></TD>
<TD id="0_table0_cell_c2_r2" class=""></TD>
<TD id="0_table0_cell_c3_r2" class=""></TD>
<TD id="0_table0_cell_c4_r2" class=""></TD>
<TD id="0_table0_cell_c5_r2" class=""></TD>
</TR>
<TR height="18" style="height: 18px;">
<TD id="0_table0_cell_c0_r3" class=""></TD>
<TD id="0_table0_cell_c1_r3" class=""></TD>
<TD id="0_table0_cell_c2_r3" class=""></TD>
<TD id="0_table0_cell_c3_r3" class=""></TD>
<TD id="0_table0_cell_c4_r3" class=""></TD>
<TD id="0_table0_cell_c5_r3" class=""></TD>
</TR>
</TBODY>
</TABLE>
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