1var Base64 = { 2 // private property 3 _keyStr: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=", 4 5 // public method for encoding 6 encode: function (input) { 7 var output = ""; 8 var chr1, chr2, chr3, enc1, enc2, enc3, enc4; 9 var i = 0; 10 11 input = Base64._utf8_encode(input); 12 13 while (i < input.length) { 14 15 chr1 = input.charCodeAt(i++); 16 chr2 = input.charCodeAt(i++); 17 chr3 = input.charCodeAt(i++); 18 19 enc1 = chr1 >> 2; 20 enc2 = ((chr1 & 3) << 4) | (chr2 >> 4); 21 enc3 = ((chr2 & 15) << 2) | (chr3 >> 6); 22 enc4 = chr3 & 63; 23 24 if (isNaN(chr2)) { 25 enc3 = enc4 = 64; 26 } 27 else if (isNaN(chr3)) { 28 enc4 = 64; 29 } 30 31 output = output + this._keyStr.charAt(enc1) + this._keyStr.charAt(enc2) + 32 this._keyStr.charAt(enc3) + this._keyStr.charAt(enc4); 33 } 34 35 return output; 36 }, 37 38 // public method for decoding 39 decode: function (input) { 40 var output = ""; 41 var chr1, chr2, chr3; 42 var enc1, enc2, enc3, enc4; 43 var i = 0; 44 45 input = input.replace(/[^A-Za-z0-9\+\/\=]/g, ""); 46 47 while (i < input.length) { 48 49 enc1 = this._keyStr.indexOf(input.charAt(i++)); 50 enc2 = this._keyStr.indexOf(input.charAt(i++)); 51 enc3 = this._keyStr.indexOf(input.charAt(i++)); 52 enc4 = this._keyStr.indexOf(input.charAt(i++)); 53 54 chr1 = (enc1 << 2) | (enc2 >> 4); 55 chr2 = ((enc2 & 15) << 4) | (enc3 >> 2); 56 chr3 = ((enc3 & 3) << 6) | enc4; 57 58 output = output + String.fromCharCode(chr1); 59 60 if (enc3 != 64) { 61 output = output + String.fromCharCode(chr2); 62 } 63 if (enc4 != 64) { 64 output = output + String.fromCharCode(chr3); 65 } 66 } 67 68 output = Base64._utf8_decode(output); 69 70 return output; 71 }, 72 73 // private method for UTF-8 encoding 74 _utf8_encode: function (string) { 75 string = string.replace(/\r\n/g, "\n"); 76 var utftext = ""; 77 78 for (var n = 0; n < string.length; n++) { 79 80 var c = string.charCodeAt(n); 81 82 if (c < 128) { 83 utftext += String.fromCharCode(c); 84 } 85 else if ((c > 127) && (c < 2048)) { 86 utftext += String.fromCharCode((c >> 6) | 192); 87 utftext += String.fromCharCode((c & 63) | 128); 88 } 89 else { 90 utftext += String.fromCharCode((c >> 12) | 224); 91 utftext += String.fromCharCode(((c >> 6) & 63) | 128); 92 utftext += String.fromCharCode((c & 63) | 128); 93 } 94 95 } 96 97 return utftext; 98 }, 99 100 // private method for UTF-8 decoding 101 _utf8_decode: function (utftext) { 102 var string = ""; 103 var i = 0; 104 var c = c1 = c2 = 0; 105 106 while (i < utftext.length) { 107 108 c = utftext.charCodeAt(i); 109 110 if (c < 128) { 111 string += String.fromCharCode(c); 112 i++; 113 } 114 else if ((c > 191) && (c < 224)) { 115 c2 = utftext.charCodeAt(i + 1); 116 string += String.fromCharCode(((c & 31) << 6) | (c2 & 63)); 117 i += 2; 118 } 119 else { 120 c2 = utftext.charCodeAt(i + 1); 121 c3 = utftext.charCodeAt(i + 2); 122 string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63)); 123 i += 3; 124 } 125 126 } 127 128 return string; 129 } 130} 131 132 133 134var SNSWriter = { 135 Link: "", 136 Title: "", 137 Contents: "", 138 Writer: "", 139 140 Cyworld: function () { 141 //titleì ì 목 - Base64ë¡ ì¸ì½ë© 142 //summaryë ë´ì© - Base64ë¡ ì¸ì½ë© 143 //writerë ê³µê¸ì - encodeURIComponent() ì¸ì½ë© 144 //urlì ë§í¬í 주 - encodeURIComponent() ì¸ì½ë© 145 var url = "http://csp.cyworld.com/bi/bi_recommend_pop.php"; 146 url += "?title=" + Base64.encode(this.Title); 147 url += "&summary=" + Base64.encode(this.Contents); 148 url += "&writer=" + encodeURIComponent(this.Writer); 149 url += "&url=" + encodeURIComponent(this.Link); 150 window.open(url, 'recom_icon_pop', 'width=400,height=364,scrollbars=no,resizable=no'); 151 }, 152 153 Me2day: function () { 154 //new_post[body]ìë "ë´ì©":주ì ì ííì¬ì¼ 주ìê° ë§í¬ëë¤. ì¦ new_post[body]=\"ë¤ì´ë²\":http://naver.com ì íí 155 //new_post[tags]ë 공백ì¼ë¡ 구ë¶. ì¦ new_post[tags]=ë°ë¥¸ì ëê°í¬ í°ìë¼ ì íí 156 //ë´ì©ì urlencodeíì¬ ë긴ë¤. ìë°ì¤í¬ë¦½í¸ë encodeURIComponent() í¨ì ì¬ì©
157 var url = "http://me2day.net/posts/new"; 158 url += "?new_post[body]=" + encodeURIComponent("" + this.Contents + ":" + this.Link); 159 url += "&new_post[tags]=" + encodeURIComponent(this.Writer); 160 window.open(url, '', ''); 161 }, 162 163 Twitter: function () { 164 //statusì ê¸ë´ì© ë° urlì ê°ì´ ë³´ë´ë©´ ìëì¼ë¡ ê¸ì ë§í¬ê° ê±¸ë¦°ë¤ 165 //Twitterë 140ì ì í 166 var url = "http://twitter.com/home/"; 167 url += "?status=" + encodeURIComponent(this.Contents); 168 url += encodeURIComponent(" " + this.Link); 169 window.open(url, '', ''); 170 }, 171 172 Facebook: function () { 173 //uì 주ì를 ë³´ë´ë©´ ëë¤. 174 //Facebook API ê°ì´ëìë tì ë´ì©ì ì ì´ì ë³´ë´ë¼ê³ ëìì§ë§ ì¤ì ì ì©ëì§ ìëë¤. 175 var url = "http://www.facebook.com/sharer.php"; 176 url += "?u=" + encodeURIComponent(this.Link); 177 url += "&t=" + encodeURIComponent(this.Contents); 178 window.open(url, '', 'width=750,height=400,scrollbars=yes,resizable=auto'); 179 } 180}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.