Compare commits
28 Commits
synchro-wi
...
80af7b029a
Author | SHA1 | Date | |
---|---|---|---|
80af7b029a | |||
4dd37cda7b | |||
ecf570ee87 | |||
d3f8d78b73 | |||
276a21b3a3 | |||
bd7c519426 | |||
e35bc4accf | |||
8429233511 | |||
bff6df4a35 | |||
0a87a3a0cb | |||
a5a934a108 | |||
876a925f79 | |||
5b06af2026 | |||
d8070b6260 | |||
ca9d3b2d98 | |||
92c26dab45 | |||
4da327413c | |||
8d8ea7adf3 | |||
ea34094d41 | |||
de54555d77 | |||
8f7e94e482 | |||
952121b1d2 | |||
5cb0055bee | |||
af9b97596f | |||
f911853410 | |||
79c241eb27 | |||
d628afbc68 | |||
849a8f3629 |
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
.DS_Store
|
||||
.history/
|
10
.htaccess
10
.htaccess
@ -1 +1,9 @@
|
||||
Options -Indexes
|
||||
RewriteEngine On
|
||||
|
||||
# browser requests PHP
|
||||
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^\ ]+)\.php
|
||||
RewriteRule ^/?(.*)\.php$ /$1 [L,R=301]
|
||||
|
||||
# check to see if the request is for a PHP file:
|
||||
RewriteCond %{REQUEST_FILENAME}\.php -f
|
||||
RewriteRule ^/?(.*)$ /$1.php [L]
|
25
anthologie.php
Normal file
25
anthologie.php
Normal file
@ -0,0 +1,25 @@
|
||||
<?php require_once './parts/head.php'; ?>
|
||||
|
||||
<body>
|
||||
<?php require_once './parts/header.php'; ?>
|
||||
<!-- Anthology -->
|
||||
<div id="anthology">
|
||||
<h3 id="anthologyTitle" style="text-align:center">Anthologie</h3>
|
||||
<br><br>
|
||||
<small><em id="anthologyDisclaimer">Si vous souhaitez supprimer un message/poème public, merci de le faire savoir à <a href="mailto:contact@avion-poe.me">contact@avion-poe.me</a></em></small>
|
||||
<br><br><br><br>
|
||||
<div id="anthologyItems">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="backToMap">
|
||||
<p style="text-align:center"><a id="closeAnthologyAbout" href="/">Retour à la carte</a></p>
|
||||
</div>
|
||||
|
||||
<div id="map" style="display:none"></div>
|
||||
|
||||
<script src="src/anthology.js"></script>
|
||||
<script src="src/translation.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
26
apropos.php
Normal file
26
apropos.php
Normal file
@ -0,0 +1,26 @@
|
||||
<?php require_once './parts/head.php'; ?>
|
||||
|
||||
<body>
|
||||
<?php require_once './parts/header.php'; ?>
|
||||
|
||||
<!-- About -->
|
||||
<div id="about">
|
||||
<h3 id="aboutTitle" style="text-align:center">A propos</h3><br><br>
|
||||
<p id="aboutText">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
|
||||
<p><b id="librairies">Librairies utilisées</b></p>
|
||||
<p><small><a href="https://getbootstrap.com/">Bootstrap</a> | <a href="https://jquery.com/">jQuery</a> | <a href="https://leafletjs.com/">Leaflet</a> | <a href="https://github.com/Leaflet/Leaflet.fullscreen">Leaflet.fullscreen</a> | <a href="https://github.com/domoritz/leaflet-locatecontrol">Leaflet-locatecontrol</a> | <a href="https://github.com/manubb/Leaflet.PixiOverlay">Leaflet.PixiOverlay</a> | <a href="https://github.com/joergdietrich/Leaflet.Terminator">Leaflet.Terminator</a> | <a href="https://momentjs.com/">Moment.js</a> | <a href="https://www.pixijs.com/">PixiJS</a> | <a href="https://popper.js.org/">Popper</a> | <a href="https://quilljs.com/">Quill</a> | <a href="https://cburgmer.github.io/rasterizeHTML.js/">RasterizeHTML.js</a> | <a href="https://turfjs.org/">Turf.js</a> | <a href="https://github.com/RemiKoutcherawy/OriSim3D-JS">OriSim3D-JS</a> | <a href="https://www.geonames.org/export/web-services.html">Geonames</a></small></p>
|
||||
<p><b id="mapSources">Sources de la carte</b></p>
|
||||
<ul>
|
||||
<li><span id="mapBackground">Fond de carte </span>:<small> <a href="https://www.arcgis.com/home/item.html?id=10df2279f9684e4a9f6a7f08febac2a9">World Imagery</a> Tiles © Esri — Source: Esri, i-cubed, USDA, USGS, AEX, GeoEye, Getmapping, Aerogrid, IGN, IGP, UPR-EGP, and the GIS User Community.</small></li>
|
||||
<li><span id="clouds">Nuages </span>:<small> Imagery provided by services from the Global Imagery Browse Services (GIBS), operated by the NASA/GSFC/Earth Science Data and Information System (<a href="https://earthdata.nasa.gov">ESDIS</a>) with funding provided by NASA/HQ.</small></li>
|
||||
</ul>
|
||||
<br>
|
||||
<br>
|
||||
</div>
|
||||
<div id="backToMap">
|
||||
<p style="text-align:center"><a id="closeAnthologyAbout" href="/">Retour à la carte</a></p>
|
||||
</div>
|
||||
|
||||
<script src="src/anthology.js"></script>
|
||||
<script src="src/translation.js"></script>
|
||||
</body>
|
@ -1,37 +1,31 @@
|
||||
<?php
|
||||
require_once 'session_init.php';
|
||||
require_once 'config.inc.php';
|
||||
require_once 'db.class.php';
|
||||
require_once 'log.php';
|
||||
require_once 'fonctions.inc.php';
|
||||
require_once 'session_init.php';
|
||||
require_once 'config.inc.php';
|
||||
require_once 'db.class.php';
|
||||
require_once 'log.php';
|
||||
require_once 'fonctions.inc.php';
|
||||
|
||||
$table=array("message", "expeMail", "expeKnown", "expeLang", "destLang", "startLat", "startLon", "startName", "startTime", "startTZ", "destMail", "destLat", "destLon", "destName", "public", "color", "deliveryTime", "deliveryTZ", "deliveryTimeServer", "deliveryMethod");
|
||||
$table = array("message", "expeMail", "expeKnown", "expeLang", "destLang", "startLat", "startLon", "startName", "startTime", "startTZ", "destMail", "destLat", "destLon", "destName", "public", "color", "deliveryTime", "deliveryTZ", "deliveryTimeServer", "deliveryMethod");
|
||||
|
||||
$db = new db();
|
||||
//$db->open();
|
||||
$db = new db();
|
||||
//$db->open();
|
||||
|
||||
foreach ($table as $var)
|
||||
{
|
||||
if ( getpost( $var ) != null )
|
||||
{
|
||||
$r = getpost( $var );
|
||||
/*if ( $r == "true")
|
||||
foreach ($table as $var) {
|
||||
if (getpost($var) != null) {
|
||||
$r = getpost($var);
|
||||
/*if ( $r == "true")
|
||||
{
|
||||
$r = 1;
|
||||
}elseif( $r ="false")*/
|
||||
$db->$var = trim($r, ' \"');
|
||||
}else
|
||||
{
|
||||
$erreur[] = $var;
|
||||
}
|
||||
$db->$var = trim($r, ' \"');
|
||||
} else {
|
||||
$erreur[] = $var;
|
||||
}
|
||||
if (!empty ($erreur))
|
||||
{
|
||||
echo json_encode($erreur);
|
||||
log_error("erreur lors de l'acquisition des données:" . EOLH . print_r($erreur, true));
|
||||
}else
|
||||
{
|
||||
$db->newPlane();
|
||||
}
|
||||
$db->close();
|
||||
?>
|
||||
}
|
||||
if (!empty($erreur)) {
|
||||
echo json_encode($erreur);
|
||||
log_error("erreur lors de l'acquisition des données:" . EOLH . print_r($erreur, true));
|
||||
} else {
|
||||
$db->newPlane();
|
||||
}
|
||||
$db->close();
|
||||
|
61
cron.php
61
cron.php
@ -1,5 +1,6 @@
|
||||
<?php
|
||||
//chdir('/var/www/html/avion-poeme/');
|
||||
|
||||
require_once 'session_init.php';
|
||||
require_once 'config.inc.php';
|
||||
require_once 'db.class.php';
|
||||
@ -9,14 +10,15 @@
|
||||
$db = new db();
|
||||
//test();
|
||||
$_SERVER["PHP_AUTH_USER"] = "cron";
|
||||
//peripetieDatee();
|
||||
print "envoi des courriers en attente" . EOLH;
|
||||
//peripetieDatee(); // désactivée pour l'instant
|
||||
envoiCourrielEnattente();
|
||||
print "envoi des péripéties" . EOLH;
|
||||
peripeties();
|
||||
//peripeties();
|
||||
print "Envoi des arrivées" . EOLH;
|
||||
arrivee();
|
||||
anonymisation();
|
||||
|
||||
################################### FONCTIONS #################################""
|
||||
function peripetieDatee()
|
||||
{
|
||||
global $db;
|
||||
@ -40,9 +42,9 @@
|
||||
$mailText = $dicoExpe[$p['indexText']] .EOL .EOL ;
|
||||
print $objetMail . EOLH;
|
||||
print $mailText . EOLH;
|
||||
envoiMail( $result['destMail'], $objetMail, $mailText, false);
|
||||
envoiMail($result['expeMail'], $result['destMail'], $objetMail, $mailText, false);
|
||||
sleep(1);
|
||||
envoiMail( $result['expeMail'], $objetMail, $mailText, true);
|
||||
envoiMail("contact@avion-poe.me", $result['expeMail'], $objetMail, $mailText, true);
|
||||
sleep(1);
|
||||
}
|
||||
}
|
||||
@ -60,6 +62,7 @@
|
||||
$dbPeripetie->query($query);
|
||||
$peripeties = $dbPeripetie->result->fetch_all(MYSQLI_ASSOC);
|
||||
$dbPeripetie->close();
|
||||
//print_r($peripeties);
|
||||
foreach ( $peripeties as $peripetie)
|
||||
{
|
||||
print "péripétie " . $peripetie["idAP"] . " - avion poème n° " . $peripetie['idAvion'] .EOLH;
|
||||
@ -75,11 +78,15 @@
|
||||
$dicoExpe = getLang( $db->expeLang );
|
||||
$dicoDest = getLang( $db->destLang );
|
||||
// TODO calcul de la nouvelle date d'arrivée
|
||||
$dateExpe = new DateTime("@$db->startTime");
|
||||
$dateDest = new DateTime("@$db->deliveryTime");
|
||||
$startTime = date("c", $db->startTime);
|
||||
$deliveryTime = date("c", $db->deliveryTime);
|
||||
$dateExpe = new DateTime($startTime);
|
||||
print_r($dateExpe);
|
||||
$dateDest = new DateTime($deliveryTime);
|
||||
print_r($dateDest);
|
||||
$interval = $dateExpe->diff($dateDest);
|
||||
$numericInterval = (($interval->days*24 + $interval->h)*60 + $interval->i)*60 + $interval->s;
|
||||
$addDate = $numericInterval * 15/100;
|
||||
$addDate = $numericInterval * 15/100; //TODO calculer d'après les données de la péripétie(voir table péripétie de la base de données)
|
||||
$db->deliveryTime += $addDate;
|
||||
$db->deliveryTimeServer += $addDate;
|
||||
$query = "UPDATE avionpoeme SET deliveryTime=FROM_UNIXTIME(" . $db->deliveryTime . "), deliveryTimeServer=FROM_UNIXTIME(" . $db->deliveryTimeServer . ") WHERE idAvion='" . $peripetie['idAvion'] . "'" ;
|
||||
@ -94,24 +101,23 @@
|
||||
//$html = $result['html'];
|
||||
sleep(1);
|
||||
print "envoi courriel à l'expéditeur : " . $db->expeMail . EOLH . $mailText .EOLH;
|
||||
$r = envoiMail( $db->expeMail, $objetMail, $mailText);
|
||||
$r = envoiMail("contact@avion-poe.me", $db->expeMail, $objetMail, $mailText);
|
||||
$db->datePeripetie = formatteDate($db->destLang, $db->deliveryTime, $db->deliveryTZ);
|
||||
$result = replaceVariables($db, $dicoDest["Objet_" . $peripetie['indexText']], $dicoDest);
|
||||
$objetMail = $result["text"];
|
||||
$result = replaceVariables($db, $dicoDest[$peripetie['indexText']], $dicoDest);
|
||||
$mailText = $result["text"];
|
||||
print "envoi courriel au destinataire : " . $db->destMail . EOLH . $mailText .EOLH;
|
||||
$s = envoiMail( $db->destMail, $objetMail, $mailText);
|
||||
$s = envoiMail($db->expeMail, $db->destMail, $objetMail, $mailText);
|
||||
sleep(1);
|
||||
//print "r=" . $r ." => s=" .$s .EOLH;
|
||||
|
||||
if ($r AND $s)
|
||||
{
|
||||
$query = "UPDATE avionPeripetie SET mailSent=true WHERE idAP='" . $peripetie['idAP'] ."'";
|
||||
$db->query($query);
|
||||
}else
|
||||
{
|
||||
print "table avion péripétie non mise à jour" .EOL;
|
||||
print "table avion péripétie non mise à jour" . EOL;
|
||||
print "UPDATE avionPeripetie SET mailSent=true WHERE idAP='" . $peripetie['idAP'] ."'" .EOLH;
|
||||
}
|
||||
|
||||
@ -130,10 +136,10 @@
|
||||
$query = "SELECT * FROM avionpoeme WHERE atteri = 0 AND TIMEDIFF(CONCAT_WS(' ',CURDATE(),CURTIME()),deliveryTimeServer) > '00:00'";
|
||||
$db->query($query);
|
||||
$avionArrive = $db->result->fetch_all(MYSQLI_ASSOC);
|
||||
var_dump($avionArrive);
|
||||
//var_dump($avionArrive);
|
||||
foreach ($avionArrive as $avion)
|
||||
{
|
||||
print "avion poème n° " . $avion['idAvion'] . "a atterri" . EOLH;
|
||||
print "avion poème n° " . $avion['idAvion'] . " a atterri" . EOLH;
|
||||
$dicoExpe = getLang( $avion['expeLang'] );
|
||||
$dicoDest = getLang( $avion['destLang'] );
|
||||
|
||||
@ -144,7 +150,7 @@
|
||||
$result = replaceVariables((object)$avion, $dicoExpe[$index], $dicoExpe);
|
||||
$mailText= $result["text"];
|
||||
print "envoi courriel à l'expéditeur : " . $avion['expeMail'] . EOLH . $mailText .EOLH;
|
||||
$r = envoiMail( $avion['expeMail'], $objetMail["text"], $mailText);
|
||||
$r = envoiMail("contact@avion-poe.me", $avion['expeMail'], $objetMail["text"], $mailText);
|
||||
|
||||
//envoi notification arrivée destinataire
|
||||
$index = "Notification_Arrivee_Destinataire";
|
||||
@ -157,14 +163,14 @@
|
||||
$mailText = "<html><head></head>\n<body>" . $mailText . "</body></html>";
|
||||
}
|
||||
print "envoi courriel au destinataire : " . $avion['destMail'] . EOLH . $mailText .EOLH;
|
||||
sleep(1);
|
||||
$s = envoiMail( $avion['destMail'], $objetMail["text"], $mailText, $html);
|
||||
sleep(3);
|
||||
$s = envoiMail($avion['expeMail'], $avion['destMail'], $objetMail["text"], $mailText, $html);
|
||||
if ($r AND $s)
|
||||
{
|
||||
$query = "UPDATE avionpoeme SET atteri=true WHERE idAvion='" . $avion['idAvion'] ."'";
|
||||
$db->query($query);
|
||||
}
|
||||
sleep(1);
|
||||
sleep(3);
|
||||
}
|
||||
}
|
||||
|
||||
@ -176,13 +182,14 @@
|
||||
$courriels = $db->result->fetch_all(MYSQLI_ASSOC);
|
||||
foreach( $courriels as $courriel)
|
||||
{
|
||||
$r = envoiMail( $courriel['destinataire'], $courriel['objet'], $courriel['message'], $courriel['html']);
|
||||
//TODO changer l'expéditeur, doit être l'expéditeur de l'avion-poême.
|
||||
$r = envoiMail("contact@avion-poe.me", $courriel['destinataire'], $courriel['objet'], $courriel['message'], $courriel['html']);
|
||||
if ($r)
|
||||
{
|
||||
$query = "DELETE FROM courriels WHERE id='" . $courriel['id'] . "'";
|
||||
$db->query($query);
|
||||
}
|
||||
sleep(1);
|
||||
sleep(3);
|
||||
}
|
||||
}
|
||||
|
||||
@ -196,5 +203,19 @@
|
||||
print json_last_error_msg() .EOLH;
|
||||
}
|
||||
}
|
||||
|
||||
function anonymisation()
|
||||
{
|
||||
global $db;
|
||||
$query = "SELECT idAvion FROM avionpoeme WHERE atteri = 1 AND public = 0 AND DATEDIFF(CONCAT_WS(' ',CURDATE(),CURTIME()),deliveryTimeServer) > '7'";
|
||||
$db->query($query);
|
||||
$avionArrive = $db->result->fetch_all(MYSQLI_ASSOC);
|
||||
//print_r($avionArrive);
|
||||
foreach($avionArrive as $avion)
|
||||
{
|
||||
$query = "UPDATE avionpoeme SET message='', expeMail='', destMail='' WHERE idAvion='" . $avion['idAvion'] ."'";
|
||||
$db->query($query);
|
||||
}
|
||||
}
|
||||
$db->close();
|
||||
?>
|
||||
|
54004
dist/html2pdf/html2pdf.bundle.min.js
vendored
Normal file
54004
dist/html2pdf/html2pdf.bundle.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
@ -67,15 +67,22 @@ function verifPeripetieAvion()
|
||||
$db->query($query);
|
||||
$avions = $db->result->fetch_all(MYSQLI_ASSOC);
|
||||
$avionsId = array_column($avions, 'expeMail', 'idAvion');
|
||||
print_r($avionsId);
|
||||
//print_r($avionsId);
|
||||
$flag = false;
|
||||
foreach($peripeties as $peripetie)
|
||||
{
|
||||
print "Péripétie " . $peripetie["idAP"] . EOLH;
|
||||
//print "Péripétie " . $peripetie["idAP"] . EOLH;
|
||||
$idAvion = $peripetie["idAvion"];
|
||||
if ( empty($avionsId[$idAvion]) )
|
||||
{
|
||||
print "Péripétie " . $peripetie["idAP"] . " n'a pas d'avion poème idAvion=>" . $idAvion . EOLH;
|
||||
$flag = true;
|
||||
}
|
||||
|
||||
}
|
||||
if ( ! $flag )
|
||||
{
|
||||
print "Aucune erreur détectée";
|
||||
}
|
||||
$db->close();
|
||||
}
|
||||
|
@ -30,6 +30,7 @@
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<a href="stats.php">Statistiques</a><br>
|
||||
<a href="lang.php">Générer les fichiers de langue</a><br>
|
||||
<a href="logs.php">Lire les logs</a><br>
|
||||
<a href="gestionDB.php">Vérifier la base de données</a><br>
|
||||
|
@ -14,6 +14,7 @@
|
||||
$result = $db->result->fetch_assoc();
|
||||
return $result['Auto_increment']-1;
|
||||
}
|
||||
|
||||
function total() //nombre d'avions poèmes présents dans la base
|
||||
{
|
||||
global $db;
|
||||
@ -27,26 +28,42 @@
|
||||
function totalenvol() //nombre d'avions poèmes en vol
|
||||
{
|
||||
global $db;
|
||||
$query = "SELECT COUNT(*) as n FROM avionpoeme WHERE public!=2";
|
||||
$query = "SELECT COUNT(*) as n FROM avionpoeme WHERE atteri!=1";
|
||||
$db->query($query);
|
||||
$result = $db->result->fetch_assoc();
|
||||
return $result["n"];
|
||||
}
|
||||
|
||||
function alea()
|
||||
function alea($nAvionEnvoye)
|
||||
{
|
||||
global $db;
|
||||
$query = "SELECT COUNT(*) as nAvion FROM avionpoeme WHERE ";
|
||||
$query = "SELECT DISTINCT deliveryMethod FROM avionpoeme";
|
||||
$db->query($query);
|
||||
$result = $db->result->fetch_assoc();
|
||||
return $result["n"];
|
||||
|
||||
$result = $db->result->fetch_all(MYSQLI_ASSOC);
|
||||
//var_dump($result);
|
||||
foreach ( $result as $method )
|
||||
{
|
||||
$query = "SELECT COUNT(*) as nAvion FROM avionpoeme WHERE deliveryMethod='" . $method["deliveryMethod"] . "'";
|
||||
$db->query($query);
|
||||
$result = $db->result->fetch_assoc();
|
||||
echo "Méthode => " . $method["deliveryMethod"] . " nombre d'avion poèmes => " . $result["nAvion"] . " => " . round($result["nAvion"]/$nAvionEnvoye*100,2) . "%" . EOLH;
|
||||
}
|
||||
}
|
||||
|
||||
function anonymous() //nombre d'avions poèmes envoyés anonymement
|
||||
{
|
||||
global $db;
|
||||
$query = "SELECT COUNT(*) as n FROM avionpoeme WHERE expemail=''";
|
||||
$query = "SELECT COUNT(*) as n FROM avionpoeme WHERE expeknown='0'";
|
||||
$db->query($query);
|
||||
$result = $db->result->fetch_assoc();
|
||||
return $result["n"];
|
||||
|
||||
}
|
||||
|
||||
function deleted()
|
||||
{
|
||||
global $db;
|
||||
$query = "SELECT COUNT(*) as n FROM avionpoeme WHERE public='2'";
|
||||
$db->query($query);
|
||||
$result = $db->result->fetch_assoc();
|
||||
return $result["n"];
|
||||
@ -63,11 +80,14 @@
|
||||
echo "Nombre total d'avions-poème : " . $nAvionEnvoye . EOLH;
|
||||
$total = total();
|
||||
$avionSupp = $nAvionEnvoye-$total;
|
||||
echo "Nombre d'avion supprimés : " . $avionSupp . " => " . round($avionSupp/$nAvionEnvoye*100,3) . "%" . EOLH;
|
||||
echo "Nombre d'avion supprimés : " . $avionSupp . " => " . round($avionSupp/$nAvionEnvoye*100,2) . "%" . EOLH;
|
||||
$nAvionenvol = totalenvol();
|
||||
echo "Nombre d'avions-poème en vol : " . $nAvionenvol . " => " . round($nAvionenvol/$nAvionEnvoye*100) . "%" . EOLH;
|
||||
echo "Nombre d'avions-poème en vol : " . $nAvionenvol . " => " . round($nAvionenvol/$nAvionEnvoye*100,2) . "%" . EOLH;
|
||||
$anonymous = anonymous();
|
||||
echo "Nombre d'envois anonymes : " . $anonymous . " => " . round($anonymous/$nAvionEnvoye*100) . "%" . EOLH;
|
||||
echo "Nombre d'envois anonymes : " . $anonymous . " => " . round($anonymous/$nAvionEnvoye*100,2) . "%" . EOLH;
|
||||
$deleted = deleted();
|
||||
echo "Nombre d'avions anonymisés(effacés) : " . $deleted . " => " . round($deleted/$nAvionEnvoye*100,2) . "%" . EOLH;
|
||||
alea($nAvionEnvoye);
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,31 +1,39 @@
|
||||
<?php
|
||||
|
||||
define( 'EOL', "\n" );
|
||||
define( 'EOLH', "<br>\n" );
|
||||
define( 'LF', "\r\n" );
|
||||
define( 'TAB', "\t" );
|
||||
define('EOL', "\n");
|
||||
define('EOLH', "<br>\n");
|
||||
define('LF', "\r\n");
|
||||
define('TAB', "\t");
|
||||
|
||||
//constantes des niveaux de log
|
||||
define( "INFO", 1 );
|
||||
define( "ALERT", 2 );
|
||||
define( "ERROR", 3 );
|
||||
define("INFO", 1);
|
||||
define("ALERT", 2);
|
||||
define("ERROR", 3);
|
||||
|
||||
define( "RESULTS_BY_PAGE", 20 ); //Nombre de ligne d'anthologie par page
|
||||
define( "DATE_MYSQL", "Y-m-d H:i:s" );
|
||||
define("RESULTS_BY_PAGE", 20); //Nombre de ligne d'anthologie par page
|
||||
define("DATE_MYSQL", "Y-m-d H:i:s");
|
||||
|
||||
//variables diverses
|
||||
$admin = "Daniel";
|
||||
$webmaster = "dtux@free.fr";
|
||||
$site = "Avion Poème";
|
||||
$dossier = "/www";
|
||||
$basedir = dirname( $_SERVER['DOCUMENT_ROOT'] ) . $dossier;
|
||||
$basedir = dirname($_SERVER['DOCUMENT_ROOT']) . $dossier;
|
||||
|
||||
$testMode = true;
|
||||
|
||||
if ($testMode)
|
||||
{
|
||||
$base_url = "https://avion-poe.me";
|
||||
$base_path = "/flex/storage/avion-poe.me/site/www/";
|
||||
}else
|
||||
{
|
||||
$base_url = "https://dev.avion-poe.me";
|
||||
$base_path = "/flex/storage/avion-poe.me/site/dev/";
|
||||
}
|
||||
|
||||
$base_url = "http://avion-poe.me";
|
||||
$base_path = "/flex/storage/avion-poe.me/site/www/";
|
||||
$url_admin = $base_url . "/gestion";
|
||||
$accueil = $base_url . "/index.html";
|
||||
if (empty( $_SERVER["PHP_AUTH_USER"]))
|
||||
{
|
||||
if (empty($_SERVER["PHP_AUTH_USER"])) {
|
||||
$_SERVER["PHP_AUTH_USER"] = 'script';
|
||||
}
|
||||
?>
|
||||
|
@ -1,25 +1,23 @@
|
||||
<?php
|
||||
if ( !isset($site) )
|
||||
{
|
||||
require_once( "config.inc.php" );
|
||||
header( 'Location: ' . $accueil );
|
||||
if (!isset($site)) {
|
||||
require_once("config.inc.php");
|
||||
header('Location: ' . $accueil);
|
||||
}
|
||||
|
||||
require_once "config.inc.php";
|
||||
require_once "log.php";
|
||||
require_once "fonctions.inc.php";
|
||||
require_once "envoi_courriel.inc.php";
|
||||
|
||||
$table_prefix = "";
|
||||
class db
|
||||
{
|
||||
private $server = "db351634-avionpoeme.sql-pro.online.net";
|
||||
private $port = 3306;
|
||||
private $user = "db120904";
|
||||
private $passwd = "AvionPoème*DB";
|
||||
private $database = "db351634_avionpoeme";
|
||||
public $connect;
|
||||
public $result;
|
||||
private $server = "db351634-avionpoeme.sql-pro.online.net";
|
||||
private $port = 3306;
|
||||
private $user = "db120904";
|
||||
private $passwd = "AvionPoème*DB";
|
||||
private $database = "db351634_avionpoeme";
|
||||
public $connect;
|
||||
public $result;
|
||||
// avion
|
||||
public $uid;
|
||||
public $message;
|
||||
@ -52,52 +50,54 @@ class db
|
||||
public $datePeripetie;
|
||||
public $effetPeripetie;
|
||||
|
||||
function __construct()
|
||||
{
|
||||
$this->open();
|
||||
}
|
||||
function __construct()
|
||||
{
|
||||
$this->open();
|
||||
}
|
||||
|
||||
function open()
|
||||
{
|
||||
if ( !$this->connect )
|
||||
{
|
||||
$this->connect = new mysqli( $this->server, $this->user, $this->passwd, $this->database );
|
||||
if ( $this->connect->connect_errno )
|
||||
{
|
||||
log_error( "Échec de la connexion : => " . $this->connect->connect_error . "<br />" . __file__ . ' ligne ' . __line__, false,false);
|
||||
function open()
|
||||
{
|
||||
if (!$this->connect) {
|
||||
$this->connect = new mysqli($this->server, $this->user, $this->passwd, $this->database);
|
||||
if ($this->connect->connect_errno) {
|
||||
log_error("Échec de la connexion : => " . $this->connect->connect_error . "<br />" . __file__ . ' ligne ' . __line__, false, false);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
$this->connect->set_charset("utf8");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
function close()
|
||||
{
|
||||
$this->connect->close();
|
||||
$this->connect = 0;
|
||||
}
|
||||
function close()
|
||||
{
|
||||
$this->connect->close();
|
||||
$this->connect = 0;
|
||||
}
|
||||
|
||||
function protect( $string )
|
||||
{
|
||||
return $this->connect->real_escape_string( $string );
|
||||
}
|
||||
function protect($string)
|
||||
{
|
||||
return $this->connect->real_escape_string($string);
|
||||
}
|
||||
|
||||
function query( $string )
|
||||
function query($string)
|
||||
{
|
||||
|
||||
//log_write( $string );
|
||||
if ( empty( $this->connect ) ) $this->open();
|
||||
if (empty($this->connect)) $this->open();
|
||||
|
||||
$this->result = $this->connect->query( $string ) ;
|
||||
$this->result = $this->connect->query($string);
|
||||
|
||||
if ( $this->connect->errno > 0 ) log_error( "Échec de la commande query => " . $this->connect->error . "<br />" . __file__ . ' ligne ' . __line__ . "\n" . $string, true, false);
|
||||
if ($this->connect->errno > 0) log_error("Échec de la commande query => " . $this->connect->error . "<br />" . __file__ . ' ligne ' . __line__ . "\n" . $string, true, false);
|
||||
//print_r( $this );
|
||||
}
|
||||
}
|
||||
|
||||
function newPlane() //return 0 on error
|
||||
{
|
||||
function newPlane() //return 0 on error
|
||||
{
|
||||
global $base_url;
|
||||
if (round($this->startLat, 3, PHP_ROUND_HALF_DOWN) == round($this->destLat, 3, PHP_ROUND_HALF_DOWN) && round($this->startLon, 3, PHP_ROUND_HALF_DOWN) == round($this->destLon, 3, PHP_ROUND_HALF_DOWN)) {
|
||||
$this->destLon += 0.001;
|
||||
$this->destLat += 0.001;
|
||||
}
|
||||
$query = "INSERT INTO avionpoeme VALUES ('0','";
|
||||
$query .= $this->protect($this->message) . "', '";
|
||||
$query .= $this->protect($this->expeMail) . "', ";
|
||||
@ -123,18 +123,17 @@ class db
|
||||
$this->query($query);
|
||||
$this->uid = $this->connect->insert_id;
|
||||
echo "{'uid':'" . $this->uid . "'}";
|
||||
$this->startTimeRFC822 = formatteDate( $this->expeLang, $this->startTime, $this->startTZ);
|
||||
$this->deliveryTimeRFC822 = formatteDate( $this->destLang, $this->deliveryTime, $this->deliveryTZ );
|
||||
$this->startTimeRFC822 = formatteDate($this->expeLang, $this->startTime, $this->startTZ);
|
||||
$this->deliveryTimeRFC822 = formatteDate($this->destLang, $this->deliveryTime, $this->deliveryTZ);
|
||||
$this->urlAvion = $base_url . "/?avionpoeme=" . $this->uid;
|
||||
$this->newPeripetie();
|
||||
courrielEnvoi($this);
|
||||
|
||||
}
|
||||
|
||||
function getPlane($uid)
|
||||
{
|
||||
global $base_url;
|
||||
$query = "SELECT idAvion, message, expeMail, expeKnown, expeLang, destLang, startLat, startLon, startName, UNIX_TIMESTAMP(startTime) as startTime, startTZ, destMail, destLat, destLon, destName, color, UNIX_TIMESTAMP(deliveryTime) as deliveryTime, deliveryTZ, UNIX_TIMESTAMP(deliveryTimeServer) as deliveryTimeServer, deliveryMethod, public FROM avionpoeme WHERE idAvion='" . $uid ."'";
|
||||
$query = "SELECT idAvion, message, expeMail, expeKnown, expeLang, destLang, startLat, startLon, startName, UNIX_TIMESTAMP(startTime) as startTime, startTZ, destMail, destLat, destLon, destName, color, UNIX_TIMESTAMP(deliveryTime) as deliveryTime, deliveryTZ, UNIX_TIMESTAMP(deliveryTimeServer) as deliveryTimeServer, deliveryMethod, public FROM avionpoeme WHERE idAvion='" . $uid . "'";
|
||||
$this->query($query);
|
||||
$plane = $this->result->fetch_array(MYSQLI_ASSOC);
|
||||
$this->message = $plane["message"];
|
||||
@ -147,7 +146,7 @@ class db
|
||||
$this->startName = $plane["startName"];
|
||||
$this->startTime = $plane["startTime"];
|
||||
$this->startTZ = $plane["startTZ"];
|
||||
$this->startTimeRFC822 = formatteDate( $this->expeLang, $this->startTime, $this->startTZ);
|
||||
$this->startTimeRFC822 = formatteDate($this->expeLang, $this->startTime, $this->startTZ);
|
||||
$this->destMail = $plane["destMail"];
|
||||
$this->destLat = $plane["destLat"];
|
||||
$this->destLon = $plane["destLon"];
|
||||
@ -155,7 +154,7 @@ class db
|
||||
$this->color = $plane["color"];
|
||||
$this->deliveryTime = $plane["deliveryTime"];
|
||||
$this->deliveryTZ = $plane["deliveryTZ"];
|
||||
$this->deliveryTimeRFC822 = formatteDate( $this->destLang, $this->deliveryTime, $this->deliveryTZ );
|
||||
$this->deliveryTimeRFC822 = formatteDate($this->destLang, $this->deliveryTime, $this->deliveryTZ);
|
||||
$this->deliveryTimeServer = $plane["deliveryTimeServer"];
|
||||
$this->deliveryMethod = $plane["deliveryMethod"];
|
||||
$this->public = $plane["public"];
|
||||
@ -163,9 +162,9 @@ class db
|
||||
$this->urlAvion = $base_url . "/?avionpoeme=" . $this->uid;
|
||||
}
|
||||
|
||||
function getCurrentPlanes()
|
||||
{
|
||||
$query = "SELECT idAvion as uid, UNIX_TIMESTAMP(deliveryTime) as deliveryTime, deliveryTZ, destLat, destLon, destName, UNIX_TIMESTAMP(startTime) as startTime, startTZ, startLon, startLat, startName, color FROM avionpoeme WHERE deliveryTimeServer>NOW()";
|
||||
function getCurrentPlanes()
|
||||
{
|
||||
$query = "SELECT idAvion as uid, UNIX_TIMESTAMP(deliveryTime) as deliveryTime, deliveryTZ, destLat, destLon, destName, destMail, message, expeMail, deliveryTimeServer, deliveryMethod, UNIX_TIMESTAMP(startTime) as startTime, startTZ, startLon, startLat, startName, color, message FROM avionpoeme WHERE deliveryTimeServer>NOW()";
|
||||
$this->query($query);
|
||||
$planes = $this->result->fetch_all(MYSQLI_ASSOC);
|
||||
print json_encode($planes);
|
||||
@ -173,20 +172,20 @@ class db
|
||||
return $planes;
|
||||
}
|
||||
|
||||
function getAnthology($page=0)
|
||||
function getAnthology($page = 0)
|
||||
{
|
||||
$query = "SELECT COUNT(*) as count FROM avionpoeme WHERE deliveryTimeServer<NOW() AND public='1'";
|
||||
$this->query($query);
|
||||
$result = $this->result->fetch_assoc();
|
||||
$n_pages = floor(($result["count"] / RESULTS_BY_PAGE))+1;
|
||||
$n_pages = floor(($result["count"] / RESULTS_BY_PAGE)) + 1;
|
||||
if ($page <= 0) //renvoie le nombre de ligne d'anthologie
|
||||
{
|
||||
print '{"nAnthology":"' . $result["count"] . '","nPages":"' . $n_pages .'"}';
|
||||
print '{"nAnthology":"' . $result["count"] . '","nPages":"' . $n_pages . '"}';
|
||||
return $n_pages;
|
||||
}else //renvoie les lignes d'anthologie
|
||||
} else //renvoie les lignes d'anthologie
|
||||
{
|
||||
if ($page > $n_pages) $page=$n_pages;
|
||||
$query = "SELECT UNIX_TIMESTAMP(startTime) as startTime, startTZ, startName, message, UNIX_TIMESTAMP(deliveryTime) as deliveryTime , deliveryTZ, destName FROM avionpoeme WHERE deliveryTimeServer<NOW() AND public='1' ORDER BY deliveryTime DESC LIMIT " . ($page-1)*RESULTS_BY_PAGE . "," . RESULTS_BY_PAGE;
|
||||
if ($page > $n_pages) $page = $n_pages;
|
||||
$query = "SELECT UNIX_TIMESTAMP(startTime) as startTime, startTZ, startName, message, UNIX_TIMESTAMP(deliveryTime) as deliveryTime , deliveryTZ, destName FROM avionpoeme WHERE deliveryTimeServer<NOW() AND public='1' ORDER BY deliveryTime DESC LIMIT " . ($page - 1) * RESULTS_BY_PAGE . "," . RESULTS_BY_PAGE;
|
||||
$this->query($query);
|
||||
$planes = $this->result->fetch_all(MYSQLI_ASSOC);
|
||||
print json_encode($planes, JSON_FORCE_OBJECT);
|
||||
@ -197,10 +196,18 @@ class db
|
||||
function savePeripetie()
|
||||
{
|
||||
|
||||
$query = "INSERT INTO avionPeripetie VALUES ('0','";
|
||||
$query .= $this->protect($this->uid) . "','";
|
||||
$query .= $this->protect($this->idPeripetie) . "', ";
|
||||
$query .= "FROM_UNIXTIME(" . $this->protect($this->datePeripetie) . "), '0')";
|
||||
$query = "INSERT INTO avionPeripetie ('idAvion', 'idPeripetie', 'date', 'expeMail'), VALUES (";
|
||||
$query .= "'" . $this->protect($this->uid) . "',";
|
||||
$query .= "'" . $this->protect($this->idPeripetie) . "', ";
|
||||
$query .= "FROM_UNIXTIME(" . $this->protect($this->datePeripetie) . "),";
|
||||
if ($this->expeKnown)
|
||||
{
|
||||
$query .= "'" . $this->protect($this->expeMail) . "'";
|
||||
}else
|
||||
{
|
||||
$query .= "'contact@avion-poe.me'";
|
||||
}
|
||||
$query .= ")";
|
||||
log_write("savePeripetie " . $query);
|
||||
//$query .= $this->protect($this->effetPeripetie) . "', '";
|
||||
//$query .= $this->protect($this->expeMail) . "', '";
|
||||
@ -212,10 +219,9 @@ class db
|
||||
{
|
||||
$query = "SELECT *, DATEDIFF(quand,CURDATE()) as datePeripetie FROM peripeties WHERE quand IS NULL";
|
||||
$this->query($query);
|
||||
while ( ($result = $this->result->fetch_assoc()) )
|
||||
{
|
||||
while (($result = $this->result->fetch_assoc())) {
|
||||
$this->idPeripetie = $result["idPeripetie"];
|
||||
if ((mt_rand(0,100) <= $result["probabilite"])) //calcul de la probabilité de la péripétie
|
||||
if ((mt_rand(0, 100) <= $result["probabilite"])) //calcul de la probabilité de la péripétie
|
||||
{
|
||||
log_write("newPeripetie");
|
||||
$this->datePeripetie = mt_rand($this->startTime, $this->deliveryTime); //ajustement de l'effet
|
||||
@ -234,6 +240,3 @@ class db
|
||||
return $this->avionJournalier;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
|
@ -2,7 +2,6 @@
|
||||
require_once 'log.php';
|
||||
require_once 'fonctions.inc.php';
|
||||
|
||||
|
||||
function courrielEnvoi( $db )
|
||||
{
|
||||
$dicoExpe = getLang( $db->expeLang );
|
||||
@ -20,7 +19,7 @@ function courrielEnvoi( $db )
|
||||
$mailText = $result['text'];
|
||||
$html = $result['html'];
|
||||
|
||||
saveMail( $db, $db->expeMail, $objetMail, $mailText, $html);
|
||||
saveMail( $db, "contact@avion-poe.me", $db->expeMail, $objetMail, $mailText, $html);
|
||||
|
||||
//log_write(print_r($db,true));
|
||||
|
||||
@ -47,51 +46,59 @@ function courrielEnvoi( $db )
|
||||
{
|
||||
$message = "<html><head></head>\n<body>" . $message . "</body></html>";
|
||||
}
|
||||
saveMail( $db, $db->destMail, $objetMail, $mailText, $html);
|
||||
saveMail( $db, $db->expeMail, $db->destMail, $objetMail, $mailText, $html);
|
||||
}
|
||||
|
||||
function saveMail( $db, $destinataire, $objet, $text, $html=false)
|
||||
function saveMail( $db, $expediteur, $destinataire, $objet, $text, $html=false)
|
||||
{
|
||||
$query = "INSERT INTO courriels VALUES ('0', '" . $db->protect($destinataire) . "', '" . $db->protect($objet) . "', '" . $db->protect($text) . "', '" . (int)$html . "')";
|
||||
$db->query($query);
|
||||
}
|
||||
|
||||
function envoiMail($destinataire, $sujet, $text, $html=false, $cc='', $bcc='')
|
||||
function envoiMail($expediteur, $destinataire, $sujet, $text, $html=false, $cc='', $bcc='')
|
||||
{
|
||||
require_once 'include/swiftmailer/autoload.php';
|
||||
//require_once 'include/swiftmailer/swiftmailer/lib/swift_init.php';
|
||||
$transport = (new Swift_SmtpTransport('smtpauth.online.net', 465, 'ssl'))
|
||||
->setUsername('contact@avion-poe.me')
|
||||
->setPassword('AvionPoème*27juillet');
|
||||
$mailer = new Swift_Mailer($transport);
|
||||
$message = (new Swift_Message($sujet))
|
||||
->setFrom(["contact@avion-poe.me"])
|
||||
->setTo([$destinataire])
|
||||
->setCharset('utf-8');
|
||||
$type = $message->getHeaders()->get('Content-Type');
|
||||
if ($html)
|
||||
try
|
||||
{
|
||||
// setParameters() takes an associative array
|
||||
$type->setValue('text/html');
|
||||
$type->setParameter('charset', 'utf-8');
|
||||
$str = nl2br($text);
|
||||
$text = "<html><head></head>\n<body>" . $str . "</body></html>";
|
||||
log_write(__FILE__ . EOL . __LINE__ . EOL . wordwrap($text, 1000, "\r\n"), INFO);
|
||||
}else
|
||||
{
|
||||
$type->setValue('text/plain');
|
||||
$type->setParameter('charset', 'utf-8');
|
||||
$text = str_replace("\n","\r\n", $text);
|
||||
$transport = (new Swift_SmtpTransport('smtpauth.online.net', 465, 'ssl'))
|
||||
->setUsername('contact@avion-poe.me')
|
||||
->setPassword('AvionPoème*27juillet');
|
||||
$mailer = new Swift_Mailer($transport);
|
||||
$message = (new Swift_Message($sujet))
|
||||
->setFrom(["contact@avion-poe.me"])
|
||||
->setTo([$destinataire])
|
||||
->setCharset('utf-8');
|
||||
$type = $message->getHeaders()->get('Content-Type');
|
||||
if ($html)
|
||||
{
|
||||
// setParameters() takes an associative array
|
||||
$type->setValue('text/html');
|
||||
$type->setParameter('charset', 'utf-8');
|
||||
$str = nl2br($text);
|
||||
$text = "<html><head></head>\n<body>" . $str . "</body></html>";
|
||||
log_write(__FILE__ . EOL . __LINE__ . EOL . wordwrap($text, 1000, "\r\n"), INFO);
|
||||
}else
|
||||
{
|
||||
$type->setValue('text/plain');
|
||||
$type->setParameter('charset', 'utf-8');
|
||||
$text = str_replace("\n","\r\n", $text);
|
||||
}
|
||||
$message->setBody($text);
|
||||
//add date header
|
||||
$headers = $message->getHeaders();
|
||||
//$headers->addDateHeader('Date', new DateTimeImmutable('3 days ago'));
|
||||
$headers->addPathHeader('Return-Path', $expediteur);
|
||||
if (!$mailer->send($message, $failures))
|
||||
{
|
||||
echo "Failures:";
|
||||
print_r($failures);
|
||||
log_write(__FILE__ . EOL . __LINE__ . EOL . "Le courriel n'est pas parti:" . $destinataire . EOL . $sujet . EOL . print_r($failure, true) . EOL . wordwrap($text, 1000 , "\r\n"), ERROR);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
$message->setBody($text);
|
||||
//add date header
|
||||
$headers = $message->getHeaders();
|
||||
$headers->addDateHeader('Your-Header', new DateTimeImmutable('3 days ago'));
|
||||
if (!$mailer->send($message, $failures))
|
||||
catch (\Swift_TransportException $ex)
|
||||
{
|
||||
echo "Failures:";
|
||||
print_r($failures);
|
||||
log_write(__FILE__ . EOL . __LINE__ . EOL . "Le courriel n'est pas parti:" . $destinataire . EOL . $sujet . EOL . print_r($failure, true) . EOL . wordwrap($text, 1000 , "\r\n"), ERROR);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
195
index.html
195
index.html
@ -1,195 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Avion-poème</title>
|
||||
<link rel="icon" href="src/img/icon.png">
|
||||
<meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no">
|
||||
<!-- CSS -->
|
||||
<link rel="stylesheet" href="dist/bootstrap/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="dist/leaflet/leaflet.css"/>
|
||||
<link rel="stylesheet" href="dist/quill/quill.snow.css">
|
||||
<link rel="stylesheet" href="https://pro.fontawesome.com/releases/v5.10.0/css/all.css">
|
||||
<link rel="stylesheet" href="dist/leaflet-locatecontrol/L.Control.Locate.min.css"/>
|
||||
<link rel='stylesheet' href="dist/leaflet-fullscreen/leaflet.fullscreen.css"/>
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com">
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=PT+Mono&family=Special+Elite&display=swap">
|
||||
<link href="src/app.css" rel="stylesheet">
|
||||
<!-- JS -->
|
||||
<script src="dist/jquery/jquery-3.6.0.min.js"></script>
|
||||
<script src="dist/leaflet/leaflet.js"></script>
|
||||
<script src="dist/leaflet/touch-fix.js"></script>
|
||||
<script src="dist/popper/popper.min.js"></script>
|
||||
<script src="dist/bootstrap/bootstrap.min.js"></script>
|
||||
<script src="dist/bootstrap/bootstrap3-typeahead.js"></script>
|
||||
<script src="dist/turf/turf.min.js"></script>
|
||||
<script src="dist/moment/moment-with-locales.min.js"></script>
|
||||
<script src="dist/moment/moment-timezone-with-data.js"></script>
|
||||
<script src="dist/quill/quill.js"></script>
|
||||
<script src="dist/pixi/pixi.min.js"></script>
|
||||
<script src="dist/leaflet-pixi-overlay/L.PixiOverlay.min.js"></script>
|
||||
<script src="dist/leaflet-terminator/L.Terminator.js"></script>
|
||||
<script src="dist/rasterizeHTML/rasterizeHTML.allinone.js"></script>
|
||||
<script src="dist/leaflet-locatecontrol/L.Control.Locate.min.js"></script>
|
||||
<script src='dist/leaflet-fullscreen/Leaflet.fullscreen.min.js'></script>
|
||||
</head>
|
||||
<body>
|
||||
<!-- navbar -->
|
||||
<nav class="navbar navbar-expand-md fixed-top navbar-light bg-light">
|
||||
<a id="navTitle" class="navbar-brand" href="#">Avion-Poème</a>
|
||||
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarCollapse" aria-controls="navbarCollapse" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="fas fa-bars"></span>
|
||||
</button>
|
||||
<div class="collapse navbar-collapse" id="navbarCollapse">
|
||||
<ul class="nav-menus navbar-nav mr-auto">
|
||||
<li class="nav-item">
|
||||
<a id="buttonAnthology" class="nav-link" href="#">Anthologie</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a id="buttonAbout" class="nav-link" href="#">À propos</a>
|
||||
</li>
|
||||
<li class="nav-item dropdown">
|
||||
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdownLang" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
<img id="langIcon" src="src/img/lang.png" height="18px">
|
||||
</a>
|
||||
<div id="langChoices" class="dropdown-menu" aria-labelledby="navbarDropdownLang">
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
<form class="nav-button form-inline mt-2 mt-md-0">
|
||||
<input id="buttonNewPlane" type="button" class="btn btn-warning my-2 my-sm-0" data-toggle="modal" data-target="#newPlaneModal" value='Envoyer un avion'>
|
||||
</input>
|
||||
<i id="planeLimitTooltip" class="fas fa-question-circle" data-toggle="tooltip" data-placement="auto" title="coucou"></i>
|
||||
</form>
|
||||
</div>
|
||||
</nav>
|
||||
<!-- map -->
|
||||
<div id="map" style="display:block"></div>
|
||||
<!-- Paper Plane animation -->
|
||||
<canvas id="canvas3d"></canvas>
|
||||
<canvas id="blankCanvas1" width="400" height="400" style="border:1px solid #d3d3d3; display:none"></canvas>
|
||||
<canvas id="blankCanvas2" width="400" height="400" style="border:1px solid #d3d3d3; display:none"></canvas>
|
||||
<img style="display:none;" id="front" src="src/img/front.jpg"/>
|
||||
<img style="display:none;" id="back" src="src/img/back-FF5555.jpg"/>
|
||||
<script id="planeFoldScript.txt" type="not-javascript"> <!-- From https://github.com/RemiKoutcherawy/OriSim3D-JS was fun to code -->
|
||||
d -200 200 -200 -200 200 -200 200 200
|
||||
c 0 1 c 0 3 c 0 2 c 1 3
|
||||
c 0 8 c 8 3 c 0 4 c 4 1
|
||||
c 6 0 c 6 1 c 6 2 c 6 3
|
||||
iad t 1200 ty 6 tx -3)
|
||||
t 750 r 48 -179.99 21 0 10 r 55 -179.99 17 3 19 )
|
||||
t 750 r 43 160 1 4 0 21 24 12 11 13 9 10)
|
||||
t 700 ty -80 tx -60)
|
||||
t 500 r 27 -80 3 19 5 22 2 a 3 )
|
||||
t 500 r 23 -80 0 21 4 24 1 a 0)
|
||||
t 1000 tx -35 z 0 0 0 il 100 100)
|
||||
</script>
|
||||
<!-- Anthology -->
|
||||
<div id="anthology">
|
||||
<h3 id="anthologyTitle" style="text-align:center">Anthologie</h3>
|
||||
<br><br>
|
||||
<small><em id="anthologyDisclaimer" >Si vous souhaitez supprimer un message/poème public, merci de le faire savoir à <a href="mailto:contact@avion-poe.me">contact@avion-poe.me</a></em></small>
|
||||
<br><br><br><br>
|
||||
<div id="anthologyItems">
|
||||
</div>
|
||||
</div>
|
||||
<!-- About -->
|
||||
<div id="about">
|
||||
<h3 id="aboutTitle" style="text-align:center">A propos</h3><br><br>
|
||||
<p id="aboutText">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
|
||||
<p><b id="librairies">Librairies utilisées</b></p>
|
||||
<p><small><a href="https://getbootstrap.com/">Bootstrap</a> | <a href="https://jquery.com/">jQuery</a> | <a href="https://leafletjs.com/">Leaflet</a> | <a href="https://github.com/Leaflet/Leaflet.fullscreen">Leaflet.fullscreen</a> | <a href="https://github.com/domoritz/leaflet-locatecontrol">Leaflet-locatecontrol</a> | <a href="https://github.com/manubb/Leaflet.PixiOverlay">Leaflet.PixiOverlay</a> | <a href="https://github.com/joergdietrich/Leaflet.Terminator">Leaflet.Terminator</a> | <a href="https://momentjs.com/">Moment.js</a> | <a href="https://www.pixijs.com/">PixiJS</a> | <a href="https://popper.js.org/">Popper</a> | <a href="https://quilljs.com/">Quill</a> | <a href="https://cburgmer.github.io/rasterizeHTML.js/">RasterizeHTML.js</a> | <a href="https://turfjs.org/">Turf.js</a> | <a href="https://github.com/RemiKoutcherawy/OriSim3D-JS">OriSim3D-JS</a> | <a href="https://www.geonames.org/export/web-services.html">Geonames</a></small></p>
|
||||
<p><b id="mapSources">Sources de la carte</b></p>
|
||||
<ul>
|
||||
<li><span id="mapBackground">Fond de carte </span>:<small> <a href="https://www.arcgis.com/home/item.html?id=10df2279f9684e4a9f6a7f08febac2a9">World Imagery</a> Tiles © Esri — Source: Esri, i-cubed, USDA, USGS, AEX, GeoEye, Getmapping, Aerogrid, IGN, IGP, UPR-EGP, and the GIS User Community.</small></li>
|
||||
<li><span id="clouds">Nuages </span>:<small> Imagery provided by services from the Global Imagery Browse Services (GIBS), operated by the NASA/GSFC/Earth Science Data and Information System (<a href="https://earthdata.nasa.gov">ESDIS</a>) with funding provided by NASA/HQ.</small></li>
|
||||
</ul>
|
||||
<br>
|
||||
<br>
|
||||
</div>
|
||||
<div id="backToMap">
|
||||
<p style="text-align:center"><a id="closeAnthologyAbout" href="#" >Retour à la carte</a></p>
|
||||
</div>
|
||||
<!-- Modal new plane-->
|
||||
<div class="modal fade" id="newPlaneModal" tabindex="-1" role="dialog" aria-labelledby="newPlaneModal" aria-hidden="true">
|
||||
<div class="modal-dialog modal-lg" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="newPlaneModalTitle">Lancer un avion-poème</h5>
|
||||
<button type="button" id="closeModal" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<b class="bold" id="newPlaneModalMessage">Message</b>
|
||||
<div class="form-check form-check-inline">
|
||||
<input class="form-check-input" type="radio" name="inlineRadioOptions" id="prive" value="prive" checked>
|
||||
<label class="form-check-label" for="prive" id="newPlaneModalPrive">privé</label>
|
||||
</div>
|
||||
<div class="form-check form-check-inline">
|
||||
<input class="form-check-input" type="radio" name="inlineRadioOptions" id="public" value="public">
|
||||
<label class="form-check-label" for="public" id="newPlaneModalPublic">public</label> <i id="publicTooltip" class="fas fa-question-circle" data-toggle="tooltip" data-placement="auto" title="Message publié dans l’Anthologie une fois l’avion-poème arrivé"></i>
|
||||
</div>
|
||||
<br>
|
||||
<br>
|
||||
<div class="form-control rounded-0" id="messageTextArea"></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="bold" for="selectTime" id="flightTime" >Temps de vol</label>
|
||||
<select class="form-control" id="selectTime">
|
||||
<option id="newPlaneModalRandom" value="random">Aléatoire</option>
|
||||
<option id="newPlaneModal3j" value="3days">3,14 jours</option>
|
||||
<option id="newPlaneModal7j" value="7days">7 jours</option>
|
||||
<option id="newPlaneModal30j" value="30days">30 jours</option>
|
||||
<option id="newPlaneModal365j" value="365days">365 jours</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<b class="bold" id="newPlaneModalExpediteur" >Expediteur</b>
|
||||
<input type="checkbox" class="form-check-input" id="expeKnown">
|
||||
<label class="form-check-label" for="expeKnown" id="newPlaneModalAnonyme">envoi anonyme</label> <i id="anonymeTooltip" class="fas fa-question-circle" data-toggle="tooltip" data-placement="auto" title="Votre adresse électronique ne sera communiquée au destinataire qu’à l’arrivée de l’avion-poème"></i>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="email" autocomplete="off" class="form-control" id="expeMail" aria-describedby="emailHelp" placeholder="Insérer votre adresse électronique">
|
||||
</div>
|
||||
<input type="text" autocomplete="off" class="form-control typeahead" id="expeGeocoderPhoton" placeholder="Choisissez un point de départ" data-provide="typeahead">
|
||||
<br>
|
||||
<div class="form-group">
|
||||
<label class="bold" id="newPlaneModalDestinataire" for="destMail">Destinataire</label>
|
||||
<input type="email" autocomplete="off" class="form-control" id="destMail" aria-describedby="emailHelp" placeholder="Insérer l'adresse électronique du destinataire">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="text" autocomplete="off" class="form-control typeahead" id="destGeocoderPhoton" placeholder="Choisissez une destination" data-provide="typeahead">
|
||||
</div>
|
||||
<div class="form-group form-inline">
|
||||
<label for="selectDestLang" id="destLang">Langue parlée par le destinataire:</label>
|
||||
<select class="form-control form-control-sm" id="selectDestLang">
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-light" id="newPlaneModalCancel" data-dismiss="modal">Annuler</button>
|
||||
<button type="button" class="btn btn-warning" id="sendNewPlane" disabled>Lancer</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="src/about.js"></script>
|
||||
<script src="src/map.js"></script>
|
||||
<script src="src/geocoder.js"></script>
|
||||
<script src="src/paperPlaneAnimation.js"></script>
|
||||
<script src="src/formValidation.js"></script>
|
||||
<script src="src/newPlane.js"></script>
|
||||
<script src="src/translation.js"></script>
|
||||
<script src="src/anthology.js"></script>
|
||||
</body>
|
||||
</html>
|
146
index.php
Normal file
146
index.php
Normal file
@ -0,0 +1,146 @@
|
||||
<!-- Head -->
|
||||
<?php require_once './parts/head.php'; ?>
|
||||
|
||||
<body>
|
||||
<!-- Header -->
|
||||
<?php require_once './parts/header.php'; ?>
|
||||
|
||||
<!-- map -->
|
||||
<div id="map" style="display:block"></div>
|
||||
<!-- Paper Plane animation -->
|
||||
<canvas id="canvas3d"></canvas>
|
||||
<canvas id="blankCanvas1" width="400" height="400" style="border:1px solid #d3d3d3; display:none"></canvas>
|
||||
<canvas id="blankCanvas2" width="400" height="400" style="border:1px solid #d3d3d3; display:none"></canvas>
|
||||
<img style="display:none;" id="front" src="src/img/front.jpg" />
|
||||
<img style="display:none;" id="back" src="src/img/back-FF5555.jpg" />
|
||||
<?php
|
||||
if (isset($_GET['avionpoeme']) && $_GET['avionpoeme'] !== '') { ?>
|
||||
<script id="planeFoldScript.txt" type="not-javascript"> <!-- From https://github.com/RemiKoutcherawy/OriSim3D-JS was fun to code -->
|
||||
d -200 200 -200 -200 200 -200 200 200
|
||||
c 0 1 c 0 3 c 0 2 c 1 3
|
||||
c 0 8 c 8 3 c 0 4 c 4 1
|
||||
c 6 0 c 6 1 c 6 2 c 6 3
|
||||
iad t 0 ty 6 tx -3)
|
||||
t 0 r 48 -179.99 21 0 10 r 55 -179.99 17 3 19 )
|
||||
t 0 r 43 160 1 4 0 21 24 12 11 13 9 10)
|
||||
t 0 ty -80)
|
||||
t 0 tx -60)
|
||||
t 0 r 27 -80 3 19 5 22 2 a 3)
|
||||
t 0 r 23 -80 0 21 4 24 1 a 0)
|
||||
t 500 r 23 80 0 21 4 24 1 a 0)
|
||||
t 0 r 23 -90 0 a 0)
|
||||
t 500 r 27 80 3 19 5 22 2 a 3)
|
||||
t 0 r 27 -90 3 a 3)
|
||||
t 700 tx 60)
|
||||
t 700 ty 80)
|
||||
t 750 r 43 -160 1 4 0 21 24 12 11 13 9 10)
|
||||
t 750 r 48 179.99 21 0 10 r 55 179.99 17 3 19 )
|
||||
iad t 1200 ty -6 tx 3)
|
||||
</script>
|
||||
<?php } else { ?>
|
||||
<script id="planeFoldScript.txt" type="not-javascript"> <!-- From https://github.com/RemiKoutcherawy/OriSim3D-JS was fun to code -->
|
||||
d -200 200 -200 -200 200 -200 200 200
|
||||
c 0 1 c 0 3 c 0 2 c 1 3
|
||||
c 0 8 c 8 3 c 0 4 c 4 1
|
||||
c 6 0 c 6 1 c 6 2 c 6 3
|
||||
iad t 1200 ty 6 tx -3)
|
||||
t 750 r 48 -179.99 21 0 10 r 55 -179.99 17 3 19 )
|
||||
t 750 r 43 160 1 4 0 21 24 12 11 13 9 10)
|
||||
t 700 ty -80 tx -60)
|
||||
t 500 r 27 -80 3 19 5 22 2 a 3 )
|
||||
t 500 r 23 -80 0 21 4 24 1 a 0)
|
||||
t 1000 tx -35 z 0 0 0 il 100 100)
|
||||
</script>
|
||||
<?php }
|
||||
?>
|
||||
<!-- Modal new plane-->
|
||||
<div class="modal fade" id="newPlaneModal" tabindex="-1" role="dialog" aria-labelledby="newPlaneModal" aria-hidden="true">
|
||||
<div class="modal-dialog modal-lg" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="newPlaneModalTitle">Lancer un avion-poème</h5>
|
||||
<button type="button" id="closeModal" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<b class="bold" id="newPlaneModalMessage">Message</b>
|
||||
<div class="form-check form-check-inline">
|
||||
<input class="form-check-input" type="radio" name="inlineRadioOptions" id="prive" value="prive" checked>
|
||||
<label class="form-check-label" for="prive" id="newPlaneModalPrive">privé</label>
|
||||
</div>
|
||||
<div class="form-check form-check-inline">
|
||||
<input class="form-check-input" type="radio" name="inlineRadioOptions" id="public" value="public">
|
||||
<label class="form-check-label" for="public" id="newPlaneModalPublic">public</label> <i id="publicTooltip" class="fas fa-question-circle" data-toggle="tooltip" data-placement="auto" title="Message publié dans l’Anthologie une fois l’avion-poème arrivé"></i>
|
||||
</div>
|
||||
<br>
|
||||
<br>
|
||||
<div class="form-control rounded-0" id="messageTextArea"></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="bold" id="labelAttachment"></label>
|
||||
<div class="custom-file">
|
||||
<input type="file" class="custom-file-input" id="attachmentPlane" aria-describedby="inputGroupFileAddon01">
|
||||
<label class="custom-file-label" for="attachmentPlane" id="attachmentPlaneLabel"></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="bold" for="selectTime" id="flightTime">Temps de vol</label>
|
||||
<select class="form-control" id="selectTime">
|
||||
<option id="newPlaneModalRandom" value="random">Aléatoire</option>
|
||||
<option id="newPlaneModal3j" value="3days">3,14 jours</option>
|
||||
<option id="newPlaneModal7j" value="7days">7 jours</option>
|
||||
<option id="newPlaneModal30j" value="30days">30 jours</option>
|
||||
<option id="newPlaneModal365j" value="365days">365 jours</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<b class="bold" id="newPlaneModalExpediteur">Expediteur</b>
|
||||
<input type="checkbox" class="form-check-input" id="expeKnown">
|
||||
<label class="form-check-label" for="expeKnown" id="newPlaneModalAnonyme">envoi anonyme</label> <i id="anonymeTooltip" class="fas fa-question-circle" data-toggle="tooltip" data-placement="auto" title="Votre adresse électronique ne sera communiquée au destinataire qu’à l’arrivée de l’avion-poème"></i>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="email" autocomplete="off" class="form-control" id="expeMail" aria-describedby="emailHelp" placeholder="Insérer votre adresse électronique">
|
||||
</div>
|
||||
<input type="text" autocomplete="off" class="form-control typeahead" id="expeGeocoderPhoton" placeholder="Choisissez un point de départ" data-provide="typeahead">
|
||||
<br>
|
||||
<div class="form-group">
|
||||
<label class="bold" id="newPlaneModalDestinataire" for="destMail">Destinataire</label>
|
||||
<input type="email" autocomplete="off" class="form-control" id="destMail" aria-describedby="emailHelp" placeholder="Insérer l'adresse électronique du destinataire">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="text" autocomplete="off" class="form-control typeahead" id="destGeocoderPhoton" placeholder="Choisissez une destination" data-provide="typeahead">
|
||||
</div>
|
||||
<div class="form-group form-inline">
|
||||
<label for="selectDestLang" id="destLang">Langue parlée par le destinataire:</label>
|
||||
<select class="form-control form-control-sm" id="selectDestLang">
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-light" id="newPlaneModalCancel" data-dismiss="modal">Annuler</button>
|
||||
<button type="button" class="btn btn-warning" id="sendNewPlane" disabled>Lancer</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="closePlane"></div>
|
||||
<div id="downloadPlaneMessage" class="btn btn-outline-primary">Télécharger l'avion-poème</div>
|
||||
<script src="src/map.js"></script>
|
||||
<script src="src/geocoder.js"></script>
|
||||
<script src="src/paperPlaneAnimation.js"></script>
|
||||
<script src="src/formValidation.js"></script>
|
||||
<script src="src/newPlane.js"></script>
|
||||
<script src="src/translation.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
@ -74,3 +74,5 @@ AvionPoeme_epuise|100 avions-poèmes ont déjà été lancés aujourd'hui, veuil
|
||||
NB_AvionPoeme_restant|$NB_avion_poeme avions-poèmes peuvent encore être lancés aujourd'hui! A votre plume!|$NB_avion_poeme flight-poems can still be launched today! Get out your pens!|$NB_avion_poeme Gedichte-Flieger können noch heute losgeschickt werden! An Ihrem Stift!|$NB_avion_poeme самолет–поеми могат да стартират днес! Хващайте писалката!|$NB_avion_poeme 詩作紙飞机今天仍然可发送 。拿起笔來吧!|$NB_avion_poeme 今日も飛行機の詩を飛ばしていただくことができます!あなたが書いたものを!|$NB_avion_poeme aviones-poemas todavía se pueden lanzar hoy. ¡En tu pluma!|$NB_avion_poeme aviões-poemas ainda podem ser lançados hoje! Na sua caneta!|لا يزال من الممكن إطلاق $NB_avion_poeme الطائرات-القصائد اليوم! أحضروا أقلامكم
|
||||
Soutenez_avionpoeme|Offrez-nous un verre de vin |Offer us a beer |Schenken Sie uns ein Bier!|Почерпете ни с ракия!|请给我们倒茶|お酒をください|¡Ofrécenos una cerveza! |Ofereça-nos uma cerveja|من فضلك اعطنا الشاي
|
||||
AvionPoeme_free_independent|Avion-poe.me est gratuit, libre (open source) et indépendant|Avion-poe.me is free (as in freedom), free (as in free beer) and independent|Avion-poe.me ist kostenlos, frei (open source) und unabhängig |Avion-poe.me е безплатен, свободен (с отворен код) и независим |Avion-poe.me 是免费、开源和独立的 |Avion-poe.me は無料で、オープンソースで独立しています |Avion-poe.me es gratuito, libre (de código abierto) e independiente |Avion-poe.me é gratuito, libre (de código aberto) e independente |عملنا مجاني وحر (مفتوح المصدر) ومستقل
|
||||
PJ_Parcourir|Parcourir|Browse|Durchsuchen|Прегледаване|浏览|ブラウズ |Navegar|Navegar|تصفح
|
||||
PJ_Ajouter|Ajouter un pièce jointe (max. 2 Mo)|Attach file (2 MB max.)|Datei anhängen (2 MB max.)|Прикачване на файл (2 MB макс.)|附加文件 (最大 2 MB )|ファイルを添付する (最大2MB)|Adjuntar archivo (2 MB máx. )|Anexar arquivo (2 MB máx.)|إرفق ملف (2MB max)
|
||||
|
Can't render this file because it contains an unexpected character in line 37 and column 114.
|
@ -1,7 +1,7 @@
|
||||
[
|
||||
{
|
||||
"fr": "<p align=\"center\" style=\"border: 1px solid black; padding-top:50px; padding-bottom:50px; border-radius: 10px;\"><em>Cher·e·s semblables<br><br>Nous ne sommes pas comme vos milles et un prétendants<br><br>Si d’autres que nous vous offrent l’instantané,<br>Nous vous offrirons le temps et l’attente<br><br>S’ils vous offrent une lettre<br>Nous vous offrirons un poème<br><br>S’ils vous offrent une certitude<br>Nous vous offrirons les aléas et l’inconnu<br><br>S’ils vous offrent l’abondance<br>Nous vous offrirons le partage<br><br>Et s’ils vous offrent un message<br>Nous vous offrirons le voyage<br><br>Librement,<br><br>L’équipe d’avion-poe.me</em></p><br><br><p><b>En quelques mots</b><br><ul><li>Cette œuvre a été conçue par Maxime Sténuit (créateur), <a href=\"https://github.com/martinedoesgis\">martinedoesgis</a> (développeur front-end), et Daniel Tartavel (développeur back-end).</li><li>L’œuvre est sous licence <a href=\"https://creativecommons.org/licenses/by-nc-sa/2.0/fr/\">Creative Commons BY-NC-SA 2.0 FR</a> et le code source sous licence <a href=\"http://www.gnu.org/licenses/gpl-3.0.en.html\">GPLv3</a>.</li><li>Nous souhaitons que cette application mise librement à votre disposition soit utilisée à des fins excluant tous types de violences, qu’elles soient verbales ou physiques.</li><li>Les messages privés sont supprimés physiquement de notre serveur une fois arrivés, ainsi que l’ensemble des adresses électroniques. Ce site ne contient pas de traceurs.</li><li>Pour en savoir davantage sur <a href=\"https://lalis69.ddns.net:10443/laliscloud/index.php/s/Jf7BkZCWFpEF9tJ\">l’origine des avions-poèmes</a>.</li></ul><br>N’hésitez pas à nous faire part de vos commentaires et vos idées à <a href=\"mailto:contact@avion-poe.me\">contact@avion-poe.me</a>.<br><br>",
|
||||
"en": "<p align=\"center\" style=\"border: 1px solid black; padding-top:50px; padding-bottom:50px; border-radius: 10px;\"><em>Dear fellow,<br><br>We do not resemble your sycophants and suitors<br><br>Should others offer you the instant,<br>We shall offer you the time and the wait<br><br>Should they offer you a letter<br>We shall offer you a poem<br><br>Should they offer you certainty<br>We shall offer you the vagaries and the unknown<br><br>Should they offer you abundance<br>We shall offer you sharing<br><br>And should they offer you a valley<br>We shall offer you the journey<br><br>Freely,<br><br>The team of avion-poe.me</em></p><br><br><p><b>In a few words :</b><br><ul><li>Avion-poe.me was created by Maxime Sténuit, <a href=\"https://github.com/martinedoesgis\">martinedoesgis</a> (front-end developer), and Daniel Tartavel (back-end developer).</li><li>The work is under the <a href=\"https://creativecommons.org/licenses/by-nc-sa/2.0/fr/\">Creative Commons BY-NC-SA 2.0 FR</a> license and the source code under the <a href=\"http://www.gnu.org/licenses/gpl-3.0.en.html\">GPLv3</a> licence.</li><li>We wish this application, made freely available to you, to be used for purposes that exclude all types of violence, whether verbal or physical.</li><li>Private messages are physically deleted from our server when they arrive. This site does not contain cookies.</li><li>To learn more about <a href=\"https://lalis69.ddns.net:10443/laliscloud/index.php/s/Jf7BkZCWFpEF9tJ\">the origin of the flight-poem</a>.</li></ul><br>Please feel free to share your comments and ideas with us at <a href=\"mailto:contact@avion-poe.me\">contact@avion-poe.me</a>.<br><br>",
|
||||
"de": "<p align=\"center\" style=\"border: 1px solid black; padding-top:50px; padding-bottom:50px; border-radius: 10px;\"><em>Liebe Freunde<br><br>Wir gleichen euren Liebhabern nicht.<br><br>Bieten sie euch das Unmittelbare an<br>Schenken wir euch Zeit und Warten<br><br>Schreiben sie euch einen Brief<br>Überreichen wir euch ein Gedicht<br><br>Geben sie euch Gewissheit<br>bieten wir euch Launen und das Unbekannte<br><br>Überhäufen sie euch mit Überfluss<br>Lehren wir euch das Teilen<br><br>Und schicken sie euch eine Nachricht,<br>Dann schenken wir euch eine Reise.<br><br>Frei,<br><br>Das Team von avion-poe.me</em></p><br><br><p><b>In wenigen Worten:</b><br><ul><li>Diese Arbeit wurde von Maxime Sténuit (Schöpfer), <a href=\"https://github.com/martinedoesgis\">martinedoesgis</a> (Front-End-Entwickler) und Daniel Tartavel (Back-End-Entwickler) entworfen.</li><li>Die Arbeit ist unter der <a href=\"https://creativecommons.org/licenses/by-nc-sa/2.0/fr/\">Creative Commons BY-NC-SA 2.0 FR</a>-Lizenz und der Quellcode unter der <a href=\"http://www.gnu.org/licenses/gpl-3.0.en.html\">GPLv3</a>-Lizenz.</li><li>Wir möchten, dass diese Anwendung, die Ihnen frei zur Verfügung gestellt wird, für Zwecke verwendet wird, die alle Arten von verbaler oder physischer Gewalt ausschließen.</li><li>Private Nachrichten werden bei ihrem Eintreffen zusammen mit allen E-Mail-Adressen physisch von unserem Server gelöscht. Diese Seite enthält keine Cookies.</li><li>Um mehr <a href=\"https://lalis69.ddns.net:10443/laliscloud/index.php/s/Jf7BkZCWFpEF9tJ\">über den Ursprung von Gedicht-Flieger</a> zu erfahren.</li></ul><br>Bitte zögern Sie nicht, uns Ihre Kommentare und Ideen an <a href=\"mailto:contact@avion-poe.me\">contact@avion-poe.me</a> zu senden.<br><br>"
|
||||
"fr": "<p align=\"center\" style=\"border: 1px solid black; padding-top:50px; padding-bottom:50px; border-radius: 10px;\"><em>Cher·e·s semblables<br><br>Nous ne sommes pas comme vos milles et un prétendants<br><br>Si d’autres que nous vous offrent l’instantané,<br>Nous vous offrirons le temps et l’attente<br><br>S’ils vous offrent une lettre<br>Nous vous offrirons un poème<br><br>S’ils vous offrent une certitude<br>Nous vous offrirons les aléas et l’inconnu<br><br>S’ils vous offrent l’abondance<br>Nous vous offrirons le partage<br><br>Et s’ils vous offrent un message<br>Nous vous offrirons le voyage<br><br>Librement,<br><br>L’équipe d’avion-poe.me</em></p><br><br><div id='donationElt'><div id='donationText'></div><div id='donationButton' ><a id='donationButtonText' class='btn btn-outline-primary' href='https://lydia-app.com/collect/98550-support-avion-poe-me/fr' target='_blank'></a></div></div><p><b>En quelques mots</b><br><ul><li>Cette œuvre a été conçue par Maxime Sténuit (créateur), <a href=\"https://github.com/martinedoesgis\">martinedoesgis</a> (développeur front-end), et Daniel Tartavel (développeur back-end).</li><li>L’œuvre est sous licence <a href=\"https://creativecommons.org/licenses/by-nc-sa/2.0/fr/\">Creative Commons BY-NC-SA 2.0 FR</a> et le code source sous licence <a href=\"http://www.gnu.org/licenses/gpl-3.0.en.html\">GPLv3</a>.</li><li>Nous souhaitons que cette application mise librement à votre disposition soit utilisée à des fins excluant tous types de violences, qu’elles soient verbales ou physiques.</li><li>Les messages privés sont supprimés physiquement de notre serveur une fois arrivés, ainsi que l’ensemble des adresses électroniques. Ce site ne contient pas de traceurs.</li><li>Pour en savoir davantage sur <a href=\"https://lalis69.ddns.net:10443/laliscloud/index.php/s/Jf7BkZCWFpEF9tJ\">l’origine des avions-poèmes</a>.</li></ul><br>N’hésitez pas à nous faire part de vos commentaires et vos idées à <a href=\"mailto:contact@avion-poe.me\">contact@avion-poe.me</a>.<br><br>",
|
||||
"en": "<p align=\"center\" style=\"border: 1px solid black; padding-top:50px; padding-bottom:50px; border-radius: 10px;\"><em>Dear fellow,<br><br>We do not resemble your sycophants and suitors<br><br>Should others offer you the instant,<br>We shall offer you the time and the wait<br><br>Should they offer you a letter<br>We shall offer you a poem<br><br>Should they offer you certainty<br>We shall offer you the vagaries and the unknown<br><br>Should they offer you abundance<br>We shall offer you sharing<br><br>And should they offer you a valley<br>We shall offer you the journey<br><br>Freely,<br><br>The team of avion-poe.me</em></p><br><br><div id='donationElt'><div id='donationText'></div><div id='donationButton' ><a id='donationButtonText' class='btn btn-outline-primary' href='https://lydia-app.com/collect/98550-support-avion-poe-me/en' target='_blank'></a></div></div><p><b>In a few words :</b><br><ul><li>Avion-poe.me was created by Maxime Sténuit, <a href=\"https://github.com/martinedoesgis\">martinedoesgis</a> (front-end developer), and Daniel Tartavel (back-end developer).</li><li>The work is under the <a href=\"https://creativecommons.org/licenses/by-nc-sa/2.0/fr/\">Creative Commons BY-NC-SA 2.0 FR</a> license and the source code under the <a href=\"http://www.gnu.org/licenses/gpl-3.0.en.html\">GPLv3</a> licence.</li><li>We wish this application, made freely available to you, to be used for purposes that exclude all types of violence, whether verbal or physical.</li><li>Private messages are physically deleted from our server when they arrive. This site does not contain cookies.</li><li>To learn more about <a href=\"https://lalis69.ddns.net:10443/laliscloud/index.php/s/Jf7BkZCWFpEF9tJ\">the origin of the flight-poem</a>.</li></ul><br>Please feel free to share your comments and ideas with us at <a href=\"mailto:contact@avion-poe.me\">contact@avion-poe.me</a>.<br><br>",
|
||||
"de": "<p align=\"center\" style=\"border: 1px solid black; padding-top:50px; padding-bottom:50px; border-radius: 10px;\"><em>Liebe Freunde<br><br>Wir gleichen euren Liebhabern nicht.<br><br>Bieten sie euch das Unmittelbare an<br>Schenken wir euch Zeit und Warten<br><br>Schreiben sie euch einen Brief<br>Überreichen wir euch ein Gedicht<br><br>Geben sie euch Gewissheit<br>bieten wir euch Launen und das Unbekannte<br><br>Überhäufen sie euch mit Überfluss<br>Lehren wir euch das Teilen<br><br>Und schicken sie euch eine Nachricht,<br>Dann schenken wir euch eine Reise.<br><br>Frei,<br><br>Das Team von avion-poe.me</em></p><br><br><div id='donationElt'><div id='donationText'></div><div id='donationButton' ><a id='donationButtonText' class='btn btn-outline-primary' href='https://lydia-app.com/collect/98550-support-avion-poe-me/fr' target='_blank'></a></div></div><p><b>In wenigen Worten:</b><br><ul><li>Diese Arbeit wurde von Maxime Sténuit (Schöpfer), <a href=\"https://github.com/martinedoesgis\">martinedoesgis</a> (Front-End-Entwickler) und Daniel Tartavel (Back-End-Entwickler) entworfen.</li><li>Die Arbeit ist unter der <a href=\"https://creativecommons.org/licenses/by-nc-sa/2.0/fr/\">Creative Commons BY-NC-SA 2.0 FR</a>-Lizenz und der Quellcode unter der <a href=\"http://www.gnu.org/licenses/gpl-3.0.en.html\">GPLv3</a>-Lizenz.</li><li>Wir möchten, dass diese Anwendung, die Ihnen frei zur Verfügung gestellt wird, für Zwecke verwendet wird, die alle Arten von verbaler oder physischer Gewalt ausschließen.</li><li>Private Nachrichten werden bei ihrem Eintreffen zusammen mit allen E-Mail-Adressen physisch von unserem Server gelöscht. Diese Seite enthält keine Cookies.</li><li>Um mehr <a href=\"https://lalis69.ddns.net:10443/laliscloud/index.php/s/Jf7BkZCWFpEF9tJ\">über den Ursprung von Gedicht-Flieger</a> zu erfahren.</li></ul><br>Bitte zögern Sie nicht, uns Ihre Kommentare und Ideen an <a href=\"mailto:contact@avion-poe.me\">contact@avion-poe.me</a> zu senden.<br><br>"
|
||||
}
|
||||
]
|
37
parts/head.php
Normal file
37
parts/head.php
Normal file
@ -0,0 +1,37 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Avion-poème</title>
|
||||
<link rel="icon" href="src/img/icon.png">
|
||||
<meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no">
|
||||
<!-- CSS -->
|
||||
<link rel="stylesheet" href="dist/bootstrap/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="dist/leaflet/leaflet.css" />
|
||||
<link rel="stylesheet" href="dist/quill/quill.snow.css">
|
||||
<link rel="stylesheet" href="https://pro.fontawesome.com/releases/v5.10.0/css/all.css">
|
||||
<link rel="stylesheet" href="dist/leaflet-locatecontrol/L.Control.Locate.min.css" />
|
||||
<link rel='stylesheet' href="dist/leaflet-fullscreen/leaflet.fullscreen.css" />
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com">
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=PT+Mono&family=Special+Elite&display=swap">
|
||||
<link href="src/app.css" rel="stylesheet">
|
||||
<!-- JS -->
|
||||
<script src="dist/jquery/jquery-3.6.0.min.js"></script>
|
||||
<script src="dist/leaflet/leaflet.js"></script>
|
||||
<script src="dist/leaflet/touch-fix.js"></script>
|
||||
<script src="dist/popper/popper.min.js"></script>
|
||||
<script src="dist/bootstrap/bootstrap.min.js"></script>
|
||||
<script src="dist/bootstrap/bootstrap3-typeahead.js"></script>
|
||||
<script src="dist/turf/turf.min.js"></script>
|
||||
<script src="dist/moment/moment-with-locales.min.js"></script>
|
||||
<script src="dist/moment/moment-timezone-with-data.js"></script>
|
||||
<script src="dist/quill/quill.js"></script>
|
||||
<script src="dist/pixi/pixi.min.js"></script>
|
||||
<script src="dist/leaflet-pixi-overlay/L.PixiOverlay.min.js"></script>
|
||||
<script src="dist/leaflet-terminator/L.Terminator.js"></script>
|
||||
<script src="dist/rasterizeHTML/rasterizeHTML.allinone.js"></script>
|
||||
<script src="dist/leaflet-locatecontrol/L.Control.Locate.min.js"></script>
|
||||
<script src='dist/leaflet-fullscreen/Leaflet.fullscreen.min.js'></script>
|
||||
<script src='dist/html2pdf/html2pdf.bundle.min.js'></script>
|
||||
</head>
|
29
parts/header.php
Normal file
29
parts/header.php
Normal file
@ -0,0 +1,29 @@
|
||||
<!-- navbar -->
|
||||
<nav class="navbar navbar-expand-md fixed-top navbar-light bg-light">
|
||||
<a id="navTitle" class="navbar-brand" href="/">Avion-Poème</a>
|
||||
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarCollapse" aria-controls="navbarCollapse" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="fas fa-bars"></span>
|
||||
</button>
|
||||
<div class="collapse navbar-collapse" id="navbarCollapse">
|
||||
<ul class="nav-menus navbar-nav mr-auto">
|
||||
<li class="nav-item">
|
||||
<a id="buttonAnthology" class="nav-link" href="./anthologie.php">Anthologie</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a id="buttonAbout" class="nav-link" href="./apropos.php">À propos</a>
|
||||
</li>
|
||||
<li class="nav-item dropdown">
|
||||
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdownLang" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
<img id="langIcon" src="src/img/lang.png" height="18px">
|
||||
</a>
|
||||
<div id="langChoices" class="dropdown-menu" aria-labelledby="navbarDropdownLang">
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
<form class="nav-button form-inline mt-2 mt-md-0">
|
||||
<input id="buttonNewPlane" type="button" class="btn btn-warning my-2 my-sm-0" data-toggle="modal" data-target="#newPlaneModal" value='Lancer un avion-poème 0/100'>
|
||||
</input>
|
||||
<i id="planeLimitTooltip" class="fas fa-question-circle" data-toggle="tooltip" data-placement="auto" title="coucou"></i>
|
||||
</form>
|
||||
</div>
|
||||
</nav>
|
248
src/anthology.js
248
src/anthology.js
@ -1,130 +1,136 @@
|
||||
//open / close
|
||||
var anthologyOpen = 0
|
||||
|
||||
$('#buttonAnthology').on('click',function(){
|
||||
//hiding navbar
|
||||
$('.navbar-collapse').collapse('hide');
|
||||
if (anthologyOpen > 0){
|
||||
$('#anthology').css('visibility','hidden');
|
||||
$('#anthology').css('opacity','0')
|
||||
$('#backToMap').css('visibility','hidden');
|
||||
$('#backToMap').css('opacity','0')
|
||||
anthologyOpen = 0
|
||||
}
|
||||
else{
|
||||
$('#anthology').css('visibility','visible')
|
||||
$('#anthology').css('opacity','1')
|
||||
$('#backToMap').css('visibility','visible');
|
||||
$('#backToMap').css('opacity','1')
|
||||
anthologyOpen = 1
|
||||
displayAnthology()
|
||||
|
||||
}
|
||||
//closing about
|
||||
$('#about').css('visibility','hidden');
|
||||
$('#about').css('opacity','0')
|
||||
aboutOpen = 0
|
||||
})
|
||||
|
||||
$('#closeAnthologyAbout').on('click',function(){
|
||||
$('#anthology').css('opacity','0')
|
||||
$('#anthology').css('visibility','hidden')
|
||||
$('#backToMap').css('opacity','0')
|
||||
$('#backToMap').css('visibility','hidden')
|
||||
anthologyOpen = 0
|
||||
})
|
||||
|
||||
$('#navTitle').on('click',function(){
|
||||
$('#anthology').css('opacity','0')
|
||||
$('#anthology').css('visibility','hidden')
|
||||
$('#backToMap').css('opacity','0')
|
||||
$('#backToMap').css('visibility','hidden')
|
||||
$('#about').css('opacity','0')
|
||||
$('#about').css('visibility','hidden')
|
||||
aboutOpen = 0
|
||||
anthologyOpen = 0
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
function flightTime(a,b){
|
||||
var days = Math.round((b-a)/86400 * 100) / 100
|
||||
var months = Math.round(days/30)
|
||||
var years = Math.round(months/12)
|
||||
if (days < 30){
|
||||
return ""+days+" "+dictionnary.jours
|
||||
}
|
||||
else if (days >= 30 && days < 365){
|
||||
if(months>1){
|
||||
return ""+months+" "+dictionnary.mois_pluriel
|
||||
}
|
||||
else{
|
||||
return ""+months+" "+dictionnary.mois
|
||||
}
|
||||
}
|
||||
else if (days >= 365){
|
||||
if(years>1){
|
||||
return ""+years+" "+dictionnary.ans
|
||||
}
|
||||
else{
|
||||
return ""+years+" "+dictionnary.an
|
||||
}
|
||||
}
|
||||
function flightTime(a, b) {
|
||||
var days = Math.round(((b - a) / 86400) * 100) / 100;
|
||||
var months = Math.round(days / 30);
|
||||
var years = Math.round(months / 12);
|
||||
if (days < 30) {
|
||||
return "" + days + " " + dictionnary.jours;
|
||||
} else if (days >= 30 && days < 365) {
|
||||
if (months > 1) {
|
||||
return "" + months + " " + dictionnary.mois_pluriel;
|
||||
} else {
|
||||
return "" + months + " " + dictionnary.mois;
|
||||
}
|
||||
} else if (days >= 365) {
|
||||
if (years > 1) {
|
||||
return "" + years + " " + dictionnary.ans;
|
||||
} else {
|
||||
return "" + years + " " + dictionnary.an;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//load
|
||||
var nPages;
|
||||
var nPagesLoaded = 1
|
||||
$.post( "getAnthology.php", function(pages) {
|
||||
pages = $.parseJSON(pages)
|
||||
nPages = Number(pages.nPages)
|
||||
})
|
||||
|
||||
function displayAnthology(){ // clean and display first page
|
||||
$("#anthologyItems").html('')
|
||||
nPagesLoaded = 1
|
||||
$.post( "getAnthology.php?page=1", function(result) {
|
||||
results = $.parseJSON(result)
|
||||
var momentLocale = lang;
|
||||
if (momentLocale == 'zh'){momentLocale = 'zh-cn'} //troubleshot for chinese
|
||||
moment.locale(momentLocale)
|
||||
for (var i in results){
|
||||
addAnthologyLine(results[i])
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
$( "#anthology" ).scroll(function() {
|
||||
if($("#anthology").scrollTop() + 700 > $("#anthologyItems").height()){
|
||||
if (nPagesLoaded < nPages){
|
||||
nPagesLoaded++
|
||||
console.log('Loading anthology page '+nPagesLoaded+'/'+nPages)
|
||||
$.post( "getAnthology.php?page="+nPagesLoaded+"", function(result) {
|
||||
results = $.parseJSON(result)
|
||||
var momentLocale = lang;
|
||||
if (momentLocale == 'zh'){momentLocale = 'zh-cn'} //troubleshot for chinese
|
||||
moment.locale(momentLocale)
|
||||
for (var i in results){
|
||||
addAnthologyLine(results[i])
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
var nPagesLoaded = 1;
|
||||
$.post("getAnthology.php", function (pages) {
|
||||
pages = $.parseJSON(pages);
|
||||
nPages = Number(pages.nPages);
|
||||
});
|
||||
|
||||
function addAnthologyLine(results){
|
||||
if (lang == 'ar'){ // arabic : rtl + add <br>
|
||||
$("#anthologyItems").append(
|
||||
'<small style="float:right">'+dictionnary.origine+': <b>'+results.startName+'</b> • '+dictionnary.destination+': <b>'+results.destName+'</b> • '+dictionnary.date_arrivee+': <b>'+moment(Number(results.deliveryTime)*1000).format('LL')+'</b> • '+dictionnary.temps_de_vol+': <b>'+flightTime(Number(results.startTime),Number(results.deliveryTime))+'</b></small><br><br>'+results.message+'<br><hr><br>'
|
||||
)
|
||||
}
|
||||
else{
|
||||
$("#anthologyItems").append(
|
||||
'<small>'+dictionnary.origine+': <b>'+results.startName+'</b> • '+dictionnary.destination+': <b>'+results.destName+'</b> • '+dictionnary.date_arrivee+': <b>'+moment(Number(results.deliveryTime)*1000).format('LL')+'</b> • '+dictionnary.temps_de_vol+': <b>'+flightTime(Number(results.startTime),Number(results.deliveryTime))+'</b></small><br><br>'+results.message+'<br><hr><br>'
|
||||
)
|
||||
}
|
||||
function displayAnthology() {
|
||||
// clean and display first page
|
||||
$("#anthologyItems").html("");
|
||||
nPagesLoaded = 1;
|
||||
$.post("getAnthology.php?page=1", function (result) {
|
||||
results = $.parseJSON(result);
|
||||
var momentLocale = lang;
|
||||
if (momentLocale == "zh") {
|
||||
momentLocale = "zh-cn";
|
||||
} //troubleshot for chinese
|
||||
moment.locale(momentLocale);
|
||||
for (var i in results) {
|
||||
addAnthologyLine(results[i]);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$("#anthology").scroll(function () {
|
||||
if ($("#anthology").scrollTop() + 700 > $("#anthologyItems").height()) {
|
||||
if (nPagesLoaded < nPages) {
|
||||
nPagesLoaded++;
|
||||
console.log("Loading anthology page " + nPagesLoaded + "/" + nPages);
|
||||
$.post("getAnthology.php?page=" + nPagesLoaded + "", function (result) {
|
||||
results = $.parseJSON(result);
|
||||
var momentLocale = lang;
|
||||
if (momentLocale == "zh") {
|
||||
momentLocale = "zh-cn";
|
||||
} //troubleshot for chinese
|
||||
moment.locale(momentLocale);
|
||||
for (var i in results) {
|
||||
addAnthologyLine(results[i]);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
function addAnthologyLine(results) {
|
||||
if (lang == "ar") {
|
||||
// arabic : rtl + add <br>
|
||||
$("#anthologyItems").append(
|
||||
'<small style="float:right">' +
|
||||
dictionnary.origine +
|
||||
": <b>" +
|
||||
results.startName +
|
||||
"</b> • " +
|
||||
dictionnary.destination +
|
||||
": <b>" +
|
||||
results.destName +
|
||||
"</b> • " +
|
||||
dictionnary.date_arrivee +
|
||||
": <b>" +
|
||||
moment(Number(results.deliveryTime) * 1000).format("LL") +
|
||||
"</b> • " +
|
||||
dictionnary.temps_de_vol +
|
||||
": <b>" +
|
||||
flightTime(Number(results.startTime), Number(results.deliveryTime)) +
|
||||
"</b></small><br><br>" +
|
||||
results.message +
|
||||
"<br><hr><br>"
|
||||
);
|
||||
} else {
|
||||
$("#anthologyItems").append(
|
||||
"<small>" +
|
||||
dictionnary.origine +
|
||||
": <b>" +
|
||||
results.startName +
|
||||
"</b> • " +
|
||||
dictionnary.destination +
|
||||
": <b>" +
|
||||
results.destName +
|
||||
"</b> • " +
|
||||
dictionnary.date_arrivee +
|
||||
": <b>" +
|
||||
moment(Number(results.deliveryTime) * 1000).format("LL") +
|
||||
"</b> • " +
|
||||
dictionnary.temps_de_vol +
|
||||
": <b>" +
|
||||
flightTime(Number(results.startTime), Number(results.deliveryTime)) +
|
||||
"</b></small><br><br>" +
|
||||
results.message +
|
||||
"<br><hr><br>"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
$.post("avionJournalier.php", function (result) {
|
||||
result = result.replace(/'/g, '"');
|
||||
result = $.parseJSON(result);
|
||||
nbPlane = Number(result.nAvion);
|
||||
console.log(result);
|
||||
$("#buttonNewPlane").val(
|
||||
"Lancer un avion-poème " + Number(result.nAvion) + "/100"
|
||||
);
|
||||
$("#buttonNewPlane").on("click", () => {
|
||||
window.location.replace("/");
|
||||
});
|
||||
});
|
||||
|
||||
$(document).ready(function () {
|
||||
$.getJSON("lang/" + lang + "", function (s) {
|
||||
displayAnthology();
|
||||
$("#anthologyTitle").html(s.anthologie);
|
||||
$("#anthologyDisclaimer").html(s.suppr_message_public);
|
||||
$("#closeAnthologyAbout").html(s.retour_carte);
|
||||
});
|
||||
});
|
||||
|
456
src/app.css
456
src/app.css
@ -1,22 +1,29 @@
|
||||
:root {
|
||||
/** Colors **/
|
||||
--primary: #007bff;
|
||||
--primary-rgb: 0, 123, 255;
|
||||
--primary-hover: #0056b3;
|
||||
}
|
||||
|
||||
html,
|
||||
body {
|
||||
overflow-x: hidden;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
body {
|
||||
position: relative;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
font-family: 'PT Mono', monospace;
|
||||
body {
|
||||
position: relative;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
font-family: "PT Mono", monospace;
|
||||
}
|
||||
|
||||
#map {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
height:100%;
|
||||
width: 100%;
|
||||
#map {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.footer {
|
||||
@ -27,238 +34,359 @@ body {
|
||||
height: 30px;
|
||||
line-height: 30px; /* Vertically center the text there */
|
||||
background-color: #f5f5f5;
|
||||
font-size: 12px
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
|
||||
/* big modal */
|
||||
.modal-lg {
|
||||
max-width:1140px !important;
|
||||
max-width: 1140px !important;
|
||||
}
|
||||
|
||||
/* paper plane animation */
|
||||
#canvas3d{
|
||||
display:none;
|
||||
transition: all .3s;
|
||||
position:fixed;
|
||||
height:100vh;
|
||||
width:100vw;
|
||||
background-color: rgba(0,0,0,0);
|
||||
z-index:9999;
|
||||
margin-top: 50vh; /* poussé de la moitié de hauteur de viewport */
|
||||
transform: translateY(-50%) translateX(-50%); /* tiré de la moitié de sa propre hauteur */
|
||||
margin-left: 50vw; /* poussé de la moitié de hauteur de viewport */
|
||||
#canvas3d {
|
||||
display: none;
|
||||
transition: all 0.3s;
|
||||
position: fixed;
|
||||
height: 100vh;
|
||||
width: 100vw;
|
||||
background-color: rgba(0, 0, 0, 0);
|
||||
z-index: 9999;
|
||||
margin-top: 50vh; /* poussé de la moitié de hauteur de viewport */
|
||||
transform: translateY(-50%) translateX(-50%); /* tiré de la moitié de sa propre hauteur */
|
||||
margin-left: 50vw; /* poussé de la moitié de hauteur de viewport */
|
||||
}
|
||||
|
||||
/* qill text editor */
|
||||
#messageTextArea {
|
||||
min-height: 200px;
|
||||
border-radius: 0px 0px .25em .25em !important;
|
||||
border-color: #ced4da !important
|
||||
border-radius: 0px 0px 0.25em 0.25em !important;
|
||||
border-color: #ced4da !important;
|
||||
}
|
||||
|
||||
.ql-toolbar{
|
||||
border-radius: .25em .25em 0px 0px !important;
|
||||
border-color: #ced4da !important
|
||||
.ql-toolbar {
|
||||
border-radius: 0.25em 0.25em 0px 0px !important;
|
||||
border-color: #ced4da !important;
|
||||
}
|
||||
/* make the pixi overlay on top of the arc lines */
|
||||
.leaflet-pixi-overlay {
|
||||
position: absolute !important;
|
||||
z-index: 201 !important;
|
||||
position: absolute !important;
|
||||
z-index: 201 !important;
|
||||
}
|
||||
|
||||
.bold{
|
||||
font-weight:bold !important
|
||||
.bold {
|
||||
font-weight: bold !important;
|
||||
}
|
||||
|
||||
/* Anthology */
|
||||
#anthology{
|
||||
visibility:hidden;
|
||||
opacity:0;
|
||||
transition:visibility 0.2s linear,opacity 0.2s linear;
|
||||
position:absolute;
|
||||
z-index:1029;
|
||||
padding-top:66px;
|
||||
padding-bottom:35px;
|
||||
padding-left:30%;
|
||||
padding-right:30%;
|
||||
overflow-x:hidden;
|
||||
height:100vh;
|
||||
width:100vw;
|
||||
background-color:rgba(255,255,255,0.9)
|
||||
#anthology {
|
||||
margin-top: 56px;
|
||||
z-index: 1029;
|
||||
padding-top: 66px;
|
||||
padding-bottom: 35px;
|
||||
padding-left: 25%;
|
||||
padding-right: 25%;
|
||||
overflow-x: hidden;
|
||||
width: 100vw;
|
||||
background-color: rgba(255, 255, 255, 0.9);
|
||||
}
|
||||
|
||||
/* About */
|
||||
#about{
|
||||
visibility:hidden;
|
||||
opacity:0;
|
||||
transition:visibility 0.2s linear,opacity 0.2s linear;
|
||||
position:absolute;
|
||||
z-index:1029;
|
||||
padding-top:66px;
|
||||
padding-bottom:35px;
|
||||
padding-left:30%;
|
||||
padding-right:30%;
|
||||
overflow-x:hidden;
|
||||
height:100vh;
|
||||
width:100vw;
|
||||
background-color:rgba(255,255,255,0.9)
|
||||
#about {
|
||||
margin-top: 56px;
|
||||
z-index: 1029;
|
||||
padding-top: 66px;
|
||||
padding-bottom: 35px;
|
||||
padding-left: 25%;
|
||||
padding-right: 25%;
|
||||
overflow-x: hidden;
|
||||
width: 100vw;
|
||||
background-color: rgba(255, 255, 255, 0.9);
|
||||
}
|
||||
|
||||
#backToMap{
|
||||
visibility:hidden;
|
||||
opacity:0;
|
||||
transition:visibility 0.2s linear,opacity 0.2s linear;
|
||||
position:fixed;
|
||||
z-index:1035;
|
||||
padding-left:10%;
|
||||
padding-right:10%;
|
||||
overflow-x:hidden;
|
||||
width:100vw;
|
||||
bottom:0px;
|
||||
background-color:rgba(255,255,255,1);
|
||||
border-top: 1px solid #ddd;
|
||||
#backToMap {
|
||||
transition: visibility 0.2s linear, opacity 0.2s linear;
|
||||
position: fixed;
|
||||
z-index: 1035;
|
||||
padding-left: 10%;
|
||||
padding-right: 10%;
|
||||
overflow-x: hidden;
|
||||
width: 100vw;
|
||||
bottom: 0px;
|
||||
background-color: rgba(255, 255, 255, 1);
|
||||
border-top: 1px solid #ddd;
|
||||
}
|
||||
|
||||
#backToMap a{
|
||||
color:#070707
|
||||
#backToMap a {
|
||||
color: #070707;
|
||||
}
|
||||
|
||||
#backToMap p{
|
||||
margin-bottom:5px;
|
||||
padding-top:3px;
|
||||
#backToMap p {
|
||||
margin-bottom: 5px;
|
||||
padding-top: 3px;
|
||||
}
|
||||
|
||||
#backToMap a:hover{
|
||||
color:black
|
||||
#backToMap a:hover {
|
||||
color: black;
|
||||
}
|
||||
|
||||
.leaflet-popup-content-wrapper{
|
||||
font-family: 'PT Mono', monospace;
|
||||
border-radius: 1px;
|
||||
/* font-family: 'Special Elite', cursive !important */
|
||||
.leaflet-popup-content-wrapper {
|
||||
font-family: "PT Mono", monospace;
|
||||
border-radius: 1px;
|
||||
/* font-family: 'Special Elite', cursive !important */
|
||||
}
|
||||
|
||||
.leaflet-popup-content{
|
||||
/* min-width:280px; */
|
||||
margin-left: 10px;
|
||||
margin-right: 21px;
|
||||
margin-top: 10px;
|
||||
margin-bottom: 10px;
|
||||
.leaflet-popup-content {
|
||||
/* min-width:280px; */
|
||||
margin-left: 10px;
|
||||
margin-right: 21px;
|
||||
margin-top: 10px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.leaflet-popup-content hr{
|
||||
width: 267px;
|
||||
margin-top: 10px;
|
||||
margin-bottom: 10px;
|
||||
.leaflet-popup-content hr {
|
||||
width: 267px;
|
||||
margin-top: 10px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.leaflet-control-scale-line:not(:first-child) {
|
||||
border-top: none;
|
||||
border-bottom: 1px solid;
|
||||
margin-top: 0px;
|
||||
border-top: none;
|
||||
border-bottom: 1px solid;
|
||||
margin-top: 0px;
|
||||
}
|
||||
|
||||
.leaflet-control-scale-line {
|
||||
FONT-WEIGHT: 100;
|
||||
font-family: 'PT Mono', monospace;
|
||||
border: 1px solid #fff;
|
||||
border-right: none;
|
||||
border-top: none;
|
||||
border-left: none;
|
||||
line-height: 1.1;
|
||||
padding: 2px 5px 1px;
|
||||
font-size: 11px;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
color: white;
|
||||
-moz-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
/* background: #fff; */
|
||||
background: rgba(255, 255, 255, 0);
|
||||
font-weight: 100;
|
||||
font-family: "PT Mono", monospace;
|
||||
border: 1px solid #fff;
|
||||
border-right: none;
|
||||
border-top: none;
|
||||
border-left: none;
|
||||
line-height: 1.1;
|
||||
padding: 2px 5px 1px;
|
||||
font-size: 11px;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
color: white;
|
||||
-moz-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
/* background: #fff; */
|
||||
background: rgba(255, 255, 255, 0);
|
||||
}
|
||||
|
||||
.leaflet-bar a:last-child {
|
||||
border-bottom-left-radius: 1px !important;
|
||||
border-bottom-right-radius: 1px !important;
|
||||
border-bottom-left-radius: 1px !important;
|
||||
border-bottom-right-radius: 1px !important;
|
||||
}
|
||||
|
||||
.leaflet-bar a:first-child {
|
||||
border-top-left-radius: 1px !important;
|
||||
border-top-right-radius: 1px !important;
|
||||
border-top-left-radius: 1px !important;
|
||||
border-top-right-radius: 1px !important;
|
||||
}
|
||||
|
||||
/* pulsating marker */
|
||||
|
||||
.pulse-icon-anim {
|
||||
margin-top:2px;
|
||||
margin-left:2px;
|
||||
border: 3px solid;
|
||||
-webkit-border-radius: 30px;
|
||||
height: 18px;
|
||||
width: 18px;
|
||||
-webkit-animation: pulsate 1s ease-out;
|
||||
-webkit-animation-iteration-count: infinite;
|
||||
/*opacity: 0.0*/
|
||||
margin-top: 2px;
|
||||
margin-left: 2px;
|
||||
border: 3px solid;
|
||||
-webkit-border-radius: 30px;
|
||||
height: 18px;
|
||||
width: 18px;
|
||||
-webkit-animation: pulsate 1s ease-out;
|
||||
-webkit-animation-iteration-count: infinite;
|
||||
/*opacity: 0.0*/
|
||||
}
|
||||
|
||||
@-webkit-keyframes pulsate {
|
||||
0% {-webkit-transform: scale(0.1, 0.1); opacity: 0.0;}
|
||||
50% {opacity: 1.0;}
|
||||
100% {-webkit-transform: scale(1.2, 1.2); opacity: 0.0;}
|
||||
0% {
|
||||
-webkit-transform: scale(0.1, 0.1);
|
||||
opacity: 0;
|
||||
}
|
||||
50% {
|
||||
opacity: 1;
|
||||
}
|
||||
100% {
|
||||
-webkit-transform: scale(1.2, 1.2);
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
|
||||
a#navbarDropdownLang.nav-link.dropdown-toggle::after{
|
||||
margin-left:0px !important
|
||||
a#navbarDropdownLang.nav-link.dropdown-toggle::after {
|
||||
margin-left: 0px !important;
|
||||
}
|
||||
|
||||
.nav-item{
|
||||
margin-right:10px
|
||||
.nav-item {
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.dropdown-menu{
|
||||
font-size:0.9em !important;
|
||||
padding: 0px !important
|
||||
.dropdown-menu {
|
||||
font-size: 0.9em !important;
|
||||
padding: 0px !important;
|
||||
}
|
||||
|
||||
.ql-editor {
|
||||
min-height:170px !important;
|
||||
width: 100% !important
|
||||
min-height: 170px !important;
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
.ql-editor p {
|
||||
font-size:1.25em !important;
|
||||
|
||||
font-size: 1.25em !important;
|
||||
}
|
||||
|
||||
.ql-editor .ql-size-small {
|
||||
font-size: 0.9em !important;
|
||||
font-size: 0.9em !important;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 600px) {
|
||||
.modal-body {
|
||||
font-size:0.9rem
|
||||
}
|
||||
.modal-body .form-control{
|
||||
font-size:0.8rem
|
||||
}
|
||||
.leaflet-popup-content {
|
||||
margin: 10px 10px;
|
||||
line-height: 1.4;
|
||||
}
|
||||
#anthologyItems{
|
||||
font-size:0.8rem
|
||||
}
|
||||
#about{
|
||||
padding-left:5% !important;
|
||||
padding-right:5% !important;
|
||||
}
|
||||
#anthology{
|
||||
padding-left:5% !important;
|
||||
padding-right:5% !important;
|
||||
}
|
||||
.modal-body {
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
.modal-body .form-control {
|
||||
font-size: 0.8rem;
|
||||
}
|
||||
.leaflet-popup-content {
|
||||
margin: 10px 10px;
|
||||
line-height: 1.4;
|
||||
}
|
||||
#anthologyItems {
|
||||
font-size: 0.8rem;
|
||||
}
|
||||
#about {
|
||||
padding-left: 5% !important;
|
||||
padding-right: 5% !important;
|
||||
}
|
||||
#anthology {
|
||||
padding-left: 5% !important;
|
||||
padding-right: 5% !important;
|
||||
}
|
||||
}
|
||||
|
||||
/* About donation */
|
||||
#donationElt {
|
||||
background: rgba(var(--primary-rgb), 0.2);
|
||||
margin-bottom: 50px;
|
||||
padding: 5%;
|
||||
display: grid;
|
||||
grid-template-columns: fit-content(370px) auto;
|
||||
column-gap: 8%;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
#donationElt #donationButton {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
#donationElt #donationButton .btn {
|
||||
background: white;
|
||||
}
|
||||
|
||||
#donationElt #donationButton .btn:before {
|
||||
font-family: "Font Awesome 5 Pro";
|
||||
display: inline-block;
|
||||
margin-right: 10px;
|
||||
font-weight: 300;
|
||||
}
|
||||
|
||||
#donationElt #donationButton .btn.fr:before {
|
||||
content: "\f5ce";
|
||||
}
|
||||
|
||||
#donationElt #donationButton .btn.en:before,
|
||||
#donationElt #donationButton .btn.de:before,
|
||||
#donationElt #donationButton .btn.pt:before,
|
||||
#donationElt #donationButton .btn.es:before {
|
||||
content: "\f0fc";
|
||||
}
|
||||
|
||||
#donationElt #donationButton .btn.ar:before {
|
||||
content: "\f875";
|
||||
}
|
||||
|
||||
#donationElt #donationButton .btn.zh:before,
|
||||
#donationElt #donationButton .btn.ja:before,
|
||||
#donationElt #donationButton .btn.bg:before {
|
||||
content: "\f7a0";
|
||||
font-size: 13px;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
#donationElt #donationButton .btn:hover {
|
||||
color: var(--primary-hover);
|
||||
border-color: var(--primary-hover);
|
||||
}
|
||||
|
||||
@media screen and (max-width: 990px) {
|
||||
#donationElt {
|
||||
grid-template-columns: 1fr;
|
||||
grid-row-gap: 25px;
|
||||
}
|
||||
|
||||
#donationElt #donationButton {
|
||||
text-align: left;
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (max-width: 600px) {
|
||||
#donationElt {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#donationElt #donationButton {
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
|
||||
.custom-file-label {
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
width: 100%;
|
||||
padding-right: 9em;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.custom-file-label::after {
|
||||
content: attr(data-after);
|
||||
}
|
||||
|
||||
#closePlane {
|
||||
position: fixed;
|
||||
top: 70px;
|
||||
right: 40px;
|
||||
visibility: hidden;
|
||||
opacity: 0;
|
||||
cursor: pointer;
|
||||
z-index: 10000;
|
||||
}
|
||||
|
||||
#closePlane:before {
|
||||
content: "\f00d";
|
||||
font-family: "Font Awesome 5 Pro";
|
||||
color: white;
|
||||
font-size: 3em;
|
||||
}
|
||||
|
||||
#downloadPlaneMessage {
|
||||
position: fixed;
|
||||
z-index: 10000;
|
||||
bottom: 5%;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
color: var(--primary);
|
||||
background-color: white;
|
||||
opacity: 0;
|
||||
visibility: hidden;
|
||||
transition: opacity 0.3s ease-in;
|
||||
}
|
||||
|
||||
@media (max-width: 480px) {
|
||||
#downloadPlaneMessage {
|
||||
bottom: 15%;
|
||||
}
|
||||
}
|
||||
|
||||
#downloadPlaneMessage:before {
|
||||
content: "\f019";
|
||||
font-family: "Font Awesome 5 Pro";
|
||||
color: var(--primary);
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
@ -1,25 +1,43 @@
|
||||
var validExpeMail = false
|
||||
var validExpeLoc = false //turned to true in geocoder.js
|
||||
var validDestMail = false
|
||||
var validDestLoc = false //turned to true in geocoder.js
|
||||
var validExpeMail = false;
|
||||
var validExpeLoc = false; //turned to true in geocoder.js
|
||||
var validDestMail = false;
|
||||
var validDestLoc = false; //turned to true in geocoder.js
|
||||
|
||||
function validateEmail(email) { //from https://stackoverflow.com/questions/46155/how-to-validate-an-email-address-in-javascript
|
||||
const re = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
|
||||
return re.test(String(email).toLowerCase());
|
||||
function validateEmail(email) {
|
||||
//from https://stackoverflow.com/questions/46155/how-to-validate-an-email-address-in-javascript
|
||||
const re =
|
||||
/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
|
||||
return re.test(String(email).toLowerCase());
|
||||
}
|
||||
|
||||
$("#expeMail").change(function() {
|
||||
validExpeMail = validateEmail($("#expeMail").val())
|
||||
checkFormValid()
|
||||
})
|
||||
$("#expeMail").change(function () {
|
||||
validExpeMail = validateEmail($("#expeMail").val());
|
||||
checkFormValid();
|
||||
});
|
||||
|
||||
$("#destMail").change(function() {
|
||||
validDestMail = validateEmail($("#destMail").val())
|
||||
checkFormValid()
|
||||
})
|
||||
$("#destMail").change(function () {
|
||||
validDestMail = validateEmail($("#destMail").val());
|
||||
checkFormValid();
|
||||
});
|
||||
|
||||
function checkFormValid(){
|
||||
if(validExpeMail && validExpeLoc && validDestMail && validDestLoc){
|
||||
$('#sendNewPlane').prop("disabled", false)
|
||||
}
|
||||
document
|
||||
.querySelector(".custom-file-input")
|
||||
.addEventListener("change", function (e) {
|
||||
const file = e.target.files[0];
|
||||
const fileName = file.name;
|
||||
var nextSibling = e.target.nextElementSibling;
|
||||
nextSibling.innerText = fileName;
|
||||
|
||||
const filesize = (file.size / 1024 / 1024).toFixed(4); // MB
|
||||
if (filesize >= 2.2) {
|
||||
e.target.classList.add("is-invalid");
|
||||
} else {
|
||||
e.target.classList.remove("is-invalid");
|
||||
}
|
||||
});
|
||||
|
||||
function checkFormValid() {
|
||||
if (validExpeMail && validExpeLoc && validDestMail && validDestLoc) {
|
||||
$("#sendNewPlane").prop("disabled", false);
|
||||
}
|
||||
}
|
||||
|
1151
src/map.js
1151
src/map.js
File diff suppressed because it is too large
Load Diff
136
src/newPlane.js
136
src/newPlane.js
@ -108,8 +108,30 @@ $("#sendNewPlane").on('click',function(){
|
||||
var message = quill.root.innerHTML
|
||||
|
||||
var randomColor = getRandomColor()
|
||||
|
||||
console.log(message)
|
||||
|
||||
var formData = new FormData()
|
||||
var attachment = $("#attachmentPlane").prop('files')[0];
|
||||
formData.append('file', attachment);
|
||||
formData.append('message', encodeURIComponent(message));
|
||||
formData.append('expeMail', $("#expeMail").val());
|
||||
formData.append('expeKnown', expeKnown);
|
||||
formData.append('expeLang', lang);
|
||||
formData.append('destLang', $("#selectDestLang").val());
|
||||
formData.append('startLat', expeLoc.center[1]);
|
||||
formData.append('startLon', expeLoc.center[0]);
|
||||
formData.append('startName', expeLoc.name);
|
||||
formData.append('startTime', sentDate);
|
||||
formData.append('startTZ', expeTimezone);
|
||||
formData.append('destMail', $("#destMail").val());
|
||||
formData.append('destLat', destLoc.center[1]);
|
||||
formData.append('destLon', destLoc.center[0]);
|
||||
formData.append('destName', destLoc.name);
|
||||
formData.append('public', publicMessage, );
|
||||
formData.append('color', randomColor);
|
||||
formData.append('deliveryTime', deliveryDate);
|
||||
formData.append('deliveryTZ', destTimezone);
|
||||
formData.append('deliveryTimeServer', deliverySecondsServer);
|
||||
formData.append('deliveryMethod', $("#selectTime").val());
|
||||
|
||||
var data = {
|
||||
'message':encodeURIComponent(message),
|
||||
@ -131,76 +153,56 @@ $("#sendNewPlane").on('click',function(){
|
||||
'deliveryTime':deliveryDate,
|
||||
'deliveryTZ':destTimezone,
|
||||
'deliveryTimeServer':deliverySecondsServer,
|
||||
'deliveryMethod':$("#selectTime").val()
|
||||
'deliveryMethod':$("#selectTime").val(),
|
||||
}
|
||||
|
||||
|
||||
var query = 'avionpoeme.php?'+
|
||||
'message='+data.message+'&'+
|
||||
'expeMail='+data.expeMail+'&'+
|
||||
'expeKnown='+data.expeKnown+'&'+
|
||||
'expeLang='+data.expeLang+'&'+
|
||||
'destLang='+data.destLang+'&'+
|
||||
'startLat='+data.startLat+'&'+
|
||||
'startLon='+data.startLon+'&'+
|
||||
'startName='+data.startName+'&'+
|
||||
'startTime='+data.startTime+'&'+
|
||||
'startTZ='+data.startTZ+'&'+
|
||||
'destMail='+data.destMail+'&'+
|
||||
'destLat='+data.destLat+'&'+
|
||||
'destLon='+data.destLon+'&'+
|
||||
'destName='+data.destName+'&'+
|
||||
'public='+data.public+'&'+
|
||||
'color='+data.color+'&'+
|
||||
'deliveryTime='+data.deliveryTime+'&'+
|
||||
'deliveryTZ='+data.deliveryTZ+'&'+
|
||||
'deliveryTimeServer='+data.deliveryTimeServer+'&'+
|
||||
'deliveryMethod='+data.deliveryMethod+'';
|
||||
|
||||
$.post(query, function(result) {
|
||||
result = result.replace(/'/g, '"');
|
||||
console.log(result)
|
||||
result = $.parseJSON(result)
|
||||
var planeId = Number(result.uid);
|
||||
//selecting proper color for back
|
||||
$("#back").attr("src","src/img/back-"+data.color+".jpg");
|
||||
|
||||
// creating image for plane, need to link it to the inputs tog et entered values.
|
||||
var message = quill.root.innerHTML
|
||||
|
||||
var canvas1 = document.getElementById("blankCanvas1"),
|
||||
html = quill.root.innerHTML;
|
||||
|
||||
rasterizeHTML.drawHTML(html, canvas1,{zoom:0.7}).then(function success(renderResult) {
|
||||
$.ajax({
|
||||
url: 'avionpoeme.php',
|
||||
data: formData,
|
||||
processData: false,
|
||||
contentType: false,
|
||||
cache : false,
|
||||
type: 'POST',
|
||||
success: function(result){
|
||||
result = result.replace(/'/g, '"');
|
||||
result = $.parseJSON(result)
|
||||
var planeId = Number(result.uid);
|
||||
//selecting proper color for back
|
||||
$("#back").attr("src","src/img/back-"+randomColor+".jpg");
|
||||
|
||||
var canvas2 = document.getElementById("blankCanvas2");
|
||||
var ctx = canvas2.getContext("2d");
|
||||
ctx.fillStyle = "#"+data.color;
|
||||
ctx.fillRect(0,0,400,400);
|
||||
ctx.drawImage(canvas1, 0, 0,400,400)
|
||||
ctx.fillStyle = "rgb(0,0,0)";
|
||||
ctx.font = "9px Courier";
|
||||
$("#front").attr('src',document.getElementById("blankCanvas2").toDataURL())
|
||||
//display and animate plane
|
||||
$("#canvas3d").css('display','block')
|
||||
animePlane()
|
||||
// creating image for plane, need to link it to the inputs tog et entered values.
|
||||
var message = quill.root.innerHTML
|
||||
|
||||
var canvas1 = document.getElementById("blankCanvas1"),
|
||||
html = quill.root.innerHTML;
|
||||
|
||||
//moving plane at the end
|
||||
setInterval(function(){
|
||||
$("#canvas3d").css('transition','transform 2500ms ease-in-out')
|
||||
$("#canvas3d").css('transform','translate(50vw, -150vh)')
|
||||
},4400);
|
||||
//reloading page (to change)
|
||||
setInterval(function(){
|
||||
window.location.href ='https://avion-poe.me?avion='+planeId+'';
|
||||
},5500);
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
rasterizeHTML.drawHTML(html, canvas1,{zoom:0.7}).then(function success(renderResult) {
|
||||
|
||||
var canvas2 = document.getElementById("blankCanvas2");
|
||||
var ctx = canvas2.getContext("2d");
|
||||
ctx.fillStyle = "#"+data.color;
|
||||
ctx.fillRect(0,0,400,400);
|
||||
ctx.drawImage(canvas1, 0, 0,400,400)
|
||||
ctx.fillStyle = "rgb(0,0,0)";
|
||||
ctx.font = "9px Courier";
|
||||
$("#front").attr('src',document.getElementById("blankCanvas2").toDataURL())
|
||||
//display and animate plane
|
||||
$("#canvas3d").css('display','block')
|
||||
animePlane()
|
||||
|
||||
|
||||
//moving plane at the end
|
||||
setInterval(function(){
|
||||
$("#canvas3d").css('transition','transform 2500ms ease-in-out')
|
||||
$("#canvas3d").css('transform','translate(50vw, -150vh)')
|
||||
},4400);
|
||||
//reloading page (to change)
|
||||
setInterval(function(){
|
||||
window.location.href ='https://www.avion-poe.me/?avion='+planeId+'';
|
||||
},5500);
|
||||
})
|
||||
}
|
||||
});
|
||||
|
||||
})
|
||||
});
|
||||
|
@ -1,164 +1,182 @@
|
||||
var lang = 'en'
|
||||
// Default lang
|
||||
var lang = "en";
|
||||
|
||||
// Lang by session
|
||||
var langSession = sessionStorage.getItem("lang");
|
||||
// Lang by navigator config
|
||||
var userLang = navigator.userLanguage || navigator.language;
|
||||
if (userLang){
|
||||
lang = userLang.substring(0,2)
|
||||
|
||||
if (langSession) {
|
||||
lang = langSession.substring(0, 2);
|
||||
} else if (userLang) {
|
||||
lang = userLang.substring(0, 2);
|
||||
}
|
||||
|
||||
//loading the lang.json file
|
||||
$(document).ready(function(){
|
||||
translateUI(lang)
|
||||
$.getJSON("lang/lang.json", function(data){
|
||||
//creating dropdown list of languages in navbar
|
||||
for (var key in data){
|
||||
$("#langChoices").append( '<a class="dropdown-item langSelect" value="'+key+'" href="#">'+data[key]+'</a>' )
|
||||
$("#selectDestLang").append( '<option value="'+key+'" href="#">'+data[key]+'</option>' )
|
||||
}
|
||||
//setting the user lang
|
||||
if(data[lang]){
|
||||
//$("#navbarDropdownLang").html(data[lang])
|
||||
translateUI(lang)
|
||||
}
|
||||
//or english if not in list
|
||||
else{
|
||||
//$("#navbarDropdownLang").html("English")
|
||||
translateUI('en')
|
||||
}
|
||||
$(".langSelect").on('click',function(e){
|
||||
lang = e.currentTarget.attributes[1].value
|
||||
translateUI(lang)
|
||||
//$("#navbarDropdownLang").html($(this).html())
|
||||
})
|
||||
}).fail(function(error){
|
||||
console.log(error);
|
||||
});
|
||||
$(document).ready(function () {
|
||||
translateUI(lang);
|
||||
$.getJSON("lang/lang.json", function (data) {
|
||||
//creating dropdown list of languages in navbar
|
||||
for (var key in data) {
|
||||
$("#langChoices").append(
|
||||
'<a class="dropdown-item langSelect" value="' +
|
||||
key +
|
||||
'" href="#">' +
|
||||
data[key] +
|
||||
"</a>"
|
||||
);
|
||||
$("#selectDestLang").append(
|
||||
'<option value="' + key + '" href="#">' + data[key] + "</option>"
|
||||
);
|
||||
}
|
||||
//setting the user lang
|
||||
if (data[lang]) {
|
||||
//$("#navbarDropdownLang").html(data[lang])
|
||||
translateUI(lang);
|
||||
}
|
||||
//or english if not in list
|
||||
else {
|
||||
//$("#navbarDropdownLang").html("English")
|
||||
translateUI("en");
|
||||
}
|
||||
$(".langSelect").on("click", function (e) {
|
||||
lang = e.currentTarget.attributes[1].value;
|
||||
sessionStorage.setItem("lang", lang);
|
||||
translateUI(lang);
|
||||
//$("#navbarDropdownLang").html($(this).html())
|
||||
});
|
||||
}).fail(function (error) {
|
||||
console.log(error);
|
||||
});
|
||||
});
|
||||
|
||||
var dictionnary = []
|
||||
var dictionnary = [];
|
||||
|
||||
function translateUI(l){
|
||||
$.getJSON("lang/"+l+"", function(s){
|
||||
//console.log(s)
|
||||
dictionnary = s
|
||||
//if arabic : display left to right (ltr) + troubleshooting a lot of individual elements
|
||||
if (lang == "ar"){
|
||||
//navbar
|
||||
$("nav").css('direction','rtl')
|
||||
$(".nav-menus").removeClass('mr-auto')
|
||||
$(".nav-button").addClass('mr-auto')
|
||||
//form
|
||||
// $(".ql-container").css('direction','rtl')
|
||||
// $(".ql-container").css('float','right')
|
||||
// $(".ql-editor").css('float','right')
|
||||
// $(".ql-editor p").css('float','right')
|
||||
$(".modal-content").css('direction','rtl')
|
||||
$(".bold").css('float','right')
|
||||
$("#public").css('margin-left','5px')
|
||||
$("#prive").css('margin-left','5px')
|
||||
$("#newPlaneModalAnonyme").css('margin-right','25px')
|
||||
$("#newPlaneModalCancel").css('margin-left','8px')
|
||||
$("#closeModal").css('margin-left','0px')
|
||||
$("#closeModal").css('padding-left','0px')
|
||||
//anthology
|
||||
$("#anthology").css('direction','rtl')
|
||||
$("#anthologyDisclaimer").css('float','right')
|
||||
|
||||
}
|
||||
else{
|
||||
//navbar
|
||||
$("nav").css('direction','ltr')
|
||||
$(".nav-menus").addClass('mr-auto')
|
||||
$(".nav-button").removeClass('mr-auto')
|
||||
//form
|
||||
// $(".ql-container").css('direction','ltr')
|
||||
// $(".ql-container").css('float','left')
|
||||
// $(".ql-editor").css('float','left')
|
||||
// $(".ql-editor p").css('float','none')
|
||||
$(".modal-content").css('direction','ltr')
|
||||
$(".bold").css('float','left')
|
||||
$("#public").css('margin-left','0px')
|
||||
$("#prive").css('margin-left','0px')
|
||||
$("#newPlaneModalAnonyme").css('margin-right','0px')
|
||||
$("#newPlaneModalCancel").css('margin-left','0px')
|
||||
//anthology
|
||||
$("#anthology").css('direction','ltr')
|
||||
$("#anthologyDisclaimer").css('float','left')
|
||||
}
|
||||
|
||||
//changing all strings
|
||||
//main page
|
||||
$('head title', window.parent.document).text(s.avionpoeme);
|
||||
$("#navTitle").html(s.avionpoeme)
|
||||
$("#buttonAnthology").html(s.anthologie)
|
||||
$("#buttonAbout").html(s.apropos)
|
||||
$("#buttonNewPlane").val(s.lancer_avion+" "+nbPlane+"/100")
|
||||
//new plane form
|
||||
$("#newPlaneModalTitle").html(s.lancer_avion)
|
||||
$("#newPlaneModalMessage").html(s.message)
|
||||
$("#newPlaneModalPrive").html(s.prive)
|
||||
$("#newPlaneModalPublic").html(s.public)
|
||||
$("#flightTime").html(s.temps_de_vol)
|
||||
$("#newPlaneModalRandom").html(s.aléatoire)
|
||||
$("#newPlaneModal3j").html(s.trois_jours)
|
||||
$("#newPlaneModal7j").html(s.sept_jours)
|
||||
$("#newPlaneModal30j").html(s.trente_jours)
|
||||
$("#newPlaneModal365j").html(s.unan_jours)
|
||||
$("#newPlaneModalExpediteur").html(s.expediteur)
|
||||
$("#newPlaneModalDestinataire").html(s.destinataire)
|
||||
$("#newPlaneModalAnonyme").html(s.anonyme)
|
||||
$("#newPlaneModalCancel").html(s.annuler)
|
||||
$("#sendNewPlane").html(s.lancer)
|
||||
$("#destLang").html(s.langue_destinataire)
|
||||
$("#expeMail").attr("placeholder", s.expeMail_placeholder)
|
||||
$("#expeGeocoderPhoton").attr("placeholder", s.expeLoc_placeholder)
|
||||
$("#destMail").attr("placeholder", s.destMail_placeholder)
|
||||
$("#destGeocoderPhoton").attr("placeholder", s.destLoc_placeholder)
|
||||
$('#anonymeTooltip').attr("title", s.anonyme_tooltip).tooltip("_fixTitle");
|
||||
$('#publicTooltip').attr("title", s.public_tooltip).tooltip("_fixTitle");
|
||||
|
||||
$('#selectDestLang option[value="'+lang+'"]').prop('selected', true); //selecting by default recipient language same as interface
|
||||
//Anthology
|
||||
displayAnthology()
|
||||
$("#anthologyTitle").html(s.anthologie)
|
||||
$("#anthologyDisclaimer").html(s.suppr_message_public)
|
||||
$("#closeAnthologyAbout").html(s.retour_carte)
|
||||
|
||||
//About
|
||||
$("#aboutTitle").html(s.apropos)
|
||||
$("#librairies").html(s.librairies)
|
||||
$("#mapSources").html(s.source_carte)
|
||||
$("#mapBackground").html(s.map_background)
|
||||
$("#clouds").html(s.clouds)
|
||||
$.getJSON("lang/about.json", function(e){
|
||||
if(lang !== 'en' && lang !== 'fr' && lang !== 'de'){
|
||||
$("#aboutText").html(e[0].en)
|
||||
}
|
||||
else{
|
||||
$("#aboutText").html(e[0][lang])
|
||||
}
|
||||
})
|
||||
|
||||
//plane limit tooltip
|
||||
if (nbPlane > 99){
|
||||
$("#planeLimitTooltip").attr("title", s.AvionPoeme_epuise).tooltip("_fixTitle");
|
||||
}
|
||||
else{
|
||||
var remainingPlanes = 100 - nbPlane;
|
||||
s.NB_AvionPoeme_restant = s.NB_AvionPoeme_restant.replace('$NB_avion_poeme',remainingPlanes)
|
||||
$("#planeLimitTooltip").attr("title", s.NB_AvionPoeme_restant).tooltip("_fixTitle");
|
||||
}
|
||||
|
||||
})
|
||||
.always(function(callback) {
|
||||
//console.log( callback );
|
||||
});
|
||||
function translateUI(l) {
|
||||
$.getJSON("lang/" + l + "", function (s) {
|
||||
dictionnary = s;
|
||||
//if arabic : display left to right (ltr) + troubleshooting a lot of individual elements
|
||||
if (lang == "ar") {
|
||||
//navbar
|
||||
$("nav").css("direction", "rtl");
|
||||
$(".nav-menus").removeClass("mr-auto");
|
||||
$(".nav-button").addClass("mr-auto");
|
||||
//form
|
||||
// $(".ql-container").css('direction','rtl')
|
||||
// $(".ql-container").css('float','right')
|
||||
// $(".ql-editor").css('float','right')
|
||||
// $(".ql-editor p").css('float','right')
|
||||
$(".modal-content").css("direction", "rtl");
|
||||
$(".bold").css("float", "right");
|
||||
$("#public").css("margin-left", "5px");
|
||||
$("#prive").css("margin-left", "5px");
|
||||
$("#newPlaneModalAnonyme").css("margin-right", "25px");
|
||||
$("#newPlaneModalCancel").css("margin-left", "8px");
|
||||
$("#closeModal").css("margin-left", "0px");
|
||||
$("#closeModal").css("padding-left", "0px");
|
||||
//anthology
|
||||
$("#anthology").css("direction", "rtl");
|
||||
$("#anthologyDisclaimer").css("float", "right");
|
||||
} else {
|
||||
//navbar
|
||||
$("nav").css("direction", "ltr");
|
||||
$(".nav-menus").addClass("mr-auto");
|
||||
$(".nav-button").removeClass("mr-auto");
|
||||
//form
|
||||
// $(".ql-container").css('direction','ltr')
|
||||
// $(".ql-container").css('float','left')
|
||||
// $(".ql-editor").css('float','left')
|
||||
// $(".ql-editor p").css('float','none')
|
||||
$(".modal-content").css("direction", "ltr");
|
||||
$(".bold").css("float", "left");
|
||||
$("#public").css("margin-left", "0px");
|
||||
$("#prive").css("margin-left", "0px");
|
||||
$("#newPlaneModalAnonyme").css("margin-right", "0px");
|
||||
$("#newPlaneModalCancel").css("margin-left", "0px");
|
||||
//anthology
|
||||
$("#anthology").css("direction", "ltr");
|
||||
$("#anthologyDisclaimer").css("float", "left");
|
||||
}
|
||||
|
||||
//changing all strings
|
||||
//main page
|
||||
$("head title", window.parent.document).text(s.avionpoeme);
|
||||
$("#navTitle").html(s.avionpoeme);
|
||||
$("#buttonAnthology").html(s.anthologie);
|
||||
$("#buttonAbout").html(s.apropos);
|
||||
$("#buttonNewPlane").val(s.lancer_avion + " " + nbPlane + "/100");
|
||||
//new plane form
|
||||
$("#newPlaneModalTitle").html(s.lancer_avion);
|
||||
$("#newPlaneModalMessage").html(s.message);
|
||||
$("#newPlaneModalPrive").html(s.prive);
|
||||
$("#newPlaneModalPublic").html(s.public);
|
||||
$("#labelAttachment").html(s.PJ_Ajouter);
|
||||
console.log(s);
|
||||
$("#attachmentPlaneLabel").attr("data-after", s.PJ_Parcourir);
|
||||
$("#flightTime").html(s.temps_de_vol);
|
||||
$("#newPlaneModalRandom").html(s.aléatoire);
|
||||
$("#newPlaneModal3j").html(s.trois_jours);
|
||||
$("#newPlaneModal7j").html(s.sept_jours);
|
||||
$("#newPlaneModal30j").html(s.trente_jours);
|
||||
$("#newPlaneModal365j").html(s.unan_jours);
|
||||
$("#newPlaneModalExpediteur").html(s.expediteur);
|
||||
$("#newPlaneModalDestinataire").html(s.destinataire);
|
||||
$("#newPlaneModalAnonyme").html(s.anonyme);
|
||||
$("#newPlaneModalCancel").html(s.annuler);
|
||||
$("#sendNewPlane").html(s.lancer);
|
||||
$("#destLang").html(s.langue_destinataire);
|
||||
$("#expeMail").attr("placeholder", s.expeMail_placeholder);
|
||||
$("#expeGeocoderPhoton").attr("placeholder", s.expeLoc_placeholder);
|
||||
$("#destMail").attr("placeholder", s.destMail_placeholder);
|
||||
$("#destGeocoderPhoton").attr("placeholder", s.destLoc_placeholder);
|
||||
$("#anonymeTooltip").attr("title", s.anonyme_tooltip).tooltip("_fixTitle");
|
||||
$("#publicTooltip").attr("title", s.public_tooltip).tooltip("_fixTitle");
|
||||
|
||||
$('#selectDestLang option[value="' + lang + '"]').prop("selected", true); //selecting by default recipient language same as interface
|
||||
|
||||
//About
|
||||
$("#aboutTitle").html(s.apropos);
|
||||
$("#librairies").html(s.librairies);
|
||||
$("#mapSources").html(s.source_carte);
|
||||
$("#mapBackground").html(s.map_background);
|
||||
$("#clouds").html(s.clouds);
|
||||
$.getJSON("lang/about.json", function (e) {
|
||||
if (lang !== "en" && lang !== "fr" && lang !== "de") {
|
||||
$("#aboutText").html(e[0].en);
|
||||
} else {
|
||||
$("#aboutText").html(e[0][lang]);
|
||||
}
|
||||
$("#donationText").html(s.AvionPoeme_free_independent);
|
||||
$("#donationButtonText").html(s.Soutenez_avionpoeme);
|
||||
$("#donationButtonText").addClass(lang);
|
||||
});
|
||||
|
||||
//plane limit tooltip
|
||||
if (typeof nbPlane !== "undefined") {
|
||||
if (nbPlane > 99) {
|
||||
$("#planeLimitTooltip")
|
||||
.attr("title", s.AvionPoeme_epuise)
|
||||
.tooltip("_fixTitle");
|
||||
} else {
|
||||
var remainingPlanes = 100 - nbPlane;
|
||||
s.NB_AvionPoeme_restant = s.NB_AvionPoeme_restant.replace(
|
||||
"$NB_avion_poeme",
|
||||
remainingPlanes
|
||||
);
|
||||
$("#planeLimitTooltip")
|
||||
.attr("title", s.NB_AvionPoeme_restant)
|
||||
.tooltip("_fixTitle");
|
||||
}
|
||||
}
|
||||
}).always(function (callback) {
|
||||
//console.log( callback );
|
||||
});
|
||||
}
|
||||
|
||||
//hovering lang icon
|
||||
$( "#navbarDropdownLang" ).mouseenter(function() {
|
||||
$("#langIcon").attr("src","src/img/lang-hover.png");
|
||||
$("#navbarDropdownLang").mouseenter(function () {
|
||||
$("#langIcon").attr("src", "src/img/lang-hover.png");
|
||||
});
|
||||
$( "#navbarDropdownLang" ).mouseleave(function() {
|
||||
$("#langIcon").attr("src","src/img/lang.png");
|
||||
$("#navbarDropdownLang").mouseleave(function () {
|
||||
$("#langIcon").attr("src", "src/img/lang.png");
|
||||
});
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user