make URLs easier on the eyes
This commit is contained in:
parent
e68ac38ade
commit
8e070661ab
11
index.html
11
index.html
@ -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é: {{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) {
|
||||
|
Loading…
Reference in New Issue
Block a user