Skip to content

Commit

Permalink
remove inline js from publishers view (#5188)
Browse files Browse the repository at this point in the history
  • Loading branch information
RayBB authored May 17, 2021
1 parent 2bb16bd commit 9cf0157
Showing 1 changed file with 0 additions and 55 deletions.
55 changes: 0 additions & 55 deletions openlibrary/templates/publishers/view.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,54 +33,6 @@ <h2>
</div>

<script type="text/json+graph" id="graph-json-chartPubHistory">$:json_encode(page.publishing_history)</script>
<script type="text/javascript">
<!--
// FIXME: Please move this text/javascript to webpack entry point after you've worked out what it's doing
function parse_hash() {
try {
var hash = document.location.hash || "#";
var tokens = hash.substr(1).split("&");
var d = {};
for (var i in tokens) {
if (tokens[i]) {
var kv = tokens[i].split("=");
d[kv[0]] = kv[1];
}
}
return d;
}
catch (error) {
// Work-around for IE weirdness
return {};
}
}

function set_hash(data) {
var d = parse_hash();

for (var k in data) {
if (data[k])
d[k] = data[k];
else
delete d[k];
}

var tokens = [];
for (var k in d) {
tokens[tokens.length] = k + "=" + d[k];
}

var hash = "#" + tokens.join("&");
var current_hash = document.location.hash || "#";

if (hash == current_hash)
return;
document.location.hash = hash;
}

var _hash = parse_hash();
//-->
</script>

<div class="chart">
<div class="chartYaxis">$_("Editions Published")</div>
Expand Down Expand Up @@ -139,13 +91,6 @@ <h3>$_("Authors")</h3>

$ publishers_feature_enabled = "publishers" in ctx.features

<script type="text/javascript">
<!--
$ page_key = page.key[page.key.rindex('/')+1:]
var page_key = "$page_key";
var publishers_feature_enabled = $:json_encode(publishers_feature_enabled);
//-->
</script>
$jsdef renderPublishers(publishers):
$for p in publishers:
<span class="tag">
Expand Down

0 comments on commit 9cf0157

Please sign in to comment.