Actions
Table of Contents |
---|
maxLevel | 5 |
---|
style | circle |
---|
minLevel | 2 |
---|
|
Requirements
The examples in this page use the Prototype library, which is included by default inside a portal. However, the same concepts may be applied using other implementations.
Invocation
This command is executed immediately in a synchronous way.
Open a page internally
When a page needs to be opened internally within Studio, use this JavaScript code to dispatch the appropriate action:
Code Block |
---|
|
dispatch($H({
controller : 'portal.browser',
action : "internalOpen",
args : ["http://www.appcelerator.com"].toJSON()
}).toJSON());
|
Open a page externally
When a page needs to be opened externally in the OS default browser, use this JavaScript code to dispatch the appropriate action:
Code Block |
---|
|
dispatch($H({
controller : 'portal.browser',
action : "externalOpen",
args : ["http://www.appcelerator.com"].toJSON()
}).toJSON());
|
Open a page in the Studio's default browser
This call will open the URL in the Studio's default browser, as defined in the preferences. Use this JavaScript code to dispatch the appropriate action:
Code Block |
---|
|
dispatch($H({
controller : 'portal.browser',
action : "openURL",
args : ["http://www.appcelerator.com"].toJSON()
}).toJSON());
|
Note: Since Aptana Studio 3.3.0
Example
You may place that dispatch code above inside a link listener, just like that:
Code Block |
---|
|
myLink = $('my-link');
myLink.observe('click', function(e) {
if (typeof(dispatch) !== 'undefined') {
dispatch($H({
controller : 'portal.browser',
action : "externalOpen",
args : ["http://www.appcelerator.com"].toJSON()
}).toJSON());
}
return false;
});
|