מדיה ויקי:Common.js: הבדלים בין גרסאות
מתוך ויקיתרופות
ערן רוזנטל (שיחה | תרומות) |
ערן רוזנטל (שיחה | תרומות) |
||
| שורה 37: | שורה 37: | ||
}); | }); | ||
}); | }); | ||
| + | |||
| + | |||
| + | /* additional toolbar buttons */ | ||
| + | if ( mw.user.options.get('usebetatoolbar')) { | ||
| + | mw.loader.using(['jquery.wikiEditor','jquery.wikiEditor.toolbar','ext.wikiEditor','ext.wikiEditor.toolbar'],function(){ | ||
| + | $(function() { | ||
| + | // קבוצה חדשה בתפריט מתקדם: | ||
| + | $( '#wpTextbox1' ).wikiEditor( 'addToToolbar', { | ||
| + | 'section': 'advanced', | ||
| + | 'groups': { | ||
| + | 'more': { | ||
| + | 'label': "" | ||
| + | } | ||
| + | } | ||
| + | } ); | ||
| + | |||
| + | // טקסט ממורכז | ||
| + | $( '#wpTextbox1' ).wikiEditor( 'addToToolbar', { | ||
| + | 'section': 'advanced', | ||
| + | 'group': 'more', | ||
| + | 'tools': { | ||
| + | 'center': { | ||
| + | label: 'טקסט ממורכז', | ||
| + | type: 'button', | ||
| + | icon: '//upload.wikimedia.org/wikipedia/commons/thumb/c/ce/Gnome-format-justify-center.svg/22px-Gnome-format-justify-center.svg.png', | ||
| + | action: { | ||
| + | type: 'encapsulate', | ||
| + | options: { | ||
| + | pre: '<center>', | ||
| + | peri: "טקסט ממורכז", | ||
| + | post: "</center>" | ||
| + | } | ||
| + | } | ||
| + | } | ||
| + | } | ||
| + | } ); | ||
| + | |||
| + | // טקסט מיושר לשמאל | ||
| + | $( '#wpTextbox1' ).wikiEditor( 'addToToolbar', { | ||
| + | 'section': 'advanced', | ||
| + | 'group': 'more', | ||
| + | 'tools': { | ||
| + | 'center': { | ||
| + | label: 'טקסט מיושר לשמאל', | ||
| + | type: 'button', | ||
| + | icon: '//upload.wikimedia.org/wikipedia/commons/thumb/c/ce/Gnome-format-justify-left.svg/22px-Gnome-format-justify-left.svg.png', | ||
| + | action: { | ||
| + | type: 'encapsulate', | ||
| + | options: { | ||
| + | pre: '<div class="mw-content-ltr">', | ||
| + | peri: "טקסט מיושר לשמאל", | ||
| + | post: "</div>" | ||
| + | } | ||
| + | } | ||
| + | } | ||
| + | } | ||
| + | } ); | ||
| + | }); | ||
| + | }); | ||
| + | } | ||
גרסה מתאריך 20:00, 26 בינואר 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
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['*'];
$('<div class="jThumbnailScroller"><div class="jTscrollerContainer"><div class="jTscroller">'+banner+'</div>').insertAfter('#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
});
});
});
});
/* additional toolbar buttons */
if ( mw.user.options.get('usebetatoolbar')) {
mw.loader.using(['jquery.wikiEditor','jquery.wikiEditor.toolbar','ext.wikiEditor','ext.wikiEditor.toolbar'],function(){
$(function() {
// קבוצה חדשה בתפריט מתקדם:
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
'section': 'advanced',
'groups': {
'more': {
'label': ""
}
}
} );
// טקסט ממורכז
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
'section': 'advanced',
'group': 'more',
'tools': {
'center': {
label: 'טקסט ממורכז',
type: 'button',
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/c/ce/Gnome-format-justify-center.svg/22px-Gnome-format-justify-center.svg.png',
action: {
type: 'encapsulate',
options: {
pre: '<center>',
peri: "טקסט ממורכז",
post: "</center>"
}
}
}
}
} );
// טקסט מיושר לשמאל
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
'section': 'advanced',
'group': 'more',
'tools': {
'center': {
label: 'טקסט מיושר לשמאל',
type: 'button',
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/c/ce/Gnome-format-justify-left.svg/22px-Gnome-format-justify-left.svg.png',
action: {
type: 'encapsulate',
options: {
pre: '<div class="mw-content-ltr">',
peri: "טקסט מיושר לשמאל",
post: "</div>"
}
}
}
}
} );
});
});
}