Skip to content

Commit b9153df

Browse files
committed
Releasing Tocify v0.1.0
1 parent 36f2d05 commit b9153df

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+10710
-6
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules

LICENSE-MIT

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
Copyright (c) 2012 Greg Franko
2+
3+
Permission is hereby granted, free of charge, to any person
4+
obtaining a copy of this software and associated documentation
5+
files (the "Software"), to deal in the Software without
6+
restriction, including without limitation the rights to use,
7+
copy, modify, merge, publish, distribute, sublicense, and/or sell
8+
copies of the Software, and to permit persons to whom the
9+
Software is furnished to do so, subject to the following
10+
conditions:
11+
12+
The above copyright notice and this permission notice shall be
13+
included in all copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17+
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19+
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22+
OTHER DEALINGS IN THE SOFTWARE.

README.markdown

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
jquery.tocify.js - jQuery Table of Contents
2+
-------------------------------------------
3+
4+
A jQuery plugin that dynamically generates a table of contents. Tocify can be optionally styled with **jQueryUI Themeroller**, and optionally animated with jQuery show/hide effects. Tocify also optionally provides support for **smooth scrolling**, **scroll highlighting**, **scroll page extending**, and the **HTML5 pushstate API** via [History.js](https://github.com/balupton/History.js/).
5+
6+
[Homepage](http://gregfranko.com/jquery.tocify.js/)
7+
8+
**Notable Features**
9+
10+
- Styleable with the **jQueryUI Themeroller**
11+
12+
- Supports dynamic scroll and click **jQuery show/hide effects**
13+
14+
- Supports **HTML5 History pushstate API** (via History.js) for forward and back button support
15+
16+
- Supports **smooth scrolling** animations
17+
18+
- Supports dynamic **scroll highlighting**
19+
20+
- Supports a **page extender** option to make sure a page is big enough to scroll to all table of content items
21+
22+
- Passes **jsHint** with no errors
23+
24+
##Requirements
25+
jQuery 1.7.2+
26+
27+
jQueryUI Widget Factory 1.8.20+
28+
29+
##Browser Support
30+
IE7+, Firefox 4+, Chrome, Safari 4+, and Opera 11+
31+
32+
##Unit Tests
33+
All unit tests are written using the Jasmine Framework (Work in Progress)
34+
35+
##Contributing
36+
Take care to maintain the existing coding style. Add Jasmine unit tests for any new or changed functionality. Lint and test your code using [grunt](https://github.com/cowboy/grunt).
37+
38+
If you plan to contribute to `Tocify` in the future, keep in mind that you should make sure your code passes the Grunt checks. If you are on Windows (like me) remember you need to run the grunt command using `grunt.cmd`. Also, if you have trouble getting the Jasmine Unit Tests to work with PhantomJS 1.5 (the current release), install PhantomJS 1.3.
39+
40+
After you have verified your code, send a pull request to the `Tocify` dev branch. After you send a pull request, you will hear back from me shortly after I review your code.
41+
42+
You'll find source code in the "src" subdirectory!
43+
44+
##Forking
45+
If you find that you need a feature that Tocify does not currently support, either let me know via the Tocify issue tracker, or fork Tocify on Github and easily extend it to create your own widget!
46+
47+
##Change Log
48+
49+
50+
`0.1.0` - July 11, 2012
51+
52+
- Initial Tocify release. Added annotated source code and documentation
53+
54+
**Contributors**
55+
Greg Franko
56+
57+
## License
58+
Copyright (c) 2012 Greg Franko
59+
Licensed under the MIT license.

README.md

-6
This file was deleted.

demos/default.html

+218
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,218 @@
1+
<!doctype html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8">
5+
<meta http-equiv="X-UA-Compatible" content="chrome=1">
6+
<title>Tocify by gfranko</title>
7+
<link href='http://fonts.googleapis.com/css?family=Kameron:400,700|Sansita+One' rel='stylesheet' type='text/css'>
8+
<link rel="stylesheet" href="styles/bootstrap.css" />
9+
<link type="text/css" rel="stylesheet" href="../src/stylesheets/jqueryUI/jquery-ui-1.8.18.custom.css" />
10+
<link type="text/css" rel="stylesheet" href="../src/stylesheets/Tocify/jquery.tocify.css" />
11+
<!--[if lt IE 9]>
12+
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
13+
<![endif]-->
14+
<!--[if gt IE 5]>
15+
<link rel="stylesheet" href="stylesheets/ie.css">
16+
<![endif]-->
17+
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
18+
19+
</head>
20+
<body>
21+
<a href="https://github.com/gfranko/jquery.tocify.js" target="_blank"><img style="position: fixed;top: 0; right: 0; border: 0;z-index:999999;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_white_ffffff.png" alt="Fork me on GitHub" alt="Fork me on GitHub"></a>
22+
<br />
23+
<div id="toc">
24+
<div class="toc-title">
25+
<h1>Tocify</h1>
26+
<p>A jQuery Table of Contents Plugin</p>
27+
<div id="switcher" align="center"></div>
28+
</div>
29+
</div>
30+
<div class="documentation well">
31+
<br /><b />
32+
<h1>Description</h1>
33+
<br />
34+
<div class="github-widget" data-repo="gfranko/jquery.tocify.js"></div>
35+
<br />
36+
<h3>Notable Features</h3>
37+
<br />
38+
<p>Supports <span class="headerDoc">HTML5 History pushstate API</span> (via History.js) for forward and back button support</p>
39+
<br />
40+
<p>Supports styling with <span class="headerDoc">jQueryUI Themeroller</span></p>
41+
<br />
42+
<p>Supports show/hide animations with <span class="headerDoc">jQuery effects</span></p>
43+
<br />
44+
<p>Supports <span class="headerDoc">smooth scrolling animations</span>
45+
</p>
46+
<br />
47+
<p>Supports <span class="headerDoc">dynamic scroll highlighting</span></p>
48+
<br />
49+
<p>Supports <span class="headerDoc">dynamic scroll show/hide effects</span></p>
50+
<br />
51+
<p>Supports <span class="headerDoc">page extender</span> option to make sure a page is big enough to scroll to all table of content items</p>
52+
<br />
53+
<h1>Requirements</h1>
54+
<br />
55+
<h4 class="headerDoc">jQuery 1.7.2+</h4>
56+
<p>The latest version of jQuery is always recommended</p>
57+
<br />
58+
<h4 class="headerDoc">jQueryUI Widget Factory 1.8.20+</h4>
59+
<p>The latest version of the jQueryUI Widget Factory is always recommended</p>
60+
<br />
61+
<h1>Optional Dependencies</h1>
62+
<br />
63+
<h4 class="headerDoc">History.js</h4>
64+
<p>History.js is required if you want forward and back button support.
65+
<br /><br />
66+
Note: If you do not include History.js, then Tocify will not have history support, but it will still be functional.
67+
</p>
68+
<br />
69+
<h1>Getting Started</h1>
70+
<br />
71+
<h3 class="headerDoc">Downloads</h3>
72+
<br />
73+
<p>Download the latest versions of...</p>
74+
1. <a href="http://www.jquery.com" target="_blank">jQuery</a>
75+
<br />
76+
2. <a href="http://jqueryui.com/download" target="_blank">jQueryUI Widget Factory</a> (You only need the Widget component underneath the UI Core dependency)
77+
<br />
78+
3. <a href="https://github.com/balupton/History.js/" target="_blank">History.js</a> (If you want forward and back button support)
79+
<br /><br />
80+
<h3 class="headerDoc">HTML</h3>
81+
82+
<br /><br />
83+
<h1>Options</h1>
84+
<br />
85+
<h3 class="headerDoc">context</h3>
86+
<p>The container element that holds all of the elements used to generate the table of contents.</p>
87+
<br />
88+
<p>Accepts String: Any jQuery selector</p>
89+
<br />
90+
<h6>Default</h6>
91+
<p>context: "body"</p>
92+
<br /><br />
93+
<h3 class="headerDoc">selectors</h3>
94+
<p>The element's used to generate the table of contents. The order is very important since it will determine the table of content's nesting structure</p>
95+
<br />
96+
<p>Accepts a String: Each comma separated selector must be a valid jQuery selector</p>
97+
<br />
98+
<h6>Default</h6>
99+
<p>selectors: "h1, h2, h3"</p>
100+
<br /><br />
101+
<h3 class="headerDoc">showEffect</h3>
102+
<p>Used to display any of the table of contents nested items</p>
103+
<br />
104+
<p>Accepts String: "none", "fadeIn", "show", "slideDown", or any of the jQueryUI show effects (i.e. "bounce")</p>
105+
<br />
106+
<h6>Default</h6>
107+
<p>showEffect: "slideDown"</p>
108+
<br /><br />
109+
<h3 class="headerDoc">showEffectSpeed</h3>
110+
<p>The time duration of the show animation</p>
111+
<br />
112+
<p>Accepts Number (milliseconds) or String: "slow", "medium", or "fast"</p>
113+
<br />
114+
<h6>Default</h6>
115+
<p>showEffectSpeed: "medium"</p>
116+
<br /><br />
117+
<h3 class="headerDoc">hideEffect</h3>
118+
<p>Used to hide any of the table of contents nested items</p>
119+
<br />
120+
<p>Accepts String: "none", "fadeOut", "hide", "slideUp", or any of the jQueryUI hide effects (i.e. "explode")</p>
121+
<br />
122+
<h6>Default</h6>
123+
<p>hideEffect: "slideUp"</p>
124+
<br /><br />
125+
<h3 class="headerDoc">hideEffectSpeed</h3>
126+
<p>The time duration of the hide animation</p>
127+
<br />
128+
<p>Accepts Number (milliseconds) or String: "slow", "medium", or "fast"</p>
129+
<br />
130+
<h6>Default</h6>
131+
<p>hideEffectSpeed: "medium"</p>
132+
<br /><br />
133+
<h3 class="headerDoc">smoothScroll</h3>
134+
<p>Animates the page scroll when specific table of content items are clicked and the page moves up or down</p>
135+
<br />
136+
<p>Accepts a boolean: true or false</p>
137+
<br />
138+
<h6>Default</h6>
139+
<p>smoothScroll: true</p>
140+
<br /><br />
141+
<h3 class="headerDoc">smoothScrollSpeed</h3>
142+
<p>The time duration of the smoothScroll animation</p>
143+
<br />
144+
<p>Accepts Number (milliseconds) or String: "slow", "medium", or "fast"</p>
145+
<br />
146+
<h6>Default</h6>
147+
<p>smoothScrollSpeed: "medium"</p>
148+
<br /><br />
149+
<h3 class="headerDoc">showAndHideOnScroll</h3>
150+
<br />
151+
<p>Determines if table of content nested items should be shown and hidden while a user scrolls the page</p>
152+
<br />
153+
<p>Accepts a boolean: true or false</p>
154+
<br />
155+
<h6>Default</h6>
156+
<br />
157+
<p>showAndHideOnScroll: true</p>
158+
<br /><br />
159+
<h3 class="headerDoc">highlightOnScroll</h3>
160+
<br />
161+
<p>Determines if table of content nested items should be highlighted (set to a different background color to show it is the currently active item) while scrolling</p>
162+
<br />
163+
<p>Accepts a boolean: true or false</p>
164+
<br />
165+
<h6>Default</h6>
166+
<br />
167+
<p>highlightOnScroll: true</p>
168+
<br /><br />
169+
170+
<h3 class="headerDoc">highlightOffset</h3>
171+
<br />
172+
<p>The offset distance in pixels to trigger the next active table of contents item</p>
173+
<br />
174+
<p>Accepts a number</p>
175+
<br />
176+
<h6>Default</h6>
177+
<br />
178+
<p>highlightOffset: 40</p>
179+
<br /><br />
180+
181+
<h3 class="headerDoc">jqueryUI</h3>
182+
<br />
183+
<p>Determines if jqueryUI or regular CSS classes will be added to the table of contents</p>
184+
<br />
185+
<p>Accepts a boolean: true or false</p>
186+
<br />
187+
<h6>Default</h6>
188+
<br />
189+
<p>jqueryUI: true</p>
190+
<br /><br />
191+
192+
<h3 class="headerDoc">extendPage</h3>
193+
<br />
194+
<p>If a user scrolls to the bottom of the page and the page is not tall enough to scroll to the last table of contents item, then the page height is increased</p>
195+
<br />
196+
<p>Accepts a boolean: true or false</p>
197+
<br />
198+
<h6>Default</h6>
199+
<br />
200+
<p>extendPage: true</p>
201+
202+
</div>
203+
<script src="../libs/jquery/jquery-1.7.2.min.js"></script>
204+
<script src="../libs/jqueryui/jquery-ui-1.8.20.custom.min.js"></script>
205+
<script src="../libs/history/jquery.history.js"></script>
206+
<script src="../src/javascripts/jquery.tocify.js"></script>
207+
<script src="http://jqueryui.com/themeroller/themeswitchertool/"></script>
208+
<script src="javascripts/githubrepo.js"></script>
209+
<script>
210+
$(function() {
211+
var toc = $("#toc").tocify({ context: ".documentation", selectors: "h1, h3, h4" });
212+
$('#switcher').themeswitcher();
213+
});
214+
</script>
215+
216+
217+
</body>
218+
</html>

demos/javascripts/githubrepo.js

+53
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)