Support for smileys
|
|
@ -49,6 +49,7 @@ this.toolbar = [
|
|||
['forecolor','backcolor','separator'],
|
||||
['HorizontalRule','Createlink','InsertImage','InsertTable','htmlmode','separator'],
|
||||
['Macros','separator'],
|
||||
['Smileys','separator'],
|
||||
|
||||
// ['custom1','custom2','custom3','separator'],
|
||||
['popupeditor']]; //,'about']];
|
||||
|
|
@ -83,6 +84,7 @@ this.fontstyles = [ // make sure these exist in the header of page the conte
|
|||
|
||||
this.btnList = {
|
||||
// buttonName: commandID, title, onclick, image,
|
||||
"smileys": ['Smileys', 'Insert Smiley', 'editor_action(this.id)', 'ed_smiley.gif'],
|
||||
"bold": ['Bold', 'Bold', 'editor_action(this.id)', 'ed_format_bold.gif'],
|
||||
"italic": ['Italic', 'Italic', 'editor_action(this.id)', 'ed_format_italic.gif'],
|
||||
"underline": ['Underline', 'Underline', 'editor_action(this.id)', 'ed_format_underline.gif'],
|
||||
|
|
@ -309,6 +311,14 @@ function editor_action(button_id) {
|
|||
//
|
||||
// CUSTOM BUTTONS START HERE
|
||||
//
|
||||
// Insert a smiley
|
||||
else if (cmdID == 'Smileys') { // insert some text from a popup window
|
||||
var myTitle = "Insert a Smiley";
|
||||
var myText = showModalDialog(_editor_url + "popups/insert_smiley.pl",
|
||||
myTitle, // str or obj specified here can be read from dialog as "window.dialogArguments"
|
||||
"resizable: yes; help: no; status: no; scroll: yes; ");
|
||||
if (myText) { editor_insertHTML(objname, myText); }
|
||||
}
|
||||
|
||||
// Custom1
|
||||
else if (cmdID == 'custom1') {
|
||||
|
|
|
|||
BIN
www/extras/htmlArea/images/ed_smiley.gif
Normal file
|
After Width: | Height: | Size: 135 B |
76
www/extras/htmlArea/popups/insert_smiley.pl
Executable file
|
|
@ -0,0 +1,76 @@
|
|||
#!/usr/bin/perl -w
|
||||
|
||||
use strict;
|
||||
|
||||
my ($httpSmileysPath, $fileSmileysPath, @smileys, $smile, $pos, $columns);
|
||||
|
||||
# $fileSmileysPath = '/home/WebGUI/www/extras/smileys'; # Define this if you're having problems determinating
|
||||
# the path to the smileys dir automaticcally.
|
||||
|
||||
$httpSmileysPath = "/extras/smileys"; # Web path to the smileys dir
|
||||
$columns = 3; # Smileys column width
|
||||
|
||||
# ------------------------------------------------------------------------------------------
|
||||
|
||||
if(defined($ENV{SCRIPT_FILENAME}) && $fileSmileysPath eq '') {
|
||||
$fileSmileysPath = $ENV{SCRIPT_FILENAME};
|
||||
$fileSmileysPath =~ s#(/[^/]+){3}$##; # Two dirs up from this script level
|
||||
$fileSmileysPath .= "/smileys";
|
||||
}
|
||||
|
||||
print <<EOM;
|
||||
<!-- Content-type: text/html //-->
|
||||
|
||||
<html style="width:200px; Height: 200px;">
|
||||
<head>
|
||||
<title>Insert Smileys</title>
|
||||
<style>
|
||||
html, body, button, div, input, select, fieldset { font-family: MS Shell Dlg; font-size: 8pt; };
|
||||
</style>
|
||||
|
||||
<script language="javascript">
|
||||
function insertSmiley() {
|
||||
var img = window.event.srcElement;
|
||||
if (img) {
|
||||
var src = img.src.replace(/^[a-z]*:[/][/][^/]*/, "");
|
||||
window.returnValue = '<IMG border=0 align=absmiddle src=' + src + '>';
|
||||
window.close();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<script language='JavaScript' type='text/javascript'>
|
||||
function cancel() {
|
||||
window.returnValue = null;
|
||||
window.close();
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body bgcolor="#D6D3CE" topmargin=15 leftmargin=10>
|
||||
<div align="center">
|
||||
<FIELDSET style="width:80%">
|
||||
<LEGEND>Choose a smiley to insert</LEGEND>
|
||||
<br><table align="center" border="0" cellpadding="4" cellspacing="0">
|
||||
<tr>
|
||||
EOM
|
||||
|
||||
opendir(DIR,$fileSmileysPath) or die "Couldn't open $fileSmileysPath\n";
|
||||
@smileys = readdir(DIR);
|
||||
closedir(DIR);
|
||||
$pos = 0;
|
||||
foreach $smile (@smileys)
|
||||
{
|
||||
chomp($smile);
|
||||
next if ($smile !~ /gif$|jpg$|jpeg$|bmp$/);
|
||||
if ($pos++ >= $columns) {
|
||||
print "</tr><tr>\n";
|
||||
$pos = 1;
|
||||
}
|
||||
|
||||
print '<td valign="top" align="center"><IMG onclick='."'insertSmiley()'".' border=0 src="'.$httpSmileysPath.'/'.$smile.'"></td>'."\n";
|
||||
|
||||
}
|
||||
print "</tr></table></FIELDSET></div></body></html>";
|
||||
|
||||
|
||||
BIN
www/extras/smileys/smile01.gif
Normal file
|
After Width: | Height: | Size: 272 B |
BIN
www/extras/smileys/smile02.gif
Normal file
|
After Width: | Height: | Size: 260 B |
BIN
www/extras/smileys/smile03.gif
Normal file
|
After Width: | Height: | Size: 862 B |
BIN
www/extras/smileys/smile04.gif
Normal file
|
After Width: | Height: | Size: 282 B |
BIN
www/extras/smileys/smile05.gif
Normal file
|
After Width: | Height: | Size: 791 B |
BIN
www/extras/smileys/smile06.gif
Normal file
|
After Width: | Height: | Size: 304 B |
BIN
www/extras/smileys/smile07.gif
Normal file
|
After Width: | Height: | Size: 1.6 KiB |
BIN
www/extras/smileys/smile08.gif
Normal file
|
After Width: | Height: | Size: 266 B |
BIN
www/extras/smileys/smile09.gif
Normal file
|
After Width: | Height: | Size: 293 B |
BIN
www/extras/smileys/smile10.gif
Normal file
|
After Width: | Height: | Size: 884 B |
BIN
www/extras/smileys/smile11.gif
Normal file
|
After Width: | Height: | Size: 276 B |
BIN
www/extras/smileys/smile12.gif
Normal file
|
After Width: | Height: | Size: 268 B |
BIN
www/extras/smileys/smile13.gif
Normal file
|
After Width: | Height: | Size: 193 B |
BIN
www/extras/smileys/smile14.gif
Normal file
|
After Width: | Height: | Size: 265 B |
BIN
www/extras/smileys/smile15.gif
Normal file
|
After Width: | Height: | Size: 974 B |
BIN
www/extras/smileys/smile16.gif
Normal file
|
After Width: | Height: | Size: 275 B |
BIN
www/extras/smileys/smile17.gif
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
BIN
www/extras/smileys/smile18.gif
Normal file
|
After Width: | Height: | Size: 496 B |
BIN
www/extras/smileys/smile19.gif
Normal file
|
After Width: | Height: | Size: 262 B |
BIN
www/extras/smileys/smile20.gif
Normal file
|
After Width: | Height: | Size: 433 B |
BIN
www/extras/smileys/smile21.gif
Normal file
|
After Width: | Height: | Size: 300 B |
BIN
www/extras/smileys/smile22.gif
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
BIN
www/extras/smileys/smile23.gif
Normal file
|
After Width: | Height: | Size: 283 B |
BIN
www/extras/smileys/smile24.gif
Normal file
|
After Width: | Height: | Size: 287 B |
BIN
www/extras/smileys/smile25.gif
Normal file
|
After Width: | Height: | Size: 626 B |
BIN
www/extras/smileys/smile26.gif
Normal file
|
After Width: | Height: | Size: 155 B |
BIN
www/extras/smileys/smile27.gif
Normal file
|
After Width: | Height: | Size: 200 B |
BIN
www/extras/smileys/smile28.gif
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
www/extras/smileys/smile29.gif
Normal file
|
After Width: | Height: | Size: 217 B |
BIN
www/extras/smileys/smile30.gif
Normal file
|
After Width: | Height: | Size: 407 B |
BIN
www/extras/smileys/smile31.gif
Normal file
|
After Width: | Height: | Size: 343 B |
BIN
www/extras/smileys/smile32.gif
Normal file
|
After Width: | Height: | Size: 452 B |
BIN
www/extras/smileys/smile33.gif
Normal file
|
After Width: | Height: | Size: 674 B |
BIN
www/extras/smileys/smile34.gif
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
www/extras/smileys/smile35.gif
Normal file
|
After Width: | Height: | Size: 796 B |
BIN
www/extras/smileys/smile36.gif
Normal file
|
After Width: | Height: | Size: 159 B |
BIN
www/extras/smileys/smile37.gif
Normal file
|
After Width: | Height: | Size: 289 B |
BIN
www/extras/smileys/smile38.gif
Normal file
|
After Width: | Height: | Size: 256 B |
BIN
www/extras/smileys/smile39.gif
Normal file
|
After Width: | Height: | Size: 274 B |
BIN
www/extras/smileys/smile40.gif
Normal file
|
After Width: | Height: | Size: 186 B |
BIN
www/extras/smileys/smile41.gif
Normal file
|
After Width: | Height: | Size: 236 B |
BIN
www/extras/smileys/smile42.gif
Normal file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
www/extras/smileys/smile43.gif
Normal file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
www/extras/smileys/smile44.gif
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
www/extras/smileys/smile45.gif
Normal file
|
After Width: | Height: | Size: 185 B |
BIN
www/extras/smileys/smile46.gif
Normal file
|
After Width: | Height: | Size: 911 B |
BIN
www/extras/smileys/smile47.gif
Normal file
|
After Width: | Height: | Size: 183 B |
BIN
www/extras/smileys/smile48.gif
Normal file
|
After Width: | Height: | Size: 2 KiB |
BIN
www/extras/smileys/smile49.gif
Normal file
|
After Width: | Height: | Size: 240 B |
BIN
www/extras/smileys/smile50.gif
Normal file
|
After Width: | Height: | Size: 281 B |
BIN
www/extras/smileys/smile51.gif
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
BIN
www/extras/smileys/smile52.gif
Normal file
|
After Width: | Height: | Size: 458 B |
BIN
www/extras/smileys/smile53.gif
Normal file
|
After Width: | Height: | Size: 959 B |
BIN
www/extras/smileys/smile54.gif
Normal file
|
After Width: | Height: | Size: 2.3 KiB |
BIN
www/extras/smileys/smile55.gif
Normal file
|
After Width: | Height: | Size: 453 B |
BIN
www/extras/smileys/smile56.gif
Normal file
|
After Width: | Height: | Size: 5.3 KiB |
BIN
www/extras/smileys/smile57.gif
Normal file
|
After Width: | Height: | Size: 296 B |
BIN
www/extras/smileys/smile58.gif
Normal file
|
After Width: | Height: | Size: 2.1 KiB |
BIN
www/extras/smileys/smile59.gif
Normal file
|
After Width: | Height: | Size: 2.7 KiB |
BIN
www/extras/smileys/smile60.gif
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
www/extras/smileys/smile61.gif
Normal file
|
After Width: | Height: | Size: 623 B |
BIN
www/extras/smileys/smile62.gif
Normal file
|
After Width: | Height: | Size: 703 B |
BIN
www/extras/smileys/smile63.gif
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
www/extras/smileys/smile64.gif
Normal file
|
After Width: | Height: | Size: 581 B |