7 Commits

Author SHA1 Message Date
47aeaff66e doc: changelog 2017-10-08 17:12:56 +13:00
d18a5fd272 bump all versions to 1.0.1 2017-10-08 17:12:49 +13:00
3a0566ca0a doc: tweak SDK information 2017-10-08 17:12:26 +13:00
36f62dd502 doc: add image 2017-10-08 17:12:17 +13:00
5b1a94c735 fix CORS 2017-10-08 17:06:24 +13:00
75c3a98f33 fix no default index page 2017-10-08 16:54:26 +13:00
e9fbfd0277 Added tag release-1.0.0 for changeset e2250a7fd290 2017-10-08 16:43:50 +13:00
5 changed files with 13 additions and 10 deletions

1
.hgtags Normal file
View File

@@ -0,0 +1 @@
e2250a7fd29052ea767f18e1459cabea4cd7efd3 release-1.0.0

View File

@@ -2,7 +2,7 @@
# Makefile for contented
#
VERSION:=1.0.0
VERSION:=1.0.1
SOURCES:=Makefile \
static \

View File

@@ -86,6 +86,7 @@ const (
func (this *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
w.Header().Set(`Server`, SERVER_HEADER)
w.Header().Set(`Access-Control-Allow-Origin`, `*`) // Blanket allow CORS
if this.opts.MaxUploadBytes > 0 {
r.Body = http.MaxBytesReader(w, r.Body, this.opts.MaxUploadBytes)
}
@@ -108,10 +109,12 @@ func (this *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
this.handleUpload(w, r)
} else if r.Method == "OPTIONS" {
// Blanket allow
w.Header().Set(`Access-Control-Allow-Origin`, `*`)
// Blanket allow (headers already set)
w.WriteHeader(200)
} else if r.Method == "GET" && r.URL.Path == `/` {
http.Redirect(w, r, `/index.html`, http.StatusFound)
} else if static, err := Asset(r.URL.Path[1:]); err == nil && r.Method == "GET" {
http.ServeContent(w, r, r.URL.Path[1:], this.startTime, bytes.NewReader(static))

View File

@@ -44,18 +44,17 @@ The server responds on the following URLs:
=USAGE (EMBEDDING FOR WEB)=
Your webpage should load the SDK from the contented server, then call the `contented.init` function to display the upload widget over the top of an existing DOM element.
Your webpage should load the SDK from the contented server, then call the `contented.init` function to display the upload widget over the top of an existing DOM element. Your callback will be passed an array of file IDs of any uploaded items. The SDK depends on jQuery.
The SDK will run your callback, passing it the file IDs of any uploaded items.
The SDK depends on jQuery.
`
<script type="text/javascript" src="SERVER_ADDR/sdk.js"></script>
`<script type="text/javascript" src="SERVER_ADDR/sdk.js"></script>
contented.init("#target", function(/* String[] */ items) {});
`
=CHANGELOG=
2017-10-08: 1.0.1
- Fix an issue with CORS preflight requests
- Fix an issue with index URLs
2017-10-08: 1.0.0
- Initial public release

BIN
_dist/image1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB