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