Ticket #2128: django_bidi.diff
File django_bidi.diff, 5.1 KB (added by , 18 years ago) |
---|
-
django/contrib/admin/media/js/core.js
135 135 new_string = pad_string + new_string; 136 136 } 137 137 return new_string; 138 } 139 No newline at end of file 138 } 139 140 // ---------------------------------------------------------------------------- 141 // Get the computed style for and element 142 // ---------------------------------------------------------------------------- 143 function getStyle(oElm, strCssRule){ 144 var strValue = ""; 145 if(document.defaultView && document.defaultView.getComputedStyle){ 146 strValue = document.defaultView.getComputedStyle(oElm, "").getPropertyValue(strCssRule); 147 } 148 else if(oElm.currentStyle){ 149 strCssRule = strCssRule.replace(/\-(\w)/g, function (strMatch, p1){ 150 return p1.toUpperCase(); 151 }); 152 strValue = oElm.currentStyle[strCssRule]; 153 } 154 return strValue; 155 } -
django/contrib/admin/media/js/admin/DateTimeShortcuts.js
69 69 var clock_box = document.createElement('div'); 70 70 clock_box.style.display = 'none'; 71 71 clock_box.style.position = 'absolute'; 72 clock_box.style.left = findPosX(clock_link) + 17 + 'px'; 72 if (getStyle(document.body,'direction')!='rtl') { 73 clock_box.style.left = findPosX(clock_link) + 17 + 'px'; 74 } 75 else { 76 // since style's width is in em, it'd be tough to calculate 77 // px value of it. let's use an estimated px for now 78 // TODO: IE returns wrong value for findPosX when in rtl mode 79 // (it returns as it was left aligned), needs to be fixed. 80 clock_box.style.left = findPosX(clock_link) - 110 + 'px'; 81 } 73 82 clock_box.style.top = findPosY(clock_link) - 30 + 'px'; 74 83 clock_box.className = 'clockbox module'; 75 84 clock_box.setAttribute('id', DateTimeShortcuts.clockDivName + num); … … 140 149 var cal_box = document.createElement('div'); 141 150 cal_box.style.display = 'none'; 142 151 cal_box.style.position = 'absolute'; 143 cal_box.style.left = findPosX(cal_link) + 17 + 'px'; 152 // is it left-to-right or right-to-left layout ? 153 if (getStyle(document.body,'direction')!='rtl') { 154 cal_box.style.left = findPosX(cal_link) + 17 + 'px'; 155 } 156 else { 157 // since style's width is in em, it'd be tough to calculate 158 // px value of it. let's use an estimated px for now 159 // TODO: IE returns wrong value for findPosX when in rtl mode 160 // (it returns as it was left aligned), needs to be fixed. 161 cal_box.style.left = findPosX(cal_link) - 180 + 'px'; 162 } 144 163 cal_box.style.top = findPosY(cal_link) - 75 + 'px'; 145 164 cal_box.className = 'calendarbox module'; 146 165 cal_box.setAttribute('id', DateTimeShortcuts.calendarDivName1 + num); -
django/contrib/admin/templates/admin/login.html
1 1 {% extends "admin/base_site.html" %} 2 2 {% load i18n %} 3 3 4 {% block stylesheet %}{% load adminmedia %}{% admin_media_prefix %}css/login {% if LANGUAGE_BIDI %}_rtl{% endif %}.css{% endblock %}4 {% block stylesheet %}{% load adminmedia %}{% admin_media_prefix %}css/login.css{% endblock %} 5 5 {% block bodyclass %}login{% endblock %} 6 6 {% block content_title %}{% endblock %} 7 7 {% block breadcrumbs %}{% endblock %} -
django/contrib/admin/templates/admin/base.html
1 1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 2 <html xmlns="http://www.w3.org/1999/xhtml" lang="{{ LANGUAGE_CODE }}" xml:lang="{{ LANGUAGE_CODE }}" >2 <html xmlns="http://www.w3.org/1999/xhtml" lang="{{ LANGUAGE_CODE }}" xml:lang="{{ LANGUAGE_CODE }}" {% if LANGUAGE_BIDI %}dir="rtl"{% endif %}> 3 3 <head> 4 4 <title>{% block title %}{% endblock %}</title> 5 <link rel="stylesheet" type="text/css" href="{% block stylesheet %}{% load adminmedia %}{% admin_media_prefix %}css/base{% if LANGUAGE_BIDI %}_rtl{% endif %}.css{% endblock %}" /> 5 <link rel="stylesheet" type="text/css" href="{% block stylesheet %}{% load adminmedia %}{% admin_media_prefix %}css/base.css{% endblock %}" /> 6 {% if LANGUAGE_BIDI %}<link rel="stylesheet" type="text/css" href="{% block stylesheet_rtl %}{% admin_media_prefix %}css/rtl.css{% endblock %}" />{% endif %} 6 7 {% block extrastyle %}{% endblock %} 7 8 {% block extrahead %}{% endblock %} 8 9 </head>