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.

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, ...}

--JoshuaRodman


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:

I personally used it to remove unwanted smileys and to improve the flags:

Installation

Place UserSmiley.py in your wikipath, i.e. in the same directory as

Usage

UserSmiley.py defines 4 functions:

  1. has_smiley( key ) -- to ask if a smiley exists
  2. add_smiley( key, width, height, border, filename ) -- to add a smiley - currently a probably existing smiley will be redefined
  3. redefine_smiley( key, width, height, border, filename ) -- to redefine a smiley - a probably existing smiley will be removed, the new smiley will be added
  4. 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


CategoryFeatureRequest CategoryMoinMoinPatch

MoinMoin: FeatureRequests/SubtractSmileys (last edited 2007-10-29 19:17:18 by localhost)