mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 16:32:18 +02:00
Merge branch 'MDL-61405-master' of git://github.com/damyon/moodle
This commit is contained in:
commit
933f48b4a3
@ -1 +1 @@
|
||||
define(["jquery","core/notification","core/ajax","core/templates"],function(a,b,c,d){var e=function(b){this._regionSelector=b,this._region=a(b),this._userCache={},a(document).on("user-changed",this._refreshUserInfo.bind(this))};return e.prototype._regionSelector=null,e.prototype._userCache=null,e.prototype._region=null,e.prototype._lastUserId=0,e.prototype._getAssignmentId=function(){return this._region.attr("data-assignmentid")},e.prototype._refreshUserInfo=function(e,f){var g=a.Deferred();this._lastUserId!=f&&(this._lastUserId=f,d.render("mod_assign/loading",{}).done(function(e,h){if(this._region.fadeOut("fast",function(){d.replaceNodeContents(this._region,e,h),this._region.fadeIn("fast")}.bind(this)),f<0)return void d.render("mod_assign/grading_navigation_no_users",{}).done(function(a,b){f==this._lastUserId&&this._region.fadeOut("fast",function(){d.replaceNodeContents(this._region,a,b),this._region.fadeIn("fast")}.bind(this))}.bind(this)).fail(b.exception);if("undefined"!=typeof this._userCache[f])g.resolve(this._userCache[f]);else{var i=this._getAssignmentId(),j=c.call([{methodname:"mod_assign_get_participant",args:{userid:f,assignid:i,embeduser:!0}}]);j[0].done(function(a){a.hasOwnProperty("id")?(this._userCache[f]=a,g.resolve(this._userCache[f])):g.reject("No users")}.bind(this)).fail(b.exception)}g.done(function(c){var e=a("[data-showuseridentity]").data("showuseridentity").split(","),g=[];c.courseid=a('[data-region="grading-navigation-panel"]').attr("data-courseid"),c.user&&(a.each(e,function(a,b){"undefined"!=typeof c.user[b]&&""!==c.user[b]&&(c.hasidentity=!0,g.push(c.user[b]))}),c.identity=g.join(", "),c.user.profileimageurl&&(c.profileimageurl=c.user.profileimageurl)),d.render("mod_assign/grading_navigation_user_summary",c).done(function(a,b){f==this._lastUserId&&this._region.fadeOut("fast",function(){d.replaceNodeContents(this._region,a,b),this._region.fadeIn("fast")}.bind(this))}.bind(this)).fail(b.exception)}.bind(this)).fail(function(){d.render("mod_assign/grading_navigation_no_users",{}).done(function(a,b){this._region.fadeOut("fast",function(){d.replaceNodeContents(this._region,a,b),this._region.fadeIn("fast")}.bind(this))}.bind(this)).fail(b.exception)}.bind(this))}.bind(this)).fail(b.exception))},e});
|
||||
define(["jquery","core/notification","core/ajax","core/templates"],function(a,b,c,d){var e=function(b){this._regionSelector=b,this._region=a(b),this._userCache={},a(document).on("user-changed",this._refreshUserInfo.bind(this))};return e.prototype._regionSelector=null,e.prototype._userCache=null,e.prototype._region=null,e.prototype._lastUserId=0,e.prototype._getAssignmentId=function(){return this._region.attr("data-assignmentid")},e.prototype._refreshUserInfo=function(e,f){var g=a.Deferred();this._region.attr("data-userid",f),this._lastUserId!=f&&(this._lastUserId=f,d.render("mod_assign/loading",{}).done(function(e,h){if(this._region.fadeOut("fast",function(){d.replaceNodeContents(this._region,e,h),this._region.fadeIn("fast")}.bind(this)),f<0)return void d.render("mod_assign/grading_navigation_no_users",{}).done(function(a,b){f==this._lastUserId&&this._region.fadeOut("fast",function(){d.replaceNodeContents(this._region,a,b),this._region.fadeIn("fast")}.bind(this))}.bind(this)).fail(b.exception);if("undefined"!=typeof this._userCache[f])g.resolve(this._userCache[f]);else{var i=this._getAssignmentId(),j=c.call([{methodname:"mod_assign_get_participant",args:{userid:f,assignid:i,embeduser:!0}}]);j[0].done(function(a){a.hasOwnProperty("id")?(this._userCache[f]=a,g.resolve(this._userCache[f])):g.reject("No users")}.bind(this)).fail(b.exception)}g.done(function(c){var e=a("[data-showuseridentity]").data("showuseridentity").split(","),g=[];c.courseid=a('[data-region="grading-navigation-panel"]').attr("data-courseid"),c.user&&(a.each(e,function(a,b){"undefined"!=typeof c.user[b]&&""!==c.user[b]&&(c.hasidentity=!0,g.push(c.user[b]))}),c.identity=g.join(", "),c.user.profileimageurl&&(c.profileimageurl=c.user.profileimageurl)),d.render("mod_assign/grading_navigation_user_summary",c).done(function(a,b){f==this._lastUserId&&this._region.fadeOut("fast",function(){d.replaceNodeContents(this._region,a,b),this._region.fadeIn("fast")}.bind(this))}.bind(this)).fail(b.exception)}.bind(this)).fail(function(){d.render("mod_assign/grading_navigation_no_users",{}).done(function(a,b){this._region.fadeOut("fast",function(){d.replaceNodeContents(this._region,a,b),this._region.fadeIn("fast")}.bind(this))}.bind(this)).fail(b.exception)}.bind(this))}.bind(this)).fail(b.exception))},e});
|
@ -73,6 +73,9 @@ define(['jquery', 'core/notification', 'core/ajax', 'core/templates'], function(
|
||||
UserInfo.prototype._refreshUserInfo = function(event, userid) {
|
||||
var promise = $.Deferred();
|
||||
|
||||
// Put the current user ID in the DOM so yui can access it.
|
||||
this._region.attr('data-userid', userid);
|
||||
|
||||
// Skip reloading if it is the same user.
|
||||
if (this._lastUserId == userid) {
|
||||
return;
|
||||
|
@ -48,6 +48,7 @@ var AJAXBASE = M.cfg.wwwroot + '/mod/assign/feedback/editpdf/ajax.php',
|
||||
UNSAVEDCHANGESDIV: '.assignfeedback_editpdf_warningmessages',
|
||||
UNSAVEDCHANGESINPUT: 'input[name="assignfeedback_editpdf_haschanges"]',
|
||||
STAMPSBUTTON: '.currentstampbutton',
|
||||
USERINFOREGION: '[data-region="user-info"]',
|
||||
DIALOGUE: '.' + CSS.DIALOGUE
|
||||
},
|
||||
SELECTEDBORDERCOLOUR = 'rgba(200, 200, 255, 0.9)',
|
||||
@ -3732,9 +3733,7 @@ EDITOR.prototype = {
|
||||
* @method poll_document_conversion_status
|
||||
*/
|
||||
poll_document_conversion_status: function() {
|
||||
if (this.get('destroyed')) {
|
||||
return;
|
||||
}
|
||||
var requestUserId = this.get('userid');
|
||||
|
||||
Y.io(AJAXBASE, {
|
||||
method: 'get',
|
||||
@ -3750,6 +3749,15 @@ EDITOR.prototype = {
|
||||
},
|
||||
on: {
|
||||
success: function(tid, response) {
|
||||
var currentUserRegion = Y.one(SELECTOR.USERINFOREGION);
|
||||
if (currentUserRegion) {
|
||||
var currentUserId = currentUserRegion.getAttribute('data-userid');
|
||||
if (currentUserId && (currentUserId != requestUserId)) {
|
||||
// Polling conversion status needs to abort because
|
||||
// the current user changed.
|
||||
return;
|
||||
}
|
||||
}
|
||||
var data = this.handle_response_data(response),
|
||||
poll = false;
|
||||
if (data) {
|
||||
@ -3798,9 +3806,6 @@ EDITOR.prototype = {
|
||||
* @method get_images_for_documents
|
||||
*/
|
||||
start_document_to_image_conversion: function() {
|
||||
if (this.get('destroyed')) {
|
||||
return;
|
||||
}
|
||||
Y.io(AJAXBASE, {
|
||||
method: 'get',
|
||||
context: this,
|
||||
@ -3933,9 +3938,6 @@ EDITOR.prototype = {
|
||||
* @method update_page_load_progress
|
||||
*/
|
||||
update_page_load_progress: function() {
|
||||
if (this.get('destroyed')) {
|
||||
return;
|
||||
}
|
||||
var checkconversionstatus,
|
||||
ajax_error_total = 0,
|
||||
progressbar = this.get_dialogue_element(SELECTOR.PROGRESSBARCONTAINER + ' .bar');
|
||||
@ -3958,9 +3960,6 @@ EDITOR.prototype = {
|
||||
},
|
||||
on: {
|
||||
success: function(tid, response) {
|
||||
if (this.get('destroyed')) {
|
||||
return;
|
||||
}
|
||||
ajax_error_total = 0;
|
||||
|
||||
var progress = 0;
|
||||
@ -3982,9 +3981,6 @@ EDITOR.prototype = {
|
||||
}
|
||||
},
|
||||
failure: function(tid, response) {
|
||||
if (this.get('destroyed')) {
|
||||
return;
|
||||
}
|
||||
ajax_error_total = ajax_error_total + 1;
|
||||
// We only continue on error if the all pages were not generated,
|
||||
// and if the ajax call did not produce 5 errors in the row.
|
||||
@ -4017,9 +4013,6 @@ EDITOR.prototype = {
|
||||
* @return {object}
|
||||
*/
|
||||
handle_response_data: function(response) {
|
||||
if (this.get('destroyed')) {
|
||||
return;
|
||||
}
|
||||
var data;
|
||||
try {
|
||||
data = Y.JSON.parse(response.responseText);
|
||||
@ -4505,9 +4498,6 @@ EDITOR.prototype = {
|
||||
*/
|
||||
save_current_page: function() {
|
||||
this.clear_warnings(false);
|
||||
if (this.get('destroyed')) {
|
||||
return;
|
||||
}
|
||||
var ajaxurl = AJAXBASE,
|
||||
config;
|
||||
|
||||
@ -4651,7 +4641,9 @@ EDITOR.prototype = {
|
||||
}
|
||||
|
||||
page = this.pages[this.currentpage];
|
||||
this.loadingicon.hide();
|
||||
if (this.loadingicon) {
|
||||
this.loadingicon.hide();
|
||||
}
|
||||
drawingcanvas.setStyle('backgroundImage', 'url("' + page.url + '")');
|
||||
drawingcanvas.setStyle('width', page.width + 'px');
|
||||
drawingcanvas.setStyle('height', page.height + 'px');
|
||||
@ -4858,10 +4850,6 @@ M.assignfeedback_editpdf.editor = M.assignfeedback_editpdf.editor || {};
|
||||
* @param {Object} params
|
||||
*/
|
||||
M.assignfeedback_editpdf.editor.init = M.assignfeedback_editpdf.editor.init || function(params) {
|
||||
if (typeof M.assignfeedback_editpdf.instance !== 'undefined') {
|
||||
M.assignfeedback_editpdf.instance.destroy();
|
||||
}
|
||||
|
||||
M.assignfeedback_editpdf.instance = new EDITOR(params);
|
||||
return M.assignfeedback_editpdf.instance;
|
||||
};
|
||||
|
File diff suppressed because one or more lines are too long
@ -48,6 +48,7 @@ var AJAXBASE = M.cfg.wwwroot + '/mod/assign/feedback/editpdf/ajax.php',
|
||||
UNSAVEDCHANGESDIV: '.assignfeedback_editpdf_warningmessages',
|
||||
UNSAVEDCHANGESINPUT: 'input[name="assignfeedback_editpdf_haschanges"]',
|
||||
STAMPSBUTTON: '.currentstampbutton',
|
||||
USERINFOREGION: '[data-region="user-info"]',
|
||||
DIALOGUE: '.' + CSS.DIALOGUE
|
||||
},
|
||||
SELECTEDBORDERCOLOUR = 'rgba(200, 200, 255, 0.9)',
|
||||
@ -3732,9 +3733,7 @@ EDITOR.prototype = {
|
||||
* @method poll_document_conversion_status
|
||||
*/
|
||||
poll_document_conversion_status: function() {
|
||||
if (this.get('destroyed')) {
|
||||
return;
|
||||
}
|
||||
var requestUserId = this.get('userid');
|
||||
|
||||
Y.io(AJAXBASE, {
|
||||
method: 'get',
|
||||
@ -3750,6 +3749,15 @@ EDITOR.prototype = {
|
||||
},
|
||||
on: {
|
||||
success: function(tid, response) {
|
||||
var currentUserRegion = Y.one(SELECTOR.USERINFOREGION);
|
||||
if (currentUserRegion) {
|
||||
var currentUserId = currentUserRegion.getAttribute('data-userid');
|
||||
if (currentUserId && (currentUserId != requestUserId)) {
|
||||
// Polling conversion status needs to abort because
|
||||
// the current user changed.
|
||||
return;
|
||||
}
|
||||
}
|
||||
var data = this.handle_response_data(response),
|
||||
poll = false;
|
||||
if (data) {
|
||||
@ -3798,9 +3806,6 @@ EDITOR.prototype = {
|
||||
* @method get_images_for_documents
|
||||
*/
|
||||
start_document_to_image_conversion: function() {
|
||||
if (this.get('destroyed')) {
|
||||
return;
|
||||
}
|
||||
Y.io(AJAXBASE, {
|
||||
method: 'get',
|
||||
context: this,
|
||||
@ -3933,9 +3938,6 @@ EDITOR.prototype = {
|
||||
* @method update_page_load_progress
|
||||
*/
|
||||
update_page_load_progress: function() {
|
||||
if (this.get('destroyed')) {
|
||||
return;
|
||||
}
|
||||
var checkconversionstatus,
|
||||
ajax_error_total = 0,
|
||||
progressbar = this.get_dialogue_element(SELECTOR.PROGRESSBARCONTAINER + ' .bar');
|
||||
@ -3958,9 +3960,6 @@ EDITOR.prototype = {
|
||||
},
|
||||
on: {
|
||||
success: function(tid, response) {
|
||||
if (this.get('destroyed')) {
|
||||
return;
|
||||
}
|
||||
ajax_error_total = 0;
|
||||
|
||||
var progress = 0;
|
||||
@ -3982,9 +3981,6 @@ EDITOR.prototype = {
|
||||
}
|
||||
},
|
||||
failure: function(tid, response) {
|
||||
if (this.get('destroyed')) {
|
||||
return;
|
||||
}
|
||||
ajax_error_total = ajax_error_total + 1;
|
||||
// We only continue on error if the all pages were not generated,
|
||||
// and if the ajax call did not produce 5 errors in the row.
|
||||
@ -4017,9 +4013,6 @@ EDITOR.prototype = {
|
||||
* @return {object}
|
||||
*/
|
||||
handle_response_data: function(response) {
|
||||
if (this.get('destroyed')) {
|
||||
return;
|
||||
}
|
||||
var data;
|
||||
try {
|
||||
data = Y.JSON.parse(response.responseText);
|
||||
@ -4505,9 +4498,6 @@ EDITOR.prototype = {
|
||||
*/
|
||||
save_current_page: function() {
|
||||
this.clear_warnings(false);
|
||||
if (this.get('destroyed')) {
|
||||
return;
|
||||
}
|
||||
var ajaxurl = AJAXBASE,
|
||||
config;
|
||||
|
||||
@ -4651,7 +4641,9 @@ EDITOR.prototype = {
|
||||
}
|
||||
|
||||
page = this.pages[this.currentpage];
|
||||
this.loadingicon.hide();
|
||||
if (this.loadingicon) {
|
||||
this.loadingicon.hide();
|
||||
}
|
||||
drawingcanvas.setStyle('backgroundImage', 'url("' + page.url + '")');
|
||||
drawingcanvas.setStyle('width', page.width + 'px');
|
||||
drawingcanvas.setStyle('height', page.height + 'px');
|
||||
@ -4858,10 +4850,6 @@ M.assignfeedback_editpdf.editor = M.assignfeedback_editpdf.editor || {};
|
||||
* @param {Object} params
|
||||
*/
|
||||
M.assignfeedback_editpdf.editor.init = M.assignfeedback_editpdf.editor.init || function(params) {
|
||||
if (typeof M.assignfeedback_editpdf.instance !== 'undefined') {
|
||||
M.assignfeedback_editpdf.instance.destroy();
|
||||
}
|
||||
|
||||
M.assignfeedback_editpdf.instance = new EDITOR(params);
|
||||
return M.assignfeedback_editpdf.instance;
|
||||
};
|
||||
|
@ -457,9 +457,7 @@ EDITOR.prototype = {
|
||||
* @method poll_document_conversion_status
|
||||
*/
|
||||
poll_document_conversion_status: function() {
|
||||
if (this.get('destroyed')) {
|
||||
return;
|
||||
}
|
||||
var requestUserId = this.get('userid');
|
||||
|
||||
Y.io(AJAXBASE, {
|
||||
method: 'get',
|
||||
@ -475,6 +473,15 @@ EDITOR.prototype = {
|
||||
},
|
||||
on: {
|
||||
success: function(tid, response) {
|
||||
var currentUserRegion = Y.one(SELECTOR.USERINFOREGION);
|
||||
if (currentUserRegion) {
|
||||
var currentUserId = currentUserRegion.getAttribute('data-userid');
|
||||
if (currentUserId && (currentUserId != requestUserId)) {
|
||||
// Polling conversion status needs to abort because
|
||||
// the current user changed.
|
||||
return;
|
||||
}
|
||||
}
|
||||
var data = this.handle_response_data(response),
|
||||
poll = false;
|
||||
if (data) {
|
||||
@ -523,9 +530,6 @@ EDITOR.prototype = {
|
||||
* @method get_images_for_documents
|
||||
*/
|
||||
start_document_to_image_conversion: function() {
|
||||
if (this.get('destroyed')) {
|
||||
return;
|
||||
}
|
||||
Y.io(AJAXBASE, {
|
||||
method: 'get',
|
||||
context: this,
|
||||
@ -658,9 +662,6 @@ EDITOR.prototype = {
|
||||
* @method update_page_load_progress
|
||||
*/
|
||||
update_page_load_progress: function() {
|
||||
if (this.get('destroyed')) {
|
||||
return;
|
||||
}
|
||||
var checkconversionstatus,
|
||||
ajax_error_total = 0,
|
||||
progressbar = this.get_dialogue_element(SELECTOR.PROGRESSBARCONTAINER + ' .bar');
|
||||
@ -683,9 +684,6 @@ EDITOR.prototype = {
|
||||
},
|
||||
on: {
|
||||
success: function(tid, response) {
|
||||
if (this.get('destroyed')) {
|
||||
return;
|
||||
}
|
||||
ajax_error_total = 0;
|
||||
|
||||
var progress = 0;
|
||||
@ -707,9 +705,6 @@ EDITOR.prototype = {
|
||||
}
|
||||
},
|
||||
failure: function(tid, response) {
|
||||
if (this.get('destroyed')) {
|
||||
return;
|
||||
}
|
||||
ajax_error_total = ajax_error_total + 1;
|
||||
// We only continue on error if the all pages were not generated,
|
||||
// and if the ajax call did not produce 5 errors in the row.
|
||||
@ -742,9 +737,6 @@ EDITOR.prototype = {
|
||||
* @return {object}
|
||||
*/
|
||||
handle_response_data: function(response) {
|
||||
if (this.get('destroyed')) {
|
||||
return;
|
||||
}
|
||||
var data;
|
||||
try {
|
||||
data = Y.JSON.parse(response.responseText);
|
||||
@ -1230,9 +1222,6 @@ EDITOR.prototype = {
|
||||
*/
|
||||
save_current_page: function() {
|
||||
this.clear_warnings(false);
|
||||
if (this.get('destroyed')) {
|
||||
return;
|
||||
}
|
||||
var ajaxurl = AJAXBASE,
|
||||
config;
|
||||
|
||||
@ -1376,7 +1365,9 @@ EDITOR.prototype = {
|
||||
}
|
||||
|
||||
page = this.pages[this.currentpage];
|
||||
this.loadingicon.hide();
|
||||
if (this.loadingicon) {
|
||||
this.loadingicon.hide();
|
||||
}
|
||||
drawingcanvas.setStyle('backgroundImage', 'url("' + page.url + '")');
|
||||
drawingcanvas.setStyle('width', page.width + 'px');
|
||||
drawingcanvas.setStyle('height', page.height + 'px');
|
||||
@ -1583,10 +1574,6 @@ M.assignfeedback_editpdf.editor = M.assignfeedback_editpdf.editor || {};
|
||||
* @param {Object} params
|
||||
*/
|
||||
M.assignfeedback_editpdf.editor.init = M.assignfeedback_editpdf.editor.init || function(params) {
|
||||
if (typeof M.assignfeedback_editpdf.instance !== 'undefined') {
|
||||
M.assignfeedback_editpdf.instance.destroy();
|
||||
}
|
||||
|
||||
M.assignfeedback_editpdf.instance = new EDITOR(params);
|
||||
return M.assignfeedback_editpdf.instance;
|
||||
};
|
||||
|
@ -46,6 +46,7 @@ var AJAXBASE = M.cfg.wwwroot + '/mod/assign/feedback/editpdf/ajax.php',
|
||||
UNSAVEDCHANGESDIV: '.assignfeedback_editpdf_warningmessages',
|
||||
UNSAVEDCHANGESINPUT: 'input[name="assignfeedback_editpdf_haschanges"]',
|
||||
STAMPSBUTTON: '.currentstampbutton',
|
||||
USERINFOREGION: '[data-region="user-info"]',
|
||||
DIALOGUE: '.' + CSS.DIALOGUE
|
||||
},
|
||||
SELECTEDBORDERCOLOUR = 'rgba(200, 200, 255, 0.9)',
|
||||
|
Loading…
x
Reference in New Issue
Block a user