מדיה ויקי:Mobile.js
הערה: לאחר הפרסום, ייתכן שיהיה צורך לנקות את זיכרון המטמון (cache) של הדפדפן כדי להבחין בשינויים.
- פיירפוקס / ספארי: להחזיק את המקש Shift בעת לחיצה על טעינה מחדש (Reload) או ללחוץ על צירוף המקשים Ctrl-F5 או Ctrl-R (במחשב מק: ⌘-R).
- גוגל כרום: ללחוץ על צירוף המקשים Ctrl-Shift-R (במחשב מק: ⌘-Shift-R).
- אינטרנט אקספלורר / אדג': להחזיק את המקש Ctrl בעת לחיצה על רענן (Refresh) או ללחוץ על צירוף המקשים Ctrl-F5.
- אופרה: ללחוץ על Ctrl-F5.
/* כל הסקריפטים הנכתבים כאן ייטענו עבור הגולשים באתר למכשירים ניידים בלבד */
function touchFriendlyTooltip() {
var targets = $( '.TooltipPhrase' ),
target = false, tooltip = false, title = false;
targets.on( 'mouseenter', function() {
$(".TooltipTip").remove(); // clear other tooltips before showing a new one
target = $( this );
tip = target.find(".TooltipSpan").html();
tooltip = $( '<div id="tooltip" class="TooltipTip"></div>' );
tooltip.css( 'opacity', 0 ).html( tip ).appendTo( 'body' );
var init_tooltip = function()
{
if( $( window ).width() < tooltip.outerWidth() * 1.5 )
tooltip.css( 'max-width', $( window ).width() / 2 );
else
tooltip.css( 'max-width', 340 );
var pos_left = target.offset().left + ( target.outerWidth() / 2 ) - ( tooltip.outerWidth() / 2 ),
pos_top = target.offset().top + target.outerHeight() + 2;
if( pos_left < 0 )
pos_left = target.offset().left + target.outerWidth() / 2 - 20;
if( pos_left + tooltip.outerWidth() > $( window ).width() )
pos_left = target.offset().left - tooltip.outerWidth() + target.outerWidth() / 2 + 20;
target.css( { color: "gray" } );
tooltip.css( { left: pos_left, top: pos_top, opacity: 0.95 } );
};
init_tooltip();
$( window ).resize( init_tooltip );
var remove_tooltip = function() {
tooltip.animate( { opacity: 0 }, 1000, function() {
// wait 1 sec until hiding, to allow click on a link
$( this ).remove();
});
target.css({ color: "" });
};
target.on( 'mouseleave', remove_tooltip );
tooltip.on( 'click', remove_tooltip ); // for mobile
});
}
$(document).ready(touchFriendlyTooltip);
// simpler version than in מדיה_ויקי:Common.js
function createNavigationBarToggleButton() {
$(".NavFrame").click(function() {
$(this).find(".NavContent").toggle("slow");
});
$(".NavContent").css("display", "none");
$(".mw-collapsible" ).click(function() {
$(this).find(".mw-collapsible").toggle("slow");
});
$(".mw-collapsible").css("display", "none");
}
$(document).ready(createNavigationBarToggleButton);