[Script] Smilies forum tribal

DeletedUser

Guest
Script pour les smilies dans le forum tribal

Qui n'a jamais regretté l'absence de smilies-image pour égayer le forum de votre tribu?

Je vous fait partager un script que j'ai codé à cet effet.
Je remercie tout d'abord File Not Found, je me suis en effet servi des liens des smilies dans un de ses scripts similaire au mien.

Il y a cependant des contraintes :

-Le script ne fonctionne que si le forum tribal est ouvert dans un nouvel onglet

Là c'est pas faute d'avoir essayé, mais le champ de texte n'apparaît tout simplement pas dans le code source si la condition n'est pas respectée.

Cela inclue que le script ne peut être installé dans la barre de raccourcis, il faut l'installer dans un bookmark/signet/favori/marque-page du navigateur.
Je conseille fortement Opera !

Sans plus attendre, voici le code :

Code:
javascript:
var entree = prompt("Entrez votre smiley : ");
url = "http://www.siteduzero.com/Templates/images/smilies/";
urls = "http://skype-emoticons.com/images/emoticon-";
img = {
  'sourire' : '[' + 'img' + ']' + url + 'smile.png' + '[' + '/img' + ']',
  'heureux' : '[' + 'img' + ']' + url + 'heureux.png' + '[' + '/img' + ']',
  'clin' : '[' + 'img' + ']' + url + 'clin.png' + '[' + '/img' + ']',
  'langue' : '[' + 'img' + ']' + url + 'langue.png' + '[' + '/img' + ']',
  'rire' : '[' + 'img' + ']' + url + 'rire.png' + '[' + '/img' + ']',
  'gene' : '[' + 'img' + ']' + url + 'unsure.png' + '[' + '/img' + ']',
  'triste' : '[' + 'img' + ']' + url + 'triste.png' + '[' + '/img' + ']',
  'euh' : '[' + 'img' + ']' + url + 'huh.png' + '[' + '/img' + ']',
  'mechant' : '[' + 'img' + ']' + url + 'mechant.png' + '[' + '/img' + ']',
  'etonne' : '[' + 'img' + ']' + url + 'blink.png' + '[' + '/img' + ']',
  'hihi' : '[' + 'img' + ']' + url + 'hihi.png' + '[' + '/img' + ']',
  'siffle' : '[' + 'img' + ']' + url + 'siffle.png' + '[' + '/img' + ']',                    
   "\:)" : '[' + 'img'+ ']' + urls + '00100-smile.gif' + '[' + '/img' + ']',
  "\:(": '[' + 'img' + ']' + urls + '00101-sadsmile.gif' + '[' + '/img' + ']', 
  "\:D": '[' + 'img' + ']' + urls + '00102-bigsmile.gif' + '[' + '/img' + ']', 
  '8-)': '[' + 'img' + ']' + urls + '00103-cool.gif' + '[' + '/img' + ']', 
  "\;)": '[' + 'img' + ']' + urls + '00105-wink.gif' + '[' + '/img' + ']', 
  '\;(': '[' + 'img' + ']' + urls + '00106-crying.gif' + '[' + '/img' + ']', 
  '(sweat)': '[' + 'img' + ']' + urls + '00107-sweating.gif' + '[' + '/img' + ']', 
  '\:|': '[' + 'img' + ']' + urls + '00108-speechless.gif' + '[' + '/img' + ']', 
  '(kiss)': '[' + 'img' + ']' + urls + '00109-kiss.gif' + '[' + '/img' + ']', 
  "\:p": '[' + 'img' + ']' + urls + '00110-tongueout.gif' + '[' + '/img' + ']', 
  '(blush)': '[' + 'img' + ']' + urls + '00111-blush.gif' + '[' + '/img' + ']', 
  '\:^)': '[' + 'img' + ']' + urls + '00112-wondering.gif' + '[' + '/img' + ']', 
  '\|-)': '[' + 'img' + ']' + urls + '00113-sleepy.gif' + '[' + '/img' + ']', 
  '(dull)': '[' + 'img' + ']' + urls + '00114-dull.gif' + '[' + '/img' + ']', 
  '(inlove)': '[' + 'img' + ']' + urls + '00115-inlove.gif' + '[' + '/img' + ']', 
  "]:)": '[' + 'img' + ']' + urls + '00116-evilgrin.gif' + '[' + '/img' + ']', 
  '(talk)': '[' + 'img' + ']' + urls + '00117-talking.gif' + '[' + '/img' + ']',
  '(yawn)': '[' + 'img' + ']' + urls + '00118-yawn.gif' + '[' + '/img' + ']', 
  '(puke)': '[' + 'img' + ']' + urls + '00119-puke.gif' + '[' + '/img' + ']', 
  '(doh)': '[' + 'img' + ']' + urls + '00120-doh.gif' + '[' + '/img' + ']', 
  '\:@': '[' + 'img' + ']' + urls + '00121-angry.gif' + '[' + '/img' + ']', 
  '(wasntme)': '[' + 'img' + ']' + urls + '00122-itwasntme.gif' + '[' + '/img' + ']', 
  '(party)': '[' + 'img' + ']' + urls + '00123-party.gif' + '[' + '/img' + ']', 
  '(worried)': '[' + 'img' + ']' + urls + '00124-worried.gif' + '[' + '/img' + ']', 
  '(mm)': '[' + 'img' + ']' + urls + '00125-mmm.gif' + '[' + '/img' + ']', 
  '8-\|': '[' + 'img' + ']' + urls + '00126-nerd.gif' + '[' + '/img' + ']', 
  ':x': '[' + 'img' + ']' + urls + '00127-lipssealed.gif' + '[' + '/img' + ']', 
  '(wave)': '[' + 'img' + ']' + urls + '00128-hi.gif' + '[' + '/img' + ']', 
  '(call)': '[' + 'img' + ']' + urls + '00129-call.gif' + '[' + '/img' + ']', 
  '(devil)': '[' + 'img' + ']' + urls + '00130-devil.gif' + '[' + '/img' + ']', 
  '(angel)': '[' + 'img' + ']' + urls + '00131-angel.gif' + '[' + '/img' + ']', 
  '(envy)': '[' + 'img' + ']' + urls + '00132-envy.gif' + '[' + '/img' + ']', 
  '(wait)': '[' + 'img' + ']' + urls + '00133-wait.gif' + '[' + '/img' + ']', 
  '(hug)': '[' + 'img' + ']' + urls + '00134-bear.gif' + '[' + '/img' + ']', 
  '(makeup)': '[' + 'img' + ']' + urls + '00135-makeup.gif' + '[' + '/img' + ']', 
  '(giggle)': '[' + 'img' + ']' + urls + '00136-giggle.gif' + '[' + '/img' + ']',
  '(clap)': '[' + 'img' + ']' + urls + '00137-clapping.gif' + '[' + '/img' + ']', 
  '(think)': '[' + 'img' + ']' + urls + '00138-thinking.gif' + '[' + '/img' + ']', 
  '(bow)': '[' + 'img' + ']' + urls + '00139-bow.gif' + '[' + '/img' + ']', 
  '(rofl)': '[' + 'img' + ']' + urls + '00140-rofl.gif' + '[' + '/img' + ']', 
  '(whew)': '[' + 'img' + ']' + urls + '00141-whew.gif' + '[' + '/img' + ']', 
  '(happy)': '[' + 'img' + ']' + urls + '00142-happy.gif' + '[' + '/img' + ']', 
  '(smirk)': '[' + 'img' + ']' + urls + '00143-smirk.gif' + '[' + '/img' + ']', 
  '(nod)': '[' + 'img' + ']' + urls + '00144-nod.gif' + '[' + '/img' + ']', 
  '(shake)': '[' + 'img' + ']' + urls + '00145-shake.gif' + '[' + '/img' + ']', 
  '(punch)': '[' + 'img' + ']' + urls + '00146-punch.gif' + '[' + '/img' + ']', 
  '(emo)': '[' + 'img' + ']' + urls + '00147-emo.gif' + '[' + '/img' + ']', 
  '(y)': '[' + 'img' + ']' + urls + '00148-yes.gif' + '[' + '/img' + ']', 
  '(n)': '[' + 'img' + ']' + urls + '00149-no.gif' + '[' + '/img' + ']', 
  '(handshake)': '[' + 'img' + ']' + urls + '00150-handshake.gif' + '[' + '/img' + ']', 
  '(skype)': '[' + 'img' + ']' + urls + '00151-skype.gif' + '[' + '/img' + ']', 
  '(h)': '[' + 'img' + ']' + urls + '00152-heart.gif' + '[' + '/img' + ']', 
  '(u)': '[' + 'img' + ']' + urls + '00153-brokenheart.gif' + '[' + '/img' + ']', 
  '(e)': '[' + 'img' + ']' + urls + '00154-mail.gif' + '[' + '/img' + ']', 
  '(f)': '[' + 'img' + ']' + urls + '00155-flower.gif' + '[' + '/img' + ']', 
  '(rain)': '[' + 'img' + ']' + urls + '00156-rain.gif' + '[' + '/img' + ']', 
  '(sun)': '[' + 'img' + ']' + urls + '00157-sun.gif' + '[' + '/img' + ']', 
  '(o)': '[' + 'img' + ']' + urls + '00158-time.gif' + '[' + '/img' + ']', 
  '(music)': '[' + 'img' + ']' + urls + '00159-music.gif' + '[' + '/img' + ']', 
  '(~)': '[' + 'img' + ']' + urls + '00160-movie.gif' + '[' + '/img' + ']', 
  '(mp)': '[' + 'img' + ']' + urls + '00161-phone.gif' + '[' + '/img' + ']', 
  '(coffee)': '[' + 'img' + ']' + urls + '00162-coffee.gif' + '[' + '/img' + ']', 
  '(pi)': '[' + 'img' + ']' + urls + '00163-pizza.gif' + '[' + '/img' + ']', 
  '(cash)': '[' + 'img' + ']' + urls + '00164-cash.gif' + '[' + '/img' + ']', 
  '(flex)': '[' + 'img' + ']' + urls + '00165-muscle.gif' + '[' + '/img' + ']', 
  '(\^)': '[' + 'img' + ']' + urls + '00166-cake.gif' + '[' + '/img' + ']', 
  '(beer)': '[' + 'img' + ']' + urls + '00167-beer.gif' + '[' + '/img' + ']', 
  '(d)': '[' + 'img' + ']' + urls + '00168-drink.gif' + '[' + '/img' + ']', 
  '(dance)': '[' + 'img' + ']' + urls + '00169-dance.gif' + '[' + '/img' + ']', 
  '(ninja)': '[' + 'img' + ']' + urls + '00170-ninja.gif' + '[' + '/img' + ']', 
  '(star)': '[' + 'img' + ']' + urls + '00171-star.gif' + '[' + '/img' + ']', 
  '(mooning)': '[' + 'img' + ']' + urls + '00172-mooning.gif' + '[' + '/img' + ']', 
  '(finger)': '[' + 'img' + ']' + urls + '00173-middlefinger.gif' + '[' + '/img' + ']', 
  '(bandit)': '[' + 'img' + ']' + urls + '00174-bandit.gif' + '[' + '/img' + ']', 
  '(drunk)': '[' + 'img' + ']' + urls + '00175-drunk.gif' + '[' + '/img' + ']', 
  '(smoke)': '[' + 'img' + ']' + urls + '00176-smoke.gif' + '[' + '/img' + ']', 
  '(toivo)': '[' + 'img' + ']' + urls + '00177-toivo.gif' + '[' + '/img' + ']', 
  '(rock)': '[' + 'img' + ']' + urls + '00178-rock.gif' + '[' + '/img' + ']', 
  '(headbang)': '[' + 'img' + ']' + urls + '00179-headbang.gif' + '[' + '/img' + ']', 
  '(bug)': '[' + 'img' + ']' + urls + '00180-bug.gif' + '[' + '/img' + ']', 
  '(fubar)': '[' + 'img' + ']' + urls + '00181-fubar.gif' + '[' + '/img' + ']', 
  '(poolparty)': '[' + 'img' + ']' + urls + '00182-poolparty.gif' + '[' + '/img' + ']', 
  '(swear)': '[' + 'img' + ']' + urls + '00183-swear.gif' + '[' + '/img' + ']', 
  '(tmi)': '[' + 'img' + ']' + urls + '00184-tmi.gif' + '[' + '/img' + ']', 
  '(heidy)': '[' + 'img' + ']' + urls + '00185-heidy.gif' + '[' + '/img' + ']',
  'coeur' : '♥'

};
var smiley = img[entree];
var msg = document.getElementById("message").value;
document.getElementById("message").value = msg + ' ' + smiley;
void(0);

Le principe est simple, vous actionnez le script, vous entrez la commande (colonne de gauche dans le script) et le reste se fait tout seul.

Si vous entrez n'importe quoi c'est votre problème, il n'y aura pas d'explosion atomique ou je ne sais quoi, mais je préfère prévenir ;)


S'il y a un bug, veuillez faire un rapport complet de ce qui ne va pas, car un simple "c'd'la daube ça marche pas" c'est joli mais sans plus :)

Je crois que c'est tout... :D
 

DeletedUser

Guest
J'annonce juste qu'actuellement j'ai un soucis d'ordinateur puisqu'il ne fonctionne plus, donc je me connecte par ci par là assez rarement en attendant d'amener mon ordi chez un informaticien. Je proposerais la validation du script une fois que je retrouverais une situation normale, désolée. ;)

Inadin.

Edit : Finalement je le remonte, vu que j'en ai la possibilité. Et Virza, GG le pompage sur le Site du Zéro et Skype. :D

Code:
url = "http://www.siteduzero.com/Templates/images/smilies/";
urls = "http://skype-emoticons.com/images/emoticon-
 
Dernière édition par un modérateur:

DeletedUser

Guest
Bonjours Virza ,

Je suis assez curieux ^^

Peut t'on mètre sa juste sur un seul topique ? exemple , selement la taverne ?
 

DeletedUser

Guest
Inadin a dit:
Et Virza, GG le pompage sur le Site du Zéro et Skype.

Euh je ne sais pas comment prendre ta phrase :D

Je ne voulais pas me fouler avec les smilies, je voulais un script qui mette des smiley, lesquels je m'en contrefiche :p
J'ai pris ceux du siteduzero car ils sont mimi, et ceux de skype car ils sont largement utilisés. Pour ceux-là je me suis contenté d'un simple copié-collé des liens de File Not Found lol



Angerfist a dit:
Bonjours Virza ,

Je suis assez curieux ^^

Peut t'on mètre sa juste sur un seul topique ? exemple , selement la taverne ?

C'est un script, tu l'actives sur le topic de ton choix ;)
J'ai peut-être oublié de préciser qu'il ne converti pas tous vos ":)" en image, il vous demande d'insérer une commande, genre ":)" et vous le traduit en smiley image
 

DeletedUser16542

Guest
Humm, J'ai un doute sur la ligne :

'8-\|': '[' + 'img' + ']' + urls + '00126-nerd.gif' + '[' + '/img' + ']',
':x': '[' + 'img' + ']' + urls + '00127-lipssealed.gif' + '[' + '/img' + ']',

Sinon, Il faudrait précisé qu'il ne faut pas mettre le \ Comme ici :
Code:
\:)
 

DeletedUser

Guest
Ah, j'ai zappé de préciser que le "\" est un caractère d'échappement, et qu'il n'est pas "lu" par le navigateur, sauf si "\\"
 

DeletedUser

Guest
Je précise que grâce à la mise à jour, le script peut-être placé dans la barre de raccourcis, et ne nécessite plus d'ouvrir le forum dans un nouvel onglet :)
 

DeletedUser

Guest
[SCRIPT] Smileys pour forum

Bonjour, j'ai vu que Virza avait créer un script, facile d'utilisation, pour mettre des smileys sur le forum de la tribu (source : http://forum.guerretribale.fr/showthread.php?t=22427)

J'ai repris la base de son script pour le modifier et mettre les smileys de Guerre tribale
Le principe est simple, vous actionnez le script, vous entrez la commande (colonne de gauche dans le script) et le reste se fait tout seul.
Voila le script :

Code:
javascript:
var entree = prompt("Entrez votre smiley : ");
url = "http://forum.guerretribale.fr/images/smilies/";
img = {
  '1' : '[' + 'img' + ']' + url + 'tongue.gif' + '[' + '/img' + ']',
  '2' : '[' + 'img' + ']' + url + 'redface.gif' + '[' + '/img' + ']',
  '3' : '[' + 'img' + ']' + url + 'confused.gif' + '[' + '/img' + ']',
  '4' : '[' + 'img' + ']' + url + 'wink.gif' + '[' + '/img' + ']',
  '5' : '[' + 'img' + ']' + url + 'smile.gif' + '[' + '/img' + ']',
  '6' : '[' + 'img' + ']' + url + 'biggrin.gif' + '[' + '/img' + ']',
  '7' : '[' + 'img' + ']' + url + 'frown.gif' + '[' + '/img' + ']',
  '8' : '[' + 'img' + ']' + url + 'mad.gif' + '[' + '/img' + ']',
  '9' : '[' + 'img' + ']' + url + 'rolleyes.gif' + '[' + '/img' + ']',
  '10' : '[' + 'img' + ']' + url + 'cool.gif' + '[' + '/img' + ']',
  '11' : '[' + 'img' + ']' + url + 'eek.gif' + '[' + '/img' + ']',                    

};
var smiley = img[entree];
var msg = document.getElementById("message").value;
document.getElementById("message").value = msg + ' ' + smiley;
void(0);

Le script devrai normalement fonctionner (chez moi oui en tout cas)

voila l'ordre des smileys qui seront affichés :

1 :
tongue.gif

2 :
redface.gif

3 :
confused.gif

4 :
wink.gif

5 :
smile.gif

6 :
biggrin.gif

7 :
frown.gif

8 :
mad.gif

9 :
rolleyes.gif

10 :
cool.gif

11 :
eek.gif


Pour les bugs, je pense que vous savez comment faire (moi pas trop :eek:)
Encore merci pour la base du script a Virza !!
 
Dernière édition par un modérateur:

DeletedUser331

Guest
Tu aurais pu l'ajouter sur le topique à Virza directement ^^

Mais merci ;)
 

DeletedUser

Guest
Meuh non on me vexe pas comme ça =0

Si j'avais été toi j'aurais modifié ma deuxième version de script pour smiley, je suis pas très fier de ce script-ci ó_ò

Mais je vois que tu as bien compris son fonctionnement ;)
 

DeletedUser

Guest
j'ai modifié le script il y avait un espace en trop !

Virza, j'ai modifié ton userscript pour mettre les smileys de Guerre tribale, voila le code :
Je rajoute qu'il marche sur firefox, et pas seulement sur Opéra comme l'avais dit Virza

Code:
javascript:
(function ()	{  
	if(document.URL.indexOf('&screen=mail&mode')!= -1)  {  
	function bb_code1() {  
		var doc = document.getElementById('bb_bar');  
		doc.innerHTML += "<a id=\'code\' title=\'Code\' href=\'#\' onclick=\"BBCodes.insert('[code]', '
');return false;\"><span style=\'display:inline-block; zoom:1; *display:inline; background:url(http://forum.guerretribale.fr/images/editor/code.gif) no-repeat 0px 0px; padding-left: 0px; padding-bottom:0px; margin-right: 2px; margin-bottom:3px; width: 20px; height: 20px\'>&nbsp;</span></a>";
}
bb_code1();
}
if(document.URL.indexOf('&screen=forum&screenmode=view')!= -1 || document.URL.indexOf('&screen=forum&mode=') != -1) {
function bb_code() {
var doc = document.getElementById('bb_bar');
var texte = "no-repeat 0px 0px; padding-left: 0px; padding-bottom:0px; margin-right: 2px; margin-bottom:3px; width: 20px; height: 20px\'>&nbsp;</span></a>";
doc.innerHTML += "<a id=\'code\' title=\'Code\' href=\'#\' onclick=\"BBCodes.insert('
Code:
', '
');return false;\"><span style=\'display:inline-block; zoom:1; *display:inline; background:url(http://forum.guerretribale.fr/images/editor/code.gif)" + texte;
doc.innerHTML += "<a id=\'tongue\' title=\'tongue\' href=\'#\' onclick=\"BBCodes.insert('
tongue.gif', '
');return false;\"><span style=\'display:inline-block; zoom:1; *display:inline; background:url(http://forum.guerretribale.fr/images/smilies/tongue.gif)" + texte;
doc.innerHTML += "<a id=\'redface\' title=\'redface\' href=\'#\' onclick=\"BBCodes.insert('
redface.gif', '
');return false;\"><span style=\'display:inline-block; zoom:1; *display:inline; background:url(http://forum.guerretribale.fr/images/smilies/redface.gif)" + texte;
doc.innerHTML += "<a id=\'confused\' title=\'confused\' href=\'#\' onclick=\"BBCodes.insert('
confused.gif', '
');return false;\"><span style=\'display:inline-block; zoom:1; *display:inline; background:url(http://forum.guerretribale.fr/images/smilies/confused.gif)" + texte;
doc.innerHTML += "<a id=\'wink\' title=\'wink\' href=\'#\' onclick=\"BBCodes.insert('
wink.gif', '
');return false;\"><span style=\'display:inline-block; zoom:1; *display:inline; background:url(http://forum.guerretribale.fr/images/smilies/wink.gif)" + texte;
doc.innerHTML += "<a id=\'smile\' title=\'smile\' href=\'#\' onclick=\"BBCodes.insert('
smile.gif', '
');return false;\"><span style=\'display:inline-block; zoom:1; *display:inline; background:url(http://forum.guerretribale.fr/images/smilies/smile.gif)" + texte;
doc.innerHTML += "<a id=\'biggrin\' title=\'biggrin\' href=\'#\' onclick=\"BBCodes.insert('
biggrin.gif', '
');return false;\"><span style=\'display:inline-block; zoom:1; *display:inline; background:url(http://forum.guerretribale.fr/images/smilies/biggrin.gif)" + texte;
doc.innerHTML += "<a id=\'frown\' title=\'frown\' href=\'#\' onclick=\"BBCodes.insert('
frown.gif', '
');return false;\"><span style=\'display:inline-block; zoom:1; *display:inline; background:url(http://forum.guerretribale.fr/images/smilies/frown.gif)" + texte;
doc.innerHTML += "<a id=\'mad\' title=\'mad\' href=\'#\' onclick=\"BBCodes.insert('
mad.gif', '
');return false;\"><span style=\'display:inline-block; zoom:1; *display:inline; background:url(http://forum.guerretribale.fr/images/smilies/mad.gif)" + texte;
doc.innerHTML += "<a id=\'rolleyes\' title=\'rolleyes\' href=\'#\' onclick=\"BBCodes.insert('
rolleyes.gif', '
');return false;\"><span style=\'display:inline-block; zoom:1; *display:inline; background:url(http://forum.guerretribale.fr/images/smilies/rolleyes.gif)" + texte;
doc.innerHTML += "<a id=\'cool\' title=\'cool\' href=\'#\' onclick=\"BBCodes.insert('
cool.gif', '
');return false;\"><span style=\'display:inline-block; zoom:1; *display:inline; background:url(http://forum.guerretribale.fr/images/smilies/cool.gif)" + texte;
doc.innerHTML += "<a id=\'eek\' title=\'eek\' href=\'#\' onclick=\"BBCodes.insert('
eek.gif', '
');return false;\"><span style=\'display:inline-block; zoom:1; *display:inline; background:url(http://forum.guerretribale.fr/images/smilies/eek.gif)" + texte;

}
bb_code();
}
})();[/CODE]

Gandaflerouge, mes scripts sont-ils acceptés d'office ? puisque ceux de Virza le sont !

PS : Il faut citer mon message, et copier le code pour que l'UserScript marche, car le forum de GT prend quelques signes du code et les changes !
 
Dernière édition par un modérateur:

DeletedUser12712

Guest
j'ai modifié le script il y avait un espace en trop !

Virza, j'ai modifié ton userscript pour mettre les smileys de Guerre tribale, voila le code :
Je rajoute qu'il marche sur firefox, et pas seulement sur Opéra comme l'avais dit Virza

Code:
javascript:
(function ()	{  
	if(document.URL.indexOf('&screen=mail&mode')!= -1)  {  
	function bb_code1() {  
		var doc = document.getElementById('bb_bar');  
		doc.innerHTML += "<a id=\'code\' title=\'Code\' href=\'#\' onclick=\"BBCodes.insert('[code]', '
');return false;\"><span style=\'display:inline-block; zoom:1; *display:inline; background:url(http://forum.guerretribale.fr/images/editor/code.gif) no-repeat 0px 0px; padding-left: 0px; padding-bottom:0px; margin-right: 2px; margin-bottom:3px; width: 20px; height: 20px\'>&nbsp;</span></a>";
}
bb_code1();
}
if(document.URL.indexOf('&screen=forum&screenmode=view')!= -1 || document.URL.indexOf('&screen=forum&mode=') != -1) {
function bb_code() {
var doc = document.getElementById('bb_bar');
var texte = "no-repeat 0px 0px; padding-left: 0px; padding-bottom:0px; margin-right: 2px; margin-bottom:3px; width: 20px; height: 20px\'>&nbsp;</span></a>";
doc.innerHTML += "<a id=\'code\' title=\'Code\' href=\'#\' onclick=\"BBCodes.insert('
Code:
', '
');return false;\"><span style=\'display:inline-block; zoom:1; *display:inline; background:url(http://forum.guerretribale.fr/images/editor/code.gif)" + texte;
doc.innerHTML += "<a id=\'tongue\' title=\'tongue\' href=\'#\' onclick=\"BBCodes.insert('
tongue.gif', '
');return false;\"><span style=\'display:inline-block; zoom:1; *display:inline; background:url(http://forum.guerretribale.fr/images/smilies/tongue.gif)" + texte;
doc.innerHTML += "<a id=\'redface\' title=\'redface\' href=\'#\' onclick=\"BBCodes.insert('
redface.gif', '
');return false;\"><span style=\'display:inline-block; zoom:1; *display:inline; background:url(http://forum.guerretribale.fr/images/smilies/redface.gif)" + texte;
doc.innerHTML += "<a id=\'confused\' title=\'confused\' href=\'#\' onclick=\"BBCodes.insert('
confused.gif', '
');return false;\"><span style=\'display:inline-block; zoom:1; *display:inline; background:url(http://forum.guerretribale.fr/images/smilies/confused.gif)" + texte;
doc.innerHTML += "<a id=\'wink\' title=\'wink\' href=\'#\' onclick=\"BBCodes.insert('
wink.gif', '
');return false;\"><span style=\'display:inline-block; zoom:1; *display:inline; background:url(http://forum.guerretribale.fr/images/smilies/wink.gif)" + texte;
doc.innerHTML += "<a id=\'smile\' title=\'smile\' href=\'#\' onclick=\"BBCodes.insert('
smile.gif', '
');return false;\"><span style=\'display:inline-block; zoom:1; *display:inline; background:url(http://forum.guerretribale.fr/images/smilies/smile.gif)" + texte;
doc.innerHTML += "<a id=\'biggrin\' title=\'biggrin\' href=\'#\' onclick=\"BBCodes.insert('
biggrin.gif', '
');return false;\"><span style=\'display:inline-block; zoom:1; *display:inline; background:url(http://forum.guerretribale.fr/images/smilies/biggrin.gif)" + texte;
doc.innerHTML += "<a id=\'frown\' title=\'frown\' href=\'#\' onclick=\"BBCodes.insert('
frown.gif', '
');return false;\"><span style=\'display:inline-block; zoom:1; *display:inline; background:url(http://forum.guerretribale.fr/images/smilies/frown.gif)" + texte;
doc.innerHTML += "<a id=\'mad\' title=\'mad\' href=\'#\' onclick=\"BBCodes.insert('
mad.gif', '
');return false;\"><span style=\'display:inline-block; zoom:1; *display:inline; background:url(http://forum.guerretribale.fr/images/smilies/mad.gif)" + texte;
doc.innerHTML += "<a id=\'rolleyes\' title=\'rolleyes\' href=\'#\' onclick=\"BBCodes.insert('
rolleyes.gif', '
');return false;\"><span style=\'display:inline-block; zoom:1; *display:inline; background:url(http://forum.guerretribale.fr/images/smilies/rolleyes.gif)" + texte;
doc.innerHTML += "<a id=\'cool\' title=\'cool\' href=\'#\' onclick=\"BBCodes.insert('
cool.gif', '
');return false;\"><span style=\'display:inline-block; zoom:1; *display:inline; background:url(http://forum.guerretribale.fr/images/smilies/cool.gif)" + texte;
doc.innerHTML += "<a id=\'eek\' title=\'eek\' href=\'#\' onclick=\"BBCodes.insert('
eek.gif', '
');return false;\"><span style=\'display:inline-block; zoom:1; *display:inline; background:url(http://forum.guerretribale.fr/images/smilies/eek.gif)" + texte;

}
bb_code();
}
})();[/CODE]

Gandaflerouge, mes scripts sont-ils acceptés d'office ? puisque ceux de Virza le sont !

PS : Il faut citer mon message, et copier le code pour que l'UserScript marche, car le forum de GT prend quelques signes du code et les changes !

Pourquoi chez moi ça ne marche pas :(

[27/05/2011 21:54:20] JavaScript - http://zz1.beta.tribalwars.net/game.php?village=5011&screen=mail&mode=view&view=27364&group_id=0
User Javascript thread
Uncaught exception: TypeError: Cannot convert 'doc' to object
Error thrown at line 6, column 2 in bb_code1():
doc.innerHTML += "<a id=\'code\' title=\'Code\' href=\'#\' onclick=\"BBCodes.insert('
Code:
', '
');return false;\"><span style=\'display:inline-block; zoom:1; *display:inline; background:url(http://forum.guerretribale.fr/images/editor/code.gif) no-repeat 0px 0px; padding-left: 0px; padding-bottom:0px; margin-right: 2px; margin-bottom:3px; width: 20px; height: 20px\'>&nbsp;</span></a>";
called from line 8, column 1 in <anonymous function>():
bb_code1();
called from line 2, column 0 in program code:
(function () {
 

DeletedUser

Guest
j'ai modifié le script il y avait un espace en trop !

Virza, j'ai modifié ton userscript pour mettre les smileys de Guerre tribale, voila le code :
Je rajoute qu'il marche sur firefox, et pas seulement sur Opéra comme l'avais dit Virza

Code:
javascript:
(function ()	{  
	if(document.URL.indexOf('&screen=mail&mode')!= -1)  {  
	function bb_code1() {  
		var doc = document.getElementById('bb_bar');  
		doc.innerHTML += "<a id=\'code\' title=\'Code\' href=\'#\' onclick=\"BBCodes.insert('[code]', '
');return false;\"><span style=\'display:inline-block; zoom:1; *display:inline; background:url(http://forum.guerretribale.fr/images/editor/code.gif) no-repeat 0px 0px; padding-left: 0px; padding-bottom:0px; margin-right: 2px; margin-bottom:3px; width: 20px; height: 20px\'>&nbsp;</span></a>";
}
bb_code1();
}
if(document.URL.indexOf('&screen=forum&screenmode=view')!= -1 || document.URL.indexOf('&screen=forum&mode=') != -1) {
function bb_code() {
var doc = document.getElementById('bb_bar');
var texte = "no-repeat 0px 0px; padding-left: 0px; padding-bottom:0px; margin-right: 2px; margin-bottom:3px; width: 20px; height: 20px\'>&nbsp;</span></a>";
doc.innerHTML += "<a id=\'code\' title=\'Code\' href=\'#\' onclick=\"BBCodes.insert('
Code:
', '
');return false;\"><span style=\'display:inline-block; zoom:1; *display:inline; background:url(http://forum.guerretribale.fr/images/editor/code.gif)" + texte;
doc.innerHTML += "<a id=\'tongue\' title=\'tongue\' href=\'#\' onclick=\"BBCodes.insert('
tongue.gif', '
');return false;\"><span style=\'display:inline-block; zoom:1; *display:inline; background:url(http://forum.guerretribale.fr/images/smilies/tongue.gif)" + texte;
doc.innerHTML += "<a id=\'redface\' title=\'redface\' href=\'#\' onclick=\"BBCodes.insert('
redface.gif', '
');return false;\"><span style=\'display:inline-block; zoom:1; *display:inline; background:url(http://forum.guerretribale.fr/images/smilies/redface.gif)" + texte;
doc.innerHTML += "<a id=\'confused\' title=\'confused\' href=\'#\' onclick=\"BBCodes.insert('
confused.gif', '
');return false;\"><span style=\'display:inline-block; zoom:1; *display:inline; background:url(http://forum.guerretribale.fr/images/smilies/confused.gif)" + texte;
doc.innerHTML += "<a id=\'wink\' title=\'wink\' href=\'#\' onclick=\"BBCodes.insert('
wink.gif', '
');return false;\"><span style=\'display:inline-block; zoom:1; *display:inline; background:url(http://forum.guerretribale.fr/images/smilies/wink.gif)" + texte;
doc.innerHTML += "<a id=\'smile\' title=\'smile\' href=\'#\' onclick=\"BBCodes.insert('
smile.gif', '
');return false;\"><span style=\'display:inline-block; zoom:1; *display:inline; background:url(http://forum.guerretribale.fr/images/smilies/smile.gif)" + texte;
doc.innerHTML += "<a id=\'biggrin\' title=\'biggrin\' href=\'#\' onclick=\"BBCodes.insert('
biggrin.gif', '
');return false;\"><span style=\'display:inline-block; zoom:1; *display:inline; background:url(http://forum.guerretribale.fr/images/smilies/biggrin.gif)" + texte;
doc.innerHTML += "<a id=\'frown\' title=\'frown\' href=\'#\' onclick=\"BBCodes.insert('
frown.gif', '
');return false;\"><span style=\'display:inline-block; zoom:1; *display:inline; background:url(http://forum.guerretribale.fr/images/smilies/frown.gif)" + texte;
doc.innerHTML += "<a id=\'mad\' title=\'mad\' href=\'#\' onclick=\"BBCodes.insert('
mad.gif', '
');return false;\"><span style=\'display:inline-block; zoom:1; *display:inline; background:url(http://forum.guerretribale.fr/images/smilies/mad.gif)" + texte;
doc.innerHTML += "<a id=\'rolleyes\' title=\'rolleyes\' href=\'#\' onclick=\"BBCodes.insert('
rolleyes.gif', '
');return false;\"><span style=\'display:inline-block; zoom:1; *display:inline; background:url(http://forum.guerretribale.fr/images/smilies/rolleyes.gif)" + texte;
doc.innerHTML += "<a id=\'cool\' title=\'cool\' href=\'#\' onclick=\"BBCodes.insert('
cool.gif', '
');return false;\"><span style=\'display:inline-block; zoom:1; *display:inline; background:url(http://forum.guerretribale.fr/images/smilies/cool.gif)" + texte;
doc.innerHTML += "<a id=\'eek\' title=\'eek\' href=\'#\' onclick=\"BBCodes.insert('
eek.gif', '
');return false;\"><span style=\'display:inline-block; zoom:1; *display:inline; background:url(http://forum.guerretribale.fr/images/smilies/eek.gif)" + texte;

}
bb_code();
}
})();[/CODE]

Gandaflerouge, mes scripts sont-ils acceptés d'office ? puisque ceux de Virza le sont !

PS : Il faut citer mon message, et copier le code pour que l'UserScript marche, car le forum de GT prend quelques signes du code et les changes !


J'ai jamais dit que mon script ne marchait pas sous firefox
Relis bien, j'ai donné une deuxième version (donc celle que tu proposes là maintenant et dont tu as changé les smileys, pas celle citée dans ton premier post) qui fonctionne sous tous les navigateurs.
De plus, ce n'est pas un userscript hein, userscript c'est intégré au navigateur.
 
Dernière édition par un modérateur:

DeletedUser

Guest
Pourquoi chez moi ça ne marche pas :(

[27/05/2011 21:54:20] JavaScript - http://zz1.beta.tribalwars.net/game.php?village=5011&screen=mail&mode=view&view=27364&group_id=0
User Javascript thread
Uncaught exception: TypeError: Cannot convert 'doc' to object
Error thrown at line 6, column 2 in bb_code1():
doc.innerHTML += "<a id=\'code\' title=\'Code\' href=\'#\' onclick=\"BBCodes.insert('
Code:
', '
');return false;\"><span style=\'display:inline-block; zoom:1; *display:inline; background:url(http://forum.guerretribale.fr/images/editor/code.gif) no-repeat 0px 0px; padding-left: 0px; padding-bottom:0px; margin-right: 2px; margin-bottom:3px; width: 20px; height: 20px\'>&nbsp;</span></a>";
called from line 8, column 1 in <anonymous function>():
bb_code1();
called from line 2, column 0 in program code:
(function () {

Tu est sur que tu as bien citer mon message ??
j'ai dit qu'il ne fallais pas copier/coller directement, tu cite mon message, et la tu copi-colle le javascript !!
Je viens de réessayer et ça marche chez moi !

Virza, j'ai du mal comprendre pour ta phrase sur Opéra alors ^^
C'est pas un Userscript ?? dans ton titre tu as bien mis [USERSCRIPT] Ajoute de BB-code smileys !! non ??
 

DeletedUser

Guest
loooooooooool

Va relire mon post, tu vois que j'y ai donné deux scripts ^^!
Le premier est un userscript, le deuxième (celui que tu as repris) est un script pour quickbar
 

DeletedUser

Guest
J'ai pas réussis a faire fonctionner ton premier script, (sur opéra bien sur)
j'ai peut être oublier 1 ou 2 ***
Tu veux pas le modifier toi même lol ??? (et le mettre sans *** c'est casse cou**** a enlever)
 
Haut