aboutsummaryrefslogtreecommitdiffstats
path: root/src/moveToAngularCom/ControlBar.js
diff options
context:
space:
mode:
authorAndres Ornelas2010-07-27 10:44:46 -0700
committerAndres Ornelas2010-07-27 10:44:46 -0700
commitb42072733c3afd03a49457d88ffed28ebe55655e (patch)
tree2fa2b8703cdc75fe19a204d2c9677e27d33c8176 /src/moveToAngularCom/ControlBar.js
parent2f7c538628929888ce7c99b9577e34f8c87211f7 (diff)
parent8ddee9bb25ade2bbe7d57db6353b29867606c184 (diff)
downloadangular.js-b42072733c3afd03a49457d88ffed28ebe55655e.tar.bz2
Merge branch 'master' of github.com:angular/angular.js into future
Diffstat (limited to 'src/moveToAngularCom/ControlBar.js')
-rw-r--r--src/moveToAngularCom/ControlBar.js72
1 files changed, 0 insertions, 72 deletions
diff --git a/src/moveToAngularCom/ControlBar.js b/src/moveToAngularCom/ControlBar.js
deleted file mode 100644
index 685beeb2..00000000
--- a/src/moveToAngularCom/ControlBar.js
+++ /dev/null
@@ -1,72 +0,0 @@
-function ControlBar(document, serverUrl, database) {
- this._document = document;
- this.serverUrl = serverUrl;
- this.database = database;
- this._window = window;
- this.callbacks = [];
-};
-
-ControlBar.HTML =
- '<div>' +
- '<div class="ui-widget-overlay"></div>' +
- '<div id="ng-login" ng-non-bindable="true">' +
- '<div class="ng-login-container"></div>' +
- '</div>' +
- '</div>';
-
-
-ControlBar.FORBIDEN =
- '<div ng-non-bindable="true" title="Permission Error:">' +
- 'Sorry, you do not have permission for this!'+
- '</div>';
-
-ControlBar.prototype = {
- bind: function () {
- },
-
- login: function (loginSubmitFn) {
- this.callbacks.push(loginSubmitFn);
- if (this.callbacks.length == 1) {
- this.doTemplate("/user_session/new.mini?database="+encodeURIComponent(this.database)+"&return_url=" + encodeURIComponent(this.urlWithoutAnchor()));
- }
- },
-
- logout: function (loginSubmitFn) {
- this.callbacks.push(loginSubmitFn);
- if (this.callbacks.length == 1) {
- this.doTemplate("/user_session/do_destroy.mini");
- }
- },
-
- urlWithoutAnchor: function (path) {
- return this._window['location']['href'].split("#")[0];
- },
-
- doTemplate: function (path) {
- var self = this;
- var id = new Date().getTime();
- var url = this.urlWithoutAnchor() + "#$iframe_notify=" + id;
- var iframeHeight = 330;
- var loginView = jQuery('<div style="overflow:hidden; padding:2px 0 0 0;"><iframe name="'+ url +'" src="'+this.serverUrl + path + '" width="500" height="'+ iframeHeight +'"/></div>');
- this._document.append(loginView);
- loginView['dialog']({
- 'height':iframeHeight + 33, 'width':500,
- 'resizable': false, 'modal':true,
- 'title': 'Authentication: <a href="http://www.getangular.com"><tt>&lt;angular/&gt;</tt></a>'
- });
- angularCallbacks["_iframe_notify_" + id] = function() {
- loginView['dialog']("destroy");
- loginView['remove']();
- foreach(self.callbacks, function(callback){
- callback();
- });
- self.callbacks = [];
- };
- },
-
- notAuthorized: function () {
- if (this.forbidenView) return;
- this.forbidenView = jQuery(ControlBar.FORBIDEN);
- this.forbidenView.dialog({bgiframe:true, height:70, modal:true});
- }
-}; \ No newline at end of file