Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

'Big/small textarea' mod.

 
Reply
   X-Cart forums > X-Cart 4 > Changing and adding new features
 
Thread Tools Search this Thread
  #1  
Old 03-18-2008, 03:17 AM
  Ene's Avatar 
Ene Ene is offline
 

X-Cart team
  
Join Date: Aug 2004
Posts: 907
 

Default '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.
__________________
Eugene Kaznacheev,
Evangelist/Product Manager at Ecwid: http://www.ecwid.com/ (since Sept 2009)

ex-Head of X-Cart Tech Support Department
ex- X-Cart Hosting Manager - X-Cart hosting
ex-X-Cart Technical Support Engineer


Note: For the official guaranteed tech support services please turn to the Customers HelpDesk.
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Changing and adding new features


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 08:45 AM.

   

 
X-Cart forums © 2001-2020