use alertify instead of browser prompt
This commit is contained in:
parent
71c59d7ae2
commit
ce5dbaeafd
@ -4,6 +4,7 @@
|
|||||||
<meta content="text/html; charset=utf-8" http-equiv="content-type"/>
|
<meta content="text/html; charset=utf-8" http-equiv="content-type"/>
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
||||||
<script data-bootload="main.js" data-main="/common/boot.js" src="/bower_components/requirejs/require.js"></script>
|
<script data-bootload="main.js" data-main="/common/boot.js" src="/bower_components/requirejs/require.js"></script>
|
||||||
|
<link rel="stylesheet" href="/customize/main.css" />
|
||||||
<style>
|
<style>
|
||||||
html, body{
|
html, body{
|
||||||
padding: 0px;
|
padding: 0px;
|
||||||
|
|||||||
@ -16,22 +16,13 @@ define([
|
|||||||
//'/customize/pad.js'
|
//'/customize/pad.js'
|
||||||
], function (Config, Realtime, Crypto, TextPatcher, JSONSortify, JsonOT, Cryptpad) {
|
], function (Config, Realtime, Crypto, TextPatcher, JSONSortify, JsonOT, Cryptpad) {
|
||||||
var saveAs = window.saveAs;
|
var saveAs = window.saveAs;
|
||||||
|
var Messages = Cryptpad.Messages;
|
||||||
|
|
||||||
var module = window.APP = { };
|
var module = window.APP = { };
|
||||||
var $ = module.$ = window.jQuery;
|
var $ = module.$ = window.jQuery;
|
||||||
var Fabric = module.Fabric = window.fabric;
|
var Fabric = module.Fabric = window.fabric;
|
||||||
|
|
||||||
var secret = Cryptpad.getSecrets();
|
var secret = Cryptpad.getSecrets();
|
||||||
/*
|
|
||||||
var key;
|
|
||||||
var channel = '';
|
|
||||||
if (!/#/.test(window.location.href)) {
|
|
||||||
key = Crypto.genKey();
|
|
||||||
} else {
|
|
||||||
var hash = window.location.hash.slice(1);
|
|
||||||
channel = hash.slice(0, 32);
|
|
||||||
key = hash.slice(32);
|
|
||||||
}*/
|
|
||||||
|
|
||||||
/* Initialize Fabric */
|
/* Initialize Fabric */
|
||||||
var canvas = module.canvas = new Fabric.Canvas('canvas');
|
var canvas = module.canvas = new Fabric.Canvas('canvas');
|
||||||
@ -65,11 +56,12 @@ define([
|
|||||||
};
|
};
|
||||||
|
|
||||||
var saveImage = module.saveImage = function () {
|
var saveImage = module.saveImage = function () {
|
||||||
$canvas[0].toBlob(function (blob) {
|
var defaultName = "pretty-picture.png";
|
||||||
var defaultName = "pretty-picture.png";
|
Cryptpad.prompt(Messages.exportPrompt, defaultName, function (filename) {
|
||||||
// TODO make this translatable
|
if (!(typeof(filename) === 'string' && filename)) { return; }
|
||||||
saveAs(blob, window.prompt("What would you like to name your image?",
|
$canvas[0].toBlob(function (blob) {
|
||||||
defaultName) || "pretty-picture.png");
|
saveAs(blob, filename);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user