forked from barakyoresh/github-show-hide-outdated-diffs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbackground.js
More file actions
26 lines (20 loc) · 811 Bytes
/
Copy pathbackground.js
File metadata and controls
26 lines (20 loc) · 811 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
var current = 0;
function updateShowState() {
chrome.browserAction.setIcon({path:"icon" + current + ".png"});
current++;
if (current > 1) {
current = 0;
chrome.tabs.executeScript(null, { file: "jquery-2.1.4.js" }, function() {
chrome.tabs.executeScript(null, { code:"$('.outdated-diff-comment-container').addClass('open');" });
});
} else {
chrome.tabs.executeScript(null, { file: "jquery-2.1.4.js" }, function() {
chrome.tabs.executeScript(null, { code:"$('.outdated-diff-comment-container').removeClass('open');" });
});
}
}
chrome.browserAction.onClicked.addListener(updateShowState);
updateShowState();