diff --git a/wire/modules/Process/ProcessPageEditImageSelect/ProcessPageEditImageSelect.js b/wire/modules/Process/ProcessPageEditImageSelect/ProcessPageEditImageSelect.js index 9245c60a..73fb81ad 100644 --- a/wire/modules/Process/ProcessPageEditImageSelect/ProcessPageEditImageSelect.js +++ b/wire/modules/Process/ProcessPageEditImageSelect/ProcessPageEditImageSelect.js @@ -83,19 +83,20 @@ function setupExecuteVariations() { function setupSelectedImage() { var croppingActive = false; + var inputPixelsActive = false; var $form = $("#selected_image_settings"); var $container = $("#selected_image_container"); var $img = $("#selected_image"); var $hidpi = $("#selected_image_hidpi"); var fullWidth; // full/original width when not resized - var minWidth = parseInt($("#input_width").attr('min')); - var minHeight = parseInt($("#input_height").attr('min')); + var minWidth = 0; //parseInt($("#input_width").data('min')); + var minHeight = 0; // parseInt($("#input_height").data('min')); function setupImage($img) { var originalWidth = $img.width(); - var maxWidth = $("#input_width").attr('max'); - var maxHeight = $("#input_height").attr('max'); + var maxWidth = 9999; // $("#input_width").data('max'); + var maxHeight = 9999; // $("#input_height").data('max'); function updateHidpiCheckbox(w) { @@ -158,8 +159,8 @@ function setupSelectedImage() { alsoResize: "#selected_image_container", maxWidth: maxWidth, maxHeight: maxHeight, - minWidth: minWidth < 10 ? 10 : minWidth, - minHeight: minHeight < 10 ? 10 : minHeight, + minWidth: 10, //minWidth < 10 ? 10 : minWidth, + minHeight: 10, //minHeight < 10 ? 10 : minHeight, start: function() { $form.addClass('resizing_active'); }, @@ -299,35 +300,65 @@ function setupSelectedImage() { } - function inputPixelsChange() { + function inputPixelsChange(event) { + + if(inputPixelsActive) return; if($(this).parents("#crop_coordinates").length) return; + + inputPixelsActive = true; - var w, h; - + var w, h, + abort = false, + noChange = false, + oldWidth = $img.attr('width'), + oldHeight = $img.attr('height'), + origWidth = parseInt($img.attr('data-origwidth')), + origHeight = parseInt($img.attr('data-origheight')); + + oldWidth = typeof oldWidth == "undefined" ? $img.width() : parseInt(oldWidth); + oldHeight = typeof oldHeight == "undefined" ? $img.height() : parseInt(oldHeight); + if($(this).attr('id') == 'input_width') { w = parseInt($(this).val()); - h = (w / $img.attr('width')) * $img.attr('height'); + h = (origHeight / (origWidth / w)); + if(w == oldWidth) noChange = true; } else { h = parseInt($(this).val()); - w = (h / $img.attr('height')) * $img.attr('width'); + w = Math.round((h / oldHeight) * oldWidth); + w = (origWidth / (origHeight / h)); + if(h == oldHeight) noChange = true; } - w = Math.floor(w); - h = Math.floor(h); - - if(w < 1 || h < 1 || w == $img.attr('width') || h == $img.attr('height') || w > maxWidth || (minWidth > 1 && w < minWidth) || (minHeight > 1 && h < minHeight)) { - $("#input_width").val($img.attr('width')); - $("#input_height").val($img.attr('height')); + if(w < 1 || h < 1 || noChange) { + // requested dimension too small, or image already at requested dimension + abort = 1; + } else if(maxWidth > 0 && w > maxWidth) { + // requested dimension exceeds maximum + abort = 2; + } else if((minWidth > 1 && w < minWidth) || (minHeight > 1 && h < minHeight)) { + // requested dimension smaller than minimum allowed + abort = 3; + } + + if(abort) { + $("#input_width").val(oldWidth); + $("#input_height").val(oldHeight); + inputPixelsActive = false; return false; } + + var wRounded = Math.round(w); + var hRounded = Math.round(h); setupImageResizable(); - $("#input_height").val(h); + $("#input_height").val(hRounded); $container.width(w).height(h); $img.parent('.ui-wrapper').width(w).height(h); - $img.width(w).height(h).attr('width', w).attr('height', h); - $img.addClass('resized'); + $img.width(w).height(h) + .attr('width', wRounded).attr('height', hRounded) + .addClass('resized'); populateResizeDimensions(); + inputPixelsActive = false; } function alignClassChange() { @@ -354,6 +385,10 @@ function setupSelectedImage() { var origWidth = parseInt($img.attr('data-origwidth')); if(origWidth > maxWidth) origWidth = maxWidth; //console.log('origWidth=' + origWidth); + if(origWidth > $(window).width()) { + // new width exceeds window size + $('#content').css('overflow-x', 'auto'); + } $("#input_width").val(origWidth).change(); }); @@ -361,7 +396,7 @@ function setupSelectedImage() { var imgWidth = $img.width(); var imgHeight = $img.height(); var windowWidth = $(window).width() - 30; - var windowHeight = $(window).height() - $("#wrap_info").height() - 20; + var windowHeight = $(window).height() - $("#wrap_info").height() - 60; var updated = false; if(imgHeight > windowHeight) { @@ -431,7 +466,7 @@ function setupSelectedImage() { $("#wrap_description").slideDown('fast'); } }); - + /* $("#rotate_right_action, #rotate_left_action").click(function() { $img.resizable('destroy'); @@ -495,15 +530,19 @@ function setupSelectedImage() { } function fitImageToWindow() { + var winwidth = $(window).width() - 30; - var winheight = $(window).height() - ($("#wrap_info").height() + 80); + var winheight = $(window).height() - ($("#wrap_info").height() + 60); + if($img.width() > winwidth) { $img.width(winwidth).css('height', 'auto').removeAttr('height'); $img.removeAttr('height'); } + if($img.height() > winheight) { $img.removeAttr('width').css('width', 'auto').height(winheight); } + $container.width($img.width()).height($img.height()); } @@ -555,8 +594,7 @@ function setupSelectedImage() { } // setupSelectedImage() $(document).ready(function() { - - var $page_id = $("#page_id"); + var $page_id = $("#page_id"); if($page_id.length > 0) { var page_id = $page_id.val(); $page_id.bind("pageSelected", function (event, data) { @@ -566,11 +604,13 @@ $(document).ready(function() { } if($("#selected_image").length > 0) { - setupSelectedImage(); + setTimeout(function() { + setupSelectedImage(); + }, 250); } else if($("#ImageVariations").length > 0) { setupExecuteVariations(); } - + enablePWImageDialogButtons(); // prevent enter from submitting any of our forms @@ -581,5 +621,4 @@ $(document).ready(function() { } }); - }); diff --git a/wire/modules/Process/ProcessPageEditImageSelect/ProcessPageEditImageSelect.min.js b/wire/modules/Process/ProcessPageEditImageSelect/ProcessPageEditImageSelect.min.js index 862032e8..46fcc6ad 100644 --- a/wire/modules/Process/ProcessPageEditImageSelect/ProcessPageEditImageSelect.min.js +++ b/wire/modules/Process/ProcessPageEditImageSelect/ProcessPageEditImageSelect.min.js @@ -1 +1 @@ -function enablePWImageDialogButtons(){var a=parent.jQuery(".ui-dialog-buttonpane");a.find("button").button("enable");return}function disablePWImageDialogButtons(){var a=parent.jQuery(".ui-dialog-buttonpane");a.find("button").button("disable");return}function closePWImageDialog(){parent.jQuery("iframe.ui-dialog-content").dialog("close")}function setupProcessSaveReloaded(b,a){if(a){var c=parent.jQuery("#"+b).offset().top-20;parent.jQuery("html, body").animate({scrollTop:c},1000,"swing");parent.jQuery("#"+b).hide();setTimeout(function(){parent.jQuery("#"+b).slideDown()},900)}else{parent.jQuery("#"+b).find("img").hide();setTimeout(function(){parent.jQuery("#"+b).find("img").fadeIn("normal",function(){parent.jQuery("#"+b).find(".gridImage__edit").click()})},500)}closePWImageDialog()}function setupProcessSave(e,b,a){var d=false;var c=parent.jQuery("#wrap_Inputfield_"+e);if(!c.length){c=parent.jQuery("#"+b).closest(".Inputfield")}c.trigger("reload");parent.jQuery(".Inputfield").on("reloaded",function(){if(d){return}d=true;if(b.length>0){setTimeout(function(){setupProcessSaveReloaded(b,a)},250)}})}function refreshPageEditField(a){parent.jQuery("#wrap_Inputfield_"+a).trigger("reload")}function setupExecuteVariations(){$(document).on("click","input#delete_all",function(e){if($(this).is(":checked")){$("input.delete").attr("checked","checked")}else{$("input.delete").removeAttr("checked")}e.stopPropagation()});var d={type:"image",closeOnContentClick:true,closeBtnInside:true};$("a.preview").magnificPopup(d);var c=$("#varcnt_id");var a=c.val();var b=c.attr("data-cnt");window.parent.jQuery("#"+a).text(b)}function setupSelectedImage(){var f=false;var i=$("#selected_image_settings");var h=$("#selected_image_container");var b=$("#selected_image");var d=$("#selected_image_hidpi");var e;var c=parseInt($("#input_width").attr("min"));var g=parseInt($("#input_height").attr("min"));function a(k){var m=k.width();var v=$("#input_width").attr("max");var w=$("#input_height").attr("max");function u(x){if(x<(e-(e*0.2))){if(!d.is(":visible")){d.closest("label").fadeIn()}d.removeAttr("disabled")}else{d.attr("disabled","disabled");if(d.is(":visible")){d.closest("label").fadeOut()}}}function s(){var y=k.width();var A=k.height();var z=$("#wrap_link_original");if((A>=w||y>=v)&&i.hasClass("croppable")){y=v;A=w;$("#selected_image_link").removeAttr("checked");z.hide()}else{if(!z.is(":visible")){z.fadeIn();if(z.attr("data-was-checked")==1){z.attr("checked","checked")}}}$("#input_width").val(y);$("#input_height").val(A);k.attr("width",y);k.attr("height",A);u(y);var x=$("#latin");if(x.is(":visible")){x.height(A)}if(!i.hasClass("rte")){var B=$("#selected_image_resize");if(m<=y){B.hide()}else{if(!B.is(":visible")){B.fadeIn()}}}}function t(){k.resizable({aspectRatio:true,handles:"n, ne, e, se, s, sw, w",alsoResize:"#selected_image_container",maxWidth:v,maxHeight:w,minWidth:c<10?10:c,minHeight:g<10?10:g,start:function(){i.addClass("resizing_active")},stop:function(){k.attr("width",k.width()).attr("height",k.height());if(m!=k.width()){k.addClass("resized");if(!i.hasClass("rte")){var x=$("#selected_image_resize_yes");if(!x.is(":checked")){x.attr("checked","checked");$("#selected_image_resize_no").removeAttr("checked")}}}i.removeClass("resizing_active");if($("#resize_action").hasClass("on")){$("#resize_action").click().mouseout()}},resize:s});k.addClass("resizable_setup")}var l=null;function q(){var x=[{html:$("#button_crop").html(),click:function(){$("#button_crop").click()}},{html:$("#button_cancel_crop").html(),click:function(){$("#button_cancel_crop").click()},"class":"ui-priority-secondary"}];$(".show_when_crop").hide();$("#crop_action, .crop_trigger").click(function(D){var B=$(this).attr("data-recrop");if(B&&B.length>0){window.location.assign(B);return true}if(!i.hasClass("croppable")){return}if(f){return false}f=true;$("#selected_image_settings").addClass("cropping_active");$(".hide_when_crop").hide();$(".show_when_crop").show();if(k.hasClass("resizable_setup")){k.resizable("destroy")}var A={autoCrop:true,autoCropArea:0.35,zoomable:false,rotatable:false,maxWidth:k.attr("data-origwidth"),maxHeight:k.attr("data-origheight"),minCropBoxWidth:(c<2?0:c),minCropBoxHeight:(g<2?0:g),minWidth:(c<2?0:c),minHeight:(g<2?0:g),done:function(E){$("#crop_x").val(Math.floor(E.x));$("#crop_y").val(Math.floor(E.y));$("#crop_w").val(Math.floor(E.width));$("#crop_h").val(Math.floor(E.height));l=E}};var C=k.attr("data-crop");if(C&&C.length>0){C=C.split(",");A.data={x:C[0],y:C[1],width:C[2],height:C[3]};setTimeout(function(){disablePWImageDialogButtons(x)},1000)}else{disablePWImageDialogButtons(x)}k.cropper(A);setTimeout(function(){$(".cropper-canvas").width($(".cropper-container").width()).height($(".cropper-container").height())},500);var z=function(){var E={x:parseInt($("#crop_x").val()),y:parseInt($("#crop_y").val()),width:parseInt($("#crop_w").val()),height:parseInt($("#crop_h").val()),rotate:0};k.cropper("setData",E)};$("#crop_coordinates input").change(z)});function y(){k.cropper("destroy");$(".show_when_crop").hide();$(".hide_when_crop").show();f=false;$("#selected_image_settings").removeClass("cropping_active");t();enablePWImageDialogButtons()}$("#button_cancel_crop").click(function(){y()});$("#button_crop").click(function(){if(i.hasClass("processing")){return false}i.addClass("processing");return true});if(k.attr("data-crop")){$("#crop_action").click()}}function n(){if($(this).parents("#crop_coordinates").length){return}var x,y;if($(this).attr("id")=="input_width"){x=parseInt($(this).val());y=(x/k.attr("width"))*k.attr("height")}else{y=parseInt($(this).val());x=(y/k.attr("height"))*k.attr("width")}x=Math.floor(x);y=Math.floor(y);if(x<1||y<1||x==k.attr("width")||y==k.attr("height")||x>v||(c>1&&x1&&yv){y=v}$("#input_width").val(y).change()});$("#min_action").click(function(){var A=k.width();var y=k.height();var B=$(window).width()-30;var C=$(window).height()-$("#wrap_info").height()-20;var z=false;if(y>C){$("#input_height").val(C).change();z=true}if(A>B){$("#input_width").val(B).change();z=true}if(!z){$("#input_width").val(Math.ceil(A/2)).change()}});$("#align_left_action, #align_center_action, #align_right_action").click(function(){var z=$("#selected_image_class");var y=$(this).attr("data-label");if($(this).hasClass("on")){z.children("option").removeAttr("selected");$(this).removeClass("on")}else{$(this).siblings(".on").removeClass("on");z.children("option").removeAttr("selected");z.find("option[data-label="+y+"]").attr("selected","selected");$(this).addClass("on")}z.change()});var x=$("#selected_image_class").find("option[selected=selected]").attr("data-label");if(x){$("#action_icons").find("span[data-label="+x+"]").addClass("on")}$("#resize_action").hover(function(){if($(this).hasClass("on")){return}$("#resize_tips").show();$("#input_width, #input_height").addClass("ui-state-highlight")},function(){if($(this).hasClass("on")){return}$("#resize_tips").hide();$("#input_width, #input_height").removeClass("ui-state-highlight")}).click(function(){if($(this).hasClass("on")){$(this).removeClass("on");$("#input_width, #input_height").removeClass("ui-state-highlight")}else{$(this).addClass("on");$("#input_width, #input_height").addClass("ui-state-highlight")}});$("#description_action").click(function(){if($(this).hasClass("on")){$(this).removeClass("on");$("#wrap_description").slideUp("fast")}else{$(this).addClass("on");$("#wrap_description").slideDown("fast")}})}function j(){$("#selected_image_caption").change(function(){if(i.hasClass("cropping_active")){return}var x=$("#caption_preview");if($(this).is(":checked")){x.fadeIn()}else{if(x.is(":visible")){x.fadeOut()}}}).change()}function r(){var y=$(window).width()-30;var x=$(window).height()-($("#wrap_info").height()+80);if(k.width()>y){k.width(y).css("height","auto").removeAttr("height");k.removeAttr("height")}if(k.height()>x){k.removeAttr("width").css("width","auto").height(x)}h.width(k.width()).height(k.height())}$("#loading_button").hide();if(k.attr("data-fit")){r()}else{h.width(k.width()).height(k.height())}$("#selected_image_settings .input_pixels").change(n);$("#selected_image_class").change(o).change();e=k.attr("data-origwidth");s();q();p();j();$("button.submit_save_copy, button.submit_save_replace").click(function(){i.addClass("processing");disablePWImageDialogButtons()})}if(b.length>0){b=b.first();if(b.width()>0&&b.height()>0){a(b)}else{b.load(function(){b=$(this);a(b)})}}}$(document).ready(function(){var b=$("#page_id");if(b.length>0){var a=b.val();b.bind("pageSelected",function(c,d){if(d.id==a){return}window.location="./?id="+d.id+"&modal=1"})}if($("#selected_image").length>0){setupSelectedImage()}else{if($("#ImageVariations").length>0){setupExecuteVariations()}}enablePWImageDialogButtons();$(window).keydown(function(c){if(c.keyCode==13){c.preventDefault();return false}})}); \ No newline at end of file +function enablePWImageDialogButtons(){var a=parent.jQuery(".ui-dialog-buttonpane");a.find("button").button("enable");return}function disablePWImageDialogButtons(){var a=parent.jQuery(".ui-dialog-buttonpane");a.find("button").button("disable");return}function closePWImageDialog(){parent.jQuery("iframe.ui-dialog-content").dialog("close")}function setupProcessSaveReloaded(b,a){if(a){var c=parent.jQuery("#"+b).offset().top-20;parent.jQuery("html, body").animate({scrollTop:c},1000,"swing");parent.jQuery("#"+b).hide();setTimeout(function(){parent.jQuery("#"+b).slideDown()},900)}else{parent.jQuery("#"+b).find("img").hide();setTimeout(function(){parent.jQuery("#"+b).find("img").fadeIn("normal",function(){parent.jQuery("#"+b).find(".gridImage__edit").click()})},500)}closePWImageDialog()}function setupProcessSave(e,b,a){var d=false;var c=parent.jQuery("#wrap_Inputfield_"+e);if(!c.length){c=parent.jQuery("#"+b).closest(".Inputfield")}c.trigger("reload");parent.jQuery(".Inputfield").on("reloaded",function(){if(d){return}d=true;if(b.length>0){setTimeout(function(){setupProcessSaveReloaded(b,a)},250)}})}function refreshPageEditField(a){parent.jQuery("#wrap_Inputfield_"+a).trigger("reload")}function setupExecuteVariations(){$(document).on("click","input#delete_all",function(e){if($(this).is(":checked")){$("input.delete").attr("checked","checked")}else{$("input.delete").removeAttr("checked")}e.stopPropagation()});var d={type:"image",closeOnContentClick:true,closeBtnInside:true};$("a.preview").magnificPopup(d);var c=$("#varcnt_id");var a=c.val();var b=c.attr("data-cnt");window.parent.jQuery("#"+a).text(b)}function setupSelectedImage(){var g=false;var d=false;var j=$("#selected_image_settings");var i=$("#selected_image_container");var b=$("#selected_image");var e=$("#selected_image_hidpi");var f;var c=0;var h=0;function a(l){var n=l.width();var w=9999;var x=9999;function v(y){if(y<(f-(f*0.2))){if(!e.is(":visible")){e.closest("label").fadeIn()}e.removeAttr("disabled")}else{e.attr("disabled","disabled");if(e.is(":visible")){e.closest("label").fadeOut()}}}function t(){var z=l.width();var B=l.height();var A=$("#wrap_link_original");if((B>=x||z>=w)&&j.hasClass("croppable")){z=w;B=x;$("#selected_image_link").removeAttr("checked");A.hide()}else{if(!A.is(":visible")){A.fadeIn();if(A.attr("data-was-checked")==1){A.attr("checked","checked")}}}$("#input_width").val(z);$("#input_height").val(B);l.attr("width",z);l.attr("height",B);v(z);var y=$("#latin");if(y.is(":visible")){y.height(B)}if(!j.hasClass("rte")){var C=$("#selected_image_resize");if(n<=z){C.hide()}else{if(!C.is(":visible")){C.fadeIn()}}}}function u(){l.resizable({aspectRatio:true,handles:"n, ne, e, se, s, sw, w",alsoResize:"#selected_image_container",maxWidth:w,maxHeight:x,minWidth:10,minHeight:10,start:function(){j.addClass("resizing_active")},stop:function(){l.attr("width",l.width()).attr("height",l.height());if(n!=l.width()){l.addClass("resized");if(!j.hasClass("rte")){var y=$("#selected_image_resize_yes");if(!y.is(":checked")){y.attr("checked","checked");$("#selected_image_resize_no").removeAttr("checked")}}}j.removeClass("resizing_active");if($("#resize_action").hasClass("on")){$("#resize_action").click().mouseout()}},resize:t});l.addClass("resizable_setup")}var m=null;function r(){var y=[{html:$("#button_crop").html(),click:function(){$("#button_crop").click()}},{html:$("#button_cancel_crop").html(),click:function(){$("#button_cancel_crop").click()},"class":"ui-priority-secondary"}];$(".show_when_crop").hide();$("#crop_action, .crop_trigger").click(function(E){var C=$(this).attr("data-recrop");if(C&&C.length>0){window.location.assign(C);return true}if(!j.hasClass("croppable")){return}if(g){return false}g=true;$("#selected_image_settings").addClass("cropping_active");$(".hide_when_crop").hide();$(".show_when_crop").show();if(l.hasClass("resizable_setup")){l.resizable("destroy")}var B={autoCrop:true,autoCropArea:0.35,zoomable:false,rotatable:false,maxWidth:l.attr("data-origwidth"),maxHeight:l.attr("data-origheight"),minCropBoxWidth:(c<2?0:c),minCropBoxHeight:(h<2?0:h),minWidth:(c<2?0:c),minHeight:(h<2?0:h),done:function(F){$("#crop_x").val(Math.floor(F.x));$("#crop_y").val(Math.floor(F.y));$("#crop_w").val(Math.floor(F.width));$("#crop_h").val(Math.floor(F.height));m=F}};var D=l.attr("data-crop");if(D&&D.length>0){D=D.split(",");B.data={x:D[0],y:D[1],width:D[2],height:D[3]};setTimeout(function(){disablePWImageDialogButtons(y)},1000)}else{disablePWImageDialogButtons(y)}l.cropper(B);setTimeout(function(){$(".cropper-canvas").width($(".cropper-container").width()).height($(".cropper-container").height())},500);var A=function(){var F={x:parseInt($("#crop_x").val()),y:parseInt($("#crop_y").val()),width:parseInt($("#crop_w").val()),height:parseInt($("#crop_h").val()),rotate:0};l.cropper("setData",F)};$("#crop_coordinates input").change(A)});function z(){l.cropper("destroy");$(".show_when_crop").hide();$(".hide_when_crop").show();g=false;$("#selected_image_settings").removeClass("cropping_active");u();enablePWImageDialogButtons()}$("#button_cancel_crop").click(function(){z()});$("#button_crop").click(function(){if(j.hasClass("processing")){return false}j.addClass("processing");return true});if(l.attr("data-crop")){$("#crop_action").click()}}function o(y){if(d){return}if($(this).parents("#crop_coordinates").length){return}d=true;var F,E,C=false,D=false,A=l.attr("width"),G=l.attr("height"),H=parseInt(l.attr("data-origwidth")),I=parseInt(l.attr("data-origheight"));A=typeof A=="undefined"?l.width():parseInt(A);G=typeof G=="undefined"?l.height():parseInt(G);if($(this).attr("id")=="input_width"){F=parseInt($(this).val());E=(I/(H/F));if(F==A){D=true}}else{E=parseInt($(this).val());F=Math.round((E/G)*A);F=(H/(I/E));if(E==G){D=true}}if(F<1||E<1||D){C=1}else{if(w>0&&F>w){C=2}else{if((c>1&&F1&&Ew){z=w}if(z>$(window).width()){$("#content").css("overflow-x","auto")}$("#input_width").val(z).change()});$("#min_action").click(function(){var B=l.width();var z=l.height();var C=$(window).width()-30;var D=$(window).height()-$("#wrap_info").height()-60;var A=false;if(z>D){$("#input_height").val(D).change();A=true}if(B>C){$("#input_width").val(C).change();A=true}if(!A){$("#input_width").val(Math.ceil(B/2)).change()}});$("#align_left_action, #align_center_action, #align_right_action").click(function(){var A=$("#selected_image_class");var z=$(this).attr("data-label");if($(this).hasClass("on")){A.children("option").removeAttr("selected");$(this).removeClass("on")}else{$(this).siblings(".on").removeClass("on");A.children("option").removeAttr("selected");A.find("option[data-label="+z+"]").attr("selected","selected");$(this).addClass("on")}A.change()});var y=$("#selected_image_class").find("option[selected=selected]").attr("data-label");if(y){$("#action_icons").find("span[data-label="+y+"]").addClass("on")}$("#resize_action").hover(function(){if($(this).hasClass("on")){return}$("#resize_tips").show();$("#input_width, #input_height").addClass("ui-state-highlight")},function(){if($(this).hasClass("on")){return}$("#resize_tips").hide();$("#input_width, #input_height").removeClass("ui-state-highlight")}).click(function(){if($(this).hasClass("on")){$(this).removeClass("on");$("#input_width, #input_height").removeClass("ui-state-highlight")}else{$(this).addClass("on");$("#input_width, #input_height").addClass("ui-state-highlight")}});$("#description_action").click(function(){if($(this).hasClass("on")){$(this).removeClass("on");$("#wrap_description").slideUp("fast")}else{$(this).addClass("on");$("#wrap_description").slideDown("fast")}})}function k(){$("#selected_image_caption").change(function(){if(j.hasClass("cropping_active")){return}var y=$("#caption_preview");if($(this).is(":checked")){y.fadeIn()}else{if(y.is(":visible")){y.fadeOut()}}}).change()}function s(){var z=$(window).width()-30;var y=$(window).height()-($("#wrap_info").height()+60);if(l.width()>z){l.width(z).css("height","auto").removeAttr("height");l.removeAttr("height")}if(l.height()>y){l.removeAttr("width").css("width","auto").height(y)}i.width(l.width()).height(l.height())}$("#loading_button").hide();if(l.attr("data-fit")){s()}else{i.width(l.width()).height(l.height())}$("#selected_image_settings .input_pixels").change(o);$("#selected_image_class").change(p).change();f=l.attr("data-origwidth");t();r();q();k();$("button.submit_save_copy, button.submit_save_replace").click(function(){j.addClass("processing");disablePWImageDialogButtons()})}if(b.length>0){b=b.first();if(b.width()>0&&b.height()>0){a(b)}else{b.load(function(){b=$(this);a(b)})}}}$(document).ready(function(){var b=$("#page_id");if(b.length>0){var a=b.val();b.bind("pageSelected",function(c,d){if(d.id==a){return}window.location="./?id="+d.id+"&modal=1"})}if($("#selected_image").length>0){setTimeout(function(){setupSelectedImage()},250)}else{if($("#ImageVariations").length>0){setupExecuteVariations()}}enablePWImageDialogButtons();$(window).keydown(function(c){if(c.keyCode==13){c.preventDefault();return false}})}); \ No newline at end of file diff --git a/wire/modules/Process/ProcessPageEditImageSelect/ProcessPageEditImageSelect.module b/wire/modules/Process/ProcessPageEditImageSelect/ProcessPageEditImageSelect.module index d74ee92b..9a2351f8 100644 --- a/wire/modules/Process/ProcessPageEditImageSelect/ProcessPageEditImageSelect.module +++ b/wire/modules/Process/ProcessPageEditImageSelect/ProcessPageEditImageSelect.module @@ -837,10 +837,10 @@ class ProcessPageEditImageSelect extends Process implements ConfigurableModule { "" . "" . "" . + "type='number' size='6' step='1' data-min='$minWidth' data-max='$originalWidth' value='$width' />" . "  " . "" . + "type='number' size='6' step='1' data-min='$minHeight' data-max='$originalHeight' value='$height' />" . " " . "" . "" .