Skip to content

Commit

Permalink
[docs] Show bugs and feature requests on each of the feature pages.
Browse files Browse the repository at this point in the history
  • Loading branch information
jverkoey committed Jun 21, 2012
1 parent e40620b commit e576fcb
Show file tree
Hide file tree
Showing 18 changed files with 159 additions and 8 deletions.
1 change: 1 addition & 0 deletions docs/Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -899,6 +899,7 @@ HTML_STYLESHEET = docs/stylesheet.css

HTML_EXTRA_FILES = docs/js/fixed.js \
docs/js/cleannavtree.js \
docs/js/widget.js \
docs/gfx/nimbus128.png

# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output.
Expand Down
2 changes: 2 additions & 0 deletions docs/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,7 @@
</div>
<!--END GENERATE_TREEVIEW-->
</div> <!-- page -->

<script type="text/javascript" src="widget.js"></script>
</body>
</html>
93 changes: 93 additions & 0 deletions docs/js/widget.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
/**
* Welcome to janky-town. This code is messy as shit.
*/

var GitHubAPI = {};

GitHubAPI.Repo = function(username, reponame, callback) {
requestURL = "https://api.github.com/repos/"+username+"/"+reponame+'?callback=?';
$.getJSON(requestURL, function(json, status){
callback(json.data, status);
});
};
GitHubAPI.RepoEvents = function(username, reponame, callback) {
requestURL = "https://api.github.com/repos/"+username+"/"+reponame+"/events?callback=?";
$.getJSON(requestURL, function(json, status){
callback(json.data, status);
});
};
GitHubAPI.RepoIssues = function(username, reponame, labels, callback) {
requestURL = "https://api.github.com/repos/"+username+"/"+reponame+'/issues?labels='+labels+'&callback=?';
$.getJSON(requestURL, function(json, status){
callback(json.data, status);
});
};
function normalizeDate(date) {
var relative_to = new Date();
var delta = parseInt((relative_to.getTime() - date.getTime()) / 1000);

var out = '';
if (delta < 60) {
out = 'a minute ago';
} else if(delta < 120) {
out = 'couple of minutes ago';
} else if(delta < (45*60)) {
out = (parseInt(delta / 60)).toString() + ' minutes ago';
} else if(delta < (90*60)) {
out = 'an hour ago';
} else if(delta < (24*60*60)) {
out = '' + (parseInt(delta / 3600 + 0.5)).toString() + ' hours ago';
} else if(delta < (48*60*60)) {
out = '1 day ago';
} else {
out = (parseInt(delta / 86400)).toString() + ' days ago';
}

return out;
}

function fetchIssues(feature, element, type, typename) {
var labels = type+',['+feature+']';
element.attr('href', 'http://github.com/jverkoey/nimbus/issues?labels='+labels);
GitHubAPI.RepoIssues('jverkoey', 'nimbus', labels, function(json, status) {
if (json) {
var text = json.length;
if (json.length == 0) {
text = 'No '+typename+'s'
} else if (json.length == 1) {
text = text + ' ' + typename;
} else {
text = text + ' ' + typename + 's';
}
element.html(text);
if (type == 'bug') {
if (json.length == 0) {
element.addClass('no-issues');
} else if (json.length < 3) {
element.addClass('few-issues');
} else {
element.addClass('many-issues');
}
}
}
});
}

$(document).ready(function(){
var element = $('#github');
if (element && element.length > 0) {
// Move the node higher in the page.
element.remove();
$('#doc-content .header').prepend(element);
var bugs = $('<a class="issues">');
var features = $('<a class="issues">');
var updatingText = 'Updating...';
bugs.html(updatingText);
features.html(updatingText);

element.append(bugs).append(features);

fetchIssues(element.attr('feature'), bugs, 'bug', 'bug');
fetchIssues(element.attr('feature'), features, 'feature', 'feature request');
}
});
28 changes: 27 additions & 1 deletion docs/stylesheet.css
Original file line number Diff line number Diff line change
Expand Up @@ -1078,4 +1078,30 @@ h5 {
padding: 0;
font-size: 100%;
color: black;
}
}

#github {
float: right;
margin-top: 20px;
}

#github .issues {
color: #AAA;
padding: 5px;
margin-top: 10px;
margin-left: 10px;
border: 1px solid #EEE;
font-size: 2em;
}

#github .issues.no-issues {
background-color: #C9FFD4;
}

#github .issues.few-issues {
background-color: #FFFFC9;
}

#github .issues.many-issues {
background-color: #FFC9C9;
}
2 changes: 2 additions & 0 deletions src/attributedlabel/src/NimbusAttributedLabel.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
* @defgroup NimbusAttributedLabel Nimbus Attributed Label
* @{
*
* <div id="github" feature="attributedlabel"></div>
*
* The Nimbus Attributed Label is a UILabel that uses NSAttributedString to render rich text labels
* with links using CoreText.
*
Expand Down
2 changes: 2 additions & 0 deletions src/badge/src/NimbusBadge.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
* @defgroup NimbusBadge Nimbus Badge
* @{
*
* <div id="github" feature="badge"></div>
*
* This Nimbus badge view is a UIView that draws a customizable notification badge-like view.
*
* @image html badge-iphone-example1.png "Screenshot of a Nimbus badge on the iPhone"
Expand Down
2 changes: 2 additions & 0 deletions src/core/src/NimbusCore.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
/**
* @defgroup NimbusCore Nimbus Core
*
* <div id="github" feature="core"></div>
*
* Nimbus' Core defines the foundation upon which all other Nimbus features are built.
* Within the core you will find common elements used to build iOS applications
* including in-memory caches, path manipulation, and SDK availability. These features form
Expand Down
2 changes: 2 additions & 0 deletions src/css/src/NimbusCSS.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
* @defgroup NimbusCSS Nimbus CSS
* @{
*
* <div id="github" feature="css"></div>
*
* Nimbus CSS allows you to use cascading stylesheets to theme your native iOS application.
* Stylesheets provide a number of advantages over Interface Builder and native code.
*
Expand Down
2 changes: 2 additions & 0 deletions src/interapp/src/NimbusInterapp.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
/**
* @defgroup NimbusInterapp Nimbus Interapp
*
* <div id="github" feature="interapp"></div>
*
* Nimbus' inter-application communication feature for interacting with other applications
* installed on the device.
*
Expand Down
5 changes: 4 additions & 1 deletion src/launcher/src/NimbusLauncher.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,13 @@
//

/**
* Nimbus' Launcher view and related components.
* @defgroup NimbusLauncher Nimbus Launcher
* @{
*
* <div id="github" feature="launcher"></div>
*
* Nimbus' Launcher view and related components.
*
* A launcher view is best exemplified in Apple's home screen interface. It consists of a set
* of pages that each contain a set of buttons that the user may tap to access a consistent,
* focused aspect of the application or operating system. The user may swipe the screen to the
Expand Down
2 changes: 2 additions & 0 deletions src/models/src/NimbusModels.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
* @defgroup NimbusModels Nimbus Models
* @{
*
* <div id="github" feature="models"></div>
*
* A model is an implementation of a data source protocol.
*
* Data sources are required by various UI components throughout UIKit and Nimbus.
Expand Down
8 changes: 5 additions & 3 deletions src/networkcontrollers/src/NimbusNetworkControllers.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@
//

/**
* View controllers that display loading states while they load information from the network or
* disk.
*
* @defgroup NimbusNetworkControllers Nimbus Network Controllers
* @{
*
* <div id="github" feature="networkcontrollers"></div>
*
* View controllers that display loading states while they load information from the network or
* disk.
*
* Whether you are loading data from the disk or from the network, it is important to present
* the fact that information is loading to your user. This ensures that your application feels
* responsive and also comforts the user by letting them know that your application is working
Expand Down
8 changes: 5 additions & 3 deletions src/networkimage/src/NimbusNetworkImage.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@
//

/**
* Image views that load images from the network and efficiently store the result in memory and on
* disk.
*
* @defgroup NimbusNetworkImage Nimbus Network Image
* @{
*
* <div id="github" feature="networkimage"></div>
*
* Image views that load images from the network and efficiently store the result in memory and on
* disk.
*
* Presented below is an architectural overview of the Nimbus network image library.
*
* @image html NINetworkImageDesign1.png "NINetworkImage Design"
Expand Down
2 changes: 2 additions & 0 deletions src/operations/src/NimbusOperations.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
* @defgroup NimbusOperations Nimbus Operations
* @{
*
* <div id="github" feature="operations"></div>
*
* Processing data is a potential bottleneck for any application that manipulates it.
* Older iPhone and iPod touch models get the worst of this with their slower processors
* and smaller amounts of ram. It's important to pull data processing off of the main UI thread.
Expand Down
2 changes: 2 additions & 0 deletions src/overview/src/NimbusOverview.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
* @defgroup NimbusOverview Nimbus Overview
* @{
*
* <div id="github" feature="overview"></div>
*
* The Overview is a debugging tool for quickly understanding the current state of your
* application. When added to an application, it will insert a paged
* scroll view beneath the status bar that contains any number of pages of information.
Expand Down
2 changes: 2 additions & 0 deletions src/pagingscrollview/src/NimbusPagingScrollView.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
* @defgroup NimbusPagingScrollView Nimbus Paging Scroll View
* @{
*
* <div id="github" feature="pagingscrollview"></div>
*
* A paging scroll view is a UIScrollView that scrolls horizontally and shows a series of
* pages that are efficiently recycled.
*
Expand Down
2 changes: 2 additions & 0 deletions src/photos/src/NimbusPhotos.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
* @defgroup NimbusPhotos Nimbus Photos
* @{
*
* <div id="github" feature="photos"></div>
*
* Photo viewers are a common, non-trivial feature in many types of iOS apps ranging from
* simple photo viewers to apps that fetch photos from an API. The Nimbus photo album viewer
* is designed to consume minimal amounts of memory and encourage the use of threads to provide
Expand Down
2 changes: 2 additions & 0 deletions src/webcontroller/src/NimbusWebController.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
* @defgroup NimbusWebController Nimbus Web Controller
* @{
*
* <div id="github" feature="webcontroller"></div>
*
* This controller presents a UIWebView with a toolbar containing basic chrome for interacting
* with it. The chrome shows forward, back, stop and refresh buttons on a toolbar aligned
* to the bottom of the view controller's view. The toolbar includes an option to open the
Expand Down

0 comments on commit e576fcb

Please sign in to comment.