diff options
author | Christian Pointner <equinox@helsinki.at> | 2015-12-30 22:44:30 (GMT) |
---|---|---|
committer | Christian Pointner <equinox@helsinki.at> | 2015-12-30 22:44:30 (GMT) |
commit | 620d1b76807f6ecffda54347db7b58107d03c2a5 (patch) | |
tree | ee6ffc49c9d63301a7961fe1f0a6bc8952ad7077 /test/socket.html | |
parent | 1a817c9f42dfbc4f3f80281e748a8a008b771533 (diff) |
improved sanity check for local files
Diffstat (limited to 'test/socket.html')
-rw-r--r-- | test/socket.html | 32 |
1 files changed, 25 insertions, 7 deletions
diff --git a/test/socket.html b/test/socket.html index 4d26667..c179456 100644 --- a/test/socket.html +++ b/test/socket.html @@ -58,9 +58,7 @@ switch (msg.TYPE) { case "ack": $('#sessionid').val(msg.ID); - $('#buttonrun').attr('disabled','disabled') - $('#buttonreconnect').attr('disabled','disabled') - $('#buttoncancel').removeAttr('disabled') + buttonsRunning(); break; case "done": case "error": @@ -86,12 +84,12 @@ function run() { req = { COMMAND: "new", TIMEOUT: 200, - REFERENCE_ID: "my-very-personal-import", + REFERENCE_ID: $('#refid').val(), LOGIN_NAME: $('#username').val(), PASSWORD: $('#token').val(), SHOW_ID: 10002, CLEAR_SHOW_CARTS: true, - SOURCE_URI: "fake://10000" }; + SOURCE_URI: $('#source').val() }; s = new Session(req); } @@ -106,12 +104,29 @@ s.cancel(); } - function init() { - $('#sessionid').val(""); + function detach() { + s.sock.close(); + buttonsIdle(); + } + + function buttonsIdle() { $('#buttonrun').removeAttr('disabled') $('#buttonreconnect').removeAttr('disabled') + $('#buttondetach').attr('disabled','disabled') $('#buttoncancel').attr('disabled','disabled') } + + function buttonsRunning() { + $('#buttonrun').attr('disabled','disabled') + $('#buttonreconnect').attr('disabled','disabled') + $('#buttondetach').removeAttr('disabled') + $('#buttoncancel').removeAttr('disabled') + } + + function init() { + $('#sessionid').val(""); + buttonsIdle(); + } </script> </head> <body onload="init()"> @@ -131,7 +146,10 @@ </p> <p> + <input id="source" type="text" size="30" value="fake://10000"> + <input id="refid" type="text" size="15" value="test-reference-id"> <button id="buttonrun" onclick="run()">start</button> + <button id="buttondetach" onclick="detach()">detach</button> <input id="sessionid" type="text" size="45"> <button id="buttonreconnect" onclick="reconnect()">reconnect</button> <button id="buttoncancel" onclick="cancel()">cancel</button> |