Updated the footable Lib.
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
/*! UIkit 2.21.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
/*! UIkit 2.25.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
(function(addon) {
|
||||
var component;
|
||||
|
||||
@ -52,7 +52,7 @@
|
||||
|
||||
var $this = this;
|
||||
|
||||
this.element.on('click.uikit.accordion', this.options.toggle, function(e) {
|
||||
this.element.on('click.uk.accordion', this.options.toggle, function(e) {
|
||||
|
||||
e.preventDefault();
|
||||
|
||||
@ -71,12 +71,14 @@
|
||||
var $this = this;
|
||||
|
||||
wrapper.data('toggle').toggleClass(this.options.clsactive);
|
||||
wrapper.data('content').toggleClass(this.options.clsactive);
|
||||
|
||||
var active = wrapper.data('toggle').hasClass(this.options.clsactive);
|
||||
|
||||
if (collapse) {
|
||||
this.toggle.not(wrapper.data('toggle')).removeClass(this.options.clsactive);
|
||||
this.content.not(wrapper.data('content')).parent().stop().css('overflow', 'hidden').animate({ height: 0 }, {easing: this.options.easing, duration: animated ? this.options.duration : 0}).attr('aria-expanded', 'false');
|
||||
this.content.not(wrapper.data('content')).removeClass(this.options.clsactive)
|
||||
.parent().stop().css('overflow', 'hidden').animate({ height: 0 }, {easing: this.options.easing, duration: animated ? this.options.duration : 0}).attr('aria-expanded', 'false');
|
||||
}
|
||||
|
||||
wrapper.stop().css('overflow', 'hidden');
|
||||
|
@ -1,2 +1,2 @@
|
||||
/*! UIkit 2.21.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
!function(t){var i;window.UIkit&&(i=t(UIkit)),"function"==typeof define&&define.amd&&define("uikit-accordion",["uikit"],function(){return i||t(UIkit)})}(function(t){"use strict";function i(i){var o=t.$(i),e="auto";if(o.is(":visible"))e=o.outerHeight();else{var a={position:o.css("position"),visibility:o.css("visibility"),display:o.css("display")};e=o.css({position:"absolute",visibility:"hidden",display:"block"}).outerHeight(),o.css(a)}return e}return t.component("accordion",{defaults:{showfirst:!0,collapse:!0,animate:!0,easing:"swing",duration:300,toggle:".uk-accordion-title",containers:".uk-accordion-content",clsactive:"uk-active"},boot:function(){t.ready(function(i){setTimeout(function(){t.$("[data-uk-accordion]",i).each(function(){var i=t.$(this);i.data("accordion")||t.accordion(i,t.Utils.options(i.attr("data-uk-accordion")))})},0)})},init:function(){var i=this;this.element.on("click.uikit.accordion",this.options.toggle,function(o){o.preventDefault(),i.toggleItem(t.$(this).data("wrapper"),i.options.animate,i.options.collapse)}),this.update(),this.options.showfirst&&this.toggleItem(this.toggle.eq(0).data("wrapper"),!1,!1)},toggleItem:function(o,e,a){var n=this;o.data("toggle").toggleClass(this.options.clsactive);var s=o.data("toggle").hasClass(this.options.clsactive);a&&(this.toggle.not(o.data("toggle")).removeClass(this.options.clsactive),this.content.not(o.data("content")).parent().stop().css("overflow","hidden").animate({height:0},{easing:this.options.easing,duration:e?this.options.duration:0}).attr("aria-expanded","false")),o.stop().css("overflow","hidden"),e?o.animate({height:s?i(o.data("content")):0},{easing:this.options.easing,duration:this.options.duration,complete:function(){s&&(o.css({overflow:"",height:"auto"}),t.Utils.checkDisplay(o.data("content"))),n.trigger("display.uk.check")}}):(o.height(s?"auto":0),s&&(o.css({overflow:""}),t.Utils.checkDisplay(o.data("content"))),this.trigger("display.uk.check")),o.attr("aria-expanded",s),this.element.trigger("toggle.uk.accordion",[s,o.data("toggle"),o.data("content")])},update:function(){var i,o,e,a=this;this.toggle=this.find(this.options.toggle),this.content=this.find(this.options.containers),this.content.each(function(n){i=t.$(this),i.parent().data("wrapper")?o=i.parent():(o=t.$(this).wrap('<div data-wrapper="true" style="overflow:hidden;height:0;position:relative;"></div>').parent(),o.attr("aria-expanded","false")),e=a.toggle.eq(n),o.data("toggle",e),o.data("content",i),e.data("wrapper",o),i.data("wrapper",o)}),this.element.trigger("update.uk.accordion",[this])}}),t.accordion});
|
||||
/*! UIkit 2.25.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
!function(t){var i;window.UIkit&&(i=t(UIkit)),"function"==typeof define&&define.amd&&define("uikit-accordion",["uikit"],function(){return i||t(UIkit)})}(function(t){"use strict";function i(i){var o=t.$(i),e="auto";if(o.is(":visible"))e=o.outerHeight();else{var a={position:o.css("position"),visibility:o.css("visibility"),display:o.css("display")};e=o.css({position:"absolute",visibility:"hidden",display:"block"}).outerHeight(),o.css(a)}return e}return t.component("accordion",{defaults:{showfirst:!0,collapse:!0,animate:!0,easing:"swing",duration:300,toggle:".uk-accordion-title",containers:".uk-accordion-content",clsactive:"uk-active"},boot:function(){t.ready(function(i){setTimeout(function(){t.$("[data-uk-accordion]",i).each(function(){var i=t.$(this);i.data("accordion")||t.accordion(i,t.Utils.options(i.attr("data-uk-accordion")))})},0)})},init:function(){var i=this;this.element.on("click.uk.accordion",this.options.toggle,function(o){o.preventDefault(),i.toggleItem(t.$(this).data("wrapper"),i.options.animate,i.options.collapse)}),this.update(),this.options.showfirst&&this.toggleItem(this.toggle.eq(0).data("wrapper"),!1,!1)},toggleItem:function(o,e,a){var n=this;o.data("toggle").toggleClass(this.options.clsactive),o.data("content").toggleClass(this.options.clsactive);var s=o.data("toggle").hasClass(this.options.clsactive);a&&(this.toggle.not(o.data("toggle")).removeClass(this.options.clsactive),this.content.not(o.data("content")).removeClass(this.options.clsactive).parent().stop().css("overflow","hidden").animate({height:0},{easing:this.options.easing,duration:e?this.options.duration:0}).attr("aria-expanded","false")),o.stop().css("overflow","hidden"),e?o.animate({height:s?i(o.data("content")):0},{easing:this.options.easing,duration:this.options.duration,complete:function(){s&&(o.css({overflow:"",height:"auto"}),t.Utils.checkDisplay(o.data("content"))),n.trigger("display.uk.check")}}):(o.height(s?"auto":0),s&&(o.css({overflow:""}),t.Utils.checkDisplay(o.data("content"))),this.trigger("display.uk.check")),o.attr("aria-expanded",s),this.element.trigger("toggle.uk.accordion",[s,o.data("toggle"),o.data("content")])},update:function(){var i,o,e,a=this;this.toggle=this.find(this.options.toggle),this.content=this.find(this.options.containers),this.content.each(function(n){i=t.$(this),i.parent().data("wrapper")?o=i.parent():(o=t.$(this).wrap('<div data-wrapper="true" style="overflow:hidden;height:0;position:relative;"></div>').parent(),o.attr("aria-expanded","false")),e=a.toggle.eq(n),o.data("toggle",e),o.data("content",i),e.data("wrapper",o),i.data("wrapper",o)}),this.element.trigger("update.uk.accordion",[this])}}),t.accordion});
|
@ -1,4 +1,4 @@
|
||||
/*! UIkit 2.21.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
/*! UIkit 2.25.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
(function(addon) {
|
||||
|
||||
var component;
|
||||
@ -50,7 +50,7 @@
|
||||
var ele = UI.$(this);
|
||||
|
||||
if (!ele.data("autocomplete")) {
|
||||
var obj = UI.autocomplete(ele, UI.Utils.options(ele.attr("data-uk-autocomplete")));
|
||||
UI.autocomplete(ele, UI.Utils.options(ele.attr("data-uk-autocomplete")));
|
||||
}
|
||||
});
|
||||
|
||||
@ -310,8 +310,6 @@
|
||||
|
||||
render: function(data) {
|
||||
|
||||
var $this = this;
|
||||
|
||||
this.dropdown.empty();
|
||||
|
||||
this.selected = false;
|
||||
|
@ -1,2 +1,2 @@
|
||||
/*! UIkit 2.21.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
!function(t){var e;window.UIkit&&(e=t(UIkit)),"function"==typeof define&&define.amd&&define("uikit-autocomplete",["uikit"],function(){return e||t(UIkit)})}(function(t){"use strict";var e;return t.component("autocomplete",{defaults:{minLength:3,param:"search",method:"post",delay:300,loadingClass:"uk-loading",flipDropdown:!1,skipClass:"uk-skip",hoverClass:"uk-active",source:null,renderer:null,template:'<ul class="uk-nav uk-nav-autocomplete uk-autocomplete-results">{{~items}}<li data-value="{{$item.value}}"><a>{{$item.value}}</a></li>{{/items}}</ul>'},visible:!1,value:null,selected:null,boot:function(){t.$html.on("focus.autocomplete.uikit","[data-uk-autocomplete]",function(){var e=t.$(this);if(!e.data("autocomplete")){t.autocomplete(e,t.Utils.options(e.attr("data-uk-autocomplete")))}}),t.$html.on("click.autocomplete.uikit",function(t){e&&t.target!=e.input[0]&&e.hide()})},init:function(){var e=this,i=!1,s=t.Utils.debounce(function(){return i?i=!1:(e.handle(),void 0)},this.options.delay);this.dropdown=this.find(".uk-dropdown"),this.template=this.find('script[type="text/autocomplete"]').html(),this.template=t.Utils.template(this.template||this.options.template),this.input=this.find("input:first").attr("autocomplete","off"),this.dropdown.length||(this.dropdown=t.$('<div class="uk-dropdown"></div>').appendTo(this.element)),this.options.flipDropdown&&this.dropdown.addClass("uk-dropdown-flip"),this.dropdown.attr("aria-expanded","false"),this.input.on({keydown:function(t){if(t&&t.which&&!t.shiftKey)switch(t.which){case 13:i=!0,e.selected&&(t.preventDefault(),e.select());break;case 38:t.preventDefault(),e.pick("prev",!0);break;case 40:t.preventDefault(),e.pick("next",!0);break;case 27:case 9:e.hide()}},keyup:s}),this.dropdown.on("click",".uk-autocomplete-results > *",function(){e.select()}),this.dropdown.on("mouseover",".uk-autocomplete-results > *",function(){e.pick(t.$(this))}),this.triggercomplete=s},handle:function(){var t=this,e=this.value;return this.value=this.input.val(),this.value.length<this.options.minLength?this.hide():(this.value!=e&&t.request(),this)},pick:function(e,i){var s=this,o=t.$(this.dropdown.find(".uk-autocomplete-results").children(":not(."+this.options.skipClass+")")),n=!1;if("string"==typeof e||e.hasClass(this.options.skipClass)){if("next"==e||"prev"==e){if(this.selected){var a=o.index(this.selected);n="next"==e?o.eq(a+1<o.length?a+1:0):o.eq(0>a-1?o.length-1:a-1)}else n=o["next"==e?"first":"last"]();n=t.$(n)}}else n=e;if(n&&n.length&&(this.selected=n,o.removeClass(this.options.hoverClass),this.selected.addClass(this.options.hoverClass),i)){var l=n.position().top,h=s.dropdown.scrollTop(),r=s.dropdown.height();(l>r||0>l)&&s.dropdown.scrollTop(h+l)}},select:function(){if(this.selected){var t=this.selected.data();this.trigger("selectitem.uk.autocomplete",[t,this]),t.value&&this.input.val(t.value).trigger("change"),this.hide()}},show:function(){return this.visible?void 0:(this.visible=!0,this.element.addClass("uk-open"),e&&e!==this&&e.hide(),e=this,this.dropdown.attr("aria-expanded","true"),this)},hide:function(){return this.visible?(this.visible=!1,this.element.removeClass("uk-open"),e===this&&(e=!1),this.dropdown.attr("aria-expanded","false"),this):void 0},request:function(){var e=this,i=function(t){t&&e.render(t),e.element.removeClass(e.options.loadingClass)};if(this.element.addClass(this.options.loadingClass),this.options.source){var s=this.options.source;switch(typeof this.options.source){case"function":this.options.source.apply(this,[i]);break;case"object":if(s.length){var o=[];s.forEach(function(t){t.value&&-1!=t.value.toLowerCase().indexOf(e.value.toLowerCase())&&o.push(t)}),i(o)}break;case"string":var n={};n[this.options.param]=this.value,t.$.ajax({url:this.options.source,data:n,type:this.options.method,dataType:"json"}).done(function(t){i(t||[])});break;default:i(null)}}else this.element.removeClass(e.options.loadingClass)},render:function(t){return this.dropdown.empty(),this.selected=!1,this.options.renderer?this.options.renderer.apply(this,[t]):t&&t.length&&(this.dropdown.append(this.template({items:t})),this.show(),this.trigger("show.uk.autocomplete")),this}}),t.autocomplete});
|
||||
/*! UIkit 2.25.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
!function(t){var e;window.UIkit&&(e=t(UIkit)),"function"==typeof define&&define.amd&&define("uikit-autocomplete",["uikit"],function(){return e||t(UIkit)})}(function(t){"use strict";var e;return t.component("autocomplete",{defaults:{minLength:3,param:"search",method:"post",delay:300,loadingClass:"uk-loading",flipDropdown:!1,skipClass:"uk-skip",hoverClass:"uk-active",source:null,renderer:null,template:'<ul class="uk-nav uk-nav-autocomplete uk-autocomplete-results">{{~items}}<li data-value="{{$item.value}}"><a>{{$item.value}}</a></li>{{/items}}</ul>'},visible:!1,value:null,selected:null,boot:function(){t.$html.on("focus.autocomplete.uikit","[data-uk-autocomplete]",function(){var e=t.$(this);e.data("autocomplete")||t.autocomplete(e,t.Utils.options(e.attr("data-uk-autocomplete")))}),t.$html.on("click.autocomplete.uikit",function(t){e&&t.target!=e.input[0]&&e.hide()})},init:function(){var e=this,i=!1,s=t.Utils.debounce(function(){return i?i=!1:(e.handle(),void 0)},this.options.delay);this.dropdown=this.find(".uk-dropdown"),this.template=this.find('script[type="text/autocomplete"]').html(),this.template=t.Utils.template(this.template||this.options.template),this.input=this.find("input:first").attr("autocomplete","off"),this.dropdown.length||(this.dropdown=t.$('<div class="uk-dropdown"></div>').appendTo(this.element)),this.options.flipDropdown&&this.dropdown.addClass("uk-dropdown-flip"),this.dropdown.attr("aria-expanded","false"),this.input.on({keydown:function(t){if(t&&t.which&&!t.shiftKey)switch(t.which){case 13:i=!0,e.selected&&(t.preventDefault(),e.select());break;case 38:t.preventDefault(),e.pick("prev",!0);break;case 40:t.preventDefault(),e.pick("next",!0);break;case 27:case 9:e.hide()}},keyup:s}),this.dropdown.on("click",".uk-autocomplete-results > *",function(){e.select()}),this.dropdown.on("mouseover",".uk-autocomplete-results > *",function(){e.pick(t.$(this))}),this.triggercomplete=s},handle:function(){var t=this,e=this.value;return this.value=this.input.val(),this.value.length<this.options.minLength?this.hide():(this.value!=e&&t.request(),this)},pick:function(e,i){var s=this,o=t.$(this.dropdown.find(".uk-autocomplete-results").children(":not(."+this.options.skipClass+")")),n=!1;if("string"==typeof e||e.hasClass(this.options.skipClass)){if("next"==e||"prev"==e){if(this.selected){var a=o.index(this.selected);n="next"==e?o.eq(a+1<o.length?a+1:0):o.eq(0>a-1?o.length-1:a-1)}else n=o["next"==e?"first":"last"]();n=t.$(n)}}else n=e;if(n&&n.length&&(this.selected=n,o.removeClass(this.options.hoverClass),this.selected.addClass(this.options.hoverClass),i)){var l=n.position().top,h=s.dropdown.scrollTop(),r=s.dropdown.height();(l>r||0>l)&&s.dropdown.scrollTop(h+l)}},select:function(){if(this.selected){var t=this.selected.data();this.trigger("selectitem.uk.autocomplete",[t,this]),t.value&&this.input.val(t.value).trigger("change"),this.hide()}},show:function(){return this.visible?void 0:(this.visible=!0,this.element.addClass("uk-open"),e&&e!==this&&e.hide(),e=this,this.dropdown.attr("aria-expanded","true"),this)},hide:function(){return this.visible?(this.visible=!1,this.element.removeClass("uk-open"),e===this&&(e=!1),this.dropdown.attr("aria-expanded","false"),this):void 0},request:function(){var e=this,i=function(t){t&&e.render(t),e.element.removeClass(e.options.loadingClass)};if(this.element.addClass(this.options.loadingClass),this.options.source){var s=this.options.source;switch(typeof this.options.source){case"function":this.options.source.apply(this,[i]);break;case"object":if(s.length){var o=[];s.forEach(function(t){t.value&&-1!=t.value.toLowerCase().indexOf(e.value.toLowerCase())&&o.push(t)}),i(o)}break;case"string":var n={};n[this.options.param]=this.value,t.$.ajax({url:this.options.source,data:n,type:this.options.method,dataType:"json"}).done(function(t){i(t||[])});break;default:i(null)}}else this.element.removeClass(e.options.loadingClass)},render:function(t){return this.dropdown.empty(),this.selected=!1,this.options.renderer?this.options.renderer.apply(this,[t]):t&&t.length&&(this.dropdown.append(this.template({items:t})),this.show(),this.trigger("show.uk.autocomplete")),this}}),t.autocomplete});
|
@ -1,4 +1,4 @@
|
||||
/*! UIkit 2.21.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
/*! UIkit 2.25.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
(function(addon) {
|
||||
|
||||
var component;
|
||||
@ -30,22 +30,14 @@
|
||||
months : ['January','February','March','April','May','June','July','August','September','October','November','December'],
|
||||
weekdays : ['Sun','Mon','Tue','Wed','Thu','Fri','Sat']
|
||||
},
|
||||
format: "DD.MM.YYYY",
|
||||
format: "YYYY-MM-DD",
|
||||
offsettop: 5,
|
||||
maxDate: false,
|
||||
minDate: false,
|
||||
pos: 'auto',
|
||||
template: function(data, opts) {
|
||||
|
||||
var content = '', maxDate, minDate, i;
|
||||
|
||||
if (opts.maxDate!==false){
|
||||
maxDate = isNaN(opts.maxDate) ? moment(opts.maxDate, opts.format) : moment().add(opts.maxDate, 'days');
|
||||
}
|
||||
|
||||
if (opts.minDate!==false){
|
||||
minDate = isNaN(opts.minDate) ? moment(opts.minDate, opts.format) : moment().add(opts.minDate-1, 'days');
|
||||
}
|
||||
var content = '', i;
|
||||
|
||||
content += '<div class="uk-datepicker-nav">';
|
||||
content += '<a href="" class="uk-datepicker-previous"></a>';
|
||||
@ -69,8 +61,8 @@
|
||||
|
||||
options = [];
|
||||
|
||||
minYear = minDate ? minDate.year() : currentyear - 50;
|
||||
maxYear = maxDate ? maxDate.year() : currentyear + 20;
|
||||
minYear = data.minDate ? data.minDate.year() : currentyear - 50;
|
||||
maxYear = data.maxDate ? data.maxDate.year() : currentyear + 20;
|
||||
|
||||
for (i=minYear;i<=maxYear;i++) {
|
||||
if (i == data.year) {
|
||||
@ -110,9 +102,7 @@
|
||||
|
||||
if(!day.inmonth) cls.push("uk-datepicker-table-muted");
|
||||
if(day.selected) cls.push("uk-active");
|
||||
|
||||
if (maxDate && day.day > maxDate) cls.push('uk-datepicker-date-disabled uk-datepicker-table-muted');
|
||||
if (minDate && minDate > day.day) cls.push('uk-datepicker-date-disabled uk-datepicker-table-muted');
|
||||
if(day.disabled) cls.push('uk-datepicker-date-disabled uk-datepicker-table-muted');
|
||||
|
||||
content += '<td><a href="" class="'+cls.join(" ")+'" data-date="'+day.day.format()+'">'+day.day.format("D")+'</a></td>';
|
||||
}
|
||||
@ -144,12 +134,12 @@
|
||||
|
||||
if (!ele.data("datepicker")) {
|
||||
e.preventDefault();
|
||||
var obj = UI.datepicker(ele, UI.Utils.options(ele.attr("data-uk-datepicker")));
|
||||
UI.datepicker(ele, UI.Utils.options(ele.attr("data-uk-datepicker")));
|
||||
ele.trigger("focus");
|
||||
}
|
||||
});
|
||||
|
||||
UI.$html.on("click.datepicker.uikit", function(e) {
|
||||
UI.$html.on("click focus", '*', function(e) {
|
||||
|
||||
var target = UI.$(e.target);
|
||||
|
||||
@ -194,11 +184,11 @@
|
||||
if (ele.hasClass('uk-datepicker-date-disabled')) return false;
|
||||
|
||||
if (ele.is('[data-date]')) {
|
||||
active.element.val(moment(ele.data("date")).format(active.options.format)).trigger("change");
|
||||
dropdown.hide();
|
||||
active = false;
|
||||
active.current = moment(ele.data("date"));
|
||||
active.element.val(active.current.format(active.options.format)).trigger("change");
|
||||
active.hide();
|
||||
} else {
|
||||
active.add(1 * (ele.hasClass("uk-datepicker-next") ? 1:-1), "months");
|
||||
active.add((ele.hasClass("uk-datepicker-next") ? 1:-1), "months");
|
||||
}
|
||||
});
|
||||
|
||||
@ -217,7 +207,7 @@
|
||||
var offset = this.element.offset(),
|
||||
css = {"left": offset.left, "right":""};
|
||||
|
||||
this.current = initdate ? moment(initdate, this.options.format):moment();
|
||||
this.current = isNaN(initdate) ? moment(initdate, this.options.format):moment();
|
||||
this.initdate = this.current.format("YYYY-MM-DD");
|
||||
|
||||
this.update();
|
||||
@ -274,10 +264,18 @@
|
||||
var opts = this.options,
|
||||
now = moment().format('YYYY-MM-DD'),
|
||||
days = [31, (year % 4 === 0 && year % 100 !== 0 || year % 400 === 0) ? 29 : 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][month],
|
||||
before = new Date(year, month, 1).getDay(),
|
||||
data = {"month":month, "year":year,"weekdays":[],"days":[]},
|
||||
before = new Date(year, month, 1, 12).getDay(),
|
||||
data = {"month":month, "year":year,"weekdays":[],"days":[], "maxDate": false, "minDate": false},
|
||||
row = [];
|
||||
|
||||
if (opts.maxDate!==false){
|
||||
data.maxDate = isNaN(opts.maxDate) ? moment(opts.maxDate, opts.format) : moment().add(opts.maxDate, 'days');
|
||||
}
|
||||
|
||||
if (opts.minDate!==false){
|
||||
data.minDate = isNaN(opts.minDate) ? moment(opts.minDate, opts.format) : moment().add(opts.minDate-1, 'days');
|
||||
}
|
||||
|
||||
data.weekdays = (function(){
|
||||
|
||||
for (var i=0, arr=[]; i < 7; i++) {
|
||||
@ -311,8 +309,8 @@
|
||||
|
||||
for (var i = 0, r = 0; i < cells; i++) {
|
||||
|
||||
day = new Date(year, month, 1 + (i - before));
|
||||
isDisabled = (opts.mindate && day < opts.mindate) || (opts.maxdate && day > opts.maxdate);
|
||||
day = new Date(year, month, 1 + (i - before), 12);
|
||||
isDisabled = (data.minDate && data.minDate > day) || (data.maxDate && day > data.maxDate);
|
||||
isInMonth = !(i < before || i >= (days + before));
|
||||
|
||||
day = moment(day);
|
||||
|
File diff suppressed because one or more lines are too long
@ -1,4 +1,4 @@
|
||||
/*! UIkit 2.21.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
/*! UIkit 2.25.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
(function(addon) {
|
||||
|
||||
var component;
|
||||
@ -34,7 +34,7 @@
|
||||
|
||||
e.preventDefault();
|
||||
|
||||
var obj = UI.formPassword(ele, UI.Utils.options(ele.attr("data-uk-form-password")));
|
||||
UI.formPassword(ele, UI.Utils.options(ele.attr("data-uk-form-password")));
|
||||
ele.trigger("click");
|
||||
}
|
||||
});
|
||||
@ -51,12 +51,13 @@
|
||||
if($this.input.length) {
|
||||
var type = $this.input.attr("type");
|
||||
$this.input.attr("type", type=="text" ? "password":"text");
|
||||
$this.element.text($this.options[type=="text" ? "lblShow":"lblHide"]);
|
||||
$this.element.html($this.options[type=="text" ? "lblShow":"lblHide"]);
|
||||
}
|
||||
});
|
||||
|
||||
this.input = this.element.next("input").length ? this.element.next("input") : this.element.prev("input");
|
||||
this.element.text(this.options[this.input.is("[type='password']") ? "lblShow":"lblHide"]);
|
||||
this.element.html(this.options[this.input.is("[type='password']") ? "lblShow":"lblHide"]);
|
||||
|
||||
|
||||
this.element.data("formPassword", this);
|
||||
}
|
||||
|
@ -1,2 +1,2 @@
|
||||
/*! UIkit 2.21.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
!function(t){var i;window.UIkit&&(i=t(UIkit)),"function"==typeof define&&define.amd&&define("uikit-form-password",["uikit"],function(){return i||t(UIkit)})}(function(t){"use strict";return t.component("formPassword",{defaults:{lblShow:"Show",lblHide:"Hide"},boot:function(){t.$html.on("click.formpassword.uikit","[data-uk-form-password]",function(i){var e=t.$(this);if(!e.data("formPassword")){i.preventDefault();{t.formPassword(e,t.Utils.options(e.attr("data-uk-form-password")))}e.trigger("click")}})},init:function(){var t=this;this.on("click",function(i){if(i.preventDefault(),t.input.length){var e=t.input.attr("type");t.input.attr("type","text"==e?"password":"text"),t.element.text(t.options["text"==e?"lblShow":"lblHide"])}}),this.input=this.element.next("input").length?this.element.next("input"):this.element.prev("input"),this.element.text(this.options[this.input.is("[type='password']")?"lblShow":"lblHide"]),this.element.data("formPassword",this)}}),t.formPassword});
|
||||
/*! UIkit 2.25.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
!function(t){var i;window.UIkit&&(i=t(UIkit)),"function"==typeof define&&define.amd&&define("uikit-form-password",["uikit"],function(){return i||t(UIkit)})}(function(t){"use strict";return t.component("formPassword",{defaults:{lblShow:"Show",lblHide:"Hide"},boot:function(){t.$html.on("click.formpassword.uikit","[data-uk-form-password]",function(i){var e=t.$(this);e.data("formPassword")||(i.preventDefault(),t.formPassword(e,t.Utils.options(e.attr("data-uk-form-password"))),e.trigger("click"))})},init:function(){var t=this;this.on("click",function(i){if(i.preventDefault(),t.input.length){var e=t.input.attr("type");t.input.attr("type","text"==e?"password":"text"),t.element.html(t.options["text"==e?"lblShow":"lblHide"])}}),this.input=this.element.next("input").length?this.element.next("input"):this.element.prev("input"),this.element.html(this.options[this.input.is("[type='password']")?"lblShow":"lblHide"]),this.element.data("formPassword",this)}}),t.formPassword});
|
@ -1,4 +1,4 @@
|
||||
/*! UIkit 2.21.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
/*! UIkit 2.25.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
(function(addon) {
|
||||
|
||||
var component;
|
||||
@ -33,7 +33,7 @@
|
||||
var ele = UI.$(this);
|
||||
|
||||
if (!ele.data("formSelect")) {
|
||||
var obj = UI.formSelect(ele, UI.Utils.options(ele.attr("data-uk-form-select")));
|
||||
UI.formSelect(ele, UI.Utils.options(ele.attr("data-uk-form-select")));
|
||||
}
|
||||
});
|
||||
});
|
||||
|
@ -1,2 +1,2 @@
|
||||
/*! UIkit 2.21.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
!function(t){var e;window.UIkit&&(e=t(UIkit)),"function"==typeof define&&define.amd&&define("uikit-form-select",["uikit"],function(){return e||t(UIkit)})}(function(t){"use strict";return t.component("formSelect",{defaults:{target:">span:first",activeClass:"uk-active"},boot:function(){t.ready(function(e){t.$("[data-uk-form-select]",e).each(function(){var e=t.$(this);if(!e.data("formSelect")){t.formSelect(e,t.Utils.options(e.attr("data-uk-form-select")))}})})},init:function(){var t=this;this.target=this.find(this.options.target),this.select=this.find("select"),this.select.on("change",function(){var e=t.select[0],i=function(){try{t.target.text(e.options[e.selectedIndex].text)}catch(n){}return t.element[t.select.val()?"addClass":"removeClass"](t.options.activeClass),i};return i()}()),this.element.data("formSelect",this)}}),t.formSelect});
|
||||
/*! UIkit 2.25.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
!function(t){var e;window.UIkit&&(e=t(UIkit)),"function"==typeof define&&define.amd&&define("uikit-form-select",["uikit"],function(){return e||t(UIkit)})}(function(t){"use strict";return t.component("formSelect",{defaults:{target:">span:first",activeClass:"uk-active"},boot:function(){t.ready(function(e){t.$("[data-uk-form-select]",e).each(function(){var e=t.$(this);e.data("formSelect")||t.formSelect(e,t.Utils.options(e.attr("data-uk-form-select")))})})},init:function(){var t=this;this.target=this.find(this.options.target),this.select=this.find("select"),this.select.on("change",function(){var e=t.select[0],i=function(){try{t.target.text(e.options[e.selectedIndex].text)}catch(n){}return t.element[t.select.val()?"addClass":"removeClass"](t.options.activeClass),i};return i()}()),this.element.data("formSelect",this)}}),t.formSelect});
|
168
admin/custom/uikit/js/components/grid-parallax.js
Normal file
168
admin/custom/uikit/js/components/grid-parallax.js
Normal file
@ -0,0 +1,168 @@
|
||||
/*! UIkit 2.25.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
(function(addon) {
|
||||
|
||||
var component;
|
||||
|
||||
if (window.UIkit) {
|
||||
component = addon(UIkit);
|
||||
}
|
||||
|
||||
if (typeof define == "function" && define.amd) {
|
||||
define("uikit-grid-parallax", ["uikit"], function(){
|
||||
return component || addon(UIkit);
|
||||
});
|
||||
}
|
||||
|
||||
})(function(UI){
|
||||
|
||||
var parallaxes = [], checkParallaxes = function() {
|
||||
|
||||
requestAnimationFrame(function(){
|
||||
for (var i=0; i < parallaxes.length; i++) {
|
||||
parallaxes[i].process();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
UI.component('gridparallax', {
|
||||
|
||||
defaults: {
|
||||
target : false,
|
||||
smooth : 150,
|
||||
translate : 150
|
||||
},
|
||||
|
||||
boot: function() {
|
||||
|
||||
// listen to scroll and resize
|
||||
UI.$doc.on("scrolling.uk.document", checkParallaxes);
|
||||
UI.$win.on("load resize orientationchange", UI.Utils.debounce(function(){
|
||||
checkParallaxes();
|
||||
}, 50));
|
||||
|
||||
// init code
|
||||
UI.ready(function(context) {
|
||||
|
||||
UI.$('[data-uk-grid-parallax]', context).each(function() {
|
||||
|
||||
var parallax = UI.$(this);
|
||||
|
||||
if (!parallax.data("gridparallax")) {
|
||||
UI.gridparallax(parallax, UI.Utils.options(parallax.attr("data-uk-grid-parallax")));
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
init: function() {
|
||||
|
||||
var $this = this;
|
||||
|
||||
this.initItems().process();
|
||||
parallaxes.push(this);
|
||||
|
||||
UI.$win.on('load resize orientationchange', (function() {
|
||||
|
||||
var fn = function() {
|
||||
var columns = getcolumns($this.element);
|
||||
|
||||
$this.element.css('margin-bottom', '');
|
||||
|
||||
if (columns > 1) {
|
||||
$this.element.css('margin-bottom', $this.options.translate + parseInt($this.element.css('margin-bottom')));
|
||||
}
|
||||
};
|
||||
|
||||
UI.$(function() { fn(); });
|
||||
|
||||
return UI.Utils.debounce(fn, 50);
|
||||
})());
|
||||
},
|
||||
|
||||
initItems: function() {
|
||||
|
||||
var smooth = this.options.smooth;
|
||||
|
||||
this.items = (this.options.target ? this.element.find(this.options.target) : this.element.children()).each(function(){
|
||||
UI.$(this).css({
|
||||
transition: 'transform '+smooth+'ms linear',
|
||||
transform: ''
|
||||
});
|
||||
});
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
process: function() {
|
||||
|
||||
var percent = percentageInViewport(this.element),
|
||||
columns = getcolumns(this.element),
|
||||
items = this.items,
|
||||
mods = [(columns-1)];
|
||||
|
||||
if (columns == 1 || !percent) {
|
||||
items.css('transform', '');
|
||||
return;
|
||||
}
|
||||
|
||||
while(mods.length < columns) {
|
||||
if(!(mods[mods.length-1] - 2)) break;
|
||||
mods.push(mods[mods.length-1] - 2);
|
||||
}
|
||||
|
||||
var translate = this.options.translate, percenttranslate = percent * translate;
|
||||
|
||||
items.each(function(idx, ele, translate){
|
||||
translate = mods.indexOf((idx+1) % columns) != -1 ? percenttranslate : percenttranslate / 8;
|
||||
UI.$(this).css('transform', 'translate3d(0,'+(translate)+'px, 0)');
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
function getcolumns(element) {
|
||||
|
||||
var children = element.children(),
|
||||
first = children.filter(':visible:first'),
|
||||
top = first[0].offsetTop + first.outerHeight();
|
||||
|
||||
for (var column=0;column<children.length;column++) {
|
||||
if (children[column].offsetTop >= top) break;
|
||||
}
|
||||
|
||||
return column || 1;
|
||||
}
|
||||
|
||||
function percentageInViewport(element) {
|
||||
|
||||
var top = element.offset().top,
|
||||
height = element.outerHeight(),
|
||||
scrolltop = UIkit.$win.scrollTop(),
|
||||
wh = window.innerHeight,
|
||||
distance, percentage, percent;
|
||||
|
||||
if (top > (scrolltop + wh)) {
|
||||
percent = 0;
|
||||
} else if ((top + height) < scrolltop) {
|
||||
percent = 1;
|
||||
} else {
|
||||
|
||||
if ((top + height) < wh) {
|
||||
percent = (scrolltop < wh ? scrolltop : scrolltop - wh) / (top+height);
|
||||
} else {
|
||||
|
||||
distance = (scrolltop + wh) - top;
|
||||
percentage = Math.round(distance / ((wh + height) / 100));
|
||||
percent = percentage/100;
|
||||
}
|
||||
|
||||
if (top < wh) {
|
||||
percent = percent * scrolltop / ((top + height) - wh);
|
||||
}
|
||||
}
|
||||
|
||||
return percent > 1 ? 1:percent;
|
||||
}
|
||||
});
|
2
admin/custom/uikit/js/components/grid-parallax.min.js
vendored
Normal file
2
admin/custom/uikit/js/components/grid-parallax.min.js
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
/*! UIkit 2.25.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
!function(t){var n;window.UIkit&&(n=t(UIkit)),"function"==typeof define&&define.amd&&define("uikit-grid-parallax",["uikit"],function(){return n||t(UIkit)})}(function(t){function n(t){for(var n=t.children(),i=n.filter(":visible:first"),e=i[0].offsetTop+i.outerHeight(),o=0;o<n.length&&!(n[o].offsetTop>=e);o++);return o||1}function i(t){var n,i,e,o=t.offset().top,r=t.outerHeight(),s=UIkit.$win.scrollTop(),a=window.innerHeight;return o>s+a?e=0:s>o+r?e=1:(a>o+r?e=(a>s?s:s-a)/(o+r):(n=s+a-o,i=Math.round(n/((a+r)/100)),e=i/100),a>o&&(e=e*s/(o+r-a))),e>1?1:e}var e=[],o=function(){requestAnimationFrame(function(){for(var t=0;t<e.length;t++)e[t].process()})};t.component("gridparallax",{defaults:{target:!1,smooth:150,translate:150},boot:function(){t.$doc.on("scrolling.uk.document",o),t.$win.on("load resize orientationchange",t.Utils.debounce(function(){o()},50)),t.ready(function(n){t.$("[data-uk-grid-parallax]",n).each(function(){var n=t.$(this);n.data("gridparallax")||t.gridparallax(n,t.Utils.options(n.attr("data-uk-grid-parallax")))})})},init:function(){var i=this;this.initItems().process(),e.push(this),t.$win.on("load resize orientationchange",function(){var e=function(){var t=n(i.element);i.element.css("margin-bottom",""),t>1&&i.element.css("margin-bottom",i.options.translate+parseInt(i.element.css("margin-bottom")))};return t.$(function(){e()}),t.Utils.debounce(e,50)}())},initItems:function(){var n=this.options.smooth;return this.items=(this.options.target?this.element.find(this.options.target):this.element.children()).each(function(){t.$(this).css({transition:"transform "+n+"ms linear",transform:""})}),this},process:function(){var e=i(this.element),o=n(this.element),r=this.items,s=[o-1];if(1==o||!e)return r.css("transform",""),void 0;for(;s.length<o&&s[s.length-1]-2;)s.push(s[s.length-1]-2);var a=this.options.translate,l=e*a;r.each(function(n,i,e){e=-1!=s.indexOf((n+1)%o)?l:l/8,t.$(this).css("transform","translate3d(0,"+e+"px, 0)")})}})});
|
@ -1,4 +1,4 @@
|
||||
/*! UIkit 2.21.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
/*! UIkit 2.25.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
(function(addon) {
|
||||
|
||||
var component;
|
||||
@ -38,7 +38,7 @@
|
||||
var ele = UI.$(this);
|
||||
|
||||
if(!ele.data("grid")) {
|
||||
var plugin = UI.grid(ele, UI.Utils.options(ele.attr('data-uk-grid')));
|
||||
UI.grid(ele, UI.Utils.options(ele.attr('data-uk-grid')));
|
||||
}
|
||||
});
|
||||
});
|
||||
@ -131,14 +131,13 @@
|
||||
|
||||
elements = elements || this.element.children(':visible');
|
||||
|
||||
var $this = this,
|
||||
children = elements,
|
||||
var children = elements,
|
||||
maxwidth = this.element.width() + (2*this.gutterh) + 2,
|
||||
left = 0,
|
||||
top = 0,
|
||||
positions = [],
|
||||
|
||||
item, width, height, pos, aX, aY, i, z, max, size;
|
||||
item, width, height, pos, i, z, max, size;
|
||||
|
||||
this.trigger('beforeupdate.uk.grid', [children]);
|
||||
|
||||
@ -229,6 +228,10 @@
|
||||
|
||||
filter = filter || [];
|
||||
|
||||
if (typeof(filter) === 'number') {
|
||||
filter = filter.toString();
|
||||
}
|
||||
|
||||
if (typeof(filter) === 'string') {
|
||||
filter = filter.split(/,/).map(function(item){ return item.trim(); });
|
||||
}
|
||||
|
4
admin/custom/uikit/js/components/grid.min.js
vendored
4
admin/custom/uikit/js/components/grid.min.js
vendored
File diff suppressed because one or more lines are too long
@ -1,4 +1,4 @@
|
||||
/*! UIkit 2.21.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
/*! UIkit 2.25.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
(function(addon) {
|
||||
|
||||
var component;
|
||||
@ -42,10 +42,10 @@
|
||||
|
||||
UI.$('textarea[data-uk-htmleditor]', context).each(function() {
|
||||
|
||||
var editor = UI.$(this), obj;
|
||||
var editor = UI.$(this);
|
||||
|
||||
if (!editor.data('htmleditor')) {
|
||||
obj = UI.htmleditor(editor, UI.Utils.options(editor.attr('data-uk-htmleditor')));
|
||||
UI.htmleditor(editor, UI.Utils.options(editor.attr('data-uk-htmleditor')));
|
||||
}
|
||||
});
|
||||
});
|
||||
@ -58,8 +58,8 @@
|
||||
this.CodeMirror = this.options.CodeMirror || CodeMirror;
|
||||
this.buttons = {};
|
||||
|
||||
tpl = tpl.replace(/\{:lblPreview\}/g, this.options.lblPreview);
|
||||
tpl = tpl.replace(/\{:lblCodeview\}/g, this.options.lblCodeview);
|
||||
tpl = tpl.replace(/\{:lblPreview}/g, this.options.lblPreview);
|
||||
tpl = tpl.replace(/\{:lblCodeview}/g, this.options.lblCodeview);
|
||||
|
||||
this.htmleditor = UI.$(tpl);
|
||||
this.content = this.htmleditor.find('.uk-htmleditor-content');
|
||||
@ -91,7 +91,7 @@
|
||||
|
||||
// append custom stylesheet
|
||||
if (typeof(this.options.iframe) === 'string') {
|
||||
this.preview.container.parent().append('<link rel="stylesheet" href="'+this.options.iframe+'">');
|
||||
this.preview.container.parent().append('<link rel="stylesheet" href="'+this.options.iframe+'">');
|
||||
}
|
||||
|
||||
} else {
|
||||
@ -107,13 +107,13 @@
|
||||
if ($this.htmleditor.attr('data-mode') == 'tab') return;
|
||||
|
||||
// calc position
|
||||
var codeHeight = codeContent.height() - codeScroll.height(),
|
||||
previewHeight = previewContainer[0].scrollHeight - ($this.iframe ? $this.iframe.height() : previewContainer.height()),
|
||||
ratio = previewHeight / codeHeight,
|
||||
previewPostition = codeScroll.scrollTop() * ratio;
|
||||
var codeHeight = codeContent.height() - codeScroll.height(),
|
||||
previewHeight = previewContainer[0].scrollHeight - ($this.iframe ? $this.iframe.height() : previewContainer.height()),
|
||||
ratio = previewHeight / codeHeight,
|
||||
previewPosition = codeScroll.scrollTop() * ratio;
|
||||
|
||||
// apply new scroll
|
||||
previewContainer.scrollTop(previewPostition);
|
||||
previewContainer.scrollTop(previewPosition);
|
||||
|
||||
}, 10));
|
||||
|
||||
@ -161,7 +161,7 @@
|
||||
this.debouncedRedraw = UI.Utils.debounce(function () { $this.redraw(); }, 5);
|
||||
|
||||
this.on('init.uk.component', function() {
|
||||
$this.redraw();
|
||||
$this.debouncedRedraw();
|
||||
});
|
||||
|
||||
this.element.attr('data-uk-check-display', 1).on('display.uk.check', function(e) {
|
||||
@ -181,7 +181,7 @@
|
||||
|
||||
replaceInPreview: function(regexp, callback) {
|
||||
|
||||
var editor = this.editor, results = [], value = editor.getValue(), offset = -1;
|
||||
var editor = this.editor, results = [], value = editor.getValue(), offset = -1, index = 0;
|
||||
|
||||
this.currentvalue = this.currentvalue.replace(regexp, function() {
|
||||
|
||||
@ -206,12 +206,14 @@
|
||||
}
|
||||
};
|
||||
|
||||
var result = callback(match);
|
||||
var result = callback(match, index);
|
||||
|
||||
if (!result) {
|
||||
return arguments[0];
|
||||
}
|
||||
|
||||
index++;
|
||||
|
||||
results.push(match);
|
||||
return result;
|
||||
});
|
||||
@ -455,7 +457,7 @@
|
||||
cm.setCursor({ line: posend.line, ch: cm.getLine(posend.line).length });
|
||||
cm.focus();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
editor.on('action.listUl', function() {
|
||||
listfn();
|
||||
@ -585,7 +587,7 @@
|
||||
UI.$.extend(editor, {
|
||||
|
||||
enableMarkdown: function() {
|
||||
enableMarkdown()
|
||||
enableMarkdown();
|
||||
this.render();
|
||||
},
|
||||
disableMarkdown: function() {
|
||||
|
File diff suppressed because one or more lines are too long
@ -1,4 +1,4 @@
|
||||
/*! UIkit 2.21.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
/*! UIkit 2.25.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
(function(addon) {
|
||||
|
||||
var component;
|
||||
@ -67,7 +67,7 @@
|
||||
|
||||
init: function() {
|
||||
|
||||
var $this = this, siblings = [];
|
||||
var siblings = [];
|
||||
|
||||
this.index = 0;
|
||||
this.siblings = [];
|
||||
@ -85,7 +85,7 @@
|
||||
|
||||
siblings.push({
|
||||
'source': ele.attr('href'),
|
||||
'title' : ele.attr('title'),
|
||||
'title' : ele.attr('data-title') || ele.attr('title'),
|
||||
'type' : ele.attr("data-lightbox-type") || 'auto',
|
||||
'link' : ele
|
||||
});
|
||||
@ -353,7 +353,7 @@
|
||||
|
||||
if(!cache[id]) {
|
||||
|
||||
var img = new Image();
|
||||
var img = new Image(), lowres = false;
|
||||
|
||||
img.onerror = function(){
|
||||
cache[id] = {width:640, height:320};
|
||||
@ -361,11 +361,22 @@
|
||||
};
|
||||
|
||||
img.onload = function(){
|
||||
cache[id] = {width:img.width, height:img.height};
|
||||
resolve(id, img.width, img.height);
|
||||
//youtube default 404 thumb, fall back to lowres
|
||||
if (img.width == 120 && img.height == 90) {
|
||||
if (!lowres) {
|
||||
lowres = true;
|
||||
img.src = '//img.youtube.com/vi/' + id + '/0.jpg';
|
||||
} else {
|
||||
cache[id] = {width: 640, height: 320};
|
||||
resolve(id, cache[id].width, cache[id].height);
|
||||
}
|
||||
} else {
|
||||
cache[id] = {width: img.width, height: img.height};
|
||||
resolve(id, img.width, img.height);
|
||||
}
|
||||
};
|
||||
|
||||
img.src = '//img.youtube.com/vi/'+id+'/0.jpg';
|
||||
img.src = '//img.youtube.com/vi/'+id+'/maxresdefault.jpg';
|
||||
|
||||
} else {
|
||||
resolve(id, cache[id].width, cache[id].height);
|
||||
|
File diff suppressed because one or more lines are too long
@ -1,4 +1,4 @@
|
||||
/*! UIkit 2.21.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
/*! UIkit 2.25.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
/*
|
||||
* Based on Nestable jQuery Plugin - Copyright (c) 2012 David Bushell - http://dbushell.com/
|
||||
*/
|
||||
@ -24,7 +24,7 @@
|
||||
html = UI.$html,
|
||||
touchedlists = [],
|
||||
$win = UI.$win,
|
||||
draggingElement, dragSource;
|
||||
draggingElement;
|
||||
|
||||
var eStart = hasTouch ? 'touchstart' : 'mousedown',
|
||||
eMove = hasTouch ? 'touchmove' : 'mousemove',
|
||||
@ -40,6 +40,8 @@
|
||||
listItemClass : 'uk-nestable-item',
|
||||
dragClass : 'uk-nestable-dragged',
|
||||
movingClass : 'uk-nestable-moving',
|
||||
noChildrenClass : 'uk-nestable-nochildren',
|
||||
emptyClass : 'uk-nestable-empty',
|
||||
handleClass : '',
|
||||
collapsedClass : 'uk-collapsed',
|
||||
placeholderClass: 'uk-nestable-placeholder',
|
||||
@ -47,7 +49,7 @@
|
||||
group : false,
|
||||
maxDepth : 10,
|
||||
threshold : 20,
|
||||
idlethreshold : 10
|
||||
idlethreshold : 10,
|
||||
},
|
||||
|
||||
boot: function() {
|
||||
@ -408,7 +410,7 @@
|
||||
|
||||
dragStop: function(e) {
|
||||
|
||||
var el = this.placeEl,
|
||||
var el = UI.$(this.placeEl),
|
||||
root = this.placeEl.parents(this.options._listBaseClass+':first');
|
||||
|
||||
this.placeEl.removeClass(this.options.placeholderClass);
|
||||
@ -416,11 +418,11 @@
|
||||
|
||||
if (this.element[0] !== root[0]) {
|
||||
|
||||
root.trigger('change.uk.nestable',[el, "added", root, root.data('nestable')]);
|
||||
this.element.trigger('change.uk.nestable', [el, "removed", this.element, this]);
|
||||
root.trigger('change.uk.nestable',[root.data('nestable'), el, 'added']);
|
||||
this.element.trigger('change.uk.nestable', [this, el, 'removed']);
|
||||
|
||||
} else {
|
||||
this.element.trigger('change.uk.nestable',[el, "moved", this.element, this]);
|
||||
this.element.trigger('change.uk.nestable',[this, el, "moved"]);
|
||||
}
|
||||
|
||||
this.trigger('stop.uk.nestable', [this, el]);
|
||||
@ -490,8 +492,8 @@
|
||||
mouse.distAxX = 0;
|
||||
prev = this.placeEl.prev('li');
|
||||
|
||||
// increase horizontal level if previous sibling exists and is not collapsed
|
||||
if (mouse.distX > 0 && prev.length && !prev.hasClass(opt.collapsedClass)) {
|
||||
// increase horizontal level if previous sibling exists, is not collapsed, and does not have a 'no children' class
|
||||
if (mouse.distX > 0 && prev.length && !prev.hasClass(opt.collapsedClass) && !prev.hasClass(opt.noChildrenClass)) {
|
||||
|
||||
// cannot increase level when item above is collapsed
|
||||
list = prev.find(opt._listClass).last();
|
||||
@ -514,15 +516,27 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// decrease horizontal level
|
||||
if (mouse.distX < 0) {
|
||||
// we can't decrease a level if an item preceeds the current one
|
||||
next = this.placeEl.next('li');
|
||||
|
||||
// we cannot decrease the level if an item precedes the current one
|
||||
next = this.placeEl.next(opt._listItemClass);
|
||||
if (!next.length) {
|
||||
parent = this.placeEl.parent();
|
||||
this.placeEl.closest(opt._listItemClass).after(this.placeEl);
|
||||
if (!parent.children().length) {
|
||||
this.unsetParent(parent.parent());
|
||||
|
||||
// get parent ul of the list item
|
||||
var parentUl = this.placeEl.closest([opt._listBaseClass, opt._listClass].join(','));
|
||||
// try to get the li surrounding the ul
|
||||
var surroundingLi = parentUl.closest(opt._listItemClass);
|
||||
|
||||
// if the ul is inside of a li (meaning it is nested)
|
||||
if (surroundingLi.length) {
|
||||
// we can decrease the horizontal level
|
||||
surroundingLi.after(this.placeEl);
|
||||
// if the previous parent ul is now empty
|
||||
if (!parentUl.children().length) {
|
||||
this.unsetParent(surroundingLi);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -531,7 +545,7 @@
|
||||
var isEmpty = false;
|
||||
|
||||
// find list item under cursor
|
||||
var pointX = this.dragEl.offset().left - (window.pageXOffset || document.scrollLeft || 0),
|
||||
var pointX = e.pageX - (window.pageXOffset || document.scrollLeft || 0),
|
||||
pointY = e.pageY - (window.pageYOffset || document.documentElement.scrollTop);
|
||||
this.pointEl = UI.$(document.elementFromPoint(pointX, pointY));
|
||||
|
||||
@ -562,7 +576,7 @@
|
||||
// find parent list of item under cursor
|
||||
var pointElRoot = this.element,
|
||||
tmpRoot = this.pointEl.closest(this.options._listBaseClass),
|
||||
isNewRoot = pointElRoot[0] !== this.pointEl.closest(this.options._listBaseClass)[0];
|
||||
isNewRoot = pointElRoot[0] != tmpRoot[0];
|
||||
|
||||
/**
|
||||
* move vertical
|
||||
@ -614,8 +628,8 @@
|
||||
|
||||
list = list ? UI.$(list) : this.element;
|
||||
|
||||
if (!list.children().length) {
|
||||
list.html('');
|
||||
if (this.options.emptyClass) {
|
||||
list[!list.children().length ? 'addClass':'removeClass'](this.options.emptyClass);
|
||||
}
|
||||
}
|
||||
|
||||
|
File diff suppressed because one or more lines are too long
@ -1,4 +1,4 @@
|
||||
/*! UIkit 2.21.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
/*! UIkit 2.25.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
(function(addon) {
|
||||
|
||||
var component;
|
||||
@ -45,8 +45,6 @@
|
||||
|
||||
var Message = function(options){
|
||||
|
||||
var $this = this;
|
||||
|
||||
this.options = UI.$.extend({}, Message.defaults, options);
|
||||
|
||||
this.uuid = UI.Utils.uid("notifymsg");
|
||||
|
@ -1,2 +1,2 @@
|
||||
/*! UIkit 2.21.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
/*! UIkit 2.25.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
!function(t){var e;window.UIkit&&(e=t(UIkit)),"function"==typeof define&&define.amd&&define("uikit-notify",["uikit"],function(){return e||t(UIkit)})}(function(t){"use strict";var e={},i={},s=function(e){return"string"==t.$.type(e)&&(e={message:e}),arguments[1]&&(e=t.$.extend(e,"string"==t.$.type(arguments[1])?{status:arguments[1]}:arguments[1])),new n(e).show()},o=function(t,e){var s;if(t)for(s in i)t===i[s].group&&i[s].close(e);else for(s in i)i[s].close(e)},n=function(s){this.options=t.$.extend({},n.defaults,s),this.uuid=t.Utils.uid("notifymsg"),this.element=t.$(['<div class="uk-notify-message">','<a class="uk-close"></a>',"<div></div>","</div>"].join("")).data("notifyMessage",this),this.content(this.options.message),this.options.status&&(this.element.addClass("uk-notify-message-"+this.options.status),this.currentstatus=this.options.status),this.group=this.options.group,i[this.uuid]=this,e[this.options.pos]||(e[this.options.pos]=t.$('<div class="uk-notify uk-notify-'+this.options.pos+'"></div>').appendTo("body").on("click",".uk-notify-message",function(){var e=t.$(this).data("notifyMessage");e.element.trigger("manualclose.uk.notify",[e]),e.close()}))};return t.$.extend(n.prototype,{uuid:!1,element:!1,timout:!1,currentstatus:"",group:!1,show:function(){if(!this.element.is(":visible")){var t=this;e[this.options.pos].show().prepend(this.element);var i=parseInt(this.element.css("margin-bottom"),10);return this.element.css({opacity:0,"margin-top":-1*this.element.outerHeight(),"margin-bottom":0}).animate({opacity:1,"margin-top":0,"margin-bottom":i},function(){if(t.options.timeout){var e=function(){t.close()};t.timeout=setTimeout(e,t.options.timeout),t.element.hover(function(){clearTimeout(t.timeout)},function(){t.timeout=setTimeout(e,t.options.timeout)})}}),this}},close:function(t){var s=this,o=function(){s.element.remove(),e[s.options.pos].children().length||e[s.options.pos].hide(),s.options.onClose.apply(s,[]),s.element.trigger("close.uk.notify",[s]),delete i[s.uuid]};this.timeout&&clearTimeout(this.timeout),t?o():this.element.animate({opacity:0,"margin-top":-1*this.element.outerHeight(),"margin-bottom":0},function(){o()})},content:function(t){var e=this.element.find(">div");return t?(e.html(t),this):e.html()},status:function(t){return t?(this.element.removeClass("uk-notify-message-"+this.currentstatus).addClass("uk-notify-message-"+t),this.currentstatus=t,this):this.currentstatus}}),n.defaults={message:"",status:"",timeout:5e3,group:null,pos:"top-center",onClose:function(){}},t.notify=s,t.notify.message=n,t.notify.closeAll=o,s});
|
@ -1,4 +1,4 @@
|
||||
/*! UIkit 2.21.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
/*! UIkit 2.25.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
/*
|
||||
* Based on simplePagination - Copyright (c) 2012 Flavius Matis - http://flaviusmatis.github.com/simplePagination.js/ (MIT)
|
||||
*/
|
||||
@ -26,9 +26,9 @@
|
||||
items : 1,
|
||||
itemsOnPage : 1,
|
||||
pages : 0,
|
||||
displayedPages : 3,
|
||||
edges : 3,
|
||||
currentPage : 1,
|
||||
displayedPages : 7,
|
||||
edges : 1,
|
||||
currentPage : 0,
|
||||
lblPrev : false,
|
||||
lblNext : false,
|
||||
onSelectPage : function() {}
|
||||
@ -43,7 +43,7 @@
|
||||
var ele = UI.$(this);
|
||||
|
||||
if (!ele.data("pagination")) {
|
||||
var obj = UI.pagination(ele, UI.Utils.options(ele.attr("data-uk-pagination")));
|
||||
UI.pagination(ele, UI.Utils.options(ele.attr("data-uk-pagination")));
|
||||
}
|
||||
});
|
||||
});
|
||||
@ -54,7 +54,7 @@
|
||||
var $this = this;
|
||||
|
||||
this.pages = this.options.pages ? this.options.pages : Math.ceil(this.options.items / this.options.itemsOnPage) ? Math.ceil(this.options.items / this.options.itemsOnPage) : 1;
|
||||
this.currentPage = this.options.currentPage - 1;
|
||||
this.currentPage = this.options.currentPage;
|
||||
this.halfDisplayed = this.options.displayedPages / 2;
|
||||
|
||||
this.on("click", "a[data-page]", function(e){
|
||||
@ -93,7 +93,7 @@
|
||||
this.element.empty();
|
||||
|
||||
// Generate Prev link
|
||||
if (o.lblPrev) this._append(o.currentPage - 1, {text: o.lblPrev});
|
||||
if (o.lblPrev) this._append(this.currentPage - 1, {text: o.lblPrev});
|
||||
|
||||
// Generate start edges
|
||||
if (interval.start > 0 && o.edges > 0) {
|
||||
@ -127,18 +127,17 @@
|
||||
}
|
||||
|
||||
// Generate Next link (unless option is set for at front)
|
||||
if (o.lblNext) this._append(o.currentPage + 1, {text: o.lblNext});
|
||||
if (o.lblNext) this._append(this.currentPage + 1, {text: o.lblNext});
|
||||
},
|
||||
|
||||
_append: function(pageIndex, opts) {
|
||||
|
||||
var $this = this, item, link, options;
|
||||
var item, options;
|
||||
|
||||
pageIndex = pageIndex < 0 ? 0 : (pageIndex < this.pages ? pageIndex : this.pages - 1);
|
||||
options = UI.$.extend({ text: pageIndex + 1 }, opts);
|
||||
|
||||
item = (pageIndex == this.currentPage) ? '<li class="uk-active"><span>' + (options.text) + '</span></li>'
|
||||
: '<li><a href="#page-'+(pageIndex+1)+'" data-page="'+pageIndex+'">'+options.text+'</a></li>';
|
||||
item = (pageIndex == this.currentPage) ? '<li class="uk-active"><span>' + (options.text) + '</span></li>' : '<li><a href="#page-'+(pageIndex+1)+'" data-page="'+pageIndex+'">'+options.text+'</a></li>';
|
||||
|
||||
this.element.append(item);
|
||||
}
|
||||
|
@ -1,2 +1,2 @@
|
||||
/*! UIkit 2.21.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
!function(t){var e;window.UIkit&&(e=t(UIkit)),"function"==typeof define&&define.amd&&define("uikit-pagination",["uikit"],function(){return e||t(UIkit)})}(function(t){"use strict";return t.component("pagination",{defaults:{items:1,itemsOnPage:1,pages:0,displayedPages:3,edges:3,currentPage:1,lblPrev:!1,lblNext:!1,onSelectPage:function(){}},boot:function(){t.ready(function(e){t.$("[data-uk-pagination]",e).each(function(){var e=t.$(this);if(!e.data("pagination")){t.pagination(e,t.Utils.options(e.attr("data-uk-pagination")))}})})},init:function(){var e=this;this.pages=this.options.pages?this.options.pages:Math.ceil(this.options.items/this.options.itemsOnPage)?Math.ceil(this.options.items/this.options.itemsOnPage):1,this.currentPage=this.options.currentPage-1,this.halfDisplayed=this.options.displayedPages/2,this.on("click","a[data-page]",function(i){i.preventDefault(),e.selectPage(t.$(this).data("page"))}),this._render()},_getInterval:function(){return{start:Math.ceil(this.currentPage>this.halfDisplayed?Math.max(Math.min(this.currentPage-this.halfDisplayed,this.pages-this.options.displayedPages),0):0),end:Math.ceil(this.currentPage>this.halfDisplayed?Math.min(this.currentPage+this.halfDisplayed,this.pages):Math.min(this.options.displayedPages,this.pages))}},render:function(t){this.pages=t?t:this.pages,this._render()},selectPage:function(t,e){this.currentPage=t,this.render(e),this.options.onSelectPage.apply(this,[t]),this.trigger("select.uk.pagination",[t,this])},_render:function(){var t,e=this.options,i=this._getInterval();if(this.element.empty(),e.lblPrev&&this._append(e.currentPage-1,{text:e.lblPrev}),i.start>0&&e.edges>0){var s=Math.min(e.edges,i.start);for(t=0;s>t;t++)this._append(t);e.edges<i.start&&i.start-e.edges!=1?this.element.append("<li><span>...</span></li>"):i.start-e.edges==1&&this._append(e.edges)}for(t=i.start;t<i.end;t++)this._append(t);if(i.end<this.pages&&e.edges>0){this.pages-e.edges>i.end&&this.pages-e.edges-i.end!=1?this.element.append("<li><span>...</span></li>"):this.pages-e.edges-i.end==1&&this._append(i.end++);var a=Math.max(this.pages-e.edges,i.end);for(t=a;t<this.pages;t++)this._append(t)}e.lblNext&&this._append(e.currentPage+1,{text:e.lblNext})},_append:function(e,i){var s,a;e=0>e?0:e<this.pages?e:this.pages-1,a=t.$.extend({text:e+1},i),s=e==this.currentPage?'<li class="uk-active"><span>'+a.text+"</span></li>":'<li><a href="#page-'+(e+1)+'" data-page="'+e+'">'+a.text+"</a></li>",this.element.append(s)}}),t.pagination});
|
||||
/*! UIkit 2.25.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
!function(t){var e;window.UIkit&&(e=t(UIkit)),"function"==typeof define&&define.amd&&define("uikit-pagination",["uikit"],function(){return e||t(UIkit)})}(function(t){"use strict";return t.component("pagination",{defaults:{items:1,itemsOnPage:1,pages:0,displayedPages:7,edges:1,currentPage:0,lblPrev:!1,lblNext:!1,onSelectPage:function(){}},boot:function(){t.ready(function(e){t.$("[data-uk-pagination]",e).each(function(){var e=t.$(this);e.data("pagination")||t.pagination(e,t.Utils.options(e.attr("data-uk-pagination")))})})},init:function(){var e=this;this.pages=this.options.pages?this.options.pages:Math.ceil(this.options.items/this.options.itemsOnPage)?Math.ceil(this.options.items/this.options.itemsOnPage):1,this.currentPage=this.options.currentPage,this.halfDisplayed=this.options.displayedPages/2,this.on("click","a[data-page]",function(i){i.preventDefault(),e.selectPage(t.$(this).data("page"))}),this._render()},_getInterval:function(){return{start:Math.ceil(this.currentPage>this.halfDisplayed?Math.max(Math.min(this.currentPage-this.halfDisplayed,this.pages-this.options.displayedPages),0):0),end:Math.ceil(this.currentPage>this.halfDisplayed?Math.min(this.currentPage+this.halfDisplayed,this.pages):Math.min(this.options.displayedPages,this.pages))}},render:function(t){this.pages=t?t:this.pages,this._render()},selectPage:function(t,e){this.currentPage=t,this.render(e),this.options.onSelectPage.apply(this,[t]),this.trigger("select.uk.pagination",[t,this])},_render:function(){var t,e=this.options,i=this._getInterval();if(this.element.empty(),e.lblPrev&&this._append(this.currentPage-1,{text:e.lblPrev}),i.start>0&&e.edges>0){var s=Math.min(e.edges,i.start);for(t=0;s>t;t++)this._append(t);e.edges<i.start&&i.start-e.edges!=1?this.element.append("<li><span>...</span></li>"):i.start-e.edges==1&&this._append(e.edges)}for(t=i.start;t<i.end;t++)this._append(t);if(i.end<this.pages&&e.edges>0){this.pages-e.edges>i.end&&this.pages-e.edges-i.end!=1?this.element.append("<li><span>...</span></li>"):this.pages-e.edges-i.end==1&&this._append(i.end++);var a=Math.max(this.pages-e.edges,i.end);for(t=a;t<this.pages;t++)this._append(t)}e.lblNext&&this._append(this.currentPage+1,{text:e.lblNext})},_append:function(e,i){var s,a;e=0>e?0:e<this.pages?e:this.pages-1,a=t.$.extend({text:e+1},i),s=e==this.currentPage?'<li class="uk-active"><span>'+a.text+"</span></li>":'<li><a href="#page-'+(e+1)+'" data-page="'+e+'">'+a.text+"</a></li>",this.element.append(s)}}),t.pagination});
|
@ -1,4 +1,4 @@
|
||||
/*! UIkit 2.21.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
/*! UIkit 2.25.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
(function(addon) {
|
||||
|
||||
var component;
|
||||
@ -25,11 +25,11 @@
|
||||
|
||||
scrolltop = UI.$win.scrollTop();
|
||||
|
||||
window.requestAnimationFrame.apply(window, [function(){
|
||||
window.requestAnimationFrame(function(){
|
||||
for (var i=0; i < parallaxes.length; i++) {
|
||||
parallaxes[i].process();
|
||||
}
|
||||
}]);
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
@ -85,7 +85,7 @@
|
||||
var parallax = UI.$(this);
|
||||
|
||||
if (!parallax.data("parallax")) {
|
||||
var obj = UI.parallax(parallax, UI.Utils.options(parallax.attr("data-uk-parallax")));
|
||||
UI.parallax(parallax, UI.Utils.options(parallax.attr("data-uk-parallax")));
|
||||
}
|
||||
});
|
||||
});
|
||||
@ -185,7 +185,8 @@
|
||||
|
||||
update: function(percent) {
|
||||
|
||||
var css = {'transform':''},
|
||||
var $this = this,
|
||||
css = {'transform':''},
|
||||
compercent = percent * (1 - (this.velocity - (this.velocity * percent))),
|
||||
opts, val;
|
||||
|
||||
@ -236,6 +237,12 @@
|
||||
|
||||
// bg image
|
||||
case "bg":
|
||||
|
||||
// don't move if image height is too small
|
||||
// if ($this.element.data('bgsize') && ($this.element.data('bgsize').h + val - window.innerHeight) < 0) {
|
||||
// break;
|
||||
// }
|
||||
|
||||
css['background-position'] = '50% '+val+'px';
|
||||
break;
|
||||
case "bgp":
|
||||
@ -283,29 +290,40 @@
|
||||
|
||||
function initBgImageParallax(obj, prop, opts) {
|
||||
|
||||
var img = new Image(), url, loaded, element, size, check, ratio, width, height;
|
||||
var img = new Image(), url, element, size, check, ratio, width, height;
|
||||
|
||||
element = obj.element.css({'background-size': 'cover', 'background-repeat': 'no-repeat'});
|
||||
url = element.css('background-image').replace(/^url\(/g, '').replace(/\)$/g, '').replace(/("|')/g, '');
|
||||
check = function() {
|
||||
|
||||
var w = element.width(), h = element.height(), extra = (prop=='bg') ? opts.diff : (opts.diff/100) * h;
|
||||
var w = element.innerWidth(), h = element.innerHeight(), extra = (prop=='bg') ? opts.diff : (opts.diff/100) * h;
|
||||
|
||||
h += extra;
|
||||
w += Math.ceil(extra * ratio);
|
||||
|
||||
if (w-extra < size.w && h < size.h) {
|
||||
return obj.element.css({'background-size': 'auto'});
|
||||
}
|
||||
|
||||
// if element height < parent height (gap underneath)
|
||||
if ((w / ratio) < h) {
|
||||
|
||||
width = Math.ceil(h * ratio);
|
||||
height = h;
|
||||
|
||||
if (h > window.innerHeight) {
|
||||
width = width * 1.2;
|
||||
height = height * 1.2;
|
||||
}
|
||||
|
||||
// element width < parent width (gap to right)
|
||||
} else {
|
||||
|
||||
width = w;
|
||||
height = Math.ceil(w / ratio);
|
||||
}
|
||||
|
||||
obj.element.css({'background-size': (width+'px '+height+'px')});
|
||||
element.css({'background-size': (width+'px '+height+'px')}).data('bgsize', {w:width,h:height});
|
||||
};
|
||||
|
||||
img.onerror = function(){
|
||||
@ -313,7 +331,7 @@
|
||||
};
|
||||
|
||||
img.onload = function(){
|
||||
size = {w:img.width, height:img.height};
|
||||
size = {w:img.width, h:img.height};
|
||||
ratio = img.width / img.height;
|
||||
|
||||
UI.$win.on("load resize orientationchange", UI.Utils.debounce(function(){
|
||||
|
File diff suppressed because one or more lines are too long
@ -1,4 +1,4 @@
|
||||
/*! UIkit 2.21.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
/*! UIkit 2.25.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
(function(addon) {
|
||||
|
||||
var component;
|
||||
@ -45,7 +45,7 @@
|
||||
|
||||
renderer: function(data) {
|
||||
|
||||
var $this = this, opts = this.options;
|
||||
var opts = this.options;
|
||||
|
||||
this.dropdown.append(this.template({"items":data.results || [], "msgResultsHeader":opts.msgResultsHeader, "msgMoreResults": opts.msgMoreResults, "msgNoResults": opts.msgNoResults}));
|
||||
this.show();
|
||||
@ -59,7 +59,7 @@
|
||||
var ele =UI.$(this);
|
||||
|
||||
if (!ele.data("search")) {
|
||||
var obj = UI.search(ele, UI.Utils.options(ele.attr("data-uk-search")));
|
||||
UI.search(ele, UI.Utils.options(ele.attr("data-uk-search")));
|
||||
}
|
||||
});
|
||||
},
|
||||
|
@ -1,2 +1,2 @@
|
||||
/*! UIkit 2.21.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
!function(e){var s;window.UIkit&&(s=e(UIkit)),"function"==typeof define&&define.amd&&define("uikit-search",["uikit"],function(){return s||e(UIkit)})}(function(e){"use strict";e.component("search",{defaults:{msgResultsHeader:"Search Results",msgMoreResults:"More Results",msgNoResults:"No results found",template:'<ul class="uk-nav uk-nav-search uk-autocomplete-results"> {{#msgResultsHeader}}<li class="uk-nav-header uk-skip">{{msgResultsHeader}}</li>{{/msgResultsHeader}} {{#items && items.length}} {{~items}} <li data-url="{{!$item.url}}"> <a href="{{!$item.url}}"> {{{$item.title}}} {{#$item.text}}<div>{{{$item.text}}}</div>{{/$item.text}} </a> </li> {{/items}} {{#msgMoreResults}} <li class="uk-nav-divider uk-skip"></li> <li class="uk-search-moreresults" data-moreresults="true"><a href="#" onclick="jQuery(this).closest(\'form\').submit();">{{msgMoreResults}}</a></li> {{/msgMoreResults}} {{/end}} {{^items.length}} {{#msgNoResults}}<li class="uk-skip"><a>{{msgNoResults}}</a></li>{{/msgNoResults}} {{/end}} </ul>',renderer:function(e){var s=this.options;this.dropdown.append(this.template({items:e.results||[],msgResultsHeader:s.msgResultsHeader,msgMoreResults:s.msgMoreResults,msgNoResults:s.msgNoResults})),this.show()}},boot:function(){e.$html.on("focus.search.uikit","[data-uk-search]",function(){var s=e.$(this);if(!s.data("search")){e.search(s,e.Utils.options(s.attr("data-uk-search")))}})},init:function(){var s=this;this.autocomplete=e.autocomplete(this.element,this.options),this.autocomplete.dropdown.addClass("uk-dropdown-search"),this.autocomplete.input.on("keyup",function(){s.element[s.autocomplete.input.val()?"addClass":"removeClass"]("uk-active")}).closest("form").on("reset",function(){s.value="",s.element.removeClass("uk-active")}),this.on("selectitem.uk.autocomplete",function(e,t){t.url?location.href=t.url:t.moreresults&&s.autocomplete.input.closest("form").submit()}),this.element.data("search",this)}})});
|
||||
/*! UIkit 2.25.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
!function(e){var s;window.UIkit&&(s=e(UIkit)),"function"==typeof define&&define.amd&&define("uikit-search",["uikit"],function(){return s||e(UIkit)})}(function(e){"use strict";e.component("search",{defaults:{msgResultsHeader:"Search Results",msgMoreResults:"More Results",msgNoResults:"No results found",template:'<ul class="uk-nav uk-nav-search uk-autocomplete-results"> {{#msgResultsHeader}}<li class="uk-nav-header uk-skip">{{msgResultsHeader}}</li>{{/msgResultsHeader}} {{#items && items.length}} {{~items}} <li data-url="{{!$item.url}}"> <a href="{{!$item.url}}"> {{{$item.title}}} {{#$item.text}}<div>{{{$item.text}}}</div>{{/$item.text}} </a> </li> {{/items}} {{#msgMoreResults}} <li class="uk-nav-divider uk-skip"></li> <li class="uk-search-moreresults" data-moreresults="true"><a href="#" onclick="jQuery(this).closest(\'form\').submit();">{{msgMoreResults}}</a></li> {{/msgMoreResults}} {{/end}} {{^items.length}} {{#msgNoResults}}<li class="uk-skip"><a>{{msgNoResults}}</a></li>{{/msgNoResults}} {{/end}} </ul>',renderer:function(e){var s=this.options;this.dropdown.append(this.template({items:e.results||[],msgResultsHeader:s.msgResultsHeader,msgMoreResults:s.msgMoreResults,msgNoResults:s.msgNoResults})),this.show()}},boot:function(){e.$html.on("focus.search.uikit","[data-uk-search]",function(){var s=e.$(this);s.data("search")||e.search(s,e.Utils.options(s.attr("data-uk-search")))})},init:function(){var s=this;this.autocomplete=e.autocomplete(this.element,this.options),this.autocomplete.dropdown.addClass("uk-dropdown-search"),this.autocomplete.input.on("keyup",function(){s.element[s.autocomplete.input.val()?"addClass":"removeClass"]("uk-active")}).closest("form").on("reset",function(){s.value="",s.element.removeClass("uk-active")}),this.on("selectitem.uk.autocomplete",function(e,t){t.url?location.href=t.url:t.moreresults&&s.autocomplete.input.closest("form").submit()}),this.element.data("search",this)}})});
|
@ -1,4 +1,4 @@
|
||||
/*! UIkit 2.21.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
/*! UIkit 2.25.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
(function(addon) {
|
||||
|
||||
var component;
|
||||
@ -22,10 +22,13 @@
|
||||
UI.component('slider', {
|
||||
|
||||
defaults: {
|
||||
center : false,
|
||||
threshold : 10,
|
||||
infinite : true,
|
||||
activecls : 'uk-active'
|
||||
center : false,
|
||||
threshold : 10,
|
||||
infinite : true,
|
||||
autoplay : false,
|
||||
autoplayInterval : 7000,
|
||||
pauseOnHover : true,
|
||||
activecls : 'uk-active'
|
||||
},
|
||||
|
||||
boot: function() {
|
||||
@ -35,11 +38,11 @@
|
||||
|
||||
setTimeout(function(){
|
||||
|
||||
UI.$("[data-uk-slider]", context).each(function(){
|
||||
UI.$('[data-uk-slider]', context).each(function(){
|
||||
|
||||
var ele = UI.$(this);
|
||||
|
||||
if (!ele.data("slider")) {
|
||||
if (!ele.data('slider')) {
|
||||
UI.slider(ele, UI.Utils.options(ele.attr('data-uk-slider')));
|
||||
}
|
||||
});
|
||||
@ -55,11 +58,11 @@
|
||||
this.container = this.element.find('.uk-slider');
|
||||
this.focus = 0;
|
||||
|
||||
UI.$win.on("resize load", UI.Utils.debounce(function() {
|
||||
UI.$win.on('resize load', UI.Utils.debounce(function() {
|
||||
$this.resize(true);
|
||||
}, 100));
|
||||
|
||||
this.on("click.uikit.slider", '[data-uk-slider-item]', function(e) {
|
||||
this.on('click.uk.slider', '[data-uk-slider-item]', function(e) {
|
||||
|
||||
e.preventDefault();
|
||||
|
||||
@ -67,65 +70,77 @@
|
||||
|
||||
if ($this.focus == item) return;
|
||||
|
||||
// stop autoplay
|
||||
$this.stop();
|
||||
|
||||
switch(item) {
|
||||
case 'next':
|
||||
case 'previous':
|
||||
$this[item=='next' ? 'next':'previous']();
|
||||
break;
|
||||
default:
|
||||
$this.updateFocus(parseInt(slide, 10));
|
||||
$this.updateFocus(parseInt(item, 10));
|
||||
}
|
||||
});
|
||||
|
||||
this.container.on('touchstart mousedown', function(evt) {
|
||||
this.container.on({
|
||||
|
||||
if (evt.originalEvent && evt.originalEvent.touches) {
|
||||
evt = evt.originalEvent.touches[0];
|
||||
}
|
||||
'touchstart mousedown': function(evt) {
|
||||
|
||||
// ignore right click button
|
||||
if (evt.button && evt.button==2 || !$this.active) {
|
||||
return;
|
||||
}
|
||||
|
||||
anchor = UI.$(evt.target).is('a') ? UI.$(evt.target) : UI.$(evt.target).parents('a:first');
|
||||
dragged = false;
|
||||
|
||||
if (anchor.length) {
|
||||
|
||||
anchor.one('click', function(e){
|
||||
if (dragged) e.preventDefault();
|
||||
});
|
||||
}
|
||||
|
||||
delayIdle = function(e) {
|
||||
|
||||
dragged = true;
|
||||
dragging = $this;
|
||||
store = {
|
||||
touchx : parseInt(e.pageX, 10),
|
||||
dir : 1,
|
||||
focus : $this.focus,
|
||||
base : $this.options.center ? 'center':'area'
|
||||
};
|
||||
|
||||
if (e.originalEvent && e.originalEvent.touches) {
|
||||
e = e.originalEvent.touches[0];
|
||||
if (evt.originalEvent && evt.originalEvent.touches) {
|
||||
evt = evt.originalEvent.touches[0];
|
||||
}
|
||||
|
||||
dragging.element.data({
|
||||
'pointer-start': {x: parseInt(e.pageX, 10), y: parseInt(e.pageY, 10)},
|
||||
'pointer-pos-start': $this.pos
|
||||
});
|
||||
// ignore right click button
|
||||
if (evt.button && evt.button==2 || !$this.active) {
|
||||
return;
|
||||
}
|
||||
|
||||
$this.container.addClass('uk-drag');
|
||||
// stop autoplay
|
||||
$this.stop();
|
||||
|
||||
delayIdle = false;
|
||||
};
|
||||
anchor = UI.$(evt.target).is('a') ? UI.$(evt.target) : UI.$(evt.target).parents('a:first');
|
||||
dragged = false;
|
||||
|
||||
delayIdle.x = parseInt(evt.pageX, 10);
|
||||
delayIdle.threshold = $this.options.threshold;
|
||||
if (anchor.length) {
|
||||
|
||||
anchor.one('click', function(e){
|
||||
if (dragged) e.preventDefault();
|
||||
});
|
||||
}
|
||||
|
||||
delayIdle = function(e) {
|
||||
|
||||
dragged = true;
|
||||
dragging = $this;
|
||||
store = {
|
||||
touchx : parseInt(e.pageX, 10),
|
||||
dir : 1,
|
||||
focus : $this.focus,
|
||||
base : $this.options.center ? 'center':'area'
|
||||
};
|
||||
|
||||
if (e.originalEvent && e.originalEvent.touches) {
|
||||
e = e.originalEvent.touches[0];
|
||||
}
|
||||
|
||||
dragging.element.data({
|
||||
'pointer-start': {x: parseInt(e.pageX, 10), y: parseInt(e.pageY, 10)},
|
||||
'pointer-pos-start': $this.pos
|
||||
});
|
||||
|
||||
$this.container.addClass('uk-drag');
|
||||
|
||||
delayIdle = false;
|
||||
};
|
||||
|
||||
delayIdle.x = parseInt(evt.pageX, 10);
|
||||
delayIdle.threshold = $this.options.threshold;
|
||||
|
||||
},
|
||||
|
||||
mouseenter: function() { if ($this.options.pauseOnHover) $this.hovering = true; },
|
||||
mouseleave: function() { $this.hovering = false; }
|
||||
});
|
||||
|
||||
this.resize(true);
|
||||
@ -138,6 +153,12 @@
|
||||
|
||||
// prevent dragging links + images
|
||||
this.element.find('a,img').attr('draggable', 'false');
|
||||
|
||||
// Set autoplay
|
||||
if (this.options.autoplay) {
|
||||
this.start();
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
resize: function(focus) {
|
||||
@ -164,7 +185,7 @@
|
||||
|
||||
this.container.css({'min-width': pos, 'min-height': maxheight});
|
||||
|
||||
if (this.options.infinite && pos <= (2*this.vp) && !this.itemsResized) {
|
||||
if (this.options.infinite && (pos <= (2*this.vp) || this.items.length < 5) && !this.itemsResized) {
|
||||
|
||||
// fill with cloned items
|
||||
this.container.children().each(function(idx){
|
||||
@ -188,7 +209,7 @@
|
||||
'transform': ''
|
||||
});
|
||||
|
||||
this.updateFocus(0);
|
||||
if (focus) this.updateFocus(this.focus);
|
||||
},
|
||||
|
||||
updatePos: function(pos) {
|
||||
@ -208,7 +229,7 @@
|
||||
|
||||
dir = dir || (idx > this.focus ? 1:-1);
|
||||
|
||||
var $this = this, item = this.items.eq(idx), area, i;
|
||||
var item = this.items.eq(idx), area, i;
|
||||
|
||||
if (this.options.infinite) {
|
||||
this.infinite(idx, dir);
|
||||
@ -250,18 +271,36 @@
|
||||
|
||||
area += this.items.eq(i).data('width');
|
||||
|
||||
if (area >= this.vp) {
|
||||
if (area == this.vp) {
|
||||
idx = i;
|
||||
break;
|
||||
}
|
||||
|
||||
if (area > this.vp) {
|
||||
idx = (i < this.items.length-1) ? i+1 : i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
this.updatePos(this.items.eq(idx).data('left')*-1);
|
||||
if (area > this.vp) {
|
||||
this.updatePos((this.container.width() - this.vp) * -1);
|
||||
} else {
|
||||
this.updatePos(this.items.eq(idx).data('left')*-1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// mark elements
|
||||
var left = this.items.eq(idx).data('left');
|
||||
|
||||
this.items.removeClass('uk-slide-before uk-slide-after').each(function(i){
|
||||
if (i!==idx) {
|
||||
UI.$(this).addClass(UI.$(this).data('left') < left ? 'uk-slide-before':'uk-slide-after');
|
||||
}
|
||||
});
|
||||
|
||||
this.focus = idx;
|
||||
|
||||
this.trigger('focusitem.uk.slider', [idx,this.items.eq(idx),this]);
|
||||
@ -281,9 +320,25 @@
|
||||
this.updateFocus(focus, -1);
|
||||
},
|
||||
|
||||
start: function() {
|
||||
|
||||
this.stop();
|
||||
|
||||
var $this = this;
|
||||
|
||||
this.interval = setInterval(function() {
|
||||
if (!$this.hovering) $this.next();
|
||||
}, this.options.autoplayInterval);
|
||||
|
||||
},
|
||||
|
||||
stop: function() {
|
||||
if (this.interval) clearInterval(this.interval);
|
||||
},
|
||||
|
||||
infinite: function(baseidx, direction) {
|
||||
|
||||
var $this = this, item = this.items.eq(baseidx), i, z = baseidx, move = [], lastvisible, area = 0;
|
||||
var $this = this, item = this.items.eq(baseidx), i, z = baseidx, move = [], area = 0;
|
||||
|
||||
if (direction == 1) {
|
||||
|
||||
@ -356,7 +411,7 @@
|
||||
});
|
||||
|
||||
// handle dragging
|
||||
UI.$doc.on('mousemove.uikit.slider touchmove.uikit.slider', function(e) {
|
||||
UI.$doc.on('mousemove.uk.slider touchmove.uk.slider', function(e) {
|
||||
|
||||
if (e.originalEvent && e.originalEvent.touches) {
|
||||
e = e.originalEvent.touches[0];
|
||||
@ -434,13 +489,16 @@
|
||||
store.diff = diff;
|
||||
});
|
||||
|
||||
UI.$doc.on('mouseup.uikit.slider touchend.uikit.slider', function(e) {
|
||||
UI.$doc.on('mouseup.uk.slider touchend.uk.slider', function(e) {
|
||||
|
||||
if (dragging) {
|
||||
|
||||
dragging.container.removeClass('uk-drag');
|
||||
|
||||
var item = dragging.items.eq(store.focus), itm, focus = false, i, z;
|
||||
// TODO is this needed?
|
||||
dragging.items.eq(store.focus);
|
||||
|
||||
var itm, focus = false, i, z;
|
||||
|
||||
if (store.dir == 1) {
|
||||
|
||||
|
File diff suppressed because one or more lines are too long
@ -1,4 +1,4 @@
|
||||
/*! UIkit 2.21.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
/*! UIkit 2.25.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
(function(addon) {
|
||||
|
||||
var component;
|
||||
@ -45,7 +45,7 @@
|
||||
var ele = UI.$(this);
|
||||
|
||||
if(!ele.data("slideset")) {
|
||||
var plugin = UI.slideset(ele, UI.Utils.options(ele.attr("data-uk-slideset")));
|
||||
UI.slideset(ele, UI.Utils.options(ele.attr("data-uk-slideset")));
|
||||
}
|
||||
});
|
||||
});
|
||||
@ -75,7 +75,7 @@
|
||||
$this.list.addClass('uk-grid-width-'+bp+'-1-'+$this.options[bp]);
|
||||
});
|
||||
|
||||
this.on("click.uikit.slideset", '[data-uk-slideset-item]', function(e) {
|
||||
this.on("click.uk.slideset", '[data-uk-slideset-item]', function(e) {
|
||||
|
||||
e.preventDefault();
|
||||
|
||||
@ -98,7 +98,7 @@
|
||||
|
||||
});
|
||||
|
||||
this.controls.on('click.uikit.slideset', '[data-uk-filter]', function(e) {
|
||||
this.controls.on('click.uk.slideset', '[data-uk-filter]', function(e) {
|
||||
|
||||
var ele = UI.$(this);
|
||||
|
||||
@ -140,7 +140,7 @@
|
||||
|
||||
updateSets: function(animate, force) {
|
||||
|
||||
var $this = this, visible = this.visible, i;
|
||||
var visible = this.visible, i;
|
||||
|
||||
this.visible = this.getVisibleOnCurrenBreakpoint();
|
||||
|
||||
@ -296,8 +296,7 @@
|
||||
|
||||
_getAnimation: function() {
|
||||
|
||||
var $this = this,
|
||||
animation = Animations[this.options.animation] || Animations.none;
|
||||
var animation = Animations[this.options.animation] || Animations.none;
|
||||
|
||||
if (!UI.support.animation) {
|
||||
animation = Animations.none;
|
||||
@ -397,7 +396,7 @@
|
||||
|
||||
function coreAnimation(cls, current, next, dir) {
|
||||
|
||||
var d = UI.$.Deferred(),
|
||||
var d = UI.$.Deferred(),
|
||||
delay = (this.options.delay === false) ? Math.floor(this.options.duration/2) : this.options.delay,
|
||||
$this = this, clsIn, clsOut, release, i;
|
||||
|
||||
@ -433,13 +432,21 @@
|
||||
next.eq(dir == 1 ? i:(next.length - i)-1).css('animation-delay', (i*delay)+'ms');
|
||||
}
|
||||
|
||||
next.addClass(clsIn)[dir==1 ? 'last':'first']().one(UI.support.animation.end, function() {
|
||||
|
||||
var finish = function() {
|
||||
next.removeClass(''+clsIn+'').css({opacity:'', display:'', 'animation-delay':'', 'animation':''});
|
||||
d.resolve();
|
||||
$this.element.css('min-height', '');
|
||||
finish = false;
|
||||
};
|
||||
|
||||
next.addClass(clsIn)[dir==1 ? 'last':'first']().one(UI.support.animation.end, function(){
|
||||
if(finish) finish();
|
||||
}).end().css('display', '');
|
||||
|
||||
// make sure everything resolves really
|
||||
setTimeout(function() {
|
||||
if(finish) finish();
|
||||
}, next.length * delay * 2);
|
||||
};
|
||||
|
||||
if (next.length) {
|
||||
@ -457,7 +464,11 @@
|
||||
(function (index, ele){
|
||||
|
||||
setTimeout(function(){
|
||||
ele.css('display', 'none').css('display', '').css('opacity', 0).addClass(clsOut+' uk-animation-reverse');
|
||||
|
||||
ele.css('display', 'none').css('display', '').css('opacity', 0).on(UI.support.animation.end, function(){
|
||||
ele.removeClass(clsOut);
|
||||
}).addClass(clsOut+' uk-animation-reverse');
|
||||
|
||||
}.bind(this), i * delay);
|
||||
|
||||
})(i, current.eq(dir == 1 ? i:(current.length - i)-1));
|
||||
|
File diff suppressed because one or more lines are too long
@ -1,4 +1,4 @@
|
||||
/*! UIkit 2.21.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
/*! UIkit 2.25.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
(function(addon) {
|
||||
|
||||
var component;
|
||||
@ -132,8 +132,6 @@
|
||||
|
||||
for (var i = 0; i < this.options.slices; i++) {
|
||||
|
||||
var width = (i == this.options.slices-1) ? (ghostWidth - (sliceWidth*i)) : sliceWidth;
|
||||
|
||||
bar = UI.$('<div class="uk-cover-background"></div>').css({
|
||||
'position' : 'absolute',
|
||||
'top' : 0,
|
||||
@ -361,7 +359,7 @@
|
||||
if (!animations[this.fxIndex]) this.fxIndex = 0;
|
||||
|
||||
return Animations[animations[this.fxIndex]].apply(this, arguments);
|
||||
},
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
File diff suppressed because one or more lines are too long
@ -1,4 +1,4 @@
|
||||
/*! UIkit 2.21.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
/*! UIkit 2.25.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
(function(addon) {
|
||||
|
||||
var component;
|
||||
@ -40,7 +40,7 @@
|
||||
'uk-animation-top-center',
|
||||
'', // middle-center
|
||||
'uk-animation-bottom-right'
|
||||
],
|
||||
]
|
||||
},
|
||||
|
||||
current : false,
|
||||
@ -57,7 +57,7 @@
|
||||
var slideshow = UI.$(this);
|
||||
|
||||
if (!slideshow.data("slideshow")) {
|
||||
var obj = UI.slideshow(slideshow, UI.Utils.options(slideshow.attr("data-uk-slideshow")));
|
||||
UI.slideshow(slideshow, UI.Utils.options(slideshow.attr("data-uk-slideshow")));
|
||||
}
|
||||
});
|
||||
});
|
||||
@ -105,7 +105,14 @@
|
||||
|
||||
var cover = UI.$('<div class="uk-cover-background uk-position-cover"></div>').css({'background-image':'url('+ media.attr('src') + ')'});
|
||||
|
||||
media.css({'width': '100%','height': 'auto'});
|
||||
if (media.attr('width') && media.attr('height')) {
|
||||
placeholder = UI.$('<canvas></canvas>').attr({width:media.attr('width'), height:media.attr('height')});
|
||||
media.replaceWith(placeholder);
|
||||
media = placeholder;
|
||||
placeholder = undefined;
|
||||
}
|
||||
|
||||
media.css({width: '100%',height: 'auto', opacity:0});
|
||||
slide.prepend(cover).data('cover', cover);
|
||||
break;
|
||||
|
||||
@ -179,7 +186,7 @@
|
||||
}
|
||||
});
|
||||
|
||||
this.on("click.uikit.slideshow", '[data-uk-slideshow-item]', function(e) {
|
||||
this.on("click.uk.slideshow", '[data-uk-slideshow-item]', function(e) {
|
||||
|
||||
e.preventDefault();
|
||||
|
||||
@ -257,7 +264,7 @@
|
||||
|
||||
if (this.container.hasClass('uk-slideshow-fullscreen')) return;
|
||||
|
||||
var $this = this, height = this.options.height;
|
||||
var height = this.options.height;
|
||||
|
||||
if (this.options.height === 'auto') {
|
||||
|
||||
@ -281,7 +288,7 @@
|
||||
var $this = this,
|
||||
current = this.slides.eq(this.current),
|
||||
next = this.slides.eq(index),
|
||||
dir = direction ? direction : this.current < index ? -1 : 1,
|
||||
dir = direction ? direction : this.current < index ? 1 : -1,
|
||||
currentmedia = current.data('media'),
|
||||
animation = Animations[this.options.animation] ? this.options.animation : 'fade',
|
||||
nextmedia = next.data('media'),
|
||||
@ -305,7 +312,7 @@
|
||||
|
||||
UI.Utils.checkDisplay(next, '[class*="uk-animation-"]:not(.uk-cover-background.uk-position-cover)');
|
||||
|
||||
$this.trigger('show.uk.slideshow', [next]);
|
||||
$this.trigger('show.uk.slideshow', [next, current, $this]);
|
||||
};
|
||||
|
||||
$this.applyKenBurns(next);
|
||||
@ -318,6 +325,8 @@
|
||||
current = UI.$(current);
|
||||
next = UI.$(next);
|
||||
|
||||
$this.trigger('beforeshow.uk.slideshow', [next, current, $this]);
|
||||
|
||||
Animations[animation].apply(this, [current, next, dir]).then(finalize);
|
||||
|
||||
$this.triggers.removeClass('uk-active');
|
||||
@ -345,11 +354,11 @@
|
||||
},
|
||||
|
||||
next: function() {
|
||||
this.show(this.slides[this.current + 1] ? (this.current + 1) : 0);
|
||||
this.show(this.slides[this.current + 1] ? (this.current + 1) : 0, 1);
|
||||
},
|
||||
|
||||
previous: function() {
|
||||
this.show(this.slides[this.current - 1] ? (this.current - 1) : (this.slides.length - 1));
|
||||
this.show(this.slides[this.current - 1] ? (this.current - 1) : (this.slides.length - 1), -1);
|
||||
},
|
||||
|
||||
start: function() {
|
||||
@ -435,14 +444,14 @@
|
||||
|
||||
next.css('opacity', 1).one(UI.support.animation.end, function() {
|
||||
|
||||
current.removeClass(dir === 1 ? 'uk-slideshow-scroll-backward-out' : 'uk-slideshow-scroll-forward-out');
|
||||
next.css('opacity', '').removeClass(dir === 1 ? 'uk-slideshow-scroll-backward-in' : 'uk-slideshow-scroll-forward-in');
|
||||
current.removeClass(dir == -1 ? 'uk-slideshow-scroll-backward-out' : 'uk-slideshow-scroll-forward-out');
|
||||
next.css('opacity', '').removeClass(dir == -1 ? 'uk-slideshow-scroll-backward-in' : 'uk-slideshow-scroll-forward-in');
|
||||
d.resolve();
|
||||
|
||||
}.bind(this));
|
||||
|
||||
current.addClass(dir == 1 ? 'uk-slideshow-scroll-backward-out' : 'uk-slideshow-scroll-forward-out');
|
||||
next.addClass(dir == 1 ? 'uk-slideshow-scroll-backward-in' : 'uk-slideshow-scroll-forward-in');
|
||||
current.addClass(dir == -1 ? 'uk-slideshow-scroll-backward-out' : 'uk-slideshow-scroll-forward-out');
|
||||
next.addClass(dir == -1 ? 'uk-slideshow-scroll-backward-in' : 'uk-slideshow-scroll-forward-in');
|
||||
next.width(); // force redraw
|
||||
|
||||
return d.promise();
|
||||
@ -457,14 +466,14 @@
|
||||
|
||||
next.css('opacity', 1).one(UI.support.animation.end, function() {
|
||||
|
||||
current.removeClass(dir === 1 ? 'uk-slideshow-swipe-backward-out' : 'uk-slideshow-swipe-forward-out');
|
||||
next.css('opacity', '').removeClass(dir === 1 ? 'uk-slideshow-swipe-backward-in' : 'uk-slideshow-swipe-forward-in');
|
||||
current.removeClass(dir === -1 ? 'uk-slideshow-swipe-backward-out' : 'uk-slideshow-swipe-forward-out');
|
||||
next.css('opacity', '').removeClass(dir === -1 ? 'uk-slideshow-swipe-backward-in' : 'uk-slideshow-swipe-forward-in');
|
||||
d.resolve();
|
||||
|
||||
}.bind(this));
|
||||
|
||||
current.addClass(dir == 1 ? 'uk-slideshow-swipe-backward-out' : 'uk-slideshow-swipe-forward-out');
|
||||
next.addClass(dir == 1 ? 'uk-slideshow-swipe-backward-in' : 'uk-slideshow-swipe-forward-in');
|
||||
current.addClass(dir == -1 ? 'uk-slideshow-swipe-backward-out' : 'uk-slideshow-swipe-forward-out');
|
||||
next.addClass(dir == -1 ? 'uk-slideshow-swipe-backward-in' : 'uk-slideshow-swipe-forward-in');
|
||||
next.width(); // force redraw
|
||||
|
||||
return d.promise();
|
||||
@ -502,6 +511,14 @@
|
||||
|
||||
next.css('opacity', 1);
|
||||
|
||||
// for plain text content slides - looks smoother
|
||||
if (!(next.data('cover') || next.data('placeholder'))) {
|
||||
|
||||
next.css('opacity', 1).one(UI.support.animation.end, function() {
|
||||
next.removeClass('uk-slideshow-fade-in');
|
||||
}).addClass('uk-slideshow-fade-in');
|
||||
}
|
||||
|
||||
current.one(UI.support.animation.end, function() {
|
||||
|
||||
current.removeClass('uk-slideshow-fade-out');
|
||||
|
File diff suppressed because one or more lines are too long
@ -1,4 +1,4 @@
|
||||
/*! UIkit 2.21.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
/*! UIkit 2.25.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
/*
|
||||
* Based on nativesortable - Copyright (c) Brian Grinstead - https://github.com/bgrins/nativesortable
|
||||
*/
|
||||
@ -21,7 +21,7 @@
|
||||
"use strict";
|
||||
|
||||
var supportsTouch = ('ontouchstart' in window) || (window.DocumentTouch && document instanceof DocumentTouch),
|
||||
draggingPlaceholder, currentlyDraggingElement, currentlyDraggingTarget, dragging, moving, clickedlink, delayIdle, touchedlists, moved;
|
||||
draggingPlaceholder, currentlyDraggingElement, currentlyDraggingTarget, dragging, moving, clickedlink, delayIdle, touchedlists, moved, overElement;
|
||||
|
||||
function closestSortable(ele) {
|
||||
|
||||
@ -51,6 +51,7 @@
|
||||
dragMovingClass : 'uk-sortable-moving',
|
||||
baseClass : 'uk-sortable',
|
||||
noDragClass : 'uk-sortable-nodrag',
|
||||
emptyClass : 'uk-sortable-empty',
|
||||
dragCustomClass : '',
|
||||
handleClass : false,
|
||||
group : false,
|
||||
@ -70,7 +71,7 @@
|
||||
var ele = UI.$(this);
|
||||
|
||||
if(!ele.data("sortable")) {
|
||||
var plugin = UI.sortable(ele, UI.Utils.options(ele.attr("data-uk-sortable")));
|
||||
UI.sortable(ele, UI.Utils.options(ele.attr("data-uk-sortable")));
|
||||
}
|
||||
});
|
||||
});
|
||||
@ -105,10 +106,15 @@
|
||||
draggingPlaceholder.css({'left': left, 'top': top });
|
||||
|
||||
// adjust document scrolling
|
||||
|
||||
if (top + (draggingPlaceholder.height()/3) > document.body.offsetHeight) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (top < UI.$win.scrollTop()) {
|
||||
UI.$win.scrollTop(UI.$win.scrollTop() - Math.ceil(draggingPlaceholder.height()/2));
|
||||
} else if ( (top + draggingPlaceholder.height()) > (window.innerHeight + UI.$win.scrollTop()) ) {
|
||||
UI.$win.scrollTop(UI.$win.scrollTop() + Math.ceil(draggingPlaceholder.height()/2));
|
||||
UI.$win.scrollTop(UI.$win.scrollTop() - Math.ceil(draggingPlaceholder.height()/3));
|
||||
} else if ( (top + (draggingPlaceholder.height()/3)) > (window.innerHeight + UI.$win.scrollTop()) ) {
|
||||
UI.$win.scrollTop(UI.$win.scrollTop() + Math.ceil(draggingPlaceholder.height()/3));
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -125,7 +131,7 @@
|
||||
}
|
||||
|
||||
// inside or outside of sortable?
|
||||
var sortable = closestSortable(e.target),
|
||||
var sortable = closestSortable(currentlyDraggingElement),
|
||||
component = draggingPlaceholder.$sortable,
|
||||
ev = { type: e.type };
|
||||
|
||||
@ -139,27 +145,27 @@
|
||||
init: function() {
|
||||
|
||||
var $this = this,
|
||||
element = this.element[0],
|
||||
children;
|
||||
element = this.element[0];
|
||||
|
||||
touchedlists = [];
|
||||
|
||||
// make sure :empty selector works on empty lists
|
||||
if (this.element.children().length === 0) {
|
||||
this.element.html('');
|
||||
}
|
||||
this.checkEmptyList();
|
||||
|
||||
this.element.data('sortable-group', this.options.group ? this.options.group : UI.Utils.uid('sortable-group'));
|
||||
|
||||
var handleDragStart = delegate(function(e) {
|
||||
|
||||
if (e.data && e.data.sortable) {
|
||||
return;
|
||||
}
|
||||
|
||||
var $target = UI.$(e.target),
|
||||
$link = $target.is('a[href]') ? $target:$target.parents('a[href]');
|
||||
|
||||
|
||||
if ($target.is(':input')) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
e.preventDefault();
|
||||
|
||||
if (!supportsTouch && $link.length) {
|
||||
@ -171,22 +177,13 @@
|
||||
});
|
||||
}
|
||||
|
||||
e.data = e.data || {};
|
||||
|
||||
e.data.sortable = element;
|
||||
|
||||
return $this.dragStart(e, this);
|
||||
});
|
||||
|
||||
var handleDragOver = delegate(function(e) {
|
||||
|
||||
if (!currentlyDraggingElement) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (e.preventDefault) {
|
||||
e.preventDefault();
|
||||
}
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
var handleDragEnter = delegate(UI.Utils.debounce(function(e) {
|
||||
return $this.dragEnter(e, this);
|
||||
}), 40);
|
||||
@ -269,6 +266,8 @@
|
||||
if (supportsTouch && document.elementFromPoint) {
|
||||
target = document.elementFromPoint(e.pageX - document.body.scrollLeft, e.pageY - document.body.scrollTop);
|
||||
}
|
||||
|
||||
overElement = UI.$(target);
|
||||
}
|
||||
|
||||
if (UI.$(target).hasClass($this.options.childClass)) {
|
||||
@ -296,8 +295,7 @@
|
||||
dragging = false;
|
||||
|
||||
var $this = this,
|
||||
target = UI.$(e.target),
|
||||
children = $this.element.children();
|
||||
target = UI.$(e.target);
|
||||
|
||||
if (!supportsTouch && e.button==2) {
|
||||
return;
|
||||
@ -313,7 +311,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
if (target.is('.'+$this.options.noDragClass) || target.closest('.'+$this.options._noDragClass).length) {
|
||||
if (target.is('.'+$this.options.noDragClass) || target.closest('.'+$this.options.noDragClass).length) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -355,7 +353,12 @@
|
||||
|
||||
draggingPlaceholder.$current = $current;
|
||||
draggingPlaceholder.$sortable = $this;
|
||||
$current.data('sortable-group', $this.options.group);
|
||||
|
||||
$current.data({
|
||||
'start-list': $current.parent(),
|
||||
'start-index': $current.index(),
|
||||
'sortable-group': $this.options.group
|
||||
});
|
||||
|
||||
$this.addDragHandlers();
|
||||
|
||||
@ -369,8 +372,10 @@
|
||||
},
|
||||
|
||||
dragMove: function(e, elem) {
|
||||
var overEl = UI.$(document.elementFromPoint(e.pageX - document.body.scrollLeft, e.pageY - (window.pageYOffset || document.documentElement.scrollTop))),
|
||||
overRoot = overEl.closest('.'+this.options.baseClass),
|
||||
|
||||
overElement = UI.$(document.elementFromPoint(e.pageX - (document.body.scrollLeft || document.scrollLeft || 0), e.pageY - (document.body.scrollTop || document.documentElement.scrollTop || 0)));
|
||||
|
||||
var overRoot = overElement.closest('.'+this.options.baseClass),
|
||||
groupOver = overRoot.data("sortable-group"),
|
||||
$current = UI.$(currentlyDraggingElement),
|
||||
currentRoot = $current.parent(),
|
||||
@ -378,6 +383,7 @@
|
||||
overChild;
|
||||
|
||||
if (overRoot[0] !== currentRoot[0] && groupCurrent !== undefined && groupOver === groupCurrent) {
|
||||
|
||||
overRoot.data('sortable').addDragHandlers();
|
||||
|
||||
touchedlists.push(overRoot);
|
||||
@ -385,19 +391,23 @@
|
||||
|
||||
// swap root
|
||||
if (overRoot.children().length > 0) {
|
||||
overChild = overEl.closest('.'+this.options.childClass);
|
||||
overChild.before($current);
|
||||
} else { // empty list
|
||||
overEl.append($current);
|
||||
}
|
||||
overChild = overElement.closest('.'+this.options.childClass);
|
||||
|
||||
// list empty? remove inner whitespace to make sure :empty selector works
|
||||
if (currentRoot.children().length === 0) {
|
||||
currentRoot.html('');
|
||||
if (overChild.length) {
|
||||
overChild.before($current);
|
||||
} else {
|
||||
overRoot.append($current);
|
||||
}
|
||||
|
||||
} else { // empty list
|
||||
overElement.append($current);
|
||||
}
|
||||
|
||||
UIkit.$doc.trigger('mouseover');
|
||||
}
|
||||
|
||||
this.checkEmptyList();
|
||||
this.checkEmptyList(currentRoot);
|
||||
},
|
||||
|
||||
dragEnter: function(e, elem) {
|
||||
@ -406,15 +416,27 @@
|
||||
return true;
|
||||
}
|
||||
|
||||
// Prevent dragenter on a child from allowing a dragleave on the container
|
||||
var previousCounter = this.dragenterData(elem);
|
||||
|
||||
this.dragenterData(elem, previousCounter + 1);
|
||||
|
||||
// Prevent dragenter on a child from allowing a dragleave on the container
|
||||
if (previousCounter === 0) {
|
||||
|
||||
UI.$(elem).addClass(this.options.overClass);
|
||||
var currentlist = UI.$(elem).parent(),
|
||||
startlist = UI.$(currentlyDraggingElement).data("start-list");
|
||||
|
||||
if (currentlist[0] !== startlist[0]) {
|
||||
|
||||
var groupOver = currentlist.data('sortable-group'),
|
||||
groupCurrent = UI.$(currentlyDraggingElement).data("sortable-group");
|
||||
|
||||
if ((groupOver || groupCurrent) && (groupOver != groupCurrent)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
UI.$(elem).addClass(this.options.overClass);
|
||||
this.moveElementNextTo(currentlyDraggingElement, elem);
|
||||
}
|
||||
|
||||
@ -483,17 +505,20 @@
|
||||
var $current = UI.$(currentlyDraggingElement),
|
||||
oldRoot = draggingPlaceholder.data("origin"),
|
||||
newRoot = $current.closest('.'+this.options.baseClass),
|
||||
triggers = [];
|
||||
triggers = [],
|
||||
el = UI.$(currentlyDraggingElement);
|
||||
|
||||
// events depending on move inside lists or across lists
|
||||
if (oldRoot[0] === newRoot[0] && draggingPlaceholder.data('index') != $current.index() ) {
|
||||
triggers.push({el: this, mode: 'moved'});
|
||||
triggers.push({sortable: this, mode: 'moved'});
|
||||
} else if (oldRoot[0] != newRoot[0]) {
|
||||
triggers.push({el: newRoot, mode: 'added'}, {el: oldRoot, mode: 'removed'});
|
||||
triggers.push({sortable: UI.$(newRoot).data('sortable'), mode: 'added'}, {sortable: UI.$(oldRoot).data('sortable'), mode: 'removed'});
|
||||
}
|
||||
|
||||
triggers.forEach(function (trigger, i) {
|
||||
trigger.el.trigger('change.uk.sortable', [trigger.el, currentlyDraggingElement, trigger.mode]);
|
||||
if (trigger.sortable) {
|
||||
trigger.sortable.element.trigger('change.uk.sortable', [trigger.sortable, el, trigger.mode]);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
@ -587,6 +612,15 @@
|
||||
});
|
||||
|
||||
return data;
|
||||
},
|
||||
|
||||
checkEmptyList: function(list) {
|
||||
|
||||
list = list ? UI.$(list) : this.element;
|
||||
|
||||
if (this.options.emptyClass) {
|
||||
list[!list.children().length ? 'addClass':'removeClass'](this.options.emptyClass);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
File diff suppressed because one or more lines are too long
@ -1,4 +1,4 @@
|
||||
/*! UIkit 2.21.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
/*! UIkit 2.25.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
(function(addon) {
|
||||
|
||||
var component;
|
||||
@ -19,7 +19,8 @@
|
||||
|
||||
var $win = UI.$win,
|
||||
$doc = UI.$doc,
|
||||
sticked = [];
|
||||
sticked = [],
|
||||
direction = 1;
|
||||
|
||||
UI.component('sticky', {
|
||||
|
||||
@ -29,7 +30,9 @@
|
||||
animation : '',
|
||||
clsinit : 'uk-sticky-init',
|
||||
clsactive : 'uk-active',
|
||||
clsinactive : '',
|
||||
getWidthFrom : '',
|
||||
showup : false,
|
||||
boundary : false,
|
||||
media : false,
|
||||
target : false,
|
||||
@ -39,14 +42,19 @@
|
||||
boot: function() {
|
||||
|
||||
// should be more efficient than using $win.scroll(checkscrollposition):
|
||||
UI.$doc.on('scrolling.uk.document', function() { checkscrollposition(); });
|
||||
UI.$doc.on('scrolling.uk.document', function(e, data) {
|
||||
if (!data || !data.dir) return;
|
||||
direction = data.dir.y;
|
||||
checkscrollposition();
|
||||
});
|
||||
|
||||
UI.$win.on('resize orientationchange', UI.Utils.debounce(function() {
|
||||
|
||||
if (!sticked.length) return;
|
||||
|
||||
for (var i = 0; i < sticked.length; i++) {
|
||||
sticked[i].reset(true);
|
||||
sticked[i].self.computeWrapper();
|
||||
//sticked[i].self.computeWrapper();
|
||||
}
|
||||
|
||||
checkscrollposition();
|
||||
@ -73,17 +81,17 @@
|
||||
|
||||
init: function() {
|
||||
|
||||
var wrapper = UI.$('<div class="uk-sticky-placeholder"></div>'), boundary = this.options.boundary, boundtoparent;
|
||||
|
||||
this.wrapper = this.element.css('margin', 0).wrap(wrapper).parent();
|
||||
var boundary = this.options.boundary, boundtoparent;
|
||||
|
||||
this.wrapper = this.element.wrap('<div class="uk-sticky-placeholder"></div>').parent();
|
||||
this.computeWrapper();
|
||||
this.element.css('margin', 0);
|
||||
|
||||
if (boundary) {
|
||||
|
||||
if (boundary === true) {
|
||||
if (boundary === true || boundary[0] === '!') {
|
||||
|
||||
boundary = this.wrapper.parent();
|
||||
boundary = boundary === true ? this.wrapper.parent() : this.wrapper.closest(boundary.substr(1));
|
||||
boundtoparent = true;
|
||||
|
||||
} else if (typeof boundary === "string") {
|
||||
@ -98,21 +106,51 @@
|
||||
currentTop : null,
|
||||
wrapper : this.wrapper,
|
||||
init : false,
|
||||
getWidthFrom : this.options.getWidthFrom || this.wrapper,
|
||||
getWidthFrom : UI.$(this.options.getWidthFrom || this.wrapper),
|
||||
boundary : boundary,
|
||||
boundtoparent : boundtoparent,
|
||||
reset : function(force) {
|
||||
top : 0,
|
||||
calcTop : function() {
|
||||
|
||||
var top = this.options.top;
|
||||
|
||||
// dynamic top parameter
|
||||
if (this.options.top && typeof(this.options.top) == 'string') {
|
||||
|
||||
// e.g. 50vh
|
||||
if (this.options.top.match(/^(-|)(\d+)vh$/)) {
|
||||
top = window.innerHeight * parseInt(this.options.top, 10)/100;
|
||||
// e.g. #elementId, or .class-1,class-2,.class-3 (first found is used)
|
||||
} else {
|
||||
|
||||
var topElement = UI.$(this.options.top).first();
|
||||
|
||||
if (topElement.length && topElement.is(':visible')) {
|
||||
top = -1 * ((topElement.offset().top + topElement.outerHeight()) - this.wrapper.offset().top);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
this.top = top;
|
||||
},
|
||||
|
||||
reset: function(force) {
|
||||
|
||||
this.calcTop();
|
||||
|
||||
var finalize = function() {
|
||||
this.element.css({"position":"", "top":"", "width":"", "left":"", "margin":"0"});
|
||||
this.element.removeClass([this.options.animation, 'uk-animation-reverse', this.options.clsactive].join(' '));
|
||||
this.element.addClass(this.options.clsinactive);
|
||||
this.element.trigger('inactive.uk.sticky');
|
||||
|
||||
this.currentTop = null;
|
||||
this.animate = false;
|
||||
}.bind(this);
|
||||
|
||||
|
||||
if (!force && this.options.animation && UI.support.animation) {
|
||||
if (!force && this.options.animation && UI.support.animation && !UI.Utils.isInView(this.wrapper)) {
|
||||
|
||||
this.animate = true;
|
||||
|
||||
@ -153,12 +191,28 @@
|
||||
dwh = documentHeight - window.innerHeight,
|
||||
extra = (scrollTop > dwh) ? dwh - scrollTop : 0,
|
||||
elementTop = this.wrapper.offset().top,
|
||||
etse = elementTop - this.options.top - extra;
|
||||
etse = elementTop - this.top - extra,
|
||||
active = (scrollTop >= etse);
|
||||
|
||||
return (scrollTop >= etse);
|
||||
if (active && this.options.showup) {
|
||||
|
||||
// set inactiv if scrolling down
|
||||
if (direction == 1) {
|
||||
active = false;
|
||||
}
|
||||
|
||||
// set inactive when wrapper is still in view
|
||||
if (direction == -1 && !this.element.hasClass(this.options.clsactive) && UI.Utils.isInView(this.wrapper)) {
|
||||
active = false;
|
||||
}
|
||||
}
|
||||
|
||||
return active;
|
||||
}
|
||||
};
|
||||
|
||||
this.sticky.calcTop();
|
||||
|
||||
sticked.push(this.sticky);
|
||||
},
|
||||
|
||||
@ -179,14 +233,20 @@
|
||||
computeWrapper: function() {
|
||||
|
||||
this.wrapper.css({
|
||||
'height' : this.element.css('position') != 'absolute' ? this.element.outerHeight() : '',
|
||||
'float' : this.element.css("float") != "none" ? this.element.css("float") : '',
|
||||
'margin' : this.element.css("margin")
|
||||
'height' : ['absolute','fixed'].indexOf(this.element.css('position')) == -1 ? this.element.outerHeight() : '',
|
||||
'float' : this.element.css('float') != 'none' ? this.element.css('float') : '',
|
||||
'margin' : this.element.css('margin')
|
||||
});
|
||||
|
||||
if (this.element.css('position') == 'fixed') {
|
||||
this.element.css({
|
||||
width: this.sticky.getWidthFrom.length ? this.sticky.getWidthFrom.width() : this.element.width()
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
function checkscrollposition() {
|
||||
function checkscrollposition(direction) {
|
||||
|
||||
var stickies = arguments.length ? arguments : sticked;
|
||||
|
||||
@ -215,17 +275,17 @@
|
||||
|
||||
} else {
|
||||
|
||||
if (sticky.options.top < 0) {
|
||||
if (sticky.top < 0) {
|
||||
newTop = 0;
|
||||
} else {
|
||||
stickyHeight = sticky.element.outerHeight();
|
||||
newTop = documentHeight - stickyHeight - sticky.options.top - sticky.options.bottom - scrollTop - extra;
|
||||
newTop = newTop < 0 ? newTop + sticky.options.top : sticky.options.top;
|
||||
newTop = documentHeight - stickyHeight - sticky.top - sticky.options.bottom - scrollTop - extra;
|
||||
newTop = newTop < 0 ? newTop + sticky.top : sticky.top;
|
||||
}
|
||||
|
||||
if (sticky.boundary && sticky.boundary.length) {
|
||||
|
||||
var bTop = sticky.boundary.position().top;
|
||||
var bTop = sticky.boundary.offset().top;
|
||||
|
||||
if (sticky.boundtoparent) {
|
||||
containerBottom = documentHeight - (bTop + sticky.boundary.outerHeight()) + parseInt(sticky.boundary.css('padding-bottom'));
|
||||
@ -233,17 +293,16 @@
|
||||
containerBottom = documentHeight - bTop - parseInt(sticky.boundary.css('margin-top'));
|
||||
}
|
||||
|
||||
newTop = (scrollTop + stickyHeight) > (documentHeight - containerBottom - (sticky.options.top < 0 ? 0 : sticky.options.top)) ? (documentHeight - containerBottom) - (scrollTop + stickyHeight) : newTop;
|
||||
newTop = (scrollTop + stickyHeight) > (documentHeight - containerBottom - (sticky.top < 0 ? 0 : sticky.top)) ? (documentHeight - containerBottom) - (scrollTop + stickyHeight) : newTop;
|
||||
}
|
||||
|
||||
|
||||
if (sticky.currentTop != newTop) {
|
||||
|
||||
sticky.element.css({
|
||||
"position" : "fixed",
|
||||
"top" : newTop,
|
||||
"width" : (typeof sticky.getWidthFrom !== 'undefined') ? UI.$(sticky.getWidthFrom).width() : sticky.element.width(),
|
||||
"left" : sticky.wrapper.offset().left
|
||||
position : "fixed",
|
||||
top : newTop,
|
||||
width : sticky.getWidthFrom.length ? sticky.getWidthFrom.width() : sticky.element.width()
|
||||
});
|
||||
|
||||
if (!sticky.init) {
|
||||
@ -279,10 +338,11 @@
|
||||
}
|
||||
}
|
||||
|
||||
sticky.element.addClass(sticky.options.clsactive);
|
||||
sticky.element.addClass(sticky.options.clsactive).removeClass(sticky.options.clsinactive);
|
||||
sticky.element.trigger('active.uk.sticky');
|
||||
sticky.element.css('margin', '');
|
||||
|
||||
if (sticky.options.animation && sticky.init) {
|
||||
if (sticky.options.animation && sticky.init && !UI.Utils.isInView(sticky.wrapper)) {
|
||||
sticky.element.addClass(sticky.options.animation);
|
||||
}
|
||||
|
||||
|
@ -1,2 +1,2 @@
|
||||
/*! UIkit 2.21.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
!function(t){var i;window.UIkit&&(i=t(UIkit)),"function"==typeof define&&define.amd&&define("uikit-sticky",["uikit"],function(){return i||t(UIkit)})}(function(t){"use strict";function i(){var i=arguments.length?arguments:o;if(i.length&&!(e.scrollTop()<0))for(var s,a,r,p,h=e.scrollTop(),c=n.height(),l=e.height(),u=c-l,d=h>u?u-h:0,m=0;m<i.length;m++)if(p=i[m],p.element.is(":visible")&&!p.animate){if(p.check()){if(p.options.top<0?s=0:(r=p.element.outerHeight(),s=c-r-p.options.top-p.options.bottom-h-d,s=0>s?s+p.options.top:p.options.top),p.boundary&&p.boundary.length){var f=p.boundary.position().top;a=p.boundtoparent?c-(f+p.boundary.outerHeight())+parseInt(p.boundary.css("padding-bottom")):c-f-parseInt(p.boundary.css("margin-top")),s=h+r>c-a-(p.options.top<0?0:p.options.top)?c-a-(h+r):s}if(p.currentTop!=s){if(p.element.css({position:"fixed",top:s,width:"undefined"!=typeof p.getWidthFrom?t.$(p.getWidthFrom).width():p.element.width(),left:p.wrapper.offset().left}),!p.init&&(p.element.addClass(p.options.clsinit),location.hash&&h>0&&p.options.target)){var g=t.$(location.hash);g.length&&setTimeout(function(t,i){return function(){i.element.width();var e=t.offset(),n=e.top+t.outerHeight(),o=i.element.offset(),s=i.element.outerHeight(),a=o.top+s;o.top<n&&e.top<a&&(h=e.top-s-i.options.target,window.scrollTo(0,h))}}(g,p),0)}p.element.addClass(p.options.clsactive),p.element.css("margin",""),p.options.animation&&p.init&&p.element.addClass(p.options.animation),p.currentTop=s}}else null!==p.currentTop&&p.reset();p.init=!0}}var e=t.$win,n=t.$doc,o=[];return t.component("sticky",{defaults:{top:0,bottom:0,animation:"",clsinit:"uk-sticky-init",clsactive:"uk-active",getWidthFrom:"",boundary:!1,media:!1,target:!1,disabled:!1},boot:function(){t.$doc.on("scrolling.uk.document",function(){i()}),t.$win.on("resize orientationchange",t.Utils.debounce(function(){if(o.length){for(var t=0;t<o.length;t++)o[t].reset(!0),o[t].self.computeWrapper();i()}},100)),t.ready(function(e){setTimeout(function(){t.$("[data-uk-sticky]",e).each(function(){var i=t.$(this);i.data("sticky")||t.sticky(i,t.Utils.options(i.attr("data-uk-sticky")))}),i()},0)})},init:function(){var i,s=t.$('<div class="uk-sticky-placeholder"></div>'),a=this.options.boundary;this.wrapper=this.element.css("margin",0).wrap(s).parent(),this.computeWrapper(),a&&(a===!0?(a=this.wrapper.parent(),i=!0):"string"==typeof a&&(a=t.$(a))),this.sticky={self:this,options:this.options,element:this.element,currentTop:null,wrapper:this.wrapper,init:!1,getWidthFrom:this.options.getWidthFrom||this.wrapper,boundary:a,boundtoparent:i,reset:function(i){var e=function(){this.element.css({position:"",top:"",width:"",left:"",margin:"0"}),this.element.removeClass([this.options.animation,"uk-animation-reverse",this.options.clsactive].join(" ")),this.currentTop=null,this.animate=!1}.bind(this);!i&&this.options.animation&&t.support.animation?(this.animate=!0,this.element.removeClass(this.options.animation).one(t.support.animation.end,function(){e()}).width(),this.element.addClass(this.options.animation+" uk-animation-reverse")):e()},check:function(){if(this.options.disabled)return!1;if(this.options.media)switch(typeof this.options.media){case"number":if(window.innerWidth<this.options.media)return!1;break;case"string":if(window.matchMedia&&!window.matchMedia(this.options.media).matches)return!1}var t=e.scrollTop(),i=n.height(),o=i-window.innerHeight,s=t>o?o-t:0,a=this.wrapper.offset().top,r=a-this.options.top-s;return t>=r}},o.push(this.sticky)},update:function(){i(this.sticky)},enable:function(){this.options.disabled=!1,this.update()},disable:function(t){this.options.disabled=!0,this.sticky.reset(t)},computeWrapper:function(){this.wrapper.css({height:"absolute"!=this.element.css("position")?this.element.outerHeight():"","float":"none"!=this.element.css("float")?this.element.css("float"):"",margin:this.element.css("margin")})}}),t.sticky});
|
||||
/*! UIkit 2.25.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
!function(t){var i;window.UIkit&&(i=t(UIkit)),"function"==typeof define&&define.amd&&define("uikit-sticky",["uikit"],function(){return i||t(UIkit)})}(function(t){"use strict";function i(){var i=arguments.length?arguments:n;if(i.length&&!(e.scrollTop()<0))for(var o,a,r,h,p=e.scrollTop(),c=s.height(),l=e.height(),d=c-l,u=p>d?d-p:0,m=0;m<i.length;m++)if(h=i[m],h.element.is(":visible")&&!h.animate){if(h.check()){if(h.top<0?o=0:(r=h.element.outerHeight(),o=c-r-h.top-h.options.bottom-p-u,o=0>o?o+h.top:h.top),h.boundary&&h.boundary.length){var f=h.boundary.offset().top;a=h.boundtoparent?c-(f+h.boundary.outerHeight())+parseInt(h.boundary.css("padding-bottom")):c-f-parseInt(h.boundary.css("margin-top")),o=p+r>c-a-(h.top<0?0:h.top)?c-a-(p+r):o}if(h.currentTop!=o){if(h.element.css({position:"fixed",top:o,width:h.getWidthFrom.length?h.getWidthFrom.width():h.element.width()}),!h.init&&(h.element.addClass(h.options.clsinit),location.hash&&p>0&&h.options.target)){var g=t.$(location.hash);g.length&&setTimeout(function(t,i){return function(){i.element.width();var e=t.offset(),s=e.top+t.outerHeight(),n=i.element.offset(),o=i.element.outerHeight(),a=n.top+o;n.top<s&&e.top<a&&(p=e.top-o-i.options.target,window.scrollTo(0,p))}}(g,h),0)}h.element.addClass(h.options.clsactive).removeClass(h.options.clsinactive),h.element.trigger("active.uk.sticky"),h.element.css("margin",""),h.options.animation&&h.init&&!t.Utils.isInView(h.wrapper)&&h.element.addClass(h.options.animation),h.currentTop=o}}else null!==h.currentTop&&h.reset();h.init=!0}}var e=t.$win,s=t.$doc,n=[],o=1;return t.component("sticky",{defaults:{top:0,bottom:0,animation:"",clsinit:"uk-sticky-init",clsactive:"uk-active",clsinactive:"",getWidthFrom:"",showup:!1,boundary:!1,media:!1,target:!1,disabled:!1},boot:function(){t.$doc.on("scrolling.uk.document",function(t,e){e&&e.dir&&(o=e.dir.y,i())}),t.$win.on("resize orientationchange",t.Utils.debounce(function(){if(n.length){for(var t=0;t<n.length;t++)n[t].reset(!0);i()}},100)),t.ready(function(e){setTimeout(function(){t.$("[data-uk-sticky]",e).each(function(){var i=t.$(this);i.data("sticky")||t.sticky(i,t.Utils.options(i.attr("data-uk-sticky")))}),i()},0)})},init:function(){var i,a=this.options.boundary;this.wrapper=this.element.wrap('<div class="uk-sticky-placeholder"></div>').parent(),this.computeWrapper(),this.element.css("margin",0),a&&(a===!0||"!"===a[0]?(a=a===!0?this.wrapper.parent():this.wrapper.closest(a.substr(1)),i=!0):"string"==typeof a&&(a=t.$(a))),this.sticky={self:this,options:this.options,element:this.element,currentTop:null,wrapper:this.wrapper,init:!1,getWidthFrom:t.$(this.options.getWidthFrom||this.wrapper),boundary:a,boundtoparent:i,top:0,calcTop:function(){var i=this.options.top;if(this.options.top&&"string"==typeof this.options.top)if(this.options.top.match(/^(-|)(\d+)vh$/))i=window.innerHeight*parseInt(this.options.top,10)/100;else{var e=t.$(this.options.top).first();e.length&&e.is(":visible")&&(i=-1*(e.offset().top+e.outerHeight()-this.wrapper.offset().top))}this.top=i},reset:function(i){this.calcTop();var e=function(){this.element.css({position:"",top:"",width:"",left:"",margin:"0"}),this.element.removeClass([this.options.animation,"uk-animation-reverse",this.options.clsactive].join(" ")),this.element.addClass(this.options.clsinactive),this.element.trigger("inactive.uk.sticky"),this.currentTop=null,this.animate=!1}.bind(this);!i&&this.options.animation&&t.support.animation&&!t.Utils.isInView(this.wrapper)?(this.animate=!0,this.element.removeClass(this.options.animation).one(t.support.animation.end,function(){e()}).width(),this.element.addClass(this.options.animation+" uk-animation-reverse")):e()},check:function(){if(this.options.disabled)return!1;if(this.options.media)switch(typeof this.options.media){case"number":if(window.innerWidth<this.options.media)return!1;break;case"string":if(window.matchMedia&&!window.matchMedia(this.options.media).matches)return!1}var i=e.scrollTop(),n=s.height(),a=n-window.innerHeight,r=i>a?a-i:0,h=this.wrapper.offset().top,p=h-this.top-r,c=i>=p;return c&&this.options.showup&&(1==o&&(c=!1),-1==o&&!this.element.hasClass(this.options.clsactive)&&t.Utils.isInView(this.wrapper)&&(c=!1)),c}},this.sticky.calcTop(),n.push(this.sticky)},update:function(){i(this.sticky)},enable:function(){this.options.disabled=!1,this.update()},disable:function(t){this.options.disabled=!0,this.sticky.reset(t)},computeWrapper:function(){this.wrapper.css({height:-1==["absolute","fixed"].indexOf(this.element.css("position"))?this.element.outerHeight():"","float":"none"!=this.element.css("float")?this.element.css("float"):"",margin:this.element.css("margin")}),"fixed"==this.element.css("position")&&this.element.css({width:this.sticky.getWidthFrom.length?this.sticky.getWidthFrom.width():this.element.width()})}}),t.sticky});
|
@ -1,4 +1,4 @@
|
||||
/*! UIkit 2.21.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
/*! UIkit 2.25.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
(function(addon) {
|
||||
|
||||
var component;
|
||||
@ -8,7 +8,7 @@
|
||||
}
|
||||
|
||||
if (typeof define == "function" && define.amd) {
|
||||
define("uikit-search", ["uikit"], function(){
|
||||
define("uikit-timepicker", ["uikit"], function(){
|
||||
return component || addon(UIkit);
|
||||
});
|
||||
}
|
||||
@ -79,9 +79,9 @@
|
||||
$this.autocomplete.value = Math.random();
|
||||
$this.autocomplete.triggercomplete();
|
||||
|
||||
}).on('blur', function() {
|
||||
}).on('blur', UI.Utils.debounce(function() {
|
||||
$this.checkTime();
|
||||
});
|
||||
}, 100));
|
||||
|
||||
this.element.data("timepicker", this);
|
||||
},
|
||||
|
@ -1,2 +1,2 @@
|
||||
/*! UIkit 2.21.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
!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",function(){o.checkTime()}),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:"")}})});
|
||||
/*! UIkit 2.25.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
!function(t){var e;window.UIkit&&(e=t(UIkit)),"function"==typeof define&&define.amd&&define("uikit-timepicker",["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:"")}})});
|
@ -1,4 +1,4 @@
|
||||
/*! UIkit 2.21.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
/*! UIkit 2.25.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
(function(addon) {
|
||||
var component;
|
||||
|
||||
@ -28,11 +28,10 @@
|
||||
"delay": 0, // in miliseconds
|
||||
"cls": "",
|
||||
"activeClass": "uk-active",
|
||||
"src": function(ele, title) {
|
||||
"src": function(ele) {
|
||||
var title = ele.attr('title');
|
||||
|
||||
title = ele.attr('title');
|
||||
|
||||
if (title) {
|
||||
if (title !== undefined) {
|
||||
ele.data('cached-title', title).removeAttr('title');
|
||||
}
|
||||
|
||||
@ -49,7 +48,7 @@
|
||||
var ele = UI.$(this);
|
||||
|
||||
if (!ele.data("tooltip")) {
|
||||
var obj = UI.tooltip(ele, UI.Utils.options(ele.attr("data-uk-tooltip")));
|
||||
UI.tooltip(ele, UI.Utils.options(ele.attr("data-uk-tooltip")));
|
||||
ele.trigger("mouseenter");
|
||||
}
|
||||
});
|
||||
@ -77,7 +76,8 @@
|
||||
|
||||
if (tooltipdelay) clearTimeout(tooltipdelay);
|
||||
if (checkdelay) clearTimeout(checkdelay);
|
||||
if (!this.tip.length) return;
|
||||
|
||||
if (typeof(this.tip) === 'string' ? !this.tip.length:true) return;
|
||||
|
||||
$tooltip.stop().css({"top": -2000, "visibility": "hidden"}).removeClass(this.options.activeClass).show();
|
||||
$tooltip.html('<div class="uk-tooltip-inner">' + this.tip + '</div>');
|
||||
|
@ -1,2 +1,2 @@
|
||||
/*! UIkit 2.21.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
!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,i){return i=t.attr("title"),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);if(!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),this.tip.length){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});
|
||||
/*! UIkit 2.25.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
!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});
|
@ -1,4 +1,4 @@
|
||||
/*! UIkit 2.21.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
/*! UIkit 2.25.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
(function(addon) {
|
||||
|
||||
var component;
|
||||
@ -188,6 +188,10 @@
|
||||
|
||||
xhr.open(settings.method, settings.action, true);
|
||||
|
||||
if (settings.type=="json") {
|
||||
xhr.setRequestHeader("Accept", "application/json");
|
||||
}
|
||||
|
||||
xhr.onreadystatechange = function() {
|
||||
|
||||
settings.readystatechange(xhr);
|
||||
|
@ -1,2 +1,2 @@
|
||||
/*! UIkit 2.21.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
!function(e){var t;window.UIkit&&(t=e(UIkit)),"function"==typeof define&&define.amd&&define("uikit-upload",["uikit"],function(){return t||e(UIkit)})}(function(e){"use strict";function t(o,a){function r(t,n){var o=new FormData,a=new XMLHttpRequest;if(n.before(n,t)!==!1){for(var r,l=0;r=t[l];l++)o.append(n.param,r);for(var i in n.params)o.append(i,n.params[i]);a.upload.addEventListener("progress",function(e){var t=e.loaded/e.total*100;n.progress(t,e)},!1),a.addEventListener("loadstart",function(e){n.loadstart(e)},!1),a.addEventListener("load",function(e){n.load(e)},!1),a.addEventListener("loadend",function(e){n.loadend(e)},!1),a.addEventListener("error",function(e){n.error(e)},!1),a.addEventListener("abort",function(e){n.abort(e)},!1),a.open(n.method,n.action,!0),a.onreadystatechange=function(){if(n.readystatechange(a),4==a.readyState){var t=a.responseText;if("json"==n.type)try{t=e.$.parseJSON(t)}catch(o){t=!1}n.complete(t,a)}},n.beforeSend(a),a.send(o)}}if(!e.support.ajaxupload)return this;if(a=e.$.extend({},t.defaults,a),o.length){if("*.*"!==a.allow)for(var l,i=0;l=o[i];i++)if(!n(a.allow,l.name))return"string"==typeof a.notallowed?alert(a.notallowed):a.notallowed(l,a),void 0;var f=a.complete;if(a.single){var d=o.length,s=0,p=!0;a.beforeAll(o),a.complete=function(e,t){s+=1,f(e,t),a.filelimit&&s>=a.filelimit&&(p=!1),p&&d>s?r([o[s]],a):a.allcomplete(e,t)},r([o[0]],a)}else a.complete=function(e,t){f(e,t),a.allcomplete(e,t)},r(o,a)}}function n(e,t){var n="^"+e.replace(/\//g,"\\/").replace(/\*\*/g,"(\\/[^\\/]+)*").replace(/\*/g,"[^\\/]+").replace(/((?!\\))\?/g,"$1.")+"$";return n="^"+n+"$",null!==t.match(new RegExp(n,"i"))}return e.component("uploadSelect",{init:function(){var e=this;this.on("change",function(){t(e.element[0].files,e.options);var n=e.element.clone(!0).data("uploadSelect",e);e.element.replaceWith(n),e.element=n})}}),e.component("uploadDrop",{defaults:{dragoverClass:"uk-dragover"},init:function(){var e=this,n=!1;this.on("drop",function(n){n.dataTransfer&&n.dataTransfer.files&&(n.stopPropagation(),n.preventDefault(),e.element.removeClass(e.options.dragoverClass),e.element.trigger("dropped.uk.upload",[n.dataTransfer.files]),t(n.dataTransfer.files,e.options))}).on("dragenter",function(e){e.stopPropagation(),e.preventDefault()}).on("dragover",function(t){t.stopPropagation(),t.preventDefault(),n||(e.element.addClass(e.options.dragoverClass),n=!0)}).on("dragleave",function(t){t.stopPropagation(),t.preventDefault(),e.element.removeClass(e.options.dragoverClass),n=!1})}}),e.support.ajaxupload=function(){function e(){var e=document.createElement("INPUT");return e.type="file","files"in e}function t(){var e=new XMLHttpRequest;return!!(e&&"upload"in e&&"onprogress"in e.upload)}function n(){return!!window.FormData}return e()&&t()&&n()}(),e.support.ajaxupload&&e.$.event.props.push("dataTransfer"),t.defaults={action:"",single:!0,method:"POST",param:"files[]",params:{},allow:"*.*",type:"text",filelimit:!1,before:function(){},beforeSend:function(){},beforeAll:function(){},loadstart:function(){},load:function(){},loadend:function(){},error:function(){},abort:function(){},progress:function(){},complete:function(){},allcomplete:function(){},readystatechange:function(){},notallowed:function(e,t){alert("Only the following file types are allowed: "+t.allow)}},e.Utils.xhrupload=t,t});
|
||||
/*! UIkit 2.25.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
!function(e){var t;window.UIkit&&(t=e(UIkit)),"function"==typeof define&&define.amd&&define("uikit-upload",["uikit"],function(){return t||e(UIkit)})}(function(e){"use strict";function t(o,a){function r(t,n){var o=new FormData,a=new XMLHttpRequest;if(n.before(n,t)!==!1){for(var r,i=0;r=t[i];i++)o.append(n.param,r);for(var l in n.params)o.append(l,n.params[l]);a.upload.addEventListener("progress",function(e){var t=e.loaded/e.total*100;n.progress(t,e)},!1),a.addEventListener("loadstart",function(e){n.loadstart(e)},!1),a.addEventListener("load",function(e){n.load(e)},!1),a.addEventListener("loadend",function(e){n.loadend(e)},!1),a.addEventListener("error",function(e){n.error(e)},!1),a.addEventListener("abort",function(e){n.abort(e)},!1),a.open(n.method,n.action,!0),"json"==n.type&&a.setRequestHeader("Accept","application/json"),a.onreadystatechange=function(){if(n.readystatechange(a),4==a.readyState){var t=a.responseText;if("json"==n.type)try{t=e.$.parseJSON(t)}catch(o){t=!1}n.complete(t,a)}},n.beforeSend(a),a.send(o)}}if(!e.support.ajaxupload)return this;if(a=e.$.extend({},t.defaults,a),o.length){if("*.*"!==a.allow)for(var i,l=0;i=o[l];l++)if(!n(a.allow,i.name))return"string"==typeof a.notallowed?alert(a.notallowed):a.notallowed(i,a),void 0;var s=a.complete;if(a.single){var d=o.length,f=0,p=!0;a.beforeAll(o),a.complete=function(e,t){f+=1,s(e,t),a.filelimit&&f>=a.filelimit&&(p=!1),p&&d>f?r([o[f]],a):a.allcomplete(e,t)},r([o[0]],a)}else a.complete=function(e,t){s(e,t),a.allcomplete(e,t)},r(o,a)}}function n(e,t){var n="^"+e.replace(/\//g,"\\/").replace(/\*\*/g,"(\\/[^\\/]+)*").replace(/\*/g,"[^\\/]+").replace(/((?!\\))\?/g,"$1.")+"$";return n="^"+n+"$",null!==t.match(new RegExp(n,"i"))}return e.component("uploadSelect",{init:function(){var e=this;this.on("change",function(){t(e.element[0].files,e.options);var n=e.element.clone(!0).data("uploadSelect",e);e.element.replaceWith(n),e.element=n})}}),e.component("uploadDrop",{defaults:{dragoverClass:"uk-dragover"},init:function(){var e=this,n=!1;this.on("drop",function(n){n.dataTransfer&&n.dataTransfer.files&&(n.stopPropagation(),n.preventDefault(),e.element.removeClass(e.options.dragoverClass),e.element.trigger("dropped.uk.upload",[n.dataTransfer.files]),t(n.dataTransfer.files,e.options))}).on("dragenter",function(e){e.stopPropagation(),e.preventDefault()}).on("dragover",function(t){t.stopPropagation(),t.preventDefault(),n||(e.element.addClass(e.options.dragoverClass),n=!0)}).on("dragleave",function(t){t.stopPropagation(),t.preventDefault(),e.element.removeClass(e.options.dragoverClass),n=!1})}}),e.support.ajaxupload=function(){function e(){var e=document.createElement("INPUT");return e.type="file","files"in e}function t(){var e=new XMLHttpRequest;return!!(e&&"upload"in e&&"onprogress"in e.upload)}function n(){return!!window.FormData}return e()&&t()&&n()}(),e.support.ajaxupload&&e.$.event.props.push("dataTransfer"),t.defaults={action:"",single:!0,method:"POST",param:"files[]",params:{},allow:"*.*",type:"text",filelimit:!1,before:function(){},beforeSend:function(){},beforeAll:function(){},loadstart:function(){},load:function(){},loadend:function(){},error:function(){},abort:function(){},progress:function(){},complete:function(){},allcomplete:function(){},readystatechange:function(){},notallowed:function(e,t){alert("Only the following file types are allowed: "+t.allow)}},e.Utils.xhrupload=t,t});
|
Reference in New Issue
Block a user