_atrk_opts = { atrk_acct:"dVZmx11BEh20u9", domain:"sickleavetmr.com",dynamic: true};
(function() { var as = document.createElement('script'); as.type = 'text/javascript'; as.async = true; as.src = "https://certify-js.alexametrics.com/atrk.js"; var s = document.getElementsByTagName('script')[0];s.parentNode.insertBefore(as, s); })();
function ScrollTo_ID(scrollToID) {
var elmnt = document.getElementById(scrollToID);
elmnt.scrollIntoView();
}
function ScrollTo_ID_smooth(scrollToID) {
var elmnt = document.getElementById(scrollToID);
elmnt.scrollIntoView({
block:'start',
behavior:'smooth'
});
}
jQuery.fn.exists = function(){ return this.length > 0; }
jQuery(document).ready(function () {
var clipboard = new ClipboardJS('.copyToClipboard');
clipboard.on('success', event => {
if (event.text) {
showTooltip(event.trigger, 'copied!');
}
});
function showTooltip(elem, msg){
var classNames = elem.className;
elem.setAttribute('class', classNames + ' hint--right');
elem.setAttribute('aria-label', msg);
setTimeout(function() {
elem.setAttribute('class', classNames);
}, 500);
}
});
function window_reload_once(){
if( !localStorage.getItem('firstLoad') ){
localStorage['firstLoad'] = true;
window.location.reload();
}
else{
localStorage.removeItem('firstLoad');
}
}
function sleep(i) {
return new Promise((resolve) => {
setTimeout(() => {
resolve();
}, i);
});
};
function copy_share_link(target_id, CopyType) {
let CodeToCopy = document.querySelector('#'+target_id)
CodeToCopy.setAttribute('type', 'text') // 不是 hidden 才能複製
CodeToCopy.select()
try {
var successful = document.execCommand('copy');
var msg = successful ? 'successful' : 'unsuccessful';
alert('The ' + CopyType + ' was copied ' + msg);
} catch (err) {
alert('Oops, unable to copy');
}
CodeToCopy.setAttribute('type', 'hidden')
window.getSelection().removeAllRanges()
}
function to_app_store(){
location.href = "https://sickleavetmr.page.link/from-social-to-app-store";
}
function close_custom_app_install_row(){
document.querySelector('#custom_app_install_row').style.display = 'none';
}
function add_footer_widget_5(){
jQuery(".footer-widget-2").after('');
let params = new URLSearchParams(document.location.search);
let cta = params.get("cta");
if(cta == 1){
jQuery("body").after('一 APP 係手 筍工即有
');
}
if(cta == 2){
document.querySelector('html').style.overflow = 'hidden';
document.querySelector('html').style.position = 'relative';
document.querySelector('body').style.overflow = 'hidden';
document.querySelector('body').style.position = 'fixed';
document.querySelector('body').style.width = '100%';
document.querySelector('.entry-meta').style.display = 'none';
document.querySelector('.post_total_count').style.display = 'none';
document.querySelector('.blog__share_and_like').style.display = 'none';
jQuery("body").after('');
}
}
jQuery(window).ready(add_footer_widget_5);
setTimeout(hide_entry_website_loading_min, 500);
function hide_entry_website_loading_min(){
jQuery(window).ready(hide_entry_website_loading);
}
setTimeout(hide_entry_website_loading, 20 * 1000);
function hide_entry_website_loading() {
jQuery('#entry_website_loading').fadeOut(500);
}
//here are the testing functions
jQuery(document).ready(function() {
footer_init();
isGotoFooter();
});
function isGotoFooter(){
let queryString = window.location.search;
let urlParams = new URLSearchParams(queryString);
if(urlParams.has('goto') && urlParams.get('goto') == 'footer'){
setTimeout(function(){ ScrollTo_ID_smooth('colophon'); }, 1000);
}
}
function footer_init(){
jQuery(".footer-widgets").before('');
jQuery(".footer-widgets").before('');
jQuery("#colophon").addClass("is-call-active");
jQuery("#colophon .close_status_show").addClass("hidden");
jQuery(".copyright-info .copyright-info-top-slt").append(jQuery(".footer-widget.footer-widget-2").html());
//jQuery(".copyright-info .copyright-info-top-services").append(jQuery(".footer-widget.footer-widget-3").html());
}
function OnOff_footer(){
let footer = jQuery("#colophon");
let footer_close_status = jQuery("#colophon .close_status_show");
let footer_below = jQuery("#colophon .footer-widgets");
if( footer.hasClass("is-call-active")){
footer.addClass("not-call-active").removeClass("is-call-active");
footer_close_status.addClass("active").removeClass("hidden");
footer_below.addClass("hidden").removeClass("active");
jQuery(".footer_show_btn_class .fas.fa-chevron-up").addClass("is-active");
jQuery(".footer_show_btn_class .fas.fa-chevron-down").removeClass("is-active");
}else{
footer.addClass("is-call-active").removeClass("not-call-active");
footer_close_status.addClass("hidden").removeClass("active");
footer_below.addClass("active").removeClass("hidden");
jQuery(".footer_show_btn_class .fas.fa-chevron-up").removeClass("is-active");
jQuery(".footer_show_btn_class .fas.fa-chevron-down").addClass("is-active");
ScrollTo_ID("colophon");
}
}