Changeset 17112 for lang/javascript/vimperator-plugins/trunk
- Timestamp:
- 08/05/08 20:22:19 (4 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
lang/javascript/vimperator-plugins/trunk/mixiecho.js
r17104 r17112 1 // Vimperator plugin: "Update mixi echo" 2 // Last Change: 05-Aug-2008. Jan 2008 3 // License: Creative Commons 4 // Maintainer: mattn <mattn.jp@gmail.com> - http://mattn.kaoriya.net/ 5 1 6 (function(){ 7 var ucnv = Components.classes["@mozilla.org/intl/scriptableunicodeconverter"] 8 .createInstance(Components.interfaces.nsIScriptableUnicodeConverter); 9 ucnv.charset = "EUC-JP"; 2 10 function sprintf(format){ 3 11 var i = 1, re = /%s/, result = "" + format; … … 92 100 } 93 101 function sayEcho(text){ 94 /* FIXME TODO: does not work!!!!!!!!!!!!!!!!!!!!95 102 var xhr = new XMLHttpRequest(); 96 103 xhr.open("GET", "http://mixi.jp/recent_echo.pl", false); … … 102 109 var params = []; 103 110 var inputs = getElementsByXPath('.//*[contains(" INPUT TEXTAREA SELECT ", concat(" ", local-name(), " "))]', form); 104 inputs.forEach(function(input) { params.push(input.name + '=' + encodeURIComponent(input.value)); });111 inputs.forEach(function(input) { if (input.name.length) params.push(input.name + '=' + escape(ucnv.ConvertFromUnicode(input.value))); }); 105 112 xhr.open("POST", "http://mixi.jp/add_echo.pl", false); 106 113 xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); 107 114 xhr.send(params.join('&')); 108 */109 115 } 110 116 liberator.commands.addUserCommand(["mixiecho"], "Change mixi echo", … … 112 118 if (special || arg.length == 0) 113 119 showFollowersStatus() 114 //else115 //sayTwitter(username, password,arg);120 else 121 sayEcho(arg); 116 122 }, 117 123 { });
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)