Gallery – Photo Gallery – Image Gallery - Version 2.2.6

Version Description

Download this release

Release Info

Developer giucu91
Plugin Icon wp plugin Gallery – Photo Gallery – Image Gallery
Version 2.2.6
Comparing to
See all releases

Code changes from version 2.2.5 to 2.2.6

Modula.php CHANGED
@@ -4,7 +4,7 @@
4
* Plugin URI: https://wp-modula.com/
5
* Description: Modula is the most powerful, user-friendly WordPress gallery plugin. Add galleries, masonry grids and more in a few clicks.
6
* Author: MachoThemes
7
- * Version: 2.2.5
8
* Author URI: https://www.machothemes.com/
9
* License: GPLv3 or later
10
* License URI: http://www.gnu.org/licenses/gpl-3.0.html
@@ -43,7 +43,7 @@
43
*
44
* @since 2.0.2
45
*/
46
- define( 'MODULA_LITE_VERSION' , '2.2.5' );
47
define( 'MODULA_PATH' , plugin_dir_path( __FILE__ ) );
48
define( 'MODULA_URL' , plugin_dir_url( __FILE__ ) );
49
defined( 'MODULA_PRO_STORE_URL' ) || define( 'MODULA_PRO_STORE_URL' , 'https://wp-modula.com' );
4
* Plugin URI: https://wp-modula.com/
5
* Description: Modula is the most powerful, user-friendly WordPress gallery plugin. Add galleries, masonry grids and more in a few clicks.
6
* Author: MachoThemes
7
+ * Version: 2.2.6
8
* Author URI: https://www.machothemes.com/
9
* License: GPLv3 or later
10
* License URI: http://www.gnu.org/licenses/gpl-3.0.html
43
*
44
* @since 2.0.2
45
*/
46
+ define( 'MODULA_LITE_VERSION' , '2.2.6' );
47
define( 'MODULA_PATH' , plugin_dir_path( __FILE__ ) );
48
define( 'MODULA_URL' , plugin_dir_url( __FILE__ ) );
49
defined( 'MODULA_PRO_STORE_URL' ) || define( 'MODULA_PRO_STORE_URL' , 'https://wp-modula.com' );
README.txt CHANGED
@@ -4,7 +4,7 @@ Tags: best gallery plugin, image gallery, photo gallery, responsive gallery, wor
4
Requires at least: 4.6
5
Tested up to: 5.3
6
Requires PHP: 5.6
7
- Stable tag: 2.2.5
8
License: GPLv3 or later
9
License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
4
Requires at least: 4.6
5
Tested up to: 5.3
6
Requires PHP: 5.6
7
+ Stable tag: 2.2.6
8
License: GPLv3 or later
9
License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
assets/css/modula-cpt.css CHANGED
@@ -1274,6 +1274,43 @@ Ups-sells carousel
1274
margin:0 auto;
1275
}
1276
1277
#modula_troubleshooting_option .modula-select label {
1278
margin-right: 10px;
1279
}
1274
margin:0 auto;
1275
}
1276
1277
+ /* Editor theme*/
1278
+ /*
1279
+ Name: dracula
1280
+ Author: Michael Kaminsky (http://github.com/mkaminsky11)
1281
+ Original dracula color scheme by Zeno Rocha (https://github.com/zenorocha/dracula-theme)
1282
+ */
1283
+ .cm-s-dracula.CodeMirror, .cm-s-dracula .CodeMirror-gutters {
1284
+ background-color: #282a36 !important;
1285
+ color: #f8f8f2 !important;
1286
+ border: none;
1287
+ }
1288
+ .cm-s-dracula .CodeMirror-gutters { color: #282a36; }
1289
+ .cm-s-dracula .CodeMirror-cursor { border-left: solid thin #f8f8f0; }
1290
+ .cm-s-dracula .CodeMirror-linenumber { color: #6D8A88; }
1291
+ .cm-s-dracula .CodeMirror-selected { background: rgba(255, 255, 255, 0.10); }
1292
+ .cm-s-dracula .CodeMirror-line::selection, .cm-s-dracula .CodeMirror-line > span::selection, .cm-s-dracula .CodeMirror-line > span > span::selection { background: rgba(255, 255, 255, 0.10); }
1293
+ .cm-s-dracula .CodeMirror-line::-moz-selection, .cm-s-dracula .CodeMirror-line > span::-moz-selection, .cm-s-dracula .CodeMirror-line > span > span::-moz-selection { background: rgba(255, 255, 255, 0.10); }
1294
+ .cm-s-dracula span.cm-comment { color: #6272a4; }
1295
+ .cm-s-dracula span.cm-string, .cm-s-dracula span.cm-string-2 { color: #f1fa8c; }
1296
+ .cm-s-dracula span.cm-number { color: #bd93f9; }
1297
+ .cm-s-dracula span.cm-variable { color: #50fa7b; }
1298
+ .cm-s-dracula span.cm-variable-2 { color: white; }
1299
+ .cm-s-dracula span.cm-def { color: #50fa7b; }
1300
+ .cm-s-dracula span.cm-operator { color: #ff79c6; }
1301
+ .cm-s-dracula span.cm-keyword { color: #ff79c6; }
1302
+ .cm-s-dracula span.cm-atom { color: #bd93f9; }
1303
+ .cm-s-dracula span.cm-meta { color: #f8f8f2; }
1304
+ .cm-s-dracula span.cm-tag { color: #ff79c6; }
1305
+ .cm-s-dracula span.cm-attribute { color: #50fa7b; }
1306
+ .cm-s-dracula span.cm-qualifier { color: #50fa7b; }
1307
+ .cm-s-dracula span.cm-property { color: #66d9ef; }
1308
+ .cm-s-dracula span.cm-builtin { color: #50fa7b; }
1309
+ .cm-s-dracula span.cm-variable-3, .cm-s-dracula span.cm-type { color: #ffb86c; }
1310
+
1311
+ .cm-s-dracula .CodeMirror-activeline-background { background: rgba(255,255,255,0.1); }
1312
+ .cm-s-dracula .CodeMirror-matchingbracket { text-decoration: underline; color: white !important; }
1313
+
1314
#modula_troubleshooting_option .modula-select label {
1315
margin-right: 10px;
1316
}
assets/js/editor-plugin.min.js ADDED
@@ -0,0 +1 @@
1
+ tinymce.create("tinymce.plugins.Modula",{init:function(t,o){t.addCommand("modula_shortcode_editor",function(){t.windowManager.open({file:ajaxurl+"?action=modula_shortcode_editor",width:900+parseInt(t.getLang("button.delta_width",0)),height:500+parseInt(t.getLang("button.delta_height",0)),inline:1},{plugin_url:o})});var e=o.split("assets/");t.addButton("modula_shortcode_editor",{title:"Modula Gallery",cmd:"modula_shortcode_editor",image:e[0]+"assets/images/modula-logo.jpg"})},getInfo:function(){return{longname:"Modula Gallery",author:"Macho Themes",authorurl:"https://www.machothemes.com/",infourl:"https://www.machothemes.com/",version:tinymce.majorVersion+"."+tinymce.minorVersion}}}),tinymce.PluginManager.add("modula_shortcode_editor",tinymce.plugins.Modula);
assets/js/jquery-modula.js CHANGED
@@ -92,7 +92,7 @@ jQuery(document).on( 'vc-full-width-row-single vc-full-width-row', function( eve
92
if ( this.options.gutter > 0 ) {
93
size = ( containerWidth - this.options.gutter * ( columns - 1 ) ) / columns;
94
}else{
95
- size = Math.floor( containerWidth / columns );
96
}
97
98
this.$items.not(".jtg-hidden").each(function (i, item) {
@@ -636,6 +636,7 @@ jQuery( document ).ready( function($){
636
});
637
});
638
639
jQuery('.modula-item').on('click', function(e){
640
window.location.hash = "#";
641
window.addEventListener('popstate', onBackDown, false);
92
if ( this.options.gutter > 0 ) {
93
size = ( containerWidth - this.options.gutter * ( columns - 1 ) ) / columns;
94
}else{
95
+ size = Math.floor( (containerWidth / columns) * 1000 ) / 1000;
96
}
97
98
this.$items.not(".jtg-hidden").each(function (i, item) {
636
});
637
});
638
639
+ /* Remove this after migration to Fancybox */
640
jQuery('.modula-item').on('click', function(e){
641
window.location.hash = "#";
642
window.addEventListener('popstate', onBackDown, false);
assets/js/jquery-modula.min.js CHANGED
@@ -1 +1,2 @@
1
- function tg_getURLParameter(t){return decodeURIComponent((new RegExp("[?|&]"+t+"=([^&;]+?)(&|#|;|$)").exec(location.search)||[,""])[1].replace(/\+/g,"%20"))||null}jQuery(document).on("vc-full-width-row-single vc-full-width-row",function(t,i){0<jQuery("body").find(".modula").length&&jQuery(window).trigger("modula-update")}),function(d,l,c,t){var s="modulaGallery",e={resizer:"/",margin:10,keepArea:!0,type:"creative-gallery",columns:12,gutter:10,enableTwitter:!1,enableFacebook:!1,enableGplus:!1,enablePinterest:!1,enableLinkedin:!1,lazyLoad:0};function n(t,i){this.element=t,this.$element=d(t),this.$itemsCnt=this.$element.find(".modula-items"),this.$items=this.$itemsCnt.find(".modula-item"),this.options=d.extend({},e,i),this._defaults=e,this._name=s,this.tiles=[],this.$tilesCnt=null,this.completed=!1,this.lastWidth=0,this.resizeTO=0,this.isPackeryActive=!1,this.init()}n.prototype.trunc=function(t){return Math.trunc?Math.trunc(t):(t=+t,isFinite(t)?t-t%1||(t<0?-0:0===t?t:0):t)},n.prototype.createCustomGallery=function(){var h,t=this.$element.width(),r=this,l=this.options.columns,i=c.documentElement.clientWidth;"1"==this.options.enableResponsive&&(i<=568?l=this.options.mobileColumns:i<=768&&(l=this.options.tabletColumns)),h=0<this.options.gutter?(t-this.options.gutter*(l-1))/l:Math.floor(t/l),this.$items.not(".jtg-hidden").each(function(t,i){var e,o,s,n,a={};e=d(i).data("width"),o=d(i).data("height"),12<e&&(e=12),"1"==r.options.enableResponsive&&(s=e,n=o,1==l?o=(e=1)*n/s:((e=Math.round(l*s/12))<1&&(e=1),(o=Math.round(e*n/s))<1&&(o=1))),a.width=h*e+r.options.gutter*(e-1),a.height=Math.round(h)*o+r.options.gutter*(o-1),d(i).data("size",a).addClass("tiled").addClass(a.width>a.height?"tile-h":"tile-v").data("position"),d(i).css(d(i).data("size")),d(i).find(".figc").css({width:d(i).data("size").width,height:d(i).data("size").height})}),this.isPackeryActive&&this.$itemsCnt.packery("destroy"),this.$itemsCnt.packery({itemSelector:".modula-item",gutter:parseInt(r.options.gutter),columnWidth:h,resize:!1}),this.isPackeryActive=!0},n.prototype.createGrid=function(){var o=this;this.options.width&&this.$itemsCnt.width(this.options.width),this.options.height&&this.$itemsCnt.height(this.options.height),this.$itemsCnt.data("area",this.$itemsCnt.width()*this.$itemsCnt.height()),this.lastWidth=this.$itemsCnt.width();for(var t=0;t<this.$items.not(".jtg-hidden").length;t++)this.tiles.push(o.getSlot());this.tiles.sort(function(t,i){return t.position-i.position}),this.$items.not(".jtg-hidden").each(function(t,i){var e=o.tiles[t];d(i).data("size",e).addClass("tiled").addClass(e.width>e.height?"tile-h":"tile-v").data("position")}),this.$items.each(function(t,i){d(i).css(d(i).data("size")),d(i).find(".figc").css({width:d(i).data("size").width,height:d(i).data("size").height})}),this.completed=!0},n.prototype.getSlot=function(){if(0==this.tiles.length)return e={top:0,left:0,width:this.$itemsCnt.width(),height:this.$itemsCnt.height(),area:this.$itemsCnt.width()*this.$itemsCnt.height(),position:0};for(var t=0,i=0;i<this.tiles.length;i++){(e=this.tiles[i]).area>this.tiles[t].area&&(t=i)}var e={},o=this.tiles[t];if(o.width>o.height){var s=o.width/2*this.options.randomFactor;o.prevWidth=o.width,o.width=Math.floor(o.width/2+s*(Math.random()-.5)),e={top:o.top,left:o.left+o.width+this.options.margin,width:o.prevWidth-o.width-this.options.margin,height:o.height}}else{s=o.height/2*this.options.randomFactor;o.prevHeight=o.height,o.height=Math.floor(o.height/2+s*(Math.random()-.5)),e={left:o.left,top:o.top+o.height+this.options.margin,width:o.width,height:o.prevHeight-o.height-this.options.margin}}return e.area=e.width*e.height,e.position=1e3*e.top+e.left,o.position=1e3*o.top+o.left,this.tiles[t]=o,this.tiles[t].area=o.width*o.height,e},n.prototype.reset=function(){var e=this;e.tiles=[],"custom-grid"===e.options.type?(e.createCustomGallery(),e.$itemsCnt.packery()):"creative-gallery"==this.options.type&&e.createGrid(),e.$itemsCnt.find(".pic").each(function(t,i){e.placeImage(t)}),e.lastWidth=e.$itemsCnt.width()},n.prototype.onResize=function(i){i.lastWidth!=i.$itemsCnt.width()&&(clearTimeout(i.resizeTO),i.resizeTO=setTimeout(function(){if(i.options.keepArea){var t=i.$itemsCnt.data("area");i.$itemsCnt.height(t/i.$itemsCnt.width())}i.reset()},100))},n.prototype.placeImage=function(t){var i=this.$items.eq(t),e=i.find(".pic"),o=i.data("size"),s=e.data("size");if(e.parent()!=i&&(o={width:e.parent().width(),height:e.parent().height()}),void 0!==o&&void 0!==s){var n=o.width/o.height,a=s.width/s.height,h=e.data("valign")?e.data("valign"):"middle",r=e.data("halign")?e.data("halign"):"center",l={top:"auto",bottom:"auto",left:"auto",right:"auto",width:"auto",height:"auto",margin:"0",maxWidth:"999em"};if(a<n)switch(l.width=o.width,l.left=0,h){case"top":l.top=0;break;case"middle":l.top=0-(o.width*(1/a)-o.height)/2;break;case"bottom":l.bottom=0}else switch(l.height=o.height,l.top=0,r){case"left":l.left=0;break;case"center":l.left=0-(o.height*a-o.width)/2;break;case"right":l.right=0}e.css(l)}},n.prototype.loadImage=function(t){var i=this,e=i.$items.eq(t).find(".pic"),o=new Image;o.onerror=function(){console.log("error loading image ["+t+"] : "+this.src),t+1<i.$items.length&&i.loadImage(t+1)},o.onload=function(){e.data("size",{width:this.width,height:this.height}),i.placeImage(t),i.$items.eq(t).addClass("tg-loaded"),t+1<i.$items.length&&i.loadImage(t+1)};var s=e.data("src");o.src=s,e.attr("src",s)},n.prototype.init=function(){var s=this;d(c).trigger("modula_api_before_init",[s]),this.$itemsCnt.css({position:"relative",zIndex:1,"min-height":"10px"}),this.$items.addClass("tile"),this.$items.find(".pic").removeAttr("src"),"custom-grid"===this.options.type?this.createCustomGallery():"creative-gallery"==this.options.type&&this.createGrid(),"1"!=s.options.lazyLoad&&this.loadImage(0),d(l).resize(function(){s.onResize(s)}),d(l).on("modula-update",function(){s.onResize(s)}),d(c).on("lazyloaded",function(t){var i,e,o=d(t.target);"modula"==o.data("source")&&(o.data("size",{width:o.width(),height:o.height()}),(i=o.parents(".modula-item")).addClass("tg-loaded"),e=s.$items.index(i),s.placeImage(e))}),this.setupSocial(),this.options.onComplete&&this.options.onComplete(),d(c).trigger("modula_api_after_init",[s])},n.prototype.setupSocial=function(){this.options.enableTwitter&&i(this.$items,this),this.options.enableFacebook&&o(this.$items,this),this.options.enablePinterest&&h(this.$items,this),this.options.enableLinkedin&&r(this.$items,this),this.options.enableWhatsapp&&a(this.$items,this)},n.prototype.destroy=function(){this.isPackeryActive&&(this.$itemsCnt.packery("destroy"),this.isPackeryActive=!1)};var i=function(t,o){t.find(".modula-icon-twitter").click(function(t){t.preventDefault();var i=d(this).parents(".tile:first").find(".caption"),e=o.options.twitterText||c.title;return!o.options.twitterText&&1==i.length&&0<i.text().length&&(e=d.trim(i.text())),l.open("https://twitter.com/intent/tweet?url="+encodeURI(location.href.split("#")[0])+"&text="+encodeURI(e),"ftgw","location=1,status=1,scrollbars=1,width=600,height=400").moveTo(screen.width/2-300,screen.height/2-200),!1})},o=function(t,s){t.find(".modula-icon-facebook").click(function(t){t.preventDefault();var i=d(this).parents(".tile:first").find(".pic"),e=d(this).parents(".tile:first").find(".caption");s.options.facebookText||c.title;!s.options.facebookText&&1==e.length&&0<e.text().length&&d.trim(e.text());i.attr("src");var o="//www.facebook.com/sharer.php?u="+location.href;return l.open(o,"ftgw","location=1,status=1,scrollbars=1,width=600,height=400").moveTo(screen.width/2-300,screen.height/2-200),!1})},a=function(t,e){t.find(".modula-icon-whatsapp").click(function(t){t.preventDefault();var i=d(this).parents(".tile:first").find(".caption");e.options.whatsappText||c.title;return!e.options.whatsappText&&1==i.length&&0<i.text().length&&d.trim(i.text()),l.open("https://api.whatsapp.com/send?text="+encodeURI(l.location.href.split("#")[0])+"&preview_url=true","ftgw","location=1,status=1,scrollbars=1,width=600,height=400").moveTo(screen.width/2-300,screen.height/2-200),!1})},h=function(t,r){t.find(".modula-icon-pinterest").click(function(t){t.preventDefault();var i=d(this).parents(".tile:first").find(".pic"),e=d(this).parents(".tile:first").find(".caption"),o=r.options.facebookText||c.title;!r.options.facebookText&&1==e.length&&0<e.text().length&&(o=d.trim(e.text()));var s,n,a="http://pinterest.com/pin/create/button/?url="+encodeURI(location.href)+"&description="+encodeURI(o);if(1==i.length){var h=i.attr("src");a+="&media="+(s=h,(n=c.createElement("img")).src=s,s=n.src,n.src=null,s)}return l.open(a,"ftgw","location=1,status=1,scrollbars=1,width=600,height=400").moveTo(screen.width/2-300,screen.height/2-200),!1})},r=function(t,i){t.find(".modula-icon-linkedin").click(function(t){t.preventDefault();var i="//linkedin.com/shareArticle?mini=true&url="+ +encodeURI(location.href);return l.open(i,"ftgw","location=1,status=1,scrollbars=1,width=600,height=400").moveTo(screen.width/2-300,screen.height/2-200),!1})};d.fn[s]=function(i){var e,o=arguments;return i===t||"object"==typeof i?this.each(function(){d.data(this,"plugin_"+s)||d.data(this,"plugin_"+s,new n(this,i))}):"string"==typeof i&&"_"!==i[0]&&"init"!==i?(this.each(function(){var t=d.data(this,"plugin_"+s);t instanceof n&&"function"==typeof t[i]&&(e=t[i].apply(t,Array.prototype.slice.call(o,1))),"destroy"===i&&d.data(this,"plugin_"+s,null)}),e!==t?e:this):void 0}}(jQuery,window,document),jQuery(document).ready(function(e){var t=e(".modula-gallery");e.each(t,function(){var t=e(this).attr("id"),i=e(this).data("config");e("#"+t).modulaGallery(i)})}),jQuery(".modula-item").on("click",function(t){function i(){this.event.preventDefault(),jQuery(".lb-close").click(),this.window.location.hash=""}window.location.hash="#",window.addEventListener("popstate",i,!1),window.addEventListener("backbutton",i,!1)});
1
+ "use strict";!function(e,t){"function"==typeof define&&define.amd?define(t):"object"==typeof exports?module.exports=t():e.ResizeSensor=t()}("undefined"!=typeof window?window:this,function(){if("undefined"==typeof window)return null;var e=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||function(e){return window.setTimeout(e,20)};function t(e,t){var i=Object.prototype.toString.call(e),n="[object Array]"===i||"[object NodeList]"===i||"[object HTMLCollection]"===i||"[object Object]"===i||"undefined"!=typeof jQuery&&e instanceof jQuery||"undefined"!=typeof Elements&&e instanceof Elements,o=0,s=e.length;if(n)for(;o<s;o++)t(e[o]);else t(e)}function i(e){if(!e.getBoundingClientRect)return{width:e.offsetWidth,height:e.offsetHeight};var t=e.getBoundingClientRect();return{width:Math.round(t.width),height:Math.round(t.height)}}var n=function(o,s){function r(){var e,t,i=[];this.add=function(e){i.push(e)},this.call=function(){for(e=0,t=i.length;e<t;e++)i[e].call()},this.remove=function(n){var o=[];for(e=0,t=i.length;e<t;e++)i[e]!==n&&o.push(i[e]);i=o},this.length=function(){return i.length}}t(o,function(t){!function(t,n){if(t)if(t.resizedAttached)t.resizedAttached.add(n);else{t.resizedAttached=new r,t.resizedAttached.add(n),t.resizeSensor=document.createElement("div"),t.resizeSensor.dir="ltr",t.resizeSensor.className="resize-sensor";var o="position: absolute; left: -10px; top: -10px; right: 0; bottom: 0; overflow: hidden; z-index: -1; visibility: hidden;",s="position: absolute; left: 0; top: 0; transition: 0s;";t.resizeSensor.style.cssText=o,t.resizeSensor.innerHTML='<div class="resize-sensor-expand" style="'+o+'"><div style="'+s+'"></div></div><div class="resize-sensor-shrink" style="'+o+'"><div style="'+s+' width: 200%; height: 200%"></div></div>',t.appendChild(t.resizeSensor);var d=window.getComputedStyle(t).getPropertyPriority("position");"absolute"!==d&&"relative"!==d&&"fixed"!==d&&(t.style.position="relative");var c,l,a=t.resizeSensor.childNodes[0],h=a.childNodes[0],f=t.resizeSensor.childNodes[1],u=i(t),v=u.width,p=u.height,z=function(){var e=0===t.offsetWidth&&0===t.offsetHeight;if(e){var i=t.style.display;t.style.display="block"}h.style.width="100000px",h.style.height="100000px",a.scrollLeft=1e5,a.scrollTop=1e5,f.scrollLeft=1e5,f.scrollTop=1e5,e&&(t.style.display=i)};t.resizeSensor.resetSensor=z;var y=function(){l=0,c&&(v=void 0,p=void 0,t.resizedAttached&&t.resizedAttached.call())},w=function(){var n=i(t),o=n.width,s=n.height;(c=o!=v||s!=p)&&!l&&(l=e(y)),z()},g=function(e,t,i){e.attachEvent?e.attachEvent("on"+t,i):e.addEventListener(t,i)};g(a,"scroll",w),g(f,"scroll",w),e(z)}}(t,s)}),this.detach=function(e){n.detach(o,e)},this.reset=function(){o.resizeSensor.resetSensor()}};return n.reset=function(e,i){t(e,function(e){e.resizeSensor.resetSensor()})},n.detach=function(e,i){t(e,function(e){e&&(e.resizedAttached&&"function"==typeof i&&(e.resizedAttached.remove(i),e.resizedAttached.length())||e.resizeSensor&&(e.contains(e.resizeSensor)&&e.removeChild(e.resizeSensor),delete e.resizeSensor,delete e.resizedAttached))})},n});
2
+ function tg_getURLParameter(t){return decodeURIComponent((new RegExp("[?|&]"+t+"=([^&;]+?)(&|#|;|$)").exec(location.search)||[,""])[1].replace(/\+/g,"%20"))||null}jQuery(document).on("vc-full-width-row-single vc-full-width-row",function(t,i){0<jQuery("body").find(".modula").length&&jQuery(window).trigger("modula-update")}),function(d,a,c,t){var o="modulaGallery",e={resizer:"/",margin:10,keepArea:!0,type:"creative-gallery",columns:12,gutter:10,enableTwitter:!1,enableFacebook:!1,enableGplus:!1,enablePinterest:!1,enableLinkedin:!1,lazyLoad:0};function s(t,i){this.element=t,this.$element=d(t),this.$itemsCnt=this.$element.find(".modula-items"),this.$items=this.$itemsCnt.find(".modula-item"),this.options=d.extend({},e,i),this._defaults=e,this._name=o,this.tiles=[],this.$tilesCnt=null,this.completed=!1,this.lastWidth=0,this.resizeTO=0,this.isPackeryActive=!1,this.init()}s.prototype.trunc=function(t){return Math.trunc?Math.trunc(t):(t=+t,isFinite(t)?t-t%1||(t<0?-0:0===t?t:0):t)},s.prototype.createCustomGallery=function(){var h,t=this.$element.width(),r=this,l=this.options.columns,i=c.documentElement.clientWidth;"1"==this.options.enableResponsive&&(i<=568?l=this.options.mobileColumns:i<=768&&(l=this.options.tabletColumns)),h=0<this.options.gutter?(t-this.options.gutter*(l-1))/l:Math.floor(t/l*1e3)/1e3,this.$items.not(".jtg-hidden").each(function(t,i){var e,n,o,s,a={};e=d(i).data("width"),n=d(i).data("height"),12<e&&(e=12),"1"==r.options.enableResponsive&&(o=e,s=n,1==l?n=(e=1)*s/o:((e=Math.round(l*o/12))<1&&(e=1),(n=Math.round(e*s/o))<1&&(n=1))),a.width=h*e+r.options.gutter*(e-1),a.height=Math.round(h)*n+r.options.gutter*(n-1),d(i).data("size",a).addClass("tiled").addClass(a.width>a.height?"tile-h":"tile-v").data("position"),d(i).css(d(i).data("size")),d(i).find(".figc").css({width:d(i).data("size").width,height:d(i).data("size").height})}),this.isPackeryActive&&this.$itemsCnt.packery("destroy"),this.$itemsCnt.packery({itemSelector:".modula-item",gutter:parseInt(r.options.gutter),columnWidth:h,resize:!1}),this.isPackeryActive=!0},s.prototype.createGrid=function(){var n=this;this.options.width&&this.$itemsCnt.width(this.options.width),this.options.height&&this.$itemsCnt.height(this.options.height),this.$itemsCnt.data("area",this.$itemsCnt.width()*this.$itemsCnt.height()),this.lastWidth=this.$itemsCnt.width();for(var t=0;t<this.$items.not(".jtg-hidden").length;t++)this.tiles.push(n.getSlot());this.tiles.sort(function(t,i){return t.position-i.position}),this.$items.not(".jtg-hidden").each(function(t,i){var e=n.tiles[t];d(i).data("size",e).addClass("tiled").addClass(e.width>e.height?"tile-h":"tile-v").data("position")}),this.$items.each(function(t,i){d(i).css(d(i).data("size")),d(i).find(".figc").css({width:d(i).data("size").width,height:d(i).data("size").height})}),this.completed=!0},s.prototype.getSlot=function(){if(0==this.tiles.length)return e={top:0,left:0,width:this.$itemsCnt.width(),height:this.$itemsCnt.height(),area:this.$itemsCnt.width()*this.$itemsCnt.height(),position:0};for(var t=0,i=0;i<this.tiles.length;i++){(e=this.tiles[i]).area>this.tiles[t].area&&(t=i)}var e={},n=this.tiles[t];if(n.width>n.height){var o=n.width/2*this.options.randomFactor;n.prevWidth=n.width,n.width=Math.floor(n.width/2+o*(Math.random()-.5)),e={top:n.top,left:n.left+n.width+this.options.margin,width:n.prevWidth-n.width-this.options.margin,height:n.height}}else{o=n.height/2*this.options.randomFactor;n.prevHeight=n.height,n.height=Math.floor(n.height/2+o*(Math.random()-.5)),e={left:n.left,top:n.top+n.height+this.options.margin,width:n.width,height:n.prevHeight-n.height-this.options.margin}}return e.area=e.width*e.height,e.position=1e3*e.top+e.left,n.position=1e3*n.top+n.left,this.tiles[t]=n,this.tiles[t].area=n.width*n.height,e},s.prototype.reset=function(){var e=this;e.tiles=[],"custom-grid"===e.options.type?(e.createCustomGallery(),e.$itemsCnt.packery()):"creative-gallery"==this.options.type&&e.createGrid(),e.$itemsCnt.find(".pic").each(function(t,i){e.placeImage(t)}),e.lastWidth=e.$itemsCnt.width()},s.prototype.onResize=function(i){i.lastWidth!=i.$itemsCnt.width()&&(clearTimeout(i.resizeTO),i.resizeTO=setTimeout(function(){if(i.options.keepArea){var t=i.$itemsCnt.data("area");i.$itemsCnt.height(t/i.$itemsCnt.width())}i.reset()},100))},s.prototype.placeImage=function(t){var i=this.$items.eq(t),e=i.find(".pic"),n=i.data("size"),o=e.data("size");if(e.parent()!=i&&(n={width:e.parent().width(),height:e.parent().height()}),void 0!==n&&void 0!==o){var s=n.width/n.height,a=o.width/o.height,h=e.data("valign")?e.data("valign"):"middle",r=e.data("halign")?e.data("halign"):"center",l={top:"auto",bottom:"auto",left:"auto",right:"auto",width:"auto",height:"auto",margin:"0",maxWidth:"999em"};if(a<s)switch(l.width=n.width,l.left=0,h){case"top":l.top=0;break;case"middle":l.top=0-(n.width*(1/a)-n.height)/2;break;case"bottom":l.bottom=0}else switch(l.height=n.height,l.top=0,r){case"left":l.left=0;break;case"center":l.left=0-(n.height*a-n.width)/2;break;case"right":l.right=0}e.css(l)}},s.prototype.loadImage=function(t){var i=this,e=i.$items.eq(t).find(".pic"),n=new Image;n.onerror=function(){console.log("error loading image ["+t+"] : "+this.src),t+1<i.$items.length&&i.loadImage(t+1)},n.onload=function(){e.data("size",{width:this.width,height:this.height}),i.placeImage(t),i.$items.eq(t).addClass("tg-loaded"),t+1<i.$items.length&&i.loadImage(t+1)};var o=e.data("src");n.src=o,e.attr("src",o)},s.prototype.init=function(){var o=this;d(c).trigger("modula_api_before_init",[o]),this.$itemsCnt.css({position:"relative",zIndex:1,"min-height":"10px"}),this.$items.addClass("tile"),this.$items.find(".pic").removeAttr("src"),"custom-grid"===this.options.type?this.createCustomGallery():"creative-gallery"==this.options.type&&this.createGrid(),"1"!=o.options.lazyLoad&&this.loadImage(0),d(a).resize(function(){o.onResize(o)}),d(a).on("modula-update",function(){o.onResize(o)}),d(c).on("lazyloaded",function(t){var i,e,n=d(t.target);"modula"==n.data("source")&&(n.data("size",{width:n.width(),height:n.height()}),(i=n.parents(".modula-item")).addClass("tg-loaded"),e=o.$items.index(i),o.placeImage(e))}),this.setupSocial(),this.options.onComplete&&this.options.onComplete(),d(c).trigger("modula_api_after_init",[o])},s.prototype.setupSocial=function(){this.options.enableTwitter&&i(this.$items,this),this.options.enableFacebook&&n(this.$items,this),this.options.enablePinterest&&r(this.$items,this),this.options.enableLinkedin&&l(this.$items,this),this.options.enableWhatsapp&&h(this.$items,this)},s.prototype.destroy=function(){this.isPackeryActive&&(this.$itemsCnt.packery("destroy"),this.isPackeryActive=!1)};var i=function(t,n){t.find(".modula-icon-twitter").click(function(t){t.preventDefault();var i=d(this).parents(".tile:first").find(".caption"),e=n.options.twitterText||c.title;return!n.options.twitterText&&1==i.length&&0<i.text().length&&(e=d.trim(i.text())),a.open("https://twitter.com/intent/tweet?url="+encodeURI(location.href.split("#")[0])+"&text="+encodeURI(e),"ftgw","location=1,status=1,scrollbars=1,width=600,height=400").moveTo(screen.width/2-300,screen.height/2-200),!1})},n=function(t,o){t.find(".modula-icon-facebook").click(function(t){t.preventDefault();var i=d(this).parents(".tile:first").find(".pic"),e=d(this).parents(".tile:first").find(".caption");o.options.facebookText||c.title;!o.options.facebookText&&1==e.length&&0<e.text().length&&d.trim(e.text());i.attr("src");var n="//www.facebook.com/sharer.php?u="+location.href;return a.open(n,"ftgw","location=1,status=1,scrollbars=1,width=600,height=400").moveTo(screen.width/2-300,screen.height/2-200),!1})},h=function(t,e){t.find(".modula-icon-whatsapp").click(function(t){t.preventDefault();var i=d(this).parents(".tile:first").find(".caption");e.options.whatsappText||c.title;return!e.options.whatsappText&&1==i.length&&0<i.text().length&&d.trim(i.text()),a.open("https://api.whatsapp.com/send?text="+encodeURI(a.location.href.split("#")[0])+"&preview_url=true","ftgw","location=1,status=1,scrollbars=1,width=600,height=400").moveTo(screen.width/2-300,screen.height/2-200),!1})},r=function(t,s){t.find(".modula-icon-pinterest").click(function(t){t.preventDefault();var i=d(this).parents(".tile:first").find(".pic"),e=d(this).parents(".tile:first").find(".caption"),n=s.options.facebookText||c.title;!s.options.facebookText&&1==e.length&&0<e.text().length&&(n=d.trim(e.text()));var o="http://pinterest.com/pin/create/button/?url="+encodeURI(location.href)+"&description="+encodeURI(n);1==i.length&&(o+="&media="+function(t){var i=c.createElement("img");return i.src=t,t=i.src,i.src=null,t}(i.attr("src")));return a.open(o,"ftgw","location=1,status=1,scrollbars=1,width=600,height=400").moveTo(screen.width/2-300,screen.height/2-200),!1})},l=function(t,i){t.find(".modula-icon-linkedin").click(function(t){t.preventDefault();var i="//linkedin.com/shareArticle?mini=true&url="+ +encodeURI(location.href);return a.open(i,"ftgw","location=1,status=1,scrollbars=1,width=600,height=400").moveTo(screen.width/2-300,screen.height/2-200),!1})};d.fn[o]=function(i){var e,n=arguments;return i===t||"object"==typeof i?this.each(function(){d.data(this,"plugin_"+o)||d.data(this,"plugin_"+o,new s(this,i))}):"string"==typeof i&&"_"!==i[0]&&"init"!==i?(this.each(function(){var t=d.data(this,"plugin_"+o);t instanceof s&&"function"==typeof t[i]&&(e=t[i].apply(t,Array.prototype.slice.call(n,1))),"destroy"===i&&d.data(this,"plugin_"+o,null)}),e!==t?e:this):void 0}}(jQuery,window,document),jQuery(document).ready(function(e){var t=e(".modula-gallery");e.each(t,function(){var t=e(this).attr("id"),i=e(this).data("config");e("#"+t).modulaGallery(i)})}),jQuery(".modula-item").on("click",function(t){function i(){this.event.preventDefault(),jQuery(".lb-close").click(),this.window.location.hash=""}window.location.hash="#",window.addEventListener("popstate",i,!1),window.addEventListener("backbutton",i,!1)});
assets/js/lightbox.min.js CHANGED
@@ -1 +1 @@
1
- !function(t,i){"function"==typeof define&&define.amd?define(["jquery"],i):"object"==typeof exports?module.exports=i(require("jquery")):t.lightbox=i(t.jQuery)}(this,function(t){function i(i){this.album=[],this.currentImageIndex=void 0,this.init(),this.options=t.extend({},this.constructor.defaults),this.option(i)}return i.defaults={albumLabel:"Image %1 of %2",showNavigation:!0,showNavigationOnMobile:!1,fadeDuration:600,fitImagesInViewport:!0,imageFadeDuration:600,positionFromTop:50,resizeDuration:700,showImageNumberLabel:!0,wrapAround:!1,disableScrolling:!1,enableSwipeOnTouchDevices:!0,sanitizeTitle:!1},i.prototype.option=function(i){t.extend(this.options,i)},i.prototype.imageCountLabel=function(t,i){return this.options.albumLabel.replace(/%1/g,t).replace(/%2/g,i)},i.prototype.mobilecheck=function(){var t,i=!1;return t=navigator.userAgent||navigator.vendor||window.opera,(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(t)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(t.substr(0,4)))&&(i=!0),i},i.prototype.init=function(){var i=this;t(document).ready(function(){i.enable(),i.build()})},i.prototype.enable=function(){var i=this;t("body").on("click","a[rel^=lightbox], area[rel^=lightbox], a[data-lightbox], area[data-lightbox]",function(e){return i.start(t(e.currentTarget)),!1})},i.prototype.swipedetect=function(i,e){var n,o,a,r,s,h,l=i,d=e||function(t){};l.addEventListener("touchstart",function(t){var i=t.changedTouches[0];n="none",dist=0,o=i.pageX,a=i.pageY,h=(new Date).getTime(),t.preventDefault()},!1),l.addEventListener("touchmove",function(t){t.preventDefault()},!1),l.addEventListener("touchend",function(i){var e=i.changedTouches[0];if(r=e.pageX-o,s=e.pageY-a,(new Date).getTime()-h<=300&&(Math.abs(r)>=1&&Math.abs(s)<=100?n=r<0?"left":"right":Math.abs(s)>=1&&Math.abs(r)<=100&&(n=s<0?"up":"down")),"none"==n){var l=t(i.target);l.hasClass("lb-prev")?n="left":l.hasClass("lb-next")&&(n="right")}d(n),i.preventDefault()},!1)},i.prototype.build=function(){if(!(t("#lightbox").length>0)){var i=this;t('<div id="lightboxOverlay" class="lightboxOverlay"></div><div id="lightbox" class="lightbox"><div class="lb-outerContainer"><div class="lb-container"><img class="lb-image" src="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" /><div class="lb-nav"><a class="lb-prev" href="" ></a><a class="lb-next" href="" ></a></div><div class="lb-loader"><a class="lb-cancel"></a></div></div></div><div class="lb-dataContainer"><div class="lb-data"><div class="lb-details"><span class="lb-caption"></span><span class="lb-number"></span></div><div class="lb-closeContainer"><a class="lb-close"></a></div></div></div></div>').appendTo(t("body")),this.$lightbox=t("#lightbox"),this.$overlay=t("#lightboxOverlay"),this.$outerContainer=this.$lightbox.find(".lb-outerContainer"),this.$container=this.$lightbox.find(".lb-container"),this.$image=this.$lightbox.find(".lb-image"),this.$nav=this.$lightbox.find(".lb-nav"),this.containerPadding={top:parseInt(this.$container.css("padding-top"),10),right:parseInt(this.$container.css("padding-right"),10),bottom:parseInt(this.$container.css("padding-bottom"),10),left:parseInt(this.$container.css("padding-left"),10)},this.imageBorderWidth={top:parseInt(this.$image.css("border-top-width"),10),right:parseInt(this.$image.css("border-right-width"),10),bottom:parseInt(this.$image.css("border-bottom-width"),10),left:parseInt(this.$image.css("border-left-width"),10)},this.$overlay.hide().on("click",function(){return i.end(),jQuery(document).trigger("modula_lightbox2_lightbox_close"),!1}),this.$lightbox.hide().on("click",function(e){return"lightbox"===t(e.target).attr("id")&&(i.end(),jQuery(document).trigger("modula_lightbox2_lightbox_close")),!1}),this.$outerContainer.on("click",function(e){return"lightbox"===t(e.target).attr("id")&&(i.end(),jQuery(document).trigger("modula_lightbox2_lightbox_close")),!1}),this.$lightbox.find(".lb-prev").on("click",function(){return 0===i.currentImageIndex?i.changeImage(i.album.length-1):i.changeImage(i.currentImageIndex-1),setTimeout(function(){jQuery(document).trigger("modula_lightbox2_lightbox_prev",[i,i.currentImageIndex])},600),!1}),this.$lightbox.find(".lb-next").on("click",function(){return i.currentImageIndex===i.album.length-1?i.changeImage(0):i.changeImage(i.currentImageIndex+1),setTimeout(function(){jQuery(document).trigger("modula_lightbox2_lightbox_next",[i,i.currentImageIndex])},600),!1});var e=this.$lightbox.find(".lb-container")[0];i.swipedetect(e,function(t){"left"==t?i.currentImageIndex===i.album.length-1?i.changeImage(0):i.changeImage(i.currentImageIndex+1):"right"==t&&(0===i.currentImageIndex?i.changeImage(i.album.length-1):i.changeImage(i.currentImageIndex-1))}),this.$nav.on("mousedown",function(t){3===t.which&&(i.$nav.css("pointer-events","none"),i.$lightbox.one("contextmenu",function(){setTimeout(function(){this.$nav.css("pointer-events","auto")}.bind(i),0)}))}),this.$lightbox.find(".lb-loader, .lb-close").on("click",function(){return i.end(),jQuery(document).trigger("modula_lightbox2_lightbox_close"),!1})}},i.prototype.start=function(i){var e=this,n=t(window);n.on("resize",t.proxy(this.sizeOverlay,this)),t("select, object, embed").css({visibility:"hidden"}),this.sizeOverlay(),this.album=[];var o=0;function a(t){e.album.push({alt:t.attr("data-alt"),link:t.attr("href"),title:t.attr("data-title")||t.attr("title")})}var r,s,h=i.attr("data-lightbox");if(h){(s=(r=t(i.prop("tagName")+'[data-lightbox="'+h+'"]')).filter("[data-cyclefilter=show]")).length>0&&s.length!=r.length&&(r=s);for(var l=0;l<r.length;l=++l)a(t(r[l])),r[l]===i[0]&&(o=l)}else if("lightbox"===i.attr("rel"))a(i);else{(s=(r=t(i.prop("tagName")+'[rel="'+i.attr("rel")+'"]')).filter("[data-cyclefilter=show]")).length>0&&s.length!=r.length&&(r=s);for(var d=0;d<r.length;d=++d)a(t(r[d])),r[d]===i[0]&&(o=d)}var g=n.scrollTop()+this.options.positionFromTop,c=n.scrollLeft();this.$lightbox.css({top:g+"px",left:c+"px"}).fadeIn(this.options.fadeDuration),this.options.disableScrolling&&t("html").addClass("lb-disable-scrolling"),this.changeImage(o),setTimeout(function(){jQuery(document).trigger("modula_lightbox2_lightbox_open",[e,i])},600)},i.prototype.changeImage=function(i){var e=this;this.disableKeyboardNav();var n=this.$lightbox.find(".lb-image");this.$overlay.fadeIn(this.options.fadeDuration),t(".lb-loader").fadeIn("slow"),this.$lightbox.find(".lb-image, .lb-nav, .lb-prev, .lb-next, .lb-dataContainer, .lb-numbers, .lb-caption").hide(),this.$outerContainer.addClass("animating");var o=new Image;o.onload=function(){var a,r,s,h,l,d;n.attr({alt:e.album[i].alt,src:e.album[i].link}),t(o),n.width(o.width),n.height(o.height),e.options.fitImagesInViewport&&(d=t(window).width(),l=t(window).height(),h=d-e.containerPadding.left-e.containerPadding.right-e.imageBorderWidth.left-e.imageBorderWidth.right-20,s=l-e.containerPadding.top-e.containerPadding.bottom-e.imageBorderWidth.top-e.imageBorderWidth.bottom-120,e.options.maxWidth&&e.options.maxWidth<h&&(h=e.options.maxWidth),e.options.maxHeight&&e.options.maxHeight<h&&(s=e.options.maxHeight),(o.width>h||o.height>s)&&(o.width/h>o.height/s?(r=h,a=parseInt(o.height/(o.width/r),10),n.width(r),n.height(a)):(a=s,r=parseInt(o.width/(o.height/a),10),n.width(r),n.height(a)))),e.sizeContainer(n.width(),n.height())},o.src=this.album[i].link,this.currentImageIndex=i},i.prototype.sizeOverlay=function(){this.$overlay.width(t(document).width()).height(t(document).height())},i.prototype.sizeContainer=function(t,i){var e=this,n=this.$outerContainer.outerWidth(),o=this.$outerContainer.outerHeight(),a=t+this.containerPadding.left+this.containerPadding.right+this.imageBorderWidth.left+this.imageBorderWidth.right,r=i+this.containerPadding.top+this.containerPadding.bottom+this.imageBorderWidth.top+this.imageBorderWidth.bottom;function s(){e.$lightbox.find(".lb-dataContainer").width(a),e.$lightbox.find(".lb-prevLink").height(r),e.$lightbox.find(".lb-nextLink").height(r),e.showImage()}n!==a||o!==r?this.$outerContainer.animate({width:a,height:r},this.options.resizeDuration,"swing",function(){s()}):s()},i.prototype.showImage=function(){this.$lightbox.find(".lb-loader").stop(!0).hide(),this.$lightbox.find(".lb-image").fadeIn(this.options.imageFadeDuration),this.updateNav(),this.updateDetails(),this.preloadNeighboringImages(),this.enableKeyboardNav()},i.prototype.updateNav=function(){var t=!!this.options.showNavigation,i=!1;try{document.createEvent("TouchEvent"),!!this.options.enableSwipeOnTouchDevices,i=!0}catch(t){}this.mobilecheck()&&(t=!!this.options.showNavigationOnMobile),t?(this.$lightbox.find(".lb-nav").show(),this.album.length>1&&(this.options.wrapAround?(i&&this.$lightbox.find(".lb-prev, .lb-next").css("opacity","1"),this.$lightbox.find(".lb-prev, .lb-next").show()):(this.currentImageIndex>0&&(this.$lightbox.find(".lb-prev").show(),i&&this.$lightbox.find(".lb-prev").css("opacity","1")),this.currentImageIndex<this.album.length-1&&(this.$lightbox.find(".lb-next").show(),i&&this.$lightbox.find(".lb-next").css("opacity","1"))))):this.$lightbox.find(".lb-nav").hide()},i.prototype.updateDetails=function(){var i=this;if(void 0!==this.album[this.currentImageIndex].title&&""!==this.album[this.currentImageIndex].title){var e=this.$lightbox.find(".lb-caption");this.options.sanitizeTitle?e.text(this.album[this.currentImageIndex].title):e.html(this.album[this.currentImageIndex].title),e.fadeIn("fast").find("a").on("click",function(i){void 0!==t(this).attr("target")?window.open(t(this).attr("href"),t(this).attr("target")):location.href=t(this).attr("href")})}if(this.album.length>1&&this.options.showImageNumberLabel){var n=this.imageCountLabel(this.currentImageIndex+1,this.album.length);this.$lightbox.find(".lb-number").text(n).fadeIn("fast")}else this.$lightbox.find(".lb-number").hide();this.$outerContainer.removeClass("animating"),this.$lightbox.find(".lb-dataContainer").fadeIn(this.options.resizeDuration,function(){return i.sizeOverlay()})},i.prototype.preloadNeighboringImages=function(){this.album.length>this.currentImageIndex+1&&((new Image).src=this.album[this.currentImageIndex+1].link);this.currentImageIndex>0&&((new Image).src=this.album[this.currentImageIndex-1].link)},i.prototype.enableKeyboardNav=function(){t(document).on("keyup.keyboard",t.proxy(this.keyboardAction,this))},i.prototype.disableKeyboardNav=function(){t(document).off(".keyboard")},i.prototype.keyboardAction=function(t){var i=t.keyCode,e=String.fromCharCode(i).toLowerCase();27===i||e.match(/x|o|c/)?this.end():"p"===e||37===i?0!==this.currentImageIndex?this.changeImage(this.currentImageIndex-1):this.options.wrapAround&&this.album.length>1&&this.changeImage(this.album.length-1):"n"!==e&&39!==i||(this.currentImageIndex!==this.album.length-1?this.changeImage(this.currentImageIndex+1):this.options.wrapAround&&this.album.length>1&&this.changeImage(0))},i.prototype.end=function(){this.disableKeyboardNav(),t(window).off("resize",this.sizeOverlay),this.$lightbox.fadeOut(this.options.fadeDuration),this.$overlay.fadeOut(this.options.fadeDuration),t("select, object, embed").css({visibility:"visible"}),this.options.disableScrolling&&t("html").removeClass("lb-disable-scrolling")},new i});
1
+ !function(t,i){"function"==typeof define&&define.amd?define(["jquery"],i):"object"==typeof exports?module.exports=i(require("jquery")):t.lightbox=i(t.jQuery)}(this,function(c){function t(t){this.album=[],this.currentImageIndex=void 0,this.init(),this.options=c.extend({},this.constructor.defaults),this.option(t)}return t.defaults={albumLabel:"Image %1 of %2",showNavigation:!0,showNavigationOnMobile:!1,fadeDuration:600,fitImagesInViewport:!0,imageFadeDuration:600,positionFromTop:50,resizeDuration:700,showImageNumberLabel:!0,wrapAround:!1,disableScrolling:!1,enableSwipeOnTouchDevices:!0,sanitizeTitle:!1},t.prototype.option=function(t){c.extend(this.options,t)},t.prototype.imageCountLabel=function(t,i){return this.options.albumLabel.replace(/%1/g,t).replace(/%2/g,i)},t.prototype.mobilecheck=function(){var t,i=!1;return t=navigator.userAgent||navigator.vendor||window.opera,(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(t)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(t.substr(0,4)))&&(i=!0),i},t.prototype.init=function(){var t=this;c(document).ready(function(){t.enable(),t.build()})},t.prototype.enable=function(){var i=this;c("body").on("click","a[rel^=lightbox], area[rel^=lightbox], a[data-lightbox], area[data-lightbox]",function(t){return i.start(c(t.currentTarget)),!1})},t.prototype.swipedetect=function(t,i){var n,o,a,r,s,h,e=t,l=i||function(t){};e.addEventListener("touchstart",function(t){var i=t.changedTouches[0];n="none",dist=0,o=i.pageX,a=i.pageY,h=(new Date).getTime(),t.preventDefault()},!1),e.addEventListener("touchmove",function(t){t.preventDefault()},!1),e.addEventListener("touchend",function(t){var i=t.changedTouches[0];if(r=i.pageX-o,s=i.pageY-a,(new Date).getTime()-h<=300&&(1<=Math.abs(r)&&Math.abs(s)<=100?n=r<0?"left":"right":1<=Math.abs(s)&&Math.abs(r)<=100&&(n=s<0?"up":"down")),"none"==n){var e=c(t.target);e.hasClass("lb-prev")?n="left":e.hasClass("lb-next")&&(n="right")}l(n),t.preventDefault()},!1)},t.prototype.build=function(){if(!(0<c("#lightbox").length)){var i=this;c('<div id="lightboxOverlay" class="lightboxOverlay"></div><div id="lightbox" class="lightbox"><div class="lb-outerContainer"><div class="lb-container"><img class="lb-image" src="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" /><div class="lb-nav"><a class="lb-prev" href="" ></a><a class="lb-next" href="" ></a></div><div class="lb-loader"><a class="lb-cancel"></a></div></div></div><div class="lb-dataContainer"><div class="lb-data"><div class="lb-details"><span class="lb-caption"></span><span class="lb-number"></span></div><div class="lb-closeContainer"><a class="lb-close"></a></div></div></div></div>').appendTo(c("body")),this.$lightbox=c("#lightbox"),this.$overlay=c("#lightboxOverlay"),this.$outerContainer=this.$lightbox.find(".lb-outerContainer"),this.$container=this.$lightbox.find(".lb-container"),this.$image=this.$lightbox.find(".lb-image"),this.$nav=this.$lightbox.find(".lb-nav"),this.containerPadding={top:parseInt(this.$container.css("padding-top"),10),right:parseInt(this.$container.css("padding-right"),10),bottom:parseInt(this.$container.css("padding-bottom"),10),left:parseInt(this.$container.css("padding-left"),10)},this.imageBorderWidth={top:parseInt(this.$image.css("border-top-width"),10),right:parseInt(this.$image.css("border-right-width"),10),bottom:parseInt(this.$image.css("border-bottom-width"),10),left:parseInt(this.$image.css("border-left-width"),10)},this.$overlay.hide().on("click",function(){return i.end(),jQuery(document).trigger("modula_lightbox2_lightbox_close"),!1}),this.$lightbox.hide().on("click",function(t){return"lightbox"===c(t.target).attr("id")&&(i.end(),jQuery(document).trigger("modula_lightbox2_lightbox_close")),!1}),this.$outerContainer.on("click",function(t){return"lightbox"===c(t.target).attr("id")&&(i.end(),jQuery(document).trigger("modula_lightbox2_lightbox_close")),!1}),this.$lightbox.find(".lb-prev").on("click",function(){return 0===i.currentImageIndex?i.changeImage(i.album.length-1):i.changeImage(i.currentImageIndex-1),setTimeout(function(){jQuery(document).trigger("modula_lightbox2_lightbox_prev",[i,i.currentImageIndex])},600),!1}),this.$lightbox.find(".lb-next").on("click",function(){return i.currentImageIndex===i.album.length-1?i.changeImage(0):i.changeImage(i.currentImageIndex+1),setTimeout(function(){jQuery(document).trigger("modula_lightbox2_lightbox_next",[i,i.currentImageIndex])},600),!1});var t=this.$lightbox.find(".lb-container")[0];i.swipedetect(t,function(t){"left"==t?i.currentImageIndex===i.album.length-1?i.changeImage(0):i.changeImage(i.currentImageIndex+1):"right"==t&&(0===i.currentImageIndex?i.changeImage(i.album.length-1):i.changeImage(i.currentImageIndex-1))}),this.$nav.on("mousedown",function(t){3===t.which&&(i.$nav.css("pointer-events","none"),i.$lightbox.one("contextmenu",function(){setTimeout(function(){this.$nav.css("pointer-events","auto")}.bind(i),0)}))}),this.$lightbox.find(".lb-loader, .lb-close").on("click",function(){return i.end(),jQuery(document).trigger("modula_lightbox2_lightbox_close"),!1})}},t.prototype.start=function(t){var i=this,e=c(window);e.on("resize",c.proxy(this.sizeOverlay,this)),c("select, object, embed").css({visibility:"hidden"}),this.sizeOverlay(),this.album=[];var n=0;function o(t){i.album.push({alt:t.attr("data-alt"),link:t.attr("href"),title:t.attr("data-title")||t.attr("title")})}var a,r,s=t.attr("data-lightbox");if(s){0<(r=(a=c(t.prop("tagName")+'[data-lightbox="'+s+'"]')).filter("[data-cyclefilter=show]")).length&&r.length!=a.length&&(a=r);for(var h=0;h<a.length;h=++h)o(c(a[h])),a[h]===t[0]&&(n=h)}else if("lightbox"===t.attr("rel"))o(t);else{0<(r=(a=c(t.prop("tagName")+'[rel="'+t.attr("rel")+'"]')).filter("[data-cyclefilter=show]")).length&&r.length!=a.length&&(a=r);for(var l=0;l<a.length;l=++l)o(c(a[l])),a[l]===t[0]&&(n=l)}var d=e.scrollTop()+this.options.positionFromTop,g=e.scrollLeft();this.$lightbox.css({top:d+"px",left:g+"px"}).fadeIn(this.options.fadeDuration),this.options.disableScrolling&&c("html").addClass("lb-disable-scrolling"),this.changeImage(n),setTimeout(function(){jQuery(document).trigger("modula_lightbox2_lightbox_open",[i,t])},600)},t.prototype.changeImage=function(r){var s=this;this.disableKeyboardNav();var h=this.$lightbox.find(".lb-image");this.$overlay.fadeIn(this.options.fadeDuration),c(".lb-loader").fadeIn("slow"),this.$lightbox.find(".lb-image, .lb-nav, .lb-prev, .lb-next, .lb-dataContainer, .lb-numbers, .lb-caption").hide(),this.$outerContainer.addClass("animating");var l=new Image;l.onload=function(){var t,i,e,n,o,a;h.attr({alt:s.album[r].alt,src:s.album[r].link}),c(l),h.width(l.width),h.height(l.height),s.options.fitImagesInViewport&&(a=c(window).width(),o=c(window).height(),n=a-s.containerPadding.left-s.containerPadding.right-s.imageBorderWidth.left-s.imageBorderWidth.right-20,e=o-s.containerPadding.top-s.containerPadding.bottom-s.imageBorderWidth.top-s.imageBorderWidth.bottom-120,s.options.maxWidth&&s.options.maxWidth<n&&(n=s.options.maxWidth),s.options.maxHeight&&s.options.maxHeight<n&&(e=s.options.maxHeight),(l.width>n||l.height>e)&&(l.width/n>l.height/e?(i=n,t=parseInt(l.height/(l.width/i),10)):(t=e,i=parseInt(l.width/(l.height/t),10)),h.width(i),h.height(t))),s.sizeContainer(h.width(),h.height())},l.src=this.album[r].link,this.currentImageIndex=r},t.prototype.sizeOverlay=function(){this.$overlay.width(c(document).width()).height(c(document).height())},t.prototype.sizeContainer=function(t,i){var e=this,n=this.$outerContainer.outerWidth(),o=this.$outerContainer.outerHeight(),a=t+this.containerPadding.left+this.containerPadding.right+this.imageBorderWidth.left+this.imageBorderWidth.right,r=i+this.containerPadding.top+this.containerPadding.bottom+this.imageBorderWidth.top+this.imageBorderWidth.bottom;function s(){e.$lightbox.find(".lb-dataContainer").width(a),e.$lightbox.find(".lb-prevLink").height(r),e.$lightbox.find(".lb-nextLink").height(r),e.showImage()}n!==a||o!==r?this.$outerContainer.animate({width:a,height:r},this.options.resizeDuration,"swing",function(){s()}):s()},t.prototype.showImage=function(){this.$lightbox.find(".lb-loader").stop(!0).hide(),this.$lightbox.find(".lb-image").fadeIn(this.options.imageFadeDuration),this.updateNav(),this.updateDetails(),this.preloadNeighboringImages(),this.enableKeyboardNav()},t.prototype.updateNav=function(){var t=!!this.options.showNavigation,i=!1;try{document.createEvent("TouchEvent"),!!this.options.enableSwipeOnTouchDevices,i=!0}catch(t){}this.mobilecheck()&&(t=!!this.options.showNavigationOnMobile),t?(this.$lightbox.find(".lb-nav").show(),1<this.album.length&&(this.options.wrapAround?(i&&this.$lightbox.find(".lb-prev, .lb-next").css("opacity","1"),this.$lightbox.find(".lb-prev, .lb-next").show()):(0<this.currentImageIndex&&(this.$lightbox.find(".lb-prev").show(),i&&this.$lightbox.find(".lb-prev").css("opacity","1")),this.currentImageIndex<this.album.length-1&&(this.$lightbox.find(".lb-next").show(),i&&this.$lightbox.find(".lb-next").css("opacity","1"))))):this.$lightbox.find(".lb-nav").hide()},t.prototype.updateDetails=function(){var t=this;if(void 0!==this.album[this.currentImageIndex].title&&""!==this.album[this.currentImageIndex].title){var i=this.$lightbox.find(".lb-caption");this.options.sanitizeTitle?i.text(this.album[this.currentImageIndex].title):i.html(this.album[this.currentImageIndex].title),i.fadeIn("fast").find("a").on("click",function(t){void 0!==c(this).attr("target")?window.open(c(this).attr("href"),c(this).attr("target")):location.href=c(this).attr("href")})}if(1<this.album.length&&this.options.showImageNumberLabel){var e=this.imageCountLabel(this.currentImageIndex+1,this.album.length);this.$lightbox.find(".lb-number").text(e).fadeIn("fast")}else this.$lightbox.find(".lb-number").hide();this.$outerContainer.removeClass("animating"),this.$lightbox.find(".lb-dataContainer").fadeIn(this.options.resizeDuration,function(){return t.sizeOverlay()})},t.prototype.preloadNeighboringImages=function(){this.album.length>this.currentImageIndex+1&&((new Image).src=this.album[this.currentImageIndex+1].link);0<this.currentImageIndex&&((new Image).src=this.album[this.currentImageIndex-1].link)},t.prototype.enableKeyboardNav=function(){c(document).on("keyup.keyboard",c.proxy(this.keyboardAction,this))},t.prototype.disableKeyboardNav=function(){c(document).off(".keyboard")},t.prototype.keyboardAction=function(t){var i=t.keyCode,e=String.fromCharCode(i).toLowerCase();27===i||e.match(/x|o|c/)?this.end():"p"===e||37===i?0!==this.currentImageIndex?this.changeImage(this.currentImageIndex-1):this.options.wrapAround&&1<this.album.length&&this.changeImage(this.album.length-1):"n"!==e&&39!==i||(this.currentImageIndex!==this.album.length-1?this.changeImage(this.currentImageIndex+1):this.options.wrapAround&&1<this.album.length&&this.changeImage(0))},t.prototype.end=function(){this.disableKeyboardNav(),c(window).off("resize",this.sizeOverlay),this.$lightbox.fadeOut(this.options.fadeDuration),this.$overlay.fadeOut(this.options.fadeDuration),c("select, object, embed").css({visibility:"visible"}),this.options.disableScrolling&&c("html").removeClass("lb-disable-scrolling")},new t});
assets/js/modula-elementor-editor.min.js ADDED
@@ -0,0 +1 @@
1
+ jQuery(function(e){elementor.hooks.addAction("panel/open_editor/widget/modula_elementor_gallery",function(e,t,a){search_input=e.$el.find('select[data-setting="modula_gallery_select"]');t.attributes.settings.attributes.modula_gallery_select;search_input.selectize({create:!1,maxItems:1,closeAfterSelect:!0,valueField:"ID",labelField:"post_title",searchField:"post_title",load:function(e,t){if(!e.length)return t();jQuery.ajax({url:modula_elementor_ajax.ajax_url,type:"POST",dataType:"json",data:{action:"modula_elementor_ajax_search",s:e},error:function(){t()},success:function(e){t(e.data)}})}})})});
assets/js/modula-troubleshoot-conditions.min.js ADDED
@@ -0,0 +1 @@
1
+ function mts_master_toggle(e){e?jQuery("tr.troubleshoot-subfield").show():jQuery("tr.troubleshoot-subfield").hide()}jQuery(document).ready(function(e){var t=jQuery("input#modula_troubleshooting_option-enqueue_files"),o=t.is(":checked");mts_master_toggle(o),t.on("change",function(){mts_master_toggle(o=t.is(":checked"))})});
assets/js/selectize.min.js ADDED
@@ -0,0 +1 @@
1
+ !function(t,e){"function"==typeof define&&define.amd?define("sifter",e):"object"==typeof exports?module.exports=e():t.Sifter=e()}(this,function(){function t(t,e){this.items=t,this.settings=e||{diacritics:!0}}t.prototype.tokenize=function(t){if(!(t=a(String(t||"").toLowerCase()))||!t.length)return[];var e,n,i,o,s=[],r=t.split(/ +/);for(e=0,n=r.length;e<n;e++){if(i=l(r[e]),this.settings.diacritics)for(o in p)p.hasOwnProperty(o)&&(i=i.replace(new RegExp(o,"g"),p[o]));s.push({string:r[e],regex:new RegExp(i,"i")})}return s},t.prototype.iterator=function(t,e){(r(t)?Array.prototype.forEach||function(t){for(var e=0,n=this.length;e<n;e++)t(this[e],e,this)}:function(t){for(var e in this)this.hasOwnProperty(e)&&t(this[e],e,this)}).apply(t,[e])},t.prototype.getScoreFunction=function(t,e){var o,s,r,a;t=this.prepareSearch(t,e),s=t.tokens,o=t.options.fields,r=s.length,a=t.options.nesting;function l(t,e){var n,i;return t?-1===(i=(t=String(t||"")).search(e.regex))?0:(n=e.string.length/t.length,0===i&&(n+=.5),n):0}var p,u=(p=o.length)?1===p?function(t,e){return l(g(e,o[0],a),t)}:function(t,e){for(var n=0,i=0;n<p;n++)i+=l(g(e,o[n],a),t);return i/p}:function(){return 0};return r?1===r?function(t){return u(s[0],t)}:"and"===t.options.conjunction?function(t){for(var e,n=0,i=0;n<r;n++){if((e=u(s[n],t))<=0)return 0;i+=e}return i/r}:function(t){for(var e=0,n=0;e<r;e++)n+=u(s[e],t);return n/r}:function(){return 0}},t.prototype.getSortFunction=function(t,n){var e,i,o,s,r,a,l,p,u,c,d;if(d=!(t=(o=this).prepareSearch(t,n)).query&&n.sort_empty||n.sort,u=function(t,e){return"$score"===t?e.score:g(o.items[e.id],t,n.nesting)},r=[],d)for(e=0,i=d.length;e<i;e++)!t.query&&"$score"===d[e].field||r.push(d[e]);if(t.query){for(c=!0,e=0,i=r.length;e<i;e++)if("$score"===r[e].field){c=!1;break}c&&r.unshift({field:"$score",direction:"desc"})}else for(e=0,i=r.length;e<i;e++)if("$score"===r[e].field){r.splice(e,1);break}for(p=[],e=0,i=r.length;e<i;e++)p.push("desc"===r[e].direction?-1:1);return(a=r.length)?1===a?(s=r[0].field,l=p[0],function(t,e){return l*h(u(s,t),u(s,e))}):function(t,e){var n,i,o;for(n=0;n<a;n++)if(o=r[n].field,i=p[n]*h(u(o,t),u(o,e)))return i;return 0}:null},t.prototype.prepareSearch=function(t,e){if("object"==typeof t)return t;var n=(e=s({},e)).fields,i=e.sort,o=e.sort_empty;return n&&!r(n)&&(e.fields=[n]),i&&!r(i)&&(e.sort=[i]),o&&!r(o)&&(e.sort_empty=[o]),{options:e,query:String(t||"").toLowerCase(),tokens:this.tokenize(t),total:0,items:[]}},t.prototype.search=function(t,n){var i,o,e,s,r=this;return o=this.prepareSearch(t,n),n=o.options,t=o.query,s=n.score||r.getScoreFunction(o),t.length?r.iterator(r.items,function(t,e){i=s(t),(!1===n.filter||0<i)&&o.items.push({score:i,id:e})}):r.iterator(r.items,function(t,e){o.items.push({score:1,id:e})}),(e=r.getSortFunction(o,n))&&o.items.sort(e),o.total=o.items.length,"number"==typeof n.limit&&(o.items=o.items.slice(0,n.limit)),o};var h=function(t,e){return"number"==typeof t&&"number"==typeof e?e<t?1:t<e?-1:0:(t=n(String(t||"")),(e=n(String(e||"")))<t?1:t<e?-1:0)},s=function(t,e){var n,i,o,s;for(n=1,i=arguments.length;n<i;n++)if(s=arguments[n])for(o in s)s.hasOwnProperty(o)&&(t[o]=s[o]);return t},g=function(t,e,n){if(t&&e){if(!n)return t[e];for(var i=e.split(".");i.length&&(t=t[i.shift()]););return t}},a=function(t){return(t+"").replace(/^\s+|\s+$|/g,"")},l=function(t){return(t+"").replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1")},r=Array.isArray||"undefined"!=typeof amp;&$.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},p={a:"[aḀḁĂăÂâǍǎȺⱥȦȧẠạÄäÀàÁáĀāÃãÅåąĄÃąĄ]",b:"[b␢βΒB฿𐌁ᛒ]",c:"[cĆćĈĉČčĊċC̄c̄ÇçḈḉȻȼƇƈɕᴄCc]",d:"[dĎďḊḋḐḑḌḍḒḓḎḏĐđD̦d̦ƉɖƊɗƋƌᵭᶁᶑȡᴅDdð]",e:"[eÉéÈèÊêḘḙĚěĔĕẼẽḚḛẺẻĖėËëĒēȨȩĘęᶒɆɇȄȅẾếỀềỄễỂểḜḝḖḗḔḕȆȇẸẹỆệⱸᴇEeɘǝƏƐε]",f:"[fƑƒḞḟ]",g:"[gɢ₲ǤǥĜĝĞğĢģƓɠĠġ]",h:"[hĤĥĦħḨḩẖẖḤḥḢḣɦʰǶƕ]",i:"[iÍíÌìĬĭÎîǏǐÏïḮḯĨĩĮįĪīỈỉȈȉȊȋỊịḬḭƗɨɨ̆ᵻᶖİiIıɪIi]",j:"[jȷĴĵɈɉʝɟʲ]",k:"[kƘƙꝀꝁḰḱǨǩḲḳḴḵκϰ₭]",l:"[lŁłĽľĻļĹĺḶḷḸḹḼḽḺḻĿŀȽƚⱠⱡⱢɫɬᶅɭȴʟLl]",n:"[nŃńǸǹŇňÑñṄṅŅņṆṇṊṋṈṉN̈n̈ƝɲȠƞᵰᶇɳȵɴNnŊŋ]",o:"[oØøÖöÓóÒòÔôǑǒŐőŎŏȮȯỌọƟɵƠơỎỏŌōÕõǪǫȌȍՕօ]",p:"[pṔṕṖṗⱣᵽƤƥᵱ]",q:"[qꝖꝗʠɊɋꝘꝙq̃]",r:"[rŔŕɌɍŘřŖŗṘṙȐȑȒȓṚṛⱤɽ]",s:"[sŚśṠṡṢṣꞨꞩŜŝŠšŞşȘșS̈s̈]",t:"[tŤťṪṫŢţṬṭƮʈȚțṰṱṮṯƬƭ]",u:"[uŬŭɄʉỤụÜüÚúÙùÛûǓǔŰűŬŭƯưỦủŪūŨũŲųȔȕ∪]",v:"[vṼṽṾṿƲʋꝞꝟⱱʋ]",w:"[wẂẃẀẁŴŵẄẅẆẇẈẉ]",x:"[xẌẍẊẋχ]",y:"[yÝýỲỳŶŷŸÿỸỹẎẏỴỵɎɏƳƴ]",z:"[zŹźẐẑŽžŻżẒẓẔẕƵƶ]"},n=function(){var t,e,n,i,o="",s={};for(n in p)if(p.hasOwnProperty(n))for(o+=i=p[n].substring(2,p[n].length-1),t=0,e=i.length;t<e;t++)s[i.charAt(t)]=n;var r=new RegExp("["+o+"]","g");return function(t){return t.replace(r,function(t){return s[t]}).toLowerCase()}}();return t}),function(t,e){"function"==typeof define&&define.amd?define("microplugin",e):"object"==typeof exports?module.exports=e():t.MicroPlugin=e()}(this,function(){var t={mixin:function(i){i.plugins={},i.prototype.initializePlugins=function(t){var e,n,i,o=[];if(this.plugins={names:[],settings:{},requested:{},loaded:{}},s.isArray(t))for(e=0,n=t.length;e<n;e++)"string"==typeof t[e]?o.push(t[e]):(this.plugins.settings[t[e].name]=t[e].options,o.push(t[e].name));else if(t)for(i in t)t.hasOwnProperty(i)&&(this.plugins.settings[i]=t[i],o.push(i));for(;o.length;)this.require(o.shift())},i.prototype.loadPlugin=function(t){var e=this.plugins,n=i.plugins[t];if(!i.plugins.hasOwnProperty(t))throw new Error('Unable to find "'+t+'" plugin');e.requested[t]=!0,e.loaded[t]=n.fn.apply(this,[this.plugins.settings[t]||{}]),e.names.push(t)},i.prototype.require=function(t){var e=this.plugins;if(!this.plugins.loaded.hasOwnProperty(t)){if(e.requested[t])throw new Error('Plugin has circular dependency ("'+t+'")');this.loadPlugin(t)}return e.loaded[t]},i.define=function(t,e){i.plugins[t]={name:t,fn:e}}}},s={isArray:Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)}};return t}),function(t,e){"function"==typeof define&&define.amd?define("selectize",["jquery","sifter","microplugin"],e):"object"==typeof exports?module.exports=e(require("jquery"),require("sifter"),require("microplugin")):t.Selectize=e(t.jQuery,t.Sifter,t.MicroPlugin)}(this,function(x,l,t){"use strict";function S(t,e){if("string"!=typeof e||e.length){var l="string"==typeof e?new RegExp(e,"i"):e,p=function(t){var e=0;if(3===t.nodeType){var n=t.data.search(l);if(0<=n&&0<t.data.length){var i=t.data.match(l),o=document.createElement("span");o.className="highlight";var s=t.splitText(n),r=(s.splitText(i[0].length),s.cloneNode(!0));o.appendChild(r),s.parentNode.replaceChild(o,s),e=1}}else if(1===t.nodeType&&t.childNodes&&!/(script|style)/i.test(t.tagName)&&("highlight"!==t.className||"SPAN"!==t.tagName))for(var a=0;a<t.childNodes.length;++a)a+=p(t.childNodes[a]);return e};return t.each(function(){p(this)})}}x.fn.removeHighlight=function(){return this.find("span.highlight").each(function(){this.parentNode.firstChild.nodeName;var t=this.parentNode;t.replaceChild(this.firstChild,this),t.normalize()}).end()};function i(){}i.prototype={on:function(t,e){this._events=this._events||{},this._events[t]=this._events[t]||[],this._events[t].push(e)},off:function(t,e){var n=arguments.length;return 0===n?delete this._events:1===n?delete this._events[t]:(this._events=this._events||{},void(t in this._events!=!1&&this._events[t].splice(this._events[t].indexOf(e),1)))},trigger:function(t){if(this._events=this._events||{},t in this._events!=!1)for(var e=0;e<this._events[t].length;e++)this._events[t][e].apply(this,Array.prototype.slice.call(arguments,1))}},i.mixin=function(t){for(var e=["on","off","trigger"],n=0;n<e.length;n++)t.prototype[e[n]]=i.prototype[e[n]]};function p(t){return void 0!==t}function I(t){return null==t?null:"boolean"==typeof t?t?"1":"0":t+""}function a(t){return(t+"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function n(e,n,t){var i,o=e.trigger,s={};for(i in e.trigger=function(){var t=arguments[0];if(-1===n.indexOf(t))return o.apply(e,arguments);s[t]=arguments},t.apply(e,[]),e.trigger=o,s)s.hasOwnProperty(i)&&o.apply(e,s[i])}function d(t){var e={};if("selectionStart"in t)e.start=t.selectionStart,e.length=t.selectionEnd-e.start;else if(document.selection){t.focus();var n=document.selection.createRange(),i=document.selection.createRange().text.length;n.moveStart("character",-t.value.length),e.start=n.text.length-i,e.length=i}return e}function m(u){function t(t,e){var n,i,o,s,r,a,l,p;e=e||{},(t=t||window.event||{}).metaKey||t.altKey||!e.force&&!1===u.data("grow")||(n=u.val(),t.type&&"keydown"===t.type.toLowerCase()&&(o=48<=(i=t.keyCode)&&i<=57||65<=i&&i<=90||96<=i&&i<=111||186<=i&&i<=222||32===i,46===i||8===i?(p=d(u[0])).length?n=n.substring(0,p.start)+n.substring(p.start+p.length):8===i&&p.start?n=n.substring(0,p.start-1)+n.substring(p.start+1):46===i&&void 0!==p.start&&(n=n.substring(0,p.start)+n.substring(p.start+1)):o&&(a=t.shiftKey,l=String.fromCharCode(t.keyCode),n+=l=a?l.toUpperCase():l.toLowerCase())),s=u.attr("placeholder"),!n&&s&&(n=s),(r=function(t,e){return t?(C.$testInput||(C.$testInput=x("<span />").css({position:"absolute",top:-99999,left:-99999,width:"auto",padding:0,whiteSpace:"pre"}).appendTo("body")),C.$testInput.text(t),function(t,e,n){var i,o,s={};if(n)for(i=0,o=n.length;i<o;i++)s[n[i]]=t.css(n[i]);else s=t.css();e.css(s)}(e,C.$testInput,["letterSpacing","fontSize","fontFamily","fontWeight","textTransform"]),C.$testInput.width()):0}(n,u)+4)!==c&&(c=r,u.width(r),u.triggerHandler("resize")))}var c=null;u.on("keydown keyup update blur",t),t()}var y=/Mac/.test(navigator.userAgent),w=y?91:17,O=y?18:17,$=!/android/i.test(window.navigator.userAgent)&&!!document.createElement("input").validity,e={before:function(t,e,n){var i=t[e];t[e]=function(){return n.apply(t,arguments),i.apply(t,arguments)}},after:function(e,t,n){var i=e[t];e[t]=function(){var t=i.apply(e,arguments);return n.apply(e,arguments),t}}},C=function(t,e){var n,i,o,s,r=this;(s=t[0]).selectize=r;var a=window.getComputedStyle&&window.getComputedStyle(s,null);if(o=(o=a?a.getPropertyValue("direction"):s.currentStyle&&s.currentStyle.direction)||t.parents("[dir]:first").attr("dir")||"",x.extend(r,{order:0,settings:e,$input:t,tabIndex:t.attr("tabindex")||"",tagType:"select"===s.tagName.toLowerCase()?1:2,rtl:/rtl/i.test(o),eventNS:".selectize"+ ++C.count,highlightedValue:null,isBlurring:!1,isOpen:!1,isDisabled:!1,isRequired:t.is("[required]"),isInvalid:!1,isLocked:!1,isFocused:!1,isInputHidden:!1,isSetup:!1,isShiftDown:!1,isCmdDown:!1,isCtrlDown:!1,ignoreFocus:!1,ignoreBlur:!1,ignoreHover:!1,hasOptions:!1,currentResults:null,lastValue:"",caretPos:0,loading:0,loadedSearches:{},$activeOption:null,$activeItems:[],optgroups:{},options:{},userOptions:{},items:[],renderCache:{},onSearchChange:null===e.loadThrottle?r.onSearchChange:function(n,i){var o;return function(){var t=this,e=arguments;window.clearTimeout(o),o=window.setTimeout(function(){n.apply(t,e)},i)}}(r.onSearchChange,e.loadThrottle)}),r.sifter=new l(this.options,{diacritics:e.diacritics}),r.settings.options){for(n=0,i=r.settings.options.length;n<i;n++)r.registerOption(r.settings.options[n]);delete r.settings.options}if(r.settings.optgroups){for(n=0,i=r.settings.optgroups.length;n<i;n++)r.registerOptionGroup(r.settings.optgroups[n]);delete r.settings.optgroups}r.settings.mode=r.settings.mode||(1===r.settings.maxItems?"single":"multi"),"boolean"!=typeof r.settings.hideSelected&&(r.settings.hideSelected="multi"===r.settings.mode),r.initializePlugins(r.settings.plugins),r.setupCallbacks(),r.setupTemplates(),r.setup()};return i.mixin(C),void 0!==t?t.mixin(C):function(t,e){e=e||{};console.error("Selectize: "+t),e.explanation&&(console.group&&console.group(),console.error(e.explanation),console.group&&console.groupEnd())}("Dependency MicroPlugin is missing",{explanation:'Make sure you either: (1) are using the "standalone" version of Selectize, or (2) require MicroPlugin before you load Selectize.'}),x.extend(C.prototype,{setup:function(){var t,e,n,i,o,s,r,a,l,p,u=this,c=u.settings,d=u.eventNS,h=x(window),g=x(document),f=u.$input;if(r=u.settings.mode,a=f.attr("class")||"",t=x("<div>").addClass(c.wrapperClass).addClass(a).addClass(r),e=x("<div>").addClass(c.inputClass).addClass("items").appendTo(t),n=x('<input type="text" autocomplete="off" />').appendTo(e).attr("tabindex",f.is(":disabled")?"-1":u.tabIndex),s=x(c.dropdownParent||t),i=x("<div>").addClass(c.dropdownClass).addClass(r).hide().appendTo(s),o=x("<div>").addClass(c.dropdownContentClass).appendTo(i),(p=f.attr("id"))&&(n.attr("id",p+"-selectized"),x("label[for='"+p+"']").attr("for",p+"-selectized")),u.settings.copyClassesToDropdown&&i.addClass(a),t.css({width:f[0].style.width}),u.plugins.names.length&&(l="plugin-"+u.plugins.names.join(" plugin-"),t.addClass(l),i.addClass(l)),(null===c.maxItems||1<c.maxItems)&&1===u.tagType&&f.attr("multiple","multiple"),u.settings.placeholder&&n.attr("placeholder",c.placeholder),!u.settings.splitOn&&u.settings.delimiter){var v=u.settings.delimiter.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\amp;");u.settings.splitOn=new RegExp("\\s*"+v+"+\\s*")}f.attr("autocorrect")&&n.attr("autocorrect",f.attr("autocorrect")),f.attr("autocapitalize")&&n.attr("autocapitalize",f.attr("autocapitalize")),n[0].type=f[0].type,u.$wrapper=t,u.$control=e,u.$control_input=n,u.$dropdown=i,u.$dropdown_content=o,i.on("mouseenter mousedown click","[data-disabled]>[data-selectable]",function(t){t.stopImmediatePropagation()}),i.on("mouseenter","[data-selectable]",function(){return u.onOptionHover.apply(u,arguments)}),i.on("mousedown click","[data-selectable]",function(){return u.onOptionSelect.apply(u,arguments)}),function(n,t,e,i){n.on(t,e,function(t){for(var e=t.target;e&&e.parentNode!==n[0];)e=e.parentNode;return t.currentTarget=e,i.apply(this,[t])})}(e,"mousedown","*:not(input)",function(){return u.onItemSelect.apply(u,arguments)}),m(n),e.on({mousedown:function(){return u.onMouseDown.apply(u,arguments)},click:function(){return u.onClick.apply(u,arguments)}}),n.on({mousedown:function(t){t.stopPropagation()},keydown:function(){return u.onKeyDown.apply(u,arguments)},keyup:function(){return u.onKeyUp.apply(u,arguments)},keypress:function(){return u.onKeyPress.apply(u,arguments)},resize:function(){u.positionDropdown.apply(u,[])},blur:function(){return u.onBlur.apply(u,arguments)},focus:function(){return u.ignoreBlur=!1,u.onFocus.apply(u,arguments)},paste:function(){return u.onPaste.apply(u,arguments)}}),g.on("keydown"+d,function(t){u.isCmdDown=t[y?"metaKey":"ctrlKey"],u.isCtrlDown=t[y?"altKey":"ctrlKey"],u.isShiftDown=t.shiftKey}),g.on("keyup"+d,function(t){t.keyCode===O&&(u.isCtrlDown=!1),16===t.keyCode&&(u.isShiftDown=!1),t.keyCode===w&&(u.isCmdDown=!1)}),g.on("mousedown"+d,function(t){if(u.isFocused){if(t.target===u.$dropdown[0]||t.target.parentNode===u.$dropdown[0])return!1;u.$control.has(t.target).length||t.target===u.$control[0]||u.blur(t.target)}}),h.on(["scroll"+d,"resize"+d].join(" "),function(){u.isOpen&&u.positionDropdown.apply(u,arguments)}),h.on("mousemove"+d,function(){u.ignoreHover=!1}),this.revertSettings={$children:f.children().detach(),tabindex:f.attr("tabindex")},f.attr("tabindex",-1).hide().after(u.$wrapper),x.isArray(c.items)&&(u.setValue(c.items),delete c.items),amp;&f.on("invalid"+d,function(t){t.preventDefault(),u.isInvalid=!0,u.refreshState()}),u.updateOriginalInput(),u.refreshItems(),u.refreshState(),u.updatePlaceholder(),u.isSetup=!0,f.is(":disabled")&&u.disable(),u.on("change",this.onChange),f.data("selectize",u),f.addClass("selectized"),u.trigger("initialize"),!0===c.preload&&u.onSearchChange("")},setupTemplates:function(){var n=this.settings.labelField,i=this.settings.optgroupLabelField,t={optgroup:function(t){return'<div class="optgroup">'+t.html+"</div>"},optgroup_header:function(t,e){return'<div class="optgroup-header">'+e(t[i])+"</div>"},option:function(t,e){return'<div class="option">'+e(t[n])+"</div>"},item:function(t,e){return'<div class="item">'+e(t[n])+"</div>"},option_create:function(t,e){return'<div class="create">Add <strong>'+e(t.input)+"</strong>&hellip;</div>"}};this.settings.render=x.extend({},t,this.settings.render)},setupCallbacks:function(){var t,e,n={initialize:"onInitialize",change:"onChange",item_add:"onItemAdd",item_remove:"onItemRemove",clear:"onClear",option_add:"onOptionAdd",option_remove:"onOptionRemove",option_clear:"onOptionClear",optgroup_add:"onOptionGroupAdd",optgroup_remove:"onOptionGroupRemove",optgroup_clear:"onOptionGroupClear",dropdown_open:"onDropdownOpen",dropdown_close:"onDropdownClose",type:"onType",load:"onLoad",focus:"onFocus",blur:"onBlur"};for(t in n)n.hasOwnProperty(t)&&(e=this.settings[n[t]])&&this.on(t,e)},onClick:function(t){this.isFocused&&this.isOpen||(this.focus(),t.preventDefault())},onMouseDown:function(t){var e=this,n=t.isDefaultPrevented();x(t.target);if(e.isFocused){if(t.target!==e.$control_input[0])return"single"===e.settings.mode?e.isOpen?e.close():e.open():n||e.setActiveItem(null),!1}else n||window.setTimeout(function(){e.focus()},0)},onChange:function(){this.$input.trigger("change")},onPaste:function(t){var o=this;o.isFull()||o.isInputHidden||o.isLocked?t.preventDefault():o.settings.splitOn&&setTimeout(function(){var t=o.$control_input.val();if(t.match(o.settings.splitOn))for(var e=x.trim(t).split(o.settings.splitOn),n=0,i=e.length;n<i;n++)o.createItem(e[n])},0)},onKeyPress:function(t){if(this.isLocked)return t&&t.preventDefault();var e=String.fromCharCode(t.keyCode||t.which);return this.settings.create&&"multi"===this.settings.mode&&e===this.settings.delimiter?(this.createItem(),t.preventDefault(),!1):void 0},onKeyDown:function(t){t.target,this.$control_input[0];var e=this;if(e.isLocked)9!==t.keyCode&&t.preventDefault();else{switch(t.keyCode){case 65:if(e.isCmdDown)return void e.selectAll();break;case 27:return void(e.isOpen&&(t.preventDefault(),t.stopPropagation(),e.close()));case 78:if(!t.ctrlKey||t.altKey)break;case 40:if(!e.isOpen&&e.hasOptions)e.open();else if(e.$activeOption){e.ignoreHover=!0;var n=e.getAdjacentOption(e.$activeOption,1);n.length&&e.setActiveOption(n,!0,!0)}return void t.preventDefault();case 80:if(!t.ctrlKey||t.altKey)break;case 38:if(e.$activeOption){e.ignoreHover=!0;var i=e.getAdjacentOption(e.$activeOption,-1);i.length&&e.setActiveOption(i,!0,!0)}return void t.preventDefault();case 13:return void(e.isOpen&&e.$activeOption&&(e.onOptionSelect({currentTarget:e.$activeOption}),t.preventDefault()));case 37:return void e.advanceSelection(-1,t);case 39:return void e.advanceSelection(1,t);case 9:return e.settings.selectOnTab&&e.isOpen&&e.$activeOption&&(e.onOptionSelect({currentTarget:e.$activeOption}),e.isFull()||t.preventDefault()),void(e.settings.create&&e.createItem()&&t.preventDefault());case 8:case 46:return void e.deleteSelection(t)}!e.isFull()&&!e.isInputHidden||(y?t.metaKey:t.ctrlKey)||t.preventDefault()}},onKeyUp:function(t){var e=this;if(e.isLocked)return t&&t.preventDefault();var n=e.$control_input.val()||"";e.lastValue!==n&&(e.lastValue=n,e.onSearchChange(n),e.refreshOptions(),e.trigger("type",n))},onSearchChange:function(e){var n=this,i=n.settings.load;i&&(n.loadedSearches.hasOwnProperty(e)||(n.loadedSearches[e]=!0,n.load(function(t){i.apply(n,[e,t])})))},onFocus:function(t){var e=this,n=e.isFocused;if(e.isDisabled)return e.blur(),t&&t.preventDefault(),!1;e.ignoreFocus||(e.isFocused=!0,"focus"===e.settings.preload&&e.onSearchChange(""),n||e.trigger("focus"),e.$activeItems.length||(e.showInput(),e.setActiveItem(null),e.refreshOptions(!!e.settings.openOnFocus)),e.refreshState())},onBlur:function(t,e){var n=this;if(n.isFocused&&(n.isFocused=!1,!n.ignoreFocus)){if(!n.ignoreBlur&&document.activeElement===n.$dropdown_content[0])return n.ignoreBlur=!0,void n.onFocus(t);var i=function(){n.close(),n.setTextboxValue(""),n.setActiveItem(null),n.setActiveOption(null),n.setCaret(n.items.length),n.refreshState(),e&&e.focus&&e.focus(),n.isBlurring=!1,n.ignoreFocus=!1,n.trigger("blur")};n.isBlurring=!0,n.ignoreFocus=!0,n.settings.create&&n.settings.createOnBlur?n.createItem(null,!1,i):i()}},onOptionHover:function(t){this.ignoreHover||this.setActiveOption(t.currentTarget,!1)},onOptionSelect:function(t){var e,n,i=this;t.preventDefault&&(t.preventDefault(),t.stopPropagation()),(n=x(t.currentTarget)).hasClass("create")?i.createItem(null,function(){i.settings.closeAfterSelect&&i.close()}):void 0!==(e=n.attr("data-value"))&&(i.lastQuery=null,i.setTextboxValue(""),i.addItem(e),i.settings.closeAfterSelect?i.close():!i.settings.hideSelected&&t.type&&/mouse/.test(t.type)&&i.setActiveOption(i.getOption(e)))},onItemSelect:function(t){this.isLocked||"multi"===this.settings.mode&&(t.preventDefault(),this.setActiveItem(t.currentTarget,t))},load:function(t){var e=this,n=e.$wrapper.addClass(e.settings.loadingClass);e.loading++,t.apply(e,[function(t){e.loading=Math.max(e.loading-1,0),t&&t.length&&(e.addOption(t),e.refreshOptions(e.isFocused&&!e.isInputHidden)),e.loading||n.removeClass(e.settings.loadingClass),e.trigger("load",t)}])},setTextboxValue:function(t){var e=this.$control_input;e.val()!==t&&(e.val(t).triggerHandler("update"),this.lastValue=t)},getValue:function(){return 1===this.tagType&&this.$input.attr("multiple")?this.items:this.items.join(this.settings.delimiter)},setValue:function(t,e){n(this,e?[]:["change"],function(){this.clear(e),this.addItems(t,e)})},setActiveItem:function(t,e){var n,i,o,s,r,a,l,p,u=this;if("single"!==u.settings.mode){if(!(t=x(t)).length)return x(u.$activeItems).removeClass("active"),u.$activeItems=[],void(u.isFocused&&u.showInput());if("mousedown"===(n=e&&e.type.toLowerCase())&&u.isShiftDown&&u.$activeItems.length){for(p=u.$control.children(".active:last"),s=Array.prototype.indexOf.apply(u.$control[0].childNodes,[p[0]]),(r=Array.prototype.indexOf.apply(u.$control[0].childNodes,[t[0]]))<s&&(l=s,s=r,r=l),i=s;i<=r;i++)a=u.$control[0].childNodes[i],-1===u.$activeItems.indexOf(a)&&(x(a).addClass("active"),u.$activeItems.push(a));e.preventDefault()}else"mousedown"===n&&u.isCtrlDown||"keydown"===n&&this.isShiftDown?t.hasClass("active")?(o=u.$activeItems.indexOf(t[0]),u.$activeItems.splice(o,1),t.removeClass("active")):u.$activeItems.push(t.addClass("active")[0]):(x(u.$activeItems).removeClass("active"),u.$activeItems=[t.addClass("active")[0]]);u.hideInput(),this.isFocused||u.focus()}},setActiveOption:function(t,e,n){var i,o,s,r,a,l=this;l.$activeOption&&l.$activeOption.removeClass("active"),l.$activeOption=null,(t=x(t)).length&&(l.$activeOption=t.addClass("active"),!e&&p(e)||(i=l.$dropdown_content.height(),o=l.$activeOption.outerHeight(!0),e=l.$dropdown_content.scrollTop()||0,a=(r=s=l.$activeOption.offset().top-l.$dropdown_content.offset().top+e)-i+o,i+e<s+o?l.$dropdown_content.stop().animate({scrollTop:a},n?l.settings.scrollDuration:0):s<e&&l.$dropdown_content.stop().animate({scrollTop:r},n?l.settings.scrollDuration:0)))},selectAll:function(){var t=this;"single"!==t.settings.mode&&(t.$activeItems=Array.prototype.slice.apply(t.$control.children(":not(input)").addClass("active")),t.$activeItems.length&&(t.hideInput(),t.close()),t.focus())},hideInput:function(){this.setTextboxValue(""),this.$control_input.css({opacity:0,position:"absolute",left:this.rtl?1e4:-1e4}),this.isInputHidden=!0},showInput:function(){this.$control_input.css({opacity:1,position:"relative",left:0}),this.isInputHidden=!1},focus:function(){var t=this;t.isDisabled||(t.ignoreFocus=!0,t.$control_input[0].focus(),window.setTimeout(function(){t.ignoreFocus=!1,t.onFocus()},0))},blur:function(t){this.$control_input[0].blur(),this.onBlur(null,t)},getScoreFunction:function(t){return this.sifter.getScoreFunction(t,this.getSearchOptions())},getSearchOptions:function(){var t=this.settings,e=t.sortField;return"string"==typeof e&&(e=[{field:e}]),{fields:t.searchField,conjunction:t.searchConjunction,sort:e,nesting:t.nesting}},search:function(t){var e,n,i,o=this,s=o.settings,r=this.getSearchOptions();if(s.score&&"function"!=typeof(i=o.settings.score.apply(this,[t])))throw new Error('Selectize "score" setting must be a function that returns a function');if(t!==o.lastQuery?(o.lastQuery=t,n=o.sifter.search(t,x.extend(r,{score:i})),o.currentResults=n):n=x.extend(!0,{},o.currentResults),s.hideSelected)for(e=n.items.length-1;0<=e;e--)-1!==o.items.indexOf(I(n.items[e].id))&&n.items.splice(e,1);return n},refreshOptions:function(t){var e,n,i,o,s,r,a,l,p,u,c,d,h,g,f,v;void 0===t&&(t=!0);var m,y,w=this,O=x.trim(w.$control_input.val()),$=w.search(O),C=w.$dropdown_content,b=w.$activeOption&&I(w.$activeOption.attr("data-value"));for(o=$.items.length,"number"==typeof w.settings.maxOptions&&(o=Math.min(o,w.settings.maxOptions)),s={},r=[],e=0;e<o;e++)for(a=w.options[$.items[e].id],l=w.render("option",a),p=a[w.settings.optgroupField]||"",n=0,i=(u=x.isArray(p)?p:[p])&&u.length;n<i;n++)p=u[n],w.optgroups.hasOwnProperty(p)||(p=""),s.hasOwnProperty(p)||(s[p]=document.createDocumentFragment(),r.push(p)),s[p].appendChild(l);for(this.settings.lockOptgroupOrder&&r.sort(function(t,e){return(w.optgroups[t].$order||0)-(w.optgroups[e].$order||0)}),c=document.createDocumentFragment(),e=0,o=r.length;e<o;e++)p=r[e],w.optgroups.hasOwnProperty(p)&&s[p].childNodes.length?((d=document.createDocumentFragment()).appendChild(w.render("optgroup_header",w.optgroups[p])),d.appendChild(s[p]),c.appendChild(w.render("optgroup",x.extend({},w.optgroups[p],{html:(m=d,y=void 0,y=document.createElement("div"),y.appendChild(m.cloneNode(!0)),y.innerHTML),dom:d})))):c.appendChild(s[p]);if(C.html(c),w.settings.highlight&&(C.removeHighlight(),$.query.length&&$.tokens.length))for(e=0,o=$.tokens.length;e<o;e++)S(C,$.tokens[e].regex);if(!w.settings.hideSelected)for(e=0,o=w.items.length;e<o;e++)w.getOption(w.items[e]).addClass("selected");(h=w.canCreate(O))&&(C.prepend(w.render("option_create",{input:O})),v=x(C[0].childNodes[0])),w.hasOptions=0<$.items.length||h,w.hasOptions?(0<$.items.length?((f=b&&w.getOption(b))&&f.length?g=f:"single"===w.settings.mode&&w.items.length&&(g=w.getOption(w.items[0])),g&&g.length||(g=v&&!w.settings.addPrecedence?w.getAdjacentOption(v,1):C.find("[data-selectable]:first"))):g=v,w.setActiveOption(g),t&&!w.isOpen&&w.open()):(w.setActiveOption(null),t&&w.isOpen&&w.close())},addOption:function(t){var e,n,i,o=this;if(x.isArray(t))for(e=0,n=t.length;e<n;e++)o.addOption(t[e]);else(i=o.registerOption(t))&&(o.userOptions[i]=!0,o.lastQuery=null,o.trigger("option_add",i,t))},registerOption:function(t){var e=I(t[this.settings.valueField]);return null!=e&&!this.options.hasOwnProperty(e)&&(t.$order=t.$order||++this.order,this.options[e]=t,e)},registerOptionGroup:function(t){var e=I(t[this.settings.optgroupValueField]);return!!e&&(t.$order=t.$order||++this.order,this.optgroups[e]=t,e)},addOptionGroup:function(t,e){e[this.settings.optgroupValueField]=t,(t=this.registerOptionGroup(e))&&this.trigger("optgroup_add",t,e)},removeOptionGroup:function(t){this.optgroups.hasOwnProperty(t)&&(delete this.optgroups[t],this.renderCache={},this.trigger("optgroup_remove",t))},clearOptionGroups:function(){this.optgroups={},this.renderCache={},this.trigger("optgroup_clear")},updateOption:function(t,e){var n,i,o,s,r,a,l,p=this;if(t=I(t),o=I(e[p.settings.valueField]),null!==t&&p.options.hasOwnProperty(t)){if("string"!=typeof o)throw new Error("Value must be set in option data");l=p.options[t].$order,o!==t&&(delete p.options[t],-1!==(s=p.items.indexOf(t))&&p.items.splice(s,1,o)),e.$order=e.$order||l,p.options[o]=e,r=p.renderCache.item,a=p.renderCache.option,r&&(delete r[t],delete r[o]),a&&(delete a[t],delete a[o]),-1!==p.items.indexOf(o)&&(n=p.getItem(t),i=x(p.render("item",e)),n.hasClass("active")&&i.addClass("active"),n.replaceWith(i)),p.lastQuery=null,p.isOpen&&p.refreshOptions(!1)}},removeOption:function(t,e){var n=this;t=I(t);var i=n.renderCache.item,o=n.renderCache.option;i&&delete i[t],o&&delete o[t],delete n.userOptions[t],delete n.options[t],n.lastQuery=null,n.trigger("option_remove",t),n.removeItem(t,e)},clearOptions:function(){var n=this;n.loadedSearches={},n.userOptions={},n.renderCache={};var i=n.options;x.each(n.options,function(t,e){-1==n.items.indexOf(t)&&delete i[t]}),n.options=n.sifter.items=i,n.lastQuery=null,n.trigger("option_clear")},getOption:function(t){return this.getElementWithValue(t,this.$dropdown_content.find("[data-selectable]"))},getAdjacentOption:function(t,e){var n=this.$dropdown.find("[data-selectable]"),i=n.index(t)+e;return 0<=i&&i<n.length?n.eq(i):x()},getElementWithValue:function(t,e){if(null!=(t=I(t)))for(var n=0,i=e.length;n<i;n++)if(e[n].getAttribute("data-value")===t)return x(e[n]);return x()},getItem:function(t){return this.getElementWithValue(t,this.$control.children())},addItems:function(t,e){this.buffer=document.createDocumentFragment();for(var n=this.$control[0].childNodes,i=0;i<n.length;i++)this.buffer.appendChild(n[i]);for(var o=x.isArray(t)?t:[t],s=(i=0,o.length);i<s;i++)this.isPending=i<s-1,this.addItem(o[i],e);var r=this.$control[0];r.insertBefore(this.buffer,r.firstChild),this.buffer=null},addItem:function(a,l){n(this,l?[]:["change"],function(){var t,e,n,i,o,s=this,r=s.settings.mode;a=I(a),-1===s.items.indexOf(a)?s.options.hasOwnProperty(a)&&("single"===r&&s.clear(l),"multi"===r&&s.isFull()||(t=x(s.render("item",s.options[a])),o=s.isFull(),s.items.splice(s.caretPos,0,a),s.insertAtCaret(t),s.isPending&&(o||!s.isFull())||s.refreshState(),s.isSetup&&(n=s.$dropdown_content.find("[data-selectable]"),s.isPending||(e=s.getOption(a),i=s.getAdjacentOption(e,1).attr("data-value"),s.refreshOptions(s.isFocused&&"single"!==r),i&&s.setActiveOption(s.getOption(i))),!n.length||s.isFull()?s.close():s.isPending||s.positionDropdown(),s.updatePlaceholder(),s.trigger("item_add",a,t),s.isPending||s.updateOriginalInput({silent:l})))):"single"===r&&s.close()})},removeItem:function(t,e){var n,i,o,s=this;n=t instanceof x?t:s.getItem(t),t=I(n.attr("data-value")),-1!==(i=s.items.indexOf(t))&&(n.remove(),n.hasClass("active")&&(o=s.$activeItems.indexOf(n[0]),s.$activeItems.splice(o,1)),s.items.splice(i,1),s.lastQuery=null,!s.settings.persist&&s.userOptions.hasOwnProperty(t)&&s.removeOption(t,e),i<s.caretPos&&s.setCaret(s.caretPos-1),s.refreshState(),s.updatePlaceholder(),s.updateOriginalInput({silent:e}),s.positionDropdown(),s.trigger("item_remove",t,n))},createItem:function(t,n){var i=this,o=i.caretPos;t=t||x.trim(i.$control_input.val()||"");var s=arguments[arguments.length-1];if("function"!=typeof s&&(s=function(){}),"boolean"!=typeof n&&(n=!0),!i.canCreate(t))return s(),!1;i.lock();var e="function"==typeof i.settings.create?this.settings.create:function(t){var e={};return e[i.settings.labelField]=t,e[i.settings.valueField]=t,e},r=function(t){var e=!1;return function(){e||(e=!0,t.apply(this,arguments))}}(function(t){if(i.unlock(),!t||"object"!=typeof t)return s();var e=I(t[i.settings.valueField]);if("string"!=typeof e)return s();i.setTextboxValue(""),i.addOption(t),i.setCaret(o),i.addItem(e),i.refreshOptions(n&&"single"!==i.settings.mode),s(t)}),a=e.apply(this,[t,r]);return void 0!==a&&r(a),!0},refreshItems:function(){this.lastQuery=null,this.isSetup&&this.addItem(this.items),this.refreshState(),this.updateOriginalInput()},refreshState:function(){this.refreshValidityState(),this.refreshClasses()},refreshValidityState:function(){if(!this.isRequired)return!1;var t=!this.items.length;this.isInvalid=t,this.$control_input.prop("required",t),this.$input.prop("required",!t)},refreshClasses:function(){var t=this,e=t.isFull(),n=t.isLocked;t.$wrapper.toggleClass("rtl",t.rtl),t.$control.toggleClass("focus",t.isFocused).toggleClass("disabled",t.isDisabled).toggleClass("required",t.isRequired).toggleClass("invalid",t.isInvalid).toggleClass("locked",n).toggleClass("full",e).toggleClass("not-full",!e).toggleClass("input-active",t.isFocused&&!t.isInputHidden).toggleClass("dropdown-active",t.isOpen).toggleClass("has-options",!x.isEmptyObject(t.options)).toggleClass("has-items",0<t.items.length),t.$control_input.data("grow",!e&&!n)},isFull:function(){return null!==this.settings.maxItems&&this.items.length>=this.settings.maxItems},updateOriginalInput:function(t){var e,n,i,o,s=this;if(t=t||{},1===s.tagType){for(i=[],e=0,n=s.items.length;e<n;e++)o=s.options[s.items[e]][s.settings.labelField]||"",i.push('<option value="'+a(s.items[e])+'" selected="selected">'+a(o)+"</option>");i.length||this.$input.attr("multiple")||i.push('<option value="" selected="selected"></option>'),s.$input.html(i.join(""))}else s.$input.val(s.getValue()),s.$input.attr("value",s.$input.val());s.isSetup&&(t.silent||s.trigger("change",s.$input.val()))},updatePlaceholder:function(){if(this.settings.placeholder){var t=this.$control_input;this.items.length?t.removeAttr("placeholder"):t.attr("placeholder",this.settings.placeholder),t.triggerHandler("update",{force:!0})}},open:function(){var t=this;t.isLocked||t.isOpen||"multi"===t.settings.mode&&t.isFull()||(t.focus(),t.isOpen=!0,t.refreshState(),t.$dropdown.css({visibility:"hidden",display:"block"}),t.positionDropdown(),t.$dropdown.css({visibility:"visible"}),t.trigger("dropdown_open",t.$dropdown))},close:function(){var t=this,e=t.isOpen;"single"===t.settings.mode&&t.items.length&&(t.hideInput(),t.isBlurring||t.$control_input.blur()),t.isOpen=!1,t.$dropdown.hide(),t.setActiveOption(null),t.refreshState(),e&&t.trigger("dropdown_close",t.$dropdown)},positionDropdown:function(){var t=this.$control,e="body"===this.settings.dropdownParent?t.offset():t.position();e.top+=t.outerHeight(!0),this.$dropdown.css({width:t[0].getBoundingClientRect().width,top:e.top,left:e.left})},clear:function(t){var e=this;e.items.length&&(e.$control.children(":not(input)").remove(),e.items=[],e.lastQuery=null,e.setCaret(0),e.setActiveItem(null),e.updatePlaceholder(),e.updateOriginalInput({silent:t}),e.refreshState(),e.showInput(),e.trigger("clear"))},insertAtCaret:function(t){var e=Math.min(this.caretPos,this.items.length),n=t[0],i=this.buffer||this.$control[0];0===e?i.insertBefore(n,i.firstChild):i.insertBefore(n,i.childNodes[e]),this.setCaret(e+1)},deleteSelection:function(t){var e,n,i,o,s,r,a,l,p,u=this;if(i=t&&8===t.keyCode?-1:1,o=d(u.$control_input[0]),u.$activeOption&&!u.settings.hideSelected&&(a=u.getAdjacentOption(u.$activeOption,-1).attr("data-value")),s=[],u.$activeItems.length){for(p=u.$control.children(".active:"+(0<i?"last":"first")),r=u.$control.children(":not(input)").index(p),0<i&&r++,e=0,n=u.$activeItems.length;e<n;e++)s.push(x(u.$activeItems[e]).attr("data-value"));t&&(t.preventDefault(),t.stopPropagation())}else(u.isFocused||"single"===u.settings.mode)&&u.items.length&&(i<0&&0===o.start&&0===o.length?s.push(u.items[u.caretPos-1]):0<i&&o.start===u.$control_input.val().length&&s.push(u.items[u.caretPos]));if(!s.length||"function"==typeof u.settings.onDelete&&!1===u.settings.onDelete.apply(u,[s]))return!1;for(void 0!==r&&u.setCaret(r);s.length;)u.removeItem(s.pop());return u.showInput(),u.positionDropdown(),u.refreshOptions(!0),a&&(l=u.getOption(a)).length&&u.setActiveOption(l),!0},advanceSelection:function(t,e){var n,i,o,s,r,a=this;0!==t&&(a.rtl&&(t*=-1),n=0<t?"last":"first",i=d(a.$control_input[0]),a.isFocused&&!a.isInputHidden?(s=a.$control_input.val().length,(t<0?0!==i.start||0!==i.length:i.start!==s)||s||a.advanceCaret(t,e)):(r=a.$control.children(".active:"+n)).length&&(o=a.$control.children(":not(input)").index(r),a.setActiveItem(null),a.setCaret(0<t?o+1:o)))},advanceCaret:function(t,e){var n,i,o=this;0!==t&&(n=0<t?"next":"prev",o.isShiftDown?(i=o.$control_input[n]()).length&&(o.hideInput(),o.setActiveItem(i),e&&e.preventDefault()):o.setCaret(o.caretPos+t))},setCaret:function(t){var e,n,i,o,s=this;if(t="single"===s.settings.mode?s.items.length:Math.max(0,Math.min(s.items.length,t)),!s.isPending)for(e=0,n=(i=s.$control.children(":not(input)")).length;e<n;e++)o=x(i[e]).detach(),e<t?s.$control_input.before(o):s.$control.append(o);s.caretPos=t},lock:function(){this.close(),this.isLocked=!0,this.refreshState()},unlock:function(){this.isLocked=!1,this.refreshState()},disable:function(){this.$input.prop("disabled",!0),this.$control_input.prop("disabled",!0).prop("tabindex",-1),this.isDisabled=!0,this.lock()},enable:function(){var t=this;t.$input.prop("disabled",!1),t.$control_input.prop("disabled",!1).prop("tabindex",t.tabIndex),t.isDisabled=!1,t.unlock()},destroy:function(){var t=this,e=t.eventNS,n=t.revertSettings;t.trigger("destroy"),t.off(),t.$wrapper.remove(),t.$dropdown.remove(),t.$input.html("").append(n.$children).removeAttr("tabindex").removeClass("selectized").attr({tabindex:n.tabindex}).show(),t.$control_input.removeData("grow"),t.$input.removeData("selectize"),0==--C.count&&C.$testInput&&(C.$testInput.remove(),C.$testInput=void 0),x(window).off(e),x(document).off(e),x(document.body).off(e),delete t.$input[0].selectize},render:function(t,e){var n,i,o="",s=!1,r=this;return"option"!==t&&"item"!==t||(s=!!(n=I(e[r.settings.valueField]))),s&&(p(r.renderCache[t])||(r.renderCache[t]={}),r.renderCache[t].hasOwnProperty(n))?r.renderCache[t][n]:(o=x(r.settings.render[t].apply(this,[e,a])),"option"===t||"option_create"===t?e[r.settings.disabledField]||o.attr("data-selectable",""):"optgroup"===t&&(i=e[r.settings.optgroupValueField]||"",o.attr("data-group",i),e[r.settings.disabledField]&&o.attr("data-disabled","")),"option"!==t&&"item"!==t||o.attr("data-value",n||""),s&&(r.renderCache[t][n]=o[0]),o[0])},clearCache:function(t){void 0===t?this.renderCache={}:delete this.renderCache[t]},canCreate:function(t){if(!this.settings.create)return!1;var e=this.settings.createFilter;return t.length&&("function"!=typeof e||e.apply(this,[t]))&&("string"!=typeof e||new RegExp(e).test(t))&&(!(e instanceof RegExp)||e.test(t))}}),C.count=0,C.defaults={options:[],optgroups:[],plugins:[],delimiter:",",splitOn:null,persist:!0,diacritics:!0,create:!1,createOnBlur:!1,createFilter:null,highlight:!0,openOnFocus:!0,maxOptions:1e3,maxItems:null,hideSelected:null,addPrecedence:!1,selectOnTab:!1,preload:!1,allowEmptyOption:!1,closeAfterSelect:!1,scrollDuration:60,loadThrottle:300,loadingClass:"loading",dataAttr:"data-data",optgroupField:"optgroup",valueField:"value",labelField:"text",disabledField:"disabled",optgroupLabelField:"label",optgroupValueField:"value",lockOptgroupOrder:!1,sortField:"$order",searchField:["text"],searchConjunction:"and",mode:null,wrapperClass:"selectize-control",inputClass:"selectize-input",dropdownClass:"selectize-dropdown",dropdownContentClass:"selectize-dropdown-content",dropdownParent:null,copyClassesToDropdown:!0,render:{}},x.fn.selectize=function(o){var s=x.fn.selectize.defaults,c=x.extend({},s,o),d=c.dataAttr,h=c.labelField,g=c.valueField,f=c.disabledField,v=c.optgroupField,m=c.optgroupLabelField,y=c.optgroupValueField;return this.each(function(){if(!this.selectize){var t=x(this),e=this.tagName.toLowerCase(),n=t.attr("placeholder")||t.attr("data-placeholder");n||c.allowEmptyOption||(n=t.children('option[value=""]').text());var i={placeholder:n,options:[],optgroups:[],items:[]};"select"===e?function(t,r){function a(t){var e=d&&t.attr(d);return"string"==typeof e&&e.length?JSON.parse(e):null}function l(t,e){t=x(t);var n=I(t.val());if(n||c.allowEmptyOption)if(u.hasOwnProperty(n)){if(e){var i=u[n][v];i?x.isArray(i)?i.push(e):u[n][v]=[i,e]:u[n][v]=e}}else{var o=a(t)||{};o[h]=o[h]||t.text(),o[g]=o[g]||n,o[f]=o[f]||t.prop("disabled"),o[v]=o[v]||e,u[n]=o,p.push(o),t.is(":selected")&&r.items.push(n)}}function e(t){var e,n,i,o,s;for((i=(t=x(t)).attr("label"))&&((o=a(t)||{})[m]=i,o[y]=i,o[f]=t.prop("disabled"),r.optgroups.push(o)),e=0,n=(s=x("option",t)).length;e<n;e++)l(s[e],i)}var n,i,o,s,p=r.options,u={};for(r.maxItems=t.attr("multiple")?null:1,n=0,i=(s=t.children()).length;n<i;n++)"optgroup"===(o=s[n].tagName.toLowerCase())?e(s[n]):"option"===o&&l(s[n])}(t,i):function(t,e){var n,i,o,s,r=t.attr(d);if(r)for(e.options=JSON.parse(r),n=0,i=e.options.length;n<i;n++)e.items.push(e.options[n][g]);else{var a=x.trim(t.val()||"");if(!c.allowEmptyOption&&!a.length)return;for(n=0,i=(o=a.split(c.delimiter)).length;n<i;n++)(s={})[h]=o[n],s[g]=o[n],e.options.push(s);e.items=o}}(t,i),new C(t,x.extend(!0,{},s,i,o))}})},x.fn.selectize.defaults=C.defaults,x.fn.selectize.support={validity:$},C.define("drag_drop",function(t){if(!x.fn.sortable)throw new Error('The "drag_drop" plugin requires jQuery UI "sortable".');if("multi"===this.settings.mode){var e,n,i,o=this;o.lock=(e=o.lock,function(){var t=o.$control.data("sortable");return t&&t.disable(),e.apply(o,arguments)}),o.unlock=(n=o.unlock,function(){var t=o.$control.data("sortable");return t&&t.enable(),n.apply(o,arguments)}),o.setup=(i=o.setup,function(){i.apply(this,arguments);var n=o.$control.sortable({items:"[data-value]",forcePlaceholderSize:!0,disabled:o.isLocked,start:function(t,e){e.placeholder.css("width",e.helper.css("width")),n.css({overflow:"visible"})},stop:function(){n.css({overflow:"hidden"});var t=o.$activeItems?o.$activeItems.slice():null,e=[];n.children("[data-value]").each(function(){e.push(x(this).attr("data-value"))}),o.setValue(e),o.setActiveItem(t)}})})}}),C.define("dropdown_header",function(t){var e,n=this;t=x.extend({title:"Untitled",headerClass:"selectize-dropdown-header",titleRowClass:"selectize-dropdown-header-title",labelClass:"selectize-dropdown-header-label",closeClass:"selectize-dropdown-header-close",html:function(t){return'<div class="'+t.headerClass+'"><div class="'+t.titleRowClass+'"><span class="'+t.labelClass+'">'+t.title+'</span><a href="javascript:void(0)" class="'+t.closeClass+'">&times;</a></div></div>'}},t),n.setup=(e=n.setup,function(){e.apply(n,arguments),n.$dropdown_header=x(t.html(t)),n.$dropdown.prepend(n.$dropdown_header)})}),C.define("optgroup_columns",function(a){var s,l=this;a=x.extend({equalizeWidth:!0,equalizeHeight:!0},a),this.getAdjacentOption=function(t,e){var n=t.closest("[data-group]").find("[data-selectable]"),i=n.index(t)+e;return 0<=i&&i<n.length?n.eq(i):x()},this.onKeyDown=(s=l.onKeyDown,function(t){var e,n,i,o;return!this.isOpen||37!==t.keyCode&&39!==t.keyCode?s.apply(this,arguments):(l.ignoreHover=!0,e=(o=this.$activeOption.closest("[data-group]")).find("[data-selectable]").index(this.$activeOption),void((n=(i=(o=37===t.keyCode?o.prev("[data-group]"):o.next("[data-group]")).find("[data-selectable]")).eq(Math.min(i.length-1,e))).length&&this.setActiveOption(n)))});function t(){var t,e,n,i,o,s,r;if((e=(r=x("[data-group]",l.$dropdown_content)).length)&&l.$dropdown_content.width()){if(a.equalizeHeight){for(t=n=0;t<e;t++)n=Math.max(n,r.eq(t).height());r.css({height:n})}a.equalizeWidth&&(s=l.$dropdown_content.innerWidth()-p(),i=Math.round(s/e),r.css({width:i}),1<e&&(o=s-i*(e-1),r.eq(e-1).css({width:o})))}}var p=function(){var t,e=p.width,n=document;return void 0===e&&((t=n.createElement("div")).innerHTML='<div style="width:50px;height:50px;position:absolute;left:-50px;top:-50px;overflow:auto;"><div style="width:1px;height:100px;"></div></div>',t=t.firstChild,n.body.appendChild(t),e=p.width=t.offsetWidth-t.clientWidth,n.body.removeChild(t)),e};(a.equalizeHeight||a.equalizeWidth)&&(e.after(this,"positionDropdown",t),e.after(this,"refreshOptions",t))}),C.define("remove_button",function(t){t=x.extend({label:"&times;",title:"Remove",className:"remove",append:!0},t);var n,i,o,s,r;"single"!==this.settings.mode?(s=n=this,r='<a href="javascript:void(0)" class="'+(i=t).className+'" tabindex="-1" title="'+a(i.title)+'">'+i.label+"</a>",n.setup=(o=s.setup,function(){if(i.append){var e=s.settings.render.item;s.settings.render.item=function(t){return function(t,e){var n=t.search(/(<\/[^>]+>\s*)#x2F;);return t.substring(0,n)+e+t.substring(n)}(e.apply(n,arguments),r)}}o.apply(n,arguments),n.$control.on("click","."+i.className,function(t){if(t.preventDefault(),!s.isLocked){var e=x(t.currentTarget).parent();s.setActiveItem(e),s.deleteSelection()&&s.setCaret(s.items.length)}})})):function(n,i){i.className="remove-single";var o,s=n,r='<a href="javascript:void(0)" class="'+i.className+'" tabindex="-1" title="'+a(i.title)+'">'+i.label+"</a>";n.setup=(o=s.setup,function(){if(i.append){var t=x(s.$input.context).attr("id"),e=(x("#"+t),s.settings.render.item);s.settings.render.item=function(t){return function(t,e){return x("<span>").append(t).append(e)}(e.apply(n,arguments),r)}}o.apply(n,arguments),n.$control.on("click","."+i.className,function(t){t.preventDefault(),s.isLocked||s.clear()})})}(this,t)}),C.define("restore_on_backspace",function(i){var o,t=this;i.text=i.text||function(t){return t[this.settings.labelField]},this.onKeyDown=(o=t.onKeyDown,function(t){var e,n;return 8===t.keyCode&&""===this.$control_input.val()&&!this.$activeItems.length&&0<=(e=this.caretPos-1)&&e<this.items.length?(n=this.options[this.items[e]],this.deleteSelection(t)&&(this.setTextboxValue(i.text.apply(this,[n])),this.refreshOptions(!0)),void t.preventDefault()):o.apply(this,arguments)})}),C});
assets/js/wp-modula-settings.js CHANGED
@@ -36,15 +36,21 @@ wp.Modula = 'undefined' === typeof( wp.Modula ) ? {} : wp.Modula;
36
},
37
38
initialize: function( args ) {
39
40
- this.tabs = this.$el.find( '.modula-tabs .modula-tab' );
41
- this.tabContainers = this.$el.find( '.modula-tabs-content > div' );
42
- this.sliders = this.$el.find( '.modula-ui-slider' );
43
- this.colorPickers = this.$el.find( '.modula-color' );
44
45
- // initialize 3rd party scripts
46
- this.initSliders();
47
- this.initColorPickers();
48
49
},
50
@@ -81,7 +87,7 @@ wp.Modula = 'undefined' === typeof( wp.Modula ) ? {} : wp.Modula;
81
this.tabs.removeClass( 'active-tab' );
82
this.tabContainers.removeClass( 'active-tab' );
83
jQuery( event.target ).addClass( 'active-tab' );
84
- this.tabContainers.filter( '#' + currentTab ).addClass( 'active-tab' );
85
86
},
87
@@ -132,6 +138,29 @@ wp.Modula = 'undefined' === typeof( wp.Modula ) ? {} : wp.Modula;
132
jQuery( colorPicker ).wpColorPicker();
133
});
134
}
135
}
136
137
});
36
},
37
38
initialize: function( args ) {
39
+ this.initializeLite();
40
+ },
41
+
42
+ initializeLite: function(){
43
44
+ this.tabs = this.$el.find( '.modula-tabs .modula-tab' );
45
+ this.tabContainers = this.$el.find( '.modula-tabs-content > div' );
46
+ this.sliders = this.$el.find( '.modula-ui-slider' );
47
+ this.colorPickers = this.$el.find( '.modula-color' );
48
+ this.customEditors = this.$el.find( '.modula-code-editor' );
49
50
+ // initialize 3rd party scripts
51
+ this.initSliders();
52
+ this.initColorPickers();
53
+ this.initCustomCSS();
54
55
},
56
87
this.tabs.removeClass( 'active-tab' );
88
this.tabContainers.removeClass( 'active-tab' );
89
jQuery( event.target ).addClass( 'active-tab' );
90
+ this.tabContainers.filter( '#' + currentTab ).addClass( 'active-tab' ).trigger( 'modula-current-tab' );
91
92
},
93
138
jQuery( colorPicker ).wpColorPicker();
139
});
140
}
141
+ },
142
+
143
+ initCustomCSS: function() {
144
+ var editorSettings = wp.codeEditor.defaultSettings ? _.clone( wp.codeEditor.defaultSettings ) : {};
145
+ if ( this.customEditors.length > 0 ) {
146
+ this.customEditors.each( function( $index, customEditorContainer ) {
147
+ var syntax = $( customEditorContainer ).data( 'syntax' ),
148
+ id = '#' + $( customEditorContainer ).find( '.modula-custom-editor-field' ).attr( 'id' ),
149
+ currentSettings = _.extend(
150
+ {},
151
+ editorSettings.codemirror,
152
+ {
153
+ mode: syntax,
154
+ }
155
+ );
156
+
157
+ var editor = wp.codeEditor.initialize( $( id ), currentSettings );
158
+
159
+ $( customEditorContainer ).parents( '.modula-tab-content' ).on( 'modula-current-tab',function(){
160
+ editor.codemirror.refresh();
161
+ });
162
+ });
163
+ }
164
}
165
166
});
changelog.txt CHANGED
@@ -1,3 +1,10 @@
1
= 2.2.5 - 13/02/2020 =
2
Fixed Captions
3
Fixed security issue
1
+ = 2.2.6 - 18/02/2020 =
2
+ Improved Custom CSS textarea
3
+ Improved how the lightbox closes
4
+ Fixed Custom Gallery with gutter 0
5
+ Removed feature box from extensions
6
+ Changed font size settings
7
+
8
= 2.2.5 - 13/02/2020 =
9
Fixed Captions
10
Fixed security issue
includes/admin/class-modula-addons.php CHANGED
@@ -57,22 +57,6 @@ class Modula_Addons {
57
echo '</div>';
58
}
59
}
60
-
61
- if ( apply_filters( 'modula-show-feature-request', true ) ) {
62
- echo '<div class="modula-addon">';
63
- echo '<div class="modula-addon-box">';
64
- echo '<div><img src="' . MODULA_URL . 'assets/images/modula-logo.jpg"></div>';
65
- echo '<div class="modula-addon-content">';
66
- echo '<h3>' . esc_html__( 'Feature Request', 'modula-best-grid-gallery' ) . '</h3>';
67
- echo '<div class="modula-addon-description">' . esc_html__( 'Cant\'t find what you’re looking for? Let us know by making a suggestion!', 'modula-best-grid-gallery' ) . '</div>';
68
- echo '</div>';
69
- echo '</div>';
70
- echo '<div class="modula-addon-actions">';
71
- echo '<a href="https://docs.google.com/forms/d/e/1FAIpQLSc5eAZbxGROm_WSntX_3JVji2cMfS3LIbCNDKG1yF_VNe3R4g/viewform" class="button primary-button" target="_blank">' . esc_html__( 'Send Feature Request', 'modula-best-grid-gallery' ) . '</a>';
72
- echo '</div>';
73
- echo '</div>';
74
- }
75
-
76
}
77
78
}
57
echo '</div>';
58
}
59
}
60
}
61
62
}
includes/admin/class-modula-cpt-fields-helper.php CHANGED
@@ -275,9 +275,8 @@ class Modula_CPT_Fields_Helper {
275
),
276
"titleFontSize" => array(
277
"name" => esc_html__( 'Title Font Size', 'modula-best-grid-gallery' ),
278
- "type" => "ui-slider",
279
- "min" => 0,
280
- "max" => 100,
281
"default" => 0,
282
"description" => esc_html__( 'The title font size in pixels (set to 0 to use the theme defaults).', 'modula-best-grid-gallery' ),
283
'priority' => 40,
@@ -298,27 +297,24 @@ class Modula_CPT_Fields_Helper {
298
),
299
"captionFontSize" => array(
300
"name" => esc_html__( 'Caption Font Size', 'modula-best-grid-gallery' ),
301
- "type" => "ui-slider",
302
- "min" => 0,
303
- "max" => 100,
304
"default" => 14,
305
"description" => esc_html__( 'The caption font size in pixels (set to 0 to use theme defaults).', 'modula-best-grid-gallery' ),
306
'priority' => 80,
307
),
308
"mobileTitleFontSize" => array(
309
"name" => esc_html__( 'Mobile Title Font Size', 'modula-best-grid-gallery' ),
310
- "type" => "ui-slider",
311
- "min" => 0,
312
- "max" => 100,
313
"default" => 12,
314
"description" => esc_html__( 'The title font size in pixels (set to 0 to use the theme defaults) for mobile view.', 'modula-best-grid-gallery' ),
315
'priority' => 90,
316
),
317
"mobileCaptionFontSize" => array(
318
"name" => esc_html__( 'Mobile Caption Font Size', 'modula-best-grid-gallery' ),
319
- "type" => "ui-slider",
320
- "min" => 0,
321
- "max" => 100,
322
"default" => 10,
323
"description" => esc_html__( 'The caption font size in pixels (set to 0 to use theme defaults) for mobile view.', 'modula-best-grid-gallery' ),
324
'priority' => 100,
@@ -518,10 +514,10 @@ class Modula_CPT_Fields_Helper {
518
),
519
'customizations' => array(
520
"style" => array(
521
- "name" => esc_html__( 'Custom css', 'modula-best-grid-gallery' ),
522
"type" => "custom_code",
523
"syntax" => 'css',
524
- "description" => '<strong>' . esc_html__( 'Just write the code without using the &lt;style&gt;&lt;/style&gt; tags', 'modula-best-grid-gallery' ) . '</strong>',
525
'priority' => 20,
526
),
527
),
275
),
276
"titleFontSize" => array(
277
"name" => esc_html__( 'Title Font Size', 'modula-best-grid-gallery' ),
278
+ "type" => "number",
279
+ "after" => 'px',
280
"default" => 0,
281
"description" => esc_html__( 'The title font size in pixels (set to 0 to use the theme defaults).', 'modula-best-grid-gallery' ),
282
'priority' => 40,
297
),
298
"captionFontSize" => array(
299
"name" => esc_html__( 'Caption Font Size', 'modula-best-grid-gallery' ),
300
+ "type" => "number",
301
+ "after" => 'px',
302
"default" => 14,
303
"description" => esc_html__( 'The caption font size in pixels (set to 0 to use theme defaults).', 'modula-best-grid-gallery' ),
304
'priority' => 80,
305
),
306
"mobileTitleFontSize" => array(
307
"name" => esc_html__( 'Mobile Title Font Size', 'modula-best-grid-gallery' ),
308
+ "type" => "number",
309
+ "after" => 'px',
310
"default" => 12,
311
"description" => esc_html__( 'The title font size in pixels (set to 0 to use the theme defaults) for mobile view.', 'modula-best-grid-gallery' ),
312
'priority' => 90,
313
),
314
"mobileCaptionFontSize" => array(
315
"name" => esc_html__( 'Mobile Caption Font Size', 'modula-best-grid-gallery' ),
316
+ "type" => "number",
317
+ "after" => 'px',
318
"default" => 10,
319
"description" => esc_html__( 'The caption font size in pixels (set to 0 to use theme defaults) for mobile view.', 'modula-best-grid-gallery' ),
320
'priority' => 100,
514
),
515
'customizations' => array(
516
"style" => array(
517
+ "name" => '',
518
"type" => "custom_code",
519
"syntax" => 'css',
520
+ "description" => '',
521
'priority' => 20,
522
),
523
),
includes/admin/class-modula-field-builder.php CHANGED
@@ -158,7 +158,7 @@ class Modula_Field_Builder {
158
// Sort fields based on priority.
159
uasort( $fields, array( 'Modula_Helper', 'sort_data_by_priority' ) );
160
161
- $current_tab_content = '<div id="modula-' . esc_attr( $tab['id'] ) . '" class="' . ( $first ? 'active-tab' : '' ) . '">';
162
163
// Check if our tab have title & description
164
if ( isset( $tab['title'] ) || isset( $tab['description'] ) ) {
@@ -274,6 +274,12 @@ class Modula_Field_Builder {
274
case 'text':
275
$html = '<input type="text" class="regular-text" name="modula-settings[' . esc_attr( $field['id'] ) . ']" data-setting="' . esc_attr( $field['id'] ) . '" value="' . esc_attr( $value ) . '">';
276
break;
277
case 'select' :
278
$html = '<select name="modula-settings[' . esc_attr( $field['id'] ) . ']" data-setting="' . esc_attr( $field['id'] ) . '" class="regular-text">';
279
foreach ( $field['values'] as $key => $option ) {
@@ -287,7 +293,7 @@ class Modula_Field_Builder {
287
$html .= '<option value="' . esc_attr( $key ) . '" ' . selected( $key, $value, false ) . '>' . esc_html( $option ) . '</option>';
288
}
289
}
290
- if ( isset( $field['disabled'] ) && is_array( $field['disabled'] ) ) {
291
$html .= '<optgroup label="' . esc_attr( $field['disabled']['title'] ) . '">';
292
foreach ( $field['disabled']['values'] as $key => $disabled ) {
293
$html .= '<option value="' . esc_attr( $key ) . '" disabled >' . esc_html( $disabled ) . '</option>';
@@ -335,8 +341,9 @@ class Modula_Field_Builder {
335
$html .= '</div>';
336
break;
337
case "custom_code":
338
$html = '<div class="modula-code-editor" data-syntax="' . esc_attr( $field['syntax'] ) . '">';
339
- $html .= '<textarea data-setting="' . esc_attr( $field['id'] ) . '" name="modula-settings[' . esc_attr( $field['id'] ) . ']" id="modula-' . esc_attr( $field['id'] ) . '" class="large-text code" rows="10" cols="50">' . wp_kses_post($value) . '</textarea>';
340
$html .= '</div>';
341
break;
342
case "hover-effect":
158
// Sort fields based on priority.
159
uasort( $fields, array( 'Modula_Helper', 'sort_data_by_priority' ) );
160
161
+ $current_tab_content = '<div id="modula-' . esc_attr( $tab['id'] ) . '" class="modula-tab-content' . ( $first ? ' active-tab' : '' ) . '">';
162
163
// Check if our tab have title & description
164
if ( isset( $tab['title'] ) || isset( $tab['description'] ) ) {
274
case 'text':
275
$html = '<input type="text" class="regular-text" name="modula-settings[' . esc_attr( $field['id'] ) . ']" data-setting="' . esc_attr( $field['id'] ) . '" value="' . esc_attr( $value ) . '">';
276
break;
277
+ case 'number':
278
+ $html = '<input type="number" class="regular-number" name="modula-settings[' . esc_attr( $field['id'] ) . ']" data-setting="' . esc_attr( $field['id'] ) . '" value="' . esc_attr( $value ) . '">';
279
+ if ( isset( $field['after'] ) ) {
280
+ $html .= '<span class="modula-after-input">' . esc_html( $field['after'] ) . '</span>';
281
+ }
282
+ break;
283
case 'select' :
284
$html = '<select name="modula-settings[' . esc_attr( $field['id'] ) . ']" data-setting="' . esc_attr( $field['id'] ) . '" class="regular-text">';
285
foreach ( $field['values'] as $key => $option ) {
293
$html .= '<option value="' . esc_attr( $key ) . '" ' . selected( $key, $value, false ) . '>' . esc_html( $option ) . '</option>';
294
}
295
}
296
+ if ( isset( $field['disabled'] ) && is_array( $field['disabled'] ) && ! empty( $field['disabled']['values'] ) ) {
297
$html .= '<optgroup label="' . esc_attr( $field['disabled']['title'] ) . '">';
298
foreach ( $field['disabled']['values'] as $key => $disabled ) {
299
$html .= '<option value="' . esc_attr( $key ) . '" disabled >' . esc_html( $disabled ) . '</option>';
341
$html .= '</div>';
342
break;
343
case "custom_code":
344
+
345
$html = '<div class="modula-code-editor" data-syntax="' . esc_attr( $field['syntax'] ) . '">';
346
+ $html .= '<textarea data-setting="' . esc_attr( $field['id'] ) . '" name="modula-settings[' . esc_attr( $field['id'] ) . ']" id="modula-' . esc_attr( $field['id'] ) . '-customcode" class="large-text code modula-custom-editor-field" rows="10" cols="50">' . wp_kses_post($value) . '</textarea>';
347
$html .= '</div>';
348
break;
349
case "hover-effect":
includes/admin/tabs/about.php CHANGED
@@ -1,8 +1,11 @@
1
<?php
2
$issues = array(
3
'fix' => array(
4
- esc_html__( 'Fixed Captions', 'modula-best-grid-gallery' ),
5
- esc_html__( 'Fixed security issue', 'modula-best-grid-gallery' ),
6
),
7
);
8
?>
1
<?php
2
$issues = array(
3
'fix' => array(
4
+ esc_html__( 'Improved Custom CSS textarea', 'modula-best-grid-gallery' ),
5
+ esc_html__( 'Improved how the lightbox closes', 'modula-best-grid-gallery' ),
6
+ esc_html__( 'Fixed Custom Gallery with gutter 0', 'modula-best-grid-gallery' ),
7
+ esc_html__( 'Removed feature box from extensions', 'modula-best-grid-gallery' ),
8
+ esc_html__( 'Changed font size settings', 'modula-best-grid-gallery' ),
9
),
10
);
11
?>
includes/class-modula-upgrades.php CHANGED
@@ -56,8 +56,7 @@ class Modula_Upgrades {
56
// Check if is a new 2.0.0 install or an old install
57
$version = get_option( 'modula_version', array() );
58
59
- // Check to see if we redirect or not to About page
60
- $modula_update = Modula_Update::get_instance();
61
$check = false;
62
if(!empty($version) && $version['current_version'] !== MODULA_LITE_VERSION ){
63
$check = true;
@@ -78,7 +77,12 @@ class Modula_Upgrades {
78
79
update_option( 'modula_version', $version );
80
81
- $modula_update->modula_on_activation($check);
82
}
83
84
/**
56
// Check if is a new 2.0.0 install or an old install
57
$version = get_option( 'modula_version', array() );
58
59
+
60
$check = false;
61
if(!empty($version) && $version['current_version'] !== MODULA_LITE_VERSION ){
62
$check = true;
77
78
update_option( 'modula_version', $version );
79
80
+ if ( class_exists( 'Modula_Update' ) ) {
81
+ // Check to see if we redirect or not to About page
82
+ $modula_update = Modula_Update::get_instance();
83
+ $modula_update->modula_on_activation( $check );
84
+ }
85
+
86
}
87
88
/**
includes/class-modula.php CHANGED
@@ -179,7 +179,9 @@ class Modula {
179
}
180
181
wp_enqueue_style( 'wp-color-picker' );
182
- wp_enqueue_style( 'jquery-ui', MODULA_URL . 'assets/css/jquery-ui.min.css', null, MODULA_LITE_VERSION );
183
wp_enqueue_style( 'modula-cpt-style', MODULA_URL . 'assets/css/modula-cpt.css', null, MODULA_LITE_VERSION );
184
185
wp_enqueue_script( 'modula-resize-senzor', MODULA_URL . 'assets/js/resizesensor.js', array( 'jquery' ), MODULA_LITE_VERSION, true );
179
}
180
181
wp_enqueue_style( 'wp-color-picker' );
182
+ // Enqueue Code Editor for Custom CSS
183
+ wp_enqueue_code_editor(array('type' => 'text/css'));
184
+ wp_enqueue_style( 'jquery-ui', MODULA_URL . 'assets/css/jquery-ui.min.css', null, MODULA_LITE_VERSION );
185
wp_enqueue_style( 'modula-cpt-style', MODULA_URL . 'assets/css/modula-cpt.css', null, MODULA_LITE_VERSION );
186
187
wp_enqueue_script( 'modula-resize-senzor', MODULA_URL . 'assets/js/resizesensor.js', array( 'jquery' ), MODULA_LITE_VERSION, true );