uikit2-rails 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +10 -0
- data/.travis.yml +4 -0
- data/Gemfile +4 -0
- data/README.md +66 -0
- data/Rakefile +1 -0
- data/bin/console +14 -0
- data/bin/setup +7 -0
- data/lib/uikit2/rails.rb +8 -0
- data/lib/uikit2/rails/version.rb +5 -0
- data/uikit2-rails.gemspec +25 -0
- data/vendor/assets/fonts/FontAwesome.otf +0 -0
- data/vendor/assets/fonts/fontawesome-webfont.eot +0 -0
- data/vendor/assets/fonts/fontawesome-webfont.ttf +0 -0
- data/vendor/assets/fonts/fontawesome-webfont.woff +0 -0
- data/vendor/assets/fonts/fontawesome-webfont.woff2 +0 -0
- data/vendor/assets/javascripts/uikit.js +3537 -0
- data/vendor/assets/javascripts/uikit/components/accordion.js +172 -0
- data/vendor/assets/javascripts/uikit/components/accordion.min.js +2 -0
- data/vendor/assets/javascripts/uikit/components/autocomplete.js +334 -0
- data/vendor/assets/javascripts/uikit/components/autocomplete.min.js +2 -0
- data/vendor/assets/javascripts/uikit/components/datepicker.js +3166 -0
- data/vendor/assets/javascripts/uikit/components/datepicker.min.js +3 -0
- data/vendor/assets/javascripts/uikit/components/form-password.js +67 -0
- data/vendor/assets/javascripts/uikit/components/form-password.min.js +2 -0
- data/vendor/assets/javascripts/uikit/components/form-select.js +70 -0
- data/vendor/assets/javascripts/uikit/components/form-select.min.js +2 -0
- data/vendor/assets/javascripts/uikit/components/grid.js +523 -0
- data/vendor/assets/javascripts/uikit/components/grid.min.js +2 -0
- data/vendor/assets/javascripts/uikit/components/htmleditor.js +623 -0
- data/vendor/assets/javascripts/uikit/components/htmleditor.min.js +2 -0
- data/vendor/assets/javascripts/uikit/components/lightbox.js +555 -0
- data/vendor/assets/javascripts/uikit/components/lightbox.min.js +2 -0
- data/vendor/assets/javascripts/uikit/components/nestable.js +638 -0
- data/vendor/assets/javascripts/uikit/components/nestable.min.js +2 -0
- data/vendor/assets/javascripts/uikit/components/notify.js +189 -0
- data/vendor/assets/javascripts/uikit/components/notify.min.js +2 -0
- data/vendor/assets/javascripts/uikit/components/pagination.js +147 -0
- data/vendor/assets/javascripts/uikit/components/pagination.min.js +2 -0
- data/vendor/assets/javascripts/uikit/components/parallax.js +417 -0
- data/vendor/assets/javascripts/uikit/components/parallax.min.js +2 -0
- data/vendor/assets/javascripts/uikit/components/search.js +92 -0
- data/vendor/assets/javascripts/uikit/components/search.min.js +2 -0
- data/vendor/assets/javascripts/uikit/components/slider.js +520 -0
- data/vendor/assets/javascripts/uikit/components/slider.min.js +2 -0
- data/vendor/assets/javascripts/uikit/components/slideset.js +502 -0
- data/vendor/assets/javascripts/uikit/components/slideset.min.js +2 -0
- data/vendor/assets/javascripts/uikit/components/slideshow-fx.js +375 -0
- data/vendor/assets/javascripts/uikit/components/slideshow-fx.min.js +2 -0
- data/vendor/assets/javascripts/uikit/components/slideshow.js +545 -0
- data/vendor/assets/javascripts/uikit/components/slideshow.min.js +2 -0
- data/vendor/assets/javascripts/uikit/components/sortable.js +664 -0
- data/vendor/assets/javascripts/uikit/components/sortable.min.js +2 -0
- data/vendor/assets/javascripts/uikit/components/sticky.js +349 -0
- data/vendor/assets/javascripts/uikit/components/sticky.min.js +2 -0
- data/vendor/assets/javascripts/uikit/components/timepicker.js +192 -0
- data/vendor/assets/javascripts/uikit/components/timepicker.min.js +2 -0
- data/vendor/assets/javascripts/uikit/components/tooltip.js +234 -0
- data/vendor/assets/javascripts/uikit/components/tooltip.min.js +2 -0
- data/vendor/assets/javascripts/uikit/components/upload.js +260 -0
- data/vendor/assets/javascripts/uikit/components/upload.min.js +2 -0
- data/vendor/assets/javascripts/uikit/core/alert.js +66 -0
- data/vendor/assets/javascripts/uikit/core/alert.min.js +2 -0
- data/vendor/assets/javascripts/uikit/core/button.js +157 -0
- data/vendor/assets/javascripts/uikit/core/button.min.js +2 -0
- data/vendor/assets/javascripts/uikit/core/core.js +725 -0
- data/vendor/assets/javascripts/uikit/core/core.min.js +2 -0
- data/vendor/assets/javascripts/uikit/core/cover.js +95 -0
- data/vendor/assets/javascripts/uikit/core/cover.min.js +2 -0
- data/vendor/assets/javascripts/uikit/core/dropdown.js +421 -0
- data/vendor/assets/javascripts/uikit/core/dropdown.min.js +2 -0
- data/vendor/assets/javascripts/uikit/core/grid.js +114 -0
- data/vendor/assets/javascripts/uikit/core/grid.min.js +2 -0
- data/vendor/assets/javascripts/uikit/core/modal.js +372 -0
- data/vendor/assets/javascripts/uikit/core/modal.min.js +2 -0
- data/vendor/assets/javascripts/uikit/core/nav.js +136 -0
- data/vendor/assets/javascripts/uikit/core/nav.min.js +2 -0
- data/vendor/assets/javascripts/uikit/core/offcanvas.js +180 -0
- data/vendor/assets/javascripts/uikit/core/offcanvas.min.js +2 -0
- data/vendor/assets/javascripts/uikit/core/scrollspy.js +208 -0
- data/vendor/assets/javascripts/uikit/core/scrollspy.min.js +2 -0
- data/vendor/assets/javascripts/uikit/core/smooth-scroll.js +62 -0
- data/vendor/assets/javascripts/uikit/core/smooth-scroll.min.js +2 -0
- data/vendor/assets/javascripts/uikit/core/switcher.js +304 -0
- data/vendor/assets/javascripts/uikit/core/switcher.min.js +2 -0
- data/vendor/assets/javascripts/uikit/core/tab.js +165 -0
- data/vendor/assets/javascripts/uikit/core/tab.min.js +2 -0
- data/vendor/assets/javascripts/uikit/core/toggle.js +120 -0
- data/vendor/assets/javascripts/uikit/core/toggle.min.js +2 -0
- data/vendor/assets/javascripts/uikit/core/touch.js +173 -0
- data/vendor/assets/javascripts/uikit/core/touch.min.js +2 -0
- data/vendor/assets/javascripts/uikit/core/utility.js +239 -0
- data/vendor/assets/javascripts/uikit/core/utility.min.js +2 -0
- data/vendor/assets/stylesheets/uikit.almost-flat.css +8551 -0
- data/vendor/assets/stylesheets/uikit.css +8252 -0
- data/vendor/assets/stylesheets/uikit.gradient.css +8614 -0
- data/vendor/assets/stylesheets/uikit/components/accordion.almost-flat.css +39 -0
- data/vendor/assets/stylesheets/uikit/components/accordion.almost-flat.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/accordion.css +37 -0
- data/vendor/assets/stylesheets/uikit/components/accordion.gradient.css +39 -0
- data/vendor/assets/stylesheets/uikit/components/accordion.gradient.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/accordion.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/autocomplete.almost-flat.css +52 -0
- data/vendor/assets/stylesheets/uikit/components/autocomplete.almost-flat.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/autocomplete.css +50 -0
- data/vendor/assets/stylesheets/uikit/components/autocomplete.gradient.css +52 -0
- data/vendor/assets/stylesheets/uikit/components/autocomplete.gradient.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/autocomplete.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/datepicker.almost-flat.css +129 -0
- data/vendor/assets/stylesheets/uikit/components/datepicker.almost-flat.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/datepicker.css +123 -0
- data/vendor/assets/stylesheets/uikit/components/datepicker.gradient.css +139 -0
- data/vendor/assets/stylesheets/uikit/components/datepicker.gradient.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/datepicker.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/dotnav.almost-flat.css +128 -0
- data/vendor/assets/stylesheets/uikit/components/dotnav.almost-flat.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/dotnav.css +124 -0
- data/vendor/assets/stylesheets/uikit/components/dotnav.gradient.css +128 -0
- data/vendor/assets/stylesheets/uikit/components/dotnav.gradient.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/dotnav.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/form-advanced.almost-flat.css +78 -0
- data/vendor/assets/stylesheets/uikit/components/form-advanced.almost-flat.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/form-advanced.css +78 -0
- data/vendor/assets/stylesheets/uikit/components/form-advanced.gradient.css +78 -0
- data/vendor/assets/stylesheets/uikit/components/form-advanced.gradient.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/form-advanced.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/form-file.almost-flat.css +34 -0
- data/vendor/assets/stylesheets/uikit/components/form-file.almost-flat.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/form-file.css +34 -0
- data/vendor/assets/stylesheets/uikit/components/form-file.gradient.css +34 -0
- data/vendor/assets/stylesheets/uikit/components/form-file.gradient.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/form-file.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/form-password.almost-flat.css +34 -0
- data/vendor/assets/stylesheets/uikit/components/form-password.almost-flat.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/form-password.css +34 -0
- data/vendor/assets/stylesheets/uikit/components/form-password.gradient.css +34 -0
- data/vendor/assets/stylesheets/uikit/components/form-password.gradient.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/form-password.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/form-select.almost-flat.css +35 -0
- data/vendor/assets/stylesheets/uikit/components/form-select.almost-flat.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/form-select.css +35 -0
- data/vendor/assets/stylesheets/uikit/components/form-select.gradient.css +35 -0
- data/vendor/assets/stylesheets/uikit/components/form-select.gradient.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/form-select.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/htmleditor.almost-flat.css +222 -0
- data/vendor/assets/stylesheets/uikit/components/htmleditor.almost-flat.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/htmleditor.css +164 -0
- data/vendor/assets/stylesheets/uikit/components/htmleditor.gradient.css +229 -0
- data/vendor/assets/stylesheets/uikit/components/htmleditor.gradient.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/htmleditor.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/nestable.almost-flat.css +135 -0
- data/vendor/assets/stylesheets/uikit/components/nestable.almost-flat.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/nestable.css +132 -0
- data/vendor/assets/stylesheets/uikit/components/nestable.gradient.css +139 -0
- data/vendor/assets/stylesheets/uikit/components/nestable.gradient.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/nestable.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/notify.almost-flat.css +98 -0
- data/vendor/assets/stylesheets/uikit/components/notify.almost-flat.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/notify.css +92 -0
- data/vendor/assets/stylesheets/uikit/components/notify.gradient.css +98 -0
- data/vendor/assets/stylesheets/uikit/components/notify.gradient.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/notify.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/placeholder.almost-flat.css +29 -0
- data/vendor/assets/stylesheets/uikit/components/placeholder.almost-flat.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/placeholder.css +29 -0
- data/vendor/assets/stylesheets/uikit/components/placeholder.gradient.css +29 -0
- data/vendor/assets/stylesheets/uikit/components/placeholder.gradient.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/placeholder.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/progress.almost-flat.css +104 -0
- data/vendor/assets/stylesheets/uikit/components/progress.almost-flat.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/progress.css +94 -0
- data/vendor/assets/stylesheets/uikit/components/progress.gradient.css +112 -0
- data/vendor/assets/stylesheets/uikit/components/progress.gradient.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/progress.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/search.almost-flat.css +191 -0
- data/vendor/assets/stylesheets/uikit/components/search.almost-flat.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/search.css +189 -0
- data/vendor/assets/stylesheets/uikit/components/search.gradient.css +191 -0
- data/vendor/assets/stylesheets/uikit/components/search.gradient.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/search.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/slidenav.almost-flat.css +98 -0
- data/vendor/assets/stylesheets/uikit/components/slidenav.almost-flat.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/slidenav.css +98 -0
- data/vendor/assets/stylesheets/uikit/components/slidenav.gradient.css +98 -0
- data/vendor/assets/stylesheets/uikit/components/slidenav.gradient.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/slidenav.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/slider.almost-flat.css +85 -0
- data/vendor/assets/stylesheets/uikit/components/slider.almost-flat.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/slider.css +85 -0
- data/vendor/assets/stylesheets/uikit/components/slider.gradient.css +85 -0
- data/vendor/assets/stylesheets/uikit/components/slider.gradient.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/slider.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/slideshow.almost-flat.css +140 -0
- data/vendor/assets/stylesheets/uikit/components/slideshow.almost-flat.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/slideshow.css +140 -0
- data/vendor/assets/stylesheets/uikit/components/slideshow.gradient.css +140 -0
- data/vendor/assets/stylesheets/uikit/components/slideshow.gradient.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/slideshow.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/sortable.almost-flat.css +62 -0
- data/vendor/assets/stylesheets/uikit/components/sortable.almost-flat.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/sortable.css +62 -0
- data/vendor/assets/stylesheets/uikit/components/sortable.gradient.css +62 -0
- data/vendor/assets/stylesheets/uikit/components/sortable.gradient.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/sortable.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/sticky.almost-flat.css +31 -0
- data/vendor/assets/stylesheets/uikit/components/sticky.almost-flat.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/sticky.css +31 -0
- data/vendor/assets/stylesheets/uikit/components/sticky.gradient.css +31 -0
- data/vendor/assets/stylesheets/uikit/components/sticky.gradient.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/sticky.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/tooltip.almost-flat.css +118 -0
- data/vendor/assets/stylesheets/uikit/components/tooltip.almost-flat.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/tooltip.css +116 -0
- data/vendor/assets/stylesheets/uikit/components/tooltip.gradient.css +118 -0
- data/vendor/assets/stylesheets/uikit/components/tooltip.gradient.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/tooltip.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/upload.almost-flat.css +10 -0
- data/vendor/assets/stylesheets/uikit/components/upload.almost-flat.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/upload.css +10 -0
- data/vendor/assets/stylesheets/uikit/components/upload.gradient.css +10 -0
- data/vendor/assets/stylesheets/uikit/components/upload.gradient.min.css +2 -0
- data/vendor/assets/stylesheets/uikit/components/upload.min.css +2 -0
- metadata +295 -0
@@ -0,0 +1,2 @@
|
|
1
|
+
/*! UIkit 2.22.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
2
|
+
!function(t){var e;window.UIkit&&(e=t(UIkit)),"function"==typeof define&&define.amd&&define("uikit-search",["uikit"],function(){return e||t(UIkit)})}(function(t){"use strict";function e(t,e){t=t||0,e=e||24;var i,o,a={"12h":[],"24h":[]};for(i=t,o="";e>i;i++)o=""+i,10>i&&(o="0"+o),a["24h"].push({value:o+":00"}),a["24h"].push({value:o+":30"}),0===i&&(o=12,a["12h"].push({value:o+":00 AM"}),a["12h"].push({value:o+":30 AM"})),i>0&&13>i&&12!==i&&(a["12h"].push({value:o+":00 AM"}),a["12h"].push({value:o+":30 AM"})),i>=12&&(o-=12,0===o&&(o=12),10>o&&(o="0"+String(o)),a["12h"].push({value:o+":00 PM"}),a["12h"].push({value:o+":30 PM"}));return a}t.component("timepicker",{defaults:{format:"24h",delay:0,start:0,end:24},boot:function(){t.$html.on("focus.timepicker.uikit","[data-uk-timepicker]",function(){var e=t.$(this);if(!e.data("timepicker")){var i=t.timepicker(e,t.Utils.options(e.attr("data-uk-timepicker")));setTimeout(function(){i.autocomplete.input.focus()},40)}})},init:function(){var i,o=this,a=e(this.options.start,this.options.end);this.options.minLength=0,this.options.template='<ul class="uk-nav uk-nav-autocomplete uk-autocomplete-results">{{~items}}<li data-value="{{$item.value}}"><a>{{$item.value}}</a></li>{{/items}}</ul>',this.options.source=function(t){t(a[o.options.format]||a["12h"])},this.element.is("input")?(this.element.wrap('<div class="uk-autocomplete"></div>'),i=this.element.parent()):i=this.element.addClass("uk-autocomplete"),this.autocomplete=t.autocomplete(i,this.options),this.autocomplete.dropdown.addClass("uk-dropdown-small uk-dropdown-scrollable"),this.autocomplete.on("show.uk.autocomplete",function(){var t=o.autocomplete.dropdown.find('[data-value="'+o.autocomplete.input.val()+'"]');setTimeout(function(){o.autocomplete.pick(t,!0)},10)}),this.autocomplete.input.on("focus",function(){o.autocomplete.value=Math.random(),o.autocomplete.triggercomplete()}).on("blur",t.Utils.debounce(function(){o.checkTime()},100)),this.element.data("timepicker",this)},checkTime:function(){var t,e,i,o,a="AM",u=this.autocomplete.input.val();"12h"==this.options.format?(t=u.split(" "),e=t[0].split(":"),a=t[1]):e=u.split(":"),i=parseInt(e[0],10),o=parseInt(e[1],10),isNaN(i)&&(i=0),isNaN(o)&&(o=0),"12h"==this.options.format?(i>12?i=12:0>i&&(i=12),"am"===a||"a"===a?a="AM":("pm"===a||"p"===a)&&(a="PM"),"AM"!==a&&"PM"!==a&&(a="AM")):i>=24?i=23:0>i&&(i=0),0>o?o=0:o>=60&&(o=0),this.autocomplete.input.val(this.formatTime(i,o,a)).trigger("change")},formatTime:function(t,e,i){return t=10>t?"0"+t:t,e=10>e?"0"+e:e,t+":"+e+("12h"==this.options.format?" "+i:"")}})});
|
@@ -0,0 +1,234 @@
|
|
1
|
+
/*! UIkit 2.22.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
2
|
+
(function(addon) {
|
3
|
+
var component;
|
4
|
+
|
5
|
+
if (window.UIkit) {
|
6
|
+
component = addon(UIkit);
|
7
|
+
}
|
8
|
+
|
9
|
+
if (typeof define == "function" && define.amd) {
|
10
|
+
define("uikit-tooltip", ["uikit"], function(){
|
11
|
+
return component || addon(UIkit);
|
12
|
+
});
|
13
|
+
}
|
14
|
+
|
15
|
+
})(function(UI){
|
16
|
+
|
17
|
+
"use strict";
|
18
|
+
|
19
|
+
var $tooltip, // tooltip container
|
20
|
+
tooltipdelay, checkdelay;
|
21
|
+
|
22
|
+
UI.component('tooltip', {
|
23
|
+
|
24
|
+
defaults: {
|
25
|
+
"offset": 5,
|
26
|
+
"pos": "top",
|
27
|
+
"animation": false,
|
28
|
+
"delay": 0, // in miliseconds
|
29
|
+
"cls": "",
|
30
|
+
"activeClass": "uk-active",
|
31
|
+
"src": function(ele) {
|
32
|
+
var title = ele.attr('title');
|
33
|
+
|
34
|
+
if (title !== undefined) {
|
35
|
+
ele.data('cached-title', title).removeAttr('title');
|
36
|
+
}
|
37
|
+
|
38
|
+
return ele.data("cached-title");
|
39
|
+
}
|
40
|
+
},
|
41
|
+
|
42
|
+
tip: "",
|
43
|
+
|
44
|
+
boot: function() {
|
45
|
+
|
46
|
+
// init code
|
47
|
+
UI.$html.on("mouseenter.tooltip.uikit focus.tooltip.uikit", "[data-uk-tooltip]", function(e) {
|
48
|
+
var ele = UI.$(this);
|
49
|
+
|
50
|
+
if (!ele.data("tooltip")) {
|
51
|
+
UI.tooltip(ele, UI.Utils.options(ele.attr("data-uk-tooltip")));
|
52
|
+
ele.trigger("mouseenter");
|
53
|
+
}
|
54
|
+
});
|
55
|
+
},
|
56
|
+
|
57
|
+
init: function() {
|
58
|
+
|
59
|
+
var $this = this;
|
60
|
+
|
61
|
+
if (!$tooltip) {
|
62
|
+
$tooltip = UI.$('<div class="uk-tooltip"></div>').appendTo("body");
|
63
|
+
}
|
64
|
+
|
65
|
+
this.on({
|
66
|
+
focus : function(e) { $this.show(); },
|
67
|
+
blur : function(e) { $this.hide(); },
|
68
|
+
mouseenter : function(e) { $this.show(); },
|
69
|
+
mouseleave : function(e) { $this.hide(); }
|
70
|
+
});
|
71
|
+
},
|
72
|
+
|
73
|
+
show: function() {
|
74
|
+
|
75
|
+
this.tip = typeof(this.options.src) === "function" ? this.options.src(this.element) : this.options.src;
|
76
|
+
|
77
|
+
if (tooltipdelay) clearTimeout(tooltipdelay);
|
78
|
+
if (checkdelay) clearTimeout(checkdelay);
|
79
|
+
|
80
|
+
if (typeof(this.tip) === 'string' ? !this.tip.length:true) return;
|
81
|
+
|
82
|
+
$tooltip.stop().css({"top": -2000, "visibility": "hidden"}).removeClass(this.options.activeClass).show();
|
83
|
+
$tooltip.html('<div class="uk-tooltip-inner">' + this.tip + '</div>');
|
84
|
+
|
85
|
+
var $this = this,
|
86
|
+
pos = UI.$.extend({}, this.element.offset(), {width: this.element[0].offsetWidth, height: this.element[0].offsetHeight}),
|
87
|
+
width = $tooltip[0].offsetWidth,
|
88
|
+
height = $tooltip[0].offsetHeight,
|
89
|
+
offset = typeof(this.options.offset) === "function" ? this.options.offset.call(this.element) : this.options.offset,
|
90
|
+
position = typeof(this.options.pos) === "function" ? this.options.pos.call(this.element) : this.options.pos,
|
91
|
+
tmppos = position.split("-"),
|
92
|
+
tcss = {
|
93
|
+
"display" : "none",
|
94
|
+
"visibility" : "visible",
|
95
|
+
"top" : (pos.top + pos.height + height),
|
96
|
+
"left" : pos.left
|
97
|
+
};
|
98
|
+
|
99
|
+
|
100
|
+
// prevent strange position
|
101
|
+
// when tooltip is in offcanvas etc.
|
102
|
+
if (UI.$html.css('position')=='fixed' || UI.$body.css('position')=='fixed'){
|
103
|
+
var bodyoffset = UI.$('body').offset(),
|
104
|
+
htmloffset = UI.$('html').offset(),
|
105
|
+
docoffset = {'top': (htmloffset.top + bodyoffset.top), 'left': (htmloffset.left + bodyoffset.left)};
|
106
|
+
|
107
|
+
pos.left -= docoffset.left;
|
108
|
+
pos.top -= docoffset.top;
|
109
|
+
}
|
110
|
+
|
111
|
+
|
112
|
+
if ((tmppos[0] == "left" || tmppos[0] == "right") && UI.langdirection == 'right') {
|
113
|
+
tmppos[0] = tmppos[0] == "left" ? "right" : "left";
|
114
|
+
}
|
115
|
+
|
116
|
+
var variants = {
|
117
|
+
"bottom" : {top: pos.top + pos.height + offset, left: pos.left + pos.width / 2 - width / 2},
|
118
|
+
"top" : {top: pos.top - height - offset, left: pos.left + pos.width / 2 - width / 2},
|
119
|
+
"left" : {top: pos.top + pos.height / 2 - height / 2, left: pos.left - width - offset},
|
120
|
+
"right" : {top: pos.top + pos.height / 2 - height / 2, left: pos.left + pos.width + offset}
|
121
|
+
};
|
122
|
+
|
123
|
+
UI.$.extend(tcss, variants[tmppos[0]]);
|
124
|
+
|
125
|
+
if (tmppos.length == 2) tcss.left = (tmppos[1] == 'left') ? (pos.left) : ((pos.left + pos.width) - width);
|
126
|
+
|
127
|
+
var boundary = this.checkBoundary(tcss.left, tcss.top, width, height);
|
128
|
+
|
129
|
+
if(boundary) {
|
130
|
+
|
131
|
+
switch(boundary) {
|
132
|
+
case "x":
|
133
|
+
|
134
|
+
if (tmppos.length == 2) {
|
135
|
+
position = tmppos[0]+"-"+(tcss.left < 0 ? "left": "right");
|
136
|
+
} else {
|
137
|
+
position = tcss.left < 0 ? "right": "left";
|
138
|
+
}
|
139
|
+
|
140
|
+
break;
|
141
|
+
|
142
|
+
case "y":
|
143
|
+
if (tmppos.length == 2) {
|
144
|
+
position = (tcss.top < 0 ? "bottom": "top")+"-"+tmppos[1];
|
145
|
+
} else {
|
146
|
+
position = (tcss.top < 0 ? "bottom": "top");
|
147
|
+
}
|
148
|
+
|
149
|
+
break;
|
150
|
+
|
151
|
+
case "xy":
|
152
|
+
if (tmppos.length == 2) {
|
153
|
+
position = (tcss.top < 0 ? "bottom": "top")+"-"+(tcss.left < 0 ? "left": "right");
|
154
|
+
} else {
|
155
|
+
position = tcss.left < 0 ? "right": "left";
|
156
|
+
}
|
157
|
+
|
158
|
+
break;
|
159
|
+
|
160
|
+
}
|
161
|
+
|
162
|
+
tmppos = position.split("-");
|
163
|
+
|
164
|
+
UI.$.extend(tcss, variants[tmppos[0]]);
|
165
|
+
|
166
|
+
if (tmppos.length == 2) tcss.left = (tmppos[1] == 'left') ? (pos.left) : ((pos.left + pos.width) - width);
|
167
|
+
}
|
168
|
+
|
169
|
+
|
170
|
+
tcss.left -= UI.$body.position().left;
|
171
|
+
|
172
|
+
tooltipdelay = setTimeout(function(){
|
173
|
+
|
174
|
+
$tooltip.css(tcss).attr("class", ["uk-tooltip", "uk-tooltip-"+position, $this.options.cls].join(' '));
|
175
|
+
|
176
|
+
if ($this.options.animation) {
|
177
|
+
$tooltip.css({opacity: 0, display: 'block'}).addClass($this.options.activeClass).animate({opacity: 1}, parseInt($this.options.animation, 10) || 400);
|
178
|
+
} else {
|
179
|
+
$tooltip.show().addClass($this.options.activeClass);
|
180
|
+
}
|
181
|
+
|
182
|
+
tooltipdelay = false;
|
183
|
+
|
184
|
+
// close tooltip if element was removed or hidden
|
185
|
+
checkdelay = setInterval(function(){
|
186
|
+
if(!$this.element.is(':visible')) $this.hide();
|
187
|
+
}, 150);
|
188
|
+
|
189
|
+
}, parseInt(this.options.delay, 10) || 0);
|
190
|
+
},
|
191
|
+
|
192
|
+
hide: function() {
|
193
|
+
if(this.element.is("input") && this.element[0]===document.activeElement) return;
|
194
|
+
|
195
|
+
if(tooltipdelay) clearTimeout(tooltipdelay);
|
196
|
+
if (checkdelay) clearTimeout(checkdelay);
|
197
|
+
|
198
|
+
$tooltip.stop();
|
199
|
+
|
200
|
+
if (this.options.animation) {
|
201
|
+
|
202
|
+
var $this = this;
|
203
|
+
|
204
|
+
$tooltip.fadeOut(parseInt(this.options.animation, 10) || 400, function(){
|
205
|
+
$tooltip.removeClass($this.options.activeClass)
|
206
|
+
});
|
207
|
+
|
208
|
+
} else {
|
209
|
+
$tooltip.hide().removeClass(this.options.activeClass);
|
210
|
+
}
|
211
|
+
},
|
212
|
+
|
213
|
+
content: function() {
|
214
|
+
return this.tip;
|
215
|
+
},
|
216
|
+
|
217
|
+
checkBoundary: function(left, top, width, height) {
|
218
|
+
|
219
|
+
var axis = "";
|
220
|
+
|
221
|
+
if(left < 0 || ((left - UI.$win.scrollLeft())+width) > window.innerWidth) {
|
222
|
+
axis += "x";
|
223
|
+
}
|
224
|
+
|
225
|
+
if(top < 0 || ((top - UI.$win.scrollTop())+height) > window.innerHeight) {
|
226
|
+
axis += "y";
|
227
|
+
}
|
228
|
+
|
229
|
+
return axis;
|
230
|
+
}
|
231
|
+
});
|
232
|
+
|
233
|
+
return UI.tooltip;
|
234
|
+
});
|
@@ -0,0 +1,2 @@
|
|
1
|
+
/*! UIkit 2.22.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
2
|
+
!function(t){var i;window.UIkit&&(i=t(UIkit)),"function"==typeof define&&define.amd&&define("uikit-tooltip",["uikit"],function(){return i||t(UIkit)})}(function(t){"use strict";var i,o,e;return t.component("tooltip",{defaults:{offset:5,pos:"top",animation:!1,delay:0,cls:"",activeClass:"uk-active",src:function(t){var i=t.attr("title");return void 0!==i&&t.data("cached-title",i).removeAttr("title"),t.data("cached-title")}},tip:"",boot:function(){t.$html.on("mouseenter.tooltip.uikit focus.tooltip.uikit","[data-uk-tooltip]",function(){var i=t.$(this);i.data("tooltip")||(t.tooltip(i,t.Utils.options(i.attr("data-uk-tooltip"))),i.trigger("mouseenter"))})},init:function(){var o=this;i||(i=t.$('<div class="uk-tooltip"></div>').appendTo("body")),this.on({focus:function(){o.show()},blur:function(){o.hide()},mouseenter:function(){o.show()},mouseleave:function(){o.hide()}})},show:function(){if(this.tip="function"==typeof this.options.src?this.options.src(this.element):this.options.src,o&&clearTimeout(o),e&&clearTimeout(e),"string"==typeof this.tip?this.tip.length:0){i.stop().css({top:-2e3,visibility:"hidden"}).removeClass(this.options.activeClass).show(),i.html('<div class="uk-tooltip-inner">'+this.tip+"</div>");var s=this,n=t.$.extend({},this.element.offset(),{width:this.element[0].offsetWidth,height:this.element[0].offsetHeight}),l=i[0].offsetWidth,f=i[0].offsetHeight,p="function"==typeof this.options.offset?this.options.offset.call(this.element):this.options.offset,a="function"==typeof this.options.pos?this.options.pos.call(this.element):this.options.pos,h=a.split("-"),c={display:"none",visibility:"visible",top:n.top+n.height+f,left:n.left};if("fixed"==t.$html.css("position")||"fixed"==t.$body.css("position")){var r=t.$("body").offset(),d=t.$("html").offset(),u={top:d.top+r.top,left:d.left+r.left};n.left-=u.left,n.top-=u.top}"left"!=h[0]&&"right"!=h[0]||"right"!=t.langdirection||(h[0]="left"==h[0]?"right":"left");var m={bottom:{top:n.top+n.height+p,left:n.left+n.width/2-l/2},top:{top:n.top-f-p,left:n.left+n.width/2-l/2},left:{top:n.top+n.height/2-f/2,left:n.left-l-p},right:{top:n.top+n.height/2-f/2,left:n.left+n.width+p}};t.$.extend(c,m[h[0]]),2==h.length&&(c.left="left"==h[1]?n.left:n.left+n.width-l);var v=this.checkBoundary(c.left,c.top,l,f);if(v){switch(v){case"x":a=2==h.length?h[0]+"-"+(c.left<0?"left":"right"):c.left<0?"right":"left";break;case"y":a=2==h.length?(c.top<0?"bottom":"top")+"-"+h[1]:c.top<0?"bottom":"top";break;case"xy":a=2==h.length?(c.top<0?"bottom":"top")+"-"+(c.left<0?"left":"right"):c.left<0?"right":"left"}h=a.split("-"),t.$.extend(c,m[h[0]]),2==h.length&&(c.left="left"==h[1]?n.left:n.left+n.width-l)}c.left-=t.$body.position().left,o=setTimeout(function(){i.css(c).attr("class",["uk-tooltip","uk-tooltip-"+a,s.options.cls].join(" ")),s.options.animation?i.css({opacity:0,display:"block"}).addClass(s.options.activeClass).animate({opacity:1},parseInt(s.options.animation,10)||400):i.show().addClass(s.options.activeClass),o=!1,e=setInterval(function(){s.element.is(":visible")||s.hide()},150)},parseInt(this.options.delay,10)||0)}},hide:function(){if(!this.element.is("input")||this.element[0]!==document.activeElement)if(o&&clearTimeout(o),e&&clearTimeout(e),i.stop(),this.options.animation){var t=this;i.fadeOut(parseInt(this.options.animation,10)||400,function(){i.removeClass(t.options.activeClass)})}else i.hide().removeClass(this.options.activeClass)},content:function(){return this.tip},checkBoundary:function(i,o,e,s){var n="";return(0>i||i-t.$win.scrollLeft()+e>window.innerWidth)&&(n+="x"),(0>o||o-t.$win.scrollTop()+s>window.innerHeight)&&(n+="y"),n}}),t.tooltip});
|
@@ -0,0 +1,260 @@
|
|
1
|
+
/*! UIkit 2.22.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
2
|
+
(function(addon) {
|
3
|
+
|
4
|
+
var component;
|
5
|
+
|
6
|
+
if (window.UIkit) {
|
7
|
+
component = addon(UIkit);
|
8
|
+
}
|
9
|
+
|
10
|
+
if (typeof define == "function" && define.amd) {
|
11
|
+
define("uikit-upload", ["uikit"], function(){
|
12
|
+
return component || addon(UIkit);
|
13
|
+
});
|
14
|
+
}
|
15
|
+
|
16
|
+
})(function(UI){
|
17
|
+
|
18
|
+
"use strict";
|
19
|
+
|
20
|
+
UI.component('uploadSelect', {
|
21
|
+
|
22
|
+
init: function() {
|
23
|
+
|
24
|
+
var $this = this;
|
25
|
+
|
26
|
+
this.on("change", function() {
|
27
|
+
xhrupload($this.element[0].files, $this.options);
|
28
|
+
var twin = $this.element.clone(true).data('uploadSelect', $this);
|
29
|
+
$this.element.replaceWith(twin);
|
30
|
+
$this.element = twin;
|
31
|
+
});
|
32
|
+
}
|
33
|
+
});
|
34
|
+
|
35
|
+
UI.component('uploadDrop', {
|
36
|
+
|
37
|
+
defaults: {
|
38
|
+
'dragoverClass': 'uk-dragover'
|
39
|
+
},
|
40
|
+
|
41
|
+
init: function() {
|
42
|
+
|
43
|
+
var $this = this, hasdragCls = false;
|
44
|
+
|
45
|
+
this.on("drop", function(e){
|
46
|
+
|
47
|
+
if (e.dataTransfer && e.dataTransfer.files) {
|
48
|
+
|
49
|
+
e.stopPropagation();
|
50
|
+
e.preventDefault();
|
51
|
+
|
52
|
+
$this.element.removeClass($this.options.dragoverClass);
|
53
|
+
$this.element.trigger('dropped.uk.upload', [e.dataTransfer.files]);
|
54
|
+
|
55
|
+
xhrupload(e.dataTransfer.files, $this.options);
|
56
|
+
}
|
57
|
+
|
58
|
+
}).on("dragenter", function(e){
|
59
|
+
e.stopPropagation();
|
60
|
+
e.preventDefault();
|
61
|
+
}).on("dragover", function(e){
|
62
|
+
e.stopPropagation();
|
63
|
+
e.preventDefault();
|
64
|
+
|
65
|
+
if (!hasdragCls) {
|
66
|
+
$this.element.addClass($this.options.dragoverClass);
|
67
|
+
hasdragCls = true;
|
68
|
+
}
|
69
|
+
}).on("dragleave", function(e){
|
70
|
+
e.stopPropagation();
|
71
|
+
e.preventDefault();
|
72
|
+
$this.element.removeClass($this.options.dragoverClass);
|
73
|
+
hasdragCls = false;
|
74
|
+
});
|
75
|
+
}
|
76
|
+
});
|
77
|
+
|
78
|
+
|
79
|
+
UI.support.ajaxupload = (function() {
|
80
|
+
|
81
|
+
function supportFileAPI() {
|
82
|
+
var fi = document.createElement('INPUT'); fi.type = 'file'; return 'files' in fi;
|
83
|
+
}
|
84
|
+
|
85
|
+
function supportAjaxUploadProgressEvents() {
|
86
|
+
var xhr = new XMLHttpRequest(); return !! (xhr && ('upload' in xhr) && ('onprogress' in xhr.upload));
|
87
|
+
}
|
88
|
+
|
89
|
+
function supportFormData() {
|
90
|
+
return !! window.FormData;
|
91
|
+
}
|
92
|
+
|
93
|
+
return supportFileAPI() && supportAjaxUploadProgressEvents() && supportFormData();
|
94
|
+
})();
|
95
|
+
|
96
|
+
if (UI.support.ajaxupload){
|
97
|
+
UI.$.event.props.push("dataTransfer");
|
98
|
+
}
|
99
|
+
|
100
|
+
function xhrupload(files, settings) {
|
101
|
+
|
102
|
+
if (!UI.support.ajaxupload){
|
103
|
+
return this;
|
104
|
+
}
|
105
|
+
|
106
|
+
settings = UI.$.extend({}, xhrupload.defaults, settings);
|
107
|
+
|
108
|
+
if (!files.length){
|
109
|
+
return;
|
110
|
+
}
|
111
|
+
|
112
|
+
if (settings.allow !== '*.*') {
|
113
|
+
|
114
|
+
for(var i=0,file;file=files[i];i++) {
|
115
|
+
|
116
|
+
if(!matchName(settings.allow, file.name)) {
|
117
|
+
|
118
|
+
if(typeof(settings.notallowed) == 'string') {
|
119
|
+
alert(settings.notallowed);
|
120
|
+
} else {
|
121
|
+
settings.notallowed(file, settings);
|
122
|
+
}
|
123
|
+
return;
|
124
|
+
}
|
125
|
+
}
|
126
|
+
}
|
127
|
+
|
128
|
+
var complete = settings.complete;
|
129
|
+
|
130
|
+
if (settings.single){
|
131
|
+
|
132
|
+
var count = files.length,
|
133
|
+
uploaded = 0,
|
134
|
+
allow = true;
|
135
|
+
|
136
|
+
settings.beforeAll(files);
|
137
|
+
|
138
|
+
settings.complete = function(response, xhr){
|
139
|
+
|
140
|
+
uploaded = uploaded + 1;
|
141
|
+
|
142
|
+
complete(response, xhr);
|
143
|
+
|
144
|
+
if (settings.filelimit && uploaded >= settings.filelimit){
|
145
|
+
allow = false;
|
146
|
+
}
|
147
|
+
|
148
|
+
if (allow && uploaded<count){
|
149
|
+
upload([files[uploaded]], settings);
|
150
|
+
} else {
|
151
|
+
settings.allcomplete(response, xhr);
|
152
|
+
}
|
153
|
+
};
|
154
|
+
|
155
|
+
upload([files[0]], settings);
|
156
|
+
|
157
|
+
} else {
|
158
|
+
|
159
|
+
settings.complete = function(response, xhr){
|
160
|
+
complete(response, xhr);
|
161
|
+
settings.allcomplete(response, xhr);
|
162
|
+
};
|
163
|
+
|
164
|
+
upload(files, settings);
|
165
|
+
}
|
166
|
+
|
167
|
+
function upload(files, settings){
|
168
|
+
|
169
|
+
// upload all at once
|
170
|
+
var formData = new FormData(), xhr = new XMLHttpRequest();
|
171
|
+
|
172
|
+
if (settings.before(settings, files)===false) return;
|
173
|
+
|
174
|
+
for (var i = 0, f; f = files[i]; i++) { formData.append(settings.param, f); }
|
175
|
+
for (var p in settings.params) { formData.append(p, settings.params[p]); }
|
176
|
+
|
177
|
+
// Add any event handlers here...
|
178
|
+
xhr.upload.addEventListener("progress", function(e){
|
179
|
+
var percent = (e.loaded / e.total)*100;
|
180
|
+
settings.progress(percent, e);
|
181
|
+
}, false);
|
182
|
+
|
183
|
+
xhr.addEventListener("loadstart", function(e){ settings.loadstart(e); }, false);
|
184
|
+
xhr.addEventListener("load", function(e){ settings.load(e); }, false);
|
185
|
+
xhr.addEventListener("loadend", function(e){ settings.loadend(e); }, false);
|
186
|
+
xhr.addEventListener("error", function(e){ settings.error(e); }, false);
|
187
|
+
xhr.addEventListener("abort", function(e){ settings.abort(e); }, false);
|
188
|
+
|
189
|
+
xhr.open(settings.method, settings.action, true);
|
190
|
+
|
191
|
+
if (settings.type=="json") {
|
192
|
+
xhr.setRequestHeader("Accept", "application/json");
|
193
|
+
}
|
194
|
+
|
195
|
+
xhr.onreadystatechange = function() {
|
196
|
+
|
197
|
+
settings.readystatechange(xhr);
|
198
|
+
|
199
|
+
if (xhr.readyState==4){
|
200
|
+
|
201
|
+
var response = xhr.responseText;
|
202
|
+
|
203
|
+
if (settings.type=="json") {
|
204
|
+
try {
|
205
|
+
response = UI.$.parseJSON(response);
|
206
|
+
} catch(e) {
|
207
|
+
response = false;
|
208
|
+
}
|
209
|
+
}
|
210
|
+
|
211
|
+
settings.complete(response, xhr);
|
212
|
+
}
|
213
|
+
};
|
214
|
+
settings.beforeSend(xhr);
|
215
|
+
xhr.send(formData);
|
216
|
+
}
|
217
|
+
}
|
218
|
+
|
219
|
+
xhrupload.defaults = {
|
220
|
+
'action': '',
|
221
|
+
'single': true,
|
222
|
+
'method': 'POST',
|
223
|
+
'param' : 'files[]',
|
224
|
+
'params': {},
|
225
|
+
'allow' : '*.*',
|
226
|
+
'type' : 'text',
|
227
|
+
'filelimit': false,
|
228
|
+
|
229
|
+
// events
|
230
|
+
'before' : function(o){},
|
231
|
+
'beforeSend' : function(xhr){},
|
232
|
+
'beforeAll' : function(){},
|
233
|
+
'loadstart' : function(){},
|
234
|
+
'load' : function(){},
|
235
|
+
'loadend' : function(){},
|
236
|
+
'error' : function(){},
|
237
|
+
'abort' : function(){},
|
238
|
+
'progress' : function(){},
|
239
|
+
'complete' : function(){},
|
240
|
+
'allcomplete' : function(){},
|
241
|
+
'readystatechange': function(){},
|
242
|
+
'notallowed' : function(file, settings){ alert('Only the following file types are allowed: '+settings.allow); }
|
243
|
+
};
|
244
|
+
|
245
|
+
function matchName(pattern, path) {
|
246
|
+
|
247
|
+
var parsedPattern = '^' + pattern.replace(/\//g, '\\/').
|
248
|
+
replace(/\*\*/g, '(\\/[^\\/]+)*').
|
249
|
+
replace(/\*/g, '[^\\/]+').
|
250
|
+
replace(/((?!\\))\?/g, '$1.') + '$';
|
251
|
+
|
252
|
+
parsedPattern = '^' + parsedPattern + '$';
|
253
|
+
|
254
|
+
return (path.match(new RegExp(parsedPattern, 'i')) !== null);
|
255
|
+
}
|
256
|
+
|
257
|
+
UI.Utils.xhrupload = xhrupload;
|
258
|
+
|
259
|
+
return xhrupload;
|
260
|
+
});
|