nano-lazar 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +1 -0
- data/Gemfile +8 -0
- data/LICENSE.md +596 -0
- data/README.md +52 -0
- data/VERSION +1 -0
- data/application.rb +185 -0
- data/bin/nano-lazar-start +8 -0
- data/bin/nano-lazar-start.sh +8 -0
- data/bin/nano-lazar-stop +5 -0
- data/bin/nano-lazar-stop.sh +52 -0
- data/config.ru +13 -0
- data/feature-filter.rb +36 -0
- data/helper.rb +1 -0
- data/nano-lazar.gemspec +31 -0
- data/npo.rb +11 -0
- data/public/css/bootstrap.min.css +6 -0
- data/public/css/images/black-asc.gif +0 -0
- data/public/css/images/black-desc.gif +0 -0
- data/public/css/images/black-unsorted.gif +0 -0
- data/public/css/images/bootstrap-black-unsorted.png +0 -0
- data/public/css/images/bootstrap-white-unsorted.png +0 -0
- data/public/css/images/dragtable-handle.png +0 -0
- data/public/css/images/dragtable-handle.svg +7 -0
- data/public/css/images/dropbox-asc-hovered.png +0 -0
- data/public/css/images/dropbox-asc.png +0 -0
- data/public/css/images/dropbox-desc-hovered.png +0 -0
- data/public/css/images/dropbox-desc.png +0 -0
- data/public/css/images/first.png +0 -0
- data/public/css/images/green-asc.gif +0 -0
- data/public/css/images/green-desc.gif +0 -0
- data/public/css/images/green-header.gif +0 -0
- data/public/css/images/green-unsorted.gif +0 -0
- data/public/css/images/ice-asc.gif +0 -0
- data/public/css/images/ice-desc.gif +0 -0
- data/public/css/images/ice-unsorted.gif +0 -0
- data/public/css/images/last.png +0 -0
- data/public/css/images/loading.gif +0 -0
- data/public/css/images/metro-black-asc.png +0 -0
- data/public/css/images/metro-black-desc.png +0 -0
- data/public/css/images/metro-loading.gif +0 -0
- data/public/css/images/metro-unsorted.png +0 -0
- data/public/css/images/metro-white-asc.png +0 -0
- data/public/css/images/metro-white-desc.png +0 -0
- data/public/css/images/next.png +0 -0
- data/public/css/images/prev.png +0 -0
- data/public/css/images/white-asc.gif +0 -0
- data/public/css/images/white-desc.gif +0 -0
- data/public/css/images/white-unsorted.gif +0 -0
- data/public/css/jquery-ui.css +1225 -0
- data/public/css/jquery-ui.theme.min.css +5 -0
- data/public/css/style.css +16 -0
- data/public/css/theme.bootstrap.min.css +1 -0
- data/public/css/theme.default.min.css +1 -0
- data/public/enm-workshop.html +468 -0
- data/public/enm-workshop.rst +98 -0
- data/public/fonts/glyphicons-halflings-regular.eot +0 -0
- data/public/fonts/glyphicons-halflings-regular.svg +288 -0
- data/public/fonts/glyphicons-halflings-regular.ttf +0 -0
- data/public/fonts/glyphicons-halflings-regular.woff +0 -0
- data/public/fonts/glyphicons-halflings-regular.woff2 +0 -0
- data/public/images/Email.png +0 -0
- data/public/images/Facebook.png +0 -0
- data/public/images/Google+.png +0 -0
- data/public/images/IST_logo_s.png +0 -0
- data/public/images/LinkedIn.png +0 -0
- data/public/images/Twitter.png +0 -0
- data/public/images/enm-sm.jpg +0 -0
- data/public/images/enm_logo.png +0 -0
- data/public/images/favicon.ico +0 -0
- data/public/images/ist_logo.png +0 -0
- data/public/images/wait30trans.gif +0 -0
- data/public/javascripts/bootstrap.min.js +7 -0
- data/public/javascripts/google_analytics.js +7 -0
- data/public/javascripts/jquery-1.11.2.min.js +4 -0
- data/public/javascripts/jquery-ui-1.10.3.custom.min.js +6 -0
- data/public/javascripts/jquery.bpopup.min.js +7 -0
- data/public/javascripts/jquery.doubleScroll.js +126 -0
- data/public/javascripts/jquery.tablesorter.min.js +2 -0
- data/public/javascripts/jquery.tablesorter.staticrow.min.js +1 -0
- data/public/javascripts/jquery.tablesorter.widgets.js +2917 -0
- data/public/javascripts/jquery.tools.min.js +5 -0
- data/public/javascripts/lazar-gui.js +11 -0
- data/public/javascripts/nanolazar.js +11 -0
- data/public/javascripts/widget-scroller.js +921 -0
- data/public/ui/small-white/blank.gif +0 -0
- data/public/ui/small-white/framing.css +24 -0
- data/public/ui/small-white/iepngfix.htc +42 -0
- data/public/ui/small-white/opera.css +8 -0
- data/public/ui/small-white/outline.css +16 -0
- data/public/ui/small-white/pretty.css +114 -0
- data/public/ui/small-white/print.css +24 -0
- data/public/ui/small-white/s5-core.css +11 -0
- data/public/ui/small-white/slides.css +10 -0
- data/public/ui/small-white/slides.js +558 -0
- data/unicorn.rb +2 -0
- data/views/layout.haml +95 -0
- data/views/license.haml +1 -0
- data/views/predict.haml +299 -0
- data/views/prediction.haml +152 -0
- metadata +235 -0
@@ -0,0 +1,558 @@
|
|
1
|
+
// S5 v1.1 slides.js -- released into the Public Domain
|
2
|
+
// Modified for Docutils (http://docutils.sf.net) by David Goodger
|
3
|
+
//
|
4
|
+
// Please see http://www.meyerweb.com/eric/tools/s5/credits.html for
|
5
|
+
// information about all the wonderful and talented contributors to this code!
|
6
|
+
|
7
|
+
var undef;
|
8
|
+
var slideCSS = '';
|
9
|
+
var snum = 0;
|
10
|
+
var smax = 1;
|
11
|
+
var slideIDs = new Array();
|
12
|
+
var incpos = 0;
|
13
|
+
var number = undef;
|
14
|
+
var s5mode = true;
|
15
|
+
var defaultView = 'slideshow';
|
16
|
+
var controlVis = 'visible';
|
17
|
+
|
18
|
+
var isIE = navigator.appName == 'Microsoft Internet Explorer' ? 1 : 0;
|
19
|
+
var isOp = navigator.userAgent.indexOf('Opera') > -1 ? 1 : 0;
|
20
|
+
var isGe = navigator.userAgent.indexOf('Gecko') > -1 && navigator.userAgent.indexOf('Safari') < 1 ? 1 : 0;
|
21
|
+
|
22
|
+
function hasClass(object, className) {
|
23
|
+
if (!object.className) return false;
|
24
|
+
return (object.className.search('(^|\\s)' + className + '(\\s|$)') != -1);
|
25
|
+
}
|
26
|
+
|
27
|
+
function hasValue(object, value) {
|
28
|
+
if (!object) return false;
|
29
|
+
return (object.search('(^|\\s)' + value + '(\\s|$)') != -1);
|
30
|
+
}
|
31
|
+
|
32
|
+
function removeClass(object,className) {
|
33
|
+
if (!object) return;
|
34
|
+
object.className = object.className.replace(new RegExp('(^|\\s)'+className+'(\\s|$)'), RegExp.$1+RegExp.$2);
|
35
|
+
}
|
36
|
+
|
37
|
+
function addClass(object,className) {
|
38
|
+
if (!object || hasClass(object, className)) return;
|
39
|
+
if (object.className) {
|
40
|
+
object.className += ' '+className;
|
41
|
+
} else {
|
42
|
+
object.className = className;
|
43
|
+
}
|
44
|
+
}
|
45
|
+
|
46
|
+
function GetElementsWithClassName(elementName,className) {
|
47
|
+
var allElements = document.getElementsByTagName(elementName);
|
48
|
+
var elemColl = new Array();
|
49
|
+
for (var i = 0; i< allElements.length; i++) {
|
50
|
+
if (hasClass(allElements[i], className)) {
|
51
|
+
elemColl[elemColl.length] = allElements[i];
|
52
|
+
}
|
53
|
+
}
|
54
|
+
return elemColl;
|
55
|
+
}
|
56
|
+
|
57
|
+
function isParentOrSelf(element, id) {
|
58
|
+
if (element == null || element.nodeName=='BODY') return false;
|
59
|
+
else if (element.id == id) return true;
|
60
|
+
else return isParentOrSelf(element.parentNode, id);
|
61
|
+
}
|
62
|
+
|
63
|
+
function nodeValue(node) {
|
64
|
+
var result = "";
|
65
|
+
if (node.nodeType == 1) {
|
66
|
+
var children = node.childNodes;
|
67
|
+
for (var i = 0; i < children.length; ++i) {
|
68
|
+
result += nodeValue(children[i]);
|
69
|
+
}
|
70
|
+
}
|
71
|
+
else if (node.nodeType == 3) {
|
72
|
+
result = node.nodeValue;
|
73
|
+
}
|
74
|
+
return(result);
|
75
|
+
}
|
76
|
+
|
77
|
+
function slideLabel() {
|
78
|
+
var slideColl = GetElementsWithClassName('*','slide');
|
79
|
+
var list = document.getElementById('jumplist');
|
80
|
+
smax = slideColl.length;
|
81
|
+
for (var n = 0; n < smax; n++) {
|
82
|
+
var obj = slideColl[n];
|
83
|
+
|
84
|
+
var did = 'slide' + n.toString();
|
85
|
+
if (obj.getAttribute('id')) {
|
86
|
+
slideIDs[n] = obj.getAttribute('id');
|
87
|
+
}
|
88
|
+
else {
|
89
|
+
obj.setAttribute('id',did);
|
90
|
+
slideIDs[n] = did;
|
91
|
+
}
|
92
|
+
if (isOp) continue;
|
93
|
+
|
94
|
+
var otext = '';
|
95
|
+
var menu = obj.firstChild;
|
96
|
+
if (!menu) continue; // to cope with empty slides
|
97
|
+
while (menu && menu.nodeType == 3) {
|
98
|
+
menu = menu.nextSibling;
|
99
|
+
}
|
100
|
+
if (!menu) continue; // to cope with slides with only text nodes
|
101
|
+
|
102
|
+
var menunodes = menu.childNodes;
|
103
|
+
for (var o = 0; o < menunodes.length; o++) {
|
104
|
+
otext += nodeValue(menunodes[o]);
|
105
|
+
}
|
106
|
+
list.options[list.length] = new Option(n + ' : ' + otext, n);
|
107
|
+
}
|
108
|
+
}
|
109
|
+
|
110
|
+
function currentSlide() {
|
111
|
+
var cs;
|
112
|
+
var footer_nodes;
|
113
|
+
var vis = 'visible';
|
114
|
+
if (document.getElementById) {
|
115
|
+
cs = document.getElementById('currentSlide');
|
116
|
+
footer_nodes = document.getElementById('footer').childNodes;
|
117
|
+
} else {
|
118
|
+
cs = document.currentSlide;
|
119
|
+
footer = document.footer.childNodes;
|
120
|
+
}
|
121
|
+
cs.innerHTML = '<span id="csHere">' + snum + '<\/span> ' +
|
122
|
+
'<span id="csSep">\/<\/span> ' +
|
123
|
+
'<span id="csTotal">' + (smax-1) + '<\/span>';
|
124
|
+
if (snum == 0) {
|
125
|
+
vis = 'hidden';
|
126
|
+
}
|
127
|
+
cs.style.visibility = vis;
|
128
|
+
for (var i = 0; i < footer_nodes.length; i++) {
|
129
|
+
if (footer_nodes[i].nodeType == 1) {
|
130
|
+
footer_nodes[i].style.visibility = vis;
|
131
|
+
}
|
132
|
+
}
|
133
|
+
}
|
134
|
+
|
135
|
+
function go(step) {
|
136
|
+
if (document.getElementById('slideProj').disabled || step == 0) return;
|
137
|
+
var jl = document.getElementById('jumplist');
|
138
|
+
var cid = slideIDs[snum];
|
139
|
+
var ce = document.getElementById(cid);
|
140
|
+
if (incrementals[snum].length > 0) {
|
141
|
+
for (var i = 0; i < incrementals[snum].length; i++) {
|
142
|
+
removeClass(incrementals[snum][i], 'current');
|
143
|
+
removeClass(incrementals[snum][i], 'incremental');
|
144
|
+
}
|
145
|
+
}
|
146
|
+
if (step != 'j') {
|
147
|
+
snum += step;
|
148
|
+
lmax = smax - 1;
|
149
|
+
if (snum > lmax) snum = lmax;
|
150
|
+
if (snum < 0) snum = 0;
|
151
|
+
} else
|
152
|
+
snum = parseInt(jl.value);
|
153
|
+
var nid = slideIDs[snum];
|
154
|
+
var ne = document.getElementById(nid);
|
155
|
+
if (!ne) {
|
156
|
+
ne = document.getElementById(slideIDs[0]);
|
157
|
+
snum = 0;
|
158
|
+
}
|
159
|
+
if (step < 0) {incpos = incrementals[snum].length} else {incpos = 0;}
|
160
|
+
if (incrementals[snum].length > 0 && incpos == 0) {
|
161
|
+
for (var i = 0; i < incrementals[snum].length; i++) {
|
162
|
+
if (hasClass(incrementals[snum][i], 'current'))
|
163
|
+
incpos = i + 1;
|
164
|
+
else
|
165
|
+
addClass(incrementals[snum][i], 'incremental');
|
166
|
+
}
|
167
|
+
}
|
168
|
+
if (incrementals[snum].length > 0 && incpos > 0)
|
169
|
+
addClass(incrementals[snum][incpos - 1], 'current');
|
170
|
+
ce.style.visibility = 'hidden';
|
171
|
+
ne.style.visibility = 'visible';
|
172
|
+
jl.selectedIndex = snum;
|
173
|
+
currentSlide();
|
174
|
+
number = 0;
|
175
|
+
}
|
176
|
+
|
177
|
+
function goTo(target) {
|
178
|
+
if (target >= smax || target == snum) return;
|
179
|
+
go(target - snum);
|
180
|
+
}
|
181
|
+
|
182
|
+
function subgo(step) {
|
183
|
+
if (step > 0) {
|
184
|
+
removeClass(incrementals[snum][incpos - 1],'current');
|
185
|
+
removeClass(incrementals[snum][incpos], 'incremental');
|
186
|
+
addClass(incrementals[snum][incpos],'current');
|
187
|
+
incpos++;
|
188
|
+
} else {
|
189
|
+
incpos--;
|
190
|
+
removeClass(incrementals[snum][incpos],'current');
|
191
|
+
addClass(incrementals[snum][incpos], 'incremental');
|
192
|
+
addClass(incrementals[snum][incpos - 1],'current');
|
193
|
+
}
|
194
|
+
}
|
195
|
+
|
196
|
+
function toggle() {
|
197
|
+
var slideColl = GetElementsWithClassName('*','slide');
|
198
|
+
var slides = document.getElementById('slideProj');
|
199
|
+
var outline = document.getElementById('outlineStyle');
|
200
|
+
if (!slides.disabled) {
|
201
|
+
slides.disabled = true;
|
202
|
+
outline.disabled = false;
|
203
|
+
s5mode = false;
|
204
|
+
fontSize('1em');
|
205
|
+
for (var n = 0; n < smax; n++) {
|
206
|
+
var slide = slideColl[n];
|
207
|
+
slide.style.visibility = 'visible';
|
208
|
+
}
|
209
|
+
} else {
|
210
|
+
slides.disabled = false;
|
211
|
+
outline.disabled = true;
|
212
|
+
s5mode = true;
|
213
|
+
fontScale();
|
214
|
+
for (var n = 0; n < smax; n++) {
|
215
|
+
var slide = slideColl[n];
|
216
|
+
slide.style.visibility = 'hidden';
|
217
|
+
}
|
218
|
+
slideColl[snum].style.visibility = 'visible';
|
219
|
+
}
|
220
|
+
}
|
221
|
+
|
222
|
+
function showHide(action) {
|
223
|
+
var obj = GetElementsWithClassName('*','hideme')[0];
|
224
|
+
switch (action) {
|
225
|
+
case 's': obj.style.visibility = 'visible'; break;
|
226
|
+
case 'h': obj.style.visibility = 'hidden'; break;
|
227
|
+
case 'k':
|
228
|
+
if (obj.style.visibility != 'visible') {
|
229
|
+
obj.style.visibility = 'visible';
|
230
|
+
} else {
|
231
|
+
obj.style.visibility = 'hidden';
|
232
|
+
}
|
233
|
+
break;
|
234
|
+
}
|
235
|
+
}
|
236
|
+
|
237
|
+
// 'keys' code adapted from MozPoint (http://mozpoint.mozdev.org/)
|
238
|
+
function keys(key) {
|
239
|
+
if (!key) {
|
240
|
+
key = event;
|
241
|
+
key.which = key.keyCode;
|
242
|
+
}
|
243
|
+
if (key.which == 84) {
|
244
|
+
toggle();
|
245
|
+
return;
|
246
|
+
}
|
247
|
+
if (s5mode) {
|
248
|
+
switch (key.which) {
|
249
|
+
case 10: // return
|
250
|
+
case 13: // enter
|
251
|
+
if (window.event && isParentOrSelf(window.event.srcElement, 'controls')) return;
|
252
|
+
if (key.target && isParentOrSelf(key.target, 'controls')) return;
|
253
|
+
if(number != undef) {
|
254
|
+
goTo(number);
|
255
|
+
break;
|
256
|
+
}
|
257
|
+
case 32: // spacebar
|
258
|
+
case 34: // page down
|
259
|
+
case 39: // rightkey
|
260
|
+
case 40: // downkey
|
261
|
+
if(number != undef) {
|
262
|
+
go(number);
|
263
|
+
} else if (!incrementals[snum] || incpos >= incrementals[snum].length) {
|
264
|
+
go(1);
|
265
|
+
} else {
|
266
|
+
subgo(1);
|
267
|
+
}
|
268
|
+
break;
|
269
|
+
case 33: // page up
|
270
|
+
case 37: // leftkey
|
271
|
+
case 38: // upkey
|
272
|
+
if(number != undef) {
|
273
|
+
go(-1 * number);
|
274
|
+
} else if (!incrementals[snum] || incpos <= 0) {
|
275
|
+
go(-1);
|
276
|
+
} else {
|
277
|
+
subgo(-1);
|
278
|
+
}
|
279
|
+
break;
|
280
|
+
case 36: // home
|
281
|
+
goTo(0);
|
282
|
+
break;
|
283
|
+
case 35: // end
|
284
|
+
goTo(smax-1);
|
285
|
+
break;
|
286
|
+
case 67: // c
|
287
|
+
showHide('k');
|
288
|
+
break;
|
289
|
+
}
|
290
|
+
if (key.which < 48 || key.which > 57) {
|
291
|
+
number = undef;
|
292
|
+
} else {
|
293
|
+
if (window.event && isParentOrSelf(window.event.srcElement, 'controls')) return;
|
294
|
+
if (key.target && isParentOrSelf(key.target, 'controls')) return;
|
295
|
+
number = (((number != undef) ? number : 0) * 10) + (key.which - 48);
|
296
|
+
}
|
297
|
+
}
|
298
|
+
return false;
|
299
|
+
}
|
300
|
+
|
301
|
+
function clicker(e) {
|
302
|
+
number = undef;
|
303
|
+
var target;
|
304
|
+
if (window.event) {
|
305
|
+
target = window.event.srcElement;
|
306
|
+
e = window.event;
|
307
|
+
} else target = e.target;
|
308
|
+
if (target.href != null || hasValue(target.rel, 'external') || isParentOrSelf(target, 'controls') || isParentOrSelf(target,'embed') || isParentOrSelf(target, 'object')) return true;
|
309
|
+
if (!e.which || e.which == 1) {
|
310
|
+
if (!incrementals[snum] || incpos >= incrementals[snum].length) {
|
311
|
+
go(1);
|
312
|
+
} else {
|
313
|
+
subgo(1);
|
314
|
+
}
|
315
|
+
}
|
316
|
+
}
|
317
|
+
|
318
|
+
function findSlide(hash) {
|
319
|
+
var target = document.getElementById(hash);
|
320
|
+
if (target) {
|
321
|
+
for (var i = 0; i < slideIDs.length; i++) {
|
322
|
+
if (target.id == slideIDs[i]) return i;
|
323
|
+
}
|
324
|
+
}
|
325
|
+
return null;
|
326
|
+
}
|
327
|
+
|
328
|
+
function slideJump() {
|
329
|
+
if (window.location.hash == null || window.location.hash == '') {
|
330
|
+
currentSlide();
|
331
|
+
return;
|
332
|
+
}
|
333
|
+
if (window.location.hash == null) return;
|
334
|
+
var dest = null;
|
335
|
+
dest = findSlide(window.location.hash.slice(1));
|
336
|
+
if (dest == null) {
|
337
|
+
dest = 0;
|
338
|
+
}
|
339
|
+
go(dest - snum);
|
340
|
+
}
|
341
|
+
|
342
|
+
function fixLinks() {
|
343
|
+
var thisUri = window.location.href;
|
344
|
+
thisUri = thisUri.slice(0, thisUri.length - window.location.hash.length);
|
345
|
+
var aelements = document.getElementsByTagName('A');
|
346
|
+
for (var i = 0; i < aelements.length; i++) {
|
347
|
+
var a = aelements[i].href;
|
348
|
+
var slideID = a.match('\#.+');
|
349
|
+
if ((slideID) && (slideID[0].slice(0,1) == '#')) {
|
350
|
+
var dest = findSlide(slideID[0].slice(1));
|
351
|
+
if (dest != null) {
|
352
|
+
if (aelements[i].addEventListener) {
|
353
|
+
aelements[i].addEventListener("click", new Function("e",
|
354
|
+
"if (document.getElementById('slideProj').disabled) return;" +
|
355
|
+
"go("+dest+" - snum); " +
|
356
|
+
"if (e.preventDefault) e.preventDefault();"), true);
|
357
|
+
} else if (aelements[i].attachEvent) {
|
358
|
+
aelements[i].attachEvent("onclick", new Function("",
|
359
|
+
"if (document.getElementById('slideProj').disabled) return;" +
|
360
|
+
"go("+dest+" - snum); " +
|
361
|
+
"event.returnValue = false;"));
|
362
|
+
}
|
363
|
+
}
|
364
|
+
}
|
365
|
+
}
|
366
|
+
}
|
367
|
+
|
368
|
+
function externalLinks() {
|
369
|
+
if (!document.getElementsByTagName) return;
|
370
|
+
var anchors = document.getElementsByTagName('a');
|
371
|
+
for (var i=0; i<anchors.length; i++) {
|
372
|
+
var anchor = anchors[i];
|
373
|
+
if (anchor.getAttribute('href') && hasValue(anchor.rel, 'external')) {
|
374
|
+
anchor.target = '_blank';
|
375
|
+
addClass(anchor,'external');
|
376
|
+
}
|
377
|
+
}
|
378
|
+
}
|
379
|
+
|
380
|
+
function createControls() {
|
381
|
+
var controlsDiv = document.getElementById("controls");
|
382
|
+
if (!controlsDiv) return;
|
383
|
+
var hider = ' onmouseover="showHide(\'s\');" onmouseout="showHide(\'h\');"';
|
384
|
+
var hideDiv, hideList = '';
|
385
|
+
if (controlVis == 'hidden') {
|
386
|
+
hideDiv = hider;
|
387
|
+
} else {
|
388
|
+
hideList = hider;
|
389
|
+
}
|
390
|
+
controlsDiv.innerHTML = '<form action="#" id="controlForm"' + hideDiv + '>' +
|
391
|
+
'<div id="navLinks">' +
|
392
|
+
'<a accesskey="t" id="toggle" href="javascript:toggle();">Ø<\/a>' +
|
393
|
+
'<a accesskey="z" id="prev" href="javascript:go(-1);">«<\/a>' +
|
394
|
+
'<a accesskey="x" id="next" href="javascript:go(1);">»<\/a>' +
|
395
|
+
'<div id="navList"' + hideList + '><select id="jumplist" onchange="go(\'j\');"><\/select><\/div>' +
|
396
|
+
'<\/div><\/form>';
|
397
|
+
if (controlVis == 'hidden') {
|
398
|
+
var hidden = document.getElementById('navLinks');
|
399
|
+
} else {
|
400
|
+
var hidden = document.getElementById('jumplist');
|
401
|
+
}
|
402
|
+
addClass(hidden,'hideme');
|
403
|
+
}
|
404
|
+
|
405
|
+
function fontScale() { // causes layout problems in FireFox that get fixed if browser's Reload is used; same may be true of other Gecko-based browsers
|
406
|
+
if (!s5mode) return false;
|
407
|
+
var vScale = 22; // both yield 32 (after rounding) at 1024x768
|
408
|
+
var hScale = 32; // perhaps should auto-calculate based on theme's declared value?
|
409
|
+
if (window.innerHeight) {
|
410
|
+
var vSize = window.innerHeight;
|
411
|
+
var hSize = window.innerWidth;
|
412
|
+
} else if (document.documentElement.clientHeight) {
|
413
|
+
var vSize = document.documentElement.clientHeight;
|
414
|
+
var hSize = document.documentElement.clientWidth;
|
415
|
+
} else if (document.body.clientHeight) {
|
416
|
+
var vSize = document.body.clientHeight;
|
417
|
+
var hSize = document.body.clientWidth;
|
418
|
+
} else {
|
419
|
+
var vSize = 700; // assuming 1024x768, minus chrome and such
|
420
|
+
var hSize = 1024; // these do not account for kiosk mode or Opera Show
|
421
|
+
}
|
422
|
+
var newSize = Math.min(Math.round(vSize/vScale),Math.round(hSize/hScale));
|
423
|
+
fontSize(newSize + 'px');
|
424
|
+
if (isGe) { // hack to counter incremental reflow bugs
|
425
|
+
var obj = document.getElementsByTagName('body')[0];
|
426
|
+
obj.style.display = 'none';
|
427
|
+
obj.style.display = 'block';
|
428
|
+
}
|
429
|
+
}
|
430
|
+
|
431
|
+
function fontSize(value) {
|
432
|
+
if (!(s5ss = document.getElementById('s5ss'))) {
|
433
|
+
if (!isIE) {
|
434
|
+
document.getElementsByTagName('head')[0].appendChild(s5ss = document.createElement('style'));
|
435
|
+
s5ss.setAttribute('media','screen, projection');
|
436
|
+
s5ss.setAttribute('id','s5ss');
|
437
|
+
} else {
|
438
|
+
document.createStyleSheet();
|
439
|
+
document.s5ss = document.styleSheets[document.styleSheets.length - 1];
|
440
|
+
}
|
441
|
+
}
|
442
|
+
if (!isIE) {
|
443
|
+
while (s5ss.lastChild) s5ss.removeChild(s5ss.lastChild);
|
444
|
+
s5ss.appendChild(document.createTextNode('body {font-size: ' + value + ' !important;}'));
|
445
|
+
} else {
|
446
|
+
document.s5ss.addRule('body','font-size: ' + value + ' !important;');
|
447
|
+
}
|
448
|
+
}
|
449
|
+
|
450
|
+
function notOperaFix() {
|
451
|
+
slideCSS = document.getElementById('slideProj').href;
|
452
|
+
var slides = document.getElementById('slideProj');
|
453
|
+
var outline = document.getElementById('outlineStyle');
|
454
|
+
slides.setAttribute('media','screen');
|
455
|
+
outline.disabled = true;
|
456
|
+
if (isGe) {
|
457
|
+
slides.setAttribute('href','null'); // Gecko fix
|
458
|
+
slides.setAttribute('href',slideCSS); // Gecko fix
|
459
|
+
}
|
460
|
+
if (isIE && document.styleSheets && document.styleSheets[0]) {
|
461
|
+
document.styleSheets[0].addRule('img', 'behavior: url(ui/small-white/iepngfix.htc)');
|
462
|
+
document.styleSheets[0].addRule('div', 'behavior: url(ui/small-white/iepngfix.htc)');
|
463
|
+
document.styleSheets[0].addRule('.slide', 'behavior: url(ui/small-white/iepngfix.htc)');
|
464
|
+
}
|
465
|
+
}
|
466
|
+
|
467
|
+
function getIncrementals(obj) {
|
468
|
+
var incrementals = new Array();
|
469
|
+
if (!obj)
|
470
|
+
return incrementals;
|
471
|
+
var children = obj.childNodes;
|
472
|
+
for (var i = 0; i < children.length; i++) {
|
473
|
+
var child = children[i];
|
474
|
+
if (hasClass(child, 'incremental')) {
|
475
|
+
if (child.nodeName == 'OL' || child.nodeName == 'UL') {
|
476
|
+
removeClass(child, 'incremental');
|
477
|
+
for (var j = 0; j < child.childNodes.length; j++) {
|
478
|
+
if (child.childNodes[j].nodeType == 1) {
|
479
|
+
addClass(child.childNodes[j], 'incremental');
|
480
|
+
}
|
481
|
+
}
|
482
|
+
} else {
|
483
|
+
incrementals[incrementals.length] = child;
|
484
|
+
removeClass(child,'incremental');
|
485
|
+
}
|
486
|
+
}
|
487
|
+
if (hasClass(child, 'show-first')) {
|
488
|
+
if (child.nodeName == 'OL' || child.nodeName == 'UL') {
|
489
|
+
removeClass(child, 'show-first');
|
490
|
+
if (child.childNodes[isGe].nodeType == 1) {
|
491
|
+
removeClass(child.childNodes[isGe], 'incremental');
|
492
|
+
}
|
493
|
+
} else {
|
494
|
+
incrementals[incrementals.length] = child;
|
495
|
+
}
|
496
|
+
}
|
497
|
+
incrementals = incrementals.concat(getIncrementals(child));
|
498
|
+
}
|
499
|
+
return incrementals;
|
500
|
+
}
|
501
|
+
|
502
|
+
function createIncrementals() {
|
503
|
+
var incrementals = new Array();
|
504
|
+
for (var i = 0; i < smax; i++) {
|
505
|
+
incrementals[i] = getIncrementals(document.getElementById(slideIDs[i]));
|
506
|
+
}
|
507
|
+
return incrementals;
|
508
|
+
}
|
509
|
+
|
510
|
+
function defaultCheck() {
|
511
|
+
var allMetas = document.getElementsByTagName('meta');
|
512
|
+
for (var i = 0; i< allMetas.length; i++) {
|
513
|
+
if (allMetas[i].name == 'defaultView') {
|
514
|
+
defaultView = allMetas[i].content;
|
515
|
+
}
|
516
|
+
if (allMetas[i].name == 'controlVis') {
|
517
|
+
controlVis = allMetas[i].content;
|
518
|
+
}
|
519
|
+
}
|
520
|
+
}
|
521
|
+
|
522
|
+
// Key trap fix, new function body for trap()
|
523
|
+
function trap(e) {
|
524
|
+
if (!e) {
|
525
|
+
e = event;
|
526
|
+
e.which = e.keyCode;
|
527
|
+
}
|
528
|
+
try {
|
529
|
+
modifierKey = e.ctrlKey || e.altKey || e.metaKey;
|
530
|
+
}
|
531
|
+
catch(e) {
|
532
|
+
modifierKey = false;
|
533
|
+
}
|
534
|
+
return modifierKey || e.which == 0;
|
535
|
+
}
|
536
|
+
|
537
|
+
function startup() {
|
538
|
+
defaultCheck();
|
539
|
+
if (!isOp) createControls();
|
540
|
+
slideLabel();
|
541
|
+
fixLinks();
|
542
|
+
externalLinks();
|
543
|
+
fontScale();
|
544
|
+
if (!isOp) {
|
545
|
+
notOperaFix();
|
546
|
+
incrementals = createIncrementals();
|
547
|
+
slideJump();
|
548
|
+
if (defaultView == 'outline') {
|
549
|
+
toggle();
|
550
|
+
}
|
551
|
+
document.onkeyup = keys;
|
552
|
+
document.onkeypress = trap;
|
553
|
+
document.onclick = clicker;
|
554
|
+
}
|
555
|
+
}
|
556
|
+
|
557
|
+
window.onload = startup;
|
558
|
+
window.onresize = function(){setTimeout('fontScale()', 50);}
|
data/unicorn.rb
ADDED
data/views/layout.haml
ADDED
@@ -0,0 +1,95 @@
|
|
1
|
+
!!!
|
2
|
+
%html{:xmlns => "http://www.w3.org/1999/xhtml", "xml:lang" => "en", :lang => "en"}
|
3
|
+
%head
|
4
|
+
%meta{'charset'=>"utf-8"}
|
5
|
+
%meta{'http-equiv'=>"X-UA-Compatible", :content=>"IE=edge"}
|
6
|
+
%meta{'name'=>"viewport", :content=>"width=device-width, initial-scale=1"}
|
7
|
+
%title Nano Lazar Toxicity Predictions
|
8
|
+
%link{:rel=>'icon', :type=>'image/x-icon', :href=>'/images/favicon.ico'}
|
9
|
+
%link{:rel=>'stylesheet', :href=>"#{'/css/style.css'}"}
|
10
|
+
%link{:rel=>'stylesheet', :href=>"#{'/css/bootstrap.min.css'}"}
|
11
|
+
%link{:rel=>'stylesheet', :href=>"#{'/css/theme.bootstrap.min.css'}"}
|
12
|
+
%link{:rel=>'stylesheet', :href=>"#{'/css/theme.default.min.css'}"}
|
13
|
+
%script{:src=>"/javascripts/jquery-1.11.2.min.js"}
|
14
|
+
%script{:src=>"/javascripts/jquery.tablesorter.min.js"}
|
15
|
+
%script{:src=>"/javascripts/jquery.tablesorter.widgets.js"}
|
16
|
+
%script{:src=>"/javascripts/jquery.tablesorter.staticrow.min.js"}
|
17
|
+
%script{:src=>"/javascripts/jquery.doubleScroll.js"}
|
18
|
+
%script{:src=>"/javascripts/bootstrap.min.js"}
|
19
|
+
%script{:src=>"/javascripts/nanolazar.js"}
|
20
|
+
%script{:src=>"/javascripts/google_analytics.js"}
|
21
|
+
%body
|
22
|
+
%noscript
|
23
|
+
%div{ :style=>"width: 22em; position: absolute; left: 50%; margin-left: -11em; color: red; background-color: white; border: 1px solid red; padding: 4px; font-family: sans-serif"}
|
24
|
+
Your web browser must have JavaScript enabled in order for this application to display correctly.
|
25
|
+
%header.page-header{:style=>"margin:20px 0 20px;"}
|
26
|
+
%div.row{:style=>"display:flex;flex-direction:row;align-items:center;justify-content:center"}
|
27
|
+
%div.col-sm-2
|
28
|
+
%a{:href=> to("/predict")}
|
29
|
+
%img.media-object{:src=>"/images/IST_logo_s.png", :alt=>"logo_ist", :width=>"150px", :heigth=>"150px", :style=>"margin:0 0 0 1em;"}
|
30
|
+
%div.col-sm-2
|
31
|
+
%a{:href=> "http://www.enanomapper.net"}
|
32
|
+
%img.media-object{:src=>"/images/enm_logo.png", :width=>"150px", :heigth=>"150px", :alt=>"logo_enm", :style=>"margin:0 0 0 1em;"}
|
33
|
+
%div.col-sm-6
|
34
|
+
%h1.media-heading{:style=>"margin:0 0 0 1em;"} nano-lazar toxicity predictions
|
35
|
+
%div.col-sm-2
|
36
|
+
%h1.media-heading{:style=>"margin:0 0 0 1em;"}
|
37
|
+
%small
|
38
|
+
%a{:href=>"https://lazar.in-silico.ch/predict", :rel=>"external"} lazar
|
39
|
+
|
40
|
+
%div.container-fluid
|
41
|
+
%topline
|
42
|
+
%div.row
|
43
|
+
%div.col-md-8
|
44
|
+
Problems, bugs, ideas for improvements ? Please report at our
|
45
|
+
%a{:href => 'https://github.com/enanomapper/nano-lazar/issues', :rel => "external"} issue tracker
|
46
|
+
or send us an email
|
47
|
+
%a{ :href=>"mailto:info@in-silico.ch?subject=[nano-lazar v#{@version}]", :target=>"_top"}
|
48
|
+
%img.share{:src=>"/images/Email.png"}
|
49
|
+
(version #{@version}).
|
50
|
+
%div.col-md-2
|
51
|
+
%div.col-md-2
|
52
|
+
%a{:href=>"https://twitter.com/intent/tweet?source=http%3A%2F%2Flazar.in-silico.ch&text=:%20http%3A%2F%2Flazar.in-silico.ch", :target=>"_blank", :title=>"Tweet"}
|
53
|
+
%img.share{:src=>"/images/Twitter.png"}
|
54
|
+
%a{:href=>"https://plus.google.com/share?url=http%3A%2F%2Flazar.in-silico.ch", :target=>"_blank", :title=>"Share on Google+"}
|
55
|
+
%img.share{:src=>"/images/Google+.png"}
|
56
|
+
%a{:href=>"http://www.linkedin.com/shareArticle?mini=true&url=http%3A%2F%2Flazar.in-silico.ch&title=&summary=&source=http%3A%2F%2Flazar.in-silico.ch", :target=>"_blank", :title=>"Share on LinkedIn"}
|
57
|
+
%img.share{:src=>"/images/LinkedIn.png"}
|
58
|
+
%a{:href=>"https://www.facebook.com/sharer/sharer.php?u=http%3A%2F%2Flazar.in-silico.ch&title=&summary=&source=http%3A%2F%2Flazar.in-silico.ch", :target=>"_blank", :title=>"Share on Facebook"}
|
59
|
+
%img.share{:src=>"/images/Facebook.png"}
|
60
|
+
:javascript
|
61
|
+
$(document).ready(function(){
|
62
|
+
$("#back-top").hide();
|
63
|
+
});
|
64
|
+
|
65
|
+
= yield
|
66
|
+
|
67
|
+
%footer.footer
|
68
|
+
%div.container-fluid
|
69
|
+
%p.text-muted
|
70
|
+
©
|
71
|
+
%a{:href => 'http://www.in-silico.ch', :rel => "external"} <i style="font-family: serife">in silico</i> toxicology gmbh 2014 - #{Time.now.year.to_s}
|
72
|
+
|
|
73
|
+
%a{:href => to("/license"), :rel => "external"} GPL3 License
|
74
|
+
|
75
|
+
#back-top{:style => "z-index:100;position:fixed;bottom:1%;right:1%;"}
|
76
|
+
%a{:href => "", :style=>"text:decoration:none;color:#ccc;"}
|
77
|
+
%span.glyphicon.glyphicon-circle-arrow-up{:style => "font-size:3em;color:black;"}
|
78
|
+
:javascript
|
79
|
+
$("#back-top").hide();
|
80
|
+
$(function () {
|
81
|
+
$(window).scroll(function () {
|
82
|
+
if ($(this).scrollTop() > 600) {
|
83
|
+
$('#back-top').fadeIn();
|
84
|
+
} else {
|
85
|
+
$('#back-top').fadeOut();
|
86
|
+
}
|
87
|
+
});
|
88
|
+
// scroll body to 0px on click
|
89
|
+
$('#back-top a').click(function () {
|
90
|
+
$('body,html').animate({
|
91
|
+
scrollTop: 0
|
92
|
+
}, 500);
|
93
|
+
return false;
|
94
|
+
});
|
95
|
+
});
|
data/views/license.haml
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
= @license
|