Skip to content

Instantly share code, notes, and snippets.

Avatar

Philip Hutchison pipwerks

View GitHub Profile
@pipwerks
pipwerks / captivate.js
Created Jan 13, 2012
Captivate SCORM 2004 Output, moved SCORM code to scorm_support.js
View captivate.js
// set document.domain property here, if it works for your environment/SCORM implementation
// document.domain="";
var flashvars = {},
params = { bgcolor: "#f5f4f1", menu: "false" },
attributes = { id: "Captivate", name: "Captivate" };
function callbackFn(e){
//e.ref is the <object> aka SWF file. No need for getElementById
if(e.success && e.ref){
@pipwerks
pipwerks / captivate.js
Created Jan 13, 2012
Captivate SCORM 2004 Output, removed SCORM 1.2 code
View captivate.js
// set document.domain property here, if it works for your environment/SCORM implementation
// document.domain="";
var flashvars = {},
params = { bgcolor: "#f5f4f1", menu: "false" },
attributes = { id: "Captivate", name: "Captivate" },
g_intAPIType = 0, // Specifies SCORM 2004
strURLFile = "sample.swf", // Name of the flash file
intIntervalSecs = 1, // Number of seconds to wait for SCORM API to load
g_intAPIOrder = 0, // Way to search for API object (0 - starts with bottom up; 1 - starts top down)
strURLParams = "";
@pipwerks
pipwerks / captivate.js
Created Jan 13, 2012
Captivate SCORM 2004 Output, removed eval
View captivate.js
// set document.domain property here, if it works for your environment/SCORM implementation
// document.domain="";
var flashvars = {},
params = { bgcolor: "#f5f4f1", menu: "false" },
attributes = { id: "Captivate", name: "Captivate" },
g_intAPIType = 0,
strURLFile = "sample.swf", // Name of the flash file
intIntervalSecs = 1, // Number of seconds to wait for SCORM API to load
g_intAPIOrder = 0, // Way to search for API object (0 - starts with bottom up; 1 - starts top down)
strURLParams = "";
@pipwerks
pipwerks / captivate.js
Created Jan 13, 2012
Captivate SCORM 2004 Output, removed useless querystring parsing
View captivate.js
// set document.domain property here, if it works for your environment/SCORM implementation
// document.domain="";
var flashvars = {},
params = { bgcolor: "#f5f4f1", menu: "false" },
attributes = { id: "Captivate", name: "Captivate" },
g_intAPIType = 0,
strURLFile = "sample.swf", // Name of the flash file
intIntervalSecs = 1, // Number of seconds to wait for SCORM API to load
g_intAPIOrder = 0, // Way to search for API object (0 - starts with bottom up; 1 - starts top down)
strURLParams = "";
@pipwerks
pipwerks / captivate.js
Created Jan 13, 2012
Captivate SCORM 2004 Output, replaced IE sniffing
View captivate.js
// set document.domain property here, if it works for your environment/SCORM implementation
// document.domain="";
var g_intAPIType = 0,
strURLFile = "sample.swf", // Name of the flash file
intIntervalSecs = 1, // Number of seconds to wait for SCORM API to load
g_intAPIOrder = 0, // Way to search for API object (0 - starts with bottom up; 1 - starts top down)
strURLBase = "",
strURLParams = "",
strURLFull = document.location + "",
intTemp = strURLFull.indexOf("#"),
@pipwerks
pipwerks / captivate.js
Created Jan 12, 2012
Captivate SCORM 2004 Output, replaced SWFObject 1.5 with 2.2
View captivate.js
// set document.domain property here, if it works for your environment/SCORM implementation
// document.domain="";
var g_intAPIType = 0,
strURLFile = "sample.swf", // Name of the flash file
intIntervalSecs = 1, // Number of seconds to wait for SCORM API to load
g_intAPIOrder = 0, // Way to search for API object (0 - starts with bottom up; 1 - starts top down)
strURLBase = "",
strURLParams = "",
strURLFull = document.location + "",
intTemp = strURLFull.indexOf("#"),
@pipwerks
pipwerks / captivate.js
Created Jan 12, 2012
Captivate SCORM 2004 Output, reduced var statements, moved function declarations
View captivate.js
// set document.domain property here, if it works for your environment/SCORM implementation
// document.domain="";
var g_intAPIType = 0,
strURLFile = "sample.swf", // Name of the flash file
intIntervalSecs = 1, // Number of seconds to wait for SCORM API to load
g_intAPIOrder = 0, // Way to search for API object (0 - starts with bottom up; 1 - starts top down)
strURLBase = "",
strURLParams = "",
strURLFull = document.location + "",
intTemp = strURLFull.indexOf("#"),
@pipwerks
pipwerks / captivate.js
Created Jan 12, 2012
Captivate SCORM 2004 Output, slight JavaScript cleanup
View captivate.js
// set document.domain property here, if it works for your environment/SCORM implementation
// document.domain="";
var g_intAPIType = 0;
// Hook for Internet Explorer
if((navigator.appName && navigator.appName.indexOf("Microsoft") != -1 && navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) || g_intAPIType == -1){
g_intAPIType = 0;
document.write('<script language=\"VBScript\"\>\n');
document.write('On Error Resume Next\n');
document.write('Sub Captivate_FSCommand(ByVal command, ByVal args)\n');
@pipwerks
pipwerks / captivate.js
Created Jan 12, 2012
Captivate SCORM 2004 Output, all inline JavaScript removed
View captivate.js
// set document.domain property here, if it works for your environment/SCORM implementation
// document.domain="";
var g_intAPIType = 0;
// Hook for Internet Explorer
if ((navigator.appName && navigator.appName.indexOf("Microsoft") != -1 && navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) || g_intAPIType == -1)
{
g_intAPIType = 0;
document.write('<script language=\"VBScript\"\>\n');
document.write('On Error Resume Next\n');
document.write('Sub Captivate_FSCommand(ByVal command, ByVal args)\n');
@pipwerks
pipwerks / sample.htm
Created Jan 12, 2012
Captivate SCORM 2004 Output, removed <table> generated by JavaScript
View sample.htm
<!-- Copyright [2008] Adobe Systems Incorporated. All rights reserved -->
<!-- saved from url=(0013)about:internet -->
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="utf-8" />
<title></title>
<script src="standard.js"></script>
<script src="SCORM_support/scorm_support.js"></script>
<script src="captivate.js"></script>
You can’t perform that action at this time.