X-Git-Url: https://git.cielonegro.org/gitweb.cgi?a=blobdiff_plain;f=js%2FeditPage.js;h=1843be911ae682ce4b3347c1d10a9509c878c9c4;hb=102d8daa39c593f0ee376c268a9372fc49254a4a;hp=eb5097c54da1fc3bd7fa524bb8d7e7a13a36824b;hpb=9c2fc861f3ed609ebb4d0f135aea38ca055bbea8;p=Rakka.git diff --git a/js/editPage.js b/js/editPage.js index eb5097c..1843be9 100644 --- a/js/editPage.js +++ b/js/editPage.js @@ -35,9 +35,9 @@ return obj; })(); var source - = $page.attr("redirect") != null ? $page.attr("redirect") - : $page.attr("isBinary") != null ? Rakka.decodeBase64($page.find("binaryData").text()) - : $page.find("textData").text() + = $page.attr("redirect") != null ? $page.attr("redirect") + : $page.attr("isBinary") == "yes" ? Rakka.decodeBase64($page.find("binaryData").text()) + : $page.find("textData").text() ; var summary = $page.find("summary").text(); @@ -237,13 +237,13 @@ = $.INPUT({type: "button", value: "Select file..."}); $(btnSelectFile).click(function () { - var path = Rakka.selectFile("Select a binary file to upload", "open"); - if (path != null) { - uploadFileBin = Rakka.loadLocalBinaryFile(path); - fldUploadFile.value = Rakka.hexDump(uploadFileBin, 128); - makeDirty(); - } - }); + var file = Rakka.selectFile("Select a binary file to upload", "open"); + if (file != null) { + uploadFileBin = Rakka.loadLocalBinaryFile(file); + fldUploadFile.value = Rakka.hexDump(uploadFileBin, 128); + makeDirty(); + } + }); var fldRedirect = $.INPUT({type: "text", value: (defaultType == "redirect" ? source : "")}); @@ -344,20 +344,6 @@ } }); - var btnCancel - = $.INPUT({type: "button", value: "Cancel editing"}); - - $(btnCancel).click(function () { - if (isDirty) { - if (window.confirm("Do you really want to discard changes?")) { - Rakka.restoreScreen(); - } - } - else { - Rakka.restoreScreen(); - } - }); - var updateTRContent = function () { if (btnTypeRakka.checked) { $(trPageLang).show(); @@ -458,7 +444,7 @@ trContent, $.TR({}, $.TH({}), - $.TD({}, btnPreview, btnSubmit, btnDelete, btnCancel) + $.TD({}, btnPreview, btnSubmit, btnDelete) ) ) );