V10 course republished in 17: doesn't work. Also JS.

carlfink
carlfink Community Member Posts: 971 ✭ Legend ✭
So I have a course that was done by a third-party developer years ago in Lectora Publisher 10. He/she apparently wasn't very comfortable with Lectora, because a lot of very basic functionality seems to be in external JavaScript files, instead of Lectora itself. For instance, closed captions are displayed using JS to create a Div, format it extensively with HTML tags, and then show or hide it--the original developer didn't even feel comfortable using Lectora hide and show actions, it's all done via JS.

Some functionality has broken with versioning. If I publish it from V17.0, the closed captions don't display at all. If I publish from V16, the closed caption box displays but contains no text, just "Undefined". Was there a change in JS handling between those versions?

Audio is also played by the JS. Well, in Internet Explorer it is. In Chrome the audio never plays.

I doubt anyone can help me actually fix this. (For one thing due to confidentiality I can't upload the course.) I'm just wondering if anyone has tips or advice. I'm inclined to just refactor the entire course myself at this point rather than debug someone else's JavaScript, which isn't needed in the first place.

Thanks.

Comments

  • _
    _ Community Member Posts: 84
    Hi Carl,

    I know 'Publish to Seamless Play' can cause havoc with Javascript - do you have this enabled in L17?

    Cheers,

    Cam
  • carlfink
    carlfink Community Member Posts: 971 ✭ Legend ✭
    Cam, I tried it both with and without Seamless Play, and as I said I also tried V16, which doesn't even have SP.
  • mnotermans5114
    mnotermans5114 Community Member Posts: 916
    Besides from SP in Lectora 17 quite a few differences with Javascript. If you dont fix those, JS seldom will work. Most notable is any reference to 'document' or 'pageDiv' will fail in Lectora 17. All Javascript need to use the functionality as described in this document to work in 17
    http://community.trivantis.com/knowledge-base/containing-containers-custom-javascript-suggestions-lectora-online/
    Kind regards,

    Math
  • mnotermans5114
    mnotermans5114 Community Member Posts: 916
    One more thing remembering from my own Lectora X10 days... because in Lectora you couldnot easily set a class to a specific element, that needed to be done in Javascript... that too might cause problems when going from 10 -> 16 and up. CSS classes were only introduced in version 12 if im not wrong. I actually do have several X10 courses i converted and published without big issues to v16...
  • carlfink
    carlfink Community Member Posts: 971 ✭ Legend ✭
    Math, I got involved in other projects and just got back to this, so let me tardily say: thank you very much.
  • carlfink
    carlfink Community Member Posts: 971 ✭ Legend ✭
    I don't suppose anyone has an example using getCurrentPageDiv()? When I publish the course and watch JS execution in the browser console, the interpreter complains that
    cc_text_code.js:125 Uncaught ReferenceError: getCurrentPageDiv is not defined
    The relevant code is:
    getCurrentPageDiv().innerHTML += html ;
    Where "html" is a variable containing the HTML required to draw a Div containing the closed caption for the current page.

    All help appreciated.
  • wheels
    wheels Florida USACommunity Member, Administrator, Moderator, Rockstar Manager Posts: 603 eLearning ROCKSTAR Admin Team
    If you are working in Lectora Desktop and are not on the latest version, they use C++ format rules for the functions (which means an uppercase first letter).

    Try GetCurrentPageDiv() instead, and this will be true for the other API calls as well.
  • carlfink
    carlfink Community Member Posts: 971 ✭ Legend ✭
    Capitalization is the issue? Because Lectora Desktop doesn't match the only (very sketchy) documentation?
  • mnotermans5114
    mnotermans5114 Community Member Posts: 916
    My own default setup for Lectora 17 ( v.17.0.6 i still use , cannot guarantee it works in the last updates, cause read so many issues with those ). Works fine in seamless too.