HomeGenie Forum

Automation Program Plugins and Wizard Scripting => Help => Topic started by: Johnny H on November 18, 2014, 08:48:12 PM

Title: converted HG Web interface to phonegap
Post by: Johnny H on November 18, 2014, 08:48:12 PM
Hi,

i might ramble a little here.......

just playing around with the html interface as I have ported it to compile under phonegap  allowing the single codebase to run on w8/bb10/iphone/android etc...

i've tested the code on all the iphone models, apple tablets, various samsung/HTC android devices, and compiled under BB10, sees good except for when authentication is turned on.....

its working great, the only issue I have come across is the authentication request from the browser is suppressed under the phonegap app due to the way it is rendering the site.

i'm not a professional pgm by trade (more lamp stack), but is there something funky going on with the code, i'm seeing {include...} syntax and items that I'm not use to... can anybody explain how this works, i've been debugging through the app and js, so I understand the code but not sure if HG is what type of web server/service HG is using/emulating.

in order for the phonegap app to access hg with a password, i need to create another form to manage the login process and not have the browser prompt for the credentials as it currently does, as the inappbrowser object blocks the authentication window. (i'm using window.open(_self) as it makes the app appear clean and as a native app, and removes all the browser features) 

not sure if I can get away with a single .html page and call that...: localhost:8080//hg/html/login.html, or if it has to abide by the current structure.

here's what i'm thinking/will need in order to get the app exposed to internet.

load hg/html/login.html
   call HG.HasPassword
        if == 1; prompt for password
                call new function validatePassword(encrypt); return t/f
               if == 0 repeat
               if == 1 load hg/html/index.html

In English: load login page, if needs password then get password, validate, if ok then load the main index page otherwise keep prompting

if anyone has any insight or is interested in assisting that would be appreciated.

Johnny