Edit File by line
/home/barbar84/www/wp-inclu.../js/tinymce/plugins/directio...
File: plugin.js
(function () {
[0] Fix | Delete
var directionality = (function () {
[1] Fix | Delete
'use strict';
[2] Fix | Delete
[3] Fix | Delete
var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
[4] Fix | Delete
[5] Fix | Delete
var global$1 = tinymce.util.Tools.resolve('tinymce.util.Tools');
[6] Fix | Delete
[7] Fix | Delete
var setDir = function (editor, dir) {
[8] Fix | Delete
var dom = editor.dom;
[9] Fix | Delete
var curDir;
[10] Fix | Delete
var blocks = editor.selection.getSelectedBlocks();
[11] Fix | Delete
if (blocks.length) {
[12] Fix | Delete
curDir = dom.getAttrib(blocks[0], 'dir');
[13] Fix | Delete
global$1.each(blocks, function (block) {
[14] Fix | Delete
if (!dom.getParent(block.parentNode, '*[dir="' + dir + '"]', dom.getRoot())) {
[15] Fix | Delete
dom.setAttrib(block, 'dir', curDir !== dir ? dir : null);
[16] Fix | Delete
}
[17] Fix | Delete
});
[18] Fix | Delete
editor.nodeChanged();
[19] Fix | Delete
}
[20] Fix | Delete
};
[21] Fix | Delete
var Direction = { setDir: setDir };
[22] Fix | Delete
[23] Fix | Delete
var register = function (editor) {
[24] Fix | Delete
editor.addCommand('mceDirectionLTR', function () {
[25] Fix | Delete
Direction.setDir(editor, 'ltr');
[26] Fix | Delete
});
[27] Fix | Delete
editor.addCommand('mceDirectionRTL', function () {
[28] Fix | Delete
Direction.setDir(editor, 'rtl');
[29] Fix | Delete
});
[30] Fix | Delete
};
[31] Fix | Delete
var Commands = { register: register };
[32] Fix | Delete
[33] Fix | Delete
var generateSelector = function (dir) {
[34] Fix | Delete
var selector = [];
[35] Fix | Delete
global$1.each('h1 h2 h3 h4 h5 h6 div p'.split(' '), function (name) {
[36] Fix | Delete
selector.push(name + '[dir=' + dir + ']');
[37] Fix | Delete
});
[38] Fix | Delete
return selector.join(',');
[39] Fix | Delete
};
[40] Fix | Delete
var register$1 = function (editor) {
[41] Fix | Delete
editor.addButton('ltr', {
[42] Fix | Delete
title: 'Left to right',
[43] Fix | Delete
cmd: 'mceDirectionLTR',
[44] Fix | Delete
stateSelector: generateSelector('ltr')
[45] Fix | Delete
});
[46] Fix | Delete
editor.addButton('rtl', {
[47] Fix | Delete
title: 'Right to left',
[48] Fix | Delete
cmd: 'mceDirectionRTL',
[49] Fix | Delete
stateSelector: generateSelector('rtl')
[50] Fix | Delete
});
[51] Fix | Delete
};
[52] Fix | Delete
var Buttons = { register: register$1 };
[53] Fix | Delete
[54] Fix | Delete
global.add('directionality', function (editor) {
[55] Fix | Delete
Commands.register(editor);
[56] Fix | Delete
Buttons.register(editor);
[57] Fix | Delete
});
[58] Fix | Delete
function Plugin () {
[59] Fix | Delete
}
[60] Fix | Delete
[61] Fix | Delete
return Plugin;
[62] Fix | Delete
[63] Fix | Delete
}());
[64] Fix | Delete
})();
[65] Fix | Delete
[66] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function