From 993c82dac0fc5cfa09a0b98f93686c0e12544ffb Mon Sep 17 00:00:00 2001 From: Andy Tudhope Date: Sun, 31 Mar 2019 11:34:55 +0200 Subject: [PATCH] Remove submodules entirely --- .gitmodules | 3 - Jenkinsfile | 10 --- gulpfile.js | 4 +- package.json | 4 +- themes/navy/layout/layout.swig | 2 +- .../navy/layout/partial/community-popup.swig | 60 ++++++++++++++++++ themes/navy/layout/partial/header-nav.swig | 9 +++ themes/navy/layout/partial/header.swig | 8 +-- .../navy/layout/partial/projects-popup.swig | 62 +++++++++++++++++++ themes/navy/layout/partial/search.swig | 23 +++++++ themes/navy/layout/partial/shared-partials | 1 - themes/navy/source/js/main.js | 4 +- themes/navy/source/js/popups.js | 43 +++++++++++++ themes/navy/source/js/shared-js | 1 - themes/navy/source/js/utils.js | 20 ++++++ 15 files changed, 228 insertions(+), 26 deletions(-) delete mode 100644 .gitmodules create mode 100644 themes/navy/layout/partial/community-popup.swig create mode 100644 themes/navy/layout/partial/header-nav.swig create mode 100644 themes/navy/layout/partial/projects-popup.swig create mode 100644 themes/navy/layout/partial/search.swig delete mode 160000 themes/navy/layout/partial/shared-partials create mode 100644 themes/navy/source/js/popups.js delete mode 160000 themes/navy/source/js/shared-js create mode 100644 themes/navy/source/js/utils.js diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index b594082..0000000 --- a/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "themes/navy/layout/partial/shared-partials"] - path = themes/navy/layout/partial/shared-partials - url = https://github.com/status-im/status.im-partials diff --git a/Jenkinsfile b/Jenkinsfile index 2d66107..fc431b3 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -16,16 +16,6 @@ pipeline { } stages { - stage('Git Prep') { - steps { - sh "git config user.name ${env.GIT_USER}" - sh "git config user.email ${env.GIT_MAIL}" - /* necessary to have access to the theme partials */ - sshagent(credentials: ['status-im-auto-ssh']) { - sh 'git submodule update --init --recursive' - } - } - } stage('Install Deps') { steps { diff --git a/gulpfile.js b/gulpfile.js index f451e71..8cfefd1 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -38,8 +38,8 @@ var config = { src: { scss: './themes/navy/source/scss/*.scss', js: [ - './themes/navy/source/js/shared-js/js/utils.js', - './themes/navy/source/js/shared-js/js/popups.js', + './themes/navy/source/js/utils.js', + './themes/navy/source/js/popups.js', './themes/navy/source/js/main.js', ] }, diff --git a/package.json b/package.json index 416a827..7ae8921 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "version": "0.0.0", "private": true, "hexo": { - "version": "3.7.1" + "version": "3.8.0" }, "scripts": { "clean": "rm -rf public/*", @@ -51,4 +51,4 @@ "vinyl-source-stream": "^2.0.0", "watchify": "^3.11.0" } -} +} \ No newline at end of file diff --git a/themes/navy/layout/layout.swig b/themes/navy/layout/layout.swig index a517b05..d1fdbe9 100644 --- a/themes/navy/layout/layout.swig +++ b/themes/navy/layout/layout.swig @@ -7,7 +7,7 @@ {{ partial('partial/header') }} {% endif %} {{ body }} - {{ partial('partial/shared-partials/partials/footer') }} + {{ partial('partial/footer') }} {{ partial('partial/after_footer') }} diff --git a/themes/navy/layout/partial/community-popup.swig b/themes/navy/layout/partial/community-popup.swig new file mode 100644 index 0000000..55b2dc6 --- /dev/null +++ b/themes/navy/layout/partial/community-popup.swig @@ -0,0 +1,60 @@ + -{{ partial('partial/shared-partials/partials/community-popup') }} +{{ partial('partial/community-popup') }} -{{ partial('partial/shared-partials/partials/projects-popup') }} +{{ partial('partial/projects-popup') }} diff --git a/themes/navy/layout/partial/projects-popup.swig b/themes/navy/layout/partial/projects-popup.swig new file mode 100644 index 0000000..55ab696 --- /dev/null +++ b/themes/navy/layout/partial/projects-popup.swig @@ -0,0 +1,62 @@ + + \ No newline at end of file diff --git a/themes/navy/layout/partial/search.swig b/themes/navy/layout/partial/search.swig new file mode 100644 index 0000000..1496e50 --- /dev/null +++ b/themes/navy/layout/partial/search.swig @@ -0,0 +1,23 @@ + +
\ No newline at end of file diff --git a/themes/navy/layout/partial/shared-partials b/themes/navy/layout/partial/shared-partials deleted file mode 160000 index ef5db8a..0000000 --- a/themes/navy/layout/partial/shared-partials +++ /dev/null @@ -1 +0,0 @@ -Subproject commit ef5db8a4de18fe58b1e5e44c7b7f965b13850a91 diff --git a/themes/navy/source/js/main.js b/themes/navy/source/js/main.js index 0aa45f8..884688a 100644 --- a/themes/navy/source/js/main.js +++ b/themes/navy/source/js/main.js @@ -63,8 +63,8 @@ $(document).ready(function () { }); -var addClassToElement = require('./shared-js/js/utils').addClassToElement; -var removeClassFromElement = require('./shared-js/js/utils').removeClassFromElement; +var addClassToElement = require('./utils').addClassToElement; +var removeClassFromElement = require('./utils').removeClassFromElement; /* Code highlighting */ diff --git a/themes/navy/source/js/popups.js b/themes/navy/source/js/popups.js new file mode 100644 index 0000000..6f3bd47 --- /dev/null +++ b/themes/navy/source/js/popups.js @@ -0,0 +1,43 @@ +var addClassToElement = require('./utils').addClassToElement; +var removeClassFromElement = require('./utils').removeClassFromElement; + + +/* Popups */ + +let community = document.querySelectorAll(".item--dropdown-community")[0] +let projects = document.querySelectorAll(".item--dropdown-projects")[0] + +let popups = document.querySelectorAll(".popup-wrap") +let overlays = document.querySelectorAll(".popup-overlay") +let closeButtons = document.querySelectorAll(".popup__button--close") + +let activePopup = null; +let activeOverlay = null; + +community.addEventListener('click', function(event){ + showPopup(popups[0]) + event.preventDefault() +}) + +projects.addEventListener('click', function(event){ + showPopup(popups[1]) + event.preventDefault() +}) + +closeButtons.forEach((button) => { + button.addEventListener('click', closeActivePopup) +}) + +overlays.forEach((overlay) => { + overlay.addEventListener('click', closeActivePopup) +}) + +function showPopup(whichPopup) { + activePopup = whichPopup + addClassToElement(whichPopup, "popup--shown"); +} + +function closeActivePopup() { + removeClassFromElement(activePopup, "popup--shown"); + activePopup = null; +} diff --git a/themes/navy/source/js/shared-js b/themes/navy/source/js/shared-js deleted file mode 160000 index 24185e5..0000000 --- a/themes/navy/source/js/shared-js +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 24185e51517464988a80e3223417a4b3183c7954 diff --git a/themes/navy/source/js/utils.js b/themes/navy/source/js/utils.js new file mode 100644 index 0000000..2fff8ea --- /dev/null +++ b/themes/navy/source/js/utils.js @@ -0,0 +1,20 @@ + +/*--- Utils ---*/ + +function addClassToElement(element, className) { + (element.classList) ? element.classList.add(className) : element.className += ' ' + className + return element +} + + +function removeClassFromElement(element, className) { + if(element.classList) { + element.classList.remove(className) + } else { + element.className = element.className.replace(new RegExp('(^|\\b)' + className.split(' ').join('|') + '(\\b|$)', 'gi'), ' ') + } + return element +} + +exports.addClassToElement = addClassToElement +exports.removeClassFromElement = removeClassFromElement \ No newline at end of file