Zikula: A Flexible Open Source Content Management System
home | forum | contact us

Dizkus

Goto page: 1 - 2 [+1]

Bottom
Embedding JavaScript and/or Java applets
  • Posted: 30.12.2007, 13:50
     
    mgaffney
    rank:
    Freshman Freshman
    registered:
     January 2005
    Status:
    offline
    last visit:
    24.01.08
    Posts:
    23
    I've been trying to embed either JavaScript or Java applets onto my page. In administration, I've enabled and with attributes, and I can't seem to get either to display properly. I'm pretty sure I've also enabled Safe HTML.

    Anyone have thoughts on what might be happening here? Thanks to anyone who can help! icon_biggrin
  • Posted: 30.12.2007, 18:48
     
    kaffeeringe.de
    rank:
    Professional Professional
    registered:
     September 2002
    Status:
    offline
    last visit:
    19.11.08
    Posts:
    879
    What happens instead?

    --
    best regards from Kiel, sailing city

    Steffen Voss

    Member of the PostNuke Steering Committee
    Read The Zikulan's Blog
  • Posted: 31.12.2007, 05:39
     
    mgaffney
    rank:
    Freshman Freshman
    registered:
     January 2005
    Status:
    offline
    last visit:
    24.01.08
    Posts:
    23
    Nothing - the text before and after the embedded applet/scripts displays, but nothing else. Everything between the opening and closing tags for the applet and scripts does not display at all...
  • Posted: 31.12.2007, 06:23
     
    videokid
    rank:
    Professional Professional
    registered:
     March 2003
    Status:
    offline
    last visit:
    19.11.08
    Posts:
    901
    A link might help to check out the source...

    - Igor

    --
    Have a nice day
    zikulapro.be is currently running
    Zikula 1.0.2
  • Posted: 01.01.2008, 00:24
     
    mgaffney
    rank:
    Freshman Freshman
    registered:
     January 2005
    Status:
    offline
    last visit:
    24.01.08
    Posts:
    23
    Hey Igor:

    Here's the link to the main page: www.laxref.com

    On the main page, you're supposed to see a Java Applet (countdown) between "Countdown to the 2008 World Field Lacrosse Games" and "You need Java to see this applet!", and a script pulling the weather forecast from weather.ca is supposed to show up after "Current Weather in Coquitlam, BC".

    Thanks for your help! icon_razz
  • Posted: 01.01.2008, 07:23
     
    AmmoDump
    rank:
    Professional Professional
    registered:
     December 2003
    Status:
    offline
    last visit:
    21.11.08
    Posts:
    2975
    Wheres the script?


    --
    David Pahl
    Zikula Support Team
  • Posted: 03.01.2008, 01:30
     
    mgaffney
    rank:
    Freshman Freshman
    registered:
     January 2005
    Status:
    offline
    last visit:
    24.01.08
    Posts:
    23
    The script is to come after the "Current weather in Coquitlam..." - it's pulling a dynamic weather image from a Web site.
  • Posted: 03.01.2008, 17:03
     
    Topiatic
    rank:
    Professional Professional
    registered:
     November 2003
    Status:
    offline
    last visit:
    06.11.08
    Posts:
    1675
    Can you please post the template contents here.

    --
    Under Construction!
  • Posted: 04.01.2008, 03:57
     
    videokid
    rank:
    Professional Professional
    registered:
     March 2003
    Status:
    offline
    last visit:
    19.11.08
    Posts:
    901
    IMHO I think he inserted it in an admin message.. probably better to use it indeed in a template....
    No sure, but mgaffeny could tell us more... icon_smile

    - Igor

    --
    Have a nice day
    zikulapro.be is currently running
    Zikula 1.0.2
  • Posted: 04.01.2008, 04:16
     
    mgaffney
    rank:
    Freshman Freshman
    registered:
     January 2005
    Status:
    offline
    last visit:
    24.01.08
    Posts:
    23
    I haven't used the viewTopiaryWorks method before, but you're right, I am currently using this in an adminstration message, not a template. It surprises me that this doesn't work, as I had no issues with using either of these prior to my PostNuke upgrade, so I'm leaning towards issues with security?

    Anyways, here is the exact code from the HTML in the Administrator message (if it helps any):

    Java applet:


    You need Java to see this applet!


    JavaScript:
    Current Weather in Coquitlam, BC:
    var LocationID = 'CABC0066';



    Hope this helps - if not, let me know, and I'll provide you with whatever other information you need. Thanks!

    Marty icon_biggrin
  • Posted: 04.01.2008, 10:55
     
    Topiatic
    rank:
    Professional Professional
    registered:
     November 2003
    Status:
    offline
    last visit:
    06.11.08
    Posts:
    1675
    Hhmmm ok give this a try to see if it helps, go to Admin > System > Settings and way down at the bottom you'll find the 'Enable Safehtml sanitation for output' switch... if it's on try turning it off. While you're there make sure that the tags you're using to embed are 'enabled with params' in the table above the switch.

    Also, remember to delete any cache's you're using before expecting to see the results.

    --
    Under Construction!
  • Posted: 04.01.2008, 13:08
     
    Topiatic
    rank:
    Professional Professional
    registered:
     November 2003
    Status:
    offline
    last visit:
    06.11.08
    Posts:
    1675
    I'd forgotten Environment Canada had an applet available, after some digging I found it on a backup disk and tested it under pn8. The pn764 AdminMessages module is API compliant so I think the rules should translate.

    The only way it worked as an edit of an Admin_Messages message was with safeHTML 'off' and the tag 'embed' set to 'Allowed with Attributes'. But I don't think that's a good idea as it enables anyone who can post anything to use 'embed'.

    However dropping it into any of the relevant templates works just fine, I tested with home.htm, master.htm and a custom admin_messages_block_messages.htm.



    --
    Under Construction!
  • Posted: 10.01.2008, 09:00
     
    mgaffney
    rank:
    Freshman Freshman
    registered:
     January 2005
    Status:
    offline
    last visit:
    24.01.08
    Posts:
    23
    Hey:

    Enabling safe HTML sanitation for output fixed my JavaScript, but the Java applet still has just the code, despite allowing both under Settings with attributes. I tried a number of different JavaScript countdowns, and none of them seemed to display properly, whether having them embedded on the page or referenced in a separate file. Any thoughts?

    Thanks so much for your help up to this point! icon_biggrin
  • Posted: 10.01.2008, 09:29
     
    Topiatic
    rank:
    Professional Professional
    registered:
     November 2003
    Status:
    offline
    last visit:
    06.11.08
    Posts:
    1675
    Can you post the script here inside of code tags so I can experiment with it?

    --
    Under Construction!
  • Posted: 10.01.2008, 12:44
     
    denisrf
    rank:
    Helper Helper
    registered:
     February 2005
    Status:
    offline
    last visit:
    17.11.08
    Posts:
    411
    Seeing as that applet tag is is an admin message the first thing I'd do is get the HTML correct. Looking at the page source I see it is a mixture of HTML entities and none quoted elements:

    Code

    <APPLET code="www.laxref.com/files/countdown/CountDown.class" width=80 height=30 hspace=0 vspace=0 align=absmiddle alt="Countdown applet">


    Try It like

    Code

    (APPLET code="www.laxref.com/files/countdown/CountDown.class" width="80" height="30" hspace="0" vspace="0" align="absmiddle" alt="Countdown applet")


    Change (for< and )for>

    AFAIR all HTML has to be correct or PostNuke will dump it, safeHTML or not.

Goto page: 1 - 2 [+1]

Main Menu

Extensions Database

Documentation

Development

Login

Donate to Zikula