Created
December 13, 2011 07:00
-
-
Save gladson/1470994 to your computer and use it in GitHub Desktop.
32434234werwfsdf?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title> jQuery Youtube </title> | |
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" > | |
<link rel="stylesheet" href="../../reset.css" type="text/css" media="screen" charset="utf-8"> | |
<link rel="stylesheet" href="../../screen.css" type="text/css" media="screen" charset="utf-8"> | |
<link rel="stylesheet" href="screen.css" type="text/css" media="screen" charset="utf-8"> | |
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" charset="utf-8"></script> | |
<script type="text/javascript" src="../../../jTube/jquery.jTube.js" charset="utf-8"></script> | |
<script type="text/javascript"> | |
$(function() { | |
var currentPage = 1; | |
$.jTube({ | |
request: 'user', | |
requestValue: 'RhettandLink', | |
requestOption: 'uploads', | |
limit: 4, | |
page: currentPage, | |
success: function(videos, numberPages) { | |
$('#example').html(''); | |
$('#currentPage').html(currentPage); | |
$('#numberPages').html(numberPages); | |
$(videos).each(function() { | |
html = '<li>\n'; | |
html += '\t<a href="'+this.link+'"><img src="'+this.thumbnail+'">'+this.title+'</a> - '+this.length+'\n'; | |
html += '<br><span class="label">Categoria:</span> '+this.category+'\n'; | |
html += '<br><span class="label">Keywords:</span> '+this.keywords+'\n'; | |
html += '<div><br><span class="label">Descrição:</span> '+this.description+'\n</div>'; | |
html += '</li>\n'; | |
$('#example').append(html); | |
}); | |
//Back | |
if(currentPage != 1) { | |
$('#pageBack').removeClass('disabled').unbind('click').click(function(event) { | |
currentPage = currentPage - 1; | |
options.page = currentPage; | |
$.jTube(options); | |
event.preventDefault(); | |
}); | |
} else { | |
$('#pageBack').addClass('disabled').unbind('click').click(empty); | |
} | |
//Next | |
if(currentPage < numberPages) { | |
$('#pageNext').removeClass('disabled').unbind('click').click(function(event) { | |
currentPage = currentPage + 1; | |
options.page = currentPage; | |
$.jTube(options); | |
event.preventDefault(); | |
}); | |
} else { | |
$('#pageNext').addClass('disabled').unbind('click').click(empty); | |
} | |
}, | |
error: function(error) { | |
$('#example').html(error); | |
} | |
}); | |
var empty = function(event) {event.preventDefault();}; | |
$("#pageBack, #pageNext").click(empty); | |
$.jTube(options); //Uncaught ReferenceError: options is not defined | |
}); | |
</script> | |
</head> | |
<body> | |
<div id="wrapper"> | |
<h1>jTube Preview</h1> | |
<div id="crumbs"> | |
<a href="../../">Examples</a> > <a href="../">Users</a> > Uploads | |
</div> | |
<ul id="example"></ul> | |
<div class="clear"> </div> | |
<div id="paging"> | |
<a href="" id="pageBack" class="disabled">Back</a> - Page <span id="currentPage">1</span> of <span id="numberPages">1</span> - <a href="" id="pageNext" class="disabled">Next</a> | |
</div> | |
</div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment