Galerie d'images de carreaux

:warning: Ce composant est obsolète. Discourse dispose désormais d’une fonctionnalité de galerie en mosaïque intégrée :


Galeries en grille adaptatives !



Construit à l’aide des bibliothèques open source Masonry et ImagesLoaded de David Desandro - Licence MIT

« … publié sous licence MIT. Amusez-vous bien. »


#### Comment l'utiliser ?

Ce composant ajoute un bouton à l’éditeur de message.

Il vous suffit donc de :

1- Télécharger plusieurs images en utilisant le bouton de téléchargement par défaut de Discourse, puis de surligner le code :

2- Cliquez sur le bouton de galerie.

Vous obtiendrez un aperçu statique des images sélectionnées dans le volet d’aperçu :

C’est fait !


Y a-t-il autre chose que je dois savoir ?

Ce composant ne contient aucun style de couleur ou d’arrière-plan. Il héritera des styles du thème actuel.

Voici le composant de thème exécuté sur un autre thème :

Ce composant de thème maintient également le comportement natif de la lightbox de Discourse, ce qui signifie que cliquer sur l’une des images les ouvrira dans le visualiseur lightbox natif.

Puis-je utiliser à la fois Slick et Tiles en même temps ?

Vous pouvez en être sûr ! :smile:

C’est possible en rendant à la fois les composants slick et tiles d’un thème.

Comme ceci :

Vous pouvez ensuite définir « mon thème » dans l’exemple ci-dessus comme thème par défaut ou le rendre sélectionnable par l’utilisateur, et il inclura à la fois Slick et Tiles.


Un grand merci à tous ceux qui ont aidé en cours de route : :yum:

@dax - Bouton de l’éditeur
@cpradio - Traductions du bouton
@Mittineague - Gestionnaire ajaxComplete
@simon - Gestionnaire api.onPageChange
@vinothkannans - Expression régulière pour l’URL de la page de sujet
@sam - ajout de data-theme-* aux attributs autorisés


Rapports de bogues / Suggestions / PRs bienvenus. :wine_glass:

Installer ce composant de thème

92 « J'aime »

You demonstrated that both Slick & Tiles theme can be used at the same time, but did not explain how. Could you please? (explain how)

1 « J'aime »

That’s a very good point @kaefert thank you for bringing it up :sunflower:
I will edit both the Slick and Tiles topics and clarify what I meant.

In the meantime, to answer your question:

Tile and Slick act independently. What I meant to say here:

is that there is no conflict between Tiles and Slick. If you want to use both Tiles and Slick at the same time, you can! You just have to install both of them, separately.

If you install both of the same time, you get something like this in the composer:

Capture

And if you use both of them in a topic/post you end up with something like this:

3 « J'aime »

The problem I have about activating both at the same time is that I only can set one as default in the admin settings, and can only select one of them in the user settings.
Screenshot%20from%202018-03-10%2015-33-32_crop

1 « J'aime »

I understand :ok_hand:

What you want you do is make Slick and Tiles components of your current theme instead of them being user-selectable themes.

Like this:

You can then make “my theme” in the example above the default theme or make it user-selectable and it would include both Slick and Tiles.

7 « J'aime »

Bugs*

Thanks for reporting @savas

Can you share a little bit more details? The reason why I’m asking is because that looks like a onebox. This theme component only applies styles to images within very specific structure like so

.tiles-initialized {
 // all styles are applied here
}

So it should not have any effect on oneboxes at all.

Does the issue still occur if you disable the the theme temporarily?

2 « J'aime »

i got installed facebook onebox plugin can he mess your plugin ?

1- The Facebook onebox plugin is not supported anymore, you don’t need it.
2- No, there should not be any conflict between the two. Tiles only targets specific images but you have to use the button in the composer to make it work

image

If you’re not sure, check the OP again and let me know if you need more help.

4 « J'aime »

Both the Slick theme component and this one don’t seem to work after upgrading discourse to 2.0.0.beta5. JS Error messages for this one:

I18n.translations.en.js.composer is undefined
@https://discourse-instance/:104:2
O@https://discourse-instance/assets/application-d85c1a58a506702e3c09017c9d92a23100e1ec3c2a620a10440601587bf2d226.js:13:23523
initialize@https://discourse-instance/assets/application-d85c1a58a506702e3c09017c9d92a23100e1ec3c2a620a10440601587bf2d226.js:6:8870
runInstanceInitializers/<@https://discourse-instance/assets/ember_jquery-27e777857b8c0730dacfe09cb11711365d21a5db4f9ee0b85d494e4259cf6cda.js:8:23844
n</e.prototype.each@https://discourse-instance/assets/ember_jquery-27e777857b8c0730dacfe09cb11711365d21a5db4f9ee0b85d494e4259cf6cda.js:8:8774
n</e.prototype.topsort@https://discourse-instance/assets/ember_jquery-27e777857b8c0730dacfe09cb11711365d21a5db4f9ee0b85d494e4259cf6cda.js:8:8272
t</e.prototype.topsort@https://discourse-instance/assets/ember_jquery-27e777857b8c0730dacfe09cb11711365d21a5db4f9ee0b85d494e4259cf6cda.js:8:7670
_runInitializer@https://discourse-instance/assets/ember_jquery-27e777857b8c0730dacfe09cb11711365d21a5db4f9ee0b85d494e4259cf6cda.js:8:24023
runInstanceInitializers@https://discourse-instance/assets/ember_jquery-27e777857b8c0730dacfe09cb11711365d21a5db4f9ee0b85d494e4259cf6cda.js:8:23786
_bootSync@https://discourse-instance/assets/ember_jquery-27e777857b8c0730dacfe09cb11711365d21a5db4f9ee0b85d494e4259cf6cda.js:8:11232
didBecomeReady@https://discourse-instance/assets/ember_jquery-27e777857b8c0730dacfe09cb11711365d21a5db4f9ee0b85d494e4259cf6cda.js:8:17098
invokeWithOnError@https://discourse-instance/assets/ember_jquery-27e777857b8c0730dacfe09cb11711365d21a5db4f9ee0b85d494e4259cf6cda.js:7:19387
flush@https://discourse-instance/assets/ember_jquery-27e777857b8c0730dacfe09cb11711365d21a5db4f9ee0b85d494e4259cf6cda.js:7:19832
flush@https://discourse-instance/assets/ember_jquery-27e777857b8c0730dacfe09cb11711365d21a5db4f9ee0b85d494e4259cf6cda.js:7:20592
end@https://discourse-instance/assets/ember_jquery-27e777857b8c0730dacfe09cb11711365d21a5db4f9ee0b85d494e4259cf6cda.js:7:20937
run@https://discourse-instance/assets/ember_jquery-27e777857b8c0730dacfe09cb11711365d21a5db4f9ee0b85d494e4259cf6cda.js:7:22006
join@https://discourse-instance/assets/ember_jquery-27e777857b8c0730dacfe09cb11711365d21a5db4f9ee0b85d494e4259cf6cda.js:7:22126
u.join@https://discourse-instance/assets/ember_jquery-27e777857b8c0730dacfe09cb11711365d21a5db4f9ee0b85d494e4259cf6cda.js:13:3164
u.bind/<@https://discourse-instance/assets/ember_jquery-27e777857b8c0730dacfe09cb11711365d21a5db4f9ee0b85d494e4259cf6cda.js:13:3370
p@https://discourse-instance/assets/ember_jquery-27e777857b8c0730dacfe09cb11711365d21a5db4f9ee0b85d494e4259cf6cda.js:2:9019
o/</f<@https://discourse-instance/assets/ember_jquery-27e777857b8c0730dacfe09cb11711365d21a5db4f9ee0b85d494e4259cf6cda.js:2:9324
1 « J'aime »

Hi @kaefert, @vchrizz and thank you for reporting :sunflower:

My apologies for not getting to you earlier.

the good news is that I have just tested on v2.0.0.beta5 +120 and both Slick and Tiles seem to be working.

My guess is that subsequent commits to Discourse addressed the issue.

Are you still facing the same problem?

Even better news is that I tinkered a little bit with both Slick and Tiles and they now have much more targeted firing methods that will only fire when needed. Credit here goes to @vinothkannans for the awesome tip.

So if you’re using either Slick or Tiles or both, please update now and let me know if the problem is still there, or if there are any other issues that need to be addressed.

10 « J'aime »

I just upgraded our Discourse instance to the latest commit and reinstalled the two themes components. Everything works again as it worked with beta4! :slight_smile:

Thanks for your help!

3 « J'aime »

I am facing a Problem on beta 2.0.7.
I imported the Theme and configured it as a Child-Theme for my standard “Dark”-Theme.

2018-04-25%2012_01_21-Administration%20-%20Kneipentruppe%20-%20Forum

(Had to split the post because I cannot include more than one image in my posts)

However I just get a blank Screen…any ideas on that?

@Lars Can you check if there are any errors in the browser console?

2 « J'aime »

1 « J'aime »

Ok, thank you. Can you update the theme and check again?

1 « J'aime »

Did an Update and refreshed (cleared cache).
Seems to be the same error.

2 « J'aime »

Ok, try it again one last time :sunflower:. If that does not work I’ll take a deeper look at this and fix it within the next couple of hours.


After the fact edit

Crosspost:

6 « J'aime »

That did the trick, thank you very much for the quick help :slight_smile:

5 « J'aime »