In CKEditor, is there an event that can be bound to which fires when the user switches between the WYSIWYG view and the source view?
If not, I need to enable/disable some other controls on the page when the view changes; what's my best strategy?
I'm still unable to find any documentation, but after poking around the internals of a CKEditor instance, I was able to find the event I'm looking for:
instance.on('mode', function() { // Code to execute when the user switches editing modes}
Easy enough. The event fires once when the editor is initialized and again any time the source command is activated (either through instance.execCommand(...) or the user clicking a Source toolbar button).
I have an older version and solved this with
CKEDITOR.instances['terms_and_conditions'].on('mode', function() {
console.log(this.mode); // outputs: source, wysiwyg
});
Related
Upon the click of a button, the RadWindow in question opens. Immediately after it finishes doing so, I'd like to click one of the buttons within it. Additionally, I'd like for the window to be hidden upon launch. Is there a simple way to do either of these? Any assistance would be appreciated.
In the Javascript the RadWindow is populated from, I used this.
window.addEventListener('DOMContentLoaded', function() {
console.log('DOM fully loaded and parsed');
$telerik.$("#Submit1").click();
});
i have added below configuration to hide the toolbar onload of ckeditor.
config.toolbarStartupExpanded = false;
is there any configuration or any workaround available to show the toolbar once the user clicks on the editing area and then hides it once user clicks out of the editing area.
You can try to use inline version of editor, it might be sufficient for you in this case.
Take a look into this sample how it works: https://cdn.ckeditor.com/4.7.3/full-all/samples/old/inlineall.html.
You need to remember to initialise editor with CKEDITOR.inline instead of CKEDITOR.replace. More about it you can find in documentation
Another option might be dynamically create and destroy editor, but this approach might be a little bit more laggy, for the user. Example how it works you can find here: https://cdn.ckeditor.com/4.7.3/full-all/samples/old/ajax.html
I have a problem with a component that loads in to a modal window. I am using the Alpha User Points system and it has a component that gives you a full list of yous site's users. It also gives you the ability to order by username, by points etc. If I use it outside of modal window it works fine. If I use it in to modal window, ordering don't work!!! When I put my mouse over table's headers, outside of modal window gives this...javascript:tableOrdering('aup.referreid','asc','');In to modal window I see this...javascript:tableOrdering('aup.referreid','asc','');?ml=1 Using Firebug, I remove this ?ml=1 and it works into modal also!!! So the question is, why in to modal window gives this ?ml=1, what is this? And how will I remove it?
Well here is the answer... I use the Modalizer extension of nonumber.nl. I was loading my component through modalizer's modal box, this is why I had this issue. So, if anyone use Modalizer to popup components and have the same problem with me, just go to modalizer's Plugin Manager, find the option Convert Links inside Window and disable it!!! But, after this, if you want to add link in to modal window and you don't want to show-up the whole front page but only the component or what ever this is, you have to add at the end of the link this &ml=1.
I have a webapp that store a layout,
And on its edit mode the user should click on the layout option inside a jquery ui dialog.
After the user choose the template that he/she want, the page will automatically reload.
I want the jquery-ui keep open even after the page was reloaded...
Hope it makes sense.
Hoping for your replys.
King Pangilinan
I guess your whole page is being reloaded? If so you can't keep the dialog open but re-open it when your dom has been loaded. To do so you can do:
$(document).ready(function() {
$("dialog_selector").dialog('open');
});
That just opens it. Now if you want to do it on a page reload you would have to embed this javascript code in some conditional ERB-code (if you're using ERB) or similar which meets your conditions...
Hope it's clear what I mean.
For a given button inside Firefox 4, how do I discover the appropriate way to simulate a click using XPCom/JavaScript? I'd like to programmatically invoke a dialog which is currently only reachable by clicking a toolbar button.
More info: I am happily using Mozilla's experimental F1 sharing extension from here:
http://f1.mozillamessaging.com
But I'd like to craft a custom keybinding or programmatic invocation for the share dialog (basically I want to hide my navigation bar but still invoke F1 easily).
I cannot find any straightforward way to do this? I suspect that I just need to peek at (the equivalent of) the onClick handler for the default button and then invoke that in my own XPCom code ... but this seems undiscoverable.
Any help would be much appreciated.
Peeking at the onclick handler might work, if they did it that way. But if they added the functionality using addEventListener then it would not. In that case, your best bet might be to use dispatchEvent to simulate the user clicking on that button.
https://developer.mozilla.org/en/DOM/element.dispatchEvent