Remove dead pentamedia comments to stop browsers from trying to load them forever
This commit is contained in:
parent
9999999318
commit
0000008605
|
@ -1,69 +0,0 @@
|
||||||
var PENTAMEDIA = 'https://pentamedia.org';
|
|
||||||
|
|
||||||
/*** Kommentare in der News-Übersicht ***/
|
|
||||||
|
|
||||||
var links = {};
|
|
||||||
|
|
||||||
$(document).ready(
|
|
||||||
function() {
|
|
||||||
var load = false;
|
|
||||||
$("h3.news").find("a").each(
|
|
||||||
function() {
|
|
||||||
var a = $(this);
|
|
||||||
var href = a.attr("href");
|
|
||||||
var m;
|
|
||||||
if ((m = /news\/([^\/\.]+)\.[^\/\.]+$/.exec(href))) {
|
|
||||||
links[m[1]] = a;
|
|
||||||
load = true;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
if (load) {
|
|
||||||
$(document).append('<script src="' + PENTAMEDIA + '/comments/count.json?jsonp=ShowStats" type="text/javascript"></script>');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
function ShowStats(comments) {
|
|
||||||
for(var filename in comments) {
|
|
||||||
var amount = comments[filename];
|
|
||||||
var text;
|
|
||||||
if (amount == 1)
|
|
||||||
text = amount.toString() + " Kommentar";
|
|
||||||
else
|
|
||||||
text = amount.toString() + " Kommentare";
|
|
||||||
|
|
||||||
var slug = filename.split(".")[0];
|
|
||||||
if (links[slug])
|
|
||||||
links[slug].parent().parent().parent().find("p.more").append("<span class='comments'>" + text + "</span>");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*** Kommentare auf jeder Seite ***/
|
|
||||||
|
|
||||||
var slug;
|
|
||||||
|
|
||||||
$(document).ready(
|
|
||||||
function() {
|
|
||||||
var m;
|
|
||||||
if ((m = /\/(penta[a-zA-Z0-9\-]+)\./.exec(document.location))) {
|
|
||||||
slug = m[1];
|
|
||||||
$(document).append('<script src="'+PENTAMEDIA+'/'+slug+'/comments.json?jsonp=ShowComments&html=mitsahne" type="text/javascript"></script>');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
function ShowComments(r) {
|
|
||||||
$("#content").append(r.html);
|
|
||||||
$("#content").
|
|
||||||
find(".comments").
|
|
||||||
find("a").
|
|
||||||
map(function() {
|
|
||||||
var a = $(this);
|
|
||||||
if (a.attr("href").substr(0, 1) == "/")
|
|
||||||
a.attr("href", PENTAMEDIA + a.attr("href"));
|
|
||||||
});
|
|
||||||
|
|
||||||
var new_p = $("<p class='new_comment'/>");
|
|
||||||
var new_a = $("<a>Kommentar schreiben</a>");
|
|
||||||
new_a.attr("href", PENTAMEDIA + r.new_link);
|
|
||||||
new_p.append(new_a);
|
|
||||||
$("#content").append(new_p);
|
|
||||||
}
|
|
|
@ -86,9 +86,6 @@
|
||||||
<xsl:call-template name="make-script-tag">
|
<xsl:call-template name="make-script-tag">
|
||||||
<xsl:with-param name="name">jquery.dataset</xsl:with-param>
|
<xsl:with-param name="name">jquery.dataset</xsl:with-param>
|
||||||
</xsl:call-template>
|
</xsl:call-template>
|
||||||
<xsl:call-template name="make-script-tag">
|
|
||||||
<xsl:with-param name="name">pentamedia-comments</xsl:with-param>
|
|
||||||
</xsl:call-template>
|
|
||||||
<xsl:call-template name="make-script-tag">
|
<xsl:call-template name="make-script-tag">
|
||||||
<xsl:with-param name="name">play-resources</xsl:with-param>
|
<xsl:with-param name="name">play-resources</xsl:with-param>
|
||||||
</xsl:call-template>
|
</xsl:call-template>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user