/modules/mod_base/lib/js/modules/tinymce3.4.3.2/plugins/zlink/editor_plugin.js
https://code.google.com/p/zotonic/ · JavaScript · 54 lines · 40 code · 6 blank · 8 comment · 1 complexity · 048ae753ee331d36801fd918cd4dda3f MD5 · raw file
- /**
- * Create internal links to zotonic pages in the body text, by using the typeahead.
- *
- * @author Arjan Scherpenisse <arjan@scherpenisse.net>
- * @copyright 2010 Arjan Scherpenisse <arjan@scherpenisse.net>
- */
-
-
- (function()
- {
- var DOM = tinymce.DOM;
-
- tinymce.create('tinymce.plugins.ZotonicLinkPlugin',
- {
- init: function(ed, url)
- {
- ed.addCommand('Z_Link', function()
- {
- z_event('zlink');
- });
-
- window.z_zlink = function(url, title) {
- //var html = id + "<b>{$selection}</b>";
- if (ed.selection.getContent())
- {
- ed.execCommand('mceInsertLink', false, {href: url, title: title});
- }
- else
- {
- var html = "<a href=\"" + url + "\">" + title + "</a>";
- ed.execCommand('mceInsertContent', false, html);
- }
- };
- ed.addButton('zlink', {
- title: 'Add internal link',
- cmd: 'Z_Link',
- 'class': 'mce_link'
- });
- },
-
- getInfo : function() {
- return {
- longname : 'Zotonic Internal Link Plugin',
- author : 'Arjan Scherpenisse',
- authorurl : 'http://www.zotonic.com',
- infourl : 'http://www.zotonic.com',
- version : '0.1'
- };
- }
- });
-
- // Register plugin
- tinymce.PluginManager.add('zlink', tinymce.plugins.ZotonicLinkPlugin);
- })();