Skip to content

Instantly share code, notes, and snippets.

@richorama
Created January 7, 2013 16:15
Show Gist options
  • Save richorama/4476178 to your computer and use it in GitHub Desktop.
Save richorama/4476178 to your computer and use it in GitHub Desktop.
Drop this file into a *public* Windows Azure Blob Storage Container, and open the page in your browser. It will display a list of the blobs for you.
<html>
<head>
<script src="http://code.jquery.com/jquery-1.8.3.min.js"></script>
<script src="http://jquery-xml2json-plugin.googlecode.com/svn/trunk/jquery.xml2json.js"></script>
<script src="http://cloud.github.com/downloads/wycats/handlebars.js/handlebars-1.0.rc.1.js"></script>
</head>
<body>
<script>
$(document).ready(function() {
$.ajax("/" + window.location.pathname.split("/")[1] + "?restype=container&comp=list", {dataType:"text"}).done(function(data){
var json = $.xml2json(data);
render(json.Blobs.Blob);
});
});
function render(pages){
var template = Handlebars.compile($("#page-template").html());
$("#container").html(template({pages:pages}));
}
</script>
<div id="container"></div>
<script id="page-template" type="text/x-handlebars-template">
<ul>
{{#each pages}}
<li><a href="{{Name}}">{{Name}}</a></li>
{{/each}}
</ul>
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment