Skip to content

Commit

Permalink
p3x-robot sunday release 2018-5-14 23:41:26
Browse files Browse the repository at this point in the history
  • Loading branch information
p3x-robot committed May 14, 2018
1 parent 60c47ce commit df0c8f1
Show file tree
Hide file tree
Showing 9 changed files with 61 additions and 45 deletions.
2 changes: 1 addition & 1 deletion INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ UrlToolkit {

---

[**P3X-GITLIST**](https://pages.corifeus.com/gitlist) Build v2.0.16-591
[**P3X-GITLIST**](https://pages.corifeus.com/gitlist) Build v2.0.18-595

[![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)

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@



# 🤖 P3X Gitlist v2.0.16-591
# 🤖 P3X Gitlist v2.0.18-595

This is an open-source project. Star this repository if you like it, or even donate! Thank you so much! :)

Expand Down Expand Up @@ -35,7 +35,7 @@ https://nodejs.org/en/download/package-manager/
[//]: #@corifeus-header:end

This is Klaus Silveira's fork, with multiple themes, sub-modules and updated to PHP7 only and upgraded all components.
This is Klaus Silveira's fork, with multiple themes (dark/light), sub-modules, uglify-es, webpack, toast, pure Bootstrap 3 and upgraded to PHP7.1 with all components.

### PHP > 7.1 only

Expand Down Expand Up @@ -145,7 +145,7 @@ npm run watch

---

[**P3X-GITLIST**](https://pages.corifeus.com/gitlist) Build v2.0.16-591
[**P3X-GITLIST**](https://pages.corifeus.com/gitlist) Build v2.0.18-595

[![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)

Expand Down
5 changes: 3 additions & 2 deletions artifacts/php-7.2-ubuntu.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@

[//]: #@corifeus-header:end
# Install PHP 7.2 on Ubuntu

# Install PHP 7.2 on Ubuntu before Bionic

```bash
sudo add-apt-repository ppa:ondrej/php
Expand All @@ -19,7 +20,7 @@ sudo apt upgrade -y

---

[**P3X-GITLIST**](https://pages.corifeus.com/gitlist) Build v2.0.16-591
[**P3X-GITLIST**](https://pages.corifeus.com/gitlist) Build v2.0.18-595

[![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)

Expand Down
2 changes: 1 addition & 1 deletion changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ require('codemirror/mode/yaml/yaml');

---

[**P3X-GITLIST**](https://pages.corifeus.com/gitlist) Build v2.0.16-591
[**P3X-GITLIST**](https://pages.corifeus.com/gitlist) Build v2.0.18-595

[![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)

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "p3x-gitlist",
"version": "2.0.16-591",
"version": "2.0.18-595",
"corifeus": {
"prefix": "p3x-",
"publish": false,
Expand Down
5 changes: 3 additions & 2 deletions public/js/bundle.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
require('codemirror/lib/codemirror.css')
require('codemirror/theme/blackboard.css')
require('codemirror/theme/dracula.css')
require('codemirror/theme/idea.css')
require('../less/style.less')
require('../less/fontawesome.less')

Expand Down Expand Up @@ -56,6 +57,6 @@ require('./clone-buttons')
require('./paginate')
require('./search-branch')
require('./search-repositories')
require('./global')
require('./theme-switcher.js')
require('./global')

32 changes: 13 additions & 19 deletions public/js/code-mirror.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,25 @@ document.addEventListener("DOMContentLoaded", function(event) {
expires: 3650
}

buttonScroll.click(() => {
const setScroll = () => {
buttonFull.removeClass('active')
buttonScroll.addClass('active')
codeMirror.css('height', codeMirrorHeight)
gitlist.viewer.setSize(null, codeMirrorHeight);
Cookies.set(cookieName, 'scroll', cookieSettings)
})
}

buttonScroll.click(setScroll)

buttonFull.click(() => {
const setFull = () => {
buttonScroll.removeClass('active')
buttonFull.addClass('active')
codeMirror.css('height', 'auto')
gitlist.viewer.setSize(null, '100%');
Cookies.set(cookieName, 'full', cookieSettings)
})
}

buttonFull.click(setFull)

gitlist.viewer = CodeMirror(function(elt) {
pre.parentNode.replaceChild(elt, pre);
Expand All @@ -46,22 +50,12 @@ document.addEventListener("DOMContentLoaded", function(event) {
lineWrapping: true,
readOnly: true,
mode: mode,
theme: window.gitlist.getActualThemeCodemirror(),
});

const setCodeMirror = function() {
if (gitlist.getThemeCookie !== undefined) {
global.gitlist.setTheme()
} else {
setTimeout(function() {
setCodeMirror()
if (currentSizing !== 'scroll') {
buttonFull.click();
} else {
buttonScroll.click();
}
})
}
if (currentSizing === 'full') {
setFull()
} else {
setScroll()
}
setCodeMirror()
}
})
33 changes: 26 additions & 7 deletions public/js/global.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

window.gitlist.isDark =(theme) => {
for(var i = 0; i < window.gitlist.dark.length; i++ ) {
if (window.gitlist.dark[i] === theme) {
Expand All @@ -9,26 +10,44 @@ window.gitlist.isDark =(theme) => {

let $body;

window.gitlist.codemirrorTheme = {
light: 'idea',
dark: 'dracula',
}

window.gitlist.getActualTheme = () => {
const theme = window.gitlist.getThemeCookie()
const actualTheme = theme.split('-')[1]
return actualTheme;
}

window.gitlist.getActualThemeCodemirror = () => {
if (window.gitlist.isDark(window.gitlist.getActualTheme())) {
return window.gitlist.codemirrorTheme.dark;
} else {
return window.gitlist.codemirrorTheme.light;
}
}

window.gitlist.setTheme = () => {
if ($body === undefined) {
if ($body === undefined || window.gitlist.getThemeCookie === undefined) {
setTimeout(() => {
window.gitlist.setTheme(theme)
window.gitlist.setTheme()
})
return;
}
const theme = global.gitlist.getThemeCookie()
const actualTheme = theme.split('-')[1]
if (window.gitlist.isDark(actualTheme)) {
const theme = window.gitlist.getActualTheme();
if (window.gitlist.isDark(theme)) {
$body.addClass('p3x-gitlist-dark')
$body.removeClass('p3x-gitlist-light')
if (gitlist.viewer !== undefined) {
gitlist.viewer.setOption("theme", 'blackboard');
gitlist.viewer.setOption("theme", window.gitlist.codemirrorTheme.dark);
}
} else {
$body.addClass('p3x-gitlist-light')
$body.removeClass('p3x-gitlist-dark')
if (gitlist.viewer !== undefined) {
gitlist.viewer.setOption("theme", 'default');
gitlist.viewer.setOption("theme", window.gitlist.codemirrorTheme.light);
}
}
let setTimeoutSwitch;
Expand Down
19 changes: 10 additions & 9 deletions public/js/theme-switcher.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
const Cookies = require('js-cookie')
const themeCookieName = 'gitlist-bootstrap-theme'

function getThemeCookie() {
const theme = Cookies.get(themeCookieName)
return theme || 'bootstrap-cosmo';
}

gitlist.getThemeCookie = getThemeCookie;

document.addEventListener("DOMContentLoaded", function(event) {

const themes = require('./themes.js')
Expand All @@ -10,15 +20,6 @@ document.addEventListener("DOMContentLoaded", function(event) {
menuList: themeList,
})

const Cookies = require('js-cookie')
const themeCookieName = 'gitlist-bootstrap-theme'

function getThemeCookie() {
const theme = Cookies.get(themeCookieName)
return theme || 'bootstrap-cosmo';
}

gitlist.getThemeCookie = getThemeCookie;

function setThemeCookie(theme) {
Cookies.set(themeCookieName, theme, { expires: 3650, path: '/' });
Expand Down

0 comments on commit df0c8f1

Please sign in to comment.