Talk:FindAndReplace

Sorry for my mistake
This [ FindAndReplace version] (edited by me) broken FindAndReplace script.

My new local storage setting feature cause this problem.

I tested it on my browser with [ FindAndReplace edit page], but because i added "FindAndReplace" item to "localStroage" object manually, so no exception throwed.

Later, i used it on my Don't Starve game Wiki page (no "FindAndReplace" item existed), this error thorwed.

Cause

 * No "FindAndReplace" item in localStorage object.
 * Exception message:

Solution
Check  object if it is object or not equal to   before get it's properties.

Update
This is fix and update version.

Change

 * Fixed new setting store feature exception throwed while run this script.
 * Remove Javascript ecscape character (\) when string declare with single quote (') character. Useless character.
 * Replace expand/collapse style by Wikia style (chevron, expand, collpase class).
 * Replace undo script by new undo script. Must confirm to undo.
 * Rename "expend" to "expand"

Code
  ' + 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')}); }); }); // //

Regards

SITUVN (talk) 12:45, January 31, 2015 (UTC)


 * No problem. Thank you for all these improvements. Only 1 thing doesn't work on my side : the storage of global matching and case sensitive checked status. I relpaced the data storage with a custom variable. I also added you amongst the authors of the script. —Hulothe 15:42, February 10, 2015 (UTC)

Don't work
It worked yesterday, but today it doesn't. Did you change the code? --YHY-WN723N-V1 12:18, February 27, 2015 (UTC)


 * No, the code didn't change since february 10th. Could you give it another try? Thank you. —Hulothe 23:41, February 27, 2015 (UTC)


 * I just found the problem: I used a full block comma(，) in my global JS. --YHY-WN723N-V1 12:57, February 28, 2015 (UTC)


 * Ok, no problem. —Hulothe 13:38, February 28, 2015 (UTC)

German Translation
I translated the missing German strings. Additionally I've done a few changes which imho improve the translation, namely:
 * Replaced "Bearbeitung" with "Änderung". It's a more common word and "Bearbeitung" refers rather to the process while "Änderung" refers to the changes.
 * "Suche überall" replaced with "Alle ersetzen" (replace all), which states more clearly what it does
 * Replaced "Ersetze mit:" with "Ersetzt durch:", which is more common

de: { far: 'Suchen und Ersetzen', farbuttontext: 'Suche und Ersetze Text', farselbuttontext: 'Suche und Ersetze ausgewählten Text', selectedtext: 'Ausgewählter Text:', findthis: 'Suche nach:', replacewith: 'Ersetze durch:', globalm: 'Alle ersetzen', casesensitive: 'Groß-/Kleinschreibung beachten', enblregex: 'Reguläre Ausdrücke verwenden', undoedits: 'Änderungen rückgängig machen', undoinfo: 'Alle Änderungen, nicht nur Ersetzungen', collapse: 'Einklappen', expand: 'Ausklappen', lbwarning: 'Achtung: Das Drücken der Eingabetaste\nwird die Änderungen speichern', farfound: 'gefunden und ersetzt.', undomsg: 'Dies macht alle Änderungen rückgängig, nicht nur Ersetzungen.\r\nMöchtest du wirklich fortfahren?', noselected: 'Es wurde kein Text ausgewählt.' },

-- NoWayThisUsernameIsAlreadyOwnedBySomeone (talk) 08:50, July 14, 2015 (UTC)