html5iness

This commit is contained in:
Shish 2012-03-12 02:45:39 +00:00
parent dfd38b1b84
commit c6c4f06de8
7 changed files with 25 additions and 56 deletions

View file

@ -54,11 +54,11 @@ $(document).ready(function() {
var sidebar_hidden = ($.cookie("sidebar-hidden") || "").split("|");
for(var i in sidebar_hidden) {
$("#"+sidebar_hidden[i]).hide();
$("#"+sidebar_hidden[i]+" .blockbody").hide();
};
$(".shm-toggler").each(function(idx, elm) {
var tid = $(elm).data("toggle-id");
var tob = $("#"+tid);
var tob = $("#"+tid+" .blockbody");
$(elm).click(function(e) {
tob.slideToggle("slow");
if(sidebar_hidden.indexOf(tid) == -1) {

View file

@ -238,19 +238,19 @@ EOD;
$h = $block->header;
$s = $block->section;
$b = $block->body;
$html = "";
$i = str_replace(' ', '_', $h.$s);
$html = "<section id='$i'>";
if($hidable) {
$i = str_replace(' ', '_', $h.$s);
if(!is_null($h)) $html .= "\n<h3 class='shm-toggler' data-toggle-id='$i'>$h</h3>\n";
if(!is_null($b)) $html .= "<div id='$i'>$b</div>\n";
}
else {
$i = str_replace(' ', '_', $h.$s);
if(!is_null($h)) $html .= "\n<h3>$h</h3>\n";
if(!is_null($b)) $html .= "<div>$b</div>\n";
}
if(!is_null($b)) $html .= "<div class='blockbody'>$b</div>\n";
$html .= "</section>";
return $html;
}
private function navlinks($link, $desc, $pages_matched) {
/**
* Woo! We can actually SEE THE CURRENT PAGE!! (well... see it highlighted in the menu.)

View file

@ -92,21 +92,12 @@ EOD;
private function block_to_html($block, $hidable=false, $salt="") {
$h = $block->header;
$b = $block->body;
$html = "";
$i = str_replace(' ', '_', $h) . $salt;
$html = "<section id='$i'>";
$h_toggler = $hidable ? " shm-toggler" : "";
if(!is_null($h)) $html .= "
<h3 data-toggle-id='$i' class='hrr$h_toggler'>$h</h3>
";
if(!is_null($b)) {
if(strpos($b, "<!-- cancel border -->") === FALSE) {
$html .= "<div class='blockbody brr' id='$i'>$b</div>";
}
else {
$html .= "<div class='blockbody' id='$i'>$b</div>";
}
}
if(!is_null($h)) $html .= "<h3 data-toggle-id='$i' class='$h_toggler'>$h</h3>";
if(!is_null($b)) $html .= "<div class='blockbody'>$b</div>";
$html .= "</section>";
return $html;
}
}

View file

@ -21,15 +21,15 @@ H3 {
text-align: center;
margin: 0px;
}
.hrr {
SECTION>H3 {
background: #CCC;
border: 1px solid #BBB;
}
.brr, .thumb {
SECTION>.blockbody, .thumb {
background: #DDD;
border: 1px solid #CCC;
}
.brr, .hrr, H1, FOOTER, .thumb {
SECTION>.blockbody, SECTION>H3, H1, FOOTER, .thumb {
margin: 8px;
padding: 8px;
border-radius: 12px; /* standard, webkit, opera */
@ -103,9 +103,6 @@ NAV .blockbody {
NAV TABLE {
width: 100%;
}
NAV TD {
vertical-align: middle;
}
NAV INPUT {
width: 100%;
padding: 0px;

View file

@ -97,10 +97,11 @@ EOD;
function block_to_html($block, $hidable=false, $salt="") {
$h = $block->header;
$b = $block->body;
$html = "";
$i = str_replace(' ', '_', $h) . $salt;
$html = "<section id='$i'>";
if(!is_null($h)) $html .= "\n<h3 data-toggle-id='$i' class='shm-toggler'>$h</h3>\n";
if(!is_null($b)) $html .= "<div id='$i'>$b</div>\n";
if(!is_null($b)) $html .= "<div class='blockbody'>$b</div>\n";
$html .= "</section>";
return $html;
}
}

View file

@ -200,8 +200,8 @@ EOD;
private function block_to_html($block, $hidable=false, $salt="") {
$h = $block->header;
$b = $block->body;
$html = "";
$i = str_replace(' ', '_', $h) . $salt;
$html = "<section id='$i'>";
if(!is_null($h)) {
if($salt == "main") {
$html .= "<div class='maintop navside tab shm-toggler' data-toggle-id='$i'>$h</div>";
@ -210,17 +210,16 @@ EOD;
}
}
if(!is_null($b)) {
//if(strpos($b, "<!-- cancel border -->")) {
if($salt =="main") {
$html .= "<div class='blockbody' id='$i'>$b</div>";
$html .= "<div class='blockbody'>$b</div>";
}
else {
$html .= "
<div class='navside tab' id='$i'>$b</div>
<div class='navside tab'>$b</div>
";
}
}
$html .= "</section>";
return $html;
}

View file

@ -106,30 +106,11 @@ EOD;
private function block_to_html($block, $hidable=false, $salt="") {
$h = $block->header;
$b = $block->body;
$html = "";
$i = str_replace(' ', '_', $h) . $salt;
if(!is_null($h)) $html .= "
<div class='hrr' data-toggle-id='$i' class='shm-toggler'>
<div class='hrrtop'><div></div></div>
<div class='hrrcontent'><h3>$h</h3></div>
<div class='hrrbot'><div></div></div>
</div>
";
if(!is_null($b)) {
if(strpos($b, "<!-- cancel border -->")) {
$html .= "<div class='blockbody' id='$i'>$b</div>";
}
else {
$html .= "
<div class='rr' id='$i'>
<div class='rrtop'><div></div></div>
<div class='rrcontent'><div class='blockbody'>$b</div></div>
<div class='rrbot'><div></div></div>
</div>
";
}
}
$html = "<section id='$i'>";
if(!is_null($h)) $html .= "<h3 data-toggle-id='$i' class='shm-toggler'>$h</h3>";
if(!is_null($b)) $html .= "<div class='blockbody'>$b</div>";
$html .= "</section>";
return $html;
}
}