This is the second variation of the JS-PY interface (advanced edition). It is constructed to fit a specific script on the server, and has a separate input field for each argument. Unlike the first variation, this one loads an image result from the script. Less visibly, it also differs in that it uses form tags and the FormData interface to POST input data to the server, instead of using JavaScript to construct the querystring from the individual form fields for a GET request. The form is still submitted using an AJAX request.
Since the script does image processing, which takes a human-noticeable amount of time, it also includes a status icon for when the AJAX response is pending, loaded, or failed. Check it!
Associated files:
pyinterface2_advanced.js
cgi-bin/wrapper2_advanced.py
style.css
(global stylesheet)A simpler version of this interface concept is available here. It doesn't have color-picking or a file upload. (Note to self: remember to check .png and do other security stuff merp)
Supply some dimensions and hit run to see a totally cool Mandelbrot set visualization! While the AJAX request is pending, a loading icon should appear next to the Run button. Once the response is loading, it should change to a checkmark and the image should appear in a new window. You may need to disable your pop-up blocker if it doesn't!