Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
163 lines (129 sloc) 4.86 KB
<?xml version="1.0" encoding="UTF-8"?>
<html xmlns="">
Steal CSS and other styling for example page from spin.js
Please refer to for license.
<link rel="stylesheet" type="text/css" href="assets/main.css"/>
<link rel="stylesheet" type="text/css" href=",700">
<!-- Load CSS & JS for icongrid -->
<link rel="stylesheet" type="text/css" media="all" href="icongrid.css"/>
<script type="text/javascript" src="base32.js"></script>
<script type="text/javascript" src="jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="icongrid.js"></script>
<script type="text/javascript" src="include.js"></script>
<div id="logo">
<a id="ribbon" href=""></a>
<div id="content">
<div id="download"><a href="icongrid.js">Download</a></div>
<div class="container">
<div class="dashboardclipper" id="clipper" style="width: 400px; height: 300px;"></div>
<h2>User Features</h2>
<li>Direct-manipulation interface</li>
<li>Drag or flick the page, or click the page indicator to switch pages</li>
<li>Click icons to invoke them</li>
<li>Press and hold icons to move them, even between pages</li>
<li>The icon positions are saved automatically</li>
<h2>Developer Features</h2>
<li>Asynchronous API</li>
<li>Works on desktop and touch devices</li>
<li>Firefox, Safari, Chrome</li>
<li>Firefox Mobile, Mobile Safari</li>
<li>Not currently working perfectly with IE 8</li>
<li>Multi-page, smooth scrolling</li>
<li>Any size, any number of rows and columns</li>
<li>Multiple grids per webpage</li>
<li>Represent arbitrary heterogeneous objects</li>
<li>Drag and drop to re-arrange (remembers position on reload!)</li>
<p>View the source of this page to see how it works</p>
<p id="contact">
<a href="">MPL 1.1/GPL 2.0/LGPL 2.1</a>
Author: <b><a href="">Dan Walkowski</a></b>
<div id="footer">
<a class="mozilla" href="">Mozilla Labs</a>
<a class="github" href="">Hosted on GitHub</a>
<script type="text/javascript">
var myDash;
var myLayout;
var html_datasource;
function onfocus(event) {
$(document).ready(function() {
apps_datasource = {
//important callbacks for updates
removeItemFromGridCallback: undefined,
setRemovalCallback: function(callback) {
removeItemFromGridCallback = callback;
addItemToGridCallback: undefined,
setAdditionCallback: function(callback) {
addItemToGridCallback = callback;
getItemList: function(callback) {
var self = this;
navigator.mozApps.mgmt.list( function(theApps) { self.callback(theApps)});
openItem: function(itemID) {
handleWatcher: function(cmd, itemArray) {
var i;
if (cmd == "add") {
for (i=0, i<itemArray.length){
} else if (cmd == "remove"){
for (i=0, i<itemArray.length){
userRemovedItem: function(itemID) {
//this better trigger a call to the update watches, so we can fix the UI
removeItem: function(itemID) {
if (removeItemFromGridCallback == undefined) return;
addItem: function(theItem) {
if (addItemToGridCallback == undefined) return;
addItemToGridCallback(guid, theItem);
// if all your items have 'itemImgURL' and 'itemTitle' properties, then you don't need to implement these.
// These get called when an item doesn't have the right properties.
// Note that you can pass in data URIs for icons
getItemImgURL: function(itemID) {},
getItemTitle: function(itemID) {}
var hostElement = $("#clipper");
myLayout = new GridLayout(hostElement.width(), hostElement.height(), 3, 2);
myDash = new IconGrid("mydash", hostElement, apps_datasource, myLayout);