alfa 0.0.1.pre → 0.0.2.pre

Sign up to get free protection for your applications and to get access to all the features.
Files changed (238) hide show
  1. data/assets/css/960gs/960.css +653 -0
  2. data/assets/css/960gs/960_12_col.css +357 -0
  3. data/assets/css/960gs/960_12_col_rtl.css +357 -0
  4. data/assets/css/960gs/960_16_col.css +446 -0
  5. data/assets/css/960gs/960_16_col_rtl.css +446 -0
  6. data/assets/css/960gs/960_24_col.css +621 -0
  7. data/assets/css/960gs/960_24_col_rtl.css +621 -0
  8. data/assets/css/960gs/960_rtl.css +653 -0
  9. data/assets/css/960gs/demo.css +55 -0
  10. data/assets/css/960gs/min/960.css +1 -0
  11. data/assets/css/960gs/min/960_12_col.css +1 -0
  12. data/assets/css/960gs/min/960_12_col_rtl.css +1 -0
  13. data/assets/css/960gs/min/960_16_col.css +1 -0
  14. data/assets/css/960gs/min/960_16_col_rtl.css +1 -0
  15. data/assets/css/960gs/min/960_24_col.css +1 -0
  16. data/assets/css/960gs/min/960_24_col_rtl.css +1 -0
  17. data/assets/css/960gs/min/960_rtl.css +1 -0
  18. data/assets/css/960gs/min/reset.css +1 -0
  19. data/assets/css/960gs/min/reset_rtl.css +1 -0
  20. data/assets/css/960gs/min/text.css +1 -0
  21. data/assets/css/960gs/min/text_rtl.css +1 -0
  22. data/assets/css/960gs/reset.css +211 -0
  23. data/assets/css/960gs/reset_rtl.css +211 -0
  24. data/assets/css/960gs/text.css +86 -0
  25. data/assets/css/960gs/text_rtl.css +86 -0
  26. data/assets/js/jquery/jquery-1.3.2.js +4376 -0
  27. data/assets/js/jquery/jquery-1.3.2.min.js +19 -0
  28. data/assets/js/jquery/jquery-1.4.2.js +6240 -0
  29. data/assets/js/jquery/jquery-1.4.2.min.js +154 -0
  30. data/assets/js/jquery/jquery-1.4.4.js +7179 -0
  31. data/assets/js/jquery/jquery-1.4.4.min.js +167 -0
  32. data/assets/js/jquery/jquery-1.8.2.js +9440 -0
  33. data/assets/js/jquery/jquery-1.8.2.min.js +2 -0
  34. data/assets/js/jquery/jquery-latest.js +2 -0
  35. data/assets/js/jquery/plugins/corner.js +178 -0
  36. data/assets/js/jquery/plugins/corner_12x.js +503 -0
  37. data/assets/js/jquery/plugins/datepick/calendar-green.gif +0 -0
  38. data/assets/js/jquery/plugins/datepick/calendar.gif +0 -0
  39. data/assets/js/jquery/plugins/datepick/datepickBasics.html +34 -0
  40. data/assets/js/jquery/plugins/datepick/flora.datepick.css +221 -0
  41. data/assets/js/jquery/plugins/datepick/humanity.datepick.css +192 -0
  42. data/assets/js/jquery/plugins/datepick/jquery.datepick-ar.js +27 -0
  43. data/assets/js/jquery/plugins/datepick/jquery.datepick-az.js +26 -0
  44. data/assets/js/jquery/plugins/datepick/jquery.datepick-bg.js +26 -0
  45. data/assets/js/jquery/plugins/datepick/jquery.datepick-ca.js +26 -0
  46. data/assets/js/jquery/plugins/datepick/jquery.datepick-cs.js +26 -0
  47. data/assets/js/jquery/plugins/datepick/jquery.datepick-da.js +26 -0
  48. data/assets/js/jquery/plugins/datepick/jquery.datepick-de.js +26 -0
  49. data/assets/js/jquery/plugins/datepick/jquery.datepick-el.js +26 -0
  50. data/assets/js/jquery/plugins/datepick/jquery.datepick-eo.js +26 -0
  51. data/assets/js/jquery/plugins/datepick/jquery.datepick-es.js +26 -0
  52. data/assets/js/jquery/plugins/datepick/jquery.datepick-et.js +26 -0
  53. data/assets/js/jquery/plugins/datepick/jquery.datepick-fa.js +26 -0
  54. data/assets/js/jquery/plugins/datepick/jquery.datepick-fi.js +26 -0
  55. data/assets/js/jquery/plugins/datepick/jquery.datepick-fr.js +26 -0
  56. data/assets/js/jquery/plugins/datepick/jquery.datepick-he.js +26 -0
  57. data/assets/js/jquery/plugins/datepick/jquery.datepick-hr.js +26 -0
  58. data/assets/js/jquery/plugins/datepick/jquery.datepick-hu.js +26 -0
  59. data/assets/js/jquery/plugins/datepick/jquery.datepick-hy.js +26 -0
  60. data/assets/js/jquery/plugins/datepick/jquery.datepick-id.js +26 -0
  61. data/assets/js/jquery/plugins/datepick/jquery.datepick-is.js +26 -0
  62. data/assets/js/jquery/plugins/datepick/jquery.datepick-it.js +26 -0
  63. data/assets/js/jquery/plugins/datepick/jquery.datepick-ja.js +26 -0
  64. data/assets/js/jquery/plugins/datepick/jquery.datepick-ko.js +26 -0
  65. data/assets/js/jquery/plugins/datepick/jquery.datepick-lt.js +26 -0
  66. data/assets/js/jquery/plugins/datepick/jquery.datepick-lv.js +26 -0
  67. data/assets/js/jquery/plugins/datepick/jquery.datepick-ms.js +26 -0
  68. data/assets/js/jquery/plugins/datepick/jquery.datepick-nl.js +26 -0
  69. data/assets/js/jquery/plugins/datepick/jquery.datepick-no.js +26 -0
  70. data/assets/js/jquery/plugins/datepick/jquery.datepick-pl.js +26 -0
  71. data/assets/js/jquery/plugins/datepick/jquery.datepick-pt-BR.js +26 -0
  72. data/assets/js/jquery/plugins/datepick/jquery.datepick-ro.js +26 -0
  73. data/assets/js/jquery/plugins/datepick/jquery.datepick-ru.js +26 -0
  74. data/assets/js/jquery/plugins/datepick/jquery.datepick-sk.js +26 -0
  75. data/assets/js/jquery/plugins/datepick/jquery.datepick-sl.js +27 -0
  76. data/assets/js/jquery/plugins/datepick/jquery.datepick-sq.js +26 -0
  77. data/assets/js/jquery/plugins/datepick/jquery.datepick-sr-SR.js +25 -0
  78. data/assets/js/jquery/plugins/datepick/jquery.datepick-sr.js +25 -0
  79. data/assets/js/jquery/plugins/datepick/jquery.datepick-sv.js +26 -0
  80. data/assets/js/jquery/plugins/datepick/jquery.datepick-th.js +26 -0
  81. data/assets/js/jquery/plugins/datepick/jquery.datepick-tr.js +26 -0
  82. data/assets/js/jquery/plugins/datepick/jquery.datepick-uk.js +26 -0
  83. data/assets/js/jquery/plugins/datepick/jquery.datepick-validation.js +141 -0
  84. data/assets/js/jquery/plugins/datepick/jquery.datepick-validation.min.js +8 -0
  85. data/assets/js/jquery/plugins/datepick/jquery.datepick-validation.pack.js +8 -0
  86. data/assets/js/jquery/plugins/datepick/jquery.datepick-zh-CN.js +26 -0
  87. data/assets/js/jquery/plugins/datepick/jquery.datepick-zh-TW.js +26 -0
  88. data/assets/js/jquery/plugins/datepick/jquery.datepick.css +216 -0
  89. data/assets/js/jquery/plugins/datepick/jquery.datepick.ent +76 -0
  90. data/assets/js/jquery/plugins/datepick/jquery.datepick.js +1974 -0
  91. data/assets/js/jquery/plugins/datepick/jquery.datepick.min.js +8 -0
  92. data/assets/js/jquery/plugins/datepick/jquery.datepick.pack.js +8 -0
  93. data/assets/js/jquery/plugins/datepick/redmond.datepick.css +204 -0
  94. data/assets/js/jquery/plugins/datepick/smoothness.datepick.css +205 -0
  95. data/assets/js/jquery/plugins/fancybox/blank.gif +0 -0
  96. data/assets/js/jquery/plugins/fancybox/fancy_close.png +0 -0
  97. data/assets/js/jquery/plugins/fancybox/fancy_loading.png +0 -0
  98. data/assets/js/jquery/plugins/fancybox/fancy_nav_left.png +0 -0
  99. data/assets/js/jquery/plugins/fancybox/fancy_nav_right.png +0 -0
  100. data/assets/js/jquery/plugins/fancybox/fancy_shadow_e.png +0 -0
  101. data/assets/js/jquery/plugins/fancybox/fancy_shadow_n.png +0 -0
  102. data/assets/js/jquery/plugins/fancybox/fancy_shadow_ne.png +0 -0
  103. data/assets/js/jquery/plugins/fancybox/fancy_shadow_nw.png +0 -0
  104. data/assets/js/jquery/plugins/fancybox/fancy_shadow_s.png +0 -0
  105. data/assets/js/jquery/plugins/fancybox/fancy_shadow_se.png +0 -0
  106. data/assets/js/jquery/plugins/fancybox/fancy_shadow_sw.png +0 -0
  107. data/assets/js/jquery/plugins/fancybox/fancy_shadow_w.png +0 -0
  108. data/assets/js/jquery/plugins/fancybox/fancy_title_left.png +0 -0
  109. data/assets/js/jquery/plugins/fancybox/fancy_title_main.png +0 -0
  110. data/assets/js/jquery/plugins/fancybox/fancy_title_over.png +0 -0
  111. data/assets/js/jquery/plugins/fancybox/fancy_title_right.png +0 -0
  112. data/assets/js/jquery/plugins/fancybox/fancybox-x.png +0 -0
  113. data/assets/js/jquery/plugins/fancybox/fancybox-y.png +0 -0
  114. data/assets/js/jquery/plugins/fancybox/fancybox.png +0 -0
  115. data/assets/js/jquery/plugins/fancybox/jquery.easing-1.3.pack.js +72 -0
  116. data/assets/js/jquery/plugins/fancybox/jquery.fancybox-1.3.2.css +359 -0
  117. data/assets/js/jquery/plugins/fancybox/jquery.fancybox-1.3.2.js +1136 -0
  118. data/assets/js/jquery/plugins/fancybox/jquery.fancybox-1.3.2.pack.js +46 -0
  119. data/assets/js/jquery/plugins/fancybox/jquery.fancybox-1.3.4.css +359 -0
  120. data/assets/js/jquery/plugins/fancybox/jquery.fancybox-1.3.4.js +1156 -0
  121. data/assets/js/jquery/plugins/fancybox/jquery.fancybox-1.3.4.pack.js +46 -0
  122. data/assets/js/jquery/plugins/fancybox/jquery.mousewheel-3.0.4.pack.js +14 -0
  123. data/assets/js/jquery/plugins/jquery.cookie.js +96 -0
  124. data/assets/js/jquery/plugins/jquery.easing.1.3.js +205 -0
  125. data/assets/js/jquery/plugins/jquery.flash.js +288 -0
  126. data/assets/js/jquery/plugins/jquery.flash.min.js +1 -0
  127. data/assets/js/jquery/plugins/jquery.ifixpng.js +137 -0
  128. data/assets/js/jquery/plugins/jquery.mousewheel.js +84 -0
  129. data/assets/js/jquery/plugins/jquery.mousewheel.min.js +12 -0
  130. data/assets/js/jquery/plugins/jquery.numberformatter-1.2.2.js +486 -0
  131. data/assets/js/jquery/plugins/jquery.sifr.js +224 -0
  132. data/assets/js/jquery/plugins/jquery.sifr.min.js +1 -0
  133. data/assets/js/jquery/plugins/jquery.swfobject.js +1 -0
  134. data/assets/js/jquery/plugins/jquery.timers-1.1.2.js +147 -0
  135. data/assets/js/jquery/plugins/simplegallery.js +167 -0
  136. data/assets/js/jquery/ui/external/jquery.bgiframe-2.1.2.js +39 -0
  137. data/assets/js/jquery/ui/external/jquery.cookie.js +89 -0
  138. data/assets/js/jquery/ui/external/jquery.metadata.js +122 -0
  139. data/assets/js/jquery/ui/external/qunit.css +153 -0
  140. data/assets/js/jquery/ui/external/qunit.js +1261 -0
  141. data/assets/js/jquery/ui/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  142. data/assets/js/jquery/ui/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
  143. data/assets/js/jquery/ui/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  144. data/assets/js/jquery/ui/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  145. data/assets/js/jquery/ui/images/ui-bg_glass_75_dadada_1x400.png +0 -0
  146. data/assets/js/jquery/ui/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  147. data/assets/js/jquery/ui/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  148. data/assets/js/jquery/ui/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  149. data/assets/js/jquery/ui/images/ui-icons_222222_256x240.png +0 -0
  150. data/assets/js/jquery/ui/images/ui-icons_2e83ff_256x240.png +0 -0
  151. data/assets/js/jquery/ui/images/ui-icons_454545_256x240.png +0 -0
  152. data/assets/js/jquery/ui/images/ui-icons_888888_256x240.png +0 -0
  153. data/assets/js/jquery/ui/images/ui-icons_cd0a0a_256x240.png +0 -0
  154. data/assets/js/jquery/ui/jquery-ui-latest.min.js +778 -0
  155. data/assets/js/jquery/ui/themes/base/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  156. data/assets/js/jquery/ui/themes/base/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
  157. data/assets/js/jquery/ui/themes/base/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  158. data/assets/js/jquery/ui/themes/base/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  159. data/assets/js/jquery/ui/themes/base/images/ui-bg_glass_75_dadada_1x400.png +0 -0
  160. data/assets/js/jquery/ui/themes/base/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  161. data/assets/js/jquery/ui/themes/base/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  162. data/assets/js/jquery/ui/themes/base/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  163. data/assets/js/jquery/ui/themes/base/images/ui-icons_222222_256x240.png +0 -0
  164. data/assets/js/jquery/ui/themes/base/images/ui-icons_2e83ff_256x240.png +0 -0
  165. data/assets/js/jquery/ui/themes/base/images/ui-icons_454545_256x240.png +0 -0
  166. data/assets/js/jquery/ui/themes/base/images/ui-icons_888888_256x240.png +0 -0
  167. data/assets/js/jquery/ui/themes/base/images/ui-icons_cd0a0a_256x240.png +0 -0
  168. data/assets/js/jquery/ui/themes/base/jquery.ui.accordion.css +19 -0
  169. data/assets/js/jquery/ui/themes/base/jquery.ui.all.css +11 -0
  170. data/assets/js/jquery/ui/themes/base/jquery.ui.autocomplete.css +53 -0
  171. data/assets/js/jquery/ui/themes/base/jquery.ui.base.css +11 -0
  172. data/assets/js/jquery/ui/themes/base/jquery.ui.button.css +38 -0
  173. data/assets/js/jquery/ui/themes/base/jquery.ui.core.css +41 -0
  174. data/assets/js/jquery/ui/themes/base/jquery.ui.datepicker.css +68 -0
  175. data/assets/js/jquery/ui/themes/base/jquery.ui.dialog.css +21 -0
  176. data/assets/js/jquery/ui/themes/base/jquery.ui.progressbar.css +11 -0
  177. data/assets/js/jquery/ui/themes/base/jquery.ui.resizable.css +20 -0
  178. data/assets/js/jquery/ui/themes/base/jquery.ui.selectable.css +10 -0
  179. data/assets/js/jquery/ui/themes/base/jquery.ui.slider.css +24 -0
  180. data/assets/js/jquery/ui/themes/base/jquery.ui.tabs.css +18 -0
  181. data/assets/js/jquery/ui/themes/base/jquery.ui.theme.css +252 -0
  182. data/assets/js/jquery/ui/themes/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  183. data/assets/js/jquery/ui/themes/smoothness/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
  184. data/assets/js/jquery/ui/themes/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  185. data/assets/js/jquery/ui/themes/smoothness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  186. data/assets/js/jquery/ui/themes/smoothness/images/ui-bg_glass_75_dadada_1x400.png +0 -0
  187. data/assets/js/jquery/ui/themes/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  188. data/assets/js/jquery/ui/themes/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  189. data/assets/js/jquery/ui/themes/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  190. data/assets/js/jquery/ui/themes/smoothness/images/ui-icons_222222_256x240.png +0 -0
  191. data/assets/js/jquery/ui/themes/smoothness/images/ui-icons_2e83ff_256x240.png +0 -0
  192. data/assets/js/jquery/ui/themes/smoothness/images/ui-icons_454545_256x240.png +0 -0
  193. data/assets/js/jquery/ui/themes/smoothness/images/ui-icons_888888_256x240.png +0 -0
  194. data/assets/js/jquery/ui/themes/smoothness/images/ui-icons_cd0a0a_256x240.png +0 -0
  195. data/assets/js/jquery/ui/themes/smoothness/jquery-ui-1.8.6.custom.css +572 -0
  196. data/assets/js/jquery/ui/themes/smoothness/jquery.ui.accordion.css +19 -0
  197. data/assets/js/jquery/ui/themes/smoothness/jquery.ui.all.css +11 -0
  198. data/assets/js/jquery/ui/themes/smoothness/jquery.ui.autocomplete.css +53 -0
  199. data/assets/js/jquery/ui/themes/smoothness/jquery.ui.base.css +11 -0
  200. data/assets/js/jquery/ui/themes/smoothness/jquery.ui.button.css +38 -0
  201. data/assets/js/jquery/ui/themes/smoothness/jquery.ui.core.css +41 -0
  202. data/assets/js/jquery/ui/themes/smoothness/jquery.ui.datepicker.css +68 -0
  203. data/assets/js/jquery/ui/themes/smoothness/jquery.ui.dialog.css +21 -0
  204. data/assets/js/jquery/ui/themes/smoothness/jquery.ui.progressbar.css +11 -0
  205. data/assets/js/jquery/ui/themes/smoothness/jquery.ui.resizable.css +20 -0
  206. data/assets/js/jquery/ui/themes/smoothness/jquery.ui.selectable.css +10 -0
  207. data/assets/js/jquery/ui/themes/smoothness/jquery.ui.slider.css +24 -0
  208. data/assets/js/jquery/ui/themes/smoothness/jquery.ui.tabs.css +18 -0
  209. data/assets/js/jquery/ui/themes/smoothness/jquery.ui.theme.css +254 -0
  210. data/bin/alfa +15 -0
  211. data/lib/alfa/application.rb +36 -0
  212. data/lib/alfa/cli_application.rb +11 -3
  213. data/lib/alfa/commands/new.rb +4 -0
  214. data/lib/alfa/config.rb +11 -0
  215. data/lib/alfa/controller.rb +1 -1
  216. data/lib/alfa/database/mysql.rb +60 -8
  217. data/lib/alfa/database.rb +2 -1
  218. data/lib/alfa/logger.rb +38 -0
  219. data/lib/alfa/models/base.rb +1 -1
  220. data/lib/alfa/models/base_sql.rb +1 -1
  221. data/lib/alfa/models/dummy.rb +1 -1
  222. data/lib/alfa/models/mysql.rb +36 -26
  223. data/lib/alfa/models.rb +1 -1
  224. data/lib/alfa/query_logger.rb +29 -0
  225. data/lib/alfa/router.rb +155 -0
  226. data/lib/alfa/support.rb +58 -2
  227. data/lib/alfa/tfile.rb +97 -0
  228. data/lib/alfa/web_application.rb +106 -85
  229. data/lib/alfa.rb +1 -1
  230. data/lib/ruty/bugfix.rb +21 -0
  231. data/lib/ruty/tags/resources.rb +45 -2
  232. data/lib/ruty/upgrade.rb +61 -0
  233. data/test/data/test_router/config/routes.rb +4 -0
  234. data/test/test_alfa.rb +1 -52
  235. data/test/test_router.rb +132 -0
  236. data/test/test_support.rb +26 -0
  237. data/test/test_tfile.rb +186 -0
  238. metadata +259 -100
@@ -0,0 +1 @@
1
+ (function($){$.fn.sifr=function(prefs){var t=true,u=undefined,s,p;s=arguments.callee.prefs=arguments.callee.prefs||{asHex:function(x){var d=['0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'];return isNaN(x)?'00':d[(x-x%16)/16]+d[x%16];},colors:{aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0],transparent:[255,255,255]},toHex:function(color){var rgb;if(!color){return u;}return(rgb=color.match(/rgb\(([0-9]+),\s([0-9]+),\s([0-9]+)\)/))?'#'+this.asHex(rgb[1])+this.asHex(rgb[2])+this.asHex(rgb[3]):(rgb=this.colors[color])?'#'+this.asHex(rgb[0])+this.asHex(rgb[1])+this.asHex(rgb[2]):(color.length===4)?color.replace(/\#([0-9a-z])([0-9a-z])([0-9a-z])/,'#$1$1$2$2$3$3'):color;}};p=$.extend({},s,(prefs===false)?{unsifr:true}:prefs);if(p.save===t){arguments.callee.prefs=$.extend(p,{save:false});}if(this[0]===document){return;}if(!p.unsifr&&typeof p.before==='function'){p.before.apply(this,[p]);}this.each(function(){var ele=$(this),txt,alt,fir,embedOptions;fir=ele.children('.sIFR-alternate');if(fir){ele.html(fir.html());if(p.unsifr){return;}}if(typeof p.beforeEach==='function'){p.beforeEach.apply(this,[t,p]);}fir=ele.addClass('sIFR-replaced').wrapInner('<span class="sIFR-alternate" style="position: absolute; "></span>').children('.sIFR-alternate');alt=ele.append('<span class="sIFR-jquery" style="position: absolute; ">'+$.trim(fir.text())+'</span>').children('.sIFR-jquery');txt=$.trim(fir.html()).replace(/(>)\s+|\s+(<)/g,'$1$2').replace(/(id|name)=[A-Za-z0-9]+/g,'');if(p.textTransform){p.textTransform=p.textTransform.toLowerCase();if(p.textTransform==='uppercase'){txt=txt.toUpperCase();}if(p.textTransform==='lowercase'){txt=txt.html().toLowerCase();}if(p.textTransform==='capitalize'){var cap=txt.split(/(\s|\>)/);txt='';for(var i in cap){txt+=cap[i].charAt(0).toUpperCase()+cap[i].substr(1);}}}txt=ele.attr('href')?'<a href="'+ele.attr('href')+'">'+txt+'</a>':txt;embedOptions={flashvars:$.extend({h:alt.height()*(p.zoom||1),offsetLeft:p.offsetLeft||u,offsetTop:p.offsetTop||u,textAlign:p.textAlign||ele.css('textAlign').match(/left|center|right/)||'center',textColor:p.toHex(p.color||ele.css('color'))||u,txt:p.content||txt,underline:(p.underline===t||ele.css('textDecoration')==='underline')?t:u,w:alt.width()*(p.zoom||1)},p.flashvars),height:p.height||alt.height(),src:(p.path||'').replace(/([^\/])$/,'$1/')+(p.font||ele.css('fontFamily').replace(/^\s+|\s+$|,[\S|\s]+|'|"|(,)\s+/g,'$1')).replace(/([^\.][^s][^w][^f])$/,'$1.swf'),style:'margin: 1px 0 0; position: absolute; vertical-align: text-top;',width:p.width||alt.width(),wmode:'transparent'};embedOptions.flashvars.linkColor=p.toHex(p.link||ele.find('a').css('color'))||embedOptions.flashvars.textColor;embedOptions.flashvars.hoverColor=p.toHex(p.hover)||embedOptions.flashvars.linkColor;if(p.zoom){embedOptions.flashvars.offsetTop=((p.offsetTop||0)+((alt.height()-(alt.height()*p.zoom))/2))*(p.zoomTop||1);embedOptions.flashvars.offsetLeft=((p.offsetLeft||0)+((alt.width()-(alt.width()*p.zoom))/2))*(p.zoomLeft||1);}$().flash($.extend(embedOptions,p.embedOptions),$.extend({expressInstall:p.expressInstall||false,version:p.version||7,update:p.update||false},p.pluginOptions),function(options){fir.attr('style','visibility: hidden;');alt.remove();ele.prepend($.fn.flash.transform(options));});if(typeof p.afterEach==='function'){p.afterEach.apply(this,[t,p]);}});if(!p.unsifr&&typeof p.after==='function'){p.after.apply(this,[p]);}};$.fn.unsifr=function(){return this.each(function(){$(this).sifr(false);});};$.sifr=function(prefs){$(document).sifr($.extend({save:true},prefs));};$.sifr();})(jQuery);
@@ -0,0 +1 @@
1
+ (function(F,C){var D=function(H){var G,I=[];for(G in H){if(/string|number/.test(typeof H[G])&&H[G]!==""){I.push(G+'="'+H[G]+'"')}}return I[A]("")},E=function(I){var G,K,J=[],H;if(typeof I=="object"){for(G in I){if(typeof I[G]=="object"){H=[];for(K in I[G]){H.push([K,"=",encodeURIComponent(I[G][K])][A](""))}I[G]=H[A]("&amp;")}if(I[G]){J.push(['<param name="',G,'" value="',I[G],'" />'][A](""))}}I=J[A]("")}return I},B=false,A="join";F[C]=(function(){try{var G="0,0,0",H=navigator.plugins["Shockwave Flash"]||ActiveXObject;G=H.description||(function(){try{return(new H("ShockwaveFlash.ShockwaveFlash")).GetVariable("$version")}catch(J){}}())}catch(I){}G=G.match(/^[A-Za-z\s]*?(\d+)[\.|,](\d+)(?:\s+[d|r]|,)(\d+)/);return{available:G[1]>0,activeX:H&&!H.name,version:{major:G[1]*1,minor:G[2]*1,release:G[3]*1},hasVersion:function(K){var N=this.version,L="major",M="minor",J="release";K=(/string|number/.test(typeof K))?K.toString().split("."):K||[0,0,0];K=[K[L]||K[0]||N[L],K[M]||K[1]||N[M],K[J]||K[2]||N[J]];return(K[0]<N[L])||(K[0]==N[L]&&K[1]<N[M])||(K[0]==N[L]&&K[1]==N[M]&&K[2]<=N[J])},expressInstall:"expressInstall.swf",create:function(J){if(!F[C].available||B||!typeof J=="object"||!J.swf){return false}if(J.hasVersion&&!F[C].hasVersion(J.hasVersion)){J={swf:J.expressInstall||F[C].expressInstall,attrs:{id:J.id||"SWFObjectExprInst",name:J.name,height:Math.max(J.height||137),width:Math.max(J.width||214)},params:{flashvars:{MMredirectURL:location.href,MMplayerType:(F[C].activeX)?"ActiveX":"PlugIn",MMdoctitle:document.title.slice(0,47)+" - Flash Player Installation"}}};B=true}else{J=F.extend(true,{attrs:{id:J.id,name:J.name,height:J.height||180,width:J.width||320},params:{wmode:J.wmode||"opaque",flashvars:J.flashvars}},J)}if(F[C].activeX){J.attrs.classid=J.attrs.classid||"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000";J.params.movie=J.params.movie||J.swf}else{J.attrs.type=J.attrs.classid||"application/x-shockwave-flash";J.attrs.data=J.attrs.data||J.swf}return["<object ",D(J.attrs),">",E(J.params),"</object>"][A]("")}}}());F.fn[C]=function(G){if(typeof G=="object"){this.each(function(){var I=document.createElement(C);var H=F[C].create(G);if(H){I.innerHTML=H;if(I.childNodes[0]){this.appendChild(I.childNodes[0])}}})}else{if(typeof G=="function"){this.find("object").andSelf().filter("object").each(function(){var I=this,H="jsInteractionTimeoutMs";I[H]=I[H]||0;if(I[H]<660){if(I.clientWidth||I.clientHeight){G.call(this)}else{setTimeout(function(){F(I)[C](G)},I[H]+66)}}})}}return this}}(jQuery,"flash"));
@@ -0,0 +1,147 @@
1
+ /**
2
+ * jQuery.timers - Timer abstractions for jQuery
3
+ * Written by Blair Mitchelmore (blair DOT mitchelmore AT gmail DOT com)
4
+ * Licensed under the WTFPL (http://sam.zoy.org/wtfpl/).
5
+ * Date: 2009/02/08
6
+ *
7
+ * @author Blair Mitchelmore
8
+ * @version 1.1.2
9
+ *
10
+ **/
11
+
12
+ jQuery.fn.extend({
13
+ everyTime: function(interval, label, fn, times, belay) {
14
+ return this.each(function() {
15
+ jQuery.timer.add(this, interval, label, fn, times, belay);
16
+ });
17
+ },
18
+ oneTime: function(interval, label, fn) {
19
+ return this.each(function() {
20
+ jQuery.timer.add(this, interval, label, fn, 1);
21
+ });
22
+ },
23
+ stopTime: function(label, fn) {
24
+ return this.each(function() {
25
+ jQuery.timer.remove(this, label, fn);
26
+ });
27
+ }
28
+ });
29
+
30
+ jQuery.event.special
31
+
32
+ jQuery.extend({
33
+ timer: {
34
+ global: [],
35
+ guid: 1,
36
+ dataKey: "jQuery.timer",
37
+ regex: /^([0-9]+(?:\.[0-9]*)?)\s*(.*s)?$/,
38
+ powers: {
39
+ // Yeah this is major overkill...
40
+ 'ms': 1,
41
+ 'cs': 10,
42
+ 'ds': 100,
43
+ 's': 1000,
44
+ 'das': 10000,
45
+ 'hs': 100000,
46
+ 'ks': 1000000
47
+ },
48
+ timeParse: function(value) {
49
+ if (value == undefined || value == null)
50
+ return null;
51
+ var result = this.regex.exec(jQuery.trim(value.toString()));
52
+ if (result[2]) {
53
+ var num = parseFloat(result[1]);
54
+ var mult = this.powers[result[2]] || 1;
55
+ return num * mult;
56
+ } else {
57
+ return value;
58
+ }
59
+ },
60
+ add: function(element, interval, label, fn, times, belay) {
61
+ var counter = 0;
62
+
63
+ if (jQuery.isFunction(label)) {
64
+ if (!times)
65
+ times = fn;
66
+ fn = label;
67
+ label = interval;
68
+ }
69
+
70
+ interval = jQuery.timer.timeParse(interval);
71
+
72
+ if (typeof interval != 'number' || isNaN(interval) || interval <= 0)
73
+ return;
74
+
75
+ if (times && times.constructor != Number) {
76
+ belay = !!times;
77
+ times = 0;
78
+ }
79
+
80
+ times = times || 0;
81
+ belay = belay || false;
82
+
83
+ var timers = jQuery.data(element, this.dataKey) || jQuery.data(element, this.dataKey, {});
84
+
85
+ if (!timers[label])
86
+ timers[label] = {};
87
+
88
+ fn.timerID = fn.timerID || this.guid++;
89
+
90
+ var handler = function() {
91
+ if (belay && this.inProgress)
92
+ return;
93
+ this.inProgress = true;
94
+ if ((++counter > times && times !== 0) || fn.call(element, counter) === false)
95
+ jQuery.timer.remove(element, label, fn);
96
+ this.inProgress = false;
97
+ };
98
+
99
+ handler.timerID = fn.timerID;
100
+
101
+ if (!timers[label][fn.timerID])
102
+ timers[label][fn.timerID] = window.setInterval(handler,interval);
103
+
104
+ this.global.push( element );
105
+
106
+ },
107
+ remove: function(element, label, fn) {
108
+ var timers = jQuery.data(element, this.dataKey), ret;
109
+
110
+ if ( timers ) {
111
+
112
+ if (!label) {
113
+ for ( label in timers )
114
+ this.remove(element, label, fn);
115
+ } else if ( timers[label] ) {
116
+ if ( fn ) {
117
+ if ( fn.timerID ) {
118
+ window.clearInterval(timers[label][fn.timerID]);
119
+ delete timers[label][fn.timerID];
120
+ }
121
+ } else {
122
+ for ( var fn in timers[label] ) {
123
+ window.clearInterval(timers[label][fn]);
124
+ delete timers[label][fn];
125
+ }
126
+ }
127
+
128
+ for ( ret in timers[label] ) break;
129
+ if ( !ret ) {
130
+ ret = null;
131
+ delete timers[label];
132
+ }
133
+ }
134
+
135
+ for ( ret in timers ) break;
136
+ if ( !ret )
137
+ jQuery.removeData(element, this.dataKey);
138
+ }
139
+ }
140
+ }
141
+ });
142
+
143
+ jQuery(window).bind("unload", function() {
144
+ jQuery.each(jQuery.timer.global, function(index, item) {
145
+ jQuery.timer.remove(item);
146
+ });
147
+ });
@@ -0,0 +1,167 @@
1
+ //** DD Drop Down Panel- (c) Dynamic Drive DHTML code library: http://www.dynamicdrive.com
2
+ //** Dec 7th, 08'- Script created (Requires jquery 1.2.x)
3
+
4
+
5
+
6
+ function simpleGallery(settingarg){
7
+ this.setting=settingarg
8
+ settingarg=null
9
+ var setting=this.setting
10
+ setting.pause=parseInt(setting.pause)
11
+ setting.fadeduration=parseInt(setting.fadeduration)
12
+ setting.curimage=(setting.persist)? simpleGallery.routines.getCookie("gallery-"+setting.wrapperid) : 0
13
+ setting.curimage=setting.curimage || 0 //account for curimage being null if cookie is empty
14
+ setting.ispaused=!setting.autoplay //ispaused reflects current state of gallery, autoplay indicates whether gallery is set to auto play
15
+ setting.fglayer=0, setting.bglayer=1 //index of active and background layer (switches after each change of slide)
16
+ setting.oninit=setting.oninit || function(){}
17
+ setting.onslide=setting.onslide || function(){}
18
+ var preloadimages=[] //temp array to preload images
19
+ for (var i=0; i<setting.imagearray.length; i++){
20
+ preloadimages[i]=new Image()
21
+ preloadimages[i].src=setting.imagearray[i][0]
22
+ }
23
+ var slideshow=this
24
+ jQuery(document).ready(function($){
25
+ var setting=slideshow.setting
26
+ setting.$wrapperdiv=$('#'+setting.wrapperid).css({position:'relative', visibility:'visible', background:'black', overflow:'hidden', width:setting.dimensions[0], height:setting.dimensions[1]}).empty() //main gallery DIV
27
+ if (setting.$wrapperdiv.length==0){ //if no wrapper DIV found
28
+ alert("Error: DIV with ID \""+setting.wrapperid+"\" not found on page.")
29
+ return
30
+ }
31
+ setting.$gallerylayers=$('<div class="gallerylayer"></div><div class="gallerylayer"></div>') //two stacked DIVs to display the actual slide
32
+ .css({position:'absolute', left:0, top:0})
33
+ .appendTo(setting.$wrapperdiv)
34
+ setting.gallerylayers=setting.$gallerylayers.get() //cache stacked DIVs as DOM objects
35
+ setting.navbuttons=simpleGallery.routines.addnavpanel(setting) //get 4 nav buttons DIVs as DOM objects
36
+ $(setting.navbuttons).filter('img.navimages').css({opacity:0.8})
37
+ .bind('mouseover mouseout', function(e){
38
+ $(this).css({opacity:(e.type=="mouseover")? 1 : 0.8})
39
+ })
40
+ .bind('click', function(e){
41
+ var keyword=e.target.title.toLowerCase()
42
+ slideshow.navigate(keyword) //assign behavior to nav images
43
+ })
44
+ setting.$wrapperdiv.bind('mouseenter', function(){slideshow.showhidenavpanel('show')})
45
+ setting.$wrapperdiv.bind('mouseleave', function(){slideshow.showhidenavpanel('hide')})
46
+ slideshow.showslide(setting.curimage) //show initial slide
47
+ setting.oninit() //trigger oninit() event
48
+ $(window).bind('unload', function(){ //clean up and persist
49
+ $(slideshow.setting.navbuttons).unbind()
50
+ if (slideshow.setting.persist) //remember last shown image's index
51
+ simpleGallery.routines.setCookie("gallery-"+setting.wrapperid, setting.curimage)
52
+ jQuery.each(slideshow.setting, function(k){
53
+ if (slideshow.setting[k] instanceof Array){
54
+ for (var i=0; i<slideshow.setting[k].length; i++){
55
+ if (slideshow.setting[k][i].tagName=="DIV")
56
+ slideshow.setting[k][i].innerHTML=null
57
+ slideshow.setting[k][i]=null
58
+ }
59
+ }
60
+ slideshow.setting[k]=null
61
+ })
62
+ slideshow=slideshow.setting=null
63
+ })
64
+ })
65
+ }
66
+
67
+ simpleGallery.prototype={
68
+
69
+ navigate:function(keyword){
70
+ clearTimeout(this.setting.playtimer)
71
+ if (!isNaN(parseInt(keyword))){
72
+ this.showslide(parseInt(keyword))
73
+ }
74
+ else if (/(prev)|(next)/i.test(keyword)){
75
+ this.showslide(keyword.toLowerCase())
76
+ }
77
+ else{ //if play|pause button
78
+ var slideshow=this
79
+ var $playbutton=$(this.setting.navbuttons).eq(1)
80
+ if (!this.setting.ispaused){ //if pause Gallery
81
+ this.setting.autoplay=false
82
+ $playbutton.attr({title:'Play', src:simpleGallery_navpanel.images[1]})
83
+ }
84
+ else if (this.setting.ispaused){ //if play Gallery
85
+ this.setting.autoplay=true
86
+ this.setting.playtimer=setTimeout(function(){slideshow.showslide('next')}, this.setting.pause)
87
+ $playbutton.attr({title:'Pause', src:simpleGallery_navpanel.images[3]})
88
+ }
89
+ slideshow.setting.ispaused=!slideshow.setting.ispaused
90
+ }
91
+ },
92
+
93
+ showslide:function(keyword){
94
+ var slideshow=this
95
+ var setting=slideshow.setting
96
+ var totalimages=setting.imagearray.length
97
+ var imgindex=(keyword=="next")? (setting.curimage<totalimages-1? setting.curimage+1 : 0)
98
+ : (keyword=="prev")? (setting.curimage>0? setting.curimage-1 : totalimages-1)
99
+ : Math.min(keyword, totalimages-1)
100
+ setting.gallerylayers[setting.bglayer].innerHTML=simpleGallery.routines.getSlideHTML(setting.imagearray[imgindex])
101
+ setting.$gallerylayers.eq(setting.bglayer).css({zIndex:1000, opacity:0}) //background layer becomes foreground
102
+ .stop().css({opacity:0}).animate({opacity:1}, setting.fadeduration, function(){ //Callback function after fade animation is complete:
103
+ clearTimeout(setting.playtimer)
104
+ setting.gallerylayers[setting.bglayer].innerHTML=null //empty bglayer (previously fglayer before setting.fglayer=setting.bglayer was set below)
105
+ try{
106
+ setting.onslide(setting.gallerylayers[setting.fglayer], setting.curimage)
107
+ }catch(e){
108
+ alert("Simple Controls Gallery: An error has occured somwhere in your code attached to the \"onslide\" event: "+e)
109
+ }
110
+ if (setting.autoplay){
111
+ setting.playtimer=setTimeout(function(){slideshow.showslide('next')}, setting.pause)
112
+ }
113
+ })
114
+ setting.gallerylayers[setting.fglayer].style.zIndex=999 //foreground layer becomes background
115
+ setting.fglayer=setting.bglayer
116
+ setting.bglayer=(setting.bglayer==0)? 1 : 0
117
+ setting.curimage=imgindex
118
+ setting.navbuttons[3].innerHTML=(setting.curimage+1) + '/' + setting.imagearray.length
119
+ },
120
+
121
+ showhidenavpanel:function(state){
122
+ var setting=this.setting
123
+ var endpoint=(state=="show")? setting.dimensions[1]-parseInt(simpleGallery_navpanel.panel.height) : this.setting.dimensions[1]
124
+ setting.$navpanel.stop().animate({top:endpoint}, simpleGallery_navpanel.slideduration)
125
+ }
126
+ }
127
+
128
+ simpleGallery.routines={
129
+
130
+ getSlideHTML:function(imgelement){
131
+ var layerHTML=(imgelement[1])? '<a href="'+imgelement[1]+'" target="'+imgelement[2]+'">\n' : '' //hyperlink slide?
132
+ layerHTML+='<img src="'+imgelement[0]+'" style="border-width:0" />'
133
+ layerHTML+=(imgelement[1])? '</a>' : ''
134
+ return layerHTML //return HTML for this layer
135
+ },
136
+
137
+ addnavpanel:function(setting){
138
+ var interfaceHTML=''
139
+ for (var i=0; i<3; i++){
140
+ var imgstyle='position:relative; border:0; cursor:hand; cursor:pointer; top:'+simpleGallery_navpanel.imageSpacing.offsetTop[i]+'px; margin-right:'+(i!=2? simpleGallery_navpanel.imageSpacing.spacing+'px' : 0)
141
+ var title=(i==0? 'Prev' : (i==1)? (setting.ispaused? 'Play' : 'Pause') : 'Next')
142
+ var imagesrc=(i==1)? simpleGallery_navpanel.images[(setting.ispaused)? 1 : 3] : simpleGallery_navpanel.images[i]
143
+ interfaceHTML+='<img class="navimages" title="' + title + '" src="'+ imagesrc +'" style="'+imgstyle+'" /> '
144
+ }
145
+ interfaceHTML+='<div class="gallerystatus" style="margin-top:1px">' + (setting.curimage+1) + '/' + setting.imagearray.length + '</div>'
146
+ setting.$navpanel=$('<div class="navpanellayer"></div>')
147
+ .css({position:'absolute', width:'100%', height:simpleGallery_navpanel.panel.height, left:0, top:setting.dimensions[1], font:simpleGallery_navpanel.panel.fontStyle, zIndex:'1001'})
148
+ .appendTo(setting.$wrapperdiv)
149
+ $('<div class="navpanellayerbg"></div><div class="navpanellayerfg"></div>')
150
+ .css({position:'absolute', left:0, top:0, width:'100%', height:'100%'})
151
+ .eq(0).css({background:'black', opacity:simpleGallery_navpanel.panel.opacity}) //"navpanellayerbg" div
152
+ .end().eq(1).css({paddingTop:simpleGallery_navpanel.panel.paddingTop, textAlign:'center', color:'white'}).html(interfaceHTML) //"navpanellayerfg" div
153
+ .end().appendTo(setting.$navpanel)
154
+ return setting.$navpanel.find('img.navimages, div.gallerystatus').get() ////return 4 nav buttons DIVs as DOM objects
155
+ },
156
+
157
+ getCookie:function(Name){
158
+ var re=new RegExp(Name+"=[^;]+", "i"); //construct RE to search for target name/value pair
159
+ if (document.cookie.match(re)) //if cookie found
160
+ return document.cookie.match(re)[0].split("=")[1] //return its value
161
+ return null
162
+ },
163
+
164
+ setCookie:function(name, value){
165
+ document.cookie = name+"=" + value + ";path=/"
166
+ }
167
+ }
@@ -0,0 +1,39 @@
1
+ /*! Copyright (c) 2010 Brandon Aaron (http://brandonaaron.net)
2
+ * Licensed under the MIT License (LICENSE.txt).
3
+ *
4
+ * Version 2.1.2
5
+ */
6
+
7
+ (function($){
8
+
9
+ $.fn.bgiframe = ($.browser.msie && /msie 6\.0/i.test(navigator.userAgent) ? function(s) {
10
+ s = $.extend({
11
+ top : 'auto', // auto == .currentStyle.borderTopWidth
12
+ left : 'auto', // auto == .currentStyle.borderLeftWidth
13
+ width : 'auto', // auto == offsetWidth
14
+ height : 'auto', // auto == offsetHeight
15
+ opacity : true,
16
+ src : 'javascript:false;'
17
+ }, s);
18
+ var html = '<iframe class="bgiframe"frameborder="0"tabindex="-1"src="'+s.src+'"'+
19
+ 'style="display:block;position:absolute;z-index:-1;'+
20
+ (s.opacity !== false?'filter:Alpha(Opacity=\'0\');':'')+
21
+ 'top:'+(s.top=='auto'?'expression(((parseInt(this.parentNode.currentStyle.borderTopWidth)||0)*-1)+\'px\')':prop(s.top))+';'+
22
+ 'left:'+(s.left=='auto'?'expression(((parseInt(this.parentNode.currentStyle.borderLeftWidth)||0)*-1)+\'px\')':prop(s.left))+';'+
23
+ 'width:'+(s.width=='auto'?'expression(this.parentNode.offsetWidth+\'px\')':prop(s.width))+';'+
24
+ 'height:'+(s.height=='auto'?'expression(this.parentNode.offsetHeight+\'px\')':prop(s.height))+';'+
25
+ '"/>';
26
+ return this.each(function() {
27
+ if ( $(this).children('iframe.bgiframe').length === 0 )
28
+ this.insertBefore( document.createElement(html), this.firstChild );
29
+ });
30
+ } : function() { return this; });
31
+
32
+ // old alias
33
+ $.fn.bgIframe = $.fn.bgiframe;
34
+
35
+ function prop(n) {
36
+ return n && n.constructor === Number ? n + 'px' : n;
37
+ }
38
+
39
+ })(jQuery);
@@ -0,0 +1,89 @@
1
+ /*jslint browser: true */ /*global jQuery: true */
2
+
3
+ /**
4
+ * jQuery Cookie plugin
5
+ *
6
+ * Copyright (c) 2010 Klaus Hartl (stilbuero.de)
7
+ * Dual licensed under the MIT and GPL licenses:
8
+ * http://www.opensource.org/licenses/mit-license.php
9
+ * http://www.gnu.org/licenses/gpl.html
10
+ *
11
+ */
12
+
13
+ // TODO JsDoc
14
+
15
+ /**
16
+ * Create a cookie with the given key and value and other optional parameters.
17
+ *
18
+ * @example $.cookie('the_cookie', 'the_value');
19
+ * @desc Set the value of a cookie.
20
+ * @example $.cookie('the_cookie', 'the_value', { expires: 7, path: '/', domain: 'jquery.com', secure: true });
21
+ * @desc Create a cookie with all available options.
22
+ * @example $.cookie('the_cookie', 'the_value');
23
+ * @desc Create a session cookie.
24
+ * @example $.cookie('the_cookie', null);
25
+ * @desc Delete a cookie by passing null as value. Keep in mind that you have to use the same path and domain
26
+ * used when the cookie was set.
27
+ *
28
+ * @param String key The key of the cookie.
29
+ * @param String value The value of the cookie.
30
+ * @param Object options An object literal containing key/value pairs to provide optional cookie attributes.
31
+ * @option Number|Date expires Either an integer specifying the expiration date from now on in days or a Date object.
32
+ * If a negative value is specified (e.g. a date in the past), the cookie will be deleted.
33
+ * If set to null or omitted, the cookie will be a session cookie and will not be retained
34
+ * when the the browser exits.
35
+ * @option String path The value of the path atribute of the cookie (default: path of page that created the cookie).
36
+ * @option String domain The value of the domain attribute of the cookie (default: domain of page that created the cookie).
37
+ * @option Boolean secure If true, the secure attribute of the cookie will be set and the cookie transmission will
38
+ * require a secure protocol (like HTTPS).
39
+ * @type undefined
40
+ *
41
+ * @name $.cookie
42
+ * @cat Plugins/Cookie
43
+ * @author Klaus Hartl/klaus.hartl@stilbuero.de
44
+ */
45
+
46
+ /**
47
+ * Get the value of a cookie with the given key.
48
+ *
49
+ * @example $.cookie('the_cookie');
50
+ * @desc Get the value of a cookie.
51
+ *
52
+ * @param String key The key of the cookie.
53
+ * @return The value of the cookie.
54
+ * @type String
55
+ *
56
+ * @name $.cookie
57
+ * @cat Plugins/Cookie
58
+ * @author Klaus Hartl/klaus.hartl@stilbuero.de
59
+ */
60
+ jQuery.cookie = function (key, value, options) {
61
+
62
+ // key and value given, set cookie...
63
+ if (arguments.length > 1 && (value === null || typeof value !== "object")) {
64
+ options = jQuery.extend({}, options);
65
+
66
+ if (value === null) {
67
+ options.expires = -1;
68
+ }
69
+
70
+ if (typeof options.expires === 'number') {
71
+ var days = options.expires, t = options.expires = new Date();
72
+ t.setDate(t.getDate() + days);
73
+ }
74
+
75
+ return (document.cookie = [
76
+ encodeURIComponent(key), '=',
77
+ options.raw ? String(value) : encodeURIComponent(String(value)),
78
+ options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
79
+ options.path ? '; path=' + options.path : '',
80
+ options.domain ? '; domain=' + options.domain : '',
81
+ options.secure ? '; secure' : ''
82
+ ].join(''));
83
+ }
84
+
85
+ // key and possibly options given, get cookie...
86
+ options = value || {};
87
+ var result, decode = options.raw ? function (s) { return s; } : decodeURIComponent;
88
+ return (result = new RegExp('(?:^|; )' + encodeURIComponent(key) + '=([^;]*)').exec(document.cookie)) ? decode(result[1]) : null;
89
+ };
@@ -0,0 +1,122 @@
1
+ /*
2
+ * Metadata - jQuery plugin for parsing metadata from elements
3
+ *
4
+ * Copyright (c) 2006 John Resig, Yehuda Katz, J�örn Zaefferer, Paul McLanahan
5
+ *
6
+ * Dual licensed under the MIT and GPL licenses:
7
+ * http://www.opensource.org/licenses/mit-license.php
8
+ * http://www.gnu.org/licenses/gpl.html
9
+ *
10
+ * Revision: $Id: jquery.metadata.js 4187 2007-12-16 17:15:27Z joern.zaefferer $
11
+ *
12
+ */
13
+
14
+ /**
15
+ * Sets the type of metadata to use. Metadata is encoded in JSON, and each property
16
+ * in the JSON will become a property of the element itself.
17
+ *
18
+ * There are three supported types of metadata storage:
19
+ *
20
+ * attr: Inside an attribute. The name parameter indicates *which* attribute.
21
+ *
22
+ * class: Inside the class attribute, wrapped in curly braces: { }
23
+ *
24
+ * elem: Inside a child element (e.g. a script tag). The
25
+ * name parameter indicates *which* element.
26
+ *
27
+ * The metadata for an element is loaded the first time the element is accessed via jQuery.
28
+ *
29
+ * As a result, you can define the metadata type, use $(expr) to load the metadata into the elements
30
+ * matched by expr, then redefine the metadata type and run another $(expr) for other elements.
31
+ *
32
+ * @name $.metadata.setType
33
+ *
34
+ * @example <p id="one" class="some_class {item_id: 1, item_label: 'Label'}">This is a p</p>
35
+ * @before $.metadata.setType("class")
36
+ * @after $("#one").metadata().item_id == 1; $("#one").metadata().item_label == "Label"
37
+ * @desc Reads metadata from the class attribute
38
+ *
39
+ * @example <p id="one" class="some_class" data="{item_id: 1, item_label: 'Label'}">This is a p</p>
40
+ * @before $.metadata.setType("attr", "data")
41
+ * @after $("#one").metadata().item_id == 1; $("#one").metadata().item_label == "Label"
42
+ * @desc Reads metadata from a "data" attribute
43
+ *
44
+ * @example <p id="one" class="some_class"><script>{item_id: 1, item_label: 'Label'}</script>This is a p</p>
45
+ * @before $.metadata.setType("elem", "script")
46
+ * @after $("#one").metadata().item_id == 1; $("#one").metadata().item_label == "Label"
47
+ * @desc Reads metadata from a nested script element
48
+ *
49
+ * @param String type The encoding type
50
+ * @param String name The name of the attribute to be used to get metadata (optional)
51
+ * @cat Plugins/Metadata
52
+ * @descr Sets the type of encoding to be used when loading metadata for the first time
53
+ * @type undefined
54
+ * @see metadata()
55
+ */
56
+
57
+ (function($) {
58
+
59
+ $.extend({
60
+ metadata : {
61
+ defaults : {
62
+ type: 'class',
63
+ name: 'metadata',
64
+ cre: /({.*})/,
65
+ single: 'metadata'
66
+ },
67
+ setType: function( type, name ){
68
+ this.defaults.type = type;
69
+ this.defaults.name = name;
70
+ },
71
+ get: function( elem, opts ){
72
+ var settings = $.extend({},this.defaults,opts);
73
+ // check for empty string in single property
74
+ if ( !settings.single.length ) settings.single = 'metadata';
75
+
76
+ var data = $.data(elem, settings.single);
77
+ // returned cached data if it already exists
78
+ if ( data ) return data;
79
+
80
+ data = "{}";
81
+
82
+ if ( settings.type == "class" ) {
83
+ var m = settings.cre.exec( elem.className );
84
+ if ( m )
85
+ data = m[1];
86
+ } else if ( settings.type == "elem" ) {
87
+ if( !elem.getElementsByTagName )
88
+ return undefined;
89
+ var e = elem.getElementsByTagName(settings.name);
90
+ if ( e.length )
91
+ data = $.trim(e[0].innerHTML);
92
+ } else if ( elem.getAttribute != undefined ) {
93
+ var attr = elem.getAttribute( settings.name );
94
+ if ( attr )
95
+ data = attr;
96
+ }
97
+
98
+ if ( data.indexOf( '{' ) <0 )
99
+ data = "{" + data + "}";
100
+
101
+ data = eval("(" + data + ")");
102
+
103
+ $.data( elem, settings.single, data );
104
+ return data;
105
+ }
106
+ }
107
+ });
108
+
109
+ /**
110
+ * Returns the metadata object for the first member of the jQuery object.
111
+ *
112
+ * @name metadata
113
+ * @descr Returns element's metadata object
114
+ * @param Object opts An object contianing settings to override the defaults
115
+ * @type jQuery
116
+ * @cat Plugins/Metadata
117
+ */
118
+ $.fn.metadata = function( opts ){
119
+ return $.metadata.get( this[0], opts );
120
+ };
121
+
122
+ })(jQuery);