From: Aleksander Łukasz Date: Mon, 15 Jul 2013 10:46:33 +0000 (+0200) Subject: Adding "replace all" functionality to replace find & replace tool X-Git-Url: https://git.mdrn.pl/redakcja.git/commitdiff_plain/06e1d514d3ab31269add6b120fd9481c895fa449?ds=inline;hp=1c8de9a0fa5d7adb8dc595e1935704da088ee2dd Adding "replace all" functionality to replace find & replace tool --- diff --git a/apps/wiki/locale/pl/LC_MESSAGES/django.po b/apps/wiki/locale/pl/LC_MESSAGES/django.po index 1dd02fce..a6797240 100644 --- a/apps/wiki/locale/pl/LC_MESSAGES/django.po +++ b/apps/wiki/locale/pl/LC_MESSAGES/django.po @@ -199,7 +199,10 @@ msgstr "Zamień na" msgid "Replace" msgstr "Zamień" -#: templates/wiki/tabs/search_view.html:13 +#: templates/wiki/tabs/search_view.html:12 +msgid "Replace all" +msgstr "Zamień wszystko" + msgid "Options" msgstr "Opcje" diff --git a/apps/wiki/templates/wiki/tabs/search_view.html b/apps/wiki/templates/wiki/tabs/search_view.html index 4bf1e893..2ed15eca 100644 --- a/apps/wiki/templates/wiki/tabs/search_view.html +++ b/apps/wiki/templates/wiki/tabs/search_view.html @@ -8,6 +8,8 @@

{% trans "Replace with" %}:


+ +

{% trans "Options" %}
diff --git a/redakcja/static/js/wiki/view_search.js b/redakcja/static/js/wiki/view_search.js index 64a35c44..e41f19d6 100644 --- a/redakcja/static/js/wiki/view_search.js +++ b/redakcja/static/js/wiki/view_search.js @@ -90,7 +90,10 @@ else {} self.searchCursor.select(); self.searchCursor.replace(query); - self.search(); + if(self.options['replace-all']) { + while(self.search()) + self.replace(); + } }; SearchPerspective.prototype.onEnter = function(success, failure){