Posted By

szsk on 07/30/06


Tagged

css javascript image Opera Firefox imode mobile greasemonkey


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

hides
sena


emoji replacer


 / Published in: JavaScript
 

URL: http://snipplr.com/users/szsk/

view imode emoji for Greasemonkey&Opera userScript

  1. // ==UserScript==
  2. // @name emoji replacer
  3. // @description emoji is replaced with image.
  4. // @namespace http://bmky.net/
  5. // @include */i/*
  6. // ==/UserScript==
  7.  
  8. (function() {
  9.  
  10. var image =
  11. [ "data:image/x-png;base64,iVBORw0KGgoAAAANSUhEUgAAAMAAAADYBAMAAABPd%2FHCAAAAA3NCSV"
  12. , "QICAjb4U%2FgAAAAHlBMVEX%2F%2F%2F8A%2FwD%2FgAD%2FAP%2F%2FAACAAICAAAAAAP8AAIAAAAAt"
  13. , "tYrtAAAACnRSTlMA%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FfokUVgAAAAlwSFlzAAALEgAACxIB"
  14. , "0t1%2B%2FAAAACB0RVh0U29mdHdhcmUATWFjcm9tZWRpYSBGaXJld29ya3MgTVi7kSokAAAAFnRFWHRD"
  15. , "cmVhdGlvbiBUaW1lADA1LzE5LzA25e4LyAAAFlJJREFUeJztXD1247rShCiOaWbSDni0Ap3jDSDgAiaZ"
  16. , "3NHEzJQ6dMiUu%2F26qrpBkKLnet57wRdcWNZ4KBKF%2FkV3A1BKKeW0tglv3UP%2FGVJqxzGlR%2Bom"
  17. , "vVkb%2BbKPmvLQg%2Fe3dT9rawFQPlLXk3CagQ%2BNBbzj%2FdleAjhd0QwaL1xPt6G54Va7atc0zkyQ"
  18. , "6B%2BD6fiyu524FX4FaEjExS5cSNgkgMEGZddP%2BGh6aJxpLEM0Wh%2BPKXXWQMAK4GMUgN1vl28Y6Q"
  19. , "kvEtaJFejeMC5%2BXTSPY94BqKvb4PCFwMdUeC0KDgGGZgMwBoCxHxwCjyiD5oZBtiL9CWCQkC%2F2I9"
  20. , "kfA%2BAJAIz2rPXqAKLA%2Bh%2F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XsmYXdx9vJZl%2FXt9xTKAy0n%2BgqoaiVC%2F3i07nusraX1P%2"
  70. , "Ff4evFNMubCIKzeeDFHUsV9yXrvwjv4SwMkABV6M3VDgABo4VbVm0VJ9KkZtAazvcOrA2gGo%2BhVpV4"
  71. , "y0r2lypqXq7wLThvb6rJEKQGFRXwDmbwOs15Mv9QQFePP85JlF89pF77r0zwC%2BGuFT6U5L%2F0pNBb"
  72. , "B%2F%2BQzhs9ITwH9vaG5f2nMuRv2PXUUqs0TV2mdSnlvePcidjWqD%2FnlaWCvbD9svDolsBjHuAO7n"
  73. , "LUDjiw2bZ7I2J6xOPT%2BRN02xszLH1MW45awtGOy6CRgg0emPHvIVpYoHtJWsU12cO8l9S0NbvL8DvP"
  74. , "HlPZME383Uuxx4ZCSnYg937iSsYhvtgC0USAZalW21U8tGxJVmp0Acoh7qwIBT0D7JXCdH9lvcCIBH0b"
  75. , "CRCnupYl3Y%2BsYmiWZQlcB34Skwbp%2BnnS3cVAPgQes%2FC0CTqK8qiwIH4HVuyMguBu13PTh0NMUm"
  76. , "9g1AsCiiayw6UAZiEbxoG2qqW1wrFDxx0fl04tLEE4DIcSH7gCoNhZDHsk2CB57ySoG0SELmPsbCIt40"
  77. , "etzSbtR0Q4GXByOqGNPBzH%2FUPCdQ2MUhVYaWZMUl1KlaTgce76D7cUWJdq4J%2BBKgD5jtUj8MCts%"
  78. , "2B3yDG5y0Mh7XIKvBaQzffbMbLNYIDvNlvANQ7nhzgqB7GLVMipXJMijOq3M0BsA25UNCmUiMMCraUMI"
  79. , "LXZhBEt27f8wpQhaxQLu64e1N6xJt84cEfWvfyxTOwkMTlH5wo4gp67JcrABbbT7HTnUJ0AHqUYGgpYf"
  80. , "p2Ut%2FO1HL%2FiNaXBqyvNhE45%2FBFk2%2BbXgHOd6cg4xWF4DJwFmZnjwqVgNyoTAAwKlQ650EjB%"
  81. , "2FA14eQOH79tTBKrSywV57L%2BIBctAKwVD9hc1sSarKc7MfypAii2nXKlRYWSokVBQdYpFhzr2gG0yT"
  82. , "fxuAz2AGX4HsHshBwALc%2FhcG9Z8wSQyla2g5brrioWVbChplhHH7B7K4TcxvPdampQzDfJmRlLGybq"
  83. , "ibt4c2RoMLNbWTAWAYUBKwF7gKrRBo6IPHQVPix%2FwHr6%2FPz8IFTMYy%2B%2Frb2nl%2FeX97g9WC"
  84. , "qc9XwDJyytgnvD3jLwPRbTcn79%2BPj4TLA5Oj%2BzmBd88J6s%2F3df4W5H35lIxp%2F88KTvBi0AZN"
  85. , "%2BUeA4pElULGV5fPz9fya0HmXhLL0aC9f2SXlIsIXmdCFUAhDYRGGhPcRRX5sLzKRa7UER5%2Ffz4%2"
  86. , "FOQGCfvllpYX6xgA4JMDuGUwxz7xeCYCo4Hbke8FAPSBPY%2BJvmTG7DamAACLKKTBKXgnCbOPzEVghF"
  87. , "tsFiRwy%2FY5PKJ2TnMX58wNeKwDGcAnAabHo0P%2FjcvgJf3%2BbZKYFZIoaIBqkICTKLDQLSF24wYe"
  88. , "XzkSANcM%2BZxTYPzppg4U3Mgi4xH%2BefHttgqqKMbLlRgFALrdy1K40E73qcygJd0E%2BCCPJjqtAm"
  89. , "AUvGj5n8c8sypZftDP%2FENTALTPSquIAmDmIM0wAHv5LuQb1sXFoncAvXiK0bYox5HHFzODi5%2Buc4"
  90. , "AYP7hSAyhCJcCnhwCckxzgBcYmq1T6LiFeJWIHOGMWRP0t8XhM7zLQ0q1mtdf0kT5eU5BwCwA3t6RtH1"
  91. , "QimtlVh5QFcE46zgkh1Futg%2FAkChIo0CZrSMFdBd51M02%2B%2BAltG3HPI0PbrO7psOpXJzu%2Bak"
  92. , "cB1nFzR%2FJHgLzONtBySLLanpIiSD1vn4rj%2BN%2BgoF1nmzuyoLMD6Po9erf3D8gwmqZeUaCJW7H0"
  93. , "3Y9kdbyjiynix6%2BUfv286zRSw839Urt70ilRuNJXYqhp28q682aOjIxjsaRsmjYAGxYNOpexp8BtyL"
  94. , "%2FRQBRc%2BIpDvFsmrifr1sa%2BGBcOBzKoKXAZBMDB5p4AaH2omzYcJPU7GSiCcAA5YR6A1HAe3Gou"
  95. , "GCwYlMEqjwMFnv5tryfmUmDhhgKPzqRRzFvEfR2Lzb4gsXJDFLTMmc%2BVFtFEHWBKysJ0Gr5WU4a89a"
  96. , "nQTI388evXz1TSplWL%2FArfP%2FmSkB3AN4j9yQ62MgA86trIjD13vJf3WgY43QmQ6z9b8kF73vf41L"
  97. , "ppzZjqgOmAAhfm%2FnC%2FrnfVcbiN2A%2B3QZDxvvmxhJ18otXRzdh9gP1Zuk477PS33%2BlNbpeVlN"
  98. , "YreKzbKIkxy9Cu3ZkLW3bL9YKDTJ7iwBdpyUtf0cHwv%2FUCiDfNeOyz1Xyvgwna8jv7gTOzQKTqpqc6"
  99. , "N6htJlwlySzxTmBRp0F4ZaXaRhnc1BGYjsdDZ541dQDsy8gK%2BzW36NOmseiZRxFanHjsOrA%2FBwVe"
  100. , "hS2bVriohuUYfcXErG0hcaJtmbFmmEHByYQgCrgLjwtZLSO0jqUVpyBqjzUA1wXZ%2FVQocAAcn8HQ0P"
  101. , "s1lYUqAEjIE4UsCliMiR0xAQAhEyDpOzKqL2%2FouYuMA2197iU8%2FdzgMsBevA6izV9QIC0CAAlYU2"
  102. , "FhpBkUpBAyP5W3YVkntEgAmaWqshqxVACmpvE1JavweeRnZmkv1LTaeCyRuha5kPOqRamsXcWUtTmQVT"
  103. , "U3n9O17Egs59S%2BYWhs7iq%2BOFb%2F37kKjmuqCSmo6506%2FZarapSGea4jlcqXDdpozoxFEz2%2B"
  104. , "OadzV3T1k%2F3KbWnhqve1VaYvbtwRIrnMaIrsEq684X8QCp4Ytzz0bUMQsum7eMHaXKulJGW9eYV3AM"
  105. , "xiUdEC%2BjujV1HwOwDwDRLdgzkrtejqwuRKlXjK3bOmI6PD%2B6GxtzO%2Bo0L5HQN6pRKi4IUkJH3P"
  106. , "DaOkLtTIlaUC4CkT%2Fn3SsX%2FqxJlxngOImQJge0fU%2FK7A9NSBBFjEFKFYq3q2ABp%2BI46W30Sf"
  107. , "qr04RHvXtgyfVskiHakFgGUtF4SLJxs%2Bzm3y7PbJz6PLTjFSHqIIAC%2BWj1wNAAU6WE89z8ziZIYN"
  108. , "WPSyUvAgAEOJK77dBJsuRhcdPVsT7CKAKKAMlItR5ll853GXhsk1KLhah%2By6i5OJJ3Uc%2BzEU5RCg"
  109. , "DQBf0IUWCaBQYGlWRUFSjnt6VE1dsJIJIjLP1WECqykg8PkOO6gBqDfvNLJB5QEH4EH8KQBcjbQtABPR"
  110. , "jYFoLB0WAMX5cs457CT99oWEF%2F7p3zXUdf7lXXWDDKj7cQJ5swsnbzOaceOFcL9KG8kzUz%2BOwkLR"
  111. , "UXuRhaIxgPzxC%2FnId5o%2FqUUk5sfxXVH1TZ5fov3g6%2BePH%2Bnn9xB%2Bo8bh3umDJPAApAKT6p"
  112. , "7fvkpDAPT%2B88c3AWxs7zc6zNePDwAgc3rAdptyrg71NAfAuH8m48%2BPb1Lw%2Fv7yTs293az3109V"
  113. , "fkPggnlJ0gi0X9Z%2BfrNvB3h%2FcdNIBGAs2elC3EMXoONt7P8Hxv9NFhnAbwd4RYLyMXH24fD9FveQ"
  114. , "AyGt%2F18G8PPbQn5nuQ99Da9Qow9nkcbLxQwYpDv5AXnOr%2FQ3AKzGFQBIWUL2IaOe805ddgAm5Okn"
  115. , "9PR7TTpOhTGAxFLUo8jAKfgdThgD%2Bfl3AD41kyEfyhKfxkAiUxwX%2B1sANWjjJ9vRGNLqKSgDE8E3"
  116. , "7ez%2FAAhJsLe0jYpjAAAAAElFTkSuQmCC"
  117. ].join( "" );
  118.  
  119. //http://www.onicos.com/staff/iz/amuse/javascript/expert/
  120. if( btoa == undefined ) {
  121. var b64ec = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
  122. var btoa = function( str ) {
  123. var out = "", i = 0, len = str.length;
  124. while( i < len ) {
  125. var c1 = str.charCodeAt( i++ ) & 0xff;
  126. if( i == len ) {
  127. out += b64ec.charAt( c1 >> 2 )
  128. + b64ec.charAt( ( c1 & 0x3 ) << 4 )
  129. + "==";
  130. break;
  131. }
  132. var c2 = str.charCodeAt( i++ );
  133. if( i == len ) {
  134. out += b64ec.charAt( c1 >> 2 )
  135. + b64ec.charAt( ( ( c1 & 0x3 ) << 4 ) | ( ( c2 & 0xF0 ) >> 4 ) )
  136. + b64ec.charAt( ( c2 & 0xF ) << 2 )
  137. + "=";
  138. break;
  139. }
  140. var c3 = str.charCodeAt( i++ );
  141. out += b64ec.charAt( c1 >> 2 )
  142. + b64ec.charAt( ( ( c1 & 0x3 ) << 4 ) | ( ( c2 & 0xF0 ) >> 4 ) )
  143. + b64ec.charAt( ( ( c2 & 0xF ) << 2 ) | ( ( c3 & 0xC0 ) >> 6 ) )
  144. + b64ec.charAt( c3 & 0x3F );
  145. }
  146. return out;
  147. }
  148. }
  149. function addStyle( selector, property ) {
  150. if( window.opera ) {
  151. var cssText = selector + "{" + property + "}";
  152. var href = "data:text/html;charset=shift_jis;base64," + btoa( cssText );
  153. createStyleSheet( href );
  154. return;
  155. }
  156. var sheet = document.styleSheets[0];
  157. if( sheet.addRule )
  158. sheet.addRule( selector, "{" + property + "}" );
  159. else if( sheet.insertRule )
  160. sheet.insertRule( selector + "{" + property + "}", 0 );
  161. }
  162. function createStyleSheet( href ) {
  163. var link = document.createElement( "link" );
  164. link.rel = "stylesheet";
  165. link.href = href;
  166. link.type = "text/css";
  167. var head = document.getElementsByTagName( "head" ).item( 0 );
  168. head.appendChild( link );
  169. }
  170.  
  171. if( window.opera ) {
  172. addStyle( "img { visibility : hidden; width : 12px; height : 12px; border : 0 }" );
  173. addStyle( "span{ font-size : 12px; background-image : url(" + image + ") }" );
  174. }
  175. else {
  176. GM_addStyle( "img { visibility : hidden; width : 12px; height : 12px; border : 0 }" );
  177. GM_addStyle( "span{ background-image : url(" + image + "); }" );
  178. }
  179.  
  180. document.body.innerHTML = document.body.innerHTML
  181. .replace( /[\uE63E-\uE757]/g, function( $0 ) { return repimg( $0.charCodeAt(0) ); } )
  182. .replace( /[\uF89F-\uF8FC]/g, function( $0 ) { return repimg( $0.charCodeAt(0) - 0x1261 ); } )
  183. .replace( /[\uF940-\uF97E]/g, function( $0 ) { return repimg( $0.charCodeAt(0) - 0x12A4 ); } )
  184. .replace( /[\uF980-\uF9FC]/g, function( $0 ) { return repimg( $0.charCodeAt(0) - 0x12A5 ); } )
  185. ;
  186.  
  187. function repimg( num ) {
  188. var x = parseInt( ( num - parseInt( 0xE63E, 10 ) ) % 16 );
  189. var y = parseInt( ( num - parseInt( 0xE63E, 10 ) ) / 16 );
  190. return '<span style="background-position:'
  191. + ( x * -12 ) + "px " + ( y * -12 ) + 'px;">'
  192. + '<img src=""></span>';
  193. }
  194. })();

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: vayaingenieros on November 25, 2008

Parse error: parse error, unexpected T_FUNCTION on line 10

You need to login to post a comment.