diff --git a/.htaccess b/.htaccess index 712feb7..2d6bacc 100644 --- a/.htaccess +++ b/.htaccess @@ -1,27 +1,27 @@ -Options -Indexes +Options -Indexes +FollowSymLinks -SymLinksIfOwnerMatch RewriteEngine on ## Sécurité RewriteRule ^([0-9]+-[0-9]{1,2})/.key-[0-9]{12}$ /index.php?action=403 RewriteRule ^files/([0-9]+-[0-9]{1,2})/.key-[0-9]{12} /index.php?action=403 RewriteRule ^config.yaml$ index.php?action=403 RewriteRule ^cron.php$ index.php?action=403 ## Rewrite # direct RewriteRule ^([0-9]+-[0-9]{1,2})/(.+)$ files/$1/$2 [L] # html page RewriteRule ^([0-9]+-[0-9]{1,2})/ index.php?action=html&id=$1&%{QUERY_STRING} [L] # download force RewriteRule ^dl/([0-9]+-[0-9]{1,2})/(.+)$ index.php?action=dl&id=$1&file=$2 [L] # delete RewriteRule ^del/([0-9]+-[0-9]{1,2})/([0-9]{12})/(.+)$ index.php?action=del&id=$1&key=$2&file=$3 [L] RewriteRule ^del/([0-9]+-[0-9]{1,2})/([0-9]{12})/$ index.php?action=del&id=$1&key=$2 [L] # zip RewriteRule ^([0-9]+-[0-9]{1,2})\.zip$ index.php?action=zip&id=$1 [L] # Mes fichiers RewriteRule ^My$ index.php?action=myFiles&%{QUERY_STRING} [L] # Pages RewriteRule ^(.+)\.html$ index.php?action=page&name=$1&%{QUERY_STRING} [L] # Error ErrorDocument 404 /index.php?action=404 ErrorDocument 403 /index.php?action=403 diff --git a/index.php b/index.php index a864071..b49ea89 100644 --- a/index.php +++ b/index.php @@ -1,500 +1,510 @@ '; $lang_from_http_accept = explode(',', $HTTP_ACCEPT_LANGUAGE); //echo $lang_from_http_accept[0].'
'; $locale = lang2locale($lang_from_http_accept[0]); if (substr($locale,0,2) != substr($lang_from_http_accept[0],0,2)) { //echo "Non trouvé, 2ème tentative"; $lang_from_http_accept = explode('-', $lang_from_http_accept[0]); //echo $lang_from_http_accept[0].'
'; $locale = lang2locale($lang_from_http_accept[0]); } //echo $locale.'
'; $localeshort=locale2lang($locale); } } // Définition de la langue : $results=putenv("LC_ALL=$locale.utf8"); if (!$results) { exit ('putenv failed'); } $results=putenv("LC_LANG=$locale.utf8"); if (!$results) { exit ('putenv failed'); } $results=putenv("LC_LANGUAGE=$locale.utf8"); if (!$results) { exit ('putenv failed'); } $results=setlocale(LC_ALL, "$locale.utf8"); if (!$results) { exit ('setlocale failed: locale function is not available on this platform, or the given local does not exist in this environment'); } bindtextdomain("messages", "./lang"); textdomain("messages"); /* / language */ if (convertHumain2octect($config['maxUploadPerFile']) > convertHumain2octect(ini_get('upload_max_filesize'))) { exit(printf(_('In coherence with your configuration (config.yaml) you must increase the PHP configuration upload_max_filesize to %s'), $config['maxUploadPerFile'])); } if (convertHumain2octect($config['maxUploadPerFile']) > convertHumain2octect(ini_get('post_max_size'))) { exit(printf(_('In coherence with your configuration (config.yaml) you must increase the PHP configuration post_max_size to %s'), $config['maxUploadPerFile'])); } if (convertHumain2octect($config['maxUploadNb']) > convertHumain2octect(ini_get('max_file_uploads'))) { exit(printf(_('In coherence with your configuration (config.yaml) you must increase the PHP configuration max_file_uploads to %s'), $config['maxUploadNb'])); } // ZIP ou DL if (isset($_GET['action']) && ($_GET['action'] == 'zip' || $_GET['action'] == 'dl')) { $uploadDirId=$config['uploadDir'].'/'.$id.'/'; if ($_GET['action'] == 'zip') { genZip($id); $filename = $id.'.zip'; $contentType='application/zip'; } elseif ($_GET['action'] == 'dl') { $filename = $_GET['file']; $contentType=mime_content_type($uploadDirId.$filename); } // HTTP Headers File Downloads // https://perishablepress.com/press/2010/11/17/http-headers-file-downloads/ // http headers for zip downloads if (headers_sent()) { echo 'HTTP header already sent'; } else { if (!is_file($uploadDirId.$filename)) { header($_SERVER['SERVER_PROTOCOL'].' 404 Not Found'); echo 'File not found'; } else if (!is_readable($uploadDirId.$filename)) { header($_SERVER['SERVER_PROTOCOL'].' 403 Forbidden'); echo 'File not readable'; } else { header($_SERVER['SERVER_PROTOCOL'].' 200 OK'); header("Pragma: public"); header("Expires: 0"); header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); header("Cache-Control: public"); header("Content-Description: File Transfer"); header("Content-Type: ".$contentType); header("Content-Disposition: attachment; filename=\"".$filename."\""); header("Content-Transfer-Encoding: binary"); header("Content-Length: ".filesize($uploadDirId.$filename)); @readfile($uploadDirId.$filename); } } exit(); } + +@include_once('./header.php'); + // Del if (isset($_GET['action']) && $_GET['action'] == 'del') { echo $config['uploadDir'].'/'.$id.'/.key-'.$_GET['key']; print_r($_GET); if (! is_file($config['uploadDir'].'/'.$id.'/.key-'.$_GET['key'])) exit('No hack 5 - delete not Unauthorized'); // Si c'est juste un fichier if (isset($_GET['file'])) { @unlink($config['uploadDir'].'/'.$id.'/'.$_GET['file']); @unlink($config['uploadDir'].'/'.$id.'/.'.$_GET['file'].'.small'); // Si c'est le dernire, on supprime le tout $uploadDirId = $config['uploadDir'].'/'.$id.'/'; $nbFile=0; foreach (scandir($uploadDirId) as $file) { if (is_file($uploadDirId.'/'.$file) && $file != $id.'.zip' && !preg_match('/^.key-[0-9]{12}$/', $file) && !preg_match('/^\.(.+)\.small$/', $file)) { $nbFile++; } } if ($nbFile == 0) { rrmdir($config['uploadDir'].'/'.$id.'/'); } } else { // Si c'est le dossier rrmdir($config['uploadDir'].'/'.$id.'/'); $nbFile = 0; } if ($nbFile == 0) { header('Status: 301 Moved Permanently', false, 301); header('Location: '.$config['baseUrl']); } else { header('Status: 301 Moved Permanently', false, 301); header('Location: '.$config['baseUrl'].'/'.$id.'/'); } exit(); } ?> <?= $config['shortTitle'] ?> : <?= $config['title'] ?> - - - + + + + + +
$lang) { $flag=''; if ($localeshort == $langShort) { $flag=' drapeauActif'; } echo ''.$langShort.''; } ?>
'._('Maintenance').''; echo '

'.$config['maintenanceMsg'].'

'; } else { // signaler au mainteneur que le mode maintenance est à true if ($config['maintenanceMod'] == true) { echo '

'._('Mode Maintenance as true').'

'; } @include_once('./header-page.php'); $similarServicesLink=''; if ($config['similarServicesView']) { $similarServicesLink='
'; } $uploadDirId=$config['uploadDir'].'/'.$id; $action = null; if (isset($_GET['action'])) { $action = $_GET['action']; } if (!is_writable($config['uploadDir'])) { $action = 'ErrorUploadDir'; } if ($action == 'html' && !is_dir($config['uploadDir'].'/'.$id)) { $action = '404'; } if (!$config['htmlPages'] && $action == 'page') { $action = '404'; } $echoNewUpload = '
'.$similarServicesLink.'
'; switch ($action) { case 'ErrorUploadDir': echo '
'; printf(_('Error: The directory (%s) is not writable, please contact the service administrator'), $config['uploadDir']); echo '
'; break; case 'page': foreach ($config['htmlPages'] as $fileName => $name) { if ($_GET['name'] == $fileName) { $page['fileName'] = $fileName; $page['name'] = $name; } } if (empty($page['name'])) { echo '

'._('The requested page does not exist').'

'; } elseif (!is_file('htmlPages/'.$page['fileName'].'.html')) { echo '

'._('The requested page does not exist').'

'; } else { include('htmlPages/'.$page['fileName'].'.html'); } echo $echoNewUpload; break; case 'html': echo '

'.$config['shortTitle'].' : '.$config['title'].'

'; $expire=explode('-', $id); $dateExpire=date('d/m/Y H:m', $expire[0]); $dStart = new DateTime(date('Y-m-d', $expire[0])); $dEnd = new DateTime(date('Y-m-d')); $dDiff = $dStart->diff($dEnd); $dayExpire = $dDiff->format('%a'); $classExpire =''; if ($dayExpire < 2) { $classExpire='verySpeedDownload'; }elseif ($dayExpire < 5) { $classExpire='speedDownload'; } printf('

'._('These files will be automatically deleted on %s, ie in %d days').'

', $dateExpire, $dayExpire); $nbFile=0; foreach (scandir($uploadDirId) as $file) { if (is_file($uploadDirId.'/'.$file) && $file != $id.'.zip' && !preg_match('/^.key-[0-9]{12}$/', $file) && !preg_match('/^\.(.+)\.small$/', $file)) { $filesInUploadDirId[]=$file; $nbFile++; } } if ($nbFile == 0) { echo '

'._('Error: Nothing to display').'

'; } elseif ($nbFile == 1) { echo '
'; echo '
html
'; echo ''; echo '
'; echo '
'; } elseif ($nbFile > 1) { $linkDownload=$config['baseUrl'].$id.'.zip'; echo '
'; echo '
zip
'; echo ''; echo '
'; echo '
'; echo '
'; } $idFile=0; foreach ($filesInUploadDirId as $fileInUploadDirId) { $pathInfo = pathinfo($uploadDirId.'/'.$fileInUploadDirId); $linkDownload=$config['baseUrl'].'dl/'.$id.'/'.$fileInUploadDirId; echo '
'; echo '
'; echo '
'; if (preg_match('/^image\/(png|jpeg|gif)$/', mime_content_type($pathInfo['dirname'].'/'.$pathInfo['basename']))) { if (!is_file($pathInfo['dirname'].'/.'.$pathInfo['basename'].'.small')) { resize_image($pathInfo['dirname'].'/'.$pathInfo['basename'], $pathInfo['dirname'].'/.'.$pathInfo['basename'].'.small' , 60, 60); } if (is_file($pathInfo['dirname'].'/.'.$pathInfo['basename'].'.small')) { echo ''; } else { echo '
'.$pathInfo['extension'].'
'; } } else { echo '
'.$pathInfo['extension'].'
'; } echo '
'; echo ''; echo '
'; echo ''._('Size').' : '.convertOctect2humain(filesize($pathInfo['dirname'].'/'.$pathInfo['basename'])).' '; echo ''._('Type').' : '.mime_content_type($pathInfo['dirname'].'/'.$pathInfo['basename']).' '; //echo ''._('Type').' : '.mime_content_type($pathInfo['dirname'].'/'.$pathInfo['basename']).' '; echo '
'; echo '
'; echo '
'; echo '
'; $idFile++; } echo $echoNewUpload; ?>

:

free of rights (license Beerware) and free.') ?>

'.$config['shortTitle'].' : 403 '._('Unauthorized access').''; echo '

'._('Unauthorized access').'

'; echo $echoNewUpload; break; case '404': echo '

'.$config['shortTitle'].' : 404 '._('Not Found').'

'; echo '

'._('This sharing does not exist, it has probably expired').'

'; echo $echoNewUpload; break; default: ?>

:

free of rights (license Beerware) and free.') ?>

:
:
diff --git a/lang/fr_FR/LC_MESSAGES/messages.mo b/lang/fr_FR/LC_MESSAGES/messages.mo index e92807a..3dca561 100644 Binary files a/lang/fr_FR/LC_MESSAGES/messages.mo and b/lang/fr_FR/LC_MESSAGES/messages.mo differ diff --git a/lang/fr_FR/LC_MESSAGES/messages.po b/lang/fr_FR/LC_MESSAGES/messages.po index 574f281..6565cfe 100644 --- a/lang/fr_FR/LC_MESSAGES/messages.po +++ b/lang/fr_FR/LC_MESSAGES/messages.po @@ -1,226 +1,246 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR , YEAR. # msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-11-18 18:12+0100\n" -"PO-Revision-Date: 2019-11-18 23:01+0100\n" +"POT-Creation-Date: 2019-11-20 01:37+0100\n" +"PO-Revision-Date: 2019-11-20 01:47+0100\n" +"Last-Translator: \n" "Language-Team: \n" +"Language: fr_FR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: Poedit 2.0.6\n" -"Last-Translator: \n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" -"Language: fr_FR\n" #: cron.php:7 msgid "Start the command in the file2link directory" msgstr "Lancer la commande dans le répertoire de travail file2link" #: cron.php:10 msgid "Completed" msgstr "Terminé" #: cron.php:12 msgid "expireCron is not at \"cli\" mod (in config.yaml)" msgstr "expireCron n'est pas à la valeur \"cli\" (dans le config.yaml)" -#: index.php:19 +#: functions.php:111 +msgid "Expired" +msgstr "Expiré" + +#: index.php:66 #, php-format msgid "" "In coherence with your configuration (config.yaml) you must increase the PHP " "configuration upload_max_filesize to %s" msgstr "" "En cohérence avec votre configuration (config.yaml), vous devez modifier la " -"configuration PHP upload_max_filesize à%s" +"configuration PHP upload_max_filesize à %s" -#: index.php:22 +#: index.php:69 #, php-format msgid "" "In coherence with your configuration (config.yaml) you must increase the PHP " "configuration post_max_size to %s" msgstr "" "En cohérence avec votre configuration (config.yaml), vous devez modifier la " -"configuration PHP post_max_size à%s" +"configuration PHP post_max_size à %s" -#: index.php:25 +#: index.php:72 #, php-format msgid "" "In coherence with your configuration (config.yaml) you must increase the PHP " "configuration max_file_uploads to %s" msgstr "" "En cohérence avec votre configuration (config.yaml), vous devez modifier la " -"configuration PHP max_file_uploads à%s" +"configuration PHP max_file_uploads à %s" -#: index.php:121 upload.php:43 +#: index.php:171 upload.php:43 #, php-format msgid "this file exceeds the allowed size %s" msgstr "ce fichier dépasse la taille autorisée %s" -#: index.php:122 +#: index.php:172 #, php-format msgid "The total size of the files exceeds the allowed size : %s" msgstr "La taille totale des fichiers dépasse la taille autorisée: %s" -#: index.php:123 +#: index.php:173 #, php-format msgid "You can not send more than %d files at a time" msgstr "Vous ne pouvez pas envoyer plus de %d fichiers à la fois" -#: index.php:124 +#: index.php:174 #, php-format msgid "this type of file isn\\'t allow" msgstr "ce type de fichier n’autorise pas" -#: index.php:146 +#: index.php:210 +msgid "Maintenance" +msgstr "Maintenance" + +#: index.php:216 +msgid "Mode Maintenance as true" +msgstr "Le mode maintenance est activé" + +#: index.php:223 msgid "Similar services" msgstr "Services similaires" -#: index.php:179 +#: index.php:245 +msgid "Send a new file" +msgstr "Envoyez un nouveau fichier" + +#: index.php:246 +msgid "See the files already sent" +msgstr "Voir les fichiers déjà envoyés" + +#: index.php:256 #, php-format msgid "" "Error: The directory (%s) is not writable, please contact the service " "administrator" msgstr "" "Erreur: le répertoire (%s) n'est pas accessible en écriture, veuillez " "contacter l'administrateur du service" -#: index.php:190 index.php:192 +#: index.php:267 index.php:269 msgid "The requested page does not exist" msgstr "La page demandée n'existe pas" -#: index.php:212 +#: index.php:289 #, php-format msgid "These files will be automatically deleted on %s, ie in %d days" msgstr "" "Ces fichiers seront automatiquement supprimés le %s, c'est-à-dire dans %d " "jours" -#: index.php:224 +#: index.php:301 msgid "Error: Nothing to display" msgstr "Erreur: rien à afficher" -#: index.php:228 +#: index.php:305 msgid "This page" msgstr "Cette page" -#: index.php:235 +#: index.php:312 msgid "All" msgstr "Tout" -#: index.php:235 +#: index.php:312 msgid "Delete all (permanently)" msgstr "Supprimer tout (définitivement)" -#: index.php:262 +#: index.php:313 index.php:314 index.php:343 index.php:344 +msgid "Click to copy the link to the clipboard" +msgstr "Cliquer pour copier le lien dans le presse papier" + +#: index.php:339 msgid "Size" msgstr "Taille" -#: index.php:263 +#: index.php:340 msgid "Type" msgstr "Type" -#: index.php:294 +#: index.php:371 msgid "My files" msgstr "Mes fichiers" -#: index.php:295 index.php:348 +#: index.php:372 index.php:425 msgid "" "Online file sharing service free of rights (license Beerware) and free." msgstr "" "Service de partage de fichiers en ligne libre de droits (licence Bière ) et gratuite." -#: index.php:300 index.php:362 +#: index.php:377 index.php:439 msgid "Expire" msgstr "Expiration" -#: index.php:300 +#: index.php:377 msgid "Link" msgstr "Lien" -#: index.php:323 +#: index.php:400 msgid "No files, maybe all of them have expired." msgstr "Aucun fichier, peut-être que tous ont expiré." -#: index.php:326 +#: index.php:403 msgid "All your files have expired." msgstr "Tous vos fichiers ont expiré." -#: index.php:333 index.php:334 +#: index.php:410 index.php:411 msgid "Unauthorized access" msgstr "Accès non autorisé" -#: index.php:338 +#: index.php:415 msgid "Not Found" msgstr "Introuvable" -#: index.php:339 +#: index.php:416 msgid "This sharing does not exist, it has probably expired" msgstr "Ce partage n'existe pas, il a probablement expiré" -#: index.php:366 index.php:368 +#: index.php:443 index.php:445 msgid "day" msgstr "jour" -#: index.php:373 +#: index.php:450 msgid "Images resize" msgstr "Redimensionner les images" -#: index.php:378 +#: index.php:455 msgid "No resizing" msgstr "Pas de redimensionnement" -#: index.php:388 +#: index.php:465 #, php-format msgid "The limit per file is %dM, and the total limit per upload is %dM" msgstr "" "La limite par fichier est de %dM et la limite totale par téléchargement est " "de %dM" -#: index.php:398 +#: index.php:475 msgid "By" msgstr "Par" -#: index.php:398 +#: index.php:475 msgid "Git repository" msgstr "Source git" -#: index.php:399 +#: index.php:476 msgid "version" msgstr "version" -#: index.php:399 +#: index.php:476 msgid "" "is an open software licensed Beerware" msgstr "" "est un logiciel libre sous licence Beerware " #: upload.php:37 #, php-format msgid "this type of file isn't allow" msgstr "ce type de fichier n'est pas autorisé" #: upload.php:49 #, php-format msgid "The total size of the files exceeds the allowed size %s" msgstr "La taille totale des fichiers dépasse la taille autorisée %s" #: upload.php:71 #, php-format msgid "Unknown error" msgstr "Erreur inconnue" - -#: lib/functions.php:104 -msgid "Expired" -msgstr "Expiré" diff --git a/lang/messages.pot b/lang/messages.pot index 782dc92..66bbb08 100644 --- a/lang/messages.pot +++ b/lang/messages.pot @@ -1,209 +1,228 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR , YEAR. # #, fuzzy msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-11-18 18:12+0100\n" +"POT-Creation-Date: 2019-11-20 01:37+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" #: cron.php:7 msgid "Start the command in the file2link directory" msgstr "" #: cron.php:10 msgid "Completed" msgstr "" #: cron.php:12 msgid "expireCron is not at \"cli\" mod (in config.yaml)" msgstr "" -#: index.php:19 +#: functions.php:111 +msgid "Expired" +msgstr "" + +#: index.php:66 #, php-format msgid "" "In coherence with your configuration (config.yaml) you must increase the PHP " "configuration upload_max_filesize to %s" msgstr "" -#: index.php:22 +#: index.php:69 #, php-format msgid "" "In coherence with your configuration (config.yaml) you must increase the PHP " "configuration post_max_size to %s" msgstr "" -#: index.php:25 +#: index.php:72 #, php-format msgid "" "In coherence with your configuration (config.yaml) you must increase the PHP " "configuration max_file_uploads to %s" msgstr "" -#: index.php:121 upload.php:43 +#: index.php:171 upload.php:43 #, php-format msgid "this file exceeds the allowed size %s" msgstr "" -#: index.php:122 +#: index.php:172 #, php-format msgid "The total size of the files exceeds the allowed size : %s" msgstr "" -#: index.php:123 +#: index.php:173 #, php-format msgid "You can not send more than %d files at a time" msgstr "" -#: index.php:124 +#: index.php:174 #, php-format msgid "this type of file isn\\'t allow" msgstr "" -#: index.php:146 +#: index.php:210 +msgid "Maintenance" +msgstr "" + +#: index.php:216 +msgid "Mode Maintenance as true" +msgstr "" + +#: index.php:223 msgid "Similar services" msgstr "" -#: index.php:179 +#: index.php:245 +msgid "Send a new file" +msgstr "" + +#: index.php:246 +msgid "See the files already sent" +msgstr "" + +#: index.php:256 #, php-format msgid "" "Error: The directory (%s) is not writable, please contact the service " "administrator" msgstr "" -#: index.php:190 index.php:192 +#: index.php:267 index.php:269 msgid "The requested page does not exist" msgstr "" -#: index.php:212 +#: index.php:289 #, php-format msgid "These files will be automatically deleted on %s, ie in %d days" msgstr "" -#: index.php:224 +#: index.php:301 msgid "Error: Nothing to display" msgstr "" -#: index.php:228 +#: index.php:305 msgid "This page" msgstr "" -#: index.php:235 +#: index.php:312 msgid "All" msgstr "" -#: index.php:235 +#: index.php:312 msgid "Delete all (permanently)" msgstr "" -#: index.php:262 +#: index.php:313 index.php:314 index.php:343 index.php:344 +msgid "Click to copy the link to the clipboard" +msgstr "" + +#: index.php:339 msgid "Size" msgstr "" -#: index.php:263 +#: index.php:340 msgid "Type" msgstr "" -#: index.php:294 +#: index.php:371 msgid "My files" msgstr "" -#: index.php:295 index.php:348 +#: index.php:372 index.php:425 msgid "" "Online file sharing service free of rights (license Beerware) and free." msgstr "" -#: index.php:300 index.php:362 +#: index.php:377 index.php:439 msgid "Expire" msgstr "" -#: index.php:300 +#: index.php:377 msgid "Link" msgstr "" -#: index.php:323 +#: index.php:400 msgid "No files, maybe all of them have expired." msgstr "" -#: index.php:326 +#: index.php:403 msgid "All your files have expired." msgstr "" -#: index.php:333 index.php:334 +#: index.php:410 index.php:411 msgid "Unauthorized access" msgstr "" -#: index.php:338 +#: index.php:415 msgid "Not Found" msgstr "" -#: index.php:339 +#: index.php:416 msgid "This sharing does not exist, it has probably expired" msgstr "" -#: index.php:366 index.php:368 +#: index.php:443 index.php:445 msgid "day" msgstr "" -#: index.php:373 +#: index.php:450 msgid "Images resize" msgstr "" -#: index.php:378 +#: index.php:455 msgid "No resizing" msgstr "" -#: index.php:388 +#: index.php:465 #, php-format msgid "The limit per file is %dM, and the total limit per upload is %dM" msgstr "" -#: index.php:398 +#: index.php:475 msgid "By" msgstr "" -#: index.php:398 +#: index.php:475 msgid "Git repository" msgstr "" -#: index.php:399 +#: index.php:476 msgid "version" msgstr "" -#: index.php:399 +#: index.php:476 msgid "" "is an open software licensed Beerware" msgstr "" #: upload.php:37 #, php-format msgid "this type of file isn't allow" msgstr "" #: upload.php:49 #, php-format msgid "The total size of the files exceeds the allowed size %s" msgstr "" #: upload.php:71 #, php-format msgid "Unknown error" msgstr "" - -#: lib/functions.php:104 -msgid "Expired" -msgstr "" - diff --git a/lib/jquery-ui.min.css b/lib/jquery-ui.min.css new file mode 100644 index 0000000..e12a835 --- /dev/null +++ b/lib/jquery-ui.min.css @@ -0,0 +1,7 @@ +/*! jQuery UI - v1.12.1 - 2019-11-20 +* http://jqueryui.com +* Includes: core.css, tooltip.css, theme.css +* To view and modify this theme, visit http://jqueryui.com/themeroller/?scope=&folderName=base&cornerRadiusShadow=8px&offsetLeftShadow=0px&offsetTopShadow=0px&thicknessShadow=5px&opacityShadow=30&bgImgOpacityShadow=0&bgTextureShadow=flat&bgColorShadow=666666&opacityOverlay=30&bgImgOpacityOverlay=0&bgTextureOverlay=flat&bgColorOverlay=aaaaaa&iconColorError=cc0000&fcError=5f3f3f&borderColorError=f1a899&bgTextureError=flat&bgColorError=fddfdf&iconColorHighlight=777620&fcHighlight=777620&borderColorHighlight=dad55e&bgTextureHighlight=flat&bgColorHighlight=fffa90&iconColorActive=ffffff&fcActive=ffffff&borderColorActive=003eff&bgTextureActive=flat&bgColorActive=007fff&iconColorHover=555555&fcHover=2b2b2b&borderColorHover=cccccc&bgTextureHover=flat&bgColorHover=ededed&iconColorDefault=777777&fcDefault=454545&borderColorDefault=c5c5c5&bgTextureDefault=flat&bgColorDefault=f6f6f6&iconColorContent=444444&fcContent=333333&borderColorContent=dddddd&bgTextureContent=flat&bgColorContent=ffffff&iconColorHeader=444444&fcHeader=333333&borderColorHeader=dddddd&bgTextureHeader=flat&bgColorHeader=e9e9e9&cornerRadius=3px&fwDefault=normal&fsDefault=1em&ffDefault=Arial%2CHelvetica%2Csans-serif +* Copyright jQuery Foundation and other contributors; Licensed MIT */ + +.ui-helper-hidden{display:none}.ui-helper-hidden-accessible{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.ui-helper-reset{margin:0;padding:0;border:0;outline:0;line-height:1.3;text-decoration:none;font-size:100%;list-style:none}.ui-helper-clearfix:before,.ui-helper-clearfix:after{content:"";display:table;border-collapse:collapse}.ui-helper-clearfix:after{clear:both}.ui-helper-zfix{width:100%;height:100%;top:0;left:0;position:absolute;opacity:0;filter:Alpha(Opacity=0)}.ui-front{z-index:100}.ui-state-disabled{cursor:default!important;pointer-events:none}.ui-icon{display:inline-block;vertical-align:middle;margin-top:-.25em;position:relative;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat}.ui-widget-icon-block{left:50%;margin-left:-8px;display:block}.ui-widget-overlay{position:fixed;top:0;left:0;width:100%;height:100%}.ui-tooltip{padding:8px;position:absolute;z-index:9999;max-width:300px}body .ui-tooltip{border-width:2px}.ui-widget{font-family:Arial,Helvetica,sans-serif;font-size:1em}.ui-widget .ui-widget{font-size:1em}.ui-widget input,.ui-widget select,.ui-widget textarea,.ui-widget button{font-family:Arial,Helvetica,sans-serif;font-size:1em}.ui-widget.ui-widget-content{border:1px solid #c5c5c5}.ui-widget-content{border:1px solid #ddd;background:#fff;color:#333}.ui-widget-content a{color:#333}.ui-widget-header{border:1px solid #ddd;background:#e9e9e9;color:#333;font-weight:bold}.ui-widget-header a{color:#333}.ui-state-default,.ui-widget-content .ui-state-default,.ui-widget-header .ui-state-default,.ui-button,html .ui-button.ui-state-disabled:hover,html .ui-button.ui-state-disabled:active{border:1px solid #c5c5c5;background:#f6f6f6;font-weight:normal;color:#454545}.ui-state-default a,.ui-state-default a:link,.ui-state-default a:visited,a.ui-button,a:link.ui-button,a:visited.ui-button,.ui-button{color:#454545;text-decoration:none}.ui-state-hover,.ui-widget-content .ui-state-hover,.ui-widget-header .ui-state-hover,.ui-state-focus,.ui-widget-content .ui-state-focus,.ui-widget-header .ui-state-focus,.ui-button:hover,.ui-button:focus{border:1px solid #ccc;background:#ededed;font-weight:normal;color:#2b2b2b}.ui-state-hover a,.ui-state-hover a:hover,.ui-state-hover a:link,.ui-state-hover a:visited,.ui-state-focus a,.ui-state-focus a:hover,.ui-state-focus a:link,.ui-state-focus a:visited,a.ui-button:hover,a.ui-button:focus{color:#2b2b2b;text-decoration:none}.ui-visual-focus{box-shadow:0 0 3px 1px rgb(94,158,214)}.ui-state-active,.ui-widget-content .ui-state-active,.ui-widget-header .ui-state-active,a.ui-button:active,.ui-button:active,.ui-button.ui-state-active:hover{border:1px solid #003eff;background:#007fff;font-weight:normal;color:#fff}.ui-icon-background,.ui-state-active .ui-icon-background{border:#003eff;background-color:#fff}.ui-state-active a,.ui-state-active a:link,.ui-state-active a:visited{color:#fff;text-decoration:none}.ui-state-highlight,.ui-widget-content .ui-state-highlight,.ui-widget-header .ui-state-highlight{border:1px solid #dad55e;background:#fffa90;color:#777620}.ui-state-checked{border:1px solid #dad55e;background:#fffa90}.ui-state-highlight a,.ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a{color:#777620}.ui-state-error,.ui-widget-content .ui-state-error,.ui-widget-header .ui-state-error{border:1px solid #f1a899;background:#fddfdf;color:#5f3f3f}.ui-state-error a,.ui-widget-content .ui-state-error a,.ui-widget-header .ui-state-error a{color:#5f3f3f}.ui-state-error-text,.ui-widget-content .ui-state-error-text,.ui-widget-header .ui-state-error-text{color:#5f3f3f}.ui-priority-primary,.ui-widget-content .ui-priority-primary,.ui-widget-header .ui-priority-primary{font-weight:bold}.ui-priority-secondary,.ui-widget-content .ui-priority-secondary,.ui-widget-header .ui-priority-secondary{opacity:.7;filter:Alpha(Opacity=70);font-weight:normal}.ui-state-disabled,.ui-widget-content .ui-state-disabled,.ui-widget-header .ui-state-disabled{opacity:.35;filter:Alpha(Opacity=35);background-image:none}.ui-state-disabled .ui-icon{filter:Alpha(Opacity=35)}.ui-icon{width:16px;height:16px}.ui-icon,.ui-widget-content .ui-icon{background-image:url("images/ui-icons_444444_256x240.png")}.ui-widget-header .ui-icon{background-image:url("images/ui-icons_444444_256x240.png")}.ui-state-hover .ui-icon,.ui-state-focus .ui-icon,.ui-button:hover .ui-icon,.ui-button:focus .ui-icon{background-image:url("images/ui-icons_555555_256x240.png")}.ui-state-active .ui-icon,.ui-button:active .ui-icon{background-image:url("images/ui-icons_ffffff_256x240.png")}.ui-state-highlight .ui-icon,.ui-button .ui-state-highlight.ui-icon{background-image:url("images/ui-icons_777620_256x240.png")}.ui-state-error .ui-icon,.ui-state-error-text .ui-icon{background-image:url("images/ui-icons_cc0000_256x240.png")}.ui-button .ui-icon{background-image:url("images/ui-icons_777777_256x240.png")}.ui-icon-blank{background-position:16px 16px}.ui-icon-caret-1-n{background-position:0 0}.ui-icon-caret-1-ne{background-position:-16px 0}.ui-icon-caret-1-e{background-position:-32px 0}.ui-icon-caret-1-se{background-position:-48px 0}.ui-icon-caret-1-s{background-position:-65px 0}.ui-icon-caret-1-sw{background-position:-80px 0}.ui-icon-caret-1-w{background-position:-96px 0}.ui-icon-caret-1-nw{background-position:-112px 0}.ui-icon-caret-2-n-s{background-position:-128px 0}.ui-icon-caret-2-e-w{background-position:-144px 0}.ui-icon-triangle-1-n{background-position:0 -16px}.ui-icon-triangle-1-ne{background-position:-16px -16px}.ui-icon-triangle-1-e{background-position:-32px -16px}.ui-icon-triangle-1-se{background-position:-48px -16px}.ui-icon-triangle-1-s{background-position:-65px -16px}.ui-icon-triangle-1-sw{background-position:-80px -16px}.ui-icon-triangle-1-w{background-position:-96px -16px}.ui-icon-triangle-1-nw{background-position:-112px -16px}.ui-icon-triangle-2-n-s{background-position:-128px -16px}.ui-icon-triangle-2-e-w{background-position:-144px -16px}.ui-icon-arrow-1-n{background-position:0 -32px}.ui-icon-arrow-1-ne{background-position:-16px -32px}.ui-icon-arrow-1-e{background-position:-32px -32px}.ui-icon-arrow-1-se{background-position:-48px -32px}.ui-icon-arrow-1-s{background-position:-65px -32px}.ui-icon-arrow-1-sw{background-position:-80px -32px}.ui-icon-arrow-1-w{background-position:-96px -32px}.ui-icon-arrow-1-nw{background-position:-112px -32px}.ui-icon-arrow-2-n-s{background-position:-128px -32px}.ui-icon-arrow-2-ne-sw{background-position:-144px -32px}.ui-icon-arrow-2-e-w{background-position:-160px -32px}.ui-icon-arrow-2-se-nw{background-position:-176px -32px}.ui-icon-arrowstop-1-n{background-position:-192px -32px}.ui-icon-arrowstop-1-e{background-position:-208px -32px}.ui-icon-arrowstop-1-s{background-position:-224px -32px}.ui-icon-arrowstop-1-w{background-position:-240px -32px}.ui-icon-arrowthick-1-n{background-position:1px -48px}.ui-icon-arrowthick-1-ne{background-position:-16px -48px}.ui-icon-arrowthick-1-e{background-position:-32px -48px}.ui-icon-arrowthick-1-se{background-position:-48px -48px}.ui-icon-arrowthick-1-s{background-position:-64px -48px}.ui-icon-arrowthick-1-sw{background-position:-80px -48px}.ui-icon-arrowthick-1-w{background-position:-96px -48px}.ui-icon-arrowthick-1-nw{background-position:-112px -48px}.ui-icon-arrowthick-2-n-s{background-position:-128px -48px}.ui-icon-arrowthick-2-ne-sw{background-position:-144px -48px}.ui-icon-arrowthick-2-e-w{background-position:-160px -48px}.ui-icon-arrowthick-2-se-nw{background-position:-176px -48px}.ui-icon-arrowthickstop-1-n{background-position:-192px -48px}.ui-icon-arrowthickstop-1-e{background-position:-208px -48px}.ui-icon-arrowthickstop-1-s{background-position:-224px -48px}.ui-icon-arrowthickstop-1-w{background-position:-240px -48px}.ui-icon-arrowreturnthick-1-w{background-position:0 -64px}.ui-icon-arrowreturnthick-1-n{background-position:-16px -64px}.ui-icon-arrowreturnthick-1-e{background-position:-32px -64px}.ui-icon-arrowreturnthick-1-s{background-position:-48px -64px}.ui-icon-arrowreturn-1-w{background-position:-64px -64px}.ui-icon-arrowreturn-1-n{background-position:-80px -64px}.ui-icon-arrowreturn-1-e{background-position:-96px -64px}.ui-icon-arrowreturn-1-s{background-position:-112px -64px}.ui-icon-arrowrefresh-1-w{background-position:-128px -64px}.ui-icon-arrowrefresh-1-n{background-position:-144px -64px}.ui-icon-arrowrefresh-1-e{background-position:-160px -64px}.ui-icon-arrowrefresh-1-s{background-position:-176px -64px}.ui-icon-arrow-4{background-position:0 -80px}.ui-icon-arrow-4-diag{background-position:-16px -80px}.ui-icon-extlink{background-position:-32px -80px}.ui-icon-newwin{background-position:-48px -80px}.ui-icon-refresh{background-position:-64px -80px}.ui-icon-shuffle{background-position:-80px -80px}.ui-icon-transfer-e-w{background-position:-96px -80px}.ui-icon-transferthick-e-w{background-position:-112px -80px}.ui-icon-folder-collapsed{background-position:0 -96px}.ui-icon-folder-open{background-position:-16px -96px}.ui-icon-document{background-position:-32px -96px}.ui-icon-document-b{background-position:-48px -96px}.ui-icon-note{background-position:-64px -96px}.ui-icon-mail-closed{background-position:-80px -96px}.ui-icon-mail-open{background-position:-96px -96px}.ui-icon-suitcase{background-position:-112px -96px}.ui-icon-comment{background-position:-128px -96px}.ui-icon-person{background-position:-144px -96px}.ui-icon-print{background-position:-160px -96px}.ui-icon-trash{background-position:-176px -96px}.ui-icon-locked{background-position:-192px -96px}.ui-icon-unlocked{background-position:-208px -96px}.ui-icon-bookmark{background-position:-224px -96px}.ui-icon-tag{background-position:-240px -96px}.ui-icon-home{background-position:0 -112px}.ui-icon-flag{background-position:-16px -112px}.ui-icon-calendar{background-position:-32px -112px}.ui-icon-cart{background-position:-48px -112px}.ui-icon-pencil{background-position:-64px -112px}.ui-icon-clock{background-position:-80px -112px}.ui-icon-disk{background-position:-96px -112px}.ui-icon-calculator{background-position:-112px -112px}.ui-icon-zoomin{background-position:-128px -112px}.ui-icon-zoomout{background-position:-144px -112px}.ui-icon-search{background-position:-160px -112px}.ui-icon-wrench{background-position:-176px -112px}.ui-icon-gear{background-position:-192px -112px}.ui-icon-heart{background-position:-208px -112px}.ui-icon-star{background-position:-224px -112px}.ui-icon-link{background-position:-240px -112px}.ui-icon-cancel{background-position:0 -128px}.ui-icon-plus{background-position:-16px -128px}.ui-icon-plusthick{background-position:-32px -128px}.ui-icon-minus{background-position:-48px -128px}.ui-icon-minusthick{background-position:-64px -128px}.ui-icon-close{background-position:-80px -128px}.ui-icon-closethick{background-position:-96px -128px}.ui-icon-key{background-position:-112px -128px}.ui-icon-lightbulb{background-position:-128px -128px}.ui-icon-scissors{background-position:-144px -128px}.ui-icon-clipboard{background-position:-160px -128px}.ui-icon-copy{background-position:-176px -128px}.ui-icon-contact{background-position:-192px -128px}.ui-icon-image{background-position:-208px -128px}.ui-icon-video{background-position:-224px -128px}.ui-icon-script{background-position:-240px -128px}.ui-icon-alert{background-position:0 -144px}.ui-icon-info{background-position:-16px -144px}.ui-icon-notice{background-position:-32px -144px}.ui-icon-help{background-position:-48px -144px}.ui-icon-check{background-position:-64px -144px}.ui-icon-bullet{background-position:-80px -144px}.ui-icon-radio-on{background-position:-96px -144px}.ui-icon-radio-off{background-position:-112px -144px}.ui-icon-pin-w{background-position:-128px -144px}.ui-icon-pin-s{background-position:-144px -144px}.ui-icon-play{background-position:0 -160px}.ui-icon-pause{background-position:-16px -160px}.ui-icon-seek-next{background-position:-32px -160px}.ui-icon-seek-prev{background-position:-48px -160px}.ui-icon-seek-end{background-position:-64px -160px}.ui-icon-seek-start{background-position:-80px -160px}.ui-icon-seek-first{background-position:-80px -160px}.ui-icon-stop{background-position:-96px -160px}.ui-icon-eject{background-position:-112px -160px}.ui-icon-volume-off{background-position:-128px -160px}.ui-icon-volume-on{background-position:-144px -160px}.ui-icon-power{background-position:0 -176px}.ui-icon-signal-diag{background-position:-16px -176px}.ui-icon-signal{background-position:-32px -176px}.ui-icon-battery-0{background-position:-48px -176px}.ui-icon-battery-1{background-position:-64px -176px}.ui-icon-battery-2{background-position:-80px -176px}.ui-icon-battery-3{background-position:-96px -176px}.ui-icon-circle-plus{background-position:0 -192px}.ui-icon-circle-minus{background-position:-16px -192px}.ui-icon-circle-close{background-position:-32px -192px}.ui-icon-circle-triangle-e{background-position:-48px -192px}.ui-icon-circle-triangle-s{background-position:-64px -192px}.ui-icon-circle-triangle-w{background-position:-80px -192px}.ui-icon-circle-triangle-n{background-position:-96px -192px}.ui-icon-circle-arrow-e{background-position:-112px -192px}.ui-icon-circle-arrow-s{background-position:-128px -192px}.ui-icon-circle-arrow-w{background-position:-144px -192px}.ui-icon-circle-arrow-n{background-position:-160px -192px}.ui-icon-circle-zoomin{background-position:-176px -192px}.ui-icon-circle-zoomout{background-position:-192px -192px}.ui-icon-circle-check{background-position:-208px -192px}.ui-icon-circlesmall-plus{background-position:0 -208px}.ui-icon-circlesmall-minus{background-position:-16px -208px}.ui-icon-circlesmall-close{background-position:-32px -208px}.ui-icon-squaresmall-plus{background-position:-48px -208px}.ui-icon-squaresmall-minus{background-position:-64px -208px}.ui-icon-squaresmall-close{background-position:-80px -208px}.ui-icon-grip-dotted-vertical{background-position:0 -224px}.ui-icon-grip-dotted-horizontal{background-position:-16px -224px}.ui-icon-grip-solid-vertical{background-position:-32px -224px}.ui-icon-grip-solid-horizontal{background-position:-48px -224px}.ui-icon-gripsmall-diagonal-se{background-position:-64px -224px}.ui-icon-grip-diagonal-se{background-position:-80px -224px}.ui-corner-all,.ui-corner-top,.ui-corner-left,.ui-corner-tl{border-top-left-radius:3px}.ui-corner-all,.ui-corner-top,.ui-corner-right,.ui-corner-tr{border-top-right-radius:3px}.ui-corner-all,.ui-corner-bottom,.ui-corner-left,.ui-corner-bl{border-bottom-left-radius:3px}.ui-corner-all,.ui-corner-bottom,.ui-corner-right,.ui-corner-br{border-bottom-right-radius:3px}.ui-widget-overlay{background:#aaa;opacity:.3;filter:Alpha(Opacity=30)}.ui-widget-shadow{-webkit-box-shadow:0 0 5px #666;box-shadow:0 0 5px #666} \ No newline at end of file diff --git a/lib/jquery-ui.min.js b/lib/jquery-ui.min.js new file mode 100644 index 0000000..cfb47e3 --- /dev/null +++ b/lib/jquery-ui.min.js @@ -0,0 +1,6 @@ +/*! jQuery UI - v1.12.1 - 2019-11-20 +* http://jqueryui.com +* Includes: widget.js, position.js, keycode.js, unique-id.js, widgets/tooltip.js +* Copyright jQuery Foundation and other contributors; Licensed MIT */ + +(function(t){"function"==typeof define&&define.amd?define(["jquery"],t):t(jQuery)})(function(t){t.ui=t.ui||{},t.ui.version="1.12.1";var e=0,i=Array.prototype.slice;t.cleanData=function(e){return function(i){var s,n,o;for(o=0;null!=(n=i[o]);o++)try{s=t._data(n,"events"),s&&s.remove&&t(n).triggerHandler("remove")}catch(a){}e(i)}}(t.cleanData),t.widget=function(e,i,s){var n,o,a,r={},l=e.split(".")[0];e=e.split(".")[1];var h=l+"-"+e;return s||(s=i,i=t.Widget),t.isArray(s)&&(s=t.extend.apply(null,[{}].concat(s))),t.expr[":"][h.toLowerCase()]=function(e){return!!t.data(e,h)},t[l]=t[l]||{},n=t[l][e],o=t[l][e]=function(t,e){return this._createWidget?(arguments.length&&this._createWidget(t,e),void 0):new o(t,e)},t.extend(o,n,{version:s.version,_proto:t.extend({},s),_childConstructors:[]}),a=new i,a.options=t.widget.extend({},a.options),t.each(s,function(e,s){return t.isFunction(s)?(r[e]=function(){function t(){return i.prototype[e].apply(this,arguments)}function n(t){return i.prototype[e].apply(this,t)}return function(){var e,i=this._super,o=this._superApply;return this._super=t,this._superApply=n,e=s.apply(this,arguments),this._super=i,this._superApply=o,e}}(),void 0):(r[e]=s,void 0)}),o.prototype=t.widget.extend(a,{widgetEventPrefix:n?a.widgetEventPrefix||e:e},r,{constructor:o,namespace:l,widgetName:e,widgetFullName:h}),n?(t.each(n._childConstructors,function(e,i){var s=i.prototype;t.widget(s.namespace+"."+s.widgetName,o,i._proto)}),delete n._childConstructors):i._childConstructors.push(o),t.widget.bridge(e,o),o},t.widget.extend=function(e){for(var s,n,o=i.call(arguments,1),a=0,r=o.length;r>a;a++)for(s in o[a])n=o[a][s],o[a].hasOwnProperty(s)&&void 0!==n&&(e[s]=t.isPlainObject(n)?t.isPlainObject(e[s])?t.widget.extend({},e[s],n):t.widget.extend({},n):n);return e},t.widget.bridge=function(e,s){var n=s.prototype.widgetFullName||e;t.fn[e]=function(o){var a="string"==typeof o,r=i.call(arguments,1),l=this;return a?this.length||"instance"!==o?this.each(function(){var i,s=t.data(this,n);return"instance"===o?(l=s,!1):s?t.isFunction(s[o])&&"_"!==o.charAt(0)?(i=s[o].apply(s,r),i!==s&&void 0!==i?(l=i&&i.jquery?l.pushStack(i.get()):i,!1):void 0):t.error("no such method '"+o+"' for "+e+" widget instance"):t.error("cannot call methods on "+e+" prior to initialization; "+"attempted to call method '"+o+"'")}):l=void 0:(r.length&&(o=t.widget.extend.apply(null,[o].concat(r))),this.each(function(){var e=t.data(this,n);e?(e.option(o||{}),e._init&&e._init()):t.data(this,n,new s(o,this))})),l}},t.Widget=function(){},t.Widget._childConstructors=[],t.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"
",options:{classes:{},disabled:!1,create:null},_createWidget:function(i,s){s=t(s||this.defaultElement||this)[0],this.element=t(s),this.uuid=e++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=t(),this.hoverable=t(),this.focusable=t(),this.classesElementLookup={},s!==this&&(t.data(s,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===s&&this.destroy()}}),this.document=t(s.style?s.ownerDocument:s.document||s),this.window=t(this.document[0].defaultView||this.document[0].parentWindow)),this.options=t.widget.extend({},this.options,this._getCreateOptions(),i),this._create(),this.options.disabled&&this._setOptionDisabled(this.options.disabled),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:t.noop,_create:t.noop,_init:t.noop,destroy:function(){var e=this;this._destroy(),t.each(this.classesElementLookup,function(t,i){e._removeClass(i,t)}),this.element.off(this.eventNamespace).removeData(this.widgetFullName),this.widget().off(this.eventNamespace).removeAttr("aria-disabled"),this.bindings.off(this.eventNamespace)},_destroy:t.noop,widget:function(){return this.element},option:function(e,i){var s,n,o,a=e;if(0===arguments.length)return t.widget.extend({},this.options);if("string"==typeof e)if(a={},s=e.split("."),e=s.shift(),s.length){for(n=a[e]=t.widget.extend({},this.options[e]),o=0;s.length-1>o;o++)n[s[o]]=n[s[o]]||{},n=n[s[o]];if(e=s.pop(),1===arguments.length)return void 0===n[e]?null:n[e];n[e]=i}else{if(1===arguments.length)return void 0===this.options[e]?null:this.options[e];a[e]=i}return this._setOptions(a),this},_setOptions:function(t){var e;for(e in t)this._setOption(e,t[e]);return this},_setOption:function(t,e){return"classes"===t&&this._setOptionClasses(e),this.options[t]=e,"disabled"===t&&this._setOptionDisabled(e),this},_setOptionClasses:function(e){var i,s,n;for(i in e)n=this.classesElementLookup[i],e[i]!==this.options.classes[i]&&n&&n.length&&(s=t(n.get()),this._removeClass(n,i),s.addClass(this._classes({element:s,keys:i,classes:e,add:!0})))},_setOptionDisabled:function(t){this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,!!t),t&&(this._removeClass(this.hoverable,null,"ui-state-hover"),this._removeClass(this.focusable,null,"ui-state-focus"))},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_classes:function(e){function i(i,o){var a,r;for(r=0;i.length>r;r++)a=n.classesElementLookup[i[r]]||t(),a=e.add?t(t.unique(a.get().concat(e.element.get()))):t(a.not(e.element).get()),n.classesElementLookup[i[r]]=a,s.push(i[r]),o&&e.classes[i[r]]&&s.push(e.classes[i[r]])}var s=[],n=this;return e=t.extend({element:this.element,classes:this.options.classes||{}},e),this._on(e.element,{remove:"_untrackClassesElement"}),e.keys&&i(e.keys.match(/\S+/g)||[],!0),e.extra&&i(e.extra.match(/\S+/g)||[]),s.join(" ")},_untrackClassesElement:function(e){var i=this;t.each(i.classesElementLookup,function(s,n){-1!==t.inArray(e.target,n)&&(i.classesElementLookup[s]=t(n.not(e.target).get()))})},_removeClass:function(t,e,i){return this._toggleClass(t,e,i,!1)},_addClass:function(t,e,i){return this._toggleClass(t,e,i,!0)},_toggleClass:function(t,e,i,s){s="boolean"==typeof s?s:i;var n="string"==typeof t||null===t,o={extra:n?e:i,keys:n?t:e,element:n?this.element:t,add:s};return o.element.toggleClass(this._classes(o),s),this},_on:function(e,i,s){var n,o=this;"boolean"!=typeof e&&(s=i,i=e,e=!1),s?(i=n=t(i),this.bindings=this.bindings.add(i)):(s=i,i=this.element,n=this.widget()),t.each(s,function(s,a){function r(){return e||o.options.disabled!==!0&&!t(this).hasClass("ui-state-disabled")?("string"==typeof a?o[a]:a).apply(o,arguments):void 0}"string"!=typeof a&&(r.guid=a.guid=a.guid||r.guid||t.guid++);var l=s.match(/^([\w:-]*)\s*(.*)$/),h=l[1]+o.eventNamespace,c=l[2];c?n.on(h,c,r):i.on(h,r)})},_off:function(e,i){i=(i||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,e.off(i).off(i),this.bindings=t(this.bindings.not(e).get()),this.focusable=t(this.focusable.not(e).get()),this.hoverable=t(this.hoverable.not(e).get())},_delay:function(t,e){function i(){return("string"==typeof t?s[t]:t).apply(s,arguments)}var s=this;return setTimeout(i,e||0)},_hoverable:function(e){this.hoverable=this.hoverable.add(e),this._on(e,{mouseenter:function(e){this._addClass(t(e.currentTarget),null,"ui-state-hover")},mouseleave:function(e){this._removeClass(t(e.currentTarget),null,"ui-state-hover")}})},_focusable:function(e){this.focusable=this.focusable.add(e),this._on(e,{focusin:function(e){this._addClass(t(e.currentTarget),null,"ui-state-focus")},focusout:function(e){this._removeClass(t(e.currentTarget),null,"ui-state-focus")}})},_trigger:function(e,i,s){var n,o,a=this.options[e];if(s=s||{},i=t.Event(i),i.type=(e===this.widgetEventPrefix?e:this.widgetEventPrefix+e).toLowerCase(),i.target=this.element[0],o=i.originalEvent)for(n in o)n in i||(i[n]=o[n]);return this.element.trigger(i,s),!(t.isFunction(a)&&a.apply(this.element[0],[i].concat(s))===!1||i.isDefaultPrevented())}},t.each({show:"fadeIn",hide:"fadeOut"},function(e,i){t.Widget.prototype["_"+e]=function(s,n,o){"string"==typeof n&&(n={effect:n});var a,r=n?n===!0||"number"==typeof n?i:n.effect||i:e;n=n||{},"number"==typeof n&&(n={duration:n}),a=!t.isEmptyObject(n),n.complete=o,n.delay&&s.delay(n.delay),a&&t.effects&&t.effects.effect[r]?s[e](n):r!==e&&s[r]?s[r](n.duration,n.easing,o):s.queue(function(i){t(this)[e](),o&&o.call(s[0]),i()})}}),t.widget,function(){function e(t,e,i){return[parseFloat(t[0])*(u.test(t[0])?e/100:1),parseFloat(t[1])*(u.test(t[1])?i/100:1)]}function i(e,i){return parseInt(t.css(e,i),10)||0}function s(e){var i=e[0];return 9===i.nodeType?{width:e.width(),height:e.height(),offset:{top:0,left:0}}:t.isWindow(i)?{width:e.width(),height:e.height(),offset:{top:e.scrollTop(),left:e.scrollLeft()}}:i.preventDefault?{width:0,height:0,offset:{top:i.pageY,left:i.pageX}}:{width:e.outerWidth(),height:e.outerHeight(),offset:e.offset()}}var n,o=Math.max,a=Math.abs,r=/left|center|right/,l=/top|center|bottom/,h=/[\+\-]\d+(\.[\d]+)?%?/,c=/^\w+/,u=/%$/,d=t.fn.position;t.position={scrollbarWidth:function(){if(void 0!==n)return n;var e,i,s=t("
"),o=s.children()[0];return t("body").append(s),e=o.offsetWidth,s.css("overflow","scroll"),i=o.offsetWidth,e===i&&(i=s[0].clientWidth),s.remove(),n=e-i},getScrollInfo:function(e){var i=e.isWindow||e.isDocument?"":e.element.css("overflow-x"),s=e.isWindow||e.isDocument?"":e.element.css("overflow-y"),n="scroll"===i||"auto"===i&&e.widthi?"left":e>0?"right":"center",vertical:0>r?"top":s>0?"bottom":"middle"};h>p&&p>a(e+i)&&(u.horizontal="center"),c>f&&f>a(s+r)&&(u.vertical="middle"),u.important=o(a(e),a(i))>o(a(s),a(r))?"horizontal":"vertical",n.using.call(this,t,u)}),l.offset(t.extend(D,{using:r}))})},t.ui.position={fit:{left:function(t,e){var i,s=e.within,n=s.isWindow?s.scrollLeft:s.offset.left,a=s.width,r=t.left-e.collisionPosition.marginLeft,l=n-r,h=r+e.collisionWidth-a-n;e.collisionWidth>a?l>0&&0>=h?(i=t.left+l+e.collisionWidth-a-n,t.left+=l-i):t.left=h>0&&0>=l?n:l>h?n+a-e.collisionWidth:n:l>0?t.left+=l:h>0?t.left-=h:t.left=o(t.left-r,t.left)},top:function(t,e){var i,s=e.within,n=s.isWindow?s.scrollTop:s.offset.top,a=e.within.height,r=t.top-e.collisionPosition.marginTop,l=n-r,h=r+e.collisionHeight-a-n;e.collisionHeight>a?l>0&&0>=h?(i=t.top+l+e.collisionHeight-a-n,t.top+=l-i):t.top=h>0&&0>=l?n:l>h?n+a-e.collisionHeight:n:l>0?t.top+=l:h>0?t.top-=h:t.top=o(t.top-r,t.top)}},flip:{left:function(t,e){var i,s,n=e.within,o=n.offset.left+n.scrollLeft,r=n.width,l=n.isWindow?n.scrollLeft:n.offset.left,h=t.left-e.collisionPosition.marginLeft,c=h-l,u=h+e.collisionWidth-r-l,d="left"===e.my[0]?-e.elemWidth:"right"===e.my[0]?e.elemWidth:0,p="left"===e.at[0]?e.targetWidth:"right"===e.at[0]?-e.targetWidth:0,f=-2*e.offset[0];0>c?(i=t.left+d+p+f+e.collisionWidth-r-o,(0>i||a(c)>i)&&(t.left+=d+p+f)):u>0&&(s=t.left-e.collisionPosition.marginLeft+d+p+f-l,(s>0||u>a(s))&&(t.left+=d+p+f))},top:function(t,e){var i,s,n=e.within,o=n.offset.top+n.scrollTop,r=n.height,l=n.isWindow?n.scrollTop:n.offset.top,h=t.top-e.collisionPosition.marginTop,c=h-l,u=h+e.collisionHeight-r-l,d="top"===e.my[1],p=d?-e.elemHeight:"bottom"===e.my[1]?e.elemHeight:0,f="top"===e.at[1]?e.targetHeight:"bottom"===e.at[1]?-e.targetHeight:0,m=-2*e.offset[1];0>c?(s=t.top+p+f+m+e.collisionHeight-r-o,(0>s||a(c)>s)&&(t.top+=p+f+m)):u>0&&(i=t.top-e.collisionPosition.marginTop+p+f+m-l,(i>0||u>a(i))&&(t.top+=p+f+m))}},flipfit:{left:function(){t.ui.position.flip.left.apply(this,arguments),t.ui.position.fit.left.apply(this,arguments)},top:function(){t.ui.position.flip.top.apply(this,arguments),t.ui.position.fit.top.apply(this,arguments)}}}}(),t.ui.position,t.ui.keyCode={BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38},t.fn.extend({uniqueId:function(){var t=0;return function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++t)})}}(),removeUniqueId:function(){return this.each(function(){/^ui-id-\d+$/.test(this.id)&&t(this).removeAttr("id")})}}),t.widget("ui.tooltip",{version:"1.12.1",options:{classes:{"ui-tooltip":"ui-corner-all ui-widget-shadow"},content:function(){var e=t(this).attr("title")||"";return t("").text(e).html()},hide:!0,items:"[title]:not([disabled])",position:{my:"left top+15",at:"left bottom",collision:"flipfit flip"},show:!0,track:!1,close:null,open:null},_addDescribedBy:function(e,i){var s=(e.attr("aria-describedby")||"").split(/\s+/);s.push(i),e.data("ui-tooltip-id",i).attr("aria-describedby",t.trim(s.join(" ")))},_removeDescribedBy:function(e){var i=e.data("ui-tooltip-id"),s=(e.attr("aria-describedby")||"").split(/\s+/),n=t.inArray(i,s);-1!==n&&s.splice(n,1),e.removeData("ui-tooltip-id"),s=t.trim(s.join(" ")),s?e.attr("aria-describedby",s):e.removeAttr("aria-describedby")},_create:function(){this._on({mouseover:"open",focusin:"open"}),this.tooltips={},this.parents={},this.liveRegion=t("
").attr({role:"log","aria-live":"assertive","aria-relevant":"additions"}).appendTo(this.document[0].body),this._addClass(this.liveRegion,null,"ui-helper-hidden-accessible"),this.disabledTitles=t([])},_setOption:function(e,i){var s=this;this._super(e,i),"content"===e&&t.each(this.tooltips,function(t,e){s._updateContent(e.element)})},_setOptionDisabled:function(t){this[t?"_disable":"_enable"]()},_disable:function(){var e=this;t.each(this.tooltips,function(i,s){var n=t.Event("blur");n.target=n.currentTarget=s.element[0],e.close(n,!0)}),this.disabledTitles=this.disabledTitles.add(this.element.find(this.options.items).addBack().filter(function(){var e=t(this);return e.is("[title]")?e.data("ui-tooltip-title",e.attr("title")).removeAttr("title"):void 0}))},_enable:function(){this.disabledTitles.each(function(){var e=t(this);e.data("ui-tooltip-title")&&e.attr("title",e.data("ui-tooltip-title"))}),this.disabledTitles=t([])},open:function(e){var i=this,s=t(e?e.target:this.element).closest(this.options.items);s.length&&!s.data("ui-tooltip-id")&&(s.attr("title")&&s.data("ui-tooltip-title",s.attr("title")),s.data("ui-tooltip-open",!0),e&&"mouseover"===e.type&&s.parents().each(function(){var e,s=t(this);s.data("ui-tooltip-open")&&(e=t.Event("blur"),e.target=e.currentTarget=this,i.close(e,!0)),s.attr("title")&&(s.uniqueId(),i.parents[this.id]={element:this,title:s.attr("title")},s.attr("title",""))}),this._registerCloseHandlers(e,s),this._updateContent(s,e))},_updateContent:function(t,e){var i,s=this.options.content,n=this,o=e?e.type:null;return"string"==typeof s||s.nodeType||s.jquery?this._open(e,t,s):(i=s.call(t[0],function(i){n._delay(function(){t.data("ui-tooltip-open")&&(e&&(e.type=o),this._open(e,t,i))})}),i&&this._open(e,t,i),void 0)},_open:function(e,i,s){function n(t){h.of=t,a.is(":hidden")||a.position(h)}var o,a,r,l,h=t.extend({},this.options.position);if(s){if(o=this._find(i))return o.tooltip.find(".ui-tooltip-content").html(s),void 0;i.is("[title]")&&(e&&"mouseover"===e.type?i.attr("title",""):i.removeAttr("title")),o=this._tooltip(i),a=o.tooltip,this._addDescribedBy(i,a.attr("id")),a.find(".ui-tooltip-content").html(s),this.liveRegion.children().hide(),l=t("
").html(a.find(".ui-tooltip-content").html()),l.removeAttr("name").find("[name]").removeAttr("name"),l.removeAttr("id").find("[id]").removeAttr("id"),l.appendTo(this.liveRegion),this.options.track&&e&&/^mouse/.test(e.type)?(this._on(this.document,{mousemove:n}),n(e)):a.position(t.extend({of:i},this.options.position)),a.hide(),this._show(a,this.options.show),this.options.track&&this.options.show&&this.options.show.delay&&(r=this.delayedShow=setInterval(function(){a.is(":visible")&&(n(h.of),clearInterval(r))},t.fx.interval)),this._trigger("open",e,{tooltip:a})}},_registerCloseHandlers:function(e,i){var s={keyup:function(e){if(e.keyCode===t.ui.keyCode.ESCAPE){var s=t.Event(e);s.currentTarget=i[0],this.close(s,!0)}}};i[0]!==this.element[0]&&(s.remove=function(){this._removeTooltip(this._find(i).tooltip)}),e&&"mouseover"!==e.type||(s.mouseleave="close"),e&&"focusin"!==e.type||(s.focusout="close"),this._on(!0,i,s)},close:function(e){var i,s=this,n=t(e?e.currentTarget:this.element),o=this._find(n);return o?(i=o.tooltip,o.closing||(clearInterval(this.delayedShow),n.data("ui-tooltip-title")&&!n.attr("title")&&n.attr("title",n.data("ui-tooltip-title")),this._removeDescribedBy(n),o.hiding=!0,i.stop(!0),this._hide(i,this.options.hide,function(){s._removeTooltip(t(this))}),n.removeData("ui-tooltip-open"),this._off(n,"mouseleave focusout keyup"),n[0]!==this.element[0]&&this._off(n,"remove"),this._off(this.document,"mousemove"),e&&"mouseleave"===e.type&&t.each(this.parents,function(e,i){t(i.element).attr("title",i.title),delete s.parents[e]}),o.closing=!0,this._trigger("close",e,{tooltip:i}),o.hiding||(o.closing=!1)),void 0):(n.removeData("ui-tooltip-open"),void 0)},_tooltip:function(e){var i=t("
").attr("role","tooltip"),s=t("
").appendTo(i),n=i.uniqueId().attr("id");return this._addClass(s,"ui-tooltip-content"),this._addClass(i,"ui-tooltip","ui-widget ui-widget-content"),i.appendTo(this._appendTo(e)),this.tooltips[n]={element:e,tooltip:i}},_find:function(t){var e=t.data("ui-tooltip-id");return e?this.tooltips[e]:null},_removeTooltip:function(t){t.remove(),delete this.tooltips[t.attr("id")]},_appendTo:function(t){var e=t.closest(".ui-front, dialog");return e.length||(e=this.document[0].body),e},_destroy:function(){var e=this;t.each(this.tooltips,function(i,s){var n=t.Event("blur"),o=s.element;n.target=n.currentTarget=o[0],e.close(n,!0),t("#"+i).remove(),o.data("ui-tooltip-title")&&(o.attr("title")||o.attr("title",o.data("ui-tooltip-title")),o.removeData("ui-tooltip-title"))}),this.liveRegion.remove()}}),t.uiBackCompat!==!1&&t.widget("ui.tooltip",t.ui.tooltip,{options:{tooltipClass:null},_tooltip:function(){var t=this._superApply(arguments);return this.options.tooltipClass&&t.tooltip.addClass(this.options.tooltipClass),t}}),t.ui.tooltip}); \ No newline at end of file diff --git a/lib/style.css b/lib/style.css index b35d65e..d1f8852 100644 --- a/lib/style.css +++ b/lib/style.css @@ -1,306 +1,287 @@ body{ font-family: Helvetica, "Trebuchet MS" , Arial; font-size: small; } /* L'image en background */ #bg { position:fixed; top:-50%; left:-50%; width:200%; height:200%; } #bg img { position:absolute; top:0; left:0; right:0; bottom:0; margin:auto; min-width:50%; min-height:50%; } /* Le carde de la page */ #page-wrap { position: relative; z-index: 2; width: 90%; margin: 50px auto; padding: 5px 20px; background: white; -moz-box-shadow: 0 0 20px black; -webkit-box-shadow: 0 0 20px black; box-shadow: 0 0 20px black; opacity: 0.90; } .similarHref a { color: #7E7E7E; } .similarLink { margin-top: 10px; display:none; } /* Pied de page */ #footer { color: #7E7E7E; clear: both; padding: 10px; } .footer_right { float: right; } #footer a { color: #7E7E7E; } .footer_htmlPages { text-align: right; } @media screen and (max-width: 800px) { #page-wrap { width: 90%; } } @media screen and (min-width: 800px) { #page-wrap { width: 600px; } } .uploadArea { text-align: center; } .uploadArea div { margin: 30px; } .uploadResult { font-weight: bold; } .uploadResult.ok { color: #008000; } .uploadResult.nok { color: #FF0000; } #resizeForm { display: none; } .limit { text-align: center; color: #7E7E7E; } a { color:#07396A; text-decoration:underline; } .progress { text-align: center; padding: 20px; } progress { width: 100%; } -/* Infobulle */ -a.bulles { - color:#07396A; - text-decoration:none; - cursor:pointer; - cursor:hand; -} -#tooltip { - text-align: left; - position:absolute; - z-index:9999; - color:#fff; - width:210px; -} -/* hack IE */ -*html #tooltip .tipHeader {margin-bottom:-6px;} -#tooltip .tipBody { - background-color:#000; - padding:5px; -} + @media screen and (max-width: 800px) { .file.icone, .file.name, .file.info, .file.input { margin: 0 auto; text-align:center; width: 90%; } input.copy { width: 85%; } } @media screen and (min-width: 800px) { .file.icone { float: left; } input.copy { width: 75%; } } .verySpeedDownload { color: #FF0000; font-weight: bold; } .speedDownload { color: #FFA500; font-weight: bold; } .fileGlobal { padding-top: 10px; } .file { padding: 4px; } .file.icone { cursor: pointer; margin: 10px; padding: 10px; } .file.icone a { text-decoration: none; color : #FFFFFF; } .file.name { font-size: 20px; } .file.name a { text-decoration: none; color: #000000; } .file.info { color: #A1A1A1; } .file.info .type { margin-left: 10px; } .file.input img { float: left; width: 25px; } .file.delete { width: 15px; float: right; } input.copy { background-image: url('/lib/copy.svg'); background-repeat: no-repeat; background-position: center right; background-color: #EBEBEB; border: 1px solid #C6C6C6; padding: 4px; cursor: copy; } .delete, .deleteAll, .myFiles { display: none; } .newUpload { text-align: center; margin: 10px; margin-top: 40px; cursor: pointer; } .newUpload img{ width: 100px; } .error.myFiles0 { text-align:center; } .fileGlobal.fileAll, .fileGlobal.fileJust1 { background-color: #EBEBEB; border-radius: 25px; border: 2px solid #CACACA; opacity:0.6; padding-bottom: 10px; } .fileJust1.icone { margin: 5px 10px; padding: 5px 10px; } #myFilesArea table { width: 100%; } #myFilesArea td, #myFilesArea th { text-align: center; } #upgrade { text-align: right; opacity:0.6; } #langues { position: fixed; top: 0px; right: 20px; padding: 6px; border: 1px solid #2F2F2F; border-bottom-left-radius: 8px; border-bottom-right-radius: 8px; background: #333333; -moz-box-shadow: 0 0 10px black; -webkit-box-shadow: 0 0 10px black; box-shadow: 0 0 10px black; opacity: 0.70; z-index: 999; /* Sit on top */ } #languesLegende { position: fixed; top: 50px; right: 25px; padding: 8px; border: 1px solid #6F6C2F; border-bottom-left-radius: 8px; border-bottom-right-radius: 8px; background: #E2DC8C; -moz-box-shadow: 0 0 10px black; -webkit-box-shadow: 0 0 10px black; box-shadow: 0 0 10px black; opacity: 0.70; z-index: 999; /* Sit on top */ } img.drapeau { margin-right: 6px; margin-left: 6px; } img.drapeauActif { opacity: 0.50; } .formChoixDeLangue { margin: 0; padding: 0; } /* Highlighted Paragraphs */ .highlight-1, .highlight-2, .highlight-3 { -moz-border-radius : 4px; -webkit-border-radius : 4px; padding : 5px 10px; } .highlight-1 { background : #FFCCCC; border : 1px dotted #FF9966; } .highlight-2 { background : #FFFF99; border : 1px dotted #FFCC33; } .highlight-3 { background : #CCFF99; border : 1px dotted #CCCC33; } diff --git a/lib/upload.js b/lib/upload.js index 868d07f..34b3fe3 100644 --- a/lib/upload.js +++ b/lib/upload.js @@ -1,187 +1,164 @@ $(function () { function checkMimeTypes(mimeTypesTest) { var mimeDetect=false; Config_mimeTypes.forEach(function(item, index, array) { var regex = item.replace(/\//g, "\\\/"); if (mimeTypesTest.match(regex) != undefined) { mimeDetect=true; } }); if ((Config_mimeTypesConduct == 'allow' && mimeDetect) || (Config_mimeTypesConduct == 'deny' && !mimeDetect)) { return true; } else { return false; } } /** * Function called to upload one file. * @param file * @param item */ function uploadFile(item, file, expire, random, resize, key) { // Add progress bar $('.progress').show(); $('.progress').append('' + file.name + '
'); // Create object XMLHttpRequest var request = new XMLHttpRequest(); // Event progress to change value of progress bar request.upload.addEventListener('progress', function (e) { $('.progress-' + item).css('display', 'block'); var value = Math.round((e.loaded / e.total) * 100); $('.progress-' + item).attr("value", value); }, false); // Create object FormData var formData = new FormData(); // Add file to FormData formData.append('random', random); formData.append('item', item); formData.append('file', file); formData.append('expire', expire); formData.append('resize', resize); formData.append('key', key); // File to call request.open('post', 'upload.php'); // Function called when request ended request.onload = function (e) { $('#result').append(request.response); }; // Send request request.send(formData); } /** * Function called to upload files. */ function upload() { // Vide les messages si jamais il y en avait $( "#preUpload" ).html( "" ); var upload = true; // Get files var files = $('#files')[0].files; var expire = Math.floor(Date.now() / 1000 + $('#expire').val() * 86400); var random = Math.floor(Math.random() * Math.floor(99)); // Check size and mime var fileAlreadyUploadSizeTotal = 0; for (var i = 0; i < files.length; i++) { // Size fileAlreadyUploadSizeTotal = fileAlreadyUploadSizeTotal + document.getElementById("files").files[i].size; if (document.getElementById("files").files[i].size > Config_maxUploadPerFile) { $('#preUpload').append('
' + document.getElementById("files").files[i].name + ' : ' + Msg_errorFileSize + '
'); upload = false; } // Mime if (!checkMimeTypes(document.getElementById("files").files[i].type)) { $('#preUpload').append('
' + document.getElementById("files").files[i].name + ' : ' + Msg_errorFileType + '
'); upload = false; } } if (fileAlreadyUploadSizeTotal > Config_maxUploadTotal) { $('#preUpload').append('
' + Msg_errorTotalSize + '
'); upload = false; } if (files.length > Config_maxUploadNb) { $('#preUpload').append('
' + Msg_errorUploadNb + '
'); upload = false; } if (files.length == 0) { upload = false; } // Upload file by file if (upload == true) { // Session pour compter le nombre de fichier en cours de download sessionStorage.setItem('uploadWait', files.length); $( ".uploadArea" ).hide(); // On lance l'upload fichier par fichier: for (var i = 0; i < files.length; i++) { if (i == 0) { // On mémorise l'upload dans le localStorage if (localStorage.getItem('myFiles')) { var data = JSON.parse(localStorage.getItem('myFiles')); } else { var data = {items: []}; } var keyGen = Math.floor(Math.random() * (999999999999 - 100000000000) + 100000000000); data.items.push( {id: expire + '-' + random, key: keyGen} ); localStorage.setItem('myFiles', JSON.stringify(data)); } uploadFile(i, files[i], expire, random, $('#resize').val(), keyGen); } } } // Copy on clipart : https://stackoverflow.com/questions/44888884/copying-to-clipboard-textbox-value-using-jquery-javascript function copyToClipboard(text) { var textArea = document.createElement( "textarea" ); textArea.value = text; document.body.appendChild( textArea ); textArea.select(); try { var successful = document.execCommand( 'copy' ); var msg = successful ? 'successful' : 'unsuccessful'; } catch (err) { console.log('Oops, unable to copy'); } document.body.removeChild( textArea ); } $('.btn-upload').on('click', upload); $( "#similarServices" ).click(function() { $('.similarHref').hide(); $('.similarLink').show(); }); $(document).on('click', '.copy', function(){ copyToClipboard($(this).val()); $(this).select(); }); $("input[type=file]").on('change',function(){ $('#resizeForm').hide(); for (var i = 0; i < this.files.length; i++) { var mime = this.files[i].type; if (mime.match('^image\/(jpeg|gif)$')) { $('#resizeForm').show(); } } }); - /* infobulles http://javascript.developpez.com/tutoriels/javascript/creer-info-bulles-css-et-javascript-simplement-avec-jquery/ */ - // Sélectionner tous les liens ayant l'attribut rel valant tooltip - $('a[rel=tooltip]').mouseover(function(e) { - // Récupérer la valeur de l'attribut title et l'assigner à une variable - var tip = $(this).attr('title'); - // Supprimer la valeur de l'attribut title pour éviter l'infobulle native - $(this).attr('title',''); - // Insérer notre infobulle avec son texte dans la page - $(this).append('
' + tip + '
'); - // Ajuster les coordonnées de l'infobulle - $('#tooltip').css('top', e.pageY - 30 ); - $('#tooltip').css('left', e.pageX - 145 ); - // Faire apparaitre l'infobulle avec un effet fadeIn - }).mousemove(function(e) { - // Ajuster la position de l'infobulle au déplacement de la souris - $('#tooltip').css('top', e.pageY - 30 ); - $('#tooltip').css('left', e.pageX - 145 ); - }).mouseout(function() { - // Réaffecter la valeur de l'attribut title - $(this).attr('title',$('.tipBody').html()); - // Supprimer notre infobulle - $(this).children('div#tooltip').remove(); - }); });