From eef785560395d57117072177ac30583a3c46088a Mon Sep 17 00:00:00 2001 From: George FunBook Date: Tue, 15 Dec 2020 21:39:33 -0600 Subject: [PATCH] add js compile constants for node js --- haxelib.json | 4 ++-- lib/Source/io/newgrounds/NG.hx | 2 +- lib/Source/io/newgrounds/NGLite.hx | 8 ++++---- test/Source/io/newgrounds/test/ui/MainScreen.hx | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/haxelib.json b/haxelib.json index 7bdf280..d66d6bd 100644 --- a/haxelib.json +++ b/haxelib.json @@ -1,8 +1,8 @@ { "name" : "newgrounds", "description" : "Newgrounds API for haxe", - "version" : "1.1.2", - "releasenote" : "remove OpenFL references in NG.hx", + "version" : "1.1.3", + "releasenote" : "change html5 compile conditions to js", "url" : "https://github.com/Geokureli/Newgrounds.hx", "classPath" : "lib/Source", "license" : "MIT", diff --git a/lib/Source/io/newgrounds/NG.hx b/lib/Source/io/newgrounds/NG.hx index e175fa2..02fae0f 100644 --- a/lib/Source/io/newgrounds/NG.hx +++ b/lib/Source/io/newgrounds/NG.hx @@ -235,7 +235,7 @@ class NG extends NGLite { #if flash flash.Lib.getURL(new flash.net.URLRequest(url), window); - #elseif (js && html5) + #elseif js js.Browser.window.open(url, window); #elseif desktop diff --git a/lib/Source/io/newgrounds/NGLite.hx b/lib/Source/io/newgrounds/NGLite.hx index d2b0738..49e1690 100644 --- a/lib/Source/io/newgrounds/NGLite.hx +++ b/lib/Source/io/newgrounds/NGLite.hx @@ -15,8 +15,8 @@ import io.newgrounds.objects.events.Result.ResultBase; import io.newgrounds.objects.events.Result.SessionResult; import io.newgrounds.utils.Dispatcher; -#if !(html5 || flash || desktop || neko) - #error "Target not supported, use: Flash, JS/HTML5, cpp or maybe neko"; +#if !(js || flash || desktop || neko) + #error "Target not supported, use: Flash, JS, cpp or maybe neko"; #end /** @@ -127,7 +127,7 @@ class NGLite { inline static public function getUrl():String { - #if html5 + #if js return js.Browser.document.location.href; #elseif flash return flash.Lib.current.stage.loaderInfo != null @@ -140,7 +140,7 @@ class NGLite { static public function getSessionId():String { - #if html5 + #if js var url = getUrl(); diff --git a/test/Source/io/newgrounds/test/ui/MainScreen.hx b/test/Source/io/newgrounds/test/ui/MainScreen.hx index 59502d3..b79825e 100644 --- a/test/Source/io/newgrounds/test/ui/MainScreen.hx +++ b/test/Source/io/newgrounds/test/ui/MainScreen.hx @@ -53,7 +53,7 @@ class MainScreen extends Sprite { _layout = new MainScreenSwf(); addChild(_layout); - #if html5 + #if js Input.mouseDisableText(_layout); #end _output = _layout.output;