mirror of
https://github.com/apachecn/ailearning.git
synced 2026-04-13 18:01:04 +08:00
2021-05-09 15:46:38
This commit is contained in:
15
asset/edit.css
Normal file
15
asset/edit.css
Normal file
@@ -0,0 +1,15 @@
|
||||
#edit-btn {
|
||||
position: fixed;
|
||||
right: 15px;
|
||||
top: 260px;
|
||||
width: 35px;
|
||||
height: 35px;
|
||||
background-repeat: no-repeat;
|
||||
background-size: cover;
|
||||
cursor: pointer;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
background-image: url(edit.svg);
|
||||
}
|
||||
15
asset/edit.js
Normal file
15
asset/edit.js
Normal file
@@ -0,0 +1,15 @@
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
var editBtn = document.createElement('div')
|
||||
editBtn.id = 'edit-btn'
|
||||
document.body.append(editBtn)
|
||||
|
||||
var repo = window.$docsify.repo
|
||||
editBtn.addEventListener('click', function() {
|
||||
if (!repo) return
|
||||
if (!/https?:\/\//.exec(repo))
|
||||
repo = 'https://github.com/' + repo
|
||||
var url = repo + '/tree/master' +
|
||||
location.hash.slice(1) + '.md'
|
||||
window.open(url)
|
||||
})
|
||||
})
|
||||
13
asset/edit.svg
Normal file
13
asset/edit.svg
Normal file
@@ -0,0 +1,13 @@
|
||||
<!--?xml version="1.0" encoding="UTF-8" standalone="no"?-->
|
||||
<svg viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" class="si-glyph si-glyph-edit">
|
||||
<!-- Generator: Sketch 3.0.3 (7891) - http://www.bohemiancoding.com/sketch -->
|
||||
<title>Edit</title>
|
||||
|
||||
<defs></defs>
|
||||
<g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<g transform="translate(0.000000, 1.000000)" fill="#434343">
|
||||
<path d="M15.682,1.91 L14.147,0.396 C13.737,-0.012 12.929,-0.181 12.54,0.207 L6.485,6.234 C6.485,6.234 5.164,10.147 5.039,10.476 C4.94,10.738 5.27,11.066 5.499,10.951 C5.873,10.765 9.604,9.32 9.604,9.32 L15.675,3.263 C16.065,2.875 16.093,2.317 15.682,1.91 L15.682,1.91 Z M9.021,8.854 L6.454,9.828 L5.993,9.403 L7.218,6.438 L7.959,6.984 L9.017,6.984 L9.021,8.854 L9.021,8.854 Z" class="si-glyph-fill"></path>
|
||||
<path d="M12.042,9.345 L12.042,13.042 L0.958,13.042 L0.958,2 L9.141,1.917 L9.953,1.058 L0,1.058 L0,14 L13,14 L12.943,8.578 L12.042,9.345 Z" class="si-glyph-fill"></path>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.1 KiB |
@@ -20,6 +20,8 @@
|
||||
<script src="asset/dark-mode.js"></script>
|
||||
<link rel="stylesheet" href="asset/share.css">
|
||||
<script src="asset/share.js"></script>
|
||||
<link rel="stylesheet" href="asset/edit.css">
|
||||
<script src="asset/edit.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="app">now loading...</div>
|
||||
|
||||
Reference in New Issue
Block a user