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 596582f225224..7fc1ae54c25bf 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 7fa25ef986840..140ecf1ffa26b 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('