This repository has been archived by the owner on Oct 26, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtemplate.ejs
131 lines (112 loc) · 3.87 KB
/
template.ejs
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
<!doctype html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8" lang="en"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9" lang="en"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" type="text/css" href="https://github.global.ssl.fastly.net/assets/github-c8eaece92b2ba4da8cdfd619fae679b5161d6b98.css">
<link rel="stylesheet" type="text/css" href="https://github.global.ssl.fastly.net/assets/github2-7f0d7b48b3c00afffc09e3e222de589a9adf9afa.css">
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
<style>
.ov-livereload-progress {
position: fixed;
top: 10px;
left: 33%;
margin: auto;
width: 33%;
}
</style>
<script type="text/javascript">
/**
* a grunt watch live-reload plugin supporting reload of html snippets
*
* @return {LiveReloadPlugin} the plugin constructor
*
* @see https://github.com/livereload/livereload-js
*/
window.LiveReloadPluginOrangevolt = (function() {
var target;
function LivrereloadPlugin( window, options) {
$( window).ready( function() {
var target = $( '.markdown-body');
this.reload( target.data( 'url'), {});
$( '.ov-livereload-progress').show();
}.bind( this));
}
LivrereloadPlugin.identifier = "orangevolt-livereload";
LivrereloadPlugin.version = "0.1.0";
LivrereloadPlugin.prototype.reload = function( path, options) {
var target = $( '.markdown-body');
var scroll = {
x : window.scrollX,
y : window.scrollY
};
$( '.ov-livereload-progress').animate({
'opacity' : 1.0
});
target.css({
'opacity' : 0.3
});
var ajaxOptions = {
url : '/' + path,
cache : false
};
$.ajax( ajaxOptions)
.done( function( content, textStatus, jqXHR) {
content = $( content);
// adjust highlight syntax css classes to match github css classes
content.children( 'PRE >CODE')
.addClass( 'highlight')
.find( '.hljs-keyword').addClass( 'k').end()
.find( '.hljs-comment').addClass( 'c').end()
.find( '.hljs-literal').addClass( 'm').end()
.find( '.hljs-number').addClass( 'm').end()
.find( '.hljs-string').addClass( 's').end()
.find( '.hljs-regexp').addClass( 'sr').end()
.find( '.hljs-built_in').addClass( 'nb').end()
.find( '.hljs-class').addClass( 'nc').end()
.find( '.hljs-title').addClass( 'nf').end()
.find( '.hljs-title').addClass( 'nf').end()
;
$( target).empty().append( content);
window.scrollTo( scroll.x, scroll.y);
})
.always( function() {
$( '.ov-livereload-progress').animate({
'opacity' : 0
});
target.animate({
'opacity' : 1.0
});
});
// -> means reload was handled by this plugin
return true;
};
return LivrereloadPlugin;
})();
</script>
</head>
<body>
<div class="container">
<div class="repository-with-sidebar repo-container">
<div class="repository-sidebar">
</div>
<div id="js-repo-pjax-container" class="repository-content context-loader-container" data-pjax-container="">
<div class="page">
<h1 class="title"><%- url.substr( 1)%></h1>
<p>
<em>(<%- url.substr( 1)%>)</em>
<progress style="display:none" class="ov-livereload-progress">reloading content ...</progress>
</p>
<hr>
</div>
<div class="markdown-body" data-url="<%- url.substr( 1)%>">
</div>
</div>
</div>
</div>
</body>
</html>