Changeset 896779
- Timestamp:
- 04/17/2014 09:40:42 PM (12 years ago)
- Location:
- image-pro-wordpress-image-media-management-and-resizing-done-right/trunk
- Files:
-
- 3 edited
-
imagepro.php (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
-
src/js/editor.js (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
image-pro-wordpress-image-media-management-and-resizing-done-right/trunk/imagepro.php
r892409 r896779 5 5 Description: WordPress media & images management done right! 6 6 Author: Mihai Valentin 7 Version: 0.3 27 Version: 0.33 8 8 Author URI: http://www.mihaivalentin.com/ 9 9 */ -
image-pro-wordpress-image-media-management-and-resizing-done-right/trunk/readme.txt
r892409 r896779 4 4 Tags: post, plugin, image, images, pictures, editor, upload, management 5 5 Requires at least: 3.0.0 6 Tested up to: 3. 87 Stable tag: 0.3 26 Tested up to: 3.9 7 Stable tag: 0.33 8 8 9 9 Upload, resize, add, change images instantly. Manage your media collection with ease and use it for any post or page. A new way of managing content! … … 70 70 71 71 == Changelog == 72 73 = 0.33 = 74 * Made compatible with WordPress 3.9 72 75 73 76 = 0.32 = -
image-pro-wordpress-image-media-management-and-resizing-done-right/trunk/src/js/editor.js
r849545 r896779 40 40 /* tinyMCE will start initialization soon */ 41 41 var tinymceInitTimer = setInterval(function() { 42 if (window.tinymce && window.tinymce.getInstanceById('content')) {42 if (window.tinymce && getTinyMCE()) { 43 43 clearInterval(tinymceInitTimer); 44 44 … … 47 47 48 48 /* initialize the editor */ 49 onEditorInit( window.tinymce.getInstanceById('content'));49 onEditorInit(getTinyMCE()); 50 50 } 51 51 }, 300); … … 56 56 57 57 var getTinyMCE = function() { 58 return tinymce.get InstanceById('content');58 return tinymce.get('content'); 59 59 }; 60 60 … … 69 69 setTinyMCEInteractions($body, getTinyMCE()); 70 70 71 /* if we are re on Chrome or Safari, try to simulate the resize handles */ 72 if (window.tinymce.isWebKit) { 71 /* if we are re on Chrome or Safari, try to simulate the resize handles, 72 but only if we're still on TinyMCE 3.X. 73 TinyMCE 4 implemented it in the editor for Webkit */ 74 if (window.tinymce.isWebKit && window.tinymce.majorVersion != 4) { 73 75 impro.fakeImageResize(); 74 76 } 75 77 } 76 78 }, 300); 79 }; 80 81 /** 82 * starting with TinyMCE 4, in WebKit browsers and IE, it becomes 83 * harder to drop images over the TinyMCE editor. 84 * the reason is that the body does not have a fixed height 85 * and if the post is empty or with very few content, the drop zone 86 * exists only over that content. 87 * this function attempts to fix this issue by ensuring that the 88 * min-height of the body is just like the height of it's container 89 * so that the drop zone is maximized. 90 * TODO also get called on panel resize 91 */ 92 var updateTinyMCEBodyToOuterIframeContainerHeight = function() { 93 var $editorIframe = $(getTinyMCE().contentAreaContainer).find('iframe'); 94 var $body = $editorIframe.contents().find('body'); 95 var iframeHeight = $editorIframe.height(); 96 97 if (!isNaN(parseInt(iframeHeight))) { 98 /* trying -25 to prevent vertical scrolling - may need special tuning later */ 99 $body.css('min-height', (iframeHeight - 25) + 'px'); 100 } 77 101 }; 78 102 … … 86 110 } else { 87 111 $('#impro-editor-maxwidth-info').html($('#impro-editor-maxwidth-info').html().replace('%maxwidth%', themeMaxWidth)); 112 } 113 114 /* update tinymce iframe body height */ 115 updateTinyMCEBodyToOuterIframeContainerHeight(); 116 117 /* hide image toolbar buttons for tinymce 4 */ 118 if (window.tinymce.majorVersion == 4) { 119 try { 120 // TODO replace with editor_styles later 121 $(tinymce.get('content').dom.doc.head).append('<style>#wp-image-toolbar { display: none !important; }</style>'); 122 } catch(e) {} 88 123 } 89 124 … … 139 174 if (target.is('img')) { 140 175 showEditor(target); 141 } else { 176 } else if (!(target.is('body') && target.find('img[data-mce-selected]').length > 0)) { 177 /* on Chrome, when resizing an image, the selected image panel closes 178 that's because it is similar to clicking outside it. 179 for this, before closing the panel, we check if the image is still selected. 180 if it is, do nothing (keep it open), if not, close the panel */ 142 181 closeEditor(); 143 182 } … … 348 387 349 388 /* update the resizing rectangle to match the new image dimension */ 350 if (window.tinymce.isWebKit ) {389 if (window.tinymce.isWebKit && window.tinymce.majorVersion != 4) { 351 390 impro.updateResizeRect(); 352 391 }
Note: See TracChangeset
for help on using the changeset viewer.