Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added multiple tables; refined presentation, other changes around All…

…_Repos wiki page
  • Loading branch information...
commit d69a7c254b8a15605546f3721af7bdf5d54c30e0 1 parent 9dbb626
Eduardo Pelegri-Llopart pelegri authored
3  All_Pages.md
View
@@ -10,7 +10,8 @@ title: All Pages
* [Adobe AIR]
  • aka [AIR]
* [AliceJS]
-* [All Repos]
+* [All Repos]
+  • also [All Repos as One Table]
* [All Samples]
* [Apache Cordova]
* [bbUI.js]
52 All_Repos.md
View
@@ -7,11 +7,24 @@ jsfile: All_Repos.js
---
{% include common-defs.md %}
-This is a sortable table with all the repositories in our [GitHub Organization](http://github.com/blackberry),
-generated from a backing [JSON file](All_Repos.json). Also see the list of [All Samples].
+<div id='right'>
+<div class='caption'>Repo Catalog</div>
+<ul>
+<li><a href="#repoPorts">Port Repos</a></li>
+<li><a href="#repoHtml5">HTML5 Repos</a></li>
+<li><a href="#repoNative">Native Repos</a></li>
+<li><a href="#repoAir">Adobe AIR Repos</a></li>
+<li><a href="#repoOther">Other Repos</a></li>
+</ul>
+</div>
+
+This page contains several tables cover all the repositories in our [GitHub Organization](http://github.com/blackberry),
+generated from a backing [JSON file](All_Repos.json). As an alternative presentation see [All Repos as One Table].
+Also see the list of [All Samples].
The table can be sorted (ascending/descending) on a sequence of one or more columns. To select additional
-columns select the next column while pressing the 'SHIFT' (on mac) key. The table uses these tooltips:
+columns select the next column while pressing the 'SHIFT' (on mac) key. The table uses the following tooltips -
+hover over them to learn their meaning:
<span class="question" tip="(Repo column) A list of 'tags' characterizing this repo (useful?)">T</span>,
<span class="question" tip="(Repo column) Extra information on the branches in the repository">B</span>,
<span class="question" tip="(Repo column) Repo has Pages">P</span>,
@@ -21,11 +34,34 @@ columns select the next column while pressing the 'SHIFT' (on mac) key. The tabl
<span class="question" tip="(in BB10 column) Ported to PlayBook but not yet tested on BB10">?</span>,
<span class="question" tip="(in Port column) Extra information on porting">P</span>.
-_*Notes*_: We are interested in your feedback on how to best present this information. In particular:
+_*Notes*_: We are interested in your feedback on how to best present this information.
+
+<div id="repoPorts">
+<a name="repoPorts"><h2>Port Repositories</h2></a>
+</div>
+
+<a href="#top">Back to top</a>
+
+<div id="repoHtml5">
+<a name="repoHtml5"><h2>HTML5 Repositories</h2></a>
+</div>
+
+<a href="#top">Back to top</a>
+
+<div id="repoNative">
+<a href="repoNative"><h2>Native Repositories</h2></a>
+</div>
+
+<a href="#top">Back to top</a>
+
+<div id="repoAir">
+<a href="repoAir"><h2>Adobe AIR Repositories</h2></a>
+</div>
-*Q1*: Is the list of tags useful, or just extra noise.
+<a href="#top">Back to top</a>
-*Q2*: Should we split the table into several tables? Perhaps one for each platform, plus one for all ports?
-That way each table would then be smaller and with fewer columns.
+<div id="repoOther">
+<a href="repoOther"><h2>Other Repositories</h2></a>
+</div>
-*N3*: We may have to start tracking non-RIM repos (e.g. opendataspace clients).
+<a href="#top">Back to top</a>
29 All_Repos2.md → All_Repos_as_One_Table.md
View
@@ -7,12 +7,13 @@ jsfile: All_Repos2.js
---
{% include common-defs.md %}
-Alternative presentation to [All_Repos];
-the tables cover all the repositories in our [GitHub Organization](http://github.com/blackberry),
-generated from a backing [JSON file](All_Repos.json). Also see the list of [All Samples].
+This is a single-table version of [All Repos].
+It provides sortable table with all the repositories in our [GitHub Organization](http://github.com/blackberry),
+generated from a backing [JSON file](All_Repos.json). Also see the list of [All Samples].
The table can be sorted (ascending/descending) on a sequence of one or more columns. To select additional
-columns select the next column while pressing the 'SHIFT' (on mac) key. The table uses these tooltips:
+columns select the next column while pressing the 'SHIFT' (on mac) key. The table uses these tooltips -
+hover over them to learn their meaning:
<span class="question" tip="(Repo column) A list of 'tags' characterizing this repo (useful?)">T</span>,
<span class="question" tip="(Repo column) Extra information on the branches in the repository">B</span>,
<span class="question" tip="(Repo column) Repo has Pages">P</span>,
@@ -24,22 +25,6 @@ columns select the next column while pressing the 'SHIFT' (on mac) key. The tabl
_*Notes*_: We are interested in your feedback on how to best present this information.
-<div id="repoPorts">
-<h2>Port Repositories</h2>
+<div id="repoAll">
+<h2>All Repositories</h2>
</div>
-
-<div id="repoHtml5">
-<h2>HTML5 Repositories</h2>
-</div>
-
-<div id="repoNative">
-<h2>Native Repositories</h2>
-</div>
-
-<div id="repoAir">
-<h2>Adobe AIR Repositories</h2>
-</div>
-
-<div id="repoOther">
-<h2>Other Repositories</h2>
-</div>
2  Recent_Changes.md
View
@@ -7,7 +7,7 @@ title: Recent Changes
New additions and major updates to pages. Listed in reverse chronological order.
-* Added [All Repos] and [All Samples], and the corresponding JS and JSON files.
+* Added [All Repos] and [All Repos as One Table] and the corresponding JS, CSS and JSON files.
* Added first cut at: [BlackBerry 10 Releases], [BlackBerry 10.0.06][blackberry_10_0_06] and [BlackBerry 10.0.6 Samples][blackberry_10_0_06_samples]
* Added: [FAQ]
* Added: [Screencasts]
1  _includes/basic-include.html
View
@@ -4,7 +4,6 @@
<head>
<title>{{ page.title }}</title>
<link id="stylesheet" href="{{ base-url }}/css/github.css" rel="stylesheet" type="text/css"></link>
- <link id="stylesheet" href="{{ base-url }}/css/table.css" rel="stylesheet" type="text/css"></link>
<link id="stylesheet" href="{{ base-url }}/css/jquery.tablesorter.theme/style.css" rel="stylesheet" type="text/css"></link>
<link id="stylesheet" href="{{ base-url }}/css/tooltip.css" rel="stylesheet" type="text/css"></link>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
3  _includes/common-defs.md
View
@@ -53,7 +53,8 @@
[bb_push]: <BlackBerry_Push_Service.html> "BlackBerry Push Service"
[adobe_air]: <Adobe_AIR.html> "Adobe Integrated Runtime (AIR)"
-[all_repos]: <All_Repos.html> "All Repos in GitHub.com/Blackberry"
+[all_repos]: <All_Repos.html> "All Repos in GitHub.com/Blackberry, in multiple tables"
+[all_repos_as_one_table]: <All_Repos_as_One_Table.html> "All Repos in GitHub.com/Blackberry as a single table"
[all_samples]: <All_Samples.html> "All Samples in GitHub.com/Blackberry"
[alicejs]: <AliceJS.html> "Alice - A Lightweight Independent CSS Engine"
[air]: <AIR.html> "Adobe Integrated Runtime (AIR)"
2  css/github.css
View
@@ -170,7 +170,7 @@ h4 {
width: 100%;
}
-#right caption {
+#right caption, #right div.caption {
text-align: center;
font-size: 12pt;
margin-bottom: 10px;
32 css/jquery.tablesorter.theme/style.css
View
@@ -1,3 +1,35 @@
+table.tablesorter {
+ border: 1px solid #666;
+ margin: 20px 0 20px 0 !important;
+}
+
+table.tablesorter th, table.tablesorter td {
+ padding: 2px 4px 2px 4px !important;
+ text-align: left;
+ vertical-align: top;
+}
+
+table.tablesorter td.centered {
+ text-align: center;
+}
+
+table.tablesorter th {
+ background-color: #fc0;
+}
+
+table.tablesorter th:hover {
+ background-color: #fc7;
+}
+
+table.tablesorter tbody tr.even {
+ background-color: #fea
+}
+
+table.tablesorter tbody tr.odd {
+ background-color: #fff
+}
+
+
/* tables */
table.tablesorter {
border: 1px solid #666;
30 css/table.css
View
@@ -1,30 +0,0 @@
-table {
- border: 1px solid #666;
- margin: 20px 0 20px 0 !important;
-}
-
-th, td {
- padding: 2px 4px 2px 4px !important;
- text-align: left;
- vertical-align: top;
-}
-
-td.centered {
- text-align: center;
-}
-
-th {
- background-color: #fc0;
-}
-
-th:hover {
- background-color: #fc7;
-}
-
-tbody tr.even {
- background-color: #fea
-}
-
-tbody tr.odd {
- background-color: #fff
-}
393 js/All_Repos.js
View
@@ -1,143 +1,268 @@
+/* Code here should be shared with All_Repos2.js */
+
+// add new widget called repeatHeaders
+$.tablesorter.addWidget({
+ // give the widget a id
+ id: "repeatHeaders",
+ // format is called when the on init and when a sorting has finished
+ format: function(table) {
+
+ // This should be changed to cache the headers based on the table object
+ // because we are sorting multiple tables.
+ // Invalidating the cache will work for now
+
+ // invalidate the cache
+ this.headers = null;
+
+ // cache and collect all TH headers
+ if(!this.headers) {
+ var h = this.headers = [];
+ $("thead th",table).each(function() {
+ h.push(
+ "<th>" + $(this).text() + "</th>"
+ );
+
+ });
+ }
+
+ // remove appended headers by classname.
+ $("tr.repeated-header",table).remove();
+
+ // loop all tr elements and insert a copy of the "headers"
+ for(var i=0; i < table.tBodies[0].rows.length; i++) {
+ // insert a copy of the table head every 10th row
+ if((i%20) == 19) {
+ $("tbody tr:eq(" + i + ")",table).before(
+ $("<tr></tr>").addClass("repeated-header").html(this.headers.join(""))
+
+ );
+ }
+ }
+ }
+});
+
+/*
+ * parseRepoData()
+ *
+ * data - from JASON parse
+ *
+ * showPortColumn - true, false
+ * showSamplesColumn - true, false
+ *
+ * portTag - "yes", "no", "any"
+ * samplesTag - "yes", "no", "any"
+ * typeTag - "html5", "native", "air", "other", "any"
+ *
+ * Should rewrite with callback funtions on columns and tags
+ */
+
+function parseRepoData(data,
+ showPortColumn, showSamplesColumn, showTypeColumn,
+ portTag, samplesTag, typeTag) {
+ var items = [];
+
+ /* total hack on the overlap; need to fix */
+ items.push('<thead>' +
+ '<tr>' +
+ '<th>Repository</th>' +
+ '<th>Description</th>' +
+ ( showTypeColumn ? '<th>Type</th>' : '' ) +
+ '<th>BB10</th>' +
+ ( showSamplesColumn ? '<th>Sample</th>' : '' ) +
+ ( showPortColumn ? '<th>Port</th>' : '' ) +
+ '</tr>' +
+ '</thead>')
+
+ $.each(data, function(key, val) {
+ if ( ( $.inArray("port", val.tags) < 0) && ( portTag === "yes") ) {
+ return true; /* skip this item */
+ }
+ if ( ( $.inArray("port", val.tags) >= 0) && (portTag === "no") ) {
+ return true; /* skip this item */
+ }
+
+ if ( ( $.inArray("samples", val.tags) < 0) && ( samplesTag === "yes") ) {
+ return true; /* skip this item */
+ }
+ if ( ( $.inArray("samples", val.tags) >= 0) && (samplesTag === "no") ) {
+ return true; /* skip this item */
+ }
+
+ if ( ( $.inArray("html5", val.tags) < 0) && ( typeTag === "html5") ) {
+ return true; /* skip this item */
+ }
+ if ( ( $.inArray("native", val.tags) < 0) && (typeTag === "native") ) {
+ return true; /* skip this item */
+ }
+ if ( ( $.inArray("air", val.tags) < 0) && (typeTag === "air") ) {
+ return true; /* skip this item */
+ }
+ if ( ( ( $.inArray("air", val.tags) >= 0) ||
+ ( $.inArray("html5", val.tags) >= 0) ||
+ ( $.inArray("native", val.tags) >= 0) ) && (typeTag === "other") ) {
+ return true; /* skip this item */
+ }
+
+ items.push('<tr>' +
+ /* Start Row */
+
+ /* Repository */
+ '<td><span style="white-space: nowrap;"><a href="' + val.url + '" target="_blank">' + key + '</a></span>' +
+
+ ' <span style="white-space: nowrap;">'+
+ ( ( (val.branches && val.branches.length > 1 ) || (val.branchinfo))
+ ? ' <span class="question" tip="' + val.branches +
+ ( ( val.branchinfo )
+ ? val.branchinfo
+ : ''
+ ) +
+ '">B</span>'
+ : ''
+ ) +
+ ( ( $.inArray("wiki", val.tags) >= 0 )
+ ? ' <span class="question" tip="Repo has a Wiki">W</span>'
+ : ''
+ ) +
+ ( ( $.inArray("pages", val.tags) >= 0 )
+ ? ' <span class="question" tip="Repo has a Pages local site">P</span>'
+ : ''
+ ) +
+ '</span>' +
+
+ '</td>' +
+
+ /* Description */
+ '<td>' + val.desc +
+ ( ( val.note )
+ ? ' <span class="question" tip="' + val.note + '">?</span>'
+ : ''
+ ) +
+ ( ( val.warning )
+ ? ' <span class="warning" tip="' + val.warning + '">!</span>'
+ : ''
+ ) +
+ '</td>' +
+
+ /* Type */
+ ( showTypeColumn
+ ? '<td class="centered">' + val.type + '</td>'
+ : '' ) +
+
+ /* BB10 */
+ '<td class="centered">' + (
+ ($.inArray("bb10", val.tags) >= 0)
+ ? '&check;'
+ : ( ($.inArray("playbook", val.tags) >= 0)
+ ? '<span class="question" left="yes" tip="Tested on PlayBook, not yet on BB10">?</span>'
+ : '')
+ ) +
+ '</td>' +
+
+ /* Samples */
+ ( showSamplesColumn
+ ? '<td class="centered">' + ( ($.inArray("samples", val.tags) >= 0) ? "&check;" : "") + '</td>'
+ : '' ) +
+
+ /* Ports */
+ ( showPortColumn
+ ? ( '<td class="centered">' + ( ($.inArray("port", val.tags) >= 0) ? "&check;" : "") +
+ ( ( val.portinfo)
+ ? '<span class="question" left="yes" tip="' + val.portinfo + '">P</span>'
+ : '' ) +
+ '</td>')
+ : '' ) +
+
+ /* End of row */
+ '</tr>');
+ });
+ return items;
+}
+
+
$(document).ready(function(){
+
$.getJSON('/Community/All_Repos.json', function(data) {
- var items = [];
-
- /* total hack on the overlap; need to fix */
- items.push('<thead>' +
- '<tr>' +
- '<th>Repository</th>' +
- '<th>Description</th>' +
- '<th>Type</th>' +
- '<th>BB10</th>' +
- '<th>Sample</th>' +
- '<th>Port</th>' +
-/* REMOVED for now
- '<th>Tags&nbsp;&nbsp;&nbsp;</th>' +
-*/
- '</tr>' +
- '</thead>')
-
- $.each(data, function(key, val) {
- items.push('<tr>' +
-
- /* Repository */
- '<td><span style="white-space: nowrap;"><a href="' + val.url + '" target="_blank">' + key + '</a></span>' +
-
- ' <span style="white-space: nowrap;">'+
- ( ( (val.branches && val.branches.length > 1 ) || (val.branchinfo))
- ? ' <span class="question" tip="' + val.branches +
- ( ( val.branchinfo )
- ? val.branchinfo
- : ''
- ) +
- '">B</span>'
- : ''
- ) +
- ( ( $.inArray("wiki", val.tags) >= 0 )
- ? ' <span class="question" tip="Repo has a Wiki">W</span>'
- : ''
- ) +
- ( ( $.inArray("pages", val.tags) >= 0 )
- ? ' <span class="question" tip="Repo has a Pages local site">P</span>'
- : ''
- ) +
- ( ( val.tags )
- ? ' <a href="' + val.url + '#readme"><span class="question" tip="' + val.tags + '">T</span></a>'
- : '' ) +
- '</span>' +
-
- '</td>' +
-
- /* Description */
- '<td>' + val.desc +
- ( ( val.note )
- ? ' <span class="question" tip="' + val.note + '">?</span>'
- : ''
- ) +
- ( ( val.warning )
- ? ' <span class="warning" tip="' + val.warning + '">!</span>'
- : ''
- ) +
- '</td>' +
-
- /* Platform */
- '<td class="centered">' + val.type + '</td>' +
-
- /* BB10 */
- '<td class="centered">' + (
- ($.inArray("bb10", val.tags) >= 0)
- ? '&check;'
- : ( ($.inArray("playbook", val.tags) >= 0)
- ? '<span class="question" left="yes" tip="Tested on PlayBook, not yet on BB10">?</span>'
- : '')
- ) +
- '</td>' +
-
- /* Samples */
- '<td class="centered">' + ( ($.inArray("samples", val.tags) >= 0) ? "&check;" : "") + '</td>' +
-
- /* Ports */
- '<td class="centered">' + ( ($.inArray("port", val.tags) >= 0) ? "&check;" : "") +
- ( ( val.portinfo)
- ? '<span class="question" left="yes" tip="' + val.portinfo + '">P</span>'
- : '' ) +
- '</td>' +
-
- /* Tags */
- /* REMOVED for now
- '<td class="centered">' +
- ( ( val.tags )
- ? '<a href="' + val.url + '#readme"><span class="question" left="yes" tip="' + val.tags + '">T</span></a>'
- : '' ) +
- '</td>' +
- */
-
- '</tr>');
+
+ /* Table of Port Repos */
+
+ /* Parse JSON data into items
+ * column: port, samples, type / tags: port, samples, type */
+ items = parseRepoData(data, false, false, true, "yes", "any", "any");
+
+ /* Inject into page */
+ $('<table/>', {
+ 'id': 'repoPortsTable',
+ html: items.join('')
+ }).appendTo('#repoPorts').addClass("tablesorter");
+
+ $("#repoPortsTable").tablesorter({
+ widgets: ['zebra', 'repeatHeaders'] // Stripping looking
+
});
-
+
+ /* Table of HTML5 Repos */
+
+ /* Parse JSON data into items
+ * column: port, samples, type / tags: port, samples, type */
+ items = parseRepoData(data, true, true, false, "any", "any", "html5");
+
+ /* Inject into page */
$('<table/>', {
- 'id': 'allrepos',
+ 'id': 'repoHtml5Table',
html: items.join('')
- }).appendTo('#contentbody').addClass("tablesorter");
-
-
- // add new widget called repeatHeaders
- $.tablesorter.addWidget({
- // give the widget a id
- id: "repeatHeaders",
- // format is called when the on init and when a sorting has finished
- format: function(table) {
- // cache and collect all TH headers
- if(!this.headers) {
- var h = this.headers = [];
- $("thead th",table).each(function() {
- h.push(
- "<th>" + $(this).text() + "</th>"
- );
-
- });
- }
-
- // remove appended headers by classname.
- $("tr.repeated-header",table).remove();
-
- // loop all tr elements and insert a copy of the "headers"
- for(var i=0; i < table.tBodies[0].rows.length; i++) {
- // insert a copy of the table head every 10th row
- if((i%20) == 19) {
- $("tbody tr:eq(" + i + ")",table).before(
- $("<tr></tr>").addClass("repeated-header").html(this.headers.join(""))
-
- );
- }
- }
- }
- });
+ }).appendTo('#repoHtml5').addClass("tablesorter");
+
+ $("#repoHtml5Table").tablesorter({
+ widgets: ['zebra', 'repeatHeaders'] // Stripping looking
+ });
+
+ /* Table of Native Repos */
+
+ /* Parse JSON data into items
+ * column: port, samples, type / tags: port, samples, type */
+ items = parseRepoData(data, true, true, false, "any", "any", "native");
+
+ /* Inject into page */
+ $('<table/>', {
+ 'id': 'repoNativeTable',
+ html: items.join('')
+ }).appendTo('#repoNative').addClass("tablesorter");
+
+ $("#repoNativeTable").tablesorter({
+ widgets: ['zebra', 'repeatHeaders'] // Stripping looking
+ });
+
+ /* Table of AIR Repos */
+
+ /* Parse JSON data into items
+ * column: port, samples, type / tags: port, samples, type */
+ items = parseRepoData(data, true, true, false, "any", "any", "air");
+
+ /* Inject into page */
+ $('<table/>', {
+ 'id': 'repoAirTable',
+ html: items.join('')
+ }).appendTo('#repoAir').addClass("tablesorter");
+
+ $("#repoAirTable").tablesorter({
+ widgets: ['zebra', 'repeatHeaders'] // Stripping looking
+ });
+
+ /* Table of Other Repos */
+
+ /* Parse JSON data into items
+ * column: port, samples, type / tags: port, samples, type */
+ items = parseRepoData(data, true, true, true, "any", "any", "other");
+
+ /* Inject into page */
+ $('<table/>', {
+ 'id': 'repoOtherTable',
+ html: items.join('')
+ }).appendTo('#repoOther').addClass("tablesorter");
- /* Sort the table */
- $("#allrepos").tablesorter({
- // Stripping looking
- widgets: ['zebra', 'repeatHeaders']
+ /* Sort the tables */
+ $("#repoOtherTable").tablesorter({
+ widgets: ['zebra', 'repeatHeaders'] // Stripping looking
});
/* Add the tooltips */
389 js/All_Repos2.js
View
@@ -1,264 +1,147 @@
-/* Code here should be shared with All_Repos.js */
+/* Code here should be the same as All_Repos.js */
-// add new widget called repeatHeaders
-$.tablesorter.addWidget({
- // give the widget a id
- id: "repeatHeaders",
- // format is called when the on init and when a sorting has finished
- format: function(table) {
-
- // invalidate the cache
- this.headers = null;
-
- // cache and collect all TH headers
- if(!this.headers) {
- var h = this.headers = [];
- $("thead th",table).each(function() {
- h.push(
- "<th>" + $(this).text() + "</th>"
- );
-
- });
- }
-
- // remove appended headers by classname.
- $("tr.repeated-header",table).remove();
-
- // loop all tr elements and insert a copy of the "headers"
- for(var i=0; i < table.tBodies[0].rows.length; i++) {
- // insert a copy of the table head every 10th row
- if((i%20) == 19) {
- $("tbody tr:eq(" + i + ")",table).before(
- $("<tr></tr>").addClass("repeated-header").html(this.headers.join(""))
-
- );
- }
- }
- }
-});
-
-/*
- * parseRepoData()
- *
- * data - from JASON parse
- *
- * showPortColumn - true, false
- * showSamplesColumn - true, false
- *
- * portTag - "yes", "no", "any"
- * samplesTag - "yes", "no", "any"
- * typeTag - "html5", "native", "air", "other", "any"
- *
- * Should rewrite with callback funtions on columns and tags
- */
-
-function parseRepoData(data,
- showPortColumn, showSamplesColumn, showTypeColumn,
- portTag, samplesTag, typeTag) {
- var items = [];
-
- /* total hack on the overlap; need to fix */
- items.push('<thead>' +
- '<tr>' +
- '<th>Repository</th>' +
- '<th>Description</th>' +
- ( showTypeColumn ? '<th>Type</th>' : '' ) +
- '<th>BB10</th>' +
- ( showSamplesColumn ? '<th>Sample</th>' : '' ) +
- ( showPortColumn ? '<th>Port</th>' : '' ) +
- '</tr>' +
- '</thead>')
-
- $.each(data, function(key, val) {
- if ( ( $.inArray("port", val.tags) < 0) && ( portTag === "yes") ) {
- return true; /* skip this item */
- }
- if ( ( $.inArray("port", val.tags) >= 0) && (portTag === "no") ) {
- return true; /* skip this item */
- }
-
- if ( ( $.inArray("samples", val.tags) < 0) && ( samplesTag === "yes") ) {
- return true; /* skip this item */
- }
- if ( ( $.inArray("samples", val.tags) >= 0) && (samplesTag === "no") ) {
- return true; /* skip this item */
- }
-
- if ( ( $.inArray("html5", val.tags) < 0) && ( typeTag === "html5") ) {
- return true; /* skip this item */
- }
- if ( ( $.inArray("native", val.tags) < 0) && (typeTag === "native") ) {
- return true; /* skip this item */
- }
- if ( ( $.inArray("air", val.tags) < 0) && (typeTag === "air") ) {
- return true; /* skip this item */
- }
- if ( ( ( $.inArray("air", val.tags) >= 0) ||
- ( $.inArray("html5", val.tags) >= 0) ||
- ( $.inArray("native", val.tags) >= 0) ) && (typeTag === "other") ) {
- return true; /* skip this item */
- }
-
- items.push('<tr>' +
- /* Start Row */
-
- /* Repository */
- '<td><span style="white-space: nowrap;"><a href="' + val.url + '" target="_blank">' + key + '</a></span>' +
-
- ' <span style="white-space: nowrap;">'+
- ( ( (val.branches && val.branches.length > 1 ) || (val.branchinfo))
- ? ' <span class="question" tip="' + val.branches +
- ( ( val.branchinfo )
- ? val.branchinfo
- : ''
- ) +
- '">B</span>'
- : ''
- ) +
- ( ( $.inArray("wiki", val.tags) >= 0 )
- ? ' <span class="question" tip="Repo has a Wiki">W</span>'
- : ''
- ) +
- ( ( $.inArray("pages", val.tags) >= 0 )
- ? ' <span class="question" tip="Repo has a Pages local site">P</span>'
- : ''
- ) +
- '</span>' +
-
- '</td>' +
-
- /* Description */
- '<td>' + val.desc +
- ( ( val.note )
- ? ' <span class="question" tip="' + val.note + '">?</span>'
- : ''
- ) +
- ( ( val.warning )
- ? ' <span class="warning" tip="' + val.warning + '">!</span>'
- : ''
- ) +
- '</td>' +
-
- /* Type */
- ( showTypeColumn
- ? '<td class="centered">' + val.type + '</td>'
- : '' ) +
-
- /* BB10 */
- '<td class="centered">' + (
- ($.inArray("bb10", val.tags) >= 0)
- ? '&check;'
- : ( ($.inArray("playbook", val.tags) >= 0)
- ? '<span class="question" left="yes" tip="Tested on PlayBook, not yet on BB10">?</span>'
- : '')
- ) +
- '</td>' +
-
- /* Samples */
- ( showSamplesColumn
- ? '<td class="centered">' + ( ($.inArray("samples", val.tags) >= 0) ? "&check;" : "") + '</td>'
- : '' ) +
-
- /* Ports */
- ( showPortColumn
- ? ( '<td class="centered">' + ( ($.inArray("port", val.tags) >= 0) ? "&check;" : "") +
- ( ( val.portinfo)
- ? '<span class="question" left="yes" tip="' + val.portinfo + '">P</span>'
- : '' ) +
- '</td>')
- : '' ) +
-
- /* End of row */
- '</tr>');
- });
- return items;
-}
-
+/* This version was actually first and then I fixed a couple of issues and generalized it for All_Repos.js */
$(document).ready(function(){
-
$.getJSON('/Community/All_Repos.json', function(data) {
-
- /* Table of Port Repos */
-
- /* Parse JSON data into items
- * column: port, samples, type / tags: port, samples, type */
- items = parseRepoData(data, false, false, true, "yes", "any", "any");
-
- /* Inject into page */
- $('<table/>', {
- 'id': 'repoPortsTable',
- html: items.join('')
- }).appendTo('#repoPorts').addClass("tablesorter");
-
- $("#repoPortsTable").tablesorter({
- widgets: ['zebra', 'repeatHeaders'] // Stripping looking
-
- });
-
- /* Table of HTML5 Repos */
-
- /* Parse JSON data into items
- * column: port, samples, type / tags: port, samples, type */
- items = parseRepoData(data, true, true, false, "any", "any", "html5");
-
- /* Inject into page */
- $('<table/>', {
- 'id': 'repoHtml5Table',
- html: items.join('')
- }).appendTo('#repoHtml5').addClass("tablesorter");
-
- $("#repoHtml5Table").tablesorter({
- widgets: ['zebra', 'repeatHeaders'] // Stripping looking
- });
-
- /* Table of Native Repos */
-
- /* Parse JSON data into items
- * column: port, samples, type / tags: port, samples, type */
- items = parseRepoData(data, true, true, false, "any", "any", "native");
-
- /* Inject into page */
- $('<table/>', {
- 'id': 'repoNativeTable',
- html: items.join('')
- }).appendTo('#repoNative').addClass("tablesorter");
-
- $("#repoNativeTable").tablesorter({
- widgets: ['zebra', 'repeatHeaders'] // Stripping looking
- });
-
- /* Table of AIR Repos */
-
- /* Parse JSON data into items
- * column: port, samples, type / tags: port, samples, type */
- items = parseRepoData(data, true, true, false, "any", "any", "air");
-
- /* Inject into page */
- $('<table/>', {
- 'id': 'repoAirTable',
- html: items.join('')
- }).appendTo('#repoAir').addClass("tablesorter");
-
- $("#repoAirTable").tablesorter({
- widgets: ['zebra', 'repeatHeaders'] // Stripping looking
+ var items = [];
+
+ /* total hack on the overlap; need to fix */
+ items.push('<thead>' +
+ '<tr>' +
+ '<th>Repository</th>' +
+ '<th>Description</th>' +
+ '<th>Type</th>' +
+ '<th>BB10</th>' +
+ '<th>Sample</th>' +
+ '<th>Port</th>' +
+/* REMOVED for now
+ '<th>Tags&nbsp;&nbsp;&nbsp;</th>' +
+*/
+ '</tr>' +
+ '</thead>')
+
+ $.each(data, function(key, val) {
+ items.push('<tr>' +
+
+ /* Repository */
+ '<td><span style="white-space: nowrap;"><a href="' + val.url + '" target="_blank">' + key + '</a></span>' +
+
+ ' <span style="white-space: nowrap;">'+
+ ( ( (val.branches && val.branches.length > 1 ) || (val.branchinfo))
+ ? ' <span class="question" tip="' + val.branches +
+ ( ( val.branchinfo )
+ ? val.branchinfo
+ : ''
+ ) +
+ '">B</span>'
+ : ''
+ ) +
+ ( ( $.inArray("wiki", val.tags) >= 0 )
+ ? ' <span class="question" tip="Repo has a Wiki">W</span>'
+ : ''
+ ) +
+ ( ( $.inArray("pages", val.tags) >= 0 )
+ ? ' <span class="question" tip="Repo has a Pages local site">P</span>'
+ : ''
+ ) +
+ ( ( val.tags )
+ ? ' <a href="' + val.url + '#readme"><span class="question" tip="' + val.tags + '">T</span></a>'
+ : '' ) +
+ '</span>' +
+
+ '</td>' +
+
+ /* Description */
+ '<td>' + val.desc +
+ ( ( val.note )
+ ? ' <span class="question" tip="' + val.note + '">?</span>'
+ : ''
+ ) +
+ ( ( val.warning )
+ ? ' <span class="warning" tip="' + val.warning + '">!</span>'
+ : ''
+ ) +
+ '</td>' +
+
+ /* Platform */
+ '<td class="centered">' + val.type + '</td>' +
+
+ /* BB10 */
+ '<td class="centered">' + (
+ ($.inArray("bb10", val.tags) >= 0)
+ ? '&check;'
+ : ( ($.inArray("playbook", val.tags) >= 0)
+ ? '<span class="question" left="yes" tip="Tested on PlayBook, not yet on BB10">?</span>'
+ : '')
+ ) +
+ '</td>' +
+
+ /* Samples */
+ '<td class="centered">' + ( ($.inArray("samples", val.tags) >= 0) ? "&check;" : "") + '</td>' +
+
+ /* Ports */
+ '<td class="centered">' + ( ($.inArray("port", val.tags) >= 0) ? "&check;" : "") +
+ ( ( val.portinfo)
+ ? '<span class="question" left="yes" tip="' + val.portinfo + '">P</span>'
+ : '' ) +
+ '</td>' +
+
+ /* Tags */
+ /* REMOVED for now
+ '<td class="centered">' +
+ ( ( val.tags )
+ ? '<a href="' + val.url + '#readme"><span class="question" left="yes" tip="' + val.tags + '">T</span></a>'
+ : '' ) +
+ '</td>' +
+ */
+
+ '</tr>');
});
-
- /* Table of Other Repos */
-
- /* Parse JSON data into items
- * column: port, samples, type / tags: port, samples, type */
- items = parseRepoData(data, true, true, true, "any", "any", "other");
-
- /* Inject into page */
+
$('<table/>', {
- 'id': 'repoOtherTable',
+ 'id': 'allrepos',
html: items.join('')
- }).appendTo('#repoOther').addClass("tablesorter");
+ }).appendTo('#repoAll').addClass("tablesorter");
+
+
+ // add new widget called repeatHeaders
+ $.tablesorter.addWidget({
+ // give the widget a id
+ id: "repeatHeaders",
+ // format is called when the on init and when a sorting has finished
+ format: function(table) {
+ // cache and collect all TH headers
+ if(!this.headers) {
+ var h = this.headers = [];
+ $("thead th",table).each(function() {
+ h.push(
+ "<th>" + $(this).text() + "</th>"
+ );
+
+ });
+ }
+
+ // remove appended headers by classname.
+ $("tr.repeated-header",table).remove();
+
+ // loop all tr elements and insert a copy of the "headers"
+ for(var i=0; i < table.tBodies[0].rows.length; i++) {
+ // insert a copy of the table head every 10th row
+ if((i%20) == 19) {
+ $("tbody tr:eq(" + i + ")",table).before(
+ $("<tr></tr>").addClass("repeated-header").html(this.headers.join(""))
+
+ );
+ }
+ }
+ }
+ });
- /* Sort the tables */
- $("#repoOtherTable").tablesorter({
- widgets: ['zebra', 'repeatHeaders'] // Stripping looking
+ /* Sort the table */
+ $("#allrepos").tablesorter({
+ // Stripping looking
+ widgets: ['zebra', 'repeatHeaders']
});
/* Add the tooltips */
Please sign in to comment.
Something went wrong with that request. Please try again.