Version 3.2.3
This commit is contained in:
1 parent
ae5c01cc78
commit
78706903a2
2641 files changed
+228363
-201264
No files matched your search
+74
-165
@@ -12,9 +12,7 @@ var _forums = window.IPBoard;
|
||||
_forums.prototype.forums = {
|
||||
totalChecked: 0,
|
||||
showMod: [],
|
||||
deletePerms: {},
|
||||
deleteUrls: {},
|
||||
deletePopUps: {},
|
||||
fetchMore: {},
|
||||
|
||||
init: function()
|
||||
{
|
||||
@@ -26,17 +24,9 @@ _forums.prototype.forums = {
|
||||
},
|
||||
initEvents: function()
|
||||
{
|
||||
// Find all moderation tools
|
||||
$$('ul.topic_moderation').each( function(mod){
|
||||
ipb.forums.setUpModeration( mod );
|
||||
});
|
||||
|
||||
//$('forum_table').observe( 'mouseout', ipb.forums.hideAllModeration );
|
||||
|
||||
if( $('show_filters') )
|
||||
{
|
||||
$('show_filters').observe('click', ipb.forums.toggleFilters );
|
||||
$('filter_form').hide();
|
||||
if( $('forum_load_more') ){
|
||||
$('forum_load_more').observe('click', ipb.forums.loadMore);
|
||||
$('more_topics').show();
|
||||
}
|
||||
|
||||
/* Set up mod checkboxes */
|
||||
@@ -46,24 +36,54 @@ _forums.prototype.forums = {
|
||||
$('tmod_all').observe( 'click', ipb.forums.checkAllTopics );
|
||||
}
|
||||
|
||||
$$('.topic_mod').each( function(check){
|
||||
check.observe( 'click', ipb.forums.checkTopic );
|
||||
} );
|
||||
|
||||
if( $('showforumJump') )
|
||||
if ( $("moderator_toggle") )
|
||||
{
|
||||
$('showforumJump').observe( "change", ipb.forums.jumpToForum );
|
||||
$('forum_jump_submit').hide();
|
||||
$("moderator_toggle").on( 'click', ipb.forums.openModPanel );
|
||||
}
|
||||
|
||||
ipb.delegate.register(".topic_mod", ipb.forums.checkTopic );
|
||||
ipb.delegate.register(".t_rename", ipb.forums.topicRename );
|
||||
},
|
||||
|
||||
jumpToForum: function(e)
|
||||
loadMore: function(e)
|
||||
{
|
||||
Event.stop(e);
|
||||
Event.stop(e);
|
||||
if( !ipb.forums.fetchMore ){ return; }
|
||||
|
||||
ipb.forums.fetchMore['st'] = parseInt(ipb.forums.fetchMore['st']) + parseInt(ipb.forums.fetchMore['max_topics']);
|
||||
|
||||
$('forum_jump').submit();
|
||||
|
||||
return false;
|
||||
var url = ipb.vars['base_url'] + "app=forums&module=ajax§ion=forums&do=getTopics&md5check="+ipb.vars['secure_hash'] + "&" + $H(ipb.forums.fetchMore).toQueryString();
|
||||
Debug.write( url );
|
||||
new Ajax.Request( url.replace(/&/g, '&'),
|
||||
{
|
||||
method: 'get',
|
||||
evalJSON: 'force',
|
||||
onSuccess: function(t){
|
||||
Debug.dir( t.responseJSON );
|
||||
if( t.responseJSON['topics'] == '' )
|
||||
{
|
||||
$('forum_load_more').replace("<span class='desc lighter'>"+ipb.lang['no_more_topics']+"</span>");
|
||||
return;
|
||||
}
|
||||
$$('tbody.dynamic_update').invoke("removeClassName", "dynamic_update");
|
||||
var newtbody = new Element("tbody", {'class': 'dynamic_update'});
|
||||
$('forum_table').select('tbody:last')[0].insert({ 'after': newtbody});
|
||||
newtbody.update( t.responseJSON['topics'] );
|
||||
$$('.pagination').invoke("replace", t.responseJSON['pages']);
|
||||
|
||||
// Tooltips
|
||||
$$("tbody.dynamic_update [data-tooltip]").invoke('tooltip');
|
||||
|
||||
// General click handlers
|
||||
$$("tbody.dynamic_update [data-clicklaunch]").invoke('clickLaunch');
|
||||
|
||||
if( t.responseJSON['topics'] == '' || t.responseJSON['hasMore'] == false)
|
||||
{
|
||||
$('forum_load_more').replace("<span class='desc lighter'>"+ipb.lang['no_more_topics']+"</span>");
|
||||
return;
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
submitModForm: function(e)
|
||||
@@ -82,121 +102,8 @@ _forums.prototype.forums = {
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
setUpModeration: function( mod )
|
||||
{
|
||||
cell = mod.up('td');
|
||||
mod.hide();
|
||||
mod.identify();
|
||||
|
||||
$( cell ).observe('mouseover', ipb.forums.showModeration);
|
||||
$( mod ).observe('mouseover', ipb.forums.moverModeration);
|
||||
$( mod ).observe('mouseout', ipb.forums.moutModeration);
|
||||
|
||||
$( mod ).observe('mouseover', function(e){
|
||||
$(mod).setStyle( { 'cursor': 'pointer' } );
|
||||
Event.stop(e);
|
||||
});
|
||||
$( mod ).observe('mouseout', function(e){
|
||||
Event.stop(e);
|
||||
});
|
||||
},
|
||||
|
||||
showModeration: function(e)
|
||||
{
|
||||
ipb.forums.hideAllModeration();
|
||||
elem = Event.findElement(e, 'td');
|
||||
|
||||
if( elem != document)
|
||||
{
|
||||
theUL = $( elem ).down('ul.topic_moderation');
|
||||
theUL.show().setOpacity( 0.3 );
|
||||
ipb.forums.showMod.push( theUL );
|
||||
|
||||
if( theUL.down('.t_rename') ){ $( theUL.down('.t_rename') ).observe( 'click', ipb.forums.topicRename ); }
|
||||
if( theUL.down('.t_delete') ){ $( theUL.down('.t_delete') ).observe( 'click', ipb.forums.topicDelete ); }
|
||||
}
|
||||
Event.stop(e);
|
||||
},
|
||||
|
||||
moverModeration: function(e)
|
||||
{
|
||||
elem = Event.element(e);
|
||||
if( !elem.hasClassName('topic_moderation') )
|
||||
{
|
||||
elem = elem.up('.topic_moderation');
|
||||
}
|
||||
|
||||
if ( $$('.__topic') )
|
||||
{
|
||||
ipb.global.topicPreviewShowIcon(e);
|
||||
}
|
||||
|
||||
elem.setStyle( { 'cursor': 'pointer' } ).setOpacity(1); // Fix the cursor
|
||||
//new Effect.Appear( $( elem ), {duration: 0.2} );
|
||||
},
|
||||
|
||||
moutModeration: function(e)
|
||||
{
|
||||
elem = Event.element(e);
|
||||
if( !elem.hasClassName('topic_moderation') )
|
||||
{
|
||||
elem = elem.up('.topic_moderation');
|
||||
}
|
||||
|
||||
if ( $$('.__topic') )
|
||||
{
|
||||
ipb.global.topicPreviewHideIcon(e);
|
||||
}
|
||||
|
||||
elem.setOpacity( 0.3 );
|
||||
},
|
||||
|
||||
topicDelete: function(e)
|
||||
{
|
||||
/* Right then */
|
||||
if ( ipb.forums.deletePerms['canDelete'] && ! ipb.forums.deletePerms['canSoftDelete'] )
|
||||
{
|
||||
/* Do the usual, sir */
|
||||
if( !confirm( ipb.lang['delete_topic_confirm'] ) )
|
||||
{
|
||||
Event.stop(e);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Event.stop(e);
|
||||
elem = Event.element(e);
|
||||
|
||||
var topicid = elem.up().id.replace( /t_deletelink_/, '' );
|
||||
|
||||
if( !topicid ){ return; }
|
||||
|
||||
/* First off, fix URLs */
|
||||
var _url_delete = ipb.forums.deleteUrls['hardDelete'].evaluate( { 'tid': topicid } ).replace(/&/g, '&') + '&nr=1';
|
||||
var _url_soft = ipb.forums.deleteUrls['softDelete'].evaluate( { 'tid': topicid } ).replace(/&/g, '&') + '&nr=1';
|
||||
var _permaShow = '';
|
||||
|
||||
/* Can we hard delete? */
|
||||
if ( ! ipb.forums.deletePerms['canDelete'] )
|
||||
{
|
||||
_permaShow = 'display:none;';
|
||||
}
|
||||
|
||||
/* Create the pop-up */
|
||||
var popid = 'pop__delete_popup_' + topicid;
|
||||
var content = new Template( $('delPopUp').innerHTML ).evaluate( { removeUrl: _url_soft, permaDelete: _permaShow, permaUrl: _url_delete } );
|
||||
|
||||
ipb.forums.deletePopUps = new ipb.Popup( popid, { type: 'balloon',
|
||||
initial: content,
|
||||
stem: true,
|
||||
hideAtStart: false,
|
||||
attach: { target: $('tid-link-' + topicid ), position: 'auto' },
|
||||
w: '450px' });
|
||||
}
|
||||
},
|
||||
|
||||
topicRename: function(e)
|
||||
|
||||
topicRename: function(e, elem)
|
||||
{
|
||||
if( DISABLE_AJAX ){
|
||||
return false;
|
||||
@@ -205,7 +112,7 @@ _forums.prototype.forums = {
|
||||
Event.stop(e);
|
||||
|
||||
// We need to find the topic concerned
|
||||
var link = Event.findElement(e, 'td').down('a.topic_title');
|
||||
var link = $(elem).up('.__topic').down('a.topic_title');
|
||||
if( $( link ).readAttribute('showingRename') == 'true' ){ return; }
|
||||
|
||||
// Create elements
|
||||
@@ -268,11 +175,6 @@ _forums.prototype.forums = {
|
||||
tid = elem.up('tr').id.replace( 'trow_', '' );
|
||||
} catch(err){ Debug.write( err ); return; }
|
||||
|
||||
//$('tid-link-' + tid ).update( $F('tid-link-' + tid + '_input' ) );
|
||||
//$('tid-link-' + tid + '_input').hide().remove();
|
||||
//$('tid-link-' + tid + '_save').hide().remove();
|
||||
//$('tid-link-' + tid).show();
|
||||
|
||||
new Ajax.Request( ipb.vars['base_url'] + "app=forums&module=ajax§ion=topics&do=saveTopicTitle&md5check="+ipb.vars['secure_hash']+'&tid='+tid,
|
||||
{
|
||||
method: 'post',
|
||||
@@ -303,23 +205,11 @@ _forums.prototype.forums = {
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
hideAllModeration: function()
|
||||
{
|
||||
//if( !ipb.forums.showMod || ipb.forums.showMod.length == 0 ){ return; }
|
||||
ipb.forums.showMod.invoke('hide');
|
||||
},
|
||||
|
||||
toggleFilters: function(e)
|
||||
{
|
||||
if( $('filter_form') )
|
||||
{
|
||||
Effect.toggle( $('filter_form'), 'blind', {duration: 0.2} );
|
||||
Effect.toggle( $('show_filters'), 'blind', {duration: 0.2} );
|
||||
}
|
||||
},
|
||||
|
||||
preCheckTopics: function()
|
||||
{
|
||||
{
|
||||
if( !$('selectedtids') ){ return; }
|
||||
|
||||
topics = $F('selectedtids').split(',');
|
||||
|
||||
if( topics )
|
||||
@@ -376,6 +266,7 @@ _forums.prototype.forums = {
|
||||
$('selectedtids').value = selectedTopics;
|
||||
|
||||
ipb.forums.updateTopicModButton();
|
||||
ipb.forums.openModPanel();
|
||||
},
|
||||
checkTopic: function(e)
|
||||
{
|
||||
@@ -399,7 +290,19 @@ _forums.prototype.forums = {
|
||||
|
||||
$('selectedtids').value = selectedTopics;
|
||||
|
||||
ipb.forums.updateTopicModButton();
|
||||
ipb.forums.updateTopicModButton();
|
||||
ipb.forums.openModPanel();
|
||||
},
|
||||
openModPanel: function( e )
|
||||
{
|
||||
if( e ){
|
||||
Event.stop(e);
|
||||
}
|
||||
|
||||
if( $('topic_mod') && $('moderator_toggle') && ! $('topic_mod').visible() ){
|
||||
$('moderator_toggle').up('li').hide();
|
||||
new Effect.BlindDown( $('topic_mod'), { duration: 0.3 } );
|
||||
}
|
||||
},
|
||||
updateTopicModButton: function( )
|
||||
{
|
||||
@@ -419,6 +322,12 @@ _forums.prototype.forums = {
|
||||
} else {
|
||||
$('mod_submit').disabled = false;
|
||||
}
|
||||
|
||||
/* Make sure it can't say -1 */
|
||||
if( ipb.forums.totalChecked < 1 )
|
||||
{
|
||||
ipb.forums.totalChecked = 0;
|
||||
}
|
||||
|
||||
$('mod_submit').value = ipb.lang['with_selected'].replace('{num}', ipb.forums.totalChecked);
|
||||
}
|
||||
@@ -440,7 +349,7 @@ _forums.prototype.forums = {
|
||||
}
|
||||
|
||||
url = ipb.vars['base_url'] + "&app=forums&module=ajax&secure_key=" + ipb.vars['secure_hash'] + '§ion=stats&do=who&t=' + tid;
|
||||
popup = new ipb.Popup( 'whoPosted', { type: 'pane', modal: false, w: '500px', h: '400px', ajaxURL: url, hideAtStart: false, close: 'a[rel="close"]' } );
|
||||
popup = new ipb.Popup( 'whoPosted', { type: 'pane', modal: false, w: '500px', h: 400, ajaxURL: url, hideAtStart: false, close: 'a[rel="close"]' } );
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user