diff --git a/css/style.css b/css/style.css index 6188b0c..7ff37ec 100644 --- a/css/style.css +++ b/css/style.css @@ -78,6 +78,38 @@ body { } } +.toc +{ + margin-top: 56px; + left:auto; + background: #eee; + width: 20%; + border: 1px solid #ddd; + color: #333; +} +.toc > ul +{ + list-style-type: none; + margin: 8px; + padding: 0px; +} +.toc a { + color: #333; +} +.toc .toc-h3 { + margin-left: 10px +} +.toc .toc-h4 { + margin-left: 20px +} +.toc-active { + color: #000; + font-weight: bold; +} +.toc.right { + right: 0 +} + blockquote { font-style: normal; @@ -197,9 +229,12 @@ flex-wrap: wrap; .alert { display: none; position: fixed; + font-weight: bold; + font-size: 1.5rem; top: 10px; right: 10px; cursor: pointer; + z-index: 1500000; } .imagepreview img diff --git a/hosts/localhost/config.php b/hosts/localhost/config.php index b9a1112..a9159fd 100644 --- a/hosts/localhost/config.php +++ b/hosts/localhost/config.php @@ -8,7 +8,7 @@ define('ALLOWED_EXT','jpg,svg,gif,png,c,tgz,tar.gz,gz,tar,sql,ico'); define('PASSWORD', 'c7ad44cbad762a5da0a452f9e854fdc1e0e7a52a38015f23f3eab1d80b931dd472634dfac71cd34ebc35d16ab7fb8a90c81f975113d6c7538dc69dd8de9077ec'); define('LOG_FILE', 'log.txt'); define('ACCESS_IP', ''); -define('HISTORY_FILE', 'history.txt'); +define('HISTORY_FILE', 'history'); define('MAX_HISTORY_FILES', 5); define('LANGUAGE', 'en'); \ No newline at end of file diff --git a/hosts/localhost/content/dependencies.md b/hosts/localhost/content/dependencies.md index 1ee73ca..4fcaee8 100644 --- a/hosts/localhost/content/dependencies.md +++ b/hosts/localhost/content/dependencies.md @@ -25,14 +25,21 @@ * https://github.com/PrismLibrary/Prism +## Table of Contents + + * https://github.com/jgallen23/toc + ## Icons * https://github.com/FortAwesome/Font-Awesome +## Interface + * https://github.com/mobify/magnifik + * https://github.com/codepo8/css-fork-on-github-ribbon + ## Essential * https://github.com/twbs/bootstrap * https://github.com/jquery/jquery * https://github.com/popperjs/popper-core - * https://github.com/zenorocha/clipboard.js - * https://github.com/codepo8/css-fork-on-github-ribbon \ No newline at end of file + * https://github.com/zenorocha/clipboard.js \ No newline at end of file diff --git a/hosts/localhost/content/features.md b/hosts/localhost/content/features.md index f16b4d7..5b18729 100644 --- a/hosts/localhost/content/features.md +++ b/hosts/localhost/content/features.md @@ -9,6 +9,7 @@ 3. Integrated Image viewer 4. Restricted access by ip address 5. Admin access logging +6. Table of contents ## Planned diff --git a/hosts/localhost/content/index.md b/hosts/localhost/content/index.md index 55d3103..2c818cd 100644 --- a/hosts/localhost/content/index.md +++ b/hosts/localhost/content/index.md @@ -7,7 +7,7 @@ This website is heavily formated with markdown format ! __ __ _ _____ | \/ | | | | __ \ | \ / | __ _ _ __| | _| | | | ___ ___ - | |\/| |/ _` | \'__| |/ / | | |/ _ \ / __| + | |\/| |/ _` | '__| |/ / | | |/ _ \ / __| | | | | (_| | | | <| |__| | (_) | (__ |_| |_|\__,_|_| |_|\_\_____/ \___/ \___| ``` diff --git a/hosts/localhost/content/usage.md b/hosts/localhost/content/usage.md index 726b0b6..3e1641b 100644 --- a/hosts/localhost/content/usage.md +++ b/hosts/localhost/content/usage.md @@ -17,7 +17,7 @@ unzip v6.0.0.zip mv emoji-data-v6.0.0 emoji-data ``` -## Configuration +## Multiples hosts There is a sample website in the "[website_root]/hosts/locahost" directory. It's easy to add a new one, you create one subfolder by name served by your webserver. diff --git a/index.php b/index.php index 6cd9564..b064527 100644 --- a/index.php +++ b/index.php @@ -24,12 +24,16 @@ include LIB_DIR."/ParsedownExtra.php"; include LIB_DIR."/ParsedownExtraPlus.php"; include LIB_DIR."/functions.php"; +### Translations +loadlang(LANGUAGE); +global $LANG; + ### Security testip(); logprotect(); ### Sessions -session_name($_SERVER['SERVER_NAME']); +session_name(markdoc); session_start(); /*var_dump($_POST); @@ -57,17 +61,17 @@ else if (isset($_POST['action'])) } else { - $content = '

Mot de passe incorrect.

'; - $log = file_exists(LOG_FILE) ? unserialize(file_get_contents(LOG_FILE)) : array(); + $content = '

'.$LANG['BADPASS'].'

'; + $log = file_exists(LOG_DIR) ? unserialize(file_get_contents(LOG_DIR)) : array(); if (isset($log[$_SERVER['REMOTE_ADDR']]) === false) { $log[$_SERVER['REMOTE_ADDR']] = array('num' => 0, 'time' => 0); } $log[$_SERVER['REMOTE_ADDR']]['num'] += 1; $log[$_SERVER['REMOTE_ADDR']]['time'] = time(); - file_put_contents(LOG_FILE, serialize($log)); + file_put_contents(LOG_DIR, serialize($log)); } - } + } else $content='

Aucun mot de passe renseigné !

'; } @@ -181,15 +185,16 @@ print(($_SESSION['md_admin'] == true)?'
  • ").addClass(l.itemClass(n,i,f,l.prefix)).append(u);o.append(d)}),e.html(o)})},jQuery.fn.toc.defaults={container:"body",listType:"