מדיה ויקי:VisualEditor customization.js: הבדלים בין גרסאות בדף
קפיצה לניווט
קפיצה לחיפוש
יצירת דף עם התוכן "mw.loader.using('ext.visualEditor.desktopArticleTarget.init').done(function() { // כאן תוכל להוסיף את הקוד שלך להתאמה אישית של העריכה החזותית // לדוגמה: הוספת אפשרויות יישור שורות });" |
אין תקציר עריכה |
||
| שורה 1: | שורה 1: | ||
mw.loader.using('ext.visualEditor.desktopArticleTarget.init').done(function() { | mw.loader.using('ext.visualEditor.desktopArticleTarget.init').done(function() { | ||
// | // טוען את העורך החזותי | ||
// | mw.loader.load('https://www.mediawiki.org/w/index.php?title=User:YourUsername/VisualEditor_customization.js&action=raw&ctype=text/javascript'); | ||
// הוספת אפשרויות יישור שורות | |||
ve.ui.MWFormatAction.static.nameToTag = Object.assign({}, ve.ui.MWFormatAction.static.nameToTag, { | |||
'align-left': { tag: 'p', attributes: { 'style': 'text-align:left;' } }, | |||
'align-center': { tag: 'p', attributes: { 'style': 'text-align:center;' } }, | |||
'align-right': { tag: 'p', attributes: { 'style': 'text-align:right;' } }, | |||
'align-justify': { tag: 'p', attributes: { 'style': 'text-align:justify;' } } | |||
}); | |||
ve.ui.MWToolbar.addButtonGroup('align', [ | |||
{ | |||
'name': 'align-left', | |||
'icon': 'align-left', | |||
'title': 'Align Left', | |||
'action': 'align-left' | |||
}, | |||
{ | |||
'name': 'align-center', | |||
'icon': 'align-center', | |||
'title': 'Align Center', | |||
'action': 'align-center' | |||
}, | |||
{ | |||
'name': 'align-right', | |||
'icon': 'align-right', | |||
'title': 'Align Right', | |||
'action': 'align-right' | |||
}, | |||
{ | |||
'name': 'align-justify', | |||
'icon': 'align-justify', | |||
'title': 'Align Justify', | |||
'action': 'align-justify' | |||
} | |||
]); | |||
}); | }); | ||
גרסה מ־19:57, 14 באוגוסט 2024
mw.loader.using('ext.visualEditor.desktopArticleTarget.init').done(function() {
// טוען את העורך החזותי
mw.loader.load('https://www.mediawiki.org/w/index.php?title=User:YourUsername/VisualEditor_customization.js&action=raw&ctype=text/javascript');
// הוספת אפשרויות יישור שורות
ve.ui.MWFormatAction.static.nameToTag = Object.assign({}, ve.ui.MWFormatAction.static.nameToTag, {
'align-left': { tag: 'p', attributes: { 'style': 'text-align:left;' } },
'align-center': { tag: 'p', attributes: { 'style': 'text-align:center;' } },
'align-right': { tag: 'p', attributes: { 'style': 'text-align:right;' } },
'align-justify': { tag: 'p', attributes: { 'style': 'text-align:justify;' } }
});
ve.ui.MWToolbar.addButtonGroup('align', [
{
'name': 'align-left',
'icon': 'align-left',
'title': 'Align Left',
'action': 'align-left'
},
{
'name': 'align-center',
'icon': 'align-center',
'title': 'Align Center',
'action': 'align-center'
},
{
'name': 'align-right',
'icon': 'align-right',
'title': 'Align Right',
'action': 'align-right'
},
{
'name': 'align-justify',
'icon': 'align-justify',
'title': 'Align Justify',
'action': 'align-justify'
}
]);
});