: $page.attr("redirect") != null ? "redirect"
: "unknown"
;
+ var lang = $page.attr("lang");
var isLocked = $page.attr("isLocked") == "yes";
var source
= $page.attr("redirect") != null ? $page.attr("redirect")
;
var summary = $page.find("summary").text();
- displayPageEditor(pageName, oldRevision, defaultType, isLocked, source, summary);
+ displayPageEditor(pageName, oldRevision, defaultType, lang, isLocked, source, summary);
}
else {
- displayPageEditor(pageName, null, "rakka", false, null, "");
+ displayPageEditor(pageName, null, "rakka", null, false, null, "");
}
},
error : function (req) {
Rakka.hideWaitingMessage();
if (req.status == 404) {
- displayPageEditor(pageName, null, "rakka", false, null, "");
+ displayPageEditor(pageName, null, "rakka", null, false, null, "");
}
else {
$area.text("Error: " + req.status + " " + req.statusText);
};
Rakka.newPage = function () {
- displayPageEditor("", null, "rakka", false, null, "");
+ displayPageEditor("", null, "rakka", null, false, null, "");
};
- var displayPageEditor = function (pageName, oldRevision, defaultType, isLocked, source, summary) {
+ var displayPageEditor = function (pageName, oldRevision, defaultType, lang, isLocked, source, summary) {
var $area = Rakka.switchScreen();
$previewHeader = $( $.H1({}, "Preview") );
$(btnTypeRedirect).change(makeDirty);
+ var selPageLang
+ = $.SELECT({},
+ $.OPTION({value: ""}, "(unspecified)"),
+ (function () {
+ var options = [];
+
+ $.each(Rakka.getSystemConfig().languages, function (tag, name) {
+ options.push(
+ $.OPTION({value: tag}, name));
+ });
+
+ return options;
+ })());
+
+ $(selPageLang).change(makeDirty);
+
+ if (lang == null || lang == "") {
+ $(selPageLang).val($("html").attr("xml:lang"));
+ }
+ else {
+ $(selPageLang).val(lang);
+ }
+
+ var trPageLang
+ = $.TR({},
+ $.TH({}, "Page language"),
+ $.TD({}, selPageLang));
+
var fldSummary
= $.TEXTAREA({className: "summary"}, summary);
fldPageName.value,
chkIsLocked.checked,
"text/x-rakka",
+ $(selPageLang).val(),
fldSummary.value,
fldRakkaSource.value);
}
fldPageName.value,
chkIsLocked.checked,
"text/css",
+ $(selPageLang).val(),
fldSummary.value,
fldCSSSource.value);
}
oldRevision,
fldPageName.value,
chkIsLocked.checked,
+ $(selPageLang).val(),
fldSummary.value,
fldUploadFile.value);
}
var updateTRContent = function () {
if (btnTypeRakka.checked) {
+ $(trPageLang).show();
$(trSummary).show();
$(trContent).find("th").text("Wiki source");
$(trContent).find("td").empty().append(fldRakkaSource);
$(btnPreview).show();
}
else if (btnTypeCSS.checked) {
+ $(trPageLang).show();
$(trSummary).show();
$(trContent).find("th").text("CSS source");
$(trContent).find("td").empty().append(fldCSSSource);
$(btnPreview).hide();
}
else if (btnTypeBinary.checked) {
+ $(trPageLang).show();
$(trSummary).show();
$(trContent).find("th").text("File");
$(trContent).find("td").empty().append(fldUploadFile);
$(btnPreview).show();
}
else if (btnTypeRedirect.checked) {
+ $(trPageLang).hide();
$(trSummary).hide();
$(trContent).find("th").text("Destination Page");
$(trContent).find("td").empty().append(fldRedirect);
)
)
),
+ trPageLang,
trSummary,
trContent,
$.TR({},
Rakka.scrollToTopLeft();
};
- var submitTextPage = function (pageName, oldRevision, givenPageName, isLocked, mimeType, summary, text) {
+ var submitTextPage = function (pageName, oldRevision, givenPageName, isLocked, mimeType, lang, summary, text) {
var doc = document.implementation.createDocument(
"http://cielonegro.org/schema/Rakka/Page/1.0", "page", null);
page.setAttribute("isLocked", isLocked ? "yes" : "no");
page.setAttribute("type", mimeType);
- if (summary != null) {
+ if (lang != null && lang != "") {
+ page.setAttribute("lang", lang);
+ }
+
+ if (summary != null && summary != "") {
var s = doc.createElement("summary");
s.appendChild(
doc.createTextNode(summary));
});
};
- var submitBinaryPage = function (pageName, oldRevision, givenPageName, isLocked, summary, path) {
+ var submitBinaryPage = function (pageName, oldRevision, givenPageName, isLocked, lang, summary, path) {
var doc = document.implementation.createDocument(
"http://cielonegro.org/schema/Rakka/Page/1.0", "page", null);
page.setAttribute("isLocked", isLocked ? "yes" : "no");
page.setAttribute("type", "");
+ if (lang != null && lang != "") {
+ page.setAttribute("lang", lang);
+ }
+
if (summary != null) {
var s = doc.createElement("summary");
s.appendChild(