Skip to content
This repository was archived by the owner on Sep 8, 2020. It is now read-only.

Commit fa98004

Browse files
committed
fix(demo) updated demo
Signed-off-by: Josh Kurz <josh.kurz@turner.com>
1 parent 3587759 commit fa98004

File tree

2 files changed

+83
-35
lines changed

2 files changed

+83
-35
lines changed

demo/calendarDemo.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,6 @@ function CalendarCtrl($scope) {
110110
eventResize: $scope.alertOnResize
111111
}
112112
};
113-
$scope.uiConfig = {calendar: {}};
114113

115114
$scope.changeLang = function() {
116115
if($scope.changeTo === 'Hungarian'){

demo/index.html

Lines changed: 83 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,8 @@
88
<link rel="stylesheet" href="calendarDemo.css" />
99

1010
<script src="../bower_components/jquery/jquery.js"></script>
11+
<script src="../bower_components/jquery-ui/ui/jquery-ui.js"></script>
1112

12-
<script src="../bower_components/jquery-ui/ui/jquery.ui.core.js"></script>
13-
<script src="../bower_components/jquery-ui/ui/jquery.ui.widget.js"></script>
14-
<script src="../bower_components/jquery-ui/ui/jquery.ui.mouse.js"></script>
15-
<script src="../bower_components/jquery-ui/ui/jquery.ui.draggable.js"></script>
16-
<script src="../bower_components/jquery-ui/ui/jquery.ui.droppable.js"></script>
1713
<script src="../bower_components/angular/angular.js"></script>
1814
<script src="http://angular-ui.github.io/bootstrap/ui-bootstrap-tpls-0.9.0.js"></script>
1915
<script src="../bower_components/fullcalendar/fullcalendar.js"></script>
@@ -36,7 +32,7 @@
3632
<li><a href="http://angular-ui.github.com/bootstrap/">Bootstrap</a></li>
3733
<li><a href="http://angular-ui.github.com/ng-grid/">Grid</a></li>
3834
<li><a href="https://github.com/angular-ui/AngularJs.tmbundle">AngularJS.tmbundle</a></li>
39-
<li><a href="http://angular-ui.github.com/ui-router/">Router <span
35+
<li><a href="http://angular-ui.github.io/ui-router/sample/">Router <span
4036
class="label label-success">New!</span></a></li>
4137
<li><a href="http://angular-ui.github.com/Tips-n-Tricks/">Tips-n-Tricks <span
4238
class="label">WIP</span></a></li>
@@ -45,10 +41,44 @@
4541
</div>
4642
</div>
4743
</header>
44+
<div class="hero-unit">
45+
<div class="container">
46+
<h1>UI Calendar</h1>
47+
<p>A complete AngularJS directive for the <a href="http://arshaw.com/fullcalendar/">Arshaw FullCalendar</a>.</p>
48+
<p class="btn-group">
49+
<a href="https://github.com/angular-ui/ui-calendar" class='btn'><i class='icon-github'></i> Code on Github</a>
50+
<a href="https://github.com/angular-ui/ui-calendar/archive/master.zip" class='btn btn-primary'><i class="icon-download-alt icon-white"></i> Download <small>(0.1.3)</small></a>
51+
</p>
52+
</div>
53+
<div class="bs-docs-social">
54+
<div class="container">
55+
<ul class="bs-docs-social-buttons">
56+
<li>
57+
<iframe src="http://ghbtns.com/github-btn.html?user=angular-ui&amp;repo=ui-calendar&amp;type=watch&amp;count=true" allowtransparency="true" frameborder="0" scrolling="0" width="110" height="20"></iframe>
58+
</li>
59+
<li>
60+
<iframe src="http://ghbtns.com/github-btn.html?user=angular-ui&amp;repo=ui-calendar&amp;type=fork&amp;count=true" allowtransparency="true" frameborder="0" scrolling="0" width="95" height="20"></iframe>
61+
</li>
62+
<li>
63+
<div class="g-plusone" data-size="medium"></div>
64+
<!-- Place this tag after the last +1 button tag. -->
65+
<script type="text/javascript">
66+
(function () {
67+
var po = document.createElement('script');
68+
po.type = 'text/javascript';
69+
po.async = true;
70+
po.src = 'https://apis.google.com/js/plusone.js';
71+
var s = document.getElementsByTagName('script')[0];
72+
s.parentNode.insertBefore(po, s);
73+
})();
74+
</script>
75+
</li>
76+
</ul>
77+
</div>
78+
</div>
79+
</div>
4880
<div role="main">
49-
5081
<div class="container">
51-
5282
<section id="directives-calendar" ng-controller="CalendarCtrl">
5383
<div class="page-header">
5484
<h1>UI-Calendar</h1>
@@ -81,7 +111,8 @@ <h3>Why?</h3>
81111
<li ng-repeat="e in events">
82112
<div class="alert alert-info">
83113
<a class="close" ng-click="remove($index)"><i class="icon-remove"></i></a>
84-
<b> <input ng-model="e.title"></b> - {{e.start | date:"MMM dd"}}
114+
<b> <input ng-model="e.title"></b>
115+
{{e.start | date:"MMM dd"}} - {{e.end | date:"MMM dd"}}
85116
</div>
86117
</li>
87118
</ul>
@@ -115,7 +146,7 @@ <h4>{{alertMessage}}</h4>
115146
<h4>{{alertMessage}}</h4>
116147
</div>
117148
<div class="btn-toolbar">
118-
<p class="pull-right lead">Calendar One View Options</p>
149+
<p class="pull-right lead">Calendar Two View Options</p>
119150
<div class="btn-group">
120151
<button class="btn btn-success" ng-click="changeView('agendaDay', myCalendar2)">AgendaDay</button>
121152
<button class="btn btn-success" ng-click="changeView('agendaWeek', myCalendar2)">AgendaWeek</button>
@@ -132,7 +163,7 @@ <h4>{{alertMessage}}</h4>
132163
<h4>This calendar uses the extended form</h4>
133164
</div>
134165
<div class="btn-toolbar">
135-
<p class="pull-right lead">Calendar One View Options</p>
166+
<p class="pull-right lead">Calendar Three View Options</p>
136167
<div class="btn-group">
137168
<button class="btn btn-success" ng-click="changeView('agendaDay', myCalendar3)">AgendaDay</button>
138169
<button class="btn btn-success" ng-click="changeView('agendaWeek', myCalendar3)">AgendaWeek</button>
@@ -146,10 +177,13 @@ <h4>This calendar uses the extended form</h4>
146177
</div>
147178
</div>
148179
<h3>How?</h3>
149-
<pre class="prettyprint linenums">
180+
<pre class="prettyprint linenums">
150181
&lt;div ui-calendar="uiConfig.calendar" class="span8 calendar" ng-model="eventSources"&gt;&lt;/div&gt;
151182

152-
angular.module('calendarDemoApp', ['ui.calendar']);
183+
/**
184+
* calendarDemoApp - 0.1.3
185+
*/
186+
angular.module('calendarDemoApp', ['ui.calendar', 'ui.bootstrap']);
153187

154188
function CalendarCtrl($scope) {
155189
var date = new Date();
@@ -179,6 +213,16 @@ <h3>How?</h3>
179213
var events = [{title: 'Feed Me ' + m,start: s + (50000),end: s + (100000),allDay: false, className: ['customFeed']}];
180214
callback(events);
181215
};
216+
217+
$scope.calEventsExt = {
218+
color: '#f00',
219+
textColor: 'yellow',
220+
events: [
221+
{type:'party',title: 'Lunch',start: new Date(y, m, d, 12, 0),end: new Date(y, m, d, 14, 0),allDay: false},
222+
{type:'party',title: 'Lunch 2',start: new Date(y, m, d, 12, 0),end: new Date(y, m, d, 14, 0),allDay: false},
223+
{type:'party',title: 'Click for Google',start: new Date(y, m, 28),end: new Date(y, m, 29),url: 'http://google.com/'}
224+
]
225+
};
182226
/* alert on eventClick */
183227
$scope.alertEventOnClick = function( date, allDay, jsEvent, view ){
184228
$scope.$apply(function(){
@@ -224,17 +268,21 @@ <h3>How?</h3>
224268
$scope.events.splice(index,1);
225269
};
226270
/* Change View */
227-
$scope.changeView = function(view, calendar) {
271+
$scope.changeView = function(view,calendar) {
228272
calendar.fullCalendar('changeView',view);
229273
};
274+
/* Change View */
275+
$scope.renderCalender = function(calendar) {
276+
calendar.fullCalendar('render');
277+
};
230278
/* config object */
231279
$scope.uiConfig = {
232280
calendar:{
233281
height: 450,
234282
editable: true,
235283
header:{
236-
left: 'month basicWeek basicDay agendaWeek agendaDay',
237-
center: 'title',
284+
left: 'title',
285+
center: '',
238286
right: 'today prev,next'
239287
},
240288
dayClick: $scope.alertEventOnClick,
@@ -244,28 +292,29 @@ <h3>How?</h3>
244292
};
245293
/* event sources array*/
246294
$scope.eventSources = [$scope.events, $scope.eventSource, $scope.eventsF];
295+
$scope.eventSources2 = [$scope.calEventsExt, $scope.eventsF, $scope.events];
247296
}
248-
</pre>
297+
/* EOF */
298+
299+
</pre>
249300
</section>
250301
</div>
251302
</div>
303+
<script type="text/javascript">
252304

253-
<script type="text/javascript">
254-
255-
var _gaq = _gaq || [];
256-
_gaq.push(['_setAccount', 'UA-17352735-3']);
257-
_gaq.push(['_trackPageview']);
258-
259-
(function () {
260-
var ga = document.createElement('script');
261-
ga.type = 'text/javascript';
262-
ga.async = true;
263-
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
264-
var s = document.getElementsByTagName('script')[0];
265-
s.parentNode.insertBefore(ga, s);
266-
})();
305+
var _gaq = _gaq || [];
306+
_gaq.push(['_setAccount', 'UA-17352735-3']);
307+
_gaq.push(['_trackPageview']);
267308

268-
</script>
309+
(function () {
310+
var ga = document.createElement('script');
311+
ga.type = 'text/javascript';
312+
ga.async = true;
313+
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
314+
var s = document.getElementsByTagName('script')[0];
315+
s.parentNode.insertBefore(ga, s);
316+
})();
269317

270-
</body>
271-
</html>
318+
</script>
319+
</body>
320+
</html>

0 commit comments

Comments
 (0)