├── .gitignore
├── CHANGELOG.md
├── Gruntfile.js
├── README.md
├── demo
├── more-indexing.html
├── number-indexing.html
├── sample.html
├── scroll.html
└── style.html
├── dist
├── css
│ ├── toc-scroll.css
│ ├── toc-scroll.min.css
│ ├── toc-scroll.scss
│ ├── toc.css
│ ├── toc.min.css
│ └── toc.scss
└── js
│ ├── toc.js
│ └── toc.min.js
├── img
└── screenshot.png
├── package.json
├── src
├── css
│ ├── toc-scroll.css
│ ├── toc-scroll.scss
│ ├── toc.css
│ └── toc.scss
└── js
│ └── toc.js
└── vendor
├── bootstrap
├── css
│ ├── bootstrap-theme.css
│ ├── bootstrap-theme.min.css
│ ├── bootstrap.css
│ └── bootstrap.min.css
├── fonts
│ ├── glyphicons-halflings-regular.eot
│ ├── glyphicons-halflings-regular.svg
│ ├── glyphicons-halflings-regular.ttf
│ └── glyphicons-halflings-regular.woff
└── js
│ ├── bootstrap.js
│ └── bootstrap.min.js
└── jquery
├── jquery-1.10.2.min.js
└── jquery-1.10.2.min.map
/.gitignore:
--------------------------------------------------------------------------------
1 | .idea/*
2 | node_modules/*
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # Change Log
2 |
3 | ## v1.1.2 (2014/01/16)
4 |
5 | * Add shortcut definition for indexing format
6 |
7 | ## v1.1.1 (2013/10/21):
8 |
9 | * ^#2: Doesn't work when using the default indexing format
10 |
11 | ## v1.1.0 (2013/10/19)
12 |
13 | * +#1: Allow to define different format for each heading level
14 |
15 | ## v1.0.0 (2013/09/26)
16 |
17 | * Generate anchor link for heading
18 | * Automatically scroll to with the help of [Bootstrap ScrollSpy](http://getbootstrap.com/javascript/#scrollspy) plugin
19 | * Easy to customize look and feel
--------------------------------------------------------------------------------
/Gruntfile.js:
--------------------------------------------------------------------------------
1 | module.exports = function(grunt) {
2 | grunt.initConfig({
3 | pkg: grunt.file.readJSON('package.json'),
4 |
5 | buildDir: 'dist',
6 |
7 | banner: [
8 | '/**',
9 | ' * TocJS v<%= pkg.version %> (<%= pkg.homepage %>)',
10 | ' *',
11 | ' * Generate a table of contents based on headings',
12 | ' *',
13 | ' * @author http://twitter.com/nghuuphuoc',
14 | ' * @copyright (c) 2013 - 2014 Nguyen Huu Phuoc',
15 | ' * @license MIT',
16 | ' */\n\n'
17 | ].join('\n'),
18 |
19 | // See https://github.com/gruntjs/grunt-contrib-copy
20 | copy: {
21 | main: {
22 | files: [
23 | { cwd: 'src/css', src: '**', dest: '<%= buildDir %>/css', expand: true, flatten: true, filter: 'isFile' },
24 | { cwd: 'src/js', src: '**', dest: '<%= buildDir %>/js', expand: true, flatten: true, filter: 'isFile' }
25 | ]
26 | }
27 | },
28 |
29 | // https://github.com/gruntjs/grunt-contrib-cssmin
30 | cssmin: {
31 | minify: { expand: true, cwd: 'src/css/', src: ['*.css'], dest: '<%= buildDir %>/css/', ext: '.min.css' },
32 | add_banner: {
33 | options: {
34 | banner: '<%= banner %>'
35 | },
36 | files: {
37 | '<%= buildDir %>/css/toc.min.css': ['src/css/toc.css'],
38 | '<%= buildDir %>/css/toc-scroll.min.css': ['src/css/toc-scroll.css']
39 | }
40 | }
41 | },
42 |
43 | uglify: {
44 | options: {
45 | banner: '<%= banner %>'
46 | },
47 | build: {
48 | src: ['src/js/toc.js'],
49 | dest: '<%= buildDir %>/js/toc.min.js'
50 | }
51 | }
52 | });
53 |
54 | grunt.registerTask('default', 'build');
55 | grunt.registerTask('build', ['copy', 'cssmin', 'uglify']);
56 |
57 | grunt.loadNpmTasks('grunt-contrib-copy');
58 | grunt.loadNpmTasks('grunt-contrib-cssmin');
59 | grunt.loadNpmTasks('grunt-contrib-uglify');
60 | };
61 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # TocJS
2 |
3 | TocJS is a jQuery plugin for generating table of contents based on headings.
4 |
5 | 
6 |
7 | ## Demo
8 |
9 | * [Sample demo](https://rawgithub.com/nghuuphuoc/tocjs/master/demo/sample.html)
10 | * [Style with Bootstrap](https://rawgithub.com/nghuuphuoc/tocjs/master/demo/style.html)
11 | * [Scroll automatically](https://rawgithub.com/nghuuphuoc/tocjs/master/demo/scroll.html)
12 | * [Number indexing](https://rawgithub.com/nghuuphuoc/tocjs/master/demo/number-indexing.html)
13 | * [More indexing styles](https://rawgithub.com/nghuuphuoc/tocjs/master/demo/more-indexing.html)
14 |
15 | ## Features
16 |
17 | * Allow to define different format for each heading level
18 | * Generate anchor link for heading
19 | * Automatically scroll to with the help of [Bootstrap ScrollSpy](http://getbootstrap.com/javascript/#scrollspy) plugin
20 | * The table of contents are generated using nested ```ul``` elements
21 | * Easy to customize look and feel
22 |
23 | ## Download
24 |
25 | You can download TocJS from the [Github repository](https://github.com/nghuuphuoc/tocjs) directly or use [bower](http://bower.io):
26 |
27 | ```bash
28 | $ bower install tocjs
29 | ```
30 |
31 | ## Usage
32 |
33 | By default, TocJS generates a table of contents based on the headings (```h1``` to ```h6```) found on page.
34 |
35 | In order to use this plugin:
36 |
37 | * Insert ```toc.js``` to your page, ensure that it is placed after jQuery:
38 |
39 | ```html
40 |
41 |
42 | ```
43 |
44 | * Call the plugin when the document is ready:
45 |
46 | ```javascript
47 |
52 | ```
53 |
54 | The plugin provides the following options:
55 |
56 | * ```selector``` (default value is _h1, h2, h3, h4, h5, h6_): Indicates which elements will be found and included in the table of contents
57 | * ```elementClass``` (_toc_): The CSS class which will be added to root element
58 | * ```rootUlClass``` (_toc-ul-root_): The CSS class which will be added to the root generated ```ul``` element
59 | * ```ulClass``` (_toc-ul_): The CSS class which will be added to all generated ```ul``` elements (including the root and sub ones)
60 | * ```prefixLinkClass``` (_toc-link-_): This option will be added as a prefix to CSS class of all generated ```a``` elements. The suffix is level of associating heading (1 to 6)
61 | * ```heading``` (_null_): The _Table of Contents_ heading label placed at the top. This heading is not shown by default.
62 | * ```indexingFormats``` (_{}_): Define the indexing formats for each heading level
63 |
64 | ```javascript
65 | $(element).toc({
66 | indexingFormats: {
67 | : ''
68 | }
69 | });
70 | ```
71 |
72 | `````` can be 'h1', 'h2', ..., 'h6'
73 |
74 | `````` is a string and can be:
75 |
76 | Value | Description
77 | -----------------------------|------------
78 | ```number``` or ```1``` | The headings will be prefixed with number (1, 2, 3, ...)
79 | ```upperAlphabet```, ```A``` | Prefix headings with uppercase alphabetical characters (A, B, C, ...)
80 | ```lowerAlphabet```, ```a``` | Prefix headings with lowercase alphabetical characters (a, b, c, ...)
81 | ```upperRoman```, ```I``` | Prefix headings with uppercase Roman numerals (I, II, III, ...)
82 | ```lowerRoman```, ```i``` | Prefix headings with lowercase Roman numerals (i, ii, iii, ...)
83 |
84 | You can define different formatter for each heading level, for example:
85 |
86 | ```javascript
87 | $(element).toc({
88 | indexingFormats: {
89 | 'h1': 'upperAlphabet',
90 | 'h2': 'number',
91 | 'h3': 'lowerAlphabet'
92 | }
93 | });
94 |
95 | $(element).toc({
96 | indexingFormats: {
97 | 'h1': 'A',
98 | 'h2': '1',
99 | 'h3': 'a'
100 | }
101 | });
102 |
103 | $(element).toc({
104 | indexingFormats: 'A1a'
105 | });
106 | ```
107 |
108 | If you want to set indexing formats for all levels:
109 |
110 | ```javascript
111 | $(element).toc({
112 | // can be 'number', 'upperAlphabet', 'lowerAlphabet', 'upperRoman', 'lowerRoman'
113 | indexingFormats: ''
114 | });
115 | ```
116 |
117 | ## Customize the look and feel
118 |
119 | Assume that `````` is the element containing the table of contents.
120 | By default, TocJS generates the following markup:
121 |
122 | ```html
123 |
137 | ```
138 |
139 | To customize the styles of table of contents, you can customize the ```toc```, ```toc-ul-root```, ```toc-ul```, ```toc-heading```, and ```toc-link-[1..6]``` classes.
140 | Or create your own CSS classes and set them using the TocJS options which are described in the above section.
141 |
142 | ## Build
143 |
144 | TocJS uses [grunt](http://gruntjs.com) for building process.
145 | The process includes the following steps:
146 |
147 | * Copy entire ```src/css``` and ```src/js``` directories to ```dist``` directory
148 | * Compress the CSS files in ```src/css``` and save to ```dist/css```
149 | * Compress the ```src/js/toc.js``` and save to ```dist/js/toc.min.js```
150 |
151 | Grunt helps us simplify the process.
152 |
153 | First, you have to install the dependencies defined in ```package.json``` (the following commands might need the administrator permission to run):
154 |
155 | ```
156 | $ cd
157 | $ npm install grunt --save-dev
158 | $ npm install grunt-contrib-copy --save-dev
159 | $ npm install grunt-contrib-cssmin --save-dev
160 | $ npm install grunt-contrib-uglify --save-dev
161 | ```
162 |
163 | Then, run the command below from the TocJS directory:
164 |
165 | ```
166 | $ grunt
167 | ```
168 |
169 | ## Author
170 |
171 | Nguyen Huu Phuoc, aka @nghuuphuoc
172 |
173 | * [http://github.com/nghuuphuoc](http://github.com/nghuuphuoc)
174 | * [http://twitter.com/nghuuphuoc](http://twitter.com/nghuuphuoc)
175 |
176 | ## License
177 |
178 | ```
179 | The MIT License (MIT)
180 |
181 | Copyright (c) 2013 - 2014 Nguyen Huu Phuoc
182 |
183 | Permission is hereby granted, free of charge, to any person obtaining a copy of
184 | this software and associated documentation files (the "Software"), to deal in
185 | the Software without restriction, including without limitation the rights to
186 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
187 | the Software, and to permit persons to whom the Software is furnished to do so,
188 | subject to the following conditions:
189 |
190 | The above copyright notice and this permission notice shall be included in all
191 | copies or substantial portions of the Software.
192 |
193 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
194 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
195 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
196 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
197 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
198 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
199 | ```
--------------------------------------------------------------------------------
/dist/css/toc-scroll.css:
--------------------------------------------------------------------------------
1 | /**
2 | * TocJS (https://github.com/nghuuphuoc/tocjs)
3 | *
4 | * Generate a table of contents based on headings
5 | *
6 | * @author http://twitter.com/nghuuphuoc
7 | * @copyright (c) 2013 - 2014 Nguyen Huu Phuoc
8 | * @license MIT
9 | */
10 | .toc {
11 | border: 1px solid #ddd;
12 | border-radius: 4px; }
13 | .toc.affix {
14 | position: static; }
15 | .toc .nav > .active > a, .toc .nav > .active:hover > a,
16 | .toc .nav > .active :focus > a {
17 | border-right: 2px solid #428bca; }
18 | .toc .nav .nav {
19 | /*
20 | * If you want to hide the sub UL elements, then add the following line
21 | * display: none;
22 | */
23 | display: block;
24 | margin-bottom: 8px; }
25 | .toc .nav .nav > li > a {
26 | font-size: 90%; }
27 | .toc .toc-heading {
28 | color: #333333;
29 | background-color: #f5f5f5;
30 | border-bottom: 1px solid #dddddd; }
31 | .toc .toc-link-2 {
32 | padding-left: 25px; }
33 | .toc .toc-link-3 {
34 | padding-left: 50px; }
35 | .toc .toc-link-4 {
36 | padding-left: 75px; }
37 | .toc .toc-link-5 {
38 | padding-left: 100px; }
39 | .toc .toc-link-6 {
40 | padding-left: 125px; }
41 |
42 | @media screen and (min-width: 992px) and (min-height: 700px) {
43 | .toc.affix {
44 | position: fixed; }
45 | .toc .nav > .active > ul {
46 | display: block; } }
47 | .toc .nav .nav {
48 | display: none; }
49 |
--------------------------------------------------------------------------------
/dist/css/toc-scroll.min.css:
--------------------------------------------------------------------------------
1 | /**
2 | * TocJS v1.1.2 (http://github.com/nghuuphuoc/tocjs)
3 | *
4 | * Generate a table of contents based on headings
5 | *
6 | * @author http://twitter.com/nghuuphuoc
7 | * @copyright (c) 2013 - 2014 Nguyen Huu Phuoc
8 | * @license MIT
9 | */
10 |
11 |
12 | .toc{border:1px solid #ddd;border-radius:4px}.toc.affix{position:static}.toc .nav>.active>a,.toc .nav>.active:hover>a,.toc .nav>.active :focus>a{border-right:2px solid #428bca}.toc .nav .nav{display:block;margin-bottom:8px}.toc .nav .nav>li>a{font-size:90%}.toc .toc-heading{color:#333;background-color:#f5f5f5;border-bottom:1px solid #ddd}.toc .toc-link-2{padding-left:25px}.toc .toc-link-3{padding-left:50px}.toc .toc-link-4{padding-left:75px}.toc .toc-link-5{padding-left:100px}.toc .toc-link-6{padding-left:125px}@media screen and (min-width:992px) and (min-height:700px){.toc.affix{position:fixed}.toc .nav>.active>ul{display:block}}.toc .nav .nav{display:none}
--------------------------------------------------------------------------------
/dist/css/toc-scroll.scss:
--------------------------------------------------------------------------------
1 | @import "toc";
2 |
3 | .toc {
4 | .nav .nav {
5 | display: none;
6 | }
7 | }
--------------------------------------------------------------------------------
/dist/css/toc.css:
--------------------------------------------------------------------------------
1 | /**
2 | * TocJS (https://github.com/nghuuphuoc/tocjs)
3 | *
4 | * Generate a table of contents based on headings
5 | *
6 | * @author Nguyen Huu Phuoc
7 | * @copyright (c) 2013 Nguyen Huu Phuoc
8 | * @license MIT
9 | */
10 | .toc {
11 | border: 1px solid #ddd;
12 | border-radius: 4px; }
13 | .toc.affix {
14 | position: static; }
15 | .toc .nav > .active > a, .toc .nav > .active:hover > a,
16 | .toc .nav > .active :focus > a {
17 | border-right: 2px solid #428bca; }
18 | .toc .nav .nav {
19 | /*
20 | * If you want to hide the sub UL elements, then add the following line
21 | * display: none;
22 | */
23 | display: block;
24 | margin-bottom: 8px; }
25 | .toc .nav .nav > li > a {
26 | font-size: 90%; }
27 | .toc .toc-heading {
28 | color: #333333;
29 | background-color: #f5f5f5;
30 | border-bottom: 1px solid #dddddd; }
31 | .toc .toc-link-2 {
32 | padding-left: 25px; }
33 | .toc .toc-link-3 {
34 | padding-left: 50px; }
35 | .toc .toc-link-4 {
36 | padding-left: 75px; }
37 | .toc .toc-link-5 {
38 | padding-left: 100px; }
39 | .toc .toc-link-6 {
40 | padding-left: 125px; }
41 |
42 | @media screen and (min-width: 992px) and (min-height: 700px) {
43 | .toc.affix {
44 | position: fixed; }
45 | .toc .nav > .active > ul {
46 | display: block; } }
47 |
--------------------------------------------------------------------------------
/dist/css/toc.min.css:
--------------------------------------------------------------------------------
1 | /**
2 | * TocJS v1.1.2 (http://github.com/nghuuphuoc/tocjs)
3 | *
4 | * Generate a table of contents based on headings
5 | *
6 | * @author http://twitter.com/nghuuphuoc
7 | * @copyright (c) 2013 - 2014 Nguyen Huu Phuoc
8 | * @license MIT
9 | */
10 |
11 |
12 | .toc{border:1px solid #ddd;border-radius:4px}.toc.affix{position:static}.toc .nav>.active>a,.toc .nav>.active:hover>a,.toc .nav>.active :focus>a{border-right:2px solid #428bca}.toc .nav .nav{display:block;margin-bottom:8px}.toc .nav .nav>li>a{font-size:90%}.toc .toc-heading{color:#333;background-color:#f5f5f5;border-bottom:1px solid #ddd}.toc .toc-link-2{padding-left:25px}.toc .toc-link-3{padding-left:50px}.toc .toc-link-4{padding-left:75px}.toc .toc-link-5{padding-left:100px}.toc .toc-link-6{padding-left:125px}@media screen and (min-width:992px) and (min-height:700px){.toc.affix{position:fixed}.toc .nav>.active>ul{display:block}}
--------------------------------------------------------------------------------
/dist/css/toc.scss:
--------------------------------------------------------------------------------
1 | /**
2 | * TocJS (https://github.com/nghuuphuoc/tocjs)
3 | *
4 | * Generate a table of contents based on headings
5 | *
6 | * @author http://twitter.com/nghuuphuoc
7 | * @copyright (c) 2013 - 2014 Nguyen Huu Phuoc
8 | * @license MIT
9 | */
10 |
11 | // Variable
12 | $tocPaddingLevel: 25px;
13 |
14 | // Table of content
15 | .toc {
16 | border: 1px solid #ddd;
17 | border-radius: 4px;
18 |
19 | // Used when you want the page to scroll to the table of content
20 | // For using with Bootstrap 3
21 | &.affix {
22 | position: static;
23 | }
24 |
25 | // For using with Bootstrap 3
26 | .nav > .active {
27 | > a,
28 | &:hover > a,
29 | :focus > a {
30 | border-right: 2px solid #428bca;
31 | }
32 | }
33 |
34 | // Second level
35 | .nav .nav {
36 | /*
37 | * If you want to hide the sub UL elements, then add the following line
38 | * display: none;
39 | */
40 | display: block;
41 | margin-bottom: 8px;
42 | > li > a {
43 | font-size: 90%;
44 | }
45 | }
46 |
47 | // Heading (Table of Contents)
48 | .toc-heading {
49 | color: #333333;
50 | background-color: #f5f5f5;
51 | border-bottom: 1px solid #dddddd;
52 | }
53 |
54 | // Children links
55 | .toc-link-2 {
56 | padding-left: $tocPaddingLevel;
57 | }
58 | .toc-link-3 {
59 | padding-left: $tocPaddingLevel * 2;
60 | }
61 | .toc-link-4 {
62 | padding-left: $tocPaddingLevel * 3;
63 | }
64 | .toc-link-5 {
65 | padding-left: $tocPaddingLevel * 4;
66 | }
67 | .toc-link-6 {
68 | padding-left: $tocPaddingLevel * 5;
69 | }
70 | }
71 |
72 | // Responsive
73 | @media screen and (min-width: 992px) and (min-height: 700px) {
74 | .toc {
75 | &.affix {
76 | position: fixed;
77 | }
78 | .nav > .active > ul {
79 | display: block;
80 | }
81 | }
82 | }
83 |
--------------------------------------------------------------------------------
/dist/js/toc.js:
--------------------------------------------------------------------------------
1 | /**
2 | * TocJS (https://github.com/nghuuphuoc/tocjs)
3 | *
4 | * Generate a table of contents based on headings
5 | *
6 | * @author http://twitter.com/nghuuphuoc
7 | * @copyright (c) 2013 - 2014 Nguyen Huu Phuoc
8 | * @license MIT
9 | */
10 |
11 | (function($) {
12 | var Toc = function(element, options) {
13 | this.$element = $(element);
14 | this.options = $.extend({}, Toc.DEFAULT_OPTIONS, options);
15 | this.headings = [];
16 |
17 | this.$element.addClass(this.options.elementClass);
18 |
19 | var that = this;
20 | $(this.options.selector).each(function(index, node) {
21 | $(node)
22 | .data('tagNumber', parseInt(node.tagName.substring(1))) // 1...6
23 | .data('index', 1)
24 | .data('numbering', '1');
25 | that.headings.push(node);
26 | });
27 |
28 | if (this.headings.length > 0) {
29 | this.render();
30 | }
31 | };
32 |
33 | /**
34 | * The default options
35 | */
36 | Toc.DEFAULT_OPTIONS = {
37 | selector: 'h1, h2, h3, h4, h5, h6',
38 | elementClass: 'toc',
39 | rootUlClass: 'toc-ul-root',
40 | ulClass: 'toc-ul',
41 | prefixLinkClass: 'toc-link-',
42 | heading: null,
43 |
44 | /**
45 | * Define the indexing formats for each heading level
46 | * indexingFormats: {
47 | * headingLevel: formatter
48 | * }
49 | *
50 | * headingLevel can be 'h1', 'h2', ..., 'h6'
51 | * formatter can be:
52 | * - 'number', '1': The headings will be prefixed with number (1, 2, 3, ...)
53 | * - 'upperAlphabet', 'A': Prefix headings with uppercase alphabetical characters (A, B, C, ...)
54 | * - 'lowerAlphabet', 'a': Prefix headings with lowercase alphabetical characters (a, b, c, ...)
55 | * - 'upperRoman', 'I': Prefix headings with uppercase Roman numerals (I, II, III, ...)
56 | * - 'lowerRoman', 'i': Prefix headings with lowercase Roman numerals (i, ii, iii, ...)
57 | *
58 | * You can define different formatter for each heading level:
59 | * indexingFormats: {
60 | * 'h1': 'upperAlphabet', // 'A'
61 | * 'h2': 'number', // '1'
62 | * 'h3': 'lowerAlphabet' // 'a'
63 | * }
64 | *
65 | * If you want to set indexing formats for levels:
66 | * indexingFormats: formatter
67 | *
68 | * Example:
69 | * indexingFormats: 'number' => Prefix all headings by number
70 | * indexingFormats: '1AaIi' => Prefix 1st level heading by number
71 | * Prefix 2nd level heading by uppercase character, and so forth.
72 | */
73 | indexingFormats: {}
74 | };
75 |
76 | Toc.prototype = {
77 | constructor: Toc,
78 |
79 | /**
80 | * Render table of content
81 | */
82 | render: function() {
83 | var h = {},
84 | headings = this.headings,
85 | numHeadings = this.headings.length;
86 |
87 | for (var i = 0; i < numHeadings; i++) {
88 | var currTagNumber = $(headings[i]).data('tagNumber');
89 | if (i == 0) {
90 | h[headings[0].tagName] = $(headings[0]);
91 | } else {
92 | var prevTagNumber = $(headings[i - 1]).data('tagNumber'),
93 | prevNumbering = String($(headings[i - 1]).data('numbering')).split('.');
94 |
95 | switch (true) {
96 | // Case 1:
97 | // The current heading is at the same level with previous one
98 | // h3___________ <== previous heading
99 | // h3___________ <== current heading
100 | case (currTagNumber == prevTagNumber):
101 | var index = $(headings[i - 1]).data('index') + 1;
102 | $(headings[i]).data('index', index);
103 | if (prevNumbering.length == 1) {
104 | $(headings[i]).data('numbering', parseInt(prevNumbering[0]) + 1);
105 | } else {
106 | prevNumbering.pop();
107 | prevNumbering.push(index);
108 | $(headings[i]).data('numbering', prevNumbering.join('.'));
109 | }
110 | h[headings[i].tagName] = $(headings[i]);
111 | break;
112 |
113 | // Case 2:
114 | // The current heading is child of the previous one
115 | // h3____________ <== previous heading
116 | // h4________ <== current heading
117 | case (currTagNumber > prevTagNumber):
118 | prevNumbering.push('1');
119 | $(headings[i]).data('index', 1)
120 | .data('numbering', prevNumbering.join('.'));
121 | h[headings[i].tagName] = $(headings[i]);
122 | break;
123 |
124 | // Case 3:
125 | // h2____________ <== (*) the closest heading that is at the same level with current one
126 | // ...
127 | // h4________ <== previous heading
128 | // h2____________ <== current heading
129 | case (currTagNumber < prevTagNumber):
130 | // Get the cloest heading (*)
131 | var closestHeading = h[headings[i].tagName];
132 |
133 | // Now I come back the case 1
134 | var closestNumbering = String($(closestHeading).data('numbering')).split('.'),
135 | index = $(closestHeading).data('index') + 1;
136 | $(headings[i]).data('index', index);
137 | if (closestNumbering.length == 1) {
138 | $(headings[i]).data('numbering', parseInt(closestNumbering[0]) + 1);
139 | } else {
140 | closestNumbering.pop();
141 | closestNumbering.push(index);
142 | $(headings[i]).data('numbering', closestNumbering.join('.'));
143 | }
144 |
145 | h[headings[i].tagName] = $(headings[i]);
146 | break;
147 |
148 | default:
149 | break;
150 | }
151 | }
152 | }
153 |
154 | var numberingMap = {},
155 | $toc = $('').addClass(this.options.rootUlClass)
156 | .addClass(this.options.ulClass)
157 | .appendTo(this.$element);
158 | // Add heading
159 | if (this.options.heading) {
160 | $('').addClass('toc-heading')
161 | .wrapInner($('').attr('href', '#').html(this.options.heading))
162 | .appendTo($toc);
163 | }
164 |
165 | for (var i = 0; i < numHeadings; i++) {
166 | // Generate Id
167 | var id = this.generateHeadingId(headings[i]),
168 | numbering = String($(headings[i]).data('numbering')).split('.'),
169 | $a = $('').html($(headings[i]).text())
170 | .addClass(this.options.prefixLinkClass + numbering.length)
171 | .attr('href', '#' + id);
172 |
173 | // Add anchor icon to heading
174 | $('').addClass('toc-anchor')
175 | .html('#')
176 | .attr('href', '#' + id)
177 | .hide()
178 | .appendTo(headings[i]);
179 | $(headings[i]).on('mouseover', function() {
180 | $(this).find('.toc-anchor').show();
181 | }).on('mouseout', function() {
182 | $(this).find('.toc-anchor').hide();
183 | });
184 |
185 | if (numbering.length == 1) {
186 | var $li = $('').wrapInner($a).appendTo($toc);
187 | } else {
188 | var last = numbering.pop(),
189 | n = numbering.join('.'),
190 | uls = numberingMap[n].find('ul'),
191 | $ul = uls.length > 0 ? uls.get(0) : $('').addClass(this.options.ulClass).appendTo(numberingMap[n]),
192 | $li = $('').wrapInner($a).appendTo($ul);
193 |
194 | numbering.push(last);
195 | }
196 |
197 | numberingMap[numbering.join('.')] = $li;
198 |
199 | this.prependIndexing(i, $a);
200 | }
201 | },
202 |
203 | /**
204 | * Generate heading Id
205 | *
206 | * @param {Number} heading
207 | * @return {String}
208 | */
209 | generateHeadingId: function(heading) {
210 | if (!$(heading).attr('id')) {
211 | var id = $(heading)
212 | .text()
213 | .toLowerCase()
214 | .replace(/\s+|\/|\\/g, '-')
215 | .replace(/á|à|ạ|ả|ã|ă|ắ|ằ|ặ|ẳ|ẵ|â|ấ|ầ|ậ|ẩ|ẫ|ä/g, 'a')
216 | .replace(/đ/g, 'd')
217 | .replace(/é|è|ẹ|ẻ|ẽ|ê|ế|ề|ệ|ể|ễ/g, 'e')
218 | .replace(/í|ì|ị|ỉ|ĩ/g, 'i')
219 | .replace(/ó|ò|ọ|ỏ|õ|ô|ố|ồ|ộ|ổ|ỗ|ơ|ớ|ờ|ợ|ở|ỡ/g, 'o')
220 | .replace(/ú|ù|ụ|ủ|ũ|ư|ứ|ừ|ự|ử|ữ/g, 'u')
221 | .replace(/ý|ỳ|ỵ|ỷ|ỹ/g, 'y')
222 | .replace(/[^a-z0-9-]/g, '');
223 |
224 | var found = true, counter = 0;
225 | while (found) {
226 | found = $('#' + id + (counter == 0 ? '' : '-' + counter)).length > 0;
227 | if (found) {
228 | counter++;
229 | } else {
230 | id = id + (counter == 0 ? '' : '-' + counter);
231 | }
232 | }
233 |
234 | $(heading).attr('id', id);
235 | return id;
236 | }
237 |
238 | return $(heading).attr('id');
239 | },
240 |
241 | /**
242 | * Prepend indexing string to link/heading
243 | *
244 | * @param {Number} index
245 | * @param {HTMLElement} linkElement
246 | */
247 | prependIndexing: function(index, linkElement) {
248 | var heading = this.headings[index],
249 | tagNumber = parseInt($(heading).data('tagNumber')),
250 | format = this.getIndexingFormat(tagNumber);
251 | if (null == format) {
252 | return;
253 | }
254 | var numbering = String($(heading).data('numbering')).split('.'), n = numbering.length, converted = [], j = 0;
255 | for (var i = 0; i < n; i++) {
256 | j = i + (tagNumber - n) + 1;
257 | format = this.getIndexingFormat(j);
258 | if (format) {
259 | converted.push(this.convertIndexing(numbering[i], format));
260 | }
261 | }
262 |
263 | if (converted.length > 0) {
264 | var text = converted.join('. ') + '. ';
265 | $(linkElement).prepend(text);
266 | $(heading).prepend(text);
267 | }
268 | },
269 |
270 | /**
271 | * Get the indexing format for given heading level
272 | *
273 | * @param {Number} level Can be 1, 2, ..., 6
274 | * @return {String} Can be null or one of 'number', 'lowerAlphabet', 'upperAlphabet', 'lowerRoman', 'upperRoman'
275 | */
276 | getIndexingFormat: function(level) {
277 | if ('object' == typeof this.options.indexingFormats) {
278 | return this.options.indexingFormats['h' + level] ? this.options.indexingFormats['h' + level] : null;
279 | }
280 |
281 | if ('string' == typeof this.options.indexingFormats) {
282 | if (['upperAlphabet', 'lowerAlphabet', 'number', 'upperRoman', 'lowerRoman'].indexOf(this.options.indexingFormats) != -1) {
283 | return this.options.indexingFormats;
284 | }
285 |
286 | // indexingFormats defines format for each heading level (1AaIi, 111111, for example)
287 | if (this.options.indexingFormats.length < level) {
288 | return null;
289 | }
290 | switch (this.options.indexingFormats[level - 1]) {
291 | case '1':
292 | case 1:
293 | return 'number';
294 | case 'A':
295 | return 'upperAlphabet';
296 | case 'a':
297 | return 'lowerAlphabet';
298 | case 'I':
299 | return 'upperRoman';
300 | case 'i':
301 | return 'lowerRoman';
302 | default:
303 | return null;
304 | }
305 | }
306 |
307 | return null;
308 | },
309 |
310 | /**
311 | * Format an indexing number in given type
312 | *
313 | * @param {Number} number
314 | * @param {String} type Can be one of supported formats: number, lowerAlphabet, upperAlphabet, lowerRoman, upperRoman
315 | * @returns {String}
316 | */
317 | convertIndexing: function(number, type) {
318 | var lowerChars = 'abcdefghijklmnopqrstuvwxyz', upperChars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', length = lowerChars.length;
319 | switch (type) {
320 | case 'upperAlphabet':
321 | case 'A':
322 | return (number > length) ? upperChars[number % length - 1] : upperChars[number - 1];
323 |
324 | case 'lowerAlphabet':
325 | case 'a':
326 | return (number > length) ? lowerChars[number % length - 1] : lowerChars[number - 1];
327 |
328 | case 'number':
329 | case '1':
330 | case 1:
331 | return number;
332 |
333 | case 'upperRoman':
334 | case 'I':
335 | return this.convertToRomanNumeral(number);
336 |
337 | case 'lowerRoman':
338 | case 'i':
339 | return this.convertToRomanNumeral(number).toLowerCase();
340 |
341 | default:
342 | return '_';
343 | }
344 | },
345 |
346 | /**
347 | * Convert a number to Roman numeral
348 | *
349 | * @param {Number} number
350 | * @return {String}
351 | */
352 | convertToRomanNumeral: function(number) {
353 | if (!+number) {
354 | return '';
355 | }
356 | var digits = String(+number).split(''),
357 | key = ['', 'C', 'CC', 'CCC', 'CD', 'D', 'DC', 'DCC', 'DCCC', 'CM',
358 | '', 'X', 'XX', 'XXX', 'XL', 'L', 'LX', 'LXX', 'LXXX', 'XC',
359 | '', 'I', 'II', 'III', 'IV', 'V', 'VI', 'VII', 'VIII', 'IX'],
360 | roman = '',
361 | i = 3;
362 | while (i--) {
363 | roman = (key[+digits.pop() + (i * 10)] || '') + roman;
364 | }
365 | return Array(+digits.join('') + 1).join('M') + roman;
366 | }
367 | };
368 |
369 | // Plugin definition
370 |
371 | $.fn.toc = function(options) {
372 | return this.each(function() {
373 | var $this = $(this), data = $this.data('toc');
374 | if (!data) {
375 | $this.data('toc', (data = new Toc(this, options)));
376 | }
377 | });
378 | };
379 |
380 | $.fn.toc.Constructor = Toc;
381 | }(window.jQuery));
382 |
--------------------------------------------------------------------------------
/dist/js/toc.min.js:
--------------------------------------------------------------------------------
1 | /**
2 | * TocJS v1.1.2 (http://github.com/nghuuphuoc/tocjs)
3 | *
4 | * Generate a table of contents based on headings
5 | *
6 | * @author http://twitter.com/nghuuphuoc
7 | * @copyright (c) 2013 - 2014 Nguyen Huu Phuoc
8 | * @license MIT
9 | */
10 |
11 | !function(a){var b=function(c,d){this.$element=a(c),this.options=a.extend({},b.DEFAULT_OPTIONS,d),this.headings=[],this.$element.addClass(this.options.elementClass);var e=this;a(this.options.selector).each(function(b,c){a(c).data("tagNumber",parseInt(c.tagName.substring(1))).data("index",1).data("numbering","1"),e.headings.push(c)}),this.headings.length>0&&this.render()};b.DEFAULT_OPTIONS={selector:"h1, h2, h3, h4, h5, h6",elementClass:"toc",rootUlClass:"toc-ul-root",ulClass:"toc-ul",prefixLinkClass:"toc-link-",heading:null,indexingFormats:{}},b.prototype={constructor:b,render:function(){for(var b={},c=this.headings,d=this.headings.length,e=0;d>e;e++){var f=a(c[e]).data("tagNumber");if(0==e)b[c[0].tagName]=a(c[0]);else{var g=a(c[e-1]).data("tagNumber"),h=String(a(c[e-1]).data("numbering")).split(".");switch(!0){case f==g:var i=a(c[e-1]).data("index")+1;a(c[e]).data("index",i),1==h.length?a(c[e]).data("numbering",parseInt(h[0])+1):(h.pop(),h.push(i),a(c[e]).data("numbering",h.join("."))),b[c[e].tagName]=a(c[e]);break;case f>g:h.push("1"),a(c[e]).data("index",1).data("numbering",h.join(".")),b[c[e].tagName]=a(c[e]);break;case g>f:var j=b[c[e].tagName],k=String(a(j).data("numbering")).split("."),i=a(j).data("index")+1;a(c[e]).data("index",i),1==k.length?a(c[e]).data("numbering",parseInt(k[0])+1):(k.pop(),k.push(i),a(c[e]).data("numbering",k.join("."))),b[c[e].tagName]=a(c[e])}}}var l={},m=a("").addClass(this.options.rootUlClass).addClass(this.options.ulClass).appendTo(this.$element);this.options.heading&&a("").addClass("toc-heading").wrapInner(a("").attr("href","#").html(this.options.heading)).appendTo(m);for(var e=0;d>e;e++){var n=this.generateHeadingId(c[e]),o=String(a(c[e]).data("numbering")).split("."),p=a("").html(a(c[e]).text()).addClass(this.options.prefixLinkClass+o.length).attr("href","#"+n);if(a("").addClass("toc-anchor").html("#").attr("href","#"+n).hide().appendTo(c[e]),a(c[e]).on("mouseover",function(){a(this).find(".toc-anchor").show()}).on("mouseout",function(){a(this).find(".toc-anchor").hide()}),1==o.length)var q=a("").wrapInner(p).appendTo(m);else{var r=o.pop(),s=o.join("."),t=l[s].find("ul"),u=t.length>0?t.get(0):a("").addClass(this.options.ulClass).appendTo(l[s]),q=a("").wrapInner(p).appendTo(u);o.push(r)}l[o.join(".")]=q,this.prependIndexing(e,p)}},generateHeadingId:function(b){if(!a(b).attr("id")){for(var c=a(b).text().toLowerCase().replace(/\s+|\/|\\/g,"-").replace(/á|à|ạ|ả|ã|ă|ắ|ằ|ặ|ẳ|ẵ|â|ấ|ầ|ậ|ẩ|ẫ|ä/g,"a").replace(/đ/g,"d").replace(/é|è|ẹ|ẻ|ẽ|ê|ế|ề|ệ|ể|ễ/g,"e").replace(/í|ì|ị|ỉ|ĩ/g,"i").replace(/ó|ò|ọ|ỏ|õ|ô|ố|ồ|ộ|ổ|ỗ|ơ|ớ|ờ|ợ|ở|ỡ/g,"o").replace(/ú|ù|ụ|ủ|ũ|ư|ứ|ừ|ự|ử|ữ/g,"u").replace(/ý|ỳ|ỵ|ỷ|ỹ/g,"y").replace(/[^a-z0-9-]/g,""),d=!0,e=0;d;)d=a("#"+c+(0==e?"":"-"+e)).length>0,d?e++:c+=0==e?"":"-"+e;return a(b).attr("id",c),c}return a(b).attr("id")},prependIndexing:function(b,c){var d=this.headings[b],e=parseInt(a(d).data("tagNumber")),f=this.getIndexingFormat(e);if(null!=f){for(var g=String(a(d).data("numbering")).split("."),h=g.length,i=[],j=0,k=0;h>k;k++)j=k+(e-h)+1,f=this.getIndexingFormat(j),f&&i.push(this.convertIndexing(g[k],f));if(i.length>0){var l=i.join(". ")+". ";a(c).prepend(l),a(d).prepend(l)}}},getIndexingFormat:function(a){if("object"==typeof this.options.indexingFormats)return this.options.indexingFormats["h"+a]?this.options.indexingFormats["h"+a]:null;if("string"==typeof this.options.indexingFormats){if(-1!=["upperAlphabet","lowerAlphabet","number","upperRoman","lowerRoman"].indexOf(this.options.indexingFormats))return this.options.indexingFormats;if(this.options.indexingFormats.lengthe?d[a%e-1]:d[a-1];case"lowerAlphabet":case"a":return a>e?c[a%e-1]:c[a-1];case"number":case"1":case 1:return a;case"upperRoman":case"I":return this.convertToRomanNumeral(a);case"lowerRoman":case"i":return this.convertToRomanNumeral(a).toLowerCase();default:return"_"}},convertToRomanNumeral:function(a){if(!+a)return"";for(var b=String(+a).split(""),c=["","C","CC","CCC","CD","D","DC","DCC","DCCC","CM","","X","XX","XXX","XL","L","LX","LXX","LXXX","XC","","I","II","III","IV","V","VI","VII","VIII","IX"],d="",e=3;e--;)d=(c[+b.pop()+10*e]||"")+d;return Array(+b.join("")+1).join("M")+d}},a.fn.toc=function(c){return this.each(function(){var d=a(this),e=d.data("toc");e||d.data("toc",e=new b(this,c))})},a.fn.toc.Constructor=b}(window.jQuery);
--------------------------------------------------------------------------------
/img/screenshot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nghuuphuoc/tocjs/09e1aaa07dc83c50aeb3c30bcd423aa321a9e148/img/screenshot.png
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "tocjs",
3 | "author": {
4 | "name": "Nguyen Huu Phuoc ",
5 | "url": "https://twitter.com/nghuuphuoc"
6 | },
7 | "homepage": "http://github.com/nghuuphuoc/tocjs",
8 | "devDependencies": {
9 | "grunt": "~0.4.1",
10 | "grunt-contrib-copy": "~0.4.1",
11 | "grunt-contrib-uglify": "~0.2.4",
12 | "grunt-contrib-cssmin": "~0.6.2",
13 | "grunt-contrib-watch": "~0.5.3"
14 | },
15 | "version": "1.1.2"
16 | }
17 |
--------------------------------------------------------------------------------
/src/css/toc-scroll.css:
--------------------------------------------------------------------------------
1 | /**
2 | * TocJS (https://github.com/nghuuphuoc/tocjs)
3 | *
4 | * Generate a table of contents based on headings
5 | *
6 | * @author http://twitter.com/nghuuphuoc
7 | * @copyright (c) 2013 - 2014 Nguyen Huu Phuoc
8 | * @license MIT
9 | */
10 | .toc {
11 | border: 1px solid #ddd;
12 | border-radius: 4px; }
13 | .toc.affix {
14 | position: static; }
15 | .toc .nav > .active > a, .toc .nav > .active:hover > a,
16 | .toc .nav > .active :focus > a {
17 | border-right: 2px solid #428bca; }
18 | .toc .nav .nav {
19 | /*
20 | * If you want to hide the sub UL elements, then add the following line
21 | * display: none;
22 | */
23 | display: block;
24 | margin-bottom: 8px; }
25 | .toc .nav .nav > li > a {
26 | font-size: 90%; }
27 | .toc .toc-heading {
28 | color: #333333;
29 | background-color: #f5f5f5;
30 | border-bottom: 1px solid #dddddd; }
31 | .toc .toc-link-2 {
32 | padding-left: 25px; }
33 | .toc .toc-link-3 {
34 | padding-left: 50px; }
35 | .toc .toc-link-4 {
36 | padding-left: 75px; }
37 | .toc .toc-link-5 {
38 | padding-left: 100px; }
39 | .toc .toc-link-6 {
40 | padding-left: 125px; }
41 |
42 | @media screen and (min-width: 992px) and (min-height: 700px) {
43 | .toc.affix {
44 | position: fixed; }
45 | .toc .nav > .active > ul {
46 | display: block; } }
47 | .toc .nav .nav {
48 | display: none; }
49 |
--------------------------------------------------------------------------------
/src/css/toc-scroll.scss:
--------------------------------------------------------------------------------
1 | @import "toc";
2 |
3 | .toc {
4 | .nav .nav {
5 | display: none;
6 | }
7 | }
--------------------------------------------------------------------------------
/src/css/toc.css:
--------------------------------------------------------------------------------
1 | /**
2 | * TocJS (https://github.com/nghuuphuoc/tocjs)
3 | *
4 | * Generate a table of contents based on headings
5 | *
6 | * @author Nguyen Huu Phuoc
7 | * @copyright (c) 2013 Nguyen Huu Phuoc
8 | * @license MIT
9 | */
10 | .toc {
11 | border: 1px solid #ddd;
12 | border-radius: 4px; }
13 | .toc.affix {
14 | position: static; }
15 | .toc .nav > .active > a, .toc .nav > .active:hover > a,
16 | .toc .nav > .active :focus > a {
17 | border-right: 2px solid #428bca; }
18 | .toc .nav .nav {
19 | /*
20 | * If you want to hide the sub UL elements, then add the following line
21 | * display: none;
22 | */
23 | display: block;
24 | margin-bottom: 8px; }
25 | .toc .nav .nav > li > a {
26 | font-size: 90%; }
27 | .toc .toc-heading {
28 | color: #333333;
29 | background-color: #f5f5f5;
30 | border-bottom: 1px solid #dddddd; }
31 | .toc .toc-link-2 {
32 | padding-left: 25px; }
33 | .toc .toc-link-3 {
34 | padding-left: 50px; }
35 | .toc .toc-link-4 {
36 | padding-left: 75px; }
37 | .toc .toc-link-5 {
38 | padding-left: 100px; }
39 | .toc .toc-link-6 {
40 | padding-left: 125px; }
41 |
42 | @media screen and (min-width: 992px) and (min-height: 700px) {
43 | .toc.affix {
44 | position: fixed; }
45 | .toc .nav > .active > ul {
46 | display: block; } }
47 |
--------------------------------------------------------------------------------
/src/css/toc.scss:
--------------------------------------------------------------------------------
1 | /**
2 | * TocJS (https://github.com/nghuuphuoc/tocjs)
3 | *
4 | * Generate a table of contents based on headings
5 | *
6 | * @author http://twitter.com/nghuuphuoc
7 | * @copyright (c) 2013 - 2014 Nguyen Huu Phuoc
8 | * @license MIT
9 | */
10 |
11 | // Variable
12 | $tocPaddingLevel: 25px;
13 |
14 | // Table of content
15 | .toc {
16 | border: 1px solid #ddd;
17 | border-radius: 4px;
18 |
19 | // Used when you want the page to scroll to the table of content
20 | // For using with Bootstrap 3
21 | &.affix {
22 | position: static;
23 | }
24 |
25 | // For using with Bootstrap 3
26 | .nav > .active {
27 | > a,
28 | &:hover > a,
29 | :focus > a {
30 | border-right: 2px solid #428bca;
31 | }
32 | }
33 |
34 | // Second level
35 | .nav .nav {
36 | /*
37 | * If you want to hide the sub UL elements, then add the following line
38 | * display: none;
39 | */
40 | display: block;
41 | margin-bottom: 8px;
42 | > li > a {
43 | font-size: 90%;
44 | }
45 | }
46 |
47 | // Heading (Table of Contents)
48 | .toc-heading {
49 | color: #333333;
50 | background-color: #f5f5f5;
51 | border-bottom: 1px solid #dddddd;
52 | }
53 |
54 | // Children links
55 | .toc-link-2 {
56 | padding-left: $tocPaddingLevel;
57 | }
58 | .toc-link-3 {
59 | padding-left: $tocPaddingLevel * 2;
60 | }
61 | .toc-link-4 {
62 | padding-left: $tocPaddingLevel * 3;
63 | }
64 | .toc-link-5 {
65 | padding-left: $tocPaddingLevel * 4;
66 | }
67 | .toc-link-6 {
68 | padding-left: $tocPaddingLevel * 5;
69 | }
70 | }
71 |
72 | // Responsive
73 | @media screen and (min-width: 992px) and (min-height: 700px) {
74 | .toc {
75 | &.affix {
76 | position: fixed;
77 | }
78 | .nav > .active > ul {
79 | display: block;
80 | }
81 | }
82 | }
83 |
--------------------------------------------------------------------------------
/src/js/toc.js:
--------------------------------------------------------------------------------
1 | /**
2 | * TocJS (https://github.com/nghuuphuoc/tocjs)
3 | *
4 | * Generate a table of contents based on headings
5 | *
6 | * @author http://twitter.com/nghuuphuoc
7 | * @copyright (c) 2013 - 2014 Nguyen Huu Phuoc
8 | * @license MIT
9 | */
10 |
11 | (function($) {
12 | var Toc = function(element, options) {
13 | this.$element = $(element);
14 | this.options = $.extend({}, Toc.DEFAULT_OPTIONS, options);
15 | this.headings = [];
16 |
17 | this.$element.addClass(this.options.elementClass);
18 |
19 | var that = this;
20 | $(this.options.selector).each(function(index, node) {
21 | $(node)
22 | .data('tagNumber', parseInt(node.tagName.substring(1))) // 1...6
23 | .data('index', 1)
24 | .data('numbering', '1');
25 | that.headings.push(node);
26 | });
27 |
28 | if (this.headings.length > 0) {
29 | this.render();
30 | }
31 | };
32 |
33 | /**
34 | * The default options
35 | */
36 | Toc.DEFAULT_OPTIONS = {
37 | selector: 'h1, h2, h3, h4, h5, h6',
38 | elementClass: 'toc',
39 | rootUlClass: 'toc-ul-root',
40 | ulClass: 'toc-ul',
41 | prefixLinkClass: 'toc-link-',
42 | heading: null,
43 |
44 | /**
45 | * Define the indexing formats for each heading level
46 | * indexingFormats: {
47 | * headingLevel: formatter
48 | * }
49 | *
50 | * headingLevel can be 'h1', 'h2', ..., 'h6'
51 | * formatter can be:
52 | * - 'number', '1': The headings will be prefixed with number (1, 2, 3, ...)
53 | * - 'upperAlphabet', 'A': Prefix headings with uppercase alphabetical characters (A, B, C, ...)
54 | * - 'lowerAlphabet', 'a': Prefix headings with lowercase alphabetical characters (a, b, c, ...)
55 | * - 'upperRoman', 'I': Prefix headings with uppercase Roman numerals (I, II, III, ...)
56 | * - 'lowerRoman', 'i': Prefix headings with lowercase Roman numerals (i, ii, iii, ...)
57 | *
58 | * You can define different formatter for each heading level:
59 | * indexingFormats: {
60 | * 'h1': 'upperAlphabet', // 'A'
61 | * 'h2': 'number', // '1'
62 | * 'h3': 'lowerAlphabet' // 'a'
63 | * }
64 | *
65 | * If you want to set indexing formats for levels:
66 | * indexingFormats: formatter
67 | *
68 | * Example:
69 | * indexingFormats: 'number' => Prefix all headings by number
70 | * indexingFormats: '1AaIi' => Prefix 1st level heading by number
71 | * Prefix 2nd level heading by uppercase character, and so forth.
72 | */
73 | indexingFormats: {}
74 | };
75 |
76 | Toc.prototype = {
77 | constructor: Toc,
78 |
79 | /**
80 | * Render table of content
81 | */
82 | render: function() {
83 | var h = {},
84 | headings = this.headings,
85 | numHeadings = this.headings.length;
86 |
87 | for (var i = 0; i < numHeadings; i++) {
88 | var currTagNumber = $(headings[i]).data('tagNumber');
89 | if (i == 0) {
90 | h[headings[0].tagName] = $(headings[0]);
91 | } else {
92 | var prevTagNumber = $(headings[i - 1]).data('tagNumber'),
93 | prevNumbering = String($(headings[i - 1]).data('numbering')).split('.');
94 |
95 | switch (true) {
96 | // Case 1:
97 | // The current heading is at the same level with previous one
98 | // h3___________ <== previous heading
99 | // h3___________ <== current heading
100 | case (currTagNumber == prevTagNumber):
101 | var index = $(headings[i - 1]).data('index') + 1;
102 | $(headings[i]).data('index', index);
103 | if (prevNumbering.length == 1) {
104 | $(headings[i]).data('numbering', parseInt(prevNumbering[0]) + 1);
105 | } else {
106 | prevNumbering.pop();
107 | prevNumbering.push(index);
108 | $(headings[i]).data('numbering', prevNumbering.join('.'));
109 | }
110 | h[headings[i].tagName] = $(headings[i]);
111 | break;
112 |
113 | // Case 2:
114 | // The current heading is child of the previous one
115 | // h3____________ <== previous heading
116 | // h4________ <== current heading
117 | case (currTagNumber > prevTagNumber):
118 | prevNumbering.push('1');
119 | $(headings[i]).data('index', 1)
120 | .data('numbering', prevNumbering.join('.'));
121 | h[headings[i].tagName] = $(headings[i]);
122 | break;
123 |
124 | // Case 3:
125 | // h2____________ <== (*) the closest heading that is at the same level with current one
126 | // ...
127 | // h4________ <== previous heading
128 | // h2____________ <== current heading
129 | case (currTagNumber < prevTagNumber):
130 | // Get the cloest heading (*)
131 | var closestHeading = h[headings[i].tagName];
132 |
133 | // Now I come back the case 1
134 | var closestNumbering = String($(closestHeading).data('numbering')).split('.'),
135 | index = $(closestHeading).data('index') + 1;
136 | $(headings[i]).data('index', index);
137 | if (closestNumbering.length == 1) {
138 | $(headings[i]).data('numbering', parseInt(closestNumbering[0]) + 1);
139 | } else {
140 | closestNumbering.pop();
141 | closestNumbering.push(index);
142 | $(headings[i]).data('numbering', closestNumbering.join('.'));
143 | }
144 |
145 | h[headings[i].tagName] = $(headings[i]);
146 | break;
147 |
148 | default:
149 | break;
150 | }
151 | }
152 | }
153 |
154 | var numberingMap = {},
155 | $toc = $('').addClass(this.options.rootUlClass)
156 | .addClass(this.options.ulClass)
157 | .appendTo(this.$element);
158 | // Add heading
159 | if (this.options.heading) {
160 | $('').addClass('toc-heading')
161 | .wrapInner($('').attr('href', '#').html(this.options.heading))
162 | .appendTo($toc);
163 | }
164 |
165 | for (var i = 0; i < numHeadings; i++) {
166 | // Generate Id
167 | var id = this.generateHeadingId(headings[i]),
168 | numbering = String($(headings[i]).data('numbering')).split('.'),
169 | $a = $('').html($(headings[i]).text())
170 | .addClass(this.options.prefixLinkClass + numbering.length)
171 | .attr('href', '#' + id);
172 |
173 | // Add anchor icon to heading
174 | $('').addClass('toc-anchor')
175 | .html('#')
176 | .attr('href', '#' + id)
177 | .hide()
178 | .appendTo(headings[i]);
179 | $(headings[i]).on('mouseover', function() {
180 | $(this).find('.toc-anchor').show();
181 | }).on('mouseout', function() {
182 | $(this).find('.toc-anchor').hide();
183 | });
184 |
185 | if (numbering.length == 1) {
186 | var $li = $('').wrapInner($a).appendTo($toc);
187 | } else {
188 | var last = numbering.pop(),
189 | n = numbering.join('.'),
190 | uls = numberingMap[n].find('ul'),
191 | $ul = uls.length > 0 ? uls.get(0) : $('').addClass(this.options.ulClass).appendTo(numberingMap[n]),
192 | $li = $('').wrapInner($a).appendTo($ul);
193 |
194 | numbering.push(last);
195 | }
196 |
197 | numberingMap[numbering.join('.')] = $li;
198 |
199 | this.prependIndexing(i, $a);
200 | }
201 | },
202 |
203 | /**
204 | * Generate heading Id
205 | *
206 | * @param {Number} heading
207 | * @return {String}
208 | */
209 | generateHeadingId: function(heading) {
210 | if (!$(heading).attr('id')) {
211 | var id = $(heading)
212 | .text()
213 | .toLowerCase()
214 | .replace(/\s+|\/|\\/g, '-')
215 | .replace(/á|à|ạ|ả|ã|ă|ắ|ằ|ặ|ẳ|ẵ|â|ấ|ầ|ậ|ẩ|ẫ|ä/g, 'a')
216 | .replace(/đ/g, 'd')
217 | .replace(/é|è|ẹ|ẻ|ẽ|ê|ế|ề|ệ|ể|ễ/g, 'e')
218 | .replace(/í|ì|ị|ỉ|ĩ/g, 'i')
219 | .replace(/ó|ò|ọ|ỏ|õ|ô|ố|ồ|ộ|ổ|ỗ|ơ|ớ|ờ|ợ|ở|ỡ/g, 'o')
220 | .replace(/ú|ù|ụ|ủ|ũ|ư|ứ|ừ|ự|ử|ữ/g, 'u')
221 | .replace(/ý|ỳ|ỵ|ỷ|ỹ/g, 'y')
222 | .replace(/[^a-z0-9-]/g, '');
223 |
224 | var found = true, counter = 0;
225 | while (found) {
226 | found = $('#' + id + (counter == 0 ? '' : '-' + counter)).length > 0;
227 | if (found) {
228 | counter++;
229 | } else {
230 | id = id + (counter == 0 ? '' : '-' + counter);
231 | }
232 | }
233 |
234 | $(heading).attr('id', id);
235 | return id;
236 | }
237 |
238 | return $(heading).attr('id');
239 | },
240 |
241 | /**
242 | * Prepend indexing string to link/heading
243 | *
244 | * @param {Number} index
245 | * @param {HTMLElement} linkElement
246 | */
247 | prependIndexing: function(index, linkElement) {
248 | var heading = this.headings[index],
249 | tagNumber = parseInt($(heading).data('tagNumber')),
250 | format = this.getIndexingFormat(tagNumber);
251 | if (null == format) {
252 | return;
253 | }
254 | var numbering = String($(heading).data('numbering')).split('.'), n = numbering.length, converted = [], j = 0;
255 | for (var i = 0; i < n; i++) {
256 | j = i + (tagNumber - n) + 1;
257 | format = this.getIndexingFormat(j);
258 | if (format) {
259 | converted.push(this.convertIndexing(numbering[i], format));
260 | }
261 | }
262 |
263 | if (converted.length > 0) {
264 | var text = converted.join('. ') + '. ';
265 | $(linkElement).prepend(text);
266 | $(heading).prepend(text);
267 | }
268 | },
269 |
270 | /**
271 | * Get the indexing format for given heading level
272 | *
273 | * @param {Number} level Can be 1, 2, ..., 6
274 | * @return {String} Can be null or one of 'number', 'lowerAlphabet', 'upperAlphabet', 'lowerRoman', 'upperRoman'
275 | */
276 | getIndexingFormat: function(level) {
277 | if ('object' == typeof this.options.indexingFormats) {
278 | return this.options.indexingFormats['h' + level] ? this.options.indexingFormats['h' + level] : null;
279 | }
280 |
281 | if ('string' == typeof this.options.indexingFormats) {
282 | if (['upperAlphabet', 'lowerAlphabet', 'number', 'upperRoman', 'lowerRoman'].indexOf(this.options.indexingFormats) != -1) {
283 | return this.options.indexingFormats;
284 | }
285 |
286 | // indexingFormats defines format for each heading level (1AaIi, 111111, for example)
287 | if (this.options.indexingFormats.length < level) {
288 | return null;
289 | }
290 | switch (this.options.indexingFormats[level - 1]) {
291 | case '1':
292 | case 1:
293 | return 'number';
294 | case 'A':
295 | return 'upperAlphabet';
296 | case 'a':
297 | return 'lowerAlphabet';
298 | case 'I':
299 | return 'upperRoman';
300 | case 'i':
301 | return 'lowerRoman';
302 | default:
303 | return null;
304 | }
305 | }
306 |
307 | return null;
308 | },
309 |
310 | /**
311 | * Format an indexing number in given type
312 | *
313 | * @param {Number} number
314 | * @param {String} type Can be one of supported formats: number, lowerAlphabet, upperAlphabet, lowerRoman, upperRoman
315 | * @returns {String}
316 | */
317 | convertIndexing: function(number, type) {
318 | var lowerChars = 'abcdefghijklmnopqrstuvwxyz', upperChars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', length = lowerChars.length;
319 | switch (type) {
320 | case 'upperAlphabet':
321 | case 'A':
322 | return (number > length) ? upperChars[number % length - 1] : upperChars[number - 1];
323 |
324 | case 'lowerAlphabet':
325 | case 'a':
326 | return (number > length) ? lowerChars[number % length - 1] : lowerChars[number - 1];
327 |
328 | case 'number':
329 | case '1':
330 | case 1:
331 | return number;
332 |
333 | case 'upperRoman':
334 | case 'I':
335 | return this.convertToRomanNumeral(number);
336 |
337 | case 'lowerRoman':
338 | case 'i':
339 | return this.convertToRomanNumeral(number).toLowerCase();
340 |
341 | default:
342 | return '_';
343 | }
344 | },
345 |
346 | /**
347 | * Convert a number to Roman numeral
348 | *
349 | * @param {Number} number
350 | * @return {String}
351 | */
352 | convertToRomanNumeral: function(number) {
353 | if (!+number) {
354 | return '';
355 | }
356 | var digits = String(+number).split(''),
357 | key = ['', 'C', 'CC', 'CCC', 'CD', 'D', 'DC', 'DCC', 'DCCC', 'CM',
358 | '', 'X', 'XX', 'XXX', 'XL', 'L', 'LX', 'LXX', 'LXXX', 'XC',
359 | '', 'I', 'II', 'III', 'IV', 'V', 'VI', 'VII', 'VIII', 'IX'],
360 | roman = '',
361 | i = 3;
362 | while (i--) {
363 | roman = (key[+digits.pop() + (i * 10)] || '') + roman;
364 | }
365 | return Array(+digits.join('') + 1).join('M') + roman;
366 | }
367 | };
368 |
369 | // Plugin definition
370 |
371 | $.fn.toc = function(options) {
372 | return this.each(function() {
373 | var $this = $(this), data = $this.data('toc');
374 | if (!data) {
375 | $this.data('toc', (data = new Toc(this, options)));
376 | }
377 | });
378 | };
379 |
380 | $.fn.toc.Constructor = Toc;
381 | }(window.jQuery));
382 |
--------------------------------------------------------------------------------
/vendor/bootstrap/css/bootstrap-theme.css:
--------------------------------------------------------------------------------
1 | .btn-default,
2 | .btn-primary,
3 | .btn-success,
4 | .btn-info,
5 | .btn-warning,
6 | .btn-danger {
7 | text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.2);
8 | -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 1px 1px rgba(0, 0, 0, 0.075);
9 | box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 1px 1px rgba(0, 0, 0, 0.075);
10 | }
11 |
12 | .btn-default:active,
13 | .btn-primary:active,
14 | .btn-success:active,
15 | .btn-info:active,
16 | .btn-warning:active,
17 | .btn-danger:active,
18 | .btn-default.active,
19 | .btn-primary.active,
20 | .btn-success.active,
21 | .btn-info.active,
22 | .btn-warning.active,
23 | .btn-danger.active {
24 | -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
25 | box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
26 | }
27 |
28 | .btn:active,
29 | .btn.active {
30 | background-image: none;
31 | }
32 |
33 | .btn-default {
34 | text-shadow: 0 1px 0 #fff;
35 | background-image: -webkit-gradient(linear, left 0%, left 100%, from(#ffffff), to(#e6e6e6));
36 | background-image: -webkit-linear-gradient(top, #ffffff, 0%, #e6e6e6, 100%);
37 | background-image: -moz-linear-gradient(top, #ffffff 0%, #e6e6e6 100%);
38 | background-image: linear-gradient(to bottom, #ffffff 0%, #e6e6e6 100%);
39 | background-repeat: repeat-x;
40 | border-color: #e0e0e0;
41 | border-color: #ccc;
42 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffe6e6e6', GradientType=0);
43 | }
44 |
45 | .btn-default:active,
46 | .btn-default.active {
47 | background-color: #e6e6e6;
48 | border-color: #e0e0e0;
49 | }
50 |
51 | .btn-primary {
52 | background-image: -webkit-gradient(linear, left 0%, left 100%, from(#428bca), to(#3071a9));
53 | background-image: -webkit-linear-gradient(top, #428bca, 0%, #3071a9, 100%);
54 | background-image: -moz-linear-gradient(top, #428bca 0%, #3071a9 100%);
55 | background-image: linear-gradient(to bottom, #428bca 0%, #3071a9 100%);
56 | background-repeat: repeat-x;
57 | border-color: #2d6ca2;
58 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff3071a9', GradientType=0);
59 | }
60 |
61 | .btn-primary:active,
62 | .btn-primary.active {
63 | background-color: #3071a9;
64 | border-color: #2d6ca2;
65 | }
66 |
67 | .btn-success {
68 | background-image: -webkit-gradient(linear, left 0%, left 100%, from(#5cb85c), to(#449d44));
69 | background-image: -webkit-linear-gradient(top, #5cb85c, 0%, #449d44, 100%);
70 | background-image: -moz-linear-gradient(top, #5cb85c 0%, #449d44 100%);
71 | background-image: linear-gradient(to bottom, #5cb85c 0%, #449d44 100%);
72 | background-repeat: repeat-x;
73 | border-color: #419641;
74 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5cb85c', endColorstr='#ff449d44', GradientType=0);
75 | }
76 |
77 | .btn-success:active,
78 | .btn-success.active {
79 | background-color: #449d44;
80 | border-color: #419641;
81 | }
82 |
83 | .btn-warning {
84 | background-image: -webkit-gradient(linear, left 0%, left 100%, from(#f0ad4e), to(#ec971f));
85 | background-image: -webkit-linear-gradient(top, #f0ad4e, 0%, #ec971f, 100%);
86 | background-image: -moz-linear-gradient(top, #f0ad4e 0%, #ec971f 100%);
87 | background-image: linear-gradient(to bottom, #f0ad4e 0%, #ec971f 100%);
88 | background-repeat: repeat-x;
89 | border-color: #eb9316;
90 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff0ad4e', endColorstr='#ffec971f', GradientType=0);
91 | }
92 |
93 | .btn-warning:active,
94 | .btn-warning.active {
95 | background-color: #ec971f;
96 | border-color: #eb9316;
97 | }
98 |
99 | .btn-danger {
100 | background-image: -webkit-gradient(linear, left 0%, left 100%, from(#d9534f), to(#c9302c));
101 | background-image: -webkit-linear-gradient(top, #d9534f, 0%, #c9302c, 100%);
102 | background-image: -moz-linear-gradient(top, #d9534f 0%, #c9302c 100%);
103 | background-image: linear-gradient(to bottom, #d9534f 0%, #c9302c 100%);
104 | background-repeat: repeat-x;
105 | border-color: #c12e2a;
106 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9534f', endColorstr='#ffc9302c', GradientType=0);
107 | }
108 |
109 | .btn-danger:active,
110 | .btn-danger.active {
111 | background-color: #c9302c;
112 | border-color: #c12e2a;
113 | }
114 |
115 | .btn-info {
116 | background-image: -webkit-gradient(linear, left 0%, left 100%, from(#5bc0de), to(#31b0d5));
117 | background-image: -webkit-linear-gradient(top, #5bc0de, 0%, #31b0d5, 100%);
118 | background-image: -moz-linear-gradient(top, #5bc0de 0%, #31b0d5 100%);
119 | background-image: linear-gradient(to bottom, #5bc0de 0%, #31b0d5 100%);
120 | background-repeat: repeat-x;
121 | border-color: #2aabd2;
122 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff31b0d5', GradientType=0);
123 | }
124 |
125 | .btn-info:active,
126 | .btn-info.active {
127 | background-color: #31b0d5;
128 | border-color: #2aabd2;
129 | }
130 |
131 | .thumbnail,
132 | .img-thumbnail {
133 | -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.075);
134 | box-shadow: 0 1px 2px rgba(0, 0, 0, 0.075);
135 | }
136 |
137 | .dropdown-menu > li > a:hover,
138 | .dropdown-menu > li > a:focus,
139 | .dropdown-menu > .active > a,
140 | .dropdown-menu > .active > a:hover,
141 | .dropdown-menu > .active > a:focus {
142 | background-color: #357ebd;
143 | background-image: -webkit-gradient(linear, left 0%, left 100%, from(#428bca), to(#357ebd));
144 | background-image: -webkit-linear-gradient(top, #428bca, 0%, #357ebd, 100%);
145 | background-image: -moz-linear-gradient(top, #428bca 0%, #357ebd 100%);
146 | background-image: linear-gradient(to bottom, #428bca 0%, #357ebd 100%);
147 | background-repeat: repeat-x;
148 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff357ebd', GradientType=0);
149 | }
150 |
151 | .navbar {
152 | background-image: -webkit-gradient(linear, left 0%, left 100%, from(#ffffff), to(#f8f8f8));
153 | background-image: -webkit-linear-gradient(top, #ffffff, 0%, #f8f8f8, 100%);
154 | background-image: -moz-linear-gradient(top, #ffffff 0%, #f8f8f8 100%);
155 | background-image: linear-gradient(to bottom, #ffffff 0%, #f8f8f8 100%);
156 | background-repeat: repeat-x;
157 | border-radius: 4px;
158 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#fff8f8f8', GradientType=0);
159 | -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 1px 5px rgba(0, 0, 0, 0.075);
160 | box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 1px 5px rgba(0, 0, 0, 0.075);
161 | }
162 |
163 | .navbar .navbar-nav > .active > a {
164 | background-color: #f8f8f8;
165 | }
166 |
167 | .navbar-brand,
168 | .navbar-nav > li > a {
169 | text-shadow: 0 1px 0 rgba(255, 255, 255, 0.25);
170 | }
171 |
172 | .navbar-inverse {
173 | background-image: -webkit-gradient(linear, left 0%, left 100%, from(#3c3c3c), to(#222222));
174 | background-image: -webkit-linear-gradient(top, #3c3c3c, 0%, #222222, 100%);
175 | background-image: -moz-linear-gradient(top, #3c3c3c 0%, #222222 100%);
176 | background-image: linear-gradient(to bottom, #3c3c3c 0%, #222222 100%);
177 | background-repeat: repeat-x;
178 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff3c3c3c', endColorstr='#ff222222', GradientType=0);
179 | }
180 |
181 | .navbar-inverse .navbar-nav > .active > a {
182 | background-color: #222222;
183 | }
184 |
185 | .navbar-inverse .navbar-brand,
186 | .navbar-inverse .navbar-nav > li > a {
187 | text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
188 | }
189 |
190 | .navbar-static-top,
191 | .navbar-fixed-top,
192 | .navbar-fixed-bottom {
193 | border-radius: 0;
194 | }
195 |
196 | .alert {
197 | text-shadow: 0 1px 0 rgba(255, 255, 255, 0.2);
198 | -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 1px 2px rgba(0, 0, 0, 0.05);
199 | box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 1px 2px rgba(0, 0, 0, 0.05);
200 | }
201 |
202 | .alert-success {
203 | background-image: -webkit-gradient(linear, left 0%, left 100%, from(#dff0d8), to(#c8e5bc));
204 | background-image: -webkit-linear-gradient(top, #dff0d8, 0%, #c8e5bc, 100%);
205 | background-image: -moz-linear-gradient(top, #dff0d8 0%, #c8e5bc 100%);
206 | background-image: linear-gradient(to bottom, #dff0d8 0%, #c8e5bc 100%);
207 | background-repeat: repeat-x;
208 | border-color: #b2dba1;
209 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdff0d8', endColorstr='#ffc8e5bc', GradientType=0);
210 | }
211 |
212 | .alert-info {
213 | background-image: -webkit-gradient(linear, left 0%, left 100%, from(#d9edf7), to(#b9def0));
214 | background-image: -webkit-linear-gradient(top, #d9edf7, 0%, #b9def0, 100%);
215 | background-image: -moz-linear-gradient(top, #d9edf7 0%, #b9def0 100%);
216 | background-image: linear-gradient(to bottom, #d9edf7 0%, #b9def0 100%);
217 | background-repeat: repeat-x;
218 | border-color: #9acfea;
219 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9edf7', endColorstr='#ffb9def0', GradientType=0);
220 | }
221 |
222 | .alert-warning {
223 | background-image: -webkit-gradient(linear, left 0%, left 100%, from(#fcf8e3), to(#f8efc0));
224 | background-image: -webkit-linear-gradient(top, #fcf8e3, 0%, #f8efc0, 100%);
225 | background-image: -moz-linear-gradient(top, #fcf8e3 0%, #f8efc0 100%);
226 | background-image: linear-gradient(to bottom, #fcf8e3 0%, #f8efc0 100%);
227 | background-repeat: repeat-x;
228 | border-color: #f5e79e;
229 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffcf8e3', endColorstr='#fff8efc0', GradientType=0);
230 | }
231 |
232 | .alert-danger {
233 | background-image: -webkit-gradient(linear, left 0%, left 100%, from(#f2dede), to(#e7c3c3));
234 | background-image: -webkit-linear-gradient(top, #f2dede, 0%, #e7c3c3, 100%);
235 | background-image: -moz-linear-gradient(top, #f2dede 0%, #e7c3c3 100%);
236 | background-image: linear-gradient(to bottom, #f2dede 0%, #e7c3c3 100%);
237 | background-repeat: repeat-x;
238 | border-color: #dca7a7;
239 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2dede', endColorstr='#ffe7c3c3', GradientType=0);
240 | }
241 |
242 | .progress {
243 | background-image: -webkit-gradient(linear, left 0%, left 100%, from(#ebebeb), to(#f5f5f5));
244 | background-image: -webkit-linear-gradient(top, #ebebeb, 0%, #f5f5f5, 100%);
245 | background-image: -moz-linear-gradient(top, #ebebeb 0%, #f5f5f5 100%);
246 | background-image: linear-gradient(to bottom, #ebebeb 0%, #f5f5f5 100%);
247 | background-repeat: repeat-x;
248 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffebebeb', endColorstr='#fff5f5f5', GradientType=0);
249 | }
250 |
251 | .progress-bar {
252 | background-image: -webkit-gradient(linear, left 0%, left 100%, from(#428bca), to(#3071a9));
253 | background-image: -webkit-linear-gradient(top, #428bca, 0%, #3071a9, 100%);
254 | background-image: -moz-linear-gradient(top, #428bca 0%, #3071a9 100%);
255 | background-image: linear-gradient(to bottom, #428bca 0%, #3071a9 100%);
256 | background-repeat: repeat-x;
257 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff3071a9', GradientType=0);
258 | }
259 |
260 | .progress-bar-success {
261 | background-image: -webkit-gradient(linear, left 0%, left 100%, from(#5cb85c), to(#449d44));
262 | background-image: -webkit-linear-gradient(top, #5cb85c, 0%, #449d44, 100%);
263 | background-image: -moz-linear-gradient(top, #5cb85c 0%, #449d44 100%);
264 | background-image: linear-gradient(to bottom, #5cb85c 0%, #449d44 100%);
265 | background-repeat: repeat-x;
266 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5cb85c', endColorstr='#ff449d44', GradientType=0);
267 | }
268 |
269 | .progress-bar-info {
270 | background-image: -webkit-gradient(linear, left 0%, left 100%, from(#5bc0de), to(#31b0d5));
271 | background-image: -webkit-linear-gradient(top, #5bc0de, 0%, #31b0d5, 100%);
272 | background-image: -moz-linear-gradient(top, #5bc0de 0%, #31b0d5 100%);
273 | background-image: linear-gradient(to bottom, #5bc0de 0%, #31b0d5 100%);
274 | background-repeat: repeat-x;
275 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff31b0d5', GradientType=0);
276 | }
277 |
278 | .progress-bar-warning {
279 | background-image: -webkit-gradient(linear, left 0%, left 100%, from(#f0ad4e), to(#ec971f));
280 | background-image: -webkit-linear-gradient(top, #f0ad4e, 0%, #ec971f, 100%);
281 | background-image: -moz-linear-gradient(top, #f0ad4e 0%, #ec971f 100%);
282 | background-image: linear-gradient(to bottom, #f0ad4e 0%, #ec971f 100%);
283 | background-repeat: repeat-x;
284 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff0ad4e', endColorstr='#ffec971f', GradientType=0);
285 | }
286 |
287 | .progress-bar-danger {
288 | background-image: -webkit-gradient(linear, left 0%, left 100%, from(#d9534f), to(#c9302c));
289 | background-image: -webkit-linear-gradient(top, #d9534f, 0%, #c9302c, 100%);
290 | background-image: -moz-linear-gradient(top, #d9534f 0%, #c9302c 100%);
291 | background-image: linear-gradient(to bottom, #d9534f 0%, #c9302c 100%);
292 | background-repeat: repeat-x;
293 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9534f', endColorstr='#ffc9302c', GradientType=0);
294 | }
295 |
296 | .list-group {
297 | border-radius: 4px;
298 | -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.075);
299 | box-shadow: 0 1px 2px rgba(0, 0, 0, 0.075);
300 | }
301 |
302 | .list-group-item.active,
303 | .list-group-item.active:hover,
304 | .list-group-item.active:focus {
305 | text-shadow: 0 -1px 0 #3071a9;
306 | background-image: -webkit-gradient(linear, left 0%, left 100%, from(#428bca), to(#3278b3));
307 | background-image: -webkit-linear-gradient(top, #428bca, 0%, #3278b3, 100%);
308 | background-image: -moz-linear-gradient(top, #428bca 0%, #3278b3 100%);
309 | background-image: linear-gradient(to bottom, #428bca 0%, #3278b3 100%);
310 | background-repeat: repeat-x;
311 | border-color: #3278b3;
312 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff3278b3', GradientType=0);
313 | }
314 |
315 | .panel {
316 | -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
317 | box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
318 | }
319 |
320 | .panel-default > .panel-heading {
321 | background-image: -webkit-gradient(linear, left 0%, left 100%, from(#f5f5f5), to(#e8e8e8));
322 | background-image: -webkit-linear-gradient(top, #f5f5f5, 0%, #e8e8e8, 100%);
323 | background-image: -moz-linear-gradient(top, #f5f5f5 0%, #e8e8e8 100%);
324 | background-image: linear-gradient(to bottom, #f5f5f5 0%, #e8e8e8 100%);
325 | background-repeat: repeat-x;
326 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#ffe8e8e8', GradientType=0);
327 | }
328 |
329 | .panel-primary > .panel-heading {
330 | background-image: -webkit-gradient(linear, left 0%, left 100%, from(#428bca), to(#357ebd));
331 | background-image: -webkit-linear-gradient(top, #428bca, 0%, #357ebd, 100%);
332 | background-image: -moz-linear-gradient(top, #428bca 0%, #357ebd 100%);
333 | background-image: linear-gradient(to bottom, #428bca 0%, #357ebd 100%);
334 | background-repeat: repeat-x;
335 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff357ebd', GradientType=0);
336 | }
337 |
338 | .panel-success > .panel-heading {
339 | background-image: -webkit-gradient(linear, left 0%, left 100%, from(#dff0d8), to(#d0e9c6));
340 | background-image: -webkit-linear-gradient(top, #dff0d8, 0%, #d0e9c6, 100%);
341 | background-image: -moz-linear-gradient(top, #dff0d8 0%, #d0e9c6 100%);
342 | background-image: linear-gradient(to bottom, #dff0d8 0%, #d0e9c6 100%);
343 | background-repeat: repeat-x;
344 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdff0d8', endColorstr='#ffd0e9c6', GradientType=0);
345 | }
346 |
347 | .panel-info > .panel-heading {
348 | background-image: -webkit-gradient(linear, left 0%, left 100%, from(#d9edf7), to(#c4e3f3));
349 | background-image: -webkit-linear-gradient(top, #d9edf7, 0%, #c4e3f3, 100%);
350 | background-image: -moz-linear-gradient(top, #d9edf7 0%, #c4e3f3 100%);
351 | background-image: linear-gradient(to bottom, #d9edf7 0%, #c4e3f3 100%);
352 | background-repeat: repeat-x;
353 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9edf7', endColorstr='#ffc4e3f3', GradientType=0);
354 | }
355 |
356 | .panel-warning > .panel-heading {
357 | background-image: -webkit-gradient(linear, left 0%, left 100%, from(#fcf8e3), to(#faf2cc));
358 | background-image: -webkit-linear-gradient(top, #fcf8e3, 0%, #faf2cc, 100%);
359 | background-image: -moz-linear-gradient(top, #fcf8e3 0%, #faf2cc 100%);
360 | background-image: linear-gradient(to bottom, #fcf8e3 0%, #faf2cc 100%);
361 | background-repeat: repeat-x;
362 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffcf8e3', endColorstr='#fffaf2cc', GradientType=0);
363 | }
364 |
365 | .panel-danger > .panel-heading {
366 | background-image: -webkit-gradient(linear, left 0%, left 100%, from(#f2dede), to(#ebcccc));
367 | background-image: -webkit-linear-gradient(top, #f2dede, 0%, #ebcccc, 100%);
368 | background-image: -moz-linear-gradient(top, #f2dede 0%, #ebcccc 100%);
369 | background-image: linear-gradient(to bottom, #f2dede 0%, #ebcccc 100%);
370 | background-repeat: repeat-x;
371 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2dede', endColorstr='#ffebcccc', GradientType=0);
372 | }
373 |
374 | .well {
375 | background-image: -webkit-gradient(linear, left 0%, left 100%, from(#e8e8e8), to(#f5f5f5));
376 | background-image: -webkit-linear-gradient(top, #e8e8e8, 0%, #f5f5f5, 100%);
377 | background-image: -moz-linear-gradient(top, #e8e8e8 0%, #f5f5f5 100%);
378 | background-image: linear-gradient(to bottom, #e8e8e8 0%, #f5f5f5 100%);
379 | background-repeat: repeat-x;
380 | border-color: #dcdcdc;
381 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe8e8e8', endColorstr='#fff5f5f5', GradientType=0);
382 | -webkit-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 0 rgba(255, 255, 255, 0.1);
383 | box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 0 rgba(255, 255, 255, 0.1);
384 | }
--------------------------------------------------------------------------------
/vendor/bootstrap/css/bootstrap-theme.min.css:
--------------------------------------------------------------------------------
1 | .btn-default,.btn-primary,.btn-success,.btn-info,.btn-warning,.btn-danger{text-shadow:0 -1px 0 rgba(0,0,0,0.2);-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.15),0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 0 rgba(255,255,255,0.15),0 1px 1px rgba(0,0,0,0.075)}.btn-default:active,.btn-primary:active,.btn-success:active,.btn-info:active,.btn-warning:active,.btn-danger:active,.btn-default.active,.btn-primary.active,.btn-success.active,.btn-info.active,.btn-warning.active,.btn-danger.active{-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,0.125);box-shadow:inset 0 3px 5px rgba(0,0,0,0.125)}.btn:active,.btn.active{background-image:none}.btn-default{text-shadow:0 1px 0 #fff;background-image:-webkit-gradient(linear,left 0,left 100%,from(#fff),to(#e6e6e6));background-image:-webkit-linear-gradient(top,#fff,0%,#e6e6e6,100%);background-image:-moz-linear-gradient(top,#fff 0,#e6e6e6 100%);background-image:linear-gradient(to bottom,#fff 0,#e6e6e6 100%);background-repeat:repeat-x;border-color:#e0e0e0;border-color:#ccc;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff',endColorstr='#ffe6e6e6',GradientType=0)}.btn-default:active,.btn-default.active{background-color:#e6e6e6;border-color:#e0e0e0}.btn-primary{background-image:-webkit-gradient(linear,left 0,left 100%,from(#428bca),to(#3071a9));background-image:-webkit-linear-gradient(top,#428bca,0%,#3071a9,100%);background-image:-moz-linear-gradient(top,#428bca 0,#3071a9 100%);background-image:linear-gradient(to bottom,#428bca 0,#3071a9 100%);background-repeat:repeat-x;border-color:#2d6ca2;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca',endColorstr='#ff3071a9',GradientType=0)}.btn-primary:active,.btn-primary.active{background-color:#3071a9;border-color:#2d6ca2}.btn-success{background-image:-webkit-gradient(linear,left 0,left 100%,from(#5cb85c),to(#449d44));background-image:-webkit-linear-gradient(top,#5cb85c,0%,#449d44,100%);background-image:-moz-linear-gradient(top,#5cb85c 0,#449d44 100%);background-image:linear-gradient(to bottom,#5cb85c 0,#449d44 100%);background-repeat:repeat-x;border-color:#419641;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5cb85c',endColorstr='#ff449d44',GradientType=0)}.btn-success:active,.btn-success.active{background-color:#449d44;border-color:#419641}.btn-warning{background-image:-webkit-gradient(linear,left 0,left 100%,from(#f0ad4e),to(#ec971f));background-image:-webkit-linear-gradient(top,#f0ad4e,0%,#ec971f,100%);background-image:-moz-linear-gradient(top,#f0ad4e 0,#ec971f 100%);background-image:linear-gradient(to bottom,#f0ad4e 0,#ec971f 100%);background-repeat:repeat-x;border-color:#eb9316;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff0ad4e',endColorstr='#ffec971f',GradientType=0)}.btn-warning:active,.btn-warning.active{background-color:#ec971f;border-color:#eb9316}.btn-danger{background-image:-webkit-gradient(linear,left 0,left 100%,from(#d9534f),to(#c9302c));background-image:-webkit-linear-gradient(top,#d9534f,0%,#c9302c,100%);background-image:-moz-linear-gradient(top,#d9534f 0,#c9302c 100%);background-image:linear-gradient(to bottom,#d9534f 0,#c9302c 100%);background-repeat:repeat-x;border-color:#c12e2a;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9534f',endColorstr='#ffc9302c',GradientType=0)}.btn-danger:active,.btn-danger.active{background-color:#c9302c;border-color:#c12e2a}.btn-info{background-image:-webkit-gradient(linear,left 0,left 100%,from(#5bc0de),to(#31b0d5));background-image:-webkit-linear-gradient(top,#5bc0de,0%,#31b0d5,100%);background-image:-moz-linear-gradient(top,#5bc0de 0,#31b0d5 100%);background-image:linear-gradient(to bottom,#5bc0de 0,#31b0d5 100%);background-repeat:repeat-x;border-color:#2aabd2;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de',endColorstr='#ff31b0d5',GradientType=0)}.btn-info:active,.btn-info.active{background-color:#31b0d5;border-color:#2aabd2}.thumbnail,.img-thumbnail{-webkit-box-shadow:0 1px 2px rgba(0,0,0,0.075);box-shadow:0 1px 2px rgba(0,0,0,0.075)}.dropdown-menu>li>a:hover,.dropdown-menu>li>a:focus,.dropdown-menu>.active>a,.dropdown-menu>.active>a:hover,.dropdown-menu>.active>a:focus{background-color:#357ebd;background-image:-webkit-gradient(linear,left 0,left 100%,from(#428bca),to(#357ebd));background-image:-webkit-linear-gradient(top,#428bca,0%,#357ebd,100%);background-image:-moz-linear-gradient(top,#428bca 0,#357ebd 100%);background-image:linear-gradient(to bottom,#428bca 0,#357ebd 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca',endColorstr='#ff357ebd',GradientType=0)}.navbar{background-image:-webkit-gradient(linear,left 0,left 100%,from(#fff),to(#f8f8f8));background-image:-webkit-linear-gradient(top,#fff,0%,#f8f8f8,100%);background-image:-moz-linear-gradient(top,#fff 0,#f8f8f8 100%);background-image:linear-gradient(to bottom,#fff 0,#f8f8f8 100%);background-repeat:repeat-x;border-radius:4px;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff',endColorstr='#fff8f8f8',GradientType=0);-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.15),0 1px 5px rgba(0,0,0,0.075);box-shadow:inset 0 1px 0 rgba(255,255,255,0.15),0 1px 5px rgba(0,0,0,0.075)}.navbar .navbar-nav>.active>a{background-color:#f8f8f8}.navbar-brand,.navbar-nav>li>a{text-shadow:0 1px 0 rgba(255,255,255,0.25)}.navbar-inverse{background-image:-webkit-gradient(linear,left 0,left 100%,from(#3c3c3c),to(#222));background-image:-webkit-linear-gradient(top,#3c3c3c,0%,#222,100%);background-image:-moz-linear-gradient(top,#3c3c3c 0,#222 100%);background-image:linear-gradient(to bottom,#3c3c3c 0,#222 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff3c3c3c',endColorstr='#ff222222',GradientType=0)}.navbar-inverse .navbar-nav>.active>a{background-color:#222}.navbar-inverse .navbar-brand,.navbar-inverse .navbar-nav>li>a{text-shadow:0 -1px 0 rgba(0,0,0,0.25)}.navbar-static-top,.navbar-fixed-top,.navbar-fixed-bottom{border-radius:0}.alert{text-shadow:0 1px 0 rgba(255,255,255,0.2);-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.25),0 1px 2px rgba(0,0,0,0.05);box-shadow:inset 0 1px 0 rgba(255,255,255,0.25),0 1px 2px rgba(0,0,0,0.05)}.alert-success{background-image:-webkit-gradient(linear,left 0,left 100%,from(#dff0d8),to(#c8e5bc));background-image:-webkit-linear-gradient(top,#dff0d8,0%,#c8e5bc,100%);background-image:-moz-linear-gradient(top,#dff0d8 0,#c8e5bc 100%);background-image:linear-gradient(to bottom,#dff0d8 0,#c8e5bc 100%);background-repeat:repeat-x;border-color:#b2dba1;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdff0d8',endColorstr='#ffc8e5bc',GradientType=0)}.alert-info{background-image:-webkit-gradient(linear,left 0,left 100%,from(#d9edf7),to(#b9def0));background-image:-webkit-linear-gradient(top,#d9edf7,0%,#b9def0,100%);background-image:-moz-linear-gradient(top,#d9edf7 0,#b9def0 100%);background-image:linear-gradient(to bottom,#d9edf7 0,#b9def0 100%);background-repeat:repeat-x;border-color:#9acfea;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9edf7',endColorstr='#ffb9def0',GradientType=0)}.alert-warning{background-image:-webkit-gradient(linear,left 0,left 100%,from(#fcf8e3),to(#f8efc0));background-image:-webkit-linear-gradient(top,#fcf8e3,0%,#f8efc0,100%);background-image:-moz-linear-gradient(top,#fcf8e3 0,#f8efc0 100%);background-image:linear-gradient(to bottom,#fcf8e3 0,#f8efc0 100%);background-repeat:repeat-x;border-color:#f5e79e;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffcf8e3',endColorstr='#fff8efc0',GradientType=0)}.alert-danger{background-image:-webkit-gradient(linear,left 0,left 100%,from(#f2dede),to(#e7c3c3));background-image:-webkit-linear-gradient(top,#f2dede,0%,#e7c3c3,100%);background-image:-moz-linear-gradient(top,#f2dede 0,#e7c3c3 100%);background-image:linear-gradient(to bottom,#f2dede 0,#e7c3c3 100%);background-repeat:repeat-x;border-color:#dca7a7;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2dede',endColorstr='#ffe7c3c3',GradientType=0)}.progress{background-image:-webkit-gradient(linear,left 0,left 100%,from(#ebebeb),to(#f5f5f5));background-image:-webkit-linear-gradient(top,#ebebeb,0%,#f5f5f5,100%);background-image:-moz-linear-gradient(top,#ebebeb 0,#f5f5f5 100%);background-image:linear-gradient(to bottom,#ebebeb 0,#f5f5f5 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffebebeb',endColorstr='#fff5f5f5',GradientType=0)}.progress-bar{background-image:-webkit-gradient(linear,left 0,left 100%,from(#428bca),to(#3071a9));background-image:-webkit-linear-gradient(top,#428bca,0%,#3071a9,100%);background-image:-moz-linear-gradient(top,#428bca 0,#3071a9 100%);background-image:linear-gradient(to bottom,#428bca 0,#3071a9 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca',endColorstr='#ff3071a9',GradientType=0)}.progress-bar-success{background-image:-webkit-gradient(linear,left 0,left 100%,from(#5cb85c),to(#449d44));background-image:-webkit-linear-gradient(top,#5cb85c,0%,#449d44,100%);background-image:-moz-linear-gradient(top,#5cb85c 0,#449d44 100%);background-image:linear-gradient(to bottom,#5cb85c 0,#449d44 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5cb85c',endColorstr='#ff449d44',GradientType=0)}.progress-bar-info{background-image:-webkit-gradient(linear,left 0,left 100%,from(#5bc0de),to(#31b0d5));background-image:-webkit-linear-gradient(top,#5bc0de,0%,#31b0d5,100%);background-image:-moz-linear-gradient(top,#5bc0de 0,#31b0d5 100%);background-image:linear-gradient(to bottom,#5bc0de 0,#31b0d5 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de',endColorstr='#ff31b0d5',GradientType=0)}.progress-bar-warning{background-image:-webkit-gradient(linear,left 0,left 100%,from(#f0ad4e),to(#ec971f));background-image:-webkit-linear-gradient(top,#f0ad4e,0%,#ec971f,100%);background-image:-moz-linear-gradient(top,#f0ad4e 0,#ec971f 100%);background-image:linear-gradient(to bottom,#f0ad4e 0,#ec971f 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff0ad4e',endColorstr='#ffec971f',GradientType=0)}.progress-bar-danger{background-image:-webkit-gradient(linear,left 0,left 100%,from(#d9534f),to(#c9302c));background-image:-webkit-linear-gradient(top,#d9534f,0%,#c9302c,100%);background-image:-moz-linear-gradient(top,#d9534f 0,#c9302c 100%);background-image:linear-gradient(to bottom,#d9534f 0,#c9302c 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9534f',endColorstr='#ffc9302c',GradientType=0)}.list-group{border-radius:4px;-webkit-box-shadow:0 1px 2px rgba(0,0,0,0.075);box-shadow:0 1px 2px rgba(0,0,0,0.075)}.list-group-item.active,.list-group-item.active:hover,.list-group-item.active:focus{text-shadow:0 -1px 0 #3071a9;background-image:-webkit-gradient(linear,left 0,left 100%,from(#428bca),to(#3278b3));background-image:-webkit-linear-gradient(top,#428bca,0%,#3278b3,100%);background-image:-moz-linear-gradient(top,#428bca 0,#3278b3 100%);background-image:linear-gradient(to bottom,#428bca 0,#3278b3 100%);background-repeat:repeat-x;border-color:#3278b3;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca',endColorstr='#ff3278b3',GradientType=0)}.panel{-webkit-box-shadow:0 1px 2px rgba(0,0,0,0.05);box-shadow:0 1px 2px rgba(0,0,0,0.05)}.panel-default>.panel-heading{background-image:-webkit-gradient(linear,left 0,left 100%,from(#f5f5f5),to(#e8e8e8));background-image:-webkit-linear-gradient(top,#f5f5f5,0%,#e8e8e8,100%);background-image:-moz-linear-gradient(top,#f5f5f5 0,#e8e8e8 100%);background-image:linear-gradient(to bottom,#f5f5f5 0,#e8e8e8 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5',endColorstr='#ffe8e8e8',GradientType=0)}.panel-primary>.panel-heading{background-image:-webkit-gradient(linear,left 0,left 100%,from(#428bca),to(#357ebd));background-image:-webkit-linear-gradient(top,#428bca,0%,#357ebd,100%);background-image:-moz-linear-gradient(top,#428bca 0,#357ebd 100%);background-image:linear-gradient(to bottom,#428bca 0,#357ebd 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca',endColorstr='#ff357ebd',GradientType=0)}.panel-success>.panel-heading{background-image:-webkit-gradient(linear,left 0,left 100%,from(#dff0d8),to(#d0e9c6));background-image:-webkit-linear-gradient(top,#dff0d8,0%,#d0e9c6,100%);background-image:-moz-linear-gradient(top,#dff0d8 0,#d0e9c6 100%);background-image:linear-gradient(to bottom,#dff0d8 0,#d0e9c6 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdff0d8',endColorstr='#ffd0e9c6',GradientType=0)}.panel-info>.panel-heading{background-image:-webkit-gradient(linear,left 0,left 100%,from(#d9edf7),to(#c4e3f3));background-image:-webkit-linear-gradient(top,#d9edf7,0%,#c4e3f3,100%);background-image:-moz-linear-gradient(top,#d9edf7 0,#c4e3f3 100%);background-image:linear-gradient(to bottom,#d9edf7 0,#c4e3f3 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9edf7',endColorstr='#ffc4e3f3',GradientType=0)}.panel-warning>.panel-heading{background-image:-webkit-gradient(linear,left 0,left 100%,from(#fcf8e3),to(#faf2cc));background-image:-webkit-linear-gradient(top,#fcf8e3,0%,#faf2cc,100%);background-image:-moz-linear-gradient(top,#fcf8e3 0,#faf2cc 100%);background-image:linear-gradient(to bottom,#fcf8e3 0,#faf2cc 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffcf8e3',endColorstr='#fffaf2cc',GradientType=0)}.panel-danger>.panel-heading{background-image:-webkit-gradient(linear,left 0,left 100%,from(#f2dede),to(#ebcccc));background-image:-webkit-linear-gradient(top,#f2dede,0%,#ebcccc,100%);background-image:-moz-linear-gradient(top,#f2dede 0,#ebcccc 100%);background-image:linear-gradient(to bottom,#f2dede 0,#ebcccc 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2dede',endColorstr='#ffebcccc',GradientType=0)}.well{background-image:-webkit-gradient(linear,left 0,left 100%,from(#e8e8e8),to(#f5f5f5));background-image:-webkit-linear-gradient(top,#e8e8e8,0%,#f5f5f5,100%);background-image:-moz-linear-gradient(top,#e8e8e8 0,#f5f5f5 100%);background-image:linear-gradient(to bottom,#e8e8e8 0,#f5f5f5 100%);background-repeat:repeat-x;border-color:#dcdcdc;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe8e8e8',endColorstr='#fff5f5f5',GradientType=0);-webkit-box-shadow:inset 0 1px 3px rgba(0,0,0,0.05),0 1px 0 rgba(255,255,255,0.1);box-shadow:inset 0 1px 3px rgba(0,0,0,0.05),0 1px 0 rgba(255,255,255,0.1)}
--------------------------------------------------------------------------------
/vendor/bootstrap/fonts/glyphicons-halflings-regular.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nghuuphuoc/tocjs/09e1aaa07dc83c50aeb3c30bcd423aa321a9e148/vendor/bootstrap/fonts/glyphicons-halflings-regular.eot
--------------------------------------------------------------------------------
/vendor/bootstrap/fonts/glyphicons-halflings-regular.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/vendor/bootstrap/fonts/glyphicons-halflings-regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nghuuphuoc/tocjs/09e1aaa07dc83c50aeb3c30bcd423aa321a9e148/vendor/bootstrap/fonts/glyphicons-halflings-regular.ttf
--------------------------------------------------------------------------------
/vendor/bootstrap/fonts/glyphicons-halflings-regular.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nghuuphuoc/tocjs/09e1aaa07dc83c50aeb3c30bcd423aa321a9e148/vendor/bootstrap/fonts/glyphicons-halflings-regular.woff
--------------------------------------------------------------------------------
/vendor/bootstrap/js/bootstrap.min.js:
--------------------------------------------------------------------------------
1 | /**
2 | * bootstrap.js v3.0.0 by @fat and @mdo
3 | * Copyright 2013 Twitter Inc.
4 | * http://www.apache.org/licenses/LICENSE-2.0
5 | */
6 | if(!jQuery)throw new Error("Bootstrap requires jQuery");+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]}}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one(a.support.transition.end,function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b()})}(window.jQuery),+function(a){"use strict";var b='[data-dismiss="alert"]',c=function(c){a(c).on("click",b,this.close)};c.prototype.close=function(b){function c(){f.trigger("closed.bs.alert").remove()}var d=a(this),e=d.attr("data-target");e||(e=d.attr("href"),e=e&&e.replace(/.*(?=#[^\s]*$)/,""));var f=a(e);b&&b.preventDefault(),f.length||(f=d.hasClass("alert")?d:d.parent()),f.trigger(b=a.Event("close.bs.alert")),b.isDefaultPrevented()||(f.removeClass("in"),a.support.transition&&f.hasClass("fade")?f.one(a.support.transition.end,c).emulateTransitionEnd(150):c())};var d=a.fn.alert;a.fn.alert=function(b){return this.each(function(){var d=a(this),e=d.data("bs.alert");e||d.data("bs.alert",e=new c(this)),"string"==typeof b&&e[b].call(d)})},a.fn.alert.Constructor=c,a.fn.alert.noConflict=function(){return a.fn.alert=d,this},a(document).on("click.bs.alert.data-api",b,c.prototype.close)}(window.jQuery),+function(a){"use strict";var b=function(c,d){this.$element=a(c),this.options=a.extend({},b.DEFAULTS,d)};b.DEFAULTS={loadingText:"loading..."},b.prototype.setState=function(a){var b="disabled",c=this.$element,d=c.is("input")?"val":"html",e=c.data();a+="Text",e.resetText||c.data("resetText",c[d]()),c[d](e[a]||this.options[a]),setTimeout(function(){"loadingText"==a?c.addClass(b).attr(b,b):c.removeClass(b).removeAttr(b)},0)},b.prototype.toggle=function(){var a=this.$element.closest('[data-toggle="buttons"]');if(a.length){var b=this.$element.find("input").prop("checked",!this.$element.hasClass("active")).trigger("change");"radio"===b.prop("type")&&a.find(".active").removeClass("active")}this.$element.toggleClass("active")};var c=a.fn.button;a.fn.button=function(c){return this.each(function(){var d=a(this),e=d.data("bs.button"),f="object"==typeof c&&c;e||d.data("bs.button",e=new b(this,f)),"toggle"==c?e.toggle():c&&e.setState(c)})},a.fn.button.Constructor=b,a.fn.button.noConflict=function(){return a.fn.button=c,this},a(document).on("click.bs.button.data-api","[data-toggle^=button]",function(b){var c=a(b.target);c.hasClass("btn")||(c=c.closest(".btn")),c.button("toggle"),b.preventDefault()})}(window.jQuery),+function(a){"use strict";var b=function(b,c){this.$element=a(b),this.$indicators=this.$element.find(".carousel-indicators"),this.options=c,this.paused=this.sliding=this.interval=this.$active=this.$items=null,"hover"==this.options.pause&&this.$element.on("mouseenter",a.proxy(this.pause,this)).on("mouseleave",a.proxy(this.cycle,this))};b.DEFAULTS={interval:5e3,pause:"hover",wrap:!0},b.prototype.cycle=function(b){return b||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},b.prototype.getActiveIndex=function(){return this.$active=this.$element.find(".item.active"),this.$items=this.$active.parent().children(),this.$items.index(this.$active)},b.prototype.to=function(b){var c=this,d=this.getActiveIndex();return b>this.$items.length-1||0>b?void 0:this.sliding?this.$element.one("slid",function(){c.to(b)}):d==b?this.pause().cycle():this.slide(b>d?"next":"prev",a(this.$items[b]))},b.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition.end&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},b.prototype.next=function(){return this.sliding?void 0:this.slide("next")},b.prototype.prev=function(){return this.sliding?void 0:this.slide("prev")},b.prototype.slide=function(b,c){var d=this.$element.find(".item.active"),e=c||d[b](),f=this.interval,g="next"==b?"left":"right",h="next"==b?"first":"last",i=this;if(!e.length){if(!this.options.wrap)return;e=this.$element.find(".item")[h]()}this.sliding=!0,f&&this.pause();var j=a.Event("slide.bs.carousel",{relatedTarget:e[0],direction:g});if(!e.hasClass("active")){if(this.$indicators.length&&(this.$indicators.find(".active").removeClass("active"),this.$element.one("slid",function(){var b=a(i.$indicators.children()[i.getActiveIndex()]);b&&b.addClass("active")})),a.support.transition&&this.$element.hasClass("slide")){if(this.$element.trigger(j),j.isDefaultPrevented())return;e.addClass(b),e[0].offsetWidth,d.addClass(g),e.addClass(g),d.one(a.support.transition.end,function(){e.removeClass([b,g].join(" ")).addClass("active"),d.removeClass(["active",g].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger("slid")},0)}).emulateTransitionEnd(600)}else{if(this.$element.trigger(j),j.isDefaultPrevented())return;d.removeClass("active"),e.addClass("active"),this.sliding=!1,this.$element.trigger("slid")}return f&&this.cycle(),this}};var c=a.fn.carousel;a.fn.carousel=function(c){return this.each(function(){var d=a(this),e=d.data("bs.carousel"),f=a.extend({},b.DEFAULTS,d.data(),"object"==typeof c&&c),g="string"==typeof c?c:f.slide;e||d.data("bs.carousel",e=new b(this,f)),"number"==typeof c?e.to(c):g?e[g]():f.interval&&e.pause().cycle()})},a.fn.carousel.Constructor=b,a.fn.carousel.noConflict=function(){return a.fn.carousel=c,this},a(document).on("click.bs.carousel.data-api","[data-slide], [data-slide-to]",function(b){var c,d=a(this),e=a(d.attr("data-target")||(c=d.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,"")),f=a.extend({},e.data(),d.data()),g=d.attr("data-slide-to");g&&(f.interval=!1),e.carousel(f),(g=d.attr("data-slide-to"))&&e.data("bs.carousel").to(g),b.preventDefault()}),a(window).on("load",function(){a('[data-ride="carousel"]').each(function(){var b=a(this);b.carousel(b.data())})})}(window.jQuery),+function(a){"use strict";var b=function(c,d){this.$element=a(c),this.options=a.extend({},b.DEFAULTS,d),this.transitioning=null,this.options.parent&&(this.$parent=a(this.options.parent)),this.options.toggle&&this.toggle()};b.DEFAULTS={toggle:!0},b.prototype.dimension=function(){var a=this.$element.hasClass("width");return a?"width":"height"},b.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var b=a.Event("show.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.$parent&&this.$parent.find("> .panel > .in");if(c&&c.length){var d=c.data("bs.collapse");if(d&&d.transitioning)return;c.collapse("hide"),d||c.data("bs.collapse",null)}var e=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[e](0),this.transitioning=1;var f=function(){this.$element.removeClass("collapsing").addClass("in")[e]("auto"),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return f.call(this);var g=a.camelCase(["scroll",e].join("-"));this.$element.one(a.support.transition.end,a.proxy(f,this)).emulateTransitionEnd(350)[e](this.$element[0][g])}}},b.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var b=a.Event("hide.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.dimension();this.$element[c](this.$element[c]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse").removeClass("in"),this.transitioning=1;var d=function(){this.transitioning=0,this.$element.trigger("hidden.bs.collapse").removeClass("collapsing").addClass("collapse")};return a.support.transition?(this.$element[c](0).one(a.support.transition.end,a.proxy(d,this)).emulateTransitionEnd(350),void 0):d.call(this)}}},b.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()};var c=a.fn.collapse;a.fn.collapse=function(c){return this.each(function(){var d=a(this),e=d.data("bs.collapse"),f=a.extend({},b.DEFAULTS,d.data(),"object"==typeof c&&c);e||d.data("bs.collapse",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.collapse.Constructor=b,a.fn.collapse.noConflict=function(){return a.fn.collapse=c,this},a(document).on("click.bs.collapse.data-api","[data-toggle=collapse]",function(b){var c,d=a(this),e=d.attr("data-target")||b.preventDefault()||(c=d.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,""),f=a(e),g=f.data("bs.collapse"),h=g?"toggle":d.data(),i=d.attr("data-parent"),j=i&&a(i);g&&g.transitioning||(j&&j.find('[data-toggle=collapse][data-parent="'+i+'"]').not(d).addClass("collapsed"),d[f.hasClass("in")?"addClass":"removeClass"]("collapsed")),f.collapse(h)})}(window.jQuery),+function(a){"use strict";function b(){a(d).remove(),a(e).each(function(b){var d=c(a(this));d.hasClass("open")&&(d.trigger(b=a.Event("hide.bs.dropdown")),b.isDefaultPrevented()||d.removeClass("open").trigger("hidden.bs.dropdown"))})}function c(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}var d=".dropdown-backdrop",e="[data-toggle=dropdown]",f=function(b){a(b).on("click.bs.dropdown",this.toggle)};f.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=c(e),g=f.hasClass("open");if(b(),!g){if("ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a('').insertAfter(a(this)).on("click",b),f.trigger(d=a.Event("show.bs.dropdown")),d.isDefaultPrevented())return;f.toggleClass("open").trigger("shown.bs.dropdown"),e.focus()}return!1}},f.prototype.keydown=function(b){if(/(38|40|27)/.test(b.keyCode)){var d=a(this);if(b.preventDefault(),b.stopPropagation(),!d.is(".disabled, :disabled")){var f=c(d),g=f.hasClass("open");if(!g||g&&27==b.keyCode)return 27==b.which&&f.find(e).focus(),d.click();var h=a("[role=menu] li:not(.divider):visible a",f);if(h.length){var i=h.index(h.filter(":focus"));38==b.keyCode&&i>0&&i--,40==b.keyCode&&i').appendTo(document.body),this.$element.on("click.dismiss.modal",a.proxy(function(a){a.target===a.currentTarget&&("static"==this.options.backdrop?this.$element[0].focus.call(this.$element[0]):this.hide.call(this))},this)),d&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),!b)return;d?this.$backdrop.one(a.support.transition.end,b).emulateTransitionEnd(150):b()}else!this.isShown&&this.$backdrop?(this.$backdrop.removeClass("in"),a.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one(a.support.transition.end,b).emulateTransitionEnd(150):b()):b&&b()};var c=a.fn.modal;a.fn.modal=function(c,d){return this.each(function(){var e=a(this),f=e.data("bs.modal"),g=a.extend({},b.DEFAULTS,e.data(),"object"==typeof c&&c);f||e.data("bs.modal",f=new b(this,g)),"string"==typeof c?f[c](d):g.show&&f.show(d)})},a.fn.modal.Constructor=b,a.fn.modal.noConflict=function(){return a.fn.modal=c,this},a(document).on("click.bs.modal.data-api",'[data-toggle="modal"]',function(b){var c=a(this),d=c.attr("href"),e=a(c.attr("data-target")||d&&d.replace(/.*(?=#[^\s]+$)/,"")),f=e.data("modal")?"toggle":a.extend({remote:!/#/.test(d)&&d},e.data(),c.data());b.preventDefault(),e.modal(f,this).one("hide",function(){c.is(":visible")&&c.focus()})}),a(document).on("show.bs.modal",".modal",function(){a(document.body).addClass("modal-open")}).on("hidden.bs.modal",".modal",function(){a(document.body).removeClass("modal-open")})}(window.jQuery),+function(a){"use strict";var b=function(a,b){this.type=this.options=this.enabled=this.timeout=this.hoverState=this.$element=null,this.init("tooltip",a,b)};b.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'',trigger:"hover focus",title:"",delay:0,html:!1,container:!1},b.prototype.init=function(b,c,d){this.enabled=!0,this.type=b,this.$element=a(c),this.options=this.getOptions(d);for(var e=this.options.trigger.split(" "),f=e.length;f--;){var g=e[f];if("click"==g)this.$element.on("click."+this.type,this.options.selector,a.proxy(this.toggle,this));else if("manual"!=g){var h="hover"==g?"mouseenter":"focus",i="hover"==g?"mouseleave":"blur";this.$element.on(h+"."+this.type,this.options.selector,a.proxy(this.enter,this)),this.$element.on(i+"."+this.type,this.options.selector,a.proxy(this.leave,this))}}this.options.selector?this._options=a.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},b.prototype.getDefaults=function(){return b.DEFAULTS},b.prototype.getOptions=function(b){return b=a.extend({},this.getDefaults(),this.$element.data(),b),b.delay&&"number"==typeof b.delay&&(b.delay={show:b.delay,hide:b.delay}),b},b.prototype.getDelegateOptions=function(){var b={},c=this.getDefaults();return this._options&&a.each(this._options,function(a,d){c[a]!=d&&(b[a]=d)}),b},b.prototype.enter=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget)[this.type](this.getDelegateOptions()).data("bs."+this.type);return clearTimeout(c.timeout),c.hoverState="in",c.options.delay&&c.options.delay.show?(c.timeout=setTimeout(function(){"in"==c.hoverState&&c.show()},c.options.delay.show),void 0):c.show()},b.prototype.leave=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget)[this.type](this.getDelegateOptions()).data("bs."+this.type);return clearTimeout(c.timeout),c.hoverState="out",c.options.delay&&c.options.delay.hide?(c.timeout=setTimeout(function(){"out"==c.hoverState&&c.hide()},c.options.delay.hide),void 0):c.hide()},b.prototype.show=function(){var b=a.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){if(this.$element.trigger(b),b.isDefaultPrevented())return;var c=this.tip();this.setContent(),this.options.animation&&c.addClass("fade");var d="function"==typeof this.options.placement?this.options.placement.call(this,c[0],this.$element[0]):this.options.placement,e=/\s?auto?\s?/i,f=e.test(d);f&&(d=d.replace(e,"")||"top"),c.detach().css({top:0,left:0,display:"block"}).addClass(d),this.options.container?c.appendTo(this.options.container):c.insertAfter(this.$element);var g=this.getPosition(),h=c[0].offsetWidth,i=c[0].offsetHeight;if(f){var j=this.$element.parent(),k=d,l=document.documentElement.scrollTop||document.body.scrollTop,m="body"==this.options.container?window.innerWidth:j.outerWidth(),n="body"==this.options.container?window.innerHeight:j.outerHeight(),o="body"==this.options.container?0:j.offset().left;d="bottom"==d&&g.top+g.height+i-l>n?"top":"top"==d&&g.top-l-i<0?"bottom":"right"==d&&g.right+h>m?"left":"left"==d&&g.left-h'}),b.prototype=a.extend({},a.fn.tooltip.Constructor.prototype),b.prototype.constructor=b,b.prototype.getDefaults=function(){return b.DEFAULTS},b.prototype.setContent=function(){var a=this.tip(),b=this.getTitle(),c=this.getContent();a.find(".popover-title")[this.options.html?"html":"text"](b),a.find(".popover-content")[this.options.html?"html":"text"](c),a.removeClass("fade top bottom left right in"),a.find(".popover-title").html()||a.find(".popover-title").hide()},b.prototype.hasContent=function(){return this.getTitle()||this.getContent()},b.prototype.getContent=function(){var a=this.$element,b=this.options;return a.attr("data-content")||("function"==typeof b.content?b.content.call(a[0]):b.content)},b.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")},b.prototype.tip=function(){return this.$tip||(this.$tip=a(this.options.template)),this.$tip};var c=a.fn.popover;a.fn.popover=function(c){return this.each(function(){var d=a(this),e=d.data("bs.popover"),f="object"==typeof c&&c;e||d.data("bs.popover",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.popover.Constructor=b,a.fn.popover.noConflict=function(){return a.fn.popover=c,this}}(window.jQuery),+function(a){"use strict";function b(c,d){var e,f=a.proxy(this.process,this);this.$element=a(c).is("body")?a(window):a(c),this.$body=a("body"),this.$scrollElement=this.$element.on("scroll.bs.scroll-spy.data-api",f),this.options=a.extend({},b.DEFAULTS,d),this.selector=(this.options.target||(e=a(c).attr("href"))&&e.replace(/.*(?=#[^\s]+$)/,"")||"")+" .nav li > a",this.offsets=a([]),this.targets=a([]),this.activeTarget=null,this.refresh(),this.process()}b.DEFAULTS={offset:10},b.prototype.refresh=function(){var b=this.$element[0]==window?"offset":"position";this.offsets=a([]),this.targets=a([]);var c=this;this.$body.find(this.selector).map(function(){var d=a(this),e=d.data("target")||d.attr("href"),f=/^#\w/.test(e)&&a(e);return f&&f.length&&[[f[b]().top+(!a.isWindow(c.$scrollElement.get(0))&&c.$scrollElement.scrollTop()),e]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){c.offsets.push(this[0]),c.targets.push(this[1])})},b.prototype.process=function(){var a,b=this.$scrollElement.scrollTop()+this.options.offset,c=this.$scrollElement[0].scrollHeight||this.$body[0].scrollHeight,d=c-this.$scrollElement.height(),e=this.offsets,f=this.targets,g=this.activeTarget;if(b>=d)return g!=(a=f.last()[0])&&this.activate(a);for(a=e.length;a--;)g!=f[a]&&b>=e[a]&&(!e[a+1]||b<=e[a+1])&&this.activate(f[a])},b.prototype.activate=function(b){this.activeTarget=b,a(this.selector).parents(".active").removeClass("active");var c=this.selector+'[data-target="'+b+'"],'+this.selector+'[href="'+b+'"]',d=a(c).parents("li").addClass("active");d.parent(".dropdown-menu").length&&(d=d.closest("li.dropdown").addClass("active")),d.trigger("activate")};var c=a.fn.scrollspy;a.fn.scrollspy=function(c){return this.each(function(){var d=a(this),e=d.data("bs.scrollspy"),f="object"==typeof c&&c;e||d.data("bs.scrollspy",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.scrollspy.Constructor=b,a.fn.scrollspy.noConflict=function(){return a.fn.scrollspy=c,this},a(window).on("load",function(){a('[data-spy="scroll"]').each(function(){var b=a(this);b.scrollspy(b.data())})})}(window.jQuery),+function(a){"use strict";var b=function(b){this.element=a(b)};b.prototype.show=function(){var b=this.element,c=b.closest("ul:not(.dropdown-menu)"),d=b.attr("data-target");if(d||(d=b.attr("href"),d=d&&d.replace(/.*(?=#[^\s]*$)/,"")),!b.parent("li").hasClass("active")){var e=c.find(".active:last a")[0],f=a.Event("show.bs.tab",{relatedTarget:e});if(b.trigger(f),!f.isDefaultPrevented()){var g=a(d);this.activate(b.parent("li"),c),this.activate(g,g.parent(),function(){b.trigger({type:"shown.bs.tab",relatedTarget:e})})}}},b.prototype.activate=function(b,c,d){function e(){f.removeClass("active").find("> .dropdown-menu > .active").removeClass("active"),b.addClass("active"),g?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu")&&b.closest("li.dropdown").addClass("active"),d&&d()}var f=c.find("> .active"),g=d&&a.support.transition&&f.hasClass("fade");g?f.one(a.support.transition.end,e).emulateTransitionEnd(150):e(),f.removeClass("in")};var c=a.fn.tab;a.fn.tab=function(c){return this.each(function(){var d=a(this),e=d.data("bs.tab");e||d.data("bs.tab",e=new b(this)),"string"==typeof c&&e[c]()})},a.fn.tab.Constructor=b,a.fn.tab.noConflict=function(){return a.fn.tab=c,this},a(document).on("click.bs.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"]',function(b){b.preventDefault(),a(this).tab("show")})}(window.jQuery),+function(a){"use strict";var b=function(c,d){this.options=a.extend({},b.DEFAULTS,d),this.$window=a(window).on("scroll.bs.affix.data-api",a.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",a.proxy(this.checkPositionWithEventLoop,this)),this.$element=a(c),this.affixed=this.unpin=null,this.checkPosition()};b.RESET="affix affix-top affix-bottom",b.DEFAULTS={offset:0},b.prototype.checkPositionWithEventLoop=function(){setTimeout(a.proxy(this.checkPosition,this),1)},b.prototype.checkPosition=function(){if(this.$element.is(":visible")){var c=a(document).height(),d=this.$window.scrollTop(),e=this.$element.offset(),f=this.options.offset,g=f.top,h=f.bottom;"object"!=typeof f&&(h=g=f),"function"==typeof g&&(g=f.top()),"function"==typeof h&&(h=f.bottom());var i=null!=this.unpin&&d+this.unpin<=e.top?!1:null!=h&&e.top+this.$element.height()>=c-h?"bottom":null!=g&&g>=d?"top":!1;this.affixed!==i&&(this.unpin&&this.$element.css("top",""),this.affixed=i,this.unpin="bottom"==i?e.top-d:null,this.$element.removeClass(b.RESET).addClass("affix"+(i?"-"+i:"")),"bottom"==i&&this.$element.offset({top:document.body.offsetHeight-h-this.$element.height()}))}};var c=a.fn.affix;a.fn.affix=function(c){return this.each(function(){var d=a(this),e=d.data("bs.affix"),f="object"==typeof c&&c;e||d.data("bs.affix",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.affix.Constructor=b,a.fn.affix.noConflict=function(){return a.fn.affix=c,this},a(window).on("load",function(){a('[data-spy="affix"]').each(function(){var b=a(this),c=b.data();c.offset=c.offset||{},c.offsetBottom&&(c.offset.bottom=c.offsetBottom),c.offsetTop&&(c.offset.top=c.offsetTop),b.affix(c)})})}(window.jQuery);
--------------------------------------------------------------------------------