Skip to content

Commit 829ffae

Browse files
committed
More details in the settings, close #6
1 parent f1bcde6 commit 829ffae

3 files changed

Lines changed: 49 additions & 31 deletions

File tree

includes/chart.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@
3030
</ul>
3131
</nav>
3232
<div class='container-fluid'>
33+
<div class='text-justify text-center'>
34+
More infos on the differents stats available <a target='_blank' href='https://github.com/RakSrinaNa/YTTracker/wiki/Data'>here</a>.
35+
</div>
3336
<div class='card info-card box-shadow'>
3437
<div class='card-header'>
3538
<h5 class='card-title'>All data</h5>

includes/js/options.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,6 @@ $(function () {
5151
alert('Corrupted file!');
5252
return;
5353
}
54-
if (!confirm('This action will reset all your current data and replace it with the one in the file!\nAre you sure to continue?'))
55-
return;
56-
5754
YTTGetConfig(null, function (config) {
5855
let foundCount = 0;
5956
let newConf = {};
@@ -103,7 +100,10 @@ $(function () {
103100

104101
YTTGetConfig([YTT_CONFIG_VERSION, YTT_CONFIG_USERID, YTT_CONFIG_SHARE_ONLINE, YTT_CONFIG_USERNAME, YTT_CONFIG_DEBUG_KEY], function (config) {
105102
$('#validUsername').on('click', function () {
106-
const newUsername = $('#username').val();
103+
let newUsername = $('#username').val();
104+
if(newUsername === ""){
105+
newUsername = "Anonymous";
106+
}
107107
$.ajax({
108108
url: 'https://yttracker.mrcraftcod.fr/api/v2/' + encodeURI(config[YTT_CONFIG_USERID]) + '/username',
109109
data: {

includes/options.html

Lines changed: 42 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -14,54 +14,69 @@
1414
<body>
1515
<div class='container-fluid' style="margin-top:10px">
1616
<div class='row'>
17-
<div class='col'>
18-
<button type="button" class="btn btn-primary btn-block" id="exportButton" data-toggle="tooltip" data-placement="bottom" title="Export your data in a JSON file that you can download and import back later">
17+
<div class='col form-group'>
18+
<button type="button" class="btn btn-primary btn-block" id="exportButton" aria-describedby="exportDataHelp">
1919
Export data
2020
</button>
21+
<small id="exportDataHelp" class="text-justify form-text text-muted">Export your data in a JSON file that you can download and import back later (see <a target='_blank' href='https://github.com/RakSrinaNa/YTTracker/wiki/Import-Export'>the wiki</a>).</small>
2122
</div>
22-
<div class='col'>
23-
<label class="btn btn-info btn-block" role='button' data-toggle="tooltip" data-placement="bottom" title="Import a JSON file (!! THIS WILL RESET EVERYTHING AND CAN'T BE UNDONE !!)">
23+
<div class='col form-group'>
24+
<label class="btn btn-info btn-block" role='button' aria-describedby='importFileHelp'>
2425
Import data<input type="file" id="importFileInput" hidden>
2526
</label>
27+
<small id="importFileHelp" class="text-justify form-text text-muted">Import a JSON file the you previously exported (see <a target='_blank' href='https://github.com/RakSrinaNa/YTTracker/wiki/Import-Export'>the wiki</a>). <span class='text-danger'>Be carefull, ALL data currently present will be wiped out and replaced by the data in the file.</span></small>
2628
</div>
27-
<div class='col'>
28-
<label class="btn btn-info btn-block" role='button' data-toggle="tooltip" data-placement="bottom" title="Import your history from youtube">
29-
Import watch history<input type="file" id="importYoutubeFileInput" hidden>
29+
<div class='col form-group'>
30+
<label class="btn btn-info btn-block" role='button' aria-describedby='importYoutubeFileHelp'>
31+
Import YouTube history<input type="file" id="importYoutubeFileInput" hidden>
3032
</label>
33+
<small id="importYoutubeFileHelp" class="text-justify form-text text-muted">Import data from an export of your YouTube history (see <a target='_blank' href='https://github.com/RakSrinaNa/YTTracker/wiki/Import-YouTube-history'>the wiki</a>). <span class='text-warning'>Only the days with no data will be imported as we can only retrieve the number of videos opened.</span></small>
3134
</div>
32-
<div class='col'>
33-
<button type="button" class="btn btn-danger btn-block" id="resetButton" data-toggle="tooltip" data-placement="bottom" title="Reset all your current data (!! THIS WILL RESET EVERYTHING AND CAN'T BE UNDONE !!)">
35+
<div class='col form-group'>
36+
<button type="button" class="btn btn-danger btn-block" id="resetButton" aria-describedby='resetHelp'>
3437
Reset all data
3538
</button>
39+
<small id="resetHelp" class="text-justify form-text text-muted">Reset all the data saved by this extension. <span class='text-danger'>This cannot be undone!</span></small>
3640
</div>
3741
</div>
3842
<hr>
39-
<div class="input-group mb-3">
40-
<div class="input-group-prepend">
41-
<div class="input-group-text">
42-
Send stats online
43+
<div>
44+
<p>
45+
If you wish to, you can share your data with other users.
46+
They will only be able to see the <span class='text-info'>watched time</span>, <span class='text-info'>opened time</span> and <span class='text-info'>opened count</span> (more infos <a target='_blank' href='https://github.com/RakSrinaNa/YTTracker/wiki/Online-Sharing'>here</a>).
47+
<br/>
48+
To do so just check the box under, pick a username and press <span class='text-success'>Valid</span>.
49+
You can change it at anytime.
50+
If you let it blank, you'll be shown as <span class='text-info'>Anonymous</span>.
51+
</p>
52+
<div class="input-group mb-3">
53+
<div class="input-group-prepend">
54+
<div class="input-group-text">
55+
Send stats online
56+
</div>
57+
<div class="input-group-text">
58+
<input id="shareStats" name='shareStats' value="share" type="checkbox" aria-label="Allow the extension to send data to a server">
59+
</div>
4360
</div>
44-
<div class="input-group-text">
45-
<input id="shareStats" name='shareStats' value="share" type="checkbox" aria-label="Allow the extension to send data to a server">
61+
<input id='username' type="text" class="form-control" aria-label="Enter the username you desire" placeholder="Enter your username">
62+
<div class="input-group-append">
63+
<button id="validUsername" class='btn btn-success'>Valid</button>
4664
</div>
4765
</div>
48-
<input id='username' type="text" class="form-control" aria-label="Enter the username you desire" placeholder="Enter your username">
49-
<div class="input-group-append">
50-
<button id="validUsername" class='btn btn-success'>Valid</button>
51-
</div>
52-
</div>
53-
<div class="form-check">
54-
<input class="form-check-input" type="checkbox" name="debug" value="debug" title="Debug" id="debug">
55-
<label class="form-check-label" for="debug">
56-
Debug mode
57-
</label>
5866
</div>
5967
<hr/>
60-
<span class="float-left">UUID: <span id="UUID"></span></span>
61-
<span class="float-right">Version: <span id="versionNumber"></span></span>
6268
<button type="button" class="btn btn-primary btn-block" id="backButton">
6369
Back to chart
6470
</button>
71+
<small class="float-left text-muted">UUID: <span id="UUID"></span></small>
72+
<small class="float-right text-muted">Version: <span id="versionNumber"></span></small>
73+
<br/>
74+
<div class="float-left form-control-sm form-check">
75+
<input class="form-check-input" type="checkbox" value="debug" id="debug">
76+
<label class="form-check-label" for="debug">
77+
<small class='text-muted'>Debug mode</small>
78+
</label>
79+
</div>
6580
</div>
6681
</body>
6782
</html>

0 commit comments

Comments
 (0)