document.observe("dom:loaded", function() { $$("#secondary_navigation a").each( function(e) { Event.observe(e, "click", loadUrl ); } ); $$(".touch-row").each(function(e) { Event.observe(e, "click", touchRowClick); addArrow(e); }); $$("a.prev:not(.disabled), a.next:not(.disabled)").invoke("on", "click", loadUrl); $$(".post").each(function(e) { Event.observe(e, "click", postClick); }); $$('.sd_content').invoke('on', 'click', '.sd_content', toggleDeletedContent); Event.observe($('options-button'), "click", openNavigation); if($('filter-option')) {Event.observe($('filter-option'), "click", openFilter);} $('options-button').setStyle({'display': 'block'}); if( $('nav_markread') ){ $('nav_markread').down('a').observe('click', markAsRead); }; if ( $('full_version') ) { $('full_version').on( 'click', function( e, elem ) { Event.stop(e); var url = ipb.vars['base_url'] + 'app=core&module=ajax§ion=skin&do=change&skinId=fullVersion&secure_key=' + ipb.vars['secure_hash']; Debug.write( url ); new Ajax.Request( url, { method: 'get', onSuccess: function(t) { /* * Get an error? */ if( t.responseJSON['status'] == 'ok' ) { window.location = window.location; window.location.reload(true); } else { ipb.global.errorDialogue( ipb.lang['ajax_failure'] ); } } } ); } ); } if( $('show_langs') ){ $('show_langs').on('click', function(e){ $('show_langs').hide(); $('show_langs_box').show(); Event.stop(e); return false; }); } /* Set this here to 'toggle' works later */ $('shade').setStyle({'display': 'none'}); if ( $('filter-letters') ){ $('filter-letters').toggleClassName('hidden'); } // Set up user nav box var items = $("user_navigation").down("ul").select("li").size(); var diff = 3 - (items % 3); /* Ensure loading box isn't visible */ if ( $('loadingBox') ) { $('loadingBox').remove(); } resizeEmbeds(); for(i=0; i 440 ) { pct += 10; embed.width = embed.width - ( ( embed.width / 100 ) * pct ); } if ( pct > 0 ) { embed.height = embed.height - ( ( embed.height / 100 ) * pct ); } } } ); } function toggleDeletedContent(e, element) { Event.stop(e); var id = element.id.replace('seeContent_', ''); $('postsDelete-' + id).hide(); $('post-' + id).show(); } function markAsRead(e) { if( !confirm( ipb.lang['clear_markboard'] ) ){ Event.stop(e); } } function mobileFilter( e, element ) { Event.stop(e); // Does the pane exist? if( !$( element.id + '_pane' ) ){ return; } $('shade').toggle(); $( element.id + '_pane' ).show(); } function closePane( e, element ) { Event.stop(e); $(element).up(".ipsFilterPane").hide(); $('shade').hide(); } /** * Add the touch arrow */ function addArrow(e) { d = e.getDimensions(); t = ( d.height / 2 ) - 18; if ( ! e.inspect().match( '