From 6d87dcebe2496106d525c55500cb7758a9607130 Mon Sep 17 00:00:00 2001 From: Damyon Wiese Date: Thu, 24 Oct 2013 13:50:58 +0800 Subject: [PATCH] MDL-42401 EditPDF: Allow dragging the edit pdf window. Also move the location of the call the centerDialogue so it fires after the drawing region is added to the window. --- .../moodle-assignfeedback_editpdf-editor-debug.js | 8 ++++---- .../moodle-assignfeedback_editpdf-editor-min.js | 6 +++--- .../moodle-assignfeedback_editpdf-editor.js | 8 ++++---- mod/assign/feedback/editpdf/yui/src/editor/js/editor.js | 8 ++++---- 4 files changed, 15 insertions(+), 15 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 596582f2252..4f996e6bcfd 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 @@ -3090,10 +3090,10 @@ EDITOR.prototype = { bodyContent: this.get('body'), footerContent: this.get('footer'), width: '840px', - visible: true + visible: false, + draggable: true }); - this.dialogue.centerDialogue(); // Add custom class for styling. this.dialogue.get('boundingBox').addClass(CSS.DIALOGUE); @@ -3109,9 +3109,9 @@ EDITOR.prototype = { this.refresh_button_state(); } - } else { - this.dialogue.show(); } + this.dialogue.centerDialogue(); + this.dialogue.show(); this.load_all_pages(); }, 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..dca07a7c93d 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 @@ -2,6 +2,6 @@ YUI.add("moodle-assignfeedback_editpdf-editor",function(e,t){var n=M.cfg.wwwroot ANNOTATIONLINE.NAME="annotationline",ANNOTATIONLINE.ATTRS={},e.extend(ANNOTATIONLINE,M.assignfeedback_editpdf.annotation,{draw:function(){var t,n;return t=new M.assignfeedback_editpdf.drawable(this.editor),n=this.editor.graphic.addShape({type:e.Path,fill:!1,stroke:{weight:h,color:f[this.colour]}}),n.moveTo(this.x,this.y),n.lineTo(this.endx,this.endy),n.end(),t.shapes.push(n),this.drawable=t,ANNOTATIONLINE.superclass.draw.apply(this)},draw_current_edit:function(t){var n=new M.assignfeedback_editpdf.drawable(this.editor),r;return r=this.editor.graphic.addShape({type:e.Path,fill:!1,stroke:{weight:h,color:f[t.annotationcolour]}}),r.moveTo(t.start.x,t.start.y),r.lineTo(t.end.x,t.end.y),r.end(),n.shapes.push(r),n},init_from_edit:function(e){this.gradeid=this.editor.get("gradeid"),this.pageno=this.editor.currentpage,this.x=e.start.x,this.y=e.start.y,this.endx=e.end.x,this.endy=e.end.y,this.colour=e.annotationcolour,this.path=""}}),M.assignfeedback_editpdf=M.assignfeedback_editpdf||{},M.assignfeedback_editpdf.annotationline=ANNOTATIONLINE,ANNOTATIONRECTANGLE=function(e){ANNOTATIONRECTANGLE.superclass.constructor.apply(this,[e])},ANNOTATIONRECTANGLE.NAME="annotationrectangle",ANNOTATIONRECTANGLE.ATTRS={},e.extend(ANNOTATIONRECTANGLE,M.assignfeedback_editpdf.annotation,{draw:function(){var t,n;return t=new M.assignfeedback_editpdf.drawable(this.editor),bounds=new M.assignfeedback_editpdf.rect,bounds.bound([new M.assignfeedback_editpdf.point(this.x,this.y),new M.assignfeedback_editpdf.point(this.endx,this.endy)]),n=this.editor.graphic.addShape({type:e.Rect,width:bounds.width,height:bounds.height,stroke:{weight:h,color:f[this.colour]},x:bounds.x,y:bounds.y}),t.shapes.push(n),this.drawable=t,ANNOTATIONRECTANGLE.superclass.draw.apply(this)},draw_current_edit:function(t){var n=new M.assignfeedback_editpdf.drawable(this.editor),r,i;return i=new M.assignfeedback_editpdf.rect,i.bound([new M.assignfeedback_editpdf.point(t.start.x,t.start.y),new M.assignfeedback_editpdf.point(t.end.x,t.end.y)]),r=this.editor.graphic.addShape({type:e.Rect,width:i.width,height:i.height,stroke:{weight:h,color:f[t.annotationcolour]},x:i.x,y:i.y}),n.shapes.push(r),n}}),M.assignfeedback_editpdf=M.assignfeedback_editpdf||{},M.assignfeedback_editpdf.annotationrectangle=ANNOTATIONRECTANGLE,ANNOTATIONOVAL=function(e){ANNOTATIONOVAL.superclass.constructor.apply(this,[e])},ANNOTATIONOVAL.NAME="annotationoval",ANNOTATIONOVAL.ATTRS={},e.extend(ANNOTATIONOVAL,M.assignfeedback_editpdf.annotation,{draw:function(){var t,n;return t=new M.assignfeedback_editpdf.drawable(this.editor),bounds=new M.assignfeedback_editpdf.rect,bounds.bound([new M.assignfeedback_editpdf.point(this.x,this.y),new M.assignfeedback_editpdf.point(this.endx,this.endy)]),n=this.editor.graphic.addShape({type:e.Ellipse,width:bounds.width,height:bounds.height,stroke:{weight:h,color:f[this.colour]},x:bounds.x,y:bounds.y}),t.shapes.push(n),this.drawable=t,ANNOTATIONOVAL.superclass.draw.apply(this)},draw_current_edit:function(t){var n=new M.assignfeedback_editpdf.drawable(this.editor),r,i;return i=new M.assignfeedback_editpdf.rect,i.bound([new M.assignfeedback_editpdf.point(t.start.x,t.start.y),new M.assignfeedback_editpdf.point(t.end.x,t.end.y)]),r=this.editor.graphic.addShape({type:e.Ellipse,width:i.width,height:i.height,stroke:{weight:h,color:f[t.annotationcolour]},x:i.x,y:i.y}),n.shapes.push(r),n}}),M.assignfeedback_editpdf=M.assignfeedback_editpdf||{},M.assignfeedback_editpdf.annotationoval=ANNOTATIONOVAL,ANNOTATIONPEN=function(e){ANNOTATIONPEN.superclass.constructor.apply(this,[e])},ANNOTATIONPEN.NAME="annotationpen",ANNOTATIONPEN.ATTRS={},e.extend(ANNOTATIONPEN,M.assignfeedback_editpdf.annotation,{draw:function(){var t,n,r,i,s;return t=new M.assignfeedback_editpdf.drawable(this.editor),n=this.editor.graphic.addShape({type:e.Path,fill:!1,stroke:{weight:h,color:f[this.colour]}}),r=!0,i=this.path.split(":"),e.each(i,function(e){s=e.split(","),r?(n.moveTo(s[0],s[1]),r=!1):n.lineTo(s[0],s[1])},this),n.end(),t.shapes.push(n),this.drawable=t,ANNOTATIONPEN.superclass.draw.apply(this)},draw_current_edit:function(t){var n=new M.assignfeedback_editpdf.drawable(this.editor),r,i;return r=this.editor.graphic.addShape({type:e.Path,fill:!1,stroke:{weight:h,color:f[t.annotationcolour]}}),i=!0,e.each(t.path,function(e){i?(r.moveTo(e.x,e.y),i=!1):r.lineTo(e.x,e.y)},this),r.end(),n.shapes.push(r),n},init_from_edit:function(e){var t=new M.assignfeedback_editpdf.rect,n=[],r=0;t.bound(e.path);for(r=0;r"),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('