im_reader 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +11 -0
- data/Gemfile +9 -0
- data/Gemfile.lock +44 -0
- data/LICENSE.txt +21 -0
- data/README.md +110 -0
- data/Rakefile +8 -0
- data/app/assets/fonts/im_reader/icons.ttf +0 -0
- data/app/assets/fonts/im_reader/icons.woff +0 -0
- data/app/assets/fonts/im_reader/icons.woff2 +0 -0
- data/app/assets/images/im_reader/logo_colore.svg +26 -0
- data/app/assets/javascripts/im_reader/epub.min.js +1 -0
- data/app/assets/javascripts/im_reader/jszip.min.js +13 -0
- data/app/assets/javascripts/im_reader/reader.js +144 -0
- data/app/assets/javascripts/im_reader/semantic/progress.js +793 -0
- data/app/assets/javascripts/im_reader/semantic/sidebar.js +1022 -0
- data/app/assets/javascripts/im_reader/semantic-ui.js +2 -0
- data/app/assets/stylesheets/im_reader/reader.scss +127 -0
- data/app/assets/stylesheets/im_reader/semantic/button.scss +3172 -0
- data/app/assets/stylesheets/im_reader/semantic/colors.scss +15 -0
- data/app/assets/stylesheets/im_reader/semantic/container.scss +154 -0
- data/app/assets/stylesheets/im_reader/semantic/grid.scss +2029 -0
- data/app/assets/stylesheets/im_reader/semantic/header.scss +719 -0
- data/app/assets/stylesheets/im_reader/semantic/icon.scss +2587 -0
- data/app/assets/stylesheets/im_reader/semantic/item.scss +482 -0
- data/app/assets/stylesheets/im_reader/semantic/menu.scss +2054 -0
- data/app/assets/stylesheets/im_reader/semantic/progress.scss +517 -0
- data/app/controllers/im_reader/application_controller.rb +8 -0
- data/app/controllers/im_reader/epub_reader_controller.rb +62 -0
- data/app/views/im_reader/epub_reader/show.html.erb +38 -0
- data/app/views/layouts/im_reader/epub_reader.html.erb +23 -0
- data/config/locales/de.yml +10 -0
- data/config/locales/en.yml +10 -0
- data/config/locales/es.yml +10 -0
- data/config/locales/fr.yml +10 -0
- data/config/locales/pt.yml +10 -0
- data/config/routes.rb +4 -0
- data/im_reader.gemspec +33 -0
- data/lib/im_reader/engine.rb +32 -0
- data/lib/im_reader/version.rb +5 -0
- data/lib/im_reader.rb +8 -0
- data/sig/im_reader.rbs +4 -0
- data/spec/im_reader_spec.rb +11 -0
- data/spec/spec_helper.rb +15 -0
- metadata +115 -0
|
@@ -0,0 +1,517 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* # Semantic UI 2.1.4 - Progress Bar
|
|
3
|
+
* http://github.com/semantic-org/semantic-ui/
|
|
4
|
+
*
|
|
5
|
+
*
|
|
6
|
+
* Copyright 2015 Contributors
|
|
7
|
+
* Released under the MIT license
|
|
8
|
+
* http://opensource.org/licenses/MIT
|
|
9
|
+
*
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
/*******************************
|
|
14
|
+
Progress
|
|
15
|
+
*******************************/
|
|
16
|
+
|
|
17
|
+
.ui.progress {
|
|
18
|
+
position: relative;
|
|
19
|
+
display: block;
|
|
20
|
+
max-width: 100%;
|
|
21
|
+
border: none;
|
|
22
|
+
margin: 1em 0em 2.5em;
|
|
23
|
+
box-shadow: none;
|
|
24
|
+
background: rgba(0, 0, 0, 0.1);
|
|
25
|
+
padding: 0em;
|
|
26
|
+
border-radius: 0.28571429rem;
|
|
27
|
+
}
|
|
28
|
+
.ui.progress:first-child {
|
|
29
|
+
margin: 0em 0em 2.5em;
|
|
30
|
+
}
|
|
31
|
+
.ui.progress:last-child {
|
|
32
|
+
margin: 0em 0em 1.5em;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
/*******************************
|
|
37
|
+
Content
|
|
38
|
+
*******************************/
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
/* Activity Bar */
|
|
42
|
+
.ui.progress .bar {
|
|
43
|
+
display: block;
|
|
44
|
+
line-height: 1;
|
|
45
|
+
position: relative;
|
|
46
|
+
width: 0%;
|
|
47
|
+
min-width: 2em;
|
|
48
|
+
background: #888888;
|
|
49
|
+
border-radius: 0.28571429rem;
|
|
50
|
+
-webkit-transition: width 0.1s ease, background-color 0.1s ease;
|
|
51
|
+
transition: width 0.1s ease, background-color 0.1s ease;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/* Percent Complete */
|
|
55
|
+
.ui.progress .bar > .progress {
|
|
56
|
+
white-space: nowrap;
|
|
57
|
+
position: absolute;
|
|
58
|
+
width: auto;
|
|
59
|
+
font-size: 0.92857143em;
|
|
60
|
+
top: 50%;
|
|
61
|
+
right: 0.5em;
|
|
62
|
+
left: auto;
|
|
63
|
+
bottom: auto;
|
|
64
|
+
color: rgba(255, 255, 255, 0.7);
|
|
65
|
+
text-shadow: none;
|
|
66
|
+
margin-top: -0.5em;
|
|
67
|
+
font-weight: bold;
|
|
68
|
+
text-align: left;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/* Label */
|
|
72
|
+
.ui.progress > .label {
|
|
73
|
+
position: absolute;
|
|
74
|
+
width: 100%;
|
|
75
|
+
font-size: 1em;
|
|
76
|
+
top: 100%;
|
|
77
|
+
right: auto;
|
|
78
|
+
left: 0%;
|
|
79
|
+
bottom: auto;
|
|
80
|
+
color: rgba(0, 0, 0, 0.87);
|
|
81
|
+
font-weight: bold;
|
|
82
|
+
text-shadow: none;
|
|
83
|
+
margin-top: 0.2em;
|
|
84
|
+
text-align: center;
|
|
85
|
+
-webkit-transition: color 0.4s ease;
|
|
86
|
+
transition: color 0.4s ease;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
/*******************************
|
|
91
|
+
Types
|
|
92
|
+
*******************************/
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
/* Indicating */
|
|
96
|
+
.ui.indicating.progress[data-percent^="1"] .bar,
|
|
97
|
+
.ui.indicating.progress[data-percent^="2"] .bar {
|
|
98
|
+
background-color: #d95c5c;
|
|
99
|
+
}
|
|
100
|
+
.ui.indicating.progress[data-percent^="3"] .bar {
|
|
101
|
+
background-color: #efbc72;
|
|
102
|
+
}
|
|
103
|
+
.ui.indicating.progress[data-percent^="4"] .bar,
|
|
104
|
+
.ui.indicating.progress[data-percent^="5"] .bar {
|
|
105
|
+
background-color: #e6bb48;
|
|
106
|
+
}
|
|
107
|
+
.ui.indicating.progress[data-percent^="6"] .bar {
|
|
108
|
+
background-color: #ddc928;
|
|
109
|
+
}
|
|
110
|
+
.ui.indicating.progress[data-percent^="7"] .bar,
|
|
111
|
+
.ui.indicating.progress[data-percent^="8"] .bar {
|
|
112
|
+
background-color: #b4d95c;
|
|
113
|
+
}
|
|
114
|
+
.ui.indicating.progress[data-percent^="9"] .bar,
|
|
115
|
+
.ui.indicating.progress[data-percent^="100"] .bar {
|
|
116
|
+
background-color: #66da81;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/* Indicating Label */
|
|
120
|
+
.ui.indicating.progress[data-percent^="1"] .label,
|
|
121
|
+
.ui.indicating.progress[data-percent^="2"] .label {
|
|
122
|
+
color: rgba(0, 0, 0, 0.87);
|
|
123
|
+
}
|
|
124
|
+
.ui.indicating.progress[data-percent^="3"] .label {
|
|
125
|
+
color: rgba(0, 0, 0, 0.87);
|
|
126
|
+
}
|
|
127
|
+
.ui.indicating.progress[data-percent^="4"] .label,
|
|
128
|
+
.ui.indicating.progress[data-percent^="5"] .label {
|
|
129
|
+
color: rgba(0, 0, 0, 0.87);
|
|
130
|
+
}
|
|
131
|
+
.ui.indicating.progress[data-percent^="6"] .label {
|
|
132
|
+
color: rgba(0, 0, 0, 0.87);
|
|
133
|
+
}
|
|
134
|
+
.ui.indicating.progress[data-percent^="7"] .label,
|
|
135
|
+
.ui.indicating.progress[data-percent^="8"] .label {
|
|
136
|
+
color: rgba(0, 0, 0, 0.87);
|
|
137
|
+
}
|
|
138
|
+
.ui.indicating.progress[data-percent^="9"] .label,
|
|
139
|
+
.ui.indicating.progress[data-percent^="100"] .label {
|
|
140
|
+
color: rgba(0, 0, 0, 0.87);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/* Single Digits */
|
|
144
|
+
.ui.indicating.progress[data-percent="1"] .bar,
|
|
145
|
+
.ui.indicating.progress[data-percent="2"] .bar,
|
|
146
|
+
.ui.indicating.progress[data-percent="3"] .bar,
|
|
147
|
+
.ui.indicating.progress[data-percent="4"] .bar,
|
|
148
|
+
.ui.indicating.progress[data-percent="5"] .bar,
|
|
149
|
+
.ui.indicating.progress[data-percent="6"] .bar,
|
|
150
|
+
.ui.indicating.progress[data-percent="7"] .bar,
|
|
151
|
+
.ui.indicating.progress[data-percent="8"] .bar,
|
|
152
|
+
.ui.indicating.progress[data-percent="9"] .bar {
|
|
153
|
+
background-color: #d95c5c;
|
|
154
|
+
}
|
|
155
|
+
.ui.indicating.progress[data-percent="1"] .label,
|
|
156
|
+
.ui.indicating.progress[data-percent="2"] .label,
|
|
157
|
+
.ui.indicating.progress[data-percent="3"] .label,
|
|
158
|
+
.ui.indicating.progress[data-percent="4"] .label,
|
|
159
|
+
.ui.indicating.progress[data-percent="5"] .label,
|
|
160
|
+
.ui.indicating.progress[data-percent="6"] .label,
|
|
161
|
+
.ui.indicating.progress[data-percent="7"] .label,
|
|
162
|
+
.ui.indicating.progress[data-percent="8"] .label,
|
|
163
|
+
.ui.indicating.progress[data-percent="9"] .label {
|
|
164
|
+
color: rgba(0, 0, 0, 0.87);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
/* Indicating Success */
|
|
168
|
+
.ui.indicating.progress.success .label {
|
|
169
|
+
color: #1a531b;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
/*******************************
|
|
174
|
+
States
|
|
175
|
+
*******************************/
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
/*--------------
|
|
179
|
+
Success
|
|
180
|
+
---------------*/
|
|
181
|
+
|
|
182
|
+
.ui.progress.success .bar {
|
|
183
|
+
background-color: #21ba45 !important;
|
|
184
|
+
}
|
|
185
|
+
.ui.progress.success .bar,
|
|
186
|
+
.ui.progress.success .bar::after {
|
|
187
|
+
-webkit-animation: none !important;
|
|
188
|
+
animation: none !important;
|
|
189
|
+
}
|
|
190
|
+
.ui.progress.success > .label {
|
|
191
|
+
color: #1a531b;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
/*--------------
|
|
195
|
+
Warning
|
|
196
|
+
---------------*/
|
|
197
|
+
|
|
198
|
+
.ui.progress.warning .bar {
|
|
199
|
+
background-color: #f2c037 !important;
|
|
200
|
+
}
|
|
201
|
+
.ui.progress.warning .bar,
|
|
202
|
+
.ui.progress.warning .bar::after {
|
|
203
|
+
-webkit-animation: none !important;
|
|
204
|
+
animation: none !important;
|
|
205
|
+
}
|
|
206
|
+
.ui.progress.warning > .label {
|
|
207
|
+
color: #794b02;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
/*--------------
|
|
211
|
+
Error
|
|
212
|
+
---------------*/
|
|
213
|
+
|
|
214
|
+
.ui.progress.error .bar {
|
|
215
|
+
background-color: #db2828 !important;
|
|
216
|
+
}
|
|
217
|
+
.ui.progress.error .bar,
|
|
218
|
+
.ui.progress.error .bar::after {
|
|
219
|
+
-webkit-animation: none !important;
|
|
220
|
+
animation: none !important;
|
|
221
|
+
}
|
|
222
|
+
.ui.progress.error > .label {
|
|
223
|
+
color: #912d2b;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
/*--------------
|
|
227
|
+
Active
|
|
228
|
+
---------------*/
|
|
229
|
+
|
|
230
|
+
.ui.active.progress .bar {
|
|
231
|
+
position: relative;
|
|
232
|
+
min-width: 2em;
|
|
233
|
+
}
|
|
234
|
+
.ui.active.progress .bar::after {
|
|
235
|
+
content: '';
|
|
236
|
+
opacity: 0;
|
|
237
|
+
position: absolute;
|
|
238
|
+
top: 0px;
|
|
239
|
+
left: 0px;
|
|
240
|
+
right: 0px;
|
|
241
|
+
bottom: 0px;
|
|
242
|
+
background: #ffffff;
|
|
243
|
+
border-radius: 0.28571429rem;
|
|
244
|
+
-webkit-animation: progress-active 2s ease infinite;
|
|
245
|
+
animation: progress-active 2s ease infinite;
|
|
246
|
+
}
|
|
247
|
+
@-webkit-keyframes progress-active {
|
|
248
|
+
0% {
|
|
249
|
+
opacity: 0.3;
|
|
250
|
+
width: 0;
|
|
251
|
+
}
|
|
252
|
+
100% {
|
|
253
|
+
opacity: 0;
|
|
254
|
+
width: 100%;
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
@keyframes progress-active {
|
|
258
|
+
0% {
|
|
259
|
+
opacity: 0.3;
|
|
260
|
+
width: 0;
|
|
261
|
+
}
|
|
262
|
+
100% {
|
|
263
|
+
opacity: 0;
|
|
264
|
+
width: 100%;
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
/*--------------
|
|
269
|
+
Disabled
|
|
270
|
+
---------------*/
|
|
271
|
+
|
|
272
|
+
.ui.disabled.progress {
|
|
273
|
+
opacity: 0.35;
|
|
274
|
+
}
|
|
275
|
+
.ui.disabled.progress .bar,
|
|
276
|
+
.ui.disabled.progress .bar::after {
|
|
277
|
+
-webkit-animation: none !important;
|
|
278
|
+
animation: none !important;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
|
|
282
|
+
/*******************************
|
|
283
|
+
Variations
|
|
284
|
+
*******************************/
|
|
285
|
+
|
|
286
|
+
|
|
287
|
+
/*--------------
|
|
288
|
+
Inverted
|
|
289
|
+
---------------*/
|
|
290
|
+
|
|
291
|
+
.ui.inverted.progress {
|
|
292
|
+
background: rgba(255, 255, 255, 0.08);
|
|
293
|
+
border: none;
|
|
294
|
+
}
|
|
295
|
+
.ui.inverted.progress .bar {
|
|
296
|
+
background: #888888;
|
|
297
|
+
}
|
|
298
|
+
.ui.inverted.progress .bar > .progress {
|
|
299
|
+
color: #f9fafb;
|
|
300
|
+
}
|
|
301
|
+
.ui.inverted.progress > .label {
|
|
302
|
+
color: #ffffff;
|
|
303
|
+
}
|
|
304
|
+
.ui.inverted.progress.success > .label {
|
|
305
|
+
color: #21ba45;
|
|
306
|
+
}
|
|
307
|
+
.ui.inverted.progress.warning > .label {
|
|
308
|
+
color: #f2c037;
|
|
309
|
+
}
|
|
310
|
+
.ui.inverted.progress.error > .label {
|
|
311
|
+
color: #db2828;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
/*--------------
|
|
315
|
+
Attached
|
|
316
|
+
---------------*/
|
|
317
|
+
|
|
318
|
+
|
|
319
|
+
/* bottom attached */
|
|
320
|
+
.ui.progress.attached {
|
|
321
|
+
background: transparent;
|
|
322
|
+
position: relative;
|
|
323
|
+
border: none;
|
|
324
|
+
margin: 0em;
|
|
325
|
+
}
|
|
326
|
+
.ui.progress.attached,
|
|
327
|
+
.ui.progress.attached .bar {
|
|
328
|
+
display: block;
|
|
329
|
+
height: 0.2rem;
|
|
330
|
+
padding: 0px;
|
|
331
|
+
overflow: hidden;
|
|
332
|
+
border-radius: 0em 0em 0.28571429rem 0.28571429rem;
|
|
333
|
+
}
|
|
334
|
+
.ui.progress.attached .bar {
|
|
335
|
+
border-radius: 0em;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
/* top attached */
|
|
339
|
+
.ui.progress.top.attached,
|
|
340
|
+
.ui.progress.top.attached .bar {
|
|
341
|
+
top: 0px;
|
|
342
|
+
border-radius: 0.28571429rem 0.28571429rem 0em 0em;
|
|
343
|
+
}
|
|
344
|
+
.ui.progress.top.attached .bar {
|
|
345
|
+
border-radius: 0em;
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
/* Coupling */
|
|
349
|
+
.ui.segment > .ui.attached.progress,
|
|
350
|
+
.ui.card > .ui.attached.progress {
|
|
351
|
+
position: absolute;
|
|
352
|
+
top: auto;
|
|
353
|
+
left: 0;
|
|
354
|
+
bottom: 100%;
|
|
355
|
+
width: 100%;
|
|
356
|
+
}
|
|
357
|
+
.ui.segment > .ui.bottom.attached.progress,
|
|
358
|
+
.ui.card > .ui.bottom.attached.progress {
|
|
359
|
+
top: 100%;
|
|
360
|
+
bottom: auto;
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
/*--------------
|
|
364
|
+
Colors
|
|
365
|
+
---------------*/
|
|
366
|
+
|
|
367
|
+
|
|
368
|
+
/* Red */
|
|
369
|
+
.ui.red.progress .bar {
|
|
370
|
+
background-color: #db2828;
|
|
371
|
+
}
|
|
372
|
+
.ui.red.inverted.progress .bar {
|
|
373
|
+
background-color: #ff695e;
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
/* Orange */
|
|
377
|
+
.ui.orange.progress .bar {
|
|
378
|
+
background-color: #f2711c;
|
|
379
|
+
}
|
|
380
|
+
.ui.orange.inverted.progress .bar {
|
|
381
|
+
background-color: #ff851b;
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
/* Yellow */
|
|
385
|
+
.ui.yellow.progress .bar {
|
|
386
|
+
background-color: #fbbd08;
|
|
387
|
+
}
|
|
388
|
+
.ui.yellow.inverted.progress .bar {
|
|
389
|
+
background-color: #ffe21f;
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
/* Olive */
|
|
393
|
+
.ui.olive.progress .bar {
|
|
394
|
+
background-color: #b5cc18;
|
|
395
|
+
}
|
|
396
|
+
.ui.olive.inverted.progress .bar {
|
|
397
|
+
background-color: #d9e778;
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
/* Green */
|
|
401
|
+
.ui.green.progress .bar {
|
|
402
|
+
background-color: #21ba45;
|
|
403
|
+
}
|
|
404
|
+
.ui.green.inverted.progress .bar {
|
|
405
|
+
background-color: #2ecc40;
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
/* Teal */
|
|
409
|
+
.ui.teal.progress .bar {
|
|
410
|
+
background-color: #00b5ad;
|
|
411
|
+
}
|
|
412
|
+
.ui.teal.inverted.progress .bar {
|
|
413
|
+
background-color: #6dffff;
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
/* Blue */
|
|
417
|
+
.ui.blue.progress .bar {
|
|
418
|
+
background-color: #2185d0;
|
|
419
|
+
}
|
|
420
|
+
.ui.blue.inverted.progress .bar {
|
|
421
|
+
background-color: #54c8ff;
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
/* Violet */
|
|
425
|
+
.ui.violet.progress .bar {
|
|
426
|
+
background-color: #6435c9;
|
|
427
|
+
}
|
|
428
|
+
.ui.violet.inverted.progress .bar {
|
|
429
|
+
background-color: #a291fb;
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
/* Purple */
|
|
433
|
+
.ui.purple.progress .bar {
|
|
434
|
+
background-color: #a333c8;
|
|
435
|
+
}
|
|
436
|
+
.ui.purple.inverted.progress .bar {
|
|
437
|
+
background-color: #dc73ff;
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
/* Pink */
|
|
441
|
+
.ui.pink.progress .bar {
|
|
442
|
+
background-color: #e03997;
|
|
443
|
+
}
|
|
444
|
+
.ui.pink.inverted.progress .bar {
|
|
445
|
+
background-color: #ff8edf;
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
/* Brown */
|
|
449
|
+
.ui.brown.progress .bar {
|
|
450
|
+
background-color: #a5673f;
|
|
451
|
+
}
|
|
452
|
+
.ui.brown.inverted.progress .bar {
|
|
453
|
+
background-color: #d67c1c;
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
/* Grey */
|
|
457
|
+
.ui.grey.progress .bar {
|
|
458
|
+
background-color: #767676;
|
|
459
|
+
}
|
|
460
|
+
.ui.grey.inverted.progress .bar {
|
|
461
|
+
background-color: #dcddde;
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
/* Black */
|
|
465
|
+
.ui.black.progress .bar {
|
|
466
|
+
background-color: #1b1c1d;
|
|
467
|
+
}
|
|
468
|
+
.ui.black.inverted.progress .bar {
|
|
469
|
+
background-color: #545454;
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
/*--------------
|
|
473
|
+
Sizes
|
|
474
|
+
---------------*/
|
|
475
|
+
|
|
476
|
+
.ui.tiny.progress {
|
|
477
|
+
font-size: 0.85714286rem;
|
|
478
|
+
}
|
|
479
|
+
.ui.tiny.progress .bar {
|
|
480
|
+
height: 0.5em;
|
|
481
|
+
}
|
|
482
|
+
.ui.small.progress {
|
|
483
|
+
font-size: 0.92857143rem;
|
|
484
|
+
}
|
|
485
|
+
.ui.small.progress .bar {
|
|
486
|
+
height: 1em;
|
|
487
|
+
}
|
|
488
|
+
.ui.progress {
|
|
489
|
+
font-size: 1rem;
|
|
490
|
+
}
|
|
491
|
+
.ui.progress .bar {
|
|
492
|
+
height: 1.75em;
|
|
493
|
+
}
|
|
494
|
+
.ui.large.progress {
|
|
495
|
+
font-size: 1.14285714rem;
|
|
496
|
+
}
|
|
497
|
+
.ui.large.progress .bar {
|
|
498
|
+
height: 2.5em;
|
|
499
|
+
}
|
|
500
|
+
.ui.big.progress {
|
|
501
|
+
font-size: 1.28571429rem;
|
|
502
|
+
}
|
|
503
|
+
.ui.big.progress .bar {
|
|
504
|
+
height: 3.5em;
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
|
|
508
|
+
/*******************************
|
|
509
|
+
Progress
|
|
510
|
+
*******************************/
|
|
511
|
+
|
|
512
|
+
|
|
513
|
+
|
|
514
|
+
/*******************************
|
|
515
|
+
Site Overrides
|
|
516
|
+
*******************************/
|
|
517
|
+
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
module ImReader
|
|
2
|
+
class EpubReaderController < ApplicationController
|
|
3
|
+
before_action :set_locale
|
|
4
|
+
|
|
5
|
+
def show
|
|
6
|
+
@remote_url = params[:url]
|
|
7
|
+
puts "#### PLOP ####"
|
|
8
|
+
@url = im_reader.remote_epub_reader_url(url: @remote_url)
|
|
9
|
+
puts "***** OK *****"
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def remote
|
|
13
|
+
# Envoyer cette url depuis le BO immateriel
|
|
14
|
+
# @book.book_previews&.last&.download_url
|
|
15
|
+
puts "***** REMOTE 1 *****"
|
|
16
|
+
url = params[:url]
|
|
17
|
+
uri = URI.parse(url)
|
|
18
|
+
response = fetch_with_redirect(uri)
|
|
19
|
+
|
|
20
|
+
# on télécharge directement en mémoire
|
|
21
|
+
puts "***** REMOTE 2 *****"
|
|
22
|
+
|
|
23
|
+
if response.is_a?(Net::HTTPSuccess)
|
|
24
|
+
|
|
25
|
+
puts "***** REMOTE 3.1 *****"
|
|
26
|
+
send_data response.body,
|
|
27
|
+
filename: File.basename(uri.path.presence || "remote.epub"),
|
|
28
|
+
type: "application/epub+zip",
|
|
29
|
+
disposition: "inline"
|
|
30
|
+
else
|
|
31
|
+
puts "***** REMOTE 3.2 *****"
|
|
32
|
+
render plain: "Impossible de récupérer l’EPUB", status: 404
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
private
|
|
37
|
+
|
|
38
|
+
def fetch_with_redirect(uri, limit = 5)
|
|
39
|
+
raise "Too many redirects" if limit == 0
|
|
40
|
+
|
|
41
|
+
http = Net::HTTP.new(uri.host, uri.port)
|
|
42
|
+
http.use_ssl = (uri.scheme == "https")
|
|
43
|
+
http.open_timeout = 10
|
|
44
|
+
http.read_timeout = 20
|
|
45
|
+
|
|
46
|
+
response = http.get(uri.request_uri)
|
|
47
|
+
|
|
48
|
+
case response
|
|
49
|
+
when Net::HTTPRedirection
|
|
50
|
+
new_uri = URI.parse(response["location"])
|
|
51
|
+
fetch_with_redirect(new_uri, limit - 1)
|
|
52
|
+
else
|
|
53
|
+
response
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
def set_locale
|
|
58
|
+
I18n.locale = params[:locale] || I18n.default_locale
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
end
|
|
62
|
+
end
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
<div id="reader-root"
|
|
2
|
+
data-book-url="<%= @url %>"
|
|
3
|
+
data-i18n='<%= {
|
|
4
|
+
start: t("im_reader.buttons.start"),
|
|
5
|
+
loading: t("im_reader.messages.loading"),
|
|
6
|
+
book_cover: t("im_reader.elements.book_cover")
|
|
7
|
+
}.to_json %>'>
|
|
8
|
+
<aside class="ui vertical menu">
|
|
9
|
+
<div class="item logo">
|
|
10
|
+
<%= image_tag 'im_reader/logo_colore.svg', id: "logo" %>
|
|
11
|
+
</div>
|
|
12
|
+
<div class="header"><%= I18n.t('im_reader.elements.toc') %></div>
|
|
13
|
+
<div class="menu" id="toc"></div>
|
|
14
|
+
</aside>
|
|
15
|
+
|
|
16
|
+
<section>
|
|
17
|
+
<div class="ui grid">
|
|
18
|
+
<div class="three wide column center aligned">
|
|
19
|
+
<button id="prev_button" class="ui circular icon button">
|
|
20
|
+
<i class="angle left icon"></i>
|
|
21
|
+
</button>
|
|
22
|
+
</div>
|
|
23
|
+
<div class="ten wide column" id="progress_bar_container">
|
|
24
|
+
<div id="progressBar" class="ui tiny red indicating progress" data-percent="0">
|
|
25
|
+
<div class="bar"></div>
|
|
26
|
+
</div>
|
|
27
|
+
</div>
|
|
28
|
+
<div class="three wide column center aligned">
|
|
29
|
+
<button id="next_button" class="ui circular icon button">
|
|
30
|
+
<i class="angle right icon"></i>
|
|
31
|
+
</button>
|
|
32
|
+
</div>
|
|
33
|
+
</div>
|
|
34
|
+
|
|
35
|
+
<div id="viewer">
|
|
36
|
+
</div>
|
|
37
|
+
</section>
|
|
38
|
+
</div>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="<%= I18n.locale.to_s %>">
|
|
3
|
+
<head>
|
|
4
|
+
|
|
5
|
+
<%= stylesheet_link_tag "im_reader/reader", "data-turbo-track": "reload" %>
|
|
6
|
+
|
|
7
|
+
<%= javascript_include_tag 'im_reader/reader', 'data-turbolinks-track' => false %>
|
|
8
|
+
|
|
9
|
+
<%= yield :head %>
|
|
10
|
+
|
|
11
|
+
<title><%= I18n.t('im_reader.title') %></title>
|
|
12
|
+
|
|
13
|
+
<%= csrf_meta_tags %>
|
|
14
|
+
</head>
|
|
15
|
+
|
|
16
|
+
<body>
|
|
17
|
+
|
|
18
|
+
<div id="epub_reader_container">
|
|
19
|
+
<%= yield %>
|
|
20
|
+
</div>
|
|
21
|
+
<%= javascript_include_tag params[:controller] if ::Rails.application.assets_manifest.assets["#{params[:controller]}.js"] %>
|
|
22
|
+
</body>
|
|
23
|
+
</html>
|
data/config/routes.rb
ADDED