Skip to content

Instantly share code, notes, and snippets.

@davetheflashguy
Created March 13, 2014 15:48
Show Gist options
  • Save davetheflashguy/9531001 to your computer and use it in GitHub Desktop.
Save davetheflashguy/9531001 to your computer and use it in GitHub Desktop.
Sub Sequence
var sequenceObj = {"nodes": []}
// now build the list of media place holders
for (var i=0; i < sequenceArray.length; i++) {
// first check and see if the first elements is a textfield,
// if it is we know it's a header
if (sequenceArray[0] == "T") {
sequenceObj.nodes.push({"node" : sequenceArray[0]});
}
else {
if (sequenceArray[i] == "P" || sequenceArray[i] == "V") {
var subSeq = [];
subSeq.push(sequenceArray[i]);
var start = i + 1;
var end = i + 5;
for (var k = start; k < end; k++) {
if (sequenceArray[k] == "T") {
subSeq.push(sequenceArray[k]);
}
}
sequenceObj.nodes.push({"node" : subSeq});
var model = new Backbone.Model();
model.asset = (sequenceArray[i] == "P") ? '<img data-src="holder.js/100x100/text:Image">' : '<img data-src="holder.js/100x100/text:Video">';
$("#video-builder-text-container>.list-container").append(textListItem(model));
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment