Skip to content

Commit

Permalink
Item1156: Create Release01x00 branch
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.foswiki.org/branches/Release01x00@2730 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
KennethLavrsen authored and KennethLavrsen committed Feb 26, 2009
1 parent 8643570 commit 3f37c49
Show file tree
Hide file tree
Showing 25 changed files with 273 additions and 0 deletions.
115 changes: 115 additions & 0 deletions SmiliesPlugin/data/System/SmiliesPlugin.txt
@@ -0,0 +1,115 @@
%META:TOPICINFO{author="ProjectContributor" date="1111929255" format="1.0" version="$Rev$"}%
---+ The Smilies Plugin <nop>:-)

Smilies are common in e-mail messages and bulletin board posts. They are used to convey an emotion, such as a smile :<nop>-) or a frown :<nop>-( . This plugin automatically converts certain smilies to a nice small icon.

Here is the list of smilies supported by this plugin. To add others, attach new icons to this topic and tweak the table below.

| *You type* | *You see* | *Emotion* |
| <nop>:-) | %ATTACHURL%/smile.gif | "smile" |
| <nop>:) | %ATTACHURL%/smile.gif | "smile" |
| <nop>8-) | %ATTACHURL%/cool.gif | "cool!" |
| <nop>:cool: | %ATTACHURL%/cool.gif | "cool!" |
| <nop>:-I | %ATTACHURL%/indifferent.gif | "indifferent" |
| <nop>:( | %ATTACHURL%/frown.gif | "frown" |
| <nop>:-( | %ATTACHURL%/frown.gif | "frown" |
| <nop>:o | %ATTACHURL%/redface.gif | "embarrassment" |
| <nop>:D | %ATTACHURL%/biggrin.gif | "big grin" |
| <nop>:-D | %ATTACHURL%/biggrin.gif | "big grin" |
| <nop>;) | %ATTACHURL%/wink.gif | "wink" |
| <nop>;-) | %ATTACHURL%/wink.gif | "wink" |
| <nop>:p | %ATTACHURL%/tongue.gif | "stick out tongue" |
| <nop>:-p | %ATTACHURL%/tongue.gif | "stick out tongue" |
| <nop>:rolleyes: | %ATTACHURL%/rolleyes.gif | "roll eyes (sarcastic)" |
| <nop>:mad: | %ATTACHURL%/mad.gif | "mad!" |
| <nop>:eek: | %ATTACHURL%/eek.gif | "eek!" |
| <nop>:confused: | %ATTACHURL%/confused.gif | "confused" |
| <nop>&nbsp;>:-) | %ATTACHURL%/devil.gif | "hehe!" |
| <nop>:devil: | %ATTACHURL%/devil.gif | "hehe!" |
| <nop>&nbsp;>;-) | %ATTACHURL%/devilwink.gif | "hehe! (friendly)" |
| <nop>:devilish: | %ATTACHURL%/devilwink.gif | "hehe! (friendly)" |
| <nop>:-X | %ATTACHURL%/sealed.gif | "sealed lips" |
| <nop>:ok: | %ATTACHURL%/thumbs.gif | "thumbs up" |
| <nop>:yes: | %ATTACHURL%/yes.gif | "yes" |
| <nop>:no: | %ATTACHURL%/no.gif | "no" |
| <nop>:love: | %ATTACHURL%/love.gif | "I love it!" |
| <nop>:skull: | %ATTACHURL%/skull.gif | "dead!" |

---++ <nop>%TOPIC% Global Settings

Plugin settings are stored as [[%SYSTEMWEB%.PreferenceSettings][preference settings]]. To reference
a plugin setting of this plugin write ==%<nop>&lt;plugin&gt;_&lt;setting&gt;%==, for example, ==%<nop>SMILIESPLUGIN_TOPIC%==

* One line description, shown in the %SYSTEMWEB%.TextFormattingRules topic:
* Set SHORTDESCRIPTION = Render smilies as icons, like :-) for =&nbsp;:-)= or :eek: for =&nbsp;:eek:=

* The name of the topic containig your Smilies. Use format =web.topic=. Default: ==%SYSTEMWEB%.SmiliesPlugin==
* #Set TOPIC = %SYSTEMWEB%.SmiliesPlugin

* The way the _emoticon_ is displayed. You can use ==$emoticon== (e.g. =:<nop>D=), ==$url== (e.g. =%<nop>ATTACHURL%/biggrin.gif=) and ==$tooltip== (e.g. ="big grin"=). Default: ==&lt;img src="$url" alt="$tooltip" title="$tooltip" border="0" /&gt;==
<verbatim>
* #Set FORMAT = <img src="$url" alt="$emoticon" title="$emoticon" border="0" />
</verbatim>

---++ Plugin Installation Instructions
This plugin is installed by default with a Foswiki release. You should not need to install the plugin unless it is for an upgrade.
* Download the ZIP file from the Plugin web (see below)
* Unzip ==%TOPIC%.zip== in your Foswiki installation directory. Content:
| *File:* | *Description:* |
| ==data/System/%TOPIC%.txt== | Plugin topic |
| ==data/System/%TOPIC%.txt,v== | Plugin topic repository |
| ==lib/Foswiki/Plugins/%TOPIC%.pm== | Plugin Perl module |
| ==pub/System/%TOPIC%/*.gif== | Plugin icon files |
* Visit =configure= in your Foswiki installation, and enable the plugin in the {Plugins} section.
* Test if the plugin is correctly installed:
* You will see a series of icons on next line: <br />
:-) :) :cool: :( :o :D ;) :p :rolleyes: :mad: :eek: :confused: >:-) >;-) :-X :ok: :yes: :no: :love: :skull:

---++ Plugin Info

| Copyright: | Copyright (C) 2001-2007 Andrea Sterbini, Peter Thoeny, peter@thoeny.org and TWiki Contributors. Copyright (C) 2008-2009 Foswiki Contributors |
| License: | GPL ([[http://www.gnu.org/copyleft/gpl.html][GNU General Public License]]) |
| Plugin Version: | 04 Jan 2009 |
| Change History: | <!-- specify latest version first -->&nbsp; |
| 04 Jan 2009: | Foswiki version - Fixed the use of SMILIESPLUGIN_TOPIC so you can create your own smily collection that does not get overwritten when upgrading Foswiki |
| 21 Nov 2007: | Doc improvements |
| 16 Mar 2005: | Fixed typo "scull" |
| 5 Mar 2005: | 1.004 Crawford Currie prepared for Dakar |
| 21 Nov 2004: | Added benchmarks (no code changes) |
| 21 Aug 2004: | Fixed tooltip for Netscape; added "sealed lips", "thumbs up", "yes" "no", "in love", "skull" |
| 16 Feb 2004: | Added "devil" and "devilwink" smilies (by TWiki:Main.CrawfordCurrie) |
| 26 Feb 2003: | Added "indifferent" smilie |
| 20 Oct 2002: | Fixed STDERR warning for non-initialized Plugin |
| 20 Apr 2002: | Improved performance; removed non-standard Plugin API dependencies; added standard plugin topic content -- TWiki:Main.PeterThoeny |
| 23 Nov 2001: | Added TOPIC and FORMAT setting |
| 10 Jun 2001: | Packaged into ZIP |
| 28 Feb 2001: | Initial version |
| CPAN Dependencies: | none |
| Other Dependencies: | none |
| Perl Version: | 5.008 |
| Plugin Home: | http://foswiki.org/Extensions/%TOPIC% |
| Feedback: | http://foswiki.org/Extensions/%TOPIC%Dev |

---
*Related Topics:* %SYSTEMWEB%.DefaultPreferences, %USERSWEB%.SitePreferences, [[%SYSTEMWEB%.Plugins][Plugins]]

%META:FILEATTACHMENT{name="biggrin.gif" attr="h" comment="" date="1071216488" path="C:\Data\MyTWiki\Plugins\SmiliesPlugin\pub\TWiki\SmiliesPlugin\biggrin.gif" size="152" user="ProjectContributor" version="1.1"}%
%META:FILEATTACHMENT{name="confused.gif" attr="h" comment="" date="1071216502" path="C:\Data\MyTWiki\Plugins\SmiliesPlugin\pub\TWiki\SmiliesPlugin\confused.gif" size="110" user="ProjectContributor" version="1.1"}%
%META:FILEATTACHMENT{name="cool.gif" attr="h" comment="" date="1071216522" path="C:\Data\MyTWiki\Plugins\SmiliesPlugin\pub\TWiki\SmiliesPlugin\cool.gif" size="124" user="ProjectContributor" version="1.1"}%
%META:FILEATTACHMENT{name="eek.gif" attr="h" comment="" date="1071216532" path="C:\Data\MyTWiki\Plugins\SmiliesPlugin\pub\TWiki\SmiliesPlugin\eek.gif" size="1264" user="ProjectContributor" version="1.1"}%
%META:FILEATTACHMENT{name="frown.gif" attr="h" comment="" date="1071216543" path="C:\Data\MyTWiki\Plugins\SmiliesPlugin\pub\TWiki\SmiliesPlugin\frown.gif" size="94" user="ProjectContributor" version="1.1"}%
%META:FILEATTACHMENT{name="indifferent.gif" attr="h" comment="" date="1071216555" path="C:\Data\MyTWiki\Plugins\SmiliesPlugin\pub\TWiki\SmiliesPlugin\indifferent.gif" size="132" user="ProjectContributor" version="1.1"}%
%META:FILEATTACHMENT{name="mad.gif" attr="h" comment="" date="1071216566" path="C:\Data\MyTWiki\Plugins\SmiliesPlugin\pub\TWiki\SmiliesPlugin\mad.gif" size="154" user="ProjectContributor" version="1.1"}%
%META:FILEATTACHMENT{name="redface.gif" attr="h" comment="" date="1071216576" path="C:\Data\MyTWiki\Plugins\SmiliesPlugin\pub\TWiki\SmiliesPlugin\redface.gif" size="136" user="ProjectContributor" version="1.1"}%
%META:FILEATTACHMENT{name="rolleyes.gif" attr="h" comment="" date="1071216591" path="C:\Data\MyTWiki\Plugins\SmiliesPlugin\pub\TWiki\SmiliesPlugin\rolleyes.gif" size="1784" user="ProjectContributor" version="1.1"}%
%META:FILEATTACHMENT{name="smile.gif" attr="h" comment="" date="1071216609" path="C:\Data\MyTWiki\Plugins\SmiliesPlugin\pub\TWiki\SmiliesPlugin\smile.gif" size="93" user="ProjectContributor" version="1.1"}%
%META:FILEATTACHMENT{name="tongue.gif" attr="h" comment="" date="1071216632" path="C:\Data\MyTWiki\Plugins\SmiliesPlugin\pub\TWiki\SmiliesPlugin\tongue.gif" size="338" user="ProjectContributor" version="1.1"}%
%META:FILEATTACHMENT{name="wink.gif" attr="h" comment="" date="1071216641" path="C:\Data\MyTWiki\Plugins\SmiliesPlugin\pub\TWiki\SmiliesPlugin\wink.gif" size="135" user="ProjectContributor" version="1.1"}%
%META:FILEATTACHMENT{name="devil.gif" attr="h" comment="" date="1077002192" path="C:\Data\Temp\devil.gif" size="139" user="ProjectContributor" version="1.1"}%
%META:FILEATTACHMENT{name="devilwink.gif" attr="h" comment="" date="1077002138" path="C:\Data\Temp\devilwink.gif" size="141" user="ProjectContributor" version="1.1"}%
%META:FILEATTACHMENT{name="sealed.gif" attr="h" comment="" date="1093124420" path="C:\Data\Temp\1\sealed.gif" size="142" user="ProjectContributor" version="1.1"}%
%META:FILEATTACHMENT{name="thumbs.gif" attr="h" comment="" date="1093124440" path="C:\Data\Temp\1\thumbs.gif" size="166" user="ProjectContributor" version="1.1"}%
%META:FILEATTACHMENT{name="yes.gif" attr="h" comment="" date="1093124449" path="C:\Data\Temp\1\yes.gif" size="262" user="ProjectContributor" version="1.1"}%
%META:FILEATTACHMENT{name="no.gif" attr="h" comment="" date="1093124458" path="C:\Data\Temp\1\no.gif" size="468" user="ProjectContributor" version="1.1"}%
%META:FILEATTACHMENT{name="love.gif" attr="h" comment="" date="1093124471" path="C:\Data\Temp\1\love.gif" size="379" user="ProjectContributor" version="1.1"}%
%META:FILEATTACHMENT{name="skull.gif" attr="h" comment="" date="1093124482" path="C:\Data\Temp\1\skull.gif" size="1006" user="ProjectContributor" version="1.1"}%
119 changes: 119 additions & 0 deletions SmiliesPlugin/lib/Foswiki/Plugins/SmiliesPlugin.pm
@@ -0,0 +1,119 @@
# Plugin for Foswiki - The Free and Open Source Wiki, http://foswiki.org/
#
# Copyright (C) 2000-2001 Andrea Sterbini, a.sterbini@flashnet.it
# Copyright (C) 2002-2006 Peter Thoeny, peter@thoeny.org
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version. For
# more details read LICENSE in the root of this distribution.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details, published at
# http://www.gnu.org/copyleft/gpl.html
#
# As per the GPL, removal of this notice is prohibited.
#
# This plugin replaces smilies with small smilies bitmaps

package Foswiki::Plugins::SmiliesPlugin;

use strict;

use Foswiki::Func;

use vars qw( $VERSION $RELEASE
%smiliesUrls %smiliesEmotions
$smiliesPubUrl $allPattern $smiliesFormat );

# This should always be $Rev$ so that Foswiki can determine the checked-in
# status of the plugin. It is used by the build automation tools, so
# you should leave it alone.
$VERSION = '$Rev$';

# This is a free-form string you can use to "name" your own plugin version.
# It is *not* used by the build automation tools, but is reported as part
# of the version number in PLUGINDESCRIPTIONS.
$RELEASE = '04 Jan 2009';

sub initPlugin {
my( $topic, $web, $user, $installWeb ) = @_;

# check for Plugins.pm versions
if( $Foswiki::Plugins::VERSION < 1.026 ) {
Foswiki::Func::writeWarning( "Version mismatch between InterwikiPlugin and Plugins.pm" );
return 0;
}

# Get plugin preferences
$smiliesFormat =
Foswiki::Func::getPreferencesValue( 'SMILIESPLUGIN_FORMAT' )
|| '<img src="$url" alt="$tooltip" title="$tooltip" border="0" />';

$topic =
Foswiki::Func::getPreferencesValue( 'SMILIESPLUGIN_TOPIC' )
|| "$installWeb.SmiliesPlugin";

$web = $installWeb;
if( $topic =~ /(.+)\.(.+)/ ) {
$web = $1;
$topic = $2;
}

$allPattern = "(";
foreach( split( /\n/, Foswiki::Func::readTopicText( $web, $topic, undef, 1 ) ) ) {
# smilie url emotion
if( m/^\s*\|\s*<nop>(?:\&nbsp\;)?([^\s|]+)\s*\|\s*%ATTACHURL%\/([^\s]+)\s*\|\s*"([^"|]+)"\s*\|\s*$/o ) {
$allPattern .= "\Q$1\E|";
$smiliesUrls{$1} = $2;
$smiliesEmotions{$1} = $3;
}
}
$allPattern =~ s/\|$//o;
$allPattern .= ")";
$smiliesPubUrl =
Foswiki::Func::getPubUrlPath() .
"/$web/$topic";

# Initialization OK
return 1;
}

sub commonTagsHandler {
# my ( $text, $topic, $web ) = @_;
$_[0] =~ s/%SMILIES%/_allSmiliesTable()/geo;
}

sub preRenderingHandler {
# my ( $text, \%removed ) = @_;

$_[0] =~ s/(\s|^)$allPattern(?=\s|$)/_renderSmily($1,$2)/geo;
}

sub _renderSmily {
my ( $thePre, $theSmily ) = @_;

return $thePre unless $theSmily;

my $text = $thePre.$smiliesFormat;
$text =~ s/\$emoticon/$theSmily/go;
$text =~ s/\$tooltip/$smiliesEmotions{$theSmily}/go;
$text =~ s/\$url/$smiliesPubUrl\/$smiliesUrls{$theSmily}/go;

return $text;
}

sub _allSmiliesTable {
my $text = "| *What to Type* | *Graphic That Will Appear* | *Emotion* |\n";

foreach my $k ( sort { $smiliesEmotions{$b} cmp $smiliesEmotions{$a} }
keys %smiliesEmotions ) {
$text .= "| <nop>$k | $k | ". $smiliesEmotions{$k} ." |\n";
}
return $text;
}

1;
Empty file.
22 changes: 22 additions & 0 deletions SmiliesPlugin/lib/Foswiki/Plugins/SmiliesPlugin/MANIFEST
@@ -0,0 +1,22 @@
data/System/SmiliesPlugin.txt 0644
lib/Foswiki/Plugins/SmiliesPlugin.pm 0444
pub/System/SmiliesPlugin/biggrin.gif 0644
pub/System/SmiliesPlugin/confused.gif 0644
pub/System/SmiliesPlugin/cool.gif 0644
pub/System/SmiliesPlugin/devil.gif 0644
pub/System/SmiliesPlugin/devilwink.gif 0644
pub/System/SmiliesPlugin/eek.gif 0644
pub/System/SmiliesPlugin/frown.gif 0644
pub/System/SmiliesPlugin/indifferent.gif 0644
pub/System/SmiliesPlugin/mad.gif 0644
pub/System/SmiliesPlugin/redface.gif 0644
pub/System/SmiliesPlugin/rolleyes.gif 0644
pub/System/SmiliesPlugin/smile.gif 0644
pub/System/SmiliesPlugin/tongue.gif 0644
pub/System/SmiliesPlugin/wink.gif 0644
pub/System/SmiliesPlugin/sealed.gif 0644
pub/System/SmiliesPlugin/thumbs.gif 0644
pub/System/SmiliesPlugin/yes.gif 0644
pub/System/SmiliesPlugin/no.gif 0644
pub/System/SmiliesPlugin/love.gif 0644
pub/System/SmiliesPlugin/skull.gif 0644
17 changes: 17 additions & 0 deletions SmiliesPlugin/lib/Foswiki/Plugins/SmiliesPlugin/build.pl
@@ -0,0 +1,17 @@
#!/usr/bin/perl -w
#
# Build for SmiliesPlugin
#
BEGIN {
foreach my $pc (split(/:/, $ENV{FOSWIKI_LIBS})) {
unshift @INC, $pc;
}
}

use Foswiki::Contrib::Build;

# Create the build object
$build = new Foswiki::Contrib::Build( 'SmiliesPlugin' );

# Build the target on the command line, or the default target
$build->build($build->{target});
Binary file added SmiliesPlugin/pub/System/SmiliesPlugin/biggrin.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added SmiliesPlugin/pub/System/SmiliesPlugin/confused.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added SmiliesPlugin/pub/System/SmiliesPlugin/cool.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added SmiliesPlugin/pub/System/SmiliesPlugin/devil.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added SmiliesPlugin/pub/System/SmiliesPlugin/devilwink.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added SmiliesPlugin/pub/System/SmiliesPlugin/eek.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added SmiliesPlugin/pub/System/SmiliesPlugin/frown.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added SmiliesPlugin/pub/System/SmiliesPlugin/love.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added SmiliesPlugin/pub/System/SmiliesPlugin/mad.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added SmiliesPlugin/pub/System/SmiliesPlugin/no.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added SmiliesPlugin/pub/System/SmiliesPlugin/redface.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added SmiliesPlugin/pub/System/SmiliesPlugin/sealed.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added SmiliesPlugin/pub/System/SmiliesPlugin/skull.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added SmiliesPlugin/pub/System/SmiliesPlugin/smile.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added SmiliesPlugin/pub/System/SmiliesPlugin/thumbs.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added SmiliesPlugin/pub/System/SmiliesPlugin/tongue.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added SmiliesPlugin/pub/System/SmiliesPlugin/wink.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added SmiliesPlugin/pub/System/SmiliesPlugin/yes.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 3f37c49

Please sign in to comment.