From 85cd11699724fc45d2f784b2d024c8c32252bfeb Mon Sep 17 00:00:00 2001 From: Bram Prieshof Date: Thu, 3 Feb 2022 13:21:02 +0100 Subject: [PATCH] Removed unnecessary buttons in editor --- vendor/js/picture-annotation.min.js | 2 +- vendor/js/picture-annotation.min.js.map | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/vendor/js/picture-annotation.min.js b/vendor/js/picture-annotation.min.js index 1e0cd26..85d0a0c 100644 --- a/vendor/js/picture-annotation.min.js +++ b/vendor/js/picture-annotation.min.js @@ -1,2 +1,2 @@ -(function(e){function t(t){for(var n,o,r=t[0],_=t[1],l=t[2],d=0,h=[];d5&&this.addPolygon(e),this.polygonAddShapes.length&&this.polygonAddShapes.splice(0,this.polygonAddShapes.length),this.isAddingPolygon=!1},addPolygon:function(e){this.shapes.push(Object(_var_www_debb1_local_picture_annotation_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__["a"])(Object(_var_www_debb1_local_picture_annotation_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__["a"])({},this.getBaseShape("poly")),{},{points:e,closed:!0,x:0,y:0})),this.shapesUpdated()},addRectangle:function(){this.isAddingPolygon||(this.shapes.push(Object(_var_www_debb1_local_picture_annotation_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__["a"])(Object(_var_www_debb1_local_picture_annotation_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__["a"])({},this.getBaseShape("rect")),{},{x:80/this.scale,y:50/this.scale,width:200/this.scale,height:200/this.scale})),this.shapesUpdated())},addCircle:function(){this.isAddingPolygon||(this.shapes.push(Object(_var_www_debb1_local_picture_annotation_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__["a"])(Object(_var_www_debb1_local_picture_annotation_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__["a"])({},this.getBaseShape("circle")),{},{x:180/this.scale,y:200/this.scale,radius:100/this.scale})),this.shapesUpdated())},addPerson:function(){this.isAddingPolygon||(this.shapes.push(Object(_var_www_debb1_local_picture_annotation_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__["a"])(Object(_var_www_debb1_local_picture_annotation_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__["a"])({},this.getBaseShape("path")),{},{x:80/this.scale,y:80/this.scale,data:"m 105.61519,0 a 52.807596,52.807596 0 1 1 0,105.61519 52.807596,52.807596 0 0 1 0,-105.61519 m 0,105.61519 c 58.3524,0 105.61522,23.63141 105.61522,52.8076 V 264.038 H 0 V 158.42279 c 0,-29.17619 47.262803,-52.8076 105.61519,-52.8076 z",scale:{x:1/this.scale,y:1/this.scale}})),this.shapesUpdated())},getBaseShape:function(e){return{type:e,name:"shape-"+(new Date).valueOf(),fill:"#b0c4de",opacity:.5,stroke:"#0000ff",draggable:!0,strokeWidth:2,strokeScaleEnabled:!1,annotation:{title:"",text:"",linkTitle:"",link:""}}},getBaseShapeForPolygon:function(e){return{fill:"#a24545",opacity:.5,stroke:"#800000",strokeWidth:2,strokeScaleEnabled:!1}},deleteShape:function(e){var t=this.shapes.findIndex((function(t){return t.name===e}));t>=0&&(e===this.selectedShapeName&&(this.selectedShapeName="",this.updateTransformer()),this.shapes.splice(t,1),this.shapesUpdated())},handleKeyEvent:function(e){this.editMode&&this.selectedShapeName&&"Delete"===e.key&&this.deleteShape(this.selectedShapeName)},handleScroll:function(e){if(e.evt){var t=e.evt;t.preventDefault();var a=t.deltaY<0?1:-1;this.changeScale(.02*a)}},changeScale:function(e){var t=this.scale+e;t<.1&&(t=.1),t>5&&(t=5),this.scale=t},handleDragEnd:function(e,t){t.x=e.currentTarget.attrs.x,t.y=e.currentTarget.attrs.y,this.shapesUpdated()},handleTransform:function(e,t){t.rotation=e.currentTarget.attrs.rotation,t.scaleX=e.currentTarget.attrs.scaleX,t.scaleY=e.currentTarget.attrs.scaleY,t.x=e.currentTarget.attrs.x,t.y=e.currentTarget.attrs.y,this.shapesUpdated()},handleMouseEnter:function(e){this.isAddingPolygon||(this.$refs.stage.getStage().container().style.cursor="pointer",this.currentHoverShape=e)},handleMouseLeave:function(){this.isAddingPolygon||(this.$refs.stage.getStage().container().style.cursor="default",this.currentHoverShape="")},handleGlobalMouseEnter:function(){this.isAddingPolygon&&(this.$refs.stage.getStage().container().style.cursor="crosshair")},handleGlobalMouseLeave:function(){this.isAddingPolygon&&(this.$refs.stage.getStage().container().style.cursor="default")},handleSideBarMouseEnter:function(e){if(!this.isAddingPolygon){var t=this.shapes.findIndex((function(t){return t.name===e}));t>=0&&(this.shapes[t].stroke="#c00",this.shapes[t].fill="#dec4b0")}},handleSideBarMouseLeave:function(e){if(!this.isAddingPolygon){var t=this.shapes.findIndex((function(t){return t.name===e}));t>=0&&(this.shapes[t].stroke="#00f",this.shapes[t].fill="#b0c4de")}},formSubmitted:function(e){var t=this.shapes.findIndex((function(t){return t.name===e}));t>=0&&(this.shapes[t].stroke="#00f",this.shapes[t].fill="#b0c4de"),this.shapesUpdated()},toggleShowShapes:function(){this.$refs.items.getStage().canvas._canvas.style.opacity=this.isShapesVisible?"0":"1",this.isShapesVisible=!this.isShapesVisible},shapesUpdated:function(){this.callback&&"function"===typeof this.callback&&this.callback(JSON.stringify(this.shapes)),this.localStorageKey&&localStorage.setItem(this.localStorageKey,JSON.stringify(this.shapes))},load:function(){if(this.initialDataId){var e=document.getElementById(this.initialDataId);e&&e.innerHTML&&(this.shapes=JSON.parse(e.innerHTML))}else if(this.initialData&&this.initialData.length>0)this.shapes=JSON.parse(this.initialData);else if(this.localStorageKey){var t=localStorage.getItem(this.localStorageKey)||"[]";this.shapes=JSON.parse(t)}this.editMode||this.shapes.forEach((function(e){return e.draggable&&delete e.draggable}))}}}},"555f":function(e,t,a){"use strict";var n=function(){var e=this,t=e.$createElement;e._self._c;return e._m(0)},i=[function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"pa-loader"},[a("div",{staticClass:"lds-ring"},[a("div"),a("div"),a("div"),a("div")])])}],s=a("2877"),o={},r=Object(s["a"])(o,n,i,!1,null,null,null);t["a"]=r.exports},"56d7":function(e,t,a){"use strict";a.r(t);a("e260"),a("e6cf"),a("cca6"),a("a79d");for(var n=a("2b0e"),i=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"pa-container",style:{width:e.width+"px",height:e.height+"px"},attrs:{id:e.containerId}},[a("div",{staticClass:"pa-canvas"},[a("div",{staticClass:"pa-controls"},[a("a",{attrs:{href:"#",title:e.$t("zoom_in")},on:{click:function(t){return t.preventDefault(),e.changeScale(.1)}}},[a("icon",{attrs:{type:"zoom-in"}})],1),a("a",{attrs:{href:"#",title:e.$t("zoom_out")},on:{click:function(t){return t.preventDefault(),e.changeScale(-.1)}}},[a("icon",{attrs:{type:"zoom-out"}})],1),a("hr"),e.editMode?e._e():a("a",{attrs:{href:"#",title:e.$t(e.isShapesVisible?"hide_shapes":"show_shapes")},on:{click:function(t){return t.preventDefault(),e.toggleShowShapes(t)}}},[a("icon",{attrs:{type:e.isShapesVisible?"shapes-off":"shapes-on"}})],1),e.editMode?a("a",{attrs:{href:"#",title:e.$t(e.isAddingPolygon?"accept_polygon":"add_polygon")},on:{click:function(t){return t.preventDefault(),e.startPolygonDrawing(t)}}},[a("icon",{attrs:{type:e.isAddingPolygon?"add-polygon-accept":"add-polygon",fill:e.isAddingPolygon?"green":"currentColor"}})],1):e._e(),e.editMode?a("a",{attrs:{href:"#",title:e.$t("add_rectangle")},on:{click:function(t){return t.preventDefault(),e.addRectangle(t)}}},[a("icon",{attrs:{type:"add-rectangle",fill:e.isAddingPolygon?"gray":"currentColor"}})],1):e._e(),e.editMode?a("a",{attrs:{href:"#",title:e.$t("add_circle")},on:{click:function(t){return t.preventDefault(),e.addCircle(t)}}},[a("icon",{attrs:{type:"add-circle",fill:e.isAddingPolygon?"gray":"currentColor"}})],1):e._e(),e.editMode?a("a",{attrs:{href:"#",title:e.$t("add_person")},on:{click:function(t){return t.preventDefault(),e.addPerson(t)}}},[a("icon",{attrs:{type:"add-person",fill:e.isAddingPolygon?"gray":"currentColor"}})],1):e._e()]),a("v-stage",{ref:"stage",attrs:{config:{width:e.stageSize.width,height:e.stageSize.height,scaleX:e.scale,scaleY:e.scale,draggable:!0}},on:{mousedown:e.handleStageMouseDown,contextmenu:e.cancelEvent,mouseenter:e.handleGlobalMouseEnter,mouseleave:e.handleGlobalMouseLeave,wheel:e.handleScroll}},[a("v-layer",{ref:"background"},[a("v-image",{attrs:{config:{image:e.image}}})],1),a("v-layer",{ref:"items"},[e._l(e.shapes,(function(t){return["rect"===t.type?a("v-rect",{key:t.name,attrs:{config:t},on:{dragend:function(a){return e.handleDragEnd(a,t)},transformend:function(a){return e.handleTransform(a,t)},mouseenter:function(a){return e.handleMouseEnter(t.name)},mouseleave:e.handleMouseLeave}}):e._e(),"circle"===t.type?a("v-circle",{key:t.name,attrs:{config:t},on:{dragend:function(a){return e.handleDragEnd(a,t)},transformend:function(a){return e.handleTransform(a,t)},mouseenter:function(a){return e.handleMouseEnter(t.name)},mouseleave:e.handleMouseLeave}}):e._e(),"poly"===t.type?a("v-line",{key:t.name,attrs:{config:t},on:{dragend:function(a){return e.handleDragEnd(a,t)},transformend:function(a){return e.handleTransform(a,t)},mouseenter:function(a){return e.handleMouseEnter(t.name)},mouseleave:e.handleMouseLeave}}):e._e(),"path"===t.type?a("v-path",{key:t.name,attrs:{config:t},on:{dragend:function(a){return e.handleDragEnd(a,t)},transformend:function(a){return e.handleTransform(a,t)},mouseenter:function(a){return e.handleMouseEnter(t.name)},mouseleave:e.handleMouseLeave}}):e._e()]})),e.editMode?a("v-transformer",{ref:"transformer"}):e._e()],2),e.editMode&&e.isAddingPolygon?a("v-layer",{ref:"polygon"},[e.polygonPoints.length>2?a("v-line",{attrs:{config:e.polygonPointsConfig}}):e._e(),e._l(e.polygonAddShapes,(function(e,t){return[a("v-rect",{key:t,attrs:{config:e}})]}))],2):e._e()],1),e.isLoading?a("loader"):e._e(),a("div",{directives:[{name:"show",rawName:"v-show",value:e.isAddingPolygon,expression:"isAddingPolygon"}],staticClass:"pa-polygon-hint"},[e._v(e._s(e.$t("polygon_help")))])],1),a("div",{staticClass:"pa-infobar"},e._l(e.shapes,(function(t){return a("side-bar-entry",{key:t.name,attrs:{shape:t,"edit-mode":e.editMode,"selected-shape-name":e.selectedShapeName,"current-hover-shape":e.currentHoverShape},on:{"sidebar-entry-enter":function(t){return e.handleSideBarMouseEnter(t)},"sidebar-entry-leave":function(t){return e.handleSideBarMouseLeave(t)},"sidebar-entry-delete":function(t){return e.deleteShape(t)},"sidebar-entry-save":function(t){return e.formSubmitted(t)}}})})),1)])},s=[],o=a("3f4a"),r=o["a"],_=(a("cf25"),a("2877")),l=Object(_["a"])(r,i,s,!1,null,null,null),c=l.exports,d=document.getElementsByClassName("picture-annotation"),h=[],u=0;u5&&this.addPolygon(e),this.polygonAddShapes.length&&this.polygonAddShapes.splice(0,this.polygonAddShapes.length),this.isAddingPolygon=!1},addPolygon:function(e){this.shapes.push(Object(_var_www_debb1_local_Src_picture_annotation_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__["a"])(Object(_var_www_debb1_local_Src_picture_annotation_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__["a"])({},this.getBaseShape("poly")),{},{points:e,closed:!0,x:0,y:0})),this.shapesUpdated()},addRectangle:function(){this.isAddingPolygon||(this.shapes.push(Object(_var_www_debb1_local_Src_picture_annotation_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__["a"])(Object(_var_www_debb1_local_Src_picture_annotation_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__["a"])({},this.getBaseShape("rect")),{},{x:80/this.scale,y:50/this.scale,width:200/this.scale,height:200/this.scale})),this.shapesUpdated())},addCircle:function(){this.isAddingPolygon||(this.shapes.push(Object(_var_www_debb1_local_Src_picture_annotation_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__["a"])(Object(_var_www_debb1_local_Src_picture_annotation_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__["a"])({},this.getBaseShape("circle")),{},{x:180/this.scale,y:200/this.scale,radius:100/this.scale})),this.shapesUpdated())},addPerson:function(){this.isAddingPolygon||(this.shapes.push(Object(_var_www_debb1_local_Src_picture_annotation_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__["a"])(Object(_var_www_debb1_local_Src_picture_annotation_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__["a"])({},this.getBaseShape("path")),{},{x:80/this.scale,y:80/this.scale,data:"m 105.61519,0 a 52.807596,52.807596 0 1 1 0,105.61519 52.807596,52.807596 0 0 1 0,-105.61519 m 0,105.61519 c 58.3524,0 105.61522,23.63141 105.61522,52.8076 V 264.038 H 0 V 158.42279 c 0,-29.17619 47.262803,-52.8076 105.61519,-52.8076 z",scale:{x:1/this.scale,y:1/this.scale}})),this.shapesUpdated())},getBaseShape:function(e){return{type:e,name:"shape-"+(new Date).valueOf(),fill:"#b0c4de",opacity:.5,stroke:"#0000ff",draggable:!0,strokeWidth:2,strokeScaleEnabled:!1,annotation:{title:"",text:"",linkTitle:"",link:""}}},getBaseShapeForPolygon:function(e){return{fill:"#a24545",opacity:.5,stroke:"#800000",strokeWidth:2,strokeScaleEnabled:!1}},deleteShape:function(e){var t=this.shapes.findIndex((function(t){return t.name===e}));t>=0&&(e===this.selectedShapeName&&(this.selectedShapeName="",this.updateTransformer()),this.shapes.splice(t,1),this.shapesUpdated())},handleKeyEvent:function(e){this.editMode&&this.selectedShapeName&&"Delete"===e.key&&this.deleteShape(this.selectedShapeName)},handleScroll:function(e){if(e.evt){var t=e.evt;t.preventDefault();var a=t.deltaY<0?1:-1;this.changeScale(.02*a)}},changeScale:function(e){var t=this.scale+e;t<.1&&(t=.1),t>5&&(t=5),this.scale=t},handleDragEnd:function(e,t){t.x=e.currentTarget.attrs.x,t.y=e.currentTarget.attrs.y,this.shapesUpdated()},handleTransform:function(e,t){t.rotation=e.currentTarget.attrs.rotation,t.scaleX=e.currentTarget.attrs.scaleX,t.scaleY=e.currentTarget.attrs.scaleY,t.x=e.currentTarget.attrs.x,t.y=e.currentTarget.attrs.y,this.shapesUpdated()},handleMouseEnter:function(e){this.isAddingPolygon||(this.$refs.stage.getStage().container().style.cursor="pointer",this.currentHoverShape=e)},handleMouseLeave:function(){this.isAddingPolygon||(this.$refs.stage.getStage().container().style.cursor="default",this.currentHoverShape="")},handleGlobalMouseEnter:function(){this.isAddingPolygon&&(this.$refs.stage.getStage().container().style.cursor="crosshair")},handleGlobalMouseLeave:function(){this.isAddingPolygon&&(this.$refs.stage.getStage().container().style.cursor="default")},handleSideBarMouseEnter:function(e){if(!this.isAddingPolygon){var t=this.shapes.findIndex((function(t){return t.name===e}));t>=0&&(this.shapes[t].stroke="#c00",this.shapes[t].fill="#dec4b0")}},handleSideBarMouseLeave:function(e){if(!this.isAddingPolygon){var t=this.shapes.findIndex((function(t){return t.name===e}));t>=0&&(this.shapes[t].stroke="#00f",this.shapes[t].fill="#b0c4de")}},formSubmitted:function(e){var t=this.shapes.findIndex((function(t){return t.name===e}));t>=0&&(this.shapes[t].stroke="#00f",this.shapes[t].fill="#b0c4de"),this.shapesUpdated()},toggleShowShapes:function(){this.$refs.items.getStage().canvas._canvas.style.opacity=this.isShapesVisible?"0":"1",this.isShapesVisible=!this.isShapesVisible},shapesUpdated:function(){this.callback&&"function"===typeof this.callback&&this.callback(JSON.stringify(this.shapes)),this.localStorageKey&&localStorage.setItem(this.localStorageKey,JSON.stringify(this.shapes))},load:function(){if(this.initialDataId){var e=document.getElementById(this.initialDataId);e&&e.innerHTML&&(this.shapes=JSON.parse(e.innerHTML))}else if(this.initialData&&this.initialData.length>0)this.shapes=JSON.parse(this.initialData);else if(this.localStorageKey){var t=localStorage.getItem(this.localStorageKey)||"[]";this.shapes=JSON.parse(t)}this.editMode||this.shapes.forEach((function(e){return e.draggable&&delete e.draggable}))}}}},"555f":function(e,t,a){"use strict";var n=function(){var e=this,t=e.$createElement;e._self._c;return e._m(0)},i=[function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"pa-loader"},[a("div",{staticClass:"lds-ring"},[a("div"),a("div"),a("div"),a("div")])])}],s=a("2877"),_={},o=Object(s["a"])(_,n,i,!1,null,null,null);t["a"]=o.exports},"56d7":function(e,t,a){"use strict";a.r(t);a("e260"),a("e6cf"),a("cca6"),a("a79d");for(var n=a("2b0e"),i=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"pa-container",style:{width:e.width+"px",height:e.height+"px"},attrs:{id:e.containerId}},[a("div",{staticClass:"pa-canvas"},[a("div",{staticClass:"pa-controls"},[a("a",{attrs:{href:"#",title:e.$t("zoom_in")},on:{click:function(t){return t.preventDefault(),e.changeScale(.1)}}},[a("icon",{attrs:{type:"zoom-in"}})],1),a("a",{attrs:{href:"#",title:e.$t("zoom_out")},on:{click:function(t){return t.preventDefault(),e.changeScale(-.1)}}},[a("icon",{attrs:{type:"zoom-out"}})],1),a("hr"),e.editMode?a("a",{attrs:{href:"#",title:e.$t("add_rectangle")},on:{click:function(t){return t.preventDefault(),e.addRectangle(t)}}},[a("icon",{attrs:{type:"add-rectangle",fill:e.isAddingPolygon?"gray":"currentColor"}})],1):e._e()]),a("v-stage",{ref:"stage",attrs:{config:{width:e.stageSize.width,height:e.stageSize.height,scaleX:e.scale,scaleY:e.scale,draggable:!0}},on:{mousedown:e.handleStageMouseDown,contextmenu:e.cancelEvent,mouseenter:e.handleGlobalMouseEnter,mouseleave:e.handleGlobalMouseLeave,wheel:e.handleScroll}},[a("v-layer",{ref:"background"},[a("v-image",{attrs:{config:{image:e.image}}})],1),a("v-layer",{ref:"items"},[e._l(e.shapes,(function(t){return["rect"===t.type?a("v-rect",{key:t.name,attrs:{config:t},on:{dragend:function(a){return e.handleDragEnd(a,t)},transformend:function(a){return e.handleTransform(a,t)},mouseenter:function(a){return e.handleMouseEnter(t.name)},mouseleave:e.handleMouseLeave}}):e._e(),"circle"===t.type?a("v-circle",{key:t.name,attrs:{config:t},on:{dragend:function(a){return e.handleDragEnd(a,t)},transformend:function(a){return e.handleTransform(a,t)},mouseenter:function(a){return e.handleMouseEnter(t.name)},mouseleave:e.handleMouseLeave}}):e._e(),"poly"===t.type?a("v-line",{key:t.name,attrs:{config:t},on:{dragend:function(a){return e.handleDragEnd(a,t)},transformend:function(a){return e.handleTransform(a,t)},mouseenter:function(a){return e.handleMouseEnter(t.name)},mouseleave:e.handleMouseLeave}}):e._e(),"path"===t.type?a("v-path",{key:t.name,attrs:{config:t},on:{dragend:function(a){return e.handleDragEnd(a,t)},transformend:function(a){return e.handleTransform(a,t)},mouseenter:function(a){return e.handleMouseEnter(t.name)},mouseleave:e.handleMouseLeave}}):e._e()]})),e.editMode?a("v-transformer",{ref:"transformer"}):e._e()],2),e.editMode&&e.isAddingPolygon?a("v-layer",{ref:"polygon"},[e.polygonPoints.length>2?a("v-line",{attrs:{config:e.polygonPointsConfig}}):e._e(),e._l(e.polygonAddShapes,(function(e,t){return[a("v-rect",{key:t,attrs:{config:e}})]}))],2):e._e()],1),e.isLoading?a("loader"):e._e(),a("div",{directives:[{name:"show",rawName:"v-show",value:e.isAddingPolygon,expression:"isAddingPolygon"}],staticClass:"pa-polygon-hint"},[e._v(e._s(e.$t("polygon_help")))])],1),a("div",{staticClass:"pa-infobar"},e._l(e.shapes,(function(t){return a("side-bar-entry",{key:t.name,attrs:{shape:t,"edit-mode":e.editMode,"selected-shape-name":e.selectedShapeName,"current-hover-shape":e.currentHoverShape},on:{"sidebar-entry-enter":function(t){return e.handleSideBarMouseEnter(t)},"sidebar-entry-leave":function(t){return e.handleSideBarMouseLeave(t)},"sidebar-entry-delete":function(t){return e.deleteShape(t)},"sidebar-entry-save":function(t){return e.formSubmitted(t)}}})})),1)])},s=[],_=a("3f4a"),o=_["a"],r=(a("cf25"),a("2877")),l=Object(r["a"])(o,i,s,!1,null,null,null),c=l.exports,d=document.getElementsByClassName("picture-annotation"),h=[],u=0;u\n
\n
\n
\n \n \n
\n \n \n \n \n \n
\n \n\n \n \n \n \n \n \n \n \n \n 2\" :config=\"polygonPointsConfig\" />\n \n \n \n\n \n\n
{{ $t('polygon_help') }}
\n
\n
\n \n
\n
\n\n\n\n\n\n","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _vm._m(0)}\nvar staticRenderFns = [function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"pa-loader\"},[_c('div',{staticClass:\"lds-ring\"},[_c('div'),_c('div'),_c('div'),_c('div')])])}]\n\nexport { render, staticRenderFns }","import { render, staticRenderFns } from \"./Loader.vue?vue&type=template&id=9e9779d6&\"\nvar script = {}\n\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","import Vue from 'vue';\nimport App from './App.vue';\n\n// loader that simulates the parameters of the web component\nconst $elements = document.getElementsByClassName('picture-annotation');\nconst savedElements = []; // save elements to array, since array will otherwise be reduce while looping\nfor (let i = 0; i < $elements.length; i++) {\n savedElements.push($elements[i]);\n}\n\n// retrieve elements from array and create vue instances\nfor (let i = 0; i < savedElements.length; i++) {\n const $el = savedElements[i];\n\n // do we have annotation data?\n const data = $el.getElementsByClassName('picture-annotation-data');\n\n // create new instance for each occurrence\n new Vue({\n // handler for rendering component\n render: function (h) {\n // return App instance with parameters\n return h(App, {\n // pass attributes of parent element to app\n props: {\n containerId: (this.$el.attributes.id && this.$el.attributes.id.value) || 'picture-annotation-' + i,\n editMode: (this.$el.attributes['data-edit-mode'] && this.$el.attributes['data-edit-mode'].value === '1') || false,\n language: (this.$el.attributes['data-language'] && this.$el.attributes['data-language'].value) || 'en',\n imageSrc: this.$el.attributes['data-image-src'] && this.$el.attributes['data-image-src'].value,\n localStorageKey: this.$el.attributes['data-local-storage-key'] && this.$el.attributes['data-local-storage-key'].value,\n width: (this.$el.attributes['data-width'] && this.$el.attributes['data-width'].value) || $el.innerWidth,\n height: (this.$el.attributes['data-height'] && this.$el.attributes['data-height'].value) || $el.innerHeight,\n dataCallback: this.$el.attributes['data-callback'] && this.$el.attributes['data-callback'].value,\n initialData: (data.length && data[0].innerHTML) || '',\n initialDataId: this.$el.attributes['data-initial-data-id'] && this.$el.attributes['data-initial-data-id'].value\n }\n });\n }\n }).$mount($el);\n}\n","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"pa-container\",style:({width: _vm.width + 'px', height: _vm.height + 'px'}),attrs:{\"id\":_vm.containerId}},[_c('div',{staticClass:\"pa-canvas\"},[_c('div',{staticClass:\"pa-controls\"},[_c('a',{attrs:{\"href\":\"#\",\"title\":_vm.$t('zoom_in')},on:{\"click\":function($event){$event.preventDefault();return _vm.changeScale(0.1)}}},[_c('icon',{attrs:{\"type\":\"zoom-in\"}})],1),_c('a',{attrs:{\"href\":\"#\",\"title\":_vm.$t('zoom_out')},on:{\"click\":function($event){$event.preventDefault();return _vm.changeScale(-0.1)}}},[_c('icon',{attrs:{\"type\":\"zoom-out\"}})],1),_c('hr'),(!_vm.editMode)?_c('a',{attrs:{\"href\":\"#\",\"title\":_vm.$t(_vm.isShapesVisible ? 'hide_shapes' : 'show_shapes')},on:{\"click\":function($event){$event.preventDefault();return _vm.toggleShowShapes($event)}}},[_c('icon',{attrs:{\"type\":_vm.isShapesVisible ? 'shapes-off' : 'shapes-on'}})],1):_vm._e(),(_vm.editMode)?_c('a',{attrs:{\"href\":\"#\",\"title\":_vm.$t(_vm.isAddingPolygon ? 'accept_polygon' : 'add_polygon')},on:{\"click\":function($event){$event.preventDefault();return _vm.startPolygonDrawing($event)}}},[_c('icon',{attrs:{\"type\":_vm.isAddingPolygon ? 'add-polygon-accept' : 'add-polygon',\"fill\":_vm.isAddingPolygon ? 'green' : 'currentColor'}})],1):_vm._e(),(_vm.editMode)?_c('a',{attrs:{\"href\":\"#\",\"title\":_vm.$t('add_rectangle')},on:{\"click\":function($event){$event.preventDefault();return _vm.addRectangle($event)}}},[_c('icon',{attrs:{\"type\":\"add-rectangle\",\"fill\":_vm.isAddingPolygon ? 'gray' : 'currentColor'}})],1):_vm._e(),(_vm.editMode)?_c('a',{attrs:{\"href\":\"#\",\"title\":_vm.$t('add_circle')},on:{\"click\":function($event){$event.preventDefault();return _vm.addCircle($event)}}},[_c('icon',{attrs:{\"type\":\"add-circle\",\"fill\":_vm.isAddingPolygon ? 'gray' : 'currentColor'}})],1):_vm._e(),(_vm.editMode)?_c('a',{attrs:{\"href\":\"#\",\"title\":_vm.$t('add_person')},on:{\"click\":function($event){$event.preventDefault();return _vm.addPerson($event)}}},[_c('icon',{attrs:{\"type\":\"add-person\",\"fill\":_vm.isAddingPolygon ? 'gray' : 'currentColor'}})],1):_vm._e()]),_c('v-stage',{ref:'stage',attrs:{\"config\":{\n width: _vm.stageSize.width,\n height: _vm.stageSize.height,\n scaleX: _vm.scale,\n scaleY: _vm.scale,\n draggable: true\n }},on:{\"mousedown\":_vm.handleStageMouseDown,\"contextmenu\":_vm.cancelEvent,\"mouseenter\":_vm.handleGlobalMouseEnter,\"mouseleave\":_vm.handleGlobalMouseLeave,\"wheel\":_vm.handleScroll}},[_c('v-layer',{ref:\"background\"},[_c('v-image',{attrs:{\"config\":{\n image: _vm.image\n }}})],1),_c('v-layer',{ref:\"items\"},[_vm._l((_vm.shapes),function(shape){return [(shape.type === 'rect')?_c('v-rect',{key:shape.name,attrs:{\"config\":shape},on:{\"dragend\":function($event){return _vm.handleDragEnd($event, shape)},\"transformend\":function($event){return _vm.handleTransform($event, shape)},\"mouseenter\":function($event){return _vm.handleMouseEnter(shape.name)},\"mouseleave\":_vm.handleMouseLeave}}):_vm._e(),(shape.type === 'circle')?_c('v-circle',{key:shape.name,attrs:{\"config\":shape},on:{\"dragend\":function($event){return _vm.handleDragEnd($event, shape)},\"transformend\":function($event){return _vm.handleTransform($event, shape)},\"mouseenter\":function($event){return _vm.handleMouseEnter(shape.name)},\"mouseleave\":_vm.handleMouseLeave}}):_vm._e(),(shape.type === 'poly')?_c('v-line',{key:shape.name,attrs:{\"config\":shape},on:{\"dragend\":function($event){return _vm.handleDragEnd($event, shape)},\"transformend\":function($event){return _vm.handleTransform($event, shape)},\"mouseenter\":function($event){return _vm.handleMouseEnter(shape.name)},\"mouseleave\":_vm.handleMouseLeave}}):_vm._e(),(shape.type === 'path')?_c('v-path',{key:shape.name,attrs:{\"config\":shape},on:{\"dragend\":function($event){return _vm.handleDragEnd($event, shape)},\"transformend\":function($event){return _vm.handleTransform($event, shape)},\"mouseenter\":function($event){return _vm.handleMouseEnter(shape.name)},\"mouseleave\":_vm.handleMouseLeave}}):_vm._e()]}),(_vm.editMode)?_c('v-transformer',{ref:\"transformer\"}):_vm._e()],2),(_vm.editMode && _vm.isAddingPolygon)?_c('v-layer',{ref:\"polygon\"},[(_vm.polygonPoints.length > 2)?_c('v-line',{attrs:{\"config\":_vm.polygonPointsConfig}}):_vm._e(),_vm._l((_vm.polygonAddShapes),function(shape,index){return [_c('v-rect',{key:index,attrs:{\"config\":shape}})]})],2):_vm._e()],1),(_vm.isLoading)?_c('loader'):_vm._e(),_c('div',{directives:[{name:\"show\",rawName:\"v-show\",value:(_vm.isAddingPolygon),expression:\"isAddingPolygon\"}],staticClass:\"pa-polygon-hint\"},[_vm._v(_vm._s(_vm.$t('polygon_help')))])],1),_c('div',{staticClass:\"pa-infobar\"},_vm._l((_vm.shapes),function(shape){return _c('side-bar-entry',{key:shape.name,attrs:{\"shape\":shape,\"edit-mode\":_vm.editMode,\"selected-shape-name\":_vm.selectedShapeName,\"current-hover-shape\":_vm.currentHoverShape},on:{\"sidebar-entry-enter\":function($event){return _vm.handleSideBarMouseEnter($event)},\"sidebar-entry-leave\":function($event){return _vm.handleSideBarMouseLeave($event)},\"sidebar-entry-delete\":function($event){return _vm.deleteShape($event)},\"sidebar-entry-save\":function($event){return _vm.formSubmitted($event)}}})}),1)])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import mod from \"-!../node_modules/cache-loader/dist/cjs.js??ref--12-0!../node_modules/babel-loader/lib/index.js!../node_modules/cache-loader/dist/cjs.js??ref--0-0!../node_modules/vue-loader/lib/index.js??vue-loader-options!./App.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../node_modules/cache-loader/dist/cjs.js??ref--12-0!../node_modules/babel-loader/lib/index.js!../node_modules/cache-loader/dist/cjs.js??ref--0-0!../node_modules/vue-loader/lib/index.js??vue-loader-options!./App.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./App.vue?vue&type=template&id=f2d0525e&\"\nimport script from \"./App.vue?vue&type=script&lang=js&\"\nexport * from \"./App.vue?vue&type=script&lang=js&\"\nimport style0 from \"./App.vue?vue&type=style&index=0&lang=sass&\"\n\n\n/* normalize component */\nimport normalizer from \"!../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"pa-side-bar-entry\",class:{'is-selected-target': _vm.selectedShapeName === _vm.shape.name, 'is-hover-target': _vm.currentHoverShape === _vm.shape.name},on:{\"mouseenter\":_vm.handleMouseEnter,\"mouseleave\":_vm.handleMouseLeave}},[_c('button',{staticClass:\"pa-accordion\",class:{'is-active': _vm.active},attrs:{\"type\":\"button\"},on:{\"click\":function($event){$event.preventDefault();$event.stopPropagation();return _vm.toggleContent($event)}}},[_c('icon',{attrs:{\"type\":_vm.shape.type}}),(_vm.shape.annotation.title)?_c('span',{staticClass:\"pa-side-bar-title\"},[_vm._v(_vm._s(_vm.shape.annotation.title))]):_vm._e(),(_vm.editMode && (_vm.active || _vm.selectedShapeName === _vm.shape.name))?_c('span',{staticClass:\"pa-side-bar-icons\"},[_c('a',{attrs:{\"href\":\"#\",\"title\":_vm.$t('delete_shape')},on:{\"click\":function($event){$event.preventDefault();return _vm.deleteShape($event)}}},[_c('icon',{attrs:{\"type\":\"delete-shape\",\"fill\":\"red\"}})],1)]):_vm._e()],1),_c('div',{ref:\"panel\",staticClass:\"pa-panel\"},[(_vm.editMode)?[_c('form',{staticClass:\"pa-annotation-form\",on:{\"submit\":function($event){$event.preventDefault();$event.stopPropagation();return _vm.submitted($event)}}},[_c('label',{attrs:{\"for\":_vm.shape.name + '-title'}},[_vm._v(_vm._s(_vm.$t('annotation_title')))]),_c('input',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.formData.title),expression:\"formData.title\"}],attrs:{\"type\":\"text\",\"name\":\"title\",\"id\":_vm.shape.name + '-title'},domProps:{\"value\":(_vm.formData.title)},on:{\"input\":function($event){if($event.target.composing){ return; }_vm.$set(_vm.formData, \"title\", $event.target.value)}}}),_c('label',{attrs:{\"for\":_vm.shape.name + '-text'}},[_vm._v(_vm._s(_vm.$t('annotation_text')))]),_c('textarea',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.formData.text),expression:\"formData.text\"}],attrs:{\"name\":\"text\",\"id\":_vm.shape.name + '-text'},domProps:{\"value\":(_vm.formData.text)},on:{\"input\":function($event){if($event.target.composing){ return; }_vm.$set(_vm.formData, \"text\", $event.target.value)}}}),_vm._v(\" \"),_c('label',{attrs:{\"for\":_vm.shape.name + '-link-title'}},[_vm._v(_vm._s(_vm.$t('annotation_link_title')))]),_c('input',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.formData.linkTitle),expression:\"formData.linkTitle\"}],attrs:{\"type\":\"text\",\"name\":\"link-title\",\"id\":_vm.shape.name + '-link-title'},domProps:{\"value\":(_vm.formData.linkTitle)},on:{\"input\":function($event){if($event.target.composing){ return; }_vm.$set(_vm.formData, \"linkTitle\", $event.target.value)}}}),_c('label',{attrs:{\"for\":_vm.shape.name + '-link'}},[_vm._v(_vm._s(_vm.$t('annotation_link')))]),_c('input',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.formData.link),expression:\"formData.link\"}],attrs:{\"type\":\"text\",\"name\":\"link\",\"id\":_vm.shape.name + '-link'},domProps:{\"value\":(_vm.formData.link)},on:{\"input\":function($event){if($event.target.composing){ return; }_vm.$set(_vm.formData, \"link\", $event.target.value)}}}),_c('button',{attrs:{\"type\":\"submit\"}},[_vm._v(_vm._s(_vm.$t('submit')))])])]:[(_vm.shape.annotation.text)?_c('div',{staticClass:\"pa-annotation-text\"},[_c('nl2br',{attrs:{\"tag\":\"p\",\"text\":_vm.shape.annotation.text}})],1):_vm._e(),(_vm.shape.annotation.link)?_c('a',{staticClass:\"pa-annotation-link\",attrs:{\"href\":_vm.shape.annotation.link}},[_vm._v(_vm._s(_vm.shape.annotation.linkTitle || _vm.$t('more')))]):_vm._e()]],2)])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","