Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ node_modules
/data/vox/*/
/data/vox/Backups.lnk
/data/vox/batch.sh
/data/vox/noise.profile
/data/vox/noise.profile
/.switchboard/
4 changes: 2 additions & 2 deletions ABOUT.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ Obviously, I am not a lawyer, but I hope this text makes it clear enough that th
a hobby of mine, with zero commercial intent. Please enjoy, and thanks!

[0]: https://roycurtis.com
[1]: https://github.com/RoyCurtis/RAG/blob/master/LICENSE.md
[2]: https://github.com/RoyCurtis/RAG
[1]: https://github.com/zzz-creator/RAG/blob/master/LICENSE.md
[2]: https://github.com/zzz-creator/RAG
[3]: https://www.typescriptlang.org/
[4]: http://stylus-lang.com/
[5]: https://www.jetbrains.com/webstorm/
Expand Down
127 changes: 74 additions & 53 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
<!DOCTYPE html>
<!-- Roy Curtis 2018, MIT license -->
<html lang="en">

<head>
<meta content="text/html;charset=utf-8" http-equiv="Content-Type">
<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>Rail Announcement Generator</title>

<link href="css/index.css" rel="stylesheet" type="text/css"/>
<link href="css/index.css" rel="stylesheet" type="text/css" />
<!-- TODO: Offline cache manifest -->
<!-- TODO: https://introjs.com/ ? -->
<!-- TODO: A11y -->
Expand Down Expand Up @@ -40,27 +41,39 @@
<!-- Toolbar of RAG operations -->
<menu id="toolbar">
<button tabindex="1" id="btnPlay" title="%TOOLBAR_PLAY%">
<svg><use xlink:href="css/icons/icoMoon.svg#icon-play"></use></svg>
<svg>
<use xlink:href="css/icons/icoMoon.svg#icon-play"></use>
</svg>
</button>

<button tabindex="1" id="btnStop" hidden title="%TOOLBAR_STOP%">
<svg><use xlink:href="css/icons/icoMoon.svg#icon-stop"></use></svg>
<svg>
<use xlink:href="css/icons/icoMoon.svg#icon-stop"></use>
</svg>
</button>

<button tabindex="1" id="btnShuffle" title="%TOOLBAR_SHUFFLE%">
<svg><use xlink:href="css/icons/icoMoon.svg#icon-shuffle"></use></svg>
<svg>
<use xlink:href="css/icons/icoMoon.svg#icon-shuffle"></use>
</svg>
</button>

<button tabindex="1" id="btnSave" title="%TOOLBAR_SAVE%">
<svg><use xlink:href="css/icons/icoMoon.svg#icon-save"></use></svg>
<svg>
<use xlink:href="css/icons/icoMoon.svg#icon-save"></use>
</svg>
</button>

<button tabindex="1" id="btnLoad" title="%TOOLBAR_LOAD%">
<svg><use xlink:href="css/icons/icoMoon.svg#icon-recall"></use></svg>
<svg>
<use xlink:href="css/icons/icoMoon.svg#icon-recall"></use>
</svg>
</button>

<button tabindex="1" id="btnSettings" title="%TOOLBAR_SETTINGS%">
<svg><use xlink:href="css/icons/icoMoon.svg#icon-settings"></use></svg>
<svg>
<use xlink:href="css/icons/icoMoon.svg#icon-settings"></use>
</svg>
</button>
</menu>

Expand All @@ -76,7 +89,7 @@
// Eventually, the editor will re-apply this message with localization
document.body.classList.add('javascriptEnabled');
document.querySelector('#marquee').innerText = 'Please wait...';
document.querySelector('#editor').innerText = 'Please wait...';
document.querySelector('#editor').innerText = 'Please wait...';
</script>
</div>

Expand All @@ -97,7 +110,7 @@ <h1>%ST_SPEECH%</h1>
<form id="frmSpeech">
<!-- TODO: Localize -->
<label for="chkUseVox">Use VOX</label>
<input tabindex="2" type="checkbox" id="chkUseVox"/>
<input tabindex="2" type="checkbox" id="chkUseVox" />

<!-- TODO: Hyperlink to list of voices -->
<p id="hintUseVox">
Expand All @@ -108,7 +121,7 @@ <h1>%ST_SPEECH%</h1>
<label hidden for="selVoxVoice">Voice</label>
<select hidden tabindex="2" id="selVoxVoice">
<option value="">Custom</option>
<option value="https://roycurtis.github.io/RAG-VOX-Roy">GitHub - Roy</option>
<option value="https://zzz-creator.github.io/RAG-VOX-Roy">GitHub - Roy</option>
<option value="data/vox/Roy">Local - Roy</option>
</select>

Expand All @@ -130,16 +143,13 @@ <h1>%ST_SPEECH%</h1>
</select>

<label for="rangeSpeechVol">%ST_SPEECH_VOL%</label>
<input tabindex="2" id="rangeSpeechVol" type="range"
min="0.1" max="1.9" value="1" step="0.1"/>
<input tabindex="2" id="rangeSpeechVol" type="range" min="0.1" max="1.9" value="1" step="0.1" />

<label for="rangeSpeechPitch">%ST_SPEECH_PITCH%</label>
<input tabindex="2" id="rangeSpeechPitch" type="range"
min="0.1" max="1.9" value="1" step="0.1"/>
<input tabindex="2" id="rangeSpeechPitch" type="range" min="0.1" max="1.9" value="1" step="0.1" />

<label for="rangeSpeechRate">%ST_SPEECH_RATE%</label>
<input tabindex="2" id="rangeSpeechRate" type="range"
min="0.1" max="1.9" value="1" step="0.1"/>
<input tabindex="2" id="rangeSpeechRate" type="range" min="0.1" max="1.9" value="1" step="0.1" />

<button tabindex="2" id="btnSpeechTest" title="%ST_SPEECH_TEST_T%">
%ST_SPEECH_TEST%
Expand All @@ -156,8 +166,8 @@ <h1>%ST_LEGAL%</h1>
<div id="disclaimerScreen" class="warningScreen" role="alertdialog" hidden>
<p id="disclaimerDescription">
This project is not endorsed by National Rail, nor the British Transport Police, nor
any of the mentioned rail networks, towns, communities, or companies.<br/>
<br/>
any of the mentioned rail networks, towns, communities, or companies.<br />
<br />
Rail Announcement Generator is not meant as a replacement for, or alternative to,
official announcement systems. None of the generated messages reflect real-world
conditions, schedules, or routes. Please do not use this project to impersonate
Expand Down Expand Up @@ -189,11 +199,7 @@ <h1>%WARN_SHORT_HEADER%</h1>
<header></header>

<form>
<chooser
title="%P_EXCUSE_T%"
placeholder="%P_EXCUSE_PH%"
itemTitle="%P_EXCUSE_ITEM_T%"
></chooser>
<chooser title="%P_EXCUSE_T%" placeholder="%P_EXCUSE_PH%" itemTitle="%P_EXCUSE_ITEM_T%"></chooser>
</form>
</div>

Expand All @@ -210,31 +216,23 @@ <h1>%WARN_SHORT_HEADER%</h1>
<header></header>

<form>
<chooser
title="%P_NAMED_T%"
placeholder="%P_NAMED_PH%"
itemTitle="%P_NAMED_ITEM_T%"
></chooser>
<chooser title="%P_NAMED_T%" placeholder="%P_NAMED_PH%" itemTitle="%P_NAMED_ITEM_T%"></chooser>
</form>
</div>

<div id="phrasesetPicker" hidden class="picker modal">
<header></header>

<form>
<chooser
title="%P_PSET_T%"
placeholder="%P_PSET_PH%"
itemTitle="%P_PSET_ITEM_T%"
></chooser>
<chooser title="%P_PSET_T%" placeholder="%P_PSET_PH%" itemTitle="%P_PSET_ITEM_T%"></chooser>
</form>
</div>

<div id="platformPicker" hidden class="picker">
<header></header>

<form>
<input title="%P_PLAT_NUMBER_T%" min="0" max="99" type="number">
<input title="%P_PLAT_NUMBER_T%" min="0" max="60" type="number">

<select title="%P_PLAT_LETTER_T%">
<option value=""></option>
Expand All @@ -249,24 +247,15 @@ <h1>%WARN_SHORT_HEADER%</h1>
<header></header>

<form>
<chooser
title="%P_SERV_T%"
placeholder="%P_SERV_PH%"
itemTitle="%P_SERV_ITEM_T%"
></chooser>
<chooser title="%P_SERV_T%" placeholder="%P_SERV_PH%" itemTitle="%P_SERV_ITEM_T%"></chooser>
</form>
</div>

<div id="stationPicker" hidden class="picker fullWidth">
<header></header>

<form>
<chooser
title="%P_STATION_T%"
placeholder="%P_STATION_PH%"
itemTitle="%P_STATION_ITEM_T%"
groupByABC
></chooser>
<chooser title="%P_STATION_T%" placeholder="%P_STATION_PH%" itemTitle="%P_STATION_ITEM_T%" groupByABC></chooser>
</form>
</div>

Expand Down Expand Up @@ -298,15 +287,46 @@ <h1>%WARN_SHORT_HEADER%</h1>
<header></header>

<form>
<input id="timePickerValue" type="time" title="%P_TIME_T%"
pattern="[0-9]{2}:[0-9]{2}" required>
<input id="timePickerValue" type="time" title="%P_TIME_T%" pattern="[0-9]{2}:[0-9]{2}" required>
</form>
</div>

<div id="statePicker" hidden class="picker modal">
<header></header>
<form>
<div style="padding: 10px; display: flex; flex-direction: column; gap: 10px;">
<label for="statePickerValue">State #:</label>
<input id="statePickerValue" type="number" min="1" step="1" required
style="width: 100%; font-size: 1.2em; padding: 5px; box-sizing: border-box;" />

<label for="statePickerName">State Name:</label>
<input id="statePickerName" type="text" placeholder="Optional Name"
style="width: 100%; font-size: 1.2em; padding: 5px; box-sizing: border-box;" />

<div style="font-size: 0.9em; margin-bottom: 5px;">Saved States:</div>
<ul id="statePickerList" style="list-style-type: none; padding: 0; margin: 0; max-height: 100px; overflow-y: auto; border: 1px solid #555; background: #222;">
</ul>

<div style="font-size: 0.9em; margin-bottom: 5px;">State Preview:</div>
<pre id="statePickerPreview" style="margin: 0; max-height: 100px; overflow-y: auto; font-size: 0.8em; background: #111; padding: 5px; border: 1px solid #444; color: #ddd;"></pre>

<p id="statePickerWarning" style="color: #ffaa00; margin: 0; font-size: 0.9em;" hidden>
Warning: State already exists and will be overwritten!
</p>

<menu style="margin: 0; padding: 0; display: flex; gap: 10px;">
<button id="btnStateAction" tabindex="50" style="flex-grow: 1;">Action</button>
<button id="btnStateDelete" tabindex="50" style="background-color: #800;">Delete</button>
<button id="btnStateCancel" tabindex="50">Cancel</button>
</menu>
</div>
</form>
</div>

<!-- UI definitions for common controls -->

<div id="chooserTemplate" hidden class="chooser">
<input class="chSearchBox" type="text" tabindex="50" title=""/>
<input class="chSearchBox" type="text" tabindex="50" title="" />

<dl class="chChoicesBox" tabindex="50"></dl>
</div>
Expand All @@ -326,7 +346,9 @@ <h1>%WARN_SHORT_HEADER%</h1>
</button>

<button id="phrasesetButtonTemplate" class="choosePhrase" tabindex="1" hidden>
<svg><use xlink:href="css/icons/icoMoon.svg#icon-list"></use></svg>
<svg>
<use xlink:href="css/icons/icoMoon.svg#icon-list"></use>
</svg>
</button>

</body>
Expand All @@ -339,13 +361,12 @@ <h1>%WARN_SHORT_HEADER%</h1>
<script src="js/rag.js" type="text/javascript"></script>

<!-- National Rail phrase sets and vocabulary data -->
<script src="data/nr_excuses.js" type="text/javascript"></script>
<script src="data/nr_named.js" type="text/javascript"></script>
<script src="data/nr_excuses.js" type="text/javascript"></script>
<script src="data/nr_named.js" type="text/javascript"></script>
<script src="data/nr_services.js" type="text/javascript"></script>
<script src="data/nr_stations.js" type="text/javascript"></script>
<!-- Loads RAG synchronously, after loading phrase data -->
<iframe id="nrPhraseset" hidden src="data/nr_phrases.xml"
onload="RAG.main({
<iframe id="nrPhraseset" hidden src="data/nr_phrases.xml" onload="RAG.main({
phrasesetEmbed: '#nrPhraseset',
excusesData: DATA_EXCUSES,
namedData: DATA_NAMED,
Expand Down
2 changes: 1 addition & 1 deletion js/config/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class Config extends ConfigBase<Config>
/** Whether to use the VOX engine */
public voxEnabled : boolean = true;
/** Relative or absolute URL of the VOX voice to use */
public voxPath : string = 'https://roycurtis.github.io/RAG-VOX-Roy';
public voxPath : string = 'https://zzz-creator.github.io/RAG-VOX-Roy';

/** Choice of speech voice to use as voice name, or '' if unset */
private _speechVoice : string = '';
Expand Down
Loading