1
+ <!DOCTYPE html>
2
+
3
+ < html >
4
+
5
+ < head >
6
+
7
+ < title > CalenStyle with AngularJS</ title >
8
+
9
+ < script type ="text/javascript " src ="../../js/jquery-1.11.1.min.js "> </ script >
10
+ < script type ="text/javascript " src ="../../js/jquery-ui-custom-1.11.2.min.js "> </ script >
11
+ < link rel ="stylesheet " type ="text/css " href ="../../css/jquery-ui-custom-1.11.2.min.css " />
12
+
13
+ < script type ="text/javascript " src ="../../js/angular.min.js "> </ script >
14
+
15
+ < script type ="text/javascript " src ="../../js/jquery.ui.touch-punch.js "> </ script >
16
+ < script type ="text/javascript " src ="../../js/hammer.min.js "> </ script >
17
+ < script type ="text/javascript " src ="../../js/fastclick.js "> </ script >
18
+
19
+ < link rel ="stylesheet " type ="text/css " href ="../../../src/calenstyle.css " />
20
+ < link rel ="stylesheet " type ="text/css " href ="../../../src/calenstyle-jquery-ui-override.css " />
21
+ < link rel ="stylesheet " type ="text/css " href ="../../../src/calenstyle-iconfont.css " />
22
+ < script type ="text/javascript " src ="../../../src/calenstyle.js "> </ script >
23
+
24
+ < link rel ="stylesheet " type ="text/css " href ="../../css/CalEventList.css " />
25
+ < script type ="text/javascript " src ="../../js/CalJsonGenerator.js "> </ script >
26
+
27
+
28
+ < style type ="text/css ">
29
+
30
+ .calendarContOuter
31
+ {
32
+ position : absolute;
33
+ left : 0px ;
34
+ right : 0px ;
35
+ top : 0px ;
36
+ bottom : 0px ;
37
+
38
+ font-size : 14px ;
39
+ text-shadow : none;
40
+ }
41
+
42
+ .cElemDatePicker
43
+ {
44
+ font-size : 13px ;
45
+ }
46
+
47
+ .cdlvDaysTableRowCustom
48
+ {
49
+ display : -webkit-flex; /* Safari */
50
+ -webkit-flex-direction : row; /* Safari 6.1+ */
51
+ -webkit-flex-wrap : wrap-reverse;
52
+ -webkit-justify-content : center;
53
+
54
+ display : flex;
55
+ flex-direction : row;
56
+ flex-wrap : wrap-reverse;
57
+ justify-content : center;
58
+ align-content : flex-start;
59
+
60
+ padding : 2px ;
61
+ }
62
+
63
+ .custEvent
64
+ {
65
+ display : inline-block;
66
+ width : 5px ;
67
+ height : 5px ;
68
+ line-height : 5px ;
69
+
70
+ margin : 1px 2px ;
71
+
72
+ text-align : center;
73
+ }
74
+
75
+ @media screen and (max-width : 500px ), (max-height : 400px )
76
+ {
77
+ .custEvent
78
+ {
79
+ display : inline-block;
80
+ width : 4px ;
81
+ height : 4px ;
82
+ line-height : 4px ;
83
+
84
+ margin : 1px 2px ;
85
+
86
+ text-align : center;
87
+ }
88
+ }
89
+
90
+ </ style >
91
+
92
+ < script type ="text/javascript ">
93
+
94
+
95
+ angular . module ( "App-CS" , [ ] ) ;
96
+
97
+ $ ( document ) . ready ( function ( )
98
+ {
99
+ $ ( ".calendarContOuter" ) . CalenStyle (
100
+ {
101
+ sectionsList : [ "Header" , "Calendar" , "EventList" ] ,
102
+
103
+ headerSectionsList :
104
+ {
105
+ left : [ "HeaderLabelWithDropdownMenuArrow" ] ,
106
+ center : [ ] ,
107
+ right : [ "PreviousButton" , "NextButton" ]
108
+ } ,
109
+
110
+ visibleView : "DayEventListView" ,
111
+
112
+ daysInDayListView : 3 ,
113
+
114
+ eventIndicatorInDayListView : "Custom" ,
115
+
116
+ dropdownMenuElements : [ "DatePicker" ] ,
117
+
118
+ displayEventsForPeriodInList : function ( listStartDate , listEndDate )
119
+ {
120
+ return displayEventsInList ( this , listStartDate , listEndDate ) ;
121
+ } ,
122
+
123
+ eventListAppended : function ( )
124
+ {
125
+ adjustList ( ) ;
126
+ } ,
127
+
128
+ calDataSource :
129
+ [
130
+ {
131
+ sourceFetchType : "DateRange" ,
132
+ sourceType : "FUNCTION" ,
133
+ source : function ( fetchStartDate , fetchEndDate , durationStartDate , durationEndDate , oConfig , loadViewCallback )
134
+ {
135
+ var calObj1 = this ;
136
+ calObj1 . incrementDataLoadingCount ( 1 ) ;
137
+
138
+ var oEventResponse = generateJsonEvents ( fetchStartDate , fetchEndDate ) ;
139
+ console . log ( "Response " + fetchStartDate + " " + fetchEndDate ) ;
140
+ console . log ( oEventResponse ) ;
141
+ if ( oEventResponse != undefined )
142
+ {
143
+ if ( oEventResponse [ 0 ] )
144
+ {
145
+ calObj1 . parseDataSource ( "eventSource" , oEventResponse [ 1 ] , durationStartDate , durationEndDate , loadViewCallback , oConfig , false ) ;
146
+ }
147
+ }
148
+ }
149
+ }
150
+ ] ,
151
+
152
+ modifyCustomView : function ( dArrViewDates )
153
+ {
154
+ var calObj1 = this ;
155
+
156
+ for ( var iTempIndex = 0 ; iTempIndex < dArrViewDates . length ; iTempIndex ++ )
157
+ {
158
+ var dThisDate = dArrViewDates [ iTempIndex ] ,
159
+ sDayId = "#cdlvRowDay" + iTempIndex ,
160
+ oArrEvents = calObj1 . getArrayOfEventsForView ( dThisDate , dThisDate ) ,
161
+ sTempStr = "" ,
162
+ iTempIndex2 ,
163
+ sBgColor = "" , bIsMarkedG = false ;
164
+
165
+ for ( iTempIndex2 = 0 ; iTempIndex2 < oArrEvents . length ; iTempIndex2 ++ )
166
+ {
167
+ var oEvent = oArrEvents [ iTempIndex2 ] ,
168
+ sEventColor = oEvent . fromSingleColor ? oEvent . textColor : oEvent . backgroundColor ,
169
+ bIsMarked = ( $ . cf . isValid ( oEvent . isMarked ) && oEvent . isMarked ) ;
170
+ if ( bIsMarked )
171
+ {
172
+ bIsMarkedG = true ;
173
+ sBgColor = oEvent . fromSingleColor ? oEvent . backgroundColor : $ . cf . addHashToHexcode ( oEvent . backgroundColor , 0.1 ) ;
174
+ }
175
+
176
+ sTempStr += "<span class='custEvent' style='background: " + sEventColor + ";'></span>" ;
177
+ }
178
+
179
+ var sTemp = sTempStr ;
180
+ /*
181
+ for(iTempIndex3 = 0; iTempIndex3 < 15; iTempIndex3++)
182
+ {
183
+ sTemp += sTempStr;
184
+ }
185
+ */
186
+
187
+ if ( bIsMarkedG )
188
+ $ ( calObj1 . elem ) . find ( sDayId ) . css ( { "background" : sBgColor } ) ;
189
+
190
+ $ ( calObj1 . elem ) . find ( sDayId + " .cdlvDaysTableRowCustom" ) . html ( sTemp ) ;
191
+ }
192
+
193
+ calObj1 . addRemoveViewLoader ( false , "cEventLoaderBg" ) ;
194
+ calObj1 . addRemoveLoaderIndicators ( false , "cEventLoaderIndicator" ) ;
195
+
196
+ //alert("Modified CustomView");
197
+ } ,
198
+
199
+ useHammerjsAsGestureLibrary : true ,
200
+
201
+ //hideEventIcon: {Default: false},
202
+
203
+ hideEventTime : { Default : true }
204
+
205
+ } ) ;
206
+
207
+ adjustList ( ) ;
208
+ $ ( window ) . resize ( function ( )
209
+ {
210
+ adjustList ( ) ;
211
+ } ) ;
212
+
213
+ function adjustList ( )
214
+ {
215
+ var oCal3 = $ ( ".calendarContOuter" ) . CalenStyle ( ) ;
216
+ var iEventWidth = $ ( oCal3 . elem ) . width ( ) ,
217
+ iEventColorWidth = $ ( ".cListEventColor" ) . outerWidth ( true ) ,
218
+ iEventIconWidth = $ ( ".cListEventIcon span" ) . outerWidth ( true ) ,
219
+ oElems = $ ( ".cListEventTime span" ) ;
220
+ var iMaxWidth = Math . max . apply ( null , $ ( oElems ) . map ( function ( )
221
+ {
222
+ return $ ( this ) . outerWidth ( true ) ;
223
+ } ) . get ( ) ) ;
224
+ iMaxWidth += 5 ;
225
+ $ ( ".cListEventTime" ) . css ( { "width" : iMaxWidth } ) ;
226
+
227
+ var iEventTitleWidth = iEventWidth - ( iEventColorWidth + iMaxWidth + iEventIconWidth ) - 25 ;
228
+ $ ( ".cListEventTitle" ) . css ( { "width" : iEventTitleWidth } ) ;
229
+ }
230
+
231
+ } ) ;
232
+ </ script >
233
+
234
+ </ head >
235
+
236
+ < body ng-app ="App-CS ">
237
+
238
+ < div class ="calendarContOuter "> </ div >
239
+
240
+ </ body >
241
+
242
+ </ html >
0 commit comments