Commit 4fcb72d3 authored by Georg Bauer's avatar Georg Bauer
Browse files

fixed #2128: updated BiDi support


git-svn-id: http://code.djangoproject.com/svn/django/trunk@3121 bcc190cf-cafb-0310-a4f2-bffc1f526a37
parent ece252ed
Loading
Loading
Loading
Loading
+0 −5
Original line number Diff line number Diff line
@import url('base.css');

body {
    direction: rtl;
}
+0 −7
Original line number Diff line number Diff line
@import url('login.css');
@import url('base_rtl.css');
@import url('layout_rtl.css');

.login .form-row { float:right; }
.login .form-row label { float:right; padding-left:0.5em; padding-right:0; text-align:left;}
.login .submit-row { clear:both; padding:1em 9.4em 0 0; }
+46 −0
Original line number Diff line number Diff line
body { direction: rtl; }

/* login styles */

.login .form-row { float:right; }
.login .form-row label { float:right; padding-left:0.5em; padding-right:0; text-align:left;}
.login .submit-row { clear:both; padding:1em 9.4em 0 0; }


/* global styles */
th { text-align: right; }
.module h2, .module caption { text-align: right; }
.addlink, .changelink { padding-left:0px; padding-right:12px; background-position:100% 0.2em; }
.deletelink { padding-left:0px; padding-right:12px; background-position:100% 0.25em; }
.object-tools { float:left; }


/* layout styles */
#user-tools	{ right:auto; left:0; text-align:left; }
div.breadcrumbs { text-align:right; }
#content-main { float:right;}
#content-related { float:left; margin-left:-19em; margin-right:auto;}
.colMS { margin-left:20em !important; margin-right:10px !important;}

/* dashboard styles */
.dashboard .module table td a { padding-left:.6em; padding-right:12px; }

/* changelists styles */
.change-list .filtered { background:white url(../img/admin/changelist-bg_rtl.gif) top left repeat-y !important; }
.change-list .filtered table { border-left:1px solid #ddd; border-right:0px none; }
#changelist-filter { right:auto; left:0; border-left:0px none; border-right:1px solid #ddd;}
.change-list .filtered table, .change-list .filtered .paginator, .filtered #toolbar, .filtered div.xfull { margin-right:0px !important; margin-left:160px !important; }
#changelist-filter li.selected { border-left:0px none; padding-left:0px; margin-left:0; border-right:5px solid #ccc; padding-right:5px;margin-right:-10px; }

/* fomrs styles */
.aligned label { padding:0 0 3px 1em;  float:right; }
.submit-row { text-align: left }
.vDateField, .vTimeField { margin-left:2px; }

/* widget styles */
.calendarnav-previous { top:0; left:auto; right:0; }
.calendarnav-next { top:0; right:auto; left:0;}
.calendar caption, .calendarbox h2 { text-align:center; }

.selector { float: right;}
.selector .selector-filter { text-align: right;}
+21 −2
Original line number Diff line number Diff line
@@ -69,7 +69,16 @@ var DateTimeShortcuts = {
        var clock_box = document.createElement('div');
        clock_box.style.display = 'none';
        clock_box.style.position = 'absolute';
        if (getStyle(document.body,'direction')!='rtl') {
            clock_box.style.left = findPosX(clock_link) + 17 + 'px';
        }
        else {
            // since style's width is in em, it'd be tough to calculate
            // px value of it. let's use an estimated px for now
            // TODO: IE returns wrong value for findPosX when in rtl mode
            //       (it returns as it was left aligned), needs to be fixed.
            clock_box.style.left = findPosX(clock_link) - 110 + 'px';
        }
        clock_box.style.top = findPosY(clock_link) - 30 + 'px';
        clock_box.className = 'clockbox module';
        clock_box.setAttribute('id', DateTimeShortcuts.clockDivName + num);
@@ -140,7 +149,17 @@ var DateTimeShortcuts = {
        var cal_box = document.createElement('div');
        cal_box.style.display = 'none';
        cal_box.style.position = 'absolute';
        // is it left-to-right or right-to-left layout ?
        if (getStyle(document.body,'direction')!='rtl') {
            cal_box.style.left = findPosX(cal_link) + 17 + 'px';
        }
        else {
            // since style's width is in em, it'd be tough to calculate
            // px value of it. let's use an estimated px for now
            // TODO: IE returns wrong value for findPosX when in rtl mode
            //       (it returns as it was left aligned), needs to be fixed.
            cal_box.style.left = findPosX(cal_link) - 180 + 'px';
        }
        cal_box.style.top = findPosY(cal_link) - 75 + 'px';
        cal_box.className = 'calendarbox module';
        cal_box.setAttribute('id', DateTimeShortcuts.calendarDivName1 + num);
+18 −1
Original line number Diff line number Diff line
@@ -136,3 +136,20 @@ String.prototype.pad_left = function(pad_length, pad_string) {
    }
    return new_string;
}

// ----------------------------------------------------------------------------
// Get the computed style for and element
// ----------------------------------------------------------------------------
function getStyle(oElm, strCssRule){
    var strValue = "";
    if(document.defaultView && document.defaultView.getComputedStyle){
        strValue = document.defaultView.getComputedStyle(oElm, "").getPropertyValue(strCssRule);
    }
    else if(oElm.currentStyle){
        strCssRule = strCssRule.replace(/\-(\w)/g, function (strMatch, p1){
            return p1.toUpperCase();
        });
        strValue = oElm.currentStyle[strCssRule];
    }
    return strValue;
}
Loading