From 06e1d514d3ab31269add6b120fd9481c895fa449 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Aleksander=20=C5=81ukasz?= Date: Mon, 15 Jul 2013 12:46:33 +0200 Subject: [PATCH] Adding "replace all" functionality to replace find & replace tool --- apps/wiki/locale/pl/LC_MESSAGES/django.po | 5 ++++- apps/wiki/templates/wiki/tabs/search_view.html | 2 ++ redakcja/static/js/wiki/view_search.js | 5 ++++- 3 files changed, 10 insertions(+), 2 deletions(-) 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){ -- 2.20.1