| | |
| | |
|
| | | ed.formatter.register(name, {
|
| | | inline : 'span',
|
| | | classes : o['class'],
|
| | | attributes : {'class' : o['class']},
|
| | | selector : '*'
|
| | | });
|
| | |
|
| | |
| | | ctrl = ctrlMan.createListBox('styleselect', {
|
| | | title : 'advanced.style_select',
|
| | | onselect : function(name) {
|
| | | ed.execCommand('mceToggleFormat', false, name);
|
| | | var matches, formatNames = [];
|
| | |
|
| | | each(ctrl.items, function(item) {
|
| | | formatNames.push(item.value);
|
| | | });
|
| | |
|
| | | ed.focus();
|
| | | ed.undoManager.add();
|
| | |
|
| | | // Toggle off the current format
|
| | | matches = ed.formatter.matchAll(formatNames);
|
| | | if (matches[0] == name)
|
| | | ed.formatter.remove(name);
|
| | | else
|
| | | ed.formatter.apply(name);
|
| | |
|
| | | ed.undoManager.add();
|
| | | ed.nodeChanged();
|
| | |
|
| | | return false; // No auto select
|
| | | }
|
| | |
| | |
|
| | | ed.formatter.register(name, {
|
| | | inline : 'span',
|
| | | classes : val
|
| | | classes : val,
|
| | | selector : '*'
|
| | | });
|
| | |
|
| | | ctrl.add(t.editor.translate(key), name);
|
| | |
| | | title : 'advanced.fontdefault',
|
| | | onselect : function(v) {
|
| | | ed.execCommand('FontName', false, v);
|
| | |
|
| | | // Fake selection, execCommand will fire a nodeChange and update the selection
|
| | | c.select(function(sv) {
|
| | | return v == sv;
|
| | | });
|
| | |
|
| | | return false; // No auto select
|
| | | }
|
| | | });
|
| | |
| | | var t = this, ed = t.editor, c, i = 0, cl = [];
|
| | |
|
| | | c = ed.controlManager.createListBox('fontsizeselect', {title : 'advanced.font_size', onselect : function(v) {
|
| | | if (v.fontSize)
|
| | | if (v['class']) {
|
| | | ed.focus();
|
| | | ed.undoManager.add();
|
| | | ed.formatter.toggle('fontsize_class', {value : v['class']});
|
| | | ed.undoManager.add();
|
| | | ed.nodeChanged();
|
| | | } else
|
| | | ed.execCommand('FontSize', false, v.fontSize);
|
| | | else {
|
| | | each(t.settings.theme_advanced_font_sizes, function(v, k) {
|
| | | if (v['class'])
|
| | | cl.push(v['class']);
|
| | | });
|
| | |
|
| | | ed.editorCommands._applyInlineStyle('span', {'class' : v['class']}, {check_classes : cl});
|
| | | }
|
| | | // Fake selection, execCommand will fire a nodeChange and update the selection
|
| | | c.select(function(sv) {
|
| | | return v == sv;
|
| | | });
|
| | |
|
| | | return false; // No auto select
|
| | | }});
|