compass-jquery-plugin 0.3.2.3 → 0.3.2.4
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +54 -37
- data/VERSION.yml +1 -1
- data/lib/handle_attributes.rb +4 -4
- data/lib/handle_js_files.rb +5 -5
- data/lib/jqtouch_theme.rb +2 -2
- data/lib/jquery/dynatree.rb +2 -2
- data/lib/jquery/emulators.rb +1 -1
- data/lib/jquery/flash_messages.rb +6 -6
- data/lib/jquery/graphics.rb +5 -0
- data/lib/jquery/gridify/assertions.rb +1 -1
- data/lib/jquery/gridify/grid.rb +76 -59
- data/lib/jquery/gridify/grid_column.rb +73 -67
- data/lib/jquery/gridify/grid_finder.rb +79 -79
- data/lib/jquery/gridify/grid_options.rb +154 -149
- data/lib/jquery/gridify/grid_view.rb +143 -143
- data/lib/jquery/gridify.rb +25 -25
- data/lib/jquery/ical/calendar.rb +2 -2
- data/lib/jquery/ical/event.rb +48 -44
- data/lib/jquery/ical/helpers/ui_event_helper.rb +3 -3
- data/lib/jquery/jqgrid/jqgrid.rb +58 -58
- data/lib/jquery/jqgrid.rb +1 -1
- data/lib/jquery/jqtouch.rb +1 -1
- data/lib/jquery/jquery.rb +117 -117
- data/lib/jquery/jquery_auto_complete.rb +9 -9
- data/lib/jquery/jquery_json_response.rb +12 -12
- data/lib/jquery/jquery_selector_assertions.rb +55 -53
- data/lib/jquery/jstree.rb +2 -2
- data/lib/jquery/mobile.rb +1 -1
- data/lib/jquery/ribbon.rb +2 -2
- data/lib/jquery/secret_sauce/controller/ui_dialog_controls.rb +5 -5
- data/lib/jquery/secret_sauce/controller/ui_grid_controls.rb +5 -5
- data/lib/jquery/secret_sauce/helpers/ui_dialog_helper.rb +1 -1
- data/lib/jquery/secret_sauce/helpers/ui_form_helper.rb +39 -39
- data/lib/jquery/secret_sauce/helpers/ui_grid_helper.rb +74 -74
- data/lib/jquery/secret_sauce/model/find_for_grid.rb +21 -21
- data/lib/jquery/secret_sauce.rb +1 -1
- data/lib/jquery/tools.rb +1 -1
- data/lib/jquery_mobile_theme.rb +2 -2
- data/lib/jquery_ui_theme.rb +12 -12
- data/templates/dynatree/config/initializers/dynatree.rb +3 -3
- data/templates/dynatree/jquery/dynatree/aero.scss +16 -16
- data/templates/dynatree/jquery/dynatree/aqua.scss +16 -16
- data/templates/dynatree/jquery/dynatree/crystal.scss +16 -16
- data/templates/dynatree/jquery/dynatree/xp.scss +17 -17
- data/templates/dynatree/jquery.dynatree.js +2926 -2912
- data/templates/emulators/config/initializers/emulators.rb +6 -6
- data/templates/graphics/config/initializers/graphics.rb +5 -0
- data/templates/graphics/jquery/ganttView.scss +89 -0
- data/templates/graphics/jquery.ganttView.js +1669 -0
- data/templates/graphics/jquery.ganttView.min.js +70 -0
- data/templates/{jquery → graphics}/jquery.sparkline.js +466 -438
- data/templates/{jquery → graphics}/jquery.sparkline.min.js +0 -0
- data/templates/graphics/manifest.rb +9 -0
- data/templates/jqgrid/config/initializers/jqgrid.rb +1 -1
- data/templates/jqgrid/i18n/jqgrid/locale-ar.js +131 -125
- data/templates/jqgrid/i18n/jqgrid/locale-bg.js +135 -131
- data/templates/jqgrid/i18n/jqgrid/locale-bg1251.js +135 -131
- data/templates/jqgrid/i18n/jqgrid/locale-cat.js +132 -126
- data/templates/jqgrid/i18n/jqgrid/locale-cn.js +137 -131
- data/templates/jqgrid/i18n/jqgrid/locale-cs.js +133 -127
- data/templates/jqgrid/i18n/jqgrid/locale-da.js +132 -126
- data/templates/jqgrid/i18n/jqgrid/locale-de.js +138 -132
- data/templates/jqgrid/i18n/jqgrid/locale-el.js +131 -125
- data/templates/jqgrid/i18n/jqgrid/locale-en.js +133 -127
- data/templates/jqgrid/i18n/jqgrid/locale-es.js +133 -127
- data/templates/jqgrid/i18n/jqgrid/locale-fa.js +19 -16
- data/templates/jqgrid/i18n/jqgrid/locale-fi.js +132 -126
- data/templates/jqgrid/i18n/jqgrid/locale-fr.js +131 -125
- data/templates/jqgrid/i18n/jqgrid/locale-gl.js +131 -125
- data/templates/jqgrid/i18n/jqgrid/locale-he.js +132 -126
- data/templates/jqgrid/i18n/jqgrid/locale-hu.js +133 -127
- data/templates/jqgrid/i18n/jqgrid/locale-is.js +131 -125
- data/templates/jqgrid/i18n/jqgrid/locale-it.js +8 -1
- data/templates/jqgrid/i18n/jqgrid/locale-ja.js +139 -136
- data/templates/jqgrid/i18n/jqgrid/locale-nl.js +4 -1
- data/templates/jqgrid/i18n/jqgrid/locale-no.js +14 -1
- data/templates/jqgrid/i18n/jqgrid/locale-pl.js +132 -126
- data/templates/jqgrid/i18n/jqgrid/locale-pt-br.js +132 -126
- data/templates/jqgrid/i18n/jqgrid/locale-pt.js +130 -124
- data/templates/jqgrid/i18n/jqgrid/locale-ro.js +144 -138
- data/templates/jqgrid/i18n/jqgrid/locale-ru.js +132 -126
- data/templates/jqgrid/i18n/jqgrid/locale-sk.js +132 -126
- data/templates/jqgrid/i18n/jqgrid/locale-sr.js +133 -127
- data/templates/jqgrid/i18n/jqgrid/locale-sv.js +132 -126
- data/templates/jqgrid/i18n/jqgrid/locale-tr.js +131 -125
- data/templates/jqgrid/i18n/jqgrid/locale-ua.js +132 -126
- data/templates/jqgrid/jquery.jqGrid.js +12735 -10444
- data/templates/jqgrid/jquery.jqGrid.min.js +477 -469
- data/templates/jqgrid/public/stylesheets/ellipsis-xbl.xml +12 -10
- data/templates/jqtouch/config/initializers/jqtouch.rb +3 -3
- data/templates/jqtouch/jquery/touch/jqtouch.scss +1 -1
- data/templates/jqtouch/jquery.jqtouch.js +10025 -10043
- data/templates/jquery/config/initializers/jquery.rb +2 -4
- data/templates/jquery/history.adapter.jquery.js +71 -0
- data/templates/jquery/history.adapter.jquery.min.js +4 -0
- data/templates/jquery/history.html4.js +690 -0
- data/templates/jquery/history.html4.min.js +21 -0
- data/templates/jquery/history.js +1297 -0
- data/templates/jquery/history.min.js +29 -0
- data/templates/jquery/i18n/jquery.ui/datepicker-af.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-ar-DZ.js +19 -19
- data/templates/jquery/i18n/jquery.ui/datepicker-ar.js +19 -19
- data/templates/jquery/i18n/jquery.ui/datepicker-az.js +19 -19
- data/templates/jquery/i18n/jquery.ui/datepicker-bg.js +8 -8
- data/templates/jquery/i18n/jquery.ui/datepicker-bs.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-ca.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-cs.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-da.js +14 -14
- data/templates/jquery/i18n/jquery.ui/datepicker-de.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-el.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-en-AU.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-en-GB.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-en-NZ.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-eo.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-es.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-et.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-eu.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-fa.js +18 -18
- data/templates/jquery/i18n/jquery.ui/datepicker-fi.js +15 -15
- data/templates/jquery/i18n/jquery.ui/datepicker-fo.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-fr-CH.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-fr.js +22 -22
- data/templates/jquery/i18n/jquery.ui/datepicker-gl.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-he.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-hr.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-hu.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-hu.min.js +1 -1
- data/templates/jquery/i18n/jquery.ui/datepicker-hy.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-id.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-is.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-it.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-ja.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-ko.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-kz.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-lt.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-lv.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-ml.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-ms.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-nl.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-no.js +16 -16
- data/templates/jquery/i18n/jquery.ui/datepicker-no.min.js +2 -2
- data/templates/jquery/i18n/jquery.ui/datepicker-pl.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-pt-BR.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-pt.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-rm.js +18 -18
- data/templates/jquery/i18n/jquery.ui/datepicker-ro.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-ru.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-sk.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-sl.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-sq.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-sr-SR.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-sr.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-sv.js +14 -14
- data/templates/jquery/i18n/jquery.ui/datepicker-ta.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-th.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-tr.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-uk.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-vi.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-zh-CN.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-zh-HK.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-zh-TW.js +20 -20
- data/templates/jquery/{partials → jquery/ui}/_flash_messages.scss +0 -0
- data/templates/jquery/jquery/ui/_theme.scss +14 -13
- data/templates/jquery/jquery/ui/contextMenu/configure.png +0 -0
- data/templates/jquery/jquery/ui/contextMenu/copy.png +0 -0
- data/templates/jquery/jquery/ui/contextMenu/cut.png +0 -0
- data/templates/jquery/jquery/ui/contextMenu/delete.png +0 -0
- data/templates/jquery/jquery/ui/contextMenu/edit.png +0 -0
- data/templates/jquery/jquery/ui/contextMenu/exit.png +0 -0
- data/templates/jquery/jquery/ui/contextMenu/new.png +0 -0
- data/templates/jquery/jquery/ui/contextMenu/paste.png +0 -0
- data/templates/jquery/jquery/ui/contextMenu/rename.png +0 -0
- data/templates/jquery/jquery/ui/contextMenu/show.png +0 -0
- data/templates/jquery/jquery/ui/contextMenu/trash.png +0 -0
- data/templates/jquery/jquery/ui/contextMenu.scss +16 -10
- data/templates/jquery/jquery-ui.js +11839 -23066
- data/templates/jquery/jquery-ui.min.js +401 -795
- data/templates/jquery/jquery.bgiframe.js +27 -25
- data/templates/jquery/jquery.contextMenu.js +209 -196
- data/templates/jquery/jquery.cookie.js +3 -1
- data/templates/jquery/jquery.dotimeout.js +236 -228
- data/templates/jquery/jquery.dst.js +154 -151
- data/templates/jquery/jquery.farbtastic.js +293 -293
- data/templates/jquery/jquery.flashMessages.js +26 -0
- data/templates/jquery/jquery.flashMessages.min.js +1 -0
- data/templates/jquery/jquery.form.js +803 -786
- data/templates/jquery/jquery.haml.js +248 -247
- data/templates/jquery/jquery.hotkeys.js +89 -89
- data/templates/jquery/jquery.js +8141 -8106
- data/templates/jquery/jquery.layout.js +2451 -2415
- data/templates/jquery/jquery.min.js +167 -166
- data/templates/jquery/jquery.mousewheel.js +62 -54
- data/templates/jquery/jquery.offline.js +171 -171
- data/templates/jquery/jquery.pngFix.js +76 -76
- data/templates/jquery/jquery.replacetext.js +83 -83
- data/templates/jquery/jquery.themeswitchertool.js +202 -177
- data/templates/jquery/jquery.tmpl.js +478 -473
- data/templates/jquery/jquery.tmplPlus.js +82 -81
- data/templates/jquery/jrails.js +178 -175
- data/templates/jquery/json.js +77 -7
- data/templates/jquery/json2.js +480 -0
- data/templates/jquery/json2.min.js +7 -0
- data/templates/jquery/lib/tasks/haml.rake +2 -2
- data/templates/jquery/manifest.rb +21 -17
- data/templates/jstree/jquery.jstree.js +5967 -4536
- data/templates/mobile/config/initializers/mobile.rb +1 -1
- data/templates/mobile/jquery/mobile/_base.scss +944 -927
- data/templates/mobile/jquery/mobile/default.scss +61 -48
- data/templates/mobile/jquery/mobile/valencia.scss +56 -42
- data/templates/mobile/jquery.mobile.js +4461 -4347
- data/templates/mobile/jquery.mobile.min.js +11 -2
- data/templates/mobile/lib/tasks/jquery.mobile.rake +12 -12
- data/templates/ribbon/config/initializers/ribbon.rb +2 -2
- data/templates/ribbon/jquery.ribbon.js +50 -29
- data/templates/secret_sauce/secret_sauce.js +8 -8
- data/templates/tools/flowplayer.js +945 -1
- data/templates/tools/jquery.tools.js +4645 -4335
- data/templates/tools/jquery.tools.min.js +37 -37
- data/templates/tools/lib/tasks/jquery.tools.rake +4 -4
- data/templates/tools/swfobject.js +813 -773
- metadata +33 -21
- data/templates/jquery/haml.js +0 -506
- data/templates/jquery/haml.min.js +0 -5
- data/templates/jquery/jquery/ui/contextMenu/door.png +0 -0
- data/templates/jquery/jquery/ui/contextMenu/page_white_copy.png +0 -0
- data/templates/jquery/jquery/ui/contextMenu/page_white_delete.png +0 -0
- data/templates/jquery/jquery/ui/contextMenu/page_white_edit.png +0 -0
- data/templates/jquery/jquery/ui/contextMenu/page_white_new.png +0 -0
- data/templates/jquery/jquery/ui/contextMenu/page_white_paste.png +0 -0
- data/templates/jquery/jquery.compat-1.3.js +0 -291
- data/templates/jquery/jquery.compat-1.3.min.js +0 -6
- data/templates/jquery/jquery.flash_messages.js +0 -5
- data/templates/jquery/jquery.flash_messages.min.js +0 -1
- data/templates/jquery/jquery.history.js +0 -194
- data/templates/jquery/jquery.history.min.js +0 -5
@@ -7,476 +7,481 @@
|
|
7
7
|
* Dual licensed under the MIT or GPL Version 2 licenses.
|
8
8
|
* http://jquery.org/license
|
9
9
|
*/
|
10
|
-
(function(
|
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
|
-
|
10
|
+
(function(jQuery, undefined) {
|
11
|
+
var oldManip = jQuery.fn.domManip, tmplItmAtt = "_tmplitem", htmlExpr = /^[^<]*(<[\w\W]+>)[^>]*$|\{\{\! /,
|
12
|
+
newTmplItems = {}, wrappedItems = {}, appendToTmplItems, topTmplItem = { key: 0, data: {} }, itemKey = 0, cloneIndex = 0, stack = [];
|
13
|
+
|
14
|
+
function newTmplItem(options, parentItem, fn, data) {
|
15
|
+
// Returns a template item data structure for a new rendered instance of a template (a 'template item').
|
16
|
+
// The content field is a hierarchical array of strings and nested items (to be
|
17
|
+
// removed and replaced by nodes field of dom elements, once inserted in DOM).
|
18
|
+
var newItem = {
|
19
|
+
data: data || (parentItem ? parentItem.data : {}),
|
20
|
+
_wrap: parentItem ? parentItem._wrap : null,
|
21
|
+
tmpl: null,
|
22
|
+
parent: parentItem || null,
|
23
|
+
nodes: [],
|
24
|
+
calls: tiCalls,
|
25
|
+
nest: tiNest,
|
26
|
+
wrap: tiWrap,
|
27
|
+
html: tiHtml,
|
28
|
+
update: tiUpdate
|
29
|
+
};
|
30
|
+
if (options) {
|
31
|
+
jQuery.extend(newItem, options, { nodes: [], parent: parentItem });
|
32
|
+
}
|
33
|
+
if (fn) {
|
34
|
+
// Build the hierarchical content to be used during insertion into DOM
|
35
|
+
newItem.tmpl = fn;
|
36
|
+
newItem._ctnt = newItem._ctnt || newItem.tmpl(jQuery, newItem);
|
37
|
+
newItem.key = ++itemKey;
|
38
|
+
// Keep track of new template item, until it is stored as jQuery Data on DOM element
|
39
|
+
(stack.length ? wrappedItems : newTmplItems)[itemKey] = newItem;
|
40
|
+
}
|
41
|
+
return newItem;
|
42
|
+
}
|
43
|
+
|
44
|
+
// Override appendTo etc., in order to provide support for targeting multiple elements. (This code would disappear if integrated in jquery core).
|
45
|
+
jQuery.each({
|
46
|
+
appendTo: "append",
|
47
|
+
prependTo: "prepend",
|
48
|
+
insertBefore: "before",
|
49
|
+
insertAfter: "after",
|
50
|
+
replaceAll: "replaceWith"
|
51
|
+
}, function(name, original) {
|
52
|
+
jQuery.fn[ name ] = function(selector) {
|
53
|
+
var ret = [], insert = jQuery(selector), elems, i, l, tmplItems,
|
54
|
+
parent = this.length === 1 && this[0].parentNode;
|
55
|
+
|
56
|
+
appendToTmplItems = newTmplItems || {};
|
57
|
+
if (parent && parent.nodeType === 11 && parent.childNodes.length === 1 && insert.length === 1) {
|
58
|
+
insert[ original ](this[0]);
|
59
|
+
ret = this;
|
60
|
+
} else {
|
61
|
+
for (i = 0,l = insert.length; i < l; i++) {
|
62
|
+
cloneIndex = i;
|
63
|
+
elems = (i > 0 ? this.clone(true) : this).get();
|
64
|
+
jQuery(insert[i])[ original ](elems);
|
65
|
+
ret = ret.concat(elems);
|
66
|
+
}
|
67
|
+
cloneIndex = 0;
|
68
|
+
ret = this.pushStack(ret, name, insert.selector);
|
69
|
+
}
|
70
|
+
tmplItems = appendToTmplItems;
|
71
|
+
appendToTmplItems = null;
|
72
|
+
jQuery.tmpl.complete(tmplItems);
|
73
|
+
return ret;
|
74
|
+
};
|
75
|
+
});
|
76
|
+
|
77
|
+
jQuery.fn.extend({
|
78
|
+
// Use first wrapped element as template markup.
|
79
|
+
// Return wrapped set of template items, obtained by rendering template against data.
|
80
|
+
tmpl: function(data, options, parentItem) {
|
81
|
+
return jQuery.tmpl(this[0], data, options, parentItem);
|
82
|
+
},
|
83
|
+
|
84
|
+
// Find which rendered template item the first wrapped DOM element belongs to
|
85
|
+
tmplItem: function() {
|
86
|
+
return jQuery.tmplItem(this[0]);
|
87
|
+
},
|
88
|
+
|
89
|
+
// Consider the first wrapped element as a template declaration, and get the compiled template or store it as a named template.
|
90
|
+
template: function(name) {
|
91
|
+
return jQuery.template(name, this[0]);
|
92
|
+
},
|
93
|
+
|
94
|
+
domManip: function(args, table, callback, options) {
|
95
|
+
if (args[0] && jQuery.isArray(args[0])) {
|
96
|
+
var dmArgs = jQuery.makeArray(arguments), elems = args[0], elemsLength = elems.length, i = 0, tmplItem;
|
97
|
+
while (i < elemsLength && !(tmplItem = jQuery.data(elems[i++], "tmplItem"))) {
|
98
|
+
}
|
99
|
+
if (tmplItem && cloneIndex) {
|
100
|
+
dmArgs[2] = function(fragClone) {
|
101
|
+
// Handler called by oldManip when rendered template has been inserted into DOM.
|
102
|
+
jQuery.tmpl.afterManip(this, fragClone, callback);
|
103
|
+
};
|
104
|
+
}
|
105
|
+
oldManip.apply(this, dmArgs);
|
106
|
+
} else {
|
107
|
+
oldManip.apply(this, arguments);
|
108
|
+
}
|
109
|
+
cloneIndex = 0;
|
110
|
+
if (!appendToTmplItems) {
|
111
|
+
jQuery.tmpl.complete(newTmplItems);
|
112
|
+
}
|
113
|
+
return this;
|
114
|
+
}
|
115
|
+
});
|
116
|
+
|
117
|
+
jQuery.extend({
|
118
|
+
// Return wrapped set of template items, obtained by rendering template against data.
|
119
|
+
tmpl: function(tmpl, data, options, parentItem) {
|
120
|
+
var ret, topLevel = !parentItem;
|
121
|
+
if (topLevel) {
|
122
|
+
// This is a top-level tmpl call (not from a nested template using {{tmpl}})
|
123
|
+
parentItem = topTmplItem;
|
124
|
+
tmpl = jQuery.template[tmpl] || jQuery.template(null, tmpl);
|
125
|
+
wrappedItems = {}; // Any wrapped items will be rebuilt, since this is top level
|
126
|
+
} else if (!tmpl) {
|
127
|
+
// The template item is already associated with DOM - this is a refresh.
|
128
|
+
// Re-evaluate rendered template for the parentItem
|
129
|
+
tmpl = parentItem.tmpl;
|
130
|
+
newTmplItems[parentItem.key] = parentItem;
|
131
|
+
parentItem.nodes = [];
|
132
|
+
if (parentItem.wrapped) {
|
133
|
+
updateWrapped(parentItem, parentItem.wrapped);
|
134
|
+
}
|
135
|
+
// Rebuild, without creating a new template item
|
136
|
+
return jQuery(build(parentItem, null, parentItem.tmpl(jQuery, parentItem)));
|
137
|
+
}
|
138
|
+
if (!tmpl) {
|
139
|
+
return []; // Could throw...
|
140
|
+
}
|
141
|
+
if (typeof data === "function") {
|
142
|
+
data = data.call(parentItem || {});
|
143
|
+
}
|
144
|
+
if (options && options.wrapped) {
|
145
|
+
updateWrapped(options, options.wrapped);
|
146
|
+
}
|
147
|
+
ret = jQuery.isArray(data) ?
|
148
|
+
jQuery.map(data, function(dataItem) {
|
149
|
+
return dataItem ? newTmplItem(options, parentItem, tmpl, dataItem) : null;
|
150
|
+
}) :
|
151
|
+
[ newTmplItem(options, parentItem, tmpl, data) ];
|
152
|
+
return topLevel ? jQuery(build(parentItem, null, ret)) : ret;
|
153
|
+
},
|
154
|
+
|
155
|
+
// Return rendered template item for an element.
|
156
|
+
tmplItem: function(elem) {
|
157
|
+
var tmplItem;
|
158
|
+
if (elem instanceof jQuery) {
|
159
|
+
elem = elem[0];
|
160
|
+
}
|
161
|
+
while (elem && elem.nodeType === 1 && !(tmplItem = jQuery.data(elem, "tmplItem")) && (elem = elem.parentNode)) {
|
162
|
+
}
|
163
|
+
return tmplItem || topTmplItem;
|
164
|
+
},
|
165
|
+
|
166
|
+
// Set:
|
167
|
+
// Use $.template( name, tmpl ) to cache a named template,
|
168
|
+
// where tmpl is a template string, a script element or a jQuery instance wrapping a script element, etc.
|
169
|
+
// Use $( "selector" ).template( name ) to provide access by name to a script block template declaration.
|
170
|
+
|
171
|
+
// Get:
|
172
|
+
// Use $.template( name ) to access a cached template.
|
173
|
+
// Also $( selectorToScriptBlock ).template(), or $.template( null, templateString )
|
174
|
+
// will return the compiled template, without adding a name reference.
|
175
|
+
// If templateString includes at least one HTML tag, $.template( templateString ) is equivalent
|
176
|
+
// to $.template( null, templateString )
|
177
|
+
template: function(name, tmpl) {
|
178
|
+
if (tmpl) {
|
179
|
+
// Compile template and associate with name
|
180
|
+
if (typeof tmpl === "string") {
|
181
|
+
// This is an HTML string being passed directly in.
|
182
|
+
tmpl = buildTmplFn(tmpl)
|
183
|
+
} else if (tmpl instanceof jQuery) {
|
184
|
+
tmpl = tmpl[0] || {};
|
185
|
+
}
|
186
|
+
if (tmpl.nodeType) {
|
187
|
+
// If this is a template block, use cached copy, or generate tmpl function and cache.
|
188
|
+
tmpl = jQuery.data(tmpl, "tmpl") || jQuery.data(tmpl, "tmpl", buildTmplFn(tmpl.innerHTML));
|
189
|
+
// Issue: In IE, if the container element is not a script block, the innerHTML will remove quotes from attribute values whenever the value does not include white space.
|
190
|
+
// This means that foo="${x}" will not work if the value of x includes white space: foo="${x}" -> foo=value of x.
|
191
|
+
// To correct this, include space in tag: foo="${ x }" -> foo="value of x"
|
192
|
+
}
|
193
|
+
return typeof name === "string" ? (jQuery.template[name] = tmpl) : tmpl;
|
194
|
+
}
|
195
|
+
// Return named compiled template
|
196
|
+
return name ? (typeof name !== "string" ? jQuery.template(null, name) :
|
197
|
+
(jQuery.template[name] ||
|
198
|
+
// If not in map, treat as a selector. (If integrated with core, use quickExpr.exec)
|
199
|
+
jQuery.template(null, htmlExpr.test(name) ? name : jQuery(name)))) : null;
|
200
|
+
},
|
201
|
+
|
202
|
+
encode: function(text) {
|
203
|
+
// Do HTML encoding replacing < > & and ' and " by corresponding entities.
|
204
|
+
return ("" + text).split("<").join("<").split(">").join(">").split('"').join(""").split("'").join("'");
|
205
|
+
}
|
206
|
+
});
|
207
|
+
|
208
|
+
jQuery.extend(jQuery.tmpl, {
|
209
|
+
tag: {
|
210
|
+
"tmpl": {
|
211
|
+
_default: { $2: "null" },
|
212
|
+
open: "if($notnull_1){_=_.concat($item.nest($1,$2));}"
|
213
|
+
// tmpl target parameter can be of type function, so use $1, not $1a (so not auto detection of functions)
|
214
|
+
// This means that {{tmpl foo}} treats foo as a template (which IS a function).
|
215
|
+
// Explicit parens can be used if foo is a function that returns a template: {{tmpl foo()}}.
|
216
|
+
},
|
217
|
+
"wrap": {
|
218
|
+
_default: { $2: "null" },
|
219
|
+
open: "$item.calls(_,$1,$2);_=[];",
|
220
|
+
close: "call=$item.calls();_=call._.concat($item.wrap(call,_));"
|
221
|
+
},
|
222
|
+
"each": {
|
223
|
+
_default: { $2: "$index, $value" },
|
224
|
+
open: "if($notnull_1){$.each($1a,function($2){with(this){",
|
225
|
+
close: "}});}"
|
226
|
+
},
|
227
|
+
"if": {
|
228
|
+
open: "if(($notnull_1) && $1a){",
|
229
|
+
close: "}"
|
230
|
+
},
|
231
|
+
"else": {
|
232
|
+
_default: { $1: "true" },
|
233
|
+
open: "}else if(($notnull_1) && $1a){"
|
234
|
+
},
|
235
|
+
"html": {
|
236
|
+
// Unecoded expression evaluation.
|
237
|
+
open: "if($notnull_1){_.push($1a);}"
|
238
|
+
},
|
239
|
+
"=": {
|
240
|
+
// Encoded expression evaluation. Abbreviated form is ${}.
|
241
|
+
_default: { $1: "$data" },
|
242
|
+
open: "if($notnull_1){_.push($.encode($1a));}"
|
243
|
+
},
|
244
|
+
"!": {
|
245
|
+
// Comment tag. Skipped by parser
|
246
|
+
open: ""
|
247
|
+
}
|
248
|
+
},
|
249
|
+
|
250
|
+
// This stub can be overridden, e.g. in jquery.tmplPlus for providing rendered events
|
251
|
+
complete: function(items) {
|
252
|
+
newTmplItems = {};
|
253
|
+
},
|
254
|
+
|
255
|
+
// Call this from code which overrides domManip, or equivalent
|
256
|
+
// Manage cloning/storing template items etc.
|
257
|
+
afterManip: function afterManip(elem, fragClone, callback) {
|
258
|
+
// Provides cloned fragment ready for fixup prior to and after insertion into DOM
|
259
|
+
var content = fragClone.nodeType === 11 ?
|
260
|
+
jQuery.makeArray(fragClone.childNodes) :
|
261
|
+
fragClone.nodeType === 1 ? [fragClone] : [];
|
262
|
+
|
263
|
+
// Return fragment to original caller (e.g. append) for DOM insertion
|
264
|
+
callback.call(elem, fragClone);
|
265
|
+
|
266
|
+
// Fragment has been inserted:- Add inserted nodes to tmplItem data structure. Replace inserted element annotations by jQuery.data.
|
267
|
+
storeTmplItems(content);
|
268
|
+
cloneIndex++;
|
269
|
+
}
|
270
|
+
});
|
271
|
+
|
272
|
+
//========================== Private helper functions, used by code above ==========================
|
273
|
+
|
274
|
+
function build(tmplItem, nested, content) {
|
275
|
+
// Convert hierarchical content into flat string array
|
276
|
+
// and finally return array of fragments ready for DOM insertion
|
277
|
+
var frag, ret = content ? jQuery.map(content, function(item) {
|
278
|
+
return (typeof item === "string") ?
|
279
|
+
// Insert template item annotations, to be converted to jQuery.data( "tmplItem" ) when elems are inserted into DOM.
|
280
|
+
(tmplItem.key ? item.replace(/(<\w+)(?=[\s>])(?![^>]*_tmplitem)([^>]*)/g, "$1 " + tmplItmAtt + "=\"" + tmplItem.key + "\" $2") : item) :
|
281
|
+
// This is a child template item. Build nested template.
|
282
|
+
build(item, tmplItem, item._ctnt);
|
283
|
+
}) :
|
284
|
+
// If content is not defined, insert tmplItem directly. Not a template item. May be a string, or a string array, e.g. from {{html $item.html()}}.
|
285
|
+
tmplItem;
|
286
|
+
if (nested) {
|
287
|
+
return ret;
|
288
|
+
}
|
289
|
+
|
290
|
+
// top-level template
|
291
|
+
ret = ret.join("");
|
292
|
+
|
293
|
+
// Support templates which have initial or final text nodes, or consist only of text
|
294
|
+
// Also support HTML entities within the HTML markup.
|
295
|
+
ret.replace(/^\s*([^<\s][^<]*)?(<[\w\W]+>)([^>]*[^>\s])?\s*$/, function(all, before, middle, after) {
|
296
|
+
frag = jQuery(middle).get();
|
297
|
+
|
298
|
+
storeTmplItems(frag);
|
299
|
+
if (before) {
|
300
|
+
frag = unencode(before).concat(frag);
|
301
|
+
}
|
302
|
+
if (after) {
|
303
|
+
frag = frag.concat(unencode(after));
|
304
|
+
}
|
305
|
+
});
|
306
|
+
return frag ? frag : unencode(ret);
|
307
|
+
}
|
308
|
+
|
309
|
+
function unencode(text) {
|
310
|
+
// Use createElement, since createTextNode will not render HTML entities correctly
|
311
|
+
var el = document.createElement("div");
|
312
|
+
el.innerHTML = text;
|
313
|
+
return jQuery.makeArray(el.childNodes);
|
314
|
+
}
|
315
|
+
|
316
|
+
// Generate a reusable function that will serve to render a template against data
|
317
|
+
function buildTmplFn(markup) {
|
318
|
+
return new Function("jQuery", "$item",
|
319
|
+
"var $=jQuery,call,_=[],$data=$item.data;" +
|
320
|
+
|
321
|
+
// Introduce the data as local variables using with(){}
|
322
|
+
"with($data){_.push('" +
|
323
|
+
|
324
|
+
// Convert the template into pure JavaScript
|
325
|
+
jQuery.trim(markup)
|
326
|
+
.replace(/([\\'])/g, "\\$1")
|
327
|
+
.replace(/[\r\t\n]/g, " ")
|
328
|
+
.replace(/\$\{([^\}]*)\}/g, "{{= $1}}")
|
329
|
+
.replace(/\{\{(\/?)(\w+|.)(?:\(((?:[^\}]|\}(?!\}))*?)?\))?(?:\s+(.*?)?)?(\(((?:[^\}]|\}(?!\}))*?)\))?\s*\}\}/g,
|
330
|
+
function(all, slash, type, fnargs, target, parens, args) {
|
331
|
+
var tag = jQuery.tmpl.tag[ type ], def, expr, exprAutoFnDetect;
|
332
|
+
if (!tag) {
|
333
|
+
throw "Template command not found: " + type;
|
334
|
+
}
|
335
|
+
def = tag._default || [];
|
336
|
+
if (parens && !/\w$/.test(target)) {
|
337
|
+
target += parens;
|
338
|
+
parens = "";
|
339
|
+
}
|
340
|
+
if (target) {
|
341
|
+
target = unescape(target);
|
342
|
+
args = args ? ("," + unescape(args) + ")") : (parens ? ")" : "");
|
343
|
+
// Support for target being things like a.toLowerCase();
|
344
|
+
// In that case don't call with template item as 'this' pointer. Just evaluate...
|
345
|
+
expr = parens ? (target.indexOf(".") > -1 ? target + unescape(parens) : ("(" + target + ").call($item" + args)) : target;
|
346
|
+
exprAutoFnDetect = parens ? expr : "(typeof(" + target + ")==='function'?(" + target + ").call($item):(" + target + "))";
|
347
|
+
} else {
|
348
|
+
exprAutoFnDetect = expr = def.$1 || "null";
|
349
|
+
}
|
350
|
+
fnargs = unescape(fnargs);
|
351
|
+
return "');" +
|
352
|
+
tag[ slash ? "close" : "open" ]
|
353
|
+
.split("$notnull_1").join(target ? "typeof(" + target + ")!=='undefined' && (" + target + ")!=null" : "true")
|
354
|
+
.split("$1a").join(exprAutoFnDetect)
|
355
|
+
.split("$1").join(expr)
|
356
|
+
.split("$2").join(fnargs || def.$2 || "") +
|
357
|
+
"_.push('";
|
358
|
+
}) +
|
359
|
+
"');}return _;"
|
360
|
+
);
|
361
|
+
}
|
362
|
+
|
363
|
+
function updateWrapped(options, wrapped) {
|
364
|
+
// Build the wrapped content.
|
365
|
+
options._wrap = build(options, true,
|
366
|
+
// Suport imperative scenario in which options.wrapped can be set to a selector or an HTML string.
|
367
|
+
jQuery.isArray(wrapped) ? wrapped : [htmlExpr.test(wrapped) ? wrapped : jQuery(wrapped).html()]
|
368
|
+
).join("");
|
369
|
+
}
|
370
|
+
|
371
|
+
function unescape(args) {
|
372
|
+
return args ? args.replace(/\\'/g, "'").replace(/\\\\/g, "\\") : null;
|
373
|
+
}
|
374
|
+
|
375
|
+
function outerHtml(elem) {
|
376
|
+
var div = document.createElement("div");
|
377
|
+
div.appendChild(elem.cloneNode(true));
|
378
|
+
return div.innerHTML;
|
379
|
+
}
|
380
|
+
|
381
|
+
// Store template items in jQuery.data(), ensuring a unique tmplItem data data structure for each rendered template instance.
|
382
|
+
function storeTmplItems(content) {
|
383
|
+
var keySuffix = "_" + cloneIndex, elem, elems, newClonedItems = {}, i, l, m;
|
384
|
+
for (i = 0,l = content.length; i < l; i++) {
|
385
|
+
if ((elem = content[i]).nodeType !== 1) {
|
386
|
+
continue;
|
387
|
+
}
|
388
|
+
elems = elem.getElementsByTagName("*");
|
389
|
+
for (m = elems.length - 1; m >= 0; m--) {
|
390
|
+
processItemKey(elems[m]);
|
391
|
+
}
|
392
|
+
processItemKey(elem);
|
393
|
+
}
|
394
|
+
function processItemKey(el) {
|
395
|
+
var pntKey, pntNode = el, pntItem, tmplItem, key;
|
396
|
+
// Ensure that each rendered template inserted into the DOM has its own template item,
|
397
|
+
if ((key = el.getAttribute(tmplItmAtt))) {
|
398
|
+
while (pntNode.parentNode && (pntNode = pntNode.parentNode).nodeType === 1 && !(pntKey = pntNode.getAttribute(tmplItmAtt))) {
|
399
|
+
}
|
400
|
+
if (pntKey !== key) {
|
401
|
+
// The next ancestor with a _tmplitem expando is on a different key than this one.
|
402
|
+
// So this is a top-level element within this template item
|
403
|
+
// Set pntNode to the key of the parentNode, or to 0 if pntNode.parentNode is null, or pntNode is a fragment.
|
404
|
+
pntNode = pntNode.parentNode ? (pntNode.nodeType === 11 ? 0 : (pntNode.getAttribute(tmplItmAtt) || 0)) : 0;
|
405
|
+
if (!(tmplItem = newTmplItems[key])) {
|
406
|
+
// The item is for wrapped content, and was copied from the temporary parent wrappedItem.
|
407
|
+
tmplItem = wrappedItems[key];
|
408
|
+
tmplItem = newTmplItem(tmplItem, newTmplItems[pntNode] || wrappedItems[pntNode]);
|
409
|
+
tmplItem.key = ++itemKey;
|
410
|
+
newTmplItems[itemKey] = tmplItem;
|
411
|
+
}
|
412
|
+
if (cloneIndex) {
|
413
|
+
cloneTmplItem(key);
|
414
|
+
}
|
415
|
+
}
|
416
|
+
el.removeAttribute(tmplItmAtt);
|
417
|
+
} else if (cloneIndex && (tmplItem = jQuery.data(el, "tmplItem"))) {
|
418
|
+
// This was a rendered element, cloned during append or appendTo etc.
|
419
|
+
// TmplItem stored in jQuery data has already been cloned in cloneCopyEvent. We must replace it with a fresh cloned tmplItem.
|
420
|
+
cloneTmplItem(tmplItem.key);
|
421
|
+
newTmplItems[tmplItem.key] = tmplItem;
|
422
|
+
pntNode = jQuery.data(el.parentNode, "tmplItem");
|
423
|
+
pntNode = pntNode ? pntNode.key : 0;
|
424
|
+
}
|
425
|
+
if (tmplItem) {
|
426
|
+
pntItem = tmplItem;
|
427
|
+
// Find the template item of the parent element.
|
428
|
+
// (Using !=, not !==, since pntItem.key is number, and pntNode may be a string)
|
429
|
+
while (pntItem && pntItem.key != pntNode) {
|
430
|
+
// Add this element as a top-level node for this rendered template item, as well as for any
|
431
|
+
// ancestor items between this item and the item of its parent element
|
432
|
+
pntItem.nodes.push(el);
|
433
|
+
pntItem = pntItem.parent;
|
434
|
+
}
|
435
|
+
// Delete content built during rendering - reduce API surface area and memory use, and avoid exposing of stale data after rendering...
|
436
|
+
delete tmplItem._ctnt;
|
437
|
+
delete tmplItem._wrap;
|
438
|
+
// Store template item as jQuery data on the element
|
439
|
+
jQuery.data(el, "tmplItem", tmplItem);
|
440
|
+
}
|
441
|
+
function cloneTmplItem(key) {
|
442
|
+
key = key + keySuffix;
|
443
|
+
tmplItem = newClonedItems[key] =
|
444
|
+
(newClonedItems[key] || newTmplItem(tmplItem, newTmplItems[tmplItem.parent.key + keySuffix] || tmplItem.parent));
|
445
|
+
}
|
446
|
+
}
|
447
|
+
}
|
448
|
+
|
449
|
+
//---- Helper functions for template item ----
|
450
|
+
|
451
|
+
function tiCalls(content, tmpl, data, options) {
|
452
|
+
if (!content) {
|
453
|
+
return stack.pop();
|
454
|
+
}
|
455
|
+
stack.push({ _: content, tmpl: tmpl, item:this, data: data, options: options });
|
456
|
+
}
|
457
|
+
|
458
|
+
function tiNest(tmpl, data, options) {
|
459
|
+
// nested template, using {{tmpl}} tag
|
460
|
+
return jQuery.tmpl(jQuery.template(tmpl), data, options, this);
|
461
|
+
}
|
462
|
+
|
463
|
+
function tiWrap(call, wrapped) {
|
464
|
+
// nested template, using {{wrap}} tag
|
465
|
+
var options = call.options || {};
|
466
|
+
options.wrapped = wrapped;
|
467
|
+
// Apply the template, which may incorporate wrapped content,
|
468
|
+
return jQuery.tmpl(jQuery.template(call.tmpl), call.data, options, call.item);
|
469
|
+
}
|
470
|
+
|
471
|
+
function tiHtml(filter, textOnly) {
|
472
|
+
var wrapped = this._wrap;
|
473
|
+
return jQuery.map(
|
474
|
+
jQuery(jQuery.isArray(wrapped) ? wrapped.join("") : wrapped).filter(filter || "*"),
|
475
|
+
function(e) {
|
476
|
+
return textOnly ?
|
477
|
+
e.innerText || e.textContent :
|
478
|
+
e.outerHTML || outerHtml(e);
|
479
|
+
});
|
480
|
+
}
|
481
|
+
|
482
|
+
function tiUpdate() {
|
483
|
+
var coll = this.nodes;
|
484
|
+
jQuery.tmpl(null, null, null, this).insertBefore(coll[0]);
|
485
|
+
jQuery(coll).remove();
|
486
|
+
}
|
487
|
+
})(jQuery);
|