Browse Source

Refactor and added todo.

master
Nero Ignis 5 years ago
parent
commit
c43cd5bf31
  1. 37
      .idea/workspace.xml
  2. 5
      app.js

37
.idea/workspace.xml

@ -5,7 +5,6 @@ @@ -5,7 +5,6 @@
</component>
<component name="ChangeListManager">
<list default="true" id="e3f098f0-e98c-435a-af04-d153c9525633" name="Default Changelist" comment="">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app.js" beforeDir="false" afterPath="$PROJECT_DIR$/app.js" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
@ -46,6 +45,7 @@ @@ -46,6 +45,7 @@
<workItem from="1597346228730" duration="1851000" />
<workItem from="1597348092890" duration="8205000" />
<workItem from="1597530844649" duration="131000" />
<workItem from="1597577497243" duration="188000" />
</task>
<task id="LOCAL-00001" summary="Adds gitignore.">
<created>1597348071361</created>
@ -208,7 +208,21 @@ @@ -208,7 +208,21 @@
<option name="project" value="LOCAL" />
<updated>1597356192344</updated>
</task>
<option name="localTasksCounter" value="24" />
<task id="LOCAL-00024" summary="Remove DB method call.">
<created>1597577517699</created>
<option name="number" value="00024" />
<option name="presentableId" value="LOCAL-00024" />
<option name="project" value="LOCAL" />
<updated>1597577517699</updated>
</task>
<task id="LOCAL-00025" summary="Remove DB method call.">
<created>1597577559042</created>
<option name="number" value="00025" />
<option name="presentableId" value="LOCAL-00025" />
<option name="project" value="LOCAL" />
<updated>1597577559042</updated>
</task>
<option name="localTasksCounter" value="26" />
<servers />
</component>
<component name="TypeScriptGeneratedFilesManager">
@ -225,37 +239,38 @@ @@ -225,37 +239,38 @@
<MESSAGE value="Fix not completely visible messages in mobile view with open keyboard." />
<MESSAGE value="Testing database access." />
<MESSAGE value="Test commit." />
<option name="LAST_COMMIT_MESSAGE" value="Test commit." />
<MESSAGE value="Remove DB method call." />
<option name="LAST_COMMIT_MESSAGE" value="Remove DB method call." />
</component>
<component name="WindowStateProjectService">
<state x="278" y="2" width="800" height="718" key="#Plugins" timestamp="1597350105557">
<screen x="0" y="0" width="1366" height="720" />
</state>
<state x="278" y="2" width="800" height="718" key="#Plugins/0.0.1366.720@0.0.1366.720" timestamp="1597350105557" />
<state x="222" y="0" width="912" height="720" key="CommitChangelistDialog2" timestamp="1597356192305">
<state x="222" y="0" width="912" height="720" key="CommitChangelistDialog2" timestamp="1597577558978">
<screen x="0" y="0" width="1366" height="720" />
</state>
<state x="222" y="0" width="912" height="720" key="CommitChangelistDialog2/0.0.1366.720@0.0.1366.720" timestamp="1597356192305" />
<state x="222" y="0" width="912" height="720" key="CommitChangelistDialog2/0.0.1366.720@0.0.1366.720" timestamp="1597577558978" />
<state x="466" y="118" width="424" height="490" key="FileChooserDialogImpl" timestamp="1597353496276">
<screen x="0" y="0" width="1366" height="720" />
</state>
<state x="466" y="118" width="424" height="490" key="FileChooserDialogImpl/0.0.1366.720@0.0.1366.720" timestamp="1597353496276" />
<state x="127" y="60" width="1092" height="612" key="MergeDialog" timestamp="1597354753021">
<state x="127" y="60" width="1092" height="612" key="MergeDialog" timestamp="1597577611599">
<screen x="0" y="0" width="1366" height="720" />
</state>
<state x="127" y="60" width="1092" height="612" key="MergeDialog/0.0.1366.720@0.0.1366.720" timestamp="1597354753021" />
<state x="315" y="115" width="726" height="496" key="MultipleFileMergeDialog" timestamp="1597354753023">
<state x="127" y="60" width="1092" height="612" key="MergeDialog/0.0.1366.720@0.0.1366.720" timestamp="1597577611599" />
<state x="315" y="115" width="726" height="496" key="MultipleFileMergeDialog" timestamp="1597577611601">
<screen x="0" y="0" width="1366" height="720" />
</state>
<state x="315" y="115" width="726" height="496" key="MultipleFileMergeDialog/0.0.1366.720@0.0.1366.720" timestamp="1597354753023" />
<state x="315" y="115" width="726" height="496" key="MultipleFileMergeDialog/0.0.1366.720@0.0.1366.720" timestamp="1597577611601" />
<state x="172" y="0" key="SettingsEditor" timestamp="1597530949459">
<screen x="0" y="0" width="1366" height="720" />
</state>
<state x="172" y="0" key="SettingsEditor/0.0.1366.720@0.0.1366.720" timestamp="1597530949459" />
<state x="278" y="92" width="800" height="542" key="Vcs.Push.Dialog.v2" timestamp="1597356194181">
<state x="278" y="92" width="800" height="542" key="Vcs.Push.Dialog.v2" timestamp="1597577614375">
<screen x="0" y="0" width="1366" height="720" />
</state>
<state x="278" y="92" width="800" height="542" key="Vcs.Push.Dialog.v2/0.0.1366.720@0.0.1366.720" timestamp="1597356194181" />
<state x="278" y="92" width="800" height="542" key="Vcs.Push.Dialog.v2/0.0.1366.720@0.0.1366.720" timestamp="1597577614375" />
<state x="0" y="0" width="616" height="720" key="find.popup" timestamp="1597346688624">
<screen x="0" y="0" width="1366" height="720" />
</state>

5
app.js

@ -92,7 +92,7 @@ let kara = new Vue({ @@ -92,7 +92,7 @@ let kara = new Vue({
return includesAllPhrases;
},
clearMessage(message) {
cleanupMessage(message) {
return message.replace('?', '')
.replace('!', '')
.replace('.', '')
@ -119,9 +119,10 @@ let kara = new Vue({ @@ -119,9 +119,10 @@ let kara = new Vue({
},
getAnswer(message) {
message = message.toLowerCase();
message = this.clearMessage(message);
message = this.cleanupMessage(message);
let phrases = message.split(' ');
// TODO: get options from json
if (
this.includesOneOf(phrases,['hi', 'hallo', 'servas', 'servas', 'servus', 'hello'])
) {

Loading…
Cancel
Save