Skip to content

Commit

Permalink
add view-source buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
FrankFang committed May 7, 2017
1 parent 2c28dd8 commit 5b70211
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions demos/calendar.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ <h1 class="date"></h1>
<div class="calendar"></div>
</div>
<script src="../lib/dom/index.js"></script>
<script src="view-source.js"></script>
<script src="../lib/date2/index.js"></script>
<script src="../lib/calendar/index.js"></script>
<style>
Expand Down
1 change: 1 addition & 0 deletions demos/fullpage.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
</div>

<script src="../lib/dom/index.js"></script>
<script src="view-source.js"></script>
<script src="../lib/fullpage/index.js"></script>
<style>
body{ margin:0; color: #0F0E0D; }
Expand Down
1 change: 1 addition & 0 deletions demos/image-picker.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
</div>
</div>
<script src="../lib/dom/index.js"></script>
<script src="view-source.js"></script>
<script src="../lib/image-picker/index.js"></script>
<style>
.image-picker{ width: 100px; height: 100px; border-radius: 50%; overflow: hidden; position: relative; }
Expand Down
1 change: 1 addition & 0 deletions demos/pager.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
<div class="pager"> </div>
</div>
<script src="../lib/dom/index.js"></script>
<script src="view-source.js"></script>
<script src="../lib/bom/index.js"></script>
<script src="../lib/pager/index.js"></script>
<style>
Expand Down
1 change: 1 addition & 0 deletions demos/tabs.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
</div>

<script src="../lib/dom/index.js"></script>
<script src="view-source.js"></script>
<script src="../lib/tabs/index.js"></script>
<style>
body{ background: #E2DED2; display: flex; justify-content: center; align-items: flex-start; min-height: 100vh; }
Expand Down
13 changes: 13 additions & 0 deletions demos/view-source.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
let parts = location.pathname.split(/\/|\./)
let name = parts[parts.length - 1 - 1]
let a = dom.create(`<a id="viewSource" href="https://github.com/FrankFang/wheels#如何阅读源代码">查看源码</a>`)
a.style.position = 'fixed'
a.style.top = '.2em'
a.style.right = '.2em'
a.style.background = 'black'
a.style.border = '1px solid white'
a.style.color = 'white'
a.style.padding = '.2em'
document.body.appendChild(a)
}

0 comments on commit 5b70211

Please sign in to comment.