return false;
});
+ $("#logout").click(function () {
+ $("#logout").logout();
+ });
+
$("#main_controls").submit(function () {
//Validate!
return false;
<div id="logout-container">
<form action="#">
<div>
- <input type="button" name="logout" value="Logout">
+ <input type="button" id="logout" value="Logout">
</div>
</form>
</div>
*/
mctx = {};
-mctx.location = location.protocol + "//" + location.host;
+mctx.location = location.protocol + "//" + location.host + "/";
mctx.api = mctx.location + "/api/";
mctx.expected_api_version = 0;
mctx.has_control = false;
});
};
+$.fn.logout = function () {
+ $.ajax({
+ url : mctx.api + "unbind"
+ }).always(function () {
+ //Note: this only clears the nameless cookie
+ document.cookie = "";
+ window.location = mctx.location + "login.html";
+ });
+}
+
$.fn.setErrorLog = function () {
var url = mctx.api + "errorlog";
var outdiv = this;