X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   'Big/small textarea' mod. (https://forum.x-cart.com/showthread.php?t=38380)

Ene 03-18-2008 03:17 AM

'Big/small textarea' mod.
 
If your product descriptions are big or contain a lot of HTML code, you may find it quite inconvenient to update the text and scroll it up/down.

The following mod will add two new links near each textarea, so you'll be able to increase the textarea's size dynamically.


1. Edit skin1/common.js file and add the following code:

PHP Code:

function changeCommentSize(id,d)
        {
            var 
el document.getElementById(id);
            var 
height parseInt(el.style.height);
            if(!
height && el.offsetHeight)
                
height el.offsetHeight;
            
height += d;
            if(
height 20)
                
height 20;
            
el.style.height height+"px";
        } 


2. Edit skin1/main/textarea.tpl template and replace:

PHP Code:

<div class="AELinkBox" style="width: 576px;">
<
a href="javascript: void(0);" style="display: none;" id="{$id}Dis" onclick="javascript: disableEditor('{$id}','{$name}', {$id}Editor);">{$lng.lbl_default_editor}</a


with:

PHP Code:

<div class="AELinkBox" style="width: 576px;">
<
a href="#" onClick="changeCommentSize('{$id}',80); return false;">Bigger</a> / <a href="#" onClick="changeCommentSize('{$id}',-80); return false;">Smaller</a> |
<
a href="javascript: void(0);" style="display: none;" id="{$id}Dis" onclick="javascript: disableEditor('{$id}','{$name}', {$id}Editor);">{$lng.lbl_default_editor}</a



That's all.


All times are GMT -8. The time now is 10:07 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.