Skip to content

minor fixes #24

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 15, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 22 additions & 22 deletions 404.html
Original file line number Diff line number Diff line change
@@ -1,38 +1,38 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta charset='utf-8'>
<title>Nicegist</title>
<!-- This page is only here for the Github Pages SPA hack
http://www.backalleycoder.com/2016/05/13/sghpa-the-single-page-app-hack-for-github-pages/ -->
<script>
sessionStorage.redirect = location.href;
</script>
<meta http-equiv="refresh" content="0;URL='/'"></meta>
<meta http-equiv='refresh' content='0;URL="/"'></meta>

<link rel='dns-prefetch' href='https://www.googletagmanager.com'>
<link rel='prefetch' href='https://www.googletagmanager.com/gtag/js'>

<link rel="apple-touch-icon" sizes="57x57" href="/static/touch-icons/apple-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="/static/touch-icons/apple-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="/static/touch-icons/apple-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="/static/touch-icons/apple-icon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="/static/touch-icons/apple-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="/static/touch-icons/apple-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="/static/touch-icons/apple-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="/static/touch-icons/apple-icon-152x152.png">
<link rel="apple-touch-icon" sizes="180x180" href="/static/touch-icons/apple-icon-180x180.png">
<link rel="icon" type="image/png" sizes="192x192" href="/static/touch-icons/android-icon-192x192.png">
<link rel="icon" type="image/png" sizes="32x32" href="/static/touch-icons/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="96x96" href="/static/touch-icons/favicon-96x96.png">
<link rel="icon" type="image/png" sizes="16x16" href="/static/touch-icons/favicon-16x16.png">
<link rel="mask-icon" href="/static/touch-icons/safari-pinned-tab.svg" color="#5bbad5">
<link rel="shortcut icon" href="/favicon.ico">
<link rel="manifest" href="/manifest.json">
<meta name="msapplication-TileColor" content="#FAFAFA">
<meta name="msapplication-config" content="/browserconfig.xml">
<meta name="msapplication-TileImage" content="/static/touch-icons/ms-icon-144x144.png">
<meta name="theme-color" content="#FAFAFA">
<link rel='apple-touch-icon' sizes='57x57' href='/static/touch-icons/apple-icon-57x57.png'>
<link rel='apple-touch-icon' sizes='60x60' href='/static/touch-icons/apple-icon-60x60.png'>
<link rel='apple-touch-icon' sizes='72x72' href='/static/touch-icons/apple-icon-72x72.png'>
<link rel='apple-touch-icon' sizes='76x76' href='/static/touch-icons/apple-icon-76x76.png'>
<link rel='apple-touch-icon' sizes='114x114' href='/static/touch-icons/apple-icon-114x114.png'>
<link rel='apple-touch-icon' sizes='120x120' href='/static/touch-icons/apple-icon-120x120.png'>
<link rel='apple-touch-icon' sizes='144x144' href='/static/touch-icons/apple-icon-144x144.png'>
<link rel='apple-touch-icon' sizes='152x152' href='/static/touch-icons/apple-icon-152x152.png'>
<link rel='apple-touch-icon' sizes='180x180' href='/static/touch-icons/apple-icon-180x180.png'>
<link rel='icon' type='image/png' sizes='192x192' href='/static/touch-icons/android-icon-192x192.png'>
<link rel='icon' type='image/png' sizes='32x32' href='/static/touch-icons/favicon-32x32.png'>
<link rel='icon' type='image/png' sizes='96x96' href='/static/touch-icons/favicon-96x96.png'>
<link rel='icon' type='image/png' sizes='16x16' href='/static/touch-icons/favicon-16x16.png'>
<link rel='mask-icon' href='/static/touch-icons/safari-pinned-tab.svg' color='#5bbad5'>
<link rel='shortcut icon' href='/favicon.ico'>
<link rel='manifest' href='/manifest.json'>
<meta name='msapplication-TileColor' content='#FAFAFA'>
<meta name='msapplication-config' content='/browserconfig.xml'>
<meta name='msapplication-TileImage' content='/static/touch-icons/ms-icon-144x144.png'>
<meta name='theme-color' content='#FAFAFA'>
</head>
<body>
<!-- The total size of a custom 404 page must be greater than 512 bytes,
Expand Down
88 changes: 44 additions & 44 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,75 +1,75 @@
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no">
<meta charset='utf-8'>
<meta name='viewport' content='width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no'>
<title>Nicegist</title>

<link rel='dns-prefetch' href='https://api.github.com'>
<link rel='dns-prefetch' href='https://www.googletagmanager.com'>
<link rel='prefetch' href='https://www.googletagmanager.com/gtag/js'>

<link rel="apple-touch-icon" sizes="57x57" href="/static/touch-icons/apple-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="/static/touch-icons/apple-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="/static/touch-icons/apple-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="/static/touch-icons/apple-icon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="/static/touch-icons/apple-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="/static/touch-icons/apple-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="/static/touch-icons/apple-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="/static/touch-icons/apple-icon-152x152.png">
<link rel="apple-touch-icon" sizes="180x180" href="/static/touch-icons/apple-icon-180x180.png">
<link rel="icon" type="image/png" sizes="192x192" href="/static/touch-icons/android-icon-192x192.png">
<link rel="icon" type="image/png" sizes="32x32" href="/static/touch-icons/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="96x96" href="/static/touch-icons/favicon-96x96.png">
<link rel="icon" type="image/png" sizes="16x16" href="/static/touch-icons/favicon-16x16.png">
<link rel="mask-icon" href="/static/touch-icons/safari-pinned-tab.svg" color="#5bbad5">
<link rel="shortcut icon" href="/favicon.ico">
<link rel="manifest" href="/manifest.json">
<meta name="msapplication-TileColor" content="#FAFAFA">
<meta name="msapplication-config" content="/browserconfig.xml">
<meta name="msapplication-TileImage" content="/static/touch-icons/ms-icon-144x144.png">
<meta name="theme-color" content="#FAFAFA">
<link rel='apple-touch-icon' sizes='57x57' href='/static/touch-icons/apple-icon-57x57.png'>
<link rel='apple-touch-icon' sizes='60x60' href='/static/touch-icons/apple-icon-60x60.png'>
<link rel='apple-touch-icon' sizes='72x72' href='/static/touch-icons/apple-icon-72x72.png'>
<link rel='apple-touch-icon' sizes='76x76' href='/static/touch-icons/apple-icon-76x76.png'>
<link rel='apple-touch-icon' sizes='114x114' href='/static/touch-icons/apple-icon-114x114.png'>
<link rel='apple-touch-icon' sizes='120x120' href='/static/touch-icons/apple-icon-120x120.png'>
<link rel='apple-touch-icon' sizes='144x144' href='/static/touch-icons/apple-icon-144x144.png'>
<link rel='apple-touch-icon' sizes='152x152' href='/static/touch-icons/apple-icon-152x152.png'>
<link rel='apple-touch-icon' sizes='180x180' href='/static/touch-icons/apple-icon-180x180.png'>
<link rel='icon' type='image/png' sizes='192x192' href='/static/touch-icons/android-icon-192x192.png'>
<link rel='icon' type='image/png' sizes='32x32' href='/static/touch-icons/favicon-32x32.png'>
<link rel='icon' type='image/png' sizes='96x96' href='/static/touch-icons/favicon-96x96.png'>
<link rel='icon' type='image/png' sizes='16x16' href='/static/touch-icons/favicon-16x16.png'>
<link rel='mask-icon' href='/static/touch-icons/safari-pinned-tab.svg' color='#5bbad5'>
<link rel='shortcut icon' href='/favicon.ico'>
<link rel='manifest' href='/manifest.json'>
<meta name='msapplication-TileColor' content='#FAFAFA'>
<meta name='msapplication-config' content='/browserconfig.xml'>
<meta name='msapplication-TileImage' content='/static/touch-icons/ms-icon-144x144.png'>
<meta name='theme-color' content='#FAFAFA'>

<link href="./static/dom_distiller_viewer.css" rel="stylesheet" media="nope" onload="this.media='all'">
<link href="https://cdn.jsdelivr.net/gh/highlightjs/[email protected]/build/styles/default.min.css" rel="stylesheet" media="nope" onload="this.media='all'">
<link href='/static/dom_distiller_viewer.css' rel='stylesheet' media='nope' onload='this.media="all"'>
<link href='https://cdn.jsdelivr.net/gh/highlightjs/[email protected]/build/styles/default.min.css' rel='stylesheet' media='nope' onload='this.media="all"'>

<script src="https://cdn.jsdelivr.net/gh/markdown-it/[email protected]/dist/markdown-it.min.js"></script>
<script src="./static/vendor/[email protected]"></script>
<script src="https://cdn.jsdelivr.net/gh/highlightjs/[email protected]/build/highlight.min.js" defer></script>
<script src='https://cdn.jsdelivr.net/gh/markdown-it/[email protected]/dist/markdown-it.min.js'></script>
<script src='/static/vendor/[email protected]'></script>
<script src='https://cdn.jsdelivr.net/gh/highlightjs/[email protected]/build/highlight.min.js' defer></script>
</head>
<body class="light sans-serif">
<div id="contentWrap">
<div id="mainContent">
<body class='light sans-serif'>
<div id='contentWrap'>
<div id='mainContent'>
<article>
<header id="articleHeader">
<h1 id="titleHolder">Loading gist...</h1>
<header id='articleHeader'>
<h1 id='titleHolder'>Loading gist...</h1>
</header>
<div id="authorHolder">
<div id='authorHolder'>
<span>
Post by <span id="gistAuthor"></span>,
at <span id="gistPubDate"></span>
Post by <span id='gistAuthor'></span>,
at <span id='gistPubDate'></span>
</span>
</div>
<div id="gistContent">
<div id='gistContent'>
<noscript>Enable JavaScript to use nicegist.</noscript>
<div id="loadingIndicator">
<img src="./static/dom_distiller_material_spinner.svg">
<div id='loadingIndicator'>
<img src='/static/dom_distiller_material_spinner.svg'>
</div>
</div>
</article>
<div id="gist-comments"></div>
<div id='gist-comments'></div>
<footer>
<p id="footerIntro">
Check out the <a href="https://github.com/nicegist/nicegist.github.io">source for Nicegist on GitHub</a>
<p id='footerIntro'>
Check out the <a href='https://github.com/nicegist/nicegist.github.io'>source for Nicegist on GitHub</a>
</p>
<p id="footerPost">
<a href="https://nicegist.github.io/">Nicegist</a>
<p id='footerPost'>
<a href='https://nicegist.github.io/'>Nicegist</a>
· writing for hackers · zero setup · publish in seconds
</p>
</footer>
</div>
</div>
<script src='./static/app.js' async defer></script>
<script src='/static/app.js' async defer></script>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script src='https://www.googletagmanager.com/gtag/js?id=UA-57728344-3' async defer></script>
<script>
Expand Down
28 changes: 22 additions & 6 deletions static/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
var GithubApi = {
xhr: null,
apiBaseUrl: 'https://api.github.com',
githubStatusApiUrl: 'https://kctbh9vrtdwd.statuspage.io/api/v2/summary.json',
githubStatusApiUrl: 'https://kctbh9vrtdwd.statuspage.io/api/v2/summary.json', // https://www.githubstatus.com/api
getXMLHttpRequest: function() {
if (!!window.XMLHttpRequest) {
this.xhr = new window.XMLHttpRequest;
Expand All @@ -17,11 +17,20 @@
get: function(requestUrl, success, failure) {
this.getXMLHttpRequest();

if (!this.xhr) {
window.console.log("AJAX (XMLHTTP) not supported by your client.");
failure({
status: 'error',
msg: 'AJAX (XMLHTTP) not supported by your client but required for Nicegist to work, sorry.'
});
return;
}

var self = this.xhr;

this.xhr.open('GET', requestUrl, true);
this.xhr.setRequestHeader('Accept', 'application/json');
this.xhr.timeout = 1000; // time in milliseconds
this.xhr.timeout = 1500; // time in milliseconds

self.onload = function() {
if (self.status >= 200 && self.status < 400) {
Expand Down Expand Up @@ -65,6 +74,15 @@
});
}
}
failure({
status: 'error',
msg: 'API timeout error when fetching Gist.'
});
} else {
failure({
status: 'error',
msg: 'API timeout error when fetching Gist.'
});
}
}, error => {
failure({
Expand All @@ -83,12 +101,10 @@
this.xhr.send();
},
getGist: function(gistId, success, failure) {
var endpoint = '/gists/' + gistId;
this.get(this.apiBaseUrl + endpoint, success, failure);
this.get(`${this.apiBaseUrl}/gists/${gistId}`, success, failure);
},
getGistComments: function(gistId, success, failure) {
var endpoint = '/gists/' + gistId + '/comments';
this.get(this.apiBaseUrl + endpoint, success, failure);
this.get(`${this.apiBaseUrl}/gists/${gistId}/comments`, success, failure);
},
getGithubApiStatus: function(success, failure) {
this.get(this.githubStatusApiUrl, success, failure);
Expand Down