Re: A stunning theme required
Posted: Fri Jun 30, 2017 8:12 pm
I've just remember that i had prepare this some day ago, it is the starting code that work into the default install theme of phpBB 3.2, the prosilver theme. Resize the forum list on index, and the topics list of viewforum.
Provide a throttle to not overload the cpu on resize.
Into overall_footer.html after:
add:
Recompile template!
Provide a throttle to not overload the cpu on resize.
Into overall_footer.html after:
Code: Select all
<!-- IF S_PLUPLOAD --><!-- INCLUDE plupload.html --><!-- ENDIF -->
{$SCRIPTS}
Code: Select all
<script type="text/javascript">
function resizer() {
$('ul.topiclist.forums li.row dl.row-item').each(function () {
var dhsf = ($(this.childNodes[0].nextElementSibling.childNodes[3]).height());
if (null == dhsf){
var dhsf = ($(this.childNodes[1].childNodes[1]).height());
}
if (dhsf < 55){ dhsf = 55; } // the needed min height
$(this,'ul.topiclist.forums li.row dl').children().css({
height: dhsf + 'px',
'padding':'0px'
});
});
$('ul.topiclist.topics li.row dl.row-item').each(function () {
var dhsf = ($(this.childNodes[0].nextElementSibling.childNodes[3]).height());
if (null == dhsf){
var dhsf = ($(this.childNodes[1].childNodes[1]).height());
}
if (dhsf < 55){ dhsf = 55; } // the needed min height
$(this,'ul.topiclist.topics li.row dl').children().css({
height: dhsf + 'px',
'padding':'0px'
});
});
}
$( window ).load(function() {
$('ul.topiclist.forums li.row dl.row-item').each(function () {
$(this.childNodes[3]).wrapInner( "<table style=\"margin:0px;padding:0px;border-collapse:collapse;height:100%;width:100%\"><tbody><tr><td style=\"text-align:center;margin:0px;padding:0px;vertical-align:middle\"></td></tr></tbody></table>" );
$(this.childNodes[3,5]).wrapInner( "<table style=\"margin:0px;padding:0px;border-collapse:collapse;height:100%;width:100%\"><tbody><tr><td style=\"text-align:center;margin:0px;padding:0px;vertical-align:middle\"></td></tr></tbody></table>" );
$(this.childNodes[3,5,7]).wrapInner( "<table style=\"margin:0px;padding:0px;border-collapse:collapse;height:100%;width:100%\"><tbody><tr><td style=\"margin:0px;padding-left:6px;vertical-align:middle\"></td></tr></tbody></table>" );
});
$('ul.topiclist.topics li.row dl.row-item').each(function () {
$(this.childNodes[3]).wrapInner( "<table style=\"margin:0px;padding:0px;border-collapse:collapse;height:100%;width:100%\"><tbody><tr><td style=\"text-align:center;margin:0px;padding:0px;vertical-align:middle\"></td></tr></tbody></table>" );
$(this.childNodes[3,5]).wrapInner( "<table style=\"margin:0px;padding:0px;border-collapse:collapse;height:100%;width:100%\"><tbody><tr><td style=\"text-align:center;margin:0px;padding:0px;vertical-align:middle\"></td></tr></tbody></table>" );
$(this.childNodes[3,5,7]).wrapInner( "<table style=\"margin:0px;padding:0px;border-collapse:collapse;height:100%;width:100%\"><tbody><tr><td style=\"margin:0px;padding-left:6px;vertical-align:middle\"></td></tr></tbody></table>" );
});
resizer();
});
(function() {
window.addEventListener("resize", resizeThrottler, false);
var resizeTimeout;
function resizeThrottler() {
// ignore resize events as long as an actualResizeHandler execution is in the queue
if ( !resizeTimeout ) {
resizeTimeout = setTimeout(function() {
resizeTimeout = null;
actualResizeHandler();
// The actualResizeHandler will execute at a rate of 45fps
}, 198);
}
}
function actualResizeHandler() {
// handle the resize event
resizer();
}
}());
</script>