Skip to content

Commit

Permalink
Add terms of use
Browse files Browse the repository at this point in the history
  • Loading branch information
hugodeaguiar committed Oct 13, 2023
1 parent 6c94dc8 commit 158bb27
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 2 deletions.
4 changes: 4 additions & 0 deletions css/auth.css
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,8 @@ body {

.disabled {
display: none !important;
}

.terms-of-use {
margin-bottom: 20px;
}
Empty file removed css/style.css
Empty file.
Binary file modified images/noffort_48.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 3 additions & 2 deletions scripts/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ async function auth() {
try {
var apiKey = document.getElementById("apiKey").value

if (!apiKey) {
if (!apiKey || !document.getElementById('terms-of-use').checked) {
return false;
}

Expand All @@ -33,7 +33,6 @@ async function auth() {

value = btoa(apiKey);
chrome.storage.local.set({ 'noffort_Caeth3Haileeko1r': value }, function () {
console.log('saved');
if (chrome.runtime.lastError) {
document.getElementById('bg').classList.add('disabled');
console.error('Error saving to Chrome storage: ', chrome.runtime.lastError);
Expand All @@ -44,6 +43,8 @@ async function auth() {
})
});

chrome.tabs.create({ url: "http://eepurl.com/iBKrv-/" });

chrome.tabs.getCurrent(function(tab) {
chrome.tabs.remove(tab.id, function() { });
});
Expand Down
4 changes: 4 additions & 0 deletions view/authentication.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
<div class="input-container">
<input type="password" id="apiKey" class="input-field" placeholder="Enter your Clockify API key" required>
</div>
<div class="terms-of-use">
<input type="checkbox" name="terms_of_use" id="terms-of-use" required>
<label for="terms-of-use">I Agree with <a target="_blank" href="https://noffort.co/terms-of-use">Terms of Use</a></label>
</div>
<button type="submit" class="submit-button" id="submit-button">Submit</button>
</form>
</div>
Expand Down

0 comments on commit 158bb27

Please sign in to comment.