Skip to content

Commit

Permalink
Add logic to attempt load nomadhelper and call function inside that file
Browse files Browse the repository at this point in the history
(reference #53)
  • Loading branch information
piotrzarzycki21 committed Apr 2, 2024
1 parent ab5397e commit 8a46a2e
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
package controller
{
import model.proxy.login.ProxyLogin;

import org.puremvc.as3.multicore.interfaces.INotification;
import org.puremvc.as3.multicore.patterns.command.SimpleCommand;
import org.apache.royale.utils.js.loadJavascript;
import org.apache.royale.net.HTTPService;
import org.apache.royale.net.beads.CORSCredentialsBead;
import org.apache.royale.net.events.FaultEvent;
import org.apache.royale.net.HTTPHeader;

public class CommandLoadNomadHelper extends SimpleCommand
{
override public function execute(note:INotification):void
{
/*window['fetch']("https://nomadweb.venus.startcloud.com/nomad/nomadhelper.js", { mode: 'cors' }).then(function(res:Object):Object {
return {};
}).catch(function(err:Object):void {
});*/

/*loadJavascript("https://nomadweb.venus.startcloud.com/nomad/nomadhelper.js", function():void {
});*/
window['openLink']("Some");
/*var service:HTTPService = new HTTPService();
service.addBead(new CORSCredentialsBead(true));
service.url = "https://nomadweb.venus.startcloud.com/nomad/nomadhelper.js?openLink&link='Some'";
service.method = "GET";
service.addEventListener("complete", function(event:Event):void {
var e:Event = event;
});
service.addEventListener("ioError", function(event:FaultEvent):void {
var f:FaultEvent = event;
});
service.send();*/
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package controller.startup
import controller.CommandVersionCheck;

import org.puremvc.as3.multicore.patterns.command.MacroCommand;
import controller.CommandLoadNomadHelper;

public class CommandPostStartup extends MacroCommand
{
Expand All @@ -12,6 +13,7 @@ package controller.startup
override protected function initializeMacroCommand() :void
{
addSubCommand(CommandVersionCheck);
addSubCommand(CommandLoadNomadHelper);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/devextreme-quill/1.7.0/dx-quill.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/devextreme-dist/23.2.5/js/dx.all.js"></script>
<script type="text/javascript" src="https://nomadweb.venus.startcloud.com/nomad/nomadhelper.js"></script>

<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/dialog-polyfill/0.5.6/dialog-polyfill.min.js"></script>
${head}
Expand Down
7 changes: 7 additions & 0 deletions Super.Human.Portal_Royale/src/resources/nomadhelper.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
function openLink(link) {
Console.log("My test link " + link);
}

/*const urlParams = new URLSearchParams(window.location.search);
const myParam = urlParams.get('link');
openLink(myParam);*/

0 comments on commit 8a46a2e

Please sign in to comment.