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

+190 -1
View File
@@ -11,6 +11,9 @@ document.observe("dom:loaded", function()
if( $('nav_markread') ){
$('nav_markread').down('a').observe('click', markAsRead);
};
$$('a[rel~="external"]').each( function(e) { Event.observe(e, "click", openNewWindow ); } );
parseQuoteBoxes();
if ( $('full_version') )
{
@@ -19,6 +22,7 @@ document.observe("dom:loaded", function()
Event.stop(e);
var url = ipb.vars['base_url'] + 'app=core&module=ajax&section=skin&do=change&skinId=fullVersion&secure_key=' + ipb.vars['secure_hash'];
Debug.write( url );
new Ajax.Request( url,
{
@@ -68,6 +72,18 @@ document.observe("dom:loaded", function()
$('loadingBox').remove();
}
/* Remove loading box once window unloads so if they hit back and page loads from cache it won't show */
window.onpageshow = function(event)
{
if ( event.persisted )
{
if ( $('loadingBox') )
{
$('loadingBox').remove();
}
}
};
resizeEmbeds();
for(i=0; i<diff; i++){
@@ -264,4 +280,177 @@ var Debug = {
console.info( text );
}
}
};
};
// Extend String with HTMLspecial chars
String.prototype.escapeHtml = function()
{
return this
.replace(/&/g, "&amp;")
.replace(/</g, "&lt;")
.replace(/>/g, "&gt;")
.replace(/"/g, "&quot;")
.replace(/'/g, "&#039;");
};
//Extend String with HTMLspecial chars
String.prototype.unEscapeHtml = function()
{
var _t = this.replace( /&amp;/g, "&" );
return _t
.replace(/&lt;/g, "<")
.replace(/&gt;/g, ">")
.replace(/&quot;/g, '"')
.replace(/&#039;/g, "'")
.replace(/&#39;/g, "'");
};
function parseQuoteBoxes()
{
$$('blockquote.ipsBlockquote').each( function( el )
{
if ( ! $(el).hasClassName('built') )
{
var author = '';
var cid = '';
var time = 0;
var date = '';
var collapsed = 0;
var _extra = '';
var _a = new Element('span');
try {
author = $(el).getAttribute( 'data-author' ) ? $(el).getAttribute( 'data-author' ).escapeHtml() : '';
cid = $(el).getAttribute( 'data-cid' ) ? $(el).getAttribute( 'data-cid' ).escapeHtml() : '';
time = $(el).getAttribute( 'data-time' ) ? $(el).getAttribute( 'data-time' ).escapeHtml() : 0;
date = $(el).getAttribute( 'data-date' ) ? $(el).getAttribute( 'data-date' ).escapeHtml() : '';
collapsed = $(el).getAttribute( 'data-collapsed' ) ? $(el).getAttribute( 'data-collapsed' ).escapeHtml() : 0;
} catch( aCold ) { }
if ( time )
{
if ( time == parseInt( time ) && time.length == 10 )
{
/* First, determine if we are in DST now */
var _tz = new Date().getTimezoneOffset() * 60;
/* Find out if timestamp was in DST */
var _date = new Date().getDateAndTime( parseInt( time ) );
/* If there isn't a match, figure out the DST offset and then add it back in */
if( _date['dst'] * 60 != _tz )
{
_tz = _tz - _date['dst'] * 60;
_date = new Date().getDateAndTime( parseInt( time ) - parseInt( _tz ) );
}
var _ampm = '';
if( ipb.vars['hour_format'] == "12" )
{
if( _date['hour'] > 12 )
{
_date['hour'] -= 12;
_ampm = ' ' + ipb.lang['date_pm'];
}
else if( _date['hour'] == 12 )
{
_ampm = ' ' + ipb.lang['date_pm'];
}
else if( _date['hour'] == 0 )
{
_date['hour'] = 12;
_ampm = ' ' + ipb.lang['date_am'];
}
else
{
_ampm = ' ' + ipb.lang['date_am'];
}
}
date = _date['date'] + ' ' + _date['monthName'] + ' ' + _date['year'] + ' - ' + _date['hour'] + ':' + _date['min'] + _ampm;
}
}
if ( author && date )
{
_extra = ipb.lang['quote__date_author'].replace( /#name#/, author ).replace( /#date#/, date );
}
else if ( author )
{
_extra = ipb.lang['quote__author'].replace( /#name#/, author );
}
/* finally.. */
if ( _extra.length == 0 )
{
_extra = ipb.lang['quote_title'];
}
if ( cid && parseInt( cid ) == cid )
{
_a = new Element( 'a', { 'class': 'snapback right', rel: 'citation', href: ipb.vars['board_url'] + '/index.php?app=forums&module=forums&section=findpost&pid=' + cid } );
_a.update( new Element( 'img', { src: ipb.vars['img_url'] + '/snapback.png' } ) );
}
el.insert( { before: new Element( 'p', { 'class': 'citation' } ).update( _extra ).insert( _a ) } );
try
{
el.down('cite').hide();
}
catch(err){}
el.addClassName( 'built' );
if ( collapsed )
{
el.down('p').hide();
el.down('div').hide();
el.insert( new Element( 'p', { 'class': '___x clickable' } ).update( ipb.lang['quote_expand'] ) );
el.down('p.___x').on( 'click', function( e, elem )
{
elem.up('blockquote').down('p').show();
elem.up('blockquote').down('div').show();
elem.hide();
} );
}
}
} );
}
function warningPopup( elem, id )
{
window.location = ipb.vars['base_url'] + '&app=members&module=profile&section=warnings&do=acknowledge&id=' + id
}
function openNewWindow(e)
{
window.open(e.target.href);
Event.stop(e);
return false;
}
// Extend date object to return date and time as object
Date.prototype.getDateAndTime = function( unix )
{
var a = new Date( parseInt( unix ) * 1000 );
var months = ipb.lang['gbl_months'].split(',');
var year = a.getFullYear();
var month = months[a.getMonth()];
var date = a.getDate();
var hour = a.getHours();
var min = a.getMinutes();
var sec = a.getSeconds();
return { year : year,
monthName: month,
month : ( '0' + a.getMonth() + 1 ).slice( -2 ),
date : ( '0' + date ).slice( -2 ),
hour : ( '0' + hour ).slice( -2 ),
min : ( '0' + min ).slice( -2 ),
sec : ( '0' + sec ).slice( -2 ),
dst : a.getTimezoneOffset() };
};