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
31 changes: 31 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@

# Created by https://www.gitignore.io/api/macos

### macOS ###
*.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon

# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

# End of https://www.gitignore.io/api/macos
Binary file added Icon.sketch
Binary file not shown.
Binary file modified icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 12 additions & 1 deletion options.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@
// Saves options to localStorage.
function saveOptions(event) {
event.preventDefault();

function adjustHostname(hostname) {
var adjustedHostname = hostname.replace(/\s+/g, '-');
if (!adjustedHostname.endsWith(".local")) {
adjustedHostname += ".local";
}
return adjustedHostname;
}

localStorage["hostname"] = document.getElementById("hostname").value;
var adjustedHostname = adjustHostname(document.getElementById("hostname").value);
localStorage["hostname"] = adjustedHostname;
localStorage["play-position"] = document.getElementById("play-position-current").checked ? "current" : "0";

document.getElementById("hostname").value = localStorage["hostname"];

chrome.extension.getBackgroundPage().window.location.reload();

// Show status to let user know options were saved.
Expand Down