Skip to content

Commit a45d970

Browse files
authored
Merge pull request #10 from LeidenUniversityLibrary/6-duplicate-ids-error
Duplicate ids and manifest v.3
2 parents efe6143 + 55097f1 commit a45d970

30 files changed

Lines changed: 11089 additions & 173 deletions

css/bootstrap.min.css

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

css/fontawesome-all.css

Lines changed: 4616 additions & 0 deletions
Large diffs are not rendered by default.

css/style.css

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
html {
2+
width: auto;
3+
height: auto;
4+
font-family: Arial, Helvetica, sans-serif, sans-serif;
5+
}
6+
7+
body {
8+
width: 450px;
9+
height: auto;
10+
background-color: #fff;
11+
font-family: Arial, Helvetica, sans-serif, sans-serif;
12+
}
13+
14+
#searchContainer {
15+
padding: 20px;
16+
}
17+
18+
#searchInput {
19+
font-style: italic;
20+
width: 100%;
21+
}
22+
23+
input[type=text] {
24+
padding: 5px;
25+
border: 2px solid #d3d3d3;
26+
-webkit-border-radius: 5px;
27+
border-radius: 5px;
28+
}
29+
30+
input[type=submit] {
31+
padding: 5px 15px;
32+
cursor: pointer;
33+
border: 0 none;
34+
-webkit-border-radius: 5px;
35+
border-radius: 5px;
36+
background: #001158;
37+
color: #fff;
38+
}
39+
40+
h4 {
41+
font-size: 20px;
42+
color: #001158;
43+
font-weight: 300;
44+
}
45+
46+
.searchBox {
47+
background-color: #7f88ab;
48+
padding: 20px;
49+
padding-top: 106px;
50+
}
51+
52+
.searchOptions {
53+
background-color: #fff;
54+
padding: 20px;
55+
}
56+
57+
.getAccess {
58+
background-color: #fff;
59+
padding: 20px;
60+
border-top: 2px solid #d3d3d3;
61+
}
62+
63+
.searchButton {
64+
margin-top: 1em;
65+
}
66+
67+
/* icons */
68+
69+
i.fas.fa-external-link-alt {
70+
font-size: 0.6em;
71+
}
72+
73+
/* bootstrap changes */
74+
75+
.navbar {
76+
margin-bottom: 0;
77+
background-color: #fff !important;
78+
border: 1px solid #d3d3d3;
79+
}
80+
81+
.btn-outline-primary {
82+
color: #b27f2b;
83+
background-color: transparent;
84+
background-image: none;
85+
border-color: #b27f2b;
86+
}
87+
88+
.btn-outline-primary:hover {
89+
background-color: #e5c592;
90+
border-color: #e5c592;
91+
}
92+
93+
.btn-outline-primary:not(:disabled):not(.disabled).active,
94+
.btn-outline-primary:not(:disabled):not(.disabled):active,
95+
.show>.btn-outline-primary.dropdown-toggle {
96+
background-color: #e5c592;
97+
border-color: #e5c592;
98+
}
99+
100+
.btn-outline-primary.focus,
101+
.btn-outline-primary:focus {
102+
box-shadow: 0 0 0 0.2rem #e5c592;
103+
}
104+
105+
.btn-outline-primary:not(:disabled):not(.disabled).active:focus,
106+
.btn-outline-primary:not(:disabled):not(.disabled):active:focus,
107+
.show>.btn-outline-primary.dropdown-toggle:focus {
108+
box-shadow: 0 0 0 0.2rem #e5c592;
109+
}
110+
111+
input[type=checkbox],
112+
input[type=radio],
113+
label.form-check-label {
114+
cursor: pointer;
115+
}
116+
117+
.navbar-light .navbar-toggler {
118+
border-color: #b27f2b;
119+
}
120+
121+
.install_welcome {
122+
background-color: #fff;
123+
padding: 20px;
124+
text-align: center;
125+
margin-top: 200px;
126+
}

js/background.js

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
//SECTION Context Menu
2+
var searches = [{
3+
title: "Search in the Library's Catalogue",
4+
//Replace with your library's URL. IMPORTANT '%s' is the search variable and must be present.
5+
url: "https://example.com/search?query=%s"
6+
},
7+
{
8+
title: "Search in the Web of Science",
9+
//Replace with your library's ezproxy URL. If your library does not use ezproxy, keep the Web of Science url only.
10+
url: "https://login.ezproxy.example.com/login?URL=https://gateway.webofknowledge.com/gateway/Gateway.cgi?GWVersion=2&SrcApp=WEB&SrcAuth=HSB&DestApp=WOS&DestLinkType=GeneralSearchSummary&topic=%s&btnWS=Search&utm_source=Leiden%20Search%20Assistant%20plugin&utm_medium=Contextual"
11+
},
12+
{
13+
title: "Search in Google Scholar",
14+
url: "https://scholar.google.com/scholar?q=%s"
15+
},
16+
{
17+
title: "Search in Leiden PubMed",
18+
//Replace the asterisks **** with your Pubmed otool ID
19+
url: "https://www.ncbi.nlm.nih.gov/pubmed/?otool=****&term=%s"
20+
},
21+
{
22+
title: "Search in WorldCat",
23+
url: "https://www.worldcat.org/search?q=%s"
24+
}
25+
];
26+
27+
searches.forEach(function (obj, info) {
28+
chrome.contextMenus.create({
29+
title: obj.title,
30+
contexts: ["selection"],
31+
id: (searches.indexOf(obj) + 1).toString()
32+
});
33+
});
34+
35+
// replace %s with highlighted text
36+
chrome.contextMenus.onClicked.addListener(function (info, tab) {
37+
//console.log(info.menuItemId);
38+
var searchObj = searches[info.menuItemId - 1];
39+
if (typeof searchObj === "undefined")
40+
return;
41+
chrome.tabs.create({
42+
url: searchObj.url.replace("%s", encodeURIComponent(info.selectionText)),
43+
selected: false
44+
});
45+
});
46+
//!SECTION

js/bootstrap.bundle.min.js

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/gtm.js

Lines changed: 0 additions & 14 deletions
This file was deleted.

0 commit comments

Comments
 (0)