Merge branch 'config' of github.com:towards-a-new-leftypol/leftypol_lainchan into config
This commit is contained in:
commit
af967788dc
|
@ -1921,3 +1921,7 @@
|
||||||
|
|
||||||
//Empty board alias
|
//Empty board alias
|
||||||
$config['boards_alias'] = array();
|
$config['boards_alias'] = array();
|
||||||
|
|
||||||
|
//Logo location for themes
|
||||||
|
$config['logo'] = 'static/logo.png';
|
||||||
|
|
||||||
|
|
|
@ -109,6 +109,9 @@ $config['secure_trip_salt'] = 'ODQ2NDM0ODlmMmRhNzk2M2EyNjJlOW';
|
||||||
//Banners
|
//Banners
|
||||||
$config['url_banner'] = '/banners.php';
|
$config['url_banner'] = '/banners.php';
|
||||||
|
|
||||||
|
//Logo location for themes
|
||||||
|
$config['logo'] = 'static/leftypol_logo.png';
|
||||||
|
|
||||||
//Date format
|
//Date format
|
||||||
$config['post_date'] = '%F (%a) %T';
|
$config['post_date'] = '%F (%a) %T';
|
||||||
|
|
||||||
|
@ -370,6 +373,7 @@ $config['additional_javascript'][] = 'js/auto-reload.js';
|
||||||
$config['additional_javascript'][] = 'js/auto-scroll.js';
|
$config['additional_javascript'][] = 'js/auto-scroll.js';
|
||||||
$config['additional_javascript'][] = 'js/thread-stats.js';
|
$config['additional_javascript'][] = 'js/thread-stats.js';
|
||||||
$config['additional_javascript'][] = 'js/post-hover.js';
|
$config['additional_javascript'][] = 'js/post-hover.js';
|
||||||
|
$config['additional_javascript'][] = 'js/image-hover.js';
|
||||||
$config['additional_javascript'][] = 'js/style-select.js';
|
$config['additional_javascript'][] = 'js/style-select.js';
|
||||||
$config['additional_javascript'][] = 'js/flag-preview.js';
|
$config['additional_javascript'][] = 'js/flag-preview.js';
|
||||||
|
|
||||||
|
@ -394,7 +398,6 @@ $config['additional_javascript'][] = 'js/file-selector.js';
|
||||||
$config['additional_javascript'][] = 'js/save-user_flag.js';
|
$config['additional_javascript'][] = 'js/save-user_flag.js';
|
||||||
$config['additional_javascript'][] = 'js/webm-settings.js';
|
$config['additional_javascript'][] = 'js/webm-settings.js';
|
||||||
$config['additional_javascript'][] = 'js/expand-video.js';
|
$config['additional_javascript'][] = 'js/expand-video.js';
|
||||||
$config['additional_javascript'][] = 'js/download-original.js';
|
|
||||||
|
|
||||||
$config['flag_preview'] = true;
|
$config['flag_preview'] = true;
|
||||||
|
|
||||||
|
|
|
@ -59,7 +59,8 @@ var searchThreads = function($threads, query) {
|
||||||
|
|
||||||
// Only load in the catalog
|
// Only load in the catalog
|
||||||
if (active_page == 'catalog') {
|
if (active_page == 'catalog') {
|
||||||
onready(catalogSearch);
|
|
||||||
|
$(document).ready(catalogSearch);
|
||||||
}
|
}
|
||||||
|
|
||||||
}());
|
}());
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
onready(function(){
|
$(document).ready(function(){
|
||||||
var do_original_filename = function() {
|
var do_original_filename = function() {
|
||||||
var filename, truncated;
|
var filename, truncated;
|
||||||
if ($(this).attr('title')) {
|
if ($(this).attr('title')) {
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (active_page == 'ukko' || active_page == 'thread' || active_page == 'index')
|
if (active_page == 'ukko' || active_page == 'thread' || active_page == 'index')
|
||||||
onready(function(){
|
$(document).ready(function(){
|
||||||
$('hr:first').before('<div id="expand-all-images" style="text-align:right"><a class="unimportant" href="javascript:void(0)"></a></div>');
|
$('hr:first').before('<div id="expand-all-images" style="text-align:right"><a class="unimportant" href="javascript:void(0)"></a></div>');
|
||||||
$('div#expand-all-images a')
|
$('div#expand-all-images a')
|
||||||
.text(_('Expand all images'))
|
.text(_('Expand all images'))
|
||||||
|
|
|
@ -216,7 +216,7 @@ function setupVideosIn(element) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onready(function(){
|
$(document).ready(function(){
|
||||||
// Insert menu from settings.js
|
// Insert menu from settings.js
|
||||||
if (typeof settingsMenu != "undefined" && typeof Options == "undefined") {
|
if (typeof settingsMenu != "undefined" && typeof Options == "undefined") {
|
||||||
var firsthr = document.getElementsByTagName("hr")[0];
|
var firsthr = document.getElementsByTagName("hr")[0];
|
||||||
|
|
|
@ -8,24 +8,6 @@
|
||||||
*/
|
*/
|
||||||
function init_file_selector(max_images) {
|
function init_file_selector(max_images) {
|
||||||
|
|
||||||
$(document).ready(function () {
|
|
||||||
// add options panel item
|
|
||||||
if (window.Options && Options.get_tab('general')) {
|
|
||||||
Options.extend_tab('general', '<label id="file-drag-drop"><input type="checkbox">' + _('Drag and drop file selection') + '</label>');
|
|
||||||
|
|
||||||
$('#file-drag-drop>input').on('click', function() {
|
|
||||||
if ($('#file-drag-drop>input').is(':checked')) {
|
|
||||||
localStorage.file_dragdrop = 'true';
|
|
||||||
} else {
|
|
||||||
localStorage.file_dragdrop = 'false';
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
if (typeof localStorage.file_dragdrop === 'undefined') localStorage.file_dragdrop = 'true';
|
|
||||||
if (localStorage.file_dragdrop === 'true') $('#file-drag-drop>input').prop('checked', true);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// disabled by user, or incompatible browser.
|
// disabled by user, or incompatible browser.
|
||||||
if (localStorage.file_dragdrop == 'false' || !(window.URL.createObjectURL && window.File))
|
if (localStorage.file_dragdrop == 'false' || !(window.URL.createObjectURL && window.File))
|
||||||
return;
|
return;
|
||||||
|
@ -190,3 +172,26 @@ $(document).on('paste', function (e) {
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$(document).ready(function () {
|
||||||
|
// add options panel item
|
||||||
|
if (window.Options && Options.get_tab('general')) {
|
||||||
|
Options.extend_tab('general', '<label id="file-drag-drop"><input type="checkbox">' + _('Drag and drop file selection') + '</label>');
|
||||||
|
|
||||||
|
$('#file-drag-drop>input').on('click', function() {
|
||||||
|
if ($('#file-drag-drop>input').is(':checked')) {
|
||||||
|
localStorage.file_dragdrop = 'true';
|
||||||
|
} else {
|
||||||
|
localStorage.file_dragdrop = 'false';
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
if (typeof localStorage.file_dragdrop === 'undefined') localStorage.file_dragdrop = 'true';
|
||||||
|
if (localStorage.file_dragdrop === 'true') $('#file-drag-drop>input').prop('checked', true);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
$(document).ready(function () {
|
||||||
|
var maxImages = document.querySelector("form[name=post]").dataset.maxImages;
|
||||||
|
init_file_selector(Number(maxImages));
|
||||||
|
});
|
||||||
|
|
|
@ -26,7 +26,7 @@ function updatePreviewWithSelected(img, select) {
|
||||||
img.attr("src", getFlagUrl(select.find(":selected").val()));
|
img.attr("src", getFlagUrl(select.find(":selected").val()));
|
||||||
}
|
}
|
||||||
|
|
||||||
onready(function(){
|
$(document).ready(function(){
|
||||||
var flagImg = $('#flag_preview');
|
var flagImg = $('#flag_preview');
|
||||||
var flagSelect = $('#user_flag');
|
var flagSelect = $('#user_flag');
|
||||||
var loaded = loadFlag();
|
var loaded = loadFlag();
|
||||||
|
|
|
@ -6,8 +6,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (active_page === "catalog" || active_page === "thread" || active_page === "index" || active_page === "ukko") {
|
if (active_page === "catalog" || active_page === "thread" || active_page === "index" || active_page === "ukko") {
|
||||||
$(document).on('ready', function(){
|
$(document).ready(function () {
|
||||||
|
|
||||||
if (window.Options && Options.get_tab('general')) {
|
if (window.Options && Options.get_tab('general')) {
|
||||||
Options.extend_tab("general",
|
Options.extend_tab("general",
|
||||||
"<fieldset><legend>Image hover</legend>"
|
"<fieldset><legend>Image hover</legend>"
|
||||||
|
@ -19,7 +18,6 @@ if (window.Options && Options.get_tab('general')) {
|
||||||
|
|
||||||
$('.image-hover').on('change', function(){
|
$('.image-hover').on('change', function(){
|
||||||
var setting = $(this).attr('id');
|
var setting = $(this).attr('id');
|
||||||
|
|
||||||
localStorage[setting] = $(this).children('input').is(':checked');
|
localStorage[setting] = $(this).children('input').is(':checked');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -34,6 +32,7 @@ if (getSetting('catalogImageHover')) $('#catalogImageHover>input').prop('checked
|
||||||
if (getSetting('imageHoverFollowCursor')) $('#imageHoverFollowCursor>input').prop('checked', 'checked');
|
if (getSetting('imageHoverFollowCursor')) $('#imageHoverFollowCursor>input').prop('checked', 'checked');
|
||||||
|
|
||||||
function getFileExtension(filename) { //Pashe, WTFPL
|
function getFileExtension(filename) { //Pashe, WTFPL
|
||||||
|
if (filename == undefined) {return "unknown";} // catalog
|
||||||
if (filename.match(/\.([a-z0-9]+)(&loop.*)?$/i) !== null) {
|
if (filename.match(/\.([a-z0-9]+)(&loop.*)?$/i) !== null) {
|
||||||
return filename.match(/\.([a-z0-9]+)(&loop.*)?$/i)[1];
|
return filename.match(/\.([a-z0-9]+)(&loop.*)?$/i)[1];
|
||||||
} else if (filename.match(/https?:\/\/(www\.)?youtube.com/)) {
|
} else if (filename.match(/https?:\/\/(www\.)?youtube.com/)) {
|
||||||
|
@ -96,26 +95,23 @@ function initImageHover() { //Pashe, influenced by tux, et al, WTFPL
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function imageHoverStart(e) { //Pashe, anonish, WTFPL
|
function followCursor(e, hoverImage) {
|
||||||
var hoverImage = $("#chx_hoverImage");
|
|
||||||
|
|
||||||
if (hoverImage.length) {
|
|
||||||
if (getSetting("imageHoverFollowCursor")) {
|
|
||||||
var scrollTop = $(window).scrollTop();
|
var scrollTop = $(window).scrollTop();
|
||||||
var imgY = e.pageY;
|
var imgWidth = Number(hoverImage.css("max-width").slice(0,-2))
|
||||||
var imgTop = imgY;
|
var imgHeight = Number(hoverImage.css("max-height").slice(0,-2))
|
||||||
|
var imgTop = e.pageY - (imgHeight/2);
|
||||||
var windowWidth = $(window).width();
|
var windowWidth = $(window).width();
|
||||||
var imgWidth = hoverImage.width() + e.pageX;
|
var imgEnd = imgWidth + e.pageX;
|
||||||
|
|
||||||
if (imgY < scrollTop + 15) {
|
if (imgTop < scrollTop + 15) {
|
||||||
imgTop = scrollTop;
|
imgTop = scrollTop + 15;
|
||||||
} else if (imgY > scrollTop + $(window).height() - hoverImage.height() - 15) {
|
} else if (imgTop > scrollTop + $(window).height() - imgHeight - 15) {
|
||||||
imgTop = scrollTop + $(window).height() - hoverImage.height() - 15;
|
imgTop = scrollTop + $(window).height() - imgHeight - 15;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (imgWidth > windowWidth) {
|
if (imgEnd > windowWidth) {
|
||||||
hoverImage.css({
|
hoverImage.css({
|
||||||
'left': (e.pageX + (windowWidth - imgWidth)),
|
'left': (e.pageX + (windowWidth - imgEnd)),
|
||||||
'top' : imgTop,
|
'top' : imgTop,
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
@ -124,10 +120,16 @@ function imageHoverStart(e) { //Pashe, anonish, WTFPL
|
||||||
'top' : imgTop,
|
'top' : imgTop,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function imageHoverStart(e) { //Pashe, anonish, WTFPL
|
||||||
|
var hoverImage = $("#chx_hoverImage");
|
||||||
|
|
||||||
|
if (hoverImage.length){
|
||||||
|
if (getSetting("imageHoverFollowCursor")) {
|
||||||
|
followCursor(e, hoverImage);
|
||||||
hoverImage.appendTo($("body"));
|
hoverImage.appendTo($("body"));
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -145,8 +147,8 @@ function imageHoverStart(e) { //Pashe, anonish, WTFPL
|
||||||
|
|
||||||
hoverImage = $('<img id="chx_hoverImage" src="'+fullUrl+'" />');
|
hoverImage = $('<img id="chx_hoverImage" src="'+fullUrl+'" />');
|
||||||
|
|
||||||
if (getSetting("imageHoverFollowCursor")) {
|
if (getSetting("imageHoverFollowCursor") && active_page !== "catalog") {
|
||||||
var size = $this.parents('.file').find('.unimportant').text().match(/\b(\d+)x(\d+)\b/),
|
var size = $this.parents('.file').find('.details').text().match(/\b(\d+)x(\d+)\b/),
|
||||||
maxWidth = $(window).width(),
|
maxWidth = $(window).width(),
|
||||||
maxHeight = $(window).height();
|
maxHeight = $(window).height();
|
||||||
|
|
||||||
|
@ -159,8 +161,6 @@ function imageHoverStart(e) { //Pashe, anonish, WTFPL
|
||||||
"height" : size[2] + "px",
|
"height" : size[2] + "px",
|
||||||
"max-width" : (size[1] * scale) + "px",
|
"max-width" : (size[1] * scale) + "px",
|
||||||
"max-height" : (size[2] * scale) + "px",
|
"max-height" : (size[2] * scale) + "px",
|
||||||
'left' : e.pageX,
|
|
||||||
'top' : imgTop,
|
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
hoverImage.css({
|
hoverImage.css({
|
||||||
|
@ -173,7 +173,13 @@ function imageHoverStart(e) { //Pashe, anonish, WTFPL
|
||||||
"max-height" : "100%",
|
"max-height" : "100%",
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (getSetting("imageHoverFollowCursor")) {
|
||||||
|
followCursor(e, hoverImage);
|
||||||
|
}
|
||||||
|
|
||||||
hoverImage.appendTo($("body"));
|
hoverImage.appendTo($("body"));
|
||||||
|
|
||||||
if (isOnThread()) {$this.css("cursor", "none");}
|
if (isOnThread()) {$this.css("cursor", "none");}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -185,3 +191,4 @@ initImageHover();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
onready(function(){
|
$(document).ready(function(){
|
||||||
var inline_expanding_filename = function() {
|
var inline_expanding_filename = function() {
|
||||||
$(this).find(".fileinfo > a").click(function(){
|
$(this).find(".fileinfo > a").click(function(){
|
||||||
var imagelink = $(this).parent().parent().find('a[target="_blank"]:first');
|
var imagelink = $(this).parent().parent().find('a[target="_blank"]:first');
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
onready(function(){
|
$(document).ready(function () {
|
||||||
var dont_fetch_again = [];
|
var dont_fetch_again = [];
|
||||||
init_hover = function() {
|
init_hover = function() {
|
||||||
var $link = $(this);
|
var $link = $(this);
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
onready(function(){
|
$(document).ready(function(){
|
||||||
var showBackLinks = function() {
|
var showBackLinks = function() {
|
||||||
var reply_id = $(this).attr('id').replace(/^reply_/, '');
|
var reply_id = $(this).attr('id').replace(/^reply_/, '');
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
onready(function(){
|
$(document).ready(function(){
|
||||||
if(device_type == 'mobile') {
|
if(device_type == 'mobile') {
|
||||||
var fix_spoilers = function(where) {
|
var fix_spoilers = function(where) {
|
||||||
var spoilers = where.getElementsByClassName('spoiler');
|
var spoilers = where.getElementsByClassName('spoiler');
|
||||||
|
|
|
@ -14,23 +14,35 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
onready(function(){
|
$(document).ready(function() {
|
||||||
var stylesDiv = $('div.styles');
|
var stylesDiv = $('div.styles');
|
||||||
var pages = $('div.pages');
|
var pages = $('div.pages');
|
||||||
var stylesSelect = $('<select></select>');
|
var stylesSelect = $('<select></select>').css({float:"none"});
|
||||||
|
var options = [];
|
||||||
|
|
||||||
var i = 1;
|
var i = 1;
|
||||||
stylesDiv.children().each(function() {
|
stylesDiv.children().each(function() {
|
||||||
|
var name = this.innerHTML.replace(/(^\[|\]$)/g, '');
|
||||||
var opt = $('<option></option>')
|
var opt = $('<option></option>')
|
||||||
.html(this.innerHTML.replace(/(^\[|\]$)/g, ''))
|
.html(name)
|
||||||
.val(i);
|
.val(i);
|
||||||
if ($(this).hasClass('selected'))
|
if ($(this).hasClass('selected'))
|
||||||
opt.attr('selected', true);
|
opt.attr('selected', true);
|
||||||
stylesSelect.append(opt);
|
options.push ([name.toUpperCase (), opt]);
|
||||||
$(this).attr('id', 'style-select-' + i);
|
$(this).attr('id', 'style-select-' + i);
|
||||||
i++;
|
i++;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
options.sort ((a, b) => {
|
||||||
|
const keya = a [0];
|
||||||
|
const keyb = b [0];
|
||||||
|
if (keya < keyb) { return -1; }
|
||||||
|
if (keya > keyb) { return 1; }
|
||||||
|
return 0;
|
||||||
|
}).forEach (([key, opt]) => {
|
||||||
|
stylesSelect.append(opt);
|
||||||
|
});
|
||||||
|
|
||||||
stylesSelect.change(function() {
|
stylesSelect.change(function() {
|
||||||
$('#style-select-' + $(this).val()).click();
|
$('#style-select-' + $(this).val()).click();
|
||||||
});
|
});
|
||||||
|
@ -38,8 +50,6 @@ onready(function(){
|
||||||
stylesDiv.hide()
|
stylesDiv.hide()
|
||||||
pages.after(
|
pages.after(
|
||||||
$('<div id="style-select"></div>')
|
$('<div id="style-select"></div>')
|
||||||
/*.text(_('Style: '))*/
|
.append(_('Select theme: '), stylesSelect)
|
||||||
.append(stylesSelect)
|
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
onready(function(){
|
$(document).ready(function(){
|
||||||
const ON = "[Remove]";
|
const ON = "[Remove]";
|
||||||
const OFF = "[Embed]";
|
const OFF = "[Embed]";
|
||||||
|
|
||||||
|
|
3
post.php
3
post.php
|
@ -280,7 +280,8 @@ function handle_delete(){
|
||||||
$root = $is_mod ? $config['root'] . $config['file_mod'] . '?/' : $config['root'];
|
$root = $is_mod ? $config['root'] . $config['file_mod'] . '?/' : $config['root'];
|
||||||
|
|
||||||
if (!isset($_POST['json_response'])) {
|
if (!isset($_POST['json_response'])) {
|
||||||
header('Location: ' . $root . $board['dir'] . $config['file_index'], true, $config['redirect_http']);
|
// If only deleting a post in a thread, redirect to the current thread
|
||||||
|
header('Location: ' . $root . $board['dir'] . ($post['thread'] ? $config['dir']['res'] . sprintf($config['file_page'], $post['thread']) : $config['file_index']), true, $config['redirect_http']);
|
||||||
} else {
|
} else {
|
||||||
header('Content-Type: text/json');
|
header('Content-Type: text/json');
|
||||||
echo json_encode(array('success' => true));
|
echo json_encode(array('success' => true));
|
||||||
|
|
46
status.php
46
status.php
|
@ -49,6 +49,52 @@ foreach ($board_list as $board) {
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function endsWith( $haystack, $needle ) {
|
||||||
|
$length = strlen( $needle );
|
||||||
|
if( !$length ) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return substr( $haystack, -$length ) === $needle;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Boards that are nsfw
|
||||||
|
$nsfw_boards = ['b', 'overboard'];
|
||||||
|
// Boards that use spoiler_alunya.png as their spoiler
|
||||||
|
$alunya_spoiler = ['leftypol', 'anime'];
|
||||||
|
// Boards where posts are not allowed to be created
|
||||||
|
$readonly_boards = ['overboard', 'sfw', 'alt'];
|
||||||
|
|
||||||
|
$board_list = listBoards();
|
||||||
|
|
||||||
|
// Add objects that are not boards but are treated as such
|
||||||
|
$board_list[] = ['uri' => 'overboard', 'title' => 'Overboard'];
|
||||||
|
$board_list[] = ['uri' => 'sfw', 'title' => 'SFW Overboard'];
|
||||||
|
$board_list[] = ['uri' => 'alt', 'title' => 'Alternate Overboard'];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Allowed fields for the board object:
|
||||||
|
* - code<string>: The board code ('b', 'tech', ...)
|
||||||
|
* - name<string>: The board user-readable name ('Siberia', ...)
|
||||||
|
* - description<string>: The board description ('Leftist Politically Incorrect', ...)
|
||||||
|
* - sfw<boolean>: Is this board sfw?
|
||||||
|
* - alternate_spoilers<boolean>: Does this board use the alunya spoiler?
|
||||||
|
*/
|
||||||
|
$boards = [];
|
||||||
|
foreach ($board_list as $board) {
|
||||||
|
// Skip archives
|
||||||
|
if (endsWith($board['uri'], '_archive')) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
$boards[] = [
|
||||||
|
'code' => $board['uri'],
|
||||||
|
'name' => $board['title'],
|
||||||
|
'sfw' => !in_array($board['uri'], $nsfw_boards),
|
||||||
|
'alternate_spoilers' => in_array($board['uri'], $alunya_spoiler),
|
||||||
|
'posting_enabled' => !in_array($board['uri'], $readonly_boards),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
header('Content-Type: application/json');
|
header('Content-Type: application/json');
|
||||||
echo json_encode([
|
echo json_encode([
|
||||||
'captcha' => $config['securimage'],
|
'captcha' => $config['securimage'],
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
{% if not nojavascript %}
|
{% if not nojavascript %}
|
||||||
<script type="text/javascript" src="{{ config.url_javascript }}"></script>
|
<script type="text/javascript" src="{{ config.url_javascript }}"></script>
|
||||||
{% if not config.additional_javascript_compile %}
|
{% if not config.additional_javascript_compile %}
|
||||||
{% for javascript in config.additional_javascript %}<script type="text/javascript" src="{{ config.additional_javascript_url }}{{ javascript }}"></script>{% endfor %}
|
{% for javascript in config.additional_javascript %}<script defer type="text/javascript" src="{{ config.additional_javascript_url }}{{ javascript }}"></script>{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if config.recaptcha %}
|
{% if config.recaptcha %}
|
||||||
|
|
|
@ -22,9 +22,9 @@
|
||||||
{% if config.show_filename and file.filename %}
|
{% if config.show_filename and file.filename %}
|
||||||
,
|
,
|
||||||
{% if file.filename|length > config.max_filename_display %}
|
{% if file.filename|length > config.max_filename_display %}
|
||||||
<span class="postfilename" title="{{ file.filename|e|bidi_cleanup }}">{{ file.filename|truncate_filename(config.max_filename_display)|e|bidi_cleanup }}</span>
|
<a href="{{ config.uri_img }}{{ file.file }}" download="{{ file.filename }}" title="Save as original filename">{{ file.filename|truncate_filename(config.max_filename_display)|e|bidi_cleanup }}</a>
|
||||||
{% else %}
|
{% else %}
|
||||||
<span class="postfilename">{{ file.filename|e|bidi_cleanup }}</span>
|
<a href="{{ config.uri_img }}{{ file.file }}" download="{{ file.filename }}" title="Save as original filename">{{ file.filename|e|bidi_cleanup }}</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
)
|
)
|
||||||
|
@ -36,3 +36,4 @@
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,10 @@
|
||||||
<form name="post" onsubmit="return dopost(this);" enctype="multipart/form-data" action="{{ config.post_url }}" method="post">
|
<form
|
||||||
|
name="post" onsubmit="return dopost(this);"
|
||||||
|
enctype="multipart/form-data"
|
||||||
|
action="{{ config.post_url }}"
|
||||||
|
method="post"
|
||||||
|
data-max-images="{{ config.max_images }}"
|
||||||
|
>
|
||||||
{{ antibot.html() }}
|
{{ antibot.html() }}
|
||||||
{% if id %}<input type="hidden" name="thread" value="{{ id }}">{% endif %}
|
{% if id %}<input type="hidden" name="thread" value="{{ id }}">{% endif %}
|
||||||
{{ antibot.html() }}
|
{{ antibot.html() }}
|
||||||
|
@ -142,8 +148,6 @@
|
||||||
<td>
|
<td>
|
||||||
<input type="file" name="file" id="upload_file">
|
<input type="file" name="file" id="upload_file">
|
||||||
|
|
||||||
<script type="text/javascript">if (typeof init_file_selector !== 'undefined') init_file_selector({{ config.max_images }});</script>
|
|
||||||
|
|
||||||
{% if config.allow_upload_by_url %}
|
{% if config.allow_upload_by_url %}
|
||||||
<div style="float:none;text-align:left" id="upload_url">
|
<div style="float:none;text-align:left" id="upload_url">
|
||||||
<label for="file_url">{% trans %}Or URL{% endtrans %}</label>:
|
<label for="file_url">{% trans %}Or URL{% endtrans %}</label>:
|
||||||
|
|
|
@ -8,6 +8,8 @@
|
||||||
<link rel="stylesheet" media="screen" href="/stylesheets/dark_red.css">
|
<link rel="stylesheet" media="screen" href="/stylesheets/dark_red.css">
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
.sidebar {
|
.sidebar {
|
||||||
|
grid-column: 1;
|
||||||
|
grid-row: 1 / 3;
|
||||||
width: 200px;
|
width: 200px;
|
||||||
border-right-color: gray;
|
border-right-color: gray;
|
||||||
border-right-style: solid;
|
border-right-style: solid;
|
||||||
|
@ -15,15 +17,30 @@
|
||||||
margin-right: 15px;
|
margin-right: 15px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.introduction {
|
||||||
|
grid-column: 2 / 9;
|
||||||
|
grid-row: 1;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
.content {
|
.content {
|
||||||
|
grid-column: 2 / 9;
|
||||||
|
grid-row: 2;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
body {
|
body {
|
||||||
display: flex;
|
display: grid;
|
||||||
|
grid-template-columns: repeat(auto-fill,minmax(200px, 1fr));
|
||||||
|
gap: 20px;
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.modlog {
|
||||||
|
width: 50%;
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
|
||||||
fieldset {
|
fieldset {
|
||||||
margin: 10px;
|
margin: 10px;
|
||||||
}
|
}
|
||||||
|
@ -54,13 +71,45 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (max-width:768px) {
|
@media (max-width:768px) {
|
||||||
.sidebar {
|
body{
|
||||||
width: 80vw;
|
display: grid;
|
||||||
border: none;
|
grid-template-columns: none;
|
||||||
|
gap: 20px;
|
||||||
|
height: 100vh;
|
||||||
|
width: 100%;
|
||||||
}
|
}
|
||||||
.main {
|
|
||||||
flex-direction: column;
|
.introduction {
|
||||||
align-items: center;
|
grid-column: 1;
|
||||||
|
grid-row: 1;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidebar {
|
||||||
|
grid-column: 1;
|
||||||
|
grid-row: 2;
|
||||||
|
width: 100%;
|
||||||
|
border-width: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content {
|
||||||
|
grid-column: 1;
|
||||||
|
grid-row: 3;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.modlog {
|
||||||
|
width: 100%;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
table {
|
||||||
|
table-layout: fixed;
|
||||||
|
}
|
||||||
|
|
||||||
|
table.modlog tr th {
|
||||||
|
white-space: normal;
|
||||||
|
word-wrap: break-word;
|
||||||
}
|
}
|
||||||
|
|
||||||
.boardlist {
|
.boardlist {
|
||||||
|
@ -73,9 +122,11 @@
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<title>{{ settings.title }}</title>
|
<title>{{ settings.title }}</title>
|
||||||
|
<meta name="description" content="{{ description }}">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
{% include 'themes/categories/' ~ settings.file_sidebar %}
|
{% include 'themes/categories/' ~ settings.file_sidebar %}
|
||||||
{% include 'themes/categories/' ~ settings.file_news %}
|
{% include 'themes/categories/' ~ settings.file_news %}
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
||||||
|
|
|
@ -1,13 +1,30 @@
|
||||||
{% filter remove_whitespace %}
|
{% filter remove_whitespace %}
|
||||||
<div class="content">
|
<div class="introduction">
|
||||||
|
<style style="display:none;">
|
||||||
|
.home-logo {
|
||||||
|
display: block;
|
||||||
|
margin: auto;
|
||||||
|
min-width: 100px;
|
||||||
|
width: 15%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.home-description {
|
||||||
|
margin: 20px auto 0 auto;
|
||||||
|
text-align: center;
|
||||||
|
max-width: 700px;"
|
||||||
|
}
|
||||||
|
</style>
|
||||||
{{ boardlist.top }}
|
{{ boardlist.top }}
|
||||||
<header>
|
<header>
|
||||||
<h1>{{ settings.title }}</h1>
|
<h1>{{ settings.title }}</h1>
|
||||||
|
<img src="{{ config.logo }}" alt="logo" class="home-logo">
|
||||||
<div class="subtitle">{{ settings.subtitle }}</div>
|
<div class="subtitle">{{ settings.subtitle }}</div>
|
||||||
<link rel="stylesheet" media="screen" href="{{ config.url_stylesheet }}">
|
<link rel="stylesheet" media="screen" href="{{ config.url_stylesheet }}">
|
||||||
<link rel="stylesheet" media="screen" href="/stylesheets/dark_red.css">
|
<link rel="stylesheet" media="screen" href="/stylesheets/dark_red.css">
|
||||||
|
<p class="home-description" >{{ description }}</p>
|
||||||
</header>
|
</header>
|
||||||
|
</div>
|
||||||
|
<div class="content">
|
||||||
<div class="ban">
|
<div class="ban">
|
||||||
{% if not news %}
|
{% if not news %}
|
||||||
<p style="text-align:center" class="unimportant">{% trans %}(No news to show.){% endtrans %}</p>
|
<p style="text-align:center" class="unimportant">{% trans %}(No news to show.){% endtrans %}</p>
|
||||||
|
@ -31,7 +48,7 @@
|
||||||
{% trans "Post Statistics" %}
|
{% trans "Post Statistics" %}
|
||||||
</h1>
|
</h1>
|
||||||
</div>
|
</div>
|
||||||
<table class="modlog" style="width: 50%; text-align: left;">
|
<table class="modlog">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>{% trans "Board" %}</th>
|
<th>{% trans "Board" %}</th>
|
||||||
|
@ -91,3 +108,4 @@
|
||||||
</footer>
|
</footer>
|
||||||
</div>
|
</div>
|
||||||
{% endfilter %}
|
{% endfilter %}
|
||||||
|
|
||||||
|
|
|
@ -34,6 +34,9 @@
|
||||||
// Build homepage
|
// Build homepage
|
||||||
public static function homepage($settings) {
|
public static function homepage($settings) {
|
||||||
global $config;
|
global $config;
|
||||||
|
$description = 'Leftypol is a fun and enjoyable space where users can post anonymously.<br>' .
|
||||||
|
'We engage in both serious political discourse and less serious informal discussions ' .
|
||||||
|
'on various topics related to leftist thought.';
|
||||||
$query = query("SELECT * FROM ``news`` ORDER BY `time` DESC") or error(db_error());
|
$query = query("SELECT * FROM ``news`` ORDER BY `time` DESC") or error(db_error());
|
||||||
$news = $query->fetchAll(PDO::FETCH_ASSOC);
|
$news = $query->fetchAll(PDO::FETCH_ASSOC);
|
||||||
$stats = Categories::getPostStatistics($settings);
|
$stats = Categories::getPostStatistics($settings);
|
||||||
|
@ -42,6 +45,7 @@
|
||||||
Array(
|
Array(
|
||||||
'config' => $config,
|
'config' => $config,
|
||||||
'settings' => $settings,
|
'settings' => $settings,
|
||||||
|
'description' => $description,
|
||||||
'categories' => Categories::getCategories($config),
|
'categories' => Categories::getCategories($config),
|
||||||
'news' => $news,
|
'news' => $news,
|
||||||
'stats' => $stats,
|
'stats' => $stats,
|
||||||
|
@ -160,3 +164,4 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue