Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #398900 Score: 0
    Profile photo of Math Notermans
    Math Notermans
    Member
    contributor
    intermediate
    advanced
    friend finder
    junior moderator
    advocate
    LUC16 Attendee
    LUC16
    wise owl
    curious george
    131 pts
    @mnotermans5114

    Lately working more and more in Lectora Online. Figured out quite a few changes in how LO uses Javascript.

    One thing i would love to figure out is how to detect the html-name of an actiongroup on runtime. I dont want it hardcoded in my code… i want to use something like  %HTMLNAME%  to detect what the HtmlName of my actiongroup is. Offcourse i cannot add an action to it..because it will be called by some HtmlName.

    In LO now this will call a specified actiongroup…

    og155247.issueActions(1001); // Runs some ActionGroup

    In LO i can see the htmlName…being og155247..
    But how to replace that, so its generic..and when copied will use the new Htmlname ???

    #398999 Score: 0
    Profile photo of Joe Wieloch
    Joe Wieloch
    Moderator
    beginner
    intermediate
    friend finder
    contributor
    LUC16 Attendee
    verified member
    wise owl
    LUC17 Attendee
    advanced
    picture perfect
    74 pts
    @wheels

    Because group objects do not have #HTMLNAME# it isn’t easy to get their HTML object.  I promise we will do something soon to make this easier for this and for executing action groups in general.

    I have attached a script that I use sometimes to abstract objects from their HTML name to a known name which is more portable.  This is my personal script which I’ll try to find a better way to implement in the product.  I would like the html name to be based off of the object name, or customizable.  If you have any ideas about this I’m listening.

    Hope the attached script helps you.

    #399009 Score: 0
    Profile photo of Math Notermans
    Math Notermans
    Member
    contributor
    intermediate
    advanced
    friend finder
    junior moderator
    advocate
    LUC16 Attendee
    LUC16
    wise owl
    curious george
    131 pts
    @mnotermans5114

    Thx Joe, trying and checking this out…

    #399011 Score: 1
    Profile photo of Math Notermans
    Math Notermans
    Member
    contributor
    intermediate
    advanced
    friend finder
    junior moderator
    advocate
    LUC16 Attendee
    LUC16
    wise owl
    curious george
    131 pts
    @mnotermans5114

    Tested it and it works perfect. Now i can make my more complex pages in Lectora Online completely reusable. Tried copying one i am working on now with a lot of variables, actiongroups and Javascript…and works as desired. Any other ( less Javascript minded ) developer now can just copy and paste my pages and they work without having to dive deep into the Javascript.

    Thx Joe.

    Kind regards,
    Math

    This post has received 1 vote up.
    #399032 Score: 0
    Profile photo of Joe Wieloch
    Joe Wieloch
    Moderator
    beginner
    intermediate
    friend finder
    contributor
    LUC16 Attendee
    verified member
    wise owl
    LUC17 Attendee
    advanced
    picture perfect
    74 pts
    @wheels

    Math, that’s great!  It might need a little tweaking for SPP , you know the getDisplayDocument() and getDisplayWindow() methods substituted for document and window respectively.  Let me know if you run into any issues.  Appreciate all the help you give on the forums

    – Joe

    #399034 Score: 0
    Profile photo of Math Notermans
    Math Notermans
    Member
    contributor
    intermediate
    advanced
    friend finder
    junior moderator
    advocate
    LUC16 Attendee
    LUC16
    wise owl
    curious george
    131 pts
    @mnotermans5114

    Yeah i know. Found quite a lot of differences in working with Javascript in LO compared to Inspire or Publisher, but must admit that although i was sceptical about LO untill recently, now working a lot with it, i especially do like the option you can share work easily. And now with your little trick, i can make almost anything good reusable for my teammates.

    A few things i would love if that could be improved/changed, will be listing them soon…

     

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.