Skip to main content
Inspiring
March 19, 2018
Answered

can I edit Captivate templates to add a few lines to CPM.js file on publish?

  • March 19, 2018
  • 2 replies
  • 575 views

Hello!  I am wondering if there is a way to edit a Captivate publish template (if such exists) to add some custom functionality to the courses.

Currently, after I publish a lesson, I constantly find myself unobfuscating/beautifying the CPM.js file in order to manually add a few lines of code. It would save me tons of time in the long run if I could add those lines to a template or append them to an already published CPM.js in a different, less manual way. 

Any suggestion would be much apprecaited!

Thank you!

This topic has been closed for replies.
Correct answer

I always add a javascript file on publish.

Put your js file:

C:\Program Files\Adobe\Adobe Captivate X x64\HTML\assets\js

if the folder doesn't exist, create it.

Put and include to the file in the index.html located here:

C:\Program Files\Adobe\Adobe Captivate X x64\HTML

Start with the basic listeners and work from there.

interfaceObj, eventEmitterObj;

window.addEventListener( 'moduleReadyEvent', function ( e )
{
'use strict';

interfaceObj = e.Data;
eventEmitterObj = interfaceObj.getEventEmitter();
initStorage();
});

function initializeEventListeners()

'use strict';

if ( interfaceObj )
{
  if ( eventEmitterObj )
  {  
  
   eventEmitterObj.addEventListener( 'CPAPI_SLIDEENTER', function ( e )
   {        
    initSlide( e );
   });
  }
}
}

function initSlide( e )

'use strict';
}

2 replies

Participating Frequently
April 1, 2019

Did this work for you? I am having the same request and looking for an working solution.

Correct answer
March 19, 2018

I always add a javascript file on publish.

Put your js file:

C:\Program Files\Adobe\Adobe Captivate X x64\HTML\assets\js

if the folder doesn't exist, create it.

Put and include to the file in the index.html located here:

C:\Program Files\Adobe\Adobe Captivate X x64\HTML

Start with the basic listeners and work from there.

interfaceObj, eventEmitterObj;

window.addEventListener( 'moduleReadyEvent', function ( e )
{
'use strict';

interfaceObj = e.Data;
eventEmitterObj = interfaceObj.getEventEmitter();
initStorage();
});

function initializeEventListeners()

'use strict';

if ( interfaceObj )
{
  if ( eventEmitterObj )
  {  
  
   eventEmitterObj.addEventListener( 'CPAPI_SLIDEENTER', function ( e )
   {        
    initSlide( e );
   });
  }
}
}

function initSlide( e )

'use strict';
}