[pmwiki-devel] Inserting Javascript

2 views
Skip to first unread message

Simon

unread,
Nov 1, 2021, 5:27:37 AM11/1/21
to PmWiki Devel Mailing List
It's easy to add CSS to PmWiki, a group, or a page.

Is there some way of doing something similar for Javascript?

I had a scan of the documentation, but it wasn't oo obvious to me.

e.g. I'd like to add this https://browser-update.org/#install to my wiki

thanks

Simon

Petko Yotov

unread,
Nov 1, 2021, 8:36:14 AM11/1/21
to Simon, PmWiki Devel Mailing List
On 01/11/2021 10:26, Simon wrote:
> It's easy to add CSS to PmWiki, a group, or a page.
>
> Is there some way of doing something similar for Javascript?
>
> I had a scan of the documentation, but it wasn't oo obvious to me.

Yes, you can inject JavaScript either in the skin template, or in the
$HTMLHeaderFmt or $HTMLFooterFmt arrays.

Example for the latter: see scripts/stdconfig.php injecting
pub/pmwiki-utils.js.


> e.g. I'd like to add this https://browser-update.org/#install to my
> wiki

In this case (script injecting another script) I'd go with either the
skin template, or $HTMLHeaderFmt:

$HTMLHeaderFmt['browser-update'] = '
<script>
// the code generated in the form on the above link
</script>';

Petko

--
If you upgrade : http://www.pmwiki.org/Upgrades



_______________________________________________
pmwiki-devel mailing list
pmwiki...@pmichaud.com
http://www.pmichaud.com/mailman/listinfo/pmwiki-devel
Reply all
Reply to author
Forward
0 new messages