-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Rackover
committed
Feb 9, 2020
1 parent
e6aeb6f
commit 2c8b8ba
Showing
9 changed files
with
173 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
module.exports = async function(body){ | ||
let code = 200 | ||
let content = "OK" | ||
|
||
const miss = utility.getMissingFields(body, ["data", "virtualPath"]) | ||
|
||
if (miss.length > 0){ | ||
code = 400 | ||
content = "The following fields are missing from the POST body: "+miss.join(", "); | ||
} | ||
else{ | ||
await wikiPage.add(body.virtualPath, body.data) | ||
} | ||
|
||
return { | ||
code:code, | ||
content:content | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
module.exports = { | ||
getMissingFields: getMissingFields | ||
} | ||
|
||
function getMissingFields(obj, fields){ | ||
let missing = [] | ||
for (k in fields){ | ||
const field = fields[k] | ||
if (undefined === (obj[field])){ | ||
missing.push(field) | ||
} | ||
} | ||
return missing | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,28 @@ | ||
a.saveButton:after{ | ||
content: "Save"; | ||
a.submitButton:after{ | ||
content: "Submit and go to..."; | ||
font-family: "Noto sans"; | ||
margin-left: 6px; | ||
} | ||
|
||
a.saveButton{ | ||
a.submitButton{ | ||
width:auto; | ||
border:1px dotted grey; | ||
padding-left: 6px; | ||
padding-right: 6px; | ||
background:linear-gradient(#00DD44, #006622); | ||
color:white !important; | ||
font-weight:bold; | ||
} | ||
|
||
a.saveButton:hover{ | ||
a.submitButton:hover{ | ||
border:1px solid grey; | ||
background:linear-gradient(#00FF55, #00AA66); | ||
} | ||
|
||
a.saveButton.saving{ | ||
background:rgb(100, 100, 100); | ||
} | ||
|
||
.CodeMirror.saving{ | ||
color:grey !important; | ||
background-color:lightgrey !important; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.