]> _ Git - tortuga-home.git/commitdiff
.
authorVincent <vincent@enhydra.fr>
Mon, 3 May 2021 07:51:27 +0000 (09:51 +0200)
committerVincent <vincent@enhydra.fr>
Mon, 3 May 2021 07:51:27 +0000 (09:51 +0200)
.idea/workspace.xml
index.php
js/cordova.js
js/home.js

index b0a5a3248bc9cb53849ab5e28d17dc53b7afa29b..c83fb953c7f61b8b43e8c66cf955a02365545236 100644 (file)
@@ -3,24 +3,9 @@
   <component name="ChangeListManager">
     <list default="true" id="352ce63a-b52a-41a2-979b-becda7920939" name="Default" comment=".">
       <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/config/balcon.php" beforeDir="false" afterPath="$PROJECT_DIR$/config/balcon.php" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/config/bureau.php" beforeDir="false" afterPath="$PROJECT_DIR$/config/bureau.php" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/config/chambre.php" beforeDir="false" afterPath="$PROJECT_DIR$/config/chambre.php" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/config/cour.php" beforeDir="false" afterPath="$PROJECT_DIR$/config/cour.php" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/config/cuisine.php" beforeDir="false" afterPath="$PROJECT_DIR$/config/cuisine.php" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/config/entree.php" beforeDir="false" afterPath="$PROJECT_DIR$/config/entree.php" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/config/lit.php" beforeDir="false" afterPath="$PROJECT_DIR$/config/lit.php" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/config/litjerome.php" beforeDir="false" afterPath="$PROJECT_DIR$/config/litjerome.php" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/config/litvincent.php" beforeDir="false" afterPath="$PROJECT_DIR$/config/litvincent.php" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/config/music.php" beforeDir="false" afterPath="$PROJECT_DIR$/config/music.php" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/config/salon.php" beforeDir="false" afterPath="$PROJECT_DIR$/config/salon.php" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/config/sdb.php" beforeDir="false" afterPath="$PROJECT_DIR$/config/sdb.php" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/config/wc.php" beforeDir="false" afterPath="$PROJECT_DIR$/config/wc.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/index.php" beforeDir="false" afterPath="$PROJECT_DIR$/index.php" 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/domoticz_device_event.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/domoticz_device_event.php" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/scripts/lib/mediarasp.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/mediarasp.php" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/scripts/volume.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/volume.php" afterDir="false" />
     </list>
     <option name="SHOW_DIALOG" value="false" />
     <option name="HIGHLIGHT_CONFLICTS" value="true" />
         <option name="Make" enabled="true" />
       </method>
     </configuration>
+    <configuration default="true" type="ArquillianJUnit" factoryName="" nameIsGenerated="true">
+      <option name="arquillianRunConfiguration">
+        <value>
+          <option name="containerStateName" value="" />
+        </value>
+      </option>
+      <option name="TEST_OBJECT" value="class" />
+      <method v="2">
+        <option name="Make" enabled="true" />
+      </method>
+    </configuration>
     <configuration default="true" type="ArquillianTestNG" factoryName="">
       <option name="arquillianRunConfiguration">
         <value>
       <workItem from="1619802300800" duration="355000" />
       <workItem from="1619888463622" duration="1227000" />
       <workItem from="1619952129836" duration="292000" />
-      <workItem from="1619952673812" duration="1313000" />
-    </task>
-    <task id="LOCAL-00430" summary=".">
-      <created>1610353505617</created>
-      <option name="number" value="00430" />
-      <option name="presentableId" value="LOCAL-00430" />
-      <option name="project" value="LOCAL" />
-      <updated>1610353505617</updated>
+      <workItem from="1619952673812" duration="6968000" />
     </task>
     <task id="LOCAL-00431" summary=".">
       <created>1610463457268</created>
       <option name="project" value="LOCAL" />
       <updated>1619802642366</updated>
     </task>
-    <option name="localTasksCounter" value="479" />
+    <task id="LOCAL-00479" summary=".">
+      <created>1619954224127</created>
+      <option name="number" value="00479" />
+      <option name="presentableId" value="LOCAL-00479" />
+      <option name="project" value="LOCAL" />
+      <updated>1619954224128</updated>
+    </task>
+    <option name="localTasksCounter" value="480" />
     <servers />
   </component>
   <component name="TypeScriptGeneratedFilesManager">
index 22939bcc99693520f60e591775885e8455969f80..75bb48bb97f296f2268e9f7679f2ef152eff1b67 100644 (file)
--- a/index.php
+++ b/index.php
@@ -24,6 +24,7 @@ function relativePath($p)
 <head>
     <meta charset="UTF-8">
     <meta name="google" content="notranslate">
+    <meta http-equiv="Content-Security-Policy" content="default-src * 'self' data: gap: cdvfile: 'unsafe-eval' 'unsafe-inline' https: http: wss: ws:; style-src 'self' 'unsafe-inline'; img-src * filesystem: cdvfile: data:; media-src * blob:">
     <title>Tortuga Home Control</title>
     <link href="<?php echo relativePath('js/mmenu/mmenu-light.css') ?>" rel="stylesheet">
     <link href="<?php echo relativePath('style/fonts/fontawesome/all.min.css') ?>" rel="stylesheet">
@@ -91,7 +92,7 @@ function relativePath($p)
     </main>
 </div>
 <?php
-if (true) {
+if (false) {
     echo '<script src="' . relativePath('js/webapp.js') . '"></script>' . "\n";
 } ?>
 <script>
index a24a0bb7b1b817429ca1f9cda9b3401eafa916a8..11c98645e61b60c8e3452a6c9af008dea34f0925 100644 (file)
@@ -1,9 +1,17 @@
+console.log('cordova scripts loaded');
+
 var DEVICE_READY_BEFORE_JQUERY = false;
 var JQUERY_READY = false;
 var cordovaInitInterval;
-document.addEventListener('deviceready', _onDeviceReady, false);
+
+if (window.cordova) {
+    _onDeviceReady();
+} else {
+    document.addEventListener('deviceready', _onDeviceReady, false);
+}
 
 function _onDeviceReady() {
+    console.log('_onDeviceReady');
     if (JQUERY_READY) {
         onDeviceReady();
     } else {
@@ -11,7 +19,13 @@ function _onDeviceReady() {
     }
 }
 
+// setTimeout(function () {
+//     console.log('trigger _onDeviceReady');
+//     _onDeviceReady();
+// }, 6000);
+
 $(function () {
+    console.log('jquery ready');
     JQUERY_READY = true;
     if (DEVICE_READY_BEFORE_JQUERY) {
         onDeviceReady();
@@ -19,7 +33,9 @@ $(function () {
 });
 
 function onDeviceReady() {
+    console.log('onDeviceReady');
     cordovaInitInterval = setInterval(function () {
+        console.log('check cordova');
         if (window.cordova) {
             clearInterval(cordovaInitInterval);
             initCordova();
@@ -28,6 +44,7 @@ function onDeviceReady() {
 }
 
 function initCordova() {
+    console.log('initCordova');
     try {
         screen.orientation.lock('landscape');
     } catch (e) {
index 7ac2a8f1a2ea99ea130ac1e210141e305eae6a01..23fe12fa9a7c2b7f787ac16025bc8c13fd2aa05e 100644 (file)
@@ -1,5 +1,5 @@
 var iOS = !!navigator.platform && /iPad|iPhone|iPod/.test(navigator.platform);
-var androidApp = navigator.userAgent.indexOf("Lenovo TB-8505") >= 0;
+var androidApp = navigator.userAgent.indexOf("Lenovo TB-8505") >= 0 || navigator.userAgent.indexOf("Lenovo TB-X606F") >= 0;
 if (!raspberry && !iOS && !androidApp) {
     CONFIG.SLEEPSCREEN = 0;
     CONFIG.SLEEPTYPE = 'off';
@@ -23,10 +23,11 @@ var lastOffScreen = 0;
 var maskRemoteShort = false;
 
 $(function () {
-
+    console.log('main jquery ready');
     var clicktouchevent = 'click';
     var clickevent = 'click';
     if (CONFIG.SLEEPSCREEN > 0) {
+        console.log('define check sleep');
         sleepDate = Date.now();
         setInterval(function () {
             checkSleep();
@@ -34,12 +35,14 @@ $(function () {
     }
 
     if (defaultVolume > 0) {
+        console.log('set default volume');
         setTimeout(function () {
             $.get('scripts/volume.php?volume=' + defaultVolume + '%');
         }, 10000);
     }
 
     if (true || raspberry) {
+        console.log('define check ecomode');
         setInterval(function () {
             checkEcoMode(false);
         }, 60000);
@@ -53,6 +56,7 @@ $(function () {
         runSSHQueue();
     }, 1500);
 
+    console.log('menu init');
     menu = new MmenuLight(
         document.querySelector("#mainnav")
     );
@@ -60,6 +64,7 @@ $(function () {
     menunav = menu.navigation({theme: 'dark', title: ''});
     menudrawer = menu.offcanvas();
 
+    console.log('init events');
     document.querySelector('a[href="#openmenu"]')
         .addEventListener('click', function (evnt) {
             evnt.preventDefault();
@@ -319,7 +324,7 @@ $(function () {
         resize();
     });
 
-
+    console.log('init hammer');
     // Long click
     var mc = new Hammer.Manager(document, {
         recognizers: [
@@ -377,17 +382,6 @@ $(function () {
         return true;
     });
 
-    var eventtouch = 'click';
-    try {
-        if (Modernizr.touch) {
-            eventtouch = 'touchstart';
-        } else {
-            eventtouch = 'click';
-        }
-    } catch (e) {
-
-    }
-
     $(document).on('click', '[data-remote-command]', function () {
         if (maskRemoteShort && $(this).is('[data-remote-command-long]')) {
             maskRemoteShort = false;
@@ -401,6 +395,7 @@ $(function () {
         return false;
     });
 
+    console.log('init functions');
     changeAddress();
     initScreenSaver();
     initWeather();
@@ -408,17 +403,19 @@ $(function () {
     initVelib();
 
     setTimeout(function () {
+        console.log('init');
         resize();
         $("body").addClass('init');
     }, 1000);
+
 });
 
-function volumeDown(){
+function volumeDown() {
 
     return false;
 }
 
-function volumeUp(){
+function volumeUp() {
 
     return false;
 }
@@ -642,7 +639,7 @@ function updateScreenSaver(force) {
 }
 
 function showScreenSaver() {
-    if( $('main section:visible').data('section')==='remote'){
+    if ($('main section:visible').data('section') === 'remote') {
         return;
     }