SemanticResultFormats
SemanticResultFormats copied to clipboard
Proposal for correcting result format - gallery (redirect and overlay)
Setup
- SMW version: 5.0.2
- MW version: 1.43.1
- PHP version: 8.3.12
- DB system (MySQL, Blazegraph, etc.) and version: MariaDB 10.11.11 - Fedora 42
Issue
Detailed description of the issue and a stack trace if applicable:
Hello,
I just migrated from MediaWiki 1.39 to 1.43 and I'm using SemanticResultFormats, gallery format options, redirects, and overlay. I've found a few errors.
In the HTML code, the "image" class has been replaced by "a.mw-file-description". So in the ext.srf.gallery.redirect.js file, the line "image = $this.find( 'a.image' );" should be replaced by "image = $this.find( 'a.mw-file-description' );" and in the "ext.srf.gallery.overlay.js" file, the lines "image = $this.find( 'a.image' ), imageText = $.trim( $this.find( '.gallerytext p' ).text() );" should be replaced by "image = $this.find( 'a.mw-file-description' ), imageText = $.trim( $this.find( '.gallerytext' ).text() );". Otherwise, a red message appears indicating that the image was not found.
In the "fancybox" application, the jquery.fancybox-1.3.4.pack.js file, a function is deprecated and must be adapted to work. The string "{j.get(0).style.removeAttribute("filter");f.get(0).style.removeAttribute("filter")}" must be replaced with "{j.get(0).style.removeProperty("filter");f.get(0).style.removeProperty("filter")}".
For the sake of convenience, I replaced FancyBox v1.3.4 with v3.5.7. I've attached the modified "ext.srf.gallery.overlay.js" zipped file. Obviously, the "Resources.php" file must be adapted. Note: I added for me the French translation to the "jquery.fancybox.js" file:
fr: {
CLOSE: "Fermer",
NEXT: "Suivant",
PREV: "Précédent",
ERROR: "Le contenu demandé ne peut être chargé. <br/> SVP Veuillez essayer plus tard.",
PLAY_START: "Démarrage du diaporama",
PLAY_STOP: "Pause du diaporama",
FULL_SCREEN: "Plein écran",
THUMBS: "Vignettes",
DOWNLOAD: "Télécharger",
SHARE: "Partager",
ZOOM: "Zoom"
},
With these fixes, my problems have disappeared.
I'm using Fedora 42, PHP 8.3.21 (Remi), MariaDB 10.11.11, Mediawiki 1.43.1, Semantic Mediawiki 5.0.2, and Semantic Result Formats 5.0.0.
I hope this helps you.
Best regards,
A. De Bast
Steps to reproduce the observation (recommendation is to use the sandbox):
To me it looks like this would also fix #937
Example of breakage using 'overlay' option: https://wiki.freephile.org/wiki/Logo If I get a chance, I'll try to fix and submit a PR - but can't at the moment.
Thank for your reply.
A detail of the correction I use, can be found in my blog at the URL: https://www.adbweb.gslb.eu/wiki/index.php?title=LINUX:Semantic_MediaWiki_-_R%C3%A9cup%C3%A9ration_des_paquets_et_mise_en_place#Extension_SemanticResultFormats If this can help you. But it's in french. Sorry
The correction is very little, one word in two scripts. But that is not a problem for me after the corrections.
Albert
I have a page (https://wiki.freephile.org/wiki/Logo) illustrating the problem. The screenshot below shows what it looked like when broken.
The current page shows that the (applied) fix works.
the PR above should (at least partially) fix Issue #937