From 673c4ffe606ac13b81f22e47949a5fa21496b406 Mon Sep 17 00:00:00 2001 From: Jerome Mouneyrac Date: Mon, 7 Oct 2013 12:13:08 +0800 Subject: [PATCH] MDL-42030 EditPDF: when selecting stamp image the stamp tool is not selected --- .../moodle-assignfeedback_editpdf-editor-debug.js | 4 ++-- .../moodle-assignfeedback_editpdf-editor-min.js | 4 ++-- .../moodle-assignfeedback_editpdf-editor.js | 4 ++-- mod/assign/feedback/editpdf/yui/src/editor/js/editor.js | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) 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 2897ba017c2..7a531d52628 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 @@ -3310,7 +3310,7 @@ EDITOR.prototype = { } filename = stamp.substr(stamp.lastIndexOf('/')); this.currentedit.stamp = filename; - this.refresh_button_state(); + this.handle_tool_button(e, "stamp"); }, context: this }); @@ -3333,7 +3333,7 @@ EDITOR.prototype = { currenttoolnode.removeClass('assignfeedback_editpdf_selectedbutton'); currenttoolnode.setAttribute('aria-pressed', 'false'); this.currentedit.tool = tool; - if (tool !== "comment" && tool !== "select") { + if (tool !== "comment" && tool !== "select" && tool !== "stamp") { this.lastannotationtool = tool; } this.refresh_button_state(); 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 13f0e948288..c702e87f9e3 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 @@ -3,5 +3,5 @@ ANNOTATIONLINE.NAME="annotationline",ANNOTATIONLINE.ATTRS={},e.extend(ANNOTATION ,stroke:!1,fill:{color:s},x:i.x,y:t.start.y}),n.shapes.push(r),n},init_from_edit:function(e){var t=new M.assignfeedback_editpdf.rect;t.bound([e.start,e.end]),this.gradeid=this.editor.get("gradeid"),this.pageno=this.editor.currentpage,this.x=t.x,this.y=e.start.y,this.endx=t.x+t.width,this.endy=e.start.y+16,this.colour=e.annotationcolour,this.page=""}}),M.assignfeedback_editpdf=M.assignfeedback_editpdf||{},M.assignfeedback_editpdf.annotationhighlight=ANNOTATIONHIGHLIGHT,ANNOTATIONSTAMP=function(e){ANNOTATIONSTAMP.superclass.constructor.apply(this,[e])},ANNOTATIONSTAMP.NAME="annotationstamp",ANNOTATIONSTAMP.ATTRS={},e.extend(ANNOTATIONSTAMP,M.assignfeedback_editpdf.annotation,{draw:function(){var t=new M.assignfeedback_editpdf.drawable(this.editor),n=e.one(s.DRAWINGREGION),r,i;return i=this.editor.get_window_coordinates(new M.assignfeedback_editpdf.point(this.x,this.y)),r=e.Node.create("
"),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('