Version 3.4.5

This commit is contained in:
Neo committed 2025-12-19 00:38:12 -08:00
1 parent fb6b5baabc
commit e4478369d8
1360 files changed
+228921 -179445

No files matched your search

+144 -33
View File
@@ -12,6 +12,8 @@ var _topic = window.IPBoard;
_topic.prototype.topic = {
totalChecked: 0,
inSection: '',
topic_id: 0,
page_id: 0,
postcache: [],
poll: [],
pollPopups: [],
@@ -38,6 +40,30 @@ _topic.prototype.topic = {
if( ipb.topic.inSection == 'topicview' )
{
/* Check to see if we want a PID but it doesn't exist on this page */
if ( window.location.hash.substring(1).match( /entry/ ) )
{
var pid = window.location.hash.substring(1).replace(/entry/, '');
if ( ipb.topic.redirectPost && pid && $$('a[data-entry-pid]').length && ! $$('a[data-entry-pid="' + pid + '"]').length )
{
window.location = ipb.vars['board_url'] + '/index.php?app=forums&module=forums&section=findpost&pid=' + pid + '&t=' + ipb.topic.topic_id;
}
}
/* Scroll to a post? */
if ( ! pid )
{
pid = getQueryStringParamByName('p');
}
if ( pid && $('entry' + pid ) )
{
ipb.topic.scrollToPost( parseInt( pid ) );
}
ipb.delegate.register('a[data-entry-pid]', ipb.topic.launchPostShare );
if( $('show_filters') )
{
$('show_filters').observe('click', ipb.topic.toggleFilters );
@@ -61,6 +87,9 @@ _topic.prototype.topic = {
ipb.delegate.register('.modlink_09', ipb.topic.topicDeletePopUp );
/* Answer stuffs */
//ipb.delegate.register('[data-post-button=answer]', ipb.topic.QA_answer );
if ( $('submit_post') ){
$('submit_post').observe( "click", ipb.topic.ajaxFastReply );
}
@@ -430,6 +459,27 @@ _topic.prototype.topic = {
}
},
/**
* Launch post sharerererererererererererererer
*
*/
launchPostShare: function(e, elem)
{
Event.stop(e);
var pid = $(elem).readAttribute('data-entry-pid');
var url = ipb.vars['base_url'] + 'app=forums&module=ajax&section=topics&do=postShareModal&p=' + pid + '&t=' + ipb.topic.topic_id + '&f=' + ipb.topic.forum_id + '&md5check=' + ipb.vars['secure_hash'];
ipb.global.popups['psharer'] = new ipb.Popup( 'psharer',
{ type: 'modal',
modal: true,
ajaxURL: url,
hideAtStart: false,
evalJs: 'force',
w: '550px',
h: 300
} );
},
/**
* MATT
@@ -644,6 +694,12 @@ _topic.prototype.topic = {
var Post = ipb.textEditor.getEditor( ipb.topic.fastReplyId ).getText();
var isRte = ipb.textEditor.getEditor( ipb.topic.fastReplyId ).isRte();
/* BBCode issues? */
if ( Post === false )
{
return false;
}
/* Quick check */
if( Post.blank() )
{
@@ -667,7 +723,23 @@ _topic.prototype.topic = {
toggleEditorButtons( false );
ipb.topic.isPosting = true;
var elements = new Hash({
md5check: ipb.vars['secure_hash'],
Post: Post.encodeParam(),
isRte: isRte
});
var formElements = $('ips_fastReplyForm').getElements();
for( var i=0, j=formElements.length; i < j; i++ )
{
if( formElements[i].getAttribute('rel') == 'include' )
{
elements.set( formElements[i].name, formElements[i].getValue() );
}
}
var url = ipb.vars['base_url'] + 'app=forums&module=ajax&section=topics&do=reply&t=' + ipb.topic.topic_id + '&f=' + ipb.topic.forum_id + '&pid=' + ipb.topic.topPid;
Debug.write(url);
new Ajax.Request( url,
@@ -675,11 +747,7 @@ _topic.prototype.topic = {
method: 'post',
encoding: ipb.vars['charset'],
evalJSON: 'force',
parameters: {
md5check: ipb.vars['secure_hash'],
Post: Post.encodeParam(),
isRte: isRte
},
parameters: elements,
onSuccess: function(t)
{
toggleEditorButtons( true );
@@ -701,7 +769,7 @@ _topic.prototype.topic = {
{
ipb.global.okDialogue( t.responseJSON['message'] );
}
if( t.responseJSON['post'] && t.responseJSON['postid'] )
{
/* Are we *NOT* on the last page? */
@@ -736,14 +804,23 @@ _topic.prototype.topic = {
{
$( 'newContent-' + ipb.topic.topPid).hide();
new Effect.BlindDown( 'newContent-' + ipb.topic.topPid, { duration: 0.5, queue: 'front' } );
prettyPrint();
}
prettyPrint();
}
ipb.topic.isPosting = false;
ipb.textEditor.getEditor( ipb.topic.fastReplyId ).minimizeOpenedEditor();
var editor = ipb.textEditor.getEditor( ipb.topic.fastReplyId );
editor.clearSaveMessage();
editor.minimizeOpenedEditor();
if ( editor.options.isTypingCallBack !== false )
{
editor.timers['dirty'] = setInterval( editor.checkForInput.bind( editor ), ipb.textEditor.IPS_TEXTEDITOR_POLLING );
}
return false;
}
else if ( t.responseText && t.responseText != 'no_permission' )
@@ -771,7 +848,7 @@ _topic.prototype.topic = {
{
return false;
}
$('ips_Posts').insert( new Element('div', { id: 'newContent-' + ipb.topic.topPid } ).insert( t.responseText ) );
if ( $( 'newContent-' + ipb.topic.topPid ) )
@@ -780,6 +857,7 @@ _topic.prototype.topic = {
new Effect.BlindDown( 'newContent-' + ipb.topic.topPid, { duration: 0.5, queue: 'front' } );
/* Close editor */
ipb.textEditor.getEditor( ipb.topic.fastReplyId ).clearSaveMessage();
ipb.textEditor.getEditor( ipb.topic.fastReplyId ).minimizeOpenedEditor();
prettyPrint();
@@ -824,14 +902,22 @@ _topic.prototype.topic = {
{
if ( t.responseJSON && t.responseJSON['error'] )
{
ipb.global.errorDialogue( t.responseJSON['error'] );
if (! Object.isUndefined( ipb.lang[t.responseJSON['error']] ))
{
ipb.global.errorDialogue( ipb.lang[t.responseJSON['error']] );
}
else
{
ipb.global.errorDialogue( t.responseJSON['error'] );
}
return false;
}
else if ( t.responseText && t.responseText != 'nopermission' )
{
editor = ipb.textEditor.getEditor( ipb.topic.fastReplyId );
editor.insert( t.responseText, 'always' );
editor.insert( ipb.textEditor.convertQuotes( t.responseText ), 'always' );
}
}
}
@@ -851,7 +937,13 @@ _topic.prototype.topic = {
if( !postid ){ alert("No post ID"); return; }
var Post = ipb.textEditor.getEditor( 'edit-' + postid ).getText();
/* BBCode issues? */
if ( Post === false )
{
return false;
}
if( Post.blank() )
{
alert( ipb.lang['post_empty'] );
@@ -963,6 +1055,9 @@ _topic.prototype.topic = {
return false;
}
}
/* Call now */
ipb.topic.pollForReplies();
/* set off the timer */
ipb.textEditor.getEditor().timers['interval_hasContent'] = setInterval( ipb.topic.pollForReplies, ipb.textEditor.IPS_NEW_POST_POLLING );
@@ -1094,27 +1189,28 @@ _topic.prototype.topic = {
* Reads the cookie and checks posts as necessary
*/
preCheckPosts: function()
{
{
if( ! $('selectedpidsJS' ) || !$F('selectedpidsJS') ){ return true; }
// Get the cookie
pids = $F('selectedpidsJS').split(',');
if( pids )
{
pids.each( function(pid)
{
if( !pid.blank() )
{
/* #37999: We don't need this increment as the action of checking the box itself will also increment the count */
//ipb.topic.totalChecked++;
if( $('checkbox_' + pid) )
{
ipb.topic.checkPost( this, $('checkbox_' + pid) );
$('checkbox_' + pid).checked = true;
}
else
{
ipb.topic.totalChecked++;
}
}
});
}
@@ -1129,7 +1225,7 @@ _topic.prototype.topic = {
* @var {event} e The event
*/
checkPost: function(e, check)
{
{
Debug.write("Check post");
remove = $A();
data = $F('selectedpidsJS');
@@ -1182,6 +1278,7 @@ _topic.prototype.topic = {
}
pids = pids.uniq().without( remove ).join(',');
ipb.Cookie.set('modpids', pids, 0);
$('selectedpidsJS').value = pids;
ipb.topic.updatePostModButton();
@@ -1221,28 +1318,35 @@ _topic.prototype.topic = {
$('tactInPopup').select('option').invoke('remove');
/* Update the available options */
if ( ipb.topic.modOptionsUnapproved )
if ( ipb.topic.modOptionsUnapproved && ipb.topic.modPerms['approve'] )
{
$('tactInPopup').insert( new Element('option', { value: 'approve' } ).update( ipb.lang['cpt_approve'] ) );
}
if ( ipb.topic.modOptionsUnhidden )
if ( ipb.topic.modOptionsUnhidden && ipb.topic.modPerms['hide'] )
{
$('tactInPopup').insert( new Element('option', { value: 'delete' } ).update( ipb.lang['cpt_hide'] ) );
}
if ( ipb.topic.modOptionsHidden )
if ( ipb.topic.modOptionsHidden && ipb.topic.modPerms['unhide'] )
{
$('tactInPopup').insert( new Element('option', { value: 'sundelete' } ).update( ipb.lang['cpt_undelete'] ) );
}
$('tactInPopup').insert( new Element('option', { value: 'deletedo' } ).update( ipb.lang['cpt_delete'] ) );
if ( ipb.topic.totalChecked > 1 )
if ( ipb.topic.modPerms['delete'] )
{
$('tactInPopup').insert( new Element('option', { value: 'deletedo' } ).update( ipb.lang['cpt_delete'] ) );
}
if ( ipb.topic.totalChecked > 1 && ipb.topic.modPerms['merge'] )
{
$('tactInPopup').insert( new Element('option', { value: 'merge' } ).update( ipb.lang['cpt_merge'] ) );
}
$('tactInPopup').insert( new Element('option', { value: 'split' } ).update( ipb.lang['cpt_split'] ) );
$('tactInPopup').insert( new Element('option', { value: 'move' } ).update( ipb.lang['cpt_move'] ) );
if ( ipb.topic.modPerms['split'] )
{
$('tactInPopup').insert( new Element('option', { value: 'split' } ).update( ipb.lang['cpt_split'] ) );
}
if ( ipb.topic.modPerms['move'] )
{
$('tactInPopup').insert( new Element('option', { value: 'move' } ).update( ipb.lang['cpt_move'] ) );
}
}
else
{
@@ -1315,14 +1419,21 @@ _topic.prototype.topic = {
{
if ( t.responseJSON && t.responseJSON['error'] )
{
ipb.global.errorDialogue( t.responseJSON['error'] );
if (! Object.isUndefined( ipb.lang[t.responseJSON['error']] ))
{
ipb.global.errorDialogue( ipb.lang[t.responseJSON['error']] );
}
else
{
ipb.global.errorDialogue( t.responseJSON['error'] );
}
return false;
}
else if ( t.responseText && t.responseText != 'nopermission' )
{
editor = ipb.textEditor.getEditor( ipb.topic.fastReplyId )
editor.insert( t.responseText, true );
editor.insert( ipb.textEditor.convertQuotes( t.responseText ), true );
}
}
}
@@ -1504,7 +1615,7 @@ _topic.prototype.topic = {
* @var {int} pid Post ID to scroll to
*/
scrollToPost: function( pid )
{
{
if( !pid || !Object.isNumber( pid ) ){ return; }
$('entry' + pid).scrollTo();
},