Skip to content

Commit

Permalink
add clear btn and other fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
timqian committed Jun 28, 2016
1 parent 0de6776 commit 4dc12e9
Show file tree
Hide file tree
Showing 9 changed files with 60 additions and 43 deletions.
20 changes: 9 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
## Intro
## Show cases

// TODO
### lodash vs underscore

http://www.timqian.com/star-history/#lodash/lodash&jashkenas/underscore

![](./assets/lodashUnderscore.png)

#### ( As a chrome extension: https://github.com/timqian/star-history-plugin/ )

## Updates

- 2016-6-28: Add clear btn

- 2016-6-28: Better view for "many star" repos(use current star number as the last point on the graph)

- 2016-6-26: store repo info into url hash
- 2016-6-26: Store repo info into url hash

- 2016-6-26: multiple kinds of input styles(eg: github.com/timqian/star-history, ...)

Expand All @@ -18,14 +24,6 @@

- 2016-5-26: Update mobile view

## Show cases:

### meteor vs rails vs django
![](./assets/django.png)

### lodash vs underscore
![lodash vs underscore](./assets/lodash_underscore.png)


[![paypal donate][paypal-image]][paypal-url]
[paypal-image]: https://www.paypal.com/en_US/i/btn/btn_donate_SM.gif
Expand Down
Binary file removed assets/django.png
Binary file not shown.
Binary file added assets/lodashUnderscore.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed assets/lodash_underscore.png
Binary file not shown.
Binary file removed assets/phone.png
Binary file not shown.
28 changes: 14 additions & 14 deletions dist/bundle.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/bundle.js.map

Large diffs are not rendered by default.

45 changes: 29 additions & 16 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@
font-size: 15pt;
margin:4pt;
}

#theBtn {
button {
text-decoration: none;
text-align: center;
font-size: 16pt;
Expand All @@ -58,11 +57,22 @@
padding: 6pt 10pt;
cursor: default;
}

#theForm {
display: inline-block;
padding: 0;
margin: 0;
}

footer {
max-width: 800px;
margin: auto;
}

#clearBtn {
float: right;
background-color: #9b0000;
}
</style>
<title>Star history</title>

Expand All @@ -83,21 +93,24 @@
<svg></svg>
</div>

<a href="https://github.com/timqian/star-history-plugin">Chrome extension version of star-history</a>
<br/>
<a href="https://github.com/timqian/star-history/blob/gh-pages/README.md#updates">Updates</a>
</script>
<footer>
<button id="clearBtn" >clear</button>
<a href="https://github.com/timqian/star-history-plugin">Chrome extension version of star-history</a>
<br/>
<a href="https://github.com/timqian/star-history/blob/gh-pages/README.md#updates">Updates</a>
</footer>

<script type="text/javascript" src="./dist/bundle.js" charset="utf-8"></script>

<!--Google analytics-->
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
<!--Google analytics-->
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');

ga('create', 'UA-56506279-1', 'auto');
ga('send', 'pageview');
</script>
<!--Google analytics-->
ga('create', 'UA-56506279-1', 'auto');
ga('send', 'pageview');
</script>
<!--Google analytics-->
</body>
8 changes: 7 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ if (location.hash !== '') {
})
}

document.getElementById('theForm').addEventListener("submit", async event => {
document.getElementById('theForm').addEventListener('submit', async event => {
event.preventDefault();

// get repo str (format: 'torvalds/linux')
Expand All @@ -33,6 +33,12 @@ document.getElementById('theForm').addEventListener("submit", async event => {

});

document.getElementById('clearBtn').addEventListener('click', () => {
data = []
location.hash = ''
draw(data)
})


async function fetchDataAndDraw(repo) {

Expand Down

0 comments on commit 4dc12e9

Please sign in to comment.