۵٬۱۲۰
ویرایش
بدون خلاصۀ ویرایش |
بدون خلاصۀ ویرایش |
||
خط ۲۶: | خط ۲۶: | ||
*/ | */ | ||
var msg = { | var msg = { | ||
toggleTabText: "Toggle sidebar", | |||
toggleTabTitle: "Hide or show the sidebar" | |||
}; | |||
/** | |||
* Translations for messages displayed by this script. | |||
* To have your translations added, please contact this script's maintainer. | |||
*/ | |||
var translations = { | |||
fa: { | |||
toggleTabText: "تغییر وضعیت نوار سمت راست", | toggleTabText: "تغییر وضعیت نوار سمت راست", | ||
toggleTabTitle: "مخفی یا نمایش نوار سمت راست", | toggleTabTitle: "مخفی یا نمایش نوار سمت راست", | ||
} | |||
}; | }; | ||
خط ۳۸: | خط ۴۹: | ||
* The text direction of the page. | * The text direction of the page. | ||
*/ | */ | ||
var dir = " | var dir = "ltr"; | ||
/** | /** | ||
خط ۴۹: | خط ۶۰: | ||
*/ | */ | ||
var nodes = {}; | var nodes = {}; | ||
/** | |||
* Equivalent CSS property names for RTL pages. | |||
*/ | |||
var cssRTLProps = { | |||
"left": "right", | |||
"margin-left": "margin-right" | |||
}; | |||
/** | |||
* Changes the CSS property name as appropriate for the page's text direction. | |||
* @param prop {string} The CSS property name to be changed. | |||
*/ | |||
function flipCSSProp(prop) { | |||
if ( dir === "rtl" && cssRTLProps[prop] ) { | |||
return cssRTLProps[prop]; | |||
} | |||
return prop; | |||
} | |||
/** | /** | ||
* Loads the current state from sessionStorage (preferred) or localStorage. | * Loads the current state from sessionStorage (preferred) or localStorage. | ||
خط ۱۰۰: | خط ۱۳۰: | ||
mwPanelNonIE: {opacity: 0}, | mwPanelNonIE: {opacity: 0}, | ||
notSidebar: {}, | notSidebar: {}, | ||
leftNavigation: {} | leftNavigation: {} | ||
}; | }; | ||
animations.mwPanelIE[ " | animations.mwPanelIE[ flipCSSProp("left") ] = "-10em"; | ||
animations.mwPanelNonIE[ " | animations.mwPanelNonIE[ flipCSSProp("left") ] = "-10em"; | ||
animations.notSidebar[ "margin- | animations.notSidebar[ flipCSSProp("margin-left") ] = 0; | ||
animations.leftNavigation[ " | animations.leftNavigation[ flipCSSProp("left") ] = "1em"; | ||
if ( isOldIE ) { | if ( isOldIE ) { | ||
nodes.$mwPanel.animate( animations.mwPanelIE, duration, function() { | nodes.$mwPanel.animate( animations.mwPanelIE, duration, function() { | ||
خط ۱۲۶: | خط ۱۵۳: | ||
nodes.$leftNavigation.animate( animations.leftNavigation, duration); | nodes.$leftNavigation.animate( animations.leftNavigation, duration); | ||
$("collsidebar").css("background-image", "url('/images/thumb/c/cf/Left.png/20px-Left.png')"); | |||
state = "collapsed"; | state = "collapsed"; | ||
خط ۱۴۶: | خط ۱۷۵: | ||
}; | }; | ||
animations.mwPanelIE[ " | animations.mwPanelIE[ flipCSSProp("left") ] = "-0.01em"; | ||
animations.mwPanelNonIE[ " | animations.mwPanelNonIE[ flipCSSProp("left") ] = 0; | ||
animations.notSidebar[ "margin- | animations.notSidebar[ flipCSSProp("margin-left") ] = "10em"; | ||
animations.leftNavigation[ " | animations.leftNavigation[ flipCSSProp("left") ] = "10em"; | ||
if ( isOldIE ) { | if ( isOldIE ) { | ||
nodes.$mwPanel.animate( animations.mwPanelIE, duration, function () { | nodes.$mwPanel.animate( animations.mwPanelIE, duration, function () { | ||
nodes.$mwPanel.css( " | nodes.$mwPanel.css( flipCSSProp("left"), "0em" ); | ||
}); | }); | ||
} else { | } else { | ||
خط ۱۵۹: | خط ۱۸۸: | ||
} | } | ||
nodes.$content.css( "background-image", "" ); | |||
nodes.$notSidebar.animate( animations.notSidebar, duration ); | nodes.$notSidebar.animate( animations.notSidebar, duration ); | ||
nodes.$leftNavigation.animate( animations.leftNavigation, duration ); | nodes.$leftNavigation.animate( animations.leftNavigation, duration ); | ||
خط ۱۸۸: | خط ۲۱۸: | ||
collapse( 0 ); | collapse( 0 ); | ||
} | } | ||
} | } | ||
ویرایش