[Kimchi-devel] [PATCH 2/4] Remove former login design files
alinefm at linux.vnet.ibm.com
alinefm at linux.vnet.ibm.com
Wed Jul 16 16:44:03 UTC 2014
From: Aline Manera <alinefm at linux.vnet.ibm.com>
ui/css/theme-default/login-window.css, ui/js/src/kimchi.login_window.js
and ui/pages/login-window.html.tmpl are not being used anymore since Kimchi
switched to the traditional login flow.
So remove them.
Signed-off-by: Aline Manera <alinefm at linux.vnet.ibm.com>
---
ui/css/theme-default/login-window.css | 90 ------------------------
ui/js/src/kimchi.login_window.js | 128 ----------------------------------
ui/pages/login-window.html.tmpl | 53 --------------
3 files changed, 271 deletions(-)
delete mode 100644 ui/css/theme-default/login-window.css
delete mode 100644 ui/js/src/kimchi.login_window.js
delete mode 100644 ui/pages/login-window.html.tmpl
diff --git a/ui/css/theme-default/login-window.css b/ui/css/theme-default/login-window.css
deleted file mode 100644
index f4ad5f8..0000000
--- a/ui/css/theme-default/login-window.css
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Project Kimchi
- *
- * Copyright IBM, Corp. 2013
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#login-window {
- height: 360px;
- width: 400px;
-}
-
-#login-window>header>.title-text {
- front: #000000;
- font-size: 18px;
- height: 48px;
- line-height: 48px;
- font-weight: bold;
- text-shadow: -1px -1px 1px #eaeaea, 1px 1px 1px #fff;
-}
-
-#login-window footer #form-language {
- height: 48px;
- line-height: 48px;
- padding-right: 10px;
- text-align: right;
-}
-
-#login-window .login-panel #form-login {
- padding: 40px 40px 0;
-}
-
-#login-window>header>.logo {
- display:inline;
- margin: 11px 0 0 2px;
- float: left;
- width: 25px;
- height: 25px;
- background: url(../images/logo.ico) no-repeat center center;
-}
-
-#login-window .login-panel .row {
- margin-bottom: 28px;
-}
-
-#login-window .login-panel input[type="text"],
-#login-window .login-panel input[type="password"] {
- font-size: 18px;
- height: 40px;
- padding-left: 10px;
- padding-right: 10px;
- width: 290px;
-}
-
-#login-window .login-panel .msg-required {
- color: red;
-}
-
-#login-window .login-panel button {
- font-size: 18px;
- height: 40px;
- min-width: 160px;
- float: right;
-}
-
-#login-window .login-panel button[disabled] {
- background: #888;
- color: #DDD;
-}
-
-.language {
- display:inline-block;
- float:right;
- margin:11px 10px 0 0;
-}
-
-.i18n-selector {
- padding:2px 0;
- background: #FFFBF0;
-}
diff --git a/ui/js/src/kimchi.login_window.js b/ui/js/src/kimchi.login_window.js
deleted file mode 100644
index c562159..0000000
--- a/ui/js/src/kimchi.login_window.js
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * Project Kimchi
- *
- * Copyright IBM, Corp. 2013
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-kimchi.login_main = function() {
-
- var selectedLanguage = kimchi.lang.get();
- var languages = kimchi.lang.all();
- for(var k in languages) {
- var opt = $([
- '<option value="',
- k,
- '">',
- languages[k],
- '</option>'
- ].join('')).appendTo($('#language'));
- $(opt).prop('selected', selectedLanguage === k);
- }
-
- $('#language').on('change', function() {
- kimchi.topic('languageChanged').publish($(this).val());
- });
-
- var validateNonEmpty = function(idsArray) {
- for(var i = 0; i < idsArray.length; i++) {
- var id = idsArray[i];
- if (!$('#' + id).val()) {
- $('#' + id + '-msg').text(i18n['KCHAUTH6002E']);
- placeCursor(id);
- return false;
- }
- else {
- $('#' + id + '-msg').empty();
- }
- }
-
- return true;
- };
-
- var userNameBox = $('#username');
- var passwordBox = $('#password');
- var loginButton = $('#btn-login');
- var placeCursor = function(id) {
- if (id && $('#' + id).size() > 0) {
- $('#' + id).focus();
- return;
- }
-
- var userName = kimchi.user.getUserName();
- userName && !userNameBox.val() && userNameBox.val(userName);
- var password = passwordBox.val();
-
- var nodeToFocus = !userName ? userNameBox : !password ? passwordBox : loginButton;
-
- $(nodeToFocus).focus();
- };
-
- var login = function(event) {
-
- if (!validateNonEmpty(['username', 'password'])) {
- return false;
- }
-
- loginButton.text(i18n['KCHAUTH6002M']).prop('disabled', true);
-
- var userName = userNameBox.val();
- userName && kimchi.user.setUserName(userName);
- var settings = {
- username: userName,
- password: passwordBox.val()
- };
-
- kimchi.login(settings, function() {
- var pAjax = kimchi.previousAjax;
- var consoleURL = kimchi.cookie.get("console_uri");
- if (consoleURL) {
- var path = /.*\/(.*?)\?.*/g.exec(consoleURL)[1];
- var query = consoleURL.substr(consoleURL.indexOf("?") + 1);
-
- var proxy_port = /.*port=(.*?)(&|$)/g.exec(consoleURL)[1];
- var http_port = /.*kimchi=(.*?)(&|$)/g.exec(consoleURL);
- var kimchi_port = http_port ? http_port[1] : location.port;
-
- url = location.protocol + "//" + location.hostname;
- url += ":" + proxy_port + "/console.html?url=" + path;
- url += "&" + query;
- url += "&kimchi=" + kimchi_port;
-
- kimchi.cookie.remove("console_uri");
- window.location.replace(url)
- }
- else if (pAjax && true === pAjax['resend']) {
- pAjax['error'] = pAjax['originalError'];
- $.ajax(pAjax);
- kimchi.previousAjax = null;
- }
- else if(pAjax) {
- window.location.reload();
- }
-
- kimchi.user.showUser(true);
- kimchi.window.close();
- }, function() {
- kimchi.message.error.code('KCHAUTH6001E');
- $('#btn-login').prop('disabled', false).text(i18n['KCHAUTH6001M']);
- placeCursor('username');
- });
-
- return false;
- };
-
- $('#form-login').on('submit', login);
-
- setTimeout(placeCursor, 0);
-};
diff --git a/ui/pages/login-window.html.tmpl b/ui/pages/login-window.html.tmpl
deleted file mode 100644
index 3e451c4..0000000
--- a/ui/pages/login-window.html.tmpl
+++ /dev/null
@@ -1,53 +0,0 @@
-#*
- * Project Kimchi
- *
- * Copyright IBM, Corp. 2013
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *#
-#unicode UTF-8
-#import gettext
-#from kimchi.cachebust import href
-#silent t = gettext.translation($lang.domain, $lang.localedir, languages=$lang.lang)
-#silent _ = t.gettext
-#silent _t = t.gettext
-<div id="login-window" class="window">
- <header>
- <div class="logo"></div>
- <span class="title">$_("Log In")</span>
- <form id="form-language" class="language" action="" method="GET">
- <div id="lang-selection-wrapper">
- <select id="language" class="i18n-selector"></select>
- </div>
- </form>
- </header>
- <div class="content login-panel">
- <form id="form-login" action="/login" method="POST">
- <div class="row">
- <input type="text" id="username" name="username" required="required" placeholder="$_("User Name")" />
- <div id="username-msg" class="msg-required"></div>
- </div>
- <div class="row">
- <input type="password" id="password" name="password" required="required" placeholder="$_("Password")" />
- <div id="password-msg" class="msg-required"></div>
- </div>
- <div class="row">
- <button id="btn-login" class="btn-normal">$_("Log in")</button>
- </div>
- </form>
- </div>
-</div>
-
-<script type="text/javascript">
- kimchi.login_main();
-</script>
--
1.9.3
More information about the Kimchi-devel
mailing list