מדיה ויקי:Gadget-UserMessages.js: הבדלים בין גרסאות בדף
debugging - to be removed shortly. |
ffv |
||
| שורה 79: | שורה 79: | ||
'{{ס:' + template + (needParam ? '|' + paramfield.val() : '') + "}} ~~" + "~~"; | '{{ס:' + template + (needParam ? '|' + paramfield.val() : '') + "}} ~~" + "~~"; | ||
dialog.css({cursor: 'wait'}); | dialog.css({cursor: 'wait'}); | ||
new mw.Api().edit( { | var pname = 'שיחת משתמש:' + user; | ||
new mw.Api().edit( pname, function() { return { summary: summary, appendtext: message } } ) | |||
.done( function(data) { | .done( function(data) { | ||
if (data && data.edit && data.edit.result === "Success") { | if (data && data.edit && data.edit.result === "Success") { | ||
| שורה 94: | שורה 91: | ||
} else | } else | ||
dialog.append($('<p>').css({color: 'red'}).text('כנראה אירעה תקלה. אנא בידקו ב"תרומות המשתמש" שלכם מה בדיוק קרה')); | dialog.append($('<p>').css({color: 'red'}).text('כנראה אירעה תקלה. אנא בידקו ב"תרומות המשתמש" שלכם מה בדיוק קרה')); | ||
} ).fail( function(data) { | } ) | ||
.fail( function(data) { | |||
dialog.append($('<p>').css({color: 'red'}).text('תקלה. התבנית לא נשמרה בדף השיחה של המשתמש')); | |||
} ); | } ); | ||
} | } | ||