diff --git a/lib/recorder.js b/lib/recorder.js new file mode 100644 index 0000000..504bc60 --- /dev/null +++ b/lib/recorder.js @@ -0,0 +1,120 @@ +//start recording and share a list when required +var zlib = require('zlib'), + Datastore = require('nedb'), + util = require("util"), + events = require('events'), + db = new Datastore(); //in-memory store + +function Recorder(){ + var self = this, + id = 1; + + self.recordBodyMap = []; // id - body + + self.updateRecord = function(id,info){ + if(id < 0 ) return; + + var finalInfo = normalizeInfo(id,info); + + db.update({_id:id},finalInfo); + self.updateRecordBody(id,info); + + self.emit("update",finalInfo); + }; + + + self.appendRecord = function(info){ + if(info.req.headers.anyproxy_web_req){ //request from web interface + return -1; + } + + var thisId = id++, + finalInfo = normalizeInfo(thisId,info); + db.insert(finalInfo); + self.updateRecordBody(id,info); + + self.emit("update",finalInfo); + return thisId; + }; + + + //update recordBody if exits + self.updateRecordBody =function(id,info){ + if(id == -1) return; + + if(!id || !info.resBody) return; + //add to body map + //do not save image data + if(/image/.test(info.res.headers['content-type'])){ + self.recordBodyMap[id] = "(image)"; + }else if(/gzip/.test(info.res.headers['content-encoding'])){ + zlib.unzip(info.resBody,function(err,buffer){ + if(err){ + self.recordBodyMap[id] = "(err when unzip response buffer)"; + }else{ + self.recordBodyMap[id] = buffer.toString(); + } + }); + }else{ + self.recordBodyMap[id] = info.resBody.toString(); + } + }; + + + self.getBody = function(id){ + if(id < 0){ + return ""; + } + + return self.recordBodyMap[id] || ""; + }; + + self.getSummaryList = function(cb){ + db.find({},cb); + }; +} + +util.inherits(Recorder, events.EventEmitter); + +function normalizeInfo(id,info){ + var singleRecord = {}; + + //general + singleRecord._id = id; + singleRecord.id = id; + singleRecord.url = info.url; + singleRecord.host = info.host; + singleRecord.path = info.path; + singleRecord.method = info.method; + + //req + singleRecord.reqHeader = info.req.headers; + singleRecord.startTime = info.startTime; + + //res + if(info.res){ + singleRecord.statusCode= info.res.statusCode; + singleRecord.endTime = info.endTime; + singleRecord.resHeader = info.res.headers; + singleRecord.length = info.length; + if(info.res.headers['content-type']){ + singleRecord.mime = info.res.headers['content-type'].split(";")[0]; + }else{ + singleRecord.mime = ""; + } + + singleRecord.duration = info.endTime - info.startTime; + }else{ + singleRecord.statusCode= ""; + singleRecord.endTime = ""; + singleRecord.resHeader = ""; + singleRecord.length = ""; + singleRecord.mime = ""; + singleRecord.duration = ""; + } + + + return singleRecord; +} + +module.exports = Recorder; \ No newline at end of file diff --git a/lib/requestHandler.js b/lib/requestHandler.js index 211798d..2906b11 100644 --- a/lib/requestHandler.js +++ b/lib/requestHandler.js @@ -29,10 +29,24 @@ var handleRule = { function userRequestHandler(req,userRes){ var host = req.headers.host, - urlPattern = url.parse(req.url), - path = urlPattern.path, + urlPattern = url.parse(req.url), + path = urlPattern.path, ifLocalruleMatched = false, - callback = null; + callback = null, + ifHttps = !!req.connection.encrypted && !/http:/.test(req.url), + resourceInfo = {}, + resourceInfoId = -1; + + resourceInfo.host = host; + resourceInfo.method = req.method; + resourceInfo.path = path; + resourceInfo.url = (ifHttps ? "https://" :"http://") + host + path; + resourceInfo.req = req; + resourceInfo.startTime = new Date().getTime(); + + try{ + resourceInfoId = GLOBAL.recorder.appendRecord(resourceInfo); + }catch(e){} console.log(color.green("\nreceived request to : " + host + path)); /* @@ -41,6 +55,7 @@ function userRequestHandler(req,userRes){ in https server : /work/alibaba */ + //handle OPTIONS request if(req.method == "OPTIONS"){ console.log("==>OPTIONS req for CROS, will allow all"); userRes.writeHead(200,mergeCORSHeader(req.headers)); //remove any cache related header, add crossdomain headers @@ -83,8 +98,6 @@ function userRequestHandler(req,userRes){ } } - - //sleep for seconds if configed in the rule file //see rule_sample.js if(hostTest && pathTest && !!rule.sleep){ @@ -102,7 +115,6 @@ function userRequestHandler(req,userRes){ }else{ console.log("==>will forward to real server by proxy"); - var ifHttps = !!req.connection.encrypted && !/http:/.test(req.url); var options = { hostname : urlPattern.hostname || req.headers.host, @@ -114,17 +126,31 @@ function userRequestHandler(req,userRes){ var proxyReq = (ifHttps ? https : http).request(options, function(res) { userRes.writeHead(res.statusCode,mergeCORSHeader(req.headers,res.headers)); - if(callback){ - res.on('data',function(chunk){ - userRes.write(chunk); - }); - res.on('end',function(){ - callback(userRes); - userRes.end(); - }); - }else{ - res.pipe(userRes); - } + + var resData = [], + length = 0; + res.on("data",function(chunk){ + resData.push(chunk); + length += chunk.length; + userRes.write(chunk); + }); + + res.on("end",function(){ + callback && callback.call(null,userRes); + userRes.end(); + + //update record info + resourceInfo.endTime = new Date().getTime(); + resourceInfo.res = res; + resourceInfo.resBody = Buffer.concat(resData); + resourceInfo.length = length; + + try{ + GLOBAL.recorder.updateRecord(resourceInfoId,resourceInfo); + }catch(e){} + + }); + }); proxyReq.on("error",function(e){ diff --git a/package.json b/package.json index 32610c7..9ac9412 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,11 @@ "async-task-mgr": "^1.0.1", "colorful": "^2.1.0", "commander": "~2.3.0", - "sleep": "~1.1.8" + "entities": "^1.1.1", + "express": "^4.8.5", + "nedb": "^0.11.0", + "sleep": "~1.1.8", + "ws": "^0.4.32" }, "devDependencies": { "tunnel": "0.0.3" diff --git a/proxy.js b/proxy.js index 9e74f4a..8775137 100644 --- a/proxy.js +++ b/proxy.js @@ -1,21 +1,27 @@ var http = require('http'), https = require('https'), fs = require('fs'), - net = require('net'), async = require("async"), url = require('url'), - exec = require('child_process').exec, program = require('commander'), color = require('colorful'), certMgr = require("./lib/certMgr"), getPort = require("./lib/getPort"), - requestHandler = require("./lib/requestHandler"); + requestHandler = require("./lib/requestHandler"), + Recorder = require("./lib/Recorder"), + entities = require("entities"), + express = require("express"), + WebSocketServer= require('ws').Server; + +GLOBAL.recorder = new Recorder(); var T_TYPE_HTTP = 0, - T_TYPE_HTTPS = 1, - DEFAULT_PORT = 8001, - DEFAULT_HOST = "localhost", - DEFAULT_TYPE = T_TYPE_HTTP; + T_TYPE_HTTPS = 1, + DEFAULT_PORT = 8001, + DEFAULT_WEB_PORT = 8002, + DEFAULT_WEBSOCKET_PORT = 8003, + DEFAULT_HOST = "localhost", + DEFAULT_TYPE = T_TYPE_HTTP; function proxyServer(type, port, hostname,ruleFile){ var self = this, @@ -29,6 +35,8 @@ function proxyServer(type, port, hostname,ruleFile){ console.log(color.green("server closed :" + proxyHost + ":" + proxyPort)); } + startWebServer(); + if(ruleFile){ if(fs.existsSync(ruleFile)){ try{ //for abs path @@ -88,6 +96,59 @@ function proxyServer(type, port, hostname,ruleFile){ } +function startWebServer(port){ + port = port || DEFAULT_WEB_PORT; + + //web interface + var app = express(); + app.use(function(req, res, next) { + res.setHeader("note", "THIS IS A REQUEST FROM ANYPROXY WEB INTERFACE"); + return next(); + }); + + app.get("/summary",function(req,res){ + GLOBAL.recorder.getSummaryList(function(err,docs){ + if(err){ + res.end(err.toString()); + }else{ + res.json(docs.slice(docs.length -500)); + } + }); + }); + + app.get("/body",function(req,res){ + var reqQuery = url.parse(req.url,true); + var id = reqQuery.query.id; + + res.setHeader("Content-Type","text/html"); + res.writeHead(200); + + var body = GLOBAL.recorder.getBody(id); + res.end(entities.encodeHTML(body)); + }); + + app.use(express.static(__dirname + '/web')); + + app.listen(port); + + var tipText = "web interface started at port " + port; + console.log(color.green(tipText)); + + + + //web socket interface + var wss = new WebSocketServer({port: DEFAULT_WEBSOCKET_PORT}); + wss.broadcast = function(data) { + for(var i in this.clients){ + this.clients[i].send(data); + } + }; + GLOBAL.recorder.on("update",function(data){ + wss.broadcast( JSON.stringify(data) ); + }); +} + + module.exports.proxyServer = proxyServer; module.exports.generateRootCA = certMgr.generateRootCA; module.exports.isRootCAFileExists = certMgr.isRootCAFileExists; \ No newline at end of file diff --git a/rule_sample.js b/rule_sample.js index 9bb2221..7470d01 100644 --- a/rule_sample.js +++ b/rule_sample.js @@ -23,7 +23,7 @@ var rules = { "sleep" :5//seconds },{ "host" :/./, - "path" :/(.*)\.html/, + "path" :/html/, "callback" :function(res){ //remoty.js will be inject into response via callback res.write(" + + + + \ No newline at end of file diff --git a/web/js/addons/autocomplete.js b/web/js/addons/autocomplete.js deleted file mode 100755 index 524fbcc..0000000 --- a/web/js/addons/autocomplete.js +++ /dev/null @@ -1,305 +0,0 @@ -/*! UIkit 2.9.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ - -(function(addon) { - - var component; - - if (jQuery && jQuery.UIkit) { - component = addon(jQuery, jQuery.UIkit); - } - - if (typeof define == "function" && define.amd) { - define("uikit-autocomplete", ["uikit"], function(){ - return component || addon(jQuery, jQuery.UIkit); - }); - } - -})(function($, UI){ - - UI.component('autocomplete', { - - defaults: { - minLength: 3, - param: 'search', - method: 'post', - delay: 300, - loadingClass: 'uk-loading', - flipDropdown: false, - skipClass: 'uk-skip', - hoverClass: 'uk-active', - source: null, - renderer: null, - - // template - - template: '' - }, - - visible : false, - value : null, - selected : null, - - init: function() { - - var $this = this, - select = false, - trigger = UI.Utils.debounce(function(e) { - if(select) { - return (select = false); - } - $this.handle(); - }, this.options.delay); - - - this.dropdown = this.find('.uk-dropdown'); - this.template = this.find('script[type="text/autocomplete"]').html(); - this.template = UI.Utils.template(this.template || this.options.template); - this.input = this.find("input:first").attr("autocomplete", "off"); - - if (!this.dropdown.length) { - this.dropdown = $('
').appendTo(this.element); - } - - if (this.options.flipDropdown) { - this.dropdown.addClass('uk-dropdown-flip'); - } - - this.input.on({ - "keydown": function(e) { - - if (e && e.which && !e.shiftKey) { - - switch (e.which) { - case 13: // enter - select = true; - - if ($this.selected) { - e.preventDefault(); - $this.select(); - } - break; - case 38: // up - e.preventDefault(); - $this.pick('prev', true); - break; - case 40: // down - e.preventDefault(); - $this.pick('next', true); - break; - case 27: - case 9: // esc, tab - $this.hide(); - break; - default: - break; - } - } - - }, - "keyup": trigger, - "blur": function(e) { - setTimeout(function() { $this.hide(); }, 200); - } - }); - - this.dropdown.on("click", ".uk-autocomplete-results > *", function(){ - $this.select(); - }); - - this.dropdown.on("mouseover", ".uk-autocomplete-results > *", function(){ - $this.pick($(this)); - }); - - this.triggercomplete = trigger; - }, - - handle: function() { - - var $this = this, old = this.value; - - this.value = this.input.val(); - - if (this.value.length < this.options.minLength) return this.hide(); - - if (this.value != old) { - $this.request(); - } - - return this; - }, - - pick: function(item, scrollinview) { - - var $this = this, - items = this.dropdown.find('.uk-autocomplete-results').children(':not(.'+this.options.skipClass+')'), - selected = false; - - if (typeof item !== "string" && !item.hasClass(this.options.skipClass)) { - selected = item; - } else if (item == 'next' || item == 'prev') { - - if (this.selected) { - var index = items.index(this.selected); - - if (item == 'next') { - selected = items.eq(index + 1 < items.length ? index + 1 : 0); - } else { - selected = items.eq(index - 1 < 0 ? items.length - 1 : index - 1); - } - - } else { - selected = items[(item == 'next') ? 'first' : 'last'](); - } - } - - if (selected && selected.length) { - this.selected = selected; - items.removeClass(this.options.hoverClass); - this.selected.addClass(this.options.hoverClass); - - // jump to selected if not in view - if (scrollinview) { - - var top = selected.position().top, - scrollTop = $this.dropdown.scrollTop(), - dpheight = $this.dropdown.height(); - - if (top > dpheight || top < 0) { - $this.dropdown.scrollTop(scrollTop + top); - } - } - } - }, - - select: function() { - - if(!this.selected) return; - - var data = this.selected.data(); - - this.trigger("autocomplete-select", [data, this]); - - if (data.value) { - this.input.val(data.value); - } - - this.hide(); - }, - - show: function() { - if (this.visible) return; - this.visible = true; - this.element.addClass("uk-open"); - return this; - }, - - hide: function() { - if (!this.visible) return; - this.visible = false; - this.element.removeClass("uk-open"); - return this; - }, - - request: function() { - - var $this = this, - release = function(data) { - - if(data) { - $this.render(data); - } - - $this.element.removeClass($this.options.loadingClass); - }; - - this.element.addClass(this.options.loadingClass); - - if (this.options.source) { - - var source = this.options.source; - - switch(typeof(this.options.source)) { - case 'function': - - this.options.source.apply(this, [release]); - - break; - - case 'object': - - if(source.length) { - - var items = []; - - source.forEach(function(item){ - if(item.value && item.value.toLowerCase().indexOf($this.value.toLowerCase())!=-1) { - items.push(item); - } - }); - - release(items); - } - - break; - - case 'string': - - var params ={}; - - params[this.options.param] = this.value; - - $.ajax({ - url: this.options.source, - data: params, - type: this.options.method, - dataType: 'json' - }).done(function(json) { - release(json || []); - }); - - break; - - default: - release(null); - } - - } else { - this.element.removeClass($this.options.loadingClass); - } - }, - - render: function(data) { - - var $this = this; - - this.dropdown.empty(); - - this.selected = false; - - if (this.options.renderer) { - - this.options.renderer.apply(this, [data]); - - } else if(data && data.length) { - - this.dropdown.append(this.template({"items":data})); - this.show(); - - this.trigger('autocomplete-show'); - } - - return this; - } - }); - - // init code - UI.$doc.on("focus.autocomplete.uikit", "[data-uk-autocomplete]", function(e) { - - var ele = $(this); - if (!ele.data("autocomplete")) { - var obj = UI.autocomplete(ele, UI.Utils.options(ele.attr("data-uk-autocomplete"))); - } - }); - - return UI.autocomplete; -}); \ No newline at end of file diff --git a/web/js/addons/autocomplete.min.js b/web/js/addons/autocomplete.min.js deleted file mode 100755 index 9ba425f..0000000 --- a/web/js/addons/autocomplete.min.js +++ /dev/null @@ -1,3 +0,0 @@ -/*! UIkit 2.9.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ - -!function(a){var b;jQuery&&jQuery.UIkit&&(b=a(jQuery,jQuery.UIkit)),"function"==typeof define&&define.amd&&define("uikit-autocomplete",["uikit"],function(){return b||a(jQuery,jQuery.UIkit)})}(function(a,b){return b.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:''},visible:!1,value:null,selected:null,init:function(){var c=this,d=!1,e=b.Utils.debounce(function(){return d?d=!1:void c.handle()},this.options.delay);this.dropdown=this.find(".uk-dropdown"),this.template=this.find('script[type="text/autocomplete"]').html(),this.template=b.Utils.template(this.template||this.options.template),this.input=this.find("input:first").attr("autocomplete","off"),this.dropdown.length||(this.dropdown=a('
').appendTo(this.element)),this.options.flipDropdown&&this.dropdown.addClass("uk-dropdown-flip"),this.input.on({keydown:function(a){if(a&&a.which&&!a.shiftKey)switch(a.which){case 13:d=!0,c.selected&&(a.preventDefault(),c.select());break;case 38:a.preventDefault(),c.pick("prev",!0);break;case 40:a.preventDefault(),c.pick("next",!0);break;case 27:case 9:c.hide()}},keyup:e,blur:function(){setTimeout(function(){c.hide()},200)}}),this.dropdown.on("click",".uk-autocomplete-results > *",function(){c.select()}),this.dropdown.on("mouseover",".uk-autocomplete-results > *",function(){c.pick(a(this))}),this.triggercomplete=e},handle:function(){var a=this,b=this.value;return this.value=this.input.val(),this.value.lengthf-1?d.length-1:f-1)}else e=d["next"==a?"first":"last"]()}else e=a;if(e&&e.length&&(this.selected=e,d.removeClass(this.options.hoverClass),this.selected.addClass(this.options.hoverClass),b)){var g=e.position().top,h=c.dropdown.scrollTop(),i=c.dropdown.height();(g>i||0>g)&&c.dropdown.scrollTop(h+g)}},select:function(){if(this.selected){var a=this.selected.data();this.trigger("autocomplete-select",[a,this]),a.value&&this.input.val(a.value),this.hide()}},show:function(){return this.visible?void 0:(this.visible=!0,this.element.addClass("uk-open"),this)},hide:function(){return this.visible?(this.visible=!1,this.element.removeClass("uk-open"),this):void 0},request:function(){var b=this,c=function(a){a&&b.render(a),b.element.removeClass(b.options.loadingClass)};if(this.element.addClass(this.options.loadingClass),this.options.source){var d=this.options.source;switch(typeof this.options.source){case"function":this.options.source.apply(this,[c]);break;case"object":if(d.length){var e=[];d.forEach(function(a){a.value&&-1!=a.value.toLowerCase().indexOf(b.value.toLowerCase())&&e.push(a)}),c(e)}break;case"string":var f={};f[this.options.param]=this.value,a.ajax({url:this.options.source,data:f,type:this.options.method,dataType:"json"}).done(function(a){c(a||[])});break;default:c(null)}}else this.element.removeClass(b.options.loadingClass)},render:function(a){return this.dropdown.empty(),this.selected=!1,this.options.renderer?this.options.renderer.apply(this,[a]):a&&a.length&&(this.dropdown.append(this.template({items:a})),this.show(),this.trigger("autocomplete-show")),this}}),b.$doc.on("focus.autocomplete.uikit","[data-uk-autocomplete]",function(){var c=a(this);if(!c.data("autocomplete")){b.autocomplete(c,b.Utils.options(c.attr("data-uk-autocomplete")))}}),b.autocomplete}); \ No newline at end of file diff --git a/web/js/addons/cover.js b/web/js/addons/cover.js deleted file mode 100755 index b1dd679..0000000 --- a/web/js/addons/cover.js +++ /dev/null @@ -1,90 +0,0 @@ -/*! UIkit 2.9.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ - -(function(addon) { - - var component; - - if (jQuery && jQuery.UIkit) { - component = addon(jQuery, jQuery.UIkit); - } - - if (typeof define == "function" && define.amd) { - define("uikit-cover", ["uikit"], function(){ - return component || addon(jQuery, jQuery.UIkit); - }); - } - -})(function($, UI){ - - "use strict"; - - UI.component('cover', { - - defaults: { - automute : true - }, - - init: function() { - - this.parent = this.element.parent(); - this.dimension = {w: this.element.width(), h: this.element.height()}; - this.ratio = this.dimension.w / this.dimension.h; - - UI.$win.on('load resize orientationchange', UI.Utils.debounce(function(){ - this.check(); - }.bind(this), 100)); - - this.check(); - - this.element.data("cover", this); - - - if (this.element.is('iframe') && this.options.automute) { - - var src = this.element.attr('src'); - - this.element.attr('src', '').on('load', function(){ - - this.contentWindow.postMessage('{ "event": "command", "func": "mute", "method":"setVolume", "value":0}', '*'); - - }).attr('src', [src, (src.indexOf('?') > -1 ? '&':'?'), 'enablejsapi=1&api=1'].join('')); - } - }, - - check: function() { - - var w = this.parent.width(), h = this.parent.height(), width, height; - - // if element height < parent height (gap underneath) - if ((w / this.ratio) < h) { - - width = Math.ceil(h * this.ratio); - height = h; - - // element width < parent width (gap to right) - } else { - - width = w; - height = Math.ceil(w / this.ratio); - } - - this.element.css({ - 'width' : width, - 'height' : height - }); - } - }); - - // auto init - UI.ready(function(context) { - - $("[data-uk-cover]", context).each(function(){ - - var ele = $(this); - - if(!ele.data("cover")) { - var plugin = UI.cover(ele, UI.Utils.options(ele.attr("data-uk-cover"))); - } - }); - }); -}); \ No newline at end of file diff --git a/web/js/addons/cover.min.js b/web/js/addons/cover.min.js deleted file mode 100755 index bf94683..0000000 --- a/web/js/addons/cover.min.js +++ /dev/null @@ -1,3 +0,0 @@ -/*! UIkit 2.9.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ - -!function(a){var b;jQuery&&jQuery.UIkit&&(b=a(jQuery,jQuery.UIkit)),"function"==typeof define&&define.amd&&define("uikit-cover",["uikit"],function(){return b||a(jQuery,jQuery.UIkit)})}(function(a,b){"use strict";b.component("cover",{defaults:{automute:!0},init:function(){if(this.parent=this.element.parent(),this.dimension={w:this.element.width(),h:this.element.height()},this.ratio=this.dimension.w/this.dimension.h,b.$win.on("load resize orientationchange",b.Utils.debounce(function(){this.check()}.bind(this),100)),this.check(),this.element.data("cover",this),this.element.is("iframe")&&this.options.automute){var a=this.element.attr("src");this.element.attr("src","").on("load",function(){this.contentWindow.postMessage('{ "event": "command", "func": "mute", "method":"setVolume", "value":0}',"*")}).attr("src",[a,a.indexOf("?")>-1?"&":"?","enablejsapi=1&api=1"].join(""))}},check:function(){var a,b,c=this.parent.width(),d=this.parent.height();c/this.ratio'+opts.i18n.months[i]+''); - } else { - options.push(''); - } - } - - months = ''+ opts.i18n.months[data.month] + ''; - - // -- - - options = []; - - minYear = minDate ? minDate.year() : currentyear - 50; - maxYear = maxDate ? maxDate.year() : currentyear + 20; - - for (i=minYear;i<=maxYear;i++) { - if (i == data.year) { - options.push(''); - } else { - options.push(''); - } - } - - years = ''+ data.year + ''; - - content += '
'+ months + ' ' + years +'
'; - - } else { - content += '
'+ opts.i18n.months[data.month] +' '+ data.year+'
'; - } - - content += ''; - - content += ''; - content += ''; - for(var i = 0; i < data.weekdays.length; i++) { - if (data.weekdays[i]) { - content += ''; - } - } - content += ''; - - content += ''; - for(var i = 0; i < data.days.length; i++) { - if (data.days[i] && data.days[i].length){ - content += ''; - for(var d = 0; d < data.days[i].length; d++) { - if (data.days[i][d]) { - var day = data.days[i][d], - cls = []; - - 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'); - - content += ''; - } - } - content += ''; - } - } - content += ''; - - content += '
'+data.weekdays[i]+'
'+day.day.format("D")+'
'; - - return content; - } - }, - - init: function() { - - var $this = this; - - this.current = this.element.val() ? moment(this.element.val(), this.options.format) : moment(); - - this.on("click", function(){ - if(active!==$this) $this.pick(this.value); - }).on("change", function(){ - - if($this.element.val() && !moment($this.element.val(), $this.options.format).isValid()) { - $this.element.val(moment().format($this.options.format)); - } - - }); - - // init dropdown - if (!dropdown) { - - dropdown = $('
'); - - dropdown.on("click", ".uk-datepicker-next, .uk-datepicker-previous, [data-date]", function(e){ - e.stopPropagation(); - e.preventDefault(); - - var ele = $(this); - - 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; - } else { - active.add("months", 1 * (ele.hasClass("uk-datepicker-next") ? 1:-1)); - } - }); - - dropdown.on('change', '.update-picker-month, .update-picker-year', function(){ - - var select = $(this); - active[select.is('.update-picker-year') ? 'setYear':'setMonth'](Number(select.val())); - }); - - dropdown.appendTo("body"); - } - }, - - pick: function(initdate) { - - var offset = this.element.offset(), - css = {"top": offset.top + this.element.outerHeight() + this.options.offsettop, "left": offset.left, "right":""}; - - this.current = initdate ? moment(initdate, this.options.format):moment(); - this.initdate = this.current.format("YYYY-MM-DD"); - - this.update(); - - if ($.UIkit.langdirection == 'right') { - css.right = window.innerWidth - (css.left + this.element.outerWidth()); - css.left = ""; - } - - dropdown.css(css).show(); - - active = this; - }, - - add: function(unit, value) { - this.current.add(unit, value); - this.update(); - }, - - setMonth: function(month) { - this.current.month(month); - this.update(); - }, - - setYear: function(year) { - this.current.year(year); - this.update(); - }, - - update: function() { - - var data = this.getRows(this.current.year(), this.current.month()), - tpl = this.options.template(data, this.options); - - dropdown.html(tpl); - }, - - getRows: function(year, month) { - - 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":[]}, - row = []; - - data.weekdays = (function(){ - - for (var i=0, arr=[]; i < 7; i++) { - - var day = i + (opts.weekstart || 0); - - while (day >= 7) { - day -= 7; - } - - arr.push(opts.i18n.weekdays[day]); - } - - return arr; - })(); - - if (opts.weekstart && opts.weekstart > 0) { - before -= opts.weekstart; - if (before < 0) { - before += 7; - } - } - - var cells = days + before, after = cells; - - while(after > 7) { after -= 7; } - - cells += 7 - after; - - var day, isDisabled, isSelected, isToday, isInMonth; - - 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); - isInMonth = !(i < before || i >= (days + before)); - - day = moment(day); - - isSelected = this.initdate == day.format("YYYY-MM-DD"); - isToday = now == day.format("YYYY-MM-DD"); - - row.push({"selected": isSelected, "today": isToday, "disabled": isDisabled, "day":day, "inmonth":isInMonth}); - - if (++r === 7) { - data.days.push(row); - row = []; - r = 0; - } - } - - return data; - }, - - hide: function() { - - if (active && active === this) { - dropdown.hide(); - active = false; - } - } - }); - - UI.$win.on("resize orientationchange", function() { - - if (active) { - active.hide(); - } - }); - - - // init code - UI.$doc.on("focus.datepicker.uikit", "[data-uk-datepicker]", function(e) { - - var ele = $(this); - if (!ele.data("datepicker")) { - e.preventDefault(); - var obj = UI.datepicker(ele, UI.Utils.options(ele.attr("data-uk-datepicker"))); - ele.trigger("focus"); - } - }); - - UI.$doc.on("click.datepicker.uikit", function(e) { - - var target = $(e.target); - - if (active && target[0] != dropdown[0] && !target.data("datepicker") && !target.parents(".uk-datepicker:first").length) { - active.hide(); - } - }); - - //! moment.js - //! version : 2.5.1 - //! authors : Tim Wood, Iskren Chernev, Moment.js contributors - //! license : MIT - //! momentjs.com - - moment = (function(B){function G(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1}}function Z(a,b){return function(c){return l(a.call(this,c),b)}}function ta(a,b){return function(c){return this.lang().ordinal(a.call(this,c),b)}}function $(){}function H(a){aa(a);v(this,a)}function I(a){a=ba(a);var b=a.year||0,c=a.month||0,d=a.week||0,f=a.day||0;this._milliseconds=+(a.millisecond||0)+1E3*(a.second||0)+6E4*(a.minute|| - 0)+36E5*(a.hour||0);this._days=+f+7*d;this._months=+c+12*b;this._data={};this._bubble()}function v(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c]);b.hasOwnProperty("toString")&&(a.toString=b.toString);b.hasOwnProperty("valueOf")&&(a.valueOf=b.valueOf);return a}function w(a){return 0>a?Math.ceil(a):Math.floor(a)}function l(a,b,c){for(var d=""+Math.abs(a);d.lengtha._a[x]||11a._a[q]||a._a[q]>L(a._a[r],a._a[x])?q:0>a._a[p]||23a._a[y]||59a._a[D]||59a._a[E]||999q)&&(b=q),a._pf.overflow=b)}function ea(a){null==a._isValid&&(a._isValid=!isNaN(a._d.getTime())&&0>a._pf.overflow&&!a._pf.empty&&!a._pf.invalidMonth&& - !a._pf.nullInput&&!a._pf.invalidFormat&&!a._pf.userInvalidated,a._strict&&(a._isValid=a._isValid&&0===a._pf.charsLeftOver&&0===a._pf.unusedTokens.length));return a._isValid}function N(a){return a?a.toLowerCase().replace("_","-"):a}function O(a,b){return b._isUTC?e(a).zone(b._offset||0):e(a).local()}function s(a){var b=0,c,d,f,g,m=function(a){if(!z[a]&&xa)try{require("./lang/"+a)}catch(b){}return z[a]};if(!a)return e.fn._lang;if(!K(a)){if(d=m(a))return d;a=[a]}for(;b=c&&ca(g,f,!0)>=c-1)break;c--}b++}return e.fn._lang}function ya(a){return a.match(/\[[\s\S]/)?a.replace(/^\[|\]$/g,""):a.replace(/\\/g,"")}function za(a){var b=a.match(fa),c,d;c=0;for(d=b.length;cb.length?68(M(b)?366:365)&&(a._pf._overflowDayOfYear=!0),b=T(b,0,a._dayOfYear),a._a[x]=b.getUTCMonth(),a._a[q]=b.getUTCDate());for(b=0;3>b&&null==a._a[b];++b)a._a[b]=c[b]=d[b];for(;7>b;b++)a._a[b]=c[b]=null==a._a[b]?2===b?1:0:a._a[b];c[p]+=h((a._tzm||0)/60);c[y]+=h((a._tzm||0)%60);a._d=(a._useUTC?T:Qa).apply(null,c)}} - function Pa(a){var b=new Date;return a._useUTC?[b.getUTCFullYear(),b.getUTCMonth(),b.getUTCDate()]:[b.getFullYear(),b.getMonth(),b.getDate()]}function U(a){a._a=[];a._pf.empty=!0;var b=s(a._l),c=""+a._i,d,f,g,e,k=c.length,l=0;f=ga(a._f,b).match(fa)||[];for(b=0;ba._a[p]&&(a._a[p]+=12);!1===a._isPm&&12===a._a[p]&&(a._a[p]=0);S(a);aa(a)}function Na(a){return a.replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(a,c,d,f,e){return c||d||f||e})}function Qa(a,b,c,d,f,e,h){b=new Date(a,b,c,d,f,e,h);1970>a&&b.setFullYear(a);return b}function T(a){var b=new Date(Date.UTC.apply(null,arguments));1970>a&&b.setUTCFullYear(a);return b}function ma(a,b){if("string"===typeof a)if(isNaN(a)){if(a=b.weekdaysParse(a),"number"!== - typeof a)return null}else a=parseInt(a,10);return a}function Ra(a,b,c,d,f){return f.relativeTime(b||1,!!c,a,d)}function C(a,b,c){b=c-b;c-=a.day();c>b&&(c-=7);cd?7:0)-(ea&&(a=-a,b="-");return b+l(h(a/60),2)+":"+l(h(a)%60,2)},ZZ:function(){var a=-this.zone(),b="+";0>a&&(a=-a,b="-"); - return b+l(h(a/60),2)+l(h(a)%60,2)},z:function(){return this.zoneAbbr()},zz:function(){return this.zoneName()},X:function(){return this.unix()},Q:function(){return this.quarter()}},sa=["months","monthsShort","weekdays","weekdaysShort","weekdaysMin"];qa.length;)k=qa.pop(),u[k+"o"]=ta(u[k],k);for(;ra.length;)k=ra.pop(),u[k+k]=Z(u[k],2);u.DDDD=Z(u.DDD,3);v($.prototype,{set:function(a){var b,c;for(c in a)b=a[c],"function"===typeof b?this[c]=b:this["_"+c]=b},_months:"January February March April May June July August September October November December".split(" "), - months:function(a){return this._months[a.month()]},_monthsShort:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),monthsShort:function(a){return this._monthsShort[a.month()]},monthsParse:function(a){var b,c;this._monthsParse||(this._monthsParse=[]);for(b=0;12>b;b++)if(this._monthsParse[b]||(c=e.utc([2E3,b]),c="^"+this.months(c,"")+"|^"+this.monthsShort(c,""),this._monthsParse[b]=RegExp(c.replace(".",""),"i")),this._monthsParse[b].test(a))return b},_weekdays:"Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "), - weekdays:function(a){return this._weekdays[a.day()]},_weekdaysShort:"Sun Mon Tue Wed Thu Fri Sat".split(" "),weekdaysShort:function(a){return this._weekdaysShort[a.day()]},_weekdaysMin:"Su Mo Tu We Th Fr Sa".split(" "),weekdaysMin:function(a){return this._weekdaysMin[a.day()]},weekdaysParse:function(a){var b,c;this._weekdaysParse||(this._weekdaysParse=[]);for(b=0;7>b;b++)if(this._weekdaysParse[b]||(c=e([2E3,1]).day(b),c="^"+this.weekdays(c,"")+"|^"+this.weekdaysShort(c,"")+"|^"+this.weekdaysMin(c, - ""),this._weekdaysParse[b]=RegExp(c.replace(".",""),"i")),this._weekdaysParse[b].test(a))return b},_longDateFormat:{LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D YYYY",LLL:"MMMM D YYYY LT",LLLL:"dddd, MMMM D YYYY LT"},longDateFormat:function(a){var b=this._longDateFormat[a];!b&&this._longDateFormat[a.toUpperCase()]&&(b=this._longDateFormat[a.toUpperCase()].replace(/MMMM|MM|DD|dddd/g,function(a){return a.slice(1)}),this._longDateFormat[a]=b);return b},isPM:function(a){return"p"===(a+"").toLowerCase().charAt(0)}, - _meridiemParse:/[ap]\.?m?\.?/i,meridiem:function(a,b,c){return 11=a.year()?P(a,"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]"):P(a,"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]")},toArray:function(){return[this.year(),this.month(),this.date(),this.hours(),this.minutes(),this.seconds(),this.milliseconds()]},isValid:function(){return ea(this)},isDSTShifted:function(){return this._a?this.isValid()&&0a?"sameElse":-1>a?"lastWeek":0>a?"lastDay":1>a?"sameDay":2>a?"nextDay":7>a?"nextWeek":"sameElse";return this.format(this.lang().calendar(a,this))},isLeapYear:function(){return M(this.year())},isDST:function(){return this.zone()+e(a).startOf(b)},isBefore:function(a,b){b="undefined"!==typeof b?b:"millisecond";return+this.clone().startOf(b)<+e(a).startOf(b)},isSame:function(a,b){b=b||"ms";return+this.clone().startOf(b)===+O(a,this).startOf(b)},min:function(a){a=e.apply(null, - arguments);return athis?this:a},zone:function(a,b){b=null==b?!0:!1;var c=this._offset||0;if(null!=a)"string"===typeof a&&(a=ka(a)),16>Math.abs(a)&&(a*=60),this._offset=a,this._isUTC=!0,c!==a&&b&&J(this,e.duration(c-a,"m"),1,!0);else return this._isUTC?c:this._d.getTimezoneOffset();return this},zoneAbbr:function(){return this._isUTC?"UTC":""},zoneName:function(){return this._isUTC?"Coordinated Universal Time":""},parseZone:function(){this._tzm? - this.zone(this._tzm):"string"===typeof this._i&&this.zone(this._i);return this},hasAlignedHourOffset:function(a){a=a?e(a).zone():0;return 0===(this.zone()-a)%60},daysInMonth:function(){return L(this.year(),this.month())},dayOfYear:function(a){var b=A((e(this).startOf("day")-e(this).startOf("year"))/864E5)+1;return null==a?b:this.add("d",a-b)},quarter:function(){return Math.ceil((this.month()+1)/3)},weekYear:function(a){var b=C(this,this.lang()._week.dow,this.lang()._week.doy).year;return null==a? - b:this.add("y",a-b)},isoWeekYear:function(a){var b=C(this,1,4).year;return null==a?b:this.add("y",a-b)},week:function(a){var b=this.lang().week(this);return null==a?b:this.add("d",7*(a-b))},isoWeek:function(a){var b=C(this,1,4).week;return null==a?b:this.add("d",7*(a-b))},weekday:function(a){var b=(this.day()+7-this.lang()._week.dow)%7;return null==a?b:this.add("d",a-b)},isoWeekday:function(a){return null==a?this.day()||7:this.day(this.day()%7?a:a-7)},isoWeeksInYear:function(){return da(this.year(), - 1,4)},weeksInYear:function(){var a=this._lang._week;return da(this.year(),a.dow,a.doy)},get:function(a){a=n(a);return this[a]()},set:function(a,b){a=n(a);if("function"===typeof this[a])this[a](b);return this},lang:function(a){if(a===B)return this._lang;this._lang=s(a);return this}});for(k=0;kf&&["s",f]||1===e&&["m"]||45>e&&["mm",e]||1===h&&["h"]||22>h&&["hh",h]||1===k&&["d"]||25>=k&&["dd",k]||45>=k&&["M"]||345>k&&["MM",A(k/30)]||1===l&&["y"]||["yy",l];f[2]=c;f[3]=0 - this.asSeconds()?"-":"")+"P"+(a?a+"Y":"")+(b?b+"M":"")+(c?c+"D":"")+(d||e||g?"T":"")+(d?d+"H":"")+(e?e+"M":"")+(g?g+"S":""):"P0D"}});for(k in Y)Y.hasOwnProperty(k)&&(pa(k,Y[k]),Va(k.toLowerCase()));pa("Weeks",6048E5);e.duration.fn.asMonths=function(){return(+this-31536E6*this.years())/2592E6+12*this.years()};e.lang("en",{ordinal:function(a){var b=a%10,b=1===h(a%100/10)?"th":1===b?"st":2===b?"nd":3===b?"rd":"th";return a+b}});return e}).call(this); - - UI.datepicker.moment = moment; - - return UI.datepicker; -}); \ No newline at end of file diff --git a/web/js/addons/datepicker.min.js b/web/js/addons/datepicker.min.js deleted file mode 100755 index 80e61c3..0000000 --- a/web/js/addons/datepicker.min.js +++ /dev/null @@ -1,3 +0,0 @@ -/*! UIkit 2.9.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ - -!function(a){var b;jQuery&&jQuery.UIkit&&(b=a(jQuery,jQuery.UIkit)),"function"==typeof define&&define.amd&&define("uikit-datepicker",["uikit"],function(){return b||a(jQuery,jQuery.UIkit)})}(function(a,b){var c,d,e=!1;return b.component("datepicker",{defaults:{weekstart:1,i18n:{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",offsettop:5,maxDate:!1,minDate:!1,template:function(a,c){var e,f,g="";if(c.maxDate!==!1&&(e=isNaN(c.maxDate)?d(c.maxDate,c.format):d().add("days",c.maxDate)),c.minDate!==!1&&(f=isNaN(c.minDate)?d(c.minDate,c.format):d().add("days",c.minDate-1)),g+='
',g+='',g+='',b.formSelect){var h,i,j,k,l,m=(new Date).getFullYear(),n=[];for(h=0;h'+c.i18n.months[h]+"":'");for(i=''+c.i18n.months[a.month]+'",n=[],k=f?f.year():m-50,l=e?e.year():m+20,h=k;l>=h;h++)n.push(h==a.year?'":'");j=''+a.year+'",g+='
'+i+" "+j+"
"}else g+='
'+c.i18n.months[a.month]+" "+a.year+"
";g+="
",g+='',g+="";for(var h=0;h"+a.weekdays[h]+"");g+="",g+="";for(var h=0;h";for(var o=0;oe&&q.push("uk-datepicker-date-disabled uk-datepicker-table-muted"),f&&f>p.day&&q.push("uk-datepicker-date-disabled uk-datepicker-table-muted"),g+='"}g+=""}return g+="",g+="
'+p.day.format("D")+"
"}},init:function(){var b=this;this.current=this.element.val()?d(this.element.val(),this.options.format):d(),this.on("click",function(){e!==b&&b.pick(this.value)}).on("change",function(){b.element.val()&&!d(b.element.val(),b.options.format).isValid()&&b.element.val(d().format(b.options.format))}),c||(c=a('
'),c.on("click",".uk-datepicker-next, .uk-datepicker-previous, [data-date]",function(b){b.stopPropagation(),b.preventDefault();var f=a(this);return f.hasClass("uk-datepicker-date-disabled")?!1:void(f.is("[data-date]")?(e.element.val(d(f.data("date")).format(e.options.format)).trigger("change"),c.hide(),e=!1):e.add("months",1*(f.hasClass("uk-datepicker-next")?1:-1)))}),c.on("change",".update-picker-month, .update-picker-year",function(){var b=a(this);e[b.is(".update-picker-year")?"setYear":"setMonth"](Number(b.val()))}),c.appendTo("body"))},pick:function(b){var f=this.element.offset(),g={top:f.top+this.element.outerHeight()+this.options.offsettop,left:f.left,right:""};this.current=b?d(b,this.options.format):d(),this.initdate=this.current.format("YYYY-MM-DD"),this.update(),"right"==a.UIkit.langdirection&&(g.right=window.innerWidth-(g.left+this.element.outerWidth()),g.left=""),c.css(g).show(),e=this},add:function(a,b){this.current.add(a,b),this.update()},setMonth:function(a){this.current.month(a),this.update()},setYear:function(a){this.current.year(a),this.update()},update:function(){var a=this.getRows(this.current.year(),this.current.month()),b=this.options.template(a,this.options);c.html(b)},getRows:function(a,b){var c=this.options,e=d().format("YYYY-MM-DD"),f=[31,a%4===0&&a%100!==0||a%400===0?29:28,31,30,31,30,31,31,30,31,30,31][b],g=new Date(a,b,1).getDay(),h={month:b,year:a,weekdays:[],days:[]},i=[];h.weekdays=function(){for(var a=0,b=[];7>a;a++){for(var d=a+(c.weekstart||0);d>=7;)d-=7;b.push(c.i18n.weekdays[d])}return b}(),c.weekstart&&c.weekstart>0&&(g-=c.weekstart,0>g&&(g+=7));for(var j=f+g,k=j;k>7;)k-=7;j+=7-k;for(var l,m,n,o,p,q=0,r=0;j>q;q++)l=new Date(a,b,1+(q-g)),m=c.mindate&&lc.maxdate,p=!(g>q||q>=f+g),l=d(l),n=this.initdate==l.format("YYYY-MM-DD"),o=e==l.format("YYYY-MM-DD"),i.push({selected:n,today:o,disabled:m,day:l,inmonth:p}),7===++r&&(h.days.push(i),i=[],r=0);return h},hide:function(){e&&e===this&&(c.hide(),e=!1)}}),b.$win.on("resize orientationchange",function(){e&&e.hide()}),b.$doc.on("focus.datepicker.uikit","[data-uk-datepicker]",function(c){var d=a(this);if(!d.data("datepicker")){c.preventDefault();{b.datepicker(d,b.Utils.options(d.attr("data-uk-datepicker")))}d.trigger("focus")}}),b.$doc.on("click.datepicker.uikit",function(b){var d=a(b.target);!e||d[0]==c[0]||d.data("datepicker")||d.parents(".uk-datepicker:first").length||e.hide()}),d=function(a){function b(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1}}function c(a,b){return function(c){return j(a.call(this,c),b)}}function d(a,b){return function(c){return this.lang().ordinal(a.call(this,c),b)}}function e(){}function f(a){u(a),h(this,a)}function g(a){a=o(a);var b=a.year||0,c=a.month||0,d=a.week||0,e=a.day||0;this._milliseconds=+(a.millisecond||0)+1e3*(a.second||0)+6e4*(a.minute||0)+36e5*(a.hour||0),this._days=+e+7*d,this._months=+c+12*b,this._data={},this._bubble()}function h(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c]);return b.hasOwnProperty("toString")&&(a.toString=b.toString),b.hasOwnProperty("valueOf")&&(a.valueOf=b.valueOf),a}function i(a){return 0>a?Math.ceil(a):Math.floor(a)}function j(a,b,c){for(var d=""+Math.abs(a);d.length=0?c?"+":"":"-")+d}function k(a,b,c,d){var e=b._milliseconds,f=b._days;b=b._months;var g,h;e&&a._d.setTime(+a._d+e*c),(f||b)&&(g=a.minute(),h=a.hour()),f&&a.date(a.date()+f*c),b&&a.month(a.month()+b*c),e&&!d&&T.updateOffset(a,f||b),(f||b)&&(a.minute(g),a.hour(h))}function l(a){return"[object Array]"===Object.prototype.toString.call(a)}function m(a,b,c){var d,e=Math.min(a.length,b.length),f=Math.abs(a.length-b.length),g=0;for(d=0;e>d;d++)(c&&a[d]!==b[d]||!c&&q(a[d])!==q(b[d]))&&g++;return g+f}function n(a){if(a){var b=a.toLowerCase().replace(/(.)s$/,"$1");a=Fb[a]||Gb[b]||b}return a}function o(a){var b,c,d={};for(c in a)a.hasOwnProperty(c)&&(b=n(c))&&(d[b]=a[c]);return d}function p(b){var c,d;if(0===b.indexOf("week"))c=7,d="day";else{if(0!==b.indexOf("month"))return;c=12,d="month"}T[b]=function(e,f){var g,h,i=T.fn._lang[b],j=[];if("number"==typeof e&&(f=e,e=a),h=function(a){return a=T().utc().set(d,a),i.call(T.fn._lang,a,e||"")},null!=f)return h(f);for(g=0;c>g;g++)j.push(h(g));return j}}function q(a){a=+a;var b=0;return 0!==a&&isFinite(a)&&(b=a>=0?Math.floor(a):Math.ceil(a)),b}function r(a,b){return new Date(Date.UTC(a,b+1,0)).getUTCDate()}function s(a,b,c){return N(T([a,11,31+b-c]),b,c).week}function t(a){return 0===a%4&&0!==a%100||0===a%400}function u(a){var b;a._a&&-2===a._pf.overflow&&(b=0>a._a[X]||11a._a[Y]||a._a[Y]>r(a._a[W],a._a[X])?Y:0>a._a[Z]||23a._a[$]||59a._a[_]||59a._a[ab]||999b||b>Y)&&(b=Y),a._pf.overflow=b)}function v(a){return null==a._isValid&&(a._isValid=!isNaN(a._d.getTime())&&0>a._pf.overflow&&!a._pf.empty&&!a._pf.invalidMonth&&!a._pf.nullInput&&!a._pf.invalidFormat&&!a._pf.userInvalidated,a._strict&&(a._isValid=a._isValid&&0===a._pf.charsLeftOver&&0===a._pf.unusedTokens.length)),a._isValid}function w(a){return a?a.toLowerCase().replace("_","-"):a}function x(a,b){return b._isUTC?T(a).zone(b._offset||0):T(a).local()}function y(a){var b,c,d,e,f=0,g=function(a){if(!bb[a]&&db)try{require("./lang/"+a)}catch(b){}return bb[a]};if(!a)return T.fn._lang;if(!l(a)){if(c=g(a))return c;a=[a]}for(;f0;){if(c=g(e.slice(0,b).join("-")))return c;if(d&&d.length>=b&&m(e,d,!0)>=b-1)break;b--}f++}return T.fn._lang}function z(a){return a.match(/\[[\s\S]/)?a.replace(/^\[|\]$/g,""):a.replace(/\\/g,"")}function A(a){var b,c,d=a.match(hb);for(b=0,c=d.length;c>b;b++)d[b]=Kb[d[b]]?Kb[d[b]]:z(d[b]);return function(e){var f="";for(b=0;c>b;b++)f+=d[b]instanceof Function?d[b].call(e,a):d[b];return f}}function B(a,b){return a.isValid()?(b=C(b,a.lang()),Hb[b]||(Hb[b]=A(b)),Hb[b](a)):a.lang().invalidDate()}function C(a,b){function c(a){return b.longDateFormat(a)||a}var d=5;for(ib.lastIndex=0;d>=0&&ib.test(a);)a=a.replace(ib,c),ib.lastIndex=0,d-=1;return a}function D(a,b){var c=b._strict;switch(a){case"DDDD":return vb;case"YYYY":case"GGGG":case"gggg":return c?wb:lb;case"Y":case"G":case"g":return yb;case"YYYYYY":case"YYYYY":case"GGGGG":case"ggggg":return c?xb:mb;case"S":if(c)return tb;case"SS":if(c)return ub;case"SSS":if(c)return vb;case"DDD":return kb;case"MMM":case"MMMM":case"dd":case"ddd":case"dddd":return ob;case"a":case"A":return y(b._l)._meridiemParse;case"X":return rb;case"Z":case"ZZ":return pb;case"T":return qb;case"SSSS":return nb;case"MM":case"DD":case"YY":case"GG":case"gg":case"HH":case"hh":case"mm":case"ss":case"ww":case"WW":return c?ub:jb;case"M":case"D":case"d":case"H":case"h":case"m":case"s":case"w":case"W":case"e":case"E":return jb;case"Do":return sb;default:var d,c=RegExp;return d=I(a.replace("\\","")).replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"),new c(d)}}function E(a){a=(a||"").match(pb)||[],a=((a[a.length-1]||[])+"").match(Cb)||["-",0,0];var b=+(60*a[1])+q(a[2]);return"+"===a[0]?-b:b}function F(a){var b,c,d,e,f,g,h=[];if(!a._d){for(c=G(a),a._w&&null==a._a[Y]&&null==a._a[X]&&(b=function(b){var c=parseInt(b,10);return b?3>b.length?c>68?1900+c:2e3+c:c:null==a._a[W]?T().weekYear():a._a[W]},d=a._w,null!=d.GG||null!=d.W||null!=d.E?b=O(b(d.GG),d.W||1,d.E,4,1):(e=y(a._l),f=null!=d.d?L(d.d,e):null!=d.e?parseInt(d.e,10)+e._week.dow:0,g=parseInt(d.w,10)||1,null!=d.d&&f(t(b)?366:365)&&(a._pf._overflowDayOfYear=!0),b=K(b,0,a._dayOfYear),a._a[X]=b.getUTCMonth(),a._a[Y]=b.getUTCDate()),b=0;3>b&&null==a._a[b];++b)a._a[b]=h[b]=c[b];for(;7>b;b++)a._a[b]=h[b]=null==a._a[b]?2===b?1:0:a._a[b];h[Z]+=q((a._tzm||0)/60),h[$]+=q((a._tzm||0)%60),a._d=(a._useUTC?K:J).apply(null,h)}}function G(a){var b=new Date;return a._useUTC?[b.getUTCFullYear(),b.getUTCMonth(),b.getUTCDate()]:[b.getFullYear(),b.getMonth(),b.getDate()]}function H(a){a._a=[],a._pf.empty=!0;var b,c,d,e,f=y(a._l),g=""+a._i,h=g.length,i=0;for(c=C(a._f,f).match(hb)||[],f=0;fa._a[Z]&&(a._a[Z]+=12),!1===a._isPm&&12===a._a[Z]&&(a._a[Z]=0),F(a),u(a)}function I(a){return a.replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(a,b,c,d,e){return b||c||d||e})}function J(a,b,c,d,e,f,g){return b=new Date(a,b,c,d,e,f,g),1970>a&&b.setFullYear(a),b}function K(a){var b=new Date(Date.UTC.apply(null,arguments));return 1970>a&&b.setUTCFullYear(a),b}function L(a,b){if("string"==typeof a)if(isNaN(a)){if(a=b.weekdaysParse(a),"number"!=typeof a)return null}else a=parseInt(a,10);return a}function M(a,b,c,d,e){return e.relativeTime(b||1,!!c,a,d)}function N(a,b,c){return b=c-b,c-=a.day(),c>b&&(c-=7),b-7>c&&(c+=7),a=T(a).add("d",c),{week:Math.ceil(a.dayOfYear()/7),year:a.year()}}function O(a,b,c,d,e){var f=K(a,0,1).getUTCDay();return b=7*(b-1)+((null!=c?c:e)-e)+(e-f+(f>d?7:0)-(e>f?7:0))+1,{year:b>0?a:a-1,dayOfYear:b>0?b:(t(a-1)?366:365)+b}}function P(c){var d=c._i,e=c._f;if(null===d)return T.invalid({nullInput:!0});if("string"==typeof d&&(c._i=d=y().preparse(d)),T.isMoment(d)){c=d;var g,i={};for(g in c)c.hasOwnProperty(g)&&cb.hasOwnProperty(g)&&(i[g]=c[g]);c=i,c._d=new Date(+d._d)}else if(e)if(l(e)){var j,k,d=c;if(0===d._f.length)d._pf.invalidFormat=!0,d._d=new Date(0/0);else{for(g=0;ge)&&(k=e,j=i);h(d,j||i)}}else H(c);else if(i=c,j=i._i,k=eb.exec(j),j===a)i._d=new Date;else if(k)i._d=new Date(+k[1]);else if("string"==typeof j)if(d=i._i,g=zb.exec(d)){for(i._pf.iso=!0,j=0,k=Ab.length;k>j;j++)if(Ab[j][1].exec(d)){i._f=Ab[j][0]+(g[6]||" ");break}for(j=0,k=Bb.length;k>j;j++)if(Bb[j][1].exec(d)){i._f+=Bb[j][0];break}d.match(pb)&&(i._f+="Z"),H(i)}else i._d=new Date(d);else l(j)?(i._a=j.slice(0),F(i)):"[object Date]"===Object.prototype.toString.call(j)||j instanceof Date?i._d=new Date(+j):"object"==typeof j?i._d||(j=o(i._i),i._a=[j.year,j.month,j.day,j.hour,j.minute,j.second,j.millisecond],F(i)):i._d=new Date(j);return new f(c)}function Q(a,b){var c="date"===b||"month"===b||"year"===b;T.fn[a]=T.fn[a+"s"]=function(a,d){var e=this._isUTC?"UTC":"";return null==d&&(d=c),null!=a?(this._d["set"+e+b](a),T.updateOffset(this,d),this):this._d["get"+e+b]()}}function R(a){T.duration.fn[a]=function(){return this._data[a]}}function S(a,b){T.duration.fn["as"+a]=function(){return+this/b}}for(var T,U,V=Math.round,W=0,X=1,Y=2,Z=3,$=4,_=5,ab=6,bb={},cb={_isAMomentObject:null,_i:null,_f:null,_l:null,_strict:null,_isUTC:null,_offset:null,_pf:null,_lang:null},db="undefined"!=typeof module&&module.exports&&"undefined"!=typeof require,eb=/^\/?Date\((\-?\d+)/i,fb=/(\-)?(?:(\d*)\.)?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?)?/,gb=/^(-)?P(?:(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?|([0-9,.]*)W)$/,hb=/(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,4}|X|zz?|ZZ?|.)/g,ib=/(\[[^\[]*\])|(\\)?(LT|LL?L?L?|l{1,4})/g,jb=/\d\d?/,kb=/\d{1,3}/,lb=/\d{1,4}/,mb=/[+\-]?\d{1,6}/,nb=/\d+/,ob=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,pb=/Z|[\+\-]\d\d:?\d\d/gi,qb=/T/i,rb=/[\+\-]?\d+(\.\d{1,3})?/,sb=/\d{1,2}/,tb=/\d/,ub=/\d\d/,vb=/\d{3}/,wb=/\d{4}/,xb=/[+-]?\d{6}/,yb=/[+-]?\d+/,zb=/^\s*(?:[+-]\d{6}|\d{4})-(?:(\d\d-\d\d)|(W\d\d$)|(W\d\d-\d)|(\d\d\d))((T| )(\d\d(:\d\d(:\d\d(\.\d+)?)?)?)?([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Ab=[["YYYYYY-MM-DD",/[+-]\d{6}-\d{2}-\d{2}/],["YYYY-MM-DD",/\d{4}-\d{2}-\d{2}/],["GGGG-[W]WW-E",/\d{4}-W\d{2}-\d/],["GGGG-[W]WW",/\d{4}-W\d{2}/],["YYYY-DDD",/\d{4}-\d{3}/]],Bb=[["HH:mm:ss.SSSS",/(T| )\d\d:\d\d:\d\d\.\d{1,3}/],["HH:mm:ss",/(T| )\d\d:\d\d:\d\d/],["HH:mm",/(T| )\d\d:\d\d/],["HH",/(T| )\d\d/]],Cb=/([\+\-]|\d\d)/gi,Db=["Date","Hours","Minutes","Seconds","Milliseconds"],Eb={Milliseconds:1,Seconds:1e3,Minutes:6e4,Hours:36e5,Days:864e5,Months:2592e6,Years:31536e6},Fb={ms:"millisecond",s:"second",m:"minute",h:"hour",d:"day",D:"date",w:"week",W:"isoWeek",M:"month",y:"year",DDD:"dayOfYear",e:"weekday",E:"isoWeekday",gg:"weekYear",GG:"isoWeekYear"},Gb={dayofyear:"dayOfYear",isoweekday:"isoWeekday",isoweek:"isoWeek",weekyear:"weekYear",isoweekyear:"isoWeekYear"},Hb={},Ib="DDD w W M D d".split(" "),Jb="MDHhmswW".split(""),Kb={M:function(){return this.month()+1},MMM:function(a){return this.lang().monthsShort(this,a)},MMMM:function(a){return this.lang().months(this,a)},D:function(){return this.date()},DDD:function(){return this.dayOfYear()},d:function(){return this.day()},dd:function(a){return this.lang().weekdaysMin(this,a)},ddd:function(a){return this.lang().weekdaysShort(this,a)},dddd:function(a){return this.lang().weekdays(this,a)},w:function(){return this.week()},W:function(){return this.isoWeek()},YY:function(){return j(this.year()%100,2)},YYYY:function(){return j(this.year(),4)},YYYYY:function(){return j(this.year(),5)},YYYYYY:function(){var a=this.year();return(a>=0?"+":"-")+j(Math.abs(a),6)},gg:function(){return j(this.weekYear()%100,2)},gggg:function(){return j(this.weekYear(),4)},ggggg:function(){return j(this.weekYear(),5)},GG:function(){return j(this.isoWeekYear()%100,2)},GGGG:function(){return j(this.isoWeekYear(),4)},GGGGG:function(){return j(this.isoWeekYear(),5)},e:function(){return this.weekday()},E:function(){return this.isoWeekday()},a:function(){return this.lang().meridiem(this.hours(),this.minutes(),!0)},A:function(){return this.lang().meridiem(this.hours(),this.minutes(),!1)},H:function(){return this.hours()},h:function(){return this.hours()%12||12},m:function(){return this.minutes()},s:function(){return this.seconds()},S:function(){return q(this.milliseconds()/100)},SS:function(){return j(q(this.milliseconds()/10),2)},SSS:function(){return j(this.milliseconds(),3)},SSSS:function(){return j(this.milliseconds(),3)},Z:function(){var a=-this.zone(),b="+";return 0>a&&(a=-a,b="-"),b+j(q(a/60),2)+":"+j(q(a)%60,2)},ZZ:function(){var a=-this.zone(),b="+";return 0>a&&(a=-a,b="-"),b+j(q(a/60),2)+j(q(a)%60,2)},z:function(){return this.zoneAbbr()},zz:function(){return this.zoneName()},X:function(){return this.unix()},Q:function(){return this.quarter()}},Lb=["months","monthsShort","weekdays","weekdaysShort","weekdaysMin"];Ib.length;)U=Ib.pop(),Kb[U+"o"]=d(Kb[U],U);for(;Jb.length;)U=Jb.pop(),Kb[U+U]=c(Kb[U],2);for(Kb.DDDD=c(Kb.DDD,3),h(e.prototype,{set:function(a){var b,c;for(c in a)b=a[c],"function"==typeof b?this[c]=b:this["_"+c]=b},_months:"January February March April May June July August September October November December".split(" "),months:function(a){return this._months[a.month()]},_monthsShort:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),monthsShort:function(a){return this._monthsShort[a.month()]},monthsParse:function(a){var b,c;for(this._monthsParse||(this._monthsParse=[]),b=0;12>b;b++)if(this._monthsParse[b]||(c=T.utc([2e3,b]),c="^"+this.months(c,"")+"|^"+this.monthsShort(c,""),this._monthsParse[b]=RegExp(c.replace(".",""),"i")),this._monthsParse[b].test(a))return b},_weekdays:"Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),weekdays:function(a){return this._weekdays[a.day()]},_weekdaysShort:"Sun Mon Tue Wed Thu Fri Sat".split(" "),weekdaysShort:function(a){return this._weekdaysShort[a.day()]},_weekdaysMin:"Su Mo Tu We Th Fr Sa".split(" "),weekdaysMin:function(a){return this._weekdaysMin[a.day()]},weekdaysParse:function(a){var b,c;for(this._weekdaysParse||(this._weekdaysParse=[]),b=0;7>b;b++)if(this._weekdaysParse[b]||(c=T([2e3,1]).day(b),c="^"+this.weekdays(c,"")+"|^"+this.weekdaysShort(c,"")+"|^"+this.weekdaysMin(c,""),this._weekdaysParse[b]=RegExp(c.replace(".",""),"i")),this._weekdaysParse[b].test(a))return b},_longDateFormat:{LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D YYYY",LLL:"MMMM D YYYY LT",LLLL:"dddd, MMMM D YYYY LT"},longDateFormat:function(a){var b=this._longDateFormat[a];return!b&&this._longDateFormat[a.toUpperCase()]&&(b=this._longDateFormat[a.toUpperCase()].replace(/MMMM|MM|DD|dddd/g,function(a){return a.slice(1)}),this._longDateFormat[a]=b),b},isPM:function(a){return"p"===(a+"").toLowerCase().charAt(0)},_meridiemParse:/[ap]\.?m?\.?/i,meridiem:function(a,b,c){return a>11?c?"pm":"PM":c?"am":"AM"},_calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},calendar:function(a,b){var c=this._calendar[a];return"function"==typeof c?c.apply(b):c},_relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},relativeTime:function(a,b,c,d){var e=this._relativeTime[c];return"function"==typeof e?e(a,b,c,d):e.replace(/%d/i,a)},pastFuture:function(a,b){var c=this._relativeTime[a>0?"future":"past"];return"function"==typeof c?c(b):c.replace(/%s/i,b)},ordinal:function(a){return this._ordinal.replace("%d",a)},_ordinal:"%d",preparse:function(a){return a},postformat:function(a){return a},week:function(a){return N(a,this._week.dow,this._week.doy).week},_week:{dow:0,doy:6},_invalidDate:"Invalid date",invalidDate:function(){return this._invalidDate}}),T=function(c,d,e,f){var g;return"boolean"==typeof e&&(f=e,e=a),g={_isAMomentObject:!0},g._i=c,g._f=d,g._l=e,g._strict=f,g._isUTC=!1,g._pf=b(),P(g)},T.utc=function(c,d,e,f){var g;return"boolean"==typeof e&&(f=e,e=a),g={_isAMomentObject:!0,_useUTC:!0,_isUTC:!0},g._l=e,g._i=c,g._f=d,g._strict=f,g._pf=b(),P(g).utc()},T.unix=function(a){return T(1e3*a)},T.duration=function(a,b){var c,d=a,e=null;return T.isDuration(a)?d={ms:a._milliseconds,d:a._days,M:a._months}:"number"==typeof a?(d={},b?d[b]=a:d.milliseconds=a):(e=fb.exec(a))?(c="-"===e[1]?-1:1,d={y:0,d:q(e[Y])*c,h:q(e[Z])*c,m:q(e[$])*c,s:q(e[_])*c,ms:q(e[ab])*c}):(e=gb.exec(a))&&(c="-"===e[1]?-1:1,d=function(a){return a=a&&parseFloat(a.replace(",",".")),(isNaN(a)?0:a)*c},d={y:d(e[2]),M:d(e[3]),d:d(e[4]),h:d(e[5]),m:d(e[6]),s:d(e[7]),w:d(e[8])}),e=new g(d),T.isDuration(a)&&a.hasOwnProperty("_lang")&&(e._lang=a._lang),e},T.version="2.5.1",T.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",T.updateOffset=function(){},T.lang=function(a,b){if(!a)return T.fn._lang._abbr;if(b){var c=w(a);b.abbr=c,bb[c]||(bb[c]=new e),bb[c].set(b)}else null===b?(delete bb[a],a="en"):bb[a]||y(a);return(T.duration.fn._lang=T.fn._lang=y(a))._abbr},T.langData=function(a){return a&&a._lang&&a._lang._abbr&&(a=a._lang._abbr),y(a)},T.isMoment=function(a){return a instanceof f||null!=a&&a.hasOwnProperty("_isAMomentObject")},T.isDuration=function(a){return a instanceof g},U=Lb.length-1;U>=0;--U)p(Lb[U]);for(T.normalizeUnits=function(a){return n(a)},T.invalid=function(a){var b=T.utc(0/0);return null!=a?h(b._pf,a):b._pf.userInvalidated=!0,b},T.parseZone=function(){return T.apply(null,arguments).parseZone()},h(T.fn=f.prototype,{clone:function(){return T(this)},valueOf:function(){return+this._d+6e4*(this._offset||0)},unix:function(){return Math.floor(+this/1e3)},toString:function(){return this.clone().lang("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},toDate:function(){return this._offset?new Date(+this):this._d},toISOString:function(){var a=T(this).utc();return 0=a.year()?B(a,"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]"):B(a,"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]")},toArray:function(){return[this.year(),this.month(),this.date(),this.hours(),this.minutes(),this.seconds(),this.milliseconds()]},isValid:function(){return v(this)},isDSTShifted:function(){return this._a?this.isValid()&&0a?"sameElse":-1>a?"lastWeek":0>a?"lastDay":1>a?"sameDay":2>a?"nextDay":7>a?"nextWeek":"sameElse";return this.format(this.lang().calendar(a,this))},isLeapYear:function(){return t(this.year())},isDST:function(){return this.zone()+T(a).startOf(b)},isBefore:function(a,b){return b="undefined"!=typeof b?b:"millisecond",+this.clone().startOf(b)<+T(a).startOf(b)},isSame:function(a,b){return b=b||"ms",+this.clone().startOf(b)===+x(a,this).startOf(b)},min:function(a){return a=T.apply(null,arguments),this>a?this:a},max:function(a){return a=T.apply(null,arguments),a>this?this:a},zone:function(a,b){b=null==b?!0:!1;var c=this._offset||0;return null==a?this._isUTC?c:this._d.getTimezoneOffset():("string"==typeof a&&(a=E(a)),16>Math.abs(a)&&(a*=60),this._offset=a,this._isUTC=!0,c!==a&&b&&k(this,T.duration(c-a,"m"),1,!0),this)},zoneAbbr:function(){return this._isUTC?"UTC":""},zoneName:function(){return this._isUTC?"Coordinated Universal Time":""},parseZone:function(){return this._tzm?this.zone(this._tzm):"string"==typeof this._i&&this.zone(this._i),this},hasAlignedHourOffset:function(a){return a=a?T(a).zone():0,0===(this.zone()-a)%60},daysInMonth:function(){return r(this.year(),this.month())},dayOfYear:function(a){var b=V((T(this).startOf("day")-T(this).startOf("year"))/864e5)+1;return null==a?b:this.add("d",a-b)},quarter:function(){return Math.ceil((this.month()+1)/3)},weekYear:function(a){var b=N(this,this.lang()._week.dow,this.lang()._week.doy).year;return null==a?b:this.add("y",a-b)},isoWeekYear:function(a){var b=N(this,1,4).year;return null==a?b:this.add("y",a-b)},week:function(a){var b=this.lang().week(this);return null==a?b:this.add("d",7*(a-b))},isoWeek:function(a){var b=N(this,1,4).week;return null==a?b:this.add("d",7*(a-b))},weekday:function(a){var b=(this.day()+7-this.lang()._week.dow)%7;return null==a?b:this.add("d",a-b)},isoWeekday:function(a){return null==a?this.day()||7:this.day(this.day()%7?a:a-7)},isoWeeksInYear:function(){return s(this.year(),1,4)},weeksInYear:function(){var a=this._lang._week;return s(this.year(),a.dow,a.doy)},get:function(a){return a=n(a),this[a]()},set:function(a,b){return a=n(a),"function"==typeof this[a]&&this[a](b),this},lang:function(b){return b===a?this._lang:(this._lang=y(b),this)}}),U=0;Ue&&["s",e]||1===f&&["m"]||45>f&&["mm",f]||1===g&&["h"]||22>g&&["hh",g]||1===h&&["d"]||25>=h&&["dd",h]||45>=h&&["M"]||345>h&&["MM",V(h/30)]||1===i&&["y"]||["yy",i];return e[2]=b,e[3]=c>0,e[4]=d,b=M.apply({},e),a&&(b=this.lang().pastFuture(c,b)),this.lang().postformat(b)},add:function(a,b){var c=T.duration(a,b);return this._milliseconds+=c._milliseconds,this._days+=c._days,this._months+=c._months,this._bubble(),this},subtract:function(a,b){var c=T.duration(a,b);return this._milliseconds-=c._milliseconds,this._days-=c._days,this._months-=c._months,this._bubble(),this},get:function(a){return a=n(a),this[a.toLowerCase()+"s"]()},as:function(a){return a=n(a),this["as"+a.charAt(0).toUpperCase()+a.slice(1)+"s"]()},lang:T.fn.lang,toIsoString:function(){var a=Math.abs(this.years()),b=Math.abs(this.months()),c=Math.abs(this.days()),d=Math.abs(this.hours()),e=Math.abs(this.minutes()),f=Math.abs(this.seconds()+this.milliseconds()/1e3);return this.asSeconds()?(0>this.asSeconds()?"-":"")+"P"+(a?a+"Y":"")+(b?b+"M":"")+(c?c+"D":"")+(d||e||f?"T":"")+(d?d+"H":"")+(e?e+"M":"")+(f?f+"S":""):"P0D"}});for(U in Eb)Eb.hasOwnProperty(U)&&(S(U,Eb[U]),R(U.toLowerCase()));return S("Weeks",6048e5),T.duration.fn.asMonths=function(){return(+this-31536e6*this.years())/2592e6+12*this.years()},T.lang("en",{ordinal:function(a){var b=a%10,b=1===q(a%100/10)?"th":1===b?"st":2===b?"nd":3===b?"rd":"th";return a+b}}),T}.call(this),b.datepicker.moment=d,b.datepicker}); \ No newline at end of file diff --git a/web/js/addons/form-password.js b/web/js/addons/form-password.js deleted file mode 100755 index d7ccdf1..0000000 --- a/web/js/addons/form-password.js +++ /dev/null @@ -1,62 +0,0 @@ -/*! UIkit 2.9.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ - -(function(addon) { - - var component; - - if (jQuery && jQuery.UIkit) { - component = addon(jQuery, jQuery.UIkit); - } - - if (typeof define == "function" && define.amd) { - define("uikit-form-password", ["uikit"], function(){ - return component || addon(jQuery, jQuery.UIkit); - }); - } - -})(function($, UI){ - - UI.component('formPassword', { - - defaults: { - "lblShow": "Show", - "lblHide": "Hide" - }, - - init: function() { - - var $this = this; - - this.on("click", function(e) { - - e.preventDefault(); - - 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.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); - } - }); - - // init code - UI.$doc.on("click.formpassword.uikit", "[data-uk-form-password]", function(e) { - - var ele = $(this); - if (!ele.data("formPassword")) { - - e.preventDefault(); - - var obj = UI.formPassword(ele, UI.Utils.options(ele.attr("data-uk-form-password"))); - ele.trigger("click"); - } - }); - - return UI.formPassword; -}); \ No newline at end of file diff --git a/web/js/addons/form-password.min.js b/web/js/addons/form-password.min.js deleted file mode 100755 index fdebb6d..0000000 --- a/web/js/addons/form-password.min.js +++ /dev/null @@ -1,3 +0,0 @@ -/*! UIkit 2.9.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ - -!function(a){var b;jQuery&&jQuery.UIkit&&(b=a(jQuery,jQuery.UIkit)),"function"==typeof define&&define.amd&&define("uikit-form-password",["uikit"],function(){return b||a(jQuery,jQuery.UIkit)})}(function(a,b){return b.component("formPassword",{defaults:{lblShow:"Show",lblHide:"Hide"},init:function(){var a=this;this.on("click",function(b){if(b.preventDefault(),a.input.length){var c=a.input.attr("type");a.input.attr("type","text"==c?"password":"text"),a.element.text(a.options["text"==c?"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)}}),b.$doc.on("click.formpassword.uikit","[data-uk-form-password]",function(c){var d=a(this);if(!d.data("formPassword")){c.preventDefault();{b.formPassword(d,b.Utils.options(d.attr("data-uk-form-password")))}d.trigger("click")}}),b.formPassword}); \ No newline at end of file diff --git a/web/js/addons/form-select.js b/web/js/addons/form-select.js deleted file mode 100755 index dc3be74..0000000 --- a/web/js/addons/form-select.js +++ /dev/null @@ -1,62 +0,0 @@ -/*! UIkit 2.9.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ - -(function(addon) { - - var component; - - if (jQuery && jQuery.UIkit) { - component = addon(jQuery, jQuery.UIkit); - } - - if (typeof define == "function" && define.amd) { - define("uikit-form-select", ["uikit"], function(){ - return component || addon(jQuery, jQuery.UIkit); - }); - } - -})(function($, UI){ - - UI.component('formSelect', { - defaults: { - 'target': '>span:first' - }, - - init: function() { - var $this = this; - - this.target = this.find(this.options.target); - this.select = this.find('select'); - - // init + on change event - this.select.on("change", (function(){ - - var select = $this.select[0], fn = function(){ - - try { - $this.target.text(select.options[select.selectedIndex].text); - } catch(e) {} - - return fn; - }; - - return fn(); - })()); - - this.element.data("formSelect", this); - } - }); - - // init code - UI.ready(function(context) { - - $("[data-uk-form-select]", context).each(function(){ - var ele = $(this); - - if (!ele.data("formSelect")) { - var obj = UI.formSelect(ele, UI.Utils.options(ele.attr("data-uk-form-select"))); - } - }); - }); - - return UI.formSelect; -}); \ No newline at end of file diff --git a/web/js/addons/form-select.min.js b/web/js/addons/form-select.min.js deleted file mode 100755 index a1322df..0000000 --- a/web/js/addons/form-select.min.js +++ /dev/null @@ -1,3 +0,0 @@ -/*! UIkit 2.9.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ - -!function(a){var b;jQuery&&jQuery.UIkit&&(b=a(jQuery,jQuery.UIkit)),"function"==typeof define&&define.amd&&define("uikit-form-select",["uikit"],function(){return b||a(jQuery,jQuery.UIkit)})}(function(a,b){return b.component("formSelect",{defaults:{target:">span:first"},init:function(){var a=this;this.target=this.find(this.options.target),this.select=this.find("select"),this.select.on("change",function(){var b=a.select[0],c=function(){try{a.target.text(b.options[b.selectedIndex].text)}catch(d){}return c};return c()}()),this.element.data("formSelect",this)}}),b.ready(function(c){a("[data-uk-form-select]",c).each(function(){var c=a(this);if(!c.data("formSelect")){b.formSelect(c,b.Utils.options(c.attr("data-uk-form-select")))}})}),b.formSelect}); \ No newline at end of file diff --git a/web/js/addons/htmleditor.js b/web/js/addons/htmleditor.js deleted file mode 100755 index b915ccd..0000000 --- a/web/js/addons/htmleditor.js +++ /dev/null @@ -1,615 +0,0 @@ -/*! UIkit 2.9.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ - -(function(addon) { - - var component; - - if (jQuery && jQuery.UIkit) { - component = addon(jQuery, jQuery.UIkit); - } - - if (typeof define == "function" && define.amd) { - define("uikit-htmleditor", ["uikit"], function(){ - return component || addon(jQuery, jQuery.UIkit); - }); - } - -})(function($, UI) { - - var editors = []; - - UI.component('htmleditor', { - - defaults: { - iframe : false, - mode : 'split', - markdown : false, - autocomplete : true, - height : 500, - maxsplitsize : 1000, - markedOptions: { gfm: true, tables: true, breaks: true, pedantic: true, sanitize: false, smartLists: true, smartypants: false, langPrefix: 'lang-'}, - codemirror : { mode: 'htmlmixed', lineWrapping: true, dragDrop: false, autoCloseTags: true, matchTags: true, autoCloseBrackets: true, matchBrackets: true, indentUnit: 4, indentWithTabs: false, tabSize: 4, hintOptions: {completionSingle:false} }, - toolbar : [ 'bold', 'italic', 'strike', 'link', 'image', 'blockquote', 'listUl', 'listOl' ], - lblPreview : 'Preview', - lblCodeview : 'HTML', - lblMarkedview: 'Markdown' - }, - - init: function() { - - var $this = this, tpl = UI.components.htmleditor.template; - - this.CodeMirror = this.options.CodeMirror || CodeMirror; - this.buttons = {}; - - tpl = tpl.replace(/\{:lblPreview\}/g, this.options.lblPreview); - tpl = tpl.replace(/\{:lblCodeview\}/g, this.options.lblCodeview); - - this.htmleditor = $(tpl); - this.content = this.htmleditor.find('.uk-htmleditor-content'); - this.toolbar = this.htmleditor.find('.uk-htmleditor-toolbar'); - this.preview = this.htmleditor.find('.uk-htmleditor-preview').children().eq(0); - this.code = this.htmleditor.find('.uk-htmleditor-code'); - - this.element.before(this.htmleditor).appendTo(this.code); - this.editor = this.CodeMirror.fromTextArea(this.element[0], this.options.codemirror); - this.editor.htmleditor = this; - this.editor.on('change', UI.Utils.debounce(function() { $this.render(); }, 150)); - this.editor.on('change', function() { $this.editor.save(); }); - this.code.find('.CodeMirror').css('height', this.options.height); - - // iframe mode? - if (this.options.iframe) { - - this.iframe = $(''); - this.preview.append(this.iframe); - - // must open and close document object to start using it! - this.iframe[0].contentWindow.document.open(); - this.iframe[0].contentWindow.document.close(); - - this.preview.container = $(this.iframe[0].contentWindow.document).find('body'); - - // append custom stylesheet - if (typeof(this.options.iframe) === 'string') { - this.preview.container.parent().append(''); - } - - } else { - this.preview.container = this.preview; - } - - UI.$win.on('resize', UI.Utils.debounce(function() { $this.fit(); }, 200)); - - var previewContainer = this.iframe ? this.preview.container:$this.preview.parent(), - codeContent = this.code.find('.CodeMirror-sizer'), - codeScroll = this.code.find('.CodeMirror-scroll').on('scroll', UI.Utils.debounce(function() { - - 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; - - // apply new scroll - previewContainer.scrollTop(previewPostition); - - }, 10)); - - this.htmleditor.on('click', '.uk-htmleditor-button-code, .uk-htmleditor-button-preview', function(e) { - - e.preventDefault(); - - if ($this.htmleditor.attr('data-mode') == 'tab') { - - $this.htmleditor.find('.uk-htmleditor-button-code, .uk-htmleditor-button-preview').removeClass('uk-active').filter(this).addClass('uk-active'); - - $this.activetab = $(this).hasClass('uk-htmleditor-button-code') ? 'code' : 'preview'; - $this.htmleditor.attr('data-active-tab', $this.activetab); - $this.editor.refresh(); - } - }); - - // toolbar actions - this.htmleditor.on('click', 'a[data-htmleditor-button]', function() { - - if (!$this.code.is(':visible')) return; - - $this.trigger('action.' + $(this).data('htmleditor-button'), [$this.editor]); - }); - - this.preview.parent().css('height', this.code.height()); - - // autocomplete - if (this.options.autocomplete && this.CodeMirror.showHint && this.CodeMirror.hint && this.CodeMirror.hint.html) { - - this.editor.on('inputRead', UI.Utils.debounce(function() { - var doc = $this.editor.getDoc(), POS = doc.getCursor(), mode = $this.CodeMirror.innerMode($this.editor.getMode(), $this.editor.getTokenAt(POS).state).mode.name; - - if (mode == 'xml') { //html depends on xml - - var cur = $this.editor.getCursor(), token = $this.editor.getTokenAt(cur); - - if (token.string.charAt(0) == '<' || token.type == 'attribute') { - $this.CodeMirror.showHint($this.editor, $this.CodeMirror.hint.html, { completeSingle: false }); - } - } - }, 100)); - } - - this.debouncedRedraw = UI.Utils.debounce(function () { $this.redraw(); }, 5); - - this.on('init', function() { - $this.redraw(); - }); - - this.element.attr('data-uk-check-display', 1).on('uk-check-display', function(e) { - if(this.htmleditor.is(":visible")) this.fit(); - }.bind(this)); - - editors.push(this); - }, - - addButton: function(name, button) { - this.buttons[name] = button; - }, - - addButtons: function(buttons) { - $.extend(this.buttons, buttons); - }, - - replaceInPreview: function(regexp, callback) { - - var editor = this.editor, results = [], value = editor.getValue(), offset = -1; - - this.currentvalue = this.currentvalue.replace(regexp, function() { - - offset = value.indexOf(arguments[0], ++offset); - - var match = { - matches: arguments, - from : translateOffset(offset), - to : translateOffset(offset + arguments[0].length), - replace: function(value) { - editor.replaceRange(value, match.from, match.to); - }, - inRange: function(cursor) { - - if (cursor.line === match.from.line && cursor.line === match.to.line) { - return cursor.ch >= match.from.ch && cursor.ch < match.to.ch; - } - - return (cursor.line === match.from.line && cursor.ch >= match.from.ch) - || (cursor.line > match.from.line && cursor.line < match.to.line) - || (cursor.line === match.to.line && cursor.ch < match.to.ch); - } - }; - - var result = callback(match); - - if (result == false) { - return arguments[0]; - } - - results.push(match); - return result; - }); - - function translateOffset(offset) { - var result = editor.getValue().substring(0, offset).split('\n'); - return { line: result.length - 1, ch: result[result.length - 1].length } - } - - return results; - }, - - _buildtoolbar: function() { - - if (!(this.options.toolbar && this.options.toolbar.length)) return; - - var $this = this, bar = []; - - this.toolbar.empty(); - - this.options.toolbar.forEach(function(button) { - if (!$this.buttons[button]) return; - - var title = $this.buttons[button].title ? $this.buttons[button].title : button; - - bar.push('
  • '+$this.buttons[button].label+'
  • '); - }); - - this.toolbar.html(bar.join('\n')); - }, - - fit: function() { - - var mode = this.options.mode; - - if (mode == 'split' && this.htmleditor.width() < this.options.maxsplitsize) { - mode = 'tab'; - } - - if (mode == 'tab') { - if (!this.activetab) { - this.activetab = 'code'; - this.htmleditor.attr('data-active-tab', this.activetab); - } - - this.htmleditor.find('.uk-htmleditor-button-code, .uk-htmleditor-button-preview').removeClass('uk-active') - .filter(this.activetab == 'code' ? '.uk-htmleditor-button-code' : '.uk-htmleditor-button-preview') - .addClass('uk-active'); - } - - this.editor.refresh(); - this.preview.parent().css('height', this.code.height()); - - this.htmleditor.attr('data-mode', mode); - }, - - redraw: function() { - this._buildtoolbar(); - this.render(); - this.fit(); - }, - - getMode: function() { - return this.editor.getOption('mode'); - }, - - getCursorMode: function() { - var param = { mode: 'html'}; - this.trigger('cursorMode', [param]); - return param.mode; - }, - - render: function() { - - this.currentvalue = this.editor.getValue(); - - // empty code - if (!this.currentvalue) { - - this.element.val(''); - this.preview.container.html(''); - - return; - } - - this.trigger('render', [this]); - this.trigger('renderLate', [this]); - - this.preview.container.html(this.currentvalue); - }, - - addShortcut: function(name, callback) { - var map = {}; - if (!$.isArray(name)) { - name = [name]; - } - - name.forEach(function(key) { - map[key] = callback; - }); - - this.editor.addKeyMap(map); - - return map; - }, - - addShortcutAction: function(action, shortcuts) { - var editor = this; - this.addShortcut(shortcuts, function() { - editor.element.trigger('action.' + action, [editor.editor]); - }); - }, - - replaceSelection: function(replace) { - - var text = this.editor.getSelection(); - - if (!text.length) { - - var cur = this.editor.getCursor(), - curLine = this.editor.getLine(cur.line), - start = cur.ch, - end = start; - - while (end < curLine.length && /[\w$]+/.test(curLine.charAt(end))) ++end; - while (start && /[\w$]+/.test(curLine.charAt(start - 1))) --start; - - var curWord = start != end && curLine.slice(start, end); - - if (curWord) { - this.editor.setSelection({ line: cur.line, ch: start}, { line: cur.line, ch: end }); - text = curWord; - } - } - - var html = replace.replace('$1', text); - - this.editor.replaceSelection(html, 'end'); - this.editor.focus(); - }, - - replaceLine: function(replace) { - var pos = this.editor.getDoc().getCursor(), - text = this.editor.getLine(pos.line), - html = replace.replace('$1', text); - - this.editor.replaceRange(html , { line: pos.line, ch: 0 }, { line: pos.line, ch: text.length }); - this.editor.setCursor({ line: pos.line, ch: html.length }); - this.editor.focus(); - }, - - save: function() { - this.editor.save(); - } - }); - - - UI.components.htmleditor.template = [ - '
    ', - '
    ', - '
      ', - '
      ', - '', - '
      ', - '
      ', - '
      ', - '
      ', - '
      ', - '
      ', - '
      ' - ].join(''); - - - UI.plugin('htmleditor', 'base', { - - init: function(editor) { - - editor.addButtons({ - - fullscreen: { - title : 'Fullscreen', - label : '' - }, - bold : { - title : 'Bold', - label : '' - }, - italic : { - title : 'Italic', - label : '' - }, - strike : { - title : 'Strikethrough', - label : '' - }, - blockquote : { - title : 'Blockquote', - label : '' - }, - link : { - title : 'Link', - label : '' - }, - image : { - title : 'Image', - label : '' - }, - listUl : { - title : 'Unordered List', - label : '' - }, - listOl : { - title : 'Ordered List', - label : '' - } - - }); - - addAction('bold', '$1'); - addAction('italic', '$1'); - addAction('strike', '$1'); - addAction('blockquote', '

      $1

      ', 'replaceLine'); - addAction('link', '$1'); - addAction('image', '$1'); - - var listfn = function() { - if (editor.getCursorMode() == 'html') { - - var cm = editor.editor, - pos = cm.getDoc().getCursor(true), - posend = cm.getDoc().getCursor(false); - - for (var i=pos.line; i<(posend.line+1);i++) { - cm.replaceRange('
    • '+cm.getLine(i)+'
    • ', { line: i, ch: 0 }, { line: i, ch: cm.getLine(i).length }); - } - - cm.setCursor({ line: posend.line, ch: cm.getLine(posend.line).length }); - cm.focus(); - } - } - - editor.on('action.listUl', function() { - listfn(); - }); - - editor.on('action.listOl', function() { - listfn(); - }); - - editor.htmleditor.on('click', 'a[data-htmleditor-button="fullscreen"]', function() { - editor.htmleditor.toggleClass('uk-htmleditor-fullscreen'); - - var wrap = editor.editor.getWrapperElement(); - - if (editor.htmleditor.hasClass('uk-htmleditor-fullscreen')) { - - editor.editor.state.fullScreenRestore = {scrollTop: window.pageYOffset, scrollLeft: window.pageXOffset, width: wrap.style.width, height: wrap.style.height}; - wrap.style.width = ''; - wrap.style.height = editor.content.height()+'px'; - document.documentElement.style.overflow = 'hidden'; - - } else { - - document.documentElement.style.overflow = ''; - var info = editor.editor.state.fullScreenRestore; - wrap.style.width = info.width; wrap.style.height = info.height; - window.scrollTo(info.scrollLeft, info.scrollTop); - } - - setTimeout(function() { - editor.fit(); - UI.$win.trigger('resize'); - }, 50); - }); - - editor.addShortcut(['Ctrl-S', 'Cmd-S'], function() { editor.element.trigger('htmleditor-save', [editor]); }); - editor.addShortcutAction('bold', ['Ctrl-B', 'Cmd-B']); - - function addAction(name, replace, mode) { - editor.on('action.'+name, function() { - if (editor.getCursorMode() == 'html') { - editor[mode == 'replaceLine' ? 'replaceLine' : 'replaceSelection'](replace); - } - }); - } - } - }); - - UI.plugin('htmleditor', 'markdown', { - - init: function(editor) { - - var parser = editor.options.marked || marked; - - if (!parser) return; - - parser.setOptions(editor.options.markedOptions); - - if (editor.options.markdown) { - enableMarkdown() - } - - addAction('bold', '**$1**'); - addAction('italic', '*$1*'); - addAction('strike', '~~$1~~'); - addAction('blockquote', '> $1', 'replaceLine'); - addAction('link', '[$1](http://)'); - addAction('image', '![$1](http://)'); - - editor.on('action.listUl', function() { - - if (editor.getCursorMode() == 'markdown') { - - var cm = editor.editor, - pos = cm.getDoc().getCursor(true), - posend = cm.getDoc().getCursor(false); - - for (var i=pos.line; i<(posend.line+1);i++) { - cm.replaceRange('* '+cm.getLine(i), { line: i, ch: 0 }, { line: i, ch: cm.getLine(i).length }); - } - - cm.setCursor({ line: posend.line, ch: cm.getLine(posend.line).length }); - cm.focus(); - } - }); - - editor.on('action.listOl', function() { - - if (editor.getCursorMode() == 'markdown') { - - var cm = editor.editor, - pos = cm.getDoc().getCursor(true), - posend = cm.getDoc().getCursor(false), - prefix = 1; - - if (pos.line > 0) { - var prevline = cm.getLine(pos.line-1), matches; - - if(matches = prevline.match(/^(\d+)\./)) { - prefix = Number(matches[1])+1; - } - } - - for (var i=pos.line; i<(posend.line+1);i++) { - cm.replaceRange(prefix+'. '+cm.getLine(i), { line: i, ch: 0 }, { line: i, ch: cm.getLine(i).length }); - prefix++; - } - - cm.setCursor({ line: posend.line, ch: cm.getLine(posend.line).length }); - cm.focus(); - } - }); - - editor.on('renderLate', function() { - if (editor.editor.options.mode == 'gfm') { - editor.currentvalue = parser(editor.currentvalue); - } - }); - - editor.on('cursorMode', function(e, param) { - if (editor.editor.options.mode == 'gfm') { - var pos = editor.editor.getDoc().getCursor(); - if (!editor.editor.getTokenAt(pos).state.base.htmlState) { - param.mode = 'markdown'; - } - } - }); - - $.extend(editor, { - - enableMarkdown: function() { - enableMarkdown() - this.render(); - }, - disableMarkdown: function() { - this.editor.setOption('mode', 'htmlmixed'); - this.htmleditor.find('.uk-htmleditor-button-code a').html(this.options.lblCodeview); - this.render(); - } - - }); - - // switch markdown mode on event - editor.on({ - enableMarkdown : function() { editor.enableMarkdown(); }, - disableMarkdown : function() { editor.disableMarkdown(); } - }); - - function enableMarkdown() { - editor.editor.setOption('mode', 'gfm'); - editor.htmleditor.find('.uk-htmleditor-button-code a').html(editor.options.lblMarkedview); - } - - function addAction(name, replace, mode) { - editor.on('action.'+name, function() { - if (editor.getCursorMode() == 'markdown') { - editor[mode == 'replaceLine' ? 'replaceLine' : 'replaceSelection'](replace); - } - }); - } - } - }); - - // init code - $(function() { - $('textarea[data-uk-htmleditor]').each(function() { - var editor = $(this), obj; - - if (!editor.data('htmleditor')) { - obj = UI.htmleditor(editor, UI.Utils.options(editor.attr('data-uk-htmleditor'))); - } - }); - }); - - return UI.htmleditor; -}); \ No newline at end of file diff --git a/web/js/addons/htmleditor.min.js b/web/js/addons/htmleditor.min.js deleted file mode 100755 index 28858b2..0000000 --- a/web/js/addons/htmleditor.min.js +++ /dev/null @@ -1,3 +0,0 @@ -/*! UIkit 2.9.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ - -!function(a){var b;jQuery&&jQuery.UIkit&&(b=a(jQuery,jQuery.UIkit)),"function"==typeof define&&define.amd&&define("uikit-htmleditor",["uikit"],function(){return b||a(jQuery,jQuery.UIkit)})}(function(a,b){var c=[];return b.component("htmleditor",{defaults:{iframe:!1,mode:"split",markdown:!1,autocomplete:!0,height:500,maxsplitsize:1e3,markedOptions:{gfm:!0,tables:!0,breaks:!0,pedantic:!0,sanitize:!1,smartLists:!0,smartypants:!1,langPrefix:"lang-"},codemirror:{mode:"htmlmixed",lineWrapping:!0,dragDrop:!1,autoCloseTags:!0,matchTags:!0,autoCloseBrackets:!0,matchBrackets:!0,indentUnit:4,indentWithTabs:!1,tabSize:4,hintOptions:{completionSingle:!1}},toolbar:["bold","italic","strike","link","image","blockquote","listUl","listOl"],lblPreview:"Preview",lblCodeview:"HTML",lblMarkedview:"Markdown"},init:function(){var d=this,e=b.components.htmleditor.template;this.CodeMirror=this.options.CodeMirror||CodeMirror,this.buttons={},e=e.replace(/\{:lblPreview\}/g,this.options.lblPreview),e=e.replace(/\{:lblCodeview\}/g,this.options.lblCodeview),this.htmleditor=a(e),this.content=this.htmleditor.find(".uk-htmleditor-content"),this.toolbar=this.htmleditor.find(".uk-htmleditor-toolbar"),this.preview=this.htmleditor.find(".uk-htmleditor-preview").children().eq(0),this.code=this.htmleditor.find(".uk-htmleditor-code"),this.element.before(this.htmleditor).appendTo(this.code),this.editor=this.CodeMirror.fromTextArea(this.element[0],this.options.codemirror),this.editor.htmleditor=this,this.editor.on("change",b.Utils.debounce(function(){d.render()},150)),this.editor.on("change",function(){d.editor.save()}),this.code.find(".CodeMirror").css("height",this.options.height),this.options.iframe?(this.iframe=a(''),this.preview.append(this.iframe),this.iframe[0].contentWindow.document.open(),this.iframe[0].contentWindow.document.close(),this.preview.container=a(this.iframe[0].contentWindow.document).find("body"),"string"==typeof this.options.iframe&&this.preview.container.parent().append('')):this.preview.container=this.preview,b.$win.on("resize",b.Utils.debounce(function(){d.fit()},200));var f=this.iframe?this.preview.container:d.preview.parent(),g=this.code.find(".CodeMirror-sizer"),h=this.code.find(".CodeMirror-scroll").on("scroll",b.Utils.debounce(function(){if("tab"!=d.htmleditor.attr("data-mode")){var a=g.height()-h.height(),b=f[0].scrollHeight-(d.iframe?d.iframe.height():f.height()),c=b/a,e=h.scrollTop()*c;f.scrollTop(e)}},10));this.htmleditor.on("click",".uk-htmleditor-button-code, .uk-htmleditor-button-preview",function(b){b.preventDefault(),"tab"==d.htmleditor.attr("data-mode")&&(d.htmleditor.find(".uk-htmleditor-button-code, .uk-htmleditor-button-preview").removeClass("uk-active").filter(this).addClass("uk-active"),d.activetab=a(this).hasClass("uk-htmleditor-button-code")?"code":"preview",d.htmleditor.attr("data-active-tab",d.activetab),d.editor.refresh())}),this.htmleditor.on("click","a[data-htmleditor-button]",function(){d.code.is(":visible")&&d.trigger("action."+a(this).data("htmleditor-button"),[d.editor])}),this.preview.parent().css("height",this.code.height()),this.options.autocomplete&&this.CodeMirror.showHint&&this.CodeMirror.hint&&this.CodeMirror.hint.html&&this.editor.on("inputRead",b.Utils.debounce(function(){var a=d.editor.getDoc(),b=a.getCursor(),c=d.CodeMirror.innerMode(d.editor.getMode(),d.editor.getTokenAt(b).state).mode.name;if("xml"==c){var e=d.editor.getCursor(),f=d.editor.getTokenAt(e);("<"==f.string.charAt(0)||"attribute"==f.type)&&d.CodeMirror.showHint(d.editor,d.CodeMirror.hint.html,{completeSingle:!1})}},100)),this.debouncedRedraw=b.Utils.debounce(function(){d.redraw()},5),this.on("init",function(){d.redraw()}),this.element.attr("data-uk-check-display",1).on("uk-check-display",function(){this.htmleditor.is(":visible")&&this.fit()}.bind(this)),c.push(this)},addButton:function(a,b){this.buttons[a]=b},addButtons:function(b){a.extend(this.buttons,b)},replaceInPreview:function(a,b){function c(a){var b=d.getValue().substring(0,a).split("\n");return{line:b.length-1,ch:b[b.length-1].length}}var d=this.editor,e=[],f=d.getValue(),g=-1;return this.currentvalue=this.currentvalue.replace(a,function(){g=f.indexOf(arguments[0],++g);var a={matches:arguments,from:c(g),to:c(g+arguments[0].length),replace:function(b){d.replaceRange(b,a.from,a.to)},inRange:function(b){return b.line===a.from.line&&b.line===a.to.line?b.ch>=a.from.ch&&b.ch=a.from.ch||b.line>a.from.line&&b.line'+a.buttons[c].label+"")}}),this.toolbar.html(b.join("\n"))}},fit:function(){var a=this.options.mode;"split"==a&&this.htmleditor.width()','
      ','
        ','
        ','","
        ","
        ",'
        ','
        ','
        ',"
        ",""].join(""),b.plugin("htmleditor","base",{init:function(a){function c(b,c,d){a.on("action."+b,function(){"html"==a.getCursorMode()&&a["replaceLine"==d?"replaceLine":"replaceSelection"](c)})}a.addButtons({fullscreen:{title:"Fullscreen",label:''},bold:{title:"Bold",label:''},italic:{title:"Italic",label:''},strike:{title:"Strikethrough",label:''},blockquote:{title:"Blockquote",label:''},link:{title:"Link",label:''},image:{title:"Image",label:''},listUl:{title:"Unordered List",label:''},listOl:{title:"Ordered List",label:''}}),c("bold","$1"),c("italic","$1"),c("strike","$1"),c("blockquote","

        $1

        ","replaceLine"),c("link",'$1'),c("image",'$1');var d=function(){if("html"==a.getCursorMode()){for(var b=a.editor,c=b.getDoc().getCursor(!0),d=b.getDoc().getCursor(!1),e=c.line;e"+b.getLine(e)+"",{line:e,ch:0},{line:e,ch:b.getLine(e).length});b.setCursor({line:d.line,ch:b.getLine(d.line).length}),b.focus()}};a.on("action.listUl",function(){d()}),a.on("action.listOl",function(){d()}),a.htmleditor.on("click",'a[data-htmleditor-button="fullscreen"]',function(){a.htmleditor.toggleClass("uk-htmleditor-fullscreen");var c=a.editor.getWrapperElement();if(a.htmleditor.hasClass("uk-htmleditor-fullscreen"))a.editor.state.fullScreenRestore={scrollTop:window.pageYOffset,scrollLeft:window.pageXOffset,width:c.style.width,height:c.style.height},c.style.width="",c.style.height=a.content.height()+"px",document.documentElement.style.overflow="hidden";else{document.documentElement.style.overflow="";var d=a.editor.state.fullScreenRestore;c.style.width=d.width,c.style.height=d.height,window.scrollTo(d.scrollLeft,d.scrollTop)}setTimeout(function(){a.fit(),b.$win.trigger("resize")},50)}),a.addShortcut(["Ctrl-S","Cmd-S"],function(){a.element.trigger("htmleditor-save",[a])}),a.addShortcutAction("bold",["Ctrl-B","Cmd-B"])}}),b.plugin("htmleditor","markdown",{init:function(b){function c(){b.editor.setOption("mode","gfm"),b.htmleditor.find(".uk-htmleditor-button-code a").html(b.options.lblMarkedview)}function d(a,c,d){b.on("action."+a,function(){"markdown"==b.getCursorMode()&&b["replaceLine"==d?"replaceLine":"replaceSelection"](c)})}var e=b.options.marked||marked;e&&(e.setOptions(b.options.markedOptions),b.options.markdown&&c(),d("bold","**$1**"),d("italic","*$1*"),d("strike","~~$1~~"),d("blockquote","> $1","replaceLine"),d("link","[$1](http://)"),d("image","![$1](http://)"),b.on("action.listUl",function(){if("markdown"==b.getCursorMode()){for(var a=b.editor,c=a.getDoc().getCursor(!0),d=a.getDoc().getCursor(!1),e=c.line;e0){var f,g=a.getLine(c.line-1);(f=g.match(/^(\d+)\./))&&(e=Number(f[1])+1)}for(var h=c.line;h'; - - this.find(">"+this.options.itemNodeName).addClass(this.options.listitemClass) - .end() - .find("ul:not(.ignore-list)").addClass(this.options.listClass) - .find(">li").addClass(this.options.listitemClass); - - if (!this.element.children(this.options.itemNodeName).length) { - this.element.append(this.tplempty); - } - - this.element.data("nestable-id", "ID"+(new Date().getTime())+"RAND"+(Math.ceil(Math.random() *100000))); - this.reset(); - this.element.data('nestable-group', this.options.group); - this.placeEl = $('
        '); - - this.find(this.options.itemNodeName).each(function() { - $this.setParent($(this)); - }); - - this.on('click', '[data-nestable-action]', function(e) { - - if ($this.dragEl || (!hasTouch && e.button !== 0)) { - return; - } - - e.preventDefault(); - - var target = $(e.currentTarget), - action = target.data('nestableAction'), - item = target.closest($this.options.itemNodeName); - if (action === 'collapse') { - $this.collapseItem(item); - } - if (action === 'expand') { - $this.expandItem(item); - } - if (action === 'toggle') { - $this.toggleItem(item); - } - }); - - var onStartEvent = function(e) { - - var handle = $(e.target); - - if (!handle.hasClass($this.options.handleClass)) { - if (handle.closest('.' + $this.options.noDragClass).length) { - return; - } - handle = handle.closest('.' + $this.options.handleClass); - } - if (!handle.length || $this.dragEl || (!hasTouch && e.button !== 0) || (hasTouch && e.touches.length !== 1)) { - return; - } - e.preventDefault(); - $this.dragStart(hasTouch ? e.touches[0] : e); - $this.trigger('nestable-start', [$this]); - }; - - var onMoveEvent = function(e) { - if ($this.dragEl) { - e.preventDefault(); - $this.dragMove(hasTouch ? e.touches[0] : e); - $this.trigger('nestable-move', [$this]); - } - }; - - var onEndEvent = function(e) { - if ($this.dragEl) { - e.preventDefault(); - $this.dragStop(hasTouch ? e.touches[0] : e); - $this.trigger('nestable-stop', [$this]); - } - }; - - if (hasTouch) { - this.element[0].addEventListener(eStart, onStartEvent, false); - window.addEventListener(eMove, onMoveEvent, false); - window.addEventListener(eEnd, onEndEvent, false); - window.addEventListener(eCancel, onEndEvent, false); - } else { - this.on(eStart, onStartEvent); - $win.on(eMove, onMoveEvent); - $win.on(eEnd, onEndEvent); - } - - }, - - serialize: function() { - - var data, - depth = 0, - list = this; - step = function(level, depth) { - - var array = [ ], items = level.children(list.options.itemNodeName); - - items.each(function() { - - var li = $(this), - item = $.extend({}, li.data()), - sub = li.children(list.options.listNodeName); - - if (sub.length) { - item.children = step(sub, depth + 1); - } - array.push(item); - }); - return array; - }; - - data = step(list.element, depth); - - return data; - }, - - list: function(options) { - - var data = [], - list = this, - depth = 0, - options = $.extend({}, list.options, options), - step = function(level, depth, parent) { - - var items = level.children(options.itemNodeName); - - items.each(function(index) { - var li = $(this), - item = $.extend({parent_id: (parent ? parent : null), depth: depth, order: index}, li.data()), - sub = li.children(options.listNodeName); - - data.push(item); - - if (sub.length) { - step(sub, depth + 1, li.data(options.idProperty || 'id')); - } - }); - }; - - step(list.element, depth); - - return data; - }, - - reset: function() { - - this.mouse = { - offsetX : 0, - offsetY : 0, - startX : 0, - startY : 0, - lastX : 0, - lastY : 0, - nowX : 0, - nowY : 0, - distX : 0, - distY : 0, - dirAx : 0, - dirX : 0, - dirY : 0, - lastDirX : 0, - lastDirY : 0, - distAxX : 0, - distAxY : 0 - }; - this.moving = false; - this.dragEl = null; - this.dragRootEl = null; - this.dragDepth = 0; - this.hasNewRoot = false; - this.pointEl = null; - - for (var i=0; i this.dragDepth) { - this.dragDepth = depth; - } - } - - html.addClass(this.options.movingClass); - }, - - dragStop: function(e) { - // fix for zepto.js - //this.placeEl.replaceWith(this.dragEl.children(this.options.itemNodeName + ':first').detach()); - var el = this.dragEl.children(this.options.itemNodeName).first(); - el[0].parentNode.removeChild(el[0]); - this.placeEl.replaceWith(el); - - this.dragEl.remove(); - - if (this.tmpDragOnSiblings[0]!=el[0].previousSibling || this.tmpDragOnSiblings[0]!=el[0].previousSibling) { - - this.element.trigger('nestable-change',[el, this.hasNewRoot ? "added":"moved"]); - - if (this.hasNewRoot) { - this.dragRootEl.trigger('nestable-change', [el, "removed"]); - } - } - - this.reset(); - - html.removeClass(this.options.movingClass); - }, - - dragMove: function(e) { - var list, parent, prev, next, depth, - opt = this.options, - mouse = this.mouse; - - this.dragEl.css({ - left : e.pageX - mouse.offsetX, - top : e.pageY - mouse.offsetY - }); - - // mouse position last events - mouse.lastX = mouse.nowX; - mouse.lastY = mouse.nowY; - // mouse position this events - mouse.nowX = e.pageX; - mouse.nowY = e.pageY; - // distance mouse moved between events - mouse.distX = mouse.nowX - mouse.lastX; - mouse.distY = mouse.nowY - mouse.lastY; - // direction mouse was moving - mouse.lastDirX = mouse.dirX; - mouse.lastDirY = mouse.dirY; - // direction mouse is now moving (on both axis) - mouse.dirX = mouse.distX === 0 ? 0 : mouse.distX > 0 ? 1 : -1; - mouse.dirY = mouse.distY === 0 ? 0 : mouse.distY > 0 ? 1 : -1; - // axis mouse is now moving on - var newAx = Math.abs(mouse.distX) > Math.abs(mouse.distY) ? 1 : 0; - - // do nothing on first move - if (!mouse.moving) { - mouse.dirAx = newAx; - mouse.moving = true; - return; - } - - // calc distance moved on this axis (and direction) - if (mouse.dirAx !== newAx) { - mouse.distAxX = 0; - mouse.distAxY = 0; - } else { - mouse.distAxX += Math.abs(mouse.distX); - if (mouse.dirX !== 0 && mouse.dirX !== mouse.lastDirX) { - mouse.distAxX = 0; - } - mouse.distAxY += Math.abs(mouse.distY); - if (mouse.dirY !== 0 && mouse.dirY !== mouse.lastDirY) { - mouse.distAxY = 0; - } - } - mouse.dirAx = newAx; - - /** - * move horizontal - */ - if (mouse.dirAx && mouse.distAxX >= opt.threshold) { - // reset move distance on x-axis for new phase - mouse.distAxX = 0; - prev = this.placeEl.prev(opt.itemNodeName); - // increase horizontal level if previous sibling exists and is not collapsed - if (mouse.distX > 0 && prev.length && !prev.hasClass(opt.collapsedClass)) { - // cannot increase level when item above is collapsed - list = prev.find(opt.listNodeName).last(); - // check if depth limit has reached - depth = this.placeEl.parents(opt.listNodeName).length; - if (depth + this.dragDepth <= opt.maxDepth) { - // create new sub-level if one doesn't exist - if (!list.length) { - list = $('<' + opt.listNodeName + '/>').addClass(opt.listClass); - list.append(this.placeEl); - prev.append(list); - this.setParent(prev); - } else { - // else append to next level up - list = prev.children(opt.listNodeName).last(); - list.append(this.placeEl); - } - } - } - // decrease horizontal level - if (mouse.distX < 0) { - // we can't decrease a level if an item preceeds the current one - next = this.placeEl.next(opt.itemNodeName); - if (!next.length) { - parent = this.placeEl.parent(); - this.placeEl.closest(opt.itemNodeName).after(this.placeEl); - if (!parent.children().length) { - this.unsetParent(parent.parent()); - } - } - } - } - - var isEmpty = false; - - // find list item under cursor - if (!hasPointerEvents) { - this.dragEl[0].style.visibility = 'hidden'; - } - this.pointEl = $(document.elementFromPoint(e.pageX - document.body.scrollLeft, e.pageY - (window.pageYOffset || document.documentElement.scrollTop))); - if (!hasPointerEvents) { - this.dragEl[0].style.visibility = 'visible'; - } - - if (this.pointEl.hasClass(opt.handleClass)) { - this.pointEl = this.pointEl.closest(opt.itemNodeName); - } else { - - var nestableitem = this.pointEl.closest('.'+opt.itemClass); - - if(nestableitem.length) { - this.pointEl = nestableitem.closest(opt.itemNodeName); - } - } - - if (this.pointEl.hasClass(opt.emptyClass)) { - isEmpty = true; - } else if (this.pointEl.data('nestable') && !this.pointEl.children().length) { - isEmpty = true; - this.pointEl = $(this.tplempty).appendTo(this.pointEl); - } else if (!this.pointEl.length || !this.pointEl.hasClass(opt.listitemClass)) { - return; - } - - // 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], - $newRoot = tmpRoot; - - /** - * move vertical - */ - if (!mouse.dirAx || isNewRoot || isEmpty) { - // check if groups match if dragging over new root - if (isNewRoot && opt.group !== $newRoot.data('nestable-group')) { - return; - } else { - touchedlists.push(pointElRoot); - } - - // check depth limit - depth = this.dragDepth - 1 + this.pointEl.parents(opt.listNodeName).length; - - if (depth > opt.maxDepth) { - return; - } - - var before = e.pageY < (this.pointEl.offset().top + this.pointEl.height() / 2); - - parent = this.placeEl.parent(); - - // if empty create new list to replace empty placeholder - if (isEmpty) { - this.pointEl.replaceWith(this.placeEl); - } else if (before) { - this.pointEl.before(this.placeEl); - } else { - this.pointEl.after(this.placeEl); - } - - if (!parent.children().length) { - if(!parent.data("nestable")) this.unsetParent(parent.parent()); - } - - if (!this.dragRootEl.find(opt.itemNodeName).length && !this.dragRootEl.children().length) { - this.dragRootEl.append(this.tplempty); - } - - // parent root list has changed - if (isNewRoot) { - this.dragRootEl = tmpRoot; - this.hasNewRoot = this.element[0] !== this.dragRootEl[0]; - } - } - } - - }); - - // init code - UI.ready(function(context) { - - $("[data-uk-nestable]", context).each(function(){ - - var ele = $(this); - - if(!ele.data("nestable")) { - var plugin = UI.nestable(ele, UI.Utils.options(ele.attr("data-uk-nestable"))); - } - }); - }); - - return UI.nestable; -}); \ No newline at end of file diff --git a/web/js/addons/nestable.min.js b/web/js/addons/nestable.min.js deleted file mode 100755 index 8a337d1..0000000 --- a/web/js/addons/nestable.min.js +++ /dev/null @@ -1,3 +0,0 @@ -/*! UIkit 2.9.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ - -!function(a){var b;jQuery&&jQuery.UIkit&&(b=a(jQuery,jQuery.UIkit)),"function"==typeof define&&define.amd&&define("uikit-nestable",["uikit"],function(){return b||a(jQuery,jQuery.UIkit)})}(function(a,b){var c="ontouchstart"in window,d=a("html"),e=[],f=b.$win,g=function(){var a=document.createElement("div"),b=document.documentElement;if(!("pointerEvents"in a.style))return!1;a.style.pointerEvents="auto",a.style.pointerEvents="x",b.appendChild(a);var c=window.getComputedStyle&&"auto"===window.getComputedStyle(a,"").pointerEvents;return b.removeChild(a),!!c}(),h=c?"touchstart":"mousedown",i=c?"touchmove":"mousemove",j=c?"touchend":"mouseup",k=c?"touchcancel":"mouseup";return b.component("nestable",{defaults:{prefix:"uk",listNodeName:"ul",itemNodeName:"li",listBaseClass:"{prefix}-nestable",listClass:"{prefix}-nestable-list",listitemClass:"{prefix}-nestable-list-item",itemClass:"{prefix}-nestable-item",dragClass:"{prefix}-nestable-list-dragged",movingClass:"{prefix}-nestable-moving",handleClass:"{prefix}-nestable-handle",collapsedClass:"{prefix}-collapsed",placeClass:"{prefix}-nestable-placeholder",noDragClass:"{prefix}-nestable-nodrag",emptyClass:"{prefix}-nestable-empty",group:0,maxDepth:10,threshold:20},init:function(){var b=this;Object.keys(this.options).forEach(function(a){-1!=String(b.options[a]).indexOf("{prefix}")&&(b.options[a]=b.options[a].replace("{prefix}",b.options.prefix))}),this.tplempty='
        ',this.find(">"+this.options.itemNodeName).addClass(this.options.listitemClass).end().find("ul:not(.ignore-list)").addClass(this.options.listClass).find(">li").addClass(this.options.listitemClass),this.element.children(this.options.itemNodeName).length||this.element.append(this.tplempty),this.element.data("nestable-id","ID"+(new Date).getTime()+"RAND"+Math.ceil(1e5*Math.random())),this.reset(),this.element.data("nestable-group",this.options.group),this.placeEl=a('
        '),this.find(this.options.itemNodeName).each(function(){b.setParent(a(this))}),this.on("click","[data-nestable-action]",function(d){if(!b.dragEl&&(c||0===d.button)){d.preventDefault();var e=a(d.currentTarget),f=e.data("nestableAction"),g=e.closest(b.options.itemNodeName);"collapse"===f&&b.collapseItem(g),"expand"===f&&b.expandItem(g),"toggle"===f&&b.toggleItem(g)}});var d=function(d){var e=a(d.target);if(!e.hasClass(b.options.handleClass)){if(e.closest("."+b.options.noDragClass).length)return;e=e.closest("."+b.options.handleClass)}!e.length||b.dragEl||!c&&0!==d.button||c&&1!==d.touches.length||(d.preventDefault(),b.dragStart(c?d.touches[0]:d),b.trigger("nestable-start",[b]))},e=function(a){b.dragEl&&(a.preventDefault(),b.dragMove(c?a.touches[0]:a),b.trigger("nestable-move",[b]))},g=function(a){b.dragEl&&(a.preventDefault(),b.dragStop(c?a.touches[0]:a),b.trigger("nestable-stop",[b]))};c?(this.element[0].addEventListener(h,d,!1),window.addEventListener(i,e,!1),window.addEventListener(j,g,!1),window.addEventListener(k,g,!1)):(this.on(h,d),f.on(i,e),f.on(j,g))},serialize:function(){var b,c=0,d=this;return step=function(b,c){var e=[],f=b.children(d.options.itemNodeName);return f.each(function(){var b=a(this),f=a.extend({},b.data()),g=b.children(d.options.listNodeName);g.length&&(f.children=step(g,c+1)),e.push(f)}),e},b=step(d.element,c)},list:function(b){var c=[],d=this,e=0,b=a.extend({},d.options,b),f=function(d,e,g){var h=d.children(b.itemNodeName);h.each(function(d){var h=a(this),i=a.extend({parent_id:g?g:null,depth:e,order:d},h.data()),j=h.children(b.listNodeName);c.push(i),j.length&&f(j,e+1,h.data(b.idProperty||"id"))})};return f(d.element,e),c},reset:function(){this.mouse={offsetX:0,offsetY:0,startX:0,startY:0,lastX:0,lastY:0,nowX:0,nowY:0,distX:0,distY:0,dirAx:0,dirX:0,dirY:0,lastDirX:0,lastDirY:0,distAxX:0,distAxY:0},this.moving=!1,this.dragEl=null,this.dragRootEl=null,this.dragDepth=0,this.hasNewRoot=!1,this.pointEl=null;for(var a=0;athis.dragDepth&&(this.dragDepth=i);d.addClass(this.options.movingClass)},dragStop:function(){var a=this.dragEl.children(this.options.itemNodeName).first();a[0].parentNode.removeChild(a[0]),this.placeEl.replaceWith(a),this.dragEl.remove(),(this.tmpDragOnSiblings[0]!=a[0].previousSibling||this.tmpDragOnSiblings[0]!=a[0].previousSibling)&&(this.element.trigger("nestable-change",[a,this.hasNewRoot?"added":"moved"]),this.hasNewRoot&&this.dragRootEl.trigger("nestable-change",[a,"removed"])),this.reset(),d.removeClass(this.options.movingClass)},dragMove:function(b){var c,d,f,h,i,j=this.options,k=this.mouse;this.dragEl.css({left:b.pageX-k.offsetX,top:b.pageY-k.offsetY}),k.lastX=k.nowX,k.lastY=k.nowY,k.nowX=b.pageX,k.nowY=b.pageY,k.distX=k.nowX-k.lastX,k.distY=k.nowY-k.lastY,k.lastDirX=k.dirX,k.lastDirY=k.dirY,k.dirX=0===k.distX?0:k.distX>0?1:-1,k.dirY=0===k.distY?0:k.distY>0?1:-1;var l=Math.abs(k.distX)>Math.abs(k.distY)?1:0;if(!k.moving)return k.dirAx=l,void(k.moving=!0);k.dirAx!==l?(k.distAxX=0,k.distAxY=0):(k.distAxX+=Math.abs(k.distX),0!==k.dirX&&k.dirX!==k.lastDirX&&(k.distAxX=0),k.distAxY+=Math.abs(k.distY),0!==k.dirY&&k.dirY!==k.lastDirY&&(k.distAxY=0)),k.dirAx=l,k.dirAx&&k.distAxX>=j.threshold&&(k.distAxX=0,f=this.placeEl.prev(j.itemNodeName),k.distX>0&&f.length&&!f.hasClass(j.collapsedClass)&&(c=f.find(j.listNodeName).last(),i=this.placeEl.parents(j.listNodeName).length,i+this.dragDepth<=j.maxDepth&&(c.length?(c=f.children(j.listNodeName).last(),c.append(this.placeEl)):(c=a("<"+j.listNodeName+"/>").addClass(j.listClass),c.append(this.placeEl),f.append(c),this.setParent(f)))),k.distX<0&&(h=this.placeEl.next(j.itemNodeName),h.length||(d=this.placeEl.parent(),this.placeEl.closest(j.itemNodeName).after(this.placeEl),d.children().length||this.unsetParent(d.parent()))));var m=!1;if(g||(this.dragEl[0].style.visibility="hidden"),this.pointEl=a(document.elementFromPoint(b.pageX-document.body.scrollLeft,b.pageY-(window.pageYOffset||document.documentElement.scrollTop))),g||(this.dragEl[0].style.visibility="visible"),this.pointEl.hasClass(j.handleClass))this.pointEl=this.pointEl.closest(j.itemNodeName);else{var n=this.pointEl.closest("."+j.itemClass);n.length&&(this.pointEl=n.closest(j.itemNodeName))}if(this.pointEl.hasClass(j.emptyClass))m=!0;else if(this.pointEl.data("nestable")&&!this.pointEl.children().length)m=!0,this.pointEl=a(this.tplempty).appendTo(this.pointEl);else if(!this.pointEl.length||!this.pointEl.hasClass(j.listitemClass))return;var o=this.element,p=this.pointEl.closest("."+this.options.listBaseClass),q=o[0]!==this.pointEl.closest("."+this.options.listBaseClass)[0],r=p;if(!k.dirAx||q||m){if(q&&j.group!==r.data("nestable-group"))return;if(e.push(o),i=this.dragDepth-1+this.pointEl.parents(j.listNodeName).length,i>j.maxDepth)return;var s=b.pageY', - '', - '
        '+this.options.message+'
        ', - '
        ' - - ].join('')).data("notifyMessage", this); - - // status - if (this.options.status) { - this.element.addClass('uk-notify-message-'+this.options.status); - this.currentstatus = this.options.status; - } - - this.group = this.options.group; - - messages[this.uuid] = this; - - if(!containers[this.options.pos]) { - containers[this.options.pos] = $('
        ').appendTo('body').on("click", ".uk-notify-message", function(){ - $(this).data("notifyMessage").close(); - }); - } - }; - - - $.extend(Message.prototype, { - - uuid: false, - element: false, - timout: false, - currentstatus: "", - group: false, - - show: function() { - - if (this.element.is(":visible")) return; - - var $this = this; - - containers[this.options.pos].show().prepend(this.element); - - var marginbottom = parseInt(this.element.css("margin-bottom"), 10); - - this.element.css({"opacity":0, "margin-top": -1*this.element.outerHeight(), "margin-bottom":0}).animate({"opacity":1, "margin-top": 0, "margin-bottom":marginbottom}, function(){ - - if ($this.options.timeout) { - - var closefn = function(){ $this.close(); }; - - $this.timeout = setTimeout(closefn, $this.options.timeout); - - $this.element.hover( - function() { clearTimeout($this.timeout); }, - function() { $this.timeout = setTimeout(closefn, $this.options.timeout); } - ); - } - - }); - - return this; - }, - - close: function(instantly) { - - var $this = this, - finalize = function(){ - $this.element.remove(); - - if(!containers[$this.options.pos].children().length) { - containers[$this.options.pos].hide(); - } - - $this.options.onClose.apply($this, []); - - delete messages[$this.uuid]; - }; - - if(this.timeout) clearTimeout(this.timeout); - - if(instantly) { - finalize(); - } else { - this.element.animate({"opacity":0, "margin-top": -1* this.element.outerHeight(), "margin-bottom":0}, function(){ - finalize(); - }); - } - }, - - content: function(html){ - - var container = this.element.find(">div"); - - if(!html) { - return container.html(); - } - - container.html(html); - - return this; - }, - - status: function(status) { - - if(!status) { - return this.currentstatus; - } - - this.element.removeClass('uk-notify-message-'+this.currentstatus).addClass('uk-notify-message-'+status); - - this.currentstatus = status; - - return this; - } - }); - - Message.defaults = { - message: "", - status: "", - timeout: 5000, - group: null, - pos: 'top-center', - onClose: function() {} - }; - - UI.notify = notify; - UI.notify.message = Message; - UI.notify.closeAll = closeAll; - - return notify; -}); \ No newline at end of file diff --git a/web/js/addons/notify.min.js b/web/js/addons/notify.min.js deleted file mode 100755 index eae4dd7..0000000 --- a/web/js/addons/notify.min.js +++ /dev/null @@ -1,3 +0,0 @@ -/*! UIkit 2.9.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ - -!function(a){var b;jQuery&&jQuery.UIkit&&(b=a(jQuery,jQuery.UIkit)),"function"==typeof define&&define.amd&&define("uikit-notify",["uikit"],function(){return b||a(jQuery,jQuery.UIkit)})}(function(a,b){var c={},d={},e=function(b){return"string"==a.type(b)&&(b={message:b}),arguments[1]&&(b=a.extend(b,"string"==a.type(arguments[1])?{status:arguments[1]}:arguments[1])),new g(b).show()},f=function(a,b){if(a)for(var c in d)a===d[c].group&&d[c].close(b);else for(var c in d)d[c].close(b)},g=function(b){this.options=a.extend({},g.defaults,b),this.uuid="ID"+(new Date).getTime()+"RAND"+Math.ceil(1e5*Math.random()),this.element=a(['
        ','',"
        "+this.options.message+"
        ","
        "].join("")).data("notifyMessage",this),this.options.status&&(this.element.addClass("uk-notify-message-"+this.options.status),this.currentstatus=this.options.status),this.group=this.options.group,d[this.uuid]=this,c[this.options.pos]||(c[this.options.pos]=a('
        ').appendTo("body").on("click",".uk-notify-message",function(){a(this).data("notifyMessage").close()}))};return a.extend(g.prototype,{uuid:!1,element:!1,timout:!1,currentstatus:"",group:!1,show:function(){if(!this.element.is(":visible")){var a=this;c[this.options.pos].show().prepend(this.element);var b=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":b},function(){if(a.options.timeout){var b=function(){a.close()};a.timeout=setTimeout(b,a.options.timeout),a.element.hover(function(){clearTimeout(a.timeout)},function(){a.timeout=setTimeout(b,a.options.timeout)})}}),this}},close:function(a){var b=this,e=function(){b.element.remove(),c[b.options.pos].children().length||c[b.options.pos].hide(),b.options.onClose.apply(b,[]),delete d[b.uuid]};this.timeout&&clearTimeout(this.timeout),a?e():this.element.animate({opacity:0,"margin-top":-1*this.element.outerHeight(),"margin-bottom":0},function(){e()})},content:function(a){var b=this.element.find(">div");return a?(b.html(a),this):b.html()},status:function(a){return a?(this.element.removeClass("uk-notify-message-"+this.currentstatus).addClass("uk-notify-message-"+a),this.currentstatus=a,this):this.currentstatus}}),g.defaults={message:"",status:"",timeout:5e3,group:null,pos:"top-center",onClose:function(){}},b.notify=e,b.notify.message=g,b.notify.closeAll=f,e}); \ No newline at end of file diff --git a/web/js/addons/pagination.js b/web/js/addons/pagination.js deleted file mode 100755 index 9ef861c..0000000 --- a/web/js/addons/pagination.js +++ /dev/null @@ -1,146 +0,0 @@ -/*! UIkit 2.9.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) - */ -(function(addon) { - - var component; - - if (jQuery && jQuery.UIkit) { - component = addon(jQuery, jQuery.UIkit); - } - - if (typeof define == "function" && define.amd) { - define("uikit-pagination", ["uikit"], function(){ - return component || addon(jQuery, jQuery.UIkit); - }); - } - -})(function($, UI){ - - "use strict"; - - UI.component('pagination', { - - defaults: { - items : 1, - itemsOnPage : 1, - pages : 0, - displayedPages : 3, - edges : 3, - currentPage : 1, - lblPrev : false, - lblNext : false, - onSelectPage : function() {} - }, - - init: function() { - - 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.halfDisplayed = this.options.displayedPages / 2; - - this.on("click", "a[data-page]", function(e){ - e.preventDefault(); - $this.selectPage($(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(pages) { - this.pages = pages ? pages : this.pages; - this._render(); - }, - - selectPage: function(pageIndex, pages) { - this.currentPage = pageIndex; - this.render(pages); - - this.options.onSelectPage.apply(this, [pageIndex]); - this.trigger('uk-select-page', [pageIndex, this]); - }, - - _render: function() { - - var o = this.options, interval = this._getInterval(), i; - - this.element.empty(); - - // Generate Prev link - if (o.lblPrev) this._append(o.currentPage - 1, {text: o.lblPrev}); - - // Generate start edges - if (interval.start > 0 && o.edges > 0) { - - var end = Math.min(o.edges, interval.start); - - for (i = 0; i < end; i++) this._append(i); - - if (o.edges < interval.start && (interval.start - o.edges != 1)) { - this.element.append('
      • ...
      • '); - } else if (interval.start - o.edges == 1) { - this._append(o.edges); - } - } - - // Generate interval links - for (i = interval.start; i < interval.end; i++) this._append(i); - - // Generate end edges - if (interval.end < this.pages && o.edges > 0) { - - if (this.pages - o.edges > interval.end && (this.pages - o.edges - interval.end != 1)) { - this.element.append('
      • ...
      • '); - } else if (this.pages - o.edges - interval.end == 1) { - this._append(interval.end++); - } - - var begin = Math.max(this.pages - o.edges, interval.end); - - for (i = begin; i < this.pages; i++) this._append(i); - } - - // Generate Next link (unless option is set for at front) - if (o.lblNext) this._append(o.currentPage + 1, {text: o.lblNext}); - }, - - _append: function(pageIndex, opts) { - - var $this = this, item, link, options; - - pageIndex = pageIndex < 0 ? 0 : (pageIndex < this.pages ? pageIndex : this.pages - 1); - options = $.extend({ text: pageIndex + 1 }, opts); - - item = (pageIndex == this.currentPage) ? '
      • ' + (options.text) + '
      • ' - : '
      • '+options.text+'
      • '; - - this.element.append(item); - } - }); - - // init code - UI.ready(function(context) { - - $("[data-uk-pagination]", context).each(function(){ - var ele = $(this); - - if (!ele.data("pagination")) { - var obj = UI.pagination(ele, UI.Utils.options(ele.attr("data-uk-pagination"))); - } - }); - }); - - return UI.pagination; -}); \ No newline at end of file diff --git a/web/js/addons/pagination.min.js b/web/js/addons/pagination.min.js deleted file mode 100755 index 95aef5d..0000000 --- a/web/js/addons/pagination.min.js +++ /dev/null @@ -1,3 +0,0 @@ -/*! UIkit 2.9.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ - -!function(a){var b;jQuery&&jQuery.UIkit&&(b=a(jQuery,jQuery.UIkit)),"function"==typeof define&&define.amd&&define("uikit-pagination",["uikit"],function(){return b||a(jQuery,jQuery.UIkit)})}(function(a,b){"use strict";return b.component("pagination",{defaults:{items:1,itemsOnPage:1,pages:0,displayedPages:3,edges:3,currentPage:1,lblPrev:!1,lblNext:!1,onSelectPage:function(){}},init:function(){var b=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(c){c.preventDefault(),b.selectPage(a(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(a){this.pages=a?a:this.pages,this._render()},selectPage:function(a,b){this.currentPage=a,this.render(b),this.options.onSelectPage.apply(this,[a]),this.trigger("uk-select-page",[a,this])},_render:function(){var a,b=this.options,c=this._getInterval();if(this.element.empty(),b.lblPrev&&this._append(b.currentPage-1,{text:b.lblPrev}),c.start>0&&b.edges>0){var d=Math.min(b.edges,c.start);for(a=0;d>a;a++)this._append(a);b.edges..."):c.start-b.edges==1&&this._append(b.edges)}for(a=c.start;a0){this.pages-b.edges>c.end&&this.pages-b.edges-c.end!=1?this.element.append("
      • ...
      • "):this.pages-b.edges-c.end==1&&this._append(c.end++);var e=Math.max(this.pages-b.edges,c.end);for(a=e;ab?0:b'+e.text+"":'
      • '+e.text+"
      • ",this.element.append(d)}}),b.ready(function(c){a("[data-uk-pagination]",c).each(function(){var c=a(this);if(!c.data("pagination")){b.pagination(c,b.Utils.options(c.attr("data-uk-pagination")))}})}),b.pagination}); \ No newline at end of file diff --git a/web/js/addons/search.js b/web/js/addons/search.js deleted file mode 100755 index fbf3852..0000000 --- a/web/js/addons/search.js +++ /dev/null @@ -1,90 +0,0 @@ -/*! UIkit 2.9.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ - -(function(addon) { - - var component; - - if (jQuery && jQuery.UIkit) { - component = addon(jQuery, jQuery.UIkit); - } - - if (typeof define == "function" && define.amd) { - define("uikit-search", ["uikit"], function(){ - return component || addon(jQuery, jQuery.UIkit); - }); - } - -})(function($, UI){ - - "use strict"; - - UI.component('search', { - defaults: { - msgResultsHeader : 'Search Results', - msgMoreResults : 'More Results', - msgNoResults : 'No results found', - template : '', - - renderer: function(data) { - - var $this = this, opts = this.options; - - this.dropdown.append(this.template({"items":data.results || [], "msgResultsHeader":opts.msgResultsHeader, "msgMoreResults": opts.msgMoreResults, "msgNoResults": opts.msgNoResults})); - this.show(); - } - }, - - init: function() { - var $this = this; - - this.autocomplete = UI.autocomplete(this.element, this.options); - - this.autocomplete.dropdown.addClass('uk-dropdown-search'); - - this.autocomplete.input.on("keyup", function(){ - $this.element[$this.autocomplete.input.val() ? "addClass":"removeClass"]("uk-active"); - }).closest("form").on("reset", function(){ - $this.value=""; - $this.element.removeClass("uk-active"); - }); - - this.on('autocomplete-select', function(e, data) { - if (data.url) { - location.href = data.url; - } else if(data.moreresults) { - this.autocomplete.input.closest('form').submit(); - } - }); - - this.element.data("search", this); - } - }); - - // init code - UI.$doc.on("focus.search.uikit", "[data-uk-search]", function(e) { - var ele = $(this); - - if (!ele.data("search")) { - var obj = UI.search(ele, UI.Utils.options(ele.attr("data-uk-search"))); - } - }); -}); \ No newline at end of file diff --git a/web/js/addons/search.min.js b/web/js/addons/search.min.js deleted file mode 100755 index b34eccc..0000000 --- a/web/js/addons/search.min.js +++ /dev/null @@ -1,3 +0,0 @@ -/*! UIkit 2.9.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ - -!function(a){var b;jQuery&&jQuery.UIkit&&(b=a(jQuery,jQuery.UIkit)),"function"==typeof define&&define.amd&&define("uikit-search",["uikit"],function(){return b||a(jQuery,jQuery.UIkit)})}(function(a,b){"use strict";b.component("search",{defaults:{msgResultsHeader:"Search Results",msgMoreResults:"More Results",msgNoResults:"No results found",template:'',renderer:function(a){var b=this.options;this.dropdown.append(this.template({items:a.results||[],msgResultsHeader:b.msgResultsHeader,msgMoreResults:b.msgMoreResults,msgNoResults:b.msgNoResults})),this.show()}},init:function(){var a=this;this.autocomplete=b.autocomplete(this.element,this.options),this.autocomplete.dropdown.addClass("uk-dropdown-search"),this.autocomplete.input.on("keyup",function(){a.element[a.autocomplete.input.val()?"addClass":"removeClass"]("uk-active")}).closest("form").on("reset",function(){a.value="",a.element.removeClass("uk-active")}),this.on("autocomplete-select",function(a,b){b.url?location.href=b.url:b.moreresults&&this.autocomplete.input.closest("form").submit()}),this.element.data("search",this)}}),b.$doc.on("focus.search.uikit","[data-uk-search]",function(){var c=a(this);if(!c.data("search")){b.search(c,b.Utils.options(c.attr("data-uk-search")))}})}); \ No newline at end of file diff --git a/web/js/addons/sortable.js b/web/js/addons/sortable.js deleted file mode 100755 index 135f685..0000000 --- a/web/js/addons/sortable.js +++ /dev/null @@ -1,514 +0,0 @@ -/*! UIkit 2.9.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ - -/* - * Based on nativesortable - Copyright (c) Brian Grinstead - https://github.com/bgrins/nativesortable - */ -(function(addon) { - - var component; - - if (jQuery && jQuery.UIkit) { - component = addon(jQuery, jQuery.UIkit); - } - - if (typeof define == "function" && define.amd) { - define("uikit-sortable", ["uikit"], function(){ - return component || addon(jQuery, jQuery.UIkit); - }); - } - -})(function($, UI){ - - "use strict"; - - var supportsTouch = ('ontouchstart' in window) || (window.DocumentTouch && document instanceof DocumentTouch), - supportsDragAndDrop = !supportsTouch && (function() { - var div = document.createElement('div'); - return ('draggable' in div) || ('ondragstart' in div && 'ondrop' in div); - })(), - - draggingPlaceholder, moving, dragging, clickedlink, delayIdle; - - // disable native dragndrop support for now - supportsDragAndDrop = false; - - UI.component('sortable', { - - defaults: { - - warp : false, - animation : 150, - threshold : 10, - - childClass : 'uk-sortable-item', - placeholderClass : 'uk-sortable-placeholder', - overClass : 'uk-sortable-over', - draggingClass : 'uk-sortable-dragged', - dragMovingClass : 'uk-sortable-moving', - dragCustomClass : '', - handleClass : false, - - stop : function() {}, - start : function() {}, - change : function() {} - }, - - init: function() { - - var $this = this, - element = this.element[0], - currentlyDraggingElement = null, - currentlyDraggingTarget = null, - children; - - if (supportsDragAndDrop) { - this.element.children().attr("draggable", "true"); - - } else { - - // prevent leaving page after link clicking - this.element.on('mousedown touchstart', 'a[href]', function(e) { - clickedlink = $(this); - }).on('click', 'a[href]', function(e) { - clickedlink = $(this); - e.stopImmediatePropagation(); - return false; - }); - } - - var handleDragStart = delegate(function(e) { - - moving = false; - dragging = false; - - var target = $(e.target), children = $this.element.children(); - - if (!supportsTouch && e.button==2) { - return; - } - - if ($this.options.handleClass) { - - var handle = target.hasClass($this.options.handleClass) ? target : target.closest('.'+$this.options.handleClass, element); - - if (!handle.length) { - //e.preventDefault(); - return; - } - } - - if (e.dataTransfer) { - e.dataTransfer.effectAllowed = 'move'; - e.dataTransfer.dropEffect = 'move'; - e.dataTransfer.setData('Text', "*"); // Need to set to something or else drag doesn't start - } - - currentlyDraggingElement = this; - - // init drag placeholder - if (draggingPlaceholder) draggingPlaceholder.remove(); - - var $current = $(currentlyDraggingElement), offset = $current.offset(); - - delayIdle = { - - pos : { x:e.pageX, y:e.pageY }, - threshold : $this.options.threshold, - 'apply' : function() { - - draggingPlaceholder = $('
        ').css({ - display : 'none', - top : offset.top, - left : offset.left, - width : $current.width(), - height : $current.height(), - padding : $current.css('padding') - }).data('mouse-offset', { - 'left': offset.left - parseInt(e.pageX, 10), - 'top' : offset.top - parseInt(e.pageY, 10) - }).append($current.html()).appendTo('body'); - - draggingPlaceholder.$current = $current; - draggingPlaceholder.$sortable = $this; - - addFakeDragHandlers(); - - $this.options.start(this, currentlyDraggingElement); - $this.trigger('sortable-start', [$this, currentlyDraggingElement]); - - delayIdle = false; - } - } - - if (!supportsDragAndDrop) { - e.preventDefault(); - } - }); - - var handleDragOver = delegate(function(e) { - - if (!currentlyDraggingElement) { - return true; - } - - if (e.preventDefault) { - e.preventDefault(); - } - - return false; - }); - - var handleDragEnter = delegate($.UIkit.Utils.debounce(function(e) { - - if (!currentlyDraggingElement || currentlyDraggingElement === this) { - return true; - } - - // Prevent dragenter on a child from allowing a dragleave on the container - var previousCounter = $this.dragenterData(this); - - $this.dragenterData(this, previousCounter + 1); - - if (previousCounter === 0) { - - $(this).addClass($this.options.overClass); - - if (!$this.options.warp) { - $this.moveElementNextTo(currentlyDraggingElement, this); - } - } - - return false; - }), 40); - - var handleDragLeave = delegate(function(e) { - - // Prevent dragenter on a child from allowing a dragleave on the container - var previousCounter = $this.dragenterData(this); - $this.dragenterData(this, previousCounter - 1); - - // This is a fix for child elements firing dragenter before the parent fires dragleave - if (!$this.dragenterData(this)) { - $(this).removeClass($this.options.overClass); - $this.dragenterData(this, false); - } - }); - - var handleDrop = delegate(function(e) { - - - if (e.type === 'drop') { - - if (e.stopPropagation) { - e.stopPropagation(); - } - - if (e.preventDefault) { - e.preventDefault(); - } - } - - if (!dragging) { - return; - } - - if ($this.options.warp) { - var thisSibling = currentlyDraggingElement.nextSibling; - this.parentNode.insertBefore(currentlyDraggingElement, this); - this.parentNode.insertBefore(this, thisSibling); - } - - $this.options.change(this, currentlyDraggingElement); - $this.trigger('sortable-change', [$this, currentlyDraggingElement]); - }); - - var handleDragEnd = function(e) { - - currentlyDraggingElement = null; - currentlyDraggingTarget = null; - - $this.element.children().each(function() { - if (this.nodeType === 1) { - $(this).removeClass($this.options.overClass).removeClass($this.options.placeholderClass).removeClass($this.options.childClass); - $this.dragenterData(this, false); - } - }); - - $('html').removeClass($this.options.dragMovingClass); - - removeFakeDragHandlers(); - - $this.options.stop(this); - $this.trigger('sortable-stop', [$this]); - - draggingPlaceholder.remove(); - draggingPlaceholder = null; - }; - - var handleTouchMove = delegate(function(e) { - - if (!currentlyDraggingElement || - currentlyDraggingElement === this || - currentlyDraggingTarget === this) { - return true; - } - - children.removeClass($this.options.overClass); - currentlyDraggingTarget = this; - - if (!$this.options.warp) { - $this.moveElementNextTo(currentlyDraggingElement, this); - } else { - $(this).addClass($this.options.overClass); - } - - return prevent(e); - }); - - function delegate(fn) { - return function(e) { - - var touch = (supportsTouch && e.touches && e.touches[0]) || { }, - target = touch.target || e.target; - - // Fix event.target for a touch event - if (supportsTouch && document.elementFromPoint) { - target = document.elementFromPoint(e.pageX - document.body.scrollLeft, e.pageY - document.body.scrollTop); - } - - if ($(target).hasClass($this.options.childClass)) { - fn.apply(target, [e]); - } else if (target !== element) { - - // If a child is initiating the event or ending it, then use the container as context for the callback. - var context = moveUpToChildNode(element, target); - - if (context) { - fn.apply(context, [e]); - } - } - }; - } - - // Opera and mobile devices do not support drag and drop. http://caniuse.com/dragndrop - // Bind/unbind standard mouse/touch events as a polyfill. - function addFakeDragHandlers() { - if (!supportsDragAndDrop) { - if (supportsTouch) { - element.addEventListener("touchmove", handleTouchMove, false); - } else { - element.addEventListener('mouseover', handleDragEnter, false); - element.addEventListener('mouseout', handleDragLeave, false); - } - - element.addEventListener(supportsTouch ? 'touchend' : 'mouseup', handleDrop, false); - document.addEventListener(supportsTouch ? 'touchend' : 'mouseup', handleDragEnd, false); - document.addEventListener("selectstart", prevent, false); - - } - } - - function removeFakeDragHandlers() { - if (!supportsDragAndDrop) { - if (supportsTouch) { - element.removeEventListener("touchmove", handleTouchMove, false); - } else { - element.removeEventListener('mouseover', handleDragEnter, false); - element.removeEventListener('mouseout', handleDragLeave, false); - } - - element.removeEventListener(supportsTouch ? 'touchend' : 'mouseup', handleDrop, false); - document.removeEventListener(supportsTouch ? 'touchend' : 'mouseup', handleDragEnd, false); - document.removeEventListener("selectstart", prevent, false); - } - } - - if (supportsDragAndDrop) { - element.addEventListener('dragstart', handleDragStart, false); - element.addEventListener('dragenter', handleDragEnter, false); - element.addEventListener('dragleave', handleDragLeave, false); - element.addEventListener('drop', handleDrop, false); - element.addEventListener('dragover', handleDragOver, false); - element.addEventListener('dragend', handleDragEnd, false); - } else { - - element.addEventListener(supportsTouch ? 'touchstart':'mousedown', handleDragStart, false); - } - }, - - dragenterData: function(element, val) { - - element = $(element); - - if (arguments.length == 1) { - return parseInt(element.attr('data-child-dragenter'), 10) || 0; - } else if (!val) { - element.removeAttr('data-child-dragenter'); - } else { - element.attr('data-child-dragenter', Math.max(0, val)); - } - }, - - moveElementNextTo: function(element, elementToMoveNextTo) { - - dragging = true; - - var $this = this, - list = $(element).parent().css('min-height', ''), - next = isBelow(element, elementToMoveNextTo) ? elementToMoveNextTo : elementToMoveNextTo.nextSibling, - children = list.children(), - count = children.length; - - if($this.options.warp || !$this.options.animation) { - elementToMoveNextTo.parentNode.insertBefore(element, next); - UI.Utils.checkDisplay($this.element); - return; - } - - list.css('min-height', list.height()); - - children.stop().each(function(){ - var ele = $(this), - offset = ele.position(); - - offset.width = ele.width(); - - ele.data('offset-before', offset); - }); - - elementToMoveNextTo.parentNode.insertBefore(element, next); - - children = list.children().each(function() { - var ele = $(this); - ele.data('offset-after', ele.position()); - }).each(function() { - var ele = $(this), - before = ele.data('offset-before'); - ele.css({'position':'absolute', 'top':before.top, 'left':before.left, 'min-width':before.width }); - }); - - children.each(function(){ - - var ele = $(this), - before = ele.data('offset-before'), - offset = ele.data('offset-after'); - - ele.css('pointer-events', 'none').width(); - - setTimeout(function(){ - ele.animate({'top':offset.top, 'left':offset.left}, $this.options.animation, function() { - ele.css({'position':'','top':'', 'left':'', 'min-width': '', 'pointer-events':''}).removeClass($this.options.overClass).attr('data-child-dragenter', ''); - count-- - if (!count) { - list.css('min-height', ''); - UI.Utils.checkDisplay(ele); - } - }); - }, 0); - }); - - - } - }); - - // helpers - - function isBelow(el1, el2) { - - var parent = el1.parentNode; - - if (el2.parentNode != parent) { - return false; - } - - var cur = el1.previousSibling; - - while (cur && cur.nodeType !== 9) { - if (cur === el2) { - return true; - } - cur = cur.previousSibling; - } - - return false; - } - - function moveUpToChildNode(parent, child) { - var cur = child; - if (cur == parent) { return null; } - - while (cur) { - if (cur.parentNode === parent) { - return cur; - } - - cur = cur.parentNode; - if ( !cur || !cur.ownerDocument || cur.nodeType === 11 ) { - break; - } - } - return null; - } - - function prevent(e) { - if (e.stopPropagation) { - e.stopPropagation(); - } - if (e.preventDefault) { - e.preventDefault(); - } - e.returnValue = false; - } - - // auto init - UI.ready(function(context) { - - $("[data-uk-sortable]", context).each(function(){ - - var ele = $(this); - - if(!ele.data("sortable")) { - var plugin = UI.sortable(ele, UI.Utils.options(ele.attr("data-uk-sortable"))); - } - }); - }); - - UI.$doc.on('mousemove touchmove', function(e) { - - if (delayIdle) { - if (Math.abs(e.pageX - delayIdle.pos.x) > delayIdle.threshold || Math.abs(e.pageY - delayIdle.pos.y) > delayIdle.threshold) { - delayIdle.apply(); - } - } - - if (draggingPlaceholder) { - - if (!moving) { - moving = true; - draggingPlaceholder.show(); - - draggingPlaceholder.$current.addClass(draggingPlaceholder.$sortable.options.placeholderClass); - draggingPlaceholder.$sortable.element.children().addClass(draggingPlaceholder.$sortable.options.childClass); - - $('html').addClass(draggingPlaceholder.$sortable.options.dragMovingClass); - } - - var offset = draggingPlaceholder.data('mouse-offset'), - left = parseInt(e.originalEvent.pageX, 10) + offset.left, - top = parseInt(e.originalEvent.pageY, 10) + offset.top; - - draggingPlaceholder.css({'left': left, 'top': top }); - } - }); - - UI.$doc.on('mouseup touchend', function() { - - if(!moving && clickedlink) { - location.href = clickedlink.attr('href'); - } - - delayIdle = clickedlink = false; - }); - - return UI.sortable; -}); \ No newline at end of file diff --git a/web/js/addons/sortable.min.js b/web/js/addons/sortable.min.js deleted file mode 100755 index 2347600..0000000 --- a/web/js/addons/sortable.min.js +++ /dev/null @@ -1,3 +0,0 @@ -/*! UIkit 2.9.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ - -!function(a){var b;jQuery&&jQuery.UIkit&&(b=a(jQuery,jQuery.UIkit)),"function"==typeof define&&define.amd&&define("uikit-sortable",["uikit"],function(){return b||a(jQuery,jQuery.UIkit)})}(function(a,b){"use strict";function c(a,b){var c=a.parentNode;if(b.parentNode!=c)return!1;for(var d=a.previousSibling;d&&9!==d.nodeType;){if(d===b)return!0;d=d.previousSibling}return!1}function d(a,b){var c=b;if(c==a)return null;for(;c;){if(c.parentNode===a)return c;if(c=c.parentNode,!c||!c.ownerDocument||11===c.nodeType)break}return null}function e(a){a.stopPropagation&&a.stopPropagation(),a.preventDefault&&a.preventDefault(),a.returnValue=!1}var f,g,h,i,j,k="ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch,l=!k&&function(){var a=document.createElement("div");return"draggable"in a||"ondragstart"in a&&"ondrop"in a}();return l=!1,b.component("sortable",{defaults:{warp:!1,animation:150,threshold:10,childClass:"uk-sortable-item",placeholderClass:"uk-sortable-placeholder",overClass:"uk-sortable-over",draggingClass:"uk-sortable-dragged",dragMovingClass:"uk-sortable-moving",dragCustomClass:"",handleClass:!1,stop:function(){},start:function(){},change:function(){}},init:function(){function b(b){return function(c){var e=k&&c.touches&&c.touches[0]||{},f=e.target||c.target;if(k&&document.elementFromPoint&&(f=document.elementFromPoint(c.pageX-document.body.scrollLeft,c.pageY-document.body.scrollTop)),a(f).hasClass(o.options.childClass))b.apply(f,[c]);else if(f!==p){var g=d(p,f);g&&b.apply(g,[c])}}}function c(){l||(k?p.addEventListener("touchmove",y,!1):(p.addEventListener("mouseover",u,!1),p.addEventListener("mouseout",v,!1)),p.addEventListener(k?"touchend":"mouseup",w,!1),document.addEventListener(k?"touchend":"mouseup",x,!1),document.addEventListener("selectstart",e,!1))}function m(){l||(k?p.removeEventListener("touchmove",y,!1):(p.removeEventListener("mouseover",u,!1),p.removeEventListener("mouseout",v,!1)),p.removeEventListener(k?"touchend":"mouseup",w,!1),document.removeEventListener(k?"touchend":"mouseup",x,!1),document.removeEventListener("selectstart",e,!1))}var n,o=this,p=this.element[0],q=null,r=null;l?this.element.children().attr("draggable","true"):this.element.on("mousedown touchstart","a[href]",function(){i=a(this)}).on("click","a[href]",function(b){return i=a(this),b.stopImmediatePropagation(),!1});var s=b(function(b){g=!1,h=!1;{var d=a(b.target);o.element.children()}if(k||2!=b.button){if(o.options.handleClass){var e=d.hasClass(o.options.handleClass)?d:d.closest("."+o.options.handleClass,p);if(!e.length)return}b.dataTransfer&&(b.dataTransfer.effectAllowed="move",b.dataTransfer.dropEffect="move",b.dataTransfer.setData("Text","*")),q=this,f&&f.remove();var i=a(q),m=i.offset();j={pos:{x:b.pageX,y:b.pageY},threshold:o.options.threshold,apply:function(){f=a('
        ').css({display:"none",top:m.top,left:m.left,width:i.width(),height:i.height(),padding:i.css("padding")}).data("mouse-offset",{left:m.left-parseInt(b.pageX,10),top:m.top-parseInt(b.pageY,10)}).append(i.html()).appendTo("body"),f.$current=i,f.$sortable=o,c(),o.options.start(this,q),o.trigger("sortable-start",[o,q]),j=!1}},l||b.preventDefault()}}),t=b(function(a){return q?(a.preventDefault&&a.preventDefault(),!1):!0}),u=b(a.UIkit.Utils.debounce(function(){if(!q||q===this)return!0;var b=o.dragenterData(this);return o.dragenterData(this,b+1),0===b&&(a(this).addClass(o.options.overClass),o.options.warp||o.moveElementNextTo(q,this)),!1}),40),v=b(function(){var b=o.dragenterData(this);o.dragenterData(this,b-1),o.dragenterData(this)||(a(this).removeClass(o.options.overClass),o.dragenterData(this,!1))}),w=b(function(a){if("drop"===a.type&&(a.stopPropagation&&a.stopPropagation(),a.preventDefault&&a.preventDefault()),h){if(o.options.warp){var b=q.nextSibling;this.parentNode.insertBefore(q,this),this.parentNode.insertBefore(this,b)}o.options.change(this,q),o.trigger("sortable-change",[o,q])}}),x=function(){q=null,r=null,o.element.children().each(function(){1===this.nodeType&&(a(this).removeClass(o.options.overClass).removeClass(o.options.placeholderClass).removeClass(o.options.childClass),o.dragenterData(this,!1))}),a("html").removeClass(o.options.dragMovingClass),m(),o.options.stop(this),o.trigger("sortable-stop",[o]),f.remove(),f=null},y=b(function(b){return q&&q!==this&&r!==this?(n.removeClass(o.options.overClass),r=this,o.options.warp?a(this).addClass(o.options.overClass):o.moveElementNextTo(q,this),e(b)):!0});l?(p.addEventListener("dragstart",s,!1),p.addEventListener("dragenter",u,!1),p.addEventListener("dragleave",v,!1),p.addEventListener("drop",w,!1),p.addEventListener("dragover",t,!1),p.addEventListener("dragend",x,!1)):p.addEventListener(k?"touchstart":"mousedown",s,!1)},dragenterData:function(b,c){return b=a(b),1==arguments.length?parseInt(b.attr("data-child-dragenter"),10)||0:void(c?b.attr("data-child-dragenter",Math.max(0,c)):b.removeAttr("data-child-dragenter"))},moveElementNextTo:function(d,e){h=!0;var f=this,g=a(d).parent().css("min-height",""),i=c(d,e)?e:e.nextSibling,j=g.children(),k=j.length;return f.options.warp||!f.options.animation?(e.parentNode.insertBefore(d,i),void b.Utils.checkDisplay(f.element)):(g.css("min-height",g.height()),j.stop().each(function(){var b=a(this),c=b.position();c.width=b.width(),b.data("offset-before",c)}),e.parentNode.insertBefore(d,i),j=g.children().each(function(){var b=a(this);b.data("offset-after",b.position())}).each(function(){var b=a(this),c=b.data("offset-before");b.css({position:"absolute",top:c.top,left:c.left,"min-width":c.width})}),void j.each(function(){var c=a(this),d=(c.data("offset-before"),c.data("offset-after"));c.css("pointer-events","none").width(),setTimeout(function(){c.animate({top:d.top,left:d.left},f.options.animation,function(){c.css({position:"",top:"",left:"","min-width":"","pointer-events":""}).removeClass(f.options.overClass).attr("data-child-dragenter",""),k--,k||(g.css("min-height",""),b.Utils.checkDisplay(c))})},0)}))}}),b.ready(function(c){a("[data-uk-sortable]",c).each(function(){var c=a(this);if(!c.data("sortable")){b.sortable(c,b.Utils.options(c.attr("data-uk-sortable")))}})}),b.$doc.on("mousemove touchmove",function(b){if(j&&(Math.abs(b.pageX-j.pos.x)>j.threshold||Math.abs(b.pageY-j.pos.y)>j.threshold)&&j.apply(),f){g||(g=!0,f.show(),f.$current.addClass(f.$sortable.options.placeholderClass),f.$sortable.element.children().addClass(f.$sortable.options.childClass),a("html").addClass(f.$sortable.options.dragMovingClass));var c=f.data("mouse-offset"),d=parseInt(b.originalEvent.pageX,10)+c.left,e=parseInt(b.originalEvent.pageY,10)+c.top;f.css({left:d,top:e})}}),b.$doc.on("mouseup touchend",function(){!g&&i&&(location.href=i.attr("href")),j=i=!1}),b.sortable}); \ No newline at end of file diff --git a/web/js/addons/sticky.js b/web/js/addons/sticky.js deleted file mode 100755 index d36e896..0000000 --- a/web/js/addons/sticky.js +++ /dev/null @@ -1,241 +0,0 @@ -/*! UIkit 2.9.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ - -(function(addon) { - - var component; - - if (jQuery && jQuery.UIkit) { - component = addon(jQuery, jQuery.UIkit); - } - - if (typeof define == "function" && define.amd) { - define("uikit-sticky", ["uikit"], function(){ - return component || addon(jQuery, jQuery.UIkit); - }); - } - -})(function($, UI){ - - var $win = UI.$win, - $doc = UI.$doc, - sticked = []; - - UI.component('sticky', { - - defaults: { - top : 0, - bottom : 0, - animation : '', - clsinit : 'uk-sticky-init', - clsactive : 'uk-active', - getWidthFrom : '', - media : false, - target : false - }, - - init: function() { - - var stickyId = this.element.attr('id') || ("s"+Math.ceil(Math.random()*10000)), - 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") - }); - - wrapper = this.element.css('margin', 0).wrap(wrapper).parent(); - - this.sticky = { - options : this.options, - element : this.element, - currentTop : null, - wrapper : wrapper, - init : false, - getWidthFrom : this.options.getWidthFrom || wrapper, - reset : function(force) { - - 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.currentTop = null; - this.animate = false; - }.bind(this); - - - if (!force && this.options.animation && UI.support.animation) { - - this.animate = true; - - this.element.removeClass(this.options.animation).one(UI.support.animation.end, function(){ - finalize(); - }).width(); // force redraw - - this.element.addClass(this.options.animation+' '+'uk-animation-reverse'); - } else { - finalize(); - } - }, - check: function() { - - if (this.options.media) { - - switch(typeof(this.options.media)) { - case 'number': - if (window.innerWidth < this.options.media) { - return false; - } - break; - case 'string': - if (window.matchMedia && !window.matchMedia(this.options.media).matches) { - return false; - } - break; - } - } - - var scrollTop = $win.scrollTop(), - documentHeight = $doc.height(), - dwh = documentHeight - $win.height(), - extra = (scrollTop > dwh) ? dwh - scrollTop : 0, - elementTop = this.wrapper.offset().top, - etse = elementTop - this.options.top - extra; - - return (scrollTop >= etse); - } - }; - - sticked.push(this.sticky); - }, - - update: function() { - scroller(); - } - }); - - function scroller() { - - if (!sticked.length) return; - - var scrollTop = $win.scrollTop(), - documentHeight = $doc.height(), - dwh = documentHeight - $win.height(), - extra = (scrollTop > dwh) ? dwh - scrollTop : 0, - cls, newTop; - - if(scrollTop < 0) return; - - - for (var i = 0; i < sticked.length; i++) { - - if (!sticked[i].element.is(":visible") || sticked[i].animate) { - continue; - } - - var sticky = sticked[i]; - - if (!sticky.check()) { - - if (sticky.currentTop !== null) { - sticky.reset(); - } - - } else { - - if (sticky.options.top < 0) { - newTop = 0; - } else { - newTop = documentHeight - sticky.element.outerHeight() - sticky.options.top - sticky.options.bottom - scrollTop - extra; - newTop = newTop < 0 ? newTop + sticky.options.top : sticky.options.top; - } - - if (sticky.currentTop != newTop) { - - sticky.element.css({ - "position" : "fixed", - "top" : newTop, - "width" : (typeof sticky.getWidthFrom !== 'undefined') ? $(sticky.getWidthFrom).width() : sticky.element.width(), - "left" : sticky.wrapper.offset().left - }); - - if (!sticky.init) { - - sticky.element.addClass(sticky.options.clsinit); - - if (location.hash && scrollTop > 0 && sticky.options.target) { - - var $target = $(location.hash); - - if ($target.length) { - - setTimeout((function($target, sticky){ - - return function() { - - sticky.element.width(); // force redraw - - var offset = $target.offset(), - maxoffset = offset.top + $target.outerHeight(), - stickyOffset = sticky.element.offset(), - stickyHeight = sticky.element.outerHeight(), - stickyMaxOffset = stickyOffset.top + stickyHeight; - - if (stickyOffset.top < maxoffset && offset.top < stickyMaxOffset) { - scrollTop = offset.top - stickyHeight - sticky.options.target; - window.scrollTo(0, scrollTop); - } - }; - - })($target, sticky), 0); - } - } - } - - sticky.element.addClass(sticky.options.clsactive); - sticky.element.css('margin', ''); - - if (sticky.options.animation && sticky.init) { - sticky.element.addClass(sticky.options.animation); - } - - sticky.currentTop = newTop; - } - } - - sticky.init = true; - } - - } - - // should be more efficient than using $win.scroll(scroller): - $doc.on('uk-scroll', scroller); - $win.on('resize orientationchange', UI.Utils.debounce(function() { - - if (!sticked.length) return; - - for (var i = 0; i < sticked.length; i++) { - sticked[i].reset(true); - } - - scroller(); - }, 100)); - - // init code - UI.ready(function(context) { - - setTimeout(function(){ - - $("[data-uk-sticky]", context).each(function(){ - - var $ele = $(this); - - if(!$ele.data("sticky")) { - UI.sticky($ele, UI.Utils.options($ele.attr('data-uk-sticky'))); - } - }); - - scroller(); - }, 0); - }); - - return $.fn.uksticky; -}); \ No newline at end of file diff --git a/web/js/addons/sticky.min.js b/web/js/addons/sticky.min.js deleted file mode 100755 index 5d43ba0..0000000 --- a/web/js/addons/sticky.min.js +++ /dev/null @@ -1,3 +0,0 @@ -/*! UIkit 2.9.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ - -!function(a){var b;jQuery&&jQuery.UIkit&&(b=a(jQuery,jQuery.UIkit)),"function"==typeof define&&define.amd&&define("uikit-sticky",["uikit"],function(){return b||a(jQuery,jQuery.UIkit)})}(function(a,b){function c(){if(f.length){var b,c=d.scrollTop(),g=e.height(),h=g-d.height(),i=c>h?h-c:0;if(!(0>c))for(var j=0;jb?b+k.options.top:k.options.top),k.currentTop!=b){if(k.element.css({position:"fixed",top:b,width:"undefined"!=typeof k.getWidthFrom?a(k.getWidthFrom).width():k.element.width(),left:k.wrapper.offset().left}),!k.init&&(k.element.addClass(k.options.clsinit),location.hash&&c>0&&k.options.target)){var l=a(location.hash);l.length&&setTimeout(function(a,b){return function(){b.element.width();var d=a.offset(),e=d.top+a.outerHeight(),f=b.element.offset(),g=b.element.outerHeight(),h=f.top+g;f.top
        ').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")}));c=this.element.css("margin",0).wrap(c).parent(),this.sticky={options:this.options,element:this.element,currentTop:null,wrapper:c,init:!1,getWidthFrom:this.options.getWidthFrom||c,reset:function(a){var c=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);!a&&this.options.animation&&b.support.animation?(this.animate=!0,this.element.removeClass(this.options.animation).one(b.support.animation.end,function(){c()}).width(),this.element.addClass(this.options.animation+" uk-animation-reverse")):c()},check:function(){if(this.options.media)switch(typeof this.options.media){case"number":if(window.innerWidthc?c-a:0,g=this.wrapper.offset().top,h=g-this.options.top-f;return a>=h}},f.push(this.sticky)},update:function(){c()}}),e.on("uk-scroll",c),d.on("resize orientationchange",b.Utils.debounce(function(){if(f.length){for(var a=0;a 12) { - - h = h-12; - - if (h < 10) h = '0'+String(h); - - times['12h'].push({value: (h+':00 PM')}); - times['12h'].push({value: (h+':30 PM')}); - } - } - - - UI.component('timepicker', { - - defaults: { - format : '24h', - delay : 0 - }, - - init: function() { - - var $this = this; - - this.options.minLength = 0; - this.options.template = ''; - - this.options.source = function(release) { - release(times[$this.options.format] || times['12h']); - }; - - this.element.wrap('
        '); - - this.autocomplete = UI.autocomplete(this.element.parent(), this.options); - this.autocomplete.dropdown.addClass('uk-dropdown-small uk-dropdown-scrollable'); - - this.autocomplete.on('autocomplete-show', function() { - - var selected = $this.autocomplete.dropdown.find('[data-value="'+$this.autocomplete.input.val()+'"]'); - - setTimeout(function(){ - $this.autocomplete.pick(selected, true); - }, 10); - }); - - this.autocomplete.input.on('focus', function(){ - - $this.autocomplete.value = Math.random(); - $this.autocomplete.triggercomplete(); - - }).on('blur', function() { - $this.checkTime(); - }); - - this.element.data("timepicker", this); - }, - - checkTime: function() { - - var arr, timeArray, meridian = 'AM', hour, minute, time = this.autocomplete.input.val(); - - if (this.options.format == '12h') { - arr = time.split(' '); - timeArray = arr[0].split(':'); - meridian = arr[1]; - } else { - timeArray = time.split(':'); - } - - hour = parseInt(timeArray[0], 10); - minute = parseInt(timeArray[1], 10); - - if (isNaN(hour)) hour = 0; - if (isNaN(minute)) minute = 0; - - if (this.options.format == '12h') { - if (hour > 12) { - hour = 12; - } else if (hour < 0) { - hour = 12; - } - - if (meridian === 'am' || meridian === 'a') { - meridian = 'AM'; - } else if (meridian === 'pm' || meridian === 'p') { - meridian = 'PM'; - } - - if (meridian !== 'AM' && meridian !== 'PM') { - meridian = 'AM'; - } - - } else { - - if (hour >= 24) { - hour = 23; - } else if (hour < 0) { - hour = 0; - } - } - - if (minute < 0) { - minute = 0; - } else if (minute >= 60) { - minute = 0; - } - - this.autocomplete.input.val(this.formatTime(hour, minute, meridian)); - }, - - formatTime: function(hour, minute, meridian) { - hour = hour < 10 ? '0' + hour : hour; - minute = minute < 10 ? '0' + minute : minute; - return hour + ':' + minute + (this.options.format == '12h' ? ' ' + meridian : ''); - } - }); - - // init code - UI.$doc.on("focus.timepicker.uikit", "[data-uk-timepicker]", function(e) { - var ele = $(this); - - if (!ele.data("timepicker")) { - var obj = UI.timepicker(ele, UI.Utils.options(ele.attr("data-uk-timepicker"))); - - setTimeout(function(){ - obj.autocomplete.input.focus(); - }, 20); - } - }); -}); diff --git a/web/js/addons/timepicker.min.js b/web/js/addons/timepicker.min.js deleted file mode 100755 index 6154a28..0000000 --- a/web/js/addons/timepicker.min.js +++ /dev/null @@ -1,3 +0,0 @@ -/*! UIkit 2.9.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ - -!function(a){var b;jQuery&&jQuery.UIkit&&(b=a(jQuery,jQuery.UIkit)),"function"==typeof define&&define.amd&&define("uikit-search",["uikit"],function(){return b||a(jQuery,jQuery.UIkit)})}(function(a,b){"use strict";for(var c={"12h":[],"24h":[]},d=0,e="";24>d;d++)e=""+d,10>d&&(e="0"+e),c["24h"].push({value:e+":00"}),c["24h"].push({value:e+":30"}),13>d&&(c["12h"].push({value:e+":00 AM"}),c["12h"].push({value:e+":30 AM"})),d>12&&(e-=12,10>e&&(e="0"+String(e)),c["12h"].push({value:e+":00 PM"}),c["12h"].push({value:e+":30 PM"}));b.component("timepicker",{defaults:{format:"24h",delay:0},init:function(){var a=this;this.options.minLength=0,this.options.template='',this.options.source=function(b){b(c[a.options.format]||c["12h"])},this.element.wrap('
        '),this.autocomplete=b.autocomplete(this.element.parent(),this.options),this.autocomplete.dropdown.addClass("uk-dropdown-small uk-dropdown-scrollable"),this.autocomplete.on("autocomplete-show",function(){var b=a.autocomplete.dropdown.find('[data-value="'+a.autocomplete.input.val()+'"]');setTimeout(function(){a.autocomplete.pick(b,!0)},10)}),this.autocomplete.input.on("focus",function(){a.autocomplete.value=Math.random(),a.autocomplete.triggercomplete()}).on("blur",function(){a.checkTime()}),this.element.data("timepicker",this)},checkTime:function(){var a,b,c,d,e="AM",f=this.autocomplete.input.val();"12h"==this.options.format?(a=f.split(" "),b=a[0].split(":"),e=a[1]):b=f.split(":"),c=parseInt(b[0],10),d=parseInt(b[1],10),isNaN(c)&&(c=0),isNaN(d)&&(d=0),"12h"==this.options.format?(c>12?c=12:0>c&&(c=12),"am"===e||"a"===e?e="AM":("pm"===e||"p"===e)&&(e="PM"),"AM"!==e&&"PM"!==e&&(e="AM")):c>=24?c=23:0>c&&(c=0),0>d?d=0:d>=60&&(d=0),this.autocomplete.input.val(this.formatTime(c,d,e))},formatTime:function(a,b,c){return a=10>a?"0"+a:a,b=10>b?"0"+b:b,a+":"+b+("12h"==this.options.format?" "+c:"")}}),b.$doc.on("focus.timepicker.uikit","[data-uk-timepicker]",function(){var c=a(this);if(!c.data("timepicker")){var d=b.timepicker(c,b.Utils.options(c.attr("data-uk-timepicker")));setTimeout(function(){d.autocomplete.input.focus()},20)}})}); \ No newline at end of file diff --git a/web/js/addons/upload.js b/web/js/addons/upload.js deleted file mode 100755 index cf58b5a..0000000 --- a/web/js/addons/upload.js +++ /dev/null @@ -1,253 +0,0 @@ -/*! UIkit 2.9.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ - -(function(addon) { - - var component; - - if (jQuery && jQuery.UIkit) { - component = addon(jQuery, jQuery.UIkit); - } - - if (typeof define == "function" && define.amd) { - define("uikit-upload", ["uikit"], function(){ - return component || addon(jQuery, jQuery.UIkit); - }); - } - -})(function($, UI){ - - UI.component('uploadSelect', { - - - init: function() { - - var $this = this; - - this.on("change", function() { - xhrupload($this.element[0].files, $this.options); - }); - } - }); - - UI.component('uploadDrop', { - - defaults: { - 'dragoverClass': 'uk-dragover' - }, - - init: function() { - - var $this = this, hasdragCls = false; - - this.on("drop", function(e){ - - if (e.dataTransfer && e.dataTransfer.files) { - - e.stopPropagation(); - e.preventDefault(); - - $this.element.removeClass($this.options.dragoverClass); - $this.element.trigger('uk.dropped', [e.dataTransfer.files]); - - xhrupload(e.dataTransfer.files, $this.options); - } - - }).on("dragenter", function(e){ - e.stopPropagation(); - e.preventDefault(); - }).on("dragover", function(e){ - e.stopPropagation(); - e.preventDefault(); - - if (!hasdragCls) { - $this.element.addClass($this.options.dragoverClass); - hasdragCls = true; - } - }).on("dragleave", function(e){ - e.stopPropagation(); - e.preventDefault(); - $this.element.removeClass($this.options.dragoverClass); - hasdragCls = false; - }); - } - }); - - - UI.support.ajaxupload = (function() { - - function supportFileAPI() { - var fi = document.createElement('INPUT'); fi.type = 'file'; return 'files' in fi; - } - - function supportAjaxUploadProgressEvents() { - var xhr = new XMLHttpRequest(); return !! (xhr && ('upload' in xhr) && ('onprogress' in xhr.upload)); - } - - function supportFormData() { - return !! window.FormData; - } - - return supportFileAPI() && supportAjaxUploadProgressEvents() && supportFormData(); - })(); - - if (UI.support.ajaxupload){ - $.event.props.push("dataTransfer"); - } - - function xhrupload(files, settings) { - - if (!UI.support.ajaxupload){ - return this; - } - - settings = $.extend({}, xhrupload.defaults, settings); - - if (!files.length){ - return; - } - - if (settings.allow !== '*.*') { - - for(var i=0,file;file=files[i];i++) { - - if(!matchName(settings.allow, file.name)) { - - if(typeof(settings.notallowed) == 'string') { - alert(settings.notallowed); - } else { - settings.notallowed(file, settings); - } - return; - } - } - } - - var complete = settings.complete; - - if (settings.single){ - - var count = files.length, - uploaded = 0, - allow = true; - - settings.beforeAll(files); - - settings.complete = function(response, xhr){ - - uploaded = uploaded + 1; - - complete(response, xhr); - - if (settings.filelimit && uploaded >= settings.filelimit){ - allow = false; - } - - if (allow && uploaded=f.filelimit&&(m=!1),m&&k>l?g([e[l]],f):f.allcomplete(a,b)},g([e[0]],f)}else f.complete=function(a,b){j(a,b),f.allcomplete(a,b)},g(e,f)}}function d(a,b){var c="^"+a.replace(/\//g,"\\/").replace(/\*\*/g,"(\\/[^\\/]+)*").replace(/\*/g,"[^\\/]+").replace(/((?!\\))\?/g,"$1.")+"$";return c="^"+c+"$",null!==b.match(new RegExp(c,"i"))}return b.component("uploadSelect",{init:function(){var a=this;this.on("change",function(){c(a.element[0].files,a.options)})}}),b.component("uploadDrop",{defaults:{dragoverClass:"uk-dragover"},init:function(){var a=this,b=!1;this.on("drop",function(b){b.dataTransfer&&b.dataTransfer.files&&(b.stopPropagation(),b.preventDefault(),a.element.removeClass(a.options.dragoverClass),a.element.trigger("uk.dropped",[b.dataTransfer.files]),c(b.dataTransfer.files,a.options))}).on("dragenter",function(a){a.stopPropagation(),a.preventDefault()}).on("dragover",function(c){c.stopPropagation(),c.preventDefault(),b||(a.element.addClass(a.options.dragoverClass),b=!0)}).on("dragleave",function(c){c.stopPropagation(),c.preventDefault(),a.element.removeClass(a.options.dragoverClass),b=!1})}}),b.support.ajaxupload=function(){function a(){var a=document.createElement("INPUT");return a.type="file","files"in a}function b(){var a=new XMLHttpRequest;return!!(a&&"upload"in a&&"onprogress"in a.upload)}function c(){return!!window.FormData}return a()&&b()&&c()}(),b.support.ajaxupload&&a.event.props.push("dataTransfer"),c.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(a,b){alert("Only the following file types are allowed: "+b.allow)}},b.Utils.xhrupload=c,c}); \ No newline at end of file diff --git a/web/js/uikit.js b/web/js/uikit.js deleted file mode 100755 index 7d2e345..0000000 --- a/web/js/uikit.js +++ /dev/null @@ -1,2594 +0,0 @@ -/*! UIkit 2.9.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ - -(function(core) { - - if (typeof define == "function" && define.amd) { // AMD - define("uikit", function(){ - - var uikit = core(window, window.jQuery, window.document); - - uikit.load = function(res, req, onload, config) { - - var resources = res.split(','), load = [], i, base = (config.config && config.config.uikit && config.config.uikit.base ? config.config.uikit.base : "").replace(/\/+$/g, ""); - - if (!base) { - throw new Error( "Please define base path to UIkit in the requirejs config." ); - } - - for (i = 0; i < resources.length; i += 1) { - var resource = resources[i].replace(/\./g, '/'); - load.push(base+'/js/addons/'+resource); - } - - req(load, function() { - onload(uikit); - }); - }; - - return uikit; - }); - } - - if (!window.jQuery) { - throw new Error( "UIkit requires jQuery" ); - } - - if (window && window.jQuery) { - core(window, window.jQuery, window.document); - } - - -})(function(global, $, doc) { - - "use strict"; - - var UI = $.UIkit || {}, $html = $("html"), $win = $(window), $doc = $(document); - - if (UI.fn) { - return UI; - } - - UI.version = '2.9.0'; - UI.$doc = $doc; - UI.$win = $win; - - UI.fn = function(command, options) { - - var args = arguments, cmd = command.match(/^([a-z\-]+)(?:\.([a-z]+))?/i), component = cmd[1], method = cmd[2]; - - if (!UI[component]) { - $.error("UIkit component [" + component + "] does not exist."); - return this; - } - - return this.each(function() { - var $this = $(this), data = $this.data(component); - if (!data) $this.data(component, (data = UI[component](this, method ? undefined : options))); - if (method) data[method].apply(data, Array.prototype.slice.call(args, 1)); - }); - }; - - - UI.support = {}; - UI.support.transition = (function() { - - var transitionEnd = (function() { - - var element = doc.body || doc.documentElement, - transEndEventNames = { - WebkitTransition: 'webkitTransitionEnd', - MozTransition: 'transitionend', - OTransition: 'oTransitionEnd otransitionend', - transition: 'transitionend' - }, name; - - for (name in transEndEventNames) { - if (element.style[name] !== undefined) return transEndEventNames[name]; - } - }()); - - return transitionEnd && { end: transitionEnd }; - })(); - - UI.support.animation = (function() { - - var animationEnd = (function() { - - var element = doc.body || doc.documentElement, - animEndEventNames = { - WebkitAnimation: 'webkitAnimationEnd', - MozAnimation: 'animationend', - OAnimation: 'oAnimationEnd oanimationend', - animation: 'animationend' - }, name; - - for (name in animEndEventNames) { - if (element.style[name] !== undefined) return animEndEventNames[name]; - } - }()); - - return animationEnd && { end: animationEnd }; - })(); - - UI.support.requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.msRequestAnimationFrame || window.oRequestAnimationFrame || function(callback){ setTimeout(callback, 1000/60); }; - UI.support.touch = ( - ('ontouchstart' in window && navigator.userAgent.toLowerCase().match(/mobile|tablet/)) || - (global.DocumentTouch && document instanceof global.DocumentTouch) || - (global.navigator['msPointerEnabled'] && global.navigator['msMaxTouchPoints'] > 0) || //IE 10 - (global.navigator['pointerEnabled'] && global.navigator['maxTouchPoints'] > 0) || //IE >=11 - false - ); - UI.support.mutationobserver = (global.MutationObserver || global.WebKitMutationObserver || null); - - UI.Utils = {}; - - UI.Utils.debounce = function(func, wait, immediate) { - var timeout; - return function() { - var context = this, args = arguments; - var later = function() { - timeout = null; - if (!immediate) func.apply(context, args); - }; - var callNow = immediate && !timeout; - clearTimeout(timeout); - timeout = setTimeout(later, wait); - if (callNow) func.apply(context, args); - }; - }; - - UI.Utils.removeCssRules = function(selectorRegEx) { - var idx, idxs, stylesheet, _i, _j, _k, _len, _len1, _len2, _ref; - - if(!selectorRegEx) return; - - setTimeout(function(){ - try { - _ref = document.styleSheets; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - stylesheet = _ref[_i]; - idxs = []; - stylesheet.cssRules = stylesheet.cssRules; - for (idx = _j = 0, _len1 = stylesheet.cssRules.length; _j < _len1; idx = ++_j) { - if (stylesheet.cssRules[idx].type === CSSRule.STYLE_RULE && selectorRegEx.test(stylesheet.cssRules[idx].selectorText)) { - idxs.unshift(idx); - } - } - for (_k = 0, _len2 = idxs.length; _k < _len2; _k++) { - stylesheet.deleteRule(idxs[_k]); - } - } - } catch (_error) {} - }, 0); - }; - - UI.Utils.isInView = function(element, options) { - - var $element = $(element); - - if (!$element.is(':visible')) { - return false; - } - - var window_left = $win.scrollLeft(), window_top = $win.scrollTop(), offset = $element.offset(), left = offset.left, top = offset.top; - - options = $.extend({topoffset:0, leftoffset:0}, options); - - if (top + $element.height() >= window_top && top - options.topoffset <= window_top + $win.height() && - left + $element.width() >= window_left && left - options.leftoffset <= window_left + $win.width()) { - return true; - } else { - return false; - } - }; - - UI.Utils.checkDisplay = function(context) { - $('[data-uk-margin], [data-uk-grid-match], [data-uk-grid-margin], [data-uk-check-display]', context || document).trigger('uk-check-display'); - }; - - UI.Utils.options = function(string) { - - if ($.isPlainObject(string)) return string; - - var start = (string ? string.indexOf("{") : -1), options = {}; - - if (start != -1) { - try { - options = (new Function("", "var json = " + string.substr(start) + "; return JSON.parse(JSON.stringify(json));"))(); - } catch (e) {} - } - - return options; - }; - - UI.Utils.template = function(str, data) { - - var tokens = str.replace(/\n/g, '\\n').replace(/\{\{\{\s*(.+?)\s*\}\}\}/g, "{{!$1}}").split(/(\{\{\s*(.+?)\s*\}\})/g), - i=0, toc, cmd, prop, val, fn, output = [], openblocks = 0; - - while(i < tokens.length) { - - toc = tokens[i]; - - if(toc.match(/\{\{\s*(.+?)\s*\}\}/)) { - i = i + 1; - toc = tokens[i]; - cmd = toc[0]; - prop = toc.substring(toc.match(/^(\^|\#|\!|\~|\:)/) ? 1:0); - - switch(cmd) { - case '~': - output.push("for(var $i=0;$i<"+prop+".length;$i++) { var $item = "+prop+"[$i];"); - openblocks++; - break; - case ':': - output.push("for(var $key in "+prop+") { var $val = "+prop+"[$key];"); - openblocks++; - break; - case '#': - output.push("if("+prop+") {"); - openblocks++; - break; - case '^': - output.push("if(!"+prop+") {"); - openblocks++; - break; - case '/': - output.push("}"); - openblocks--; - break; - case '!': - output.push("__ret.push("+prop+");"); - break; - default: - output.push("__ret.push(escape("+prop+"));"); - break; - } - } else { - output.push("__ret.push('"+toc.replace(/\'/g, "\\'")+"');"); - } - i = i + 1; - } - - fn = [ - 'var __ret = [];', - 'try {', - 'with($data){', (!openblocks ? output.join('') : '__ret = ["Not all blocks are closed correctly."]'), '};', - '}catch(e){__ret = [e.message];}', - 'return __ret.join("").replace(/\\n\\n/g, "\\n");', - "function escape(html) { return String(html).replace(/&/g, '&').replace(/\"/g, '"').replace(//g, '>');}" - ].join("\n"); - - var func = new Function('$data', fn); - return data ? func(data) : func; - }; - - UI.Utils.events = {}; - UI.Utils.events.click = UI.support.touch ? 'tap' : 'click'; - - $.UIkit = UI; - $.fn.uk = UI.fn; - - $.UIkit.langdirection = $html.attr("dir") == "rtl" ? "right" : "left"; - - - // DOM mutation save ready helper function - - UI.domObservers = []; - - UI.domObserve = function(selector, fn) { - - if(!UI.support.mutationobserver) return; - - $(selector).each(function() { - - var element = this; - - try { - - var observer = new UI.support.mutationobserver(UI.Utils.debounce(function(mutations) { - fn.apply(element, []); - $(element).trigger('uk.dom.changed'); - }, 50)); - - // pass in the target node, as well as the observer options - observer.observe(element, { childList: true, subtree: true }); - - } catch(e) {} - }); - }; - - UI.ready = function(fn) { - $(function() { fn(document); }); - UI.domObservers.push(fn); - }; - - $doc.on('uk.domready', function(){ - UI.domObservers.forEach(function(fn){ - fn(document); - }); - $doc.trigger('uk.dom.changed'); - }); - - $(function(){ - - // custom scroll observer - setInterval((function(){ - - var memory = {x: window.pageXOffset, y:window.pageYOffset}; - - var fn = function(){ - - if (memory.x != window.pageXOffset || memory.y != window.pageYOffset) { - memory = {x: window.pageXOffset, y:window.pageYOffset}; - $doc.trigger('uk-scroll', [memory]); - } - }; - - if ($.UIkit.support.touch) { - $doc.on('touchmove touchend MSPointerMove MSPointerUp', fn); - } - - if(memory.x || memory.y) fn(); - - return fn; - - })(), 15); - - // Check for dom modifications - UI.domObserve('[data-uk-observe]', function() { - - var ele = this; - - UI.domObservers.forEach(function(fn){ - fn(ele); - }); - }); - - - if (UI.support.touch) { - - // remove css hover rules for touch devices - // UI.Utils.removeCssRules(/\.uk-(?!navbar).*:hover/); - - // viewport unit fix for uk-height-viewport - should be fixed in iOS 8 - if (navigator.userAgent.match(/(iPad|iPhone|iPod)/g)) { - - UI.$win.on('load orientationchange resize', UI.Utils.debounce((function(){ - - var fn = function() { - $('.uk-height-viewport').css('height', window.innerHeight); - return fn; - }; - - return fn(); - - })(), 100)); - } - } - }); - - // add touch identifier class - $html.addClass(UI.support.touch ? "uk-touch" : "uk-notouch"); - - // add uk-hover class on tap to support overlays on touch devices - if (UI.support.touch) { - - var hoverset = false, selector = '.uk-overlay, .uk-overlay-toggle, .uk-has-hover', exclude; - - $doc.on('touchstart MSPointerDown', selector, function() { - - if(hoverset) $('.uk-hover').removeClass('uk-hover'); - - hoverset = $(this).addClass('uk-hover'); - - }).on('touchend MSPointerUp', function(e) { - - exclude = $(e.target).parents(selector); - - if (hoverset) hoverset.not(exclude).removeClass('uk-hover'); - }); - } - - return UI; -}); - -(function($, UI) { - - "use strict"; - - UI.components = {}; - - UI.component = function(name, def) { - - var fn = function(element, options) { - - var $this = this; - - this.element = element ? $(element) : null; - this.options = $.extend(true, {}, this.defaults, options); - this.plugins = {}; - - if (this.element) { - this.element.data(name, this); - } - - this.init(); - - (this.options.plugins.length ? this.options.plugins : Object.keys(fn.plugins)).forEach(function(plugin) { - - if (fn.plugins[plugin].init) { - fn.plugins[plugin].init($this); - $this.plugins[plugin] = true; - } - - }); - - this.trigger('init', [this]); - }; - - fn.plugins = {}; - - $.extend(true, fn.prototype, { - - defaults : {plugins: []}, - - init: function(){}, - - on: function(){ - return $(this.element || this).on.apply(this.element || this, arguments); - }, - - one: function(){ - return $(this.element || this).one.apply(this.element || this, arguments); - }, - - off: function(evt){ - return $(this.element || this).off(evt); - }, - - trigger: function(evt, params) { - return $(this.element || this).trigger(evt, params); - }, - - find: function(selector) { - return this.element ? this.element.find(selector) : $([]); - }, - - proxy: function(obj, methods) { - - var $this = this; - - methods.split(' ').forEach(function(method) { - if (!$this[method]) $this[method] = function() { return obj[method].apply(obj, arguments); }; - }); - }, - - mixin: function(obj, methods) { - - var $this = this; - - methods.split(' ').forEach(function(method) { - if (!$this[method]) $this[method] = obj[method].bind($this); - }); - }, - - }, def); - - this.components[name] = fn; - - this[name] = function() { - - var element, options; - - if(arguments.length) { - switch(arguments.length) { - case 1: - - if (typeof arguments[0] === "string" || arguments[0].nodeType || arguments[0] instanceof jQuery) { - element = $(arguments[0]); - } else { - options = arguments[0]; - } - - break; - case 2: - - element = $(arguments[0]); - options = arguments[1]; - break; - } - } - - if (element && element.data(name)) { - return element.data(name); - } - - return (new UI.components[name](element, options)); - }; - - return fn; - }; - - UI.plugin = function(component, name, def) { - this.components[component].plugins[name] = def; - }; - -})(jQuery, jQuery.UIkit); - -(function($, UI) { - - "use strict"; - - var stacks = []; - - UI.component('stackMargin', { - - defaults: { - 'cls': 'uk-margin-small-top' - }, - - init: function() { - - var $this = this; - - this.columns = this.element.children(); - - if (!this.columns.length) return; - - UI.$win.on('resize orientationchange', (function() { - - var fn = function() { - $this.process(); - }; - - $(function() { - fn(); - UI.$win.on("load", fn); - }); - - return UI.Utils.debounce(fn, 50); - })()); - - UI.$doc.on("uk.dom.changed", function(e) { - $this.columns = $this.element.children(); - $this.process(); - }); - - this.on("uk-check-display", function(e) { - if(this.element.is(":visible")) this.process(); - }.bind(this)); - - stacks.push(this); - }, - - process: function() { - - var $this = this; - - this.revert(); - - var skip = false, - firstvisible = this.columns.filter(":visible:first"), - offset = firstvisible.length ? firstvisible.offset().top : false; - - if (offset === false) return; - - this.columns.each(function() { - - var column = $(this); - - if (column.is(":visible")) { - - if (skip) { - column.addClass($this.options.cls); - } else { - if (column.offset().top != offset) { - column.addClass($this.options.cls); - skip = true; - } - } - } - }); - - return this; - }, - - revert: function() { - this.columns.removeClass(this.options.cls); - return this; - } - }); - - // init code - UI.ready(function(context) { - - $("[data-uk-margin]", context).each(function() { - var ele = $(this), obj; - - if (!ele.data("stackMargin")) { - obj = UI.stackMargin(ele, UI.Utils.options(ele.attr("data-uk-margin"))); - } - }); - }); - -})(jQuery, jQuery.UIkit); - -// Based on Zeptos touch.js -// https://raw.github.com/madrobby/zepto/master/src/touch.js -// Zepto.js may be freely distributed under the MIT license. - -;(function($){ - var touch = {}, - touchTimeout, tapTimeout, swipeTimeout, longTapTimeout, - longTapDelay = 750, - gesture; - - function swipeDirection(x1, x2, y1, y2) { - return Math.abs(x1 - x2) >= Math.abs(y1 - y2) ? (x1 - x2 > 0 ? 'Left' : 'Right') : (y1 - y2 > 0 ? 'Up' : 'Down'); - } - - function longTap() { - longTapTimeout = null; - if (touch.last) { - touch.el.trigger('longTap'); - touch = {}; - } - } - - function cancelLongTap() { - if (longTapTimeout) clearTimeout(longTapTimeout); - longTapTimeout = null; - } - - function cancelAll() { - if (touchTimeout) clearTimeout(touchTimeout); - if (tapTimeout) clearTimeout(tapTimeout); - if (swipeTimeout) clearTimeout(swipeTimeout); - if (longTapTimeout) clearTimeout(longTapTimeout); - touchTimeout = tapTimeout = swipeTimeout = longTapTimeout = null; - touch = {}; - } - - function isPrimaryTouch(event){ - return event.pointerType == event.MSPOINTER_TYPE_TOUCH && event.isPrimary; - } - - $(function(){ - var now, delta, deltaX = 0, deltaY = 0, firstTouch; - - if ('MSGesture' in window) { - gesture = new MSGesture(); - gesture.target = document.body; - } - - $(document) - .bind('MSGestureEnd', function(e){ - var swipeDirectionFromVelocity = e.originalEvent.velocityX > 1 ? 'Right' : e.originalEvent.velocityX < -1 ? 'Left' : e.originalEvent.velocityY > 1 ? 'Down' : e.originalEvent.velocityY < -1 ? 'Up' : null; - - if (swipeDirectionFromVelocity) { - touch.el.trigger('swipe'); - touch.el.trigger('swipe'+ swipeDirectionFromVelocity); - } - }) - .on('touchstart MSPointerDown', function(e){ - - if(e.type == 'MSPointerDown' && !isPrimaryTouch(e.originalEvent)) return; - - firstTouch = e.type == 'MSPointerDown' ? e : e.originalEvent.touches[0]; - - now = Date.now(); - delta = now - (touch.last || now); - touch.el = $('tagName' in firstTouch.target ? firstTouch.target : firstTouch.target.parentNode); - - if(touchTimeout) clearTimeout(touchTimeout); - - touch.x1 = firstTouch.pageX; - touch.y1 = firstTouch.pageY; - - if (delta > 0 && delta <= 250) touch.isDoubleTap = true; - - touch.last = now; - longTapTimeout = setTimeout(longTap, longTapDelay); - - // adds the current touch contact for IE gesture recognition - if (gesture && e.type == 'MSPointerDown') gesture.addPointer(e.originalEvent.pointerId); - }) - .on('touchmove MSPointerMove', function(e){ - - if(e.type == 'MSPointerMove' && !isPrimaryTouch(e.originalEvent)) return; - - firstTouch = e.type == 'MSPointerMove' ? e : e.originalEvent.touches[0]; - - cancelLongTap(); - touch.x2 = firstTouch.pageX; - touch.y2 = firstTouch.pageY; - - deltaX += Math.abs(touch.x1 - touch.x2); - deltaY += Math.abs(touch.y1 - touch.y2); - }) - .on('touchend MSPointerUp', function(e){ - - if(e.type == 'MSPointerUp' && !isPrimaryTouch(e.originalEvent)) return; - - cancelLongTap(); - - // swipe - if ((touch.x2 && Math.abs(touch.x1 - touch.x2) > 30) || (touch.y2 && Math.abs(touch.y1 - touch.y2) > 30)){ - - swipeTimeout = setTimeout(function() { - touch.el.trigger('swipe'); - touch.el.trigger('swipe' + (swipeDirection(touch.x1, touch.x2, touch.y1, touch.y2))); - touch = {}; - }, 0); - - // normal tap - } else if ('last' in touch) { - - // don't fire tap when delta position changed by more than 30 pixels, - // for instance when moving to a point and back to origin - if (isNaN(deltaX) || (deltaX < 30 && deltaY < 30)) { - // delay by one tick so we can cancel the 'tap' event if 'scroll' fires - // ('tap' fires before 'scroll') - tapTimeout = setTimeout(function() { - - // trigger universal 'tap' with the option to cancelTouch() - // (cancelTouch cancels processing of single vs double taps for faster 'tap' response) - var event = $.Event('tap'); - event.cancelTouch = cancelAll; - touch.el.trigger(event); - - // trigger double tap immediately - if (touch.isDoubleTap) { - touch.el.trigger('doubleTap'); - touch = {}; - } - - // trigger single tap after 250ms of inactivity - else { - touchTimeout = setTimeout(function(){ - touchTimeout = null; - touch.el.trigger('singleTap'); - touch = {}; - }, 250); - } - }, 0); - } else { - touch = {}; - } - deltaX = deltaY = 0; - } - }) - // when the browser window loses focus, - // for example when a modal dialog is shown, - // cancel all ongoing events - .on('touchcancel MSPointerCancel', cancelAll); - - // scrolling the window indicates intention of the user - // to scroll, not tap or swipe, so cancel all ongoing events - $(window).on('scroll', cancelAll); - }); - - ['swipe', 'swipeLeft', 'swipeRight', 'swipeUp', 'swipeDown', 'doubleTap', 'tap', 'singleTap', 'longTap'].forEach(function(eventName){ - $.fn[eventName] = function(callback){ return $(this).on(eventName, callback); }; - }); -})(jQuery); - -(function($, UI) { - - "use strict"; - - UI.component('alert', { - - defaults: { - "fade": true, - "duration": 200, - "trigger": ".uk-alert-close" - }, - - init: function() { - - var $this = this; - - this.on("click", this.options.trigger, function(e) { - e.preventDefault(); - $this.close(); - }); - }, - - close: function() { - - var element = this.trigger("close"); - - if (this.options.fade) { - element.css("overflow", "hidden").css("max-height", element.height()).animate({ - "height": 0, - "opacity": 0, - "padding-top": 0, - "padding-bottom": 0, - "margin-top": 0, - "margin-bottom": 0 - }, this.options.duration, removeElement); - } else { - removeElement(); - } - - function removeElement() { - element.trigger("closed").remove(); - } - } - - }); - - // init code - UI.$doc.on("click.alert.uikit", "[data-uk-alert]", function(e) { - - var ele = $(this); - - if (!ele.data("alert")) { - - var alert = UI.alert(ele, UI.Utils.options(ele.data("uk-alert"))); - - if ($(e.target).is(ele.data("alert").options.trigger)) { - e.preventDefault(); - alert.close(); - } - } - }); - -})(jQuery, jQuery.UIkit); - -(function($, UI) { - - "use strict"; - - UI.component('buttonRadio', { - - defaults: { - "target": ".uk-button" - }, - - init: function() { - - var $this = this; - - this.on("click", this.options.target, function(e) { - - if ($(this).is('a[href="#"]')) e.preventDefault(); - - $this.find($this.options.target).not(this).removeClass("uk-active").blur(); - $this.trigger("change", [$(this).addClass("uk-active")]); - }); - - }, - - getSelected: function() { - return this.find(".uk-active"); - } - }); - - UI.component('buttonCheckbox', { - - defaults: { - "target": ".uk-button" - }, - - init: function() { - - var $this = this; - - this.on("click", this.options.target, function(e) { - - if ($(this).is('a[href="#"]')) e.preventDefault(); - - $this.trigger("change", [$(this).toggleClass("uk-active").blur()]); - }); - - }, - - getSelected: function() { - return this.find(".uk-active"); - } - }); - - - UI.component('button', { - - defaults: {}, - - init: function() { - - var $this = this; - - this.on("click", function(e) { - - if ($this.element.is('a[href="#"]')) e.preventDefault(); - - $this.toggle(); - $this.trigger("change", [$element.blur().hasClass("uk-active")]); - }); - - }, - - toggle: function() { - this.element.toggleClass("uk-active"); - } - }); - - - // init code - UI.$doc.on("click.buttonradio.uikit", "[data-uk-button-radio]", function(e) { - var ele = $(this); - - if (!ele.data("buttonRadio")) { - var obj = UI.buttonRadio(ele, UI.Utils.options(ele.attr("data-uk-button-radio"))); - - if ($(e.target).is(obj.options.target)) { - $(e.target).trigger("click"); - } - } - }); - - UI.$doc.on("click.buttoncheckbox.uikit", "[data-uk-button-checkbox]", function(e) { - var ele = $(this); - - if (!ele.data("buttonCheckbox")) { - - var obj = UI.buttonCheckbox(ele, UI.Utils.options(ele.attr("data-uk-button-checkbox"))), target=$(e.target); - - if (target.is(obj.options.target)) { - ele.trigger("change", [target.toggleClass("uk-active").blur()]); - } - } - }); - - UI.$doc.on("click.button.uikit", "[data-uk-button]", function(e) { - var ele = $(this); - - if (!ele.data("button")) { - - var obj = UI.button(ele, UI.Utils.options(ele.attr("data-uk-button"))); - ele.trigger("click"); - } - }); - -})(jQuery, jQuery.UIkit); - -(function($, UI) { - - "use strict"; - - var active = false, hoverIdle; - - UI.component('dropdown', { - - defaults: { - 'mode' : 'hover', - 'remaintime' : 800, - 'justify' : false, - 'boundary' : UI.$win, - 'delay' : 0 - }, - - remainIdle: false, - - init: function() { - - var $this = this; - - this.dropdown = this.find(".uk-dropdown"); - - this.centered = this.dropdown.hasClass("uk-dropdown-center"); - this.justified = this.options.justify ? $(this.options.justify) : false; - - this.boundary = $(this.options.boundary); - this.flipped = this.dropdown.hasClass('uk-dropdown-flip'); - - if(!this.boundary.length) { - this.boundary = UI.$win; - } - - if (this.options.mode == "click" || UI.support.touch) { - - this.on("click", function(e) { - - var $target = $(e.target); - - if (!$target.parents(".uk-dropdown").length) { - - if ($target.is("a[href='#']") || $target.parent().is("a[href='#']")){ - e.preventDefault(); - } - - $target.blur(); - } - - if (!$this.element.hasClass("uk-open")) { - - $this.show(); - - } else { - - if ($target.is("a:not(.js-uk-prevent)") || $target.is(".uk-dropdown-close") || !$this.dropdown.find(e.target).length) { - $this.element.removeClass("uk-open"); - active = false; - } - } - }); - - } else { - - this.on("mouseenter", function(e) { - - if ($this.remainIdle) { - clearTimeout($this.remainIdle); - } - - if (hoverIdle) { - clearTimeout(hoverIdle); - } - - hoverIdle = setTimeout($this.show.bind($this), $this.options.delay); - - }).on("mouseleave", function() { - - if (hoverIdle) { - clearTimeout(hoverIdle); - } - - $this.remainIdle = setTimeout(function() { - - $this.element.removeClass("uk-open"); - $this.remainIdle = false; - - if (active && active[0] == $this.element[0]) active = false; - - }, $this.options.remaintime); - - }).on("click", function(e){ - - var $target = $(e.target); - - if ($this.remainIdle) { - clearTimeout($this.remainIdle); - } - - if ($target.is("a[href='#']") || $target.parent().is("a[href='#']")){ - e.preventDefault(); - } - - $this.show(); - }); - } - }, - - show: function(){ - - if (active && active[0] != this.element[0]) { - active.removeClass("uk-open"); - } - - if (hoverIdle) { - clearTimeout(hoverIdle); - } - - this.checkDimensions(); - this.element.addClass("uk-open"); - this.trigger('uk.dropdown.show', [this]); - - UI.Utils.checkDisplay(this.dropdown); - active = this.element; - - this.registerOuterClick(); - }, - - registerOuterClick: function(){ - - var $this = this; - - UI.$doc.off("click.outer.dropdown"); - - setTimeout(function() { - UI.$doc.on("click.outer.dropdown", function(e) { - - if (hoverIdle) { - clearTimeout(hoverIdle); - } - - var $target = $(e.target); - - if (active && active[0] == $this.element[0] && ($target.is("a:not(.js-uk-prevent)") || $target.is(".uk-dropdown-close") || !$this.dropdown.find(e.target).length)) { - active.removeClass("uk-open"); - UI.$doc.off("click.outer.dropdown"); - } - }); - }, 10); - }, - - checkDimensions: function() { - - if(!this.dropdown.length) return; - - if (this.justified && this.justified.length) { - this.dropdown.css("min-width", ""); - } - - var $this = this, - dropdown = this.dropdown.css("margin-" + $.UIkit.langdirection, ""), - offset = dropdown.show().offset(), - width = dropdown.outerWidth(), - boundarywidth = this.boundary.width(), - boundaryoffset = this.boundary.offset() ? this.boundary.offset().left:0; - - // centered dropdown - if (this.centered) { - dropdown.css("margin-" + $.UIkit.langdirection, (parseFloat(width) / 2 - dropdown.parent().width() / 2) * -1); - offset = dropdown.offset(); - - // reset dropdown - if ((width + offset.left) > boundarywidth || offset.left < 0) { - dropdown.css("margin-" + $.UIkit.langdirection, ""); - offset = dropdown.offset(); - } - } - - // justify dropdown - if (this.justified && this.justified.length) { - - var jwidth = this.justified.outerWidth(); - - dropdown.css("min-width", jwidth); - - if ($.UIkit.langdirection == 'right') { - - var right1 = boundarywidth - (this.justified.offset().left + jwidth), - right2 = boundarywidth - (dropdown.offset().left + dropdown.outerWidth()); - - dropdown.css("margin-right", right1 - right2); - - } else { - dropdown.css("margin-left", this.justified.offset().left - offset.left); - } - - offset = dropdown.offset(); - - } - - if ((width + (offset.left-boundaryoffset)) > boundarywidth) { - dropdown.addClass("uk-dropdown-flip"); - offset = dropdown.offset(); - } - - if ((offset.left-boundaryoffset) < 0) { - - dropdown.addClass("uk-dropdown-stack"); - - if (dropdown.hasClass("uk-dropdown-flip")) { - - if (!this.flipped) { - dropdown.removeClass("uk-dropdown-flip"); - offset = dropdown.offset(); - dropdown.addClass("uk-dropdown-flip"); - } - - setTimeout(function(){ - - if ((dropdown.offset().left-boundaryoffset) < 0 || !$this.flipped && (dropdown.outerWidth() + (offset.left-boundaryoffset)) < boundarywidth) { - dropdown.removeClass("uk-dropdown-flip"); - } - }, 0); - } - - this.trigger('uk.dropdown.stack', [this]); - } - - dropdown.css("display", ""); - } - - }); - - var triggerevent = UI.support.touch ? "click" : "mouseenter"; - - // init code - UI.$doc.on(triggerevent+".dropdown.uikit", "[data-uk-dropdown]", function(e) { - var ele = $(this); - - if (!ele.data("dropdown")) { - - var dropdown = UI.dropdown(ele, UI.Utils.options(ele.data("uk-dropdown"))); - - if (triggerevent=="click" || (triggerevent=="mouseenter" && dropdown.options.mode=="hover")) { - dropdown.element.trigger(triggerevent); - } - - if(dropdown.element.find('.uk-dropdown').length) { - e.preventDefault(); - } - } - }); - -})(jQuery, jQuery.UIkit); - -(function($, UI) { - - "use strict"; - - var grids = []; - - UI.component('gridMatchHeight', { - - defaults: { - "target" : false, - "row" : true - }, - - init: function() { - - var $this = this; - - this.columns = this.element.children(); - this.elements = this.options.target ? this.find(this.options.target) : this.columns; - - if (!this.columns.length) return; - - UI.$win.on('resize orientationchange', (function() { - - var fn = function() { - $this.match(); - }; - - $(function() { - fn(); - UI.$win.on("load", fn); - }); - - return UI.Utils.debounce(fn, 50); - })()); - - UI.$doc.on("uk.dom.changed", function(e) { - $this.columns = $this.element.children(); - $this.elements = $this.options.target ? $this.find($this.options.target) : $this.columns; - $this.match(); - }); - - this.on("uk-check-display", function(e) { - if(this.element.is(":visible")) this.match(); - }.bind(this)); - - grids.push(this); - }, - - match: function() { - - this.revert(); - - var firstvisible = this.columns.filter(":visible:first"); - - if (!firstvisible.length) return; - - var stacked = Math.ceil(100 * parseFloat(firstvisible.css('width')) / parseFloat(firstvisible.parent().css('width'))) >= 100 ? true : false, - max = 0, - $this = this; - - if (stacked) return; - - if(this.options.row) { - - this.element.width(); // force redraw - - setTimeout(function(){ - - var lastoffset = false, group = []; - - $this.elements.each(function(i) { - var ele = $(this), offset = ele.offset().top; - - if(offset != lastoffset && group.length) { - - $this.matchHeights($(group)); - group = []; - offset = ele.offset().top; - } - - group.push(ele); - lastoffset = offset; - }); - - if(group.length) { - $this.matchHeights($(group)); - } - - }, 0); - - } else { - - this.matchHeights(this.elements); - } - - return this; - }, - - revert: function() { - this.elements.css('min-height', ''); - return this; - }, - - matchHeights: function(elements){ - - if(elements.length < 2) return; - - var max = 0; - - elements.each(function() { - max = Math.max(max, $(this).outerHeight()); - }).each(function(i) { - - var element = $(this), - height = max - (element.outerHeight() - element.height()); - - element.css('min-height', height + 'px'); - }); - } - }); - - UI.component('gridMargin', { - - defaults: { - "cls": "uk-grid-margin" - }, - - init: function() { - - var $this = this; - - var stackMargin = UI.stackMargin(this.element, this.options); - } - }); - - - // init code - UI.ready(function(context) { - - $("[data-uk-grid-match],[data-uk-grid-margin]", context).each(function() { - var grid = $(this), obj; - - if (grid.is("[data-uk-grid-match]") && !grid.data("gridMatchHeight")) { - obj = UI.gridMatchHeight(grid, UI.Utils.options(grid.attr("data-uk-grid-match"))); - } - - if (grid.is("[data-uk-grid-margin]") && !grid.data("gridMargin")) { - obj = UI.gridMargin(grid, UI.Utils.options(grid.attr("data-uk-grid-margin"))); - } - }); - }); - -})(jQuery, jQuery.UIkit); - -(function($, UI) { - - "use strict"; - - var active = false, $html = $('html'), body; - - UI.component('modal', { - - defaults: { - keyboard: true, - bgclose: true, - minScrollHeight: 150 - }, - - scrollable: false, - transition: false, - - init: function() { - - if (!body) body = $('body'); - - var $this = this; - - this.transition = UI.support.transition; - this.dialog = this.find(".uk-modal-dialog"); - - this.on("click", ".uk-modal-close", function(e) { - e.preventDefault(); - $this.hide(); - - }).on("click", function(e) { - - var target = $(e.target); - - if (target[0] == $this.element[0] && $this.options.bgclose) { - $this.hide(); - } - }); - }, - - toggle: function() { - return this[this.isActive() ? "hide" : "show"](); - }, - - show: function() { - - var $this = this; - - if (this.isActive()) return; - if (active) active.hide(true); - - this.element.removeClass("uk-open").show(); - this.resize(); - - active = this; - $html.addClass("uk-modal-page").height(); // force browser engine redraw - - this.element.addClass("uk-open").trigger("uk.modal.show"); - - UI.Utils.checkDisplay(this.dialog); - - return this; - }, - - hide: function(force) { - - if (!this.isActive()) return; - - if (!force && UI.support.transition) { - - var $this = this; - - this.one(UI.support.transition.end, function() { - $this._hide(); - }).removeClass("uk-open"); - - } else { - - this._hide(); - } - - return this; - }, - - resize: function() { - - var paddingdir = "padding-" + (UI.langdirection == 'left' ? "left":"right"), - margindir = "margin-" + (UI.langdirection == 'left' ? "left":"right"), - bodywidth = body.width(); - - this.scrollbarwidth = window.innerWidth - bodywidth; - - $html.css(margindir, this.scrollbarwidth * -1); - - this.element.css(paddingdir, ""); - - if (this.dialog.offset().left > this.scrollbarwidth) { - this.element.css(paddingdir, this.scrollbarwidth - (this.element[0].scrollHeight==window.innerHeight ? 0:this.scrollbarwidth )); - } - - this.updateScrollable(); - - }, - - updateScrollable: function() { - - // has scrollable? - - var scrollable = this.dialog.find('.uk-overflow-container:visible:first'); - - if (scrollable) { - - scrollable.css("height", 0); - - var offset = Math.abs(parseInt(this.dialog.css("margin-top"), 10)), - dh = this.dialog.outerHeight(), - wh = window.innerHeight, - h = wh - 2*(offset < 20 ? 20:offset) - dh; - - scrollable.css("height", h < this.options.minScrollHeight ? "":h); - } - }, - - _hide: function() { - - this.element.hide().removeClass("uk-open"); - - $html.removeClass("uk-modal-page").css("margin-" + (UI.langdirection == 'left' ? "left":"right"), ""); - - if(active===this) active = false; - - this.trigger("uk.modal.hide"); - }, - - isActive: function() { - return (active == this); - } - - }); - - UI.component('modalTrigger', { - - init: function() { - - var $this = this; - - this.options = $.extend({ - "target": $this.element.is("a") ? $this.element.attr("href") : false - }, this.options); - - this.modal = UI.modal(this.options.target, this.options); - - this.on("click", function(e) { - e.preventDefault(); - $this.show(); - }); - - //methods - this.proxy(this.modal, "show hide isActive"); - } - }); - - UI.modal.dialog = function(content, options) { - - var modal = UI.modal($(UI.modal.dialog.template).appendTo("body"), options); - - modal.on("uk.modal.hide", function(){ - if (modal.persist) { - modal.persist.appendTo(modal.persist.data("modalPersistParent")); - modal.persist = false; - } - modal.element.remove(); - }); - - setContent(content, modal); - - return modal; - }; - - UI.modal.dialog.template = '
        '; - - UI.modal.alert = function(content, options) { - - UI.modal.dialog(([ - '
        '+String(content)+'
        ', - '
        ' - ]).join(""), $.extend({bgclose:false, keyboard:false}, options)).show(); - }; - - UI.modal.confirm = function(content, onconfirm, options) { - - onconfirm = $.isFunction(onconfirm) ? onconfirm : function(){}; - - var modal = UI.modal.dialog(([ - '
        '+String(content)+'
        ', - '
        ' - ]).join(""), $.extend({bgclose:false, keyboard:false}, options)); - - modal.element.find(".js-modal-confirm").on("click", function(){ - onconfirm(); - modal.hide(); - }); - - modal.show(); - }; - - // init code - UI.$doc.on("click.modal.uikit", "[data-uk-modal]", function(e) { - - var ele = $(this); - - if(ele.is("a")) { - e.preventDefault(); - } - - if (!ele.data("modalTrigger")) { - var modal = UI.modalTrigger(ele, UI.Utils.options(ele.attr("data-uk-modal"))); - modal.show(); - } - - }); - - // close modal on esc button - UI.$doc.on('keydown.modal.uikit', function (e) { - - if (active && e.keyCode === 27 && active.options.keyboard) { // ESC - e.preventDefault(); - active.hide(); - } - }); - - UI.$win.on("resize orientationchange", UI.Utils.debounce(function(){ - if(active) active.resize(); - }, 150)); - - - // helper functions - function setContent(content, modal){ - - if(!modal) return; - - if (typeof content === 'object') { - - // convert DOM object to a jQuery object - content = content instanceof jQuery ? content : $(content); - - if(content.parent().length) { - modal.persist = content; - modal.persist.data("modalPersistParent", content.parent()); - } - }else if (typeof content === 'string' || typeof content === 'number') { - // just insert the data as innerHTML - content = $('
        ').html(content); - }else { - // unsupported data type! - content = $('
        ').html('$.UIkitt.modal Error: Unsupported data type: ' + typeof content); - } - - content.appendTo(modal.element.find('.uk-modal-dialog')); - - return modal; - } - -})(jQuery, jQuery.UIkit); - -(function($, UI) { - - "use strict"; - - var scrollpos = {x: window.scrollX, y: window.scrollY}, - $win = UI.$win, - $doc = UI.$doc, - $html = $('html'), - Offcanvas = { - - show: function(element) { - - element = $(element); - - if (!element.length) return; - - var $body = $('body'), - winwidth = $win.width(), - bar = element.find(".uk-offcanvas-bar:first"), - rtl = ($.UIkit.langdirection == "right"), - flip = bar.hasClass("uk-offcanvas-bar-flip") ? -1:1, - dir = flip * (rtl ? -1 : 1); - - scrollpos = {x: window.pageXOffset, y: window.pageYOffset}; - - element.addClass("uk-active"); - - $body.css({"width": window.innerWidth, "height": $win.height()}).addClass("uk-offcanvas-page"); - $body.css((rtl ? "margin-right" : "margin-left"), (rtl ? -1 : 1) * (bar.outerWidth() * dir)).width(); // .width() - force redraw - - $html.css('margin-top', scrollpos.y * -1); - - bar.addClass("uk-offcanvas-bar-show"); - - element.off(".ukoffcanvas").on("click.ukoffcanvas swipeRight.ukoffcanvas swipeLeft.ukoffcanvas", function(e) { - - var target = $(e.target); - - if (!e.type.match(/swipe/)) { - - if (!target.hasClass("uk-offcanvas-close")) { - if (target.hasClass("uk-offcanvas-bar")) return; - if (target.parents(".uk-offcanvas-bar:first").length) return; - } - } - - e.stopImmediatePropagation(); - Offcanvas.hide(); - }); - - $doc.on('keydown.ukoffcanvas', function(e) { - if (e.keyCode === 27) { // ESC - Offcanvas.hide(); - } - }); - - $doc.trigger('uk.offcanvas.show', [element, bar]); - }, - - hide: function(force) { - - var $body = $('body'), - panel = $(".uk-offcanvas.uk-active"), - rtl = ($.UIkit.langdirection == "right"), - bar = panel.find(".uk-offcanvas-bar:first"), - finalize = function() { - $body.removeClass("uk-offcanvas-page").css({"width": "", "height": "", "margin-left": "", "margin-right": ""}); - panel.removeClass("uk-active"); - bar.removeClass("uk-offcanvas-bar-show"); - $html.css('margin-top', ''); - window.scrollTo(scrollpos.x, scrollpos.y); - $doc.trigger('uk.offcanvas.hide', [panel, bar]); - }; - - if (!panel.length) return; - - if ($.UIkit.support.transition && !force) { - - $body.one($.UIkit.support.transition.end, function() { - finalize(); - }).css((rtl ? "margin-right" : "margin-left"), ""); - - setTimeout(function(){ - bar.removeClass("uk-offcanvas-bar-show"); - }, 0); - - } else { - finalize(); - } - - panel.off(".ukoffcanvas"); - $doc.off(".ukoffcanvas"); - } - }; - - UI.component('offcanvasTrigger', { - - init: function() { - - var $this = this; - - this.options = $.extend({ - "target": $this.element.is("a") ? $this.element.attr("href") : false - }, this.options); - - this.on("click", function(e) { - e.preventDefault(); - Offcanvas.show($this.options.target); - }); - } - }); - - UI.offcanvas = Offcanvas; - - // init code - $doc.on("click.offcanvas.uikit", "[data-uk-offcanvas]", function(e) { - - e.preventDefault(); - - var ele = $(this); - - if (!ele.data("offcanvasTrigger")) { - var obj = UI.offcanvasTrigger(ele, UI.Utils.options(ele.attr("data-uk-offcanvas"))); - ele.trigger("click"); - } - }); - -})(jQuery, jQuery.UIkit); - -(function($, UI) { - - "use strict"; - - UI.component('nav', { - - defaults: { - "toggle": ">li.uk-parent > a[href='#']", - "lists": ">li.uk-parent > ul", - "multiple": false - }, - - init: function() { - - var $this = this; - - this.on("click", this.options.toggle, function(e) { - e.preventDefault(); - var ele = $(this); - $this.open(ele.parent()[0] == $this.element[0] ? ele : ele.parent("li")); - }); - - this.find(this.options.lists).each(function() { - var $ele = $(this), - parent = $ele.parent(), - active = parent.hasClass("uk-active"); - - $ele.wrap('
        '); - parent.data("list-container", $ele.parent()); - - if (active) $this.open(parent, true); - }); - - }, - - open: function(li, noanimation) { - - var element = this.element, $li = $(li); - - if (!this.options.multiple) { - - element.children(".uk-open").not(li).each(function() { - if ($(this).data("list-container")) { - $(this).data("list-container").stop().animate({height: 0}, function() { - $(this).parent().removeClass("uk-open"); - }); - } - }); - } - - $li.toggleClass("uk-open"); - - if ($li.data("list-container")) { - if (noanimation) { - $li.data('list-container').stop().height($li.hasClass("uk-open") ? "auto" : 0); - } else { - $li.data('list-container').stop().animate({ - height: ($li.hasClass("uk-open") ? getHeight($li.data('list-container').find('ul:first')) : 0) - }); - } - } - } - }); - - - // helper - - function getHeight(ele) { - var $ele = $(ele), height = "auto"; - - if ($ele.is(":visible")) { - height = $ele.outerHeight(); - } else { - var tmp = { - position: $ele.css("position"), - visibility: $ele.css("visibility"), - display: $ele.css("display") - }; - - height = $ele.css({position: 'absolute', visibility: 'hidden', display: 'block'}).outerHeight(); - - $ele.css(tmp); // reset element - } - - return height; - } - - // init code - UI.ready(function(context) { - - $("[data-uk-nav]", context).each(function() { - var nav = $(this); - - if (!nav.data("nav")) { - var obj = UI.nav(nav, UI.Utils.options(nav.attr("data-uk-nav"))); - } - }); - }); - -})(jQuery, jQuery.UIkit); - -(function($, UI, $win) { - - "use strict"; - - var $tooltip, // tooltip container - tooltipdelay, checkdelay; - - UI.component('tooltip', { - - defaults: { - "offset": 5, - "pos": "top", - "animation": false, - "delay": 0, // in miliseconds - "cls": "", - "src": function() { return this.attr("title"); } - }, - - tip: "", - - init: function() { - - var $this = this; - - if (!$tooltip) { - $tooltip = $('
        ').appendTo("body"); - } - - this.on({ - "focus" : function(e) { $this.show(); }, - "blur" : function(e) { $this.hide(); }, - "mouseenter": function(e) { $this.show(); }, - "mouseleave": function(e) { $this.hide(); } - }); - - this.tip = typeof(this.options.src) === "function" ? this.options.src.call(this.element) : this.options.src; - - // disable title attribute - this.element.attr("data-cached-title", this.element.attr("title")).attr("title", ""); - }, - - show: function() { - - if (tooltipdelay) clearTimeout(tooltipdelay); - if (checkdelay) clearTimeout(checkdelay); - if (!this.tip.length) return; - - $tooltip.stop().css({"top": -2000, "visibility": "hidden"}).show(); - $tooltip.html('
        ' + this.tip + '
        '); - - var $this = this, - pos = $.extend({}, this.element.offset(), {width: this.element[0].offsetWidth, height: this.element[0].offsetHeight}), - width = $tooltip[0].offsetWidth, - height = $tooltip[0].offsetHeight, - offset = typeof(this.options.offset) === "function" ? this.options.offset.call(this.element) : this.options.offset, - position = typeof(this.options.pos) === "function" ? this.options.pos.call(this.element) : this.options.pos, - tmppos = position.split("-"), - tcss = { - "display" : "none", - "visibility" : "visible", - "top" : (pos.top + pos.height + height), - "left" : pos.left - }; - - - // prevent strange position - // when tooltip is in offcanvas etc. - if ($('html').css('position')=='fixed' || $('body').css('position')=='fixed'){ - var bodyoffset = $('body').offset(), - htmloffset = $('html').offset(), - docoffset = {'top': (htmloffset.top + bodyoffset.top), 'left': (htmloffset.left + bodyoffset.left)}; - - pos.left -= docoffset.left; - pos.top -= docoffset.top; - } - - - if ((tmppos[0] == "left" || tmppos[0] == "right") && $.UIkit.langdirection == 'right') { - tmppos[0] = tmppos[0] == "left" ? "right" : "left"; - } - - var variants = { - "bottom" : {top: pos.top + pos.height + offset, left: pos.left + pos.width / 2 - width / 2}, - "top" : {top: pos.top - height - offset, left: pos.left + pos.width / 2 - width / 2}, - "left" : {top: pos.top + pos.height / 2 - height / 2, left: pos.left - width - offset}, - "right" : {top: pos.top + pos.height / 2 - height / 2, left: pos.left + pos.width + offset} - }; - - $.extend(tcss, variants[tmppos[0]]); - - if (tmppos.length == 2) tcss.left = (tmppos[1] == 'left') ? (pos.left) : ((pos.left + pos.width) - width); - - var boundary = this.checkBoundary(tcss.left, tcss.top, width, height); - - if(boundary) { - - switch(boundary) { - case "x": - - if (tmppos.length == 2) { - position = tmppos[0]+"-"+(tcss.left < 0 ? "left": "right"); - } else { - position = tcss.left < 0 ? "right": "left"; - } - - break; - - case "y": - if (tmppos.length == 2) { - position = (tcss.top < 0 ? "bottom": "top")+"-"+tmppos[1]; - } else { - position = (tcss.top < 0 ? "bottom": "top"); - } - - break; - - case "xy": - if (tmppos.length == 2) { - position = (tcss.top < 0 ? "bottom": "top")+"-"+(tcss.left < 0 ? "left": "right"); - } else { - position = tcss.left < 0 ? "right": "left"; - } - - break; - - } - - tmppos = position.split("-"); - - $.extend(tcss, variants[tmppos[0]]); - - if (tmppos.length == 2) tcss.left = (tmppos[1] == 'left') ? (pos.left) : ((pos.left + pos.width) - width); - } - - - tcss.left -= $("body").position().left; - - tooltipdelay = setTimeout(function(){ - - $tooltip.css(tcss).attr("class", ["uk-tooltip", "uk-tooltip-"+position, $this.options.cls].join(' ')); - - if ($this.options.animation) { - $tooltip.css({opacity: 0, display: 'block'}).animate({opacity: 1}, parseInt($this.options.animation, 10) || 400); - } else { - $tooltip.show(); - } - - tooltipdelay = false; - - // close tooltip if element was removed or hidden - checkdelay = setInterval(function(){ - if(!$this.element.is(':visible')) $this.hide(); - }, 150); - - }, parseInt(this.options.delay, 10) || 0); - }, - - hide: function() { - if(this.element.is("input") && this.element[0]===document.activeElement) return; - - if(tooltipdelay) clearTimeout(tooltipdelay); - if (checkdelay) clearTimeout(checkdelay); - - $tooltip.stop(); - - if (this.options.animation) { - $tooltip.fadeOut(parseInt(this.options.animation, 10) || 400); - } else { - $tooltip.hide(); - } - }, - - content: function() { - return this.tip; - }, - - checkBoundary: function(left, top, width, height) { - - var axis = ""; - - if(left < 0 || ((left-$win.scrollLeft())+width) > window.innerWidth) { - axis += "x"; - } - - if(top < 0 || ((top-$win.scrollTop())+height) > window.innerHeight) { - axis += "y"; - } - - return axis; - } - }); - - - // init code - UI.$doc.on("mouseenter.tooltip.uikit focus.tooltip.uikit", "[data-uk-tooltip]", function(e) { - var ele = $(this); - - if (!ele.data("tooltip")) { - var obj = UI.tooltip(ele, UI.Utils.options(ele.attr("data-uk-tooltip"))); - ele.trigger("mouseenter"); - } - }); - -})(jQuery, jQuery.UIkit, jQuery(window)); - -(function($, UI) { - - "use strict"; - - UI.component('switcher', { - - defaults: { - connect : false, - toggle : ">*", - active : 0 - }, - - init: function() { - - var $this = this; - - this.on("click", this.options.toggle, function(e) { - e.preventDefault(); - $this.show(this); - }); - - if (this.options.connect) { - - this.connect = $(this.options.connect).find(".uk-active").removeClass(".uk-active").end(); - - // delegate switch commands within container content - if (this.connect.length) { - - this.connect.on("click", '[data-uk-switcher-item]', function(e) { - - e.preventDefault(); - - var item = $(this).data('ukSwitcherItem'); - - if ($this.index == item) return; - - switch(item) { - case 'next': - case 'previous': - $this.show($this.index + (item=='next' ? 1:-1)); - break; - default: - $this.show(item); - } - }); - } - - var toggles = this.find(this.options.toggle), - active = toggles.filter(".uk-active"); - - if (active.length) { - this.show(active); - } else { - active = toggles.eq(this.options.active); - this.show(active.length ? active : toggles.eq(0)); - } - } - - }, - - show: function(tab) { - - tab = isNaN(tab) ? $(tab) : this.find(this.options.toggle).eq(tab); - - var $this = this, active = tab; - - if (active.hasClass("uk-disabled")) return; - - this.find(this.options.toggle).filter(".uk-active").removeClass("uk-active"); - active.addClass("uk-active"); - - if (this.options.connect && this.connect.length) { - - this.index = this.find(this.options.toggle).index(active); - - if (this.index == -1 ) { - this.index = 0; - } - - this.connect.each(function() { - $(this).children().removeClass("uk-active").eq($this.index).addClass("uk-active"); - UI.Utils.checkDisplay(this); - }); - } - - this.trigger("uk.switcher.show", [active]); - } - }); - - - // init code - UI.ready(function(context) { - - $("[data-uk-switcher]", context).each(function() { - var switcher = $(this); - - if (!switcher.data("switcher")) { - var obj = UI.switcher(switcher, UI.Utils.options(switcher.attr("data-uk-switcher"))); - } - }); - }); - -})(jQuery, jQuery.UIkit); - -(function($, UI) { - - "use strict"; - - - UI.component('tab', { - - defaults: { - 'target' : '>li:not(.uk-tab-responsive, .uk-disabled)', - 'connect' : false, - 'active' : 0 - }, - - init: function() { - - var $this = this; - - this.on("click", this.options.target, function(e) { - e.preventDefault(); - $this.find($this.options.target).not(this).removeClass("uk-active").blur(); - $this.trigger("uk.tab.change", [$(this).addClass("uk-active")]); - }); - - if (this.options.connect) { - this.connect = $(this.options.connect); - } - - // init responsive tab - this.responsivetab = $('
      • ').append('
          '); - - this.responsivetab.dropdown = this.responsivetab.find('.uk-dropdown'); - this.responsivetab.lst = this.responsivetab.dropdown.find('ul'); - this.responsivetab.caption = this.responsivetab.find('a:first'); - - if (this.element.hasClass("uk-tab-bottom")) this.responsivetab.dropdown.addClass("uk-dropdown-up"); - - // handle click - this.responsivetab.lst.on('click', 'a', function(e) { - - e.preventDefault(); - e.stopPropagation(); - - var link = $(this); - - $this.element.children(':not(.uk-tab-responsive)').eq(link.data('index')).trigger('click'); - }); - - this.on('uk.switcher.show uk.tab.change', function(e, tab) { - $this.responsivetab.caption.html(tab.text()); - }); - - this.element.append(this.responsivetab); - - // init UIkit components - if (this.options.connect) { - UI.switcher(this.element, {"toggle": ">li:not(.uk-tab-responsive)", "connect": this.options.connect, "active": this.options.active}); - } - - UI.dropdown(this.responsivetab, {"mode": "click"}); - - // init - $this.trigger("uk.tab.change", [this.element.find(this.options.target).filter('.uk-active')]); - - this.check(); - - UI.$win.on('resize orientationchange', UI.Utils.debounce(function(){ - $this.check(); - }, 100)); - }, - - check: function() { - - var children = this.element.children(':not(.uk-tab-responsive)').removeClass('uk-hidden'); - - if (children.length < 2) return; - - var top = (children.eq(0).offset().top + Math.ceil(children.eq(0).height()/2)), - added = 0, - doresponsive = false, - item, link; - - this.responsivetab.lst.empty(); - - children.each(function(){ - - item = $(this); - - if (item.offset().top > top || (added && this.responsivetab.offset().top > top)) { - doresponsive = true; - } - }); - - if (doresponsive) { - - for (var i = 0; i < children.length; i++) { - - item = children.eq(i); - link = item.find('a'); - - if (item.css('float') != 'none' && !item.attr('uk-dropdown')) { - - item.addClass('uk-hidden'); - - if (!item.hasClass('uk-disabled')) { - this.responsivetab.lst.append('
        • '+link.html()+'
        • '); - } - } - } - } - - this.responsivetab[this.responsivetab.lst.children().length ? 'removeClass':'addClass']('uk-hidden'); - } - }); - - // init code - UI.ready(function(context) { - - $("[data-uk-tab]", context).each(function() { - - var tab = $(this); - - if (!tab.data("tab")) { - var obj = UI.tab(tab, UI.Utils.options(tab.attr("data-uk-tab"))); - } - }); - }); - -})(jQuery, jQuery.UIkit); - -(function($, UI) { - - "use strict"; - - var $win = UI.$win, - $doc = UI.$doc, - scrollspies = [], - checkScrollSpy = function() { - for(var i=0; i < scrollspies.length; i++) { - UI.support.requestAnimationFrame.apply(window, [scrollspies[i].check]); - } - }; - - UI.component('scrollspy', { - - defaults: { - "cls" : "uk-scrollspy-inview", - "initcls" : "uk-scrollspy-init-inview", - "topoffset" : 0, - "leftoffset" : 0, - "repeat" : false, - "delay" : 0 - }, - - init: function() { - - var $this = this, idle, inviewstate, initinview, - fn = function(){ - - var inview = UI.Utils.isInView($this.element, $this.options); - - if(inview && !inviewstate) { - - if(idle) clearTimeout(idle); - - if(!initinview) { - $this.element.addClass($this.options.initcls); - $this.offset = $this.element.offset(); - initinview = true; - - $this.trigger("uk.scrollspy.init"); - } - - idle = setTimeout(function(){ - - if(inview) { - $this.element.addClass("uk-scrollspy-inview").addClass($this.options.cls).width(); - } - }, $this.options.delay); - - inviewstate = true; - $this.trigger("uk.scrollspy.inview"); - } - - if (!inview && inviewstate && $this.options.repeat) { - $this.element.removeClass("uk-scrollspy-inview").removeClass($this.options.cls); - inviewstate = false; - - $this.trigger("uk.scrollspy.outview"); - } - }; - - fn(); - - this.check = fn; - scrollspies.push(this); - } - }); - - - var scrollspynavs = [], - checkScrollSpyNavs = function() { - for(var i=0; i < scrollspynavs.length; i++) { - UI.support.requestAnimationFrame.apply(window, [scrollspynavs[i].check]); - } - }; - - UI.component('scrollspynav', { - - defaults: { - "cls" : 'uk-active', - "closest" : false, - "topoffset" : 0, - "leftoffset" : 0, - "smoothscroll" : false - }, - - init: function() { - - var ids = [], - links = this.find("a[href^='#']").each(function(){ ids.push($(this).attr("href")); }), - targets = $(ids.join(",")); - - var $this = this, inviews, fn = function(){ - - inviews = []; - - for(var i=0 ; i < targets.length ; i++) { - if(UI.Utils.isInView(targets.eq(i), $this.options)) { - inviews.push(targets.eq(i)); - } - } - - if(inviews.length) { - - var scrollTop = $win.scrollTop(), - target = (function(){ - for(var i=0; i< inviews.length;i++){ - if(inviews[i].offset().top >= scrollTop){ - return inviews[i]; - } - } - })(); - - if(!target) return; - - if($this.options.closest) { - links.closest($this.options.closest).removeClass($this.options.cls).end().filter("a[href='#"+target.attr("id")+"']").closest($this.options.closest).addClass($this.options.cls); - } else { - links.removeClass($this.options.cls).filter("a[href='#"+target.attr("id")+"']").addClass($this.options.cls); - } - } - }; - - if(this.options.smoothscroll && UI["smoothScroll"]) { - links.each(function(){ - UI.smoothScroll(this, $this.options.smoothscroll); - }); - } - - fn(); - - this.element.data("scrollspynav", this); - - this.check = fn; - scrollspynavs.push(this); - - } - }); - - - var fnCheck = function(){ - checkScrollSpy(); - checkScrollSpyNavs(); - }; - - // listen to scroll and resize - $doc.on("uk-scroll", fnCheck); - $win.on("resize orientationchange", UI.Utils.debounce(fnCheck, 50)); - - // init code - UI.ready(function(context) { - - $("[data-uk-scrollspy]", context).each(function() { - - var element = $(this); - - if (!element.data("scrollspy")) { - var obj = UI.scrollspy(element, UI.Utils.options(element.attr("data-uk-scrollspy"))); - } - }); - - $("[data-uk-scrollspy-nav]", context).each(function() { - - var element = $(this); - - if (!element.data("scrollspynav")) { - var obj = UI.scrollspynav(element, UI.Utils.options(element.attr("data-uk-scrollspy-nav"))); - } - }); - }); - -})(jQuery, jQuery.UIkit); - -(function($, UI) { - - "use strict"; - - UI.component('smoothScroll', { - - defaults: { - duration: 1000, - transition: 'easeOutExpo', - offset: 0, - complete: function(){} - }, - - init: function() { - - var $this = this; - - this.on("click", function(e) { - - // get / set parameters - var ele = ($(this.hash).length ? $(this.hash) : $("body")), - target = ele.offset().top - $this.options.offset, - docheight = UI.$doc.height(), - winheight = UI.$win.height(), - eleheight = ele.outerHeight(); - - if ((target + winheight) > docheight) { - target = docheight - winheight; - } - - // animate to target, fire callback when done - $("html,body").stop().animate({scrollTop: target}, $this.options.duration, $this.options.transition).promise().done($this.options.complete); - - // cancel default click action - return false; - }); - - } - }); - - if (!$.easing['easeOutExpo']) { - $.easing['easeOutExpo'] = function(x, t, b, c, d) { return (t == d) ? b + c : c * (-Math.pow(2, -10 * t / d) + 1) + b; }; - } - - // init code - UI.$doc.on("click.smooth-scroll.uikit", "[data-uk-smooth-scroll]", function(e) { - var ele = $(this); - - if (!ele.data("smoothScroll")) { - var obj = UI.smoothScroll(ele, UI.Utils.options(ele.attr("data-uk-smooth-scroll"))); - ele.trigger("click"); - } - - return false; - }); - -})(jQuery, jQuery.UIkit); - - -(function(global, $, UI){ - - var togglers = []; - - UI.component('toggle', { - - defaults: { - target: false, - cls: 'uk-hidden' - }, - - init: function() { - - var $this = this; - - this.getTogglers(); - - this.on("click", function(e) { - if ($this.element.is('a[href="#"]')) e.preventDefault(); - $this.toggle(); - }); - - togglers.push(this); - }, - - toggle: function() { - - if(!this.totoggle.length) return; - - this.totoggle.toggleClass(this.options.cls); - - if (this.options.cls == 'uk-hidden') { - UI.Utils.checkDisplay(this.totoggle); - } - }, - - getTogglers: function() { - this.totoggle = this.options.target ? $(this.options.target):[]; - } - }); - - // init code - UI.ready(function(context) { - - $("[data-uk-toggle]", context).each(function() { - var ele = $(this); - - if (!ele.data("toggle")) { - var obj = UI.toggle(ele, UI.Utils.options(ele.attr("data-uk-toggle"))); - } - }); - - setTimeout(function(){ - - togglers.forEach(function(toggler){ - toggler.getTogglers(); - }); - - }, 0); - }); - -})(this, jQuery, jQuery.UIkit); \ No newline at end of file diff --git a/web/js/uikit.min.js b/web/js/uikit.min.js deleted file mode 100755 index 1a1539b..0000000 --- a/web/js/uikit.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! UIkit 2.9.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ - -!function(a){if("function"==typeof define&&define.amd&&define("uikit",function(){var b=a(window,window.jQuery,window.document);return b.load=function(a,c,d,e){var f,g=a.split(","),h=[],i=(e.config&&e.config.uikit&&e.config.uikit.base?e.config.uikit.base:"").replace(/\/+$/g,"");if(!i)throw new Error("Please define base path to UIkit in the requirejs config.");for(f=0;f0||a.navigator.pointerEnabled&&a.navigator.maxTouchPoints>0||!1,d.support.mutationobserver=a.MutationObserver||a.WebKitMutationObserver||null,d.Utils={},d.Utils.debounce=function(a,b,c){var d;return function(){var e=this,f=arguments,g=function(){d=null,c||a.apply(e,f)},h=c&&!d;clearTimeout(d),d=setTimeout(g,b),h&&a.apply(e,f)}},d.Utils.removeCssRules=function(a){var b,c,d,e,f,g,h,i,j,k;a&&setTimeout(function(){try{for(k=document.styleSheets,e=0,h=k.length;h>e;e++){for(d=k[e],c=[],d.cssRules=d.cssRules,b=f=0,i=d.cssRules.length;i>f;b=++f)d.cssRules[b].type===CSSRule.STYLE_RULE&&a.test(d.cssRules[b].selectorText)&&c.unshift(b);for(g=0,j=c.length;j>g;g++)d.deleteRule(c[g])}}catch(l){}},0)},d.Utils.isInView=function(a,c){var d=b(a);if(!d.is(":visible"))return!1;var e=f.scrollLeft(),g=f.scrollTop(),h=d.offset(),i=h.left,j=h.top;return c=b.extend({topoffset:0,leftoffset:0},c),j+d.height()>=g&&j-c.topoffset<=g+f.height()&&i+d.width()>=e&&i-c.leftoffset<=e+f.width()?!0:!1},d.Utils.checkDisplay=function(a){b("[data-uk-margin], [data-uk-grid-match], [data-uk-grid-margin], [data-uk-check-display]",a||document).trigger("uk-check-display")},d.Utils.options=function(a){if(b.isPlainObject(a))return a;var c=a?a.indexOf("{"):-1,d={};if(-1!=c)try{d=new Function("","var json = "+a.substr(c)+"; return JSON.parse(JSON.stringify(json));")()}catch(e){}return d},d.Utils.template=function(a,b){for(var c,d,e,f,g=a.replace(/\n/g,"\\n").replace(/\{\{\{\s*(.+?)\s*\}\}\}/g,"{{!$1}}").split(/(\{\{\s*(.+?)\s*\}\})/g),h=0,i=[],j=0;h/g, '>');}"].join("\n");var k=new Function("$data",f);return b?k(b):k},d.Utils.events={},d.Utils.events.click=d.support.touch?"tap":"click",b.UIkit=d,b.fn.uk=d.fn,b.UIkit.langdirection="rtl"==e.attr("dir")?"right":"left",d.domObservers=[],d.domObserve=function(a,c){d.support.mutationobserver&&b(a).each(function(){var a=this;try{var e=new d.support.mutationobserver(d.Utils.debounce(function(){c.apply(a,[]),b(a).trigger("uk.dom.changed")},50));e.observe(a,{childList:!0,subtree:!0})}catch(f){}})},d.ready=function(a){b(function(){a(document)}),d.domObservers.push(a)},g.on("uk.domready",function(){d.domObservers.forEach(function(a){a(document)}),g.trigger("uk.dom.changed")}),b(function(){setInterval(function(){var a={x:window.pageXOffset,y:window.pageYOffset},c=function(){(a.x!=window.pageXOffset||a.y!=window.pageYOffset)&&(a={x:window.pageXOffset,y:window.pageYOffset},g.trigger("uk-scroll",[a]))};return b.UIkit.support.touch&&g.on("touchmove touchend MSPointerMove MSPointerUp",c),(a.x||a.y)&&c(),c}(),15),d.domObserve("[data-uk-observe]",function(){var a=this;d.domObservers.forEach(function(b){b(a)})}),d.support.touch&&navigator.userAgent.match(/(iPad|iPhone|iPod)/g)&&d.$win.on("load orientationchange resize",d.Utils.debounce(function(){var a=function(){return b(".uk-height-viewport").css("height",window.innerHeight),a};return a()}(),100))}),e.addClass(d.support.touch?"uk-touch":"uk-notouch"),d.support.touch){var h,i=!1,j=".uk-overlay, .uk-overlay-toggle, .uk-has-hover";g.on("touchstart MSPointerDown",j,function(){i&&b(".uk-hover").removeClass("uk-hover"),i=b(this).addClass("uk-hover")}).on("touchend MSPointerUp",function(a){h=b(a.target).parents(j),i&&i.not(h).removeClass("uk-hover")})}return d}),function(a,b){"use strict";b.components={},b.component=function(c,d){var e=function(b,d){var f=this;this.element=b?a(b):null,this.options=a.extend(!0,{},this.defaults,d),this.plugins={},this.element&&this.element.data(c,this),this.init(),(this.options.plugins.length?this.options.plugins:Object.keys(e.plugins)).forEach(function(a){e.plugins[a].init&&(e.plugins[a].init(f),f.plugins[a]=!0)}),this.trigger("init",[this])};return e.plugins={},a.extend(!0,e.prototype,{defaults:{plugins:[]},init:function(){},on:function(){return a(this.element||this).on.apply(this.element||this,arguments)},one:function(){return a(this.element||this).one.apply(this.element||this,arguments)},off:function(b){return a(this.element||this).off(b)},trigger:function(b,c){return a(this.element||this).trigger(b,c)},find:function(b){return this.element?this.element.find(b):a([])},proxy:function(a,b){var c=this;b.split(" ").forEach(function(b){c[b]||(c[b]=function(){return a[b].apply(a,arguments)})})},mixin:function(a,b){var c=this;b.split(" ").forEach(function(b){c[b]||(c[b]=a[b].bind(c))})}},d),this.components[c]=e,this[c]=function(){var d,e;if(arguments.length)switch(arguments.length){case 1:"string"==typeof arguments[0]||arguments[0].nodeType||arguments[0]instanceof jQuery?d=a(arguments[0]):e=arguments[0];break;case 2:d=a(arguments[0]),e=arguments[1]}return d&&d.data(c)?d.data(c):new b.components[c](d,e)},e},b.plugin=function(a,b,c){this.components[a].plugins[b]=c}}(jQuery,jQuery.UIkit),function(a,b){"use strict";var c=[];b.component("stackMargin",{defaults:{cls:"uk-margin-small-top"},init:function(){var d=this;this.columns=this.element.children(),this.columns.length&&(b.$win.on("resize orientationchange",function(){var c=function(){d.process()};return a(function(){c(),b.$win.on("load",c)}),b.Utils.debounce(c,50)}()),b.$doc.on("uk.dom.changed",function(){d.columns=d.element.children(),d.process()}),this.on("uk-check-display",function(){this.element.is(":visible")&&this.process()}.bind(this)),c.push(this))},process:function(){var b=this;this.revert();var c=!1,d=this.columns.filter(":visible:first"),e=d.length?d.offset().top:!1;if(e!==!1)return this.columns.each(function(){var d=a(this);d.is(":visible")&&(c?d.addClass(b.options.cls):d.offset().top!=e&&(d.addClass(b.options.cls),c=!0))}),this},revert:function(){return this.columns.removeClass(this.options.cls),this}}),b.ready(function(c){a("[data-uk-margin]",c).each(function(){var c,d=a(this);d.data("stackMargin")||(c=b.stackMargin(d,b.Utils.options(d.attr("data-uk-margin"))))})})}(jQuery,jQuery.UIkit),function(a){function b(a,b,c,d){return Math.abs(a-b)>=Math.abs(c-d)?a-b>0?"Left":"Right":c-d>0?"Up":"Down"}function c(){j=null,l.last&&(l.el.trigger("longTap"),l={})}function d(){j&&clearTimeout(j),j=null}function e(){g&&clearTimeout(g),h&&clearTimeout(h),i&&clearTimeout(i),j&&clearTimeout(j),g=h=i=j=null,l={}}function f(a){return a.pointerType==a.MSPOINTER_TYPE_TOUCH&&a.isPrimary}var g,h,i,j,k,l={},m=750;a(function(){var n,o,p,q=0,r=0;"MSGesture"in window&&(k=new MSGesture,k.target=document.body),a(document).bind("MSGestureEnd",function(a){var b=a.originalEvent.velocityX>1?"Right":a.originalEvent.velocityX<-1?"Left":a.originalEvent.velocityY>1?"Down":a.originalEvent.velocityY<-1?"Up":null;b&&(l.el.trigger("swipe"),l.el.trigger("swipe"+b))}).on("touchstart MSPointerDown",function(b){("MSPointerDown"!=b.type||f(b.originalEvent))&&(p="MSPointerDown"==b.type?b:b.originalEvent.touches[0],n=Date.now(),o=n-(l.last||n),l.el=a("tagName"in p.target?p.target:p.target.parentNode),g&&clearTimeout(g),l.x1=p.pageX,l.y1=p.pageY,o>0&&250>=o&&(l.isDoubleTap=!0),l.last=n,j=setTimeout(c,m),k&&"MSPointerDown"==b.type&&k.addPointer(b.originalEvent.pointerId))}).on("touchmove MSPointerMove",function(a){("MSPointerMove"!=a.type||f(a.originalEvent))&&(p="MSPointerMove"==a.type?a:a.originalEvent.touches[0],d(),l.x2=p.pageX,l.y2=p.pageY,q+=Math.abs(l.x1-l.x2),r+=Math.abs(l.y1-l.y2))}).on("touchend MSPointerUp",function(c){("MSPointerUp"!=c.type||f(c.originalEvent))&&(d(),l.x2&&Math.abs(l.x1-l.x2)>30||l.y2&&Math.abs(l.y1-l.y2)>30?i=setTimeout(function(){l.el.trigger("swipe"),l.el.trigger("swipe"+b(l.x1,l.x2,l.y1,l.y2)),l={}},0):"last"in l&&(isNaN(q)||30>q&&30>r?h=setTimeout(function(){var b=a.Event("tap");b.cancelTouch=e,l.el.trigger(b),l.isDoubleTap?(l.el.trigger("doubleTap"),l={}):g=setTimeout(function(){g=null,l.el.trigger("singleTap"),l={}},250)},0):l={},q=r=0))}).on("touchcancel MSPointerCancel",e),a(window).on("scroll",e)}),["swipe","swipeLeft","swipeRight","swipeUp","swipeDown","doubleTap","tap","singleTap","longTap"].forEach(function(b){a.fn[b]=function(c){return a(this).on(b,c)}})}(jQuery),function(a,b){"use strict";b.component("alert",{defaults:{fade:!0,duration:200,trigger:".uk-alert-close"},init:function(){var a=this;this.on("click",this.options.trigger,function(b){b.preventDefault(),a.close()})},close:function(){function a(){b.trigger("closed").remove()}var b=this.trigger("close");this.options.fade?b.css("overflow","hidden").css("max-height",b.height()).animate({height:0,opacity:0,"padding-top":0,"padding-bottom":0,"margin-top":0,"margin-bottom":0},this.options.duration,a):a()}}),b.$doc.on("click.alert.uikit","[data-uk-alert]",function(c){var d=a(this);if(!d.data("alert")){var e=b.alert(d,b.Utils.options(d.data("uk-alert")));a(c.target).is(d.data("alert").options.trigger)&&(c.preventDefault(),e.close())}})}(jQuery,jQuery.UIkit),function(a,b){"use strict";b.component("buttonRadio",{defaults:{target:".uk-button"},init:function(){var b=this;this.on("click",this.options.target,function(c){a(this).is('a[href="#"]')&&c.preventDefault(),b.find(b.options.target).not(this).removeClass("uk-active").blur(),b.trigger("change",[a(this).addClass("uk-active")])})},getSelected:function(){return this.find(".uk-active")}}),b.component("buttonCheckbox",{defaults:{target:".uk-button"},init:function(){var b=this;this.on("click",this.options.target,function(c){a(this).is('a[href="#"]')&&c.preventDefault(),b.trigger("change",[a(this).toggleClass("uk-active").blur()])})},getSelected:function(){return this.find(".uk-active")}}),b.component("button",{defaults:{},init:function(){var a=this;this.on("click",function(b){a.element.is('a[href="#"]')&&b.preventDefault(),a.toggle(),a.trigger("change",[$element.blur().hasClass("uk-active")])})},toggle:function(){this.element.toggleClass("uk-active")}}),b.$doc.on("click.buttonradio.uikit","[data-uk-button-radio]",function(c){var d=a(this);if(!d.data("buttonRadio")){var e=b.buttonRadio(d,b.Utils.options(d.attr("data-uk-button-radio")));a(c.target).is(e.options.target)&&a(c.target).trigger("click")}}),b.$doc.on("click.buttoncheckbox.uikit","[data-uk-button-checkbox]",function(c){var d=a(this);if(!d.data("buttonCheckbox")){var e=b.buttonCheckbox(d,b.Utils.options(d.attr("data-uk-button-checkbox"))),f=a(c.target);f.is(e.options.target)&&d.trigger("change",[f.toggleClass("uk-active").blur()])}}),b.$doc.on("click.button.uikit","[data-uk-button]",function(){var c=a(this);if(!c.data("button")){{b.button(c,b.Utils.options(c.attr("data-uk-button")))}c.trigger("click")}})}(jQuery,jQuery.UIkit),function(a,b){"use strict";var c,d=!1;b.component("dropdown",{defaults:{mode:"hover",remaintime:800,justify:!1,boundary:b.$win,delay:0},remainIdle:!1,init:function(){var e=this;this.dropdown=this.find(".uk-dropdown"),this.centered=this.dropdown.hasClass("uk-dropdown-center"),this.justified=this.options.justify?a(this.options.justify):!1,this.boundary=a(this.options.boundary),this.flipped=this.dropdown.hasClass("uk-dropdown-flip"),this.boundary.length||(this.boundary=b.$win),"click"==this.options.mode||b.support.touch?this.on("click",function(b){var c=a(b.target);c.parents(".uk-dropdown").length||((c.is("a[href='#']")||c.parent().is("a[href='#']"))&&b.preventDefault(),c.blur()),e.element.hasClass("uk-open")?(c.is("a:not(.js-uk-prevent)")||c.is(".uk-dropdown-close")||!e.dropdown.find(b.target).length)&&(e.element.removeClass("uk-open"),d=!1):e.show()}):this.on("mouseenter",function(){e.remainIdle&&clearTimeout(e.remainIdle),c&&clearTimeout(c),c=setTimeout(e.show.bind(e),e.options.delay)}).on("mouseleave",function(){c&&clearTimeout(c),e.remainIdle=setTimeout(function(){e.element.removeClass("uk-open"),e.remainIdle=!1,d&&d[0]==e.element[0]&&(d=!1)},e.options.remaintime)}).on("click",function(b){var c=a(b.target);e.remainIdle&&clearTimeout(e.remainIdle),(c.is("a[href='#']")||c.parent().is("a[href='#']"))&&b.preventDefault(),e.show()})},show:function(){d&&d[0]!=this.element[0]&&d.removeClass("uk-open"),c&&clearTimeout(c),this.checkDimensions(),this.element.addClass("uk-open"),this.trigger("uk.dropdown.show",[this]),b.Utils.checkDisplay(this.dropdown),d=this.element,this.registerOuterClick()},registerOuterClick:function(){var e=this;b.$doc.off("click.outer.dropdown"),setTimeout(function(){b.$doc.on("click.outer.dropdown",function(f){c&&clearTimeout(c);var g=a(f.target);d&&d[0]==e.element[0]&&(g.is("a:not(.js-uk-prevent)")||g.is(".uk-dropdown-close")||!e.dropdown.find(f.target).length)&&(d.removeClass("uk-open"),b.$doc.off("click.outer.dropdown"))})},10)},checkDimensions:function(){if(this.dropdown.length){this.justified&&this.justified.length&&this.dropdown.css("min-width","");var b=this,c=this.dropdown.css("margin-"+a.UIkit.langdirection,""),d=c.show().offset(),e=c.outerWidth(),f=this.boundary.width(),g=this.boundary.offset()?this.boundary.offset().left:0;if(this.centered&&(c.css("margin-"+a.UIkit.langdirection,-1*(parseFloat(e)/2-c.parent().width()/2)),d=c.offset(),(e+d.left>f||d.left<0)&&(c.css("margin-"+a.UIkit.langdirection,""),d=c.offset())),this.justified&&this.justified.length){var h=this.justified.outerWidth();if(c.css("min-width",h),"right"==a.UIkit.langdirection){var i=f-(this.justified.offset().left+h),j=f-(c.offset().left+c.outerWidth());c.css("margin-right",i-j)}else c.css("margin-left",this.justified.offset().left-d.left);d=c.offset()}e+(d.left-g)>f&&(c.addClass("uk-dropdown-flip"),d=c.offset()),d.left-g<0&&(c.addClass("uk-dropdown-stack"),c.hasClass("uk-dropdown-flip")&&(this.flipped||(c.removeClass("uk-dropdown-flip"),d=c.offset(),c.addClass("uk-dropdown-flip")),setTimeout(function(){(c.offset().left-g<0||!b.flipped&&c.outerWidth()+(d.left-g)=100?!0:!1,d=this;if(!c)return this.options.row?(this.element.width(),setTimeout(function(){var b=!1,c=[];d.elements.each(function(){var e=a(this),f=e.offset().top;f!=b&&c.length&&(d.matchHeights(a(c)),c=[],f=e.offset().top),c.push(e),b=f}),c.length&&d.matchHeights(a(c))},0)):this.matchHeights(this.elements),this}},revert:function(){return this.elements.css("min-height",""),this},matchHeights:function(b){if(!(b.length<2)){var c=0;b.each(function(){c=Math.max(c,a(this).outerHeight())}).each(function(){var b=a(this),d=c-(b.outerHeight()-b.height());b.css("min-height",d+"px")})}}}),b.component("gridMargin",{defaults:{cls:"uk-grid-margin"},init:function(){b.stackMargin(this.element,this.options)}}),b.ready(function(c){a("[data-uk-grid-match],[data-uk-grid-margin]",c).each(function(){var c,d=a(this);d.is("[data-uk-grid-match]")&&!d.data("gridMatchHeight")&&(c=b.gridMatchHeight(d,b.Utils.options(d.attr("data-uk-grid-match")))),d.is("[data-uk-grid-margin]")&&!d.data("gridMargin")&&(c=b.gridMargin(d,b.Utils.options(d.attr("data-uk-grid-margin"))))})})}(jQuery,jQuery.UIkit),function(a,b){"use strict";function c(b,c){return c?("object"==typeof b?(b=b instanceof jQuery?b:a(b),b.parent().length&&(c.persist=b,c.persist.data("modalPersistParent",b.parent()))):b=a("
          ").html("string"==typeof b||"number"==typeof b?b:"$.UIkitt.modal Error: Unsupported data type: "+typeof b),b.appendTo(c.element.find(".uk-modal-dialog")),c):void 0}var d,e=!1,f=a("html");b.component("modal",{defaults:{keyboard:!0,bgclose:!0,minScrollHeight:150},scrollable:!1,transition:!1,init:function(){d||(d=a("body"));var c=this;this.transition=b.support.transition,this.dialog=this.find(".uk-modal-dialog"),this.on("click",".uk-modal-close",function(a){a.preventDefault(),c.hide()}).on("click",function(b){var d=a(b.target);d[0]==c.element[0]&&c.options.bgclose&&c.hide()})},toggle:function(){return this[this.isActive()?"hide":"show"]()},show:function(){if(!this.isActive())return e&&e.hide(!0),this.element.removeClass("uk-open").show(),this.resize(),e=this,f.addClass("uk-modal-page").height(),this.element.addClass("uk-open").trigger("uk.modal.show"),b.Utils.checkDisplay(this.dialog),this},hide:function(a){if(this.isActive()){if(!a&&b.support.transition){var c=this;this.one(b.support.transition.end,function(){c._hide()}).removeClass("uk-open")}else this._hide();return this}},resize:function(){var a="padding-"+("left"==b.langdirection?"left":"right"),c="margin-"+("left"==b.langdirection?"left":"right"),e=d.width();this.scrollbarwidth=window.innerWidth-e,f.css(c,-1*this.scrollbarwidth),this.element.css(a,""),this.dialog.offset().left>this.scrollbarwidth&&this.element.css(a,this.scrollbarwidth-(this.element[0].scrollHeight==window.innerHeight?0:this.scrollbarwidth)),this.updateScrollable()},updateScrollable:function(){var a=this.dialog.find(".uk-overflow-container:visible:first");if(a){a.css("height",0);var b=Math.abs(parseInt(this.dialog.css("margin-top"),10)),c=this.dialog.outerHeight(),d=window.innerHeight,e=d-2*(20>b?20:b)-c;a.css("height",e
          ',b.modal.alert=function(c,d){b.modal.dialog(['
          '+String(c)+"
          ",'
          '].join(""),a.extend({bgclose:!1,keyboard:!1},d)).show()},b.modal.confirm=function(c,d,e){d=a.isFunction(d)?d:function(){};var f=b.modal.dialog(['
          '+String(c)+"
          ",'
          '].join(""),a.extend({bgclose:!1,keyboard:!1},e));f.element.find(".js-modal-confirm").on("click",function(){d(),f.hide()}),f.show()},b.$doc.on("click.modal.uikit","[data-uk-modal]",function(c){var d=a(this);if(d.is("a")&&c.preventDefault(),!d.data("modalTrigger")){var e=b.modalTrigger(d,b.Utils.options(d.attr("data-uk-modal")));e.show()}}),b.$doc.on("keydown.modal.uikit",function(a){e&&27===a.keyCode&&e.options.keyboard&&(a.preventDefault(),e.hide())}),b.$win.on("resize orientationchange",b.Utils.debounce(function(){e&&e.resize()},150))}(jQuery,jQuery.UIkit),function(a,b){"use strict";var c={x:window.scrollX,y:window.scrollY},d=b.$win,e=b.$doc,f=a("html"),g={show:function(b){if(b=a(b),b.length){var h=a("body"),i=(d.width(),b.find(".uk-offcanvas-bar:first")),j="right"==a.UIkit.langdirection,k=i.hasClass("uk-offcanvas-bar-flip")?-1:1,l=k*(j?-1:1);c={x:window.pageXOffset,y:window.pageYOffset},b.addClass("uk-active"),h.css({width:window.innerWidth,height:d.height()}).addClass("uk-offcanvas-page"),h.css(j?"margin-right":"margin-left",(j?-1:1)*i.outerWidth()*l).width(),f.css("margin-top",-1*c.y),i.addClass("uk-offcanvas-bar-show"),b.off(".ukoffcanvas").on("click.ukoffcanvas swipeRight.ukoffcanvas swipeLeft.ukoffcanvas",function(b){var c=a(b.target);if(!b.type.match(/swipe/)&&!c.hasClass("uk-offcanvas-close")){if(c.hasClass("uk-offcanvas-bar"))return;if(c.parents(".uk-offcanvas-bar:first").length)return}b.stopImmediatePropagation(),g.hide()}),e.on("keydown.ukoffcanvas",function(a){27===a.keyCode&&g.hide()}),e.trigger("uk.offcanvas.show",[b,i])}},hide:function(b){var d=a("body"),g=a(".uk-offcanvas.uk-active"),h="right"==a.UIkit.langdirection,i=g.find(".uk-offcanvas-bar:first"),j=function(){d.removeClass("uk-offcanvas-page").css({width:"",height:"","margin-left":"","margin-right":""}),g.removeClass("uk-active"),i.removeClass("uk-offcanvas-bar-show"),f.css("margin-top",""),window.scrollTo(c.x,c.y),e.trigger("uk.offcanvas.hide",[g,i])};g.length&&(a.UIkit.support.transition&&!b?(d.one(a.UIkit.support.transition.end,function(){j()}).css(h?"margin-right":"margin-left",""),setTimeout(function(){i.removeClass("uk-offcanvas-bar-show")},0)):j(),g.off(".ukoffcanvas"),e.off(".ukoffcanvas"))}};b.component("offcanvasTrigger",{init:function(){var b=this;this.options=a.extend({target:b.element.is("a")?b.element.attr("href"):!1},this.options),this.on("click",function(a){a.preventDefault(),g.show(b.options.target)})}}),b.offcanvas=g,e.on("click.offcanvas.uikit","[data-uk-offcanvas]",function(c){c.preventDefault();var d=a(this);if(!d.data("offcanvasTrigger")){{b.offcanvasTrigger(d,b.Utils.options(d.attr("data-uk-offcanvas")))}d.trigger("click")}})}(jQuery,jQuery.UIkit),function(a,b){"use strict";function c(b){var c=a(b),d="auto";if(c.is(":visible"))d=c.outerHeight();else{var e={position:c.css("position"),visibility:c.css("visibility"),display:c.css("display")};d=c.css({position:"absolute",visibility:"hidden",display:"block"}).outerHeight(),c.css(e)}return d}b.component("nav",{defaults:{toggle:">li.uk-parent > a[href='#']",lists:">li.uk-parent > ul",multiple:!1},init:function(){var b=this;this.on("click",this.options.toggle,function(c){c.preventDefault();var d=a(this);b.open(d.parent()[0]==b.element[0]?d:d.parent("li"))}),this.find(this.options.lists).each(function(){var c=a(this),d=c.parent(),e=d.hasClass("uk-active");c.wrap('
          '),d.data("list-container",c.parent()),e&&b.open(d,!0)})},open:function(b,d){var e=this.element,f=a(b);this.options.multiple||e.children(".uk-open").not(b).each(function(){a(this).data("list-container")&&a(this).data("list-container").stop().animate({height:0},function(){a(this).parent().removeClass("uk-open")})}),f.toggleClass("uk-open"),f.data("list-container")&&(d?f.data("list-container").stop().height(f.hasClass("uk-open")?"auto":0):f.data("list-container").stop().animate({height:f.hasClass("uk-open")?c(f.data("list-container").find("ul:first")):0}))}}),b.ready(function(c){a("[data-uk-nav]",c).each(function(){var c=a(this);if(!c.data("nav")){b.nav(c,b.Utils.options(c.attr("data-uk-nav")))}})})}(jQuery,jQuery.UIkit),function(a,b,c){"use strict";var d,e,f;b.component("tooltip",{defaults:{offset:5,pos:"top",animation:!1,delay:0,cls:"",src:function(){return this.attr("title")}},tip:"",init:function(){var b=this;d||(d=a('
          ').appendTo("body")),this.on({focus:function(){b.show()},blur:function(){b.hide()},mouseenter:function(){b.show()},mouseleave:function(){b.hide()}}),this.tip="function"==typeof this.options.src?this.options.src.call(this.element):this.options.src,this.element.attr("data-cached-title",this.element.attr("title")).attr("title","")},show:function(){if(e&&clearTimeout(e),f&&clearTimeout(f),this.tip.length){d.stop().css({top:-2e3,visibility:"hidden"}).show(),d.html('
          '+this.tip+"
          ");var b=this,c=a.extend({},this.element.offset(),{width:this.element[0].offsetWidth,height:this.element[0].offsetHeight}),g=d[0].offsetWidth,h=d[0].offsetHeight,i="function"==typeof this.options.offset?this.options.offset.call(this.element):this.options.offset,j="function"==typeof this.options.pos?this.options.pos.call(this.element):this.options.pos,k=j.split("-"),l={display:"none",visibility:"visible",top:c.top+c.height+h,left:c.left};if("fixed"==a("html").css("position")||"fixed"==a("body").css("position")){var m=a("body").offset(),n=a("html").offset(),o={top:n.top+m.top,left:n.left+m.left};c.left-=o.left,c.top-=o.top}"left"!=k[0]&&"right"!=k[0]||"right"!=a.UIkit.langdirection||(k[0]="left"==k[0]?"right":"left");var p={bottom:{top:c.top+c.height+i,left:c.left+c.width/2-g/2},top:{top:c.top-h-i,left:c.left+c.width/2-g/2},left:{top:c.top+c.height/2-h/2,left:c.left-g-i},right:{top:c.top+c.height/2-h/2,left:c.left+c.width+i}};a.extend(l,p[k[0]]),2==k.length&&(l.left="left"==k[1]?c.left:c.left+c.width-g);var q=this.checkBoundary(l.left,l.top,g,h);if(q){switch(q){case"x":j=2==k.length?k[0]+"-"+(l.left<0?"left":"right"):l.left<0?"right":"left";break;case"y":j=2==k.length?(l.top<0?"bottom":"top")+"-"+k[1]:l.top<0?"bottom":"top";break;case"xy":j=2==k.length?(l.top<0?"bottom":"top")+"-"+(l.left<0?"left":"right"):l.left<0?"right":"left"}k=j.split("-"),a.extend(l,p[k[0]]),2==k.length&&(l.left="left"==k[1]?c.left:c.left+c.width-g)}l.left-=a("body").position().left,e=setTimeout(function(){d.css(l).attr("class",["uk-tooltip","uk-tooltip-"+j,b.options.cls].join(" ")),b.options.animation?d.css({opacity:0,display:"block"}).animate({opacity:1},parseInt(b.options.animation,10)||400):d.show(),e=!1,f=setInterval(function(){b.element.is(":visible")||b.hide()},150)},parseInt(this.options.delay,10)||0)}},hide:function(){this.element.is("input")&&this.element[0]===document.activeElement||(e&&clearTimeout(e),f&&clearTimeout(f),d.stop(),this.options.animation?d.fadeOut(parseInt(this.options.animation,10)||400):d.hide())},content:function(){return this.tip},checkBoundary:function(a,b,d,e){var f="";return(0>a||a-c.scrollLeft()+d>window.innerWidth)&&(f+="x"),(0>b||b-c.scrollTop()+e>window.innerHeight)&&(f+="y"),f}}),b.$doc.on("mouseenter.tooltip.uikit focus.tooltip.uikit","[data-uk-tooltip]",function(){var c=a(this);if(!c.data("tooltip")){{b.tooltip(c,b.Utils.options(c.attr("data-uk-tooltip")))}c.trigger("mouseenter")}})}(jQuery,jQuery.UIkit,jQuery(window)),function(a,b){"use strict";b.component("switcher",{defaults:{connect:!1,toggle:">*",active:0},init:function(){var b=this;if(this.on("click",this.options.toggle,function(a){a.preventDefault(),b.show(this)}),this.options.connect){this.connect=a(this.options.connect).find(".uk-active").removeClass(".uk-active").end(),this.connect.length&&this.connect.on("click","[data-uk-switcher-item]",function(c){c.preventDefault();var d=a(this).data("ukSwitcherItem");if(b.index!=d)switch(d){case"next":case"previous":b.show(b.index+("next"==d?1:-1));break;default:b.show(d)}});var c=this.find(this.options.toggle),d=c.filter(".uk-active");d.length?this.show(d):(d=c.eq(this.options.active),this.show(d.length?d:c.eq(0)))}},show:function(c){c=isNaN(c)?a(c):this.find(this.options.toggle).eq(c);var d=this,e=c;e.hasClass("uk-disabled")||(this.find(this.options.toggle).filter(".uk-active").removeClass("uk-active"),e.addClass("uk-active"),this.options.connect&&this.connect.length&&(this.index=this.find(this.options.toggle).index(e),-1==this.index&&(this.index=0),this.connect.each(function(){a(this).children().removeClass("uk-active").eq(d.index).addClass("uk-active"),b.Utils.checkDisplay(this)})),this.trigger("uk.switcher.show",[e]))}}),b.ready(function(c){a("[data-uk-switcher]",c).each(function(){var c=a(this);if(!c.data("switcher")){b.switcher(c,b.Utils.options(c.attr("data-uk-switcher")))}})})}(jQuery,jQuery.UIkit),function(a,b){"use strict";b.component("tab",{defaults:{target:">li:not(.uk-tab-responsive, .uk-disabled)",connect:!1,active:0},init:function(){var c=this;this.on("click",this.options.target,function(b){b.preventDefault(),c.find(c.options.target).not(this).removeClass("uk-active").blur(),c.trigger("uk.tab.change",[a(this).addClass("uk-active")])}),this.options.connect&&(this.connect=a(this.options.connect)),this.responsivetab=a('
        • ').append('
            '),this.responsivetab.dropdown=this.responsivetab.find(".uk-dropdown"),this.responsivetab.lst=this.responsivetab.dropdown.find("ul"),this.responsivetab.caption=this.responsivetab.find("a:first"),this.element.hasClass("uk-tab-bottom")&&this.responsivetab.dropdown.addClass("uk-dropdown-up"),this.responsivetab.lst.on("click","a",function(b){b.preventDefault(),b.stopPropagation(); -var d=a(this);c.element.children(":not(.uk-tab-responsive)").eq(d.data("index")).trigger("click")}),this.on("uk.switcher.show uk.tab.change",function(a,b){c.responsivetab.caption.html(b.text())}),this.element.append(this.responsivetab),this.options.connect&&b.switcher(this.element,{toggle:">li:not(.uk-tab-responsive)",connect:this.options.connect,active:this.options.active}),b.dropdown(this.responsivetab,{mode:"click"}),c.trigger("uk.tab.change",[this.element.find(this.options.target).filter(".uk-active")]),this.check(),b.$win.on("resize orientationchange",b.Utils.debounce(function(){c.check()},100))},check:function(){var b=this.element.children(":not(.uk-tab-responsive)").removeClass("uk-hidden");if(!(b.length<2)){var c,d,e=b.eq(0).offset().top+Math.ceil(b.eq(0).height()/2),f=0,g=!1;if(this.responsivetab.lst.empty(),b.each(function(){c=a(this),(c.offset().top>e||f&&this.responsivetab.offset().top>e)&&(g=!0)}),g)for(var h=0;h'+d.html()+""));this.responsivetab[this.responsivetab.lst.children().length?"removeClass":"addClass"]("uk-hidden")}}}),b.ready(function(c){a("[data-uk-tab]",c).each(function(){var c=a(this);if(!c.data("tab")){b.tab(c,b.Utils.options(c.attr("data-uk-tab")))}})})}(jQuery,jQuery.UIkit),function(a,b){"use strict";var c=b.$win,d=b.$doc,e=[],f=function(){for(var a=0;a=e)return d[a]}();if(!g)return;i.options.closest?f.closest(i.options.closest).removeClass(i.options.cls).end().filter("a[href='#"+g.attr("id")+"']").closest(i.options.closest).addClass(i.options.cls):f.removeClass(i.options.cls).filter("a[href='#"+g.attr("id")+"']").addClass(i.options.cls)}};this.options.smoothscroll&&b.smoothScroll&&f.each(function(){b.smoothScroll(this,i.options.smoothscroll)}),j(),this.element.data("scrollspynav",this),this.check=j,g.push(this)}});var i=function(){f(),h()};d.on("uk-scroll",i),c.on("resize orientationchange",b.Utils.debounce(i,50)),b.ready(function(c){a("[data-uk-scrollspy]",c).each(function(){var c=a(this);if(!c.data("scrollspy")){b.scrollspy(c,b.Utils.options(c.attr("data-uk-scrollspy")))}}),a("[data-uk-scrollspy-nav]",c).each(function(){var c=a(this);if(!c.data("scrollspynav")){b.scrollspynav(c,b.Utils.options(c.attr("data-uk-scrollspy-nav")))}})})}(jQuery,jQuery.UIkit),function(a,b){"use strict";b.component("smoothScroll",{defaults:{duration:1e3,transition:"easeOutExpo",offset:0,complete:function(){}},init:function(){var c=this;this.on("click",function(){{var d=a(a(this.hash).length?this.hash:"body"),e=d.offset().top-c.options.offset,f=b.$doc.height(),g=b.$win.height();d.outerHeight()}return e+g>f&&(e=f-g),a("html,body").stop().animate({scrollTop:e},c.options.duration,c.options.transition).promise().done(c.options.complete),!1})}}),a.easing.easeOutExpo||(a.easing.easeOutExpo=function(a,b,c,d,e){return b==e?c+d:d*(-Math.pow(2,-10*b/e)+1)+c}),b.$doc.on("click.smooth-scroll.uikit","[data-uk-smooth-scroll]",function(){var c=a(this);if(!c.data("smoothScroll")){{b.smoothScroll(c,b.Utils.options(c.attr("data-uk-smooth-scroll")))}c.trigger("click")}return!1})}(jQuery,jQuery.UIkit),function(a,b,c){var d=[];c.component("toggle",{defaults:{target:!1,cls:"uk-hidden"},init:function(){var a=this;this.getTogglers(),this.on("click",function(b){a.element.is('a[href="#"]')&&b.preventDefault(),a.toggle()}),d.push(this)},toggle:function(){this.totoggle.length&&(this.totoggle.toggleClass(this.options.cls),"uk-hidden"==this.options.cls&&c.Utils.checkDisplay(this.totoggle))},getTogglers:function(){this.totoggle=this.options.target?b(this.options.target):[]}}),c.ready(function(a){b("[data-uk-toggle]",a).each(function(){var a=b(this);if(!a.data("toggle")){c.toggle(a,c.Utils.options(a.attr("data-uk-toggle")))}}),setTimeout(function(){d.forEach(function(a){a.getTogglers()})},0)})}(this,jQuery,jQuery.UIkit); \ No newline at end of file