Skip to content

Instantly share code, notes, and snippets.

CS.csVideoPLayer = {
speeds: [1, 1.5, 2, 2.5, 3],
init: function() {
var videos = $('.cs-video_player');
var el;
for(var i=0, l=videos.length; i < l; i++) {
el = videos[i];
CS.csVideoPLayer.initSublime(el);
CS.csVideoPLayer.initWrapper(el);
}
@renz45
renz45 / replacement.js
Last active August 29, 2015 14:22
I came up to a problem the other day where I had to do a sort of token replacement in html without removing/recompiling the html nodes. I was working in angular, so data attached to html nodes needed to be preserved in this process. Below is my initial attempt, which seems to work at a glance.
<div id="test-el">
<div>some testing text blah</div>
<div>some testing <span>%replace%test span</span> text blah</div>
<p>something %replace% something blah</p>
</div>
<div id="control">
<div>some testing text blah</div>
<div>some testing <span>%replace%test span</span> text blah</div>
<p>something %replace% something blah</p>