Html names of Action groups

mnotermans5114
mnotermans5114 Community Member Posts: 916
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 ???

Comments

  • wheels
    wheels Community Member, Administrator, Moderator, Rockstar Manager Posts: 530 eLearning ROCKSTAR Admin Team
    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.
  • mnotermans5114
    mnotermans5114 Community Member Posts: 916
    Thx Joe, trying and checking this out...
  • mnotermans5114
    mnotermans5114 Community Member Posts: 916
    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
  • wheels
    wheels Community Member, Administrator, Moderator, Rockstar Manager Posts: 530 eLearning ROCKSTAR Admin Team
    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
  • mnotermans5114
    mnotermans5114 Community Member Posts: 916
    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...

     
Sign In or Register to comment.

So You Wanna Be An eLearning ROCKSTAR?

We're all fans of eLearning here! Want to become an eLearning ROCKSTAR? Just click on one of the buttons below to start your rocking journey!