From 3af8210da3114566cfa044f4d8ef83b3c6cef3e6 Mon Sep 17 00:00:00 2001
From: blavenie <benoit.lavenier@e-is.pro>
Date: Thu, 6 Sep 2018 16:54:25 +0200
Subject: [PATCH] [fix] remove debug log on github deployment script [fix] Try
 to whow titlebar on desktop, when opening a link

---
 github.sh                        |  2 +-
 www/js/services/http-services.js | 17 ++++++++++++-----
 2 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/github.sh b/github.sh
index adb7e380..ed303301 100755
--- a/github.sh
+++ b/github.sh
@@ -66,7 +66,7 @@ case "$1" in
       echo " - tag: v$current"
       echo " - description: $description"
       result=`curl -H ''"$GITHUT_AUTH"'' -i $REPO_URL/releases -d '{"tag_name": "v'"$current"'","target_commitish": "master","name": "'"$current"'","body": "'"$description"'","draft": false,"prerelease": '"$prerelease"'}'`
-      echo "$result"
+      #echo "DEBUG - $result"
       upload_url=`echo "$result" | grep -P "\"upload_url\": \"[^\"]+"  | grep -oP "https://[A-Za-z0-9/.-]+"`
 
       ###  Sending files
diff --git a/www/js/services/http-services.js b/www/js/services/http-services.js
index 58343946..017bf943 100644
--- a/www/js/services/http-services.js
+++ b/www/js/services/http-services.js
@@ -340,7 +340,7 @@ angular.module('cesium.http.services', ['cesium.cache.services'])
         uri = parts.protocol + uri;
       }
 
-      // Check if device is enable, on spcial tel: or mailto: protocole
+      // Check if device is enable, on special tel: or mailto: protocole
       var validProtocol = (parts.protocol == 'mailto:' || parts.protocol == 'tel:') && Device.enable;
       if (!validProtocol) {
         if (options.onError && typeof options.onError == 'function') {
@@ -352,15 +352,22 @@ angular.module('cesium.http.services', ['cesium.cache.services'])
 
     // Note: If device enable, then target=_system will use InAppBrowser cordova plugin
     var openTarget = (options.target || (Device.enable ? '_system' : '_blank'));
-    var openOptions;
+
     // If desktop, should always open in new window (no tabs)
-    if (openTarget == '_blank' && Device.isDesktop() && $window.screen && $window.screen.width && $window.screen.height) {
-      openOptions= "width={0},height={1},location=1,menubar=1,toolbar=1,resizable=1,scrollbars=1".format($window.screen.width/2, $window.screen.height/2);
+    var openOptions;
+    if (openTarget == '_blank' && Device.isDesktop()) {
+      openOptions= "location=1,titlebar=1,status=1,menubar=1,toolbar=1,resizable=1,scrollbars=1";
+      // Add width/height
+      if ($window.screen && $window.screen.width && $window.screen.height) {
+        openOptions += ",width={0},height={1}".format(Math.trunc($window.screen.width/2), Math.trunc($window.screen.height/2));
+      }
     }
     var win = $window.open(uri,
       openTarget,
       openOptions);
-    if (openOptions) {
+
+    // Center the opened window
+    if (openOptions && $window.screen && $window.screen.width && $window.screen.height) {
       win.moveTo($window.screen.width/2/2, $window.screen.height/2/2);
       win.focus();
     }
-- 
GitLab