Skip to content

Commit

Permalink
HTML5: Added some code to switch between the 'default' and 'mobile' U…
Browse files Browse the repository at this point in the history
…RLs, depending on the device. iOS, touchScreen or mobile gets the 'mobile' version now.

git-svn-id: https://xerteonlinetoolkits.googlecode.com/svn/trunk@520 912cdd6b-5c7d-d5a7-a2ba-d0f0cdb91641
  • Loading branch information
JohnSmith-LT committed Nov 19, 2012
1 parent 8b9eca7 commit 0fe83dd
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,18 @@
if (data.data.totalItems == 0) {
resultsHolder = '<div><p>No results returned!!</p></div>'; // ** Need to take this from the language file
} else {
var safePlayer, hyperlink;
$.each(data.data.items, function (index, item) {
// item.player.default breaks IE so this is a workaround
var safePlayer = JSON.parse(JSON.stringify(item.player).replace('"default"', '"standard"'));
safePlayer = JSON.parse(JSON.stringify(item.player).replace('"default"', '"standard"'));
if (x_browserInfo.iOS == true || x_browserInfo.touchScreen || x_browserInfo.mobile) {
hyperlink = '<a href="' + safePlayer.standard + '">' + item.title + '</a>';
}
else {
hyperlink = '<a target="_blank" href="' + safePlayer.standard + '">' + item.title + '</a>';
}
resultsHolder += '<div><img src="' + item.thumbnail.sqDefault + '" />';
resultsHolder += '<p><a target="_blank" href="' + safePlayer.standard + '">' + item.title + '</a></p></div>';
resultsHolder += '<p>' + hyperlink + '</p></div>';
});
}
$resultsHolder
Expand Down

0 comments on commit 0fe83dd

Please sign in to comment.