spree_backend 2.0.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (370) hide show
  1. checksums.yaml +15 -0
  2. data/app/assets/images/admin/bg/spree_50.png +0 -0
  3. data/app/assets/images/admin/payment_banner.png +0 -0
  4. data/app/assets/images/admin/progress.gif +0 -0
  5. data/app/assets/javascripts/admin/address_states.js +27 -0
  6. data/app/assets/javascripts/admin/admin.js.erb +283 -0
  7. data/app/assets/javascripts/admin/calculator.js +16 -0
  8. data/app/assets/javascripts/admin/checkouts/edit.js +94 -0
  9. data/app/assets/javascripts/admin/gateway.js +13 -0
  10. data/app/assets/javascripts/admin/image_settings.js.erb +62 -0
  11. data/app/assets/javascripts/admin/images/index.js.coffee +15 -0
  12. data/app/assets/javascripts/admin/images/new.js.coffee +7 -0
  13. data/app/assets/javascripts/admin/nested-attribute.js +23 -0
  14. data/app/assets/javascripts/admin/option_type_autocomplete.js.erb +35 -0
  15. data/app/assets/javascripts/admin/orders/edit.js +17 -0
  16. data/app/assets/javascripts/admin/orders/edit_form.js +16 -0
  17. data/app/assets/javascripts/admin/payments/new.js +16 -0
  18. data/app/assets/javascripts/admin/product_picker.js +37 -0
  19. data/app/assets/javascripts/admin/progress.coffee +27 -0
  20. data/app/assets/javascripts/admin/promotions.js +98 -0
  21. data/app/assets/javascripts/admin/shipments.js.erb +66 -0
  22. data/app/assets/javascripts/admin/spree-select2.js.erb +22 -0
  23. data/app/assets/javascripts/admin/spree_backend.js +19 -0
  24. data/app/assets/javascripts/admin/states.js +9 -0
  25. data/app/assets/javascripts/admin/stock_management.js.coffee +9 -0
  26. data/app/assets/javascripts/admin/stock_transfer.js.coffee +181 -0
  27. data/app/assets/javascripts/admin/taxon_autocomplete.js.erb +32 -0
  28. data/app/assets/javascripts/admin/taxon_tree_menu.js.coffee +22 -0
  29. data/app/assets/javascripts/admin/taxonomy.js.coffee +127 -0
  30. data/app/assets/javascripts/admin/underscore-min.js +1227 -0
  31. data/app/assets/javascripts/admin/user_picker.js +31 -0
  32. data/app/assets/javascripts/admin/variant_autocomplete.js.erb +180 -0
  33. data/app/assets/javascripts/admin/zone.js.coffee +39 -0
  34. data/app/assets/javascripts/store/backend.js +1 -0
  35. data/app/assets/stylesheets/admin/components/_actions.scss +31 -0
  36. data/app/assets/stylesheets/admin/components/_date-picker.scss +154 -0
  37. data/app/assets/stylesheets/admin/components/_messages.scss +43 -0
  38. data/app/assets/stylesheets/admin/components/_navigation.scss +150 -0
  39. data/app/assets/stylesheets/admin/components/_pagination.scss +17 -0
  40. data/app/assets/stylesheets/admin/components/_product_autocomplete.scss +29 -0
  41. data/app/assets/stylesheets/admin/components/_progress.scss +35 -0
  42. data/app/assets/stylesheets/admin/components/_sidebar.scss +24 -0
  43. data/app/assets/stylesheets/admin/components/_states.scss +34 -0
  44. data/app/assets/stylesheets/admin/components/_table-filter.scss +14 -0
  45. data/app/assets/stylesheets/admin/globals/_functions.scss +25 -0
  46. data/app/assets/stylesheets/admin/globals/_mixins.scss +25 -0
  47. data/app/assets/stylesheets/admin/globals/_variables.scss +142 -0
  48. data/app/assets/stylesheets/admin/globals/_variables_override.scss +7 -0
  49. data/app/assets/stylesheets/admin/hacks/_ie.scss +73 -0
  50. data/app/assets/stylesheets/admin/hacks/_mozilla.scss +32 -0
  51. data/app/assets/stylesheets/admin/hacks/_opera.scss +17 -0
  52. data/app/assets/stylesheets/admin/plugins/_jstree.scss +132 -0
  53. data/app/assets/stylesheets/admin/plugins/_powertip.scss +86 -0
  54. data/app/assets/stylesheets/admin/plugins/_select2.scss +176 -0
  55. data/app/assets/stylesheets/admin/plugins/_token-input.scss +110 -0
  56. data/app/assets/stylesheets/admin/plugins/font-awesome.scss +303 -0
  57. data/app/assets/stylesheets/admin/sections/_bulk_transfer.scss +8 -0
  58. data/app/assets/stylesheets/admin/sections/_edit_checkouts.scss +72 -0
  59. data/app/assets/stylesheets/admin/sections/_image_settings.scss +3 -0
  60. data/app/assets/stylesheets/admin/sections/_orders.scss +54 -0
  61. data/app/assets/stylesheets/admin/sections/_overview.scss +86 -0
  62. data/app/assets/stylesheets/admin/sections/_products.scss +113 -0
  63. data/app/assets/stylesheets/admin/sections/_promotions.scss +100 -0
  64. data/app/assets/stylesheets/admin/shared/_forms.scss +262 -0
  65. data/app/assets/stylesheets/admin/shared/_icons.scss +22 -0
  66. data/app/assets/stylesheets/admin/shared/_layout.scss +91 -0
  67. data/app/assets/stylesheets/admin/shared/_tables.scss +198 -0
  68. data/app/assets/stylesheets/admin/shared/_typography.scss +132 -0
  69. data/app/assets/stylesheets/admin/spree_admin.scss +39 -0
  70. data/app/assets/stylesheets/admin/spree_backend.css +16 -0
  71. data/app/assets/stylesheets/store/backend.css +1 -0
  72. data/app/controllers/spree/admin/adjustments_controller.rb +30 -0
  73. data/app/controllers/spree/admin/banners_controller.rb +14 -0
  74. data/app/controllers/spree/admin/base_controller.rb +92 -0
  75. data/app/controllers/spree/admin/countries_controller.rb +11 -0
  76. data/app/controllers/spree/admin/general_settings_controller.rb +34 -0
  77. data/app/controllers/spree/admin/image_settings_controller.rb +66 -0
  78. data/app/controllers/spree/admin/images_controller.rb +35 -0
  79. data/app/controllers/spree/admin/inventory_units_controller.rb +6 -0
  80. data/app/controllers/spree/admin/line_items_controller.rb +49 -0
  81. data/app/controllers/spree/admin/mail_methods_controller.rb +38 -0
  82. data/app/controllers/spree/admin/option_types_controller.rb +46 -0
  83. data/app/controllers/spree/admin/option_values_controller.rb +11 -0
  84. data/app/controllers/spree/admin/orders/customer_details_controller.rb +40 -0
  85. data/app/controllers/spree/admin/orders_controller.rb +133 -0
  86. data/app/controllers/spree/admin/overview_controller.rb +13 -0
  87. data/app/controllers/spree/admin/payment_methods_controller.rb +65 -0
  88. data/app/controllers/spree/admin/payments_controller.rb +111 -0
  89. data/app/controllers/spree/admin/product_properties_controller.rb +18 -0
  90. data/app/controllers/spree/admin/products_controller.rb +115 -0
  91. data/app/controllers/spree/admin/promotion_actions_controller.rb +45 -0
  92. data/app/controllers/spree/admin/promotion_rules_controller.rb +50 -0
  93. data/app/controllers/spree/admin/promotions_controller.rb +23 -0
  94. data/app/controllers/spree/admin/properties_controller.rb +12 -0
  95. data/app/controllers/spree/admin/prototypes_controller.rb +27 -0
  96. data/app/controllers/spree/admin/reports_controller.rb +55 -0
  97. data/app/controllers/spree/admin/resource_controller.rb +261 -0
  98. data/app/controllers/spree/admin/return_authorizations_controller.rb +21 -0
  99. data/app/controllers/spree/admin/search_controller.rb +27 -0
  100. data/app/controllers/spree/admin/shipping_categories_controller.rb +6 -0
  101. data/app/controllers/spree/admin/shipping_methods_controller.rb +45 -0
  102. data/app/controllers/spree/admin/states_controller.rb +29 -0
  103. data/app/controllers/spree/admin/stock_items_controller.rb +24 -0
  104. data/app/controllers/spree/admin/stock_locations_controller.rb +7 -0
  105. data/app/controllers/spree/admin/stock_movements_controller.rb +60 -0
  106. data/app/controllers/spree/admin/stock_transfers_controller.rb +53 -0
  107. data/app/controllers/spree/admin/tax_categories_controller.rb +19 -0
  108. data/app/controllers/spree/admin/tax_rates_controller.rb +26 -0
  109. data/app/controllers/spree/admin/tax_settings_controller.rb +17 -0
  110. data/app/controllers/spree/admin/taxonomies_controller.rb +21 -0
  111. data/app/controllers/spree/admin/taxons_controller.rb +112 -0
  112. data/app/controllers/spree/admin/trackers_controller.rb +6 -0
  113. data/app/controllers/spree/admin/variants_controller.rb +44 -0
  114. data/app/controllers/spree/admin/zones_controller.rb +26 -0
  115. data/app/helpers/spree/admin/base_helper.rb +168 -0
  116. data/app/helpers/spree/admin/general_settings_helper.rb +13 -0
  117. data/app/helpers/spree/admin/inventory_settings_helper.rb +9 -0
  118. data/app/helpers/spree/admin/navigation_helper.rb +154 -0
  119. data/app/helpers/spree/admin/orders_helper.rb +19 -0
  120. data/app/helpers/spree/admin/payments_helper.rb +11 -0
  121. data/app/helpers/spree/admin/products_helper.rb +27 -0
  122. data/app/helpers/spree/admin/stock_movements_helper.rb +13 -0
  123. data/app/helpers/spree/admin/tables_helper.rb +15 -0
  124. data/app/helpers/spree/admin/taxons_helper.rb +9 -0
  125. data/app/helpers/spree/promotion_rules_helper.rb +13 -0
  126. data/app/models/spree/backend_configuration.rb +5 -0
  127. data/app/views/spree/admin/adjustments/_adjustments_table.html.erb +36 -0
  128. data/app/views/spree/admin/adjustments/_form.html.erb +16 -0
  129. data/app/views/spree/admin/adjustments/edit.html.erb +22 -0
  130. data/app/views/spree/admin/adjustments/index.html.erb +14 -0
  131. data/app/views/spree/admin/adjustments/new.html.erb +23 -0
  132. data/app/views/spree/admin/banners/_gateway.html.erb +16 -0
  133. data/app/views/spree/admin/countries/_form.html.erb +22 -0
  134. data/app/views/spree/admin/countries/edit.html.erb +21 -0
  135. data/app/views/spree/admin/countries/index.html.erb +34 -0
  136. data/app/views/spree/admin/general_settings/edit.html.erb +92 -0
  137. data/app/views/spree/admin/image_settings/edit.html.erb +126 -0
  138. data/app/views/spree/admin/images/_form.html.erb +18 -0
  139. data/app/views/spree/admin/images/edit.html.erb +28 -0
  140. data/app/views/spree/admin/images/index.html.erb +58 -0
  141. data/app/views/spree/admin/images/new.html.erb +15 -0
  142. data/app/views/spree/admin/inventory_units/adjust.html.erb +31 -0
  143. data/app/views/spree/admin/line_items/create.js.erb +1 -0
  144. data/app/views/spree/admin/line_items/destroy.js.erb +1 -0
  145. data/app/views/spree/admin/mail_methods/_form.html.erb +80 -0
  146. data/app/views/spree/admin/mail_methods/edit.html.erb +21 -0
  147. data/app/views/spree/admin/option_types/_form.html.erb +17 -0
  148. data/app/views/spree/admin/option_types/_option_value_fields.html.erb +9 -0
  149. data/app/views/spree/admin/option_types/edit.html.erb +50 -0
  150. data/app/views/spree/admin/option_types/index.html.erb +40 -0
  151. data/app/views/spree/admin/option_types/new.html.erb +11 -0
  152. data/app/views/spree/admin/option_types/new.js.erb +2 -0
  153. data/app/views/spree/admin/orders/_add_product.html.erb +15 -0
  154. data/app/views/spree/admin/orders/_form.html.erb +45 -0
  155. data/app/views/spree/admin/orders/_line_item.html.erb +9 -0
  156. data/app/views/spree/admin/orders/_shipment.html.erb +148 -0
  157. data/app/views/spree/admin/orders/customer_details/_form.html.erb +66 -0
  158. data/app/views/spree/admin/orders/customer_details/edit.html.erb +27 -0
  159. data/app/views/spree/admin/orders/edit.html.erb +30 -0
  160. data/app/views/spree/admin/orders/index.html.erb +134 -0
  161. data/app/views/spree/admin/payment_methods/_form.html.erb +57 -0
  162. data/app/views/spree/admin/payment_methods/edit.html.erb +23 -0
  163. data/app/views/spree/admin/payment_methods/index.html.erb +52 -0
  164. data/app/views/spree/admin/payment_methods/new.html.erb +22 -0
  165. data/app/views/spree/admin/payments/_bill_address_form.html.erb +9 -0
  166. data/app/views/spree/admin/payments/_form.html.erb +28 -0
  167. data/app/views/spree/admin/payments/_list.html.erb +26 -0
  168. data/app/views/spree/admin/payments/credit.html.erb +18 -0
  169. data/app/views/spree/admin/payments/index.html.erb +24 -0
  170. data/app/views/spree/admin/payments/new.html.erb +26 -0
  171. data/app/views/spree/admin/payments/show.html.erb +18 -0
  172. data/app/views/spree/admin/payments/source_forms/_check.html.erb +0 -0
  173. data/app/views/spree/admin/payments/source_forms/_gateway.html.erb +50 -0
  174. data/app/views/spree/admin/payments/source_views/_check.html.erb +0 -0
  175. data/app/views/spree/admin/payments/source_views/_gateway.html.erb +29 -0
  176. data/app/views/spree/admin/product_properties/_product_property_fields.html.erb +17 -0
  177. data/app/views/spree/admin/product_properties/index.html.erb +59 -0
  178. data/app/views/spree/admin/products/_add_stock_form.html.erb +6 -0
  179. data/app/views/spree/admin/products/_form.html.erb +128 -0
  180. data/app/views/spree/admin/products/_properties_form.erb +10 -0
  181. data/app/views/spree/admin/products/edit.html.erb +18 -0
  182. data/app/views/spree/admin/products/index.html.erb +102 -0
  183. data/app/views/spree/admin/products/new.html.erb +81 -0
  184. data/app/views/spree/admin/products/new.js.erb +7 -0
  185. data/app/views/spree/admin/products/stock.html.erb +79 -0
  186. data/app/views/spree/admin/promotion_actions/create.js.erb +13 -0
  187. data/app/views/spree/admin/promotion_actions/destroy.js.erb +1 -0
  188. data/app/views/spree/admin/promotion_rules/create.js.erb +7 -0
  189. data/app/views/spree/admin/promotion_rules/destroy.js.erb +3 -0
  190. data/app/views/spree/admin/promotions/_actions.html.erb +32 -0
  191. data/app/views/spree/admin/promotions/_form.html.erb +56 -0
  192. data/app/views/spree/admin/promotions/_promotion_action.html.erb +11 -0
  193. data/app/views/spree/admin/promotions/_promotion_rule.html.erb +9 -0
  194. data/app/views/spree/admin/promotions/_rules.html.erb +45 -0
  195. data/app/views/spree/admin/promotions/_tab.html.erb +1 -0
  196. data/app/views/spree/admin/promotions/actions/_create_adjustment.html.erb +26 -0
  197. data/app/views/spree/admin/promotions/actions/_create_line_items.html.erb +22 -0
  198. data/app/views/spree/admin/promotions/edit.html.erb +28 -0
  199. data/app/views/spree/admin/promotions/index.html.erb +52 -0
  200. data/app/views/spree/admin/promotions/new.html.erb +16 -0
  201. data/app/views/spree/admin/promotions/rules/_first_order.html.erb +0 -0
  202. data/app/views/spree/admin/promotions/rules/_item_total.html.erb +6 -0
  203. data/app/views/spree/admin/promotions/rules/_landing_page.html.erb +5 -0
  204. data/app/views/spree/admin/promotions/rules/_product.html.erb +9 -0
  205. data/app/views/spree/admin/promotions/rules/_user.html.erb +4 -0
  206. data/app/views/spree/admin/promotions/rules/_user_logged_in.html.erb +0 -0
  207. data/app/views/spree/admin/properties/_form.html.erb +16 -0
  208. data/app/views/spree/admin/properties/edit.html.erb +18 -0
  209. data/app/views/spree/admin/properties/filtered.html.erb +1 -0
  210. data/app/views/spree/admin/properties/index.html.erb +41 -0
  211. data/app/views/spree/admin/properties/new.html.erb +13 -0
  212. data/app/views/spree/admin/properties/new.js.erb +2 -0
  213. data/app/views/spree/admin/prototypes/_form.html.erb +25 -0
  214. data/app/views/spree/admin/prototypes/_prototypes.html.erb +25 -0
  215. data/app/views/spree/admin/prototypes/available.js.erb +2 -0
  216. data/app/views/spree/admin/prototypes/edit.html.erb +20 -0
  217. data/app/views/spree/admin/prototypes/index.html.erb +40 -0
  218. data/app/views/spree/admin/prototypes/new.html.erb +11 -0
  219. data/app/views/spree/admin/prototypes/new.js.erb +5 -0
  220. data/app/views/spree/admin/prototypes/select.js.erb +4 -0
  221. data/app/views/spree/admin/prototypes/show.html.erb +42 -0
  222. data/app/views/spree/admin/reports/index.html.erb +21 -0
  223. data/app/views/spree/admin/reports/sales_total.html.erb +37 -0
  224. data/app/views/spree/admin/return_authorizations/_form.html.erb +78 -0
  225. data/app/views/spree/admin/return_authorizations/edit.html.erb +32 -0
  226. data/app/views/spree/admin/return_authorizations/index.html.erb +52 -0
  227. data/app/views/spree/admin/return_authorizations/new.html.erb +22 -0
  228. data/app/views/spree/admin/search/users.rabl +30 -0
  229. data/app/views/spree/admin/shared/_address.html.erb +6 -0
  230. data/app/views/spree/admin/shared/_address_form.html.erb +72 -0
  231. data/app/views/spree/admin/shared/_alert.html.erb +5 -0
  232. data/app/views/spree/admin/shared/_calculator_fields.html.erb +22 -0
  233. data/app/views/spree/admin/shared/_configuration_menu.html.erb +30 -0
  234. data/app/views/spree/admin/shared/_destroy.js.erb +16 -0
  235. data/app/views/spree/admin/shared/_edit_resource_links.html.erb +5 -0
  236. data/app/views/spree/admin/shared/_head.html.erb +25 -0
  237. data/app/views/spree/admin/shared/_new_resource_links.html.erb +5 -0
  238. data/app/views/spree/admin/shared/_order_details.html.erb +56 -0
  239. data/app/views/spree/admin/shared/_order_tabs.html.erb +75 -0
  240. data/app/views/spree/admin/shared/_product_sub_menu.html.erb +8 -0
  241. data/app/views/spree/admin/shared/_product_tabs.html.erb +30 -0
  242. data/app/views/spree/admin/shared/_report_criteria.html.erb +17 -0
  243. data/app/views/spree/admin/shared/_routes.html.erb +8 -0
  244. data/app/views/spree/admin/shared/_show_resource_links.html.erb +5 -0
  245. data/app/views/spree/admin/shared/_stock_movement_form.html.erb +30 -0
  246. data/app/views/spree/admin/shared/_tabs.html.erb +14 -0
  247. data/app/views/spree/admin/shared/_translations.html.erb +32 -0
  248. data/app/views/spree/admin/shared/_update_order_state.js +7 -0
  249. data/app/views/spree/admin/shipping_categories/_form.html.erb +6 -0
  250. data/app/views/spree/admin/shipping_categories/edit.html.erb +20 -0
  251. data/app/views/spree/admin/shipping_categories/index.html.erb +35 -0
  252. data/app/views/spree/admin/shipping_categories/new.html.erb +20 -0
  253. data/app/views/spree/admin/shipping_methods/_form.html.erb +58 -0
  254. data/app/views/spree/admin/shipping_methods/edit.html.erb +29 -0
  255. data/app/views/spree/admin/shipping_methods/index.html.erb +48 -0
  256. data/app/views/spree/admin/shipping_methods/new.html.erb +29 -0
  257. data/app/views/spree/admin/states/_form.html.erb +14 -0
  258. data/app/views/spree/admin/states/_state_list.html.erb +31 -0
  259. data/app/views/spree/admin/states/edit.html.erb +20 -0
  260. data/app/views/spree/admin/states/index.html.erb +24 -0
  261. data/app/views/spree/admin/states/new.html.erb +15 -0
  262. data/app/views/spree/admin/states/new.js.erb +2 -0
  263. data/app/views/spree/admin/stock_locations/_form.html.erb +87 -0
  264. data/app/views/spree/admin/stock_locations/_transfer_stock_form.html.erb +39 -0
  265. data/app/views/spree/admin/stock_locations/edit.html.erb +17 -0
  266. data/app/views/spree/admin/stock_locations/index.html.erb +49 -0
  267. data/app/views/spree/admin/stock_locations/new.html.erb +16 -0
  268. data/app/views/spree/admin/stock_movements/_form.html.erb +13 -0
  269. data/app/views/spree/admin/stock_movements/edit.html.erb +16 -0
  270. data/app/views/spree/admin/stock_movements/index.html.erb +43 -0
  271. data/app/views/spree/admin/stock_movements/new.html.erb +16 -0
  272. data/app/views/spree/admin/stock_transfers/_stock_movements.html.erb +27 -0
  273. data/app/views/spree/admin/stock_transfers/index.html.erb +94 -0
  274. data/app/views/spree/admin/stock_transfers/new.html.erb +108 -0
  275. data/app/views/spree/admin/stock_transfers/show.html.erb +48 -0
  276. data/app/views/spree/admin/tax_categories/_form.html.erb +24 -0
  277. data/app/views/spree/admin/tax_categories/edit.html.erb +18 -0
  278. data/app/views/spree/admin/tax_categories/index.html.erb +48 -0
  279. data/app/views/spree/admin/tax_categories/new.html.erb +19 -0
  280. data/app/views/spree/admin/tax_categories/show.html.erb +1 -0
  281. data/app/views/spree/admin/tax_rates/_form.html.erb +42 -0
  282. data/app/views/spree/admin/tax_rates/edit.html.erb +21 -0
  283. data/app/views/spree/admin/tax_rates/index.html.erb +59 -0
  284. data/app/views/spree/admin/tax_rates/new.html.erb +25 -0
  285. data/app/views/spree/admin/tax_settings/edit.html.erb +18 -0
  286. data/app/views/spree/admin/taxonomies/_form.html.erb +7 -0
  287. data/app/views/spree/admin/taxonomies/_js_head.html.erb +13 -0
  288. data/app/views/spree/admin/taxonomies/_list.html.erb +26 -0
  289. data/app/views/spree/admin/taxonomies/_taxon.html.erb +12 -0
  290. data/app/views/spree/admin/taxonomies/edit.erb +42 -0
  291. data/app/views/spree/admin/taxonomies/index.html.erb +15 -0
  292. data/app/views/spree/admin/taxonomies/new.html.erb +22 -0
  293. data/app/views/spree/admin/taxons/_form.html.erb +44 -0
  294. data/app/views/spree/admin/taxons/_taxon_table.html.erb +23 -0
  295. data/app/views/spree/admin/taxons/edit.html.erb +23 -0
  296. data/app/views/spree/admin/taxons/search.rabl +5 -0
  297. data/app/views/spree/admin/trackers/_form.html.erb +34 -0
  298. data/app/views/spree/admin/trackers/edit.html.erb +20 -0
  299. data/app/views/spree/admin/trackers/index.html.erb +48 -0
  300. data/app/views/spree/admin/trackers/new.html.erb +20 -0
  301. data/app/views/spree/admin/variants/_autocomplete.js.erb +67 -0
  302. data/app/views/spree/admin/variants/_form.html.erb +37 -0
  303. data/app/views/spree/admin/variants/edit.html.erb +15 -0
  304. data/app/views/spree/admin/variants/index.html.erb +74 -0
  305. data/app/views/spree/admin/variants/new.html.erb +9 -0
  306. data/app/views/spree/admin/variants/new.js.erb +3 -0
  307. data/app/views/spree/admin/zones/_country_member.html.erb +5 -0
  308. data/app/views/spree/admin/zones/_form.html.erb +34 -0
  309. data/app/views/spree/admin/zones/_member_type.html.erb +19 -0
  310. data/app/views/spree/admin/zones/_state_member.html.erb +5 -0
  311. data/app/views/spree/admin/zones/edit.html.erb +23 -0
  312. data/app/views/spree/admin/zones/index.html.erb +53 -0
  313. data/app/views/spree/admin/zones/new.html.erb +21 -0
  314. data/app/views/spree/layouts/admin.html.erb +135 -0
  315. data/app/views/spree/test_mailer/test_email.text.erb +4 -0
  316. data/config/initializers/form_builder.rb +15 -0
  317. data/config/routes.rb +159 -0
  318. data/lib/spree/backend.rb +21 -0
  319. data/lib/spree/backend/action_callbacks.rb +26 -0
  320. data/lib/spree/backend/engine.rb +41 -0
  321. data/lib/spree_backend.rb +1 -0
  322. data/vendor/assets/fonts/fontawesome-webfont.eot +0 -0
  323. data/vendor/assets/fonts/fontawesome-webfont.svg +255 -0
  324. data/vendor/assets/fonts/fontawesome-webfont.ttf +0 -0
  325. data/vendor/assets/fonts/fontawesome-webfont.woff +0 -0
  326. data/vendor/assets/images/jquery-ui/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  327. data/vendor/assets/images/jquery-ui/ui-bg_flat_0_eeeeee_40x100.png +0 -0
  328. data/vendor/assets/images/jquery-ui/ui-bg_flat_55_ffffff_40x100.png +0 -0
  329. data/vendor/assets/images/jquery-ui/ui-bg_flat_75_ffffff_40x100.png +0 -0
  330. data/vendor/assets/images/jquery-ui/ui-bg_glass_65_ffffff_1x400.png +0 -0
  331. data/vendor/assets/images/jquery-ui/ui-bg_highlight-soft_100_f6f6f6_1x100.png +0 -0
  332. data/vendor/assets/images/jquery-ui/ui-bg_highlight-soft_25_0073ea_1x100.png +0 -0
  333. data/vendor/assets/images/jquery-ui/ui-bg_highlight-soft_50_dddddd_1x100.png +0 -0
  334. data/vendor/assets/images/jquery-ui/ui-icons_0073ea_256x240.png +0 -0
  335. data/vendor/assets/images/jquery-ui/ui-icons_454545_256x240.png +0 -0
  336. data/vendor/assets/images/jquery-ui/ui-icons_666666_256x240.png +0 -0
  337. data/vendor/assets/images/jquery-ui/ui-icons_ff0084_256x240.png +0 -0
  338. data/vendor/assets/images/jquery-ui/ui-icons_ffffff_256x240.png +0 -0
  339. data/vendor/assets/images/jquery.alerts/images/help.gif +0 -0
  340. data/vendor/assets/images/jquery.alerts/images/important.gif +0 -0
  341. data/vendor/assets/images/jquery.alerts/images/info.gif +0 -0
  342. data/vendor/assets/images/jquery.alerts/images/title.gif +0 -0
  343. data/vendor/assets/javascripts/css_browser_selector_dev.js +156 -0
  344. data/vendor/assets/javascripts/equalize.js +41 -0
  345. data/vendor/assets/javascripts/handlebars.js +1920 -0
  346. data/vendor/assets/javascripts/jquery.adaptivemenu.js +60 -0
  347. data/vendor/assets/javascripts/jquery.alerts/jquery.alerts.js +235 -0
  348. data/vendor/assets/javascripts/jquery.cookie.js +41 -0
  349. data/vendor/assets/javascripts/jquery.delayedobserver.js +35 -0
  350. data/vendor/assets/javascripts/jquery.horizontalNav.js +141 -0
  351. data/vendor/assets/javascripts/jquery.jstree/jquery.jstree.js +4540 -0
  352. data/vendor/assets/javascripts/jquery.jstree/themes/apple/bg.jpg +0 -0
  353. data/vendor/assets/javascripts/jquery.jstree/themes/apple/d.png +0 -0
  354. data/vendor/assets/javascripts/jquery.jstree/themes/apple/dot_for_ie.gif +0 -0
  355. data/vendor/assets/javascripts/jquery.jstree/themes/apple/style.css +61 -0
  356. data/vendor/assets/javascripts/jquery.jstree/themes/apple/throbber.gif +0 -0
  357. data/vendor/assets/javascripts/jquery.powertip.js +796 -0
  358. data/vendor/assets/javascripts/jquery.vAlign.js +11 -0
  359. data/vendor/assets/javascripts/modernizr.js +4 -0
  360. data/vendor/assets/javascripts/responsive-tables.js +42 -0
  361. data/vendor/assets/javascripts/spin.js +319 -0
  362. data/vendor/assets/javascripts/trunk8.js +233 -0
  363. data/vendor/assets/stylesheets/font-awesome-ie7.css +645 -0
  364. data/vendor/assets/stylesheets/font-awesome.css.erb +303 -0
  365. data/vendor/assets/stylesheets/jquery-ui.datepicker.css.erb +357 -0
  366. data/vendor/assets/stylesheets/jquery.alerts/jquery.alerts.css.erb +57 -0
  367. data/vendor/assets/stylesheets/jquery.alerts/jquery.alerts.spree.css +29 -0
  368. data/vendor/assets/stylesheets/jquery.powertip.css +85 -0
  369. data/vendor/assets/stylesheets/responsive-tables.css +21 -0
  370. metadata +509 -0
@@ -0,0 +1,11 @@
1
+ (function ($) {
2
+ // VERTICALLY ALIGN FUNCTION
3
+ $.fn.vAlign = function() {
4
+ return this.each(function(i){
5
+ var ah = $(this).height();
6
+ var ph = $(this).parent().height();
7
+ var mh = Math.ceil((ph-ah) / 2);
8
+ $(this).css('margin-top', mh);
9
+ });
10
+ };
11
+ })(jQuery);
@@ -0,0 +1,4 @@
1
+ /* Modernizr 2.6.1 (Custom Build) | MIT & BSD
2
+ * Build: http://modernizr.com/download/#-touch-shiv-teststyles-prefixes-load
3
+ */
4
+ ;window.Modernizr=function(a,b,c){function v(a){i.cssText=a}function w(a,b){return v(l.join(a+";")+(b||""))}function x(a,b){return typeof a===b}function y(a,b){return!!~(""+a).indexOf(b)}function z(a,b,d){for(var e in a){var f=b[a[e]];if(f!==c)return d===!1?a[e]:x(f,"function")?f.bind(d||b):f}return!1}var d="2.6.1",e={},f=b.documentElement,g="modernizr",h=b.createElement(g),i=h.style,j,k={}.toString,l=" -webkit- -moz- -o- -ms- ".split(" "),m={},n={},o={},p=[],q=p.slice,r,s=function(a,c,d,e){var h,i,j,k=b.createElement("div"),l=b.body,m=l?l:b.createElement("body");if(parseInt(d,10))while(d--)j=b.createElement("div"),j.id=e?e[d]:g+(d+1),k.appendChild(j);return h=["&#173;",'<style id="s',g,'">',a,"</style>"].join(""),k.id=g,(l?k:m).innerHTML+=h,m.appendChild(k),l||(m.style.background="",f.appendChild(m)),i=c(k,a),l?k.parentNode.removeChild(k):m.parentNode.removeChild(m),!!i},t={}.hasOwnProperty,u;!x(t,"undefined")&&!x(t.call,"undefined")?u=function(a,b){return t.call(a,b)}:u=function(a,b){return b in a&&x(a.constructor.prototype[b],"undefined")},Function.prototype.bind||(Function.prototype.bind=function(b){var c=this;if(typeof c!="function")throw new TypeError;var d=q.call(arguments,1),e=function(){if(this instanceof e){var a=function(){};a.prototype=c.prototype;var f=new a,g=c.apply(f,d.concat(q.call(arguments)));return Object(g)===g?g:f}return c.apply(b,d.concat(q.call(arguments)))};return e}),m.touch=function(){var c;return"ontouchstart"in a||a.DocumentTouch&&b instanceof DocumentTouch?c=!0:s(["@media (",l.join("touch-enabled),("),g,")","{#modernizr{top:9px;position:absolute}}"].join(""),function(a){c=a.offsetTop===9}),c};for(var A in m)u(m,A)&&(r=A.toLowerCase(),e[r]=m[A](),p.push((e[r]?"":"no-")+r));return e.addTest=function(a,b){if(typeof a=="object")for(var d in a)u(a,d)&&e.addTest(d,a[d]);else{a=a.toLowerCase();if(e[a]!==c)return e;b=typeof b=="function"?b():b,enableClasses&&(f.className+=" "+(b?"":"no-")+a),e[a]=b}return e},v(""),h=j=null,function(a,b){function k(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x<style>"+b+"</style>",d.insertBefore(c.lastChild,d.firstChild)}function l(){var a=r.elements;return typeof a=="string"?a.split(" "):a}function m(a){var b=i[a[g]];return b||(b={},h++,a[g]=h,i[h]=b),b}function n(a,c,f){c||(c=b);if(j)return c.createElement(a);f||(f=m(c));var g;return f.cache[a]?g=f.cache[a].cloneNode():e.test(a)?g=(f.cache[a]=f.createElem(a)).cloneNode():g=f.createElem(a),g.canHaveChildren&&!d.test(a)?f.frag.appendChild(g):g}function o(a,c){a||(a=b);if(j)return a.createDocumentFragment();c=c||m(a);var d=c.frag.cloneNode(),e=0,f=l(),g=f.length;for(;e<g;e++)d.createElement(f[e]);return d}function p(a,b){b.cache||(b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag()),a.createElement=function(c){return r.shivMethods?n(c,a,b):b.createElem(c)},a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+l().join().replace(/\w+/g,function(a){return b.createElem(a),b.frag.createElement(a),'c("'+a+'")'})+");return n}")(r,b.frag)}function q(a){a||(a=b);var c=m(a);return r.shivCSS&&!f&&!c.hasCSS&&(c.hasCSS=!!k(a,"article,aside,figcaption,figure,footer,header,hgroup,nav,section{display:block}mark{background:#FF0;color:#000}")),j||p(a,c),a}var c=a.html5||{},d=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,e=/^<|^(?:a|b|button|code|div|fieldset|form|h1|h2|h3|h4|h5|h6|i|iframe|img|input|label|li|link|ol|option|p|param|q|script|select|span|strong|style|table|tbody|td|textarea|tfoot|th|thead|tr|ul)$/i,f,g="_html5shiv",h=0,i={},j;(function(){try{var a=b.createElement("a");a.innerHTML="<xyz></xyz>",f="hidden"in a,j=a.childNodes.length==1||function(){b.createElement("a");var a=b.createDocumentFragment();return typeof a.cloneNode=="undefined"||typeof a.createDocumentFragment=="undefined"||typeof a.createElement=="undefined"}()}catch(c){f=!0,j=!0}})();var r={elements:c.elements||"abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video",shivCSS:c.shivCSS!==!1,supportsUnknownElements:j,shivMethods:c.shivMethods!==!1,type:"default",shivDocument:q,createElement:n,createDocumentFragment:o};a.html5=r,q(b)}(this,b),e._version=d,e._prefixes=l,e.testStyles=s,e}(this,this.document),function(a,b,c){function d(a){return"[object Function]"==o.call(a)}function e(a){return"string"==typeof a}function f(){}function g(a){return!a||"loaded"==a||"complete"==a||"uninitialized"==a}function h(){var a=p.shift();q=1,a?a.t?m(function(){("c"==a.t?B.injectCss:B.injectJs)(a.s,0,a.a,a.x,a.e,1)},0):(a(),h()):q=0}function i(a,c,d,e,f,i,j){function k(b){if(!o&&g(l.readyState)&&(u.r=o=1,!q&&h(),l.onload=l.onreadystatechange=null,b)){"img"!=a&&m(function(){t.removeChild(l)},50);for(var d in y[c])y[c].hasOwnProperty(d)&&y[c][d].onload()}}var j=j||B.errorTimeout,l=b.createElement(a),o=0,r=0,u={t:d,s:c,e:f,a:i,x:j};1===y[c]&&(r=1,y[c]=[]),"object"==a?l.data=c:(l.src=c,l.type=a),l.width=l.height="0",l.onerror=l.onload=l.onreadystatechange=function(){k.call(this,r)},p.splice(e,0,u),"img"!=a&&(r||2===y[c]?(t.insertBefore(l,s?null:n),m(k,j)):y[c].push(l))}function j(a,b,c,d,f){return q=0,b=b||"j",e(a)?i("c"==b?v:u,a,b,this.i++,c,d,f):(p.splice(this.i++,0,a),1==p.length&&h()),this}function k(){var a=B;return a.loader={load:j,i:0},a}var l=b.documentElement,m=a.setTimeout,n=b.getElementsByTagName("script")[0],o={}.toString,p=[],q=0,r="MozAppearance"in l.style,s=r&&!!b.createRange().compareNode,t=s?l:n.parentNode,l=a.opera&&"[object Opera]"==o.call(a.opera),l=!!b.attachEvent&&!l,u=r?"object":l?"script":"img",v=l?"script":u,w=Array.isArray||function(a){return"[object Array]"==o.call(a)},x=[],y={},z={timeout:function(a,b){return b.length&&(a.timeout=b[0]),a}},A,B;B=function(a){function b(a){var a=a.split("!"),b=x.length,c=a.pop(),d=a.length,c={url:c,origUrl:c,prefixes:a},e,f,g;for(f=0;f<d;f++)g=a[f].split("="),(e=z[g.shift()])&&(c=e(c,g));for(f=0;f<b;f++)c=x[f](c);return c}function g(a,e,f,g,h){var i=b(a),j=i.autoCallback;i.url.split(".").pop().split("?").shift(),i.bypass||(e&&(e=d(e)?e:e[a]||e[g]||e[a.split("/").pop().split("?")[0]]),i.instead?i.instead(a,e,f,g,h):(y[i.url]?i.noexec=!0:y[i.url]=1,f.load(i.url,i.forceCSS||!i.forceJS&&"css"==i.url.split(".").pop().split("?").shift()?"c":c,i.noexec,i.attrs,i.timeout),(d(e)||d(j))&&f.load(function(){k(),e&&e(i.origUrl,h,g),j&&j(i.origUrl,h,g),y[i.url]=2})))}function h(a,b){function c(a,c){if(a){if(e(a))c||(j=function(){var a=[].slice.call(arguments);k.apply(this,a),l()}),g(a,j,b,0,h);else if(Object(a)===a)for(n in m=function(){var b=0,c;for(c in a)a.hasOwnProperty(c)&&b++;return b}(),a)a.hasOwnProperty(n)&&(!c&&!--m&&(d(j)?j=function(){var a=[].slice.call(arguments);k.apply(this,a),l()}:j[n]=function(a){return function(){var b=[].slice.call(arguments);a&&a.apply(this,b),l()}}(k[n])),g(a[n],j,b,n,h))}else!c&&l()}var h=!!a.test,i=a.load||a.both,j=a.callback||f,k=j,l=a.complete||f,m,n;c(h?a.yep:a.nope,!!i),i&&c(i)}var i,j,l=this.yepnope.loader;if(e(a))g(a,0,l,0);else if(w(a))for(i=0;i<a.length;i++)j=a[i],e(j)?g(j,0,l,0):w(j)?B(j):Object(j)===j&&h(j,l);else Object(a)===a&&h(a,l)},B.addPrefix=function(a,b){z[a]=b},B.addFilter=function(a){x.push(a)},B.errorTimeout=1e4,null==b.readyState&&b.addEventListener&&(b.readyState="loading",b.addEventListener("DOMContentLoaded",A=function(){b.removeEventListener("DOMContentLoaded",A,0),b.readyState="complete"},0)),a.yepnope=k(),a.yepnope.executeStack=h,a.yepnope.injectJs=function(a,c,d,e,i,j){var k=b.createElement("script"),l,o,e=e||B.errorTimeout;k.src=a;for(o in d)k.setAttribute(o,d[o]);c=j?h:c||f,k.onreadystatechange=k.onload=function(){!l&&g(k.readyState)&&(l=1,c(),k.onload=k.onreadystatechange=null)},m(function(){l||(l=1,c(1))},e),i?k.onload():n.parentNode.insertBefore(k,n)},a.yepnope.injectCss=function(a,c,d,e,g,i){var e=b.createElement("link"),j,c=i?h:c||f;e.href=a,e.rel="stylesheet",e.type="text/css";for(j in d)e.setAttribute(j,d[j]);g||(n.parentNode.insertBefore(e,n),m(c,0))}}(this,document),Modernizr.load=function(){yepnope.apply(window,[].slice.call(arguments,0))};
@@ -0,0 +1,42 @@
1
+ $(document).ready(function() {
2
+ var switched = false;
3
+ var updateTables = function() {
4
+ if (($(window).width() < 767) && !switched ){
5
+ switched = true;
6
+ $("table.responsive").each(function(i, element) {
7
+ splitTable($(element));
8
+ });
9
+ return true;
10
+ }
11
+ else if (switched && ($(window).width() > 767)) {
12
+ switched = false;
13
+ $("table.responsive").each(function(i, element) {
14
+ unsplitTable($(element));
15
+ });
16
+ }
17
+ };
18
+
19
+ $(window).load(updateTables);
20
+ $(window).bind("resize", updateTables);
21
+
22
+
23
+ function splitTable(original)
24
+ {
25
+ original.wrap("<div class='table-wrapper' />");
26
+
27
+ var copy = original.clone();
28
+ copy.find("td:not(:first-child), th:not(:first-child)").css("display", "none");
29
+ copy.removeClass("responsive");
30
+
31
+ original.closest(".table-wrapper").append(copy);
32
+ copy.wrap("<div class='pinned' />");
33
+ original.wrap("<div class='scrollable' />");
34
+ }
35
+
36
+ function unsplitTable(original) {
37
+ original.closest(".table-wrapper").find(".pinned").remove();
38
+ original.unwrap();
39
+ original.unwrap();
40
+ }
41
+
42
+ });
@@ -0,0 +1,319 @@
1
+ //fgnass.github.com/spin.js#v1.2.6
2
+ !function(window, document, undefined) {
3
+
4
+ /**
5
+ * Copyright (c) 2011 Felix Gnass [fgnass at neteye dot de]
6
+ * Licensed under the MIT license
7
+ */
8
+
9
+ var prefixes = ['webkit', 'Moz', 'ms', 'O'] /* Vendor prefixes */
10
+ , animations = {} /* Animation rules keyed by their name */
11
+ , useCssAnimations
12
+
13
+ /**
14
+ * Utility function to create elements. If no tag name is given,
15
+ * a DIV is created. Optionally properties can be passed.
16
+ */
17
+ function createEl(tag, prop) {
18
+ var el = document.createElement(tag || 'div')
19
+ , n
20
+
21
+ for(n in prop) el[n] = prop[n]
22
+ return el
23
+ }
24
+
25
+ /**
26
+ * Appends children and returns the parent.
27
+ */
28
+ function ins(parent /* child1, child2, ...*/) {
29
+ for (var i=1, n=arguments.length; i<n; i++)
30
+ parent.appendChild(arguments[i])
31
+
32
+ return parent
33
+ }
34
+
35
+ /**
36
+ * Insert a new stylesheet to hold the @keyframe or VML rules.
37
+ */
38
+ var sheet = function() {
39
+ var el = createEl('style', {type : 'text/css'})
40
+ ins(document.getElementsByTagName('head')[0], el)
41
+ return el.sheet || el.styleSheet
42
+ }()
43
+
44
+ /**
45
+ * Creates an opacity keyframe animation rule and returns its name.
46
+ * Since most mobile Webkits have timing issues with animation-delay,
47
+ * we create separate rules for each line/segment.
48
+ */
49
+ function addAnimation(alpha, trail, i, lines) {
50
+ var name = ['opacity', trail, ~~(alpha*100), i, lines].join('-')
51
+ , start = 0.01 + i/lines*100
52
+ , z = Math.max(1 - (1-alpha) / trail * (100-start), alpha)
53
+ , prefix = useCssAnimations.substring(0, useCssAnimations.indexOf('Animation')).toLowerCase()
54
+ , pre = prefix && '-'+prefix+'-' || ''
55
+
56
+ if (!animations[name]) {
57
+ sheet.insertRule(
58
+ '@' + pre + 'keyframes ' + name + '{' +
59
+ '0%{opacity:' + z + '}' +
60
+ start + '%{opacity:' + alpha + '}' +
61
+ (start+0.01) + '%{opacity:1}' +
62
+ (start+trail) % 100 + '%{opacity:' + alpha + '}' +
63
+ '100%{opacity:' + z + '}' +
64
+ '}', sheet.cssRules.length)
65
+
66
+ animations[name] = 1
67
+ }
68
+ return name
69
+ }
70
+
71
+ /**
72
+ * Tries various vendor prefixes and returns the first supported property.
73
+ **/
74
+ function vendor(el, prop) {
75
+ var s = el.style
76
+ , pp
77
+ , i
78
+
79
+ if(s[prop] !== undefined) return prop
80
+ prop = prop.charAt(0).toUpperCase() + prop.slice(1)
81
+ for(i=0; i<prefixes.length; i++) {
82
+ pp = prefixes[i]+prop
83
+ if(s[pp] !== undefined) return pp
84
+ }
85
+ }
86
+
87
+ /**
88
+ * Sets multiple style properties at once.
89
+ */
90
+ function css(el, prop) {
91
+ for (var n in prop)
92
+ el.style[vendor(el, n)||n] = prop[n]
93
+
94
+ return el
95
+ }
96
+
97
+ /**
98
+ * Fills in default values.
99
+ */
100
+ function merge(obj) {
101
+ for (var i=1; i < arguments.length; i++) {
102
+ var def = arguments[i]
103
+ for (var n in def)
104
+ if (obj[n] === undefined) obj[n] = def[n]
105
+ }
106
+ return obj
107
+ }
108
+
109
+ /**
110
+ * Returns the absolute page-offset of the given element.
111
+ */
112
+ function pos(el) {
113
+ var o = { x:el.offsetLeft, y:el.offsetTop }
114
+ while((el = el.offsetParent))
115
+ o.x+=el.offsetLeft, o.y+=el.offsetTop
116
+
117
+ return o
118
+ }
119
+
120
+ var defaults = {
121
+ lines: 12, // The number of lines to draw
122
+ length: 7, // The length of each line
123
+ width: 5, // The line thickness
124
+ radius: 10, // The radius of the inner circle
125
+ rotate: 0, // Rotation offset
126
+ corners: 1, // Roundness (0..1)
127
+ color: '#000', // #rgb or #rrggbb
128
+ speed: 1, // Rounds per second
129
+ trail: 100, // Afterglow percentage
130
+ opacity: 1/4, // Opacity of the lines
131
+ fps: 20, // Frames per second when using setTimeout()
132
+ zIndex: 2e9, // Use a high z-index by default
133
+ className: 'spinner', // CSS class to assign to the element
134
+ top: 'auto', // center vertically
135
+ left: 'auto' // center horizontally
136
+ }
137
+
138
+ /** The constructor */
139
+ var Spinner = function Spinner(o) {
140
+ if (!this.spin) return new Spinner(o)
141
+ this.opts = merge(o || {}, Spinner.defaults, defaults)
142
+ }
143
+
144
+ Spinner.defaults = {}
145
+
146
+ merge(Spinner.prototype, {
147
+ spin: function(target) {
148
+ this.stop()
149
+ var self = this
150
+ , o = self.opts
151
+ , el = self.el = css(createEl(0, {className: o.className}), {position: 'relative', width: 0, zIndex: o.zIndex})
152
+ , mid = o.radius+o.length+o.width
153
+ , ep // element position
154
+ , tp // target position
155
+
156
+ if (target) {
157
+ target.insertBefore(el, target.firstChild||null)
158
+ tp = pos(target)
159
+ ep = pos(el)
160
+ css(el, {
161
+ left: (o.left == 'auto' ? tp.x-ep.x + (target.offsetWidth >> 1) : parseInt(o.left, 10) + mid) + 'px',
162
+ top: (o.top == 'auto' ? tp.y-ep.y + (target.offsetHeight >> 1) : parseInt(o.top, 10) + mid) + 'px'
163
+ })
164
+ }
165
+
166
+ el.setAttribute('aria-role', 'progressbar')
167
+ self.lines(el, self.opts)
168
+
169
+ if (!useCssAnimations) {
170
+ // No CSS animation support, use setTimeout() instead
171
+ var i = 0
172
+ , fps = o.fps
173
+ , f = fps/o.speed
174
+ , ostep = (1-o.opacity) / (f*o.trail / 100)
175
+ , astep = f/o.lines
176
+
177
+ ;(function anim() {
178
+ i++;
179
+ for (var s=o.lines; s; s--) {
180
+ var alpha = Math.max(1-(i+s*astep)%f * ostep, o.opacity)
181
+ self.opacity(el, o.lines-s, alpha, o)
182
+ }
183
+ self.timeout = self.el && setTimeout(anim, ~~(1000/fps))
184
+ })()
185
+ }
186
+ return self
187
+ },
188
+
189
+ stop: function() {
190
+ var el = this.el
191
+ if (el) {
192
+ clearTimeout(this.timeout)
193
+ if (el.parentNode) el.parentNode.removeChild(el)
194
+ this.el = undefined
195
+ }
196
+ return this
197
+ },
198
+
199
+ lines: function(el, o) {
200
+ var i = 0
201
+ , seg
202
+
203
+ function fill(color, shadow) {
204
+ return css(createEl(), {
205
+ position: 'absolute',
206
+ width: (o.length+o.width) + 'px',
207
+ height: o.width + 'px',
208
+ background: color,
209
+ boxShadow: shadow,
210
+ transformOrigin: 'left',
211
+ transform: 'rotate(' + ~~(360/o.lines*i+o.rotate) + 'deg) translate(' + o.radius+'px' +',0)',
212
+ borderRadius: (o.corners * o.width>>1) + 'px'
213
+ })
214
+ }
215
+
216
+ for (; i < o.lines; i++) {
217
+ seg = css(createEl(), {
218
+ position: 'absolute',
219
+ top: 1+~(o.width/2) + 'px',
220
+ transform: o.hwaccel ? 'translate3d(0,0,0)' : '',
221
+ opacity: o.opacity,
222
+ animation: useCssAnimations && addAnimation(o.opacity, o.trail, i, o.lines) + ' ' + 1/o.speed + 's linear infinite'
223
+ })
224
+
225
+ if (o.shadow) ins(seg, css(fill('#000', '0 0 4px ' + '#000'), {top: 2+'px'}))
226
+
227
+ ins(el, ins(seg, fill(o.color, '0 0 1px rgba(0,0,0,.1)')))
228
+ }
229
+ return el
230
+ },
231
+
232
+ opacity: function(el, i, val) {
233
+ if (i < el.childNodes.length) el.childNodes[i].style.opacity = val
234
+ }
235
+
236
+ })
237
+
238
+ /////////////////////////////////////////////////////////////////////////
239
+ // VML rendering for IE
240
+ /////////////////////////////////////////////////////////////////////////
241
+
242
+ /**
243
+ * Check and init VML support
244
+ */
245
+ ;(function() {
246
+
247
+ function vml(tag, attr) {
248
+ return createEl('<' + tag + ' xmlns="urn:schemas-microsoft.com:vml" class="spin-vml">', attr)
249
+ }
250
+
251
+ var s = css(createEl('group'), {behavior: 'url(#default#VML)'})
252
+
253
+ if (!vendor(s, 'transform') && s.adj) {
254
+
255
+ // VML support detected. Insert CSS rule ...
256
+ sheet.addRule('.spin-vml', 'behavior:url(#default#VML)')
257
+
258
+ Spinner.prototype.lines = function(el, o) {
259
+ var r = o.length+o.width
260
+ , s = 2*r
261
+
262
+ function grp() {
263
+ return css(
264
+ vml('group', {
265
+ coordsize: s + ' ' + s,
266
+ coordorigin: -r + ' ' + -r
267
+ }),
268
+ { width: s, height: s }
269
+ )
270
+ }
271
+
272
+ var margin = -(o.width+o.length)*2 + 'px'
273
+ , g = css(grp(), {position: 'absolute', top: margin, left: margin})
274
+ , i
275
+
276
+ function seg(i, dx, filter) {
277
+ ins(g,
278
+ ins(css(grp(), {rotation: 360 / o.lines * i + 'deg', left: ~~dx}),
279
+ ins(css(vml('roundrect', {arcsize: o.corners}), {
280
+ width: r,
281
+ height: o.width,
282
+ left: o.radius,
283
+ top: -o.width>>1,
284
+ filter: filter
285
+ }),
286
+ vml('fill', {color: o.color, opacity: o.opacity}),
287
+ vml('stroke', {opacity: 0}) // transparent stroke to fix color bleeding upon opacity change
288
+ )
289
+ )
290
+ )
291
+ }
292
+
293
+ if (o.shadow)
294
+ for (i = 1; i <= o.lines; i++)
295
+ seg(i, -2, 'progid:DXImageTransform.Microsoft.Blur(pixelradius=2,makeshadow=1,shadowopacity=.3)')
296
+
297
+ for (i = 1; i <= o.lines; i++) seg(i)
298
+ return ins(el, g)
299
+ }
300
+
301
+ Spinner.prototype.opacity = function(el, i, val, o) {
302
+ var c = el.firstChild
303
+ o = o.shadow && o.lines || 0
304
+ if (c && i+o < c.childNodes.length) {
305
+ c = c.childNodes[i+o]; c = c && c.firstChild; c = c && c.firstChild
306
+ if (c) c.opacity = val
307
+ }
308
+ }
309
+ }
310
+ else
311
+ useCssAnimations = vendor(s, 'animation')
312
+ })()
313
+
314
+ if (typeof define == 'function' && define.amd)
315
+ define(function() { return Spinner })
316
+ else
317
+ window.Spinner = Spinner
318
+
319
+ }(window, document)
@@ -0,0 +1,233 @@
1
+ /**!
2
+ * trunk8 v1.2.3
3
+ * https://github.com/rviscomi/trunk8
4
+ *
5
+ * Copyright 2012 Rick Viscomi
6
+ * Released under the MIT License.
7
+ *
8
+ * Date: September 9, 2012
9
+ */
10
+
11
+ (function ($) {
12
+ var methods,
13
+ utils,
14
+ SIDES = {
15
+ /* cen...ter */
16
+ center: 'center',
17
+ /* ...left */
18
+ left: 'left',
19
+ /* right... */
20
+ right: 'right'
21
+ },
22
+ WIDTH = {
23
+ auto: 'auto'
24
+ },
25
+ settings = {
26
+ fill: '&hellip;',
27
+ lines: 1,
28
+ side: SIDES.right,
29
+ tooltip: true,
30
+ width: WIDTH.auto
31
+ };
32
+
33
+ function truncate() {
34
+ var width = settings.width,
35
+ side = settings.side,
36
+ fill = settings.fill,
37
+ line_height = utils.getLineHeight(this) * settings.lines,
38
+ str = this.data('trunk8') || this.text(),
39
+ length = str.length,
40
+ max_bite = '',
41
+ lower, upper,
42
+ bite_size,
43
+ bite;
44
+
45
+ /* Reset the field to the original string. */
46
+ this.html(str).data('trunk8', str);
47
+
48
+ if (width === WIDTH.auto) {
49
+ /* Assuming there is no "overflow: hidden". */
50
+ if (this.height() <= line_height) {
51
+ /* Text is already at the optimal trunkage. */
52
+ return;
53
+ }
54
+
55
+ /* Binary search technique for finding the optimal trunkage. */
56
+ /* Find the maximum bite without overflowing. */
57
+ lower = 0;
58
+ upper = length - 1;
59
+
60
+ while (lower <= upper) {
61
+ bite_size = lower + ((upper - lower) >> 1);
62
+
63
+ bite = utils.eatStr(str, side, length - bite_size, fill);
64
+
65
+ this.html(bite);
66
+
67
+ /* Check for overflow. */
68
+ if (this.height() > line_height) {
69
+ upper = bite_size - 1;
70
+ }
71
+ else {
72
+ lower = bite_size + 1;
73
+
74
+ /* Save the bigger bite. */
75
+ max_bite = (max_bite.length > bite.length) ? max_bite : bite;
76
+ }
77
+ }
78
+
79
+ /* Reset the content to eliminate possible existing scroll bars. */
80
+ this.html('');
81
+
82
+ /* Display the biggest bite. */
83
+ this.html(max_bite);
84
+
85
+ if (settings.tooltip) {
86
+ this.attr('title', str);
87
+ }
88
+ }
89
+ else if (!isNaN(width)) {
90
+ bite_size = length - width;
91
+
92
+ bite = utils.eatStr(str, side, bite_size, fill);
93
+
94
+ this.html(bite);
95
+
96
+ if (settings.tooltip) {
97
+ this.attr('title', str);
98
+ }
99
+ }
100
+ else {
101
+ $.error('Invalid width "' + width + '".');
102
+ }
103
+ }
104
+
105
+ methods = {
106
+ init: function (options) {
107
+ settings = $.extend(settings, options);
108
+
109
+ return this.each(function () {
110
+ truncate.call($(this));
111
+ });
112
+ },
113
+
114
+ /** Updates the text value of the elements while maintaining truncation. */
115
+ update: function (new_string) {
116
+ return this.each(function () {
117
+ /* Update text. */
118
+ if (new_string) {
119
+ $(this).data('trunk8', new_string);
120
+ }
121
+
122
+ /* Truncate accordingly. */
123
+ truncate.call($(this));
124
+ });
125
+ },
126
+
127
+ revert: function () {
128
+ return this.each(function () {
129
+ /* Get original text. */
130
+ var text = $(this).data('trunk8');
131
+
132
+ /* Revert element to original text. */
133
+ $(this).html(text);
134
+ });
135
+ },
136
+
137
+ /** Returns this instance's settings object. NOT CHAINABLE. */
138
+ getSettings: function () {
139
+ return settings;
140
+ }
141
+ };
142
+
143
+ utils = {
144
+ /** Replaces [bite_size] [side]-most chars in [str] with [fill]. */
145
+ eatStr: function (str, side, bite_size, fill) {
146
+ var length = str.length,
147
+ key = utils.eatStr.generateKey.apply(null, arguments),
148
+ half_length,
149
+ half_bite_size;
150
+
151
+ /* If the result is already in the cache, return it. */
152
+ if (utils.eatStr.cache[key]) {
153
+ return utils.eatStr.cache[key];
154
+ }
155
+
156
+ /* Common error handling. */
157
+ if ((typeof str !== 'string') || (length === 0)) {
158
+ $.error('Invalid source string "' + str + '".');
159
+ }
160
+ if ((bite_size < 0) || (bite_size > length)) {
161
+ $.error('Invalid bite size "' + bite_size + '".');
162
+ }
163
+ else if (bite_size === 0) {
164
+ /* No bite should show no truncation. */
165
+ return str;
166
+ }
167
+ if (typeof (fill + '') !== 'string') {
168
+ $.error('Fill unable to be converted to a string.');
169
+ }
170
+
171
+ /* Compute the result, store it in the cache, and return it. */
172
+ switch (side) {
173
+ case SIDES.right:
174
+ /* str... */
175
+ return utils.eatStr.cache[key] =
176
+ $.trim(str.substr(0, length - bite_size)) + fill;
177
+
178
+ case SIDES.left:
179
+ /* ...str */
180
+ return utils.eatStr.cache[key] =
181
+ fill + $.trim(str.substr(bite_size));
182
+
183
+ case SIDES.center:
184
+ /* Bit-shift to the right by one === Math.floor(x / 2) */
185
+ half_length = length >> 1; // halve the length
186
+ half_bite_size = bite_size >> 1; // halve the bite_size
187
+
188
+ /* st...r */
189
+ return utils.eatStr.cache[key] =
190
+ $.trim(utils.eatStr(str.substr(0, length - half_length), SIDES.right, bite_size - half_bite_size, '')) +
191
+ fill +
192
+ $.trim(utils.eatStr(str.substr(length - half_length), SIDES.left, half_bite_size, ''));
193
+
194
+ default:
195
+ $.error('Invalid side "' + side + '".');
196
+ }
197
+ },
198
+
199
+ getLineHeight: function (elem) {
200
+ var html = $(elem).html(),
201
+ wrapper_id = 'line-height-test',
202
+ line_height;
203
+
204
+ /* Set the content to a small single character and wrap. */
205
+ $(elem).html('i').wrap('<div id="' + wrapper_id + '" />');
206
+
207
+ /* Calculate the line height by measuring the wrapper.*/
208
+ line_height = $('#' + wrapper_id).innerHeight();
209
+
210
+ /* Remove the wrapper and reset the content. */
211
+ $(elem).html(html).unwrap();
212
+
213
+ return line_height;
214
+ }
215
+ };
216
+
217
+ utils.eatStr.cache = {};
218
+ utils.eatStr.generateKey = function () {
219
+ return Array.prototype.join.call(arguments, '');
220
+ };
221
+
222
+ $.fn.trunk8 = function (method) {
223
+ if (methods[method]) {
224
+ return methods[method].apply(this, Array.prototype.slice.call(arguments, 1));
225
+ }
226
+ else if (typeof method === 'object' || !method) {
227
+ return methods.init.apply(this, arguments);
228
+ }
229
+ else {
230
+ $.error('Method ' + method + ' does not exist on jQuery.trunk8');
231
+ }
232
+ };
233
+ })(jQuery);