indvdum@13: if(typeof(oldIE) == 'undefined') var oldIE = false; indvdum@13: indvdum@13: $(document).ready(function() { indvdum@13: // detect browser indvdum@13: var browser = (navigator.userAgent) ? navigator.userAgent : ''; indvdum@13: if(typeof(clrIE) == 'boolean') indvdum@13: { indvdum@13: browser = 'ie'; indvdum@13: } indvdum@13: else indvdum@13: { indvdum@13: browser = (browser.indexOf('Opera') >= 0) ? ( indvdum@13: (browser.indexOf('Opera Mini/') > 0) ? 'opera-mini' : 'opera') : ( indvdum@13: (browser.indexOf('Gecko/') > 0) ? 'mozilla' : ( indvdum@13: (browser.indexOf('WebKit/') > 0) ? 'webkit' : ( indvdum@13: (browser.indexOf('MSIE') > 0) ? 'ie' : 'unknown' indvdum@13: ) indvdum@13: ) indvdum@13: ); indvdum@13: } indvdum@13: $('body').addClass('browser-' + browser + ((oldIE) ? ' old-ie transform' : '')); indvdum@13: indvdum@13: // transformations and test browser indvdum@13: if(!oldIE) indvdum@13: { indvdum@13: var test = document.createElement('canvas'), indvdum@13: found = false, indvdum@13: list = new Array('MozTransform', 'webkitTransform', 'OTransform', 'transform', 'msTransform'); indvdum@13: for(var i=0; i 0) $(this).before(' • '); indvdum@13: count ++; indvdum@13: }); indvdum@13: if(!count) $(this).css('display', 'none'); indvdum@13: }); indvdum@13: indvdum@13: $('#footer div.nav-links > a').each(function(i) indvdum@13: { indvdum@13: if(i > 0) $(this).before(' • '); indvdum@13: }); indvdum@13: indvdum@13: // clear divs indvdum@13: $('#page-body, #footer').append('
'); indvdum@13: $('.cp-mini:last').after('
'); indvdum@13: indvdum@13: // remove extra lines indvdum@13: $('#page-body > hr, #cp-main > hr, #page-body > form > hr').remove(); indvdum@13: indvdum@13: // unread posts indvdum@13: $('dl.icon').each(function() indvdum@13: { indvdum@13: var bg = $(this).css('background-image'); indvdum@13: if(bg.length && bg.indexOf('_unread') > 0) indvdum@13: { indvdum@13: $(this).parents('li:first').addClass('unread'); indvdum@13: } indvdum@13: else if(bg.length && bg.indexOf('forum_link') > 0) indvdum@13: { indvdum@13: $(this).parents('li:first').addClass('forum-link'); indvdum@13: } indvdum@13: }); indvdum@13: indvdum@13: // topic title indvdum@13: $('body.section-viewtopic #page-body > h2:first').addClass('title'); indvdum@13: indvdum@13: // index: reported/unapproved topics indvdum@13: $('li.row a img').each(function() indvdum@13: { indvdum@13: if(this.src.indexOf('icon_topic_unapproved') > 0) indvdum@13: { indvdum@13: $(this).parents('li.row:first').addClass('unapproved'); indvdum@13: } indvdum@13: }); indvdum@13: $('dd.lastpost a img').each(function() indvdum@13: { indvdum@13: if(this.src.indexOf('icon_topic_unapproved') > 0 || this.src.indexOf('icon_topic_reported') > 0) indvdum@13: { indvdum@13: var prev = $(this).parents('dl.icon:first').find('dt'); indvdum@13: if(!prev.length) return; indvdum@13: if(!prev.find('div.extra').length) indvdum@13: { indvdum@13: prev.prepend('
'); indvdum@13: } indvdum@13: prev = prev.find('div.extra'); indvdum@13: $(this).parent('a').appendTo(prev); indvdum@13: } indvdum@13: }); indvdum@13: indvdum@13: // remove rounded block within rounded block indvdum@13: $('div.panel div.post, div.panel ul.topiclist, div.panel table.table1, div.panel dl.panel').parents('div.panel').addClass('panel-wrapper'); indvdum@13: indvdum@13: // tabs indvdum@13: $('#tabs, #navigation, #minitabs').each(function() indvdum@13: { indvdum@13: var last = false, indvdum@13: count = 0; indvdum@13: $('li', $(this)).each(function(i) indvdum@13: { indvdum@13: if(i == 0) $(this).addClass('first'); indvdum@13: last = $(this); indvdum@13: count ++; indvdum@13: }); indvdum@13: if(count < 2) indvdum@13: { indvdum@13: $(this).hide(); indvdum@13: } indvdum@13: else indvdum@13: { indvdum@13: if(last !== false) last.addClass('last'); indvdum@13: $(this).find('hr').remove(); indvdum@13: $(this).parents('form').css('display', 'inline'); indvdum@13: $(this).append('
'); indvdum@13: $(this).find('a').each(function() indvdum@13: { indvdum@13: if(!$('span', this).length) indvdum@13: { indvdum@13: $(this).html('' + $(this).html() + ''); indvdum@13: } indvdum@13: }); indvdum@13: } indvdum@13: }); indvdum@13: $('#navigation').parents('.panel').removeClass('panel').addClass('cp-panel'); indvdum@13: indvdum@13: // control panel: remove empty boxes indvdum@13: $('#cp-main .panel').each(function() indvdum@13: { indvdum@13: var inner = $(this).find('.inner:first'); indvdum@13: if(!inner.length) return; indvdum@13: if(inner.children().length < 2) indvdum@13: { indvdum@13: $(this).hide(); indvdum@13: } indvdum@13: }); indvdum@13: indvdum@13: // fix right side margin indvdum@13: $('#page-body > p.rightside').each(function() indvdum@13: { indvdum@13: var next = $(this).next(); indvdum@13: if(next.is('p') && !next.hasClass('rightside')) next.css('margin-top', 0); indvdum@13: }); indvdum@13: indvdum@13: // pm post indvdum@13: $('.post > div, .panel > div').addClass('inner'); indvdum@13: indvdum@13: // emulate multiple backgrounds indvdum@13: if(oldIE) indvdum@13: { indvdum@13: $('#header, #footer').wrapInner('
'); indvdum@13: $('#footer').wrapInner('
'); indvdum@13: $('div.panel > .inner').addClass('inner-panel'); indvdum@13: $('div.forabg, div.forumbg, div.panel-wrapper').not('.cp-panel').addClass('old-ie-wrap-1').wrapInner('
'); indvdum@13: $('div.post, .panel, .cp-mini, ul.topiclist li').not('.header, .panel-wrapper').addClass('old-ie-wrap-2').wrapInner('
'); indvdum@13: } indvdum@13: indvdum@13: // search box indvdum@13: $('div.search-box input').focus(function() { $(this).parents('.search-box').addClass('focus'); }).blur(function() { $(this).parents('.search-box').removeClass('focus'); }) indvdum@13: indvdum@13: // header search box indvdum@13: $('#search-box form').submit(function() { var value = $('#search-box input:text').val(); return (value == laSearchMini || value == '') ? false : true; }); indvdum@13: $('#search-box input:text').focus(function() { indvdum@13: if(this.value == laSearchMini) this.value = ''; indvdum@13: $('#search-box').addClass('focused'); indvdum@13: }).blur(function() { indvdum@13: if(this.value == '') this.value = laSearchMini; indvdum@13: $('#search-box').removeClass('focused'); indvdum@13: }); indvdum@13: indvdum@13: // old browser warning indvdum@13: function hasCookie(search) indvdum@13: { indvdum@13: var cookie = document.cookie.split(';'); indvdum@13: search += '='; indvdum@13: for(var i=0; i