Changeset 1808


Ignore:
Timestamp:
06.02.2012 21:43:35 (4 months ago)
Author:
zmsdev
Message:

Ticket#27 (uni-bern): added support for manual setting of image-dimensions

Location:
ZMS/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • ZMS/trunk/dtml/objattrs/f_select_image.dtml

    r1743 r1808  
    2525                                <dtml-var "getZMILangStr('ATTR_WIDTH')"> x  
    2626                                <dtml-var "getZMILangStr('ATTR_HEIGHT')"> 
    27                                 <dtml-var "getTextInput(fmName=fmName,elName='ZMSGraphic_extEdit_width:int',size=4,value=0,enabled=False)"> x 
    28                                 <dtml-var "getTextInput(fmName=fmName,elName='ZMSGraphic_extEdit_height:int',size=4,value=0,enabled=False)"> px 
     27                                <dtml-var "getTextInput(fmName=fmName,elName='ZMSGraphic_extEdit_width:int',size=4,value=0)"> x 
     28                                <dtml-var "getTextInput(fmName=fmName,elName='ZMSGraphic_extEdit_height:int',size=4,value=0)"> px 
     29                                <input class="form-checkbox" type="checkbox" id="ZMSGraphic_extEdit_proportional" checked="checked"/><span class="form-small">Proportional</span> 
    2930                                <input class="ui-button ui-state-default ui-corner-all" type="submit" name="btn" value="<dtml-var "getZMILangStr('BTN_APPLY')">" onclick="return ZMSGraphic_extEdit_apply();"> 
    3031                        </td> 
  • ZMS/trunk/plugins/www/objattrs/zmi.blob.ZMSGraphic_extEdit.js

    r1803 r1808  
    237237 
    238238$(function () { 
     239        $("#ZMSGraphic_extEdit_width").keyup(function(){ 
     240                        var w = parseInt($(this).val()); 
     241                        if ($("#ZMSGraphic_extEdit_proportional").prop("checked")) { 
     242                                var v = w/ZMSGraphic_act_width; 
     243                                var h = Math.round(v*ZMSGraphic_act_height); 
     244                                $("#ZMSGraphic_extEdit_height").val(h); 
     245                        } 
     246                        var h = $("#ZMSGraphic_extEdit_height").val(); 
     247                        $ZMSGraphic_img.attr({'width':w,'height':h}); 
     248                }); 
     249        $("#ZMSGraphic_extEdit_height").keyup(function(){ 
     250                        var h = parseInt($(this).val()); 
     251                        if ($("#ZMSGraphic_extEdit_proportional").prop("checked")) { 
     252                                var v = h/ZMSGraphic_act_height; 
     253                                var w = Math.round(v*ZMSGraphic_act_width); 
     254                                $("#ZMSGraphic_extEdit_width").val(w); 
     255                        } 
     256                        var w = $("#ZMSGraphic_extEdit_width").val(); 
     257                        $ZMSGraphic_img.attr({'width':w,'height':h}); 
     258                }); 
    239259        $("#ZMSGraphic_extEdit_vslider").slider({ 
    240260                orientation: "vertical", 
Note: See TracChangeset for help on using the changeset viewer.