add-to-homescreen-rails 3.0.8.1 → 3.1.0
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 569f945dd07d08286f2175be4beaf7c541b580e2
|
4
|
+
data.tar.gz: b68e67b306efac6293f635964be2c66b9b6850d4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ba659381d1c13bcd165f2b04a99b2fa7f40cbd2d4f98b39fefadc7580ba9156ee205465b1b3b51731ec7bd94f987e13bba2ff27fc3fc7b3873b6d5e504aab916
|
7
|
+
data.tar.gz: 25131d6ec0ccf7eab4d05dd3b0da075fe83c9d371f759230811b37d518207026cce0d2f37befd96445116f476fbef92d911940d052388a0cb2542069e2d09894
|
@@ -1,4 +1,4 @@
|
|
1
|
-
/* Add to Homescreen v3.0
|
1
|
+
/* Add to Homescreen v3.1.0 ~ (c) 2014 Matteo Spinelli ~ @license: http://cubiq.org/license */
|
2
2
|
(function (window, document) {
|
3
3
|
/*
|
4
4
|
_ _ _____ _____
|
@@ -8,6 +8,11 @@
|
|
8
8
|
by Matteo Spinelli ~ http://cubiq.org
|
9
9
|
*/
|
10
10
|
|
11
|
+
// Check for addEventListener browser support (<IE9)
|
12
|
+
if ( !window.addEventListener ) {
|
13
|
+
return;
|
14
|
+
}
|
15
|
+
|
11
16
|
// Check if document is loaded, needed by autostart
|
12
17
|
var _DOMReady = false;
|
13
18
|
if ( document.readyState === 'complete' ) {
|
@@ -36,53 +41,68 @@ function ath (options) {
|
|
36
41
|
// message in all supported languages
|
37
42
|
ath.intl = {
|
38
43
|
de_de: {
|
39
|
-
|
40
|
-
|
44
|
+
ios: 'Um diese Web-App zum Home-Bildschirm hinzuzufügen, tippen Sie auf %icon und dann <strong>Zum Home-Bildschirm</strong>.',
|
45
|
+
android: 'To add this web app to the home screen open the browser option menu and tap on <strong>Add to homescreen</strong>. <small>The menu can be accessed by pressing the menu hardware button if your device has one, or by tapping the top right menu icon <span class="ath-action-icon">icon</span>.</small>',
|
41
46
|
},
|
42
47
|
|
43
48
|
en_us: {
|
44
|
-
|
45
|
-
|
49
|
+
ios: 'To add this web app to the home screen: tap %icon and then <strong>Add to Home Screen</strong>.',
|
50
|
+
android: 'To add this web app to the home screen open the browser option menu and tap on <strong>Add to homescreen</strong>. <small>The menu can be accessed by pressing the menu hardware button if your device has one, or by tapping the top right menu icon <span class="ath-action-icon">icon</span>.</small>',
|
46
51
|
},
|
47
52
|
|
48
53
|
es_es: {
|
49
|
-
|
50
|
-
|
54
|
+
ios: 'Para añadir esta aplicación web a la pantalla de inicio: pulsa %icon y selecciona <strong>Añadir a pantalla de inicio</strong>.',
|
55
|
+
android: 'To add this web app to the home screen open the browser option menu and tap on <strong>Add to homescreen</strong>. <small>The menu can be accessed by pressing the menu hardware button if your device has one, or by tapping the top right menu icon <span class="ath-action-icon">icon</span>.</small>',
|
51
56
|
},
|
52
57
|
|
53
58
|
fr_fr: {
|
54
|
-
|
55
|
-
|
59
|
+
ios: 'Pour ajouter cette application web sur l\'écran d\'accueil : Appuyez %icon et sélectionnez <strong>Ajouter sur l\'écran d\'accueil</strong>.',
|
60
|
+
android: 'To add this web app to the home screen open the browser option menu and tap on <strong>Add to homescreen</strong>. <small>The menu can be accessed by pressing the menu hardware button if your device has one, or by tapping the top right menu icon <span class="ath-action-icon">icon</span>.</small>',
|
61
|
+
},
|
62
|
+
|
63
|
+
he_il: {
|
64
|
+
ios: '<span dir="rtl">להוספת האפליקציה למסך הבית: ללחוץ על %icon ואז <strong>הוסף למסך הבית</strong>.</span>',
|
65
|
+
android: 'To add this web app to the home screen open the browser option menu and tap on <strong>Add to homescreen</strong>. <small>The menu can be accessed by pressing the menu hardware button if your device has one, or by tapping the top right menu icon <span class="ath-action-icon">icon</span>.</small>',
|
56
66
|
},
|
57
67
|
|
58
68
|
it_it: {
|
59
|
-
|
60
|
-
|
69
|
+
ios: 'Per aggiungere questa web app alla schermata iniziale: premi %icon e poi <strong>Aggiungi a Home</strong>.',
|
70
|
+
android: 'Per aggiungere questa web app alla schermata iniziale, apri il menu opzioni del browser e premi su <strong>Aggiungi alla homescreen</strong>. <small>Puoi accedere al menu premendo il pulsante hardware delle opzioni se la tua device ne ha uno, oppure premendo l\'icona <span class="ath-action-icon">icon</span> in alto a destra.</small>',
|
61
71
|
},
|
62
72
|
|
63
73
|
nb_no: {
|
64
|
-
|
65
|
-
|
74
|
+
ios: 'For å installere denne appen på hjem-skjermen: trykk på %icon og deretter <strong>Legg til på Hjem-skjerm</strong>.',
|
75
|
+
android: 'To add this web app to the home screen open the browser option menu and tap on <strong>Add to homescreen</strong>. <small>The menu can be accessed by pressing the menu hardware button if your device has one, or by tapping the top right menu icon <span class="ath-action-icon">icon</span>.</small>',
|
76
|
+
},
|
77
|
+
|
78
|
+
pt_br: {
|
79
|
+
ios: 'Para adicionar este app à tela de início: clique %icon e então <strong>Tela de início</strong>.',
|
80
|
+
android: 'To add this web app to the home screen open the browser option menu and tap on <strong>Add to homescreen</strong>. <small>The menu can be accessed by pressing the menu hardware button if your device has one, or by tapping the top right menu icon <span class="ath-action-icon">icon</span>.</small>',
|
81
|
+
},
|
82
|
+
|
83
|
+
pt_pt: {
|
84
|
+
ios: 'Para adicionar esta app ao ecrã principal: clique %icon e depois <strong>Ecrã principal</strong>.',
|
85
|
+
android: 'To add this web app to the home screen open the browser option menu and tap on <strong>Add to homescreen</strong>. <small>The menu can be accessed by pressing the menu hardware button if your device has one, or by tapping the top right menu icon <span class="ath-action-icon">icon</span>.</small>',
|
66
86
|
},
|
67
87
|
|
68
88
|
nl_nl: {
|
69
|
-
|
70
|
-
|
89
|
+
ios: 'Om deze webapp op je telefoon te installeren, klik op %icon en dan <strong>Zet in beginscherm</strong>.',
|
90
|
+
android: 'To add this web app to the home screen open the browser option menu and tap on <strong>Add to homescreen</strong>. <small>The menu can be accessed by pressing the menu hardware button if your device has one, or by tapping the top right menu icon <span class="ath-action-icon">icon</span>.</small>',
|
71
91
|
},
|
72
92
|
|
73
93
|
sv_se: {
|
74
|
-
|
75
|
-
|
94
|
+
ios: 'För att lägga till denna webbapplikation på hemskärmen: tryck på %icon och därefter <strong>Lägg till på hemskärmen</strong>.',
|
95
|
+
android: 'To add this web app to the home screen open the browser option menu and tap on <strong>Add to homescreen</strong>. <small>The menu can be accessed by pressing the menu hardware button if your device has one, or by tapping the top right menu icon <span class="ath-action-icon">icon</span>.</small>',
|
76
96
|
},
|
77
97
|
|
78
98
|
zh_cn: {
|
79
|
-
|
80
|
-
|
99
|
+
ios: '如要把应用程式加至主屏幕,请点击%icon, 然后<strong>加至主屏幕</strong>',
|
100
|
+
android: 'To add this web app to the home screen open the browser option menu and tap on <strong>Add to homescreen</strong>. <small>The menu can be accessed by pressing the menu hardware button if your device has one, or by tapping the top right menu icon <span class="ath-action-icon">icon</span>.</small>',
|
81
101
|
},
|
82
102
|
|
83
103
|
zh_tw: {
|
84
|
-
|
85
|
-
|
104
|
+
ios: '如要把應用程式加至主屏幕, 請點擊%icon, 然後<strong>加至主屏幕</strong>.',
|
105
|
+
android: 'To add this web app to the home screen open the browser option menu and tap on <strong>Add to homescreen</strong>. <small>The menu can be accessed by pressing the menu hardware button if your device has one, or by tapping the top right menu icon <span class="ath-action-icon">icon</span>.</small>',
|
86
106
|
}
|
87
107
|
};
|
88
108
|
|
@@ -112,6 +132,7 @@ ath.defaults = {
|
|
112
132
|
onRemove: null, // executed when the message is removed
|
113
133
|
onAdd: null, // when the application is launched the first time from the homescreen (guesstimate)
|
114
134
|
onPrivate: null, // executed if user is in private mode
|
135
|
+
privateModeOverride: false, // show the message even in private mode (very rude)
|
115
136
|
detectHomescreen: false // try to detect if the site has been added to the homescreen (false | true | 'hash' | 'queryString' | 'smartURL')
|
116
137
|
};
|
117
138
|
|
@@ -287,7 +308,7 @@ ath.Class = function (options) {
|
|
287
308
|
}
|
288
309
|
|
289
310
|
// we do no show the message in private mode
|
290
|
-
if ( !ath.hasLocalStorage ) {
|
311
|
+
if ( !this.options.privateModeOverride && !ath.hasLocalStorage ) {
|
291
312
|
return;
|
292
313
|
}
|
293
314
|
|
@@ -376,11 +397,11 @@ ath.Class.prototype = {
|
|
376
397
|
var message = '';
|
377
398
|
|
378
399
|
if ( this.options.message in ath.intl ) { // you can force the locale
|
379
|
-
message = ath.intl[this.options.message]
|
400
|
+
message = ath.intl[this.options.message][ath.OS];
|
380
401
|
} else if ( this.options.message !== '' ) { // or use a custom message
|
381
402
|
message = this.options.message;
|
382
403
|
} else { // otherwise we use our message
|
383
|
-
message = ath.intl[ath.language]
|
404
|
+
message = ath.intl[ath.language][ath.OS];
|
384
405
|
}
|
385
406
|
|
386
407
|
// add the action icon
|
@@ -400,9 +421,9 @@ ath.Class.prototype = {
|
|
400
421
|
// create the actual message element
|
401
422
|
this.element = document.createElement('div');
|
402
423
|
this.element.className = 'ath-container ath-' + ath.OS + ' ath-' + ath.OS + (ath.OSVersion + '').substr(0,1) + ' ath-' + (ath.isTablet ? 'tablet' : 'phone');
|
403
|
-
this.element.style.cssText = '-webkit-transition-property:-webkit-transform,opacity;-webkit-transition-duration:
|
424
|
+
this.element.style.cssText = '-webkit-transition-property:-webkit-transform,opacity;-webkit-transition-duration:0s;-webkit-transition-timing-function:ease-out;transition-property:transform,opacity;transition-duration:0s;transition-timing-function:ease-out;';
|
404
425
|
this.element.style.webkitTransform = 'translate3d(0,-' + window.innerHeight + 'px,0)';
|
405
|
-
this.element.style.
|
426
|
+
this.element.style.transform = 'translate3d(0,-' + window.innerHeight + 'px,0)';
|
406
427
|
|
407
428
|
// add the application icon
|
408
429
|
if ( this.options.icon && this.applicationIcon ) {
|
@@ -460,8 +481,10 @@ ath.Class.prototype = {
|
|
460
481
|
|
461
482
|
// kick the animation
|
462
483
|
setTimeout(function () {
|
463
|
-
that.element.style.webkitTransform = 'translate3d(0,0,0)';
|
464
484
|
that.element.style.webkitTransitionDuration = '1.2s';
|
485
|
+
that.element.style.transitionDuration = '1.2s';
|
486
|
+
that.element.style.webkitTransform = 'translate3d(0,0,0)';
|
487
|
+
that.element.style.transform = 'translate3d(0,0,0)';
|
465
488
|
}, 0);
|
466
489
|
|
467
490
|
// set the destroy timer
|
@@ -49,6 +49,13 @@
|
|
49
49
|
text-align: center;
|
50
50
|
}
|
51
51
|
|
52
|
+
.ath-container small {
|
53
|
+
font-size: 0.8em;
|
54
|
+
line-height: 1.3em;
|
55
|
+
display: block;
|
56
|
+
margin-top: 0.5em;
|
57
|
+
}
|
58
|
+
|
52
59
|
.ath-ios.ath-phone {
|
53
60
|
bottom: 1.8em;
|
54
61
|
left: 50%;
|
@@ -71,8 +78,9 @@
|
|
71
78
|
}
|
72
79
|
|
73
80
|
.ath-android {
|
74
|
-
|
75
|
-
|
81
|
+
bottom: 1.8em;
|
82
|
+
left: 50%;
|
83
|
+
margin-left: -9em;
|
76
84
|
}
|
77
85
|
|
78
86
|
/* close icon */
|
@@ -135,13 +143,6 @@
|
|
135
143
|
overflow: hidden;
|
136
144
|
}
|
137
145
|
|
138
|
-
.ath-android .ath-action-icon {
|
139
|
-
width: 1.2em;
|
140
|
-
height: 1.8em;
|
141
|
-
background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAADcBAMAAAAig/QJAAAAA3NCSVQICAjb4U/gAAAACXBIWXMAAFtDAABbQwH5xg68AAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAAAB5QTFRFAAAA////cXFxaWlp////ZmZmnJycoaGhpqam////1D9b6wAAAAV0Uk5TAAgJERExZxYzAAAAYklEQVRYw+3WoQ2AUBAE0SsBOiBUQEIDCArA4FFoHBaJxNItFYz/x5+xz282VmwJTdM0rRzbsS1e7Pm9zdgUVn491rkFmqZpSezEjqo/Sos1HoAEjdjgFmiapiWxG7tq/igfnYteFlnOWZEAAAAASUVORK5CYII=);
|
142
|
-
background-size: auto 100%;
|
143
|
-
}
|
144
|
-
|
145
146
|
.ath-ios7 .ath-action-icon,
|
146
147
|
.ath-ios8 .ath-action-icon {
|
147
148
|
width: 1.6em;
|
@@ -159,6 +160,13 @@
|
|
159
160
|
background-size: 100% auto;
|
160
161
|
}
|
161
162
|
|
163
|
+
.ath-android .ath-action-icon {
|
164
|
+
width: 1.4em;
|
165
|
+
height: 1.4em;
|
166
|
+
background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyNpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDE0IDc5LjE1MTQ4MSwgMjAxMy8wMy8xMy0xMjowOToxNSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIChNYWNpbnRvc2gpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOkE2ODRFM0VGNDc0NTExRTRCNEUxODAyMzVCNkM5RTU5IiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOkE2ODRFM0YwNDc0NTExRTRCNEUxODAyMzVCNkM5RTU5Ij4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6QTY4NEUzRUQ0NzQ1MTFFNEI0RTE4MDIzNUI2QzlFNTkiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6QTY4NEUzRUU0NzQ1MTFFNEI0RTE4MDIzNUI2QzlFNTkiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz7bs1dGAAABKElEQVR42uyXywnCQBRFxyCxCFsQ/CzUGtQGdOfGuBJbcWcqsAGtwY2Iii1YgbhQF/EOvEAQ/ARnkhHug7NwvJC5hDBzClEUqV8nCILkTx+MQR9UZO0IFmAObnEwDMOfn11UZqcMlqD2tN4WhqAHTqYe6BncvP9i88nR/61AycUCwYfNx1MFIxcLDCxlMyvQSJGtu1ggzdxdLLBNkT26WGBhKZtZAX0q7b/IHSTrXIEr6ILdm4wu2JGskx+xPmFbYAo24CJsZK1p8hS2cZVQcteZCdanYOIyl+d46s+HBfIeIx/xk9B8f3AYEBobb0B7wQSswVlYy5rv5BugkdHIaGQ0MhoZjYxGRiOjkdEHWIBGRiOjkdHIaGQ0MhoZjYxGRiPL1sgeAgwApeJtJOoNgAYAAAAASUVORK5CYII=);
|
167
|
+
background-size: 100% auto;
|
168
|
+
}
|
169
|
+
|
162
170
|
.ath-container p {
|
163
171
|
margin: 0;
|
164
172
|
padding: 0;
|
@@ -196,17 +204,6 @@
|
|
196
204
|
z-index: 2147483641;
|
197
205
|
}
|
198
206
|
|
199
|
-
.ath-android:after {
|
200
|
-
content: '';
|
201
|
-
background: #eee;
|
202
|
-
background: -webkit-linear-gradient(-45deg, rgba(238,238,238,0) 0%,rgba(238,238,238,0) 50%,rgba(238,238,238,1) 50%,rgba(238,238,238,1) 100%);
|
203
|
-
position: absolute;
|
204
|
-
width: 2em;
|
205
|
-
height: 2em;
|
206
|
-
top: -1.5em;
|
207
|
-
right: 0;
|
208
|
-
}
|
209
|
-
|
210
207
|
.ath-application-icon {
|
211
208
|
position: relative;
|
212
209
|
padding: 0;
|
@@ -229,6 +226,10 @@
|
|
229
226
|
width: 24em;
|
230
227
|
}
|
231
228
|
|
229
|
+
.ath-android.ath-phone {
|
230
|
+
margin-left: -12em;
|
231
|
+
}
|
232
|
+
|
232
233
|
.ath-ios.ath-phone {
|
233
234
|
margin-left: -12em;
|
234
235
|
}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: add-to-homescreen-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0
|
4
|
+
version: 3.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- RogerE
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-11-19 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Provides the 'Add to Home screen' assets for your Rails application.
|
14
14
|
email:
|