', {
- class: 'image-picker-thumbnail',
- 'data-value': options[i].value,
- 'data-text': options[i].text
- }).css({
- 'background-image': 'url(' + options[i].value + ')'
- }).appendTo(container);
- }
- $this.before(container);
- $this.hide();
- });
-
- $('.image-picker-confirm').click(function() {
- $(this).data('target').val($(this).parent().find('.image-picker-thumbnail.selected').data('text'));
- });
-
- $('.image-picker-thumbnail').click(function() {
- $(this).siblings().removeClass('selected');
- $(this).addClass('selected');
- $(this).parent().siblings('.image-input').val($(this).data('value'));
- });
- });
-})();
-
-var Modal = (function() {
- $(function() {
- $('.modal [data-dismiss]').click(function() {
- if ($(this).is('[data-validate]')) {
- var valid = Modal.validate($(this).data('dismiss'));
- if (!valid) return;
- }
- Modal.hide($(this).data('dismiss'));
- });
- $('.modal').click(function(event) {
- if (event.target === this) Modal.hide();
- });
- });
-
- return {
- show: function (id, action, callback) {
- var $modal = $('#' + id);
- $modal.addClass('show');
- if (action !== null) {
- $modal.find('form').attr('action', action);
- }
- $modal.find('[autofocus]').first().focus(); // Firefox bug
- if (typeof callback === 'function') callback($modal);
- this.createBackdrop();
- },
- hide: function(id) {
- var $modal = id === undefined ? $('.modal') : $('#' + id);
- $modal.removeClass('show');
- this.removeBackdrop();
- },
- createBackdrop: function() {
- if (!$('.modal-backdrop').length) {
- $('
', {
- class: 'modal-backdrop'
- }).appendTo('body');
- }
- },
- removeBackdrop: function() {
- $('.modal-backdrop').remove();
- },
- validate: function(id) {
- var valid = false;
- var $modal = $('#' + id);
- $modal.find('[required]').each(function() {
- if ($(this).val() === '') {
- $(this).addClass('animated shake');
- $(this).focus();
- $modal.find('.modal-error').show();
- valid = false;
- return false;
- }
- valid = true;
- });
- return valid;
- }
- };
-})();
-
-var Utils = (function() {
- return {
- debounce: function(callback, delay, leading) {
- var timer = null;
- var context;
- var args;
-
- function wrapper() {
- context = this;
- args = arguments;
-
- if (timer) clearTimeout(timer);
-
- if (leading && !timer) callback.apply(context, args);
-
- timer = setTimeout(function() {
- if (!leading) callback.apply(context, args);
- timer = null;
- }, delay);
- }
-
- return wrapper;
- },
- escapeRegExp: function(string) {
- return string.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
- },
- offset: function(element) {
- var rect = element.getBoundingClientRect();
- var doc = document.documentElement;
- var body = document.body;
-
- var XOffset = window.pageXOffset || doc.scrollLeft || body.scrollLeft;
- var YOffset = window.pageYOffset || doc.scrollTop || body.scrollTop;
-
- return {
- top: rect.top + YOffset,
- left: rect.left + XOffset
- };
- },
- slug: function(string) {
- var translate = {"\t": "", "\r": "", "!": "", "\"": "", "#": "", "$": "", "%": "", "'": "", "(": "", ")": "", "*": "", "+": "", ",": "", ".": "", ":": "", ";": "", "<": "", "=": "", ">": "", "?": "", "@": "", "[": "", "]": "", "^": "", "`": "", "{": "", "|": "", "}": "", "¡": "", "£": "", "¤": "", "¥": "", "¦": "", "§": "", "«": "", "°": "", "»": "", "‘": "", "’": "", "“": "", "”": "", "\n": "-", " ": "-", "-": "-", "–": "-", "—": "-", "\/": "-", "\\": "-", "_": "-", "~": "-", "À": "A", "Á": "A", "Â": "A", "Ã": "A", "Ä": "A", "Å": "A", "Æ": "Ae", "Ç": "C", "Ð": "D", "È": "E", "É": "E", "Ê": "E", "Ë": "E", "Ì": "I", "Í": "I", "Î": "I", "Ï": "I", "Ñ": "N", "Ò": "O", "Ó": "O", "Ô": "O", "Õ": "O", "Ö": "O", "Ø": "O", "Œ": "Oe", "Š": "S", "Þ": "Th", "Ù": "U", "Ú": "U", "Û": "U", "Ü": "U", "Ý": "Y", "à": "a", "á": "a", "â": "a", "ã": "a", "ä": "ae", "å": "a", "æ": "ae", "¢": "c", "ç": "c", "ð": "d", "è": "e", "é": "e", "ê": "e", "ë": "e", "ì": "i", "í": "i", "î": "i", "ï": "i", "ñ": "n", "ò": "o", "ó": "o", "ô": "o", "õ": "o", "ö": "oe", "ø": "o", "œ": "oe", "š": "s", "ß": "ss", "þ": "th", "ù": "u", "ú": "u", "û": "u", "ü": "ue", "ý": "y", "ÿ": "y", "Ÿ": "y"};
- var char;
- string = string.toLowerCase();
- for (char in translate) {
- string = string.split(char).join(translate[char]);
- }
- return string.replace(/[^a-z0-9-]/g, '').replace(/^-+|-+$/g, '').replace(/-+/g, '-');
- },
- throttle: function(callback, delay) {
- var timer = null;
- var context;
- var args;
-
- function wrapper() {
- context = this;
- args = arguments;
-
- if (timer) return;
-
- callback.apply(context, args);
-
- timer = setTimeout(function() {
- wrapper.apply(context, args);
- timer = null;
- }, delay);
- }
-
- return wrapper;
- },
- uriPrependBase: function(base, path) {
- var regexp = /^\/+|\/+$/im;
- base = base.replace(regexp, '').split('/');
- path = path.replace(regexp, '').split('/');
- for (i = 0; i < base.length; i++) {
- if (base[i] === path[0] && base[i + 1] !== path[0]) {
- base = base.slice(0, i);
- }
- }
- return '/' + base.concat(path).join('/') + '/';
- }
- };
-})();
diff --git a/admin/assets/js/app.min.js b/admin/assets/js/app.min.js
index 929f5a51..f42c9d85 100755
--- a/admin/assets/js/app.min.js
+++ b/admin/assets/js/app.min.js
@@ -1 +1 @@
-$(function(){$("[data-modal]").click(function(){var t=$(this),e=t.data("modal"),a=t.data("modal-action");a?Modal.show(e,a):Modal.show(e)}),$(".input-reset").click(function(){var t=$("#"+$(this).data("reset"));t.val(""),t.change()}),$("[data-auto-upload]").change(function(){$(this).closest("form").submit()}),$(".file-input-label").on("drag dragstart dragend dragover dragenter dragleave drop",function(t){t.preventDefault()}).on("drop",function(t){var e=$("#"+$(this).attr("for"));e.prop("files",t.originalEvent.dataTransfer.files),e.change()}).on("dragover dragenter",function(){$(this).addClass("drag")}).on("dragleave drop",function(){$(this).removeClass("drag")}),$("input:file").change(function(){var t=$(this).prop("files");t.length&&$('label[for="'+$(this).attr("id")+'"] span').text(t[0].name)}),$(".page-children-toggle").click(function(t){t.stopPropagation(),$(this).closest("li").children(".pages-list").toggle(),$(this).toggleClass("toggle-expanded toggle-collapsed")}),$(".page-details a").click(function(t){t.stopPropagation()}),$("#expand-all-pages").click(function(){$(this).blur(),$(".pages-children").show(),$(".pages-list").find(".page-children-toggle").removeClass("toggle-collapsed").addClass("toggle-expanded")}),$("#collapse-all-pages").click(function(){$(this).blur(),$(".pages-children").hide(),$(".pages-list").find(".page-children-toggle").removeClass("toggle-expanded").addClass("toggle-collapsed")}),$(".page-search").focus(function(){$(".pages-children").each(function(){$(this).data("visible",$(this).is(":visible"))})}),$(".page-search").keyup(Utils.debounce(function(){var t=$(this).val();if(0==t.length)$(".pages-children").each(function(){$(this).toggle($(this).data("visible"))}),$(".page-details").css("padding-left",""),$(".pages-item, .page-children-toggle").show();else{$(".pages-children").show(),$(".page-children-toggle").hide(),$(".page-details").css("padding-left","0");var a=new RegExp(Utils.escapeRegExp(t),"i");$(".page-title a").each(function(){var t=$(this).closest(".pages-item"),e=!!$(this).text().match(a);e&&0,t.toggle(e)})}},100)),$(".page-details").click(function(){var t=$(this).find(".page-children-toggle").first();t.length&&t.click()}),$("#page-title","#newPageModal").keyup(function(){$("#page-slug","#newPageModal").val(Utils.slug($(this).val()))}),$("#page-slug","#newPageModal").keyup(function(){$(this).val($(this).val().replace(" ","-").replace(/[^A-Za-z0-9\-]/g,""))}).blur(function(){""==$(this).val()&&$("#page-title","#newPageModal").trigger("keyup")}),$("#page-parent","#newPageModal").change(function(){var t=$(this).find("option:selected"),e=$("#page-template","#newPageModal"),a=t.data("allowed-templates");a?(a=a.split(", "),e.data("previous-value",e.val()).val(a[0]).find("option").each(function(){-1==a.indexOf($(this).val())&&$(this).attr("disabled",!0)})):e.find("option[disabled]").length&&e.val(e.data("previous-value")).removeData("previous-value").find("option").removeAttr("disabled")}),$(document).keyup(function(t){27==t.which&&Modal.hide()}).keydown(function(t){if((t.ctrlKey||t.metaKey)&&70==t.which&&$(".page-search:not(:focus)").length)return $(".page-search").focus(),!1}),$(".tabs-tab[data-tab]").click(function(){$(this).addClass("active").siblings().removeClass("active")}),$(".tag-input").tagInput(),$("input[data-enable]").change(function(){var a=$(this).is(":checked");$.each($(this).data("enable").split(","),function(t,e){$('input[name="'+e+'"]').attr("disabled",!a)})}),$(".toggle-navigation").click(function(){$(".sidebar").toggleClass("show")}),$(".overflow-title").mouseover(function(){var t=$(this);t.prop("offsetWidth")
":("\n"===t?"\n":"\n\n")+"> ","")}),$("[data-command=link]",e).click(function(){var t=textarea.selectionStart,e=textarea.selectionEnd,a=t===e?"":textarea.value.substring(t,e),n=textarea.value.substring(0,t),i=textarea.value.substring(e,textarea.value.length);/^(https?:\/\/|mailto:)/i.test(a)?(textarea.value=n+"[]("+a+")"+i,textarea.focus(),textarea.setSelectionRange(t+1,t+1)):""!==a?(textarea.value=n+"["+a+"](http://)"+i,textarea.focus(),textarea.setSelectionRange(t+a.length+10,t+a.length+10)):s(textarea,"[","](http://)")}),$("[data-command=image]",e).click(function(){var t=o(textarea),e="\n\n";"\n"===t?e="\n":void 0===t&&(e=""),s(textarea,e+"")}),$("[data-command=summary]",e).click(function(){var t=o(textarea);a()||(console.log(t),s(textarea,(void 0===t||"\n"===t?"":"\n")+"\n===\n\n",""),$(this).attr("disabled",!0))})},Form=function(t){var e=$(t),a=function(){return e.serialize()!=e.data("original-data")};return e.data("original-data",e.serialize()),$(window).on("beforeunload",function(){if(a())return!0}),e.submit(function(){$(window).off("beforeunload")}),$('a[href]:not([href^="#"]):not([target="_blank"])').click(function(t){if(a()){var e=this;t.preventDefault(),Modal.show("changesModal",null,function(t){t.find(".button-continue").click(function(){$(window).off("beforeunload"),window.location.href=$(this).data("href")}).attr("data-href",e.href)})}}),{hasChanged:a}},Notification=function(t,e,a){var n=!1;if(0<$(".notification").length){var i=$(".notification:last");n=i.offset().top+i.outerHeight(!0)}var o=$("",{class:"notification"}).text(t).appendTo("body");n&&o.css("top",n),e&&o.addClass("notification-"+e),setTimeout(function(){offset=o.outerHeight(!0),$(".notification").each(function(){var t=$(this);t.is(o)?t.addClass("fadeout"):t.css("top","-="+offset)}),setTimeout(function(){o.remove()},400)},a)},Request=function(t,e){var a=$.ajax(t);return"function"==typeof e&&a.always(function(){var t=a.responseJSON||{};403==(t.code||a.status)?location.reload():e(t,a)}),a},Tooltip=function(t,e,s){var a={container:document.body,position:"top",offset:{x:0,y:0},delay:500};s=$.extend({},a,s);var n,r=$(t);function i(){n=setTimeout(function(){var t=$('
');t.appendTo(s.container),t.text(e),t.css(function(t){var e=Utils.offset(r[0]),a=e.top,n=e.left,i=(r.outerWidth()-t.outerWidth())/2,o=(r.outerHeight()-t.outerHeight())/2;switch(s.position){case"top":return{top:Math.round(a-t.outerHeight()+s.offset.y),left:Math.round(n+i+s.offset.x)};case"right":return{top:Math.round(a+o+s.offset.y),left:Math.round(n+r.outerWidth()+s.offset.x)};case"bottom":return{top:Math.round(a+r.outerHeight()+s.offset.y),left:Math.round(n+i+s.offset.x)};case"left":return{top:Math.round(a+o+s.offset.y),left:Math.round(n-t.outerWidth()+s.offset.x)}}}(t)).fadeIn(200)},s.delay)}return r.on("mouseout",function(){clearTimeout(n),$(".tooltip").fadeOut(100,function(){$(this).remove()})}),i(),{show:i}};!function(f){f.fn.datePicker=function(u){var i,o,t=new Date,s={year:t.getFullYear(),month:t.getMonth(),day:t.getDate(),setDate:function(t){this.year=t.getFullYear(),this.month=t.getMonth(),this.day=t.getDate()},lastDay:function(){this.day=h.daysInMonth(this.month,this.year)},prevYear:function(){this.year--},nextYear:function(){this.year++},prevMonth:function(){this.month=h.mod(this.month-1,12),11==this.month&&this.prevYear(),this.day>h.daysInMonth(this.month,this.year)&&this.lastDay()},nextMonth:function(){this.month=h.mod(this.month+1,12),0==this.month&&this.nextYear(),this.day>h.daysInMonth(this.month,this.year)&&this.lastDay()},prevWeek:function(){this.day-=7,this.day<1&&(this.prevMonth(),this.day+=h.daysInMonth(this.month,this.year))},nextWeek:function(){this.day+=7,this.day>h.daysInMonth(this.month,this.year)&&(this.day-=h.daysInMonth(this.month,this.year),this.nextMonth())},prevDay:function(){this.day--,this.day<1&&(this.prevMonth(),this.lastDay())},nextDay:function(){this.day++,this.day>h.daysInMonth(this.month,this.year)&&(this.nextMonth(),this.day=1)}},h={_daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],mod:function(t,e){return(t%e+e)%e},pad:function(t){return 1==t.toString().length?"0"+t:t},isValidDate:function(t){return t&&!isNaN(Date.parse(t))},isLeapYear:function(t){return t%4==0&&t%100!=0||t%400==0},daysInMonth:function(t,e){return 1==t&&this.isLeapYear(e)?29:this._daysInMonth[t]},formatDateTime:function(t){var e=u.format,a=t.getFullYear(),n=t.getMonth()+1,i=t.getDate(),o=t.getHours(),s=t.getMinutes(),r=t.getSeconds(),l=o<12;return-1
';l+='
",l+="";for(var c=0;c<7;c++)l+='";l+="
";for(c=0;c<6;c++){for(var d=0;d<7;d++)n<=o&&(0':'',l+=n++):1==n?(l+=' | ',l+=h.daysInMonth(h.mod(e-1,12),t)-r+d+1):(l+=' | ',l+=n++-o),l+=" | ";l+="
"}l+="
",f(".calendar-table").replaceWith(l)}function a(){i&&o.is(":visible")&&(o.css({top:i.offset().top+i.outerHeight(),left:i.offset().left}),o.offset().left+o.outerWidth(!0)>f(window).width()&&o.css("left",f(window).width()-o.outerWidth(!0)),f(window).scrollTop()+f(window).height()').appendTo("body"),f(".currentMonth").click(function(){var t=new Date;s.setDate(t),r(),i.blur()}),f(".prevMonth").longclick(function(){s.prevMonth(),e(s.year,s.month)},750,500),f(".nextMonth").longclick(function(){s.nextMonth(),e(s.year,s.month)},750,500),f(".prevMonth, .currentMonth, .nextMonth").mousedown(function(){return!1}),o.on("mousedown",".calendar-day",!1),o.on("click",".calendar-day",function(){var t=new Date(s.year,s.month,parseInt(f(this).text()));i.data("date",t),i.val(h.formatDateTime(t)),i.blur()}),f(".date-input").blur(function(){o.hide()}),f(".date-input").focus(function(){i=f(this);var t=h.isValidDate(i.data("date"))?new Date(i.data("date")):new Date;s.setDate(t),e(s.year,s.month,s.day),o.show(),a()}),f(window).on("touchstart",function(){var t=f(event.target);t.is(".date-input")||t.parents(".calendar, .date-input").length||i.blur()}),f(window).on("resize",Utils.throttle(a,100))},f.fn.datePicker.defaults={dayLabels:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],monthLabels:["January","February","March","April","May","June","July","August","September","October","November","December"],weekStarts:0,todayLabel:"Today",format:"YYYY-MM-DD"}}(jQuery),function(t){t.fn.longclick=function(e,a,n){var i;function o(){clearTimeout(i)}t(window).mouseup(o),t(this).mousedown(function(t){1!=t.which?o():(e(),i=window.setTimeout(function(){i=window.setInterval(e,n||250)},a||500))}).mouseout(o)}}(jQuery),function(r){r.fn.tagInput=function(){function i(t){var e=t.parent();e.find(".tag-hidden-input").val(e.data("tags").join(", "))}function o(t,e){t.before('\n'+e+'')}function n(t,e){-1==t.parent().data("tags").indexOf(e)&&(t.parent().data("tags").push(e),o(t,e),i(t)),t.val("")}function s(t,e){var a=t.parent().data("tags"),n=a.indexOf(e);-1",{class:"image-picker-thumbnails"}),n=0;n",{class:"image-picker-thumbnail","data-value":e[n].value,"data-text":e[n].text}).css({"background-image":"url("+e[n].value+")"}).appendTo(a);t.before(a),t.hide()}),$(".image-picker-confirm").click(function(){$(this).data("target").val($(this).parent().find(".image-picker-thumbnail.selected").data("text"))}),$(".image-picker-thumbnail").click(function(){$(this).siblings().removeClass("selected"),$(this).addClass("selected"),$(this).parent().siblings(".image-input").val($(this).data("value"))})}),Modal=($(function(){$(".modal [data-dismiss]").click(function(){$(this).is("[data-validate]")&&!Modal.validate($(this).data("dismiss"))||Modal.hide($(this).data("dismiss"))}),$(".modal").click(function(t){t.target===this&&Modal.hide()})}),{show:function(t,e,a){var n=$("#"+t);n.addClass("show"),null!==e&&n.find("form").attr("action",e),n.find("[autofocus]").first().focus(),"function"==typeof a&&a(n),this.createBackdrop()},hide:function(t){(void 0===t?$(".modal"):$("#"+t)).removeClass("show"),this.removeBackdrop()},createBackdrop:function(){$(".modal-backdrop").length||$("",{class:"modal-backdrop"}).appendTo("body")},removeBackdrop:function(){$(".modal-backdrop").remove()},validate:function(t){var e=!1,a=$("#"+t);return a.find("[required]").each(function(){if(""===$(this).val())return $(this).addClass("animated shake"),$(this).focus(),a.find(".modal-error").show(),e=!1;e=!0}),e}}),Utils={debounce:function(t,e,a){var n,i,o=null;return function(){n=this,i=arguments,o&&clearTimeout(o),a&&!o&&t.apply(n,i),o=setTimeout(function(){a||t.apply(n,i),o=null},e)}},escapeRegExp:function(t){return t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},offset:function(t){var e=t.getBoundingClientRect(),a=document.documentElement,n=document.body,i=window.pageXOffset||a.scrollLeft||n.scrollLeft,o=window.pageYOffset||a.scrollTop||n.scrollTop;return{top:e.top+o,left:e.left+i}},slug:function(t){var e,a={"\t":"","\r":"","!":"",'"':"","#":"",$:"","%":"","'":"","(":"",")":"","*":"","+":"",",":"",".":"",":":"",";":"","<":"","=":"",">":"","?":"","@":"","[":"","]":"","^":"","`":"","{":"","|":"","}":"","¡":"","£":"","¤":"","¥":"","¦":"","§":"","«":"","°":"","»":"","‘":"","’":"","“":"","”":"","\n":"-"," ":"-","-":"-","–":"-","—":"-","/":"-","\\":"-",_:"-","~":"-","À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","Æ":"Ae","Ç":"C","Ð":"D","È":"E","É":"E","Ê":"E","Ë":"E","Ì":"I","Í":"I","Î":"I","Ï":"I","Ñ":"N","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","Œ":"Oe","Š":"S","Þ":"Th","Ù":"U","Ú":"U","Û":"U","Ü":"U","Ý":"Y","à":"a","á":"a","â":"a","ã":"a","ä":"ae","å":"a","æ":"ae","¢":"c","ç":"c","ð":"d","è":"e","é":"e","ê":"e","ë":"e","ì":"i","í":"i","î":"i","ï":"i","ñ":"n","ò":"o","ó":"o","ô":"o","õ":"o","ö":"oe","ø":"o","œ":"oe","š":"s","ß":"ss","þ":"th","ù":"u","ú":"u","û":"u","ü":"ue","ý":"y","ÿ":"y","Ÿ":"y"};for(e in t=t.toLowerCase(),a)t=t.split(e).join(a[e]);return t.replace(/[^a-z0-9-]/g,"").replace(/^-+|-+$/g,"").replace(/-+/g,"-")},throttle:function(e,a){var n,i,o=null;return function t(){n=this,i=arguments,o||(e.apply(n,i),o=setTimeout(function(){t.apply(n,i),o=null},a))}},uriPrependBase:function(t,e){var a=/^\/+|\/+$/im;for(t=t.replace(a,"").split("/"),e=e.replace(a,"").split("/"),i=0;i
":("\n"===t?"\n":"\n\n")+"> ","")}),$("[data-command=link]",e).click(function(){var t=textarea.selectionStart,e=textarea.selectionEnd,a=t===e?"":textarea.value.substring(t,e),n=textarea.value.substring(0,t),i=textarea.value.substring(e,textarea.value.length);/^(https?:\/\/|mailto:)/i.test(a)?(textarea.value=n+"[]("+a+")"+i,textarea.focus(),textarea.setSelectionRange(t+1,t+1)):""!==a?(textarea.value=n+"["+a+"](http://)"+i,textarea.focus(),textarea.setSelectionRange(t+a.length+10,t+a.length+10)):s(textarea,"[","](http://)")}),$("[data-command=image]",e).click(function(){var t=o(textarea),e="\n\n";"\n"===t?e="\n":void 0===t&&(e=""),s(textarea,e+"")}),$("[data-command=summary]",e).click(function(){var t=o(textarea);a()||(console.log(t),s(textarea,(void 0===t||"\n"===t?"":"\n")+"\n===\n\n",""),$(this).attr("disabled",!0))})},Form=function(t){var e=$(t),a=function(){return e.serialize()!=e.data("original-data")};return e.data("original-data",e.serialize()),$(window).on("beforeunload",function(){if(a())return!0}),e.submit(function(){$(window).off("beforeunload")}),$('a[href]:not([href^="#"]):not([target="_blank"])').click(function(t){if(a()){var e=this;t.preventDefault(),Modal.show("changesModal",null,function(t){t.find(".button-continue").click(function(){$(window).off("beforeunload"),window.location.href=$(this).data("href")}).attr("data-href",e.href)})}}),{hasChanged:a}},Notification=function(t,e,a){var n=!1;if(0<$(".notification").length){var i=$(".notification:last");n=i.offset().top+i.outerHeight(!0)}var o=$("",{class:"notification"}).text(t).appendTo("body");n&&o.css("top",n),e&&o.addClass("notification-"+e),setTimeout(function(){offset=o.outerHeight(!0),$(".notification").each(function(){var t=$(this);t.is(o)?t.addClass("fadeout"):t.css("top","-="+offset)}),setTimeout(function(){o.remove()},400)},a)},Request=function(t,e){var a=$.ajax(t);return"function"==typeof e&&a.always(function(){var t=a.responseJSON||{};403==(t.code||a.status)?location.reload():e(t,a)}),a},Tooltip=function(t,e,s){var a={container:document.body,position:"top",offset:{x:0,y:0},delay:500};s=$.extend({},a,s);var n,r=$(t);function i(){n=setTimeout(function(){var t=$('
');t.appendTo(s.container),t.text(e),t.css(function(t){var e=Utils.offset(r[0]),a=e.top,n=e.left,i=(r.outerWidth()-t.outerWidth())/2,o=(r.outerHeight()-t.outerHeight())/2;switch(s.position){case"top":return{top:Math.round(a-t.outerHeight()+s.offset.y),left:Math.round(n+i+s.offset.x)};case"right":return{top:Math.round(a+o+s.offset.y),left:Math.round(n+r.outerWidth()+s.offset.x)};case"bottom":return{top:Math.round(a+r.outerHeight()+s.offset.y),left:Math.round(n+i+s.offset.x)};case"left":return{top:Math.round(a+o+s.offset.y),left:Math.round(n-t.outerWidth()+s.offset.x)}}}(t)).fadeIn(200)},s.delay)}return r.on("mouseout",function(){clearTimeout(n),$(".tooltip").fadeOut(100,function(){$(this).remove()})}),i(),{show:i}},Chart=function(t,e){new Chartist.Line(t,e,{showArea:!0,fullWidth:!0,scaleMinSpace:20,divisor:5,chartPadding:20,lineSmooth:!1,low:0,axisX:{showGrid:!1,labelOffset:{x:0,y:10}},axisY:{onlyInteger:!0,offset:15,labelOffset:{x:0,y:5}}})};$(function(){$("[data-chart-data]").each(function(){new Chart(this,$(this).data("chart-data"))}),$(".ct-chart").on("mouseover",".ct-point",function(){new Tooltip($(this),$(this).attr("ct:value"),{offset:{x:0,y:-8}})})});var ImagePicker=void $(function(){$(".image-input").click(function(){var e=$(this),a=e.val();Modal.show("imagesModal",null,function(t){t.find(".image-picker-confirm").data("target",e),t.find(".image-picker-thumbnail").each(function(){if($(this).data("text")==a)return $(this).addClass("selected"),!1})})}),$(".image-picker").each(function(){for(var t=$(this),e=t.children("option"),a=$("
",{class:"image-picker-thumbnails"}),n=0;n
",{class:"image-picker-thumbnail","data-value":e[n].value,"data-text":e[n].text}).css({"background-image":"url("+e[n].value+")"}).appendTo(a);t.before(a),t.hide()}),$(".image-picker-confirm").click(function(){$(this).data("target").val($(this).parent().find(".image-picker-thumbnail.selected").data("text"))}),$(".image-picker-thumbnail").click(function(){$(this).siblings().removeClass("selected"),$(this).addClass("selected"),$(this).parent().siblings(".image-input").val($(this).data("value"))})}),Modal=($(function(){$(".modal [data-dismiss]").click(function(){$(this).is("[data-validate]")&&!Modal.validate($(this).data("dismiss"))||Modal.hide($(this).data("dismiss"))}),$(".modal").click(function(t){t.target===this&&Modal.hide()})}),{show:function(t,e,a){var n=$("#"+t);n.addClass("show"),null!==e&&n.find("form").attr("action",e),n.find("[autofocus]").first().focus(),"function"==typeof a&&a(n),this.createBackdrop()},hide:function(t){(void 0===t?$(".modal"):$("#"+t)).removeClass("show"),this.removeBackdrop()},createBackdrop:function(){$(".modal-backdrop").length||$("",{class:"modal-backdrop"}).appendTo("body")},removeBackdrop:function(){$(".modal-backdrop").remove()},validate:function(t){var e=!1,a=$("#"+t);return a.find("[required]").each(function(){if(""===$(this).val())return $(this).addClass("animated shake"),$(this).focus(),a.find(".modal-error").show(),e=!1;e=!0}),e}}),Utils={debounce:function(t,e,a){var n,i,o=null;return function(){n=this,i=arguments,o&&clearTimeout(o),a&&!o&&t.apply(n,i),o=setTimeout(function(){a||t.apply(n,i),o=null},e)}},escapeRegExp:function(t){return t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},offset:function(t){var e=t.getBoundingClientRect(),a=document.documentElement,n=document.body,i=window.pageXOffset||a.scrollLeft||n.scrollLeft,o=window.pageYOffset||a.scrollTop||n.scrollTop;return{top:e.top+o,left:e.left+i}},slug:function(t){var e,a={"\t":"","\r":"","!":"",'"':"","#":"",$:"","%":"","'":"","(":"",")":"","*":"","+":"",",":"",".":"",":":"",";":"","<":"","=":"",">":"","?":"","@":"","[":"","]":"","^":"","`":"","{":"","|":"","}":"","¡":"","£":"","¤":"","¥":"","¦":"","§":"","«":"","°":"","»":"","‘":"","’":"","“":"","”":"","\n":"-"," ":"-","-":"-","–":"-","—":"-","/":"-","\\":"-",_:"-","~":"-","À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","Æ":"Ae","Ç":"C","Ð":"D","È":"E","É":"E","Ê":"E","Ë":"E","Ì":"I","Í":"I","Î":"I","Ï":"I","Ñ":"N","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","Œ":"Oe","Š":"S","Þ":"Th","Ù":"U","Ú":"U","Û":"U","Ü":"U","Ý":"Y","à":"a","á":"a","â":"a","ã":"a","ä":"ae","å":"a","æ":"ae","¢":"c","ç":"c","ð":"d","è":"e","é":"e","ê":"e","ë":"e","ì":"i","í":"i","î":"i","ï":"i","ñ":"n","ò":"o","ó":"o","ô":"o","õ":"o","ö":"oe","ø":"o","œ":"oe","š":"s","ß":"ss","þ":"th","ù":"u","ú":"u","û":"u","ü":"ue","ý":"y","ÿ":"y","Ÿ":"y"};for(e in t=t.toLowerCase(),a)t=t.split(e).join(a[e]);return t.replace(/[^a-z0-9-]/g,"").replace(/^-+|-+$/g,"").replace(/-+/g,"-")},throttle:function(e,a){var n,i,o=null;return function t(){n=this,i=arguments,o||(e.apply(n,i),o=setTimeout(function(){t.apply(n,i),o=null},a))}},uriPrependBase:function(t,e){var a=/^\/+|\/+$/im;for(t=t.replace(a,"").split("/"),e=e.replace(a,"").split("/"),i=0;i
h.daysInMonth(this.month,this.year)&&this.lastDay()},nextMonth:function(){this.month=h.mod(this.month+1,12),0==this.month&&this.nextYear(),this.day>h.daysInMonth(this.month,this.year)&&this.lastDay()},prevWeek:function(){this.day-=7,this.day<1&&(this.prevMonth(),this.day+=h.daysInMonth(this.month,this.year))},nextWeek:function(){this.day+=7,this.day>h.daysInMonth(this.month,this.year)&&(this.day-=h.daysInMonth(this.month,this.year),this.nextMonth())},prevDay:function(){this.day--,this.day<1&&(this.prevMonth(),this.lastDay())},nextDay:function(){this.day++,this.day>h.daysInMonth(this.month,this.year)&&(this.nextMonth(),this.day=1)}},h={_daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],mod:function(t,e){return(t%e+e)%e},pad:function(t){return 1==t.toString().length?"0"+t:t},isValidDate:function(t){return t&&!isNaN(Date.parse(t))},isLeapYear:function(t){return t%4==0&&t%100!=0||t%400==0},daysInMonth:function(t,e){return 1==t&&this.isLeapYear(e)?29:this._daysInMonth[t]},formatDateTime:function(t){var e=u.format,a=t.getFullYear(),n=t.getMonth()+1,i=t.getDate(),o=t.getHours(),s=t.getMinutes(),r=t.getSeconds(),l=o<12;return-1';l+='
",l+="";for(var c=0;c<7;c++)l+='";l+="
";for(c=0;c<6;c++){for(var d=0;d<7;d++)n<=o&&(0':'',l+=n++):1==n?(l+=' | ',l+=h.daysInMonth(h.mod(e-1,12),t)-r+d+1):(l+=' | ',l+=n++-o),l+=" | ";l+="
"}l+="
",f(".calendar-table").replaceWith(l)}function a(){i&&o.is(":visible")&&(o.css({top:i.offset().top+i.outerHeight(),left:i.offset().left}),o.offset().left+o.outerWidth(!0)>f(window).width()&&o.css("left",f(window).width()-o.outerWidth(!0)),f(window).scrollTop()+f(window).height()').appendTo("body"),f(".currentMonth").click(function(){var t=new Date;s.setDate(t),r(),i.blur()}),f(".prevMonth").longclick(function(){s.prevMonth(),e(s.year,s.month)},750,500),f(".nextMonth").longclick(function(){s.nextMonth(),e(s.year,s.month)},750,500),f(".prevMonth, .currentMonth, .nextMonth").mousedown(function(){return!1}),o.on("mousedown",".calendar-day",!1),o.on("click",".calendar-day",function(){var t=new Date(s.year,s.month,parseInt(f(this).text()));i.data("date",t),i.val(h.formatDateTime(t)),i.blur()}),f(".date-input").blur(function(){o.hide()}),f(".date-input").focus(function(){i=f(this);var t=h.isValidDate(i.data("date"))?new Date(i.data("date")):new Date;s.setDate(t),e(s.year,s.month,s.day),o.show(),a()}),f(window).on("touchstart",function(){var t=f(event.target);t.is(".date-input")||t.parents(".calendar, .date-input").length||i.blur()}),f(window).on("resize",Utils.throttle(a,100))},f.fn.datePicker.defaults={dayLabels:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],monthLabels:["January","February","March","April","May","June","July","August","September","October","November","December"],weekStarts:0,todayLabel:"Today",format:"YYYY-MM-DD"}}(jQuery),function(t){t.fn.longclick=function(e,a,n){var i;function o(){clearTimeout(i)}t(window).mouseup(o),t(this).mousedown(function(t){1!=t.which?o():(e(),i=window.setTimeout(function(){i=window.setInterval(e,n||250)},a||500))}).mouseout(o)}}(jQuery),function(r){r.fn.tagInput=function(){function i(t){var e=t.parent();e.find(".tag-hidden-input").val(e.data("tags").join(", "))}function o(t,e){t.before('\n'+e+'')}function n(t,e){-1==t.parent().data("tags").indexOf(e)&&(t.parent().data("tags").push(e),o(t,e),i(t)),t.val("")}function s(t,e){var a=t.parent().data("tags"),n=a.indexOf(e);-1num()) || $page->template()->scheme()->get('num') == 'date';
$routable = $page->published() && $page->routable();
?>
-
+