Skip to content

Instantly share code, notes, and snippets.

@Kaelinator
Last active July 28, 2022 18:47
Show Gist options
  • Select an option

  • Save Kaelinator/8c035b836e27a4c1f8b82b2930648f22 to your computer and use it in GitHub Desktop.

Select an option

Save Kaelinator/8c035b836e27a4c1f8b82b2930648f22 to your computer and use it in GitHub Desktop.
Paste this into your console (with target set to Frame: Activity) for extra tools to allow you to be more productive when learning with Edgenuity
(() => {
const stopAllAudio = () => {
API.Audio.soundQueue = new Array();
API.Audio.callBackQueue = new Array();
API.Audio.playing = false;
try {
API.Audio.stopAudio();
} catch (ex) { }
}
const forceOpenFrame = n => {
const order = API.FrameChain.currentFrame + n
if (API.FrameChain.frameUpdateInProgress) return;
$("#btnEntryAudio").css("display", "none");
$("#btnExitAudio").css("display", "none");
$(".frameCaptions").css("display", "none");
$(".stop-marker").css("display", "none");
try {
$('#vid_volume').change();
} catch (ex) { }
API.Frame.entryAudioFilename = null;
API.Frame.exitAudioFilename = null;
API.Frame.hintAudioFilename = null;
API.Frame.showMeVideoFilename = null;
API.Frame.showHideReplayText();
$('#iFramePreview').attr('src', API.FrameChain.frameAddresses[order - 1]);
if (API.FrameChain.turnOffClosedCaptions) {
API.FrameChain.turnOffClosedCaptions();
}
stopAllAudio()
API.FrameChain.updateFramesStatus(API.FrameChain.framesStatus, order);
//Display frame window
if (API.Video.elementIDs.container && API.Video.elementIDs.container.parentNode) {
try {
API.Video.wrapper.stop();
API.Video.wrapper.theVideo.executeFlashFunction("disconnect");
} catch (ex) { }
$("#" + API.Video.frameVideoControls.elementIDs.progress).css("left", "0");
if (getInternetExplorerVersion() == -1) {
API.Video.elementIDs.container.style.width = "1px";
API.Video.elementIDs.container.style.height = "1px";
API.Video.elementIDs.container.style.opacity = "0.01";
} else {
API.Video.elementIDs.container.style.display = "none";
}
$("#" + API.Video.elementIDs.frameVideoControls).hide();
//destroy();
$("#ctl00_ContentPlaceHolderBody_upnlFrameArea").show();
$("#iFramePreview").show();
//$("#" + API.Video.elementIDs.playerContainer).hide();
}
}
$('<li class="FrameLeft"></li>')
.click(() => forceOpenFrame(-1))
.append($('<a href="#_" style="filter: hue-rotate(180deg) saturate(2); margin-left: -40px;">Go Left</a>'))
.appendTo('.FramesList')
$('<li class="FrameRight"></li>')
.click(() => forceOpenFrame(1))
.append($('<a href="#_" style="filter: hue-rotate(180deg) saturate(2); margin-left: 40px;">Go Right</a>'))
.appendTo('.FramesList')
setInterval(() => {
API.Audio.audioEndHandler()
if (window.autoSkip)
API.FrameChain.nextFrame()
}, 1000)
window.autoSkip = true
if (top.window.frames.$('#toggle-auto-advance').length)
top.window.frames.$('#toggle-auto-advance').remove()
top.window.frames.$('<li></li>')
.append(
$('<a class="nav dave" id="toggle-auto-advance">Disable Auto Advance</a>')
.click(function() {
$(this).text(((window.autoSkip = !window.autoSkip) ? 'Dis' : 'En') + 'able Auto Advance')
}))
.prependTo('.mainhead .head-nav')
})()
@PDuff234
Copy link

PDuff234 commented Apr 9, 2020

How do you set the target to Frame: Activity? (It would be greatly appreciated if you can also show the instantiation)

Another thing, when I run the code, it throws this error in the console

Uncaught ReferenceError: API is not defined at :62:5 (62:5 is API.Audio.audioEndHandler())

Any assistance on how to fix this is greatly appreciated!

I am also using Google Chrome if that helps

@Dummydud3
Copy link

when you open the dev tools there is a button at the very top left of the panel
that is the select button. when it turns blue you click on the stage (video/activity)
boom. then the command works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment