Skip to content

Commit

Permalink
Merge pull request #34 from geekjuice/master
Browse files Browse the repository at this point in the history
Major updates (UMD, ES6, etc)
  • Loading branch information
geekjuice committed May 9, 2015
2 parents 9f93ffb + 42f19e4 commit bc8e581
Show file tree
Hide file tree
Showing 18 changed files with 468 additions and 2,162 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
## v1.0.0
- Add proper UMD to `Tooltip`
- Convert from `Coffeescript` to `ES6 (Babel)`
- Fix `*.json` files to include `main`
- Remove bundled `tooltip.js`
- Restructure directory layout
- Update `gulp` builds
- Update `drop` dependency to `v1.0.0`
- Update `tether` dependency to `v0.7.1`

57 changes: 57 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Contributing Guide

You will need:

- Node.js/io.js & npm
- Bower
- Gulp
- _Ruby_ (to be deprecated)
- _Sass gem_ (to be deprecated)
- _Compass gem_ (to be deprecated)


## Getting started

1. Fork the project
2. Clone your forked project by running `git clone git@github.com:{
YOUR_USERNAME }/drop.git`
3. Run `npm install` to install both node modules and bower components
4. Test that you can build the source by moving/renaming the existing `dist`
directory and running `npm run build`
5. Assuming everything went well, you should now have a `dist` directory that
matches the one you moved in step 4.
6. __NOTE__: Depending on your local version of Sass and Compass, you may end up
with slightly different stylesheets. In most cases, the changes are
equivalents and nothing to worry about. That said, we are planning on
removing the Ruby dependencies to alleviate issues like this.


## Writing code!

We use `gulp` to facilitate things like transpilation, minification, etc. so
can focus on writing relevant code. If there is a fix or feature you would like
to contribute, we ask that you take the following steps:

1. Most of the _editable_ code lives in the `src` directory while built code
will end up in the `dist` directory upon running `npm run build`.
2. Depending on how big your changes are, bump the version numbers appropriately
in `bower.json` and `package.json`. We try to follow semver, so a good rule
of thumb for how to bump the version is:
- A fix to existing code, perform a patch bump e.g. x.x.0 -> x.x.1
- New feature, perform a minor bump e.g. x.0.x -> x.1.x
- Breaking changes such a rewrite, perform a major bump e.g.
1.x.x -> 2.x.x

Versioning is hard, so just use good judgement and we'll be more than happy
to help out.
3. Provide a thoughtful commit message and push your changes to your fork using
`git push origin master` (assuming your forked project is using `origin` for
the remote name and you are on the `master` branch).
4. Open a Pull Request on GitHub with a description of your changes.


## Testing

Work in progress. We are hoping to add some tests, so if you would like to help
us get started, feel free to contact us through the Issues or open a Pull
Request.
49 changes: 45 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,48 @@
## Tooltip

### [Demo](http://github.hubspot.com/tooltip/docs/welcome)    [Documentation](http://github.hubspot.com/tooltip)

Tooltip.js is a Javascript and CSS library for creating styleable tooltips.
It only depends on [Tether.js](https://github.com/HubSpot/tether).
It is free and open source and was developed by HubSpot developers Zack Bloom ([@zackbloom](github.com/zackbloom)) and Adam Schwartz ([@adamschwartz](github.com/adamschwartz)).


## Install

__Dependencies__

* __[Tether](https://github.com/HubSpot/tether)__
* __[Drop](https://github.com/HubSpot/drop)__

Installing via `npm` and `bower` will bring in the above dependencies as well.


__npm__
```sh
$ npm install tether-tooltip
```

__bower__
```sh
$ bower install tether-tooltip
```

## Usage

```javascript
let tooltipInstance = new Tooltip({
target: document.querySelector('.tooltip-target'),
content: "My awesome <b>content</b>.",
classes: 'tooltip-tether-arrows',
position: 'top left'
})
```

[API Documentation](http://github.hubspot.com/tooltip)

[Demo](http://github.hubspot.com/tooltip/docs/welcome)


## Contributing

We encourage contributions of all kinds. If you would like to contribute in some way, please review our [guidelines for contributing](CONTRIBUTING.md).


## License
Copyright &copy; 2015 HubSpot - [MIT License](LICENSE)
14 changes: 10 additions & 4 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
{
"name": "tether-tooltip",
"version": "0.2.6",
"version": "1.0.0",
"homepage": "https://github.hubspot.com/tooltip",
"authors": [
"Zack Bloom <zackbloom@gmail.com>",
"Adam Schwartz <adam.flynn.schwartz@gmail.com>"
],
"maintainers": [
"Nicholas Hwang <nick.joosung.hwang@gmail.com>"
],
"description": "Tooltips built on Tether",
"keywords": [
"javascript"
"tooltip",
"overlay",
"tether"
],
"license": "MIT",
"main": "dist/js/tooltip.js",
"ignore": [
"**/.*",
"node_modules",
Expand All @@ -19,7 +25,7 @@
"tests"
],
"dependencies": {
"drop": "0.5.4",
"tether": "0.6.5"
"drop": "~1.0.0",
"tether": "~0.7.1"
}
}
60 changes: 0 additions & 60 deletions coffee/tooltip.coffee

This file was deleted.

5 changes: 0 additions & 5 deletions config.rb

This file was deleted.

34 changes: 16 additions & 18 deletions css/tooltip-theme-arrows.css → dist/css/tooltip-theme-arrows.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.tooltip-element, .tooltip-element:after, .tooltip-element:before, .tooltip-element *, .tooltip-element *:after, .tooltip-element *:before {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box; }

.tooltip-element {
Expand All @@ -13,15 +13,13 @@
max-width: 100%;
max-height: 100%; }
.tooltip-element.tooltip-theme-arrows .tooltip-content {
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
-ms-border-radius: 5px;
-o-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;
position: relative;
font-family: inherit;
background: black;
color: #eeeeee;
background: #000;
color: #eee;
padding: 1em;
font-size: 1.1em;
line-height: 1.5em; }
Expand All @@ -40,76 +38,76 @@
top: 100%;
left: 50%;
margin-left: -8px;
border-top-color: black; }
border-top-color: #000; }
.tooltip-element.tooltip-theme-arrows.tooltip-element-attached-top.tooltip-element-attached-center .tooltip-content {
margin-top: 8px; }
.tooltip-element.tooltip-theme-arrows.tooltip-element-attached-top.tooltip-element-attached-center .tooltip-content:before {
bottom: 100%;
left: 50%;
margin-left: -8px;
border-bottom-color: black; }
border-bottom-color: #000; }
.tooltip-element.tooltip-theme-arrows.tooltip-element-attached-right.tooltip-element-attached-middle .tooltip-content {
margin-right: 8px; }
.tooltip-element.tooltip-theme-arrows.tooltip-element-attached-right.tooltip-element-attached-middle .tooltip-content:before {
left: 100%;
top: 50%;
margin-top: -8px;
border-left-color: black; }
border-left-color: #000; }
.tooltip-element.tooltip-theme-arrows.tooltip-element-attached-left.tooltip-element-attached-middle .tooltip-content {
margin-left: 8px; }
.tooltip-element.tooltip-theme-arrows.tooltip-element-attached-left.tooltip-element-attached-middle .tooltip-content:before {
right: 100%;
top: 50%;
margin-top: -8px;
border-right-color: black; }
border-right-color: #000; }
.tooltip-element.tooltip-theme-arrows.tooltip-element-attached-top.tooltip-element-attached-left.tooltip-target-attached-bottom .tooltip-content {
margin-top: 8px; }
.tooltip-element.tooltip-theme-arrows.tooltip-element-attached-top.tooltip-element-attached-left.tooltip-target-attached-bottom .tooltip-content:before {
bottom: 100%;
left: 8px;
border-bottom-color: black; }
border-bottom-color: #000; }
.tooltip-element.tooltip-theme-arrows.tooltip-element-attached-top.tooltip-element-attached-right.tooltip-target-attached-bottom .tooltip-content {
margin-top: 8px; }
.tooltip-element.tooltip-theme-arrows.tooltip-element-attached-top.tooltip-element-attached-right.tooltip-target-attached-bottom .tooltip-content:before {
bottom: 100%;
right: 8px;
border-bottom-color: black; }
border-bottom-color: #000; }
.tooltip-element.tooltip-theme-arrows.tooltip-element-attached-bottom.tooltip-element-attached-left.tooltip-target-attached-top .tooltip-content {
margin-bottom: 8px; }
.tooltip-element.tooltip-theme-arrows.tooltip-element-attached-bottom.tooltip-element-attached-left.tooltip-target-attached-top .tooltip-content:before {
top: 100%;
left: 8px;
border-top-color: black; }
border-top-color: #000; }
.tooltip-element.tooltip-theme-arrows.tooltip-element-attached-bottom.tooltip-element-attached-right.tooltip-target-attached-top .tooltip-content {
margin-bottom: 8px; }
.tooltip-element.tooltip-theme-arrows.tooltip-element-attached-bottom.tooltip-element-attached-right.tooltip-target-attached-top .tooltip-content:before {
top: 100%;
right: 8px;
border-top-color: black; }
border-top-color: #000; }
.tooltip-element.tooltip-theme-arrows.tooltip-element-attached-top.tooltip-element-attached-right.tooltip-target-attached-left .tooltip-content {
margin-right: 8px; }
.tooltip-element.tooltip-theme-arrows.tooltip-element-attached-top.tooltip-element-attached-right.tooltip-target-attached-left .tooltip-content:before {
top: 8px;
left: 100%;
border-left-color: black; }
border-left-color: #000; }
.tooltip-element.tooltip-theme-arrows.tooltip-element-attached-top.tooltip-element-attached-left.tooltip-target-attached-right .tooltip-content {
margin-left: 8px; }
.tooltip-element.tooltip-theme-arrows.tooltip-element-attached-top.tooltip-element-attached-left.tooltip-target-attached-right .tooltip-content:before {
top: 8px;
right: 100%;
border-right-color: black; }
border-right-color: #000; }
.tooltip-element.tooltip-theme-arrows.tooltip-element-attached-bottom.tooltip-element-attached-right.tooltip-target-attached-left .tooltip-content {
margin-right: 8px; }
.tooltip-element.tooltip-theme-arrows.tooltip-element-attached-bottom.tooltip-element-attached-right.tooltip-target-attached-left .tooltip-content:before {
bottom: 8px;
left: 100%;
border-left-color: black; }
border-left-color: #000; }
.tooltip-element.tooltip-theme-arrows.tooltip-element-attached-bottom.tooltip-element-attached-left.tooltip-target-attached-right .tooltip-content {
margin-left: 8px; }
.tooltip-element.tooltip-theme-arrows.tooltip-element-attached-bottom.tooltip-element-attached-left.tooltip-target-attached-right .tooltip-content:before {
bottom: 8px;
right: 100%;
border-right-color: black; }
border-right-color: #000; }

.tooltip-element.tooltip-theme-arrows {
-webkit-pointer-events: none;
Expand Down
Loading

0 comments on commit bc8e581

Please sign in to comment.