volt-semantic-ui 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +0 -0
- data/Gemfile +0 -0
- data/LICENSE.txt +0 -0
- data/README.md +0 -0
- data/Rakefile +0 -0
- data/app/semanticui/assets/css/semantic.min.css +3 -3
- data/app/semanticui/assets/css/themes/basic/assets/fonts/icons.eot +0 -0
- data/app/semanticui/assets/css/themes/basic/assets/fonts/icons.svg +0 -0
- data/app/semanticui/assets/css/themes/basic/assets/fonts/icons.ttf +0 -0
- data/app/semanticui/assets/css/themes/basic/assets/fonts/icons.woff +0 -0
- data/app/semanticui/assets/css/themes/default/assets/fonts/icons.eot +0 -0
- data/app/semanticui/assets/css/themes/default/assets/fonts/icons.otf +0 -0
- data/app/semanticui/assets/css/themes/default/assets/fonts/icons.svg +526 -465
- data/app/semanticui/assets/css/themes/default/assets/fonts/icons.ttf +0 -0
- data/app/semanticui/assets/css/themes/default/assets/fonts/icons.woff +0 -0
- data/app/semanticui/assets/css/themes/default/assets/fonts/icons.woff2 +0 -0
- data/app/semanticui/assets/css/themes/default/assets/images/flags.png +0 -0
- data/app/semanticui/assets/js/components/accordion.css +256 -0
- data/app/semanticui/assets/js/components/accordion.js +578 -0
- data/app/semanticui/assets/js/components/accordion.min.css +10 -0
- data/app/semanticui/assets/js/components/accordion.min.js +11 -0
- data/app/semanticui/assets/js/components/ad.css +276 -0
- data/app/semanticui/assets/js/components/ad.min.css +10 -0
- data/app/semanticui/assets/js/components/api.js +871 -0
- data/app/semanticui/assets/js/components/api.min.js +11 -0
- data/app/semanticui/assets/js/components/breadcrumb.css +124 -0
- data/app/semanticui/assets/js/components/breadcrumb.min.css +10 -0
- data/app/semanticui/assets/js/components/button.css +2391 -0
- data/app/semanticui/assets/js/components/button.min.css +10 -0
- data/app/semanticui/assets/js/components/card.css +909 -0
- data/app/semanticui/assets/js/components/card.min.css +10 -0
- data/app/semanticui/assets/js/components/checkbox.css +513 -0
- data/app/semanticui/assets/js/components/checkbox.js +509 -0
- data/app/semanticui/assets/js/components/checkbox.min.css +10 -0
- data/app/semanticui/assets/js/components/checkbox.min.js +11 -0
- data/app/semanticui/assets/js/components/comment.css +259 -0
- data/app/semanticui/assets/js/components/comment.min.css +10 -0
- data/app/semanticui/assets/js/components/dimmer.css +186 -0
- data/app/semanticui/assets/js/components/dimmer.js +669 -0
- data/app/semanticui/assets/js/components/dimmer.min.css +10 -0
- data/app/semanticui/assets/js/components/dimmer.min.js +11 -0
- data/app/semanticui/assets/js/components/divider.css +241 -0
- data/app/semanticui/assets/js/components/divider.min.css +10 -0
- data/app/semanticui/assets/js/components/dropdown.css +1103 -0
- data/app/semanticui/assets/js/components/dropdown.js +1795 -0
- data/app/semanticui/assets/js/components/dropdown.min.css +10 -0
- data/app/semanticui/assets/js/components/dropdown.min.js +11 -0
- data/app/semanticui/assets/js/components/feed.css +276 -0
- data/app/semanticui/assets/js/components/feed.min.css +10 -0
- data/app/semanticui/assets/js/components/flag.css +1024 -0
- data/app/semanticui/assets/js/components/flag.min.css +10 -0
- data/app/semanticui/assets/js/components/form.css +891 -0
- data/app/semanticui/assets/js/components/form.js +1118 -0
- data/app/semanticui/assets/js/components/form.min.css +10 -0
- data/app/semanticui/assets/js/components/form.min.js +11 -0
- data/app/semanticui/assets/js/components/grid.css +1871 -0
- data/app/semanticui/assets/js/components/grid.min.css +10 -0
- data/app/semanticui/assets/js/components/header.css +596 -0
- data/app/semanticui/assets/js/components/header.min.css +10 -0
- data/app/semanticui/assets/js/components/icon.css +2467 -0
- data/app/semanticui/assets/js/components/icon.min.css +10 -0
- data/app/semanticui/assets/js/components/image.css +288 -0
- data/app/semanticui/assets/js/components/image.min.css +10 -0
- data/app/semanticui/assets/js/components/input.css +439 -0
- data/app/semanticui/assets/js/components/input.min.css +10 -0
- data/app/semanticui/assets/js/components/item.css +456 -0
- data/app/semanticui/assets/js/components/item.min.css +10 -0
- data/app/semanticui/assets/js/components/label.css +963 -0
- data/app/semanticui/assets/js/components/label.min.css +10 -0
- data/app/semanticui/assets/js/components/list.css +878 -0
- data/app/semanticui/assets/js/components/list.min.css +10 -0
- data/app/semanticui/assets/js/components/loader.css +284 -0
- data/app/semanticui/assets/js/components/loader.min.css +10 -0
- data/app/semanticui/assets/js/components/menu.css +1608 -0
- data/app/semanticui/assets/js/components/menu.min.css +10 -0
- data/app/semanticui/assets/js/components/message.css +421 -0
- data/app/semanticui/assets/js/components/message.min.css +10 -0
- data/app/semanticui/assets/js/components/modal.css +432 -0
- data/app/semanticui/assets/js/components/modal.js +860 -0
- data/app/semanticui/assets/js/components/modal.min.css +10 -0
- data/app/semanticui/assets/js/components/modal.min.js +11 -0
- data/app/semanticui/assets/js/components/nag.css +148 -0
- data/app/semanticui/assets/js/components/nag.js +477 -0
- data/app/semanticui/assets/js/components/nag.min.css +10 -0
- data/app/semanticui/assets/js/components/nag.min.js +11 -0
- data/app/semanticui/assets/js/components/popup.css +293 -0
- data/app/semanticui/assets/js/components/popup.js +1224 -0
- data/app/semanticui/assets/js/components/popup.min.css +10 -0
- data/app/semanticui/assets/js/components/popup.min.js +11 -0
- data/app/semanticui/assets/js/components/progress.css +461 -0
- data/app/semanticui/assets/js/components/progress.js +785 -0
- data/app/semanticui/assets/js/components/progress.min.css +10 -0
- data/app/semanticui/assets/js/components/progress.min.js +11 -0
- data/app/semanticui/assets/js/components/rail.css +124 -0
- data/app/semanticui/assets/js/components/rail.min.css +10 -0
- data/app/semanticui/assets/js/components/rating.css +251 -0
- data/app/semanticui/assets/js/components/rating.js +451 -0
- data/app/semanticui/assets/js/components/rating.min.css +10 -0
- data/app/semanticui/assets/js/components/rating.min.js +11 -0
- data/app/semanticui/assets/js/components/reset.css +429 -0
- data/app/semanticui/assets/js/components/reset.min.css +10 -0
- data/app/semanticui/assets/js/components/reveal.css +293 -0
- data/app/semanticui/assets/js/components/reveal.min.css +10 -0
- data/app/semanticui/assets/js/components/search.css +329 -0
- data/app/semanticui/assets/js/components/search.js +1096 -0
- data/app/semanticui/assets/js/components/search.min.css +10 -0
- data/app/semanticui/assets/js/components/search.min.js +11 -0
- data/app/semanticui/assets/js/components/segment.css +635 -0
- data/app/semanticui/assets/js/components/segment.min.css +10 -0
- data/app/semanticui/assets/js/components/shape.css +154 -0
- data/app/semanticui/assets/js/components/shape.js +830 -0
- data/app/semanticui/assets/js/components/shape.min.css +10 -0
- data/app/semanticui/assets/js/components/shape.min.js +11 -0
- data/app/semanticui/assets/js/components/sidebar.css +625 -0
- data/app/semanticui/assets/js/components/sidebar.js +1089 -0
- data/app/semanticui/assets/js/components/sidebar.min.css +10 -0
- data/app/semanticui/assets/js/components/sidebar.min.js +11 -0
- data/app/semanticui/assets/js/components/site.css +160 -0
- data/app/semanticui/assets/js/components/site.js +487 -0
- data/app/semanticui/assets/js/components/site.min.css +10 -0
- data/app/semanticui/assets/js/components/site.min.js +11 -0
- data/app/semanticui/assets/js/components/state.js +695 -0
- data/app/semanticui/assets/js/components/state.min.js +11 -0
- data/app/semanticui/assets/js/components/statistic.css +409 -0
- data/app/semanticui/assets/js/components/statistic.min.css +10 -0
- data/app/semanticui/assets/js/components/step.css +432 -0
- data/app/semanticui/assets/js/components/step.min.css +10 -0
- data/app/semanticui/assets/js/components/sticky.css +79 -0
- data/app/semanticui/assets/js/components/sticky.js +792 -0
- data/app/semanticui/assets/js/components/sticky.min.css +10 -0
- data/app/semanticui/assets/js/components/sticky.min.js +11 -0
- data/app/semanticui/assets/js/components/tab.css +92 -0
- data/app/semanticui/assets/js/components/tab.js +802 -0
- data/app/semanticui/assets/js/components/tab.min.css +10 -0
- data/app/semanticui/assets/js/components/tab.min.js +11 -0
- data/app/semanticui/assets/js/components/table.css +1000 -0
- data/app/semanticui/assets/js/components/table.min.css +10 -0
- data/app/semanticui/assets/js/components/transition.css +1990 -0
- data/app/semanticui/assets/js/components/transition.js +1038 -0
- data/app/semanticui/assets/js/components/transition.min.css +10 -0
- data/app/semanticui/assets/js/components/transition.min.js +11 -0
- data/app/semanticui/assets/js/components/video.css +125 -0
- data/app/semanticui/assets/js/components/video.js +540 -0
- data/app/semanticui/assets/js/components/video.min.css +10 -0
- data/app/semanticui/assets/js/components/video.min.js +11 -0
- data/app/semanticui/assets/js/components/visibility.js +1032 -0
- data/app/semanticui/assets/js/components/visibility.min.js +11 -0
- data/app/semanticui/assets/js/semantic.min.js +9 -9
- data/lib/volt/semanticui.rb +0 -0
- data/lib/volt/semanticui/version.rb +1 -1
- data/volt-semantic-ui-0.0.1.gem +0 -0
- data/volt-semanticui-0.0.1.gem +0 -0
- data/volt-semanticui.gemspec +0 -0
- metadata +141 -10
@@ -0,0 +1,10 @@
|
|
1
|
+
/*!
|
2
|
+
* # Semantic UI 1.11.4 - Accordion
|
3
|
+
* http://github.com/semantic-org/semantic-ui/
|
4
|
+
*
|
5
|
+
*
|
6
|
+
* Copyright 2014 Contributors
|
7
|
+
* Released under the MIT license
|
8
|
+
* http://opensource.org/licenses/MIT
|
9
|
+
*
|
10
|
+
*/.ui.accordion,.ui.accordion .accordion{max-width:100%;font-size:1em}.ui.accordion .accordion{margin:1em 0 0;padding:0}.ui.accordion .accordion .title,.ui.accordion .title{cursor:pointer}.ui.accordion .title:not(.ui){padding:.5em 0;font-family:Lato,'Helvetica Neue',Arial,Helvetica,sans-serif;font-size:1em;color:rgba(0,0,0,.8)}.ui.accordion .accordion .title~.content,.ui.accordion .title~.content{display:none}.ui.accordion:not(.styled) .accordion .title~.content:not(.ui),.ui.accordion:not(.styled) .title~.content:not(.ui){margin:0;padding:.5em 0 1em}.ui.accordion:not(.styled) .title~.content:not(.ui):last-child{padding-bottom:0}.ui.accordion .accordion .title .dropdown.icon,.ui.accordion .title .dropdown.icon{display:inline-block;float:none;opacity:1;width:1.25em;height:1em;margin:0 .25rem 0 0;padding:0;font-size:1em;-webkit-transition:-webkit-transform .2s ease,opacity .2s ease;transition:transform .2s ease,opacity .2s ease;vertical-align:baseline;-webkit-transform:none;-ms-transform:none;transform:none}.ui.accordion.menu .item .title{display:block;padding:0}.ui.accordion.menu .item .title>.dropdown.icon{float:right;margin:.165em 0 0 1em;-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}.ui.accordion .ui.header .dropdown.icon{font-size:1em;margin:0 .25rem 0 0}.ui.accordion .accordion .active.title .dropdown.icon,.ui.accordion .active.title .dropdown.icon,.ui.accordion.menu .item .active.title>.dropdown.icon{-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}.ui.styled.accordion{width:600px}.ui.styled.accordion,.ui.styled.accordion .accordion{border-radius:.2857rem;background:#fff;box-shadow:0 1px 2px 0 rgba(0,0,0,.05),0 0 0 1px rgba(39,41,43,.15)}.ui.styled.accordion .accordion .title,.ui.styled.accordion .title{margin:0;padding:.75em 1em;color:rgba(0,0,0,.4);font-weight:700;border-top:1px solid rgba(39,41,43,.15);-webkit-transition:background .2s ease,color .2s ease;transition:background .2s ease,color .2s ease}.ui.styled.accordion .accordion .title:first-child,.ui.styled.accordion>.title:first-child{border-top:none}.ui.styled.accordion .accordion .content,.ui.styled.accordion .content{margin:0;padding:.5em 1em 1.5em}.ui.styled.accordion .accordion .content{padding:.5em 1em 1.5em}.ui.styled.accordion .accordion .active.title,.ui.styled.accordion .accordion .title:hover,.ui.styled.accordion .active.title,.ui.styled.accordion .title:hover{background:0 0;color:rgba(0,0,0,.8)}.ui.accordion .accordion .active.content,.ui.accordion .active.content{display:block}.ui.fluid.accordion,.ui.fluid.accordion .accordion{width:100%}.ui.inverted.accordion .title:not(.ui){color:#fff}@font-face{font-family:Accordion;src:url(data:application/x-font-ttf;charset=utf-8;base64,AAEAAAALAIAAAwAwT1MvMggjB5AAAAC8AAAAYGNtYXAPfOIKAAABHAAAAExnYXNwAAAAEAAAAWgAAAAIZ2x5Zryj6HgAAAFwAAAAyGhlYWT/0IhHAAACOAAAADZoaGVhApkB5wAAAnAAAAAkaG10eAJuABIAAAKUAAAAGGxvY2EAjABWAAACrAAAAA5tYXhwAAgAFgAAArwAAAAgbmFtZfC1n04AAALcAAABPHBvc3QAAwAAAAAEGAAAACAAAwIAAZAABQAAAUwBZgAAAEcBTAFmAAAA9QAZAIQAAAAAAAAAAAAAAAAAAAABEAAAAAAAAAAAAAAAAAAAAABAAADw2gHg/+D/4AHgACAAAAABAAAAAAAAAAAAAAAgAAAAAAACAAAAAwAAABQAAwABAAAAFAAEADgAAAAKAAgAAgACAAEAIPDa//3//wAAAAAAIPDZ//3//wAB/+MPKwADAAEAAAAAAAAAAAAAAAEAAf//AA8AAQAAAAAAAAAAAAIAADc5AQAAAAABAAAAAAAAAAAAAgAANzkBAAAAAAEAAAAAAAAAAAACAAA3OQEAAAAAAQASAEkAtwFuABMAADc0PwE2FzYXFh0BFAcGJwYvASY1EgaABQgHBQYGBQcIBYAG2wcGfwcBAQcECf8IBAcBAQd/BgYAAAAAAQAAAEkApQFuABMAADcRNDc2MzIfARYVFA8BBiMiJyY1AAUGBwgFgAYGgAUIBwYFWwEACAUGBoAFCAcFgAYGBQcAAAABAAAAAQAAqWYls18PPPUACwIAAAAAAM/9o+4AAAAAz/2j7gAAAAAAtwFuAAAACAACAAAAAAAAAAEAAAHg/+AAAAIAAAAAAAC3AAEAAAAAAAAAAAAAAAAAAAAGAAAAAAAAAAAAAAAAAQAAAAC3ABIAtwAAAAAAAAAKABQAHgBCAGQAAAABAAAABgAUAAEAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAAADgCuAAEAAAAAAAEADAAAAAEAAAAAAAIADgBAAAEAAAAAAAMADAAiAAEAAAAAAAQADABOAAEAAAAAAAUAFgAMAAEAAAAAAAYABgAuAAEAAAAAAAoANABaAAMAAQQJAAEADAAAAAMAAQQJAAIADgBAAAMAAQQJAAMADAAiAAMAAQQJAAQADABOAAMAAQQJAAUAFgAMAAMAAQQJAAYADAA0AAMAAQQJAAoANABaAHIAYQB0AGkAbgBnAFYAZQByAHMAaQBvAG4AIAAxAC4AMAByAGEAdABpAG4AZ3JhdGluZwByAGEAdABpAG4AZwBSAGUAZwB1AGwAYQByAHIAYQB0AGkAbgBnAEYAbwBuAHQAIABnAGUAbgBlAHIAYQB0AGUAZAAgAGIAeQAgAEkAYwBvAE0AbwBvAG4ALgADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA) format('truetype'),url(data:application/font-woff;charset=utf-8;base64,d09GRk9UVE8AAASwAAoAAAAABGgAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABDRkYgAAAA9AAAAS0AAAEtFpovuE9TLzIAAAIkAAAAYAAAAGAIIweQY21hcAAAAoQAAABMAAAATA984gpnYXNwAAAC0AAAAAgAAAAIAAAAEGhlYWQAAALYAAAANgAAADb/0IhHaGhlYQAAAxAAAAAkAAAAJAKZAedobXR4AAADNAAAABgAAAAYAm4AEm1heHAAAANMAAAABgAAAAYABlAAbmFtZQAAA1QAAAE8AAABPPC1n05wb3N0AAAEkAAAACAAAAAgAAMAAAEABAQAAQEBB3JhdGluZwABAgABADr4HAL4GwP4GAQeCgAZU/+Lix4KABlT/4uLDAeLa/iU+HQFHQAAAHkPHQAAAH4RHQAAAAkdAAABJBIABwEBBw0PERQZHnJhdGluZ3JhdGluZ3UwdTF1MjB1RjBEOXVGMERBAAACAYkABAAGAQEEBwoNVp38lA78lA78lA77lA773Z33bxWLkI2Qj44I9xT3FAWOj5CNkIuQi4+JjoePiI2Gi4YIi/uUBYuGiYeHiIiHh4mGi4aLho2Ijwj7FPcUBYeOiY+LkAgO+92L5hWL95QFi5CNkI6Oj4+PjZCLkIuQiY6HCPcU+xQFj4iNhouGi4aJh4eICPsU+xQFiIeGiYaLhouHjYePiI6Jj4uQCA74lBT4lBWLDAoAAAAAAwIAAZAABQAAAUwBZgAAAEcBTAFmAAAA9QAZAIQAAAAAAAAAAAAAAAAAAAABEAAAAAAAAAAAAAAAAAAAAABAAADw2gHg/+D/4AHgACAAAAABAAAAAAAAAAAAAAAgAAAAAAACAAAAAwAAABQAAwABAAAAFAAEADgAAAAKAAgAAgACAAEAIPDa//3//wAAAAAAIPDZ//3//wAB/+MPKwADAAEAAAAAAAAAAAAAAAEAAf//AA8AAQAAAAEAADfYOJZfDzz1AAsCAAAAAADP/aPuAAAAAM/9o+4AAAAAALcBbgAAAAgAAgAAAAAAAAABAAAB4P/gAAACAAAAAAAAtwABAAAAAAAAAAAAAAAAAAAABgAAAAAAAAAAAAAAAAEAAAAAtwASALcAAAAAUAAABgAAAAAADgCuAAEAAAAAAAEADAAAAAEAAAAAAAIADgBAAAEAAAAAAAMADAAiAAEAAAAAAAQADABOAAEAAAAAAAUAFgAMAAEAAAAAAAYABgAuAAEAAAAAAAoANABaAAMAAQQJAAEADAAAAAMAAQQJAAIADgBAAAMAAQQJAAMADAAiAAMAAQQJAAQADABOAAMAAQQJAAUAFgAMAAMAAQQJAAYADAA0AAMAAQQJAAoANABaAHIAYQB0AGkAbgBnAFYAZQByAHMAaQBvAG4AIAAxAC4AMAByAGEAdABpAG4AZ3JhdGluZwByAGEAdABpAG4AZwBSAGUAZwB1AGwAYQByAHIAYQB0AGkAbgBnAEYAbwBuAHQAIABnAGUAbgBlAHIAYQB0AGUAZAAgAGIAeQAgAEkAYwBvAE0AbwBvAG4ALgADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA) format('woff');font-weight:400;font-style:normal}.ui.accordion .accordion .title .dropdown.icon,.ui.accordion .title .dropdown.icon{font-family:Accordion;line-height:1;-webkit-backface-visibility:hidden;backface-visibility:hidden;font-weight:400;font-style:normal;text-align:center}.ui.accordion .accordion .title .dropdown.icon:before,.ui.accordion .title .dropdown.icon:before{content:'\f0da'}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
/*!
|
2
|
+
* # Semantic UI 1.11.4 - Accordion
|
3
|
+
* http://github.com/semantic-org/semantic-ui/
|
4
|
+
*
|
5
|
+
*
|
6
|
+
* Copyright 2014 Contributors
|
7
|
+
* Released under the MIT license
|
8
|
+
* http://opensource.org/licenses/MIT
|
9
|
+
*
|
10
|
+
*/
|
11
|
+
!function(e,n,t,i){"use strict";e.fn.accordion=function(t){{var o,a=e(this),s=(new Date).getTime(),r=[],c=arguments[0],l="string"==typeof c,u=[].slice.call(arguments,1);n.requestAnimationFrame||n.mozRequestAnimationFrame||n.webkitRequestAnimationFrame||n.msRequestAnimationFrame||function(e){setTimeout(e,0)}}return a.each(function(){var d,m,g=e.isPlainObject(t)?e.extend(!0,{},e.fn.accordion.settings,t):e.extend({},e.fn.accordion.settings),f=g.className,p=g.namespace,v=g.selector,h=g.error,b="."+p,y="module-"+p,C=a.selector||"",O=e(this),x=O.find(v.title),F=O.find(v.content),T=this,q=O.data(y);m={initialize:function(){m.debug("Initializing",O),m.bind.events(),m.observeChanges(),m.instantiate()},instantiate:function(){q=m,O.data(y,m)},destroy:function(){m.debug("Destroying previous instance",O),O.off(b).removeData(y)},refresh:function(){x=O.find(v.title),F=O.find(v.content)},observeChanges:function(){"MutationObserver"in n&&(d=new MutationObserver(function(){m.debug("DOM tree modified, updating selector cache"),m.refresh()}),d.observe(T,{childList:!0,subtree:!0}),m.debug("Setting up mutation observer",d))},bind:{events:function(){m.debug("Binding delegated events"),O.on("click"+b,v.trigger,m.event.click)}},event:{click:function(){m.toggle.call(this)}},toggle:function(n){var t=n!==i?"number"==typeof n?x.eq(n):e(n).closest(v.title):e(this).closest(v.title),o=t.next(F),a=o.hasClass(f.animating),s=o.hasClass(f.active),r=s&&!a,c=!s&&a;m.debug("Toggling visibility of content",t),r||c?g.collapsible?m.close.call(t):m.debug("Cannot close accordion content collapsing is disabled"):m.open.call(t)},open:function(n){var t=n!==i?"number"==typeof n?x.eq(n):e(n).closest(v.title):e(this).closest(v.title),o=t.next(F),a=o.hasClass(f.animating),s=o.hasClass(f.active),r=!s&&!a;r&&(m.debug("Opening accordion content",t),g.exclusive&&m.closeOthers.call(t),t.addClass(f.active),o.addClass(f.animating),g.animateChildren&&(e.fn.transition!==i&&O.transition("is supported")?o.children().transition({animation:"fade in",queue:!1,useFailSafe:!0,debug:g.debug,verbose:g.verbose,duration:g.duration}):o.children().stop(!0).animate({opacity:1},g.duration,m.resetOpacity)),o.stop(!0).slideDown(g.duration,g.easing,function(){o.removeClass(f.animating).addClass(f.active),m.reset.display.call(this),g.onOpen.call(this),g.onChange.call(this)}))},close:function(n){var t=n!==i?"number"==typeof n?x.eq(n):e(n).closest(v.title):e(this).closest(v.title),o=t.next(F),a=o.hasClass(f.animating),s=o.hasClass(f.active),r=!s&&a,c=s&&a;!s&&!r||c||(m.debug("Closing accordion content",o),t.removeClass(f.active),o.addClass(f.animating),g.animateChildren&&(e.fn.transition!==i&&O.transition("is supported")?o.children().transition({animation:"fade out",queue:!1,useFailSafe:!0,debug:g.debug,verbose:g.verbose,duration:g.duration}):o.children().stop(!0).animate({opacity:0},g.duration,m.resetOpacity)),o.stop(!0).slideUp(g.duration,g.easing,function(){o.removeClass(f.animating).removeClass(f.active),m.reset.display.call(this),g.onClose.call(this),g.onChange.call(this)}))},closeOthers:function(n){var t,o,a,s=n!==i?x.eq(n):e(this).closest(v.title),r=s.parents(v.content).prev(v.title),c=s.closest(v.accordion),l=v.title+"."+f.active+":visible",u=v.content+"."+f.active+":visible";g.closeNested?(t=c.find(l).not(r),a=t.next(F)):(t=c.find(l).not(r),o=c.find(u).find(l).not(r),t=t.not(o),a=t.next(F)),t.length>0&&(m.debug("Exclusive enabled, closing other content",t),t.removeClass(f.active),g.animateChildren&&(e.fn.transition!==i&&O.transition("is supported")?a.children().transition({animation:"fade out",useFailSafe:!0,debug:g.debug,verbose:g.verbose,duration:g.duration}):a.children().stop().animate({opacity:0},g.duration,m.resetOpacity)),a.stop().slideUp(g.duration,g.easing,function(){e(this).removeClass(f.active),m.reset.display.call(this)}))},reset:{display:function(){m.verbose("Removing inline display from element",this),e(this).css("display",""),""===e(this).attr("style")&&e(this).attr("style","").removeAttr("style")},opacity:function(){m.verbose("Removing inline opacity from element",this),e(this).css("opacity",""),""===e(this).attr("style")&&e(this).attr("style","").removeAttr("style")}},setting:function(n,t){if(m.debug("Changing setting",n,t),e.isPlainObject(n))e.extend(!0,g,n);else{if(t===i)return g[n];g[n]=t}},internal:function(n,t){return m.debug("Changing internal",n,t),t===i?m[n]:void(e.isPlainObject(n)?e.extend(!0,m,n):m[n]=t)},debug:function(){g.debug&&(g.performance?m.performance.log(arguments):(m.debug=Function.prototype.bind.call(console.info,console,g.name+":"),m.debug.apply(console,arguments)))},verbose:function(){g.verbose&&g.debug&&(g.performance?m.performance.log(arguments):(m.verbose=Function.prototype.bind.call(console.info,console,g.name+":"),m.verbose.apply(console,arguments)))},error:function(){m.error=Function.prototype.bind.call(console.error,console,g.name+":"),m.error.apply(console,arguments)},performance:{log:function(e){var n,t,i;g.performance&&(n=(new Date).getTime(),i=s||n,t=n-i,s=n,r.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:T,"Execution Time":t})),clearTimeout(m.performance.timer),m.performance.timer=setTimeout(m.performance.display,100)},display:function(){var n=g.name+":",t=0;s=!1,clearTimeout(m.performance.timer),e.each(r,function(e,n){t+=n["Execution Time"]}),n+=" "+t+"ms",C&&(n+=" '"+C+"'"),(console.group!==i||console.table!==i)&&r.length>0&&(console.groupCollapsed(n),console.table?console.table(r):e.each(r,function(e,n){console.log(n.Name+": "+n["Execution Time"]+"ms")}),console.groupEnd()),r=[]}},invoke:function(n,t,a){var s,r,c,l=q;return t=t||u,a=T||a,"string"==typeof n&&l!==i&&(n=n.split(/[\. ]/),s=n.length-1,e.each(n,function(t,o){var a=t!=s?o+n[t+1].charAt(0).toUpperCase()+n[t+1].slice(1):n;if(e.isPlainObject(l[a])&&t!=s)l=l[a];else{if(l[a]!==i)return r=l[a],!1;if(!e.isPlainObject(l[o])||t==s)return l[o]!==i?(r=l[o],!1):(m.error(h.method,n),!1);l=l[o]}})),e.isFunction(r)?c=r.apply(a,t):r!==i&&(c=r),e.isArray(o)?o.push(c):o!==i?o=[o,c]:c!==i&&(o=c),r}},l?(q===i&&m.initialize(),m.invoke(c)):(q!==i&&q.invoke("destroy"),m.initialize())}),o!==i?o:this},e.fn.accordion.settings={name:"Accordion",namespace:"accordion",debug:!1,verbose:!0,performance:!0,exclusive:!0,collapsible:!0,closeNested:!1,animateChildren:!0,duration:350,easing:"easeOutQuad",onOpen:function(){},onClose:function(){},onChange:function(){},error:{method:"The method you called is not defined"},className:{active:"active",animating:"animating"},selector:{accordion:".accordion",title:".title",trigger:".title",content:".content"}},e.extend(e.easing,{easeOutQuad:function(e,n,t,i,o){return-i*(n/=o)*(n-2)+t}})}(jQuery,window,document);
|
@@ -0,0 +1,276 @@
|
|
1
|
+
/*!
|
2
|
+
* # Semantic UI 1.11.4 - Ad
|
3
|
+
* http://github.com/semantic-org/semantic-ui/
|
4
|
+
*
|
5
|
+
*
|
6
|
+
* Copyright 2013 Contributors
|
7
|
+
* Released under the MIT license
|
8
|
+
* http://opensource.org/licenses/MIT
|
9
|
+
*
|
10
|
+
*/
|
11
|
+
|
12
|
+
|
13
|
+
/*******************************
|
14
|
+
Advertisement
|
15
|
+
*******************************/
|
16
|
+
|
17
|
+
.ui.ad {
|
18
|
+
display: block;
|
19
|
+
overflow: hidden;
|
20
|
+
margin: 1em 0em;
|
21
|
+
}
|
22
|
+
.ui.ad:first-child {
|
23
|
+
margin: 0em;
|
24
|
+
}
|
25
|
+
.ui.ad:last-child {
|
26
|
+
margin: 0em;
|
27
|
+
}
|
28
|
+
.ui.ad iframe {
|
29
|
+
margin: 0em;
|
30
|
+
padding: 0em;
|
31
|
+
border: none;
|
32
|
+
overflow: hidden;
|
33
|
+
}
|
34
|
+
|
35
|
+
/*--------------
|
36
|
+
Common
|
37
|
+
---------------*/
|
38
|
+
|
39
|
+
|
40
|
+
/* Leaderboard */
|
41
|
+
.ui.leaderboard.ad {
|
42
|
+
width: 728px;
|
43
|
+
height: 90px;
|
44
|
+
}
|
45
|
+
|
46
|
+
/* Medium Rectangle */
|
47
|
+
.ui[class*="medium rectangle"].ad {
|
48
|
+
width: 300px;
|
49
|
+
height: 250px;
|
50
|
+
}
|
51
|
+
|
52
|
+
/* Large Rectangle */
|
53
|
+
.ui[class*="large rectangle"].ad {
|
54
|
+
width: 336px;
|
55
|
+
height: 280px;
|
56
|
+
}
|
57
|
+
|
58
|
+
/* Half Page */
|
59
|
+
.ui[class*="half page"].ad {
|
60
|
+
width: 300px;
|
61
|
+
height: 600px;
|
62
|
+
}
|
63
|
+
|
64
|
+
/*--------------
|
65
|
+
Square
|
66
|
+
---------------*/
|
67
|
+
|
68
|
+
|
69
|
+
/* Square */
|
70
|
+
.ui.square.ad {
|
71
|
+
width: 250px;
|
72
|
+
height: 250px;
|
73
|
+
}
|
74
|
+
|
75
|
+
/* Small Square */
|
76
|
+
.ui[class*="small square"].ad {
|
77
|
+
width: 200px;
|
78
|
+
height: 200px;
|
79
|
+
}
|
80
|
+
|
81
|
+
/*--------------
|
82
|
+
Rectangle
|
83
|
+
---------------*/
|
84
|
+
|
85
|
+
|
86
|
+
/* Small Rectangle */
|
87
|
+
.ui[class*="small rectangle"].ad {
|
88
|
+
width: 180px;
|
89
|
+
height: 150px;
|
90
|
+
}
|
91
|
+
|
92
|
+
/* Vertical Rectangle */
|
93
|
+
.ui[class*="vertical rectangle"].ad {
|
94
|
+
width: 240px;
|
95
|
+
height: 400px;
|
96
|
+
}
|
97
|
+
|
98
|
+
/*--------------
|
99
|
+
Button
|
100
|
+
---------------*/
|
101
|
+
|
102
|
+
.ui.button.ad {
|
103
|
+
width: 120px;
|
104
|
+
height: 90px;
|
105
|
+
}
|
106
|
+
.ui[class*="square button"].ad {
|
107
|
+
width: 125px;
|
108
|
+
height: 125px;
|
109
|
+
}
|
110
|
+
.ui[class*="small button"].ad {
|
111
|
+
width: 120px;
|
112
|
+
height: 60px;
|
113
|
+
}
|
114
|
+
|
115
|
+
/*--------------
|
116
|
+
Skyscrapers
|
117
|
+
---------------*/
|
118
|
+
|
119
|
+
|
120
|
+
/* Skyscraper */
|
121
|
+
.ui.skyscraper.ad {
|
122
|
+
width: 120px;
|
123
|
+
height: 600px;
|
124
|
+
}
|
125
|
+
|
126
|
+
/* Wide Skyscraper */
|
127
|
+
.ui[class*="wide skyscraper"].ad {
|
128
|
+
width: 160px;
|
129
|
+
}
|
130
|
+
|
131
|
+
/*--------------
|
132
|
+
Banners
|
133
|
+
---------------*/
|
134
|
+
|
135
|
+
|
136
|
+
/* Banner */
|
137
|
+
.ui.banner.ad {
|
138
|
+
width: 468px;
|
139
|
+
height: 60px;
|
140
|
+
}
|
141
|
+
|
142
|
+
/* Vertical Banner */
|
143
|
+
.ui[class*="vertical banner"].ad {
|
144
|
+
width: 120px;
|
145
|
+
height: 240px;
|
146
|
+
}
|
147
|
+
|
148
|
+
/* Top Banner */
|
149
|
+
.ui[class*="top banner"].ad {
|
150
|
+
width: 930px;
|
151
|
+
height: 180px;
|
152
|
+
}
|
153
|
+
|
154
|
+
/* Half Banner */
|
155
|
+
.ui[class*="half banner"].ad {
|
156
|
+
width: 234px;
|
157
|
+
height: 60px;
|
158
|
+
}
|
159
|
+
|
160
|
+
/*--------------
|
161
|
+
Boards
|
162
|
+
---------------*/
|
163
|
+
|
164
|
+
|
165
|
+
/* Leaderboard */
|
166
|
+
.ui[class*="large leaderboard"].ad {
|
167
|
+
width: 970px;
|
168
|
+
height: 90px;
|
169
|
+
}
|
170
|
+
|
171
|
+
/* Billboard */
|
172
|
+
.ui.billboard.ad {
|
173
|
+
width: 970px;
|
174
|
+
height: 250px;
|
175
|
+
}
|
176
|
+
|
177
|
+
/*--------------
|
178
|
+
Panorama
|
179
|
+
---------------*/
|
180
|
+
|
181
|
+
|
182
|
+
/* Panorama */
|
183
|
+
.ui.panorama.ad {
|
184
|
+
width: 980px;
|
185
|
+
height: 120px;
|
186
|
+
}
|
187
|
+
|
188
|
+
/*--------------
|
189
|
+
Netboard
|
190
|
+
---------------*/
|
191
|
+
|
192
|
+
|
193
|
+
/* Netboard */
|
194
|
+
.ui.netboard.ad {
|
195
|
+
width: 580px;
|
196
|
+
height: 400px;
|
197
|
+
}
|
198
|
+
|
199
|
+
/*--------------
|
200
|
+
Mobile
|
201
|
+
---------------*/
|
202
|
+
|
203
|
+
|
204
|
+
/* Large Mobile Banner */
|
205
|
+
.ui[class*="large mobile banner"].ad {
|
206
|
+
width: 320px;
|
207
|
+
height: 100px;
|
208
|
+
}
|
209
|
+
|
210
|
+
/* Mobile Leaderboard */
|
211
|
+
.ui[class*="mobile leaderboard"].ad {
|
212
|
+
width: 320px;
|
213
|
+
height: 50px;
|
214
|
+
}
|
215
|
+
|
216
|
+
|
217
|
+
/*******************************
|
218
|
+
Types
|
219
|
+
*******************************/
|
220
|
+
|
221
|
+
|
222
|
+
/* Mobile Sizes */
|
223
|
+
.ui.mobile.ad {
|
224
|
+
display: none;
|
225
|
+
}
|
226
|
+
@media only screen and (max-width: 767px) {
|
227
|
+
.ui.mobile.ad {
|
228
|
+
display: block;
|
229
|
+
}
|
230
|
+
}
|
231
|
+
|
232
|
+
|
233
|
+
/*******************************
|
234
|
+
Variations
|
235
|
+
*******************************/
|
236
|
+
|
237
|
+
.ui.centered.ad {
|
238
|
+
margin-left: auto;
|
239
|
+
margin-right: auto;
|
240
|
+
}
|
241
|
+
.ui.test.ad {
|
242
|
+
position: relative;
|
243
|
+
background: #333333;
|
244
|
+
}
|
245
|
+
.ui.test.ad:after {
|
246
|
+
position: absolute;
|
247
|
+
top: 50%;
|
248
|
+
left: 50%;
|
249
|
+
width: 100%;
|
250
|
+
text-align: center;
|
251
|
+
-webkit-transform: translateX(-50%) translateY(-50%);
|
252
|
+
-ms-transform: translateX(-50%) translateY(-50%);
|
253
|
+
transform: translateX(-50%) translateY(-50%);
|
254
|
+
content: 'Ad';
|
255
|
+
color: #ffffff;
|
256
|
+
font-size: 1em;
|
257
|
+
font-weight: bold;
|
258
|
+
}
|
259
|
+
.ui.mobile.test.ad:after {
|
260
|
+
font-size: 0.85714em;
|
261
|
+
}
|
262
|
+
.ui.test.ad[data-text]:after {
|
263
|
+
content: attr(data-text);
|
264
|
+
}
|
265
|
+
|
266
|
+
|
267
|
+
/*******************************
|
268
|
+
Theme Overrides
|
269
|
+
*******************************/
|
270
|
+
|
271
|
+
|
272
|
+
|
273
|
+
/*******************************
|
274
|
+
User Variable Overrides
|
275
|
+
*******************************/
|
276
|
+
|
@@ -0,0 +1,10 @@
|
|
1
|
+
/*!
|
2
|
+
* # Semantic UI 1.11.4 - Ad
|
3
|
+
* http://github.com/semantic-org/semantic-ui/
|
4
|
+
*
|
5
|
+
*
|
6
|
+
* Copyright 2013 Contributors
|
7
|
+
* Released under the MIT license
|
8
|
+
* http://opensource.org/licenses/MIT
|
9
|
+
*
|
10
|
+
*/.ui.ad{display:block;overflow:hidden;margin:1em 0}.ui.ad:first-child,.ui.ad:last-child{margin:0}.ui.ad iframe{margin:0;padding:0;border:none;overflow:hidden}.ui.leaderboard.ad{width:728px;height:90px}.ui[class*="medium rectangle"].ad{width:300px;height:250px}.ui[class*="large rectangle"].ad{width:336px;height:280px}.ui[class*="half page"].ad{width:300px;height:600px}.ui.square.ad{width:250px;height:250px}.ui[class*="small square"].ad{width:200px;height:200px}.ui[class*="small rectangle"].ad{width:180px;height:150px}.ui[class*="vertical rectangle"].ad{width:240px;height:400px}.ui.button.ad{width:120px;height:90px}.ui[class*="square button"].ad{width:125px;height:125px}.ui[class*="small button"].ad{width:120px;height:60px}.ui.skyscraper.ad{width:120px;height:600px}.ui[class*="wide skyscraper"].ad{width:160px}.ui.banner.ad{width:468px;height:60px}.ui[class*="vertical banner"].ad{width:120px;height:240px}.ui[class*="top banner"].ad{width:930px;height:180px}.ui[class*="half banner"].ad{width:234px;height:60px}.ui[class*="large leaderboard"].ad{width:970px;height:90px}.ui.billboard.ad{width:970px;height:250px}.ui.panorama.ad{width:980px;height:120px}.ui.netboard.ad{width:580px;height:400px}.ui[class*="large mobile banner"].ad{width:320px;height:100px}.ui[class*="mobile leaderboard"].ad{width:320px;height:50px}.ui.mobile.ad{display:none}@media only screen and (max-width:767px){.ui.mobile.ad{display:block}}.ui.centered.ad{margin-left:auto;margin-right:auto}.ui.test.ad{position:relative;background:#333}.ui.test.ad:after{position:absolute;top:50%;left:50%;width:100%;text-align:center;-webkit-transform:translateX(-50%) translateY(-50%);-ms-transform:translateX(-50%) translateY(-50%);transform:translateX(-50%) translateY(-50%);content:'Ad';color:#fff;font-size:1em;font-weight:700}.ui.mobile.test.ad:after{font-size:.85714em}.ui.test.ad[data-text]:after{content:attr(data-text)}
|
@@ -0,0 +1,871 @@
|
|
1
|
+
/*!
|
2
|
+
* # Semantic UI 1.11.4 - API
|
3
|
+
* http://github.com/semantic-org/semantic-ui/
|
4
|
+
*
|
5
|
+
*
|
6
|
+
* Copyright 2014 Contributors
|
7
|
+
* Released under the MIT license
|
8
|
+
* http://opensource.org/licenses/MIT
|
9
|
+
*
|
10
|
+
*/
|
11
|
+
|
12
|
+
;(function ( $, window, document, undefined ) {
|
13
|
+
|
14
|
+
"use strict";
|
15
|
+
|
16
|
+
$.api = $.fn.api = function(parameters) {
|
17
|
+
|
18
|
+
var
|
19
|
+
// use window context if none specified
|
20
|
+
$allModules = $.isFunction(this)
|
21
|
+
? $(window)
|
22
|
+
: $(this),
|
23
|
+
moduleSelector = $allModules.selector || '',
|
24
|
+
time = new Date().getTime(),
|
25
|
+
performance = [],
|
26
|
+
|
27
|
+
query = arguments[0],
|
28
|
+
methodInvoked = (typeof query == 'string'),
|
29
|
+
queryArguments = [].slice.call(arguments, 1),
|
30
|
+
|
31
|
+
returnedValue
|
32
|
+
;
|
33
|
+
|
34
|
+
$allModules
|
35
|
+
.each(function() {
|
36
|
+
var
|
37
|
+
settings = ( $.isPlainObject(parameters) )
|
38
|
+
? $.extend(true, {}, $.fn.api.settings, parameters)
|
39
|
+
: $.extend({}, $.fn.api.settings),
|
40
|
+
|
41
|
+
// internal aliases
|
42
|
+
namespace = settings.namespace,
|
43
|
+
metadata = settings.metadata,
|
44
|
+
selector = settings.selector,
|
45
|
+
error = settings.error,
|
46
|
+
className = settings.className,
|
47
|
+
|
48
|
+
// define namespaces for modules
|
49
|
+
eventNamespace = '.' + namespace,
|
50
|
+
moduleNamespace = 'module-' + namespace,
|
51
|
+
|
52
|
+
// element that creates request
|
53
|
+
$module = $(this),
|
54
|
+
$form = $module.closest(selector.form),
|
55
|
+
|
56
|
+
// context used for state
|
57
|
+
$context = (settings.stateContext)
|
58
|
+
? $(settings.stateContext)
|
59
|
+
: $module,
|
60
|
+
|
61
|
+
// request details
|
62
|
+
ajaxSettings,
|
63
|
+
requestSettings,
|
64
|
+
url,
|
65
|
+
data,
|
66
|
+
|
67
|
+
// standard module
|
68
|
+
element = this,
|
69
|
+
context = $context.get(),
|
70
|
+
instance = $module.data(moduleNamespace),
|
71
|
+
module
|
72
|
+
;
|
73
|
+
|
74
|
+
module = {
|
75
|
+
|
76
|
+
initialize: function() {
|
77
|
+
var
|
78
|
+
triggerEvent = module.get.event()
|
79
|
+
;
|
80
|
+
// bind events
|
81
|
+
if(!methodInvoked) {
|
82
|
+
if( triggerEvent ) {
|
83
|
+
module.debug('Attaching API events to element', triggerEvent);
|
84
|
+
$module
|
85
|
+
.on(triggerEvent + eventNamespace, module.event.trigger)
|
86
|
+
;
|
87
|
+
}
|
88
|
+
else if(settings.on == 'now') {
|
89
|
+
module.debug('Querying API now', triggerEvent);
|
90
|
+
module.query();
|
91
|
+
}
|
92
|
+
}
|
93
|
+
module.instantiate();
|
94
|
+
},
|
95
|
+
|
96
|
+
instantiate: function() {
|
97
|
+
module.verbose('Storing instance of module', module);
|
98
|
+
instance = module;
|
99
|
+
$module
|
100
|
+
.data(moduleNamespace, instance)
|
101
|
+
;
|
102
|
+
},
|
103
|
+
|
104
|
+
destroy: function() {
|
105
|
+
module.verbose('Destroying previous module for', element);
|
106
|
+
$module
|
107
|
+
.removeData(moduleNamespace)
|
108
|
+
.off(eventNamespace)
|
109
|
+
;
|
110
|
+
},
|
111
|
+
|
112
|
+
query: function() {
|
113
|
+
|
114
|
+
if(module.is.disabled()) {
|
115
|
+
module.debug('Element is disabled API request aborted');
|
116
|
+
return;
|
117
|
+
}
|
118
|
+
// determine if an api event already occurred
|
119
|
+
if(module.is.loading() && settings.throttle === 0 ) {
|
120
|
+
module.debug('Cancelling request, previous request is still pending');
|
121
|
+
return;
|
122
|
+
}
|
123
|
+
|
124
|
+
// pass element metadata to url (value, text)
|
125
|
+
if(settings.defaultData) {
|
126
|
+
$.extend(true, settings.urlData, module.get.defaultData());
|
127
|
+
}
|
128
|
+
|
129
|
+
// Add form content
|
130
|
+
if(settings.serializeForm !== false || $context.is('form')) {
|
131
|
+
if(settings.serializeForm == 'json') {
|
132
|
+
$.extend(true, settings.data, module.get.formData());
|
133
|
+
}
|
134
|
+
else {
|
135
|
+
settings.data = module.get.formData();
|
136
|
+
}
|
137
|
+
}
|
138
|
+
|
139
|
+
// call beforesend and get any settings changes
|
140
|
+
requestSettings = module.get.settings();
|
141
|
+
|
142
|
+
// check if before send cancelled request
|
143
|
+
if(requestSettings === false) {
|
144
|
+
module.cancelled = true;
|
145
|
+
module.error(error.beforeSend);
|
146
|
+
return;
|
147
|
+
}
|
148
|
+
else {
|
149
|
+
module.cancelled = false;
|
150
|
+
}
|
151
|
+
|
152
|
+
if(settings.url) {
|
153
|
+
// override with url if specified
|
154
|
+
module.debug('Using specified url', url);
|
155
|
+
url = module.add.urlData( settings.url );
|
156
|
+
}
|
157
|
+
else {
|
158
|
+
// otherwise find url from api endpoints
|
159
|
+
url = module.add.urlData( module.get.templateURL() );
|
160
|
+
module.debug('Added URL Data to url', url);
|
161
|
+
}
|
162
|
+
|
163
|
+
// exit conditions reached, missing url parameters
|
164
|
+
if( !url ) {
|
165
|
+
if( module.is.form() ) {
|
166
|
+
url = $module.attr('action') || '';
|
167
|
+
module.debug('No url or action specified, defaulting to form action', url);
|
168
|
+
}
|
169
|
+
else {
|
170
|
+
module.error(error.missingURL, settings.action);
|
171
|
+
return;
|
172
|
+
}
|
173
|
+
}
|
174
|
+
|
175
|
+
// add loading state
|
176
|
+
module.set.loading();
|
177
|
+
|
178
|
+
// look for jQuery ajax parameters in settings
|
179
|
+
ajaxSettings = $.extend(true, {}, settings, {
|
180
|
+
type : settings.method || settings.type,
|
181
|
+
data : data,
|
182
|
+
url : settings.base + url,
|
183
|
+
beforeSend : settings.beforeXHR,
|
184
|
+
success : function() {},
|
185
|
+
failure : function() {},
|
186
|
+
complete : function() {}
|
187
|
+
});
|
188
|
+
|
189
|
+
module.debug('Querying URL', ajaxSettings.url);
|
190
|
+
module.debug('Sending data', data, ajaxSettings.method);
|
191
|
+
module.verbose('Using AJAX settings', ajaxSettings);
|
192
|
+
|
193
|
+
if( module.is.loading() ) {
|
194
|
+
// throttle additional requests
|
195
|
+
module.timer = setTimeout(function() {
|
196
|
+
module.request = module.create.request();
|
197
|
+
module.xhr = module.create.xhr();
|
198
|
+
settings.onRequest.call(context, module.request, module.xhr);
|
199
|
+
}, settings.throttle);
|
200
|
+
}
|
201
|
+
else {
|
202
|
+
// immediately on first request
|
203
|
+
module.request = module.create.request();
|
204
|
+
module.xhr = module.create.xhr();
|
205
|
+
settings.onRequest.call(context, module.request, module.xhr);
|
206
|
+
}
|
207
|
+
|
208
|
+
},
|
209
|
+
|
210
|
+
|
211
|
+
is: {
|
212
|
+
disabled: function() {
|
213
|
+
return ($module.filter(settings.filter).length > 0);
|
214
|
+
},
|
215
|
+
form: function() {
|
216
|
+
return $module.is('form');
|
217
|
+
},
|
218
|
+
input: function() {
|
219
|
+
return $module.is('input');
|
220
|
+
},
|
221
|
+
loading: function() {
|
222
|
+
return (module.request && module.request.state() == 'pending');
|
223
|
+
}
|
224
|
+
},
|
225
|
+
|
226
|
+
was: {
|
227
|
+
cancelled: function() {
|
228
|
+
return (module.cancelled || false);
|
229
|
+
},
|
230
|
+
succesful: function() {
|
231
|
+
return (module.request && module.request.state() == 'resolved');
|
232
|
+
},
|
233
|
+
failure: function() {
|
234
|
+
return (module.request && module.request.state() == 'rejected');
|
235
|
+
},
|
236
|
+
complete: function() {
|
237
|
+
return (module.request && (module.request.state() == 'resolved' || module.request.state() == 'rejected') );
|
238
|
+
}
|
239
|
+
},
|
240
|
+
|
241
|
+
add: {
|
242
|
+
urlData: function(url, urlData) {
|
243
|
+
var
|
244
|
+
requiredVariables,
|
245
|
+
optionalVariables
|
246
|
+
;
|
247
|
+
if(url) {
|
248
|
+
requiredVariables = url.match(settings.regExp.required);
|
249
|
+
optionalVariables = url.match(settings.regExp.optional);
|
250
|
+
urlData = urlData || settings.urlData;
|
251
|
+
if(requiredVariables) {
|
252
|
+
module.debug('Looking for required URL variables', requiredVariables);
|
253
|
+
$.each(requiredVariables, function(index, templatedString) {
|
254
|
+
var
|
255
|
+
// allow legacy {$var} style
|
256
|
+
variable = (templatedString.indexOf('$') !== -1)
|
257
|
+
? templatedString.substr(2, templatedString.length - 3)
|
258
|
+
: templatedString.substr(1, templatedString.length - 2),
|
259
|
+
value = ($.isPlainObject(urlData) && urlData[variable] !== undefined)
|
260
|
+
? urlData[variable]
|
261
|
+
: ($module.data(variable) !== undefined)
|
262
|
+
? $module.data(variable)
|
263
|
+
: ($context.data(variable) !== undefined)
|
264
|
+
? $context.data(variable)
|
265
|
+
: urlData[variable]
|
266
|
+
;
|
267
|
+
// remove value
|
268
|
+
if(value === undefined) {
|
269
|
+
module.error(error.requiredParameter, variable, url);
|
270
|
+
url = false;
|
271
|
+
return false;
|
272
|
+
}
|
273
|
+
else {
|
274
|
+
module.verbose('Found required variable', variable, value);
|
275
|
+
url = url.replace(templatedString, value);
|
276
|
+
}
|
277
|
+
});
|
278
|
+
}
|
279
|
+
if(optionalVariables) {
|
280
|
+
module.debug('Looking for optional URL variables', requiredVariables);
|
281
|
+
$.each(optionalVariables, function(index, templatedString) {
|
282
|
+
var
|
283
|
+
// allow legacy {/$var} style
|
284
|
+
variable = (templatedString.indexOf('$') !== -1)
|
285
|
+
? templatedString.substr(3, templatedString.length - 4)
|
286
|
+
: templatedString.substr(2, templatedString.length - 3),
|
287
|
+
value = ($.isPlainObject(urlData) && urlData[variable] !== undefined)
|
288
|
+
? urlData[variable]
|
289
|
+
: ($module.data(variable) !== undefined)
|
290
|
+
? $module.data(variable)
|
291
|
+
: ($context.data(variable) !== undefined)
|
292
|
+
? $context.data(variable)
|
293
|
+
: urlData[variable]
|
294
|
+
;
|
295
|
+
// optional replacement
|
296
|
+
if(value !== undefined) {
|
297
|
+
module.verbose('Optional variable Found', variable, value);
|
298
|
+
url = url.replace(templatedString, value);
|
299
|
+
}
|
300
|
+
else {
|
301
|
+
module.verbose('Optional variable not found', variable);
|
302
|
+
// remove preceding slash if set
|
303
|
+
if(url.indexOf('/' + templatedString) !== -1) {
|
304
|
+
url = url.replace('/' + templatedString, '');
|
305
|
+
}
|
306
|
+
else {
|
307
|
+
url = url.replace(templatedString, '');
|
308
|
+
}
|
309
|
+
}
|
310
|
+
});
|
311
|
+
}
|
312
|
+
}
|
313
|
+
return url;
|
314
|
+
}
|
315
|
+
},
|
316
|
+
|
317
|
+
event: {
|
318
|
+
trigger: function(event) {
|
319
|
+
module.query();
|
320
|
+
if(event.type == 'submit' || event.type == 'click') {
|
321
|
+
event.preventDefault();
|
322
|
+
}
|
323
|
+
},
|
324
|
+
xhr: {
|
325
|
+
always: function() {
|
326
|
+
// calculate if loading time was below minimum threshold
|
327
|
+
},
|
328
|
+
done: function(response) {
|
329
|
+
var
|
330
|
+
context = this,
|
331
|
+
elapsedTime = (new Date().getTime() - time),
|
332
|
+
timeLeft = (settings.loadingDuration - elapsedTime)
|
333
|
+
;
|
334
|
+
timeLeft = (timeLeft > 0)
|
335
|
+
? timeLeft
|
336
|
+
: 0
|
337
|
+
;
|
338
|
+
setTimeout(function() {
|
339
|
+
module.request.resolveWith(context, [response]);
|
340
|
+
}, timeLeft);
|
341
|
+
},
|
342
|
+
fail: function(xhr, status, httpMessage) {
|
343
|
+
var
|
344
|
+
context = this,
|
345
|
+
elapsedTime = (new Date().getTime() - time),
|
346
|
+
timeLeft = (settings.loadingDuration - elapsedTime)
|
347
|
+
;
|
348
|
+
timeLeft = (timeLeft > 0)
|
349
|
+
? timeLeft
|
350
|
+
: 0
|
351
|
+
;
|
352
|
+
// page triggers abort on navigation, dont show error
|
353
|
+
setTimeout(function() {
|
354
|
+
if(status !== 'abort') {
|
355
|
+
module.request.rejectWith(context, [xhr, status, httpMessage]);
|
356
|
+
}
|
357
|
+
else {
|
358
|
+
module.reset();
|
359
|
+
}
|
360
|
+
}, timeLeft);
|
361
|
+
}
|
362
|
+
},
|
363
|
+
request: {
|
364
|
+
complete: function(response) {
|
365
|
+
module.remove.loading();
|
366
|
+
settings.onComplete.call(context, response, $module);
|
367
|
+
},
|
368
|
+
done: function(response) {
|
369
|
+
module.debug('API Response Received', response);
|
370
|
+
if(settings.dataType == 'json') {
|
371
|
+
if( $.isFunction(settings.successTest) ) {
|
372
|
+
module.debug('Checking JSON returned success', settings.successTest, response);
|
373
|
+
if( settings.successTest(response) ) {
|
374
|
+
settings.onSuccess.call(context, response, $module);
|
375
|
+
}
|
376
|
+
else {
|
377
|
+
module.debug('JSON test specified by user and response failed', response);
|
378
|
+
settings.onFailure.call(context, response, $module);
|
379
|
+
}
|
380
|
+
}
|
381
|
+
else {
|
382
|
+
settings.onSuccess.call(context, response, $module);
|
383
|
+
}
|
384
|
+
}
|
385
|
+
else {
|
386
|
+
settings.onSuccess.call(context, response, $module);
|
387
|
+
}
|
388
|
+
},
|
389
|
+
error: function(xhr, status, httpMessage) {
|
390
|
+
var
|
391
|
+
errorMessage = (settings.error[status] !== undefined)
|
392
|
+
? settings.error[status]
|
393
|
+
: httpMessage,
|
394
|
+
response
|
395
|
+
;
|
396
|
+
// let em know unless request aborted
|
397
|
+
if(xhr !== undefined) {
|
398
|
+
// readyState 4 = done, anything less is not really sent
|
399
|
+
if(xhr.readyState !== undefined && xhr.readyState == 4) {
|
400
|
+
|
401
|
+
// if http status code returned and json returned error, look for it
|
402
|
+
if( xhr.status != 200 && httpMessage !== undefined && httpMessage !== '') {
|
403
|
+
module.error(error.statusMessage + httpMessage, ajaxSettings.url);
|
404
|
+
}
|
405
|
+
else {
|
406
|
+
if(status == 'error' && settings.dataType == 'json') {
|
407
|
+
try {
|
408
|
+
response = $.parseJSON(xhr.responseText);
|
409
|
+
if(response && response.error !== undefined) {
|
410
|
+
errorMessage = response.error;
|
411
|
+
}
|
412
|
+
}
|
413
|
+
catch(e) {
|
414
|
+
module.error(error.JSONParse);
|
415
|
+
}
|
416
|
+
}
|
417
|
+
}
|
418
|
+
module.remove.loading();
|
419
|
+
module.set.error();
|
420
|
+
// show error state only for duration specified in settings
|
421
|
+
if(settings.errorDuration) {
|
422
|
+
setTimeout(module.remove.error, settings.errorDuration);
|
423
|
+
}
|
424
|
+
module.debug('API Request error:', errorMessage);
|
425
|
+
settings.onError.call(context, errorMessage, $module);
|
426
|
+
}
|
427
|
+
else {
|
428
|
+
settings.onAbort.call(context, errorMessage, $module);
|
429
|
+
module.debug('Request Aborted (Most likely caused by page change or CORS Policy)', status, httpMessage);
|
430
|
+
}
|
431
|
+
}
|
432
|
+
}
|
433
|
+
}
|
434
|
+
},
|
435
|
+
|
436
|
+
create: {
|
437
|
+
request: function() {
|
438
|
+
return $.Deferred()
|
439
|
+
.always(module.event.request.complete)
|
440
|
+
.done(module.event.request.done)
|
441
|
+
.fail(module.event.request.error)
|
442
|
+
;
|
443
|
+
},
|
444
|
+
xhr: function() {
|
445
|
+
return $.ajax(ajaxSettings)
|
446
|
+
.always(module.event.xhr.always)
|
447
|
+
.done(module.event.xhr.done)
|
448
|
+
.fail(module.event.xhr.fail)
|
449
|
+
;
|
450
|
+
}
|
451
|
+
},
|
452
|
+
|
453
|
+
set: {
|
454
|
+
error: function() {
|
455
|
+
module.verbose('Adding error state to element', $context);
|
456
|
+
$context.addClass(className.error);
|
457
|
+
},
|
458
|
+
loading: function() {
|
459
|
+
module.verbose('Adding loading state to element', $context);
|
460
|
+
$context.addClass(className.loading);
|
461
|
+
}
|
462
|
+
},
|
463
|
+
|
464
|
+
remove: {
|
465
|
+
error: function() {
|
466
|
+
module.verbose('Removing error state from element', $context);
|
467
|
+
$context.removeClass(className.error);
|
468
|
+
},
|
469
|
+
loading: function() {
|
470
|
+
module.verbose('Removing loading state from element', $context);
|
471
|
+
$context.removeClass(className.loading);
|
472
|
+
}
|
473
|
+
},
|
474
|
+
|
475
|
+
get: {
|
476
|
+
request: function() {
|
477
|
+
return module.request || false;
|
478
|
+
},
|
479
|
+
xhr: function() {
|
480
|
+
return module.xhr || false;
|
481
|
+
},
|
482
|
+
settings: function() {
|
483
|
+
var
|
484
|
+
runSettings
|
485
|
+
;
|
486
|
+
runSettings = settings.beforeSend.call($module, settings);
|
487
|
+
if(runSettings) {
|
488
|
+
if(runSettings.success !== undefined) {
|
489
|
+
module.debug('Legacy success callback detected', runSettings);
|
490
|
+
module.error(error.legacyParameters, runSettings.success);
|
491
|
+
runSettings.onSuccess = runSettings.success;
|
492
|
+
}
|
493
|
+
if(runSettings.failure !== undefined) {
|
494
|
+
module.debug('Legacy failure callback detected', runSettings);
|
495
|
+
module.error(error.legacyParameters, runSettings.failure);
|
496
|
+
runSettings.onFailure = runSettings.failure;
|
497
|
+
}
|
498
|
+
if(runSettings.complete !== undefined) {
|
499
|
+
module.debug('Legacy complete callback detected', runSettings);
|
500
|
+
module.error(error.legacyParameters, runSettings.complete);
|
501
|
+
runSettings.onComplete = runSettings.complete;
|
502
|
+
}
|
503
|
+
}
|
504
|
+
if(runSettings === undefined) {
|
505
|
+
module.error(error.noReturnedValue);
|
506
|
+
}
|
507
|
+
return (runSettings !== undefined)
|
508
|
+
? runSettings
|
509
|
+
: settings
|
510
|
+
;
|
511
|
+
},
|
512
|
+
defaultData: function() {
|
513
|
+
var
|
514
|
+
data = {}
|
515
|
+
;
|
516
|
+
if( !$.isWindow(element) ) {
|
517
|
+
if( module.is.input() ) {
|
518
|
+
data.value = $module.val();
|
519
|
+
}
|
520
|
+
else if( !module.is.form() ) {
|
521
|
+
|
522
|
+
}
|
523
|
+
else {
|
524
|
+
data.text = $module.text();
|
525
|
+
}
|
526
|
+
}
|
527
|
+
return data;
|
528
|
+
},
|
529
|
+
event: function() {
|
530
|
+
if( $.isWindow(element) || settings.on == 'now' ) {
|
531
|
+
module.debug('API called without element, no events attached');
|
532
|
+
return false;
|
533
|
+
}
|
534
|
+
else if(settings.on == 'auto') {
|
535
|
+
if( $module.is('input') ) {
|
536
|
+
return (element.oninput !== undefined)
|
537
|
+
? 'input'
|
538
|
+
: (element.onpropertychange !== undefined)
|
539
|
+
? 'propertychange'
|
540
|
+
: 'keyup'
|
541
|
+
;
|
542
|
+
}
|
543
|
+
else if( $module.is('form') ) {
|
544
|
+
return 'submit';
|
545
|
+
}
|
546
|
+
else {
|
547
|
+
return 'click';
|
548
|
+
}
|
549
|
+
}
|
550
|
+
else {
|
551
|
+
return settings.on;
|
552
|
+
}
|
553
|
+
},
|
554
|
+
formData: function() {
|
555
|
+
var
|
556
|
+
formData
|
557
|
+
;
|
558
|
+
if($module.serializeObject !== undefined) {
|
559
|
+
formData = $form.serializeObject();
|
560
|
+
}
|
561
|
+
else {
|
562
|
+
module.error(error.missingSerialize);
|
563
|
+
formData = $form.serialize();
|
564
|
+
}
|
565
|
+
module.debug('Retrieved form data', formData);
|
566
|
+
return formData;
|
567
|
+
},
|
568
|
+
templateURL: function(action) {
|
569
|
+
var
|
570
|
+
url
|
571
|
+
;
|
572
|
+
action = action || $module.data(metadata.action) || settings.action || false;
|
573
|
+
if(action) {
|
574
|
+
module.debug('Looking up url for action', action, settings.api);
|
575
|
+
if(settings.api[action] !== undefined) {
|
576
|
+
url = settings.api[action];
|
577
|
+
module.debug('Found template url', url);
|
578
|
+
}
|
579
|
+
else if( !module.is.form() ) {
|
580
|
+
module.error(error.missingAction, settings.action, settings.api);
|
581
|
+
}
|
582
|
+
}
|
583
|
+
return url;
|
584
|
+
}
|
585
|
+
},
|
586
|
+
|
587
|
+
abort: function() {
|
588
|
+
var
|
589
|
+
xhr = module.get.xhr()
|
590
|
+
;
|
591
|
+
if( xhr && xhr.state() !== 'resolved') {
|
592
|
+
module.debug('Cancelling API request');
|
593
|
+
xhr.abort();
|
594
|
+
module.request.rejectWith(settings.apiSettings);
|
595
|
+
}
|
596
|
+
},
|
597
|
+
|
598
|
+
// reset state
|
599
|
+
reset: function() {
|
600
|
+
module.remove.error();
|
601
|
+
module.remove.loading();
|
602
|
+
},
|
603
|
+
|
604
|
+
setting: function(name, value) {
|
605
|
+
module.debug('Changing setting', name, value);
|
606
|
+
if( $.isPlainObject(name) ) {
|
607
|
+
$.extend(true, settings, name);
|
608
|
+
}
|
609
|
+
else if(value !== undefined) {
|
610
|
+
settings[name] = value;
|
611
|
+
}
|
612
|
+
else {
|
613
|
+
return settings[name];
|
614
|
+
}
|
615
|
+
},
|
616
|
+
internal: function(name, value) {
|
617
|
+
if( $.isPlainObject(name) ) {
|
618
|
+
$.extend(true, module, name);
|
619
|
+
}
|
620
|
+
else if(value !== undefined) {
|
621
|
+
module[name] = value;
|
622
|
+
}
|
623
|
+
else {
|
624
|
+
return module[name];
|
625
|
+
}
|
626
|
+
},
|
627
|
+
debug: function() {
|
628
|
+
if(settings.debug) {
|
629
|
+
if(settings.performance) {
|
630
|
+
module.performance.log(arguments);
|
631
|
+
}
|
632
|
+
else {
|
633
|
+
module.debug = Function.prototype.bind.call(console.info, console, settings.name + ':');
|
634
|
+
module.debug.apply(console, arguments);
|
635
|
+
}
|
636
|
+
}
|
637
|
+
},
|
638
|
+
verbose: function() {
|
639
|
+
if(settings.verbose && settings.debug) {
|
640
|
+
if(settings.performance) {
|
641
|
+
module.performance.log(arguments);
|
642
|
+
}
|
643
|
+
else {
|
644
|
+
module.verbose = Function.prototype.bind.call(console.info, console, settings.name + ':');
|
645
|
+
module.verbose.apply(console, arguments);
|
646
|
+
}
|
647
|
+
}
|
648
|
+
},
|
649
|
+
error: function() {
|
650
|
+
module.error = Function.prototype.bind.call(console.error, console, settings.name + ':');
|
651
|
+
module.error.apply(console, arguments);
|
652
|
+
},
|
653
|
+
performance: {
|
654
|
+
log: function(message) {
|
655
|
+
var
|
656
|
+
currentTime,
|
657
|
+
executionTime,
|
658
|
+
previousTime
|
659
|
+
;
|
660
|
+
if(settings.performance) {
|
661
|
+
currentTime = new Date().getTime();
|
662
|
+
previousTime = time || currentTime;
|
663
|
+
executionTime = currentTime - previousTime;
|
664
|
+
time = currentTime;
|
665
|
+
performance.push({
|
666
|
+
'Name' : message[0],
|
667
|
+
'Arguments' : [].slice.call(message, 1) || '',
|
668
|
+
//'Element' : element,
|
669
|
+
'Execution Time' : executionTime
|
670
|
+
});
|
671
|
+
}
|
672
|
+
clearTimeout(module.performance.timer);
|
673
|
+
module.performance.timer = setTimeout(module.performance.display, 100);
|
674
|
+
},
|
675
|
+
display: function() {
|
676
|
+
var
|
677
|
+
title = settings.name + ':',
|
678
|
+
totalTime = 0
|
679
|
+
;
|
680
|
+
time = false;
|
681
|
+
clearTimeout(module.performance.timer);
|
682
|
+
$.each(performance, function(index, data) {
|
683
|
+
totalTime += data['Execution Time'];
|
684
|
+
});
|
685
|
+
title += ' ' + totalTime + 'ms';
|
686
|
+
if(moduleSelector) {
|
687
|
+
title += ' \'' + moduleSelector + '\'';
|
688
|
+
}
|
689
|
+
if( (console.group !== undefined || console.table !== undefined) && performance.length > 0) {
|
690
|
+
console.groupCollapsed(title);
|
691
|
+
if(console.table) {
|
692
|
+
console.table(performance);
|
693
|
+
}
|
694
|
+
else {
|
695
|
+
$.each(performance, function(index, data) {
|
696
|
+
console.log(data['Name'] + ': ' + data['Execution Time']+'ms');
|
697
|
+
});
|
698
|
+
}
|
699
|
+
console.groupEnd();
|
700
|
+
}
|
701
|
+
performance = [];
|
702
|
+
}
|
703
|
+
},
|
704
|
+
invoke: function(query, passedArguments, context) {
|
705
|
+
var
|
706
|
+
object = instance,
|
707
|
+
maxDepth,
|
708
|
+
found,
|
709
|
+
response
|
710
|
+
;
|
711
|
+
passedArguments = passedArguments || queryArguments;
|
712
|
+
context = element || context;
|
713
|
+
if(typeof query == 'string' && object !== undefined) {
|
714
|
+
query = query.split(/[\. ]/);
|
715
|
+
maxDepth = query.length - 1;
|
716
|
+
$.each(query, function(depth, value) {
|
717
|
+
var camelCaseValue = (depth != maxDepth)
|
718
|
+
? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
|
719
|
+
: query
|
720
|
+
;
|
721
|
+
if( $.isPlainObject( object[camelCaseValue] ) && (depth != maxDepth) ) {
|
722
|
+
object = object[camelCaseValue];
|
723
|
+
}
|
724
|
+
else if( object[camelCaseValue] !== undefined ) {
|
725
|
+
found = object[camelCaseValue];
|
726
|
+
return false;
|
727
|
+
}
|
728
|
+
else if( $.isPlainObject( object[value] ) && (depth != maxDepth) ) {
|
729
|
+
object = object[value];
|
730
|
+
}
|
731
|
+
else if( object[value] !== undefined ) {
|
732
|
+
found = object[value];
|
733
|
+
return false;
|
734
|
+
}
|
735
|
+
else {
|
736
|
+
module.error(error.method, query);
|
737
|
+
return false;
|
738
|
+
}
|
739
|
+
});
|
740
|
+
}
|
741
|
+
if ( $.isFunction( found ) ) {
|
742
|
+
response = found.apply(context, passedArguments);
|
743
|
+
}
|
744
|
+
else if(found !== undefined) {
|
745
|
+
response = found;
|
746
|
+
}
|
747
|
+
if($.isArray(returnedValue)) {
|
748
|
+
returnedValue.push(response);
|
749
|
+
}
|
750
|
+
else if(returnedValue !== undefined) {
|
751
|
+
returnedValue = [returnedValue, response];
|
752
|
+
}
|
753
|
+
else if(response !== undefined) {
|
754
|
+
returnedValue = response;
|
755
|
+
}
|
756
|
+
return found;
|
757
|
+
}
|
758
|
+
};
|
759
|
+
|
760
|
+
if(methodInvoked) {
|
761
|
+
if(instance === undefined) {
|
762
|
+
module.initialize();
|
763
|
+
}
|
764
|
+
module.invoke(query);
|
765
|
+
}
|
766
|
+
else {
|
767
|
+
if(instance !== undefined) {
|
768
|
+
instance.invoke('destroy');
|
769
|
+
}
|
770
|
+
module.initialize();
|
771
|
+
}
|
772
|
+
})
|
773
|
+
;
|
774
|
+
|
775
|
+
return (returnedValue !== undefined)
|
776
|
+
? returnedValue
|
777
|
+
: this
|
778
|
+
;
|
779
|
+
};
|
780
|
+
|
781
|
+
$.api.settings = {
|
782
|
+
|
783
|
+
name : 'API',
|
784
|
+
namespace : 'api',
|
785
|
+
|
786
|
+
debug : true,
|
787
|
+
verbose : false,
|
788
|
+
performance : true,
|
789
|
+
|
790
|
+
// event binding
|
791
|
+
on : 'auto',
|
792
|
+
filter : '.disabled',
|
793
|
+
stateContext : false,
|
794
|
+
|
795
|
+
// state
|
796
|
+
loadingDuration : 0,
|
797
|
+
errorDuration : 2000,
|
798
|
+
|
799
|
+
// templating
|
800
|
+
action : false,
|
801
|
+
url : false,
|
802
|
+
base : '',
|
803
|
+
|
804
|
+
// data
|
805
|
+
urlData : {},
|
806
|
+
|
807
|
+
// ui
|
808
|
+
defaultData : true,
|
809
|
+
serializeForm : false,
|
810
|
+
throttle : 0,
|
811
|
+
|
812
|
+
// jQ ajax
|
813
|
+
method : 'get',
|
814
|
+
data : {},
|
815
|
+
dataType : 'json',
|
816
|
+
|
817
|
+
// callbacks
|
818
|
+
beforeSend : function(settings) { return settings; },
|
819
|
+
beforeXHR : function(xhr) {},
|
820
|
+
|
821
|
+
onRequest : function(promise, xhr) {},
|
822
|
+
onSuccess : function(response, $module) {},
|
823
|
+
onComplete : function(response, $module) {},
|
824
|
+
onFailure : function(errorMessage, $module) {},
|
825
|
+
onError : function(errorMessage, $module) {},
|
826
|
+
onAbort : function(errorMessage, $module) {},
|
827
|
+
|
828
|
+
successTest : false,
|
829
|
+
|
830
|
+
// errors
|
831
|
+
error : {
|
832
|
+
beforeSend : 'The before send function has aborted the request',
|
833
|
+
error : 'There was an error with your request',
|
834
|
+
exitConditions : 'API Request Aborted. Exit conditions met',
|
835
|
+
JSONParse : 'JSON could not be parsed during error handling',
|
836
|
+
legacyParameters : 'You are using legacy API success callback names',
|
837
|
+
method : 'The method you called is not defined',
|
838
|
+
missingAction : 'API action used but no url was defined',
|
839
|
+
missingSerialize : 'Required dependency jquery-serialize-object missing, using basic serialize',
|
840
|
+
missingURL : 'No URL specified for api event',
|
841
|
+
noReturnedValue : 'The beforeSend callback must return a settings object, beforeSend ignored.',
|
842
|
+
parseError : 'There was an error parsing your request',
|
843
|
+
requiredParameter : 'Missing a required URL parameter: ',
|
844
|
+
statusMessage : 'Server gave an error: ',
|
845
|
+
timeout : 'Your request timed out'
|
846
|
+
},
|
847
|
+
|
848
|
+
regExp : {
|
849
|
+
required: /\{\$*[A-z0-9]+\}/g,
|
850
|
+
optional: /\{\/\$*[A-z0-9]+\}/g,
|
851
|
+
},
|
852
|
+
|
853
|
+
className: {
|
854
|
+
loading : 'loading',
|
855
|
+
error : 'error'
|
856
|
+
},
|
857
|
+
|
858
|
+
selector: {
|
859
|
+
form: 'form'
|
860
|
+
},
|
861
|
+
|
862
|
+
metadata: {
|
863
|
+
action : 'action'
|
864
|
+
}
|
865
|
+
};
|
866
|
+
|
867
|
+
|
868
|
+
$.api.settings.api = {};
|
869
|
+
|
870
|
+
|
871
|
+
})( jQuery, window , document );
|