This repository has been archived by the owner on May 30, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
376 lines (365 loc) · 17.1 KB
/
index.html
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
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>MacGyver Example</title>
<link href="//netdna.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet">
<link href="dist/macgyver-table.css" rel="stylesheet">
<style>
body{padding-top:49px;position:relative}
h1.hero{color:#363636;font-size:60px;font-weight:500;text-align:center;margin-bottom:22px;text-shadow:0 1px 1px rgba(0,0,0,0.15)}
section{padding-top:29px;}
section h1{padding-bottom:9px;margin:20px 0;border-bottom:1px solid #eee}
#top-nav{background-color:#363636;position:fixed;top:0;width:100%;min-width:700px;height:49px;z-index:10;-webkit-transform:rotateX(0) rotateY(0);-moz-transform:rotateX(0) rotateY(0);-o-transform:rotateX(0) rotateY(0);-ms-transform:rotateX(0) rotateY(0);transform:rotateX(0) rotateY(0);}
#top-nav #logo{display:inline-block;height:39px;padding:10px 0;}
#top-nav #logo h2{margin:0}
#top-nav .nav-menu{margin:0 auto;display:inline-block;overflow:hidden;list-style:none;}
#top-nav .nav-menu li{margin-right:10px;display:inline-block;}
#top-nav .nav-menu li a:hover{text-decoration:underline}
#top-nav a,#top-nav a:visited,#top-nav a:active{display:block;padding:2px 10px 0;font-size:14px;color:#fff;text-decoration:none}
.macgyver-head{padding-top:10px;position:relative;text-align:center;}
.docs-example{position:relative;margin:15px 0;padding:39px 19px 14px;*padding-top:19px;background-color:#fff;border:1px solid #ddd;-webkit-border-radius:4px;border-radius:4px;min-height:25px;}
.docs-example:after{content:"Example";position:absolute;top:-1px;left:-1px;padding:3px 7px;font-size:12px;font-weight:bold;background-color:#f5f5f5;border:1px solid #ddd;color:#9da0a4;-webkit-border-radius:4px 0 4px 0;border-radius:4px 0 4px 0}
.docs-example .mac-menu{position:relative}
.footer{text-align:center;padding:30px 0;margin-top:70px;border-top:1px solid #e5e5e5;background-color:#f5f5f5;}
.footer p{margin-bottom:0;color:#777}.footer .footer-links{margin:10px 0;}
.com{color:#93a1a1}
.lit{color:#195f91}
.pun,.opn,.clo{color:#93a1a1}
.fun{color:#dc322f}
.str,.atv{color:#d14}
.kwd,.prettyprint .tag{color:#1e347b}
.typ,.atn,.dec,.var{color:#008080}
.pln{color:#48484c}
.prettyprint{padding:8px;background-color:#f7f7f9;border:1px solid #e1e1e8}
.prettyprint.linenums{-webkit-box-shadow:inset 40px 0 0 #fbfbfc,inset 41px 0 0 #ececf0;box-shadow:inset 40px 0 0 #fbfbfc,inset 41px 0 0 #ececf0}
ol.linenums{margin:0 0 0 33px;}
ol.linenums li{padding-left:12px;color:#bebec5;line-height:20px;text-shadow:0 1px 0 #fff}
</style>
</head>
<body ng-app="Mac.Table" mac-scroll-spy mac-scroll-spy-offset="10">
<div id="top-nav">
<div class="container">
<a id="logo" href="index.html"><h2>MacGyver</h2></a>
</div>
</div>
<div class="container">
<div ng-controller="DemoController" class="row content">
<div id="example" class="col-md-12 col-xs-12">
<section id="table-view">
<h2>Table View</h2>
<div class="docs-example">
<h3>Dynamic Columns</h3>
<table mac-table="mac-table" mac-table-columns="dynamic" mac-table-resizable-columns="" mac-table-reorderable-columns="" class="table mac-table-default">
<thead mac-table-section="header" mac-table-section-blank-row="mac-table-section-blank-row">
<tr mac-table-row="mac-table-row">
<th mac-cell-template="No." mac-column-width="5%"><span>{{cell.column.colName}}</span></th>
<th mac-cell-template="Title" mac-column-width="35%"><span>{{cell.column.colName}}</span></th>
<th mac-cell-template="" mac-column-width="auto"><span>{{cell.column.colName}}</span></th>
</tr>
</thead>
<tbody mac-table-section="body" mac-table-section-models="macGyverSeasonOne">
<tr mac-table-row="mac-table-row">
<td mac-cell-template=""><span>{{cell.value()}}</span></td>
</tr>
</tbody>
</table>
</div>
<pre class="prettyprint linenums">
<table mac-table mac-table-columns="dynamic" mac-table-resizable-columns mac-table-reorderable-columns class="table mac-table-default">
<thead mac-table-section="header" mac-table-section-blank-row>
<tr mac-table-row>
<th mac-cell-template="No." mac-column-width="5%"><span>{{cell.column.colName}}</span></th>
<th mac-cell-template="Title" mac-column-width="35%"><span>{{cell.column.colName}}</span></th>
<th mac-cell-template="" mac-column-width="auto"><span>{{cell.column.colName}}</span></th>
</tr>
</thead>
<tbody mac-table-section="body" mac-table-section-models="macGyverSeasonOne">
<tr mac-table-row>
<td mac-cell-template=""><span>{{cell.value()}}</span></td>
</tr>
</tbody>
</table>
</pre>
<pre class="prettyprint linenums">$scope.macGyverSeasonOne = [
{
\'No.\': \'1\',
\'Title\': \'"Pilot"\',
\'Directed by\': \'Jerrold Freedman\',
\'Written by\': \'Thackary Pallor\',
\'Original air date\': \'September 29, 1986\'
}, { ...]
</pre>
<div class="docs-example">
<h3>Filtered and Selectable Rows</h3>
<div class="row">
<div class="col-md-8">
<table mac-table="mac-table" mac-table-columns="['No.', 'Title', 'Original air date']" mac-table-resizable-columns="" mac-table-reorderable-columns="" class="table mac-table-default">
<thead mac-table-section="header" mac-table-section-blank-row="mac-table-section-blank-row">
<tr mac-table-row="mac-table-row">
<th mac-cell-template="" mac-column-width="auto"><span>{{cell.column.colName}}</span></th>
</tr>
</thead>
<tbody mac-table-section="body" mac-table-section-models="macGyverSeasonOne | filter: query" mac-table-section-selected-models="$parent.$parent.selectedModels">
<tr mac-table-row="mac-table-row" ng-class="{selected: row.selected}">
<td mac-cell-template="No." mac-table-selectable="true"><span>{{cell.value()}}</span></td>
<td mac-cell-template=""><span>{{cell.value()}}</span></td>
</tr>
</tbody>
</table>
</div>
<div class="col-md-4">
<div class="row">
<input type="text" ng-model="query" placeholder="Search"/>
<ul class="nav nav-pills nav-stacked">
<li><a href="" ng-click="selectAll()">Select All</a></li>
<li><a href="" ng-click="unselectAll()">Unselect All</a></li>
<li><a href="" ng-click="selectRandom()">Select Random</a></li>
</ul>
</div>
<div ng-show="selectedModels.length">
<h5>You've selected</h5>
<ul>
<li ng-repeat="model in selectedModels | orderBy:'Title'"><span>{{model["Title"]}}</span></li>
</ul>
</div>
</div>
</div>
</div>
<pre class="prettyprint linenums">
<table
mac-table
mac-table-columns="[\'No.\', \'Title\', \'Original air date\']"
mac-table-resizable-columns
mac-table-reorderable-columns
class="table mac-table-default">
<thead mac-table-section="header" mac-table-section-blank-row>
<tr mac-table-row>
<th mac-cell-template="" mac-column-width="auto"><span>{{cell.column.colName}}</span></th>
</tr>
</thead>
<tbody
mac-table-section="body"
mac-table-section-models="macGyverSeasonOne | filter: query"
mac-table-section-selected-models="$parent.$parent.selectedModels">
<tr
mac-table-row
ng-class = "{selected: row.selected}">
<td mac-cell-template="No." mac-table-selectable="true"><span>{{cell.value()}}</span></td>
<td mac-cell-template=""><span>{{cell.value()}}</span></td>
</tr>
</tbody>
</table>
</pre>
<pre class="prettyprint linenums">
$scope.selectedModels = []
$scope.unselectAll = ->
$scope.selectedModels = []
$scope.selectAll = ->
$scope.selectedModels = $scope.macGyverSeasonOne.slice 0
$scope.selectRandom = ->
length = $scope.macGyverSeasonOne.length
models = []
for i in [1..(length / 2)]
index = Math.floor Math.random() * length
model = $scope.macGyverSeasonOne[index]
models.push model unless model in models
$scope.selectedModels = models
</pre>
</h2>
</section>
</div>
</div>
</div>
<footer class="footer">
<ul class="list-inline">
<li>
<iframe src="http://ghbtns.com/github-btn.html?user=angular-macgyver&repo=macgyver-table&type=watch&count=true" allowtransparency="true" frameborder="0" scrolling="0" width="110" height="20"></iframe>
</li>
<li>
<iframe src="http://ghbtns.com/github-btn.html?user=angular-macgyver&repo=macgyver-table&type=fork&count=true" allowtransparency="true" frameborder="0" scrolling="0" width="95" height="20"></iframe>
</li>
</ul>
<div class="container">
<p>Code licensed under <a href="https://github.com/angular-macgyver/macgyver-table/blob/master/LICENSE">MIT</a></p>
</div>
<ul class="list-inline">
<li>Currently 0.4.0</li>
<li>·</li>
<li><a href="https://github.com/angular-macgyver/macgyver-table">Github</a></li>
<li>·</li>
<li><a href="https://github.com/angular-macgyver/macgyver-table/issues">Issues</a></li>
<li>·</li>
<li><a href="https://github.com/angular-macgyver/macgyver-table/blob/master/CHANGELOG.md">Changelog</a></li>
<li>·</li>
<li><a href="https://github.com/angular-macgyver/macgyver-table/blob/master/README.md">README</a></li>
</ul>
</footer>
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js" type="text/javascript"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/prettify/r298/prettify.js" type="text/javascript"></script>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.25/angular.min.js" type="text/javascript"></script>
<script src="dist/macgyver-table.js" type="text/javascript"></script>
<script>
angular.module("Mac.Table").controller("DemoController", function($scope){
var __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
$scope.macGyverSeasonOne = [
{
"No.": "1",
Title: "\"Pilot\"",
"Directed by": "Jerrold Freedman",
"Written by": "Thackary Pallor",
"Original air date": "September 29, 1985"
}, {
"No.": "2",
Title: "\"The Golden Triangle\"",
"Directed by": "Paul Stanley & Donald Petrie",
"Written by": "Dennis R. Foley & Terry Nation",
"Original air date": "October 6, 1985"
}, {
"No.": "3",
Title: "\"Thief of Budapest\"",
"Directed by": "Lee H. Katzin & John Patterson",
"Written by": "Terry Nation & Stephen Downing & Joe Viola",
"Original air date": "October 13, 1985"
}, {
"No.": "4",
Title: "\"The Gauntlet\"",
"Directed by": "Lee H. Katzin",
"Written by": "Stephen Kandel",
"Original air date": "October 20, 1985"
}, {
"No.": "5",
Title: "\"The Heist\"",
"Directed by": "Alan Smithee",
"Written by": "Larry Alexander & James Schmerer",
"Original air date": "November 3, 1985"
}, {
"No.": "6",
Title: "\"Trumbo's World\"",
"Directed by": "Donald Petrie & Lee H. Katzin",
"Written by": "Stephen Kandel",
"Original air date": "November 10, 1985"
}, {
"No.": "7",
Title: "\"Last Stand\"",
"Directed by": "John Florea",
"Written by": "Judy Burns",
"Original air date": "November 17, 1985"
}, {
"No.": "8",
Title: "\"Hellfire\"",
"Directed by": "Richard Colla",
"Written by": "Story by: Douglas Brooks West",
"Original air date": "November 24, 1985"
}, {
"No.": "9",
Title: "\"The Prodigal\"",
"Directed by": "Alexander Singer",
"Written by": "Story by: David Abramowitz & Paul Savage",
"Original air date": "December 8, 1985"
}, {
"No.": "10",
Title: "\"Target MacGyver\"",
"Directed by": "Lee H. Katzin & Ernest Pintoff",
"Written by": "Story by: Mike Marvin",
"Original air date": "December 22, 1985"
}, {
"No.": "11",
Title: "\"Nightmares\"",
"Directed by": "Cliff Bole",
"Written by": "James Schmerer",
"Original air date": "January 15, 1986"
}, {
"No.": "12",
Title: "\"Deathlock\"",
"Directed by": "Cliff Bole & Alexander Singer",
"Written by": "Jerry Ludwig & Stephen Kandel",
"Original air date": "January 22, 1986"
}, {
"No.": "13",
Title: "\"Flame's End\"",
"Directed by": "Bruce Seth Green",
"Written by": "Story by: Hannah Louise Shearer",
"Original air date": "January 29, 1986"
}, {
"No.": "14",
Title: "\"Countdown\"",
"Directed by": "Stan Jolley",
"Written by": "Tony DiMarco & David Ketchum",
"Original air date": "February 5, 1986"
}, {
"No.": "15",
Title: "\"The Enemy Within\"",
"Directed by": "Cliff Bole",
"Written by": "David Abramowitz",
"Original air date": "February 12, 1986"
}, {
"No.": "16",
Title: "\"Every Time She Smiles\"",
"Directed by": "Charlie Correll",
"Written by": "James Schmerer",
"Original air date": "February 19, 1986"
}, {
"No.": "17",
Title: "\"To Be a Man\"",
"Directed by": "Cliff Bole",
"Written by": "Don Mankiewicz",
"Original air date": "March 5, 1986"
}, {
"No.": "18",
Title: "\"Ugly Duckling\"",
"Directed by": "Charlie Correll",
"Written by": "Larry Gross",
"Original air date": "March 12, 1986"
}, {
"No.": "19",
Title: "\"Slow Death\"",
"Directed by": "Don Weis",
"Written by": "Stephen Kandel",
"Original air date": "April 2, 1986"
}, {
"No.": "20",
Title: "\"The Escape\"",
"Directed by": "Don Chaffey",
"Written by": "Stephen Kandel",
"Original air date": "April 16, 1986"
}, {
"No.": "21",
Title: "\"A Prisoner of Conscience\"",
"Directed by": "Cliff Bole",
"Written by": "Stephen Kandel",
"Original air date": "April 30, 1986"
}, {
"No.": "22",
Title: "\"The Assassin\"",
"Directed by": "Charlie Correll",
"Written by": "James Schmerer",
"Original air date": "May 7, 1986"
}
];
$scope.selectedModels = [];
$scope.unselectAll = function() {
$scope.selectedModels = [];
};
$scope.selectAll = function() {
$scope.selectedModels = $scope.macGyverSeasonOne.slice(0);
};
$scope.selectRandom = function() {
var i, index, length, model, models, _i, _ref;
length = $scope.macGyverSeasonOne.length;
models = [];
for (i = _i = 1, _ref = length / 2; 1 <= _ref ? _i <= _ref : _i >= _ref; i = 1 <= _ref ? ++_i : --_i) {
index = Math.floor(Math.random() * length);
model = $scope.macGyverSeasonOne[index];
if (__indexOf.call(models, model) < 0) {
models.push(model);
}
}
$scope.selectedModels = models;
return models;
};
});
window.prettyPrint && prettyPrint();
</script>
</body>
</html>