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,178 @@
1
+ /*
2
+ * jQuery corner plugin
3
+ *
4
+ * version 1.92 (12/18/2007)
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
+
11
+ /**
12
+ * The corner() method provides a simple way of styling DOM elements.
13
+ *
14
+ * corner() takes a single string argument: $().corner("effect corners width")
15
+ *
16
+ * effect: The name of the effect to apply, such as round or bevel.
17
+ * If you don't specify an effect, rounding is used.
18
+ *
19
+ * corners: The corners can be one or more of top, bottom, tr, tl, br, or bl.
20
+ * By default, all four corners are adorned.
21
+ *
22
+ * width: The width specifies the width of the effect; in the case of rounded corners this
23
+ * will be the radius of the width.
24
+ * Specify this value using the px suffix such as 10px, and yes it must be pixels.
25
+ *
26
+ * For more details see: http://methvin.com/jquery/jq-corner.html
27
+ * For a full demo see: http://malsup.com/jquery/corner/
28
+ *
29
+ *
30
+ * @example $('.adorn').corner();
31
+ * @desc Create round, 10px corners
32
+ *
33
+ * @example $('.adorn').corner("25px");
34
+ * @desc Create round, 25px corners
35
+ *
36
+ * @example $('.adorn').corner("notch bottom");
37
+ * @desc Create notched, 10px corners on bottom only
38
+ *
39
+ * @example $('.adorn').corner("tr dog 25px");
40
+ * @desc Create dogeared, 25px corner on the top-right corner only
41
+ *
42
+ * @example $('.adorn').corner("round 8px").parent().css('padding', '4px').corner("round 10px");
43
+ * @desc Create a rounded border effect by styling both the element and its parent
44
+ *
45
+ * @name corner
46
+ * @type jQuery
47
+ * @param String options Options which control the corner style
48
+ * @cat Plugins/Corner
49
+ * @return jQuery
50
+ * @author Dave Methvin (dave.methvin@gmail.com)
51
+ * @author Mike Alsup (malsup@gmail.com)
52
+ */
53
+ (function($) {
54
+
55
+ $.fn.corner = function(o) {
56
+ var ie6 = $.browser.msie && /MSIE 6.0/.test(navigator.userAgent);
57
+ function sz(el, p) { return parseInt($.css(el,p))||0; };
58
+ function hex2(s) {
59
+ var s = parseInt(s).toString(16);
60
+ return ( s.length < 2 ) ? '0'+s : s;
61
+ };
62
+ function gpc(node) {
63
+ for ( ; node && node.nodeName.toLowerCase() != 'html'; node = node.parentNode ) {
64
+ var v = $.css(node,'backgroundColor');
65
+ if ( v.indexOf('rgb') >= 0 ) {
66
+ if ($.browser.safari && v == 'rgba(0, 0, 0, 0)')
67
+ continue;
68
+ var rgb = v.match(/\d+/g);
69
+ return '#'+ hex2(rgb[0]) + hex2(rgb[1]) + hex2(rgb[2]);
70
+ }
71
+ if ( v && v != 'transparent' )
72
+ return v;
73
+ }
74
+ return '#ffffff';
75
+ };
76
+ function getW(i) {
77
+ switch(fx) {
78
+ case 'round': return Math.round(width*(1-Math.cos(Math.asin(i/width))));
79
+ case 'cool': return Math.round(width*(1+Math.cos(Math.asin(i/width))));
80
+ case 'sharp': return Math.round(width*(1-Math.cos(Math.acos(i/width))));
81
+ case 'bite': return Math.round(width*(Math.cos(Math.asin((width-i-1)/width))));
82
+ case 'slide': return Math.round(width*(Math.atan2(i,width/i)));
83
+ case 'jut': return Math.round(width*(Math.atan2(width,(width-i-1))));
84
+ case 'curl': return Math.round(width*(Math.atan(i)));
85
+ case 'tear': return Math.round(width*(Math.cos(i)));
86
+ case 'wicked': return Math.round(width*(Math.tan(i)));
87
+ case 'long': return Math.round(width*(Math.sqrt(i)));
88
+ case 'sculpt': return Math.round(width*(Math.log((width-i-1),width)));
89
+ case 'dog': return (i&1) ? (i+1) : width;
90
+ case 'dog2': return (i&2) ? (i+1) : width;
91
+ case 'dog3': return (i&3) ? (i+1) : width;
92
+ case 'fray': return (i%2)*width;
93
+ case 'notch': return width;
94
+ case 'bevel': return i+1;
95
+ }
96
+ };
97
+ o = (o||"").toLowerCase();
98
+ var keep = /keep/.test(o); // keep borders?
99
+ var cc = ((o.match(/cc:(#[0-9a-f]+)/)||[])[1]); // corner color
100
+ var sc = ((o.match(/sc:(#[0-9a-f]+)/)||[])[1]); // strip color
101
+ var width = parseInt((o.match(/(\d+)px/)||[])[1]) || 10; // corner width
102
+ var re = /round|bevel|notch|bite|cool|sharp|slide|jut|curl|tear|fray|wicked|sculpt|long|dog3|dog2|dog/;
103
+ var fx = ((o.match(re)||['round'])[0]);
104
+ var edges = { T:0, B:1 };
105
+ var opts = {
106
+ TL: /top|tl/.test(o), TR: /top|tr/.test(o),
107
+ BL: /bottom|bl/.test(o), BR: /bottom|br/.test(o)
108
+ };
109
+ if ( !opts.TL && !opts.TR && !opts.BL && !opts.BR )
110
+ opts = { TL:1, TR:1, BL:1, BR:1 };
111
+ var strip = document.createElement('div');
112
+ strip.style.overflow = 'hidden';
113
+ strip.style.height = '1px';
114
+ strip.style.backgroundColor = sc || 'transparent';
115
+ strip.style.borderStyle = 'solid';
116
+ return this.each(function(index){
117
+ var pad = {
118
+ T: parseInt($.css(this,'paddingTop'))||0, R: parseInt($.css(this,'paddingRight'))||0,
119
+ B: parseInt($.css(this,'paddingBottom'))||0, L: parseInt($.css(this,'paddingLeft'))||0
120
+ };
121
+
122
+ if ($.browser.msie) this.style.zoom = 1; // force 'hasLayout' in IE
123
+ if (!keep) this.style.border = 'none';
124
+ strip.style.borderColor = cc || gpc(this.parentNode);
125
+ var cssHeight = $.curCSS(this, 'height');
126
+
127
+ for (var j in edges) {
128
+ var bot = edges[j];
129
+ // only add stips if needed
130
+ if ((bot && (opts.BL || opts.BR)) || (!bot && (opts.TL || opts.TR))) {
131
+ strip.style.borderStyle = 'none '+(opts[j+'R']?'solid':'none')+' none '+(opts[j+'L']?'solid':'none');
132
+ var d = document.createElement('div');
133
+ $(d).addClass('jquery-corner');
134
+ var ds = d.style;
135
+
136
+ bot ? this.appendChild(d) : this.insertBefore(d, this.firstChild);
137
+
138
+ if (bot && cssHeight != 'auto') {
139
+ if ($.css(this,'position') == 'static')
140
+ this.style.position = 'relative';
141
+ ds.position = 'absolute';
142
+ ds.bottom = ds.left = ds.padding = ds.margin = '0';
143
+ if ($.browser.msie)
144
+ ds.setExpression('width', 'this.parentNode.offsetWidth');
145
+ else
146
+ ds.width = '100%';
147
+ }
148
+ else if (!bot && $.browser.msie) {
149
+ if ($.css(this,'position') == 'static')
150
+ this.style.position = 'relative';
151
+ ds.position = 'absolute';
152
+ ds.top = ds.left = ds.right = ds.padding = ds.margin = '0';
153
+
154
+ // fix ie6 problem when blocked element has a border width
155
+ var bw = 0;
156
+ if (ie6 || !$.boxModel)
157
+ bw = sz(this,'borderLeftWidth') + sz(this,'borderRightWidth');
158
+ ie6 ? ds.setExpression('width', 'this.parentNode.offsetWidth - '+bw+'+ "px"') : ds.width = '100%';
159
+ }
160
+ else {
161
+ ds.margin = !bot ? '-'+pad.T+'px -'+pad.R+'px '+(pad.T-width)+'px -'+pad.L+'px' :
162
+ (pad.B-width)+'px -'+pad.R+'px -'+pad.B+'px -'+pad.L+'px';
163
+ }
164
+
165
+ for (var i=0; i < width; i++) {
166
+ var w = Math.max(0,getW(i));
167
+ var e = strip.cloneNode(false);
168
+ e.style.borderWidth = '0 '+(opts[j+'R']?w:0)+'px 0 '+(opts[j+'L']?w:0)+'px';
169
+ bot ? d.appendChild(e) : d.insertBefore(e, d.firstChild);
170
+ }
171
+ }
172
+ }
173
+ });
174
+ };
175
+
176
+ $.fn.uncorner = function(o) { return $('.jquery-corner', this).remove(); };
177
+
178
+ })(jQuery);
@@ -0,0 +1,503 @@
1
+ /*(You must include this commment)
2
+ * Round Corners jQuery Plugin version - 1.0.1
3
+ * written by Avinoam Henig
4
+ * special thanks to Dan Blaisdell for help and mentoring (http://manifestwebdesign.com/)
5
+ *
6
+ * for more information go to:
7
+ * roundCorners.avinoam.info
8
+ * or email me at: contact@avinoam.info
9
+ *
10
+ * Dual licensed under the MIT and GPL licenses:
11
+ * http://www.opensource.org/licenses/mit-license.php
12
+ * http://www.gnu.org/licenses/gpl.html
13
+ *
14
+ * Needed files:
15
+ * jQuery 1.3 Core Javascirpt File
16
+ * Explorer Canvas Release 2 Javascript File
17
+ */
18
+ (function($){
19
+ var emFuncs = new Array();
20
+ $.fn.fontchange = function(func){
21
+ emFuncs[emFuncs.length] = func;
22
+ return this;
23
+ };
24
+ function checkEM(){
25
+ var nLeft = $emEL.offset().left;
26
+ if(nLeft!=oLeft){
27
+ for(var func in emFuncs) emFuncs[func]();
28
+ }
29
+ oLeft = nLeft;
30
+ };
31
+ $(window).bind('load', function(){
32
+ emFuncs = [];
33
+ $emEL = $('<div></div>').css({
34
+ 'position' : 'absolute',
35
+ 'left' : '-100em',
36
+ 'width' : '0px',
37
+ 'height' : '0px',
38
+ 'background' : 'none',
39
+ 'border:' : 'none',
40
+ 'padding' : '0px',
41
+ 'margin' : '0px'
42
+ }).prependTo('body');
43
+ oLeft = $emEL.offset().left;
44
+ $(window).keyup(function(){
45
+ checkEM();
46
+ });
47
+ });
48
+ $.fn._html = $.fn.html;
49
+ $.fn.html = function(val){
50
+ $(this).each(function(){
51
+ if(this.canvas) $('span.inner', this)._html(val);
52
+ else $(this)._html(val);
53
+ });
54
+ return this;
55
+ };
56
+ $.fn._offset = $.fn.offset;
57
+ $.fn.offset = function(newXY){
58
+ return newXY ? this.setXY(newXY) : this._offset();
59
+ };
60
+ $.fn.setXY = function(newXY){
61
+ $(this).each(function(){
62
+ var el = this;
63
+ var hide = false;
64
+ if($(el).css('display')=='none'){
65
+ hide = true;
66
+ $(el).show();
67
+ };
68
+ var style_pos = $(el).css('position');
69
+ if (style_pos == 'static') {
70
+ $(el).css('position','relative');
71
+ style_pos = 'relative';
72
+ };
73
+ var pageXY = $(el).offset();
74
+ if(pageXY){
75
+ var delta = {
76
+ left : parseInt($(el).css('left')),
77
+ top : parseInt($(el).css('top'))
78
+ };
79
+ if (isNaN(delta.left)) delta.left = (style_pos == 'relative') ? 0 : el.offsetLeft;
80
+ if (isNaN(delta.top)) delta.top = (style_pos == 'relative') ? 0 : el.offsetTop;
81
+ if (newXY.left || newXY.left===0) $(el).css('left',newXY.left - pageXY.left + delta.left + 'px');
82
+ if (newXY.top || newXY.top===0) $(el).css('top',newXY.top - pageXY.top + delta.top + 'px');
83
+ };
84
+ if(hide) $(el).show();
85
+ });
86
+ return this;
87
+ };
88
+ $.fn._css = $.fn.css;
89
+ $.fn.css = function(one, two){
90
+ var el = this;
91
+ var theResult = el;
92
+ if(arguments.length==1 && typeof one=='string'){
93
+ var type, style, result = false;
94
+ if(one.search(':')!=-1){
95
+ type = one.split(':')[0].replace(' ', '');
96
+ style = one.split(':')[1].replace(' ', '');
97
+ } else{
98
+ theResult = el._css(one, two);
99
+ };
100
+ if(type && style){
101
+ var styleSplits = style.split('-');
102
+ style = styleSplits[0];
103
+ for(var s=1; s<styleSplits.length; s++){
104
+ style += styleSplits[s].substring(0, 1).toUpperCase();
105
+ style += styleSplits[s].substring(1, styleSplits[s].length);
106
+ };
107
+ var rules = el.getCSSRules(':'+type);
108
+ result = el._css(style);
109
+ if(type=='active'){
110
+ var hoverRules = el.getCSSRules(':hover');
111
+ for(var hr=0; hr<hoverRules.length; hr++){
112
+ if(hoverRules[hr].style[style]) result = hoverRules[hr].style[style];
113
+ }
114
+ }
115
+ if(result) for(var r=0; r<rules.length; r++) if(rules[r].style[style]) result = rules[r].style[style];
116
+ theResult = result;
117
+ } else theResult = el._css(one, two);
118
+ } else theResult = this._css(one, two);
119
+ return theResult;
120
+ };
121
+ $.fn.getCSSRules = function(type){
122
+ var el = this;
123
+ var elRules = new Array();
124
+ if(type==null) type = '';
125
+ for(var ss = 0; ss<document.styleSheets.length; ss++){
126
+ if($.browser.msie) var rules = document.styleSheets[ss].rules;
127
+ else var rules = document.styleSheets[ss].cssRules;
128
+ for(var r=0; r<rules.length; r++){
129
+ if(!rules[r].selectorText || rules[r].selectorText.search(type)==-1) continue;
130
+ var sel = rules[r].selectorText.replace(':hover', '').replace(':active', '').replace(':focus', '');
131
+ if ($(sel)) {
132
+ $(sel).each(function(){
133
+ if ($(this)[0] == $(el)[0]) {
134
+ elRules[elRules.length] = rules[r];
135
+ };
136
+ });
137
+ };
138
+ };
139
+ };
140
+ return elRules;
141
+ };
142
+ $.fn.canvas = function(){
143
+ $(this).each(function(){
144
+ var el = this;
145
+ if (el.canvas) return;
146
+ var hide = false;
147
+ if($(el).css('display')=='none'){
148
+ hide = true;
149
+ $(el).show();
150
+ };
151
+ var close = false;
152
+ var funcName = 'insertBefore';
153
+ if(el.tagName=='INPUT' || el.tagName=='TEXTAREA' || el.tagName=='IMG') close = true;
154
+ if($.browser.opera) var tagDisplay = 'block';
155
+ else var tagDisplay = 'inline';
156
+ if(!close){
157
+ $(el).wrapInner('<span style="display: '+tagDisplay+';position: relative; z-index: 1; background: none; border: none; margin: 0px; padding: 0px;" class="inner" />')
158
+ .css('display', $(el).css('display'));
159
+ if($.browser.safari) $('span.inner', el).children().css('position', 'relative');
160
+ if($.browser.msie) funcName = 'appendTo';
161
+ else funcName = 'prependTo';
162
+ };
163
+ var canvas = $('<canvas></canvas>')[funcName](el).attr({
164
+ 'width': $(el).outerWidth(),
165
+ 'height': $(el).outerHeight()
166
+ }).css({
167
+ 'position' : 'absolute',
168
+ 'background' : 'none',
169
+ 'border' : 'none',
170
+ 'padding' : '0px'
171
+ }).offset($(el).offset());
172
+ if(close) $(el).css('position', 'relative');
173
+ el.canvas = canvas[0];
174
+ if ($.browser.msie) el.canvas = G_vmlCanvasManager.initElement(el.canvas);
175
+ el.canvas.ctx = el.canvas.getContext('2d');
176
+ el.canvas.roundCornersEvent = false;
177
+ el.canvas.ctx.roundRect = function(width, height, x, y , tl, tr, bl, br){
178
+ this.beginPath();
179
+ if(tl>0) this.moveTo(tl + x, y);
180
+ else this.moveTo(x, y);
181
+ if(tl>0) this.quadraticCurveTo(x, y, x, tl + y);
182
+ if(bl>0) this.lineTo(x, (height + y) - bl);
183
+ else this.lineTo(x, height + y);
184
+ if(bl>0) this.quadraticCurveTo(x, height + y, bl + x, height + y);
185
+ if(br>0) this.lineTo((width + x) - br, height + y);
186
+ else this.lineTo(width + x, height + y);
187
+ if(br>0) this.quadraticCurveTo(width + x, height + y, width + x, (height + y) - br);
188
+ if(tr>0) this.lineTo(width + x, tr + y);
189
+ else this.lineTo(width + x, y);
190
+ if(tr>0) this.quadraticCurveTo(width + x, y, width + x - tr, y);
191
+ if(tl>0) this.lineTo(tl, y);
192
+ else this.lineTo(x, y);
193
+ };
194
+ el.focused = false;
195
+ el.styles = {
196
+ bgColor : $(el).css('background-color'),
197
+ radius : [0, 0, 0, 0],
198
+ border : {
199
+ top : {
200
+ width : parseInt($(el).css('border-top-width')),
201
+ color : $(el).css('border-top-color')
202
+ },
203
+ left : {
204
+ width : parseInt($(el).css('border-left-width')),
205
+ color : $(el).css('border-left-color')
206
+ },
207
+ bottom : {
208
+
209
+ width : parseInt($(el).css('border-bottom-width')),
210
+ color : $(el).css('border-bottom-color')
211
+ },
212
+ right : {
213
+ width : parseInt($(el).css('border-right-width')),
214
+ color : $(el).css('border-right-color')
215
+ }
216
+ },
217
+ hover : {
218
+ bgColor: $(el).css('hover:background-color'),
219
+ border : {
220
+ top : {
221
+ width : parseInt($(el).css('hover:border-top-width')),
222
+ color : $(el).css('hover:border-top-color')
223
+ },
224
+ left : {
225
+ width : parseInt($(el).css('hover:border-left-width')),
226
+ color : $(el).css('hover:border-left-color')
227
+ },
228
+ bottom : {
229
+ width : parseInt($(el).css('hover:border-bottom-width')),
230
+ color : $(el).css('hover:border-bottom-color')
231
+ },
232
+ right : {
233
+ width : parseInt($(el).css('hover:border-right-width')),
234
+ color : $(el).css('hover:border-right-color')
235
+ }
236
+ }
237
+ },
238
+ active : {
239
+ bgColor: $(el).css('active:background-color'),
240
+ border : {
241
+ top : {
242
+ width : parseInt($(el).css('active:border-top-width')),
243
+ color : $(el).css('active:border-top-color')
244
+ },
245
+ left : {
246
+ width : parseInt($(el).css('active:border-left-width')),
247
+ color : $(el).css('active:border-left-color')
248
+ },
249
+ bottom : {
250
+ width : parseInt($(el).css('active:border-bottom-width')),
251
+ color : $(el).css('active:border-bottom-color')
252
+ },
253
+ right : {
254
+ width : parseInt($(el).css('active:border-right-width')),
255
+ color : $(el).css('active:border-right-color')
256
+ }
257
+ }
258
+ },
259
+ focus : {
260
+ bgColor: $(el).css('focus:background-color'),
261
+ opacity : $(el).css('opacity'),
262
+ border : {
263
+ top : {
264
+ width : parseInt($(el).css('focus:border-top-width')),
265
+ color : $(el).css('focus:border-top-color')
266
+ },
267
+ left : {
268
+ width : parseInt($(el).css('focus:border-left-width')),
269
+ color : $(el).css('focus:border-left-color')
270
+ },
271
+ bottom : {
272
+ width : parseInt($(el).css('focus:border-bottom-width')),
273
+ color : $(el).css('focus:border-bottom-color')
274
+ },
275
+ right : {
276
+ width : parseInt($(el).css('focus:border-right-width')),
277
+ color : $(el).css('focus:border-right-color')
278
+ }
279
+ }
280
+ }
281
+ };
282
+ if(hide) $(el).hide();
283
+ });
284
+ return this;
285
+ };
286
+ $.fn.getCanvas = function(){
287
+ var el = this;
288
+ $(el).canvas();
289
+ var cvs = $(el)[0].canvas;
290
+ if ($.browser.msie) {
291
+ $(cvs).children().css({
292
+ 'position': 'relative',
293
+ 'background': 'none',
294
+ 'border': 'none',
295
+ 'padding': '0px',
296
+ 'margin': '0px',
297
+ 'left': '0px',
298
+ 'top': '0px'
299
+ });
300
+ };
301
+ return cvs;
302
+ };
303
+ $.fn.draw = function(specialStyle){
304
+ $(this).each(function(){
305
+ var el = this;
306
+ var hide = false;
307
+ if($(el).css('display')=='none'){
308
+ hide = true;
309
+ $(el).show();
310
+ };
311
+ var canvas = $(el).getCanvas(tl, tr, br, bl, width, height);
312
+ var tl = el.styles.radius[0];
313
+ var tr = el.styles.radius[1];
314
+ var br = el.styles.radius[2];
315
+ var bl = el.styles.radius[3];
316
+ var border, bgColor;
317
+ switch(specialStyle){
318
+ case 'hover':
319
+ border = el.styles.hover.border;
320
+ bgColor = el.styles.hover.bgColor;
321
+ break;
322
+ case 'active':
323
+ border = el.styles.active.border;
324
+ bgColor = el.styles.active.bgColor;
325
+ break;
326
+ case 'focus':
327
+ border = el.styles.focus.border;
328
+ bgColor = el.styles.focus.bgColor;
329
+ break;
330
+ default:
331
+ border = el.styles.border;
332
+ bgColor = el.styles.bgColor;
333
+ };
334
+ var width = $(el).outerWidth();
335
+ var height = $(el).outerHeight();
336
+ $(canvas).attr({
337
+ 'width' : width,
338
+ 'height' : height
339
+ }).offset($(el).offset());
340
+ var ctx = canvas.ctx;
341
+ if(canvas.oldWidth && canvas.oldHeight) ctx.clearRect(0, 0, canvas.oldWidth, canvas.oldHeight);
342
+ canvas.oldWidth = width;
343
+ canvas.oldHeight = height;
344
+ var bWidth = border.top.width;
345
+ if(border.right.width>bWidth) bWidth = border.right.width;
346
+ if(border.bottom.width>bWidth) bWidth = border.bottom.width;
347
+ if(border.left.width>bWidth) bWidth = border.left.width;
348
+ if (bWidth > 0) {
349
+ ctx.roundRect(width, height, 0, 0, tl, tr, bl, br);
350
+ ctx.fillStyle = border.top.color;
351
+ ctx.fill();
352
+ if(bWidth>tl && bWidth>tr && bWidth>br && bWidth>bl){
353
+ ctx.roundRect(width - (border.right.width+border.left.width),
354
+ height - (border.bottom.width+border.top.width), border.left.width, border.top.width,
355
+ 0, 0, 0, 0);
356
+ } else{
357
+ ctx.roundRect(width - (border.right.width+border.left.width),
358
+ height - (border.bottom.width+border.top.width), border.left.width, border.top.width,
359
+ tl - border.left.width, tr - border.right.width, bl - border.left.width, br - border.right.width);
360
+ };
361
+ if(bgColor=='rgba(0, 0, 0, 0)' || bgColor=='transparent'){
362
+ var parBgColor = '#ffffff';
363
+ $(el).parents().each(function(){
364
+ if($(this).css('background-color')!='rgba(0, 0, 0, 0)' && $(this).css('background-color')!='transparent'){
365
+ parBgColor = $(this).css('background-color');
366
+ return false;
367
+ };
368
+ });
369
+ ctx.fillStyle = parBgColor;
370
+ } else{
371
+ ctx.fillStyle = bgColor;
372
+ };
373
+ } else{
374
+ ctx.roundRect(width,
375
+ height, 0, 0, tl, tr, bl, br);
376
+ ctx.fillStyle = bgColor;
377
+ };
378
+ ctx.fill();
379
+ $(el).css({
380
+ 'background' : 'none',
381
+ 'border-color' : 'transparent'
382
+ });
383
+ if($.browser.msie && parseInt($.browser.version)==6){
384
+ $(el).css({
385
+ 'padding-top' : parseInt($(el).css('padding-top')+border.top.width)+'px',
386
+ 'padding-left' : parseInt($(el).css('padding-left')+border.left.width)+'px',
387
+ 'border' : 'none'
388
+ });
389
+ };
390
+ if(hide) $(el).hide();
391
+ });
392
+ return this;
393
+ };
394
+ function getGradient(ctx, colors, height){
395
+ var grad = ctx.createLinearGradient(0, 0, 0, height);
396
+ var g = 0;
397
+ for(var i=0; i<colors.length; i+=1/(colors.length-1)){
398
+ grad.addColorStop(i, colors[g]);
399
+ g++;
400
+ };
401
+ return grad;
402
+ };
403
+ $.fn.bg = function(radius, gradient, specialStyle){
404
+ $(this).each(function(){
405
+ var el = this;
406
+ var $el = $(this);
407
+ if(typeof($el.attr('radius'))!='undefined') alert('hi');
408
+ if(typeof($el.attr('gradient'))!='undefined') gradient = eval($el.attr('gradient'));
409
+ $el.canvas();
410
+ el.canvas.args = {
411
+ radius: radius,
412
+ gradient: gradient
413
+ };
414
+ if(gradient){
415
+ if(typeof gradient[0]=='object'){
416
+ var colors = gradient[0];
417
+ if(gradient[1]){
418
+ if (gradient[1].length>0) var colorsHover = gradient[1];
419
+ else colorsHover = colors;
420
+ };
421
+ if(gradient[2]){
422
+ if (gradient[2].length>0) var colorsClick = gradient[2];
423
+ else{
424
+ if(colorsHover) var colorsClick = colorsHover;
425
+ else var colorsClick = colors;
426
+ };
427
+ };
428
+ if(gradient[3]){
429
+ if (gradient[3].length>0) var colorsFocus = gradient[3];
430
+ else{
431
+ var colorsFocus = colors;
432
+ };
433
+ };
434
+ } else{
435
+ var colors = gradient;
436
+ var colorsHover = gradient;
437
+ var colorsClick = gradient;
438
+ var colorsFocus = gradient;
439
+ };
440
+ if(colors) el.styles.bgColor = getGradient(el.canvas.ctx, colors, $el.outerHeight());
441
+ if(colorsHover) el.styles.hover.bgColor = getGradient(el.canvas.ctx, colorsHover, $el.outerHeight());
442
+ if(colorsClick) el.styles.active.bgColor = getGradient(el.canvas.ctx, colorsClick, $el.outerHeight());
443
+ if(colorsFocus) el.styles.focus.bgColor = getGradient(el.canvas.ctx, colorsFocus, $el.outerHeight());
444
+ };
445
+ if(radius){
446
+ if(typeof radius != 'object') radius = [radius, radius, radius, radius];
447
+ } else{
448
+ radius = [0, 0, 0, 0];
449
+ };
450
+ if(radius[0]==null){
451
+ radius[0] = 14;
452
+ };
453
+ for(var i=0; i<4; i++){
454
+ if(radius[i]==null){
455
+ radius[i] = radius[0];
456
+ };
457
+ if(typeof radius[i] == 'string'){
458
+ if (radius[i].search('em')!=-1) {
459
+ radius[i] = parseFloat(radius[i]);
460
+ radius[i] = radius[i] * 14;
461
+ };
462
+ radius[i] = parseInt(radius[i]);
463
+ };
464
+ };
465
+ el.styles.radius = radius;
466
+ var canvas = el.canvas;
467
+ if (!canvas.roundCornersEvent) {
468
+ canvas.roundCornersEvent = true;
469
+ $(window).resize(function(){
470
+ $(el).bg(radius, gradient);
471
+ });
472
+ $(el).hover(function(){
473
+ if(!el.focused) $(el).bg(radius, gradient, 'hover');
474
+ }, function(){
475
+ if(!el.focused) $(el).bg(radius, gradient);
476
+ });
477
+ $(el).mousedown(function(){
478
+ if(!el.focused) $(el).bg(radius, gradient, 'active');
479
+ });
480
+ $(el).mouseup(function(){
481
+ if(!el.focused) $(el).bg(radius, gradient, 'hover');
482
+ });
483
+ $(el).focus(function(){
484
+ el.focused = true;
485
+ $(el).bg(radius, gradient, 'focus');
486
+ });
487
+ $(el).blur(function(){
488
+ el.focused = false;
489
+ $(el).bg(radius, gradient);
490
+ });
491
+ emFuncs[emFuncs.length] = function(){
492
+ if(!el.focused) $(el).bg(radius, gradient);
493
+ else $(el).bg(radius, gradient, 'focus');
494
+ };
495
+ };
496
+ $(el).draw(specialStyle);
497
+ });
498
+ return this;
499
+ };
500
+ $.fn.roundCorners = function(tl, tr, br, bl){
501
+ return $(this).bg([tl, tr, br, bl]);
502
+ };
503
+ })(jQuery);