diyminify (v3)

Revision 3 of this benchmark created on


Preparation HTML

var emma=(function(b){b.contentAttrAdd=function(f){var c=_contentAttrBox($(f));var d=c.find('.js-contentAttr-tpl').html();var e=Mustache.render(d,{'key':c.find('.js-contentAttr-item').length,'contentAttr_key':'','contentAttr_val':''});c.find('.js-contentAttr-items').append(e);b.contentAttrUpdateFormtab(c);b.contentAttrUpdateNoDataInfo(c);return false};b.contentAttrRemove=function(c){var d=_contentAttrBox($(c));$(c).parents('.js-contentAttr-item').first().remove();b.contentAttrUpdateFormtab(d);b.contentAttrUpdateNoDataInfo(d);return false};b.contentAttrUpdateFormtab=function(c){b.formtabUpdate($('[href="#'+c.parent().attr('id')+'"]').parent(),true)};b.contentAttrUpdateNoDataInfo=function(b){if(b.find('.js-contentAttr-item').length>0){b.find('.js-contentAttr-nodata').hide()}else{b.find('.js-contentAttr-nodata').show()}};_contentAttrBox=function(b){return b.parents('.js-contentAttr').first()};return b}(emma||{}));;var emma=(function(b){var c={};b.contentRelationModal=function(i,e,g){var j=d(i);if(typeof g==='undefined'){var param={}}if(j.attr('data-contentRelation-mode')==='diff'){var f=[];j.find('.js-contentRelation-items').children('.js-contentRelation-item').each(function(){f.push($(this).attr('data-contentRelation-id'))});if(f.length){g['selection']=f}}var h=$.param(g);if(h.length){e+=(e.indexOf('?')===-1?'?':'&')+h}c[i]=b.modalPush(e);return false};b.contentRelationModalBySender=function(c,d){b.contentRelationModal($(c).parents('.js-contentRelation').first().attr('data-contentRelation-box'),$(c).attr('data-contentRelation-uri'),d);return false};b.contentRelationRemove=function(e){var d=$(e).parents('.js-contentRelation-item').first();var c=d.parents('.js-contentRelation').first();d.remove();b.contentRelationUpdateFormtab(c);b.contentRelationUpdateNoDataInfo(c);b.contentRelationUpdateFilterBtn(c);return false};b.contentRelationUpdate=function(g){b.modalPop(c[g['meta']['token']]);delete c[g['meta']['token']];if(g['meta']['action']==='cancel'){return}var e=d(g['meta']['token']);if(e.length===0){return}var h=e.attr('data-contentRelation-mode')?e.attr('data-contentRelation-mode'):'default';var i=g['meta']['action']==='list'?true:false;var j=g['data'];if(j===null){if(h!=='diff'){return}}if(i&&h==='diff'){var r=[];$.each(j,function(){r.push(this.content_id)})}var q=[];var k=0;var n=0;e.find('.js-contentRelation-items').children('.js-contentRelation-item').each(function(){k++;id=$(this).attr('data-contentRelation-id');if(i&&h==='diff'){if($.inArray(id,r)===-1){e.find('[data-contentRelation-id="'+id+'"]').remove();k--}}q.push(id);n=parseInt($(this).attr('data-contentRelation-key'))});var p=e.find('.js-contentRelation-tpl').html();var s=e.attr('data-contentRelation-limit')?e.attr('data-contentRelation-limit'):-1;for(var m=0;m<j.length;m++){var f=j[m];var l=true;if(i&&(h==='diff'||h==='unique')){l=false;if($.inArray(f['content_id'],q)===-1){l=true}}if(l){if(f['img_uri']){f['img_uriBig']=f['img_uri'].replace('%s','800re0');f['img_uri']=f['img_uri'].replace('%s','80')}var o=e.find('[data-contentRelation-id="'+f['content_id']+'"]');if(!i&&o.length){o.each(function(){f['key']=$(this).attr('data-contentRelation-key');var b=Mustache.render(p,f);$(this).replaceWith(b)})}else if(s===-1||k<s){f['key']=++n;var t=Mustache.render(p,f);e.find('.js-contentRelation-items').append(t);k++}}}b.contentRelationUpdateFormtab(e);b.contentRelationUpdateNoDataInfo(e);b.contentRelationUpdateFilterBtn(e)};b.contentRelationUpdateFormtab=function(c){b.formtabUpdate($('[href="#'+c.parent().attr('id')+'"]').parent(),true)};b.contentRelationUpdateNoDataInfo=function(b){if(b.find('.js-contentRelation-item').length>0){b.find('.js-contentRelation-nodata').hide()}else{b.find('.js-contentRelation-nodata').show()}};b.contentRelationUpdateFilterBtn=function(b){h=b.find('.js-contentRelation-items').outerHeight();b.find('.js-contentRelation-filterBtn').attr('style','height: '+h+'px; line-height: '+(h-10)+'px;')};b.contentRelationUpdateSelection=function(b){var d=$('[name="selection[]"]:checkbox:checked').map(function(){return this.value}).get();var c=e();c['selection']=d;b.attr('href',b.attr('href').split('?')[0]+'?'+$.param(c))};function d(b){return $('[data-contentRelation-box="'+b+'"]')}function e(){var f=decodeURI(location.search.substr(1));var e=f.split('&');var c=Object();for(var d=0;d<e.length;d++){var b=e[d].split('=');if(b[0].search("\\[\\]")!==-1){b[0]=b[0].replace(/\[|\]/g,'');if(typeof c[b[0]]==='undefined'){c[b[0]]=[b[1]]}else{c[b[0]].push(b[1])}}else{c[b[0]]=b[1]}}return c}return b}(emma||{}));;$(function(){$('.js-datepicker').datepicker({dateFormat:'dd.mm.yy',dayNamesMin:['So','Mo','Di','Mi','Do','Fr','Sa'],firstDay:'1',monthNames:['Januar','Februar','März','April','Mai','Juni','Juli','August','September','October','November','Dezember']})});;$(function(){$('.js-fancybox').fancybox()});;var emma=(function(b){b.formtabUpdate=function(b,f){var c=$(b).find('.js-formtab-info:first');var e=$(b).attr('data-formtab-key');var d=$('.js-formtab .js-formtab-content-'+e+' .js-formtab-count').length;c.html('');if(d){$('<span />').addClass('badge badge-info').text(d).appendTo(c)}if(f){$('.js-formtab .js-formtab-tab').removeClass('active');$(b).addClass('active');$('.js-formtab .tab-content .tab-pane').removeClass('active');$('#formtab-'+e).addClass('active')}};b.formtabUpdateAll=function(){$('.js-formtab .js-formtab-tab').each(function(){b.formtabUpdate($(this),false)})};return b}(emma||{}));;var emma=(function(b){b.importUpdate=function(i,h){var g=f(i);if(g.length===0){return}var j=g.attr('data-import-uri');if(j.length===0){return}if(h.length===0){return}$.ajax({url:j,data:{'type':h}}).done(function(f){if(f===null){return}if(h==='previewList'){e(g,f);b.importUpdateNoDataInfo(g,'list')}else if(h==='previewProgress'){c(g,f);b.importUpdateNoDataInfo(g,'progress')}else if(h==='listProgress'){d(g,f)}}).always(function(){$(this).delay(2000).queue(function(){b.importUpdate(i,h);$(this).dequeue()})})};b.importUpdateNoDataInfo=function(c,b){if(c.find('.js-import-'+b+'-item').length>0){c.find('.js-import-'+b+'-noData').hide()}else{c.find('.js-import-'+b+'-noData').show()}};function f(b){return $('.'+b)}function e(b,c){var d=[];$.each(c,function(){d.push(this.content_id)});b.find('.js-import-list-items').find('.js-import-list-item').each(function(){if($.inArray($(this).attr('data-import-id'),d)===-1){$(this).fadeOut().remove()}});$.each(c,function(h,c){var d=b.find('.js-import-list-item[data-import-id="'+c['content_id']+'"]');if(d.length===0){c['date']=g(new Date(parseInt(c['content_update'])*1000));var f=b.find('.js-import-list-tpl').html();var e=Mustache.render(f,c);b.find('.js-import-list-items').prepend(e)}})}function c(b,d){var c=[];$.each(d,function(){c.push(this.content_id)});b.find('.js-import-progress-items').find('.js-import-progress-item').each(function(){if($.inArray($(this).attr('data-import-id'),c)===-1){$(this).fadeOut().remove()}});$.each(d,function(h,c){var e=b.find('.js-import-progress-item[data-import-id="'+c['content_id']+'"]');var d=(parseFloat(c['import_progress'])*100).toFixed(0);if(e.length===0){c['progress']=d;var g=b.find('.js-import-progress-tpl').html();var f=Mustache.render(g,c);b.find('.js-import-progress-items').prepend(f)}else{e.find('.js-import-progress-item-bar').attr('aria-valuenow',d).css('width',d+'%').text(d+'%')}})}function d(b,d){var c=[];$.each(d,function(){c.push(this.content_id)});b.find('.js-import-progress-items').find('.js-import-progress-item').each(function(){if($.inArray($(this).attr('data-import-id'),c)===-1){$(this).html('')}});$.each(d,function(h,c){var e=b.find('.js-import-progress-item[data-import-id="'+c['content_id']+'"]');var d=(parseFloat(c['import_progress'])*100).toFixed(0);if(e.html().trim().length===0){c['progress']=d;var f=b.find('.js-import-progress-tpl').html();var g=Mustache.render(f,c);e.html(g)}else{e.find('.js-import-progress-item-bar').attr('aria-valuenow',d).css('width',d+'%').text(d+'%')}})};function g(b){var c=function(b){if(b<10){return'0'+b}return b};return c(b.getDate())+'.'+c(b.getMonth()+1)+'.'+b.getFullYear()+' '+c(b.getHours())+':'+c(b.getMinutes())}return b}(emma||{}));;var emma=(function(c){var b=[];c.modalPop=function(c){if(b.length===0){return}var d=c?$.inArray(c,b):b.length-1;if(d===-1){return}c=b[d];c.remove();b.pop(c);if(b.length===0){$('body').css({overflow:'',position:''})}};c.modalPush=function(e){var d=$('<div></div>').attr({'class':'modal'}).css({width:'100%',height:'100%',position:'fixed',zIndex:2000,background:'rgba(0, 0, 0, .50)'}).html('<div class="modal-loader"><div class="modal-loader-icon">&nbsp;</div><button type="button" class="btn btn-default">&times; Abbrechen</button></div>').appendTo('body');var f=$('<iframe />').attr({src:e,allowtransparency:'true',frameborder:'0'}).css({display:'none',position:'fixed',left:'0px',width:'100%',top:'0px',height:'100%',zIndex:2000,background:'rgba(0, 0, 0, .50)'}).appendTo(d);d.find('.modal-loader .btn').click(function(){return c.modalPop(d)});d.show();b.push(d);$('body').css('overflow','hidden');if(navigator.userAgent.match(/(iPad|iPhone|iPod)/g)){$('body').css('position','fixed')}return d};c.modalReady=function(c){$.each(b,function(e,d){var b=$(d).children('iframe');if(b.get(0).contentWindow===c&&$(b).is(':hidden')){$(b).prev('.modal-loader').hide();$(b).show();return false}})};return c}(emma||{}));;$(function(){$('.js-sortable').sortable({items:"tr:not(.ui-state-disabled)",handle:'.sort',cursor:'move'})});;tinyMCE.init({selector:"textarea.js-tinymce",language:'de',convert_urls:false,relative_urls:false,remove_script_host:false,plugins:["advlist autolink lists link image charmap print preview anchor visualblocks paste","wordcount textcolor"],toolbar_items_size:'small',toolbar:"insertfile undo redo | bold italic | forecolor backcolor | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image",setup:function(b){if(b.settings.readonly){b.settings.toolbar=false;b.settings.menubar=false}}});;var emma=(function(b){b.treeUpdateSelectChild=function(b,c){$('.js-treeUpdatSelecteChild').empty();i=0;$.each(b,function(d,b){if(b['tree_id_tree']===c){$('.js-treeUpdateSelectChild').append($("<option></option>").attr('value',i).text(b['title']));i++}});last=i?i:'end';$('.js-treeUpdateSelectChild').append($("<option></option>").attr('value',last).text('Am Ende'))};return b}(emma||{}));$(function(){$('.js-tree').each(function(){var c=$(this);var b=typeof (c.attr('data-tree-session'))!=="undefined"&&c.attr('data-tree-session').length?'admin-tree-'+c.attr('data-tree-session'):'';var e=b.length>0&&typeof (Storage)!=="undefined";c.find('.js-tree-ctrl').click(function(){var c=$(this);var f=c.parents('.js-tree-li').first();var i=c.hasClass('js-tree-h');var h=f.attr('data-tree-id');if(i){c.removeClass('js-tree-h');f.find('.js-tree-ul').first().show();if(!e||typeof (localStorage[b])==="undefined"){return}var d=localStorage[b].split(',');d.splice(d.indexOf(h),1);localStorage[b]=d.join(',')}else{c.addClass('js-tree-h');f.find('.js-tree-ul').first().hide();var g=typeof (localStorage[b])!=="undefined"?localStorage[b].split(','):[];g[g.length]=h;localStorage[b]=g.join(',')}});if(!e||typeof (localStorage[b])==="undefined"){return}var f=localStorage[b].split(',');for(var d=0,g=f.length;d<g;d++){c.find('.js-tree-id-'+f[d]).first().find('.js-tree-ul').first().hide().end().end().find('.js-tree-ctrl').first().addClass('js-tree-h')}})});;$(function(){$('.js-typeahead-hm').typeahead({name:'time',local:["00:00","00:15","00:30","00:45","01:00","01:15","01:30","01:45","02:00","02:15","02:30","02:45","03:00","03:15","03:30","03:45","04:00","04:15","04:30","04:45","05:00","05:15","05:30","05:45","06:00","06:15","06:30","06:45","07:00","07:15","07:30","07:45","08:00","08:15","08:30","08:45","09:00","09:15","09:30","09:45","10:00","10:15","10:30","10:45","11:00","11:15","11:30","11:45","12:00","12:15","12:30","12:45","13:00","13:15","13:30","13:45","14:00","14:15","14:30","14:45","15:00","15:15","15:30","15:45","16:00","16:15","16:30","16:45","17:00","17:15","17:30","17:45","18:00","18:15","18:30","18:45","19:00","19:15","19:30","19:45","20:00","20:15","20:30","20:45","21:00","21:15","21:30","21:45","22:00","22:15","22:30","22:45","23:00","23:15","23:30","23:45"]})});;

Test runner

Ready to run.

Testing in
TestOps/sec
original
original(10);
original(10000);
ready
minified
minified(10);
minified(10000);
ready
diy
diy(10);
diy(10000);
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.