diff --git a/wp-admin/admin-header.php b/wp-admin/admin-header.php index cb30639213..c3ceef6b6a 100644 --- a/wp-admin/admin-header.php +++ b/wp-admin/admin-header.php @@ -79,15 +79,20 @@ addLoadEvent(blurry); - - + + diff --git a/wp-admin/edit-form-advanced.php b/wp-admin/edit-form-advanced.php index c1df52ead8..bceeaba7a9 100644 --- a/wp-admin/edit-form-advanced.php +++ b/wp-admin/edit-form-advanced.php @@ -150,7 +150,7 @@ endforeach; ?> -
+ diff --git a/wp-includes/functions-formatting.php b/wp-includes/functions-formatting.php index c179df2d74..8b959d43ff 100644 --- a/wp-includes/functions-formatting.php +++ b/wp-includes/functions-formatting.php @@ -994,7 +994,7 @@ function ent2ncr($text) { function wp_richedit_pre($text) { // Filtering a blank results in an annoying'; $output = $text; $output = html_entity_decode($output); // undoes format_to_edit() diff --git a/wp-includes/js/tinymce/plugins/directionality/editor_plugin.js b/wp-includes/js/tinymce/plugins/directionality/editor_plugin.js new file mode 100644 index 0000000000..c866b53dfb --- /dev/null +++ b/wp-includes/js/tinymce/plugins/directionality/editor_plugin.js @@ -0,0 +1,83 @@ +/* Import plugin specific language pack */ +tinyMCE.importPluginLanguagePack('directionality', 'en,sv,fr_ca,zh_cn,cs,da,he,no,de,hu,ru,ru_KOI8-R,ru_UTF-8,es,cy,is,pl'); + +function TinyMCE_directionality_getInfo() { + return { + longname : 'Directionality', + author : 'Moxiecode Systems', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://tinymce.moxiecode.com/tinymce/docs/plugin_directionality.html', + version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion + }; +}; + +function TinyMCE_directionality_getControlHTML(control_name) { + switch (control_name) { + case "ltr": + var cmd = 'tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mceDirectionLTR\');return false;'; + return '' + + ''; + + case "rtl": + var cmd = 'tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mceDirectionRTL\');return false;'; + return '' + + ''; + } + + return ""; +} + +function TinyMCE_directionality_execCommand(editor_id, element, command, user_interface, value) { + // Handle commands + switch (command) { + case "mceDirectionLTR": + var inst = tinyMCE.getInstanceById(editor_id); + var elm = tinyMCE.getParentElement(inst.getFocusElement(), "p,div,td,h1,h2,h3,h4,h5,h6,pre,address"); + + if (elm) + elm.setAttribute("dir", "ltr"); + + tinyMCE.triggerNodeChange(false); + return true; + + case "mceDirectionRTL": + var inst = tinyMCE.getInstanceById(editor_id); + var elm = tinyMCE.getParentElement(inst.getFocusElement(), "p,div,td,h1,h2,h3,h4,h5,h6,pre,address"); + + if (elm) + elm.setAttribute("dir", "rtl"); + + tinyMCE.triggerNodeChange(false); + return true; + } + + // Pass to next handler in chain + return false; +} + +function TinyMCE_directionality_handleNodeChange(editor_id, node, undo_index, undo_levels, visual_aid, any_selection) { + function getAttrib(elm, name) { + return elm.getAttribute(name) ? elm.getAttribute(name) : ""; + } + + tinyMCE.switchClassSticky(editor_id + '_ltr', 'mceButtonNormal', false); + tinyMCE.switchClassSticky(editor_id + '_rtl', 'mceButtonNormal', false); + + if (node == null) + return; + + var elm = tinyMCE.getParentElement(node, "p,div,td,h1,h2,h3,h4,h5,h6,pre,address"); + if (!elm) { + tinyMCE.switchClassSticky(editor_id + '_ltr', 'mceButtonDisabled', true); + tinyMCE.switchClassSticky(editor_id + '_rtl', 'mceButtonDisabled', true); + return; + } + + var dir = getAttrib(elm, "dir"); + if (dir == "ltr" || dir == "") + tinyMCE.switchClassSticky(editor_id + '_ltr', 'mceButtonSelected', false); + else + tinyMCE.switchClassSticky(editor_id + '_rtl', 'mceButtonSelected', false); + + return true; +} diff --git a/wp-includes/js/tinymce/plugins/directionality/images/ltr.gif b/wp-includes/js/tinymce/plugins/directionality/images/ltr.gif new file mode 100644 index 0000000000..ac8f30c120 Binary files /dev/null and b/wp-includes/js/tinymce/plugins/directionality/images/ltr.gif differ diff --git a/wp-includes/js/tinymce/plugins/directionality/images/rtl.gif b/wp-includes/js/tinymce/plugins/directionality/images/rtl.gif new file mode 100644 index 0000000000..0348f99656 Binary files /dev/null and b/wp-includes/js/tinymce/plugins/directionality/images/rtl.gif differ diff --git a/wp-includes/js/tinymce/plugins/directionality/langs/en.js b/wp-includes/js/tinymce/plugins/directionality/langs/en.js new file mode 100644 index 0000000000..5b392fe189 --- /dev/null +++ b/wp-includes/js/tinymce/plugins/directionality/langs/en.js @@ -0,0 +1,6 @@ +// UK lang variables + +tinyMCE.addToLang('',{ +directionality_ltr_desc : 'Direction left to right (Alt-.)', +directionality_rtl_desc : 'Direction right to left (Alt-,)' +});