I'm creating a new plugin for TinyMce. However I cannot find any examples to see some of the functionality I've seen in other plugins. I've read their source code but I cannot find where it is done:
When you click on an 'A' element, the link/unlink buttons in the taskbar become enabled.
When you right click on an 'A' element, then click on the "Insert/edit link" icon that is shown in the popup menu, the "Insert/edit link" window is setup (has all the attributes for that particular link) prefilled.
Could you suggest somewhere where I could learn how to do this? A file and line number is fine.
Thanks in advance.
Here a part of what you want. To highlight a UI button (link) you may do
tinymce.get(editorid).contentManager.setActive('link', true);
EDIT: For the other functionality have a look at editor_plugin_src.js/editor_plugin.js in the directory tiny_mce\plugins\advlink\. It is only small in size. You will find that a file called link.htm is being called to form the popup. Hope this helps.
Related
If I add a link to the active editor either by using the menu/context menu or by simply typing a URL (e.g., http://www.google.com), the link is added but it is not immediately clickable. The only way a user can use the link to navigate to a page is by ctrl-clicking and choosing to open in a new tab. If the editor is in read-only mode then it works as intended but not when the editor is active.
Is there a way to make links clickable in an active editor?
thnx,
Christoph
TinyMCE will not (by default) make the link clickable. You can right click on the link and a context menu appears. In that menu is an option to open the link. To modify a link one needs to click on it (select it) in TinyMCE. If that act (clicking) opened the link you would not be able to easily select the link to act upon it in the editor.
Fontello has an area where you can drag custom fonts onto.
GitHub style page here shows they have a custom font I want to use on that fontello can someone please help me to import it.
Yeah I love the GitHub icon font "Octicons" too. Unfortunately as far as I know they're assumed to not freely available to the public - see here: https://github.com/FortAwesome/Font-Awesome/issues/191#issuecomment-6180040
That said - I just did some source file snooping and grabbed the TTF and other files here if you wanna try this on fontello? https://dl.dropboxusercontent.com/u/7951258/fonts/octicons-from-github.com_20140302.zip
PS: If you do find a way to get a hold of them legitamitely please post an update though!
Go to GitHub Style page HERE
Open the inspector Ctrl + Shift + C
Click on Fonts
Click on "See all fonts used in this page"
Find octicons section
Highlight and copy (with Ctrl+C, cant right click here) that box below >Used as: "octicons"
Open notepad and paste it there.
Find the format(svg) and copy it
Go back to firefox, type in http://github.com/ and then paste the string you copied so now in URL bar it says https://github.com//assets/octicons-cdc456dbc5906e59b8c4d1c649a4b734fb0fd97b.svg#octicons
Hit enter and now right click in the page after it loads and go view source
Save this source to your drive
Now go to Fontello tab and then drag the downloaded file into the area on Fontello site where it says "Drag custom SVG icons or SVG font here" on fontello
DONE. Wait and magically all the github icons are now available to you!! Its grouped as "Custom Icons"
Super cool!!
i am having some problems with the TinyMCE (V3.4.7) and JqueryUI (V1.8.14) Dialog
the following Fiddler link shows my example purfectly here
What i am trying to do is open a JqueryUI Dialog box with a TinyMCE WYSIWYG Editor in it.
the first time it displays properly. but if you click close and then reopen the box it will not show the Editor but just the TextArea.
Any help would be good. Thanks
Update
I did find out a solution that works for me, i have put up the working code here
What i am doing is check to see if the dialog has been opened before and if so just open it, then in the Open Function i test to see if the box contains an element with id_parent
if it does then this will be the editor (so do nothing) otherwise just init as usual.
it seems there is a problem with the JQuery Plug in as it does not remove the elements when you call tinyMCE.execCommand('mceRemoveControl',false,'editor_id') and when you re-add the editor it attaches to the first box available.
Problem here is that you need to shut down tinymce correctly in order to open an editor with the same id.
Use:
ed.execCommand('mceRemoveControl', false, 'editor_id');// editor_id equals the id of your textarea
I have created a right click menu item. On its click I want to show a small popup filled with certain values. Any idea?
Take a look under SWT snippets for instructions on opening new windows of various kinds.
http://www.eclipse.org/swt/snippets/
Look under the Shell section.
We have a multi-tiered/hierarchical YUI menu activated via a YUI menu button. Everything in this menu works pretty well. If you mouseover a menu item with a submenu, the submenu appears as expected. You can select an item from this submenu just fine.
The problem, however, is that you can also click on the parent items of this menu which closes the entire menu. In fact, I want the opposite. I'd like a click of a parent menu item leave the top level menu open and open the submenu (i.e. I want a click to be identical to a mouseover event in terms of functionality).
Side note: This isn't an issue on a typical web browser (e.g. Firefox) where the click event doesn't matter because you can't have a click without a mouseover. This is an issue on the iPhone which doesn't have a mouseover event.
I've been playing with the autosubmenudisplay properties and keepopen properties, hoping I can just handle the parent item click events to do what I want but, so far, I've been unsuccessful. If I set autosubmenudisplay to false, I can't figure out how to get the submenus to display manually. The keepopen property doesn't seem to work rather I set it on the menu or submenus.
Is there a way to get the behavior I want so our iPhone users are happy?
Todd Kloots, author of the YUI Button and Menu widgets here. Took at look at your request. Unfortunately the current version YUI Button and Menu aren't designed to support the type of interaction you are looking to create. Feel free to file a feature request via SourceForge and I'll try to work on this for a future version of YUI.
Todd
It's not exactly what you asked for, but have you looked at iUI? You may be able to pick up some tricks from the implementation.