From 92db927622850b27064fa7ee9dae3edeeab2ae73 Mon Sep 17 00:00:00 2001 From: L3D <16953664+DO1JLR@users.noreply.github.com> Date: Wed, 3 Apr 2019 19:26:41 +0200 Subject: [PATCH] Update JS and travis (#13) * delete some REANDOM JavaScriptShit * Update JS and sass * improve sassc * edit travis config --- .gitignore | 3 +++ .travis.yml | 2 +- Makefile | 18 +++++++-------- assets/js/main.js | 51 ++++------------------------------------- templates/layout.html | 6 ++--- templates/projekte.html | 1 - 6 files changed, 18 insertions(+), 63 deletions(-) diff --git a/.gitignore b/.gitignore index b68d806..11d39b3 100644 --- a/.gitignore +++ b/.gitignore @@ -48,4 +48,7 @@ assets/css/ie9.css.map assets/css/main.min.css.map assets/css/ie9.min.css.map tmp/ +libsass/ +sass-spec/ +sassc/ diff --git a/.travis.yml b/.travis.yml index 412bde3..db46b20 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,7 +7,7 @@ cache: - $HOME/.cache/pip before_install: - git lfs pull - - gem install sass + - make install-sassc install: - "pip install Lektor" - make sass diff --git a/Makefile b/Makefile index 4e7c29f..c3017ae 100644 --- a/Makefile +++ b/Makefile @@ -3,26 +3,24 @@ LEKTOR_SERVER_FLAGS=-h 127.0.0.1 all: build sass: - sass -t compressed ./assets/sass/main.scss ./assets/css/main.min.css - sass -t compressed ./assets/sass/ie9.scss ./assets/css/ie9.min.css - rm ./assets/css/main.min.css.map - rm ./assets/css/ie9.min.css.map + ./sassc/bin/sassc -t compressed ./assets/sass/main.scss ./assets/css/main.min.css + ./sassc/bin/sassc -t compressed ./assets/sass/ie9.scss ./assets/css/ie9.min.css lektor clean --yes lektor build sass-uncompressed: - sass ./assets/sass/main.scss ./assets/css/main.css - sass ./assets/sass/ie9.scss ./assets/css/ie9.css - rm ./assets/css/main.css.map - rm ./assets/css/ie9.css.map + ./sassc/bin/sassc ./assets/sass/main.scss ./assets/css/main.css + ./sassc/bin/sassc ./assets/sass/ie9.scss ./assets/css/ie9.css lektor clean --yes lektor build install: + if hash apt 2>/dev/null; then sudo apt update; sudo apt install imagemagick python3 python3-pip -y; elif hash pacman 2>/dev/null; then sudo pacman -Sy imagemagick python python-pip --noconfirm; elif hash dnf 2>/dev/null; then sudo dnf install -y ImageMagick python3 python3-pip; else echo -e "Please install Imagemagick, Python3 and Pip!"; fi pip install lektor --user - gem install sass - if hash apt 2>/dev/null; then sudo apt update; sudo apt install imagemagick -y; elif hash pacman 2>/dev/null; then sudo pacman -Sy imagemagick --noconfirm; elif hash dnf 2>/dev/null; then sudo dnf install -y imagemagick; else echo -e "Please install Imagemagick"; fi + make install-sassc +install-sassc: + if [ ! -d './sassc' ]; then git clone https://github.com/sass/sassc.git sassc; . sassc/script/bootstrap ; make -C sassc -j4 ; fi build: sass lektor build diff --git a/assets/js/main.js b/assets/js/main.js index 411eee2..e14e194 100644 --- a/assets/js/main.js +++ b/assets/js/main.js @@ -2,6 +2,10 @@ Landed by HTML5 UP html5up.net | @ajlkn Free for personal and commercial use under the CCA 3.0 license (html5up.net/license) + + "Cleaned" - aka destroyed and rewritten by L3D. + L3D does not know how JavaScript works and just deleted some random lines. + */ (function($) { @@ -154,53 +158,6 @@ } - // Wrappers. - var $wrappers = $('.wrapper'); - - $wrappers - .each(function() { - - var $this = $(this), - on, off; - - on = function() { - - if (skel.canUse('transition')) { - - $this.scrollex({ - top: 120, - bottom: 0, - initialize: function(t) { $this.addClass('inactive'); }, - terminate: function(t) { $this.removeClass('inactive'); }, - enter: function(t) { $this.removeClass('inactive'); }, - - // Uncomment the line below to "rewind" when this wrapper scrolls out of view. - - //leave: function(t) { $this.addClass('inactive'); }, - - }); - - } - - }; - - off = function() { - - if (skel.canUse('transition')) - $this.unscrollex(); - - }; - - skel.on('change', function() { - - if (skel.breakpoint('medium').active) - (off)(); - else - (on)(); - - }); - - }); // Banner. var $banner = $('#banner'); diff --git a/templates/layout.html b/templates/layout.html index 8ac407a..c893855 100644 --- a/templates/layout.html +++ b/templates/layout.html @@ -278,9 +278,7 @@ Wenn Sie unsere Kritik an der geplanten Urheberrechtsreform teilen, werden Sie a - {% - block mainjs %} - {% - endblock %} + + diff --git a/templates/projekte.html b/templates/projekte.html index 4964268..2e09ef3 100644 --- a/templates/projekte.html +++ b/templates/projekte.html @@ -3,7 +3,6 @@ {% block title %}{{ this.title }}{% endblock %} -{% block mainjs %}{% endblock %} {% block body %}