| 1 |
<!DOCTYPE html> |
| 2 |
<html lang="en"> |
| 3 |
<head> |
| 4 |
<meta charset="utf-8" /> |
| 5 |
<title>zero.md - Grip</title> |
| 6 |
<link rel="icon" href="/__/grip/static/favicon.ico" /> |
| 7 |
<link rel="stylesheet" href="/__/grip/static/octicons/octicons.css" /> |
| 8 |
<style> |
| 9 |
/* Page tweaks */ |
| 10 |
.preview-page { |
| 11 |
margin-top: 64px; |
| 12 |
margin-bottom: 21px; |
| 13 |
} |
| 14 |
/* User-content tweaks */ |
| 15 |
.timeline-comment-wrapper > .timeline-comment:after, |
| 16 |
.timeline-comment-wrapper > .timeline-comment:before { |
| 17 |
content: none; |
| 18 |
} |
| 19 |
/* User-content overrides */ |
| 20 |
.discussion-timeline.wide { |
| 21 |
width: 920px; |
| 22 |
} |
| 23 |
</style> |
| 24 |
</head> |
| 25 |
<body> |
| 26 |
<div class="page"> |
| 27 |
<div id="preview-page" class="preview-page" data-autorefresh-url="/__/grip/refresh/"> |
| 28 |
<main id="js-repo-pjax-container"> |
| 29 |
<div class="clearfix new-discussion-timeline container-xl px-3 px-md-4 px-lg-5"> |
| 30 |
<div class="repository-content"> |
| 31 |
<div class="clearfix"> |
| 32 |
<div class="Layout Layout--flowRow-until-md Layout--sidebarPosition-end Layout--sidebarPosition-flowRow-end"> |
| 33 |
<div class="Layout-main"> |
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
<div class="pull-discussion-timeline"> |
| 38 |
<div class="ml-0 pl-0 ml-md-6 pl-md-3"> |
| 39 |
<div class="TimelineItem pt-0"> |
| 40 |
<div class="timeline-comment-group TimelineItem-body my-0"> |
| 41 |
<div class="ml-n3 timeline-comment unminimized-comment comment previewable-edit editable-comment timeline-comment--caret reorderable-task-lists"> |
| 42 |
|
| 43 |
<div class="edit-comment-hide"> |
| 44 |
<table class="d-block"> |
| 45 |
<tbody class="d-block"> |
| 46 |
<tr class="d-block"> |
| 47 |
<td class="d-block comment-body markdown-body" id="grip-content"> |
| 48 |
|
| 49 |
</td> |
| 50 |
</tr> |
| 51 |
</tbody> |
| 52 |
</table> |
| 53 |
</div> |
| 54 |
</div> |
| 55 |
</div> |
| 56 |
</div> |
| 57 |
</div> |
| 58 |
</div> |
| 59 |
|
| 60 |
|
| 61 |
|
| 62 |
</div> |
| 63 |
</div> |
| 64 |
</div> |
| 65 |
</div> |
| 66 |
</div> |
| 67 |
</main> |
| 68 |
</div> |
| 69 |
</div><script> |
| 70 |
function showCanonicalImages() { |
| 71 |
var images = document.getElementsByTagName('img'); |
| 72 |
if (!images) { |
| 73 |
return; |
| 74 |
} |
| 75 |
for (var index = 0; index < images.length; index++) { |
| 76 |
var image = images[index]; |
| 77 |
if (image.getAttribute('data-canonical-src') && image.src !== image.getAttribute('data-canonical-src')) { |
| 78 |
image.src = image.getAttribute('data-canonical-src'); |
| 79 |
} |
| 80 |
} |
| 81 |
} |
| 82 |
|
| 83 |
function scrollToHash() { |
| 84 |
if (location.hash && !document.querySelector(':target')) { |
| 85 |
var element = document.getElementById('user-content-' + location.hash.slice(1)); |
| 86 |
if (element) { |
| 87 |
element.scrollIntoView(); |
| 88 |
} |
| 89 |
} |
| 90 |
} |
| 91 |
|
| 92 |
function autorefreshContent(eventSourceUrl) { |
| 93 |
var initialTitle = document.title; |
| 94 |
var contentElement = document.getElementById('grip-content'); |
| 95 |
var source = new EventSource(eventSourceUrl); |
| 96 |
var isRendering = false; |
| 97 |
|
| 98 |
source.onmessage = function(ev) { |
| 99 |
var msg = JSON.parse(ev.data); |
| 100 |
if (msg.updating) { |
| 101 |
isRendering = true; |
| 102 |
document.title = '(Rendering) ' + document.title; |
| 103 |
} else { |
| 104 |
isRendering = false; |
| 105 |
document.title = initialTitle; |
| 106 |
contentElement.innerHTML = msg.content; |
| 107 |
showCanonicalImages(); |
| 108 |
} |
| 109 |
} |
| 110 |
|
| 111 |
source.onerror = function(e) { |
| 112 |
if (e.readyState === EventSource.CLOSED && isRendering) { |
| 113 |
isRendering = false; |
| 114 |
document.title = initialTitle; |
| 115 |
} |
| 116 |
} |
| 117 |
} |
| 118 |
|
| 119 |
window.onhashchange = function() { |
| 120 |
scrollToHash(); |
| 121 |
} |
| 122 |
|
| 123 |
window.onload = function() { |
| 124 |
scrollToHash(); |
| 125 |
} |
| 126 |
|
| 127 |
showCanonicalImages(); |
| 128 |
|
| 129 |
var autorefreshUrl = document.getElementById('preview-page').getAttribute('data-autorefresh-url'); |
| 130 |
if (autorefreshUrl) { |
| 131 |
autorefreshContent(autorefreshUrl); |
| 132 |
} |
| 133 |
</script> |
| 134 |
</body> |
| 135 |
</html> |