Browse Source

Javascript ammendments, dio_ on Windows.

Signed-off-by: 8n-tech <[email protected]>
pull/40/head
8n-tech 9 years ago
committed by czaks
parent
commit
e64b01b690
  1. 10
      js/fix-report-delete-submit.js
  2. 9
      js/infinite-scroll.js
  3. 9
      js/post-filter.js
  4. 6
      js/post-menu.js
  5. 3
      stylesheets/style.css

10
js/fix-report-delete-submit.js

@ -9,9 +9,10 @@
*/ */
if (active_page == 'thread' || active_page == 'index') { if (active_page == 'thread' || active_page == 'index') {
$(document).ready(function(){ $(document).on('menu_ready', function(){
if ($('#delete-fields #password').length) { if ($('#delete-fields #password').length) {
var Menu = window.Menu;
Menu.add_item("delete_post_menu", _("Delete post")); Menu.add_item("delete_post_menu", _("Delete post"));
Menu.add_item("delete_file_menu", _("Delete file")); Menu.add_item("delete_file_menu", _("Delete file"));
Menu.onclick(function(e, $buf) { Menu.onclick(function(e, $buf) {
@ -57,4 +58,9 @@ $(document).on('new_post', function(){
}); });
$('input.delete').hide(); $('input.delete').hide();
$('#post-moderation-fields').hide(); $('#post-moderation-fields').hide();
})} });
if (typeof window.Menu !== "undefined") {
$(document).trigger('menu_ready');
}
}

9
js/infinite-scroll.js

@ -45,13 +45,13 @@ var load_next_page = function() {
if (!href) return; if (!href) return;
var boardheader = $('<h2>'+_('Page')+' '+next_page.html()+'</h2>'); var boardheader = $('<h2>'+_('Page')+' '+next_page.html()+'</h2>');
var loading_ind = $('<h2>'+_('Loading...')+'</h2>').insertBefore('form[name="postcontrols"]>.delete:first'); var loading_ind = $('<h2>'+_('Loading...')+'</h2>').insertBefore('#post-moderation-fields');
$.get(href, function(data) { $.get(href, function(data) {
var doc = $(data); var doc = $(data);
loading_ind.remove(); loading_ind.remove();
boardheader.insertBefore('form[name="postcontrols"]>.delete:first'); boardheader.insertBefore('#post-moderation-fields');
var i = 0; var i = 0;
@ -62,13 +62,15 @@ var load_next_page = function() {
if ($('div#thread_' + checkout).length == 0) { if ($('div#thread_' + checkout).length == 0) {
// Delay DOM insertion to lessen the lag. // Delay DOM insertion to lessen the lag.
setTimeout(function() { setTimeout(function() {
$($this).insertBefore('form[name="postcontrols"]>.delete:first'); $($this).insertBefore('#post-moderation-fields');
$(document).trigger('new_post', $this); $(document).trigger('new_post', $this);
$($this).hide().slideDown(); $($this).hide().slideDown();
}, 500*i); }, 500*i);
i++; i++;
} }
}); });
setTimeout(function() { setTimeout(function() {
loading = false; loading = false;
scrolltest(); scrolltest();
@ -76,7 +78,6 @@ var load_next_page = function() {
next_page.addClass('selected'); next_page.addClass('selected');
}); });
}; };
var button = $("<a href='#all'>"+_("All")+" </a>").prependTo(".pages"); var button = $("<a href='#all'>"+_("All")+" </a>").prependTo(".pages");

9
js/post-filter.js

@ -1,6 +1,7 @@
if (active_page === 'thread' || active_page === 'index' || active_page === 'catalog') { if (active_page === 'thread' || active_page === 'index' || active_page === 'catalog') {
$(document).ready(function () { $(document).on('menu_ready', function () {
'use strict'; 'use strict';
// returns blacklist object from storage // returns blacklist object from storage
function getList() { function getList() {
return JSON.parse(localStorage.postFilter); return JSON.parse(localStorage.postFilter);
@ -200,7 +201,7 @@ if (active_page === 'thread' || active_page === 'index' || active_page === 'cata
* create filter menu when the button is clicked * create filter menu when the button is clicked
*/ */
function initPostMenu(pageData) { function initPostMenu(pageData) {
var Menu = window.Menu;
var submenu; var submenu;
Menu.add_item('filter-menu-hide', _('Hide post')); Menu.add_item('filter-menu-hide', _('Hide post'));
Menu.add_item('filter-menu-unhide', _('Unhide post')); Menu.add_item('filter-menu-unhide', _('Unhide post'));
@ -836,4 +837,8 @@ if (active_page === 'thread' || active_page === 'index' || active_page === 'cata
} }
init(); init();
}); });
if (typeof window.Menu !== "undefined") {
$(document).trigger('menu_ready');
}
} }

6
js/post-menu.js

@ -26,7 +26,7 @@
* $config['additional_javascript'][] = 'js/jquery.min.js'; * $config['additional_javascript'][] = 'js/jquery.min.js';
* $config['additional_javascript'][] = 'js/post-menu.js'; * $config['additional_javascript'][] = 'js/post-menu.js';
*/ */
onready(function () { $(document).ready(function () {
var List = function (menuId, text) { var List = function (menuId, text) {
this.id = menuId; this.id = menuId;
@ -133,6 +133,8 @@ Menu.get_submenu = function (id) {
return mainMenu.get_submenu(id); return mainMenu.get_submenu(id);
}; };
window.Menu = Menu;
/* * * * * * * * /* * * * * * * *
Initialize Initialize
@ -205,5 +207,5 @@ $(document).on('new_post', function (e, post) {
addButton(post); addButton(post);
}); });
window.Menu = Menu; $(document).trigger('menu_ready');
}); });

3
stylesheets/style.css

@ -418,8 +418,9 @@ fieldset label {
div.pages { div.pages {
color: #89A; color: #89A;
background: #D6DAF0; background: #D6DAF0;
display: inline; display: inline-block;
padding: 8px; padding: 8px;
margin: 8px 0 4px 0;
border-right: 1px solid #B7C5D9; border-right: 1px solid #B7C5D9;
border-bottom: 1px solid #B7C5D9; border-bottom: 1px solid #B7C5D9;
} }

Loading…
Cancel
Save