Last active
August 10, 2017 15:13
-
-
Save carlwoodhouse/573e57ebd48e786467d1fde0e07415c9 to your computer and use it in GitHub Desktop.
rs instructions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
this is at the end of the body | |
<script> | |
$(document).on('rs-load',function(){pasl('https://patient.azureedge.net/res/636378683031670982/p4/rs.config.min.js',function(){$(document).trigger('rs-conf-loaded');})}); | |
$(document).on('rs-conf-loaded',function(){pasl('https://f1-eu.readspeaker.com/script/5816/ReadSpeaker.js?pids=embhl',function(){ReadSpeaker.init();$(document).trigger('rs-initialized');})}); | |
</script |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
in our main js file we have this which handles the call to rs-load ... and in turn loads config | |
$(function () { | |
window.rsConf = { general: { usePost: true } }; | |
var rsLoadTriggered = false; | |
$(".rs-button").on('mouseenter', function () { | |
if (!rsLoadTriggered) { | |
rsLoadTriggered = true; | |
$(document).trigger('rs-load'); | |
} | |
}) | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Once rs-load is trigered, we load our configuration from rs.config.js | |
if (!window.rsConf) { window.rsConf = {}; } | |
if (!window.rsConf.ui) { window.rsConf.ui = {}; } | |
window.rsConf.ui.rsbtnClass = 'rsbtn_colorskin'; | |
window.rsConf.ui.player = [ | |
'<span class="rsbtn_box">', | |
' <span class="rsbutton"><i class="icon icon-listen"></i></span>', | |
' <a href="#" class="rsbtn_pause rsimg rspart rsbutton rsbtn_playbtn" title="Pause">', | |
' <i class="icon icon-pause"></i>', | |
' <i class="icon icon-play"></i>', | |
' </a>', | |
' <span class="rsbtn_progress_container rspart">', | |
' <span class="rsbtn_progress_played"></span>', | |
' </span>', | |
' <a href="javascript:void(0);" class="rsbtn_closer rsimg rspart rsbutton" title="Close player">', | |
' <i class="icon icon-remove"></i>', | |
' </a>', | |
' <span class="rsdefloat"></span>', | |
'</span>' | |
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Once this co0nfig, we load the actual external js from readspeaker in the callback .. | |
Once thats loaded we call ReadSpeaker.init(); in the callback of the external js |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment