Skip to content
This repository has been archived by the owner on Jun 13, 2020. It is now read-only.

Add scrollbars to catalog #272

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions inc/instance-config.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@
//$config['default_stylesheet'] = array('Notsuba', 'notsuba.css');
$config['additional_javascript'][] = 'js/jquery.min.js';
$config['additional_javascript'][] = 'js/jquery.mixitup.min.js';
$config['additional_javascript'][] = 'js/perfect-scrollbar.min.js';
$config['additional_javascript'][] = 'js/catalog.js';
$config['additional_javascript'][] = 'js/captcha.js';
$config['additional_javascript'][] = 'js/jquery.tablesorter.min.js';
Expand Down
5 changes: 4 additions & 1 deletion js/catalog.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ if (active_page == 'catalog') $(function(){
$('#Grid').mixItUp('sort', value);
catalog.sort_by = value;
localStorage.catalog = JSON.stringify(catalog);
$('.threads .thread .replies').perfectScrollbar('update');
});

$("#image_size").change(function(){
Expand All @@ -22,6 +23,7 @@ if (active_page == 'catalog') $(function(){
$(".grid-li").addClass("grid-size-"+value);
catalog.image_size = value;
localStorage.catalog = JSON.stringify(catalog);
$('.threads .thread .replies').perfectScrollbar('update');
});

$('#Grid').mixItUp({
Expand All @@ -36,5 +38,6 @@ if (active_page == 'catalog') $(function(){
if (catalog.image_size !== undefined) {
$('#image_size').val(catalog.image_size).trigger('change');
}


$('.threads .thread .replies').perfectScrollbar()
});
4 changes: 4 additions & 0 deletions js/perfect-scrollbar.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

101 changes: 101 additions & 0 deletions stylesheets/perfect-scrollbar.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
.ps-container.ps-active-x > .ps-scrollbar-x-rail, .ps-container.ps-active-y > .ps-scrollbar-y-rail {
display: block; }
.ps-container > .ps-scrollbar-x-rail {
display: none;
position: absolute;
/* please don't change 'position' */
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
-ms-border-radius: 4px;
border-radius: 4px;
opacity: 0.5;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
filter: alpha(opacity=0);
-webkit-transition: background-color 0.2s linear, opacity 0.2s linear;
-moz-transition: background-color 0.2s linear, opacity 0.2s linear;
-o-transition: background-color 0.2s linear, opacity 0.2s linear;
transition: background-color 0.2s linear, opacity 0.2s linear;
bottom: 3px;
/* there must be 'bottom' for ps-scrollbar-x-rail */
height: 8px; }
.ps-container > .ps-scrollbar-x-rail > .ps-scrollbar-x {
position: absolute;
/* please don't change 'position' */
background-color: #aaa;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
-ms-border-radius: 4px;
border-radius: 4px;
-webkit-transition: background-color 0.2s linear;
-moz-transition: background-color 0.2s linear;
-o-transition: background-color 0.2s linear;
transition: background-color 0.2s linear;
bottom: 0;
/* there must be 'bottom' for ps-scrollbar-x */
height: 8px; }
.ps-container > .ps-scrollbar-x-rail.in-scrolling {
background-color: #eee;
opacity: 0.9;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=90)";
filter: alpha(opacity=90); }
.ps-container > .ps-scrollbar-y-rail {
display: none;
position: absolute;
/* please don't change 'position' */
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
-ms-border-radius: 4px;
border-radius: 4px;
opacity: 0.5;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
filter: alpha(opacity=0);
-webkit-transition: background-color 0.2s linear, opacity 0.2s linear;
-moz-transition: background-color 0.2s linear, opacity 0.2s linear;
-o-transition: background-color 0.2s linear, opacity 0.2s linear;
transition: background-color 0.2s linear, opacity 0.2s linear;
right: 3px;
/* there must be 'right' for ps-scrollbar-y-rail */
width: 8px; }
.ps-container > .ps-scrollbar-y-rail > .ps-scrollbar-y {
position: absolute;
/* please don't change 'position' */
background-color: #aaa;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
-ms-border-radius: 4px;
border-radius: 4px;
-webkit-transition: background-color 0.2s linear;
-moz-transition: background-color 0.2s linear;
-o-transition: background-color 0.2s linear;
transition: background-color 0.2s linear;
right: 0;
/* there must be 'right' for ps-scrollbar-y */
width: 8px; }
.ps-container > .ps-scrollbar-y-rail.in-scrolling {
background-color: #eee;
opacity: 0.9;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=90)";
filter: alpha(opacity=90); }
.ps-container:hover > .ps-scrollbar-x-rail, .ps-container:hover > .ps-scrollbar-y-rail {
opacity: 0.9;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=60)";
filter: alpha(opacity=60); }
.ps-container:hover > .ps-scrollbar-x-rail.in-scrolling, .ps-container:hover > .ps-scrollbar-y-rail.in-scrolling {
background-color: #eee;
opacity: 0.9;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=90)";
filter: alpha(opacity=90); }
.ps-container:hover > .ps-scrollbar-x-rail:hover {
background-color: #eee;
opacity: 0.9;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=90)";
filter: alpha(opacity=90); }
.ps-container:hover > .ps-scrollbar-x-rail:hover > .ps-scrollbar-x {
background-color: #999; }
.ps-container:hover > .ps-scrollbar-y-rail:hover {
background-color: #eee;
opacity: 0.9;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=90)";
filter: alpha(opacity=90); }
.ps-container:hover > .ps-scrollbar-y-rail:hover > .ps-scrollbar-y {
background-color: #999; }
8 changes: 8 additions & 0 deletions stylesheets/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -689,6 +689,14 @@ pre {
display: block;
}

.theme-catalog div.thread div.replies {
height: 62%;
width: 100%;
overflow: hidden;
position: absolute;
word-break: break-word;
}

.theme-catalog div.threads {
text-align: center;
margin-left: -20px;
Expand Down
1 change: 1 addition & 0 deletions templates/themes/catalog/catalog.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
active_page = "catalog";
</script>
{% include 'header.html' %}
<link rel="stylesheet" type="text/css" href="/stylesheets/perfect-scrollbar.css" />
<title>{{ board }} - Catalog</title>
</head>
<body class="theme-catalog">
Expand Down
2 changes: 1 addition & 1 deletion templates/themes/catalog/theme.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public function build($settings, $board_name) {
$recent_posts[] = $post;
}

$required_scripts = array('js/jquery.min.js', 'js/jquery.mixitup.min.js', 'js/catalog.js');
$required_scripts = array('js/jquery.min.js', 'js/jquery.mixitup.min.js', 'js/perfect-scrollbar.min.js', 'js/catalog.js');

foreach($required_scripts as $i => $s) {
if (!in_array($s, $config['additional_javascript']))
Expand Down