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 ee82675f460..edd0c46de57 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
@@ -1570,15 +1570,14 @@ Y.extend(ANNOTATIONSTAMP, M.assignfeedback_editpdf.annotation, {
*/
draw: function() {
var drawable = new M.assignfeedback_editpdf.drawable(this.editor),
- drawingregion = this.editor.get_dialogue_element(SELECTOR.DRAWINGREGION),
+ drawingcanvas = this.editor.get_dialogue_element(SELECTOR.DRAWINGCANVAS),
node,
position;
position = this.editor.get_window_coordinates(new M.assignfeedback_editpdf.point(this.x, this.y));
node = Y.Node.create('
');
- // If these are absolutely positioned, they escape their scroll container.
node.setStyles({
- 'position': 'relative',
+ 'position': 'absolute',
'display': 'inline-block',
'backgroundImage': 'url(' + this.editor.get_stamp_image_url(this.path) + ')',
'width': (this.endx - this.x),
@@ -1587,7 +1586,7 @@ Y.extend(ANNOTATIONSTAMP, M.assignfeedback_editpdf.annotation, {
'zIndex': 50
});
- drawingregion.append(node);
+ drawingcanvas.append(node);
node.setX(position.x);
node.setY(position.y);
drawable.store_position(node, position.x, position.y);
@@ -2544,7 +2543,7 @@ var COMMENT = function(editor, gradeid, pageno, x, y, width, colour, rawtext) {
this.draw = function(focus) {
var drawable = new M.assignfeedback_editpdf.drawable(this.editor),
node,
- drawingregion = this.editor.get_dialogue_element(SELECTOR.DRAWINGREGION),
+ drawingcanvas = this.editor.get_dialogue_element(SELECTOR.DRAWINGCANVAS),
container,
label,
marker,
@@ -2587,8 +2586,8 @@ var COMMENT = function(editor, gradeid, pageno, x, y, width, colour, rawtext) {
color: COMMENTTEXTCOLOUR
});
- drawingregion.append(container);
- container.setStyle('position', 'relative');
+ drawingcanvas.append(container);
+ container.setStyle('position', 'absolute');
container.setX(position.x);
container.setY(position.y);
drawable.store_position(container, position.x, position.y);
@@ -3664,7 +3663,7 @@ EDITOR.prototype = {
* @method open_in_panel
*/
open_in_panel: function(panel) {
- var drawingcanvas, drawingregion;
+ var drawingcanvas;
this.panel = panel;
panel.append(this.get('body'));
@@ -3675,9 +3674,6 @@ EDITOR.prototype = {
drawingcanvas = this.get_dialogue_element(SELECTOR.DRAWINGCANVAS);
this.graphic = new Y.Graphic({render: drawingcanvas});
- drawingregion = this.get_dialogue_element(SELECTOR.DRAWINGREGION);
- drawingregion.on('scroll', this.move_canvas, this);
-
if (!this.get('readonly')) {
drawingcanvas.on('gesturemovestart', this.edit_start, null, this);
drawingcanvas.on('gesturemove', this.edit_move, null, this);
@@ -3694,7 +3690,7 @@ EDITOR.prototype = {
* @method link_handler
*/
link_handler: function(e) {
- var drawingcanvas, drawingregion;
+ var drawingcanvas;
var resize = true;
e.preventDefault();
@@ -3717,9 +3713,6 @@ EDITOR.prototype = {
drawingcanvas = this.get_dialogue_element(SELECTOR.DRAWINGCANVAS);
this.graphic = new Y.Graphic({render: drawingcanvas});
- drawingregion = this.get_dialogue_element(SELECTOR.DRAWINGREGION);
- drawingregion.on('scroll', this.move_canvas, this);
-
if (!this.get('readonly')) {
drawingcanvas.on('gesturemovestart', this.edit_start, null, this);
drawingcanvas.on('gesturemove', this.edit_move, null, this);
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 7a85b4555f5..867594d6ed9 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,10 +1,10 @@
YUI.add("moodle-assignfeedback_editpdf-editor",function(e,t){var n=M.cfg.wwwroot+"/mod/assign/feedback/editpdf/ajax.php",r=M.cfg.wwwroot+"/mod/assign/feedback/editpdf/ajax_progress.php",i={DIALOGUE:"assignfeedback_editpdf_widget"},s={PREVIOUSBUTTON:".navigate-previous-button",NEXTBUTTON:" .navigate-next-button",SEARCHCOMMENTSBUTTON:".searchcommentsbutton",EXPCOLCOMMENTSBUTTON:".expcolcommentsbutton",SEARCHFILTER:".assignfeedback_editpdf_commentsearch input",SEARCHCOMMENTSLIST:".assignfeedback_editpdf_commentsearch ul",PAGESELECT:".navigate-page-select",LOADINGICON:".loading",PROGRESSBARCONTAINER:".progress-info.progress-striped",DRAWINGREGION:".drawingregion",DRAWINGCANVAS:".drawingcanvas",SAVE:".savebutton",COMMENTCOLOURBUTTON:".commentcolourbutton",COMMENTMENU:".commentdrawable a",ANNOTATIONCOLOURBUTTON:".annotationcolourbutton",DELETEANNOTATIONBUTTON:".deleteannotationbutton",WARNINGMESSAGECONTAINER:".warningmessages",ICONMESSAGECONTAINER:".infoicon",UNSAVEDCHANGESDIV:".assignfeedback_editpdf_warningmessages",UNSAVEDCHANGESINPUT:'input[name="assignfeedback_editpdf_haschanges"]',STAMPSBUTTON:".currentstampbutton",USERINFOREGION:'[data-region="user-info"]',ROTATELEFTBUTTON:".rotateleftbutton",ROTATERIGHTBUTTON:".rotaterightbutton",DIALOGUE:"."+i.DIALOGUE},o="rgba(200, 200, 255, 0.9)",u="rgba(200, 200, 255, 0.5)",a="rgb(51, 51, 51)",f={white:"rgb(255,255,255)",yellow:"rgb(255,236,174)",red:"rgb(249,181,179)",green:"rgb(214,234,178)",blue:"rgb(203,217,237)",clear:"rgba(255,255,255, 0)"},l={white:"rgb(255,255,255)",yellow:"rgb(255,207,53)",red:"rgb(239,69,64)",green:"rgb(152,202,62)",blue:"rgb(125,159,211)",black:"rgb(51,51,51)"},c=300,h={comment:".commentbutton",pen:".penbutton",line:".linebutton",rectangle:".rectanglebutton",oval:".ovalbutton",stamp:".stampbutton",select:".selectbutton",drag:".dragbutton",highlight:".highlightbutton"},p=4,d=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=d;var v=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},this.has_min_width=function(){return this.width>=5},this.has_min_height=function(){return this.height>=5},this.set_min_width=function(){this.width=5},this.set_min_height=function(){this.height=5}};M.assignfeedback_editpdf=M.assignfeedback_editpdf||{},M.assignfeedback_editpdf.rect=v;var m=function(){this.start=!1,this.end=!1,this.starttime=0,this.annotationstart=!1,this.tool="drag",this.commentcolour="yellow",this.annotationcolour="red",this.stamp="",this.path=[]};M.assignfeedback_editpdf=M.assignfeedback_editpdf||{},M.assignfeedback_editpdf.edit=m;var g=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()},this.scroll_update=function(e,t){var n,r,i;for(n=0;n'),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,n;e.preventDefault(),t=this.editor.pages[this.editor.currentpage].annotations;for(n=0;n"),r.setStyles({position:"relative",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),t.store_position(r,i.x,i.y),this.editor.get("readonly")||(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,T.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=this.editor.get_dialogue_element(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({position:"absolute",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.store_position(o,u.x,u.y),r.nodes.push(o),r},init_from_edit:function(e){var t=new M.assignfeedback_editpdf.rect;return 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,!0},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=T;var N="Dropdown menu",C;C=function(e){e.draggable=!1,e.centered=!1,e.width="auto",e.visible=!1,e.footerContent="",C.superclass.constructor.apply(this,[e])},e.extend(C,M.core.dialogue,{initializer:function(t){var n,r,i,s;C.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.get("id")!==n.get("id")&&e.target.ancestor().get("id")!==n.get("id")&&(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"),n=C.superclass.show.call(this);return this.align(t,[e.WidgetPositionAlign.TL,e.WidgetPositionAlign.BL]),n}},{NAME:N,ATTRS:{headerText:{value:""},buttonNode:{value:null}}}),e.Base.modifyAttrs(C,{modal:{getter:function(){return!1}}}),M.assignfeedback_editpdf=M.assignfeedback_editpdf||{},M.assignfeedback_editpdf.dropdown=C;var k="Colourpicker",L;L=function(e){L.superclass.constructor.apply(this,[e])},e.extend(L,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),L.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:k,ATTRS:{colours:{value:{}},callback:{value:null},context:{value:null},iconprefix:{value:"colour_"}}}),M.assignfeedback_editpdf=M.assignfeedback_editpdf||{},M.assignfeedback_editpdf.colourpicker=L;var A="Colourpicker",O;O=function(e){O.superclass.constructor.apply(this,[e])},e.extend(O,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),O.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:A,ATTRS:{stamps:{value:[]},callback:{value:null},context:{value:null}}}),M.assignfeedback_editpdf=M.assignfeedback_editpdf||{},M.assignfeedback_editpdf.stamppicker=O;var _="Commentmenu",D;D=function(e){D.superclass.constructor.apply(this,[e])},e.extend(D,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),D.superclass.initializer.call(this,t)},show:function(){var t=this.get("boundingBox").one("ul");t.all(".quicklist_comment").remove(!0);var n=this.get("comment");n.deleteme=!1,e.each(n.editor.quicklist.comments,function(r){var i=e.Node.create(''),s=e.Node.create(''+r.rawtext+""),o=e.Node.create('");s.setAttribute("title",r.rawtext),i.append(s),i.append(o),t.append(i),i.on("click",n.set_from_quick_comment,n,r),i.on("key",n.set_from_quick_comment,"space,enter",n,r),o.on("click",n.remove_from_quicklist,n,r),o.on("key",n.remove_from_quicklist,"space,enter",n,r)},this),D.superclass.show.call(this)}},{NAME:_,ATTRS:{comment:{value:null}}}),M.assignfeedback_editpdf=M.assignfeedback_editpdf||{},M.assignfeedback_editpdf.commentmenu=D;var P="commentsearch",H;H=function(e){e.draggable=!1,e.centered=!0,e.width="400px",e.visible=!1,e.headerContent=M.util.get_string("searchcomments","assignfeedback_editpdf"),e.footerContent="",H.superclass.constructor.apply(this,[e])},e.extend(H,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,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),H.superclass.initializer.call(this,t)},filter_search_comments:function(){var t,n,r,i;i=this.get("id"),t=e.one("#"+i+s.SEARCHFILTER),n=e.one("#"+i+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=n.clean().pageno,n.pageno!==r.currentpage&&(r.currentpage=n.pageno,r.change_page()),n.node=n.drawable.nodes[0].one("textarea"),n.node.ancestor("div").removeClass("commentcollapsed"),n.node.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(),H.superclass.show.call(this)}},{NAME:P,ATTRS:{editor:{value:null}}}),e.Base.modifyAttrs(H,{modal:{getter:function(){return!0}}}),M.assignfeedback_editpdf=M.assignfeedback_editpdf||{},M.assignfeedback_editpdf.commentsearch=H;var B=function(t,n,r,i,o,u,l,c){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=c||"",this.pageno=r||0,this.colour=l||"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:parseInt(this.pageno,10),colour:this.colour}},this.draw=function(n){var r=new M.assignfeedback_editpdf.drawable(this.editor),i,o=this.editor.get_dialogue_element(s.DRAWINGREGION),u,l,c,h,p,d;return i=e.Node.create(""),u=e.Node.create(''),l=e.Node.create(""),c=e.Node.create(''),h=e.Node.create('
'),this.menulink=h,u.append(l),l.append(i),u.append(c),u.setAttribute("tabindex","-1"),l.setAttribute("tabindex","0"),i.setAttribute("tabindex","-1"),h.setAttribute("tabindex","0"),this.editor.get("readonly")?i.setAttribute("readonly","readonly"
-):u.append(h),this.width<100&&(this.width=100),p=this.editor.get_window_coordinates(new M.assignfeedback_editpdf.point(this.x,this.y)),i.setStyles({width:this.width+"px",backgroundColor:f[this.colour],color:a}),o.append(u),u.setStyle("position","relative"),u.setX(p.x),u.setY(p.y),r.store_position(u,p.x,p.y),r.nodes.push(u),i.set("value",this.rawtext),d=i.get("scrollHeight"),i.setStyles({height:d+"px",overflow:"hidden"}),c.setStyle("color",f[this.colour]),this.attach_events(i,h),n?i.focus():t.collapsecomments&&u.addClass("commentcollapsed"),this.drawable=r,r},this.delete_comment_later=function(){this.deleteme&&this.remove()},this.attach_events=function(n,r){var i=n.ancestor("div"),s=n.ancestor("label"),o=s.next("svg");n.collapse=function(r){n.collapse.delay=e.later(r,n,function(){t.collapsecomments&&i.addClass("commentcollapsed")})},n.expand=function(){n.getData("dragging")!==!0&&(n.collapse.delay&&n.collapse.delay.cancel(),i.removeClass("commentcollapsed"))},i.on("mouseenter",function(){(t.currentedit.tool==="comment"||t.currentedit.tool==="select"||this.editor.get("readonly"))&&n.expand()},this),i.on("click|tap",function(){n.expand(),n.focus()},this),n.on("keyup",function(e){e.keyCode===9&&e.shiftKey&&r.getAttribute("tabindex")==="0"&&r.focus(),r.setAttribute("tabindex","0")},this),r.on("keydown",function(e){e.keyCode===9&&e.shiftKey&&r.setAttribute("tabindex","-1")},this),s.on("focus",function(){n.active=!0,n.collapse.delay&&n.collapse.delay.cancel(),n.setAttribute("tabindex","0"),n.expand(),n.focus(),s.setAttribute("tabindex","-1")},this),r.on("focus",function(){n.active=!0,n.collapse.delay&&n.collapse.delay.cancel(),this.deleteme=!1,s.setAttribute("tabindex","0")},this),n.on("blur",function(){n.setAttribute("tabindex","-1")},this),s.on("blur",function(){s.setAttribute("tabindex","0")},this),i.on("mouseleave",function(){t.collapsecomments&&n.active!==!0&&n.collapse(400)},this),i.on("blur",function(){n.active=!1,n.collapse(800)},this),this.editor.get("readonly")||(n.on("blur",function(){this.rawtext=n.get("value"),this.width=parseInt(n.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.editor.editingcomment=!1},this),r.setData("comment",this),n.on("keyup",function(){n.setStyle("height","auto");var e=n.get("scrollHeight"),t=parseInt(n.getStyle("height"),10);e===t+8&&(e-=8),n.setStyle("height",e+"px")}),n.on("gesturemovestart",function(e){t.currentedit.tool==="select"&&(e.preventDefault(),t.collapsecomments?(n.setData("offsetx",8),n.setData("offsety",8)):(n.setData("offsetx",e.clientX-i.getX()),n.setData("offsety",e.clientY-i.getY())))}),n.on("gesturemove",function(e){if(t.currentedit.tool==="select"){var r=e.clientX-n.getData("offsetx"),s=e.clientY-n.getData("offsety"),o,u,a;n.getData("dragging")!==!0&&(n.collapse(0),n.setData("dragging",!0)),o=this.editor.get_canvas_coordinates(new M.assignfeedback_editpdf.point(r,s)),a=this.editor.get_canvas_bounds(!0),a.x=0,a.y=0,a.width-=24,a.height-=24,o.clip(a),this.x=o.x,this.y=o.y,u=this.editor.get_window_coordinates(o),i.setX(u.x),i.setY(u.y),this.drawable.store_position(i,u.x,u.y)}},null,this),n.on("gesturemoveend",function(){t.currentedit.tool==="select"&&(n.getData("dragging")===!0&&n.setData("dragging",!1),this.editor.save_current_page())},null,this),o.on("gesturemovestart",function(e){t.currentedit.tool==="select"&&(e.preventDefault(),n.setData("offsetx",e.clientX-i.getX()),n.setData("offsety",e.clientY-i.getY()),n.expand())}),o.on("gesturemove",function(e){if(t.currentedit.tool==="select"){var r=e.clientX-n.getData("offsetx"),s=e.clientY-n.getData("offsety"),o,u,a;n.getData("dragging")!==!0&&(n.collapse(100),n.setData("dragging",!0)),o=this.editor.get_canvas_coordinates(new M.assignfeedback_editpdf.point(r,s)),a=this.editor.get_canvas_bounds(!0),a.x=0,a.y=0,a.width-=24,a.height-=24,o.clip(a),this.x=o.x,this.y=o.y,u=this.editor.get_window_coordinates(o),i.setX(u.x),i.setY(u.y),this.drawable.store_position(i,u.x,u.y)}},null,this),o.on("gesturemoveend",function(){t.currentedit.tool==="select"&&(n.getData("dragging")===!0&&n.setData("dragging",!1),this.editor.save_current_page())},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),this.comments.sort(function(e,t){return e.rawtext.localeCompare(t.rawtext)})}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=F;var I=function(){I.superclass.constructor.apply(this,arguments)};I.prototype={oldannotationcoordinates:null,dialogue:null,panel:null,pagecount:0,currentpage:0,pages:[],documentstatus:0,loadingicon:null,pageimage:null,graphic:null,currentedit:new M.assignfeedback_editpdf.edit,currentdrawable:!1,drawables:[],currentcomment:null,currentannotation:null,lastannotation:null,lastannotationtool:"pen",quicklist:null,searchcommentswindow:null,currentstamp:null,stamps:[],editingcomment:!1,collapsecomments:!0,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),require(["mod_assign/grading_review_panel"],function(n){var r=new n,i=r.getReviewPanel("assignfeedback_editpdf");i&&(i=e.one(i),i.empty(),t.ancestor(".fitem").hide(),this.open_in_panel(i)),this.currentedit.start=!1,this.currentedit.end=!1,this.get("readonly")||(this.quicklist=new M.assignfeedback_editpdf.quickcommentlist(this))}.bind(this)))},refresh_button_state:function(){var e,t,n,r,i,o;e=this.get_dialogue_element(s.COMMENTCOLOURBUTTON),n=M.util.image_url("background_colour_"+this.currentedit.commentcolour,"assignfeedback_editpdf"),e.one("img").setAttribute("src",n),this.currentedit.commentcolour==="clear"?e.one("img").setStyle("borderStyle","dashed"):e.one("img").setStyle("borderStyle","solid"),e=this.get_dialogue_element(s.ANNOTATIONCOLOURBUTTON),n=M.util.image_url("colour_"+this.currentedit.annotationcolour,"assignfeedback_editpdf"),e.one("img").setAttribute("src",n),t=this.get_dialogue_element(h[this.currentedit.tool]),t.addClass("assignfeedback_editpdf_selectedbutton"),t.setAttribute("aria-pressed","true"),r=this.get_dialogue_element(s.DRAWINGREGION),r.setAttribute("data-currenttool",this.currentedit.tool),e=this.get_dialogue_element(s.STAMPSBUTTON),i=this.get_stamp_image_url(this.currentedit.stamp),e.one("img").setAttrs({src:i,height:"16",width:"16"}),o=this.get_dialogue_element(s.DRAWINGCANVAS);switch(this.currentedit.tool){case"drag":o.setStyle("cursor","move");break;case"highlight":o.setStyle("cursor","text");break;case"select":o.setStyle("cursor","default");break;case"stamp":o.setStyle("cursor","url("+i+"), crosshair");break;default:o.setStyle("cursor","crosshair")}},get_canvas_bounds:function(){var e=this.get_dialogue_element(s.DRAWINGCANVAS),t=e.getXY(),n=t[0],r=t[1],i=parseInt(e.getStyle("width"),10),o=parseInt(e.getStyle("height"),10);return new M.assignfeedback_editpdf.rect(n,r,i,o)},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},open_in_panel:function(t){var n,r;this.panel=t,t.append(this.get("body")),t.addClass(i.DIALOGUE),this.loadingicon=this.get_dialogue_element(s.LOADINGICON),n=this.get_dialogue_element(s.DRAWINGCANVAS),this.graphic=new e.Graphic({render:n}),r=this.get_dialogue_element(s.DRAWINGREGION),r.on("scroll",this.move_canvas,this),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.start_generation()},link_handler:function(t){var n,r,o=!0;t.preventDefault(),this.dialogue||(this.dialogue=new M.core.dialogue({headerContent:this.get("header"),bodyContent:this.get("body"),footerContent:this.get("footer"),modal:!0,width:"840px",visible:!1,draggable:!0}),this.dialogue.get("boundingBox").addClass(i.DIALOGUE),this.loadingicon=this.get_dialogue_element(s.LOADINGICON),n=this.get_dialogue_element(s.DRAWINGCANVAS),this.graphic=new e
-.Graphic({render:n}),r=this.get_dialogue_element(s.DRAWINGREGION),r.on("scroll",this.move_canvas,this),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.start_generation(),n.on("windowresize",this.resize,this),o=!1),this.dialogue.centerDialogue(),this.dialogue.show(),this.dialogue.dd.on("drag:end",this.redraw,this),o&&this.resize()},start_generation:function(){this.poll_document_conversion_status()},poll_document_conversion_status:function(){var t=this.get("userid");e.io(n,{method:"get",context:this,sync:!1,data:{sesskey:M.cfg.sesskey,action:"pollconversions",userid:this.get("userid"),attemptnumber:this.get("attemptnumber"),assignmentid:this.get("assignmentid"),readonly:this.get("readonly")?1:0},on:{success:function(n,r){var i=e.one(s.USERINFOREGION);if(i){var o=i.getAttribute("data-userid");if(o&&o!=t)return}var u=this.handle_response_data(r),a=!1;if(u){this.documentstatus=u.status;if(u.status===0)a=!0;else if(u.status===1||u.status===3)a=!0;else if(u.status===2||u.status===-1)this.pagecount=u.pagecount,u.pageready==u.pagecount?this.prepare_pages_for_display(u):(this.update_page_load_progress(),this.start_document_to_image_conversion());a&&e.later(1e3,this,this.poll_document_conversion_status)}},failure:function(e,t){return new M.core.exception(t.responseText)}}})},start_document_to_image_conversion:function(){e.io(n,{method:"get",context:this,sync:!1,data:{sesskey:M.cfg.sesskey,action:"pollconversions",userid:this.get("userid"),attemptnumber:this.get("attemptnumber"),assignmentid:this.get("assignmentid"),readonly:this.get("readonly")?1:0},on:{success:function(e,t){var n=this.handle_response_data(t);n&&(this.documentstatus=n.status,n.status===2&&this.prepare_pages_for_display(n))},failure:function(e,t){return new M.core.exception(t.responseText)}}})},warning:function(t,n){var r=this.get_dialogue_element(s.ICONMESSAGECONTAINER),i=this.get_dialogue_element(s.WARNINGMESSAGECONTAINER),o=15,u=1,a="assignfeedback_editpdf_warningmessages alert alert-warning";n&&(o=4,a="assignfeedback_editpdf_warningmessages alert alert-info");var f=e.Node.create('');f.append(r.one("*").cloneNode()),f.append(t),i.prepend(f),f.transition({duration:u,delay:o,opacity:0},function(){f.remove()})},prepare_pages_for_display:function(e){var t,n,r,i,s,o;if(!e.pagecount){this.dialogue&&this.dialogue.hide(),i=new M.core.alert({message:M.util.get_string("cannotopenpdf","assignfeedback_editpdf")}),i.show();return}this.pages=e.pages;for(t=0;t0&&(r=e)},this),r},setup_toolbar:function(){var t,n,r,i,o,u,a,c,p,d,v;i=this.get_dialogue_element(s.SEARCHCOMMENTSBUTTON),i.on("click",this.open_search_comments,this),i.on("key",this.open_search_comments,"down:13",this),o=this.get_dialogue_element(s.EXPCOLCOMMENTSBUTTON),o.on("click",this.expandCollapseComments,this),o.on("key",this.expandCollapseComments,"down:13",this);if(this.get("readonly"))return;u=this.get_dialogue_element(s.ROTATELEFTBUTTON),u.on("click",this.rotatePDF,this,!0),u.on("key",this.rotatePDF,"down:13",this,!0),a=this.get_dialogue_element(s.ROTATERIGHTBUTTON),a.on("click",this.rotatePDF,this,!1),a.on("key",this.rotatePDF,"down:13",this,!1),this.disable_touch_scroll(),e.each(h,function(e,n){t=this.get_dialogue_element(e),t.on("click",this.handle_tool_button,this,n),t.on("key",this.handle_tool_button,"down:13",this,n),t.setAttribute("aria-pressed","false")},this),n=this.get_dialogue_element(s.COMMENTCOLOURBUTTON),d=new M.assignfeedback_editpdf.colourpicker({buttonNode:n,colours:f,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=this
-.get_dialogue_element(s.ANNOTATIONCOLOURBUTTON),d=new M.assignfeedback_editpdf.colourpicker({buttonNode:r,iconprefix:"colour_",colours:l,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}),p=this.get("stampfiles"),p.length<=0?this.get_dialogue_element(h.stamp).ancestor().hide():(v=p[0].substr(p[0].lastIndexOf("/")+1),this.currentedit.stamp=v,c=this.get_dialogue_element(s.STAMPSBUTTON),d=new M.assignfeedback_editpdf.stamppicker({buttonNode:c,stamps:p,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.handle_tool_button(e,"stamp")},context:this}),this.refresh_button_state())},handle_tool_button:function(e,t){var n;e.preventDefault(),n=this.get_dialogue_element(h[this.currentedit.tool]),n.removeClass("assignfeedback_editpdf_selectedbutton"),n.setAttribute("aria-pressed","false"),this.currentedit.tool=t,t!=="comment"&&t!=="select"&&t!=="drag"&&t!=="stamp"&&(this.lastannotationtool=t),this.refresh_button_state()},stringify_current_page:function(){var t=[],n=[],r,i=0;for(i=0;it.width||o.y<0||o.y>t.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.tool==="drag"?(u=o.x-this.currentedit.start.x,a=o.y-this.currentedit.start.y,r.getDOMNode().scrollLeft-=u,r.getDOMNode().scrollTop-=a):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?n.removeAttribute("disabled"):n.setAttribute("disabled","true"),this.currentpage"),i.setAttribute("value",n),r={page:n+1,total:this.pages.length},i.setHTML(M.util.get_string("pagexofy","assignfeedback_editpdf",r)),t.append(i);t.removeAttribute("disabled"),t.on("change",function(){this.currentpage=t.get("value"),this.clear_warnings(!1),this.change_page()},this),o=this.get_dialogue_element(s.PREVIOUSBUTTON),u=this.get_dialogue_element(s.NEXTBUTTON),o.on("click",this.previous_page,this),o.on("key",this.previous_page,"down:13",this),u.on("click",this.next_page,this),u.on("key",this.next_page,"down:13",this)},previous_page:function(e){e.preventDefault(),this.currentpage--,this.currentpage<0&&(this.currentpage=0),this.clear_warnings(!1),this.change_page()},next_page:function(e){e.preventDefault(),this.currentpage++,this.currentpage>=this.pages.length&&(this.currentpage=this.pages.length-1),this.clear_warnings(!1),this.change_page()},move_canvas:function(){var e,t,n,r;e=this.get_dialogue_element(s.DRAWINGREGION),t=parseInt(e.get("scrollLeft"),10),n=parseInt(e.get("scrollTop"),10);for(r=0;r"),r.setStyles({position:"absolute",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),t.store_position(r,i.x,i.y),this.editor.get("readonly")||(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,T.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=this.editor.get_dialogue_element(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({position:"absolute",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.store_position(o,u.x,u.y),r.nodes.push(o),r},init_from_edit:function(e){var t=new M.assignfeedback_editpdf.rect;return 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,!0},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=T;var N="Dropdown menu",C;C=function(e){e.draggable=!1,e.centered=!1,e.width="auto",e.visible=!1,e.footerContent="",C.superclass.constructor.apply(this,[e])},e.extend(C,M.core.dialogue,{initializer:function(t){var n,r,i,s;C.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.get("id")!==n.get("id")&&e.target.ancestor().get("id")!==n.get("id")&&(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"),n=C.superclass.show.call(this);return this.align(t,[e.WidgetPositionAlign.TL,e.WidgetPositionAlign.BL]),n}},{NAME:N,ATTRS:{headerText:{value:""},buttonNode:{value:null}}}),e.Base.modifyAttrs(C,{modal:{getter:function(){return!1}}}),M.assignfeedback_editpdf=M.assignfeedback_editpdf||{},M.assignfeedback_editpdf.dropdown=C;var k="Colourpicker",L;L=function(e){L.superclass.constructor.apply(this,[e])},e.extend(L,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),L.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:k,ATTRS:{colours:{value:{}},callback:{value:null},context:{value:null},iconprefix:{value:"colour_"}}}),M.assignfeedback_editpdf=M.assignfeedback_editpdf||{},M.assignfeedback_editpdf.colourpicker=L;var A="Colourpicker",O;O=function(e){O.superclass.constructor.apply(this,[e])},e.extend(O,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),O.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:A,ATTRS:{stamps:{value:[]},callback:{value:null},context:{value:null}}}),M.assignfeedback_editpdf=M.assignfeedback_editpdf||{},M.assignfeedback_editpdf.stamppicker=O;var _="Commentmenu",D;D=function(e){D.superclass.constructor.apply(this,[e])},e.extend(D,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),D.superclass.initializer.call(this,t)},show:function(){var t=this.get("boundingBox").one("ul");t.all(".quicklist_comment").remove(!0);var n=this.get("comment");n.deleteme=!1,e.each(n.editor.quicklist.comments,function(r){var i=e.Node.create(''),s=e.Node.create(''+r.rawtext+""),o=e.Node.create('");s.setAttribute("title",r.rawtext),i.append(s),i.append(o),t.append(i),i.on("click",n.set_from_quick_comment,n,r),i.on("key",n.set_from_quick_comment,"space,enter",n,r),o.on("click",n.remove_from_quicklist,n,r),o.on("key",n.remove_from_quicklist,"space,enter",n,r)},this),D.superclass.show.call(this)}},{NAME:_,ATTRS:{comment:{value:null}}}),M.assignfeedback_editpdf=M.assignfeedback_editpdf||{},M.assignfeedback_editpdf.commentmenu=D;var P="commentsearch",H;H=function(e){e.draggable=!1,e.centered=!0,e.width="400px",e.visible=!1,e.headerContent=M.util.get_string("searchcomments","assignfeedback_editpdf"),e.footerContent="",H.superclass.constructor.apply(this,[e])},e.extend(H,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,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),H.superclass.initializer.call(this,t)},filter_search_comments:function(){var t,n,r,i;i=this.get("id"),t=e.one("#"+i+s.SEARCHFILTER),n=e.one("#"+i+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=n.clean().pageno,n.pageno!==r.currentpage&&(r.currentpage=n.pageno,r.change_page()),n.node=n.drawable.nodes[0].one("textarea"),n.node.ancestor("div").removeClass("commentcollapsed"),n.node.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(),H.superclass.show.call(this)}},{NAME:P,ATTRS:{editor:{value:null}}}),e.Base.modifyAttrs(H,{modal:{getter:function(){return!0}}}),M.assignfeedback_editpdf=M.assignfeedback_editpdf||{},M.assignfeedback_editpdf.commentsearch=H;var B=function(t,n,r,i,o,u,l,c){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=c||"",this.pageno=r||0,this.colour=l||"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:parseInt(this.pageno,10),colour:this.colour}},this.draw=function(n){var r=new M.assignfeedback_editpdf.drawable(this.editor),i,o=this.editor.get_dialogue_element(s.DRAWINGCANVAS),u,l,c,h,p,d;return i=e.Node.create(""),u=e.Node.create(''),l=e.Node.create(""),c=e.Node.create(''),h=e.Node.create('
'),this.menulink=h,u.append(l),l.append(i),u.append(c),u.setAttribute("tabindex","-1"),l.setAttribute("tabindex","0"),i.setAttribute("tabindex","-1"),h.setAttribute("tabindex","0"),this.editor.get("readonly")?i.setAttribute("readonly","readonly"
+):u.append(h),this.width<100&&(this.width=100),p=this.editor.get_window_coordinates(new M.assignfeedback_editpdf.point(this.x,this.y)),i.setStyles({width:this.width+"px",backgroundColor:f[this.colour],color:a}),o.append(u),u.setStyle("position","absolute"),u.setX(p.x),u.setY(p.y),r.store_position(u,p.x,p.y),r.nodes.push(u),i.set("value",this.rawtext),d=i.get("scrollHeight"),i.setStyles({height:d+"px",overflow:"hidden"}),c.setStyle("color",f[this.colour]),this.attach_events(i,h),n?i.focus():t.collapsecomments&&u.addClass("commentcollapsed"),this.drawable=r,r},this.delete_comment_later=function(){this.deleteme&&this.remove()},this.attach_events=function(n,r){var i=n.ancestor("div"),s=n.ancestor("label"),o=s.next("svg");n.collapse=function(r){n.collapse.delay=e.later(r,n,function(){t.collapsecomments&&i.addClass("commentcollapsed")})},n.expand=function(){n.getData("dragging")!==!0&&(n.collapse.delay&&n.collapse.delay.cancel(),i.removeClass("commentcollapsed"))},i.on("mouseenter",function(){(t.currentedit.tool==="comment"||t.currentedit.tool==="select"||this.editor.get("readonly"))&&n.expand()},this),i.on("click|tap",function(){n.expand(),n.focus()},this),n.on("keyup",function(e){e.keyCode===9&&e.shiftKey&&r.getAttribute("tabindex")==="0"&&r.focus(),r.setAttribute("tabindex","0")},this),r.on("keydown",function(e){e.keyCode===9&&e.shiftKey&&r.setAttribute("tabindex","-1")},this),s.on("focus",function(){n.active=!0,n.collapse.delay&&n.collapse.delay.cancel(),n.setAttribute("tabindex","0"),n.expand(),n.focus(),s.setAttribute("tabindex","-1")},this),r.on("focus",function(){n.active=!0,n.collapse.delay&&n.collapse.delay.cancel(),this.deleteme=!1,s.setAttribute("tabindex","0")},this),n.on("blur",function(){n.setAttribute("tabindex","-1")},this),s.on("blur",function(){s.setAttribute("tabindex","0")},this),i.on("mouseleave",function(){t.collapsecomments&&n.active!==!0&&n.collapse(400)},this),i.on("blur",function(){n.active=!1,n.collapse(800)},this),this.editor.get("readonly")||(n.on("blur",function(){this.rawtext=n.get("value"),this.width=parseInt(n.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.editor.editingcomment=!1},this),r.setData("comment",this),n.on("keyup",function(){n.setStyle("height","auto");var e=n.get("scrollHeight"),t=parseInt(n.getStyle("height"),10);e===t+8&&(e-=8),n.setStyle("height",e+"px")}),n.on("gesturemovestart",function(e){t.currentedit.tool==="select"&&(e.preventDefault(),t.collapsecomments?(n.setData("offsetx",8),n.setData("offsety",8)):(n.setData("offsetx",e.clientX-i.getX()),n.setData("offsety",e.clientY-i.getY())))}),n.on("gesturemove",function(e){if(t.currentedit.tool==="select"){var r=e.clientX-n.getData("offsetx"),s=e.clientY-n.getData("offsety"),o,u,a;n.getData("dragging")!==!0&&(n.collapse(0),n.setData("dragging",!0)),o=this.editor.get_canvas_coordinates(new M.assignfeedback_editpdf.point(r,s)),a=this.editor.get_canvas_bounds(!0),a.x=0,a.y=0,a.width-=24,a.height-=24,o.clip(a),this.x=o.x,this.y=o.y,u=this.editor.get_window_coordinates(o),i.setX(u.x),i.setY(u.y),this.drawable.store_position(i,u.x,u.y)}},null,this),n.on("gesturemoveend",function(){t.currentedit.tool==="select"&&(n.getData("dragging")===!0&&n.setData("dragging",!1),this.editor.save_current_page())},null,this),o.on("gesturemovestart",function(e){t.currentedit.tool==="select"&&(e.preventDefault(),n.setData("offsetx",e.clientX-i.getX()),n.setData("offsety",e.clientY-i.getY()),n.expand())}),o.on("gesturemove",function(e){if(t.currentedit.tool==="select"){var r=e.clientX-n.getData("offsetx"),s=e.clientY-n.getData("offsety"),o,u,a;n.getData("dragging")!==!0&&(n.collapse(100),n.setData("dragging",!0)),o=this.editor.get_canvas_coordinates(new M.assignfeedback_editpdf.point(r,s)),a=this.editor.get_canvas_bounds(!0),a.x=0,a.y=0,a.width-=24,a.height-=24,o.clip(a),this.x=o.x,this.y=o.y,u=this.editor.get_window_coordinates(o),i.setX(u.x),i.setY(u.y),this.drawable.store_position(i,u.x,u.y)}},null,this),o.on("gesturemoveend",function(){t.currentedit.tool==="select"&&(n.getData("dragging")===!0&&n.setData("dragging",!1),this.editor.save_current_page())},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),this.comments.sort(function(e,t){return e.rawtext.localeCompare(t.rawtext)})}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=F;var I=function(){I.superclass.constructor.apply(this,arguments)};I.prototype={oldannotationcoordinates:null,dialogue:null,panel:null,pagecount:0,currentpage:0,pages:[],documentstatus:0,loadingicon:null,pageimage:null,graphic:null,currentedit:new M.assignfeedback_editpdf.edit,currentdrawable:!1,drawables:[],currentcomment:null,currentannotation:null,lastannotation:null,lastannotationtool:"pen",quicklist:null,searchcommentswindow:null,currentstamp:null,stamps:[],editingcomment:!1,collapsecomments:!0,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),require(["mod_assign/grading_review_panel"],function(n){var r=new n,i=r.getReviewPanel("assignfeedback_editpdf");i&&(i=e.one(i),i.empty(),t.ancestor(".fitem").hide(),this.open_in_panel(i)),this.currentedit.start=!1,this.currentedit.end=!1,this.get("readonly")||(this.quicklist=new M.assignfeedback_editpdf.quickcommentlist(this))}.bind(this)))},refresh_button_state:function(){var e,t,n,r,i,o;e=this.get_dialogue_element(s.COMMENTCOLOURBUTTON),n=M.util.image_url("background_colour_"+this.currentedit.commentcolour,"assignfeedback_editpdf"),e.one("img").setAttribute("src",n),this.currentedit.commentcolour==="clear"?e.one("img").setStyle("borderStyle","dashed"):e.one("img").setStyle("borderStyle","solid"),e=this.get_dialogue_element(s.ANNOTATIONCOLOURBUTTON),n=M.util.image_url("colour_"+this.currentedit.annotationcolour,"assignfeedback_editpdf"),e.one("img").setAttribute("src",n),t=this.get_dialogue_element(h[this.currentedit.tool]),t.addClass("assignfeedback_editpdf_selectedbutton"),t.setAttribute("aria-pressed","true"),r=this.get_dialogue_element(s.DRAWINGREGION),r.setAttribute("data-currenttool",this.currentedit.tool),e=this.get_dialogue_element(s.STAMPSBUTTON),i=this.get_stamp_image_url(this.currentedit.stamp),e.one("img").setAttrs({src:i,height:"16",width:"16"}),o=this.get_dialogue_element(s.DRAWINGCANVAS);switch(this.currentedit.tool){case"drag":o.setStyle("cursor","move");break;case"highlight":o.setStyle("cursor","text");break;case"select":o.setStyle("cursor","default");break;case"stamp":o.setStyle("cursor","url("+i+"), crosshair");break;default:o.setStyle("cursor","crosshair")}},get_canvas_bounds:function(){var e=this.get_dialogue_element(s.DRAWINGCANVAS),t=e.getXY(),n=t[0],r=t[1],i=parseInt(e.getStyle("width"),10),o=parseInt(e.getStyle("height"),10);return new M.assignfeedback_editpdf.rect(n,r,i,o)},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},open_in_panel:function(t){var n;this.panel=t,t.append(this.get("body")),t.addClass(i.DIALOGUE),this.loadingicon=this.get_dialogue_element(s.LOADINGICON),n=this.get_dialogue_element(s.DRAWINGCANVAS),this.graphic=new e.Graphic({render:n}),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.start_generation()},link_handler:function(t){var n,r=!0;t.preventDefault(),this.dialogue||(this.dialogue=new M.core.dialogue({headerContent:this.get("header"),bodyContent:this.get("body"),footerContent:this.get("footer"),modal:!0,width:"840px",visible:!1,draggable:!0}),this.dialogue.get("boundingBox").addClass(i.DIALOGUE),this.loadingicon=this.get_dialogue_element(s.LOADINGICON),n=this.get_dialogue_element(s.DRAWINGCANVAS),this.graphic=new e.Graphic({render:n}),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.start_generation(),n.on("windowresize",this.resize,this),r=!1),this.dialogue.centerDialogue(),this.dialogue.show(),this.dialogue.dd.on("drag:end",this.redraw,this),r&&this.resize()},start_generation:function(){this.poll_document_conversion_status()},poll_document_conversion_status:function(){var t=this.get("userid");e.io(n,{method:"get",context:this,sync:!1,data:{sesskey:M.cfg.sesskey,action:"pollconversions",userid:this.get("userid"),attemptnumber:this.get("attemptnumber"),assignmentid:this.get("assignmentid"),readonly:this.get("readonly")?1:0},on:{success:function(n,r){var i=e.one(s.USERINFOREGION);if(i){var o=i.getAttribute("data-userid");if(o&&o!=t)return}var u=this.handle_response_data(r),a=!1;if(u){this.documentstatus=u.status;if(u.status===0)a=!0;else if(u.status===1||u.status===3)a=!0;else if(u.status===2||u.status===-1)this.pagecount=u.pagecount,u.pageready==u.pagecount?this.prepare_pages_for_display(u):(this.update_page_load_progress(),this.start_document_to_image_conversion());a&&e.later(1e3,this,this.poll_document_conversion_status)}},failure:function(e,t){return new M.core.exception(t.responseText)}}})},start_document_to_image_conversion:function(){e.io(n,{method:"get",context:this,sync:!1,data:{sesskey:M.cfg.sesskey,action:"pollconversions",userid:this.get("userid"),attemptnumber:this.get("attemptnumber"),assignmentid:this.get("assignmentid"),readonly:this.get("readonly")?1:0},on:{success:function(e,t){var n=this.handle_response_data(t);n&&(this.documentstatus=n.status,n.status===2&&this.prepare_pages_for_display(n))},failure:function(e,t){return new M.core.exception(t.responseText)}}})},warning:function(t,n){var r=this.get_dialogue_element(s.ICONMESSAGECONTAINER),i=this.get_dialogue_element(s.WARNINGMESSAGECONTAINER),o=15,u=1,a="assignfeedback_editpdf_warningmessages alert alert-warning";n&&(o=4,a="assignfeedback_editpdf_warningmessages alert alert-info");var f=e.Node.create('');f.append(r.one("*").cloneNode()),f.append(t),i.prepend(f),f.transition({duration:u,delay:o,opacity:0},function(){f.remove()})},prepare_pages_for_display:function(e){var t,n,r,i,s,o;if(!e.pagecount){this.dialogue&&this.dialogue.hide(),i=new M.core.alert({message:M.util.get_string("cannotopenpdf","assignfeedback_editpdf")}),i.show();return}this.pages=e.pages;for(t=0;t0&&(r=e)},this),r},setup_toolbar:function(){var t,n,r,i,o,u,a,c,p,d,v;i=this.get_dialogue_element(s.SEARCHCOMMENTSBUTTON),i.on("click",this.open_search_comments,this),i.on("key",this.open_search_comments,"down:13",this),o=this.get_dialogue_element(s.EXPCOLCOMMENTSBUTTON),o.on("click",this.expandCollapseComments,this),o.on("key",this.expandCollapseComments,"down:13",this);if(this.get("readonly"))return;u=this.get_dialogue_element(s.ROTATELEFTBUTTON),u.on("click",this.rotatePDF,this,!0),u.on("key",this.rotatePDF,"down:13",this,!0),a=this.get_dialogue_element(s.ROTATERIGHTBUTTON),a.on("click",this.rotatePDF,this,!1),a.on("key",this.rotatePDF,"down:13",this,!1),this.disable_touch_scroll(),e.each(h,function(e,n){t=this.get_dialogue_element(e),t.on("click",this.handle_tool_button,this,n),t.on("key",this.handle_tool_button,"down:13",this,n),t.setAttribute("aria-pressed","false")},this),n=this.get_dialogue_element(s.COMMENTCOLOURBUTTON),d=new M.assignfeedback_editpdf.colourpicker({buttonNode:n,colours:f,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=this.get_dialogue_element(s.ANNOTATIONCOLOURBUTTON),d=new M.assignfeedback_editpdf.colourpicker({buttonNode:r,iconprefix:"colour_",colours:l,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}),p=this.get("stampfiles"),p.length<=0?this.get_dialogue_element(h.stamp).ancestor().hide():(v=p[0].substr(p[0].lastIndexOf("/")+1),this.currentedit.stamp=v,c=this.get_dialogue_element(s.STAMPSBUTTON),d=new M.assignfeedback_editpdf.stamppicker({buttonNode:c,stamps:p,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.handle_tool_button(e,"stamp")},context:this}),this.refresh_button_state())},handle_tool_button:function(e,t){var n;e.preventDefault(),n=this.get_dialogue_element(h[this.currentedit.tool]),n.removeClass("assignfeedback_editpdf_selectedbutton"),n.setAttribute("aria-pressed","false"),this.currentedit.tool=t,t!=="comment"&&t!=="select"&&t!=="drag"&&t!=="stamp"&&(this.lastannotationtool=t),this.refresh_button_state()},stringify_current_page:function(){var t=[],n=[],r,i=0;for(i=0;it.width||o.y<0||o.y>t.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.tool==="drag"?(u=o.x-this.currentedit.start.x,a=o.y-this.currentedit.start.y,r.getDOMNode().scrollLeft-=u,r.getDOMNode().scrollTop-=a):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?n.removeAttribute("disabled"):n.setAttribute("disabled","true"),this.currentpage"),i.setAttribute("value",n),r={page:n+1,total:this.pages.length},i.setHTML(M.util.get_string("pagexofy","assignfeedback_editpdf",r)),t.append(i);t.removeAttribute("disabled"),t.on("change",function(){this.currentpage=t.get("value"),this.clear_warnings(!1),this.change_page()},this),o=this.get_dialogue_element(s.PREVIOUSBUTTON),u=this.get_dialogue_element(s.NEXTBUTTON),o.on("click",this.previous_page,this),o.on("key",this.previous_page,"down:13",this),u.on("click",this.next_page,this),u.on("key",this.next_page,"down:13",this)},previous_page:function(e){e.preventDefault(),this.currentpage--,this.currentpage<0&&(this.currentpage=0),this.clear_warnings(!1),this.change_page()},next_page:function(e){e.preventDefault(),this.currentpage++,this.currentpage>=this.pages.length&&(this.currentpage=this.pages.length-1),this.clear_warnings(!1),this.change_page()},move_canvas:function(){var e,t,n,r;e=this.get_dialogue_element(s.DRAWINGREGION),t=parseInt(e.get("scrollLeft"),10),n=parseInt(e.get("scrollTop"),10);for(r=0;r');
- // If these are absolutely positioned, they escape their scroll container.
node.setStyles({
- 'position': 'relative',
+ 'position': 'absolute',
'display': 'inline-block',
'backgroundImage': 'url(' + this.editor.get_stamp_image_url(this.path) + ')',
'width': (this.endx - this.x),
@@ -1587,7 +1586,7 @@ Y.extend(ANNOTATIONSTAMP, M.assignfeedback_editpdf.annotation, {
'zIndex': 50
});
- drawingregion.append(node);
+ drawingcanvas.append(node);
node.setX(position.x);
node.setY(position.y);
drawable.store_position(node, position.x, position.y);
@@ -2544,7 +2543,7 @@ var COMMENT = function(editor, gradeid, pageno, x, y, width, colour, rawtext) {
this.draw = function(focus) {
var drawable = new M.assignfeedback_editpdf.drawable(this.editor),
node,
- drawingregion = this.editor.get_dialogue_element(SELECTOR.DRAWINGREGION),
+ drawingcanvas = this.editor.get_dialogue_element(SELECTOR.DRAWINGCANVAS),
container,
label,
marker,
@@ -2587,8 +2586,8 @@ var COMMENT = function(editor, gradeid, pageno, x, y, width, colour, rawtext) {
color: COMMENTTEXTCOLOUR
});
- drawingregion.append(container);
- container.setStyle('position', 'relative');
+ drawingcanvas.append(container);
+ container.setStyle('position', 'absolute');
container.setX(position.x);
container.setY(position.y);
drawable.store_position(container, position.x, position.y);
@@ -3664,7 +3663,7 @@ EDITOR.prototype = {
* @method open_in_panel
*/
open_in_panel: function(panel) {
- var drawingcanvas, drawingregion;
+ var drawingcanvas;
this.panel = panel;
panel.append(this.get('body'));
@@ -3675,9 +3674,6 @@ EDITOR.prototype = {
drawingcanvas = this.get_dialogue_element(SELECTOR.DRAWINGCANVAS);
this.graphic = new Y.Graphic({render: drawingcanvas});
- drawingregion = this.get_dialogue_element(SELECTOR.DRAWINGREGION);
- drawingregion.on('scroll', this.move_canvas, this);
-
if (!this.get('readonly')) {
drawingcanvas.on('gesturemovestart', this.edit_start, null, this);
drawingcanvas.on('gesturemove', this.edit_move, null, this);
@@ -3694,7 +3690,7 @@ EDITOR.prototype = {
* @method link_handler
*/
link_handler: function(e) {
- var drawingcanvas, drawingregion;
+ var drawingcanvas;
var resize = true;
e.preventDefault();
@@ -3717,9 +3713,6 @@ EDITOR.prototype = {
drawingcanvas = this.get_dialogue_element(SELECTOR.DRAWINGCANVAS);
this.graphic = new Y.Graphic({render: drawingcanvas});
- drawingregion = this.get_dialogue_element(SELECTOR.DRAWINGREGION);
- drawingregion.on('scroll', this.move_canvas, this);
-
if (!this.get('readonly')) {
drawingcanvas.on('gesturemovestart', this.edit_start, null, this);
drawingcanvas.on('gesturemove', this.edit_move, null, this);
diff --git a/mod/assign/feedback/editpdf/yui/src/editor/js/annotationstamp.js b/mod/assign/feedback/editpdf/yui/src/editor/js/annotationstamp.js
index 27a1cbd28ff..11356106944 100644
--- a/mod/assign/feedback/editpdf/yui/src/editor/js/annotationstamp.js
+++ b/mod/assign/feedback/editpdf/yui/src/editor/js/annotationstamp.js
@@ -43,15 +43,14 @@ Y.extend(ANNOTATIONSTAMP, M.assignfeedback_editpdf.annotation, {
*/
draw: function() {
var drawable = new M.assignfeedback_editpdf.drawable(this.editor),
- drawingregion = this.editor.get_dialogue_element(SELECTOR.DRAWINGREGION),
+ drawingcanvas = this.editor.get_dialogue_element(SELECTOR.DRAWINGCANVAS),
node,
position;
position = this.editor.get_window_coordinates(new M.assignfeedback_editpdf.point(this.x, this.y));
node = Y.Node.create('');
- // If these are absolutely positioned, they escape their scroll container.
node.setStyles({
- 'position': 'relative',
+ 'position': 'absolute',
'display': 'inline-block',
'backgroundImage': 'url(' + this.editor.get_stamp_image_url(this.path) + ')',
'width': (this.endx - this.x),
@@ -60,7 +59,7 @@ Y.extend(ANNOTATIONSTAMP, M.assignfeedback_editpdf.annotation, {
'zIndex': 50
});
- drawingregion.append(node);
+ drawingcanvas.append(node);
node.setX(position.x);
node.setY(position.y);
drawable.store_position(node, position.x, position.y);
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 75c2dcba401..146f728d092 100644
--- a/mod/assign/feedback/editpdf/yui/src/editor/js/comment.js
+++ b/mod/assign/feedback/editpdf/yui/src/editor/js/comment.js
@@ -160,7 +160,7 @@ var COMMENT = function(editor, gradeid, pageno, x, y, width, colour, rawtext) {
this.draw = function(focus) {
var drawable = new M.assignfeedback_editpdf.drawable(this.editor),
node,
- drawingregion = this.editor.get_dialogue_element(SELECTOR.DRAWINGREGION),
+ drawingcanvas = this.editor.get_dialogue_element(SELECTOR.DRAWINGCANVAS),
container,
label,
marker,
@@ -203,8 +203,8 @@ var COMMENT = function(editor, gradeid, pageno, x, y, width, colour, rawtext) {
color: COMMENTTEXTCOLOUR
});
- drawingregion.append(container);
- container.setStyle('position', 'relative');
+ drawingcanvas.append(container);
+ container.setStyle('position', 'absolute');
container.setX(position.x);
container.setY(position.y);
drawable.store_position(container, position.x, position.y);
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 579c33fbb52..dfeb368d945 100644
--- a/mod/assign/feedback/editpdf/yui/src/editor/js/editor.js
+++ b/mod/assign/feedback/editpdf/yui/src/editor/js/editor.js
@@ -367,7 +367,7 @@ EDITOR.prototype = {
* @method open_in_panel
*/
open_in_panel: function(panel) {
- var drawingcanvas, drawingregion;
+ var drawingcanvas;
this.panel = panel;
panel.append(this.get('body'));
@@ -378,9 +378,6 @@ EDITOR.prototype = {
drawingcanvas = this.get_dialogue_element(SELECTOR.DRAWINGCANVAS);
this.graphic = new Y.Graphic({render: drawingcanvas});
- drawingregion = this.get_dialogue_element(SELECTOR.DRAWINGREGION);
- drawingregion.on('scroll', this.move_canvas, this);
-
if (!this.get('readonly')) {
drawingcanvas.on('gesturemovestart', this.edit_start, null, this);
drawingcanvas.on('gesturemove', this.edit_move, null, this);
@@ -397,7 +394,7 @@ EDITOR.prototype = {
* @method link_handler
*/
link_handler: function(e) {
- var drawingcanvas, drawingregion;
+ var drawingcanvas;
var resize = true;
e.preventDefault();
@@ -420,9 +417,6 @@ EDITOR.prototype = {
drawingcanvas = this.get_dialogue_element(SELECTOR.DRAWINGCANVAS);
this.graphic = new Y.Graphic({render: drawingcanvas});
- drawingregion = this.get_dialogue_element(SELECTOR.DRAWINGREGION);
- drawingregion.on('scroll', this.move_canvas, this);
-
if (!this.get('readonly')) {
drawingcanvas.on('gesturemovestart', this.edit_start, null, this);
drawingcanvas.on('gesturemove', this.edit_move, null, this);