Remove as well as add Smileys from default Smiley list
MoinMoin provides a flexible, extendable smiley feature, which allows for the additions of small graphics to pages to describe them better. It is possible to add additional smiley graphics on a wiki-by-wiki basis. However, it is not possible to change the existing smileys or to disable smileys on a wiki-by-wiki basis. (See HelpOnSmileys for built-in smileys)
My impetus for this desire is that conversion of ascii smileys to png or gif representations is both lossy, and undesirable. Users have been exploring the context space of "emoticons" for more than twenty years now, and a vast array of emotive intent has been plumbed. Reducing all these different modes of human expression to yellow circles is only sufficient to suggest the most basic and simplistic of emotive content. They have a variety of problems.
- Yellow circles are not very emotive. It is hard for a yellow circle to suggest wryness, the state of being nonplussed, etc.
- Yellow circles are less iconic. Ascii emoticons have only vague suggestions of the facial expressions, which allows the reader to fill out an internal image more easily. yellow circles are relatively concrete, and provide a higher barrier to visualizing emotive content.
Ascii is a small dataset, and thus some emoticons have served a variety of purposes. For example in my circles, the emoticon constructed from <, :, and ( indicates "Sad Party Hat", the petty personal aloneness that comes from ennui at one's childhood birthday. MoinMoin renders this as "frown" <:(. This is incompatable with the emotive intent of the emoticon. A better example is :-?, which historically was used to represent a contemplative pipe smoking session, which MoinMoin handles as a tongue. is often a robot, and so on.
The list is assuredly incomplete. is sad in moinmoin, wheras :~( is crying in emoticon standard. Yes, local admins could make a little picture of a crying yellow circle, but since emoticons are a soft medium with local invention, it will always remain incomplete.
I am of the view that yellow circles are always inferior to plain ascii emoticons, and should be abandoned everywhere, but I accept that not everyone sees this as I do. As a result, I would simply like to disable emoticons with the smileys dict that is supplied in config_moin.py:
Example:
'smileys': {"X-C": None, ":D": None, "<:(": None, ...}
Although new to both, MoinMoin and Python I decided to provide a suggestion for a solution. If not appropriate, please feel free to adapt and improve.
Solution Description
The script UserSmileys.py provides 4 functions to ask for existing, remove, add or redefine smileys. It will be installed on the wikipath which ensures that smileys can be defined per wiki.
Tests
UserSmileys.py has been successfully tested with:
MoinMoin version MoinDesktop_1.3.4-2 (zipped standalone version)
- Python 2.4
I personally used it to remove unwanted smileys and to improve the flags:
- bring all flags to same size, i.e. 18 x 20
- redefine white background flags to have a black border (and be better visible)
Installation
Place UserSmiley.py in your wikipath, i.e. in the same directory as
- moin.py
- wikiconfig.py
- wikiserverconfig.py
Usage
UserSmiley.py defines 4 functions:
- has_smiley( key ) -- to ask if a smiley exists
- add_smiley( key, width, height, border, filename ) -- to add a smiley - currently a probably existing smiley will be redefined
- redefine_smiley( key, width, height, border, filename ) -- to redefine a smiley - a probably existing smiley will be removed, the new smiley will be added
- remove_smiley( key ) -- to remove an existing smiley
Call this functions from your wikiconfig.py. This ensures you can define the smileys on a wiki-by-wiki basis.
Usage Examples (placed in wikiconfig.py)
# user smiley management # remove some unwanted smileys: if True: UserSmileys.remove_smiley(':(') UserSmileys.remove_smiley(':-(') # redefine some flags: if True: UserSmileys.redefine_smiley('{en}',18,12,0,'flag-en-normal.png') UserSmileys.redefine_smiley('{ko}',18,12,0,'flag-ko-border.png') # add some flags: if True: UserSmileys.add_smiley('{au}',18,12,0,'flag-au-normal.png')
Script UserSmileys.py
See attachment UserSmileys.py
-- JürgenLind, 2005-08-08
I'd be happy with the ability to set a per-user preference of "disable smileys for me." I've seen references to some config pref for users that does this but it only seems to be in translated UserPrefs, not in the english UserPrefs nor anywhere in a page text search. :-/
-- Jon Booth, 2005-12-19