vsee Example
HTML
<script src="https://gethealthy.com/kendo/js/jquery.min.js"></script>
<script src="https://gethealthy.com/kendo/js/kendo.all.min.js"></script>
<div id='container'>
<div data-bind='visible:showInformation'>
<label>First Name :
<input data-bind='value:firstName' />
</label>
<label>Last Name :
<input data-bind='value:lastName' />
</label>
<p>Why are your here?
<textarea data-bind='value:reasonForVisit'></textarea>
</p>
<button data-bind="click:clickSeeTheDoctor">See The Doctor!</button>
</div>
<div data-bind='invisible:showInformation'>
<button data-bind="click:clickHide">Hide Waiting Room</button>
<iframe name='iframeWaitingRoom' id='iframeWaitingRoom' style="width: 100%; height: 600px;"></iframe>
</div>
</div>
JavaScript
window.addEventListener('message', function (event) {
/*alert(event.data);*/
} );
var $container = $('#container');
var vm = new kendo.observable({
showInformation: true,
firstName: "Frank",
lastName: "Rizzo",
waitingRoomUrl: "https://vsee.me/u/gethealthy",
waitingRoomCssUrl: "https://gethealthy.com/css/vsee.css",
reasonForVisit: "",
iframeName: "iframeWaitingRoom",
clickHide: function (e) {
e.preventDefault();
vm.set('showInformation', true);
},
clickSeeTheDoctor: function (e) {
e.preventDefault();
// The following values should be managed by php code
var expiry = Math.round(new Date().getTime() / 1000) + 3600 * 2;
var salt = '12345678';
var token = 1234; //md5(expiry + salt);
/*
* Demonstrate how to launch oneclick widget with post method
* parameters: (Object) Parameters for oneclick widget
* - name: (String) The name of iframe
* - url: (String) Waiting room url
* - css: (String) Custom css path
* - first_name: (String) Visitor's first name
* - last_name: (String) Visitor's last name
* - reason_for_visit: (String) Visitor's reason for visiting waiting room
* - token: (String) The token for verifying this request
* - expiry: (String) The timestamp of session expire time
*/
var newform = $('<form></form>');
var first_name_input = $('<input type="text" name="first_name" value="' + vm.firstName + '"></input>');
var last_name_input = $('<input type="text" name="last_name" value="' + vm.lastName + '"></input>');
var reason_for_visit_input = $('<input type="text" name="reason_for_visit" value="' + vm.reasonForVisit + '"></input>');
var expiry_input = $('<input type="text" name="expiry" value="' + expiry + '"></input>');
var token_input =...