User:Hulothe/wikia.js

//__NOWYSIWYG__  ' + lng.undoedits + '  ');    $('#find-and-replace').click(function  { var searchfor = '', searchexp, $textarea = $('#wpTextbox1'), replacewith = $('#replace_with').val.replace(/\r/gi, ''), text = $textarea.val.replace(/\r/gi, ''), flagg = 'g', flagi = 'i'; if ($('#globl').prop('checked') === false) { flagg = ''; }       if ($('#case_sen').prop('checked') === true) { flagi = ''; }       var flags = flagg + flagi + 'm'; searchfor = $('#find_this').val.replace(/\r/gi, '').replace(/([.*+?^=!:${}|\[\]\/\\])/g,'\\$1'); searchexp = new RegExp(searchfor, flags); var rcount = 0; var matched = text.match(searchexp); if (matched !== null) { rcount = matched.length; }       text = text.replace(searchexp, replacewith); $textarea.val(text); $('#far-found').text( rcount + ' ' + lng.farfound ); });   function getOldContent {        $("#wpTextbox1").val($("#wpTextbox1").text);    }    $('a#far-alb').click(function { $('#replace_with').val($('#replace_with').val+'\n'); })   $('a#far-undo').click(function  { if (confirm(lng.undomsg)) getOldContent; });   $(".far-module h3").click(function  { var $header = $(this); var $content = $header.next; var $visible = $content.is(":visible"); $header.find('span').text(lng.far + " (" + ($visible ? lng.expand : lng.collapse) + ")"); $header.find(".chevron").addClass($visible ? "expand" : "collapse").removeClass($visible ? "collapse" : "expand"); $content.stop.slideToggle(500); });   $(window).bind("beforeunload", function{ $.storage.set("FindAndReplace", {sh: $("#findfielddiv").is(":visible"), gm: $('#globl').prop('checked'), cs: $('#case_sen').prop('checked')}); }); }); // //