View Single Post
Old 10-22-2013, 04:26 AM   #19
eureka
but forgot what it's like
eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.
 
Posts: 741
Karma: 2345678
Join Date: Dec 2011
Location: north (by northwest)
Device: Kindle Touch
Quote:
Originally Posted by Aeris View Post
Oh, wonderful, thanks!

I'm trying with:


Code:
document.getElementsByClassName("statusBarConnectionDiv").onclick=function(){
var invertedState = (ConnectionState.connectionOnOff ? 0 : 1);
nativeBridge.setIntLipcProperty("com.lab126.cmd", "wirelessEnable", invertedState);
};
But don't know where place the code exactly in the script for make it work (PS the forum puts a space that breaks "connection" word, don't know why)
First of all, result of getElementsByClassName is a NodeList, not an element usable for attaching event listeners.

But then, after disabling wireless this div is hidden by default script (using display: none style), so it couldn't be clicked afterwards, until wireless is enabled again. So final solution should be more complex.

UPD: ah, it's possibly not a problem on PW where div isn't hidden, but inner icon is just changed to "airplane" (I'm speculating here, because I don't have a real PW).

Last edited by eureka; 10-22-2013 at 04:48 AM.
eureka is offline   Reply With Quote