מדיה ויקי:Common.js: הבדלים בין גרסאות
מתוך ויקיתרופות
ערן רוזנטל (שיחה | תרומות) |
ערן רוזנטל (שיחה | תרומות) |
||
שורה 53: | שורה 53: | ||
// drug pages | // drug pages | ||
$(function(){ | $(function(){ | ||
− | function | + | function hashChangeDrugHandler(){ |
try { | try { | ||
var decoded = decodeURI(location.href.split("#")[1].replace(/\./g,'%')); | var decoded = decodeURI(location.href.split("#")[1].replace(/\./g,'%')); | ||
if (decoded=='נתוני_סל'){ | if (decoded=='נתוני_סל'){ | ||
$('.mw-customtoggle-healthBasket').click(); | $('.mw-customtoggle-healthBasket').click(); | ||
+ | } else if ($.inArray(decoded,['מצגות','הרצאות','מאמרים','MoreInfoForDoc'])>-1 && mw.user.isAnon()) | ||
+ | window.location.href = mw.util.wikiGetlink('מיוחד:כניסה לחשבון'); | ||
} | } | ||
} catch(e){} | } catch(e){} | ||
} | } | ||
− | $(window).on('hashchange', | + | $(window).on('hashchange', hashChangeDrugHandler); |
if($('.externalAlonLink a.external').length==0) return; | if($('.externalAlonLink a.external').length==0) return; |
גרסה מתאריך 10:48, 14 באפריל 2014
/* כל סקריפט JavaScript שנכתב כאן ירוץ עבור כל המשתמשים בכל טעינת עמוד */ /* line break after reg owner */ $('.mw-normal-catlinks a[title^="קטגוריה:בעל רישום"]').parent().next().css('border-right','none').before('<br>'); //adds print link var printButton = $('"<li id="printTab"><span><a href="#" title="להדפסת הדף">הדפסה</a></span></li>').click(function(){ window.print(); }); $('#p-views ul').prepend ( printButton ) ; //banner if($.inArray('user',wgUserGroups)!=-1) { mw.loader.using(['jquery.thumbnailScroller', 'mediawiki.api'], function(){ $(function(){ var api=new mw.Api(); api.get({ action: 'parse', page: 'תבנית:באנר תחתון', prop: 'text' }).then(function (data){ var banner = data.parse.text['*']; var inPlaceholder = $('#bannerPlaceholder').length; var scroller = $('<div class="jThumbnailScroller"><div class="jTscrollerContainer"><div class="jTscroller">'+banner+'</div>'); if(inPlaceholder){ scroller.css('margin-top','2em'); } scroller.appendTo(inPlaceholder? '#bannerPlaceholder' : '#mw-content-text').thumbnailScroller({ scrollerType:"hoverPrecise", scrollerOrientation:"horizontal", scrollSpeed:2, scrollEasing:"easeOutCirc", scrollEasingAmount:600, acceleration:4, scrollSpeed:800, noScrollCenterSpace:10, autoScrolling:10, autoScrollingSpeed:5000, autoScrollingEasing:"easeInOutQuad", autoScrollingDelay:500 }); }); }); }); } if(wgAction == "edit" || wgAction == "submit") importScript("MediaWiki:Edit.js"); if(wgPageName=='מיוחד:חיפוש'){ $($('h2').get(1)).hide().next().hide(); } // drug pages $(function(){ function hashChangeDrugHandler(){ try { var decoded = decodeURI(location.href.split("#")[1].replace(/\./g,'%')); if (decoded=='נתוני_סל'){ $('.mw-customtoggle-healthBasket').click(); } else if ($.inArray(decoded,['מצגות','הרצאות','מאמרים','MoreInfoForDoc'])>-1 && mw.user.isAnon()) window.location.href = mw.util.wikiGetlink('מיוחד:כניסה לחשבון'); } } catch(e){} } $(window).on('hashchange', hashChangeDrugHandler); if($('.externalAlonLink a.external').length==0) return; mw.loader.using('jquery.ui.dialog', function(){ $('.externalAlonLink a.external').click(function(e){ var dest = $(this).attr('href'); $('<div style="text-align:center;" />').append($('<iframe style="width:800px;height:640px;" />').attr("src", dest)).dialog({ width: '860', height: '700', title: 'עלון לרופא' }); e.preventDefault(); }) }); });