Action grpups from Javascript in Lectora Online

mnotermans5114
Community Member Posts: 916 ☆ Roadie ☆
@wheels
Hi Joe,
First of all...happy and creative 2020... Somewhere last year you created a script that can be used to 'Run ActionGroups from Javascript' by adding some prefix (EDU_ ) in front of it...and then in your Javascript you can just call that specific name without having to worry about HTMLnames of those actiongroups. I added that to my scripts-workflow and it works perfectly in Lectora Online..
Now however i am trying to use Seamless Play on a title... and your script now doesnot recognize the prefixes anymore. This is the function based on your setup i made and use....
If you can check whats causing this not to work in Seamless... would be great...
Thx,
Math
Hi Joe,
First of all...happy and creative 2020... Somewhere last year you created a script that can be used to 'Run ActionGroups from Javascript' by adding some prefix (EDU_ ) in front of it...and then in your Javascript you can just call that specific name without having to worry about HTMLnames of those actiongroups. I added that to my scripts-workflow and it works perfectly in Lectora Online..
Now however i am trying to use Seamless Play on a title... and your script now doesnot recognize the prefixes anymore. This is the function based on your setup i made and use....
function definePresetforActiongroups(){
// set whatever prefix you want to use for object names that will map to their HTML object
var objectPrefix = "ACT";
console.log("preset is "+objectPrefix);
var chlds = getDisplayDocument().head.childNodes;
for (var i=0;i<chlds.length;i++)
{
if (chlds[i].tagName && chlds[i].tagName.toLowerCase().indexOf('script')>-1 &&
chlds[i].innerHTML && chlds[i].innerHTML.indexOf('trivWeb20Popups')>-1 )
{
var re = new RegExp("var\\s*([^\\s]*).*//("+objectPrefix+"[^\\s]*)",'g');
var s = chlds[i].innerHTML;
s.replace(re, function(match, g1, g2) {
eval("window."+g2+"="+g1);
});
}
}
}
If you can check whats causing this not to work in Seamless... would be great...
Thx,
Math
Comments
-
@wheels
Hi Joe,
Alas this didnot fix it.
Getting this error in my console...
Uncaught (in promise) ReferenceError: ACT_changetextfields is not defined
at Array.forEach (<anonymous>)
Too bad i get quite some more errors in Seamless Play on my setup... and for now i cannot share my project because its quite complex. Either i forget SP for now, or build a SPA like approach for it..
Thx,
Math -
In fact after proper check only the Action Groups call and a dynamic fill in of YouTube movies isnot working properly in Seamless Play... so if i can get that working that would be great...
This works properly in Seamless Play
//ACT_changetextfields.issueActions(1001);
og154956.issueActions(1001);
This doesnot work in Seamless Play
ACT_changetextfields.issueActions(1001);
//og154956.issueActions(1001);
In normal mode both work.... -
wheels Florida USACommunity Member, Administrator, Moderator, Rockstar Manager Posts: 665 eLearning ROCKSTAR Admin Team@mnotermans5114 This is way beyond what needs to be in the forum! You have my email, please email me directly about this.
-
Categories
- 35.8K All Categories
- 108 ✫ Announcements
- 33.1K Lectora®
- 31.1K Lectora Discussions
- 28.9K Lectora Desktop
- 2K Lectora Online
- 2K Lectora Feature Requests
- 71 Lectora User Groups
- 36 Lectora Accessibility User Group (LAUG)
- 22 ELB Learning Content
- 22 ELB Learning Content Discussions
- 321 CenarioVR®
- 188 CenarioVR Discussions
- 133 CenarioVR Feature Requests
- 41 Rockstar Learning Platform®
- 38 Rockstar Learning Platform Discussions
- 108 CourseMill®
- 108 CourseMill Discussions
- 47 ReviewLink®
- 47 ReviewLink Discussions
- 5 The Training Arcade®
- 5 The Training Arcade Discussions
- 934 All Things eLearning
- 36 eLearning Development
- 546 Learning Management System (LMS) Integration
- 332 Web Accessibility
- 1.2K ♪ The Green Room
- 9 Additional Learning Products