Skip to content

Commit

Permalink
p3x-robot sunday release 7/9/2018, 4:03:47 PM
Browse files Browse the repository at this point in the history
  • Loading branch information
p3x-robot committed Jul 9, 2018
1 parent a0761f4 commit 1008d64
Show file tree
Hide file tree
Showing 19 changed files with 164 additions and 100 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.9.8-888
[**P3X-GITLIST**](https://pages.corifeus.com/gitlist) Build v2.9.12-890

[![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
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@



# 🤖 P3X Gitlist v2.9.8-888
# 🤖 P3X Gitlist v2.9.12-890

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

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

---

[**P3X-GITLIST**](https://pages.corifeus.com/gitlist) Build v2.9.8-888
[**P3X-GITLIST**](https://pages.corifeus.com/gitlist) Build v2.9.12-890

[![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 artifacts/php-7.2-ubuntu.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ sudo apt upgrade -y

---

[**P3X-GITLIST**](https://pages.corifeus.com/gitlist) Build v2.9.8-888
[**P3X-GITLIST**](https://pages.corifeus.com/gitlist) Build v2.9.12-890

[![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 @@ -139,7 +139,7 @@ require('codemirror/mode/yaml/yaml');

---

[**P3X-GITLIST**](https://pages.corifeus.com/gitlist) Build v2.9.8-888
[**P3X-GITLIST**](https://pages.corifeus.com/gitlist) Build v2.9.12-890

[![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
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "p3x-gitlist",
"version": "2.9.9-889",
"version": "2.9.13-892",
"corifeus": {
"prod-dir": "prod",
"postfix": "2607a7cb45c1136298a2a2ccb0a3d49ec147c7dab987b6dd4ec124a716e92c92",
"postfix": "435184d6305e289329e6552e2041505e35b22c41535a8d79f41f4e2af0568de2",
"prefix": "p3x-",
"publish": false,
"type": "p3x",
Expand Down
7 changes: 7 additions & 0 deletions src/GitList/Controller/TreeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,12 @@ public function connect(Application $app)
$breadcrumbs = array(array('dir' => 'Search results for: ' . $query, 'path' => ''));
$results = $repository->searchTree($query, $branch);

for($i = 0; $i < count($results); $i++) {
$result = $results[$i];
$results[$i]['type'] = $app['util.repository']->getFileType($result['file']);
}


return $app['twig']->render('search.twig', array(
'results' => $results,
'repo' => $repo,
Expand All @@ -72,6 +78,7 @@ public function connect(Application $app)
'tags' => $repository->getTags(),
'query' => $query
));

})->assert('repo', $app['util.routing']->getRepositoryRegex())
->assert('branch', $app['util.routing']->getBranchRegex())
->convert('branch', 'escaper.argument:escape')
Expand Down
2 changes: 1 addition & 1 deletion src/browser/bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ require('./js/file')
require('./js/theme-switcher.js')
require('./js/commit')
require('./js/commits-list')
require('./js/blame')
require('./js/file-fragment')
require('./js/global')


55 changes: 3 additions & 52 deletions src/browser/js/blame.js
Original file line number Diff line number Diff line change
@@ -1,52 +1,3 @@
$(() => {
const $blamePanel = $('.p3x-gitlist-blame-panel')
if ($blamePanel.length > 0) {

let $buttonToggleCodeMirrorCurrent;
let $textareaCurrent;
let $textCurrent

for(let blame of $blamePanel) {
const index = blame.dataset.index
const $buttonToggleCodeMirror = $(`#p3x-gitlilst-blame-heading-button-codemirror-${ index }`)
const $text = $(`#p3x-gitlist-blame-text-${ index }`)
const $textarea = $(`#p3x-gitlist-blame-codemirror-${ index }`)

$buttonToggleCodeMirror.on('click', function(event) {
if ($buttonToggleCodeMirrorCurrent !== undefined) {
$('.CodeMirror-wrap').remove()
const wasActive = $buttonToggleCodeMirror.hasClass('active')
window.gitlist.blameCodeMirror = undefined
$buttonToggleCodeMirrorCurrent.removeClass('active')
$textCurrent.removeClass('hidden')
$textareaCurrent.addClass('hidden')
if (wasActive) {
return;
}
}

$buttonToggleCodeMirrorCurrent = $buttonToggleCodeMirror
$textCurrent = $text;
$textareaCurrent = $textarea;
$text.addClass('hidden');
$textarea.removeClass('hidden')
$buttonToggleCodeMirror.addClass('active')

const cm = CodeMirror.fromTextArea($textarea.get(0), {
styleActiveLine: true,
styleSelectedText: true,
value: blame.value,
lineNumbers: true,
matchBrackets: true,
lineWrapping: true,
readOnly: true,
height: 'auto',
mode: blame.dataset.mode,
theme: window.gitlist.getActualThemeCodemirror(),
});
window.gitlist.blameCodeMirror = cm
})
}

}
})
/*
It uses the file-fragement
*/
61 changes: 61 additions & 0 deletions src/browser/js/file-fragment.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
$(() => {
const $fragmentFilePanel = $('.p3x-gitlist-file-fragment-panel')
if ($fragmentFilePanel.length > 0) {

let $buttonToggleCodeMirrorCurrent;
let $textareaCurrent;
let $textCurrent

for(let fragmentFile of $fragmentFilePanel) {
const index = fragmentFile.dataset.index
const $buttonToggleCodeMirror = $(`#p3x-gitlilst-file-fragment-heading-button-codemirror-${ index }`)
const $text = $(`#p3x-gitlist-file-fragment-text-${ index }`)
const $textarea = $(`#p3x-gitlist-file-fragment-codemirror-${ index }`)

const $buttonEditor = $(`#p3x-gitlilst-file-fragment-heading-button-edit-${ index}`)
if ($buttonEditor.length > 0) {
$buttonEditor.on('click', function(event) {
const url = $buttonEditor.get(0).dataset.url
location = url;
})

}

$buttonToggleCodeMirror.on('click', function(event) {
if ($buttonToggleCodeMirrorCurrent !== undefined) {
$('.CodeMirror-wrap').remove()
const wasActive = $buttonToggleCodeMirror.hasClass('active')
window.gitlist.fragmentFileCodeMirror = undefined
$buttonToggleCodeMirrorCurrent.removeClass('active')
$textCurrent.removeClass('hidden')
$textareaCurrent.addClass('hidden')
if (wasActive) {
return;
}
}

$buttonToggleCodeMirrorCurrent = $buttonToggleCodeMirror
$textCurrent = $text;
$textareaCurrent = $textarea;
$text.addClass('hidden');
$textarea.removeClass('hidden')
$buttonToggleCodeMirror.addClass('active')

const cm = CodeMirror.fromTextArea($textarea.get(0), {
styleActiveLine: true,
styleSelectedText: true,
value: fragmentFile.value,
lineNumbers: true,
matchBrackets: true,
lineWrapping: true,
readOnly: true,
height: 'auto',
mode: fragmentFile.dataset.mode,
theme: window.gitlist.getActualThemeCodemirror(),
});
window.gitlist.fragmentFileCodeMirror = cm
})
}

}
})
10 changes: 10 additions & 0 deletions src/browser/js/file.js
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,16 @@ ${branchInfo}
if (line !== undefined) {
setTimeout(() => {
cm.scrollIntoView({line: line, char:0}, isReallyFull ? window.innerHeight / 2 : 100)
/*
const codes = $('.CodeMirror-linenumber')
for(let codeLinenumber of codes) {
const $codeLinenumber = $(codeLinenumber)
const findLine = $codeLinenumber.text();
if(findLine === line ) {
break;
}
}
*/
}, 250)
}
}
Expand Down
8 changes: 4 additions & 4 deletions src/browser/js/global.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,9 @@ window.gitlist.setTheme = () => {
currentTheme = theme;

/*
const themeBlameCodeMirror = (options) => {
const themeFragmentFileCodeMirror = (options) => {
const { theme } = options
for(let cm of window.gitlist.blameCodeMirror) {
for(let cm of window.gitlist.fragmentFileCodeMirror) {
cm.setOption("theme", theme);
}
}
Expand All @@ -140,8 +140,8 @@ window.gitlist.setTheme = () => {
if (gitlist.viewer !== undefined) {
gitlist.viewer.setOption("theme", codeMirrorTheme);
}
if (gitlist.blameCodeMirror !== undefined) {
gitlist.blameCodeMirror.setOption("theme", codeMirrorTheme);
if (gitlist.fragmentFileCodeMirror !== undefined) {
gitlist.fragmentFileCodeMirror.setOption("theme", codeMirrorTheme);
}


Expand Down
36 changes: 18 additions & 18 deletions src/browser/js/themes.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@

const themes = {
"bootstrap-default": "prod/css/bootstrap-default.2607a7cb45c1136298a2a2ccb0a3d49ec147c7dab987b6dd4ec124a716e92c92.css",
"bootstrap-solar": "prod/css/bootstrap-solar.2607a7cb45c1136298a2a2ccb0a3d49ec147c7dab987b6dd4ec124a716e92c92.css",
"bootstrap-cerulean": "prod/css/bootstrap-cerulean.2607a7cb45c1136298a2a2ccb0a3d49ec147c7dab987b6dd4ec124a716e92c92.css",
"bootstrap-cosmo": "prod/css/bootstrap-cosmo.2607a7cb45c1136298a2a2ccb0a3d49ec147c7dab987b6dd4ec124a716e92c92.css",
"bootstrap-cyborg": "prod/css/bootstrap-cyborg.2607a7cb45c1136298a2a2ccb0a3d49ec147c7dab987b6dd4ec124a716e92c92.css",
"bootstrap-darkly": "prod/css/bootstrap-darkly.2607a7cb45c1136298a2a2ccb0a3d49ec147c7dab987b6dd4ec124a716e92c92.css",
"bootstrap-flatly": "prod/css/bootstrap-flatly.2607a7cb45c1136298a2a2ccb0a3d49ec147c7dab987b6dd4ec124a716e92c92.css",
"bootstrap-journal": "prod/css/bootstrap-journal.2607a7cb45c1136298a2a2ccb0a3d49ec147c7dab987b6dd4ec124a716e92c92.css",
"bootstrap-lumen": "prod/css/bootstrap-lumen.2607a7cb45c1136298a2a2ccb0a3d49ec147c7dab987b6dd4ec124a716e92c92.css",
"bootstrap-paper": "prod/css/bootstrap-paper.2607a7cb45c1136298a2a2ccb0a3d49ec147c7dab987b6dd4ec124a716e92c92.css",
"bootstrap-readable": "prod/css/bootstrap-readable.2607a7cb45c1136298a2a2ccb0a3d49ec147c7dab987b6dd4ec124a716e92c92.css",
"bootstrap-sandstone": "prod/css/bootstrap-sandstone.2607a7cb45c1136298a2a2ccb0a3d49ec147c7dab987b6dd4ec124a716e92c92.css",
"bootstrap-simplex": "prod/css/bootstrap-simplex.2607a7cb45c1136298a2a2ccb0a3d49ec147c7dab987b6dd4ec124a716e92c92.css",
"bootstrap-slate": "prod/css/bootstrap-slate.2607a7cb45c1136298a2a2ccb0a3d49ec147c7dab987b6dd4ec124a716e92c92.css",
"bootstrap-spacelab": "prod/css/bootstrap-spacelab.2607a7cb45c1136298a2a2ccb0a3d49ec147c7dab987b6dd4ec124a716e92c92.css",
"bootstrap-superhero": "prod/css/bootstrap-superhero.2607a7cb45c1136298a2a2ccb0a3d49ec147c7dab987b6dd4ec124a716e92c92.css",
"bootstrap-united": "prod/css/bootstrap-united.2607a7cb45c1136298a2a2ccb0a3d49ec147c7dab987b6dd4ec124a716e92c92.css",
"bootstrap-yeti": "prod/css/bootstrap-yeti.2607a7cb45c1136298a2a2ccb0a3d49ec147c7dab987b6dd4ec124a716e92c92.css"
"bootstrap-default": "prod/css/bootstrap-default.435184d6305e289329e6552e2041505e35b22c41535a8d79f41f4e2af0568de2.css",
"bootstrap-solar": "prod/css/bootstrap-solar.435184d6305e289329e6552e2041505e35b22c41535a8d79f41f4e2af0568de2.css",
"bootstrap-cerulean": "prod/css/bootstrap-cerulean.435184d6305e289329e6552e2041505e35b22c41535a8d79f41f4e2af0568de2.css",
"bootstrap-cosmo": "prod/css/bootstrap-cosmo.435184d6305e289329e6552e2041505e35b22c41535a8d79f41f4e2af0568de2.css",
"bootstrap-cyborg": "prod/css/bootstrap-cyborg.435184d6305e289329e6552e2041505e35b22c41535a8d79f41f4e2af0568de2.css",
"bootstrap-darkly": "prod/css/bootstrap-darkly.435184d6305e289329e6552e2041505e35b22c41535a8d79f41f4e2af0568de2.css",
"bootstrap-flatly": "prod/css/bootstrap-flatly.435184d6305e289329e6552e2041505e35b22c41535a8d79f41f4e2af0568de2.css",
"bootstrap-journal": "prod/css/bootstrap-journal.435184d6305e289329e6552e2041505e35b22c41535a8d79f41f4e2af0568de2.css",
"bootstrap-lumen": "prod/css/bootstrap-lumen.435184d6305e289329e6552e2041505e35b22c41535a8d79f41f4e2af0568de2.css",
"bootstrap-paper": "prod/css/bootstrap-paper.435184d6305e289329e6552e2041505e35b22c41535a8d79f41f4e2af0568de2.css",
"bootstrap-readable": "prod/css/bootstrap-readable.435184d6305e289329e6552e2041505e35b22c41535a8d79f41f4e2af0568de2.css",
"bootstrap-sandstone": "prod/css/bootstrap-sandstone.435184d6305e289329e6552e2041505e35b22c41535a8d79f41f4e2af0568de2.css",
"bootstrap-simplex": "prod/css/bootstrap-simplex.435184d6305e289329e6552e2041505e35b22c41535a8d79f41f4e2af0568de2.css",
"bootstrap-slate": "prod/css/bootstrap-slate.435184d6305e289329e6552e2041505e35b22c41535a8d79f41f4e2af0568de2.css",
"bootstrap-spacelab": "prod/css/bootstrap-spacelab.435184d6305e289329e6552e2041505e35b22c41535a8d79f41f4e2af0568de2.css",
"bootstrap-superhero": "prod/css/bootstrap-superhero.435184d6305e289329e6552e2041505e35b22c41535a8d79f41f4e2af0568de2.css",
"bootstrap-united": "prod/css/bootstrap-united.435184d6305e289329e6552e2041505e35b22c41535a8d79f41f4e2af0568de2.css",
"bootstrap-yeti": "prod/css/bootstrap-yeti.435184d6305e289329e6552e2041505e35b22c41535a8d79f41f4e2af0568de2.css"
};
module.exports = themes;
2 changes: 1 addition & 1 deletion src/browser/layout.tpl.twig
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<title>{% block title %}Welcome!{% endblock %}</title>
<link rel="shortcut icon" type="image/png" href="img/favicon.png"/>
<link rel="stylesheet" type="text/css" href="{{ prod_dir }}/css/{{ theme }}.{{ theme_postfix }}.css" id="bootstrap-theme">
<script type="text/javascript">window.gitlist = { lastload: undefined, lastloadSpan: undefined, dark: {{ theme_dark |json_encode|raw }}, isDark: undefined, viewer: undefined, setTheme: undefined, getThemeCookie: undefined, basepath: '{{ app.url_subdir }}', branch: '{{ branch }}', repo: '{{ repo }}', dateFormat: '{{ gitlist_date_format }}', themes: {}, codemirror_full_limit: undefined, browse_type: undefined, search_query: '{{ search_query }}', browserClick: undefined, networkRedraw: undefined, treegraph: undefined, canvasLaneColors: undefined, canvasDotColors: undefined, randomCanvasLaneColors: undefined, loadTheme: '{{ theme }}', codemirrorTheme : {}, scrollIntoView: undefined, markdownRenderer: undefined, editorMaxHeight: 300, blameCodeMirror: undefined}</script>
<script type="text/javascript">window.gitlist = { lastload: undefined, lastloadSpan: undefined, dark: {{ theme_dark |json_encode|raw }}, isDark: undefined, viewer: undefined, setTheme: undefined, getThemeCookie: undefined, basepath: '{{ app.url_subdir }}', branch: '{{ branch }}', repo: '{{ repo }}', dateFormat: '{{ gitlist_date_format }}', themes: {}, codemirror_full_limit: undefined, browse_type: undefined, search_query: '{{ search_query }}', browserClick: undefined, networkRedraw: undefined, treegraph: undefined, canvasLaneColors: undefined, canvasDotColors: undefined, randomCanvasLaneColors: undefined, loadTheme: '{{ theme }}', codemirrorTheme : {}, scrollIntoView: undefined, markdownRenderer: undefined, editorMaxHeight: 300, fragmentFileCodeMirror: undefined}</script>
</head>
<body class="{{ theme_type }}" id="p3x-gitlist-body">

Expand Down
3 changes: 3 additions & 0 deletions src/browser/less/blame-and-search.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/*
they are using the file-fragment.less file
*/
2 changes: 1 addition & 1 deletion src/browser/less/default.less
Original file line number Diff line number Diff line change
Expand Up @@ -114,4 +114,4 @@ img.emoji {
@import "commit";
@import "tree";
@import "navigation";
@import "blame";
@import "file-fragment";
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
.p3x-gitlilst-blame-heading-right {
.p3x-gitlilst-file-fragment-heading-right {

float: right;

}

.p3x-gitlist-blame-panel {
.p3x-gitlist-file-fragment-panel {
.panel-body {
padding: 0 !important;
.p3x-gitlist-blame-text {
.p3x-gitlist-file-fragment-text {
padding: @panel-body-padding !important;
}
.CodeMirror-wrap {
Expand All @@ -17,7 +17,7 @@
}
}

.p3x-gitlist-blame-text {
.p3x-gitlist-file-fragment-text {
overflow-x: auto;
white-space: pre;
margin: 0;
Expand Down
12 changes: 6 additions & 6 deletions src/twig/blame.twig
Original file line number Diff line number Diff line change
Expand Up @@ -33,25 +33,25 @@

{% for blame in blames %}

<div class="panel panel-default p3x-gitlist-blame-panel" data-index="{{ loop.index0 }}" data-mode="{{ type }}">
<div class="panel panel-default p3x-gitlist-file-fragment-panel" data-index="{{ loop.index0 }}" data-mode="{{ type }}">
<div class="panel-heading">
<table style="width: 100%; background-color: transparent;" id="p3x-gitlilst-blame-heading-table-{{ loop.index0 }}">
<table style="width: 100%; background-color: transparent;" id="p3x-gitlilst-file-fragment-heading-table-{{ loop.index0 }}">
<tr>
<td>
<span class="far fa-file-alt"></span>&nbsp;&nbsp; <a href="{{ path('commit', {repo: repo, commit: blame.commit}) }}">{{ blame.commitShort }}</a>
</td>
<td style="text-align: right;">
<button class="btn btn-sm btn-primary" id="p3x-gitlilst-blame-heading-button-codemirror-{{ loop.index0 }}">
Display in code mirror
<button class="btn btn-sm btn-primary" id="p3x-gitlilst-file-fragment-heading-button-codemirror-{{ loop.index0 }}">
<i class="fas fa-eye"></i>&nbsp;&nbsp;Code Mirror
</button>
</td>
</tr>
</table>

</div>
<div class="panel-body">
<div class="p3x-gitlist-blame-text" id="p3x-gitlist-blame-text-{{ loop.index0 }}">{{ blame.line }}</div>
<textarea class="hidden" id="p3x-gitlist-blame-codemirror-{{ loop.index0 }}">{{ blame.line }}</textarea>
<div class="p3x-gitlist-file-fragment-text" id="p3x-gitlist-file-fragment-text-{{ loop.index0 }}">{{ blame.line }}</div>
<textarea class="hidden" id="p3x-gitlist-file-fragment-codemirror-{{ loop.index0 }}">{{ blame.line }}</textarea>
</div>

</div>
Expand Down
Loading

0 comments on commit 1008d64

Please sign in to comment.