News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Help: html tag with javascript

Started by wjhdiz, January 01, 2013, 12:17:31 PM

Previous topic - Next topic

wjhdiz

Hi,

I have been trying to add Galleria slideshow in a post. The following script within html tag seems not working:

   <script>

    // Load the Twelve theme
    Galleria.loadTheme('galleria/themes/twelve/galleria.twelve.min.js');

    // Initialize Galleria
    Galleria.run('#galleria');

    </script>


Any suggestions or help are greatly appreciated.

Thanks in advance.
Jimmy
Freedom of speech? It is freer if not speaking out.
Believing in God? Yes, talk with God every day through God creations.
Coding is poem and a way of keeping away from the troubled world.

mashby

Does this even exist?
    Galleria.loadTheme('galleria/themes/twelve/galleria.twelve.min.js');
Do you also have an element ID of galleria?
Always be a little kinder than necessary.
- James M. Barrie

Arantor

I don't think that matters, Galleria doesn't exist in JavaScript, meaning that an entire JS file is still required to be loaded first...

wjhdiz

#3
I made a test here: test in simple portal html block through a html block in simple portal. It workes. However, the code added in the post within html tag failed using html tag Test in post. I suspect that this has things to do with smf 2.0.x security upgrade(s)...
QuoteIn fact,

  • I just found out that some of the original posts with html tags failed due to these updates.
  • The extra &#32 for white space causes the problem.
  • Does this mean that there is a way to fix it? For the issue that I have now, I removed white space characters manually and it worked.
For security reason, I allow only the site admin to use html tag so that no other member is allowed to use html tag in post.


        <div id="galleria">   
            <a href="http://upload.wikimedia.org/wikipedia/commons/thumb/3/36/Icebergs_in_the_High_Arctic_-_20050907.jpg/1000px-Icebergs_in_the_High_Arctic_-_20050907.jpg">
                <img title="Icebergs in the High Arctic"
                     alt=""The debris loading isn't particularly extensive, but the color is usual.""
                     src="http://upload.wikimedia.org/wikipedia/commons/thumb/3/36/Icebergs_in_the_High_Arctic_-_20050907.jpg/100px-Icebergs_in_the_High_Arctic_-_20050907.jpg">
            </a>
            <a href="http://upload.wikimedia.org/wikipedia/commons/thumb/f/fe/Araña._A_Estrada,_Galiza._02.jpg/1000px-Araña._A_Estrada,_Galiza._02.jpg">
                <img title="Araña"
                     alt="Xysticus cristatus, A Estrada, Galicia, Spain"
                     src="http://upload.wikimedia.org/wikipedia/commons/thumb/f/fe/Araña._A_Estrada,_Galiza._02.jpg/100px-Araña._A_Estrada,_Galiza._02.jpg">
            </a>
            <a href="http://upload.wikimedia.org/wikipedia/commons/thumb/2/2d/9104_-_Milano_-_Museo_storia_naturale_-_Fluorite_-_Foto_Giovanni_Dall'Orto_22-Apr-2007.jpg/1000px-9104_-_Milano_-_Museo_storia_naturale_-_Fluorite_-_Foto_Giovanni_Dall'Orto_22-Apr-2007.jpg">
                <img title="Museo storia naturale"
                     src="http://upload.wikimedia.org/wikipedia/commons/thumb/2/2d/9104_-_Milano_-_Museo_storia_naturale_-_Fluorite_-_Foto_Giovanni_Dall'Orto_22-Apr-2007.jpg/100px-9104_-_Milano_-_Museo_storia_naturale_-_Fluorite_-_Foto_Giovanni_Dall'Orto_22-Apr-2007.jpg">
            </a>
            <a href="http://upload.wikimedia.org/wikipedia/commons/thumb/1/15/Grjótagjá_caves_in_summer_2009_(2).jpg/1000px-Grjótagjá_caves_in_summer_2009_(2).jpg">
                <img title="Grjótagjá caves in summer 2009"
                     src="http://upload.wikimedia.org/wikipedia/commons/thumb/1/15/Grjótagjá_caves_in_summer_2009_(2).jpg/100px-Grjótagjá_caves_in_summer_2009_(2).jpg">
            </a>
            <a href="http://upload.wikimedia.org/wikipedia/commons/thumb/9/90/20091128_Loutra_Thermes_Xanthi_Thrace_Greece_2.jpg/1000px-20091128_Loutra_Thermes_Xanthi_Thrace_Greece_2.jpg">
                <img title="Thermes"
                     alt="Xanthi hot-spa springs, Xanthi Prefecture, Greece"
                     src="http://upload.wikimedia.org/wikipedia/commons/thumb/9/90/20091128_Loutra_Thermes_Xanthi_Thrace_Greece_2.jpg/100px-20091128_Loutra_Thermes_Xanthi_Thrace_Greece_2.jpg">
            </a>
            <a href="http://upload.wikimedia.org/wikipedia/commons/thumb/5/58/Polish_Army_Kołobrzeg_077.JPG/1024px-Polish_Army_Kołobrzeg_077.JPG">
                <img title="Polish Army Kołobrzeg"
                     alt="A display of the Polish Army. Both the soldier, and the vehicle belong to the 7th Pomeranian Coastal Defence Brigade, a part of the Szczecin-based 12th Mechanized Division "Bolesław Krzywousty""
                     src="http://upload.wikimedia.org/wikipedia/commons/thumb/5/58/Polish_Army_Kołobrzeg_077.JPG/100px-Polish_Army_Kołobrzeg_077.JPG">
            </a>
            <a href="http://upload.wikimedia.org/wikipedia/commons/thumb/2/2d/20100213_Zlatograd_Bulgaria_3.jpg/1024px-20100213_Zlatograd_Bulgaria_3.jpg">
                <img title="Zlatograd Bulgaria"
                     src="http://upload.wikimedia.org/wikipedia/commons/thumb/2/2d/20100213_Zlatograd_Bulgaria_3.jpg/100px-20100213_Zlatograd_Bulgaria_3.jpg">
            </a>
            <a href="http://upload.wikimedia.org/wikipedia/commons/thumb/b/b5/FEMA_-_5399_-_Photograph_by_Andrea_Booher_taken_on_09-28-2001_in_New_York.jpg/1024px-FEMA_-_5399_-_Photograph_by_Andrea_Booher_taken_on_09-28-2001_in_New_York.jpg">
                <img title="09-28-2001 in New York City"
                     alt="New York, NY, September 28, 2001 -- Debris on surrounding roofs at the site of the World Trade Center. Photo by Andrea Booher/ FEMA News Photo"
                     src="http://upload.wikimedia.org/wikipedia/commons/thumb/b/b5/FEMA_-_5399_-_Photograph_by_Andrea_Booher_taken_on_09-28-2001_in_New_York.jpg/100px-FEMA_-_5399_-_Photograph_by_Andrea_Booher_taken_on_09-28-2001_in_New_York.jpg">
            </a>
            <a href="http://upload.wikimedia.org/wikipedia/commons/thumb/e/e6/Antennae,_Hubble_images.jpg/1024px-Antennae,_Hubble_images.jpg">
                <img src="http://upload.wikimedia.org/wikipedia/commons/thumb/e/e6/Antennae,_Hubble_images.jpg/100px-Antennae,_Hubble_images.jpg">
            </a>
        </div>
    <script>

    // Load the Twelve theme
    Galleria.loadTheme('galleria/themes/twelve/galleria.twelve.min.js');

    // Initialize Galleria
    Galleria.run('#galleria');

    </script>
Freedom of speech? It is freer if not speaking out.
Believing in God? Yes, talk with God every day through God creations.
Coding is poem and a way of keeping away from the troubled world.

Arantor

QuoteI suspect that this has things to do with smf 2.0.x security upgrade(s)...

Nope.

OK, so now we have a test link I can see you're using a theme from DzinerStudio but aren't respecting the terms of their licence (which is to leave a link back to their site on it)

I can also see what your problem is - the problem isn't malformed code but the way you're putting it into the html bbc tag and it's adding extra formatting. I won't explain any further until the theme's copyright is properly restored.

wjhdiz

#5
Hi Arantor,

Quote from: Arantor on January 01, 2013, 10:07:18 PM
I can see you're using a theme from DzinerStudio but aren't respecting the terms of their licence (which is to leave a link back to their site on it)
Thanks for your advice and I just saw your post regarding to the Copyright... I put the original copyright back. BTW, it is only a test not a live site at all.
For the extra formatting characters, I removed them manually and it works now. I thought it was not an issue before these 2 or 3 recent updates.

Thanks again.
Jimmy
Freedom of speech? It is freer if not speaking out.
Believing in God? Yes, talk with God every day through God creations.
Coding is poem and a way of keeping away from the troubled world.

Advertisement: