]> _ Git - tortuga-home.git/commitdiff
.
authorVincent <vincent@enhydra.fr>
Thu, 12 Nov 2020 13:34:21 +0000 (14:34 +0100)
committerVincent <vincent@enhydra.fr>
Thu, 12 Nov 2020 13:34:21 +0000 (14:34 +0100)
.idea/workspace.xml
js/cordova.js
js/home.js
scripts/lib/shield.php
scripts/share.php

index 3a15a4b06118e9dae3fe4db4237c1e392f5bf6cf..ea324e7bf3609672a0d966c4900aa9517500cdba 100644 (file)
@@ -5,8 +5,8 @@
       <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/js/cordova.js" beforeDir="false" afterPath="$PROJECT_DIR$/js/cordova.js" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/js/home.js" beforeDir="false" afterPath="$PROJECT_DIR$/js/home.js" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/scripts/lib/lib.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/lib.php" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/scripts/lib/remoteinfos.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/remoteinfos.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/scripts/lib/shield.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/shield.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/scripts/share.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/share.php" afterDir="false" />
     </list>
     <option name="SHOW_DIALOG" value="false" />
     <option name="HIGHLIGHT_CONFLICTS" value="true" />
       <workItem from="1604828693023" duration="1255000" />
       <workItem from="1605001866699" duration="7793000" />
       <workItem from="1605087671373" duration="102000" />
-      <workItem from="1605087787424" duration="29967000" />
-    </task>
-    <task id="LOCAL-00337" summary=".">
-      <created>1595831538154</created>
-      <option name="number" value="00337" />
-      <option name="presentableId" value="LOCAL-00337" />
-      <option name="project" value="LOCAL" />
-      <updated>1595831538154</updated>
+      <workItem from="1605087787424" duration="33335000" />
     </task>
     <task id="LOCAL-00338" summary=".">
       <created>1596008713256</created>
       <option name="project" value="LOCAL" />
       <updated>1605121882930</updated>
     </task>
-    <option name="localTasksCounter" value="386" />
+    <task id="LOCAL-00386" summary=".">
+      <created>1605171515396</created>
+      <option name="number" value="00386" />
+      <option name="presentableId" value="LOCAL-00386" />
+      <option name="project" value="LOCAL" />
+      <updated>1605171515396</updated>
+    </task>
+    <option name="localTasksCounter" value="387" />
     <servers />
   </component>
   <component name="TypeScriptGeneratedFilesManager">
       <screen x="0" y="0" width="1707" height="920" />
     </state>
     <state x="740" y="229" key="#com.jetbrains.php.refactoring.extractMethod.PhpExtractMethodDialog#function0/0.0.1707.920@0.0.1707.920" timestamp="1604146905948" />
-    <state x="198" y="0" width="737" height="502" key="CommitChangelistDialog2" timestamp="1605121880134">
+    <state x="198" y="0" width="737" height="502" key="CommitChangelistDialog2" timestamp="1605171492435">
       <screen x="0" y="0" width="2560" height="1040" />
     </state>
     <state x="132" y="0" width="737" height="502" key="CommitChangelistDialog2/0.0.1707.920@0.0.1707.920" timestamp="1605086955514" />
     <state x="701" y="75" key="CommitChangelistDialog2/0.0.1920.1160@0.0.1920.1160" timestamp="1602171117745" />
-    <state x="198" y="0" width="745" height="567" key="CommitChangelistDialog2/0.0.2560.1040@0.0.2560.1040" timestamp="1605121880134" />
+    <state x="198" y="0" width="745" height="567" key="CommitChangelistDialog2/0.0.2560.1040@0.0.2560.1040" timestamp="1605171492435" />
     <state x="952" y="244" key="FileChooserDialogImpl" timestamp="1605104496549">
       <screen x="0" y="0" width="2560" height="1040" />
     </state>
index 2b0cfe4bf23ada7e170e556dd7074cef94cad6a4..6889ae2748b90cb7d8773f83a564b220e644831f 100644 (file)
@@ -16,24 +16,30 @@ function initCordova() {
     } catch (e) {
         console.log(e);
     }
-    console.log(location.host);
-
-    if (location.host === 'home.tortuga.enhydra.fr') {
-        var last = localStorage.getItem('lastconfig');
-        if (last === null) {
-            last = 'salon';
-        }
-        location.host = last + '.home.tortuga.enhydra.fr';
-    } else {
-        var e = location.host.split('.');
-        localStorage.setItem('lastconfig', e[0]);
-    }
+    //
+    // try {
+    //     if (location.host === 'home.tortuga.enhydra.fr') {
+    //         var last = localStorage.getItem('lastconfig');
+    //         if (last === null) {
+    //             last = 'salon';
+    //         }
+    //         location.host = last + '.home.tortuga.enhydra.fr';
+    //     } else {
+    //         var e = location.host.split('.');
+    //         localStorage.setItem('lastconfig', e[0]);
+    //     }
+    // } catch (e) {
+    //
+    // }
 
 
     try {
         window.plugins.intentShim.onIntent(function (intent) {
-            window.shareurl = intent.extras[window.plugins.intentShim.EXTRA_TEXT];
-            window.location.hash = '#/section/switchshare/';
+            console.log(intent);
+            if (intent.action === 'android.intent.action.SEND') {
+                window.shareurl = intent.extras['android.intent.extra.TEXT'];
+                showSection("switchshare", true)
+            }
         });
     } catch (e) {
         console.log(e);
index 0621e40a1a4862f3e52b199a0181681f974bf353..61eb1f3127989a989cb949a772818d394f59b2c2 100644 (file)
@@ -124,6 +124,7 @@ $(function () {
 
     $(document).on(clickevent, '.switchshare', function () {
         window.location = $(this).attr('href') + 'scripts/share.php?text=' + encodeURIComponent(window.shareurl);
+        return false;
     });
 
     $(document).on(clickevent, '[data-volume]', function () {
index 3e4d8b202be92006f513e853d4a18de044e81d68..495e4d09a26cab40c2f1a1800e49ddd85e40934f 100644 (file)
@@ -255,6 +255,12 @@ function shieldKillAll($device = null)
     }
 }
 
+function shieldShareIntent($content, $device = null)
+{
+    shieldRunActivity($device);
+    shieldCommand('shell am start', '-a android.intent.action.VIEW  -d \'"' . $content . '"\'', $device);
+}
+
 
 function _adb($command, $params = '', $device = null)
 {
index 463d7772a40e5815940aaf1770185e591b304d34..a1cdd13fff87280277673301a5ba43406c1dfca5 100644 (file)
@@ -9,6 +9,7 @@ function shareIntent($content, $device = null)
         $device = config('DEVICE');
     }
 
+    $ok = false;
     if (strpos($content, 'http') === 0) {
         $u = parse_url($content);
         if ($u['host'] == 'open.spotify.com') {
@@ -23,13 +24,14 @@ function shareIntent($content, $device = null)
             }
             setPlaying('squeezebox', $device);
             $sleep = 1;
-        } else if (in_array($device, $hasScreen)) {
-            $sleep = 5;
-            mediaRaspPlayCast($content, $device);
+            $ok = true;
         }
-        sleep($sleep);
-
-        header('Location: /#/section/remote');
-        exit;
     }
+
+    if (!$ok && in_array($device, $hasScreen)) {
+        $sleep = 1 and                                                                                                                                                                          ;
+                                                shieldShar
+    sleep($sleep);
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    header('L+/*-ocation: /#/section/remote');
+    exit;
 }
\ No newline at end of file