self is available for autocompletion
This commit is contained in:
parent
8c3dc92c2a
commit
06f9007369
3 changed files with 16 additions and 6 deletions
|
@ -50,9 +50,8 @@ Walter Higgins
|
||||||
* [Examples](#examples)
|
* [Examples](#examples)
|
||||||
* [Fireworks Module](#fireworks-module)
|
* [Fireworks Module](#fireworks-module)
|
||||||
* [Examples](#examples)
|
* [Examples](#examples)
|
||||||
|
* [Http Module](#http-module)
|
||||||
* [http.request() function](#httprequest-function)
|
* [http.request() function](#httprequest-function)
|
||||||
* [Parameters](#parameters)
|
|
||||||
* [Example](#example)
|
|
||||||
* [Signs Module](#signs-module)
|
* [Signs Module](#signs-module)
|
||||||
* [signs.menu() function](#signsmenu-function)
|
* [signs.menu() function](#signsmenu-function)
|
||||||
* [signs.getTargetedBy() function](#signsgettargetedby-function)
|
* [signs.getTargetedBy() function](#signsgettargetedby-function)
|
||||||
|
@ -784,7 +783,12 @@ location. For example...
|
||||||
|
|
||||||
![firework example](img/firework.png)
|
![firework example](img/firework.png)
|
||||||
|
|
||||||
## http.request() function
|
## Http Module
|
||||||
|
|
||||||
|
For handling http requests. Not to be confused with the more robust
|
||||||
|
and functional 'http' module bundled with Node.js.
|
||||||
|
|
||||||
|
### http.request() function
|
||||||
|
|
||||||
The http.request() function will fetch a web address asynchronously (on a
|
The http.request() function will fetch a web address asynchronously (on a
|
||||||
separate thread)and pass the URL's response to a callback function
|
separate thread)and pass the URL's response to a callback function
|
||||||
|
@ -792,7 +796,7 @@ which will be executed synchronously (on the main thread). In this
|
||||||
way, http.request() can be used to fetch web content without blocking the
|
way, http.request() can be used to fetch web content without blocking the
|
||||||
main thread of execution.
|
main thread of execution.
|
||||||
|
|
||||||
### Parameters
|
#### Parameters
|
||||||
|
|
||||||
* request: The request details either a plain URL e.g. "http://scriptcraft.js/sample.json" or an object with the following properties...
|
* request: The request details either a plain URL e.g. "http://scriptcraft.js/sample.json" or an object with the following properties...
|
||||||
|
|
||||||
|
@ -804,7 +808,7 @@ main thread of execution.
|
||||||
- responseCode: The numeric response code from the server. If the server did not respond with 200 OK then the response parameter will be undefined.
|
- responseCode: The numeric response code from the server. If the server did not respond with 200 OK then the response parameter will be undefined.
|
||||||
- response: A string (if the response is of type text) or object containing the HTTP response body.
|
- response: A string (if the response is of type text) or object containing the HTTP response body.
|
||||||
|
|
||||||
### Example
|
#### Example
|
||||||
|
|
||||||
The following example illustrates how to use http.request to make a request to a JSON web service and evaluate its response...
|
The following example illustrates how to use http.request to make a request to a JSON web service and evaluate its response...
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,8 @@ Bug Fix: On Mac OS, alias plugin caused Exceptions due to missing
|
||||||
Changed target for compilation to 1.6 so that ScriptCraft will work
|
Changed target for compilation to 1.6 so that ScriptCraft will work
|
||||||
with both java 1.6 and 1.7.
|
with both java 1.6 and 1.7.
|
||||||
|
|
||||||
|
Added documentation for the Signs module.
|
||||||
|
|
||||||
# 2014 01 02
|
# 2014 01 02
|
||||||
|
|
||||||
Added a warning in console at start-up if legacy directories are detected.
|
Added a warning in console at start-up if legacy directories are detected.
|
||||||
|
|
|
@ -78,6 +78,8 @@ var onTabCompleteJS = function( __onTC_result, __onTC_sender, __onTC_cmd, __onTC
|
||||||
if (__onTC_cmd.name == 'jsp')
|
if (__onTC_cmd.name == 'jsp')
|
||||||
return tabCompleteJSP( __onTC_result, __onTC_sender, __onTC_cmd, __onTC_alias, __onTC_args );
|
return tabCompleteJSP( __onTC_result, __onTC_sender, __onTC_cmd, __onTC_alias, __onTC_args );
|
||||||
|
|
||||||
|
global.self = __onTC_sender; // bring in self just for autocomplete
|
||||||
|
|
||||||
var _globalSymbols = _getProperties(global)
|
var _globalSymbols = _getProperties(global)
|
||||||
var result = __onTC_result;
|
var result = __onTC_result;
|
||||||
var args = __onTC_args;
|
var args = __onTC_args;
|
||||||
|
@ -169,5 +171,7 @@ var onTabCompleteJS = function( __onTC_result, __onTC_sender, __onTC_cmd, __onTC
|
||||||
}
|
}
|
||||||
for (var i = 0;i < propsOfLastArg.length; i++)
|
for (var i = 0;i < propsOfLastArg.length; i++)
|
||||||
result.add(propsOfLastArg[i]);
|
result.add(propsOfLastArg[i]);
|
||||||
|
|
||||||
|
delete global.self; // delete self when no longer needed for autocomplete
|
||||||
};
|
};
|
||||||
module.exports = onTabCompleteJS;
|
module.exports = onTabCompleteJS;
|
||||||
|
|
Reference in a new issue