מדיה ויקי:Gadget-UserMessages.js: הבדלים בין גרסאות בדף

←using [[mw:CodeEditor|CodeEditor]]: גם בדף השיחה של המשתמש (אם כי אז הכותרת יוצאת קצת עקומה)
←using [[mw:CodeEditor|CodeEditor]]: כטוב בעיניכם.
שורה 75: שורה 75:


function doIt() {
function doIt() {
var summary = 'תבנית ' + template,
var title = $('#mw-diff-ntitle2 a:first').length
message = '\n==[[' + mw.config.get('wgPageName') + ']]==\n' +
? '[[' + mw.config.get('wgPageName') + ']]'
: template,
summary = 'תבנית ' + template,
message = '\n== ' + title + ' ==\n' +
'{{ס:' + template + (needParam ? '|' + paramfield.val() : '') + "}} ~~" + "~~";
'{{ס:' + template + (needParam ? '|' + paramfield.val() : '') + "}} ~~" + "~~";
dialog.css({cursor: 'wait'})
dialog.css({cursor: 'wait'});
$.ajax({
$.ajax({
url: mw.util.wikiScript('api'),
url: mw.util.wikiScript('api'),
שורה 85: שורה 88:
data: {action: 'edit', title: 'שיחת משתמש:' + user, summary: summary, token: mw.user.tokens.get('editToken'), appendtext: message, format:'json'},
data: {action: 'edit', title: 'שיחת משתמש:' + user, summary: summary, token: mw.user.tokens.get('editToken'), appendtext: message, format:'json'},
success: function(data){
success: function(data){
dialog.css({pointer: ''});
dialog.css({cursor: ''});
dialog.dialog('close');
dialog.dialog('close');
},
},