From 6fcfb7c04d32e1c8b26a312295bf7ac3ec2d2ad7 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Fri, 13 Jul 2018 19:06:45 +0200 Subject: Fixed many permissions and began admin interface --- .../jvectormap/src/vml-shape-element.js | 49 ++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 public/bower_components/jvectormap/src/vml-shape-element.js (limited to 'public/bower_components/jvectormap/src/vml-shape-element.js') diff --git a/public/bower_components/jvectormap/src/vml-shape-element.js b/public/bower_components/jvectormap/src/vml-shape-element.js new file mode 100644 index 0000000..85e9791 --- /dev/null +++ b/public/bower_components/jvectormap/src/vml-shape-element.js @@ -0,0 +1,49 @@ +jvm.VMLShapeElement = function(name, config){ + jvm.VMLShapeElement.parentClass.call(this, name, config); + + this.fillElement = new jvm.VMLElement('fill'); + this.strokeElement = new jvm.VMLElement('stroke'); + this.node.appendChild(this.fillElement.node); + this.node.appendChild(this.strokeElement.node); + this.node.stroked = false; + + jvm.AbstractShapeElement.apply(this, arguments); +}; + +jvm.inherits(jvm.VMLShapeElement, jvm.VMLElement); +jvm.mixin(jvm.VMLShapeElement, jvm.AbstractShapeElement); + +jvm.VMLShapeElement.prototype.applyAttr = function(attr, value){ + switch (attr) { + case 'fill': + this.node.fillcolor = value; + break; + case 'fill-opacity': + this.fillElement.node.opacity = Math.round(value*100)+'%'; + break; + case 'stroke': + if (value === 'none') { + this.node.stroked = false; + } else { + this.node.stroked = true; + } + this.node.strokecolor = value; + break; + case 'stroke-opacity': + this.strokeElement.node.opacity = Math.round(value*100)+'%'; + break; + case 'stroke-width': + if (parseInt(value, 10) === 0) { + this.node.stroked = false; + } else { + this.node.stroked = true; + } + this.node.strokeweight = value; + break; + case 'd': + this.node.path = jvm.VMLPathElement.pathSvgToVml(value); + break; + default: + jvm.VMLShapeElement.parentClass.prototype.applyAttr.apply(this, arguments); + } +}; \ No newline at end of file -- cgit v1.2.3