// update tooltip
var $likes = this._containerData[containerID].likes;
var $dislikes = this._containerData[containerID].dislikes;
- $badge.data('tooltip', eval(WCF.Language.get('wcf.like.tooltip')));
+ $badge.data('tooltip', WCF.Language.get('wcf.like.tooltip', { likes: $likes, dislikes: $dislikes }));
}
},
for (var $userID in $users) $userArray.push($users[$userID].username);
var $others = this._containerData[containerID].likes - $userArray.length;
- this._containerData[containerID].summary.children('span').html(eval(WCF.Language.get('wcf.like.summary')));
+ this._containerData[containerID].summary.children('span').html(WCF.Language.get('wcf.like.summary', { users: $userArray, others: $others }));
}
},
template = "$output += '" + template + "';";
- this.fetch = new Function("v", "var $output = ''; " + template + ' return $output;');
+ try {
+ this.fetch = new Function("v", "var $output = ''; " + template + ' return $output;');
+ }
+ catch (e) {
+ console.debug("var $output = ''; " + template + ' return $output;');
+ throw e;
+ }
},
/**
<category name="wcf.like">
<item name="wcf.like.cumulativeLikes"><![CDATA[Likes]]></item>
<item name="wcf.like.tooltip"><![CDATA[{if $likes}{#$likes} Like{if $likes != 1}s{/if}{if $dislikes}, {/if}{/if}{if $dislikes}{#$dislikes} Dislike{if $dislikes != 1}s{/if}{/if}]]></item>
- <item name="wcf.like.jsTooltip"><![CDATA[($likes > 0 ? ($likes + " Like" + ($likes != 1 ? "s" : "") + ($dislikes > 0 ? ", " : "")) : "") + ($dislikes > 0 ? ($dislikes + " Dislike" + ($dislikes != 1 ? "s" : "")) : "")]]></item>
+ <item name="wcf.like.jsTooltip"><![CDATA[{literal}{if $likes}{#$likes} Like{if $likes != 1}s{/if}{if $dislikes}, {/if}{/if}{if $dislikes}{#$dislikes} Dislike{if $dislikes != 1}s{/if}{/if}{/literal}]]></item>
<item name="wcf.like.button.like"><![CDATA[Gefällt mir]]></item>
<item name="wcf.like.button.dislike"><![CDATA[Gefällt mir nicht]]></item>
<item name="wcf.like.likesReceived"><![CDATA[Erhaltene Likes]]></item>
- <item name="wcf.like.summary"><![CDATA[$userArray.join(", ") + ($others > 0 ? (" und " + $others + (" weitere" + ($others > 1 ? "n" : "m"))) : "") + " gefällt das."]]></item>
+ <item name="wcf.like.summary"><![CDATA[{literal}{if $others == 0}{@$users.slice(0, -1).join(", ")}{if $users.length > 1} und {/if}{@$users.slice(-1)[0]}{else}{@$users.join(", ")} und {if $others == 1}einem{else}{#$others}{/if} weitere{if $others > 1}n{else}m{/if}{/if} gefällt das.{/literal}]]></item>
<item name="wcf.like.details"><![CDATA[Details]]></item>
<item name="wcf.like.details.like"><![CDATA[Likes]]></item>
<item name="wcf.like.details.dislike"><![CDATA[Dislikes]]></item>
<category name="wcf.like">
<item name="wcf.like.cumulativeLikes"><![CDATA[Likes]]></item>
<item name="wcf.like.tooltip"><![CDATA[{if $likes}{#$likes} Like{if $likes != 1}s{/if}{if $dislikes}, {/if}{/if}{if $dislikes}{#$dislikes} Dislike{if $dislikes != 1}s{/if}{/if}]]></item>
- <item name="wcf.like.jsTooltip"><![CDATA[($likes > 0 ? ($likes + " Like" + ($likes != 1 ? "s" : "") + ($dislikes > 0 ? ", " : "")) : "") + ($dislikes > 0 ? ($dislikes + " Dislike" + ($dislikes != 1 ? "s" : "")) : "")]]></item>
+ <item name="wcf.like.jsTooltip"><![CDATA[{literal}{if $likes}{#$likes} Like{if $likes != 1}s{/if}{if $dislikes}, {/if}{/if}{if $dislikes}{#$dislikes} Dislike{if $dislikes != 1}s{/if}{/if}{/literal}]]></item>
<item name="wcf.like.button.like"><![CDATA[Like]]></item>
<item name="wcf.like.button.dislike"><![CDATA[Dislike]]></item>
<item name="wcf.like.likesReceived"><![CDATA[Likes Received]]></item>
<item name="wcf.like.summary"><![CDATA[$userArray.join(", ") + ($others > 0 ? (" and " + $others + (" other" + ($others > 1 ? "s" : ""))) : "") + " like" + ($userArray.length == 1 ? "s" : "") + " this."]]></item>
+ <item name="wcf.like.summary"><![CDATA[{literal}{if $others == 0}{@$users.slice(0, -1).join(", ")}{if $users.length > 1} and {/if}{@$users.slice(-1)[0]}{else}{@$users.join(", ")} and {if $others == 1}one{else}{#$others}{/if} other{if $others > 1}s{/if}{/if} like{if $users.length == 1}s{/if} this.{/literal}]]></item>
<item name="wcf.like.details"><![CDATA[Details]]></item>
<item name="wcf.like.details.like"><![CDATA[Likes]]></item>
<item name="wcf.like.details.dislike"><![CDATA[Dislikes]]></item>