مدیاویکی:Gadget-sidebarToggle.js: تفاوت میان نسخهها
بدون خلاصۀ ویرایش |
بدون خلاصۀ ویرایش |
||
(۱۳ نسخهٔ میانیِ ایجادشده توسط همین کاربر نشان داده نشد) | |||
خط ۱: | خط ۱: | ||
(function( $, undefined ) { | (function( $, undefined ) { | ||
"use strict"; | "use strict"; | ||
/** | /** | ||
خط ۱۲۴: | خط ۸۶: | ||
* @param duration {mixed} Animation duration passed to jQuery. | * @param duration {mixed} Animation duration passed to jQuery. | ||
*/ | */ | ||
/* | |||
function collapse( duration ) { | function collapse( duration ) { | ||
خط ۱۵۹: | خط ۱۲۲: | ||
} | } | ||
/** | /** | ||
* Expands the sidebar. | * Expands the sidebar. | ||
* @param duration {mixed} Animation duration passed to jQuery. | * @param duration {mixed} Animation duration passed to jQuery. | ||
function expand( duration ) { | function expand( duration ) { | ||
خط ۱۹۷: | خط ۱۶۰: | ||
} | } | ||
*/ | |||
function totop() { | function totop() { | ||
$('html, body').animate({ scrollTop: 0 }, 500); | $('html, body').animate({ scrollTop: 0 }, 500); | ||
} | } | ||
function fontsizeup() { | function fontsizeup() { | ||
var fontSize = parseInt($('p').css("font-size")); | |||
fontSize = fontSize + 3 + "px"; | |||
$( | $('p').css({'font-size':fontSize}); | ||
} | } | ||
function fontsizedown() { | function fontsizedown() { | ||
var fontSize = parseInt($('p').css("font-size")); | |||
fontSize = fontSize - 3 + "px"; | |||
$('p').css({'font-size':fontSize}); | |||
} | } | ||
خط ۲۳۲: | خط ۱۸۹: | ||
// Show the toggle tab. | // Show the toggle tab. | ||
$("< | //$("<a class='sidebarbottons' id='collsidebar'></a>") | ||
// .prop( "title", "تغییر وضعیت فهرست سمت راست" ) | |||
// .click( toggle ) | |||
// .insertAfter("#mw-panel"); | |||
$("< | $("<a class='sidebarbottons' id='totop'></a>") | ||
.prop( "title", "بازگشت به بالا" ) | .prop( "title", "بازگشت به بالا" ) | ||
.click( totop ) | .click( totop ) | ||
.insertAfter("#mw-panel"); | .insertAfter("#mw-panel"); | ||
$("< | $("<a class='sidebarbottons' id='fontsizeup'></a>") | ||
.prop( "title", "افزایش اندازه قلم" ) | .prop( "title", "افزایش اندازه قلم" ) | ||
.click( fontsizeup ) | .click( fontsizeup ) | ||
.insertAfter("#mw-panel"); | .insertAfter("#mw-panel"); | ||
$("< | $("<a class='sidebarbottons' id='fontsizedown'></a>") | ||
.prop( "title", "کاهش اندازه قلم" ) | .prop( "title", "کاهش اندازه قلم" ) | ||
.click( fontsizedown ) | .click( fontsizedown ) | ||
.insertAfter("#mw-panel"); | .insertAfter("#mw-panel"); | ||
/* | /* | ||
// Respect the saved state. | // Respect the saved state. | ||
خط ۲۷۱: | خط ۲۲۹: | ||
// Load translations and saved state. | // Load translations and saved state. | ||
dir = document.documentElement.dir; | dir = document.documentElement.dir; | ||
$.extend( msg, translations[document.documentElement.lang] ); | //$.extend( msg, translations[document.documentElement.lang] ); | ||
loadState(); | loadState(); | ||
خط ۲۸۳: | خط ۲۴۱: | ||
mw.loader.using( "jquery.client", main ); | mw.loader.using( "jquery.client", main ); | ||
})( jQuery ); | })( jQuery ); |