From ef923209b09e6d91d4f3fbd8ff4a0ab22ba2e9ca Mon Sep 17 00:00:00 2001 From: Marcel Klehr Date: Tue, 30 Oct 2012 14:18:50 +0100 Subject: Refactor structure of api/http_api.md and add api version numbers for all endpoints. --- doc/api/http_api.md | 217 ++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 186 insertions(+), 31 deletions(-) diff --git a/doc/api/http_api.md b/doc/api/http_api.md index 3afab498..4bf6303e 100644 --- a/doc/api/http_api.md +++ b/doc/api/http_api.md @@ -116,43 +116,93 @@ Example usage: http://api.jquery.com/jQuery.getJSON/ ### Groups Pads can belong to a group. The padID of grouppads is starting with a groupID like g.asdfasdfasdfasdf$test -* **createGroup()** creates a new group

*Example returns:* +#### createGroup() + * API >= 1 + +creates a new group + +*Example returns:* * `{code: 0, message:"ok", data: {groupID: g.s8oes9dhwrvt0zif}}` -* **createGroupIfNotExistsFor(groupMapper)** this functions helps you to map your application group ids to etherpad lite group ids

*Example returns:* +#### createGroupIfNotExistsFor(groupMapper) + * API >= 1 + +this functions helps you to map your application group ids to etherpad lite group ids + +*Example returns:* * `{code: 0, message:"ok", data: {groupID: g.s8oes9dhwrvt0zif}}` -* **deleteGroup(groupID)** deletes a group

*Example returns:* +#### deleteGroup(groupID) + * API >= 1 + +deletes a group + +*Example returns:* * `{code: 0, message:"ok", data: null}` * `{code: 1, message:"groupID does not exist", data: null}` -* **listPads(groupID)** returns all pads of this group

*Example returns:* +#### listPads(groupID) + * API >= 1 + +returns all pads of this group + +*Example returns:* * `{code: 0, message:"ok", data: {padIDs : ["g.s8oes9dhwrvt0zif$test", "g.s8oes9dhwrvt0zif$test2"]}` * `{code: 1, message:"groupID does not exist", data: null}` -* **createGroupPad(groupID, padName [, text])** creates a new pad in this group

*Example returns:* +#### createGroupPad(groupID, padName [, text]) + * API >= 1 + +creates a new pad in this group + +*Example returns:* * `{code: 0, message:"ok", data: null}` * `{code: 1, message:"pad does already exist", data: null}` * `{code: 1, message:"groupID does not exist", data: null}` -* **listAllGroups()** lists all existing groups

*Example returns:* +#### listAllGroups() + * API >= 1 + +lists all existing groups + +*Example returns:* * `{code: 0, message:"ok", data: {groupIDs: ["g.mKjkmnAbSMtCt8eL", "g.3ADWx6sbGuAiUmCy"]}}` * `{code: 0, message:"ok", data: {groupIDs: []}}` ### Author These authors are bound to the attributes the users choose (color and name). -* **createAuthor([name])** creates a new author

*Example returns:* +#### createAuthor([name]) + * API >= 1 + +creates a new author + +*Example returns:* * `{code: 0, message:"ok", data: {authorID: "a.s8oes9dhwrvt0zif"}}` -* **createAuthorIfNotExistsFor(authorMapper [, name])** this functions helps you to map your application author ids to etherpad lite author ids

*Example returns:* +#### createAuthorIfNotExistsFor(authorMapper [, name]) + * API >= 1 + +this functions helps you to map your application author ids to etherpad lite author ids + +*Example returns:* * `{code: 0, message:"ok", data: {authorID: "a.s8oes9dhwrvt0zif"}}` -* **listPadsOfAuthor(authorID)** returns an array of all pads this author contributed to

*Example returns:* +#### listPadsOfAuthor(authorID) + * API >= 1 + +returns an array of all pads this author contributed to + +*Example returns:* * `{code: 0, message:"ok", data: {padIDs: ["g.s8oes9dhwrvt0zif$test", "g.s8oejklhwrvt0zif$foo"]}}` * `{code: 1, message:"authorID does not exist", data: null}` -* **getAuthorName(authorID)** Returns the Author Name of the author

*Example returns:* +#### getAuthorName(authorID) + * API >= 1.1 + +Returns the Author Name of the author + +*Example returns:* * `{code: 0, message:"ok", data: {authorName: "John McLear"}}` -> can't be deleted cause this would involve scanning all the pads where this author was @@ -160,25 +210,50 @@ These authors are bound to the attributes the users choose (color and name). ### Session Sessions can be created between a group and an author. This allows an author to access more than one group. The sessionID will be set as a cookie to the client and is valid until a certain date. The session cookie can also contain multiple comma-seperated sessionIDs, allowing a user to edit pads in different groups at the same time. Only users with a valid session for this group, can access group pads. You can create a session after you authenticated the user at your web application, to give them access to the pads. You should save the sessionID of this session and delete it after the user logged out. -* **createSession(groupID, authorID, validUntil)** creates a new session. validUntil is an unix timestamp in seconds

*Example returns:* +#### createSession(groupID, authorID, validUntil) + * API >= 1 + +creates a new session. validUntil is an unix timestamp in seconds + +*Example returns:* * `{code: 0, message:"ok", data: {sessionID: "s.s8oes9dhwrvt0zif"}}` * `{code: 1, message:"groupID doesn't exist", data: null}` * `{code: 1, message:"authorID doesn't exist", data: null}` * `{code: 1, message:"validUntil is in the past", data: null}` -* **deleteSession(sessionID)** deletes a session

*Example returns:* +#### deleteSession(sessionID) + * API >= 1 + +deletes a session + +*Example returns:* * `{code: 1, message:"ok", data: null}` * `{code: 1, message:"sessionID does not exist", data: null}` -* **getSessionInfo(sessionID)** returns informations about a session

*Example returns:* +#### getSessionInfo(sessionID) + * API >= 1 + +returns informations about a session + +*Example returns:* * `{code: 0, message:"ok", data: {authorID: "a.s8oes9dhwrvt0zif", groupID: g.s8oes9dhwrvt0zif, validUntil: 1312201246}}` * `{code: 1, message:"sessionID does not exist", data: null}` -* **listSessionsOfGroup(groupID)** returns all sessions of a group

*Example returns:* +#### listSessionsOfGroup(groupID) + * API >= 1 + +returns all sessions of a group + +*Example returns:* * `{"code":0,"message":"ok","data":{"s.oxf2ras6lvhv2132":{"groupID":"g.s8oes9dhwrvt0zif","authorID":"a.akf8finncvomlqva","validUntil":2312905480}}}` * `{code: 1, message:"groupID does not exist", data: null}` -* **listSessionsOfAuthor(authorID)** returns all sessions of an author

*Example returns:* +#### listSessionsOfAuthor(authorID) + * API >= 1 + +returns all sessions of an author + +*Example returns:* * `{"code":0,"message":"ok","data":{"s.oxf2ras6lvhv2132":{"groupID":"g.s8oes9dhwrvt0zif","authorID":"a.akf8finncvomlqva","validUntil":2312905480}}}` * `{code: 1, message:"authorID does not exist", data: null}` @@ -186,69 +261,149 @@ Sessions can be created between a group and an author. This allows an author to Pad content can be updated and retrieved through the API -* **getText(padID, [rev])** returns the text of a pad

*Example returns:* +#### getText(padID, [rev]) + * API >= 1 + +returns the text of a pad + +*Example returns:* * `{code: 0, message:"ok", data: {text:"Welcome Text"}}` * `{code: 1, message:"padID does not exist", data: null}` -* **setText(padID, text)** sets the text of a pad

*Example returns:* +#### setText(padID, text) + * API >= 1 + +sets the text of a pad + +*Example returns:* * `{code: 0, message:"ok", data: null}` * `{code: 1, message:"padID does not exist", data: null}` * `{code: 1, message:"text too long", data: null}` -* **getHTML(padID, [rev])** returns the text of a pad formatted as HTML

*Example returns:* +#### getHTML(padID, [rev]) + * API >= 1 + +returns the text of a pad formatted as HTML + +*Example returns:* * `{code: 0, message:"ok", data: {html:"Welcome Text
More Text"}}` * `{code: 1, message:"padID does not exist", data: null}` ### Pad Group pads are normal pads, but with the name schema GROUPID$PADNAME. A security manager controls access of them and its forbidden for normal pads to include a $ in the name. -* **createPad(padID [, text])** creates a new (non-group) pad. Note that if you need to create a group Pad, you should call **createGroupPad**.

*Example returns:* +#### createPad(padID [, text]) + * API >= 1 + +creates a new (non-group) pad. Note that if you need to create a group Pad, you should call **createGroupPad**. + +*Example returns:* * `{code: 0, message:"ok", data: null}` * `{code: 1, message:"pad does already exist", data: null}` -* **getRevisionsCount(padID)** returns the number of revisions of this pad

*Example returns:* +#### getRevisionsCount(padID) + * API >= 1 + +returns the number of revisions of this pad + +*Example returns:* * `{code: 0, message:"ok", data: {revisions: 56}}` * `{code: 1, message:"padID does not exist", data: null}` -* **padUsersCount(padID)** returns the number of user that are currently editing this pad

*Example returns:* +#### padUsersCount(padID) + * API >= 1 + +returns the number of user that are currently editing this pad + +*Example returns:* * `{code: 0, message:"ok", data: {padUsersCount: 5}}` -* **padUsers(padID)** returns the list of users that are currently editing this pad

*Example returns:* +#### padUsers(padID) + * API >= 1.1 + +returns the list of users that are currently editing this pad + +*Example returns:* * `{code: 0, message:"ok", data: {padUsers: [{colorId:"#c1a9d9","name":"username1","timestamp":1345228793126},{"colorId":"#d9a9cd","name":"Hmmm","timestamp":1345228796042}]}}` * `{code: 0, message:"ok", data: {padUsers: []}}` -* **deletePad(padID)** deletes a pad

*Example returns:* +#### deletePad(padID) + * API >= 1 + +deletes a pad + +*Example returns:* * `{code: 0, message:"ok", data: null}` * `{code: 1, message:"padID does not exist", data: null}` -* **getReadOnlyID(padID)** returns the read only link of a pad

*Example returns:* +#### getReadOnlyID(padID) + * API >= 1 + +returns the read only link of a pad + +*Example returns:* * `{code: 0, message:"ok", data: {readOnlyID: "r.s8oes9dhwrvt0zif"}}` * `{code: 1, message:"padID does not exist", data: null}` -* **setPublicStatus(padID, publicStatus)** sets a boolean for the public status of a pad

*Example returns:* +#### setPublicStatus(padID, publicStatus) + * API >= 1 + +sets a boolean for the public status of a pad + +*Example returns:* * `{code: 0, message:"ok", data: null}` * `{code: 1, message:"padID does not exist", data: null}` -* **getPublicStatus(padID)** return true of false

*Example returns:* +#### getPublicStatus(padID) + * API >= 1 + +return true of false + +*Example returns:* * `{code: 0, message:"ok", data: {publicStatus: true}}` * `{code: 1, message:"padID does not exist", data: null}` -* **setPassword(padID, password)** returns ok or a error message

*Example returns:* +#### setPassword(padID, password) + * API >= 1 + +returns ok or a error message + +*Example returns:* * `{code: 0, message:"ok", data: null}` * `{code: 1, message:"padID does not exist", data: null}` -* **isPasswordProtected(padID)** returns true or false

*Example returns:* +#### isPasswordProtected(padID) + * API >= 1 + +returns true or false + +*Example returns:* * `{code: 0, message:"ok", data: {passwordProtection: true}}` * `{code: 1, message:"padID does not exist", data: null}` -* **listAuthorsOfPad(padID)** returns an array of authors who contributed to this pad

*Example returns:* +#### listAuthorsOfPad(padID) + * API >= 1 + +returns an array of authors who contributed to this pad + +*Example returns:* * `{code: 0, message:"ok", data: {authorIDs : ["a.s8oes9dhwrvt0zif", "a.akf8finncvomlqva"]}` * `{code: 1, message:"padID does not exist", data: null}` -* **getLastEdited(padID)** returns the timestamp of the last revision of the pad

*Example returns:* +#### getLastEdited(padID) + * API >= 1 + +returns the timestamp of the last revision of the pad + +*Example returns:* * `{code: 0, message:"ok", data: {lastEdited: 1340815946602}}` * `{code: 1, message:"padID does not exist", data: null}` -* **sendClientsMessage(padID, msg)** sends a custom message of type `msg` to the pad

*Example returns:* +#### sendClientsMessage(padID, msg) + * API >= 1.1 + +sends a custom message of type `msg` to the pad + +*Example returns:* * `{code: 0, message:"ok", data: {}}` * `{code: 1, message:"padID does not exist", data: null}` -- cgit v1.2.3 From dd1e383d6e0980a4b621bbae3c6790b5e6460331 Mon Sep 17 00:00:00 2001 From: Marcel Klehr Date: Tue, 30 Oct 2012 14:35:26 +0100 Subject: Bump api version in #usage section --- doc/api/http_api.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/api/http_api.md b/doc/api/http_api.md index 4bf6303e..990d1b49 100644 --- a/doc/api/http_api.md +++ b/doc/api/http_api.md @@ -62,7 +62,7 @@ Portal submits content into new blog post ### Request Format -The API is accessible via HTTP. HTTP Requests are in the format /api/$APIVERSION/$FUNCTIONNAME. Parameters are transmitted via HTTP GET. $APIVERSION is 1 +The API is accessible via HTTP. HTTP Requests are in the format /api/$APIVERSION/$FUNCTIONNAME. Parameters are transmitted via HTTP GET. $APIVERSION depends on the endpoints you want to use. The latest version is `1.1` ### Response Format Responses are valid JSON in the following format: -- cgit v1.2.3 From d30bb6d892e1e0e8770acccf8cb403df29cec385 Mon Sep 17 00:00:00 2001 From: johnyma22 Date: Tue, 30 Oct 2012 21:57:15 +0000 Subject: fixes a tiny css bug #1077 --- src/static/css/timeslider.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/static/css/timeslider.css b/src/static/css/timeslider.css index 5f24a4cf..1dd0ca91 100644 --- a/src/static/css/timeslider.css +++ b/src/static/css/timeslider.css @@ -59,7 +59,7 @@ cursor: pointer; height: 35px; margin-left: 5px; - margin-right: 148px; + margin-right: 150px; position: relative; top: 20px; } @@ -292,4 +292,4 @@ OL { } * HTML .pause#playpause_button_icon { background-image: url(../../static/img/pause.gif) -} \ No newline at end of file +} -- cgit v1.2.3 From d9298778650eb7be2181dc9aaf23e14faff61e99 Mon Sep 17 00:00:00 2001 From: johnyma22 Date: Tue, 30 Oct 2012 22:35:01 +0000 Subject: JS fix for #1077 fire event at start because of the resize issue, this is a clean way of doing it --- src/static/js/timeslider.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/static/js/timeslider.js b/src/static/js/timeslider.js index a2156b16..5203e57b 100644 --- a/src/static/js/timeslider.js +++ b/src/static/js/timeslider.js @@ -158,6 +158,7 @@ function handleClientVars(message) { fireWhenAllScriptsAreLoaded[i](); } + $("#ui-slider-handle").css('left', $("#ui-slider-bar").width() - 2); } exports.baseURL = ''; -- cgit v1.2.3 From f676e90199a90235347467801f1d646da60cf8f7 Mon Sep 17 00:00:00 2001 From: Marcel Klehr Date: Wed, 31 Oct 2012 18:12:12 +0100 Subject: [docs] Fix assets: Rename doc/_assets to doc/assets github's jekyll would do some dark magic with '_assets'. We don't want that. --- Makefile | 4 ++-- doc/_assets/style.css | 44 -------------------------------------------- doc/assets/style.css | 44 ++++++++++++++++++++++++++++++++++++++++++++ doc/template.html | 2 +- 4 files changed, 47 insertions(+), 47 deletions(-) delete mode 100644 doc/_assets/style.css create mode 100644 doc/assets/style.css diff --git a/Makefile b/Makefile index ab720f28..4e870a45 100644 --- a/Makefile +++ b/Makefile @@ -1,13 +1,13 @@ doc_sources = $(wildcard doc/*/*.md) $(wildcard doc/*.md) outdoc_files = $(addprefix out/,$(doc_sources:.md=.html)) -docassets = $(addprefix out/,$(wildcard doc/_assets/*)) +docassets = $(addprefix out/,$(wildcard doc/assets/*)) VERSION = $(shell node -e "console.log( require('./src/package.json').version )") docs: $(outdoc_files) $(docassets) -out/doc/_assets/%: doc/_assets/% +out/doc/assets/%: doc/assets/% mkdir -p $(@D) cp $< $@ diff --git a/doc/_assets/style.css b/doc/_assets/style.css deleted file mode 100644 index fe1343af..00000000 --- a/doc/_assets/style.css +++ /dev/null @@ -1,44 +0,0 @@ -body.apidoc { - width: 60%; - min-width: 10cm; - margin: 0 auto; -} - -#header { - background-color: #5a5; - padding: 10px; - color: #111; -} - -a, -a:active { - color: #272; -} -a:focus, -a:hover { - color: #050; -} - -#apicontent a.mark, -#apicontent a.mark:active { - float: right; - color: #BBB; - font-size: 0.7cm; - text-decoration: none; -} -#apicontent a.mark:focus, -#apicontent a.mark:hover { - color: #AAA; -} - -#apicontent code { - padding: 1px; - background-color: #EEE; - border-radius: 4px; - border: 1px solid #DDD; -} -#apicontent pre>code { - display: block; - overflow: auto; - padding: 5px; -} \ No newline at end of file diff --git a/doc/assets/style.css b/doc/assets/style.css new file mode 100644 index 00000000..fe1343af --- /dev/null +++ b/doc/assets/style.css @@ -0,0 +1,44 @@ +body.apidoc { + width: 60%; + min-width: 10cm; + margin: 0 auto; +} + +#header { + background-color: #5a5; + padding: 10px; + color: #111; +} + +a, +a:active { + color: #272; +} +a:focus, +a:hover { + color: #050; +} + +#apicontent a.mark, +#apicontent a.mark:active { + float: right; + color: #BBB; + font-size: 0.7cm; + text-decoration: none; +} +#apicontent a.mark:focus, +#apicontent a.mark:hover { + color: #AAA; +} + +#apicontent code { + padding: 1px; + background-color: #EEE; + border-radius: 4px; + border: 1px solid #DDD; +} +#apicontent pre>code { + display: block; + overflow: auto; + padding: 5px; +} \ No newline at end of file diff --git a/doc/template.html b/doc/template.html index 6416da94..b91f3c16 100644 --- a/doc/template.html +++ b/doc/template.html @@ -3,7 +3,7 @@ __SECTION__ - Etherpad Lite v__VERSION__ Manual & Documentation - +