Adding "replace all" functionality to replace find & replace tool
authorAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Mon, 15 Jul 2013 10:46:33 +0000 (12:46 +0200)
committerAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Mon, 15 Jul 2013 10:46:33 +0000 (12:46 +0200)
apps/wiki/locale/pl/LC_MESSAGES/django.po
apps/wiki/templates/wiki/tabs/search_view.html
redakcja/static/js/wiki/view_search.js

index 1dd02fc..a679724 100644 (file)
@@ -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"
 
index 4bf1e89..2ed15ec 100644 (file)
@@ -8,6 +8,8 @@
     <p>{% trans "Replace with" %}:<br/>
         <input id='replace-input' /><br/>
         <button id='replace-button'>{% trans "Replace" %}</button><br/>
+        <input type="checkbox" id="replace-all" />
+            <label for="replace-all">{% trans "Replace all" %}</label><br/>
     </p>
 
     <p>{% trans "Options" %}<br/>
index 64a35c4..e41f19d 100644 (file)
         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){