GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — gitfengri.github.io/js/src/hook-duoshuo.js at master · gitfengri/gitfengri.github.io Expand file tree/ Copy pathhook-duoshuo.jsMore file actions 115 lines (98 loc) · 3.29 KB / Copy pathhook-duoshuo.jsFile metadata and controls115 lines (98 loc) · 3.29 KB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 /* global DUOSHUO: true */ /* jshint camelcase: false */ typeof DUOSHUO !== 'undefined' ? hookTemplate() : ($('#duoshuo-script')[0].onload = hookTemplate); function hookTemplate() { var post = DUOSHUO.templates.post; DUOSHUO.templates.post = function (e, t) { var rs = post(e, t); var agent = e.post.agent; var userId = e.post.author.user_id; var admin = ''; if (userId && (userId == CONFIG.duoshuo.userId)) { admin = '<span class="duoshuo-ua-admin">' + CONFIG.duoshuo.author + '</span>'; } if (agent && /^Mozilla/.test(agent)) { rs = rs.replace(/<\/div><p>/, admin + getAgentInfo(agent) + '</div><p>'); } return rs; }; } function getAgentInfo(string) { $.ua.set(string); var UNKNOWN = 'Unknown'; var sua = $.ua; var separator = isMobile() ? '<br><br>' : '<span class="duoshuo-ua-separator"></span>'; var osName = sua.os.name || UNKNOWN; var osVersion = sua.os.version || UNKNOWN; var browserName = sua.browser.name || UNKNOWN; var browserVersion = sua.browser.version || UNKNOWN; var iconMapping = { os: { android : 'android', linux : 'linux', windows : 'windows', ios : 'apple', 'mac os': 'apple', unknown : 'desktop' }, browser: { chrome : 'chrome', chromium : 'chrome', firefox : 'firefox', opera : 'opera', safari : 'safari', ie : 'internet-explorer', wechat : 'wechat', qq : 'qq', unknown : 'globe' } }; var osIcon = iconMapping.os[osName.toLowerCase()]; var browserIcon = iconMapping.browser[getBrowserKey()]; return separator + '<span class="duoshuo-ua-platform duoshuo-ua-platform-' + osName.toLowerCase() + '">' + '<i class="fa fa-' + osIcon + '"></i>' + osName + ' ' + osVersion + '</span>' + separator + '<span class="duoshuo-ua-browser duoshuo-ua-browser-' + browserName.toLowerCase() + '">' + '<i class="fa fa-' + browserIcon + '"></i>' + browserName + ' ' + browserVersion + '</span>'; function getBrowserKey () { var key = browserName.toLowerCase(); if (key.match(/WeChat/i)) { return 'wechat'; } if (key.match(/QQBrowser/i)) { return 'qq'; } return key; } function isMobile() { var userAgent = window.navigator.userAgent; var isiPad = userAgent.match(/iPad/i) !== null; var mobileUA = [ 'iphone', 'android', 'phone', 'mobile', 'wap', 'netfront', 'x11', 'java', 'opera mobi', 'opera mini', 'ucweb', 'windows ce', 'symbian', 'symbianos', 'series', 'webos', 'sony', 'blackberry', 'dopod', 'nokia', 'samsung', 'palmsource', 'xda', 'pieplus', 'meizu', 'midp' ,'cldc' , 'motorola', 'foma', 'docomo', 'up.browser', 'up.link', 'blazer', 'helio', 'hosin', 'huawei', 'novarra', 'coolpad', 'webos', 'techfaith', 'palmsource', 'alcatel', 'amoi', 'ktouch', 'nexian', 'ericsson', 'philips', 'sagem', 'wellcom', 'bunjalloo', 'maui', 'smartphone', 'iemobile', 'spice', 'bird', 'zte-', 'longcos', 'pantech', 'gionee', 'portalmmm', 'jig browser', 'hiptop', 'benq', 'haier', '^lct', '320x320', '240x320', '176x220' ]; var pattern = new RegExp(mobileUA.join('|'), 'i'); return !isiPad && userAgent.match(pattern); } } |
| You are visitor 01402792 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |