Ticket #18254: 18254.diff
| File 18254.diff, 5.1 KB (added by asdasDan, 21 months ago) |
|---|
-
wp-includes/js/tinymce/plugins/wpeditimage/css/editimage.css
344 344 font-weight: bold; 345 345 } 346 346 347 img.link-align { 348 height:22px; 349 vertical-align:middle; 350 margin-bottom:2px; 351 margin-left:-5px; 352 cursor:pointer; 353 } 354 347 355 * html #sidemenu li { 348 356 zoom: 100%; 349 357 } -
wp-includes/js/tinymce/plugins/wpeditimage/editimage.html
4 4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 5 5 <title></title> 6 6 7 <script type="text/javascript" src="js/editimage. js?ver=327"></script>7 <script type="text/javascript" src="js/editimage.dev.js"></script> 8 8 <script type="text/javascript" src="../../utils/form_utils.js?ver=3223"></script> 9 9 10 10 <link rel="stylesheet" href="css/editimage.css?ver=327" type="text/css" media="all" /> … … 148 148 </th> 149 149 <td class="field"> 150 150 <label for="width">{#wpeditimage.width}</label> 151 <input type="text" maxlength="5" id="width" name="width" value="" />151 <input type="text" maxlength="5" onkeyup="wpImage.possiblyConstrain(this);" id="width" name="width" value="" /> 152 152 153 153 <label for="height">{#wpeditimage.height}</label> 154 <input type="text" maxlength="5" id="height" name="height" value="" /> 154 <input type="text" maxlength="5" onkeyup="wpImage.possiblyConstrain(this);" id="height" name="height" value="" /> 155 <img id="constrain_proportions" class="link-align" title="Constraining Proportions" src="img/link.png" name="constrain_proportions" onclick="wpImage.toggleConstrain();" /> 156 <input type="button" class="button" id="orig_size" name="orig_size" value="{#wpeditimage.orig_size}" onclick="wpImage.origSize();" /> 155 157 156 <input type="button" class="button" id="orig_size" name="orig_size" value="{#wpeditimage.orig_size}" onclick="wpImage.origSize();" />157 158 </td> 158 159 </tr> 159 160 -
wp-includes/js/tinymce/plugins/wpeditimage/js/editimage.dev.js
222 222 } 223 223 }, 224 224 225 setConstrainedProportions: function() { 226 var f = document.forms[0], t = this; 227 228 if (t.I('img_classes').value.indexOf('constrained ') != -1 || t.I('img_classes').value.indexOf(' constrained') != -1) { 229 f.constrain_proportions.className += (f.constrain_proportions.className == '') ? 'constrained' : ' constrained'; 230 f.constrain_proportions.title = 'Constraining Proportions'; 231 f.constrain_proportions.src = 'img/link.png'; 232 } else { 233 f.constrain_proportions.className = f.constrain_proportions.className.replace(/(\sconstrained|constrained\s|constrained)/, ''); 234 f.constrain_proportions.src = 'img/broken_link.png'; 235 f.constrain_proportions.title = 'Not Constraining'; 236 } 237 }, 238 239 toggleConstrain: function() { 240 var f = document.forms[0], t = this; 241 242 if (f.constrain_proportions.className.indexOf('constrained') != -1) { 243 f.constrain_proportions.className = f.constrain_proportions.className.replace(/(\sconstrained|constrained\s|constrained)/, ''); 244 f.constrain_proportions.src = 'img/broken_link.png'; 245 f.constrain_proportions.title = 'Not Constraining'; 246 t.I('img_classes').value = t.I('img_classes').value.replace(/(\sconstrained|constrained\s)/, ''); 247 } else { 248 f.constrain_proportions.title = 'Constraining Proportions'; 249 f.constrain_proportions.src = 'img/link.png'; 250 f.constrain_proportions.className += (f.constrain_proportions.className == '') ? 'constrained' : ' constrained'; 251 t.I('img_classes').value += ' constrained'; 252 } 253 }, 254 255 possiblyConstrain : function(el) { 256 var f = document.forms[0], t = this; 257 258 if (f.constrain_proportions.className.indexOf('constrained') == -1) { 259 return; 260 } 261 262 var newOriginalImage = new Image(); 263 newOriginalImage.src = t.I('img_demo').src; 264 265 var widthToHeightRatio = (newOriginalImage.width / newOriginalImage.height); 266 var heightToWidthRatio = (newOriginalImage.height / newOriginalImage.width); 267 268 if (el.id == 'width') { 269 f.height.value = (isNaN(el.value * heightToWidthRatio)) ? '' : Math.round(el.value * heightToWidthRatio); 270 } else if (el.id == 'height') { 271 f.width.value = (isNaN(el.value * widthToHeightRatio)) ? '' : Math.round(el.value * widthToHeightRatio); 272 } 273 }, 225 274 origSize : function() { 226 275 var t = this, f = document.forms[0], el = t.I('s100'); 227 276 … … 287 336 f.img_classes.value = c; 288 337 f.img_style.value = ed.dom.getAttrib(el, 'style'); 289 338 339 t.setConstrainedProportions(); 340 290 341 // Move attribs to styles 291 342 if ( dom.getAttrib(el, 'hspace') ) 292 343 t.updateStyle('hspace');