RTL support. Props mani_monaj. #3136

git-svn-id: http://svn.automattic.com/wordpress/trunk@4201 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2006-09-21 00:34:34 +00:00
parent 7d55a43102
commit 8ca163a2d2
3 changed files with 140 additions and 0 deletions

113
wp-admin/rtl.css Normal file
View File

@ -0,0 +1,113 @@
body {
direction: rtl;
}
body, td {
font: 13px Tahoma, "Lucida Grande", "Lucida Sans Unicode", Verdana;
}
h2 small.quickjump {
text-align: left;
}
h2 small.quickjump a {
font-size: 12px;
font-family: Tahoma, sans-serif;
}
textarea, input, select {
font: 12px Tahoma, Arial, Helvetica, sans-serif;
}
#adminmenu {
float: right;
width: 100%;
}
#adminmenu a {
font-size: 16px;
font-weight: bold;
font-family: georgia;
margin: 0px 2px;
padding: 1px 5px;
float: right;
}
#submenu {
clear: both;
float: right;
width: 100%;
}
#submenu a {
padding: .1em .33em;
float: right;
margin: 0px 2px;
}
#title {
font-family: georgia;
}
#login h1 {
direction: ltr;
}
#postcustom .updatemeta, #postcustom .deletemeta {
width: 5em;
}
#template div {
direction: ltr;
}
#user_info {
left: 1em;
top: 0;
right: auto;
}
#wphead {
padding: .8em 2em .8em 19em;
}
#moremeta fieldset div {
padding: 0 7px 0 0;
}
#moremeta .dbx-content {
background: url(images/box-butt.gif) no-repeat bottom left;
padding: 5px 10px 15px 5px;
}
#moremeta .dbx-handle {
background: url(images/box-head.gif) no-repeat right;
}
/* toggle images */
a.dbx-toggle, a.dbx-toggle:visited {
left: 5px;
right: auto;
}
#advancedstuff a.dbx-toggle-open, #advancedstuff a.dbx-toggle-open:visited {
}
/* Ali ix Corrections and Additions ;) */
td.desc, td.name, textarea#ping_sites, textarea#moderation_keys, textarea#blacklist_keys, input#home, input#admin_email, input#siteurl, input#mailserver_url, input#mailserver_port, input#mailserver_login, input#mailserver_pass, input#blog_charset, input#permalink_structure, input#post_name, input#trackback {
direction: ltr;
text-align: left;
}
.mceToolbarTop {
direction: ltr;
}
div#zeitgeist ul, div.wrap ul {
list-style: none;
}
table.widefat th, tr.thead {
text-align: right;
}

View File

@ -141,6 +141,8 @@ add_filter('the_author', 'ent2ncr', 8);
// Misc filters // Misc filters
add_filter('option_ping_sites', 'privacy_ping_filter'); add_filter('option_ping_sites', 'privacy_ping_filter');
add_filter('option_blog_charset', 'wp_specialchars'); add_filter('option_blog_charset', 'wp_specialchars');
add_filter('mce_plugins', '_mce_load_rtl_plugin');
add_filter('mce_buttons', '_mce_add_direction_buttons');
// Actions // Actions
add_action('wp_head', 'rsd_link'); add_action('wp_head', 'rsd_link');
@ -158,4 +160,5 @@ add_action('do_pings', 'do_all_pings', 10, 1);
add_action('do_robots', 'do_robots'); add_action('do_robots', 'do_robots');
add_action('sanitize_comment_cookies', 'sanitize_comment_cookies'); add_action('sanitize_comment_cookies', 'sanitize_comment_cookies');
add_action('admin_print_scripts', 'wp_print_scripts', 20); add_action('admin_print_scripts', 'wp_print_scripts', 20);
add_action('mce_options', '_mce_set_direction');
?> ?>

View File

@ -1159,4 +1159,28 @@ function wp_die($message, $title = '') {
die(); die();
} }
function _mce_set_direction() {
global $wp_locale;
if ('rtl' == $wp_locale->text_direction)
echo 'directionality : "rtl" ,';
}
function _mce_load_rtl_plugin($input) {
global $wp_locale;
if ('rtl' == $wp_locale->text_direction)
$input[] = 'directionality';
return $input;
}
function _mce_add_direction_buttons($input) {
global $wp_locale;
if ('rtl' == $wp_locale->text_direction) {
$new_buttons = array('separator', 'ltr', 'rtl');
$input = array_merge($input, $new_buttons);
}
return $input;
}
?> ?>