abstracted 0.0.6 → 0.0.14

Sign up to get free protection for your applications and to get access to all the features.
Files changed (224) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +1 -1
  3. data/Gemfile.lock +11 -8
  4. data/app/assets/javascripts/abstract_resources.js +29 -25
  5. data/app/assets/javascripts/crud.js.coffee +174 -29
  6. data/app/assets/javascripts/initializers.js.coffee +403 -58
  7. data/app/assets/javascripts/pagescrolling.js.coffee +92 -0
  8. data/app/assets/stylesheets/abstract_resources.css +5 -0
  9. data/app/assets/stylesheets/scaffold.css +4 -2
  10. data/app/assets/stylesheets/selectize.css.scss +0 -0
  11. data/app/controllers/abstract_resources_controller.rb +473 -134
  12. data/app/controllers/application_controller.rb +22 -7
  13. data/app/helpers/abstract_resources_helper.rb +515 -9
  14. data/app/helpers/fab_button_helper.rb +82 -0
  15. data/app/models/abstract_resource.rb +141 -89
  16. data/app/models/ancestry_abstract_resource.rb +27 -0
  17. data/app/models/concerns/roleable.rb +1 -1
  18. data/app/policies/abstract_resource_policy.rb +25 -0
  19. data/app/views/abstract_resources/_title.html.haml +2 -0
  20. data/app/views/abstract_resources/activate.html.haml +5 -0
  21. data/app/views/abstract_resources/attach.html.haml +6 -0
  22. data/app/views/abstract_resources/deactivate.html.haml +5 -0
  23. data/app/views/abstract_resources/defer.html.haml +5 -0
  24. data/app/views/abstract_resources/destroy.js.haml +2 -1
  25. data/app/views/abstract_resources/detach.html.haml +5 -0
  26. data/app/views/abstract_resources/edit.html.haml +4 -9
  27. data/app/views/abstract_resources/error.html.haml +2 -0
  28. data/app/views/abstract_resources/error.js.haml +2 -0
  29. data/app/views/abstract_resources/index.html.haml +27 -0
  30. data/app/views/abstract_resources/index.js.haml +2 -0
  31. data/app/views/abstract_resources/new.html.haml +4 -10
  32. data/app/views/abstract_resources/prefer.html.haml +5 -0
  33. data/app/views/abstract_resources/print.html.haml +2 -0
  34. data/app/views/abstract_resources/print.js.haml +2 -0
  35. data/app/views/abstract_resources/show.html.haml +5 -11
  36. data/app/views/layouts/_messages.html.haml +1 -0
  37. data/app/views/layouts/_navigation.html.haml +13 -0
  38. data/bower.json +34 -0
  39. data/config/initializers/exception.rb +19 -0
  40. data/config/initializers/pundit.rb +22 -0
  41. data/config/routes.rb +24 -0
  42. data/lib/abstracted.rb +3 -0
  43. data/lib/abstracted/version.rb +1 -1
  44. data/lib/abstracted_responder.rb +1 -0
  45. data/lib/exceptions.rb +61 -0
  46. data/vendor/assets/components/jquery/.bower.json +38 -0
  47. data/vendor/assets/components/jquery/MIT-LICENSE.txt +21 -0
  48. data/vendor/assets/components/jquery/bower.json +28 -0
  49. data/vendor/assets/components/jquery/dist/jquery.js +9210 -0
  50. data/vendor/assets/components/jquery/dist/jquery.min.js +5 -0
  51. data/vendor/assets/components/jquery/dist/jquery.min.map +1 -0
  52. data/vendor/assets/components/jquery/src/ajax.js +786 -0
  53. data/vendor/assets/components/jquery/src/ajax/jsonp.js +89 -0
  54. data/vendor/assets/components/jquery/src/ajax/load.js +75 -0
  55. data/vendor/assets/components/jquery/src/ajax/parseJSON.js +13 -0
  56. data/vendor/assets/components/jquery/src/ajax/parseXML.js +28 -0
  57. data/vendor/assets/components/jquery/src/ajax/script.js +64 -0
  58. data/vendor/assets/components/jquery/src/ajax/var/nonce.js +5 -0
  59. data/vendor/assets/components/jquery/src/ajax/var/rquery.js +3 -0
  60. data/vendor/assets/components/jquery/src/ajax/xhr.js +136 -0
  61. data/vendor/assets/components/jquery/src/attributes.js +11 -0
  62. data/vendor/assets/components/jquery/src/attributes/attr.js +141 -0
  63. data/vendor/assets/components/jquery/src/attributes/classes.js +158 -0
  64. data/vendor/assets/components/jquery/src/attributes/prop.js +94 -0
  65. data/vendor/assets/components/jquery/src/attributes/support.js +35 -0
  66. data/vendor/assets/components/jquery/src/attributes/val.js +161 -0
  67. data/vendor/assets/components/jquery/src/callbacks.js +205 -0
  68. data/vendor/assets/components/jquery/src/core.js +502 -0
  69. data/vendor/assets/components/jquery/src/core/access.js +60 -0
  70. data/vendor/assets/components/jquery/src/core/init.js +123 -0
  71. data/vendor/assets/components/jquery/src/core/parseHTML.js +39 -0
  72. data/vendor/assets/components/jquery/src/core/ready.js +97 -0
  73. data/vendor/assets/components/jquery/src/core/var/rsingleTag.js +4 -0
  74. data/vendor/assets/components/jquery/src/css.js +450 -0
  75. data/vendor/assets/components/jquery/src/css/addGetHookIf.js +22 -0
  76. data/vendor/assets/components/jquery/src/css/curCSS.js +57 -0
  77. data/vendor/assets/components/jquery/src/css/defaultDisplay.js +70 -0
  78. data/vendor/assets/components/jquery/src/css/hiddenVisibleSelectors.js +15 -0
  79. data/vendor/assets/components/jquery/src/css/support.js +96 -0
  80. data/vendor/assets/components/jquery/src/css/swap.js +28 -0
  81. data/vendor/assets/components/jquery/src/css/var/cssExpand.js +3 -0
  82. data/vendor/assets/components/jquery/src/css/var/getStyles.js +12 -0
  83. data/vendor/assets/components/jquery/src/css/var/isHidden.js +13 -0
  84. data/vendor/assets/components/jquery/src/css/var/rmargin.js +3 -0
  85. data/vendor/assets/components/jquery/src/css/var/rnumnonpx.js +5 -0
  86. data/vendor/assets/components/jquery/src/data.js +178 -0
  87. data/vendor/assets/components/jquery/src/data/Data.js +181 -0
  88. data/vendor/assets/components/jquery/src/data/accepts.js +20 -0
  89. data/vendor/assets/components/jquery/src/data/var/data_priv.js +5 -0
  90. data/vendor/assets/components/jquery/src/data/var/data_user.js +5 -0
  91. data/vendor/assets/components/jquery/src/deferred.js +149 -0
  92. data/vendor/assets/components/jquery/src/deprecated.js +13 -0
  93. data/vendor/assets/components/jquery/src/dimensions.js +50 -0
  94. data/vendor/assets/components/jquery/src/effects.js +648 -0
  95. data/vendor/assets/components/jquery/src/effects/Tween.js +114 -0
  96. data/vendor/assets/components/jquery/src/effects/animatedSelector.js +13 -0
  97. data/vendor/assets/components/jquery/src/event.js +868 -0
  98. data/vendor/assets/components/jquery/src/event/ajax.js +13 -0
  99. data/vendor/assets/components/jquery/src/event/alias.js +39 -0
  100. data/vendor/assets/components/jquery/src/event/support.js +9 -0
  101. data/vendor/assets/components/jquery/src/exports/amd.js +24 -0
  102. data/vendor/assets/components/jquery/src/exports/global.js +32 -0
  103. data/vendor/assets/components/jquery/src/intro.js +44 -0
  104. data/vendor/assets/components/jquery/src/jquery.js +37 -0
  105. data/vendor/assets/components/jquery/src/manipulation.js +580 -0
  106. data/vendor/assets/components/jquery/src/manipulation/_evalUrl.js +18 -0
  107. data/vendor/assets/components/jquery/src/manipulation/support.js +32 -0
  108. data/vendor/assets/components/jquery/src/manipulation/var/rcheckableType.js +3 -0
  109. data/vendor/assets/components/jquery/src/offset.js +207 -0
  110. data/vendor/assets/components/jquery/src/outro.js +1 -0
  111. data/vendor/assets/components/jquery/src/queue.js +142 -0
  112. data/vendor/assets/components/jquery/src/queue/delay.js +22 -0
  113. data/vendor/assets/components/jquery/src/selector-native.js +172 -0
  114. data/vendor/assets/components/jquery/src/selector-sizzle.js +14 -0
  115. data/vendor/assets/components/jquery/src/selector.js +1 -0
  116. data/vendor/assets/components/jquery/src/serialize.js +111 -0
  117. data/vendor/assets/components/jquery/src/sizzle/dist/sizzle.js +2067 -0
  118. data/vendor/assets/components/jquery/src/sizzle/dist/sizzle.min.js +3 -0
  119. data/vendor/assets/components/jquery/src/sizzle/dist/sizzle.min.map +1 -0
  120. data/vendor/assets/components/jquery/src/traversing.js +199 -0
  121. data/vendor/assets/components/jquery/src/traversing/findFilter.js +100 -0
  122. data/vendor/assets/components/jquery/src/traversing/var/rneedsContext.js +6 -0
  123. data/vendor/assets/components/jquery/src/var/arr.js +3 -0
  124. data/vendor/assets/components/jquery/src/var/class2type.js +4 -0
  125. data/vendor/assets/components/jquery/src/var/concat.js +5 -0
  126. data/vendor/assets/components/jquery/src/var/hasOwn.js +5 -0
  127. data/vendor/assets/components/jquery/src/var/indexOf.js +5 -0
  128. data/vendor/assets/components/jquery/src/var/pnum.js +3 -0
  129. data/vendor/assets/components/jquery/src/var/push.js +5 -0
  130. data/vendor/assets/components/jquery/src/var/rnotwhite.js +3 -0
  131. data/vendor/assets/components/jquery/src/var/slice.js +5 -0
  132. data/vendor/assets/components/jquery/src/var/strundefined.js +3 -0
  133. data/vendor/assets/components/jquery/src/var/support.js +4 -0
  134. data/vendor/assets/components/jquery/src/var/toString.js +5 -0
  135. data/vendor/assets/components/jquery/src/wrap.js +79 -0
  136. data/vendor/assets/components/microplugin/.bower.json +38 -0
  137. data/vendor/assets/components/microplugin/.gitignore +2 -0
  138. data/vendor/assets/components/microplugin/.npmignore +3 -0
  139. data/vendor/assets/components/microplugin/README.md +115 -0
  140. data/vendor/assets/components/microplugin/bower.json +22 -0
  141. data/vendor/assets/components/microplugin/package.json +15 -0
  142. data/vendor/assets/components/microplugin/src/microplugin.js +135 -0
  143. data/vendor/assets/components/selectize/.bower.json +60 -0
  144. data/vendor/assets/components/selectize/.gitignore +5 -0
  145. data/vendor/assets/components/selectize/LICENSE +202 -0
  146. data/vendor/assets/components/selectize/README.md +105 -0
  147. data/vendor/assets/components/selectize/bower.json +40 -0
  148. data/vendor/assets/components/selectize/dist/css/selectize.bootstrap2.css +487 -0
  149. data/vendor/assets/components/selectize/dist/css/selectize.bootstrap3.css +401 -0
  150. data/vendor/assets/components/selectize/dist/css/selectize.css +317 -0
  151. data/vendor/assets/components/selectize/dist/css/selectize.default.css +387 -0
  152. data/vendor/assets/components/selectize/dist/css/selectize.legacy.css +364 -0
  153. data/vendor/assets/components/selectize/dist/js/selectize.js +3058 -0
  154. data/vendor/assets/components/selectize/dist/js/selectize.min.js +3 -0
  155. data/vendor/assets/components/selectize/dist/js/standalone/selectize.js +3667 -0
  156. data/vendor/assets/components/selectize/dist/js/standalone/selectize.min.js +3 -0
  157. data/vendor/assets/components/selectize/dist/less/plugins/drag_drop.less +16 -0
  158. data/vendor/assets/components/selectize/dist/less/plugins/dropdown_header.less +20 -0
  159. data/vendor/assets/components/selectize/dist/less/plugins/optgroup_columns.less +17 -0
  160. data/vendor/assets/components/selectize/dist/less/plugins/remove_button.less +37 -0
  161. data/vendor/assets/components/selectize/dist/less/selectize.bootstrap2.less +161 -0
  162. data/vendor/assets/components/selectize/dist/less/selectize.bootstrap3.less +150 -0
  163. data/vendor/assets/components/selectize/dist/less/selectize.default.less +84 -0
  164. data/vendor/assets/components/selectize/dist/less/selectize.legacy.less +75 -0
  165. data/vendor/assets/components/selectize/dist/less/selectize.less +295 -0
  166. data/vendor/assets/components/selectize/karma.conf.js +107 -0
  167. data/vendor/assets/components/sifter/.bower.json +44 -0
  168. data/vendor/assets/components/sifter/.gitignore +3 -0
  169. data/vendor/assets/components/sifter/.npmignore +4 -0
  170. data/vendor/assets/components/sifter/README.md +149 -0
  171. data/vendor/assets/components/sifter/bower.json +23 -0
  172. data/vendor/assets/components/sifter/package.json +48 -0
  173. data/vendor/assets/components/sifter/sifter.js +471 -0
  174. data/vendor/assets/components/sifter/sifter.min.js +2 -0
  175. data/vendor/assets/components/sweetalert/.bower.json +36 -0
  176. data/vendor/assets/components/sweetalert/.editorconfig +11 -0
  177. data/vendor/assets/components/sweetalert/.gitignore +5 -0
  178. data/vendor/assets/components/sweetalert/.jshintrc +11 -0
  179. data/vendor/assets/components/sweetalert/.travis.yml +6 -0
  180. data/vendor/assets/components/sweetalert/LICENSE +22 -0
  181. data/vendor/assets/components/sweetalert/README.md +157 -0
  182. data/vendor/assets/components/sweetalert/bower.json +25 -0
  183. data/vendor/assets/components/sweetalert/dev/gulpfile-wrap-template.js +18 -0
  184. data/vendor/assets/components/sweetalert/dev/ie9.css +23 -0
  185. data/vendor/assets/components/sweetalert/dev/loader-animation.css +209 -0
  186. data/vendor/assets/components/sweetalert/dev/modules/default-params.js +26 -0
  187. data/vendor/assets/components/sweetalert/dev/modules/handle-click.js +128 -0
  188. data/vendor/assets/components/sweetalert/dev/modules/handle-dom.js +161 -0
  189. data/vendor/assets/components/sweetalert/dev/modules/handle-key.js +73 -0
  190. data/vendor/assets/components/sweetalert/dev/modules/handle-swal-dom.js +148 -0
  191. data/vendor/assets/components/sweetalert/dev/modules/injected-html.js +69 -0
  192. data/vendor/assets/components/sweetalert/dev/modules/set-params.js +221 -0
  193. data/vendor/assets/components/sweetalert/dev/modules/utils.js +71 -0
  194. data/vendor/assets/components/sweetalert/dev/sweetalert.es6.js +311 -0
  195. data/vendor/assets/components/sweetalert/dev/sweetalert.scss +648 -0
  196. data/vendor/assets/components/sweetalert/dist/sweetalert-dev.js +1281 -0
  197. data/vendor/assets/components/sweetalert/dist/sweetalert.css +932 -0
  198. data/vendor/assets/components/sweetalert/dist/sweetalert.min.js +1 -0
  199. data/vendor/assets/components/sweetalert/example/example.css +442 -0
  200. data/vendor/assets/components/sweetalert/example/example.scss +580 -0
  201. data/vendor/assets/components/sweetalert/example/images/logo_big.png +0 -0
  202. data/vendor/assets/components/sweetalert/example/images/logo_big@2x.png +0 -0
  203. data/vendor/assets/components/sweetalert/example/images/logo_small.png +0 -0
  204. data/vendor/assets/components/sweetalert/example/images/logo_small@2x.png +0 -0
  205. data/vendor/assets/components/sweetalert/example/images/te-logo-small.svg +12 -0
  206. data/vendor/assets/components/sweetalert/example/images/thumbs-up.jpg +0 -0
  207. data/vendor/assets/components/sweetalert/example/images/vs_icon.png +0 -0
  208. data/vendor/assets/components/sweetalert/example/images/vs_icon@2x.png +0 -0
  209. data/vendor/assets/components/sweetalert/gulpfile.js +97 -0
  210. data/vendor/assets/components/sweetalert/index.html +584 -0
  211. data/vendor/assets/components/sweetalert/package.json +45 -0
  212. data/vendor/assets/components/sweetalert/sweetalert.gif +0 -0
  213. data/vendor/assets/components/sweetalert/test/index.html +20 -0
  214. data/vendor/assets/components/sweetalert/test/tests.js +143 -0
  215. data/vendor/assets/components/sweetalert/themes/facebook/facebook.css +111 -0
  216. data/vendor/assets/components/sweetalert/themes/facebook/facebook.scss +146 -0
  217. data/vendor/assets/components/sweetalert/themes/google/google.css +115 -0
  218. data/vendor/assets/components/sweetalert/themes/google/google.scss +148 -0
  219. data/vendor/assets/components/sweetalert/themes/twitter/twitter.css +140 -0
  220. data/vendor/assets/components/sweetalert/themes/twitter/twitter.scss +177 -0
  221. metadata +214 -5
  222. data/abstracted-0.0.4.gem +0 -0
  223. data/abstracted.gemspec +0 -51
  224. data/app/views/abstract_resources/index.html.erb +0 -1
@@ -0,0 +1,2 @@
1
+ /*! sifter.js | https://github.com/brianreavis/sifter.js | Apache License (v2) */
2
+ (function(r,t){if(typeof define==="function"&&define.amd){define(t)}else if(typeof exports==="object"){module.exports=t()}else{r.Sifter=t()}})(this,function(){var r=function(r,t){this.items=r;this.settings=t||{diacritics:true}};r.prototype.tokenize=function(r){r=n(String(r||"").toLowerCase());if(!r||!r.length)return[];var t,e,o,u;var s=[];var a=r.split(/ +/);for(t=0,e=a.length;t<e;t++){o=i(a[t]);if(this.settings.diacritics){for(u in f){if(f.hasOwnProperty(u)){o=o.replace(new RegExp(u,"g"),f[u])}}}s.push({string:a[t],regex:new RegExp(o,"i")})}return s};r.prototype.iterator=function(r,t){var e;if(o(r)){e=Array.prototype.forEach||function(r){for(var t=0,e=this.length;t<e;t++){r(this[t],t,this)}}}else{e=function(r){for(var t in this){if(this.hasOwnProperty(t)){r(this[t],t,this)}}}}e.apply(r,[t])};r.prototype.getScoreFunction=function(r,t){var e,n,i,o;e=this;r=e.prepareSearch(r,t);i=r.tokens;n=r.options.fields;o=i.length;var f=function(r,t){var e,n;if(!r)return 0;r=String(r||"");n=r.search(t.regex);if(n===-1)return 0;e=t.string.length/r.length;if(n===0)e+=.5;return e};var u=function(){var r=n.length;if(!r){return function(){return 0}}if(r===1){return function(r,t){return f(t[n[0]],r)}}return function(t,e){for(var i=0,o=0;i<r;i++){o+=f(e[n[i]],t)}return o/r}}();if(!o){return function(){return 0}}if(o===1){return function(r){return u(i[0],r)}}if(r.options.conjunction==="and"){return function(r){var t;for(var e=0,n=0;e<o;e++){t=u(i[e],r);if(t<=0)return 0;n+=t}return n/o}}else{return function(r){for(var t=0,e=0;t<o;t++){e+=u(i[t],r)}return e/o}}};r.prototype.getSortFunction=function(r,e){var n,i,o,f,u,s,a,c,p,l,h;o=this;r=o.prepareSearch(r,e);h=!r.query&&e.sort_empty||e.sort;p=function(r,t){if(r==="$score")return t.score;return o.items[t.id][r]};u=[];if(h){for(n=0,i=h.length;n<i;n++){if(r.query||h[n].field!=="$score"){u.push(h[n])}}}if(r.query){l=true;for(n=0,i=u.length;n<i;n++){if(u[n].field==="$score"){l=false;break}}if(l){u.unshift({field:"$score",direction:"desc"})}}else{for(n=0,i=u.length;n<i;n++){if(u[n].field==="$score"){u.splice(n,1);break}}}c=[];for(n=0,i=u.length;n<i;n++){c.push(u[n].direction==="desc"?-1:1)}s=u.length;if(!s){return null}else if(s===1){f=u[0].field;a=c[0];return function(r,e){return a*t(p(f,r),p(f,e))}}else{return function(r,e){var n,i,o,f,a;for(n=0;n<s;n++){a=u[n].field;i=c[n]*t(p(a,r),p(a,e));if(i)return i}return 0}}};r.prototype.prepareSearch=function(r,t){if(typeof r==="object")return r;t=e({},t);var n=t.fields;var i=t.sort;var f=t.sort_empty;if(n&&!o(n))t.fields=[n];if(i&&!o(i))t.sort=[i];if(f&&!o(f))t.sort_empty=[f];return{options:t,query:String(r||"").toLowerCase(),tokens:this.tokenize(r),total:0,items:[]}};r.prototype.search=function(r,t){var e=this,n,i,o,f;var u;var s;o=this.prepareSearch(r,t);t=o.options;r=o.query;s=t.score||e.getScoreFunction(o);if(r.length){e.iterator(e.items,function(r,e){i=s(r);if(t.filter===false||i>0){o.items.push({score:i,id:e})}})}else{e.iterator(e.items,function(r,t){o.items.push({score:1,id:t})})}u=e.getSortFunction(o,t);if(u)o.items.sort(u);o.total=o.items.length;if(typeof t.limit==="number"){o.items=o.items.slice(0,t.limit)}return o};var t=function(r,t){if(typeof r==="number"&&typeof t==="number"){return r>t?1:r<t?-1:0}r=u(String(r||""));t=u(String(t||""));if(r>t)return 1;if(t>r)return-1;return 0};var e=function(r,t){var e,n,i,o;for(e=1,n=arguments.length;e<n;e++){o=arguments[e];if(!o)continue;for(i in o){if(o.hasOwnProperty(i)){r[i]=o[i]}}}return r};var n=function(r){return(r+"").replace(/^\s+|\s+$|/g,"")};var i=function(r){return(r+"").replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1")};var o=Array.isArray||$&&$.isArray||function(r){return Object.prototype.toString.call(r)==="[object Array]"};var f={a:"[a\xc0\xc1\xc2\xc3\xc4\xc5\xe0\xe1\xe2\xe3\xe4\xe5\u0100\u0101\u0105\u0104]",c:"[c\xc7\xe7\u0107\u0106\u010d\u010c]",d:"[d\u0111\u0110\u010f\u010e]",e:"[e\xc8\xc9\xca\xcb\xe8\xe9\xea\xeb\u011b\u011a\u0112\u0113\u0119\u0118]",i:"[i\xcc\xcd\xce\xcf\xec\xed\xee\xef\u012a\u012b]",l:"[l\u0142\u0141]",n:"[n\xd1\xf1\u0148\u0147\u0144\u0143]",o:"[o\xd2\xd3\xd4\xd5\xd5\xd6\xd8\xf2\xf3\xf4\xf5\xf6\xf8\u014c\u014d]",r:"[r\u0159\u0158]",s:"[s\u0160\u0161\u015b\u015a]",t:"[t\u0165\u0164]",u:"[u\xd9\xda\xdb\xdc\xf9\xfa\xfb\xfc\u016f\u016e\u016a\u016b]",y:"[y\u0178\xff\xfd\xdd]",z:"[z\u017d\u017e\u017c\u017b\u017a\u0179]"};var u=function(){var r,t,e,n;var i="";var o={};for(e in f){if(f.hasOwnProperty(e)){n=f[e].substring(2,f[e].length-1);i+=n;for(r=0,t=n.length;r<t;r++){o[n.charAt(r)]=e}}}var u=new RegExp("["+i+"]","g");return function(r){return r.replace(u,function(r){return o[r]}).toLowerCase()}}();return r});
@@ -0,0 +1,36 @@
1
+ {
2
+ "name": "sweetalert",
3
+ "homepage": "http://tristanedwards.me/sweetalert",
4
+ "authors": [
5
+ "Tristan Edwards <tristan.edwards@me.com> (http://tristanedwards.me)"
6
+ ],
7
+ "description": "A beautiful replacement for JavaScript's alert.",
8
+ "main": [
9
+ "dist/sweetalert.min.js",
10
+ "dist/sweetalert.css"
11
+ ],
12
+ "keywords": [
13
+ "alert",
14
+ "modal"
15
+ ],
16
+ "repository": {
17
+ "type": "git",
18
+ "url": "git@github.com:t4t5/sweetalert.git"
19
+ },
20
+ "license": "MIT",
21
+ "devDependencies": {
22
+ "qunit": "~1.18.0",
23
+ "jquery": "~2.1.4"
24
+ },
25
+ "version": "1.1.0",
26
+ "_release": "1.1.0",
27
+ "_resolution": {
28
+ "type": "version",
29
+ "tag": "v1.1.0",
30
+ "commit": "6c5e4ca0e7ce9aee6c3d5dce0cfdde2f5c572357"
31
+ },
32
+ "_source": "git://github.com/t4t5/sweetalert.git",
33
+ "_target": "~1.1.0",
34
+ "_originalSource": "sweetalert",
35
+ "_direct": true
36
+ }
@@ -0,0 +1,11 @@
1
+ # editorconfig.org
2
+
3
+ root = true
4
+
5
+ [*]
6
+ charset = utf-8
7
+ end_of_line = lf
8
+ indent_size = 2
9
+ indent_style = space
10
+ insert_final_newline = true
11
+ trim_trailing_whitespace = true
@@ -0,0 +1,5 @@
1
+ *.codekit
2
+ *.sass-cache
3
+ *.DS_STORE
4
+ node_modules
5
+ bower_components
@@ -0,0 +1,11 @@
1
+ {
2
+ "predef": [
3
+ "document",
4
+ "window",
5
+ "module",
6
+ "define"
7
+ ],
8
+ "browser": true,
9
+ "esnext": true,
10
+ "validthis": true
11
+ }
@@ -0,0 +1,6 @@
1
+ language: node_js
2
+ node_js:
3
+ - "0.12"
4
+ before script:
5
+ - npm install -g gulp
6
+ script: gulp test
@@ -0,0 +1,22 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2014 Tristan Edwards
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
@@ -0,0 +1,157 @@
1
+ SweetAlert
2
+ ==========
3
+
4
+ An awesome replacement for JavaScript's alert.
5
+
6
+ ![A success modal](https://raw.github.com/t4t5/sweetalert/master/sweetalert.gif)
7
+
8
+ [See it in action!](http://t4t5.github.io/sweetalert)
9
+
10
+ [Learn how to use it!](https://www.ludu.co/lesson/how-to-use-sweetalert)
11
+
12
+
13
+ Usage
14
+ -----
15
+
16
+ You can install SweetAlert through bower:
17
+
18
+ ```bash
19
+ bower install sweetalert
20
+ ```
21
+
22
+ Or through npm:
23
+
24
+ ```bash
25
+ npm install sweetalert
26
+ ```
27
+
28
+ Alternatively, download the package and reference the JavaScript and CSS files manually:
29
+
30
+ ```html
31
+ <script src="dist/sweetalert.min.js"></script>
32
+ <link rel="stylesheet" type="text/css" href="dist/sweetalert.css">
33
+ ```
34
+ **Note:** If you're using an older version than v1.0.0, the files are `lib/sweet-alert.min.js` and `lib/sweet-alert.css`
35
+
36
+
37
+ Tutorial
38
+ --------
39
+
40
+ The easiest way to get started is follow the [SweetAlert tutorial on Ludu](https://www.ludu.co/lesson/how-to-use-sweetalert)!
41
+
42
+
43
+ Examples
44
+ --------
45
+
46
+ The most basic message:
47
+
48
+ ```javascript
49
+ swal("Hello world!");
50
+ ```
51
+
52
+ A message signaling an error:
53
+
54
+ ```javascript
55
+ swal("Oops...", "Something went wrong!", "error");
56
+ ```
57
+
58
+ A warning message, with a function attached to the "Confirm"-button:
59
+
60
+ ```javascript
61
+ swal({
62
+ title: "Are you sure?",
63
+ text: "You will not be able to recover this imaginary file!",
64
+ type: "warning",
65
+ showCancelButton: true,
66
+ confirmButtonColor: "#DD6B55",
67
+ confirmButtonText: "Yes, delete it!",
68
+ closeOnConfirm: false,
69
+ html: false
70
+ }, function(){
71
+ swal("Deleted!",
72
+ "Your imaginary file has been deleted.",
73
+ "success");
74
+ });
75
+ ```
76
+
77
+ A prompt modal where the user's input is logged:
78
+
79
+ ```javascript
80
+ swal({
81
+ title: "An input!",
82
+ text: 'Write something interesting:',
83
+ type: 'input',
84
+ showCancelButton: true,
85
+ closeOnConfirm: false,
86
+ animation: "slide-from-top"
87
+ }, function(inputValue){
88
+ console.log("You wrote", inputValue);
89
+ });
90
+ ```
91
+
92
+ Ajax request example:
93
+
94
+ ```javascript
95
+ swal({
96
+ title: 'Ajax request example',
97
+ text: 'Submit to run ajax request',
98
+ type: 'info',
99
+ showCancelButton: true,
100
+ closeOnConfirm: false,
101
+ disableButtonsOnConfirm: true,
102
+ confirmLoadingButtonColor: '#DD6B55'
103
+ }, function(inputValue){
104
+ setTimeout(function() {
105
+ swal('Ajax request finished!');
106
+ }, 2000);
107
+ });
108
+ ```
109
+
110
+ [View more examples](http://t4t5.github.io/sweetalert)
111
+
112
+
113
+ Themes
114
+ ------
115
+
116
+ SweetAlert can easily be themed to fit your site's design. SweetAlert comes with three example themes that you can try out: **facebook**, **twitter** and **google**. They can be referenced right after the intial sweetalert-CSS:
117
+ ```html
118
+ <link rel="stylesheet" href="dist/sweetalert.css">
119
+ <link rel="stylesheet" href="themes/twitter/twitter.css">
120
+ ```
121
+
122
+
123
+ Browser compatibility
124
+ ---------------------
125
+
126
+ SweetAlert works in most major browsers (yes, even IE). Some details:
127
+
128
+ - **IE8**: (Dropped since v1.0.0-beta)
129
+ - **IE9**: Works, but icons are not animated.
130
+ - **IE10+**: Works!
131
+ - **Safari 4+**: Works!
132
+ - **Firefox 3+**: Works!
133
+ - **Chrome 14+**: Works!
134
+ - **Opera 15+**: Works!
135
+
136
+
137
+ Contributing
138
+ ------------
139
+
140
+ If you want to contribute:
141
+
142
+ - Fork the repo
143
+
144
+ - Make sure you have [Node](http://nodejs.org/), [NPM](https://www.npmjs.com/) and [Gulp](http://gulpjs.com/) installed. When in the SweetAlert directory, run `npm install` to install the dependencies. Then run `gulp` while working to automatically minify the SCSS and JS-files.
145
+
146
+ - Keep in mind that SweetAlert uses Browserify in order to compile ES6-files. For easy debugging, make sure you reference the file `dist/sweetalert-dev.js` instead of `sweetalert.js`.
147
+
148
+ - After you're done, make a pull request and wait for approval! :)
149
+
150
+
151
+ Related projects
152
+ ----------------
153
+
154
+ * [SweetAlert for Android](https://github.com/pedant/sweet-alert-dialog)
155
+ * [SweetAlert for Bootstrap](https://github.com/lipis/bootstrap-sweetalert)
156
+ * [SweetAlert for AngularJS](https://github.com/oitozero/ngSweetAlert)
157
+ * [SweetAlert for RubyOnRails](https://github.com/sharshenov/sweetalert-rails)
@@ -0,0 +1,25 @@
1
+ {
2
+ "name": "sweetalert",
3
+ "homepage": "http://tristanedwards.me/sweetalert",
4
+ "authors": [
5
+ "Tristan Edwards <tristan.edwards@me.com> (http://tristanedwards.me)"
6
+ ],
7
+ "description": "A beautiful replacement for JavaScript's alert.",
8
+ "main": [
9
+ "dist/sweetalert.min.js",
10
+ "dist/sweetalert.css"
11
+ ],
12
+ "keywords": [
13
+ "alert",
14
+ "modal"
15
+ ],
16
+ "repository": {
17
+ "type": "git",
18
+ "url": "git@github.com:t4t5/sweetalert.git"
19
+ },
20
+ "license": "MIT",
21
+ "devDependencies": {
22
+ "qunit": "~1.18.0",
23
+ "jquery": "~2.1.4"
24
+ }
25
+ }
@@ -0,0 +1,18 @@
1
+ ;(function(window, document, undefined) {
2
+ "use strict";
3
+
4
+ <%= contents %>
5
+
6
+ /*
7
+ * Use SweetAlert with RequireJS
8
+ */
9
+
10
+ if (typeof define === 'function' && define.amd) {
11
+ define(function () {
12
+ return sweetAlert;
13
+ });
14
+ } else if (typeof module !== 'undefined' && module.exports) {
15
+ module.exports = sweetAlert;
16
+ }
17
+
18
+ })(window, document);
@@ -0,0 +1,23 @@
1
+ /* Internet Explorer 9 has some special quirks that are fixed here */
2
+ /* The icons are not animated. */
3
+ /* This file is automatically merged into sweet-alert.min.js through Gulp */
4
+
5
+ /* Error icon */
6
+ .sweet-alert .sa-icon.sa-error .sa-line.sa-left {
7
+ -ms-transform: rotate(45deg)\9;
8
+ }
9
+ .sweet-alert .sa-icon.sa-error .sa-line.sa-right {
10
+ -ms-transform: rotate(-45deg)\9;
11
+ }
12
+
13
+
14
+ /* Success icon */
15
+ .sweet-alert .sa-icon.sa-success {
16
+ border-color: transparent\9;
17
+ }
18
+ .sweet-alert .sa-icon.sa-success .sa-line.sa-tip {
19
+ -ms-transform: rotate(45deg)\9;
20
+ }
21
+ .sweet-alert .sa-icon.sa-success .sa-line.sa-long {
22
+ -ms-transform: rotate(-45deg)\9;
23
+ }
@@ -0,0 +1,209 @@
1
+ /*!
2
+ * Load Awesome v1.1.0 (http://github.danielcardoso.net/load-awesome/)
3
+ * Copyright 2015 Daniel Cardoso <@DanielCardoso>
4
+ * Licensed under MIT
5
+ */
6
+ .la-ball-fall,
7
+ .la-ball-fall > div {
8
+ position: relative;
9
+ -webkit-box-sizing: border-box;
10
+ -moz-box-sizing: border-box;
11
+ box-sizing: border-box;
12
+ }
13
+ .la-ball-fall {
14
+ display: block;
15
+ font-size: 0;
16
+ color: #fff;
17
+ }
18
+ .la-ball-fall.la-dark {
19
+ color: #333;
20
+ }
21
+ .la-ball-fall > div {
22
+ display: inline-block;
23
+ float: none;
24
+ background-color: currentColor;
25
+ border: 0 solid currentColor;
26
+ }
27
+ .la-ball-fall {
28
+ width: 54px;
29
+ height: 18px;
30
+ }
31
+ .la-ball-fall > div {
32
+ width: 10px;
33
+ height: 10px;
34
+ margin: 4px;
35
+ border-radius: 100%;
36
+ opacity: 0;
37
+ -webkit-animation: ball-fall 1s ease-in-out infinite;
38
+ -moz-animation: ball-fall 1s ease-in-out infinite;
39
+ -o-animation: ball-fall 1s ease-in-out infinite;
40
+ animation: ball-fall 1s ease-in-out infinite;
41
+ }
42
+ .la-ball-fall > div:nth-child(1) {
43
+ -webkit-animation-delay: -200ms;
44
+ -moz-animation-delay: -200ms;
45
+ -o-animation-delay: -200ms;
46
+ animation-delay: -200ms;
47
+ }
48
+ .la-ball-fall > div:nth-child(2) {
49
+ -webkit-animation-delay: -100ms;
50
+ -moz-animation-delay: -100ms;
51
+ -o-animation-delay: -100ms;
52
+ animation-delay: -100ms;
53
+ }
54
+ .la-ball-fall > div:nth-child(3) {
55
+ -webkit-animation-delay: 0ms;
56
+ -moz-animation-delay: 0ms;
57
+ -o-animation-delay: 0ms;
58
+ animation-delay: 0ms;
59
+ }
60
+ .la-ball-fall.la-sm {
61
+ width: 26px;
62
+ height: 8px;
63
+ }
64
+ .la-ball-fall.la-sm > div {
65
+ width: 4px;
66
+ height: 4px;
67
+ margin: 2px;
68
+ }
69
+ .la-ball-fall.la-2x {
70
+ width: 108px;
71
+ height: 36px;
72
+ }
73
+ .la-ball-fall.la-2x > div {
74
+ width: 20px;
75
+ height: 20px;
76
+ margin: 8px;
77
+ }
78
+ .la-ball-fall.la-3x {
79
+ width: 162px;
80
+ height: 54px;
81
+ }
82
+ .la-ball-fall.la-3x > div {
83
+ width: 30px;
84
+ height: 30px;
85
+ margin: 12px;
86
+ }
87
+ /*
88
+ * Animation
89
+ */
90
+ @-webkit-keyframes ball-fall {
91
+ 0% {
92
+ opacity: 0;
93
+ -webkit-transform: translateY(-145%);
94
+ transform: translateY(-145%);
95
+ }
96
+ 10% {
97
+ opacity: .5;
98
+ }
99
+ 20% {
100
+ opacity: 1;
101
+ -webkit-transform: translateY(0);
102
+ transform: translateY(0);
103
+ }
104
+ 80% {
105
+ opacity: 1;
106
+ -webkit-transform: translateY(0);
107
+ transform: translateY(0);
108
+ }
109
+ 90% {
110
+ opacity: .5;
111
+ }
112
+ 100% {
113
+ opacity: 0;
114
+ -webkit-transform: translateY(145%);
115
+ transform: translateY(145%);
116
+ }
117
+ }
118
+ @-moz-keyframes ball-fall {
119
+ 0% {
120
+ opacity: 0;
121
+ -moz-transform: translateY(-145%);
122
+ transform: translateY(-145%);
123
+ }
124
+ 10% {
125
+ opacity: .5;
126
+ }
127
+ 20% {
128
+ opacity: 1;
129
+ -moz-transform: translateY(0);
130
+ transform: translateY(0);
131
+ }
132
+ 80% {
133
+ opacity: 1;
134
+ -moz-transform: translateY(0);
135
+ transform: translateY(0);
136
+ }
137
+ 90% {
138
+ opacity: .5;
139
+ }
140
+ 100% {
141
+ opacity: 0;
142
+ -moz-transform: translateY(145%);
143
+ transform: translateY(145%);
144
+ }
145
+ }
146
+ @-o-keyframes ball-fall {
147
+ 0% {
148
+ opacity: 0;
149
+ -o-transform: translateY(-145%);
150
+ transform: translateY(-145%);
151
+ }
152
+ 10% {
153
+ opacity: .5;
154
+ }
155
+ 20% {
156
+ opacity: 1;
157
+ -o-transform: translateY(0);
158
+ transform: translateY(0);
159
+ }
160
+ 80% {
161
+ opacity: 1;
162
+ -o-transform: translateY(0);
163
+ transform: translateY(0);
164
+ }
165
+ 90% {
166
+ opacity: .5;
167
+ }
168
+ 100% {
169
+ opacity: 0;
170
+ -o-transform: translateY(145%);
171
+ transform: translateY(145%);
172
+ }
173
+ }
174
+ @keyframes ball-fall {
175
+ 0% {
176
+ opacity: 0;
177
+ -webkit-transform: translateY(-145%);
178
+ -moz-transform: translateY(-145%);
179
+ -o-transform: translateY(-145%);
180
+ transform: translateY(-145%);
181
+ }
182
+ 10% {
183
+ opacity: .5;
184
+ }
185
+ 20% {
186
+ opacity: 1;
187
+ -webkit-transform: translateY(0);
188
+ -moz-transform: translateY(0);
189
+ -o-transform: translateY(0);
190
+ transform: translateY(0);
191
+ }
192
+ 80% {
193
+ opacity: 1;
194
+ -webkit-transform: translateY(0);
195
+ -moz-transform: translateY(0);
196
+ -o-transform: translateY(0);
197
+ transform: translateY(0);
198
+ }
199
+ 90% {
200
+ opacity: .5;
201
+ }
202
+ 100% {
203
+ opacity: 0;
204
+ -webkit-transform: translateY(145%);
205
+ -moz-transform: translateY(145%);
206
+ -o-transform: translateY(145%);
207
+ transform: translateY(145%);
208
+ }
209
+ }