This commit is contained in:
OMGiTzPomPom 2023-02-03 11:35:07 +01:00
parent 5aa076e769
commit 9c17e1508d
40 changed files with 3539 additions and 5 deletions

7
TD1/.idea/TD1.iml generated
View File

@ -1,9 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="android" name="Android">
<configuration />
</facet>
</component>
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="jdk" jdkName="Android API 33, extension level 3 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

14
TD1/package-lock.json generated
View File

@ -11,6 +11,7 @@
"devDependencies": {
"cordova-android": "^10.1.2",
"cordova-plugin-camera": "^6.0.0",
"cordova-plugin-dialogs": "^2.0.2",
"cordova-plugin-geolocation": "^4.1.0",
"cordova-plugin-network-information": "^3.0.0"
}
@ -281,6 +282,19 @@
}
}
},
"node_modules/cordova-plugin-dialogs": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/cordova-plugin-dialogs/-/cordova-plugin-dialogs-2.0.2.tgz",
"integrity": "sha512-FUHI6eEVeoz2VkxbF0P56QlUQLGzXcvw3i4xuXyM9gEct6Y+FA3Xzgl2pJTZcTg5wRqLWzN08kgNoHPkom15pw==",
"dev": true,
"engines": {
"cordovaDependencies": {
"3.0.0": {
"cordova": ">100"
}
}
}
},
"node_modules/cordova-plugin-geolocation": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/cordova-plugin-geolocation/-/cordova-plugin-geolocation-4.1.0.tgz",

View File

@ -15,6 +15,7 @@
"devDependencies": {
"cordova-android": "^10.1.2",
"cordova-plugin-camera": "^6.0.0",
"cordova-plugin-dialogs": "^2.0.2",
"cordova-plugin-geolocation": "^4.1.0",
"cordova-plugin-network-information": "^3.0.0"
},
@ -23,11 +24,14 @@
"android"
],
"plugins": {
"cordova-plugin-geolocation": {},
"cordova-plugin-geolocation": {
"GPS_REQUIRED": "true"
},
"cordova-plugin-camera": {
"ANDROIDX_CORE_VERSION": "1.6.+"
},
"cordova-plugin-network-information": {}
"cordova-plugin-network-information": {},
"cordova-plugin-dialogs": {}
}
}
}

View File

@ -112,13 +112,15 @@ h1 {
#aj {
width: 50%;
margin-bottom: 15px;
}
#imgToReplace {
margin-top: 20px;
width: 50%;
display: none;
}
.btn {
margin: 5px 0;
}
}

View File

@ -49,8 +49,9 @@
<button class="btn btn-primary mx-auto d-block" id="takePicture">Camera</button>
<button class="btn btn-secondary mx-auto d-block" id="getPosition">Position</button>
<button class="btn btn-info mx-auto d-block" id="getCon">Est connecté ?</button>
<button class="btn btn-danger mx-auto d-block" id="getNotif">Notif</button>
<div class="camera">
<img src="" alt=" " class="mx-auto d-block" id="imgToReplace">
<img src="" alt=" " class="mx-auto d-block imgh" id="imgToReplace">
</div>
</div>

View File

@ -47,12 +47,17 @@ function onDeviceReady() {
});
document.addEventListener("offline", decoNet, false);
document.getElementById("getNotif").addEventListener("click", (e) => {
sendnotif();
});
}
function sucessCallbackImage(imageData) {
//alert("Zipp is best princess !");
var image = document.getElementById('imgToReplace') ;
image.style.display = "block";
image.src = "data:image/jpeg;base64," + imageData;
}
@ -100,3 +105,14 @@ function decoNet() {
btn.classList.add("btn-danger");
}
function sendnotif() {
navigator.notification.alert(
"Applejack is best pony !",
alertDismissed, // callback
);
}
function alertDismissed() {
}

26
TD2/.gitignore vendored Normal file
View File

@ -0,0 +1,26 @@
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
.DS_Store
# Generated by package manager
node_modules/
# Generated by Cordova
/plugins/
/platforms/

11
TD2/config.xml Normal file
View File

@ -0,0 +1,11 @@
<?xml version='1.0' encoding='utf-8'?>
<widget id="io.cordova.hellocordova" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>HelloCordova</name>
<description>Sample Apache Cordova App</description>
<author email="dev@cordova.apache.org" href="https://cordova.apache.org">
Apache Cordova Team
</author>
<content src="index.html" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
</widget>

1681
TD2/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

23
TD2/package.json Normal file
View File

@ -0,0 +1,23 @@
{
"name": "io.cordova.hellocordova",
"displayName": "HelloCordova",
"version": "1.0.0",
"description": "A sample Apache Cordova application that responds to the deviceready event.",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [
"ecosystem:cordova"
],
"author": "Apache Cordova Team",
"license": "Apache-2.0",
"devDependencies": {
"cordova-android": "^10.1.2"
},
"cordova": {
"platforms": [
"android"
]
}
}

0
TD2/www/.nojekyll Normal file
View File

9
TD2/www/200.html Normal file
View File

@ -0,0 +1,9 @@
<!doctype html>
<html>
<head>
<title>TempsReel</title><meta data-n-head="1" charset="utf-8"><meta data-n-head="1" name="viewport" content="width=device-width,initial-scale=1"><meta data-n-head="1" data-hid="description" name="description" content="mise en place du temps réel avec nuxt/laravel"><link data-n-head="1" rel="icon" type="image/x-icon" href="/favicon.ico"><link rel="preload" href="/_nuxt/b50a4cf.js" as="script"><link rel="preload" href="/_nuxt/b69b31e.js" as="script"><link rel="preload" href="/_nuxt/001c78c.js" as="script"><link rel="preload" href="/_nuxt/654ffe2.js" as="script">
</head>
<body>
<div id="__nuxt"><style>#nuxt-loading{background:#fff;visibility:hidden;opacity:0;position:absolute;left:0;right:0;top:0;bottom:0;display:flex;justify-content:center;align-items:center;flex-direction:column;animation:nuxtLoadingIn 10s ease;-webkit-animation:nuxtLoadingIn 10s ease;animation-fill-mode:forwards;overflow:hidden}@keyframes nuxtLoadingIn{0%{visibility:hidden;opacity:0}20%{visibility:visible;opacity:0}100%{visibility:visible;opacity:1}}@-webkit-keyframes nuxtLoadingIn{0%{visibility:hidden;opacity:0}20%{visibility:visible;opacity:0}100%{visibility:visible;opacity:1}}#nuxt-loading>div,#nuxt-loading>div:after{border-radius:50%;width:5rem;height:5rem}#nuxt-loading>div{font-size:10px;position:relative;text-indent:-9999em;border:.5rem solid #f5f5f5;border-left:.5rem solid #fff;-webkit-transform:translateZ(0);-ms-transform:translateZ(0);transform:translateZ(0);-webkit-animation:nuxtLoading 1.1s infinite linear;animation:nuxtLoading 1.1s infinite linear}#nuxt-loading.error>div{border-left:.5rem solid #ff4500;animation-duration:5s}@-webkit-keyframes nuxtLoading{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes nuxtLoading{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}</style><script>window.addEventListener("error",function(){var e=document.getElementById("nuxt-loading");e&&(e.className+=" error")})</script><div id="nuxt-loading" aria-live="polite" role="status"><div>Loading...</div></div></div><script>window.__NUXT__={config:{_app:{basePath:"/",assetsPath:"/_nuxt/",cdnURL:null}}}</script>
<script src="/_nuxt/b50a4cf.js"></script><script src="/_nuxt/b69b31e.js"></script><script src="/_nuxt/001c78c.js"></script><script src="/_nuxt/654ffe2.js"></script></body>
</html>

11
TD2/www/README.md Normal file
View File

@ -0,0 +1,11 @@
# STATIC
**This directory is not required, you can delete it if you don't want to use it.**
This directory contains your static files.
Each file inside this directory is mapped to `/`.
Thus you'd want to delete this README.md before deploying to production.
Example: `/static/robots.txt` is mapped as `/robots.txt`.
More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/assets#static).

2
TD2/www/_nuxt/001c78c.js Normal file

File diff suppressed because one or more lines are too long

1
TD2/www/_nuxt/654ffe2.js Normal file

File diff suppressed because one or more lines are too long

54
TD2/www/_nuxt/LICENSES Normal file
View File

@ -0,0 +1,54 @@
/*!
* Pusher JavaScript Library v5.1.1
* https://pusher.com/
*
* Copyright 2017, Pusher
* Released under the MIT licence.
*/
/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <http://feross.org>
* @license MIT
*/
/*!
* vue-client-only v0.0.0-semantic-release
* (c) 2021-present egoist <0x142857@gmail.com>
* Released under the MIT License.
*/
/*!
* vue-no-ssr v1.1.1
* (c) 2018-present egoist <0x142857@gmail.com>
* Released under the MIT License.
*/
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
/*!
* vue-router v3.5.3
* (c) 2021 Evan You
* @license MIT
*/
/*!
* Vue.js v2.6.14
* (c) 2014-2021 Evan You
* Released under the MIT License.
*/
/*!
* cookie
* Copyright(c) 2012-2014 Roman Shtylman
* Copyright(c) 2015 Douglas Christopher Wilson
* MIT Licensed
*/
/*!
* vuex v3.6.2
* (c) 2021 Evan You
* @license MIT
*/

1
TD2/www/_nuxt/ab05ce0.js Normal file
View File

@ -0,0 +1 @@
(window.webpackJsonp=window.webpackJsonp||[]).push([[2],{212:function(e,t,n){var content=n(214);content.__esModule&&(content=content.default),"string"==typeof content&&(content=[[e.i,content,""]]),content.locals&&(e.exports=content.locals);(0,n(75).default)("6759f5ab",content,!0,{sourceMap:!1})},213:function(e,t,n){"use strict";n(212)},214:function(e,t,n){var o=n(74)(!1);o.push([e.i,".titre-general{width:50%;margin:0 auto 50px;padding-bottom:20px;border:1px solid #000;border-top:none;font-size:40px;text-align:center}.pending{color:#ff4500}.disconnected{color:red}.connected{color:green}",""]),e.exports=o},215:function(e,t,n){"use strict";n.r(t);var o=n(4),c=(n(43),{data:function(){return{status:"pending",email:"user1@unice.fr",echo:null,messages:[],message_to_send:null}},watch:{},mounted:function(){var e=this;this.echo=window.Echo,this.echo.connector.pusher.connection.bind("connected",(function(){e.status="connected"})),this.echo.connector.pusher.connection.bind("disconnected",(function(){e.status="disconnected"})),this.getMessages(),this.echo.channel("LP-IOTIA").listen(".App\\Events\\PublicMessage",(function(data){e.messages.push(data.message.message),console.log(data)}))},methods:{getMessages:function(){var e=this;this.$axios.get("messages").catch((function(e){console.log(e)})).then((function(t){e.messages=t.data.messages}))},sendMessage:function(){var e=this;return Object(o.a)(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e.$axios.post("messages",{content:e.message_to_send}).catch((function(e){console.log(e)})).then((function(e){e&&e.data&&alert("Message envoyé")}));case 1:case"end":return t.stop()}}),t)})))()},login:function(){var e=this;return Object(o.a)(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.$auth.loginWith("local",{data:{email:e.email,password:"demo"}}).catch((function(e){alert(e.response.data.message)})).then((function(){e.$auth.user&&alert("Connecté : "+e.$auth.user.email)}));case 2:case"end":return t.stop()}}),t)})))()}}}),r=(n(213),n(39)),component=Object(r.a)(c,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("h1",{staticClass:"titre-general"},[e._v("Statut du serveur Websocket")]),e._v(" "),n("div",{staticStyle:{"text-align":"center"}},[n("h2",[e._v("Statut : "),n("span",{class:e.echo?e.echo.connector.pusher.connection.state:e.status,staticStyle:{"font-weight":"bold"}},[e._v(e._s(e.echo?e.echo.connector.pusher.connection.state:e.status))])])]),e._v(" "),e.$auth.user?n("div",[n("p",[e._v("Connecté en tant que "+e._s(e.$auth.user.email))]),e._v(" "),n("input",{directives:[{name:"model",rawName:"v-model",value:e.message_to_send,expression:"message_to_send"}],attrs:{type:"text"},domProps:{value:e.message_to_send},on:{input:function(t){t.target.composing||(e.message_to_send=t.target.value)}}}),e._v(" "),n("button",{on:{click:e.sendMessage}},[e._v("Envoyer")])]):n("div",{staticStyle:{"margin-top":"10px","text-align":"center"}},[n("input",{directives:[{name:"model",rawName:"v-model",value:e.email,expression:"email"}],attrs:{type:"text"},domProps:{value:e.email},on:{input:function(t){t.target.composing||(e.email=t.target.value)}}}),e._v(" "),n("button",{on:{click:e.login}},[e._v("Se connecter")])]),e._v(" "),n("div",e._l(e.messages,(function(t){return n("p",[n("strong",[e._v("["+e._s(t.sender.name)+"]")]),e._v(" "+e._s(t.content))])})),0)])}),[],!1,null,null,null);t.default=component.exports}}]);

1
TD2/www/_nuxt/b50a4cf.js Normal file
View File

@ -0,0 +1 @@
!function(e){function r(data){for(var r,n,l=data[0],f=data[1],d=data[2],i=0,h=[];i<l.length;i++)n=l[i],Object.prototype.hasOwnProperty.call(o,n)&&o[n]&&h.push(o[n][0]),o[n]=0;for(r in f)Object.prototype.hasOwnProperty.call(f,r)&&(e[r]=f[r]);for(v&&v(data);h.length;)h.shift()();return c.push.apply(c,d||[]),t()}function t(){for(var e,i=0;i<c.length;i++){for(var r=c[i],t=!0,n=1;n<r.length;n++){var f=r[n];0!==o[f]&&(t=!1)}t&&(c.splice(i--,1),e=l(l.s=r[0]))}return e}var n={},o={3:0},c=[];function l(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,l),t.l=!0,t.exports}l.e=function(e){var r=[],t=o[e];if(0!==t)if(t)r.push(t[2]);else{var n=new Promise((function(r,n){t=o[e]=[r,n]}));r.push(t[2]=n);var c,script=document.createElement("script");script.charset="utf-8",script.timeout=120,l.nc&&script.setAttribute("nonce",l.nc),script.src=function(e){return l.p+""+{2:"ab05ce0"}[e]+".js"}(e);var f=new Error;c=function(r){script.onerror=script.onload=null,clearTimeout(d);var t=o[e];if(0!==t){if(t){var n=r&&("load"===r.type?"missing":r.type),c=r&&r.target&&r.target.src;f.message="Loading chunk "+e+" failed.\n("+n+": "+c+")",f.name="ChunkLoadError",f.type=n,f.request=c,t[1](f)}o[e]=void 0}};var d=setTimeout((function(){c({type:"timeout",target:script})}),12e4);script.onerror=script.onload=c,document.head.appendChild(script)}return Promise.all(r)},l.m=e,l.c=n,l.d=function(e,r,t){l.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},l.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l.t=function(e,r){if(1&r&&(e=l(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(l.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var n in e)l.d(t,n,function(r){return e[r]}.bind(null,n));return t},l.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return l.d(r,"a",r),r},l.o=function(object,e){return Object.prototype.hasOwnProperty.call(object,e)},l.p="/_nuxt/",l.oe=function(e){throw console.error(e),e};var f=window.webpackJsonp=window.webpackJsonp||[],d=f.push.bind(f);f.push=r,f=f.slice();for(var i=0;i<f.length;i++)r(f[i]);var v=d;t()}([]);

2
TD2/www/_nuxt/b69b31e.js Normal file

File diff suppressed because one or more lines are too long

110
TD2/www/css/index.css Normal file
View File

@ -0,0 +1,110 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
* {
-webkit-tap-highlight-color: rgba(0,0,0,0); /* make transparent link selection, adjust last value opacity 0 to 1.0 */
}
body {
-webkit-touch-callout: none; /* prevent callout to copy image, etc when tap to hold */
-webkit-text-size-adjust: none; /* prevent webkit from resizing text to fit */
-webkit-user-select: none; /* prevent copy paste, to allow, change 'none' to 'text' */
background-color:#E4E4E4;
background-image:linear-gradient(to bottom, #A7A7A7 0%, #E4E4E4 51%);
font-family: system-ui, -apple-system, -apple-system-font, 'Segoe UI', 'Roboto', sans-serif;
font-size:12px;
height:100vh;
margin:0px;
padding:0px;
/* Padding to avoid the "unsafe" areas behind notches in the screen */
padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
text-transform:uppercase;
width:100%;
}
/* Portrait layout (default) */
.app {
background:url(../img/logo.png) no-repeat center top; /* 170px x 200px */
position:absolute; /* position in the center of the screen */
left:50%;
top:50%;
height:50px; /* text area height */
width:225px; /* text area width */
text-align:center;
padding:180px 0px 0px 0px; /* image height is 200px (bottom 20px are overlapped with text) */
margin:-115px 0px 0px -112px; /* offset vertical: half of image height and text area height */
/* offset horizontal: half of text area width */
}
/* Landscape layout (with min-width) */
@media screen and (min-aspect-ratio: 1/1) and (min-width:400px) {
.app {
background-position:left center;
padding:75px 0px 75px 170px; /* padding-top + padding-bottom + text area = image height */
margin:-90px 0px 0px -198px; /* offset vertical: half of image height */
/* offset horizontal: half of image width and text area width */
}
}
h1 {
font-size:24px;
font-weight:normal;
margin:0px;
overflow:visible;
padding:0px;
text-align:center;
}
.event {
border-radius:4px;
color:#FFFFFF;
font-size:12px;
margin:0px 30px;
padding:2px 0px;
}
.event.listening {
background-color:#333333;
display:block;
}
.event.received {
background-color:#4B946A;
display:none;
}
#deviceready.ready .event.listening { display: none; }
#deviceready.ready .event.received { display: block; }
@keyframes fade {
from { opacity: 1.0; }
50% { opacity: 0.4; }
to { opacity: 1.0; }
}
.blink {
animation:fade 3000ms infinite;
-webkit-animation:fade 3000ms infinite;
}
@media screen and (prefers-color-scheme: dark) {
body {
background-image:linear-gradient(to bottom, #585858 0%, #1B1B1B 51%);
}
}

BIN
TD2/www/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
TD2/www/img/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

9
TD2/www/index.html Normal file
View File

@ -0,0 +1,9 @@
<!doctype html>
<html data-n-head-ssr>
<head>
<title>TempsReel</title><meta data-n-head="ssr" charset="utf-8"><meta data-n-head="ssr" name="viewport" content="width=device-width,initial-scale=1"><meta data-n-head="ssr" data-hid="description" name="description" content="mise en place du temps réel avec nuxt/laravel"><link data-n-head="ssr" rel="icon" type="image/x-icon" href="/favicon.ico"><link rel="preload" href="/_nuxt/b50a4cf.js" as="script"><link rel="preload" href="/_nuxt/b69b31e.js" as="script"><link rel="preload" href="/_nuxt/001c78c.js" as="script"><link rel="preload" href="/_nuxt/654ffe2.js" as="script"><link rel="preload" href="/_nuxt/ab05ce0.js" as="script"><style data-vue-ssr-id="3191d5ad:0 932a8f60:0 6759f5ab:0">.nuxt-progress{position:fixed;top:0;left:0;right:0;height:2px;width:0;opacity:1;transition:width .1s,opacity .4s;background-color:#fff;z-index:999999}.nuxt-progress.nuxt-progress-notransition{transition:none}.nuxt-progress-failed{background-color:red}html{font-family:"Source Sans Pro",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;font-size:16px;word-spacing:1px;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;box-sizing:border-box}*,:after,:before{box-sizing:border-box;margin:0}.button--green{display:inline-block;border-radius:4px;border:1px solid #3b8070;color:#3b8070;text-decoration:none;padding:10px 30px}.button--green:hover{color:#fff;background-color:#3b8070}.button--grey{display:inline-block;border-radius:4px;border:1px solid #35495e;color:#35495e;text-decoration:none;padding:10px 30px;margin-left:15px}.button--grey:hover{color:#fff;background-color:#35495e}.titre-general{width:50%;margin:0 auto 50px;padding-bottom:20px;border:1px solid #000;border-top:none;font-size:40px;text-align:center}.pending{color:#ff4500}.disconnected{color:red}.connected{color:green}</style>
</head>
<body>
<div data-server-rendered="true" id="__nuxt"><!----><div id="__layout"><div><div><h1 class="titre-general">Statut du serveur Websocket</h1> <div style="text-align:center"><h2>Statut : <span class="pending" style="font-weight:700">pending</span></h2></div> <div style="margin-top:10px;text-align:center"><input value="user1@unice.fr"> <button>Se connecter</button></div> <div></div></div></div></div></div><script>window.__NUXT__=function(t){return{layout:"default",data:[{}],fetch:{},error:t,state:{auth:{user:t,loggedIn:!1,strategy:"local"}},serverRendered:!0,routePath:"/",config:{_app:{basePath:"/",assetsPath:"/_nuxt/",cdnURL:t}}}}(null)</script><script src="/_nuxt/b50a4cf.js" defer></script><script src="/_nuxt/ab05ce0.js" defer></script><script src="/_nuxt/b69b31e.js" defer></script><script src="/_nuxt/001c78c.js" defer></script><script src="/_nuxt/654ffe2.js" defer></script>
</body>
</html>

29
TD2/www/js/index.js Normal file
View File

@ -0,0 +1,29 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
// Wait for the deviceready event before using any of Cordova's device APIs.
// See https://cordova.apache.org/docs/en/latest/cordova/events/events.html#deviceready
document.addEventListener('deviceready', onDeviceReady, false);
function onDeviceReady() {
// Cordova is now initialized. Have fun!
console.log('Running cordova-' + cordova.platformId + '@' + cordova.version);
document.getElementById('deviceready').classList.add('ready');
}

13
TPnote/.gitignore vendored Normal file
View File

@ -0,0 +1,13 @@
### ApacheCordova ###
# Apache Cordova generated files and directories
bin/*
!/plugins
!/plugins/android.json
!/plugins/fetch.json
plugins/*
platforms/*
node_modules
www/index.js
js/**/*.js
js/**/*.js.map

3
TPnote/.idea/.gitignore generated vendored Normal file
View File

@ -0,0 +1,3 @@
# Default ignored files
/shelf/
/workspace.xml

14
TPnote/.idea/TD1.iml generated Normal file
View File

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="android" name="Android">
<configuration />
</facet>
</component>
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$" />
<orderEntry type="jdk" jdkName="Android API 33, extension level 3 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

8
TPnote/.idea/modules.xml generated Normal file
View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/TD1.iml" filepath="$PROJECT_DIR$/.idea/TD1.iml" />
</modules>
</component>
</project>

6
TPnote/.idea/vcs.xml generated Normal file
View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$/.." vcs="Git" />
</component>
</project>

11
TPnote/config.xml Normal file
View File

@ -0,0 +1,11 @@
<?xml version='1.0' encoding='utf-8'?>
<widget id="io.cordova.hellocordova" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>HelloCordova</name>
<description>Sample Apache Cordova App</description>
<author email="dev@cordova.apache.org" href="https://cordova.apache.org">
Apache Cordova Team
</author>
<content src="index.html" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
</widget>

1067
TPnote/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

39
TPnote/package.json Normal file
View File

@ -0,0 +1,39 @@
{
"name": "io.cordova.hellocordova",
"displayName": "HelloCordova",
"version": "1.0.0",
"description": "A sample Apache Cordova application that responds to the deviceready event.",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [
"ecosystem:cordova"
],
"author": "Apache Cordova Team",
"license": "Apache-2.0",
"devDependencies": {
"cordova-android": "^10.1.2",
"cordova-plugin-battery-status": "^2.0.3",
"cordova-plugin-camera": "^6.0.0",
"cordova-plugin-dialogs": "^2.0.2",
"cordova-plugin-geolocation": "^4.1.0",
"cordova-plugin-network-information": "^3.0.0"
},
"cordova": {
"platforms": [
"android"
],
"plugins": {
"cordova-plugin-geolocation": {
"GPS_REQUIRED": "true"
},
"cordova-plugin-camera": {
"ANDROIDX_CORE_VERSION": "1.6.+"
},
"cordova-plugin-network-information": {},
"cordova-plugin-dialogs": {},
"cordova-plugin-battery-status": {}
}
}
}

7
TPnote/www/css/bootstrap.min.css vendored Normal file

File diff suppressed because one or more lines are too long

126
TPnote/www/css/index.css Normal file
View File

@ -0,0 +1,126 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
* {
-webkit-tap-highlight-color: rgba(0,0,0,0); /* make transparent link selection, adjust last value opacity 0 to 1.0 */
}
body {
-webkit-touch-callout: none; /* prevent callout to copy image, etc when tap to hold */
-webkit-text-size-adjust: none; /* prevent webkit from resizing text to fit */
-webkit-user-select: none; /* prevent copy paste, to allow, change 'none' to 'text' */
background-color:#E4E4E4;
background-image:linear-gradient(to bottom, #A7A7A7 0%, #E4E4E4 51%);
font-family: system-ui, -apple-system, -apple-system-font, 'Segoe UI', 'Roboto', sans-serif;
font-size:12px;
height:100vh;
margin:0px;
padding:0px;
/* Padding to avoid the "unsafe" areas behind notches in the screen */
padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
text-transform:uppercase;
width:100%;
}
/* Portrait layout (default) */
.app {
background:url(../img/logo.png) no-repeat center top; /* 170px x 200px */
position:absolute; /* position in the center of the screen */
left:50%;
top:50%;
height:50px; /* text area height */
width:225px; /* text area width */
text-align:center;
padding:180px 0px 0px 0px; /* image height is 200px (bottom 20px are overlapped with text) */
margin:-115px 0px 0px -112px; /* offset vertical: half of image height and text area height */
/* offset horizontal: half of text area width */
}
/* Landscape layout (with min-width) */
@media screen and (min-aspect-ratio: 1/1) and (min-width:400px) {
.app {
background-position:left center;
padding:75px 0px 75px 170px; /* padding-top + padding-bottom + text area = image height */
margin:-90px 0px 0px -198px; /* offset vertical: half of image height */
/* offset horizontal: half of image width and text area width */
}
}
h1 {
font-size:24px;
font-weight:normal;
margin:0px;
overflow:visible;
padding:0px;
text-align:center;
}
.event {
border-radius:4px;
color:#FFFFFF;
font-size:12px;
margin:0px 30px;
padding:2px 0px;
}
.event.listening {
background-color:#333333;
display:block;
}
.event.received {
background-color:#4B946A;
display:none;
}
#deviceready.ready .event.listening { display: none; }
#deviceready.ready .event.received { display: block; }
@keyframes fade {
from { opacity: 1.0; }
50% { opacity: 0.4; }
to { opacity: 1.0; }
}
.blink {
animation:fade 3000ms infinite;
-webkit-animation:fade 3000ms infinite;
}
@media screen and (prefers-color-scheme: dark) {
body {
background-image:linear-gradient(to bottom, #585858 0%, #1B1B1B 51%);
}
}
#aj {
width: 50%;
margin-bottom: 15px;
}
#imgToReplace {
margin-top: 20px;
width: 50%;
display: none;
}
.btn {
margin: 5px 0;
}

BIN
TPnote/www/img/aj.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 684 KiB

BIN
TPnote/www/img/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

66
TPnote/www/index.html Normal file
View File

@ -0,0 +1,66 @@
<!DOCTYPE html>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<html>
<head>
<meta charset="utf-8">
<!--
Customize this policy to fit your own app's needs. For more guidance, please refer to the docs:
https://cordova.apache.org/docs/en/latest/
Some notes:
* https://ssl.gstatic.com is required only on Android and is needed for TalkBack to function properly
* Disables use of inline scripts in order to mitigate risk of XSS vulnerabilities. To change this:
* Enable inline JS: add 'unsafe-inline' to default-src
-->
<meta http-equiv="Content-Security-Policy" content="default-src 'self' data: https://ssl.gstatic.com 'unsafe-eval'; style-src 'self' 'unsafe-inline'; media-src *; img-src 'self' data: content:;">
<meta name="format-detection" content="telephone=no">
<meta name="msapplication-tap-highlight" content="no">
<meta name="viewport" content="initial-scale=1, width=device-width, viewport-fit=cover">
<meta name="color-scheme" content="light dark">
<link rel="stylesheet" href="css/index.css">
<link rel="stylesheet" href="css/bootstrap.min.css">
<!-- JavaScript Bundle with Popper -->
<script src="js/bootstrap.bundle.min.js"></script>
<title>Hello World</title>
</head>
<body>
<div>
<h1>Applejack is best pony</h1>
<div>
<img src="./img/aj.gif" width="100%" alt="aj" id="aj" class="mx-auto d-block" />
</div>
<div class="content justify-content-center">
<button class="btn btn-primary mx-auto d-block" id="takePicture">Camera</button>
<button class="btn btn-secondary mx-auto d-block" id="getPosition">Position</button>
<button class="btn btn-info mx-auto d-block" id="getCon">Est connecté ?</button>
<button class="btn btn-danger mx-auto d-block" id="getNotif">Notif</button>
<h2 style="color: white;">Batterie</h2>
<div class="progress">
<div id="batteryLevel" class="progress-bar progress-bar-striped" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width:0%"></div>
</div>
<div class="camera">
<img src="" alt=" " class="mx-auto d-block imgh" id="imgToReplace">
</div>
</div>
</div>
<script src="cordova.js"></script>
<script src="js/index.js"></script>
</body>
</html>

7
TPnote/www/js/bootstrap.bundle.min.js vendored Normal file

File diff suppressed because one or more lines are too long

154
TPnote/www/js/index.js Normal file
View File

@ -0,0 +1,154 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
// Wait for the deviceready event before using any of Cordova's device APIs.
// See https://cordova.apache.org/docs/en/latest/cordova/events/events.html#deviceready
document.addEventListener('deviceready', onDeviceReady, false);
function onDeviceReady() {
// Cordova is now initialized. Have fun!
console.log('Running cordova-' + cordova.platformId + '@' + cordova.version);
document.getElementById("takePicture").addEventListener("click", (e) => {
navigator.camera.getPicture(sucessCallbackImage,errorCallbackImage,{ quality: 50,
destinationType: Camera.DestinationType.DATA_URL
})
});
document.getElementById("getPosition").addEventListener("click", (e) => {
navigator.geolocation.watchPosition(sucessCallbackPos,errorCallbackPos,{})
});
var networkState = navigator.connection.type;
document.getElementById("getCon").addEventListener("click", (e) => {
let con = navigator.connection.type;
if(con == "none") {
errorCallbackCon();
} else {
sucessCallbackCon();
}
});
document.addEventListener("offline", decoNet, false);
document.getElementById("getNotif").addEventListener("click", (e) => {
sendnotif();
});
window.addEventListener('batterystatus', onBatteryStatus, false);
function onBatteryStatus(status) {
var batteryLevel = status.level;
//var batteryLevel = 4;
let bar = document.getElementById('batteryLevel');
/*
Pour les couleurs de batterie
100-96 : vert = batterie maximale
95-21 : bleu = batterie standard
20-6 : jaune = batterie faible
5-0 : rouge = batterie critique
*/
if(batteryLevel > 95) {
bar.classList.add('bg-success');
bar.classList.remove('bg-info');
} else if(batteryLevel > 20 && batteryLevel <= 95) {
bar.classList.remove('bg-success');
bar.classList.add('bg-info');
bar.classList.remove('bg-warning');
} else if(batteryLevel <= 20 && batteryLevel > 5) {
bar.classList.remove('bg-info');
bar.classList.add('bg-warning');
bar.classList.remove('bg-danger');
} else {
bar.classList.remove('bg-warning');
bar.classList.add('bg-danger');
}
document.querySelector("#batteryLevel").style.width = batteryLevel + "%";
document.querySelector("#batteryLevel").setAttribute("aria-valuenow", batteryLevel);
document.querySelector("#batteryLevel").innerHTML = batteryLevel + "%";
}
}
function sucessCallbackImage(imageData) {
//alert("Zipp is best princess !");
var image = document.getElementById('imgToReplace') ;
image.style.display = "block";
image.src = "data:image/jpeg;base64," + imageData;
}
function errorCallbackImage() {
alert("prout");
}
function sucessCallbackPos(position) {
alert('Latitude: ' + position.coords.latitude + '\n' +
'Longitude: ' + position.coords.longitude + '\n' +
'Altitude: ' + position.coords.altitude + '\n' +
'Timestamp: ' + new Date(position.timestamp) + '\n');
}
function errorCallbackPos() {
alert("proutPos");
}
function sucessCallbackCon() {
alert("Equestria.social reachable !");
let btn = document.getElementById('getCon');
btn.innerHTML = "Equestria.social Online";
btn.classList.remove("btn-info");
btn.classList.remove("btn-danger");
btn.classList.add("btn-success");
}
function errorCallbackCon() {
alert("Equestria.social unreachable !");
let btn = document.getElementById('getCon');
btn.innerHTML = "Equestria.social Offline";
btn.classList.remove("btn-info");
btn.classList.remove("btn-success");
btn.classList.add("btn-danger");
}
function decoNet() {
alert("Equestria.social : lost connexion");
let btn = document.getElementById('getCon');
btn.innerHTML = "Equestria.social Offline (Lost Connexion)";
btn.classList.remove("btn-info");
btn.classList.remove("btn-success");
btn.classList.add("btn-danger");
}
function sendnotif() {
navigator.notification.alert(
"Applejack is best pony !",
alertDismissed, // callback
);
}
function alertDismissed() {
}

1
client-ws Submodule

@ -0,0 +1 @@
Subproject commit 7bb61db5a98b291095ab888f256c7a48aac62dea