Login form styling accomplished
This commit is contained in:
parent
d1d49a1d48
commit
2b747f1856
|
@ -1,11 +1,15 @@
|
|||
let angApp = require(__dirname+'/../init')
|
||||
|
||||
angApp.controller('LoginController', function($scope, ChimeVerseService, SettingsServise) {
|
||||
angApp.controller('LoginController', function($scope, ChimeVerseService, CredentialsServise) {
|
||||
|
||||
$scope.addAccountAndLoginAction = () => {
|
||||
SettingsServise.addCredentials($scope.bosh,
|
||||
$scope.login,
|
||||
$scope.password
|
||||
CredentialsServise.addCredentials($scope.credentials.bosh,
|
||||
$scope.credentials.login,
|
||||
$scope.credentials.password
|
||||
)
|
||||
ChimeVerseService.initConverse($scope.bosh, $scope.login, $scope.password)
|
||||
ChimeVerseService.initConverse($scope.credentials.bosh, $scope.credentials.login, $scope.credentials.password)
|
||||
$scope.accountForm.$setPristine()
|
||||
$scope.accountForm.$setUntouched()
|
||||
$scope.credentials = {}
|
||||
}
|
||||
});
|
|
@ -1,6 +1,6 @@
|
|||
let angApp = require(__dirname + '/../init')
|
||||
|
||||
angApp.factory('ChimeVerseService', ($window, SettingsServise, SystemService, AppStateService) => {
|
||||
angApp.factory('ChimeVerseService', ($window, CredentialsServise, SystemService, AppStateService) => {
|
||||
|
||||
let chimeverseService = {}
|
||||
|
||||
|
@ -14,9 +14,9 @@ angApp.factory('ChimeVerseService', ($window, SettingsServise, SystemService, Ap
|
|||
}
|
||||
|
||||
chimeverseService.logout = () => {
|
||||
let credentials = SettingsServise.getCredentials()
|
||||
let credentials = CredentialsServise.getCredentials()
|
||||
credentials.then((result) => {
|
||||
let remove = SettingsServise.removeCredentials(result.login)
|
||||
let remove = CredentialsServise.removeCredentials(result.login)
|
||||
console.log('Remove credential on logout')
|
||||
remove.then(() => {
|
||||
AppStateService.set(AppStateService.APP_STATE_LOGIN)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
let angApp = require(__dirname+'/../init')
|
||||
|
||||
angApp.factory('SettingsServise', () => {
|
||||
angApp.factory('CredentialsServise', () => {
|
||||
|
||||
const keytar = require('keytar')
|
||||
const settings = require('electron-settings')
|
|
@ -6,27 +6,31 @@
|
|||
<div class="login-form__wrapper">
|
||||
<div class="login-form__input-group">
|
||||
<span class="oi" data-glyph="link-intact"></span>
|
||||
<input ng-model="bosh" class="login-form__input" type="text" placeholder="Bosh service url" required>
|
||||
<input ng-model="credentials.bosh" class="login-form__input" type="text" placeholder="Bosh service url" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="login-form__wrapper">
|
||||
<div class="login-form__input-group">
|
||||
<span class="oi" data-glyph="person"></span>
|
||||
<input ng-model="login" class="login-form__input" type="text" placeholder="jid@jabber.org" required>
|
||||
<input ng-model="credentials.login" class="login-form__input" type="text" placeholder="jid@jabber.org" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="login-form__wrapper">
|
||||
<div class="login-form__input-group">
|
||||
<span class="oi" data-glyph="lock-locked"></span>
|
||||
<input ng-model="password" class="login-form__input" type="password" placeholder="Password" required>
|
||||
<input ng-model="credentials.password" class="login-form__input" type="password" placeholder="Password" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="login-form__wrapper">
|
||||
<button class="login-form__button" ng-click="addAccountAndLoginAction()" ng-disabled="accountForm.$invalid" disabled>Add account</button>
|
||||
</div>
|
||||
<div class="uk-text-small uk-text-center">
|
||||
Credentials stored via Keychain
|
||||
<div class="login-form__credentials-message">
|
||||
Credentials stored via <a href="https://atom.github.io/node-keytar/" target="_blank">Keychain</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="login-form__footer">
|
||||
<span class="footer__version">Chimeverse v0.1.52.</span>
|
||||
<a class="github-button" href="https://github.com/nick-denry/Chimeverse" data-icon="octicon-star" aria-label="Star nick-denry/Chimeverse on GitHub">Star</a>
|
||||
</div>
|
|
@ -38,6 +38,7 @@
|
|||
window.require = window.nodeRequire
|
||||
delete window.nodeRequire
|
||||
</script>
|
||||
<script async defer src="node_modules/github-buttons/dist/buttons.min.js"></script>
|
||||
<script>
|
||||
// You can also require other files to run in this process
|
||||
require('./node_modules/converse.js/dist/locales/' + navigator.language + '-LC_MESSAGES-converse-po.js')
|
||||
|
|
1
main.js
1
main.js
|
@ -43,6 +43,7 @@ function createWindow () {
|
|||
mainWindow = null
|
||||
})
|
||||
|
||||
// Open links on system default browser
|
||||
mainWindow.webContents.on('new-window', function(e, url) {
|
||||
e.preventDefault()
|
||||
shell.openExternal(url)
|
||||
|
|
|
@ -1639,6 +1639,11 @@
|
|||
"assert-plus": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"github-buttons": {
|
||||
"version": "2.8.0",
|
||||
"resolved": "https://registry.npmjs.org/github-buttons/-/github-buttons-2.8.0.tgz",
|
||||
"integrity": "sha512-luN2vRGV0GKT/P9FLqrWfa2DXddjNrDmv6eOLhFTU99yGv1OrMxVZEXKwSHlGmxhxvnZFYT6a3Hz42W07m3J1g=="
|
||||
},
|
||||
"github-from-package": {
|
||||
"version": "0.0.0",
|
||||
"resolved": "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz",
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
"angular": "^1.7.9",
|
||||
"converse.js": "^6.0.0",
|
||||
"electron-settings": "^3.2.0",
|
||||
"github-buttons": "^2.8.0",
|
||||
"keytar": "^4.13.0",
|
||||
"n": "^6.5.1",
|
||||
"open-iconic": "^1.1.1"
|
||||
|
|
10
renderer.js
10
renderer.js
|
@ -4,7 +4,7 @@
|
|||
|
||||
var angApp = require('./app/init')
|
||||
|
||||
require('./app/services/settings-service')
|
||||
require('./app/services/credentials-service')
|
||||
require('./app/services/system-service')
|
||||
require('./app/services/app-state-service')
|
||||
require('./app/services/chimeverse-service')
|
||||
|
@ -14,7 +14,7 @@ require('./app/controllers/default-controller')
|
|||
const chimeversePlugin = require('./libs/converse.js/3rdparty/chimeverse-plugin')
|
||||
chimeversePlugin.register()
|
||||
|
||||
angApp.controller('AppController', function ($scope, $timeout, ChimeVerseService, SettingsServise, AppStateService) {
|
||||
angApp.controller('AppController', function ($scope, $timeout, ChimeVerseService, CredentialsServise, AppStateService) {
|
||||
|
||||
//const { remote, ipcRenderer } = require('electron')
|
||||
const { ipcRenderer } = require('electron')
|
||||
|
@ -26,6 +26,10 @@ angApp.controller('AppController', function ($scope, $timeout, ChimeVerseService
|
|||
//remote.getCurrentWindow().reload()
|
||||
})
|
||||
|
||||
ipcRenderer.on('preferences-event', () => {
|
||||
AppStateService.set(AppStateService.APP_STATE_SETTINGS)
|
||||
})
|
||||
|
||||
$scope.state = AppStateService.APP_STATE_DEFAULT
|
||||
|
||||
$scope.$on('app:state:changed', (event, data) => {
|
||||
|
@ -37,7 +41,7 @@ angApp.controller('AppController', function ($scope, $timeout, ChimeVerseService
|
|||
});
|
||||
|
||||
$scope.getCredentialsAndLogin = () => {
|
||||
let credentials = SettingsServise.getCredentials()
|
||||
let credentials = CredentialsServise.getCredentials()
|
||||
credentials.then((result) => {
|
||||
ChimeVerseService.initConverse(result.bosh, result.login, result.password)
|
||||
}, (error) => {
|
||||
|
|
|
@ -16,6 +16,10 @@ body {
|
|||
-webkit-text-size-adjust: 100%;
|
||||
}
|
||||
|
||||
a {
|
||||
color: #777;
|
||||
}
|
||||
|
||||
.main-background {
|
||||
background: #f8f8f8;
|
||||
height: 100%;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
color: #777;
|
||||
left: 50%;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
top: 47%;
|
||||
transform: translate(-50%, -50%);
|
||||
}
|
||||
|
||||
|
@ -75,3 +75,23 @@
|
|||
.login-form__button:disabled {
|
||||
background: #eee;
|
||||
}
|
||||
|
||||
.login-form__credentials-message {
|
||||
font-size: 14px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.login-form__footer {
|
||||
bottom: 20px;
|
||||
color: #777;
|
||||
display: flex;
|
||||
left: 50%;
|
||||
position: absolute;
|
||||
text-align: center;
|
||||
transform: translate(-50%, 0%);
|
||||
}
|
||||
|
||||
.footer__version {
|
||||
font-size: 13px;
|
||||
margin-right: 30px;
|
||||
}
|
Loading…
Reference in New Issue