Commit b413d657 authored by Dave Lane's avatar Dave Lane
Browse files

test code, still in flux

parent 5f7d4840
......@@ -415,33 +415,40 @@ function processPage(pi) {
});
// embed YouTube videos
$(".weYouTube").each(function(i, e) {
var $this = $(this),
id = $this.attr("data-ytid"),
width = $this.css("width") || 560,
height = $this.css("height") || 315,
start = $this.css("t") || 0,
list = $this.attr("data-list"),
index = $this.attr("data-index");
var opts = ' class="weYouTube-responsive" controls="yes" allowfullscreen="yes"';
opts += ' maxwidth=' + width + ' start=' + start;
$this
.parent()
/* .replaceWith(
'<iframe width="' +
width +
'" height="' +
height +
'" src="//www.youtube.com/embed/' +
id +
"?" +
(list ? "list=" + list : "rel=0") +
(index ? "&index=" + index : "") +
'" frameborder="0" allowfullscreen></iframe> <p>Responsive Test</p><p>[youtube v=' + id + ']</p>' */
.replaceWith(
'[youtube v="' + id + '" ' + opts + ']'
); //Testing YouTube
$('.weYoutube-wrapper').each(function(i, e) {
var wrapper = $(this),
align = wrapper.attr("align"),
wrapper_classes = wrapper.attr("class");
wrapper.find(".weYouTube").each(function(i, e) {
var $this = $(this),
id = $this.attr("data-ytid"),
width = $this.css("width") || 560,
height = $this.css("height") || 315,
start = $this.css("t") || 0,
list = $this.attr("data-list"),
index = $this.attr("data-index");
var opts = ' class="weYouTube-responsive" controls="yes" allowfullscreen="yes"';
opts += ' maxwidth=' + width + ' start=' + start;
var ytinvocation = '[youtube v="' + id + '" ' + opts + ']';
/*console.log("******* Checking for video wrapper! ********");
if ($this.parent().find('.weYouTube-wrapper')) {
var wrapper = $this.parent().find('.weYouTube-wrapper');
var wrapperhtml = $("<div />").append(wrapper.clone()).html();
console.log("wrapper = ", wrapperhtml);
wrapper.addClass("testing");
}
console.log("******* After check for video wrapper! ********");
console.log("******* Checking for video title! ********");
if ($this.find('.weYouTubeTitleContainer')) {
var yttitle = $("<div />").append($this.find('.weYouTubeTitleContainer').clone()).html();
console.log("title = ", yttitle);
//ytinvocation = '<span class="weYouTubeTitle" style="padding-left: 0.5em;">' + yttitle + '</span>' + ytinvocation;
//ytinvocation = '<div class="weYouTubeTitleContainer" style="color: white; background: rgba(69,69,69,75); position: absolute; top: 0px; width: 100%; height: 18px; font: 14px sans-serif; padding-top: 4px;"><span class="weYouTubeTitle" style="padding-left: 0.5em;">' + yttitle + '</span>' + ytinvocation + '</div>';
}
console.log("******* After check for video title! ********");*/
});
// assign the new content...
$this.parent().replaceWith(ytinvocation); //Testing YouTube
});
// embed SoundCloud clips
$(".weSoundCloud").each(function(i, e) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment