Merge pull request 'HTML + some js fixes' (#192) from js-fixes into config

Reviewed-on: https://git.leftypol.org/leftypol/leftypol/pulls/192
This commit is contained in:
Zankaria 2024-08-29 16:45:22 +00:00
commit 2bd4cdc5e6
13 changed files with 137 additions and 120 deletions

View file

@ -13,37 +13,38 @@
*
*/
$(document).ready(function(){
if($('span.omitted').length == 0)
return; // nothing to expand
$(document).ready(function() {
if ($('span.omitted').length === 0) {
// Nothing to expand.
return;
}
var do_expand = function() {
let doExpand = function() {
$(this)
.html($(this).text().replace(_("Click reply to view."), '<a href="javascript:void(0)">'+_("Click to expand")+'</a>.'))
.find('a').click(window.expand_fun = function() {
var thread = $(this).parents('[id^="thread_"]');
var id = thread.attr('id').replace(/^thread_/, '');
.html($(this).text().concat(' <a href="javascript:void(0)">' + _("Click to expand") + '</a>.'))
.find('a').click(window.expandFun = function() {
let thread = $(this).parents('[id^="thread_"]');
$.ajax({
url: thread.find('p.intro a.post_no:first').attr('href'),
context: document.body,
success: function(data) {
var last_expanded = false;
let lastExpanded = false;
$(data).find('div.post.reply').each(function() {
thread.find('div.hidden').remove();
var post_in_doc = thread.find('#' + $(this).attr('id'));
if(post_in_doc.length == 0) {
if(last_expanded) {
$(this).addClass('expanded').insertAfter(last_expanded).before('<br class="expanded">');
let postInDoc = thread.find('#' + $(this).attr('id'));
if (postInDoc.length === 0) {
if (lastExpanded) {
$(this).addClass('expanded').insertAfter(lastExpanded).before('<br class="expanded">');
} else {
$(this).addClass('expanded').insertAfter(thread.find('div.post:first')).after('<br class="expanded">');
}
last_expanded = $(this);
lastExpanded = $(this);
$(document).trigger('new_post', this);
} else {
last_expanded = post_in_doc;
lastExpanded = postInDoc;
}
});
thread.find("span.omitted").css('display', 'none');
@ -51,19 +52,20 @@ $(document).ready(function(){
.insertAfter(thread.find('.op div.body, .op span.omitted').last())
.click(function() {
thread.find('.expanded').remove();
$(this).parent().find(".omitted:not(.hide-expanded)").css('display', '');
$(this).parent().find(".hide-expanded").remove();
let parent = $(this).parent();
parent.find(".omitted:not(.hide-expanded)").css('display', '');
parent.find(".hide-expanded").remove();
});
}
});
});
}
$('div.post.op span.omitted').each(do_expand);
$('div.post.op span.omitted').each(doExpand);
$(document).on("new_post", function(e, post) {
if (!$(post).hasClass("reply")) {
$(post).find('div.post.op span.omitted').each(do_expand);
$(post).find('div.post.op span.omitted').each(doExpand);
}
});
});

View file

@ -1,16 +1,16 @@
/*
/*
* live-index.js
* https://github.com/vichan-devel/Tinyboard/blob/master/js/live-index.js
*
*
* Released under the MIT license
* Copyright (c) 2014 Marcin Łabanowski <marcin@6irc.net>
*
*
* Usage:
* $config['api']['enabled'] = true;
* $config['additional_javascript'][] = 'js/jquery.min.js';
* $config['additional_javascript'][] = 'js/expand.js';
* $config['additional_javascript'][] = 'js/live-index.js';
*
*
*/
if (active_page == 'index' && (""+document.location).match(/\/(index\.html)?(\?|$|#)/))
@ -85,7 +85,7 @@ if (active_page == 'index' && (""+document.location).match(/\/(index\.html)?(\?|
if ($(th).find(".new-posts").html() != msg) {
$(th).find(".new-posts").html(msg);
$(th).find(".new-posts a").click(window.expand_fun);
$(th).find(".new-posts a").click(window.expandFun);
}
};

View file

@ -29,9 +29,9 @@ $(document).ready(function() {
if(post.length == 0)
return;
let mentioned = post.find('.head span.mentioned');
let mentioned = post.find('.head div.mentioned');
if (mentioned.length === 0) {
mentioned = $('<span class="mentioned unimportant"></span>').prependTo(post.find('.head'));
mentioned = $('<div class="mentioned unimportant"></div>').prependTo(post.find('.head'));
}
if (mentioned.find('a.mentioned-' + replyId).length !== 0) {

View file

@ -18,7 +18,7 @@ form table tr td {
display: table;
position: fixed;
width: 100%;
left: 0px;
left: 0px;
z-index: 3;
background-color: #35363b;
border-color: #39d958;
@ -175,7 +175,7 @@ background-color: #2b2b2b;
form table {
max-width: 500px;
min-width: 100%
display: inline-block;
margin: 5px auto;
background-color: #2b2b2b;
@ -293,7 +293,7 @@ background-color: #1A1A1A;
border-bottom: double 3px #989898 !important;
position:fixed;
}
/*favorites in a new line*/
div.boardlist span.favorite-boards {
display: ;
@ -386,7 +386,7 @@ max-width: 50%;
}
span.subject:after { content: '\A'; white-space:pre; }
SPAN.controls.op:before { content: '\A'; white-space:pre; }
div.controls.op:before { content: '\A'; white-space:pre; }
a:visited {color: #97094b}
@ -411,7 +411,7 @@ max-width: 50%;
}
span.subject:after { content: '\A'; white-space:pre; }
SPAN.controls.op:before { content: '\A'; white-space:pre; }
div.controls.op:before { content: '\A'; white-space:pre; }
a:visited {color: #97094b}

View file

@ -235,17 +235,17 @@ br.clear {
clear: left;
display: block;
}
span.controls {
div.controls {
float: right;
margin: 0;
padding: 0;
font-size: 80%;
}
span.controls.op {
div.controls.op {
float: none;
margin-left: 10px;
}
span.controls a {
div.controls a {
margin: 0;
}
div#wrap {
@ -465,7 +465,7 @@ background: #333333;
border: 1px solid #666666;
color: #999999;
}
input[type="submit"]:hover
input[type="submit"]:hover
{
color: #9999CC;
}

View file

@ -1,4 +1,4 @@
/*
/*
Thank you very much the wonderful CSS lainchan.jp Developers , whose CSS theme was the orginal inspiration for this file
. It is was removed from CSS theme list at their request, and is included here as a derivative work licensed under fair use,
with at least 40% of the file being different so that lainons can use it as user CSS if they like.
@ -346,18 +346,18 @@ br.clear {
clear: left;
display: block;
}
span.controls {
div.controls {
float: right !important;
clear: none !important;
margin: 0;
padding: 0;
font-size: 80%;
}
span.controls.op {
div.controls.op {
float: none;
margin-left: 10px;
}
span.controls a {
div.controls a {
margin: 0;
}
div#wrap {

View file

@ -238,17 +238,17 @@ br.clear {
clear: left;
display: block;
}
span.controls {
div.controls {
float: right;
margin: 0;
padding: 0;
font-size: 80%;
}
span.controls.op {
div.controls.op {
float: none;
margin-left: 10px;
}
span.controls a {
div.controls a {
margin: 0;
}
div#wrap {

View file

@ -1,38 +1,38 @@
/*monoelains ez css for VIP quality imageboards. steal this .css and edit it to your liking. */
/* OPTION HIDING */
/*lainchan bottom bar fix*/
.bar{
background-color: #CDCDCD!important;
}
/*removes footer (STI pls dont sue)
footer {
display:none;
color: #ffffff;
}
/* hides AA in catalog */
.theme-catalog span.aa {
display: none !important;
}
/* hides expand all images */
#expand-all-images {
display: none;
}
/* hides hints*/
.hint {
}
/* hides horizontal bar */
hr {
display: none;
}
/*banner stuff*/
img.banner, img.board_image {
border: 8px ridge #B18108;
@ -42,23 +42,23 @@
box-shadow: 7px 7px rgba(0, 0, 0, 0.5);
margin: 30px auto 0px;
}
/* hides delete options (obsolete) */
div.delete {
display: none;
}
/*makes files align vertically (hw pls fix this shit)*/
.file {
display: block;
margin-right: 11px;
}
}
div.boardlist a {
color: rgb(187, 51, 0);
}
/*expanded image border/shadow*/
.full-image {
border-top-right-radius: 0;
@ -81,7 +81,7 @@
float: none;
background-color: rgb(194, 194, 194);
}
/*gives quick reply its border/shadow*/
#quick-reply table {
background: none repeat scroll 0 0 #CBCBCB;
@ -93,14 +93,14 @@
box-shadow: 7px 7px rgba(0, 0, 0, 0.5);
width: auto !important;
}
/*makes posting form maroon*/
form table tr th {
background-color: rgb(187, 51, 0);
color: #FFFFFF;
font-family: Palatino Linotype, Book Antiqua, Palatino, serif;
}
/*gives images border/shadow*/
div.files img.post-image {
-webkit-box-shadow: 7px 7px 0px 0px #000;
@ -117,7 +117,7 @@
border-radius: 0;
margin-bottom: 5px;
}
/* makes Youtube thumbs not obscenely big */
div.video-container {
width: auto !important;
@ -125,7 +125,7 @@
max-height: 20% !important;
max-width: 20% !important;
}
/* Image thumbs size limit (make as big as you want)*/
.post-image {
border: double black;
@ -137,7 +137,7 @@
padding: 5px;
background-color: #cdcdcd;
}
/* Keep small thumbnails in replies */
.post.reply a:not([data-expanded="true"]) .post-image {
width: auto !important;
@ -145,13 +145,13 @@ background-color: #cdcdcd;
max-height: 60%;
max-width: 60%;
}
/* reply box size */
.input[type="text"], textarea {
min-height: 117px;
min-width: 240px;
}
/*boardwide font stuff goes here also background image*/
body {
padding: 0;
@ -168,7 +168,7 @@ margin-left: 10px;
header {
margin-bottom: 0px;
}
/*gives posting table its border/shadow*/
form table {
width: 100%;
@ -182,7 +182,7 @@ margin-left: 10px;
-webkit-box-shadow: 10px 10px 10px rgba(0, 0, 0, 0.5);
box-shadow: 7px 5px rgba(0, 0, 0, 0.5);
}
/*gives threads its border/shadow*/
div[id^="thread_"] {
-webkit-box-shadow: 11px 11px 0px 0px #000;
@ -195,7 +195,7 @@ margin-left: 10px;
-webkit-box-shadow: 10px 10px 10px rgba(0, 0, 0, 0.5);
box-shadow: 7px 7px rgba(0, 0, 0, 0.5);
}
/*adds horizontal bar below subject*/
p.intro {
background-image: url('https://www.lainchan.org/static/UebGaj5.png');
@ -203,7 +203,7 @@ margin-left: 10px;
background-position: bottom;
min-height: 25px;
}
/*gives replies border/shadow*/
div.post.reply {
max-width: 95% !important;
@ -216,19 +216,19 @@ margin-left: 10px;
border: double 3px #000;
background-color: rgb(194, 194, 194);
}
/*unfucks highlighting replies and gives border/shadow*/
div.post.reply.highlighted {
background-color: #D6BDB0;
}
/*dont touch this*/
div.body {
display: block;
clear: both;
padding-top: 10px;
}
/*makes page bar have border/shadow*/
div.pages {
-webkit-box-shadow: 7px 7px 0px 0px #000;
@ -241,12 +241,12 @@ margin-left: 10px;
border: double black;
background-color: rgb(221, 221, 221);
}
/*hovered links have underline*/
a:hover {
text-decoration: underline;
}
/*stops textbox resizing shenanigans*/
.input[type="text"], textarea {
font-size: 14px;
@ -254,26 +254,26 @@ margin-left: 10px;
min-height: 115px;
min-width: 270px;
}
/*boardname nice font. replace with something classy someday*/
header div.subtitle, h1 {
font-family: Palatino Linotype, Book Antiqua, Palatino, serif;
color: rgb(187, 51, 0);
}
/*announcement font and color*/
div.blotter {
padding: 15px;
color: #000000;
font-family: Palatino Linotype, Book Antiqua, Palatino, serif;
}
/*makes links red*/
a {
color: rgb(187, 51, 0) !important;
text-decoration: none;
}
/*top boardlist stuff. change position to "fixed" to make it behave like normal 8chan*/
div.boardlist:not(.bottom) {
background-color: rgba(221, 221, 221, 1) !important;
@ -293,47 +293,47 @@ div.boardlist {
}
}
/*favorites in a new line*/
div.boardlist span.favorite-boards {
display: block;
}
/*subject color*/
p.intro span.subject {
color: rgb(117, 8, 8);
}
/*bottom boardlist centered*/
div.boardlist.bottom {
text-align: center;
background-color: rgba(228,228,228,1);
border: double #000000;
width: 101%;
}
/*colors name*/
p.intro span.name {
color: rgb(122, 77, 77);
font-family: ;
}
/*catalog stuff*/
.theme-catalog div.thread {
background-color: rgb(221, 221, 221);
border: double;
}
.theme-catalog div.thread:hover {
background-color: #D6BDB0;
border: double;
}
span.trip {
color: rgb(34, 136, 84);
}
#updater, #thread-links {
background-color: rgba(228,228,228,1);
border:double;
@ -365,7 +365,7 @@ max-width: 50%;
}
span.subject:after { content: '\A'; white-space:pre; }
SPAN.controls.op:before { content: '\A'; white-space:pre; }
div.controls.op:before { content: '\A'; white-space:pre; }
div.post-menu
{
@ -373,7 +373,7 @@ color: #ffffff;}
#options_div {
background-color: #dddddd;
}
.options_tab_icon.active {
color: #bb3300;
}

View file

@ -232,17 +232,17 @@ span.omitted {
br.clear {
clear: left;
}
span.controls {
div.controls {
float: right;
margin: 0;
padding: 0;
font-size: 80%;
}
span.controls.op {
div.controls.op {
float: none;
margin-left: 10px;
}
span.controls a {
div.controls a {
margin: 0;
}
div#wrap {

View file

@ -471,6 +471,12 @@ input.delete {
font-weight: bold;
}
@media (max-width: 48em) {
.user-controls {
display: none;
}
}
span.capcode, p.intro a.capcode, p.intro a.nametag {
color: #F00000;
margin-left: 0;
@ -521,6 +527,11 @@ div.post > p {
}
}
div.post.op > p {
clear: both;
padding-top: 1em;
}
div.post div.body {
margin-top: 0.8em;
padding-right: 3em;
@ -613,12 +624,12 @@ br.clear {
display: block;
}
span.controls {
div.controls {
margin: 0;
padding: 0;
}
span.controls a {
div.controls a {
margin: 0;
text-wrap: nowrap;
display: inline-block;

View file

@ -354,19 +354,19 @@ br.clear {
display: block;
}
span.controls {
div.controls {
float: right;
margin: 0;
padding: 0;
font-size: 80%;
}
span.controls.op {
div.controls.op {
float: none;
margin-left: 10px;
}
span.controls a {
div.controls a {
margin: 0;
}

View file

@ -231,17 +231,17 @@ span.omitted {
br.clear {
clear: left;
}
span.controls {
div.controls {
float: right;
margin: 0;
padding: 0;
font-size: 80%;
}
span.controls.op {
div.controls.op {
float: none;
margin-left: 10px;
}
span.controls a {
div.controls a {
margin: 0;
}
div#wrap {

View file

@ -4,6 +4,9 @@
<div class="thread" id="thread_{{ post.id }}" data-board="{{ board.uri }}">
{% if not index %}<a id="{{ post.id }}" class="post_anchor"></a>{% endif %}
<div class="post op" id="op_{{ post.id }}" {%if post.num_files > 1%}style='clear:both'{%endif%}>
<div class="head">
{% include 'post/fileinfo.html' %}
</div>
<p class="intro">
<label for="delete_{{ post.id }}">
<input type="checkbox" class="delete" name="delete_{{ post.id }}" id="delete_{{ post.id }}" />
@ -18,48 +21,49 @@
<a class="post_no" id="post_no_{{ post.id }}" title="Link to this post" onclick="highlightReply({{ post.id }})" href="{% if isnoko50 %}{{ post.link('', '50') }}{% else %}{{ post.link }}{% endif %}">No.</a>
<a class="post_no" title="Reply to this post" onclick="citeReply({{ post.id }})" href="{% if isnoko50 %}{{ post.link('q', '50') }}{% else %}{{ post.link('q') }}{% endif %}">{{ post.id }}</a>
</label>
</p>
<div class="head">
{% if post.sticky %}
{% if config.font_awesome %}
<i class="fa fa-thumb-tack" title="Sticky"></i> {# Keep this space #}
{# Keep this space #} <i class="fa fa-thumb-tack" title="Sticky"></i>
{% else %}
<img class="icon" title="Sticky" src="{{ config.root }}{{ config.image_sticky }}" alt="Sticky" /> {# Keep this space #}
{# Keep this space #} <img class="icon" title="Sticky" src="{{ config.root }}{{ config.image_sticky }}" alt="Sticky" />
{% endif %}
{% endif %}
{% if post.locked %}
{% if config.font_awesome %}
<i class="fa fa-lock" title="Locked"></i> {# Keep this space #}
{# Keep this space #} <i class="fa fa-lock" title="Locked"></i>
{% else %}
<img class="icon" title="Locked" src="{{ config.root }}{{ config.image_locked }}" alt="Locked" /> {# Keep this space #}
{# Keep this space #} <img class="icon" title="Locked" src="{{ config.root }}{{ config.image_locked }}" alt="Locked" />
{% endif %}
{% endif %}
{% if post.sage and (config.mod.view_bumplock < 0 or (post.mod and post.mod|hasPermission(config.mod.view_bumplock, board.uri))) %}
{% if config.font_awesome %}
<i class="fa fa-anchor" title="Bumplocked"></i> {# Keep this space #}
{# Keep this space #} <i class="fa fa-anchor" title="Bumplocked"></i>
{% else %}
<img class="icon" title="Bumplocked" src="{{ config.root }}{{ config.image_bumplocked }}" alt="Bumplocked" /> {# Keep this space #}
{# Keep this space #} <img class="icon" title="Bumplocked" src="{{ config.root }}{{ config.image_bumplocked }}" alt="Bumplocked" />
{% endif %}
{% endif %}
{% if post.cycle %}
{% if config.font_awesome %}
<i class="fa fa-refresh" title="Cyclical"></i> {# Keep this space #}
{# Keep this space #} <i class="fa fa-refresh" title="Cyclical"></i>
{% else %}
<img class="icon" title="Cyclical" src="{{ config.root }}{{ config.image_cycled }}" alt="Cyclical" /> {# Keep this space #}
{# Keep this space #} <img class="icon" title="Cyclical" src="{{ config.root }}{{ config.image_cycled }}" alt="Cyclical" />
{% endif %}
{% endif %}
{% if index %}
<a href="{{ post.root }}{{ board.dir }}{{ config.dir.res }}{{ link_for(post) }}">[{% trans %}Reply{% endtrans %}]</a> {# Keep this space #}
{% endif %}
{% if isnoko50 %}
<a href="{{ post.root }}{{ board.dir }}{{ config.dir.res }}{{ link_for(post) }}">[{% trans %}View All{% endtrans %}]</a> {# Keep this space #}
{% endif %}
{% if hasnoko50 and not isnoko50 %}
{% set lastcount = config.noko50_count %}
<a href="{{ post.root }}{{ board.dir }}{{ config.dir.res }}{{ link_for(post, true) }}">[{% trans %}Last 1 Post{% plural lastcount %}Last {{ count }} Posts{% endtrans %}]</a> {# Keep this space #}
{% endif %}
<label class="user-controls">
{% if index %}
{# Keep this space #} <a href="{{ post.root }}{{ board.dir }}{{ config.dir.res }}{{ link_for(post) }}">[{% trans %}Reply{% endtrans %}]</a>
{% endif %}
{% if isnoko50 %}
{# Keep this space #} <a href="{{ post.root }}{{ board.dir }}{{ config.dir.res }}{{ link_for(post) }}">[{% trans %}View All{% endtrans %}]</a>
{% endif %}
{% if hasnoko50 and not isnoko50 %}
{% set lastcount = config.noko50_count %}
{# Keep this space #} <a href="{{ post.root }}{{ board.dir }}{{ config.dir.res }}{{ link_for(post, true) }}">[{% trans %}Last 1 Post{% plural lastcount %}Last {{ count }} Posts{% endtrans %}]</a>
{% endif %}
</label>
</p>
<div class="head">
{% include 'post/post_controls.html' %}
{% include 'post/fileinfo.html' %}
</div>
<div class="body">
{% endfilter %}{% if index %}{{ post.body|truncate_body(post.link) }}{% else %}{{ post.body }}{% endif %}{% filter remove_whitespace %}
@ -88,7 +92,7 @@
{% plural post.omitted_images %}
{{ count }} image replies
{% endtrans %}
{% endif %} {% trans %}omitted. Click reply to view.{% endtrans %}
{% endif %} {% trans %}omitted.{% endtrans %}
</span>
{% endif %}
{% if not index %}