Mercurial > planet-ubiquity-redesign
changeset 34:e51c8e11d202
Renamed about-mozilla.* files to planet.*.
author | Atul Varma <varmaa@toolness.com> |
---|---|
date | Tue, 03 Mar 2009 10:22:55 -0800 |
parents | ea5794bfb0ac |
children | 722b7bdf055a |
files | about-mozilla.css about-mozilla.html about-mozilla.js docs.html planet.css planet.html planet.js |
diffstat | 7 files changed, 394 insertions(+), 394 deletions(-) [+] |
line wrap: on
line diff
--- a/about-mozilla.css Tue Mar 03 10:17:49 2009 -0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,122 +0,0 @@ -body { - font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; - font-size: 9pt; - line-height: 1.4em; - background: white; - padding: 0; - margin: 0; -} - -#issue { - display: none; -} - -#header { - /* Too bad font-stretch isn't implemented in Firefox yet... */ - font-stretch: condensed; - font-variant: small-caps; - font-weight: bold; - font-size: 18pt; - margin: 6pt; - padding-top: 6pt; - padding-bottom: 6pt; - color: black; -} - -#body { -} - -.entry { - background: white; - float: left; - width: 20em; -} - -.headline { - font-weight: bold; - height: 3em; - padding: 6pt; - border-top: 1px dotted gray; - border-bottom: 1px dotted gray; -} - -.content { -} - -a { - color: black; - text-decoration: none; - border-bottom: 1px dotted gray; -} - -.blog-item { - padding-left: 6pt; - padding-right: 6pt; - padding-top: 6pt; - padding-bottom: 6pt; - color: gray; -} - -.blog-item a { - border: none; - font-style: italic; - color: black; -} - -.days-ago-0 { - background-color: #ffffff; -} - -.days-ago-1 { - background-color: #fafafa; -} - -.days-ago-2 { - background-color: #f5f5f5; -} - -.days-ago-3 { - background-color: #f0f0f0; -} - -.days-ago-4 { - background-color: #eaeaea; -} - -.days-ago-5 { - background-color: #e5e5e5; -} - -.days-ago-6 { - background-color: #e0e0e0; -} - -.days-ago-7 { - background-color: #dadada; -} - -.days-ago-8 { - background-color: #d5d5d5; -} - -.days-ago-9 { - background-color: #d0d0d0; -} - -#row-labels .content { - font-weight: bold; -} - -.build { - padding-right: 1em; - margin-right: 2pt; - opacity: .5; -} - -.build-errors { - background-color: #ff0000; -} - -.build-success { - background-color: #00ff00; -}
--- a/about-mozilla.html Tue Mar 03 10:17:49 2009 -0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,56 +0,0 @@ -<!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" xml:lang="en" lang="en"> -<head> - <meta http-equiv="Content-type" content="text/html; charset=utf-8" /> - <link rel="stylesheet" type="text/css" media="all" - href="about-mozilla.css" /> - <title>planet ubiquity</title> -</head> -<body> -<div id="issue"> - <div id="header">planet ubiquity</div> - <div id="body"> - <div class="entry" id="row-labels"> - <div class="headline"> </div> - <div class="content"> - <div class="days-ago-0"> - <div class="blog-item">Within the last 8 hours</div> - </div> - <div class="days-ago-1"> - <div class="blog-item">8-16 hours ago</div> - </div> - <div class="days-ago-2"> - <div class="blog-item">16 hours to 1 day ago</div> - </div> - <div class="days-ago-3"> - <div class="blog-item">24-32 hours ago</div> - </div> - <div class="days-ago-4"> - <div class="blog-item">32-40 hours ago</div> - </div> - <div class="days-ago-5"> - <div class="blog-item">40 hours to 2 days ago</div> - </div> - <div class="days-ago-6"> - <div class="blog-item">48-56 hours ago</div> - </div> - <div class="days-ago-7"> - <div class="blog-item">56-64 hours ago</div> - </div> - <div class="days-ago-8"> - <div class="blog-item">64 hours to 3 days ago</div> - </div> - <div class="days-ago-9"> - <div class="blog-item">More than 3 days ago</div> - </div> - </div> - </div> - </div> -</div> -</body> -<script src="jquery.js"></script> -<script src="querystring.js"></script> -<script src="http://www.google.com/jsapi?key=ABQIAAAAzBIC_wxmje-aKLT3RzZx7BSMyDMkO9FJ67H-yweQ42J8NadmShSzBtxGrM35N4zI4l-rt1mDAF_fPg"></script> -<script src="about-mozilla.js"></script> -</html>
--- a/about-mozilla.js Tue Mar 03 10:17:49 2009 -0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,214 +0,0 @@ -// = Planet Ubiquity Code = -// -// This is the JavaScript source code for the Planet Ubiquity Redesign. - -var Planet = { - // The base URL for where Ubiquity buildbot information is located. - BUILDBOT_BASE: "http://ubiquity.mozilla.com/buildbot/", - - // The base URL for where Ubiquity's main HG repository is located. - HG_BASE: "https://ubiquity.mozilla.com/hg/ubiquity-firefox/" -}; - -Planet.getBuildInfo = function getBuildInfo(page) { - var builds = []; - $("li", page).each( - function(i) { - var revRegexp = /.*rev=\[([0-9a-f]+)\].*/; - builds.push({rev: $(this).text().match(revRegexp)[1], - href: (Planet.BUILDBOT_BASE + - $("a:not(:first)", this).attr("href")), - isSuccessful: $(".success", this).length > 0 - }); - } - ); - return builds; -}; - -Planet.mashupBuildbotWithHgData = function mashup(hgLog, buildbotPage) { - var builds = Planet.getBuildInfo(buildbotPage); - builds.forEach( - function(build) { - var revUrl = Planet.HG_BASE + "rev/" + build.rev; - var revSelector = ("a[href='" + revUrl + "']"); - var link = jQuery(revSelector, hgLog); - var className = "build-errors"; - var title = "This build may have errors."; - if (build.isSuccessful) { - className = "build-success"; - title = "This build passed all tests."; - } - var status = jQuery('<span></span>'); - status.addClass(className); - status.addClass("build"); - link.before(status); - status.wrap('<a title="' + title + - '" href="' + build.href + '"></a>'); - }); -}; - -Planet.processHgFeed = function processHgFeed(feed, content, cb) { - Planet.processBlogFeed( - feed, - content, - function() { - jQuery.get( - ("http://about-mozilla.appspot.com/?url=" + - Planet.BUILDBOT_BASE + "one_line_per_build&jsonp=?"), - null, - function(result) { - Planet.mashupBuildbotWithHgData(content, $(result.data)); - cb(); - }, - "jsonp" - ); - }); -}; - -Planet.processBlogFeed = function processBlogFeed(feed, content, cb) { - jQuery.each( - feed.entries, - function(i) { - var item = $('<div class="blog-item">' + - '<span class="title"></span> ' + - '<span class="author"></span></div>'); - $('.title', item).html(this.title); - var linkTitle = ""; - if (this.contentSnippet) - linkTitle =this.contentSnippet ; - var link = $('<a title="' + linkTitle + '" href="' + - this.link + '"></a>'); - link.attr("target", "_blank"); - $('.title', item).wrap(link); - if (this.author) { - var author = this.author; - var authorFilters = [ - // Filter out e.g. "Robert Jones <robert@jones.com>" - /(.+)\s*<.+>/, - // Filter out e.g. "rob...@jones.com (Robert Jones)" - /.+\.\.\.@.+\s+\((.+)\)/ - ]; - jQuery.each( - authorFilters, - function() { - var match = author.match(this); - if (match) - author = match[1]; - }); - $('.author', item).html('by ' + author); - } - $(item).attr("published", this.publishedDate); - content.append(item); - }); - cb(); -}; - -Planet.FEEDS = [ - {name: "Blogs", - url: "http://ubiquity.mozilla.com/planet/?feed=rss2", - processFeed: Planet.processBlogFeed, - entries: 10}, - {name: "Bugs", - url: ("https://ubiquity.mozilla.com/trac/timeline?ticket=on" + - "&milestone=on&wiki=on&max=50&daysback=90&format=rss"), - processFeed: Planet.processBlogFeed, - entries: 10}, - {name: "Code", - url: Planet.HG_BASE + "rss-log", - processFeed: Planet.processHgFeed, - entries: 15}, - {name: "Discussions", - url: ("http://groups.google.com/group/ubiquity-firefox/feed/" + - "rss_v2_0_msgs.xml"), - processFeed: Planet.processBlogFeed, - entries: 30}, - {name: "Support", - url: ("http://getsatisfaction.com/mozilla/products/mozilla_ubiquity.rss?" + - "sort=recently_created"), - processFeed: Planet.processBlogFeed, - entries: 10} -]; - -Planet.doneLoadingFeeds = function doneLoadingFeeds() { - function fixHeights(daysAgo) { - var tallestHeight = 0; - var elements = $(".days-ago-" + i); - elements.each( - function(i) { - var height = $(this).height(); - if (height > tallestHeight) - tallestHeight = height; - }); - elements.height(tallestHeight); - } - - $("#issue").fadeIn(); - for (var i = 0; i < 10; i++) - fixHeights(i); - var entries = $("#issue .entry"); - $(document.body).width(entries.outerWidth() * entries.length); -}; - -Planet.splitByDate = function splitByDate(rawContent, content) { - var now = new Date(); - $(".blog-item", rawContent).each( - function(i) { - var pub = new Date($(this).attr("published")); - var msAgo = now - pub; - var hoursAgo = msAgo / (1000 * 60 * 60); - var daysAgo = Math.floor(hoursAgo / 8); - if (daysAgo < 0) - daysAgo = 0; - if (daysAgo > 9) - daysAgo = 9; - var div = $(".days-ago-" + daysAgo, content); - div.append(this); - }); -}; - -Planet.showFeed = function showFeed(feedInfo, cb) { - var entry = $('<div class="entry"></div>'); - var headline = $('<div class="headline"></div>'); - headline.text(feedInfo.name); - entry.append(headline); - $("#body").append(entry); - - var feed = new google.feeds.Feed(feedInfo.url); - feed.setNumEntries(feedInfo.entries); - feed.includeHistoricalEntries(); - feed.load( - function(result) { - var rawContent = $('<div class="content"></div>'); - var content = $('<div class="content"></div>'); - - for (var i = 0; i < 10; i++) - content.append('<div class="days-ago-' + i + '"></div>'); - - feedInfo.processFeed( - result.feed, - rawContent, - function() { - Planet.splitByDate(rawContent, content); - entry.append(content); - cb(); - }); - }); -}; - -google.load("feeds", "1"); -google.setOnLoadCallback( - function() { - var feedsLeftToLoad = Planet.FEEDS.length; - jQuery.each( - Planet.FEEDS, - function(i) { - Planet.showFeed(this, - function() { - feedsLeftToLoad--; - if (!feedsLeftToLoad) { - Planet.doneLoadingFeeds(); - } - }); - } - ); - });
--- a/docs.html Tue Mar 03 10:17:49 2009 -0800 +++ b/docs.html Tue Mar 03 10:22:55 2009 -0800 @@ -18,9 +18,9 @@ of <a href="http://ubiquity.mozilla.com/planet/">Planet Ubiquity</a>, but the underlying code can easily be modified to serve as a dashboard for any kind of project.</p> - <p>You can view the redesign <a href="about-mozilla.html">here</a>.</p> + <p>You can view the redesign <a href="planet.html">here</a>.</p> <ul> - <li><a href="#about-mozilla.js">JavaScript Documentation</a></li> + <li><a href="#planet.js">JavaScript Documentation</a></li> </ul> </div> </div>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/planet.css Tue Mar 03 10:22:55 2009 -0800 @@ -0,0 +1,122 @@ +body { + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + font-size: 9pt; + line-height: 1.4em; + background: white; + padding: 0; + margin: 0; +} + +#issue { + display: none; +} + +#header { + /* Too bad font-stretch isn't implemented in Firefox yet... */ + font-stretch: condensed; + font-variant: small-caps; + font-weight: bold; + font-size: 18pt; + margin: 6pt; + padding-top: 6pt; + padding-bottom: 6pt; + color: black; +} + +#body { +} + +.entry { + background: white; + float: left; + width: 20em; +} + +.headline { + font-weight: bold; + height: 3em; + padding: 6pt; + border-top: 1px dotted gray; + border-bottom: 1px dotted gray; +} + +.content { +} + +a { + color: black; + text-decoration: none; + border-bottom: 1px dotted gray; +} + +.blog-item { + padding-left: 6pt; + padding-right: 6pt; + padding-top: 6pt; + padding-bottom: 6pt; + color: gray; +} + +.blog-item a { + border: none; + font-style: italic; + color: black; +} + +.days-ago-0 { + background-color: #ffffff; +} + +.days-ago-1 { + background-color: #fafafa; +} + +.days-ago-2 { + background-color: #f5f5f5; +} + +.days-ago-3 { + background-color: #f0f0f0; +} + +.days-ago-4 { + background-color: #eaeaea; +} + +.days-ago-5 { + background-color: #e5e5e5; +} + +.days-ago-6 { + background-color: #e0e0e0; +} + +.days-ago-7 { + background-color: #dadada; +} + +.days-ago-8 { + background-color: #d5d5d5; +} + +.days-ago-9 { + background-color: #d0d0d0; +} + +#row-labels .content { + font-weight: bold; +} + +.build { + padding-right: 1em; + margin-right: 2pt; + opacity: .5; +} + +.build-errors { + background-color: #ff0000; +} + +.build-success { + background-color: #00ff00; +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/planet.html Tue Mar 03 10:22:55 2009 -0800 @@ -0,0 +1,56 @@ +<!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" xml:lang="en" lang="en"> +<head> + <meta http-equiv="Content-type" content="text/html; charset=utf-8" /> + <link rel="stylesheet" type="text/css" media="all" + href="planet.css" /> + <title>planet ubiquity</title> +</head> +<body> +<div id="issue"> + <div id="header">planet ubiquity</div> + <div id="body"> + <div class="entry" id="row-labels"> + <div class="headline"> </div> + <div class="content"> + <div class="days-ago-0"> + <div class="blog-item">Within the last 8 hours</div> + </div> + <div class="days-ago-1"> + <div class="blog-item">8-16 hours ago</div> + </div> + <div class="days-ago-2"> + <div class="blog-item">16 hours to 1 day ago</div> + </div> + <div class="days-ago-3"> + <div class="blog-item">24-32 hours ago</div> + </div> + <div class="days-ago-4"> + <div class="blog-item">32-40 hours ago</div> + </div> + <div class="days-ago-5"> + <div class="blog-item">40 hours to 2 days ago</div> + </div> + <div class="days-ago-6"> + <div class="blog-item">48-56 hours ago</div> + </div> + <div class="days-ago-7"> + <div class="blog-item">56-64 hours ago</div> + </div> + <div class="days-ago-8"> + <div class="blog-item">64 hours to 3 days ago</div> + </div> + <div class="days-ago-9"> + <div class="blog-item">More than 3 days ago</div> + </div> + </div> + </div> + </div> +</div> +</body> +<script src="jquery.js"></script> +<script src="querystring.js"></script> +<script src="http://www.google.com/jsapi?key=ABQIAAAAzBIC_wxmje-aKLT3RzZx7BSMyDMkO9FJ67H-yweQ42J8NadmShSzBtxGrM35N4zI4l-rt1mDAF_fPg"></script> +<script src="planet.js"></script> +</html>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/planet.js Tue Mar 03 10:22:55 2009 -0800 @@ -0,0 +1,214 @@ +// = Planet Ubiquity Code = +// +// This is the JavaScript source code for the Planet Ubiquity Redesign. + +var Planet = { + // The base URL for where Ubiquity buildbot information is located. + BUILDBOT_BASE: "http://ubiquity.mozilla.com/buildbot/", + + // The base URL for where Ubiquity's main HG repository is located. + HG_BASE: "https://ubiquity.mozilla.com/hg/ubiquity-firefox/" +}; + +Planet.getBuildInfo = function getBuildInfo(page) { + var builds = []; + $("li", page).each( + function(i) { + var revRegexp = /.*rev=\[([0-9a-f]+)\].*/; + builds.push({rev: $(this).text().match(revRegexp)[1], + href: (Planet.BUILDBOT_BASE + + $("a:not(:first)", this).attr("href")), + isSuccessful: $(".success", this).length > 0 + }); + } + ); + return builds; +}; + +Planet.mashupBuildbotWithHgData = function mashup(hgLog, buildbotPage) { + var builds = Planet.getBuildInfo(buildbotPage); + builds.forEach( + function(build) { + var revUrl = Planet.HG_BASE + "rev/" + build.rev; + var revSelector = ("a[href='" + revUrl + "']"); + var link = jQuery(revSelector, hgLog); + var className = "build-errors"; + var title = "This build may have errors."; + if (build.isSuccessful) { + className = "build-success"; + title = "This build passed all tests."; + } + var status = jQuery('<span></span>'); + status.addClass(className); + status.addClass("build"); + link.before(status); + status.wrap('<a title="' + title + + '" href="' + build.href + '"></a>'); + }); +}; + +Planet.processHgFeed = function processHgFeed(feed, content, cb) { + Planet.processBlogFeed( + feed, + content, + function() { + jQuery.get( + ("http://about-mozilla.appspot.com/?url=" + + Planet.BUILDBOT_BASE + "one_line_per_build&jsonp=?"), + null, + function(result) { + Planet.mashupBuildbotWithHgData(content, $(result.data)); + cb(); + }, + "jsonp" + ); + }); +}; + +Planet.processBlogFeed = function processBlogFeed(feed, content, cb) { + jQuery.each( + feed.entries, + function(i) { + var item = $('<div class="blog-item">' + + '<span class="title"></span> ' + + '<span class="author"></span></div>'); + $('.title', item).html(this.title); + var linkTitle = ""; + if (this.contentSnippet) + linkTitle =this.contentSnippet ; + var link = $('<a title="' + linkTitle + '" href="' + + this.link + '"></a>'); + link.attr("target", "_blank"); + $('.title', item).wrap(link); + if (this.author) { + var author = this.author; + var authorFilters = [ + // Filter out e.g. "Robert Jones <robert@jones.com>" + /(.+)\s*<.+>/, + // Filter out e.g. "rob...@jones.com (Robert Jones)" + /.+\.\.\.@.+\s+\((.+)\)/ + ]; + jQuery.each( + authorFilters, + function() { + var match = author.match(this); + if (match) + author = match[1]; + }); + $('.author', item).html('by ' + author); + } + $(item).attr("published", this.publishedDate); + content.append(item); + }); + cb(); +}; + +Planet.FEEDS = [ + {name: "Blogs", + url: "http://ubiquity.mozilla.com/planet/?feed=rss2", + processFeed: Planet.processBlogFeed, + entries: 10}, + {name: "Bugs", + url: ("https://ubiquity.mozilla.com/trac/timeline?ticket=on" + + "&milestone=on&wiki=on&max=50&daysback=90&format=rss"), + processFeed: Planet.processBlogFeed, + entries: 10}, + {name: "Code", + url: Planet.HG_BASE + "rss-log", + processFeed: Planet.processHgFeed, + entries: 15}, + {name: "Discussions", + url: ("http://groups.google.com/group/ubiquity-firefox/feed/" + + "rss_v2_0_msgs.xml"), + processFeed: Planet.processBlogFeed, + entries: 30}, + {name: "Support", + url: ("http://getsatisfaction.com/mozilla/products/mozilla_ubiquity.rss?" + + "sort=recently_created"), + processFeed: Planet.processBlogFeed, + entries: 10} +]; + +Planet.doneLoadingFeeds = function doneLoadingFeeds() { + function fixHeights(daysAgo) { + var tallestHeight = 0; + var elements = $(".days-ago-" + i); + elements.each( + function(i) { + var height = $(this).height(); + if (height > tallestHeight) + tallestHeight = height; + }); + elements.height(tallestHeight); + } + + $("#issue").fadeIn(); + for (var i = 0; i < 10; i++) + fixHeights(i); + var entries = $("#issue .entry"); + $(document.body).width(entries.outerWidth() * entries.length); +}; + +Planet.splitByDate = function splitByDate(rawContent, content) { + var now = new Date(); + $(".blog-item", rawContent).each( + function(i) { + var pub = new Date($(this).attr("published")); + var msAgo = now - pub; + var hoursAgo = msAgo / (1000 * 60 * 60); + var daysAgo = Math.floor(hoursAgo / 8); + if (daysAgo < 0) + daysAgo = 0; + if (daysAgo > 9) + daysAgo = 9; + var div = $(".days-ago-" + daysAgo, content); + div.append(this); + }); +}; + +Planet.showFeed = function showFeed(feedInfo, cb) { + var entry = $('<div class="entry"></div>'); + var headline = $('<div class="headline"></div>'); + headline.text(feedInfo.name); + entry.append(headline); + $("#body").append(entry); + + var feed = new google.feeds.Feed(feedInfo.url); + feed.setNumEntries(feedInfo.entries); + feed.includeHistoricalEntries(); + feed.load( + function(result) { + var rawContent = $('<div class="content"></div>'); + var content = $('<div class="content"></div>'); + + for (var i = 0; i < 10; i++) + content.append('<div class="days-ago-' + i + '"></div>'); + + feedInfo.processFeed( + result.feed, + rawContent, + function() { + Planet.splitByDate(rawContent, content); + entry.append(content); + cb(); + }); + }); +}; + +google.load("feeds", "1"); +google.setOnLoadCallback( + function() { + var feedsLeftToLoad = Planet.FEEDS.length; + jQuery.each( + Planet.FEEDS, + function(i) { + Planet.showFeed(this, + function() { + feedsLeftToLoad--; + if (!feedsLeftToLoad) { + Planet.doneLoadingFeeds(); + } + }); + } + ); + });