throw { name: 'FatalError', message: 'Do not call this file. If you want to use it, remove this line.' };
/*!
* Add to Homescreen v1.0.8 ~ Copyright (c) 2011 Matteo Spinelli, http://cubiq.org
* Released under MIT license, http://cubiq.org/license
*/
(function(){
var nav = navigator,
isIDevice = (/iphone|ipod|ipad/gi).test(nav.platform),
isIPad = (/ipad/gi).test(nav.platform),
isRetina = 'devicePixelRatio' in window && window.devicePixelRatio > 1,
isSafari = nav.appVersion.match(/Safari/gi),
hasHomescreen = 'standalone' in nav && isIDevice,
isStandalone = hasHomescreen && nav.standalone,
OSVersion = nav.appVersion.match(/OS \d+_\d+/g),
platform = nav.platform.split(' ')[0],
language = nav.language.replace('-', '_'),
startY = 0,
startX = 0,
expired = 'localStorage' in window && typeof localStorage.getItem === 'function' ? localStorage.getItem('_addToHome') : null,
theInterval, closeTimeout, el, i, l,
options = {
animationIn: 'drop', // drop || bubble || fade
animationOut: 'fade', // drop || bubble || fade
startDelay: 2000, // 2 seconds from page load before the balloon appears
lifespan: 20000, // 20 seconds before it is automatically destroyed
bottomOffset: 14, // Distance of the balloon from bottom
expire: 0, // Minutes to wait before showing the popup again (0 = always displayed)
message: '', // Customize your message or force a language ('' = automatic)
touchIcon: false, // Display the touch icon
arrow: true, // Display the balloon arrow
iterations:100 // Internal/debug use
},
/* Message in various languages, en_us is the default if a language does not exist */
intl = {
ca_es: 'Per instal·lar aquesta aplicació al vostre %device premeu %icon i llavors Afegir a pantalla d\'inici.',
da_dk: 'Tilføj denne side til din %device: tryk på %icon og derefter Tilføj til hjemmeskærm.',
de_de: 'Installieren Sie diese App auf Ihrem %device: %icon antippen und dann Zum Home-Bildschirm.',
el_gr: 'ÎγκαÏαÏÏήÏεÏε αÏ
Ïήν Ïην ÎÏαÏμογή ÏÏήν ÏÏ
ÏκεÏ
ή ÏÎ±Ï %device: %icon μεÏά ÏαÏάÏε Î ÏοÏθήκη Ïε ÎÏεÏηÏία.',
en_us: 'Install this web app on your %device: tap %icon and then Add to Home Screen.',
es_es: 'Para instalar esta app en su %device, pulse %icon y seleccione Añadir a pantalla de inicio.',
fi_fi: 'Asenna tämä web-sovellus laitteeseesi %device: paina %icon ja sen jälkeen valitse Lisää Koti-valikkoon.',
fr_fr: 'Ajoutez cette application sur votre %device en cliquant sur %icon, puis Ajouter à l\'écran d\'accueil.',
he_il: '××ª×§× ×פ××קצ×× ×× ×¢× ×-%device ש××: ×קש %icon ××× ××סף ×××¡× ×××ת.',
hu_hu: 'TelepÃtse ezt a web-alkalmazást az Ãn %device-jára: nyomjon a %icon-ra majd a FÅképernyÅhöz adás gombra.',
it_it: 'Installa questa applicazione sul tuo %device: premi su %icon e poi Aggiungi a Home.',
ja_jp: 'ãã®ã¦ã§ãã¢ããªãããªãã®%deviceã«ã¤ã³ã¹ãã¼ã«ããã«ã¯%iconãã¿ãããã¦ãã¼ã ç»é¢ã«è¿½å ãé¸ãã§ãã ããã',
ko_kr: '%deviceì ì¹ì±ì ì¤ì¹íë ¤ë©´ %iconì í°ì¹ í "ííë©´ì ì¶ê°"를 ì ííì¸ì',
nb_no: 'Installer denne appen på din %device: trykk på %icon og deretter Legg til på Hjem-skjerm',
nl_nl: 'Installeer deze webapp op uw %device: tik %icon en dan Zet in beginscherm.',
pt_br: 'Instale este web app em seu %device: aperte %icon e selecione Adicionar à Tela Inicio.',
pt_pt: 'Para instalar esta aplicação no seu %device, prima o %icon e depois o Adicionar ao ecrã principal.',
ru_ru: 'УÑÑановиÑе ÑÑо веб-пÑиложение на Ð²Ð°Ñ %device: нажмиÑе %icon, заÑем ÐобавиÑÑ Ð² «Ðомой».',
sv_se: 'Lägg till denna webbapplikation på din %device: tryck på %icon och därefter Lägg till på hemskärmen.',
th_th: 'à¸à¸´à¸à¸à¸±à¹à¸à¹à¸§à¹à¸à¹à¸à¸à¸¯ à¸à¸µà¹à¸à¸ %device à¸à¸à¸à¸à¸¸à¸: à¹à¸à¸° %icon à¹à¸¥à¸° à¹à¸à¸´à¹à¸¡à¸à¸µà¹à¸«à¸à¹à¸²à¸à¸à¹à¸®à¸¡',
tr_tr: '%device için bu uygulamayı kurduktan sonra %icon simgesine dokunarak Ev Ekranına Ekleyin.',
zh_cn: 'æ¨å¯ä»¥å°æ¤åºç¨ç¨å¼å®è£
å°æ¨ç %device ä¸ã请æ %icon ç¶åç¹éæ·»å è³ä¸»å±å¹ã',
zh_tw: 'æ¨å¯ä»¥å°æ¤æç¨ç¨å¼å®è£å°æ¨ç %device ä¸ãè«æ %icon ç¶å¾é»é¸å å
¥ä¸»ç«é¢è¢å¹ã'
};
OSVersion = OSVersion ? OSVersion[0].replace(/[^\d_]/g,'').replace('_','.')*1 : 0;
expired = expired == 'null' ? 0 : expired*1;
// Merge options
if (window.addToHomeConfig) {
for (i in window.addToHomeConfig) {
options[i] = window.addToHomeConfig[i];
}
}
// Is it expired?
if (!options.expire || expired < new Date().getTime()) {
expired = 0;
}
/* Bootstrap */
if (hasHomescreen && !expired && !isStandalone && isSafari) {
document.addEventListener('DOMContentLoaded', ready, false);
window.addEventListener('load', loaded, false);
}
/* on DOM ready */
function ready () {
document.removeEventListener('DOMContentLoaded', ready, false);
var div = document.createElement('div'),
close,
link = options.touchIcon ? document.querySelectorAll('head link[rel=apple-touch-icon],head link[rel=apple-touch-icon-precomposed]') : [],
sizes, touchIcon = '';
div.id = 'addToHomeScreen';
div.style.cssText += 'position:absolute;-webkit-transition-property:-webkit-transform,opacity;-webkit-transition-duration:0;-webkit-transform:translate3d(0,0,0);';
div.style.left = '-9999px'; // Hide from view at startup
// Localize message
if (options.message in intl) { // You may force a language despite the user's locale
language = options.message;
options.message = '';
}
if (options.message == '') { // We look for a suitable language (defaulted to en_us)
options.message = language in intl ? intl[language] : intl['en_us'];
}
// Search for the apple-touch-icon
if (link.length) {
for (i=0, l=link.length; i';
}
div.className = (isIPad ? 'ipad' : 'iphone') + (touchIcon ? ' wide' : '');
div.innerHTML = touchIcon + options.message.replace('%device', platform).replace('%icon', OSVersion >= 4.2 ? '' : '+') + (options.arrow ? '' : '') + '\u00D7';
document.body.appendChild(div);
el = div;
// Add the close action
close = el.querySelector('.close');
if (close) close.addEventListener('click', addToHomeClose, false);
// Add expire date to the popup
if (options.expire) localStorage.setItem('_addToHome', new Date().getTime() + options.expire*60*1000);
}
/* on window load */
function loaded () {
window.removeEventListener('load', loaded, false);
setTimeout(function () {
var duration;
startY = isIPad ? window.scrollY : window.innerHeight + window.scrollY;
startX = isIPad ? window.scrollX : Math.round((window.innerWidth - el.offsetWidth)/2) + window.scrollX;
el.style.top = isIPad ? startY + options.bottomOffset + 'px' : startY - el.offsetHeight - options.bottomOffset + 'px';
el.style.left = isIPad ? startX + (OSVersion >=5 ? 160 : 208) - Math.round(el.offsetWidth/2) + 'px' : startX + 'px';
switch (options.animationIn) {
case 'drop':
if (isIPad) {
duration = '0.6s';
el.style.webkitTransform = 'translate3d(0,' + -(window.scrollY + options.bottomOffset + el.offsetHeight) + 'px,0)';
} else {
duration = '0.9s';
el.style.webkitTransform = 'translate3d(0,' + -(startY + options.bottomOffset) + 'px,0)';
}
break;
case 'bubble':
if (isIPad) {
duration = '0.6s';
el.style.opacity = '0';
el.style.webkitTransform = 'translate3d(0,' + (startY + 50) + 'px,0)';
} else {
duration = '0.6s';
el.style.webkitTransform = 'translate3d(0,' + (el.offsetHeight + options.bottomOffset + 50) + 'px,0)';
}
break;
default:
duration = '1s';
el.style.opacity = '0';
}
setTimeout(function () {
el.style.webkitTransitionDuration = duration;
el.style.opacity = '1';
el.style.webkitTransform = 'translate3d(0,0,0)';
el.addEventListener('webkitTransitionEnd', transitionEnd, false);
}, 0);
closeTimeout = setTimeout(addToHomeClose, options.lifespan);
}, options.startDelay);
}
function transitionEnd () {
el.removeEventListener('webkitTransitionEnd', transitionEnd, false);
el.style.webkitTransitionProperty = '-webkit-transform';
el.style.webkitTransitionDuration = '0.2s';
if (closeTimeout) { // Standard loop
clearInterval(theInterval);
theInterval = setInterval(setPosition, options.iterations);
} else { // We are closing
el.parentNode.removeChild(el);
}
}
function setPosition () {
var matrix = new WebKitCSSMatrix(window.getComputedStyle(el, null).webkitTransform),
posY = isIPad ? window.scrollY - startY : window.scrollY + window.innerHeight - startY,
posX = isIPad ? window.scrollX - startX : window.scrollX + Math.round((window.innerWidth - el.offsetWidth)/2) - startX;
if (posY == matrix.m42 && posX == matrix.m41) return;
clearInterval(theInterval);
el.removeEventListener('webkitTransitionEnd', transitionEnd, false);
setTimeout(function () {
el.addEventListener('webkitTransitionEnd', transitionEnd, false);
el.style.webkitTransform = 'translate3d(' + posX + 'px,' + posY + 'px,0)';
}, 0);
}
function addToHomeClose () {
clearInterval(theInterval);
clearTimeout(closeTimeout);
closeTimeout = null;
el.removeEventListener('webkitTransitionEnd', transitionEnd, false);
var posY = isIPad ? window.scrollY - startY : window.scrollY + window.innerHeight - startY,
posX = isIPad ? window.scrollX - startX : window.scrollX + Math.round((window.innerWidth - el.offsetWidth)/2) - startX,
opacity = '1',
duration = '0',
close = el.querySelector('.close');
if (close) close.removeEventListener('click', addToHomeClose, false);
el.style.webkitTransitionProperty = '-webkit-transform,opacity';
switch (options.animationOut) {
case 'drop':
if (isIPad) {
duration = '0.4s';
opacity = '0';
posY = posY + 50;
} else {
duration = '0.6s';
posY = posY + el.offsetHeight + options.bottomOffset + 50;
}
break;
case 'bubble':
if (isIPad) {
duration = '0.8s';
posY = posY - el.offsetHeight - options.bottomOffset - 50;
} else {
duration = '0.4s';
opacity = '0';
posY = posY - 50;
}
break;
default:
duration = '0.8s';
opacity = '0';
}
el.addEventListener('webkitTransitionEnd', transitionEnd, false);
el.style.opacity = opacity;
el.style.webkitTransitionDuration = duration;
el.style.webkitTransform = 'translate3d(' + posX + 'px,' + posY + 'px,0)';
}
/* Public functions */
window.addToHomeClose = addToHomeClose;
})();