// Copyright (C) 2008,2009 BRAT Tech LLC ControlBar = function (document, serverUrl) { this.document = document; this.serverUrl = serverUrl; this.window = window; this.callbacks = []; }; ControlBar.prototype.bind = function () { }; ControlBar.HTML = '
' + '
' + '
' + '' + '
' + '
'; ControlBar.prototype.login = function (loginSubmitFn) { this.callbacks.push(loginSubmitFn); if (this.callbacks.length == 1) { this.doTemplate("/user_session/new.mini?return_url=" + encodeURIComponent(this.urlWithoutAnchor())); } }; ControlBar.prototype.logout = function (loginSubmitFn) { this.callbacks.push(loginSubmitFn); if (this.callbacks.length == 1) { this.doTemplate("/user_session/do_destroy.mini"); } }; ControlBar.prototype.urlWithoutAnchor = function (path) { return this.window.location.href.split("#")[0]; }; ControlBar.prototype.doTemplate = function (path) { var self = this; var id = new Date().getTime(); var url = this.urlWithoutAnchor(); url += "#$iframe_notify=" + id; var iframeHeight = 330; var loginView = jQuery('