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
Dev gui contact #335
base: staging
Are you sure you want to change the base?
Dev gui contact #335
Conversation
Can you make contact a readonly element? |
Yes, originally I thought to be able to keep it writable is a benefit, however we should not fix one problem (missed RF receives) with the ability to manipulate the state manually, we could think to introduce a password protected mode OVERRULE.
Von meinem iPhone gesendet
… Am 28.02.2017 um 07:13 schrieb CurlyMoo ***@***.***>:
Can you make contact a readonly element?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
3494121
to
c9b686e
Compare
Problem with the disabled buttons is the opacity of the buttons. |
c9b686e
to
7e33ea9
Compare
Done, tested, confirmed by other user. The opacity for disabled devices is an issue of the browser and intended by design. The development branch is the base of this PR. |
libs/webgui/pilight.js
Outdated
oTab = $('#all'); | ||
} | ||
if('name' in aValues) { | ||
oTab.append($('<li id="'+sDevId+'" class="contact" data-icon="false"><div class="name">'+aValues['name']+'</div><div id="'+sDevId+'_contact" class="contact" data-role="fieldcontain" data-type="horizontal"><fieldset data-role="controlgroup" class="controlgroup" data-type="horizontal" data-mini="true"><input type="radio" name="'+sDevId+'_contact" id="'+sDevId+'_contact_closed" value="closed" /><label for="'+sDevId+'_contact_closed">'+language.closed+'</label><input type="radio" name="'+sDevId+'_contact" id="'+sDevId+'_contact_opened" value="opened" /><label for="'+sDevId+'_contact_opened">'+language.opened+'</label></fieldset></div></li>')); |
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.
Too much spaces here.
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
$('#'+sDevId+'_contact_closed').bind("change", function(event, ui) { | ||
event.stopPropagation(); | ||
if('confirm' in aValues && aValues['confirm']) { | ||
if(window.confirm("Are you sure?") == false) { |
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 should be language independent.
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.
same as with switch protocol
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.
Indeed, you found a bug in the switch protocol 😉
libs/webgui/pilight.js
Outdated
} | ||
$('#'+sDevId+'_contact_opened').checkboxradio('disable'); | ||
$('#'+sDevId+'_contact_closed').checkboxradio('disable'); | ||
$('#'+sDevId+'_contact_opened').fadeTo(0,0.1); |
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.
Spaces after the komma.
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.
removed. opacity is a function of the browser used for showing elements as being disabled.
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.
fadeTo has no impact for example with Firefox,
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 understand what it does. I just want the programming style to be consistent.
libs/webgui/pilight.js
Outdated
} else { | ||
bSending = true; | ||
if('all' in aValues && aValues['all'] == 1) { | ||
$.get(sHTTPProtocol+'://'+location.host+'/control/control?device='+sDevId+'&state='+this.value+'&values[all]=1'); |
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.
The URL is wrong, double /control
.
Just saw that this is wrong in createScreenElement()
too, on line 399. But that's unrelated to this pr.
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.
Indeed, nice catch.
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
Looks good, just the minor change @CurlyMoo pointed out to fix |
The switch bug requires a new PR. This PR should only be focused on a new contact element. |
@@ -396,7 +498,7 @@ function createScreenElement(sTabId, sDevId, aValues) { | |||
} else { | |||
bSending = true; | |||
if('all' in aValues && aValues['all'] == 1) { | |||
$.get(sHTTPProtocol+'://'+location.host+'/control/control?device='+sDevId+'&state='+this.value+'&values[all]=1'); |
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.
Also make this a seperate PR.
cb49c2c
to
d298c5a
Compare
This pull requests adds handling of CONTACT devices to the GUI. It was tested for SC2262 protocol.
A description on how to test it was added to the wiki for SC2262 protocol. The same principle can be used for all other protocols.