Skip to content

Commit

Permalink
Update docs filtering for More, plus table styles.
Browse files Browse the repository at this point in the history
  • Loading branch information
cheeaun committed Nov 6, 2010
1 parent c860849 commit ee241fe
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 11 deletions.
15 changes: 15 additions & 0 deletions assets/docs.css
Expand Up @@ -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;
Expand Down
20 changes: 11 additions & 9 deletions assets/docs.js
Expand Up @@ -16,7 +16,7 @@ var Docs = {
startPagePath: null,
stripRootPath: null,
replaceRootPath: [],
removePages: null,
filterPages: null,

data: {},
searchData: [],
Expand Down Expand Up @@ -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){
Expand Down Expand Up @@ -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});
Expand Down
2 changes: 1 addition & 1 deletion core.html
Expand Up @@ -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">
Expand Down
4 changes: 3 additions & 1 deletion more.html
Expand Up @@ -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">
Expand Down

0 comments on commit ee241fe

Please sign in to comment.