forked from oazabir/Droptiles
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDemo.html
More file actions
139 lines (113 loc) · 5.04 KB
/
Demo.html
File metadata and controls
139 lines (113 loc) · 5.04 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
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="css/droptiles.css?v=14">
<script src="js/jquery-1.7.2.min.js"></script>
<script src="js/jquery-ui-1.8.21.custom.min.js"></script>
<script src="js/Knockout-2.1.0.js"></script>
</head>
<body>
<div id="body" class="unselectable">
<div id="navbar" class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container-fluid">
<a class="pull-left" style="margin-top: 7px; margin-right: 5px;" href="">
<img src="img/avatar474_2.gif" style="max-height: 16px;" />
</a>
<h1><a class="brand" href="?">Droptiles</a></h1>
<div class="nav-collapse">
<ul class="nav">
<li><a class="active" href="?"><i class="icon-th-large"></i>Dashboard</a></li>
<li><a href="AppStore.aspx"><i class="icon-shopping-cart"></i>Apps</a></li>
<li><a href="http://oazabir.github.com/Droptiles/"><i class="icon-gift"></i>I want this!</a></li>
<li>
<form id="googleForm" class="navbar-search pull-left" action="http://www.google.com/search" target="_blank">
<input id="googleSearchText" type="text" class="search-query span2" name="q" placeholder="Google">
</form>
</li>
</ul>
<ul class="nav pull-right">
<li><a href="ServerStuff/Logout.ashx"><i class="icon-refresh"></i>Reset</a></li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="icon-tint"></i>Theme<b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="#">Green</a></li>
<li><a href="#">White</a></li>
<li><a href="#">Bloom</a></li>
</ul>
</li>
</ul>
</div>
</div>
</div>
</div>
<div id="content">
<div id="start">Start</div>
<div id="user">
<div id="name">
<div id="firstname">Omar</div>
<div id="lastname">AL Zabir</div>
</div>
<div id="photo">
<img src="img/User No-Frame.png" width="40" height="40" />
</div>
</div>
<div id="metro-sections-container" class="metro">
<div class="metro-sections" >
<div class="metro-section" data-bind="foreach: tiles" >
<div class="tile">
<div class="tile-icon-large">
<img data-bind="attr: { src: icon } " />
</div>
<span class="tile-label" data-bind="html: label"></span>
<span class="tile-counter" data-bind="html: count"></span>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
<script>
function Tile(param) {
this.label = ko.observable(param.label);
this.count = ko.observable(param.count);
this.icon = ko.observable(param.icon);
}
var tile1 = new Tile({
label: "Label 1",
count: 10,
icon: "img/CutTheRope.png"
});
var tile2 = new Tile({
label: "Label 2",
count: 20,
icon: "img/Desktop.png"
});
function ViewModel() {
this.tiles = ko.observableArray([]);
}
var viewModel = new ViewModel();
viewModel.tiles.push(tile1);
viewModel.tiles.push(tile2);
ko.applyBindings(viewModel);
window.setTimeout(function () {
viewModel.tiles.push(new Tile({
body: "New Tile",
label: "New",
count: 0,
icon: "img/Configure.png"
}));
$(".metro-section").sortable({
revert: true
});
}, 2000);
window.setInterval(function () {
ko.utils.arrayForEach(viewModel.tiles(), function (tile) {
tile.count(tile.count() + 1);
});
}, 1000);
</script>
</html>