Skip to content

Commit

Permalink
clean up view collection functions
Browse files Browse the repository at this point in the history
  • Loading branch information
Kieren Diment committed Apr 5, 2010
1 parent 9b625ba commit f6762aa
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 2 deletions.
File renamed without changes.
35 changes: 35 additions & 0 deletions view_collection/index.sjs
@@ -0,0 +1,35 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Zotero ssj/jqote template demo</title>
<link rel="stylesheet" type="text/css" media="all" href="../static/css/elastic.css" />
<link rel="stylesheet" type="text/css" media="all" href="../static/css/local.css" />
<script src="../static/js/jquery.js" type="text/javascript" language="javascript" charset="utf-8"></script>
<script src="../static/css/elastic.js" type="text/javascript" language="javascript" charset="utf-8"></script>
<script src="../static/js/jquery-1.4.2.min.js" type="text/javascript"></script>
<script src="../static/js/jquery.jqote2.min.js" type="text/javascript"></script>
</head>
<body>

<?sjs
var z = Components.classes["@zotero.org/Zotero;1"] .getService(Components.interfaces.nsISupports).wrappedJSObject;

var render_collection = function(coll) {
if (!coll) {
coll = null;
}
var collections = z.getCollections(coll);
document.writeln("<ul>");
for (c in collections) {
document.writeln('<li>' + '<a href="view_collection.sjs?name=' + encodeURI(collections[c].name) + '&id=' + collections[c].id + '">' + collections[c].name + '</a></li>');
if (collections[c].hasChildCollections) {
var childCol = render_collection(collections[c].id);
}
}
document.writeln("</ul>");
}
render_collection();
?>
</ul>
</body>
</html>
4 changes: 2 additions & 2 deletions view_collection.sjs → view_collection/view_collection.sjs
@@ -1,7 +1,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Zotero ssj/jqote template demo</title>
<title>Collection Viewer</title>
<link rel="stylesheet" type="text/css" media="all" href="static/css/elastic.css" />
<link rel="stylesheet" type="text/css" media="all" href="static/css/local.css" />
<script src="static/js/jquery.js" type="text/javascript" language="javascript" charset="utf-8"></script>
Expand All @@ -10,7 +10,7 @@
<script src="static/js/jquery.jqote2.min.js" type="text/javascript"></script>
</head>
<body>
<h1>jQote2 Simple Demo</h1>
<h1>Collection Viewer</h1>


<table id="example">
Expand Down

0 comments on commit f6762aa

Please sign in to comment.