From 8d5d7491bc052f747c4697c3df7ae1994ed0aba8 Mon Sep 17 00:00:00 2001 From: Lucas Cimon Date: Mon, 14 Aug 2017 22:18:28 +0200 Subject: [PATCH] Implementing tag filters --- .pre-commit-config.yaml | 3 +- static/css/main.css | 6 +-- static/js/plugins.js | 22 --------- templates/base.html | 29 ++++++------ templates/index.html | 12 ++++- .../js/enable-search.js | 5 -- templates/js/filter-tags.js | 46 +++++++++++++++++++ static/js/main.js => templates/js/social.js | 2 - templates/partials/article-short.html | 3 +- 9 files changed, 78 insertions(+), 50 deletions(-) delete mode 100644 static/js/plugins.js rename static/js/main-search.js => templates/js/enable-search.js (65%) create mode 100644 templates/js/filter-tags.js rename static/js/main.js => templates/js/social.js (91%) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6f7b67e..294d629 100755 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -29,7 +29,8 @@ - "--ignore=Bad value \"DUMMY\" for attribute \"datetime\"" - "--ignore=Bad value \"DUMMY\" for attribute \"lang\" on element \"html\"" - "--ignore=Bad value \"DUMMY\" for attribute \"type\" on element \"link\": Subtype missing" - exclude: templates/tipue_search.html + files: ^templates/[^/]*\.html$ + exclude: ^templates/(index|tipue_search)\.html$ - repo: local hooks: - id: make diff --git a/static/css/main.css b/static/css/main.css index a0dedf7..b8925d7 100644 --- a/static/css/main.css +++ b/static/css/main.css @@ -113,7 +113,7 @@ a { font-weight: 800; color: white; } -.mg-tag-filters { +.mg-header-extra { flex: 1; display: flex; justify-content: flex-end; } @@ -129,10 +129,6 @@ a { .mg-tag-filter:hover { border-color: #b2b2b2; text-decoration: none;} -.mg-tag-filter:hover { - text-decoration: none; } -.mg-tag-filter:not(:disabled) { - cursor: pointer; } .mg-nav-small { width: 100% } diff --git a/static/js/plugins.js b/static/js/plugins.js deleted file mode 100644 index 7082cf3..0000000 --- a/static/js/plugins.js +++ /dev/null @@ -1,22 +0,0 @@ -// Avoid `console` errors in browsers that lack a console. -(function() { - var method; - var noop = function () {}; - var methods = [ - 'assert', 'clear', 'count', 'debug', 'dir', 'dirxml', 'error', - 'exception', 'group', 'groupCollapsed', 'groupEnd', 'info', 'log', - 'markTimeline', 'profile', 'profileEnd', 'table', 'time', 'timeEnd', - 'timeStamp', 'trace', 'warn' - ]; - var length = methods.length; - var console = (window.console = window.console || {}); - - while (length--) { - method = methods[length]; - - // Only stub undefined methods. - if (!console[method]) { - console[method] = noop; - } - } -}()); diff --git a/templates/base.html b/templates/base.html index 96f28d6..126135e 100644 --- a/templates/base.html +++ b/templates/base.html @@ -55,7 +55,6 @@ -