includes/clientside/tinymce/plugins/xhtmlxtras/editor_plugin_src.js
changeset 395 fa4c5ecb7c9a
parent 335 67bd3121a12e
child 778 57ce13805b6f
equal deleted inserted replaced
394:fbfdcea634a7 395:fa4c5ecb7c9a
     1 /**
     1 /**
     2  * $Id: editor_plugin_src.js 201 2007-02-12 15:56:56Z spocke $
     2  * $Id: editor_plugin_src.js 201 2007-02-12 15:56:56Z spocke $
     3  *
     3  *
     4  * @author Moxiecode
     4  * @author Moxiecode
     5  * @copyright Copyright © 2004-2007, Moxiecode Systems AB, All rights reserved.
     5  * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
     6  */
     6  */
     7 
     7 
     8 (function() {
     8 (function() {
     9 	tinymce.create('tinymce.plugins.XHTMLXtrasPlugin', {
     9 	tinymce.create('tinymce.plugins.XHTMLXtrasPlugin', {
    10 		init : function(ed, url) {
    10 		init : function(ed, url) {
    11 			// Register commands
    11 			// Register commands
    12 			ed.addCommand('mceCite', function() {
    12 			ed.addCommand('mceCite', function() {
    13 				ed.windowManager.open({
    13 				ed.windowManager.open({
    14 					file : url + '/cite.htm',
    14 					file : url + '/cite.htm',
    15 					width : 350 + ed.getLang('xhtmlxtras.cite_delta_width', 0),
    15 					width : 350 + parseInt(ed.getLang('xhtmlxtras.cite_delta_width', 0)),
    16 					height : 250 + ed.getLang('xhtmlxtras.cite_delta_height', 0),
    16 					height : 250 + parseInt(ed.getLang('xhtmlxtras.cite_delta_height', 0)),
    17 					inline : 1
    17 					inline : 1
    18 				}, {
    18 				}, {
    19 					plugin_url : url
    19 					plugin_url : url
    20 				});
    20 				});
    21 			});
    21 			});
    22 
    22 
    23 			ed.addCommand('mceAcronym', function() {
    23 			ed.addCommand('mceAcronym', function() {
    24 				ed.windowManager.open({
    24 				ed.windowManager.open({
    25 					file : url + '/acronym.htm',
    25 					file : url + '/acronym.htm',
    26 					width : 350 + ed.getLang('xhtmlxtras.acronym_delta_width', 0),
    26 					width : 350 + parseInt(ed.getLang('xhtmlxtras.acronym_delta_width', 0)),
    27 					height : 250 + ed.getLang('xhtmlxtras.acronym_delta_width', 0),
    27 					height : 250 + parseInt(ed.getLang('xhtmlxtras.acronym_delta_width', 0)),
    28 					inline : 1
    28 					inline : 1
    29 				}, {
    29 				}, {
    30 					plugin_url : url
    30 					plugin_url : url
    31 				});
    31 				});
    32 			});
    32 			});
    33 
    33 
    34 			ed.addCommand('mceAbbr', function() {
    34 			ed.addCommand('mceAbbr', function() {
    35 				ed.windowManager.open({
    35 				ed.windowManager.open({
    36 					file : url + '/abbr.htm',
    36 					file : url + '/abbr.htm',
    37 					width : 350 + ed.getLang('xhtmlxtras.abbr_delta_width', 0),
    37 					width : 350 + parseInt(ed.getLang('xhtmlxtras.abbr_delta_width', 0)),
    38 					height : 250 + ed.getLang('xhtmlxtras.abbr_delta_width', 0),
    38 					height : 250 + parseInt(ed.getLang('xhtmlxtras.abbr_delta_width', 0)),
    39 					inline : 1
    39 					inline : 1
    40 				}, {
    40 				}, {
    41 					plugin_url : url
    41 					plugin_url : url
    42 				});
    42 				});
    43 			});
    43 			});
    44 
    44 
    45 			ed.addCommand('mceDel', function() {
    45 			ed.addCommand('mceDel', function() {
    46 				ed.windowManager.open({
    46 				ed.windowManager.open({
    47 					file : url + '/del.htm',
    47 					file : url + '/del.htm',
    48 					width : 340 + ed.getLang('xhtmlxtras.del_delta_width', 0),
    48 					width : 340 + parseInt(ed.getLang('xhtmlxtras.del_delta_width', 0)),
    49 					height : 310 + ed.getLang('xhtmlxtras.del_delta_width', 0),
    49 					height : 310 + parseInt(ed.getLang('xhtmlxtras.del_delta_width', 0)),
    50 					inline : 1
    50 					inline : 1
    51 				}, {
    51 				}, {
    52 					plugin_url : url
    52 					plugin_url : url
    53 				});
    53 				});
    54 			});
    54 			});
    55 
    55 
    56 			ed.addCommand('mceIns', function() {
    56 			ed.addCommand('mceIns', function() {
    57 				ed.windowManager.open({
    57 				ed.windowManager.open({
    58 					file : url + '/ins.htm',
    58 					file : url + '/ins.htm',
    59 					width : 340 + ed.getLang('xhtmlxtras.ins_delta_width', 0),
    59 					width : 340 + parseInt(ed.getLang('xhtmlxtras.ins_delta_width', 0)),
    60 					height : 310 + ed.getLang('xhtmlxtras.ins_delta_width', 0),
    60 					height : 310 + parseInt(ed.getLang('xhtmlxtras.ins_delta_width', 0)),
    61 					inline : 1
    61 					inline : 1
    62 				}, {
    62 				}, {
    63 					plugin_url : url
    63 					plugin_url : url
    64 				});
    64 				});
    65 			});
    65 			});
    84 			ed.addButton('attribs', {title : 'xhtmlxtras.attribs_desc', cmd : 'mceAttributes'});
    84 			ed.addButton('attribs', {title : 'xhtmlxtras.attribs_desc', cmd : 'mceAttributes'});
    85 
    85 
    86 			if (tinymce.isIE) {
    86 			if (tinymce.isIE) {
    87 				function fix(ed, o) {
    87 				function fix(ed, o) {
    88 					if (o.set) {
    88 					if (o.set) {
    89 						o.content = o.content.replace(/<abbr([^>]+)>/gi, '<mce:abbr $1>');
    89 						o.content = o.content.replace(/<abbr([^>]+)>/gi, '<html:abbr $1>');
    90 						o.content = o.content.replace(/<\/abbr>/gi, '</mce:abbr>');
    90 						o.content = o.content.replace(/<\/abbr>/gi, '</html:abbr>');
    91 					}
    91 					}
    92 				};
    92 				};
    93 
    93 
    94 				ed.onBeforeSetContent.add(fix);
    94 				ed.onBeforeSetContent.add(fix);
    95 				ed.onPostProcess.add(fix);
    95 				ed.onPostProcess.add(fix);