You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sometimes you need a different embed code, like the Seamus ones:
<divid="responsive-embed-budget_by_dollar"></div><scripttype=text/javascript>(function(jQuery){if(typeofjQuery!=='undefined'&&typeofjQuery.getScript==='function'){// add randomness to id to support for multiple graphic instances in one storyvarel=document.getElementById("responsive-embed-budget_by_dollar");el.id=el.id+"-"+Math.random().toString(36).substr(2,5);jQuery.getScript("//pym.nprapps.org/pym.v1.min.js").done(function(){jQuery(function(){// Wait for page loadvarpymParent=newpym.Parent(el.id,'http://f.benlk.com/graphics/budget_by_dollar/child.html',{});jQuery.getScript("//carebot.nprapps.org/carebot-tracker.v0.min.js").done(function(){vartracker=newCarebotTracker.VisibilityTracker(el.id,function(result){// Ignore Carebot events to empty embeds, keeps listening after unloading the pageif(pymParent.el.getElementsByTagName('iframe').length!==0){pymParent.sendMessage('on-screen',result.bucket);}});// Check if there is already an scroll tracker somewhere on the pageif(!document.querySelector("[data-carebot-scroll]")){pymParent.el.setAttribute("data-carebot-scroll","");varscrollTracker=newCarebotTracker.ScrollTracker('storytext',function(percent,seconds){// Ignore Carebot events to empty embeds, keeps listening after unloading the pageif(pymParent.el.getElementsByTagName('iframe').length!==0){pymParent.sendMessage('scroll-depth',JSON.stringify({percent: percent,seconds: seconds}));}});}});});});}else{console.error('could not load graphic: jQuery is not on the page.');}})(window.jQuery);</script>
Do we want this plugin to handle that? Do we want to make a different plugin, supporting the same shortcode, that does a different type of initialization?
The text was updated successfully, but these errors were encountered:
This plugin can handle different types of predefined embeds if:
add an admin page allowing choosing between different types of embed codes
set the default to the current embed code type, so that nothing changes.
This can handle different types of user-defined embed scripts if:
embeds are generated by callbacks
there exists a filter in the admin page allowing theme/plugin devs to add new callback options
This embed-type setting would have to be plugin-wide, probably limited to admins, and we wouldn't want to encourage people to mess with the default.
If we need to change the default embed code in the future, without updating older installs' embed codes, we can start saving an on-install version number for this plugin in the options table, and then in a subsequent release only change the default to use new embed codes if the on-install version number is greater than x or some such.
Sometimes you need a different embed code, like the Seamus ones:
Do we want this plugin to handle that? Do we want to make a different plugin, supporting the same shortcode, that does a different type of initialization?
The text was updated successfully, but these errors were encountered: