Fossil SCM
A few internal cosmetic cleanups, added json_get_wiki_page_by_rid().
Commit
afb3c89fe6beee621a18d212eee9be83f7cbf73d
Parent
cf10d9d9b936862…
6 files changed
+9
+37
-3
+9
-13
+1
-1
+4
-5
+27
-2
+9
| --- ajax/index.html | ||
| +++ ajax/index.html | ||
| @@ -183,25 +183,32 @@ | ||
| 183 | 183 | TheApp.cgi.onLogout = function(){ |
| 184 | 184 | TheApp.jqe.taResponse.val( "Logged out!" ); |
| 185 | 185 | TheApp.jqe.currentAuthToken.text("Not logged in"); |
| 186 | 186 | }; |
| 187 | 187 | TheApp.cgi.whoami(); |
| 188 | + jQuery('#headerArea').click(function(){ | |
| 189 | + jQuery(this).slideUp('fast',function(){ | |
| 190 | + jQuery(this).remove(); | |
| 191 | + }); | |
| 192 | + }); | |
| 188 | 193 | }); |
| 189 | 194 | |
| 190 | 195 | </script> |
| 191 | 196 | |
| 192 | 197 | </head> |
| 193 | 198 | |
| 194 | 199 | <body> |
| 195 | 200 | <span id='ajaxNotification'></span> |
| 201 | +<div id='headerArea'> | |
| 196 | 202 | <h1>You know, for sending raw JSON requests to Fossil...</h1> |
| 197 | 203 | |
| 198 | 204 | If you're actually using this page, then you know what you're doing and don't |
| 199 | 205 | need help text, hoverhelp, and a snazzy interface. |
| 200 | 206 | |
| 201 | 207 | <br><br> |
| 202 | 208 | See also: <a href='wiki-editor.html'>prototype wiki editor</a>. |
| 209 | +</div><!-- #headerArea --> | |
| 203 | 210 | |
| 204 | 211 | <h2>Request...</h2> |
| 205 | 212 | |
| 206 | 213 | Path: <input type='text' size='40' id='textPath' value='/json/HAI'/> |
| 207 | 214 | <input type='button' value='Send...' id='btnSend' onclick='TheApp.sendRequest()' /><br/> |
| @@ -221,11 +228,13 @@ | ||
| 221 | 228 | <input type='button' value='timeline/ticket' onclick='TheApp.cgi.sendCommand("/json/timeline/ticket")' /> |
| 222 | 229 | <input type='button' value='wiki/list' onclick='TheApp.cgi.sendCommand("/json/wiki/list")' /> |
| 223 | 230 | <input type='button' value='wiki/get Fossil' onclick='TheApp.cgi.sendCommand("/json/wiki/get",{page:"Fossil"})' /> |
| 224 | 231 | <input type='button' value='user/list' onclick='TheApp.cgi.sendCommand("/json/user/list")' /> |
| 225 | 232 | <input type='button' value='user/get' onclick='TheApp.cgi.sendCommand("/json/user/get?name=anonymous")' /> |
| 233 | +<!-- not yet ready... | |
| 226 | 234 | <input type='button' value='artifact/XYZ' onclick='TheApp.cgi.sendCommand("/json/artifact?uuid=json")' /> |
| 235 | +--> | |
| 227 | 236 | |
| 228 | 237 | <!-- |
| 229 | 238 | <input type='button' value='get whiki' onclick='TheApp.cgi.getPages("whiki")' /> |
| 230 | 239 | <input type='button' value='get more' onclick='TheApp.cgi.getPages("HelloWorld/WhikiNews")' /> |
| 231 | 240 | <input type='button' value='get client data' onclick='TheApp.cgi.getPageClientData("HelloWorld/whiki/WhikiCommands")' /> |
| 232 | 241 |
| --- ajax/index.html | |
| +++ ajax/index.html | |
| @@ -183,25 +183,32 @@ | |
| 183 | TheApp.cgi.onLogout = function(){ |
| 184 | TheApp.jqe.taResponse.val( "Logged out!" ); |
| 185 | TheApp.jqe.currentAuthToken.text("Not logged in"); |
| 186 | }; |
| 187 | TheApp.cgi.whoami(); |
| 188 | }); |
| 189 | |
| 190 | </script> |
| 191 | |
| 192 | </head> |
| 193 | |
| 194 | <body> |
| 195 | <span id='ajaxNotification'></span> |
| 196 | <h1>You know, for sending raw JSON requests to Fossil...</h1> |
| 197 | |
| 198 | If you're actually using this page, then you know what you're doing and don't |
| 199 | need help text, hoverhelp, and a snazzy interface. |
| 200 | |
| 201 | <br><br> |
| 202 | See also: <a href='wiki-editor.html'>prototype wiki editor</a>. |
| 203 | |
| 204 | <h2>Request...</h2> |
| 205 | |
| 206 | Path: <input type='text' size='40' id='textPath' value='/json/HAI'/> |
| 207 | <input type='button' value='Send...' id='btnSend' onclick='TheApp.sendRequest()' /><br/> |
| @@ -221,11 +228,13 @@ | |
| 221 | <input type='button' value='timeline/ticket' onclick='TheApp.cgi.sendCommand("/json/timeline/ticket")' /> |
| 222 | <input type='button' value='wiki/list' onclick='TheApp.cgi.sendCommand("/json/wiki/list")' /> |
| 223 | <input type='button' value='wiki/get Fossil' onclick='TheApp.cgi.sendCommand("/json/wiki/get",{page:"Fossil"})' /> |
| 224 | <input type='button' value='user/list' onclick='TheApp.cgi.sendCommand("/json/user/list")' /> |
| 225 | <input type='button' value='user/get' onclick='TheApp.cgi.sendCommand("/json/user/get?name=anonymous")' /> |
| 226 | <input type='button' value='artifact/XYZ' onclick='TheApp.cgi.sendCommand("/json/artifact?uuid=json")' /> |
| 227 | |
| 228 | <!-- |
| 229 | <input type='button' value='get whiki' onclick='TheApp.cgi.getPages("whiki")' /> |
| 230 | <input type='button' value='get more' onclick='TheApp.cgi.getPages("HelloWorld/WhikiNews")' /> |
| 231 | <input type='button' value='get client data' onclick='TheApp.cgi.getPageClientData("HelloWorld/whiki/WhikiCommands")' /> |
| 232 |
| --- ajax/index.html | |
| +++ ajax/index.html | |
| @@ -183,25 +183,32 @@ | |
| 183 | TheApp.cgi.onLogout = function(){ |
| 184 | TheApp.jqe.taResponse.val( "Logged out!" ); |
| 185 | TheApp.jqe.currentAuthToken.text("Not logged in"); |
| 186 | }; |
| 187 | TheApp.cgi.whoami(); |
| 188 | jQuery('#headerArea').click(function(){ |
| 189 | jQuery(this).slideUp('fast',function(){ |
| 190 | jQuery(this).remove(); |
| 191 | }); |
| 192 | }); |
| 193 | }); |
| 194 | |
| 195 | </script> |
| 196 | |
| 197 | </head> |
| 198 | |
| 199 | <body> |
| 200 | <span id='ajaxNotification'></span> |
| 201 | <div id='headerArea'> |
| 202 | <h1>You know, for sending raw JSON requests to Fossil...</h1> |
| 203 | |
| 204 | If you're actually using this page, then you know what you're doing and don't |
| 205 | need help text, hoverhelp, and a snazzy interface. |
| 206 | |
| 207 | <br><br> |
| 208 | See also: <a href='wiki-editor.html'>prototype wiki editor</a>. |
| 209 | </div><!-- #headerArea --> |
| 210 | |
| 211 | <h2>Request...</h2> |
| 212 | |
| 213 | Path: <input type='text' size='40' id='textPath' value='/json/HAI'/> |
| 214 | <input type='button' value='Send...' id='btnSend' onclick='TheApp.sendRequest()' /><br/> |
| @@ -221,11 +228,13 @@ | |
| 228 | <input type='button' value='timeline/ticket' onclick='TheApp.cgi.sendCommand("/json/timeline/ticket")' /> |
| 229 | <input type='button' value='wiki/list' onclick='TheApp.cgi.sendCommand("/json/wiki/list")' /> |
| 230 | <input type='button' value='wiki/get Fossil' onclick='TheApp.cgi.sendCommand("/json/wiki/get",{page:"Fossil"})' /> |
| 231 | <input type='button' value='user/list' onclick='TheApp.cgi.sendCommand("/json/user/list")' /> |
| 232 | <input type='button' value='user/get' onclick='TheApp.cgi.sendCommand("/json/user/get?name=anonymous")' /> |
| 233 | <!-- not yet ready... |
| 234 | <input type='button' value='artifact/XYZ' onclick='TheApp.cgi.sendCommand("/json/artifact?uuid=json")' /> |
| 235 | --> |
| 236 | |
| 237 | <!-- |
| 238 | <input type='button' value='get whiki' onclick='TheApp.cgi.getPages("whiki")' /> |
| 239 | <input type='button' value='get more' onclick='TheApp.cgi.getPages("HelloWorld/WhikiNews")' /> |
| 240 | <input type='button' value='get client data' onclick='TheApp.cgi.getPageClientData("HelloWorld/whiki/WhikiCommands")' /> |
| 241 |
+37
-3
| --- ajax/js/whajaj.js | ||
| +++ ajax/js/whajaj.js | ||
| @@ -207,12 +207,10 @@ | ||
| 207 | 207 | WhAjaj.Connector = function(opt) |
| 208 | 208 | { |
| 209 | 209 | if(WhAjaj.isObject(opt)) this.options = opt; |
| 210 | 210 | //TODO?: this.$cache = {}; |
| 211 | 211 | }; |
| 212 | -WhAjaj.Connector.prototype.callbacks = {}; | |
| 213 | -WhAjaj.Connector.prototype.options = {}; | |
| 214 | 212 | |
| 215 | 213 | /** |
| 216 | 214 | The core options used by WhAjaj.Connector instances for performing |
| 217 | 215 | network operations. These options can (and some _should_) |
| 218 | 216 | be changed by a client application. They can also be changed |
| @@ -262,11 +260,11 @@ | ||
| 262 | 260 | pretty prevelant in the source tree, so i can't globally |
| 263 | 261 | swap it out. |
| 264 | 262 | */ |
| 265 | 263 | ajax: { |
| 266 | 264 | /** |
| 267 | - URL of the whiki back-end CGI binary. | |
| 265 | + URL of the back-end server/CGI. | |
| 268 | 266 | */ |
| 269 | 267 | url: '/some/path', |
| 270 | 268 | |
| 271 | 269 | /** |
| 272 | 270 | Connection method. Some connection-related functions might |
| @@ -406,10 +404,39 @@ | ||
| 406 | 404 | instead of a response object parsed from JSON. |
| 407 | 405 | */ |
| 408 | 406 | jsonp:undefined |
| 409 | 407 | } |
| 410 | 408 | }; |
| 409 | + | |
| 410 | + | |
| 411 | +/** | |
| 412 | + WhAjaj.Connector.prototype.callbacks defines callbacks analog | |
| 413 | + to the onXXX callbacks defined in WhAjaj.Connector.options.ajax, | |
| 414 | + with two notable differences: | |
| 415 | + | |
| 416 | + 1) these callbacks, if set, are called in addition to any | |
| 417 | + request-specific callback. The intention is to allow a framework to set | |
| 418 | + "framework-level" callbacks which should be called independently of the | |
| 419 | + request-specific callbacks (without interfering with them, e.g. | |
| 420 | + requiring special re-forwarding features). | |
| 421 | + | |
| 422 | + 2) The 'this' object in these callbacks is the Connector instance | |
| 423 | + associated with the callback, whereas the "other" onXXX form has its | |
| 424 | + "ajax options" object as its this. | |
| 425 | + | |
| 426 | + When this API says that an onXXX callback will be called for a request, | |
| 427 | + both the request's onXXX (if set) and this one (if set) will be called. | |
| 428 | +*/ | |
| 429 | +WhAjaj.Connector.prototype.callbacks = {}; | |
| 430 | +/** | |
| 431 | + Instance-specific values for AJAJ-level properties (as opposed to | |
| 432 | + application-level request properties). Options set here "override" those | |
| 433 | + specified in WhAjaj.Connector.options.ajax and are "overridden" by | |
| 434 | + options passed to sendRequest(). | |
| 435 | +*/ | |
| 436 | +WhAjaj.Connector.prototype.options = {}; | |
| 437 | + | |
| 411 | 438 | |
| 412 | 439 | /** |
| 413 | 440 | Tries to find the given key in any of the following, returning |
| 414 | 441 | the first match found: opt, this.options, WhAjaj.Connector.options.ajax. |
| 415 | 442 | |
| @@ -421,10 +448,11 @@ | ||
| 421 | 448 | else v = this.options[key]; |
| 422 | 449 | if( undefined !== v ) return v; |
| 423 | 450 | else v = WhAjaj.Connector.options.ajax[key]; |
| 424 | 451 | return v; |
| 425 | 452 | }; |
| 453 | + | |
| 426 | 454 | /** |
| 427 | 455 | Returns a unique string on each call containing a generic |
| 428 | 456 | reandom request identifier string. This is not used by the core |
| 429 | 457 | API but can be used by client code to generate unique IDs for |
| 430 | 458 | each request (if needed). |
| @@ -532,10 +560,13 @@ | ||
| 532 | 560 | The opt object should be the normalized AJAX options used |
| 533 | 561 | for the connection. |
| 534 | 562 | |
| 535 | 563 | The resp argument may be either a plain Object or a string |
| 536 | 564 | (in which case it is assumed to be JSON). |
| 565 | + | |
| 566 | + The 'this' object for this call MUST be a WhAjaj.Connector | |
| 567 | + instance in order for callback processing to work properly. | |
| 537 | 568 | |
| 538 | 569 | This function takes care of the following: |
| 539 | 570 | |
| 540 | 571 | - Calling opt.afterSend() |
| 541 | 572 | |
| @@ -621,10 +652,13 @@ | ||
| 621 | 652 | properties are followed. |
| 622 | 653 | |
| 623 | 654 | The request argument must be the original request passed to |
| 624 | 655 | the sendImpl() function. It may legally be null for GET |
| 625 | 656 | requests. |
| 657 | + | |
| 658 | + The 'this' object for this call MUST be a WhAjaj.Connector | |
| 659 | + instance in order for callback processing to work properly. | |
| 626 | 660 | |
| 627 | 661 | The opt object should be the normalized AJAX options used |
| 628 | 662 | for the connection. By convention, the caller of this |
| 629 | 663 | function "should" set opt.errorMessage to contain a |
| 630 | 664 | human-readable description of the error. |
| 631 | 665 |
| --- ajax/js/whajaj.js | |
| +++ ajax/js/whajaj.js | |
| @@ -207,12 +207,10 @@ | |
| 207 | WhAjaj.Connector = function(opt) |
| 208 | { |
| 209 | if(WhAjaj.isObject(opt)) this.options = opt; |
| 210 | //TODO?: this.$cache = {}; |
| 211 | }; |
| 212 | WhAjaj.Connector.prototype.callbacks = {}; |
| 213 | WhAjaj.Connector.prototype.options = {}; |
| 214 | |
| 215 | /** |
| 216 | The core options used by WhAjaj.Connector instances for performing |
| 217 | network operations. These options can (and some _should_) |
| 218 | be changed by a client application. They can also be changed |
| @@ -262,11 +260,11 @@ | |
| 262 | pretty prevelant in the source tree, so i can't globally |
| 263 | swap it out. |
| 264 | */ |
| 265 | ajax: { |
| 266 | /** |
| 267 | URL of the whiki back-end CGI binary. |
| 268 | */ |
| 269 | url: '/some/path', |
| 270 | |
| 271 | /** |
| 272 | Connection method. Some connection-related functions might |
| @@ -406,10 +404,39 @@ | |
| 406 | instead of a response object parsed from JSON. |
| 407 | */ |
| 408 | jsonp:undefined |
| 409 | } |
| 410 | }; |
| 411 | |
| 412 | /** |
| 413 | Tries to find the given key in any of the following, returning |
| 414 | the first match found: opt, this.options, WhAjaj.Connector.options.ajax. |
| 415 | |
| @@ -421,10 +448,11 @@ | |
| 421 | else v = this.options[key]; |
| 422 | if( undefined !== v ) return v; |
| 423 | else v = WhAjaj.Connector.options.ajax[key]; |
| 424 | return v; |
| 425 | }; |
| 426 | /** |
| 427 | Returns a unique string on each call containing a generic |
| 428 | reandom request identifier string. This is not used by the core |
| 429 | API but can be used by client code to generate unique IDs for |
| 430 | each request (if needed). |
| @@ -532,10 +560,13 @@ | |
| 532 | The opt object should be the normalized AJAX options used |
| 533 | for the connection. |
| 534 | |
| 535 | The resp argument may be either a plain Object or a string |
| 536 | (in which case it is assumed to be JSON). |
| 537 | |
| 538 | This function takes care of the following: |
| 539 | |
| 540 | - Calling opt.afterSend() |
| 541 | |
| @@ -621,10 +652,13 @@ | |
| 621 | properties are followed. |
| 622 | |
| 623 | The request argument must be the original request passed to |
| 624 | the sendImpl() function. It may legally be null for GET |
| 625 | requests. |
| 626 | |
| 627 | The opt object should be the normalized AJAX options used |
| 628 | for the connection. By convention, the caller of this |
| 629 | function "should" set opt.errorMessage to contain a |
| 630 | human-readable description of the error. |
| 631 |
| --- ajax/js/whajaj.js | |
| +++ ajax/js/whajaj.js | |
| @@ -207,12 +207,10 @@ | |
| 207 | WhAjaj.Connector = function(opt) |
| 208 | { |
| 209 | if(WhAjaj.isObject(opt)) this.options = opt; |
| 210 | //TODO?: this.$cache = {}; |
| 211 | }; |
| 212 | |
| 213 | /** |
| 214 | The core options used by WhAjaj.Connector instances for performing |
| 215 | network operations. These options can (and some _should_) |
| 216 | be changed by a client application. They can also be changed |
| @@ -262,11 +260,11 @@ | |
| 260 | pretty prevelant in the source tree, so i can't globally |
| 261 | swap it out. |
| 262 | */ |
| 263 | ajax: { |
| 264 | /** |
| 265 | URL of the back-end server/CGI. |
| 266 | */ |
| 267 | url: '/some/path', |
| 268 | |
| 269 | /** |
| 270 | Connection method. Some connection-related functions might |
| @@ -406,10 +404,39 @@ | |
| 404 | instead of a response object parsed from JSON. |
| 405 | */ |
| 406 | jsonp:undefined |
| 407 | } |
| 408 | }; |
| 409 | |
| 410 | |
| 411 | /** |
| 412 | WhAjaj.Connector.prototype.callbacks defines callbacks analog |
| 413 | to the onXXX callbacks defined in WhAjaj.Connector.options.ajax, |
| 414 | with two notable differences: |
| 415 | |
| 416 | 1) these callbacks, if set, are called in addition to any |
| 417 | request-specific callback. The intention is to allow a framework to set |
| 418 | "framework-level" callbacks which should be called independently of the |
| 419 | request-specific callbacks (without interfering with them, e.g. |
| 420 | requiring special re-forwarding features). |
| 421 | |
| 422 | 2) The 'this' object in these callbacks is the Connector instance |
| 423 | associated with the callback, whereas the "other" onXXX form has its |
| 424 | "ajax options" object as its this. |
| 425 | |
| 426 | When this API says that an onXXX callback will be called for a request, |
| 427 | both the request's onXXX (if set) and this one (if set) will be called. |
| 428 | */ |
| 429 | WhAjaj.Connector.prototype.callbacks = {}; |
| 430 | /** |
| 431 | Instance-specific values for AJAJ-level properties (as opposed to |
| 432 | application-level request properties). Options set here "override" those |
| 433 | specified in WhAjaj.Connector.options.ajax and are "overridden" by |
| 434 | options passed to sendRequest(). |
| 435 | */ |
| 436 | WhAjaj.Connector.prototype.options = {}; |
| 437 | |
| 438 | |
| 439 | /** |
| 440 | Tries to find the given key in any of the following, returning |
| 441 | the first match found: opt, this.options, WhAjaj.Connector.options.ajax. |
| 442 | |
| @@ -421,10 +448,11 @@ | |
| 448 | else v = this.options[key]; |
| 449 | if( undefined !== v ) return v; |
| 450 | else v = WhAjaj.Connector.options.ajax[key]; |
| 451 | return v; |
| 452 | }; |
| 453 | |
| 454 | /** |
| 455 | Returns a unique string on each call containing a generic |
| 456 | reandom request identifier string. This is not used by the core |
| 457 | API but can be used by client code to generate unique IDs for |
| 458 | each request (if needed). |
| @@ -532,10 +560,13 @@ | |
| 560 | The opt object should be the normalized AJAX options used |
| 561 | for the connection. |
| 562 | |
| 563 | The resp argument may be either a plain Object or a string |
| 564 | (in which case it is assumed to be JSON). |
| 565 | |
| 566 | The 'this' object for this call MUST be a WhAjaj.Connector |
| 567 | instance in order for callback processing to work properly. |
| 568 | |
| 569 | This function takes care of the following: |
| 570 | |
| 571 | - Calling opt.afterSend() |
| 572 | |
| @@ -621,10 +652,13 @@ | |
| 652 | properties are followed. |
| 653 | |
| 654 | The request argument must be the original request passed to |
| 655 | the sendImpl() function. It may legally be null for GET |
| 656 | requests. |
| 657 | |
| 658 | The 'this' object for this call MUST be a WhAjaj.Connector |
| 659 | instance in order for callback processing to work properly. |
| 660 | |
| 661 | The opt object should be the normalized AJAX options used |
| 662 | for the connection. By convention, the caller of this |
| 663 | function "should" set opt.errorMessage to contain a |
| 664 | human-readable description of the error. |
| 665 |
+9
-13
| --- ajax/wiki-editor.html | ||
| +++ ajax/wiki-editor.html | ||
| @@ -139,26 +139,26 @@ | ||
| 139 | 139 | end:function(){ |
| 140 | 140 | this._tend = (new Date()).getTime(); |
| 141 | 141 | return this.duration = this._tend - this._tstart; |
| 142 | 142 | } |
| 143 | 143 | }; |
| 144 | - var opt = TheApp.cgi.ajaj.options; | |
| 145 | - opt.beforeSend = TheApp.beforeSend = function(req,opt) { | |
| 144 | + var ajcb = TheApp.cgi.ajaj.callbacks; | |
| 145 | + ajcb.beforeSend = TheApp.beforeSend = function(req,opt) { | |
| 146 | 146 | TheApp.timer.start(); |
| 147 | 147 | var val = |
| 148 | 148 | req ? |
| 149 | 149 | (('string'===typeof req) ? req : WhAjaj.stringify(req)) |
| 150 | 150 | : ''; |
| 151 | 151 | TheApp.jqe.taResponse.val(''); |
| 152 | 152 | TheApp.startAjaxNotif(); |
| 153 | 153 | }; |
| 154 | - opt.afterSend = TheApp.afterSend = function(req,opt) { | |
| 154 | + ajcb.afterSend = TheApp.afterSend = function(req,opt) { | |
| 155 | 155 | TheApp.timer.end(); |
| 156 | 156 | TheApp.endAjaxNotif(); |
| 157 | 157 | TheApp.jqe.timer.text( "(Round-trip time: "+TheApp.timer.duration+'ms)' ); |
| 158 | 158 | }; |
| 159 | - opt.onResponse = TheApp.onResponse = function(resp,req) { | |
| 159 | + ajcb.onResponse = TheApp.onResponse = function(resp,req) { | |
| 160 | 160 | var val; |
| 161 | 161 | try { |
| 162 | 162 | val = WhAjaj.stringify(resp); |
| 163 | 163 | } |
| 164 | 164 | catch(e) { |
| @@ -165,17 +165,13 @@ | ||
| 165 | 165 | val = WhAjaj.stringify(e) |
| 166 | 166 | } |
| 167 | 167 | if(resp.resultCode){ |
| 168 | 168 | alert("Response contains error info:\n"+val); |
| 169 | 169 | } |
| 170 | - //alert("onResponse this:"+WhAjaj.stringify(this)); | |
| 171 | - //alert("val="+val); | |
| 172 | - // FIXME: this.url is hosed for login because of how i overload onResponse() | |
| 173 | - if( this.url ) TheApp.jqe.textPath.val(this.url.replace(WhAjaj.Connector.options.ajax.url,'')); | |
| 174 | 170 | TheApp.jqe.taResponse.val( val ); |
| 175 | 171 | }; |
| 176 | - opt.onError = function(req,opt) { | |
| 172 | + ajcb.onError = function(req,opt) { | |
| 177 | 173 | TheApp.jqe.taResponse.val( "ERROR SENDING REQUEST:\n"+WhAjaj.stringify(opt) ); |
| 178 | 174 | }; |
| 179 | 175 | |
| 180 | 176 | TheApp.jqe.taPageContent.blur(function(){ |
| 181 | 177 | var p = TheApp.currentPage; |
| @@ -182,12 +178,12 @@ | ||
| 182 | 178 | if(! p ) return; |
| 183 | 179 | p.content = TheApp.jqe.taPageContent.val(); |
| 184 | 180 | }); |
| 185 | 181 | |
| 186 | 182 | TheApp.cgi.onLogin = function(){ |
| 187 | - TheApp.jqe.taResponse.val( "Logged in. Auth token =\n"+this.authToken ); | |
| 188 | - TheApp.jqe.currentAuthToken.text("Auth token: "+(this.authToken || "not logged in")); | |
| 183 | + TheApp.jqe.taResponse.val( "Logged in: "+WhAjaj.stringify(this.auth)); | |
| 184 | + TheApp.jqe.currentAuthToken.text("Logged in: "+WhAjaj.stringify(this.auth)); | |
| 189 | 185 | }; |
| 190 | 186 | TheApp.cgi.onLogout = function(){ |
| 191 | 187 | TheApp.jqe.taResponse.val( "Logged out!" ); |
| 192 | 188 | TheApp.jqe.currentAuthToken.text(""); |
| 193 | 189 | }; |
| @@ -308,10 +304,12 @@ | ||
| 308 | 304 | } |
| 309 | 305 | }); |
| 310 | 306 | */ |
| 311 | 307 | }; |
| 312 | 308 | |
| 309 | + TheApp.cgi.whoami(); | |
| 310 | + | |
| 313 | 311 | }); |
| 314 | 312 | |
| 315 | 313 | </script> |
| 316 | 314 | |
| 317 | 315 | </head> |
| @@ -336,14 +334,12 @@ | ||
| 336 | 334 | <span id='currentAuthToken' style='font-family:monospaced'></span> |
| 337 | 335 | |
| 338 | 336 | <hr/> |
| 339 | 337 | <strong>Quick-posts:</strong><br/> |
| 340 | 338 | <input type='button' value='HAI' onclick='TheApp.cgi.HAI()' /> |
| 341 | -<input type='button' value='version' onclick='TheApp.cgi.sendCommand("/json/version")' /> | |
| 342 | 339 | <input type='button' value='stat' onclick='TheApp.cgi.sendCommand("/json/stat")' /> |
| 343 | 340 | <input type='button' value='whoami' onclick='TheApp.cgi.sendCommand("/json/whoami")' /> |
| 344 | -<input type='button' value='cap' onclick='TheApp.cgi.sendCommand("/json/cap")' /> | |
| 345 | 341 | <input type='button' value='wiki/list' onclick='TheApp.loadPageList()' /> |
| 346 | 342 | <!-- |
| 347 | 343 | <input type='button' value='timeline/ci' onclick='TheApp.cgi.sendCommand("/json/timeline/ci")' /> |
| 348 | 344 | --> |
| 349 | 345 | |
| 350 | 346 |
| --- ajax/wiki-editor.html | |
| +++ ajax/wiki-editor.html | |
| @@ -139,26 +139,26 @@ | |
| 139 | end:function(){ |
| 140 | this._tend = (new Date()).getTime(); |
| 141 | return this.duration = this._tend - this._tstart; |
| 142 | } |
| 143 | }; |
| 144 | var opt = TheApp.cgi.ajaj.options; |
| 145 | opt.beforeSend = TheApp.beforeSend = function(req,opt) { |
| 146 | TheApp.timer.start(); |
| 147 | var val = |
| 148 | req ? |
| 149 | (('string'===typeof req) ? req : WhAjaj.stringify(req)) |
| 150 | : ''; |
| 151 | TheApp.jqe.taResponse.val(''); |
| 152 | TheApp.startAjaxNotif(); |
| 153 | }; |
| 154 | opt.afterSend = TheApp.afterSend = function(req,opt) { |
| 155 | TheApp.timer.end(); |
| 156 | TheApp.endAjaxNotif(); |
| 157 | TheApp.jqe.timer.text( "(Round-trip time: "+TheApp.timer.duration+'ms)' ); |
| 158 | }; |
| 159 | opt.onResponse = TheApp.onResponse = function(resp,req) { |
| 160 | var val; |
| 161 | try { |
| 162 | val = WhAjaj.stringify(resp); |
| 163 | } |
| 164 | catch(e) { |
| @@ -165,17 +165,13 @@ | |
| 165 | val = WhAjaj.stringify(e) |
| 166 | } |
| 167 | if(resp.resultCode){ |
| 168 | alert("Response contains error info:\n"+val); |
| 169 | } |
| 170 | //alert("onResponse this:"+WhAjaj.stringify(this)); |
| 171 | //alert("val="+val); |
| 172 | // FIXME: this.url is hosed for login because of how i overload onResponse() |
| 173 | if( this.url ) TheApp.jqe.textPath.val(this.url.replace(WhAjaj.Connector.options.ajax.url,'')); |
| 174 | TheApp.jqe.taResponse.val( val ); |
| 175 | }; |
| 176 | opt.onError = function(req,opt) { |
| 177 | TheApp.jqe.taResponse.val( "ERROR SENDING REQUEST:\n"+WhAjaj.stringify(opt) ); |
| 178 | }; |
| 179 | |
| 180 | TheApp.jqe.taPageContent.blur(function(){ |
| 181 | var p = TheApp.currentPage; |
| @@ -182,12 +178,12 @@ | |
| 182 | if(! p ) return; |
| 183 | p.content = TheApp.jqe.taPageContent.val(); |
| 184 | }); |
| 185 | |
| 186 | TheApp.cgi.onLogin = function(){ |
| 187 | TheApp.jqe.taResponse.val( "Logged in. Auth token =\n"+this.authToken ); |
| 188 | TheApp.jqe.currentAuthToken.text("Auth token: "+(this.authToken || "not logged in")); |
| 189 | }; |
| 190 | TheApp.cgi.onLogout = function(){ |
| 191 | TheApp.jqe.taResponse.val( "Logged out!" ); |
| 192 | TheApp.jqe.currentAuthToken.text(""); |
| 193 | }; |
| @@ -308,10 +304,12 @@ | |
| 308 | } |
| 309 | }); |
| 310 | */ |
| 311 | }; |
| 312 | |
| 313 | }); |
| 314 | |
| 315 | </script> |
| 316 | |
| 317 | </head> |
| @@ -336,14 +334,12 @@ | |
| 336 | <span id='currentAuthToken' style='font-family:monospaced'></span> |
| 337 | |
| 338 | <hr/> |
| 339 | <strong>Quick-posts:</strong><br/> |
| 340 | <input type='button' value='HAI' onclick='TheApp.cgi.HAI()' /> |
| 341 | <input type='button' value='version' onclick='TheApp.cgi.sendCommand("/json/version")' /> |
| 342 | <input type='button' value='stat' onclick='TheApp.cgi.sendCommand("/json/stat")' /> |
| 343 | <input type='button' value='whoami' onclick='TheApp.cgi.sendCommand("/json/whoami")' /> |
| 344 | <input type='button' value='cap' onclick='TheApp.cgi.sendCommand("/json/cap")' /> |
| 345 | <input type='button' value='wiki/list' onclick='TheApp.loadPageList()' /> |
| 346 | <!-- |
| 347 | <input type='button' value='timeline/ci' onclick='TheApp.cgi.sendCommand("/json/timeline/ci")' /> |
| 348 | --> |
| 349 | |
| 350 |
| --- ajax/wiki-editor.html | |
| +++ ajax/wiki-editor.html | |
| @@ -139,26 +139,26 @@ | |
| 139 | end:function(){ |
| 140 | this._tend = (new Date()).getTime(); |
| 141 | return this.duration = this._tend - this._tstart; |
| 142 | } |
| 143 | }; |
| 144 | var ajcb = TheApp.cgi.ajaj.callbacks; |
| 145 | ajcb.beforeSend = TheApp.beforeSend = function(req,opt) { |
| 146 | TheApp.timer.start(); |
| 147 | var val = |
| 148 | req ? |
| 149 | (('string'===typeof req) ? req : WhAjaj.stringify(req)) |
| 150 | : ''; |
| 151 | TheApp.jqe.taResponse.val(''); |
| 152 | TheApp.startAjaxNotif(); |
| 153 | }; |
| 154 | ajcb.afterSend = TheApp.afterSend = function(req,opt) { |
| 155 | TheApp.timer.end(); |
| 156 | TheApp.endAjaxNotif(); |
| 157 | TheApp.jqe.timer.text( "(Round-trip time: "+TheApp.timer.duration+'ms)' ); |
| 158 | }; |
| 159 | ajcb.onResponse = TheApp.onResponse = function(resp,req) { |
| 160 | var val; |
| 161 | try { |
| 162 | val = WhAjaj.stringify(resp); |
| 163 | } |
| 164 | catch(e) { |
| @@ -165,17 +165,13 @@ | |
| 165 | val = WhAjaj.stringify(e) |
| 166 | } |
| 167 | if(resp.resultCode){ |
| 168 | alert("Response contains error info:\n"+val); |
| 169 | } |
| 170 | TheApp.jqe.taResponse.val( val ); |
| 171 | }; |
| 172 | ajcb.onError = function(req,opt) { |
| 173 | TheApp.jqe.taResponse.val( "ERROR SENDING REQUEST:\n"+WhAjaj.stringify(opt) ); |
| 174 | }; |
| 175 | |
| 176 | TheApp.jqe.taPageContent.blur(function(){ |
| 177 | var p = TheApp.currentPage; |
| @@ -182,12 +178,12 @@ | |
| 178 | if(! p ) return; |
| 179 | p.content = TheApp.jqe.taPageContent.val(); |
| 180 | }); |
| 181 | |
| 182 | TheApp.cgi.onLogin = function(){ |
| 183 | TheApp.jqe.taResponse.val( "Logged in: "+WhAjaj.stringify(this.auth)); |
| 184 | TheApp.jqe.currentAuthToken.text("Logged in: "+WhAjaj.stringify(this.auth)); |
| 185 | }; |
| 186 | TheApp.cgi.onLogout = function(){ |
| 187 | TheApp.jqe.taResponse.val( "Logged out!" ); |
| 188 | TheApp.jqe.currentAuthToken.text(""); |
| 189 | }; |
| @@ -308,10 +304,12 @@ | |
| 304 | } |
| 305 | }); |
| 306 | */ |
| 307 | }; |
| 308 | |
| 309 | TheApp.cgi.whoami(); |
| 310 | |
| 311 | }); |
| 312 | |
| 313 | </script> |
| 314 | |
| 315 | </head> |
| @@ -336,14 +334,12 @@ | |
| 334 | <span id='currentAuthToken' style='font-family:monospaced'></span> |
| 335 | |
| 336 | <hr/> |
| 337 | <strong>Quick-posts:</strong><br/> |
| 338 | <input type='button' value='HAI' onclick='TheApp.cgi.HAI()' /> |
| 339 | <input type='button' value='stat' onclick='TheApp.cgi.sendCommand("/json/stat")' /> |
| 340 | <input type='button' value='whoami' onclick='TheApp.cgi.sendCommand("/json/whoami")' /> |
| 341 | <input type='button' value='wiki/list' onclick='TheApp.loadPageList()' /> |
| 342 | <!-- |
| 343 | <input type='button' value='timeline/ci' onclick='TheApp.cgi.sendCommand("/json/timeline/ci")' /> |
| 344 | --> |
| 345 | |
| 346 |
+1
-1
| --- src/json.c | ||
| +++ src/json.c | ||
| @@ -1337,11 +1337,11 @@ | ||
| 1337 | 1337 | tmp = json_new_string(json_rc_cstr(resultCode)); |
| 1338 | 1338 | SET(FossilJsonKeys.resultCode); |
| 1339 | 1339 | } |
| 1340 | 1340 | |
| 1341 | 1341 | if( pMsg && *pMsg ){ |
| 1342 | - tmp = cson_value_new_string(pMsg, strlen(pMsg)); | |
| 1342 | + tmp = json_new_string(pMsg); | |
| 1343 | 1343 | SET(FossilJsonKeys.resultText); |
| 1344 | 1344 | } |
| 1345 | 1345 | |
| 1346 | 1346 | if(g.json.cmd.commandStr){ |
| 1347 | 1347 | tmp = json_new_string(g.json.cmd.commandStr); |
| 1348 | 1348 |
| --- src/json.c | |
| +++ src/json.c | |
| @@ -1337,11 +1337,11 @@ | |
| 1337 | tmp = json_new_string(json_rc_cstr(resultCode)); |
| 1338 | SET(FossilJsonKeys.resultCode); |
| 1339 | } |
| 1340 | |
| 1341 | if( pMsg && *pMsg ){ |
| 1342 | tmp = cson_value_new_string(pMsg, strlen(pMsg)); |
| 1343 | SET(FossilJsonKeys.resultText); |
| 1344 | } |
| 1345 | |
| 1346 | if(g.json.cmd.commandStr){ |
| 1347 | tmp = json_new_string(g.json.cmd.commandStr); |
| 1348 |
| --- src/json.c | |
| +++ src/json.c | |
| @@ -1337,11 +1337,11 @@ | |
| 1337 | tmp = json_new_string(json_rc_cstr(resultCode)); |
| 1338 | SET(FossilJsonKeys.resultCode); |
| 1339 | } |
| 1340 | |
| 1341 | if( pMsg && *pMsg ){ |
| 1342 | tmp = json_new_string(pMsg); |
| 1343 | SET(FossilJsonKeys.resultText); |
| 1344 | } |
| 1345 | |
| 1346 | if(g.json.cmd.commandStr){ |
| 1347 | tmp = json_new_string(g.json.cmd.commandStr); |
| 1348 |
+4
-5
| --- src/json_artifact.c | ||
| +++ src/json_artifact.c | ||
| @@ -153,10 +153,13 @@ | ||
| 153 | 153 | } |
| 154 | 154 | db_finalize(&q); |
| 155 | 155 | return v; |
| 156 | 156 | } |
| 157 | 157 | |
| 158 | +/* | |
| 159 | +** Very incomplete/incorrect impl of /json/artifact/TICKET_ID. | |
| 160 | +*/ | |
| 158 | 161 | cson_value * json_artifact_ticket( int rid ){ |
| 159 | 162 | cson_value * payV = NULL; |
| 160 | 163 | cson_object * pay = NULL; |
| 161 | 164 | Manifest *pTktChng = NULL; |
| 162 | 165 | static cson_value * eventTypeLabel = NULL; |
| @@ -195,16 +198,12 @@ | ||
| 195 | 198 | return json_artifact_for_ci(rid, 1); |
| 196 | 199 | } |
| 197 | 200 | } |
| 198 | 201 | |
| 199 | 202 | /* |
| 200 | -** Permissions callback func for ArtifactDispatchEntry. | |
| 203 | +** Internal mapping of /json/artifact/FOO commands/callbacks. | |
| 201 | 204 | */ |
| 202 | -static char perms_can_read(){ | |
| 203 | - return g.perm.Read ? 1 : 0; | |
| 204 | -} | |
| 205 | - | |
| 206 | 205 | static ArtifactDispatchEntry ArtifactDispatchList[] = { |
| 207 | 206 | {"checkin", json_artifact_ci}, |
| 208 | 207 | {"tag", NULL}, |
| 209 | 208 | {"ticket", json_artifact_ticket}, |
| 210 | 209 | {"wiki", NULL}, |
| 211 | 210 |
| --- src/json_artifact.c | |
| +++ src/json_artifact.c | |
| @@ -153,10 +153,13 @@ | |
| 153 | } |
| 154 | db_finalize(&q); |
| 155 | return v; |
| 156 | } |
| 157 | |
| 158 | cson_value * json_artifact_ticket( int rid ){ |
| 159 | cson_value * payV = NULL; |
| 160 | cson_object * pay = NULL; |
| 161 | Manifest *pTktChng = NULL; |
| 162 | static cson_value * eventTypeLabel = NULL; |
| @@ -195,16 +198,12 @@ | |
| 195 | return json_artifact_for_ci(rid, 1); |
| 196 | } |
| 197 | } |
| 198 | |
| 199 | /* |
| 200 | ** Permissions callback func for ArtifactDispatchEntry. |
| 201 | */ |
| 202 | static char perms_can_read(){ |
| 203 | return g.perm.Read ? 1 : 0; |
| 204 | } |
| 205 | |
| 206 | static ArtifactDispatchEntry ArtifactDispatchList[] = { |
| 207 | {"checkin", json_artifact_ci}, |
| 208 | {"tag", NULL}, |
| 209 | {"ticket", json_artifact_ticket}, |
| 210 | {"wiki", NULL}, |
| 211 |
| --- src/json_artifact.c | |
| +++ src/json_artifact.c | |
| @@ -153,10 +153,13 @@ | |
| 153 | } |
| 154 | db_finalize(&q); |
| 155 | return v; |
| 156 | } |
| 157 | |
| 158 | /* |
| 159 | ** Very incomplete/incorrect impl of /json/artifact/TICKET_ID. |
| 160 | */ |
| 161 | cson_value * json_artifact_ticket( int rid ){ |
| 162 | cson_value * payV = NULL; |
| 163 | cson_object * pay = NULL; |
| 164 | Manifest *pTktChng = NULL; |
| 165 | static cson_value * eventTypeLabel = NULL; |
| @@ -195,16 +198,12 @@ | |
| 198 | return json_artifact_for_ci(rid, 1); |
| 199 | } |
| 200 | } |
| 201 | |
| 202 | /* |
| 203 | ** Internal mapping of /json/artifact/FOO commands/callbacks. |
| 204 | */ |
| 205 | static ArtifactDispatchEntry ArtifactDispatchList[] = { |
| 206 | {"checkin", json_artifact_ci}, |
| 207 | {"tag", NULL}, |
| 208 | {"ticket", json_artifact_ticket}, |
| 209 | {"wiki", NULL}, |
| 210 |
+27
-2
| --- src/json_wiki.c | ||
| +++ src/json_wiki.c | ||
| @@ -57,11 +57,11 @@ | ||
| 57 | 57 | ** conventional wiki format, else it is not parsed. |
| 58 | 58 | ** |
| 59 | 59 | ** The returned value, if not NULL, is-a JSON Object owned by the |
| 60 | 60 | ** caller. |
| 61 | 61 | */ |
| 62 | -cson_value * json_get_wiki_page(char const * zPageName, char doParse){ | |
| 62 | +cson_value * json_get_wiki_page_by_name(char const * zPageName, char doParse){ | |
| 63 | 63 | int rid; |
| 64 | 64 | Manifest *pWiki = 0; |
| 65 | 65 | char const * zBody = NULL; |
| 66 | 66 | char const * zFormat = NULL; |
| 67 | 67 | char * zUuid = NULL; |
| @@ -117,10 +117,35 @@ | ||
| 117 | 117 | manifest_destroy(pWiki); |
| 118 | 118 | return payV; |
| 119 | 119 | } |
| 120 | 120 | } |
| 121 | 121 | |
| 122 | + | |
| 123 | +/* | |
| 124 | +** UNTESTED! | |
| 125 | +** | |
| 126 | +** Searches for a wiki page with the given rid. If found it behaves | |
| 127 | +** like json_get_wiki_page_by_name(pageName, doParse), else it returns | |
| 128 | +** NULL. | |
| 129 | +*/ | |
| 130 | +cson_value * json_get_wiki_page_by_rid(int rid, char doParse){ | |
| 131 | + char * zPageName = NULL; | |
| 132 | + cson_value * rc = NULL; | |
| 133 | + zPageName = db_text(NULL, | |
| 134 | + "SELECT substr(t.tagname,6) AS name " | |
| 135 | + " FROM tag t, tagxref x, blob b " | |
| 136 | + " WHERE b.rid=%d " | |
| 137 | + " AND t.tagname GLOB 'wiki-*'" | |
| 138 | + " AND x.tagid=t.tagid AND b.rid=x.rid ", | |
| 139 | + rid); | |
| 140 | + if( zPageName ){ | |
| 141 | + rc = json_get_wiki_page_by_name(zPageName, doParse); | |
| 142 | + free(zPageName); | |
| 143 | + } | |
| 144 | + return rc; | |
| 145 | +} | |
| 146 | + | |
| 122 | 147 | /* |
| 123 | 148 | ** Implementation of /json/wiki/get. |
| 124 | 149 | ** |
| 125 | 150 | */ |
| 126 | 151 | static cson_value * json_wiki_get(){ |
| @@ -157,11 +182,11 @@ | ||
| 157 | 182 | zFormat = "raw"; |
| 158 | 183 | } |
| 159 | 184 | if( 'r' != *zFormat ){ |
| 160 | 185 | zFormat = "html"; |
| 161 | 186 | } |
| 162 | - return json_get_wiki_page(zPageName, 'h'==*zFormat); | |
| 187 | + return json_get_wiki_page_by_name(zPageName, 'h'==*zFormat); | |
| 163 | 188 | } |
| 164 | 189 | |
| 165 | 190 | /* |
| 166 | 191 | ** Internal impl of /wiki/save and /wiki/create. If createMode is 0 |
| 167 | 192 | ** and the page already exists then a |
| 168 | 193 |
| --- src/json_wiki.c | |
| +++ src/json_wiki.c | |
| @@ -57,11 +57,11 @@ | |
| 57 | ** conventional wiki format, else it is not parsed. |
| 58 | ** |
| 59 | ** The returned value, if not NULL, is-a JSON Object owned by the |
| 60 | ** caller. |
| 61 | */ |
| 62 | cson_value * json_get_wiki_page(char const * zPageName, char doParse){ |
| 63 | int rid; |
| 64 | Manifest *pWiki = 0; |
| 65 | char const * zBody = NULL; |
| 66 | char const * zFormat = NULL; |
| 67 | char * zUuid = NULL; |
| @@ -117,10 +117,35 @@ | |
| 117 | manifest_destroy(pWiki); |
| 118 | return payV; |
| 119 | } |
| 120 | } |
| 121 | |
| 122 | /* |
| 123 | ** Implementation of /json/wiki/get. |
| 124 | ** |
| 125 | */ |
| 126 | static cson_value * json_wiki_get(){ |
| @@ -157,11 +182,11 @@ | |
| 157 | zFormat = "raw"; |
| 158 | } |
| 159 | if( 'r' != *zFormat ){ |
| 160 | zFormat = "html"; |
| 161 | } |
| 162 | return json_get_wiki_page(zPageName, 'h'==*zFormat); |
| 163 | } |
| 164 | |
| 165 | /* |
| 166 | ** Internal impl of /wiki/save and /wiki/create. If createMode is 0 |
| 167 | ** and the page already exists then a |
| 168 |
| --- src/json_wiki.c | |
| +++ src/json_wiki.c | |
| @@ -57,11 +57,11 @@ | |
| 57 | ** conventional wiki format, else it is not parsed. |
| 58 | ** |
| 59 | ** The returned value, if not NULL, is-a JSON Object owned by the |
| 60 | ** caller. |
| 61 | */ |
| 62 | cson_value * json_get_wiki_page_by_name(char const * zPageName, char doParse){ |
| 63 | int rid; |
| 64 | Manifest *pWiki = 0; |
| 65 | char const * zBody = NULL; |
| 66 | char const * zFormat = NULL; |
| 67 | char * zUuid = NULL; |
| @@ -117,10 +117,35 @@ | |
| 117 | manifest_destroy(pWiki); |
| 118 | return payV; |
| 119 | } |
| 120 | } |
| 121 | |
| 122 | |
| 123 | /* |
| 124 | ** UNTESTED! |
| 125 | ** |
| 126 | ** Searches for a wiki page with the given rid. If found it behaves |
| 127 | ** like json_get_wiki_page_by_name(pageName, doParse), else it returns |
| 128 | ** NULL. |
| 129 | */ |
| 130 | cson_value * json_get_wiki_page_by_rid(int rid, char doParse){ |
| 131 | char * zPageName = NULL; |
| 132 | cson_value * rc = NULL; |
| 133 | zPageName = db_text(NULL, |
| 134 | "SELECT substr(t.tagname,6) AS name " |
| 135 | " FROM tag t, tagxref x, blob b " |
| 136 | " WHERE b.rid=%d " |
| 137 | " AND t.tagname GLOB 'wiki-*'" |
| 138 | " AND x.tagid=t.tagid AND b.rid=x.rid ", |
| 139 | rid); |
| 140 | if( zPageName ){ |
| 141 | rc = json_get_wiki_page_by_name(zPageName, doParse); |
| 142 | free(zPageName); |
| 143 | } |
| 144 | return rc; |
| 145 | } |
| 146 | |
| 147 | /* |
| 148 | ** Implementation of /json/wiki/get. |
| 149 | ** |
| 150 | */ |
| 151 | static cson_value * json_wiki_get(){ |
| @@ -157,11 +182,11 @@ | |
| 182 | zFormat = "raw"; |
| 183 | } |
| 184 | if( 'r' != *zFormat ){ |
| 185 | zFormat = "html"; |
| 186 | } |
| 187 | return json_get_wiki_page_by_name(zPageName, 'h'==*zFormat); |
| 188 | } |
| 189 | |
| 190 | /* |
| 191 | ** Internal impl of /wiki/save and /wiki/create. If createMode is 0 |
| 192 | ** and the page already exists then a |
| 193 |