summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorViraj Mahesh <virajmahesh@gmail.com>2014-04-28 01:11:23 -0700
committerViraj Mahesh <virajmahesh@gmail.com>2014-04-28 01:11:23 -0700
commitd3ec80f3748eeed2f6a4f7c75c85d56388171e2a (patch)
treef22ad3f23c36497d5429d5f9f488c70473a326e9
parentf56dc8ecf5f2845ed40b62eec4e0e2227bebd5ba (diff)
downloadsnap-d3ec80f3748eeed2f6a4f7c75c85d56388171e2a.tar.gz
snap-d3ec80f3748eeed2f6a4f7c75c85d56388171e2a.zip
Commented out popup
-rw-r--r--morphic.js21
-rw-r--r--objects.js9
2 files changed, 19 insertions, 11 deletions
diff --git a/morphic.js b/morphic.js
index b55b180..329c3ed 100644
--- a/morphic.js
+++ b/morphic.js
@@ -10353,16 +10353,17 @@ WorldMorph.prototype.initEventListeners = function () {
false
);
- window.onbeforeunload = function (evt) {
- var e = evt || window.event,
- msg = "Are you sure you want to leave?";
- // For IE and Firefox
- if (e) {
- e.returnValue = msg;
- }
- // For Safari / chrome
- return msg;
- };
+ // window.onbeforeunload = function (evt) {
+ // var e = evt || window.event,
+ // msg = "Are you sure you want to leave?";
+ // // For IE and Firefox
+ // if (e) {
+ // e.returnValue = msg;
+ // }
+ // // For Safari / chrome
+ // return msg;
+ // };
+ window.onbeforeunload = null;
};
WorldMorph.prototype.mouseDownLeft = function () {
diff --git a/objects.js b/objects.js
index ea07e6e..c4e857c 100644
--- a/objects.js
+++ b/objects.js
@@ -4764,7 +4764,14 @@ StageMorph.prototype.userMenu = function () {
menu.addItem(
"pic...",
function () {
- window.open(myself.fullImageClassic().toDataURL());
+ //window.open();
+ //window.location.href =
+ var ref = myself.fullImageClassic().toDataURL().replace(/^data:image\/[^;]/, 'data:application/octet-stream');
+ var link = document.createElement('a');
+ link.download = 'download.png';
+ link.href = ref;
+ link.click();
+ console.log("here");
},
'open a new window\nwith a picture of the stage'
);