aboutsummaryrefslogtreecommitdiff
path: root/mod/tinymce/vendor/tinymce/jscripts/tiny_mce/plugins/legacyoutput/editor_plugin_src.js
diff options
context:
space:
mode:
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-06-07 22:46:47 +0000
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-06-07 22:46:47 +0000
commitceab24db2a7bf459684a650c287770b4ff090f54 (patch)
tree171760af3de53f07b77c12d8e7931241a8d0377e /mod/tinymce/vendor/tinymce/jscripts/tiny_mce/plugins/legacyoutput/editor_plugin_src.js
parentd924a462f39ff922a4cc9f6635cfe5d0c0f14db3 (diff)
downloadelgg-ceab24db2a7bf459684a650c287770b4ff090f54.tar.gz
elgg-ceab24db2a7bf459684a650c287770b4ff090f54.tar.bz2
Refs #3510, #9113. Updated tinyMCE version in trunk.
git-svn-id: http://code.elgg.org/elgg/trunk@9140 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/tinymce/vendor/tinymce/jscripts/tiny_mce/plugins/legacyoutput/editor_plugin_src.js')
-rw-r--r--mod/tinymce/vendor/tinymce/jscripts/tiny_mce/plugins/legacyoutput/editor_plugin_src.js59
1 files changed, 31 insertions, 28 deletions
diff --git a/mod/tinymce/vendor/tinymce/jscripts/tiny_mce/plugins/legacyoutput/editor_plugin_src.js b/mod/tinymce/vendor/tinymce/jscripts/tiny_mce/plugins/legacyoutput/editor_plugin_src.js
index e852da15e..e627ec76e 100644
--- a/mod/tinymce/vendor/tinymce/jscripts/tiny_mce/plugins/legacyoutput/editor_plugin_src.js
+++ b/mod/tinymce/vendor/tinymce/jscripts/tiny_mce/plugins/legacyoutput/editor_plugin_src.js
@@ -26,7 +26,7 @@
editor.onInit.add(function() {
var alignElements = 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img',
fontSizes = tinymce.explode(editor.settings.font_size_style_values),
- serializer = editor.serializer;
+ schema = editor.schema;
// Override some internal formats to produce legacy elements and attributes
editor.formatter.register({
@@ -34,13 +34,27 @@
alignleft : {selector : alignElements, attributes : {align : 'left'}},
aligncenter : {selector : alignElements, attributes : {align : 'center'}},
alignright : {selector : alignElements, attributes : {align : 'right'}},
- alignfull : {selector : alignElements, attributes : {align : 'full'}},
-
- // Change the basic formatting elements to use deprecated element types
- bold : {inline : 'b'},
- italic : {inline : 'i'},
- underline : {inline : 'u'},
- strikethrough : {inline : 'strike'},
+ alignfull : {selector : alignElements, attributes : {align : 'justify'}},
+
+ // Change the basic formatting elements to use deprecated element types
+ bold : [
+ {inline : 'b', remove : 'all'},
+ {inline : 'strong', remove : 'all'},
+ {inline : 'span', styles : {fontWeight : 'bold'}}
+ ],
+ italic : [
+ {inline : 'i', remove : 'all'},
+ {inline : 'em', remove : 'all'},
+ {inline : 'span', styles : {fontStyle : 'italic'}}
+ ],
+ underline : [
+ {inline : 'u', remove : 'all'},
+ {inline : 'span', styles : {textDecoration : 'underline'}, exact : true}
+ ],
+ strikethrough : [
+ {inline : 'strike', remove : 'all'},
+ {inline : 'span', styles : {textDecoration: 'line-through'}, exact : true}
+ ],
// Change font size and font family to use the deprecated font element
fontname : {inline : 'font', attributes : {face : '%value'}},
@@ -58,35 +72,24 @@
hilitecolor : {inline : 'font', styles : {backgroundColor : '%value'}}
});
- // Force parsing of the serializer rules
- serializer._setup();
-
// Check that deprecated elements are allowed if not add them
tinymce.each('b,i,u,strike'.split(','), function(name) {
- var rule = serializer.rules[name];
-
- if (!rule)
- serializer.addRules(name);
+ schema.addValidElements(name + '[*]');
});
// Add font element if it's missing
- if (!serializer.rules["font"])
- serializer.addRules("font[face|size|color|style]");
+ if (!schema.getElementRule("font"))
+ schema.addValidElements("font[face|size|color|style]");
// Add the missing and depreacted align attribute for the serialization engine
tinymce.each(alignElements.split(','), function(name) {
- var rule = serializer.rules[name], found;
+ var rule = schema.getElementRule(name), found;
if (rule) {
- tinymce.each(rule.attribs, function(name, attr) {
- if (attr.name == 'align') {
- found = true;
- return false;
- }
- });
-
- if (!found)
- rule.attribs.push({name : 'align'});
+ if (!rule.attributes.align) {
+ rule.attributes.align = {};
+ rule.attributesOrder.push('align');
+ }
}
});
@@ -133,4 +136,4 @@
// Register plugin
tinymce.PluginManager.add('legacyoutput', tinymce.plugins.LegacyOutput);
-})(tinymce); \ No newline at end of file
+})(tinymce);