← Older revision
Revision as of 09:46, November 19, 2016
Line 423:
Line 423:
{{ri}}Sorry for bothering you again, but could you make Catnav script show the number of its search results it found? Thank you :) [[User:Chiến Thần Vương|Chiến Thần Vương]] ([[User talk:Chiến Thần Vương|talk]]) 03:23, November 19, 2016 (UTC)
{{ri}}Sorry for bothering you again, but could you make Catnav script show the number of its search results it found? Thank you :) [[User:Chiến Thần Vương|Chiến Thần Vương]] ([[User talk:Chiến Thần Vương|talk]]) 03:23, November 19, 2016 (UTC)
+
+
<div style="margin-left: 24px;">
+
Hi again Chien,<br />
+
First of all, sorry for not replying for your previous message- i must have missed it, so i'll reply to it first. The source for the Navigation Popup script is in [[wp:MediaWiki:Gadget-popups.js]]. Instead of importing it, copy the entire content of the page somewhere else (e.g. a subpage of yours), and import it instead. Before publishing- and this is the part that will allow you to create popups for inserted HTML content- find the pace in the script where the <code>setupTooltips</code> function is declared, and after its function block, add <code>pg.setupTooltips = setupTooltips;</code>, like so:
+
<syntaxhighlight lang="javascript">
+
function setupTooltips(container, remove, force, popData) {
+
...
+
}
+
pg.setupTooltips = setupTooltips;
+
</syntaxhighlight>
+
This will allow you to access this function via the global <code>pg</code> object. Then, after the import lines in your <code>/common.js</code> (or whatever page you use for importing scripts) that import the modified Navigation Popups script and CatNav, add the following script:
+
<syntaxhighlight lang="javascript">
+
$("#catnav").on("catnavpageload", function(e) {
+
pg.setupTooltips(this, null, true)
+
});
+
</syntaxhighlight>
+
Also, i've added a page counter like you asked.<br />
+
[[user:Penguin-Pal|<span style="color: #0e92cf;">Penguin-Pal</span>]] [[user talk:Penguin-Pal|<span style="color: #2e47aa;">(talk)</span>]] 09:46, November 19, 2016 (UTC)
+
</div>
==ChatStatus==
==ChatStatus==