Version 3.2.3
This commit is contained in:
1 parent
ae5c01cc78
commit
78706903a2
2641 files changed
+228363
-201264
No files matched your search
+108
-121
@@ -12,6 +12,8 @@ var _idx = window.IPBoard;
|
||||
_idx.prototype.board = {
|
||||
_statusClick: 0,
|
||||
_statusDefaultValue: '',
|
||||
count_sbars: 0,
|
||||
count_hidden: 0,
|
||||
|
||||
/*------------------------------*/
|
||||
/* Constructor */
|
||||
@@ -27,7 +29,7 @@ _idx.prototype.board = {
|
||||
if( $('updateStatusForm') ){
|
||||
$('updateStatusForm').observe( 'submit', ipb.board.statusHookSubmit );
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
},
|
||||
|
||||
@@ -39,10 +41,8 @@ _idx.prototype.board = {
|
||||
{
|
||||
if ( ! ipb.board._statusClick )
|
||||
{
|
||||
if( $('hookStatusTextField') )
|
||||
{
|
||||
if( $('hookStatusTextField') ){
|
||||
$('hookStatusTextField').value = '';
|
||||
//$('hookStatusTextField').setStyle( { color: 'black' } );
|
||||
}
|
||||
|
||||
ipb.board._statusClick = 1;
|
||||
@@ -73,34 +73,22 @@ _idx.prototype.board = {
|
||||
*/
|
||||
setUpForumTables: function()
|
||||
{
|
||||
$$('.ipb_table').each( function(tab){
|
||||
var tmp = $( tab ).wrap( 'div' );
|
||||
$( tmp ).addClassName('table_wrap');
|
||||
});
|
||||
|
||||
$$('.category_block').each( function(cat){
|
||||
$(cat).select('.toggle')[0].observe( 'click', ipb.board.toggleCat );
|
||||
});
|
||||
|
||||
cookie = ipb.Cookie.get('toggleCats');
|
||||
ipb.delegate.register(".category_block .toggle", ipb.board.toggleCat);
|
||||
var cookie = ipb.Cookie.get('toggleCats');
|
||||
|
||||
if( cookie )
|
||||
{
|
||||
var cookies = cookie.split( ',' );
|
||||
var newCookies = new Array();
|
||||
var resetCookie = false;
|
||||
|
||||
//-------------------------
|
||||
// Little fun for you...
|
||||
//-------------------------
|
||||
|
||||
|
||||
for( var abcdefg=0; abcdefg < cookies.length; abcdefg++ )
|
||||
{
|
||||
if( cookies[ abcdefg ] )
|
||||
{
|
||||
if( $( 'category_' + cookies[ abcdefg ] ) )
|
||||
{
|
||||
var wrapper = $( 'category_' + cookies[ abcdefg ] ).up('.category_block').down('.table_wrap');
|
||||
var wrapper = $( 'category_' + cookies[ abcdefg ] ).down('.table_wrap');
|
||||
|
||||
wrapper.hide();
|
||||
$( 'category_' + cookies[ abcdefg ] ).addClassName('collapsed');
|
||||
@@ -127,23 +115,20 @@ _idx.prototype.board = {
|
||||
*
|
||||
* @var {event} e The event
|
||||
*/
|
||||
toggleCat: function(e)
|
||||
toggleCat: function(e, elem)
|
||||
{
|
||||
if( ipb.board.animating ){ return false; }
|
||||
|
||||
|
||||
var click = Event.element(e);
|
||||
var remove = $A();
|
||||
var wrapper = $( click ).up('.category_block').down('.table_wrap');
|
||||
Debug.write( wrapper );
|
||||
var catname = $( elem ).up('.category_block');
|
||||
var wrapper = $( catname ).down('.table_wrap');
|
||||
$( wrapper ).identify(); // IE8 fix
|
||||
catname = $( click ).up('h3');
|
||||
var catid = catname.id.replace('category_', '');
|
||||
|
||||
ipb.board.animating = true;
|
||||
|
||||
|
||||
// Get cookie
|
||||
cookie = ipb.Cookie.get('toggleCats');
|
||||
var cookie = ipb.Cookie.get('toggleCats');
|
||||
if( cookie == null ){
|
||||
cookie = $A();
|
||||
} else {
|
||||
@@ -151,6 +136,7 @@ _idx.prototype.board = {
|
||||
}
|
||||
|
||||
Effect.toggle( wrapper, 'blind', {duration: 0.4, afterFinish: function(){ ipb.board.animating = false; } } );
|
||||
Effect.toggle( wrapper, 'appear', {duration: 0.3});
|
||||
|
||||
if( catname.hasClassName('collapsed') )
|
||||
{
|
||||
@@ -179,73 +165,58 @@ _idx.prototype.board = {
|
||||
*/
|
||||
initSidebar: function()
|
||||
{
|
||||
if( !$('index_stats') )
|
||||
if( $('toggle_sidebar') )
|
||||
{
|
||||
return false;
|
||||
$('toggle_sidebar').on('click', ipb.board.toggleSidebar);
|
||||
|
||||
if( $('index_stats').visible() ){
|
||||
$('toggle_sidebar').update( $('toggle_sidebar').readAttribute("data-open") );
|
||||
} else {
|
||||
$('toggle_sidebar').update( $('toggle_sidebar').readAttribute("data-closed") );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
ipb.board.setUpSideBarBlocks();
|
||||
},
|
||||
|
||||
toggleSidebar: function(e){
|
||||
if( $('index_stats').visible() )
|
||||
{
|
||||
Debug.write("Stats are visible");
|
||||
$('open_sidebar').hide();
|
||||
$('close_sidebar').show();
|
||||
ipb.Cookie.set('hide_sidebar', 1, 1);
|
||||
|
||||
ipb.board.setUpSideBarBlocks();
|
||||
if( Prototype.Browser.WebKit ){
|
||||
// Chrome utterly fails to animate our ipsLayout styling. So we have to refresh the page.
|
||||
window.location.reload();
|
||||
}
|
||||
else
|
||||
{
|
||||
new Effect.Fade( $('index_stats'), { duration: 0.4, afterFinish: function(){
|
||||
new Effect.Morph( $('board_index'), { duration: 0.3, style:'no_sidebar' });
|
||||
} } );
|
||||
}
|
||||
|
||||
$('toggle_sidebar').update("«");
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.write("Stats aren't visible");
|
||||
$('open_sidebar').show();
|
||||
$('close_sidebar').hide();
|
||||
ipb.Cookie.set('hide_sidebar', 0, 1);
|
||||
|
||||
if( Prototype.Browser.WebKit ){
|
||||
window.location.reload();
|
||||
}
|
||||
else
|
||||
{
|
||||
new Effect.Morph( $('board_index'), { duration: 0.3, style:'force_sidebar', afterFinish: function(){
|
||||
new Effect.Appear( $('index_stats'), { duration: 0.4, afterFinish: function(){
|
||||
$('board_index').removeClassName('no_sidebar').removeClassName('force_sidebar');
|
||||
}});
|
||||
} } );
|
||||
}
|
||||
|
||||
$('toggle_sidebar').update("×");
|
||||
}
|
||||
|
||||
ipb.board.animating = false;
|
||||
|
||||
if( $('close_sidebar') )
|
||||
{
|
||||
$('close_sidebar').observe('click', function(e){
|
||||
if( ipb.board.animating ){ Event.stop(e); return; }
|
||||
|
||||
ipb.board.animating = true;
|
||||
new Effect.Fade( $('index_stats'), {duration: 0.4, afterFinish: function(){
|
||||
new Effect.Morph( $('categories'), { style: 'no_sidebar', duration: 0.4, afterFinish: function(){
|
||||
ipb.board.animating = false;
|
||||
} } );
|
||||
} } );
|
||||
|
||||
Event.stop(e);
|
||||
$('close_sidebar').toggle();
|
||||
$('open_sidebar').toggle();
|
||||
ipb.Cookie.set('hide_sidebar', '1', 1);
|
||||
});
|
||||
}
|
||||
if( $('open_sidebar') )
|
||||
{
|
||||
$('open_sidebar').observe('click', function(e){
|
||||
if( ipb.board.animating ){ Event.stop(e); return; }
|
||||
|
||||
ipb.board.animating = true;
|
||||
|
||||
new Effect.Morph( $('categories'), { style: 'with_sidebar', duration: 0.4, afterFinish: function(){
|
||||
$('categories').removeClassName('with_sidebar').removeClassName('no_sidebar');
|
||||
new Effect.Appear( $('index_stats'), { duration: 0.4, queue: 'end', afterFinish: function(){
|
||||
ipb.board.animating = false; $('index_stats').show(); ipb.board.setUpSideBarBlocks();
|
||||
} } );
|
||||
} } );
|
||||
|
||||
Event.stop(e);
|
||||
$('close_sidebar').toggle();
|
||||
$('open_sidebar').toggle();
|
||||
|
||||
/* Bug fix */
|
||||
if ( Prototype.Browser.Chrome )
|
||||
{
|
||||
setTimeout( "\$('index_stats').show()", 300 );
|
||||
}
|
||||
|
||||
ipb.Cookie.set('hide_sidebar', '0', 1);
|
||||
});
|
||||
}
|
||||
Event.stop(e);
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -253,12 +224,14 @@ _idx.prototype.board = {
|
||||
*/
|
||||
setUpSideBarBlocks: function()
|
||||
{
|
||||
if( $('index_stats').visible() && ! $$('.index_stats_collapse').length )
|
||||
if ( $('index_stats').visible() )
|
||||
{
|
||||
$$('#index_stats h3').each( function(h3)
|
||||
{
|
||||
$( h3 ).identify();
|
||||
|
||||
ipb.board.count_sbars++;
|
||||
|
||||
/* Set title - fugly
|
||||
Here we run through escape first to change foreign chars to %xx with xx being latin, and then we remove % after */
|
||||
title = escape( $( h3 ).innerHTML.replace( /<(\/)?([^>]+?)>/g, '' ) ).replace( /%/g, '' );
|
||||
@@ -267,7 +240,7 @@ _idx.prototype.board = {
|
||||
$( h3 ).up('div').addClassName( '__xX' + title );
|
||||
|
||||
/* insert the image */
|
||||
$( h3 ).update( '<a href="#" class="index_stats_collapse open">-</a>' + h3.innerHTML );
|
||||
$( h3 ).update( '<a href="#" class="ipsSidebar_trigger ipsType_smaller right desc mod_links">' + ipb.lang['hide'] + '</a>' + h3.innerHTML );
|
||||
});
|
||||
|
||||
cookie = ipb.Cookie.get('toggleSBlocks');
|
||||
@@ -313,19 +286,19 @@ _idx.prototype.board = {
|
||||
top._isAlt = true;
|
||||
top.removeClassName('alt');
|
||||
}
|
||||
|
||||
|
||||
ipb.board.count_hidden++;
|
||||
top.down('.ipsSidebar_trigger').update( ipb.lang['unhide'] );
|
||||
wrapper.hide();
|
||||
}
|
||||
|
||||
top.down('.index_stats_collapse').removeClassName('open').addClassName('close');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ipb.delegate.register(".index_stats_collapse", ipb.board.toggleSideBarBlock);
|
||||
|
||||
ipb.delegate.register(".ipsSidebar_trigger", ipb.board.toggleSideBarBlock);
|
||||
//ipb.board.resetSideBarHideOrNot(true);
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -390,8 +363,8 @@ _idx.prototype.board = {
|
||||
$( top ).removeClassName('alt');
|
||||
}
|
||||
|
||||
top.down('.index_stats_collapse').removeClassName('open').addClassName('close');
|
||||
|
||||
top.down('.ipsSidebar_trigger').update( ipb.lang['unhide'] );
|
||||
ipb.board.count_hidden--;
|
||||
Debug.write( "Adding " + topId );
|
||||
cookie.push( topId );
|
||||
}
|
||||
@@ -402,7 +375,9 @@ _idx.prototype.board = {
|
||||
$( top ).addClassName('alt');
|
||||
}
|
||||
|
||||
top.down('.index_stats_collapse').removeClassName('close').addClassName('open');
|
||||
top.down('.ipsSidebar_trigger').update( ipb.lang['hide'] );
|
||||
|
||||
ipb.board.count_hidden--;
|
||||
|
||||
Debug.write( "Removing " + topId );
|
||||
remove.push( topId );
|
||||
@@ -414,33 +389,45 @@ _idx.prototype.board = {
|
||||
cookie = "," + cookie.uniq().without( remove ).join(',') + ",";
|
||||
|
||||
ipb.Cookie.set('toggleSBlocks', cookie, 1);
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* Check for DST
|
||||
*/
|
||||
checkDST: function()
|
||||
{
|
||||
var memberHasDst = ipb.vars['dst_on'];
|
||||
var dstInEffect = new Date().getDST();
|
||||
|
||||
if( memberHasDst - dstInEffect != 0 )
|
||||
{
|
||||
var url = ipb.vars['base_url'] + 'app=members&module=ajax§ion=dst&md5check='+ipb.vars['secure_hash'];
|
||||
|
||||
new Ajax.Request( url,
|
||||
{
|
||||
method: 'get',
|
||||
onSuccess: function(t)
|
||||
{
|
||||
// We don't need to do anything about this..
|
||||
return true;
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
//ipb.board.resetSideBarHideOrNot();
|
||||
}
|
||||
|
||||
/*resetSideBarHideOrNot: function( fromInit )
|
||||
{
|
||||
if ( ipb.board.count_hidden >= ipb.board.count_sbars )
|
||||
{
|
||||
|
||||
if ( fromInit)
|
||||
{
|
||||
//$('index_stats').hide();
|
||||
}
|
||||
else
|
||||
{
|
||||
//$('index_stats').fade();
|
||||
}
|
||||
|
||||
//$('categories').addClassName('no_sidebar');
|
||||
|
||||
if ( ! $('open_sidebar') )
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( fromInit)
|
||||
{
|
||||
//$('index_stats').show();
|
||||
}
|
||||
else
|
||||
{
|
||||
//$('index_stats').appear();
|
||||
}
|
||||
|
||||
//$('categories').removeClassName('no_sidebar');
|
||||
}
|
||||
}*/
|
||||
};
|
||||
|
||||
ipb.board.init();
|
||||
Reference in new issue
Block a user