Top Level Namespace
Defined Under Namespace
Modules: DashingApi
Classes: HelperFunctions
Instance Method Summary
collapse
Instance Method Details
#addDeleteTileTemplate ⇒ Object
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
# File 'lib/dashing_api/helperFunctions.rb', line 31
def addDeleteTileTemplate()
%{
<script type='text/javascript'>
$(function myFunction() {
$('li').live('click', function(e) {
var widget = $(this).find('widget');
var url = widget.data('url');
window.open(url, '_blank', "width=900, height=900, scrollvars=yes, toolbar=yes, resizable=yes");
});
});
</script>
<div class="gridster">
<ul>
<% for i in 0..body.length-1%>
<%= body[i] %>
<% end %>
</ul>
</div>
}
end
|
#newDashboardTemplate ⇒ Object
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
# File 'lib/dashing_api/helperFunctions.rb', line 7
def newDashboardTemplate()
%{
<script type='text/javascript'>
$(function myFunction() {
$('li').live('click', function(e) {
var widget = $(this).find('widget');
var url = widget.data('url');
window.open(url, '_blank', "width=900, height=900, scrollvars=yes, toolbar=yes, resizable=yes");
});
});
</script>
<div class="gridster">
<ul>
<% for i in 0..body["tiles"]["hosts"].length-1 %>
<li data-row="1" data-col="1" data-sizex="2" data-sizey="2" onClick="myFunction()">
<div data-id="<%= body["tiles"]["hosts"][i] %>" data-view="<%= body["tiles"]["widgets"][i] %>" data-unordered="true" data-title="<%= body["tiles"]["titles"][i] %>" data-url="<%= body["tiles"]["urls"][i] %>" data-bind-style="status" style="style"></div>
</li>
<% end %>
</ul>
</div>
}
end
|