File: quoteBlocks.js

package info (click to toggle)
horde3 3.1.3-4etch7
  • links: PTS
  • area: main
  • in suites: etch
  • size: 22,876 kB
  • ctags: 18,071
  • sloc: php: 75,151; xml: 2,979; sql: 1,069; makefile: 79; sh: 64
file content (29 lines) | stat: -rw-r--r-- 894 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/**
 * $Horde: horde/templates/javascript/quoteBlocks.js,v 1.5 2004/08/26 00:07:29 slusarz Exp $
 *
 * @package Horde
 */
function toggleQuoteBlock(id, lines)
{
    var block = new Horde_Hideable('qb_' + id);

    block.toggle();
    text = document.createTextNode(block.shown() ?
                                   '<?php echo _("[Hide Quoted Text]") ?>' :
                                   '<?php echo _("[Show Quoted Text -") ?> ' + lines + ' <?php echo _("lines]") ?>');
    link = document.createElement('A');
    link.href = '';
    link.className = 'widget';
    link.style.fontSize = '70%';
    link.onclick = function() {
        toggleQuoteBlock(id, lines);
        return false;
    }
    link.appendChild(text);

    var toggle = document.getElementById('qt_' + id);
    if (toggle.firstChild) {
        toggle.removeChild(toggle.firstChild);
    }
    toggle.appendChild(link);
}