{include file='include/tag_selection.inc.tpl'} {html_style} .showInfo { text-indent:5px; } {/html_style} {footer_script require='jquery'} jQuery('.showInfo').tipTip({ 'delay' : 0, 'fadeIn' : 200, 'fadeOut' : 200, 'maxWidth':'300px', 'keepAlive':true, 'activation':'click' }); function displayDeletionWarnings() { jQuery(".warningDeletion").show(); jQuery("input[name=destination_tag]:checked").parent("label").children(".warningDeletion").hide(); } displayDeletionWarnings(); jQuery("#mergeTags label").click(function() { displayDeletionWarnings(); }); jQuery("input[name=merge]").click(function() { if (jQuery("ul.tagSelection input[type=checkbox]:checked").length < 2) { alert("{'Select at least two tags for merging'|@translate}"); return false; } }); $("#searchInput").on("keydown", function(e) { var $this = $(this), timer = $this.data("timer"); if (timer) { clearTimeout(timer); } $this.data("timer", setTimeout(function() { var val = $this.val(); if (!val) { $(".tagSelection>li").show(); $("#filterIcon").css("visibility","hidden"); } else { $("#filterIcon").css("visibility","visible"); var regex = new RegExp( val.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&"), "i" ); $(".tagSelection>li").each(function() { var $li = $(this), text = $.trim( $("label", $li).text() ); $li.toggle(regex.test(text)); }); } }, 300) ); if (e.keyCode == 13) { // Enter e.preventDefault(); } }); {/footer_script}