compass-jquery-plugin 0.3.2.8 → 0.3.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (542) hide show
  1. data/README.md +24 -6
  2. data/VERSION.yml +3 -3
  3. data/lib/jquery/gridify/grid_column.rb +6 -6
  4. data/lib/jquery/gridify/grid_options.rb +4 -4
  5. data/lib/jquery/mark_it_up.rb +2 -0
  6. data/lib/jquery/mobile.rb +0 -1
  7. data/templates/dynatree/jquery.dynatree.js +2896 -2880
  8. data/templates/dynatree/jquery.dynatree.min.js +55 -54
  9. data/templates/dynatree/jquery/dynatree/aero.scss +4 -2
  10. data/templates/dynatree/jquery/dynatree/aqua.scss +4 -2
  11. data/templates/dynatree/jquery/dynatree/crystal.scss +4 -2
  12. data/templates/dynatree/jquery/dynatree/xp.scss +5 -3
  13. data/templates/emulators/emulators/bb.playbook.landscape.png +0 -0
  14. data/templates/emulators/emulators/bb.playbook.landscape.scss +18 -0
  15. data/templates/emulators/emulators/bb.playbook.portrait.png +0 -0
  16. data/templates/emulators/emulators/bb.playbook.portrait.scss +18 -0
  17. data/templates/emulators/emulators/{blackberry.torch.landscape.png → bb.torch.landscape.png} +0 -0
  18. data/templates/emulators/emulators/{blackberry.torch.landscape.scss → bb.torch.landscape.scss} +1 -3
  19. data/templates/emulators/emulators/{blackberry.torch.portrait.png → bb.torch.portrait.png} +0 -0
  20. data/templates/emulators/emulators/{blackberry.torch.portrait.scss → bb.torch.portrait.scss} +1 -3
  21. data/templates/emulators/emulators/galaxy.ace.landscape.png +0 -0
  22. data/templates/emulators/emulators/galaxy.ace.landscape.scss +18 -0
  23. data/templates/emulators/emulators/galaxy.ace.portrait.png +0 -0
  24. data/templates/emulators/emulators/galaxy.ace.portrait.scss +18 -0
  25. data/templates/emulators/emulators/galaxy.s.landscape.scss +0 -2
  26. data/templates/emulators/emulators/galaxy.s.portrait.scss +0 -2
  27. data/templates/emulators/emulators/galaxy.s2.landscape.scss +0 -2
  28. data/templates/emulators/emulators/galaxy.s2.portrait.scss +0 -2
  29. data/templates/emulators/emulators/galaxy.tab.10.1.landscape.scss +0 -2
  30. data/templates/emulators/emulators/galaxy.tab.10.1.portrait.scss +0 -2
  31. data/templates/emulators/emulators/galaxy.tab.7.landscape.scss +0 -2
  32. data/templates/emulators/emulators/galaxy.tab.7.portrait.scss +0 -2
  33. data/templates/emulators/emulators/galaxy.tab.8.9.landscape.scss +0 -2
  34. data/templates/emulators/emulators/galaxy.tab.8.9.portrait.scss +0 -2
  35. data/templates/emulators/emulators/htc.sensation.landscape.png +0 -0
  36. data/templates/emulators/emulators/htc.sensation.landscape.scss +18 -0
  37. data/templates/emulators/emulators/htc.sensation.portrait.png +0 -0
  38. data/templates/emulators/emulators/htc.sensation.portrait.scss +18 -0
  39. data/templates/emulators/emulators/ipad.landscape.scss +0 -2
  40. data/templates/emulators/emulators/ipad.portrait.scss +0 -2
  41. data/templates/emulators/emulators/iphone.3.landscape.scss +0 -2
  42. data/templates/emulators/emulators/iphone.3.portrait.scss +0 -2
  43. data/templates/emulators/emulators/{iphone.4.landscape .scss → iphone.4.landscape.scss} +0 -2
  44. data/templates/emulators/emulators/iphone.4.portrait.scss +0 -2
  45. data/templates/emulators/emulators/palm.pre.2.landscape.scss +0 -2
  46. data/templates/emulators/emulators/palm.pre.2.portrait.scss +0 -2
  47. data/templates/emulators/manifest.rb +17 -5
  48. data/templates/graphics/highcharts/dark-blue.js +159 -159
  49. data/templates/graphics/highcharts/dark-green.js +159 -159
  50. data/templates/graphics/highcharts/gray.js +154 -154
  51. data/templates/graphics/highcharts/grid.js +84 -84
  52. data/templates/graphics/highcharts/highslide-config.js +2 -2
  53. data/templates/graphics/highcharts/highslide-full.js +3310 -3310
  54. data/templates/graphics/highcharts/skies.js +72 -72
  55. data/templates/graphics/jquery.ganttView.js +1550 -1550
  56. data/templates/graphics/jquery.highcharts.js +11277 -11285
  57. data/templates/graphics/jquery.sparkline.js +1072 -1072
  58. data/templates/ical/jquery.ical.js +7637 -7637
  59. data/templates/ical/jquery/ical.print.scss +3 -3
  60. data/templates/jqgrid/i18n/jqgrid/locale-ar.js +127 -127
  61. data/templates/jqgrid/i18n/jqgrid/locale-bg.js +131 -131
  62. data/templates/jqgrid/i18n/jqgrid/locale-bg1251.js +131 -131
  63. data/templates/jqgrid/i18n/jqgrid/locale-cat.js +128 -128
  64. data/templates/jqgrid/i18n/jqgrid/locale-cn.js +132 -132
  65. data/templates/jqgrid/i18n/jqgrid/locale-cs.js +129 -129
  66. data/templates/jqgrid/i18n/jqgrid/locale-da.js +128 -128
  67. data/templates/jqgrid/i18n/jqgrid/locale-de.js +134 -134
  68. data/templates/jqgrid/i18n/jqgrid/locale-el.js +127 -127
  69. data/templates/jqgrid/i18n/jqgrid/locale-en.js +128 -128
  70. data/templates/jqgrid/i18n/jqgrid/locale-es.js +129 -129
  71. data/templates/jqgrid/i18n/jqgrid/locale-fa.js +141 -141
  72. data/templates/jqgrid/i18n/jqgrid/locale-fi.js +128 -128
  73. data/templates/jqgrid/i18n/jqgrid/locale-fr.js +127 -127
  74. data/templates/jqgrid/i18n/jqgrid/locale-gl.js +127 -127
  75. data/templates/jqgrid/i18n/jqgrid/locale-he.js +128 -128
  76. data/templates/jqgrid/i18n/jqgrid/locale-hu.js +128 -128
  77. data/templates/jqgrid/i18n/jqgrid/locale-is.js +127 -127
  78. data/templates/jqgrid/i18n/jqgrid/locale-it.js +6 -6
  79. data/templates/jqgrid/i18n/jqgrid/locale-ja.js +153 -153
  80. data/templates/jqgrid/i18n/jqgrid/locale-lt.js +128 -128
  81. data/templates/jqgrid/i18n/jqgrid/locale-mne.js +134 -0
  82. data/templates/jqgrid/i18n/jqgrid/locale-mne.min.js +7 -0
  83. data/templates/jqgrid/i18n/jqgrid/locale-nl.js +145 -145
  84. data/templates/jqgrid/i18n/jqgrid/locale-no.js +12 -12
  85. data/templates/jqgrid/i18n/jqgrid/locale-pl.js +128 -128
  86. data/templates/jqgrid/i18n/jqgrid/locale-pt-br.js +128 -128
  87. data/templates/jqgrid/i18n/jqgrid/locale-pt.js +126 -126
  88. data/templates/jqgrid/i18n/jqgrid/locale-ro.js +140 -140
  89. data/templates/jqgrid/i18n/jqgrid/locale-ru.js +128 -128
  90. data/templates/jqgrid/i18n/jqgrid/locale-sk.js +128 -128
  91. data/templates/jqgrid/i18n/jqgrid/locale-sr.js +128 -128
  92. data/templates/jqgrid/i18n/jqgrid/locale-sv.js +128 -128
  93. data/templates/jqgrid/i18n/jqgrid/locale-tr.js +127 -127
  94. data/templates/jqgrid/i18n/jqgrid/locale-ua.js +128 -128
  95. data/templates/jqgrid/jquery.jqGrid.js +13477 -13443
  96. data/templates/jqgrid/jquery.jqGrid.min.js +292 -287
  97. data/templates/jqgrid/jquery/jqGrid.scss +13 -12
  98. data/templates/jqgrid/manifest.rb +2 -0
  99. data/templates/jqtouch/jquery.jqtouch.js +9601 -9556
  100. data/templates/jqtouch/jquery.jqtouch.min.js +3 -3
  101. data/templates/jqtouch/jquery/touch/default.scss +2 -2
  102. data/templates/jqtouch/jquery/touch/jqt.scss +2 -2
  103. data/templates/jqtouch/jquery/touch/jqtouch.scss +26 -5
  104. data/templates/jquery/amplify.store.js +211 -211
  105. data/templates/jquery/config/initializers/jquery.rb +2 -0
  106. data/templates/jquery/history.adapter.jquery.js +42 -36
  107. data/templates/jquery/history.html4.js +563 -563
  108. data/templates/jquery/history.html4.min.js +5 -5
  109. data/templates/jquery/history.js +1721 -1694
  110. data/templates/jquery/history.min.js +28 -27
  111. data/templates/jquery/i18n/jquery.ui/datepicker-af.js +20 -20
  112. data/templates/jquery/i18n/jquery.ui/datepicker-ar-DZ.js +18 -18
  113. data/templates/jquery/i18n/jquery.ui/datepicker-ar.js +19 -19
  114. data/templates/jquery/i18n/jquery.ui/datepicker-az.js +20 -20
  115. data/templates/jquery/i18n/jquery.ui/datepicker-bg.js +21 -21
  116. data/templates/jquery/i18n/jquery.ui/datepicker-bs.js +20 -20
  117. data/templates/jquery/i18n/jquery.ui/datepicker-ca.js +19 -19
  118. data/templates/jquery/i18n/jquery.ui/datepicker-cs.js +20 -20
  119. data/templates/jquery/i18n/jquery.ui/datepicker-da.js +20 -20
  120. data/templates/jquery/i18n/jquery.ui/datepicker-de.js +20 -20
  121. data/templates/jquery/i18n/jquery.ui/datepicker-el.js +20 -20
  122. data/templates/jquery/i18n/jquery.ui/datepicker-en-AU.js +19 -19
  123. data/templates/jquery/i18n/jquery.ui/datepicker-en-GB.js +20 -20
  124. data/templates/jquery/i18n/jquery.ui/datepicker-en-NZ.js +19 -19
  125. data/templates/jquery/i18n/jquery.ui/datepicker-eo.js +20 -20
  126. data/templates/jquery/i18n/jquery.ui/datepicker-es.js +19 -19
  127. data/templates/jquery/i18n/jquery.ui/datepicker-et.js +20 -20
  128. data/templates/jquery/i18n/jquery.ui/datepicker-eu.js +20 -20
  129. data/templates/jquery/i18n/jquery.ui/datepicker-fa.js +19 -19
  130. data/templates/jquery/i18n/jquery.ui/datepicker-fi.js +19 -19
  131. data/templates/jquery/i18n/jquery.ui/datepicker-fo.js +20 -20
  132. data/templates/jquery/i18n/jquery.ui/datepicker-fr-CH.js +20 -20
  133. data/templates/jquery/i18n/jquery.ui/datepicker-fr.js +20 -20
  134. data/templates/jquery/i18n/jquery.ui/datepicker-gl.js +19 -19
  135. data/templates/jquery/i18n/jquery.ui/datepicker-he.js +20 -20
  136. data/templates/jquery/i18n/jquery.ui/datepicker-hr.js +20 -20
  137. data/templates/jquery/i18n/jquery.ui/datepicker-hu.js +19 -19
  138. data/templates/jquery/i18n/jquery.ui/datepicker-hy.js +19 -19
  139. data/templates/jquery/i18n/jquery.ui/datepicker-id.js +19 -19
  140. data/templates/jquery/i18n/jquery.ui/datepicker-is.js +19 -19
  141. data/templates/jquery/i18n/jquery.ui/datepicker-it.js +19 -19
  142. data/templates/jquery/i18n/jquery.ui/datepicker-ja.js +20 -20
  143. data/templates/jquery/i18n/jquery.ui/datepicker-ko.js +19 -19
  144. data/templates/jquery/i18n/jquery.ui/datepicker-kz.js +19 -19
  145. data/templates/jquery/i18n/jquery.ui/datepicker-lt.js +19 -19
  146. data/templates/jquery/i18n/jquery.ui/datepicker-lv.js +19 -19
  147. data/templates/jquery/i18n/jquery.ui/datepicker-ml.js +20 -20
  148. data/templates/jquery/i18n/jquery.ui/datepicker-ms.js +19 -19
  149. data/templates/jquery/i18n/jquery.ui/datepicker-nl.js +20 -20
  150. data/templates/jquery/i18n/jquery.ui/datepicker-nl.min.js +1 -1
  151. data/templates/jquery/i18n/jquery.ui/datepicker-no.js +18 -18
  152. data/templates/jquery/i18n/jquery.ui/datepicker-pl.js +19 -19
  153. data/templates/jquery/i18n/jquery.ui/datepicker-pt-BR.js +19 -19
  154. data/templates/jquery/i18n/jquery.ui/datepicker-pt.js +19 -19
  155. data/templates/jquery/i18n/jquery.ui/datepicker-rm.js +17 -17
  156. data/templates/jquery/i18n/jquery.ui/datepicker-ro.js +20 -20
  157. data/templates/jquery/i18n/jquery.ui/datepicker-ru.js +19 -19
  158. data/templates/jquery/i18n/jquery.ui/datepicker-sk.js +19 -19
  159. data/templates/jquery/i18n/jquery.ui/datepicker-sk.min.js +1 -1
  160. data/templates/jquery/i18n/jquery.ui/datepicker-sl.js +19 -19
  161. data/templates/jquery/i18n/jquery.ui/datepicker-sq.js +20 -20
  162. data/templates/jquery/i18n/jquery.ui/datepicker-sr-SR.js +20 -20
  163. data/templates/jquery/i18n/jquery.ui/datepicker-sr.js +20 -20
  164. data/templates/jquery/i18n/jquery.ui/datepicker-sv.js +20 -20
  165. data/templates/jquery/i18n/jquery.ui/datepicker-ta.js +20 -20
  166. data/templates/jquery/i18n/jquery.ui/datepicker-th.js +20 -20
  167. data/templates/jquery/i18n/jquery.ui/datepicker-tj.js +19 -19
  168. data/templates/jquery/i18n/jquery.ui/datepicker-tr.js +19 -19
  169. data/templates/jquery/i18n/jquery.ui/datepicker-uk.js +19 -19
  170. data/templates/jquery/i18n/jquery.ui/datepicker-vi.js +20 -20
  171. data/templates/jquery/i18n/jquery.ui/datepicker-zh-CN.js +19 -19
  172. data/templates/jquery/i18n/jquery.ui/datepicker-zh-HK.js +19 -19
  173. data/templates/jquery/i18n/jquery.ui/datepicker-zh-TW.js +20 -20
  174. data/templates/jquery/jquery-ui.js +11913 -11882
  175. data/templates/jquery/jquery-ui.min.js +340 -339
  176. data/templates/jquery/jquery.bgiframe.js +27 -27
  177. data/templates/jquery/jquery.contextMenu.js +202 -202
  178. data/templates/jquery/jquery.cookie.js +26 -26
  179. data/templates/jquery/jquery.dotimeout.js +227 -227
  180. data/templates/jquery/jquery.dst.js +89 -89
  181. data/templates/jquery/jquery.easing.js +226 -0
  182. data/templates/jquery/jquery.easing.min.js +8 -0
  183. data/templates/jquery/jquery.farbtastic.js +294 -294
  184. data/templates/jquery/jquery.flashMessages.js +14 -14
  185. data/templates/jquery/jquery.form.js +761 -761
  186. data/templates/jquery/jquery.haml.js +247 -247
  187. data/templates/jquery/jquery.hotkeys.js +79 -79
  188. data/templates/jquery/jquery.js +1490 -928
  189. data/templates/jquery/jquery.layout.js +2454 -2454
  190. data/templates/jquery/jquery.mediahelpers.js +216 -0
  191. data/templates/jquery/jquery.mediahelpers.min.js +3 -0
  192. data/templates/jquery/jquery.min.js +177 -166
  193. data/templates/jquery/jquery.mousewheel.js +57 -57
  194. data/templates/jquery/jquery.offline.js +171 -171
  195. data/templates/jquery/jquery.pngFix.js +72 -72
  196. data/templates/jquery/jquery.rails.js +145 -145
  197. data/templates/jquery/jquery.replacetext.js +80 -80
  198. data/templates/jquery/jquery.themeswitchertool.js +195 -195
  199. data/templates/jquery/jquery.tmpl.js +460 -460
  200. data/templates/jquery/jquery.tmplPlus.js +78 -78
  201. data/templates/jquery/jquery.tokeninput.js +480 -475
  202. data/templates/jquery/jquery/ui/_theme.scss +14 -14
  203. data/templates/jquery/jquery/ui/black-tie/ui-icons_4ca300_256x240.png +0 -0
  204. data/templates/jquery/jquery/ui/black-tie/ui-icons_bbbbbb_256x240.png +0 -0
  205. data/templates/jquery/jquery/ui/black-tie/ui-icons_ededed_256x240.png +0 -0
  206. data/templates/jquery/jquery/ui/black-tie/ui-icons_ffcf29_256x240.png +0 -0
  207. data/templates/jquery/jquery/ui/vader/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  208. data/templates/jquery/jquery/ui/vader/ui-icons_bbbbbb_256x240.png +0 -0
  209. data/templates/jquery/jquery/ui/vader/ui-icons_c98000_256x240.png +0 -0
  210. data/templates/jquery/jquery/ui/vader/ui-icons_f29a00_256x240.png +0 -0
  211. data/templates/jquery/json.js +66 -66
  212. data/templates/jquery/json2.js +177 -177
  213. data/templates/jquery/manifest.rb +4 -0
  214. data/templates/jstree/jquery.jstree.js +5918 -5918
  215. data/templates/markitup/app/views/shared/_mark_it_up.parsed.preview.blue.html.haml +9 -0
  216. data/templates/markitup/app/views/shared/_mark_it_up.parsed.preview.html.haml +9 -0
  217. data/templates/markitup/app/views/shared/_mark_it_up.preview.blue.html.haml +8 -0
  218. data/templates/markitup/app/views/shared/_mark_it_up.preview.html.haml +8 -0
  219. data/templates/markitup/config/initializers/mark_it_up.rb +40 -0
  220. data/templates/markitup/jquery.markitup.js +586 -0
  221. data/templates/markitup/jquery.markitup.min.js +1 -0
  222. data/templates/markitup/jquery/markitup/preview/body.blue.png +0 -0
  223. data/templates/markitup/jquery/markitup/preview/bullet.blue.png +0 -0
  224. data/templates/markitup/jquery/markitup/preview/preview.blue.scss +58 -0
  225. data/templates/markitup/jquery/markitup/preview/preview.scss +7 -0
  226. data/templates/markitup/jquery/markitup/sets/bbcode.scss +34 -0
  227. data/templates/markitup/jquery/markitup/sets/bbcode/bold.png +0 -0
  228. data/templates/markitup/jquery/markitup/sets/bbcode/clean.png +0 -0
  229. data/templates/markitup/jquery/markitup/sets/bbcode/code.png +0 -0
  230. data/templates/markitup/jquery/markitup/sets/bbcode/fonts.png +0 -0
  231. data/templates/markitup/jquery/markitup/sets/bbcode/italic.png +0 -0
  232. data/templates/markitup/jquery/markitup/sets/bbcode/link.png +0 -0
  233. data/templates/markitup/jquery/markitup/sets/bbcode/list-bullet.png +0 -0
  234. data/templates/markitup/jquery/markitup/sets/bbcode/list-item.png +0 -0
  235. data/templates/markitup/jquery/markitup/sets/bbcode/list-numeric.png +0 -0
  236. data/templates/markitup/jquery/markitup/sets/bbcode/picture.png +0 -0
  237. data/templates/markitup/jquery/markitup/sets/bbcode/preview.png +0 -0
  238. data/templates/markitup/jquery/markitup/sets/bbcode/quotes.png +0 -0
  239. data/templates/markitup/jquery/markitup/sets/bbcode/stroke.png +0 -0
  240. data/templates/markitup/jquery/markitup/sets/bbcode/underline.png +0 -0
  241. data/templates/markitup/jquery/markitup/sets/css.scss +54 -0
  242. data/templates/markitup/jquery/markitup/sets/css/bold.png +0 -0
  243. data/templates/markitup/jquery/markitup/sets/css/css.png +0 -0
  244. data/templates/markitup/jquery/markitup/sets/css/italic.png +0 -0
  245. data/templates/markitup/jquery/markitup/sets/css/picture.png +0 -0
  246. data/templates/markitup/jquery/markitup/sets/css/stroke.png +0 -0
  247. data/templates/markitup/jquery/markitup/sets/css/tag.png +0 -0
  248. data/templates/markitup/jquery/markitup/sets/css/text_align_center.png +0 -0
  249. data/templates/markitup/jquery/markitup/sets/css/text_align_justify.png +0 -0
  250. data/templates/markitup/jquery/markitup/sets/css/text_align_left.png +0 -0
  251. data/templates/markitup/jquery/markitup/sets/css/text_align_right.png +0 -0
  252. data/templates/markitup/jquery/markitup/sets/css/text_indent.png +0 -0
  253. data/templates/markitup/jquery/markitup/sets/css/text_letterspacing.png +0 -0
  254. data/templates/markitup/jquery/markitup/sets/css/text_linespacing.png +0 -0
  255. data/templates/markitup/jquery/markitup/sets/css/text_lowercase.png +0 -0
  256. data/templates/markitup/jquery/markitup/sets/css/text_padding_bottom.png +0 -0
  257. data/templates/markitup/jquery/markitup/sets/css/text_padding_left.png +0 -0
  258. data/templates/markitup/jquery/markitup/sets/css/text_padding_right.png +0 -0
  259. data/templates/markitup/jquery/markitup/sets/css/text_padding_top.png +0 -0
  260. data/templates/markitup/jquery/markitup/sets/css/text_uppercase.png +0 -0
  261. data/templates/markitup/jquery/markitup/sets/default.scss +22 -0
  262. data/templates/markitup/jquery/markitup/sets/default/bold.png +0 -0
  263. data/templates/markitup/jquery/markitup/sets/default/clean.png +0 -0
  264. data/templates/markitup/jquery/markitup/sets/default/image.png +0 -0
  265. data/templates/markitup/jquery/markitup/sets/default/italic.png +0 -0
  266. data/templates/markitup/jquery/markitup/sets/default/link.png +0 -0
  267. data/templates/markitup/jquery/markitup/sets/default/picture.png +0 -0
  268. data/templates/markitup/jquery/markitup/sets/default/preview.png +0 -0
  269. data/templates/markitup/jquery/markitup/sets/default/stroke.png +0 -0
  270. data/templates/markitup/jquery/markitup/sets/dotclear.scss +38 -0
  271. data/templates/markitup/jquery/markitup/sets/dotclear/bold.png +0 -0
  272. data/templates/markitup/jquery/markitup/sets/dotclear/code.png +0 -0
  273. data/templates/markitup/jquery/markitup/sets/dotclear/h1.png +0 -0
  274. data/templates/markitup/jquery/markitup/sets/dotclear/h2.png +0 -0
  275. data/templates/markitup/jquery/markitup/sets/dotclear/h3.png +0 -0
  276. data/templates/markitup/jquery/markitup/sets/dotclear/h4.png +0 -0
  277. data/templates/markitup/jquery/markitup/sets/dotclear/h5.png +0 -0
  278. data/templates/markitup/jquery/markitup/sets/dotclear/h6.png +0 -0
  279. data/templates/markitup/jquery/markitup/sets/dotclear/italic.png +0 -0
  280. data/templates/markitup/jquery/markitup/sets/dotclear/link.png +0 -0
  281. data/templates/markitup/jquery/markitup/sets/dotclear/list-bullet.png +0 -0
  282. data/templates/markitup/jquery/markitup/sets/dotclear/list-numeric.png +0 -0
  283. data/templates/markitup/jquery/markitup/sets/dotclear/picture.png +0 -0
  284. data/templates/markitup/jquery/markitup/sets/dotclear/preview.png +0 -0
  285. data/templates/markitup/jquery/markitup/sets/dotclear/quotes.png +0 -0
  286. data/templates/markitup/jquery/markitup/sets/dotclear/stroke.png +0 -0
  287. data/templates/markitup/jquery/markitup/sets/dotclear/url.png +0 -0
  288. data/templates/markitup/jquery/markitup/sets/html.scss +42 -0
  289. data/templates/markitup/jquery/markitup/sets/html/bold.png +0 -0
  290. data/templates/markitup/jquery/markitup/sets/html/clean.png +0 -0
  291. data/templates/markitup/jquery/markitup/sets/html/h1.png +0 -0
  292. data/templates/markitup/jquery/markitup/sets/html/h2.png +0 -0
  293. data/templates/markitup/jquery/markitup/sets/html/h3.png +0 -0
  294. data/templates/markitup/jquery/markitup/sets/html/h4.png +0 -0
  295. data/templates/markitup/jquery/markitup/sets/html/h5.png +0 -0
  296. data/templates/markitup/jquery/markitup/sets/html/h6.png +0 -0
  297. data/templates/markitup/jquery/markitup/sets/html/image.png +0 -0
  298. data/templates/markitup/jquery/markitup/sets/html/italic.png +0 -0
  299. data/templates/markitup/jquery/markitup/sets/html/link.png +0 -0
  300. data/templates/markitup/jquery/markitup/sets/html/list-bullet.png +0 -0
  301. data/templates/markitup/jquery/markitup/sets/html/list-item.png +0 -0
  302. data/templates/markitup/jquery/markitup/sets/html/list-numeric.png +0 -0
  303. data/templates/markitup/jquery/markitup/sets/html/paragraph.png +0 -0
  304. data/templates/markitup/jquery/markitup/sets/html/picture.png +0 -0
  305. data/templates/markitup/jquery/markitup/sets/html/preview.png +0 -0
  306. data/templates/markitup/jquery/markitup/sets/html/stroke.png +0 -0
  307. data/templates/markitup/jquery/markitup/sets/markdown.scss +38 -0
  308. data/templates/markitup/jquery/markitup/sets/markdown/bold.png +0 -0
  309. data/templates/markitup/jquery/markitup/sets/markdown/code.png +0 -0
  310. data/templates/markitup/jquery/markitup/sets/markdown/h1.png +0 -0
  311. data/templates/markitup/jquery/markitup/sets/markdown/h2.png +0 -0
  312. data/templates/markitup/jquery/markitup/sets/markdown/h3.png +0 -0
  313. data/templates/markitup/jquery/markitup/sets/markdown/h4.png +0 -0
  314. data/templates/markitup/jquery/markitup/sets/markdown/h5.png +0 -0
  315. data/templates/markitup/jquery/markitup/sets/markdown/h6.png +0 -0
  316. data/templates/markitup/jquery/markitup/sets/markdown/italic.png +0 -0
  317. data/templates/markitup/jquery/markitup/sets/markdown/link.png +0 -0
  318. data/templates/markitup/jquery/markitup/sets/markdown/list-bullet.png +0 -0
  319. data/templates/markitup/jquery/markitup/sets/markdown/list-numeric.png +0 -0
  320. data/templates/markitup/jquery/markitup/sets/markdown/picture.png +0 -0
  321. data/templates/markitup/jquery/markitup/sets/markdown/preview.png +0 -0
  322. data/templates/markitup/jquery/markitup/sets/markdown/quotes.png +0 -0
  323. data/templates/markitup/jquery/markitup/sets/markmin.scss +38 -0
  324. data/templates/markitup/jquery/markitup/sets/markmin/bold.png +0 -0
  325. data/templates/markitup/jquery/markitup/sets/markmin/code.png +0 -0
  326. data/templates/markitup/jquery/markitup/sets/markmin/h1.png +0 -0
  327. data/templates/markitup/jquery/markitup/sets/markmin/h2.png +0 -0
  328. data/templates/markitup/jquery/markitup/sets/markmin/h3.png +0 -0
  329. data/templates/markitup/jquery/markitup/sets/markmin/h4.png +0 -0
  330. data/templates/markitup/jquery/markitup/sets/markmin/h5.png +0 -0
  331. data/templates/markitup/jquery/markitup/sets/markmin/h6.png +0 -0
  332. data/templates/markitup/jquery/markitup/sets/markmin/italic.png +0 -0
  333. data/templates/markitup/jquery/markitup/sets/markmin/link.png +0 -0
  334. data/templates/markitup/jquery/markitup/sets/markmin/list-bullet.png +0 -0
  335. data/templates/markitup/jquery/markitup/sets/markmin/list-numeric.png +0 -0
  336. data/templates/markitup/jquery/markitup/sets/markmin/picture.png +0 -0
  337. data/templates/markitup/jquery/markitup/sets/markmin/preview.png +0 -0
  338. data/templates/markitup/jquery/markitup/sets/markmin/quotes.png +0 -0
  339. data/templates/markitup/jquery/markitup/sets/rest.scss +38 -0
  340. data/templates/markitup/jquery/markitup/sets/rest/bold.png +0 -0
  341. data/templates/markitup/jquery/markitup/sets/rest/code.png +0 -0
  342. data/templates/markitup/jquery/markitup/sets/rest/h1.png +0 -0
  343. data/templates/markitup/jquery/markitup/sets/rest/h2.png +0 -0
  344. data/templates/markitup/jquery/markitup/sets/rest/h3.png +0 -0
  345. data/templates/markitup/jquery/markitup/sets/rest/h4.png +0 -0
  346. data/templates/markitup/jquery/markitup/sets/rest/h5.png +0 -0
  347. data/templates/markitup/jquery/markitup/sets/rest/italic.png +0 -0
  348. data/templates/markitup/jquery/markitup/sets/rest/link.png +0 -0
  349. data/templates/markitup/jquery/markitup/sets/rest/list-bullet.png +0 -0
  350. data/templates/markitup/jquery/markitup/sets/rest/list-numeric.png +0 -0
  351. data/templates/markitup/jquery/markitup/sets/rest/picture.png +0 -0
  352. data/templates/markitup/jquery/markitup/sets/rest/preview.png +0 -0
  353. data/templates/markitup/jquery/markitup/sets/rest/quotes.png +0 -0
  354. data/templates/markitup/jquery/markitup/sets/textile.scss +44 -0
  355. data/templates/markitup/jquery/markitup/sets/textile/bold.png +0 -0
  356. data/templates/markitup/jquery/markitup/sets/textile/code.png +0 -0
  357. data/templates/markitup/jquery/markitup/sets/textile/h1.png +0 -0
  358. data/templates/markitup/jquery/markitup/sets/textile/h2.png +0 -0
  359. data/templates/markitup/jquery/markitup/sets/textile/h3.png +0 -0
  360. data/templates/markitup/jquery/markitup/sets/textile/h4.png +0 -0
  361. data/templates/markitup/jquery/markitup/sets/textile/h5.png +0 -0
  362. data/templates/markitup/jquery/markitup/sets/textile/h6.png +0 -0
  363. data/templates/markitup/jquery/markitup/sets/textile/italic.png +0 -0
  364. data/templates/markitup/jquery/markitup/sets/textile/link.png +0 -0
  365. data/templates/markitup/jquery/markitup/sets/textile/list-bullet.png +0 -0
  366. data/templates/markitup/jquery/markitup/sets/textile/list-numeric.png +0 -0
  367. data/templates/markitup/jquery/markitup/sets/textile/paragraph.png +0 -0
  368. data/templates/markitup/jquery/markitup/sets/textile/picture.png +0 -0
  369. data/templates/markitup/jquery/markitup/sets/textile/preview.png +0 -0
  370. data/templates/markitup/jquery/markitup/sets/textile/quotes.png +0 -0
  371. data/templates/markitup/jquery/markitup/sets/textile/stroke.png +0 -0
  372. data/templates/markitup/jquery/markitup/sets/textile/table.png +0 -0
  373. data/templates/markitup/jquery/markitup/sets/texy.scss +40 -0
  374. data/templates/markitup/jquery/markitup/sets/texy/bold.png +0 -0
  375. data/templates/markitup/jquery/markitup/sets/texy/code.png +0 -0
  376. data/templates/markitup/jquery/markitup/sets/texy/disconnect.png +0 -0
  377. data/templates/markitup/jquery/markitup/sets/texy/h1.png +0 -0
  378. data/templates/markitup/jquery/markitup/sets/texy/h2.png +0 -0
  379. data/templates/markitup/jquery/markitup/sets/texy/h3.png +0 -0
  380. data/templates/markitup/jquery/markitup/sets/texy/h4.png +0 -0
  381. data/templates/markitup/jquery/markitup/sets/texy/h5.png +0 -0
  382. data/templates/markitup/jquery/markitup/sets/texy/h6.png +0 -0
  383. data/templates/markitup/jquery/markitup/sets/texy/italic.png +0 -0
  384. data/templates/markitup/jquery/markitup/sets/texy/link.png +0 -0
  385. data/templates/markitup/jquery/markitup/sets/texy/list-bullet.png +0 -0
  386. data/templates/markitup/jquery/markitup/sets/texy/list-numeric.png +0 -0
  387. data/templates/markitup/jquery/markitup/sets/texy/page_white_code.png +0 -0
  388. data/templates/markitup/jquery/markitup/sets/texy/picture.png +0 -0
  389. data/templates/markitup/jquery/markitup/sets/texy/preview.png +0 -0
  390. data/templates/markitup/jquery/markitup/sets/texy/quotes.png +0 -0
  391. data/templates/markitup/jquery/markitup/sets/texy/stroke.png +0 -0
  392. data/templates/markitup/jquery/markitup/sets/txt2tags.scss +44 -0
  393. data/templates/markitup/jquery/markitup/sets/txt2tags/bold.png +0 -0
  394. data/templates/markitup/jquery/markitup/sets/txt2tags/code.png +0 -0
  395. data/templates/markitup/jquery/markitup/sets/txt2tags/disconnect.png +0 -0
  396. data/templates/markitup/jquery/markitup/sets/txt2tags/h1.png +0 -0
  397. data/templates/markitup/jquery/markitup/sets/txt2tags/h2.png +0 -0
  398. data/templates/markitup/jquery/markitup/sets/txt2tags/h3.png +0 -0
  399. data/templates/markitup/jquery/markitup/sets/txt2tags/h4.png +0 -0
  400. data/templates/markitup/jquery/markitup/sets/txt2tags/h5.png +0 -0
  401. data/templates/markitup/jquery/markitup/sets/txt2tags/italic.png +0 -0
  402. data/templates/markitup/jquery/markitup/sets/txt2tags/link.png +0 -0
  403. data/templates/markitup/jquery/markitup/sets/txt2tags/list-bullet.png +0 -0
  404. data/templates/markitup/jquery/markitup/sets/txt2tags/list-numeric.png +0 -0
  405. data/templates/markitup/jquery/markitup/sets/txt2tags/picture.png +0 -0
  406. data/templates/markitup/jquery/markitup/sets/txt2tags/preview.png +0 -0
  407. data/templates/markitup/jquery/markitup/sets/txt2tags/quotes.png +0 -0
  408. data/templates/markitup/jquery/markitup/sets/txt2tags/stroke.png +0 -0
  409. data/templates/markitup/jquery/markitup/sets/txt2tags/underline.png +0 -0
  410. data/templates/markitup/jquery/markitup/sets/wiki.scss +42 -0
  411. data/templates/markitup/jquery/markitup/sets/wiki/bold.png +0 -0
  412. data/templates/markitup/jquery/markitup/sets/wiki/code.png +0 -0
  413. data/templates/markitup/jquery/markitup/sets/wiki/h1.png +0 -0
  414. data/templates/markitup/jquery/markitup/sets/wiki/h2.png +0 -0
  415. data/templates/markitup/jquery/markitup/sets/wiki/h3.png +0 -0
  416. data/templates/markitup/jquery/markitup/sets/wiki/h4.png +0 -0
  417. data/templates/markitup/jquery/markitup/sets/wiki/h5.png +0 -0
  418. data/templates/markitup/jquery/markitup/sets/wiki/h6.png +0 -0
  419. data/templates/markitup/jquery/markitup/sets/wiki/italic.png +0 -0
  420. data/templates/markitup/jquery/markitup/sets/wiki/link.png +0 -0
  421. data/templates/markitup/jquery/markitup/sets/wiki/list-bullet.png +0 -0
  422. data/templates/markitup/jquery/markitup/sets/wiki/list-numeric.png +0 -0
  423. data/templates/markitup/jquery/markitup/sets/wiki/picture.png +0 -0
  424. data/templates/markitup/jquery/markitup/sets/wiki/preview.png +0 -0
  425. data/templates/markitup/jquery/markitup/sets/wiki/quotes.png +0 -0
  426. data/templates/markitup/jquery/markitup/sets/wiki/stroke.png +0 -0
  427. data/templates/markitup/jquery/markitup/sets/wiki/table.png +0 -0
  428. data/templates/markitup/jquery/markitup/sets/wiki/url.png +0 -0
  429. data/templates/markitup/jquery/markitup/sets/xbbcode.scss +42 -0
  430. data/templates/markitup/jquery/markitup/sets/xbbcode/bold.png +0 -0
  431. data/templates/markitup/jquery/markitup/sets/xbbcode/clean.png +0 -0
  432. data/templates/markitup/jquery/markitup/sets/xbbcode/h1.png +0 -0
  433. data/templates/markitup/jquery/markitup/sets/xbbcode/h2.png +0 -0
  434. data/templates/markitup/jquery/markitup/sets/xbbcode/h3.png +0 -0
  435. data/templates/markitup/jquery/markitup/sets/xbbcode/h4.png +0 -0
  436. data/templates/markitup/jquery/markitup/sets/xbbcode/h5.png +0 -0
  437. data/templates/markitup/jquery/markitup/sets/xbbcode/h6.png +0 -0
  438. data/templates/markitup/jquery/markitup/sets/xbbcode/image.png +0 -0
  439. data/templates/markitup/jquery/markitup/sets/xbbcode/italic.png +0 -0
  440. data/templates/markitup/jquery/markitup/sets/xbbcode/link.png +0 -0
  441. data/templates/markitup/jquery/markitup/sets/xbbcode/list-bullet.png +0 -0
  442. data/templates/markitup/jquery/markitup/sets/xbbcode/list-item.png +0 -0
  443. data/templates/markitup/jquery/markitup/sets/xbbcode/list-numeric.png +0 -0
  444. data/templates/markitup/jquery/markitup/sets/xbbcode/paragraph.png +0 -0
  445. data/templates/markitup/jquery/markitup/sets/xbbcode/picture.png +0 -0
  446. data/templates/markitup/jquery/markitup/sets/xbbcode/preview.png +0 -0
  447. data/templates/markitup/jquery/markitup/sets/xbbcode/stroke.png +0 -0
  448. data/templates/markitup/jquery/markitup/skins/aqua.scss +136 -0
  449. data/templates/markitup/jquery/markitup/skins/aqua/bg-container-white.png +0 -0
  450. data/templates/markitup/jquery/markitup/skins/aqua/bg-container.png +0 -0
  451. data/templates/markitup/jquery/markitup/skins/aqua/bg-footer-white.png +0 -0
  452. data/templates/markitup/jquery/markitup/skins/aqua/bg-footer.png +0 -0
  453. data/templates/markitup/jquery/markitup/skins/aqua/bg-header-white.png +0 -0
  454. data/templates/markitup/jquery/markitup/skins/aqua/bg-header.png +0 -0
  455. data/templates/markitup/jquery/markitup/skins/aqua/handle.png +0 -0
  456. data/templates/markitup/jquery/markitup/skins/aqua/menu.png +0 -0
  457. data/templates/markitup/jquery/markitup/skins/aqua/spacer.gif +0 -0
  458. data/templates/markitup/jquery/markitup/skins/aqua/submenu.png +0 -0
  459. data/templates/markitup/jquery/markitup/skins/jtageditor.scss +141 -0
  460. data/templates/markitup/jquery/markitup/skins/jtageditor/bg-container.png +0 -0
  461. data/templates/markitup/jquery/markitup/skins/jtageditor/bg-editor-bbcode.png +0 -0
  462. data/templates/markitup/jquery/markitup/skins/jtageditor/bg-editor-dotclear.png +0 -0
  463. data/templates/markitup/jquery/markitup/skins/jtageditor/bg-editor-html.png +0 -0
  464. data/templates/markitup/jquery/markitup/skins/jtageditor/bg-editor-markdown.png +0 -0
  465. data/templates/markitup/jquery/markitup/skins/jtageditor/bg-editor-textile.png +0 -0
  466. data/templates/markitup/jquery/markitup/skins/jtageditor/bg-editor-wiki.png +0 -0
  467. data/templates/markitup/jquery/markitup/skins/jtageditor/bg-editor.png +0 -0
  468. data/templates/markitup/jquery/markitup/skins/jtageditor/handle.png +0 -0
  469. data/templates/markitup/jquery/markitup/skins/jtageditor/menu.png +0 -0
  470. data/templates/markitup/jquery/markitup/skins/jtageditor/submenu.png +0 -0
  471. data/templates/markitup/jquery/markitup/skins/live.scss +135 -0
  472. data/templates/markitup/jquery/markitup/skins/live/bg-container.png +0 -0
  473. data/templates/markitup/jquery/markitup/skins/live/bg-footer.png +0 -0
  474. data/templates/markitup/jquery/markitup/skins/live/bg-header.png +0 -0
  475. data/templates/markitup/jquery/markitup/skins/live/editor.png +0 -0
  476. data/templates/markitup/jquery/markitup/skins/live/handle.png +0 -0
  477. data/templates/markitup/jquery/markitup/skins/live/menu.png +0 -0
  478. data/templates/markitup/jquery/markitup/skins/live/submenu.png +0 -0
  479. data/templates/markitup/jquery/markitup/skins/markitup.scss +150 -0
  480. data/templates/markitup/jquery/markitup/skins/markitup/bg-container.png +0 -0
  481. data/templates/markitup/jquery/markitup/skins/markitup/bg-editor-bbcode.png +0 -0
  482. data/templates/markitup/jquery/markitup/skins/markitup/bg-editor-dotclear.png +0 -0
  483. data/templates/markitup/jquery/markitup/skins/markitup/bg-editor-html.png +0 -0
  484. data/templates/markitup/jquery/markitup/skins/markitup/bg-editor-json.png +0 -0
  485. data/templates/markitup/jquery/markitup/skins/markitup/bg-editor-markdown.png +0 -0
  486. data/templates/markitup/jquery/markitup/skins/markitup/bg-editor-textile.png +0 -0
  487. data/templates/markitup/jquery/markitup/skins/markitup/bg-editor-wiki.png +0 -0
  488. data/templates/markitup/jquery/markitup/skins/markitup/bg-editor-xml.png +0 -0
  489. data/templates/markitup/jquery/markitup/skins/markitup/bg-editor.png +0 -0
  490. data/templates/markitup/jquery/markitup/skins/markitup/handle.png +0 -0
  491. data/templates/markitup/jquery/markitup/skins/markitup/menu.png +0 -0
  492. data/templates/markitup/jquery/markitup/skins/markitup/submenu.png +0 -0
  493. data/templates/markitup/jquery/markitup/skins/simple.scss +117 -0
  494. data/templates/markitup/jquery/markitup/skins/simple/handle.png +0 -0
  495. data/templates/markitup/jquery/markitup/skins/simple/menu.png +0 -0
  496. data/templates/markitup/jquery/markitup/skins/simple/submenu.png +0 -0
  497. data/templates/markitup/manifest.rb +311 -0
  498. data/templates/markitup/markitup/jquery.markitup.set.bbcode.js +40 -0
  499. data/templates/markitup/markitup/jquery.markitup.set.bbcode.min.js +3 -0
  500. data/templates/markitup/markitup/jquery.markitup.set.css.js +53 -0
  501. data/templates/markitup/markitup/jquery.markitup.set.css.min.js +5 -0
  502. data/templates/markitup/markitup/jquery.markitup.set.default.js +30 -0
  503. data/templates/markitup/markitup/jquery.markitup.set.default.min.js +2 -0
  504. data/templates/markitup/markitup/jquery.markitup.set.dotclear.js +38 -0
  505. data/templates/markitup/markitup/jquery.markitup.set.dotclear.min.js +3 -0
  506. data/templates/markitup/markitup/jquery.markitup.set.html.js +40 -0
  507. data/templates/markitup/markitup/jquery.markitup.set.html.min.js +4 -0
  508. data/templates/markitup/markitup/jquery.markitup.set.markdown.js +53 -0
  509. data/templates/markitup/markitup/jquery.markitup.set.markdown.min.js +3 -0
  510. data/templates/markitup/markitup/jquery.markitup.set.markmin.js +50 -0
  511. data/templates/markitup/markitup/jquery.markitup.set.markmin.min.js +3 -0
  512. data/templates/markitup/markitup/jquery.markitup.set.rest.js +52 -0
  513. data/templates/markitup/markitup/jquery.markitup.set.rest.min.js +3 -0
  514. data/templates/markitup/markitup/jquery.markitup.set.textile.js +58 -0
  515. data/templates/markitup/markitup/jquery.markitup.set.textile.min.js +4 -0
  516. data/templates/markitup/markitup/jquery.markitup.set.texy.js +52 -0
  517. data/templates/markitup/markitup/jquery.markitup.set.texy.min.js +4 -0
  518. data/templates/markitup/markitup/jquery.markitup.set.txt2tags.js +42 -0
  519. data/templates/markitup/markitup/jquery.markitup.set.txt2tags.min.js +3 -0
  520. data/templates/markitup/markitup/jquery.markitup.set.wiki.js +61 -0
  521. data/templates/markitup/markitup/jquery.markitup.set.wiki.min.js +4 -0
  522. data/templates/markitup/markitup/jquery.markitup.set.xbbcode.js +36 -0
  523. data/templates/markitup/markitup/jquery.markitup.set.xbbcode.min.js +4 -0
  524. data/templates/mobile/config/initializers/mobile.rb +2 -0
  525. data/templates/mobile/jquery.mobile.js +4545 -4454
  526. data/templates/mobile/jquery.mobile.min.js +16 -7
  527. data/templates/mobile/jquery/mobile/960.fluid.scss +191 -0
  528. data/templates/mobile/jquery/mobile/960.scss +213 -0
  529. data/templates/mobile/jquery/mobile/_base.scss +37 -20
  530. data/templates/mobile/jquery/mobile/default.scss +48 -56
  531. data/templates/mobile/jquery/mobile/valencia.scss +43 -44
  532. data/templates/mobile/manifest.rb +2 -0
  533. data/templates/ribbon/jquery.ribbon.js +195 -195
  534. data/templates/ribbon/jquery.ribbon.min.js +1 -1
  535. data/templates/ribbon/jquery/ribbon/office.scss +12 -12
  536. data/templates/ribbon/jquery/ribbon/windows7.scss +12 -12
  537. data/templates/secret_sauce/secret_sauce.js +8 -8
  538. data/templates/tools/flowplayer.js +897 -897
  539. data/templates/tools/jquery.tools.js +3647 -3647
  540. data/templates/tools/jquery.tools.min.js +47 -47
  541. data/templates/tools/swfobject.js +760 -760
  542. metadata +350 -22
@@ -8,482 +8,482 @@
8
8
  * http://jquery.org/license
9
9
  */
10
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 || (data === 0 || data === false) ? 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 });
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 || (data === 0 || data === false) ? 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);
32
66
  }
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;
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"))) {
40
98
  }
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;
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
+ };
114
104
  }
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, and not containing at least on HTML tag, treat as a selector.
199
- // (If integrated with core, use quickExpr.exec)
200
- jQuery.template(null, htmlExpr.test(name) ? name : jQuery(name)))) : null;
201
- },
202
-
203
- encode: function(text) {
204
- // Do HTML encoding replacing < > & and ' and " by corresponding entities.
205
- return ("" + text).split("<").join("&lt;").split(">").join("&gt;").split('"').join("&#34;").split("'").join("&#39;");
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);
206
134
  }
207
- });
208
-
209
- jQuery.extend(jQuery.tmpl, {
210
- tag: {
211
- "tmpl": {
212
- _default: { $2: "null" },
213
- open: "if($notnull_1){__=__.concat($item.nest($1,$2));}"
214
- // tmpl target parameter can be of type function, so use $1, not $1a (so not auto detection of functions)
215
- // This means that {{tmpl foo}} treats foo as a template (which IS a function).
216
- // Explicit parens can be used if foo is a function that returns a template: {{tmpl foo()}}.
217
- },
218
- "wrap": {
219
- _default: { $2: "null" },
220
- open: "$item.calls(__,$1,$2);__=[];",
221
- close: "call=$item.calls();__=call._.concat($item.wrap(call,__));"
222
- },
223
- "each": {
224
- _default: { $2: "$index, $value" },
225
- open: "if($notnull_1){$.each($1a,function($2){with(this){",
226
- close: "}});}"
227
- },
228
- "if": {
229
- open: "if(($notnull_1) && $1a){",
230
- close: "}"
231
- },
232
- "else": {
233
- _default: { $1: "true" },
234
- open: "}else if(($notnull_1) && $1a){"
235
- },
236
- "html": {
237
- // Unecoded expression evaluation.
238
- open: "if($notnull_1){__.push($1a);}"
239
- },
240
- "=": {
241
- // Encoded expression evaluation. Abbreviated form is ${}.
242
- _default: { $1: "$data" },
243
- open: "if($notnull_1){__.push($.encode($1a));}"
244
- },
245
- "!": {
246
- // Comment tag. Skipped by parser
247
- open: ""
248
- }
249
- },
250
-
251
- // This stub can be overridden, e.g. in jquery.tmplPlus for providing rendered events
252
- complete: function(items) {
253
- newTmplItems = {};
254
- },
255
-
256
- // Call this from code which overrides domManip, or equivalent
257
- // Manage cloning/storing template items etc.
258
- afterManip: function afterManip(elem, fragClone, callback) {
259
- // Provides cloned fragment ready for fixup prior to and after insertion into DOM
260
- var content = fragClone.nodeType === 11 ?
261
- jQuery.makeArray(fragClone.childNodes) :
262
- fragClone.nodeType === 1 ? [fragClone] : [];
263
-
264
- // Return fragment to original caller (e.g. append) for DOM insertion
265
- callback.call(elem, fragClone);
266
-
267
- // Fragment has been inserted:- Add inserted nodes to tmplItem data structure. Replace inserted element annotations by jQuery.data.
268
- storeTmplItems(content);
269
- cloneIndex++;
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] || {};
270
185
  }
271
- });
272
-
273
- //========================== Private helper functions, used by code above ==========================
274
-
275
- function build(tmplItem, nested, content) {
276
- // Convert hierarchical content into flat string array
277
- // and finally return array of fragments ready for DOM insertion
278
- var frag, ret = content ? jQuery.map(content, function(item) {
279
- return (typeof item === "string") ?
280
- // Insert template item annotations, to be converted to jQuery.data( "tmplItem" ) when elems are inserted into DOM.
281
- (tmplItem.key ? item.replace(/(<\w+)(?=[\s>])(?![^>]*_tmplitem)([^>]*)/g, "$1 " + tmplItmAtt + "=\"" + tmplItem.key + "\" $2") : item) :
282
- // This is a child template item. Build nested template.
283
- build(item, tmplItem, item._ctnt);
284
- }) :
285
- // 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()}}.
286
- tmplItem;
287
- if (nested) {
288
- return ret;
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"
289
192
  }
290
-
291
- // top-level template
292
- ret = ret.join("");
293
-
294
- // Support templates which have initial or final text nodes, or consist only of text
295
- // Also support HTML entities within the HTML markup.
296
- ret.replace(/^\s*([^<\s][^<]*)?(<[\w\W]+>)([^>]*[^>\s])?\s*$/, function(all, before, middle, after) {
297
- frag = jQuery(middle).get();
298
-
299
- storeTmplItems(frag);
300
- if (before) {
301
- frag = unencode(before).concat(frag);
302
- }
303
- if (after) {
304
- frag = frag.concat(unencode(after));
305
- }
306
- });
307
- return frag ? frag : unencode(ret);
308
- }
309
-
310
- function unencode(text) {
311
- // Use createElement, since createTextNode will not render HTML entities correctly
312
- var el = document.createElement("div");
313
- el.innerHTML = text;
314
- return jQuery.makeArray(el.childNodes);
315
- }
316
-
317
- // Generate a reusable function that will serve to render a template against data
318
- function buildTmplFn(markup) {
319
- return new Function("jQuery", "$item",
320
- // Use the variable __ to hold a string array while building the compiled template. (See https://github.com/jquery/jquery-tmpl/issues#issue/10).
321
- "var $=jQuery,call,__=[],$data=$item.data;" +
322
-
323
- // Introduce the data as local variables using with(){}
324
- "with($data){__.push('" +
325
-
326
- // Convert the template into pure JavaScript
327
- jQuery.trim(markup)
328
- .replace(/([\\'])/g, "\\$1")
329
- .replace(/[\r\t\n]/g, " ")
330
- .replace(/\$\{([^\}]*)\}/g, "{{= $1}}")
331
- .replace(/\{\{(\/?)(\w+|.)(?:\(((?:[^\}]|\}(?!\}))*?)?\))?(?:\s+(.*?)?)?(\(((?:[^\}]|\}(?!\}))*?)\))?\s*\}\}/g,
332
- function(all, slash, type, fnargs, target, parens, args) {
333
- var tag = jQuery.tmpl.tag[ type ], def, expr, exprAutoFnDetect;
334
- if (!tag) {
335
- throw "Unknown template tag: " + type;
336
- }
337
- def = tag._default || [];
338
- if (parens && !/\w$/.test(target)) {
339
- target += parens;
340
- parens = "";
341
- }
342
- if (target) {
343
- target = unescape(target);
344
- args = args ? ("," + unescape(args) + ")") : (parens ? ")" : "");
345
- // Support for target being things like a.toLowerCase();
346
- // In that case don't call with template item as 'this' pointer. Just evaluate...
347
- expr = parens ? (target.indexOf(".") > -1 ? target + unescape(parens) : ("(" + target + ").call($item" + args)) : target;
348
- exprAutoFnDetect = parens ? expr : "(typeof(" + target + ")==='function'?(" + target + ").call($item):(" + target + "))";
349
- } else {
350
- exprAutoFnDetect = expr = def.$1 || "null";
351
- }
352
- fnargs = unescape(fnargs);
353
- return "');" +
354
- tag[ slash ? "close" : "open" ]
355
- .split("$notnull_1").join(target ? "typeof(" + target + ")!=='undefined' && (" + target + ")!=null" : "true")
356
- .split("$1a").join(exprAutoFnDetect)
357
- .split("$1").join(expr)
358
- .split("$2").join(fnargs || def.$2 || "") +
359
- "__.push('";
360
- }) +
361
- "');}return __;"
362
- );
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, and not containing at least on HTML tag, treat as a selector.
199
+ // (If integrated with core, use quickExpr.exec)
200
+ jQuery.template(null, htmlExpr.test(name) ? name : jQuery(name)))) : null;
201
+ },
202
+
203
+ encode: function(text) {
204
+ // Do HTML encoding replacing < > & and ' and " by corresponding entities.
205
+ return ("" + text).split("<").join("&lt;").split(">").join("&gt;").split('"').join("&#34;").split("'").join("&#39;");
363
206
  }
364
-
365
- function updateWrapped(options, wrapped) {
366
- // Build the wrapped content.
367
- options._wrap = build(options, true,
368
- // Suport imperative scenario in which options.wrapped can be set to a selector or an HTML string.
369
- jQuery.isArray(wrapped) ? wrapped : [htmlExpr.test(wrapped) ? wrapped : jQuery(wrapped).html()]
370
- ).join("");
207
+ });
208
+
209
+ jQuery.extend(jQuery.tmpl, {
210
+ tag: {
211
+ "tmpl": {
212
+ _default: { $2: "null" },
213
+ open: "if($notnull_1){__=__.concat($item.nest($1,$2));}"
214
+ // tmpl target parameter can be of type function, so use $1, not $1a (so not auto detection of functions)
215
+ // This means that {{tmpl foo}} treats foo as a template (which IS a function).
216
+ // Explicit parens can be used if foo is a function that returns a template: {{tmpl foo()}}.
217
+ },
218
+ "wrap": {
219
+ _default: { $2: "null" },
220
+ open: "$item.calls(__,$1,$2);__=[];",
221
+ close: "call=$item.calls();__=call._.concat($item.wrap(call,__));"
222
+ },
223
+ "each": {
224
+ _default: { $2: "$index, $value" },
225
+ open: "if($notnull_1){$.each($1a,function($2){with(this){",
226
+ close: "}});}"
227
+ },
228
+ "if": {
229
+ open: "if(($notnull_1) && $1a){",
230
+ close: "}"
231
+ },
232
+ "else": {
233
+ _default: { $1: "true" },
234
+ open: "}else if(($notnull_1) && $1a){"
235
+ },
236
+ "html": {
237
+ // Unecoded expression evaluation.
238
+ open: "if($notnull_1){__.push($1a);}"
239
+ },
240
+ "=": {
241
+ // Encoded expression evaluation. Abbreviated form is ${}.
242
+ _default: { $1: "$data" },
243
+ open: "if($notnull_1){__.push($.encode($1a));}"
244
+ },
245
+ "!": {
246
+ // Comment tag. Skipped by parser
247
+ open: ""
248
+ }
249
+ },
250
+
251
+ // This stub can be overridden, e.g. in jquery.tmplPlus for providing rendered events
252
+ complete: function(items) {
253
+ newTmplItems = {};
254
+ },
255
+
256
+ // Call this from code which overrides domManip, or equivalent
257
+ // Manage cloning/storing template items etc.
258
+ afterManip: function afterManip(elem, fragClone, callback) {
259
+ // Provides cloned fragment ready for fixup prior to and after insertion into DOM
260
+ var content = fragClone.nodeType === 11 ?
261
+ jQuery.makeArray(fragClone.childNodes) :
262
+ fragClone.nodeType === 1 ? [fragClone] : [];
263
+
264
+ // Return fragment to original caller (e.g. append) for DOM insertion
265
+ callback.call(elem, fragClone);
266
+
267
+ // Fragment has been inserted:- Add inserted nodes to tmplItem data structure. Replace inserted element annotations by jQuery.data.
268
+ storeTmplItems(content);
269
+ cloneIndex++;
371
270
  }
372
-
373
- function unescape(args) {
374
- return args ? args.replace(/\\'/g, "'").replace(/\\\\/g, "\\") : null;
271
+ });
272
+
273
+ //========================== Private helper functions, used by code above ==========================
274
+
275
+ function build(tmplItem, nested, content) {
276
+ // Convert hierarchical content into flat string array
277
+ // and finally return array of fragments ready for DOM insertion
278
+ var frag, ret = content ? jQuery.map(content, function(item) {
279
+ return (typeof item === "string") ?
280
+ // Insert template item annotations, to be converted to jQuery.data( "tmplItem" ) when elems are inserted into DOM.
281
+ (tmplItem.key ? item.replace(/(<\w+)(?=[\s>])(?![^>]*_tmplitem)([^>]*)/g, "$1 " + tmplItmAtt + "=\"" + tmplItem.key + "\" $2") : item) :
282
+ // This is a child template item. Build nested template.
283
+ build(item, tmplItem, item._ctnt);
284
+ }) :
285
+ // 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()}}.
286
+ tmplItem;
287
+ if (nested) {
288
+ return ret;
375
289
  }
376
290
 
377
- function outerHtml(elem) {
378
- var div = document.createElement("div");
379
- div.appendChild(elem.cloneNode(true));
380
- return div.innerHTML;
291
+ // top-level template
292
+ ret = ret.join("");
293
+
294
+ // Support templates which have initial or final text nodes, or consist only of text
295
+ // Also support HTML entities within the HTML markup.
296
+ ret.replace(/^\s*([^<\s][^<]*)?(<[\w\W]+>)([^>]*[^>\s])?\s*$/, function(all, before, middle, after) {
297
+ frag = jQuery(middle).get();
298
+
299
+ storeTmplItems(frag);
300
+ if (before) {
301
+ frag = unencode(before).concat(frag);
302
+ }
303
+ if (after) {
304
+ frag = frag.concat(unencode(after));
305
+ }
306
+ });
307
+ return frag ? frag : unencode(ret);
308
+ }
309
+
310
+ function unencode(text) {
311
+ // Use createElement, since createTextNode will not render HTML entities correctly
312
+ var el = document.createElement("div");
313
+ el.innerHTML = text;
314
+ return jQuery.makeArray(el.childNodes);
315
+ }
316
+
317
+ // Generate a reusable function that will serve to render a template against data
318
+ function buildTmplFn(markup) {
319
+ return new Function("jQuery", "$item",
320
+ // Use the variable __ to hold a string array while building the compiled template. (See https://github.com/jquery/jquery-tmpl/issues#issue/10).
321
+ "var $=jQuery,call,__=[],$data=$item.data;" +
322
+
323
+ // Introduce the data as local variables using with(){}
324
+ "with($data){__.push('" +
325
+
326
+ // Convert the template into pure JavaScript
327
+ jQuery.trim(markup)
328
+ .replace(/([\\'])/g, "\\$1")
329
+ .replace(/[\r\t\n]/g, " ")
330
+ .replace(/\$\{([^\}]*)\}/g, "{{= $1}}")
331
+ .replace(/\{\{(\/?)(\w+|.)(?:\(((?:[^\}]|\}(?!\}))*?)?\))?(?:\s+(.*?)?)?(\(((?:[^\}]|\}(?!\}))*?)\))?\s*\}\}/g,
332
+ function(all, slash, type, fnargs, target, parens, args) {
333
+ var tag = jQuery.tmpl.tag[ type ], def, expr, exprAutoFnDetect;
334
+ if (!tag) {
335
+ throw "Unknown template tag: " + type;
336
+ }
337
+ def = tag._default || [];
338
+ if (parens && !/\w$/.test(target)) {
339
+ target += parens;
340
+ parens = "";
341
+ }
342
+ if (target) {
343
+ target = unescape(target);
344
+ args = args ? ("," + unescape(args) + ")") : (parens ? ")" : "");
345
+ // Support for target being things like a.toLowerCase();
346
+ // In that case don't call with template item as 'this' pointer. Just evaluate...
347
+ expr = parens ? (target.indexOf(".") > -1 ? target + unescape(parens) : ("(" + target + ").call($item" + args)) : target;
348
+ exprAutoFnDetect = parens ? expr : "(typeof(" + target + ")==='function'?(" + target + ").call($item):(" + target + "))";
349
+ } else {
350
+ exprAutoFnDetect = expr = def.$1 || "null";
351
+ }
352
+ fnargs = unescape(fnargs);
353
+ return "');" +
354
+ tag[ slash ? "close" : "open" ]
355
+ .split("$notnull_1").join(target ? "typeof(" + target + ")!=='undefined' && (" + target + ")!=null" : "true")
356
+ .split("$1a").join(exprAutoFnDetect)
357
+ .split("$1").join(expr)
358
+ .split("$2").join(fnargs || def.$2 || "") +
359
+ "__.push('";
360
+ }) +
361
+ "');}return __;"
362
+ );
363
+ }
364
+
365
+ function updateWrapped(options, wrapped) {
366
+ // Build the wrapped content.
367
+ options._wrap = build(options, true,
368
+ // Suport imperative scenario in which options.wrapped can be set to a selector or an HTML string.
369
+ jQuery.isArray(wrapped) ? wrapped : [htmlExpr.test(wrapped) ? wrapped : jQuery(wrapped).html()]
370
+ ).join("");
371
+ }
372
+
373
+ function unescape(args) {
374
+ return args ? args.replace(/\\'/g, "'").replace(/\\\\/g, "\\") : null;
375
+ }
376
+
377
+ function outerHtml(elem) {
378
+ var div = document.createElement("div");
379
+ div.appendChild(elem.cloneNode(true));
380
+ return div.innerHTML;
381
+ }
382
+
383
+ // Store template items in jQuery.data(), ensuring a unique tmplItem data data structure for each rendered template instance.
384
+ function storeTmplItems(content) {
385
+ var keySuffix = "_" + cloneIndex, elem, elems, newClonedItems = {}, i, l, m;
386
+ for (i = 0,l = content.length; i < l; i++) {
387
+ if ((elem = content[i]).nodeType !== 1) {
388
+ continue;
389
+ }
390
+ elems = elem.getElementsByTagName("*");
391
+ for (m = elems.length - 1; m >= 0; m--) {
392
+ processItemKey(elems[m]);
393
+ }
394
+ processItemKey(elem);
381
395
  }
382
-
383
- // Store template items in jQuery.data(), ensuring a unique tmplItem data data structure for each rendered template instance.
384
- function storeTmplItems(content) {
385
- var keySuffix = "_" + cloneIndex, elem, elems, newClonedItems = {}, i, l, m;
386
- for (i = 0,l = content.length; i < l; i++) {
387
- if ((elem = content[i]).nodeType !== 1) {
388
- continue;
389
- }
390
- elems = elem.getElementsByTagName("*");
391
- for (m = elems.length - 1; m >= 0; m--) {
392
- processItemKey(elems[m]);
393
- }
394
- processItemKey(elem);
396
+ function processItemKey(el) {
397
+ var pntKey, pntNode = el, pntItem, tmplItem, key;
398
+ // Ensure that each rendered template inserted into the DOM has its own template item,
399
+ if ((key = el.getAttribute(tmplItmAtt))) {
400
+ while (pntNode.parentNode && (pntNode = pntNode.parentNode).nodeType === 1 && !(pntKey = pntNode.getAttribute(tmplItmAtt))) {
395
401
  }
396
- function processItemKey(el) {
397
- var pntKey, pntNode = el, pntItem, tmplItem, key;
398
- // Ensure that each rendered template inserted into the DOM has its own template item,
399
- if ((key = el.getAttribute(tmplItmAtt))) {
400
- while (pntNode.parentNode && (pntNode = pntNode.parentNode).nodeType === 1 && !(pntKey = pntNode.getAttribute(tmplItmAtt))) {
401
- }
402
- if (pntKey !== key) {
403
- // The next ancestor with a _tmplitem expando is on a different key than this one.
404
- // So this is a top-level element within this template item
405
- // Set pntNode to the key of the parentNode, or to 0 if pntNode.parentNode is null, or pntNode is a fragment.
406
- pntNode = pntNode.parentNode ? (pntNode.nodeType === 11 ? 0 : (pntNode.getAttribute(tmplItmAtt) || 0)) : 0;
407
- if (!(tmplItem = newTmplItems[key])) {
408
- // The item is for wrapped content, and was copied from the temporary parent wrappedItem.
409
- tmplItem = wrappedItems[key];
410
- tmplItem = newTmplItem(tmplItem, newTmplItems[pntNode] || wrappedItems[pntNode]);
411
- tmplItem.key = ++itemKey;
412
- newTmplItems[itemKey] = tmplItem;
413
- }
414
- if (cloneIndex) {
415
- cloneTmplItem(key);
416
- }
417
- }
418
- el.removeAttribute(tmplItmAtt);
419
- } else if (cloneIndex && (tmplItem = jQuery.data(el, "tmplItem"))) {
420
- // This was a rendered element, cloned during append or appendTo etc.
421
- // TmplItem stored in jQuery data has already been cloned in cloneCopyEvent. We must replace it with a fresh cloned tmplItem.
422
- cloneTmplItem(tmplItem.key);
423
- newTmplItems[tmplItem.key] = tmplItem;
424
- pntNode = jQuery.data(el.parentNode, "tmplItem");
425
- pntNode = pntNode ? pntNode.key : 0;
426
- }
427
- if (tmplItem) {
428
- pntItem = tmplItem;
429
- // Find the template item of the parent element.
430
- // (Using !=, not !==, since pntItem.key is number, and pntNode may be a string)
431
- while (pntItem && pntItem.key != pntNode) {
432
- // Add this element as a top-level node for this rendered template item, as well as for any
433
- // ancestor items between this item and the item of its parent element
434
- pntItem.nodes.push(el);
435
- pntItem = pntItem.parent;
436
- }
437
- // Delete content built during rendering - reduce API surface area and memory use, and avoid exposing of stale data after rendering...
438
- delete tmplItem._ctnt;
439
- delete tmplItem._wrap;
440
- // Store template item as jQuery data on the element
441
- jQuery.data(el, "tmplItem", tmplItem);
442
- }
443
- function cloneTmplItem(key) {
444
- key = key + keySuffix;
445
- tmplItem = newClonedItems[key] =
446
- (newClonedItems[key] || newTmplItem(tmplItem, newTmplItems[tmplItem.parent.key + keySuffix] || tmplItem.parent));
447
- }
402
+ if (pntKey !== key) {
403
+ // The next ancestor with a _tmplitem expando is on a different key than this one.
404
+ // So this is a top-level element within this template item
405
+ // Set pntNode to the key of the parentNode, or to 0 if pntNode.parentNode is null, or pntNode is a fragment.
406
+ pntNode = pntNode.parentNode ? (pntNode.nodeType === 11 ? 0 : (pntNode.getAttribute(tmplItmAtt) || 0)) : 0;
407
+ if (!(tmplItem = newTmplItems[key])) {
408
+ // The item is for wrapped content, and was copied from the temporary parent wrappedItem.
409
+ tmplItem = wrappedItems[key];
410
+ tmplItem = newTmplItem(tmplItem, newTmplItems[pntNode] || wrappedItems[pntNode]);
411
+ tmplItem.key = ++itemKey;
412
+ newTmplItems[itemKey] = tmplItem;
413
+ }
414
+ if (cloneIndex) {
415
+ cloneTmplItem(key);
416
+ }
448
417
  }
449
- }
450
-
451
- //---- Helper functions for template item ----
452
-
453
- function tiCalls(content, tmpl, data, options) {
454
- if (!content) {
455
- return stack.pop();
418
+ el.removeAttribute(tmplItmAtt);
419
+ } else if (cloneIndex && (tmplItem = jQuery.data(el, "tmplItem"))) {
420
+ // This was a rendered element, cloned during append or appendTo etc.
421
+ // TmplItem stored in jQuery data has already been cloned in cloneCopyEvent. We must replace it with a fresh cloned tmplItem.
422
+ cloneTmplItem(tmplItem.key);
423
+ newTmplItems[tmplItem.key] = tmplItem;
424
+ pntNode = jQuery.data(el.parentNode, "tmplItem");
425
+ pntNode = pntNode ? pntNode.key : 0;
426
+ }
427
+ if (tmplItem) {
428
+ pntItem = tmplItem;
429
+ // Find the template item of the parent element.
430
+ // (Using !=, not !==, since pntItem.key is number, and pntNode may be a string)
431
+ while (pntItem && pntItem.key != pntNode) {
432
+ // Add this element as a top-level node for this rendered template item, as well as for any
433
+ // ancestor items between this item and the item of its parent element
434
+ pntItem.nodes.push(el);
435
+ pntItem = pntItem.parent;
456
436
  }
457
- stack.push({ _: content, tmpl: tmpl, item:this, data: data, options: options });
458
- }
459
-
460
- function tiNest(tmpl, data, options) {
461
- // nested template, using {{tmpl}} tag
462
- return jQuery.tmpl(jQuery.template(tmpl), data, options, this);
437
+ // Delete content built during rendering - reduce API surface area and memory use, and avoid exposing of stale data after rendering...
438
+ delete tmplItem._ctnt;
439
+ delete tmplItem._wrap;
440
+ // Store template item as jQuery data on the element
441
+ jQuery.data(el, "tmplItem", tmplItem);
442
+ }
443
+ function cloneTmplItem(key) {
444
+ key = key + keySuffix;
445
+ tmplItem = newClonedItems[key] =
446
+ (newClonedItems[key] || newTmplItem(tmplItem, newTmplItems[tmplItem.parent.key + keySuffix] || tmplItem.parent));
447
+ }
463
448
  }
449
+ }
464
450
 
465
- function tiWrap(call, wrapped) {
466
- // nested template, using {{wrap}} tag
467
- var options = call.options || {};
468
- options.wrapped = wrapped;
469
- // Apply the template, which may incorporate wrapped content,
470
- return jQuery.tmpl(jQuery.template(call.tmpl), call.data, options, call.item);
471
- }
472
-
473
- function tiHtml(filter, textOnly) {
474
- var wrapped = this._wrap;
475
- return jQuery.map(
476
- jQuery(jQuery.isArray(wrapped) ? wrapped.join("") : wrapped).filter(filter || "*"),
477
- function(e) {
478
- return textOnly ?
479
- e.innerText || e.textContent :
480
- e.outerHTML || outerHtml(e);
481
- });
482
- }
451
+ //---- Helper functions for template item ----
483
452
 
484
- function tiUpdate() {
485
- var coll = this.nodes;
486
- jQuery.tmpl(null, null, null, this).insertBefore(coll[0]);
487
- jQuery(coll).remove();
453
+ function tiCalls(content, tmpl, data, options) {
454
+ if (!content) {
455
+ return stack.pop();
488
456
  }
457
+ stack.push({ _: content, tmpl: tmpl, item:this, data: data, options: options });
458
+ }
459
+
460
+ function tiNest(tmpl, data, options) {
461
+ // nested template, using {{tmpl}} tag
462
+ return jQuery.tmpl(jQuery.template(tmpl), data, options, this);
463
+ }
464
+
465
+ function tiWrap(call, wrapped) {
466
+ // nested template, using {{wrap}} tag
467
+ var options = call.options || {};
468
+ options.wrapped = wrapped;
469
+ // Apply the template, which may incorporate wrapped content,
470
+ return jQuery.tmpl(jQuery.template(call.tmpl), call.data, options, call.item);
471
+ }
472
+
473
+ function tiHtml(filter, textOnly) {
474
+ var wrapped = this._wrap;
475
+ return jQuery.map(
476
+ jQuery(jQuery.isArray(wrapped) ? wrapped.join("") : wrapped).filter(filter || "*"),
477
+ function(e) {
478
+ return textOnly ?
479
+ e.innerText || e.textContent :
480
+ e.outerHTML || outerHtml(e);
481
+ });
482
+ }
483
+
484
+ function tiUpdate() {
485
+ var coll = this.nodes;
486
+ jQuery.tmpl(null, null, null, this).insertBefore(coll[0]);
487
+ jQuery(coll).remove();
488
+ }
489
489
  })(jQuery);