Skip to content

Commit

Permalink
アップデートチェック機能を追加・バグの修正・Google検索機能の呼び出しワードを追加・デザインの軽微な変更
Browse files Browse the repository at this point in the history
  • Loading branch information
Robot-Inventor committed Jan 22, 2020
1 parent 19c971b commit 669067f
Show file tree
Hide file tree
Showing 11 changed files with 178 additions and 20 deletions.
16 changes: 15 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,30 @@ The meaning of the words are shown below:
#### Changed
- Behavior became a little faster than before by optimizing variable types.

### [v0.3.4.0dev-Albatross] - 2020-01-23
#### Added
- Added Auto Update Checker with a push notification, and Manual Update Checker. Because of this, oss_license.html was modified.

#### Changed
- Changed the background color of selected text.
- Google Search Function is more useful now.

#### Fixed
- Fixed the issue that default web browser was not used in Google Search Function.
- Fixed the issue that app bar was shown in splash screen.

### [v0.2.3.0dev-Albatross] - 2020-01-22
#### Added
- 3 responses were added to the dictionary, so there are 261 responses in total.
- Added Google Search Function. If you ask questions to ORIZIN Agent, it'll open the default web browser and search the questions.

#### Changed
- Fixed some dictionary format error.
- Changed privacy_policy.txt for Google Search Function.
- The UI design was made similar to the Material Design.

#### Fixed
- Fixed some dictionary format error.

### [v0.1.2.0dev-Albatross] - 2020-01-21
#### Added
- 108 responses were added to the dictionary, so there are 258 responses in total.
Expand Down
17 changes: 14 additions & 3 deletions orizin_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import re
import subprocess
import webbrowser
import urllib.request
import sys

@eel.expose
Expand Down Expand Up @@ -93,12 +94,22 @@ def make_response(not_adjusted_question):
elif judge(question, ["イースターエッグ", "ゲーム", "宇宙船", "宇宙戦艦", "spacebattleship", "game", "easteregg"]):
subprocess.Popen(["python", "resource/python/easter_egg.py"])
return "イースターエッグを起動します。"
elif judge(question, ["て何" ,"てなに", "意味", "とは", "教え", "おしえ"]):
url = "google.com/search?q=" + question
webbrowser.open(url)
elif judge(question, ["て何" ,"てなに", "意味", "とは", "教え", "おしえ", "検索", "けんさく"]):
webbrowser.open_new("https://google.com/search?q=" + question)
return question + "を検索します。"
else:
return search_response(question)

@eel.expose
def check_update():
info_file = urllib.request.urlopen("https://raw.githubusercontent.com/Robot-Inventor/ORIZIN-Agent-HTML-Based/master/resource/information.txt").read().decode()
f = open("resource/information.txt")
local_info_file = f.read()
f.close()
if info_file != local_info_file:
return True
else:
return False


load_dictionary()
Expand Down
30 changes: 29 additions & 1 deletion resource/css/layout.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,25 @@
font-display: swap;
}

* {
overflow: scroll;
-ms-overflow-style: none;
scrollbar-width: none;
}

*::-webkit-scrollbar {
display:none;
}

*::selection {
background: var(--theme_color);
color: var(--text_color);
}

*:focus {
outline: none;
}

html, body {
font-family: "League Spartan", "Yu Gothic UI", sans-selif;
position: relative;
Expand Down Expand Up @@ -33,7 +52,7 @@ main {
}

.title {
width: 100vw;
max-width: 100vw;
height: 6vh;
margin: 0;
padding: 2vh;
Expand All @@ -47,6 +66,10 @@ main {
color: white;
}

.title img {
vertical-align: top;
}

header h1 {
color: white;
display: inline:
Expand Down Expand Up @@ -232,3 +255,8 @@ a {
.pre {
white-space: pre-wrap;
}

img {
max-width: 100%;
max-height: 100%;
}
1 change: 1 addition & 0 deletions resource/dictionary/unknownQuestions.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@

明日の気温は何度
8 changes: 4 additions & 4 deletions resource/html/basic.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="title">
<img src="../image/menu_icon.svg" class="menu_open_button"><h1 style="display: inline;"><a href="index.html"><img src="../image/title.svg" alt="ORIZIN Agent" style="height: 5vh;"></a></h1>
<img src="../image/menu_icon.svg" class="menu_open_button"><h1 style="display: inline;"><a href="index.html"><img src="../image/title.svg" alt="ORIZIN Agent"></a></h1>
</div>
<div class="side_menu_bar_overlay">
</div>
Expand All @@ -24,7 +24,7 @@
jQuery(".side_menu_bar").animate({
left: "0vw"
}, page_change_time);
}
}
function close_menu() {
jQuery(".side_menu_bar_overlay").fadeOut(page_change_time);
jQuery(".side_menu_bar").animate({
Expand All @@ -49,7 +49,7 @@
});
jQuery(".setting_button").click(function() {
move_page("setting.html");
});
});
jQuery(".oss_license").click(function() {
move_page("oss_license.html");
});
Expand All @@ -60,4 +60,4 @@
move_page("about_oa.html");
});
});
</script>
</script>
29 changes: 27 additions & 2 deletions resource/html/oss_license.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@
<header>
</header>
<main>
<div class="fill_panel" style="overflow: scroll;">
<div class="fill_panel">
<h2>オープンソースソフトウェアライセンス</h2>
本ソフトウェア(ORIZIN Agent)では,以下のオープンソースソフトウェア(OSS)を使用しています。
<ul>
<li>jQuery v3.4.1</li>
<li>League Spartan</li>
<li>Push</li>
</ul>
以下に,上記OSSのライセンスを示します。
<div>
Expand Down Expand Up @@ -155,7 +156,31 @@ <h3>League Spartan</h3>
OTHER DEALINGS IN THE FONT SOFTWARE.
</pre>
</div>
</div>
<hr>
<h3>Push</h3>
<pre>
# The MIT License (MIT)

Copyright (c) 2016 Tyler Nickerson

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
</pre>
</main>
<script src="../javascript/jquery-3.4.1.min.js"></script>
<script src="../javascript/basic.js"></script>
Expand Down
28 changes: 26 additions & 2 deletions resource/html/setting.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,41 @@ <h2>設定</h2>
<option value="dark">ダークテーマ</option>
</select>
<br>
アップデートを確認 <button onclick="check_update()">実行</button>
<br>
<button onclick="save_setting()">適用</button>
</div>
</main>
<script src="../javascript/jquery-3.4.1.min.js"></script>
<script src="../javascript/basic.js"></script>
<script src="../javascript/push.min.js"></script>
<script src="/eel.js"></script>
<script>
function save_setting() {
eel.change_theme(document.getElementById("theme").value);
location.reload();
};
}
async function check_update() {
result = await eel.check_update()();
if (result == true) {
Push.create("ORIZIN Agent", {
body: "アップデートがあります。最新バージョンが利用可能です。",
icon: "../image/favicon.ico",
onClick: function() {
window.open("https://github.com/Robot-Inventor/ORIZIN-Agent-HTML-Based", "newwindow");
this.close();
}
});
} else {
Push.create("ORIZIN Agent", {
body: "アップデートはありません。既に最新のバージョンです。",
icon: "../image/favicon.ico",
onClick: function() {
this.close();
}
});
}
}
</script>
</body>
</html>
</html>
17 changes: 15 additions & 2 deletions resource/html/splash.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
<meta name="description" content="オープンソースのAIアシスタント「ORIZIN_Agent」です。">
</head>
<body>
<header>
</header>
<main>
<div style="position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: var(--bg3); color: gray; text-align: center;">
<div class="loading_div">
Expand Down Expand Up @@ -87,8 +85,23 @@ <h2>Now Loading... Pleas waite.</h2><br>
</style>
<script src="../javascript/jquery-3.4.1.min.js"></script>
<script src="../javascript/basic.js"></script>
<script src="../javascript/push.min.js"></script>
<script src="/eel.js"></script>
<script>
async function check_update() {
result = await eel.check_update()();
if (result == true) {
Push.create("ORIZIN Agent", {
body: "アップデートがあります。最新バージョンが利用可能です。",
icon: "../image/favicon.ico",
onClick: function() {
window.open("https://github.com/Robot-Inventor/ORIZIN-Agent-HTML-Based", "newwindow");
this.close();
}
});
}
}
check_update();
jQuery(window).on("load", function () {
if ("speechSynthesis" in window) {
} else {
Expand Down
9 changes: 6 additions & 3 deletions resource/html/toggle_test.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
<input id="cmn-toggle-1" class="cmn-toggle cmn-toggle-round" type="checkbox">
<label for="cmn-toggle-1"></label>
</div>

<div class="switch">
<input id="cmn-toggle-4" class="cmn-toggle cmn-toggle-round-flat" type="checkbox">
<label for="cmn-toggle-4"></label>
</div>

<div class="switch">
<input id="cmn-toggle-7" class="cmn-toggle cmn-toggle-yes-no" type="checkbox">
<label for="cmn-toggle-7" data-on="Yes" data-off="No"></label>
Expand All @@ -19,6 +19,9 @@
--background_status_off: #f1f1f1;
--background_status_on: black;
}
*:focus {
outline: none;
}
.switch {
width: var(--toggle_width);
height: var(--toggle_height);
Expand Down Expand Up @@ -69,4 +72,4 @@
input.cmn-toggle-round:checked + label:after {
margin-left: calc(var(--toggle_width) - var(--toggle_height));
}
</style>
</style>
4 changes: 2 additions & 2 deletions resource/information.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Series Name : ORIZIN Agent
Edition : ORIZIN Agent HTML Based
Version : v0.2.3.0dev
Version : v0.3.4.0dev
Code Name : Albatross
Date : 2020-01-22 JST
Date : 2020-01-23 JST
Loading

0 comments on commit 669067f

Please sign in to comment.