Skip to content

Commit 40dc83e

Browse files
committed
remove inline placeholder image func
1 parent de1db36 commit 40dc83e

File tree

1 file changed

+0
-34
lines changed

1 file changed

+0
-34
lines changed

Diff for: speakers/index.html

-34
Original file line numberDiff line numberDiff line change
@@ -5,40 +5,6 @@
55

66
<h1 class="sr-only">Speakers</h1>
77

8-
<script>
9-
{% comment %}
10-
Generates a random placeholder image:
11-
css: css class for <img> element
12-
name: identifier for the speaker that gets hashed
13-
path: the path to the image with a # for the image. # gets replaced
14-
alt: alt text for the image
15-
num: total number of placeholder image options for modulo
16-
{% endcomment %}
17-
function placeholderImage(css, name, path, alt, num) {
18-
const hashCode = function(str) {
19-
if (Array.prototype.reduce) {
20-
return str.split("").reduce(function(a,b){a=((a<<5)-a)+b.charCodeAt(0);return a&a},0);
21-
} else {
22-
var hash = 0, i, chr, len;
23-
if (str.length == 0) return hash;
24-
for (i = 0, len = str.length; i < len; i++) {
25-
chr = str.charCodeAt(i);
26-
hash = ((hash << 5) - hash) + chr;
27-
hash |= 0; // Convert to 32bit integer
28-
}
29-
return hash;
30-
}
31-
};
32-
33-
var output = '<img ';
34-
output += 'class="' + css + '" ';
35-
output += 'alt="' + alt + '" ';
36-
output += 'src="' + path.replace('#', Math.abs(hashCode(name)) % 10) + '" ';
37-
output = output.trim() + '>';
38-
document.write(output);
39-
}
40-
</script>
41-
428
{% if site.data.speakers %}
439
<section>
4410
<div class="container">

0 commit comments

Comments
 (0)