~laumann/laumann.xyz

3a777efb87b5d978b8cb5f2f4ed880e0f48b1f1a — Thomas Bracht Laumann Jespersen 5 months ago 8ad9256
Major stylistic overhaul

Model the general page layout like man pages.
36 files changed, 136 insertions(+), 6095 deletions(-)

M _includes/head.html
M _includes/sidebar.html
M _layouts/base.html
M _layouts/post.html
M css/main.scss
D js/addons/autocomplete.js
D js/addons/autocomplete.min.js
D js/addons/datepicker.js
D js/addons/datepicker.min.js
D js/addons/form-password.js
D js/addons/form-password.min.js
D js/addons/form-select.js
D js/addons/form-select.min.js
D js/addons/htmleditor.js
D js/addons/htmleditor.min.js
D js/addons/nestable.js
D js/addons/nestable.min.js
D js/addons/notify.js
D js/addons/notify.min.js
D js/addons/pagination.js
D js/addons/pagination.min.js
D js/addons/search.js
D js/addons/search.min.js
D js/addons/sortable.js
D js/addons/sortable.min.js
D js/addons/sticky.js
D js/addons/sticky.min.js
D js/addons/timepicker.js
D js/addons/timepicker.min.js
D js/addons/upload.js
D js/addons/upload.min.js
D js/app.js
D js/jquery-2.1.1.min.js
D js/laumann.github.io.js
D js/uikit.js
D js/uikit.min.js
M _includes/head.html => _includes/head.html +0 -13
@@ 2,17 2,4 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>laumann.xyz{% if page.title %}: {{ page.title }}{% endif %}</title>

<!-- syntax highlighting CSS
-->
<!-- link rel="stylesheet" href="/css/normalize.css" type="text/css" />
<link rel="stylesheet" href="/css/site.css" type="text/css" />
-->

<link rel="stylesheet" href="/css/main.css" type="text/css" />
<link rel="stylesheet" href="/css/syntax.css" type="text/css" />

<!-- link rel="stylesheet" href="/css/font-awesome/font-awesome.css" type="text/css" /-->

<!-- js files -->
<!-- script type="text/javascript" src="/js/jquery-2.1.1.min.js"></script -->
<!-- script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script -->

M _includes/sidebar.html => _includes/sidebar.html +29 -27
@@ 1,46 1,48 @@
<div class="sidebar">

  <h3>Contact</h3>

  <div class="external-links">
    <div class="external-link">email</div>
    <a href="mailto:t@laumann.xyz">t@laumann.xyz</a>
  <h3>Author</h3>

    <div class="external-link">PGP</div>
    <a href="/94DC1AEB62B1E0B4FDC5DC3A85C9FB9C4405C282.asc.txt">
      <code>94DC 1AEB 62B1 E0B4 FDC5<br/>
        DC3A 85C9 FB9C 4405 C282
    </code></a>
  <div class="external links">
    Written by Thomas Bracht Laumann Jespersen
  </div>

    <div class="external-link">mastodon</div>
    <a rel="me" href="https://mastodon.xyz/@laumann">@laumann@mastodon.xyz</a>
  <h3>Contact</h3>
  <div class="external links">
    <div>email: <a href="mailto:t@laumann.xyz">t@laumann.xyz</a></div>
    <div>mastodon: <a rel="me" href="https://mastodon.xyz/@laumann">@laumann@mastodon.xyz</a></div>

    <div class="external-link">keybase</div>
    <a href="https://keybase.io/laumann">keybase.io/laumann</a>
    <div>keybase: <a href="https://keybase.io/laumann">keybase.io/laumann</a></div>
  </div>

  <h3>PGP</h3>
    <div class="external links">
      <a href="/94DC1AEB62B1E0B4FDC5DC3A85C9FB9C4405C282.asc.txt">94DC 1AEB 62B1 E0B4 FDC5 DC3A 85C9 FB9C 4405 C282</a>
    </div>

  <h3>Code</h3>

  <div class="external-links">
    <div class="external-link">sourcehut</div>
    <a href="https://git.sr.ht/~laumann">git.sr.ht/~laumann</a>
  <div class="external links">
    <div>sourcehut: <a href="https://git.sr.ht/~laumann">git.sr.ht/~laumann</a></div>

    <div class="external-link">cgit</div>
    <a href="https://git.laumann.xyz">git.laumann.xyz</a>
    <div>cgit: <a href="https://git.laumann.xyz">git.laumann.xyz</a></div>

    <div class="external-link">GitHub</div>
    <a href="https://github.com/laumann">github.com/laumann</a>
    <div>github: <a href="https://github.com/laumann">github.com/laumann</a></div>
  </div>

  <h3>Pages</h3>

  <a href="/" class="button">Home</a>
  <a href="/about" class="button">Who</a>
  <a href="/sites.html" class="button">Sites</a>
  <h3>See Also</h3>
  <div class="links">
    <p>
      <a href="/">home</a>,
      <a href="/about">who</a>,
      <a href="/sites.html">sites</a>
    </p>
  </div>

  <h3>License</h3>

  <p>This page is created using <a href="https://jekyllrb.org">Jekyll</a>.</p>
  <div class="links">
    <p>This page is created using <a href="https://jekyllrb.org">Jekyll</a>.</p>
  </div>

  <div id="identicon">
    <img src="/img/laumann.svg" />

M _layouts/base.html => _layouts/base.html +3 -0
@@ 6,7 6,10 @@
<body>

<div class="container">
  <div class="left-header">LAUMANN(1)</div>
  <h1 class="page-title">{{page.title}}</h1>
  <div class="right-header">LAUMANN(1)</div>

  {{ content }}
</div>


M _layouts/post.html => _layouts/post.html +2 -1
@@ 3,11 3,12 @@ layout: default
active: post
---
<header class="post-header">
  <h3>When</h3>
  <div class="subtitle-stuff">Posted on {{ page.date | date_to_string }} &middot; <a href="/">Go back</a></div>
</header>

<article class="post-content">
  <h3>Article</h3>
  {{ content }}
</article>

<hr />

M css/main.scss => css/main.scss +102 -23
@@ 1,10 1,30 @@
---
---

$red: #d54e53;
$green: #b9ca4a;
$yellow: #e6c547;
$blue: #7aa6da;
$magenta: #c397d8;
$cyan: #70c0ba;
$white: #eaeaea;

@mixin titlecase() {
    text-transform: uppercase;
    color: $blue;
}

@mixin hthree() {
    h3 {
        @include titlecase();
    }
}

html, body {
    overflow-x: hidden;
    background-color: white;
    font-family: sans-serif;
    background-color: black;
    color: $white;
    font-family: monospace, sans-serif;
    vertical-align: baseline;
}



@@ 31,7 51,7 @@ footer, header, hgroup, menu, nav, section {
    display: block;
}
ol, ul {
    padding-left: 2rem;
    padding-left: 3rem;
}

blockquote, q {


@@ 49,16 69,38 @@ table {

.container {
    max-width: 960px;
    margin: 0 auto;
    //margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr;
    grid-template-columns: 1fr 2fr 1fr;

    a {
        color: #1569C7;
        color: $blue;
        font-weight: bold;
        text-decoration: none;
    }

    & .left-header {
        grid-column: 1;
    }

    & .page-title {
        grid-column: 2;
        text-align: center;
        font-size: 1rem;
        font-weight: normal;
    }

    & .right-header {
        grid-column: 3;
        text-align: right;
    }

    a:hover {
        text-decoration: underline;
    }

    a:visited {
        color: purple;
        color: $magenta;
    }

    h3 {


@@ 80,13 122,9 @@ table {
    }


    .page-title {
        grid-column-start: 1;
        grid-column-end: 3;
    }

    .content {
        grid-column-start: 1;
        grid-column-end: 4;

        .tag::before {
            content: '#'


@@ 96,20 134,30 @@ table {
            list-style-type: none;
            padding: 0;
        }

        li {
            margin-bottom: 0.5rem;
        }
    }

    .sidebar {
        grid-column-start: 2;
        padding-left: 2rem;
        @include hthree();

        .external-links {
            .external-link {
                font-size: 0.8rem;
            }
        }
        grid-column-start: 1;
        grid-column-end: 4;

        a {
            color: dimgray;
        .links {
            margin-left: 5rem;

            &.external {
                a::before {
                    content: '<';
                }

                a::after {
                    content: '>';
                }
            }
        }

        #identicon {


@@ 134,9 182,28 @@ table {
        }
    }

    header.post-header {
        @include hthree();
    }

    article.post-content {
        @include hthree();
        margin-left: 5rem;

        h3 {
            margin-left: -5rem;
        }

        // h4 {
        //     @include titlecase();
        //     margin-left: -5rem;
        // }
    }

    div.subtitle-stuff {
        color: grey;
        font-size: 0.8rem;
        //color: grey;

        margin-left: 5rem;

        a {
            color: grey;


@@ 145,6 212,18 @@ table {

    code {
        font-family: monospace;
        font-size: 1rem;
        color: $green;
        text-decoration: underline;
    }

    pre {
        margin-left: 3rem;

        & code {
            color: $white;
            text-decoration: none;
        }
    }

    p {

D js/addons/autocomplete.js => js/addons/autocomplete.js +0 -306
@@ 1,306 0,0 @@
/*! UIkit 2.8.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: '<ul class="uk-nav uk-nav-autocomplete uk-autocomplete-results">{{~items}}<li data-value="{{$item.value}}"><a>{{$item.value}}</a></li>{{/items}}</ul>'
        },

        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 = $('<div class="uk-dropdown"></div>').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',
                            complete: function(xhr) {
                                release(xhr.responseJSON || []);
                            }
                        });

                        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
    $(document).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

D js/addons/autocomplete.min.js => js/addons/autocomplete.min.js +0 -3
@@ 1,3 0,0 @@
/*! UIkit 2.8.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:'<ul class="uk-nav uk-nav-autocomplete uk-autocomplete-results">{{~items}}<li data-value="{{$item.value}}"><a>{{$item.value}}</a></li>{{/items}}</ul>'},visible:!1,value:null,selected:null,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('<div class="uk-dropdown"></div>').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.length<this.options.minLength?this.hide():(this.value!=b&&a.request(),this)},pick:function(a,b){var c=this,d=this.dropdown.find(".uk-autocomplete-results").children(":not(."+this.options.skipClass+")"),e=!1;if("string"==typeof a||a.hasClass(this.options.skipClass)){if("next"==a||"prev"==a)if(this.selected){var f=d.index(this.selected);e=d.eq("next"==a?f+1<d.length?f+1:0:0>f-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",complete:function(a){c(a.responseJSON||[])}});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}}),a(document).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

D js/addons/datepicker.js => js/addons/datepicker.js +0 -365
@@ 1,365 0,0 @@
/*! UIkit 2.8.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-datepicker", ["uikit"], function(){
            return component || addon(jQuery, jQuery.UIkit);
        });
    }

})(function($, UI){

    // Datepicker

    var active = false, dropdown, moment;

    UI.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: false,
            minDate: false,
            template: function(data, opts) {

                var content = '', maxDate, minDate;

                if (opts.maxDate!==false){
                    maxDate = isNaN(opts.maxDate) ? moment(opts.maxDate, opts.format) : moment().add('days', opts.maxDate);
                }

                if (opts.minDate!==false){
                    minDate = isNaN(opts.minDate) ? moment(opts.minDate, opts.format) : moment().add('days',opts.minDate-1);
                }

                content += '<div class="uk-datepicker-nav">';
                content += '<a href="" class="uk-datepicker-previous"></a>';
                content += '<a href="" class="uk-datepicker-next"></a>';

                if (UI.formSelect) {

                    var i, currentyear = (new Date()).getFullYear(), options = [], months, years, minYear, maxYear;

                    for (i=0;i<opts.i18n.months.length;i++) {
                        if(i==data.month) {
                            options.push('<option value="'+i+'" selected>'+opts.i18n.months[i]+'</option>');
                        } else {
                            options.push('<option value="'+i+'">'+opts.i18n.months[i]+'</option>');
                        }
                    }

                    months = '<span class="uk-form-select">'+ opts.i18n.months[data.month] + '<select class="update-picker-month">'+options.join('')+'</select></span>';

                    // --

                    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('<option value="'+i+'" selected>'+i+'</option>');
                        } else {
                            options.push('<option value="'+i+'">'+i+'</option>');
                        }
                    }

                    years  = '<span class="uk-form-select">'+ data.year + '<select class="update-picker-year">'+options.join('')+'</select></span>';

                    content += '<div class="uk-datepicker-heading">'+ months + ' ' + years +'</div>';

                } else {
                    content += '<div class="uk-datepicker-heading">'+ opts.i18n.months[data.month] +' '+ data.year+'</div>';
                }

                content += '</div>';

                content += '<table class="uk-datepicker-table">';
                content += '<thead>';
                for(var i = 0; i < data.weekdays.length; i++) {
                    if (data.weekdays[i]) {
                        content += '<th>'+data.weekdays[i]+'</th>';
                    }
                }
                content += '</thead>';

                content += '<tbody>';
                for(var i = 0; i < data.days.length; i++) {
                    if (data.days[i] && data.days[i].length){
                        content += '<tr>';
                        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 += '<td><a href="" class="'+cls.join(" ")+'" data-date="'+day.day.format()+'">'+day.day.format("D")+'</a></td>';
                            }
                        }
                        content += '</tr>';
                    }
                }
                content += '</tbody>';

                content += '</table>';

                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 = $('<div class="uk-dropdown uk-datepicker"></div>');

                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;
        }
    });


    // init code
    $(document).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");
        }
    });

    $(document).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) {
            dropdown.hide();
            active = false;
        }
    });

    //! 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.length<b;)d="0"+d;return(0<=a?c?"+":"":"-")+d}function J(a,b,c,d){var f=b._milliseconds,g=b._days;b=b._months;var m,h;f&&a._d.setTime(+a._d+
    f*c);if(g||b)m=a.minute(),h=a.hour();g&&a.date(a.date()+g*c);b&&a.month(a.month()+b*c);f&&!d&&e.updateOffset(a,g||b);if(g||b)a.minute(m),a.hour(h)}function K(a){return"[object Array]"===Object.prototype.toString.call(a)}function ca(a,b,c){var d=Math.min(a.length,b.length),f=Math.abs(a.length-b.length),g=0,e;for(e=0;e<d;e++)(c&&a[e]!==b[e]||!c&&h(a[e])!==h(b[e]))&&g++;return g+f}function n(a){if(a){var b=a.toLowerCase().replace(/(.)s$/,"$1");a=ua[a]||va[b]||b}return a}function ba(a){var b={},c,d;for(d in a)a.hasOwnProperty(d)&&
    (c=n(d))&&(b[c]=a[d]);return b}function wa(a){var b,c;if(0===a.indexOf("week"))b=7,c="day";else if(0===a.indexOf("month"))b=12,c="month";else return;e[a]=function(d,f){var g,m,h=e.fn._lang[a],k=[];"number"===typeof d&&(f=d,d=B);m=function(a){a=e().utc().set(c,a);return h.call(e.fn._lang,a,d||"")};if(null!=f)return m(f);for(g=0;g<b;g++)k.push(m(g));return k}}function h(a){a=+a;var b=0;0!==a&&isFinite(a)&&(b=0<=a?Math.floor(a):Math.ceil(a));return b}function L(a,b){return(new Date(Date.UTC(a,b+1,0))).getUTCDate()}
    function da(a,b,c){return C(e([a,11,31+b-c]),b,c).week}function M(a){return 0===a%4&&0!==a%100||0===a%400}function aa(a){var b;a._a&&-2===a._pf.overflow&&(b=0>a._a[x]||11<a._a[x]?x:1>a._a[q]||a._a[q]>L(a._a[r],a._a[x])?q:0>a._a[p]||23<a._a[p]?p:0>a._a[y]||59<a._a[y]?y:0>a._a[D]||59<a._a[D]?D:0>a._a[E]||999<a._a[E]?E:-1,a._pf._overflowDayOfYear&&(b<r||b>q)&&(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<a.length;){g=N(a[b]).split("-");
    c=g.length;for(f=(f=N(a[b+1]))?f.split("-"):null;0<c;){if(d=m(g.slice(0,c).join("-")))return d;if(f&&f.length>=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;c<d;c++)b[c]=u[b[c]]?u[b[c]]:ya(b[c]);return function(f){var g="";for(c=0;c<d;c++)g+=b[c]instanceof Function?b[c].call(f,a):b[c];return g}}function P(a,b){if(!a.isValid())return a.lang().invalidDate();
    b=ga(b,a.lang());Q[b]||(Q[b]=za(b));return Q[b](a)}function ga(a,b){function c(a){return b.longDateFormat(a)||a}var d=5;for(F.lastIndex=0;0<=d&&F.test(a);)a=a.replace(F,c),F.lastIndex=0,d-=1;return a}function Aa(a,b){var c=b._strict;switch(a){case "DDDD":return ha;case "YYYY":case "GGGG":case "gggg":return c?Ba:Ca;case "Y":case "G":case "g":return Da;case "YYYYYY":case "YYYYY":case "GGGGG":case "ggggg":return c?Ea:Fa;case "S":if(c)return Ga;case "SS":if(c)return ia;case "SSS":if(c)return ha;case "DDD":return Ha;
    case "MMM":case "MMMM":case "dd":case "ddd":case "dddd":return Ia;case "a":case "A":return s(b._l)._meridiemParse;case "X":return Ja;case "Z":case "ZZ":return R;case "T":return Ka;case "SSSS":return La;case "MM":case "DD":case "YY":case "GG":case "gg":case "HH":case "hh":case "mm":case "ss":case "ww":case "WW":return c?ia:ja;case "M":case "D":case "d":case "H":case "h":case "m":case "s":case "w":case "W":case "e":case "E":return ja;case "Do":return Ma;default:var c=RegExp,d;d=Na(a.replace("\\","")).replace(/[-\/\\^$*+?.()|[\]{}]/g,
    "\\$&");return new c(d)}}function ka(a){a=(a||"").match(R)||[];a=((a[a.length-1]||[])+"").match(Oa)||["-",0,0];var b=+(60*a[1])+h(a[2]);return"+"===a[0]?-b:b}function S(a){var b,c=[],d,f,g,m,k;if(!a._d){d=Pa(a);a._w&&null==a._a[q]&&null==a._a[x]&&(b=function(b){var c=parseInt(b,10);return b?3>b.length?68<c?1900+c:2E3+c:c:null==a._a[r]?e().weekYear():a._a[r]},f=a._w,null!=f.GG||null!=f.W||null!=f.E?b=la(b(f.GG),f.W||1,f.E,4,1):(g=s(a._l),m=null!=f.d?ma(f.d,g):null!=f.e?parseInt(f.e,10)+g._week.dow:
    0,k=parseInt(f.w,10)||1,null!=f.d&&m<g._week.dow&&k++,b=la(b(f.gg),k,m,g._week.doy,g._week.dow)),a._a[r]=b.year,a._dayOfYear=b.dayOfYear);a._dayOfYear&&(b=null==a._a[r]?d[r]:a._a[r],a._dayOfYear>(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;b<f.length;b++){g=f[b];if(d=(c.match(Aa(g,a))||[])[0])e=c.substr(0,c.indexOf(d)),0<e.length&&a._pf.unusedInput.push(e),c=c.slice(c.indexOf(d)+d.length),l+=d.length;if(u[g]){d?a._pf.empty=!1:a._pf.unusedTokens.push(g);e=a;var n=void 0,t=e._a;
    switch(g){case "M":case "MM":null!=d&&(t[x]=h(d)-1);break;case "MMM":case "MMMM":n=s(e._l).monthsParse(d);null!=n?t[x]=n:e._pf.invalidMonth=d;break;case "D":case "DD":null!=d&&(t[q]=h(d));break;case "Do":null!=d&&(t[q]=h(parseInt(d,10)));break;case "DDD":case "DDDD":null!=d&&(e._dayOfYear=h(d));break;case "YY":t[r]=h(d)+(68<h(d)?1900:2E3);break;case "YYYY":case "YYYYY":case "YYYYYY":t[r]=h(d);break;case "a":case "A":e._isPm=s(e._l).isPM(d);break;case "H":case "HH":case "h":case "hh":t[p]=h(d);break;
    case "m":case "mm":t[y]=h(d);break;case "s":case "ss":t[D]=h(d);break;case "S":case "SS":case "SSS":case "SSSS":t[E]=h(1E3*("0."+d));break;case "X":e._d=new Date(1E3*parseFloat(d));break;case "Z":case "ZZ":e._useUTC=!0;e._tzm=ka(d);break;case "w":case "ww":case "W":case "WW":case "d":case "dd":case "ddd":case "dddd":case "e":case "E":g=g.substr(0,1);case "gg":case "gggg":case "GG":case "GGGG":case "GGGGG":g=g.substr(0,2),d&&(e._w=e._w||{},e._w[g]=d)}}else a._strict&&!d&&a._pf.unusedTokens.push(g)}a._pf.charsLeftOver=
    k-l;0<c.length&&a._pf.unusedInput.push(c);a._isPm&&12>a._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);c<b-7&&(c+=7);a=e(a).add("d",c);return{week:Math.ceil(a.dayOfYear()/7),year:a.year()}}function la(a,b,c,d,f){var e=T(a,0,1).getUTCDay();b=7*(b-1)+((null!=c?c:f)-f)+(f-e+(e>d?7:0)-(e<f?7:0))+1;return{year:0<b?a:a-1,dayOfYear:0<b?b:(M(a-1)?366:365)+b}}function na(a){var b=a._i,c=a._f;if(null===b)return e.invalid({nullInput:!0});"string"===typeof b&&
    (a._i=b=s().preparse(b));if(e.isMoment(b)){a=b;var d={},f;for(f in a)a.hasOwnProperty(f)&&Sa.hasOwnProperty(f)&&(d[f]=a[f]);a=d;a._d=new Date(+b._d)}else if(c)if(K(c)){var b=a,g,h;if(0===b._f.length)b._pf.invalidFormat=!0,b._d=new Date(NaN);else{for(f=0;f<b._f.length;f++)if(c=0,d=v({},b),d._pf=G(),d._f=b._f[f],U(d),ea(d)&&(c+=d._pf.charsLeftOver,c+=10*d._pf.unusedTokens.length,d._pf.score=c,null==h||c<h))h=c,g=d;v(b,g||d)}}else U(a);else if(d=a,g=d._i,h=Ta.exec(g),g===B)d._d=new Date;else if(h)d._d=
    new Date(+h[1]);else if("string"===typeof g)if(b=d._i,f=Ua.exec(b)){d._pf.iso=!0;g=0;for(h=V.length;g<h;g++)if(V[g][1].exec(b)){d._f=V[g][0]+(f[6]||" ");break}g=0;for(h=W.length;g<h;g++)if(W[g][1].exec(b)){d._f+=W[g][0];break}b.match(R)&&(d._f+="Z");U(d)}else d._d=new Date(b);else K(g)?(d._a=g.slice(0),S(d)):"[object Date]"===Object.prototype.toString.call(g)||g instanceof Date?d._d=new Date(+g):"object"===typeof g?d._d||(g=ba(d._i),d._a=[g.year,g.month,g.day,g.hour,g.minute,g.second,g.millisecond],
    S(d)):d._d=new Date(g);return new H(a)}function oa(a,b){var c="date"===b||"month"===b||"year"===b;e.fn[a]=e.fn[a+"s"]=function(a,f){var g=this._isUTC?"UTC":"";null==f&&(f=c);return null!=a?(this._d["set"+g+b](a),e.updateOffset(this,f),this):this._d["get"+g+b]()}}function Va(a){e.duration.fn[a]=function(){return this._data[a]}}function pa(a,b){e.duration.fn["as"+a]=function(){return+this/b}}for(var e,A=Math.round,k,r=0,x=1,q=2,p=3,y=4,D=5,E=6,z={},Sa={_isAMomentObject:null,_i:null,_f:null,_l:null,
    _strict:null,_isUTC:null,_offset:null,_pf:null,_lang:null},xa="undefined"!==typeof module&&module.exports&&"undefined"!==typeof require,Ta=/^\/?Date\((\-?\d+)/i,Wa=/(\-)?(?:(\d*)\.)?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?)?/,Xa=/^(-)?P(?:(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?|([0-9,.]*)W)$/,fa=/(\[[^\[]*\])|(\\)?(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,
    F=/(\[[^\[]*\])|(\\)?(LT|LL?L?L?|l{1,4})/g,ja=/\d\d?/,Ha=/\d{1,3}/,Ca=/\d{1,4}/,Fa=/[+\-]?\d{1,6}/,La=/\d+/,Ia=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,R=/Z|[\+\-]\d\d:?\d\d/gi,Ka=/T/i,Ja=/[\+\-]?\d+(\.\d{1,3})?/,Ma=/\d{1,2}/,Ga=/\d/,ia=/\d\d/,ha=/\d{3}/,Ba=/\d{4}/,Ea=/[+-]?\d{6}/,Da=/[+-]?\d+/,Ua=/^\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)?)?$/,
    V=[["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}/]],W=[["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/]],Oa=/([\+\-]|\d\d)/gi,X=["Date","Hours","Minutes","Seconds","Milliseconds"],Y={Milliseconds:1,Seconds:1E3,Minutes:6E4,Hours:36E5,Days:864E5,Months:2592E6,Years:31536E6},ua={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"},va={dayofyear:"dayOfYear",isoweekday:"isoWeekday",isoweek:"isoWeek",weekyear:"weekYear",isoweekyear:"isoWeekYear"},Q={},qa="DDD w W M D d".split(" "),ra="MDHhmswW".split(""),u={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 l(this.year()%100,2)},YYYY:function(){return l(this.year(),4)},YYYYY:function(){return l(this.year(),5)},YYYYYY:function(){var a=this.year();return(0<=a?"+":"-")+l(Math.abs(a),
    6)},gg:function(){return l(this.weekYear()%100,2)},gggg:function(){return l(this.weekYear(),4)},ggggg:function(){return l(this.weekYear(),5)},GG:function(){return l(this.isoWeekYear()%100,2)},GGGG:function(){return l(this.isoWeekYear(),4)},GGGGG:function(){return l(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 h(this.milliseconds()/100)},SS:function(){return l(h(this.milliseconds()/10),2)},SSS:function(){return l(this.milliseconds(),3)},SSSS:function(){return l(this.milliseconds(),3)},Z:function(){var a=-this.zone(),b="+";0>a&&(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?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 f=this._relativeTime[c];return"function"===typeof f?f(a,b,c,d):f.replace(/%d/i,a)},pastFuture:function(a,b){var c=this._relativeTime[0<a?"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 C(a,this._week.dow,this._week.doy).week},_week:{dow:0,doy:6},_invalidDate:"Invalid date",
    invalidDate:function(){return this._invalidDate}});e=function(a,b,c,d){var f;"boolean"===typeof c&&(d=c,c=B);f={_isAMomentObject:!0};f._i=a;f._f=b;f._l=c;f._strict=d;f._isUTC=!1;f._pf=G();return na(f)};e.utc=function(a,b,c,d){var f;"boolean"===typeof c&&(d=c,c=B);f={_isAMomentObject:!0,_useUTC:!0,_isUTC:!0};f._l=c;f._i=a;f._f=b;f._strict=d;f._pf=G();return na(f).utc()};e.unix=function(a){return e(1E3*a)};e.duration=function(a,b){var c=a,d=null,f;if(e.isDuration(a))c={ms:a._milliseconds,d:a._days,
    M:a._months};else if("number"===typeof a)c={},b?c[b]=a:c.milliseconds=a;else if(d=Wa.exec(a))f="-"===d[1]?-1:1,c={y:0,d:h(d[q])*f,h:h(d[p])*f,m:h(d[y])*f,s:h(d[D])*f,ms:h(d[E])*f};else if(d=Xa.exec(a))f="-"===d[1]?-1:1,c=function(a){a=a&&parseFloat(a.replace(",","."));return(isNaN(a)?0:a)*f},c={y:c(d[2]),M:c(d[3]),d:c(d[4]),h:c(d[5]),m:c(d[6]),s:c(d[7]),w:c(d[8])};d=new I(c);e.isDuration(a)&&a.hasOwnProperty("_lang")&&(d._lang=a._lang);return d};e.version="2.5.1";e.defaultFormat="YYYY-MM-DDTHH:mm:ssZ";
    e.updateOffset=function(){};e.lang=function(a,b){if(!a)return e.fn._lang._abbr;if(b){var c=N(a);b.abbr=c;z[c]||(z[c]=new $);z[c].set(b)}else null===b?(delete z[a],a="en"):z[a]||s(a);return(e.duration.fn._lang=e.fn._lang=s(a))._abbr};e.langData=function(a){a&&a._lang&&a._lang._abbr&&(a=a._lang._abbr);return s(a)};e.isMoment=function(a){return a instanceof H||null!=a&&a.hasOwnProperty("_isAMomentObject")};e.isDuration=function(a){return a instanceof I};for(k=sa.length-1;0<=k;--k)wa(sa[k]);e.normalizeUnits=
    function(a){return n(a)};e.invalid=function(a){var b=e.utc(NaN);null!=a?v(b._pf,a):b._pf.userInvalidated=!0;return b};e.parseZone=function(){return e.apply(null,arguments).parseZone()};v(e.fn=H.prototype,{clone:function(){return e(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=
    e(this).utc();return 0<a.year()&&9999>=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()&&0<ca(this._a,(this._isUTC?e.utc(this._a):e(this._a)).toArray()):!1},parsingFlags:function(){return v({},this._pf)},invalidAt:function(){return this._pf.overflow},
    utc:function(){return this.zone(0)},local:function(){this.zone(0);this._isUTC=!1;return this},format:function(a){a=P(this,a||e.defaultFormat);return this.lang().postformat(a)},add:function(a,b){var c;c="string"===typeof a?e.duration(+b,a):e.duration(a,b);J(this,c,1);return this},subtract:function(a,b){var c;c="string"===typeof a?e.duration(+b,a):e.duration(a,b);J(this,c,-1);return this},diff:function(a,b,c){a=O(a,this);var d=6E4*(this.zone()-a.zone()),f;b=n(b);"year"===b||"month"===b?(f=432E5*(this.daysInMonth()+
    a.daysInMonth()),d=12*(this.year()-a.year())+(this.month()-a.month()),d+=(this-e(this).startOf("month")-(a-e(a).startOf("month")))/f,d-=6E4*(this.zone()-e(this).startOf("month").zone()-(a.zone()-e(a).startOf("month").zone()))/f,"year"===b&&(d/=12)):(f=this-a,d="second"===b?f/1E3:"minute"===b?f/6E4:"hour"===b?f/36E5:"day"===b?(f-d)/864E5:"week"===b?(f-d)/6048E5:f);return c?d:w(d)},from:function(a,b){return e.duration(this.diff(a)).lang(this.lang()._abbr).humanize(!b)},fromNow:function(a){return this.from(e(),
    a)},calendar:function(){var a=O(e(),this).startOf("day"),a=this.diff(a,"days",!0),a=-6>a?"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()<this.clone().month(0).zone()||this.zone()<this.clone().month(5).zone()},day:function(a){var b=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=a?(a=ma(a,this.lang()),this.add({d:a-
    b})):b},month:function(a){var b=this._isUTC?"UTC":"",c;if(null!=a){if("string"===typeof a&&(a=this.lang().monthsParse(a),"number"!==typeof a))return this;c=Math.min(this.date(),L(this.year(),a));this._d["set"+b+"Month"](a,c);e.updateOffset(this,!0);return this}return this._d["get"+b+"Month"]()},startOf:function(a){a=n(a);switch(a){case "year":this.month(0);case "month":this.date(1);case "week":case "isoWeek":case "day":this.hours(0);case "hour":this.minutes(0);case "minute":this.seconds(0);case "second":this.milliseconds(0)}"week"===
    a?this.weekday(0):"isoWeek"===a&&this.isoWeekday(1);return this},endOf:function(a){a=n(a);return this.startOf(a).add("isoWeek"===a?"week":a,1).subtract("ms",1)},isAfter:function(a,b){b="undefined"!==typeof b?b:"millisecond";return+this.clone().startOf(b)>+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 a<this?this:a},max:function(a){a=e.apply(null,arguments);return a>this?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;k<X.length;k++)oa(X[k].toLowerCase().replace(/s$/,""),X[k]);oa("year","FullYear");e.fn.days=e.fn.day;e.fn.months=e.fn.month;e.fn.weeks=e.fn.week;e.fn.isoWeeks=e.fn.isoWeek;e.fn.toJSON=e.fn.toISOString;v(e.duration.fn=
    I.prototype,{_bubble:function(){var a=this._milliseconds,b=this._days,c=this._months,d=this._data;d.milliseconds=a%1E3;a=w(a/1E3);d.seconds=a%60;a=w(a/60);d.minutes=a%60;a=w(a/60);d.hours=a%24;b+=w(a/24);d.days=b%30;c+=w(b/30);d.months=c%12;b=w(c/12);d.years=b},weeks:function(){return w(this.days()/7)},valueOf:function(){return this._milliseconds+864E5*this._days+this._months%12*2592E6+31536E6*h(this._months/12)},humanize:function(a){var b=+this,c;c=!a;var d=this.lang(),f=A(Math.abs(b)/1E3),e=A(f/
    60),h=A(e/60),k=A(h/24),l=A(k/365),f=45>f&&["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<b;f[4]=d;c=Ra.apply({},f);a&&(c=this.lang().pastFuture(b,c));return this.lang().postformat(c)},add:function(a,b){var c=e.duration(a,b);this._milliseconds+=c._milliseconds;this._days+=c._days;this._months+=c._months;this._bubble();return this},subtract:function(a,b){var c=e.duration(a,
    b);this._milliseconds-=c._milliseconds;this._days-=c._days;this._months-=c._months;this._bubble();return this},get:function(a){a=n(a);return this[a.toLowerCase()+"s"]()},as:function(a){a=n(a);return this["as"+a.charAt(0).toUpperCase()+a.slice(1)+"s"]()},lang:e.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()),g=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||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

D js/addons/datepicker.min.js => js/addons/datepicker.min.js +0 -3
@@ 1,3 0,0 @@
/*! UIkit 2.8.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+='<div class="uk-datepicker-nav">',g+='<a href="" class="uk-datepicker-previous"></a>',g+='<a href="" class="uk-datepicker-next"></a>',b.formSelect){var h,i,j,k,l,m=(new Date).getFullYear(),n=[];for(h=0;h<c.i18n.months.length;h++)n.push(h==a.month?'<option value="'+h+'" selected>'+c.i18n.months[h]+"</option>":'<option value="'+h+'">'+c.i18n.months[h]+"</option>");for(i='<span class="uk-form-select">'+c.i18n.months[a.month]+'<select class="update-picker-month">'+n.join("")+"</select></span>",n=[],k=f?f.year():m-50,l=e?e.year():m+20,h=k;l>=h;h++)n.push(h==a.year?'<option value="'+h+'" selected>'+h+"</option>":'<option value="'+h+'">'+h+"</option>");j='<span class="uk-form-select">'+a.year+'<select class="update-picker-year">'+n.join("")+"</select></span>",g+='<div class="uk-datepicker-heading">'+i+" "+j+"</div>"}else g+='<div class="uk-datepicker-heading">'+c.i18n.months[a.month]+" "+a.year+"</div>";g+="</div>",g+='<table class="uk-datepicker-table">',g+="<thead>";for(var h=0;h<a.weekdays.length;h++)a.weekdays[h]&&(g+="<th>"+a.weekdays[h]+"</th>");g+="</thead>",g+="<tbody>";for(var h=0;h<a.days.length;h++)if(a.days[h]&&a.days[h].length){g+="<tr>";for(var o=0;o<a.days[h].length;o++)if(a.days[h][o]){var p=a.days[h][o],q=[];p.inmonth||q.push("uk-datepicker-table-muted"),p.selected&&q.push("uk-active"),e&&p.day>e&&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+='<td><a href="" class="'+q.join(" ")+'" data-date="'+p.day.format()+'">'+p.day.format("D")+"</a></td>"}g+="</tr>"}return g+="</tbody>",g+="</table>"}},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('<div class="uk-dropdown uk-datepicker"></div>'),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&&l<c.mindate||c.maxdate&&l>c.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}}),a(document).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")}}),a(document).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||(c.hide(),e=!1)}),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<b;)d="0"+d;return(a>=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]||11<a._a[X]?X:1>a._a[Y]||a._a[Y]>r(a._a[W],a._a[X])?Y:0>a._a[Z]||23<a._a[Z]?Z:0>a._a[$]||59<a._a[$]?$:0>a._a[_]||59<a._a[_]?_:0>a._a[ab]||999<a._a[ab]?ab:-1,a._pf._overflowDayOfYear&&(W>b||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(;f<a.length;){for(e=w(a[f]).split("-"),b=e.length,d=(d=w(a[f+1]))?d.split("-"):null;b>0;){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<e._week.dow&&g++,b=O(b(d.gg),g,f,e._week.doy,e._week.dow)),a._a[W]=b.year,a._dayOfYear=b.dayOfYear),a._dayOfYear&&(b=null==a._a[W]?c[W]:a._a[W],a._dayOfYear>(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;f<c.length;f++)if(d=c[f],(b=(g.match(D(d,a))||[])[0])&&(e=g.substr(0,g.indexOf(b)),0<e.length&&a._pf.unusedInput.push(e),g=g.slice(g.indexOf(b)+b.length),i+=b.length),Kb[d]){b?a._pf.empty=!1:a._pf.unusedTokens.push(d),e=a;var j=void 0,k=e._a;switch(d){case"M":case"MM":null!=b&&(k[X]=q(b)-1);break;case"MMM":case"MMMM":j=y(e._l).monthsParse(b),null!=j?k[X]=j:e._pf.invalidMonth=b;break;case"D":case"DD":null!=b&&(k[Y]=q(b));break;case"Do":null!=b&&(k[Y]=q(parseInt(b,10)));break;case"DDD":case"DDDD":null!=b&&(e._dayOfYear=q(b));break;case"YY":k[W]=q(b)+(68<q(b)?1900:2e3);break;case"YYYY":case"YYYYY":case"YYYYYY":k[W]=q(b);break;case"a":case"A":e._isPm=y(e._l).isPM(b);break;case"H":case"HH":case"h":case"hh":k[Z]=q(b);break;case"m":case"mm":k[$]=q(b);break;case"s":case"ss":k[_]=q(b);break;case"S":case"SS":case"SSS":case"SSSS":k[ab]=q(1e3*("0."+b));break;case"X":e._d=new Date(1e3*parseFloat(b));break;case"Z":case"ZZ":e._useUTC=!0,e._tzm=E(b);break;case"w":case"ww":case"W":case"WW":case"d":case"dd":case"ddd":case"dddd":case"e":case"E":d=d.substr(0,1);case"gg":case"gggg":case"GG":case"GGGG":case"GGGGG":d=d.substr(0,2),b&&(e._w=e._w||{},e._w[d]=b)}}else a._strict&&!b&&a._pf.unusedTokens.push(d);a._pf.charsLeftOver=h-i,0<g.length&&a._pf.unusedInput.push(g),a._isPm&&12>a._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;g<d._f.length;g++)e=0,i=h({},d),i._pf=b(),i._f=d._f[g],H(i),v(i)&&(e+=i._pf.charsLeftOver,e+=10*i._pf.unusedTokens.length,i._pf.score=e,null==k||k>e)&&(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()&&9999>=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()&&0<m(this._a,(this._isUTC?T.utc(this._a):T(this._a)).toArray()):!1},parsingFlags:function(){return h({},this._pf)},invalidAt:function(){return this._pf.overflow},utc:function(){return this.zone(0)},local:function(){return this.zone(0),this._isUTC=!1,this},format:function(a){return a=B(this,a||T.defaultFormat),this.lang().postformat(a)},add:function(a,b){var c;return c="string"==typeof a?T.duration(+b,a):T.duration(a,b),k(this,c,1),this},subtract:function(a,b){var c;return c="string"==typeof a?T.duration(+b,a):T.duration(a,b),k(this,c,-1),this},diff:function(a,b,c){a=x(a,this);var d,e=6e4*(this.zone()-a.zone());return b=n(b),"year"===b||"month"===b?(d=432e5*(this.daysInMonth()+a.daysInMonth()),e=12*(this.year()-a.year())+(this.month()-a.month()),e+=(this-T(this).startOf("month")-(a-T(a).startOf("month")))/d,e-=6e4*(this.zone()-T(this).startOf("month").zone()-(a.zone()-T(a).startOf("month").zone()))/d,"year"===b&&(e/=12)):(d=this-a,e="second"===b?d/1e3:"minute"===b?d/6e4:"hour"===b?d/36e5:"day"===b?(d-e)/864e5:"week"===b?(d-e)/6048e5:d),c?e:i(e)},from:function(a,b){return T.duration(this.diff(a)).lang(this.lang()._abbr).humanize(!b)},fromNow:function(a){return this.from(T(),a)},calendar:function(){var a=x(T(),this).startOf("day"),a=this.diff(a,"days",!0),a=-6>a?"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()<this.clone().month(0).zone()||this.zone()<this.clone().month(5).zone()},day:function(a){var b=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=a?(a=L(a,this.lang()),this.add({d:a-b})):b},month:function(a){var b,c=this._isUTC?"UTC":"";return null!=a?"string"==typeof a&&(a=this.lang().monthsParse(a),"number"!=typeof a)?this:(b=Math.min(this.date(),r(this.year(),a)),this._d["set"+c+"Month"](a,b),T.updateOffset(this,!0),this):this._d["get"+c+"Month"]()},startOf:function(a){switch(a=n(a)){case"year":this.month(0);case"month":this.date(1);case"week":case"isoWeek":case"day":this.hours(0);case"hour":this.minutes(0);case"minute":this.seconds(0);case"second":this.milliseconds(0)}return"week"===a?this.weekday(0):"isoWeek"===a&&this.isoWeekday(1),this},endOf:function(a){return a=n(a),this.startOf(a).add("isoWeek"===a?"week":a,1).subtract("ms",1)},isAfter:function(a,b){return b="undefined"!=typeof b?b:"millisecond",+this.clone().startOf(b)>+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;U<Db.length;U++)Q(Db[U].toLowerCase().replace(/s$/,""),Db[U]);Q("year","FullYear"),T.fn.days=T.fn.day,T.fn.months=T.fn.month,T.fn.weeks=T.fn.week,T.fn.isoWeeks=T.fn.isoWeek,T.fn.toJSON=T.fn.toISOString,h(T.duration.fn=g.prototype,{_bubble:function(){var a=this._milliseconds,b=this._days,c=this._months,d=this._data;d.milliseconds=a%1e3,a=i(a/1e3),d.seconds=a%60,a=i(a/60),d.minutes=a%60,a=i(a/60),d.hours=a%24,b+=i(a/24),d.days=b%30,c+=i(b/30),d.months=c%12,b=i(c/12),d.years=b},weeks:function(){return i(this.days()/7)},valueOf:function(){return this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*q(this._months/12)},humanize:function(a){var b,c=+this;b=!a;var d=this.lang(),e=V(Math.abs(c)/1e3),f=V(e/60),g=V(f/60),h=V(g/24),i=V(h/365),e=45>e&&["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

D js/addons/form-password.js => js/addons/form-password.js +0 -62
@@ 1,62 0,0 @@
/*! UIkit 2.8.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
    $(document).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

D js/addons/form-password.min.js => js/addons/form-password.min.js +0 -3
@@ 1,3 0,0 @@
/*! UIkit 2.8.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)}}),a(document).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

D js/addons/form-select.js => js/addons/form-select.js +0 -62
@@ 1,62 0,0 @@
/*! UIkit 2.8.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
    $(document).on("uk-domready", function(e) {

        $("[data-uk-form-select]").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

D js/addons/form-select.min.js => js/addons/form-select.min.js +0 -3
@@ 1,3 0,0 @@
/*! UIkit 2.8.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)}}),a(document).on("uk-domready",function(){a("[data-uk-form-select]").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

D js/addons/htmleditor.js => js/addons/htmleditor.js +0 -594
@@ 1,594 0,0 @@
/*! UIkit 2.8.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: {
            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', tabMode: 'indent', tabsize: 4, lineWrapping: true, dragDrop: false, autoCloseTags: true, matchTags: true, autoCloseBrackets: true, matchBrackets: true, indentUnit: 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);

            $(window).on('resize', UI.Utils.debounce(function() { $this.fit(); }, 200));

            var previewContainer = $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 - 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();
            });

            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('<li><a data-htmleditor-button="'+button+'" title="'+title+'" data-uk-tooltip>'+$this.buttons[button].label+'</a></li>');
            });

            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.html('');

                return;
            }

            this.trigger('render', [this]);
            this.trigger('renderLate', [this]);

            this.preview.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 = [
        '<div class="uk-htmleditor uk-clearfix" data-mode="split">',
            '<div class="uk-htmleditor-navbar">',
                '<ul class="uk-htmleditor-navbar-nav uk-htmleditor-toolbar"></ul>',
                '<div class="uk-htmleditor-navbar-flip">',
                    '<ul class="uk-htmleditor-navbar-nav">',
                        '<li class="uk-htmleditor-button-code"><a>{:lblCodeview}</a></li>',
                        '<li class="uk-htmleditor-button-preview"><a>{:lblPreview}</a></li>',
                        '<li><a data-htmleditor-button="fullscreen"><i class="uk-icon-expand"></i></a></li>',
                    '</ul>',
                '</div>',
            '</div>',
            '<div class="uk-htmleditor-content">',
                '<div class="uk-htmleditor-code"></div>',
                '<div class="uk-htmleditor-preview"><div></div></div>',
            '</div>',
        '</div>'
    ].join('');


    UI.plugin('htmleditor', 'base', {

        init: function(editor) {

            editor.addButtons({

                fullscreen: {
                    title  : 'Fullscreen',
                    label  : '<i class="uk-icon-expand"></i>'
                },
                bold : {
                    title  : 'Bold',
                    label  : '<i class="uk-icon-bold"></i>'
                },
                italic : {
                    title  : 'Italic',
                    label  : '<i class="uk-icon-italic"></i>'
                },
                strike : {
                    title  : 'Strikethrough',
                    label  : '<i class="uk-icon-strikethrough"></i>'
                },
                blockquote : {
                    title  : 'Blockquote',
                    label  : '<i class="uk-icon-quote-right"></i>'
                },
                link : {
                    title  : 'Link',
                    label  : '<i class="uk-icon-link"></i>'
                },
                image : {
                    title  : 'Image',
                    label  : '<i class="uk-icon-picture-o"></i>'
                },
                listUl : {
                    title  : 'Unordered List',
                    label  : '<i class="uk-icon-list-ul"></i>'
                },
                listOl : {
                    title  : 'Ordered List',
                    label  : '<i class="uk-icon-list-ol"></i>'
                }

            });

            addAction('bold', '<strong>$1</strong>');
            addAction('italic', '<em>$1</em>');
            addAction('strike', '<del>$1</del>');
            addAction('blockquote', '<blockquote><p>$1</p></blockquote>', 'replaceLine');
            addAction('link', '<a href="http://">$1</a>');
            addAction('image', '<img src="http://" alt="$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('<li>'+cm.getLine(i)+'</li>', { 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();
                }, 10);
            });

            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')));
            }
        });
    });

    $(document).on("uk-check-display", function(e) {
        editors.forEach(function(item) {
            if(item.htmleditor.is(":visible")) item.fit();
        });
    });

    return UI.htmleditor;
});
\ No newline at end of file

D js/addons/htmleditor.min.js => js/addons/htmleditor.min.js +0 -3
@@ 1,3 0,0 @@
/*! UIkit 2.8.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:{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",tabMode:"indent",tabsize:4,lineWrapping:!0,dragDrop:!1,autoCloseTags:!0,matchTags:!0,autoCloseBrackets:!0,matchBrackets:!0,indentUnit: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),a(window).on("resize",b.Utils.debounce(function(){d.fit()},200));var f=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-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()}),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.to.ch:b.line===a.from.line&&b.ch>=a.from.ch||b.line>a.from.line&&b.line<a.to.line||b.line===a.to.line&&b.ch<a.to.ch}},h=b(a);return 0==h?arguments[0]:(e.push(a),h)}),e},_buildtoolbar:function(){if(this.options.toolbar&&this.options.toolbar.length){var a=this,b=[];this.toolbar.empty(),this.options.toolbar.forEach(function(c){if(a.buttons[c]){var d=a.buttons[c].title?a.buttons[c].title:c;b.push('<li><a data-htmleditor-button="'+c+'" title="'+d+'" data-uk-tooltip>'+a.buttons[c].label+"</a></li>")}}),this.toolbar.html(b.join("\n"))}},fit:function(){var a=this.options.mode;"split"==a&&this.htmleditor.width()<this.options.maxsplitsize&&(a="tab"),"tab"==a&&(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("code"==this.activetab?".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",a)},redraw:function(){this._buildtoolbar(),this.render(),this.fit()},getMode:function(){return this.editor.getOption("mode")},getCursorMode:function(){var a={mode:"html"};return this.trigger("cursorMode",[a]),a.mode},render:function(){return this.currentvalue=this.editor.getValue(),this.currentvalue?(this.trigger("render",[this]),this.trigger("renderLate",[this]),void this.preview.html(this.currentvalue)):(this.element.val(""),void this.preview.html(""))},addShortcut:function(b,c){var d={};return a.isArray(b)||(b=[b]),b.forEach(function(a){d[a]=c}),this.editor.addKeyMap(d),d},addShortcutAction:function(a,b){var c=this;this.addShortcut(b,function(){c.element.trigger("action."+a,[c.editor])})},replaceSelection:function(a){var b=this.editor.getSelection();if(!b.length){for(var c=this.editor.getCursor(),d=this.editor.getLine(c.line),e=c.ch,f=e;f<d.length&&/[\w$]+/.test(d.charAt(f));)++f;for(;e&&/[\w$]+/.test(d.charAt(e-1));)--e;var g=e!=f&&d.slice(e,f);g&&(this.editor.setSelection({line:c.line,ch:e},{line:c.line,ch:f}),b=g)}var h=a.replace("$1",b);this.editor.replaceSelection(h,"end"),this.editor.focus()},replaceLine:function(a){var b=this.editor.getDoc().getCursor(),c=this.editor.getLine(b.line),d=a.replace("$1",c);this.editor.replaceRange(d,{line:b.line,ch:0},{line:b.line,ch:c.length}),this.editor.setCursor({line:b.line,ch:d.length}),this.editor.focus()},save:function(){this.editor.save()}}),b.components.htmleditor.template=['<div class="uk-htmleditor uk-clearfix" data-mode="split">','<div class="uk-htmleditor-navbar">','<ul class="uk-htmleditor-navbar-nav uk-htmleditor-toolbar"></ul>','<div class="uk-htmleditor-navbar-flip">','<ul class="uk-htmleditor-navbar-nav">','<li class="uk-htmleditor-button-code"><a>{:lblCodeview}</a></li>','<li class="uk-htmleditor-button-preview"><a>{:lblPreview}</a></li>','<li><a data-htmleditor-button="fullscreen"><i class="uk-icon-expand"></i></a></li>',"</ul>","</div>","</div>",'<div class="uk-htmleditor-content">','<div class="uk-htmleditor-code"></div>','<div class="uk-htmleditor-preview"><div></div></div>',"</div>","</div>"].join(""),b.plugin("htmleditor","base",{init:function(a){function b(b,c,d){a.on("action."+b,function(){"html"==a.getCursorMode()&&a["replaceLine"==d?"replaceLine":"replaceSelection"](c)})}a.addButtons({fullscreen:{title:"Fullscreen",label:'<i class="uk-icon-expand"></i>'},bold:{title:"Bold",label:'<i class="uk-icon-bold"></i>'},italic:{title:"Italic",label:'<i class="uk-icon-italic"></i>'},strike:{title:"Strikethrough",label:'<i class="uk-icon-strikethrough"></i>'},blockquote:{title:"Blockquote",label:'<i class="uk-icon-quote-right"></i>'},link:{title:"Link",label:'<i class="uk-icon-link"></i>'},image:{title:"Image",label:'<i class="uk-icon-picture-o"></i>'},listUl:{title:"Unordered List",label:'<i class="uk-icon-list-ul"></i>'},listOl:{title:"Ordered List",label:'<i class="uk-icon-list-ol"></i>'}}),b("bold","<strong>$1</strong>"),b("italic","<em>$1</em>"),b("strike","<del>$1</del>"),b("blockquote","<blockquote><p>$1</p></blockquote>","replaceLine"),b("link",'<a href="http://">$1</a>'),b("image",'<img src="http://" alt="$1">');var c=function(){if("html"==a.getCursorMode()){for(var b=a.editor,c=b.getDoc().getCursor(!0),d=b.getDoc().getCursor(!1),e=c.line;e<d.line+1;e++)b.replaceRange("<li>"+b.getLine(e)+"</li>",{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(){c()}),a.on("action.listOl",function(){c()}),a.htmleditor.on("click",'a[data-htmleditor-button="fullscreen"]',function(){a.htmleditor.toggleClass("uk-htmleditor-fullscreen");var b=a.editor.getWrapperElement();if(a.htmleditor.hasClass("uk-htmleditor-fullscreen"))a.editor.state.fullScreenRestore={scrollTop:window.pageYOffset,scrollLeft:window.pageXOffset,width:b.style.width,height:b.style.height},b.style.width="",b.style.height=a.content.height()+"px",document.documentElement.style.overflow="hidden";else{document.documentElement.style.overflow="";var c=a.editor.state.fullScreenRestore;b.style.width=c.width,b.style.height=c.height,window.scrollTo(c.scrollLeft,c.scrollTop)}setTimeout(function(){a.fit()},10)}),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;e<d.line+1;e++)a.replaceRange("* "+a.getLine(e),{line:e,ch:0},{line:e,ch:a.getLine(e).length});a.setCursor({line:d.line,ch:a.getLine(d.line).length}),a.focus()}}),b.on("action.listOl",function(){if("markdown"==b.getCursorMode()){var a=b.editor,c=a.getDoc().getCursor(!0),d=a.getDoc().getCursor(!1),e=1;if(c.line>0){var f,g=a.getLine(c.line-1);(f=g.match(/^(\d+)\./))&&(e=Number(f[1])+1)}for(var h=c.line;h<d.line+1;h++)a.replaceRange(e+". "+a.getLine(h),{line:h,ch:0},{line:h,ch:a.getLine(h).length}),e++;a.setCursor({line:d.line,ch:a.getLine(d.line).length}),a.focus()}}),b.on("renderLate",function(){"gfm"==b.editor.options.mode&&(b.currentvalue=e(b.currentvalue))}),b.on("cursorMode",function(a,c){if("gfm"==b.editor.options.mode){var d=b.editor.getDoc().getCursor();b.editor.getTokenAt(d).state.base.htmlState||(c.mode="markdown")}}),a.extend(b,{enableMarkdown:function(){c(),this.render()},disableMarkdown:function(){this.editor.setOption("mode","htmlmixed"),this.htmleditor.find(".uk-htmleditor-button-code a").html(this.options.lblCodeview),this.render()}}),b.on({enableMarkdown:function(){b.enableMarkdown()},disableMarkdown:function(){b.disableMarkdown()}}))}}),a(function(){a("textarea[data-uk-htmleditor]").each(function(){var c,d=a(this);d.data("htmleditor")||(c=b.htmleditor(d,b.Utils.options(d.attr("data-uk-htmleditor"))))})}),a(document).on("uk-check-display",function(){c.forEach(function(a){a.htmleditor.is(":visible")&&a.fit()})}),b.htmleditor});
\ No newline at end of file

D js/addons/nestable.js => js/addons/nestable.js +0 -574
@@ 1,574 0,0 @@
/*! UIkit 2.8.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */

/*
 * Based on Nestable jQuery Plugin - Copyright (c) 2012 David Bushell - http://dbushell.com/
 */
 (function(addon) {

     var component;

     if (jQuery && jQuery.UIkit) {
         component = addon(jQuery, jQuery.UIkit);
     }

     if (typeof define == "function" && define.amd) {
         define("uikit-nestable", ["uikit"], function(){
             return component || addon(jQuery, jQuery.UIkit);
         });
     }

 })(function($, UI) {

    var hasTouch     = 'ontouchstart' in window,
        html         = $("html"),
        touchedlists = [],
        $win         = $(window);

    /**
     * Detect CSS pointer-events property
     * events are normally disabled on the dragging element to avoid conflicts
     * https://github.com/ausi/Feature-detection-technique-for-pointer-events/blob/master/modernizr-pointerevents.js
     */
    var hasPointerEvents = (function() {

        var el    = document.createElement('div'), docEl = document.documentElement;

        if (!('pointerEvents' in el.style)) {
            return false;
        }

        el.style.pointerEvents = 'auto';
        el.style.pointerEvents = 'x';

        docEl.appendChild(el);

        var supports = window.getComputedStyle && window.getComputedStyle(el, '').pointerEvents === 'auto';

        docEl.removeChild(el);

        return !!supports;
    })();

    var eStart  = hasTouch ? 'touchstart'  : 'mousedown',
        eMove   = hasTouch ? 'touchmove'   : 'mousemove',
        eEnd    = hasTouch ? 'touchend'    : 'mouseup',
        eCancel = hasTouch ? 'touchcancel' : 'mouseup';


    UI.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 $this = this;

            Object.keys(this.options).forEach(function(key){

                if(String($this.options[key]).indexOf('{prefix}')!=-1) {
                    $this.options[key] = $this.options[key].replace('{prefix}', $this.options.prefix);
                }
            });

            this.tplempty = '<div class="' + this.options.emptyClass + '"/>';

            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 = $('<div class="' + this.options.placeClass + '"/>');

            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<touchedlists.length; i++) {
                if (!touchedlists[i].children().length) {
                    touchedlists[i].append(this.tplempty);
                }
            }

            touchedlists = [];
        },

        toggleItem: function(li) {
            this[li.hasClass(this.options.collapsedClass) ? "expandItem":"collapseItem"](li);
        },

        expandItem: function(li) {
            li.removeClass(this.options.collapsedClass);
        },

        collapseItem: function(li) {
            var lists = li.children(this.options.listNodeName);
            if (lists.length) {
                li.addClass(this.options.collapsedClass);
            }
        },

        expandAll: function() {
            var list = this;
            this.find(list.options.itemNodeName).each(function() {
                list.expandItem($(this));
            });
        },

        collapseAll: function() {
            var list = this;
            this.find(list.options.itemNodeName).each(function() {
                list.collapseItem($(this));
            });
        },

        setParent: function(li) {
            if (li.children(this.options.listNodeName).length) {
                li.addClass("uk-parent");
            }
        },

        unsetParent: function(li) {
            li.removeClass('uk-parent '+this.options.collapsedClass);
            li.children(this.options.listNodeName).remove();
        },

        dragStart: function(e) {
            var mouse    = this.mouse,
                target   = $(e.target),
                dragItem = target.closest(this.options.itemNodeName),
                offset   = dragItem.offset();

            this.placeEl.css('height', dragItem.height());

            mouse.offsetX = e.pageX - offset.left;
            mouse.offsetY = e.pageY - offset.top;

            mouse.startX = mouse.lastX = offset.left;
            mouse.startY = mouse.lastY = offset.top;

            this.dragRootEl = this.element;

            this.dragEl = $(document.createElement(this.options.listNodeName)).addClass(this.options.listClass + ' ' + this.options.dragClass);
            this.dragEl.css('width', dragItem.width());

            this.tmpDragOnSiblings = [dragItem[0].previousSibling, dragItem[0].nextSibling];

            // fix for zepto.js
            //dragItem.after(this.placeEl).detach().appendTo(this.dragEl);
            dragItem.after(this.placeEl);
            dragItem[0].parentNode.removeChild(dragItem[0]);
            dragItem.appendTo(this.dragEl);

            $(document.body).append(this.dragEl);

            this.dragEl.css({
                left : offset.left,
                top  : offset.top
            });

            // total depth of dragging item
            var i, depth,
                items = this.dragEl.find(this.options.itemNodeName);
            for (i = 0; i < items.length; i++) {
                depth = $(items[i]).parents(this.options.listNodeName).length;
                if (depth > 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];
                }
            }
        }

    });

    $(document).on("uk-domready", function(e) {

        $("[data-uk-nestable]").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

D js/addons/nestable.min.js => js/addons/nestable.min.js +0 -3
@@ 1,3 0,0 @@
/*! UIkit 2.8.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=a(window),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='<div class="'+this.options.emptyClass+'"/>',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('<div class="'+this.options.placeClass+'"/>'),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;a<e.length;a++)e[a].children().length||e[a].append(this.tplempty);e=[]},toggleItem:function(a){this[a.hasClass(this.options.collapsedClass)?"expandItem":"collapseItem"](a)},expandItem:function(a){a.removeClass(this.options.collapsedClass)},collapseItem:function(a){var b=a.children(this.options.listNodeName);b.length&&a.addClass(this.options.collapsedClass)},expandAll:function(){var b=this;this.find(b.options.itemNodeName).each(function(){b.expandItem(a(this))})},collapseAll:function(){var b=this;this.find(b.options.itemNodeName).each(function(){b.collapseItem(a(this))})},setParent:function(a){a.children(this.options.listNodeName).length&&a.addClass("uk-parent")},unsetParent:function(a){a.removeClass("uk-parent "+this.options.collapsedClass),a.children(this.options.listNodeName).remove()},dragStart:function(b){var c=this.mouse,e=a(b.target),f=e.closest(this.options.itemNodeName),g=f.offset();this.placeEl.css("height",f.height()),c.offsetX=b.pageX-g.left,c.offsetY=b.pageY-g.top,c.startX=c.lastX=g.left,c.startY=c.lastY=g.top,this.dragRootEl=this.element,this.dragEl=a(document.createElement(this.options.listNodeName)).addClass(this.options.listClass+" "+this.options.dragClass),this.dragEl.css("width",f.width()),this.tmpDragOnSiblings=[f[0].previousSibling,f[0].nextSibling],f.after(this.placeEl),f[0].parentNode.removeChild(f[0]),f.appendTo(this.dragEl),a(document.body).append(this.dragEl),this.dragEl.css({left:g.left,top:g.top});var h,i,j=this.dragEl.find(this.options.itemNodeName);for(h=0;h<j.length;h++)i=a(j[h]).parents(this.options.listNodeName).length,i>this.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.pointEl.offset().top+this.pointEl.height()/2;d=this.placeEl.parent(),m?this.pointEl.replaceWith(this.placeEl):s?this.pointEl.before(this.placeEl):this.pointEl.after(this.placeEl),d.children().length||d.data("nestable")||this.unsetParent(d.parent()),this.dragRootEl.find(j.itemNodeName).length||this.dragRootEl.children().length||this.dragRootEl.append(this.tplempty),q&&(this.dragRootEl=p,this.hasNewRoot=this.element[0]!==this.dragRootEl[0])}}}),a(document).on("uk-domready",function(){a("[data-uk-nestable]").each(function(){var c=a(this);if(!c.data("nestable")){b.nestable(c,b.Utils.options(c.attr("data-uk-nestable")))}})}),b.nestable});
\ No newline at end of file

D js/addons/notify.js => js/addons/notify.js +0 -177
@@ 1,177 0,0 @@
/*! UIkit 2.8.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-notify", ["uikit"], function(){
            return component || addon(jQuery, jQuery.UIkit);
        });
    }

})(function($, UI){

    var containers = {},
        messages   = {},

        notify     =  function(options){

            if ($.type(options) == 'string') {
                options = { message: options };
            }

            if (arguments[1]) {
                options = $.extend(options, $.type(arguments[1]) == 'string' ? {status:arguments[1]} : arguments[1]);
            }

            return (new Message(options)).show();
        },
        closeAll  = function(group, instantly){
            if(group) {
                for(var id in messages) { if(group===messages[id].group) messages[id].close(instantly); }
            } else {
                for(var id in messages) { messages[id].close(instantly); }
            }
        };

    var Message = function(options){

        var $this = this;

        this.options = $.extend({}, Message.defaults, options);

        this.uuid    = "ID"+(new Date().getTime())+"RAND"+(Math.ceil(Math.random() * 100000));
        this.element = $([

            '<div class="uk-notify-message">',
                '<a class="uk-close"></a>',
                '<div>'+this.options.message+'</div>',
            '</div>'

        ].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] = $('<div class="uk-notify uk-notify-'+this.options.pos+'"></div>').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();
                    }

                    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'
    };

    UI.notify          = notify;
    UI.notify.message  = Message;
    UI.notify.closeAll = closeAll;

    return notify;
});
\ No newline at end of file

D js/addons/notify.min.js => js/addons/notify.min.js +0 -3
@@ 1,3 0,0 @@
/*! UIkit 2.8.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(['<div class="uk-notify-message">','<a class="uk-close"></a>',"<div>"+this.options.message+"</div>","</div>"].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('<div class="uk-notify uk-notify-'+this.options.pos+'"></div>').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(),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"},b.notify=e,b.notify.message=g,b.notify.closeAll=f,e});
\ No newline at end of file

D js/addons/pagination.js => js/addons/pagination.js +0 -146
@@ 1,146 0,0 @@
/*! UIkit 2.8.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('<li><span>...</span></li>');
                } 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('<li><span>...</span></li>');
                } 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) ? '<li class="uk-active"><span>' + (options.text) + '</span></li>'
                                                   : '<li><a href="#page-'+(pageIndex+1)+'" data-page="'+pageIndex+'">'+options.text+'</a></li>';

            this.element.append(item);
        }
    });

    // init code
    $(document).on("uk-domready", function(e) {

        $("[data-uk-pagination]").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

D js/addons/pagination.min.js => js/addons/pagination.min.js +0 -3
@@ 1,3 0,0 @@
/*! UIkit 2.8.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&&c.start-b.edges!=1?this.element.append("<li><span>...</span></li>"):c.start-b.edges==1&&this._append(b.edges)}for(a=c.start;a<c.end;a++)this._append(a);if(c.end<this.pages&&b.edges>0){this.pages-b.edges>c.end&&this.pages-b.edges-c.end!=1?this.element.append("<li><span>...</span></li>"):this.pages-b.edges-c.end==1&&this._append(c.end++);var e=Math.max(this.pages-b.edges,c.end);for(a=e;a<this.pages;a++)this._append(a)}b.lblNext&&this._append(b.currentPage+1,{text:b.lblNext})},_append:function(b,c){var d,e;b=0>b?0:b<this.pages?b:this.pages-1,e=a.extend({text:b+1},c),d=b==this.currentPage?'<li class="uk-active"><span>'+e.text+"</span></li>":'<li><a href="#page-'+(b+1)+'" data-page="'+b+'">'+e.text+"</a></li>",this.element.append(d)}}),a(document).on("uk-domready",function(){a("[data-uk-pagination]").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

D js/addons/search.js => js/addons/search.js +0 -90
@@ 1,90 0,0 @@
/*! UIkit 2.8.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           : '<ul class="uk-nav uk-nav-search uk-autocomplete-results">\
                                      {{#msgResultsHeader}}<li class="uk-nav-header uk-skip">{{msgResultsHeader}}</li>{{/msgResultsHeader}}\
                                      {{#items && items.length}}\
                                          {{~items}}\
                                          <li data-url="{{!$item.url}}">\
                                              <a href="{{!$item.url}}">\
                                                  {{{$item.title}}}\
                                                  {{#$item.text}}<div>{{{$item.text}}}</div>{{/$item.text}}\
                                              </a>\
                                          </li>\
                                          {{/items}}\
                                          {{#msgMoreResults}}\
                                              <li class="uk-nav-divider uk-skip"></li>\
                                              <li class="uk-search-moreresults" data-moreresults="true"><a href="#" onclick="jQuery(this).closest(\'form\').submit();">{{msgMoreResults}}</a></li>\
                                          {{/msgMoreResults}}\
                                      {{/end}}\
                                      {{^items.length}}\
                                        {{#msgNoResults}}<li class="uk-skip"><a>{{msgNoResults}}</a></li>{{/msgNoResults}}\
                                      {{/end}}\
                                  </ul>',

            renderer: function(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
    $(document).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

D js/addons/search.min.js => js/addons/search.min.js +0 -3
@@ 1,3 0,0 @@
/*! UIkit 2.8.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:'<ul class="uk-nav uk-nav-search uk-autocomplete-results">                                      {{#msgResultsHeader}}<li class="uk-nav-header uk-skip">{{msgResultsHeader}}</li>{{/msgResultsHeader}}                                      {{#items && items.length}}                                          {{~items}}                                          <li data-url="{{!$item.url}}">                                              <a href="{{!$item.url}}">                                                  {{{$item.title}}}                                                  {{#$item.text}}<div>{{{$item.text}}}</div>{{/$item.text}}                                              </a>                                          </li>                                          {{/items}}                                          {{#msgMoreResults}}                                              <li class="uk-nav-divider uk-skip"></li>                                              <li class="uk-search-moreresults" data-moreresults="true"><a href="#" onclick="jQuery(this).closest(\'form\').submit();">{{msgMoreResults}}</a></li>                                          {{/msgMoreResults}}                                      {{/end}}                                      {{^items.length}}                                        {{#msgNoResults}}<li class="uk-skip"><a>{{msgNoResults}}</a></li>{{/msgNoResults}}                                      {{/end}}                                  </ul>',renderer:function(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)}}),a(document).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

D js/addons/sortable.js => js/addons/sortable.js +0 -494
@@ 1,494 0,0 @@
/*! UIkit 2.8.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, clickedlink;

    // disable native dragndrop support for now
    supportsDragAndDrop = false;

    UI.component('sortable', {

        defaults: {

            warp             : false,
            animation        : 150,

            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;

                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();

                draggingPlaceholder = $('<div class="'+([$this.options.draggingClass, $this.options.dragCustomClass].join(' '))+'"></div>').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]);

                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 (this === currentlyDraggingElement) {
                    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) {

            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);
                $(document).trigger("uk-check-display");
                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', '');
                                $(document).trigger("uk-check-display");
                            }
                        });
                    }, 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
    $(document).on("uk-domready", function(e) {

        $("[data-uk-sortable]").each(function(){

          var ele = $(this);

          if(!ele.data("sortable")) {
              var plugin = UI.sortable(ele, UI.Utils.options(ele.attr("data-uk-sortable")));
          }
        });
    });

    $(document).on('mousemove touchmove', function(e) {

        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 });
        }
    });

    $(document).on('mouseup touchend', function() {

        if(!moving && clickedlink) {
            location.href = clickedlink.attr('href');
        }

        clickedlink = false;
    });

    return UI.sortable;
});
\ No newline at end of file

D js/addons/sortable.min.js => js/addons/sortable.min.js +0 -3
@@ 1,3 0,0 @@
/*! UIkit 2.8.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="ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch,j=!i&&function(){var a=document.createElement("div");return"draggable"in a||"ondragstart"in a&&"ondrop"in a}();return j=!1,b.component("sortable",{defaults:{warp:!1,animation:150,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=i&&c.touches&&c.touches[0]||{},f=e.target||c.target;if(i&&document.elementFromPoint&&(f=document.elementFromPoint(c.pageX-document.body.scrollLeft,c.pageY-document.body.scrollTop)),a(f).hasClass(m.options.childClass))b.apply(f,[c]);else if(f!==n){var g=d(n,f);g&&b.apply(g,[c])}}}function c(){j||(i?n.addEventListener("touchmove",w,!1):(n.addEventListener("mouseover",s,!1),n.addEventListener("mouseout",t,!1)),n.addEventListener(i?"touchend":"mouseup",u,!1),document.addEventListener(i?"touchend":"mouseup",v,!1),document.addEventListener("selectstart",e,!1))}function k(){j||(i?n.removeEventListener("touchmove",w,!1):(n.removeEventListener("mouseover",s,!1),n.removeEventListener("mouseout",t,!1)),n.removeEventListener(i?"touchend":"mouseup",u,!1),document.removeEventListener(i?"touchend":"mouseup",v,!1),document.removeEventListener("selectstart",e,!1))}var l,m=this,n=this.element[0],o=null,p=null;j?this.element.children().attr("draggable","true"):this.element.on("mousedown touchstart","a[href]",function(){h=a(this)}).on("click","a[href]",function(b){return h=a(this),b.stopImmediatePropagation(),!1});var q=b(function(b){g=!1;{var d=a(b.target);m.element.children()}if(i||2!=b.button){if(m.options.handleClass){var e=d.hasClass(m.options.handleClass)?d:d.closest("."+m.options.handleClass,n);if(!e.length)return void b.preventDefault()}b.dataTransfer&&(b.dataTransfer.effectAllowed="move",b.dataTransfer.dropEffect="move",b.dataTransfer.setData("Text","*")),o=this,f&&f.remove();var h=a(o),k=h.offset();f=a('<div class="'+[m.options.draggingClass,m.options.dragCustomClass].join(" ")+'"></div>').css({display:"none",top:k.top,left:k.left,width:h.width(),height:h.height(),padding:h.css("padding")}).data("mouse-offset",{left:k.left-parseInt(b.pageX,10),top:k.top-parseInt(b.pageY,10)}).append(h.html()).appendTo("body"),f.$current=h,f.$sortable=m,c(),m.options.start(this,o),m.trigger("sortable-start",[m,o]),j||b.preventDefault()}}),r=b(function(a){return o?(a.preventDefault&&a.preventDefault(),!1):!0}),s=b(a.UIkit.Utils.debounce(function(){if(!o||o===this)return!0;var b=m.dragenterData(this);return m.dragenterData(this,b+1),0===b&&(a(this).addClass(m.options.overClass),m.options.warp||m.moveElementNextTo(o,this)),!1}),40),t=b(function(){var b=m.dragenterData(this);m.dragenterData(this,b-1),m.dragenterData(this)||(a(this).removeClass(m.options.overClass),m.dragenterData(this,!1))}),u=b(function(a){if("drop"===a.type&&(a.stopPropagation&&a.stopPropagation(),a.preventDefault&&a.preventDefault()),this!==o){if(m.options.warp){var b=o.nextSibling;this.parentNode.insertBefore(o,this),this.parentNode.insertBefore(this,b)}m.options.change(this,o),m.trigger("sortable-change",[m,o])}}),v=function(){o=null,p=null,m.element.children().each(function(){1===this.nodeType&&(a(this).removeClass(m.options.overClass).removeClass(m.options.placeholderClass).removeClass(m.options.childClass),m.dragenterData(this,!1))}),a("html").removeClass(m.options.dragMovingClass),k(),m.options.stop(this),m.trigger("sortable-stop",[m]),f.remove(),f=null},w=b(function(b){return o&&o!==this&&p!==this?(l.removeClass(m.options.overClass),p=this,m.options.warp?a(this).addClass(m.options.overClass):m.moveElementNextTo(o,this),e(b)):!0});j?(n.addEventListener("dragstart",q,!1),n.addEventListener("dragenter",s,!1),n.addEventListener("dragleave",t,!1),n.addEventListener("drop",u,!1),n.addEventListener("dragover",r,!1),n.addEventListener("dragend",v,!1)):n.addEventListener(i?"touchstart":"mousedown",q,!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(b,d){var e=this,f=a(b).parent().css("min-height",""),g=c(b,d)?d:d.nextSibling,h=f.children(),i=h.length;return e.options.warp||!e.options.animation?(d.parentNode.insertBefore(b,g),void a(document).trigger("uk-check-display")):(f.css("min-height",f.height()),h.stop().each(function(){var b=a(this),c=b.position();c.width=b.width(),b.data("offset-before",c)}),d.parentNode.insertBefore(b,g),h=f.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 h.each(function(){var b=a(this),c=(b.data("offset-before"),b.data("offset-after"));b.css("pointer-events","none").width(),setTimeout(function(){b.animate({top:c.top,left:c.left},e.options.animation,function(){b.css({position:"",top:"",left:"","min-width":"","pointer-events":""}).removeClass(e.options.overClass).attr("data-child-dragenter",""),i--,i||(f.css("min-height",""),a(document).trigger("uk-check-display"))})},0)}))}}),a(document).on("uk-domready",function(){a("[data-uk-sortable]").each(function(){var c=a(this);if(!c.data("sortable")){b.sortable(c,b.Utils.options(c.attr("data-uk-sortable")))}})}),a(document).on("mousemove touchmove",function(b){if(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})}}),a(document).on("mouseup touchend",function(){!g&&h&&(location.href=h.attr("href")),h=!1}),b.sortable});
\ No newline at end of file

D js/addons/sticky.js => js/addons/sticky.js +0 -130
@@ 1,130 0,0 @@
/*! UIkit 2.8.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,
            clsactive    : 'uk-active',
            clswrapper   : 'uk-sticky',
            getWidthFrom : ''
        },

        init: function() {

            var stickyId = this.element.attr('id') || ("s"+Math.ceil(Math.random()*10000)),
                wrapper  = $('<div></div>').attr('id', 'sticky-'+stickyId).addClass(this.options.clswrapper);

            wrapper = this.element.wrap(wrapper).parent().css('height', this.element.outerHeight());

            if (this.element.css("float") != "none") {
                wrapper.css({"float":this.element.css("float")});
                this.element.css({"float":"none"});
            }

            sticked.push({
                top: this.options.top,
                bottom: this.options.bottom,
                element: this.element,
                currentTop: null,
                wrapper: wrapper,
                clsactive: this.options.clsactive,
                getWidthFrom: this.options.getWidthFrom || wrapper
            });
        },

        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;

        for (var i = 0; i < sticked.length; i++) {

            if (!sticked[i].element.is(":visible")) {
                continue;
            }

            var sticky     = sticked[i],
                elementTop = sticky.wrapper.offset().top,
                etse       = elementTop - sticky.top - extra;

            if (scrollTop <= etse) {

                if (sticky.currentTop !== null) {
                    sticky.element.css({"position":"", "top":"", "width":"", "left":""});
                    sticky.wrapper.removeClass(sticky.clsactive);
                    sticky.currentTop = null;
                }

            } else {

                var newTop = documentHeight - sticky.element.outerHeight() - sticky.top - sticky.bottom - scrollTop - extra;

                newTop = newTop < 0 ? newTop + sticky.top : sticky.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
                    });

                    sticky.wrapper.addClass(sticky.clsactive);
                    sticky.currentTop = newTop;
                }
            }
        }

    }

    // should be more efficient than using $win.scroll(scroller):
    $doc.on('uk-scroll', scroller);

    $doc.on("uk-domready", function(e) {
        setTimeout(function(){

            scroller();

            $("[data-uk-sticky]").each(function(){

                var $ele = $(this);

                if(!$ele.data("sticky")) {
                    UI.sticky($ele, UI.Utils.options($ele.attr('data-uk-sticky')));
                }
            });
        }, 0);
    });

    return $.fn.uksticky;
});
\ No newline at end of file

D js/addons/sticky.min.js => js/addons/sticky.min.js +0 -3
@@ 1,3 0,0 @@
/*! UIkit 2.8.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)for(var b=d.scrollTop(),c=e.height(),g=c-d.height(),h=b>g?g-b:0,i=0;i<f.length;i++)if(f[i].element.is(":visible")){var j=f[i],k=j.wrapper.offset().top,l=k-j.top-h;if(l>=b)null!==j.currentTop&&(j.element.css({position:"",top:"",width:"",left:""}),j.wrapper.removeClass(j.clsactive),j.currentTop=null);else{var m=c-j.element.outerHeight()-j.top-j.bottom-b-h;m=0>m?m+j.top:j.top,j.currentTop!=m&&(j.element.css({position:"fixed",top:m,width:"undefined"!=typeof j.getWidthFrom?a(j.getWidthFrom).width():j.element.width(),left:j.wrapper.offset().left}),j.wrapper.addClass(j.clsactive),j.currentTop=m)}}}var d=b.$win,e=b.$doc,f=[];return b.component("sticky",{defaults:{top:0,bottom:0,clsactive:"uk-active",clswrapper:"uk-sticky",getWidthFrom:""},init:function(){var b=this.element.attr("id")||"s"+Math.ceil(1e4*Math.random()),c=a("<div></div>").attr("id","sticky-"+b).addClass(this.options.clswrapper);c=this.element.wrap(c).parent().css("height",this.element.outerHeight()),"none"!=this.element.css("float")&&(c.css({"float":this.element.css("float")}),this.element.css({"float":"none"})),f.push({top:this.options.top,bottom:this.options.bottom,element:this.element,currentTop:null,wrapper:c,clsactive:this.options.clsactive,getWidthFrom:this.options.getWidthFrom||c})},update:function(){c()}}),e.on("uk-scroll",c),e.on("uk-domready",function(){setTimeout(function(){c(),a("[data-uk-sticky]").each(function(){var c=a(this);c.data("sticky")||b.sticky(c,b.Utils.options(c.attr("data-uk-sticky")))})},0)}),a.fn.uksticky});
\ No newline at end of file

D js/addons/timepicker.js => js/addons/timepicker.js +0 -163
@@ 1,163 0,0 @@
/*! UIkit 2.8.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";

    var times = {'12h':[], '24h':[]};

    for(var i = 0, h=''; i<24; i++) {

        h = ''+i;

        if(i<10)  h = '0'+h;

        times['24h'].push({value: (h+':00')});
        times['24h'].push({value: (h+':30')});

        if (i<13) {
            times['12h'].push({value: (h+':00 AM')});
            times['12h'].push({value: (h+':30 AM')});
        }

        if (i > 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  = '<ul class="uk-nav uk-nav-autocomplete uk-autocomplete-results">{{~items}}<li data-value="{{$item.value}}"><a>{{$item.value}}</a></li>{{/items}}</ul>';

            this.options.source = function(release) {
                release(times[$this.options.format] || times['12h']);
            };

            this.element.wrap('<div class="uk-autocomplete"></div>');

            this.autocomplete = UI.autocomplete(this.element.parent(), this.options);
            this.autocomplete.dropdown.addClass('uk-dropdown-scrollable');

            this.autocomplete.on('autocomplete-show', function() {

                var selected = $this.autocomplete.dropdown.find('[data-value="'+$this.element.val()+'"]');

                setTimeout(function(){
                    $this.autocomplete.pick(selected, true);
                }, 10);
            });

            this.element.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.element.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.element.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
    $(document).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")));

            ele.focus();
        }
    });
});
\ No newline at end of file

D js/addons/timepicker.min.js => js/addons/timepicker.min.js +0 -3
@@ 1,3 0,0 @@
/*! UIkit 2.8.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='<ul class="uk-nav uk-nav-autocomplete uk-autocomplete-results">{{~items}}<li data-value="{{$item.value}}"><a>{{$item.value}}</a></li>{{/items}}</ul>',this.options.source=function(b){b(c[a.options.format]||c["12h"])},this.element.wrap('<div class="uk-autocomplete"></div>'),this.autocomplete=b.autocomplete(this.element.parent(),this.options),this.autocomplete.dropdown.addClass("uk-dropdown-scrollable"),this.autocomplete.on("autocomplete-show",function(){var b=a.autocomplete.dropdown.find('[data-value="'+a.element.val()+'"]');setTimeout(function(){a.autocomplete.pick(b,!0)},10)}),this.element.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.element.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.element.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:"")}}),a(document).on("focus.timepicker.uikit","[data-uk-timepicker]",function(){var c=a(this);if(!c.data("timepicker")){{b.timepicker(c,b.Utils.options(c.attr("data-uk-timepicker")))}c.focus()}})});
\ No newline at end of file

D js/addons/upload.js => js/addons/upload.js +0 -239
@@ 1,239 0,0 @@
/*! UIkit 2.8.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);

                    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;

                settings.complete = function(response, xhr){
                    uploaded = uploaded+1;
                    complete(response, xhr);
                    if (uploaded<count){
                        upload([files[uploaded]], settings);
                    } else {
                        settings.allcomplete(response, xhr);
                    }
                };

                upload([files[0]], settings);

        } else {

            settings.complete = function(response, xhr){
                complete(response, xhr);
                settings.allcomplete(response, xhr);
            };

            upload(files, settings);
        }

        function upload(files, settings){

            // upload all at once
            var formData = new FormData(), xhr = new XMLHttpRequest();

            if (settings.before(settings, files)===false) return;

            for (var i = 0, f; f = files[i]; i++) { formData.append(settings.param, f); }
            for (var p in settings.params) { formData.append(p, settings.params[p]); }

            // Add any event handlers here...
            xhr.upload.addEventListener("progress", function(e){
                var percent = (e.loaded / e.total)*100;
                settings.progress(percent, e);
            }, false);

            xhr.addEventListener("loadstart", function(e){ settings.loadstart(e); }, false);
            xhr.addEventListener("load",      function(e){ settings.load(e);      }, false);
            xhr.addEventListener("loadend",   function(e){ settings.loadend(e);   }, false);
            xhr.addEventListener("error",     function(e){ settings.error(e);     }, false);
            xhr.addEventListener("abort",     function(e){ settings.abort(e);     }, false);

            xhr.open(settings.method, settings.action, true);

            xhr.onreadystatechange = function() {

                settings.readystatechange(xhr);

                if (xhr.readyState==4){

                    var response = xhr.responseText;

                    if (settings.type=="json") {
                        try {
                            response = $.parseJSON(response);
                        } catch(e) {
                            response = false;
                        }
                    }

                    settings.complete(response, xhr);
                }
            };

            xhr.send(formData);
        }
    }

    xhrupload.defaults = {
        'action': '',
        'single': true,
        'method': 'POST',
        'param' : 'files[]',
        'params': {},
        'allow' : '*.*',
        'type'  : 'text',

        // events
        'before'          : function(o){},
        'loadstart'       : function(){},
        'load'            : function(){},
        'loadend'         : function(){},
        'error'           : function(){},
        'abort'           : function(){},
        'progress'        : function(){},
        'complete'        : function(){},
        'allcomplete'     : function(){},
        'readystatechange': function(){},
        'notallowed'      : function(file, settings){ alert('Only the following file types are allowed: '+settings.allow); }
    };

    function matchName(pattern, path) {

        var parsedPattern = '^' + pattern.replace(/\//g, '\\/').
            replace(/\*\*/g, '(\\/[^\\/]+)*').
            replace(/\*/g, '[^\\/]+').
            replace(/((?!\\))\?/g, '$1.') + '$';

        parsedPattern = '^' + parsedPattern + '$';

        return (path.match(new RegExp(parsedPattern, 'i')) !== null);
    }

    UI.Utils.xhrupload = xhrupload;

    return xhrupload;
});
\ No newline at end of file

D js/addons/upload.min.js => js/addons/upload.min.js +0 -3
@@ 1,3 0,0 @@
/*! UIkit 2.8.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-upload",["uikit"],function(){return b||a(jQuery,jQuery.UIkit)})}(function(a,b){function c(e,f){function g(b,c){var d=new FormData,e=new XMLHttpRequest;if(c.before(c,b)!==!1){for(var f,g=0;f=b[g];g++)d.append(c.param,f);for(var h in c.params)d.append(h,c.params[h]);e.upload.addEventListener("progress",function(a){var b=a.loaded/a.total*100;c.progress(b,a)},!1),e.addEventListener("loadstart",function(a){c.loadstart(a)},!1),e.addEventListener("load",function(a){c.load(a)},!1),e.addEventListener("loadend",function(a){c.loadend(a)},!1),e.addEventListener("error",function(a){c.error(a)},!1),e.addEventListener("abort",function(a){c.abort(a)},!1),e.open(c.method,c.action,!0),e.onreadystatechange=function(){if(c.readystatechange(e),4==e.readyState){var b=e.responseText;if("json"==c.type)try{b=a.parseJSON(b)}catch(d){b=!1}c.complete(b,e)}},e.send(d)}}if(!b.support.ajaxupload)return this;if(f=a.extend({},c.defaults,f),e.length){if("*.*"!==f.allow)for(var h,i=0;h=e[i];i++)if(!d(f.allow,h.name))return void("string"==typeof f.notallowed?alert(f.notallowed):f.notallowed(h,f));var j=f.complete;if(f.single){var k=e.length,l=0;f.complete=function(a,b){l+=1,j(a,b),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),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",before: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

D js/app.js => js/app.js +0 -3
@@ 1,3 0,0 @@
// Foundation JavaScript
// Documentation can be found at: http://foundation.zurb.com/docs
$(document).foundation();
\ No newline at end of file

D js/jquery-2.1.1.min.js => js/jquery-2.1.1.min.js +0 -4
@@ 1,4 0,0 @@
/*! jQuery v2.1.1 | (c) 2005, 2014 jQuery Foundation, Inc. | jquery.org/license */
!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k={},l=a.document,m="2.1.1",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return n.each(this,a,b)},map:function(a){return this.pushStack(n.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:c.sort,splice:c.splice},n.extend=n.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||n.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(a=arguments[h]))for(b in a)c=g[b],d=a[b],g!==d&&(j&&d&&(n.isPlainObject(d)||(e=n.isArray(d)))?(e?(e=!1,f=c&&n.isArray(c)?c:[]):f=c&&n.isPlainObject(c)?c:{},g[b]=n.extend(j,f,d)):void 0!==d&&(g[b]=d));return g},n.extend({expando:"jQuery"+(m+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===n.type(a)},isArray:Array.isArray,isWindow:function(a){return null!=a&&a===a.window},isNumeric:function(a){return!n.isArray(a)&&a-parseFloat(a)>=0},isPlainObject:function(a){return"object"!==n.type(a)||a.nodeType||n.isWindow(a)?!1:a.constructor&&!j.call(a.constructor.prototype,"isPrototypeOf")?!1:!0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?h[i.call(a)]||"object":typeof a},globalEval:function(a){var b,c=eval;a=n.trim(a),a&&(1===a.indexOf("use strict")?(b=l.createElement("script"),b.text=a,l.head.appendChild(b).parentNode.removeChild(b)):c(a))},camelCase:function(a){return a.replace(p,"ms-").replace(q,r)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,c){var d,e=0,f=a.length,g=s(a);if(c){if(g){for(;f>e;e++)if(d=b.apply(a[e],c),d===!1)break}else for(e in a)if(d=b.apply(a[e],c),d===!1)break}else if(g){for(;f>e;e++)if(d=b.call(a[e],e,a[e]),d===!1)break}else for(e in a)if(d=b.call(a[e],e,a[e]),d===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(o,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(s(Object(a))?n.merge(c,"string"==typeof a?[a]:a):f.call(c,a)),c},inArray:function(a,b,c){return null==b?-1:g.call(b,a,c)},merge:function(a,b){for(var c=+b.length,d=0,e=a.length;c>d;d++)a[e++]=b[d];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,f=0,g=a.length,h=s(a),i=[];if(h)for(;g>f;f++)d=b(a[f],f,c),null!=d&&i.push(d);else for(f in a)d=b(a[f],f,c),null!=d&&i.push(d);return e.apply([],i)},guid:1,proxy:function(a,b){var c,e,f;return"string"==typeof b&&(c=a[b],b=a,a=c),n.isFunction(a)?(e=d.call(arguments,2),f=function(){return a.apply(b||this,e.concat(d.call(arguments)))},f.guid=a.guid=a.guid||n.guid++,f):void 0},now:Date.now,support:k}),n.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){h["[object "+b+"]"]=b.toLowerCase()});function s(a){var b=a.length,c=n.type(a);return"function"===c||n.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var t=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+-new Date,v=a.document,w=0,x=0,y=gb(),z=gb(),A=gb(),B=function(a,b){return a===b&&(l=!0),0},C="undefined",D=1<<31,E={}.hasOwnProperty,F=[],G=F.pop,H=F.push,I=F.push,J=F.slice,K=F.indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(this[b]===a)return b;return-1},L="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",M="[\\x20\\t\\r\\n\\f]",N="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",O=N.replace("w","w#"),P="\\["+M+"*("+N+")(?:"+M+"*([*^$|!~]?=)"+M+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+O+"))|)"+M+"*\\]",Q=":("+N+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+P+")*)|.*)\\)|)",R=new RegExp("^"+M+"+|((?:^|[^\\\\])(?:\\\\.)*)"+M+"+$","g"),S=new RegExp("^"+M+"*,"+M+"*"),T=new RegExp("^"+M+"*([>+~]|"+M+")"+M+"*"),U=new RegExp("="+M+"*([^\\]'\"]*?)"+M+"*\\]","g"),V=new RegExp(Q),W=new RegExp("^"+O+"$"),X={ID:new RegExp("^#("+N+")"),CLASS:new RegExp("^\\.("+N+")"),TAG:new RegExp("^("+N.replace("w","w*")+")"),ATTR:new RegExp("^"+P),PSEUDO:new RegExp("^"+Q),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+L+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,$=/^[^{]+\{\s*\[native \w/,_=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ab=/[+~]/,bb=/'|\\/g,cb=new RegExp("\\\\([\\da-f]{1,6}"+M+"?|("+M+")|.)","ig"),db=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)};try{I.apply(F=J.call(v.childNodes),v.childNodes),F[v.childNodes.length].nodeType}catch(eb){I={apply:F.length?function(a,b){H.apply(a,J.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function fb(a,b,d,e){var f,h,j,k,l,o,r,s,w,x;if((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,d=d||[],!a||"string"!=typeof a)return d;if(1!==(k=b.nodeType)&&9!==k)return[];if(p&&!e){if(f=_.exec(a))if(j=f[1]){if(9===k){if(h=b.getElementById(j),!h||!h.parentNode)return d;if(h.id===j)return d.push(h),d}else if(b.ownerDocument&&(h=b.ownerDocument.getElementById(j))&&t(b,h)&&h.id===j)return d.push(h),d}else{if(f[2])return I.apply(d,b.getElementsByTagName(a)),d;if((j=f[3])&&c.getElementsByClassName&&b.getElementsByClassName)return I.apply(d,b.getElementsByClassName(j)),d}if(c.qsa&&(!q||!q.test(a))){if(s=r=u,w=b,x=9===k&&a,1===k&&"object"!==b.nodeName.toLowerCase()){o=g(a),(r=b.getAttribute("id"))?s=r.replace(bb,"\\$&"):b.setAttribute("id",s),s="[id='"+s+"'] ",l=o.length;while(l--)o[l]=s+qb(o[l]);w=ab.test(a)&&ob(b.parentNode)||b,x=o.join(",")}if(x)try{return I.apply(d,w.querySelectorAll(x)),d}catch(y){}finally{r||b.removeAttribute("id")}}}return i(a.replace(R,"$1"),b,d,e)}function gb(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function hb(a){return a[u]=!0,a}function ib(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function jb(a,b){var c=a.split("|"),e=a.length;while(e--)d.attrHandle[c[e]]=b}function kb(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||D)-(~a.sourceIndex||D);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function lb(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function mb(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function nb(a){return hb(function(b){return b=+b,hb(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function ob(a){return a&&typeof a.getElementsByTagName!==C&&a}c=fb.support={},f=fb.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=fb.setDocument=function(a){var b,e=a?a.ownerDocument||a:v,g=e.defaultView;return e!==n&&9===e.nodeType&&e.documentElement?(n=e,o=e.documentElement,p=!f(e),g&&g!==g.top&&(g.addEventListener?g.addEventListener("unload",function(){m()},!1):g.attachEvent&&g.attachEvent("onunload",function(){m()})),c.attributes=ib(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ib(function(a){return a.appendChild(e.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=$.test(e.getElementsByClassName)&&ib(function(a){return a.innerHTML="<div class='a'></div><div class='a i'></div>",a.firstChild.className="i",2===a.getElementsByClassName("i").length}),c.getById=ib(function(a){return o.appendChild(a).id=u,!e.getElementsByName||!e.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if(typeof b.getElementById!==C&&p){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},d.filter.ID=function(a){var b=a.replace(cb,db);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(cb,db);return function(a){var c=typeof a.getAttributeNode!==C&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return typeof b.getElementsByTagName!==C?b.getElementsByTagName(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return typeof b.getElementsByClassName!==C&&p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=$.test(e.querySelectorAll))&&(ib(function(a){a.innerHTML="<select msallowclip=''><option selected=''></option></select>",a.querySelectorAll("[msallowclip^='']").length&&q.push("[*^$]="+M+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+M+"*(?:value|"+L+")"),a.querySelectorAll(":checked").length||q.push(":checked")}),ib(function(a){var b=e.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+M+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=$.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ib(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",Q)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=$.test(o.compareDocumentPosition),t=b||$.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===e||a.ownerDocument===v&&t(v,a)?-1:b===e||b.ownerDocument===v&&t(v,b)?1:k?K.call(k,a)-K.call(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,f=a.parentNode,g=b.parentNode,h=[a],i=[b];if(!f||!g)return a===e?-1:b===e?1:f?-1:g?1:k?K.call(k,a)-K.call(k,b):0;if(f===g)return kb(a,b);c=a;while(c=c.parentNode)h.unshift(c);c=b;while(c=c.parentNode)i.unshift(c);while(h[d]===i[d])d++;return d?kb(h[d],i[d]):h[d]===v?-1:i[d]===v?1:0},e):n},fb.matches=function(a,b){return fb(a,null,null,b)},fb.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(U,"='$1']"),!(!c.matchesSelector||!p||r&&r.test(b)||q&&q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return fb(b,n,null,[a]).length>0},fb.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},fb.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&E.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},fb.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},fb.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=fb.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=fb.selectors={cacheLength:50,createPseudo:hb,match:X,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(cb,db),a[3]=(a[3]||a[4]||a[5]||"").replace(cb,db),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||fb.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&fb.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return X.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&V.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(cb,db).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+M+")"+a+"("+M+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||typeof a.getAttribute!==C&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=fb.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h;if(q){if(f){while(p){l=b;while(l=l[p])if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){k=q[u]||(q[u]={}),j=k[a]||[],n=j[0]===w&&j[1],m=j[0]===w&&j[2],l=n&&q.childNodes[n];while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if(1===l.nodeType&&++m&&l===b){k[a]=[w,n,m];break}}else if(s&&(j=(b[u]||(b[u]={}))[a])&&j[0]===w)m=j[1];else while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if((h?l.nodeName.toLowerCase()===r:1===l.nodeType)&&++m&&(s&&((l[u]||(l[u]={}))[a]=[w,m]),l===b))break;return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||fb.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?hb(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=K.call(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:hb(function(a){var b=[],c=[],d=h(a.replace(R,"$1"));return d[u]?hb(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),!c.pop()}}),has:hb(function(a){return function(b){return fb(a,b).length>0}}),contains:hb(function(a){return function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:hb(function(a){return W.test(a||"")||fb.error("unsupported lang: "+a),a=a.replace(cb,db).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Z.test(a.nodeName)},input:function(a){return Y.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:nb(function(){return[0]}),last:nb(function(a,b){return[b-1]}),eq:nb(function(a,b,c){return[0>c?c+b:c]}),even:nb(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:nb(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:nb(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:nb(function(a,b,c){for(var d=0>c?c+b:c;++d<b;)a.push(d);return a})}},d.pseudos.nth=d.pseudos.eq;for(b in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})d.pseudos[b]=lb(b);for(b in{submit:!0,reset:!0})d.pseudos[b]=mb(b);function pb(){}pb.prototype=d.filters=d.pseudos,d.setFilters=new pb,g=fb.tokenize=function(a,b){var c,e,f,g,h,i,j,k=z[a+" "];if(k)return b?0:k.slice(0);h=a,i=[],j=d.preFilter;while(h){(!c||(e=S.exec(h)))&&(e&&(h=h.slice(e[0].length)||h),i.push(f=[])),c=!1,(e=T.exec(h))&&(c=e.shift(),f.push({value:c,type:e[0].replace(R," ")}),h=h.slice(c.length));for(g in d.filter)!(e=X[g].exec(h))||j[g]&&!(e=j[g](e))||(c=e.shift(),f.push({value:c,type:g,matches:e}),h=h.slice(c.length));if(!c)break}return b?h.length:h?fb.error(a):z(a,i).slice(0)};function qb(a){for(var b=0,c=a.length,d="";c>b;b++)d+=a[b].value;return d}function rb(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(i=b[u]||(b[u]={}),(h=i[d])&&h[0]===w&&h[1]===f)return j[2]=h[2];if(i[d]=j,j[2]=a(b,c,g))return!0}}}function sb(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function tb(a,b,c){for(var d=0,e=b.length;e>d;d++)fb(a,b[d],c);return c}function ub(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function vb(a,b,c,d,e,f){return d&&!d[u]&&(d=vb(d)),e&&!e[u]&&(e=vb(e,f)),hb(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||tb(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:ub(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=ub(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?K.call(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=ub(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):I.apply(g,r)})}function wb(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=rb(function(a){return a===b},h,!0),l=rb(function(a){return K.call(b,a)>-1},h,!0),m=[function(a,c,d){return!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d))}];f>i;i++)if(c=d.relative[a[i].type])m=[rb(sb(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return vb(i>1&&sb(m),i>1&&qb(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(R,"$1"),c,e>i&&wb(a.slice(i,e)),f>e&&wb(a=a.slice(e)),f>e&&qb(a))}m.push(c)}return sb(m)}function xb(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,m,o,p=0,q="0",r=f&&[],s=[],t=j,u=f||e&&d.find.TAG("*",k),v=w+=null==t?1:Math.random()||.1,x=u.length;for(k&&(j=g!==n&&g);q!==x&&null!=(l=u[q]);q++){if(e&&l){m=0;while(o=a[m++])if(o(l,g,h)){i.push(l);break}k&&(w=v)}c&&((l=!o&&l)&&p--,f&&r.push(l))}if(p+=q,c&&q!==p){m=0;while(o=b[m++])o(r,s,g,h);if(f){if(p>0)while(q--)r[q]||s[q]||(s[q]=G.call(i));s=ub(s)}I.apply(i,s),k&&!f&&s.length>0&&p+b.length>1&&fb.uniqueSort(i)}return k&&(w=v,j=t),r};return c?hb(f):f}return h=fb.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=wb(b[c]),f[u]?d.push(f):e.push(f);f=A(a,xb(e,d)),f.selector=a}return f},i=fb.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(cb,db),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=X.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(cb,db),ab.test(j[0].type)&&ob(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&qb(j),!a)return I.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,ab.test(a)&&ob(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ib(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ib(function(a){return a.innerHTML="<a href='#'></a>","#"===a.firstChild.getAttribute("href")})||jb("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ib(function(a){return a.innerHTML="<input/>",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||jb("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ib(function(a){return null==a.getAttribute("disabled")})||jb(L,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),fb}(a);n.find=t,n.expr=t.selectors,n.expr[":"]=n.expr.pseudos,n.unique=t.uniqueSort,n.text=t.getText,n.isXMLDoc=t.isXML,n.contains=t.contains;var u=n.expr.match.needsContext,v=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,w=/^.[^:#\[\.,]*$/;function x(a,b,c){if(n.isFunction(b))return n.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return n.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(w.test(b))return n.filter(b,a,c);b=n.filter(b,a)}return n.grep(a,function(a){return g.call(b,a)>=0!==c})}n.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?n.find.matchesSelector(d,a)?[d]:[]:n.find.matches(a,n.grep(b,function(a){return 1===a.nodeType}))},n.fn.extend({find:function(a){var b,c=this.length,d=[],e=this;if("string"!=typeof a)return this.pushStack(n(a).filter(function(){for(b=0;c>b;b++)if(n.contains(e[b],this))return!0}));for(b=0;c>b;b++)n.find(a,e[b],d);return d=this.pushStack(c>1?n.unique(d):d),d.selector=this.selector?this.selector+" "+a:a,d},filter:function(a){return this.pushStack(x(this,a||[],!1))},not:function(a){return this.pushStack(x(this,a||[],!0))},is:function(a){return!!x(this,"string"==typeof a&&u.test(a)?n(a):a||[],!1).length}});var y,z=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,A=n.fn.init=function(a,b){var c,d;if(!a)return this;if("string"==typeof a){if(c="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:z.exec(a),!c||!c[1]&&b)return!b||b.jquery?(b||y).find(a):this.constructor(b).find(a);if(c[1]){if(b=b instanceof n?b[0]:b,n.merge(this,n.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:l,!0)),v.test(c[1])&&n.isPlainObject(b))for(c in b)n.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c]);return this}return d=l.getElementById(c[2]),d&&d.parentNode&&(this.length=1,this[0]=d),this.context=l,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):n.isFunction(a)?"undefined"!=typeof y.ready?y.ready(a):a(n):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),n.makeArray(a,this))};A.prototype=n.fn,y=n(l);var B=/^(?:parents|prev(?:Until|All))/,C={children:!0,contents:!0,next:!0,prev:!0};n.extend({dir:function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&n(a).is(c))break;d.push(a)}return d},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}}),n.fn.extend({has:function(a){var b=n(a,this),c=b.length;return this.filter(function(){for(var a=0;c>a;a++)if(n.contains(this,b[a]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=u.test(a)||"string"!=typeof a?n(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&n.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?n.unique(f):f)},index:function(a){return a?"string"==typeof a?g.call(n(a),this[0]):g.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(n.unique(n.merge(this.get(),n(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function D(a,b){while((a=a[b])&&1!==a.nodeType);return a}n.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return n.dir(a,"parentNode")},parentsUntil:function(a,b,c){return n.dir(a,"parentNode",c)},next:function(a){return D(a,"nextSibling")},prev:function(a){return D(a,"previousSibling")},nextAll:function(a){return n.dir(a,"nextSibling")},prevAll:function(a){return n.dir(a,"previousSibling")},nextUntil:function(a,b,c){return n.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return n.dir(a,"previousSibling",c)},siblings:function(a){return n.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return n.sibling(a.firstChild)},contents:function(a){return a.contentDocument||n.merge([],a.childNodes)}},function(a,b){n.fn[a]=function(c,d){var e=n.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=n.filter(d,e)),this.length>1&&(C[a]||n.unique(e),B.test(a)&&e.reverse()),this.pushStack(e)}});var E=/\S+/g,F={};function G(a){var b=F[a]={};return n.each(a.match(E)||[],function(a,c){b[c]=!0}),b}n.Callbacks=function(a){a="string"==typeof a?F[a]||G(a):n.extend({},a);var b,c,d,e,f,g,h=[],i=!a.once&&[],j=function(l){for(b=a.memory&&l,c=!0,g=e||0,e=0,f=h.length,d=!0;h&&f>g;g++)if(h[g].apply(l[0],l[1])===!1&&a.stopOnFalse){b=!1;break}d=!1,h&&(i?i.length&&j(i.shift()):b?h=[]:k.disable())},k={add:function(){if(h){var c=h.length;!function g(b){n.each(b,function(b,c){var d=n.type(c);"function"===d?a.unique&&k.has(c)||h.push(c):c&&c.length&&"string"!==d&&g(c)})}(arguments),d?f=h.length:b&&(e=c,j(b))}return this},remove:function(){return h&&n.each(arguments,function(a,b){var c;while((c=n.inArray(b,h,c))>-1)h.splice(c,1),d&&(f>=c&&f--,g>=c&&g--)}),this},has:function(a){return a?n.inArray(a,h)>-1:!(!h||!h.length)},empty:function(){return h=[],f=0,this},disable:function(){return h=i=b=void 0,this},disabled:function(){return!h},lock:function(){return i=void 0,b||k.disable(),this},locked:function(){return!i},fireWith:function(a,b){return!h||c&&!i||(b=b||[],b=[a,b.slice?b.slice():b],d?i.push(b):j(b)),this},fire:function(){return k.fireWith(this,arguments),this},fired:function(){return!!c}};return k},n.extend({Deferred:function(a){var b=[["resolve","done",n.Callbacks("once memory"),"resolved"],["reject","fail",n.Callbacks("once memory"),"rejected"],["notify","progress",n.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return n.Deferred(function(c){n.each(b,function(b,f){var g=n.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&n.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?n.extend(a,d):d}},e={};return d.pipe=d.then,n.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=d.call(arguments),e=c.length,f=1!==e||a&&n.isFunction(a.promise)?e:0,g=1===f?a:n.Deferred(),h=function(a,b,c){return function(e){b[a]=this,c[a]=arguments.length>1?d.call(arguments):e,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(e>1)for(i=new Array(e),j=new Array(e),k=new Array(e);e>b;b++)c[b]&&n.isFunction(c[b].promise)?c[b].promise().done(h(b,k,c)).fail(g.reject).progress(h(b,j,i)):--f;return f||g.resolveWith(k,c),g.promise()}});var H;n.fn.ready=function(a){return n.ready.promise().done(a),this},n.extend({isReady:!1,readyWait:1,holdReady:function(a){a?n.readyWait++:n.ready(!0)},ready:function(a){(a===!0?--n.readyWait:n.isReady)||(n.isReady=!0,a!==!0&&--n.readyWait>0||(H.resolveWith(l,[n]),n.fn.triggerHandler&&(n(l).triggerHandler("ready"),n(l).off("ready"))))}});function I(){l.removeEventListener("DOMContentLoaded",I,!1),a.removeEventListener("load",I,!1),n.ready()}n.ready.promise=function(b){return H||(H=n.Deferred(),"complete"===l.readyState?setTimeout(n.ready):(l.addEventListener("DOMContentLoaded",I,!1),a.addEventListener("load",I,!1))),H.promise(b)},n.ready.promise();var J=n.access=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===n.type(c)){e=!0;for(h in c)n.access(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,n.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(n(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f};n.acceptData=function(a){return 1===a.nodeType||9===a.nodeType||!+a.nodeType};function K(){Object.defineProperty(this.cache={},0,{get:function(){return{}}}),this.expando=n.expando+Math.random()}K.uid=1,K.accepts=n.acceptData,K.prototype={key:function(a){if(!K.accepts(a))return 0;var b={},c=a[this.expando];if(!c){c=K.uid++;try{b[this.expando]={value:c},Object.defineProperties(a,b)}catch(d){b[this.expando]=c,n.extend(a,b)}}return this.cache[c]||(this.cache[c]={}),c},set:function(a,b,c){var d,e=this.key(a),f=this.cache[e];if("string"==typeof b)f[b]=c;else if(n.isEmptyObject(f))n.extend(this.cache[e],b);else for(d in b)f[d]=b[d];return f},get:function(a,b){var c=this.cache[this.key(a)];return void 0===b?c:c[b]},access:function(a,b,c){var d;return void 0===b||b&&"string"==typeof b&&void 0===c?(d=this.get(a,b),void 0!==d?d:this.get(a,n.camelCase(b))):(this.set(a,b,c),void 0!==c?c:b)},remove:function(a,b){var c,d,e,f=this.key(a),g=this.cache[f];if(void 0===b)this.cache[f]={};else{n.isArray(b)?d=b.concat(b.map(n.camelCase)):(e=n.camelCase(b),b in g?d=[b,e]:(d=e,d=d in g?[d]:d.match(E)||[])),c=d.length;while(c--)delete g[d[c]]}},hasData:function(a){return!n.isEmptyObject(this.cache[a[this.expando]]||{})},discard:function(a){a[this.expando]&&delete this.cache[a[this.expando]]}};var L=new K,M=new K,N=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,O=/([A-Z])/g;function P(a,b,c){var d;if(void 0===c&&1===a.nodeType)if(d="data-"+b.replace(O,"-$1").toLowerCase(),c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:N.test(c)?n.parseJSON(c):c}catch(e){}M.set(a,b,c)}else c=void 0;return c}n.extend({hasData:function(a){return M.hasData(a)||L.hasData(a)},data:function(a,b,c){return M.access(a,b,c)},removeData:function(a,b){M.remove(a,b)
},_data:function(a,b,c){return L.access(a,b,c)},_removeData:function(a,b){L.remove(a,b)}}),n.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=M.get(f),1===f.nodeType&&!L.get(f,"hasDataAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=n.camelCase(d.slice(5)),P(f,d,e[d])));L.set(f,"hasDataAttrs",!0)}return e}return"object"==typeof a?this.each(function(){M.set(this,a)}):J(this,function(b){var c,d=n.camelCase(a);if(f&&void 0===b){if(c=M.get(f,a),void 0!==c)return c;if(c=M.get(f,d),void 0!==c)return c;if(c=P(f,d,void 0),void 0!==c)return c}else this.each(function(){var c=M.get(this,d);M.set(this,d,b),-1!==a.indexOf("-")&&void 0!==c&&M.set(this,a,b)})},null,b,arguments.length>1,null,!0)},removeData:function(a){return this.each(function(){M.remove(this,a)})}}),n.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=L.get(a,b),c&&(!d||n.isArray(c)?d=L.access(a,b,n.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=n.queue(a,b),d=c.length,e=c.shift(),f=n._queueHooks(a,b),g=function(){n.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return L.get(a,c)||L.access(a,c,{empty:n.Callbacks("once memory").add(function(){L.remove(a,[b+"queue",c])})})}}),n.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length<c?n.queue(this[0],a):void 0===b?this:this.each(function(){var c=n.queue(this,a,b);n._queueHooks(this,a),"fx"===a&&"inprogress"!==c[0]&&n.dequeue(this,a)})},dequeue:function(a){return this.each(function(){n.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,d=1,e=n.Deferred(),f=this,g=this.length,h=function(){--d||e.resolveWith(f,[f])};"string"!=typeof a&&(b=a,a=void 0),a=a||"fx";while(g--)c=L.get(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}});var Q=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,R=["Top","Right","Bottom","Left"],S=function(a,b){return a=b||a,"none"===n.css(a,"display")||!n.contains(a.ownerDocument,a)},T=/^(?:checkbox|radio)$/i;!function(){var a=l.createDocumentFragment(),b=a.appendChild(l.createElement("div")),c=l.createElement("input");c.setAttribute("type","radio"),c.setAttribute("checked","checked"),c.setAttribute("name","t"),b.appendChild(c),k.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,b.innerHTML="<textarea>x</textarea>",k.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var U="undefined";k.focusinBubbles="onfocusin"in a;var V=/^key/,W=/^(?:mouse|pointer|contextmenu)|click/,X=/^(?:focusinfocus|focusoutblur)$/,Y=/^([^.]*)(?:\.(.+)|)$/;function Z(){return!0}function $(){return!1}function _(){try{return l.activeElement}catch(a){}}n.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=L.get(a);if(r){c.handler&&(f=c,c=f.handler,e=f.selector),c.guid||(c.guid=n.guid++),(i=r.events)||(i=r.events={}),(g=r.handle)||(g=r.handle=function(b){return typeof n!==U&&n.event.triggered!==b.type?n.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(E)||[""],j=b.length;while(j--)h=Y.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o&&(l=n.event.special[o]||{},o=(e?l.delegateType:l.bindType)||o,l=n.event.special[o]||{},k=n.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&n.expr.match.needsContext.test(e),namespace:p.join(".")},f),(m=i[o])||(m=i[o]=[],m.delegateCount=0,l.setup&&l.setup.call(a,d,p,g)!==!1||a.addEventListener&&a.addEventListener(o,g,!1)),l.add&&(l.add.call(a,k),k.handler.guid||(k.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,k):m.push(k),n.event.global[o]=!0)}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=L.hasData(a)&&L.get(a);if(r&&(i=r.events)){b=(b||"").match(E)||[""],j=b.length;while(j--)if(h=Y.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=n.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,m=i[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;while(f--)k=m[f],!e&&q!==k.origType||c&&c.guid!==k.guid||h&&!h.test(k.namespace)||d&&d!==k.selector&&("**"!==d||!k.selector)||(m.splice(f,1),k.selector&&m.delegateCount--,l.remove&&l.remove.call(a,k));g&&!m.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||n.removeEvent(a,o,r.handle),delete i[o])}else for(o in i)n.event.remove(a,o+b[j],c,d,!0);n.isEmptyObject(i)&&(delete r.handle,L.remove(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,k,m,o,p=[d||l],q=j.call(b,"type")?b.type:b,r=j.call(b,"namespace")?b.namespace.split("."):[];if(g=h=d=d||l,3!==d.nodeType&&8!==d.nodeType&&!X.test(q+n.event.triggered)&&(q.indexOf(".")>=0&&(r=q.split("."),q=r.shift(),r.sort()),k=q.indexOf(":")<0&&"on"+q,b=b[n.expando]?b:new n.Event(q,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=r.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+r.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:n.makeArray(c,[b]),o=n.event.special[q]||{},e||!o.trigger||o.trigger.apply(d,c)!==!1)){if(!e&&!o.noBubble&&!n.isWindow(d)){for(i=o.delegateType||q,X.test(i+q)||(g=g.parentNode);g;g=g.parentNode)p.push(g),h=g;h===(d.ownerDocument||l)&&p.push(h.defaultView||h.parentWindow||a)}f=0;while((g=p[f++])&&!b.isPropagationStopped())b.type=f>1?i:o.bindType||q,m=(L.get(g,"events")||{})[b.type]&&L.get(g,"handle"),m&&m.apply(g,c),m=k&&g[k],m&&m.apply&&n.acceptData(g)&&(b.result=m.apply(g,c),b.result===!1&&b.preventDefault());return b.type=q,e||b.isDefaultPrevented()||o._default&&o._default.apply(p.pop(),c)!==!1||!n.acceptData(d)||k&&n.isFunction(d[q])&&!n.isWindow(d)&&(h=d[k],h&&(d[k]=null),n.event.triggered=q,d[q](),n.event.triggered=void 0,h&&(d[k]=h)),b.result}},dispatch:function(a){a=n.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(L.get(this,"events")||{})[a.type]||[],k=n.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=n.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,c=0;while((g=f.handlers[c++])&&!a.isImmediatePropagationStopped())(!a.namespace_re||a.namespace_re.test(g.namespace))&&(a.handleObj=g,a.data=g.data,e=((n.event.special[g.or