Skip to content

Commit 516a2f9

Browse files
committed
ResultsPane: use Supadu image server for thumbnails
1 parent 5c28852 commit 516a2f9

File tree

29 files changed

+248
-249
lines changed

29 files changed

+248
-249
lines changed

src/components/ResultsPane.vue

+4-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
aria-hidden="true"
3939
>
4040
<img
41-
:src="`/open-square-reader/epub_content/${ result.identifier }/ops/images/${ result.identifier }-th.jpg`"
41+
:src="getThumbnailUrl( result.identifier )"
4242
alt=""
4343
class="img-fluid"
4444
>
@@ -180,6 +180,9 @@ export default {
180180
}
181181
}
182182
},
183+
getThumbnailUrl( isbn ) {
184+
return `https://nyu-opensquare-us.imgix.net/covers/${ isbn }.jpg?auto=format&w=145`;
185+
},
183186
truncate( text, maxLength ) {
184187
if ( ! text ) {
185188
return text;

tests/browser/pageobjects/classes/ResultsPaneSearchResults.js

-4
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,6 @@ class ResultsPaneSearchResults {
2828
.replace( /Published: /, '' );
2929
book.subtitle = innerHtml( $( `${ parentElementSelector } .book-subtitle` ).getHTML() );
3030
book.thumbnail = $( `${ parentElementSelector } .thumb img` ).getAttribute( 'src' );
31-
// When testing Chrome, the absolute URL is returned instead of the relative path
32-
if ( book.thumbnail.startsWith( 'http' ) ) {
33-
book.thumbnail = new URL( book.thumbnail ).pathname;
34-
}
3531
book.title = innerHtml( $( `${ parentElementSelector } .book-title` ).getHTML() );
3632

3733
books.push( book );

tests/browser/tests/testdata/golden/search-results/08de57b57b4b2e1c5642f51f1b686d05c01d8498b03ca0003e0637bd4f18dccc.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"isbn": "9780814793114",
99
"publicationDate": "1997",
1010
"subtitle": "",
11-
"thumbnail": "/open-square-reader/epub_content/9780814793114/ops/images/9780814793114-th.jpg",
11+
"thumbnail": "https://nyu-opensquare-us.imgix.net/covers/9780814793114.jpg?auto=format&w=145",
1212
"title": "HIV Mental Health for the 21st Century"
1313
},
1414
{
@@ -17,7 +17,7 @@
1717
"isbn": "9780814793398",
1818
"publicationDate": "1997",
1919
"subtitle": "The Lives and Stories of Urban Teenagers",
20-
"thumbnail": "/open-square-reader/epub_content/9780814793398/ops/images/9780814793398-th.jpg",
20+
"thumbnail": "https://nyu-opensquare-us.imgix.net/covers/9780814793398.jpg?auto=format&w=145",
2121
"title": "Everyday Courage"
2222
},
2323
{
@@ -26,7 +26,7 @@
2626
"isbn": "9780814715352",
2727
"publicationDate": "1996",
2828
"subtitle": "Western Responses to Genocide in Bosnia",
29-
"thumbnail": "/open-square-reader/epub_content/9780814715352/ops/images/9780814715352-th.jpg",
29+
"thumbnail": "https://nyu-opensquare-us.imgix.net/covers/9780814715352.jpg?auto=format&w=145",
3030
"title": "This Time We Knew"
3131
}
3232
],

tests/browser/tests/testdata/golden/search-results/13dcfae777cd43d68860aa74315b5a07dc998cb8a351309d104c317be349dce5.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"isbn": "9780814774632",
99
"publicationDate": "1996",
1010
"subtitle": "Bill Clinton and the Politics of Ambition",
11-
"thumbnail": "/open-square-reader/epub_content/9780814774632/ops/images/9780814774632-th.jpg",
11+
"thumbnail": "https://nyu-opensquare-us.imgix.net/covers/9780814774632.jpg?auto=format&w=145",
1212
"title": "High Hopes"
1313
},
1414
{
@@ -17,7 +17,7 @@
1717
"isbn": "9780814774694",
1818
"publicationDate": "1996",
1919
"subtitle": "",
20-
"thumbnail": "/open-square-reader/epub_content/9780814774694/ops/images/9780814774694-th.jpg",
20+
"thumbnail": "https://nyu-opensquare-us.imgix.net/covers/9780814774694.jpg?auto=format&w=145",
2121
"title": "The Psychological Assessment of Presidential Candidates"
2222
}
2323
],

tests/browser/tests/testdata/golden/search-results/163d817fe8a87f7394f70cf6febc9a697b666a64a2f14ec0b18d32cc9f6e289d.json

+8-8
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"isbn": "9780814774694",
99
"publicationDate": "1996",
1010
"subtitle": "",
11-
"thumbnail": "/open-square-reader/epub_content/9780814774694/ops/images/9780814774694-th.jpg",
11+
"thumbnail": "https://nyu-opensquare-us.imgix.net/covers/9780814774694.jpg?auto=format&w=145",
1212
"title": "The <mark>Psychological</mark> Assessment of Presidential Candidates"
1313
},
1414
{
@@ -17,7 +17,7 @@
1717
"isbn": "9780814761908",
1818
"publicationDate": "1992",
1919
"subtitle": "Philosophical, <mark>Psychological</mark>, and Historical Perspectives on Altruism",
20-
"thumbnail": "/open-square-reader/epub_content/9780814761908/ops/images/9780814761908-th.jpg",
20+
"thumbnail": "https://nyu-opensquare-us.imgix.net/covers/9780814761908.jpg?auto=format&w=145",
2121
"title": "Embracing the Other"
2222
},
2323
{
@@ -26,7 +26,7 @@
2626
"isbn": "9780814766569",
2727
"publicationDate": "1997",
2828
"subtitle": "A <mark>Psychological</mark> Approach to Character and Conflict in Literature",
29-
"thumbnail": "/open-square-reader/epub_content/9780814766569/ops/images/9780814766569-th.jpg",
29+
"thumbnail": "https://nyu-opensquare-us.imgix.net/covers/9780814766569.jpg?auto=format&w=145",
3030
"title": "Imagined Human Beings"
3131
},
3232
{
@@ -35,7 +35,7 @@
3535
"isbn": "9780814746677",
3636
"publicationDate": "1993",
3737
"subtitle": "A <mark>Psychological</mark> Study of Rainer Maria Rilke's Life and Work",
38-
"thumbnail": "/open-square-reader/epub_content/9780814746677/ops/images/9780814746677-th.jpg",
38+
"thumbnail": "https://nyu-opensquare-us.imgix.net/covers/9780814746677.jpg?auto=format&w=145",
3939
"title": "The Beginning of Terror"
4040
},
4141
{
@@ -44,7 +44,7 @@
4444
"isbn": "9780814774823",
4545
"publicationDate": "1995",
4646
"subtitle": "Moral Masochism and the Cult of Suffering",
47-
"thumbnail": "/open-square-reader/epub_content/9780814774823/ops/images/9780814774823-th.jpg",
47+
"thumbnail": "https://nyu-opensquare-us.imgix.net/covers/9780814774823.jpg?auto=format&w=145",
4848
"title": "The Slave Soul of Russia"
4949
},
5050
{
@@ -53,7 +53,7 @@
5353
"isbn": "9780814746622",
5454
"publicationDate": "1997",
5555
"subtitle": "Environmental Illness and the Struggle Over Medical Knowledge",
56-
"thumbnail": "/open-square-reader/epub_content/9780814746622/ops/images/9780814746622-th.jpg",
56+
"thumbnail": "https://nyu-opensquare-us.imgix.net/covers/9780814746622.jpg?auto=format&w=145",
5757
"title": "Bodies in Protest"
5858
},
5959
{
@@ -62,7 +62,7 @@
6262
"isbn": "9780814774632",
6363
"publicationDate": "1996",
6464
"subtitle": "Bill Clinton and the Politics of Ambition",
65-
"thumbnail": "/open-square-reader/epub_content/9780814774632/ops/images/9780814774632-th.jpg",
65+
"thumbnail": "https://nyu-opensquare-us.imgix.net/covers/9780814774632.jpg?auto=format&w=145",
6666
"title": "High Hopes"
6767
},
6868
{
@@ -71,7 +71,7 @@
7171
"isbn": "9780814755297",
7272
"publicationDate": "1995",
7373
"subtitle": "Sexual Trauma, Body Image, and Religion",
74-
"thumbnail": "/open-square-reader/epub_content/9780814755297/ops/images/9780814755297-th.jpg",
74+
"thumbnail": "https://nyu-opensquare-us.imgix.net/covers/9780814755297.jpg?auto=format&w=145",
7575
"title": "Faith Born of Seduction"
7676
}
7777
],

tests/browser/tests/testdata/golden/search-results/1a1d1484d3cbc721070469e555f6a0cc89c03d60181e1f13694014e9249d19b6.json

+26-26
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"isbn": "9780814774458",
99
"publicationDate": "1995",
1010
"subtitle": "Sex, Loyalty, and Revolution",
11-
"thumbnail": "/open-square-reader/epub_content/9780814774458/ops/images/9780814774458-th.jpg",
11+
"thumbnail": "https://nyu-opensquare-us.imgix.net/covers/9780814774458.jpg?auto=format&w=145",
1212
"title": "Bisexuality and the Challenge to Lesbian <mark>Politics</mark>"
1313
},
1414
{
@@ -17,7 +17,7 @@
1717
"isbn": "9780814735190",
1818
"publicationDate": "1995",
1919
"subtitle": "A New Sense of the <mark>Political</mark>",
20-
"thumbnail": "/open-square-reader/epub_content/9780814735190/ops/images/9780814735190-th.jpg",
20+
"thumbnail": "https://nyu-opensquare-us.imgix.net/covers/9780814735190.jpg?auto=format&w=145",
2121
"title": "Deconstruction Is/In America"
2222
},
2323
{
@@ -26,7 +26,7 @@
2626
"isbn": "9780814712481",
2727
"publicationDate": "1995",
2828
"subtitle": "Postcommunism and the Body <mark>Politic</mark>",
29-
"thumbnail": "/open-square-reader/epub_content/9780814712481/ops/images/9780814712481-th.jpg",
29+
"thumbnail": "https://nyu-opensquare-us.imgix.net/covers/9780814712481.jpg?auto=format&w=145",
3030
"title": "Genders 22"
3131
},
3232
{
@@ -35,7 +35,7 @@
3535
"isbn": "9780814774632",
3636
"publicationDate": "1996",
3737
"subtitle": "Bill Clinton and the <mark>Politics</mark> of Ambition",
38-
"thumbnail": "/open-square-reader/epub_content/9780814774632/ops/images/9780814774632-th.jpg",
38+
"thumbnail": "https://nyu-opensquare-us.imgix.net/covers/9780814774632.jpg?auto=format&w=145",
3939
"title": "High Hopes"
4040
},
4141
{
@@ -44,7 +44,7 @@
4444
"isbn": "9780814755471",
4545
"publicationDate": "1996",
4646
"subtitle": "Identity <mark>Politics</mark> in Higher Education",
47-
"thumbnail": "/open-square-reader/epub_content/9780814755471/ops/images/9780814755471-th.jpg",
47+
"thumbnail": "https://nyu-opensquare-us.imgix.net/covers/9780814755471.jpg?auto=format&w=145",
4848
"title": "Teaching What You're Not"
4949
},
5050
{
@@ -53,7 +53,7 @@
5353
"isbn": "9780814735305",
5454
"publicationDate": "",
5555
"subtitle": "Lesbians, Gay Men, and Bisexuals in American Electoral <mark>Politics</mark>",
56-
"thumbnail": "/open-square-reader/epub_content/9780814735305/ops/images/9780814735305-th.jpg",
56+
"thumbnail": "https://nyu-opensquare-us.imgix.net/covers/9780814735305.jpg?auto=format&w=145",
5757
"title": "The Lavender Vote"
5858
},
5959
{
@@ -62,7 +62,7 @@
6262
"isbn": "9780814747148",
6363
"publicationDate": "1998",
6464
"subtitle": "The American Founders, Gendered Language, and Patriarchal <mark>Politics</mark>",
65-
"thumbnail": "/open-square-reader/epub_content/9780814747148/ops/images/9780814747148-th.jpg",
65+
"thumbnail": "https://nyu-opensquare-us.imgix.net/covers/9780814747148.jpg?auto=format&w=145",
6666
"title": "A Republic of Men"
6767
},
6868
{
@@ -71,7 +71,7 @@
7171
"isbn": "9781479899982",
7272
"publicationDate": "2016",
7373
"subtitle": "The New Youth Activism",
74-
"thumbnail": "/open-square-reader/epub_content/9781479899982/ops/images/9781479899982-th.jpg",
74+
"thumbnail": "https://nyu-opensquare-us.imgix.net/covers/9781479899982.jpg?auto=format&w=145",
7575
"title": "By Any Media Necessary"
7676
},
7777
{
@@ -80,7 +80,7 @@
8080
"isbn": "9780814714218",
8181
"publicationDate": "1989",
8282
"subtitle": "Nomos XXXI",
83-
"thumbnail": "/open-square-reader/epub_content/9780814714218/ops/images/9780814714218-th.jpg",
83+
"thumbnail": "https://nyu-opensquare-us.imgix.net/covers/9780814714218.jpg?auto=format&w=145",
8484
"title": "Markets and Justice"
8585
},
8686
{
@@ -89,7 +89,7 @@
8989
"isbn": "9780814780978",
9090
"publicationDate": "1998",
9191
"subtitle": "Nomos XL",
92-
"thumbnail": "/open-square-reader/epub_content/9780814780978/ops/images/9780814780978-th.jpg",
92+
"thumbnail": "https://nyu-opensquare-us.imgix.net/covers/9780814780978.jpg?auto=format&w=145",
9393
"title": "Integrity and Conscience"
9494
},
9595
{
@@ -98,7 +98,7 @@
9898
"isbn": "9780814774816",
9999
"publicationDate": "1995",
100100
"subtitle": "Counterfeit Heroes and Unhappy Truths",
101-
"thumbnail": "/open-square-reader/epub_content/9780814774816/ops/images/9780814774816-th.jpg",
101+
"thumbnail": "https://nyu-opensquare-us.imgix.net/covers/9780814774816.jpg?auto=format&w=145",
102102
"title": "Clarence Thomas and the Tough Love Crowd"
103103
},
104104
{
@@ -107,7 +107,7 @@
107107
"isbn": "9780814726846",
108108
"publicationDate": "1997",
109109
"subtitle": "A Critical History of the Separation of Church and State",
110-
"thumbnail": "/open-square-reader/epub_content/9780814726846/ops/images/9780814726846-th.jpg",
110+
"thumbnail": "https://nyu-opensquare-us.imgix.net/covers/9780814726846.jpg?auto=format&w=145",
111111
"title": "Please Don't Wish Me a Merry Christmas"
112112
},
113113
{
@@ -116,7 +116,7 @@
116116
"isbn": "9780814774694",
117117
"publicationDate": "1996",
118118
"subtitle": "",
119-
"thumbnail": "/open-square-reader/epub_content/9780814774694/ops/images/9780814774694-th.jpg",
119+
"thumbnail": "https://nyu-opensquare-us.imgix.net/covers/9780814774694.jpg?auto=format&w=145",
120120
"title": "The Psychological Assessment of Presidential Candidates"
121121
},
122122
{
@@ -125,7 +125,7 @@
125125
"isbn": "9780814774410",
126126
"publicationDate": "1994",
127127
"subtitle": "Communication and the Construction of Homosexuality",
128-
"thumbnail": "/open-square-reader/epub_content/9780814774410/ops/images/9780814774410-th.jpg",
128+
"thumbnail": "https://nyu-opensquare-us.imgix.net/covers/9780814774410.jpg?auto=format&w=145",
129129
"title": "Queer Words, Queer Images"
130130
},
131131
{
@@ -134,7 +134,7 @@
134134
"isbn": "9780814735336",
135135
"publicationDate": "1998",
136136
"subtitle": "Society, Intelligence, and Law",
137-
"thumbnail": "/open-square-reader/epub_content/9780814735336/ops/images/9780814735336-th.jpg",
137+
"thumbnail": "https://nyu-opensquare-us.imgix.net/covers/9780814735336.jpg?auto=format&w=145",
138138
"title": "The Smart Culture"
139139
},
140140
{
@@ -143,7 +143,7 @@
143143
"isbn": "9780814718766",
144144
"publicationDate": "1997",
145145
"subtitle": "",
146-
"thumbnail": "/open-square-reader/epub_content/9780814718766/ops/images/9780814718766-th.jpg",
146+
"thumbnail": "https://nyu-opensquare-us.imgix.net/covers/9780814718766.jpg?auto=format&w=145",
147147
"title": "The Prophetic Tradition and Radical Rhetoric in America"
148148
},
149149
{
@@ -152,7 +152,7 @@
152152
"isbn": "9780814726815",
153153
"publicationDate": "1998",
154154
"subtitle": "A Crisis of Liberalism",
155-
"thumbnail": "/open-square-reader/epub_content/9780814726815/ops/images/9780814726815-th.jpg",
155+
"thumbnail": "https://nyu-opensquare-us.imgix.net/covers/9780814726815.jpg?auto=format&w=145",
156156
"title": "Blacks in the Jewish Mind"
157157
},
158158
{
@@ -161,7 +161,7 @@
161161
"isbn": "9780814755969",
162162
"publicationDate": "1998",
163163
"subtitle": "The Shaping of the Gay and Lesbian Struggle for Civil Rights",
164-
"thumbnail": "/open-square-reader/epub_content/9780814755969/ops/images/9780814755969-th.jpg",
164+
"thumbnail": "https://nyu-opensquare-us.imgix.net/covers/9780814755969.jpg?auto=format&w=145",
165165
"title": "Freedom to Differ"
166166
},
167167
{
@@ -170,7 +170,7 @@
170170
"isbn": "9780814780015",
171171
"publicationDate": "1995",
172172
"subtitle": "",
173-
"thumbnail": "/open-square-reader/epub_content/9780814780015/ops/images/9780814780015-th.jpg",
173+
"thumbnail": "https://nyu-opensquare-us.imgix.net/covers/9780814780015.jpg?auto=format&w=145",
174174
"title": "The Americanization of the Jews"
175175
},
176176
{
@@ -179,7 +179,7 @@
179179
"isbn": "9780814780213",
180180
"publicationDate": "1994",
181181
"subtitle": "The Future of U.S.-Japan Relations",
182-
"thumbnail": "/open-square-reader/epub_content/9780814780213/ops/images/9780814780213-th.jpg",
182+
"thumbnail": "https://nyu-opensquare-us.imgix.net/covers/9780814780213.jpg?auto=format&w=145",
183183
"title": "The Chrysanthemum and the Eagle"
184184
},
185185
{
@@ -188,7 +188,7 @@
188188
"isbn": "9780814751213",
189189
"publicationDate": "1998",
190190
"subtitle": "Men, Women, and the Law",
191-
"thumbnail": "/open-square-reader/epub_content/9780814751213/ops/images/9780814751213-th.jpg",
191+
"thumbnail": "https://nyu-opensquare-us.imgix.net/covers/9780814751213.jpg?auto=format&w=145",
192192
"title": "The Gender Line"
193193
},
194194
{
@@ -197,7 +197,7 @@
197197
"isbn": "9781479804948",
198198
"publicationDate": "2019",
199199
"subtitle": "The Geography of Digital Distribution",
200-
"thumbnail": "/open-square-reader/epub_content/9781479804948/ops/images/9781479804948-th.jpg",
200+
"thumbnail": "https://nyu-opensquare-us.imgix.net/covers/9781479804948.jpg?auto=format&w=145",
201201
"title": "Netflix Nations"
202202
},
203203
{
@@ -206,7 +206,7 @@
206206
"isbn": "9780814712771",
207207
"publicationDate": "1995",
208208
"subtitle": "",
209-
"thumbnail": "/open-square-reader/epub_content/9780814712771/ops/images/9780814712771-th.jpg",
209+
"thumbnail": "https://nyu-opensquare-us.imgix.net/covers/9780814712771.jpg?auto=format&w=145",
210210
"title": "The Prostitution of Sexuality"
211211
},
212212
{
@@ -215,7 +215,7 @@
215215
"isbn": "9780814713266",
216216
"publicationDate": "1998",
217217
"subtitle": "American Culture and the Vietnam War",
218-
"thumbnail": "/open-square-reader/epub_content/9780814713266/ops/images/9780814713266-th.jpg",
218+
"thumbnail": "https://nyu-opensquare-us.imgix.net/covers/9780814713266.jpg?auto=format&w=145",
219219
"title": "The Scar That Binds"
220220
},
221221
{
@@ -224,7 +224,7 @@
224224
"isbn": "9780814715352",
225225
"publicationDate": "1996",
226226
"subtitle": "Western Responses to Genocide in Bosnia",
227-
"thumbnail": "/open-square-reader/epub_content/9780814715352/ops/images/9780814715352-th.jpg",
227+
"thumbnail": "https://nyu-opensquare-us.imgix.net/covers/9780814715352.jpg?auto=format&w=145",
228228
"title": "This Time We Knew"
229229
},
230230
{
@@ -233,7 +233,7 @@
233233
"isbn": "9780814715123",
234234
"publicationDate": "1993",
235235
"subtitle": "The Rejuvenation of the American Labor Movement",
236-
"thumbnail": "/open-square-reader/epub_content/9780814715123/ops/images/9780814715123-th.jpg",
236+
"thumbnail": "https://nyu-opensquare-us.imgix.net/covers/9780814715123.jpg?auto=format&w=145",
237237
"title": "Can Unions Survive?"
238238
}
239239
],

tests/browser/tests/testdata/golden/search-results/1c0d271fb00677854528c46d8faf2e5db744aae3b49d4a3d87a9aa4d41b98485.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"isbn": "9780814730911",
99
"publicationDate": "1994",
1010
"subtitle": "<mark>Law</mark> and <mark>Science</mark> in America",
11-
"thumbnail": "/open-square-reader/epub_content/9780814730911/ops/images/9780814730911-th.jpg",
11+
"thumbnail": "https://nyu-opensquare-us.imgix.net/covers/9780814730911.jpg?auto=format&w=145",
1212
"title": "Culture Clash"
1313
}
1414
],

0 commit comments

Comments
 (0)