Widget:Sandbox: Difference between revisions

Jump to navigation Jump to search
Matt Pijoan (talk | contribs)
No edit summary
Matt Pijoan (talk | contribs)
No edit summary
Line 724: Line 724:
}
}
function submitRating(type, score, page) {
function submitRating(type, score, page) {
      if(type === "difficulty"){
var api = new mw.Api();
var api = new mw.Api();
api.get({
api.get({
Line 729: Line 730:
username : mw.user.getName(),
username : mw.user.getName(),
question : page,
question : page,
type : score,
difficulty : score,
format : 'json'
format : 'json'
}, {
}, {
ok : function (res) {}
ok : function (res) {}
});
});
} else if (type === "yield"){
api.get({
action : 'wbrinsertrating',
username : mw.user.getName(),
question : page,
yield : score,
format : 'json'
}, {
ok : function (res) {}
});
else if (type === "quality"){
api.get({
action : 'wbrinsertrating',
username : mw.user.getName(),
question : page,
quality : score,
format : 'json'
}, {
ok : function (res) {}
});
}
}
}
function getRating(type, page) {
function getRating(type, page) {

Revision as of 21:05, 20 February 2014