User:Cryptic/smiley.js is an odious little script that replaces various ascii smilies with images from the Commons.
Installation
editCopy the contents of User:Cryptic/smiley.js into your user js file. This will be in one of the following locations depending on the skin you're using:
Smilies replaced
edit=) :) :-) =):D :-D =D
:( :-( =(
;) ;-) ;D ;-D
:p :-p :P :-P =p =P
:'( :'-(
8) 8-) 8D 8-D
![]()
How to add more
editEach line in the smiley
array at the start of the script consists of an array containing the following elements:
- A regular expression for the text to be replaced. Note that backslashes ("
\
") need to be doubled. - The image name.
- The subdirectory where the image is stored. For example, if the image is at http://upload.wikimedia.org/wikipedia/commons/2/26/Smile.png, this should be "
2/26
". - The image width.
- The image height.
Deficiencies
edit- The images are linked in a specific place (e.g. http://upload.wikimedia.org/wikipedia/commons/2/26/Smile.png instead of http://en.wikipedia.org/wiki/Image:Smile.png). I don't see how this can be fixed.
- The images aren't clickable on like the normal [[Image:...]] syntax. This is due to laziness on my part.
- They're replaced everywhere, including on pages not in the Wikipedia: or *Talk: namespaces, within <pre> blocks, and in links like =). (They aren't replaced if they're immediately preceded or followed by a letter or number, like in "Template:Pt", though.) This is also due to laziness on my part.
- It's slow. (You guessed it, laziness again.)
🔥 Top keywords: Akademia e Shkencave e RPS te ShqiperiseAlexandria Ocasio-CortezBilderberg GroupCristiano RonaldoDong XiaowanMinecraftOperation GladioPrimal cutRiot FestStrictly Come Dancing (series 7)Main PageSpecial:SearchKeir StarmerWikipedia:Featured picturesProject 2025UEFA Euro 20242024 United Kingdom general electionKalki 2898 ADKhyree JacksonMoney in the Bank (2024)Rishi SunakUEFA European Championship2024 Copa AméricaVictoria StarmerMasoud PezeshkianXherdan ShaqiriMichael Rubin (businessman)CleopatraA Quiet Place: Day One.xxxMurat YakinSrikanth BollaLove chairBukayo SakaAlexei PopyrinDeaths in 2024Cristiano RonaldoDespicable Me 4Inside Out 2Angela RaynerMaXXXineBreel EmboloMirzapur (TV series)Arda GülerBad Boys: Ride or DieCopa AméricaLabour Party (UK)Beverly Hills Cop: Axel FGareth Southgate