-
Notifications
You must be signed in to change notification settings - Fork 264
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IOT tool to send messages to Dweet - https://github.com/apache/openmeetings/issues/102 #103
base: master
Are you sure you want to change the base?
Conversation
@solomax any thoughts on this ? |
Hello @gkrthk, @collisiondetection Unfortunately I had no time (yet) to check this PR (mea culpa) |
Ok you can check the dweet / message appearing here https://dweet.io/see from OM whiteboard. |
@solomax does it seem ok ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the purpose to send messages to Dweet
?
I mean why would OM users would like to have this new feature?
openmeetings-web/pom.xml
Outdated
@@ -163,7 +163,8 @@ | |||
<jsSourceFile>raw-tool-arrow.js</jsSourceFile> | |||
<jsSourceFile>raw-tool-clipart.js</jsSourceFile> | |||
<jsSourceFile>raw-wb-board.js</jsSourceFile> | |||
<jsSourceFile>raw-wb-area.js</jsSourceFile> | |||
<jsSourceFile>raw-wb-area.js</jsSourceFile> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please do not create trailing spaces
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
openmeetings-web/pom.xml
Outdated
@@ -264,7 +265,7 @@ | |||
<jsEngine>CLOSURE</jsEngine> | |||
<jsTargetDir>../generated-sources/main/java/org/apache/openmeetings/web/user/chat</jsTargetDir> | |||
</configuration> | |||
</execution> | |||
</execution> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please do not create trailing spaces
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@@ -960,4 +960,8 @@ see https://openmeetings.apache.org/LanguageEditor.html for Details | |||
<entry key="wizard.button.finish"><![CDATA[Finish]]></entry> | |||
<entry key="zoom.FULL_FIT"><![CDATA[Full-Fit]]></entry> | |||
<entry key="zoom.PAGE_WIDTH"><![CDATA[Page Width]]></entry> | |||
<entry key="wb.tool.dweet"><![CDATA[Dweet IOT Messaging]]></entry> | |||
<entry key="wb.tool.dweet.mything"><![CDATA[MyThing]]></entry> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not clear what MyThing
should mean
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"MyThing " is the term used by Dweet for an object ( fridge, light ) to be controlled.
To make this clearer for the user we could add an example object in the text field: MyThing: ..Light ...........
@@ -369,6 +370,52 @@ var Wb = function() { | |||
minHeight: 140 | |||
, minWidth: 255 | |||
}); | |||
tools.find('.om-icon.dweet').click(function(){ | |||
dweet = OmUtil.tmpl("#wb-dweet"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OmUtil.tmpl
accepts new id as second parameter- please use single quotes for strings
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@@ -369,6 +370,52 @@ var Wb = function() { | |||
minHeight: 140 | |||
, minWidth: 255 | |||
}); | |||
tools.find('.om-icon.dweet').click(function(){ | |||
dweet = OmUtil.tmpl("#wb-dweet"); | |||
dweet[0].id='wb-dweet' + dweetIDCount++; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is no clear why element ID should be different every time user role is changed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everytime the user clicks on the dweet button a new dweet popup will be opened. One user can have multiple dweet popup's opened to control different IOT things. So giving each popup a unique id so that on submit can handle the specific popup action.
tools.find('.om-icon.dweet').click(function(){ | ||
dweet = OmUtil.tmpl("#wb-dweet"); | ||
dweet[0].id='wb-dweet' + dweetIDCount++; | ||
dweet[0].style.bottom = '100px'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
styles should go to CSS
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
dweet[0].id='wb-dweet' + dweetIDCount++; | ||
dweet[0].style.bottom = '100px'; | ||
dweet[0].style.position= 'absolute'; | ||
dweet[0].style[(Settings.isRtl ? 'left' : 'right')] = '100px'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this Settings.isRtl ? 'left' : 'right'
code is obsolete
alignment will be changed automatically in case of RTL
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
, minWidth: 255 | ||
}); | ||
dweet.find('.update-btn').button().click(function() { | ||
var id = $(this.parentElement.parentElement).attr('id'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please use let
or const
instead of var
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@@ -1 +1,20 @@ | |||
/* Licensed under the Apache License, Version 2.0 (the "License") http://www.apache.org/licenses/LICENSE-2.0 */ | |||
.room-block .sb-wb .wb-block .tools .om-icon.big.dweet::before { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
custom.css
is for users
OM CSS should go to correspondent raw-*.css
files (most probably to raw-wd.css
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
var request; | ||
|
||
var LAST_THING_NAME = "last-thing.dat"; | ||
var DWEET_SERVER = "https://dweet.io:443"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I doubt connection to external server will be allowed by CSP
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
During our testing on a live site we did not experience any issues with this.
The purpose is to be able to control any object such as an arduino. This will allow students to control robots or doctors to control robot arms. It will allow OM to become an interface to any device that can respond to a dweet. |
@solomax If I upgrade this to work with current OM can you merge ? |
This PR contains the WB tool added to send IOT messages to Dweet.
Dweet api integration for send message in wb area.