forked from Spreadsheets/WickedGrid
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjquery.sheet.html
More file actions
347 lines (319 loc) · 15.6 KB
/
jquery.sheet.html
File metadata and controls
347 lines (319 loc) · 15.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=Edge"/>
<meta http-equiv="Pragma" content="no-cache"/>
<meta http-equiv="Expires" content="-1"/>
<meta content="text/html;charset=utf-8" http-equiv="Content-Type"/>
<meta content="utf-8" http-equiv="encoding"/>
<title>jQuery.sheet - The Ajax Spreadsheet</title>
<!--dependencies-->
<link rel="stylesheet" type="text/css" href="jquery.sheet.css">
<link rel="stylesheet" type="text/css" href="bower_components/jquery-ui/themes/start/jquery-ui.min.css">
<link rel="stylesheet" type="text/css" href="bower_components/bootstrap/dist/css/bootstrap.css">
<link rel="stylesheet" type="text/css" href="bower_components/bootstrap/dist/css/bootstrap-theme.css">
<script src="bower_components/jquery-legacy/dist/jquery.min.js"></script>
<script src="bower_components/globalize/lib/globalize.js"></script>
<script src="bower_components/MouseWheel/MouseWheel.js"></script>
<script src="bower_components/thaw.js/thaw.js"></script>
<script src="jquery.sheet.js"></script>
<!--optional-->
<!--Nearest-->
<script src="bower_components/jquery-nearest/src/jquery.nearest.min.js"></script>
<!--/Nearest-->
<!--jQuery UI-->
<script src="bower_components/jquery-ui/jquery-ui.min.js"></script>
<!--/jQuery UI-->
<!--Raphaeljs - for charts-->
<script src="bower_components/raphael/raphael-min.js"></script>
<script src="bower_components/graphael/g.raphael.js"></script>
<script src="bower_components/graphael/g.bar.js"></script>
<script src="bower_components/graphael/g.dot.js"></script>
<script src="bower_components/graphael/g.line.js"></script>
<script src="bower_components/graphael/g.pie.js"></script>
<!--/Raphaeljs-->
<!--ColorPicker-->
<link rel="stylesheet" type="text/css" href="bower_components/really-simple-color-picker/colorPicker.css" />
<script src="bower_components/really-simple-color-picker/jquery.colorPicker.min.js"></script>
<!--/ColorPicker-->
<!--Elastic-->
<script src="bower_components/jquery-elastic/jquery.elastic.source.js"></script>
<!--/Elastic-->
<!--Advanced_Math-->
<script src="plugins/jquery.sheet.advancedfn.js"></script>
<!--/Advanced_Math-->
<!--Finance-->
<script src="plugins/jquery.sheet.financefn.js"></script>
<!--/Finance-->
<!--Undo-->
<script src="bower_components/Javascript-Undo-Manager/js/undomanager.js"></script>
<!--/Undo-->
<!--Zero Clipboard-->
<script src="bower_components/zeroclipboard/dist/ZeroClipboard.min.js"></script>
<!--/Zero Clipboard-->
<script>
$(function(){
var parseHtml = function(html, selector) {
var parent = document.createElement('div');
parent.innerHTML = html;
if (selector) {
return parent.querySelector(selector);
}
return parent.children;
};
//Here is where we initiate the sheets
//every time sheet is created it creates a new jQuery.sheet.instance (array), to manipulate each sheet, the jQuery object is returned
window.loadSheet = function (loadWhat) {
var url;
switch (typeof loadWhat) {
case 'object':
url = $(loadWhat).attr('href');
break;
case 'string':
url = loadWhat;
break;
}
$.when(
$.get(url),
$.get('menu.left.html'),
$.get('menu.right.html')
).done(function(sheet, menuLeft, menuRight) {
$('#sheet')
.html(parseHtml(sheet[0], 'div#sheetParent table'))
.sheet({
title: 'Demo',
menuLeft: function() {
var jS = this,
menu = $(menuLeft[0]),
copy = menu.find('.jSCopy').mouseover(function() { $(this).one('mouseout', function() {return false;})}),
cut = menu.find('.jSCut').mouseover(function() { $(this).one('mouseout', function() {return false;})}),
paste = menu.find('.jSPaste').click(function() {
alert('Press Ctrl + V to paste over highlighted cells');
});
//Give anchors access to jS them
menu.find('a').each(function() {
this.jS = jS;
});
var clip = new ZeroClipboard(copy.add(cut), {
moviePath: "plugins/ZeroClipboard.swf"
});
clip.on('mousedown', function(client) {
clip.setText(jS.tdsToTsv());
$(this).mousedown();
});
cut.mousedown(function() {
jS.tdsToTsv(null, true);
});
return menu;
},
menuRight: function (){
var jS = this,
//we want to be able to edit the html for the menu to make them multi-instance
menu = $(menuRight[0]);
//Give anchors access to jS them
menu.find('a').each(function() {
this.jS = jS;
});
//The following is just so you get an idea of how to style cells
var colorPickerCell = menu.find('.colorPickerCell')
.colorPicker()
.change(function(){
jS.cellChangeStyle('background-color', $(this).val());
}),
colorPickerFont = menu.find('.colorPickerFont')
.colorPicker()
.change(function(){
jS.cellChangeStyle('color', $(this).val());
});
colorPickerCell.next()
.html($('<img>').attr('src', colorPickerCell.attr('data-img')));
colorPickerFont.next()
.html($('<img>').attr('src', colorPickerFont.attr('data-img')));
return menu;
}
});
});
};
loadSheet('examples/charts.html');
$('#pseudoSheetsMoreInfo').click(function() {
$(this).next().dialog({
title: "What is a pseudo sheet?",
modal: true
});
})
.next().hide();
});
</script>
<!--Page styles-->
<style>
body {
background-color: #464646;
padding: 0px;
margin: 0px;
padding-bottom: 100px;
color: black;
font-family: sans-serif;
font-size: 13px;
}
.wrapper {
margin: 10px;
background-color: #CCCCCC;
}
.locked {
position: fixed;
top: expression(eval(document.body.scrollTop) + "px");
left: 20px;
}
#lockedMenu
{
width: 225px;
background-image: none;
}
#lockedMenu * {
font-size: .95em ! important;
text-decoration: none;
}
#header {
text-align: left;
font-size: 1.5em;
padding: 18px;
border: none;
padding-left: 150px;
}
#footer {
text-align: center;
color: white;
font-size: .9em;
}
#footer a {
font-size: 1.2em;
color: #FFFFFF;
}
</style>
</head>
<body>
<h1 id="header" class="ui-state-default">
<a href="http://visop-dev.com/Project+jQuery.sheet">
<img src="images/logo.png" style="position: absolute;top: -20px; left: 20px; border: none;" />
jQuery.sheet - The Ajax Spreadsheet, Demo
</a>
<br />
<span id="themeSwitcher"></span>
</h1>
<div id="mainWrapper" class="ui-corner-all wrapper">
<table style="width: 100%;">
<tr>
<td rowspan="2" style="width: 170px; vertical-align: top;">
<div id="lockedMenu" class="ui-widget-header ui-corner-all">
<h2 style="width: 100%; text-align: center;">Spreadsheets</h2>
<ul style="padding-left: 15px;">
<li>
<a href="examples/lazy.load.test.html">Lazy Load</a>
</li>
<li>
<a href="examples/charts.html" onclick="loadSheet(this);return false;">Charts</a>
</li>
<li>
<a href="examples/inputs.html" onclick="loadSheet(this);return false;">Inputs</a>
</li>
<li>
<a href="examples/inputs.get.html">Get Inputs</a>
</li>
<li>
<a href="examples/dates.html" onclick="loadSheet(this);return false;">Dates</a>
</li>
<li>
<a href="examples/empty.html" onclick="loadSheet(this);return false;">Empty</a>
</li>
<li>
<a href="examples/events.html">Javascript Events</a>
</li>
<li>
<a href="examples/financial.html" onclick="loadSheet(this);return false;">Financial</a>
</li>
<li>
<a href="examples/information.html" onclick="loadSheet(this);return false;">Information</a>
</li>
<li>
<a href="examples/logical.html" onclick="loadSheet(this);return false;">Logical</a>
</li>
<li>
<a href="examples/math.html" onclick="loadSheet(this); return false;">Math</a>
</li>
<li>
<a href="examples/globalize.html">Number and Date Culture Formats</a>
</li>
<li>
<a href="examples/mild.stress.test.html" onclick="loadSheet(this); return false;">Mild Stress Test</a>
</li>
<li>
<a href="examples/mortgage.estimator.html" onclick="loadSheet(this); return false;">Mortgage Estimator</a>
</li>
<li>
<a href="examples/not.editable.html" onclick="loadSheet(this); return false;">Not Editable</a>
</li>
<li>
<a href="examples/readonly.html" onclick="loadSheet(this); return false;">Read Only (partially, formula's don't do anything)</a>
</li>
<li>
<a href="examples/statistical.html" onclick="loadSheet(this); return false;">Statistical</a>
</li>
<li>
<a href="examples/sort.html">Sorting</a>
</li>
<li>
<a href="examples/string.html" onclick="loadSheet(this); return false;">String</a>
</li>
<li>
<a href="examples/cells.hidden.html" onclick="loadSheet(this); return false;">Hidden Cells</a>
</li>
<li>
<a href="examples/cells.merged.html" onclick="loadSheet(this); return false;">Merged Cells</a>
</li>
<li>
<a href="examples/toggle.state.html">Toggle State</a>
</li>
<li>
<a href="examples/dts.test.html">Json & XML Data Transformation Services</a>
</li>
<li>
<a href="examples/behavior.testing.html">Cross Browser Behavior Unit Test</a>
</li>
</ul>
<div style="text-align: center;">
<a href="http://visop-dev.com/Project+jQuery.sheet">Project Home | Download</a>
</div>
<br />
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" style="width: 100%; text-align: center;padding-bottom: 5px;">
<input type="hidden" name="cmd" value="_s-xclick" />
<input type="hidden" name="hosted_button_id" value="X9USQZEMU9934" />
<input type="submit" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only ui-state-highlight" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!" value="DONATE"/>
<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1" />
</form>
</div>
</td>
</tr>
<tr>
<td colspan="2" style="vertical-align: top;">
<div id="sheet" class="jQuerySheet" style="height: 450px;"></div>
</td>
</tr>
</table>
</div>
<div id="footer" class="ui-corner-all">
<a href="http://visop-dev.com/Project+jQuery.sheet">jQuery.sheet() The Ajax Spreadsheet</a>
| <a href="http://visop-dev.com/contact+us">Get Support!</a>
| <a href="http://www.VisOp-Dev.com">Home</a>
| <a href="https://github.com/Spreadsheets/jQuery.sheet/">Code</a>
| <a href="http://visop-dev.com/doc/js3/index.html">Developer Documentation</a>
| <a href="http://visop-dev.com/jQuery.sheet+-+End+User+Documentation">End User Documentation</a>
| <a href="http://jqueryui.com/themeroller/">Create your own theme</a>
<br/>
<a href="http://www.opensource.org/licenses/mit-license.html">MIT license</a>
<br>
<br>
<br>
<div>Icons made by Freepik, Elegant Themes, Zurb, Icomoon, SimpleIcon, Catalin Fertu from <a href="http://www.flaticon.com" title="Flaticon">www.flaticon.com</a></div>
</div>
</body>
</html>