"use strict";"object"!=typeof window.cp&&(window.cp={}),window.cp.pentimer={programnolongerbeingmonitored:!1,timeoffirstcalltoshouldstoploop:0,_loopexits:{},_looptimers:{},start_monitoring_after:2e3,stop_all_monitoring_timeout:5e3,max_time_in_loop_wo_exit:2200,exitedloop:function(o){this._loopexits[o]=!0},shouldstoploop:function(o){if(this.programkilledsostopmonitoring)return!0;if(this.programnolongerbeingmonitored)return!1;if(this._loopexits[o])return!1;var t=this._gettime();if(0===this.timeoffirstcalltoshouldstoploop)return this.timeoffirstcalltoshouldstoploop=t,!1;var i=t-this.timeoffirstcalltoshouldstoploop;if(ithis.stop_all_monitoring_timeout)return this.programnolongerbeingmonitored=!0,!1;try{this._checkoninfiniteloop(o,t)}catch(n){return this._senderrormessagetoeditor(),this.programkilledsostopmonitoring=!0,!0}return!1},_senderrormessagetoeditor:function(){try{if(this._shouldpostmessage()){var o={action:"infinite-loop",line:this._findaroundlinenumber()};parent.postmessage(json.stringify(o),"*")}else this._throwanerrortostoppen()}catch(t){this._throwanerrortostoppen()}},_shouldpostmessage:function(){return document.location.href.match(/boomerang/)},_throwanerrortostoppen:function(){throw"we found an infinite loop in your pen. we've stopped the pen from running. please correct it or contact support@codepen.io."},_findaroundlinenumber:function(){var o=new error,t=0;if(o.stack){var i=o.stack.match(/boomerang\s+:(\d+):\d+/);i&&(t=i[1])}return t},_checkoninfiniteloop:function(o,t){if(!this._looptimers[o])return this._looptimers[o]=t,!1;var i=t-this._looptimers[o];if(i>this.max_time_in_loop_wo_exit)throw"infinite loop found on loop: "+o},_gettime:function(){return+new date}},window.cp.shouldstopexecution=function(o){return window.cp.pentimer.shouldstoploop(o)},window.cp.exitedloop=function(o){window.cp.pentimer.exitedloop(o)}; (function ($) { $.fn.jaliswall = function (options) { this.each(function () { var defaults = { item: '.wall-item', columnclass: '.wall-column', resize: true }; var prm = $.extend(defaults, options); var container = $(this); var items = container.find(prm.item); var elemsdatas = []; var columns = []; var nbcols = getnbcols(); init(); function init() { nbcols = getnbcols(); recordandremove(); print(); if (prm.resize) { $(window).resize(function () { if (nbcols != getnbcols()) { nbcols = getnbcols(); setcolpos(); print(); } }); } } function getnbcols() { var instanceforcompute = false; if (container.find(prm.columnclass).length == 0) { instanceforcompute = true; container.append('
'); } var colwidth = container.find(prm.columnclass).outerwidth(true); var wallwidth = container.innerwidth(); if (instanceforcompute) container.find(prm.columnclass).remove(); return math.round(wallwidth / colwidth); } function recordandremove() { items.each(function (index) { var item = $(this); elemsdatas.push({ content: item.html(), class: item.attr('class'), href: item.attr('href'), id: item.attr('id'), colid: index % nbcols }); item.remove(); }); } function setcolpos() { for (var i in elemsdatas) { if (window.cp.shouldstopexecution(1)) { break; } elemsdatas[i].colid = i % nbcols; } window.cp.exitedloop(1); } function parseselector(selector) { return selector.slice(1, selector.length); } function print() { var tree = ''; for (var i = 0; i < nbcols; i++) { if (window.cp.shouldstopexecution(2)) { break; } tree += '
'; } window.cp.exitedloop(2); container.html(tree); for (var i in elemsdatas) { var html = ''; var content = elemsdatas[i].content != undefined ? elemsdatas[i].content : ''; var href = elemsdatas[i].href != href ? elemsdatas[i].href : ''; var classe = elemsdatas[i].class != undefined ? elemsdatas[i].class : ''; var id = elemsdatas[i].id != undefined ? elemsdatas[i].id : ''; if (elemsdatas[i].href != undefined) { html += '' + content + ''; } else { html += '
' + content + ''; } container.children(prm.columnclass).eq(i % nbcols).append(html); } } function getattr(attr, type) { return attr != undefined ? type + '=\'' + attr + '\'' : ''; } }); return this; }; }(jquery));