= $page.attr("redirect") != null ? $page.attr("redirect")
: $page.find("textData").text()
;
- Rakka.displayPageEditor(pageName, oldRevision, defaultType, source);
+ var summary = $page.find("summary").text();
+
+ Rakka.displayPageEditor(pageName, oldRevision, defaultType, source, summary);
},
error : function (req) {
Rakka.hideWaitingMessage();
if (req.status == 404) {
- Rakka.displayPageEditor(pageName, null, "rakka", null);
+ Rakka.displayPageEditor(pageName, null, "rakka", null, "");
}
else {
$area.text("Error: " + req.status + " " + req.statusText);
};
Rakka.newPage = function () {
- Rakka.displayPageEditor("", null, "rakka", null);
+ Rakka.displayPageEditor("", null, "rakka", null, "");
};
-Rakka.displayPageEditor = function (pageName, oldRevision, defaultType, source) {
+Rakka.displayPageEditor = function (pageName, oldRevision, defaultType, source, summary) {
var $area = Rakka.switchScreen();
$area.empty();
name : "type",
checked: (defaultType == "redirect" ? "checked" : "")});
+ var fldSummary
+ = $.TEXTAREA({className: "summary"}, summary);
+
+ var trSummary
+ = $.TR({},
+ $.TH({}, "Summary"),
+ $.TD({}, fldSummary));
+
var fldRakkaSource
- = $.TEXTAREA({}, (defaultType == "rakka" && source != null ? source : ""));
+ = $.TEXTAREA({className: "source"},
+ (defaultType == "rakka" && source != null ? source : ""));
var fldCSSSource
- = $.TEXTAREA({}, (defaultType == "css" && source != null ? source : ""));
+ = $.TEXTAREA({className: "source"},
+ (defaultType == "css" && source != null ? source : ""));
var fldUploadFile
= $.INPUT({type: "file"});
oldRevision,
fldPageName.value,
"text/x-rakka",
+ fldSummary.value,
fldRakkaSource.value);
}
else if (btnTypeCSS.checked) {
oldRevision,
fldPageName.value,
"text/css",
+ fldSummary.value,
fldCSSSource.value);
}
else if (btnTypeBinary.checked) {
pageName,
oldRevision,
fldPageName.value,
+ fldSummary.value,
fldUploadFile.value);
}
else if (btnTypeRedirect.checked) {
var updateTRContent = function () {
if (btnTypeRakka.checked) {
+ $(trSummary).show();
$(trContent).find("th").text("Wiki source");
$(trContent).find("td").empty().append(fldRakkaSource);
$(btnPreview).show();
}
else if (btnTypeCSS.checked) {
+ $(trSummary).show();
$(trContent).find("th").text("CSS source");
$(trContent).find("td").empty().append(fldCSSSource);
$(btnPreview).hide();
}
else if (btnTypeBinary.checked) {
+ $(trSummary).show();
$(trContent).find("th").text("File");
$(trContent).find("td").empty().append(fldUploadFile);
$(btnPreview).show();
}
else if (btnTypeRedirect.checked) {
+ $(trSummary).hide();
$(trContent).find("th").text("Destination Page");
$(trContent).find("td").empty().append(fldRedirect);
$(btnPreview).hide();
)
)
),
+ trSummary,
trContent,
$.TR({},
$.TH({}),
} while (child = child.nextSibling);
};
-Rakka.submitTextPage = function (pageName, oldRevision, givenPageName, mimeType, text) {
+Rakka.submitTextPage = function (pageName, oldRevision, givenPageName, mimeType, summary, text) {
var doc = document.implementation.createDocument(
"http://cielonegro.org/schema/Rakka/Page/1.0", "page", null);
page.setAttribute("type", mimeType);
+ if (summary != null) {
+ var s = doc.createElement("summary");
+ s.appendChild(
+ doc.createTextNode(summary));
+ page.appendChild(s);
+ }
+
var textData = doc.createElement("textData");
textData.appendChild(
doc.createTextNode(text));
});
};
-Rakka.submitBinaryPage = function (pageName, oldRevision, givenPageName, path) {
+Rakka.submitBinaryPage = function (pageName, oldRevision, givenPageName, summary, path) {
var doc = document.implementation.createDocument(
"http://cielonegro.org/schema/Rakka/Page/1.0", "page", null);
page.setAttribute("type", "");
+ if (summary != null) {
+ var s = doc.createElement("summary");
+ s.appendChild(
+ doc.createTextNode(summary));
+ page.appendChild(s);
+ }
+
var bin = Rakka.loadLocalBinaryFile(path);
var b64 = Rakka.encodeBase64(bin);