mirror of
https://github.com/vichan-devel/vichan.git
synced 2024-11-24 23:50:11 +01:00
This commit is contained in:
commit
190d193516
@ -561,6 +561,9 @@
|
|||||||
// When true, users are instead presented a selectbox for email. Contains, blank, noko and sage.
|
// When true, users are instead presented a selectbox for email. Contains, blank, noko and sage.
|
||||||
$config['field_email_selectbox'] = &$config['field_disable_name'];
|
$config['field_email_selectbox'] = &$config['field_disable_name'];
|
||||||
|
|
||||||
|
// Prevent users from uploading files.
|
||||||
|
$config['disable_images'] = false;
|
||||||
|
|
||||||
// When true, the sage won't be displayed
|
// When true, the sage won't be displayed
|
||||||
$config['hide_sage'] = false;
|
$config['hide_sage'] = false;
|
||||||
|
|
||||||
@ -1118,7 +1121,7 @@
|
|||||||
$config['error']['mime_exploit'] = _('MIME type detection XSS exploit (IE) detected; post discarded.');
|
$config['error']['mime_exploit'] = _('MIME type detection XSS exploit (IE) detected; post discarded.');
|
||||||
$config['error']['invalid_embed'] = _('Couldn\'t make sense of the URL of the video you tried to embed.');
|
$config['error']['invalid_embed'] = _('Couldn\'t make sense of the URL of the video you tried to embed.');
|
||||||
$config['error']['captcha'] = _('You seem to have mistyped the verification.');
|
$config['error']['captcha'] = _('You seem to have mistyped the verification.');
|
||||||
|
$config['error']['images_disabled'] = _('Uploading files is disabled on this board.');
|
||||||
|
|
||||||
// mod.php errors
|
// mod.php errors
|
||||||
$config['error']['toomanyunban'] = _('You are only allowed to unban %s users at a time. You tried to unban %u users.');
|
$config['error']['toomanyunban'] = _('You are only allowed to unban %s users at a time. You tried to unban %u users.');
|
||||||
|
@ -57,7 +57,6 @@
|
|||||||
$config['show_ratio'] = true;
|
$config['show_ratio'] = true;
|
||||||
//$config['allow_upload_by_url'] = true;
|
//$config['allow_upload_by_url'] = true;
|
||||||
$config['max_filesize'] = 1024 * 1024 * 8; // 8MB
|
$config['max_filesize'] = 1024 * 1024 * 8; // 8MB
|
||||||
$config['disable_images'] = false;
|
|
||||||
$config['spoiler_images'] = true;
|
$config['spoiler_images'] = true;
|
||||||
$config['image_reject_repost'] = true;
|
$config['image_reject_repost'] = true;
|
||||||
$config['allowed_ext_files'][] = 'webm';
|
$config['allowed_ext_files'][] = 'webm';
|
||||||
|
@ -22,7 +22,7 @@ function load_twig() {
|
|||||||
$loader = new Twig_Loader_Filesystem($config['dir']['template']);
|
$loader = new Twig_Loader_Filesystem($config['dir']['template']);
|
||||||
$loader->setPaths($config['dir']['template']);
|
$loader->setPaths($config['dir']['template']);
|
||||||
$twig = new Twig_Environment($loader, array(
|
$twig = new Twig_Environment($loader, array(
|
||||||
'autoescape' => false,
|
'autoescape' => false,
|
||||||
'cache' => is_writable('templates') || (is_dir('templates/cache') && is_writable('templates/cache')) ?
|
'cache' => is_writable('templates') || (is_dir('templates/cache') && is_writable('templates/cache')) ?
|
||||||
"{$config['dir']['template']}/cache" : false,
|
"{$config['dir']['template']}/cache" : false,
|
||||||
'debug' => $config['debug']
|
'debug' => $config['debug']
|
||||||
|
@ -6,26 +6,6 @@ if (active_page == 'catalog') $(function(){
|
|||||||
localStorage.catalog = JSON.stringify(catalog);
|
localStorage.catalog = JSON.stringify(catalog);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (localStorage.hiddenthreads) {
|
|
||||||
var hidden_data = JSON.parse(localStorage.hiddenthreads);
|
|
||||||
|
|
||||||
if (hidden_data[board_name] && !$.isEmptyObject(hidden_data[board_name])) {
|
|
||||||
$.each(hidden_data[board_name], function(k, v) {
|
|
||||||
$('a[href$="/'+k+'.html"]').parents('.mix').remove();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
hidden_data = {};
|
|
||||||
}
|
|
||||||
|
|
||||||
$(document).on('click', '.mix', function(e) {
|
|
||||||
if (e.shiftKey) {
|
|
||||||
hidden_data[board_name][$(this).data('id')] = Math.round(Date.now() / 1000);
|
|
||||||
$(this).remove();
|
|
||||||
localStorage.hiddenthreads = JSON.stringify(hidden_data);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
$("#sort_by").change(function(){
|
$("#sort_by").change(function(){
|
||||||
var value = this.value;
|
var value = this.value;
|
||||||
$('#Grid').mixItUp('sort', (value == "random" ? value : "sticky:desc " + value));
|
$('#Grid').mixItUp('sort', (value == "random" ? value : "sticky:desc " + value));
|
||||||
|
@ -21,6 +21,7 @@ function setupVideo(thumb, url) {
|
|||||||
function unexpand() {
|
function unexpand() {
|
||||||
if (expanded) {
|
if (expanded) {
|
||||||
expanded = false;
|
expanded = false;
|
||||||
|
hovering = false;
|
||||||
if (video.pause) video.pause();
|
if (video.pause) video.pause();
|
||||||
videoContainer.style.display = "none";
|
videoContainer.style.display = "none";
|
||||||
thumb.style.display = "inline";
|
thumb.style.display = "inline";
|
||||||
@ -34,8 +35,7 @@ function setupVideo(thumb, url) {
|
|||||||
hovering = false;
|
hovering = false;
|
||||||
if (video.pause) video.pause();
|
if (video.pause) video.pause();
|
||||||
videoContainer.style.display = "none";
|
videoContainer.style.display = "none";
|
||||||
video.style.maxWidth = "inherit";
|
video.style.display = "none";
|
||||||
video.style.maxHeight = "inherit";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -56,6 +56,7 @@ function setupVideo(thumb, url) {
|
|||||||
videoHide.addEventListener("click", unexpand, false);
|
videoHide.addEventListener("click", unexpand, false);
|
||||||
|
|
||||||
videoContainer = document.createElement("div");
|
videoContainer = document.createElement("div");
|
||||||
|
videoContainer.id = "#expandedVideo";
|
||||||
videoContainer.style.paddingLeft = "15px";
|
videoContainer.style.paddingLeft = "15px";
|
||||||
videoContainer.style.display = "none";
|
videoContainer.style.display = "none";
|
||||||
videoContainer.appendChild(videoHide);
|
videoContainer.appendChild(videoHide);
|
||||||
@ -113,6 +114,7 @@ function setupVideo(thumb, url) {
|
|||||||
function expand2() {
|
function expand2() {
|
||||||
video.style.maxWidth = "100%";
|
video.style.maxWidth = "100%";
|
||||||
video.style.maxHeight = window.innerHeight + "px";
|
video.style.maxHeight = window.innerHeight + "px";
|
||||||
|
|
||||||
var bottom = video.getBoundingClientRect().bottom;
|
var bottom = video.getBoundingClientRect().bottom;
|
||||||
if (bottom > window.innerHeight) {
|
if (bottom > window.innerHeight) {
|
||||||
window.scrollBy(0, bottom - window.innerHeight);
|
window.scrollBy(0, bottom - window.innerHeight);
|
||||||
@ -124,34 +126,148 @@ function setupVideo(thumb, url) {
|
|||||||
|
|
||||||
// Hovering over thumbnail displays video
|
// Hovering over thumbnail displays video
|
||||||
thumb.addEventListener("mouseover", function(e) {
|
thumb.addEventListener("mouseover", function(e) {
|
||||||
if (setting("videohover")) {
|
if (setting("videohover")) {
|
||||||
getVideo();
|
getVideo();
|
||||||
expanded = false;
|
expanded = false;
|
||||||
hovering = true;
|
hovering = true;
|
||||||
|
|
||||||
|
var vidName = video.src.split('/').pop().split(".").shift();
|
||||||
|
var isMod = (window.location.pathname.split("/")[1]=="mod.php");
|
||||||
|
var thisBoard = isMod?window.location.href.split("/")[4]:window.location.pathname.split("/")[1];
|
||||||
|
var pageType = window.active_page;
|
||||||
|
var pageURL = isMod?window.location.href:window.location.pathname;
|
||||||
|
var jsonURL;
|
||||||
|
var thisThread;
|
||||||
|
var thisPost;
|
||||||
|
console.log("vidName = "+vidName);
|
||||||
|
|
||||||
|
if (pageType==="thread") {
|
||||||
|
jsonURL = pageURL.replace(/\.html$/, ".json");
|
||||||
|
} else
|
||||||
|
if (pageType==="index"){
|
||||||
|
var thisPage = isMod?window.location.href.split("/")[5].split(".")[0]:window.location.pathname.split("/")[2].split(".")[0];
|
||||||
|
if (thisPage=="index") { thisPage="0"; } else { thisPage-=1;}
|
||||||
|
jsonURL = pageURL.replace(/[a-z0-9]+.html$/, thisPage+".json");
|
||||||
|
}
|
||||||
|
|
||||||
var docRight = document.documentElement.getBoundingClientRect().right;
|
$.getJSON(jsonURL, function (thread) {
|
||||||
var thumbRight = thumb.querySelector("img, video").getBoundingClientRect().right;
|
$this = thread;
|
||||||
var maxWidth = docRight - thumbRight - 20;
|
if(typeof thread.threads != "undefined" && thread.threads != null && thread.threads.length > 0){
|
||||||
if (maxWidth < 250) maxWidth = 250;
|
|
||||||
|
|
||||||
video.style.position = "fixed";
|
var vidX = e.clientX;
|
||||||
video.style.right = "0px";
|
var vidY = e.clientY;
|
||||||
video.style.top = "0px";
|
var windowWidth = $(window).width();
|
||||||
var docRight = document.documentElement.getBoundingClientRect().right;
|
var windowHeight = $(window).height();
|
||||||
var thumbRight = thumb.querySelector("img, video").getBoundingClientRect().right;
|
var vidWidth = windowWidth - vidX;
|
||||||
video.style.maxWidth = maxWidth + "px";
|
var vidHeight = windowHeight - vidY;
|
||||||
video.style.maxHeight = "100%";
|
var vidAspect = vidHeight / vidWidth;
|
||||||
video.style.pointerEvents = "none";
|
|
||||||
|
|
||||||
video.style.display = "inline";
|
var totalWidth = windowWidth - vidX;
|
||||||
videoHide.style.display = "none";
|
var totalHeight = totalWidth*vidAspect;
|
||||||
videoContainer.style.display = "inline";
|
var maxWidth = totalWidth - 20;
|
||||||
videoContainer.style.position = "fixed";
|
if (maxWidth < 250) { maxWidth = 250; }
|
||||||
|
var maxHeight = maxWidth * vidAspect;
|
||||||
|
var vidTop = vidY;
|
||||||
|
var vidBottom;
|
||||||
|
var vidRight;
|
||||||
|
|
||||||
video.muted = (setting("videovolume") == 0);
|
if (vidWidth > windowWidth) {
|
||||||
video.volume = setting("videovolume");
|
video.style.maxWidth = maxWidth+"px";
|
||||||
video.controls = false;
|
video.style.maxHeight = maxHeight+"px";
|
||||||
video.play();
|
vidBottom = vidTop + maxHeight;
|
||||||
|
vidRight = vidX+maxWidth - 20;
|
||||||
|
} else {
|
||||||
|
video.style.maxWidth = vidWidth+"px";
|
||||||
|
video.style.maxHeight = vidHeight+"px";
|
||||||
|
vidBottom = vidTop + vidHeight;
|
||||||
|
vidRight = vidX+vidWidth - 20;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (vidBottom > windowHeight) { vidTop -= vidBottom-windowHeight; }
|
||||||
|
videoContainer.style.position = "fixed";
|
||||||
|
videoContainer.style.display = "block";
|
||||||
|
videoHide.style.display = "none";
|
||||||
|
if (vidRight > windowWidth) {
|
||||||
|
video.style.left = vidX-(vidRight-windowWidth)+"px";
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
video.style.left = vidX+"px";
|
||||||
|
}
|
||||||
|
video.style.top = vidTop+"px";
|
||||||
|
video.style.pointerEvents = "none";
|
||||||
|
video.style.display = "block";
|
||||||
|
video.style.position = "fixed";
|
||||||
|
video.muted = (setting("videovolume") == 0);
|
||||||
|
video.volume = setting("videovolume");
|
||||||
|
video.controls = false;
|
||||||
|
video.play();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
|
||||||
|
$.each($this.posts, function(){
|
||||||
|
var tim = this.tim;
|
||||||
|
var fileNum = vidName.split('-').pop();
|
||||||
|
if(typeof this.extra_files != "undefined" && this.extra_files != null && this.extra_files.length > 0){
|
||||||
|
$.each(this.extra_files, function() {
|
||||||
|
if (vidName==this.tim){
|
||||||
|
tim = this.tim;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (vidName==tim) {
|
||||||
|
var vidX = e.clientX;
|
||||||
|
var vidY = e.clientY;
|
||||||
|
var vidWidth = this.w;
|
||||||
|
var vidHeight = this.h;
|
||||||
|
var vidAspect = vidHeight / vidWidth;
|
||||||
|
var windowWidth = $(window).width();
|
||||||
|
var windowHeight = $(window).height();
|
||||||
|
var totalWidth = windowWidth - vidX;
|
||||||
|
var totalHeight = totalWidth*vidAspect;
|
||||||
|
var maxWidth = totalWidth - 20;
|
||||||
|
if (maxWidth < 250) { maxWidth = 250; }
|
||||||
|
var maxHeight = maxWidth * vidAspect;
|
||||||
|
var vidTop = vidY;
|
||||||
|
var vidBottom;
|
||||||
|
var vidRight;
|
||||||
|
if (vidWidth > windowWidth) {
|
||||||
|
video.style.maxWidth = maxWidth+"px";
|
||||||
|
video.style.maxHeight = maxHeight+"px";
|
||||||
|
vidBottom = vidTop + maxHeight;
|
||||||
|
vidRight = maxWidth+vidX;
|
||||||
|
} else {
|
||||||
|
video.style.maxWidth = vidWidth+"px";
|
||||||
|
video.style.maxHeight = vidHeight+"px";
|
||||||
|
vidBottom = vidTop + vidHeight;
|
||||||
|
vidRight = vidWidth+vidX;
|
||||||
|
}
|
||||||
|
if (vidBottom > windowHeight) {
|
||||||
|
vidTop -= vidBottom-windowHeight;
|
||||||
|
}
|
||||||
|
|
||||||
|
videoContainer.style.position = "fixed";
|
||||||
|
videoContainer.style.display = "block";
|
||||||
|
|
||||||
|
videoHide.style.display = "none";
|
||||||
|
|
||||||
|
if (vidRight > windowWidth) {
|
||||||
|
video.style.left = vidX-(vidRight-windowWidth)+"px";
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
video.style.left = vidX+"px";
|
||||||
|
}
|
||||||
|
video.style.top = vidTop+"px";
|
||||||
|
video.style.pointerEvents = "none";
|
||||||
|
video.style.display = "block";
|
||||||
|
video.style.position = "fixed";
|
||||||
|
video.muted = (setting("videovolume") == 0);
|
||||||
|
video.volume = setting("videovolume");
|
||||||
|
video.controls = false;
|
||||||
|
video.play();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} //else*/
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}, false);
|
}, false);
|
||||||
|
|
||||||
@ -241,4 +357,3 @@ onready(function(){
|
|||||||
observer.observe(document.body, {childList: true, subtree: true});
|
observer.observe(document.body, {childList: true, subtree: true});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
if (active_page === 'thread' || active_page === 'index') {
|
if (active_page === 'thread' || active_page === 'index' || active_page === 'catalog') {
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
'use strict';
|
'use strict';
|
||||||
// returns blacklist object from storage
|
// returns blacklist object from storage
|
||||||
@ -408,13 +408,13 @@ if (active_page === 'thread' || active_page === 'index') {
|
|||||||
if (!forcedAnon && hasTrip)
|
if (!forcedAnon && hasTrip)
|
||||||
trip = $post.find('.trip').text();
|
trip = $post.find('.trip').text();
|
||||||
if (hasSub)
|
if (hasSub)
|
||||||
subject = ' '+ $post.find('.subject').text() +' ';
|
subject = $post.find('.subject').text();
|
||||||
|
|
||||||
array = $post.find('.body').contents().filter(function () {if ($(this).text() !== '') return true;}).toArray();
|
array = $post.find('.body').contents().filter(function () {if ($(this).text() !== '') return true;}).toArray();
|
||||||
array = $.map(array, function (ele) {
|
array = $.map(array, function (ele) {
|
||||||
return $(ele).text();
|
return $(ele).text();
|
||||||
});
|
});
|
||||||
comment = ' '+ array.join(' ') +' ';
|
comment = array.join(' ');
|
||||||
|
|
||||||
|
|
||||||
for (i = 0, length = list.generalFilter.length; i < length; i++) {
|
for (i = 0, length = list.generalFilter.length; i < length; i++) {
|
||||||
@ -430,7 +430,7 @@ if (active_page === 'thread' || active_page === 'index') {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'trip':
|
case 'trip':
|
||||||
if (!forcedAnon && pattern.test(trip)) {
|
if (!forcedAnon && hasTrip && pattern.test(trip)) {
|
||||||
$post.data('hiddenByTrip', true);
|
$post.data('hiddenByTrip', true);
|
||||||
hide(post);
|
hide(post);
|
||||||
}
|
}
|
||||||
@ -463,13 +463,15 @@ if (active_page === 'thread' || active_page === 'index') {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'sub':
|
case 'sub':
|
||||||
if (hasSub && subject.indexOf(' '+ rule.value +' ') != -1) {
|
pattern = new RegExp('\\b'+ rule.value+ '\\b');
|
||||||
|
if (hasSub && pattern.test(subject)) {
|
||||||
$post.data('hiddenBySubject', true);
|
$post.data('hiddenBySubject', true);
|
||||||
hide(post);
|
hide(post);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'com':
|
case 'com':
|
||||||
if (comment.indexOf(' '+ rule.value +' ') != -1) {
|
pattern = new RegExp('\\b'+ rule.value+ '\\b');
|
||||||
|
if (pattern.test(comment)) {
|
||||||
$post.data('hiddenByComment', true);
|
$post.data('hiddenByComment', true);
|
||||||
hide(post);
|
hide(post);
|
||||||
}
|
}
|
||||||
@ -502,43 +504,63 @@ if (active_page === 'thread' || active_page === 'index') {
|
|||||||
function filterPage(pageData) {
|
function filterPage(pageData) {
|
||||||
var list = getList();
|
var list = getList();
|
||||||
|
|
||||||
// empty the local and no-reply list
|
if (active_page != 'catalog') {
|
||||||
pageData.localList = [];
|
|
||||||
pageData.noReplyList = [];
|
|
||||||
|
|
||||||
$('.thread').each(function () {
|
// empty the local and no-reply list
|
||||||
var $thread = $(this);
|
pageData.localList = [];
|
||||||
// disregard the hidden threads constructed by post-hover.js
|
pageData.noReplyList = [];
|
||||||
if ($thread.css('display') == 'none')
|
|
||||||
|
$('.thread').each(function () {
|
||||||
|
var $thread = $(this);
|
||||||
|
// disregard the hidden threads constructed by post-hover.js
|
||||||
|
if ($thread.css('display') == 'none')
|
||||||
|
return;
|
||||||
|
|
||||||
|
var threadId = $thread.attr('id').replace('thread_', '');
|
||||||
|
var op = $thread.children('.op')[0];
|
||||||
|
var i, array; // temp variables
|
||||||
|
|
||||||
|
// add posts to localList and noReplyList
|
||||||
|
if (typeof list.postFilter[pageData.boardId] != 'undefined' && typeof list.postFilter[pageData.boardId][threadId] != 'undefined') {
|
||||||
|
array = list.postFilter[pageData.boardId][threadId];
|
||||||
|
for (i=0; i<array.length; i++) {
|
||||||
|
if ( typeof array[i].post == 'undefined')
|
||||||
|
continue;
|
||||||
|
|
||||||
|
pageData.localList.push(array[i].post);
|
||||||
|
if (array[i].hideReplies) pageData.noReplyList.push(array[i].post);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// run filter on OP
|
||||||
|
filter(op, threadId, pageData);
|
||||||
|
quickToggle(op, threadId, pageData);
|
||||||
|
|
||||||
|
// iterate filter over each post
|
||||||
|
if (!$(op).data('hidden') || active_page == 'thread') {
|
||||||
|
$thread.find('.reply').not('.hidden').each(function () {
|
||||||
|
filter(this, threadId, pageData);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
var postFilter = list.postFilter[pageData.boardId];
|
||||||
|
var $collection = $('.mix');
|
||||||
|
|
||||||
|
if ($.isEmptyObject(postFilter))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var threadId = $thread.attr('id').replace('thread_', '');
|
// for each thread that has filtering rules
|
||||||
var op = $thread.children('.op')[0];
|
// check if filter contains thread OP and remove the thread from catalog
|
||||||
var i, array; // temp variables
|
$.each(postFilter, function (key, thread) {
|
||||||
|
var threadId = key;
|
||||||
// add posts to localList and noReplyList
|
$.each(thread, function () {
|
||||||
if (typeof list.postFilter[pageData.boardId] != 'undefined' && typeof list.postFilter[pageData.boardId][threadId] != 'undefined') {
|
if (this.post == threadId) {
|
||||||
array = list.postFilter[pageData.boardId][threadId];
|
$collection.filter('[data-id='+ threadId +']').remove();
|
||||||
for (i=0; i<array.length; i++) {
|
}
|
||||||
if ( typeof array[i].post == 'undefined')
|
|
||||||
continue;
|
|
||||||
|
|
||||||
pageData.localList.push(array[i].post);
|
|
||||||
if (array[i].hideReplies) pageData.noReplyList.push(array[i].post);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// run filter on OP
|
|
||||||
filter(op, threadId, pageData);
|
|
||||||
quickToggle(op, threadId, pageData);
|
|
||||||
|
|
||||||
// iterate filter over each post
|
|
||||||
if (!$(op).data('hidden') || active_page == 'thread') {
|
|
||||||
$thread.find('.reply').not('.hidden').each(function () {
|
|
||||||
filter(this, threadId, pageData);
|
|
||||||
});
|
});
|
||||||
}
|
});
|
||||||
|
}
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function initStyle() {
|
function initStyle() {
|
||||||
@ -592,17 +614,17 @@ if (active_page === 'thread' || active_page === 'index') {
|
|||||||
|
|
||||||
$row = $('<tr>');
|
$row = $('<tr>');
|
||||||
$row.append(
|
$row.append(
|
||||||
'<td>'+ typeName[obj.type] +'</td>',
|
'<td>'+ typeName[obj.type] +'</td>',
|
||||||
'<td>'+ val +'</td>',
|
'<td>'+ val +'</td>',
|
||||||
$('<td>').append(
|
$('<td>').append(
|
||||||
$('<a>').html('X')
|
$('<a>').html('X')
|
||||||
.addClass('del-btn')
|
.addClass('del-btn')
|
||||||
.attr('href', '#')
|
.attr('href', '#')
|
||||||
.data('type', obj.type)
|
.data('type', obj.type)
|
||||||
.data('val', obj.value)
|
.data('val', obj.value)
|
||||||
.data('useRegex', obj.regex)
|
.data('useRegex', obj.regex)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
$ele.append($row);
|
$ele.append($row);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -754,33 +776,6 @@ if (active_page === 'thread' || active_page === 'index') {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
|
||||||
* Migrate from previous version of post filter
|
|
||||||
* Remember to remove next time anyone touches this file
|
|
||||||
*/
|
|
||||||
(function () {
|
|
||||||
var list = getList();
|
|
||||||
if (typeof list.nameFilter != 'undefined') {
|
|
||||||
var filter = list.nameFilter;
|
|
||||||
list.generalFilter = [];
|
|
||||||
|
|
||||||
for (var i = 0; i < filter.length; i++) {
|
|
||||||
var obj = filter[i];
|
|
||||||
for (var key in obj) {
|
|
||||||
list.generalFilter.push({
|
|
||||||
type: key,
|
|
||||||
value: obj[key],
|
|
||||||
regex: false
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
delete list.nameFilter;
|
|
||||||
localStorage.postFilter = JSON.stringify(list);
|
|
||||||
}
|
|
||||||
})();
|
|
||||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
|
||||||
|
|
||||||
var pageData = {
|
var pageData = {
|
||||||
boardId: board_name, // get the id from the global variable
|
boardId: board_name, // get the id from the global variable
|
||||||
localList: [], // all the blacklisted post IDs or UIDs that apply to the current page
|
localList: [], // all the blacklisted post IDs or UIDs that apply to the current page
|
||||||
@ -812,6 +807,17 @@ if (active_page === 'thread' || active_page === 'index') {
|
|||||||
filterPage(pageData);
|
filterPage(pageData);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// shift+click on catalog to hide thread
|
||||||
|
if (active_page == 'catalog') {
|
||||||
|
$(document).on('click', '.mix', function(e) {
|
||||||
|
if (e.shiftKey) {
|
||||||
|
var threadId = $(this).data('id');
|
||||||
|
var postId = threadId;
|
||||||
|
blacklist.add.post(pageData.boardId, threadId, postId, false);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// clear out the old threads
|
// clear out the old threads
|
||||||
purge();
|
purge();
|
||||||
}
|
}
|
||||||
|
@ -115,7 +115,7 @@
|
|||||||
#quick-reply td.recaptcha-response {\
|
#quick-reply td.recaptcha-response {\
|
||||||
padding: 0 0 1px 0;\
|
padding: 0 0 1px 0;\
|
||||||
}\
|
}\
|
||||||
@media screen and (max-width: 600px) {\
|
@media screen and (max-width: 400px) {\
|
||||||
#quick-reply {\
|
#quick-reply {\
|
||||||
display: none !important;\
|
display: none !important;\
|
||||||
}\
|
}\
|
||||||
@ -369,7 +369,7 @@
|
|||||||
$(window).ready(function() {
|
$(window).ready(function() {
|
||||||
if (settings.get('hide_at_top', true)) {
|
if (settings.get('hide_at_top', true)) {
|
||||||
$(window).scroll(function() {
|
$(window).scroll(function() {
|
||||||
if ($(this).width() <= 600)
|
if ($(this).width() <= 400)
|
||||||
return;
|
return;
|
||||||
if ($(this).scrollTop() < $origPostForm.offset().top + $origPostForm.height() - 100)
|
if ($(this).scrollTop() < $origPostForm.offset().top + $origPostForm.height() - 100)
|
||||||
$postForm.fadeOut(100);
|
$postForm.fadeOut(100);
|
||||||
@ -391,7 +391,7 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
$(window).on('cite', function(e, id, with_link) {
|
$(window).on('cite', function(e, id, with_link) {
|
||||||
if ($(this).width() <= 600)
|
if ($(this).width() <= 400)
|
||||||
return;
|
return;
|
||||||
show_quick_reply();
|
show_quick_reply();
|
||||||
if (with_link) {
|
if (with_link) {
|
||||||
@ -446,7 +446,7 @@
|
|||||||
$('.quick-reply-btn').hide();
|
$('.quick-reply-btn').hide();
|
||||||
|
|
||||||
$(window).scroll(function() {
|
$(window).scroll(function() {
|
||||||
if ($(this).width() <= 600)
|
if ($(this).width() <= 400)
|
||||||
return;
|
return;
|
||||||
if ($(this).scrollTop() < $('form[name="post"]:first').offset().top + $('form[name="post"]:first').height() - 100)
|
if ($(this).scrollTop() < $('form[name="post"]:first').offset().top + $('form[name="post"]:first').height() - 100)
|
||||||
$('.quick-reply-btn').fadeOut(100);
|
$('.quick-reply-btn').fadeOut(100);
|
||||||
|
4
post.php
4
post.php
@ -406,6 +406,10 @@ elseif (isset($_POST['post'])) {
|
|||||||
error('Sorry. Tor users can\'t upload files.');
|
error('Sorry. Tor users can\'t upload files.');
|
||||||
if ($tor && !$config['tor_posting'])
|
if ($tor && !$config['tor_posting'])
|
||||||
error('Sorry. The owner of this board has decided not to allow Tor posters for some reason...');
|
error('Sorry. The owner of this board has decided not to allow Tor posters for some reason...');
|
||||||
|
|
||||||
|
if ($post['has_file'] && $config['disable_images']) {
|
||||||
|
error($config['error']['images_disabled']);
|
||||||
|
}
|
||||||
|
|
||||||
if (!($post['has_file'] || isset($post['embed'])) || (($post['op'] && $config['force_body_op']) || (!$post['op'] && $config['force_body']))) {
|
if (!($post['has_file'] || isset($post['embed'])) || (($post['op'] && $config['force_body_op']) || (!$post['op'] && $config['force_body']))) {
|
||||||
// http://stackoverflow.com/a/4167053
|
// http://stackoverflow.com/a/4167053
|
||||||
|
Loading…
Reference in New Issue
Block a user