Adding window.openURL for opening a browser
This commit is contained in:
@@ -235,21 +235,45 @@ class WindowHandler {
|
|||||||
|
|
||||||
//Called when the application wants to go to the background and stop
|
//Called when the application wants to go to the background and stop
|
||||||
public function on_pause() {
|
public function on_pause() {
|
||||||
|
#if lime_native
|
||||||
nme_pause_animation();
|
nme_pause_animation();
|
||||||
|
#end //lime_native
|
||||||
} //on_pause
|
} //on_pause
|
||||||
|
|
||||||
//Called when the application resumes operation from the background
|
//Called when the application resumes operation from the background
|
||||||
public function on_resume() {
|
public function on_resume() {
|
||||||
|
#if lime_native
|
||||||
nme_resume_animation();
|
nme_resume_animation();
|
||||||
|
#end //lime_native
|
||||||
} //on_resume
|
} //on_resume
|
||||||
|
|
||||||
// Terminates the process straight away, bypassing graceful shutdown
|
// Terminates the process straight away, bypassing graceful shutdown
|
||||||
public function on_force_close() {
|
public function on_force_close() {
|
||||||
|
#if lime_native
|
||||||
nme_terminate();
|
nme_terminate();
|
||||||
|
#end //lime_native
|
||||||
} //on_force_close
|
} //on_force_close
|
||||||
|
|
||||||
|
public function openURL( _url:String ) {
|
||||||
|
|
||||||
|
#if lime_native
|
||||||
|
nme_get_url( _url );
|
||||||
|
#end //lime_native
|
||||||
|
|
||||||
|
#if lime_html5
|
||||||
|
|
||||||
|
untyped __js__('
|
||||||
|
var win = window.open( _url, "_blank" );
|
||||||
|
win.focus();
|
||||||
|
');
|
||||||
|
|
||||||
|
#end //lime_html5
|
||||||
|
|
||||||
|
} //openURL
|
||||||
|
|
||||||
|
|
||||||
//nme functions
|
//nme functions
|
||||||
|
#if lime_native
|
||||||
|
|
||||||
private static var nme_stage_get_stage_width = Libs.load("nme","nme_stage_get_stage_width", 1);
|
private static var nme_stage_get_stage_width = Libs.load("nme","nme_stage_get_stage_width", 1);
|
||||||
private static var nme_stage_get_stage_height = Libs.load("nme","nme_stage_get_stage_height", 1);
|
private static var nme_stage_get_stage_height = Libs.load("nme","nme_stage_get_stage_height", 1);
|
||||||
@@ -260,6 +284,7 @@ class WindowHandler {
|
|||||||
private static var nme_resume_animation = Libs.load("nme","nme_resume_animation", 0);
|
private static var nme_resume_animation = Libs.load("nme","nme_resume_animation", 0);
|
||||||
private static var nme_terminate = Libs.load("nme","nme_terminate", 0);
|
private static var nme_terminate = Libs.load("nme","nme_terminate", 0);
|
||||||
private static var nme_close = Libs.load("nme","nme_close", 0);
|
private static var nme_close = Libs.load("nme","nme_close", 0);
|
||||||
|
private static var nme_get_url = Libs.load("nme","nme_get_url", 1);
|
||||||
|
|
||||||
//Cursor control (desktop only obviously)
|
//Cursor control (desktop only obviously)
|
||||||
private static var nme_stage_show_cursor = Libs.load("nme","nme_stage_show_cursor", 2);
|
private static var nme_stage_show_cursor = Libs.load("nme","nme_stage_show_cursor", 2);
|
||||||
@@ -270,4 +295,6 @@ class WindowHandler {
|
|||||||
private static var nme_stage_get_multitouch_supported = Libs.load("nme","nme_stage_get_multitouch_supported", 1);
|
private static var nme_stage_get_multitouch_supported = Libs.load("nme","nme_stage_get_multitouch_supported", 1);
|
||||||
private static var nme_stage_set_multitouch_active = Libs.load("nme","nme_stage_set_multitouch_active", 2);
|
private static var nme_stage_set_multitouch_active = Libs.load("nme","nme_stage_set_multitouch_active", 2);
|
||||||
|
|
||||||
|
#end //lime_native
|
||||||
|
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user