Fossil SCM
/json/wiki/get: renamed request.payload.page to "name" for consistency. Added a TODO to /json/tag/list.
Commit
34056ea2382416a1feb871c3881093a047da80fd
Parent
3d6cc1df782e753…
4 files changed
+2
-1
+1
-1
+4
+9
-4
+2
-1
| --- ajax/index.html | ||
| +++ ajax/index.html | ||
| @@ -229,11 +229,12 @@ | ||
| 229 | 229 | <input type='button' value='branch/list' onclick='TheApp.cgi.sendCommand("/json/branch/list")' /> |
| 230 | 230 | <input type='button' value='timeline/ci' onclick='TheApp.cgi.sendCommand("/json/timeline/ci?files=true")' /> |
| 231 | 231 | <input type='button' value='timeline/wiki' onclick='TheApp.cgi.sendCommand("/json/timeline/wiki")' /> |
| 232 | 232 | <input type='button' value='timeline/ticket' onclick='TheApp.cgi.sendCommand("/json/timeline/ticket")' /> |
| 233 | 233 | <input type='button' value='wiki/list' onclick='TheApp.cgi.sendCommand("/json/wiki/list")' /> |
| 234 | -<input type='button' value='wiki/get Fossil' onclick='TheApp.cgi.sendCommand("/json/wiki/get",{page:"Fossil"})' /> | |
| 234 | +<input type='button' value='wiki/get Fossil' onclick='TheApp.cgi.sendCommand("/json/wiki/get",{name:"Fossil"})' /> | |
| 235 | +<input type='button' value='wiki/get/Fossil' onclick='TheApp.cgi.sendCommand("/json/wiki/get/Fossil")' /> | |
| 235 | 236 | <input type='button' value='user/list' onclick='TheApp.cgi.sendCommand("/json/user/list")' /> |
| 236 | 237 | <input type='button' value='user/get' onclick='TheApp.cgi.sendCommand("/json/user/get?name=anonymous")' /> |
| 237 | 238 | <input type='button' value='resultCodes' onclick='TheApp.cgi.sendCommand("/json/resultCodes")' /> |
| 238 | 239 | <input type='button' value='tag/list' onclick='TheApp.cgi.sendCommand("/json/tag/list?includeTickets=false&raw=false")' /> |
| 239 | 240 | <input type='button' value='tag/list/json' onclick='TheApp.cgi.sendCommand("/json/tag/list/json?raw=false")' /> |
| 240 | 241 |
| --- ajax/index.html | |
| +++ ajax/index.html | |
| @@ -229,11 +229,12 @@ | |
| 229 | <input type='button' value='branch/list' onclick='TheApp.cgi.sendCommand("/json/branch/list")' /> |
| 230 | <input type='button' value='timeline/ci' onclick='TheApp.cgi.sendCommand("/json/timeline/ci?files=true")' /> |
| 231 | <input type='button' value='timeline/wiki' onclick='TheApp.cgi.sendCommand("/json/timeline/wiki")' /> |
| 232 | <input type='button' value='timeline/ticket' onclick='TheApp.cgi.sendCommand("/json/timeline/ticket")' /> |
| 233 | <input type='button' value='wiki/list' onclick='TheApp.cgi.sendCommand("/json/wiki/list")' /> |
| 234 | <input type='button' value='wiki/get Fossil' onclick='TheApp.cgi.sendCommand("/json/wiki/get",{page:"Fossil"})' /> |
| 235 | <input type='button' value='user/list' onclick='TheApp.cgi.sendCommand("/json/user/list")' /> |
| 236 | <input type='button' value='user/get' onclick='TheApp.cgi.sendCommand("/json/user/get?name=anonymous")' /> |
| 237 | <input type='button' value='resultCodes' onclick='TheApp.cgi.sendCommand("/json/resultCodes")' /> |
| 238 | <input type='button' value='tag/list' onclick='TheApp.cgi.sendCommand("/json/tag/list?includeTickets=false&raw=false")' /> |
| 239 | <input type='button' value='tag/list/json' onclick='TheApp.cgi.sendCommand("/json/tag/list/json?raw=false")' /> |
| 240 |
| --- ajax/index.html | |
| +++ ajax/index.html | |
| @@ -229,11 +229,12 @@ | |
| 229 | <input type='button' value='branch/list' onclick='TheApp.cgi.sendCommand("/json/branch/list")' /> |
| 230 | <input type='button' value='timeline/ci' onclick='TheApp.cgi.sendCommand("/json/timeline/ci?files=true")' /> |
| 231 | <input type='button' value='timeline/wiki' onclick='TheApp.cgi.sendCommand("/json/timeline/wiki")' /> |
| 232 | <input type='button' value='timeline/ticket' onclick='TheApp.cgi.sendCommand("/json/timeline/ticket")' /> |
| 233 | <input type='button' value='wiki/list' onclick='TheApp.cgi.sendCommand("/json/wiki/list")' /> |
| 234 | <input type='button' value='wiki/get Fossil' onclick='TheApp.cgi.sendCommand("/json/wiki/get",{name:"Fossil"})' /> |
| 235 | <input type='button' value='wiki/get/Fossil' onclick='TheApp.cgi.sendCommand("/json/wiki/get/Fossil")' /> |
| 236 | <input type='button' value='user/list' onclick='TheApp.cgi.sendCommand("/json/user/list")' /> |
| 237 | <input type='button' value='user/get' onclick='TheApp.cgi.sendCommand("/json/user/get?name=anonymous")' /> |
| 238 | <input type='button' value='resultCodes' onclick='TheApp.cgi.sendCommand("/json/resultCodes")' /> |
| 239 | <input type='button' value='tag/list' onclick='TheApp.cgi.sendCommand("/json/tag/list?includeTickets=false&raw=false")' /> |
| 240 | <input type='button' value='tag/list/json' onclick='TheApp.cgi.sendCommand("/json/tag/list/json?raw=false")' /> |
| 241 |
+1
-1
| --- ajax/wiki-editor.html | ||
| +++ ajax/wiki-editor.html | ||
| @@ -198,11 +198,11 @@ | ||
| 198 | 198 | if(('object' === typeof p) && p.content) { |
| 199 | 199 | doShow(p); |
| 200 | 200 | return; |
| 201 | 201 | } |
| 202 | 202 | TheApp.cgi.sendCommand('/json/wiki/get',{ |
| 203 | - page:name | |
| 203 | + name:name | |
| 204 | 204 | },{ |
| 205 | 205 | onResponse:function(resp,req){ |
| 206 | 206 | TheApp.onResponse(resp,req); |
| 207 | 207 | if(resp.resultCode) return; |
| 208 | 208 | var p = resp.payload; |
| 209 | 209 |
| --- ajax/wiki-editor.html | |
| +++ ajax/wiki-editor.html | |
| @@ -198,11 +198,11 @@ | |
| 198 | if(('object' === typeof p) && p.content) { |
| 199 | doShow(p); |
| 200 | return; |
| 201 | } |
| 202 | TheApp.cgi.sendCommand('/json/wiki/get',{ |
| 203 | page:name |
| 204 | },{ |
| 205 | onResponse:function(resp,req){ |
| 206 | TheApp.onResponse(resp,req); |
| 207 | if(resp.resultCode) return; |
| 208 | var p = resp.payload; |
| 209 |
| --- ajax/wiki-editor.html | |
| +++ ajax/wiki-editor.html | |
| @@ -198,11 +198,11 @@ | |
| 198 | if(('object' === typeof p) && p.content) { |
| 199 | doShow(p); |
| 200 | return; |
| 201 | } |
| 202 | TheApp.cgi.sendCommand('/json/wiki/get',{ |
| 203 | name:name |
| 204 | },{ |
| 205 | onResponse:function(resp,req){ |
| 206 | TheApp.onResponse(resp,req); |
| 207 | if(resp.resultCode) return; |
| 208 | var p = resp.payload; |
| 209 |
+4
| --- src/json_tag.c | ||
| +++ src/json_tag.c | ||
| @@ -316,10 +316,14 @@ | ||
| 316 | 316 | } |
| 317 | 317 | |
| 318 | 318 | |
| 319 | 319 | /* |
| 320 | 320 | ** Impl for /json/tag/list |
| 321 | +** | |
| 322 | +** TODOs: | |
| 323 | +** | |
| 324 | +** Add -type TYPE (ci, w, e, t) | |
| 321 | 325 | */ |
| 322 | 326 | static cson_value * json_tag_list(){ |
| 323 | 327 | cson_value * payV = NULL; |
| 324 | 328 | cson_object * pay = NULL; |
| 325 | 329 | cson_value const * tagsVal = NULL; |
| 326 | 330 |
| --- src/json_tag.c | |
| +++ src/json_tag.c | |
| @@ -316,10 +316,14 @@ | |
| 316 | } |
| 317 | |
| 318 | |
| 319 | /* |
| 320 | ** Impl for /json/tag/list |
| 321 | */ |
| 322 | static cson_value * json_tag_list(){ |
| 323 | cson_value * payV = NULL; |
| 324 | cson_object * pay = NULL; |
| 325 | cson_value const * tagsVal = NULL; |
| 326 |
| --- src/json_tag.c | |
| +++ src/json_tag.c | |
| @@ -316,10 +316,14 @@ | |
| 316 | } |
| 317 | |
| 318 | |
| 319 | /* |
| 320 | ** Impl for /json/tag/list |
| 321 | ** |
| 322 | ** TODOs: |
| 323 | ** |
| 324 | ** Add -type TYPE (ci, w, e, t) |
| 325 | */ |
| 326 | static cson_value * json_tag_list(){ |
| 327 | cson_value * payV = NULL; |
| 328 | cson_object * pay = NULL; |
| 329 | cson_value const * tagsVal = NULL; |
| 330 |
+9
-4
| --- src/json_wiki.c | ||
| +++ src/json_wiki.c | ||
| @@ -159,23 +159,28 @@ | ||
| 159 | 159 | if( !g.perm.RdWiki && !g.perm.Read ){ |
| 160 | 160 | json_set_err(FSL_JSON_E_DENIED, |
| 161 | 161 | "Requires 'o' or 'j' access."); |
| 162 | 162 | return NULL; |
| 163 | 163 | } |
| 164 | - if(fossil_is_json()){ | |
| 165 | - zPageName = json_getenv_cstr("page"); | |
| 164 | + zPageName = json_find_option_cstr("name",NULL,"n") | |
| 165 | + /* Damn... fossil automatically sets name to the PATH | |
| 166 | + part after /json, so we need a workaround down here.... | |
| 167 | + */ | |
| 168 | + ; | |
| 169 | + if( zPageName && (NULL != strstr(zPageName, "/"))){ | |
| 170 | + /* Assume that we picked up a path remnant. */ | |
| 171 | + zPageName = NULL; | |
| 166 | 172 | } |
| 167 | - zPageName = json_find_option_cstr("page",NULL,"p"); | |
| 168 | 173 | if( !zPageName && cson_value_is_string(g.json.reqPayload.v) ){ |
| 169 | 174 | zPageName = cson_string_cstr(cson_value_get_string(g.json.reqPayload.v)); |
| 170 | 175 | } |
| 171 | 176 | if(!zPageName){ |
| 172 | 177 | zPageName = json_command_arg(g.json.dispatchDepth+1); |
| 173 | 178 | } |
| 174 | 179 | if(!zPageName||!*zPageName){ |
| 175 | 180 | json_set_err(FSL_JSON_E_MISSING_ARGS, |
| 176 | - "'page' argument is missing."); | |
| 181 | + "'name' argument is missing."); | |
| 177 | 182 | return NULL; |
| 178 | 183 | } |
| 179 | 184 | |
| 180 | 185 | zFormat = json_find_option_cstr("format",NULL,"f"); |
| 181 | 186 | if(!zFormat || !*zFormat){ |
| 182 | 187 |
| --- src/json_wiki.c | |
| +++ src/json_wiki.c | |
| @@ -159,23 +159,28 @@ | |
| 159 | if( !g.perm.RdWiki && !g.perm.Read ){ |
| 160 | json_set_err(FSL_JSON_E_DENIED, |
| 161 | "Requires 'o' or 'j' access."); |
| 162 | return NULL; |
| 163 | } |
| 164 | if(fossil_is_json()){ |
| 165 | zPageName = json_getenv_cstr("page"); |
| 166 | } |
| 167 | zPageName = json_find_option_cstr("page",NULL,"p"); |
| 168 | if( !zPageName && cson_value_is_string(g.json.reqPayload.v) ){ |
| 169 | zPageName = cson_string_cstr(cson_value_get_string(g.json.reqPayload.v)); |
| 170 | } |
| 171 | if(!zPageName){ |
| 172 | zPageName = json_command_arg(g.json.dispatchDepth+1); |
| 173 | } |
| 174 | if(!zPageName||!*zPageName){ |
| 175 | json_set_err(FSL_JSON_E_MISSING_ARGS, |
| 176 | "'page' argument is missing."); |
| 177 | return NULL; |
| 178 | } |
| 179 | |
| 180 | zFormat = json_find_option_cstr("format",NULL,"f"); |
| 181 | if(!zFormat || !*zFormat){ |
| 182 |
| --- src/json_wiki.c | |
| +++ src/json_wiki.c | |
| @@ -159,23 +159,28 @@ | |
| 159 | if( !g.perm.RdWiki && !g.perm.Read ){ |
| 160 | json_set_err(FSL_JSON_E_DENIED, |
| 161 | "Requires 'o' or 'j' access."); |
| 162 | return NULL; |
| 163 | } |
| 164 | zPageName = json_find_option_cstr("name",NULL,"n") |
| 165 | /* Damn... fossil automatically sets name to the PATH |
| 166 | part after /json, so we need a workaround down here.... |
| 167 | */ |
| 168 | ; |
| 169 | if( zPageName && (NULL != strstr(zPageName, "/"))){ |
| 170 | /* Assume that we picked up a path remnant. */ |
| 171 | zPageName = NULL; |
| 172 | } |
| 173 | if( !zPageName && cson_value_is_string(g.json.reqPayload.v) ){ |
| 174 | zPageName = cson_string_cstr(cson_value_get_string(g.json.reqPayload.v)); |
| 175 | } |
| 176 | if(!zPageName){ |
| 177 | zPageName = json_command_arg(g.json.dispatchDepth+1); |
| 178 | } |
| 179 | if(!zPageName||!*zPageName){ |
| 180 | json_set_err(FSL_JSON_E_MISSING_ARGS, |
| 181 | "'name' argument is missing."); |
| 182 | return NULL; |
| 183 | } |
| 184 | |
| 185 | zFormat = json_find_option_cstr("format",NULL,"f"); |
| 186 | if(!zFormat || !*zFormat){ |
| 187 |