Commit 90698141 authored by Jonathan Wilkes's avatar Jonathan Wilkes
Browse files

Merge branch 'aggraef/purr-data-canvas-find-improvements'

parents 5da5e37e 149b0e00
......@@ -262,6 +262,7 @@
"canvas": {
"paste_clipboard_prompt": "Warnung: Sie sind dabei, Pd-Code einzufügen, der außerhalb von Pd erstellt wurde. Möchten Sie fortfahren?",
"save_dialog": {
"prompt": "Speichern der Änderungen in",
"yes": "Ja",
"yes_tt": "Speichern der Änderungen in einer Datei vor dem Schließen des Patches",
"no": "Nein",
......@@ -270,7 +271,10 @@
"cancel_tt": "Kein Speichern der Änderungen und kein Schließen des Patches"
},
"find": {
"placeholder": "Suche im Patch"
"placeholder": "Suche im Patch",
"search": "Suche",
"search_tt": "Das nächste Vorkommen suchen",
"whole_word": "Ganze Wörter"
},
"menu": {
"props": "Einstellungen",
......
......@@ -262,6 +262,7 @@
"canvas": {
"paste_clipboard_prompt": "Warning: you are about to paste Pd code that came from somewhere outside of Pd. Do you want to continue?",
"save_dialog": {
"prompt": "Do you want to save the changes you made in",
"yes": "Yes",
"yes_tt": "Write the changes to file before closing the patch",
"no": "No",
......@@ -270,7 +271,10 @@
"cancel_tt": "Don't save any changes, and don't close the patch"
},
"find": {
"placeholder": "Search in Canvas"
"placeholder": "Search in Canvas",
"search": "Search",
"search_tt": "Find next occurrence",
"whole_word": "Match Whole Word"
},
"menu": {
"props": "Properties",
......
......@@ -31,19 +31,20 @@
defaultValue="Search in Canvas"
style="width:10em"/>
</label>
<label>Match Whole Word
<label><span data-i18n="canvas.find.whole_word"></span>
<input type="checkbox"
id="canvas_find_whole_word"
name="canvas_find_whole_word"
onchange="canvas_find_whole_word(this);"/>
</label>
<input type="button"
id="canvas_find_button"
name="canvas_find_button"
value="Search"/>
<button type="button"
id="canvas_find_button"
data-i18n="[title]canvas.find.search_tt">
<span data-i18n="canvas.find.search"></span>
</button>
</div>
<dialog id="save_before_quit">
<h4>Do you want to save the changes you made in
<h4><span data-i18n="canvas.save_dialog.prompt"></span>
<span id="save_before_quit_filename"></span>?
</h4>
<div class="submit_buttons">
......
......@@ -148,6 +148,10 @@ function canvas_find_focus() {
canvas_events.search();
}
function canvas_find_reset() {
canvas_events.find_reset();
}
var canvas_events = (function() {
var name,
state,
......@@ -728,6 +732,9 @@ var canvas_events = (function() {
match_words: function(state) {
match_words_state = state;
},
find_reset: function() {
last_search_term = "";
},
add_scalar_draggable: function(cid, tag, scalar_sym, drawcommand_sym,
event_name) {
scalar_draggables[tag] = {
......@@ -1180,6 +1187,9 @@ function nw_create_patch_window_menus(gui, w, name) {
// canvas atm. But if there are other states added later,
// we might need to fetch the previous state here.
canvas_events.normal();
// this resets the last search term so that the next search
// starts from the beginning again
canvas_events.find_reset();
}
}
});
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment