|
@@ -74,23 +74,26 @@
|
|
|
}else{
|
|
|
//Paste Mode
|
|
|
document.onpaste = function(event){
|
|
|
- var items = (event.clipboardData || event.originalEvent.clipboardData).items;
|
|
|
- console.log(JSON.stringify(items)); // will give you the mime types
|
|
|
- for (index in items) {
|
|
|
- var item = items[index];
|
|
|
- if (item.kind === 'file') {
|
|
|
- var blob = item.getAsFile();
|
|
|
- var reader = new FileReader();
|
|
|
- reader.onload = function(event){
|
|
|
- console.log(event.target.result);
|
|
|
- $("#preview").attr("src", event.target.result);
|
|
|
- uploadImageToTarget();
|
|
|
- }; // data url!
|
|
|
- reader.readAsDataURL(blob);
|
|
|
- currentViewingPhotoBlob = blob;
|
|
|
+ var items = (event.clipboardData || event.originalEvent.clipboardData).items;
|
|
|
+ console.log(JSON.stringify(items)); // will give you the mime types
|
|
|
+ for (index in items) {
|
|
|
+ var item = items[index];
|
|
|
+ if (item.kind === 'file') {
|
|
|
+ var blob = item.getAsFile();
|
|
|
+ var reader = new FileReader();
|
|
|
+ reader.onload = function(event){
|
|
|
+ console.log(event.target.result);
|
|
|
+ $("#preview").attr("src", event.target.result);
|
|
|
+ if (uploadOnPaste){
|
|
|
+ uploadImageToTarget();
|
|
|
+ }
|
|
|
+
|
|
|
+ }; // data url!
|
|
|
+ reader.readAsDataURL(blob);
|
|
|
+ currentViewingPhotoBlob = blob;
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
-
|
|
|
- }
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -104,7 +107,7 @@
|
|
|
});
|
|
|
|
|
|
ao_module_storage.loadStorage("imgPaste", "savepath", function(data){
|
|
|
- savePath = data;
|
|
|
+ savePath = data || "user:/Desktop";
|
|
|
$("#savepath").val(savePath);
|
|
|
});
|
|
|
|