Vos Smileys

Voila vos Smileys

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// --Liste Smileys--
//    :sueur: [=> par Diplodocroute2]
//    :noelcoeur: [=> Par _410]
// ==Liste Smileys==
//
// ==UserScript==
// @name         Vos Smileys
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  Voila vos Smileys
// @author       ElXouif (Positron)
// @match        https://www.jeuxvideo.com/*
// @match        http://www.jeuxvideo.com/*
// @grant        none
// ==/UserScript==

replace()
function replace() {
var y = document.getElementsByTagName("P");
var i;
for (i = 0; i < y.length; i++) {
  var reg=new RegExp(":sueur:", "g");
  y[i].innerHTML = y[i].innerHTML.replace(reg,"<img border='0'src='http://shack.hapoel.rf.gd/publique/sueur.png' alt=':sueur:' />"); //Par Diplodocroute2

  reg=new RegExp(":noelcoeur:", "g");
  y[i].innerHTML = y[i].innerHTML.replace(reg,"<img border='0'src='http://shack.hapoel.rf.gd/publique/noelcoeur.png' alt=':noelcoeur:' />"); //Par _410
}
}
var userInput = document.getElementById('message_topic');
userInput.onkeyup = function() {
  if(document.getElementById('message_topic').indexOf(":hapoel:") !== -1 || document.getElementById('message_topic').indexOf(":hapoelia:") !== -1 || document.getElementById('message_topic').indexOf(":hapoel2:") !== -1){
  replace()
  }
};