Skip to content

Commit

Permalink
[*] LO: Full RTL support for back-office
Browse files Browse the repository at this point in the history
  • Loading branch information
Danoosh committed Mar 15, 2014
1 parent 7d55311 commit 4761cba
Show file tree
Hide file tree
Showing 8 changed files with 21,345 additions and 0 deletions.
2,760 changes: 2,760 additions & 0 deletions admin-dev/themes/default/css/admin-theme_rtl.css

Large diffs are not rendered by default.

64 changes: 64 additions & 0 deletions admin-dev/themes/default/css/rtl.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
/* @Todo: create a difference file for deleting _rtl files*/


/* fix SVG */
.chart svg {direction:ltr}
svg text { font: normal 11px Tahoma,Arial !important; }

/* reverse font awesome icon directions */

.icon-step-forward:before { content: "\f048"; }

.icon-fast-forward:before { content: "\f049"; }

.icon-forward:before { content: "\f04a"; }

.icon-backward:before { content: "\f04e"; }

.icon-fast-backward:before { content: "\f050"; }

.icon-step-backward:before { content: "\f051"; }

.icon-chevron-right:before { content: "\f053"; }

.icon-chevron-left:before { content: "\f054"; }

.icon-arrow-right:before { content: "\f060"; }

.icon-arrow-left:before { content: "\f061"; }

.icon-hand-o-left:before, .icon-hand-right:before { content: "\f0a4"; }

.icon-hand-o-right:before, .icon-hand-left:before { content: "\f0a5"; }

.icon-caret-right:before { content: "\f0d9"; }

.icon-caret-left:before { content: "\f0da"; }

.icon-angle-double-right:before, .icon-double-angle-right:before { content: "\f100"; }

.icon-angle-double-left:before, .icon-double-angle-left:before { content: "\f101"; }

.icon-angle-right:before { content: "\f104"; }

.icon-angle-left:before { content: "\f105"; }

.icon-quote-right:before { content: "\f10d"; }

.icon-quote-left:before { content: "\f10e"; }

.icon-chevron-circle-right:before, .icon-chevron-sign-right:before { content: "\f137"; }

.icon-chevron-circle-left:before, .icon-chevron-sign-left:before { content: "\f138"; }

.icon-toggle-left:before, .icon-caret-square-o-left:before { content: "\f152"; }

.icon-long-arrow-right:before { content: "\f177"; }

.icon-long-arrow-left:before { content: "\f178"; }

.icon-arrow-circle-o-left:before { content: "\f18e"; }

.icon-arrow-circle-o-right:before { content: "\f190"; }

.icon-toggle-right:before, .icon-caret-square-o-right:before { content: "\f191"; }
3,428 changes: 3,428 additions & 0 deletions admin-dev/themes/default/css/schemes/admin-theme-blue_rtl.css

Large diffs are not rendered by default.

3,428 changes: 3,428 additions & 0 deletions admin-dev/themes/default/css/schemes/admin-theme-contrast_rtl.css

Large diffs are not rendered by default.

4,097 changes: 4,097 additions & 0 deletions admin-dev/themes/default/css/schemes/admin-theme-flex_rtl.css

Large diffs are not rendered by default.

4,097 changes: 4,097 additions & 0 deletions admin-dev/themes/default/css/schemes/admin-theme-fruit_rtl.css

Large diffs are not rendered by default.

3,428 changes: 3,428 additions & 0 deletions admin-dev/themes/default/css/schemes/admin-theme-prune_rtl.css

Large diffs are not rendered by default.

43 changes: 43 additions & 0 deletions js/rtl.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/*
* dmartl.js
* DM Auto RTL - Auto RTL all inline style in page using jquery
* Autor: Danoosh Miralayi
* Website: presta-shop.ir
* License: MIT
* Find it here: https://github.com/Danoosh/DM-Auto-RTL
*/
$(document).ready(function () {
$('[style]').each(function (index) {
var styles_old = $(this).attr('style');
styles_old = styles_old.split(';');
var styles = {};
var s = '';
var i = '';
var v = '';
for (var x = 0, l = styles_old.length; x < l; x++) {
s = styles_old[x].split(':');
i = $.trim(s[0]);
styles[makeGeneralRTL(i)] = makeValueRTL(i, $.trim(s[1]));
}
$(this).removeAttr("style");
$(this).css(styles);
});
});

function makeGeneralRTL(index) {
var res = index.replace(/right/g, "rtemp");
res = res.replace(/left/g, "right");
res = res.replace(/rtemp/g, "left");
return res;
}
function makeValueRTL(property, value) {
if (property.match(/text-align|float/)) {
return makeGeneralRTL(value);
}
if (property.match(/background(-position)?/))
return value.match(/(.*)?url\((.*)\)(.*)?/) + makeGeneralRTL(value.replace(/(.*)?url\((.*)\)/, ''));
if (property.match(/margin|padding/) && value.match(/(\S*) (\S*) (\S*) (\S*)/))
return value.replace(/(\S*) (\S*) (\S*) (\S*)/, "$1 $4 $3 $2");
return value;
}
/* end of file dmartl.js */

0 comments on commit 4761cba

Please sign in to comment.