diff --git a/src/ui/interface.js b/src/ui/interface.js index e354adc0..f7f6ad02 100644 --- a/src/ui/interface.js +++ b/src/ui/interface.js @@ -40,7 +40,6 @@ module.exports = function Interface(options) { Presets = require('../ui/presets')(options, save_infragrammar_inputs); Analysis = require('../ui/analysis')(options, save_infragrammar_inputs); Colorize = require('../ui/colorize')(options); - Saving = require('../ui/saving')(options); $(options.imageSelector).ready(function() { diff --git a/src/ui/saving.js b/src/ui/saving.js deleted file mode 100644 index 007abf6a..00000000 --- a/src/ui/saving.js +++ /dev/null @@ -1,40 +0,0 @@ -module.exports = function Saving(options) { - - // This is all unused... - - $("#download").click(function() { - downloadImage(); - return true; - }); - - // refactor this, it's a mess: - $("#save").click(saveImage); - - function saveImage() { - var img; - function sendThumbnail() { - img = options.processor.getCurrentImage(); - return FileUpload.uploadThumbnail(img, function() { - $("#form-filename").val(FileUpload.getFilename()); - $("#form-log").val(JSON.stringify(logger.log)); - return $("#save-form").submit(); - }); - }; - $("#save").prop("disabled", true); - $("#save").html("Saving..."); - if (FileUpload.getFilename() === "") { - img = options.processor.getCurrentImage(); - FileUpload.fromBase64("camera", img, sendThumbnail); - } else if (FileUpload.isLoadedFromFile() === false) { - FileUpload.duplicate(sendThumbnail); - } else { - sendThumbnail(); - } - return img; - } - - return { - saveImage: saveImage - } - -}