diff --git a/build.py b/build.py index 302d012..e5fbf36 100644 --- a/build.py +++ b/build.py @@ -8,6 +8,10 @@ import os import distutils.dir_util +VERSION_SHORT = "BETA v.9" +VERSION_FULL = VERSION_SHORT + ", released 19 Sep 2018" + + EXEC_UGLIFYJS_WIN = "{2}/lib/uglifyjs.cmd --parse bare_returns --compress --mangle toplevel --mangle-props keep_quoted,reserved=[{3}] --output \"{1}\" \"{0}\"" EXEC_UGLIFYJS_AUTO = "uglifyjs --parse bare_returns --compress --mangle toplevel --mangle-props keep_quoted,reserved=[{3}] --output \"{1}\" \"{0}\"" EXEC_YUI = "java -jar lib/yuicompressor-2.4.8.jar --charset utf-8 --line-break 160 --type css -o \"{1}\" \"{0}\"" @@ -42,7 +46,7 @@ with open("reserve.txt", "r") as reserved: def combine_files(input_pattern, output_file): with fileinput.input(sorted(glob.glob(input_pattern))) as stream: for line in stream: - output_file.write(line) + output_file.write(line.replace("{{{version:full}}}", VERSION_FULL)) def build_tracker_html(): @@ -88,7 +92,7 @@ def build_tracker_userscript(): userscript_base = "src/base/track.user.js" with open(userscript_base, "r") as base: - userscript_contents = base.read().split("{{{contents}}}") + userscript_contents = base.read().replace("{{{version}}}", VERSION_SHORT).split("{{{contents}}}") with open(output_file, "w") as out: out.write(userscript_contents[0]) @@ -156,6 +160,13 @@ def build_website(): web_style_file = "bld/web/style.css" distutils.dir_util.copy_tree("web", "bld/web") + index_file = "bld/web/index.php" + + with open(index_file, "r") as index: + index_contents = index.read() + + with open(index_file, "w") as index: + index.write(index_contents.replace("{{{version:web}}}", VERSION_SHORT.replace(" ", " "))) os.makedirs("bld/web/build", exist_ok = True) shutil.copyfile(tracker_file_html, "bld/web/build/track.html") diff --git a/src/base/track.user.js b/src/base/track.user.js index 47e0f5a..03ea79b 100644 --- a/src/base/track.user.js +++ b/src/base/track.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name Discord History Tracker -// @version BETA v.9 +// @version {{{version}}} // @license MIT // @namespace https://chylex.com // @homepageURL https://dht.chylex.com/ diff --git a/src/renderer/scr.gui.js b/src/renderer/scr.gui.js index 1cf9f4e..6250045 100644 --- a/src/renderer/scr.gui.js +++ b/src/renderer/scr.gui.js @@ -51,7 +51,7 @@ var GUI = (function(){ showModal(560, `

Discord History Tracker is developed by chylex as an open source project.

-BETA v.9, released 19 Sep 2018 +{{{version:full}}}

Please, report any issues and suggestions to the tracker. If you want to support the development, please spread the word and consider becoming a patron. Any support is appreciated!

Issue Tracker  —  GitHub Repository  —  Developer's Twitter

`); }; diff --git a/src/tracker/gui.js b/src/tracker/gui.js index 52511fd..b0c6062 100644 --- a/src/tracker/gui.js +++ b/src/tracker/gui.js @@ -223,7 +223,7 @@ ${radio("asm", "pause", "Pause Tracking")} ${radio("asm", "switch", "Switch to Next Channel")}

It is recommended to disable link and image previews to avoid putting unnecessary strain on your browser.

-BETA v.9, released 19 Sep 2018 +{{{version:full}}}

`); // elements diff --git a/web/index.php b/web/index.php index a75c5f2..02bd24a 100644 --- a/web/index.php +++ b/web/index.php @@ -13,7 +13,7 @@
-

Discord History Tracker BETA v.9 | Release Notes

+

Discord History Tracker {{{version:web}}} | Release Notes

Discord History Tracker is a browser script that lets you locally save chat history in your servers, groups, and private conversations.

When the script is active, it will load history of the selected text channel up to the first message, and let you download it for offline viewing in your browser.