Skip to content

Commit

Permalink
HTML5 - Changed navigator models so they can now show swfs as well as…
Browse files Browse the repository at this point in the history
… images on them

git-svn-id: https://xerteonlinetoolkits.googlecode.com/svn/trunk@500 912cdd6b-5c7d-d5a7-a2ba-d0f0cdb91641
  • Loading branch information
FayCross committed Nov 15, 2012
1 parent a5f2b6b commit 030c967
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 18 deletions.
25 changes: 20 additions & 5 deletions modules/xerte/parent_templates/Nottingham/models_html5/accNav.html
Expand Up @@ -49,19 +49,34 @@
$thisHeader.find("a").html(this.getAttribute("name"));

var infoString = x_addLineBreaks('<p>' + this.getAttribute("text") + '</p>');
if (this.getAttribute("url") != undefined && this.getAttribute("url") != "") {
var newString = '<div class="paneImg"><img src="' + eval(this.getAttribute("url")) + '" ';
if (this.getAttribute("tip") != undefined && this.getAttribute("tip") != "") {
newString += 'alt="' + this.getAttribute("tip") + '" ';
var url = this.getAttribute("url");
if (url != undefined && url != "") {
var newString = "";
if (url.split('.').pop().slice(0, -1) == "swf") {
newString += '<div class="centerAlign"><div id="pageSWF' + i + '"><h3></h3><p><a href="http://www.adobe.com/go/getflashplayer"><img class="flashImg" src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif"/></a></p></div></div>';
} else {
newString += '<div class="paneImg"><img src="' + eval(url) + '" ';
if (this.getAttribute("tip") != undefined && this.getAttribute("tip") != "") {
newString += 'alt="' + this.getAttribute("tip") + '" ';
}
newString += ' /></div>';
}
newString += ' /></div>';
if (this.getAttribute("align") == "Top") {
infoString += newString;
} else {
infoString = newString + infoString;
}
}
$thisContents.html(infoString);

if (url != undefined && url != "" && url.split('.').pop().slice(0, -1) == "swf") {
// ** need to add field into wizard so you can enter swf dimensions rather than use 100% **
// ** need to add functionality for initObject and interactivity optional properties **
swfobject.embedSWF(eval(url), "pageSWF" + i, "300", "300", "9.0.0", x_templateLocation + "common_html5/expressInstall.swf", "", "", "");
$("#pageSWF" + i + " h3").html(x_getLangInfo(x_languageData.find("errorFlash")[0], "label", "You need to install the Flash Player to view this content."));
$(".flashImg").attr("alt", x_getLangInfo(x_languageData.find("errorFlash")[0], "description", "Get the Flash Player"));
$("#pageSWF" + i).attr("title", this.getAttribute("tip"));
}
});

$infoHolder.accordion({fillSpace: true});
Expand Down
Expand Up @@ -69,12 +69,18 @@
.attr("for", "btn" + i);

var infoString = x_addLineBreaks('<p>' + this.getAttribute("text") + '</p>');
if (this.getAttribute("url") != undefined && this.getAttribute("url") != "") {
var newString = '<div class="pageImg"><img src="' + eval(this.getAttribute("url")) + '" ';
if (this.getAttribute("tip") != undefined && this.getAttribute("tip") != "") {
newString += 'alt="' + this.getAttribute("tip") + '" ';
var url = this.getAttribute("url");
if (url != undefined && url != "") {
var newString = "";
if (url.split('.').pop().slice(0, -1) == "swf") {
newString += '<div class="centerAlign"><div id="pageSWF' + i + '"><h3></h3><p><a href="http://www.adobe.com/go/getflashplayer"><img class="flashImg" src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif"/></a></p></div></div>';
} else {
newString += '<div class="pageImg"><img src="' + eval(url) + '" ';
if (this.getAttribute("tip") != undefined && this.getAttribute("tip") != "") {
newString += 'alt="' + this.getAttribute("tip") + '" ';
}
newString += ' /></div>';
}
newString += ' /></div>';
if (this.getAttribute("align") == "Top") {
infoString += newString;
} else {
Expand All @@ -85,6 +91,15 @@
$thisPanelPage
.html(infoString)
.hide();

if (url != undefined && url != "" && url.split('.').pop().slice(0, -1) == "swf") {
// ** need to add field into wizard so you can enter swf dimensions rather than use 100% **
// ** need to add functionality for initObject and interactivity optional properties **
swfobject.embedSWF(eval(url), "pageSWF" + i, "300", "300", "9.0.0", x_templateLocation + "common_html5/expressInstall.swf", "", "", "");
$("#pageSWF" + i + " h3").html(x_getLangInfo(x_languageData.find("errorFlash")[0], "label", "You need to install the Flash Player to view this content."));
$(".flashImg").attr("alt", x_getLangInfo(x_languageData.find("errorFlash")[0], "description", "Get the Flash Player"));
$("#pageSWF" + i).attr("title", this.getAttribute("tip"));
}
});

$panelBtn.trigger("click");
Expand Down
25 changes: 20 additions & 5 deletions modules/xerte/parent_templates/Nottingham/models_html5/tabNav.html
Expand Up @@ -54,12 +54,18 @@
.html(this.getAttribute("name"));

var infoString = x_addLineBreaks('<p>' + this.getAttribute("text") + '</p>');
if (this.getAttribute("url") != undefined && this.getAttribute("url") != "") {
var newString = '<div class="paneImg"><img src="' + eval(this.getAttribute("url")) + '" ';
if (this.getAttribute("tip") != undefined && this.getAttribute("tip") != "") {
newString += 'alt="' + this.getAttribute("tip") + '" ';
var url = this.getAttribute("url");
if (url != undefined && url != "") {
var newString = "";
if (url.split('.').pop().slice(0, -1) == "swf") {
newString += '<div class="centerAlign"><div id="pageSWF' + i + '"><h3></h3><p><a href="http://www.adobe.com/go/getflashplayer"><img class="flashImg" src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif"/></a></p></div></div>';
} else {
newString += '<div class="paneImg"><img src="' + eval(url) + '" ';
if (this.getAttribute("tip") != undefined && this.getAttribute("tip") != "") {
newString += 'alt="' + this.getAttribute("tip") + '" ';
}
newString += ' /></div>';
}
newString += ' /></div>';
if (this.getAttribute("align") == "Top") {
infoString += newString;
} else {
Expand All @@ -69,6 +75,15 @@
$thisContents
.attr("id", "tab" + i)
.html(infoString);

if (url != undefined && url != "" && url.split('.').pop().slice(0, -1) == "swf") {
// ** need to add field into wizard so you can enter swf dimensions rather than use 100% **
// ** need to add functionality for initObject and interactivity optional properties **
swfobject.embedSWF(eval(url), "pageSWF" + i, "300", "300", "9.0.0", x_templateLocation + "common_html5/expressInstall.swf", "", "", "");
$("#pageSWF" + i + " h3").html(x_getLangInfo(x_languageData.find("errorFlash")[0], "label", "You need to install the Flash Player to view this content."));
$(".flashImg").attr("alt", x_getLangInfo(x_languageData.find("errorFlash")[0], "description", "Get the Flash Player"));
$("#pageSWF" + i).attr("title", this.getAttribute("tip"));
}
});

$("#infoHolder").tabs();
Expand Down
Expand Up @@ -48,10 +48,10 @@
}

swfobject.embedSWF(eval(x_currentPageXML.getAttribute("url")), "pageSWF", size[0], size[1], "9.0.0", x_templateLocation + "common_html5/expressInstall.swf", "", "", "", function(e) {
if (e.success == true) {
/*if (e.success == true) {
var swf = e.ref;
//swf.init("Function called from page"); // ** this is not working to call the function is swf - possibly to do with swfObject **
}
swf.init("Function called from page"); // ** this is not working to call the function in swf - possibly to do with swfObject **
}*/
});

$("#pageSWF h3").html(x_getLangInfo(x_languageData.find("errorFlash")[0], "label", "You need to install the Flash Player to view this content."));
Expand Down

0 comments on commit 030c967

Please sign in to comment.