Tektek Emotes + Autoformat

Adds Tektek Emotes/gaiArch to gaia post (works in Chrome also) also adds Tektek Autoformat (Firefox only)

  1. // ==UserScript==
  2. // @name Tektek Emotes + Autoformat
  3. // @description Adds Tektek Emotes/gaiArch to gaia post (works in Chrome also) also adds Tektek Autoformat (Firefox only)
  4. // @include http://www.gaiaonline.com/forum/compose/*
  5. // @include http://www.gaiaonline.com/profiles/?*mode=addcomment*
  6. // @include http://www.gaiaonline.com/profiles?*mode=addcomment*
  7. // @include http://www.gaiaonline.com/p/?*mode=addcomment*
  8. // @include http://www.gaiaonline.com/p?*mode=addcomment*
  9. // @include http://www.gaiaonline.com/profiles/*?*mode=addcomment*
  10. // @include http://www.gaiaonline.com/p/*?*mode=addcomment*
  11. // @include http://www.gaiaonline.com/p/*/?*mode=addcomment*
  12. // @include http://www.gaiaonline.com/guilds/posting.php*
  13. // @include http://www.gaiaonline.com/forum/*/t.*
  14. // @include http://www.gaiaonline.com/profile/privmsg.php*
  15. // @include http://www.gaiaonline.com/j/*mode=*
  16. // @include http://www.gaiaonline.com/j/
  17. // @include http://www.gaiaonline.com/journal/*mode=*
  18. // @include http://www.gaiaonline.com/journal/
  19. // @include http://www.gaiaonline.com/marketplace/editstore*
  20. // @include http://www.gaiaonline.com/account/about*
  21. // @include http://www.gaiaonline.com/account/signature*
  22. // @include http://www.gaiaonline.com/p?*mode=edit*
  23. // @include http://www.gaiaonline.com/p/?*mode=edit*
  24. // @include http://www.gaiaonline.com/profiles?*mode=edit*
  25. // @include http://www.gaiaonline.com/profiles/?*mode=edit*
  26. // @include http://www.gaiaonline.com/profiles/*/*?mode=edit
  27. // @include http://www.gaiaonline.com/guilds/admin/masspm/id.*
  28. // @resource background http://i48.tinypic.com/2lbj9et.png
  29. // @resource format1img http://i46.tinypic.com/142bozs.gif
  30. // @resource format2img http://i46.tinypic.com/16iwakz.gif
  31. // @resource format3img http://i48.tinypic.com/w9is7n.gif
  32. // @resource format4img http://i46.tinypic.com/1rx0nr.gif
  33. // @resource format5img http://i32.tinypic.com/w9w6k5.gif
  34. // @namespace http://userscripts.org/users/62850
  35. // @version 4.5.1
  36. // ==/UserScript==
  37.  
  38. var gArch=true;// this is for google chrome (true means gaiArch emotes will appear, false means they will not)
  39. var emote5=false// gaia's non Normal emots sets option for chrome
  40.  
  41. var json=[// tektek emotes
  42. { "name": "Domokun", "code": ":domokun:", "loc": "domokun", "menuloc": "domokun", "size": 15 },
  43. { "name": "DomoKing", "code": ":domoking:", "loc": "domoking", "menuloc": "domokingeye", "size": 15 },
  44. { "name": "Heartbroken", "code": ":heartbroken:", "loc": "heartbroken", "menuloc": "heartbroken", "size": 18 },
  45. { "name": "Hyper", "code": ":hyper:", "loc": "hyper", "menuloc": "hyper", "size": 15 },
  46. { "name": "o_O", "code": ":O_o:", "loc": "o_O", "menuloc": "o_O", "size": 15 },
  47. { "name": "Sick", "code": ":sick:", "loc": "sick", "menuloc": "sick", "size": 15 },
  48. { "name": "x_x", "code": ":X_X:", "loc": "x_x", "menuloc": "x_x", "size": 15 },
  49. { "name": "Worried", "code": ":worried:", "loc": "worried", "menuloc": "worried", "size": 15},
  50. { "name": "^_^", "code": ":^_^:", "loc": "tek", "menuloc": "tek", "size": 15 },
  51. { "name": "Dizzy", "code": ":dizzy:", "loc": "dizzy", "menuloc": "dizzy", "size": 15 },
  52. { "name": "Oh Dear...", "code": ":ohdear:", "loc": "ohdear", "menuloc": "ohdear", "size": 15 },
  53. { "name": "Unwilling", "code": ":unwilling:", "loc": "unwilling", "menuloc": "unwilling", "size": 15 },
  54. { "name": "Mr. Yellow", "code": ":mryellow:", "loc": "mryellow", "menuloc": "mryellow", "size": 15 },
  55. { "name": "Red Ninja", "code": ":ninjared:", "loc": "ninjared", "menuloc": "ninjared", "size": 15 },
  56. { "name": "Green Ninja", "code": ":ninjagreen:", "loc": "ninjagreen", "menuloc": "ninjagreen", "size": 15 },
  57. { "name": "Blue Ninja", "code": ":ninjablue:", "loc": "ninjablue", "menuloc": "ninjablue", "size": 15 },
  58. { "name": "Square", "code": ":square:", "loc": "square", "menuloc": "square", "size": 15 },
  59. { "name": "Grunny", "code": ":grunny:", "loc": "grunny", "menuloc": "grunny", "size": 15 },
  60. { "name": "Grunny Ninja", "code": ":grunnyninja:", "loc": "grunnyninja", "menuloc": "grunnyninja", "size": 15 },
  61. { "name": "GBot", "code": ":gbot:", "loc": "gb", "menuloc": "gb", "size": 17 },
  62. { "name": "Ugh", "code": ":ugh:", "loc": "ugh", "menuloc": "ugh", "size": 18 },
  63. { "name": "Tired", "code": ":tired:", "loc": "tired", "menuloc": "tired", "size": 24 },
  64. { "name": "Cow", "code": ":moo:", "loc": "cow", "menuloc": "cow", "size": 26 },
  65. { "name": "Angel", "code": ":angel:", "loc": "angel", "menuloc": "angel", "size": 35 }
  66. ];// If you are reordering theses watch the comma at the end of the line.
  67.  
  68. var json2=[// gaiArch emotes
  69. { "name": "Angelic", "code": ":angel2:", "loc": "Angel.gif", "size": 27 },
  70. { "name": "Angelic :3", "code": ":angel3:", "loc": "angelsmiley.jpg", "size": 41 },
  71. { "name": "Left arrow", "code": ":leftarrow:", "loc": "0011ar.gif", "size": 15 },
  72. { "name": "Up arrow", "code": ":uparrow:", "loc": "0011ars.gif", "size": 15 },
  73. { "name": "Down arrow", "code": ":downarrow:", "loc": "0011arsy.gif", "size": 15 },
  74. { "name": "Eek", "code": ":eek:", "loc": "001WTh.gif", "size": 15 },
  75. { "name": "Classy :3", "code": ":B3:", "loc": "001cool_shite.gif", "size": 15 },
  76. { "name": ";3 Wink", "code": ";3:", "loc": "001grosss.gif", "size": 15 },
  77. { "name": "Purple whee", "code": ":purplewhee:", "loc": "001noair.gif", "size": 15 },
  78. { "name": "Mweh", "code": ":mweh:", "loc": "002appease.gif", "size": 15 },
  79. { "name": "Meh...", "code": ":meh:", "loc": "002fgape.gif", "size": 15 },
  80. { "name": "Twisted :3", "code": ">:3", "loc": "00EVIL.jpg", "size": 15 },
  81. { "name": "Angry stare", "code": ">__>;;", "loc": "00angrystaree.gif", "size": 15 },
  82. { "name": "Classy :D", "code": "8D", "loc": "00hoshiz.gif", "size": 15 },
  83. { "name": "Classy D:", "code": "D8", "loc": "00mycool.gif", "size": 15 },
  84. { "name": "Confused devil", "code": ">:?", "loc": "01oopp.jpg", "size": 15 },
  85. { "name": "Staring devil", "code": "'>__>'", "loc": "01pissoff.jpg", "size": 15 },
  86. { "name": "Freaky drool", "code": "*v*", "loc": "01whhoo.gif", "size": 15 },
  87. { "name": "Big nod", "code": ":bignod:", "loc": "0BIGnod.gif", "size": 15 },
  88. { "name": "Twisted whee", "code": ":twistedwhee:", "loc": "0LAUGH.jpg", "size": 15 },
  89. { "name": "Looking around :3", "code": ":lookaround:", "loc": "0gassy.gif", "size": 15 },
  90. { "name": "Looking below", "code": ":lookbelow:", "loc": "0icon_eek3.gif", "size": 15 },
  91. { "name": "Sad no", "code": ":no:", "loc": "0nyt.gif", "size": 15 },
  92. { "name": "Unsure no", "code": ":no?:", "loc": "0ohnoes.gif", "size": 15 },
  93. { "name": "Hesitant nod", "code": ":hesitantnod:", "loc": "0sheepish.gif", "size": 15 },
  94. { "name": "Lost", "code": ":lost:", "loc": "0sheepishno.gif", "size": 15 },
  95. { "name": "Angry nod", "code": ":angrynod:", "loc": "0snarl.gif", "size": 15 },
  96. { "name": "Look around :3", "code": ":3lookaround:", "loc": "0whereis.gif", "size": 15 },
  97. { "name": "Shy nod", "code": ":shynod:", "loc": "0whimpyes.gif", "size": 15 },
  98. { "name": "Shy no", "code": ":shyno:", "loc": "0whimpyno.gif", "size": 15 },
  99. { "name": "Nod", "code": ":nod:", "loc": "1atouch_of_gas.gif", "size": 15 },
  100. { "name": "Disgusted XP", "code": ":xpdisgust:", "loc": "1dun_like_et.gif", "size": 15 },
  101. { "name": "Frowning", "code": ":frown:", "loc": "1grr.gif", "size": 16 },
  102. { "name": "Erm...", "code": ":erm:", "loc": "1heheh3.jpg", "size": 15 },
  103. { "name": "Cute smile", "code": ":cutesmile:", "loc": "1mree.gif", "size": 16 },
  104. { "name": "Mustache", "code": ":mustache:", "loc": "1mustache.gif", "size": 15 },
  105. { "name": "Angry no", "code": ":angryno:", "loc": "1never.gif", "size": 15 },
  106. { "name": "Big :3 nod", "code": ":3bignod:", "loc": "1nodnodchap.gif", "size": 15 },
  107. { "name": "Confused look around", "code": ":lookaround?:", "loc": "1notso.gif", "size": 15 },
  108. { "name": "XP No", "code": ":xpno:", "loc": "1noways.gif", "size": 15 },
  109. { "name": "Erm... (down)", "code": ":downerm:", "loc": "1ohh.gif", "size": 15 },
  110. { "name": "Pleeeease ?", "code": ":please:", "loc": "1ooo.gif", "size": 16 },
  111. { "name": "Erm... (Right)", "code": ":righterm:", "loc": "1oy2.jpg", "size": 15 },
  112. { "name": "Cute stare", "code": ":cute|:", "loc": "1poo.gif", "size": 16 },
  113. { "name": "Shocked nod", "code": ":shocknod:", "loc": "1scary.gif", "size": 15 },
  114. { "name": "Erm... (Up)", "code": ":uperm:", "loc": "1sigh4.jpg", "size": 15 },
  115. { "name": "Pervert", "code": ":perv:", "loc": "1smile.gif", "size": 15 },
  116. { "name": "Crying nod", "code": ":T_Tnod:", "loc": "1sob.gif", "size": 15 },
  117. { "name": "Buck teeth", "code": ":B", "loc": "1teeth.gif", "size": 15 },
  118. { "name": "Desperate", "code": ":desperate:", "loc": "1pleaseno.gif", "size": 15 },
  119. { "name": "Gonking nod", "code": ":gonknod:", "loc": "1uhhu.gif", "size": 15 },
  120. { "name": "Cute laugh", "code": ":3laugh:", "loc": "1weeoo.gif", "size": 16 },
  121. { "name": "Smirk", "code": ":smirk:", "loc": "1whistle5.jpg", "size": 15 },
  122. { "name": "Shocked :o", "code": ":shocko:", "loc": "1wo.gif", "size": 15 },
  123. { "name": "Shocked drool", "code": ":shockdrool:", "loc": "1yeah.gif", "size": 15 },
  124. { "name": "No no no...", "code": ":nonono:", "loc": "5oxks1.gif", "size": 15 },
  125. { "name": "Angry eye twitch", "code": ":angryeyetwitch:", "loc": "5oxkxk.gif", "size": 15 },
  126. { "name": "Suspicious stare", "code": ">__>?", "loc": "5oxl49.gif", "size": 15 },
  127. { "name": "Eyebleed", "code": ":eyebleed:", "loc": "5oxlba.gif", "size": 15 },
  128. { "name": "o:", "code": ":o:", "loc": "5oxlco.gif", "size": 15 },
  129. { "name": "Zombie drool", "code": ":zombiedrool:", "loc": "5oxldu.gif", "size": 15 },
  130. { "name": "Happy", "code": ":happy:", "loc": "5oxlhk.gif", "size": 15 },
  131. { "name": "Shiny eyes", "code": ":shiny:", "loc": "5oxlio.gif", "size": 15 },
  132. { "name": "o_O stare", "code": ":o_O:", "loc": "5oxlkg.gif", "size": 15 },
  133. { "name": "Pirate grin", "code": ":pirateD:", "loc": "5oxllf.gif", "size": 15 },
  134. { "name": "Exasperated", "code": "-.-;", "loc": "5oxlp4.gif", "size": 15 },
  135. { "name": "^_^;", "code": "^_^;", "loc": "5oxlr8.gif", "size": 15 },
  136. { "name": "Dead", "code": "X_X", "loc": "5oxlqa.gif", "size": 15 },
  137. { "name": "Suspicious look", "code": "O.o?", "loc": "5oxls2.gif", "size": 15 },
  138. { "name": "Happy happy !", "code": "^-^", "loc": "5oxlvl.gif", "size": 15 },
  139. { "name": "Feline", "code": ":feline:", "loc": "5ozcb9.gif", "size": 15 },
  140. { "name": "Huge grin", "code": ":hugegrin:", "loc": "5ozi3d.gif", "size": 15 },
  141. { "name": "Eww", "code": ":eww:", "loc": "5ozic6.gif", "size": 15 },
  142. { "name": "Twitch", "code": ":twitch:", "loc": "5p0dqe.gif", "size": 15 },
  143. { "name": "Yawn", "code": ":yawn:", "loc": "5pl7yb.gif", "size": 19 },
  144. { "name": "Sick", "code": ":sick2:", "loc": "5plb92.gif", "size": 15 },
  145. { "name": "Sleeping", "code": ":sleeping:", "loc": "5pn2hu.gif", "size": 20 },
  146. { "name": "@_@ Confused", "code": "@_@", "loc": "5vzt7a.gif", "size": 15 },
  147. { "name": "Umpf !", "code": ":umpf:", "loc": "twitchy5rv.gif", "size": 17 },
  148. { "name": "Enraged", "code": ":rage:", "loc": "die.gif", "size": 16 },
  149. { "name": "Shocked pout", "code": ":shock(:", "loc": "eww.gif", "size": 15 },
  150. { "name": "Shocked look around", "code": ":shocklookaround:", "loc": "icon_eekpeek.gif", "size": 15 },
  151. { "name": "Sly", "code": ":sly:", "loc": "hmm.jpg", "size": 15 },
  152. { "name": "Neko :3 nod", "code": ":neko3:", "loc": "DkFoxyEmo.gif", "size": 17 },
  153. { "name": "Heart stare", "code": ":heartstare:", "loc": "smi_hearts.gif", "size": 15 },
  154. { "name": "Heart whee", "code": ":heartwhee:", "loc": "mreeheart.gif", "size": 17 },
  155. { "name": "Heart whee (blinking)", "code": ":heartwhee2:", "loc": "singlemree.gif", "size": 17 },
  156. { "name": "Triple heart", "code": ":heartwhee3:", "loc": "luffsmrees.gif", "size": 17 },
  157. { "name": "Triple heart whee (+Bounce)", "code": ":heartwheebounce:", "loc": "squishmree.gif", "size": 17 },
  158. { "name": "Demonic heart", "code": ":demonicheart:", "loc": "bloufla.gif", "size": 39 },
  159. { "name": "Hellish heart", "code": ":hellishheart:", "loc": "flamewin.gif", "size": 39 },
  160. { "name": "Winged heart", "code": ":wingedheart:", "loc": "n20qwh.gif", "size": 30 },
  161. { "name": "Winged yin yang heart", "code": ":wingedyinyangheart:", "loc": "Half.gif", "size": 30 },
  162. { "name": "Broken heart", "code": ":</3:", "loc": "brokeman.gif", "size": 16 },
  163. { "name": "Heart", "code": ":<3:", "loc": "darkreh.gif", "size": 15 },
  164. { "name": "Red heart (Shiny)", "code": ":redheartshiny:", "loc": "thred.gif", "size": 15 },
  165. { "name": "Pink heart", "code": ":pinkheart:", "loc": "lightpink.gif", "size": 15 },
  166. { "name": "Purple heart", "code": ":purpleheart:", "loc": "purple3.gif", "size": 15 },
  167. { "name": "Mauve heart", "code": ":mauveheart:", "loc": "purplehearty.gif", "size": 15 },
  168. { "name": "Darkblue heart", "code": ":darkblueheart:", "loc": "drableuh.gif", "size": 15 },
  169. { "name": "Blue heart", "code": ":blueheart:", "loc": "blooheart.gif", "size": 15 },
  170. { "name": "Light blue heart", "code": ":lightblueheart:", "loc": "LightBlueHeart.gif", "size": 15 },
  171. { "name": "Orange heart", "code": ":orangeheart:", "loc": "heartorange.gif", "size": 15 },
  172. { "name": "Green heart", "code": ":greenheart:", "loc": "greenhar.gif", "size": 15 },
  173. { "name": "Light green heart", "code": ":lightgreenheart:", "loc": "s2hart.gif", "size": 15 },
  174. { "name": "Lime heart", "code": ":limeheart:", "loc": "sabiha.gif", "size": 15 },
  175. { "name": "Black heart", "code": ":blackheart:", "loc": "thblackk.gif", "size": 11 },
  176. { "name": "Black heart (Shiny)", "code": ":blackheartshiny:", "loc": "thicon_heart.gif", "size": 15 },
  177. { "name": "Skull heart", "code": ":skullheart:", "loc": "skullhea.gif", "size": 15 },
  178. { "name": "Ninja heart!", "code": ":ninjaheart:", "loc": "ninhr.gif", "size": 15 },
  179. { "name": "Ninja heart (still)", "code": ":ninjaheartstill:", "loc": "slowerninjie.gif", "size": 15 },
  180. { "name": "Ninja heart (quick)", "code": ":ninjaheartquick:", "loc": "stillninj.gif", "size": 15 },
  181. { "name": "Rose", "code": ":rose:", "loc": "rose.gif", "size": 12 },
  182. { "name": "Sun", "code": ":sun:", "loc": "fastersun.gif", "size": 15 },
  183. { "name": "Sun (still)", "code": ":stillsun:", "loc": "ridiculous_sun_X3.gif", "size": 17 },
  184. { "name": "Sun (slow)", "code": ":sunslow:", "loc": "slowsun.gif", "size": 15 },
  185. { "name": "Unsatisfied", "code": ":unsatisfied:", "loc": "thcranky.gif", "size": 17 },
  186. { "name": "Angry cat", "code": ":angrycat:", "loc": "thenraged.gif", "size": 17 },
  187. { "name": "!!! cat", "code": ":!!!cat:", "loc": "thshocked.gif", "size": 17 },
  188. { "name": "Pee", "code": ":pee:", "loc": "thpiss.gif", "size": 17 },
  189. { "name": "Happy cat", "code": ":happycat:", "loc": "thkisses.gif", "size": 17 },
  190. { "name": "Potion", "code": ":potion:", "loc": "chemicalbubble.gif", "size": 9 },
  191. { "name": "Poo", "code": ":pco:", "loc": "suspiciouspoo.gif", "size": 28 },
  192. { "name": "World", "code": ":world:", "loc": "terre-01.gif", "size": 15 },
  193. { "name": "Globe", "code": ":globe:", "loc": "terre-29.gif", "size": 17 },
  194. { "name": "Blue giftbox", "code": ":bluegiftbox:", "loc": "giftbbox.gif", "size": 24 },
  195. { "name": "Pink giftbox", "code": ":pinkgiftbox:", "loc": "giftboxpi.gif", "size": 24 },
  196. { "name": "Santa robot", "code": ":santarobot:", "loc": "santa_ani.gif", "size": 17 },
  197. { "name": "Badger badger badger !", "code": ":badger:", "loc": "badger.gif", "size": 17 },
  198. { "name": "Easter bunny", "code": ":easterbunny:", "loc": "easter_bunny_ani.gif", "size": 16 },
  199. { "name": "Carrot", "code": ":carrot:", "loc": "Carrotbullet.gif", "size": 18 },
  200. { "name": "Green apple", "code": ":greenapple:", "loc": "5oyyz7.gif", "size": 15 },
  201. { "name": "Grunny domo", "code": ":grunnydomo:", "loc": "thgrunny.gif", "size": 15 },
  202. { "name": "Green domo", "code": ":greendomo:", "loc": "GreenDomoGIF.gif", "size": 15 },
  203. { "name": "Pink domo", "code": ":pinkdomo:", "loc": "pinkdomo.gif", "size": 15 },
  204. { "name": "Domogod", "code": ":domogod:", "loc": "f4el28.gif", "size": 15 },
  205. { "name": "O rlmente?", "code": ":orlmente:", "loc": "orlmente.jpg", "size": 17 },
  206. { "name": ">{)> owl", "code": ">{)>", "loc": "OwlStarecar.jpg", "size": 15 },
  207. { "name": "Buttsecks", "code": ":buttsecks:", "loc": "lol.jpg", "size": 19 },
  208. { "name": "Demonic ghost", "code": ":demonicghost:", "loc": "demon.gif", "size": 25 },
  209. { "name": "Angelic ghost", "code": ":angelghost:", "loc": "Ghost1.gif", "size": 60 }
  210. ];// If you are reordering theses watch the comma at the end of the line.
  211.  
  212.  
  213. json4=[// gaia emotes
  214. {"class": "biggrin", "text": "Very Happy", "code": ":D"},
  215. {"class": "smile", "text": "Smile", "code": ":)"},
  216. {"class": "embarassed", "text": "Embarassed", "code": ":oops:"},
  217. {"class": "crying", "text": "Crying", "code": "T_T"},
  218. {"class": "stare", "text": "Stare", "code": ":stare:"},
  219. {"class": "xd", "text": "XD", "code": ":XD"},
  220. {"class": "nodding", "text": ":3 Nodding", "code": ":3nod:"},
  221. {"class": "biglaugh", "text": "Big Laugh", "code": ":big:"},
  222. {"class": "gonk", "text": "Gonk", "code": ":gonk:"},
  223. {"class": "scream", "text": "Scream", "code": ":scream:"},
  224. {"class": "stressed", "text": "Stressed", "code": ":vein:"},
  225. {"class": "sweat", "text": "Sweat", "code": ":sweat:"},
  226. {"class": "heart", "text": "Heart", "code": ":heart:"},
  227. {"class": "xp", "text": "XP", "code": ":xp:"},
  228. {"class": "whee", "text": "Whee!", "code": ":whee:"},
  229. {"class": "wink", "text": "Wink", "code": ":wink:"},
  230. {"class": "sad", "text": "Sad", "code": ":("},
  231. {"class": "surprised", "text": "Surprised", "code": ":o"},
  232. {"class": "shocked", "text": "Shocked", "code": ":shock:"},
  233. {"class": "confused", "text": "Confused", "code": ":?"},
  234. {"class": "cool", "text": "Cool", "code": "8)"},
  235. {"class": "laughing", "text": "Laughing", "code": ":lol:"},
  236. {"class": "mad", "text": "Mad", "code": ":x"},
  237. {"class": "razz", "text": "Razz", "code": ":P"},
  238. {"class": "verysad", "text": "Very sad", "code": ":cry:"},
  239. {"class": "evil", "text": "Evil", "code": ":evil:"},
  240. {"class": "twisted", "text": "Twisted evil", "code": ":twisted:"},
  241. {"class": "rolleyes", "text": "Rolling eyes", "code": ":roll:"},
  242. {"class": "exclaim", "text": "Exclamation!", "code": ":!:"},
  243. {"class": "question", "text": "Question?", "code": ":?:"},
  244. {"class": "idea", "text": "Idea", "code": ":idea:"},
  245. {"class": "arrow", "text": "Arrow", "code": ":arrow:"},
  246. {"class": "neutral", "text": "Neutral", "code": ":|"},
  247. {"class": "mrgreen", "text": "Mr. Green", "code": ":mrgreen:"},
  248. {"class": "ninja", "text": "Ninja", "code": ":ninja:"},
  249. {"class": "cutelaugh", "text": "Cute laugh", "code": ":cute:"},
  250. {"class": "rofl", "text": "ROFL", "code": ":rofl:"},
  251. {"class": "pirate", "text": "Pirate", "code": ":pirate:"},
  252. {"class": "talk2hand", "text": "Talk to the hand", "code": ":talk2hand:"},
  253. {"class": "burning", "text": "AUGH! My eyes!", "code": ":burning:"},
  254. {"class": "cheese", "text": "Cheese and whine", "code": ":cheese:"},
  255. {"class": "dramallama", "text": "Drama llama", "code": ":dramallama:"},
  256. {"class": "wahmbulance", "text": "Wahhhhhmbulance", "code": ":wahmbulance:"},
  257. {"class": "emo", "text": "Emo", "code": ":emo:"}
  258. ];
  259.  
  260. json5=[// new gaia emotes
  261. {"class": "cat_biggrin", "text": "Very Happy", "code": ":cat_biggrin:"},
  262. {"class": "cat_smile", "text": "Smile", "code": ":cat_smile:"},
  263. {"class": "cat_embarassed", "text": "Embarassed", "code": ":cat_oops:"},
  264. {"class": "cat_crying", "text": "Crying", "code": ":cat_crying:"},
  265. {"class": "cat_stare", "text": "Stare", "code": ":cat_stare:"},
  266. {"class": "cat_xd", "text": "XD", "code": ":cat_XD:"},
  267. {"class": "cat_nodding", "text": ":3 Nodding", "code": ":cat_3nod:"},
  268. {"class": "cat_biglaugh", "text": "Big Laugh", "code": ":cat_big:"},
  269. {"class": "cat_gonk", "text": "Gonk", "code": ":cat_gonk:"},
  270. {"class": "cat_scream", "text": "Scream", "code": ":cat_scream:"},
  271. {"class": "cat_stressed", "text": "Stressed", "code": ":cat_vein:"},
  272. {"class": "cat_sweat", "text": "Sweat", "code": ":cat_sweat:"},
  273. {"class": "cat_xp", "text": "XP", "code": ":cat_xp:"},
  274. {"class": "cat_whee", "text": "Whee!", "code": ":cat_whee:"},
  275. {"class": "cat_wink", "text": "Wink", "code": ":cat_wink:"},
  276. {"class": "cat_sad", "text": "Sad", "code": ":cat_sad:"},
  277. {"class": "cat_surprised", "text": "Surprised", "code": ":cat_aie:"},
  278. {"class": "cat_shocked", "text": "Shocked", "code": ":cat_eek:"},
  279. {"class": "cat_confused", "text": "Confused", "code": ":cat_???:"},
  280. {"class": "cat_cool", "text": "Cool", "code": ":cat_cool:"},
  281. {"class": "cat_laughing", "text": "Laughing", "code": ":cat_lol:"},
  282. {"class": "cat_mad", "text": "Mad", "code": ":cat_mad:"},
  283. {"class": "cat_razz", "text": "Razz", "code": ":cat_razz:"},
  284. {"class": "cat_verysad", "text": "Very sad", "code": ":cat_cry:"},
  285. {"class": "cat_evil", "text": "Evil", "code": ":cat_evil:"},
  286. {"class": "cat_twisted", "text": "Twisted evil", "code": ":cat_twisted:"},
  287. {"class": "cat_rolleyes", "text": "Rolling eyes", "code": ":cat_roll:"},
  288. {"class": "cat_exclaim", "text": "Exclamation!", "code": ":cat_!:"},
  289. {"class": "cat_question", "text": "Question?", "code": ":cat_?:"},
  290. {"class": "cat_idea", "text": "Idea", "code": ":cat_idea:"},
  291. {"class": "cat_arrow", "text": "Arrow", "code": ":cat_arrow:"},
  292. {"class": "cat_neutral", "text": "Neutral", "code": ":cat_neutral:"},
  293. {"class": "cat_mrgreen", "text": "Mr. Green", "code": ":cat_mrgreen:"},
  294. {"class": "cat_ninja", "text": "Ninja", "code": ":cat_ninja:"},
  295. {"class": "cat_cutelaugh", "text": "Cute laugh", "code": ":cat_cute:"},
  296. {"class": "cat_rofl", "text": "ROFL", "code": ":cat_rofl:"},
  297. {"class": "cat_pirate", "text": "Pirate", "code": ":cat_pirate:"},
  298. {"class": "cat_talk2hand", "text": "Talk to the hand", "code": ":cat_talk2hand:"},
  299. {"class": "cat_burning", "text": "AUGH! My eyes!", "code": ":cat_burning:"},
  300. {"class": "cat_emo", "text": "Emo", "code": ":cat_emo:"},
  301. {"class": "yum_burger", "text": "Burger", "code": ":burger:"},
  302. {"class": "yum_cupcake", "text": "Cupcake", "code": ":cupcake:"},
  303. {"class": "yum_donut", "text": "Donut", "code": ":donut:"},
  304. {"class": "yum_hotdog", "text": "Hotdog", "code": ":hotdog:"},
  305. {"class": "yum_onigiri", "text": "Onigiri", "code": ":onigiri:"},
  306. {"class": "yum_pie", "text": "Pie", "code": ":pie:"},
  307. {"class": "yum_pizza", "text": "Pizza", "code": ":pizza:"},
  308. {"class": "yum_puddi", "text": "Puddi", "code": ":puddi:"},
  309. {"class": "yum_strawberry", "text": "Strawberry", "code": ":strawberry:"},
  310. {"class": "yum_tea", "text": "Tea", "code": ":tea:"},
  311. {"class": "yum_bacon", "text": "Bacon", "code": ":bacon:"},
  312. {"class": "yum_coldone", "text": "Cold One", "code": ":coldone:"},
  313. {"class": "yum_icecreampie", "text": "Ice Cream Pie", "code": ":icecreampie:"},
  314. {"class": "yum_pumpkinpie", "text": "Pumpkin Pie", "code": ":pumpkinpie:"},
  315. {"class": "yum_salmon", "text": "Salmon", "code": ":salmon:"},
  316. {"class": "yum_sausage", "text": "Sausage", "code": ":sausage:"},
  317. {"class": "yum_shrimp", "text": "Shrimp", "code": ":shrimp:"},
  318. {"class": "yum_strawberrypie", "text": "Strawberry Pie", "code": ":strawberrypie:"},
  319. {"class": "yum_tamago", "text": "Tamago", "code": ":tamago:"},
  320. {"class": "yum_tuna", "text": "Tuna", "code": ":tuna:"},
  321. {"class": "yum_wasabipie", "text": "Wasabi Pie", "code": ":wasabipie:"},
  322. {"class": "emotion_awesomeface", "text": "Awesomeface", "code": ":awesome:"},
  323. {"class": "emotion_dealwithit", "text": "Deal with it", "code": ":dealwithit:"},
  324. {"class": "emotion_facepalm", "text": "Facepalm", "code": ":facepalm:"},
  325. {"class": "emotion_bigheart", "text": "Big heart", "code": ":bigheart:"},
  326. {"class": "emotion_jawdrop", "text": "Jawdrop", "code": ":jawdrop:"},
  327. {"class": "emotion_kirakira", "text": "Kira kira", "code": ":kirakira:"},
  328. {"class": "emotion_omnomnom", "text": "Omnomnom", "code": ":omnomnom:"},
  329. {"class": "emotion_puke", "text": "Puke", "code": ":puke:"},
  330. {"class": "emotion_sweatdrop", "text": "Sweatdrop", "code": ":sweatdrop:"},
  331. {"class": "emotion_bigvein", "text": "Big vein", "code": ":bigvein:"},
  332. {"class": "emotion_yatta", "text": "Yatta", "code": ":yatta:"},
  333. {"class": "emotion_0A0", "text": "0A0", "code": ":0a0:"},
  334. {"class": "emotion_8c", "text": "8C", "code": ":8c:"},
  335. {"class": "emotion_bandaid", "text": "Bandaid", "code": ":bandaid:"},
  336. {"class": "emotion_brofist", "text": "Brofist", "code": ":brofist:"},
  337. {"class": "emotion_c8", "text": "C8", "code": ":c8:"},
  338. {"class": "emotion_donotwant", "text": "Do Not Want", "code": ":donotwant:"},
  339. {"class": "emotion_dowant", "text": "Do Want", "code": ":dowant:"},
  340. {"class": "emotion_drool", "text": "Drool", "code": ":drool:"},
  341. {"class": "emotion_eyebrow", "text": "Eyebrow", "code": ":eyebrow:"},
  342. {"class": "emotion_hug", "text": "Hug", "code": ":hug:"},
  343. {"class": "emotion_zombie", "text": "Zombie", "code": ":zombie:"},
  344. {"class": "emotion_zzz", "text": "Zzz", "code": ":zzz:"},
  345. {"class": "gaia_angelleft", "text": "Angel wing left", "code": ":angelleft:"},
  346. {"class": "gaia_angelright", "text": "Angel wing right", "code": ":angelright:"},
  347. {"class": "gaia_crown", "text": "Crown", "code": ":crown:"},
  348. {"class": "gaia_gaiagold", "text": "Gaia Gold", "code": ":gaiagold:"},
  349. {"class": "gaia_nitemareleft", "text": "Nitemare left", "code": ":nitemareleft:"},
  350. {"class": "gaia_nitemareright", "text": "Nitemare right", "code": ":nitemareright:"},
  351. {"class": "gaia_spoons", "text": "Spoons", "code": ":spoons:"},
  352. {"class": "gaia_star", "text": "Star", "code": ":star:"},
  353. {"class": "gaia_kittenstar", "text": "Kittenstar", "code": ":kittenstar:"},
  354. {"class": "gaia_diamond", "text": "Diamond", "code": ":diamond:"}
  355. ];
  356. if(typeof GM_setValue != 'undefined' && typeof GM_getResourceURL != 'undefined'){
  357. if(GM_getValue('fakeValue','isFake')=='isFake'){
  358. var isFF=true;
  359. gArch=GM_getValue("GA_support",true);
  360. emote5=GM_getValue("GFE_support",false);
  361. if(typeof JSON=='object'){
  362. var json3=JSON.parse(GM_getValue('emotes','[]'));
  363. }
  364. }
  365. else{
  366. var isFF=false;
  367. var json3=[//custom emotes for old versions of Firefox
  368. //{ "name": "I ♥ Firefox", "code":":i<3ff:", "loc":"http://i251.photobucket.com/albums/gg311/OoTLink/1523015719438d778f7ac51.gif", "size": 41 }
  369. ];
  370. }
  371. }
  372. else{
  373. var isFF=false;
  374. var json3=[//custom emotes for Google Chrome
  375. //{ "name": "I ♥ Firefox", "code":":i<3ff:", "loc":"http://i251.photobucket.com/albums/gg311/OoTLink/1523015719438d778f7ac51.gif", "size": 41 }
  376. ];
  377. }
  378. function getId(id){
  379. return document.getElementById(id);
  380. }
  381. function getClass(c){
  382. return document.getElementsByClassName(c)[0];
  383. }
  384. function getName(n){
  385. return document.getElementsByName(n)[0];
  386. }
  387. function getTag(t){
  388. return document.getElementsByTagName(t)[0];
  389. }
  390. function getEle(tag,attr,val){
  391. return document.evaluate('.//'+tag+'[@'+attr+'="'+val+'"]', document, null, 9, null).singleNodeValue;
  392. }
  393. function sendEvent(ele,e){
  394. var evt = document.createEvent("HTMLEvents");
  395. evt.initEvent(e, true, true);
  396. ele.dispatchEvent(evt);
  397. }
  398. function inArray(arr,val){
  399. if((arr.constructor==Array)===false){
  400. if(arr.toString().indexOf(',')!=-1){
  401. arr=arr.split(',');
  402. }
  403. else{
  404. if(arr==val){
  405. return true;
  406. }
  407. else{
  408. return false;
  409. }
  410. }
  411. }
  412. for(var i=0;i<arr.length;i++){
  413. if(arr[i]==val){
  414. return true;
  415. }
  416. }
  417. return false;
  418. }
  419. function objectsCount(obj){
  420. if(typeof obj.length=='number'){
  421. return obj.length;
  422. }
  423. var ct=0;
  424. for(var i in obj){
  425. ct++;
  426. }
  427. return ct;
  428. }
  429. function relocate(p,t,b){
  430. if(b){
  431. p.insertBefore(t,b);
  432. }
  433. else{
  434. p.appendChild(t);
  435. }
  436. }
  437. function toTitleCase(str){
  438. if(str.indexOf(' ')!=-1){
  439. var arr=str.split(' ');
  440. var newStr='';
  441. var end;
  442. for(var i=0;i<arr.length;i++){
  443. end=arr[i].slice(1).toLowerCase()+' ';
  444. if(end.indexOf(']')!=-1){
  445. end=toTitleCaseCode(end);
  446. }
  447. newStr+=arr[i].substr(0,1).toUpperCase()+end;
  448. }
  449. return newStr.slice(0,newStr.length-1);
  450. }
  451. else if(str.indexOf(']')!=-1){
  452. return toTitleCaseCode(str);
  453. }
  454. else if(str.length>1){
  455. return str.slice(0,1).toUpperCase()+str.slice(1).toLowerCase();
  456. }
  457. else{
  458. return str.toUpperCase();
  459. }
  460. }
  461. function toTitleCaseCode(str){
  462. if(str.indexOf(']')){
  463. var arr=str.split(']');
  464. var newStr='';
  465. for(var i=0;i<arr.length;i++){
  466. newStr+=arr[i].substr(0,1).toUpperCase()+arr[i].slice(1).toLowerCase()+']';
  467. }
  468. return newStr.slice(0,newStr.length-1);
  469. }
  470. else{
  471. return str;
  472. }
  473. }
  474. // I hope people don't abuse this function
  475. function toAlternateCase(str){// function credit http://userscripts.org/topics/35015#posts-168534
  476. var newStr="";
  477. for(var i=0;i<str.length;i++){
  478. newStr+=str.charAt(i)["to"+(i&1?"Upp":"Low")+"erCase"]();
  479. }
  480. return newStr;
  481. }
  482. function str2regExStr(str){
  483. return str.replace(/([\[\]/()$\\\|\.\+?^\*])/g,"\\$1");
  484. /*var needles='\\,/,^,?,|,(,),$,*,+,[,]'.split(',');
  485. for(var i=0;i<needles.length;i++){
  486. if(str.indexOf(needles[i])!=-1){
  487. str=str.replace(new RegExp('\\'+needles[i],'g'),'\\'+needles[i]);
  488. }
  489. }
  490. return str;*/
  491. }
  492. function gaiaEmotesReload(){// tired of waiting for gaia to fix YAHOO.gaia.Emotes.reload();
  493. var list=getId('emoticon_set'),html='',emotes=unsafeWindow.YAHOO.gaia.Emotes,b=list.selectedIndex;
  494. for(var i in emotes){
  495. if(typeof emotes[i]!=="function"){
  496. html+='<option value="'+i+'">'+i+'</option>';
  497. }
  498. }
  499. list.innerHTML=html;
  500. if(b==0){
  501. return;
  502. }
  503. else if(b<6){
  504. list.selectedIndex=b;
  505. return;
  506. }
  507. sendEvent(list,'change');
  508. return;
  509. }
  510. function autoFormat(styleNum,textBox,btnClk){
  511. var tta=getId('tektek_skipauto');
  512. if(tta&&btnClk==false){
  513. if(tta.offsetHeight>0){
  514. var stat=tta.checked;
  515. GM_setValue('skip',stat);
  516. }
  517. else{
  518. var stat=false;
  519. }
  520. }
  521. else if(btnClk==false){
  522. var stat=true;
  523. }
  524. else{
  525. var stat=false;
  526. }
  527. if(styleNum>0&&!stat){
  528. var pText=textBox.value;
  529. if(pText.length==0){
  530. if(btnClk){
  531. alert('You can not format empty space.');
  532. }
  533. return '';
  534. }
  535. var endQuote=pText.toLowerCase().lastIndexOf("[/quote]")+8;
  536. if(endQuote!=7){
  537. if(pText.substr(endQuote,1)=='\n'){
  538. endQuote++;
  539. }
  540. var quote=pText.substr(0,endQuote);
  541. var post=pText.substr(endQuote);
  542. if(post.length==0){
  543. if(pText.substr(0,7)!='[quote='||pText.substr(0,7)!='[quote]'){
  544. var startQuote=pText.toLowerCase().indexOf("[quote=");
  545. if(startQuote==-1){
  546. startQuote=pText.toLowerCase().indexOf("[quote]");
  547. }
  548. if(pText.substr(startQuote-1,1)=='\n'){
  549. startQuote--;
  550. }
  551. post=pText.substr(0,startQuote);
  552. quote=pText.substr(startQuote);
  553. var afterQuote=false;
  554. }
  555. if(post.length==0){
  556. if(btnClk){
  557. alert('You can not format empty space.');
  558. }
  559. return pText;
  560. }
  561. }
  562. else{
  563. var afterQuote=true;
  564. }
  565. }
  566. else{
  567. var quote='';
  568. var post=pText;
  569. }
  570. var formats=getFormats();
  571. try{
  572. var basTyp=getEle('select','name','basic_type');
  573. if(basTyp.value==0){
  574. if(formats[styleNum]['style']==6){
  575. if(loc.indexOf('gaiaonline.com/guilds')!=-1){
  576. basTyp.selectedIndex=formats[styleNum]['style'];
  577. }
  578. }
  579. else{
  580. basTyp.selectedIndex=formats[styleNum]['style'];
  581. }
  582. }
  583. }
  584. catch(e){}
  585. if(formats[styleNum]['case']!=0){
  586. if(formats[styleNum]['case']==1){
  587. post=post.toUpperCase();
  588. }
  589. else if(formats[styleNum]['case']==2){
  590. post=post.toLowerCase();
  591. }
  592. else if(formats[styleNum]['case']==3){
  593. post=toTitleCase(post);
  594. }
  595. else if(formats[styleNum]['case']==4){
  596. post=toAlternateCase(post);
  597. }
  598. }
  599. if(afterQuote){
  600. return quote+unescape(formats[styleNum]['start'])+post+unescape(formats[styleNum]['end']);
  601. }
  602. else{
  603. return unescape(formats[styleNum]['start'])+post+unescape(formats[styleNum]['end'])+quote;
  604. }
  605. }
  606. else{
  607. return textBox.value;
  608. }
  609. }
  610. function getFormats(){
  611. var formats=GM_getValue('formats',false);
  612. if(formats){
  613. try{
  614. formats=eval('('+formats+')');
  615. }
  616. catch(e){
  617. formats=eval('('+unescape(formats)+')');
  618. }
  619. }
  620. return formats;
  621. }
  622. function stripFormat(styleNum,textBox){
  623. if(styleNum>0){
  624. var pText=textBox.value;
  625. if(pText.length==0){
  626. return pText;
  627. }
  628. var formats=getFormats();
  629. var start=unescape(formats[styleNum]['start']);
  630. if(formats[styleNum]['start']){
  631. while(pText.indexOf(start)!=-1){
  632. pText=pText.replace(start,'');
  633. }
  634. }
  635. var end=unescape(formats[styleNum]['end']);
  636. if(formats[styleNum]['end']){
  637. while(pText.indexOf(end)!=-1){
  638. pText=pText.replace(end,'');
  639. }
  640. }
  641. return pText;
  642. }
  643. else{
  644. return textBox.value;
  645. }
  646. }
  647. function scarasticNotice(textBox){
  648. var pText=textBox.value;
  649. var endQuote=pText.toLowerCase().lastIndexOf("[/quote]")+8;
  650. if(endQuote!=7){
  651. if(pText.substr(endQuote,1)=='\n'){
  652. endQuote++;
  653. }
  654. var quote=pText.substr(0,endQuote);
  655. var post=pText.substr(endQuote);
  656. if(post.length==0){
  657. return false;
  658. }
  659. }
  660. if(pText!=0){
  661. alert('Congratulations:\n\tYou double clicked a button now you have to edit you post.\n\t\tHint:\n\t\t\tClick the post then press \'\'[crtl]+[z]\'\'');
  662. }
  663. }
  664. function insertformatButtons(textBox,source,ff,loc){
  665. if(ff){
  666. var settingsBtn=true;
  667. if(source==1){
  668. if(loc.indexOf('/profile/privmsg.php')!=-1){
  669. var btn=document.createElement('a');
  670. btn.id='tekSettings';
  671. btn.className='info_button';
  672. btn.setAttribute('onclick','return false;');
  673. btn.innerHTML='<span class="button_cap"></span><span class="button_text">Settings</span>';
  674. getId('btn_send').parentNode.appendChild(btn);
  675. GM_addStyle('#gaia_content a#tekSettings{float:right;margin-left:10px;font-size:10px;}#tekformatbutons .tekformat{margin-right:0px;cursor:pointer;}#tektek_isauto #tektek_skipauto{margin-top:3px;}');
  676. }
  677. else{
  678. var btn=document.createElement('button');
  679. btn.innerHTML='<span>Settings</span>';
  680. btn.className='cta-button-sm gray-button';
  681. btn.type='button';
  682. btn.addEventListener('click',function(){formatDialog(textBox,loc,source);},false);
  683. var t=document.getElementsByClassName('form_buttons');
  684. t[0].insertBefore(btn,t[0].childNodes[0]);
  685. btn=btn.cloneNode(true);
  686. t[1].insertBefore(btn,t[1].childNodes[0]);
  687. GM_addStyle('#tekformatbutons .tekformat{margin-right:6px;cursor:pointer;}#tekformatbutons,#tektek_isauto{margin-left:70px;}');
  688. }
  689. btn.addEventListener('click',function(){formatDialog(textBox,loc,source);},false);
  690. settingsBtn=false;
  691. }
  692. else if(source==2){
  693. if(loc.indexOf('/guilds/')==-1){
  694. var t=getClass('journal-commentbox-button');
  695. if(!t){
  696. t=getClass('journal-entrybox-button');
  697. }
  698. var btn=document.createElement('td');
  699. btn.className='journal-entrybox-button';
  700. btn.innerHTML='<button title="Settings" alt="Settings" class="cta-button-xsm gray-button" type="button"><span>Settings</span></button>';
  701. btn.childNodes[0].addEventListener('click',function(){formatDialog(textBox,loc,source);},false);
  702.  
  703. t.parentNode.insertBefore(btn,t);
  704. settingsBtn=false;
  705. }
  706. GM_addStyle('#tekformatbutons{padding-bottom:3px;}#tekformatbutons .tekformat{margin-right:4px;cursor:pointer;}a#tekSettings{display:inline;float:right;}'+((loc.indexOf('journal')==-1)?'':'textarea#entrybox,textarea#commentbox,input.helpline[type="text"]{width:100%!important;}'));
  707. textBox.parentNode.appendChild(document.createElement('br'));
  708. }
  709. else if(source==3){
  710. var btn=document.createElement('input');
  711. btn.type='button';
  712. btn.value='Settings';
  713. btn.addEventListener('click',function(){formatDialog(textBox,loc,source);},false);
  714. textBox.parentNode.appendChild(btn);
  715. settingsBtn=false;
  716. GM_addStyle('#tekformatbutons .tekformat{margin-left:3px;margin-right:3px;cursor:pointer;position:relative;top:3px;}#content .info_button .button_cap {background:url("http://'+((ff)?unsafeWindow.GAIA_config('graphics_server'):GAIA_config('graphics_server'))+'/images/gaia_global/body/buttons/bn_silver_button.gif") no-repeat scroll left top transparent;display:block;float:left;font-size:0;height:21px;width:8px;}#content .info_button .button_text{background:url("http://'+((ff)?unsafeWindow.GAIA_config('graphics_server'):GAIA_config('graphics_server'))+'/images/gaia_global/body/buttons/bn_silver_button.gif") no-repeat scroll right top transparent;color:#000000;display:block;float:left;height:17px;padding:4px 8px 0 0;vertical-align:middle;white-space:nowrap;}#content .info_button{cursor:pointer;font-size:92%;font-weight:bold;text-decoration:none;}');
  717. }
  718. var span=document.createElement('span');
  719. span.id="tekformatbutons";
  720. span.innerHTML=
  721. '<img id="tekformat1img" class="tekformat" src="'+GM_getResourceURL("format1img")+'">'+
  722. '<img id="tekformat2img" class="tekformat" src="'+GM_getResourceURL("format2img")+'">'+
  723. '<img id="tekformat3img" class="tekformat" src="'+GM_getResourceURL("format3img")+'">'+
  724. '<img id="tekformat4img" class="tekformat" src="'+GM_getResourceURL("format4img")+'">'+
  725. '<img id="tekformat5img" class="tekformat" src="'+GM_getResourceURL("format5img")+'">'+
  726. ((settingsBtn)?'<br/><a onclick="return false;" href="#" class="cta-button-sm gray-button" id="tekSettings"><span>Settings</span></a>':'');
  727. span.childNodes[0].addEventListener('click',function(){textBox.value=autoFormat(1,textBox,true);},false);
  728. span.childNodes[1].addEventListener('click',function(){textBox.value=autoFormat(2,textBox,true);},false);
  729. span.childNodes[2].addEventListener('click',function(){textBox.value=autoFormat(3,textBox,true);},false);
  730. span.childNodes[3].addEventListener('click',function(){textBox.value=autoFormat(4,textBox,true);},false);
  731. span.childNodes[4].addEventListener('click',function(){textBox.value=autoFormat(5,textBox,true);},false);
  732. span.childNodes[0].addEventListener('dblclick',function(){scarasticNotice(textBox);},false);
  733. span.childNodes[1].addEventListener('dblclick',function(){scarasticNotice(textBox);},false);
  734. span.childNodes[2].addEventListener('dblclick',function(){scarasticNotice(textBox);},false);
  735. span.childNodes[3].addEventListener('dblclick',function(){scarasticNotice(textBox);},false);
  736. span.childNodes[4].addEventListener('dblclick',function(){scarasticNotice(textBox);},false);
  737. if(settingsBtn){
  738. span.childNodes[6].addEventListener('click',function(){formatDialog(textBox,loc,source);},false);
  739. }
  740. if(source==4){
  741. getId('tek_stuff').childNodes[1].appendChild(span);
  742. }
  743. else if(source==2){
  744. textBox.parentNode.appendChild(span);
  745. if(loc.indexOf('/j/')==-1&&loc.indexOf('/journal/')==-1){
  746. span.insertBefore(document.createElement('br'),span.childNodes[4]);
  747. }
  748. }
  749. else{
  750. textBox.parentNode.insertBefore(span,textBox.nextSibling);
  751. }
  752. var type,formats=getFormats();
  753. if(formats){
  754. if(loc.indexOf('/forum/compose/')!=-1 || (loc.indexOf('/forum/')!=-1&&loc.indexOf('/t.')!=-1)){
  755. type='FF';
  756. }
  757. else if(loc.indexOf('/guilds/posting.php')!=-1){
  758. type='GF';
  759. }
  760. else if(loc.indexOf('/profile/privmsg.php')!=-1){
  761. type='PM';
  762. }
  763. else if(loc.indexOf('/j/')!=-1||loc.indexOf('/journal/')!=-1){
  764. type='JC';
  765. }
  766. else{
  767. type='PC';
  768. }
  769. if(formats['auto'][type]){
  770. if(formats['auto'][type]==0){
  771. type=0;
  772. }
  773. }
  774. else{
  775. type=0;
  776. }
  777. }
  778. else{
  779. type=0;
  780. }
  781. var div=document.createElement('div');
  782. if(type==0){
  783. div.style.display='none';
  784. }
  785. div.innerHTML='<div><span style="font-size:80%;" id="tektek_isauto">(Auto-Format is <strong>enabled</strong> -- &nbsp; <input style="position:relative;top:3px;" type="checkbox" id="tektek_skipauto"> Skip)</span></div>';
  786. textBox.parentNode.appendChild(div);
  787. if(source==4){
  788. div.childNodes[0].setAttribute('style',"position:absolute;padding-top:8px;margin:6px;");
  789. }
  790. getId('tektek_skipauto').checked=((type==0)?true:GM_getValue('skip',false));
  791. }
  792. }
  793. function insertCaseChanger(loc,source,textBox){// http://i47.tinypic.com/20ivzgz.gif storing link here incase I need it again
  794. var ad=getId('grid_ad');
  795. if(ad){
  796. ad.style.display='none';
  797. }
  798. if(source==1){
  799. var holder=document.createElement('div');
  800. if(loc.indexOf('/profile/privmsg.php')!=-1){
  801. holder.setAttribute('style','margin-left:50px;width:300px;height:300px;margin-top:133px;border:1px solid #999999;padding-left:5px;padding-right:5px;padding-bottom:50px;background-color:#C3CDD5;');
  802. ad.parentNode.appendChild(holder);
  803. }
  804. else{
  805. holder.id="changeCaseHolder";
  806. holder.className='gaia-info justhd';
  807. getId('post_action').parentNode.appendChild(holder);
  808. }
  809. }
  810. else if(source==-2){
  811. var holder=document.createElement('div');
  812. holder.style.marginLeft='30px';
  813. holder.innerHTML='<h1 style="width:420px;">Case Changer</h1><div style="width:400px;padding:10px;height:350px;border:1px solid #999999;background-color:#C3CDD5;" id="changeCaseHolder"></div>';
  814. if(loc.indexOf('account/about')!=-1){
  815. textBox.parentNode.insertBefore(holder,textBox.parentNode.childNodes[0]);
  816. holder.setAttribute('style','width:420px;position:absolute;right:0px;top:-12px;');
  817. }
  818. else{
  819. ad.parentNode.appendChild(holder);
  820. }
  821. var holder=holder.childNodes[1];
  822. }
  823. else if(source==3){
  824. var holder=document.createElement('div');
  825. holder.setAttribute('style','position:absolute;top:0;right:0;width:24%;height:180px;border:1px solid #999999;padding-bottom:70px;background-color:#C3CDD5;');
  826. textBox.parentNode.appendChild(holder);
  827. }
  828. else if(source==2){
  829. var holder=textBox.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.getElementsByTagName('tbody')[0];
  830. holder.innerHTML='<tr><td></td></tr>';
  831. holder.parentNode.parentNode.setAttribute('style','padding:5px!important;width:25%;');
  832. holder=holder.childNodes[0].childNodes[0];
  833. holder.setAttribute('style','border:1px solid #999999!important;background-color:#C3CDD5;padding:5px!important;');
  834. }
  835. if(loc.indexOf('/profile/privmsg.php')!=-1||source==-2||source==2||source==3){
  836. holder.innerHTML=((!holder.id&&(source==1||source==3||source==2))?'<h3 style="text-align:center;">Case Changer</h3>':'')+
  837. '<textarea id="changeCaseInput" style="width:98%;height:39%;" rows="7"></textarea>'+
  838. '<p style="margin:0;text-align:center;font-size:100%;">Change case to <select id="changeCaseSelect" style="margin-top:5%;margin-bottom:5%;"><option value="0">Normal case</option><option value="1">UPPER CASE</option><option value="2">lower case</option><option value="3">Title Case</option><option value="4">aLtErNaTeInG CaSe</option></select></p>'+
  839. '<textarea id="changeCaseOutput" style="width:98%;height:39%;" rows="7" readonly="readonly" onclick="this.select();"></textarea>';
  840. }
  841. else{
  842. holder.innerHTML='<div class="hd"><div class="rc_top_left">&nbsp;</div><div class="rc_top_right">&nbsp;</div><h3>Case Changer</h3><a style="position:absolute;right:5px;top:6px;" class="icon_expand closed" onclick="if(this.className.indexOf(\'closed\')==-1){this.className=\'icon_expand closed\';this.parentNode.parentNode.className=\'gaia-info justhd\';}else{this.className=\'icon_expand expand\';this.parentNode.parentNode.className=\'gaia-info nofooter\';}return false;" href="#"><span class="accessAid">Expand Case Changer</span></a></div><div class="bd"><textarea id="changeCaseInput" style="width:99%;height:100px;"></textarea><p style="margin:0;text-align:center;">Change case to <select id="changeCaseSelect" style="margin-top:5%;margin-bottom:5%;"></p><option value="0">Normal case</option><option value="1">UPPER CASE</option><option value="2">lower case</option><option value="3">Title Case</option><option value="4">aLtErNaTeInG CaSe</option></select><textarea id="changeCaseOutput" style="width:99%;height:100px;" readonly="readonly" onclick="this.select();"></textarea></div><div class="ft"><div class="rc_bottom_left">&nbsp;</div><div class="rc_bottom_right">&nbsp;</div></div></div>';
  843. }
  844. getId('changeCaseSelect').addEventListener('change',function(e){
  845. var index=getId('changeCaseSelect').value;
  846. var input=getId('changeCaseInput').value;
  847. if(index==1){
  848. input=input.toUpperCase();
  849. }
  850. else if(index==2){
  851. input=input.toLowerCase();
  852. }
  853. else if(index==3){
  854. input=toTitleCase(input);
  855. }
  856. else if(index==4){
  857. input=toAlternateCase(input);
  858. }
  859. getId('changeCaseOutput').value=input;
  860. },false);
  861. getId('changeCaseInput').addEventListener('keyup',function(e){
  862. sendEvent(getId('changeCaseSelect'),"change");
  863. },false);
  864. }
  865. function formatDialogSetDefault(x){
  866. var ele=getId('formatRow');
  867. var eles=ele.getElementsByTagName('textarea');
  868. eles[0].value='[color=red]Text to go before each message';
  869. eles[1].value='Text at the end of each message[/color]';
  870.  
  871. eles[2].value='[b]';
  872. eles[3].value='[/b]';
  873.  
  874. eles[4].value='[size=9]';
  875. eles[5].value='[/size]';
  876.  
  877. eles[6].value='[align=left]Look at me, I am default text[/align]\n[center][color=blue]';
  878. eles[7].value='[/color][/center]\n[align=right]Yes, that is the best I can think of :stare:[/align]';
  879.  
  880. eles[8].value='[imgleft]http://i26.tinypic.com/ao2ele.png[/imgleft][imgright]http://i32.tinypic.com/immbyg.png[/imgright][center]';
  881. eles[9].value='[/center]';
  882. if(x==1){
  883. eles=ele.parentNode.parentNode.parentNode.parentNode.parentNode.getElementsByTagName('select');
  884. for(var i=0;i<eles.length-1;i++){
  885. eles[i].selectedIndex=0;
  886. }
  887. eles[eles.length-1].selectedIndex=1;
  888. }
  889. }
  890. function formatDialog(textBox,loc,source){
  891. unsafeWindow.GM_TIMEOUT_STOP=false;
  892. unsafeWindow.GM_TIMEOUT;
  893. var form=document.createElement('form');
  894. form.onsubmit='return false;';
  895. form.setAttribute('style','height:100%;width:100%;position:fixed;top:0px;left:0px;background-color:gray;background-color:-moz-dialog;z-index:1000;margin:0;');
  896. form.id="GM_autoformatForm";
  897. form.innerHTML='<style type="text/css">body{overflow:hidden;}</style>'+
  898. '<center><a id="GM_FORM_CLOSE" style="text-decoration:none;width:61px;display:inline;position:absolute;top:0;left:0;" class="info_button" onclick="return false;" href="#"><span class="button_cap"></span><span class="button_text">Save</span></a><input type="button" style="display:none;"/><a id="GM_FORM_RESET" style="display:table;margin-left:'+(window.innerWidth/2-21)+'px;width:100%;" title="Single Click to restore defaults. Double Click to clear everything." class="info_button" href="#" onclick="if(!GM_TIMEOUT_STOP){GM_TIMEOUT=setTimeout(\'document.getElementById(\\\'GM_FORM_RESET\\\').previousSibling.click();GM_TIMEOUT_STOP=false;\',500);GM_TIMEOUT_STOP=true;}return false;" ondblclick="clearTimeout(GM_TIMEOUT);GM_TIMEOUT_STOP=false;this.nextSibling.click();"><span class="button_cap"></span><span class="button_text">Reset</span></a><input onclick="return confirm(\'Are you sure you want to clear everything?\\nThis will blank out everything.\');" type="reset" style="display:none;"/><a style="text-decoration:none;width:61px;display:inline;position:absolute;top:0;right:0;" class="info_button" onclick="this.parentNode.parentNode.parentNode.removeChild(this.parentNode.parentNode);return false;" href="#"><span class="button_cap"></span><span class="button_text">Cancel</span></a></center>'+
  899. '<div style="margin-top:5px;overflow:auto;height:500px;max-height:'+(window.innerHeight-25)+'px">'+
  900. '<table border="0" style="min-width:1300px;width:100%;">'+
  901. '<tbody>'+
  902. '<tr>'+
  903. '<td colspan="5">'+
  904. '<table border="0" style="width:'+(window.innerWidth-20)+'px;margin-left:5px;min-width:1300px;">'+
  905. '<tbody>'+
  906. '<tr id="formatRow">'+
  907. '<td width="20%">'+
  908. '<span>Format-Style 1:</span><br/>'+
  909. '<span style="padding-left:10px;">Start of post:</span><br/>'+
  910. '<textarea id="format1-1" style="margin-left:20px;width:0;height:100px;">'+
  911. '</textarea><br/>'+
  912. '<span style="padding-left:10px;">End of post:</span><br/>'+
  913. '<textarea id="format1-2" style="margin-left:20px;width:0;height:100px;">'+
  914. '</textarea>'+
  915. '</td>'+
  916. '<td width="20%">'+
  917. '<span>Format-Style 2:</span><br/>'+
  918. '<span style="padding-left:10px;">Start of post:</span><br/>'+
  919. '<textarea id="format2-1" style="margin-left:20px;width:0;height:100px;">'+
  920. '</textarea><br/>'+
  921. '<span style="padding-left:10px;">End of post:</span><br/>'+
  922. '<textarea id="format2-2" style="margin-left:20px;width:0;height:100px;">'+
  923. '</textarea>'+
  924. '</td>'+
  925. '<td width="20%">'+
  926. '<span>Format-Style 3:</span><br/>'+
  927. '<span style="padding-left:10px;">Start of post:</span><br/>'+
  928. '<textarea id="format3-1" style="margin-left:20px;width:0;height:100px;">'+
  929. '</textarea><br/>'+
  930. '<span style="padding-left:10px;">End of post:</span><br/>'+
  931. '<textarea id="format3-2" style="margin-left:20px;width:0;height:100px;">'+
  932. '</textarea>'+
  933. '</td>'+
  934. '<td width="20%">'+
  935. '<span>Format-Style 4:</span><br/>'+
  936. '<span style="padding-left:10px;">Start of post:</span><br/>'+
  937. '<textarea id="format4-1" style="margin-left:20px;width:0;height:100px;">'+
  938. '</textarea><br/>'+
  939. '<span style="padding-left:10px;">End of post:</span><br/>'+
  940. '<textarea id="format4-2" style="margin-left:20px;width:0;height:100px;">'+
  941. '</textarea>'+
  942. '</td>'+
  943. '<td width="20%">'+
  944. '<span>Format-Style 5:</span><br/>'+
  945. '<span style="padding-left:10px;">Start of post:</span><br/>'+
  946. '<textarea id="format5-1" style="margin-left:20px;width:0;height:100px;">'+
  947. '</textarea><br/>'+
  948. '<span style="padding-left:10px;">End of post:</span><br/>'+
  949. '<textarea id="format5-2" style="margin-left:20px;width:0;height:100px;">'+
  950. '</textarea>'+
  951. '</td>'+
  952. '</tr>'+
  953. '</tbody>'+
  954. '</table>'+
  955. '</td>'+
  956. '</tr>'+
  957. '<tr>'+
  958. '<td width="20%">'+
  959. '<span style="padding-left:10px;">Format Style:</span>'+
  960. '<span style="padding-left:15px;">Case Style:</span><br/>'+
  961. '<select id="format1-3" style="margin-left:20px;width:80px;"><option value="0">Say</option><option value="1">Whisper</option><option value="2">Shout</option><option value="3">Think</option><option value="4">Document</option><option value="5">Ornate</option><option value="6">Honey (Guilds Only)</option></select>'+
  962. '<select id="format1-4" style="margin-left:25px;width:135px;"><option value="0">Normal case</option><option value="1">UPPER CASE</option><option value="2">lower case</option><option value="3">Title Case</option><option value="4">aLtErNaTeInG CaSe</option></select>'+
  963. '</td>'+
  964. '<td width="20%">'+
  965. '<span style="padding-left:10px;">Format Style:</span>'+
  966. '<span style="padding-left:15px;">Case Style:</span><br/>'+
  967. '<select id="format2-3" style="margin-left:20px;width:80px;"><option value="0">Say</option><option value="1">Whisper</option><option value="2">Shout</option><option value="3">Think</option><option value="4">Document</option><option value="5">Ornate</option><option value="6">Honey (Guilds Only)</option></select>'+
  968. '<select id="format2-4" style="margin-left:25px;width:135px;"><option value="0">Normal case</option><option value="1">UPPER CASE</option><option value="2">lower case</option><option value="3">Title Case</option><option value="4">aLtErNaTeInG CaSe</option></select>'+
  969. '</td>'+
  970. '<td width="20%">'+
  971. '<span style="padding-left:10px;">Format Style:</span>'+
  972. '<span style="padding-left:15px;">Case Style:</span><br/>'+
  973. '<select id="format3-3" style="margin-left:20px;width:80px;"><option value="0">Say</option><option value="1">Whisper</option><option value="2">Shout</option><option value="3">Think</option><option value="4">Document</option><option value="5">Ornate</option><option value="6">Honey (Guilds Only)</option></select>'+
  974. '<select id="format3-4" style="margin-left:25px;width:135px;"><option value="0">Normal case</option><option value="1">UPPER CASE</option><option value="2">lower case</option><option value="3">Title Case</option><option value="4">aLtErNaTeInG CaSe</option></select>'+
  975. '</td>'+
  976. '<td width="20%">'+
  977. '<span style="padding-left:10px;">Format Style:</span>'+
  978. '<span style="padding-left:15px;">Case Style:</span><br/>'+
  979. '<select id="format4-3" style="margin-left:20px;width:80px;"><option value="0">Say</option><option value="1">Whisper</option><option value="2">Shout</option><option value="3">Think</option><option value="4">Document</option><option value="5">Ornate</option><option value="6">Honey (Guilds Only)</option></select>'+
  980. '<select id="format4-4" style="margin-left:25px;width:135px;"><option value="0">Normal case</option><option value="1">UPPER CASE</option><option value="2">lower case</option><option value="3">Title Case</option><option value="4">aLtErNaTeInG CaSe</option></select>'+
  981. '</td>'+
  982. '<td width="20%">'+
  983. '<span style="padding-left:10px;">Format Style:</span>'+
  984. '<span style="padding-left:15px;">Case Style:</span><br/>'+
  985. '<select id="format5-3" style="margin-left:20px;width:80px;"><option value="0">Say</option><option value="1">Whisper</option><option value="2">Shout</option><option value="3">Think</option><option value="4">Document</option><option value="5">Ornate</option><option value="6">Honey (Guilds Only)</option></select>'+
  986. '<select id="format5-4" style="margin-left:25px;width:135px;"><option value="0">Normal case</option><option value="1">UPPER CASE</option><option value="2">lower case</option><option value="3">Title Case</option><option value="4">aLtErNaTeInG CaSe</option></select>'+
  987. '</td>'+
  988. '</tr>'+
  989. '<tr>'+
  990. '<td colspan="5">'+
  991. '<table border="0" width="100%">'+
  992. '<tbody>'+
  993. '<tr>'+
  994. '<td colspan="4">Auto-Format:</td>'+
  995. '</tr>'+
  996. '<tr>'+
  997. '<td>'+
  998. '<span style="margin-left:10px;">Forums:</span><br/>'+
  999. '<select id="Forum_Format" style="margin-left:20px;width:135px;"><option value="0">None</option><option value="1">Format-Style 1</option><option value="2">Format-Style 2</option><option value="3">Format-Style 3</option><option value="4">Format-Style 4</option><option value="5">Format-Style 5</option></select><br/>'+
  1000. '</td>'+
  1001. '<td>'+
  1002. '<span style="margin-left:10px;">Guilds:</span><br/>'+
  1003. '<select id="Guild_Format" style="margin-left:20px;width:135px;"><option value="0">None</option><option value="1">Format-Style 1</option><option value="2">Format-Style 2</option><option value="3">Format-Style 3</option><option value="4">Format-Style 4</option><option value="5">Format-Style 5</option></select><br/>'+
  1004. '<td>'+
  1005. '<span style="margin-left:10px;">Private Messages:</span><br/>'+
  1006. '<select id="PM_Format" style="margin-left:20px;width:135px;"><option value="0">None</option><option value="1">Format-Style 1</option><option value="2">Format-Style 2</option><option value="3">Format-Style 3</option><option value="4">Format-Style 4</option><option value="5">Format-Style 5</option></select><br/>'+
  1007. '</td>'+
  1008. '<td>'+
  1009. '<span style="margin-left:10px;">Profile Comments:</span><br/>'+
  1010. '<select id="PC_Format" style="margin-left:20px;width:135px;"><option value="0">None</option><option value="1">Format-Style 1</option><option value="2">Format-Style 2</option><option value="3">Format-Style 3</option><option value="4">Format-Style 4</option><option value="5">Format-Style 5</option></select>'+
  1011. '</td>'+
  1012. '<td>'+
  1013. '<span style="margin-left:10px;">Journal Comments:</span><br/>'+
  1014. '<select id="JC_Format" style="margin-left:20px;width:135px;"><option value="0">None</option><option value="1">Format-Style 1</option><option value="2">Format-Style 2</option><option value="3">Format-Style 3</option><option value="4">Format-Style 4</option><option value="5">Format-Style 5</option></select>'+
  1015. '</td>'+
  1016. '</tr>'+
  1017. '</tbody>'+
  1018. '</table>'+
  1019. '</td>'+
  1020. '</tr>'+
  1021. '<tr>'+
  1022. '<td colspan="2">'+
  1023. '<span><b>Note</b>:</span><br/>'+
  1024. '<span style="margin-left:10px;">Please use lower case tag names in your BB Code.</span><br/>'+
  1025. '<span style="margin-left:20px;">Example:</span><br/>'+
  1026. '<span style="margin-left:30px;">Use <i>[img]</i> not <i>[IMG]</i></span><br/>'+
  1027. '<span style="margin-left:10px;">Case changeing settings are not applied to you auto-format code.</span><br/>'+
  1028. '<span style="margin-left:10px;">Case changeing settings will break some emotes, images, and links.</span>'+
  1029. '</td>'+
  1030. '<td colspan="1" style="text-align:center;">'+
  1031. 'Auto-Format is currently<br/>'+
  1032. '<select id="tekFormatCheck" title="Determins weather the skip auto-foramt box is cheked or not"><option value="false">Enabled</option><option value="true">Disabled</option></select>'+
  1033. '</td>'+
  1034. '<td colspan="1" style="text-align:center;">'+
  1035. 'gaiArch emote support is<br/>'+
  1036. '<select id="GA_Support" title="gaiArch Support adds '+objectsCount(json2)+' emotes"><option value="true">Enabled</option><option value="false">Disabled</option></select><br/>'+
  1037. 'Always use all Gaia\'s emotes<br/>'+
  1038. '<select id="GFE_Support" title="This adds support for gaia\'s emotes sets for Cats, Yummies, Emotions, and Gaia totaling '+objectsCount(json5)+' emotes enjoy the hunt ;)"><option value="true">Enabled</option><option value="false">Disabled</option></select>'+
  1039. '</td>'+
  1040. '<td colspan="1" style="text-align:center;">'+
  1041. 'Place a scrollbar on the emote boxes<br/>'+
  1042. '<select id="largeEmoteBox" title="Prevents oversized emote boxes"><option value="false">Enabled</option><option value="true">Disabled</option></select>'+
  1043. '</td>'+
  1044. '</tr>'+
  1045. '</tbody>'+
  1046. '</table>'+
  1047. '</div>';
  1048. try{
  1049. getId('content-padding').appendChild(form);
  1050. }
  1051. catch(e){
  1052. try{
  1053. getId('gaia_content').appendChild(form);
  1054. }
  1055. catch(e){
  1056. getId('content').appendChild(form);
  1057. }
  1058. }
  1059. var tAreas=getId('formatRow').getElementsByTagName('textarea');
  1060. for(var i=0;i<tAreas.length;i+=2){
  1061. var w=tAreas[i].parentNode.offsetWidth-20+'px';
  1062. tAreas[i].style.width=w;
  1063. tAreas[i+1].style.width=w;
  1064. }
  1065. for(var i=0;i<tAreas.length;i++){
  1066. tAreas[i].addEventListener('focus',function(){
  1067. for(var i=0;i<tAreas.length;i+=2){
  1068. tAreas[i].parentNode.setAttribute('width','15%');
  1069. tAreas[i].style.width='0';
  1070. tAreas[i+1].style.width='0';
  1071. }
  1072. this.parentNode.setAttribute('width','40%');
  1073. for(var i=0;i<tAreas.length;i+=2){
  1074. var w=tAreas[i].parentNode.offsetWidth-20+'px';
  1075. tAreas[i].style.width=w;
  1076. tAreas[i+1].style.width=w;
  1077. }
  1078. },false);
  1079. tAreas[i].addEventListener('blur',function(){
  1080. for(var i=0;i<tAreas.length;i+=2){
  1081. tAreas[i].parentNode.setAttribute('width','20%');
  1082. tAreas[i].style.width='0';
  1083. tAreas[i+1].style.width='0';
  1084. }
  1085. for(var i=0;i<tAreas.length;i+=2){
  1086. var w=tAreas[i].parentNode.offsetWidth-20+'px';
  1087. tAreas[i].style.width=w;
  1088. tAreas[i+1].style.width=w;
  1089. }
  1090. },false);
  1091. }
  1092. getId('tekFormatCheck').selectedIndex=(GM_getValue('skip',false))?1:0;
  1093. var lb=GM_getValue('lb',true);
  1094. getId('largeEmoteBox').selectedIndex=(lb)?1:0;
  1095. var GAS=getId('GA_Support');
  1096. GAS.selectedIndex=(gArch)?0:1;
  1097. var GFE=getId("GFE_Support");
  1098. GFE.selectedIndex=(emote5)?0:1;
  1099. var formats=getFormats();
  1100. if(formats){
  1101. getId("Forum_Format").selectedIndex=formats['auto']['FF'];
  1102. getId("Guild_Format").selectedIndex=formats['auto']['GF'];
  1103. getId("PM_Format").selectedIndex=formats['auto']['PM'];
  1104. getId("PC_Format").selectedIndex=formats['auto']['PC'];
  1105. getId("JC_Format").selectedIndex=formats['auto']['JC'];
  1106.  
  1107. getId("format1-1").value=unescape(formats[1]['start']);
  1108. getId("format1-2").value=unescape(formats[1]['end']);
  1109. getId("format1-3").value=formats[1]['style'];
  1110. getId("format1-4").value=formats[1]['case'];
  1111.  
  1112. getId("format2-1").value=unescape(formats[2]['start']);
  1113. getId("format2-2").value=unescape(formats[2]['end']);
  1114. getId("format2-3").value=formats[2]['style'];
  1115. getId("format2-4").value=formats[2]['case'];
  1116.  
  1117. getId("format3-1").value=unescape(formats[3]['start']);
  1118. getId("format3-2").value=unescape(formats[3]['end']);
  1119. getId("format3-3").value=formats[3]['style'];
  1120. getId("format3-4").value=formats[3]['case'];
  1121.  
  1122. if(formats[4]){
  1123. getId("format4-1").value=unescape(formats[4]['start']);
  1124. getId("format4-2").value=unescape(formats[4]['end']);
  1125. getId("format4-3").value=formats[4]['style'];
  1126. getId("format4-4").value=formats[4]['case'];
  1127. }
  1128.  
  1129. if(formats[5]){
  1130. getId("format5-1").value=unescape(formats[5]['start']);
  1131. getId("format5-2").value=unescape(formats[5]['end']);
  1132. getId("format5-3").value=formats[5]['style'];
  1133. getId("format5-4").value=formats[5]['case'];
  1134. }
  1135. }
  1136. else{
  1137. formatDialogSetDefault(0);
  1138. }
  1139. getId('GM_FORM_RESET').previousSibling.addEventListener('click',function(){
  1140. if(confirm('Are you sure you want to set everything to default?\nThis will set everything to its default value. (example settings)')){
  1141. formatDialogSetDefault(1);
  1142. }
  1143. },false);
  1144. getId('GM_FORM_CLOSE').addEventListener('click',function(){
  1145. var f1p1=escape(getId("format1-1").value);
  1146. var f1p2=escape(getId("format1-2").value);
  1147. var f1p3=getId("format1-3").value;
  1148. var f1p4=getId("format1-4").value;
  1149.  
  1150. var f2p1=escape(getId("format2-1").value);
  1151. var f2p2=escape(getId("format2-2").value);
  1152. var f2p3=getId("format2-3").value;
  1153. var f2p4=getId("format2-4").value;
  1154.  
  1155. var f3p1=escape(getId("format3-1").value);
  1156. var f3p2=escape(getId("format3-2").value);
  1157. var f3p3=getId("format3-3").value;
  1158. var f3p4=getId("format3-4").value;
  1159.  
  1160. var f4p1=escape(getId("format4-1").value);
  1161. var f4p2=escape(getId("format4-2").value);
  1162. var f4p3=getId("format4-3").value;
  1163. var f4p4=getId("format4-4").value;
  1164.  
  1165. var f5p1=escape(getId("format5-1").value);
  1166. var f5p2=escape(getId("format5-2").value);
  1167. var f5p3=getId("format5-3").value;
  1168. var f5p4=getId("format5-4").value;
  1169.  
  1170. var FF=Number(getId("Forum_Format").value);
  1171. var GF=Number(getId("Guild_Format").value);
  1172. var PM=Number(getId("PM_Format").value);
  1173. var PC=Number(getId("PC_Format").value);
  1174. var JC=Number(getId("JC_Format").value);
  1175.  
  1176. var GAs=eval(getId("GA_Support").value);
  1177. var GFe=eval(getId("GFE_Support").value);
  1178.  
  1179. var skip=eval(getId('tekFormatCheck').value);
  1180. GM_setValue('skip',skip);
  1181. if(source!=-1){
  1182. var tek=getId('tektek_skipauto');
  1183. tek.checked=skip;
  1184. if(tek.offsetWidth>0){
  1185. if(source==1){
  1186. if(PM==0&&FF==0){
  1187. tek.parentNode.parentNode.parentNode.style.display='none';
  1188. tek.checked=true;
  1189. }
  1190. else if(FF==0&&PM>0){
  1191. if(loc.indexOf('/forum/')!=-1){
  1192. tek.parentNode.parentNode.parentNode.style.display='none';
  1193. tek.checked=true;
  1194. }
  1195. }
  1196. else if(PM==0&&FF>0){
  1197. if(loc.indexOf('/profile/')!=-1){
  1198. tek.parentNode.parentNode.parentNode.style.display='none';
  1199. tek.checked=true;
  1200. }
  1201. }
  1202. }
  1203. else if(source==2){
  1204. if(JC==0&&GF==0){
  1205. tek.parentNode.parentNode.parentNode.style.display='none';
  1206. tek.checked=true;
  1207. }
  1208. else if(GF==0&&JC>0){
  1209. if(loc.indexOf('/guilds/')!=-1){
  1210. tek.parentNode.parentNode.parentNode.style.display='none';
  1211. tek.checked=true;
  1212. }
  1213. }
  1214. else if(JC==0&&GF>0){
  1215. if(loc.indexOf('/guilds/')==-1){
  1216. tek.parentNode.parentNode.parentNode.style.display='none';
  1217. tek.checked=true;
  1218. }
  1219. }
  1220. }
  1221. else if(source==3){
  1222. if(PC==0){
  1223. tek.parentNode.parentNode.parentNode.style.display='none';
  1224. tek.checked=true;
  1225. }
  1226. }
  1227. else if(source==4){
  1228. if(FF==0){
  1229. tek.parentNode.parentNode.parentNode.style.display='none';
  1230. tek.checked=true;
  1231. }
  1232. }
  1233. }
  1234. else{
  1235. if(source==1){
  1236. if(PM>0&&FF>0){
  1237. tek.parentNode.parentNode.parentNode.style.display='';
  1238. tek.checked=false;
  1239. }
  1240. else if(FF>0&&PM==0){
  1241. if(loc.indexOf('/forum/')!=-1){
  1242. tek.parentNode.parentNode.parentNode.style.display='';
  1243. tek.checked=false;
  1244. }
  1245. }
  1246. else if(PM>0&&FF==0){
  1247. if(loc.indexOf('/profile/')!=-1){
  1248. tek.parentNode.parentNode.parentNode.style.display='';
  1249. tek.checked=false;
  1250. }
  1251. }
  1252. }
  1253. else if(source==2){
  1254. if(JC>0&&GF>0){
  1255. tek.parentNode.parentNode.parentNode.style.display='';
  1256. tek.checked=false;
  1257. }
  1258. else if(GF>0&&JC==0){
  1259. if(loc.indexOf('/guilds/')!=-1){
  1260. tek.parentNode.parentNode.parentNode.style.display='';
  1261. tek.checked=false;
  1262. }
  1263. }
  1264. else if(JC>0&&GF==0){
  1265. if(loc.indexOf('/guilds/')==-1){
  1266. tek.parentNode.parentNode.parentNode.style.display='';
  1267. tek.checked=false;
  1268. }
  1269. }
  1270. }
  1271. else if(source==3){
  1272. if(PC>0){
  1273. tek.parentNode.parentNode.parentNode.style.display='';
  1274. tek.checked=false;
  1275. }
  1276. }
  1277. else if(source==4){
  1278. if(FF>0){
  1279. tek.parentNode.parentNode.parentNode.style.display='';
  1280. tek.checked=false;
  1281. }
  1282. }
  1283. }
  1284. }
  1285. GM_setValue('formats','{"1":{"start":"'+f1p1+'","end":"'+f1p2+'","style":'+f1p3+',"case":'+f1p4+'},"2":{"start":"'+f2p1+'","end":"'+f2p2+'","style":'+f2p3+',"case":'+f2p4+'},"3":{"start":"'+f3p1+'","end":"'+f3p2+'","style":'+f3p3+',"case":'+f3p4+'},"4":{"start":"'+f4p1+'","end":"'+f4p2+'","style":'+f4p3+',"case":'+f4p4+'},"5":{"start":"'+f5p1+'","end":"'+f5p2+'","style":'+f5p3+',"case":'+f5p4+'},"auto":{"FF":'+FF+',"GF":'+GF+',"PM":'+PM+',"PC":'+PC+',"JC":'+JC+'}}');
  1286. GM_setValue('GA_support',GAs);
  1287. GM_setValue('GFE_support',GFe);
  1288.  
  1289. var lb=eval(getId('largeEmoteBox').value);
  1290. GM_setValue('lb',lb);
  1291.  
  1292. var div=getId('GM_autoformatForm');
  1293. div.parentNode.removeChild(div);
  1294. if(GAs!=gArch){
  1295. var holder=getId('emoticons');
  1296. if(!GAs){
  1297. if(holder){
  1298. if(typeof unsafeWindow.YAHOO.gaia.Emotes!='object'){
  1299. var eles=holder.getElementsByClassName('gArchEmote');
  1300. for(var i=eles.length-1;i>-1;i--){
  1301. holder.removeChild(eles[i]);
  1302. }
  1303. }
  1304. else{
  1305. delete(unsafeWindow.YAHOO.gaia.Emotes["GaiArch"]);
  1306. /*var e=getId('emoticon_set');
  1307. if(e.value=='GaiArch'){
  1308. e.selectedIndex=0;
  1309. sendEvent(e,"change");
  1310. }*/
  1311. gaiaEmotesReload();
  1312. }
  1313. var q=getId('qr_container');
  1314. if(q){
  1315. q.removeAttribute('class');
  1316. }
  1317. }
  1318. else{
  1319. var eles=document.getElementsByClassName('gArchEmote');
  1320. for(var i=eles.length-1;i>-1;i--){
  1321. eles[i].parentNode.removeChild(eles[i]);
  1322. }
  1323. }
  1324. textBox.value=gArchEmoteConversion(textBox.value,2);
  1325. }
  1326. else{
  1327. if(holder){
  1328. if(loc.indexOf('account/signature')!=-1||loc.indexOf('account/about')!=-1){
  1329. insertGaiArchEmote(holder,2,(getId('about_content')?0:1));
  1330. }
  1331. else{
  1332. insertGaiArchEmote(holder,(getId('qr_container')?2:0),0);
  1333. }
  1334. }
  1335. else{
  1336. insertGaiArchEmote(getClass('gensmall').parentNode.parentNode,1,0);
  1337. }
  1338. if(loc.indexOf('account/signature')==-1){
  1339. textBox.value=gArchEmoteConversion(textBox.value,1);
  1340. }
  1341. }
  1342. gArch=GAs;
  1343. }
  1344. if(GFe!=emote5){// todo emote5 strip/replace
  1345. var holder=getId('qr_container');
  1346. if(holder){
  1347. var holder2=getId('emoticons');
  1348. if(!GFe){
  1349. var eles=holder.getElementsByClassName('catsPlus');
  1350. for(var i=eles.length-1;i>-1;i--){
  1351. holder2.removeChild(eles[i]);
  1352. }
  1353. }
  1354. else{
  1355. for(var i in json5){
  1356. var li=document.createElement('li');
  1357. li.className="catsPlus";
  1358. li.innerHTML='<a title="'+json5[i]['text']+' - '+json5[i]['code']+'" class="emoticon '+json5[i]['class']+'" href="#" onclick="emoticon2(this.title.slice(this.title.indexOf(\' - \')+3));return false;">'+json5[i]['text']+'</a>';
  1359. holder2.appendChild(li);
  1360. }
  1361. }
  1362. }
  1363. emote5=GFe;
  1364. }
  1365. var edit=getId('editor');
  1366. if(!edit&&loc.indexOf('mode=addcomment')!=-1&&loc.indexOf('/p')){
  1367. edit=textBox.previousSibling;
  1368. }
  1369. if(edit&&!lb&&(gArch||objectsCount(json3)>0)){
  1370. edit.className='scroll';
  1371. }
  1372. else if(edit){
  1373. edit.removeAttribute('class');
  1374. }
  1375. },false);
  1376. }
  1377. function emotionEditorDialog(textBox,m){
  1378. var div=document.createElement('div');
  1379. div.setAttribute('style','position:fixed;top:0;left:0;width:100%;height:100%;background-color:gray;background-color:-moz-dialog;z-index:1000;');
  1380. div.id="GM_EMOTE_CONFIG";
  1381. div.innerHTML=
  1382. '<table style="width:91%;margin:auto;height:100%;" border="0">'+
  1383. '<tbody>'+
  1384. '<tr>'+
  1385. '<td colspan="3">'+
  1386. '<span>Seperate your emotes with a line break or a comma.</span>'+
  1387. '</td>'+
  1388. '</tr>'+
  1389. '<tr>'+
  1390. '<td colspan="3">'+
  1391. '<textarea id="customEmoteJSON" style="width:100%;height:100%;"></textarea>'+
  1392. '</td>'+
  1393. '</tr>'+
  1394. '<tr>'+
  1395. '<td colspan="1" >'+
  1396. '<a id="GM_EMOTE_SAVE" style="float:left;text-decoration:none;width:51px;display:inline;" class="info_button" onclick="return false;" href="#"><span class="button_cap"></span><span class="button_text">Save</span></a>'+
  1397. '</td>'+
  1398. '<td colspan="1" width="105">'+
  1399. '<a id="GM_EMOTE_ADD" title="You will have to answer 4 simple questions." style="text-decoration:none;width:105px;display:inline;" class="info_button" onclick="return false;" href="#"><span class="button_cap"></span><span class="button_text">Add Emotion</span></a>'+
  1400. '</td>'+
  1401. '<td colspan="1">'+
  1402. '<a id="GM_EMOTE_CANCEL" style="float:right;text-decoration:none;width:61px;display:inline;" class="info_button" onclick="this.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.removeChild(this.parentNode.parentNode.parentNode.parentNode.parentNode);return false;" href="#"><span class="button_cap"></span><span class="button_text">Cancel</span></a>'+
  1403. '</td>'+
  1404. '</tr>'+
  1405. '<tr>'+
  1406. '<td colspan="3">'+
  1407. '<div>'+
  1408. 'Notes:<br/>'+
  1409. '<div style="margin-left:10px">'+
  1410. 'If you can not figure out what is wrong with you code <a target="_blank" href="http://www.jsonlint.com/">this</a> will help you.<br/.>'+
  1411. 'You will need to place your code in side of brackets (<code>[]</code>) when you do this.<br/>'+
  1412. 'You will also need to replace all of you line breaks (<code>enter key</code>) with commas.'+
  1413. '</div>'+
  1414. 'FAQs:<span style="float:right;font-weight:bold;">Scroll bar here ↓&nbsp;</span><br/>'+
  1415. '<div style="margin-left:10px;max-height:175px;overflow-y:auto;">'+
  1416. 'Q: How can I change my line breaks to commas quicky?<br/>'+
  1417. 'A: Just click <a onclick="var tb=document.getElementById(\'customEmoteJSON\');tb.value=tb.value.replace(/\\n/g,\',\');return false;" href="#">here</a>.<br/>'+
  1418. 'Q: Can I use the validated code from <a target="_blank" href="http://www.jsonlint.com">www.jsonlint.com</a> in the above text box?<br/>'+
  1419. 'A: Yes.<br/>'+
  1420. 'Q: Is there a way I can easly figure out the size my emotion\'s is?<br/>'+
  1421. 'A: Yes, click <a id="imageSizer" target="_blank">here</a> for a simple tool.<br/>'+
  1422. 'Q: How can I put a double quote (<code>"</code>) in my emote code?<br/>'+
  1423. 'A: Put a backslash (<code>\\</code>) infront of it.<br/>'+
  1424. 'Q: Why the [censored] does one of my emotes have the wrong image when I post it?<br/>'+
  1425. 'A: Because you used an emotion code that is beening used by another emotion.<br/>'+
  1426. 'Q: Is there some where I can get/share custom emotion codes?<br/>'+
  1427. 'A: Yes, right <a target="_blank" href="http://userscripts.org/topics/57315">here</a>.<br/>'+
  1428. 'Q: What should a line look like in the text box?<br/>'+
  1429. 'A: Like this:<br/>'+
  1430. '<code style="margin-left:20px;">{"name":"<i>Emote Name</i>","code":"<i>Emote Code</i>", "loc":"<i>Emote URL</i>","size":<i>Emote width (height is scaled to 17 pixles)</i>}</code><br/>'+
  1431. 'Q: Can I see a sample?<br/>'+
  1432. 'A: Yes.<br/>'+
  1433. '<code style="margin-left:20px;">{ "name": "Domokun", "code": ":domokun:", "loc": "http://public.tektek.org/img/emotes/domokun.gif", "size": 15 }</code>'+
  1434. '</div>'+
  1435. '</div>'+
  1436. '</td>'+
  1437. '</tr>'+
  1438. '</tbody>'+
  1439. '</table>';
  1440. try{
  1441. getId('content-padding').appendChild(div);
  1442. }
  1443. catch(e){
  1444. try{
  1445. getId('gaia_content').appendChild(div);
  1446. }
  1447. catch(e){
  1448. getId('content').appendChild(div);
  1449. }
  1450. }
  1451. getId('imageSizer').href='data:text/html;charset=utf-8,<html><head><script type="text/javascript">function sendChange(){var evt=document.createEvent("HTMLEvents");evt.initEvent(\'change\',true,true);document.getElementById(\'width\').dispatchEvent(evt);}</script></head><body>Image URL:<input size="100" title="Link to picture goes here" onblur="document.getElementById(\'img\').style.backgroundImage=\'url(\'+this.value+\')\'" type="text"/><br/>Width:<input size="3" title="A number goes here" onchange="document.getElementById(\'img\').style.width=this.value+\'px\';" value="15" id="width" type="text"/><input onclick="document.getElementById(\'width\').value--;sendChange()" type="button" value="-"/><input type="button" onclick="document.getElementById(\'width\').value++;sendChange()" value="+"/><br/><div id="img" style="height:17px;-moz-background-size:contain;background-size:contain;background-repeat:no-repeat;width:15px;"></div></body></html>';
  1452. var box=getId('customEmoteJSON');
  1453. box.value=GM_getValue('emotes','[{"name":"I ♥ Firefox","code":":i<3ff:","loc":"http://i251.photobucket.com/albums/gg311/OoTLink/1523015719438d778f7ac51.gif","size":41}]').slice(1,-1).replace(/},/g,'}\n');
  1454. var h=window.innerHeight;
  1455. var eles=box.parentNode.parentNode.parentNode.childNodes;
  1456. for(var i=0;i<eles.length;i++){
  1457. if(i!=1&&i!=eles.length-1){
  1458. h-=eles[i].offsetHeight;
  1459. }
  1460. else if(i!=1){
  1461. h-=eles[i].childNodes[0].childNodes[0].offsetHeight;
  1462. }
  1463. }
  1464. box.style.height=h+'px';
  1465. getId('GM_EMOTE_ADD').addEventListener('click',function(){
  1466. try{
  1467. var emotes=box.value;
  1468. try{
  1469. if(emotes.charAt(0)!='['&&emotes.charAt(objectsCount(emotes)-1)!=']'){
  1470. emotes=JSON.parse('['+emotes+']');
  1471. }
  1472. else{
  1473. emotes=JSON.parse(emotes);
  1474. }
  1475. }
  1476. catch(e){
  1477. emotes=JSON.parse('['+emotes.replace(/\n/g,',')+']');
  1478. }
  1479. emotes[objectsCount(emotes)]={"name":prompt('What is the emotion\'s name?'),"code":prompt('What is the emotion\'s code?'),"loc":prompt('What is the emotion\'s web addess (URL)?'),"size":Number(prompt('What is the emotion\'s width?'))};
  1480. box.value=JSON.stringify(emotes).replace(/},/g,'}\n').slice(1,-1);
  1481. }
  1482. catch(e){
  1483. alert('The current code is not in an acceptable foramt.\nHint: Look for something out of place.');
  1484. }
  1485.  
  1486. },false);
  1487. getId('GM_EMOTE_SAVE').addEventListener('click',function(){
  1488. try{
  1489. var emotes=JSON.stringify(JSON.parse(box.value));
  1490. }
  1491. catch(e){
  1492. var emotes=box.value.replace(/\n/g,',');
  1493. }
  1494. try{
  1495. if(emotes.charAt(0)!='['&&emotes.charAt(emotes.length-1)!=']'){
  1496. var x=JSON.parse('['+emotes+']');
  1497. }
  1498. else{
  1499. var x=JSON.parse(emotes);
  1500. }
  1501. for(var i in x){
  1502. if(!x[i]["size"]||!x[i]["name"]||!x[i]["loc"]||!x[i]["code"]){
  1503. alert('Unable to save emotions.\nCustom emotion '+(i+1)+' is missing something.'+((objectsCount(x[i])==4)?'\nProbally a typo.':''));
  1504. throw new Error(i);
  1505. }
  1506. }
  1507. GM_setValue('emotes',JSON.stringify(x));
  1508. var e=getId('emoticons');
  1509. if(typeof unsafeWindow.YAHOO.gaia.Emotes!='object'){
  1510. var eles=e.getElementsByClassName('customEmote');
  1511. for(var i=eles.length-1;i>-1;i--){
  1512. e.removeChild(eles[i]);
  1513. }
  1514. }
  1515. var moded=false;
  1516. var text=textBox.value;
  1517. for(var i in json3){
  1518. var str=json3[i]["code"];
  1519. if(text.indexOf(str)!=-1){
  1520. moded=true;
  1521. str=str2regExStr(str);
  1522. var regEx=new RegExp(str,'g');
  1523. text=text.replace(regEx,'[img]'+json3[i]["loc"]+'[/img]');
  1524. }
  1525. }
  1526. json3=x;
  1527. for(var i in json3){
  1528. var str='[img]'+json3[i]["loc"]+'[/img]';
  1529. if(text.indexOf(str)!=-1){
  1530. moded=true;
  1531. str='\\[img\\]'+str2regExStr(json3[i]["loc"])+'\\[\\/img\\]';
  1532. text=text.replace(new RegExp(str,'g'),json3[i]["code"]);
  1533. }
  1534. }
  1535. if(moded){
  1536. textBox.value=text;
  1537. }
  1538. insertStandardEmoticons(e,m,2);
  1539. sendEvent(getId('GM_EMOTE_CANCEL'),'click');
  1540. }
  1541. catch(e){
  1542. e=e.toString().substr(7);
  1543. if(e!=Number(e)){
  1544. alert('Unable to save emotions.\nThere is an error in your code.\nRead the FAQs for help.');
  1545. }
  1546. }
  1547. },false);
  1548. }
  1549. function imgCode2EmoteCode(textBox){
  1550. var moded=false;
  1551. var formats=getFormats();
  1552. if(formats){
  1553. if(loc.indexOf('/forum/compose/')!=-1||(loc.indexOf('/forum/')!=-1&&loc.indexOf('/t.')!=-1)){
  1554. var type='FF';
  1555. }
  1556. else if(loc.indexOf('/guilds/posting.php')!=-1){
  1557. var type='GF';
  1558. }
  1559. else if(loc.indexOf('/profile/privmsg.php')!=-1){
  1560. var type='PM';
  1561. }
  1562. else if(loc.indexOf('/j/')!=-1||loc.indexOf('/journal/')!=-1){
  1563. var type='JC';
  1564. }
  1565. else{
  1566. var type='PC';
  1567. }
  1568. var text=stripFormat(formats['auto'][type],textBox);
  1569. moded=true;
  1570. }
  1571. else{
  1572. var text=textBox.value;
  1573. }
  1574. for(var i in json){
  1575. var str='[img]http://public.tektek.org/img/emotes/'+json[i]["loc"]+'.gif[/img]';
  1576. if(text.indexOf(str)!=-1){
  1577. moded=true;
  1578. str='\\[img\\]http:\\/\\/public.tektek.org\\/img\\/emotes\\/'+json[i]["loc"]+'.gif\\[\\/img\\]';
  1579. text=text.replace(new RegExp(str,'g'),json[i]["code"]);
  1580. }
  1581. }
  1582. if(gArch){
  1583. tmp=gArchEmoteConversion(text,1);
  1584. if(tmp!=text){
  1585. text=tmp;
  1586. moded=true;
  1587. }
  1588. }
  1589. for(var i in json3){
  1590. var str='[img]'+json3[i]["loc"]+'[/img]';
  1591. if(text.indexOf(str)!=-1){
  1592. moded=true;
  1593. str='\\[img\\]'+str2regExStr(json3[i]["loc"])+'\\[\\/img\\]';
  1594. text=text.replace(new RegExp(str,'g'),json3[i]["code"]);
  1595. }
  1596. }
  1597. if(moded){
  1598. textBox.value=text;
  1599. }
  1600. return;
  1601. }
  1602. function emoteCode2ImgCode(form,textBox,e){
  1603. form.addEventListener(e,function(){
  1604. moded=false;
  1605. var formats=getFormats();
  1606. if(formats){
  1607. if(loc.indexOf('/forum/compose/')!=-1 || (loc.indexOf('/forum/')!=-1&&loc.indexOf('/t.')!=-1)){
  1608. var type='FF';
  1609. }
  1610. else if(loc.indexOf('/guilds/posting.php')!=-1){
  1611. var type='GF';
  1612. }
  1613. else if(loc.indexOf('/profile/privmsg.php')!=-1){
  1614. var type='PM';
  1615. }
  1616. else if(loc.indexOf('/j/')!=-1||loc.indexOf('/journal/')!=-1){
  1617. var type='JC';
  1618. }
  1619. else{
  1620. var type='PC';
  1621. }
  1622. var text=autoFormat(formats['auto'][type],textBox,false);
  1623. moded=true;
  1624. }
  1625. else{
  1626. var text=textBox.value;
  1627. }
  1628. for(var i in json){
  1629. var str=json[i]["code"];
  1630. if(text.indexOf(str)!=-1){
  1631. moded=true;
  1632. str=str2regExStr(str);
  1633. var regEx=new RegExp(str,'g');
  1634. text=text.replace(regEx,'[img]http://public.tektek.org/img/emotes/'+json[i]["loc"]+'.gif[/img]');
  1635. }
  1636. }
  1637. if(gArch){
  1638. var tmp=gArchEmoteConversion(text,2);
  1639. if(tmp!=text){
  1640. text=tmp;
  1641. moded=true;
  1642. }
  1643. }
  1644. for(var i in json3){
  1645. var str=json3[i]["code"];
  1646. if(text.indexOf(str)!=-1){
  1647. moded=true;
  1648. str=str2regExStr(str);
  1649. var regEx=new RegExp(str,'g');
  1650. text=text.replace(regEx,'[img]'+json3[i]["loc"]+'[/img]');
  1651. }
  1652. }
  1653. if(moded){
  1654. textBox.value=text;
  1655. }
  1656. },false);
  1657. }
  1658. function gArchEmoteConversion(text,mode){
  1659. if(mode==2){
  1660. for(var i in json2){
  1661. var str=json2[i]["code"];
  1662. if(text.indexOf(str)!=-1){
  1663. str=str2regExStr(str);
  1664. var regEx=new RegExp(str,'g');
  1665. text=text.replace(regEx,'[img]http://i5.photobucket.com/albums/y176/absobloodylutely/'+json2[i]["loc"]+'[/img]');
  1666. }
  1667. }
  1668. }
  1669. else{
  1670. for(var i in json2){
  1671. var str='[img]http://i5.photobucket.com/albums/y176/absobloodylutely/'+json2[i]["loc"]+'[/img]';
  1672. if(text.indexOf(str)!=-1){
  1673. str='\\[img\\]http:\\/\\/i5.photobucket.com\\/albums\\/y176\\/absobloodylutely\\/'+json2[i]["loc"]+'\\[\\/img\\]';
  1674. text=text.replace(new RegExp(str,'g'),json2[i]["code"]);
  1675. }
  1676. str='[img]http://gaiarch.gaiatools.com/emotes/'+json2[i]["loc"]+'[/img]';
  1677. if(text.indexOf(str)!=-1){
  1678. str='\\[img\\]http:\\/\\/gaiarch.gaiatools.com\\/emotes\\/'+json2[i]["loc"]+'\\[\\/img\\]';
  1679. text=text.replace(new RegExp(str,'g'),json2[i]["code"]);
  1680. }
  1681. }
  1682. }
  1683. return text;
  1684. }
  1685. function insertScript(){
  1686. var script=document.createElement('script');
  1687. script.type="text/javascript";// got this function from http://s.cdn.gaiaonline.com/src/bbcode_editor-rev2.js made minor adjustments
  1688. script.src='data:text/javascript;charset=utf-8,function emoticon2(text){var txtarea=document.getElementsByClassName("bbcodable")[0];if(!txtarea){var txtarea=document.getElementById("qr_text");};if(txtarea.createTextRange&&txtarea.caretPos){var caretPos=txtarea.caretPos;caretPos.text=caretPos.text.charAt(caretPos.text.length-1)===" "?caretPos.text+text+(" "):caretPos.text+text;txtarea.focus();}else{txtarea.value+=text;txtarea.focus();}return false;}';
  1689. getTag('head').appendChild(script);
  1690. }
  1691. function insertEmoteStuff(){
  1692. GM_addStyle('#emoticons {margin:0;padding4px 0 0 0;list-style:none;}#emoticons li{margin-bottom:4px;margin-right:6px;float:left;list-style:none;}#emoticons li a {display:block;text-decoration:none;width:15px;height:17px;border:0;overflow:hidden;background:url(http://public.tektek.org/img/emotes/ic_emote_sprite.gif) left top no-repeat;text-indent:-5000em;}#emoticons .biggrin {background-position:-315px;}#emoticons .smile {background-position:-330px;}#emoticons .embarassed {background:url(http://public.tektek.org/img/emotes/icon_redface.gif) left top no-repeat;}#emoticons .crying {background:url(http://public.tektek.org/img/emotes/icon_crying.gif) left top no-repeat;}#emoticons .stare {background-position:-195px;}#emoticons .xd {background-position:-285px;}#emoticons .nodding {background:url(http://public.tektek.org/img/emotes/icon_nodding.gif) left top no-repeat;}#emoticons .biglaugh {background-position:-405px;}#emoticons .gonk {background-position:-135px;}#emoticons .scream {background-position:-90px;}#emoticons .stressed {background-position:-120px;}#emoticons .sweat {background:url(http://public.tektek.org/img/emotes/icon_sweatdrop.gif) left top no-repeat;}#emoticons .heart {background:url(http://public.tektek.org/img/emotes/icon_heart.gif) left top no-repeat;}#emoticons .domokun {background:url(http://public.tektek.org/img/emotes/icon_domokun.gif) left top no-repeat;}#emoticons .xp {background-position:-150px;}#emoticons .whee {background-position:-345px;}#emoticons .wink {background-position:-375px;}#emoticons .sad {background-position:-165px;}#emoticons .surprised {background-position:-300px;}#emoticons .shocked {background-position:-210px;}#emoticons .confused {background-position:-225px;}#emoticons .cool {background-position:-390px;}#emoticons .laughing {background:url(http://public.tektek.org/img/emotes/icon_lol.gif) left top no-repeat;}#emoticons .mad {background-position:-105px;}#emoticons .razz {background-position:-420px;}#emoticons .verysad {background:url(http://public.tektek.org/img/emotes/icon_verysad.gif) left top no-repeat;}#emoticons .evil {background-position:-75px;}#emoticons .twisted {background-position:-60px;}#emoticons .rolleyes {background:url(http://public.tektek.org/img/emotes/icon_rolleyes.gif) left top no-repeat;}#emoticons .exclaim {background-position:-15px;}#emoticons .question {background-position:-435px;}#emoticons .idea {background-position:0;}#emoticons .arrow {background-position:-30px;}#emoticons .neutral {background-position:-240px;}#emoticons .mrgreen {background-position:-270px;}#emoticons .ninja {background:url(http://public.tektek.org/img/emotes/icon_ninja.gif) left top no-repeat;}#emoticons .cutelaugh {background-position:-255px;}#emoticons .rofl {background:url(http://public.tektek.org/img/emotes/icon_rofl.gif) left top no-repeat;}#emoticons .pirate {background:url(http://public.tektek.org/img/emotes/icon_pirate.gif) left top no-repeat;}#emoticons .talk2hand {background:url(http://public.tektek.org/img/emotes/icon_talk2hand.gif) left top no-repeat;}#emoticons .burning {background:url(http://public.tektek.org/img/emotes/icon_burning.gif) left top no-repeat;}#emoticons .cheese {background:url(http://public.tektek.org/img/emotes/icon_cheese.gif) left top no-repeat;}#emoticons .dramallama {background:url(http://public.tektek.org/img/emotes/icon_dramallama.gif) left top no-repeat;}#emoticons .wahmbulance {background:url(http://public.tektek.org/img/emotes/icon_wahmbulance.gif) left top no-repeat;}#emoticons .emo {background:url(http://public.tektek.org/img/emotes/icon_emo.gif) left top no-repeat;}');
  1693. GM_addStyle('#emoticons .cat_biggrin{background:url(/images/common/cat_smilies/icon_biggrin.gif) no-repeat;width:19px;height:19px;}#emoticons .cat_smile{background:url(/images/common/cat_smilies/icon_smile.gif) no-repeat;width:19px;height:19px;}#emoticons .cat_embarassed{background:url(/images/common/cat_smilies/icon_redface.gif) no-repeat;width:19px;height:19px;}#emoticons .cat_crying{background:url(/images/common/cat_smilies/icon_crying.gif) no-repeat;width:19px;height:19px;}#emoticons .cat_stare{background:url(/images/common/cat_smilies/icon_stare.gif) no-repeat;width:19px;height:19px;}#emoticons .cat_xd{background:url(/images/common/cat_smilies/icon_xd.gif) no-repeat;width:19px;height:19px;}#emoticons .cat_nodding{background:url(/images/common/cat_smilies/icon_nodding.gif) no-repeat;width:19px;height:19px;}#emoticons .cat_biglaugh{background:url(/images/common/cat_smilies/icon_blaugh.gif) no-repeat;width:19px;height:19px;}#emoticons .cat_gonk{background:url(/images/common/cat_smilies/icon_gonk.gif) no-repeat;width:19px;height:19px;}#emoticons .cat_scream{background:url(/images/common/cat_smilies/icon_scream.gif) no-repeat;width:19px;height:19px;}#emoticons .cat_stressed{background:url(/images/common/cat_smilies/icon_stressed.gif)no-repeat;width:19px;height:19px;}#emoticons .cat_sweat{background:url(/images/common/cat_smilies/icon_sweatdrop.gif) no-repeat;width:19px;height:19px;}#emoticons .cat_heart{background:url(/images/common/cat_smilies/icon_heart.gif) no-repeat;width:19px;height:19px;}#emoticons .cat_domokun{background:url(/images/common/cat_smilies/icon_domokun.gif) no-repeat;width:19px;height:19px;}#emoticons .cat_xp{background:url(/images/common/cat_smilies/icon_xp.gif) no-repeat;width:19px;height:19px;}#emoticons .cat_whee{background:url(/images/common/cat_smilies/icon_whee.gif) no-repeat;width:19px;height:19px;}#emoticons .cat_wink{background:url(/images/common/cat_smilies/icon_wink.gif) no-repeat;width:19px;height:19px;}#emoticons .cat_sad{background:url(/images/common/cat_smilies/icon_sad.gif) no-repeat;width:19px;height:19px;}#emoticons .cat_surprised{background:url(/images/common/cat_smilies/icon_surprised.gif) no-repeat;width:19px;height:19px;}#emoticons .cat_shocked{background:url(/images/common/cat_smilies/icon_eek.gif) no-repeat;width:19px;height:19px;}#emoticons .cat_confused{background:url(/images/common/cat_smilies/icon_confused.gif) no-repeat;width:19px;height:19px;}#emoticons .cat_cool{background:url(/images/common/cat_smilies/icon_cool.gif) no-repeat;width:19px;height:19px;}#emoticons .cat_laughing{background:url(/images/common/cat_smilies/icon_lol.gif) no-repeat;width:19px;height:19px;}#emoticons .cat_mad{background:url(/images/common/cat_smilies/icon_mad.gif) no-repeat;width:19px;height:19px;}#emoticons .cat_razz{background:url(/images/common/cat_smilies/icon_razz.gif) no-repeat;width:19px;height:19px;}#emoticons .cat_verysad{background:url(/images/common/cat_smilies/icon_cry.gif) no-repeat;width:19px;height:19px;}#emoticons .cat_evil{background:url(/images/common/cat_smilies/icon_evil.gif) no-repeat;width:19px;height:19px;}#emoticons .cat_twisted{background:url(/images/common/cat_smilies/icon_twisted.gif) no-repeat;width:19px;height:19px;}#emoticons .cat_rolleyes{background:url(/images/common/cat_smilies/icon_rolleyes.gif) no-repeat;width:19px;height:19px;}#emoticons .cat_exclaim{background:url(/images/common/cat_smilies/icon_exclaim.gif) no-repeat;width:19px;height:19px;}#emoticons .cat_question{background:url(/images/common/cat_smilies/icon_question.gif) no-repeat;width:19px;height:19px;}#emoticons .cat_idea{background:url(/images/common/cat_smilies/icon_idea.gif) no-repeat;width:19px;height:19px;}#emoticons .cat_arrow{background:url(/images/common/cat_smilies/icon_arrow.gif) no-repeat;width:19px;height:19px;}#emoticons .cat_neutral{background:url(/images/common/cat_smilies/icon_neutral.gif)no-repeat;width:19px;height:19px;}#emoticons .cat_mrgreen{background:url(/images/common/cat_smilies/icon_mrgreen.gif) no-repeat;width:19px;height:19px;}#emoticons .cat_ninja{background:url(/images/common/cat_smilies/icon_ninja.gif) no-repeat;width:19px;height:19px;}#emoticons .cat_cutelaugh{background:url(/images/common/cat_smilies/icon_4laugh.gif) no-repeat;width:19px;height:19px;}#emoticons .cat_rofl{background:url(/images/common/cat_smilies/icon_rofl.gif) no-repeat;width:19px;height:19px;}#emoticons .cat_pirate{background:url(/images/common/cat_smilies/icon_pirate.gif) no-repeat;width:19px;height:19px;}#emoticons .cat_talk2hand{background:url(/images/common/cat_smilies/icon_talk2hand.gif) no-repeat;width:19px;height:19px;}#emoticons .cat_burning{background:url(/images/common/cat_smilies/icon_burning.gif) no-repeat;width:19px;height:19px;}#emoticons .cat_cheese{background:url(/images/common/cat_smilies/icon_cheese.gif) no-repeat;width:19px;height:19px;}#emoticons .cat_dramallama{background:url(/images/common/cat_smilies/icon_dramallama.gif) no-repeat;width:19px;height:19px;}#emoticons .cat_wahmbulance{background:url(/images/common/cat_smilies/icon_wahmbulance.gif) no-repeat;width:19px;height:19px;}#emoticons .cat_emo{background:url(/images/common/cat_smilies/icon_emo.gif) no-repeat;width:19px;height:19px;}#emoticons .yum_burger{background:url(/images/common/yummy_smilies/icon_burger.gif) left top no-repeat;width:19px;height:19px;}#emoticons .yum_cupcake{background:url(/images/common/yummy_smilies/icon_cupcake.gif) left top no-repeat;width:19px;height:19px;}#emoticons .yum_donut{background:url(/images/common/yummy_smilies/icon_donut.gif) left top no-repeat;width:19px;height:19px;}#emoticons .yum_hotdog{background:url(/images/common/yummy_smilies/icon_hotdog.gif) left top no-repeat;width:19px;height:19px;}#emoticons .yum_onigiri{background:url(/images/common/yummy_smilies/icon_onigiri.gif) left top no-repeat;width:19px;height:19px;}#emoticons .yum_pie{background:url(/images/common/yummy_smilies/icon_pie.gif) left top no-repeat;width:19px;height:19px;}#emoticons .yum_pizza{background:url(/images/common/yummy_smilies/icon_pizza.gif) left top no-repeat;width:19px;height:19px;}#emoticons .yum_puddi{background:url(/images/common/yummy_smilies/icon_puddi.gif) left top no-repeat;width:19px;height:19px;}#emoticons .yum_strawberry{background:url(/images/common/yummy_smilies/icon_strawberry.gif) left top no-repeat;width:19px;height:19px;}#emoticons .yum_tea{background:url(/images/common/yummy_smilies/icon_tea.gif) left top no-repeat;width:19px;height:19px;}#emoticons .yum_bacon{background:url(/images/common/yummy_smilies/icon_bacon.png) left top no-repeat;width:19px;height:19px;}#emoticons .yum_coldone{background:url(/images/common/yummy_smilies/icon_coldone.png) left top no-repeat;width:19px;height:19px;}#emoticons .yum_icecreampie{background:url(/images/common/yummy_smilies/icon_creampie.png) left top no-repeat;width:19px;height:19px;}#emoticons .yum_pumpkinpie{background:url(/images/common/yummy_smilies/icon_pumpkinpie.png) left top no-repeat;width:19px;height:19px;}#emoticons .yum_salmon{background:url(/images/common/yummy_smilies/icon_salmon.png) left top no-repeat;width:19px;height:19px;}#emoticons .yum_sausage{background:url(/images/common/yummy_smilies/icon_sausage.png) left top no-repeat;width:19px;height:19px;}#emoticons .yum_shrimp{background:url(/images/common/yummy_smilies/icon_shrimp.png) left top no-repeat;width:19px;height:19px;}#emoticons .yum_strawberrypie{background:url(/images/common/yummy_smilies/icon_strawberrypie.png) left top no-repeat;font-size:19px;}#emoticons .yum_tamago{background:url(/images/common/yummy_smilies/icon_tamago.png) left top no-repeat;width:19px;height:19px;}#emoticons .yum_tuna{background:url(/images/common/yummy_smilies/icon_tuna.png) left top no-repeat;width:19px;height:19px;}#emoticons .yum_wasabipie{background:url(/images/common/yummy_smilies/icon_wasabipie.png) left top no-repeat;width:19px;height:19px;}#emoticons .emotion_awesomeface{background:url(/images/common/emotion_smilies/icon_awesomeface.gif) left top no-repeat;width:19px;height:19px;}#emoticons .emotion_dealwithit{background:url(/images/common/emotion_smilies/icon_dealwithit.gif) left top no-repeat;width:19px;height:19px;}#emoticons .emotion_facepalm{background:url(/images/common/emotion_smilies/icon_facepalm.gif) left top no-repeat;width:19px;height:19px;}#emoticons .emotion_bigheart{background:url(/images/common/emotion_smilies/icon_heart.gif) left top no-repeat;width:19px;height:19px;}#emoticons .emotion_jawdrop{background:url(/images/common/emotion_smilies/icon_jawdrop.gif) left top no-repeat;width:19px;height:19px;}#emoticons .emotion_kirakira{background:url(/images/common/emotion_smilies/icon_kirakira.gif) left top no-repeat;width:19px;height:19px;}#emoticons .emotion_omnomnom{background:url(/images/common/emotion_smilies/icon_omnomnom.gif) left top no-repeat;width:19px;height:19px;}#emoticons .emotion_puke{background:url(/images/common/emotion_smilies/icon_puke.gif) left top no-repeat;width:19px;height:19px;}#emoticons .emotion_sweatdrop{background:url(/images/common/emotion_smilies/icon_sweatdrop.gif) left top no-repeat;width:19px;height:19px;}#emoticons .emotion_bigvein{background:url(/images/common/emotion_smilies/icon_vein.gif) left top no-repeat;width:19px;height:19px;}#emoticons .emotion_yatta{background:url(/images/common/emotion_smilies/icon_yatta.gif) left top no-repeat;width:19px;height:19px;}#emoticons .emotion_0A0{background:url(/images/common/emotion_smilies/icon_0A0.png) left top no-repeat;width:19px;height:19px;}#emoticons .emotion_8c{background:url(/images/common/emotion_smilies/icon_8C.png) left top no-repeat;width:19px;height:19px;}#emoticons .emotion_bandaid{background:url(/images/common/emotion_smilies/icon_bandaid.png) left top no-repeat;width:19px;height:19px;}#emoticons .emotion_brofist{background:url(/images/common/emotion_smilies/icon_brofist.gif) left top no-repeat;width:19px;height:19px;}#emoticons .emotion_c8{background:url(/images/common/emotion_smilies/icon_C8.png) left top no-repeat;width:19px;height:19px;}#emoticons .emotion_donotwant{background:url(/images/common/emotion_smilies/icon_donotwant.png) left top no-repeat;width:19px;height:19px;}#emoticons .emotion_dowant{background:url(/images/common/emotion_smilies/icon_dowant.png) left top no-repeat;width:19px;height:19px;}#emoticons .emotion_drool{background:url(/images/common/emotion_smilies/icon_drool.png) left top no-repeat;width:19px;height:19px;}#emoticons .emotion_eyebrow{background:url(/images/common/emotion_smilies/icon_eyebrow.png) left top no-repeat;width:19px;height:19px;}#emoticons .emotion_hug{background:url(/images/common/emotion_smilies/icon_hug.png) left top no-repeat;width:19px;height:19px;}#emoticons .emotion_zombie{background:url(/images/common/emotion_smilies/icon_zombie.png) left top no-repeat;width:19px;height:19px;}#emoticons .emotion_zzz{background:url(/images/common/emotion_smilies/icon_zzz.gif) left top no-repeat;width:19px;height:19px;}#emoticons .gaia_angelleft{background:url(/images/common/gaia_smilies/icon_angelicwing_left.gif) left top no-repeat;width:19px;height:19px;}#emoticons .gaia_angelright{background:url(/images/common/gaia_smilies/icon_angelicwing_right.gif) left top no-repeat;width:19px;height:19px;}#emoticons .gaia_crown{background:url(/images/common/gaia_smilies/icon_crown.gif) left top no-repeat;width:19px;height:19px;}#emoticons .gaia_gaiagold{background:url(/images/common/gaia_smilies/icon_gaiagold.gif) left top no-repeat;width:19px;height:19px;}#emoticons .gaia_nitemareleft{background:url(/images/common/gaia_smilies/icon_nitemarewing_left.gif) left top no-repeat;width:19px;height:19px;}#emoticons .gaia_nitemareright{background:url(/images/common/gaia_smilies/icon_nitemarewing_right.gif) left top no-repeat;width:19px;height:19px;}#emoticons .gaia_spoons{background:url(/images/common/gaia_smilies/icon_spoons.gif) left top no-repeat;width:19px;height:19px;}#emoticons .gaia_star{background:url(/images/common/gaia_smilies/icon_star.gif) left top no-repeat;width:19px;height:19px;}#emoticons .gaia_kittenstar{background:url(/images/common/gaia_smilies/icon_starkitten.gif) left top no-repeat;width:19px;height:19px;}#emoticons .gaia_diamond{background:url(/images/common/gaia_smilies/icon_diamond.png) left top no-repeat;width:19px;height:19px;}');
  1694. var emotes='';
  1695. for(var i in json4){
  1696. emotes+='<li><a title="'+json4[i]['text']+' - '+json4[i]['code']+'" class="emoticon '+json4[i]['class']+'" href="#" onclick="emoticon2(this.title.slice(this.title.indexOf(\' - \')+3));return false;">'+json4[i]['text']+'</a></li>';
  1697. }
  1698. if(emote5){
  1699. for(var i in json5){
  1700. emotes+='<li class="catsPlus"><a title="'+json5[i]['text']+' - '+json5[i]['code']+'" class="emoticon '+json5[i]['class']+'" href="#" onclick="emoticon2(this.title.slice(this.title.indexOf(\' - \')+3));return false;">'+json5[i]['text']+'</a></li>';
  1701. }
  1702. }
  1703. return '<ul id="emoticons">'+emotes+'</ul>';
  1704. }
  1705. function insertStandardEmoticons(ele,m,s){
  1706. var tek=[],cust=[],css='#editor #emoticons.tektek li a,#editor #emoticons.gaiarch li a,#editor #emoticons.custom li a{background-repeat:no-repeat;background-position:center center;}#editor #emoticons.gaiarch li a,#editor #emoticons.custom li a{-moz-background-size:contain;background-size:contain;-webkit-background-size:contain;}',sizes=[];
  1707. if(s==1){
  1708. for(var i in json){
  1709. if(m==4||m==3){
  1710. var li=document.createElement('li');
  1711. li.className='tektekEmote';
  1712. li.innerHTML='<a '+((m==2||m==3||m==4)?'onclick="return emoticon2(\''+((m==3)?'[img]http://public.tektek.org/img/emotes/'+json[i]['loc']+'.gif[/img]':json[i]['code'])+'\')"':'rel="emoticon-control"')+' title="'+json[i]['name']+' - '+((m==0||m==3||m==4)?json[i]['code']:'[img]http://public.tektek.org/img/emotes/'+json[i]['loc']+'.gif[/img]')+'" style="background-image:url(\'http://public.tektek.org/img/emotes/'+json[i]['menuloc']+'.gif\');width:'+json[i]['size']+'px" href="#"></a>';
  1713. ele.appendChild(li);
  1714. }
  1715. else{
  1716. tek.push({"text":json[i]["name"],"code":json[i]["code"],"class":json[i]["menuloc"]});
  1717. css+="#editor #emoticons.tektek ."+json[i]["menuloc"]+"{background-image:url('http://public.tektek.org/img/emotes/"+json[i]["menuloc"]+".gif');width:"+json[i]["size"]+"px;}";
  1718. }
  1719. }
  1720. if(m!=4&&m!=3){
  1721. unsafeWindow.YAHOO.gaia.Emotes["Tektek"]=tek;
  1722. }
  1723. if(gArch){
  1724. css+=insertGaiArchEmote(ele,2,m);
  1725. }
  1726. }
  1727. for(var i in json3){
  1728. if(m==4||m==3){
  1729. var li=document.createElement('li');
  1730. li.className='customEmote';
  1731. li.innerHTML='<a '+((m==2||m==3||m==4)?'onclick="return emoticon2(\''+((m==3)?'[img]'+json3[i]['loc']+'[/img]':json3[i]['code'])+'\')"':'rel="emoticon-control"')+' title="'+json3[i]['name']+' - '+((m==0||m==3||m==4)?json3[i]['code']:'[img]'+json[i]['loc']+'[/img]')+'" style="-moz-background-size:contain;background-size:contain;background-image:url(\''+json3[i]['loc']+'\');width:'+json3[i]['size']+'px" href="#"></a>';
  1732. ele.appendChild(li);
  1733. }
  1734. else{
  1735. var name="emote-"+json3[i]["loc"].slice(json3[i]["loc"].lastIndexOf('/')+1,json3[i]["loc"].lastIndexOf('.'));
  1736. cust.push({"text":json3[i]["name"],"code":json3[i]["code"],"class":name});
  1737. css+="#editor #emoticons.custom ."+name+"{background-image:url('"+json3[i]["loc"]+"');width:"+json3[i]["size"]+"px;}";
  1738. }
  1739. }
  1740. if(m!=4&&m!=3){
  1741. if(s==2&&cust.length==0){
  1742. delete(unsafeWindow.YAHOO.gaia.Emotes["Custom"]);
  1743. }
  1744. else if(cust.length>0){
  1745. unsafeWindow.YAHOO.gaia.Emotes["Custom"]=cust;
  1746. }
  1747. GM_addStyle(css);
  1748. /*if(s==2){
  1749. var e=getId('emoticon_set');
  1750. if(e.value=="Custom"){
  1751. if(cust.length==0){
  1752. e.selectedIndex=0;
  1753. }
  1754. sendEvent(getId('emoticon_set'),"change");
  1755. }
  1756. }*/
  1757. gaiaEmotesReload();
  1758. }
  1759. }
  1760. function insertGaiArchEmote(ele,mode,m){
  1761. var q=getId('qr_container');
  1762. var html="";
  1763. if(q){
  1764. q.className='gArch';
  1765. }
  1766. var arch=[],css='';
  1767. for(var i in json2){
  1768. if(!q&&m!=3){
  1769. var name="emote-"+json2[i]['loc'].substr(0,json2[i]['loc'].indexOf('.'));// class names apparently do not work in css if they start with numbers O.o
  1770. arch.push({"text":json2[i]['name'],"class":name,"code":json2[i]["code"]});
  1771. css+="#editor #emoticons.gaiarch ."+name+"{background-image:url('http://i5.photobucket.com/albums/y176/absobloodylutely/"+json2[i]["loc"]+"');width:"+json2[i]["size"]+"px;}";
  1772. }
  1773. else{
  1774. var li=document.createElement('li');
  1775. li.className='gArchEmote';
  1776. li.innerHTML='<a '+((m==2||m==3||m==4)?'onclick="return emoticon2(\''+((m==3)?'[img]http://i5.photobucket.com/albums/y176/absobloodylutely/'+json2[i]['loc']+'[/img]':json2[i]['code'])+'\')"':'rel="emoticon-control"')+' title="'+json2[i]['name']+' - '+((m==0||m==3||m==4)?json2[i]['code']:'[img]http://i5.photobucket.com/albums/y176/absobloodylutely/'+json2[i]['loc']+'[/img]')+'" style="-moz-background-size:contain;background-size:contain;-webkit-background-size:contain;background-repeat:no-repeat;background-image:url(\'http://i5.photobucket.com/albums/y176/absobloodylutely/'+json2[i]['loc']+'\');width:'+json2[i]['size']+'px" href="#"></a>';
  1777. ele.appendChild(li);
  1778. //html+='<a '+((m==2||m==3||m==4)?'onclick="return emoticon2(\''+((m==3)?'[img]http://i5.photobucket.com/albums/y176/absobloodylutely/'+json2[i]['loc']+'[/img]':json2[i]['code'])+'\')"':'rel="emoticon-control"')+' title="'+json2[i]['name']+' - '+((m==0||m==3||m==4)?json2[i]['code']:'[img]http://i5.photobucket.com/albums/y176/absobloodylutely/'+json2[i]['loc']+'[/img]')+'" style="-moz-background-size:contain;background-size:contain;-webkit-background-size:contain;background-repeat:no-repeat;background-image:url(\'http://i5.photobucket.com/albums/y176/absobloodylutely/'+json2[i]['loc']+'\');width:'+json2[i]['size']+'px" href="#"></a>';
  1779. }
  1780. }
  1781. if(!q&&m!=3){
  1782. unsafeWindow.YAHOO.gaia.Emotes["GaiArch"]=arch;
  1783. if(mode==0&&m==0){
  1784. gaiaEmotesReload();
  1785. GM_addStyle(css);
  1786. }
  1787. else{
  1788. return css;
  1789. }
  1790. }
  1791. }
  1792. /* My mod of Mindset's code http://userscripts.org/scripts/review/84591 */
  1793. function preview(){//this function has had a code over haul
  1794. var thread = loc.substring(loc.lastIndexOf(".")+1,loc.lastIndexOf("/"));
  1795. if (thread.indexOf("_") != -1 ){
  1796. thread = thread.substring(0,thread.lastIndexOf("_"));
  1797. }
  1798. var ele=document.createElement('form');
  1799. ele.style.display='none';
  1800. ele.setAttribute('action','/forum/compose/entry/new/'+thread+'/');
  1801. ele.setAttribute('method','post');
  1802. ele.innerHTML='<textarea name="message">'+getId('qr_text').value+'</textarea><input type="text" value="preview" name="action_preview"/>';
  1803. document.body.appendChild(ele);
  1804. emoteCode2ImgCode(ele,ele.childNodes[0],'submit');
  1805. sendEvent(ele,'submit');// WTF ele.submit() does not trigger event
  1806. }
  1807. function importMindsets_QuickReplyExtra(){
  1808. var previewButton = document.createElement('a');
  1809. previewButton.href="javascript:{}";
  1810. previewButton.id="qr_preview";
  1811. previewButton.className="cta-button-sm gray-button";
  1812. previewButton.setAttribute('tabindex',"4");
  1813. previewButton.setAttribute('style','float: right; margin: 10px 15px 0 0;');
  1814. previewButton.innerHTML='<span class="button_text">Preview</span>';
  1815. var formatbar=document.createElement('div');
  1816. formatbar.id='editor';
  1817. formatbar.innerHTML='<div id="format_controls"><ul class="format-text"><li><a href="javascript:{}" id="format-bold" class="bold" title="Bold text - [b][/b]">Bold text</a></li><li><a href="javascript:{}" id="format-italics" class="italics" title="Italicize text - [i][/i]">Italicize text</a></li><li><a href="javascript:{}" id="format-underline" class="underline" title="Underline text - [u][/u]">Underline text</a></li><li><a href="javascript:{}" id="format-strike" class="strike" title="Strike text - [strike][/strike]">Strike text</a></li></ul><ul class="format-elements"><li><a href="javascript:{}" id="format-quote" class="quote" title="Quote - [quote][/quote]">Quote</a></li><li><a href="javascript:{}" id="format-code" class="code" title="Code - [code][/code]">Code</a></li></ul><ul class="format-links"><li><a href="javascript:{}" id="format-url" class="url" title="Add URL - [url=http://restofurl]Webpage Title[/url]">Add URL</a></li><li><a href="javascript:{}" id="format-image" class="image" title="Add image - [img]http://restofurl[/img]">Add Image</a></li></ul></div>';
  1818. var ele=getId("qr_submit");
  1819. ele.parentNode.insertBefore(previewButton,ele.nextSibling);
  1820. ele=getId("qr_text");
  1821. ele.parentNode.insertBefore(formatbar,ele);
  1822. previewButton.addEventListener('click',preview,false);
  1823. getId("format-bold").addEventListener('click',function(){format("b");},false);
  1824. getId("format-italics").addEventListener('click',function(){format("i");},false);
  1825. getId("format-underline").addEventListener('click',function(){format("u");},false);
  1826. getId("format-strike").addEventListener('click',function(){format("strike");},false);
  1827. getId("format-quote").addEventListener('click',function(){format("quote");},false);
  1828. getId("format-code").addEventListener('click',function(){format("code");},false);
  1829. getId("format-url").addEventListener('click',insert_link,false);
  1830. getId("format-image").addEventListener('click',insert_img,false);
  1831. GM_addStyle("/* FORMAT TOOLS */ \n\
  1832. #editor #format_controls {padding:13px 8px 0 0;} \n\
  1833. #editor #format_controls ul{margin:0 20px 0 0;} \n\
  1834. /* The buttons have an on/off state and use a sprite to save on http requests */ \n\
  1835. #editor #format_controls li {float:left;margin-right:2px;list-style-type:none;} \n\
  1836. #editor #format_controls li a { height:19px; width:23px; display:block; \n\
  1837. background:url(/src/js/gaia/widgets/editor/btn_editor_toolbar_new.gif) no-repeat; \n\
  1838. text-indent:-9999em; overflow:hidden; line-height:100%; padding: 0; } \n\
  1839. #editor #format_controls #format-bold{background-position:left 0;width:23px;} \n\
  1840. #editor #format_controls #format-bold:hover{background-position:left bottom;} \n\
  1841. #editor #format_controls #format-italics{background-position:-23px 0;} \n\
  1842. #editor #format_controls #format-italics:hover{background-position:-23px bottom;} \n\
  1843. #editor #format_controls #format-underline{background-position:-46px 0;} \n\
  1844. #editor #format_controls #format-underline:hover{background-position:-46px bottom;} \n\
  1845. #editor #format_controls #format-strike{background-position:-69px 0;} \n\
  1846. #editor #format_controls #format-strike:hover{background-position:-69px bottom;} \n\
  1847. #editor #format_controls #format-quote{background-position:-220px 0;width:43px;} \n\
  1848. #editor #format_controls #format-quote:hover{background-position:-220px bottom;} \n\
  1849. #editor #format_controls #format-code{background-position:-263px 0;width:36px;} \n\
  1850. #editor #format_controls #format-code:hover{background-position:-263px bottom;} \n\
  1851. #editor #format_controls #format-url{background-position:-299px 0;width:36px;} \n\
  1852. #editor #format_controls #format-url:hover{background-position:-299px bottom;} \n\
  1853. #editor #format_controls #format-image{background-position:-335px 0;width:36px;} \n\
  1854. #editor #format_controls #format-image:hover{background-position:-335px bottom;} \n\
  1855. ");
  1856. }
  1857. function format(tag){ // insert format tags
  1858. if(typeof textBox.selectionStart != "undefined"){
  1859. var before, after, selection;
  1860. before = textBox.value.substring(0, textBox.selectionStart);
  1861. str = textBox.value.substring(textBox.selectionStart, textBox.selectionEnd);
  1862. after = textBox.value.substring(textBox.selectionEnd, textBox.value.length);
  1863. textBox.value = String.concat(before, "[" + tag + "]", str, "[/" + tag + "]", after);
  1864. }
  1865. textBox.focus();
  1866. }
  1867. function insert_link(){ // insert a link
  1868. var link = prompt("Enter your URL","http://");
  1869. var title;
  1870. if(link != null){
  1871. if(typeof textBox.selectionStart != "undefined"){
  1872. var before, after, selection;
  1873. before = textBox.value.substring(0, textBox.selectionStart);
  1874. str = textBox.value.substring(textBox.selectionStart, textBox.selectionEnd);
  1875. after = textBox.value.substring(textBox.selectionEnd, textBox.value.length);
  1876. if (!str){ // no text selected
  1877. title = prompt("Enter the webpage title","Webpage Title");
  1878. }
  1879. else{
  1880. title = prompt("Enter the webpage title",str);
  1881. }
  1882. var newstr = "[url=" + link + "]" + title + "[/url]";
  1883. textBox.value = String.concat(before, newstr, after);
  1884. }
  1885. }
  1886. textBox.focus();
  1887. }
  1888. function insert_img(){ // insert an image
  1889. var image = prompt("Enter your image URL","http://");
  1890. if(image != null){
  1891. if(typeof textBox.selectionStart != "undefined"){ //all other browsers
  1892. var before, after, selection;
  1893. before = textBox.value.substring(0, textBox.selectionStart);
  1894. str = textBox.value.substring(textBox.selectionStart, textBox.selectionEnd);
  1895. after = textBox.value.substring(textBox.selectionEnd, textBox.value.length);
  1896. var newstr = "[img]" + image + "[/img] " + str;
  1897. textBox.value = String.concat(before, newstr, after);
  1898. }
  1899. }
  1900. textBox.focus();
  1901. }
  1902. /* end Mindset's code */
  1903. var source,m,loc;
  1904. loc=document.location.href;
  1905. if(loc.indexOf('/forum/compose/')!=-1||loc.indexOf('/profile/privmsg.php')!=-1){
  1906. source=1;
  1907. m=0;
  1908. }
  1909. else if(loc.indexOf('/guilds/posting.php')!=-1||loc.indexOf('/j/')!=-1||loc.indexOf('/journal/')!=-1){
  1910. source=2;
  1911. m=0;
  1912. }
  1913. else if((loc.indexOf('/profiles/')!=-1||loc.indexOf('/p/')!=-1||loc.indexOf('/profiles?')!=-1||loc.indexOf('/p?')!=-1)&&loc.indexOf('mode=addcomment')!=-1){
  1914. source=3;
  1915. m=0;
  1916. }
  1917. else{
  1918. source=-1;
  1919. m=(loc.indexOf('account/signature')!=-1)?1:0;
  1920. }
  1921. var textBox=getClass('bbcodable');
  1922. if(textBox){
  1923. GM_addStyle('#editor ul#emoticons{width:100%!important;}#editor.scroll #emoticons{height:auto;max-height:84px;overflow-y:auto;}#editor #format_controls .emotion-editor{position:absolute;top:8px;right:-15px;}#editor #format_controls .emotion-editor a{background-position:-545px 0}#editor #format_controls .emotion-editor a:hover{background-position:-545px -19px;}#GM_EMOTE_CONFIG code{background-color:lightgray;font-family:monospace;}#gaia_content .admin_content #editor li{margin-left:0;}');
  1924. if(isFF){
  1925. var lb=GM_getValue('lb',true);
  1926. if(source==2){
  1927. var sigs=eval('('+GM_getValue('attachSig','{"guild":true,"journal":false}')+')');
  1928. getName('attach_sig').checked=((loc.indexOf('/guilds/posting.php')!=-1)?sigs['guild']:sigs['journal']);
  1929. }
  1930. else if(source==1){
  1931. if(loc.indexOf('/profile/privmsg.php')!=-1){
  1932. var sigs=eval('('+GM_getValue('attachSig','{"pm":false}')+')');
  1933. getName('attach_sig').checked=sigs['pm'];
  1934. }
  1935. }
  1936. unsafeWindow.YAHOO.util.Event.onAvailable('emoticons', function(){
  1937. textBox.style.marginTop='';
  1938. this.parentNode.style.position='';
  1939. relocate(textBox.parentNode,this.parentNode,textBox);
  1940. insertStandardEmoticons(this,m,1);
  1941. if(source==3){
  1942. this.style.width='75%';
  1943. }
  1944. else if(source==2){//prevent the unstopable growing editor
  1945. textBox.style.maxWidth=textBox.offsetWidth+'px';
  1946. }
  1947. else if(loc.indexOf('guilds/admin/masspm/id.')!=-1){
  1948. this.parentNode.style.marginLeft='73px';
  1949. textBox.style.marginLeft='73px';
  1950. var btn=document.createElement('a');
  1951. btn.innerHTML='<span>Settings</span>';
  1952. btn.setAttribute('onclick','return false;');
  1953. btn.setAttribute('style','margin-left:5px;');
  1954. btn.className='cta-button-sm gray-button';
  1955. btn.href='#';
  1956. getEle('button','name','btn_cancel').parentNode.appendChild(btn);
  1957. btn.addEventListener('click',function(){formatDialog(textBox,loc,-1);},false);
  1958. }
  1959. if(!lb&&(gArch||objectsCount(json3)>0)){
  1960. textBox.previousSibling.className='scroll';
  1961. }
  1962. if(m==1){
  1963. this.addEventListener('click',function(){
  1964. setTimeout(function(){sendEvent(textBox,'keyup');},0);
  1965. },false);
  1966. }
  1967. var ul=document.createElement('ul');
  1968. if(typeof JSON=='object'){
  1969. ul.className='emotion-editor';
  1970. ul.setAttribute('style','position:absolute;top:8px;right:-15px;');
  1971. ul.innerHTML='<li><a href="#" id="GM_customEmotes" title="Custom Emotein Editor">Emotion Editor</a></li>';
  1972. getId('format_controls').appendChild(ul);
  1973. ul.childNodes[0].childNodes[0].addEventListener('click',function(){
  1974. emotionEditorDialog(textBox,m);
  1975. },false);
  1976. }
  1977. getId('emoticon_set').addEventListener('change',function(){
  1978. getId("emoticons").className=this.value.toLowerCase();
  1979. },false);
  1980. },this);
  1981. }
  1982. else{//make google chrome work
  1983. var wm=getId('emoticons');
  1984. textBox.style.marginTop='';
  1985. wm.parentNode.style.position='';
  1986. if(source==3){
  1987. wm.parentNode.style.width='75%';
  1988. }
  1989. relocate(textBox.parentNode,wm.parentNode,textBox);
  1990. insertStandardEmoticons(wm,m,1);
  1991. if(m==1){
  1992. wm.addEventListener('click',function(){
  1993. sendEvent(textBox,'keyup');
  1994. },false);
  1995. }
  1996. }
  1997. var form=textBox.parentNode;
  1998. while(form.tagName!='FORM'){
  1999. form=form.parentNode;
  2000. }
  2001. if(source==3){
  2002. textBox.setAttribute('style','width:75%;margin-right:25%;');
  2003. insertCaseChanger(loc,source,textBox);
  2004. form.setAttribute('style','position:relative;');
  2005. }
  2006. if(source!=-1){
  2007. imgCode2EmoteCode(textBox);
  2008. emoteCode2ImgCode(form,textBox,'submit');
  2009. insertformatButtons(textBox,source,isFF,loc);
  2010. if(source==1||source==2){
  2011. insertCaseChanger(loc,source,textBox);
  2012. }
  2013. }
  2014. }
  2015. else if(loc.indexOf('/forum/')!=-1&&loc.indexOf('/t.')!=-1){
  2016. source=4;
  2017. insertScript();
  2018. var textBox=getId('qr_text');
  2019. emoteCode2ImgCode(getId('qr_submit'),textBox,'click');
  2020. var backgroundImg=((isFF)?GM_getResourceURL("background"):'http://i48.tinypic.com/2lbj9et.png');
  2021. GM_addStyle('#qr_container{background-position:100px 0;}#tek_stuff li{list-style:none;}#tek_stuff .emotionsHolder>ul{max-height:100%;overflow-y:auto;}#tek_stuff .emotionsHolder{height:130px;}.gArch #tek_stuff .emotionsHolder{height:150px;}a#tekSettings{margin-left:-7px;width:75px;position:relative;top:-15px;left:100px;}div#qr_container form{width:421px;}div#qr_container form #qr_text{width:389px;}div#qr_container{width:700px;}#tekformatbutons .tekformat{margin:3px;cursor:pointer;}div#tek_stuff{width:278px;position:absolute;top:0px;left:414px;height:100%;padding-left:6px;background-image:url(\''+backgroundImg+'\');background-repeat:no-repeat;background-position:top left;}.gArch a#tekSettings{margin-left:0;position:static;}div#qr_container.gArch{width:1000px;}.gArch div#tek_stuff{width:580px;}');
  2022. var div=document.createElement('div');
  2023. div.innerHTML='<div class="emotionsHolder">'+insertEmoteStuff()+'</div><div style="width:100%;text-align:center;margin-top:2px;"></div>';
  2024. div.id="tek_stuff";
  2025. textBox.parentNode.parentNode.appendChild(div);
  2026. insertStandardEmoticons(div.childNodes[0].childNodes[0],source,1);
  2027. insertformatButtons(textBox,source,isFF,loc);
  2028. importMindsets_QuickReplyExtra();
  2029. }
  2030. else if(loc.indexOf('guilds/admin/masspm/id.')!=-1){
  2031. var btn=document.createElement('a');
  2032. btn.innerHTML='<span>Settings</span>';
  2033. btn.setAttribute('onclick','return false;');
  2034. btn.setAttribute('style','margin-left:5px;');
  2035. btn.className='cta-button-sm gray-button';
  2036. btn.href='#';
  2037. getEle('button','name','btn_cancel').parentNode.appendChild(btn);
  2038. btn.addEventListener('click',function(){formatDialog(textBox,loc,-1);},false);
  2039. }
  2040. if(source==-1){
  2041. if(m==1){
  2042. if(textBox){
  2043. if(isFF){
  2044. var btn=document.createElement('a');
  2045. btn.innerHTML='<span>Settings</span>';
  2046. btn.setAttribute('onclick','return false;');
  2047. btn.setAttribute('style','margin-left:5px;');
  2048. btn.className='cta-button-sm gray-button';
  2049. btn.href='#';
  2050. form.insertBefore(btn,getEle('button','class','cta-button-sm').nextSibling);
  2051. btn.addEventListener('click',function(){formatDialog(textBox,loc,-1);},false);
  2052. var sigPreview=getId('signature-preview-fieldset');
  2053. var h1=document.createElement('h1');
  2054. h1.textContent='Signature Options';
  2055. sigPreview.parentNode.insertBefore(h1,sigPreview);
  2056. var sigs=eval('('+GM_getValue('attachSig','{"pm":false,"guild":true,"journal":false}')+')');
  2057. var span=document.createElement('span');
  2058. span.innerHTML='<input style="position:relative;top:3px;" type="checkbox"'+(sigs['pm']?' checked="checked"':'')+' id="attach2pms"/> Always attach signature in Private Messages.';
  2059. form.insertBefore(span,sigPreview);
  2060. form.insertBefore(document.createElement('br'),sigPreview);
  2061. var span=document.createElement('span');
  2062. span.innerHTML='<input style="position:relative;top:3px;" type="checkbox"'+(sigs['journal']?' checked="checked"':'')+' id="attach2journals"/> Always attach signature in Journals.';
  2063. form.insertBefore(span,sigPreview);
  2064. form.insertBefore(document.createElement('br'),sigPreview);
  2065. var span=document.createElement('span');
  2066. span.innerHTML='<input style="position:relative;top:3px;" type="checkbox"'+(sigs['guild']?' checked="checked"':'')+' id="attach2guilds"/> Always attach signature in Guilds.';
  2067. form.insertBefore(span,sigPreview);
  2068. form.addEventListener('submit',function(){
  2069. GM_setValue('attachSig','{"pm":'+getId('attach2pms').checked+',"guild":'+getId('attach2guilds').checked+',"journal":'+getId('attach2journals').checked+'}');
  2070. },false);
  2071. }
  2072. insertCaseChanger(loc,-2,textBox);
  2073. }
  2074. }
  2075. else if(loc.indexOf('account/about')!=-1){
  2076. form.setAttribute('style','position:relative;');
  2077. var a=getId('preview_about').parentNode.getElementsByTagName('a')[0];
  2078. emoteCode2ImgCode(a,textBox,'click');
  2079. a.addEventListener('click',function(){
  2080. setTimeout(function(){
  2081. imgCode2EmoteCode(textBox);
  2082. },100);
  2083. },false);
  2084. insertCaseChanger(loc,-2,textBox);
  2085. textBox.style.marginRight='450px';
  2086. imgCode2EmoteCode(textBox);
  2087. emoteCode2ImgCode(form,textBox,'submit');
  2088. if(isFF){
  2089. var btn=document.createElement('a');
  2090. btn.innerHTML='<span class="button_cap"></span><span class="button_text">Settings</span>';
  2091. btn.setAttribute('onclick',"return false;");
  2092. btn.setAttribute('style','float:right;');
  2093. btn.className='info_button';
  2094. btn.href='#';
  2095. textBox.parentNode.appendChild(btn);
  2096. btn.addEventListener('click',function(){formatDialog(textBox,loc,-1);},false);
  2097. }
  2098. }
  2099. else if(loc.indexOf('mode=edit')!=-1&&(loc.indexOf('/profiles?')!=-1||loc.indexOf('/profiles/?')!=-1||loc.indexOf('/p/?')!=-1||loc.indexOf('/p?')!=-1)||(loc.indexOf('/profiles/')!=-1&&loc.indexOf('mode=edit')!=-1)){
  2100. textBox=getId('edit_custom_content');
  2101. if(textBox){
  2102. textBox.className='bbcodable';
  2103. insertScript();
  2104. var div=document.createElement('div');
  2105. div.innerHTML='<span>Emotions:</span><br/>'+insertEmoteStuff();
  2106. var a=textBox.parentNode.getElementsByTagName('a')[0];
  2107. GM_addStyle('#emoticons>li{padding:1px;float:left!important;}#emoticons{max-height:82px;overflow-y:auto;}');
  2108. insertStandardEmoticons(div.childNodes[2],3,1);
  2109. textBox.parentNode.appendChild(div);
  2110. getId('emoticons').addEventListener('click',function(){
  2111. sendEvent(textBox,'change');
  2112. },false);
  2113. }
  2114. }
  2115. }

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址