Version 3.1.4
This commit is contained in:
1 parent
1d4720f3e2
commit
ae5c01cc78
2563 files changed
+283048
-240689
No files matched your search
@@ -12,11 +12,14 @@ var _forums = window.IPBoard;
|
||||
_forums.prototype.forums = {
|
||||
totalChecked: 0,
|
||||
showMod: [],
|
||||
deletePerms: {},
|
||||
deleteUrls: {},
|
||||
deletePopUps: {},
|
||||
|
||||
init: function()
|
||||
{
|
||||
Debug.write("Initializing ips.forums.js");
|
||||
|
||||
|
||||
document.observe("dom:loaded", function(){
|
||||
ipb.forums.initEvents();
|
||||
});
|
||||
@@ -46,6 +49,21 @@ _forums.prototype.forums = {
|
||||
$$('.topic_mod').each( function(check){
|
||||
check.observe( 'click', ipb.forums.checkTopic );
|
||||
} );
|
||||
|
||||
if( $('showforumJump') )
|
||||
{
|
||||
$('showforumJump').observe( "change", ipb.forums.jumpToForum );
|
||||
$('forum_jump_submit').hide();
|
||||
}
|
||||
},
|
||||
|
||||
jumpToForum: function(e)
|
||||
{
|
||||
Event.stop(e);
|
||||
|
||||
$('forum_jump').submit();
|
||||
|
||||
return false;
|
||||
},
|
||||
|
||||
submitModForm: function(e)
|
||||
@@ -75,9 +93,8 @@ _forums.prototype.forums = {
|
||||
$( mod ).observe('mouseover', ipb.forums.moverModeration);
|
||||
$( mod ).observe('mouseout', ipb.forums.moutModeration);
|
||||
|
||||
|
||||
$( mod ).observe('mouseover', function(e){
|
||||
$(mod).setStyle( 'cursor: pointer;' );
|
||||
$(mod).setStyle( { 'cursor': 'pointer' } );
|
||||
Event.stop(e);
|
||||
});
|
||||
$( mod ).observe('mouseout', function(e){
|
||||
@@ -96,8 +113,8 @@ _forums.prototype.forums = {
|
||||
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 ) }
|
||||
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);
|
||||
},
|
||||
@@ -109,7 +126,13 @@ _forums.prototype.forums = {
|
||||
{
|
||||
elem = elem.up('.topic_moderation');
|
||||
}
|
||||
elem.setStyle('cursor: pointer').setOpacity(1); // Fix the cursor
|
||||
|
||||
if ( $$('.__topic') )
|
||||
{
|
||||
ipb.global.topicPreviewShowIcon(e);
|
||||
}
|
||||
|
||||
elem.setStyle( { 'cursor': 'pointer' } ).setOpacity(1); // Fix the cursor
|
||||
//new Effect.Appear( $( elem ), {duration: 0.2} );
|
||||
},
|
||||
|
||||
@@ -121,20 +144,64 @@ _forums.prototype.forums = {
|
||||
elem = elem.up('.topic_moderation');
|
||||
}
|
||||
|
||||
//new Effect.Fade( $(elem), {duration: 0.2, to: 0.3} );
|
||||
if ( $$('.__topic') )
|
||||
{
|
||||
ipb.global.topicPreviewHideIcon(e);
|
||||
}
|
||||
|
||||
elem.setOpacity( 0.3 );
|
||||
},
|
||||
|
||||
topicDelete: function(e)
|
||||
{
|
||||
if( !confirm( ipb.lang['delete_topic_confirm'] ) )
|
||||
/* 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)
|
||||
{
|
||||
if( DISABLE_AJAX ){
|
||||
return false;
|
||||
}
|
||||
|
||||
Event.stop(e);
|
||||
|
||||
// We need to find the topic concerned
|
||||
@@ -145,7 +212,7 @@ _forums.prototype.forums = {
|
||||
var temp = ipb.templates['topic_rename'].evaluate( { inputid: link.id + '_input',
|
||||
submitid: link.id + '_submit',
|
||||
cancelid: link.id + '_cancel',
|
||||
value: link.innerHTML.unescapeHTML().replace( /'/g, "'" ) } );
|
||||
value: link.innerHTML.unescapeHTML().replace( /'/g, "'" ).replace( /</g, "<" ).replace( />/g, ">" ) } );
|
||||
|
||||
$( link ).insert( { before: temp } );
|
||||
|
||||
@@ -338,13 +405,23 @@ _forums.prototype.forums = {
|
||||
{
|
||||
if( $('mod_submit') )
|
||||
{
|
||||
if( ipb.forums.totalChecked == 0 ){
|
||||
$('mod_submit').disabled = true;
|
||||
} else {
|
||||
var _v = $('mod_tact').options[ $('mod_tact').selectedIndex ].value;
|
||||
|
||||
if ( _v.match( /^t_/ ) )
|
||||
{
|
||||
$('mod_submit').disabled = false;
|
||||
$('mod_submit').value = ipb.lang['justgo'];
|
||||
}
|
||||
else
|
||||
{
|
||||
if( ipb.forums.totalChecked == 0 ){
|
||||
$('mod_submit').disabled = true;
|
||||
} else {
|
||||
$('mod_submit').disabled = false;
|
||||
}
|
||||
|
||||
$('mod_submit').value = ipb.lang['with_selected'].replace('{num}', ipb.forums.totalChecked);
|
||||
}
|
||||
|
||||
$('mod_submit').value = ipb.lang['with_selected'].replace('{num}', ipb.forums.totalChecked);
|
||||
}
|
||||
},
|
||||
|
||||
@@ -366,5 +443,6 @@ _forums.prototype.forums = {
|
||||
popup = new ipb.Popup( 'whoPosted', { type: 'pane', modal: false, w: '500px', h: '400px', ajaxURL: url, hideAtStart: false, close: 'a[rel="close"]' } );
|
||||
return false;
|
||||
}
|
||||
}
|
||||
ipb.forums.init();
|
||||
};
|
||||
|
||||
ipb.forums.init();
|
||||
Reference in new issue
Block a user