atreides 2.0.3 → 2.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (163) hide show
  1. data/LICENSE +1 -1
  2. data/app/assets/javascripts/atreides/admin_base.js.erb +11 -16
  3. data/app/assets/stylesheets/atreides/admin_base.css.erb +2 -3
  4. data/app/controllers/atreides/admin_controller.rb +14 -0
  5. data/app/models/atreides/{preferences.rb → preference.rb} +1 -1
  6. data/app/views/admin/atreides/common/_sidebar_publish.html.haml +16 -0
  7. data/app/views/admin/atreides/features/_form.html.haml +11 -18
  8. data/app/views/admin/atreides/pages/_form.html.haml +1 -4
  9. data/app/views/admin/atreides/posts/_form_sidebar.html.haml +1 -8
  10. data/app/views/admin/common/_list_table.html.haml +30 -0
  11. data/app/views/admin/common/_list_table_row.html.haml +11 -0
  12. data/app/views/admin/common/_pagination.html.haml +1 -0
  13. data/app/views/admin/common/_search_form.html.haml +4 -0
  14. data/lib/assets/flash/atreides/player.swf +0 -0
  15. data/lib/assets/flash/atreides/slideshowpro.swf +0 -0
  16. data/lib/assets/flash/atreides/swfupload.swf +0 -0
  17. data/lib/assets/images/atreides/share/aim_16.png +0 -0
  18. data/lib/assets/images/atreides/share/apple_16.png +0 -0
  19. data/lib/assets/images/atreides/share/bebo_16.png +0 -0
  20. data/lib/assets/images/atreides/share/blogger_16.png +0 -0
  21. data/lib/assets/images/atreides/share/brightkite_16.png +0 -0
  22. data/lib/assets/images/atreides/share/cargo_16.png +0 -0
  23. data/lib/assets/images/atreides/share/delicious_16.png +0 -0
  24. data/lib/assets/images/atreides/share/designfloat_16.png +0 -0
  25. data/lib/assets/images/atreides/share/designmoo_16.png +0 -0
  26. data/lib/assets/images/atreides/share/deviantart_16.png +0 -0
  27. data/lib/assets/images/atreides/share/digg_16.png +0 -0
  28. data/lib/assets/images/atreides/share/digg_alt_16.png +0 -0
  29. data/lib/assets/images/atreides/share/dopplr_16.png +0 -0
  30. data/lib/assets/images/atreides/share/dribbble_16.png +0 -0
  31. data/lib/assets/images/atreides/share/email_16.png +0 -0
  32. data/lib/assets/images/atreides/share/ember_16.png +0 -0
  33. data/lib/assets/images/atreides/share/evernote_16.png +0 -0
  34. data/lib/assets/images/atreides/share/facebook_16.png +0 -0
  35. data/lib/assets/images/atreides/share/flickr_16.png +0 -0
  36. data/lib/assets/images/atreides/share/friendfeed_16.png +0 -0
  37. data/lib/assets/images/atreides/share/gamespot_16.png +0 -0
  38. data/lib/assets/images/atreides/share/google_16.png +0 -0
  39. data/lib/assets/images/atreides/share/google_voice_16.png +0 -0
  40. data/lib/assets/images/atreides/share/google_wave_16.png +0 -0
  41. data/lib/assets/images/atreides/share/googletalk_16.png +0 -0
  42. data/lib/assets/images/atreides/share/gowalla_16.png +0 -0
  43. data/lib/assets/images/atreides/share/grooveshark_16.png +0 -0
  44. data/lib/assets/images/atreides/share/ilike_16.png +0 -0
  45. data/lib/assets/images/atreides/share/komodomedia_azure_16.png +0 -0
  46. data/lib/assets/images/atreides/share/komodomedia_wood_16.png +0 -0
  47. data/lib/assets/images/atreides/share/lastfm_16.png +0 -0
  48. data/lib/assets/images/atreides/share/license.txt +9 -0
  49. data/lib/assets/images/atreides/share/linkedin_16.png +0 -0
  50. data/lib/assets/images/atreides/share/mixx_16.png +0 -0
  51. data/lib/assets/images/atreides/share/mobileme_16.png +0 -0
  52. data/lib/assets/images/atreides/share/mynameise_16.png +0 -0
  53. data/lib/assets/images/atreides/share/myspace_16.png +0 -0
  54. data/lib/assets/images/atreides/share/netvibes_16.png +0 -0
  55. data/lib/assets/images/atreides/share/newsvine_16.png +0 -0
  56. data/lib/assets/images/atreides/share/openid_16.png +0 -0
  57. data/lib/assets/images/atreides/share/orkut_16.png +0 -0
  58. data/lib/assets/images/atreides/share/pandora_16.png +0 -0
  59. data/lib/assets/images/atreides/share/paypal_16.png +0 -0
  60. data/lib/assets/images/atreides/share/picasa_16.png +0 -0
  61. data/lib/assets/images/atreides/share/plurk_16.png +0 -0
  62. data/lib/assets/images/atreides/share/posterous_16.png +0 -0
  63. data/lib/assets/images/atreides/share/qik_16.png +0 -0
  64. data/lib/assets/images/atreides/share/readernaut_16.png +0 -0
  65. data/lib/assets/images/atreides/share/reddit_16.png +0 -0
  66. data/lib/assets/images/atreides/share/roboto_16.png +0 -0
  67. data/lib/assets/images/atreides/share/rss_16.png +0 -0
  68. data/lib/assets/images/atreides/share/sharethis_16.png +0 -0
  69. data/lib/assets/images/atreides/share/skype_16.png +0 -0
  70. data/lib/assets/images/atreides/share/stumbleupon_16.png +0 -0
  71. data/lib/assets/images/atreides/share/technorati_16.png +0 -0
  72. data/lib/assets/images/atreides/share/tumblr_16.png +0 -0
  73. data/lib/assets/images/atreides/share/twitter_16.png +0 -0
  74. data/lib/assets/images/atreides/share/viddler_16.png +0 -0
  75. data/lib/assets/images/atreides/share/vimeo_16.png +0 -0
  76. data/lib/assets/images/atreides/share/virb_16.png +0 -0
  77. data/lib/assets/images/atreides/share/windows_16.png +0 -0
  78. data/lib/assets/images/atreides/share/wordpress_16.png +0 -0
  79. data/lib/assets/images/atreides/share/xing_16.png +0 -0
  80. data/lib/assets/images/atreides/share/yahoo_16.png +0 -0
  81. data/lib/assets/images/atreides/share/yahoobuzz_16.png +0 -0
  82. data/lib/assets/images/atreides/share/yelp_16.png +0 -0
  83. data/lib/assets/images/atreides/share/youtube_16.png +0 -0
  84. data/lib/assets/javascripts/atreides/facebox.js +309 -0
  85. data/lib/assets/javascripts/atreides/fileuploader.js +1250 -0
  86. data/lib/assets/javascripts/atreides/galleria.js +2 -0
  87. data/lib/assets/javascripts/atreides/galleria/src/galleria.js +3816 -0
  88. data/lib/assets/javascripts/atreides/galleria/src/plugins/galleria.flickr.js +221 -0
  89. data/lib/assets/javascripts/atreides/galleria/src/plugins/galleria.history.js +602 -0
  90. data/lib/assets/javascripts/atreides/galleria/src/themes/classic/classic-loader.gif +0 -0
  91. data/lib/assets/javascripts/atreides/galleria/src/themes/classic/classic-map.png +0 -0
  92. data/lib/assets/javascripts/atreides/galleria/src/themes/classic/galleria.classic.css +202 -0
  93. data/lib/assets/javascripts/atreides/galleria/src/themes/classic/galleria.classic.js +92 -0
  94. data/lib/assets/javascripts/atreides/galleria/src/themes/fullscreen/b.png +0 -0
  95. data/lib/assets/javascripts/atreides/galleria/src/themes/fullscreen/down.gif +0 -0
  96. data/lib/assets/javascripts/atreides/galleria/src/themes/fullscreen/fix.gif +0 -0
  97. data/lib/assets/javascripts/atreides/galleria/src/themes/fullscreen/fullscreen-demo.html +34 -0
  98. data/lib/assets/javascripts/atreides/galleria/src/themes/fullscreen/galleria.fullscreen.css +46 -0
  99. data/lib/assets/javascripts/atreides/galleria/src/themes/fullscreen/galleria.fullscreen.js +193 -0
  100. data/lib/assets/javascripts/atreides/galleria/src/themes/fullscreen/i.png +0 -0
  101. data/lib/assets/javascripts/atreides/galleria/src/themes/fullscreen/l.gif +0 -0
  102. data/lib/assets/javascripts/atreides/galleria/src/themes/fullscreen/l2.png +0 -0
  103. data/lib/assets/javascripts/atreides/galleria/src/themes/fullscreen/loader.gif +0 -0
  104. data/lib/assets/javascripts/atreides/galleria/src/themes/fullscreen/n.gif +0 -0
  105. data/lib/assets/javascripts/atreides/galleria/src/themes/fullscreen/p.gif +0 -0
  106. data/lib/assets/javascripts/atreides/galleria/src/themes/fullscreen/r.gif +0 -0
  107. data/lib/assets/javascripts/atreides/galleria/src/themes/fullscreen/r2.png +0 -0
  108. data/lib/assets/javascripts/atreides/galleria/src/themes/fullscreen/up.gif +0 -0
  109. data/lib/assets/javascripts/atreides/jquery.autogrow.js +132 -0
  110. data/lib/assets/javascripts/atreides/jquery.cookie.js +96 -0
  111. data/lib/assets/javascripts/atreides/jquery.countdown.js +759 -0
  112. data/lib/assets/javascripts/atreides/jquery.cycle.js +918 -0
  113. data/lib/assets/javascripts/atreides/jquery.easing.1.3.js +205 -0
  114. data/lib/assets/javascripts/atreides/jquery.flash.js +288 -0
  115. data/lib/assets/javascripts/atreides/jquery.iphone-checkboxes.js +214 -0
  116. data/lib/assets/javascripts/atreides/jquery.jBreadCrumb.1.1.js +240 -0
  117. data/lib/assets/javascripts/atreides/jquery.multipleselectbox-min.js +15 -0
  118. data/lib/assets/javascripts/atreides/jquery.multipleselectbox.js +446 -0
  119. data/lib/assets/javascripts/atreides/jquery.swfupload.js +64 -0
  120. data/lib/assets/javascripts/atreides/jquery.tipsy.js +104 -0
  121. data/lib/assets/javascripts/atreides/jquery.uniform.js +461 -0
  122. data/lib/assets/javascripts/atreides/jtags.js +125 -0
  123. data/lib/assets/javascripts/atreides/raphael-min.js +7 -0
  124. data/lib/assets/javascripts/atreides/raphael.analytics.js +205 -0
  125. data/lib/assets/javascripts/atreides/raphael.path.methods.js +53 -0
  126. data/lib/assets/javascripts/atreides/raphael.pie.js +44 -0
  127. data/lib/assets/javascripts/atreides/sifr.js +18 -0
  128. data/lib/assets/javascripts/atreides/swfobject.js +4 -0
  129. data/lib/assets/javascripts/atreides/swfupload/handlers.js +290 -0
  130. data/lib/assets/javascripts/atreides/swfupload/swfupload.cookies.js +53 -0
  131. data/lib/assets/javascripts/atreides/swfupload/swfupload.js +980 -0
  132. data/lib/assets/javascripts/atreides/swfupload/swfupload.queue.js +98 -0
  133. data/lib/assets/javascripts/atreides/swfupload/swfupload.speed.js +342 -0
  134. data/lib/assets/javascripts/atreides/swfupload/swfupload.swfobject.js +111 -0
  135. data/lib/assets/javascripts/atreides/underscore-1.1.6.js +807 -0
  136. data/lib/assets/stylesheets/atreides/admin_grid.css +258 -0
  137. data/lib/assets/stylesheets/atreides/facebox.css +80 -0
  138. data/lib/assets/stylesheets/atreides/formtastic.css +144 -0
  139. data/lib/assets/stylesheets/atreides/galleria.css +24 -0
  140. data/lib/assets/stylesheets/atreides/ie.css +35 -0
  141. data/lib/assets/stylesheets/atreides/images/bg_fallback.png +0 -0
  142. data/lib/assets/stylesheets/atreides/images/icon_sprite.png +0 -0
  143. data/lib/assets/stylesheets/atreides/images/progress_bar.gif +0 -0
  144. data/lib/assets/stylesheets/atreides/images/slider_handles.png +0 -0
  145. data/lib/assets/stylesheets/atreides/images/ui-icons_222222_256x240.png +0 -0
  146. data/lib/assets/stylesheets/atreides/images/ui-icons_454545_256x240.png +0 -0
  147. data/lib/assets/stylesheets/atreides/jquery-ui.css +738 -0
  148. data/lib/assets/stylesheets/atreides/multipleselectbox.css +33 -0
  149. data/lib/assets/stylesheets/atreides/print.css +29 -0
  150. data/lib/assets/stylesheets/atreides/public_grid.css +258 -0
  151. data/lib/assets/stylesheets/atreides/tipsy.css +7 -0
  152. data/lib/assets/stylesheets/atreides/uniform.default.css +476 -0
  153. data/lib/atreides.rb +4 -0
  154. data/lib/atreides/schema.rb +53 -0
  155. data/lib/atreides/time_zone.rb +6 -0
  156. data/lib/atreides/version.rb +1 -1
  157. data/lib/generators/templates/create_pages.rb +1 -2
  158. data/lib/generators/templates/create_posts.rb +1 -2
  159. metadata +155 -13
  160. data/app/views/admin/common/_list_table.html.erb +0 -37
  161. data/app/views/admin/common/_list_table_row.html.erb +0 -18
  162. data/app/views/admin/common/_pagination.html.erb +0 -1
  163. data/app/views/admin/common/_search_form.html.erb +0 -6
@@ -0,0 +1,205 @@
1
+ /*
2
+ * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
3
+ *
4
+ * Uses the built in easing capabilities added In jQuery 1.1
5
+ * to offer multiple easing options
6
+ *
7
+ * TERMS OF USE - jQuery Easing
8
+ *
9
+ * Open source under the BSD License.
10
+ *
11
+ * Copyright © 2008 George McGinley Smith
12
+ * All rights reserved.
13
+ *
14
+ * Redistribution and use in source and binary forms, with or without modification,
15
+ * are permitted provided that the following conditions are met:
16
+ *
17
+ * Redistributions of source code must retain the above copyright notice, this list of
18
+ * conditions and the following disclaimer.
19
+ * Redistributions in binary form must reproduce the above copyright notice, this list
20
+ * of conditions and the following disclaimer in the documentation and/or other materials
21
+ * provided with the distribution.
22
+ *
23
+ * Neither the name of the author nor the names of contributors may be used to endorse
24
+ * or promote products derived from this software without specific prior written permission.
25
+ *
26
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
27
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
28
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
29
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
30
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
31
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
32
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
33
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
34
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
35
+ *
36
+ */
37
+
38
+ // t: current time, b: begInnIng value, c: change In value, d: duration
39
+ jQuery.easing['jswing'] = jQuery.easing['swing'];
40
+
41
+ jQuery.extend( jQuery.easing,
42
+ {
43
+ def: 'easeOutQuad',
44
+ swing: function (x, t, b, c, d) {
45
+ //alert(jQuery.easing.default);
46
+ return jQuery.easing[jQuery.easing.def](x, t, b, c, d);
47
+ },
48
+ easeInQuad: function (x, t, b, c, d) {
49
+ return c*(t/=d)*t + b;
50
+ },
51
+ easeOutQuad: function (x, t, b, c, d) {
52
+ return -c *(t/=d)*(t-2) + b;
53
+ },
54
+ easeInOutQuad: function (x, t, b, c, d) {
55
+ if ((t/=d/2) < 1) return c/2*t*t + b;
56
+ return -c/2 * ((--t)*(t-2) - 1) + b;
57
+ },
58
+ easeInCubic: function (x, t, b, c, d) {
59
+ return c*(t/=d)*t*t + b;
60
+ },
61
+ easeOutCubic: function (x, t, b, c, d) {
62
+ return c*((t=t/d-1)*t*t + 1) + b;
63
+ },
64
+ easeInOutCubic: function (x, t, b, c, d) {
65
+ if ((t/=d/2) < 1) return c/2*t*t*t + b;
66
+ return c/2*((t-=2)*t*t + 2) + b;
67
+ },
68
+ easeInQuart: function (x, t, b, c, d) {
69
+ return c*(t/=d)*t*t*t + b;
70
+ },
71
+ easeOutQuart: function (x, t, b, c, d) {
72
+ return -c * ((t=t/d-1)*t*t*t - 1) + b;
73
+ },
74
+ easeInOutQuart: function (x, t, b, c, d) {
75
+ if ((t/=d/2) < 1) return c/2*t*t*t*t + b;
76
+ return -c/2 * ((t-=2)*t*t*t - 2) + b;
77
+ },
78
+ easeInQuint: function (x, t, b, c, d) {
79
+ return c*(t/=d)*t*t*t*t + b;
80
+ },
81
+ easeOutQuint: function (x, t, b, c, d) {
82
+ return c*((t=t/d-1)*t*t*t*t + 1) + b;
83
+ },
84
+ easeInOutQuint: function (x, t, b, c, d) {
85
+ if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;
86
+ return c/2*((t-=2)*t*t*t*t + 2) + b;
87
+ },
88
+ easeInSine: function (x, t, b, c, d) {
89
+ return -c * Math.cos(t/d * (Math.PI/2)) + c + b;
90
+ },
91
+ easeOutSine: function (x, t, b, c, d) {
92
+ return c * Math.sin(t/d * (Math.PI/2)) + b;
93
+ },
94
+ easeInOutSine: function (x, t, b, c, d) {
95
+ return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b;
96
+ },
97
+ easeInExpo: function (x, t, b, c, d) {
98
+ return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b;
99
+ },
100
+ easeOutExpo: function (x, t, b, c, d) {
101
+ return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;
102
+ },
103
+ easeInOutExpo: function (x, t, b, c, d) {
104
+ if (t==0) return b;
105
+ if (t==d) return b+c;
106
+ if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;
107
+ return c/2 * (-Math.pow(2, -10 * --t) + 2) + b;
108
+ },
109
+ easeInCirc: function (x, t, b, c, d) {
110
+ return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;
111
+ },
112
+ easeOutCirc: function (x, t, b, c, d) {
113
+ return c * Math.sqrt(1 - (t=t/d-1)*t) + b;
114
+ },
115
+ easeInOutCirc: function (x, t, b, c, d) {
116
+ if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b;
117
+ return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b;
118
+ },
119
+ easeInElastic: function (x, t, b, c, d) {
120
+ var s=1.70158;var p=0;var a=c;
121
+ if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;
122
+ if (a < Math.abs(c)) { a=c; var s=p/4; }
123
+ else var s = p/(2*Math.PI) * Math.asin (c/a);
124
+ return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
125
+ },
126
+ easeOutElastic: function (x, t, b, c, d) {
127
+ var s=1.70158;var p=0;var a=c;
128
+ if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;
129
+ if (a < Math.abs(c)) { a=c; var s=p/4; }
130
+ else var s = p/(2*Math.PI) * Math.asin (c/a);
131
+ return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;
132
+ },
133
+ easeInOutElastic: function (x, t, b, c, d) {
134
+ var s=1.70158;var p=0;var a=c;
135
+ if (t==0) return b; if ((t/=d/2)==2) return b+c; if (!p) p=d*(.3*1.5);
136
+ if (a < Math.abs(c)) { a=c; var s=p/4; }
137
+ else var s = p/(2*Math.PI) * Math.asin (c/a);
138
+ if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
139
+ return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b;
140
+ },
141
+ easeInBack: function (x, t, b, c, d, s) {
142
+ if (s == undefined) s = 1.70158;
143
+ return c*(t/=d)*t*((s+1)*t - s) + b;
144
+ },
145
+ easeOutBack: function (x, t, b, c, d, s) {
146
+ if (s == undefined) s = 1.70158;
147
+ return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
148
+ },
149
+ easeInOutBack: function (x, t, b, c, d, s) {
150
+ if (s == undefined) s = 1.70158;
151
+ if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
152
+ return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
153
+ },
154
+ easeInBounce: function (x, t, b, c, d) {
155
+ return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b;
156
+ },
157
+ easeOutBounce: function (x, t, b, c, d) {
158
+ if ((t/=d) < (1/2.75)) {
159
+ return c*(7.5625*t*t) + b;
160
+ } else if (t < (2/2.75)) {
161
+ return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
162
+ } else if (t < (2.5/2.75)) {
163
+ return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
164
+ } else {
165
+ return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
166
+ }
167
+ },
168
+ easeInOutBounce: function (x, t, b, c, d) {
169
+ if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b;
170
+ return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b;
171
+ }
172
+ });
173
+
174
+ /*
175
+ *
176
+ * TERMS OF USE - EASING EQUATIONS
177
+ *
178
+ * Open source under the BSD License.
179
+ *
180
+ * Copyright © 2001 Robert Penner
181
+ * All rights reserved.
182
+ *
183
+ * Redistribution and use in source and binary forms, with or without modification,
184
+ * are permitted provided that the following conditions are met:
185
+ *
186
+ * Redistributions of source code must retain the above copyright notice, this list of
187
+ * conditions and the following disclaimer.
188
+ * Redistributions in binary form must reproduce the above copyright notice, this list
189
+ * of conditions and the following disclaimer in the documentation and/or other materials
190
+ * provided with the distribution.
191
+ *
192
+ * Neither the name of the author nor the names of contributors may be used to endorse
193
+ * or promote products derived from this software without specific prior written permission.
194
+ *
195
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
196
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
197
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
198
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
199
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
200
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
201
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
202
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
203
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
204
+ *
205
+ */
@@ -0,0 +1,288 @@
1
+ /**
2
+ * Flash (http://jquery.lukelutman.com/plugins/flash)
3
+ * A jQuery plugin for embedding Flash movies.
4
+ *
5
+ * Version 1.0
6
+ * November 9th, 2006
7
+ *
8
+ * Copyright (c) 2006 Luke Lutman (http://www.lukelutman.com)
9
+ * Dual licensed under the MIT and GPL licenses.
10
+ * http://www.opensource.org/licenses/mit-license.php
11
+ * http://www.opensource.org/licenses/gpl-license.php
12
+ *
13
+ * Inspired by:
14
+ * SWFObject (http://blog.deconcept.com/swfobject/)
15
+ * UFO (http://www.bobbyvandersluis.com/ufo/)
16
+ * sIFR (http://www.mikeindustries.com/sifr/)
17
+ *
18
+ * IMPORTANT:
19
+ * The packed version of jQuery breaks ActiveX control
20
+ * activation in Internet Explorer. Use JSMin to minifiy
21
+ * jQuery (see: http://jquery.lukelutman.com/plugins/flash#activex).
22
+ *
23
+ **/
24
+ ;(function(){
25
+
26
+ var $$;
27
+
28
+ /**
29
+ *
30
+ * @desc Replace matching elements with a flash movie.
31
+ * @author Luke Lutman
32
+ * @version 1.0.1
33
+ *
34
+ * @name flash
35
+ * @param Hash htmlOptions Options for the embed/object tag.
36
+ * @param Hash pluginOptions Options for detecting/updating the Flash plugin (optional).
37
+ * @param Function replace Custom block called for each matched element if flash is installed (optional).
38
+ * @param Function update Custom block called for each matched if flash isn't installed (optional).
39
+ * @type jQuery
40
+ *
41
+ * @cat plugins/flash
42
+ *
43
+ * @example $('#hello').flash({ src: 'hello.swf' });
44
+ * @desc Embed a Flash movie.
45
+ *
46
+ * @example $('#hello').flash({ src: 'hello.swf' }, { version: 8 });
47
+ * @desc Embed a Flash 8 movie.
48
+ *
49
+ * @example $('#hello').flash({ src: 'hello.swf' }, { expressInstall: true });
50
+ * @desc Embed a Flash movie using Express Install if flash isn't installed.
51
+ *
52
+ * @example $('#hello').flash({ src: 'hello.swf' }, { update: false });
53
+ * @desc Embed a Flash movie, don't show an update message if Flash isn't installed.
54
+ *
55
+ **/
56
+ $$ = jQuery.fn.flash = function(htmlOptions, pluginOptions, replace, update) {
57
+
58
+ // Set the default block.
59
+ var block = replace || $$.replace;
60
+
61
+ // Merge the default and passed plugin options.
62
+ pluginOptions = $$.copy($$.pluginOptions, pluginOptions);
63
+
64
+ // Detect Flash.
65
+ if(!$$.hasFlash(pluginOptions.version)) {
66
+ // Use Express Install (if specified and Flash plugin 6,0,65 or higher is installed).
67
+ if(pluginOptions.expressInstall && $$.hasFlash(6,0,65)) {
68
+ // Add the necessary flashvars (merged later).
69
+ var expressInstallOptions = {
70
+ flashvars: {
71
+ MMredirectURL: location,
72
+ MMplayerType: 'PlugIn',
73
+ MMdoctitle: jQuery('title').text()
74
+ }
75
+ };
76
+ // Ask the user to update (if specified).
77
+ } else if (pluginOptions.update) {
78
+ // Change the block to insert the update message instead of the flash movie.
79
+ block = update || $$.update;
80
+ // Fail
81
+ } else {
82
+ // The required version of flash isn't installed.
83
+ // Express Install is turned off, or flash 6,0,65 isn't installed.
84
+ // Update is turned off.
85
+ // Return without doing anything.
86
+ return this;
87
+ }
88
+ }
89
+
90
+ // Merge the default, express install and passed html options.
91
+ htmlOptions = $$.copy($$.htmlOptions, expressInstallOptions, htmlOptions);
92
+
93
+ // Invoke $block (with a copy of the merged html options) for each element.
94
+ return this.each(function(){
95
+ block.call(this, $$.copy(htmlOptions));
96
+ });
97
+
98
+ };
99
+ /**
100
+ *
101
+ * @name flash.copy
102
+ * @desc Copy an arbitrary number of objects into a new object.
103
+ * @type Object
104
+ *
105
+ * @example $$.copy({ foo: 1 }, { bar: 2 });
106
+ * @result { foo: 1, bar: 2 };
107
+ *
108
+ **/
109
+ $$.copy = function() {
110
+ var options = {}, flashvars = {};
111
+ for(var i = 0; i < arguments.length; i++) {
112
+ var arg = arguments[i];
113
+ if(arg == undefined) continue;
114
+ jQuery.extend(options, arg);
115
+ // don't clobber one flash vars object with another
116
+ // merge them instead
117
+ if(arg.flashvars == undefined) continue;
118
+ jQuery.extend(flashvars, arg.flashvars);
119
+ }
120
+ options.flashvars = flashvars;
121
+ return options;
122
+ };
123
+ /*
124
+ * @name flash.hasFlash
125
+ * @desc Check if a specific version of the Flash plugin is installed
126
+ * @type Boolean
127
+ *
128
+ **/
129
+ $$.hasFlash = function() {
130
+ // look for a flag in the query string to bypass flash detection
131
+ if(/hasFlash\=true/.test(location)) return true;
132
+ if(/hasFlash\=false/.test(location)) return false;
133
+ var pv = $$.hasFlash.playerVersion().match(/\d+/g);
134
+ var rv = String([arguments[0], arguments[1], arguments[2]]).match(/\d+/g) || String($$.pluginOptions.version).match(/\d+/g);
135
+ for(var i = 0; i < 3; i++) {
136
+ pv[i] = parseInt(pv[i] || 0);
137
+ rv[i] = parseInt(rv[i] || 0);
138
+ // player is less than required
139
+ if(pv[i] < rv[i]) return false;
140
+ // player is greater than required
141
+ if(pv[i] > rv[i]) return true;
142
+ }
143
+ // major version, minor version and revision match exactly
144
+ return true;
145
+ };
146
+ /**
147
+ *
148
+ * @name flash.hasFlash.playerVersion
149
+ * @desc Get the version of the installed Flash plugin.
150
+ * @type String
151
+ *
152
+ **/
153
+ $$.hasFlash.playerVersion = function() {
154
+ // ie
155
+ try {
156
+ try {
157
+ // avoid fp6 minor version lookup issues
158
+ // see: http://blog.deconcept.com/2006/01/11/getvariable-setvariable-crash-internet-explorer-flash-6/
159
+ var axo = new ActiveXObject('ShockwaveFlash.ShockwaveFlash.6');
160
+ try { axo.AllowScriptAccess = 'always'; }
161
+ catch(e) { return '6,0,0'; }
162
+ } catch(e) {}
163
+ return new ActiveXObject('ShockwaveFlash.ShockwaveFlash').GetVariable('$version').replace(/\D+/g, ',').match(/^,?(.+),?$/)[1];
164
+ // other browsers
165
+ } catch(e) {
166
+ try {
167
+ if(navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin){
168
+ return (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]).description.replace(/\D+/g, ",").match(/^,?(.+),?$/)[1];
169
+ }
170
+ } catch(e) {}
171
+ }
172
+ return '0,0,0';
173
+ };
174
+ /**
175
+ *
176
+ * @name flash.htmlOptions
177
+ * @desc The default set of options for the object or embed tag.
178
+ *
179
+ **/
180
+ $$.htmlOptions = {
181
+ height: 240,
182
+ flashvars: {},
183
+ pluginspage: 'http://www.adobe.com/go/getflashplayer',
184
+ src: '#',
185
+ type: 'application/x-shockwave-flash',
186
+ width: 320
187
+ };
188
+ /**
189
+ *
190
+ * @name flash.pluginOptions
191
+ * @desc The default set of options for checking/updating the flash Plugin.
192
+ *
193
+ **/
194
+ $$.pluginOptions = {
195
+ expressInstall: false,
196
+ update: true,
197
+ version: '6.0.65'
198
+ };
199
+ /**
200
+ *
201
+ * @name flash.replace
202
+ * @desc The default method for replacing an element with a Flash movie.
203
+ *
204
+ **/
205
+ $$.replace = function(htmlOptions) {
206
+ this.innerHTML = '<div class="alt">'+this.innerHTML+'</div>';
207
+ jQuery(this)
208
+ .addClass('flash-replaced')
209
+ .prepend($$.transform(htmlOptions));
210
+ };
211
+ /**
212
+ *
213
+ * @name flash.update
214
+ * @desc The default method for replacing an element with an update message.
215
+ *
216
+ **/
217
+ $$.update = function(htmlOptions) {
218
+ var url = String(location).split('?');
219
+ url.splice(1,0,'?hasFlash=true&');
220
+ url = url.join('');
221
+ var msg = '<p>This content requires the Flash Player. <a href="http://www.adobe.com/go/getflashplayer">Download Flash Player</a>. Already have Flash Player? <a href="'+url+'">Click here.</a></p>';
222
+ this.innerHTML = '<span class="alt">'+this.innerHTML+'</span>';
223
+ jQuery(this)
224
+ .addClass('flash-update')
225
+ .prepend(msg);
226
+ };
227
+ /**
228
+ *
229
+ * @desc Convert a hash of html options to a string of attributes, using Function.apply().
230
+ * @example toAttributeString.apply(htmlOptions)
231
+ * @result foo="bar" foo="bar"
232
+ *
233
+ **/
234
+ function toAttributeString() {
235
+ var s = '';
236
+ for(var key in this)
237
+ if(typeof this[key] != 'function')
238
+ s += key+'="'+this[key]+'" ';
239
+ return s;
240
+ };
241
+ /**
242
+ *
243
+ * @desc Convert a hash of flashvars to a url-encoded string, using Function.apply().
244
+ * @example toFlashvarsString.apply(flashvarsObject)
245
+ * @result foo=bar&foo=bar
246
+ *
247
+ **/
248
+ function toFlashvarsString() {
249
+ var s = '';
250
+ for(var key in this)
251
+ if(typeof this[key] != 'function')
252
+ s += key+'='+encodeURIComponent(this[key])+'&';
253
+ return s.replace(/&$/, '');
254
+ };
255
+ /**
256
+ *
257
+ * @name flash.transform
258
+ * @desc Transform a set of html options into an embed tag.
259
+ * @type String
260
+ *
261
+ * @example $$.transform(htmlOptions)
262
+ * @result <embed src="foo.swf" ... />
263
+ *
264
+ * Note: The embed tag is NOT standards-compliant, but it
265
+ * works in all current browsers. flash.transform can be
266
+ * overwritten with a custom function to generate more
267
+ * standards-compliant markup.
268
+ *
269
+ **/
270
+ $$.transform = function(htmlOptions) {
271
+ htmlOptions.toString = toAttributeString;
272
+ if(htmlOptions.flashvars) htmlOptions.flashvars.toString = toFlashvarsString;
273
+ return '<embed ' + String(htmlOptions) + '/>';
274
+ };
275
+
276
+ /**
277
+ *
278
+ * Flash Player 9 Fix (http://blog.deconcept.com/2006/07/28/swfobject-143-released/)
279
+ *
280
+ **/
281
+ if (window.attachEvent) {
282
+ window.attachEvent("onbeforeunload", function(){
283
+ __flash_unloadHandler = function() {};
284
+ __flash_savedUnloadHandler = function() {};
285
+ });
286
+ }
287
+
288
+ })();