From ec74e1f2d662e1d87f520f9bcd69b724d4fee847 Mon Sep 17 00:00:00 2001 From: patrikx3 Date: Mon, 21 May 2018 22:40:42 +0200 Subject: [PATCH] p3x-robot sunday release 2018-5-21 22:40:42 --- INSTALL.md | 2 +- README.md | 4 +- artifacts/php-7.2-ubuntu.md | 2 +- changelog.md | 2 +- composer.json | 2 +- composer.lock | 14 +++---- package.json | 2 +- public/js/commit.js | 24 +++-------- public/js/global.js | 18 ++++---- public/js/theme-switcher.js | 24 +++++------ public/js/themes.js | 36 ++++++++-------- public/less/commit.less | 64 +++++++++++++++++++++++++++++ public/less/default.less | 17 ++++---- public/less/tree.less | 5 +++ src/Controller/CommitController.php | 2 +- src/css-postfix | 2 +- twig/commit.twig | 63 +++++++++++++++++++++++----- twig/layout.tpl.twig | 2 +- twig/tree.twig | 2 +- 19 files changed, 192 insertions(+), 95 deletions(-) create mode 100644 public/less/commit.less create mode 100644 public/less/tree.less diff --git a/INSTALL.md b/INSTALL.md index 46ba5da8..5bfbfad5 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -116,7 +116,7 @@ UrlToolkit { --- -[**P3X-GITLIST**](https://pages.corifeus.com/gitlist) Build v2.7.6-745 +[**P3X-GITLIST**](https://pages.corifeus.com/gitlist) Build v2.7.9-749 [![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 34aefa1d..b92693f2 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ -# 🤖 P3X Gitlist v2.7.6-745 +# 🤖 P3X Gitlist v2.7.9-749 This is an open-source project. Star this repository if you like it, or even donate! Thank you so much! :) @@ -165,7 +165,7 @@ npm run watch --- -[**P3X-GITLIST**](https://pages.corifeus.com/gitlist) Build v2.7.6-745 +[**P3X-GITLIST**](https://pages.corifeus.com/gitlist) Build v2.7.9-749 [![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 2a910551..c052971c 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.7.6-745 +[**P3X-GITLIST**](https://pages.corifeus.com/gitlist) Build v2.7.9-749 [![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 21f025e4..a65a7749 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.7.6-745 +[**P3X-GITLIST**](https://pages.corifeus.com/gitlist) Build v2.7.9-749 [![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/composer.json b/composer.json index ff658d2f..97a5d603 100644 --- a/composer.json +++ b/composer.json @@ -13,7 +13,7 @@ "symfony/twig-bridge": ">=4", "twig/twig": ">=2", "silex/silex": ">=2", - "patrikx3/gitter": "^2.0" + "patrikx3/gitter": "^2.1" }, "require-dev": { "symfony/browser-kit": ">=4", diff --git a/composer.lock b/composer.lock index f1d33ce0..28f50976 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,8 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "1a3e0f217a00c866cb5fdb29ba5b86a5", - "content-hash": "0b00d3963cfedce5bb95b05fc1137135", + "hash": "ff02bd2f1a1e4e2e96c295f75e2ae1b0", + "content-hash": "d9636fa07c87ab61f1ccefa6531284ca", "packages": [ { "name": "danielstjules/stringy", @@ -65,16 +65,16 @@ }, { "name": "patrikx3/gitter", - "version": "2.0.0", + "version": "2.1.0", "source": { "type": "git", "url": "https://github.com/patrikx3/gitter.git", - "reference": "b0c79d6b500ad12cacdde8e56c99a5d8ec289737" + "reference": "1ee9c22731e4da73e64191f2ece2f3d4ac0a52c7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/patrikx3/gitter/zipball/b0c79d6b500ad12cacdde8e56c99a5d8ec289737", - "reference": "b0c79d6b500ad12cacdde8e56c99a5d8ec289737", + "url": "https://api.github.com/repos/patrikx3/gitter/zipball/1ee9c22731e4da73e64191f2ece2f3d4ac0a52c7", + "reference": "1ee9c22731e4da73e64191f2ece2f3d4ac0a52c7", "shasum": "" }, "require": { @@ -118,7 +118,7 @@ "git", "vcs" ], - "time": "2018-05-21 15:36:26" + "time": "2018-05-21 20:35:20" }, { "name": "pimple/pimple", diff --git a/package.json b/package.json index 493030b0..c95cde00 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "p3x-gitlist", - "version": "2.7.6-745", + "version": "2.7.9-749", "corifeus": { "postfix": "", "prefix": "p3x-", diff --git a/public/js/commit.js b/public/js/commit.js index 3530d09d..a7c31884 100644 --- a/public/js/commit.js +++ b/public/js/commit.js @@ -1,34 +1,20 @@ $(() => { - const diffEditors = $('.p3x-gitlist-commit-diff'); + const diffEditors = $('.p3x-gitlist-diff-container'); let deferScroll; if (diffEditors) { for (let diffEditor of diffEditors) { const $editableHover = $('#' + diffEditor.dataset.diffId); - const editableHover = $editableHover.get(0); $editableHover.one('click', () => { clearTimeout(deferScroll) setTimeout(() => { window.gitlist.scrollIntoView(document.getElementById(diffEditor.dataset.diffRef)) + window.gitlist.pushHash(`#${diffEditor.dataset.diffRef}`) + //console.log(diffEditor) + $(diffEditor).show(); }, 0) - $editableHover.find('.panel-body').html(' Loading the diff ...') - const value = JSON.parse(diffEditor.innerText).toString() - diffEditor.remove(); - const editor = CodeMirror(function (node) { - editableHover.parentNode.replaceChild(node, editableHover); - }, { - styleActiveLine: true, - styleSelectedText: true, - value: value, - lineNumbers: false, - matchBrackets: true, - lineWrapping: false, - readOnly: true, - mode: 'text/x-diff', - theme: window.gitlist.getActualThemeCodemirror(), - }); - window.gitlist.diffEditors.push(editor) + $editableHover.hide(); }) } } diff --git a/public/js/global.js b/public/js/global.js index 00251934..5918fc63 100755 --- a/public/js/global.js +++ b/public/js/global.js @@ -5,15 +5,17 @@ const Cookies = require('js-cookie') const scrollIntoViewOptions = { behavior: "instant", - block: "start", - inline: "start" +// block: "start", +// inline: "start" } const navbarHeight = 80; const scrollIntoView = (el) => { el.scrollIntoView(scrollIntoViewOptions) + /* if ((window.innerHeight + window.scrollY) <= document.body.offsetHeight - navbarHeight ) { - window.scrollBy(0,-navbarHeight ) + window.scrollBy(0, -navbarHeight ) } + */ } window.gitlist.scrollIntoView = scrollIntoView; @@ -100,14 +102,12 @@ window.gitlist.setTheme = () => { if (gitlist.viewer !== undefined) { gitlist.viewer.setOption("theme", window.gitlist.codemirrorTheme.dark); } - gitlist.diffEditors.forEach(editor => editor.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", window.gitlist.codemirrorTheme.light); } - gitlist.diffEditors.forEach(editor => editor.setOption('theme', window.gitlist.codemirrorTheme.light ) ) } window.gitlist.networkRedraw(); window.gitlist.treegraph(); @@ -118,7 +118,6 @@ window.gitlist.setTheme = () => { }, 250) // } } - const pushHash = (hash) => { if(history.pushState) { const pushState = location.pathname + hash; @@ -129,16 +128,17 @@ const pushHash = (hash) => { } } - +window.gitlist.pushHash = pushHash; global.gitlist.scrollHash = function(element, event) { const url = new URL(element.href) const id = url.hash.substring(1) const elfind = document.getElementById(id + '-parent') - if (elfind === null) { + const elfind2 = document.getElementById(id) + if (elfind === null && elfind2 === null) { return true; } - scrollIntoView(elfind); + scrollIntoView(elfind || elfind2); if (event !== undefined) { event.preventDefault() diff --git a/public/js/theme-switcher.js b/public/js/theme-switcher.js index 0e2869ea..3c81895d 100644 --- a/public/js/theme-switcher.js +++ b/public/js/theme-switcher.js @@ -66,14 +66,6 @@ $(function () { return; } -// console.log('p3x-gitlist themer swtich') - - themesheet.attr('href', href); - gitlist.setTheme() - } - - clearTimeout(deferredSwitchTheme) - deferredSwitchTheme = setTimeout(() => { $('body').prepend(`
@@ -85,11 +77,17 @@ $(function () {
`) - clearTimeout(deferredSwitchTheme) - deferredSwitchTheme = setTimeout(() => { - generateNewTheme() - }, 250) - }, 250); + +// console.log('p3x-gitlist themer swtich') + + themesheet.attr('href', href); + gitlist.setTheme() + } + + clearTimeout(deferredSwitchTheme) + deferredSwitchTheme = setTimeout(() => { + generateNewTheme() + }, 250) }); }); diff --git a/public/js/themes.js b/public/js/themes.js index a6b79b8e..e6895b23 100755 --- a/public/js/themes.js +++ b/public/js/themes.js @@ -1,22 +1,22 @@ const themes = { - "bootstrap-default": "generated/css/bootstrap-default.70d464b5072e216915595192980aeb66414879b74b8abf06c30347c6ce498380.css", - "bootstrap-solar": "generated/css/bootstrap-solar.70d464b5072e216915595192980aeb66414879b74b8abf06c30347c6ce498380.css", - "bootstrap-cerulean": "generated/css/bootstrap-cerulean.70d464b5072e216915595192980aeb66414879b74b8abf06c30347c6ce498380.css", - "bootstrap-cosmo": "generated/css/bootstrap-cosmo.70d464b5072e216915595192980aeb66414879b74b8abf06c30347c6ce498380.css", - "bootstrap-cyborg": "generated/css/bootstrap-cyborg.70d464b5072e216915595192980aeb66414879b74b8abf06c30347c6ce498380.css", - "bootstrap-darkly": "generated/css/bootstrap-darkly.70d464b5072e216915595192980aeb66414879b74b8abf06c30347c6ce498380.css", - "bootstrap-flatly": "generated/css/bootstrap-flatly.70d464b5072e216915595192980aeb66414879b74b8abf06c30347c6ce498380.css", - "bootstrap-journal": "generated/css/bootstrap-journal.70d464b5072e216915595192980aeb66414879b74b8abf06c30347c6ce498380.css", - "bootstrap-lumen": "generated/css/bootstrap-lumen.70d464b5072e216915595192980aeb66414879b74b8abf06c30347c6ce498380.css", - "bootstrap-paper": "generated/css/bootstrap-paper.70d464b5072e216915595192980aeb66414879b74b8abf06c30347c6ce498380.css", - "bootstrap-readable": "generated/css/bootstrap-readable.70d464b5072e216915595192980aeb66414879b74b8abf06c30347c6ce498380.css", - "bootstrap-sandstone": "generated/css/bootstrap-sandstone.70d464b5072e216915595192980aeb66414879b74b8abf06c30347c6ce498380.css", - "bootstrap-simplex": "generated/css/bootstrap-simplex.70d464b5072e216915595192980aeb66414879b74b8abf06c30347c6ce498380.css", - "bootstrap-slate": "generated/css/bootstrap-slate.70d464b5072e216915595192980aeb66414879b74b8abf06c30347c6ce498380.css", - "bootstrap-spacelab": "generated/css/bootstrap-spacelab.70d464b5072e216915595192980aeb66414879b74b8abf06c30347c6ce498380.css", - "bootstrap-superhero": "generated/css/bootstrap-superhero.70d464b5072e216915595192980aeb66414879b74b8abf06c30347c6ce498380.css", - "bootstrap-united": "generated/css/bootstrap-united.70d464b5072e216915595192980aeb66414879b74b8abf06c30347c6ce498380.css", - "bootstrap-yeti": "generated/css/bootstrap-yeti.70d464b5072e216915595192980aeb66414879b74b8abf06c30347c6ce498380.css" + "bootstrap-default": "generated/css/bootstrap-default.0cb44d6d8514c81191a3e7056a7e51afcf11e0bde96495e59da4cb1dd343f1c8.css", + "bootstrap-solar": "generated/css/bootstrap-solar.0cb44d6d8514c81191a3e7056a7e51afcf11e0bde96495e59da4cb1dd343f1c8.css", + "bootstrap-cerulean": "generated/css/bootstrap-cerulean.0cb44d6d8514c81191a3e7056a7e51afcf11e0bde96495e59da4cb1dd343f1c8.css", + "bootstrap-cosmo": "generated/css/bootstrap-cosmo.0cb44d6d8514c81191a3e7056a7e51afcf11e0bde96495e59da4cb1dd343f1c8.css", + "bootstrap-cyborg": "generated/css/bootstrap-cyborg.0cb44d6d8514c81191a3e7056a7e51afcf11e0bde96495e59da4cb1dd343f1c8.css", + "bootstrap-darkly": "generated/css/bootstrap-darkly.0cb44d6d8514c81191a3e7056a7e51afcf11e0bde96495e59da4cb1dd343f1c8.css", + "bootstrap-flatly": "generated/css/bootstrap-flatly.0cb44d6d8514c81191a3e7056a7e51afcf11e0bde96495e59da4cb1dd343f1c8.css", + "bootstrap-journal": "generated/css/bootstrap-journal.0cb44d6d8514c81191a3e7056a7e51afcf11e0bde96495e59da4cb1dd343f1c8.css", + "bootstrap-lumen": "generated/css/bootstrap-lumen.0cb44d6d8514c81191a3e7056a7e51afcf11e0bde96495e59da4cb1dd343f1c8.css", + "bootstrap-paper": "generated/css/bootstrap-paper.0cb44d6d8514c81191a3e7056a7e51afcf11e0bde96495e59da4cb1dd343f1c8.css", + "bootstrap-readable": "generated/css/bootstrap-readable.0cb44d6d8514c81191a3e7056a7e51afcf11e0bde96495e59da4cb1dd343f1c8.css", + "bootstrap-sandstone": "generated/css/bootstrap-sandstone.0cb44d6d8514c81191a3e7056a7e51afcf11e0bde96495e59da4cb1dd343f1c8.css", + "bootstrap-simplex": "generated/css/bootstrap-simplex.0cb44d6d8514c81191a3e7056a7e51afcf11e0bde96495e59da4cb1dd343f1c8.css", + "bootstrap-slate": "generated/css/bootstrap-slate.0cb44d6d8514c81191a3e7056a7e51afcf11e0bde96495e59da4cb1dd343f1c8.css", + "bootstrap-spacelab": "generated/css/bootstrap-spacelab.0cb44d6d8514c81191a3e7056a7e51afcf11e0bde96495e59da4cb1dd343f1c8.css", + "bootstrap-superhero": "generated/css/bootstrap-superhero.0cb44d6d8514c81191a3e7056a7e51afcf11e0bde96495e59da4cb1dd343f1c8.css", + "bootstrap-united": "generated/css/bootstrap-united.0cb44d6d8514c81191a3e7056a7e51afcf11e0bde96495e59da4cb1dd343f1c8.css", + "bootstrap-yeti": "generated/css/bootstrap-yeti.0cb44d6d8514c81191a3e7056a7e51afcf11e0bde96495e59da4cb1dd343f1c8.css" }; module.exports = themes; diff --git a/public/less/commit.less b/public/less/commit.less new file mode 100644 index 00000000..a76b4883 --- /dev/null +++ b/public/less/commit.less @@ -0,0 +1,64 @@ +.p3x-gitlist-diff-container { + width: 100%; + display: block; + + a, a:hover { + text-decoration: none !important; + } + + .p3x-gitlist-diff { + + border: 1px solid @navbar-default-border; + max-width: 100%; + min-width: 100%; + overflow-x: auto; + pre { + background-color: @body-bg; + color: @text-color; + margin: 0; + padding: 0 0 0 6px; + border-radius: 0; + overflow: hidden; + border: 1px solid transparent; + font-family: monospace; + + &:hover { +// filter: brightness(0.9); + } + } + table { + } + table td { + padding: 0; + } + .new { + background-color: @alert-success-bg; + color: @alert-success-text; + } + .old { + background-color: @alert-danger-bg; + color: @alert-danger-text; + } + .chunk { + background-color: @alert-info-bg; + color: @alert-info-text; + } + .lineNo { +// background-color: @navbar-default-bg !important; +// color: @navbar-default-color !important; + padding: 0 6px; + text-align: right; + border-right: 1px solid @navbar-default-border !important; + font-family: monospace; + } + .lineNo a { + color: @navbar-default-color !important; + } + } + + .image-blob { + padding: 10px; + max-width: 100%; + } +} + diff --git a/public/less/default.less b/public/less/default.less index 7dbe192e..2288f136 100644 --- a/public/less/default.less +++ b/public/less/default.less @@ -43,17 +43,18 @@ } } +code, pre { + overflow-x: auto; + //white-space:pre-wrap; + font-family: monospace; +} + .p3x-gitlist-dark { #snackbar-container > div { border: 1px solid @navbar-default-border; } - code { - overflow-x: auto; - white-space:pre-wrap; - } - - code.p3x-gitlist-code { + code.p3x-gitlist-code, pre.p3x-gitlist-code { background-color: lighten(@navbar-inverse-bg, 5%); color: @navbar-inverse-color; border-color: @navbar-inverse-border; @@ -107,4 +108,6 @@ img.emoji { @import "browser"; @import "overlay"; @import "search"; -@import "codemirror"; \ No newline at end of file +@import "codemirror"; +@import "commit"; +@import "tree"; diff --git a/public/less/tree.less b/public/less/tree.less new file mode 100644 index 00000000..85e0054a --- /dev/null +++ b/public/less/tree.less @@ -0,0 +1,5 @@ +#p3x-gitlist-tree-table { + a { + text-decoration: none !important; + } +} \ No newline at end of file diff --git a/src/Controller/CommitController.php b/src/Controller/CommitController.php index c4745919..7e6cb866 100644 --- a/src/Controller/CommitController.php +++ b/src/Controller/CommitController.php @@ -44,7 +44,7 @@ public function connect(Application $app) $categorized[$date][] = $commit; } - $template = $app['request_stack']->getCurrentRequest()->isXmlHttpRequest() ? 'commits_list.twig' : 'commits.twig'; + $template = $app['request_stack']->getCurrentRequest()->isXmlHttpRequest() ? 'commits-list.twig' : 'commits.twig'; return $app['twig']->render($template, array( 'page' => 'commits', diff --git a/src/css-postfix b/src/css-postfix index 5b65edce..113c6416 100644 --- a/src/css-postfix +++ b/src/css-postfix @@ -1 +1 @@ -70d464b5072e216915595192980aeb66414879b74b8abf06c30347c6ce498380 \ No newline at end of file +0cb44d6d8514c81191a3e7056a7e51afcf11e0bde96495e59da4cb1dd343f1c8 \ No newline at end of file diff --git a/twig/commit.twig b/twig/commit.twig index f619b903..ad2fefeb 100644 --- a/twig/commit.twig +++ b/twig/commit.twig @@ -21,8 +21,9 @@ {% embed 'breadcrumb.twig' with {breadcrumbs: [{dir: "Commit #{commit.hash}", path:''}]} %} {% block right %} - Browse code - {% endblock %} + Browse code + {% endblock %} {% endembed %}
@@ -35,14 +36,16 @@

- {{ commit.message }} + {{ commit.message }} {% if commit.body is not empty %} {{ commit.body | nl2br }} {% endif %}

- {{ commit.author.name }} authored on {{ commit.date | format_date }} + {{ commit.author.name }} authored + on {{ commit.date | format_date }} {% if commit.author.email != commit.commiter.email %} - • {{ commit.commiter.name }} committed on {{ commit.commiterDate | format_date }} + • {{ commit.commiter.name }} committed on {{ commit.commiterDate | format_date }} {% endif %}
@@ -62,31 +65,69 @@ -