annotate media/js/tiny_mce/plugins/advhr/editor_plugin_src.js @ 45:a5b4c5ce0658

Breaking down and controlling all media files, including javascript libraries.
author Brian Neal <bgneal@gmail.com>
date Fri, 19 Jun 2009 03:16:03 +0000
parents
children 149c3567fec1
rev   line source
bgneal@45 1 /**
bgneal@45 2 * $Id: editor_plugin_src.js 520 2008-01-07 16:30:32Z spocke $
bgneal@45 3 *
bgneal@45 4 * @author Moxiecode
bgneal@45 5 * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
bgneal@45 6 */
bgneal@45 7
bgneal@45 8 (function() {
bgneal@45 9 tinymce.create('tinymce.plugins.AdvancedHRPlugin', {
bgneal@45 10 init : function(ed, url) {
bgneal@45 11 // Register commands
bgneal@45 12 ed.addCommand('mceAdvancedHr', function() {
bgneal@45 13 ed.windowManager.open({
bgneal@45 14 file : url + '/rule.htm',
bgneal@45 15 width : 250 + parseInt(ed.getLang('advhr.delta_width', 0)),
bgneal@45 16 height : 160 + parseInt(ed.getLang('advhr.delta_height', 0)),
bgneal@45 17 inline : 1
bgneal@45 18 }, {
bgneal@45 19 plugin_url : url
bgneal@45 20 });
bgneal@45 21 });
bgneal@45 22
bgneal@45 23 // Register buttons
bgneal@45 24 ed.addButton('advhr', {
bgneal@45 25 title : 'advhr.advhr_desc',
bgneal@45 26 cmd : 'mceAdvancedHr'
bgneal@45 27 });
bgneal@45 28
bgneal@45 29 ed.onNodeChange.add(function(ed, cm, n) {
bgneal@45 30 cm.setActive('advhr', n.nodeName == 'HR');
bgneal@45 31 });
bgneal@45 32
bgneal@45 33 ed.onClick.add(function(ed, e) {
bgneal@45 34 e = e.target;
bgneal@45 35
bgneal@45 36 if (e.nodeName === 'HR')
bgneal@45 37 ed.selection.select(e);
bgneal@45 38 });
bgneal@45 39 },
bgneal@45 40
bgneal@45 41 getInfo : function() {
bgneal@45 42 return {
bgneal@45 43 longname : 'Advanced HR',
bgneal@45 44 author : 'Moxiecode Systems AB',
bgneal@45 45 authorurl : 'http://tinymce.moxiecode.com',
bgneal@45 46 infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advhr',
bgneal@45 47 version : tinymce.majorVersion + "." + tinymce.minorVersion
bgneal@45 48 };
bgneal@45 49 }
bgneal@45 50 });
bgneal@45 51
bgneal@45 52 // Register plugin
bgneal@45 53 tinymce.PluginManager.add('advhr', tinymce.plugins.AdvancedHRPlugin);
bgneal@45 54 })();