diff --git a/css/settings.css b/css/settings.css index 5b58f9bd..a56bbeb4 100644 --- a/css/settings.css +++ b/css/settings.css @@ -129,6 +129,14 @@ margin: 15px 0; } +.import-section-title { + display : inline-block; +} + +.import-section-title-small { + width: 35px; +} + .import-section-disabled { color : #888; } @@ -139,17 +147,20 @@ width: 60px; border : 1px dashed #999; border-radius: 3px; - margin-left : 10px; } .import-resize-field { width: 30px; - margin: 0px 8px; + margin-right: 8px; text-align: right; } +.import-resize-field:nth-of-type(2) { + margin-left: 5px; +} + .file-input-button { - margin: 0px 8px; + margin-right: 8px; border-radius: 2px; } @@ -164,4 +175,9 @@ font-style: italic; font-weight: normal; text-shadow: none; +} + +[name=smooth-resize-checkbox] { + margin : 0 8px; + vertical-align: middle; } \ No newline at end of file diff --git a/js/controller/settings/ImportController.js b/js/controller/settings/ImportController.js index f28166f9..4a7e73cd 100644 --- a/js/controller/settings/ImportController.js +++ b/js/controller/settings/ImportController.js @@ -9,18 +9,18 @@ }; ns.ImportController.prototype.init = function () { - this.importForm = $("[name=import-form]"); - this.hiddenFileInput = $("[name=file-upload-input]"); - this.fileInputButton = $(".file-input-button"); - this.fileInputStatus = $(".file-input-status"); + this.importForm = $('[name=import-form]'); + this.hiddenFileInput = $('[name=file-upload-input]'); + this.fileInputButton = $('.file-input-button'); + this.fileInputStatus = $('.file-input-status'); this.fileInputStatus.html(DEFAULT_FILE_STATUS); - this.importPreview = $(".import-section-preview"); + this.importPreview = $('.import-section-preview'); - this.resizeWidth = $("[name=resize-width]"); - this.resizeHeight = $("[name=resize-height]"); - this.smoothResize = $("[name=smooth-resize-checkbox]"); - this.submitButton = $("[name=import-submit]"); + this.resizeWidth = $('[name=resize-width]'); + this.resizeHeight = $('[name=resize-height]'); + this.smoothResize = $('[name=smooth-resize-checkbox]'); + this.submitButton = $('[name=import-submit]'); this.importForm.submit(this.onImportFormSubmit_.bind(this)); this.hiddenFileInput.change(this.onFileUploadChange_.bind(this)); @@ -77,7 +77,7 @@ this.enableDisabledSections_(); } else { this.reset_(); - throw "File is not an image : " + file.type; + throw 'File is not an image : ' + file.type; } } }; @@ -119,7 +119,8 @@ this.resizeWidth.val(w); this.resizeHeight.val(h); - this.importPreview.width("auto"); + this.importPreview.width('auto'); + this.importPreview.html(''); this.importPreview.append(this.createImagePreview_()); }; @@ -144,7 +145,7 @@ ns.ImportController.prototype.importImageToPiskel_ = function () { if (this.importedImage_) { - if (window.confirm("You are about to create a new Piskel, unsaved changes will be lost.")) { + if (window.confirm('You are about to create a new Piskel, unsaved changes will be lost.')) { var w = this.resizeWidth.val(), h = this.resizeHeight.val(), smoothing = !!this.smoothResize.prop('checked'); diff --git a/templates/settings/import.html b/templates/settings/import.html index 405cd092..fec1b5c1 100644 --- a/templates/settings/import.html +++ b/templates/settings/import.html @@ -5,7 +5,7 @@
- File : + File :
- Preview : + Info :
- Size : + Size : x