# 悬停预览与每日名言

**URL:** https://meta.discourse.org/t/hover-preview-and-quote-of-the-day/119212
**Category:** Support
**Created:** [2019年五月31日 18:21 UTC](https://meta.discourse.org/t/hover-preview-and-quote-of-the-day/119212 "2019-05-31T18:21:28Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![FireAllianceNX](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/firealliancenx/32/141959_2.png) [@FireAllianceNX](https://meta.discourse.org/u/FireAllianceNX)
#### Post date: [2019年五月31日 18:21 UTC](https://meta.discourse.org/t/hover-preview-and-quote-of-the-day/119212/1 "2019-05-31T18:21:28Z")

</div>

Hi there, recently imported from SMF2 - I’m looking to re-implement tow things. Add [WoWhead link tooltips](https://www.wowhead.com/tooltips) (when hovering over a wowhead link, you get a preview of the link (game items, etc.) and we also had an in-line JS script that would load one of the pre-set quote (Quote of the Day, but really just a random quote each time the page load)

For the first one, after adding the script in before /head it doesn’t appear to be working.  
I was reading somewhere in a plugin reply saying that all hovers are uniform-ized (sanitized?) So that would make it not work? Is there a workaround? I am only familiar with the basics with HTML 😕

As for the quote of the day - I am just not sure how or where I can add it. I tried to use [Versatile Banner](https://meta.discourse.org/t/versatile-banner/109133) but it seems to only allow HTML/CSS. I don’t think there’s any HTML code that would allow a dynamic load?

I appreciate any tips and tricks 🙂

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [2019年六月1日 10:53 UTC](https://meta.discourse.org/t/hover-preview-and-quote-of-the-day/119212/2 "2019-06-01T10:53:07Z")

</div>

Didn’t we have something like this related to WoW at one point @Falco? Wouldn’t you want this as a onebox?

Not sure if we have a “random quote” theme component yet.

---

<div class="post-metadata">

### Author: ![FireAllianceNX](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/firealliancenx/32/141959_2.png) [@FireAllianceNX](https://meta.discourse.org/u/FireAllianceNX)
#### Post date: [2019年六月1日 12:44 UTC](https://meta.discourse.org/t/hover-preview-and-quote-of-the-day/119212/3 "2019-06-01T12:44:48Z")

</div>

I’ll google what onebox is in the meantime 😃  
The Quote of the Day code is something like this:

```plaintext
<script type="text/javascript" language="JavaScript">
//<![CDATA[
<!-- Begin
var quote=new Array()
quote[0]="Say your name. You all sound the same when you are panicking. - <b>Togalog</b>";
.
.
.
quote[110]="Did you try saran wrap? - <b>Xb</b>";

var Q = quote.length;
var whichQuotation=Math.round(Math.random()*(Q-1));
function showQuotation(){document.write(quote[whichQuotation]);}
showQuotation();

// End -->
//]]>
</script>
```

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [2019年六月1日 13:17 UTC](https://meta.discourse.org/t/hover-preview-and-quote-of-the-day/119212/4 "2019-06-01T13:17:36Z")

</div>

> [@codinghorror](#):
>
> Didn’t we have something like this related to WoW at one point @Falco? Wouldn’t you want this as a onebox?

Close, we did it for HearthStone and Artifact as a proofs of concept:

[https://github.com/xfalcox/discourse-artifact/](https://github.com/xfalcox/discourse-artifact/)

[https://github.com/xfalcox/discourse-hearthstone](https://github.com/xfalcox/discourse-hearthstone)

 ![](https://global.discourse-cdn.com/meta/original/3X/c/5/c5cdceaa676e3193ad08fbd37e85eb36e8d3bc4e.png)

Nowadays with the improvements @j.jaffeux did on the tool tips for Discourse, it should be even easier.

---

<div class="post-metadata">

### Author: ![FireAllianceNX](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/firealliancenx/32/141959_2.png) [@FireAllianceNX](https://meta.discourse.org/u/FireAllianceNX)
#### Post date: [2019年六月2日 20:46 UTC](https://meta.discourse.org/t/hover-preview-and-quote-of-the-day/119212/7 "2019-06-02T20:46:20Z")

</div>

Writing a plugin is probably beyond my skill-set, my IT skill set is in troubleshooting ☹  
I’ll dig in a little bit and see if there’s enough there for me to attempt to duplicate and pull from WoWhead’s database.

As for the random quote of the day, is there a place that I can just add a block of unfiltered JavaScript with the code I pasted?

---

<div class="post-metadata">

### Author: ![FireAllianceNX](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/firealliancenx/32/141959_2.png) [@FireAllianceNX](https://meta.discourse.org/u/FireAllianceNX)
#### Post date: [2019年八月24日 14:38 UTC](https://meta.discourse.org/t/hover-preview-and-quote-of-the-day/119212/8 "2019-08-24T14:38:00Z")

</div>

我在想，我打算用广告插件里的“站内广告”功能来展示每日随机名言。xD  
看看效果如何。

---

<div class="post-metadata">

### Author: ![MidnightCheesePizza](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/midnightcheesepizza/32/195297_2.png) [@MidnightCheesePizza](https://meta.discourse.org/u/MidnightCheesePizza)
#### Post date: [2020年九月25日 21:57 UTC](https://meta.discourse.org/t/hover-preview-and-quote-of-the-day/119212/9 "2020-09-25T21:57:13Z")

</div>

我知道我刚刚用这条回复复活了这个帖子，但我正在寻找与 @FireAllianceNX 完全一致的 WoWhead 工具提示内容。

至少，我需要知道在 Discourse 安装的头部或起始位置将以下代码放在哪里：

```plaintext
<script>const whTooltips = {colorLinks: true, iconizeLinks: true, renameLinks: true};</script>
<script src="https://wow.zamimg.com/widgets/power.js"></script>

```

不确定它是否值得做成插件，但如果我可以将这段代码粘贴到某个安全的地方，请告诉我。  
非常感谢！

---

<div class="post-metadata">

### Author: ![MidnightCheesePizza](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/midnightcheesepizza/32/195297_2.png) [@MidnightCheesePizza](https://meta.discourse.org/u/MidnightCheesePizza)
#### Post date: [2020年九月26日 04:54 UTC](https://meta.discourse.org/t/hover-preview-and-quote-of-the-day/119212/10 "2020-09-26T04:54:04Z")

</div>

**更新** ：

我刚刚尝试将脚本添加到“Admin \> Customize \> Edit CSS/HTML”中的 `<head>` 之前部分，但毫无效果。在帖子中以两种方式（使用超链接和原始 HTML）发布 Wowhead 链接，仍然无法触发提示框。

测试帖子：[https://deposit.midnightexchange.com/t/wowhead-tooltips-test/17](https://deposit.midnightexchange.com/t/wowhead-tooltips-test/17)

有什么建议吗？
