Преглед изворни кода

Helios is popupping itself, client only checks for its presence.

Herbert Vojčík пре 10 година
родитељ
комит
838150b897
2 измењених фајлова са 15 додато и 1 уклоњено
  1. 10 0
      support/helios/index.js
  2. 5 1
      support/helpers.js

+ 10 - 0
support/helios/index.js

@@ -0,0 +1,10 @@
+define(["require"], function (require) {
+    return  {
+        popup: function () {
+            window.open(require.toUrl('./index.html'), "Helios", "menubar=no, width=1000, height=600");
+        },
+        go: function () {
+            window.location.href = require.toUrl('./index.html');
+        }
+    };
+});

+ 5 - 1
support/helpers.js

@@ -7,7 +7,11 @@ define("amber/helpers", ["amber/boot", "require"], function (boot, require) {
     // API
 
     exports.popupHelios = function () {
-        window.open(require.toUrl('helios/index.html'), "Helios", "menubar=no, width=1000, height=600");
+        require(['helios/index'], function (helios) {
+            helios.popup();
+        }, function (err) {
+            window.alert("Error loading helios.\nIf not present, you can install it with 'bower install helios --save-dev'.\nThe error follows:\n" + err);
+        });
     };
     Object.defineProperty(exports, "vm", {
         value: vm,