From d47ffc45dd53821e08bf3b7722d6fc6c6954ed70 Mon Sep 17 00:00:00 2001 From: Rene Saarsoo Date: Fri, 5 Oct 2012 13:51:50 -0700 Subject: [PATCH] Remove unused LoginHelper class. --- template/app/view/auth/LoginHelper.js | 73 --------------------------- 1 file changed, 73 deletions(-) delete mode 100644 template/app/view/auth/LoginHelper.js diff --git a/template/app/view/auth/LoginHelper.js b/template/app/view/auth/LoginHelper.js deleted file mode 100644 index 57d34dad..00000000 --- a/template/app/view/auth/LoginHelper.js +++ /dev/null @@ -1,73 +0,0 @@ -/** - * Generates the login form for both in header and at the end of - * comments list. - * - * When form is submitted, Docs.controller.Auth#login method is called. - */ -Ext.define('Docs.view.auth.LoginHelper', { - singleton: true, - - loginTplHtml: [ - '
', - '', - '', - '', - '', - ' or ', - 'Register', - '
' - ], - - /** - * Renders the form inside Login component in header. - * @param {Ext.Element/HTMLElement} el - */ - renderToHeader: function(el) { - var tpl = Ext.create('Ext.Template', this.loginTplHtml.join('')); - tpl.overwrite(el, {}); - this.bindSubmit(el); - }, - - /** - * Renders the form at the end of comments list. - * @param {Ext.Element/HTMLElement} el - */ - renderToComments: function(el) { - if (Ext.isIE && Ext.ieVersion <= 7) { - var tpl = Ext.create('Ext.XTemplate', - '
', - 'Sorry, ', - 'adding comments is not supported in IE 7 or earlier', - '
' - ); - } - else { - var tpl = Ext.create('Ext.XTemplate', - '
', - 'Sign in to post a comment:', - this.loginTplHtml.join(''), - '
' - ); - } - tpl.overwrite(el, {}); - this.bindSubmit(el); - }, - - bindSubmit: function(el) { - Ext.get(el).down("form").on("submit", this.submitLogin, this, {preventDefault: true}); - }, - - // Gathers values from form and passes to Auth controller - submitLogin: function(event, el) { - var form = Ext.get(el); - var username = form.down('input[name=username]').getValue(); - var password = form.down('input[name=password]').getValue(); - var rememberEl = form.down('input[name=remember]'); - var submitEl = form.down('input[type=submit]'); - - var remember = rememberEl ? Boolean(rememberEl.getAttribute('checked')) : false; - - Docs.App.getController('Auth').login(username, password, remember, submitEl); - } - -}); -- GitLab