Changeset 8191
- Timestamp:
- 06/25/2008 04:30:28 PM (17 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/gears-manifest.php
r8186 r8191 65 65 { 66 66 "betaManifestVersion" : 1, 67 "version" : "<?php echo $man_version; ?>_2008062 2",67 "version" : "<?php echo $man_version; ?>_20080625", 68 68 "entries" : [ 69 69 <?php echo $defaults; ?> … … 127 127 { "url" : "../wp-includes/js/tinymce/themes/advanced/js/source_editor.js?ver=3101" }, 128 128 { "url" : "../wp-includes/js/tinymce/themes/advanced/js/anchor.js?ver=3101" }, 129 { "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/js/editimage.js?ver=310 1" },129 { "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/js/editimage.js?ver=3102" }, 130 130 131 131 { "url" : "../wp-includes/js/tinymce/themes/advanced/source_editor.htm?ver=3101" }, -
trunk/wp-includes/js/tinymce/plugins/wpeditimage/editimage.html
r8167 r8191 5 5 <title></title> 6 6 7 <script type="text/javascript" src="js/editimage.js?ver=310 1"></script>7 <script type="text/javascript" src="js/editimage.js?ver=3102"></script> 8 8 <script type="text/javascript" src="../../utils/form_utils.js?ver=3101"></script> 9 9 -
trunk/wp-includes/js/tinymce/plugins/wpeditimage/js/editimage.js
r8167 r8191 39 39 var t = this, win = t.getWin(); 40 40 41 42 41 // To avoid domain relaxing issue in Opera 43 42 function close() { 44 43 win.tb_remove(); 45 t.editor.execCommand('mceRepaint'); 46 tinymce = tinyMCE = t.editor = t.params = t.dom = t.dom.doc = null; // Cleanup 44 tinymce = tinyMCE = t.editor = t.dom = t.dom.doc = null; // Cleanup 47 45 }; 48 46 … … 154 152 }, 155 153 154 showSizeSet : function() { 155 var t = this; 156 157 if ( (t.width * 1.3) > parseInt(t.preloadImg.width) ) { 158 var s130 = t.I('s130'), s120 = t.I('s120'), s110 = t.I('s110'); 159 160 s130.onclick = s120.onclick = s110.onclick = null; 161 s130.onmouseover = s120.onmouseover = s110.onmouseover = null; 162 s130.style.color = s120.style.color = s110.style.color = '#aaa'; 163 } 164 }, 165 156 166 showSizeRem : function() { 157 167 var t = this, demo = t.I('img_demo'), f = document.forms[0]; … … 176 186 177 187 imgEditSize : function(el) { 178 var t = this, f = document.forms[0], sz, m = null; 179 188 var t = this, f = document.forms[0]; 189 190 if ( ! t.preloadImg || ! t.preloadImg.width || ! t.preloadImg.height ) return; 180 191 var W = parseInt(t.preloadImg.width), H = parseInt(t.preloadImg.height), w = t.width || W, h = t.height || H, id = el.id || 's100'; 181 182 if ( ! t.preloadImg || W == "" || H == "" )183 return;184 192 185 193 size = parseInt(id.substring(1)) / 100; … … 198 206 var demo = this.I('img_demo'), f = document.forms[0]; 199 207 200 demo.width = f.width.value ? Math. floor(f.width.value * 0.5) : '';201 demo.height = f.height.value ? Math. floor(f.height.value * 0.5) : '';208 demo.width = f.width.value ? Math.round(f.width.value * 0.5) : ''; 209 demo.height = f.height.value ? Math.round(f.height.value * 0.5) : ''; 202 210 }, 203 211 … … 217 225 f.width.value = t.width = t.preloadImg.width; 218 226 f.height.value = t.height = t.preloadImg.height; 227 t.showSizeSet(); 219 228 t.demoSetSize(); 220 229 t.showSize(el); … … 243 252 f.img_src.value = d.src = link = ed.dom.getAttrib(el, 'src'); 244 253 ed.dom.setStyle(el, 'float', ''); 254 t.getImageData(); 245 255 246 256 f.img_title.value = ed.dom.getAttrib(el, 'title'); … … 294 304 } 295 305 296 t.getImageData(); 297 298 if ( (t.width * 1.3) > parseInt(t.preloadImg.width) ) { 299 var s130 = t.I('s130'), s120 = t.I('s120'), s110 = t.I('s110'); 300 301 s130.onclick = s120.onclick = s110.onclick = null; 302 s130.onmouseover = s120.onmouseover = s110.onmouseover = null; 303 s130.style.color = s120.style.color = s110.style.color = '#aaa'; 304 } 305 306 if ( t.width && t.preloadImg.width ) t.showSizeSet(); 306 307 document.body.style.display = ''; 307 308 /* … … 332 333 333 334 update : function() { 334 var t = this, f = document.forms[0], nl = f.elements, ed = tinyMCEPopup.editor, el, P, v = f.img_classes.value;335 var t = this, f = document.forms[0], nl = f.elements, ed = tinyMCEPopup.editor, el, P, A, v = f.img_classes.value; 335 336 336 337 tinyMCEPopup.restoreSelection(); … … 339 340 if (el.nodeName != 'IMG') return; 340 341 if (f.img_src.value === '') t.remove(); 342 343 A = ed.dom.getParent(el, 'A'); 341 344 P = ed.dom.getParent(el, 'p'); 342 if ( P && P.style && P.style.textAlign == 'center' ) 343 ed.dom.setStyle(P, 'textAlign', ''); 344 /* 345 if ( tinymce.isIE ) { 345 346 /* if ( tinymce.isIE ) { 346 347 if ( f.img_classes.value.indexOf('aligncenter') != -1 ) 347 348 ed.dom.addClass(P, 'mce_iecenter'); … … 349 350 } 350 351 */ 351 if ( v.indexOf('alignleft') != -1 )352 tinyMCEPopup.execCommand('JustifyLeft');353 else if ( v.indexOf('alignright') != -1 )354 tinyMCEPopup.execCommand('JustifyRight');355 else if ( v.indexOf('aligncenter') != -1 )356 tinyMCEPopup.execCommand('JustifyCenter');357 352 358 353 ed.dom.setAttribs(el, { … … 363 358 height : f.height.value, 364 359 style : f.img_style.value, 365 'class' : f.img_classes.value360 'class' : '' //f.img_classes.value 366 361 }); 367 362 368 pa = ed.dom.getParent(el, 'A');369 370 363 if ( ! f.link_href.value ) { 371 if ( pa) {364 if ( A ) { 372 365 tinyMCEPopup.execCommand("mceBeginUndoLevel"); 373 366 b = ed.selection.getBookmark(); … … 375 368 ed.selection.moveToBookmark(b); 376 369 tinyMCEPopup.execCommand("mceEndUndoLevel"); 377 tinyMCEPopup.close(); 378 return; 379 } 380 } 381 382 tinyMCEPopup.execCommand("mceBeginUndoLevel"); 383 384 // Create new anchor elements 385 if (pa == null) { 386 tinyMCEPopup.execCommand("CreateLink", false, "#mce_temp_url#", {skip_undo : 1}); 387 388 tinymce.each(ed.dom.select("a"), function(n) { 389 if (ed.dom.getAttrib(n, 'href') == '#mce_temp_url#') { 390 391 ed.dom.setAttribs(n, { 392 href : f.link_href.value, 393 title : f.link_title.value, 394 rel : f.link_rel.value, 395 target : (f.link_target.checked == true) ? '_blank' : '', 396 'class' : f.link_classes.value, 397 style : f.link_style.value 398 }); 399 } 400 }); 370 } 401 371 } else { 402 ed.dom.setAttribs(pa, { 403 href : f.link_href.value, 404 title : f.link_title.value, 405 rel : f.link_rel.value, 406 target : (f.link_target.checked == true) ? '_blank' : '', 407 'class' : f.link_classes.value, 408 style : f.link_style.value 409 }); 410 } 411 412 tinyMCEPopup.execCommand("mceEndUndoLevel"); 372 tinyMCEPopup.execCommand("mceBeginUndoLevel"); 373 374 // Create new anchor elements 375 if ( A == null ) { 376 377 if ( ! f.link_href.value.match(/https?:\/\//) ) 378 f.link_href.value = tinyMCEPopup.editor.documentBaseURI.toAbsolute(f.link_href.value); 379 380 tinyMCEPopup.execCommand("CreateLink", false, "#mce_temp_url#", {skip_undo : 1}); 381 382 tinymce.each(ed.dom.select("a"), function(n) { 383 if (ed.dom.getAttrib(n, 'href') == '#mce_temp_url#') { 384 385 ed.dom.setAttribs(n, { 386 href : f.link_href.value, 387 title : f.link_title.value, 388 rel : f.link_rel.value, 389 target : (f.link_target.checked == true) ? '_blank' : '', 390 'class' : f.link_classes.value, 391 style : f.link_style.value 392 }); 393 } 394 }); 395 } else { 396 ed.dom.setAttribs(A, { 397 href : f.link_href.value, 398 title : f.link_title.value, 399 rel : f.link_rel.value, 400 target : (f.link_target.checked == true) ? '_blank' : '', 401 'class' : f.link_classes.value, 402 style : f.link_style.value 403 }); 404 } 405 tinyMCEPopup.execCommand("mceEndUndoLevel"); 406 } 407 408 ed.dom.setAttrib(el, 'class', f.img_classes.value); 409 410 if ( v.indexOf('aligncenter') != -1 ) { 411 if ( P && ( ! P.style || P.style.textAlign != 'center' ) ) 412 ed.dom.setStyle(P, 'textAlign', 'center'); 413 } else { 414 if ( P && P.style && P.style.textAlign == 'center' ) 415 ed.dom.setStyle(P, 'textAlign', ''); 416 } 417 418 ed.execCommand('mceRepaint'); 413 419 tinyMCEPopup.close(); 414 420 }, … … 494 500 495 501 if ( f.width.value == '' || f.height.value == '' ) { 496 f.width.value = t.preloadImg.width; 497 f.height.value = t.preloadImg.height; 498 } 502 f.width.value = t.width = t.preloadImg.width; 503 f.height.value = t.height = t.preloadImg.height; 504 } 505 506 t.showSizeSet(); 499 507 t.demoSetSize(); 508 if ( f.img_style.value ) 509 t.demoSetStyle(); 500 510 }, 501 511
Note: See TracChangeset
for help on using the changeset viewer.