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 — yncoder.github.io/index.html at master · yncoder/yncoder.github.io Expand file tree/ Copy pathindex.htmlMore file actions 204 lines (166 loc) · 5.46 KB / Copy pathindex.htmlFile metadata and controls204 lines (166 loc) · 5.46 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 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 --- layout: page type: list github: https://github.com/yncoder/yncoder.github.io --- <main> <div class="container"> <aside> <nav class="block"> <a href="{{page.github}}/issues/new/choose" target="_blank" class="btn-add"><i class="fa fa-plus"></i>发布主题</a> <ul id="label-list"> <li class="loading"><i class="fa fa-circle-o-notch fa-spin"></i></li> </ul> </nav> </aside> <ul id="issue-list"> <li class="loading"><i class="fa fa-circle-o-notch fa-spin"></i></li> </ul> </div> </main> <script> (function () { var store = { isSupport: (function () { try { return 'localStorage' in window && window['localStorage'] !== null; } catch (ex) { return false; } })(), set: function (name, value) { if (this.isSupport) { localStorage.setItem(name, JSON.stringify(value)); } }, get: function (name) { return this.isSupport ? JSON.parse(localStorage.getItem(name)) : null; } }; function ajax (url, options) { options = options || {}; var query = Object.keys(options.query || {}).map(function (key) { return key + '=' + encodeURIComponent(options.query[key]); }).join('&'); var hash = url + '?' + query + '#' + JSON.stringify(options.data || {}); if (options.cache) { var storage = store.get(hash); if (storage && Date.now() - storage.timestamp <= options.cache) { return options.ondata(storage.data); } } var request = new XMLHttpRequest(); request.responseType = options.responseType || 'json'; request.open(options.method || 'GET', url + (query ? '?' + query : ''), true); request.onreadystatechange = function () { if (this.readyState != 4) { return; } if (this.status >= 200 && this.status < 300) { if (options.cache) { store.set(hash, {data: this.response, timestamp: Date.now()}); } options.ondata && options.ondata(this.response); } else if(this.status == 403) { options.onforbidden && options.onforbidden(this.response); } }; request.send(options.data || null); } function escapeHTML (str) { return str.replace(/([&<>'"])/g, function (matcher, symbol) { return '&#' + symbol.charCodeAt(0) + ';'; }); } function format (template, data) { return template.replace(/\{(\s*\w+\s*)\}/g, function (matcher, name) { var value = data[name.trim()]; return typeof value != 'undefined' ? value : ''; }); } function gotowork () { document.getElementById('issue-list').innerHTML = '<li class="gotowork"><h1>别刷了,快去干活</h1></li>'; } var issueList = { template: '<li class="{labelClasses} {statusClass}" style="border-left-color:{firstLabelColor}">' + '<figure><img src="{authorAvatarUrl}" /></figure>' + '<h4><a href="{link}">{title}</h4>' + '<p>{labelElements} <a class="author" href="{authorLink}" target="_blank">{authorName}</a><i>{comments}</i></p>', labelTemplate: '<a href="{url}" class="label" style="backbround-color: #{color}">{name}</a>', renderLabelItem: function (label) { return format(this.labelTemplate, label); }, renderLabelClass: function (label) { return 'label-' + label.name; }, render: function (data) { var html = data.map(function (item) { return format(this.template, { firstLabelColor: item.labels.length ? '#' + item.labels[0].color : 'transparent', labelClasses: item.labels.map(this.renderLabelClass, this).join(' '), labelElements: item.labels.map(this.renderLabelItem, this).join(''), title: escapeHTML(item.title), link: item.html_url, authorAvatarUrl: item.user.avatar_url, authorName: item.user.login, authorLink: item.user.html_url, comments: item.comments }); }, this).join(''); document.getElementById('issue-list').innerHTML = html; }, load: function () { ajax('//api.github.com/repos/yncoder/yncoder.github.io/issues', { query: { state: 'open' }, cache: 60000, ondata: this.render.bind(this), onforbidden: gotowork }); } }; var labelList = { template: '<li><a href="#label-{name}" style="background-color:#{color}" data-color="#{color}"><i class="fa fa-tag"></i>{name}</a></li>', render: function (data) { data.sort(function (a, b) { return a.name.localeCompare(b.name); }); var html = data.map(function (item) { return format(this.template, item); }, this).join(''); document.getElementById('label-list').innerHTML = html; document.getElementById('label-list').onclick = this.clickHandler; }, clickHandler: function (ev) { var target = ev.target || ev.srcElement; if (target.nodeName == 'A') { ev.preventDefault(); var list = target.parentNode.parentNode; var items = list.querySelectorAll('a'); target.classList.toggle('showing'); var showings = list.querySelectorAll('a.showing').length; for (var i = 0, len = items.length; i < len; i++) { var item = items[i]; var className = decodeURIComponent(item.href.replace(/.*#([\w\-]+)/, '$1')); var flag = item.classList.contains('showing') || !showings; item.style.backgroundColor = flag ? item.getAttribute('data-color') : '#ccc'; [].slice.call(document.querySelectorAll('#issue-list li.' + className)).forEach(function (li) { li.classList.toggle('hidden', !flag); }) } return false; } }, load: function () { ajax('//api.github.com/repos/yncoder/yncoder.github.io/labels', { cache: 3600000, ondata: this.render.bind(this), onforbidden: gotowork }); } }; issueList.load(); labelList.load(); })(); </script> |
| You are visitor 01402503 — 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. |