Updated account functions and UI, small fixes
This commit is contained in:
@@ -11,27 +11,6 @@
|
||||
@import "components/content/AccountContainer";
|
||||
|
||||
@import "components/content/Content";
|
||||
@import "components/content/about/About";
|
||||
@import "components/content/attribute/Attribute";
|
||||
@import "components/content/disadv/DisAdv";
|
||||
@import "components/content/herolist/Herolist";
|
||||
@import "components/content/master/Master";
|
||||
@import "components/content/master/InGame";
|
||||
@import "components/content/master/InGameControls";
|
||||
@import "components/content/master/InGameTableCenter";
|
||||
@import "components/content/master/InGameTableHealth";
|
||||
@import "components/content/master/InGameTableIni";
|
||||
@import "components/content/master/InGameTableLeft";
|
||||
@import "components/content/master/InGameTableRight";
|
||||
@import "components/content/profile/Profile";
|
||||
@import "components/content/rcp/RCP";
|
||||
@import "components/content/sheets/InventorySheet";
|
||||
@import "components/content/sheets/LiturgiesSheet";
|
||||
@import "components/content/sheets/MainSheet";
|
||||
@import "components/content/sheets/Sheets";
|
||||
@import "components/content/sheets/SpellsSheet";
|
||||
@import "components/content/sheets/TalentsSheet";
|
||||
@import "components/content/skills/Skills";
|
||||
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
|
||||
@@ -1,3 +1,26 @@
|
||||
@import "components/content/about/About";
|
||||
@import "components/content/account/Account";
|
||||
@import "components/content/attribute/Attribute";
|
||||
@import "components/content/disadv/DisAdv";
|
||||
@import "components/content/herolist/Herolist";
|
||||
@import "components/content/master/Master";
|
||||
@import "components/content/master/InGame";
|
||||
@import "components/content/master/InGameControls";
|
||||
@import "components/content/master/InGameTableCenter";
|
||||
@import "components/content/master/InGameTableHealth";
|
||||
@import "components/content/master/InGameTableIni";
|
||||
@import "components/content/master/InGameTableLeft";
|
||||
@import "components/content/master/InGameTableRight";
|
||||
@import "components/content/profile/Profile";
|
||||
@import "components/content/rcp/RCP";
|
||||
@import "components/content/sheets/InventorySheet";
|
||||
@import "components/content/sheets/LiturgiesSheet";
|
||||
@import "components/content/sheets/MainSheet";
|
||||
@import "components/content/sheets/Sheets";
|
||||
@import "components/content/sheets/SpellsSheet";
|
||||
@import "components/content/sheets/TalentsSheet";
|
||||
@import "components/content/skills/Skills";
|
||||
|
||||
#body > main > section {
|
||||
@extend %max-size-relative;
|
||||
padding-top: $titlebar-height;
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
#body > main section#account {
|
||||
.page {
|
||||
.scroll-inner {
|
||||
padding-bottom: 22px;
|
||||
|
||||
> div.padding {
|
||||
height: 22px;
|
||||
}
|
||||
|
||||
> .btn {
|
||||
margin-top: 20px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -36,9 +36,6 @@
|
||||
z-index: 1;
|
||||
flex: none;
|
||||
@include size($size);
|
||||
border-radius: 50%;
|
||||
padding: $padding;
|
||||
background: linear-gradient(to bottom, #9a7830 0%, #6d5024 100%);
|
||||
|
||||
> div {
|
||||
@include size($size - $padding * 2);
|
||||
@@ -56,11 +53,6 @@
|
||||
font-size: 21px;
|
||||
}
|
||||
}
|
||||
|
||||
> div.avatar {
|
||||
box-shadow: 0 0 1px 1px black inset;
|
||||
background-size: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
> .main {
|
||||
@@ -92,6 +84,10 @@
|
||||
visibility: visible;
|
||||
}
|
||||
}
|
||||
|
||||
> .btn.primary {
|
||||
min-width: 140px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
#body > main section#profile {
|
||||
.page#overview {
|
||||
.scroll-inner {
|
||||
padding-bottom: 22px;
|
||||
}
|
||||
|
||||
.title-wrapper {
|
||||
margin-top: 11px;
|
||||
display: flex;
|
||||
|
||||
@@ -2,4 +2,22 @@
|
||||
background-size: contain;
|
||||
background-repeat: no-repeat;
|
||||
background-position: 50%;
|
||||
box-shadow: 0 0 1px 1px black inset;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.avatar-wrapper {
|
||||
background: linear-gradient(to bottom, #9a7830 0%, #6d5024 100%);
|
||||
padding: 2px;
|
||||
border-radius: 50%;
|
||||
|
||||
&.no-avatar {
|
||||
border: 2px solid #2b2f34;
|
||||
padding: 0;
|
||||
background: none;
|
||||
|
||||
> .avatar {
|
||||
box-shadow: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
$modal-padding: 19px;
|
||||
$modal-padding: 24px;
|
||||
|
||||
.modal-backdrop {
|
||||
position: fixed;
|
||||
@@ -67,15 +67,13 @@ $modal-padding: 19px;
|
||||
}
|
||||
|
||||
.modal-header {
|
||||
padding: 7px $modal-padding 0;
|
||||
padding: $modal-padding $modal-padding $modal-padding * 5/8;
|
||||
|
||||
.modal-header-inner {
|
||||
font: bold 16px/30px Alegreya SC;
|
||||
font: bold 20px/24px Alegreya SC;
|
||||
color: #f1e6d4;
|
||||
letter-spacing: 0.1em;
|
||||
text-transform: uppercase;
|
||||
border-bottom: 1px solid #3c3c41;
|
||||
padding-bottom: 6px;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -87,14 +85,30 @@ $modal-padding: 19px;
|
||||
color: #878683;
|
||||
font: 11px/16px "Source Sans Pro";
|
||||
letter-spacing: 0.05em;
|
||||
padding: 22px $modal-padding 55px;
|
||||
padding: 0 $modal-padding 55px;
|
||||
|
||||
p {
|
||||
margin-top: 10px;
|
||||
margin-top: 14px;
|
||||
|
||||
span.link {
|
||||
color: #015175;
|
||||
display: block;
|
||||
letter-spacing: 0.03em;
|
||||
line-height: 22px;
|
||||
|
||||
&:hover {
|
||||
color: #3685a7;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
> div:first-child {
|
||||
margin-top: 0;
|
||||
> div {
|
||||
&:first-child {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
margin-top: 14px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,9 +71,6 @@ $avatar-height: 48px;
|
||||
|
||||
&.avatar-wrapper {
|
||||
flex-shrink: 0;
|
||||
border-radius: 50%;
|
||||
padding: 2px;
|
||||
background: linear-gradient(to bottom, #9a7830 0%, #6d5024 100%);
|
||||
@include size($avatar-height);
|
||||
|
||||
+ div {
|
||||
@@ -82,9 +79,6 @@ $avatar-height: 48px;
|
||||
|
||||
> div.avatar {
|
||||
@include size($avatar-height - 4px);
|
||||
border-radius: 50%;
|
||||
box-shadow: 0 0 1px 1px black inset;
|
||||
background-size: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -163,7 +157,7 @@ $avatar-height: 48px;
|
||||
margin-left: 11px;
|
||||
}
|
||||
|
||||
.ap {
|
||||
.ap, .account {
|
||||
flex: 1 0 auto;
|
||||
font: bold 15px/#{$titlebar-height} Alegreya SC;
|
||||
letter-spacing: 0.1em;
|
||||
|
||||
Vendored
+1551
-1819
File diff suppressed because it is too large
Load Diff
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+2
-2
@@ -17,10 +17,10 @@
|
||||
<div class="titlebar">
|
||||
<div class="main">
|
||||
<div class="left">
|
||||
<div class="tab disabled">Startseite</div>
|
||||
<div class="tab disabled">Konto</div>
|
||||
<div class="tab disabled">Start</div>
|
||||
<div class="tab disabled">Helden</div>
|
||||
<div class="tab disabled">Gruppen</div>
|
||||
<div class="tab disabled">Konto</div>
|
||||
<div class="tab disabled">Über</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
+5
-2
@@ -1,5 +1,5 @@
|
||||
import AccountActions from './actions/AccountActions';
|
||||
import AppController from './components/AppController';
|
||||
import AppDispatcher from './dispatcher/AppDispatcher';
|
||||
import React from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
import WebAPIUtils from './utils/WebAPIUtils';
|
||||
@@ -13,7 +13,10 @@ import WebAPIUtils from './utils/WebAPIUtils';
|
||||
// }
|
||||
|
||||
window.onunload = function() {
|
||||
AccountActions.logout('end');
|
||||
// WebAPIUtils.logoutSync();
|
||||
AppDispatcher.dispatch({
|
||||
actionType: 'LOGOUT_SUCCESS'
|
||||
});
|
||||
};
|
||||
|
||||
ReactDOM.render( <AppController />, document.getElementById('bodywrapper') );
|
||||
|
||||
+58
-352
@@ -1,388 +1,94 @@
|
||||
import AppDispatcher from '../dispatcher/AppDispatcher';
|
||||
import ActionTypes from '../constants/ActionTypes';
|
||||
import WebAPIUtils from '../utils/WebAPIUtils';
|
||||
import reactAlert from '../utils/reactAlert';
|
||||
import createOverlay from '../utils/createOverlay';
|
||||
import AccountStore from '../stores/core/AccountStore';
|
||||
import ForgotUsername from '../components/content/account/ForgotUsername';
|
||||
import ForgotPassword from '../components/content/account/ForgotPassword';
|
||||
import Login from '../components/content/account/Login';
|
||||
import React from 'react';
|
||||
import reactAlert from '../utils/reactAlert';
|
||||
import ReactDOM from 'react-dom';
|
||||
import Register from '../components/content/account/Register';
|
||||
import ResendActivation from '../components/content/account/ResendActivation';
|
||||
|
||||
var AccountActions = {
|
||||
showRegister: function() {
|
||||
createOverlay(<Register />);
|
||||
},
|
||||
showForgotName: function() {
|
||||
createOverlay(<ForgotUsername />);
|
||||
},
|
||||
showForgotPassword: function() {
|
||||
createOverlay(<ForgotPassword />);
|
||||
},
|
||||
showResend: function() {
|
||||
createOverlay(<ResendActivation />);
|
||||
},
|
||||
showLogin: function() {
|
||||
createOverlay(<Login />);
|
||||
},
|
||||
register: function(email, username, password) {
|
||||
|
||||
AppDispatcher.dispatch({
|
||||
actionType: ActionTypes.WAIT_START
|
||||
});
|
||||
|
||||
Promise.all([WebAPIUtils.checkEmail(email), WebAPIUtils.checkUsername(username)])
|
||||
.then(function(used){
|
||||
|
||||
if (used[0] == 'true' && used[1] == 'true') {
|
||||
|
||||
reactAlert('Daten bereits vorhanden', 'Sowohl die E-Mail-Adresse als auch der Benutzername sind bereits vorhanden.\n\nHast du deine Bestätigungs-E-Mail nicht empfangen? Dann melde dich einfach mit deinen Benutzerdaten an, sodass du deine E-Mail neu oder an einer andere Adresse verschicken kannst.');
|
||||
|
||||
Promise.all([ WebAPIUtils.checkEmail(email), WebAPIUtils.checkUsername(username) ])
|
||||
.then(function([ v_email, v_name ]){
|
||||
if (v_email === 'true' && v_name === 'true') {
|
||||
reactAlert('Benutzername und Email-Adresse bereits vorhanden', 'Sowohl die E-Mail-Adresse als auch der Benutzername sind bereits vorhanden.');
|
||||
AppDispatcher.dispatch({
|
||||
actionType: ActionTypes.WAIT_END
|
||||
});
|
||||
|
||||
} else if (used[0] == 'true' && used[1] == 'false') {
|
||||
|
||||
reactAlert('E-Mail-Adresse bereits vorhanden', 'Die E-Mail-Adresse wird bereits verwendet.');
|
||||
|
||||
} else if (v_email === 'true' && v_name === 'false') {
|
||||
reactAlert('Email-Adresse bereits vorhanden', 'Die E-Mail-Adresse wird bereits verwendet.');
|
||||
AppDispatcher.dispatch({
|
||||
actionType: ActionTypes.WAIT_END
|
||||
});
|
||||
|
||||
} else if (used[0] == 'false' && used[1] == 'true') {
|
||||
|
||||
} else if (v_email === 'false' && v_name === 'true') {
|
||||
reactAlert('Benutzername bereits vorhanden', 'Der Benutzername wird bereits verwendet.');
|
||||
|
||||
AppDispatcher.dispatch({
|
||||
actionType: ActionTypes.WAIT_END
|
||||
});
|
||||
|
||||
} else if (used[0] == 'false' && used[1] == 'false') {
|
||||
|
||||
return WebAPIUtils.register(email, username, password);
|
||||
|
||||
} else if (v_email && v_name ) {
|
||||
WebAPIUtils.register(email, username, password);
|
||||
}
|
||||
})
|
||||
.then(function(callback) {
|
||||
|
||||
AppDispatcher.dispatch({
|
||||
actionType: ActionTypes.REGISTRATION_SUCCESS
|
||||
});
|
||||
|
||||
})
|
||||
.catch(function() {
|
||||
|
||||
AppDispatcher.dispatch({
|
||||
actionType: ActionTypes.WAIT_END
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
},
|
||||
forgotPassword: function(email) {
|
||||
|
||||
AppDispatcher.dispatch({
|
||||
actionType: ActionTypes.WAIT_START
|
||||
});
|
||||
|
||||
WebAPIUtils.sendPasswordCode(email)
|
||||
.then(function(callback) {
|
||||
if ( callback == 'false' ) {
|
||||
|
||||
reactAlert('E-Mail nicht vorhanden', 'Die eingegebene E-Mail-Adresse ist nicht registriert.');
|
||||
|
||||
AppDispatcher.dispatch({
|
||||
actionType: ActionTypes.WAIT_END
|
||||
});
|
||||
|
||||
} else if ( callback == 'true' ) {
|
||||
|
||||
reactAlert('E-Mail erfolgreich verschickt', 'Du kannst jetzt in dein Postfach schauen; wir haben dir die E-Mail mit dem Link zum Zurücksetzen deines Passworts geschickt!');
|
||||
|
||||
AppDispatcher.dispatch({
|
||||
actionType: ActionTypes.WAIT_END
|
||||
});
|
||||
|
||||
}
|
||||
})
|
||||
.catch(function(){
|
||||
|
||||
AppDispatcher.dispatch({
|
||||
actionType: ActionTypes.WAIT_END
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
WebAPIUtils.sendPasswordCode(email);
|
||||
},
|
||||
forgotUsername: function(email) {
|
||||
|
||||
AppDispatcher.dispatch({
|
||||
actionType: ActionTypes.WAIT_START
|
||||
});
|
||||
|
||||
WebAPIUtils.sendUsername(email)
|
||||
.then(function(callback) {
|
||||
if ( callback == 'false' ) {
|
||||
|
||||
reactAlert('E-Mail nicht vorhanden', 'Die eingegebene E-Mail-Adresse ist nicht registriert.');
|
||||
|
||||
AppDispatcher.dispatch({
|
||||
actionType: ActionTypes.WAIT_END
|
||||
});
|
||||
|
||||
} else if ( callback == 'true' ) {
|
||||
|
||||
reactAlert('E-Mail erfolgreich verschickt', 'Du kannst jetzt in dein Postfach schauen; wir haben dir die E-Mail mit deinem Benutzernamen geschickt!');
|
||||
|
||||
AppDispatcher.dispatch({
|
||||
actionType: ActionTypes.WAIT_END
|
||||
});
|
||||
|
||||
}
|
||||
})
|
||||
.catch(function(){
|
||||
|
||||
AppDispatcher.dispatch({
|
||||
actionType: ActionTypes.WAIT_END
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
WebAPIUtils.sendUsername(email);
|
||||
},
|
||||
resendActivation: function(email) {
|
||||
|
||||
AppDispatcher.dispatch({
|
||||
actionType: ActionTypes.WAIT_START
|
||||
});
|
||||
|
||||
WebAPIUtils.resendActivation(email)
|
||||
.then(function(callback) {
|
||||
if ( callback == 'false' ) {
|
||||
|
||||
reactAlert('E-Mail nicht vorhanden', 'Die eingegebene E-Mail-Adresse ist nicht registriert.');
|
||||
|
||||
AppDispatcher.dispatch({
|
||||
actionType: ActionTypes.WAIT_END
|
||||
});
|
||||
|
||||
} else if ( callback == 'true' ) {
|
||||
|
||||
reactAlert('E-Mail erfolgreich verschickt', 'Du kannst jetzt in dein Postfach schauen; wir haben dir dieAktivierungsemail erneut geschickt!');
|
||||
|
||||
AppDispatcher.dispatch({
|
||||
actionType: ActionTypes.WAIT_END
|
||||
});
|
||||
|
||||
}
|
||||
})
|
||||
.catch(function(){
|
||||
|
||||
AppDispatcher.dispatch({
|
||||
actionType: ActionTypes.WAIT_END
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
WebAPIUtils.resendActivation(email);
|
||||
},
|
||||
login: function(username, password) {
|
||||
|
||||
AppDispatcher.dispatch({
|
||||
actionType: ActionTypes.WAIT_START
|
||||
});
|
||||
|
||||
var userid;
|
||||
|
||||
WebAPIUtils.login(username, password)
|
||||
.then(function(callback) {
|
||||
|
||||
if ( callback == 'false' ) {
|
||||
|
||||
reactAlert('Anmeldeversuch fehlgeschlagen', 'Die eigegebene Kombination aus Benutzername und Passwort wurde nicht erkannt. Stelle sicher, dass du dich nicht vertippt hast und versuche es nochmal.');
|
||||
|
||||
AppDispatcher.dispatch({
|
||||
actionType: ActionTypes.WAIT_END
|
||||
});
|
||||
|
||||
} else if ( callback == 'notactive' ) {
|
||||
|
||||
reactAlert('Benutzerkonto nicht aktiviert', 'Das hinterlegte Benutzerkonto wurde noch nicht aktivert. Bitte aktiviere das Konto über den Aktivierungslink in der Aktivierungsemail.');
|
||||
|
||||
AppDispatcher.dispatch({
|
||||
actionType: ActionTypes.WAIT_END
|
||||
});
|
||||
|
||||
} else if ( callback == 'logged' ) {
|
||||
|
||||
reactAlert('Benutzer bereits angemeldet', 'Das Konto ist momentan an einem anderen Ort (Gerät oder Browser) angemeldet. Es kann nicht mehrere Male auf ein Konto zugegriffen werden.');
|
||||
|
||||
AppDispatcher.dispatch({
|
||||
actionType: ActionTypes.WAIT_END
|
||||
});
|
||||
|
||||
} else {
|
||||
|
||||
userid = callback;
|
||||
|
||||
return WebAPIUtils.getHeroes(userid);
|
||||
|
||||
}
|
||||
})
|
||||
.then(function(callback) {
|
||||
|
||||
if ( userid !== undefined ) {
|
||||
if ( callback == 'false' ) {
|
||||
|
||||
reactAlert('Da hat etwas nicht geklappt', 'Dies darf nicht passieren! Melde dies bitte als Fehler! Wir versuchen, das Problem schnellstmöglich zu beheben!');
|
||||
|
||||
AppDispatcher.dispatch({
|
||||
actionType: ActionTypes.WAIT_END
|
||||
});
|
||||
|
||||
} else {
|
||||
|
||||
AppDispatcher.dispatch({
|
||||
actionType: ActionTypes.RECEIVE_ACCOUNT,
|
||||
userid,
|
||||
username,
|
||||
raw: callback
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
.catch(function(){
|
||||
|
||||
AppDispatcher.dispatch({
|
||||
actionType: ActionTypes.WAIT_END
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
WebAPIUtils.login(username, password);
|
||||
},
|
||||
logout: function(src) {
|
||||
|
||||
let userid = AccountStore.getID();
|
||||
|
||||
if (userid > 0) {
|
||||
if (src == 'end') {
|
||||
WebAPIUtils.logoutSync();
|
||||
}
|
||||
else {
|
||||
AppDispatcher.dispatch({
|
||||
actionType: ActionTypes.WAIT_START
|
||||
});
|
||||
|
||||
WebAPIUtils.logout()
|
||||
.then(function(callback) {
|
||||
|
||||
if ( callback == 'true' ) {
|
||||
|
||||
reactAlert('Abmeldung erfolgreich', 'Du wurdest erfolgreich abgemeldet.');
|
||||
|
||||
AppDispatcher.dispatch({
|
||||
actionType: ActionTypes.CLEAR_ACCOUNT
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
})
|
||||
.catch(function(){
|
||||
|
||||
AppDispatcher.dispatch({
|
||||
actionType: ActionTypes.WAIT_END
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
logout: function() {
|
||||
WebAPIUtils.logout();
|
||||
},
|
||||
changeUsername: function(username) {
|
||||
|
||||
AppDispatcher.dispatch({
|
||||
actionType: ActionTypes.WAIT_START
|
||||
});
|
||||
|
||||
WebAPIUtils.setNewUsername(username)
|
||||
.then(function(callback) {
|
||||
if ( callback == 'false' ) {
|
||||
|
||||
reactAlert('Da hat etwas nicht geklappt', 'Dies darf nicht passieren! Melde dies bitte als Fehler! Wir versuchen, das Problem schnellstmöglich zu beheben!');
|
||||
|
||||
AppDispatcher.dispatch({
|
||||
actionType: ActionTypes.WAIT_END
|
||||
});
|
||||
|
||||
} else if ( callback == 'true' ) {
|
||||
|
||||
reactAlert('E-Benutzernamen erfolgreich geändert', 'Dein Benutzername wurde erfolgreich geändert.');
|
||||
|
||||
AppDispatcher.dispatch({
|
||||
actionType: ActionTypes.UPDATE_USERNAME,
|
||||
username
|
||||
});
|
||||
|
||||
}
|
||||
})
|
||||
.catch(function(){
|
||||
|
||||
AppDispatcher.dispatch({
|
||||
actionType: ActionTypes.WAIT_END
|
||||
});
|
||||
|
||||
});
|
||||
WebAPIUtils.setNewUsername(username);
|
||||
},
|
||||
changePassword: function(password) {
|
||||
|
||||
AppDispatcher.dispatch({
|
||||
actionType: ActionTypes.WAIT_START
|
||||
});
|
||||
|
||||
WebAPIUtils.setNewPassword(password)
|
||||
.then(function(callback) {
|
||||
if ( callback == 'false' ) {
|
||||
|
||||
reactAlert('Da hat etwas nicht geklappt', 'Dies darf nicht passieren! Melde dies bitte als Fehler! Wir versuchen, das Problem schnellstmöglich zu beheben!');
|
||||
|
||||
AppDispatcher.dispatch({
|
||||
actionType: ActionTypes.WAIT_END
|
||||
});
|
||||
|
||||
} else if ( callback == 'true' ) {
|
||||
|
||||
reactAlert('Passwort erfolgreich geändert', 'Dein Passwort wurde erfolgreich geändert.');
|
||||
|
||||
AppDispatcher.dispatch({
|
||||
actionType: ActionTypes.PASSWORD_CHANGE_SUCCESS
|
||||
});
|
||||
|
||||
}
|
||||
})
|
||||
.catch(function(){
|
||||
|
||||
AppDispatcher.dispatch({
|
||||
actionType: ActionTypes.WAIT_END
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
WebAPIUtils.setNewPassword(password);
|
||||
},
|
||||
delete: function(password) {
|
||||
|
||||
AppDispatcher.dispatch({
|
||||
actionType: ActionTypes.WAIT_START
|
||||
});
|
||||
|
||||
WebAPIUtils.deleteAccount()
|
||||
.then(function(callback) {
|
||||
if ( callback == 'false' ) {
|
||||
|
||||
reactAlert('Da hat etwas nicht geklappt', 'Dies darf nicht passieren! Melde dies bitte als Fehler! Wir versuchen, das Problem schnellstmöglich zu beheben!');
|
||||
|
||||
AppDispatcher.dispatch({
|
||||
actionType: ActionTypes.WAIT_END
|
||||
});
|
||||
|
||||
} else if ( callback == 'true' ) {
|
||||
|
||||
reactAlert('Konto gelöscht', 'Dein Konto wurde mitsamt aller Helden und Gruppen erfolgreich gelöscht.');
|
||||
|
||||
AppDispatcher.dispatch({
|
||||
actionType: ActionTypes.CLEAR_ACCOUNT
|
||||
});
|
||||
|
||||
}
|
||||
})
|
||||
.catch(function(){
|
||||
|
||||
AppDispatcher.dispatch({
|
||||
actionType: ActionTypes.WAIT_END
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
deleteConfirm: function() {
|
||||
reactAlert(
|
||||
'Konto wirklich löschen?',
|
||||
'Soll dein Konto wirklich gelöscht werden? Wenn du diesem zustimmst, werden sämtliche deiner eigenen Helden und Gruppen unwiederbringlich gelöscht. Möchtest du wirklich fortfahren?',
|
||||
[
|
||||
{
|
||||
label: 'Konto löschen',
|
||||
onClick: this.delete
|
||||
},
|
||||
{
|
||||
label: 'Abbrechen'
|
||||
}
|
||||
]
|
||||
);
|
||||
},
|
||||
delete: function() {
|
||||
WebAPIUtils.deleteAccount();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import AppDispatcher from '../dispatcher/AppDispatcher';
|
||||
import ActionTypes from '../constants/ActionTypes';
|
||||
import createDialogNode from '../utils/createDialogNode';
|
||||
import createOverlay from '../utils/createOverlay';
|
||||
import HeroCreation from '../components/content/herolist/HeroCreation';
|
||||
import React from 'react';
|
||||
import reactAlert from '../utils/reactAlert';
|
||||
@@ -9,26 +9,7 @@ import WebAPIUtils from '../utils/WebAPIUtils';
|
||||
|
||||
var HerolistActions = {
|
||||
refresh: function() {
|
||||
AppDispatcher.dispatch({
|
||||
actionType: ActionTypes.WAIT_START
|
||||
});
|
||||
WebAPIUtils.getHeroes().then(function(callback) {
|
||||
if ( callback == 'false' ) {
|
||||
reactAlert('Da hat etwas nicht geklappt', 'Dies darf nicht passieren! Melde dies bitte als Fehler! Wir versuchen, das Problem schnellstmöglich zu beheben!');
|
||||
AppDispatcher.dispatch({
|
||||
actionType: ActionTypes.WAIT_END
|
||||
});
|
||||
} else {
|
||||
AppDispatcher.dispatch({
|
||||
actionType: ActionTypes.RECEIVE_RAW_HEROLIST,
|
||||
raw: callback
|
||||
});
|
||||
}
|
||||
}).catch(function(){
|
||||
AppDispatcher.dispatch({
|
||||
actionType: ActionTypes.WAIT_END
|
||||
});
|
||||
});
|
||||
WebAPIUtils.getHeroes();
|
||||
},
|
||||
filter: function(text) {
|
||||
AppDispatcher.dispatch({
|
||||
@@ -43,11 +24,13 @@ var HerolistActions = {
|
||||
});
|
||||
},
|
||||
load: function(id) {
|
||||
AppDispatcher.dispatch({
|
||||
actionType: ActionTypes.CLEAR_HERO
|
||||
});
|
||||
WebAPIUtils.loadHero(id);
|
||||
},
|
||||
showHeroCreation: function() {
|
||||
var node = createDialogNode();
|
||||
ReactDOM.render( <HeroCreation node={node} />, node );
|
||||
createOverlay(<HeroCreation />);
|
||||
},
|
||||
createNewHero: function(options) {
|
||||
AppDispatcher.dispatch({
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import AppDispatcher from '../dispatcher/AppDispatcher';
|
||||
import ActionTypes from '../constants/ActionTypes';
|
||||
import createDialogNode from '../utils/createDialogNode';
|
||||
import createOverlay from '../utils/createOverlay';
|
||||
import Dialog from '../components/layout/Dialog';
|
||||
import React from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
@@ -11,71 +11,60 @@ var InGameActions = {
|
||||
actionType: ActionTypes.LOAD_RAW_INGAME_DATA
|
||||
});
|
||||
},
|
||||
|
||||
previousPhase: function(){
|
||||
AppDispatcher.dispatch({
|
||||
actionType: ActionTypes.INGAME_PREVIOUS_PHASE
|
||||
});
|
||||
},
|
||||
|
||||
nextPhase: function(){
|
||||
AppDispatcher.dispatch({
|
||||
actionType: ActionTypes.INGAME_NEXT_PHASE
|
||||
});
|
||||
},
|
||||
|
||||
cast: function(){
|
||||
AppDispatcher.dispatch({
|
||||
actionType: ActionTypes.UPDATE_INGAME_CAST
|
||||
});
|
||||
},
|
||||
|
||||
stopCast: function(){
|
||||
AppDispatcher.dispatch({
|
||||
actionType: ActionTypes.CANCEL_INGAME_CAST
|
||||
});
|
||||
},
|
||||
|
||||
useEndurance: function(id){
|
||||
AppDispatcher.dispatch({
|
||||
actionType: ActionTypes.INGAME_USE_ENDURANCE,
|
||||
id
|
||||
});
|
||||
},
|
||||
|
||||
useAction: function(id){
|
||||
AppDispatcher.dispatch({
|
||||
actionType: ActionTypes.INGAME_USE_ACTION,
|
||||
id
|
||||
});
|
||||
},
|
||||
|
||||
useFreeAction: function(id){
|
||||
AppDispatcher.dispatch({
|
||||
actionType: ActionTypes.INGAME_USE_FREE_ACTION,
|
||||
id
|
||||
});
|
||||
},
|
||||
|
||||
activateFighter: function(){
|
||||
AppDispatcher.dispatch({
|
||||
actionType: ActionTypes.INGAME_ACTIVATE_FIGHTER
|
||||
});
|
||||
},
|
||||
|
||||
deactivateFighter: function(){
|
||||
AppDispatcher.dispatch({
|
||||
actionType: ActionTypes.INGAME_DEACTIVATE_FIGHTER
|
||||
});
|
||||
},
|
||||
|
||||
edit: function(id){
|
||||
AppDispatcher.dispatch({
|
||||
actionType: ActionTypes.INGAME_EDIT_START,
|
||||
id
|
||||
});
|
||||
},
|
||||
|
||||
editValue: function(tag, value){
|
||||
AppDispatcher.dispatch({
|
||||
actionType: ActionTypes.INGAME_EDIT_UPDATE_VALUE,
|
||||
@@ -83,94 +72,74 @@ var InGameActions = {
|
||||
value
|
||||
});
|
||||
},
|
||||
|
||||
editCast: function(value){
|
||||
AppDispatcher.dispatch({
|
||||
actionType: ActionTypes.INGAME_EDIT_UPDATE_CAST_VALUE,
|
||||
value
|
||||
});
|
||||
},
|
||||
|
||||
editDuplicate: function(value){
|
||||
AppDispatcher.dispatch({
|
||||
actionType: ActionTypes.INGAME_EDIT_UPDATE_DUPLICATE_VALUE,
|
||||
value
|
||||
});
|
||||
},
|
||||
|
||||
closeEdit: function(){
|
||||
AppDispatcher.dispatch({
|
||||
actionType: ActionTypes.INGAME_EDIT_END
|
||||
});
|
||||
},
|
||||
|
||||
addFighter: function(){
|
||||
AppDispatcher.dispatch({
|
||||
actionType: ActionTypes.INGAME_ADD_FIGHTER
|
||||
});
|
||||
},
|
||||
|
||||
duplicateFighter: function(){
|
||||
AppDispatcher.dispatch({
|
||||
actionType: ActionTypes.INGAME_DUPLICATE_FIGHTER
|
||||
});
|
||||
},
|
||||
|
||||
removeFighter: function(){
|
||||
AppDispatcher.dispatch({
|
||||
actionType: ActionTypes.INGAME_REMOVE_FIGHTER
|
||||
});
|
||||
},
|
||||
|
||||
resetAll: function(){
|
||||
|
||||
var node = createDialogNode();
|
||||
|
||||
var resetAllFinal = function() {
|
||||
AppDispatcher.dispatch({ actionType: ActionTypes.INGAME_RESET_ALL });
|
||||
};
|
||||
|
||||
ReactDOM.render(
|
||||
createOverlay(
|
||||
<Dialog
|
||||
title='Liste zurücksetzen'
|
||||
node={node}
|
||||
buttons={[
|
||||
{ label: 'Ja', onClick: resetAllFinal },
|
||||
{ label: 'Nein' }
|
||||
]}>
|
||||
Bist du dir sicher, dass du die gesamte Liste zurücksetzen möchtest? Der Vorgang kann nicht rückgängig gemacht werden!
|
||||
</Dialog>,
|
||||
node
|
||||
</Dialog>
|
||||
);
|
||||
|
||||
|
||||
},
|
||||
|
||||
resetPhases: function(){
|
||||
AppDispatcher.dispatch({
|
||||
actionType: ActionTypes.INGAME_RESET_PHASES
|
||||
});
|
||||
},
|
||||
|
||||
resetHealth: function(){
|
||||
AppDispatcher.dispatch({
|
||||
actionType: ActionTypes.INGAME_RESET_HEALTH
|
||||
});
|
||||
},
|
||||
|
||||
setOnline: function(value){
|
||||
AppDispatcher.dispatch({
|
||||
actionType: ActionTypes.INGAME_UPDATE_ONLINE_LINK,
|
||||
value
|
||||
});
|
||||
},
|
||||
|
||||
save: function(){
|
||||
AppDispatcher.dispatch({
|
||||
actionType: ActionTypes.INGAME_SAVE
|
||||
});
|
||||
},
|
||||
|
||||
switchOption: function(option){
|
||||
AppDispatcher.dispatch({
|
||||
actionType: ActionTypes.INGAME_SWITCH_OPTION,
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import AppDispatcher from '../dispatcher/AppDispatcher';
|
||||
import ActionTypes from '../constants/ActionTypes';
|
||||
import createDialogNode from '../utils/createDialogNode';
|
||||
import React from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
import Selections from '../components/content/rcp/Selections';
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import AppDispatcher from '../dispatcher/AppDispatcher';
|
||||
import ActionTypes from '../constants/ActionTypes';
|
||||
import createDialogNode from '../utils/createDialogNode';
|
||||
import React from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
import Selections from '../components/content/rcp/Selections';
|
||||
|
||||
+150
-5
@@ -4,12 +4,24 @@ import HerolistStore from '../stores/core/HerolistStore';
|
||||
import reactAlert from '../utils/reactAlert';
|
||||
|
||||
var ServerActions = {
|
||||
connectionError: function(error) {
|
||||
reactAlert('Verbindung nicht möglich', `Die App konnte keine Verbindung zum Server herstellen. Bitte überprüfe deine Internetverbindung! ${error}`);
|
||||
startLoading: function() {
|
||||
AppDispatcher.dispatch({
|
||||
actionType: ActionTypes.WAIT_START
|
||||
});
|
||||
},
|
||||
runtimeError: function() {
|
||||
reactAlert('Da hat etwas nicht geklappt', 'Dies darf nicht passieren! Melde dies bitte als Fehler! Wir versuchen, das Problem schnellstmöglich zu beheben!');
|
||||
AppDispatcher.dispatch({
|
||||
actionType: ActionTypes.WAIT_END
|
||||
});
|
||||
},
|
||||
connectionError: function(error) {
|
||||
reactAlert('Verbindung nicht möglich', 'Die App konnte keine Verbindung zum Server herstellen. Bitte überprüfe deine Internetverbindung! ' + error + ' Es kann bei diesem Problem auch möglich sein, dass etwas im Programmablauf nicht stimmt. Informiere uns bitte über dein Problem, sollte es deiner Erkenntnis nach nicht an der Verbindung liegen!');
|
||||
AppDispatcher.dispatch({
|
||||
actionType: ActionTypes.WAIT_END
|
||||
});
|
||||
},
|
||||
|
||||
receiveLists: function(raw) {
|
||||
AppDispatcher.dispatch({
|
||||
actionType: ActionTypes.RECEIVE_RAW_LISTS,
|
||||
@@ -17,16 +29,149 @@ var ServerActions = {
|
||||
});
|
||||
},
|
||||
registrationSuccess: function() {
|
||||
reactAlert('Konto bestätigen', 'Wir haben dir eine E-Mail an die angegebene Adresse geschickt. Dort wirst du einen Bestätigungslink finden, dem du einfach nur zu folgen brauchst, um dein Konto zu aktivieren.');
|
||||
AppDispatcher.dispatch({
|
||||
actionType: ActionTypes.REGISTRATION_SUCCESS
|
||||
});
|
||||
},
|
||||
receiveUser: function(raw) {
|
||||
forgotPasswordSuccess: function(callback) {
|
||||
switch (callback) {
|
||||
case 'false':
|
||||
reactAlert('E-Mail nicht vorhanden', 'Die eingegebene E-Mail-Adresse ist nicht registriert.');
|
||||
AppDispatcher.dispatch({
|
||||
actionType: ActionTypes.WAIT_END
|
||||
});
|
||||
break;
|
||||
|
||||
default:
|
||||
reactAlert('E-Mail erfolgreich verschickt', 'Du kannst jetzt in dein Postfach schauen; wir haben dir die E-Mail mit dem Link zum Zurücksetzen deines Passworts geschickt!');
|
||||
AppDispatcher.dispatch({
|
||||
actionType: ActionTypes.WAIT_END
|
||||
});
|
||||
break;
|
||||
}
|
||||
},
|
||||
forgotUsernameSuccess: function(callback) {
|
||||
switch (callback) {
|
||||
case 'false':
|
||||
reactAlert('E-Mail nicht vorhanden', 'Die eingegebene E-Mail-Adresse ist nicht registriert.');
|
||||
AppDispatcher.dispatch({
|
||||
actionType: ActionTypes.WAIT_END
|
||||
});
|
||||
break;
|
||||
|
||||
default:
|
||||
reactAlert('E-Mail erfolgreich verschickt', 'Du kannst jetzt in dein Postfach schauen; wir haben dir die E-Mail mit deinem Benutzernamen geschickt!');
|
||||
AppDispatcher.dispatch({
|
||||
actionType: ActionTypes.WAIT_END
|
||||
});
|
||||
break;
|
||||
}
|
||||
},
|
||||
resendActivationSuccess: function(callback) {
|
||||
switch (callback) {
|
||||
case 'false':
|
||||
this.runtimeError();
|
||||
break;
|
||||
|
||||
default:
|
||||
reactAlert('E-Mail erfolgreich verschickt', 'Du kannst jetzt in dein Postfach schauen; wir haben dir die Aktivierungsemail erneut geschickt!');
|
||||
AppDispatcher.dispatch({
|
||||
actionType: ActionTypes.WAIT_END
|
||||
});
|
||||
break;
|
||||
}
|
||||
},
|
||||
logoutSuccess: function() {
|
||||
AppDispatcher.dispatch({
|
||||
actionType: ActionTypes.LOGIN_SUCCESS,
|
||||
raw
|
||||
actionType: ActionTypes.LOGOUT_SUCCESS
|
||||
});
|
||||
},
|
||||
receiveAccount: function(callback, name) {
|
||||
switch (callback) {
|
||||
case 'false':
|
||||
reactAlert('Anmeldeversuch fehlgeschlagen', 'Die eigegebene Kombination aus Benutzername und Passwort wurde nicht erkannt. Stelle sicher, dass du dich nicht vertippt hast und versuche es nochmal.');
|
||||
AppDispatcher.dispatch({
|
||||
actionType: ActionTypes.WAIT_END
|
||||
});
|
||||
break;
|
||||
case 'notactive':
|
||||
reactAlert('Benutzerkonto nicht aktiviert', 'Das hinterlegte Benutzerkonto wurde noch nicht aktivert. Bitte aktiviere das Konto über den Aktivierungslink in der Aktivierungsemail.');
|
||||
AppDispatcher.dispatch({
|
||||
actionType: ActionTypes.WAIT_END
|
||||
});
|
||||
break;
|
||||
case 'logged':
|
||||
reactAlert('Benutzer bereits angemeldet', 'Das Konto ist momentan an einem anderen Ort (Gerät oder Browser) angemeldet. Es kann nicht mehrere Male auf ein Konto zugegriffen werden.');
|
||||
AppDispatcher.dispatch({
|
||||
actionType: ActionTypes.WAIT_END
|
||||
});
|
||||
break;
|
||||
default: {
|
||||
let [ id, heroes ] = JSON.parse(callback);
|
||||
AppDispatcher.dispatch({
|
||||
actionType: ActionTypes.RECEIVE_ACCOUNT,
|
||||
id, name, heroes
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
changeUsernameSuccess: function(callback) {
|
||||
switch (callback) {
|
||||
case 'false':
|
||||
this.runtimeError();
|
||||
break;
|
||||
|
||||
default:
|
||||
reactAlert('Passwort erfolgreich geändert', 'Dein Passwort wurde erfolgreich geändert.');
|
||||
AppDispatcher.dispatch({
|
||||
actionType: ActionTypes.PASSWORD_CHANGE_SUCCESS
|
||||
});
|
||||
break;
|
||||
}
|
||||
},
|
||||
changePasswordSuccess: function(callback) {
|
||||
switch (callback) {
|
||||
case 'false':
|
||||
this.runtimeError();
|
||||
break;
|
||||
|
||||
default:
|
||||
reactAlert('Passwort erfolgreich geändert', 'Dein Passwort wurde erfolgreich geändert.');
|
||||
AppDispatcher.dispatch({
|
||||
actionType: ActionTypes.PASSWORD_CHANGE_SUCCESS
|
||||
});
|
||||
break;
|
||||
}
|
||||
},
|
||||
deleteAccountSuccess: function(callback) {
|
||||
switch (callback) {
|
||||
case 'false':
|
||||
this.runtimeError();
|
||||
break;
|
||||
|
||||
default:
|
||||
reactAlert('Konto gelöscht', 'Dein Konto wurde mitsamt aller Helden und Gruppen erfolgreich gelöscht.');
|
||||
AppDispatcher.dispatch({
|
||||
actionType: ActionTypes.CLEAR_ACCOUNT
|
||||
});
|
||||
break;
|
||||
}
|
||||
},
|
||||
herolistRefreshSuccess: function(rawHeroes) {
|
||||
switch (rawHeroes) {
|
||||
case 'false':
|
||||
this.runtimeError();
|
||||
break;
|
||||
|
||||
default:
|
||||
AppDispatcher.dispatch({
|
||||
actionType: ActionTypes.RECEIVE_RAW_HEROLIST,
|
||||
rawHeroes
|
||||
});
|
||||
break;
|
||||
}
|
||||
},
|
||||
loadHeroSuccess: function(id, data) {
|
||||
var short = HerolistStore.get(id);
|
||||
AppDispatcher.dispatch({
|
||||
|
||||
@@ -1,34 +1,29 @@
|
||||
import AppDispatcher from '../dispatcher/AppDispatcher';
|
||||
import ActionTypes from '../constants/ActionTypes';
|
||||
import reactAlert from '../utils/reactAlert';
|
||||
import saveHero from '../utils/saveHero';
|
||||
import AccountStore from '../stores/core/AccountStore';
|
||||
|
||||
var TabActions = {
|
||||
openTab: function(tab) {
|
||||
|
||||
AppDispatcher.dispatch({
|
||||
actionType: ActionTypes.SHOW_TAB,
|
||||
tab
|
||||
});
|
||||
|
||||
},
|
||||
showSection: function(section) {
|
||||
|
||||
AppDispatcher.dispatch({
|
||||
actionType: ActionTypes.SHOW_TAB_SECTION,
|
||||
section
|
||||
});
|
||||
|
||||
},
|
||||
openHero: function(id) {
|
||||
|
||||
AppDispatcher.dispatch({
|
||||
actionType: ActionTypes.RECEIVE_RAW_HERO_STRING,
|
||||
data: WebAPIUtils.getHero(id)
|
||||
});
|
||||
|
||||
},
|
||||
saveHero: function() {
|
||||
saveHero();
|
||||
let currentAccountID = AccountStore.getID();
|
||||
if (currentAccountID === null) {
|
||||
reactAlert('Speichern nicht möglich', 'Um einen Charakter zu speichern, musst du angemeldet sein. Dein Fortschritt geht jedoch nicht verloren. Du kannst den Charakter nach der Anmeldung speichern, solange du diese Seite nicht verlässt oder neu lädst.');
|
||||
} else {
|
||||
saveHero();
|
||||
}
|
||||
},
|
||||
clearCurrentHero: function() {
|
||||
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
import React, { Component } from 'react';
|
||||
import GeminiScrollbar from 'react-gemini-scrollbar';
|
||||
|
||||
class AccountContainer extends Component {
|
||||
|
||||
constructor(props) {
|
||||
super(props);
|
||||
}
|
||||
|
||||
render() {
|
||||
|
||||
return (
|
||||
<main className="center">
|
||||
<GeminiScrollbar className="account-scroll">
|
||||
<section className="account" id={this.props.id}>
|
||||
<div className="account-inner">
|
||||
{this.props.children}
|
||||
</div>
|
||||
</section>
|
||||
</GeminiScrollbar>
|
||||
</main>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default AccountContainer;
|
||||
@@ -1,12 +1,5 @@
|
||||
import About from './about/About';
|
||||
import ChangeAccount from './account/ChangeAccount';
|
||||
import DeleteAccount from './account/DeleteAccount';
|
||||
import ForgotPassword from './account/ForgotPassword';
|
||||
import ForgotUsername from './account/ForgotUsername';
|
||||
import Login from './account/Login';
|
||||
import Registration from './account/Registration';
|
||||
import RegistrationConfirm from './account/RegistrationConfirm';
|
||||
import ResendActivation from './account/ResendActivation';
|
||||
import Account from './account/Account';
|
||||
import Attribute from './attributes/Attribute';
|
||||
import DisAdv from './disadv/DisAdv';
|
||||
import Grouplist from './grouplist/Grouplist';
|
||||
@@ -36,34 +29,6 @@ class Content extends Component {
|
||||
var tabElement;
|
||||
|
||||
switch (this.props.tab) {
|
||||
case 'registration':
|
||||
tabElement = <Registration />;
|
||||
break;
|
||||
case 'confirmRegistration':
|
||||
tabElement = <RegistrationConfirm />;
|
||||
break;
|
||||
case 'forgotPassword':
|
||||
tabElement = <ForgotPassword />;
|
||||
break;
|
||||
case 'forgotUsername':
|
||||
tabElement = <ForgotUsername />;
|
||||
break;
|
||||
case 'resendActivation':
|
||||
tabElement = <ResendActivation />;
|
||||
break;
|
||||
case 'login':
|
||||
tabElement = <Login />;
|
||||
break;
|
||||
case 'changeAccountUsername':
|
||||
tabElement = <ChangeAccount type="username" />;
|
||||
break;
|
||||
case 'changeAccountPassword':
|
||||
tabElement = <ChangeAccount type="password" />;
|
||||
break;
|
||||
case 'deleteAccount':
|
||||
tabElement = <DeleteAccount />;
|
||||
break;
|
||||
|
||||
case 'home':
|
||||
tabElement = <Home />;
|
||||
break;
|
||||
@@ -73,6 +38,9 @@ class Content extends Component {
|
||||
case 'grouplist':
|
||||
tabElement = <Grouplist />;
|
||||
break;
|
||||
case 'account':
|
||||
tabElement = <Account />;
|
||||
break;
|
||||
case 'about':
|
||||
tabElement = <About />;
|
||||
break;
|
||||
|
||||
@@ -16,16 +16,20 @@ class About extends Component {
|
||||
<h2>Impressum</h2>
|
||||
|
||||
<h3>Thore Schuchardt</h3>
|
||||
Online Client, Server<br/>
|
||||
Lehmberg 7b<br/>
|
||||
24361 Groß Wittensee<br/>
|
||||
<a href="mailto:schuchi@dsa-sh.de">schuchi@dsa-sh.de</a>
|
||||
<div>
|
||||
Backend-Dev<br/>
|
||||
Lehmberg 7b<br/>
|
||||
24361 Groß Wittensee<br/>
|
||||
<a href="mailto:schuchi@dsa-sh.de">schuchi@dsa-sh.de</a>
|
||||
</div>
|
||||
|
||||
<h3>Lukas Obermann</h3>
|
||||
Design, Online Client<br/>
|
||||
Eekholl 11<br/>
|
||||
24361 Groß Wittensee<br/>
|
||||
<a href="mailto:lukas@dsa-sh.de">lukas@dsa-sh.de</a>
|
||||
<div>
|
||||
Frontend-Dev<br/>
|
||||
Eekholl 11<br/>
|
||||
24361 Groß Wittensee<br/>
|
||||
<a href="mailto:lukas@dsa-sh.de">lukas@dsa-sh.de</a>
|
||||
</div>
|
||||
|
||||
<h2>Haftungsausschluss</h2>
|
||||
|
||||
@@ -51,6 +55,54 @@ class About extends Component {
|
||||
<h2>Cha5App Browser Client v{this.state.version}</h2>
|
||||
<h2>Drittanbietersoftware</h2>
|
||||
<div className="third-party-software">
|
||||
Alegreya font<br/>
|
||||
Copyright (c) 2011, Juan Pablo del Peral (juan@huertatipografica.com.ar),<br/>
|
||||
with Reserved Font Names "Alegreya" "Alegreya SC"<br/>
|
||||
<br/>
|
||||
This Font Software is licensed under the SIL Open Font License, Version 1.1.<br/>
|
||||
This license is copied below, and is also available with a FAQ at: http://scripts.sil.org/OFL<br/>
|
||||
<br/>
|
||||
--------------------<br/>
|
||||
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007<br/>
|
||||
--------------------<br/>
|
||||
<br/>
|
||||
PREAMBLE<br/>
|
||||
The goals of the Open Font License (OFL) are to stimulate worldwide development of collaborative font projects, to support the font creation efforts of academic and linguistic communities, and to provide a free and open framework in which fonts may be shared and improved in partnership with others.<br/>
|
||||
<br/>
|
||||
The OFL allows the licensed fonts to be used, studied, modified and redistributed freely as long as they are not sold by themselves. The fonts, including any derivative works, can be bundled, embedded, redistributed and/or sold with any software provided that any reserved names are not used by derivative works. The fonts and derivatives, however, cannot be released under any other type of license. The requirement for fonts to remain under this license does not apply to any document created using the fonts or their derivatives.<br/>
|
||||
<br/>
|
||||
DEFINITIONS<br/>
|
||||
"Font Software" refers to the set of files released by the Copyright Holder(s) under this license and clearly marked as such. This may include source files, build scripts and documentation.<br/>
|
||||
<br/>
|
||||
"Reserved Font Name" refers to any names specified as such after the copyright statement(s).<br/>
|
||||
<br/>
|
||||
"Original Version" refers to the collection of Font Software components as distributed by the Copyright Holder(s).<br/>
|
||||
<br/>
|
||||
"Modified Version" refers to any derivative made by adding to, deleting, or substituting -- in part or in whole -- any of the components of the Original Version, by changing formats or by porting the Font Software to a new environment.<br/>
|
||||
<br/>
|
||||
"Author" refers to any designer, engineer, programmer, technical writer or other person who contributed to the Font Software.<br/>
|
||||
<br/>
|
||||
PERMISSION & CONDITIONS<br/>
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of the Font Software, to use, study, copy, merge, embed, modify, redistribute, and sell modified and unmodified copies of the Font Software, subject to the following conditions:<br/>
|
||||
<br/>
|
||||
1) Neither the Font Software nor any of its individual components, in Original or Modified Versions, may be sold by itself.<br/>
|
||||
<br/>
|
||||
2) Original or Modified Versions of the Font Software may be bundled, redistributed and/or sold with any software, provided that each copy contains the above copyright notice and this license. These can be included either as stand-alone text files, human-readable headers or in the appropriate machine-readable metadata fields within text or binary files as long as those fields can be easily viewed by the user.<br/>
|
||||
<br/>
|
||||
3) No Modified Version of the Font Software may use the Reserved Font Name(s) unless explicit written permission is granted by the corresponding Copyright Holder. This restriction only applies to the primary font name as presented to the users.<br/>
|
||||
<br/>
|
||||
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font Software shall not be used to promote, endorse or advertise any Modified Version, except to acknowledge the contribution(s) of the Copyright Holder(s) and the Author(s) or with their explicit written permission.<br/>
|
||||
<br/>
|
||||
5) The Font Software, modified or unmodified, in part or in whole, must be distributed entirely under this license, and must not be distributed under any other license. The requirement for fonts to remain under this license does not apply to any document created using the Font Software.<br/>
|
||||
<br/>
|
||||
TERMINATION<br/>
|
||||
This license becomes null and void if any of the above conditions are not met.<br/>
|
||||
<br/>
|
||||
DISCLAIMER<br/>
|
||||
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE.<br/>
|
||||
<br/>
|
||||
------------------------------------------------------------<br/>
|
||||
<br/>
|
||||
browserify<br/>
|
||||
Some pieces from builtins/ taken from node core under this license:<br/>
|
||||
<br/>
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
import AccountActions from '../../../actions/AccountActions';
|
||||
import AccountStore from '../../../stores/core/AccountStore';
|
||||
import BorderButton from '../../layout/BorderButton';
|
||||
import IconButton from '../../layout/IconButton';
|
||||
import React, { Component } from 'react';
|
||||
import Scroll from '../../layout/Scroll';
|
||||
import TextField from '../../layout/TextField';
|
||||
|
||||
class Account extends Component {
|
||||
|
||||
state = {
|
||||
newName: '',
|
||||
newPassword: ''
|
||||
};
|
||||
|
||||
handleName = event => this.setState({ newName: event.target.value });
|
||||
changeName = () => AccountActions.changeUsername(this.state.newName);
|
||||
handlePassword = event => this.setState({ newPassword: event.target.value });
|
||||
changePassword = () => AccountActions.changePassword(this.state.newPassword);
|
||||
delete = () => AccountActions.deleteConfirm();
|
||||
|
||||
render() {
|
||||
return (
|
||||
<section id="account">
|
||||
<div className="page">
|
||||
<Scroll>
|
||||
<TextField
|
||||
hint="Benutzernamen ändern"
|
||||
value={this.state.newName}
|
||||
onChange={this.handleName}
|
||||
/>
|
||||
<IconButton
|
||||
icon=""
|
||||
onClick={this.changeName}
|
||||
disabled={this.state.newName === '' || this.state.newName.length < 3 || this.state.newName.length > 20}
|
||||
/>
|
||||
<div className="padding">
|
||||
{(this.state.newName.length < 3 || this.state.newName.length > 20) && this.state.newName !== '' ? 'Der Benutzername muss mindestens 3 und darf maximal 20 Zeichen umfassen.' : null}
|
||||
</div>
|
||||
<TextField
|
||||
hint="Passwort ändern"
|
||||
value={this.state.newPassword}
|
||||
onChange={this.handlePassword}
|
||||
/>
|
||||
<IconButton
|
||||
icon=""
|
||||
onClick={this.changePassword}
|
||||
disabled={this.state.newPassword === '' || this.state.newPassword.length < 5 || this.state.newPassword.length > 20}
|
||||
/>
|
||||
<div className="padding">
|
||||
{(this.state.newPassword.length < 5 || this.state.newPassword.length > 20) && this.state.newPassword !== '' ? 'Das Passwort muss mindestens 5 und darf maximal 20 Zeichen umfassen.' : null}
|
||||
</div>
|
||||
<BorderButton
|
||||
label="Konto löschen"
|
||||
onClick={this.delete}
|
||||
/>
|
||||
</Scroll>
|
||||
</div>
|
||||
</section>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default Account;
|
||||
@@ -1,73 +0,0 @@
|
||||
import AccountActions from '../../../actions/AccountActions';
|
||||
import TabActions from '../../../actions/TabActions';
|
||||
import React, { Component } from 'react';
|
||||
|
||||
class ChangeAccount extends Component {
|
||||
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
value1: '',
|
||||
value2: ''
|
||||
};
|
||||
}
|
||||
|
||||
changeUsername = () => AccountActions.changeUsername(this.state.value1);
|
||||
|
||||
changePassword = () => AccountActions.changePassword(this.state.value1);
|
||||
|
||||
back = () => TabActions.openTab('list');
|
||||
|
||||
_onChange = (option, event) => this.setState({ [option]: event.target.value });
|
||||
|
||||
_change = () => {
|
||||
if (this.props.type == 'username') {
|
||||
this.changeUsername();
|
||||
}
|
||||
else if (this.props.type == 'password') {
|
||||
this.changePassword();
|
||||
}
|
||||
};
|
||||
|
||||
_onEnter = event => {
|
||||
if (event.charCode === 13 && this.state.value1 != '' && this.state.value1 == this.state.value2) this._change();
|
||||
};
|
||||
|
||||
render() {
|
||||
return (
|
||||
<AccountContainer id="changeaccount">
|
||||
<h2 className="header">{this.props.type == 'username' ? 'Kontonamen ändern' : 'Passwort ändern'}</h2>
|
||||
<TextField
|
||||
hint={this.props.type == 'username' ? 'Benutzername' : 'Passwort'}
|
||||
value={this.state.value1}
|
||||
onChange={this._onChange.bind(null, 'value1')}
|
||||
onKeyPress={this._onEnter}
|
||||
type={this.props.type == 'password' ? 'password' : undefined}
|
||||
fullWidth
|
||||
/>
|
||||
<TextField
|
||||
hint={this.props.type == 'username' ? 'Benutzernamen bestätigen' : 'Passwort bestätigen'}
|
||||
value={this.state.value2}
|
||||
onChange={this._onChange.bind(null, 'value2')}
|
||||
onKeyPress={this._onEnter}
|
||||
type={this.props.type == 'password' ? 'password' : undefined}
|
||||
fullWidth
|
||||
/>
|
||||
<BorderButton label="Ändern" onClick={this._change} primary fullWidth disabled={!equal(this.state.value1, this.state.value2)}
|
||||
/>
|
||||
{this.state.value1 !== this.state.value2 && this.state.value2 !== '' ? <p key="change-account-warning">{this.props.type == 'username' ? 'Die Benutzernamen sind nicht identisch!' : 'Die Passwörter sind nicht identisch!'}</p> : null}
|
||||
<p>
|
||||
<span className="link" onClick={this.back}>
|
||||
Zurück
|
||||
</span>
|
||||
</p>
|
||||
</AccountContainer>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
ChangeAccount.propTypes = {
|
||||
type: React.PropTypes.string.isRequired
|
||||
};
|
||||
|
||||
export default ChangeAccount;
|
||||
@@ -1,39 +0,0 @@
|
||||
import AccountActions from '../../../actions/AccountActions';
|
||||
import TabActions from '../../../actions/TabActions';
|
||||
import React, { Component } from 'react';
|
||||
|
||||
class DeleteAccount extends Component {
|
||||
|
||||
constructor(props) {
|
||||
super(props);
|
||||
}
|
||||
|
||||
deleteAccount = () => AccountActions.deleteAccount();
|
||||
|
||||
back = () => TabActions.openTab('list');
|
||||
|
||||
render() {
|
||||
return (
|
||||
<AccountContainer id="deleteaccount">
|
||||
<h2 className="header">Konto löschen</h2>
|
||||
<p>
|
||||
Du bist dabei, dein Konto zu löschen.
|
||||
</p>
|
||||
<p>
|
||||
Diese Aktion kann NICHT rückgängig gemacht werden! Durch das Löschen des Kontos werden alle Helden und Gruppen, die diesem Konto gehören, ebenfalls gelöscht!
|
||||
</p>
|
||||
<p>
|
||||
Bist du dir GANZ sicher, dass du fortfahren möchtest?
|
||||
</p>
|
||||
<BorderButton label="Konto löschen" onClick={this.deleteAccount} primary fullWIdth />
|
||||
<p>
|
||||
<span className="link" onClick={this.back}>
|
||||
Zurück
|
||||
</span>
|
||||
</p>
|
||||
</AccountContainer>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default DeleteAccount;
|
||||
@@ -1,44 +1,58 @@
|
||||
import AccountActions from '../../../actions/AccountActions';
|
||||
import TabActions from '../../../actions/TabActions';
|
||||
import React, { Component } from 'react';
|
||||
import Dialog from '../../layout/Dialog';
|
||||
import React, { Component, PropTypes } from 'react';
|
||||
import TextField from '../../layout/TextField';
|
||||
import { close } from '../../../utils/createOverlay';
|
||||
|
||||
class ForgotPassword extends Component {
|
||||
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = { email: '' };
|
||||
}
|
||||
|
||||
static props = {
|
||||
node: PropTypes.any
|
||||
};
|
||||
|
||||
state = {
|
||||
email: ''
|
||||
};
|
||||
|
||||
forgotPassword = () => AccountActions.forgotPassword(this.state.email);
|
||||
|
||||
back = () => TabActions.openTab('login');
|
||||
back = () => AccountActions.showLogin();
|
||||
|
||||
_onChange = event => this.setState({ email: event.target.value });
|
||||
|
||||
_onEnter = event => {
|
||||
if (event.charCode === 13 && this.state.email != '') this.forgotPassword();
|
||||
if (event.charCode === 13 && this.state.email !== '') {
|
||||
this.forgotPassword();
|
||||
close(this.props.node);
|
||||
}
|
||||
};
|
||||
|
||||
render() {
|
||||
|
||||
const { email } = this.state;
|
||||
|
||||
return (
|
||||
<AccountContainer id="forgotpassword">
|
||||
<h2 className="header">Passwort vergessen</h2>
|
||||
<Dialog id="forgotpassword" title="Passwort vergessen" node={this.props.node} buttons={[
|
||||
{
|
||||
label: 'E-Mail anfordern',
|
||||
onClick: this.forgotPassword,
|
||||
primary: true,
|
||||
disabled: email === ''
|
||||
},
|
||||
{
|
||||
label: 'Zurück',
|
||||
onClick: this.back
|
||||
}
|
||||
]}>
|
||||
<TextField
|
||||
hint="Registrierte E-Mail-Adresse"
|
||||
value={this.state.email}
|
||||
value={email}
|
||||
onChange={this._onChange}
|
||||
onKeyPress={this._onEnter}
|
||||
fullWidth
|
||||
type="email"
|
||||
fullWidth
|
||||
/>
|
||||
<BorderButton label="E-Mail anfordern" onClick={this.forgotPassword} primary fullWidth disabled={this.state.email == ''} />
|
||||
<p>
|
||||
<span className="link" onClick={this.back}>
|
||||
Zurück zur Anmeldeseite
|
||||
</span>
|
||||
</p>
|
||||
</AccountContainer>
|
||||
</Dialog>
|
||||
);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,44 +1,58 @@
|
||||
import AccountActions from '../../../actions/AccountActions';
|
||||
import TabActions from '../../../actions/TabActions';
|
||||
import React, { Component } from 'react';
|
||||
import Dialog from '../../layout/Dialog';
|
||||
import React, { Component, PropTypes } from 'react';
|
||||
import TextField from '../../layout/TextField';
|
||||
import { close } from '../../../utils/createOverlay';
|
||||
|
||||
class ForgotUsername extends Component {
|
||||
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = { email: '' };
|
||||
}
|
||||
|
||||
static props = {
|
||||
node: PropTypes.any
|
||||
};
|
||||
|
||||
state = {
|
||||
email: ''
|
||||
};
|
||||
|
||||
forgotUsername = () => AccountActions.forgotUsername(this.state.email);
|
||||
|
||||
back = () => TabActions.openTab('login');
|
||||
back = () => AccountActions.showLogin();
|
||||
|
||||
_onChange = event => this.setState({ email: event.target.value });
|
||||
|
||||
_onEnter = event => {
|
||||
if (event.charCode === 13 && this.state.email != '') this.forgotUsername();
|
||||
if (event.charCode === 13 && this.state.email !== '') {
|
||||
this.forgotUsername();
|
||||
close(this.props.node);
|
||||
}
|
||||
};
|
||||
|
||||
render() {
|
||||
|
||||
const { email } = this.state;
|
||||
|
||||
return (
|
||||
<AccountContainer id="forgotusername">
|
||||
<h2 className="header">Benutzername vergessen</h2>
|
||||
<Dialog id="forgotusername" title="Benutzername vergessen" node={this.props.node} buttons={[
|
||||
{
|
||||
label: 'E-Mail anfordern',
|
||||
onClick: this.forgotUsername,
|
||||
primary: true,
|
||||
disabled: email === ''
|
||||
},
|
||||
{
|
||||
label: 'Zurück',
|
||||
onClick: this.back
|
||||
}
|
||||
]}>
|
||||
<TextField
|
||||
hint="Registrierte E-Mail-Adresse"
|
||||
value={this.state.email}
|
||||
value={email}
|
||||
onChange={this._onChange}
|
||||
onKeyPress={this._onEnter}
|
||||
fullWidth
|
||||
type="email"
|
||||
fullWidth
|
||||
/>
|
||||
<BorderButton label="E-Mail anfordern" onClick={this.forgotUsername} primary fullWidth disabled={this.state.email == ''} />
|
||||
<p>
|
||||
<span className="link" onClick={this.back}>
|
||||
Zurück zur Anmeldeseite
|
||||
</span>
|
||||
</p>
|
||||
</AccountContainer>
|
||||
</Dialog>
|
||||
);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,58 +1,66 @@
|
||||
import AccountActions from '../../../actions/AccountActions';
|
||||
import TabActions from '../../../actions/TabActions';
|
||||
import React, { Component } from 'react';
|
||||
import Dialog from '../../layout/Dialog';
|
||||
import React, { Component, PropTypes } from 'react';
|
||||
import TextField from '../../layout/TextField';
|
||||
import { close } from '../../../utils/createOverlay';
|
||||
|
||||
class Login extends Component {
|
||||
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
username: '',
|
||||
password: ''
|
||||
};
|
||||
}
|
||||
|
||||
login = () => AccountActions.login(this.state.username, this.state.password);
|
||||
|
||||
forgotUsername = () => TabActions.openTab('forgotUsername');
|
||||
|
||||
forgotPassword = () => TabActions.openTab('forgotPassword');
|
||||
|
||||
registration = () => TabActions.openTab('registration');
|
||||
|
||||
resendActivation = () => TabActions.openTab('resendActivation');
|
||||
|
||||
_onChange = (option, event) => this.setState({ [option]: event.target.value });
|
||||
|
||||
_onEnter = event => {
|
||||
if (event.charCode === 13 && this.state.username != '' && this.state.password != '') this.login();
|
||||
|
||||
static props = {
|
||||
node: PropTypes.any
|
||||
};
|
||||
|
||||
shouldComponentUpdate(nextProps, nextState) {
|
||||
return nextState.username !== this.state.username || nextState.password !== this.state.password;
|
||||
}
|
||||
state = {
|
||||
username: '',
|
||||
password: ''
|
||||
};
|
||||
|
||||
login = () => AccountActions.login(this.state.username, this.state.password);
|
||||
forgotUsername = () => { AccountActions.showForgotName(); close(this.props.node); };
|
||||
forgotPassword = () => { AccountActions.showForgotPassword(); close(this.props.node); };
|
||||
register = () => AccountActions.showRegister();
|
||||
resendActivation = () => { AccountActions.showResend(); close(this.props.node); };
|
||||
|
||||
_onChange = (option, event) => this.setState({ [option]: event.target.value });
|
||||
_onEnter = event => {
|
||||
if (event.charCode === 13 && this.state.username !== '' && this.state.password !== '') {
|
||||
this.login();
|
||||
close(this.props.node);
|
||||
}
|
||||
};
|
||||
|
||||
render() {
|
||||
|
||||
|
||||
const { username, password } = this.state;
|
||||
|
||||
return (
|
||||
<AccountContainer id="login">
|
||||
<h2 className="header">Anmelden</h2>
|
||||
<Dialog id="login" title="Anmelden" node={this.props.node} buttons={[
|
||||
{
|
||||
label: 'Anmelden',
|
||||
onClick: this.login,
|
||||
primary: true,
|
||||
disabled: username === '' || password === ''
|
||||
},
|
||||
{
|
||||
label: 'Registrieren',
|
||||
onClick: this.register
|
||||
}
|
||||
]}>
|
||||
<TextField
|
||||
hint="Benutzername"
|
||||
value={this.state.username}
|
||||
value={username}
|
||||
onChange={this._onChange.bind(null, 'username')}
|
||||
onKeyPress={this._onEnter}
|
||||
fullWidth
|
||||
/>
|
||||
<TextField
|
||||
hint="Passwort"
|
||||
value={this.state.password}
|
||||
value={password}
|
||||
onChange={this._onChange.bind(null, 'password')}
|
||||
onKeyPress={this._onEnter}
|
||||
type="password"
|
||||
fullWidth
|
||||
/>
|
||||
<BorderButton label="Anmelden" onClick={this.login} primary fullWidth disabled={this.state.username == '' || this.state.password == ''} />
|
||||
<p>
|
||||
<span className="link" onClick={this.forgotUsername}>
|
||||
Benutzername vergessen
|
||||
@@ -60,14 +68,11 @@ class Login extends Component {
|
||||
<span className="link" onClick={this.forgotPassword}>
|
||||
Passwort vergessen
|
||||
</span>
|
||||
<span className="link" onClick={this.registration}>
|
||||
Konto erstellen
|
||||
</span>
|
||||
<span className="link" onClick={this.resendActivation}>
|
||||
Aktivierungs-E-Mail nicht erhalten?
|
||||
</span>
|
||||
</p>
|
||||
</AccountContainer>
|
||||
</Dialog>
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,125 @@
|
||||
import AccountActions from '../../../actions/AccountActions';
|
||||
import Dialog from '../../layout/Dialog';
|
||||
import React, { Component, PropTypes } from 'react';
|
||||
import TextField from '../../layout/TextField';
|
||||
import { close } from '../../../utils/createOverlay';
|
||||
|
||||
function _validateEmail(email) {
|
||||
var regex = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
|
||||
return regex.test(email);
|
||||
}
|
||||
|
||||
class Register extends Component {
|
||||
|
||||
static props = {
|
||||
node: PropTypes.any
|
||||
};
|
||||
|
||||
state = {
|
||||
email: '',
|
||||
email2: '',
|
||||
username: '',
|
||||
password: '',
|
||||
password2: ''
|
||||
};
|
||||
|
||||
register = () => AccountActions.register(this.state.email, this.state.username, this.state.password);
|
||||
back = () => AccountActions.showLogin();
|
||||
|
||||
_onChange = (option, event) => this.setState({ [option]: event.target.value });
|
||||
_onEnter = event => {
|
||||
let { email, email2, username, password, password2 } = this.state;
|
||||
if (event.charCode === 13 &&
|
||||
email !== '' &&
|
||||
_validateEmail(email) &&
|
||||
email === email2 &&
|
||||
username !== '' &&
|
||||
username.length >= 3 &&
|
||||
username.length <= 20 &&
|
||||
password !== '' &&
|
||||
password.length >= 5 &&
|
||||
password.length <= 20 &&
|
||||
password === password2) {
|
||||
this.register();
|
||||
close(this.props.node);
|
||||
}
|
||||
};
|
||||
|
||||
render() {
|
||||
|
||||
const { email, email2, username, password, password2 } = this.state;
|
||||
|
||||
return (
|
||||
<Dialog id="login" title="Registrieren" node={this.props.node} buttons={[
|
||||
{
|
||||
label: 'Registrieren',
|
||||
onClick: this.register,
|
||||
primary: true,
|
||||
disabled:
|
||||
email === '' ||
|
||||
!_validateEmail(email) ||
|
||||
email !== email2 ||
|
||||
username === '' ||
|
||||
username.length < 3 ||
|
||||
username.length > 20 ||
|
||||
password === '' ||
|
||||
password.length < 5 ||
|
||||
password.length > 20 ||
|
||||
password !== password2
|
||||
},
|
||||
{
|
||||
label: 'Zurück',
|
||||
onClick: this.back
|
||||
}
|
||||
]}>
|
||||
<TextField
|
||||
hint="E-Mail-Adresse"
|
||||
value={email}
|
||||
onChange={this._onChange.bind(null, 'email')}
|
||||
onKeyPress={this._onEnter}
|
||||
fullWidth
|
||||
type="email"
|
||||
/>
|
||||
{email !== '' && !_validateEmail(email) ? <p>Es wurde keine gültige Email-Adresse eingegeben!</p> : null}
|
||||
<TextField
|
||||
hint="E-Mail-Adresse bestätigen"
|
||||
value={email2}
|
||||
onChange={this._onChange.bind(null, 'email2')}
|
||||
onKeyPress={this._onEnter}
|
||||
fullWidth
|
||||
type="email"
|
||||
/>
|
||||
{(email !== email2 && email2 !== '') ? <p>Die E-Mail-Adressen sind nicht identisch!</p> : null}
|
||||
<TextField
|
||||
hint="Benutzername"
|
||||
value={username}
|
||||
onChange={this._onChange.bind(null, 'username')}
|
||||
onKeyPress={this._onEnter}
|
||||
fullWidth
|
||||
/>
|
||||
{(username.length > 0 && (username.length < 3 || username.length > 20)) ? <p>Der Benutzername muss zwischen 3 und 20 Zeichen lang sein!</p> : null}
|
||||
<TextField
|
||||
hint="Passwort"
|
||||
value={password}
|
||||
onChange={this._onChange.bind(null, 'password')}
|
||||
onKeyPress={this._onEnter}
|
||||
fullWidth
|
||||
type="password"
|
||||
/>
|
||||
{(password.length > 0 && (password.length < 5 || password.length > 20)) ? <p>Das Passwort muss zwischen 5 und 20 Zeichen lang sein!</p> : null}
|
||||
<TextField
|
||||
hint="Passwort bestätigen"
|
||||
value={password2}
|
||||
onChange={this._onChange.bind(null, 'password2')}
|
||||
onKeyPress={this._onEnter}
|
||||
fullWidth
|
||||
type="password"
|
||||
/>
|
||||
{(password !== password2 && password2 !== '') ? <p>Die Passwörter sind nicht identisch!</p> : null}
|
||||
</Dialog>
|
||||
);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
export default Register;
|
||||
@@ -1,84 +0,0 @@
|
||||
import AccountActions from '../../../actions/AccountActions';
|
||||
import TabActions from '../../../actions/TabActions';
|
||||
import React, { Component } from 'react';
|
||||
|
||||
class Registration extends Component {
|
||||
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
email: '',
|
||||
email2: '',
|
||||
username: '',
|
||||
password: '',
|
||||
password2: ''
|
||||
};
|
||||
}
|
||||
|
||||
register = () => AccountActions.register(this.state.email, this.state.username, this.state.password);
|
||||
|
||||
back = () => TabActions.openTab('login');
|
||||
|
||||
_onChange = (option, event) => this.setState({ [option]: event.target.value });
|
||||
|
||||
_onEnter = event => {
|
||||
if (event.charCode === 13 && equal(this.state.email, this.state.email2) && equal(this.state.password, this.state.password2) && this.state.username != '') this.register();
|
||||
};
|
||||
|
||||
render() {
|
||||
return (
|
||||
<AccountContainer id="registration">
|
||||
<h2 className="header">Registrieren</h2>
|
||||
<TextField
|
||||
hint="E-Mail-Adresse"
|
||||
value={this.state.email}
|
||||
onChange={this._onChange.bind(null, 'email')}
|
||||
onKeyPress={this._onEnter}
|
||||
fullWidth
|
||||
type="email"
|
||||
/>
|
||||
<TextField
|
||||
hint="E-Mail-Adresse bestätigen"
|
||||
value={this.state.email2}
|
||||
onChange={this._onChange.bind(null, 'email2')}
|
||||
onKeyPress={this._onEnter}
|
||||
fullWidth
|
||||
type="email"
|
||||
/>
|
||||
{(this.state.email != this.state.email2 && this.state.email2 != '') ? <p>Die E-Mail-Adressen sind nicht identisch!</p> : null}
|
||||
<TextField
|
||||
hint="Benutzername"
|
||||
value={this.state.username}
|
||||
onChange={this._onChange.bind(null, 'username')}
|
||||
onKeyPress={this._onEnter}
|
||||
fullWidth
|
||||
/>
|
||||
<TextField
|
||||
hint="Passwort"
|
||||
value={this.state.password}
|
||||
onChange={this._onChange.bind(null, 'password')}
|
||||
onKeyPress={this._onEnter}
|
||||
fullWidth
|
||||
type="password"
|
||||
/>
|
||||
<TextField
|
||||
hint="Passwort bestätigen"
|
||||
value={this.state.password2}
|
||||
onChange={this._onChange.bind(null, 'password2')}
|
||||
onKeyPress={this._onEnter}
|
||||
fullWidth
|
||||
type="password"
|
||||
/>
|
||||
{(this.state.password != this.state.password2 && this.state.password2 != '') ? <p>Die Passwörter sind nicht identisch!</p> : null}
|
||||
<BorderButton label="Registrieren" onClick={this.register} primary fullWidth disabled={!(equal(this.state.email, this.state.email2) && equal(this.state.password, this.state.password2) && this.state.username != '')} />
|
||||
<p>
|
||||
<span className="link" onClick={this.back}>
|
||||
Zurück zur Anmeldeseite
|
||||
</span>
|
||||
</p>
|
||||
</AccountContainer>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default Registration;
|
||||
@@ -1,44 +1,58 @@
|
||||
import AccountActions from '../../../actions/AccountActions';
|
||||
import TabActions from '../../../actions/TabActions';
|
||||
import React, { Component } from 'react';
|
||||
import Dialog from '../../layout/Dialog';
|
||||
import React, { Component, PropTypes } from 'react';
|
||||
import TextField from '../../layout/TextField';
|
||||
import { close } from '../../../utils/createOverlay';
|
||||
|
||||
class ResendActivation extends Component {
|
||||
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = { email: '' };
|
||||
}
|
||||
|
||||
static props = {
|
||||
node: PropTypes.any
|
||||
};
|
||||
|
||||
state = {
|
||||
email: ''
|
||||
};
|
||||
|
||||
resendActivation = () => AccountActions.resendActivation(this.state.email);
|
||||
back = () => AccountActions.showLogin();
|
||||
|
||||
back = () => TabActions.openTab('login');
|
||||
|
||||
_onChange = (option, event) => this.setState({ [option]: event.target.value });
|
||||
|
||||
_onChange = event => this.setState({ email: event.target.value });
|
||||
_onEnter = event => {
|
||||
if (event.charCode === 13 && this.state.email != '') this.resendActivation();
|
||||
if (event.charCode === 13 && this.state.email !== '') {
|
||||
this.resendActivation();
|
||||
close(this.props.node);
|
||||
}
|
||||
};
|
||||
|
||||
render() {
|
||||
|
||||
const { email } = this.state;
|
||||
|
||||
return (
|
||||
<AccountContainer id="resendactivation">
|
||||
<h2 className="header">Aktivierungs-E-Mail erneut senden</h2>
|
||||
<Dialog id="resendactivation" title="Aktivierungslink erneut senden" node={this.props.node} buttons={[
|
||||
{
|
||||
label: 'E-Mail anfordern',
|
||||
onClick: this.resendActivation,
|
||||
primary: true,
|
||||
disabled: email === ''
|
||||
},
|
||||
{
|
||||
label: 'Zurück',
|
||||
onClick: this.back
|
||||
}
|
||||
]}>
|
||||
<TextField
|
||||
hint="Registrierte E-Mail-Adresse"
|
||||
value={this.state.email}
|
||||
value={email}
|
||||
onChange={this._onChange}
|
||||
onKeyPress={this._onEnter}
|
||||
fullWidth
|
||||
type="email"
|
||||
fullWidth
|
||||
/>
|
||||
<BorderButton label="E-Mail anfordern" onClick={this.resendActivation} primary fullWidth disabled={this.state.email == ''} />
|
||||
<p>
|
||||
<span className="link" onClick={this.back}>
|
||||
Zurück zur Anmeldeseite
|
||||
</span>
|
||||
</p>
|
||||
</AccountContainer>
|
||||
</Dialog>
|
||||
);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
var HeroListItemX = React.createClass({
|
||||
displayName: 'HeroListItem',
|
||||
|
||||
render: function render() {
|
||||
var name = this.props.name,
|
||||
prof = this.props.prof,
|
||||
player = this.props.player,
|
||||
playerText,
|
||||
level = this.props.level,
|
||||
perc = this.props.perc;
|
||||
|
||||
if (player !== undefined) {
|
||||
playerText = ' [' + player + ']';
|
||||
}
|
||||
|
||||
return React.DOM.li({className: 'hero-list-item'},
|
||||
React.DOM.div({className: 'hero-ap'},
|
||||
React.createElement(ProgressArc, {size: 64, strokeWidth: 4, complete: perc}),
|
||||
React.DOM.span({className: 'hero-level'},
|
||||
level
|
||||
)
|
||||
),
|
||||
React.DOM.div({className: 'hero-main'},
|
||||
React.DOM.span({className: 'hero-name'},
|
||||
name,
|
||||
playerText
|
||||
),
|
||||
React.DOM.span({className: 'hero-prof'},
|
||||
prof
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
});
|
||||
@@ -1,64 +0,0 @@
|
||||
.hero-list-item {
|
||||
width: 100%;
|
||||
height: 64px;
|
||||
position: relative;
|
||||
|
||||
&:not(:first-child) {
|
||||
margin-top: 8px;
|
||||
}
|
||||
|
||||
+ .hero-list-nomatches {
|
||||
display: none;
|
||||
}
|
||||
|
||||
> * {
|
||||
float: left;
|
||||
}
|
||||
|
||||
.hero-ap {
|
||||
@include size(64px);
|
||||
position: relative;
|
||||
|
||||
> * {
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
span {
|
||||
display: block;
|
||||
@include size(64px);
|
||||
line-height: 64px;
|
||||
text-align: center;
|
||||
color: white;
|
||||
text-shadow: 0 0 5px black;
|
||||
font-family: "Mason-web", Mason;
|
||||
font-size: 32px;
|
||||
}
|
||||
}
|
||||
|
||||
.hero-main {
|
||||
height: 64px;
|
||||
@include calc(width, "100% - 84px");
|
||||
margin-left: 12px;
|
||||
|
||||
* {
|
||||
display: block;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.hero-name {
|
||||
height: 40px;
|
||||
line-height: 36px;
|
||||
font-size: 18px;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.hero-prof {
|
||||
height: 24px;
|
||||
line-height: 24px;
|
||||
font-size: 14px;
|
||||
margin-top: -8px;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,12 @@
|
||||
import APStore from '../../../stores/APStore';
|
||||
import BorderButton from '../../layout/BorderButton';
|
||||
import CultureStore from '../../../stores/rcp/CultureStore';
|
||||
import ELStore from '../../../stores/ELStore';
|
||||
import HerolistActions from '../../../actions/HerolistActions';
|
||||
import HerolistItem from './HerolistItem';
|
||||
import HerolistStore from '../../../stores/core/HerolistStore';
|
||||
import ProfessionStore from '../../../stores/rcp/ProfessionStore';
|
||||
import ProfileStore from '../../../stores/ProfileStore';
|
||||
import RaceStore from '../../../stores/rcp/RaceStore';
|
||||
import RadioButtonGroup from '../../layout/RadioButtonGroup';
|
||||
import React, { Component } from 'react';
|
||||
@@ -31,6 +34,7 @@ class Herolist extends Component {
|
||||
filter = event => HerolistActions.filter(event.target.value);
|
||||
sort = option => HerolistActions.sort(option);
|
||||
showHeroCreation = () => HerolistActions.showHeroCreation();
|
||||
refresh = () => HerolistActions.refresh();
|
||||
|
||||
componentDidMount() {
|
||||
HerolistStore.addChangeListener(this._updateHerolistStore );
|
||||
@@ -63,10 +67,20 @@ class Herolist extends Component {
|
||||
}
|
||||
]}
|
||||
/>
|
||||
<BorderButton label="Erstellen" onClick={this.showHeroCreation} />
|
||||
<BorderButton label="Aktualisieren" onClick={this.refresh} />
|
||||
<BorderButton label="Erstellen" onClick={this.showHeroCreation} primary />
|
||||
</div>
|
||||
<Scroll className="list">
|
||||
<ul>
|
||||
{
|
||||
ProfileStore.getID() === null && ELStore.getStartID() !== 'EL_0' ? (
|
||||
<HerolistItem
|
||||
id={null}
|
||||
name="Ungespeicherter Held"
|
||||
ap={{ _max: APStore.get() }}
|
||||
/>
|
||||
) : null
|
||||
}
|
||||
{
|
||||
list.map(hero => <HerolistItem key={hero.id} {...hero} />)
|
||||
}
|
||||
|
||||
@@ -4,9 +4,11 @@ import CultureStore from '../../../stores/rcp/CultureStore';
|
||||
import HerolistActions from '../../../actions/HerolistActions';
|
||||
import ProfessionStore from '../../../stores/rcp/ProfessionStore';
|
||||
import ProfessionVariantStore from '../../../stores/rcp/ProfessionVariantStore';
|
||||
import ProfileStore from '../../../stores/ProfileStore';
|
||||
import ProgressArc from 'react-progress-arc';
|
||||
import RaceStore from '../../../stores/rcp/RaceStore';
|
||||
import React, { PropTypes, Component } from 'react';
|
||||
import TabActions from '../../../actions/TabActions';
|
||||
import classNames from 'classnames';
|
||||
|
||||
class HerolistItem extends Component {
|
||||
@@ -28,10 +30,11 @@ class HerolistItem extends Component {
|
||||
}
|
||||
|
||||
load = () => HerolistActions.load(this.props.id);
|
||||
show = () => TabActions.showSection('hero');
|
||||
|
||||
render() {
|
||||
|
||||
const { name, avatar, ap, r, c, p, pv } = this.props;
|
||||
const { id, name, avatar, ap, r, c, p, pv } = this.props;
|
||||
const { _max: apTotal } = ap;
|
||||
|
||||
const elRoman = [ 'I', 'II', 'III', 'IV', 'V', 'VI', 'VII' ];
|
||||
@@ -40,7 +43,10 @@ class HerolistItem extends Component {
|
||||
var currentEL = 6;
|
||||
|
||||
for (let i = 0; i < elAp.length; i++) {
|
||||
if (elAp[i] >= apTotal) {
|
||||
if (elAp[i] === apTotal) {
|
||||
currentEL = i;
|
||||
break;
|
||||
} else if (elAp[i] > apTotal) {
|
||||
currentEL = i - 1;
|
||||
break;
|
||||
}
|
||||
@@ -51,7 +57,7 @@ class HerolistItem extends Component {
|
||||
return (
|
||||
<li className="hero-list-item">
|
||||
<ProgressArc completed={elProgress} diameter={63} strokeWidth={4} />
|
||||
<div className={classNames( 'el', !avatar && 'no-avatar' )}>
|
||||
<div className={classNames( 'el avatar-wrapper', !avatar && 'no-avatar' )}>
|
||||
<div className="overlay">
|
||||
<h2>{elRoman[currentEL]}</h2>
|
||||
</div>
|
||||
@@ -60,10 +66,22 @@ class HerolistItem extends Component {
|
||||
<div className="main">
|
||||
<h2>{name}</h2>
|
||||
<div className="rcp">
|
||||
{RaceStore.getNameByID(r)} • {CultureStore.getNameByID(c)} • {ProfessionStore.getNameByID(p)}{pv ? ` (${ProfessionVariantStore.getNameByID(pv)})` : ''}
|
||||
{ do {
|
||||
if (id === null) {
|
||||
null;
|
||||
} else {
|
||||
RaceStore.getNameByID(r) + ' • ' + CultureStore.getNameByID(c) + ' • ' + ProfessionStore.getNameByID(p) + (pv ? ` (${ProfessionVariantStore.getNameByID(pv)})` : '');
|
||||
}
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
<BorderButton label="Öffnen" onClick={this.load} />
|
||||
{ do {
|
||||
if (id === ProfileStore.getID()) {
|
||||
<BorderButton label="Anzeigen" onClick={this.show} primary />;
|
||||
} else {
|
||||
<BorderButton label="Öffnen" onClick={this.load} />;
|
||||
}
|
||||
}}
|
||||
</li>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
#home {
|
||||
.devprogress {
|
||||
margin-top: 20px;
|
||||
|
||||
&-step {
|
||||
color: white;
|
||||
}
|
||||
|
||||
&-bar {
|
||||
height: 32px;
|
||||
border: 2px solid black;
|
||||
margin: 8px 0;
|
||||
|
||||
&-bg {
|
||||
height: 28px;
|
||||
background: $scrollbar-color;
|
||||
}
|
||||
|
||||
&-num {
|
||||
color: white;
|
||||
padding-left: 12px;
|
||||
display: block;
|
||||
position: relative;
|
||||
height: 28px;
|
||||
line-height: 28px;
|
||||
margin-top: -28px;
|
||||
font-size: 13px;
|
||||
}
|
||||
}
|
||||
|
||||
&-current {
|
||||
text-align: right;
|
||||
font-size: 12px;
|
||||
width: 100%;
|
||||
display: inline-block;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,6 @@
|
||||
import BorderButton from '../../layout/BorderButton';
|
||||
import Checkbox from '../../layout/Checkbox';
|
||||
import React, { Component, PropTypes } from 'react';
|
||||
import SpecialAbilitiesListAddItem from './SpecialAbilitiesListAddItem';
|
||||
import SpecialAbilitiesListRemoveItem from './SpecialAbilitiesListRemoveItem';
|
||||
|
||||
class SelectionsCurses extends Component {
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ import GeminiScrollbar from 'react-gemini-scrollbar';
|
||||
import React, { Component, PropTypes } from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
import classNames from 'classnames';
|
||||
import { close } from '../../utils/createOverlay';
|
||||
|
||||
class Dialog extends Component {
|
||||
|
||||
@@ -10,6 +11,7 @@ class Dialog extends Component {
|
||||
buttons: PropTypes.array,
|
||||
className: PropTypes.any,
|
||||
id: PropTypes.string,
|
||||
node: PropTypes.any,
|
||||
title: PropTypes.any
|
||||
}
|
||||
|
||||
@@ -17,10 +19,7 @@ class Dialog extends Component {
|
||||
super(props);
|
||||
}
|
||||
|
||||
close = () => {
|
||||
ReactDOM.unmountComponentAtNode(this.props.node);
|
||||
document.body.removeChild(this.props.node);
|
||||
};
|
||||
close = () => close(this.props.node);
|
||||
|
||||
clickButton = (func) => {
|
||||
if (func) func();
|
||||
@@ -29,33 +28,31 @@ class Dialog extends Component {
|
||||
|
||||
render() {
|
||||
|
||||
const props = {
|
||||
className: classNames('modal-backdrop', this.props.className)
|
||||
};
|
||||
var { buttons: btns = [], title, node, ...props } = this.props;
|
||||
|
||||
if (this.props.id) props.id = this.props.id;
|
||||
props.className = classNames('modal-backdrop', props.className);
|
||||
|
||||
var buttons = [];
|
||||
|
||||
if (this.props.buttons) {
|
||||
for (let i = 0; i < this.props.buttons.length; i++) {
|
||||
const btnProps = this.props.buttons[i];
|
||||
for (let i = 0; i < btns.length; i++) {
|
||||
const btnProps = btns[i];
|
||||
|
||||
btnProps.onClick = this.clickButton.bind(null, btnProps.onClick);
|
||||
btnProps.onClick = this.clickButton.bind(null, btnProps.onClick);
|
||||
|
||||
buttons.push(
|
||||
<BorderButton key={'popup-button-' + i} {...btnProps} />
|
||||
);
|
||||
}
|
||||
buttons.push(
|
||||
<BorderButton key={'popup-button-' + i} {...btnProps} />
|
||||
);
|
||||
}
|
||||
|
||||
var contentStyle = buttons.length === 0 ? { paddingBottom: 26 } : {};
|
||||
|
||||
return (
|
||||
<div {...props}>
|
||||
<div className="modal-container">
|
||||
<div className="modal-close" onClick={this.close}><div></div></div>
|
||||
<div className="modal-header"><div className="modal-header-inner">{this.props.title}</div></div>
|
||||
<div className="modal-header"><div className="modal-header-inner">{title}</div></div>
|
||||
<div className="modal-content">
|
||||
<div className="modal-content-inner">
|
||||
<div className="modal-content-inner" style={contentStyle}>
|
||||
{this.props.children}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
import AccountActions from '../../actions/AccountActions';
|
||||
import AccountStore from '../../stores/core/AccountStore';
|
||||
import APStore from '../../stores/APStore';
|
||||
import Avatar from './Avatar';
|
||||
import BorderButton from './BorderButton';
|
||||
import ELStore from '../../stores/ELStore';
|
||||
import HerolistActions from '../../actions/HerolistActions';
|
||||
import IconButton from './IconButton';
|
||||
import InGameActions from '../../actions/InGameActions';
|
||||
import PhaseStore from '../../stores/PhaseStore';
|
||||
@@ -11,32 +15,6 @@ import TabActions from '../../actions/TabActions';
|
||||
import TitleBarArrow from './TitleBarArrow';
|
||||
import TitleBarNav from './TitleBarNav';
|
||||
|
||||
class PageTab extends Component {
|
||||
|
||||
static propTypes = {
|
||||
active: PropTypes.bool.isRequired,
|
||||
className: PropTypes.any,
|
||||
disabled: PropTypes.bool,
|
||||
label: PropTypes.string,
|
||||
tag: PropTypes.string.isRequired
|
||||
};
|
||||
|
||||
constructor(props) {
|
||||
super(props);
|
||||
}
|
||||
|
||||
handleClick = tab => TabActions.openTab(tab);
|
||||
|
||||
render() {
|
||||
|
||||
const { tag, ...other } = this.props;
|
||||
|
||||
return (
|
||||
<Tab {...other} onClick={this.handleClick.bind(null, tag)} />
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class TitleBar extends Component {
|
||||
|
||||
static propTypes = {
|
||||
@@ -45,6 +23,7 @@ class TitleBar extends Component {
|
||||
};
|
||||
|
||||
state = {
|
||||
account: AccountStore.getAll(),
|
||||
ap: APStore.get(),
|
||||
used: APStore.getUsed(),
|
||||
disadv: APStore.getForDisAdv(),
|
||||
@@ -56,28 +35,38 @@ class TitleBar extends Component {
|
||||
super(props);
|
||||
}
|
||||
|
||||
_updateAccountStore = () => this.setState({ account: AccountStore.getAll() });
|
||||
_updateAPStore = () => this.setState({ ap: APStore.get(), used: APStore.getUsed(), disadv: APStore.getForDisAdv() });
|
||||
_updatePhaseStore = () => this.setState({ phase: PhaseStore.get() });
|
||||
_updateProfileStore = () => this.setState({ portrait: ProfileStore.getPortrait() });
|
||||
|
||||
componentDidMount() {
|
||||
AccountStore.addChangeListener(this._updateAccountStore);
|
||||
APStore.addChangeListener(this._updateAPStore);
|
||||
PhaseStore.addChangeListener(this._updatePhaseStore);
|
||||
ProfileStore.addChangeListener(this._updateProfileStore);
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
AccountStore.removeChangeListener(this._updateAccountStore);
|
||||
APStore.removeChangeListener(this._updateAPStore);
|
||||
PhaseStore.removeChangeListener(this._updatePhaseStore);
|
||||
ProfileStore.removeChangeListener(this._updateProfileStore);
|
||||
}
|
||||
|
||||
back = () => TabActions.showSection('main');
|
||||
test = () => {
|
||||
if (ELStore.getStartID() === 'EL_0') {
|
||||
HerolistActions.showHeroCreation();
|
||||
} else {
|
||||
TabActions.showSection('hero');
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
|
||||
const { section, tab } = this.props;
|
||||
const { ap, used, phase, portrait } = this.state;
|
||||
const { account, ap, used, phase, portrait = '' } = this.state;
|
||||
|
||||
var showBackNav = true;
|
||||
var tabsElement;
|
||||
@@ -86,22 +75,36 @@ class TitleBar extends Component {
|
||||
switch (section) {
|
||||
case 'main': {
|
||||
showBackNav = false;
|
||||
tabsElement = (
|
||||
<TitleBarNav active={tab} tabs={[
|
||||
{ label: 'Start', tag: 'home' },
|
||||
{ label: 'Helden', tag: 'herolist' },
|
||||
{ label: 'Gruppen', tag: 'grouplist', disabled: true },
|
||||
{ label: 'Konto', tag: 'account', disabled: true },
|
||||
{ label: 'Über', tag: 'about' }
|
||||
]} />
|
||||
);
|
||||
|
||||
actionsElement = (
|
||||
<div className="right">
|
||||
<BorderButton label="Registrieren" disabled />
|
||||
<BorderButton label="Anmelden" disabled />
|
||||
</div>
|
||||
);
|
||||
if (account.id === null) {
|
||||
tabsElement = (
|
||||
<TitleBarNav active={tab} tabs={[
|
||||
{ label: 'Start', tag: 'home' },
|
||||
{ label: 'Über', tag: 'about' }
|
||||
]} />
|
||||
);
|
||||
actionsElement = (
|
||||
<div className="right">
|
||||
<BorderButton label="Testen" onClick={this.test} />
|
||||
<BorderButton label="Anmelden" onClick={AccountActions.showLogin} primary />
|
||||
</div>
|
||||
);
|
||||
} else {
|
||||
tabsElement = (
|
||||
<TitleBarNav active={tab} tabs={[
|
||||
{ label: 'Start', tag: 'home' },
|
||||
{ label: 'Helden', tag: 'herolist' },
|
||||
{ label: 'Gruppen', tag: 'grouplist', disabled: true },
|
||||
{ label: 'Konto', tag: 'account' },
|
||||
{ label: 'Über', tag: 'about' }
|
||||
]} />
|
||||
);
|
||||
actionsElement = (
|
||||
<div className="right">
|
||||
<div className="account">{account.name}</div>
|
||||
<BorderButton label="Abmelden" onClick={AccountActions.logout} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 'hero': {
|
||||
|
||||
@@ -2,6 +2,7 @@ import Avatar from './Avatar';
|
||||
import React, { Component, PropTypes } from 'react';
|
||||
import Tab from './Tab';
|
||||
import TabActions from '../../actions/TabActions';
|
||||
import classNames from 'classnames';
|
||||
|
||||
class TitleBarNav extends Component {
|
||||
|
||||
@@ -20,8 +21,8 @@ class TitleBarNav extends Component {
|
||||
|
||||
const { active, avatar, children, tabs } = this.props;
|
||||
|
||||
const avatarElement = avatar ? (
|
||||
<div className="avatar-wrapper">
|
||||
const avatarElement = avatar !== undefined ? (
|
||||
<div className={classNames( 'avatar-wrapper', !avatar && 'no-avatar' )}>
|
||||
<Avatar src={avatar} />
|
||||
</div>
|
||||
) : null;
|
||||
|
||||
@@ -16,6 +16,7 @@ export default keyMirror({
|
||||
// AccountStore
|
||||
RECEIVE_ACCOUNT: null,
|
||||
UPDATE_USERNAME: null,
|
||||
LOGOUT_SUCCESS: null,
|
||||
CLEAR_ACCOUNT: null,
|
||||
|
||||
// Registration
|
||||
|
||||
+20
-3
@@ -21,9 +21,9 @@ const SKT = [
|
||||
[15,15,15,30,45,60,75,90,105,120,135,150,165,180]
|
||||
];
|
||||
|
||||
var _max = 1100;
|
||||
var _used = 224;
|
||||
var _rcp = [0, 12, 212, 0];
|
||||
var _max = 0;
|
||||
var _used = 0;
|
||||
var _rcp = [0, 0, 0, 0];
|
||||
var _adv = 0;
|
||||
var _adv_mag = 0;
|
||||
var _adv_kar = 0;
|
||||
@@ -88,6 +88,18 @@ function _calculateRCPDiff(index, next) {
|
||||
_rcp[index] = next;
|
||||
}
|
||||
|
||||
function _clear() {
|
||||
_max = 0;
|
||||
_used = 0;
|
||||
_rcp = [ 0, 0, 0, 0 ];
|
||||
_adv = 0;
|
||||
_adv_mag = 0;
|
||||
_adv_kar = 0;
|
||||
_disadv = 0;
|
||||
_disadv_mag = 0;
|
||||
_disadv_kar = 0;
|
||||
}
|
||||
|
||||
function _updateAll(obj) {
|
||||
_max = obj._max;
|
||||
_used = obj._used;
|
||||
@@ -207,6 +219,10 @@ APStore.dispatchToken = AppDispatcher.register( function( payload ) {
|
||||
|
||||
switch( payload.actionType ) {
|
||||
|
||||
case ActionTypes.CLEAR_HERO:
|
||||
_clear();
|
||||
break;
|
||||
|
||||
case ActionTypes.RECEIVE_HERO:
|
||||
_updateAll(payload.ap);
|
||||
break;
|
||||
@@ -273,6 +289,7 @@ APStore.dispatchToken = AppDispatcher.register( function( payload ) {
|
||||
break;
|
||||
|
||||
case ActionTypes.CREATE_NEW_HERO: {
|
||||
_clear();
|
||||
AppDispatcher.waitFor([ELStore.dispatchToken]);
|
||||
_max = ELStore.getStart().ap;
|
||||
break;
|
||||
|
||||
@@ -9,13 +9,13 @@ import Categories from '../constants/Categories';
|
||||
|
||||
const CATEGORY = Categories.ATTRIBUTES;
|
||||
|
||||
var _le = 5;
|
||||
var _le = 0;
|
||||
var _le_add = 0;
|
||||
var _ae_add = 0;
|
||||
var _ke_add = 0;
|
||||
var _sk = -5;
|
||||
var _zk = -5;
|
||||
var _gs = 8;
|
||||
var _sk = 0;
|
||||
var _zk = 0;
|
||||
var _gs = 0;
|
||||
|
||||
function _addPoint(id) {
|
||||
ListStore.addAttrPoint(id);
|
||||
@@ -39,6 +39,21 @@ function _addMaxEnergyPoint(id) {
|
||||
}
|
||||
}
|
||||
|
||||
function _clear() {
|
||||
ListStore.getAllByCategory(CATEGORY).forEach(e => {
|
||||
ListStore.setProperty(e.id, 'value', 8);
|
||||
ListStore.setProperty(e.id, 'mod', 0);
|
||||
ListStore.setProperty(e.id, 'dependencies', []);
|
||||
});
|
||||
_le = 0;
|
||||
_le_add = 0;
|
||||
_ae_add = 0;
|
||||
_ke_add = 0;
|
||||
_sk = 0;
|
||||
_zk = 0;
|
||||
_gs = 0;
|
||||
}
|
||||
|
||||
function _updateAll(obj) {
|
||||
obj.values.forEach(e => {
|
||||
ListStore.setProperty(e[0], 'value', e[1]);
|
||||
@@ -70,10 +85,7 @@ var AttributeStore = Object.assign({}, EventEmitter.prototype, {
|
||||
|
||||
init: function(rawAttributes) {
|
||||
for (let id in rawAttributes) {
|
||||
rawAttributes[id].value = 8;
|
||||
rawAttributes[id].category = CATEGORY;
|
||||
rawAttributes[id].dependencies = [];
|
||||
rawAttributes[id].mod = 0;
|
||||
}
|
||||
ListStore.init(rawAttributes);
|
||||
},
|
||||
@@ -170,6 +182,11 @@ AttributeStore.dispatchToken = AppDispatcher.register( function( payload ) {
|
||||
|
||||
switch( payload.actionType ) {
|
||||
|
||||
case ActionTypes.CLEAR_HERO:
|
||||
case ActionTypes.CREATE_NEW_HERO:
|
||||
_clear();
|
||||
break;
|
||||
|
||||
case ActionTypes.RECEIVE_HERO:
|
||||
_updateAll(payload.attr);
|
||||
break;
|
||||
|
||||
@@ -1,122 +0,0 @@
|
||||
import AppDispatcher from '../dispatcher/AppDispatcher';
|
||||
import EventEmitter from 'events';
|
||||
import ActionTypes from '../constants/ActionTypes';
|
||||
|
||||
var _rules = null; // 4 oder 5
|
||||
var _gender = null;
|
||||
var _attributeMax = 14;
|
||||
var _gp = {
|
||||
max: 110,
|
||||
attributes: 100
|
||||
};
|
||||
|
||||
function updateRules(rules) {
|
||||
_rules = rules;
|
||||
}
|
||||
|
||||
function updateGender(gender) {
|
||||
_gender = gender;
|
||||
}
|
||||
|
||||
function updateGpMax(max) {
|
||||
_gp.max = max;
|
||||
}
|
||||
|
||||
function updateGpAttr(attributes) {
|
||||
_gp.attributes = attributes;
|
||||
}
|
||||
|
||||
function updateAttrMax(max) {
|
||||
_attributeMax = max;
|
||||
}
|
||||
|
||||
function reset() {
|
||||
_rules = null;
|
||||
_gender = null;
|
||||
_attributeMax = 14;
|
||||
_gp = {
|
||||
max: 110,
|
||||
attributes: 100
|
||||
};
|
||||
}
|
||||
|
||||
var CharbaseStore = Object.assign({}, EventEmitter.prototype, {
|
||||
|
||||
emitChange: function() {
|
||||
this.emit('change');
|
||||
},
|
||||
|
||||
addChangeListener: function(callback) {
|
||||
this.on('change', callback);
|
||||
},
|
||||
|
||||
removeChangeListener: function(callback) {
|
||||
this.removeListener('change', callback);
|
||||
},
|
||||
|
||||
getRules: function() {
|
||||
return _rules;
|
||||
},
|
||||
|
||||
getGender: function() {
|
||||
return _gender;
|
||||
},
|
||||
|
||||
getAttrMax: function() {
|
||||
return _attributeMax;
|
||||
},
|
||||
|
||||
getGP: function() {
|
||||
return _gp;
|
||||
},
|
||||
|
||||
getAll: function() {
|
||||
return {
|
||||
rules: _rules,
|
||||
gender: _gender,
|
||||
attributeMax: _attributeMax,
|
||||
gp: _gp
|
||||
};
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
CharbaseStore.dispatchToken = AppDispatcher.register( function( payload ) {
|
||||
|
||||
switch( payload.actionType ) {
|
||||
|
||||
case ActionTypes.SET_RULES:
|
||||
updateRules(payload.data.value);
|
||||
break;
|
||||
|
||||
case ActionTypes.SET_GENDER:
|
||||
updateGender(payload.data.value);
|
||||
break;
|
||||
|
||||
case ActionTypes.SET_GP_MAXIMUM:
|
||||
updateGpMax(payload.data.value);
|
||||
break;
|
||||
|
||||
case ActionTypes.SET_GP_FOR_ATTRIBUTES:
|
||||
updateGpAttr(payload.data.value);
|
||||
break;
|
||||
|
||||
case ActionTypes.SET_ATTRIBUTE_MAXIMUM:
|
||||
updateAttrMax(payload.data.value);
|
||||
break;
|
||||
|
||||
case ActionTypes.CLEAR_HERO:
|
||||
reset();
|
||||
break;
|
||||
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
|
||||
CharbaseStore.emitChange();
|
||||
|
||||
return true;
|
||||
|
||||
});
|
||||
|
||||
export default CharbaseStore;
|
||||
@@ -29,6 +29,13 @@ function _updateSortOrder(option) {
|
||||
_sortOrder = option;
|
||||
}
|
||||
|
||||
function _clear() {
|
||||
ListStore.getAllByCategory(CATEGORY).forEach(e => {
|
||||
ListStore.setSR(e.id, 0);
|
||||
ListStore.setProperty(e.id, 'dependencies', []);
|
||||
});
|
||||
}
|
||||
|
||||
function _updateAll(obj) {
|
||||
obj.active.forEach(e => {
|
||||
ListStore.setSR(...e);
|
||||
@@ -181,6 +188,11 @@ CombatTechniquesStore.dispatchToken = AppDispatcher.register( function( payload
|
||||
|
||||
switch( payload.actionType ) {
|
||||
|
||||
case ActionTypes.CLEAR_HERO:
|
||||
case ActionTypes.CREATE_NEW_HERO:
|
||||
_clear();
|
||||
break;
|
||||
|
||||
case ActionTypes.RECEIVE_HERO:
|
||||
_updateAll(payload.ct);
|
||||
break;
|
||||
|
||||
@@ -151,6 +151,15 @@ function _updateTier(id, tier, sid) {
|
||||
ListStore.set(id, obj);
|
||||
}
|
||||
|
||||
function _clear() {
|
||||
ListStore.getAllByCategory(CATEGORY_1, CATEGORY_2).forEach(e => {
|
||||
ListStore.setProperty(e.id, 'active', ListStore.get(e.id).max === null ? false : []);
|
||||
ListStore.setProperty(e.id, 'tier');
|
||||
ListStore.setProperty(e.id, 'sid');
|
||||
ListStore.setProperty(e.id, 'dependencies', []);
|
||||
});
|
||||
}
|
||||
|
||||
function _updateAll(payload) {
|
||||
payload.active.forEach(e => {
|
||||
let [ id, options ] = e;
|
||||
@@ -598,6 +607,11 @@ DisAdvStore.dispatchToken = AppDispatcher.register( function( payload ) {
|
||||
|
||||
switch( payload.actionType ) {
|
||||
|
||||
case ActionTypes.CLEAR_HERO:
|
||||
case ActionTypes.CREATE_NEW_HERO:
|
||||
_clear();
|
||||
break;
|
||||
|
||||
case ActionTypes.RECEIVE_HERO:
|
||||
_updateAll(payload.disadv);
|
||||
break;
|
||||
|
||||
@@ -84,12 +84,16 @@ var _el = {
|
||||
}
|
||||
};
|
||||
|
||||
var _start = 'EL_3';
|
||||
var _start = 'EL_0';
|
||||
|
||||
function _update(el) {
|
||||
_start = el;
|
||||
}
|
||||
|
||||
function _clear() {
|
||||
_start = 'EL_0';
|
||||
}
|
||||
|
||||
var ELStore = Object.assign({}, EventEmitter.prototype, {
|
||||
|
||||
emitChange: function() {
|
||||
@@ -126,12 +130,12 @@ ELStore.dispatchToken = AppDispatcher.register( function( payload ) {
|
||||
_update(payload.el);
|
||||
break;
|
||||
|
||||
case ActionTypes.RECEIVE_HERO:
|
||||
_update(payload.el);
|
||||
case ActionTypes.CLEAR_HERO:
|
||||
_clear();
|
||||
break;
|
||||
|
||||
case ActionTypes.CLEAR_HERO:
|
||||
_update('EL_1');
|
||||
case ActionTypes.RECEIVE_HERO:
|
||||
_update(payload.el);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
@@ -1,99 +0,0 @@
|
||||
import AppDispatcher from '../dispatcher/AppDispatcher';
|
||||
import { EventEmitter } from 'events';
|
||||
import ActionTypes from '../constants/ActionTypes';
|
||||
import HeroesStore from './core/HeroesStore';
|
||||
|
||||
var _id = 'h0';
|
||||
var _name = '';
|
||||
var _group = 0;
|
||||
|
||||
function create(id, name) {
|
||||
_id = id;
|
||||
_name = name;
|
||||
_group = 1;
|
||||
}
|
||||
|
||||
function receiveNew(id) {
|
||||
let core = HeroesStore.getHeroByID(id);
|
||||
_id = id;
|
||||
_name = core.name;
|
||||
_group = parseInt(core.group);
|
||||
}
|
||||
|
||||
function updateName(name) {
|
||||
_name = name;
|
||||
}
|
||||
|
||||
function reset() {
|
||||
_id = 'h0';
|
||||
_name = '';
|
||||
_group = 0;
|
||||
}
|
||||
|
||||
var HeroStore = Object.assign({}, EventEmitter.prototype, {
|
||||
|
||||
emitChange: function() {
|
||||
this.emit('change');
|
||||
},
|
||||
|
||||
addChangeListener: function(callback) {
|
||||
this.on('change', callback);
|
||||
},
|
||||
|
||||
removeChangeListener: function(callback) {
|
||||
this.removeListener('change', callback);
|
||||
},
|
||||
|
||||
getAll: function() {
|
||||
return {
|
||||
id: _id,
|
||||
name: _name,
|
||||
group: _group
|
||||
};
|
||||
},
|
||||
|
||||
getID: function() {
|
||||
return _id;
|
||||
},
|
||||
|
||||
getName: function() {
|
||||
return _name;
|
||||
},
|
||||
|
||||
getGroup: function() {
|
||||
return _group;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
HeroStore.dispatchToken = AppDispatcher.register( function( payload ) {
|
||||
|
||||
switch( payload.actionType ) {
|
||||
|
||||
case ActionTypes.CREATE_HERO:
|
||||
create(payload.heroid, payload.heroname);
|
||||
break;
|
||||
|
||||
case ActionTypes.RECEIVE_HERO:
|
||||
receiveNew(payload.id);
|
||||
break;
|
||||
|
||||
case ActionTypes.UPDATE_HERONAME:
|
||||
updateName(payload.heroname);
|
||||
break;
|
||||
|
||||
case ActionTypes.CLEAR_HERO:
|
||||
reset();
|
||||
break;
|
||||
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
|
||||
HeroStore.emitChange();
|
||||
|
||||
return true;
|
||||
|
||||
});
|
||||
|
||||
export default HeroStore;
|
||||
@@ -119,7 +119,11 @@ var ListStore = Object.assign({}, EventEmitter.prototype, {
|
||||
},
|
||||
|
||||
setProperty: function(id, property, value) {
|
||||
_list[id][property] = value;
|
||||
if (value === undefined) {
|
||||
delete _list[id][property];
|
||||
} else {
|
||||
_list[id][property] = value;
|
||||
}
|
||||
},
|
||||
|
||||
addToProperty: function(id, property, value) {
|
||||
|
||||
@@ -36,6 +36,14 @@ function _updateSortOrder(option) {
|
||||
_sortOrder = option;
|
||||
}
|
||||
|
||||
function _clear() {
|
||||
ListStore.getAllByCategory(CATEGORY).forEach(e => {
|
||||
ListStore.deactivate(e.id);
|
||||
ListStore.setSR(e.id, 0);
|
||||
ListStore.setProperty(e.id, 'dependencies', []);
|
||||
});
|
||||
}
|
||||
|
||||
function _updateAll(obj) {
|
||||
obj.active.forEach(e => {
|
||||
ListStore.activate(e[0]);
|
||||
@@ -231,6 +239,11 @@ LiturgiesStore.dispatchToken = AppDispatcher.register( function( payload ) {
|
||||
|
||||
switch( payload.actionType ) {
|
||||
|
||||
case ActionTypes.CLEAR_HERO:
|
||||
case ActionTypes.CREATE_NEW_HERO:
|
||||
_clear();
|
||||
break;
|
||||
|
||||
case ActionTypes.RECEIVE_HERO:
|
||||
_updateAll(payload.chants);
|
||||
break;
|
||||
|
||||
@@ -2,7 +2,7 @@ import AppDispatcher from '../dispatcher/AppDispatcher';
|
||||
import { EventEmitter } from 'events';
|
||||
import ActionTypes from '../constants/ActionTypes';
|
||||
|
||||
var _phase = 4;
|
||||
var _phase = 1;
|
||||
|
||||
function _update(phase) {
|
||||
_phase = phase;
|
||||
@@ -36,6 +36,10 @@ PhaseStore.dispatchToken = AppDispatcher.register( function( payload ) {
|
||||
|
||||
switch( payload.actionType ) {
|
||||
|
||||
case ActionTypes.RECEIVE_HERO:
|
||||
_update(payload.phase);
|
||||
break;
|
||||
|
||||
case ActionTypes.CREATE_NEW_HERO:
|
||||
_update(1);
|
||||
break;
|
||||
@@ -44,14 +48,6 @@ PhaseStore.dispatchToken = AppDispatcher.register( function( payload ) {
|
||||
_update(2);
|
||||
break;
|
||||
|
||||
case ActionTypes.INCREASE_PHASE:
|
||||
_increase();
|
||||
break;
|
||||
|
||||
case ActionTypes.RESET_PHASE:
|
||||
_update(1);
|
||||
break;
|
||||
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -5,9 +5,9 @@ import RaceStore from './rcp/RaceStore';
|
||||
import dice from '../utils/dice';
|
||||
|
||||
var _id = null;
|
||||
var _name = 'Heldenname';
|
||||
var _gender = 'm';
|
||||
var _portrait = 'images/portrait.png';
|
||||
var _name = '';
|
||||
var _gender = '';
|
||||
var _portrait = '';
|
||||
var _hair = '';
|
||||
var _eyes = '';
|
||||
var _size = '';
|
||||
@@ -86,6 +86,17 @@ function _rerollWeight() {
|
||||
}).reduce((a,b) => a + b, 0);
|
||||
}
|
||||
|
||||
function _clear() {
|
||||
_id = null;
|
||||
_name = '';
|
||||
_gender = '';
|
||||
_portrait = '';
|
||||
_hair = '';
|
||||
_eyes = '';
|
||||
_size = '';
|
||||
_weight = '';
|
||||
}
|
||||
|
||||
var ProfileStore = Object.assign({}, EventEmitter.prototype, {
|
||||
|
||||
emitChange: function() {
|
||||
@@ -145,10 +156,15 @@ ProfileStore.dispatchToken = AppDispatcher.register( function( payload ) {
|
||||
switch( payload.actionType ) {
|
||||
|
||||
case ActionTypes.CREATE_NEW_HERO:
|
||||
_clear();
|
||||
_updateName(payload.name);
|
||||
_updateGender(payload.gender);
|
||||
break;
|
||||
|
||||
case ActionTypes.CLEAR_HERO:
|
||||
_clear();
|
||||
break;
|
||||
|
||||
case ActionTypes.RECEIVE_HERO:
|
||||
_updateID(payload.id);
|
||||
_updateName(payload.name);
|
||||
|
||||
@@ -109,6 +109,15 @@ function _updateTier(id, tier, sid) {
|
||||
ListStore.set(id, obj);
|
||||
}
|
||||
|
||||
function _clear() {
|
||||
ListStore.getAllByCategory(CATEGORY).forEach(e => {
|
||||
ListStore.setProperty(e.id, 'active', ListStore.get(e.id).max === null ? false : []);
|
||||
ListStore.setProperty(e.id, 'tier');
|
||||
ListStore.setProperty(e.id, 'sid');
|
||||
ListStore.setProperty(e.id, 'dependencies', []);
|
||||
});
|
||||
}
|
||||
|
||||
function _updateAll(payload) {
|
||||
payload.active.forEach(e => {
|
||||
let [ id, options ] = e;
|
||||
@@ -590,6 +599,11 @@ SpecialAbilitiesStore.dispatchToken = AppDispatcher.register( function( payload
|
||||
|
||||
switch( payload.actionType ) {
|
||||
|
||||
case ActionTypes.CLEAR_HERO:
|
||||
case ActionTypes.CREATE_NEW_HERO:
|
||||
_clear();
|
||||
break;
|
||||
|
||||
case ActionTypes.RECEIVE_HERO:
|
||||
_updateAll(payload.sa);
|
||||
break;
|
||||
|
||||
@@ -38,6 +38,14 @@ function _updateSortOrder(option) {
|
||||
_sortOrder = option;
|
||||
}
|
||||
|
||||
function _clear() {
|
||||
ListStore.getAllByCategory(CATEGORY).forEach(e => {
|
||||
ListStore.deactivate(e.id);
|
||||
ListStore.setSR(e.id, 0);
|
||||
ListStore.setProperty(e.id, 'dependencies', []);
|
||||
});
|
||||
}
|
||||
|
||||
function _updateAll(obj) {
|
||||
obj.active.forEach(e => {
|
||||
ListStore.activate(e[0]);
|
||||
@@ -266,6 +274,11 @@ SpellsStore.dispatchToken = AppDispatcher.register( function( payload ) {
|
||||
|
||||
switch( payload.actionType ) {
|
||||
|
||||
case ActionTypes.CLEAR_HERO:
|
||||
case ActionTypes.CREATE_NEW_HERO:
|
||||
_clear();
|
||||
break;
|
||||
|
||||
case ActionTypes.RECEIVE_HERO:
|
||||
_updateAll(payload.spells);
|
||||
break;
|
||||
|
||||
@@ -35,6 +35,13 @@ function _updateTalentRating() {
|
||||
_talentRating = !_talentRating;
|
||||
}
|
||||
|
||||
function _clear() {
|
||||
ListStore.getAllByCategory(CATEGORY).forEach(e => {
|
||||
ListStore.setSR(e.id, 0);
|
||||
ListStore.setProperty(e.id, 'dependencies', []);
|
||||
});
|
||||
}
|
||||
|
||||
function _updateAll(obj) {
|
||||
obj.active.forEach(e => {
|
||||
ListStore.setSR(...e);
|
||||
@@ -181,6 +188,11 @@ TalentsStore.dispatchToken = AppDispatcher.register( function( payload ) {
|
||||
|
||||
switch( payload.actionType ) {
|
||||
|
||||
case ActionTypes.CLEAR_HERO:
|
||||
case ActionTypes.CREATE_NEW_HERO:
|
||||
_clear();
|
||||
break;
|
||||
|
||||
case ActionTypes.RECEIVE_HERO:
|
||||
_updateAll(payload.talents);
|
||||
break;
|
||||
|
||||
@@ -5,17 +5,17 @@ import ActionTypes from '../../constants/ActionTypes';
|
||||
var _id = 4;
|
||||
var _name = 'Elytherion';
|
||||
|
||||
function updateName(name) {
|
||||
_name = name;
|
||||
}
|
||||
|
||||
function updateAll(id, name) {
|
||||
_id = id;
|
||||
_name = name;
|
||||
}
|
||||
|
||||
function updateName(name) {
|
||||
_name = name;
|
||||
}
|
||||
|
||||
function reset() {
|
||||
_id = 0;
|
||||
_id = null;
|
||||
_name = '';
|
||||
}
|
||||
|
||||
@@ -55,14 +55,14 @@ AccountStore.dispatchToken = AppDispatcher.register( function( payload ) {
|
||||
switch( payload.actionType ) {
|
||||
|
||||
case ActionTypes.RECEIVE_ACCOUNT:
|
||||
updateAll(payload.userid, payload.username);
|
||||
updateAll(payload.id, payload.name);
|
||||
break;
|
||||
|
||||
case ActionTypes.UPDATE_USERNAME:
|
||||
updateName(payload.username);
|
||||
break;
|
||||
|
||||
case ActionTypes.CLEAR_ACCOUNT:
|
||||
case ActionTypes.LOGOUT_SUCCESS:
|
||||
reset();
|
||||
break;
|
||||
|
||||
|
||||
@@ -3,11 +3,11 @@ import { EventEmitter } from 'events';
|
||||
import ActionTypes from '../../constants/ActionTypes';
|
||||
|
||||
var _heroes = {
|
||||
|
||||
'H_0': {
|
||||
'H_1': {
|
||||
client_version: '1.0.0',
|
||||
date: new Date('2016-10-18T16:18:28.420Z'),
|
||||
id: 'H_0',
|
||||
id: 'H_1',
|
||||
phase: 2,
|
||||
name: 'Shimo ibn Rashdul',
|
||||
avatar: 'images/portrait.png',
|
||||
ap: {
|
||||
@@ -27,8 +27,9 @@ var _heroes = {
|
||||
p: 'P_6',
|
||||
pv: 'PV_21'
|
||||
},
|
||||
'H_1': {
|
||||
id: 'H_1',
|
||||
'H_2': {
|
||||
id: 'H_2',
|
||||
phase: 2,
|
||||
name: 'Yendan Keres',
|
||||
avatar: 'images/portrait2.png',
|
||||
ap: { _max: 1160, _used: 936 },
|
||||
@@ -51,22 +52,10 @@ function _updateSortOrder(option) {
|
||||
}
|
||||
|
||||
function _updateHeroes(rawHeroes) {
|
||||
rawHeroes.split('#§');
|
||||
for (let i = 0; i < (rawHeroes.length - 1); i++) {
|
||||
rawHeroes[i] = rawHeroes[i].split('#%');
|
||||
rawHeroes[i][2] = rawHeroes[i][2].split('#$');
|
||||
rawHeroes[i] = {
|
||||
id: rawHeroes[i][0],
|
||||
name: rawHeroes[i][1],
|
||||
phase: rawHeroes[i][2][0],
|
||||
ap: rawHeroes[i][2][1],
|
||||
prof: rawHeroes[i][2][2],
|
||||
group: 1
|
||||
// group: raw[i][3],
|
||||
// player: raw[i][4]
|
||||
};
|
||||
}
|
||||
_heroes = rawHeroes;
|
||||
var heroes = JSON.parse(rawHeroes);
|
||||
var obj = {};
|
||||
heroes.forEach(e => obj[e.id] = e);
|
||||
_heroes = obj;
|
||||
}
|
||||
|
||||
var HerolistStore = Object.assign({}, EventEmitter.prototype, {
|
||||
@@ -150,7 +139,7 @@ HerolistStore.dispatchToken = AppDispatcher.register( function( payload ) {
|
||||
|
||||
case ActionTypes.RECEIVE_ACCOUNT:
|
||||
case ActionTypes.RECEIVE_RAW_HEROES:
|
||||
_updateHeroes(payload.raw);
|
||||
_updateHeroes(payload.rawHeroes);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import AppDispatcher from '../../dispatcher/AppDispatcher';
|
||||
import { EventEmitter } from 'events';
|
||||
import ActionTypes from '../../constants/ActionTypes';
|
||||
import AccountStore from './AccountStore';
|
||||
import PhaseStore from '../PhaseStore';
|
||||
|
||||
var _currentTab = 'herolist';
|
||||
@@ -19,10 +20,15 @@ function _updateSection(section, tab) {
|
||||
_updateTab(tab);
|
||||
else switch (section) {
|
||||
case 'main':
|
||||
if (before === 'hero')
|
||||
_currentTab = 'herolist';
|
||||
else if (before === 'group')
|
||||
if (before === 'hero') {
|
||||
if (AccountStore.getID() === null) {
|
||||
_currentTab = 'home';
|
||||
} else {
|
||||
_currentTab = 'herolist';
|
||||
}
|
||||
} else if (before === 'group') {
|
||||
_currentTab = 'grouplist';
|
||||
}
|
||||
break;
|
||||
case 'hero':
|
||||
_currentTab = 'profile';
|
||||
@@ -89,8 +95,8 @@ TabStore.dispatchToken = AppDispatcher.register( function( payload ) {
|
||||
case ActionTypes.REGISTRATION_SUCCESS:
|
||||
_updateTab('confirmRegistration');
|
||||
break;
|
||||
|
||||
case ActionTypes.RECEIVE_ACCOUNT:
|
||||
|
||||
case ActionTypes.LOGOUT_SUCCESS:
|
||||
case ActionTypes.CLEAR_HERO:
|
||||
_updateTab('home');
|
||||
break;
|
||||
|
||||
@@ -49,6 +49,7 @@ WaitStore.dispatchToken = AppDispatcher.register( function( payload ) {
|
||||
case ActionTypes.CREATE_HERO:
|
||||
case ActionTypes.RECEIVE_HERO:
|
||||
case ActionTypes.RECEIVE_RAW_LISTS:
|
||||
case ActionTypes.SAVE_HERO_SUCCESS:
|
||||
stopWaiting();
|
||||
break;
|
||||
|
||||
|
||||
+114
-54
@@ -26,7 +26,8 @@ var WebAPIUtils = {
|
||||
});
|
||||
},
|
||||
register: function(email, username, password) {
|
||||
return new Promise(function(resolve, reject){
|
||||
ServerActions.startLoading();
|
||||
return new Promise(function(){
|
||||
jQuery.ajax(
|
||||
{
|
||||
url: 'http://cha5app.dsa-sh.de/php/register.php?e=' + email + '&u=' + username + '&p=' + password,
|
||||
@@ -36,105 +37,133 @@ var WebAPIUtils = {
|
||||
ServerActions.registrationSuccess();
|
||||
},
|
||||
error: function(error) {
|
||||
connectionError(error);
|
||||
reject();
|
||||
ServerActions.connectionError(error);
|
||||
}
|
||||
}
|
||||
);
|
||||
});
|
||||
},
|
||||
checkEmail: function(email) {
|
||||
return new Promise(function(resolve, reject){
|
||||
return new Promise(function(resolve){
|
||||
jQuery.ajax(
|
||||
{
|
||||
url: 'http://cha5app.dsa-sh.de/php/checkemail.php?e=' + email,
|
||||
type: 'GET',
|
||||
dataType: 'text',
|
||||
success: function(result) { resolve(result); },
|
||||
error: function(error) { connectionError(error); reject(); }
|
||||
success: function(result) {
|
||||
resolve(result);
|
||||
},
|
||||
error: function(error) {
|
||||
ServerActions.connectionError(error);
|
||||
}
|
||||
}
|
||||
);
|
||||
});
|
||||
},
|
||||
checkUsername: function(username) {
|
||||
return new Promise(function(resolve, reject){
|
||||
return new Promise(function(resolve){
|
||||
jQuery.ajax(
|
||||
{
|
||||
url: 'http://cha5app.dsa-sh.de/php/checkuser.php?u=' + username,
|
||||
type: 'GET',
|
||||
dataType: 'text',
|
||||
success: function(result) { resolve(result); },
|
||||
error: function(error) { connectionError(error); reject(); }
|
||||
success: function(result) {
|
||||
resolve(result);
|
||||
},
|
||||
error: function(error) {
|
||||
ServerActions.connectionError(error);
|
||||
}
|
||||
}
|
||||
);
|
||||
});
|
||||
},
|
||||
sendPasswordCode: function(email) {
|
||||
return new Promise(function(resolve, reject){
|
||||
return new Promise(function(){
|
||||
jQuery.ajax(
|
||||
{
|
||||
url: 'http://cha5app.dsa-sh.de/php/forgetpw.php?e=' + email,
|
||||
type: 'GET',
|
||||
dataType: 'text',
|
||||
success: function(result) { resolve(result); },
|
||||
error: function(error) { connectionError(error); reject(); }
|
||||
success: function(result) {
|
||||
ServerActions.forgotPasswordSuccess(result);
|
||||
},
|
||||
error: function(error) {
|
||||
ServerActions.connectionError(error);
|
||||
}
|
||||
}
|
||||
);
|
||||
});
|
||||
},
|
||||
sendUsername: function(email) {
|
||||
return new Promise(function(resolve, reject){
|
||||
return new Promise(function(){
|
||||
jQuery.ajax(
|
||||
{
|
||||
url: 'http://cha5app.dsa-sh.de/php/forgetusername.php?e=' + email,
|
||||
type: 'GET',
|
||||
dataType: 'text',
|
||||
success: function(result) { resolve(result); },
|
||||
error: function(error) { connectionError(error); reject(); }
|
||||
success: function(result) {
|
||||
ServerActions.forgotUsernameSuccess(result);
|
||||
},
|
||||
error: function(error) {
|
||||
ServerActions.connectionError(error);
|
||||
}
|
||||
}
|
||||
);
|
||||
});
|
||||
},
|
||||
resendActivation: function(email) {
|
||||
return new Promise(function(resolve, reject){
|
||||
return new Promise(function(){
|
||||
jQuery.ajax(
|
||||
{
|
||||
url: 'http://cha5app.dsa-sh.de/php/regmailagain.php?e=' + email,
|
||||
type: 'GET',
|
||||
dataType: 'text',
|
||||
success: function(result) { resolve(result); },
|
||||
error: function(error) { connectionError(error); reject(); }
|
||||
success: function(result) {
|
||||
ServerActions.resendActivationSuccess(result);
|
||||
},
|
||||
error: function(error) {
|
||||
ServerActions.connectionError(error);
|
||||
}
|
||||
}
|
||||
);
|
||||
});
|
||||
},
|
||||
login: function(username, password) {
|
||||
return new Promise(function(resolve, reject){
|
||||
ServerActions.startLoading();
|
||||
return new Promise(function(){
|
||||
jQuery.ajax(
|
||||
{
|
||||
url: 'http://cha5app.dsa-sh.de/php/login.php?u=' + username + '&p=' + password,
|
||||
type: 'GET',
|
||||
dataType: 'text',
|
||||
success: function(result) {
|
||||
ServerActions.receiveUser(result);
|
||||
success: function(result) {
|
||||
ServerActions.receiveAccount(result, username);
|
||||
},
|
||||
error: function(error) { connectionError(error); reject(); }
|
||||
error: function(error) {
|
||||
ServerActions.connectionError(error);
|
||||
}
|
||||
}
|
||||
);
|
||||
});
|
||||
},
|
||||
logout: function() {
|
||||
return new Promise(function(resolve, reject){
|
||||
jQuery.ajax(
|
||||
{
|
||||
url: 'http://cha5app.dsa-sh.de/php/logout.php?uid=' + AccountStore.getID(),
|
||||
type: 'GET',
|
||||
dataType: 'text',
|
||||
success: function(result) { resolve(result); },
|
||||
error: function(error) { connectionError(error); reject(); }
|
||||
}
|
||||
);
|
||||
});
|
||||
// ServerActions.startLoading();
|
||||
ServerActions.logoutSuccess();
|
||||
// return new Promise(function(){
|
||||
// jQuery.ajax(
|
||||
// {
|
||||
// url: 'http://cha5app.dsa-sh.de/php/logout.php?uid=' + AccountStore.getID(),
|
||||
// type: 'GET',
|
||||
// dataType: 'text',
|
||||
// success: function(result) {
|
||||
// ServerActions.logoutSuccess(result);
|
||||
// },
|
||||
// error: function(error) {
|
||||
// ServerActions.connectionError(error);
|
||||
// }
|
||||
// }
|
||||
// );
|
||||
// });
|
||||
},
|
||||
logoutSync: function() {
|
||||
jQuery.ajax(
|
||||
@@ -146,59 +175,80 @@ var WebAPIUtils = {
|
||||
}
|
||||
);
|
||||
},
|
||||
setNewUsername: function(username) {
|
||||
return new Promise(function(resolve, reject){
|
||||
setNewUsername: function(name) {
|
||||
ServerActions.startLoading();
|
||||
return new Promise(function(){
|
||||
jQuery.ajax(
|
||||
{
|
||||
url: 'http://cha5app.dsa-sh.de/php/php.php?uid=' + AccountStore.getID() + '&src=username&v=' + username,
|
||||
url: 'http://cha5app.dsa-sh.de/php/php.php?uid=' + AccountStore.getID() + '&src=username&v=' + name,
|
||||
type: 'GET',
|
||||
dataType: 'text',
|
||||
success: function(result) { resolve(result); },
|
||||
error: function(error) { connectionError(error); reject(); }
|
||||
success: function(result) {
|
||||
ServerActions.changeUsernameSuccess(result, name);
|
||||
},
|
||||
error: function(error) {
|
||||
ServerActions.connectionError(error);
|
||||
}
|
||||
}
|
||||
);
|
||||
});
|
||||
},
|
||||
setNewPassword: function(password) {
|
||||
return new Promise(function(resolve, reject){
|
||||
ServerActions.startLoading();
|
||||
return new Promise(function(){
|
||||
jQuery.ajax(
|
||||
{
|
||||
url: 'http://cha5app.dsa-sh.de/php/php.php?uid=' + AccountStore.getID() + '&src=password&v=' + password,
|
||||
type: 'GET',
|
||||
dataType: 'text',
|
||||
success: function(result) { resolve(result); },
|
||||
error: function(error) { connectionError(error); reject(); }
|
||||
success: function(result) {
|
||||
ServerActions.changePasswordSuccess(result);
|
||||
},
|
||||
error: function(error) {
|
||||
ServerActions.connectionError(error);
|
||||
}
|
||||
}
|
||||
);
|
||||
});
|
||||
},
|
||||
deleteAccount: function() {
|
||||
return new Promise(function(resolve, reject){
|
||||
ServerActions.startLoading();
|
||||
return new Promise(function(){
|
||||
jQuery.ajax(
|
||||
{
|
||||
url: 'http://cha5app.dsa-sh.de/php/deleteaccount.php?uid=' + AccountStore.getID(),
|
||||
type: 'GET',
|
||||
dataType: 'text',
|
||||
success: function(result) { resolve(result); },
|
||||
error: function(error) { connectionError(error); reject(); }
|
||||
success: function(result) {
|
||||
ServerActions.deleteAccountSuccess(result);
|
||||
},
|
||||
error: function(error) {
|
||||
ServerActions.connectionError(error);
|
||||
}
|
||||
}
|
||||
);
|
||||
});
|
||||
},
|
||||
getHeroes: function(userid) {
|
||||
return new Promise(function(resolve, reject){
|
||||
ServerActions.startLoading();
|
||||
return new Promise(function(){
|
||||
jQuery.ajax(
|
||||
{
|
||||
url: 'http://cha5app.dsa-sh.de/php/getherolist.php?uid=' + (typeof userid === 'undefined' ? AccountStore.getID(): userid),
|
||||
type: 'GET',
|
||||
dataType: 'text',
|
||||
success: function(result) { resolve(result); },
|
||||
error: function(error) { connectionError(error); reject(); }
|
||||
success: function(result) {
|
||||
ServerActions.herolistRefreshSuccess(result);
|
||||
},
|
||||
error: function(error) {
|
||||
ServerActions.connectionError(error);
|
||||
}
|
||||
}
|
||||
);
|
||||
});
|
||||
},
|
||||
loadHero: function(id) {
|
||||
ServerActions.startLoading();
|
||||
ServerActions.loadHeroSuccess(id, {
|
||||
"sex":"m",
|
||||
"pers":{
|
||||
@@ -259,19 +309,24 @@ var WebAPIUtils = {
|
||||
// });
|
||||
},
|
||||
createNewHero: function(heroname) {
|
||||
return new Promise(function(resolve, reject){
|
||||
return new Promise(function(resolve){
|
||||
jQuery.ajax(
|
||||
{
|
||||
url: 'http://cha5app.dsa-sh.de/php/newhero.php?uid=' + AccountStore.getID() + '&n=' + heroname,
|
||||
type: 'GET',
|
||||
dataType: 'text',
|
||||
success: function(result) { resolve(result); },
|
||||
error: function(error) { connectionError(error); reject(); }
|
||||
success: function(result) {
|
||||
resolve(result);
|
||||
},
|
||||
error: function(error) {
|
||||
ServerActions.connectionError(error);
|
||||
}
|
||||
}
|
||||
);
|
||||
});
|
||||
},
|
||||
saveHero: function(data) {
|
||||
ServerActions.startLoading();
|
||||
var blob = new Blob([data], { type: "application/json" });
|
||||
var url = window.URL.createObjectURL(blob);
|
||||
window.open(url);
|
||||
@@ -287,7 +342,7 @@ var WebAPIUtils = {
|
||||
// type: 'POST',
|
||||
// dataType: 'json',
|
||||
// success: function() {
|
||||
// ServerActions.saveHeroSuccess();
|
||||
ServerActions.saveHeroSuccess();
|
||||
// },
|
||||
// error: function(error) {
|
||||
// ServerActions.connectionError(error);
|
||||
@@ -297,14 +352,19 @@ var WebAPIUtils = {
|
||||
// });
|
||||
},
|
||||
deleteHero: function(heroid) {
|
||||
return new Promise(function(resolve, reject){
|
||||
ServerActions.startLoading();
|
||||
return new Promise(function(resolve){
|
||||
jQuery.ajax(
|
||||
{
|
||||
url: 'http://cha5app.dsa-sh.de/php/deletehero.php?uid=' + AccountStore.getID() + '&hid=' + heroid,
|
||||
type: 'GET',
|
||||
dataType: 'text',
|
||||
success: function(result) { resolve(result); },
|
||||
error: function(error) { connectionError(error); reject(); }
|
||||
success: function(result) {
|
||||
resolve(result);
|
||||
},
|
||||
error: function(error) {
|
||||
ServerActions.connectionError(error);
|
||||
}
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
export default function() {
|
||||
var node = document.createElement('div');
|
||||
|
||||
document.body.appendChild(node);
|
||||
|
||||
return node;
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
import React from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
|
||||
export function close(node) {
|
||||
ReactDOM.unmountComponentAtNode(node);
|
||||
document.body.removeChild(node);
|
||||
return true;
|
||||
}
|
||||
|
||||
export function createDialogNode() {
|
||||
let node = document.createElement('div');
|
||||
document.body.appendChild(node);
|
||||
return node;
|
||||
}
|
||||
|
||||
export default function(element) {
|
||||
let node = createDialogNode();
|
||||
ReactDOM.render( React.cloneElement(element, { node }), node );
|
||||
return true;
|
||||
}
|
||||
+11
-7
@@ -1,10 +1,14 @@
|
||||
import createDialogNode from './createDialogNode';
|
||||
import createOverlay from './createOverlay';
|
||||
import Dialog from '../components/layout/Dialog';
|
||||
import React from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
|
||||
export default function(title, content) {
|
||||
var node = createDialogNode();
|
||||
|
||||
ReactDOM.render( <Dialog title={title} node={node}>{content}</Dialog>, node );
|
||||
}
|
||||
export default function(title, content, buttons) {
|
||||
createOverlay(
|
||||
<Dialog
|
||||
title={title}
|
||||
buttons={buttons}
|
||||
>
|
||||
{content}
|
||||
</Dialog>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import CultureStore from '../stores/rcp/CultureStore';
|
||||
import DisAdvStore from '../stores/DisAdvStore';
|
||||
import ELStore from '../stores/ELStore';
|
||||
import LiturgiesStore from '../stores/LiturgiesStore';
|
||||
import PhaseStore from '../stores/PhaseStore';
|
||||
import ProfessionStore from '../stores/rcp/ProfessionStore';
|
||||
import ProfessionVariantStore from '../stores/rcp/ProfessionVariantStore';
|
||||
import ProfileStore from '../stores/ProfileStore';
|
||||
@@ -21,6 +22,7 @@ export default () => {
|
||||
client_version: VersionStore.get(),
|
||||
date: (new Date()).toJSON(),
|
||||
id: 'H_0',
|
||||
phase: PhaseStore.get(),
|
||||
name: ProfileStore.getName(),
|
||||
avatar: ProfileStore.getPortrait(),
|
||||
ap: APStore.getForSave(),
|
||||
@@ -48,4 +50,4 @@ export default () => {
|
||||
WebAPIUtils.saveHero(json);
|
||||
|
||||
return true;
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user