This commit is contained in:
8chan 2014-12-31 22:26:23 -08:00
commit 96284a4512
11 changed files with 108 additions and 30 deletions

View File

@ -689,7 +689,7 @@ msgstr ""
msgid "You seem to have mistyped the verification."
msgstr ""
#. Moderator errors
#. Volunteer errors
#: ../../../../inc/config.php:906 ../../../../inc/config.php:1011
#: ../../../../inc/config.php:1002 ../../../../inc/config.php:1004
#: ../../../../inc/config.php:1006 ../../../../inc/config.php:1022
@ -879,7 +879,7 @@ msgstr ""
#: ../../../../inc/mod/pages.php:671 ../../../../inc/mod/pages.php:698
#: ../../../../templates/cache/72/7e/271125664718133518fd942f20fb724224e100f8a0d47cb0b52f895ac12f.php:300
#: ../../../../templates/cache/73/f8/5e3142a8a6f8d7e40422ff577e83b0dedf55a7cb9bc7082839b24f653545.php:75
msgid "Moderation log"
msgid "Volunteer log"
msgstr ""
#. line 104
@ -3489,7 +3489,7 @@ msgid "There are no active posts."
msgstr ""
#: ../../../../templates/cache/ba/55/2553cc018aecf7d29a62331aec4bedc71b646817c7e4c4e7d1a885263676.php:49
msgid "Show only bans from boards I moderate"
msgid "Show only bans from boards I volunteer on"
msgstr ""
#: ../../../../templates/cache/ba/55/2553cc018aecf7d29a62331aec4bedc71b646817c7e4c4e7d1a885263676.php:55

View File

@ -1599,6 +1599,8 @@ function mod_edit_post($board, $edit_raw_html, $postID) {
error($config['error']['404']);
if (isset($_POST['name'], $_POST['email'], $_POST['subject'], $_POST['body'])) {
$trip = isset($_POST['remove_trip']) ? ' `trip` = NULL,' : '';
// Remove any modifiers they may have put in
$_POST['body'] = remove_modifiers($_POST['body']);
@ -1609,11 +1611,11 @@ function mod_edit_post($board, $edit_raw_html, $postID) {
}
if ($edit_raw_html)
$query = prepare(sprintf('UPDATE ``posts_%s`` SET `name` = :name, `email` = :email, `subject` = :subject, `body` = :body, `body_nomarkup` = :body_nomarkup, `edited_at` = NOW() WHERE `id` = :id', $board));
$query = prepare(sprintf('UPDATE ``posts_%s`` SET `name` = :name,'. $trip .' `email` = :email, `subject` = :subject, `body` = :body, `body_nomarkup` = :body_nomarkup, `edited_at` = NOW() WHERE `id` = :id', $board));
else
$query = prepare(sprintf('UPDATE ``posts_%s`` SET `name` = :name, `email` = :email, `subject` = :subject, `body_nomarkup` = :body, `edited_at` = NOW() WHERE `id` = :id', $board));
$query = prepare(sprintf('UPDATE ``posts_%s`` SET `name` = :name,'. $trip .' `email` = :email, `subject` = :subject, `body_nomarkup` = :body, `edited_at` = NOW() WHERE `id` = :id', $board));
$query->bindValue(':id', $postID);
$query->bindValue('name', $_POST['name']);
$query->bindValue(':name', $_POST['name'] ? $_POST['name'] : $config['anonymous']);
$query->bindValue(':email', $_POST['email']);
$query->bindValue(':subject', $_POST['subject']);
$query->bindValue(':body', $_POST['body']);

35
js/disable-styles.js Normal file
View File

@ -0,0 +1,35 @@
/* Adds a checkbox in the General options tab to disable and enable board style sheets. */
$(document).ready(function () {
var disableStyles = localStorage['disablestylesheet'] ? true : false;
/* only search for and disable board stylesheets if the user is on a page that uses them */
if(active_page == 'ukko' || active_page == 'thread' || active_page == 'index' || active_page == 'catalog')
{
var i = 0
while(i<document.styleSheets.length) {
var protAndHost = window.location.protocol + '//' + window.location.host
if(document.styleSheets[i].href == protAndHost + $('link[id="stylesheet"]').attr('href'))
{
var sheet = i
document.styleSheets[sheet].disabled = disableStyles
break
}
i++
}
}
/* add the option on all pages so that the user doesn't need to goto a board to toggle it */
if (window.Options && Options.get_tab('general')){
Options.extend_tab('general','<label id=\'disablestyle\'><input type=\'checkbox\' />' + ' Disable board specific style sheets' + '</label>')
$('#disablestyle').find('input').prop('checked', disableStyles)
}
$('#disablestyle').on('change', function() {
if(disableStyles) {
delete localStorage.disablestylesheet
} else {
localStorage.disablestylesheet = true
}
disableStyles =! disableStyles
if(active_page == 'ukko' || active_page == 'thread' || active_page == 'index' || active_page == 'catalog') document.styleSheets[sheet].disabled = disableStyles
})
})

View File

@ -56,7 +56,6 @@ if (active_page == 'thread' || active_page == 'index' || active_page == 'catalog
$(document).ready(function(){
var favorites = JSON.parse(localStorage.favorites);
var is_board_favorite = ~$.inArray(board_name, favorites);
console.log(is_board_favorite);
$('header>h1').append('<a id="favorite-star" href="#" data-active="'+(is_board_favorite ? 'true' : 'false')+'" style="color: '+(is_board_favorite ? 'yellow' : 'grey')+'; text-decoration:none">\u2605</span>');
add_favorites();

View File

@ -19,7 +19,7 @@ onready(function(){
for (var i = 0; i < link.length; i++) {
if (typeof link[i] == "object" && link[i].childNodes && typeof link[i].childNodes[0] !== 'undefined' && link[i].childNodes[0].src && link[i].childNodes[0].className.match(/post-image/) && !link[i].className.match(/file/)) {
link[i].onclick = function(e) {
var img, post_body, still_open;
var img, post_body, still_open, canvas;
var thumb = this.childNodes[0];
var padding = 5;
var boardlist = $('.boardlist')[0];
@ -43,8 +43,10 @@ onready(function(){
this.dataset.expanded = 'true';
if (thumb.tagName === 'CANVAS') {
this.removeChild(thumb);
thumb.style.display = 'block';
canvas = thumb;
thumb = thumb.nextSibling;
this.removeChild(canvas);
canvas.style.display = 'block';
}
thumb.style.opacity = '0.4';
@ -72,10 +74,10 @@ onready(function(){
if (still_open > 1) {
if (e.target.getBoundingClientRect().top - padding < 0)
$('body').scrollTop($(e.target).parent().parent().offset().top - padding);
$(document).scrollTop($(e.target).parent().parent().offset().top - padding);
} else {
if (post_body[0].getBoundingClientRect().top - padding < 0)
$('body').scrollTop(post_body.offset().top - padding);
$(document).scrollTop(post_body.offset().top - padding);
}
}

View File

@ -73,6 +73,7 @@ onready(function(){
.css('font-style', 'normal')
.css('z-index', '100')
.css('left', '0')
.css('margin-left', '')
.addClass('reply').addClass('post')
.appendTo(link.closest('div.post'))

View File

@ -41,7 +41,8 @@ onready(function(){
var $link = $('<a class="mentioned-' + reply_id + '" onclick="highlightReply(\'' + reply_id + '\');" href="#' + reply_id + '">&gt;&gt;' +
reply_id + '</a>');
$link.appendTo($mentioned)
$link.appendTo($mentioned);
$link.after(" ");
if (window.init_hover) {
$link.each(init_hover);

View File

@ -50,9 +50,12 @@ $(document).ready(function(){
ids[opID] = 0;
}
ids[opID]++;
var cur = op.find('>.intro >.poster_id');
cur.find('+.posts_by_id').remove();
cur.after('<span class="posts_by_id"> ('+ ids[cur.text()] +')</span>');
replies.each(function(){
var cur = $(this).find('> .intro > .poster_id');
cur.find('+ .posts_by_id').remove();
cur = $(this).find('>.intro >.poster_id');
cur.find('+.posts_by_id').remove();
cur.after('<span class="posts_by_id"> ('+ ids[cur.text()] +')</span>');
});
var size = function(obj) {

View File

@ -11,14 +11,28 @@
*
*/
if (active_page == 'thread' || active_page == 'ukko' || active_page == 'index')
$(function() {
if (window.Options && Options.get_tab('general')) {
var selector = '#treeview-global>input';
Options.extend_tab("general", "<label id='treeview-global'><input type='checkbox' /> "+_('Use tree view by default')+"</label>");
$(selector).on('change', function() {
if (localStorage.treeview === 'true') {
localStorage.treeview = 'false';
} else {
localStorage.treeview = 'true';
}
});
if (localStorage.treeview === 'true') {
$(selector).attr('checked', 'checked');
}
}
});
if (active_page == 'thread')
$(function() {
$('hr:first').before('<div id="treeview" style="text-align:right"><a class="unimportant" href="javascript:void(0)"></a></div>');
$('div#treeview a')
.text(_('Tree view'))
.click(function(e) {
e.preventDefault();
var treeview = function(enable) {
if (enable === true) {
$('.post.reply').each(function(){
var references = [];
$(this).find('.body a').each(function(){
@ -26,7 +40,6 @@ $(function() {
references.push(parseInt($(this).html().replace('&gt;&gt;', '')));
}
});
var maxref = references.reduce(function(a,b) { return a > b ? a : b; }, 0);
var parent_post = $("#reply_"+maxref);
@ -39,7 +52,24 @@ $(function() {
post.detach().css("margin-left", margin).insertAfter(parent_post.next());
br.detach().insertAfter(post);
});
});
} else {
$('.post.reply').sort(function(a,b) {
return parseInt(a.id.replace('reply_', '')) - parseInt(b.id.replace('reply_', ''));
}).each(function () {
var post = $(this);
var br = post.next();
post.detach().css('margin-left', '').appendTo('.thread');
br.detach().insertAfter(post);
});
}
}
$('hr:first').before('<div class="unimportant" style="text-align:right"><label for="treeview"><input type="checkbox" id="treeview"> '+_('Tree view')+'</label></div>');
$('input#treeview').on('change', function(e) { treeview($(this).is(':checked')); });
if (localStorage.treeview === 'true') {
treeview(true);
$('input#treeview').attr('checked', true);
}
});

View File

@ -257,7 +257,7 @@ p.intro span.capcode,p.intro a.capcode,p.intro a.nametag {
}
p.intro a {
margin-left: 8px;
margin-left: 5px;
}
div.delete {
@ -858,7 +858,7 @@ pre {
#options_div {
width: 600px;
height: 300px;
height: 320px;
}
#alert_div {
@ -925,6 +925,7 @@ pre {
right: 0px;
text-align: left;
font-size: 12px;
overflow-y: auto;
}
.options_tab h2 {
@ -939,10 +940,6 @@ pre {
margin-top: 0px;
}
.mentioned {
word-wrap: break-word;
}
.poster_id {
cursor: pointer;
}

View File

@ -10,6 +10,14 @@
<input type="text" name="name" size="25" maxlength="35" autocomplete="off" value="{{ post.name }}">
</td>
</tr>
<tr>
<th>
{% trans %}Tripcode{% endtrans %}
</th>
<td>
Remove? <input type="checkbox" name="remove_trip" value="{{ post.trip }}">
</td>
</tr>
<tr>
<th>
{% trans %}Email{% endtrans %}