| OLD | NEW |
| 1 /** | 1 /** |
| 2 * @fileoverview This file is the controller for generating extension | 2 * @fileoverview This file is the controller for generating extension |
| 3 * doc pages. | 3 * doc pages. |
| 4 * | 4 * |
| 5 * It expects to have available via XHR (relative path): | 5 * It expects to have available via XHR (relative path): |
| 6 * 1) API_TEMPLATE which is the main template for the api pages. | 6 * 1) API_TEMPLATE which is the main template for the api pages. |
| 7 * 2) A file located at SCHEMA which is shared with the extension system and | 7 * 2) A file located at SCHEMA which is shared with the extension system and |
| 8 * defines the methods and events contained in one api. | 8 * defines the methods and events contained in one api. |
| 9 * 3) (Possibly) A static version of the current page url in /static/. I.e. | 9 * 3) (Possibly) A static version of the current page url in /static/. I.e. |
| 10 * if called as ../foo.html, it will look for ../static/foo.html. | 10 * if called as ../foo.html, it will look for ../static/foo.html. |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 else | 112 else |
| 113 console.error("XHR Failed fetching: " + localUrl + "..." + error); | 113 console.error("XHR Failed fetching: " + localUrl + "..." + error); |
| 114 } | 114 } |
| 115 | 115 |
| 116 try { | 116 try { |
| 117 xhr.onreadystatechange = function(){ | 117 xhr.onreadystatechange = function(){ |
| 118 if (xhr.readyState == 4) { | 118 if (xhr.readyState == 4) { |
| 119 if (xhr.responseText) { | 119 if (xhr.responseText) { |
| 120 window.clearTimeout(abortTimerId); | 120 window.clearTimeout(abortTimerId); |
| 121 onSuccess(xhr.responseText); | 121 onSuccess(xhr.responseText); |
| 122 } else { | |
| 123 handleError("responseText empty."); | |
| 124 } | 122 } |
| 125 } | 123 } |
| 126 } | 124 } |
| 127 | 125 |
| 128 xhr.onerror = handleError; | 126 xhr.onerror = handleError; |
| 129 | 127 |
| 130 xhr.open("GET", url, true); | 128 xhr.open("GET", url, true); |
| 131 xhr.send(null); | 129 xhr.send(null); |
| 132 } catch(e) { | 130 } catch(e) { |
| 133 console.log("ex: " + e); | 131 console.log("ex: " + e); |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 319 * whose |parameters| are json schemas. | 317 * whose |parameters| are json schemas. |
| 320 */ | 318 */ |
| 321 function generateSignatureString(parameters) { | 319 function generateSignatureString(parameters) { |
| 322 var retval = []; | 320 var retval = []; |
| 323 parameters.each(function(param, i) { | 321 parameters.each(function(param, i) { |
| 324 retval.push(param.typeName + " " + param.name); | 322 retval.push(param.typeName + " " + param.name); |
| 325 }); | 323 }); |
| 326 | 324 |
| 327 return retval.join(", "); | 325 return retval.join(", "); |
| 328 } | 326 } |
| OLD | NEW |