OSDN Git Service

Version 0.6.129, fix X.Node.
[pettanr/clientJs.git] / 0.6.x / js / 01_core / 00_builtin.js
index d98e43a..ba646f8 100644 (file)
@@ -133,8 +133,42 @@ Array.prototype.indexOf || (Array.prototype.indexOf = function( searchElement, f
 \r
 \r
 /*\r
+ * JavaScript split Bugs: Fixed!\r
+ * http://blog.stevenlevithan.com/archives/cross-browser-split\r
+ */\r
+\r
+/*\r
  * Window\r
- * by http://nurucom-archives.hp.infoseek.co.jp/digital/trans-uri.html\r
+ * by https://web.archive.org/web/20100413085309/http://nurucom-archives.hp.infoseek.co.jp/digital/trans-uri.html\r
+ */\r
+\r
+/*\r
+ * //\r
+// TransURI (UTF-8): transURI.js (Ver.041211)\r
+//\r
+// Copyright (C) http://nurucom-archives.hp.infoseek.co.jp/digital/\r
+//\r
+\r
+EncodeURI=function(str){\r
+       return str.replace(/[^!#$&-;=?-Z_a-z~]/g,function(s){\r
+               var c=s.charCodeAt(0);\r
+               return (c<16?"%0"+c.toString(16):c<128?"%"+c.toString(16):c<2048?"%"+(c>>6|192).toString(16)+"%"+(c&63|128).toString(16):"%"+(c>>12|224).toString(16)+"%"+(c>>6&63|128).toString(16)+"%"+(c&63|128).toString(16)).toUpperCase()\r
+       })\r
+};\r
+\r
+EncodeURIComponent=function(str){\r
+       return str.replace(/[^!'-*.0-9A-Z_a-z~-]/g,function(s){\r
+               var c=s.charCodeAt(0);\r
+               return (c<16?'%0'+c.toString(16):c<128?'%'+c.toString(16):c<2048?'%'+(c>>6|192).toString(16)+'%'+(c&63|128).toString(16):'%'+(c>>12|224).toString(16)+'%'+(c>>6&63|128).toString(16)+'%'+(c&63|128).toString(16)).toUpperCase()\r
+       })\r
+};\r
+\r
+DecodeURI=function(str){\r
+       return str.replace(/%(E(0%[AB]|[1-CEF]%[89AB]|D%[89])[0-9A-F]|C[2-9A-F]|D[0-9A-F])%[89AB][0-9A-F]|%[0-7][0-9A-F]/ig,function(s){\r
+               var c=parseInt(s.substring(1),16);\r
+               return String.fromCharCode(c<128?c:c<224?(c&31)<<6|parseInt(s.substring(4),16)&63:((c&15)<<6|parseInt(s.substring(4),16)&63)<<6|parseInt(s.substring(7),16)&63)\r
+       })\r
+};\r
  */\r
 \r
 /* 正規表現が使われているため、まだ投入しない itozyun\r