From e01b09c3df3039b3cf790f74f0126a09d1744712 Mon Sep 17 00:00:00 2001
From: Jonathan Wilkes <jon.w.wilkes@gmail.com>
Date: Sun, 12 Jul 2015 20:03:55 -0400
Subject: [PATCH] fix bug with "Save As" not triggering on repeated tries

---
 pd/nw/pd_canvas.html |  2 ++
 pd/nw/todo.txt       | 23 ++++++++++++-----------
 2 files changed, 14 insertions(+), 11 deletions(-)

diff --git a/pd/nw/pd_canvas.html b/pd/nw/pd_canvas.html
index 342a18b27..18f74ee1f 100644
--- a/pd/nw/pd_canvas.html
+++ b/pd/nw/pd_canvas.html
@@ -252,6 +252,8 @@ var canvas_events = (function() {
     document.querySelector("#saveDialog").addEventListener("change",
         function(evt) {
             pdgui.saveas_callback(name, this.value);
+            // reset value so that we can open the same file twice
+            this.value = null;
             console.log("tried to open something");
         }, false
     );
diff --git a/pd/nw/todo.txt b/pd/nw/todo.txt
index f3b7c6748..94f55cb74 100644
--- a/pd/nw/todo.txt
+++ b/pd/nw/todo.txt
@@ -21,18 +21,17 @@ Event settings for edit mode
 *need to be able to tell the difference between new obj and retexted
 obj
 
-Problems to put off until all (or most) sys_vgui calls are eliminated:
-1) gui-side parser inside -- pdgui.js.  Currently we're splitting on newlines so we can separate
-   gui_vmess from sys_vgui calls.  This makes it very difficult to handle multi-line msg and text
-   boxes.
-2) Semicolons -- currently the parser can't tell the difference between semicolons inside symbols
-   and semicolons that end statements.  Again, this will be easy to solve once we eliminate sys_gui.
-
 HTML5 which may not be standard yet:
 1) mouse.pageX/pageY -- exist in Chromium but maybe not in FF et al.
 2) svg 'overflow' attribute -- probably doesn't work in other browsers
 3) document.body.scrollTop (might be Chromium-specific, not sure)
-3) document.body.scrollLeft (might be Chromium-specific, not sure)
+4) document.body.scrollLeft (might be Chromium-specific, not sure)
+
+Problems to put off until all (or most) sys_vgui calls are eliminated:
+[x] gui-side parser inside -- pdgui.js
+[ ] Semicolons -- currently the parser can't tell the difference between
+    semicolons inside symbols and semicolons that end statements. Again,
+    this will be easy to solve once we eliminate sys_gui altogether
 
 Node-webkit stuff:
 1) popup API
@@ -44,10 +43,12 @@ Node-webkit stuff:
 Everything else: (A [x] means we've fixed it)
 [ ] packaging as app, setting correct appname, etc
 [ ] get -unique to work (relied on tcl [send] command)
-[ ] check if patch windows with screenposition (0,0) get stuck underneath Ubuntu/OSX menu.  If so,
+[ ] check if patch windows with screenposition (0,0) get stuck underneath
+    Ubuntu/OSX menu.
 [ ] Node-webkit has a "screen" interface to retrieve the "workable" area of the screen
-[x] choosing the same directory multiple times doesn't work (see dialog API page)
-[ ] "Save As" on an overwrite doesn't seem to clear the dirty flag
+[x] choosing the same directory multiple times doesn't work
+    (see dialog API page)
+[x] "Save As" on an overwrite doesn't seem to clear the dirty flag
 [ ] figure out why there is a "pd_opendir" global var
 [ ] pass k12 mode arg
 [ ] implement recent files (using Pd's prefs loading mechanism instead of reimplementing gui prefs)
-- 
GitLab