Support for smileys

This commit is contained in:
Len Kranendonk 2003-05-09 09:52:43 +00:00
parent 66a25ffdef
commit 249e35d9fc
67 changed files with 86 additions and 0 deletions

View file

@ -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') {

Binary file not shown.

After

Width:  |  Height:  |  Size: 135 B

View 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>";

Binary file not shown.

After

Width:  |  Height:  |  Size: 272 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 260 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 862 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 282 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 791 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 304 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 266 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 293 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 884 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 276 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 268 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 193 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 265 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 974 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 275 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 496 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 262 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 433 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 300 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 283 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 287 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 626 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 155 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 200 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 217 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 407 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 343 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 452 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 674 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 796 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 159 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 289 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 256 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 274 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 186 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 236 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 185 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 911 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 183 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 240 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 281 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 458 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 959 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 453 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 296 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 623 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 703 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 581 B