/** FHRSWidget.Core.js: shared functionality for widgets **/ // Namespace definition : All Widget Classes should be created in this namespace // if (!window.FHRSWidget1091141) { window.FHRSWidget1091141 = {}; } // Widget Core Constructor // FHRSWidget1091141.Core = function () { // Write out Parent Div where script is placed // Widget content can then be attached to this div through the DOM this.parentDivId = 'CoreJsBaseDiv-1091141'; document.write('
'); }; // Widget Core Class Definition // FHRSWidget1091141.Core.prototype = { // Create any HTML element // createTag: function (tagName, innerHtml, cssClass) { var tag = $c_1091141(tagName); if (cssClass) { this.setCssClass(tag, cssClass); } if (innerHtml) { tag.innerHTML = innerHtml; } return tag; }, // Create Unordered List of Hyperlinks // createHyperlinkList: function (dataCollection, businessUrl, ratingImageUrl, listId, cssClass) { this.parentDiv = $g_1091141(this.parentDivId); // Remove existing list with this Id, if exists // Create list var list; list = $c_1091141('div'); list.id = listId; list.name = listId; if (cssClass !== '') { this.setCssClass(list, cssClass); } // Add items to list var div; for (index in dataCollection) { var item = dataCollection[index]; div = $c_1091141('div'); var businessName = item.BusinessName; var ratingKey = item.RatingKey; var postCode = item.PostCode; if (businessName) { var hyperlink = this.createHyperlink(null, businessName, businessUrl + item.FHRSID, null, 'listhyperlink'); div.appendChild(hyperlink); var image = this.createTag('div', postCode, null); div.appendChild(image); image = this.createTag('div', '', null); div.appendChild(image); } else { var norating = this.createTag('div', '', null); div.appendChild(norating); } list.appendChild(div); } return list; }, // Create a hyperlink and attach event handlers if needed // createHyperlink: function (hyperlinkId, text, href, onClickFunction, cssClass, target) { hyperlink = $c_1091141('a'); if (hyperlinkId) { hyperlink.id = hyperlinkId; hyperlink.name = hyperlinkId; } hyperlink.title = text; hyperlink.innerHTML = ('
' + text + '
'); //text)); if (href) { hyperlink.href = href; } if (cssClass !== null && cssClass !== '') { this.setCssClass(hyperlink, cssClass); } if (target) { hyperlink.setAttribute("target", target); } // Attach onclick event handlers if (onClickFunction) { hyperlink.onclick = onClickFunction; var onClickHandler = new Function(hyperlink.onclick); if (hyperlink.addEventListener) { hyperlink.addEventListener('click', onClickHandler, false); } else if (hyperlink.attachEvent) { hyperlink.attachEvent('onclick', onClickHandler); } } return hyperlink; }, // Adds CSS Class to any element // setCssClass: function (elem, cls) { elem.setAttribute('class', cls); elem.setAttribute('className', cls); }, // Attach a Stylesheet to document // attachStyleSheet: function (path, linkId) { var doc = document.getElementsByTagName('head').item(0); var link = $c_1091141('link'); link.rel = 'stylesheet'; link.type = 'text/css'; link.href = path; link.id = linkId; doc.appendChild(link); return false; }, // Attach a new script, useful for simulating postbacks // attachScript: function (path, scriptId) { script = $c_1091141('script'); script.src = path; script.type = 'text/javascript'; script.id = scriptId; this.parentDiv.appendChild(script); return false; } }; // Shortcut for GetElementsById // function $g_1091141(elem) { return document.getElementById(elem); } // Shortcut for CreateElement // function $c_1091141(elem) { return document.createElement(elem); } // Construct a new core object var core1091141 = new FHRSWidget1091141.Core(); /** FHRSWidget.Widget.js: renders list of dev events **/ // Widget Constructor // FHRSWidget1091141.Widget = function() { // Get reference to main div. All widget content will be children of this div this.parentDiv = document.getElementById(core1091141.parentDivId); this.businessUrl = "https://ratings.food.gov.uk/business/"; this.ratingImageUrl = "https://api1-ratings.food.gov.uk/images/scores/small/"; this.fhrsEstablishmentData = [{"AddressLine1":"1 Pinnacle Quay","AddressLine2":"Harbour Avenue","AddressLine3":"Sutton Harbour","AddressLine4":"Plymouth","BusinessName":"HonkyTonk Wine Library","BusinessType":"Restaurant\/Cafe\/Canteen","BusinessTypeID":1,"Distance":null,"FHRSID":1091141,"Geocode":{"Latitude":50.3708344,"Longitude":-4.13181734},"LocalAuthorityBusinessID":"259461","LocalAuthorityCode":"891","LocalAuthorityEmailAddress":"public.protection@plymouth.gov.uk","LocalAuthorityName":"Plymouth City","LocalAuthorityWebSite":"http:\/\/www.plymouth.gov.uk","NewRatingPending":false,"PostCode":"PL4 0BJ","RatingDate":"15 March 2024","RatingKey":"fhrs_0_en-gb","RatingValue":"0","ReInspectionResult":null,"RightToReply":"<p>\u000d\u000a\u0009We fully accept the outcome of this report, which has been a wake-up call-in regard keeping our standards more consistent upon when we first opened: There is no excuse to give other that we take full responsibility, we&rsquo;d like to give thanks to the officers on their important guidance upon getting the work needed for a fast turnaround.<\/p>\u000d\u000a<p>\u000d\u000a\u0009Once again, the Management and Team express deep disappointment with the outcome of the recent inspection. We acknowledge the need for several improvements, for which we take full responsibility. Our team has already implemented most of the necessary changes to restore our ratings.<\/p>\u000d\u000a<p>\u000d\u000a\u0009To our valued customers,<\/p>\u000d\u000a<p>\u000d\u000a\u0009Throughout nearly six years of trading, we have maintained an impeccable record regarding, safety, hygiene, and health standards. We want to assure you that Fitz &amp; Zoe management takes full ownership of the current inspection results and is committed to restoring our services to the highest standards. The necessary work will be completed asap, and we anticipate a revaluation within the coming weeks. Thank you for your continued support and understanding.&nbsp;<\/p>\u000d\u000a","SchemeType":"FHRS","Scores":{"ConfidenceInManagement":30,"Hygiene":20,"Structural":25}}]; } // Widget : Core Class Definition // FHRSWidget1091141.Widget.prototype = { // Main function for Events Widget : Handles rendering the widget to the consuming site // render: function () { var child1 = core1091141.createHyperlinkList(this.fhrsEstablishmentData, this.businessUrl, this.ratingImageUrl, 'eventList1091141', 'widgetcontainer'); var child2 = core1091141.createTag('br'); var els = document.getElementsByClassName("1091141"); for (var i = 0; i < els.length; i++) { // Create Border and Shadow and return Content Div var contentDiv = this.createContentBorder(els[i]); // Create and Attach Events List contentDiv.appendChild(child1); contentDiv.appendChild(child2); } }, // Create Border, Shadow, and Content Div // createContentBorder: function (localParentDiv) { var outerDiv = core1091141.createTag('div', '', 'widget1'); var innerDiv = core1091141.createTag('div', '', 'widget2'); var contentDiv = core1091141.createTag('div', '', 'widget3'); innerDiv.appendChild(contentDiv); outerDiv.appendChild(innerDiv); localParentDiv.appendChild(outerDiv); return contentDiv; } }; // Create Widget Object var ev_w_1091141 = new FHRSWidget1091141.Widget(); ev_w_1091141.render();