[ Index ] |
|
Code source de Horde 3.1.3 |
1 /** 2 * Horde Html Helper Javascript Class 3 * 4 * Provides the javascript class insert html tags by clicking on icons. 5 * 6 * The helpers available: 7 * emoticons - for inserting emoticons strings 8 * 9 * $Horde: horde/templates/javascript/open_html_helper.js,v 1.12.2.5 2006/05/11 19:49:14 chuck Exp $ 10 * 11 * Copyright 2003-2006 Marko Djukic <marko@oblo.com> 12 * 13 * See the enclosed file COPYING for license information (GPL). If you did not 14 * receive this file, see http://www.fsf.org/copyleft/gpl.html. 15 * 16 * @author Marko Djukic <marko@oblo.com> 17 * @package horde 18 * @todo add handling for font tags, tables, etc. 19 */ 20 21 var targetElement; 22 23 function openHtmlHelper(type, target) 24 { 25 var lay = document.getElementById('htmlhelper_' + target); 26 targetElement = document.getElementById(target); 27 28 if (lay.style.display == 'block') { 29 lay.style.display = 'none'; 30 return false; 31 } 32 33 if (lay.firstChild) { 34 lay.removeChild(lay.firstChild); 35 } 36 37 var table = document.createElement('TABLE'); 38 var tbody = document.createElement('TBODY'); 39 table.appendChild(tbody); 40 table.cellSpacing = 0; 41 table.border = 0; 42 43 if (type == 'emoticons') { 44 row = document.createElement('TR'); 45 cell = document.createElement('TD'); 46 <?php require_once 'Horde/Text/Filter.php'; $filter = Text_Filter::factory('emoticons'); $icons = array_flip($filter->getIcons()); foreach ($icons as $icon => $string): ?> 47 link = document.createElement('A'); 48 link.href = '#'; 49 link.onclick = function() { 50 targetElement.value = targetElement.value + '<?php echo $string ?>' + ' '; 51 return false; 52 } 53 cell.appendChild(link); 54 img = document.createElement('IMG') 55 img.src = '<?php echo $GLOBALS['registry']->getImageDir('horde') . '/emoticons/' . $icon . '.png' ?>'; 56 img.align = 'middle'; 57 img.border = 0; 58 link.appendChild(img); 59 <?php endforeach; ?> 60 row.appendChild(cell); 61 tbody.appendChild(row); 62 table.appendChild(tbody); 63 } 64 65 lay.appendChild(table); 66 lay.style.display = 'block'; 67 }
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Sun Feb 25 18:01:28 2007 | par Balluche grâce à PHPXref 0.7 |