devshort

private self-hosted shortlink service
git clone https://git.clttr.info/devshort.git
Log (Feed) | Files | Refs (Tags) | README | LICENSE

commit e0e4b8f5ed8253d0146b54a397bb1c6f4d68d74e
parent 7d255368289987b7e263913c9339c20c82ca829c
Author: flokX <flokX@users.noreply.github.com>
Date:   Sun, 28 Jul 2019 16:11:40 +0200

Stick to the styleguide of mdo

Diffstat:
Madmin/index.php | 18+++++++++---------
Madmin/main.js | 1+
Massets/main.css | 4----
Mindex.php | 8++++----
Minstaller.php | 8++++----
Mredirect.php | 8++++----
6 files changed, 22 insertions(+), 25 deletions(-)

diff --git a/admin/index.php b/admin/index.php @@ -49,14 +49,14 @@ if ($config_content["settings"]["custom_links"]) { ?> <!doctype html> -<html lang="en" class="h-100"> +<html class="h-100" lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <meta name="robots" content="noindex, nofollow"> <meta name="author" content="<?php echo $config_content["settings"]["author"]; ?> and the devShort team"> - <link rel="icon" href="../<?php echo $config_content["settings"]["favicon"]; ?>"> + <link href="../<?php echo $config_content["settings"]["favicon"]; ?>" rel="icon"> <title>Admin panel | <?php echo $config_content["settings"]["name"]; ?></title> <link href="../assets/vendor/bootstrap/bootstrap.min.css" rel="stylesheet"> <link href="../assets/main.css" rel="stylesheet"> @@ -64,25 +64,25 @@ if ($config_content["settings"]["custom_links"]) { <body class="d-flex flex-column h-100"> - <main role="main" class="flex-shrink-0"> + <main class="flex-shrink-0"> <div class="container"> <h1 class="mt-5 text-center"><?php echo $config_content["settings"]["name"]; ?></h1> <h4 class="mb-4 text-center">admin panel</h4> <div class="card mb-3"> <div class="card-body"> - <h5 class="card-title">Add shortlink <small><a id="refresh" href="#refresh" class="card-link">Refresh charts</a></small></h5> + <h5 class="card-title">Add shortlink <small><a class="card-link" id="refresh" href="#refresh">Refresh charts</a></small></h5> <form class="form-inline" id="add-form"> <label class="sr-only" for="name">Name</label> - <input type="text" class="form-control mb-2 mr-sm-2" id="name" placeholder="Link1" required> + <input class="form-control mb-2 mr-sm-2" id="name" type="text" placeholder="Link1" required> <label class="sr-only" for="url">URL (destination)</label> - <input type="url" class="form-control mb-2 mr-sm-2" id="url" placeholder="https://example.com" value="https://" required> - <button type="submit" class="btn btn-primary mb-2">Add</button> + <input class="form-control mb-2 mr-sm-2" id="url" type="url" placeholder="https://example.com" required> + <button class="btn btn-primary mb-2" type="submit">Add</button> <div id="status"></div> </form> </div> </div> <div class="d-flex justify-content-center"> - <div id="spinner" class="spinner-border text-primary" role="status"> + <div class="spinner-border text-primary" id="spinner" role="status"> <span class="sr-only">Loading...</span> </div> </div> @@ -91,7 +91,7 @@ if ($config_content["settings"]["custom_links"]) { </div> </main> - <footer class="footer mt-auto py-3"> + <footer class="footer mt-auto py-3 bg-light"> <div class="container"> <div class="d-flex justify-content-between align-items-center"> <span class="text-muted">&copy; <?php echo date("Y") . " " . $config_content["settings"]["author"]; ?> and <a href="https://github.com/flokX/devShort">devShort</a></span> diff --git a/admin/main.js b/admin/main.js @@ -42,6 +42,7 @@ document.getElementById('add-form').addEventListener('submit', function (event) }); spinner.style.display = 'none'; }); + document.getElementById('refresh').addEventListener('click', function (event) { 'use strict'; event.preventDefault(); diff --git a/assets/main.css b/assets/main.css @@ -7,7 +7,3 @@ max-width: 800px; padding: 0 15px; } - -.footer { - background-color: #f5f5f5; -} diff --git a/index.php b/index.php @@ -23,14 +23,14 @@ if ($config_content["settings"]["custom_links"]) { ?> <!doctype html> -<html lang="en" class="h-100"> +<html class="h-100" lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <meta name="robots" content="noindex, nofollow"> <meta name="author" content="<?php echo $config_content["settings"]["author"]; ?> and the devShort team"> - <link rel="icon" href="<?php echo $config_content["settings"]["favicon"]; ?>"> + <link href="<?php echo $config_content["settings"]["favicon"]; ?>" rel="icon"> <title><?php echo $config_content["settings"]["name"]; ?></title> <link href="assets/vendor/bootstrap/bootstrap.min.css" rel="stylesheet"> <link href="assets/main.css" rel="stylesheet"> @@ -38,7 +38,7 @@ if ($config_content["settings"]["custom_links"]) { <body class="d-flex flex-column h-100"> - <main role="main" class="flex-shrink-0"> + <main class="flex-shrink-0"> <div class="container"> <nav class="mt-3" aria-label="breadcrumb"> <ol class="breadcrumb"> @@ -58,7 +58,7 @@ if ($config_content["settings"]["custom_links"]) { </div> </main> - <footer class="footer mt-auto py-3"> + <footer class="footer mt-auto py-3 bg-light"> <div class="container"> <div class="d-flex justify-content-between align-items-center"> <span class="text-muted">&copy; <?php echo date("Y") . " " . $config_content["settings"]["author"]; ?> and <a href="https://github.com/flokX/devShort">devShort</a></span> diff --git a/installer.php b/installer.php @@ -51,14 +51,14 @@ require valid-user"; ?> <!doctype html> -<html lang="en" class="h-100"> +<html class="h-100" lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <meta name="robots" content="noindex, nofollow"> <meta name="author" content="The devShort team"> - <link rel="icon" href="assets/icon.png"> + <link href="assets/icon.png" rel="icon"> <title>Installer | devShort</title> <link href="assets/vendor/bootstrap/bootstrap.min.css" rel="stylesheet"> <link href="assets/main.css" rel="stylesheet"> @@ -66,7 +66,7 @@ require valid-user"; <body class="d-flex flex-column h-100"> - <main role="main" class="flex-shrink-0"> + <main class="flex-shrink-0"> <div class="container"> <nav class="mt-3" aria-label="breadcrumb"> <ol class="breadcrumb"> @@ -90,7 +90,7 @@ require valid-user"; </div> </main> - <footer class="footer mt-auto py-3"> + <footer class="footer mt-auto py-3 bg-light"> <div class="container"> <div class="d-flex justify-content-between align-items-center"> <span class="text-muted">&copy; <?php echo date("Y") ?> <a href="https://github.com/flokX/devShort">devShort</a></span> diff --git a/redirect.php b/redirect.php @@ -45,14 +45,14 @@ if (array_key_exists($short, $config_content["shortlinks"])) { ?> <!doctype html> -<html lang="en" class="h-100"> +<html class="h-100" lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <meta name="robots" content="noindex, nofollow"> <meta name="author" content="<?php echo $config_content["settings"]["author"]; ?> and the devShort team"> - <link rel="icon" href="<?php echo $config_content["settings"]["favicon"]; ?>"> + <link href="<?php echo $config_content["settings"]["favicon"]; ?>" rel="icon"> <title>404 | <?php echo $config_content["settings"]["name"]; ?></title> <link href="assets/vendor/bootstrap/bootstrap.min.css" rel="stylesheet"> <link href="assets/main.css" rel="stylesheet"> @@ -60,7 +60,7 @@ if (array_key_exists($short, $config_content["shortlinks"])) { <body class="d-flex flex-column h-100"> - <main role="main" class="flex-shrink-0"> + <main class="flex-shrink-0"> <div class="container"> <nav class="mt-3" aria-label="breadcrumb"> <ol class="breadcrumb"> @@ -74,7 +74,7 @@ if (array_key_exists($short, $config_content["shortlinks"])) { </div> </main> - <footer class="footer mt-auto py-3"> + <footer class="footer mt-auto py-3 bg-light"> <div class="container"> <div class="d-flex justify-content-between align-items-center"> <span class="text-muted">&copy; <?php echo date("Y") . " " . $config_content["settings"]["author"]; ?> and <a href="https://github.com/flokX/devShort">devShort</a></span>