MediaWiki:Common.js: Difference between revisions

Jump to navigation Jump to search
Removed JS for truncated text with fixed size of 2 lines: worked with some bugs in Chrome and completely broke the page in other browsers. I'll use pure CSS code now
m (grrr, silly tokens)
(Removed JS for truncated text with fixed size of 2 lines: worked with some bugs in Chrome and completely broke the page in other browsers. I'll use pure CSS code now)
Line 219: Line 219:
   
   
$( createNavigationBarToggleButton );
$( createNavigationBarToggleButton );
// JS function to truncate text of the captions used in Template:YouTube and Template:Image (when called by the template)
var thumbcaptiont_p=$('#thumbcaption_truncated p');
var thumbcaptiont=$('#thumbcaption_truncated').height();
while ($(thumbcaptiont_p).outerHeight()>thumbcaptiont) {
    $(thumbcaptiont_p).text(function (index, text) {
        return text.replace(/\W*\s(\S)*$/, '...');
        }
    );
}

Navigation menu