Post by Wintershot » Thu Oct 18, 2012 7:47 pm

I thought I would post a quick hack for adding row highlighting to the lists in the backend sections. I found it really annoying, especially on wider screen resolutions, to match up the [edit] buttons with the names.

1. Navigate to /admin/view/template/common/ with a file manager or ftp client.
2. Open "header.tpl" for editting.
3. You will find the following lines of code near the top of the file.

Code: Select all

<script type="text/javascript">
//-----------------------------------------
// Confirm Actions (delete, uninstall)
//-----------------------------------------
$(document).ready(function(){
    // Confirm Delete
    $('#form').submit(function(){
        if ($(this).attr('action').indexOf('delete',1) != -1) {
            if (!confirm('<?php echo $text_confirm; ?>')) {
                return false;
            }
        }
    });
    	
    // Confirm Uninstall
    $('a').click(function(){
        if ($(this).attr('href') != null && $(this).attr('href').indexOf('uninstall', 1) != -1) {
            if (!confirm('<?php echo $text_confirm; ?>')) {
                return false;
            }
        }
    });
});
</script>
4. Replace those lines with the following lines.

Code: Select all

<script type="text/javascript">
//-----------------------------------------
// Confirm Actions (delete, uninstall)
//-----------------------------------------
$(document).ready(function(){
    // Confirm Delete
    $('#form').submit(function(){
        if ($(this).attr('action').indexOf('delete',1) != -1) {
            if (!confirm('<?php echo $text_confirm; ?>')) {
                return false;
            }
        }
    });
    	
    // Confirm Uninstall
    $('a').click(function(){
        if ($(this).attr('href') != null && $(this).attr('href').indexOf('uninstall', 1) != -1) {
            if (!confirm('<?php echo $text_confirm; ?>')) {
                return false;
            }
        }
    });
	
var tableList = document.getElementsByTagName('table');
for (var i=0,x=tableList.length; i<x; i++) {
	if (tableList[i].className == 'list') {
		var trList = tableList[i].getElementsByTagName('tr');
		for (var a=0,y=trList.length; a<y; a++) {
			trList[a].onmouseover = function() { trHigh(this,'#f3f3f3') }
			trList[a].onmouseout = function() { trHigh(this,'#ffffff') }
		}
	}
}

function trHigh(thisTR,clr) {
	var tdList = thisTR.getElementsByTagName('td');
	for (var i=0,x=tdList.length; i<x; i++) {
		tdList[i].style.backgroundColor = clr;
	}
}
	
});
</script>
You should now see all of the rows within the backend highlighting.
As I mentioned in title, this was a very dirty/lazy hack.
Last edited by Wintershot on Thu Jul 16, 2015 9:20 pm, edited 3 times in total.

Newbie

Posts

Joined
Thu Oct 18, 2012 7:40 pm

Post by HoodLaces » Wed Nov 14, 2012 9:22 am

Awesome job on this, thank you!

User avatar
Newbie

Posts

Joined
Fri Jul 13, 2012 1:45 am

Post by Wintershot » Fri Mar 27, 2015 8:02 pm

Posted in error.

Newbie

Posts

Joined
Thu Oct 18, 2012 7:40 pm
Who is online

Users browsing this forum: No registered users and 3 guests