1$(function(){ 2 //å享 3 var title = "ã" + $.trim(document.title) + "ã"; 4 var description = $.trim($('meta[name="description"]').attr('content')); 5 var portalUrl = window.location.href; 6 //çæäºç»´ç 7 function generateQRCode(rendermethod, picwidth, picheight, url) { 8 $(".qrcode").qrcode({ 9 render: rendermethod, // æ¸²ææ¹å¼ætableæ¹å¼ï¼IEå ¼å®¹ï¼åcanvasæ¹å¼ 10 width: picwidth, //宽度 11 height: picheight, //é«åº¦ 12 text: utf16to8(portalUrl), //å 容 13 typeNumber: -1, //è®¡ç®æ¨¡å¼ 14 correctLevel: 2, //äºç»´ç çº éçº§å« 15 background: "#ffffff", //èæ¯é¢è² 16 foreground: "#000000" //äºç»´ç é¢è² 17 18 }); 19 } 20 canvas_table = !!document.createElement('canvas').getContext ? 'canvas' : 'table'; 21 22 function init() { 23 generateQRCode(canvas_table, 90, 90, window.location.href); 24 } 25 //䏿ç¼ç æ ¼å¼è½¬æ¢ 26 function utf16to8(str) { 27 var out, i, len, c; 28 out = ""; 29 len = str.length; 30 for(i = 0; i < len; i++) { 31 c = str.charCodeAt(i); 32 if((c >= 0x0001) && (c <= 0x007F)) { 33 out += str.charAt(i); 34 } else if(c > 0x07FF) { 35 out += String.fromCharCode(0xE0 | ((c >> 12) & 0x0F)); 36 out += String.fromCharCode(0x80 | ((c >> 6) & 0x3F)); 37 out += String.fromCharCode(0x80 | ((c >> 0) & 0x3F)); 38 } else { 39 out += String.fromCharCode(0xC0 | ((c >> 6) & 0x1F)); 40 out += String.fromCharCode(0x80 | ((c >> 0) & 0x3F)); 41 } 42 } 43 return out; 44 } 45 init(); 46 47 // $(".share-wechat").on("click", function() { 48 // $(".bg-code,.qrcode").toggle(); 49 // }); 50
51 $(".share-wechat").mouseenter(function(){ 52 $(".bg-code,.qrcode").show(); 53 }).mouseleave(function(){ 54 $(".bg-code,.qrcode").hide(); 55 }); 56 57 //æ¸ ç©ºäºç»´ç 58 // $(".close-btn").on("click", function(event) { 59 // $(".bg-code,.qrcode,.close-btn").hide(); 60 // event.stopPropagation(); 61 // }); 62 63 function showToQzone() { 64 var _desc = description; 65 var _title = title; 66 var _url = portalUrl; 67 var _shareUrl = 'http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?'; 68 _shareUrl += 'url=' + encodeURIComponent(_url); //åæ°url设置å享çå 容龿¥|é»è®¤å½å页location 69 _shareUrl += '&title=' + encodeURIComponent(_title); //åæ°title设置å享æ é¢ï¼å¯éåæ° 70 window.open(_shareUrl,'','width=700,height=680,top=0,left=0,toolbar=no,menubar=no,scrollbars=no,resizable=1,location=yes,status=0'); 71 } 72 73 function showToSina(title, portalUrl, desc) { 74 var _desc = desc; 75 var _t = title + " " + _desc; 76 var _url = portalUrl; 77 var _appkey = "2806082167"; //ä½ ä»å¾®èè·å¾çappkey 78 var _site = ''; //ä½ çç½ç«å°å 79 var _ralateUid = ""; 80 var _u = 'http://service.weibo.com/share/share.php?url=' + _url + '&appkey=' + _appkey + '&title=' + _t + '&ralateUid=' + _ralateUid + '&searchPic=false'; 81 window.open(_u, '', 'width=700, height=680, top=0, left=0, toolbar=no, menubar=no, scrollbars=no, location=yes, resizable=no, status=no'); 82 } 83 84 $('.share-qqzone').on('click', function() { 85 showToQzone(title, portalUrl, description); 86 }); 87 $('.share-weibo').on('click', function() { 88 showToSina(title, portalUrl, description); 89 }); 90});
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.