Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a260d102ee | |||
| 179617d058 | |||
| 5347efb51a |
2
Makefile
2
Makefile
@@ -2,7 +2,7 @@
|
||||
# Makefile for YATWiki3
|
||||
#
|
||||
|
||||
VERSION:=3.0.2
|
||||
VERSION:=3.1.0
|
||||
|
||||
SOURCES:=Makefile \
|
||||
static \
|
||||
|
||||
@@ -21,6 +21,7 @@ type ServerOptions struct {
|
||||
ExternalBaseURL string
|
||||
DeclareRSSLanguage string
|
||||
DeclareRSSEmail string
|
||||
ContentedServer string
|
||||
}
|
||||
|
||||
func DefaultOptions() *ServerOptions {
|
||||
@@ -41,5 +42,6 @@ func DefaultOptions() *ServerOptions {
|
||||
ExternalBaseURL: "http://127.0.0.1/",
|
||||
DeclareRSSLanguage: "en-GB",
|
||||
DeclareRSSEmail: `nobody@example.com`,
|
||||
ContentedServer: "",
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@ As of the 3.0 release, YATWiki is now a standalone server instead of a PHP scrip
|
||||
- IP-based ban system
|
||||
- Article index, random article, download database backup
|
||||
- Source code highlighting (thanks [url=https://github.com/isagalaev/highlight.js]highlight.js[/url])
|
||||
- Optional integration with `contented` for file/image uploads
|
||||
|
||||
Written in Golang, PHP
|
||||
|
||||
@@ -35,6 +36,9 @@ This package can be installed via go get: `go get code.ivysaur.me/yatwiki`
|
||||
|
||||
=CHANGELOG=
|
||||
|
||||
2017-10-08 3.1.0
|
||||
- Feature: Support content upload to a `contented` server
|
||||
|
||||
2017-08-11 3.0.2
|
||||
- Fix an issue with XSS prevention for web browsers other than Chrome
|
||||
|
||||
|
||||
19
rModify.go
19
rModify.go
@@ -49,6 +49,25 @@ func (this *WikiServer) routeModify(w http.ResponseWriter, r *http.Request, arti
|
||||
</label>
|
||||
<input type="submit" value="Save »">
|
||||
| <a href="` + template.HTMLEscapeString(this.opts.ExpectBaseURL+`formatting`) + `" target="_blank">formatting help</a>
|
||||
`
|
||||
if len(this.opts.ContentedServer) > 0 {
|
||||
content += `
|
||||
<script type="text/javascript" src="` + this.opts.ContentedServer + `jquery-1.12.4.min.js"></script>
|
||||
<script type="text/javascript" src="` + this.opts.ContentedServer + `sdk.js"></script>
|
||||
| <a href="javascript:;" id="open-contented-uploader">upload...</a>
|
||||
<script type="text/javascript">
|
||||
$("#open-contented-uploader").on('click', function() {
|
||||
contented.init("#contentctr", function(items) {
|
||||
for (var i = 0; i < items.length; ++i) {
|
||||
$("#contentctr textarea").append(" " + "` + this.opts.ContentedServer + `get/" + items[i] + " ");
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
`
|
||||
}
|
||||
|
||||
content += `
|
||||
</div>
|
||||
<div id="contentctr"><textarea name="content">` + template.HTMLEscapeString(existingBody) + `</textarea></div>
|
||||
</form>
|
||||
|
||||
Reference in New Issue
Block a user