Jump to content

Topic on Extension talk:SmoothGallery

MW1.15 Not Working - Images on top of each other

16
207.236.106.61 (talkcontribs)

Extension version - 1.1h SmoothGallery - 2.0

When I use the following, I just get all images stacked on top of each other; {{#sgallery: |width=200 |height=300 |showarrows=false |showcarousel=false |showinfopane=false |timed=true |delay=4000 |imagelist=Image1.jpg Image2.jpg Image3.jpg }}

Ryan lane (talkcontribs)

I've tested this with 1.15. It works. I'd check to see if your javascript is being loaded properly. Do you have web developer? See if all of the javascript is loading.

Arkasha (talkcontribs)

I have the same result in MW-1.17wmf1. All the pictures are on top of each other. However, when I press button Show preview I got normal gallery layout like in wiki/Special:NewFiles (Gallery of New files). When I save page I have the problem. How to check that all JS are loading?

Arkasha (talkcontribs)

Just to add. First try was in Firefox browser. Tried in IE-7, the problem remains even in preview mode.

Ryan lane (talkcontribs)

1.17 is a different beast. It is using Resource Loader, which this extension isn't written to support yet.

188.22.159.31 (talkcontribs)

I just upgraded a mediawiki to 1.17.0 and noticed that SmoothGallery isn't working any more. When is SmoothGallery expected to be updated to work with Resource Loader?

Thank you, Christoph

194.15.135.12 (talkcontribs)

Still no answer so let's change the question. :-) Will there be an update for SmoothGallery working with Mediawiki 1.17.0 in the near future?

Regards Norbert

Umoenks (talkcontribs)

For me, the following worked (more ore less):

Add a line like

$outputPage->addHeadItem('mootools', '<script src="' . $extensionpath . '/scripts/mootools.uncompressed.js" type="text/javascript"></script>' );

to the function setGalleryHeaders() in SmoothGalleryClass.php. Then, the gallery did appear, at least. Anyways, the parameters were not passed to the gallery... Seems the SmoothGalleryParser class is not loaded/initialized correctly.

I would appreciate an official update of this marvelous extension very much!

Umoenks (talkcontribs)

The support desk answered something similar to what Ryan said so far (cf. OutputPage::addScript(), where I first thought it was a problem of the OutputPage::addScript() function).

Desperately voting for an update, Ryan! ;)

Zck (talkcontribs)

Fix, works on MW 1.18 and SG 1.1h,
in SmoothGalleryClass.php find (line 283):

$outputPage->addScript( '<script src="' . $extensionpath . '/scripts/mootools.uncompressed.js" type="text/javascript"></script>' );
$outputPage->addScript( '<script src="' . $extensionpath . '/scripts/jd.gallery.js" type="text/javascript"></script>' );
$outputPage->addScript( '<script src="' . $extensionpath . '/scripts/HistoryManager.js" type="text/javascript"></script>' );

and replace it with:

$outputPage->addHeadItem( 'smgal1','<script src="' . $extensionpath . '/scripts/mootools.uncompressed.js" type="text/javascript"></script>' );
$outputPage->addHeadItem( 'smgal2','<script src="' . $extensionpath . '/scripts/jd.gallery.js" type="text/javascript"></script>' );
$outputPage->addHeadItem( 'smgal3','<script src="' . $extensionpath . '/scripts/HistoryManager.js" type="text/javascript"></script>' );

pass parameters fix, in SmoothGallery.php (line 112):

function initSmoothGalleryTag( $input, $argv, $parser ) {
	$output = initSmoothGallery( $input, $args, $parser );

	return $output;
}

replace

function initSmoothGalleryTag( $input, $argv, $parser ) {
	$output = initSmoothGallery( $input, $argv, $parser );

	return $output;
}
Umoenks (talkcontribs)

Zck, actually your patch did not work completely for me. What worked was the hybrid approach fixing function initSmoothGalleryTag(), as suggested by you, and patching SmoothGalleryClass.php as suggested by me.

My configuration: MW 1.17, SG 1.1h

194.15.135.12 (talkcontribs)

Great job Zck! Your Fix is working fine in Version MW 1.18.1, SG 1.1h. I didn't need to add Umoenks fix.

Regards Norbert

166.122.75.18 (talkcontribs)

Zck your pass parameter fix has two blocks of code with the SAME code in each block.

function initSmoothGalleryTag( $input, $argv, $parser ) {

       $output = initSmoothGallery( $input, $argv, $parser );

       return $output;

}

for both. Is one supposed to be different?

Umoenks (talkcontribs)

Yes, one is different. ;) Watch out the $argv parameter. In the second case, it is

$output = initSmoothGallery( $input, $argv, $parser );

instead of

$output = initSmoothGallery( $input, $args, $parser );

which apparently won't work at all.

95.240.172.119 (talkcontribs)

I think the problems is that addScript() sets the script at the end of the page, but window.addEvent() (which requires mootools.js) is in the middle. So, changing addScript() in addHeadItem() only for mootools is enough.

$outputPage->addHeadItem('mootools', '<script src="' . $extensionpath . '/scripts/mootools.uncompressed.js" type="text/javascript"></script>' );

Emanuele

P.S. I'm using MW 19+

Reply to "MW1.15 Not Working - Images on top of each other"