make URLs easier on the eyes

This commit is contained in:
David 2022-03-20 15:40:51 -04:00
parent e68ac38ade
commit 8e070661ab

View File

@ -568,7 +568,7 @@
</p>
<ul>
{{#website}}
<li><a href="{{website}}" target="_blank">{{website}}</a></li>
<li><a href="{{website}}" target="_blank">{{cleanedWebsite}}</a></li>
{{/website}}
<li class="storeDetails">Events: {{events}}</li>
<li class="storeDetails">Caf&eacute;: {{cafe}}</li>
@ -606,6 +606,7 @@
$.each(data, function (key, value) {
value.rowNumber = key;
value.slug = slugify(value.name);
value.cleanedWebsite = cleanWebsite(value.website);
});
$("#storeCount").html(data.length);
window.data = data;
@ -637,6 +638,14 @@
.replace(/^-|-$/g, "");
}
function cleanWebsite(str) {
return str
.toLowerCase()
.replace(/^https?:\/\//g, "")
.replace(/^www./g, "")
.replace(/\/$/g, "");
}
function getStoreBySlug(slug) {
var ret = false;
$.each(window.data, function (key, value) {