Tidy up dialog css, status report, readme, 1.5.34
add sessionid to status reports on connect/disconnect, bump for 1.5.34
This commit is contained in:
parent
5c5e8456f6
commit
2cf5cca09f
@ -1,5 +1,6 @@
|
||||
### Change Log for Node-RED Worldmap
|
||||
|
||||
- v1.5.34 - Add command.contextmenu to set non-marker context menu (defaults to add marker).
|
||||
- v1.5.33 - Let blank input disable contextmenu completely. Tidy up help, update dialog polyfill.
|
||||
- v1.5.32 - Add .contextmenu custom right click menu Issue #73, Fix map lock, Close websocket on unload
|
||||
- v1.5.31 - Fix pan first at start, and coords overlay. Issues #81 and #82
|
||||
|
@ -9,6 +9,7 @@ map web page for plotting "things" on.
|
||||
|
||||
### Updates
|
||||
|
||||
- v1.5.34 - Add command.contextmenu to set non-marker context menu (defaults to add marker).
|
||||
- v1.5.33 - Let blank input disable contextmenu completely. Tidy up help, update dialog polyfill.
|
||||
- v1.5.32 - Add .contextmenu custom right click menu, Fix map lock, Close websocket on unload
|
||||
- v1.5.31 - Fix pan first at start, and coords overlay. Issues #81 and #82
|
||||
@ -70,7 +71,7 @@ Optional properties include
|
||||
- **popup** : html to fill the popup if you don't want the automatic default of the properties list.
|
||||
- **label** : displays the contents as a permanent label next to the marker, or
|
||||
- **tooltip** : displays the contents when you hover over the marker. (Mutually exclusive with label. Label has priority)
|
||||
- **contextmenu** : an html fragment to display on right click of marker - defaults to delete marker. You can specify `$name` to pass in the name of the marker. Set to `""` to disable.
|
||||
- **contextmenu** : an html fragment to display on right click of marker - defaults to delete marker. You can specify `$name` to pass in the name of the marker. Set to `""` to disable just this instance.
|
||||
|
||||
Any other `msg.payload` properties will be added to the icon popup text box. This can be overridden
|
||||
by using the **popup** property to supply your own html content.
|
||||
@ -284,8 +285,8 @@ Optional properties include
|
||||
- **hiderightclick** - disables the right click that allows adding or deleting points on the map - `{"command":{"hiderightclick":true}}`
|
||||
- **coords** - turns on and off a display of the current mouse co-ordinates. Values can be "deg", "dms", or "none" (default). - `{"command":{"coords":"deg"}}`
|
||||
- **button** - if supplied with a `name` and `icon` property - adds a button to provide user input - sends
|
||||
a msg `{"action":"button", "name":"the_button_name"}` to the worldmap in node. If supplied with a `name` property only, it will remove the button. Optional `position` property can be 'bottomright', 'bottomleft',
|
||||
'topleft' or 'topright' (default).
|
||||
a msg `{"action":"button", "name":"the_button_name"}` to the worldmap in node. If supplied with a `name` property only, it will remove the button. Optional `position` property can be 'bottomright', 'bottomleft', 'topleft' or 'topright' (default).
|
||||
- **contextmenu** - html string to define the right click menu when not on a marker. Defaults to the simple add marker input. Empty string `""` disables this right click.
|
||||
|
||||
#### To switch layer, move map and zoom
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "node-red-contrib-web-worldmap",
|
||||
"version": "1.5.33",
|
||||
"version": "1.5.34",
|
||||
"description": "A Node-RED node to provide a web page of a world map for plotting things on.",
|
||||
"dependencies": {
|
||||
"cgi": "0.3.1",
|
||||
|
10
worldmap.js
10
worldmap.js
@ -79,9 +79,9 @@ module.exports = function(RED) {
|
||||
});
|
||||
client.on('close', function() {
|
||||
delete clients[client.id];
|
||||
node.status({fill:"green",shape:"ring",text:"connected "+Object.keys(clients).length});
|
||||
node.status({fill:"green",shape:"ring",text:"connected "+Object.keys(clients).length,_sessionid:client.id});
|
||||
});
|
||||
node.status({fill:"green",shape:"dot",text:"connected "+Object.keys(clients).length});
|
||||
node.status({fill:"green",shape:"dot",text:"connected "+Object.keys(clients).length,_sessionid:client.id});
|
||||
}
|
||||
node.on('input', function(msg) {
|
||||
if (msg.hasOwnProperty("_sessionid")) {
|
||||
@ -133,15 +133,15 @@ module.exports = function(RED) {
|
||||
var callback = function(client) {
|
||||
//client.setMaxListeners(0);
|
||||
clients[client.id] = client;
|
||||
node.status({fill:"green",shape:"dot",text:"connected "+Object.keys(clients).length});
|
||||
node.status({fill:"green",shape:"dot",text:"connected "+Object.keys(clients).length,_sessionid:client.id});
|
||||
client.on('data', function(message) {
|
||||
message = JSON.parse(message);
|
||||
setImmediate(function() {node.send({payload:message, topic:node.path.substr(1), _sessionid:client.id})});
|
||||
});
|
||||
client.on('close', function() {
|
||||
delete clients[client.id];
|
||||
node.status({fill:"green",shape:"ring",text:"connected "+Object.keys(clients).length});
|
||||
node.send({payload:{action:"disconnect", clients:Object.keys(clients).length}, topic:"worldmap"});
|
||||
node.status({fill:"green",shape:"ring",text:"connected "+Object.keys(clients).length,_sessionid:client.id});
|
||||
node.send({payload:{action:"disconnect", clients:Object.keys(clients).length}, topic:"worldmap", _sessionid:client.id});
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -21,17 +21,19 @@ a {
|
||||
}
|
||||
|
||||
dialog {
|
||||
top: 50px;
|
||||
z-index: 9999;
|
||||
width: 60% !important;
|
||||
border-radius: 6px !important;
|
||||
border-width: 1px !important;
|
||||
border-radius: 4px !important;
|
||||
border-width: 0px !important;
|
||||
line-height: 1.4em !important;
|
||||
box-shadow: 0 1px 5px rgba(0,0,0,0.65) !important;
|
||||
}
|
||||
dialog > p > b {
|
||||
font-size: unset;
|
||||
}
|
||||
dialog > button {
|
||||
margin-top: 5px;
|
||||
margin-top: 6px;
|
||||
height: 24px;
|
||||
border-radius: 4px;
|
||||
font-weight: 500;
|
||||
@ -101,10 +103,12 @@ dialog > button {
|
||||
color:#fff;
|
||||
background-color:#000;
|
||||
position:fixed;
|
||||
top:40px;
|
||||
top:38px;
|
||||
right:0px;
|
||||
width:200px;
|
||||
z-index:9998;
|
||||
border-radius: 4px;
|
||||
padding: 2px 4px 6px 0px;
|
||||
}
|
||||
|
||||
#menu td {
|
||||
|
@ -1,5 +1,5 @@
|
||||
CACHE MANIFEST
|
||||
# date: Mar 17th 2019 - v1.5.33
|
||||
# date: Mar 17th 2019 - v1.5.34
|
||||
|
||||
CACHE:
|
||||
index.html
|
||||
|
Loading…
Reference in New Issue
Block a user