New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@boundlessgeo/storytools

Package Overview
Dependencies
Maintainers
17
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@boundlessgeo/storytools - npm Package Compare versions

Comparing version 1.0.0-alpha8 to 1.0.0-alpha9

2

dist/story-tools-edit-ng.min.js

@@ -1,1 +0,1 @@

!function(){"use strict";var e=angular.module("storytools.edit.boxes.controllers",[]);e.controller("boxesEditorController",function(){var e=null;this.boxes=[{title:"Default"}],this.currentBox={},this.editingBox=null,this.editBox=function(t){e=angular.copy(t),this.editingBox=t},this.newStoryBox=function(){this.editingBox={isNew:!0},e=null},this.deleteBox=function(){alert("implement me!")},this.acceptEdit=function(){this.editingBox.isNew&&this.boxes.push(this.editingBox),e=null,this.editingBox=null},this.cancelEdit=function(){e&&angular.copy(e,this.editingBox),e=null,this.editingBox=null}}),e.controller("boxEditorController",["$scope",function(){}])}(),function(){"use strict";var e=angular.module("storytools.edit.boxes.directives",["storytools.edit.boxes.controllers"]);e.directive("boxChooser",function(){return{restrict:"E",require:"^boxesEditor",templateUrl:"boxes/box-chooser.html",link:function(){}}}),e.directive("boxesEditor",function(){return{restrict:"A",controller:"boxesEditorController",controllerAs:"boxesCtrl",link:function(){}}}),e.directive("boxEditor",function(){return{restrict:"E",controller:"boxEditorController",controllerAs:"boxCtrl",require:"^boxesEditor",templateUrl:"boxes/box-editor.html",link:function(e,t,r,o){e.$watch(function(){return o.editingBox},function(){e.editBox=o.editingBox})}}}),e.directive("boxBoundsEditor",["$timeout",function(){return{restrict:"E",templateUrl:"boxes/bounds-editor.html",link:function(e,t){var r=t[0].querySelector(".box-bounds-map"),o=new ol.Map({target:r,pixelRatio:1});o.setView(new ol.View({center:[0,0],zoom:3})),o.addLayer(new ol.layer.Tile({source:new ol.source.MapQuest({layer:"osm"})})),e.$watch("boxBoundsEditorSelected",function(e){e&&o.updateSize()})}}}]),e.directive("boxContentsEditor",function(){return{restrict:"E",templateUrl:"boxes/contents-editor.html"}}),e.directive("boxLayersEditor",function(){return{restrict:"E",templateUrl:"boxes/layers-editor.html"}}),e.directive("boxLayoutEditor",function(){return{restrict:"E",templateUrl:"boxes/layout-editor.html"}})}(),function(){"use strict";angular.module("storytools.edit.boxes",["storytools.edit.boxes.directives","storytools.edit.boxes.controllers","ui.bootstrap"])}(),function(){"use strict";var e=angular.module("storytools.edit.pins.controllers",[]);e.controller("pinsEditorController",["$scope","$timeout","StoryPin","StoryPinLayerManager","MapManager",function(e,t,r,o,n){function i(){return n.storyMap.getMap()}function l(){return n.storyMap.overlay.getFeatures()}function s(){for(var e in y)y[e].setActive(!1)}function a(){d.activeDrawTool=null,l().clear()}function c(){l().clear()}function u(){t(function(){d.activeDrawTool=null;var e=l(),t=e.getLength()>0?e.item(0).getGeometry():null;d.editingCopy.setGeometry(t),t&&null===d.editingCopy.in_map&&(d.editingCopy.in_map=!0)})}function f(e){s(),y[e]||("Modify"==e?y[e]=new ol.interaction.Modify({features:l()}):(y[e]=new ol.interaction.Draw({features:l(),type:e}),y[e].on("drawstart",c)),i().addInteraction(y[e]),y[e].on("drawend",u)),y[e].setActive(!0)}var y={},d=this;this.currentPin=null,this.editingCopy=new r,this.StoryPinLayerManager=o,this.deleteStoryPin=function(e){o.pinsChanged([e],"delete")},this.saveStoryPin=function(){var e=this.currentPin,t=this.editingCopy.getProperties();if(e instanceof r)e.setProperties(t),o.pinsChanged([e],"change");else{var n=new r(t);o.pinsChanged([n],"add")}this.currentPin=this.editingCopy=null,a()},this.editStoryPin=function(e){if(a(),this.currentPin=e,this.editingCopy=new r(this.currentPin?this.currentPin.getProperties():{}),e&&e.getGeometry()){l().push(e);var t=e.getGeometry().getExtent(),o=ol.extent.getCenter(t);i().getView().setCenter(o)}},this.deleteGeometry=function(){this.editingCopy.setGeometry(null),a()},this.isEditing=function(){return this.currentPin instanceof r},Object.defineProperty(this,"activeDrawTool",{get:function(){return this._activeDrawTool},set:function(e){this._activeDrawTool=e,angular.isString(e)?f(e):s()}}),e.$on("$destroy",function(){for(var e in y){var t=y[e];t.setActive(!1),i().removeInteraction(t)}})}]),e.controller("pinEditorController",["$scope",function(e){function t(){var t=e.pinsCtrl.editingCopy,r=!0;t&&null!=t.start_time&&null!=t.end_time&&(r=t.start_time<=t.end_time),e.pinForm.$setValidity("range",r)}e.$watch(function(){return e.pinsCtrl.editingCopy},function(t){e.storyPin=t}),e.$watch("pinsCtrl.editingCopy.start_time",t),e.$watch("pinsCtrl.editingCopy.end_time",t),this.isFormValid=function(){return e.pinForm.$valid},this.finish=function(){var t=e.storyPin;return e.storyPin=null,t}}])}(),function(){"use strict";var e=angular.module("storytools.edit.pins.directives",["storytools.core.pins"]);e.directive("pinsEditor",function(){return{restrict:"A",controller:"pinsEditorController",controllerAs:"pinsCtrl",link:function(e,t,r){var o=e.pinsCtrl;if(o.overlay=e.$eval(r.pinsOverlay),null===o.overlay)throw Error("pinsEditor needs pinsOverlay attribute")}}}),e.directive("pinChooser",function(){return{require:"^pinsEditor",restrict:"E",templateUrl:"pins/pin-chooser.html",link:function(e,t,r,o){e.editPin=function(t){o.editStoryPin(t),e.$eval(r.pinSelected,e.$parent)}}}}),e.directive("pinEditor",function(){return{require:"^pinsEditor",controller:"pinEditorController",controllerAs:"pinCtrl",restrict:"A"}}),e.directive("pinEditorForm",function(){return{require:"^pinEditor",restrict:"E",templateUrl:"pins/pin-editor-form.html",link:function(e,t){function r(){if(e.point.latitude&&e.point.longitude){new ol.geom.Point([parseFloat(e.point.longitude),parseFloat(e.point.latitude)]).transform("EPSG:4326",e.map.map.getView().getProjection())}}e.point={},e.showPointCoordinates=function(){return"Point"===e.pinsCtrl.activeDrawTool},e.$watch("storyPin",function(e,r){e!=r&&t[0].querySelector("input[name=title]").focus()}),e.$watch("point",r,!0)}}})}(),function(){"use strict";angular.module("storytools.edit.pins",["storytools.edit.time.directives","storytools.edit.pins.directives","storytools.edit.pins.controllers","ui.bootstrap"])}(),function(){"use strict";angular.module("storytools.edit.style",["storytools.edit.style.services","storytools.edit.style.directives","storytools.edit.style.controllers","storytools.edit.templates","ui.bootstrap"])}(),function(){"use strict";var e=angular.module("storytools.edit.time.directives",[]);e.directive("stDateTimeField",function(){return{restrict:"E",templateUrl:"time/date-time-field.html",scope:{dateTime:"=",currentTime:"="},link:function(e){e.open=function(t){t.preventDefault(),t.stopPropagation(),e.opened=!0}}}}),e.directive("isoDateTime",["$log",function(e){return{restrict:"A",require:"ngModel",link:function(t,r,o,n){n.$formatters.push(function(e){var t=null!=e?new Date(e).toISOString():"";return t}),n.$parsers.push(function(e){var t=Date.parse(e),r=!isNaN(t);return n.$setValidity("dateTime",r),r?t:null}),t.setFromCurrentTime=function(){t.currentTime?n.$modelValue=t.currentTime:e.error("no current time provided!")}}}}])}(),function(){"use strict";angular.module("storytools.edit.time",["storytools.edit.time.directives","storytools.edit.templates"])}(),function(){"use strict";function e(e,t,r,o){for(var n={},i=t.getElementsByTagName(e+"CssParameter"),l=0,s=i.length;s>l;l++){var a=i[l],c=a.getAttribute("name");if(void 0!==r[c]){var u=a.childNodes[0].nodeValue;void 0!==o[c]&&(u=o[c](u)),n[r[c]]=u}}return n}function t(e,t){var r=e.getElementsByTagName(t)[0];return r.childNodes[0].nodeValue}function r(e,t){return e.getElementsByTagName(t).length>0}function o(e,r){var o=r.getElementsByTagName(e+"Rotation")[0];return t(o,"ogc:PropertyName")}function n(n,i){if(!r(i,n+"Fill"))return{};var l=i.getElementsByTagName(n+"Fill")[0],s=e(n,l,{fill:"fillColor","fill-opacity":"fillOpacity"},{"fill-opacity":function(e){return 100*parseFloat(e)}});return r(i,n+"Size")&&(s.size=parseInt(t(i,n+"Size"))),r(i,n+"WellKnownName")&&(s.shape=t(i,n+"WellKnownName")),r(i,n+"Rotation")&&(s.rotationAttribute=o(n,i)),s}function i(t,o){if(!r(o,t+"Stroke"))return{};var n=o.getElementsByTagName(t+"Stroke")[0];return e(t,n,{stroke:"strokeColor","stroke-opacity":"strokeOpacity","stroke-dasharray":"strokeStyle","stroke-width":"strokeWidth"},{"stroke-opacity":function(e){return 100*parseFloat(e)},"stroke-width":function(e){return parseInt(e)},"stroke-dasharray":function(e){return"5.0"===e?"dashed":"1.0 2.0"===e?"dotted":"solid"}})}function l(e){if(!r(e,"ogc:Filter"))return{};var o=e.getElementsByTagName("ogc:Filter")[0];return{name:t(e,"sld:Name"),property:t(o,"ogc:PropertyName"),value:t(o,"ogc:Literal")}}function s(o,n){var i=n.getElementsByTagName(o,"TextSymbolizer"),l={};if(i.length>0){i=i[0],r(i,o+"Label")&&(l.attribute=t(i.getElementsByTagName(o+"Label")[0],"ogc:PropertyName"));for(var s=0,a=i.childNodes.length;a>s;s++){var c=i.childNodes[s];c.tagName===o+"Fill"&&(l=Object.assign(l,e(o,c,{fill:"fillColor"},{})))}if(r(i,o+"Font")){var u=i.getElementsByTagName(o+"Font")[0];l=Object.assign(l,e(o,u,{"font-family":"fontFamily","font-size":"fontSize","font-style":"fontStyle","font-weight":"fontWeight"},{"font-size":parseInt}))}}return l}var a=angular.module("storytools.edit.style.controllers",[]);a.controller("styleEditorController",["$scope","stStyleTypes","stStyleChoices","stLayerClassificationService","stStyleRuleBuilder",function(e,t,r,o,a){function c(){var t=e.activeStyle;o.classify(e.layer,t.classify.attribute,t.classify.method,t.classify.maxClasses).then(function(e){t.rules=e,a.buildRuleStyles(t)})}function u(t){for(var r=0,o=0,n=e.styleTypes.length;n>o;o++){var i=e.styleTypes[o].name;i.indexOf(t)>=0&&(r=o,e.styleTypes[o].active=!1)}return e.styleTypes[r]}function f(e,t){var r=function(r){return t.getElementsByTagName(e+r).length};return r("RasterSymbolizer")>0||r("Transformation")>0||r("Rule")>13}function y(t){var r=t.defaultStyle.href;r&&(r="/gs/"+r.split("/geoserver/")[1],r=r.replace(".json",".sld"),fetch(r,{credentials:"same-origin"}).then(function(t){t.text().then(function(t){var r=new DOMParser,o=r.parseFromString(t,"application/xml"),a="";"sld:"===o.documentElement.tagName.substring(0,4)&&(a="sld:"),e.warning=!1,f(a,o)&&(e.warning="WARNING! This style is complex and any changes saved here will cause that style to be LOST!");var c,y,d,p,h,g=o.getElementsByTagName(a+"Rule");if(1===g.length){y=g[0],d=i(a,y);for(c in d)e.activeStyle.stroke[c]=d[c];p=n(a,y);for(c in p)e.activeStyle.symbol[c]=p[c];h=s(a,y);for(c in h)e.activeStyle.label[c]=h[c]}else if(g.length>1){y=g[0],p=n(a,y);for(c in p)e.activeStyle.symbol[c]=p[c];d=i(a,y);for(c in d)e.activeStyle.stroke[c]=d[c];h=s(a,y);for(c in h)e.activeStyle.label[c]=h[c];var v=l(y);e.activeStyle.classify={attribute:v.property,method:"unique",maxClasses:g.length};var b=u("unique-");b.active=!0,e.activeStyle.typeName=b.name,p.fillOpacity&&(e.activeStyle.classify.opacity=p.fillOpacity);for(var S=[],C=0,x=g.length;x>C;C++){y=g[C],v=l(y);var E={name:v.name,value:v.value,style:{}};"unique-point"===b.name||"unique-polygon"===b.name?(E.style.symbol=n(a,y),delete E.style.symbol.size):"unique-line"===b.name&&(E.style.stroke=i(a,y)),S.push(E)}e.activeStyle.rules=S,e.layer.set("style",e.activeStyle),m(b)}})}))}function d(r){if(e.layer=r,e.meta=r.get("metadata"),e.hasStyle=!1,e.styleTypes=t.getTypes(r,e.layerstyles),e.styleTypes.length>0){var o=p();e.styleTypes[o].active=!0,m(e.styleTypes[o])}e.$watch("meta",function(t){!e.hasStyle&&t.defaultStyle&&(e.hasStyle=!0,y(t))},!0)}function p(){var t=e.layer.get("style")||b.getSavedStyle(e.layer);if(t)for(var r=0;r<e.styleTypes.length;r++)if(t.typeName===e.styleTypes[r].name)return r;return 0}function m(t){e.currentEditor=t,e.activeStyle=h(t)}function h(r){var o,n=e.layer.get("style")||b.getSavedStyle(e.layer);if(r.name in v)o=v[r.name];else{var i=e.styleTypes.filter(function(e){return e.name==r.name});if(0===i.length)throw"invalid style type: "+r.name;o=t.createStyle(i[0])}return goog.isDefAndNotNull(n)&&n.typeName==o.typeName&&(o.symbol=n.symbol,o.stroke=n.stroke,o.classify=n.classify||null,o.rules=n.rules||null),o}function g(t){var r=e.styleTypes.length,o=p(),n=o+t;0>n?n=r-1:n>=r&&(n=0);for(var i=0;r>i;i++)e.styleTypes[i].active=i===n;m(e.styleTypes[n])}var v={},b=storytools.edit.styleStorageService.styleStorageService();e.styleChoices=r,void 0!==e.updateStyleChoices&&(e.styleChoices=e.updateStyleChoices(r)),d(e.layer),e.setActiveStyle=m,e.$watch(function(){var t=e.styleTypes.filter(function(e){return e.active});return t[0]},function(e,t){e&&e!==t&&m(e)}),e.$watch("layer",function(e,t){e!=t&&d(e)}),e.$on("featuretype-added",function(){d(e.layer)}),e.changeClassifyProperty=function(t,r){t&&(e.activeStyle.classify[t]=r),c()},e.$watch("activeStyle",function(){if(e.editorForm.$valid){var t=e.layer.get("style");t&&t.readOnly===!0?(delete t.readOnly,e.activeStyle=t):e.layer.set("style",e.activeStyle),(e.onChange||angular.noop)(e.layer)}},!0),e.onPrev=function(){g(-1)},e.onNext=function(){g(1)},e.$watch("editorForm.$valid",function(){(e.formChanged||angular.noop)(e.editorForm)})}])}(),function(){"use strict";function e(e,r,o,n){t.directive(e,["stStyleChoices",function(){return{restrict:"E",scope:{stModel:"=",property:"@",popover:"@popoverText"},templateUrl:"style/widgets/"+r,link:function(e,t,r){if(e.layer=e.$parent.layer,e.$parent.activeStyle){var i=e.$parent.activeStyle.typeName;e.hideStrokeWidth="graduated-line"===i?!0:!1}e.$watch(function(){return e.$parent.layer},function(t){e.layer=t}),e.model=e.stModel[o||e.property],e.updateProperty=function(t){e.$parent.activeStyle[[o||e.property]]=t},e.styleChoices=e.$parent.styleChoices,n&&n(e,t,r)}}}])}var t=angular.module("storytools.edit.style.directives",[]);t.directive("carouselNext",function(){return{restrict:"A",scope:{onNext:"="},require:["^carousel"],link:function(e,t,r,o){function n(){return i.indexOfSlide(i.currentSlide)+1===i.slides.length?0:i.indexOfSlide(i.currentSlide)+1}var i=o[0];t.bind("click",function(){var t=n(),r=i.slides[t];e.onNext&&e.onNext(r.$parent.styleType),i.select(r)})}}}),t.directive("carouselPrev",function(){return{restrict:"A",scope:{onPrev:"="},require:["^carousel"],link:function(e,t,r,o){function n(){return 0===i.indexOfSlide(i.currentSlide)?i.slides.length-1:i.indexOfSlide(i.currentSlide)-1}var i=o[0];t.bind("click",function(){var t=n(),r=i.slides[t];e.onPrev&&e.onPrev(r.$parent.styleType),i.select(r)})}}}),t.directive("styleEditor",function(){return{restrict:"E",templateUrl:"style/style-editor.html",controller:"styleEditorController",require:"?styleEditorController",scope:{layer:"=",onChange:"=",formChanged:"=",control:"=",layerstyles:"=",updateStyleChoices:"="}}}),t.directive("attributeCombo",["$log",function(e){return{restrict:"E",templateUrl:"style/widgets/attribute-combo.html",scope:{layer:"=",model:"=stModel",onChange:"=?",css:"@css"},link:function(t,r,o){function n(){var r=[];t.layer?(t.layer.get("attributes").forEach(function(t){var n=!0;"nogeom"===o.filter?n="http://www.opengis.net/gml"!==t.typeNS:"number"===o.filter?n="integer"===t.type||"int"===t.type||"double"===t.type||"long"===t.type:"unique"===o.filter?n="string"===t.type:o.filter&&e.warn("unknown filter",o.filter),o.include&&(n=o.include.indexOf(t.type)>=0),n&&r.push(t.name)}),r.sort(),t.attributes=r):t.attributes=[]}t.$watch("layer",function(e,t){e!=t&&n()}),n(),t.property=o.property||"attribute",t.onChange||(t.onChange=function(e,r){t.model[e]=r})}}}]),e("symbolEditor","symbol-editor.html","symbol",function(e,t,r){["showGraphic","showRotation","hideColor"].forEach(function(t){e[t]=r[t]}),e.getSymbolizerText=function(e){return e.shape||e.graphic},e.getSymbolizerImage=function(){return""}}),e("strokeEditor","stroke-editor.html","stroke"),e("numberEditor","number-editor.html",null,function(e,t,r){function o(r){var o=t.find("input"),n=Number(o.attr("min"))||0,i=Number(o.attr("max")),l=Number(o.attr("step"))||1,s=e.stModel[e.property],a=r.detail||r.wheelDelta;s=Math.min(i,s+(a>0?-l:l)),s=Math.max(n,s),e.$apply(function(){e.stModel[e.property]=s})}var n={max:30,min:0,step:1};Object.keys(n).forEach(function(t){e[t]=r[t]||n[t]}),t[0].addEventListener("DOMMouseScroll",o,!1),t[0].addEventListener("mousewheel",o,!1),t[0].addEventListener("change",function(){var r=t.find("input"),o=Number(r.attr("min"))||0,n=Number(r.attr("max")),i=e.stModel[e.property];o>i?e.$apply(function(){e.stModel[e.property]=o}):i>n&&e.$apply(function(){e.stModel[e.property]=n})})}),e("colorEditor","color-editor.html"),e("labelEditor","label-editor.html","label",function(e){e.toggleValue=function(t){"fontWeight"===t?e.model.fontWeight="bold"===e.model.fontWeight?"normal":"bold":"fontStyle"===t&&(e.model.fontStyle="italic"===e.model.fontStyle?"normal":"italic")}}),t.directive("graphicEditor",["stStyleChoices","ol3MarkRenderer","iconCommons","iconCommonsSearch","stSvgIcon",function(e,t,r,o,n){return{restrict:"E",templateUrl:"style/widgets/graphic-editor.html",scope:{symbol:"="},link:function(i,l){function s(e){var r=angular.element(t(e,24));return r.addClass("symbol-icon"),r.attr("mark",e),r}function a(e){var t=angular.element("<img>");return t.attr("src",e.dataURI),t.addClass("symbol-icon"),t.attr("graphic",e.uri),t}function c(){var e=angular.element(l[0].querySelector("[data-current-symbol]"));e.find("*").remove(),i.symbol.shape?e.append(s(i.symbol.shape)):i.symbol.graphic&&n.getImage(i.symbol.graphic,"#000","#fff").then(function(t){e.append(a(t))})}function u(){y=angular.element(l[0].getElementsByClassName("recent-icons")),y.html(""),r.defaults().then(function(e){e.forEach(function(e){var t=a(e);t.on("click",f),y.append(t)}),i.recent=e})}var f=function(){var e=angular.element(this);e.attr("shape")?(i.symbol.shape=e.attr("shape"),i.symbol.graphic=null):e.attr("graphic")&&(i.symbol.shape=null,i.symbol.graphic=e.attr("graphic")),c()},y=angular.element(l[0].getElementsByClassName("ol-marks"));e.symbolizers.forEach(function(e){var t=s(e);t.attr("shape",e),t.on("click",f),y.append(t)}),i._updateRecent=function(){u(),c()},i._updateRecent(),i.showIconCommons=function(){o.search().then(function(e){n.getImageData(e.href).then(function(){i.symbol.shape=null,i.symbol.graphic=e.href,i._updateRecent()})})},i.$watch("symbol.shape",function(){c()})}}}]),t.directive("classifyEditor",function(){return{restrict:"E",templateUrl:"style/widgets/classify-editor.html",scope:!0,link:function(e,t,r){["showMethod","showMaxClasses","showRange","showColorRamp","showColorPalette","attributeFilter"].forEach(function(t){e[t]=r[t]})}}}),t.directive("colorRamp",function(){return{restrict:"A",scope:{ramp:"=ramp"},link:function(e,t,r){function o(){var o=t[0].getContext("2d"),n=o.createLinearGradient(0,0,r.width,0);Object.getOwnPropertyNames(e.ramp).forEach(function(t){t=parseFloat(t),isNaN(t)||n.addColorStop(t,e.ramp[t])}),o.fillStyle=n,o.fillRect(0,0,r.width,r.height)}e.$watch("ramp",o),o()}}}),t.directive("colorField",function(){function e(e){return t.exec(e)}var t=/(^#[0-9a-f]{6}$)|(^#[0-9a-f]{3}$)/i;return{restrict:"A",require:"ngModel",link:function(t,r,o,n){n.$parsers.push(function(t){return n.$setValidity("color",e(t)),t}),n.$formatters.push(function(t){return n.$setValidity("color",e(t)),t})}}}),t.directive("noClose",function(){return{link:function(e,t){t.on("click",function(e){e.stopPropagation()})}}}),t.directive("styleTypeEditor",["$compile","$templateCache",function(e,t){return{restrict:"E",link:function(r,o){r.$watch("currentEditor",function(){var n=r.currentEditor;if(r.currentEditor){var i="style/types/"+n.name.replace(" ","-")+".html";o.html(t.get(i)),e(o.contents())(r)}else o.html("")})}}}]),t.directive("rulesEditor",function(){return{restrict:"E",templateUrl:"style/rules-editor.html",link:function(e){e.deleteRule=function(t){e.activeStyle.rules=e.activeStyle.rules.filter(function(e){return e!==t})}}}})}(),function(){"use strict";var e=angular.module("storytools.edit.style.iconCommons",[]);e.factory("iconCommons",["$q","stSvgIcon","stRecentChoices",function(e,t,r){return{defaults:function(){return e.all(r.icons.recent.map(function(e){return t.getImage(e)}))}}}]),e.factory("iconCommonsSearch",["$http","$modal","$injector","$location",function(e,t,r,o){function n(e){for(var t=e.icons||e,r=0,o=t.length;o>r;r++)t[r].href=i+t[r].href;return e}var i=r.has("iconCommonsHost")?r.get("iconCommonsHost"):o.protocol()+"://"+o.host();return{tagEndpoint:i+"/icons/icon",search:function(){return this.modal=t.open({size:"lg",controller:"iconCommonsController",templateUrl:"style/widgets/icon-commons-search.html"}),this.modal?this.modal.result:null},getCollections:function(){return e.get(i+"/icons/collections").success(function(e){return n(e)})},getMore:function(t){var r=t.href;return 0!==r.indexOf(i)&&(r=i+r),e.get(r,{params:{page:t._nextPage}}).success(function(e){return n(e)})},getCollectionIcons:function(t){var r={};return t._nextPage&&(r.page=t._nextPage),e.get(i+t.href,{params:r}).success(function(e){return n(e)})},getByTag:function(t){return e.get(this.tagEndpoint,{params:{tag:t}}).success(function(e){return n(e)})},getTags:function(t){return e.get(i+"/icons/search/tags",{params:{query:t}}).then(function(e){return e.data.tags})}}}]),e.controller("iconCommonsController",["$scope","iconCommonsSearch","stRecentChoices",function(e,t,r){function o(t,r){var o=r.data.icons;t._icons=t._icons?t._icons.concat(o):o,t._more=r.data.page<r.data.pages,t._nextPage=r.data.page+1,e.icons=t}var n={href:t.tagEndpoint},i={};e.loadMore=function(){t.getMore(e.icons).then(function(t){o(e.icons,t)})},e.close=function(){r.icons.add(e.selectedIcon.href),t.modal.close(e.selectedIcon)},e.dismiss=function(){t.modal.dismiss()},e.tagSelect=function(e){n._icons=[],t.getByTag(e).then(function(e){o(n,e)})},e.viewCollections=function(){e.icons=i},e.viewTags=function(){e.icons=n},e.collectionSelect=function(e){e._icons=[],t.getCollectionIcons(e).then(function(t){o(e,t)})},e.iconSelected=function(t,r){e.selectedIcon=t,r&&e.close()},e.selectedClass=function(t){return t===e.selectedIcon?"active":null},e.getTags=t.getTags,t.getCollections().then(function(t){e.collections=t.data.collections})}])}(),function(){"use strict";var e=angular.module("storytools.edit.style.layerClassificationService",[]);e.factory("stLayerClassificationService",["$q","$http","$modal","$sce","$log",function(e,t,r,o,n){return{classify:function(i,l,s,a){this.cache||(this.cache={});var c;if(null===l||null===s)return c=e.defer(),c.reject("Not enough info to perform WPS request."),c.promise;var u=i.get("id")+"|"+l+"|"+s+"|"+a;if(this.cache[u])return c=e.defer(),c.resolve(this.cache[u]),c.promise;var f,y=this,d=new storytools.edit.WPSClassify.WPSClassify,p=i.get("path")+"wps";if("unique"===s)return f=d.getUniqueValues({featureNS:i.get("featureNS"),typeName:i.get("typeName"),featurePrefix:i.get("featurePrefix"),attribute:l},!0),t({url:p,method:"POST",data:f,headers:{"Content-Type":"application/xml"}}).then(function(e){var t=[];if(e.data&&e.data.features)for(var r=0,o=Math.min(e.data.features.length,a);o>r;++r){var n=e.data.features[r];t.push({name:n.properties.value,value:n.properties.value})}return y.cache[u]=t,t});var m;return"Natural Breaks"===s?m="NATURAL_BREAKS":"Equal Interval"===s?m="EQUAL_INTERVAL":"Quantile"===s&&(m="QUANTILE"),void 0!==m?(f=d.classifyVector({featureNS:i.get("featureNS"),typeName:i.get("typeName"),featurePrefix:i.get("featurePrefix"),attribute:l,numClasses:a,method:m},!0),t({url:p,method:"POST",data:f,headers:{"Content-Type":"application/xml"}}).then(function(e){var t=d.parseResult(e.data);return t.success===!0?(y.cache[u]=t.rules,t.rules):(r.open({templateUrl:"error-dialog.html",controller:["$scope",function(e){e.title="Error",e.msg=o.trustAsHtml("An error occurred when communicating with the classification service: <br/>"+t.msg)}]}),n.warn(t.msg),[])})):void 0}}}])}(),function(){"use strict";var e=angular.module("storytools.edit.style.services",["storytools.core.style","storytools.edit.style.styleRuleBuilder","storytools.edit.style.styleChoices","storytools.edit.style.styleTypes","storytools.edit.style.layerClassificationService","storytools.edit.style.iconCommons"]);e.factory("WPSClassify",[storytools.edit.WPSClassify]),e.factory("SLDStyleConverter",[storytools.edit.SLDStyleConverter]),e.factory("WFSDescribeFeatureType",[storytools.edit.WFSDescribeFeatureType]),e.factory("StyleComplete",[storytools.edit.StyleComplete]),e.factory("styleStorageService",[storytools.edit.styleStorageService])}(),function(){"use strict";function e(e,t){this._max=t,this._key="stRecentChoices-"+e;var r=localStorage.getItem(this._key);this.recent=r?JSON.parse(r):[]}var t=angular.module("storytools.edit.style.styleChoices",[]);t.factory("stStyleChoices",function(){return{symbolizers:["circle","square","triangle","star","cross","x"],rotationUnits:["degrees","radians"],strokeStyle:["solid","dashed","dotted"],fontFamily:["serif","sans-serif","cursive","monospace"],colorRamps:[{0:"#fff7ec",1:"#7f0000"},{0:"#fff7fb",1:"#023858"},{0:"#ffffe5",1:"#004529"},{0:"#ffffff",1:"#000000"},{0:"#ffffe5",1:"#662506"},{0:"#fff7f3",1:"#49006a"},{0:"#f7fb77",1:"#08306b"}],colorPalettes:[{name:"Basic",vals:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6"]},{name:"Light",vals:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd","#fddaec","#f2f2f2"]},{name:"Dark",vals:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628","#f781bf","#999999"]},{name:"Pastel",vals:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9"]}],classMethods:["Natural Breaks","Equal Interval","Quantile"],getPalette:function(e){var t=this.colorPalettes.filter(function(t){return t.name===e});return t.length?t[0]:null}}}),t.factory("stRecentChoices",function(){return{icons:new e("icons",24)}}),e.prototype.clear=function(){this.recent=[],localStorage.setItem(this._key,JSON.stringify(this.recent))},e.prototype.add=function(e){-1===this.recent.indexOf(e)&&(this.recent.push(e),this.recent.length>this._max&&this.recent.shift(),localStorage.setItem(this._key,JSON.stringify(this.recent)))}}(),function(){"use strict";var e=angular.module("storytools.edit.style.styleRuleBuilder",["storytools.edit.style.styleTypes","storytools.edit.style.styleChoices"]);e.factory("stStyleRuleBuilder",["stStyleTypes","stStyleChoices",function(e,t){function r(e){return("00"+e.toString(16)).slice(-2)}function o(e,t){function o(){return[i[0],i[1]]}if(1===t)return[e[0]];var n=[],i=Object.keys(e).filter(function(e){return"$"!=e.toString().charAt(0)});i.sort();for(var l=i.map(function(t){var r=e[t];return[parseInt("0x"+r.substr(1,2)),parseInt("0x"+r.substr(3,2)),parseInt("0x"+r.substr(5,2))]}),s=1/(t-1),a=0;t>a;a++){var c=a*s,u=o(c),f=(c-u[0])/(u[1]-u[0]),y=l[u[0]],d=l[u[1]],p=Math.floor(y[0]+(d[0]-y[0])*f),m=Math.floor(y[1]+(d[1]-y[1])*f),h=Math.floor(y[2]+(d[2]-y[2])*f);n.push("#"+r(p)+r(m)+r(h))}return n}function n(e,t){var r=t.styleType.rule,o={};angular.forEach(r,function(e,r){var n={};angular.forEach(e,function(e,r){var o=null;switch(e){case"color":t.colors&&(o=t.colors[t.index%t.colors.length]);break;case"range":t.rangeStep&&(o=Math.round(t.rangeStep*t.index));break;case"opacity":t.style.classify.opacity&&(o=t.style.classify.opacity);break;default:throw"invalid copySource "+e}null!==o&&(n[r]=o)}),o[r]=n}),e.style=o}return{_colorRampValues:o,buildRuleStyles:function(r){var i,l;if(r.classify){if(r.classify.colorRamp)i=o(r.classify.colorRamp,r.rules.length);else if(r.classify.colorPalette){var s=t.getPalette(r.classify.colorPalette);i=s.vals}r.classify.range&&(l=(r.classify.range.max-r.classify.range.min)/r.rules.length)}var a={colors:i,rangeStep:l,style:r,styleType:e.getStyleType(r.typeName)};r.rules.forEach(function(e,t){a.index=t,n(e,a)})}}}])}(),function(){"use strict";var e=angular.module("storytools.edit.style.styleTypes",[]),t={size:10,shape:"circle",graphic:null,graphicType:null,fillColor:"#dd1c77",fillOpacity:70,rotationAttribute:null,rotationUnits:"degrees"},r={strokeColor:"#000000",strokeWidth:1,strokeStyle:"solid",strokeOpacity:100},o={attribute:null,fillColor:"#333333",fontFamily:"Serif",fontSize:10,fontStyle:"normal",fontWeight:"normal",placement:"point"},n={method:"unique",opacity:100,attribute:null,maxClasses:5,colorRamp:null},i={method:null,attribute:null,maxClasses:5,colorRamp:null},l={method:null,attribute:null,maxClasses:5,range:{min:0,max:16}},s=[{name:"simple-point",displayName:"Simple",prototype:{geomType:"point"}},{name:"unique-point",displayName:"Unique",prototype:{geomType:"point",classify:n},rule:{symbol:{fillOpacity:"opacity",fillColor:"color"}}},{name:"class-point",displayName:"Choropleth",prototype:{geomType:"point",classify:i},rule:{symbol:{fillColor:"color"}}},{name:"graduated-point",displayName:"Graduated",prototype:{geomType:"point",classify:l},rule:{symbol:{size:"range"}}},{name:"simple-line",displayName:"Simple",prototype:{geomType:"line"}},{name:"unique-line",displayName:"Unique",prototype:{geomType:"line",classify:n},rule:{stroke:{strokeColor:"color"}}},{name:"graduated-line",displayName:"Graduated",prototype:{geomType:"line",classify:l},rule:{stroke:{strokeColor:"color",strokeWidth:"range"}}},{name:"simple-polygon",displayName:"Simple",prototype:{geomType:"polygon"}},{name:"unique-polygon",displayName:"Unique",prototype:{geomType:"polygon",classify:n},rule:{symbol:{fillOpacity:"opacity",fillColor:"color"}}},{name:"class-polygon",displayName:"Choropleth",prototype:{geomType:"polygon",classify:i},rule:{symbol:{fillColor:"color"}}}];e.run(["$injector",function(e){if(e.has("stStyleDefaults")){var o=e.get("stStyleDefaults");[t,r].forEach(function(e){Object.keys(e).forEach(function(t){t in o&&(e[t]=o[t])})})}}]),e.factory("stStyleTypes",function(){return{getTypes:function(e,t){var r=angular.copy(s).filter(function(t){var r=e.get("geomType")||e.get("metadata").geomType;return t.prototype.geomType===r});return void 0!==t&&(r=r.filter(function(e){return t.indexOf(e.name)>=0})),r},getStyleType:function(e){var t=s.filter(function(t){return t.name==e});if(t.length>1)throw"duplicate type names!";return 0===t.length?null:t[0]},createStyle:function(e){var n={symbol:e.symbol||t,stroke:e.stroke||r,label:o,typeName:e.name},i=angular.extend({},angular.copy(n),e.prototype);return"classify"in i&&(i.rules=e.rules||[]),i}}})}();
!function(){"use strict";var e=angular.module("storytools.edit.boxes.controllers",[]);e.controller("boxesEditorController",function(){var e=null;this.boxes=[{title:"Default"}],this.currentBox={},this.editingBox=null,this.editBox=function(t){e=angular.copy(t),this.editingBox=t},this.newStoryBox=function(){this.editingBox={isNew:!0},e=null},this.deleteBox=function(){alert("implement me!")},this.acceptEdit=function(){this.editingBox.isNew&&this.boxes.push(this.editingBox),e=null,this.editingBox=null},this.cancelEdit=function(){e&&angular.copy(e,this.editingBox),e=null,this.editingBox=null}}),e.controller("boxEditorController",["$scope",function(){}])}(),function(){"use strict";var e=angular.module("storytools.edit.boxes.directives",["storytools.edit.boxes.controllers"]);e.directive("boxChooser",function(){return{restrict:"E",require:"^boxesEditor",templateUrl:"boxes/box-chooser.html",link:function(){}}}),e.directive("boxesEditor",function(){return{restrict:"A",controller:"boxesEditorController",controllerAs:"boxesCtrl",link:function(){}}}),e.directive("boxEditor",function(){return{restrict:"E",controller:"boxEditorController",controllerAs:"boxCtrl",require:"^boxesEditor",templateUrl:"boxes/box-editor.html",link:function(e,t,r,o){e.$watch(function(){return o.editingBox},function(){e.editBox=o.editingBox})}}}),e.directive("boxBoundsEditor",["$timeout",function(){return{restrict:"E",templateUrl:"boxes/bounds-editor.html",link:function(e,t){var r=t[0].querySelector(".box-bounds-map"),o=new ol.Map({target:r,pixelRatio:1});o.setView(new ol.View({center:[0,0],zoom:3})),o.addLayer(new ol.layer.Tile({source:new ol.source.MapQuest({layer:"osm"})})),e.$watch("boxBoundsEditorSelected",function(e){e&&o.updateSize()})}}}]),e.directive("boxContentsEditor",function(){return{restrict:"E",templateUrl:"boxes/contents-editor.html"}}),e.directive("boxLayersEditor",function(){return{restrict:"E",templateUrl:"boxes/layers-editor.html"}}),e.directive("boxLayoutEditor",function(){return{restrict:"E",templateUrl:"boxes/layout-editor.html"}})}(),function(){"use strict";angular.module("storytools.edit.boxes",["storytools.edit.boxes.directives","storytools.edit.boxes.controllers","ui.bootstrap"])}(),function(){"use strict";var e=angular.module("storytools.edit.pins.controllers",[]);e.controller("pinsEditorController",["$scope","$timeout","StoryPin","StoryPinLayerManager","MapManager",function(e,t,r,o,n){function i(){return n.storyMap.getMap()}function l(){return n.storyMap.overlay.getFeatures()}function s(){for(var e in y)y[e].setActive(!1)}function a(){d.activeDrawTool=null,l().clear()}function c(){l().clear()}function u(){t(function(){d.activeDrawTool=null;var e=l(),t=e.getLength()>0?e.item(0).getGeometry():null;d.editingCopy.setGeometry(t),t&&null===d.editingCopy.in_map&&(d.editingCopy.in_map=!0)})}function f(e){s(),y[e]||("Modify"==e?y[e]=new ol.interaction.Modify({features:l()}):(y[e]=new ol.interaction.Draw({features:l(),type:e}),y[e].on("drawstart",c)),i().addInteraction(y[e]),y[e].on("drawend",u)),y[e].setActive(!0)}var y={},d=this;this.currentPin=null,this.editingCopy=new r,this.StoryPinLayerManager=o,this.deleteStoryPin=function(e){o.pinsChanged([e],"delete")},this.saveStoryPin=function(){var e=this.currentPin,t=this.editingCopy.getProperties();if(e instanceof r)e.setProperties(t),o.pinsChanged([e],"change");else{var n=new r(t);o.pinsChanged([n],"add")}this.currentPin=this.editingCopy=null,a()},this.editStoryPin=function(e){if(a(),this.currentPin=e,this.editingCopy=new r(this.currentPin?this.currentPin.getProperties():{}),e&&e.getGeometry()){l().push(e);var t=e.getGeometry().getExtent(),o=ol.extent.getCenter(t);i().getView().setCenter(o)}},this.deleteGeometry=function(){this.editingCopy.setGeometry(null),a()},this.isEditing=function(){return this.currentPin instanceof r},Object.defineProperty(this,"activeDrawTool",{get:function(){return this._activeDrawTool},set:function(e){this._activeDrawTool=e,angular.isString(e)?f(e):s()}}),e.$on("$destroy",function(){for(var e in y){var t=y[e];t.setActive(!1),i().removeInteraction(t)}})}]),e.controller("pinEditorController",["$scope",function(e){function t(){var t=e.pinsCtrl.editingCopy,r=!0;t&&null!=t.start_time&&null!=t.end_time&&(r=t.start_time<=t.end_time),e.pinForm.$setValidity("range",r)}e.$watch(function(){return e.pinsCtrl.editingCopy},function(t){e.storyPin=t}),e.$watch("pinsCtrl.editingCopy.start_time",t),e.$watch("pinsCtrl.editingCopy.end_time",t),this.isFormValid=function(){return e.pinForm.$valid},this.finish=function(){var t=e.storyPin;return e.storyPin=null,t}}])}(),function(){"use strict";var e=angular.module("storytools.edit.pins.directives",["storytools.core.pins"]);e.directive("pinsEditor",function(){return{restrict:"A",controller:"pinsEditorController",controllerAs:"pinsCtrl",link:function(e,t,r){var o=e.pinsCtrl;if(o.overlay=e.$eval(r.pinsOverlay),null===o.overlay)throw Error("pinsEditor needs pinsOverlay attribute")}}}),e.directive("pinChooser",function(){return{require:"^pinsEditor",restrict:"E",templateUrl:"pins/pin-chooser.html",link:function(e,t,r,o){e.editPin=function(t){o.editStoryPin(t),e.$eval(r.pinSelected,e.$parent)}}}}),e.directive("pinEditor",function(){return{require:"^pinsEditor",controller:"pinEditorController",controllerAs:"pinCtrl",restrict:"A"}}),e.directive("pinEditorForm",function(){return{require:"^pinEditor",restrict:"E",templateUrl:"pins/pin-editor-form.html",link:function(e,t){function r(){if(e.point.latitude&&e.point.longitude){new ol.geom.Point([parseFloat(e.point.longitude),parseFloat(e.point.latitude)]).transform("EPSG:4326",e.map.map.getView().getProjection())}}e.point={},e.showPointCoordinates=function(){return"Point"===e.pinsCtrl.activeDrawTool},e.$watch("storyPin",function(e,r){e!=r&&t[0].querySelector("input[name=title]").focus()}),e.$watch("point",r,!0)}}})}(),function(){"use strict";angular.module("storytools.edit.pins",["storytools.edit.time.directives","storytools.edit.pins.directives","storytools.edit.pins.controllers","ui.bootstrap"])}(),function(){"use strict";angular.module("storytools.edit.style",["storytools.edit.style.services","storytools.edit.style.directives","storytools.edit.style.controllers","storytools.edit.templates","ui.bootstrap"])}(),function(){"use strict";var e=angular.module("storytools.edit.time.directives",[]);e.directive("stDateTimeField",function(){return{restrict:"E",templateUrl:"time/date-time-field.html",scope:{dateTime:"=",currentTime:"="},link:function(e){e.open=function(t){t.preventDefault(),t.stopPropagation(),e.opened=!0}}}}),e.directive("isoDateTime",["$log",function(e){return{restrict:"A",require:"ngModel",link:function(t,r,o,n){n.$formatters.push(function(e){var t=null!=e?new Date(e).toISOString():"";return t}),n.$parsers.push(function(e){var t=Date.parse(e),r=!isNaN(t);return n.$setValidity("dateTime",r),r?t:null}),t.setFromCurrentTime=function(){t.currentTime?n.$modelValue=t.currentTime:e.error("no current time provided!")}}}}])}(),function(){"use strict";angular.module("storytools.edit.time",["storytools.edit.time.directives","storytools.edit.templates"])}(),function(){"use strict";function e(e,t,r,o){for(var n={},i=t.getElementsByTagName(e+"CssParameter"),l=0,s=i.length;s>l;l++){var a=i[l],c=a.getAttribute("name");if(void 0!==r[c]){var u=a.childNodes[0].nodeValue;void 0!==o[c]&&(u=o[c](u)),n[r[c]]=u}}return n}function t(e,t){var r=e.getElementsByTagName(t)[0];return r.childNodes[0].nodeValue}function r(e,t){return e.getElementsByTagName(t).length>0}function o(e,r){var o=r.getElementsByTagName(e+"Rotation")[0];return t(o,"ogc:PropertyName")}function n(n,i){if(!r(i,n+"Fill"))return{};var l=i.getElementsByTagName(n+"Fill")[0],s=e(n,l,{fill:"fillColor","fill-opacity":"fillOpacity"},{"fill-opacity":function(e){return 100*parseFloat(e)}});return r(i,n+"Size")&&(s.size=parseInt(t(i,n+"Size"))),r(i,n+"WellKnownName")&&(s.shape=t(i,n+"WellKnownName")),r(i,n+"Rotation")&&(s.rotationAttribute=o(n,i)),s}function i(t,o){if(!r(o,t+"Stroke"))return{};var n=o.getElementsByTagName(t+"Stroke")[0];return e(t,n,{stroke:"strokeColor","stroke-opacity":"strokeOpacity","stroke-dasharray":"strokeStyle","stroke-width":"strokeWidth"},{"stroke-opacity":function(e){return 100*parseFloat(e)},"stroke-width":function(e){return parseInt(e)},"stroke-dasharray":function(e){return"5.0"===e?"dashed":"1.0 2.0"===e?"dotted":"solid"}})}function l(e){if(!r(e,"ogc:Filter"))return{};var o=e.getElementsByTagName("ogc:Filter")[0];return{name:t(e,"sld:Name"),property:t(o,"ogc:PropertyName"),value:t(o,"ogc:Literal")}}function s(o,n){var i=n.getElementsByTagName(o,"TextSymbolizer"),l={};if(i.length>0){i=i[0],r(i,o+"Label")&&(l.attribute=t(i.getElementsByTagName(o+"Label")[0],"ogc:PropertyName"));for(var s=0,a=i.childNodes.length;a>s;s++){var c=i.childNodes[s];c.tagName===o+"Fill"&&(l=Object.assign(l,e(o,c,{fill:"fillColor"},{})))}if(r(i,o+"Font")){var u=i.getElementsByTagName(o+"Font")[0];l=Object.assign(l,e(o,u,{"font-family":"fontFamily","font-size":"fontSize","font-style":"fontStyle","font-weight":"fontWeight"},{"font-size":parseInt}))}}return l}var a=angular.module("storytools.edit.style.controllers",[]);a.controller("styleEditorController",["$scope","stStyleTypes","stStyleChoices","stLayerClassificationService","stStyleRuleBuilder",function(e,t,r,o,a){function c(){var t=e.activeStyle;o.classify(e.layer,t.classify.attribute,t.classify.method,t.classify.maxClasses).then(function(e){t.rules=e,a.buildRuleStyles(t)})}function u(t){for(var r=0,o=0,n=e.styleTypes.length;n>o;o++){var i=e.styleTypes[o].name;e.styleTypes[o].active=!1,i.indexOf(t)>=0&&(r=o)}return e.styleTypes[r]}function f(e,t){var r=function(r){return t.getElementsByTagName(e+r).length};return r("RasterSymbolizer")>0||r("Transformation")>0||r("Rule")>13}function y(t){var r=t.defaultStyle.href;r&&(r="/gs/"+r.split("/geoserver/")[1],r=r.replace(".json",".sld"),fetch(r,{credentials:"same-origin"}).then(function(t){t.text().then(function(t){var r=new DOMParser,o=r.parseFromString(t,"application/xml"),a="";"sld:"===o.documentElement.tagName.substring(0,4)&&(a="sld:"),e.warning=!1,f(a,o)&&(e.warning="WARNING! This style is complex and any changes saved here will cause that style to be LOST!");var c,y,d,p,g,h=o.getElementsByTagName(a+"Rule");if(1===h.length){y=h[0],d=i(a,y);for(c in d)e.activeStyle.stroke[c]=d[c];p=n(a,y);for(c in p)e.activeStyle.symbol[c]=p[c];g=s(a,y);for(c in g)e.activeStyle.label[c]=g[c]}else if(h.length>1){y=h[0],p=n(a,y);for(c in p)e.activeStyle.symbol[c]=p[c];d=i(a,y);for(c in d)e.activeStyle.stroke[c]=d[c];g=s(a,y);for(c in g)e.activeStyle.label[c]=g[c];var v=l(y);e.activeStyle.classify={attribute:v.property,method:"unique",maxClasses:h.length};var b=u("unique-");b.active=!0,e.activeStyle.typeName=b.name,p.fillOpacity&&(e.activeStyle.classify.opacity=p.fillOpacity);for(var S=[],C=0,x=h.length;x>C;C++){y=h[C],v=l(y);var E={name:v.name,value:v.value,style:{}};"unique-point"===b.name||"unique-polygon"===b.name?(E.style.symbol=n(a,y),delete E.style.symbol.size):"unique-line"===b.name&&(E.style.stroke=i(a,y)),S.push(E)}e.activeStyle.rules=S,e.layer.set("style",e.activeStyle),m(b)}})}))}function d(r){e.layer=r,e.meta=r.get("metadata"),e.hasStyle=!1,e.styleTypes=t.getTypes(r,e.layerstyles);for(var o=0,n=e.styleTypes.length;n>o;o++)e.styleTypes[o].active=!1;if(e.styleTypes.length>0){var i=p();e.styleTypes[i].active=!0,m(e.styleTypes[i])}console.log("style types...",e.styleTypes),e.$watch("meta",function(t){!e.hasStyle&&t.defaultStyle&&(e.hasStyle=!0,y(t))},!0)}function p(){var t=e.layer.get("style")||b.getSavedStyle(e.layer);if(t)for(var r=0;r<e.styleTypes.length;r++)if(t.typeName===e.styleTypes[r].name)return r;return 0}function m(t){e.currentEditor=t,e.activeStyle=g(t)}function g(r){var o,n=e.layer.get("style")||b.getSavedStyle(e.layer);if(r.name in v)o=v[r.name];else{var i=e.styleTypes.filter(function(e){return e.name==r.name});if(0===i.length)throw"invalid style type: "+r.name;o=t.createStyle(i[0])}return goog.isDefAndNotNull(n)&&n.typeName==o.typeName&&(o.symbol=n.symbol,o.stroke=n.stroke,o.classify=n.classify||null,o.rules=n.rules||null),o}function h(t){var r=e.styleTypes.length,o=p(),n=o+t;0>n?n=r-1:n>=r&&(n=0);for(var i=0;r>i;i++)e.styleTypes[i].active=i===n;m(e.styleTypes[n])}var v={},b=storytools.edit.styleStorageService.styleStorageService();e.styleChoices=r,void 0!==e.updateStyleChoices&&(e.styleChoices=e.updateStyleChoices(r)),d(e.layer),e.setActiveStyle=m,e.$watch(function(){var t=e.styleTypes.filter(function(e){return e.active});return t[0]},function(e,t){e&&e!==t&&m(e)}),e.$watch("layer",function(e,t){e!=t&&d(e)}),e.$on("featuretype-added",function(){d(e.layer)}),e.changeClassifyProperty=function(t,r){t&&(e.activeStyle.classify[t]=r),c()},e.$watch("activeStyle",function(){if(e.editorForm.$valid){var t=e.layer.get("style");t&&t.readOnly===!0?(delete t.readOnly,e.activeStyle=t):e.layer.set("style",e.activeStyle),(e.onChange||angular.noop)(e.layer)}},!0),e.onPrev=function(){h(-1)},e.onNext=function(){h(1)},e.$watch("editorForm.$valid",function(){(e.formChanged||angular.noop)(e.editorForm)})}])}(),function(){"use strict";function e(e,r,o,n){t.directive(e,["stStyleChoices",function(){return{restrict:"E",scope:{stModel:"=",property:"@",popover:"@popoverText"},templateUrl:"style/widgets/"+r,link:function(e,t,r){if(e.layer=e.$parent.layer,e.$parent.activeStyle){var i=e.$parent.activeStyle.typeName;e.hideStrokeWidth="graduated-line"===i?!0:!1}e.$watch(function(){return e.$parent.layer},function(t){e.layer=t}),e.model=e.stModel[o||e.property],e.updateProperty=function(t){e.$parent.activeStyle[[o||e.property]]=t},e.styleChoices=e.$parent.styleChoices,n&&n(e,t,r)}}}])}var t=angular.module("storytools.edit.style.directives",[]);t.directive("carouselNext",function(){return{restrict:"A",scope:{onNext:"="},require:["^carousel"],link:function(e,t,r,o){function n(){return i.indexOfSlide(i.currentSlide)+1===i.slides.length?0:i.indexOfSlide(i.currentSlide)+1}var i=o[0];t.bind("click",function(){var t=n(),r=i.slides[t];e.onNext&&e.onNext(r.$parent.styleType),i.select(r)})}}}),t.directive("carouselPrev",function(){return{restrict:"A",scope:{onPrev:"="},require:["^carousel"],link:function(e,t,r,o){function n(){return 0===i.indexOfSlide(i.currentSlide)?i.slides.length-1:i.indexOfSlide(i.currentSlide)-1}var i=o[0];t.bind("click",function(){var t=n(),r=i.slides[t];e.onPrev&&e.onPrev(r.$parent.styleType),i.select(r)})}}}),t.directive("styleEditor",function(){return{restrict:"E",templateUrl:"style/style-editor.html",controller:"styleEditorController",require:"?styleEditorController",scope:{layer:"=",onChange:"=",formChanged:"=",control:"=",layerstyles:"=",updateStyleChoices:"="}}}),t.directive("attributeCombo",["$log",function(e){return{restrict:"E",templateUrl:"style/widgets/attribute-combo.html",scope:{layer:"=",model:"=stModel",onChange:"=?",css:"@css"},link:function(t,r,o){function n(){var r=[];t.layer?(t.layer.get("attributes").forEach(function(t){var n=!0;"nogeom"===o.filter?n="http://www.opengis.net/gml"!==t.typeNS:"number"===o.filter?n="integer"===t.type||"int"===t.type||"double"===t.type||"long"===t.type:"unique"===o.filter?n="string"===t.type:o.filter&&e.warn("unknown filter",o.filter),o.include&&(n=o.include.indexOf(t.type)>=0),n&&r.push(t.name)}),r.sort(),t.attributes=r):t.attributes=[]}t.$watch("layer",function(e,t){e!=t&&n()}),n(),t.property=o.property||"attribute",t.onChange||(t.onChange=function(e,r){t.model[e]=r})}}}]),e("symbolEditor","symbol-editor.html","symbol",function(e,t,r){["showGraphic","showRotation","hideColor"].forEach(function(t){e[t]=r[t]}),e.getSymbolizerText=function(e){return e.shape||e.graphic},e.getSymbolizerImage=function(){return""}}),e("strokeEditor","stroke-editor.html","stroke"),e("numberEditor","number-editor.html",null,function(e,t,r){function o(r){var o=t.find("input"),n=Number(o.attr("min"))||0,i=Number(o.attr("max")),l=Number(o.attr("step"))||1,s=e.stModel[e.property],a=r.detail||r.wheelDelta;s=Math.min(i,s+(a>0?-l:l)),s=Math.max(n,s),e.$apply(function(){e.stModel[e.property]=s})}var n={max:30,min:0,step:1};Object.keys(n).forEach(function(t){e[t]=r[t]||n[t]}),t[0].addEventListener("DOMMouseScroll",o,!1),t[0].addEventListener("mousewheel",o,!1),t[0].addEventListener("change",function(){var r=t.find("input"),o=Number(r.attr("min"))||0,n=Number(r.attr("max")),i=e.stModel[e.property];o>i?e.$apply(function(){e.stModel[e.property]=o}):i>n&&e.$apply(function(){e.stModel[e.property]=n})})}),e("colorEditor","color-editor.html"),e("labelEditor","label-editor.html","label",function(e){e.toggleValue=function(t){"fontWeight"===t?e.model.fontWeight="bold"===e.model.fontWeight?"normal":"bold":"fontStyle"===t&&(e.model.fontStyle="italic"===e.model.fontStyle?"normal":"italic")}}),t.directive("graphicEditor",["stStyleChoices","ol3MarkRenderer","iconCommons","iconCommonsSearch","stSvgIcon",function(e,t,r,o,n){return{restrict:"E",templateUrl:"style/widgets/graphic-editor.html",scope:{symbol:"="},link:function(i,l){function s(e){var r=angular.element(t(e,24));return r.addClass("symbol-icon"),r.attr("mark",e),r}function a(e){var t=angular.element("<img>");return t.attr("src",e.dataURI),t.addClass("symbol-icon"),t.attr("graphic",e.uri),t}function c(){var e=angular.element(l[0].querySelector("[data-current-symbol]"));e.find("*").remove(),i.symbol.shape?e.append(s(i.symbol.shape)):i.symbol.graphic&&n.getImage(i.symbol.graphic,"#000","#fff").then(function(t){e.append(a(t))})}function u(){y=angular.element(l[0].getElementsByClassName("recent-icons")),y.html(""),r.defaults().then(function(e){e.forEach(function(e){var t=a(e);t.on("click",f),y.append(t)}),i.recent=e})}var f=function(){var e=angular.element(this);e.attr("shape")?(i.symbol.shape=e.attr("shape"),i.symbol.graphic=null):e.attr("graphic")&&(i.symbol.shape=null,i.symbol.graphic=e.attr("graphic")),c()},y=angular.element(l[0].getElementsByClassName("ol-marks"));e.symbolizers.forEach(function(e){var t=s(e);t.attr("shape",e),t.on("click",f),y.append(t)}),i._updateRecent=function(){u(),c()},i._updateRecent(),i.showIconCommons=function(){o.search().then(function(e){n.getImageData(e.href).then(function(){i.symbol.shape=null,i.symbol.graphic=e.href,i._updateRecent()})})},i.$watch("symbol.shape",function(){c()})}}}]),t.directive("classifyEditor",function(){return{restrict:"E",templateUrl:"style/widgets/classify-editor.html",scope:!0,link:function(e,t,r){["showMethod","showMaxClasses","showRange","showColorRamp","showColorPalette","attributeFilter"].forEach(function(t){e[t]=r[t]})}}}),t.directive("colorRamp",function(){return{restrict:"A",scope:{ramp:"=ramp"},link:function(e,t,r){function o(){var o=t[0].getContext("2d"),n=o.createLinearGradient(0,0,r.width,0);Object.getOwnPropertyNames(e.ramp).forEach(function(t){t=parseFloat(t),isNaN(t)||n.addColorStop(t,e.ramp[t])}),o.fillStyle=n,o.fillRect(0,0,r.width,r.height)}e.$watch("ramp",o),o()}}}),t.directive("colorField",function(){function e(e){return t.exec(e)}var t=/(^#[0-9a-f]{6}$)|(^#[0-9a-f]{3}$)/i;return{restrict:"A",require:"ngModel",link:function(t,r,o,n){n.$parsers.push(function(t){return n.$setValidity("color",e(t)),t}),n.$formatters.push(function(t){return n.$setValidity("color",e(t)),t})}}}),t.directive("noClose",function(){return{link:function(e,t){t.on("click",function(e){e.stopPropagation()})}}}),t.directive("styleTypeEditor",["$compile","$templateCache",function(e,t){return{restrict:"E",link:function(r,o){r.$watch("currentEditor",function(){var n=r.currentEditor;if(r.currentEditor){var i="style/types/"+n.name.replace(" ","-")+".html";o.html(t.get(i)),e(o.contents())(r)}else o.html("")})}}}]),t.directive("rulesEditor",function(){return{restrict:"E",templateUrl:"style/rules-editor.html",link:function(e){e.deleteRule=function(t){e.activeStyle.rules=e.activeStyle.rules.filter(function(e){return e!==t})}}}})}(),function(){"use strict";var e=angular.module("storytools.edit.style.iconCommons",[]);e.factory("iconCommons",["$q","stSvgIcon","stRecentChoices",function(e,t,r){return{defaults:function(){return e.all(r.icons.recent.map(function(e){return t.getImage(e)}))}}}]),e.factory("iconCommonsSearch",["$http","$modal","$injector","$location",function(e,t,r,o){function n(e){for(var t=e.icons||e,r=0,o=t.length;o>r;r++)t[r].href=i+t[r].href;return e}var i=r.has("iconCommonsHost")?r.get("iconCommonsHost"):o.protocol()+"://"+o.host();return{tagEndpoint:i+"/icons/icon",search:function(){return this.modal=t.open({size:"lg",controller:"iconCommonsController",templateUrl:"style/widgets/icon-commons-search.html"}),this.modal?this.modal.result:null},getCollections:function(){return e.get(i+"/icons/collections").success(function(e){return n(e)})},getMore:function(t){var r=t.href;return 0!==r.indexOf(i)&&(r=i+r),e.get(r,{params:{page:t._nextPage}}).success(function(e){return n(e)})},getCollectionIcons:function(t){var r={};return t._nextPage&&(r.page=t._nextPage),e.get(i+t.href,{params:r}).success(function(e){return n(e)})},getByTag:function(t){return e.get(this.tagEndpoint,{params:{tag:t}}).success(function(e){return n(e)})},getTags:function(t){return e.get(i+"/icons/search/tags",{params:{query:t}}).then(function(e){return e.data.tags})}}}]),e.controller("iconCommonsController",["$scope","iconCommonsSearch","stRecentChoices",function(e,t,r){function o(t,r){var o=r.data.icons;t._icons=t._icons?t._icons.concat(o):o,t._more=r.data.page<r.data.pages,t._nextPage=r.data.page+1,e.icons=t}var n={href:t.tagEndpoint},i={};e.loadMore=function(){t.getMore(e.icons).then(function(t){o(e.icons,t)})},e.close=function(){r.icons.add(e.selectedIcon.href),t.modal.close(e.selectedIcon)},e.dismiss=function(){t.modal.dismiss()},e.tagSelect=function(e){n._icons=[],t.getByTag(e).then(function(e){o(n,e)})},e.viewCollections=function(){e.icons=i},e.viewTags=function(){e.icons=n},e.collectionSelect=function(e){e._icons=[],t.getCollectionIcons(e).then(function(t){o(e,t)})},e.iconSelected=function(t,r){e.selectedIcon=t,r&&e.close()},e.selectedClass=function(t){return t===e.selectedIcon?"active":null},e.getTags=t.getTags,t.getCollections().then(function(t){e.collections=t.data.collections})}])}(),function(){"use strict";var e=angular.module("storytools.edit.style.layerClassificationService",[]);e.factory("stLayerClassificationService",["$q","$http","$modal","$sce","$log",function(e,t,r,o,n){return{classify:function(i,l,s,a){this.cache||(this.cache={});var c;if(null===l||null===s)return c=e.defer(),c.reject("Not enough info to perform WPS request."),c.promise;var u=i.get("id")+"|"+l+"|"+s+"|"+a;if(this.cache[u])return c=e.defer(),c.resolve(this.cache[u]),c.promise;var f,y=this,d=new storytools.edit.WPSClassify.WPSClassify,p=i.get("path")+"wps";if("unique"===s)return f=d.getUniqueValues({featureNS:i.get("featureNS"),typeName:i.get("typeName"),featurePrefix:i.get("featurePrefix"),attribute:l},!0),t({url:p,method:"POST",data:f,headers:{"Content-Type":"application/xml"}}).then(function(e){var t=[];if(e.data&&e.data.features)for(var r=0,o=Math.min(e.data.features.length,a);o>r;++r){var n=e.data.features[r];t.push({name:n.properties.value,value:n.properties.value})}return y.cache[u]=t,t});var m;return"Natural Breaks"===s?m="NATURAL_BREAKS":"Equal Interval"===s?m="EQUAL_INTERVAL":"Quantile"===s&&(m="QUANTILE"),void 0!==m?(f=d.classifyVector({featureNS:i.get("featureNS"),typeName:i.get("typeName"),featurePrefix:i.get("featurePrefix"),attribute:l,numClasses:a,method:m},!0),t({url:p,method:"POST",data:f,headers:{"Content-Type":"application/xml"}}).then(function(e){var t=d.parseResult(e.data);return t.success===!0?(y.cache[u]=t.rules,t.rules):(r.open({templateUrl:"error-dialog.html",controller:["$scope",function(e){e.title="Error",e.msg=o.trustAsHtml("An error occurred when communicating with the classification service: <br/>"+t.msg)}]}),n.warn(t.msg),[])})):void 0}}}])}(),function(){"use strict";var e=angular.module("storytools.edit.style.services",["storytools.core.style","storytools.edit.style.styleRuleBuilder","storytools.edit.style.styleChoices","storytools.edit.style.styleTypes","storytools.edit.style.layerClassificationService","storytools.edit.style.iconCommons"]);e.factory("WPSClassify",[storytools.edit.WPSClassify]),e.factory("SLDStyleConverter",[storytools.edit.SLDStyleConverter]),e.factory("WFSDescribeFeatureType",[storytools.edit.WFSDescribeFeatureType]),e.factory("StyleComplete",[storytools.edit.StyleComplete]),e.factory("styleStorageService",[storytools.edit.styleStorageService])}(),function(){"use strict";function e(e,t){this._max=t,this._key="stRecentChoices-"+e;var r=localStorage.getItem(this._key);this.recent=r?JSON.parse(r):[]}var t=angular.module("storytools.edit.style.styleChoices",[]);t.factory("stStyleChoices",function(){return{symbolizers:["circle","square","triangle","star","cross","x"],rotationUnits:["degrees","radians"],strokeStyle:["solid","dashed","dotted"],fontFamily:["serif","sans-serif","cursive","monospace"],colorRamps:[{0:"#fff7ec",1:"#7f0000"},{0:"#fff7fb",1:"#023858"},{0:"#ffffe5",1:"#004529"},{0:"#ffffff",1:"#000000"},{0:"#ffffe5",1:"#662506"},{0:"#fff7f3",1:"#49006a"},{0:"#f7fb77",1:"#08306b"}],colorPalettes:[{name:"Basic",vals:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6"]},{name:"Light",vals:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd","#fddaec","#f2f2f2"]},{name:"Dark",vals:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628","#f781bf","#999999"]},{name:"Pastel",vals:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9"]}],classMethods:["Natural Breaks","Equal Interval","Quantile"],getPalette:function(e){var t=this.colorPalettes.filter(function(t){return t.name===e});return t.length?t[0]:null}}}),t.factory("stRecentChoices",function(){return{icons:new e("icons",24)}}),e.prototype.clear=function(){this.recent=[],localStorage.setItem(this._key,JSON.stringify(this.recent))},e.prototype.add=function(e){-1===this.recent.indexOf(e)&&(this.recent.push(e),this.recent.length>this._max&&this.recent.shift(),localStorage.setItem(this._key,JSON.stringify(this.recent)))}}(),function(){"use strict";var e=angular.module("storytools.edit.style.styleRuleBuilder",["storytools.edit.style.styleTypes","storytools.edit.style.styleChoices"]);e.factory("stStyleRuleBuilder",["stStyleTypes","stStyleChoices",function(e,t){function r(e){return("00"+e.toString(16)).slice(-2)}function o(e,t){function o(){return[i[0],i[1]]}if(1===t)return[e[0]];var n=[],i=Object.keys(e).filter(function(e){return"$"!=e.toString().charAt(0)});i.sort();for(var l=i.map(function(t){var r=e[t];return[parseInt("0x"+r.substr(1,2)),parseInt("0x"+r.substr(3,2)),parseInt("0x"+r.substr(5,2))]}),s=1/(t-1),a=0;t>a;a++){var c=a*s,u=o(c),f=(c-u[0])/(u[1]-u[0]),y=l[u[0]],d=l[u[1]],p=Math.floor(y[0]+(d[0]-y[0])*f),m=Math.floor(y[1]+(d[1]-y[1])*f),g=Math.floor(y[2]+(d[2]-y[2])*f);n.push("#"+r(p)+r(m)+r(g))}return n}function n(e,t){var r=t.styleType.rule,o={};angular.forEach(r,function(e,r){var n={};angular.forEach(e,function(e,r){var o=null;switch(e){case"color":t.colors&&(o=t.colors[t.index%t.colors.length]);break;case"range":t.rangeStep&&(o=Math.round(t.rangeStep*t.index));break;case"opacity":t.style.classify.opacity&&(o=t.style.classify.opacity);break;default:throw"invalid copySource "+e}null!==o&&(n[r]=o)}),o[r]=n}),e.style=o}return{_colorRampValues:o,buildRuleStyles:function(r){var i,l;if(r.classify){if(r.classify.colorRamp)i=o(r.classify.colorRamp,r.rules.length);else if(r.classify.colorPalette){var s=t.getPalette(r.classify.colorPalette);i=s.vals}r.classify.range&&(l=(r.classify.range.max-r.classify.range.min)/r.rules.length)}var a={colors:i,rangeStep:l,style:r,styleType:e.getStyleType(r.typeName)};r.rules.forEach(function(e,t){a.index=t,n(e,a)})}}}])}(),function(){"use strict";var e=angular.module("storytools.edit.style.styleTypes",[]),t={size:10,shape:"circle",graphic:null,graphicType:null,fillColor:"#dd1c77",fillOpacity:70,rotationAttribute:null,rotationUnits:"degrees"},r={strokeColor:"#000000",strokeWidth:1,strokeStyle:"solid",strokeOpacity:100},o={attribute:null,fillColor:"#333333",fontFamily:"Serif",fontSize:10,fontStyle:"normal",fontWeight:"normal",placement:"point"},n={method:"unique",opacity:100,attribute:null,maxClasses:5,colorRamp:null},i={method:null,attribute:null,maxClasses:5,colorRamp:null},l={method:null,attribute:null,maxClasses:5,range:{min:0,max:16}},s=[{name:"simple-point",displayName:"Simple",prototype:{geomType:"point"}},{name:"unique-point",displayName:"Unique",prototype:{geomType:"point",classify:n},rule:{symbol:{fillOpacity:"opacity",fillColor:"color"}}},{name:"class-point",displayName:"Choropleth",prototype:{geomType:"point",classify:i},rule:{symbol:{fillColor:"color"}}},{name:"graduated-point",displayName:"Graduated",prototype:{geomType:"point",classify:l},rule:{symbol:{size:"range"}}},{name:"simple-line",displayName:"Simple",prototype:{geomType:"line"}},{name:"unique-line",displayName:"Unique",prototype:{geomType:"line",classify:n},rule:{stroke:{strokeColor:"color"}}},{name:"graduated-line",displayName:"Graduated",prototype:{geomType:"line",classify:l},rule:{stroke:{strokeColor:"color",strokeWidth:"range"}}},{name:"simple-polygon",displayName:"Simple",prototype:{geomType:"polygon"}},{name:"unique-polygon",displayName:"Unique",prototype:{geomType:"polygon",classify:n},rule:{symbol:{fillOpacity:"opacity",fillColor:"color"}}},{name:"class-polygon",displayName:"Choropleth",prototype:{geomType:"polygon",classify:i},rule:{symbol:{fillColor:"color"}}}];e.run(["$injector",function(e){if(e.has("stStyleDefaults")){var o=e.get("stStyleDefaults");[t,r].forEach(function(e){Object.keys(e).forEach(function(t){t in o&&(e[t]=o[t])})})}}]),e.factory("stStyleTypes",function(){return{getTypes:function(e,t){var r=angular.copy(s).filter(function(t){var r=e.get("geomType")||e.get("metadata").geomType;return t.prototype.geomType===r});return void 0!==t&&(r=r.filter(function(e){return t.indexOf(e.name)>=0})),r},getStyleType:function(e){var t=s.filter(function(t){return t.name==e});if(t.length>1)throw"duplicate type names!";return 0===t.length?null:t[0]},createStyle:function(e){var n={symbol:e.symbol||t,stroke:e.stroke||r,label:o,typeName:e.name},i=angular.extend({},angular.copy(n),e.prototype);return"classify"in i&&(i.rules=e.rules||[]),i}}})}();

@@ -1,6 +0,2 @@

angular.module("storytools.edit.templates", []).run(["$templateCache", function($templateCache) {$templateCache.put("pins/pin-chooser.html","<div><table class=\"table table-condensed\"><thead><tr><th></th><th>Title</th><th>Start Time</th><th>End Time</th><th>Geometry</th><th>In Map</th><th>In Timeline</th><th></th></tr></thead><tbody><tr ng-repeat=\"pin in pinsCtrl.StoryPinLayerManager.storyPins\" ng-class=\"pinsCtrl.currentPin == pin ? \'active\' : \'\'\"><td><i ng-click=editPin(pin) style=\"cursor: pointer;\" class=\"glyphicon glyphicon-edit\"></i></td><td>{{ pin.title }}</td><td>{{ pin.start_time|isodate }}</td><td>{{ pin.end_time|isodate }}</td><td>{{ pin.getGeometry().getType() }}</td><td>{{ pin.in_map }}</td><td>{{ pin.in_timeline }}</td><td><i ng-click=pinsCtrl.deleteStoryPin(pin) style=\"cursor: pointer;\" class=\"glyphicon glyphicon-trash\"></i></td></tr></tbody></table></div>");
$templateCache.put("pins/pin-editor-form.html","<form name=pinForm class=\"form form-horizontal pin-editor-form\"><div class=form-group><label for=storyPinTitle>StoryPin Title</label> <input name=title ng-required=true ng-model=storyPin.title class=form-control type=text id=storyPinTitle placeholder=Title></div><div class=form-group><label for=storyPinAbstract>Content</label> <textarea ng-model=storyPin.content id=storyPinAbstract class=form-control rows=2 placeholder=Content></textarea></div><hr><div class=form-group><label>Location</label><div><div class=\"btn-group nopad\"><button class=btn ng-model=pinsCtrl.activeDrawTool btn-radio=\"\'Point\'\">Point</button> <button class=btn ng-model=pinsCtrl.activeDrawTool btn-radio=\"\'LineString\'\">Line</button> <button class=btn ng-model=pinsCtrl.activeDrawTool btn-radio=\"\'Polygon\'\">Polygon</button></div><div ng-if=storyPin.getGeometry() class=\"btn-group nopad pull-right\"><button class=btn ng-class=\"pinsCtrl.activeDrawTool == \'Modify\' ? \'active\' : null\" ng-click=\"pinsCtrl.activeDrawTool = \'Modify\'\">Edit</button> <button class=btn ng-click=pinsCtrl.deleteGeometry()>Delete</button></div></div></div><hr><div class=form-group><label>Start Time</label><st-date-time-field date-time=storyPin.start_time></st-date-time-field></div><div class=form-group><label>End Time</label><st-date-time-field date-time=storyPin.end_time></st-date-time-field></div><div ng-if=pinForm.$error.range class=ng-invalid>Start must be before End</div><table ng-if=showPointCoordinates() class=\"table table-bordered table-condensed table-hover\" style=\"background-color: white\"><tbody><tr><td>Latitude</td><td><input ng-model=point.latitude class=form-control type=number placeholder=DD.MMSSSS></td></tr><tr><td>Longitude</td><td><input ng-model=point.longitude class=form-control type=number placeholder=DD.MMSSSS></td></tr></tbody></table><hr><div class=form-group><label>Options</label><div><div class=checkbox><input ng-model=storyPin.in_timeline id=showInTimeline type=checkbox> <label for=showInTimeline>Show in Timeline</label></div><div class=checkbox><input ng-model=storyPin.in_map id=showInMap type=checkbox> <label for=showInMap>Show in Map</label></div></div></div></form>");
$templateCache.put("style/rules-editor.html","<div class=style-editor-item><div class=title>Rules</div><table class=controls><tbody><tr ng-repeat=\"rule in activeStyle.rules\" class=style-rule><td>{{ rule.name}}</td><td><color-editor st-model=rule.style.symbol property=fillColor ng-if=rule.style.symbol.fillColor></color-editor><color-editor st-model=rule.style.stroke property=strokeColor ng-if=rule.style.stroke.strokeColor></color-editor><number-editor st-model=rule.style.symbol property=size ng-if=\"rule.style.symbol.size != null\"></number-editor></td><td><button type=button ng-click=deleteRule(rule)>&times;</button></td></tr></tbody></table></div>");
$templateCache.put("style/style-editor.html","<form name=editorForm><div class=style-panel ng-repeat=\"styleType in styleTypes\" ng-show=styleType.active><div class=slide-title><a class=prev ng-click=onPrev()><i class=\"glyphicon glyphicon-chevron-left\"></i></a> {{ styleType.displayName }} <a class=next ng-click=onNext()><i class=\"glyphicon glyphicon-chevron-right\"></i></a></div><div class=\"item {{styleType.displayName|lowercase}}\" data-slide-number={{$index}}></div></div><div><div class=\"warning text-danger\" ng-if=warning>{{ warning }}</div><style-type-editor ng-if=layer></style-type-editor><rules-editor ng-if=activeStyle.rules></rules-editor></div></form>");
$templateCache.put("boxes/bounds-editor.html","<div><div class=\"box-bounds-map col-lg-4\" style=\"height: 10em;\"></div><button>Use Current Map Bounds</button> <button>Use Combined Bounds of Selected Layers</button></div>");
angular.module("storytools.edit.templates", []).run(["$templateCache", function($templateCache) {$templateCache.put("boxes/bounds-editor.html","<div><div class=\"box-bounds-map col-lg-4\" style=\"height: 10em;\"></div><button>Use Current Map Bounds</button> <button>Use Combined Bounds of Selected Layers</button></div>");
$templateCache.put("boxes/box-chooser.html","<div><button ng-click=boxesCtrl.newStoryBox()>New StoryBox</button><table class=\"table table-condensed\"><thead><tr><th>Title</th><th>Start Time</th><th>End Time</th><th>Delete</th></tr></thead><tbody><tr ng-class=\"boxesCtrl.editingBox == box ? \'active\' : \'\'\" ng-repeat=\"box in boxesCtrl.boxes\"><td ng-click=boxesCtrl.editBox(box) style=\"cursor: pointer;\">{{ box.title }}</td><td>{{ box.start }}</td><td>{{ box.end }}</td><td><i ng-click=boxesCtrl.deleteBox(box) style=\"cursor: pointer;\" class=\"glyphicon glyphicon-trash\"></i></td></tr></tbody></table></div>");

@@ -11,2 +7,6 @@ $templateCache.put("boxes/box-editor.html","<div ng-if=boxesCtrl.editingBox><tabset ng-init=\"boxBoundsEditorSelected = false\" class=clearfix><tab heading=Contents><box-contents-editor></box-contents-editor></tab><tab heading=Bounds select=\"boxBoundsEditorSelected = true\" deselect=\"boxBoundsEditorSelected = false\"><box-bounds-editor selected=boxBoundsEditorSelected></box-bounds-editor></tab><tab heading=Layers><box-layers-editor></box-layers-editor></tab><tab heading=Layout><box-layout-editor></box-layout-editor></tab></tabset><button class=btn-primary ng-click=boxesCtrl.acceptEdit()>OK</button> <button ng-click=boxesCtrl.cancelEdit()>Cancel</button></div>");

$templateCache.put("boxes/layout-editor.html","<div class=todo>Customize layout for the box.</div>");
$templateCache.put("style/rules-editor.html","<div class=style-editor-item><div class=title>Rules</div><table class=controls><tbody><tr ng-repeat=\"rule in activeStyle.rules\" class=style-rule><td>{{ rule.name}}</td><td><color-editor st-model=rule.style.symbol property=fillColor ng-if=rule.style.symbol.fillColor></color-editor><color-editor st-model=rule.style.stroke property=strokeColor ng-if=rule.style.stroke.strokeColor></color-editor><number-editor st-model=rule.style.symbol property=size ng-if=\"rule.style.symbol.size != null\"></number-editor></td><td><button type=button ng-click=deleteRule(rule)>&times;</button></td></tr></tbody></table></div>");
$templateCache.put("style/style-editor.html","<form name=editorForm><div class=style-panel ng-repeat=\"styleType in styleTypes\" ng-show=styleType.active><div class=slide-title><a class=prev ng-click=onPrev()><i class=\"glyphicon glyphicon-chevron-left\"></i></a> {{ styleType.displayName }} <a class=next ng-click=onNext()><i class=\"glyphicon glyphicon-chevron-right\"></i></a></div><div class=\"item {{styleType.displayName|lowercase}}\" data-slide-number={{$index}}></div></div><div><div class=\"warning text-danger\" ng-if=warning>{{ warning }}</div><style-type-editor ng-if=layer></style-type-editor><rules-editor ng-if=activeStyle.rules></rules-editor></div></form>");
$templateCache.put("pins/pin-chooser.html","<div><table class=\"table table-condensed\"><thead><tr><th></th><th>Title</th><th>Start Time</th><th>End Time</th><th>Geometry</th><th>In Map</th><th>In Timeline</th><th></th></tr></thead><tbody><tr ng-repeat=\"pin in pinsCtrl.StoryPinLayerManager.storyPins\" ng-class=\"pinsCtrl.currentPin == pin ? \'active\' : \'\'\"><td><i ng-click=editPin(pin) style=\"cursor: pointer;\" class=\"glyphicon glyphicon-edit\"></i></td><td>{{ pin.title }}</td><td>{{ pin.start_time|isodate }}</td><td>{{ pin.end_time|isodate }}</td><td>{{ pin.getGeometry().getType() }}</td><td>{{ pin.in_map }}</td><td>{{ pin.in_timeline }}</td><td><i ng-click=pinsCtrl.deleteStoryPin(pin) style=\"cursor: pointer;\" class=\"glyphicon glyphicon-trash\"></i></td></tr></tbody></table></div>");
$templateCache.put("pins/pin-editor-form.html","<form name=pinForm class=\"form form-horizontal pin-editor-form\"><div class=form-group><label for=storyPinTitle>StoryPin Title</label> <input name=title ng-required=true ng-model=storyPin.title class=form-control type=text id=storyPinTitle placeholder=Title></div><div class=form-group><label for=storyPinAbstract>Content</label> <textarea ng-model=storyPin.content id=storyPinAbstract class=form-control rows=2 placeholder=Content></textarea></div><hr><div class=form-group><label>Location</label><div><div class=\"btn-group nopad\"><button class=btn ng-model=pinsCtrl.activeDrawTool btn-radio=\"\'Point\'\">Point</button> <button class=btn ng-model=pinsCtrl.activeDrawTool btn-radio=\"\'LineString\'\">Line</button> <button class=btn ng-model=pinsCtrl.activeDrawTool btn-radio=\"\'Polygon\'\">Polygon</button></div><div ng-if=storyPin.getGeometry() class=\"btn-group nopad pull-right\"><button class=btn ng-class=\"pinsCtrl.activeDrawTool == \'Modify\' ? \'active\' : null\" ng-click=\"pinsCtrl.activeDrawTool = \'Modify\'\">Edit</button> <button class=btn ng-click=pinsCtrl.deleteGeometry()>Delete</button></div></div></div><hr><div class=form-group><label>Start Time</label><st-date-time-field date-time=storyPin.start_time></st-date-time-field></div><div class=form-group><label>End Time</label><st-date-time-field date-time=storyPin.end_time></st-date-time-field></div><div ng-if=pinForm.$error.range class=ng-invalid>Start must be before End</div><table ng-if=showPointCoordinates() class=\"table table-bordered table-condensed table-hover\" style=\"background-color: white\"><tbody><tr><td>Latitude</td><td><input ng-model=point.latitude class=form-control type=number placeholder=DD.MMSSSS></td></tr><tr><td>Longitude</td><td><input ng-model=point.longitude class=form-control type=number placeholder=DD.MMSSSS></td></tr></tbody></table><hr><div class=form-group><label>Options</label><div><div class=checkbox><input ng-model=storyPin.in_timeline id=showInTimeline type=checkbox> <label for=showInTimeline>Show in Timeline</label></div><div class=checkbox><input ng-model=storyPin.in_map id=showInMap type=checkbox> <label for=showInMap>Show in Map</label></div></div></div></form>");
$templateCache.put("time/date-time-field.html","<p class=input-group><input type=text iso-date-time class=form-control ng-model=dateTime placeholder=YYYY-MM-DDTHH:mm:ss> <span class=input-group-btn><button ng-click=setFromCurrentTime() title=\"Set From Current Time\"><i class=\"glyphicon glyphicon-time\"></i></button></span></p>");

@@ -13,0 +13,0 @@ $templateCache.put("style/types/class-point.html","<classify-editor attribute-filter=number show-method=true show-max-classes=true show-color-ramp=true></classify-editor><symbol-editor hide-color=true st-model=activeStyle show-graphic=true show-rotation=true></symbol-editor><stroke-editor st-model=activeStyle></stroke-editor><label-editor st-model=activeStyle></label-editor>");

@@ -178,6 +178,6 @@ (function() {

var name = $scope.styleTypes[i].name;
$scope.styleTypes[i].active = false;
if (name.indexOf(matchString) >= 0) {
idx = i;
$scope.styleTypes[i].active = false;
}

@@ -330,2 +330,5 @@ }

$scope.styleTypes = stStyleTypes.getTypes(layer, $scope.layerstyles);
for (var i = 0, ii = $scope.styleTypes.length; i < ii; i++) {
$scope.styleTypes[i].active = false;
}
if ($scope.styleTypes.length > 0) {

@@ -332,0 +335,0 @@ var activeStyleIndex = getStyleTypeIndex();

{
"name": "@boundlessgeo/storytools",
"version": "1.0.0-alpha8",
"version": "1.0.0-alpha9",
"description": "Additional maploom tools",

@@ -5,0 +5,0 @@ "homepage": "",

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc