update to laptop

This commit is contained in:
silas 2018-07-06 12:17:33 +02:00
parent e2cf7e0a34
commit f04c9ec9b7
7 changed files with 218 additions and 141 deletions

1
.idea/wordRotator.iml generated
View File

@ -3,7 +3,6 @@
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src/module/Application/src" isTestSource="false" packagePrefix="Application\" />
<sourceFolder url="file://$MODULE_DIR$/src/module/Application/pwa/html" isTestSource="false" />
<excludeFolder url="file://$MODULE_DIR$/vendor/true/punycode" />
</content>
<orderEntry type="inheritedJdk" />

View File

@ -1,102 +1,52 @@
CREATE TABLE silas_wordRotator.Cronjob (id INT AUTO_INCREMENT NOT NULL, intervalInMinutes INT NOT NULL, lastRun DATETIME NOT NULL, className LONGTEXT NOT NULL, lastSuccess DATETIME NOT NULL, errorMessage LONGTEXT NOT NULL, active TINYINT(1) NOT NULL, version INT DEFAULT 1 NOT NULL, discr VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
CREATE TABLE silas_wordRotator.Code (id INT AUTO_INCREMENT NOT NULL, code VARCHAR(255) NOT NULL, creationDate DATETIME NOT NULL, isCacheable TINYINT(1) NOT NULL, version INT DEFAULT 1 NOT NULL, discriminator VARCHAR(255) NOT NULL, UNIQUE INDEX UNIQ_817996E977153098 (code), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
CREATE TABLE silas_wordRotator.UserCode (id INT NOT NULL, userId INT DEFAULT NULL, INDEX IDX_E2BA727E64B64DCC (userId), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
CREATE TABLE silas_wordRotator.ChangeEmailCode (id INT NOT NULL, newEmail VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
CREATE TABLE silas_wordRotator.User (id INT AUTO_INCREMENT NOT NULL, username VARCHAR(255) NOT NULL, password VARCHAR(128) NOT NULL, email VARCHAR(255) NOT NULL, activated TINYINT(1) NOT NULL, blocked TINYINT(1) NOT NULL, version INT DEFAULT 1 NOT NULL, UNIQUE INDEX UNIQ_7BFF7038F85E0677 (username), UNIQUE INDEX UNIQ_7BFF7038E7927C74 (email), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
CREATE TABLE UserAccess (UserId INT NOT NULL, AccessId INT NOT NULL, INDEX IDX_26623A76631A48FA (UserId), INDEX IDX_26623A76A1A046DD (AccessId), PRIMARY KEY(UserId, AccessId)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
CREATE TABLE silas_wordRotator.Role (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(75) NOT NULL, beschreibung VARCHAR(255) NOT NULL, version INT DEFAULT 1 NOT NULL, UNIQUE INDEX UNIQ_A1052C1B5E237E06 (name), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
CREATE TABLE RoleUser (RoleId INT NOT NULL, UserId INT NOT NULL, INDEX IDX_2DDE86A9BF6EF8BE (RoleId), INDEX IDX_2DDE86A9631A48FA (UserId), PRIMARY KEY(RoleId, UserId)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
CREATE TABLE RoleAccess (RoleId INT NOT NULL, AccessId INT NOT NULL, INDEX IDX_337C2901BF6EF8BE (RoleId), INDEX IDX_337C2901A1A046DD (AccessId), PRIMARY KEY(RoleId, AccessId)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
CREATE TABLE RoleChildren (ParentId INT NOT NULL, ChildId INT NOT NULL, INDEX IDX_88554C92E9982EB8 (ParentId), INDEX IDX_88554C92CD4052DB (ChildId), PRIMARY KEY(ParentId, ChildId)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
CREATE TABLE silas_wordRotator.RegistrationCode (id INT NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
CREATE TABLE silas_wordRotator.RequestNewPasswordCode (id INT NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
CREATE TABLE silas_wordRotator.UserSetting (id INT AUTO_INCREMENT NOT NULL, userId INT NOT NULL, name VARCHAR(255) NOT NULL, value LONGTEXT NOT NULL, lastUpdated BIGINT NOT NULL, version INT DEFAULT 1 NOT NULL, INDEX IDX_B63D87E164B64DCC (userId), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
CREATE TABLE silas_wordRotator.Access (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(75) NOT NULL, beschreibung VARCHAR(255) NOT NULL, version INT DEFAULT 1 NOT NULL, UNIQUE INDEX UNIQ_FF893525E237E06 (name), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
ALTER TABLE silas_wordRotator.UserCode ADD CONSTRAINT FK_E2BA727E64B64DCC FOREIGN KEY (userId) REFERENCES silas_wordRotator.User (id);
ALTER TABLE silas_wordRotator.UserCode ADD CONSTRAINT FK_E2BA727EBF396750 FOREIGN KEY (id) REFERENCES silas_wordRotator.Code (id) ON DELETE CASCADE;
ALTER TABLE silas_wordRotator.ChangeEmailCode ADD CONSTRAINT FK_8FAE5EFBF396750 FOREIGN KEY (id) REFERENCES silas_wordRotator.Code (id) ON DELETE CASCADE;
ALTER TABLE UserAccess ADD CONSTRAINT FK_26623A76631A48FA FOREIGN KEY (UserId) REFERENCES silas_wordRotator.User (id);
ALTER TABLE UserAccess ADD CONSTRAINT FK_26623A76A1A046DD FOREIGN KEY (AccessId) REFERENCES silas_wordRotator.Access (id);
ALTER TABLE RoleUser ADD CONSTRAINT FK_2DDE86A9BF6EF8BE FOREIGN KEY (RoleId) REFERENCES silas_wordRotator.Role (id);
ALTER TABLE RoleUser ADD CONSTRAINT FK_2DDE86A9631A48FA FOREIGN KEY (UserId) REFERENCES silas_wordRotator.User (id);
ALTER TABLE RoleAccess ADD CONSTRAINT FK_337C2901BF6EF8BE FOREIGN KEY (RoleId) REFERENCES silas_wordRotator.Role (id);
ALTER TABLE RoleAccess ADD CONSTRAINT FK_337C2901A1A046DD FOREIGN KEY (AccessId) REFERENCES silas_wordRotator.Access (id);
ALTER TABLE RoleChildren ADD CONSTRAINT FK_88554C92E9982EB8 FOREIGN KEY (ParentId) REFERENCES silas_wordRotator.Role (id);
ALTER TABLE RoleChildren ADD CONSTRAINT FK_88554C92CD4052DB FOREIGN KEY (ChildId) REFERENCES silas_wordRotator.Role (id);
ALTER TABLE silas_wordRotator.RegistrationCode ADD CONSTRAINT FK_96DE2014BF396750 FOREIGN KEY (id) REFERENCES silas_wordRotator.Code (id) ON DELETE CASCADE;
ALTER TABLE silas_wordRotator.RequestNewPasswordCode ADD CONSTRAINT FK_27CF9C8BBF396750 FOREIGN KEY (id) REFERENCES silas_wordRotator.Code (id) ON DELETE CASCADE;
ALTER TABLE silas_wordRotator.UserSetting ADD CONSTRAINT FK_B63D87E164B64DCC FOREIGN KEY (userId) REFERENCES silas_wordRotator.User (id);
CREATE TABLE silas_wordRotator.Code (id INT AUTO_INCREMENT NOT NULL, code VARCHAR(255) NOT NULL, creationDate DATETIME NOT NULL, isCacheable TINYINT(1) NOT NULL, version INT DEFAULT 1 NOT NULL, discriminator VARCHAR(255) NOT NULL, UNIQUE INDEX UNIQ_817996E977153098 (code), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
CREATE TABLE silas_wordRotator.UserCode (id INT NOT NULL, userId INT DEFAULT NULL, INDEX IDX_E2BA727E64B64DCC (userId), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
CREATE TABLE silas_wordRotator.ChangeEmailCode (id INT NOT NULL, newEmail VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
CREATE TABLE silas_wordRotator.Access (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(75) NOT NULL, beschreibung VARCHAR(255) NOT NULL, version INT DEFAULT 1 NOT NULL, UNIQUE INDEX UNIQ_FF893525E237E06 (name), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
CREATE TABLE silas_wordRotator.RegistrationCode (id INT NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
CREATE TABLE silas_wordRotator.Role (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(75) NOT NULL, beschreibung VARCHAR(255) NOT NULL, version INT DEFAULT 1 NOT NULL, UNIQUE INDEX UNIQ_A1052C1B5E237E06 (name), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
CREATE TABLE RoleUser (RoleId INT NOT NULL, UserId INT NOT NULL, INDEX IDX_2DDE86A9BF6EF8BE (RoleId), INDEX IDX_2DDE86A9631A48FA (UserId), PRIMARY KEY(RoleId, UserId)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
CREATE TABLE RoleAccess (RoleId INT NOT NULL, AccessId INT NOT NULL, INDEX IDX_337C2901BF6EF8BE (RoleId), INDEX IDX_337C2901A1A046DD (AccessId), PRIMARY KEY(RoleId, AccessId)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
CREATE TABLE RoleChildren (ParentId INT NOT NULL, ChildId INT NOT NULL, INDEX IDX_88554C92E9982EB8 (ParentId), INDEX IDX_88554C92CD4052DB (ChildId), PRIMARY KEY(ParentId, ChildId)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
CREATE TABLE silas_wordRotator.UserSetting (id INT AUTO_INCREMENT NOT NULL, userId INT NOT NULL, name VARCHAR(255) NOT NULL, value LONGTEXT NOT NULL, lastUpdated BIGINT NOT NULL, version INT DEFAULT 1 NOT NULL, INDEX IDX_B63D87E164B64DCC (userId), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
CREATE TABLE silas_wordRotator.User (id INT AUTO_INCREMENT NOT NULL, username VARCHAR(255) NOT NULL, password VARCHAR(128) NOT NULL, email VARCHAR(255) NOT NULL, activated TINYINT(1) NOT NULL, blocked TINYINT(1) NOT NULL, version INT DEFAULT 1 NOT NULL, UNIQUE INDEX UNIQ_7BFF7038F85E0677 (username), UNIQUE INDEX UNIQ_7BFF7038E7927C74 (email), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
CREATE TABLE UserAccess (UserId INT NOT NULL, AccessId INT NOT NULL, INDEX IDX_26623A76631A48FA (UserId), INDEX IDX_26623A76A1A046DD (AccessId), PRIMARY KEY(UserId, AccessId)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
CREATE TABLE silas_wordRotator.RequestNewPasswordCode (id INT NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
CREATE TABLE silas_wordRotator.Level (id INT AUTO_INCREMENT NOT NULL, words VARCHAR(255) NOT NULL, positions VARCHAR(255) NOT NULL, renderer INT NOT NULL, lastUpdated DATETIME NOT NULL, lang INT NOT NULL, deleted TINYINT(1) NOT NULL, difficulty INT NOT NULL, version INT DEFAULT 1 NOT NULL, UNIQUE INDEX levelCore (words, positions, renderer, lang), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
CREATE TABLE silas_wordRotator.Word (id INT AUTO_INCREMENT NOT NULL, word LONGTEXT NOT NULL, created DATETIME NOT NULL, lastUpdated DATETIME NOT NULL, deleted TINYINT(1) NOT NULL, lang INT NOT NULL, checked INT NOT NULL, version INT DEFAULT 1 NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
CREATE TABLE silas_wordRotator.Rating (id INT AUTO_INCREMENT NOT NULL, rating INT NOT NULL, version INT DEFAULT 1 NOT NULL, levelId INT DEFAULT NULL, authTokenId INT DEFAULT NULL, INDEX IDX_D1189E24D9801611 (levelId), INDEX IDX_D1189E24A1F3197E (authTokenId), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
CREATE TABLE silas_wordRotator.AuthToken (id INT AUTO_INCREMENT NOT NULL, token LONGTEXT NOT NULL, name LONGTEXT NOT NULL, creationDate DATETIME DEFAULT NULL, version INT DEFAULT 1 NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
ALTER TABLE silas_wordRotator.UserCode ADD CONSTRAINT FK_E2BA727E64B64DCC FOREIGN KEY (userId) REFERENCES silas_wordRotator.User (id);
ALTER TABLE silas_wordRotator.UserCode ADD CONSTRAINT FK_E2BA727EBF396750 FOREIGN KEY (id) REFERENCES silas_wordRotator.Code (id) ON DELETE CASCADE;
ALTER TABLE silas_wordRotator.ChangeEmailCode ADD CONSTRAINT FK_8FAE5EFBF396750 FOREIGN KEY (id) REFERENCES silas_wordRotator.Code (id) ON DELETE CASCADE;
ALTER TABLE silas_wordRotator.RegistrationCode ADD CONSTRAINT FK_96DE2014BF396750 FOREIGN KEY (id) REFERENCES silas_wordRotator.Code (id) ON DELETE CASCADE;
ALTER TABLE RoleUser ADD CONSTRAINT FK_2DDE86A9BF6EF8BE FOREIGN KEY (RoleId) REFERENCES silas_wordRotator.Role (id);
ALTER TABLE RoleUser ADD CONSTRAINT FK_2DDE86A9631A48FA FOREIGN KEY (UserId) REFERENCES silas_wordRotator.User (id);
ALTER TABLE RoleAccess ADD CONSTRAINT FK_337C2901BF6EF8BE FOREIGN KEY (RoleId) REFERENCES silas_wordRotator.Role (id);
ALTER TABLE RoleAccess ADD CONSTRAINT FK_337C2901A1A046DD FOREIGN KEY (AccessId) REFERENCES silas_wordRotator.Access (id);
ALTER TABLE RoleChildren ADD CONSTRAINT FK_88554C92E9982EB8 FOREIGN KEY (ParentId) REFERENCES silas_wordRotator.Role (id);
ALTER TABLE RoleChildren ADD CONSTRAINT FK_88554C92CD4052DB FOREIGN KEY (ChildId) REFERENCES silas_wordRotator.Role (id);
ALTER TABLE silas_wordRotator.UserSetting ADD CONSTRAINT FK_B63D87E164B64DCC FOREIGN KEY (userId) REFERENCES silas_wordRotator.User (id);
ALTER TABLE UserAccess ADD CONSTRAINT FK_26623A76631A48FA FOREIGN KEY (UserId) REFERENCES silas_wordRotator.User (id);
ALTER TABLE UserAccess ADD CONSTRAINT FK_26623A76A1A046DD FOREIGN KEY (AccessId) REFERENCES silas_wordRotator.Access (id);
ALTER TABLE silas_wordRotator.RequestNewPasswordCode ADD CONSTRAINT FK_27CF9C8BBF396750 FOREIGN KEY (id) REFERENCES silas_wordRotator.Code (id) ON DELETE CASCADE;
ALTER TABLE silas_wordRotator.Rating ADD CONSTRAINT FK_D1189E24D9801611 FOREIGN KEY (levelId) REFERENCES silas_wordRotator.Level (id);
ALTER TABLE silas_wordRotator.Rating ADD CONSTRAINT FK_D1189E24A1F3197E FOREIGN KEY (authTokenId) REFERENCES silas_wordRotator.AuthToken (id);
INSERT INTO Role (name, beschreibung) VALUES ('gast', 'Kein aktives oder eingeloggtes Mitglied');
INSERT INTO Role (name, beschreibung) VALUES ('user', 'Normales Mitglied');
INSERT INTO Role (name, beschreibung) VALUES ('admin', 'Admin, darf alles');
INSERT INTO Role (name, beschreibung) VALUES ('gast', 'Kein aktives oder eingeloggtes Mitglied'); -- 1
INSERT INTO Role (name, beschreibung) VALUES ('user', 'Normales Mitglied'); -- 2
INSERT INTO Role (name, beschreibung) VALUES ('admin', 'Admin, darf alles'); -- 3
INSERT INTO RoleChildren (ParentId, ChildId) VALUES (2, 3);
INSERT INTO Access (name, beschreibung) VALUES ('offline', 'alles, was ein nicht eingeloggter User sehen darf');
INSERT INTO Access (name, beschreibung) VALUES ('online', 'alles, was ein eingeloggter User sehen darf');
INSERT INTO RoleAccess(RoleId, AccessId) VALUES (2,2);
INSERT INTO Access (name, beschreibung) VALUES ('default', 'darf jeder');
INSERT INTO RoleAccess(RoleId, AccessId) VALUES (1,3);
INSERT INTO RoleAccess(RoleId, AccessId) VALUES (2,3);
INSERT INTO RoleAccess (RoleId, AccessId) VALUES (1,1);
INSERT INTO `Access` (`name`, `beschreibung`) VALUES ('admin', 'darf nur ein Admin');
INSERT INTO `RoleAccess` (`RoleId`, `AccessId`) VALUES (3, 4);
INSERT INTO Role (name, beschreibung) VALUES ('bookbinderAutor', 'Autor von Büchern in Bookbinder');
INSERT INTO `Access` (`id`, `name`, `beschreibung`) VALUES (NULL, 'bookbinderViewBooks', 'erlaubt das Ansehen der eigenen Bücher'), (NULL, 'bookbinderModifyBook', 'erlaubt das Erstellen und Verändern eigener Bücher'), (NULL, 'bookbinderDeleteBook', 'erlaubt das Löschen eigener Bücher'), (NULL, 'bookbinderBookoverwiev', 'erlaubt ein Buch anzusehen'), (NULL, 'bookbinderModifyChapter', 'erlaubt das Erstellen und Verändern eines Kapitels'), (NULL, 'bookbinderDeleteChapter', 'erlaubt das Löschen eines Kapitels'), (NULL, 'bookbinderChangeChapterPos', 'erlaubt das Verändern der Reihenfolge der Kapitel'), (NULL, 'bookbinderToPdf', 'erlaubt das Konvertieren zur PDF des Buches'), (NULL, 'bookbinderMakePublic', 'erlaubt das Veröffentlichen eines Buches');
INSERT INTO `RoleChildren` (`ParentId`, `ChildId`) VALUES ('4', '3');
INSERT INTO `RoleAccess` (`RoleId`, `AccessId`) VALUES (4, 5);
INSERT INTO `RoleAccess` (`RoleId`, `AccessId`) VALUES (4, 6);
INSERT INTO `RoleAccess` (`RoleId`, `AccessId`) VALUES (4, 7);
INSERT INTO `RoleAccess` (`RoleId`, `AccessId`) VALUES (4, 8);
INSERT INTO `RoleAccess` (`RoleId`, `AccessId`) VALUES (4, 9);
INSERT INTO `RoleAccess` (`RoleId`, `AccessId`) VALUES (4, 10);
INSERT INTO `RoleAccess` (`RoleId`, `AccessId`) VALUES (4, 11);
INSERT INTO `RoleAccess` (`RoleId`, `AccessId`) VALUES (4, 12);
INSERT INTO `RoleAccess` (`RoleId`, `AccessId`) VALUES (4, 13);
insert into `Access` set name='playStories', beschreibung='darf Stories spielen';
insert into `Role` set name='player', beschreibung='Story-player';
insert into `RoleAccess` set RoleId=5, AccessId=14;
-- ######################################################
insert into `Access` set name='editStory', beschreibung='darf stories bearbeiten';
insert into `Role` set name='storyAuthor', beschreibung='Story-Author';
insert into `RoleAccess` set RoleId=6, AccessId=15;
-- #######################Test-Data##################
insert into `Story` set name='firstStory', imgPath='img/test.png';
insert into `Chat` set storyId=1, imgPath='img/test.png', description='Familien-Chat', version=1, name='familie <3';
insert into `Author` set isUser=1, imgPath='img/test.png', description='It is a me, mario', name='Mario';
insert into `Author` set isUser=0, imgPath='img/test.png', description='Mein Bruder', name='Luigi';
insert into `Author` set isUser=0, imgPath='img/test.png', description='Meine Mutter', version=1, name='Mutter';
insert into `ChatAuthors` set authorId=1, chatId=1;
insert into `ChatAuthors` set authorId=2, chatId=1;
insert into `ChatAuthors` set authorId=3, chatId=1;
insert into `ConditionObject` set discriminator='sequence';
insert into `Sequence` set id=1, storyId=1;
update `Story` set `startSequenceId`='1' where `id`='1' limit 1;
insert into `Message` set sequenceId=1, atTime='-1', authorId=3, orderIndex=1, timeOffset=0, message='Kommt ihr zu ostern heim?', chatId=1;
insert into `Message` set sequenceId=1, atTime='-1', version=1, authorId=2, orderIndex=2, timeOffset=0, message='Nein', chatId=1;
insert into `Message` set sequenceId=1, atTime='-1', authorId=3, version=1, orderIndex=3, timeOffset=0, message='Schade, Anderer-Mario', id=3, chatId=1;
insert into `Message` set atTime='-1', authorId=1, version=1, orderIndex=4, timeOffset=0, message='Ja, Mama', chatId=1;
insert into `Message` set atTime='-1', authorId=1, version=1, orderIndex=4, timeOffset=0, message='Nein, ich kann nicht.', chatId=1;
insert into `ConditionObject` set discriminator='answer';
insert into `ConditionObject` set discriminator='answer';
insert into `Answer` set sequenceId=1, id=2, messageId=4;
insert into `Answer` set sequenceId=1, id=3, messageId=5;
insert into `ConditionObject` set discriminator='sequence';
insert into `ConditionObject` set discriminator='sequence';
insert into `Sequence` set id=4, storyId=1;
insert into `Sequence` set id=5, storyId=1;
insert into `Message` set sequenceId=4, atTime='-1', authorId=3, version=1, orderIndex=5, timeOffset=0, message='Ok...', chatId=1;
insert into `Message` set sequenceId=5, atTime='-1', authorId=3, version=1, orderIndex=5, timeOffset=0, message='Juhu!', id=8, chatId=1;
insert into `NextSequences` set SequenceId=5, AnswerId=2;
insert into `NextSequences` set SequenceId=4, AnswerId=3;
INSERT INTO Access (name, beschreibung) VALUES ('offline', 'alles, was ein nicht eingeloggter User sehen darf'); -- 1
INSERT INTO Access (name, beschreibung) VALUES ('online', 'alles, was ein eingeloggter User sehen darf'); -- 2
INSERT INTO Access (name, beschreibung) VALUES ('default', 'darf jeder'); -- 3
INSERT INTO `Access` (`name`, `beschreibung`) VALUES ('admin', 'darf nur ein Admin'); -- 4
INSERT INTO RoleAccess (RoleId, AccessId) VALUES (1,1); -- gast - offline
INSERT INTO RoleAccess(RoleId, AccessId) VALUES (1,3); -- gast - default
INSERT INTO RoleAccess(RoleId, AccessId) VALUES (2,2); -- user - online
INSERT INTO RoleAccess(RoleId, AccessId) VALUES (2,3); -- user - default
INSERT INTO `RoleAccess` (`RoleId`, `AccessId`) VALUES (3, 4); -- admin - admin

File diff suppressed because one or more lines are too long

View File

@ -3407,7 +3407,7 @@ class TriangleSegment extends RowSegment{
}
class ThreeWordsRowLevel extends Level {
class SixWordsRowLevel extends Level {
constructor(templateContainer, wordLength) {
super(templateContainer);
@ -3415,34 +3415,93 @@ class ThreeWordsRowLevel extends Level {
}
createSegments() {
if (this.words.length >= 3 && this.words[0].length >= this.wordLength && this.words[1].length >= this.wordLength && this.words[2].length >= this.wordLength) {
let leafsWordOne = Level._createLeafsForWord(this.words[0], this.templateContainer.copyLeafTemplate());
let leafsWordTwo = Level._createLeafsForWord(this.words[1], this.templateContainer.copyLeafTemplate());
let leafsWordThree = Level._createLeafsForWord(this.words[2], this.templateContainer.copyLeafTemplate());
if (this.words.length >= 6 &&
this.words[0].length >= this.wordLength &&
this.words[1].length >= this.wordLength &&
this.words[2].length >= this.wordLength &&
this.words[3].length >= this.wordLength &&
this.words[4].length >= this.wordLength &&
this.words[5].length >= this.wordLength
) {
let leafsWords = [];
leafsWords[0] = Level._createLeafsForWord(this.words[0], this.templateContainer.copyLeafTemplate());
leafsWords[1] = Level._createLeafsForWord(this.words[0], this.templateContainer.copyLeafTemplate());
leafsWords[2] = Level._createLeafsForWord(this.words[0], this.templateContainer.copyLeafTemplate());
leafsWords[3] = Level._createLeafsForWord(this.words[0], this.templateContainer.copyLeafTemplate());
leafsWords[4] = Level._createLeafsForWord(this.words[0], this.templateContainer.copyLeafTemplate());
leafsWords[5] = Level._createLeafsForWord(this.words[0], this.templateContainer.copyLeafTemplate());
let rootSegment = new RowSegment(this.templateContainer.copyRowTemplate());
for (let i = 0, n = this.wordLength / 2; i < n; i++) {
for (let i = 0, n = this.wordLength / 4; i < n; i++) {
let parents = [];
parents[0] = new ParentSegment(this.templateContainer.copyParentTemplate());
parents[1] = new ParentSegment(this.templateContainer.copyParentTemplate());
parents[2] = new ParentSegment(this.templateContainer.copyParentTemplate());
parents[3] = new ParentSegment(this.templateContainer.copyParentTemplate());
parents[4] = new ParentSegment(this.templateContainer.copyParentTemplate());
parents[5] = new ParentSegment(this.templateContainer.copyParentTemplate());
parents[0].addChild(leafsWords[0][4*i]);
parents[0].addChild(leafsWords[0][4*i+1]);
parents[0].addChild(leafsWords[1][4*i]);
parents[0].addChild(leafsWords[1][4*i+1]);
parents[1].addChild(leafsWords[0][4*i+2]);
parents[1].addChild(leafsWords[0][4*i+3]);
parents[1].addChild(leafsWords[1][4*i+2]);
parents[1].addChild(leafsWords[1][4*i+3]);
parents[2].addChild(leafsWords[2][4*i]);
parents[2].addChild(leafsWords[2][4*i+1]);
parents[2].addChild(leafsWords[3][4*i]);
parents[2].addChild(leafsWords[3][4*i+1]);
parents[3].addChild(leafsWords[2][4*i+2]);
parents[3].addChild(leafsWords[2][4*i+3]);
parents[3].addChild(leafsWords[3][4*i+2]);
parents[3].addChild(leafsWords[3][4*i+3]);
parents[4].addChild(leafsWords[4][4*i]);
parents[4].addChild(leafsWords[4][4*i+1]);
parents[4].addChild(leafsWords[5][4*i]);
parents[4].addChild(leafsWords[5][4*i+1]);
parents[5].addChild(leafsWords[4][4*i+2]);
parents[5].addChild(leafsWords[4][4*i+3]);
parents[5].addChild(leafsWords[5][4*i+2]);
parents[5].addChild(leafsWords[5][4*i+3]);
let parent = new ParentSegment(this.templateContainer.copyParentTemplate());
let triangle = new TriangleSegment(this.templateContainer.copyTriangleTemplate());
if (i % 2 === 0) {
parent.addChild(leafsWordOne[2 * i]);
parent.addChild(leafsWordOne[2 * i + 1]);
parent.addChild(leafsWordTwo[2 * i]);
parent.addChild(leafsWordTwo[2 * i + 1]);
parent.addChild(parents[0]);
parent.addChild(parents[1]);
parent.addChild(parents[2]);
parent.addChild(parents[3]);
let rowSegment = new RowSegment(this.templateContainer.copyRowTemplate());
rowSegment.addChild(parents[4]);
rowSegment.addChild(parents[5]);
triangle.addChild(parent);
triangle.addChild(leafsWordThree[2 * i]);
triangle.addChild(leafsWordThree[2 * i + 1]);
triangle.addChild(rowSegment);
triangle.getElement().classList.add("type-1");
}
else {
parent.addChild(leafsWordTwo[2 * i]);
parent.addChild(leafsWordTwo[2 * i + 1]);
parent.addChild(leafsWordThree[2 * i]);
parent.addChild(leafsWordThree[2 * i + 1]);
triangle.addChild(leafsWordOne[2 * i]);
triangle.addChild(leafsWordOne[2 * i + 1]);
triangle.addChild(parents[0]);
triangle.addChild(parents[1]);
triangle.addChild(parent);
parent.addChild(parents[2]);
parent.addChild(parents[3]);
parent.addChild(parents[4]);
parent.addChild(parents[5]);
triangle.getElement().classList.add("type-2");
}
rootSegment.addChild(triangle);
}
@ -3451,7 +3510,7 @@ class ThreeWordsRowLevel extends Level {
}
}
class ThreeWordsRowLevel8 extends ThreeWordsRowLevel {
class ThreeWordsRowLevel8 extends SixWordsRowLevel {
constructor(templateContainer) {
super(templateContainer, 8);
}
@ -3630,8 +3689,8 @@ class LevelSite extends AbstractSite$1 {
this._siteContent.classList.remove('won');
const db = WordRotatorDb.getInstance();
// const nextLevelJson = await db.loadNextLevel([20,40,60]);
const nextLevelJson = await db.loadNextLevel([100]);
const nextLevelJson = await db.loadNextLevel([20,40,60]);
// const nextLevelJson = await db.loadNextLevel([100]);
if (nextLevelJson === null) {
this.startSite(EndSite);
return;

View File

@ -69,8 +69,8 @@ export class LevelSite extends AbstractSite {
this._siteContent.classList.remove('won');
const db = WordRotatorDb.getInstance();
// const nextLevelJson = await db.loadNextLevel([20,40,60]);
const nextLevelJson = await db.loadNextLevel([100]);
const nextLevelJson = await db.loadNextLevel([20,40,60]);
// const nextLevelJson = await db.loadNextLevel([100]);
if (nextLevelJson === null) {
this.startSite(EndSite);
return;

View File

@ -27,31 +27,77 @@ export class SixWordsRowLevel extends Level {
leafsWords[4] = Level._createLeafsForWord(this.words[0], this.templateContainer.copyLeafTemplate());
leafsWords[5] = Level._createLeafsForWord(this.words[0], this.templateContainer.copyLeafTemplate());
let leafes = [];
let rootSegment = new RowSegment(this.templateContainer.copyRowTemplate());
for (let i = 0, n = this.wordLength / 2; i < n; i++) {
for (let i = 0, n = this.wordLength / 4; i < n; i++) {
let parents = [];
parents[0] = new ParentSegment(this.templateContainer.copyParentTemplate());
parents[1] = new ParentSegment(this.templateContainer.copyParentTemplate());
parents[2] = new ParentSegment(this.templateContainer.copyParentTemplate());
parents[3] = new ParentSegment(this.templateContainer.copyParentTemplate());
parents[4] = new ParentSegment(this.templateContainer.copyParentTemplate());
parents[5] = new ParentSegment(this.templateContainer.copyParentTemplate());
parents[0].addChild(leafsWords[0][4*i]);
parents[0].addChild(leafsWords[0][4*i+1]);
parents[0].addChild(leafsWords[1][4*i]);
parents[0].addChild(leafsWords[1][4*i+1]);
parents[1].addChild(leafsWords[0][4*i+2]);
parents[1].addChild(leafsWords[0][4*i+3]);
parents[1].addChild(leafsWords[1][4*i+2]);
parents[1].addChild(leafsWords[1][4*i+3]);
parents[2].addChild(leafsWords[2][4*i]);
parents[2].addChild(leafsWords[2][4*i+1]);
parents[2].addChild(leafsWords[3][4*i]);
parents[2].addChild(leafsWords[3][4*i+1]);
parents[3].addChild(leafsWords[2][4*i+2]);
parents[3].addChild(leafsWords[2][4*i+3]);
parents[3].addChild(leafsWords[3][4*i+2]);
parents[3].addChild(leafsWords[3][4*i+3]);
parents[4].addChild(leafsWords[4][4*i]);
parents[4].addChild(leafsWords[4][4*i+1]);
parents[4].addChild(leafsWords[5][4*i]);
parents[4].addChild(leafsWords[5][4*i+1]);
parents[5].addChild(leafsWords[4][4*i+2]);
parents[5].addChild(leafsWords[4][4*i+3]);
parents[5].addChild(leafsWords[5][4*i+2]);
parents[5].addChild(leafsWords[5][4*i+3]);
let parent = new ParentSegment(this.templateContainer.copyParentTemplate());
let triangle = new TriangleSegment(this.templateContainer.copyTriangleTemplate());
if (i % 2 === 0) {
parent.addChild(leafsWordOne[2 * i]);
parent.addChild(leafsWordOne[2 * i + 1]);
parent.addChild(leafsWordTwo[2 * i]);
parent.addChild(leafsWordTwo[2 * i + 1]);
parent.addChild(parents[0]);
parent.addChild(parents[1]);
parent.addChild(parents[2]);
parent.addChild(parents[3]);
let rowSegment = new RowSegment(this.templateContainer.copyRowTemplate());
rowSegment.addChild(parents[4]);
rowSegment.addChild(parents[5]);
triangle.addChild(parent);
triangle.addChild(leafsWordThree[2 * i]);
triangle.addChild(leafsWordThree[2 * i + 1]);
triangle.addChild(rowSegment);
triangle.getElement().classList.add("type-1");
}
else {
parent.addChild(leafsWordTwo[2 * i]);
parent.addChild(leafsWordTwo[2 * i + 1]);
parent.addChild(leafsWordThree[2 * i]);
parent.addChild(leafsWordThree[2 * i + 1]);
triangle.addChild(leafsWordOne[2 * i]);
triangle.addChild(leafsWordOne[2 * i + 1]);
triangle.addChild(parents[0]);
triangle.addChild(parents[1]);
triangle.addChild(parent);
parent.addChild(parents[2]);
parent.addChild(parents[3]);
parent.addChild(parents[4]);
parent.addChild(parents[5]);
triangle.getElement().classList.add("type-2");
}
rootSegment.addChild(triangle);
}

View File

@ -100,9 +100,32 @@ $rotationDegrees: (90 180 270 360);
&.segment-parent {
border: solid 1px #a9a9a9;
border-radius: 3px;
.segment {
width: 50%;
> .child-container{
> .segment {
width: 50%;
}
}
.segment {
//width: 50%;
//height: 50%;
}
}
&.segment-triangle {
//display: inline-block;
//width: 100%;
//animation: none !important;
//&.type-1 {
// > .child-container {
// > .segment-parent:first-child {
// //width: 100%;
// }
// > .segment-parent:not(:first-child) {
// //width: 50%;
// }
// }
//}
}
}