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: 636 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
- 4.8K All Categories
- 6 New Feature Releases
- The Training Arcade®
- Arcades™
- 123 ✫ Announcements
- 9 ✪ Contests
- 34.1K eLearning Brothers® Products
- 33.6K Lectora®
- 31.6K Lectora Discussions
- 1.9K Lectora Feature Requests
- 71 Lectora User Groups
- 16 Asset Library
- 10 AssetLibrary Discussions
- 6 AssetLibrary Feature Requests
- 301 CenarioVR®
- 176 CenarioVR Discussions
- 125 CenarioVR Feature Requests
- 37 Rockstar Learning Platform®
- 25 Rockstar Learning Platform Discussions
- 12 Rockstar Learning Platform Feature Requests
- 4 Off-the-Shelf Course Library
- 3 Off-the-Shelf Course Library Discussions
- 1 Off-the-Shelf Course Library Feature Requests
- 114 CourseMill®
- 107 CourseMill Discussions
- 44 ReviewLink®
- 32 ReviewLink Discussions
- 12 ReviewLink Suggestions
- 2 The Training Arcade®
- 1 The Training Arcade Discussions
- 1 The Training Arcade Feature Requests
- 10 Additional Learning Products
- 2 Adobe®
- 4 Articulate®
- 2 Camtasia®
- Docebo®
- 1 iSpring®
- 1 Microsoft® PowerPoint®
- 930 All Things eLearning
- 5 Course Development Showcase
- 1 eLearning Brothers® Downloads
- 1 Compliance Training
- 11 eLearning Development
- eLearning Game Design
- 7 Instructional Design
- 545 Learning Management System (LMS) Integration
- 2 Mobile Learning
- 21 Visual Design
- 331 Web Accessibility
- 1.2K ♪ The Green Room
- 8 ♡ Community Feedback
- 7 Community Tips