Kullanıcı:Srhat/vector.js
Not: Yayımladıktan sonra değişiklikleri görmek için tarayıcınızın önbelleğini temizlemeniz gerekebilir.
- Firefox / Safari: Shift tuşuna basılıyken Yeniden Yükle'ye tıklayın ya da Ctrl-F5 ya da Ctrl-R tıklayın (Mac için ⌘-R).
- Google Chrome: Ctrl-Shift-R'ye basın. (Mac için ⌘-Shift-R)
- Internet Explorer / Edge: Ctrl basılıyken Yenile'ye tıklayın ya da Ctrl-F5 yapın.
- Opera: Ctrl-F5 tıklayın.
if (typeof $ == 'undefined')
var $ = jQuery;
//<source lang="javascript">
// Faster Collapsible Containers
// Maintainer: [[User:Darklama]]
// images to use for hide/show states
var collapse_action_hide = 'http://upload.wikimedia.org/wikipedia/commons/1/10/MediaWiki_Vector_skin_action_arrow.png';
var collapse_action_show = 'http://upload.wikimedia.org/wikipedia/commons/4/41/MediaWiki_Vector_skin_right_arrow.png';
// toggle state of collapsible boxes
function collapsible_boxes()
{
$('div.collapsible').each( function() {
var $that = $(this), css_width = $that.css('width'), attr_width = $that.attr('width');
var which = $that.hasClass('selected') ? collapse_action_show : collapse_action_hide;
if ( (!css_width || css_width == 'auto') && (!attr_width || attr_width == 'auto') ) {
$that.css('width', $that.width() );
}
$(this).children('.title').each( function() {
$(this).prepend('<span class="action"><a><img src="'+which+'" /></a></span>').click( function() {
var which = $that.toggleClass('selected').hasClass('selected')
? collapse_action_show : collapse_action_hide;
$(this).find('span.action img').attr('src', which);
if ( which == collapse_action_show ) {
$(this).siblings(':not(.title)').stop(true, true).slideToggle('fast');
} else {
$(this).siblings(':not(.title)').stop(true, true).slideToggle('fast');
}
}).click();
});
});
$( "table.collapsible" ).each( function() {
var $table = $(this), rows = this.rows, cell = rows.item(0).cells.item(0);
var which = $table.hasClass('selected') ? collapse_action_show : collapse_action_hide;
var css_width = $table.css('width'), attr_width = $table.attr('width');
if ( (!css_width || css_width == 'auto') && (!attr_width || attr_width == 'auto') ) {
$table.css('width', $table.width() );
}
$(cell).prepend('<span class="action"><a><img src="'+which+'" /></a></span>');
$(rows.item(0)).click( function() {
var which = $table.toggleClass('selected').hasClass('selected')
? collapse_action_show : collapse_action_hide;
$(cell).find('span.action img').attr('src', which);
if ( which == collapse_action_show ) {
$(rows).next().stop(true, true).slideToggle('fast');
} else {
$(rows).next().stop(true, true).slideToggle('fast');
}
}).click();
});
}
$(document).ready( collapsible_boxes );
//</source>
// Check that jQuery is available
if ( typeof $ != 'undefined' ) {
$( function() {
$( '#wpTextbox1' ).bind( 'wikiEditor-toolbar-buildSection-main', function( event, section ) {
// Add icons for bold (F) and italic (L) for Swedish (sv)
// Don't overwrite them if they're already defined, so this hack can safely be removed once the
// usability team incorporates these icons in the software
if ( !( 'tr' in section.groups.format.tools.bold.icon ) ) {
// There's already a bold F icon for German, use that one
section.groups.format.tools.bold.icon['tr'] = 'format-bold-K.png';
section.groups.format.tools.bold.offset['tr'] = [2, -214];
}
if ( !( 'tr' in section.groups.format.tools.italic.icon ) ) {
// Use an icon from Commons for L
section.groups.format.tools.italic.icon['tr'] = 'http://upload.wikimedia.org/wikipedia/commons/3/32/Toolbaricon_italic_E.png';
section.groups.format.tools.italic.offset['tr'] = [2, -214];
}
} );
} );
}