![]() ![]() In addition you can adjust access permissions using the Info button. TextWrangler provides options to create new files and folders at the specified location, and also allows you to delete files and folders. Unfortunately there is no option to use Column or Icon view, but for most purposes List view should work just fine. When the connection is established, the system will display the remote system's files in list view, which you can browse through and select to open in TextWrangler. Enter the IP address or URL for the remote computer, followed by checking the "SFTP" option and providing your username and password, and then click the Connect button. Then select "Open from FTP/SFTP Server" in the File menu, and you will see the program's FTP browser window appear. To use this feature, first get and install TextWrangler on your system and then launch the program. I can’t repeat enough that this is dirty, and I barely know what I am doing.In TextWrangler's FTP browser you can check the SFTP option to browse a server that is running the remote log-in (SSH) service (click for larger view). For example to get the name of a device:.Each device is accessible as a JS object: vices.You’ll need to reverse engineer the JSON data to understand it, but basically: JsonObjects = JSON & JSON.parse(data) || $.parseJSON(data) Īfter that, you have full access to all devices details in JS. Here is an excerpt of my ‘createObjectsFromJson’ function: This is where the JSON string is parsed, then transformed into a standard JS object. This ‘post’ request, if successful (PHP returns the JSON string), calls another function.jQuery is a simple JS ‘plugin’ that can easily be downloaded. It provides both syntax colouring and function navigation for a number of popular languages including C++, HTML/XHTML, JavaScript, Perl, PHP and Python.Now again, anyone with basic JS knowledge will know that, but I didn’t :, so I am writing this just in case: (You’ll notice I am passing the vera IP address from JS to the PHP file: $.post('vera/vera.php',data = ) Now on the client/Javascript side, I am using a jquery (AJAX) request as it was advised. ':3480/data_request?id=sdata&output_format=json' I opted for ‘MAMP’, which works better than the integrated Mac OS server for testing purposes. On a side note (but you probably know that), you will need your MAC server to be able to run PHP. The server sends the PHP request to Vera, gets the JSON data, and forwards it back to the JS of the client/browser. I’ve never opened a JS/PHP manual, and what I did is basically the dirty result of hundreds of google searches Dīasically, my browser-side JS calls the a PHP (server side) function. I’m happy to share what I did, but before, let me remind that I am a hobby coder. It seems it’s a cross domain issue as well, there is no way you can do that with JS alone. One option would be: instead of dynamically reading the JSON with Javascript on the client side, I could maybe use PHP to retrieve the JSON file from the Vera, save it on my home server, and then all devices will accept reading it (JSON file on same server as web page).īut I played with PHP as a kid…I must admit I was keen on keeping things pure HTML and javascript 8) ![]() ![]() Obviously my Vera and my test server have different local IPs, so iDevices and Kindles refuse to retrieve the Json for security reasons. My conclusion is, after much online research, that mobile browsers refuse to interrogate external servers via javascript. json file in the root of my sever, and point my HTML page to it, then it works…on ALL devices above + desktops on mobile devices (iPhone, iPad and even the experimental browser on an Amazon Kindle), the JSON refuses to load from the Vera.On a Mac (safari, firefox)… I can parse the JSON and display the status of the devices on my web page. I have no problem getting the “sdata” JSON status file ( Luup Requests - MiOS), so far, i get it D Now I am trying to get the status of the devices. I have my webpage, I can control devices (javascript HTTP get requests to my Vera)… Works all good (see attachment, for a very primitive test page): I am doing things in a very “primitive manner”: pure text editing (TextWrangler Mac), and integrated Mac OS server function. I know, there are apps out there, but none is perfect…actually, some are very good, but they aren’t compatible with both iOS and Android tablets. One that I could display on in-wall tablets in my home. You can also produce your own TextWrangler language modules to include unsupported languages, while a built-in function scanner simplifies navigation of source code. I am trying to develop a simple HTML dashboard and control page for my vera. It provides both syntax colouring and function navigation for a number of popular languages including C++, HTML/XHTML, JavaScript, Perl, PHP and Python. I am an intermediate DIY user, so please bear with me D ![]()
0 Comments
Leave a Reply. |