inherit
Official Code Helper
65613
0
1
May 11, 2024 14:19:23 GMT -8
Chris
"'Oops' is the sound we make when we improve"
8,883
December 2005
horace
|
Post by Chris on Jan 11, 2019 0:14:30 GMT -8
Now I remember why I switched from Firefox to Chrome... After some brutal debugging (still cringing) it seems the command requires a user initiated action except when it doesn't!
Give this one a try, if your default is bbcode then you'll need to switch to preview then back to bbcode then back to preview to enable the feature (you should see text appear on the preview tab then fade away once the feature enables)
<script>
$(document).on('wysiwygcreate', function(ev){
if( !jQuery.ui.wysiwyg.prototype.editors.visual.document.execCommand('enableObjectResizing', false, true) && "undefined" !== typeof InstallTrigger){
var switchEditor = jQuery.ui.wysiwyg.prototype.switchEditor;
jQuery.ui.wysiwyg.prototype.switchEditor = function newSwitchEditor(){
switchEditor.apply(this,arguments);
setTimeout(()=>{
if(jQuery.ui.wysiwyg.prototype.editors.visual.document.execCommand('enableObjectResizing', false, true)){
jQuery.ui.wysiwyg.prototype.switchEditor = switchEditor;
$('#menu-item-visual').setStatus('Image Resizing Enabled')
}else console.log('Could not turn on image resizing')
},5);
}
}else if("undefined" !== typeof InstallTrigger){$('#menu-item-visual').setStatus('Image Resizing Enabled') }
});
</script>
|
|
inherit
252032
0
Apr 26, 2024 23:51:41 GMT -8
Retread
Tribbial Pursuit.
5,014
January 2018
retread
|
Post by Retread on Jan 11, 2019 7:09:34 GMT -8
Give this one a try, if your default is bbcode then you'll need to switch to preview then back to bbcode then back to preview to enable the feature (you should see text appear on the preview tab then fade away once the feature enables) Hi ChrisWhen Preview mode is the default, all is well. Upon creating a thread or reply, the 'Image Resizing Enabled' message appears between the Preview and BBCode tabs, then quickly disappears. The resize function works as expected. However, when BBCode is the default, no joy. The editor is permanently stuck in BBCode mode. Clicking on the Preview tab has no result.
|
|
inherit
Official Code Helper
65613
0
1
May 11, 2024 14:19:23 GMT -8
Chris
"'Oops' is the sound we make when we improve"
8,883
December 2005
horace
|
Post by Chris on Jan 12, 2019 18:56:34 GMT -8
Retread , try changing the line switchEditor.apply(this,args); into switchEditor.apply(this,arguments); I switched from ES6 to ES5 and forgot to downgrade the rest variable
|
|
inherit
252032
0
Apr 26, 2024 23:51:41 GMT -8
Retread
Tribbial Pursuit.
5,014
January 2018
retread
|
Post by Retread on Jan 12, 2019 20:32:17 GMT -8
Chris, that change did the trick. I reckon Miserable Orange will be very pleased with what you've done here.
|
|