diff --git a/mod/assign/feedback/editpdf/yui/build/moodle-assignfeedback_editpdf-editor/moodle-assignfeedback_editpdf-editor-debug.js b/mod/assign/feedback/editpdf/yui/build/moodle-assignfeedback_editpdf-editor/moodle-assignfeedback_editpdf-editor-debug.js
index 596582f2252..7fc1ae54c25 100644
--- a/mod/assign/feedback/editpdf/yui/build/moodle-assignfeedback_editpdf-editor/moodle-assignfeedback_editpdf-editor-debug.js
+++ b/mod/assign/feedback/editpdf/yui/build/moodle-assignfeedback_editpdf-editor/moodle-assignfeedback_editpdf-editor-debug.js
@@ -667,9 +667,11 @@ Y.extend(ANNOTATION, Y.Base, {
* @method remove
* @param event
*/
- remove : function() {
+ remove : function(e) {
var annotations;
+ e.preventDefault();
+
annotations = this.editor.pages[this.editor.currentpage].annotations;
for (i = 0; i < annotations.length; i++) {
if (annotations[i] === this) {
@@ -1577,7 +1579,7 @@ Y.extend(DROPDOWN, M.core.dialogue, {
}
}, this);
- button.on('click', this.show, this);
+ button.on('click', function(e) {e.preventDefault(); this.show();}, this);
button.on('key', this.show, 'enter,space', this);
},
@@ -1682,6 +1684,8 @@ Y.extend(COLOURPICKER, M.assignfeedback_editpdf.dropdown, {
COLOURPICKER.superclass.initializer.call(this, config);
},
callback_handler : function(e) {
+ e.preventDefault();
+
var callback = this.get('callback'),
callbackcontext = this.get('context'),
bind;
@@ -1798,6 +1802,7 @@ Y.extend(STAMPPICKER, M.assignfeedback_editpdf.dropdown, {
STAMPPICKER.superclass.initializer.call(this, config);
},
callback_handler : function(e) {
+ e.preventDefault();
var callback = this.get('callback'),
callbackcontext = this.get('context'),
bind;
@@ -1890,7 +1895,7 @@ Y.extend(COMMENTMENU, M.assignfeedback_editpdf.dropdown, {
commentlinks.append(link);
link = Y.Node.create('
' + M.util.get_string('deletecomment', 'assignfeedback_editpdf') + '');
- link.on('click', function() { comment.menu.hide(); comment.remove(); }, comment);
+ link.on('click', function(e) { e.preventDefault(); this.menu.hide(); this.remove(); }, comment);
link.on('key', function() { comment.menu.hide(); comment.remove(); }, 'enter,space', comment);
commentlinks.append(link);
@@ -2056,6 +2061,7 @@ Y.extend(COMMENTSEARCH, M.core.dialogue, {
* @method focus_on_comment
*/
focus_on_comment : function(e) {
+ e.preventDefault();
var target = e.target.ancestor('li'),
comment = target.getData('comment'),
editor = this.get('editor');
@@ -2447,6 +2453,8 @@ COMMENT = function(editor, gradeid, pageno, x, y, width, colour, rawtext) {
* @method remove_from_quicklist
*/
this.remove_from_quicklist = function(e, quickcomment) {
+ e.preventDefault();
+
this.menu.hide();
this.editor.quicklist.remove(quickcomment);
@@ -2460,6 +2468,8 @@ COMMENT = function(editor, gradeid, pageno, x, y, width, colour, rawtext) {
* @method set_from_quick_comment
*/
this.set_from_quick_comment = function(e, quickcomment) {
+ e.preventDefault();
+
this.menu.hide();
this.rawtext = quickcomment.rawtext;
@@ -2477,7 +2487,8 @@ COMMENT = function(editor, gradeid, pageno, x, y, width, colour, rawtext) {
* @protected
* @method add_to_quicklist
*/
- this.add_to_quicklist = function() {
+ this.add_to_quicklist = function(e) {
+ e.preventDefault();
this.menu.hide();
this.editor.quicklist.add(this);
};
@@ -3740,7 +3751,8 @@ EDITOR.prototype = {
* @protected
* @method previous_page
*/
- previous_page : function() {
+ previous_page : function(e) {
+ e.preventDefault();
this.currentpage--;
if (this.currentpage < 0) {
this.currentpage = 0;
@@ -3753,7 +3765,8 @@ EDITOR.prototype = {
* @protected
* @method next_page
*/
- next_page : function() {
+ next_page : function(e) {
+ e.preventDefault();
this.currentpage++;
if (this.currentpage >= this.pages.length) {
this.currentpage = this.pages.length - 1;
diff --git a/mod/assign/feedback/editpdf/yui/build/moodle-assignfeedback_editpdf-editor/moodle-assignfeedback_editpdf-editor-min.js b/mod/assign/feedback/editpdf/yui/build/moodle-assignfeedback_editpdf-editor/moodle-assignfeedback_editpdf-editor-min.js
index 7fa25ef9868..140ecf1ffa2 100644
--- a/mod/assign/feedback/editpdf/yui/build/moodle-assignfeedback_editpdf-editor/moodle-assignfeedback_editpdf-editor-min.js
+++ b/mod/assign/feedback/editpdf/yui/build/moodle-assignfeedback_editpdf-editor/moodle-assignfeedback_editpdf-editor-min.js
@@ -1,7 +1,7 @@
-YUI.add("moodle-assignfeedback_editpdf-editor",function(e,t){var n=M.cfg.wwwroot+"/mod/assign/feedback/editpdf/ajax.php",r={DIALOGUE:"assignfeedback_editpdf_widget"},s={PREVIOUSBUTTON:"."+r.DIALOGUE+" .navigate-previous-button",NEXTBUTTON:"."+r.DIALOGUE+" .navigate-next-button",SEARCHCOMMENTSBUTTON:"."+r.DIALOGUE+" .searchcommentsbutton",SEARCHFILTER:".assignfeedback_editpdf_commentsearch input",SEARCHCOMMENTSLIST:".assignfeedback_editpdf_commentsearch ul",PAGESELECT:"."+r.DIALOGUE+" .navigate-page-select",LOADINGICON:"."+r.DIALOGUE+" .loading",DRAWINGREGION:"."+r.DIALOGUE+" .drawingregion",DRAWINGCANVAS:"."+r.DIALOGUE+" .drawingcanvas",SAVE:"."+r.DIALOGUE+" .savebutton",COMMENTCOLOURBUTTON:"."+r.DIALOGUE+" .commentcolourbutton",COMMENTMENU:" .commentdrawable a",ANNOTATIONCOLOURBUTTON:"."+r.DIALOGUE+" .annotationcolourbutton",DELETEANNOTATIONBUTTON:"."+r.DIALOGUE+" .deleteannotationbutton",UNSAVEDCHANGESDIV:".assignfeedback_editpdf_unsavedchanges",STAMPSBUTTON:"."+r.DIALOGUE+" .currentstampbutton",DIALOGUE:"."+r.DIALOGUE},o="rgba(200, 200, 255, 0.9)",u="rgba(200, 200, 255, 0.5)",a={white:"rgb(255,255,255)",yellow:"rgb(255,255,176)",red:"rgb(255,176,176)",green:"rgb(176,255,176)",blue:"rgb(208,208,255)",clear:"rgba(255,255,255, 0)"},f={white:"rgb(255,255,255)",yellow:"rgb(255,255,0)",red:"rgb(255,0,0)",green:"rgb(0,255,0)",blue:"rgb(0,0,255)",black:"rgb(0,0,0)"},l=300,c={comment:"."+r.DIALOGUE+" .commentbutton",pen:"."+r.DIALOGUE+" .penbutton",line:"."+r.DIALOGUE+" .linebutton",rectangle:"."+r.DIALOGUE+" .rectanglebutton",oval:"."+r.DIALOGUE+" .ovalbutton",stamp:"."+r.DIALOGUE+" .stampbutton",select:"."+r.DIALOGUE+" .selectbutton",highlight:"."+r.DIALOGUE+" .highlightbutton"},h=4;POINT=function(e,t){this.x=parseInt(e,10),this.y=parseInt(t,10),this.clip=function(e){return this.xe.x+e.width&&(this.x=e.x+e.width),this.ye.y+e.height&&(this.y=e.y+e.height),this}},M.assignfeedback_editpdf=M.assignfeedback_editpdf||{},M.assignfeedback_editpdf.point=POINT,RECT=function(e,t,n,r){this.x=e,this.y=t,this.width=n,this.height=r,this.bound=function(e){var t=0,n=0,r=0,i=0,s=0,o;for(s=0;sn||s===0)n=o.x;if(o.yi||s===0)i=o.y}return this.x=t,this.y=r,this.width=n-t,this.height=i-r,this}},M.assignfeedback_editpdf=M.assignfeedback_editpdf||{},M.assignfeedback_editpdf.rect=RECT,EDIT=function(){this.start=!1,this.end=!1,this.starttime=0,this.annotationstart=!1,this.tool="comment",this.commentcolour="yellow",this.annotationcolour="red",this.stamp="",this.path=[]},M.assignfeedback_editpdf=M.assignfeedback_editpdf||{},M.assignfeedback_editpdf.edit=EDIT,DRAWABLE=function(e){this.editor=e,this.shapes=[],this.nodes=[],this.erase=function(){if(this.shapes)while(this.shapes.length>0)this.editor.graphic.removeShape(this.shapes.pop());if(this.nodes)while(this.nodes.length>0)this.nodes.pop().remove()}},M.assignfeedback_editpdf=M.assignfeedback_editpdf||{},M.assignfeedback_editpdf.drawable=DRAWABLE,ANNOTATION=function(e){ANNOTATION.superclass.constructor.apply(this,[e])},ANNOTATION.NAME="annotation",ANNOTATION.ATTRS={},e.extend(ANNOTATION,e.Base,{editor:null,gradeid:0,pageno:0,x:0,y:0,endx:0,endy:0,path:"",type:"rect",colour:"red",drawable:!1,initializer:function(e){this.editor=e.editor||null,this.gradeid=parseInt(e.gradeid,10)||0,this.pageno=parseInt(e.pageno,10)||0,this.x=parseInt(e.x,10)||0,this.y=parseInt(e.y,10)||0,this.endx=parseInt(e.endx,10)||0,this.endy=parseInt(e.endy,10)||0,this.path=e.path||"",this.type=e.type||"rect",this.colour=e.colour||"red",this.drawable=!1},clean:function(){return{gradeid:this.gradeid,x:parseInt(this.x,10),y:parseInt(this.y,10),endx:parseInt(this.endx,10),endy:parseInt(this.endy,10),type:this.type,path:this.path,pageno:this.pageno,colour:this.colour}},draw_highlight:function(){var t,n=e.one(s.DRAWINGREGION),r=e.one(s.DRAWINGCANVAS).getXY(),i;if(this.editor.currentannotation===this){t=new M.assignfeedback_editpdf.rect,t.bound([new M.assignfeedback_editpdf.point(this.x,this.y),new M.assignfeedback_editpdf.point(this.endx,this.endy)]),i=this.editor.graphic.addShape({type:e.Rect,width:t.width,height:t.height,stroke:{weight:h,color:o},fill:{color:u},x:t.x,y:t.y}),this.drawable.shapes.push(i);var a=e.Node.create('
'),f=e.Node.create('');a.setAttrs({alt:M.util.get_string("deleteannotation","assignfeedback_editpdf")}),a.setStyles({backgroundColor:"white"}),f.addClass("deleteannotationbutton"),f.append(a),n.append(f),f.setData("annotation",this),f.setStyle("zIndex","200"),f.on("click",this.remove,this),f.on("key",this.remove,"space,enter",this),f.setX(r[0]+t.x+t.width-18),f.setY(r[1]+t.y+6),this.drawable.nodes.push(f)}return this.drawable},draw:function(){return this.draw_highlight(),this.drawable},remove:function(){var e;e=this.editor.pages[this.editor.currentpage].annotations;for(i=0;i"),r.setStyles({display:"inline-block",backgroundImage:"url("+this.editor.get_stamp_image_url(this.path)+")",width:this.endx-this.x,height:this.endy-this.y,backgroundSize:"100% 100%",zIndex:50}),n.append(r),r.setX(i.x),r.setY(i.y),r.on("gesturemovestart",this.editor.edit_start,null,this.editor),r.on("gesturemove",this.editor.edit_move,null,this.editor),r.on("gesturemoveend",this.editor.edit_end,null,this.editor),t.nodes.push(r),this.drawable=t,ANNOTATIONSTAMP.superclass.draw.apply(this)},draw_current_edit:function(t){var n=new M.assignfeedback_editpdf.rect,r=new M.assignfeedback_editpdf.drawable(this.editor),i=e.one(s.DRAWINGREGION),o,u;return n.bound([t.start,t.end]),u=this.editor.get_window_coordinates(new M.assignfeedback_editpdf.point(n.x,n.y)),o=e.Node.create(""),o.setStyles({display:"inline-block",backgroundImage:"url("+this.editor.get_stamp_image_url(t.stamp)+")",width:n.width,height:n.height,backgroundSize:"100% 100%",zIndex:50}),i.append(o),o.setX(u.x),o.setY(u.y),r.nodes.push(o),r},init_from_edit:function(e){var t=new M.assignfeedback_editpdf.rect;t.bound([e.start,e.end]),t.width<40&&(t.width=40),t.height<40&&(t.height=40),this.gradeid=this.editor.get("gradeid"),this.pageno=this.editor.currentpage,this.x=t.x,this.y=t.y,this.endx=t.x+t.width,this.endy=t.y+t.height,this.colour=e.annotationcolour,this.path=e.stamp},move:function(e,t){var n=e-this.x,r=t-this.y;this.x+=n,this.y+=r,this.endx+=n,this.endy+=r,this.drawable&&this.drawable.erase(),this.editor.drawables.push(this.draw())}}),M.assignfeedback_editpdf=M.assignfeedback_editpdf||{},M.assignfeedback_editpdf.annotationstamp=ANNOTATIONSTAMP;var p="Dropdown menu",d;d=function(e){e.draggable=!1,e.centered=!1,e.width="auto",e.lightbox=!1,e.visible=!1,e.zIndex=100,e.footerContent="",d.superclass.constructor.apply(this,[e])},e.extend(d,M.core.dialogue,{initializer:function(t){var n,r,i,s;d.superclass.initializer.call(this,t),s=this.get("boundingBox"),s.addClass("assignfeedback_editpdf_dropdown"),n=this.get("buttonNode"),r=this.bodyNode,i=e.Node.create(""),i.addClass("accesshide"),i.setHTML(this.get("headerText")),r.prepend(i),r.on("clickoutside",function(e){this.get("visible")&&e.target!==n&&e.target.ancestor()!==n&&(e.preventDefault(),this.hide())},this),n.on("click",this.show,this),n.on("key",this.show,"enter,space",this)},show:function(){var t=this.get("buttonNode");result=d.superclass.show.call(this),this.align(t,[e.WidgetPositionAlign.TL,e.WidgetPositionAlign.BL])}},{NAME:p,ATTRS:{headerText:{value:""},buttonNode:{value:null}}}),M.assignfeedback_editpdf=M.assignfeedback_editpdf||{},M.assignfeedback_editpdf.dropdown=d;var v="Colourpicker",m;m=function(e){m.superclass.constructor.apply(this,[e])},e.extend(m,M.assignfeedback_editpdf.dropdown,{initializer:function(t){var n=e.Node.create(''),r;e.each(this.get("colours"),function(t,r){var i,s,o,u,a;o=M.util.get_string(r,"assignfeedback_editpdf"),a=this.get("iconprefix")+r,u=M.util.image_url(a,"assignfeedback_editpdf"),i=e.Node.create(''),i.setAttribute("data-colour",r),i.setAttribute("data-rgb",t),i.setStyle("backgroundImage","none"),s=e.Node.create(""),s.append(i),n.append(s)},this),r=e.Node.create(""),n.delegate("click",this.callback_handler,"button",this),n.delegate("key",this.callback_handler,"down:13","button",this),this.set("headerText",M.util.get_string("colourpicker","assignfeedback_editpdf")),r.append(n),this.set("bodyContent",r),m.superclass.initializer.call(this,t)},callback_handler:function(t){var n=this.get("callback"),r=this.get("context"),i;this.hide(),i=e.bind(n,r,t),i()}},{NAME:v,ATTRS:{colours:{value:{}},callback:{value:null},context:{value:null},iconprefix:{value:"colour_"}}}),M.assignfeedback_editpdf=M.assignfeedback_editpdf||{},M.assignfeedback_editpdf.colourpicker=m;var g="Colourpicker",b;b=function(e){b.superclass.constructor.apply(this,[e])},e.extend(b,M.assignfeedback_editpdf.dropdown,{initializer:function(t){var n=e.Node.create('');e.each(this.get("stamps"),function(t){var r,i,s;s=M.util.get_string("stamp","assignfeedback_editpdf"),r=e.Node.create(''),r.setAttribute("data-stamp",t),r.setStyle("backgroundImage","none"),i=e.Node.create(""),i.append(r),n.append(i)},this),n.delegate("click",this.callback_handler,"button",this),n.delegate("key",this.callback_handler,"down:13","button",this),this.set("headerText",M.util.get_string("stamppicker","assignfeedback_editpdf")),this.set("bodyContent",n),b.superclass.initializer.call(this,t)},callback_handler:function(t){var n=this.get("callback"),r=this.get("context"),i;this.hide(),i=e.bind(n,r,t),i()}},{NAME:g,ATTRS:{stamps:{value:[]},callback:{value:null},context:{value:null}}}),M.assignfeedback_editpdf=M.assignfeedback_editpdf||{},M.assignfeedback_editpdf.stamppicker=b;var w="Commentmenu",E;E=function(e){E.superclass.constructor.apply(this,[e])},e.extend(E,M.assignfeedback_editpdf.dropdown,{initializer
-:function(t){var n,r,i,s;s=this.get("comment"),n=e.Node.create(''),r=e.Node.create(''+M.util.get_string("addtoquicklist","assignfeedback_editpdf")+""),r.on("click",s.add_to_quicklist,s),r.on("key",s.add_to_quicklist,"enter,space",s),n.append(r),r=e.Node.create(''+M.util.get_string("deletecomment","assignfeedback_editpdf")+""),r.on("click",function(){s.menu.hide(),s.remove()},s),r.on("key",function(){s.menu.hide(),s.remove()},"enter,space",s),n.append(r),r=e.Node.create("
"),n.append(r),this.set("headerText",M.util.get_string("commentcontextmenu","assignfeedback_editpdf")),i=e.Node.create(""),i.append(n),this.set("bodyContent",i),E.superclass.initializer.call(this,t)},show:function(){var t=this.get("boundingBox").one("ul");t.all(".quicklist_comment").remove(!0),comment=this.get("comment"),e.each(comment.editor.quicklist.comments,function(n){var r=e.Node.create(''),i=e.Node.create(''+n.rawtext+""),s=e.Node.create('");r.append(i),r.append(s),t.append(r),i.on("click",comment.set_from_quick_comment,comment,n),i.on("key",comment.set_from_quick_comment,"space,enter",comment,n),s.on("click",comment.remove_from_quicklist,comment,n),s.on("key",comment.remove_from_quicklist,"space,enter",comment,n)},this),E.superclass.show.call(this)}},{NAME:w,ATTRS:{comment:{value:null}}}),M.assignfeedback_editpdf=M.assignfeedback_editpdf||{},M.assignfeedback_editpdf.commentmenu=E;var S="commentsearch",T;T=function(e){e.draggable=!1,e.centered=!0,e.width="400px",e.lightbox=!0,e.visible=!1,e.headerContent=M.util.get_string("searchcomments","assignfeedback_editpdf"),e.zIndex=100,e.footerContent="",T.superclass.constructor.apply(this,[e])},e.extend(T,M.core.dialogue,{initializer:function(t){var n,r,i,s,o,u;u=this.get("boundingBox"),u.addClass("assignfeedback_editpdf_commentsearch"),n=this.get("editor"),r=e.Node.create(""),i=M.util.get_string("filter","assignfeedback_editpdf"),s=e.Node.create(''),r.append(s),o=e.Node.create(''),r.append(o),s.on("keyup",this.filter_search_comments,null,this),o.delegate("click",this.focus_on_comment,"a",this),o.delegate("key",this.focus_on_comment,"enter,space","a",this),this.set("bodyContent",r),T.superclass.initializer.call(this,t)},filter_search_comments:function(){var t,n,r;t=e.one(s.SEARCHFILTER),n=e.one(s.SEARCHCOMMENTSLIST),r=t.get("value"),n.all("li").each(function(e){e.get("text").indexOf(r)!==-1?e.show():e.hide()})},focus_on_comment:function(e){var t=e.target.ancestor("li"),n=t.getData("comment"),r=this.get("editor");this.hide(),n.pageno===r.currentpage?n.drawable.nodes[0].one("textarea").focus():(r.currentpage=n.pageno,r.change_page(),n.drawable.nodes[0].one("textarea").focus())},show:function(){var t=this.get("boundingBox").one("ul"),n=this.get("editor");t.all("li").remove(!0),e.each(n.pages,function(n){e.each(n.comments,function(n){var r=e.Node.create(''+n.rawtext+"
");t.append(r),r.setData("comment",n)},this)},this),this.centerDialogue(),T.superclass.show.call(this)}},{NAME:S,ATTRS:{editor:{value:null}}}),M.assignfeedback_editpdf=M.assignfeedback_editpdf||{},M.assignfeedback_editpdf.commentsearch=T,COMMENT=function(t,n,r,i,o,u,f,l){this.editor=t,this.gradeid=n||0,this.x=parseInt(i,10)||0,this.y=parseInt(o,10)||0,this.width=parseInt(u,10)||0,this.rawtext=l||"",this.pageno=r||0,this.colour=f||"yellow",this.drawable=!1,this.deleteme=!1,this.menulink=null,this.menu=null,this.clean=function(){return{gradeid:this.gradeid,x:parseInt(this.x,10),y:parseInt(this.y,10),width:parseInt(this.width,10),rawtext:this.rawtext,pageno:this.currentpage,colour:this.colour}},this.draw=function(t){var n=new M.assignfeedback_editpdf.drawable(this.editor),r,i=e.one(s.DRAWINGREGION),o,u,f,l;return r=e.Node.create(""),o=e.Node.create(''),u=e.Node.create('
'),this.menulink=u,o.append(r),this.editor.get("readonly")?r.setAttribute("readonly","readonly"):o.append(u),this.width<100&&(this.width=100),f=this.editor.get_window_coordinates(new M.assignfeedback_editpdf.point(this.x,this.y)),r.setStyles({width:this.width+"px",backgroundColor:a[this.colour]}),i.append(o),o.setX(f.x),o.setY(f.y),n.nodes.push(o),r.set("value",this.rawtext),l=r.get("scrollHeight"),r.setStyles({height:l+"px",overflow:"hidden"}),this.editor.get("readonly")||this.attach_events(r,u),t&&r.focus(),this.drawable=n,n},this.delete_comment_later=function(){this.deleteme&&this.remove()},this.attach_events=function(t,n){t.on("blur",function(){this.rawtext=t.get("value"),this.width=parseInt(t.getStyle("width"),10),this.rawtext.replace(/^\s+|\s+$/g,"")===""&&(this.deleteme=!0,e.later(400,this,this.delete_comment_later)),this.editor.save_current_page()},this),n.setData("comment",this),t.on("keyup",function(){var e=t.get("scrollHeight"),n=parseInt(t.getStyle("height"),10);e===n+8&&(e-=8),t.setStyle("height",e+"px")}),t.on("gesturemovestart",function(e){t.setData("dragging",!0),t.setData("offsetx",e.clientX-t.getX()),t.setData("offsety",e.clientY-t.getY())}),t.on("gesturemoveend",function(){t.setData("dragging",!1),this.editor.save_current_page()},null,this),t.on("gesturemove",function(e){var n=e.clientX-t.getData("offsetx"),r=e.clientY-t.getData("offsety"),i,s,o,u,a;i=parseInt(t.getStyle("width"),10),s=parseInt(t.getStyle("height"),10),o=this.editor.get_canvas_coordinates(new M.assignfeedback_editpdf.point(n,r)),a=this.editor.get_canvas_bounds(!0),a.x=0,a.y=0,a.width-=i+42,a.height-=s+8
-,o.clip(a),this.x=o.x,this.y=o.y,u=this.editor.get_window_coordinates(o),t.ancestor().setX(u.x),t.ancestor().setY(u.y)},null,this),this.menu=new M.assignfeedback_editpdf.commentmenu({buttonNode:this.menulink,comment:this})},this.remove=function(){var e=0,t;t=this.editor.pages[this.editor.currentpage].comments;for(e=0;e=0&&this.comments.splice(e,1)},failure:function(e,t){return M.core.exception(t.responseText)}}},e.io(r,i)},this.load=function(){var t=n,r;r={method:"get",context:this,sync:!1,data:{sesskey:M.cfg.sesskey,action:"loadquicklist",userid:this.editor.get("userid"),attemptnumber:this.editor.get("attemptnumber"),assignmentid:this.editor.get("assignmentid")},on:{success:function(t,n){var r;try{r=e.JSON.parse(n.responseText);if(r.error)return new M.core.ajaxException(r);e.each(r,function(e){var t=new M.assignfeedback_editpdf.quickcomment(e.id,e.rawtext,e.width,e.colour);this.comments.push(t)},this)}catch(i){return new M.core.exception(i)}},failure:function(e,t){return M.core.exception(t.responseText)}}},e.io(t,r)}},M.assignfeedback_editpdf=M.assignfeedback_editpdf||{},M.assignfeedback_editpdf.quickcommentlist=QUICKCOMMENTLIST,EDITOR=function(){EDITOR.superclass.constructor.apply(this,arguments)},EDITOR.prototype={dialogue:null,pagecount:0,currentpage:0,pages:[],loadingicon:null,pageimage:null,graphic:null,currentedit:new M.assignfeedback_editpdf.edit,currentdrawable:!1,drawables:[],currentcomment:null,currentannotation:null,lastanntationtool:"pen",quicklist:null,searchcommentswindow:null,currentstamp:null,stamps:[],initializer:function(){var t;t=e.one("#"+this.get("linkid")),t&&(t.on("click",this.link_handler,this),t.on("key",this.link_handler,"down:13",this),this.currentedit.start=!1,this.currentedit.end=!1,this.quicklist=new M.assignfeedback_editpdf.quickcommentlist(this))},refresh_button_state:function(){var t,n,r;t=e.one(s.COMMENTCOLOURBUTTON),r=M.util.image_url("background_colour_"+this.currentedit.commentcolour,"assignfeedback_editpdf"),t.one("img").setAttribute("src",r),this.currentedit.commentcolour==="clear"?t.one("img").setStyle("borderStyle","dashed"):t.one("img").setStyle("borderStyle","solid"),t=e.one(s.ANNOTATIONCOLOURBUTTON),r=M.util.image_url("colour_"+this.currentedit.annotationcolour,"assignfeedback_editpdf"),t.one("img").setAttribute("src",r),n=e.one(c[this.currentedit.tool]),n.addClass("assignfeedback_editpdf_selectedbutton"),n.setAttribute("aria-pressed","true"),t=e.one(s.STAMPSBUTTON),t.one("img").setAttrs({src:this.get_stamp_image_url(this.currentedit.stamp),height:"16",width:"16"})},get_canvas_bounds:function(){var t=e.one(s.DRAWINGCANVAS),n=t.getXY(),r=n[0],i=n[1],o=parseInt(t.getStyle("width"),10),u=parseInt(t.getStyle("height"),10);return new M.assignfeedback_editpdf.rect(r,i,o,u)},get_canvas_coordinates:function(e){var t=this.get_canvas_bounds(),n=new M.assignfeedback_editpdf.point(e.x-t.x,e.y-t.y);return t.x=t.y=0,n.clip(t),n},get_window_coordinates:function(e){var t=this.get_canvas_bounds(),n=new M.assignfeedback_editpdf.point(e.x+t.x,e.y+t.y);return n},link_handler:function(t){var n;t.preventDefault(),this.dialogue?this.dialogue.show():(this.dialogue=new M.core.dialogue({headerContent:this.get("header"),bodyContent:this.get("body"),footerContent:this.get("footer"),width:"840px",visible:!0}),this.dialogue.centerDialogue(),this.dialogue.get("boundingBox").addClass(r.DIALOGUE),this.loadingicon=e.one(s.LOADINGICON),n=e.one(s.DRAWINGCANVAS),this.graphic=new e.Graphic({render:s.DRAWINGCANVAS}),this.get("readonly")||(n.on("gesturemovestart",this.edit_start,null,this),n.on("gesturemove",this.edit_move
-,null,this),n.on("gesturemoveend",this.edit_end,null,this),this.refresh_button_state())),this.load_all_pages()},load_all_pages:function(){var t=n,r;r={method:"get",context:this,sync:!1,data:{sesskey:M.cfg.sesskey,action:"loadallpages",userid:this.get("userid"),attemptnumber:this.get("attemptnumber"),assignmentid:this.get("assignmentid")},on:{success:function(e,t){this.all_pages_loaded(t.responseText)},failure:function(e,t){return M.core.exception(t.responseText)}}},e.io(t,r)},all_pages_loaded:function(t){var n,r,i,s,o;try{n=e.JSON.parse(t);if(n.error||!n.pagecount){this.dialogue.hide(),o=new M.core.alert({message:M.util.get_string("cannotopenpdf","assignfeedback_editpdf")}),o.show();return}}catch(u){this.dialogue.hide(),o=new M.core.alert({title:M.util.get_string("cannotopenpdf","assignfeedback_editpdf")}),o.show();return}this.pagecount=n.pagecount,this.pages=n.pages;for(r=0;r0&&(r=e)},this),r},setup_toolbar:function(){var t,n,r,i,o,u,l,h;i=e.one(s.SEARCHCOMMENTSBUTTON),i.on("click",this.open_search_comments,this),i.on("key",this.open_search_comments,"down:13",this);if(this.get("readonly"))return;e.each(c,function(n,r){t=e.one(n),t.on("click",this.handle_tool_button,this,r),t.on("key",this.handle_tool_button,"down:13",this,r),t.setAttribute("aria-pressed","false")},this),n=e.one(s.COMMENTCOLOURBUTTON),l=new M.assignfeedback_editpdf.colourpicker({buttonNode:n,colours:a,iconprefix:"background_colour_",callback:function(e){var t=e.target.getAttribute("data-colour");t||(t=e.target.ancestor().getAttribute("data-colour")),this.currentedit.commentcolour=t,this.handle_tool_button(e,"comment")},context:this}),r=e.one(s.ANNOTATIONCOLOURBUTTON),l=new M.assignfeedback_editpdf.colourpicker({buttonNode:r,iconprefix:"colour_",colours:f,callback:function(e){var t=e.target.getAttribute("data-colour");t||(t=e.target.ancestor().getAttribute("data-colour")),this.currentedit.annotationcolour=t,this.lastannotationtool?this.handle_tool_button(e,this.lastannotationtool):this.handle_tool_button(e,"pen")},context:this}),u=this.get("stampfiles"),u.length<=0?(e.one(s.STAMPSBUTTON).hide(),e.one(c.stamp).hide()):(h=u[0].substr(u[0].lastIndexOf("/")+1),this.currentedit.stamp=h,o=e.one(s.STAMPSBUTTON),l=new M.assignfeedback_editpdf.stamppicker({buttonNode:o,stamps:u,callback:function(e){var t=e.target.getAttribute("data-stamp"),n;t||(t=e.target.ancestor().getAttribute("data-stamp")),n=t.substr(t.lastIndexOf("/")),this.currentedit.stamp=n,this.refresh_button_state()},context:this}),this.refresh_button_state())},handle_tool_button:function(t,n){var r;t.preventDefault(),r=e.one(c[this.currentedit.tool]),r.removeClass("assignfeedback_editpdf_selectedbutton"),r.setAttribute("aria-pressed","false"),this.currentedit.tool=n,n!=="comment"&&n!=="select"&&(this.lastannotationtool=n),this.refresh_button_state()},stringify_current_page:function(){var t=[],n=[],r,i=0;for(i=0;in.width||o.y<0||o.y>n.height)return;this.currentedit.tool==="pen"&&this.currentedit.path.push(o),this.currentedit.tool==="select"?this.currentannotation&&this.currentedit&&this.currentannotation.move(this.currentedit.annotationstart.x+o.x-this.currentedit.start.x,this.currentedit.annotationstart.y+o.y-this.currentedit.start.y):this.currentedit.start&&(this.currentedit.end=o,this.redraw_current_edit())},edit_end:function(){var e,t,n;e=(new Date).getTime()-this.currentedit.start;if(e0)this.drawables.pop().erase();for(e=0;e0?r.removeAttribute("disabled"):r.setAttribute("disabled","true"),this.currentpage"),r.setAttribute("value",n),r.setHTML(M.util.get_string("pagenumber","assignfeedback_editpdf",n+1)),t.append(r);t.removeAttribute("disabled"),t.on("change",function(){this.currentpage=t.get("value"),this.change_page()},this),i=e.one(s.PREVIOUSBUTTON),o=e.one(s.NEXTBUTTON),i.on("click",this.previous_page,this),i.on("key",this.previous_page,"down:13",this),o.on("click",this.next_page,this),o.on("key",this.next_page,"down:13",this)},previous_page:function(){this.currentpage--,this.currentpage<0&&(this.currentpage=0),this.change_page()},next_page:function(){this.currentpage++,this.currentpage>=this.pages.length&&(this.currentpage=this.pages.length-1),this.change_page()}},e.extend(EDITOR,e.Base,EDITOR.prototype,{NAME:"moodle-assignfeedback_editpdf-editor",ATTRS:{userid:{validator:e.Lang.isInteger,value:0},assignmentid:{validator:e.Lang.isInteger,value:0},attemptnumber:{validator:e.Lang.isInteger,value:0},header:{validator:e.Lang.isString,value:""},body:{validator:e.Lang.isString,value:""},footer:{validator:e.Lang.isString,value:""},linkid:{validator:e.Lang.isString,value:""},deletelinkid:{validator:e.Lang.isString,value:""},readonly:{validator:e.Lang.isBoolean,value:!0},stampfiles:{validator:e.Lang.isArray,value:""}}}),M.assignfeedback_editpdf=M.assignfeedback_editpdf||{},M.assignfeedback_editpdf.editor=M.assignfeedback_editpdf.editor||{},M.assignfeedback_editpdf.editor.init=M.assignfeedback_editpdf.editor.init||function(e){return new EDITOR(e)}},"@VERSION@",{requires:["base","event","node","io","graphics","json","event-move","querystring-stringify-simple","moodle-core-notification-dialog","moodle-core-notification-exception","moodle-core-notification-ajaxexception"]});
+YUI.add("moodle-assignfeedback_editpdf-editor",function(e,t){var n=M.cfg.wwwroot+"/mod/assign/feedback/editpdf/ajax.php",r={DIALOGUE:"assignfeedback_editpdf_widget"},s={PREVIOUSBUTTON:"."+r.DIALOGUE+" .navigate-previous-button",NEXTBUTTON:"."+r.DIALOGUE+" .navigate-next-button",SEARCHCOMMENTSBUTTON:"."+r.DIALOGUE+" .searchcommentsbutton",SEARCHFILTER:".assignfeedback_editpdf_commentsearch input",SEARCHCOMMENTSLIST:".assignfeedback_editpdf_commentsearch ul",PAGESELECT:"."+r.DIALOGUE+" .navigate-page-select",LOADINGICON:"."+r.DIALOGUE+" .loading",DRAWINGREGION:"."+r.DIALOGUE+" .drawingregion",DRAWINGCANVAS:"."+r.DIALOGUE+" .drawingcanvas",SAVE:"."+r.DIALOGUE+" .savebutton",COMMENTCOLOURBUTTON:"."+r.DIALOGUE+" .commentcolourbutton",COMMENTMENU:" .commentdrawable a",ANNOTATIONCOLOURBUTTON:"."+r.DIALOGUE+" .annotationcolourbutton",DELETEANNOTATIONBUTTON:"."+r.DIALOGUE+" .deleteannotationbutton",UNSAVEDCHANGESDIV:".assignfeedback_editpdf_unsavedchanges",STAMPSBUTTON:"."+r.DIALOGUE+" .currentstampbutton",DIALOGUE:"."+r.DIALOGUE},o="rgba(200, 200, 255, 0.9)",u="rgba(200, 200, 255, 0.5)",a={white:"rgb(255,255,255)",yellow:"rgb(255,255,176)",red:"rgb(255,176,176)",green:"rgb(176,255,176)",blue:"rgb(208,208,255)",clear:"rgba(255,255,255, 0)"},f={white:"rgb(255,255,255)",yellow:"rgb(255,255,0)",red:"rgb(255,0,0)",green:"rgb(0,255,0)",blue:"rgb(0,0,255)",black:"rgb(0,0,0)"},l=300,c={comment:"."+r.DIALOGUE+" .commentbutton",pen:"."+r.DIALOGUE+" .penbutton",line:"."+r.DIALOGUE+" .linebutton",rectangle:"."+r.DIALOGUE+" .rectanglebutton",oval:"."+r.DIALOGUE+" .ovalbutton",stamp:"."+r.DIALOGUE+" .stampbutton",select:"."+r.DIALOGUE+" .selectbutton",highlight:"."+r.DIALOGUE+" .highlightbutton"},h=4;POINT=function(e,t){this.x=parseInt(e,10),this.y=parseInt(t,10),this.clip=function(e){return this.xe.x+e.width&&(this.x=e.x+e.width),this.ye.y+e.height&&(this.y=e.y+e.height),this}},M.assignfeedback_editpdf=M.assignfeedback_editpdf||{},M.assignfeedback_editpdf.point=POINT,RECT=function(e,t,n,r){this.x=e,this.y=t,this.width=n,this.height=r,this.bound=function(e){var t=0,n=0,r=0,i=0,s=0,o;for(s=0;sn||s===0)n=o.x;if(o.yi||s===0)i=o.y}return this.x=t,this.y=r,this.width=n-t,this.height=i-r,this}},M.assignfeedback_editpdf=M.assignfeedback_editpdf||{},M.assignfeedback_editpdf.rect=RECT,EDIT=function(){this.start=!1,this.end=!1,this.starttime=0,this.annotationstart=!1,this.tool="comment",this.commentcolour="yellow",this.annotationcolour="red",this.stamp="",this.path=[]},M.assignfeedback_editpdf=M.assignfeedback_editpdf||{},M.assignfeedback_editpdf.edit=EDIT,DRAWABLE=function(e){this.editor=e,this.shapes=[],this.nodes=[],this.erase=function(){if(this.shapes)while(this.shapes.length>0)this.editor.graphic.removeShape(this.shapes.pop());if(this.nodes)while(this.nodes.length>0)this.nodes.pop().remove()}},M.assignfeedback_editpdf=M.assignfeedback_editpdf||{},M.assignfeedback_editpdf.drawable=DRAWABLE,ANNOTATION=function(e){ANNOTATION.superclass.constructor.apply(this,[e])},ANNOTATION.NAME="annotation",ANNOTATION.ATTRS={},e.extend(ANNOTATION,e.Base,{editor:null,gradeid:0,pageno:0,x:0,y:0,endx:0,endy:0,path:"",type:"rect",colour:"red",drawable:!1,initializer:function(e){this.editor=e.editor||null,this.gradeid=parseInt(e.gradeid,10)||0,this.pageno=parseInt(e.pageno,10)||0,this.x=parseInt(e.x,10)||0,this.y=parseInt(e.y,10)||0,this.endx=parseInt(e.endx,10)||0,this.endy=parseInt(e.endy,10)||0,this.path=e.path||"",this.type=e.type||"rect",this.colour=e.colour||"red",this.drawable=!1},clean:function(){return{gradeid:this.gradeid,x:parseInt(this.x,10),y:parseInt(this.y,10),endx:parseInt(this.endx,10),endy:parseInt(this.endy,10),type:this.type,path:this.path,pageno:this.pageno,colour:this.colour}},draw_highlight:function(){var t,n=e.one(s.DRAWINGREGION),r=e.one(s.DRAWINGCANVAS).getXY(),i;if(this.editor.currentannotation===this){t=new M.assignfeedback_editpdf.rect,t.bound([new M.assignfeedback_editpdf.point(this.x,this.y),new M.assignfeedback_editpdf.point(this.endx,this.endy)]),i=this.editor.graphic.addShape({type:e.Rect,width:t.width,height:t.height,stroke:{weight:h,color:o},fill:{color:u},x:t.x,y:t.y}),this.drawable.shapes.push(i);var a=e.Node.create('
'),f=e.Node.create('');a.setAttrs({alt:M.util.get_string("deleteannotation","assignfeedback_editpdf")}),a.setStyles({backgroundColor:"white"}),f.addClass("deleteannotationbutton"),f.append(a),n.append(f),f.setData("annotation",this),f.setStyle("zIndex","200"),f.on("click",this.remove,this),f.on("key",this.remove,"space,enter",this),f.setX(r[0]+t.x+t.width-18),f.setY(r[1]+t.y+6),this.drawable.nodes.push(f)}return this.drawable},draw:function(){return this.draw_highlight(),this.drawable},remove:function(e){var t;e.preventDefault(),t=this.editor.pages[this.editor.currentpage].annotations;for(i=0;i"),r.setStyles({display:"inline-block",backgroundImage:"url("+this.editor.get_stamp_image_url(this.path)+")",width:this.endx-this.x,height:this.endy-this.y,backgroundSize:"100% 100%",zIndex:50}),n.append(r),r.setX(i.x),r.setY(i.y),r.on("gesturemovestart",this.editor.edit_start,null,this.editor),r.on("gesturemove",this.editor.edit_move,null,this.editor),r.on("gesturemoveend",this.editor.edit_end,null,this.editor),t.nodes.push(r),this.drawable=t,ANNOTATIONSTAMP.superclass.draw.apply(this)},draw_current_edit:function(t){var n=new M.assignfeedback_editpdf.rect,r=new M.assignfeedback_editpdf.drawable(this.editor),i=e.one(s.DRAWINGREGION),o,u;return n.bound([t.start,t.end]),u=this.editor.get_window_coordinates(new M.assignfeedback_editpdf.point(n.x,n.y)),o=e.Node.create(""),o.setStyles({display:"inline-block",backgroundImage:"url("+this.editor.get_stamp_image_url(t.stamp)+")",width:n.width,height:n.height,backgroundSize:"100% 100%",zIndex:50}),i.append(o),o.setX(u.x),o.setY(u.y),r.nodes.push(o),r},init_from_edit:function(e){var t=new M.assignfeedback_editpdf.rect;t.bound([e.start,e.end]),t.width<40&&(t.width=40),t.height<40&&(t.height=40),this.gradeid=this.editor.get("gradeid"),this.pageno=this.editor.currentpage,this.x=t.x,this.y=t.y,this.endx=t.x+t.width,this.endy=t.y+t.height,this.colour=e.annotationcolour,this.path=e.stamp},move:function(e,t){var n=e-this.x,r=t-this.y;this.x+=n,this.y+=r,this.endx+=n,this.endy+=r,this.drawable&&this.drawable.erase(),this.editor.drawables.push(this.draw())}}),M.assignfeedback_editpdf=M.assignfeedback_editpdf||{},M.assignfeedback_editpdf.annotationstamp=ANNOTATIONSTAMP;var p="Dropdown menu",d;d=function(e){e.draggable=!1,e.centered=!1,e.width="auto",e.lightbox=!1,e.visible=!1,e.zIndex=100,e.footerContent="",d.superclass.constructor.apply(this,[e])},e.extend(d,M.core.dialogue,{initializer:function(t){var n,r,i,s;d.superclass.initializer.call(this,t),s=this.get("boundingBox"),s.addClass("assignfeedback_editpdf_dropdown"),n=this.get("buttonNode"),r=this.bodyNode,i=e.Node.create(""),i.addClass("accesshide"),i.setHTML(this.get("headerText")),r.prepend(i),r.on("clickoutside",function(e){this.get("visible")&&e.target!==n&&e.target.ancestor()!==n&&(e.preventDefault(),this.hide())},this),n.on("click",function(e){e.preventDefault(),this.show()},this),n.on("key",this.show,"enter,space",this)},show:function(){var t=this.get("buttonNode");result=d.superclass.show.call(this),this.align(t,[e.WidgetPositionAlign.TL,e.WidgetPositionAlign.BL])}},{NAME:p,ATTRS:{headerText:{value:""},buttonNode:{value:null}}}),M.assignfeedback_editpdf=M.assignfeedback_editpdf||{},M.assignfeedback_editpdf.dropdown=d;var v="Colourpicker",m;m=function(e){m.superclass.constructor.apply(this,[e])},e.extend(m,M.assignfeedback_editpdf.dropdown,{initializer:function(t){var n=e.Node.create(''),r;e.each(this.get("colours"),function(t,r){var i,s,o,u,a;o=M.util.get_string(r,"assignfeedback_editpdf"),a=this.get("iconprefix")+r,u=M.util.image_url(a,"assignfeedback_editpdf"),i=e.Node.create(''),i.setAttribute("data-colour",r),i.setAttribute("data-rgb",t),i.setStyle("backgroundImage","none"),s=e.Node.create(""),s.append(i),n.append(s)},this),r=e.Node.create(""),n.delegate("click",this.callback_handler,"button",this),n.delegate("key",this.callback_handler,"down:13","button",this),this.set("headerText",M.util.get_string("colourpicker","assignfeedback_editpdf")),r.append(n),this.set("bodyContent",r),m.superclass.initializer.call(this,t)},callback_handler:function(t){t.preventDefault();var n=this.get("callback"),r=this.get("context"),i;this.hide(),i=e.bind(n,r,t),i()}},{NAME:v,ATTRS:{colours:{value:{}},callback:{value:null},context:{value:null},iconprefix:{value:"colour_"}}}),M.assignfeedback_editpdf=M.assignfeedback_editpdf||{},M.assignfeedback_editpdf.colourpicker=m;var g="Colourpicker",b;b=function(e){b.superclass.constructor.apply(this,[e])},e.extend(b,M.assignfeedback_editpdf.dropdown,{initializer:function(t){var n=e.Node.create('');e.each(this.get("stamps"),function(t){var r,i,s;s=M.util.get_string("stamp","assignfeedback_editpdf"),r=e.Node.create(''),r.setAttribute("data-stamp",t),r.setStyle("backgroundImage","none"),i=e.Node.create(""),i.append(r),n.append(i)},this),n.delegate("click",this.callback_handler,"button",this),n.delegate("key",this.callback_handler,"down:13","button",this),this.set("headerText",M.util.get_string("stamppicker","assignfeedback_editpdf")),this.set("bodyContent",n),b.superclass.initializer.call(this,t)},callback_handler:function(t){t.preventDefault();var n=this.get("callback"),r=this.get("context"),i;this.hide(),i=e.bind(n,r,t),i()}},{NAME:g,ATTRS:{stamps:{value:[]},callback:{value:null},context:{value:null}}}),M.assignfeedback_editpdf=M.assignfeedback_editpdf||{},M.assignfeedback_editpdf.stamppicker=b;var w="Commentmenu",E;E=function(e){E.superclass
+.constructor.apply(this,[e])},e.extend(E,M.assignfeedback_editpdf.dropdown,{initializer:function(t){var n,r,i,s;s=this.get("comment"),n=e.Node.create(''),r=e.Node.create(''+M.util.get_string("addtoquicklist","assignfeedback_editpdf")+""),r.on("click",s.add_to_quicklist,s),r.on("key",s.add_to_quicklist,"enter,space",s),n.append(r),r=e.Node.create(''+M.util.get_string("deletecomment","assignfeedback_editpdf")+""),r.on("click",function(e){e.preventDefault(),this.menu.hide(),this.remove()},s),r.on("key",function(){s.menu.hide(),s.remove()},"enter,space",s),n.append(r),r=e.Node.create("
"),n.append(r),this.set("headerText",M.util.get_string("commentcontextmenu","assignfeedback_editpdf")),i=e.Node.create(""),i.append(n),this.set("bodyContent",i),E.superclass.initializer.call(this,t)},show:function(){var t=this.get("boundingBox").one("ul");t.all(".quicklist_comment").remove(!0),comment=this.get("comment"),e.each(comment.editor.quicklist.comments,function(n){var r=e.Node.create(''),i=e.Node.create(''+n.rawtext+""),s=e.Node.create('");r.append(i),r.append(s),t.append(r),i.on("click",comment.set_from_quick_comment,comment,n),i.on("key",comment.set_from_quick_comment,"space,enter",comment,n),s.on("click",comment.remove_from_quicklist,comment,n),s.on("key",comment.remove_from_quicklist,"space,enter",comment,n)},this),E.superclass.show.call(this)}},{NAME:w,ATTRS:{comment:{value:null}}}),M.assignfeedback_editpdf=M.assignfeedback_editpdf||{},M.assignfeedback_editpdf.commentmenu=E;var S="commentsearch",T;T=function(e){e.draggable=!1,e.centered=!0,e.width="400px",e.lightbox=!0,e.visible=!1,e.headerContent=M.util.get_string("searchcomments","assignfeedback_editpdf"),e.zIndex=100,e.footerContent="",T.superclass.constructor.apply(this,[e])},e.extend(T,M.core.dialogue,{initializer:function(t){var n,r,i,s,o,u;u=this.get("boundingBox"),u.addClass("assignfeedback_editpdf_commentsearch"),n=this.get("editor"),r=e.Node.create(""),i=M.util.get_string("filter","assignfeedback_editpdf"),s=e.Node.create(''),r.append(s),o=e.Node.create(''),r.append(o),s.on("keyup",this.filter_search_comments,null,this),o.delegate("click",this.focus_on_comment,"a",this),o.delegate("key",this.focus_on_comment,"enter,space","a",this),this.set("bodyContent",r),T.superclass.initializer.call(this,t)},filter_search_comments:function(){var t,n,r;t=e.one(s.SEARCHFILTER),n=e.one(s.SEARCHCOMMENTSLIST),r=t.get("value"),n.all("li").each(function(e){e.get("text").indexOf(r)!==-1?e.show():e.hide()})},focus_on_comment:function(e){e.preventDefault();var t=e.target.ancestor("li"),n=t.getData("comment"),r=this.get("editor");this.hide(),n.pageno===r.currentpage?n.drawable.nodes[0].one("textarea").focus():(r.currentpage=n.pageno,r.change_page(),n.drawable.nodes[0].one("textarea").focus())},show:function(){var t=this.get("boundingBox").one("ul"),n=this.get("editor");t.all("li").remove(!0),e.each(n.pages,function(n){e.each(n.comments,function(n){var r=e.Node.create(''+n.rawtext+"
");t.append(r),r.setData("comment",n)},this)},this),this.centerDialogue(),T.superclass.show.call(this)}},{NAME:S,ATTRS:{editor:{value:null}}}),M.assignfeedback_editpdf=M.assignfeedback_editpdf||{},M.assignfeedback_editpdf.commentsearch=T,COMMENT=function(t,n,r,i,o,u,f,l){this.editor=t,this.gradeid=n||0,this.x=parseInt(i,10)||0,this.y=parseInt(o,10)||0,this.width=parseInt(u,10)||0,this.rawtext=l||"",this.pageno=r||0,this.colour=f||"yellow",this.drawable=!1,this.deleteme=!1,this.menulink=null,this.menu=null,this.clean=function(){return{gradeid:this.gradeid,x:parseInt(this.x,10),y:parseInt(this.y,10),width:parseInt(this.width,10),rawtext:this.rawtext,pageno:this.currentpage,colour:this.colour}},this.draw=function(t){var n=new M.assignfeedback_editpdf.drawable(this.editor),r,i=e.one(s.DRAWINGREGION),o,u,f,l;return r=e.Node.create(""),o=e.Node.create(''),u=e.Node.create('
'),this.menulink=u,o.append(r),this.editor.get("readonly")?r.setAttribute("readonly","readonly"):o.append(u),this.width<100&&(this.width=100),f=this.editor.get_window_coordinates(new M.assignfeedback_editpdf.point(this.x,this.y)),r.setStyles({width:this.width+"px",backgroundColor:a[this.colour]}),i.append(o),o.setX(f.x),o.setY(f.y),n.nodes.push(o),r.set("value",this.rawtext),l=r.get("scrollHeight"),r.setStyles({height:l+"px",overflow:"hidden"}),this.editor.get("readonly")||this.attach_events(r,u),t&&r.focus(),this.drawable=n,n},this.delete_comment_later=function(){this.deleteme&&this.remove()},this.attach_events=function(t,n){t.on("blur",function(){this.rawtext=t.get("value"),this.width=parseInt(t.getStyle("width"),10),this.rawtext.replace(/^\s+|\s+$/g,"")===""&&(this.deleteme=!0,e.later(400,this,this.delete_comment_later)),this.editor.save_current_page()},this),n.setData("comment",this),t.on("keyup",function(){var e=t.get("scrollHeight"),n=parseInt(t.getStyle("height"),10);e===n+8&&(e-=8),t.setStyle("height",e+"px")}),t.on("gesturemovestart",function(e){t.setData("dragging",!0),t.setData("offsetx",e.clientX-t.getX()),t.setData("offsety",e.clientY-t.getY())}),t.on("gesturemoveend",function(){t.setData("dragging",!1),this.editor.save_current_page()},null,this),t.on("gesturemove",function(e){var n=e.clientX-t.getData("offsetx"),r=e.clientY-t.getData("offsety"),i,s,o,u,a;i=parseInt(t.getStyle("width"),10),s=parseInt(t.getStyle("height"),10),o=this.editor.get_canvas_coordinates
+(new M.assignfeedback_editpdf.point(n,r)),a=this.editor.get_canvas_bounds(!0),a.x=0,a.y=0,a.width-=i+42,a.height-=s+8,o.clip(a),this.x=o.x,this.y=o.y,u=this.editor.get_window_coordinates(o),t.ancestor().setX(u.x),t.ancestor().setY(u.y)},null,this),this.menu=new M.assignfeedback_editpdf.commentmenu({buttonNode:this.menulink,comment:this})},this.remove=function(){var e=0,t;t=this.editor.pages[this.editor.currentpage].comments;for(e=0;e=0&&this.comments.splice(e,1)},failure:function(e,t){return M.core.exception(t.responseText)}}},e.io(r,i)},this.load=function(){var t=n,r;r={method:"get",context:this,sync:!1,data:{sesskey:M.cfg.sesskey,action:"loadquicklist",userid:this.editor.get("userid"),attemptnumber:this.editor.get("attemptnumber"),assignmentid:this.editor.get("assignmentid")},on:{success:function(t,n){var r;try{r=e.JSON.parse(n.responseText);if(r.error)return new M.core.ajaxException(r);e.each(r,function(e){var t=new M.assignfeedback_editpdf.quickcomment(e.id,e.rawtext,e.width,e.colour);this.comments.push(t)},this)}catch(i){return new M.core.exception(i)}},failure:function(e,t){return M.core.exception(t.responseText)}}},e.io(t,r)}},M.assignfeedback_editpdf=M.assignfeedback_editpdf||{},M.assignfeedback_editpdf.quickcommentlist=QUICKCOMMENTLIST,EDITOR=function(){EDITOR.superclass.constructor.apply(this,arguments)},EDITOR.prototype={dialogue:null,pagecount:0,currentpage:0,pages:[],loadingicon:null,pageimage:null,graphic:null,currentedit:new M.assignfeedback_editpdf.edit,currentdrawable:!1,drawables:[],currentcomment:null,currentannotation:null,lastanntationtool:"pen",quicklist:null,searchcommentswindow:null,currentstamp:null,stamps:[],initializer:function(){var t;t=e.one("#"+this.get("linkid")),t&&(t.on("click",this.link_handler,this),t.on("key",this.link_handler,"down:13",this),this.currentedit.start=!1,this.currentedit.end=!1,this.quicklist=new M.assignfeedback_editpdf.quickcommentlist(this))},refresh_button_state:function(){var t,n,r;t=e.one(s.COMMENTCOLOURBUTTON),r=M.util.image_url("background_colour_"+this.currentedit.commentcolour,"assignfeedback_editpdf"),t.one("img").setAttribute("src",r),this.currentedit.commentcolour==="clear"?t.one("img").setStyle("borderStyle","dashed"):t.one("img").setStyle("borderStyle","solid"),t=e.one(s.ANNOTATIONCOLOURBUTTON),r=M.util.image_url("colour_"+this.currentedit.annotationcolour,"assignfeedback_editpdf"),t.one("img").setAttribute("src",r),n=e.one(c[this.currentedit.tool]),n.addClass("assignfeedback_editpdf_selectedbutton"),n.setAttribute("aria-pressed","true"),t=e.one(s.STAMPSBUTTON),t.one("img").setAttrs({src:this.get_stamp_image_url(this.currentedit.stamp),height:"16",width:"16"})},get_canvas_bounds:function(){var t=e.one(s.DRAWINGCANVAS),n=t.getXY(),r=n[0],i=n[1],o=parseInt(t.getStyle("width"),10),u=parseInt(t.getStyle("height"),10);return new M.assignfeedback_editpdf.rect(r,i,o,u)},get_canvas_coordinates:function(e){var t=this.get_canvas_bounds(),n=new M.assignfeedback_editpdf.point(e.x-t.x,e.y-t.y);return t.x=t.y=0,n.clip(t),n},get_window_coordinates:function(e){var t=this.get_canvas_bounds(),n=new M.assignfeedback_editpdf.point(e.x+t.x,e.y+t.y);return n},link_handler:function(t){var n;t.preventDefault(),this.dialogue?this.dialogue.show():(this.dialogue=new M.core.dialogue({headerContent:this.get("header"),bodyContent:this.get("body"),footerContent:this.get("footer"),width:"840px",visible:!0}),this.dialogue.centerDialogue(),this.dialogue.get("boundingBox").addClass(r.DIALOGUE),this.loadingicon=e.one(s.LOADINGICON),n=e.one
+(s.DRAWINGCANVAS),this.graphic=new e.Graphic({render:s.DRAWINGCANVAS}),this.get("readonly")||(n.on("gesturemovestart",this.edit_start,null,this),n.on("gesturemove",this.edit_move,null,this),n.on("gesturemoveend",this.edit_end,null,this),this.refresh_button_state())),this.load_all_pages()},load_all_pages:function(){var t=n,r;r={method:"get",context:this,sync:!1,data:{sesskey:M.cfg.sesskey,action:"loadallpages",userid:this.get("userid"),attemptnumber:this.get("attemptnumber"),assignmentid:this.get("assignmentid")},on:{success:function(e,t){this.all_pages_loaded(t.responseText)},failure:function(e,t){return M.core.exception(t.responseText)}}},e.io(t,r)},all_pages_loaded:function(t){var n,r,i,s,o;try{n=e.JSON.parse(t);if(n.error||!n.pagecount){this.dialogue.hide(),o=new M.core.alert({message:M.util.get_string("cannotopenpdf","assignfeedback_editpdf")}),o.show();return}}catch(u){this.dialogue.hide(),o=new M.core.alert({title:M.util.get_string("cannotopenpdf","assignfeedback_editpdf")}),o.show();return}this.pagecount=n.pagecount,this.pages=n.pages;for(r=0;r0&&(r=e)},this),r},setup_toolbar:function(){var t,n,r,i,o,u,l,h;i=e.one(s.SEARCHCOMMENTSBUTTON),i.on("click",this.open_search_comments,this),i.on("key",this.open_search_comments,"down:13",this);if(this.get("readonly"))return;e.each(c,function(n,r){t=e.one(n),t.on("click",this.handle_tool_button,this,r),t.on("key",this.handle_tool_button,"down:13",this,r),t.setAttribute("aria-pressed","false")},this),n=e.one(s.COMMENTCOLOURBUTTON),l=new M.assignfeedback_editpdf.colourpicker({buttonNode:n,colours:a,iconprefix:"background_colour_",callback:function(e){var t=e.target.getAttribute("data-colour");t||(t=e.target.ancestor().getAttribute("data-colour")),this.currentedit.commentcolour=t,this.handle_tool_button(e,"comment")},context:this}),r=e.one(s.ANNOTATIONCOLOURBUTTON),l=new M.assignfeedback_editpdf.colourpicker({buttonNode:r,iconprefix:"colour_",colours:f,callback:function(e){var t=e.target.getAttribute("data-colour");t||(t=e.target.ancestor().getAttribute("data-colour")),this.currentedit.annotationcolour=t,this.lastannotationtool?this.handle_tool_button(e,this.lastannotationtool):this.handle_tool_button(e,"pen")},context:this}),u=this.get("stampfiles"),u.length<=0?(e.one(s.STAMPSBUTTON).hide(),e.one(c.stamp).hide()):(h=u[0].substr(u[0].lastIndexOf("/")+1),this.currentedit.stamp=h,o=e.one(s.STAMPSBUTTON),l=new M.assignfeedback_editpdf.stamppicker({buttonNode:o,stamps:u,callback:function(e){var t=e.target.getAttribute("data-stamp"),n;t||(t=e.target.ancestor().getAttribute("data-stamp")),n=t.substr(t.lastIndexOf("/")),this.currentedit.stamp=n,this.refresh_button_state()},context:this}),this.refresh_button_state())},handle_tool_button:function(t,n){var r;t.preventDefault(),r=e.one(c[this.currentedit.tool]),r.removeClass("assignfeedback_editpdf_selectedbutton"),r.setAttribute("aria-pressed","false"),this.currentedit.tool=n,n!=="comment"&&n!=="select"&&(this.lastannotationtool=n),this.refresh_button_state()},stringify_current_page:function(){var t=[],n=[],r,i=0;for(i=0;in.width||o.y<0||o.y>n.height)return;this.currentedit.tool==="pen"&&this.currentedit.path.push(o),this.currentedit.tool==="select"?this.currentannotation&&this.currentedit&&this.currentannotation.move(this.currentedit.annotationstart.x+o.x-this.currentedit.start.x,this.currentedit.annotationstart.y+o.y-this.currentedit.start.y):this.currentedit.start&&(this.currentedit.end=o,this.redraw_current_edit())},edit_end:function(){var e,t,n;e=(new Date).getTime()-this.currentedit.start;if(e0)this.drawables.pop().erase();for(e=0;e0?r.removeAttribute("disabled"):r.setAttribute("disabled","true"),this.currentpage"),r.setAttribute("value",n),r.setHTML(M.util.get_string("pagenumber","assignfeedback_editpdf",n+1)),t.append(r);t.removeAttribute("disabled"),t.on("change",function(){this.currentpage=t.get("value"),this.change_page()},this),i=e.one(s.PREVIOUSBUTTON),o=e.one(s.NEXTBUTTON),i.on("click",this.previous_page,this),i.on("key",this.previous_page,"down:13",this),o.on("click",this.next_page,this),o.on("key",this.next_page,"down:13",this)},previous_page:function(e){e.preventDefault(),this.currentpage--,this.currentpage<0&&(this.currentpage=0),this.change_page()},next_page:function(e){e.preventDefault(),this.currentpage++,this.currentpage>=this.pages.length&&(this.currentpage=this.pages.length-1),this.change_page()}},e.extend(EDITOR,e.Base,EDITOR.prototype,{NAME:"moodle-assignfeedback_editpdf-editor",ATTRS:{userid:{validator:e.Lang.isInteger,value:0},assignmentid:{validator:e.Lang.isInteger,value:0},attemptnumber:{validator:e.Lang.isInteger,value:0},header:{validator:e.Lang.isString,value:""},body:{validator:e.Lang.isString,value:""},footer:{validator:e.Lang.isString,value:""},linkid:{validator:e.Lang.isString,value:""},deletelinkid:{validator:e.Lang.isString,value:""},readonly:{validator:e.Lang.isBoolean,value:!0},stampfiles:{validator:e.Lang.isArray,value:""}}}),M.assignfeedback_editpdf=M.assignfeedback_editpdf||{},M.assignfeedback_editpdf.editor=M.assignfeedback_editpdf.editor||{},M.assignfeedback_editpdf.editor.init=M.assignfeedback_editpdf.editor.init||function(e){return new EDITOR(e)}},"@VERSION@",{requires:["base","event","node","io","graphics","json","event-move","querystring-stringify-simple","moodle-core-notification-dialog","moodle-core-notification-exception","moodle-core-notification-ajaxexception"]});
diff --git a/mod/assign/feedback/editpdf/yui/build/moodle-assignfeedback_editpdf-editor/moodle-assignfeedback_editpdf-editor.js b/mod/assign/feedback/editpdf/yui/build/moodle-assignfeedback_editpdf-editor/moodle-assignfeedback_editpdf-editor.js
index 596582f2252..7fc1ae54c25 100644
--- a/mod/assign/feedback/editpdf/yui/build/moodle-assignfeedback_editpdf-editor/moodle-assignfeedback_editpdf-editor.js
+++ b/mod/assign/feedback/editpdf/yui/build/moodle-assignfeedback_editpdf-editor/moodle-assignfeedback_editpdf-editor.js
@@ -667,9 +667,11 @@ Y.extend(ANNOTATION, Y.Base, {
* @method remove
* @param event
*/
- remove : function() {
+ remove : function(e) {
var annotations;
+ e.preventDefault();
+
annotations = this.editor.pages[this.editor.currentpage].annotations;
for (i = 0; i < annotations.length; i++) {
if (annotations[i] === this) {
@@ -1577,7 +1579,7 @@ Y.extend(DROPDOWN, M.core.dialogue, {
}
}, this);
- button.on('click', this.show, this);
+ button.on('click', function(e) {e.preventDefault(); this.show();}, this);
button.on('key', this.show, 'enter,space', this);
},
@@ -1682,6 +1684,8 @@ Y.extend(COLOURPICKER, M.assignfeedback_editpdf.dropdown, {
COLOURPICKER.superclass.initializer.call(this, config);
},
callback_handler : function(e) {
+ e.preventDefault();
+
var callback = this.get('callback'),
callbackcontext = this.get('context'),
bind;
@@ -1798,6 +1802,7 @@ Y.extend(STAMPPICKER, M.assignfeedback_editpdf.dropdown, {
STAMPPICKER.superclass.initializer.call(this, config);
},
callback_handler : function(e) {
+ e.preventDefault();
var callback = this.get('callback'),
callbackcontext = this.get('context'),
bind;
@@ -1890,7 +1895,7 @@ Y.extend(COMMENTMENU, M.assignfeedback_editpdf.dropdown, {
commentlinks.append(link);
link = Y.Node.create('' + M.util.get_string('deletecomment', 'assignfeedback_editpdf') + '');
- link.on('click', function() { comment.menu.hide(); comment.remove(); }, comment);
+ link.on('click', function(e) { e.preventDefault(); this.menu.hide(); this.remove(); }, comment);
link.on('key', function() { comment.menu.hide(); comment.remove(); }, 'enter,space', comment);
commentlinks.append(link);
@@ -2056,6 +2061,7 @@ Y.extend(COMMENTSEARCH, M.core.dialogue, {
* @method focus_on_comment
*/
focus_on_comment : function(e) {
+ e.preventDefault();
var target = e.target.ancestor('li'),
comment = target.getData('comment'),
editor = this.get('editor');
@@ -2447,6 +2453,8 @@ COMMENT = function(editor, gradeid, pageno, x, y, width, colour, rawtext) {
* @method remove_from_quicklist
*/
this.remove_from_quicklist = function(e, quickcomment) {
+ e.preventDefault();
+
this.menu.hide();
this.editor.quicklist.remove(quickcomment);
@@ -2460,6 +2468,8 @@ COMMENT = function(editor, gradeid, pageno, x, y, width, colour, rawtext) {
* @method set_from_quick_comment
*/
this.set_from_quick_comment = function(e, quickcomment) {
+ e.preventDefault();
+
this.menu.hide();
this.rawtext = quickcomment.rawtext;
@@ -2477,7 +2487,8 @@ COMMENT = function(editor, gradeid, pageno, x, y, width, colour, rawtext) {
* @protected
* @method add_to_quicklist
*/
- this.add_to_quicklist = function() {
+ this.add_to_quicklist = function(e) {
+ e.preventDefault();
this.menu.hide();
this.editor.quicklist.add(this);
};
@@ -3740,7 +3751,8 @@ EDITOR.prototype = {
* @protected
* @method previous_page
*/
- previous_page : function() {
+ previous_page : function(e) {
+ e.preventDefault();
this.currentpage--;
if (this.currentpage < 0) {
this.currentpage = 0;
@@ -3753,7 +3765,8 @@ EDITOR.prototype = {
* @protected
* @method next_page
*/
- next_page : function() {
+ next_page : function(e) {
+ e.preventDefault();
this.currentpage++;
if (this.currentpage >= this.pages.length) {
this.currentpage = this.pages.length - 1;
diff --git a/mod/assign/feedback/editpdf/yui/src/editor/js/annotation.js b/mod/assign/feedback/editpdf/yui/src/editor/js/annotation.js
index ac1c8482f5a..d3735d4a297 100644
--- a/mod/assign/feedback/editpdf/yui/src/editor/js/annotation.js
+++ b/mod/assign/feedback/editpdf/yui/src/editor/js/annotation.js
@@ -233,9 +233,11 @@ Y.extend(ANNOTATION, Y.Base, {
* @method remove
* @param event
*/
- remove : function() {
+ remove : function(e) {
var annotations;
+ e.preventDefault();
+
annotations = this.editor.pages[this.editor.currentpage].annotations;
for (i = 0; i < annotations.length; i++) {
if (annotations[i] === this) {
diff --git a/mod/assign/feedback/editpdf/yui/src/editor/js/colourpicker.js b/mod/assign/feedback/editpdf/yui/src/editor/js/colourpicker.js
index 196eb8a00e5..fcdaf7a2d38 100644
--- a/mod/assign/feedback/editpdf/yui/src/editor/js/colourpicker.js
+++ b/mod/assign/feedback/editpdf/yui/src/editor/js/colourpicker.js
@@ -58,6 +58,8 @@ Y.extend(COLOURPICKER, M.assignfeedback_editpdf.dropdown, {
COLOURPICKER.superclass.initializer.call(this, config);
},
callback_handler : function(e) {
+ e.preventDefault();
+
var callback = this.get('callback'),
callbackcontext = this.get('context'),
bind;
diff --git a/mod/assign/feedback/editpdf/yui/src/editor/js/comment.js b/mod/assign/feedback/editpdf/yui/src/editor/js/comment.js
index 75b86d7dced..22b235d4e2b 100644
--- a/mod/assign/feedback/editpdf/yui/src/editor/js/comment.js
+++ b/mod/assign/feedback/editpdf/yui/src/editor/js/comment.js
@@ -330,6 +330,8 @@ COMMENT = function(editor, gradeid, pageno, x, y, width, colour, rawtext) {
* @method remove_from_quicklist
*/
this.remove_from_quicklist = function(e, quickcomment) {
+ e.preventDefault();
+
this.menu.hide();
this.editor.quicklist.remove(quickcomment);
@@ -343,6 +345,8 @@ COMMENT = function(editor, gradeid, pageno, x, y, width, colour, rawtext) {
* @method set_from_quick_comment
*/
this.set_from_quick_comment = function(e, quickcomment) {
+ e.preventDefault();
+
this.menu.hide();
this.rawtext = quickcomment.rawtext;
@@ -360,7 +364,8 @@ COMMENT = function(editor, gradeid, pageno, x, y, width, colour, rawtext) {
* @protected
* @method add_to_quicklist
*/
- this.add_to_quicklist = function() {
+ this.add_to_quicklist = function(e) {
+ e.preventDefault();
this.menu.hide();
this.editor.quicklist.add(this);
};
diff --git a/mod/assign/feedback/editpdf/yui/src/editor/js/commentmenu.js b/mod/assign/feedback/editpdf/yui/src/editor/js/commentmenu.js
index 12d777b93b0..e9579c4b6a0 100644
--- a/mod/assign/feedback/editpdf/yui/src/editor/js/commentmenu.js
+++ b/mod/assign/feedback/editpdf/yui/src/editor/js/commentmenu.js
@@ -39,7 +39,7 @@ Y.extend(COMMENTMENU, M.assignfeedback_editpdf.dropdown, {
commentlinks.append(link);
link = Y.Node.create('' + M.util.get_string('deletecomment', 'assignfeedback_editpdf') + '');
- link.on('click', function() { comment.menu.hide(); comment.remove(); }, comment);
+ link.on('click', function(e) { e.preventDefault(); this.menu.hide(); this.remove(); }, comment);
link.on('key', function() { comment.menu.hide(); comment.remove(); }, 'enter,space', comment);
commentlinks.append(link);
diff --git a/mod/assign/feedback/editpdf/yui/src/editor/js/commentsearch.js b/mod/assign/feedback/editpdf/yui/src/editor/js/commentsearch.js
index 86ca960c13d..943f2733ef4 100644
--- a/mod/assign/feedback/editpdf/yui/src/editor/js/commentsearch.js
+++ b/mod/assign/feedback/editpdf/yui/src/editor/js/commentsearch.js
@@ -92,6 +92,7 @@ Y.extend(COMMENTSEARCH, M.core.dialogue, {
* @method focus_on_comment
*/
focus_on_comment : function(e) {
+ e.preventDefault();
var target = e.target.ancestor('li'),
comment = target.getData('comment'),
editor = this.get('editor');
diff --git a/mod/assign/feedback/editpdf/yui/src/editor/js/dropdown.js b/mod/assign/feedback/editpdf/yui/src/editor/js/dropdown.js
index 50259fd78ab..93efa20dd9c 100644
--- a/mod/assign/feedback/editpdf/yui/src/editor/js/dropdown.js
+++ b/mod/assign/feedback/editpdf/yui/src/editor/js/dropdown.js
@@ -55,7 +55,7 @@ Y.extend(DROPDOWN, M.core.dialogue, {
}
}, this);
- button.on('click', this.show, this);
+ button.on('click', function(e) {e.preventDefault(); this.show();}, this);
button.on('key', this.show, 'enter,space', this);
},
diff --git a/mod/assign/feedback/editpdf/yui/src/editor/js/editor.js b/mod/assign/feedback/editpdf/yui/src/editor/js/editor.js
index 50523c6994c..70491e1c995 100644
--- a/mod/assign/feedback/editpdf/yui/src/editor/js/editor.js
+++ b/mod/assign/feedback/editpdf/yui/src/editor/js/editor.js
@@ -929,7 +929,8 @@ EDITOR.prototype = {
* @protected
* @method previous_page
*/
- previous_page : function() {
+ previous_page : function(e) {
+ e.preventDefault();
this.currentpage--;
if (this.currentpage < 0) {
this.currentpage = 0;
@@ -942,7 +943,8 @@ EDITOR.prototype = {
* @protected
* @method next_page
*/
- next_page : function() {
+ next_page : function(e) {
+ e.preventDefault();
this.currentpage++;
if (this.currentpage >= this.pages.length) {
this.currentpage = this.pages.length - 1;
diff --git a/mod/assign/feedback/editpdf/yui/src/editor/js/stamppicker.js b/mod/assign/feedback/editpdf/yui/src/editor/js/stamppicker.js
index 71aad62843f..26fdf1459e0 100644
--- a/mod/assign/feedback/editpdf/yui/src/editor/js/stamppicker.js
+++ b/mod/assign/feedback/editpdf/yui/src/editor/js/stamppicker.js
@@ -52,6 +52,7 @@ Y.extend(STAMPPICKER, M.assignfeedback_editpdf.dropdown, {
STAMPPICKER.superclass.initializer.call(this, config);
},
callback_handler : function(e) {
+ e.preventDefault();
var callback = this.get('callback'),
callbackcontext = this.get('context'),
bind;