contented integration
This commit is contained in:
parent
5347efb51a
commit
179617d058
@ -21,6 +21,7 @@ type ServerOptions struct {
|
|||||||
ExternalBaseURL string
|
ExternalBaseURL string
|
||||||
DeclareRSSLanguage string
|
DeclareRSSLanguage string
|
||||||
DeclareRSSEmail string
|
DeclareRSSEmail string
|
||||||
|
ContentedServer string
|
||||||
}
|
}
|
||||||
|
|
||||||
func DefaultOptions() *ServerOptions {
|
func DefaultOptions() *ServerOptions {
|
||||||
@ -41,5 +42,6 @@ func DefaultOptions() *ServerOptions {
|
|||||||
ExternalBaseURL: "http://127.0.0.1/",
|
ExternalBaseURL: "http://127.0.0.1/",
|
||||||
DeclareRSSLanguage: "en-GB",
|
DeclareRSSLanguage: "en-GB",
|
||||||
DeclareRSSEmail: `nobody@example.com`,
|
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>
|
</label>
|
||||||
<input type="submit" value="Save »">
|
<input type="submit" value="Save »">
|
||||||
| <a href="` + template.HTMLEscapeString(this.opts.ExpectBaseURL+`formatting`) + `" target="_blank">formatting help</a>
|
| <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>
|
||||||
<div id="contentctr"><textarea name="content">` + template.HTMLEscapeString(existingBody) + `</textarea></div>
|
<div id="contentctr"><textarea name="content">` + template.HTMLEscapeString(existingBody) + `</textarea></div>
|
||||||
</form>
|
</form>
|
||||||
|
Loading…
Reference in New Issue
Block a user