/*jshint bitwise:false, curly:true, eqeqeq:true, evil:true, forin:false, noarg:true, noempty:true, nonew:true, undef:false, strict:false, browser:true, jquery:true */ $(function() { var blocked_tags = (Cookies.get("ui-blocked-tags") || "").split(" "); var needs_refresh = false; for(var i=0; i input[placeholder="Search"]').parent().submit(function(e){ var input = $('form > input[placeholder="Search"]'); var tagArr = input.val().split(" "); var rand = (($.inArray("order:random", tagArr) + 1) || ($.inArray("order=random", tagArr) + 1)) - 1; if(rand !== -1){ tagArr[rand] = "order:random_"+Math.floor((Math.random()*9999)+1); input.val(tagArr.join(" ")); } }); }); function select_blocked_tags() { var blocked_tags = prompt("Enter tags to ignore", Cookies.get("ui-blocked-tags") || "My_Little_Pony"); if(blocked_tags !== null) { Cookies.set("ui-blocked-tags", blocked_tags.toLowerCase(), {expires: 365}); location.reload(true); } }