diff --git a/INSTALL.md b/INSTALL.md index 355be79d..cceb3751 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -116,7 +116,7 @@ UrlToolkit { --- -[**P3X-GITLIST**](https://pages.corifeus.com/gitlist) Build v2.9.4-886 +[**P3X-GITLIST**](https://pages.corifeus.com/gitlist) Build v2.9.6-887 [![Like Corifeus @ Facebook](https://img.shields.io/badge/LIKE-Corifeus-3b5998.svg)](https://www.facebook.com/corifeus.software) [![Donate for Corifeus / P3X](https://img.shields.io/badge/Donate-Corifeus-003087.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=QZVM4V6HVZJW6) [![Contact Corifeus / P3X](https://img.shields.io/badge/Contact-P3X-ff9900.svg)](https://www.patrikx3.com/en/front/contact) diff --git a/README.md b/README.md index e6cefd06..4841c1b6 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ -# 🤖 P3X Gitlist v2.9.4-886 +# 🤖 P3X Gitlist v2.9.6-887 This is an open-source project. Star this repository if you like it, or even donate! Thank you so much! :) @@ -171,7 +171,7 @@ npm run watch --- -[**P3X-GITLIST**](https://pages.corifeus.com/gitlist) Build v2.9.4-886 +[**P3X-GITLIST**](https://pages.corifeus.com/gitlist) Build v2.9.6-887 [![Like Corifeus @ Facebook](https://img.shields.io/badge/LIKE-Corifeus-3b5998.svg)](https://www.facebook.com/corifeus.software) [![Donate for Corifeus / P3X](https://img.shields.io/badge/Donate-Corifeus-003087.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=QZVM4V6HVZJW6) [![Contact Corifeus / P3X](https://img.shields.io/badge/Contact-P3X-ff9900.svg)](https://www.patrikx3.com/en/front/contact) diff --git a/artifacts/php-7.2-ubuntu.md b/artifacts/php-7.2-ubuntu.md index b4db3af6..d5845726 100644 --- a/artifacts/php-7.2-ubuntu.md +++ b/artifacts/php-7.2-ubuntu.md @@ -20,7 +20,7 @@ sudo apt upgrade -y --- -[**P3X-GITLIST**](https://pages.corifeus.com/gitlist) Build v2.9.4-886 +[**P3X-GITLIST**](https://pages.corifeus.com/gitlist) Build v2.9.6-887 [![Like Corifeus @ Facebook](https://img.shields.io/badge/LIKE-Corifeus-3b5998.svg)](https://www.facebook.com/corifeus.software) [![Donate for Corifeus / P3X](https://img.shields.io/badge/Donate-Corifeus-003087.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=QZVM4V6HVZJW6) [![Contact Corifeus / P3X](https://img.shields.io/badge/Contact-P3X-ff9900.svg)](https://www.patrikx3.com/en/front/contact) diff --git a/changelog.md b/changelog.md index 6af2d01d..596e7cda 100644 --- a/changelog.md +++ b/changelog.md @@ -139,7 +139,7 @@ require('codemirror/mode/yaml/yaml'); --- -[**P3X-GITLIST**](https://pages.corifeus.com/gitlist) Build v2.9.4-886 +[**P3X-GITLIST**](https://pages.corifeus.com/gitlist) Build v2.9.6-887 [![Like Corifeus @ Facebook](https://img.shields.io/badge/LIKE-Corifeus-3b5998.svg)](https://www.facebook.com/corifeus.software) [![Donate for Corifeus / P3X](https://img.shields.io/badge/Donate-Corifeus-003087.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=QZVM4V6HVZJW6) [![Contact Corifeus / P3X](https://img.shields.io/badge/Contact-P3X-ff9900.svg)](https://www.patrikx3.com/en/front/contact) diff --git a/package.json b/package.json index 50eb7431..7973e38c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "p3x-gitlist", - "version": "2.9.5-886", + "version": "2.9.7-887", "corifeus": { "prod-dir": "prod", "postfix": "2607a7cb45c1136298a2a2ccb0a3d49ec147c7dab987b6dd4ec124a716e92c92", diff --git a/src/browser/js/global.js b/src/browser/js/global.js index d97a2016..5aea6fb7 100644 --- a/src/browser/js/global.js +++ b/src/browser/js/global.js @@ -108,58 +108,67 @@ window.gitlist.setTheme = () => { for(let diffButton of diffButtons ) { diffButton.click(); } - if (diffButtons.length > 0) { - $.snackbar({ - content: `We hid the shown diffs, to make the theme switching faster.`, - timeout: window.gitlist.snapckbarLongTimeout, - }); - window.scrollTo(0, 0); - } - // console.log('p3x-gitlist switching theme') - currentTheme = theme; + const switchThemeActually = () => { + currentTheme = theme; - /* - const themeBlameCodeMirror = (options) => { - const { theme } = options - for(let cm of window.gitlist.blameCodeMirror) { - cm.setOption("theme", theme); + /* + const themeBlameCodeMirror = (options) => { + const { theme } = options + for(let cm of window.gitlist.blameCodeMirror) { + cm.setOption("theme", theme); + } } - } - */ + */ + + let bodyAddClass + let bodyRemoveClass + let codeMirrorTheme + if (window.gitlist.isDark(theme)) { + bodyAddClass = 'p3x-gitlist-dark' + bodyRemoveClass = 'p3x-gitlist-light' + codeMirrorTheme = window.gitlist.codemirrorTheme.dark + } else { + bodyAddClass = 'p3x-gitlist-light' + bodyRemoveClass = 'p3x-gitlist-dark' + codeMirrorTheme = window.gitlist.codemirrorTheme.light - let bodyAddClass - let bodyRemoveClass - let codeMirrorTheme - if (window.gitlist.isDark(theme)) { - bodyAddClass = 'p3x-gitlist-dark' - bodyRemoveClass = 'p3x-gitlist-light' - codeMirrorTheme = window.gitlist.codemirrorTheme.dark - } else { - bodyAddClass = 'p3x-gitlist-light' - bodyRemoveClass = 'p3x-gitlist-dark' - codeMirrorTheme = window.gitlist.codemirrorTheme.light + } - } + $body.addClass(bodyAddClass) + $body.removeClass(bodyRemoveClass) + if (gitlist.viewer !== undefined) { + gitlist.viewer.setOption("theme", codeMirrorTheme); + } + if (gitlist.blameCodeMirror !== undefined) { + gitlist.blameCodeMirror.setOption("theme", codeMirrorTheme); + } + + + window.gitlist.networkRedraw(); + window.gitlist.treegraph(); +// if (window.gitlist.lastloadSpan !== undefined && window.gitlist.lastloadSpan > 1000) { + clearTimeout(setTimeoutSwitch) + setTimeoutSwitch = setTimeout(() => { + $('.p3x-gitlist-overlay').remove(); + }, 250) - $body.addClass(bodyAddClass) - $body.removeClass(bodyRemoveClass) - if (gitlist.viewer !== undefined) { - gitlist.viewer.setOption("theme", codeMirrorTheme); } - if (gitlist.blameCodeMirror !== undefined) { - gitlist.blameCodeMirror.setOption("theme", codeMirrorTheme); + // console.log('p3x-gitlist switching theme') +// } + + if (diffButtons.length > 0) { + $.snackbar({ + content: `We hid the shown diffs, to make the theme switching faster.`, + timeout: window.gitlist.snapckbarLongTimeout, + }); + window.scrollTo(0, 0); + setTimeout(switchThemeActually, 250) + } else { + switchThemeActually() } - window.gitlist.networkRedraw(); - window.gitlist.treegraph(); -// if (window.gitlist.lastloadSpan !== undefined && window.gitlist.lastloadSpan > 1000) { - clearTimeout(setTimeoutSwitch) - setTimeoutSwitch = setTimeout(() => { - $('.p3x-gitlist-overlay').remove(); - }, 250) -// } } const pushHash = (hash) => { if(history.pushState) { diff --git a/todo.md b/todo.md index 1ae2c762..28071a92 100644 --- a/todo.md +++ b/todo.md @@ -13,7 +13,7 @@ --- -[**P3X-GITLIST**](https://pages.corifeus.com/gitlist) Build v2.9.4-886 +[**P3X-GITLIST**](https://pages.corifeus.com/gitlist) Build v2.9.6-887 [![Like Corifeus @ Facebook](https://img.shields.io/badge/LIKE-Corifeus-3b5998.svg)](https://www.facebook.com/corifeus.software) [![Donate for Corifeus / P3X](https://img.shields.io/badge/Donate-Corifeus-003087.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=QZVM4V6HVZJW6) [![Contact Corifeus / P3X](https://img.shields.io/badge/Contact-P3X-ff9900.svg)](https://www.patrikx3.com/en/front/contact)