Permalink
Browse files

Update docs filtering for More, plus table styles.

  • Loading branch information...
1 parent c860849 commit ee241fe09053a46ed576cb099356c798139d2cb1 @cheeaun committed Nov 6, 2010
Showing with 30 additions and 11 deletions.
  1. +15 −0 assets/docs.css
  2. +11 −9 assets/docs.js
  3. +1 −1 core.html
  4. +3 −1 more.html
View
15 assets/docs.css
@@ -119,6 +119,21 @@ ul.awesomebar-list{
font-style: normal;
}
+#docs table{
+ width: 100%;
+}
+
+#docs table th{
+ background-color: #eee;
+ color: #686C70;
+ text-align: left;
+ border-bottom: 1px solid #ddd;
+}
+
+#docs table td{
+ border-bottom: 1px solid #ddd;
+}
+
.doc .content{
margin: 0 160px 0 0;
padding: 0 25px;
View
20 assets/docs.js
@@ -16,7 +16,7 @@ var Docs = {
startPagePath: null,
stripRootPath: null,
replaceRootPath: [],
- removePages: null,
+ filterPages: null,
data: {},
searchData: [],
@@ -383,17 +383,20 @@ var Docs = {
},
removeDocs: function(data){
- if (!Docs.removePages) return data;
- if (Docs.removePages.length){
- for (var i=0, l=Docs.removePages.length; i<l; i++){
- data.erase(Docs.removePages[i]);
+ var filterPages = Docs.filterPages;
+ if (!filterPages) return data;
+ if (typeof filterPages == 'object'){
+ for (var i=0, l=filterPages.length; i<l; i++){
+ data.erase(filterPages[i]);
}
+ return data;
+ } else if (typeof filterPages == 'function'){
+ return [].combine(data.map(filterPages));
} else {
- data = data.filter(function(item){
- return !item.test(Docs.removePages);
+ data.filter(function(item){
+ return !item.test(filterPages);
});
}
- return data;
},
fetchDocs: function(data){
@@ -538,7 +541,6 @@ var Docs = {
},
parseDoc: function(page, md){
- md = md.replace(/</g, '&lt;').replace(/>/g, '&gt;');
var html = new Showdown.converter().makeHtml(md);
html = html.replace(/&amp;lt;/g, '&lt;').replace(/&amp;gt;/g, '&gt;');
var container = new Element('div', {html: html});
View
2 core.html
@@ -29,7 +29,7 @@
path: '/more/',
realPath: 'more.html#'
});
-Docs.removePages = /Slick\/Slick/i;
+Docs.filterPages = /Slick\/Slick/i;
window.addEvent('domready', Docs.start);
</script>
<div id="container">
View
4 more.html
@@ -28,7 +28,9 @@
path: '/core/',
realPath: 'core.html#'
});
-Docs.removePages = /Locale\/Locale/i;
+Docs.filterPages = function(page){
+ return page.replace(/Locale\.[a-z]{2}(\-[a-z]{2})?\./i, '');
+};
window.addEvent('domready', Docs.start);
</script>
<div id="container">

0 comments on commit ee241fe

Please sign in to comment.