Skip to content

Commit

Permalink
Merge pull request #48 from Geokureli/js_compile
Browse files Browse the repository at this point in the history
add js compile constants for node js
  • Loading branch information
Geokureli authored Dec 16, 2020
2 parents 7e74d64 + eef7855 commit 79bf454
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions haxelib.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 1 addition & 1 deletion lib/Source/io/newgrounds/NG.hx
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
8 changes: 4 additions & 4 deletions lib/Source/io/newgrounds/NGLite.hx
Original file line number Diff line number Diff line change
Expand Up @@ -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

/**
Expand Down Expand Up @@ -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
Expand All @@ -140,7 +140,7 @@ class NGLite {

static public function getSessionId():String {

#if html5
#if js

var url = getUrl();

Expand Down
2 changes: 1 addition & 1 deletion test/Source/io/newgrounds/test/ui/MainScreen.hx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class MainScreen extends Sprite {

_layout = new MainScreenSwf();
addChild(_layout);
#if html5
#if js
Input.mouseDisableText(_layout);
#end
_output = _layout.output;
Expand Down

0 comments on commit 79bf454

Please sign in to comment.