Bug 1323553 - Add RTL to JSON Viewer r=Honza

MozReview-Commit-ID: AItCFstp7xd

--HG--
extra : rebase_source : 9a77af54503cffce6e7006a2ca6fd5c333507e77
This commit is contained in:
Tomer Cohen 2017-01-03 12:58:30 +02:00
parent 9fa0ca8e62
commit 7ee0a0db1b
3 changed files with 19 additions and 4 deletions

View File

@ -225,8 +225,13 @@ Converter.prototype = {
os = "linux";
}
let chromeReg = Cc["@mozilla.org/chrome/chrome-registry;1"]
.getService(Ci.nsIXULChromeRegistry);
let dir = chromeReg.isLocaleRTL("global") ? "rtl" : "ltr";
return "<!DOCTYPE html>\n" +
"<html platform=\"" + os + "\" class=\"" + themeClassName + "\">" +
"<html platform=\"" + os + "\" class=\"" + themeClassName +
"\" dir=\"" + dir + "\">" +
"<head><title>" + this.htmlEncode(title) + "</title>" +
"<base href=\"" + this.htmlEncode(baseUrl) + "\">" +
"<link rel=\"stylesheet\" type=\"text/css\" href=\"" +
@ -256,10 +261,14 @@ Converter.prototype = {
output += "</div><div id=\"json\">" + this.highlightError(data,
errorInfo.line, errorInfo.column) + "</div>";
let chromeReg = Cc["@mozilla.org/chrome/chrome-registry;1"]
.getService(Ci.nsIXULChromeRegistry);
let dir = chromeReg.isLocaleRTL("global") ? "rtl" : "ltr";
return "<!DOCTYPE html>\n" +
"<html><head><title>" + this.htmlEncode(uri + " - Error") + "</title>" +
"<base href=\"" + this.htmlEncode(this.data.url()) + "\">" +
"</head><body>" +
"</head><body dir=\"" + dir + "\">" +
output +
"</body></html>";
},

View File

@ -18,6 +18,7 @@
/* Panel Content */
.panelContent {
direction: ltr;
overflow-y: auto;
width: 100%;
}

View File

@ -18,7 +18,12 @@
color: var(--theme-content-color1);
width: 200px;
margin-top: 0;
margin-right: 1px;
margin-inline-end: 1px;
float: right;
padding-left: 20px;
padding-inline-start: 20px;
}
.searchBox:dir(rtl) {
float: left;
background-position: calc(100% - 2px) center;
}