-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathindex.html
1133 lines (1052 loc) · 52.4 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
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>AngularUI Foundation</title>
<link rel="stylesheet" type="text/css" href="foundation-css/css/normalize.css">
<link rel="stylesheet" type="text/css" href="foundation-css/css/foundation.css">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.0.5/angular.js"></script>
<script src="components/angular-bootstrap/ui-bootstrap.js"></script>
<script src="app.js"></script>
<script src="plunker.js"></script>
</head>
<body ng-app="foundationDemoApp" ng-controller="MainCtrl">
<nav class="top-bar">
<ul class="title-area">
<li class="name">
<h1><a href="">UI Bootstrap</a></h1>
</li>
</ul>
<section class="top-bar-section">
<ul class="left">
<li class="divider"></li>
<li><a>Related Projects:</a>
<ul class="dropdown">
<li><a href="http://angular-ui.github.com/">AngularUI</a></li>
<li><a href="http://angular-ui.github.com/ng-grid/">Grid</a></li>
<li><a href="https://github.com/angular-ui/AngularJs.tmbundle">AngularJS.tmbundle</a></li>
<li><a href="http://angular-ui.github.com/router/">Router <span class="label label-success">New!</span></a></li>
<li><a href="http://angular-ui.github.com/Tips-n-Tricks/">Tips-n-Tricks <span class="label">WIP</span></a></li>
</ul>
</li>
<li><a>Directives <b class="caret"></b></a>
<ul class="dropdown">
<li><a href="#accordion">Accordion</a></li>
<li><a href="#alert">Alert</a></li>
<li><a href="#buttons">Buttons</a></li>
<li><a href="#carousel">Carousel</a></li>
<li><a href="#collapse">Collapse</a></li>
<li><a href="#dialog">Dialog</a></li>
<li><a href="#dropdownToggle">Dropdown Toggle</a></li>
<li><a href="#modal">Modal</a></li>
<li><a href="#pagination">Pagination</a></li>
<li><a href="#popover">Popover</a></li>
<li><a href="#tabs">Tabs</a></li>
<li><a href="#tooltip">Tooltip</a></li>
<li><a href="#typeahead">Typeahead</a></li>
</ul>
</li>
<li><a href="#getting_started">Getting started</a></li>
</ul>
</section>
</nav>
<div class="row">
<div class="small-12 columns">
<h1 class="header">UI Bootstrap (Foundation)</h1>
</div>
</div>
<div class="row">
<div class="small-12 columns">
<p>UI components written in pure <strong><a href="http://angularjs.org">AngularJS</a></strong> by the <strong><a href="http://angular-ui.github.com">AngularUI Team</a></strong></p>
</div>
</div>
<div class="row">
<div class="small-12 columns">
<ul class="button-group">
<li><a class="button" href="https://github.com/angular-ui/bootstrap"><i class="icon-github"></i> Code on Github</a></li>
<li><a class="button button-primary" href="https://github.com/angular-ui/bootstrap/tree/gh-pages">
<i class="icon-download-alt icon-white"></i> Download <small>(0.2.0)</small>
</a></li>
<li><a class="button" ng-click="showBuildModal()"><i class="icon-wrench"></i> Create a Build</a></li>
</ul>
</div>
</div>
<div class="row">
<div class="small-12 columns">
<h1>Getting started</h1>
<h2>Dependencies</h2>
<p>
This repository contains a set of <strong>native AngularJS directives</strong> based on
Twitter Bootstrap's markup and CSS. As a result no dependency on jQuery or Bootstrap's
JavaScript is required. The <strong>only required dependencies</strong> are:
</p>
<ul>
<li>AngularJS (minimal version 1.0.4 or 1.1.2)</li>
<li>Bootstrap CSS</li>
</ul>
<h3>Files to download</h3>
<p>
Build files for all directives are distributed in several flavours: minified for production usage, un-minified
for development, with or without templates. All the options are described and can be
<a href="https://github.com/angular-ui/bootstrap/tree/gh-pages">downloaded from here</a>.
</p>
<p>Alternativelly, if you are only interested in a subset of directives, you can
<a ng-click="showBuildModal()">create your own build</a>.
</p>
<p>
Whichever method you choose the good news that the overall size of a download is very small:
<20kB for all directives (~5kB with gzip compression!)
</p>
<h2>Installation</h2>
<p>
As soon as you've got all the files downloaded and included in your page you just need to declare
a dependency on the <code>ui.bootstrap</code> <a href="http://docs.angularjs.org/guide/module">module</a>:<br>
<code>angular.module('myModule', ['ui.bootstrap']);</code>
</p>
<p>You can fork one of the plunkers from this page to see a working example of what is described here.</p>
</div>
</div>
<div class="row">
<div class="small-12 columns">
<h1>Accordion <small>(<a target="_blank" href="https://github.com/angular-ui/bootstrap/tree/master/src/accordion">ui.bootstrap.accordion</a>)</small></h1>
</div>
</div>
<div class="row">
<div class="small-12 large-6 columns" ng-controller="AccordionDemoCtrl">
<label class="checkbox"><input type="checkbox" ng-model="oneAtATime"> Open only one at a time</label>
<accordion close-others="oneAtATime">
<accordion-group heading="Static Header">This content is straight in the template.</accordion-group>
<accordion-group heading="{{group.title}}" ng-repeat="group in groups">{{group.content}}</accordion-group>
<accordion-group heading="Dynamic Body Content">
<p>The body of the accordion group grows to fit the contents</p>
<button class="button button-small" ng-click="addItem()">Add Item</button>
<div ng-repeat="item in items">{{item}}</div>
</accordion-group>
</accordion>
</div>
<div class="small-12 large-6 columns">
<h3>Description</h3>
<p>The <strong>accordion directive</strong> builds on top of the collapse directive to provide a list of items, with collapsible bodies that are collapsed or expanded by clicking on the item's header.</p>
<p>We can control whether expanding an item will cause the other items to close, using the <code>close-others</code> attribute on accordion.</p>
<p>The body of each accordion group is transcluded in to the body of the collapsible element.</p>
</div>
</div>
<script>
function AccordionDemoCtrl($scope) {
$scope.oneAtATime = true;
$scope.groups = [
{
title: "Dynamic Group Header - 1",
content: "Dynamic Group Body - 1"
},
{
title: "Dynamic Group Header - 2",
content: "Dynamic Group Body - 2"
}
];
$scope.items = ['Item 1', 'Item 2', 'Item 3'];
$scope.addItem = function() {
var newItemNo = $scope.items.length + 1;
$scope.items.push('Item ' + newItemNo);
};
}
</script>
<div class="row">
<div class="small-12 columns">
<h1>Alert<small> (<a target="_blank" href="https://github.com/angular-ui/bootstrap/tree/master/src/alert">ui.bootstrap.alert</a>)</small></h1>
</div>
</div>
<div class="row">
<div class="small-12 large-6 columns" ng-controller="AlertDemoCtrl">
<alert ng-repeat="alert in alerts" type="alert.type" close="closeAlert($index)">{{alert.msg}}</alert>
<button class='button' ng-click="addAlert()">Add Alert</button>
</div>
<div class="small-12 large-6 columns">
<p>Alert is an AngularJS-version of bootstrap's alert.</p>
<p>This directive can be used to generate alerts from the dynamic model data (using the ng-repeat directive);</p>
</div>
</div>
<script type="text/javascript">
function AlertDemoCtrl($scope) {
$scope.alerts = [
{ type: 'alert', msg: 'Oh snap! Change a few things up and try submitting again.' },
{ type: 'success', msg: 'Well done! You successfully read this important alert message.' }
];
$scope.addAlert = function() {
$scope.alerts.push({msg: "Another alert!", type: 'secondary'});
};
$scope.closeAlert = function(index) {
$scope.alerts.splice(index, 1);
};
}
</script>
<div class="row">
<div class="small-12 columns">
<h1>Buttons<small> (<a target="_blank" href="https://github.com/angular-ui/bootstrap/tree/master/src/buttons">ui.bootstrap.buttons</a>)</small></h1>
</div>
</div>
<div class="row">
<div class="small-12 large-6 columns" ng-controller="ButtonsCtrl">
<h3>Single toggle</h3>
<pre>{{singleModel}}</pre>
<button type="button" class="button" ng-model="singleModel" btn-checkbox btn-checkbox-true="1" btn-checkbox-false="0">Single Toggle</button>
<h3>Checkbox</h3>
<pre>{{checkModel}}</pre>
<div class="button-group">
<button type="button" class="button" ng-model="checkModel.left" btn-checkbox>Left</button>
<button type="button" class="button" ng-model="checkModel.middle" btn-checkbox>Middle</button>
<button type="button" class="button" ng-model="checkModel.right" btn-checkbox>Right</button>
</div>
<h3>Radio</h3>
<pre>{{radioModel}}</pre>
<div class="button-group" data-toggle="buttons-checkbox">
<button type="button" class="button" ng-model="radioModel" btn-radio="'Left'">Left</button>
<button type="button" class="button" ng-model="radioModel" btn-radio="'Middle'">Middle</button>
<button type="button" class="button" ng-model="radioModel" btn-radio="'Right'">Right</button>
</div>
</div>
<div class="small-12 large-6 columns">
<p>There are 2 directives that can make a group of buttons to behave like a set of checkboxes or radio buttons.</p>
</div>
</div>
<script>
var ButtonsCtrl = function ($scope) {
$scope.singleModel = 1;
$scope.radioModel = 'Middle';
$scope.checkModel = {
left: false,
middle: true,
right: false
};
};
</script>
<!--
<section id="carousel">
<div class="page-header">
<h1>Carousel<small>
(<a target="_blank" href="https://github.com/angular-ui/bootstrap/tree/master/src/carousel">ui.bootstrap.carousel</a>)
</small></h1>
</div>
<div class="row">
<div class="span6">
<div ng-controller="CarouselDemoCtrl">
<carousel interval="myInterval">
<slide ng-repeat="slide in slides" active="slide.active">
<img ng-src="{{slide.image}}" style="margin:auto;">
<div class="carousel-caption">
<h4>Slide {{$index}}</h4>
<p>{{slide.text}}</p>
</div>
</slide>
</carousel>
<div class="row-fluid">
<div class="span6">
<ul>
<li ng-repeat="slide in slides">
<button class="button button-mini" ng-class="{'button-info': !slide.active, 'button-success': slide.active}" ng-disabled="slide.active" ng-click="slide.active = true">select</button>
{{$index}}: {{slide.text}}
</li>
</ul>
<a class="button" ng-click="addSlide()">Add Slide</a>
</div>
<div class="span6">
Interval, in milliseconds: <input type="number" ng-model="myInterval">
<br />Enter a negative number to stop the interval.
</div>
</div>
</div>
</div>
<div class="span6">
<p>Carousel creates a carousel similar to bootstrap's image carousel.</p>
<p>Use a <code><carousel></code> element with <code><slide></code> elements inside it. It will automatically cycle through the slides at a given rate, and a current-index variable will be kept in sync with the currently visible slide.</p>
</div>
</div>
<hr>
<div class="row">
<div class="span12" ng-controller="PlunkerCtrl">
<div class="pull-right">
<button class="button button-info" id="plunk-button" ng-click="edit('1.0.5', '2.3.1', '0.2.0', 'carousel')"><i class="icon-edit icon-white"></i> Edit in plunker</button>
</div>
<tabs>
<pane heading="Markup" plunker-content="markup"><pre ng-non-bindable><code data-language="html"><div ng-controller="CarouselDemoCtrl">
<carousel interval="myInterval">
<slide ng-repeat="slide in slides" active="slide.active">
<img ng-src="{{slide.image}}" style="margin:auto;">
<div class="carousel-caption">
<h4>Slide {{$index}}</h4>
<p>{{slide.text}}</p>
</div>
</slide>
</carousel>
<div class="row-fluid">
<div class="span6">
<ul>
<li ng-repeat="slide in slides">
<button class="button button-mini" ng-class="{'button-info': !slide.active, 'button-success': slide.active}" ng-disabled="slide.active" ng-click="slide.active = true">select</button>
{{$index}}: {{slide.text}}
</li>
</ul>
<a class="button" ng-click="addSlide()">Add Slide</a>
</div>
<div class="span6">
Interval, in milliseconds: <input type="number" ng-model="myInterval">
<br />Enter a negative number to stop the interval.
</div>
</div>
</div>
</code></pre></pane>
<pane heading="JavaScript" plunker-content="javascript"><pre ng-non-bindable><code data-language="javascript">function CarouselDemoCtrl($scope) {
$scope.myInterval = 5000;
$scope.slides = [
{image: 'http://placekitten.com/200/200',text: 'Kitten.'},
{image: 'http://placekitten.com/225/200',text: 'Kitty!'},
{image: 'http://placekitten.com/250/200',text: 'Cat.'},
{image: 'http://placekitten.com/275/200',text: 'Feline!'}
];
$scope.addSlide = function() {
$scope.slides.push({
image: 'http://placekitten.com/'+(200+25*Math.floor(Math.random()*4))+'/200',
text: ['More','Extra','Lots of','Surplus'][Math.floor(Math.random()*4)] + ' ' +
['Cats', 'Kittys', 'Felines', 'Cutes'][Math.floor(Math.random()*4)]
});
};
}
</code></pre></pane>
</tabs>
</div>
</div>
</section>
<script>function CarouselDemoCtrl($scope) {
$scope.myInterval = 5000;
$scope.slides = [
{image: 'http://placekitten.com/200/200',text: 'Kitten.'},
{image: 'http://placekitten.com/225/200',text: 'Kitty!'},
{image: 'http://placekitten.com/250/200',text: 'Cat.'},
{image: 'http://placekitten.com/275/200',text: 'Feline!'}
];
$scope.addSlide = function() {
$scope.slides.push({
image: 'http://placekitten.com/'+(200+25*Math.floor(Math.random()*4))+'/200',
text: ['More','Extra','Lots of','Surplus'][Math.floor(Math.random()*4)] + ' ' +
['Cats', 'Kittys', 'Felines', 'Cutes'][Math.floor(Math.random()*4)]
});
};
}
</script>
<section id="collapse">
<div class="page-header">
<h1>Collapse<small>
(<a target="_blank" href="https://github.com/angular-ui/bootstrap/tree/master/src/collapse">ui.bootstrap.collapse</a>)
</small></h1>
</div>
<div class="row">
<div class="span6">
<div ng-controller="CollapseDemoCtrl">
<button class="button" ng-click="isCollapsed = !isCollapsed">Toggle collapse</button>
<hr>
<div collapse="isCollapsed">
<div class="well well-large">Some content</div>
</div>
</div>
</div>
<div class="span6">
<p>AngularJS version of twitter's collapse plugin.
Provides a simple way to hide and show an element with a css transition</p>
</div>
</div>
<hr>
<div class="row">
<div class="span12" ng-controller="PlunkerCtrl">
<div class="pull-right">
<button class="button button-info" id="plunk-button" ng-click="edit('1.0.5', '2.3.1', '0.2.0', 'collapse')"><i class="icon-edit icon-white"></i> Edit in plunker</button>
</div>
<tabs>
<pane heading="Markup" plunker-content="markup"><pre ng-non-bindable><code data-language="html"><div ng-controller="CollapseDemoCtrl">
<button class="button" ng-click="isCollapsed = !isCollapsed">Toggle collapse</button>
<hr>
<div collapse="isCollapsed">
<div class="well well-large">Some content</div>
</div>
</div></code></pre></pane>
<pane heading="JavaScript" plunker-content="javascript"><pre ng-non-bindable><code data-language="javascript">function CollapseDemoCtrl($scope) {
$scope.isCollapsed = false;
}
</code></pre></pane>
</tabs>
</div>
</div>
</section>
<script>function CollapseDemoCtrl($scope) {
$scope.isCollapsed = false;
}
</script>
<section id="dialog">
<div class="page-header">
<h1>Dialog<small>
(<a target="_blank" href="https://github.com/angular-ui/bootstrap/tree/master/src/dialog">ui.bootstrap.dialog</a>)
</small></h1>
</div>
<div class="row">
<div class="span6">
<div ng-controller="DialogDemoCtrl">
<div class="row-fluid">
<div class="span6">
<label class="checkbox"><input type=checkbox ng-model="opts.backdrop">Show backdrop</label>
<label class="checkbox"><input type=checkbox ng-model="opts.dialogFade">Fade modal dialog </label>
<label class="checkbox"><input type=checkbox ng-disabled="!opts.backdrop" ng-model="opts.backdropFade">Fade Backdrop</label>
<hr>
<label class="checkbox"><input type=checkbox ng-model="opts.keyboard">Close on Escape</label>
<label class="checkbox"><input type=checkbox ng-disabled="!opts.backdrop" ng-model="opts.backdropClick">Close on backdrop click</label>
</div>
<div class="span6">
<p>Change options at will and press the open dialog button below!</p>
<p><button class="button button-primary" ng-click="openDialog()">Open Dialog</button></p>
<p>Alternatively open a simple message box:</p>
<p><button class="button button-primary" ng-click="openMessageBox()">Open Message Box</button></p>
</div>
</div>
</div>
</div>
<div class="span6">
<p>The <code>$dialog</code> service allows you to open dialogs and message boxes from within your controllers. Very useful in case loading dialog content in the DOM up-front is tedious or not desired.</p>
<p>Creating custom dialogs is straightforward: create a partial view, its controller and reference them when using the service.
Generic message boxes (title, message and buttons) are also provided for your convenience.</p>
<p>For more information, see the <a href="https://github.com/angular-ui/bootstrap/blob/master/src/dialog/README.md">dialog readme</a> on github.</p>
</div>
</div>
<hr>
<div class="row">
<div class="span12" ng-controller="PlunkerCtrl">
<div class="pull-right">
<button class="button button-info" id="plunk-button" ng-click="edit('1.0.5', '2.3.1', '0.2.0', 'dialog')"><i class="icon-edit icon-white"></i> Edit in plunker</button>
</div>
<tabs>
<pane heading="Markup" plunker-content="markup"><pre ng-non-bindable><code data-language="html"><div ng-controller="DialogDemoCtrl">
<div class="row-fluid">
<div class="span6">
<label class="checkbox"><input type=checkbox ng-model="opts.backdrop">Show backdrop</label>
<label class="checkbox"><input type=checkbox ng-model="opts.dialogFade">Fade modal dialog </label>
<label class="checkbox"><input type=checkbox ng-disabled="!opts.backdrop" ng-model="opts.backdropFade">Fade Backdrop</label>
<hr>
<label class="checkbox"><input type=checkbox ng-model="opts.keyboard">Close on Escape</label>
<label class="checkbox"><input type=checkbox ng-disabled="!opts.backdrop" ng-model="opts.backdropClick">Close on backdrop click</label>
</div>
<div class="span6">
<p>Change options at will and press the open dialog button below!</p>
<p><button class="button button-primary" ng-click="openDialog()">Open Dialog</button></p>
<p>Alternatively open a simple message box:</p>
<p><button class="button button-primary" ng-click="openMessageBox()">Open Message Box</button></p>
</div>
</div>
</div>
</code></pre></pane>
<pane heading="JavaScript" plunker-content="javascript"><pre ng-non-bindable><code data-language="javascript">function DialogDemoCtrl($scope, $dialog){
// Inlined template for demo
var t = '<div class="modal-header">'+
'<h1>This is the title</h1>'+
'</div>'+
'<div class="modal-body">'+
'<p>Enter a value to pass to <code>close</code> as the result: <input ng-model="result" /></p>'+
'</div>'+
'<div class="modal-footer">'+
'<button ng-click="close(result)" class="button button-primary" >Close</button>'+
'</div>';
$scope.opts = {
backdrop: true,
keyboard: true,
backdropClick: true,
template: t, // OR: templateUrl: 'path/to/view.html',
controller: 'TestDialogController'
};
$scope.openDialog = function(){
var d = $dialog.dialog($scope.opts);
d.open().then(function(result){
if(result)
{
alert('dialog closed with result: ' + result);
}
});
};
$scope.openMessageBox = function(){
var title = 'This is a message box';
var msg = 'This is the content of the message box';
var buttons = [{result:'cancel', label: 'Cancel'}, {result:'ok', label: 'OK', cssClass: 'button-primary'}];
$dialog.messageBox(title, msg, buttons)
.open()
.then(function(result){
alert('dialog closed with result: ' + result);
});
};
}
// the dialog is injected in the specified controller
function TestDialogController($scope, dialog){
$scope.close = function(result){
dialog.close(result);
};
}
</code></pre></pane>
</tabs>
</div>
</div>
</section>
<script>function DialogDemoCtrl($scope, $dialog){
// Inlined template for demo
var t = '<div class="modal-header">'+
'<h1>This is the title</h1>'+
'</div>'+
'<div class="modal-body">'+
'<p>Enter a value to pass to <code>close</code> as the result: <input ng-model="result" /></p>'+
'</div>'+
'<div class="modal-footer">'+
'<button ng-click="close(result)" class="button button-primary" >Close</button>'+
'</div>';
$scope.opts = {
backdrop: true,
keyboard: true,
backdropClick: true,
template: t, // OR: templateUrl: 'path/to/view.html',
controller: 'TestDialogController'
};
$scope.openDialog = function(){
var d = $dialog.dialog($scope.opts);
d.open().then(function(result){
if(result)
{
alert('dialog closed with result: ' + result);
}
});
};
$scope.openMessageBox = function(){
var title = 'This is a message box';
var msg = 'This is the content of the message box';
var buttons = [{result:'cancel', label: 'Cancel'}, {result:'ok', label: 'OK', cssClass: 'button-primary'}];
$dialog.messageBox(title, msg, buttons)
.open()
.then(function(result){
alert('dialog closed with result: ' + result);
});
};
}
// the dialog is injected in the specified controller
function TestDialogController($scope, dialog){
$scope.close = function(result){
dialog.close(result);
};
}
</script>
<section id="dropdownToggle">
<div class="page-header">
<h1>Dropdown Toggle<small>
(<a target="_blank" href="https://github.com/angular-ui/bootstrap/tree/master/src/dropdownToggle">ui.bootstrap.dropdownToggle</a>)
</small></h1>
</div>
<div class="row">
<div class="span6">
<li class="dropdown" ng-controller="DropdownCtrl">
<a class="dropdown-toggle">
Click me for a dropdown, yo!
</a>
<ul class="dropdown-menu">
<li ng-repeat="choice in items">
<a>{{choice}}</a>
</li>
</ul>
</li>
</div>
<div class="span6">
<p>DropdownToggle is a simple directive which will toggle a dropdown link on click. Simply put it on the <code><a></code> tag of the toggler-element, and it will find the nearest dropdown menu and toggle it when the <code><a dropdown-toggle></code> is clicked.</p>
</div>
</div>
<hr>
<div class="row">
<div class="span12" ng-controller="PlunkerCtrl">
<div class="pull-right">
<button class="button button-info" id="plunk-button" ng-click="edit('1.0.5', '2.3.1', '0.2.0', 'dropdownToggle')"><i class="icon-edit icon-white"></i> Edit in plunker</button>
</div>
<tabs>
<pane heading="Markup" plunker-content="markup"><pre ng-non-bindable><code data-language="html"><li class="dropdown" ng-controller="DropdownCtrl">
<a class="dropdown-toggle">
Click me for a dropdown, yo!
</a>
<ul class="dropdown-menu">
<li ng-repeat="choice in items">
<a>{{choice}}</a>
</li>
</ul>
</li>
</code></pre></pane>
<pane heading="JavaScript" plunker-content="javascript"><pre ng-non-bindable><code data-language="javascript">function DropdownCtrl($scope) {
$scope.items = [
"The first choice!",
"And another choice for you.",
"but wait! A third!"
];
}
</code></pre></pane>
</tabs>
</div>
</div>
</section>
<script>function DropdownCtrl($scope) {
$scope.items = [
"The first choice!",
"And another choice for you.",
"but wait! A third!"
];
}
</script>
<section id="modal">
<div class="page-header">
<h1>Modal<small>
(<a target="_blank" href="https://github.com/angular-ui/bootstrap/tree/master/src/modal">ui.bootstrap.modal</a>)
</small></h1>
</div>
<div class="row">
<div class="span6">
<div ng-controller="ModalDemoCtrl">
<button class="button" ng-click="open()">Open me!</button>
<div modal="shouldBeOpen" close="close()" options="opts">
<div class="modal-header">
<h4>I'm a modal!</h4>
</div>
<div class="modal-body">
<ul>
<li ng-repeat="item in items">{{item}}</li>
</ul>
</div>
<div class="modal-footer">
<button class="button button-warning cancel" ng-click="close()">Cancel</button>
</div>
</div>
</div>
</div>
<div class="span6">
<p><code>modal</code> is a directive that reuses <code>$dialog</code> service to provide simple creation of modals that are already in your DOM without the hassle of creating partial views and controllers.</p>
<p>The directive shares <code>$dialog</code> global options.</p>
<p>For more information, see the <a href="https://github.com/angular-ui/bootstrap/blob/master/src/dialog/README.md">dialog readme</a> on github.</p>
</div>
</div>
<hr>
<div class="row">
<div class="span12" ng-controller="PlunkerCtrl">
<div class="pull-right">
<button class="button button-info" id="plunk-button" ng-click="edit('1.0.5', '2.3.1', '0.2.0', 'modal')"><i class="icon-edit icon-white"></i> Edit in plunker</button>
</div>
<tabs>
<pane heading="Markup" plunker-content="markup"><pre ng-non-bindable><code data-language="html"><div ng-controller="ModalDemoCtrl">
<button class="button" ng-click="open()">Open me!</button>
<div modal="shouldBeOpen" close="close()" options="opts">
<div class="modal-header">
<h4>I'm a modal!</h4>
</div>
<div class="modal-body">
<ul>
<li ng-repeat="item in items">{{item}}</li>
</ul>
</div>
<div class="modal-footer">
<button class="button button-warning cancel" ng-click="close()">Cancel</button>
</div>
</div>
</div></code></pre></pane>
<pane heading="JavaScript" plunker-content="javascript"><pre ng-non-bindable><code data-language="javascript">var ModalDemoCtrl = function ($scope) {
$scope.open = function () {
$scope.shouldBeOpen = true;
};
$scope.close = function () {
$scope.closeMsg = 'I was closed at: ' + new Date();
$scope.shouldBeOpen = false;
};
$scope.items = ['item1', 'item2'];
$scope.opts = {
backdropFade: true,
dialogFade:true
};
};</code></pre></pane>
</tabs>
</div>
</div>
</section>
<script>var ModalDemoCtrl = function ($scope) {
$scope.open = function () {
$scope.shouldBeOpen = true;
};
$scope.close = function () {
$scope.closeMsg = 'I was closed at: ' + new Date();
$scope.shouldBeOpen = false;
};
$scope.items = ['item1', 'item2'];
$scope.opts = {
backdropFade: true,
dialogFade:true
};
};</script>
<section id="pagination">
<div class="page-header">
<h1>Pagination<small>
(<a target="_blank" href="https://github.com/angular-ui/bootstrap/tree/master/src/pagination">ui.bootstrap.pagination</a>)
</small></h1>
</div>
<div class="row">
<div class="span6">
<div ng-controller="PaginationDemoCtrl">
<pagination num-pages="noOfPages" current-page="currentPage"></pagination>
<pagination num-pages="noOfPages" current-page="currentPage" class="pagination-small" previous-text="«" next-text="»"></pagination>
<pagination boundary-links="true" num-pages="noOfPages" current-page="currentPage" max-size="maxSize"></pagination>
<pagination num-pages="noOfPages" current-page="currentPage" max-size="maxSize"></pagination>
<pagination direction-links="false" num-pages="noOfPages" current-page="currentPage"></pagination>
<button class="button" ng-click="setPage(3)">Set current page to: 3</button>
The selected page no: {{currentPage}}
</div>
</div>
<div class="span6">
<p>A lightweight pagination directive that is focused on ... providing pagination!</p>
<p>It will take care of visualising a pagination bar. Additionally it will make sure that the state (enabled / disabled) of the Previous / Next and First / Last buttons (if exist) is maintained correctly.</p>
<p>It also provides optional attribute max-size to limit the size of pagination bar.</p>
</div>
</div>
<hr>
<div class="row">
<div class="span12" ng-controller="PlunkerCtrl">
<div class="pull-right">
<button class="button button-info" id="plunk-button" ng-click="edit('1.0.5', '2.3.1', '0.2.0', 'pagination')"><i class="icon-edit icon-white"></i> Edit in plunker</button>
</div>
<tabs>
<pane heading="Markup" plunker-content="markup"><pre ng-non-bindable><code data-language="html"><div ng-controller="PaginationDemoCtrl">
<pagination num-pages="noOfPages" current-page="currentPage"></pagination>
<pagination num-pages="noOfPages" current-page="currentPage" class="pagination-small" previous-text="&laquo;" next-text="&raquo;"></pagination>
<pagination boundary-links="true" num-pages="noOfPages" current-page="currentPage" max-size="maxSize"></pagination>
<pagination num-pages="noOfPages" current-page="currentPage" max-size="maxSize"></pagination>
<pagination direction-links="false" num-pages="noOfPages" current-page="currentPage"></pagination>
<button class="button" ng-click="setPage(3)">Set current page to: 3</button>
The selected page no: {{currentPage}}
</div></code></pre></pane>
<pane heading="JavaScript" plunker-content="javascript"><pre ng-non-bindable><code data-language="javascript">var PaginationDemoCtrl = function ($scope) {
$scope.noOfPages = 7;
$scope.currentPage = 4;
$scope.maxSize = 5;
$scope.setPage = function (pageNo) {
$scope.currentPage = pageNo;
};
};
</code></pre></pane>
</tabs>
</div>
</div>
</section>
<script>var PaginationDemoCtrl = function ($scope) {
$scope.noOfPages = 7;
$scope.currentPage = 4;
$scope.maxSize = 5;
$scope.setPage = function (pageNo) {
$scope.currentPage = pageNo;
};
};
</script>
<section id="popover">
<div class="page-header">
<h1>Popover<small>
(<a target="_blank" href="https://github.com/angular-ui/bootstrap/tree/master/src/popover">ui.bootstrap.popover</a>)
</small></h1>
</div>
<div class="row">
<div class="span6">
<div ng-controller="PopoverDemoCtrl">
<div class="well">
<div>
<h4>Dynamic</h4>
<div>Dynamic Popover : <input type="text" ng-model="dynamicPopoverText"></div>
<div>Dynamic Popover Popup Text: <input type="text" ng-model="dynamicPopover"></div>
<div>Dynamic Popover Popup Title: <input type="text" ng-model="dynamicPopoverTitle"></div>
<div><button popover="{{dynamicPopover}}" popover-title="{{dynamicPopoverTitle}}" class="button">{{dynamicPopoverText}}</button></div>
</div>
<div>
<h4>Positional</h4>
<button popover-placement="top" popover="On the Top!" class="button">Top</button>
<button popover-placement="left" popover="On the Left!" class="button">Left</button>
<button popover-placement="right" popover="On the Right!" class="button">Right</button>
<button popover-placement="bottom" popover="On the Bottom!" class="button">Bottom</button>
</div>
<div>
<h4>Other</h4>
<button Popover-animation="true" popover="I fade in and out!" class="button">fading</button>
<button popover="I have a title!" popover-title="The title." class="button">title</button>
</div>
</div>
</div>
</div>
<div class="span6">
<p>A lightweight, extensible directive for fancy popover creation. The popover
directive supports multiple placements, optional transition animation, and more.</p>
</div>
</div>
<hr>
<div class="row">
<div class="span12" ng-controller="PlunkerCtrl">
<div class="pull-right">
<button class="button button-info" id="plunk-button" ng-click="edit('1.0.5', '2.3.1', '0.2.0', 'popover')"><i class="icon-edit icon-white"></i> Edit in plunker</button>
</div>
<tabs>
<pane heading="Markup" plunker-content="markup"><pre ng-non-bindable><code data-language="html"><div ng-controller="PopoverDemoCtrl">
<div class="well">
<div>
<h4>Dynamic</h4>
<div>Dynamic Popover : <input type="text" ng-model="dynamicPopoverText"></div>
<div>Dynamic Popover Popup Text: <input type="text" ng-model="dynamicPopover"></div>
<div>Dynamic Popover Popup Title: <input type="text" ng-model="dynamicPopoverTitle"></div>
<div><button popover="{{dynamicPopover}}" popover-title="{{dynamicPopoverTitle}}" class="button">{{dynamicPopoverText}}</button></div>
</div>
<div>
<h4>Positional</h4>
<button popover-placement="top" popover="On the Top!" class="button">Top</button>
<button popover-placement="left" popover="On the Left!" class="button">Left</button>
<button popover-placement="right" popover="On the Right!" class="button">Right</button>
<button popover-placement="bottom" popover="On the Bottom!" class="button">Bottom</button>
</div>
<div>
<h4>Other</h4>
<button Popover-animation="true" popover="I fade in and out!" class="button">fading</button>
<button popover="I have a title!" popover-title="The title." class="button">title</button>
</div>
</div>
</div>
</code></pre></pane>
<pane heading="JavaScript" plunker-content="javascript"><pre ng-non-bindable><code data-language="javascript">var PopoverDemoCtrl = function ($scope) {
$scope.dynamicPopover = "Hello, World!";
$scope.dynamicPopoverText = "dynamic";
$scope.dynamicPopoverTitle = "Title";
};
</code></pre></pane>
</tabs>
</div>
</div>
</section>
<script>var PopoverDemoCtrl = function ($scope) {
$scope.dynamicPopover = "Hello, World!";
$scope.dynamicPopoverText = "dynamic";
$scope.dynamicPopoverTitle = "Title";
};
</script>
<section id="tabs">
<div class="page-header">
<h1>Tabs<small>
(<a target="_blank" href="https://github.com/angular-ui/bootstrap/tree/master/src/tabs">ui.bootstrap.tabs</a>)
</small></h1>
</div>
<div class="row">
<div class="span6">
<div ng-controller="TabsDemoCtrl">
<tabs>
<pane heading="Static title">Static content</pane>
<pane ng-repeat="pane in panes" heading="{{pane.title}}" active="pane.active">{{pane.content}}</pane>
</tabs>
<div class="row-fluid">
<button class="button" ng-click="panes[0].active = true">Select second tab</button>
<button class="button" ng-click="panes[1].active = true">Select third tab</button>
</div>
</div>
</div>
<div class="span6">
<p>AngularJS version of the tabs directive.</p>
</div>
</div>
<hr>
<div class="row">
<div class="span12" ng-controller="PlunkerCtrl">
<div class="pull-right">
<button class="button button-info" id="plunk-button" ng-click="edit('1.0.5', '2.3.1', '0.2.0', 'tabs')"><i class="icon-edit icon-white"></i> Edit in plunker</button>
</div>
<tabs>
<pane heading="Markup" plunker-content="markup"><pre ng-non-bindable><code data-language="html"><div ng-controller="TabsDemoCtrl">
<tabs>
<pane heading="Static title">Static content</pane>
<pane ng-repeat="pane in panes" heading="{{pane.title}}" active="pane.active">{{pane.content}}</pane>
</tabs>
<div class="row-fluid">
<button class="button" ng-click="panes[0].active = true">Select second tab</button>
<button class="button" ng-click="panes[1].active = true">Select third tab</button>
</div>
</div></code></pre></pane>
<pane heading="JavaScript" plunker-content="javascript"><pre ng-non-bindable><code data-language="javascript">var TabsDemoCtrl = function ($scope) {
$scope.panes = [
{ title:"Dynamic Title 1", content:"Dynamic content 1" },
{ title:"Dynamic Title 2", content:"Dynamic content 2" }
];
};</code></pre></pane>
</tabs>
</div>
</div>
</section>
<script>var TabsDemoCtrl = function ($scope) {
$scope.panes = [
{ title:"Dynamic Title 1", content:"Dynamic content 1" },
{ title:"Dynamic Title 2", content:"Dynamic content 2" }
];
};</script>
<section id="tooltip">
<div class="page-header">
<h1>Tooltip<small>
(<a target="_blank" href="https://github.com/angular-ui/bootstrap/tree/master/src/tooltip">ui.bootstrap.tooltip</a>)
</small></h1>
</div>
<div class="row">
<div class="span6">
<div ng-controller="TooltipDemoCtrl">
<div class="well">
<div>Dynamic Tooltip Text: <input type="text" ng-model="dynamicTooltipText"></div>
<div>Dynamic Tooltip Popup Text: <input type="text" ng-model="dynamicTooltip"></div>
<p>
Pellentesque <a><span tooltip="{{dynamicTooltip}}">{{dynamicTooltipText}}</span></a>,
sit amet venenatis urna cursus eget nunc scelerisque viverra mauris, in
aliquam. Tincidunt lobortis feugiat vivamus at
<a><span tooltip-placement="left" tooltip="On the Left!">left</span></a> eget
arcu dictum varius duis at consectetur lorem. Vitae elementum curabitur
<a><span tooltip-placement="right" tooltip="On the Right!">right</span></a>
nunc sed velit dignissim sodales ut eu sem integer vitae. Turpis egestas
<a><span tooltip-placement="bottom" tooltip="On the Bottom!">bottom</span></a>
pharetra convallis posuere morbi leo urna,
<a><span tooltip-animation="true" tooltip="I fade in and out!">fading</span></a>
at elementum eu, facilisis sed odio morbi quis commodo odio. In cursus
turpis massa tincidunt dui ut.
</p>
</div>
</div>
</div>
<div class="span6">
<p>A lightweight, extensible directive for fancy tooltip creation. The tooltip
directive supports multiple placements, optional transition animation, and more.</p>
</div>
</div>
<hr>
<div class="row">
<div class="span12" ng-controller="PlunkerCtrl">
<div class="pull-right">
<button class="button button-info" id="plunk-button" ng-click="edit('1.0.5', '2.3.1', '0.2.0', 'tooltip')"><i class="icon-edit icon-white"></i> Edit in plunker</button>
</div>
<tabs>
<pane heading="Markup" plunker-content="markup"><pre ng-non-bindable><code data-language="html"><div ng-controller="TooltipDemoCtrl">
<div class="well">
<div>Dynamic Tooltip Text: <input type="text" ng-model="dynamicTooltipText"></div>
<div>Dynamic Tooltip Popup Text: <input type="text" ng-model="dynamicTooltip"></div>
<p>
Pellentesque <a><span tooltip="{{dynamicTooltip}}">{{dynamicTooltipText}}</span></a>,
sit amet venenatis urna cursus eget nunc scelerisque viverra mauris, in
aliquam. Tincidunt lobortis feugiat vivamus at
<a><span tooltip-placement="left" tooltip="On the Left!">left</span></a> eget
arcu dictum varius duis at consectetur lorem. Vitae elementum curabitur
<a><span tooltip-placement="right" tooltip="On the Right!">right</span></a>
nunc sed velit dignissim sodales ut eu sem integer vitae. Turpis egestas
<a><span tooltip-placement="bottom" tooltip="On the Bottom!">bottom</span></a>
pharetra convallis posuere morbi leo urna,