Files
JiboSDK/lib/launcher/launcher.js
2026-03-22 03:21:45 +02:00

1 line
1.5 KiB
JavaScript

"use strict";function t(t){var e=l.parse(t);return null!==e.port?e.host.slice(0,-(e.port.length+1)):e.host}var e=function(t){return t&&t.__esModule?t["default"]:t},r=function(){function t(t,e){for(var r in e){var n=e[r];n.configurable=!0,n.value&&(n.writable=!0)}Object.defineProperties(t,e)}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),n=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(t.__proto__=e)},i=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},o=e(require("path")),u=require("jibo-tools").launcher,a=e(require("../toolbar/run-configuration")),s=require("events").EventEmitter,l=e(require("url-parse-as-address")),c=function(e){function s(){var t=this;i(this,s),this.isPlaying=!1,u.on("exit",function(){t.isPlaying=!1,t.emit("exit")})}return n(s,e),r(s,{play:{value:function(){this.emit("start"),this.isPlaying=!0;var e=a.runDir;e=e.replace("${project}",atom.project.getPaths()[0]);var r=o.resolve(e,"index.html");if("remote"===a.type){var n="http://"+t(a.host)+":8181/registry";u.play(r,n)}else u.play(r)}},stop:{value:function(){u.stop()}},isPlaying:{value:function(){return this.isPlaying}},togglePlayer:{value:function(){this.isPlaying?this.stop():this.play()}}}),s}(s);module.exports=c,module.exports=new c;