Skip to content
This repository has been archived by the owner on Feb 1, 2018. It is now read-only.

Commit

Permalink
UI changes
Browse files Browse the repository at this point in the history
- strong as title, code snippet style, parse first strong of p tag
  • Loading branch information
farhan687 committed Sep 21, 2016
1 parent 1a35a2f commit d0cfcbc
Show file tree
Hide file tree
Showing 7 changed files with 60 additions and 29 deletions.
2 changes: 1 addition & 1 deletion dist/css/main.min.css

Large diffs are not rendered by default.

20 changes: 16 additions & 4 deletions dist/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -372,10 +372,12 @@
$rootScope.$on('$routeChangeSuccess', function(newRoute, oldRoute) {
jWindow.on('docbase:ready', function() {
$anchorScroll();
$('.content').find('pre code').each(function() {
$('.content').find('pre code').each(function(i, block) {
$(this).addClass("prettyprint");
// hljs.highlightBlock(block);
});
prettyPrint();
// hljs.initHighlightingOnLoad();
});
});
};
Expand Down Expand Up @@ -954,9 +956,19 @@

$('.content li').each(function() {
var content = JSON.stringify($(this).html());
console.log(content.indexOf('<strong>'));
if(content.indexOf('<strong>') === 1) {
$(this).find('strong').eq(0).addClass('li-title');
var self = this;
if(content.indexOf('<p>') === 1 && content.indexOf('<strong>') === 4) {
setTitle();
}
else if(content.indexOf('<strong>') === 1) {
setTitle();
}
function setTitle() {
$(self).find('strong').eq(0).addClass('li-title');
var strongClose = '</strong>';
if(content.indexOf(strongClose) + strongClose.length + 1 === content.indexOf('<code>')) {
$(self).find('code').eq(0).addClass('code-with-title');
}
}
});

Expand Down
4 changes: 2 additions & 2 deletions dist/js/main.min.js

Large diffs are not rendered by default.

30 changes: 15 additions & 15 deletions dist/js/main.unique.js

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion scripts/docbase.js
Original file line number Diff line number Diff line change
Expand Up @@ -345,10 +345,12 @@
$rootScope.$on('$routeChangeSuccess', function(newRoute, oldRoute) {
jWindow.on('docbase:ready', function() {
$anchorScroll();
$('.content').find('pre code').each(function() {
$('.content').find('pre code').each(function(i, block) {
$(this).addClass("prettyprint");
// hljs.highlightBlock(block);
});
prettyPrint();
// hljs.initHighlightingOnLoad();
});
});
};
Expand Down
16 changes: 13 additions & 3 deletions scripts/flatdoc-theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,19 @@

$('.content li').each(function() {
var content = JSON.stringify($(this).html());
console.log(content.indexOf('<strong>'));
if(content.indexOf('<strong>') === 1) {
$(this).find('strong').eq(0).addClass('li-title');
var self = this;
if(content.indexOf('<p>') === 1 && content.indexOf('<strong>') === 4) {
setTitle();
}
else if(content.indexOf('<strong>') === 1) {
setTitle();
}
function setTitle() {
$(self).find('strong').eq(0).addClass('li-title');
var strongClose = '</strong>';
if(content.indexOf(strongClose) + strongClose.length + 1 === content.indexOf('<code>')) {
$(self).find('code').eq(0).addClass('code-with-title');
}
}
});

Expand Down
13 changes: 10 additions & 3 deletions styles/docs.css
Original file line number Diff line number Diff line change
Expand Up @@ -327,14 +327,21 @@ body.no-literate .content pre > code {
background: #f8f8f8;
border: 0;
border-radius: 0;
font-size: 14px;
font-size: 16px;
letter-spacing: 0;
}
body.no-literate .content pre > code span {

}
.content li > strong.li-title, ul li > strong.li-title {
.content li > strong.li-title, ul li > strong.li-title, ul li > p > strong.li-title, strong.li-title {
height: 32px;
line-height: 32px;
margin-right: 20px;
font-weight: 600;
font-size: 20px;
color: #777;
}
.code-with-title {
margin: 0 15px;
}
.menu a, .menu a:visited {
color: #333;
Expand Down

0 comments on commit d0cfcbc

Please sign in to comment.