@c8y/ng1-modules 1016.111.0 → 1016.113.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";!function(){function e(t,n,e,a,i,o,l,c,r){var d,s,u="c8y_Position",g="com_nsn_startups_vendme_fragments_GPSCoordinates",f={},m={icon:{type:"div",className:"normal-marker-icon",iconSize:[25,41],iconAnchor:[12.5,41]},focus:!0,draggable:!0},v={lat:0,lng:0,zoom:11};function b(e){r.getMap("locationId").then(function(e){setTimeout(function(){e.invalidateSize(!0)},500)}),d=e,t.location=D(e)||{};var n=t.location;h(t.location),s=_.clone(n),function(e){return!(!e.lat||!e.lng)}(n)&&C(n)}function h(e){var n=_.get(e,"lat"),t=_.get(e,"lng"),a=_.get(e,"alt");_.set(e,"lat",_.toNumber(n)),_.set(e,"lng",_.toNumber(t)),_.isUndefined(a)||_.set(e,"alt",_.toNumber(a))}function p(e){var n=e.latLng;if(n){var t={lat:Number(n.lat),lng:Number(n.lng),zoom:17};C(t),y(t),N(t)}}function $(){i.detailCached(function(){var e=_.get(t,"child.config.device");return e&&(m.draggable=!1),_.get(e,"id",n.deviceId)}()).then(function(e){return _.cloneDeep(e.data)}).then(b)}function C(e){_.assign(m,{lat:parseFloat(e.lat),lng:parseFloat(e.lng)}),N(f.main=m)}function y(e){_.assign(t.location,{lat:parseFloat(e.lat),lng:function(e){var n=e%360;return n<-180?360+n:180<n?n-360:n}(parseFloat(e.lng))})}function A(e){return i.isVendme(e)?g:u}function D(e){return e[A(e)]}function N(e){var n=e||m;_.assign(t.center,n)}_.assign(t,{settings:{},markers:f,mapDefaults:{scrollWheelZoom:!1},centerMap:N,center:v,pattern:{latitude:/^[-+]?([1-8]?\d(\.\d+)?|90(\.0+)?)$/,longitude:/^[-+]?(180(\.0+)?|((1[0-7]\d)|([1-9]?\d))(\.\d+)?)$/,altitude:/^[-+]?(0|([1-9]\d*))(\.\d+)?$/},events:{markers:{enable:["dragend"]}},gotoAddress:function(e){a.geoCode(e).then(function(e){var n=_.get(e,"data.results[0].locations[0]");return n||l.warning(c("Address could not be found.")),n||null}).then(p)},cancel:function(){t.noeditable=!t.noeditable,_.isEqual(t.location,s)||(t.location=_.clone(s))},save:function(){t.noeditable=!t.noeditable;var e={id:d.id},n=_.clone(D(d));delete n.address,e[A(d)]=n,h(e[A(d)]),i.save(e).then(function(){l.success(c("Location saved."))}).then($)},realtimeChannel:"/managedobjects/".concat(void 0!==n.deviceId?n.deviceId:"*"),invalid:angular.bind(e,e.invalid,t),id:t.$id}),t.$on("leafletDirectiveMarker.locationId.dragend",function(e,n){y(n.model)}),t.$watch("child.config.device",$),o.addListener(t.$id,t.realtimeChannel,"".concat(t.$id,"-subscribed"),function(){$()}),o.addListener(t.$id,t.realtimeChannel,"CREATE",function(e,n){b(n)}),o.addListener(t.$id,t.realtimeChannel,"UPDATE",function(e,n){b(n)}),$()}e.$inject=["$scope","$routeParams","c8yBase","c8yGeo","c8yDevices","c8yRealtime","c8yAlert","gettext","leafletData"],angular.module("c8y.parts.location").controller("locationCtrl",e)}();
|
|
1
|
+
"use strict";!function(){function e(t,n,e,a,i,o,l,c,r){var d,s,u="c8y_Position",g="com_nsn_startups_vendme_fragments_GPSCoordinates",f={},m={icon:{type:"div",className:"normal-marker-icon",iconSize:[25,41],iconAnchor:[12.5,41]},focus:!0,draggable:!0},v={lat:0,lng:0,zoom:11};function b(e){r.getMap("locationId").then(function(e){setTimeout(function(){e.invalidateSize(!0)},500)}),d=e,t.location=D(e)||{};var n=t.location;h(t.location),s=_.clone(n),function(e){return!(!e.lat||!e.lng)}(n)&&C(n)}function h(e){var n=_.get(e,"lat"),t=_.get(e,"lng"),a=_.get(e,"alt");_.set(e,"lat",_.toNumber(n)),_.set(e,"lng",_.toNumber(t)),_.isUndefined(a)||_.set(e,"alt",_.toNumber(a))}function p(e){var n=e&&e.latLng;if(n){var t={lat:Number(n.lat),lng:Number(n.lng),zoom:17};C(t),y(t),N(t)}}function $(){i.detailCached(function(){var e=_.get(t,"child.config.device");return e&&(m.draggable=!1),_.get(e,"id",n.deviceId)}()).then(function(e){return _.cloneDeep(e.data)}).then(b)}function C(e){_.assign(m,{lat:parseFloat(e.lat),lng:parseFloat(e.lng)}),N(f.main=m)}function y(e){_.assign(t.location,{lat:parseFloat(e.lat),lng:function(e){var n=e%360;return n<-180?360+n:180<n?n-360:n}(parseFloat(e.lng))})}function A(e){return i.isVendme(e)?g:u}function D(e){return e[A(e)]}function N(e){var n=e||m;_.assign(t.center,n)}_.assign(t,{settings:{},markers:f,mapDefaults:{scrollWheelZoom:!1},centerMap:N,center:v,pattern:{latitude:/^[-+]?([1-8]?\d(\.\d+)?|90(\.0+)?)$/,longitude:/^[-+]?(180(\.0+)?|((1[0-7]\d)|([1-9]?\d))(\.\d+)?)$/,altitude:/^[-+]?(0|([1-9]\d*))(\.\d+)?$/},events:{markers:{enable:["dragend"]}},gotoAddress:function(e){a.geoCode(e).then(function(e){var n=_.get(e,"data.results[0].locations[0]");return n||l.warning(c("Address could not be found.")),n||null}).then(p)},cancel:function(){t.noeditable=!t.noeditable,_.isEqual(t.location,s)||(t.location=_.clone(s))},save:function(){t.noeditable=!t.noeditable;var e={id:d.id},n=_.clone(D(d));delete n.address,e[A(d)]=n,h(e[A(d)]),i.save(e).then(function(){l.success(c("Location saved."))}).then($)},realtimeChannel:"/managedobjects/".concat(void 0!==n.deviceId?n.deviceId:"*"),invalid:angular.bind(e,e.invalid,t),id:t.$id}),t.$on("leafletDirectiveMarker.locationId.dragend",function(e,n){y(n.model)}),t.$watch("child.config.device",$),o.addListener(t.$id,t.realtimeChannel,"".concat(t.$id,"-subscribed"),function(){$()}),o.addListener(t.$id,t.realtimeChannel,"CREATE",function(e,n){b(n)}),o.addListener(t.$id,t.realtimeChannel,"UPDATE",function(e,n){b(n)}),$()}e.$inject=["$scope","$routeParams","c8yBase","c8yGeo","c8yDevices","c8yRealtime","c8yAlert","gettext","leafletData"],angular.module("c8y.parts.location").controller("locationCtrl",e)}();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";!function(){function e(e,n,t,l,a){var
|
|
1
|
+
"use strict";!function(){function e(e,n,t,l,a,o,r){var c,g=new l.Bounds,s=[],i={type:"polygon",stroke:!0,weight:1,color:"#2e3974",fillColor:"#2e3974",latlngs:[]},d={center:{},events:{},defaults:{doubleClickZoom:!1},bounds:g.get(),markers:s,paths:{geofencePath:i}};function u(e){var n=e&&e.latLng;n&&(d.center=_.assign(d.center,{lat:Number(n.lat),lng:Number(n.lng),zoom:17}))}function f(){0<i.latlngs.length&&(g.reset(),_.forEach(i.latlngs,function(e){g.add(e)}),d.bounds=g.get())}function h(){i.latlngs.length=0,s.length=0}function m(e,n){switch(e.name){case"leafletDirectiveMarker.dragstart":c={lat:n.model.lat,lng:n.model.lng,draggable:!0};break;case"leafletDirectiveMarker.dragend":i.latlngs[_.findIndex(i.latlngs,c)]={lat:n.model.lat,lng:n.model.lng,draggable:!0}}}e.gotoAddress=function(e){l.geoCode(e).then(function(e){var n=_.get(e,"data.results[0].locations[0]");return n||o.warning(r("Address could not be found.")),n||null}).then(u)},e.centerMap=f,e.clearGeofence=h,e.chooseGeofence=function(){n.close(function(e){return _.map(e,function(e){return{lat:e.lat,lng:e.lng}})}(i.latlngs))},e.cancel=n.dismiss,e.map=d,e.$on("leafletDirectiveMap.click",function(e,n){var t={lat:n.leafletEvent.latlng.lat,lng:n.leafletEvent.latlng.lng,draggable:!0,icon:{type:"div",className:"normal-marker-icon",iconSize:[25,41],iconAnchor:[12.5,41]}};d.markers.push(t),i.latlngs.push(t),1===i.latlngs.length&&(d.paths={geofencePath:i})}),e.$on("leafletDirectiveMarker.dragend",m),e.$on("leafletDirectiveMarker.dragstart",m),h(),_.forEach(a,function(e){e.draggable=!0,e.icon={type:"div",className:"normal-marker-icon",iconSize:[25,41],iconAnchor:[12.5,41]},s.push(e),i.latlngs.push(e)}),0<i.latlngs.length?d.paths={geofencePath:i}:d.paths={},t(f,0)}e.$inject=["$scope","$uibModalInstance","$timeout","c8yGeo","geofenceLatLngs","c8yAlert","gettext"],angular.module("c8y.cockpit.map").controller("GeofenceEditCtrl",e)}();
|