Skip to content
Browse files

Clean up dawg/icons

  • Loading branch information...
1 parent 39bad95 commit b22d454624faec351bbcda8be1b49a1f1893d3a7 @beaugunderson beaugunderson committed Oct 8, 2012
Showing with 57 additions and 27 deletions.
  1. +29 −27 static/icons.html
  2. +28 −0 static/js/icons.js
View
56 static/icons.html 100755 → 100644
@@ -1,35 +1,37 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>icooooons</title>
-<head>
+ <script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <script src="/js/icons.js"></script>
- <title>icooooons</title>
+ <link rel="stylesheet" href="/bootstrap/css/bootstrap.min.css" />
+ <link rel="stylesheet" href="/bootstrap/css/bootstrap-responsive.min.css" />
-</head>
+ <link rel="stylesheet" href="/css/dawg.css" />
+ </head>
-<body>
- <h1>I Have Many Icons!</h1>
- <div id="test"></div>
-</body>
-<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>
-<script>
-$.getJSON("https://api.singly.com/services", {}, render);
+ <body>
+ <div class="container">
+ <h1>I Have Many Icons!</h1>
-function render(data){
- if(typeof data != 'object') return window.alert(data);
- var html = "";
- Object.keys(data).forEach(function(service){
- var i = data[service];
- if(!Array.isArray(i.icons)) return;
- html += "<li>"+service;
- i.icons.forEach(function(icon){
- html += " <img src='"+icon.source+"'>";
- })
- });
- $("#test").append(html);
-};
+ <table class="table table-striped">
+ <thead>
+ <tr>
+ <th>Service</th>
+ <th>Short name</th>
+ <th>16px</th>
+ <th>24px</th>
+ <th>32px</th>
+ </tr>
+ </thead>
-</script>
+ <tbody id="rows">
+ <!-- Filled programatically -->
+ </tbody>
+ </table>
+ </div>
+ </body>
</html>
View
28 static/js/icons.js
@@ -0,0 +1,28 @@
+$(function() {
+ $.getJSON("https://api.singly.com/services", function render(data) {
+ if (typeof data !== 'object') {
+ return window.alert(data);
+ }
+
+ Object.keys(data).forEach(function(service) {
+ var i = data[service];
+
+ if (!Array.isArray(i.icons)) {
+ return;
+ }
+
+ var html = '<tr>' +
+ '<td>' + i.name + '</td>' +
+ '<td>' + service + '</td>';
+
+ i.icons.forEach(function(icon){
+ html += '<td><a href="' + icon.source + '"><img src="' + icon.source +
+ '" /></a></td>';
+ });
+
+ html += '</tr>';
+
+ $('#rows').append(html);
+ });
+ });
+});

0 comments on commit b22d454

Please sign in to comment.
Something went wrong with that request. Please try again.