Skip to content

Commit

Permalink
Merge pull request #165 from Spuds/htmlCleanup
Browse files Browse the repository at this point in the history
Html cleanup
  • Loading branch information
norv committed Feb 25, 2013
2 parents eeb047f + 9c95ecf commit 97d1490
Show file tree
Hide file tree
Showing 30 changed files with 508 additions and 704 deletions.
152 changes: 76 additions & 76 deletions themes/default/Admin.template.php

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion themes/default/BadBehavior.template.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function template_badbehavior_log()
', $context['page_index'], '
</div>
</div>
<table border="0" cellspacing="1" class="table_grid" id="error_log">';
<table class="table_grid" id="error_log">';

if ($context['has_filter'])
echo '
Expand Down
2 changes: 1 addition & 1 deletion themes/default/BoardIndex.template.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function template_main()
<div id="newsfader">
<div class="cat_bar">
<h3 class="catbg">
<img id="newsupshrink" src="', $settings['images_url'], '/collapse.png" alt="*" title="', $txt['hide'], '" align="bottom" style="display: none;" />
<img id="newsupshrink" src="', $settings['images_url'], '/collapse.png" alt="*" title="', $txt['hide'], '" style="display: none;vertical-align: bottom" />
', $txt['news'], '
</h3>
</div>
Expand Down
293 changes: 0 additions & 293 deletions themes/default/Calendar.template.php
Original file line number Diff line number Diff line change
Expand Up @@ -485,297 +485,4 @@ function template_show_week_grid($grid_name)
echo '
</ul>';
}
}

function template_bcd()
{
global $context, $scripturl;

echo '
<table cellpadding="0" cellspacing="1" align="center">
<caption class="titlebg">BCD Clock</caption>
<tr class="windowbg">';

$alt = false;
foreach ($context['clockicons'] as $t => $v)
{
echo '
<td style="padding-', $alt ? 'right' : 'left', ': 1.5em;" valign="bottom">';

foreach ($v as $i)
echo '
<img src="', $context['offimg'], '" alt="" id="', $t, '_', $i, '" /><br />';

echo '
</td>';

$alt = !$alt;
}

echo '
</tr>
</table>
<p align="center"><a href="', $scripturl, '?action=clock;rb">Are you hardcore?</a></p>
<script type="text/javascript"><!-- // --><![CDATA[
var icons = new Object();';

foreach ($context['clockicons'] as $t => $v)
{
foreach ($v as $i)
echo '
icons[\'', $t, '_', $i, '\'] = document.getElementById(\'', $t, '_', $i, '\');';
}

echo '
function update()
{
// Get the current time
var time = new Date();
var hour = time.getHours();
var min = time.getMinutes();
var sec = time.getSeconds();
// Break it up into individual digits
var h1 = parseInt(hour / 10);
var h2 = hour % 10;
var m1 = parseInt(min / 10);
var m2 = min % 10;
var s1 = parseInt(sec / 10);
var s2 = sec % 10;
// For each digit figure out which ones to turn off and which ones to turn on
var turnon = new Array();';

foreach ($context['clockicons'] as $t => $v)
{
foreach ($v as $i)
echo '
if (', $t, ' >= ', $i, ')
{
turnon.push("', $t, '_', $i, '");
', $t, ' -= ', $i, ';
}';
}

echo '
for (var i in icons)
if (!in_array(i, turnon))
icons[i].src = "', $context['offimg'], '";
else
icons[i].src = "', $context['onimg'], '";
window.setTimeout("update();", 500);
}
// Checks for variable in theArray.
function in_array(variable, theArray)
{
for (var i = 0; i < theArray.length; i++)
{
if (theArray[i] == variable)
return true;
}
return false;
}
update();
// ]]></script>';
}

function template_hms()
{
global $context, $scripturl;

echo '
<table cellpadding="0" cellspacing="1" align="center">
<caption class="titlebg">Binary Clock</caption>';
$alt = false;
foreach ($context['clockicons'] as $t => $v)
{
echo '
<tr class="', $alt ? 'windowbg2' : 'windowbg', '">
<td align="right">';
foreach ($v as $i)
echo '
<img src="', $context['offimg'], '" alt="" id="', $t, '_', $i, '" />';
echo '
</td>';
$alt = !$alt;
}

echo '
</tr>
<tr class="', $alt ? 'windowbg2' : 'windowbg', '"><td colspan="6" align="center"><a href="', $scripturl, '?action=clock">Too tough for you?</a></td></tr>
</table>';

echo '
<script type="text/javascript"><!-- // --><![CDATA[
var icons = new Object();';

foreach ($context['clockicons'] as $t => $v)
{
foreach ($v as $i)
echo '
icons[\'', $t, '_', $i, '\'] = document.getElementById(\'', $t, '_', $i, '\');';
}

echo '
function update()
{
// Get the current time
var time = new Date();
var h = time.getHours();
var m = time.getMinutes();
var s = time.getSeconds();
// For each digit figure out which ones to turn off and which ones to turn on
var turnon = new Array();';

foreach ($context['clockicons'] as $t => $v)
{
foreach ($v as $i)
echo '
if (', $t, ' >= ', $i, ')
{
turnon.push("', $t, '_', $i, '");
', $t, ' -= ', $i, ';
}';
}

echo '
for (var i in icons)
if (!in_array(i, turnon))
icons[i].src = "', $context['offimg'], '";
else
icons[i].src = "', $context['onimg'], '";
window.setTimeout("update();", 500);
}
// Checks for variable in theArray.
function in_array(variable, theArray)
{
for (var i = 0; i < theArray.length; i++)
{
if (theArray[i] == variable)
return true;
}
return false;
}
update();
// ]]></script>';
}

function template_omfg()
{
global $context, $scripturl;

echo '
<table cellpadding="0" cellspacing="1" align="center">
<caption class="titlebg">OMFG Binary Clock</caption>';
$alt = false;
foreach ($context['clockicons'] as $t => $v)
{
echo '
<tr class="', $alt ? 'windowbg2' : 'windowbg', '">
<td align="right">';
foreach ($v as $i)
echo '
<img src="', $context['offimg'], '" alt="" id="', $t, '_', $i, '" />';
echo '
</td>';
$alt = !$alt;
}

echo '
</tr>
</table>';

echo '
<script type="text/javascript"><!-- // --><![CDATA[
var icons = new Object();';

foreach ($context['clockicons'] as $t => $v)
{
foreach ($v as $i)
echo '
icons[\'', $t, '_', $i, '\'] = document.getElementById(\'', $t, '_', $i, '\');';
}

echo '
function update()
{
// Get the current time
var time = new Date();
var month = time.getMonth() + 1;
var day = time.getDate();
var year = time.getFullYear();
year = year % 100;
var hour = time.getHours();
var min = time.getMinutes();
var sec = time.getSeconds();
// For each digit figure out which ones to turn off and which ones to turn on
var turnon = new Array();';

foreach ($context['clockicons'] as $t => $v)
{
foreach ($v as $i)
echo '
if (', $t, ' >= ', $i, ')
{
turnon.push("', $t, '_', $i, '");
', $t, ' -= ', $i, ';
}';
}

echo '
for (var i in icons)
if (!in_array(i, turnon))
icons[i].src = "', $context['offimg'], '";
else
icons[i].src = "', $context['onimg'], '";
window.setTimeout("update();", 500);
}
// Checks for variable in theArray.
function in_array(variable, theArray)
{
for (var i = 0; i < theArray.length; i++)
{
if (theArray[i] == variable)
return true;
}
return false;
}
update();
// ]]></script>';
}

function template_thetime()
{
global $context, $scripturl;

echo '
<table class="table_collapse" border="1" align="center">
<caption>The time you requested</caption>';
$alt = false;
foreach ($context['clockicons'] as $t => $v)
{
echo '
<tr class="', $alt ? 'windowbg2' : 'windowbg', '">
<td align="right">';
foreach ($v as $i)
echo '
<img src="', $i ? $context['onimg'] : $context['offimg'], '" alt="" />';
echo '
</td>';
$alt = !$alt;
}

echo '
</tr>
</table>';

}
4 changes: 2 additions & 2 deletions themes/default/Errors.template.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ function template_error_log()
', $context['page_index'], '
</div>
</div>
<table border="0" cellspacing="1" class="table_grid" id="error_log">
<table class="table_grid" id="error_log">
<tr>
<td colspan="3" class="windowbg">
&nbsp;&nbsp;', $txt['apply_filter_of_type'], ':';
Expand Down Expand Up @@ -203,7 +203,7 @@ function template_show_file()
$is_target = $line_num == $context['file_data']['target'];
echo '
<tr>
<td align="right"', $is_target ? ' class="current">==&gt;' : '>', $line_num , ':</td>
<td', $is_target ? ' class="righttext current">==&gt;' : '>', $line_num , ':</td>
<td style="white-space: nowrap;', $is_target ? ' border: 1px solid black;border-width: 1px 1px 1px 0;':'','">', $line, '</td>
</tr>';
}
Expand Down
12 changes: 6 additions & 6 deletions themes/default/GenericList.template.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ function template_show_list($list_id = null)
}

echo '
<table class="table_grid" width="', !empty($cur_list['width']) ? $cur_list['width'] : '100%', '">';
<table class="table_grid" style="width:', !empty($cur_list['width']) ? $cur_list['width'] : '100%', '">';

// Show the column headers.
$header_count = count($cur_list['headers']);
Expand Down Expand Up @@ -112,7 +112,7 @@ function template_show_list($list_id = null)
if (empty($cur_list['rows']) && !empty($cur_list['no_items_label']))
echo '
<tr>
<td class="windowbg" colspan="', $cur_list['num_columns'], '" align="', !empty($cur_list['no_items_align']) ? $cur_list['no_items_align'] : 'center', '"><div class="padding">', $cur_list['no_items_label'], '</div></td>
<td class="windowbg" colspan="', $cur_list['num_columns'], '" style="text-align:', !empty($cur_list['no_items_align']) ? $cur_list['no_items_align'] : 'center', '"><div class="padding">', $cur_list['no_items_label'], '</div></td>
</tr>';

// Show the list rows.
Expand Down Expand Up @@ -240,7 +240,7 @@ function template_create_list_menu($list_menu, $direction = 'top')
<table class="table_collapse" style="margin-', $list_menu['position'], ': 10px; width: 100%;">
<tr>', $list_menu['position'] == 'right' ? '
<td>&nbsp;</td>' : '', '
<td align="', $list_menu['position'], '">
<td style="text-align:', $list_menu['position'], '">
<table class="table_collapse">
<tr>
<td class="', $direction == 'top' ? 'mirror' : 'main', 'tab_', $first, '">&nbsp;</td>';
Expand All @@ -250,13 +250,13 @@ function template_create_list_menu($list_menu, $direction = 'top')
if ($link['is_selected'])
echo '
<td class="', $direction == 'top' ? 'mirror' : 'main', 'tab_active_', $first, '">&nbsp;</td>
<td valign="top" class="', $direction == 'top' ? 'mirrortab' : 'maintab', '_active_back">
<td style="vertical-align:top" class="', $direction == 'top' ? 'mirrortab' : 'maintab', '_active_back">
<a href="', $link['href'], '">', $link['label'], '</a>
</td>
<td class="', $direction == 'top' ? 'mirror' : 'main', 'tab_active_', $last, '">&nbsp;</td>';
else
echo '
<td valign="top" class="', $direction == 'top' ? 'mirror' : 'main', 'tab_back">
<td style="vertical-align:top" class="', $direction == 'top' ? 'mirror' : 'main', 'tab_back">
<a href="', $link['href'], '">', $link['label'], '</a>
</td>';
}
Expand All @@ -280,7 +280,7 @@ function template_create_list_menu($list_menu, $direction = 'top')
<table class="table_collapse" style="margin-', $list_menu['position'], ': 10px; width: 100%;">
<tr>', $list_menu['position'] == 'right' ? '
<td>&nbsp;</td>' : '', '
<td align="', $list_menu['position'], '">
<td style="text-align:', $list_menu['position'], '">
<table class="table_collapse">
<tr>
<td class="', $direction == 'top' ? 'mirror' : 'main', 'tab_', $first, '">&nbsp;</td>
Expand Down

0 comments on commit 97d1490

Please sign in to comment.