Loading...
 
Features / Usability

Features / Usability


problems with JS plugin

posts: 3665 United States

I'm tyring use the JS plugin to add some javascript (hosted on another site) to a wiki page.

I'm using the following:
{JS(file=http://www.cmsreview.com/timelines/skyFeed.html?FeedURL=http://www.cmscalendar.com/cms-glossfeed.html)}{JS}

But TIKI generates the following code:

Image
Copy to clipboard
<script type="text/javascript" src="http://www.cmsreview.com/timelines/skyFeed.html?FeedURL">


-- it drops everything after the = sign. Anyone know what's going on?

-Rick

posts: 5

> I'm tyring use the JS plugin to add some javascript (hosted on another site) to a wiki page.
>
> I'm using the following:
> {JS(file=http://www.cmsreview.com/timelines/skyFeed.html?FeedURL=http://www.cmscalendar.com/cms-glossfeed.html)}{JS}
>
> But TIKI generates the following code:

> Image
Copy to clipboard
<script type="text/javascript" src="http://www.cmsreview.com/timelines/skyFeed.html?FeedURL"> >

>
> — it drops everything after the = sign. Anyone know what's going on?
>
> -Rick^

Well, how about Tiki is thinking that the second = is another parameter... Maybe you need to wrap this into quotes?

posts: 3665 United States

Yup, wrapping in quotes did the trick. Interestingly enough, even when I encodded the "=" as "%3D" it still didn't work.

Oh well....

-Rick


posts: 1092

THere is a stupid split on = in the parsing

Try this
Replace in lib/tikilib.php

Image
Copy to clipboard
$parts = $this->quotesplit( '=>?', $param ); if (isset($parts[0]) && isset($parts[1])) { $name = trim($parts[0]); $argument = trim($parts[1]);

Image
Copy to clipboard
if (preg_match("/([^=]*)=>? *\"?(.*)\"?/", $param, $parts) && isset($parts[1]) && isset($parts[2])) { $name = trim($parts[1]); $argument = trim($parts[2]);


Tell me if you see some problem around the plugin interpretation. Otherwise I will commit after some more test... It is a slow process to test the parsing
sylvie


Upcoming Events

1)  18 Apr 2024 14:00 GMT-0000
Tiki Roundtable Meeting
2)  16 May 2024 14:00 GMT-0000
Tiki Roundtable Meeting
3)  20 Jun 2024 14:00 GMT-0000
Tiki Roundtable Meeting
4)  18 Jul 2024 14:00 GMT-0000
Tiki Roundtable Meeting
5)  15 Aug 2024 14:00 GMT-0000
Tiki Roundtable Meeting
6)  19 Sep 2024 14:00 GMT-0000
Tiki Roundtable Meeting
7) 
Tiki birthday
8)  17 Oct 2024 14:00 GMT-0000
Tiki Roundtable Meeting
9)  21 Nov 2024 14:00 GMT-0000
Tiki Roundtable Meeting
10)  19 Dec 2024 14:00 GMT-0000
Tiki Roundtable Meeting