-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Move the link device in options page ( Settings )
- Loading branch information
Showing
6 changed files
with
59 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Sync - Sttings</title> | ||
</head> | ||
<body> | ||
<main> | ||
<a href="#" id="add_new_device_button"><u>Link new device</u></a> | ||
<div id="content"></div> | ||
</main> | ||
</body> | ||
<script src="options.js"></script> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
|
||
document.getElementById('add_new_device_button').addEventListener('click', function (e) { | ||
var generated_html = ''; | ||
generated_html += '<h3>To sync a new device enter the same key on all the devices:</h3>Your current key is: '; | ||
generated_html += '<div style="width: 200px; padding: 3px; border: 2px dotted; word-break: break-all;"><i>' + localStorage.passphrase + '</i></div>'; | ||
// generated_html += '<br /><input type="button" id="action_key" value="Enter a new key" style="font-size: 28px; font-weight: bold;" />'; | ||
document.getElementById('content').innerHTML = generated_html; | ||
alert('You are about to share bookmarks and tabs with other devices'); | ||
var passphrase = prompt("Copy-paste the same key on all your devices", localStorage.passphrase); | ||
if (passphrase == null || !window.atob(passphrase)) | ||
{ | ||
alert('Incorrect key'); | ||
return; | ||
} | ||
localStorage.passphrase = passphrase; | ||
var default_devicename = "Device-" + Math.random(); | ||
if (typeof localStorage.deviceId != 'undefined') | ||
default_devicename = localStorage.deviceId; | ||
var deviceid = prompt("Enter device name", default_devicename); | ||
if (deviceid == null) | ||
{ | ||
alert('Incorrect device name'); | ||
return; | ||
} | ||
localStorage.deviceId = deviceid; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,7 @@ body { | |
width: 100%; | ||
padding: .5rem; | ||
} | ||
|
||
.search:not(focus) { | ||
padding: 5px; | ||
border-radius: 5px; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters