mirror of
https://github.com/netzbegruenung/handbuch.gruene.social-recovered.git
synced 2024-05-02 17:44:52 +02:00
Serve JS from same directory
This commit is contained in:
parent
701b3c8a4e
commit
84bad4c3a8
|
@ -38,7 +38,7 @@
|
|||
<link rel="stylesheet" href="css/theme.css">
|
||||
</head>
|
||||
<body>
|
||||
<script src="//unpkg.com/docsify-edit-on-github/index.js"></script>
|
||||
<script src="js/edit-on-github.js"></script>
|
||||
<div id="app"></div>
|
||||
<script>
|
||||
var docBase = 'https://github.com/netzbegruenung/handbuch.gruene.social/tree/master/docs/';
|
||||
|
@ -60,8 +60,8 @@
|
|||
]
|
||||
}
|
||||
</script>
|
||||
<script src="//unpkg.com/docsify/lib/docsify.min.js"></script>
|
||||
<script src="//unpkg.com/docsify-pagination/dist/docsify-pagination.min.js"></script>
|
||||
<script src="js/docsify.min.js"></script>
|
||||
<script src="js/docsify-pagination.min.js"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
1
docs/js/docsify-pagination.min.js
vendored
Normal file
1
docs/js/docsify-pagination.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
docs/js/docsify.min.js
vendored
Normal file
1
docs/js/docsify.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
45
docs/js/edit-on-github.js
Normal file
45
docs/js/edit-on-github.js
Normal file
|
@ -0,0 +1,45 @@
|
|||
;(function(win) {
|
||||
win.EditOnGithubPlugin = {}
|
||||
|
||||
function create(docBase, docEditBase, title) {
|
||||
title = title || 'Edit on github'
|
||||
docEditBase = docEditBase || docBase.replace(/\/blob\//, '/edit/')
|
||||
|
||||
function editDoc(event, vm) {
|
||||
var docName = vm.route.file
|
||||
|
||||
if (docName) {
|
||||
var editLink = docEditBase + docName
|
||||
window.open(editLink)
|
||||
event.preventDefault()
|
||||
return false
|
||||
} else {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
win.EditOnGithubPlugin.editDoc = editDoc
|
||||
|
||||
return function(hook, vm) {
|
||||
win.EditOnGithubPlugin.onClick = function(event) {
|
||||
EditOnGithubPlugin.editDoc(event, vm)
|
||||
}
|
||||
|
||||
var header = [
|
||||
'<div style="overflow: auto">',
|
||||
'<p style="float: right"><a href="',
|
||||
docBase,
|
||||
'" target="_blank" onclick="EditOnGithubPlugin.onClick(event)">',
|
||||
title,
|
||||
'</a></p>',
|
||||
'</div>'
|
||||
].join('')
|
||||
|
||||
hook.afterEach(function (html) {
|
||||
return header + html
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
win.EditOnGithubPlugin.create = create
|
||||
}) (window)
|
Loading…
Reference in a new issue