Skip to content

Commit

Permalink
better compact-boardlist.js integration
Browse files Browse the repository at this point in the history
  • Loading branch information
twiforce committed Jun 5, 2014
1 parent 5816ca5 commit a873d89
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 12 deletions.
32 changes: 21 additions & 11 deletions inc/display.php
Expand Up @@ -19,20 +19,24 @@ function format_bytes($size) {
return round($size, 2).$units[$i];
}

function doBoardListPart($list, $root) {
function doBoardListPart($list, $root, &$boards) {
global $config;

$body = '';
foreach ($list as $board) {
foreach ($list as $key => $board) {
if (is_array($board))
$body .= ' [' . doBoardListPart($board, $root) . '] ';
// $body .= ' <span class="sub">[' . doBoardListPart($board, $root) . ']</span> ';
$body .= ' <span class="sub" data-description="' . $key . '">[' . doBoardListPart($board, $root, $boards) . ']</span> ';
else {
if (($key = array_search($board, $list)) && gettype($key) == 'string') {
$body .= ' <a href="' . $board . '">' . $key . '</a> /';
} else {
$body .= ' <a href="' . $root . $board . '/' . $config['file_index'] . '">' . $board . '</a> /';
}
if (gettype($key) == 'string') {
$body .= ' <a href="' . $board . '">' . $key . '</a> /';
} else {
$title = '';
if (isset ($boards[$board])) {
$title = ' title="'.$boards[$board].'"';
}

$body .= ' <a href="' . $root . $board . '/' . $config['file_index'] . '"'.$title.'>' . $board . '</a> /';
}
}
}
$body = preg_replace('/\/$/', '', $body);
Expand All @@ -44,8 +48,14 @@ function createBoardlist($mod=false) {
global $config;

if (!isset($config['boards'])) return array('top'=>'','bottom'=>'');

$body = doBoardListPart($config['boards'], $mod?'?/':$config['root']);

$xboards = listBoards();
$boards = array();
foreach ($xboards as $val) {
$boards[$val['uri']] = $val['title'];
}

$body = doBoardListPart($config['boards'], $mod?'?/':$config['root'], $boards);
if ($config['boardlist_wrap_bracket'] && !preg_match('/\] $/', $body))
$body = '[' . $body . ']';

Expand Down
50 changes: 49 additions & 1 deletion stylesheets/style.css
Expand Up @@ -586,4 +586,52 @@ div.post.reply.closed p.fileinfo, div.post.reply.closed div.body, div.post.reply
}
.pace-inactive {
display: none;
}
}
html.desktop-style .boardlist:nth-child(1) {
position: fixed;
top: 0px;
left: 0px;
right: 0px;
/* text-shadow: white 1px 0px 6px, white 1px 0px 6px, black 1px 0px 3px; */
margin-top: 0px;
z-index: 30;
}
.desktop-style .boardlist:nth-child(1):hover, .desktop-style .boardlist:nth-child(1).cb-menu {
background-color: rgba(90%, 90%, 90%, 0.6);
}
.compact-boardlist {
padding: 3px;
padding-bottom: 0px;
}
.compact-boardlist .cb-item {
display: inline-block;
vertical-align: middle;
}
.compact-boardlist .cb-icon {
padding-bottom: 1px;
}
.compact-boardlist .cb-fa {
font-size: 21px;
padding: 2px;
padding-top: 0;
}
.compact-boardlist .cb-cat {
padding: 5px 6px 8px 6px;
}
.compact-boardlist #watch-pinned {
display: inline-block;
}
/* styles also used by watch.js */
.cb-menuitem {
display: table-row;
}
.cb-menuitem span {
padding: 5px;
display: table-cell;
text-align: left;
border-top: 1px solid rgba(0, 0, 0, 0.5);
}
.cb-menuitem span.cb-uri {
text-align: right;
padding-left: 0;
}

0 comments on commit a873d89

Please sign in to comment.