Skip to content

Commit

Permalink
Gitmark the whole repo, not just specific pages.
Browse files Browse the repository at this point in the history
- extract the repo url to bookmark from the current url
- when checking to see if the current page is in a
  bookmarked repo, use match() to see if the current url
  contains the bookmarked url

See #11
  • Loading branch information
philtr committed Jan 4, 2012
1 parent deded10 commit 0a11521
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions chrome/background.html
Expand Up @@ -56,7 +56,8 @@
toggle_gitmark (newfolder, sender.tab.url);
});
} else {
toggle_gitmark (gitmarks, sender.tab.url);
repo_url = sender.tab.url.replace(/https:\/\/github.com\/(\w+)\/(\w+)\/.*/i, "https://github.com/$1/$2");
toggle_gitmark (gitmarks, repo_url);
}

sendResponse({farewell: "page gitmarked"});
Expand Down Expand Up @@ -108,7 +109,7 @@
url = url.substring (0, url.length - 1);

gitmarks.children.forEach (function (gitmark) {
if (gitmark.url == url)
if (gitmark.url.match(url) != null)
result = true;
});

Expand Down

0 comments on commit 0a11521

Please sign in to comment.