#design::before { content: ""; background-image: url( {{ generateFullUrl(background_image) }} ); background-size: cover; position: absolute; top: 0px; right: 0px; bottom: 0px; left: 0px; opacity: {{ background_image_opacity }}; background-position: center; } .link-text::before { content: ""; background-color: {{ link_background_color }}; background-size: cover; position: absolute; top: 0px; right: 0px; bottom: 0px; left: 0px; opacity: 0.9; }

{{ title }}

{{ description}}
{{ email_button }}
{{ email_button }}
{{ email_button }}
","embed_code_id":"68869","show_icon_color":false,"icon_color":"#2ec5d3","show_icon_color_box":false,"show_icon_box":false,"total_clicks":"0","isVideo":"0","date":"2024-10-07","hidden":"0"},{"link_id":"fyg968","project_id":"30775","title":"Flu Season Is Here - Get Vaccinated at One of our Four Urgent Cares","description":"Protect yourself and your loved ones this flu season with a flu vaccine from our 4 convenient Urgent Care locations in Eastvale, Fontana, Ontario, and Rancho Cucamonga.","icon":"fas fa-link","url":"https://sarh.link/Urgent-Care-Locations","product_type":"product","product_id":"0","product_price":"","product":false,"plan":false,"plan_id":"0","plan_name":"","product_name":"","is_editing":false,"donation":"10","image_url":"https://cdn.hyax.com/3f24f595-2943-4de0-9924-2ef1242135ee/-/quality/smart/-/format/auto/null","background_image":"","icon_or_image":"image","social_platform":"twitter","emphasize":false,"type":"1","embed_code":"","embed_code_id":"","show_icon_color":false,"icon_color":"#2ec5d3","show_icon_color_box":false,"show_icon_box":true,"total_clicks":"0","date":"2024-10-11","hidden":"1"},{"link_id":"5kgve","project_id":"30775","title":"Blood Donation - San Antonio Regional Hospital","description":"American Red Cross Blood Donation at San Antonio Regional Hospital\nThursday, January 30, 2025\n7 am to 7 pm, in Aita Auditorium \n999 San Bernardino Road, Upland, CA\n","icon":"fas fa-link","url":"https://sarh.link/blood-donation-calendar","product_type":"product","product_id":"0","product_price":"","product":false,"plan":false,"plan_id":"0","plan_name":"","product_name":"","is_editing":false,"donation":"10","image_url":"https://cdn.hyax.com/989d8e0b-eda8-4e17-b239-305ec04bbd2d/-/quality/smart/-/format/auto/null","background_image":"","icon_or_image":"image","social_platform":"twitter","emphasize":false,"type":"1","embed_code":"","embed_code_id":"","show_icon_color":false,"icon_color":"#2ec5d3","show_icon_color_box":false,"show_icon_box":false,"total_clicks":"0","date":"2025-01-26","hidden":"1"},{"link_id":"qisfwn","project_id":"30775","title":"Wellness Exams at our Four Urgent Care Locations","description":"Please visit one of our many urgent care facilities if you are under the weather. With 4 Urgent Care locations across the Inland Empire, we're always here for you. ","icon":"far fa-hospital","url":"https://sarh.link/Urgent-Care-Locations","product_type":"product","product_id":"0","product_price":"","product":false,"plan":false,"plan_id":"0","plan_name":"","product_name":"","is_editing":false,"donation":"10","image_url":"https://ucarecdn.com/d7ed54ca-cb98-429e-9d66-e9d80306f508/interfacewhiter.png","background_image":"","icon_or_image":"icon","social_platform":"twitter","emphasize":false,"type":"1","embed_code":"","embed_code_id":"","show_icon_color":false,"icon_color":"#0E6434","show_icon_color_box":false,"show_icon_box":false,"total_clicks":"0","hidden":"1","date":"2025-05-27"}] } }, methods: { generateFullUrl(link_image_url) { const keyword = '/quality'; const url = link_image_url; let newUrl = link_image_url; const cloudfront = 'cloudfront'; const hyax = 'cdn.hyax.com'; const ucare = 'ucarecdn'; if (!url.includes(cloudfront) && ( url.includes(hyax) || url.includes(ucare) ) ) { if (url.includes(keyword)) { // Insert the text "smart_resize/420x420/-/" in front of 'quality' newUrl = url.replace(keyword, '' + keyword); } else { // Insert the text "-/smart_resize/420x420/-/quality/smart/-/format/auto/" at the very end of the url newUrl = url + '-/quality/smart/-/format/auto/'; } } return newUrl; }, extra_parameters(link) { const keywords = ['null', 'quality', 'auto']; const url = link.image_url; let found = false; keywords.forEach(keyword => { if (url.includes(keyword)) { found = true; } }); return found ? '?extra-parameter=true' : '-/quality/smart/-/format/auto/null'; }, showDate(link) { if (!link.date) { return true; } else { let givenDate1 = new Date(link.date); // Past Date let givenDate2 = Date.now(); // future Date // If diff is positive, then given date is PAST let diff = new Date().getTime() - givenDate1.getTime(); if (diff > 0) { return true; } if (diff < 0) { return false; } return true; } }, resizeIFrameToFitContent(iFrame) { console.log('resizing...'); iFrame.width = iFrame.contentWindow.document.body.scrollWidth; iFrame.height = iFrame.contentWindow.document.body.scrollHeight; console.log('resizing...' + iFrame.width + iFrame.height); }, open_new_tab(url) { window.open(url, "_blank"); }, increase_click(index) { var total_clicks = this.links[index].total_clicks; // alert("Link value original =" + total_clicks); var integer = parseInt(total_clicks, 10); this.links[index].total_clicks = integer + 1; // alert("Link value new = " + this.links[index].total_clicks); this.save_links(); console.log("Link value increased to: " + this.links[index].total_clicks); $.ajax({ url: "/link-pages/increaseclick?id=25603", type: "POST", success: function (success) { } }); if (this.links[index].url) { this.open_new_tab(this.links[index].url); } //window.location.href = this.links[index].url; }, activate_request(donation_amount, description) { var loc = "/link-pages/donation?donation_or_request=request&donation_amount=" + donation_amount + "&project_id=30775&description=" + description; $('#purchase-iframe').attr('src', loc); $("#purchase-modal").addClass('is-active'); var total_clicks = this.links[index].total_clicks; // alert("Link value original =" + total_clicks); var integer = parseInt(total_clicks, 10); this.links[index].total_clicks = integer + 1; // alert("Link value new = " + this.links[index].total_clicks); this.save_links(); //alert("Link value increased to!" + link.total_clicks); $.ajax({ url: "/link-pages/increaseclick?id=25603", type: "POST", success: function (success) { } }); }, activate_donation(donation_amount, description) { if (!donation_amount) { var donation_amount = '0'; } var loc = "/link-pages/donation?donation_or_request=donation&donation_amount=" + donation_amount + "&project_id=30775&description=" + description; $('#purchase-iframe').attr('src', loc); $("#purchase-modal").addClass('is-active'); }, activate_purchase(type, link) { if (type == 'product' || !type) { var loc = "/link-pages/purchase?product_type=" + type + "&product_id=" + link.product_id; } else if (type == 'membership') { var loc = "/membership-plans/memberpurchase?membership_plan_id=" + link.plan_id; } $('#purchase-iframe').attr('src', loc); $("#purchase-modal").addClass('is-active'); }, get_product_price(link) { // console.log('product id is -- ' + link.product_id); if (link.product_type == 'product') { var product_id = link.product_id; $.ajax({ url: "/link-pages/productprice?type=product&product_id=" + link.product_id, type: "POST", success: function (success) { var returned = success; this.product_price_current = success; link.product_price = success; console.log('now product price is ' + this.product_price_current); } }); } else { var plan_id = link.plan_id; $.ajax({ url: "/link-pages/productprice?type=membership&product_id=" + link.plan_id, type: "POST", success: function (success) { var returned = success; this.product_price_current = success; link.product_price = success; console.log('now product price is ' + this.product_price_current); } }); } //this.save_links(); return this.product_price_current; }, get_background_image(link, check_url) { console.log('the url is' + check_url); var returned = 'https://i.ytimg.com/vi/4DfU5XJ2rMg/maxresdefault.jpg'; $.ajax({ url: "/link-pages/metatag?received=" + check_url, type: "POST", success: function (success) { console.log('returned url from method is ' + success); var returned = success; this.background_image_current = success; link.background_image = success; console.log('now this background image current is ' + this.background_image_current); } }); this.save_links(); return this.background_image_current; //return 'https://i.ytimg.com/vi/4DfU5XJ2rMg/maxresdefault.jpg'; }, save_links() { console.log('starting to save links'); $.ajax({ url: "/link-pages/savelinks?id=25603&public_key=25603", type: "POST", data: { links: this.links }, success: function (data) { //alert('saved links'); console.log('links saved'); } }); }, external_url(link) { if (link.url) { var pathArray = link.url.split('/'); var protocol = pathArray[0]; var host = pathArray[2]; if (host) { return host; } } else { return ''; } return ''; }, save() { $.ajax({ url: "/link-pages/savesettings?id=25603", type: "POST", data: { title: this.title, description: this.description, email_button: this.email_button, button_color: this.button_color, headline_color: this.headline_color, link_text_color: this.link_text_color, link_background_color: this.link_background_color, link_box_border_color: this.link_box_border_color, link_text_color: this.link_text_color, text_color: this.text_color, text_font_family: this.text_font_family, background_color: this.background_color, enable_box: this.enable_box }, success: function (data) { alert('saved'); } }); // working on } }, mounted: function () { for (var i = 0; i < this.links.length; i++) { var this_url = this.links[i].url; console.log('1 - the url is ' + this_url); if (this.links[i].icon_or_image == 'preview') { if (!this.links[i].background_image) { this.links[i].background_image = this.get_background_image(this.links[i], this_url); console.log('2 - turning background image on URL ' + this_url + ' to become this background_image -- ' + this.get_background_image(this.links[i], this_url)); } } if (this.links[i].plan_id) { this.links[i].product_price = this.get_product_price(this.links[i], this.links[i].plan_id); console.log('5 - changing product price of ' + this.links[i].product_id + ' to become this product price -- ' + this.links[i].product_price); } else { console.log('WARNING - no product id for ' + i) } if (this.links[i].product_id) { this.links[i].product_price = this.get_product_price(this.links[i], this.links[i].product_id); console.log('3 - changing product price of ' + this.links[i].product_id + ' to become this product price -- ' + this.links[i].product_price); } else { console.log('WARNING - no product id for ' + i) } if (this.links[i].embed_code) { var string = this.links[i].embed_code; var wordyoutube = 'youtube'; var checkyoutube = string.indexOf(wordyoutube); var wordvimeo = 'vimeo'; var checkvimeo = string.indexOf(wordvimeo); if ((checkvimeo > 0) || (checkyoutube > 1)) { this.links[i].isVideo = 1; } if (this.links[i].embed_code_id) { /* var iFrame = document.getElementById( 'embed-code-' + this.links[i].embed_code_id); iFrame.height = iFrame.contentWindow.document.body.scrollHeight; console.log('resizing height to -- ' + iFrame.height); */ } if (!this.links[i].date) { this.links[i].date = '0'; } if (!this.links[i].hidden) { this.links[i].hidden = '0'; } } else { console.log('WARNING - no product id for ' + i) } } } });