contented integration
This commit is contained in:
parent
5347efb51a
commit
179617d058
@ -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: "",
|
||||
}
|
||||
}
|
||||
|
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>
|
||||
|
Loading…
Reference in New Issue
Block a user