Compare commits
133 Commits
2.4.0
...
fix-unit-tests
| Author | SHA1 | Date | |
|---|---|---|---|
| 09177883a6 | |||
| d1127c0bb3 | |||
| 3288b0a6c5 | |||
| f268c0cd3d | |||
| 7500dffac8 | |||
| 0ece58228a | |||
| 7a7dfa4174 | |||
| 1048156cde | |||
| c5a84fdd5d | |||
| a76e3a7cd0 | |||
| 46896dd2cc | |||
| f5f7eb5dd1 | |||
| 49c218781a | |||
| 4db145e785 | |||
| 08977793e2 | |||
| ae25ba3fc8 | |||
| 20d1f35729 | |||
| f147abd89c | |||
| 400992549b | |||
| 6245a62870 | |||
| 6be7102c66 | |||
| 68379dde33 | |||
| f52c2c1db7 | |||
| 2d40031e3b | |||
| f032bec5ae | |||
| 76b5279570 | |||
| c4adfe5ef5 | |||
| 1d99792129 | |||
| b9b807ca4a | |||
| 2de7918ed0 | |||
| 0d38e16f1e | |||
| 83957b1138 | |||
| bd78c0c683 | |||
| 12cfe7f4a6 | |||
| c6553764e7 | |||
| 17c8b7320f | |||
| 9139217264 | |||
| 5ab70160dc | |||
| 76eae6ebc5 | |||
| c38558d2d3 | |||
| c4b0a970f2 | |||
| 522beb170b | |||
| 5b79e032dd | |||
| 09061a4f98 | |||
| 48a5282b45 | |||
| d24e60ee50 | |||
| dca4c5835a | |||
| 690400df8e | |||
| ab1b11315c | |||
| d00e27b267 | |||
| d076ba2ffc | |||
| 964338ef87 | |||
| f46406be13 | |||
| 6a84363adf | |||
| d8242f2eba | |||
| 6a6ea36e25 | |||
| ffc493e60b | |||
| e78eed1475 | |||
| deb2a98df6 | |||
| 2292244fa8 | |||
| 152e1290a6 | |||
| 39c52f270d | |||
| b229cfe76c | |||
| 170d46e195 | |||
| 19aa6d631c | |||
| 5ee1731dd1 | |||
| 4b7b3aea4f | |||
| ca4307a11d | |||
| 48dd128dbc | |||
| cf59717498 | |||
| 6cda57a9b9 | |||
| 932d0d5ce7 | |||
| c6d1970aef | |||
| 0b2adcab59 | |||
| 96bd561806 | |||
| d024cfb867 | |||
| 35ba8568e3 | |||
| 344388d99d | |||
| 91170f3deb | |||
| e44b6d6f2e | |||
| 6c7495261d | |||
| a4306f5619 | |||
| 5d9c3e26e5 | |||
| 9d6fc4cdc3 | |||
| b3e1350fda | |||
| e5946fdb67 | |||
| 5ff0edd3ca | |||
| b8508e0d56 | |||
| 5a1a8921a8 | |||
| df4f2f611b | |||
| a6c586481b | |||
| 88b7127bab | |||
| 2b5b5c4b39 | |||
| 66bd1bcf32 | |||
| 4ce8eb90d5 | |||
| 61d5d4b286 | |||
| 11912f7f2e | |||
| 447415acaf | |||
| 5cebd17748 | |||
| 98921f4560 | |||
| 29d0c10d2d | |||
| 5902ebbcb6 | |||
| eee69719b7 | |||
| 690b9a4b0b | |||
| 5a2aa743a5 | |||
| 23cd283b7f | |||
| 745c75ffee | |||
| 2bfd24fbd6 | |||
| 70ac727a0d | |||
| a5f551acad | |||
| 1f4309a9e3 | |||
| beca776f99 | |||
| 819a408ea1 | |||
| 84be83e008 | |||
| e085280499 | |||
| 95ba34b067 | |||
| 07c3da465c | |||
| a2dee1bdeb | |||
| 409eec4019 | |||
| b90485b2a4 | |||
| 0d79005f8d | |||
| e538d2f71f | |||
| f5b357fd11 | |||
| 761db7b4b7 | |||
| 86ee770834 | |||
| 47c4544e23 | |||
| e8479514cd | |||
| cf3f870735 | |||
| 7d3a7502fa | |||
| 71dc691323 | |||
| 42f3cc847a | |||
| b755559ec9 | |||
| 9e6d2a0a14 |
@@ -1,18 +1,45 @@
|
||||
# This file is for unifying the coding style for different editors and IDEs
|
||||
# editorconfig.org
|
||||
# This project uses EditorConfig for setting code formatting options: http://EditorConfig.org
|
||||
|
||||
root = true
|
||||
|
||||
# Default settings for all files
|
||||
[*]
|
||||
end_of_line = lf
|
||||
charset = utf-8
|
||||
end_of_line = lf
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
indent_style = tab
|
||||
indent_size = tab
|
||||
tab_width = 4
|
||||
max_line_length = 120
|
||||
|
||||
# Tabs in JS unless otherwise specified
|
||||
[**.js]
|
||||
spaces_around_operators = true
|
||||
spaces_around_brackets = none
|
||||
curly_bracket_next_line = true
|
||||
indent_brace_style = Allman
|
||||
continuation_indent_size = 4
|
||||
|
||||
[*.{css,less}]
|
||||
curly_bracket_next_line = false
|
||||
continuation_indent_size = 0
|
||||
|
||||
# Formats likely to be pasted into an REPL on a terminal should not use tabs to avoid triggering tab-completion.
|
||||
[*.{sh,bash,sql,psql,pgsql}]
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
|
||||
[*.yml]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
[*.md]
|
||||
trim_trailing_whitespace = false
|
||||
[*.{js,json}]
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
|
||||
# Special overrides for automatically-generated files
|
||||
[package.json]
|
||||
indent_size = 2
|
||||
|
||||
# For some formats, trailing whitespace is significant; don't strip it.
|
||||
[*.{md,diff,patch}]
|
||||
trim_trailing_whitespace = false
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
# These are supported funding model platforms
|
||||
|
||||
open_collective: morgul
|
||||
issuehunt: morgul
|
||||
custom: https://www.paypal.me/morgul
|
||||
@@ -6,6 +6,8 @@ existing issues (both open and closed) prior to opening any new issue and ensure
|
||||
|
||||
### Link to minimally-working plunker that reproduces the issue:
|
||||
|
||||
### Steps to reproduce the issue:
|
||||
|
||||
### Version of Angular, UIBS, and Bootstrap
|
||||
|
||||
Angular:
|
||||
|
||||
@@ -14,7 +14,7 @@ lib-cov
|
||||
pids
|
||||
logs
|
||||
results
|
||||
dist
|
||||
# dist
|
||||
# test coverage files
|
||||
.coverage/
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
language: node_js
|
||||
dist: xenial
|
||||
node_js:
|
||||
- "5.9"
|
||||
- 10
|
||||
env:
|
||||
- CXX=g++-4.8
|
||||
addons:
|
||||
@@ -11,9 +12,7 @@ addons:
|
||||
- g++-4.8
|
||||
|
||||
before_install:
|
||||
- export DISPLAY=:99.0
|
||||
- sh -e /etc/init.d/xvfb start
|
||||
- npm install --quiet -g karma
|
||||
|
||||
script: grunt
|
||||
script: xvfb-run grunt
|
||||
sudo: false
|
||||
|
||||
@@ -1,3 +1,67 @@
|
||||
<a name="3.0.5"></a>
|
||||
## [3.0.5](https://github.com/morgul/ui-bootstrap4/compare/v3.0.4...v3.0.5) (2018-10-04)
|
||||
|
||||
|
||||
|
||||
<a name="3.0.4"></a>
|
||||
## [3.0.4](https://github.com/morgul/ui-bootstrap4/compare/v3.0.3...v3.0.4) (2018-07-04)
|
||||
|
||||
|
||||
|
||||
<a name="3.0.3"></a>
|
||||
## [3.0.3](https://github.com/morgul/ui-bootstrap4/compare/v3.0.2...v3.0.3) (2018-03-13)
|
||||
|
||||
|
||||
|
||||
<a name="3.0.2"></a>
|
||||
## [3.0.2](https://github.com/morgul/ui-bootstrap4/compare/v3.0.1...v3.0.2) (2018-02-12)
|
||||
|
||||
|
||||
|
||||
<a name="3.0.1"></a>
|
||||
## [3.0.1](https://github.com/morgul/ui-bootstrap4/compare/v3.0.0...v3.0.1) (2018-02-12)
|
||||
|
||||
|
||||
|
||||
<a name="3.0.0"></a>
|
||||
# [3.0.0](https://github.com/morgul/ui-bootstrap4/compare/3.0.0-beta.4...3.0.0) (2017-12-11)
|
||||
|
||||
|
||||
|
||||
<a name="3.0.0-beta.4"></a>
|
||||
# [3.0.0-beta.4](https://github.com/morgul/ui-bootstrap4/compare/2.5.0...3.0.0-beta.4) (2017-12-10)
|
||||
|
||||
|
||||
|
||||
<a name="2.5.0"></a>
|
||||
# [2.5.0](https://github.com/angular-ui/bootstrap/compare/2.4.0...v2.5.0) (2017-01-28)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **angular:** add compatibility with Angular 1.6([0d79005](https://github.com/angular-ui/bootstrap/commit/0d79005)), closes [#6427](https://github.com/angular-ui/bootstrap/issues/6427) [#6360](https://github.com/angular-ui/bootstrap/issues/6360)
|
||||
* **carousel:** remove transition buffering([86ee770](https://github.com/angular-ui/bootstrap/commit/86ee770)), closes [#6367](https://github.com/angular-ui/bootstrap/issues/6367) [#5967](https://github.com/angular-ui/bootstrap/issues/5967)
|
||||
* **dropdown:** do nothing if not open when clicking([761db7b](https://github.com/angular-ui/bootstrap/commit/761db7b)), closes [#6414](https://github.com/angular-ui/bootstrap/issues/6414)
|
||||
* **tooltip:** unbind keypress listener on hide([f5b357f](https://github.com/angular-ui/bootstrap/commit/f5b357f)), closes [#6423](https://github.com/angular-ui/bootstrap/issues/6423) [#6405](https://github.com/angular-ui/bootstrap/issues/6405)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **dropdown:** make dropdown-append-to-body configurable ([#6356](https://github.com/angular-ui/bootstrap/issues/6356))([7d3a750](https://github.com/angular-ui/bootstrap/commit/7d3a750))
|
||||
* **pagination:** Added menu and menuitem roles (closes [#6383](https://github.com/angular-ui/bootstrap/issues/6383)) ([#6386](https://github.com/angular-ui/bootstrap/issues/6386))([71dc691](https://github.com/angular-ui/bootstrap/commit/71dc691)), closes [#6383](https://github.com/angular-ui/bootstrap/issues/6383) [(#6386](https://github.com/(/issues/6386)
|
||||
|
||||
|
||||
|
||||
<a name="2.4.0"></a>
|
||||
# [2.4.0](https://github.com/angular-ui/bootstrap/compare/2.3.2...v2.4.0) (2016-12-30)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **dateparser:** allow overriding of parsers([5a3e44a](https://github.com/angular-ui/bootstrap/commit/5a3e44a)), closes [#6370](https://github.com/angular-ui/bootstrap/issues/6370) [#6373](https://github.com/angular-ui/bootstrap/issues/6373)
|
||||
|
||||
|
||||
|
||||
<a name="2.3.2"></a>
|
||||
## [2.3.2](https://github.com/angular-ui/bootstrap/compare/2.3.1...v2.3.2) (2016-12-27)
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
The MIT License
|
||||
|
||||
Copyright (c) 2012-2016 the AngularUI Team, https://github.com/organizations/angular-ui/teams/291112
|
||||
Copyright (c) 2012-2017 the AngularUI Team, https://github.com/organizations/angular-ui/teams/291112
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
@@ -1,23 +1,59 @@
|
||||
### UI Bootstrap - [AngularJS](http://angularjs.org/) directives specific to [Bootstrap](http://getbootstrap.com)
|
||||
# UI Bootstrap 4
|
||||
|
||||
[](https://gitter.im/angular-ui/bootstrap?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
||||
[](http://travis-ci.org/angular-ui/bootstrap)
|
||||
[](https://david-dm.org/angular-ui/bootstrap#info=devDependencies)
|
||||
_[AngularJS](http://angularjs.org/) directives specific to [Bootstrap](http://getbootstrap.com)_
|
||||
|
||||
### Quick links
|
||||
[](https://gitter.im/ui-bootstrap4/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
||||
[](http://travis-ci.org/morgul/ui-bootstrap4)
|
||||
[](https://david-dm.org/morgul/ui-bootstrap4#info=devDependencies)
|
||||
|
||||
## Fork
|
||||
|
||||
This is a fork of the original [ui-bootstrap4][] project. It has been modified to work with Bootstrap 4. The reason this repository exists is because some applications are choosing (or are forced to chose) to stap with Angular 1, but would like to move to Bootstrap 4. (Especially considering the fact that [bootstrap 3 is EoL](https://github.com/twbs/bootstrap/issues/20631).)
|
||||
|
||||
This for makes as few changes as possible to the original source code, so that upstream changes can be merged in with minimal issues. Some work has been used from other attempts to do the same thing, such as the fork from [dietergeerts][].
|
||||
|
||||
[dietergeerts]: https://github.com/dietergeerts/bootstrap
|
||||
[ui-bootstrap4]: https://github.com/morgul/ui-bootstrap4
|
||||
|
||||
## 🚨 Help Wanted 🚨
|
||||
|
||||
_As of this Aug. 2019, my company no longer has any maintained Angular 1.x code, so I have lost the last of my incentive to work on this. Still happy to click buttons and make releases, but I'm pretty much done writing any code for this._
|
||||
|
||||
I did this for a work project, and, frankly, we've gotten what we needed out of it. I'd love to see this cleaned up and maybe even maintained... but I just don't have the time myself. I'll accept merge requests, and fight with the build system... but that's basically it. If someone would like to step in, just let me know and I'll add you to the project. Just open an issue, and I'll respond.
|
||||
|
||||
### 💵 Incentivising 💵
|
||||
|
||||
If you really want your issue fixed and you feel you can't fix it on your own, or your don't want to, I've setup IssueHunt for this project:
|
||||
|
||||
* https://issuehunt.io/r/Morgul/ui-bootstrap4
|
||||
|
||||
Make an item, and then add some funding, and either myself or someone in the community will likely pick it up. No promises, but it seems worth the experiment.
|
||||
|
||||
### Contributing
|
||||
|
||||
Wanting to contribute, but not take over the reigns? The things that are really holding this project back are, as I can see it:
|
||||
|
||||
* [ ] Undocumented/confusing build system.
|
||||
* [ ] The whole `SNAPSHOT` thing seems like it adds a lot of complexity, for very little gain.
|
||||
* [ ] Making a release should be a single `npm` command
|
||||
* [ ] Getting started with development should be very simple
|
||||
* [ ] Switch to ES2015
|
||||
* [ ] The code should be cleaned up, and better formatted
|
||||
|
||||
If you can think of more, feel free to make issues.
|
||||
|
||||
---
|
||||
|
||||
## Quick links
|
||||
- [Demo](#demo)
|
||||
- [Angular 2](#angular-2)
|
||||
- [Installation](#installation)
|
||||
- [NPM](#install-with-npm)
|
||||
- [Bower](#install-with-bower)
|
||||
- [NuGet](#install-with-nuget)
|
||||
- [Custom](#custom-build)
|
||||
- [Manual](#manual-download)
|
||||
- [Webpack / JSPM](#webpack--jspm)
|
||||
- [Support](#support)
|
||||
- [FAQ](#faq)
|
||||
- [Code of Conduct](#code-of-conduct)
|
||||
- [PREFIX MIGRATION GUIDE](#prefix-migration-guide)
|
||||
- [Supported browsers](#supported-browsers)
|
||||
- [Need help?](#need-help)
|
||||
- [Found a bug?](#found-a-bug)
|
||||
@@ -25,60 +61,49 @@
|
||||
- [Development, meeting minutes, roadmap and more.](#development-meeting-minutes-roadmap-and-more)
|
||||
|
||||
|
||||
# Demo
|
||||
## Demo
|
||||
|
||||
Do you want to see directives in action? Visit https://angular-ui.github.io/bootstrap/!
|
||||
Do you want to see directives in action? Visit https://morgul.github.io/ui-bootstrap4/!
|
||||
|
||||
# Angular 2
|
||||
|
||||
Are you interested in Angular 2? We are on our way! Check out [ng-bootstrap](https://github.com/ui-bootstrap/core).
|
||||
|
||||
# Installation
|
||||
## Installation
|
||||
|
||||
Installation is easy as UI Bootstrap has minimal dependencies - only the AngularJS and Twitter Bootstrap's CSS are required.
|
||||
*Notes:*
|
||||
* Since version 0.13.0, UI Bootstrap depends on [ngAnimate](https://docs.angularjs.org/api/ngAnimate) for transitions and animations, such as the accordion, carousel, etc. Include `ngAnimate` in the module dependencies for your app in order to enable animation.
|
||||
* UI Bootstrap depends on [ngTouch](https://docs.angularjs.org/api/ngTouch) for swipe actions. Include `ngTouch` in the module dependencies for your app in order to enable swiping.
|
||||
|
||||
## Angular Requirements
|
||||
### Angular Requirements
|
||||
* UI Bootstrap 1.0 and higher _requires_ Angular 1.4.x or higher and it has been tested with Angular 1.4.8.
|
||||
* UI Bootstrap 0.14.3 is the _last_ version that supports Angular 1.3.x.
|
||||
* UI Bootstrap 0.12.0 is the _last_ version that supports Angular 1.2.x.
|
||||
|
||||
## Bootstrap Requirements
|
||||
* UI Bootstrap requires Bootstrap CSS version 3.x or higher and it has been tested with Bootstrap CSS 3.3.6.
|
||||
### Bootstrap Requirements
|
||||
* UI Bootstrap 3.0 and higher requires Bootstrap CSS version 4.x or higher and it has been tested with Bootstrap CSS 4.0.0-beta.
|
||||
* UI Bootstrap 2.x requires Bootstrap CSS version 3.x or higher and it has been tested with Bootstrap CSS 3.3.6.
|
||||
* UI Bootstrap 0.8 is the _last_ version that supports Bootstrap CSS 2.3.x.
|
||||
|
||||
#### Install with NPM
|
||||
|
||||
```sh
|
||||
$ npm install angular-ui-bootstrap
|
||||
$ npm install ui-bootstrap4
|
||||
```
|
||||
|
||||
#### Install with Yarn
|
||||
|
||||
```sh
|
||||
$ yarn add ui-bootstrap4
|
||||
```
|
||||
|
||||
This will install AngularJS and Bootstrap NPM packages.
|
||||
|
||||
#### Install with Bower
|
||||
```sh
|
||||
$ bower install angular-bootstrap
|
||||
```
|
||||
|
||||
Note: do not install 'angular-ui-bootstrap'. A separate repository - [bootstrap-bower](https://github.com/angular-ui/bootstrap-bower) - hosts the compiled javascript file and bower.json.
|
||||
|
||||
#### Install with NuGet
|
||||
To install AngularJS UI Bootstrap, run the following command in the Package Manager Console
|
||||
|
||||
```sh
|
||||
PM> Install-Package Angular.UI.Bootstrap
|
||||
```
|
||||
|
||||
#### Custom build
|
||||
|
||||
Head over to https://angular-ui.github.io/bootstrap/ and hit the *Custom build* button to create your own custom UI Bootstrap build, just the way you like it.
|
||||
Head over to https://morgul.github.io/ui-bootstrap4/ and hit the *Custom build* button to create your own custom UI Bootstrap build, just the way you like it.
|
||||
|
||||
#### Manual download
|
||||
|
||||
After downloading dependencies (or better yet, referencing them from your favorite CDN) you need to download build version of this project. All the files and their purposes are described here:
|
||||
https://github.com/angular-ui/bootstrap/tree/gh-pages#build-files
|
||||
https://github.com/morgul/ui-bootstrap4/tree/gh-pages#build-files
|
||||
Don't worry, if you are not sure which file to take, opt for `ui-bootstrap-tpls-[version].min.js`.
|
||||
|
||||
### Adding dependency to your project
|
||||
@@ -89,13 +114,13 @@ When you are done downloading all the dependencies and project files the only re
|
||||
angular.module('myModule', ['ui.bootstrap']);
|
||||
```
|
||||
|
||||
# Webpack / JSPM
|
||||
## Webpack / JSPM
|
||||
|
||||
To use this project with webpack, follow the [NPM](#install-with-npm) instructions.
|
||||
Now, if you want to use only the accordion, you can do:
|
||||
|
||||
```js
|
||||
import accordion from 'angular-ui-bootstrap/src/accordion';
|
||||
import accordion from 'ui-bootstrap4/src/accordion';
|
||||
|
||||
angular.module('myModule', [accordion]);
|
||||
```
|
||||
@@ -103,8 +128,8 @@ angular.module('myModule', [accordion]);
|
||||
You can import all the pieces you need in the same way:
|
||||
|
||||
```js
|
||||
import accordion from 'angular-ui-bootstrap/src/accordion';
|
||||
import datepicker from 'angular-ui-bootstrap/src/datepicker';
|
||||
import accordion from 'ui-bootstrap4/src/accordion';
|
||||
import datepicker from 'ui-bootstrap4/src/datepicker';
|
||||
|
||||
angular.module('myModule', [accordion, datepicker]);
|
||||
```
|
||||
@@ -128,31 +153,27 @@ If you would prefer not to load your css through your JavaScript file loader/bun
|
||||
The other modules, such as `accordion` in the example below, do not have CSS resources to load, so you should continue to import them as normal:
|
||||
|
||||
```js
|
||||
import accordion from 'angular-ui-bootstrap/src/accordion';
|
||||
import typeahead from 'angular-ui-bootstrap/src/typeahead/index-nocss.js';
|
||||
import accordion from 'ui-bootstrap4/src/accordion';
|
||||
import typeahead from 'ui-bootstrap4/src/typeahead/index-nocss.js';
|
||||
|
||||
angular.module('myModule', [accordion, typeahead]);
|
||||
```
|
||||
|
||||
# Versioning
|
||||
## Versioning
|
||||
|
||||
Pre-2.0.0 does not follow a particular versioning system. 2.0.0 and onwards follows [semantic versioning](http://semver.org/). All release changes can be viewed on our [changelog](CHANGELOG.md).
|
||||
|
||||
# Support
|
||||
## Support
|
||||
|
||||
## FAQ
|
||||
### FAQ
|
||||
|
||||
https://github.com/angular-ui/bootstrap/wiki/FAQ
|
||||
https://github.com/morgul/ui-bootstrap4/wiki/FAQ
|
||||
|
||||
# Code of Conduct
|
||||
## Code of Conduct
|
||||
|
||||
Take a moment to read our [Code of Conduct](CODE_OF_CONDUCT.md)
|
||||
|
||||
## PREFIX MIGRATION GUIDE
|
||||
|
||||
If you're updating your application to use prefixes, please check the [migration guide](https://github.com/angular-ui/bootstrap/wiki/Migration-guide-for-prefixes).
|
||||
|
||||
## Supported browsers
|
||||
### Supported browsers
|
||||
|
||||
Directives from this repository are automatically tested with the following browsers:
|
||||
* Chrome (stable and canary channel)
|
||||
@@ -166,22 +187,35 @@ Modern mobile browsers should work without problems.
|
||||
## Need help?
|
||||
Need help using UI Bootstrap?
|
||||
|
||||
* Live help in the IRC (`#angularjs` channel at the `freenode` network). Use this [webchat](https://webchat.freenode.net/) or your own IRC client.
|
||||
* Ask a question in [StackOverflow](http://stackoverflow.com/) under the [angular-ui-bootstrap](http://stackoverflow.com/questions/tagged/angular-ui-bootstrap) tag.
|
||||
* ~~Live help in the IRC (`#angularjs` channel at the `freenode` network). Use this [webchat](https://webchat.freenode.net/) or your own IRC client.~~
|
||||
* ~~Ask a question in [StackOverflow](http://stackoverflow.com/) under the [ui-bootstrap4](http://stackoverflow.com/questions/tagged/ui-bootstrap4) tag.~~
|
||||
|
||||
**Please do not create new issues in this repository to ask questions about using UI Bootstrap**
|
||||
**For now, please create new issues in this repository to ask questions about using UI Bootstrap 4**
|
||||
|
||||
## Found a bug?
|
||||
Please take a look at [CONTRIBUTING.md](CONTRIBUTING.md#you-think-youve-found-a-bug) and submit your issue [here](https://github.com/angular-ui/bootstrap/issues/new).
|
||||
Please take a look at [CONTRIBUTING.md](CONTRIBUTING.md#you-think-youve-found-a-bug) and submit your issue [here](https://github.com/morgul/ui-bootstrap4/issues/new).
|
||||
|
||||
|
||||
----
|
||||
|
||||
|
||||
# Contributing to the project
|
||||
## Contributing to the project
|
||||
|
||||
We are always looking for the quality contributions! Please check the [CONTRIBUTING.md](CONTRIBUTING.md) for the contribution guidelines.
|
||||
|
||||
# Development, meeting minutes, roadmap and more.
|
||||
~~## Development, meeting minutes, roadmap and more.~~
|
||||
|
||||
Head over to the [Wiki](https://github.com/angular-ui/bootstrap/wiki) for notes on development for UI Bootstrap, meeting minutes from the UI Bootstrap team, roadmap plans, project philosophy and more.
|
||||
~~Head over to the [Wiki](https://github.com/morgul/ui-bootstrap4/wiki) for notes on development for UI Bootstrap, meeting minutes from the UI Bootstrap team, roadmap plans, project philosophy and more.~~
|
||||
|
||||
----
|
||||
|
||||
## Building a Release
|
||||
|
||||
I've currently hacked out a solution, but the whole thing's very messy. For now, to build a release, just do:
|
||||
|
||||
```
|
||||
$ grunt release:3.0.0
|
||||
```
|
||||
|
||||
(Obviously, replace `3.0.0` with the version you're releasing.) That should build a correct release, and update the
|
||||
docs, and everything.
|
||||
|
||||
@@ -0,0 +1,140 @@
|
||||
/* Include this file in your html if you are using the CSP mode. */
|
||||
|
||||
.ng-animate.item:not(.left):not(.right) {
|
||||
-webkit-transition: 0s ease-in-out left;
|
||||
transition: 0s ease-in-out left
|
||||
}
|
||||
|
||||
.fa-svg-icon {
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
min-width: 1em;
|
||||
min-height: 1em;
|
||||
height: 100%;
|
||||
position: relative;
|
||||
top: -1px;
|
||||
}
|
||||
|
||||
.fa-svg-icon svg {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.fa-svg-icon svg g,
|
||||
.fa-svg-icon svg path {
|
||||
fill: currentColor;
|
||||
}
|
||||
|
||||
.uib-datepicker .uib-title {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.uib-day button, .uib-month button, .uib-year button {
|
||||
min-width: 100%;
|
||||
}
|
||||
|
||||
.uib-left, .uib-right {
|
||||
width: 100%
|
||||
}
|
||||
|
||||
.uib-position-measure {
|
||||
display: block !important;
|
||||
visibility: hidden !important;
|
||||
position: absolute !important;
|
||||
top: -9999px !important;
|
||||
left: -9999px !important;
|
||||
}
|
||||
|
||||
.uib-position-scrollbar-measure {
|
||||
position: absolute !important;
|
||||
top: -9999px !important;
|
||||
width: 50px !important;
|
||||
height: 50px !important;
|
||||
overflow: scroll !important;
|
||||
}
|
||||
|
||||
.uib-position-body-scrollbar-measure {
|
||||
overflow: scroll !important;
|
||||
}
|
||||
.uib-datepicker-popup.dropdown-menu {
|
||||
display: block;
|
||||
float: none;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.uib-button-bar {
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
[uib-tooltip-popup].tooltip.top-left > .tooltip-arrow,
|
||||
[uib-tooltip-popup].tooltip.top-right > .tooltip-arrow,
|
||||
[uib-tooltip-popup].tooltip.bottom-left > .tooltip-arrow,
|
||||
[uib-tooltip-popup].tooltip.bottom-right > .tooltip-arrow,
|
||||
[uib-tooltip-popup].tooltip.left-top > .tooltip-arrow,
|
||||
[uib-tooltip-popup].tooltip.left-bottom > .tooltip-arrow,
|
||||
[uib-tooltip-popup].tooltip.right-top > .tooltip-arrow,
|
||||
[uib-tooltip-popup].tooltip.right-bottom > .tooltip-arrow,
|
||||
[uib-tooltip-html-popup].tooltip.top-left > .tooltip-arrow,
|
||||
[uib-tooltip-html-popup].tooltip.top-right > .tooltip-arrow,
|
||||
[uib-tooltip-html-popup].tooltip.bottom-left > .tooltip-arrow,
|
||||
[uib-tooltip-html-popup].tooltip.bottom-right > .tooltip-arrow,
|
||||
[uib-tooltip-html-popup].tooltip.left-top > .tooltip-arrow,
|
||||
[uib-tooltip-html-popup].tooltip.left-bottom > .tooltip-arrow,
|
||||
[uib-tooltip-html-popup].tooltip.right-top > .tooltip-arrow,
|
||||
[uib-tooltip-html-popup].tooltip.right-bottom > .tooltip-arrow,
|
||||
[uib-tooltip-template-popup].tooltip.top-left > .tooltip-arrow,
|
||||
[uib-tooltip-template-popup].tooltip.top-right > .tooltip-arrow,
|
||||
[uib-tooltip-template-popup].tooltip.bottom-left > .tooltip-arrow,
|
||||
[uib-tooltip-template-popup].tooltip.bottom-right > .tooltip-arrow,
|
||||
[uib-tooltip-template-popup].tooltip.left-top > .tooltip-arrow,
|
||||
[uib-tooltip-template-popup].tooltip.left-bottom > .tooltip-arrow,
|
||||
[uib-tooltip-template-popup].tooltip.right-top > .tooltip-arrow,
|
||||
[uib-tooltip-template-popup].tooltip.right-bottom > .tooltip-arrow,
|
||||
[uib-popover-popup].popover.top-left > .arrow,
|
||||
[uib-popover-popup].popover.top-right > .arrow,
|
||||
[uib-popover-popup].popover.bottom-left > .arrow,
|
||||
[uib-popover-popup].popover.bottom-right > .arrow,
|
||||
[uib-popover-popup].popover.left-top > .arrow,
|
||||
[uib-popover-popup].popover.left-bottom > .arrow,
|
||||
[uib-popover-popup].popover.right-top > .arrow,
|
||||
[uib-popover-popup].popover.right-bottom > .arrow,
|
||||
[uib-popover-html-popup].popover.top-left > .arrow,
|
||||
[uib-popover-html-popup].popover.top-right > .arrow,
|
||||
[uib-popover-html-popup].popover.bottom-left > .arrow,
|
||||
[uib-popover-html-popup].popover.bottom-right > .arrow,
|
||||
[uib-popover-html-popup].popover.left-top > .arrow,
|
||||
[uib-popover-html-popup].popover.left-bottom > .arrow,
|
||||
[uib-popover-html-popup].popover.right-top > .arrow,
|
||||
[uib-popover-html-popup].popover.right-bottom > .arrow,
|
||||
[uib-popover-template-popup].popover.top-left > .arrow,
|
||||
[uib-popover-template-popup].popover.top-right > .arrow,
|
||||
[uib-popover-template-popup].popover.bottom-left > .arrow,
|
||||
[uib-popover-template-popup].popover.bottom-right > .arrow,
|
||||
[uib-popover-template-popup].popover.left-top > .arrow,
|
||||
[uib-popover-template-popup].popover.left-bottom > .arrow,
|
||||
[uib-popover-template-popup].popover.right-top > .arrow,
|
||||
[uib-popover-template-popup].popover.right-bottom > .arrow {
|
||||
top: auto;
|
||||
bottom: auto;
|
||||
left: auto;
|
||||
right: auto;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
[uib-popover-popup].popover,
|
||||
[uib-popover-html-popup].popover,
|
||||
[uib-popover-template-popup].popover {
|
||||
display: block !important;
|
||||
}
|
||||
|
||||
.uib-time input {
|
||||
/* Bootstrap 4 overrides this otherwise */
|
||||
width: 50px !important;
|
||||
}
|
||||
|
||||
[uib-typeahead-popup].dropdown-menu {
|
||||
display: block;
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
[{"version":"3.0.x (Current)","url":"/ui-bootstrap4/"}, {"version":"3.0.5","url":"/ui-bootstrap4/versioned-docs/3.0.5/index.html"}, {"version":"2.5.0","url":"/ui-bootstrap4/versioned-docs/2.5.0/index.html"}]
|
||||
@@ -0,0 +1,337 @@
|
||||
/* global FastClick, smoothScroll */
|
||||
angular.module('ui.bootstrap.demo', ['ui.bootstrap', 'plunker', 'ngTouch', 'ngAnimate', 'ngSanitize'], function($httpProvider){
|
||||
if (!!window.FastClick) {
|
||||
FastClick.attach(document.body);
|
||||
}
|
||||
delete $httpProvider.defaults.headers.common['X-Requested-With'];
|
||||
}).run(['$location', function($location){
|
||||
//Allows us to navigate to the correct element on initialization
|
||||
if ($location.path() !== '' && $location.path() !== '/') {
|
||||
smoothScroll(document.getElementById($location.path().substring(1)), 500, function(el) {
|
||||
location.replace('#' + el.id);
|
||||
});
|
||||
}
|
||||
}]).factory('buildFilesService', function ($http, $q) {
|
||||
|
||||
var moduleMap;
|
||||
var rawFiles;
|
||||
|
||||
return {
|
||||
getModuleMap: getModuleMap,
|
||||
getRawFiles: getRawFiles,
|
||||
get: function () {
|
||||
return $q.all({
|
||||
moduleMap: getModuleMap(),
|
||||
rawFiles: getRawFiles()
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
function getModuleMap() {
|
||||
return moduleMap ? $q.when(moduleMap) : $http.get('assets/module-mapping.json')
|
||||
.then(function (result) {
|
||||
moduleMap = result.data;
|
||||
return moduleMap;
|
||||
});
|
||||
}
|
||||
|
||||
function getRawFiles() {
|
||||
return rawFiles ? $q.when(rawFiles) : $http.get('assets/raw-files.json')
|
||||
.then(function (result) {
|
||||
rawFiles = result.data;
|
||||
return rawFiles;
|
||||
});
|
||||
}
|
||||
|
||||
})
|
||||
.controller('MainCtrl', MainCtrl)
|
||||
.controller('SelectModulesCtrl', SelectModulesCtrl)
|
||||
.controller('DownloadCtrl', DownloadCtrl);
|
||||
|
||||
function MainCtrl($scope, $http, $document, $uibModal, orderByFilter) {
|
||||
$scope.isCollapsed = true;
|
||||
|
||||
// Grab old version docs
|
||||
$http.get('/ui-bootstrap4/versions-mapping.json')
|
||||
.then(function(result) {
|
||||
$scope.oldDocs = result.data;
|
||||
})
|
||||
.catch(function(response)
|
||||
{
|
||||
if(response.status === 404)
|
||||
{
|
||||
$http.get('/versions-mapping.json')
|
||||
.then(function(result) {
|
||||
$scope.oldDocs = result.data;
|
||||
})
|
||||
.catch(function(response)
|
||||
{
|
||||
console.log('failed to get versions mapping:', response);
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
console.log('failed to get versions mapping:', response);
|
||||
}
|
||||
});
|
||||
|
||||
$scope.showBuildModal = function() {
|
||||
var modalInstance = $uibModal.open({
|
||||
templateUrl: 'buildModal.html',
|
||||
controller: 'SelectModulesCtrl',
|
||||
resolve: {
|
||||
modules: function(buildFilesService) {
|
||||
return buildFilesService.getModuleMap()
|
||||
.then(function (moduleMap) {
|
||||
return Object.keys(moduleMap);
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
$scope.showDownloadModal = function() {
|
||||
var modalInstance = $uibModal.open({
|
||||
templateUrl: 'downloadModal.html',
|
||||
controller: 'DownloadCtrl'
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
function SelectModulesCtrl($scope, $uibModalInstance, modules, buildFilesService) {
|
||||
$scope.selectedModules = [];
|
||||
$scope.modules = modules;
|
||||
|
||||
$scope.selectedChanged = function(module, selected) {
|
||||
if (selected) {
|
||||
$scope.selectedModules.push(module);
|
||||
} else {
|
||||
$scope.selectedModules.splice($scope.selectedModules.indexOf(module), 1);
|
||||
}
|
||||
};
|
||||
|
||||
$scope.downloadBuild = function () {
|
||||
$uibModalInstance.close($scope.selectedModules);
|
||||
};
|
||||
|
||||
$scope.cancel = function () {
|
||||
$uibModalInstance.dismiss();
|
||||
};
|
||||
|
||||
$scope.isOldBrowser = function () {
|
||||
return isOldBrowser;
|
||||
};
|
||||
|
||||
$scope.build = function (selectedModules, version) {
|
||||
/* global JSZip, saveAs */
|
||||
var moduleMap, rawFiles;
|
||||
|
||||
buildFilesService.get().then(function (buildFiles) {
|
||||
moduleMap = buildFiles.moduleMap;
|
||||
rawFiles = buildFiles.rawFiles;
|
||||
|
||||
generateBuild();
|
||||
});
|
||||
|
||||
function generateBuild() {
|
||||
var srcModuleNames = selectedModules
|
||||
.map(function (module) {
|
||||
return moduleMap[module];
|
||||
})
|
||||
.reduce(function (toBuild, module) {
|
||||
addIfNotExists(toBuild, module.name);
|
||||
|
||||
module.dependencies.forEach(function (depName) {
|
||||
addIfNotExists(toBuild, depName);
|
||||
});
|
||||
return toBuild;
|
||||
}, []);
|
||||
|
||||
var srcModules = srcModuleNames
|
||||
.map(function (moduleName) {
|
||||
return moduleMap[moduleName];
|
||||
});
|
||||
|
||||
var srcModuleFullNames = srcModules
|
||||
.map(function (module) {
|
||||
return module.moduleName;
|
||||
});
|
||||
|
||||
var srcJsContent = srcModules
|
||||
.reduce(function (buildFiles, module) {
|
||||
return buildFiles.concat(module.srcFiles);
|
||||
}, [])
|
||||
.map(getFileContent)
|
||||
.join('\n')
|
||||
;
|
||||
|
||||
var jsFile = createNoTplFile(srcModuleFullNames, srcJsContent);
|
||||
|
||||
var tplModuleNames = srcModules
|
||||
.reduce(function (tplModuleNames, module) {
|
||||
return tplModuleNames.concat(module.tplModules);
|
||||
}, []);
|
||||
|
||||
var tplJsContent = srcModules
|
||||
.reduce(function (buildFiles, module) {
|
||||
return buildFiles.concat(module.tpljsFiles);
|
||||
}, [])
|
||||
.map(getFileContent)
|
||||
.join('\n')
|
||||
;
|
||||
|
||||
var jsTplFile = createWithTplFile(srcModuleFullNames, srcJsContent, tplModuleNames, tplJsContent);
|
||||
|
||||
var cssContent = srcModules
|
||||
.map(function (module) {
|
||||
return module.css;
|
||||
})
|
||||
.filter(function (css) {
|
||||
return css;
|
||||
})
|
||||
.join('\n')
|
||||
;
|
||||
|
||||
var cssJsContent = srcModules
|
||||
.map(function (module) {
|
||||
return module.cssJs;
|
||||
})
|
||||
.filter(function (cssJs) {
|
||||
return cssJs;
|
||||
})
|
||||
.join('\n')
|
||||
;
|
||||
|
||||
var footer = cssJsContent;
|
||||
|
||||
var zip = new JSZip();
|
||||
zip.file('ui-bootstrap-custom-' + version + '.js', rawFiles.banner + jsFile + footer);
|
||||
zip.file('ui-bootstrap-custom-' + version + '.min.js', rawFiles.banner + uglify(jsFile + footer));
|
||||
zip.file('ui-bootstrap-custom-tpls-' + version + '.js', rawFiles.banner + jsTplFile + footer);
|
||||
zip.file('ui-bootstrap-custom-tpls-' + version + '.min.js', rawFiles.banner + uglify(jsTplFile + footer));
|
||||
zip.file('ui-bootstrap-custom-tpls-' + version + '.min.js', rawFiles.banner + uglify(jsTplFile + footer));
|
||||
|
||||
if (cssContent) {
|
||||
zip.file('ui-bootstrap-custom-' + version + '-csp.css', rawFiles.cssBanner + cssContent);
|
||||
}
|
||||
|
||||
saveAs(zip.generate({type: 'blob'}), 'ui-bootstrap-custom-build.zip');
|
||||
}
|
||||
|
||||
function createNoTplFile(srcModuleNames, srcJsContent) {
|
||||
return 'angular.module("ui.bootstrap", [' + srcModuleNames.join(',') + ']);\n' +
|
||||
srcJsContent;
|
||||
}
|
||||
|
||||
function createWithTplFile(srcModuleNames, srcJsContent, tplModuleNames, tplJsContent) {
|
||||
var depModuleNames = srcModuleNames.slice();
|
||||
depModuleNames.unshift('"ui.bootstrap.tpls"');
|
||||
|
||||
return 'angular.module("ui.bootstrap", [' + depModuleNames.join(',') + ']);\n' +
|
||||
'angular.module("ui.bootstrap.tpls", [' + tplModuleNames.join(',') + ']);\n' +
|
||||
srcJsContent + '\n' + tplJsContent;
|
||||
|
||||
}
|
||||
|
||||
function addIfNotExists(array, element) {
|
||||
if (array.indexOf(element) == -1) {
|
||||
array.push(element);
|
||||
}
|
||||
}
|
||||
|
||||
function getFileContent(fileName) {
|
||||
return rawFiles.files[fileName];
|
||||
}
|
||||
|
||||
function uglify(js) {
|
||||
/* global UglifyJS */
|
||||
|
||||
var ast = UglifyJS.parse(js);
|
||||
ast.figure_out_scope();
|
||||
|
||||
var compressor = UglifyJS.Compressor();
|
||||
var compressedAst = ast.transform(compressor);
|
||||
|
||||
compressedAst.figure_out_scope();
|
||||
compressedAst.compute_char_frequency();
|
||||
compressedAst.mangle_names();
|
||||
|
||||
var stream = UglifyJS.OutputStream();
|
||||
compressedAst.print(stream);
|
||||
|
||||
return stream.toString();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
function DownloadCtrl($scope, $uibModalInstance) {
|
||||
$scope.options = {
|
||||
minified: true,
|
||||
tpls: true
|
||||
};
|
||||
|
||||
$scope.download = function (version) {
|
||||
var options = $scope.options;
|
||||
|
||||
var downloadUrl = ['ui-bootstrap-'];
|
||||
if (options.tpls) {
|
||||
downloadUrl.push('tpls-');
|
||||
}
|
||||
downloadUrl.push(version);
|
||||
if (options.minified) {
|
||||
downloadUrl.push('.min');
|
||||
}
|
||||
downloadUrl.push('.js');
|
||||
|
||||
return downloadUrl.join('');
|
||||
};
|
||||
|
||||
$scope.cancel = function () {
|
||||
$uibModalInstance.dismiss();
|
||||
};
|
||||
}
|
||||
|
||||
/*
|
||||
* The following compatibility check is from:
|
||||
*
|
||||
* Bootstrap Customizer (http://getbootstrap.com/customize/)
|
||||
* Copyright 2011-2014 Twitter, Inc.
|
||||
*
|
||||
* Licensed under the Creative Commons Attribution 3.0 Unported License. For
|
||||
* details, see http://creativecommons.org/licenses/by/3.0/.
|
||||
*/
|
||||
var isOldBrowser;
|
||||
(function () {
|
||||
|
||||
var supportsFile = (window.File && window.FileReader && window.FileList && window.Blob);
|
||||
function failback() {
|
||||
isOldBrowser = true;
|
||||
}
|
||||
/**
|
||||
* Based on:
|
||||
* Blob Feature Check v1.1.0
|
||||
* https://github.com/ssorallen/blob-feature-check/
|
||||
* License: Public domain (http://unlicense.org)
|
||||
*/
|
||||
var url = window.URL;
|
||||
var svg = new Blob(
|
||||
['<svg xmlns=\'http://www.w3.org/2000/svg\'></svg>'],
|
||||
{ type: 'image/svg+xml;charset=utf-8' }
|
||||
);
|
||||
var objectUrl = url.createObjectURL(svg);
|
||||
|
||||
if (/^blob:/.exec(objectUrl) === null || !supportsFile) {
|
||||
// `URL.createObjectURL` created a URL that started with something other
|
||||
// than "blob:", which means it has been polyfilled and is not supported by
|
||||
// this browser.
|
||||
failback();
|
||||
} else {
|
||||
angular.element('<img/>')
|
||||
.on('load', function () {
|
||||
isOldBrowser = false;
|
||||
})
|
||||
.on('error', failback)
|
||||
.attr('src', objectUrl);
|
||||
}
|
||||
|
||||
})();
|
||||
@@ -0,0 +1,317 @@
|
||||
body {
|
||||
opacity: 1;
|
||||
-webkit-transition: opacity 1s ease;
|
||||
-moz-transition: opacity 1s ease;
|
||||
transition: opacity 1s;
|
||||
}
|
||||
|
||||
.ng-cloak {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.ng-invalid {
|
||||
border: 1px solid red !important;
|
||||
}
|
||||
|
||||
section {
|
||||
padding-top: 30px;
|
||||
}
|
||||
|
||||
.page-header h1 > small > a {
|
||||
color: #999;
|
||||
}
|
||||
.page-header h1 > small > a:hover {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.footer {
|
||||
text-align: center;
|
||||
padding: 30px 0;
|
||||
margin-top: 70px;
|
||||
border-top: 1px solid #e5e5e5;
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
|
||||
.bs-social {
|
||||
margin-top: 20px;
|
||||
margin-bottom: 20px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
@media (min-width: 768px) {
|
||||
|
||||
.bs-social {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.nav, .pagination, .carousel, .panel-title a {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.bs-social-buttons {
|
||||
display: inline-block;
|
||||
margin-bottom: 0;
|
||||
padding-left: 0;
|
||||
list-style: none;
|
||||
}
|
||||
.bs-social-buttons li {
|
||||
display: inline-block;
|
||||
padding: 5px 8px;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
@media (max-width: 767px) {
|
||||
|
||||
.visible-xs.collapse.in {
|
||||
display: block!important;
|
||||
}
|
||||
.visible-xs.collapse {
|
||||
display: none!important;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.navbar-fixed-top .collapse {
|
||||
border-top: 1px solid #e7e7e7;
|
||||
margin-left: -15px;
|
||||
margin-right: -15px;
|
||||
padding-right: 15px;
|
||||
padding-left: 15px;
|
||||
}
|
||||
|
||||
.show-grid {
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
|
||||
/*
|
||||
* Container
|
||||
*
|
||||
* Tweak to width of container.
|
||||
*/
|
||||
|
||||
/*@media (min-width: 1200px) {
|
||||
.container{
|
||||
max-width: 970px;
|
||||
}
|
||||
}*/
|
||||
|
||||
/*
|
||||
* Tabs
|
||||
*
|
||||
* Tweaks to the Tabs.
|
||||
*/
|
||||
|
||||
.code .nav-tabs {
|
||||
border-bottom: 1px solid #ccc;
|
||||
}
|
||||
|
||||
.code pre, .code code {
|
||||
border-top: none;
|
||||
border-top-left-radius: 0;
|
||||
border-top-right-radius: 0;
|
||||
}
|
||||
|
||||
.code .nav-tabs>li.active>a, .code .nav-tabs>li.active>a:hover, .code .nav-tabs>li.active>a:focus {
|
||||
background-color: #f8f8f8;
|
||||
border: 1px solid #ccc;
|
||||
border-bottom-color: transparent;
|
||||
}
|
||||
|
||||
/*
|
||||
* Button Inverse
|
||||
*
|
||||
* Buttons in the masthead.
|
||||
*/
|
||||
|
||||
.btn-outline-inverse {
|
||||
color: #fff;
|
||||
background-color: transparent;
|
||||
border-color: #cdbfe3;
|
||||
margin: 10px;
|
||||
}
|
||||
|
||||
@media (min-width: 768px) {
|
||||
|
||||
.btn-outline-inverse {
|
||||
width: auto;
|
||||
margin: 20px 5px 20px 0;
|
||||
padding: 18px 24px;
|
||||
font-size: 21px;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.btn-outline-inverse:hover, .btn-outline-inverse:focus, .btn-outline-inverse:active {
|
||||
color: #563d7c;
|
||||
text-shadow: none;
|
||||
background-color: #fff;
|
||||
border-color: #fff;
|
||||
}
|
||||
|
||||
|
||||
/* Page headers */
|
||||
.bs-header {
|
||||
padding: 30px 15px 40px; /* side padding builds on .container 15px, so 30px */
|
||||
font-size: 16px;
|
||||
text-align: center;
|
||||
text-shadow: 0 1px 0 rgba(0,0,0,.15);
|
||||
color: #cdbfe3;
|
||||
background-color: #563d7c;
|
||||
background-image: url(header.png);
|
||||
}
|
||||
.bs-header a {
|
||||
color: #fff;
|
||||
font-weight: normal;
|
||||
}
|
||||
.bs-header h1 {
|
||||
color: #fff;
|
||||
}
|
||||
.bs-header p {
|
||||
font-weight: 200;
|
||||
line-height: 1.4;
|
||||
}
|
||||
.bs-header .container {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
@media (min-width: 768px) {
|
||||
.bs-header {
|
||||
font-size: 30px;
|
||||
text-align: left;
|
||||
}
|
||||
.bs-header h1 {
|
||||
font-size: 100px;
|
||||
line-height: 1;
|
||||
}
|
||||
}
|
||||
|
||||
.navbar-inner {
|
||||
-webkit-box-shadow: 0 3px 3px rgba(0,0,0,0.175);
|
||||
box-shadow: 0 3px 3px rgba(0,0,0,0.175);
|
||||
}
|
||||
|
||||
/*
|
||||
* Side navigation
|
||||
*
|
||||
* Scrollspy and affixed enhanced navigation to highlight sections and secondary
|
||||
* sections of docs content.
|
||||
*/
|
||||
|
||||
/* By default it's not affixed in mobile views, so undo that */
|
||||
.bs-sidebar.affix {
|
||||
position: static;
|
||||
}
|
||||
|
||||
/* First level of nav */
|
||||
.bs-sidenav {
|
||||
margin-top: 30px;
|
||||
margin-bottom: 30px;
|
||||
padding-top: 10px;
|
||||
padding-bottom: 10px;
|
||||
text-shadow: 0 1px 0 #fff;
|
||||
background-color: #f7f5fa;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
/* All levels of nav */
|
||||
.bs-sidebar .nav > li > a {
|
||||
display: block;
|
||||
color: #716b7a;
|
||||
padding: 5px 20px;
|
||||
}
|
||||
.bs-sidebar .nav > li > a:hover,
|
||||
.bs-sidebar .nav > li > a:focus {
|
||||
text-decoration: none;
|
||||
background-color: #e5e3e9;
|
||||
border-right: 1px solid #dbd8e0;
|
||||
}
|
||||
.bs-sidebar .nav > .active > a,
|
||||
.bs-sidebar .nav > .active:hover > a,
|
||||
.bs-sidebar .nav > .active:focus > a {
|
||||
font-weight: bold;
|
||||
color: #563d7c;
|
||||
background-color: transparent;
|
||||
border-right: 1px solid #563d7c;
|
||||
}
|
||||
|
||||
/* Nav: second level (shown on .active) */
|
||||
.bs-sidebar .nav .nav {
|
||||
display: none; /* Hide by default, but at >768px, show it */
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
.bs-sidebar .nav .nav > li > a {
|
||||
padding-top: 3px;
|
||||
padding-bottom: 3px;
|
||||
padding-left: 30px;
|
||||
font-size: 90%;
|
||||
}
|
||||
|
||||
/* Show and affix the side nav when space allows it */
|
||||
@media (min-width: 992px) {
|
||||
.bs-sidebar .nav > .active > ul {
|
||||
display: block;
|
||||
}
|
||||
/* Widen the fixed sidebar */
|
||||
.bs-sidebar.affix,
|
||||
.bs-sidebar.affix-bottom {
|
||||
width: 213px;
|
||||
}
|
||||
.bs-sidebar.affix {
|
||||
position: fixed; /* Undo the static from mobile first approach */
|
||||
top: 80px;
|
||||
}
|
||||
.bs-sidebar.affix-bottom {
|
||||
position: absolute; /* Undo the static from mobile first approach */
|
||||
}
|
||||
.bs-sidebar.affix-bottom .bs-sidenav,
|
||||
.bs-sidebar.affix .bs-sidenav {
|
||||
margin-top: 0;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
@media (min-width: 1200px) {
|
||||
/* Widen the fixed sidebar again */
|
||||
.bs-sidebar.affix-bottom,
|
||||
.bs-sidebar.affix {
|
||||
width: 263px;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Not enough room on mobile for markup tab, js tab, and plunk btn.
|
||||
And no one cares about plunk button on a phone anyway */
|
||||
@media only screen and (max-device-width: 480px) {
|
||||
#plunk-btn {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
.navbar-nav .dropdown .navbar-brand {
|
||||
max-width: 100%;
|
||||
margin-right: inherit;
|
||||
margin-left: inherit;
|
||||
}
|
||||
|
||||
.header-placeholder {
|
||||
height: 50px;
|
||||
}
|
||||
|
||||
@media screen and (min-width: 768px) {
|
||||
|
||||
.dropdown.open > .navbar-brand + .dropdown-menu {
|
||||
left: 10px;
|
||||
}
|
||||
|
||||
.header-placeholder {
|
||||
height: 50px;
|
||||
}
|
||||
|
||||
.navbar-nav .dropdown .navbar-brand {
|
||||
max-width: 200px;
|
||||
margin-right: 5px;
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
}
|
||||
|
After Width: | Height: | Size: 8.2 KiB |
|
After Width: | Height: | Size: 398 B |
|
After Width: | Height: | Size: 37 KiB |
|
After Width: | Height: | Size: 8.6 KiB |
|
After Width: | Height: | Size: 12 KiB |
@@ -0,0 +1,60 @@
|
||||
angular.module('plunker', [])
|
||||
|
||||
.factory('plunkGenerator', function ($document) {
|
||||
|
||||
return function (ngVersion, bsVersion, version, module, content) {
|
||||
|
||||
var form = angular.element('<form style="display: none;" method="post" action="https://plnkr.co/edit/?p=preview" target="_blank"></form>');
|
||||
var addField = function (name, value) {
|
||||
var input = angular.element('<input type="hidden" name="' + name + '">');
|
||||
input.attr('value', value);
|
||||
form.append(input);
|
||||
};
|
||||
|
||||
var indexContent = function (content, version) {
|
||||
return '<!doctype html>\n' +
|
||||
'<html ng-app="ui.bootstrap.demo">\n' +
|
||||
' <head>\n' +
|
||||
' <script src="//ajax.googleapis.com/ajax/libs/angularjs/'+ngVersion+'/angular.js"></script>\n' +
|
||||
' <script src="//ajax.googleapis.com/ajax/libs/angularjs/'+ngVersion+'/angular-animate.js"></script>\n' +
|
||||
' <script src="//ajax.googleapis.com/ajax/libs/angularjs/'+ngVersion+'/angular-sanitize.js"></script>\n' +
|
||||
' <script src="//morgul.github.io/bootstrap/ui-bootstrap-tpls-'+version+'.js"></script>\n' +
|
||||
' <script src="example.js"></script>\n' +
|
||||
' <link href="//netdna.bootstrapcdn.com/bootstrap/'+bsVersion+'/css/bootstrap.min.css" rel="stylesheet">\n' +
|
||||
' </head>\n' +
|
||||
' <body>\n\n' +
|
||||
content + '\n' +
|
||||
' </body>\n' +
|
||||
'</html>\n';
|
||||
};
|
||||
|
||||
var scriptContent = function(content) {
|
||||
return "angular.module('ui.bootstrap.demo', ['ngAnimate', 'ngSanitize', 'ui.bootstrap']);" + "\n" + content;
|
||||
};
|
||||
|
||||
addField('description', 'http://angular-ui.github.io/bootstrap/');
|
||||
addField('files[index.html]', indexContent(content.markup, version));
|
||||
addField('files[example.js]', scriptContent(content.javascript));
|
||||
|
||||
$document.find('body').append(form);
|
||||
form[0].submit();
|
||||
form.remove();
|
||||
};
|
||||
})
|
||||
|
||||
.controller('PlunkerCtrl', function ($scope, plunkGenerator) {
|
||||
|
||||
$scope.content = {};
|
||||
|
||||
$scope.edit = function (ngVersion, bsVersion, version, module) {
|
||||
plunkGenerator(ngVersion, bsVersion, version, module, $scope.content);
|
||||
};
|
||||
})
|
||||
|
||||
.directive('plunkerContent', function () {
|
||||
return {
|
||||
link:function (scope, element, attrs) {
|
||||
scope.content[attrs.plunkerContent] = element.text().trim();
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,59 @@
|
||||
/**
|
||||
* Generic language patterns
|
||||
*
|
||||
* @author Craig Campbell
|
||||
* @version 1.0.9
|
||||
*/
|
||||
Rainbow.extend([
|
||||
{
|
||||
'matches': {
|
||||
1: {
|
||||
'name': 'keyword.operator',
|
||||
'pattern': /\=/g
|
||||
},
|
||||
2: {
|
||||
'name': 'string',
|
||||
'matches': {
|
||||
'name': 'constant.character.escape',
|
||||
'pattern': /\\('|"){1}/g
|
||||
}
|
||||
}
|
||||
},
|
||||
'pattern': /(\(|\s|\[|\=|:)(('|")([^\\\1]|\\.)*?(\3))/gm
|
||||
},
|
||||
{
|
||||
'name': 'comment',
|
||||
'pattern': /\/\*[\s\S]*?\*\/|(\/\/|\#)[\s\S]*?$/gm
|
||||
},
|
||||
{
|
||||
'name': 'constant.numeric',
|
||||
'pattern': /\b(\d+(\.\d+)?(e(\+|\-)?\d+)?(f|d)?|0x[\da-f]+)\b/gi
|
||||
},
|
||||
{
|
||||
'matches': {
|
||||
1: 'keyword'
|
||||
},
|
||||
'pattern': /\b(and|array|as|bool(ean)?|c(atch|har|lass|onst)|d(ef|elete|o(uble)?)|e(cho|lse(if)?|xit|xtends|xcept)|f(inally|loat|or(each)?|unction)|global|if|import|int(eger)?|long|new|object|or|pr(int|ivate|otected)|public|return|self|st(ring|ruct|atic)|switch|th(en|is|row)|try|(un)?signed|var|void|while)(?=\(|\b)/gi
|
||||
},
|
||||
{
|
||||
'name': 'constant.language',
|
||||
'pattern': /true|false|null/g
|
||||
},
|
||||
{
|
||||
'name': 'keyword.operator',
|
||||
'pattern': /\+|\!|\-|&(gt|lt|amp);|\||\*|\=/g
|
||||
},
|
||||
{
|
||||
'matches': {
|
||||
1: 'function.call'
|
||||
},
|
||||
'pattern': /(\w+?)(?=\()/g
|
||||
},
|
||||
{
|
||||
'matches': {
|
||||
1: 'storage.function',
|
||||
2: 'entity.name.function'
|
||||
},
|
||||
'pattern': /(function)\s(.*?)(?=\()/g
|
||||
}
|
||||
]);
|
||||
@@ -0,0 +1,83 @@
|
||||
/**
|
||||
* HTML patterns
|
||||
*
|
||||
* @author Craig Campbell
|
||||
* @version 1.0.7
|
||||
*/
|
||||
Rainbow.extend('html', [
|
||||
{
|
||||
'name': 'source.php.embedded',
|
||||
'matches': {
|
||||
2: {
|
||||
'language': 'php'
|
||||
}
|
||||
},
|
||||
'pattern': /<\?=?(?!xml)(php)?([\s\S]*?)(\?>)/gm
|
||||
},
|
||||
{
|
||||
'name': 'source.css.embedded',
|
||||
'matches': {
|
||||
0: {
|
||||
'language': 'css'
|
||||
}
|
||||
},
|
||||
'pattern': /<style(.*?)>([\s\S]*?)<\/style>/gm
|
||||
},
|
||||
{
|
||||
'name': 'source.js.embedded',
|
||||
'matches': {
|
||||
0: {
|
||||
'language': 'javascript'
|
||||
}
|
||||
},
|
||||
'pattern': /<script(?! src)(.*?)>([\s\S]*?)<\/script>/gm
|
||||
},
|
||||
{
|
||||
'name': 'comment.html',
|
||||
'pattern': /<\!--[\S\s]*?-->/g
|
||||
},
|
||||
{
|
||||
'matches': {
|
||||
1: 'support.tag.open',
|
||||
2: 'support.tag.cclose'
|
||||
},
|
||||
'pattern': /(<)|(\/?\??>)/g
|
||||
},
|
||||
{
|
||||
'name': 'support.tag',
|
||||
'matches': {
|
||||
1: 'support.tag',
|
||||
2: 'support.tag.special',
|
||||
3: 'support.tag-name'
|
||||
},
|
||||
'pattern': /(<\??)(\/|\!?)(\w+)/g
|
||||
},
|
||||
{
|
||||
'matches': {
|
||||
1: 'support.attribute'
|
||||
},
|
||||
'pattern': /([a-z-]+)(?=\=)/gi
|
||||
},
|
||||
{
|
||||
'matches': {
|
||||
1: 'support.operator',
|
||||
2: 'string.quote',
|
||||
3: 'string.value',
|
||||
4: 'string.quote'
|
||||
},
|
||||
'pattern': /(=)('|")(.*?)(\2)/g
|
||||
},
|
||||
{
|
||||
'matches': {
|
||||
1: 'support.operator',
|
||||
2: 'support.value'
|
||||
},
|
||||
'pattern': /(=)([a-zA-Z\-0-9]*)\b/g
|
||||
},
|
||||
{
|
||||
'matches': {
|
||||
1: 'support.attribute'
|
||||
},
|
||||
'pattern': /\s(\w+)(?=\s|>)(?![\s\S]*<)/g
|
||||
}
|
||||
], true);
|
||||
@@ -0,0 +1,110 @@
|
||||
/**
|
||||
* Javascript patterns
|
||||
*
|
||||
* @author Craig Campbell
|
||||
* @version 1.0.7
|
||||
*/
|
||||
Rainbow.extend('javascript', [
|
||||
|
||||
/**
|
||||
* matches $. or $(
|
||||
*/
|
||||
{
|
||||
'name': 'selector',
|
||||
'pattern': /(\s|^)\$(?=\.|\()/g
|
||||
},
|
||||
{
|
||||
'name': 'support',
|
||||
'pattern': /\b(window|document)\b/g
|
||||
},
|
||||
{
|
||||
'matches': {
|
||||
1: 'support.property'
|
||||
},
|
||||
'pattern': /\.(length|node(Name|Value))\b/g
|
||||
},
|
||||
{
|
||||
'matches': {
|
||||
1: 'support.function'
|
||||
},
|
||||
'pattern': /(setTimeout|setInterval)(?=\()/g
|
||||
|
||||
},
|
||||
{
|
||||
'matches': {
|
||||
1: 'support.method'
|
||||
},
|
||||
'pattern': /\.(getAttribute|push|getElementById|getElementsByClassName|log|setTimeout|setInterval)(?=\()/g
|
||||
},
|
||||
{
|
||||
'matches': {
|
||||
1: 'support.tag.script',
|
||||
2: [
|
||||
{
|
||||
'name': 'string',
|
||||
'pattern': /('|")(.*?)(\1)/g
|
||||
},
|
||||
{
|
||||
'name': 'entity.tag.script',
|
||||
'pattern': /(\w+)/g
|
||||
}
|
||||
],
|
||||
3: 'support.tag.script'
|
||||
},
|
||||
'pattern': /(<\/?)(script.*?)(>)/g
|
||||
},
|
||||
|
||||
/**
|
||||
* matches any escaped characters inside of a js regex pattern
|
||||
*
|
||||
* @see https://github.com/ccampbell/rainbow/issues/22
|
||||
*
|
||||
* this was causing single line comments to fail so it now makes sure
|
||||
* the opening / is not directly followed by a *
|
||||
*
|
||||
* @todo check that there is valid regex in match group 1
|
||||
*/
|
||||
{
|
||||
'name': 'string.regexp',
|
||||
'matches': {
|
||||
1: 'string.regexp.open',
|
||||
2: {
|
||||
'name': 'constant.regexp.escape',
|
||||
'pattern': /\\(.){1}/g
|
||||
},
|
||||
3: 'string.regexp.cclose',
|
||||
4: 'string.regexp.modifier'
|
||||
},
|
||||
'pattern': /(\/)(?!\*)(.+)(\/)([igm]{0,3})/g
|
||||
},
|
||||
|
||||
/**
|
||||
* matches runtime function declarations
|
||||
*/
|
||||
{
|
||||
'matches': {
|
||||
1: 'storage',
|
||||
3: 'entity.function'
|
||||
},
|
||||
'pattern': /(var)?(\s|^)(.*)(?=\s?=\s?function\()/g
|
||||
},
|
||||
|
||||
/**
|
||||
* matches constructor call
|
||||
*/
|
||||
{
|
||||
'matches': {
|
||||
1: 'keyword',
|
||||
2: 'entity.function'
|
||||
},
|
||||
'pattern': /(new)\s+(.*)(?=\()/g
|
||||
},
|
||||
|
||||
/**
|
||||
* matches any function call in the style functionName: function()
|
||||
*/
|
||||
{
|
||||
'name': 'entity.function',
|
||||
'pattern': /(\w+)(?=:\s{0,}function)/g
|
||||
}
|
||||
]);
|
||||
@@ -0,0 +1,88 @@
|
||||
/**
|
||||
* GitHub theme
|
||||
*
|
||||
* @author Craig Campbell
|
||||
* @version 1.0.4
|
||||
*/
|
||||
pre {
|
||||
border: 1px solid #ccc;
|
||||
word-wrap: break-word;
|
||||
padding: 6px 10px;
|
||||
line-height: 19px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
code {
|
||||
border: 1px solid #eaeaea;
|
||||
margin: 0 2px;
|
||||
padding: 0 5px;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
pre code {
|
||||
border: 0;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
-moz-border-radius: 0;
|
||||
-webkit-border-radius: 0;
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
pre, code {
|
||||
font-family: Consolas, 'Liberation Mono', Courier, monospace;
|
||||
color: #333;
|
||||
background: #f8f8f8;
|
||||
-moz-border-radius: 3px;
|
||||
-webkit-border-radius: 3px;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
pre, pre code {
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
pre .comment {
|
||||
color: #998;
|
||||
}
|
||||
|
||||
pre .support {
|
||||
color: #0086B3;
|
||||
}
|
||||
|
||||
pre .tag, pre .tag-name {
|
||||
color: navy;
|
||||
}
|
||||
|
||||
pre .keyword, pre .css-property, pre .vendor-prefix, pre .sass, pre .class, pre .id, pre .css-value, pre .entity.function, pre .storage.function {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
pre .css-property, pre .css-value, pre .vendor-prefix, pre .support.namespace {
|
||||
color: #333;
|
||||
}
|
||||
|
||||
pre .constant.numeric, pre .keyword.unit, pre .hex-color {
|
||||
font-weight: normal;
|
||||
color: #099;
|
||||
}
|
||||
|
||||
pre .entity.class {
|
||||
color: #458;
|
||||
}
|
||||
|
||||
pre .entity.id, pre .entity.function {
|
||||
color: #900;
|
||||
}
|
||||
|
||||
pre .attribute, pre .variable {
|
||||
color: teal;
|
||||
}
|
||||
|
||||
pre .string, pre .support.value {
|
||||
font-weight: normal;
|
||||
color: #d14;
|
||||
}
|
||||
|
||||
pre .regexp {
|
||||
color: #009926;
|
||||
}
|
||||
@@ -0,0 +1,773 @@
|
||||
/**
|
||||
* Copyright 2012 Craig Campbell
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* Rainbow is a simple code syntax highlighter
|
||||
*
|
||||
* @preserve @version 1.1.8
|
||||
* @url rainbowco.de
|
||||
*/
|
||||
window['Rainbow'] = (function() {
|
||||
|
||||
/**
|
||||
* array of replacements to process at the end
|
||||
*
|
||||
* @type {Object}
|
||||
*/
|
||||
var replacements = {},
|
||||
|
||||
/**
|
||||
* an array of start and end positions of blocks to be replaced
|
||||
*
|
||||
* @type {Object}
|
||||
*/
|
||||
replacement_positions = {},
|
||||
|
||||
/**
|
||||
* an array of the language patterns specified for each language
|
||||
*
|
||||
* @type {Object}
|
||||
*/
|
||||
language_patterns = {},
|
||||
|
||||
/**
|
||||
* an array of languages and whether they should bypass the default patterns
|
||||
*
|
||||
* @type {Object}
|
||||
*/
|
||||
bypass_defaults = {},
|
||||
|
||||
/**
|
||||
* processing level
|
||||
*
|
||||
* replacements are stored at this level so if there is a sub block of code
|
||||
* (for example php inside of html) it runs at a different level
|
||||
*
|
||||
* @type {number}
|
||||
*/
|
||||
CURRENT_LEVEL = 0,
|
||||
|
||||
/**
|
||||
* constant used to refer to the default language
|
||||
*
|
||||
* @type {number}
|
||||
*/
|
||||
DEFAULT_LANGUAGE = 0,
|
||||
|
||||
/**
|
||||
* used as counters so we can selectively call setTimeout
|
||||
* after processing a certain number of matches/replacements
|
||||
*
|
||||
* @type {number}
|
||||
*/
|
||||
match_counter = 0,
|
||||
|
||||
/**
|
||||
* @type {number}
|
||||
*/
|
||||
replacement_counter = 0,
|
||||
|
||||
/**
|
||||
* @type {null|string}
|
||||
*/
|
||||
global_class,
|
||||
|
||||
/**
|
||||
* @type {null|Function}
|
||||
*/
|
||||
onHighlight;
|
||||
|
||||
/**
|
||||
* cross browser get attribute for an element
|
||||
*
|
||||
* @see http://stackoverflow.com/questions/3755227/cross-browser-javascript-getattribute-method
|
||||
*
|
||||
* @param {Node} el
|
||||
* @param {string} attr attribute you are trying to get
|
||||
* @returns {string|number}
|
||||
*/
|
||||
function _attr(el, attr, attrs, i) {
|
||||
var result = (el.getAttribute && el.getAttribute(attr)) || 0;
|
||||
|
||||
if (!result) {
|
||||
attrs = el.attributes;
|
||||
|
||||
for (i = 0; i < attrs.length; ++i) {
|
||||
if (attrs[i].nodeName === attr) {
|
||||
return attrs[i].nodeValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* adds a class to a given code block
|
||||
*
|
||||
* @param {Element} el
|
||||
* @param {string} class_name class name to add
|
||||
* @returns void
|
||||
*/
|
||||
function _addClass(el, class_name) {
|
||||
el.className += el.className ? ' ' + class_name : class_name;
|
||||
}
|
||||
|
||||
/**
|
||||
* checks if a block has a given class
|
||||
*
|
||||
* @param {Element} el
|
||||
* @param {string} class_name class name to check for
|
||||
* @returns {boolean}
|
||||
*/
|
||||
function _hasClass(el, class_name) {
|
||||
return (' ' + el.className + ' ').indexOf(' ' + class_name + ' ') > -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* gets the language for this block of code
|
||||
*
|
||||
* @param {Element} block
|
||||
* @returns {string|null}
|
||||
*/
|
||||
function _getLanguageForBlock(block) {
|
||||
|
||||
// if this doesn't have a language but the parent does then use that
|
||||
// this means if for example you have: <pre data-language="php">
|
||||
// with a bunch of <code> blocks inside then you do not have
|
||||
// to specify the language for each block
|
||||
var language = _attr(block, 'data-language') || _attr(block.parentNode, 'data-language');
|
||||
|
||||
// this adds support for specifying language via a css class
|
||||
// you can use the Google Code Prettify style: <pre class="lang-php">
|
||||
// or the HTML5 style: <pre><code class="language-php">
|
||||
if (!language) {
|
||||
var pattern = /\blang(?:uage)?-(\w+)/,
|
||||
match = block.className.match(pattern) || block.parentNode.className.match(pattern);
|
||||
|
||||
if (match) {
|
||||
language = match[1];
|
||||
}
|
||||
}
|
||||
|
||||
return language;
|
||||
}
|
||||
|
||||
/**
|
||||
* makes sure html entities are always used for tags
|
||||
*
|
||||
* @param {string} code
|
||||
* @returns {string}
|
||||
*/
|
||||
function _htmlEntities(code) {
|
||||
return code.replace(/</g, '<').replace(/>/g, '>').replace(/&(?![\w\#]+;)/g, '&');
|
||||
}
|
||||
|
||||
/**
|
||||
* determines if a new match intersects with an existing one
|
||||
*
|
||||
* @param {number} start1 start position of existing match
|
||||
* @param {number} end1 end position of existing match
|
||||
* @param {number} start2 start position of new match
|
||||
* @param {number} end2 end position of new match
|
||||
* @returns {boolean}
|
||||
*/
|
||||
function _intersects(start1, end1, start2, end2) {
|
||||
if (start2 >= start1 && start2 < end1) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return end2 > start1 && end2 < end1;
|
||||
}
|
||||
|
||||
/**
|
||||
* determines if two different matches have complete overlap with each other
|
||||
*
|
||||
* @param {number} start1 start position of existing match
|
||||
* @param {number} end1 end position of existing match
|
||||
* @param {number} start2 start position of new match
|
||||
* @param {number} end2 end position of new match
|
||||
* @returns {boolean}
|
||||
*/
|
||||
function _hasCompleteOverlap(start1, end1, start2, end2) {
|
||||
|
||||
// if the starting and end positions are exactly the same
|
||||
// then the first one should stay and this one should be ignored
|
||||
if (start2 == start1 && end2 == end1) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return start2 <= start1 && end2 >= end1;
|
||||
}
|
||||
|
||||
/**
|
||||
* determines if the match passed in falls inside of an existing match
|
||||
* this prevents a regex pattern from matching inside of a bigger pattern
|
||||
*
|
||||
* @param {number} start - start position of new match
|
||||
* @param {number} end - end position of new match
|
||||
* @returns {boolean}
|
||||
*/
|
||||
function _matchIsInsideOtherMatch(start, end) {
|
||||
for (var key in replacement_positions[CURRENT_LEVEL]) {
|
||||
key = parseInt(key, 10);
|
||||
|
||||
// if this block completely overlaps with another block
|
||||
// then we should remove the other block and return false
|
||||
if (_hasCompleteOverlap(key, replacement_positions[CURRENT_LEVEL][key], start, end)) {
|
||||
delete replacement_positions[CURRENT_LEVEL][key];
|
||||
delete replacements[CURRENT_LEVEL][key];
|
||||
}
|
||||
|
||||
if (_intersects(key, replacement_positions[CURRENT_LEVEL][key], start, end)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* takes a string of code and wraps it in a span tag based on the name
|
||||
*
|
||||
* @param {string} name name of the pattern (ie keyword.regex)
|
||||
* @param {string} code block of code to wrap
|
||||
* @returns {string}
|
||||
*/
|
||||
function _wrapCodeInSpan(name, code) {
|
||||
return '<span class="' + name.replace(/\./g, ' ') + (global_class ? ' ' + global_class : '') + '">' + code + '</span>';
|
||||
}
|
||||
|
||||
/**
|
||||
* finds out the position of group match for a regular expression
|
||||
*
|
||||
* @see http://stackoverflow.com/questions/1985594/how-to-find-index-of-groups-in-match
|
||||
*
|
||||
* @param {Object} match
|
||||
* @param {number} group_number
|
||||
* @returns {number}
|
||||
*/
|
||||
function _indexOfGroup(match, group_number) {
|
||||
var index = 0,
|
||||
i;
|
||||
|
||||
for (i = 1; i < group_number; ++i) {
|
||||
if (match[i]) {
|
||||
index += match[i].length;
|
||||
}
|
||||
}
|
||||
|
||||
return index;
|
||||
}
|
||||
|
||||
/**
|
||||
* matches a regex pattern against a block of code
|
||||
* finds all matches that should be processed and stores the positions
|
||||
* of where they should be replaced within the string
|
||||
*
|
||||
* this is where pretty much all the work is done but it should not
|
||||
* be called directly
|
||||
*
|
||||
* @param {RegExp} pattern
|
||||
* @param {string} code
|
||||
* @returns void
|
||||
*/
|
||||
function _processPattern(regex, pattern, code, callback)
|
||||
{
|
||||
var match = regex.exec(code);
|
||||
|
||||
if (!match) {
|
||||
return callback();
|
||||
}
|
||||
|
||||
++match_counter;
|
||||
|
||||
// treat match 0 the same way as name
|
||||
if (!pattern['name'] && typeof pattern['matches'][0] == 'string') {
|
||||
pattern['name'] = pattern['matches'][0];
|
||||
delete pattern['matches'][0];
|
||||
}
|
||||
|
||||
var replacement = match[0],
|
||||
start_pos = match.index,
|
||||
end_pos = match[0].length + start_pos,
|
||||
|
||||
/**
|
||||
* callback to process the next match of this pattern
|
||||
*/
|
||||
processNext = function() {
|
||||
var nextCall = function() {
|
||||
_processPattern(regex, pattern, code, callback);
|
||||
};
|
||||
|
||||
// every 50 items we process let's call set timeout
|
||||
// to let the ui breathe a little
|
||||
return match_counter % 50 > 0 ? nextCall() : setTimeout(nextCall, 0);
|
||||
};
|
||||
|
||||
// if this is not a child match and it falls inside of another
|
||||
// match that already happened we should skip it and continue processing
|
||||
if (_matchIsInsideOtherMatch(start_pos, end_pos)) {
|
||||
return processNext();
|
||||
}
|
||||
|
||||
/**
|
||||
* callback for when a match was successfully processed
|
||||
*
|
||||
* @param {string} replacement
|
||||
* @returns void
|
||||
*/
|
||||
var onMatchSuccess = function(replacement) {
|
||||
// if this match has a name then wrap it in a span tag
|
||||
if (pattern['name']) {
|
||||
replacement = _wrapCodeInSpan(pattern['name'], replacement);
|
||||
}
|
||||
|
||||
// console.log('LEVEL', CURRENT_LEVEL, 'replace', match[0], 'with', replacement, 'at position', start_pos, 'to', end_pos);
|
||||
|
||||
// store what needs to be replaced with what at this position
|
||||
if (!replacements[CURRENT_LEVEL]) {
|
||||
replacements[CURRENT_LEVEL] = {};
|
||||
replacement_positions[CURRENT_LEVEL] = {};
|
||||
}
|
||||
|
||||
replacements[CURRENT_LEVEL][start_pos] = {
|
||||
'replace': match[0],
|
||||
'with': replacement
|
||||
};
|
||||
|
||||
// store the range of this match so we can use it for comparisons
|
||||
// with other matches later
|
||||
replacement_positions[CURRENT_LEVEL][start_pos] = end_pos;
|
||||
|
||||
// process the next match
|
||||
processNext();
|
||||
},
|
||||
|
||||
// if this pattern has sub matches for different groups in the regex
|
||||
// then we should process them one at a time by rerunning them through
|
||||
// this function to generate the new replacement
|
||||
//
|
||||
// we run through them backwards because the match position of earlier
|
||||
// matches will not change depending on what gets replaced in later
|
||||
// matches
|
||||
group_keys = keys(pattern['matches']),
|
||||
|
||||
/**
|
||||
* callback for processing a sub group
|
||||
*
|
||||
* @param {number} i
|
||||
* @param {Array} group_keys
|
||||
* @param {Function} callback
|
||||
*/
|
||||
processGroup = function(i, group_keys, callback) {
|
||||
if (i >= group_keys.length) {
|
||||
return callback(replacement);
|
||||
}
|
||||
|
||||
var processNextGroup = function() {
|
||||
processGroup(++i, group_keys, callback);
|
||||
},
|
||||
block = match[group_keys[i]];
|
||||
|
||||
// if there is no match here then move on
|
||||
if (!block) {
|
||||
return processNextGroup();
|
||||
}
|
||||
|
||||
var group = pattern['matches'][group_keys[i]],
|
||||
language = group['language'],
|
||||
|
||||
/**
|
||||
* process group is what group we should use to actually process
|
||||
* this match group
|
||||
*
|
||||
* for example if the subgroup pattern looks like this
|
||||
* 2: {
|
||||
* 'name': 'keyword',
|
||||
* 'pattern': /true/g
|
||||
* }
|
||||
*
|
||||
* then we use that as is, but if it looks like this
|
||||
*
|
||||
* 2: {
|
||||
* 'name': 'keyword',
|
||||
* 'matches': {
|
||||
* 'name': 'special',
|
||||
* 'pattern': /whatever/g
|
||||
* }
|
||||
* }
|
||||
*
|
||||
* we treat the 'matches' part as the pattern and keep
|
||||
* the name around to wrap it with later
|
||||
*/
|
||||
process_group = group['name'] && group['matches'] ? group['matches'] : group,
|
||||
|
||||
/**
|
||||
* takes the code block matched at this group, replaces it
|
||||
* with the highlighted block, and optionally wraps it with
|
||||
* a span with a name
|
||||
*
|
||||
* @param {string} block
|
||||
* @param {string} replace_block
|
||||
* @param {string|null} match_name
|
||||
*/
|
||||
_replaceAndContinue = function(block, replace_block, match_name) {
|
||||
replacement = _replaceAtPosition(_indexOfGroup(match, group_keys[i]), block, match_name ? _wrapCodeInSpan(match_name, replace_block) : replace_block, replacement);
|
||||
processNextGroup();
|
||||
};
|
||||
|
||||
// if this is a sublanguage go and process the block using that language
|
||||
if (language) {
|
||||
return _highlightBlockForLanguage(block, language, function(code) {
|
||||
_replaceAndContinue(block, code);
|
||||
});
|
||||
}
|
||||
|
||||
// if this is a string then this match is directly mapped to selector
|
||||
// so all we have to do is wrap it in a span and continue
|
||||
if (typeof group === 'string') {
|
||||
return _replaceAndContinue(block, block, group);
|
||||
}
|
||||
|
||||
// the process group can be a single pattern or an array of patterns
|
||||
// _processCodeWithPatterns always expects an array so we convert it here
|
||||
_processCodeWithPatterns(block, process_group.length ? process_group : [process_group], function(code) {
|
||||
_replaceAndContinue(block, code, group['matches'] ? group['name'] : 0);
|
||||
});
|
||||
};
|
||||
|
||||
processGroup(0, group_keys, onMatchSuccess);
|
||||
}
|
||||
|
||||
/**
|
||||
* should a language bypass the default patterns?
|
||||
*
|
||||
* if you call Rainbow.extend() and pass true as the third argument
|
||||
* it will bypass the defaults
|
||||
*/
|
||||
function _bypassDefaultPatterns(language)
|
||||
{
|
||||
return bypass_defaults[language];
|
||||
}
|
||||
|
||||
/**
|
||||
* returns a list of regex patterns for this language
|
||||
*
|
||||
* @param {string} language
|
||||
* @returns {Array}
|
||||
*/
|
||||
function _getPatternsForLanguage(language) {
|
||||
var patterns = language_patterns[language] || [],
|
||||
default_patterns = language_patterns[DEFAULT_LANGUAGE] || [];
|
||||
|
||||
return _bypassDefaultPatterns(language) ? patterns : patterns.concat(default_patterns);
|
||||
}
|
||||
|
||||
/**
|
||||
* substring replace call to replace part of a string at a certain position
|
||||
*
|
||||
* @param {number} position the position where the replacement should happen
|
||||
* @param {string} replace the text we want to replace
|
||||
* @param {string} replace_with the text we want to replace it with
|
||||
* @param {string} code the code we are doing the replacing in
|
||||
* @returns {string}
|
||||
*/
|
||||
function _replaceAtPosition(position, replace, replace_with, code) {
|
||||
var sub_string = code.substr(position);
|
||||
return code.substr(0, position) + sub_string.replace(replace, replace_with);
|
||||
}
|
||||
|
||||
/**
|
||||
* sorts an object by index descending
|
||||
*
|
||||
* @param {Object} object
|
||||
* @return {Array}
|
||||
*/
|
||||
function keys(object) {
|
||||
var locations = [],
|
||||
replacement,
|
||||
pos;
|
||||
|
||||
for(var location in object) {
|
||||
if (object.hasOwnProperty(location)) {
|
||||
locations.push(location);
|
||||
}
|
||||
}
|
||||
|
||||
// numeric descending
|
||||
return locations.sort(function(a, b) {
|
||||
return b - a;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* processes a block of code using specified patterns
|
||||
*
|
||||
* @param {string} code
|
||||
* @param {Array} patterns
|
||||
* @returns void
|
||||
*/
|
||||
function _processCodeWithPatterns(code, patterns, callback)
|
||||
{
|
||||
// we have to increase the level here so that the
|
||||
// replacements will not conflict with each other when
|
||||
// processing sub blocks of code
|
||||
++CURRENT_LEVEL;
|
||||
|
||||
// patterns are processed one at a time through this function
|
||||
function _workOnPatterns(patterns, i)
|
||||
{
|
||||
// still have patterns to process, keep going
|
||||
if (i < patterns.length) {
|
||||
return _processPattern(patterns[i]['pattern'], patterns[i], code, function() {
|
||||
_workOnPatterns(patterns, ++i);
|
||||
});
|
||||
}
|
||||
|
||||
// we are done processing the patterns
|
||||
// process the replacements and update the DOM
|
||||
_processReplacements(code, function(code) {
|
||||
|
||||
// when we are done processing replacements
|
||||
// we are done at this level so we can go back down
|
||||
delete replacements[CURRENT_LEVEL];
|
||||
delete replacement_positions[CURRENT_LEVEL];
|
||||
--CURRENT_LEVEL;
|
||||
callback(code);
|
||||
});
|
||||
}
|
||||
|
||||
_workOnPatterns(patterns, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* process replacements in the string of code to actually update the markup
|
||||
*
|
||||
* @param {string} code the code to process replacements in
|
||||
* @param {Function} onComplete what to do when we are done processing
|
||||
* @returns void
|
||||
*/
|
||||
function _processReplacements(code, onComplete) {
|
||||
|
||||
/**
|
||||
* processes a single replacement
|
||||
*
|
||||
* @param {string} code
|
||||
* @param {Array} positions
|
||||
* @param {number} i
|
||||
* @param {Function} onComplete
|
||||
* @returns void
|
||||
*/
|
||||
function _processReplacement(code, positions, i, onComplete) {
|
||||
if (i < positions.length) {
|
||||
++replacement_counter;
|
||||
var pos = positions[i],
|
||||
replacement = replacements[CURRENT_LEVEL][pos];
|
||||
code = _replaceAtPosition(pos, replacement['replace'], replacement['with'], code);
|
||||
|
||||
// process next function
|
||||
var next = function() {
|
||||
_processReplacement(code, positions, ++i, onComplete);
|
||||
};
|
||||
|
||||
// use a timeout every 250 to not freeze up the UI
|
||||
return replacement_counter % 250 > 0 ? next() : setTimeout(next, 0);
|
||||
}
|
||||
|
||||
onComplete(code);
|
||||
}
|
||||
|
||||
var string_positions = keys(replacements[CURRENT_LEVEL]);
|
||||
_processReplacement(code, string_positions, 0, onComplete);
|
||||
}
|
||||
|
||||
/**
|
||||
* takes a string of code and highlights it according to the language specified
|
||||
*
|
||||
* @param {string} code
|
||||
* @param {string} language
|
||||
* @param {Function} onComplete
|
||||
* @returns void
|
||||
*/
|
||||
function _highlightBlockForLanguage(code, language, onComplete) {
|
||||
var patterns = _getPatternsForLanguage(language);
|
||||
_processCodeWithPatterns(_htmlEntities(code), patterns, onComplete);
|
||||
}
|
||||
|
||||
/**
|
||||
* highlight an individual code block
|
||||
*
|
||||
* @param {Array} code_blocks
|
||||
* @param {number} i
|
||||
* @returns void
|
||||
*/
|
||||
function _highlightCodeBlock(code_blocks, i, onComplete) {
|
||||
if (i < code_blocks.length) {
|
||||
var block = code_blocks[i],
|
||||
language = _getLanguageForBlock(block);
|
||||
|
||||
if (!_hasClass(block, 'rainbow') && language) {
|
||||
language = language.toLowerCase();
|
||||
|
||||
_addClass(block, 'rainbow');
|
||||
|
||||
return _highlightBlockForLanguage(block.innerHTML, language, function(code) {
|
||||
block.innerHTML = code;
|
||||
|
||||
// reset the replacement arrays
|
||||
replacements = {};
|
||||
replacement_positions = {};
|
||||
|
||||
// if you have a listener attached tell it that this block is now highlighted
|
||||
if (onHighlight) {
|
||||
onHighlight(block, language);
|
||||
}
|
||||
|
||||
// process the next block
|
||||
setTimeout(function() {
|
||||
_highlightCodeBlock(code_blocks, ++i, onComplete);
|
||||
}, 0);
|
||||
});
|
||||
}
|
||||
return _highlightCodeBlock(code_blocks, ++i, onComplete);
|
||||
}
|
||||
|
||||
if (onComplete) {
|
||||
onComplete();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* start highlighting all the code blocks
|
||||
*
|
||||
* @returns void
|
||||
*/
|
||||
function _highlight(node, onComplete) {
|
||||
|
||||
// the first argument can be an Event or a DOM Element
|
||||
// I was originally checking instanceof Event but that makes it break
|
||||
// when using mootools
|
||||
//
|
||||
// @see https://github.com/ccampbell/rainbow/issues/32
|
||||
//
|
||||
node = node && typeof node.getElementsByTagName == 'function' ? node : document;
|
||||
|
||||
var pre_blocks = node.getElementsByTagName('pre'),
|
||||
code_blocks = node.getElementsByTagName('code'),
|
||||
i,
|
||||
final_blocks = [];
|
||||
|
||||
// @see http://stackoverflow.com/questions/2735067/how-to-convert-a-dom-node-list-to-an-array-in-javascript
|
||||
// we are going to process all <code> blocks
|
||||
for (i = 0; i < code_blocks.length; ++i) {
|
||||
final_blocks.push(code_blocks[i]);
|
||||
}
|
||||
|
||||
// loop through the pre blocks to see which ones we should add
|
||||
for (i = 0; i < pre_blocks.length; ++i) {
|
||||
|
||||
// if the pre block has no code blocks then process it directly
|
||||
if (!pre_blocks[i].getElementsByTagName('code').length) {
|
||||
final_blocks.push(pre_blocks[i]);
|
||||
}
|
||||
}
|
||||
|
||||
_highlightCodeBlock(final_blocks, 0, onComplete);
|
||||
}
|
||||
|
||||
/**
|
||||
* public methods
|
||||
*/
|
||||
return {
|
||||
|
||||
/**
|
||||
* extends the language pattern matches
|
||||
*
|
||||
* @param {*} language name of language
|
||||
* @param {*} patterns array of patterns to add on
|
||||
* @param {boolean|null} bypass if true this will bypass the default language patterns
|
||||
*/
|
||||
extend: function(language, patterns, bypass) {
|
||||
|
||||
// if there is only one argument then we assume that we want to
|
||||
// extend the default language rules
|
||||
if (arguments.length == 1) {
|
||||
patterns = language;
|
||||
language = DEFAULT_LANGUAGE;
|
||||
}
|
||||
|
||||
bypass_defaults[language] = bypass;
|
||||
language_patterns[language] = patterns.concat(language_patterns[language] || []);
|
||||
},
|
||||
|
||||
/**
|
||||
* call back to let you do stuff in your app after a piece of code has been highlighted
|
||||
*
|
||||
* @param {Function} callback
|
||||
*/
|
||||
onHighlight: function(callback) {
|
||||
onHighlight = callback;
|
||||
},
|
||||
|
||||
/**
|
||||
* method to set a global class that will be applied to all spans
|
||||
*
|
||||
* @param {string} class_name
|
||||
*/
|
||||
addClass: function(class_name) {
|
||||
global_class = class_name;
|
||||
},
|
||||
|
||||
/**
|
||||
* starts the magic rainbow
|
||||
*
|
||||
* @returns void
|
||||
*/
|
||||
color: function() {
|
||||
|
||||
// if you want to straight up highlight a string you can pass the string of code,
|
||||
// the language, and a callback function
|
||||
if (typeof arguments[0] == 'string') {
|
||||
return _highlightBlockForLanguage(arguments[0], arguments[1], arguments[2]);
|
||||
}
|
||||
|
||||
// if you pass a callback function then we rerun the color function
|
||||
// on all the code and call the callback function on complete
|
||||
if (typeof arguments[0] == 'function') {
|
||||
return _highlight(0, arguments[0]);
|
||||
}
|
||||
|
||||
// otherwise we use whatever node you passed in with an optional
|
||||
// callback function as the second parameter
|
||||
_highlight(arguments[0], arguments[1]);
|
||||
}
|
||||
};
|
||||
}) ();
|
||||
|
||||
/**
|
||||
* adds event listener to start highlighting
|
||||
*/
|
||||
(function() {
|
||||
if (window.addEventListener) {
|
||||
return window.addEventListener('load', Rainbow.color, false);
|
||||
}
|
||||
window.attachEvent('onload', Rainbow.color);
|
||||
}) ();
|
||||
|
||||
// When using Google closure compiler in advanced mode some methods
|
||||
// get renamed. This keeps a public reference to these methods so they can
|
||||
// still be referenced from outside this library.
|
||||
Rainbow["onHighlight"] = Rainbow.onHighlight;
|
||||
Rainbow["addClass"] = Rainbow.addClass;
|
||||
@@ -0,0 +1,97 @@
|
||||
/*
|
||||
* https://github.com/alicelieutier/smoothScroll/
|
||||
* A teeny tiny, standard compliant, smooth scroll script with ease-in-out effect and no jQuery (or any other dependancy, FWIW).
|
||||
* MIT License
|
||||
*/
|
||||
window.smoothScroll = (function(){
|
||||
// We do not want this script to be applied in browsers that do not support those
|
||||
// That means no smoothscroll on IE9 and below.
|
||||
if(document.querySelectorAll === void 0 || window.pageYOffset === void 0 || history.pushState === void 0) { return; }
|
||||
|
||||
// Get the top position of an element in the document
|
||||
var getTop = function(element) {
|
||||
// return value of html.getBoundingClientRect().top ... IE : 0, other browsers : -pageYOffset
|
||||
if(element.nodeName === 'HTML') return -window.pageYOffset
|
||||
return element.getBoundingClientRect().top + window.pageYOffset;
|
||||
}
|
||||
// ease in out function thanks to:
|
||||
// http://blog.greweb.fr/2012/02/bezier-curve-based-easing-functions-from-concept-to-implementation/
|
||||
var easeInOutCubic = function (t) { return t<.5 ? 4*t*t*t : (t-1)*(2*t-2)*(2*t-2)+1 }
|
||||
|
||||
// calculate the scroll position we should be in
|
||||
// given the start and end point of the scroll
|
||||
// the time elapsed from the beginning of the scroll
|
||||
// and the total duration of the scroll (default 500ms)
|
||||
var position = function(start, end, elapsed, duration) {
|
||||
if (elapsed > duration) return end;
|
||||
return start + (end - start) * easeInOutCubic(elapsed / duration); // <-- you can change the easing funtion there
|
||||
// return start + (end - start) * (elapsed / duration); // <-- this would give a linear scroll
|
||||
}
|
||||
|
||||
// we use requestAnimationFrame to be called by the browser before every repaint
|
||||
// if the first argument is an element then scroll to the top of this element
|
||||
// if the first argument is numeric then scroll to this location
|
||||
// if the callback exist, it is called when the scrolling is finished
|
||||
var smoothScroll = function(el, duration, callback){
|
||||
duration = duration || 500;
|
||||
var start = window.pageYOffset;
|
||||
|
||||
if (typeof el === 'number') {
|
||||
var end = parseInt(el);
|
||||
} else {
|
||||
var end = getTop(el);
|
||||
}
|
||||
|
||||
var clock = Date.now();
|
||||
var requestAnimationFrame = window.requestAnimationFrame ||
|
||||
window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame ||
|
||||
function(fn){window.setTimeout(fn, 15);};
|
||||
|
||||
var step = function(){
|
||||
var elapsed = Date.now() - clock;
|
||||
window.scroll(0, position(start, end, elapsed, duration));
|
||||
if (elapsed > duration) {
|
||||
if (typeof callback === 'function') {
|
||||
callback(el);
|
||||
}
|
||||
} else {
|
||||
requestAnimationFrame(step);
|
||||
}
|
||||
}
|
||||
step();
|
||||
}
|
||||
|
||||
var linkHandler = function(ev) {
|
||||
ev.preventDefault();
|
||||
|
||||
if (location.hash !== this.hash) {
|
||||
//NOTE(@ajoslin): Changed this line to stop $digest errors
|
||||
//window.history.pushState(null, null, this.hash)
|
||||
angular.element(document).injector().get('$location').hash(this.hash);
|
||||
}
|
||||
// using the history api to solve issue #1 - back doesn't work
|
||||
// most browser don't update :target when the history api is used:
|
||||
// THIS IS A BUG FROM THE BROWSERS.
|
||||
// change the scrolling duration in this call
|
||||
var targetEl = document.getElementById(this.hash.substring(1));
|
||||
if (targetEl) {
|
||||
smoothScroll(document.getElementById(this.hash.substring(1)), 500, function(el) {
|
||||
location.replace('#' + el.id)
|
||||
// this will cause the :target to be activated.
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// We look for all the internal links in the documents and attach the smoothscroll function
|
||||
document.addEventListener("DOMContentLoaded", function () {
|
||||
var internal = document.querySelectorAll('a[href^="#"]'), a;
|
||||
for(var i=internal.length; a=internal[--i];){
|
||||
a.addEventListener("click", linkHandler, false);
|
||||
}
|
||||
});
|
||||
|
||||
// return smoothscroll API
|
||||
return smoothScroll;
|
||||
|
||||
})();
|
||||
|
||||
@@ -0,0 +1,115 @@
|
||||
/* Include this file in your html if you are using the CSP mode. */
|
||||
|
||||
.ng-animate.item:not(.left):not(.right) {
|
||||
-webkit-transition: 0s ease-in-out left;
|
||||
transition: 0s ease-in-out left
|
||||
}
|
||||
.uib-datepicker .uib-title {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.uib-day button, .uib-month button, .uib-year button {
|
||||
min-width: 100%;
|
||||
}
|
||||
|
||||
.uib-left, .uib-right {
|
||||
width: 100%
|
||||
}
|
||||
|
||||
.uib-position-measure {
|
||||
display: block !important;
|
||||
visibility: hidden !important;
|
||||
position: absolute !important;
|
||||
top: -9999px !important;
|
||||
left: -9999px !important;
|
||||
}
|
||||
|
||||
.uib-position-scrollbar-measure {
|
||||
position: absolute !important;
|
||||
top: -9999px !important;
|
||||
width: 50px !important;
|
||||
height: 50px !important;
|
||||
overflow: scroll !important;
|
||||
}
|
||||
|
||||
.uib-position-body-scrollbar-measure {
|
||||
overflow: scroll !important;
|
||||
}
|
||||
.uib-datepicker-popup.dropdown-menu {
|
||||
display: block;
|
||||
float: none;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.uib-button-bar {
|
||||
padding: 10px 9px 2px;
|
||||
}
|
||||
|
||||
[uib-tooltip-popup].tooltip.top-left > .tooltip-arrow,
|
||||
[uib-tooltip-popup].tooltip.top-right > .tooltip-arrow,
|
||||
[uib-tooltip-popup].tooltip.bottom-left > .tooltip-arrow,
|
||||
[uib-tooltip-popup].tooltip.bottom-right > .tooltip-arrow,
|
||||
[uib-tooltip-popup].tooltip.left-top > .tooltip-arrow,
|
||||
[uib-tooltip-popup].tooltip.left-bottom > .tooltip-arrow,
|
||||
[uib-tooltip-popup].tooltip.right-top > .tooltip-arrow,
|
||||
[uib-tooltip-popup].tooltip.right-bottom > .tooltip-arrow,
|
||||
[uib-tooltip-html-popup].tooltip.top-left > .tooltip-arrow,
|
||||
[uib-tooltip-html-popup].tooltip.top-right > .tooltip-arrow,
|
||||
[uib-tooltip-html-popup].tooltip.bottom-left > .tooltip-arrow,
|
||||
[uib-tooltip-html-popup].tooltip.bottom-right > .tooltip-arrow,
|
||||
[uib-tooltip-html-popup].tooltip.left-top > .tooltip-arrow,
|
||||
[uib-tooltip-html-popup].tooltip.left-bottom > .tooltip-arrow,
|
||||
[uib-tooltip-html-popup].tooltip.right-top > .tooltip-arrow,
|
||||
[uib-tooltip-html-popup].tooltip.right-bottom > .tooltip-arrow,
|
||||
[uib-tooltip-template-popup].tooltip.top-left > .tooltip-arrow,
|
||||
[uib-tooltip-template-popup].tooltip.top-right > .tooltip-arrow,
|
||||
[uib-tooltip-template-popup].tooltip.bottom-left > .tooltip-arrow,
|
||||
[uib-tooltip-template-popup].tooltip.bottom-right > .tooltip-arrow,
|
||||
[uib-tooltip-template-popup].tooltip.left-top > .tooltip-arrow,
|
||||
[uib-tooltip-template-popup].tooltip.left-bottom > .tooltip-arrow,
|
||||
[uib-tooltip-template-popup].tooltip.right-top > .tooltip-arrow,
|
||||
[uib-tooltip-template-popup].tooltip.right-bottom > .tooltip-arrow,
|
||||
[uib-popover-popup].popover.top-left > .arrow,
|
||||
[uib-popover-popup].popover.top-right > .arrow,
|
||||
[uib-popover-popup].popover.bottom-left > .arrow,
|
||||
[uib-popover-popup].popover.bottom-right > .arrow,
|
||||
[uib-popover-popup].popover.left-top > .arrow,
|
||||
[uib-popover-popup].popover.left-bottom > .arrow,
|
||||
[uib-popover-popup].popover.right-top > .arrow,
|
||||
[uib-popover-popup].popover.right-bottom > .arrow,
|
||||
[uib-popover-html-popup].popover.top-left > .arrow,
|
||||
[uib-popover-html-popup].popover.top-right > .arrow,
|
||||
[uib-popover-html-popup].popover.bottom-left > .arrow,
|
||||
[uib-popover-html-popup].popover.bottom-right > .arrow,
|
||||
[uib-popover-html-popup].popover.left-top > .arrow,
|
||||
[uib-popover-html-popup].popover.left-bottom > .arrow,
|
||||
[uib-popover-html-popup].popover.right-top > .arrow,
|
||||
[uib-popover-html-popup].popover.right-bottom > .arrow,
|
||||
[uib-popover-template-popup].popover.top-left > .arrow,
|
||||
[uib-popover-template-popup].popover.top-right > .arrow,
|
||||
[uib-popover-template-popup].popover.bottom-left > .arrow,
|
||||
[uib-popover-template-popup].popover.bottom-right > .arrow,
|
||||
[uib-popover-template-popup].popover.left-top > .arrow,
|
||||
[uib-popover-template-popup].popover.left-bottom > .arrow,
|
||||
[uib-popover-template-popup].popover.right-top > .arrow,
|
||||
[uib-popover-template-popup].popover.right-bottom > .arrow {
|
||||
top: auto;
|
||||
bottom: auto;
|
||||
left: auto;
|
||||
right: auto;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
[uib-popover-popup].popover,
|
||||
[uib-popover-html-popup].popover,
|
||||
[uib-popover-template-popup].popover {
|
||||
display: block !important;
|
||||
}
|
||||
|
||||
.uib-time input {
|
||||
width: 50px;
|
||||
}
|
||||
|
||||
[uib-typeahead-popup].dropdown-menu {
|
||||
display: block;
|
||||
}
|
||||
@@ -0,0 +1,116 @@
|
||||
/* Include this file in your html if you are using the CSP mode. */
|
||||
|
||||
.ng-animate.item:not(.left):not(.right) {
|
||||
-webkit-transition: 0s ease-in-out left;
|
||||
transition: 0s ease-in-out left
|
||||
}
|
||||
.uib-datepicker .uib-title {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.uib-day button, .uib-month button, .uib-year button {
|
||||
min-width: 100%;
|
||||
}
|
||||
|
||||
.uib-left, .uib-right {
|
||||
width: 100%
|
||||
}
|
||||
|
||||
.uib-position-measure {
|
||||
display: block !important;
|
||||
visibility: hidden !important;
|
||||
position: absolute !important;
|
||||
top: -9999px !important;
|
||||
left: -9999px !important;
|
||||
}
|
||||
|
||||
.uib-position-scrollbar-measure {
|
||||
position: absolute !important;
|
||||
top: -9999px !important;
|
||||
width: 50px !important;
|
||||
height: 50px !important;
|
||||
overflow: scroll !important;
|
||||
}
|
||||
|
||||
.uib-position-body-scrollbar-measure {
|
||||
overflow: scroll !important;
|
||||
}
|
||||
.uib-datepicker-popup.dropdown-menu {
|
||||
display: block;
|
||||
float: none;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.uib-button-bar {
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
[uib-tooltip-popup].tooltip.top-left > .tooltip-arrow,
|
||||
[uib-tooltip-popup].tooltip.top-right > .tooltip-arrow,
|
||||
[uib-tooltip-popup].tooltip.bottom-left > .tooltip-arrow,
|
||||
[uib-tooltip-popup].tooltip.bottom-right > .tooltip-arrow,
|
||||
[uib-tooltip-popup].tooltip.left-top > .tooltip-arrow,
|
||||
[uib-tooltip-popup].tooltip.left-bottom > .tooltip-arrow,
|
||||
[uib-tooltip-popup].tooltip.right-top > .tooltip-arrow,
|
||||
[uib-tooltip-popup].tooltip.right-bottom > .tooltip-arrow,
|
||||
[uib-tooltip-html-popup].tooltip.top-left > .tooltip-arrow,
|
||||
[uib-tooltip-html-popup].tooltip.top-right > .tooltip-arrow,
|
||||
[uib-tooltip-html-popup].tooltip.bottom-left > .tooltip-arrow,
|
||||
[uib-tooltip-html-popup].tooltip.bottom-right > .tooltip-arrow,
|
||||
[uib-tooltip-html-popup].tooltip.left-top > .tooltip-arrow,
|
||||
[uib-tooltip-html-popup].tooltip.left-bottom > .tooltip-arrow,
|
||||
[uib-tooltip-html-popup].tooltip.right-top > .tooltip-arrow,
|
||||
[uib-tooltip-html-popup].tooltip.right-bottom > .tooltip-arrow,
|
||||
[uib-tooltip-template-popup].tooltip.top-left > .tooltip-arrow,
|
||||
[uib-tooltip-template-popup].tooltip.top-right > .tooltip-arrow,
|
||||
[uib-tooltip-template-popup].tooltip.bottom-left > .tooltip-arrow,
|
||||
[uib-tooltip-template-popup].tooltip.bottom-right > .tooltip-arrow,
|
||||
[uib-tooltip-template-popup].tooltip.left-top > .tooltip-arrow,
|
||||
[uib-tooltip-template-popup].tooltip.left-bottom > .tooltip-arrow,
|
||||
[uib-tooltip-template-popup].tooltip.right-top > .tooltip-arrow,
|
||||
[uib-tooltip-template-popup].tooltip.right-bottom > .tooltip-arrow,
|
||||
[uib-popover-popup].popover.top-left > .arrow,
|
||||
[uib-popover-popup].popover.top-right > .arrow,
|
||||
[uib-popover-popup].popover.bottom-left > .arrow,
|
||||
[uib-popover-popup].popover.bottom-right > .arrow,
|
||||
[uib-popover-popup].popover.left-top > .arrow,
|
||||
[uib-popover-popup].popover.left-bottom > .arrow,
|
||||
[uib-popover-popup].popover.right-top > .arrow,
|
||||
[uib-popover-popup].popover.right-bottom > .arrow,
|
||||
[uib-popover-html-popup].popover.top-left > .arrow,
|
||||
[uib-popover-html-popup].popover.top-right > .arrow,
|
||||
[uib-popover-html-popup].popover.bottom-left > .arrow,
|
||||
[uib-popover-html-popup].popover.bottom-right > .arrow,
|
||||
[uib-popover-html-popup].popover.left-top > .arrow,
|
||||
[uib-popover-html-popup].popover.left-bottom > .arrow,
|
||||
[uib-popover-html-popup].popover.right-top > .arrow,
|
||||
[uib-popover-html-popup].popover.right-bottom > .arrow,
|
||||
[uib-popover-template-popup].popover.top-left > .arrow,
|
||||
[uib-popover-template-popup].popover.top-right > .arrow,
|
||||
[uib-popover-template-popup].popover.bottom-left > .arrow,
|
||||
[uib-popover-template-popup].popover.bottom-right > .arrow,
|
||||
[uib-popover-template-popup].popover.left-top > .arrow,
|
||||
[uib-popover-template-popup].popover.left-bottom > .arrow,
|
||||
[uib-popover-template-popup].popover.right-top > .arrow,
|
||||
[uib-popover-template-popup].popover.right-bottom > .arrow {
|
||||
top: auto;
|
||||
bottom: auto;
|
||||
left: auto;
|
||||
right: auto;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
[uib-popover-popup].popover,
|
||||
[uib-popover-html-popup].popover,
|
||||
[uib-popover-template-popup].popover {
|
||||
display: block !important;
|
||||
}
|
||||
|
||||
.uib-time input {
|
||||
/* Bootstrap 4 overrides this otherwise */
|
||||
width: 50px !important;
|
||||
}
|
||||
|
||||
[uib-typeahead-popup].dropdown-menu {
|
||||
display: block;
|
||||
}
|
||||
@@ -0,0 +1,116 @@
|
||||
/* Include this file in your html if you are using the CSP mode. */
|
||||
|
||||
.ng-animate.item:not(.left):not(.right) {
|
||||
-webkit-transition: 0s ease-in-out left;
|
||||
transition: 0s ease-in-out left
|
||||
}
|
||||
.uib-datepicker .uib-title {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.uib-day button, .uib-month button, .uib-year button {
|
||||
min-width: 100%;
|
||||
}
|
||||
|
||||
.uib-left, .uib-right {
|
||||
width: 100%
|
||||
}
|
||||
|
||||
.uib-position-measure {
|
||||
display: block !important;
|
||||
visibility: hidden !important;
|
||||
position: absolute !important;
|
||||
top: -9999px !important;
|
||||
left: -9999px !important;
|
||||
}
|
||||
|
||||
.uib-position-scrollbar-measure {
|
||||
position: absolute !important;
|
||||
top: -9999px !important;
|
||||
width: 50px !important;
|
||||
height: 50px !important;
|
||||
overflow: scroll !important;
|
||||
}
|
||||
|
||||
.uib-position-body-scrollbar-measure {
|
||||
overflow: scroll !important;
|
||||
}
|
||||
.uib-datepicker-popup.dropdown-menu {
|
||||
display: block;
|
||||
float: none;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.uib-button-bar {
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
[uib-tooltip-popup].tooltip.top-left > .tooltip-arrow,
|
||||
[uib-tooltip-popup].tooltip.top-right > .tooltip-arrow,
|
||||
[uib-tooltip-popup].tooltip.bottom-left > .tooltip-arrow,
|
||||
[uib-tooltip-popup].tooltip.bottom-right > .tooltip-arrow,
|
||||
[uib-tooltip-popup].tooltip.left-top > .tooltip-arrow,
|
||||
[uib-tooltip-popup].tooltip.left-bottom > .tooltip-arrow,
|
||||
[uib-tooltip-popup].tooltip.right-top > .tooltip-arrow,
|
||||
[uib-tooltip-popup].tooltip.right-bottom > .tooltip-arrow,
|
||||
[uib-tooltip-html-popup].tooltip.top-left > .tooltip-arrow,
|
||||
[uib-tooltip-html-popup].tooltip.top-right > .tooltip-arrow,
|
||||
[uib-tooltip-html-popup].tooltip.bottom-left > .tooltip-arrow,
|
||||
[uib-tooltip-html-popup].tooltip.bottom-right > .tooltip-arrow,
|
||||
[uib-tooltip-html-popup].tooltip.left-top > .tooltip-arrow,
|
||||
[uib-tooltip-html-popup].tooltip.left-bottom > .tooltip-arrow,
|
||||
[uib-tooltip-html-popup].tooltip.right-top > .tooltip-arrow,
|
||||
[uib-tooltip-html-popup].tooltip.right-bottom > .tooltip-arrow,
|
||||
[uib-tooltip-template-popup].tooltip.top-left > .tooltip-arrow,
|
||||
[uib-tooltip-template-popup].tooltip.top-right > .tooltip-arrow,
|
||||
[uib-tooltip-template-popup].tooltip.bottom-left > .tooltip-arrow,
|
||||
[uib-tooltip-template-popup].tooltip.bottom-right > .tooltip-arrow,
|
||||
[uib-tooltip-template-popup].tooltip.left-top > .tooltip-arrow,
|
||||
[uib-tooltip-template-popup].tooltip.left-bottom > .tooltip-arrow,
|
||||
[uib-tooltip-template-popup].tooltip.right-top > .tooltip-arrow,
|
||||
[uib-tooltip-template-popup].tooltip.right-bottom > .tooltip-arrow,
|
||||
[uib-popover-popup].popover.top-left > .arrow,
|
||||
[uib-popover-popup].popover.top-right > .arrow,
|
||||
[uib-popover-popup].popover.bottom-left > .arrow,
|
||||
[uib-popover-popup].popover.bottom-right > .arrow,
|
||||
[uib-popover-popup].popover.left-top > .arrow,
|
||||
[uib-popover-popup].popover.left-bottom > .arrow,
|
||||
[uib-popover-popup].popover.right-top > .arrow,
|
||||
[uib-popover-popup].popover.right-bottom > .arrow,
|
||||
[uib-popover-html-popup].popover.top-left > .arrow,
|
||||
[uib-popover-html-popup].popover.top-right > .arrow,
|
||||
[uib-popover-html-popup].popover.bottom-left > .arrow,
|
||||
[uib-popover-html-popup].popover.bottom-right > .arrow,
|
||||
[uib-popover-html-popup].popover.left-top > .arrow,
|
||||
[uib-popover-html-popup].popover.left-bottom > .arrow,
|
||||
[uib-popover-html-popup].popover.right-top > .arrow,
|
||||
[uib-popover-html-popup].popover.right-bottom > .arrow,
|
||||
[uib-popover-template-popup].popover.top-left > .arrow,
|
||||
[uib-popover-template-popup].popover.top-right > .arrow,
|
||||
[uib-popover-template-popup].popover.bottom-left > .arrow,
|
||||
[uib-popover-template-popup].popover.bottom-right > .arrow,
|
||||
[uib-popover-template-popup].popover.left-top > .arrow,
|
||||
[uib-popover-template-popup].popover.left-bottom > .arrow,
|
||||
[uib-popover-template-popup].popover.right-top > .arrow,
|
||||
[uib-popover-template-popup].popover.right-bottom > .arrow {
|
||||
top: auto;
|
||||
bottom: auto;
|
||||
left: auto;
|
||||
right: auto;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
[uib-popover-popup].popover,
|
||||
[uib-popover-html-popup].popover,
|
||||
[uib-popover-template-popup].popover {
|
||||
display: block !important;
|
||||
}
|
||||
|
||||
.uib-time input {
|
||||
/* Bootstrap 4 overrides this otherwise */
|
||||
width: 50px !important;
|
||||
}
|
||||
|
||||
[uib-typeahead-popup].dropdown-menu {
|
||||
display: block;
|
||||
}
|
||||
@@ -0,0 +1,116 @@
|
||||
/* Include this file in your html if you are using the CSP mode. */
|
||||
|
||||
.ng-animate.item:not(.left):not(.right) {
|
||||
-webkit-transition: 0s ease-in-out left;
|
||||
transition: 0s ease-in-out left
|
||||
}
|
||||
.uib-datepicker .uib-title {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.uib-day button, .uib-month button, .uib-year button {
|
||||
min-width: 100%;
|
||||
}
|
||||
|
||||
.uib-left, .uib-right {
|
||||
width: 100%
|
||||
}
|
||||
|
||||
.uib-position-measure {
|
||||
display: block !important;
|
||||
visibility: hidden !important;
|
||||
position: absolute !important;
|
||||
top: -9999px !important;
|
||||
left: -9999px !important;
|
||||
}
|
||||
|
||||
.uib-position-scrollbar-measure {
|
||||
position: absolute !important;
|
||||
top: -9999px !important;
|
||||
width: 50px !important;
|
||||
height: 50px !important;
|
||||
overflow: scroll !important;
|
||||
}
|
||||
|
||||
.uib-position-body-scrollbar-measure {
|
||||
overflow: scroll !important;
|
||||
}
|
||||
.uib-datepicker-popup.dropdown-menu {
|
||||
display: block;
|
||||
float: none;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.uib-button-bar {
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
[uib-tooltip-popup].tooltip.top-left > .tooltip-arrow,
|
||||
[uib-tooltip-popup].tooltip.top-right > .tooltip-arrow,
|
||||
[uib-tooltip-popup].tooltip.bottom-left > .tooltip-arrow,
|
||||
[uib-tooltip-popup].tooltip.bottom-right > .tooltip-arrow,
|
||||
[uib-tooltip-popup].tooltip.left-top > .tooltip-arrow,
|
||||
[uib-tooltip-popup].tooltip.left-bottom > .tooltip-arrow,
|
||||
[uib-tooltip-popup].tooltip.right-top > .tooltip-arrow,
|
||||
[uib-tooltip-popup].tooltip.right-bottom > .tooltip-arrow,
|
||||
[uib-tooltip-html-popup].tooltip.top-left > .tooltip-arrow,
|
||||
[uib-tooltip-html-popup].tooltip.top-right > .tooltip-arrow,
|
||||
[uib-tooltip-html-popup].tooltip.bottom-left > .tooltip-arrow,
|
||||
[uib-tooltip-html-popup].tooltip.bottom-right > .tooltip-arrow,
|
||||
[uib-tooltip-html-popup].tooltip.left-top > .tooltip-arrow,
|
||||
[uib-tooltip-html-popup].tooltip.left-bottom > .tooltip-arrow,
|
||||
[uib-tooltip-html-popup].tooltip.right-top > .tooltip-arrow,
|
||||
[uib-tooltip-html-popup].tooltip.right-bottom > .tooltip-arrow,
|
||||
[uib-tooltip-template-popup].tooltip.top-left > .tooltip-arrow,
|
||||
[uib-tooltip-template-popup].tooltip.top-right > .tooltip-arrow,
|
||||
[uib-tooltip-template-popup].tooltip.bottom-left > .tooltip-arrow,
|
||||
[uib-tooltip-template-popup].tooltip.bottom-right > .tooltip-arrow,
|
||||
[uib-tooltip-template-popup].tooltip.left-top > .tooltip-arrow,
|
||||
[uib-tooltip-template-popup].tooltip.left-bottom > .tooltip-arrow,
|
||||
[uib-tooltip-template-popup].tooltip.right-top > .tooltip-arrow,
|
||||
[uib-tooltip-template-popup].tooltip.right-bottom > .tooltip-arrow,
|
||||
[uib-popover-popup].popover.top-left > .arrow,
|
||||
[uib-popover-popup].popover.top-right > .arrow,
|
||||
[uib-popover-popup].popover.bottom-left > .arrow,
|
||||
[uib-popover-popup].popover.bottom-right > .arrow,
|
||||
[uib-popover-popup].popover.left-top > .arrow,
|
||||
[uib-popover-popup].popover.left-bottom > .arrow,
|
||||
[uib-popover-popup].popover.right-top > .arrow,
|
||||
[uib-popover-popup].popover.right-bottom > .arrow,
|
||||
[uib-popover-html-popup].popover.top-left > .arrow,
|
||||
[uib-popover-html-popup].popover.top-right > .arrow,
|
||||
[uib-popover-html-popup].popover.bottom-left > .arrow,
|
||||
[uib-popover-html-popup].popover.bottom-right > .arrow,
|
||||
[uib-popover-html-popup].popover.left-top > .arrow,
|
||||
[uib-popover-html-popup].popover.left-bottom > .arrow,
|
||||
[uib-popover-html-popup].popover.right-top > .arrow,
|
||||
[uib-popover-html-popup].popover.right-bottom > .arrow,
|
||||
[uib-popover-template-popup].popover.top-left > .arrow,
|
||||
[uib-popover-template-popup].popover.top-right > .arrow,
|
||||
[uib-popover-template-popup].popover.bottom-left > .arrow,
|
||||
[uib-popover-template-popup].popover.bottom-right > .arrow,
|
||||
[uib-popover-template-popup].popover.left-top > .arrow,
|
||||
[uib-popover-template-popup].popover.left-bottom > .arrow,
|
||||
[uib-popover-template-popup].popover.right-top > .arrow,
|
||||
[uib-popover-template-popup].popover.right-bottom > .arrow {
|
||||
top: auto;
|
||||
bottom: auto;
|
||||
left: auto;
|
||||
right: auto;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
[uib-popover-popup].popover,
|
||||
[uib-popover-html-popup].popover,
|
||||
[uib-popover-template-popup].popover {
|
||||
display: block !important;
|
||||
}
|
||||
|
||||
.uib-time input {
|
||||
/* Bootstrap 4 overrides this otherwise */
|
||||
width: 50px !important;
|
||||
}
|
||||
|
||||
[uib-typeahead-popup].dropdown-menu {
|
||||
display: block;
|
||||
}
|
||||
@@ -0,0 +1,116 @@
|
||||
/* Include this file in your html if you are using the CSP mode. */
|
||||
|
||||
.ng-animate.item:not(.left):not(.right) {
|
||||
-webkit-transition: 0s ease-in-out left;
|
||||
transition: 0s ease-in-out left
|
||||
}
|
||||
.uib-datepicker .uib-title {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.uib-day button, .uib-month button, .uib-year button {
|
||||
min-width: 100%;
|
||||
}
|
||||
|
||||
.uib-left, .uib-right {
|
||||
width: 100%
|
||||
}
|
||||
|
||||
.uib-position-measure {
|
||||
display: block !important;
|
||||
visibility: hidden !important;
|
||||
position: absolute !important;
|
||||
top: -9999px !important;
|
||||
left: -9999px !important;
|
||||
}
|
||||
|
||||
.uib-position-scrollbar-measure {
|
||||
position: absolute !important;
|
||||
top: -9999px !important;
|
||||
width: 50px !important;
|
||||
height: 50px !important;
|
||||
overflow: scroll !important;
|
||||
}
|
||||
|
||||
.uib-position-body-scrollbar-measure {
|
||||
overflow: scroll !important;
|
||||
}
|
||||
.uib-datepicker-popup.dropdown-menu {
|
||||
display: block;
|
||||
float: none;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.uib-button-bar {
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
[uib-tooltip-popup].tooltip.top-left > .tooltip-arrow,
|
||||
[uib-tooltip-popup].tooltip.top-right > .tooltip-arrow,
|
||||
[uib-tooltip-popup].tooltip.bottom-left > .tooltip-arrow,
|
||||
[uib-tooltip-popup].tooltip.bottom-right > .tooltip-arrow,
|
||||
[uib-tooltip-popup].tooltip.left-top > .tooltip-arrow,
|
||||
[uib-tooltip-popup].tooltip.left-bottom > .tooltip-arrow,
|
||||
[uib-tooltip-popup].tooltip.right-top > .tooltip-arrow,
|
||||
[uib-tooltip-popup].tooltip.right-bottom > .tooltip-arrow,
|
||||
[uib-tooltip-html-popup].tooltip.top-left > .tooltip-arrow,
|
||||
[uib-tooltip-html-popup].tooltip.top-right > .tooltip-arrow,
|
||||
[uib-tooltip-html-popup].tooltip.bottom-left > .tooltip-arrow,
|
||||
[uib-tooltip-html-popup].tooltip.bottom-right > .tooltip-arrow,
|
||||
[uib-tooltip-html-popup].tooltip.left-top > .tooltip-arrow,
|
||||
[uib-tooltip-html-popup].tooltip.left-bottom > .tooltip-arrow,
|
||||
[uib-tooltip-html-popup].tooltip.right-top > .tooltip-arrow,
|
||||
[uib-tooltip-html-popup].tooltip.right-bottom > .tooltip-arrow,
|
||||
[uib-tooltip-template-popup].tooltip.top-left > .tooltip-arrow,
|
||||
[uib-tooltip-template-popup].tooltip.top-right > .tooltip-arrow,
|
||||
[uib-tooltip-template-popup].tooltip.bottom-left > .tooltip-arrow,
|
||||
[uib-tooltip-template-popup].tooltip.bottom-right > .tooltip-arrow,
|
||||
[uib-tooltip-template-popup].tooltip.left-top > .tooltip-arrow,
|
||||
[uib-tooltip-template-popup].tooltip.left-bottom > .tooltip-arrow,
|
||||
[uib-tooltip-template-popup].tooltip.right-top > .tooltip-arrow,
|
||||
[uib-tooltip-template-popup].tooltip.right-bottom > .tooltip-arrow,
|
||||
[uib-popover-popup].popover.top-left > .arrow,
|
||||
[uib-popover-popup].popover.top-right > .arrow,
|
||||
[uib-popover-popup].popover.bottom-left > .arrow,
|
||||
[uib-popover-popup].popover.bottom-right > .arrow,
|
||||
[uib-popover-popup].popover.left-top > .arrow,
|
||||
[uib-popover-popup].popover.left-bottom > .arrow,
|
||||
[uib-popover-popup].popover.right-top > .arrow,
|
||||
[uib-popover-popup].popover.right-bottom > .arrow,
|
||||
[uib-popover-html-popup].popover.top-left > .arrow,
|
||||
[uib-popover-html-popup].popover.top-right > .arrow,
|
||||
[uib-popover-html-popup].popover.bottom-left > .arrow,
|
||||
[uib-popover-html-popup].popover.bottom-right > .arrow,
|
||||
[uib-popover-html-popup].popover.left-top > .arrow,
|
||||
[uib-popover-html-popup].popover.left-bottom > .arrow,
|
||||
[uib-popover-html-popup].popover.right-top > .arrow,
|
||||
[uib-popover-html-popup].popover.right-bottom > .arrow,
|
||||
[uib-popover-template-popup].popover.top-left > .arrow,
|
||||
[uib-popover-template-popup].popover.top-right > .arrow,
|
||||
[uib-popover-template-popup].popover.bottom-left > .arrow,
|
||||
[uib-popover-template-popup].popover.bottom-right > .arrow,
|
||||
[uib-popover-template-popup].popover.left-top > .arrow,
|
||||
[uib-popover-template-popup].popover.left-bottom > .arrow,
|
||||
[uib-popover-template-popup].popover.right-top > .arrow,
|
||||
[uib-popover-template-popup].popover.right-bottom > .arrow {
|
||||
top: auto;
|
||||
bottom: auto;
|
||||
left: auto;
|
||||
right: auto;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
[uib-popover-popup].popover,
|
||||
[uib-popover-html-popup].popover,
|
||||
[uib-popover-template-popup].popover {
|
||||
display: block !important;
|
||||
}
|
||||
|
||||
.uib-time input {
|
||||
/* Bootstrap 4 overrides this otherwise */
|
||||
width: 50px !important;
|
||||
}
|
||||
|
||||
[uib-typeahead-popup].dropdown-menu {
|
||||
display: block;
|
||||
}
|
||||
@@ -0,0 +1,139 @@
|
||||
/* Include this file in your html if you are using the CSP mode. */
|
||||
|
||||
.ng-animate.item:not(.left):not(.right) {
|
||||
-webkit-transition: 0s ease-in-out left;
|
||||
transition: 0s ease-in-out left
|
||||
}
|
||||
.fa-svg-icon {
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
min-width: 1em;
|
||||
min-height: 1em;
|
||||
height: 100%;
|
||||
position: relative;
|
||||
top: -1px;
|
||||
}
|
||||
|
||||
.fa-svg-icon svg {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.fa-svg-icon svg g,
|
||||
.fa-svg-icon svg path {
|
||||
fill: currentColor;
|
||||
}
|
||||
|
||||
.uib-datepicker .uib-title {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.uib-day button, .uib-month button, .uib-year button {
|
||||
min-width: 100%;
|
||||
}
|
||||
|
||||
.uib-left, .uib-right {
|
||||
width: 100%
|
||||
}
|
||||
|
||||
.uib-position-measure {
|
||||
display: block !important;
|
||||
visibility: hidden !important;
|
||||
position: absolute !important;
|
||||
top: -9999px !important;
|
||||
left: -9999px !important;
|
||||
}
|
||||
|
||||
.uib-position-scrollbar-measure {
|
||||
position: absolute !important;
|
||||
top: -9999px !important;
|
||||
width: 50px !important;
|
||||
height: 50px !important;
|
||||
overflow: scroll !important;
|
||||
}
|
||||
|
||||
.uib-position-body-scrollbar-measure {
|
||||
overflow: scroll !important;
|
||||
}
|
||||
.uib-datepicker-popup.dropdown-menu {
|
||||
display: block;
|
||||
float: none;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.uib-button-bar {
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
[uib-tooltip-popup].tooltip.top-left > .tooltip-arrow,
|
||||
[uib-tooltip-popup].tooltip.top-right > .tooltip-arrow,
|
||||
[uib-tooltip-popup].tooltip.bottom-left > .tooltip-arrow,
|
||||
[uib-tooltip-popup].tooltip.bottom-right > .tooltip-arrow,
|
||||
[uib-tooltip-popup].tooltip.left-top > .tooltip-arrow,
|
||||
[uib-tooltip-popup].tooltip.left-bottom > .tooltip-arrow,
|
||||
[uib-tooltip-popup].tooltip.right-top > .tooltip-arrow,
|
||||
[uib-tooltip-popup].tooltip.right-bottom > .tooltip-arrow,
|
||||
[uib-tooltip-html-popup].tooltip.top-left > .tooltip-arrow,
|
||||
[uib-tooltip-html-popup].tooltip.top-right > .tooltip-arrow,
|
||||
[uib-tooltip-html-popup].tooltip.bottom-left > .tooltip-arrow,
|
||||
[uib-tooltip-html-popup].tooltip.bottom-right > .tooltip-arrow,
|
||||
[uib-tooltip-html-popup].tooltip.left-top > .tooltip-arrow,
|
||||
[uib-tooltip-html-popup].tooltip.left-bottom > .tooltip-arrow,
|
||||
[uib-tooltip-html-popup].tooltip.right-top > .tooltip-arrow,
|
||||
[uib-tooltip-html-popup].tooltip.right-bottom > .tooltip-arrow,
|
||||
[uib-tooltip-template-popup].tooltip.top-left > .tooltip-arrow,
|
||||
[uib-tooltip-template-popup].tooltip.top-right > .tooltip-arrow,
|
||||
[uib-tooltip-template-popup].tooltip.bottom-left > .tooltip-arrow,
|
||||
[uib-tooltip-template-popup].tooltip.bottom-right > .tooltip-arrow,
|
||||
[uib-tooltip-template-popup].tooltip.left-top > .tooltip-arrow,
|
||||
[uib-tooltip-template-popup].tooltip.left-bottom > .tooltip-arrow,
|
||||
[uib-tooltip-template-popup].tooltip.right-top > .tooltip-arrow,
|
||||
[uib-tooltip-template-popup].tooltip.right-bottom > .tooltip-arrow,
|
||||
[uib-popover-popup].popover.top-left > .arrow,
|
||||
[uib-popover-popup].popover.top-right > .arrow,
|
||||
[uib-popover-popup].popover.bottom-left > .arrow,
|
||||
[uib-popover-popup].popover.bottom-right > .arrow,
|
||||
[uib-popover-popup].popover.left-top > .arrow,
|
||||
[uib-popover-popup].popover.left-bottom > .arrow,
|
||||
[uib-popover-popup].popover.right-top > .arrow,
|
||||
[uib-popover-popup].popover.right-bottom > .arrow,
|
||||
[uib-popover-html-popup].popover.top-left > .arrow,
|
||||
[uib-popover-html-popup].popover.top-right > .arrow,
|
||||
[uib-popover-html-popup].popover.bottom-left > .arrow,
|
||||
[uib-popover-html-popup].popover.bottom-right > .arrow,
|
||||
[uib-popover-html-popup].popover.left-top > .arrow,
|
||||
[uib-popover-html-popup].popover.left-bottom > .arrow,
|
||||
[uib-popover-html-popup].popover.right-top > .arrow,
|
||||
[uib-popover-html-popup].popover.right-bottom > .arrow,
|
||||
[uib-popover-template-popup].popover.top-left > .arrow,
|
||||
[uib-popover-template-popup].popover.top-right > .arrow,
|
||||
[uib-popover-template-popup].popover.bottom-left > .arrow,
|
||||
[uib-popover-template-popup].popover.bottom-right > .arrow,
|
||||
[uib-popover-template-popup].popover.left-top > .arrow,
|
||||
[uib-popover-template-popup].popover.left-bottom > .arrow,
|
||||
[uib-popover-template-popup].popover.right-top > .arrow,
|
||||
[uib-popover-template-popup].popover.right-bottom > .arrow {
|
||||
top: auto;
|
||||
bottom: auto;
|
||||
left: auto;
|
||||
right: auto;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
[uib-popover-popup].popover,
|
||||
[uib-popover-html-popup].popover,
|
||||
[uib-popover-template-popup].popover {
|
||||
display: block !important;
|
||||
}
|
||||
|
||||
.uib-time input {
|
||||
/* Bootstrap 4 overrides this otherwise */
|
||||
width: 50px !important;
|
||||
}
|
||||
|
||||
[uib-typeahead-popup].dropdown-menu {
|
||||
display: block;
|
||||
}
|
||||
@@ -0,0 +1,139 @@
|
||||
/* Include this file in your html if you are using the CSP mode. */
|
||||
|
||||
.ng-animate.item:not(.left):not(.right) {
|
||||
-webkit-transition: 0s ease-in-out left;
|
||||
transition: 0s ease-in-out left
|
||||
}
|
||||
.fa-svg-icon {
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
min-width: 1em;
|
||||
min-height: 1em;
|
||||
height: 100%;
|
||||
position: relative;
|
||||
top: -1px;
|
||||
}
|
||||
|
||||
.fa-svg-icon svg {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.fa-svg-icon svg g,
|
||||
.fa-svg-icon svg path {
|
||||
fill: currentColor;
|
||||
}
|
||||
|
||||
.uib-datepicker .uib-title {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.uib-day button, .uib-month button, .uib-year button {
|
||||
min-width: 100%;
|
||||
}
|
||||
|
||||
.uib-left, .uib-right {
|
||||
width: 100%
|
||||
}
|
||||
|
||||
.uib-position-measure {
|
||||
display: block !important;
|
||||
visibility: hidden !important;
|
||||
position: absolute !important;
|
||||
top: -9999px !important;
|
||||
left: -9999px !important;
|
||||
}
|
||||
|
||||
.uib-position-scrollbar-measure {
|
||||
position: absolute !important;
|
||||
top: -9999px !important;
|
||||
width: 50px !important;
|
||||
height: 50px !important;
|
||||
overflow: scroll !important;
|
||||
}
|
||||
|
||||
.uib-position-body-scrollbar-measure {
|
||||
overflow: scroll !important;
|
||||
}
|
||||
.uib-datepicker-popup.dropdown-menu {
|
||||
display: block;
|
||||
float: none;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.uib-button-bar {
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
[uib-tooltip-popup].tooltip.top-left > .tooltip-arrow,
|
||||
[uib-tooltip-popup].tooltip.top-right > .tooltip-arrow,
|
||||
[uib-tooltip-popup].tooltip.bottom-left > .tooltip-arrow,
|
||||
[uib-tooltip-popup].tooltip.bottom-right > .tooltip-arrow,
|
||||
[uib-tooltip-popup].tooltip.left-top > .tooltip-arrow,
|
||||
[uib-tooltip-popup].tooltip.left-bottom > .tooltip-arrow,
|
||||
[uib-tooltip-popup].tooltip.right-top > .tooltip-arrow,
|
||||
[uib-tooltip-popup].tooltip.right-bottom > .tooltip-arrow,
|
||||
[uib-tooltip-html-popup].tooltip.top-left > .tooltip-arrow,
|
||||
[uib-tooltip-html-popup].tooltip.top-right > .tooltip-arrow,
|
||||
[uib-tooltip-html-popup].tooltip.bottom-left > .tooltip-arrow,
|
||||
[uib-tooltip-html-popup].tooltip.bottom-right > .tooltip-arrow,
|
||||
[uib-tooltip-html-popup].tooltip.left-top > .tooltip-arrow,
|
||||
[uib-tooltip-html-popup].tooltip.left-bottom > .tooltip-arrow,
|
||||
[uib-tooltip-html-popup].tooltip.right-top > .tooltip-arrow,
|
||||
[uib-tooltip-html-popup].tooltip.right-bottom > .tooltip-arrow,
|
||||
[uib-tooltip-template-popup].tooltip.top-left > .tooltip-arrow,
|
||||
[uib-tooltip-template-popup].tooltip.top-right > .tooltip-arrow,
|
||||
[uib-tooltip-template-popup].tooltip.bottom-left > .tooltip-arrow,
|
||||
[uib-tooltip-template-popup].tooltip.bottom-right > .tooltip-arrow,
|
||||
[uib-tooltip-template-popup].tooltip.left-top > .tooltip-arrow,
|
||||
[uib-tooltip-template-popup].tooltip.left-bottom > .tooltip-arrow,
|
||||
[uib-tooltip-template-popup].tooltip.right-top > .tooltip-arrow,
|
||||
[uib-tooltip-template-popup].tooltip.right-bottom > .tooltip-arrow,
|
||||
[uib-popover-popup].popover.top-left > .arrow,
|
||||
[uib-popover-popup].popover.top-right > .arrow,
|
||||
[uib-popover-popup].popover.bottom-left > .arrow,
|
||||
[uib-popover-popup].popover.bottom-right > .arrow,
|
||||
[uib-popover-popup].popover.left-top > .arrow,
|
||||
[uib-popover-popup].popover.left-bottom > .arrow,
|
||||
[uib-popover-popup].popover.right-top > .arrow,
|
||||
[uib-popover-popup].popover.right-bottom > .arrow,
|
||||
[uib-popover-html-popup].popover.top-left > .arrow,
|
||||
[uib-popover-html-popup].popover.top-right > .arrow,
|
||||
[uib-popover-html-popup].popover.bottom-left > .arrow,
|
||||
[uib-popover-html-popup].popover.bottom-right > .arrow,
|
||||
[uib-popover-html-popup].popover.left-top > .arrow,
|
||||
[uib-popover-html-popup].popover.left-bottom > .arrow,
|
||||
[uib-popover-html-popup].popover.right-top > .arrow,
|
||||
[uib-popover-html-popup].popover.right-bottom > .arrow,
|
||||
[uib-popover-template-popup].popover.top-left > .arrow,
|
||||
[uib-popover-template-popup].popover.top-right > .arrow,
|
||||
[uib-popover-template-popup].popover.bottom-left > .arrow,
|
||||
[uib-popover-template-popup].popover.bottom-right > .arrow,
|
||||
[uib-popover-template-popup].popover.left-top > .arrow,
|
||||
[uib-popover-template-popup].popover.left-bottom > .arrow,
|
||||
[uib-popover-template-popup].popover.right-top > .arrow,
|
||||
[uib-popover-template-popup].popover.right-bottom > .arrow {
|
||||
top: auto;
|
||||
bottom: auto;
|
||||
left: auto;
|
||||
right: auto;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
[uib-popover-popup].popover,
|
||||
[uib-popover-html-popup].popover,
|
||||
[uib-popover-template-popup].popover {
|
||||
display: block !important;
|
||||
}
|
||||
|
||||
.uib-time input {
|
||||
/* Bootstrap 4 overrides this otherwise */
|
||||
width: 50px !important;
|
||||
}
|
||||
|
||||
[uib-typeahead-popup].dropdown-menu {
|
||||
display: block;
|
||||
}
|
||||
@@ -0,0 +1,140 @@
|
||||
/* Include this file in your html if you are using the CSP mode. */
|
||||
|
||||
.ng-animate.item:not(.left):not(.right) {
|
||||
-webkit-transition: 0s ease-in-out left;
|
||||
transition: 0s ease-in-out left
|
||||
}
|
||||
|
||||
.fa-svg-icon {
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
min-width: 1em;
|
||||
min-height: 1em;
|
||||
height: 100%;
|
||||
position: relative;
|
||||
top: -1px;
|
||||
}
|
||||
|
||||
.fa-svg-icon svg {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.fa-svg-icon svg g,
|
||||
.fa-svg-icon svg path {
|
||||
fill: currentColor;
|
||||
}
|
||||
|
||||
.uib-datepicker .uib-title {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.uib-day button, .uib-month button, .uib-year button {
|
||||
min-width: 100%;
|
||||
}
|
||||
|
||||
.uib-left, .uib-right {
|
||||
width: 100%
|
||||
}
|
||||
|
||||
.uib-position-measure {
|
||||
display: block !important;
|
||||
visibility: hidden !important;
|
||||
position: absolute !important;
|
||||
top: -9999px !important;
|
||||
left: -9999px !important;
|
||||
}
|
||||
|
||||
.uib-position-scrollbar-measure {
|
||||
position: absolute !important;
|
||||
top: -9999px !important;
|
||||
width: 50px !important;
|
||||
height: 50px !important;
|
||||
overflow: scroll !important;
|
||||
}
|
||||
|
||||
.uib-position-body-scrollbar-measure {
|
||||
overflow: scroll !important;
|
||||
}
|
||||
.uib-datepicker-popup.dropdown-menu {
|
||||
display: block;
|
||||
float: none;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.uib-button-bar {
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
[uib-tooltip-popup].tooltip.top-left > .tooltip-arrow,
|
||||
[uib-tooltip-popup].tooltip.top-right > .tooltip-arrow,
|
||||
[uib-tooltip-popup].tooltip.bottom-left > .tooltip-arrow,
|
||||
[uib-tooltip-popup].tooltip.bottom-right > .tooltip-arrow,
|
||||
[uib-tooltip-popup].tooltip.left-top > .tooltip-arrow,
|
||||
[uib-tooltip-popup].tooltip.left-bottom > .tooltip-arrow,
|
||||
[uib-tooltip-popup].tooltip.right-top > .tooltip-arrow,
|
||||
[uib-tooltip-popup].tooltip.right-bottom > .tooltip-arrow,
|
||||
[uib-tooltip-html-popup].tooltip.top-left > .tooltip-arrow,
|
||||
[uib-tooltip-html-popup].tooltip.top-right > .tooltip-arrow,
|
||||
[uib-tooltip-html-popup].tooltip.bottom-left > .tooltip-arrow,
|
||||
[uib-tooltip-html-popup].tooltip.bottom-right > .tooltip-arrow,
|
||||
[uib-tooltip-html-popup].tooltip.left-top > .tooltip-arrow,
|
||||
[uib-tooltip-html-popup].tooltip.left-bottom > .tooltip-arrow,
|
||||
[uib-tooltip-html-popup].tooltip.right-top > .tooltip-arrow,
|
||||
[uib-tooltip-html-popup].tooltip.right-bottom > .tooltip-arrow,
|
||||
[uib-tooltip-template-popup].tooltip.top-left > .tooltip-arrow,
|
||||
[uib-tooltip-template-popup].tooltip.top-right > .tooltip-arrow,
|
||||
[uib-tooltip-template-popup].tooltip.bottom-left > .tooltip-arrow,
|
||||
[uib-tooltip-template-popup].tooltip.bottom-right > .tooltip-arrow,
|
||||
[uib-tooltip-template-popup].tooltip.left-top > .tooltip-arrow,
|
||||
[uib-tooltip-template-popup].tooltip.left-bottom > .tooltip-arrow,
|
||||
[uib-tooltip-template-popup].tooltip.right-top > .tooltip-arrow,
|
||||
[uib-tooltip-template-popup].tooltip.right-bottom > .tooltip-arrow,
|
||||
[uib-popover-popup].popover.top-left > .arrow,
|
||||
[uib-popover-popup].popover.top-right > .arrow,
|
||||
[uib-popover-popup].popover.bottom-left > .arrow,
|
||||
[uib-popover-popup].popover.bottom-right > .arrow,
|
||||
[uib-popover-popup].popover.left-top > .arrow,
|
||||
[uib-popover-popup].popover.left-bottom > .arrow,
|
||||
[uib-popover-popup].popover.right-top > .arrow,
|
||||
[uib-popover-popup].popover.right-bottom > .arrow,
|
||||
[uib-popover-html-popup].popover.top-left > .arrow,
|
||||
[uib-popover-html-popup].popover.top-right > .arrow,
|
||||
[uib-popover-html-popup].popover.bottom-left > .arrow,
|
||||
[uib-popover-html-popup].popover.bottom-right > .arrow,
|
||||
[uib-popover-html-popup].popover.left-top > .arrow,
|
||||
[uib-popover-html-popup].popover.left-bottom > .arrow,
|
||||
[uib-popover-html-popup].popover.right-top > .arrow,
|
||||
[uib-popover-html-popup].popover.right-bottom > .arrow,
|
||||
[uib-popover-template-popup].popover.top-left > .arrow,
|
||||
[uib-popover-template-popup].popover.top-right > .arrow,
|
||||
[uib-popover-template-popup].popover.bottom-left > .arrow,
|
||||
[uib-popover-template-popup].popover.bottom-right > .arrow,
|
||||
[uib-popover-template-popup].popover.left-top > .arrow,
|
||||
[uib-popover-template-popup].popover.left-bottom > .arrow,
|
||||
[uib-popover-template-popup].popover.right-top > .arrow,
|
||||
[uib-popover-template-popup].popover.right-bottom > .arrow {
|
||||
top: auto;
|
||||
bottom: auto;
|
||||
left: auto;
|
||||
right: auto;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
[uib-popover-popup].popover,
|
||||
[uib-popover-html-popup].popover,
|
||||
[uib-popover-template-popup].popover {
|
||||
display: block !important;
|
||||
}
|
||||
|
||||
.uib-time input {
|
||||
/* Bootstrap 4 overrides this otherwise */
|
||||
width: 50px !important;
|
||||
}
|
||||
|
||||
[uib-typeahead-popup].dropdown-menu {
|
||||
display: block;
|
||||
}
|
||||
@@ -0,0 +1,140 @@
|
||||
/* Include this file in your html if you are using the CSP mode. */
|
||||
|
||||
.ng-animate.item:not(.left):not(.right) {
|
||||
-webkit-transition: 0s ease-in-out left;
|
||||
transition: 0s ease-in-out left
|
||||
}
|
||||
|
||||
.fa-svg-icon {
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
min-width: 1em;
|
||||
min-height: 1em;
|
||||
height: 100%;
|
||||
position: relative;
|
||||
top: -1px;
|
||||
}
|
||||
|
||||
.fa-svg-icon svg {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.fa-svg-icon svg g,
|
||||
.fa-svg-icon svg path {
|
||||
fill: currentColor;
|
||||
}
|
||||
|
||||
.uib-datepicker .uib-title {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.uib-day button, .uib-month button, .uib-year button {
|
||||
min-width: 100%;
|
||||
}
|
||||
|
||||
.uib-left, .uib-right {
|
||||
width: 100%
|
||||
}
|
||||
|
||||
.uib-position-measure {
|
||||
display: block !important;
|
||||
visibility: hidden !important;
|
||||
position: absolute !important;
|
||||
top: -9999px !important;
|
||||
left: -9999px !important;
|
||||
}
|
||||
|
||||
.uib-position-scrollbar-measure {
|
||||
position: absolute !important;
|
||||
top: -9999px !important;
|
||||
width: 50px !important;
|
||||
height: 50px !important;
|
||||
overflow: scroll !important;
|
||||
}
|
||||
|
||||
.uib-position-body-scrollbar-measure {
|
||||
overflow: scroll !important;
|
||||
}
|
||||
.uib-datepicker-popup.dropdown-menu {
|
||||
display: block;
|
||||
float: none;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.uib-button-bar {
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
[uib-tooltip-popup].tooltip.top-left > .tooltip-arrow,
|
||||
[uib-tooltip-popup].tooltip.top-right > .tooltip-arrow,
|
||||
[uib-tooltip-popup].tooltip.bottom-left > .tooltip-arrow,
|
||||
[uib-tooltip-popup].tooltip.bottom-right > .tooltip-arrow,
|
||||
[uib-tooltip-popup].tooltip.left-top > .tooltip-arrow,
|
||||
[uib-tooltip-popup].tooltip.left-bottom > .tooltip-arrow,
|
||||
[uib-tooltip-popup].tooltip.right-top > .tooltip-arrow,
|
||||
[uib-tooltip-popup].tooltip.right-bottom > .tooltip-arrow,
|
||||
[uib-tooltip-html-popup].tooltip.top-left > .tooltip-arrow,
|
||||
[uib-tooltip-html-popup].tooltip.top-right > .tooltip-arrow,
|
||||
[uib-tooltip-html-popup].tooltip.bottom-left > .tooltip-arrow,
|
||||
[uib-tooltip-html-popup].tooltip.bottom-right > .tooltip-arrow,
|
||||
[uib-tooltip-html-popup].tooltip.left-top > .tooltip-arrow,
|
||||
[uib-tooltip-html-popup].tooltip.left-bottom > .tooltip-arrow,
|
||||
[uib-tooltip-html-popup].tooltip.right-top > .tooltip-arrow,
|
||||
[uib-tooltip-html-popup].tooltip.right-bottom > .tooltip-arrow,
|
||||
[uib-tooltip-template-popup].tooltip.top-left > .tooltip-arrow,
|
||||
[uib-tooltip-template-popup].tooltip.top-right > .tooltip-arrow,
|
||||
[uib-tooltip-template-popup].tooltip.bottom-left > .tooltip-arrow,
|
||||
[uib-tooltip-template-popup].tooltip.bottom-right > .tooltip-arrow,
|
||||
[uib-tooltip-template-popup].tooltip.left-top > .tooltip-arrow,
|
||||
[uib-tooltip-template-popup].tooltip.left-bottom > .tooltip-arrow,
|
||||
[uib-tooltip-template-popup].tooltip.right-top > .tooltip-arrow,
|
||||
[uib-tooltip-template-popup].tooltip.right-bottom > .tooltip-arrow,
|
||||
[uib-popover-popup].popover.top-left > .arrow,
|
||||
[uib-popover-popup].popover.top-right > .arrow,
|
||||
[uib-popover-popup].popover.bottom-left > .arrow,
|
||||
[uib-popover-popup].popover.bottom-right > .arrow,
|
||||
[uib-popover-popup].popover.left-top > .arrow,
|
||||
[uib-popover-popup].popover.left-bottom > .arrow,
|
||||
[uib-popover-popup].popover.right-top > .arrow,
|
||||
[uib-popover-popup].popover.right-bottom > .arrow,
|
||||
[uib-popover-html-popup].popover.top-left > .arrow,
|
||||
[uib-popover-html-popup].popover.top-right > .arrow,
|
||||
[uib-popover-html-popup].popover.bottom-left > .arrow,
|
||||
[uib-popover-html-popup].popover.bottom-right > .arrow,
|
||||
[uib-popover-html-popup].popover.left-top > .arrow,
|
||||
[uib-popover-html-popup].popover.left-bottom > .arrow,
|
||||
[uib-popover-html-popup].popover.right-top > .arrow,
|
||||
[uib-popover-html-popup].popover.right-bottom > .arrow,
|
||||
[uib-popover-template-popup].popover.top-left > .arrow,
|
||||
[uib-popover-template-popup].popover.top-right > .arrow,
|
||||
[uib-popover-template-popup].popover.bottom-left > .arrow,
|
||||
[uib-popover-template-popup].popover.bottom-right > .arrow,
|
||||
[uib-popover-template-popup].popover.left-top > .arrow,
|
||||
[uib-popover-template-popup].popover.left-bottom > .arrow,
|
||||
[uib-popover-template-popup].popover.right-top > .arrow,
|
||||
[uib-popover-template-popup].popover.right-bottom > .arrow {
|
||||
top: auto;
|
||||
bottom: auto;
|
||||
left: auto;
|
||||
right: auto;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
[uib-popover-popup].popover,
|
||||
[uib-popover-html-popup].popover,
|
||||
[uib-popover-template-popup].popover {
|
||||
display: block !important;
|
||||
}
|
||||
|
||||
.uib-time input {
|
||||
/* Bootstrap 4 overrides this otherwise */
|
||||
width: 50px !important;
|
||||
}
|
||||
|
||||
[uib-typeahead-popup].dropdown-menu {
|
||||
display: block;
|
||||
}
|
||||
@@ -0,0 +1,335 @@
|
||||
/* global FastClick, smoothScroll */
|
||||
angular.module('ui.bootstrap.demo', ['ui.bootstrap', 'plunker', 'ngTouch', 'ngAnimate', 'ngSanitize'], function($httpProvider){
|
||||
if (!!window.FastClick) {
|
||||
FastClick.attach(document.body);
|
||||
}
|
||||
delete $httpProvider.defaults.headers.common['X-Requested-With'];
|
||||
}).run(['$location', function($location){
|
||||
//Allows us to navigate to the correct element on initialization
|
||||
if ($location.path() !== '' && $location.path() !== '/') {
|
||||
smoothScroll(document.getElementById($location.path().substring(1)), 500, function(el) {
|
||||
location.replace('#' + el.id);
|
||||
});
|
||||
}
|
||||
}]).factory('buildFilesService', function ($http, $q) {
|
||||
|
||||
var moduleMap;
|
||||
var rawFiles;
|
||||
|
||||
return {
|
||||
getModuleMap: getModuleMap,
|
||||
getRawFiles: getRawFiles,
|
||||
get: function () {
|
||||
return $q.all({
|
||||
moduleMap: getModuleMap(),
|
||||
rawFiles: getRawFiles()
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
function getModuleMap() {
|
||||
return moduleMap ? $q.when(moduleMap) : $http.get('assets/module-mapping.json')
|
||||
.then(function (result) {
|
||||
moduleMap = result.data;
|
||||
return moduleMap;
|
||||
});
|
||||
}
|
||||
|
||||
function getRawFiles() {
|
||||
return rawFiles ? $q.when(rawFiles) : $http.get('assets/raw-files.json')
|
||||
.then(function (result) {
|
||||
rawFiles = result.data;
|
||||
return rawFiles;
|
||||
});
|
||||
}
|
||||
|
||||
})
|
||||
.controller('MainCtrl', MainCtrl)
|
||||
.controller('SelectModulesCtrl', SelectModulesCtrl)
|
||||
.controller('DownloadCtrl', DownloadCtrl);
|
||||
|
||||
function MainCtrl($scope, $http, $document, $uibModal, orderByFilter) {
|
||||
// Grab old version docs
|
||||
$http.get('/ui-bootstrap4/versions-mapping.json')
|
||||
.then(function(result) {
|
||||
$scope.oldDocs = result.data;
|
||||
})
|
||||
.catch(function(response)
|
||||
{
|
||||
if(response.status === 404)
|
||||
{
|
||||
$http.get('/versions-mapping.json')
|
||||
.then(function(result) {
|
||||
$scope.oldDocs = result.data;
|
||||
})
|
||||
.catch(function(response)
|
||||
{
|
||||
console.log('failed to get versions mapping:', response);
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
console.log('failed to get versions mapping:', response);
|
||||
}
|
||||
});
|
||||
|
||||
$scope.showBuildModal = function() {
|
||||
var modalInstance = $uibModal.open({
|
||||
templateUrl: 'buildModal.html',
|
||||
controller: 'SelectModulesCtrl',
|
||||
resolve: {
|
||||
modules: function(buildFilesService) {
|
||||
return buildFilesService.getModuleMap()
|
||||
.then(function (moduleMap) {
|
||||
return Object.keys(moduleMap);
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
$scope.showDownloadModal = function() {
|
||||
var modalInstance = $uibModal.open({
|
||||
templateUrl: 'downloadModal.html',
|
||||
controller: 'DownloadCtrl'
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
function SelectModulesCtrl($scope, $uibModalInstance, modules, buildFilesService) {
|
||||
$scope.selectedModules = [];
|
||||
$scope.modules = modules;
|
||||
|
||||
$scope.selectedChanged = function(module, selected) {
|
||||
if (selected) {
|
||||
$scope.selectedModules.push(module);
|
||||
} else {
|
||||
$scope.selectedModules.splice($scope.selectedModules.indexOf(module), 1);
|
||||
}
|
||||
};
|
||||
|
||||
$scope.downloadBuild = function () {
|
||||
$uibModalInstance.close($scope.selectedModules);
|
||||
};
|
||||
|
||||
$scope.cancel = function () {
|
||||
$uibModalInstance.dismiss();
|
||||
};
|
||||
|
||||
$scope.isOldBrowser = function () {
|
||||
return isOldBrowser;
|
||||
};
|
||||
|
||||
$scope.build = function (selectedModules, version) {
|
||||
/* global JSZip, saveAs */
|
||||
var moduleMap, rawFiles;
|
||||
|
||||
buildFilesService.get().then(function (buildFiles) {
|
||||
moduleMap = buildFiles.moduleMap;
|
||||
rawFiles = buildFiles.rawFiles;
|
||||
|
||||
generateBuild();
|
||||
});
|
||||
|
||||
function generateBuild() {
|
||||
var srcModuleNames = selectedModules
|
||||
.map(function (module) {
|
||||
return moduleMap[module];
|
||||
})
|
||||
.reduce(function (toBuild, module) {
|
||||
addIfNotExists(toBuild, module.name);
|
||||
|
||||
module.dependencies.forEach(function (depName) {
|
||||
addIfNotExists(toBuild, depName);
|
||||
});
|
||||
return toBuild;
|
||||
}, []);
|
||||
|
||||
var srcModules = srcModuleNames
|
||||
.map(function (moduleName) {
|
||||
return moduleMap[moduleName];
|
||||
});
|
||||
|
||||
var srcModuleFullNames = srcModules
|
||||
.map(function (module) {
|
||||
return module.moduleName;
|
||||
});
|
||||
|
||||
var srcJsContent = srcModules
|
||||
.reduce(function (buildFiles, module) {
|
||||
return buildFiles.concat(module.srcFiles);
|
||||
}, [])
|
||||
.map(getFileContent)
|
||||
.join('\n')
|
||||
;
|
||||
|
||||
var jsFile = createNoTplFile(srcModuleFullNames, srcJsContent);
|
||||
|
||||
var tplModuleNames = srcModules
|
||||
.reduce(function (tplModuleNames, module) {
|
||||
return tplModuleNames.concat(module.tplModules);
|
||||
}, []);
|
||||
|
||||
var tplJsContent = srcModules
|
||||
.reduce(function (buildFiles, module) {
|
||||
return buildFiles.concat(module.tpljsFiles);
|
||||
}, [])
|
||||
.map(getFileContent)
|
||||
.join('\n')
|
||||
;
|
||||
|
||||
var jsTplFile = createWithTplFile(srcModuleFullNames, srcJsContent, tplModuleNames, tplJsContent);
|
||||
|
||||
var cssContent = srcModules
|
||||
.map(function (module) {
|
||||
return module.css;
|
||||
})
|
||||
.filter(function (css) {
|
||||
return css;
|
||||
})
|
||||
.join('\n')
|
||||
;
|
||||
|
||||
var cssJsContent = srcModules
|
||||
.map(function (module) {
|
||||
return module.cssJs;
|
||||
})
|
||||
.filter(function (cssJs) {
|
||||
return cssJs;
|
||||
})
|
||||
.join('\n')
|
||||
;
|
||||
|
||||
var footer = cssJsContent;
|
||||
|
||||
var zip = new JSZip();
|
||||
zip.file('ui-bootstrap-custom-' + version + '.js', rawFiles.banner + jsFile + footer);
|
||||
zip.file('ui-bootstrap-custom-' + version + '.min.js', rawFiles.banner + uglify(jsFile + footer));
|
||||
zip.file('ui-bootstrap-custom-tpls-' + version + '.js', rawFiles.banner + jsTplFile + footer);
|
||||
zip.file('ui-bootstrap-custom-tpls-' + version + '.min.js', rawFiles.banner + uglify(jsTplFile + footer));
|
||||
zip.file('ui-bootstrap-custom-tpls-' + version + '.min.js', rawFiles.banner + uglify(jsTplFile + footer));
|
||||
|
||||
if (cssContent) {
|
||||
zip.file('ui-bootstrap-custom-' + version + '-csp.css', rawFiles.cssBanner + cssContent);
|
||||
}
|
||||
|
||||
saveAs(zip.generate({type: 'blob'}), 'ui-bootstrap-custom-build.zip');
|
||||
}
|
||||
|
||||
function createNoTplFile(srcModuleNames, srcJsContent) {
|
||||
return 'angular.module("ui.bootstrap", [' + srcModuleNames.join(',') + ']);\n' +
|
||||
srcJsContent;
|
||||
}
|
||||
|
||||
function createWithTplFile(srcModuleNames, srcJsContent, tplModuleNames, tplJsContent) {
|
||||
var depModuleNames = srcModuleNames.slice();
|
||||
depModuleNames.unshift('"ui.bootstrap.tpls"');
|
||||
|
||||
return 'angular.module("ui.bootstrap", [' + depModuleNames.join(',') + ']);\n' +
|
||||
'angular.module("ui.bootstrap.tpls", [' + tplModuleNames.join(',') + ']);\n' +
|
||||
srcJsContent + '\n' + tplJsContent;
|
||||
|
||||
}
|
||||
|
||||
function addIfNotExists(array, element) {
|
||||
if (array.indexOf(element) == -1) {
|
||||
array.push(element);
|
||||
}
|
||||
}
|
||||
|
||||
function getFileContent(fileName) {
|
||||
return rawFiles.files[fileName];
|
||||
}
|
||||
|
||||
function uglify(js) {
|
||||
/* global UglifyJS */
|
||||
|
||||
var ast = UglifyJS.parse(js);
|
||||
ast.figure_out_scope();
|
||||
|
||||
var compressor = UglifyJS.Compressor();
|
||||
var compressedAst = ast.transform(compressor);
|
||||
|
||||
compressedAst.figure_out_scope();
|
||||
compressedAst.compute_char_frequency();
|
||||
compressedAst.mangle_names();
|
||||
|
||||
var stream = UglifyJS.OutputStream();
|
||||
compressedAst.print(stream);
|
||||
|
||||
return stream.toString();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
function DownloadCtrl($scope, $uibModalInstance) {
|
||||
$scope.options = {
|
||||
minified: true,
|
||||
tpls: true
|
||||
};
|
||||
|
||||
$scope.download = function (version) {
|
||||
var options = $scope.options;
|
||||
|
||||
var downloadUrl = ['ui-bootstrap-'];
|
||||
if (options.tpls) {
|
||||
downloadUrl.push('tpls-');
|
||||
}
|
||||
downloadUrl.push(version);
|
||||
if (options.minified) {
|
||||
downloadUrl.push('.min');
|
||||
}
|
||||
downloadUrl.push('.js');
|
||||
|
||||
return downloadUrl.join('');
|
||||
};
|
||||
|
||||
$scope.cancel = function () {
|
||||
$uibModalInstance.dismiss();
|
||||
};
|
||||
}
|
||||
|
||||
/*
|
||||
* The following compatibility check is from:
|
||||
*
|
||||
* Bootstrap Customizer (http://getbootstrap.com/customize/)
|
||||
* Copyright 2011-2014 Twitter, Inc.
|
||||
*
|
||||
* Licensed under the Creative Commons Attribution 3.0 Unported License. For
|
||||
* details, see http://creativecommons.org/licenses/by/3.0/.
|
||||
*/
|
||||
var isOldBrowser;
|
||||
(function () {
|
||||
|
||||
var supportsFile = (window.File && window.FileReader && window.FileList && window.Blob);
|
||||
function failback() {
|
||||
isOldBrowser = true;
|
||||
}
|
||||
/**
|
||||
* Based on:
|
||||
* Blob Feature Check v1.1.0
|
||||
* https://github.com/ssorallen/blob-feature-check/
|
||||
* License: Public domain (http://unlicense.org)
|
||||
*/
|
||||
var url = window.URL;
|
||||
var svg = new Blob(
|
||||
['<svg xmlns=\'http://www.w3.org/2000/svg\'></svg>'],
|
||||
{ type: 'image/svg+xml;charset=utf-8' }
|
||||
);
|
||||
var objectUrl = url.createObjectURL(svg);
|
||||
|
||||
if (/^blob:/.exec(objectUrl) === null || !supportsFile) {
|
||||
// `URL.createObjectURL` created a URL that started with something other
|
||||
// than "blob:", which means it has been polyfilled and is not supported by
|
||||
// this browser.
|
||||
failback();
|
||||
} else {
|
||||
angular.element('<img/>')
|
||||
.on('load', function () {
|
||||
isOldBrowser = false;
|
||||
})
|
||||
.on('error', failback)
|
||||
.attr('src', objectUrl);
|
||||
}
|
||||
|
||||
})();
|
||||
@@ -0,0 +1,323 @@
|
||||
body {
|
||||
opacity: 1;
|
||||
-webkit-transition: opacity 1s ease;
|
||||
-moz-transition: opacity 1s ease;
|
||||
transition: opacity 1s;
|
||||
}
|
||||
|
||||
.ng-cloak {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.ng-invalid {
|
||||
border: 1px solid red !important;
|
||||
}
|
||||
|
||||
section {
|
||||
padding-top: 30px;
|
||||
}
|
||||
|
||||
.page-header h1 > small > a {
|
||||
color: #999;
|
||||
}
|
||||
.page-header h1 > small > a:hover {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.footer {
|
||||
text-align: center;
|
||||
padding: 30px 0;
|
||||
margin-top: 70px;
|
||||
border-top: 1px solid #e5e5e5;
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
|
||||
.bs-social {
|
||||
margin-top: 20px;
|
||||
margin-bottom: 20px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
@media (min-width: 768px) {
|
||||
|
||||
.bs-social {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.nav, .pagination, .carousel, .panel-title a {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.bs-social-buttons {
|
||||
display: inline-block;
|
||||
margin-bottom: 0;
|
||||
padding-left: 0;
|
||||
list-style: none;
|
||||
}
|
||||
.bs-social-buttons li {
|
||||
display: inline-block;
|
||||
padding: 5px 8px;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
@media (max-width: 767px) {
|
||||
|
||||
.visible-xs.collapse.in {
|
||||
display: block!important;
|
||||
}
|
||||
.visible-xs.collapse {
|
||||
display: none!important;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.navbar-fixed-top .collapse {
|
||||
border-top: 1px solid #e7e7e7;
|
||||
margin-left: -15px;
|
||||
margin-right: -15px;
|
||||
padding-right: 15px;
|
||||
padding-left: 15px;
|
||||
}
|
||||
|
||||
.show-grid {
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
|
||||
/*
|
||||
* Container
|
||||
*
|
||||
* Tweak to width of container.
|
||||
*/
|
||||
|
||||
/*@media (min-width: 1200px) {
|
||||
.container{
|
||||
max-width: 970px;
|
||||
}
|
||||
}*/
|
||||
|
||||
/*
|
||||
* Tabs
|
||||
*
|
||||
* Tweaks to the Tabs.
|
||||
*/
|
||||
|
||||
.code .nav-tabs {
|
||||
border-bottom: 1px solid #ccc;
|
||||
}
|
||||
|
||||
.code pre, .code code {
|
||||
border-top: none;
|
||||
border-top-left-radius: 0;
|
||||
border-top-right-radius: 0;
|
||||
}
|
||||
|
||||
.code .nav-tabs>li.active>a, .code .nav-tabs>li.active>a:hover, .code .nav-tabs>li.active>a:focus {
|
||||
background-color: #f8f8f8;
|
||||
border: 1px solid #ccc;
|
||||
border-bottom-color: transparent;
|
||||
}
|
||||
|
||||
/*
|
||||
* Button Inverse
|
||||
*
|
||||
* Buttons in the masthead.
|
||||
*/
|
||||
|
||||
.btn-outline-inverse {
|
||||
color: #fff;
|
||||
background-color: transparent;
|
||||
border-color: #cdbfe3;
|
||||
margin: 10px;
|
||||
}
|
||||
|
||||
@media (min-width: 768px) {
|
||||
|
||||
.btn-outline-inverse {
|
||||
width: auto;
|
||||
margin: 20px 5px 20px 0;
|
||||
padding: 18px 24px;
|
||||
font-size: 21px;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.btn-outline-inverse:hover, .btn-outline-inverse:focus, .btn-outline-inverse:active {
|
||||
color: #563d7c;
|
||||
text-shadow: none;
|
||||
background-color: #fff;
|
||||
border-color: #fff;
|
||||
}
|
||||
|
||||
|
||||
/* Page headers */
|
||||
.bs-header {
|
||||
padding: 30px 15px 40px; /* side padding builds on .container 15px, so 30px */
|
||||
font-size: 16px;
|
||||
text-align: center;
|
||||
text-shadow: 0 1px 0 rgba(0,0,0,.15);
|
||||
color: #cdbfe3;
|
||||
background-color: #563d7c;
|
||||
background-image: url(header.png);
|
||||
}
|
||||
.bs-header a {
|
||||
color: #fff;
|
||||
font-weight: normal;
|
||||
}
|
||||
.bs-header h1 {
|
||||
color: #fff;
|
||||
}
|
||||
.bs-header p {
|
||||
font-weight: 200;
|
||||
line-height: 1.4;
|
||||
}
|
||||
.bs-header .container {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
@media (min-width: 768px) {
|
||||
.bs-header {
|
||||
font-size: 30px;
|
||||
text-align: left;
|
||||
}
|
||||
.bs-header h1 {
|
||||
font-size: 100px;
|
||||
line-height: 1;
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 992px) {
|
||||
.bs-header p {
|
||||
margin-right: 25%;
|
||||
}
|
||||
}
|
||||
|
||||
.navbar-inner {
|
||||
-webkit-box-shadow: 0 3px 3px rgba(0,0,0,0.175);
|
||||
box-shadow: 0 3px 3px rgba(0,0,0,0.175);
|
||||
}
|
||||
|
||||
/*
|
||||
* Side navigation
|
||||
*
|
||||
* Scrollspy and affixed enhanced navigation to highlight sections and secondary
|
||||
* sections of docs content.
|
||||
*/
|
||||
|
||||
/* By default it's not affixed in mobile views, so undo that */
|
||||
.bs-sidebar.affix {
|
||||
position: static;
|
||||
}
|
||||
|
||||
/* First level of nav */
|
||||
.bs-sidenav {
|
||||
margin-top: 30px;
|
||||
margin-bottom: 30px;
|
||||
padding-top: 10px;
|
||||
padding-bottom: 10px;
|
||||
text-shadow: 0 1px 0 #fff;
|
||||
background-color: #f7f5fa;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
/* All levels of nav */
|
||||
.bs-sidebar .nav > li > a {
|
||||
display: block;
|
||||
color: #716b7a;
|
||||
padding: 5px 20px;
|
||||
}
|
||||
.bs-sidebar .nav > li > a:hover,
|
||||
.bs-sidebar .nav > li > a:focus {
|
||||
text-decoration: none;
|
||||
background-color: #e5e3e9;
|
||||
border-right: 1px solid #dbd8e0;
|
||||
}
|
||||
.bs-sidebar .nav > .active > a,
|
||||
.bs-sidebar .nav > .active:hover > a,
|
||||
.bs-sidebar .nav > .active:focus > a {
|
||||
font-weight: bold;
|
||||
color: #563d7c;
|
||||
background-color: transparent;
|
||||
border-right: 1px solid #563d7c;
|
||||
}
|
||||
|
||||
/* Nav: second level (shown on .active) */
|
||||
.bs-sidebar .nav .nav {
|
||||
display: none; /* Hide by default, but at >768px, show it */
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
.bs-sidebar .nav .nav > li > a {
|
||||
padding-top: 3px;
|
||||
padding-bottom: 3px;
|
||||
padding-left: 30px;
|
||||
font-size: 90%;
|
||||
}
|
||||
|
||||
/* Show and affix the side nav when space allows it */
|
||||
@media (min-width: 992px) {
|
||||
.bs-sidebar .nav > .active > ul {
|
||||
display: block;
|
||||
}
|
||||
/* Widen the fixed sidebar */
|
||||
.bs-sidebar.affix,
|
||||
.bs-sidebar.affix-bottom {
|
||||
width: 213px;
|
||||
}
|
||||
.bs-sidebar.affix {
|
||||
position: fixed; /* Undo the static from mobile first approach */
|
||||
top: 80px;
|
||||
}
|
||||
.bs-sidebar.affix-bottom {
|
||||
position: absolute; /* Undo the static from mobile first approach */
|
||||
}
|
||||
.bs-sidebar.affix-bottom .bs-sidenav,
|
||||
.bs-sidebar.affix .bs-sidenav {
|
||||
margin-top: 0;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
@media (min-width: 1200px) {
|
||||
/* Widen the fixed sidebar again */
|
||||
.bs-sidebar.affix-bottom,
|
||||
.bs-sidebar.affix {
|
||||
width: 263px;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Not enough room on mobile for markup tab, js tab, and plunk btn.
|
||||
And no one cares about plunk button on a phone anyway */
|
||||
@media only screen and (max-device-width: 480px) {
|
||||
#plunk-btn {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
.navbar-nav .dropdown .navbar-brand {
|
||||
max-width: 100%;
|
||||
margin-right: inherit;
|
||||
margin-left: inherit;
|
||||
}
|
||||
|
||||
.header-placeholder {
|
||||
height: 50px;
|
||||
}
|
||||
|
||||
@media screen and (min-width: 768px) {
|
||||
|
||||
.dropdown.open > .navbar-brand + .dropdown-menu {
|
||||
left: 10px;
|
||||
}
|
||||
|
||||
.header-placeholder {
|
||||
height: 50px;
|
||||
}
|
||||
|
||||
.navbar-nav .dropdown .navbar-brand {
|
||||
max-width: 200px;
|
||||
margin-right: 5px;
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
}
|
||||
|
After Width: | Height: | Size: 8.2 KiB |
|
After Width: | Height: | Size: 398 B |
|
After Width: | Height: | Size: 37 KiB |
|
After Width: | Height: | Size: 8.6 KiB |
|
After Width: | Height: | Size: 12 KiB |
@@ -0,0 +1,60 @@
|
||||
angular.module('plunker', [])
|
||||
|
||||
.factory('plunkGenerator', function ($document) {
|
||||
|
||||
return function (ngVersion, bsVersion, version, module, content) {
|
||||
|
||||
var form = angular.element('<form style="display: none;" method="post" action="https://plnkr.co/edit/?p=preview" target="_blank"></form>');
|
||||
var addField = function (name, value) {
|
||||
var input = angular.element('<input type="hidden" name="' + name + '">');
|
||||
input.attr('value', value);
|
||||
form.append(input);
|
||||
};
|
||||
|
||||
var indexContent = function (content, version) {
|
||||
return '<!doctype html>\n' +
|
||||
'<html ng-app="ui.bootstrap.demo">\n' +
|
||||
' <head>\n' +
|
||||
' <script src="//ajax.googleapis.com/ajax/libs/angularjs/'+ngVersion+'/angular.js"></script>\n' +
|
||||
' <script src="//ajax.googleapis.com/ajax/libs/angularjs/'+ngVersion+'/angular-animate.js"></script>\n' +
|
||||
' <script src="//ajax.googleapis.com/ajax/libs/angularjs/'+ngVersion+'/angular-sanitize.js"></script>\n' +
|
||||
' <script src="//angular-ui.github.io/bootstrap/ui-bootstrap-tpls-'+version+'.js"></script>\n' +
|
||||
' <script src="example.js"></script>\n' +
|
||||
' <link href="//netdna.bootstrapcdn.com/bootstrap/'+bsVersion+'/css/bootstrap.min.css" rel="stylesheet">\n' +
|
||||
' </head>\n' +
|
||||
' <body>\n\n' +
|
||||
content + '\n' +
|
||||
' </body>\n' +
|
||||
'</html>\n';
|
||||
};
|
||||
|
||||
var scriptContent = function(content) {
|
||||
return "angular.module('ui.bootstrap.demo', ['ngAnimate', 'ngSanitize', 'ui.bootstrap']);" + "\n" + content;
|
||||
};
|
||||
|
||||
addField('description', 'http://angular-ui.github.io/bootstrap/');
|
||||
addField('files[index.html]', indexContent(content.markup, version));
|
||||
addField('files[example.js]', scriptContent(content.javascript));
|
||||
|
||||
$document.find('body').append(form);
|
||||
form[0].submit();
|
||||
form.remove();
|
||||
};
|
||||
})
|
||||
|
||||
.controller('PlunkerCtrl', function ($scope, plunkGenerator) {
|
||||
|
||||
$scope.content = {};
|
||||
|
||||
$scope.edit = function (ngVersion, bsVersion, version, module) {
|
||||
plunkGenerator(ngVersion, bsVersion, version, module, $scope.content);
|
||||
};
|
||||
})
|
||||
|
||||
.directive('plunkerContent', function () {
|
||||
return {
|
||||
link:function (scope, element, attrs) {
|
||||
scope.content[attrs.plunkerContent] = element.text().trim();
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,59 @@
|
||||
/**
|
||||
* Generic language patterns
|
||||
*
|
||||
* @author Craig Campbell
|
||||
* @version 1.0.9
|
||||
*/
|
||||
Rainbow.extend([
|
||||
{
|
||||
'matches': {
|
||||
1: {
|
||||
'name': 'keyword.operator',
|
||||
'pattern': /\=/g
|
||||
},
|
||||
2: {
|
||||
'name': 'string',
|
||||
'matches': {
|
||||
'name': 'constant.character.escape',
|
||||
'pattern': /\\('|"){1}/g
|
||||
}
|
||||
}
|
||||
},
|
||||
'pattern': /(\(|\s|\[|\=|:)(('|")([^\\\1]|\\.)*?(\3))/gm
|
||||
},
|
||||
{
|
||||
'name': 'comment',
|
||||
'pattern': /\/\*[\s\S]*?\*\/|(\/\/|\#)[\s\S]*?$/gm
|
||||
},
|
||||
{
|
||||
'name': 'constant.numeric',
|
||||
'pattern': /\b(\d+(\.\d+)?(e(\+|\-)?\d+)?(f|d)?|0x[\da-f]+)\b/gi
|
||||
},
|
||||
{
|
||||
'matches': {
|
||||
1: 'keyword'
|
||||
},
|
||||
'pattern': /\b(and|array|as|bool(ean)?|c(atch|har|lass|onst)|d(ef|elete|o(uble)?)|e(cho|lse(if)?|xit|xtends|xcept)|f(inally|loat|or(each)?|unction)|global|if|import|int(eger)?|long|new|object|or|pr(int|ivate|otected)|public|return|self|st(ring|ruct|atic)|switch|th(en|is|row)|try|(un)?signed|var|void|while)(?=\(|\b)/gi
|
||||
},
|
||||
{
|
||||
'name': 'constant.language',
|
||||
'pattern': /true|false|null/g
|
||||
},
|
||||
{
|
||||
'name': 'keyword.operator',
|
||||
'pattern': /\+|\!|\-|&(gt|lt|amp);|\||\*|\=/g
|
||||
},
|
||||
{
|
||||
'matches': {
|
||||
1: 'function.call'
|
||||
},
|
||||
'pattern': /(\w+?)(?=\()/g
|
||||
},
|
||||
{
|
||||
'matches': {
|
||||
1: 'storage.function',
|
||||
2: 'entity.name.function'
|
||||
},
|
||||
'pattern': /(function)\s(.*?)(?=\()/g
|
||||
}
|
||||
]);
|
||||
@@ -0,0 +1,83 @@
|
||||
/**
|
||||
* HTML patterns
|
||||
*
|
||||
* @author Craig Campbell
|
||||
* @version 1.0.7
|
||||
*/
|
||||
Rainbow.extend('html', [
|
||||
{
|
||||
'name': 'source.php.embedded',
|
||||
'matches': {
|
||||
2: {
|
||||
'language': 'php'
|
||||
}
|
||||
},
|
||||
'pattern': /<\?=?(?!xml)(php)?([\s\S]*?)(\?>)/gm
|
||||
},
|
||||
{
|
||||
'name': 'source.css.embedded',
|
||||
'matches': {
|
||||
0: {
|
||||
'language': 'css'
|
||||
}
|
||||
},
|
||||
'pattern': /<style(.*?)>([\s\S]*?)<\/style>/gm
|
||||
},
|
||||
{
|
||||
'name': 'source.js.embedded',
|
||||
'matches': {
|
||||
0: {
|
||||
'language': 'javascript'
|
||||
}
|
||||
},
|
||||
'pattern': /<script(?! src)(.*?)>([\s\S]*?)<\/script>/gm
|
||||
},
|
||||
{
|
||||
'name': 'comment.html',
|
||||
'pattern': /<\!--[\S\s]*?-->/g
|
||||
},
|
||||
{
|
||||
'matches': {
|
||||
1: 'support.tag.open',
|
||||
2: 'support.tag.cclose'
|
||||
},
|
||||
'pattern': /(<)|(\/?\??>)/g
|
||||
},
|
||||
{
|
||||
'name': 'support.tag',
|
||||
'matches': {
|
||||
1: 'support.tag',
|
||||
2: 'support.tag.special',
|
||||
3: 'support.tag-name'
|
||||
},
|
||||
'pattern': /(<\??)(\/|\!?)(\w+)/g
|
||||
},
|
||||
{
|
||||
'matches': {
|
||||
1: 'support.attribute'
|
||||
},
|
||||
'pattern': /([a-z-]+)(?=\=)/gi
|
||||
},
|
||||
{
|
||||
'matches': {
|
||||
1: 'support.operator',
|
||||
2: 'string.quote',
|
||||
3: 'string.value',
|
||||
4: 'string.quote'
|
||||
},
|
||||
'pattern': /(=)('|")(.*?)(\2)/g
|
||||
},
|
||||
{
|
||||
'matches': {
|
||||
1: 'support.operator',
|
||||
2: 'support.value'
|
||||
},
|
||||
'pattern': /(=)([a-zA-Z\-0-9]*)\b/g
|
||||
},
|
||||
{
|
||||
'matches': {
|
||||
1: 'support.attribute'
|
||||
},
|
||||
'pattern': /\s(\w+)(?=\s|>)(?![\s\S]*<)/g
|
||||
}
|
||||
], true);
|
||||
@@ -0,0 +1,110 @@
|
||||
/**
|
||||
* Javascript patterns
|
||||
*
|
||||
* @author Craig Campbell
|
||||
* @version 1.0.7
|
||||
*/
|
||||
Rainbow.extend('javascript', [
|
||||
|
||||
/**
|
||||
* matches $. or $(
|
||||
*/
|
||||
{
|
||||
'name': 'selector',
|
||||
'pattern': /(\s|^)\$(?=\.|\()/g
|
||||
},
|
||||
{
|
||||
'name': 'support',
|
||||
'pattern': /\b(window|document)\b/g
|
||||
},
|
||||
{
|
||||
'matches': {
|
||||
1: 'support.property'
|
||||
},
|
||||
'pattern': /\.(length|node(Name|Value))\b/g
|
||||
},
|
||||
{
|
||||
'matches': {
|
||||
1: 'support.function'
|
||||
},
|
||||
'pattern': /(setTimeout|setInterval)(?=\()/g
|
||||
|
||||
},
|
||||
{
|
||||
'matches': {
|
||||
1: 'support.method'
|
||||
},
|
||||
'pattern': /\.(getAttribute|push|getElementById|getElementsByClassName|log|setTimeout|setInterval)(?=\()/g
|
||||
},
|
||||
{
|
||||
'matches': {
|
||||
1: 'support.tag.script',
|
||||
2: [
|
||||
{
|
||||
'name': 'string',
|
||||
'pattern': /('|")(.*?)(\1)/g
|
||||
},
|
||||
{
|
||||
'name': 'entity.tag.script',
|
||||
'pattern': /(\w+)/g
|
||||
}
|
||||
],
|
||||
3: 'support.tag.script'
|
||||
},
|
||||
'pattern': /(<\/?)(script.*?)(>)/g
|
||||
},
|
||||
|
||||
/**
|
||||
* matches any escaped characters inside of a js regex pattern
|
||||
*
|
||||
* @see https://github.com/ccampbell/rainbow/issues/22
|
||||
*
|
||||
* this was causing single line comments to fail so it now makes sure
|
||||
* the opening / is not directly followed by a *
|
||||
*
|
||||
* @todo check that there is valid regex in match group 1
|
||||
*/
|
||||
{
|
||||
'name': 'string.regexp',
|
||||
'matches': {
|
||||
1: 'string.regexp.open',
|
||||
2: {
|
||||
'name': 'constant.regexp.escape',
|
||||
'pattern': /\\(.){1}/g
|
||||
},
|
||||
3: 'string.regexp.cclose',
|
||||
4: 'string.regexp.modifier'
|
||||
},
|
||||
'pattern': /(\/)(?!\*)(.+)(\/)([igm]{0,3})/g
|
||||
},
|
||||
|
||||
/**
|
||||
* matches runtime function declarations
|
||||
*/
|
||||
{
|
||||
'matches': {
|
||||
1: 'storage',
|
||||
3: 'entity.function'
|
||||
},
|
||||
'pattern': /(var)?(\s|^)(.*)(?=\s?=\s?function\()/g
|
||||
},
|
||||
|
||||
/**
|
||||
* matches constructor call
|
||||
*/
|
||||
{
|
||||
'matches': {
|
||||
1: 'keyword',
|
||||
2: 'entity.function'
|
||||
},
|
||||
'pattern': /(new)\s+(.*)(?=\()/g
|
||||
},
|
||||
|
||||
/**
|
||||
* matches any function call in the style functionName: function()
|
||||
*/
|
||||
{
|
||||
'name': 'entity.function',
|
||||
'pattern': /(\w+)(?=:\s{0,}function)/g
|
||||
}
|
||||
]);
|
||||
@@ -0,0 +1,88 @@
|
||||
/**
|
||||
* GitHub theme
|
||||
*
|
||||
* @author Craig Campbell
|
||||
* @version 1.0.4
|
||||
*/
|
||||
pre {
|
||||
border: 1px solid #ccc;
|
||||
word-wrap: break-word;
|
||||
padding: 6px 10px;
|
||||
line-height: 19px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
code {
|
||||
border: 1px solid #eaeaea;
|
||||
margin: 0 2px;
|
||||
padding: 0 5px;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
pre code {
|
||||
border: 0;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
-moz-border-radius: 0;
|
||||
-webkit-border-radius: 0;
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
pre, code {
|
||||
font-family: Consolas, 'Liberation Mono', Courier, monospace;
|
||||
color: #333;
|
||||
background: #f8f8f8;
|
||||
-moz-border-radius: 3px;
|
||||
-webkit-border-radius: 3px;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
pre, pre code {
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
pre .comment {
|
||||
color: #998;
|
||||
}
|
||||
|
||||
pre .support {
|
||||
color: #0086B3;
|
||||
}
|
||||
|
||||
pre .tag, pre .tag-name {
|
||||
color: navy;
|
||||
}
|
||||
|
||||
pre .keyword, pre .css-property, pre .vendor-prefix, pre .sass, pre .class, pre .id, pre .css-value, pre .entity.function, pre .storage.function {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
pre .css-property, pre .css-value, pre .vendor-prefix, pre .support.namespace {
|
||||
color: #333;
|
||||
}
|
||||
|
||||
pre .constant.numeric, pre .keyword.unit, pre .hex-color {
|
||||
font-weight: normal;
|
||||
color: #099;
|
||||
}
|
||||
|
||||
pre .entity.class {
|
||||
color: #458;
|
||||
}
|
||||
|
||||
pre .entity.id, pre .entity.function {
|
||||
color: #900;
|
||||
}
|
||||
|
||||
pre .attribute, pre .variable {
|
||||
color: teal;
|
||||
}
|
||||
|
||||
pre .string, pre .support.value {
|
||||
font-weight: normal;
|
||||
color: #d14;
|
||||
}
|
||||
|
||||
pre .regexp {
|
||||
color: #009926;
|
||||
}
|
||||
@@ -0,0 +1,773 @@
|
||||
/**
|
||||
* Copyright 2012 Craig Campbell
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* Rainbow is a simple code syntax highlighter
|
||||
*
|
||||
* @preserve @version 1.1.8
|
||||
* @url rainbowco.de
|
||||
*/
|
||||
window['Rainbow'] = (function() {
|
||||
|
||||
/**
|
||||
* array of replacements to process at the end
|
||||
*
|
||||
* @type {Object}
|
||||
*/
|
||||
var replacements = {},
|
||||
|
||||
/**
|
||||
* an array of start and end positions of blocks to be replaced
|
||||
*
|
||||
* @type {Object}
|
||||
*/
|
||||
replacement_positions = {},
|
||||
|
||||
/**
|
||||
* an array of the language patterns specified for each language
|
||||
*
|
||||
* @type {Object}
|
||||
*/
|
||||
language_patterns = {},
|
||||
|
||||
/**
|
||||
* an array of languages and whether they should bypass the default patterns
|
||||
*
|
||||
* @type {Object}
|
||||
*/
|
||||
bypass_defaults = {},
|
||||
|
||||
/**
|
||||
* processing level
|
||||
*
|
||||
* replacements are stored at this level so if there is a sub block of code
|
||||
* (for example php inside of html) it runs at a different level
|
||||
*
|
||||
* @type {number}
|
||||
*/
|
||||
CURRENT_LEVEL = 0,
|
||||
|
||||
/**
|
||||
* constant used to refer to the default language
|
||||
*
|
||||
* @type {number}
|
||||
*/
|
||||
DEFAULT_LANGUAGE = 0,
|
||||
|
||||
/**
|
||||
* used as counters so we can selectively call setTimeout
|
||||
* after processing a certain number of matches/replacements
|
||||
*
|
||||
* @type {number}
|
||||
*/
|
||||
match_counter = 0,
|
||||
|
||||
/**
|
||||
* @type {number}
|
||||
*/
|
||||
replacement_counter = 0,
|
||||
|
||||
/**
|
||||
* @type {null|string}
|
||||
*/
|
||||
global_class,
|
||||
|
||||
/**
|
||||
* @type {null|Function}
|
||||
*/
|
||||
onHighlight;
|
||||
|
||||
/**
|
||||
* cross browser get attribute for an element
|
||||
*
|
||||
* @see http://stackoverflow.com/questions/3755227/cross-browser-javascript-getattribute-method
|
||||
*
|
||||
* @param {Node} el
|
||||
* @param {string} attr attribute you are trying to get
|
||||
* @returns {string|number}
|
||||
*/
|
||||
function _attr(el, attr, attrs, i) {
|
||||
var result = (el.getAttribute && el.getAttribute(attr)) || 0;
|
||||
|
||||
if (!result) {
|
||||
attrs = el.attributes;
|
||||
|
||||
for (i = 0; i < attrs.length; ++i) {
|
||||
if (attrs[i].nodeName === attr) {
|
||||
return attrs[i].nodeValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* adds a class to a given code block
|
||||
*
|
||||
* @param {Element} el
|
||||
* @param {string} class_name class name to add
|
||||
* @returns void
|
||||
*/
|
||||
function _addClass(el, class_name) {
|
||||
el.className += el.className ? ' ' + class_name : class_name;
|
||||
}
|
||||
|
||||
/**
|
||||
* checks if a block has a given class
|
||||
*
|
||||
* @param {Element} el
|
||||
* @param {string} class_name class name to check for
|
||||
* @returns {boolean}
|
||||
*/
|
||||
function _hasClass(el, class_name) {
|
||||
return (' ' + el.className + ' ').indexOf(' ' + class_name + ' ') > -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* gets the language for this block of code
|
||||
*
|
||||
* @param {Element} block
|
||||
* @returns {string|null}
|
||||
*/
|
||||
function _getLanguageForBlock(block) {
|
||||
|
||||
// if this doesn't have a language but the parent does then use that
|
||||
// this means if for example you have: <pre data-language="php">
|
||||
// with a bunch of <code> blocks inside then you do not have
|
||||
// to specify the language for each block
|
||||
var language = _attr(block, 'data-language') || _attr(block.parentNode, 'data-language');
|
||||
|
||||
// this adds support for specifying language via a css class
|
||||
// you can use the Google Code Prettify style: <pre class="lang-php">
|
||||
// or the HTML5 style: <pre><code class="language-php">
|
||||
if (!language) {
|
||||
var pattern = /\blang(?:uage)?-(\w+)/,
|
||||
match = block.className.match(pattern) || block.parentNode.className.match(pattern);
|
||||
|
||||
if (match) {
|
||||
language = match[1];
|
||||
}
|
||||
}
|
||||
|
||||
return language;
|
||||
}
|
||||
|
||||
/**
|
||||
* makes sure html entities are always used for tags
|
||||
*
|
||||
* @param {string} code
|
||||
* @returns {string}
|
||||
*/
|
||||
function _htmlEntities(code) {
|
||||
return code.replace(/</g, '<').replace(/>/g, '>').replace(/&(?![\w\#]+;)/g, '&');
|
||||
}
|
||||
|
||||
/**
|
||||
* determines if a new match intersects with an existing one
|
||||
*
|
||||
* @param {number} start1 start position of existing match
|
||||
* @param {number} end1 end position of existing match
|
||||
* @param {number} start2 start position of new match
|
||||
* @param {number} end2 end position of new match
|
||||
* @returns {boolean}
|
||||
*/
|
||||
function _intersects(start1, end1, start2, end2) {
|
||||
if (start2 >= start1 && start2 < end1) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return end2 > start1 && end2 < end1;
|
||||
}
|
||||
|
||||
/**
|
||||
* determines if two different matches have complete overlap with each other
|
||||
*
|
||||
* @param {number} start1 start position of existing match
|
||||
* @param {number} end1 end position of existing match
|
||||
* @param {number} start2 start position of new match
|
||||
* @param {number} end2 end position of new match
|
||||
* @returns {boolean}
|
||||
*/
|
||||
function _hasCompleteOverlap(start1, end1, start2, end2) {
|
||||
|
||||
// if the starting and end positions are exactly the same
|
||||
// then the first one should stay and this one should be ignored
|
||||
if (start2 == start1 && end2 == end1) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return start2 <= start1 && end2 >= end1;
|
||||
}
|
||||
|
||||
/**
|
||||
* determines if the match passed in falls inside of an existing match
|
||||
* this prevents a regex pattern from matching inside of a bigger pattern
|
||||
*
|
||||
* @param {number} start - start position of new match
|
||||
* @param {number} end - end position of new match
|
||||
* @returns {boolean}
|
||||
*/
|
||||
function _matchIsInsideOtherMatch(start, end) {
|
||||
for (var key in replacement_positions[CURRENT_LEVEL]) {
|
||||
key = parseInt(key, 10);
|
||||
|
||||
// if this block completely overlaps with another block
|
||||
// then we should remove the other block and return false
|
||||
if (_hasCompleteOverlap(key, replacement_positions[CURRENT_LEVEL][key], start, end)) {
|
||||
delete replacement_positions[CURRENT_LEVEL][key];
|
||||
delete replacements[CURRENT_LEVEL][key];
|
||||
}
|
||||
|
||||
if (_intersects(key, replacement_positions[CURRENT_LEVEL][key], start, end)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* takes a string of code and wraps it in a span tag based on the name
|
||||
*
|
||||
* @param {string} name name of the pattern (ie keyword.regex)
|
||||
* @param {string} code block of code to wrap
|
||||
* @returns {string}
|
||||
*/
|
||||
function _wrapCodeInSpan(name, code) {
|
||||
return '<span class="' + name.replace(/\./g, ' ') + (global_class ? ' ' + global_class : '') + '">' + code + '</span>';
|
||||
}
|
||||
|
||||
/**
|
||||
* finds out the position of group match for a regular expression
|
||||
*
|
||||
* @see http://stackoverflow.com/questions/1985594/how-to-find-index-of-groups-in-match
|
||||
*
|
||||
* @param {Object} match
|
||||
* @param {number} group_number
|
||||
* @returns {number}
|
||||
*/
|
||||
function _indexOfGroup(match, group_number) {
|
||||
var index = 0,
|
||||
i;
|
||||
|
||||
for (i = 1; i < group_number; ++i) {
|
||||
if (match[i]) {
|
||||
index += match[i].length;
|
||||
}
|
||||
}
|
||||
|
||||
return index;
|
||||
}
|
||||
|
||||
/**
|
||||
* matches a regex pattern against a block of code
|
||||
* finds all matches that should be processed and stores the positions
|
||||
* of where they should be replaced within the string
|
||||
*
|
||||
* this is where pretty much all the work is done but it should not
|
||||
* be called directly
|
||||
*
|
||||
* @param {RegExp} pattern
|
||||
* @param {string} code
|
||||
* @returns void
|
||||
*/
|
||||
function _processPattern(regex, pattern, code, callback)
|
||||
{
|
||||
var match = regex.exec(code);
|
||||
|
||||
if (!match) {
|
||||
return callback();
|
||||
}
|
||||
|
||||
++match_counter;
|
||||
|
||||
// treat match 0 the same way as name
|
||||
if (!pattern['name'] && typeof pattern['matches'][0] == 'string') {
|
||||
pattern['name'] = pattern['matches'][0];
|
||||
delete pattern['matches'][0];
|
||||
}
|
||||
|
||||
var replacement = match[0],
|
||||
start_pos = match.index,
|
||||
end_pos = match[0].length + start_pos,
|
||||
|
||||
/**
|
||||
* callback to process the next match of this pattern
|
||||
*/
|
||||
processNext = function() {
|
||||
var nextCall = function() {
|
||||
_processPattern(regex, pattern, code, callback);
|
||||
};
|
||||
|
||||
// every 50 items we process let's call set timeout
|
||||
// to let the ui breathe a little
|
||||
return match_counter % 50 > 0 ? nextCall() : setTimeout(nextCall, 0);
|
||||
};
|
||||
|
||||
// if this is not a child match and it falls inside of another
|
||||
// match that already happened we should skip it and continue processing
|
||||
if (_matchIsInsideOtherMatch(start_pos, end_pos)) {
|
||||
return processNext();
|
||||
}
|
||||
|
||||
/**
|
||||
* callback for when a match was successfully processed
|
||||
*
|
||||
* @param {string} replacement
|
||||
* @returns void
|
||||
*/
|
||||
var onMatchSuccess = function(replacement) {
|
||||
// if this match has a name then wrap it in a span tag
|
||||
if (pattern['name']) {
|
||||
replacement = _wrapCodeInSpan(pattern['name'], replacement);
|
||||
}
|
||||
|
||||
// console.log('LEVEL', CURRENT_LEVEL, 'replace', match[0], 'with', replacement, 'at position', start_pos, 'to', end_pos);
|
||||
|
||||
// store what needs to be replaced with what at this position
|
||||
if (!replacements[CURRENT_LEVEL]) {
|
||||
replacements[CURRENT_LEVEL] = {};
|
||||
replacement_positions[CURRENT_LEVEL] = {};
|
||||
}
|
||||
|
||||
replacements[CURRENT_LEVEL][start_pos] = {
|
||||
'replace': match[0],
|
||||
'with': replacement
|
||||
};
|
||||
|
||||
// store the range of this match so we can use it for comparisons
|
||||
// with other matches later
|
||||
replacement_positions[CURRENT_LEVEL][start_pos] = end_pos;
|
||||
|
||||
// process the next match
|
||||
processNext();
|
||||
},
|
||||
|
||||
// if this pattern has sub matches for different groups in the regex
|
||||
// then we should process them one at a time by rerunning them through
|
||||
// this function to generate the new replacement
|
||||
//
|
||||
// we run through them backwards because the match position of earlier
|
||||
// matches will not change depending on what gets replaced in later
|
||||
// matches
|
||||
group_keys = keys(pattern['matches']),
|
||||
|
||||
/**
|
||||
* callback for processing a sub group
|
||||
*
|
||||
* @param {number} i
|
||||
* @param {Array} group_keys
|
||||
* @param {Function} callback
|
||||
*/
|
||||
processGroup = function(i, group_keys, callback) {
|
||||
if (i >= group_keys.length) {
|
||||
return callback(replacement);
|
||||
}
|
||||
|
||||
var processNextGroup = function() {
|
||||
processGroup(++i, group_keys, callback);
|
||||
},
|
||||
block = match[group_keys[i]];
|
||||
|
||||
// if there is no match here then move on
|
||||
if (!block) {
|
||||
return processNextGroup();
|
||||
}
|
||||
|
||||
var group = pattern['matches'][group_keys[i]],
|
||||
language = group['language'],
|
||||
|
||||
/**
|
||||
* process group is what group we should use to actually process
|
||||
* this match group
|
||||
*
|
||||
* for example if the subgroup pattern looks like this
|
||||
* 2: {
|
||||
* 'name': 'keyword',
|
||||
* 'pattern': /true/g
|
||||
* }
|
||||
*
|
||||
* then we use that as is, but if it looks like this
|
||||
*
|
||||
* 2: {
|
||||
* 'name': 'keyword',
|
||||
* 'matches': {
|
||||
* 'name': 'special',
|
||||
* 'pattern': /whatever/g
|
||||
* }
|
||||
* }
|
||||
*
|
||||
* we treat the 'matches' part as the pattern and keep
|
||||
* the name around to wrap it with later
|
||||
*/
|
||||
process_group = group['name'] && group['matches'] ? group['matches'] : group,
|
||||
|
||||
/**
|
||||
* takes the code block matched at this group, replaces it
|
||||
* with the highlighted block, and optionally wraps it with
|
||||
* a span with a name
|
||||
*
|
||||
* @param {string} block
|
||||
* @param {string} replace_block
|
||||
* @param {string|null} match_name
|
||||
*/
|
||||
_replaceAndContinue = function(block, replace_block, match_name) {
|
||||
replacement = _replaceAtPosition(_indexOfGroup(match, group_keys[i]), block, match_name ? _wrapCodeInSpan(match_name, replace_block) : replace_block, replacement);
|
||||
processNextGroup();
|
||||
};
|
||||
|
||||
// if this is a sublanguage go and process the block using that language
|
||||
if (language) {
|
||||
return _highlightBlockForLanguage(block, language, function(code) {
|
||||
_replaceAndContinue(block, code);
|
||||
});
|
||||
}
|
||||
|
||||
// if this is a string then this match is directly mapped to selector
|
||||
// so all we have to do is wrap it in a span and continue
|
||||
if (typeof group === 'string') {
|
||||
return _replaceAndContinue(block, block, group);
|
||||
}
|
||||
|
||||
// the process group can be a single pattern or an array of patterns
|
||||
// _processCodeWithPatterns always expects an array so we convert it here
|
||||
_processCodeWithPatterns(block, process_group.length ? process_group : [process_group], function(code) {
|
||||
_replaceAndContinue(block, code, group['matches'] ? group['name'] : 0);
|
||||
});
|
||||
};
|
||||
|
||||
processGroup(0, group_keys, onMatchSuccess);
|
||||
}
|
||||
|
||||
/**
|
||||
* should a language bypass the default patterns?
|
||||
*
|
||||
* if you call Rainbow.extend() and pass true as the third argument
|
||||
* it will bypass the defaults
|
||||
*/
|
||||
function _bypassDefaultPatterns(language)
|
||||
{
|
||||
return bypass_defaults[language];
|
||||
}
|
||||
|
||||
/**
|
||||
* returns a list of regex patterns for this language
|
||||
*
|
||||
* @param {string} language
|
||||
* @returns {Array}
|
||||
*/
|
||||
function _getPatternsForLanguage(language) {
|
||||
var patterns = language_patterns[language] || [],
|
||||
default_patterns = language_patterns[DEFAULT_LANGUAGE] || [];
|
||||
|
||||
return _bypassDefaultPatterns(language) ? patterns : patterns.concat(default_patterns);
|
||||
}
|
||||
|
||||
/**
|
||||
* substring replace call to replace part of a string at a certain position
|
||||
*
|
||||
* @param {number} position the position where the replacement should happen
|
||||
* @param {string} replace the text we want to replace
|
||||
* @param {string} replace_with the text we want to replace it with
|
||||
* @param {string} code the code we are doing the replacing in
|
||||
* @returns {string}
|
||||
*/
|
||||
function _replaceAtPosition(position, replace, replace_with, code) {
|
||||
var sub_string = code.substr(position);
|
||||
return code.substr(0, position) + sub_string.replace(replace, replace_with);
|
||||
}
|
||||
|
||||
/**
|
||||
* sorts an object by index descending
|
||||
*
|
||||
* @param {Object} object
|
||||
* @return {Array}
|
||||
*/
|
||||
function keys(object) {
|
||||
var locations = [],
|
||||
replacement,
|
||||
pos;
|
||||
|
||||
for(var location in object) {
|
||||
if (object.hasOwnProperty(location)) {
|
||||
locations.push(location);
|
||||
}
|
||||
}
|
||||
|
||||
// numeric descending
|
||||
return locations.sort(function(a, b) {
|
||||
return b - a;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* processes a block of code using specified patterns
|
||||
*
|
||||
* @param {string} code
|
||||
* @param {Array} patterns
|
||||
* @returns void
|
||||
*/
|
||||
function _processCodeWithPatterns(code, patterns, callback)
|
||||
{
|
||||
// we have to increase the level here so that the
|
||||
// replacements will not conflict with each other when
|
||||
// processing sub blocks of code
|
||||
++CURRENT_LEVEL;
|
||||
|
||||
// patterns are processed one at a time through this function
|
||||
function _workOnPatterns(patterns, i)
|
||||
{
|
||||
// still have patterns to process, keep going
|
||||
if (i < patterns.length) {
|
||||
return _processPattern(patterns[i]['pattern'], patterns[i], code, function() {
|
||||
_workOnPatterns(patterns, ++i);
|
||||
});
|
||||
}
|
||||
|
||||
// we are done processing the patterns
|
||||
// process the replacements and update the DOM
|
||||
_processReplacements(code, function(code) {
|
||||
|
||||
// when we are done processing replacements
|
||||
// we are done at this level so we can go back down
|
||||
delete replacements[CURRENT_LEVEL];
|
||||
delete replacement_positions[CURRENT_LEVEL];
|
||||
--CURRENT_LEVEL;
|
||||
callback(code);
|
||||
});
|
||||
}
|
||||
|
||||
_workOnPatterns(patterns, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* process replacements in the string of code to actually update the markup
|
||||
*
|
||||
* @param {string} code the code to process replacements in
|
||||
* @param {Function} onComplete what to do when we are done processing
|
||||
* @returns void
|
||||
*/
|
||||
function _processReplacements(code, onComplete) {
|
||||
|
||||
/**
|
||||
* processes a single replacement
|
||||
*
|
||||
* @param {string} code
|
||||
* @param {Array} positions
|
||||
* @param {number} i
|
||||
* @param {Function} onComplete
|
||||
* @returns void
|
||||
*/
|
||||
function _processReplacement(code, positions, i, onComplete) {
|
||||
if (i < positions.length) {
|
||||
++replacement_counter;
|
||||
var pos = positions[i],
|
||||
replacement = replacements[CURRENT_LEVEL][pos];
|
||||
code = _replaceAtPosition(pos, replacement['replace'], replacement['with'], code);
|
||||
|
||||
// process next function
|
||||
var next = function() {
|
||||
_processReplacement(code, positions, ++i, onComplete);
|
||||
};
|
||||
|
||||
// use a timeout every 250 to not freeze up the UI
|
||||
return replacement_counter % 250 > 0 ? next() : setTimeout(next, 0);
|
||||
}
|
||||
|
||||
onComplete(code);
|
||||
}
|
||||
|
||||
var string_positions = keys(replacements[CURRENT_LEVEL]);
|
||||
_processReplacement(code, string_positions, 0, onComplete);
|
||||
}
|
||||
|
||||
/**
|
||||
* takes a string of code and highlights it according to the language specified
|
||||
*
|
||||
* @param {string} code
|
||||
* @param {string} language
|
||||
* @param {Function} onComplete
|
||||
* @returns void
|
||||
*/
|
||||
function _highlightBlockForLanguage(code, language, onComplete) {
|
||||
var patterns = _getPatternsForLanguage(language);
|
||||
_processCodeWithPatterns(_htmlEntities(code), patterns, onComplete);
|
||||
}
|
||||
|
||||
/**
|
||||
* highlight an individual code block
|
||||
*
|
||||
* @param {Array} code_blocks
|
||||
* @param {number} i
|
||||
* @returns void
|
||||
*/
|
||||
function _highlightCodeBlock(code_blocks, i, onComplete) {
|
||||
if (i < code_blocks.length) {
|
||||
var block = code_blocks[i],
|
||||
language = _getLanguageForBlock(block);
|
||||
|
||||
if (!_hasClass(block, 'rainbow') && language) {
|
||||
language = language.toLowerCase();
|
||||
|
||||
_addClass(block, 'rainbow');
|
||||
|
||||
return _highlightBlockForLanguage(block.innerHTML, language, function(code) {
|
||||
block.innerHTML = code;
|
||||
|
||||
// reset the replacement arrays
|
||||
replacements = {};
|
||||
replacement_positions = {};
|
||||
|
||||
// if you have a listener attached tell it that this block is now highlighted
|
||||
if (onHighlight) {
|
||||
onHighlight(block, language);
|
||||
}
|
||||
|
||||
// process the next block
|
||||
setTimeout(function() {
|
||||
_highlightCodeBlock(code_blocks, ++i, onComplete);
|
||||
}, 0);
|
||||
});
|
||||
}
|
||||
return _highlightCodeBlock(code_blocks, ++i, onComplete);
|
||||
}
|
||||
|
||||
if (onComplete) {
|
||||
onComplete();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* start highlighting all the code blocks
|
||||
*
|
||||
* @returns void
|
||||
*/
|
||||
function _highlight(node, onComplete) {
|
||||
|
||||
// the first argument can be an Event or a DOM Element
|
||||
// I was originally checking instanceof Event but that makes it break
|
||||
// when using mootools
|
||||
//
|
||||
// @see https://github.com/ccampbell/rainbow/issues/32
|
||||
//
|
||||
node = node && typeof node.getElementsByTagName == 'function' ? node : document;
|
||||
|
||||
var pre_blocks = node.getElementsByTagName('pre'),
|
||||
code_blocks = node.getElementsByTagName('code'),
|
||||
i,
|
||||
final_blocks = [];
|
||||
|
||||
// @see http://stackoverflow.com/questions/2735067/how-to-convert-a-dom-node-list-to-an-array-in-javascript
|
||||
// we are going to process all <code> blocks
|
||||
for (i = 0; i < code_blocks.length; ++i) {
|
||||
final_blocks.push(code_blocks[i]);
|
||||
}
|
||||
|
||||
// loop through the pre blocks to see which ones we should add
|
||||
for (i = 0; i < pre_blocks.length; ++i) {
|
||||
|
||||
// if the pre block has no code blocks then process it directly
|
||||
if (!pre_blocks[i].getElementsByTagName('code').length) {
|
||||
final_blocks.push(pre_blocks[i]);
|
||||
}
|
||||
}
|
||||
|
||||
_highlightCodeBlock(final_blocks, 0, onComplete);
|
||||
}
|
||||
|
||||
/**
|
||||
* public methods
|
||||
*/
|
||||
return {
|
||||
|
||||
/**
|
||||
* extends the language pattern matches
|
||||
*
|
||||
* @param {*} language name of language
|
||||
* @param {*} patterns array of patterns to add on
|
||||
* @param {boolean|null} bypass if true this will bypass the default language patterns
|
||||
*/
|
||||
extend: function(language, patterns, bypass) {
|
||||
|
||||
// if there is only one argument then we assume that we want to
|
||||
// extend the default language rules
|
||||
if (arguments.length == 1) {
|
||||
patterns = language;
|
||||
language = DEFAULT_LANGUAGE;
|
||||
}
|
||||
|
||||
bypass_defaults[language] = bypass;
|
||||
language_patterns[language] = patterns.concat(language_patterns[language] || []);
|
||||
},
|
||||
|
||||
/**
|
||||
* call back to let you do stuff in your app after a piece of code has been highlighted
|
||||
*
|
||||
* @param {Function} callback
|
||||
*/
|
||||
onHighlight: function(callback) {
|
||||
onHighlight = callback;
|
||||
},
|
||||
|
||||
/**
|
||||
* method to set a global class that will be applied to all spans
|
||||
*
|
||||
* @param {string} class_name
|
||||
*/
|
||||
addClass: function(class_name) {
|
||||
global_class = class_name;
|
||||
},
|
||||
|
||||
/**
|
||||
* starts the magic rainbow
|
||||
*
|
||||
* @returns void
|
||||
*/
|
||||
color: function() {
|
||||
|
||||
// if you want to straight up highlight a string you can pass the string of code,
|
||||
// the language, and a callback function
|
||||
if (typeof arguments[0] == 'string') {
|
||||
return _highlightBlockForLanguage(arguments[0], arguments[1], arguments[2]);
|
||||
}
|
||||
|
||||
// if you pass a callback function then we rerun the color function
|
||||
// on all the code and call the callback function on complete
|
||||
if (typeof arguments[0] == 'function') {
|
||||
return _highlight(0, arguments[0]);
|
||||
}
|
||||
|
||||
// otherwise we use whatever node you passed in with an optional
|
||||
// callback function as the second parameter
|
||||
_highlight(arguments[0], arguments[1]);
|
||||
}
|
||||
};
|
||||
}) ();
|
||||
|
||||
/**
|
||||
* adds event listener to start highlighting
|
||||
*/
|
||||
(function() {
|
||||
if (window.addEventListener) {
|
||||
return window.addEventListener('load', Rainbow.color, false);
|
||||
}
|
||||
window.attachEvent('onload', Rainbow.color);
|
||||
}) ();
|
||||
|
||||
// When using Google closure compiler in advanced mode some methods
|
||||
// get renamed. This keeps a public reference to these methods so they can
|
||||
// still be referenced from outside this library.
|
||||
Rainbow["onHighlight"] = Rainbow.onHighlight;
|
||||
Rainbow["addClass"] = Rainbow.addClass;
|
||||
@@ -0,0 +1,97 @@
|
||||
/*
|
||||
* https://github.com/alicelieutier/smoothScroll/
|
||||
* A teeny tiny, standard compliant, smooth scroll script with ease-in-out effect and no jQuery (or any other dependancy, FWIW).
|
||||
* MIT License
|
||||
*/
|
||||
window.smoothScroll = (function(){
|
||||
// We do not want this script to be applied in browsers that do not support those
|
||||
// That means no smoothscroll on IE9 and below.
|
||||
if(document.querySelectorAll === void 0 || window.pageYOffset === void 0 || history.pushState === void 0) { return; }
|
||||
|
||||
// Get the top position of an element in the document
|
||||
var getTop = function(element) {
|
||||
// return value of html.getBoundingClientRect().top ... IE : 0, other browsers : -pageYOffset
|
||||
if(element.nodeName === 'HTML') return -window.pageYOffset
|
||||
return element.getBoundingClientRect().top + window.pageYOffset;
|
||||
}
|
||||
// ease in out function thanks to:
|
||||
// http://blog.greweb.fr/2012/02/bezier-curve-based-easing-functions-from-concept-to-implementation/
|
||||
var easeInOutCubic = function (t) { return t<.5 ? 4*t*t*t : (t-1)*(2*t-2)*(2*t-2)+1 }
|
||||
|
||||
// calculate the scroll position we should be in
|
||||
// given the start and end point of the scroll
|
||||
// the time elapsed from the beginning of the scroll
|
||||
// and the total duration of the scroll (default 500ms)
|
||||
var position = function(start, end, elapsed, duration) {
|
||||
if (elapsed > duration) return end;
|
||||
return start + (end - start) * easeInOutCubic(elapsed / duration); // <-- you can change the easing funtion there
|
||||
// return start + (end - start) * (elapsed / duration); // <-- this would give a linear scroll
|
||||
}
|
||||
|
||||
// we use requestAnimationFrame to be called by the browser before every repaint
|
||||
// if the first argument is an element then scroll to the top of this element
|
||||
// if the first argument is numeric then scroll to this location
|
||||
// if the callback exist, it is called when the scrolling is finished
|
||||
var smoothScroll = function(el, duration, callback){
|
||||
duration = duration || 500;
|
||||
var start = window.pageYOffset;
|
||||
|
||||
if (typeof el === 'number') {
|
||||
var end = parseInt(el);
|
||||
} else {
|
||||
var end = getTop(el);
|
||||
}
|
||||
|
||||
var clock = Date.now();
|
||||
var requestAnimationFrame = window.requestAnimationFrame ||
|
||||
window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame ||
|
||||
function(fn){window.setTimeout(fn, 15);};
|
||||
|
||||
var step = function(){
|
||||
var elapsed = Date.now() - clock;
|
||||
window.scroll(0, position(start, end, elapsed, duration));
|
||||
if (elapsed > duration) {
|
||||
if (typeof callback === 'function') {
|
||||
callback(el);
|
||||
}
|
||||
} else {
|
||||
requestAnimationFrame(step);
|
||||
}
|
||||
}
|
||||
step();
|
||||
}
|
||||
|
||||
var linkHandler = function(ev) {
|
||||
ev.preventDefault();
|
||||
|
||||
if (location.hash !== this.hash) {
|
||||
//NOTE(@ajoslin): Changed this line to stop $digest errors
|
||||
//window.history.pushState(null, null, this.hash)
|
||||
angular.element(document).injector().get('$location').hash(this.hash);
|
||||
}
|
||||
// using the history api to solve issue #1 - back doesn't work
|
||||
// most browser don't update :target when the history api is used:
|
||||
// THIS IS A BUG FROM THE BROWSERS.
|
||||
// change the scrolling duration in this call
|
||||
var targetEl = document.getElementById(this.hash.substring(1));
|
||||
if (targetEl) {
|
||||
smoothScroll(document.getElementById(this.hash.substring(1)), 500, function(el) {
|
||||
location.replace('#' + el.id)
|
||||
// this will cause the :target to be activated.
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// We look for all the internal links in the documents and attach the smoothscroll function
|
||||
document.addEventListener("DOMContentLoaded", function () {
|
||||
var internal = document.querySelectorAll('a[href^="#"]'), a;
|
||||
for(var i=internal.length; a=internal[--i];){
|
||||
a.addEventListener("click", linkHandler, false);
|
||||
}
|
||||
});
|
||||
|
||||
// return smoothscroll API
|
||||
return smoothScroll;
|
||||
|
||||
})();
|
||||
|
||||
@@ -0,0 +1,115 @@
|
||||
/* Include this file in your html if you are using the CSP mode. */
|
||||
|
||||
.ng-animate.item:not(.left):not(.right) {
|
||||
-webkit-transition: 0s ease-in-out left;
|
||||
transition: 0s ease-in-out left
|
||||
}
|
||||
.uib-datepicker .uib-title {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.uib-day button, .uib-month button, .uib-year button {
|
||||
min-width: 100%;
|
||||
}
|
||||
|
||||
.uib-left, .uib-right {
|
||||
width: 100%
|
||||
}
|
||||
|
||||
.uib-position-measure {
|
||||
display: block !important;
|
||||
visibility: hidden !important;
|
||||
position: absolute !important;
|
||||
top: -9999px !important;
|
||||
left: -9999px !important;
|
||||
}
|
||||
|
||||
.uib-position-scrollbar-measure {
|
||||
position: absolute !important;
|
||||
top: -9999px !important;
|
||||
width: 50px !important;
|
||||
height: 50px !important;
|
||||
overflow: scroll !important;
|
||||
}
|
||||
|
||||
.uib-position-body-scrollbar-measure {
|
||||
overflow: scroll !important;
|
||||
}
|
||||
.uib-datepicker-popup.dropdown-menu {
|
||||
display: block;
|
||||
float: none;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.uib-button-bar {
|
||||
padding: 10px 9px 2px;
|
||||
}
|
||||
|
||||
[uib-tooltip-popup].tooltip.top-left > .tooltip-arrow,
|
||||
[uib-tooltip-popup].tooltip.top-right > .tooltip-arrow,
|
||||
[uib-tooltip-popup].tooltip.bottom-left > .tooltip-arrow,
|
||||
[uib-tooltip-popup].tooltip.bottom-right > .tooltip-arrow,
|
||||
[uib-tooltip-popup].tooltip.left-top > .tooltip-arrow,
|
||||
[uib-tooltip-popup].tooltip.left-bottom > .tooltip-arrow,
|
||||
[uib-tooltip-popup].tooltip.right-top > .tooltip-arrow,
|
||||
[uib-tooltip-popup].tooltip.right-bottom > .tooltip-arrow,
|
||||
[uib-tooltip-html-popup].tooltip.top-left > .tooltip-arrow,
|
||||
[uib-tooltip-html-popup].tooltip.top-right > .tooltip-arrow,
|
||||
[uib-tooltip-html-popup].tooltip.bottom-left > .tooltip-arrow,
|
||||
[uib-tooltip-html-popup].tooltip.bottom-right > .tooltip-arrow,
|
||||
[uib-tooltip-html-popup].tooltip.left-top > .tooltip-arrow,
|
||||
[uib-tooltip-html-popup].tooltip.left-bottom > .tooltip-arrow,
|
||||
[uib-tooltip-html-popup].tooltip.right-top > .tooltip-arrow,
|
||||
[uib-tooltip-html-popup].tooltip.right-bottom > .tooltip-arrow,
|
||||
[uib-tooltip-template-popup].tooltip.top-left > .tooltip-arrow,
|
||||
[uib-tooltip-template-popup].tooltip.top-right > .tooltip-arrow,
|
||||
[uib-tooltip-template-popup].tooltip.bottom-left > .tooltip-arrow,
|
||||
[uib-tooltip-template-popup].tooltip.bottom-right > .tooltip-arrow,
|
||||
[uib-tooltip-template-popup].tooltip.left-top > .tooltip-arrow,
|
||||
[uib-tooltip-template-popup].tooltip.left-bottom > .tooltip-arrow,
|
||||
[uib-tooltip-template-popup].tooltip.right-top > .tooltip-arrow,
|
||||
[uib-tooltip-template-popup].tooltip.right-bottom > .tooltip-arrow,
|
||||
[uib-popover-popup].popover.top-left > .arrow,
|
||||
[uib-popover-popup].popover.top-right > .arrow,
|
||||
[uib-popover-popup].popover.bottom-left > .arrow,
|
||||
[uib-popover-popup].popover.bottom-right > .arrow,
|
||||
[uib-popover-popup].popover.left-top > .arrow,
|
||||
[uib-popover-popup].popover.left-bottom > .arrow,
|
||||
[uib-popover-popup].popover.right-top > .arrow,
|
||||
[uib-popover-popup].popover.right-bottom > .arrow,
|
||||
[uib-popover-html-popup].popover.top-left > .arrow,
|
||||
[uib-popover-html-popup].popover.top-right > .arrow,
|
||||
[uib-popover-html-popup].popover.bottom-left > .arrow,
|
||||
[uib-popover-html-popup].popover.bottom-right > .arrow,
|
||||
[uib-popover-html-popup].popover.left-top > .arrow,
|
||||
[uib-popover-html-popup].popover.left-bottom > .arrow,
|
||||
[uib-popover-html-popup].popover.right-top > .arrow,
|
||||
[uib-popover-html-popup].popover.right-bottom > .arrow,
|
||||
[uib-popover-template-popup].popover.top-left > .arrow,
|
||||
[uib-popover-template-popup].popover.top-right > .arrow,
|
||||
[uib-popover-template-popup].popover.bottom-left > .arrow,
|
||||
[uib-popover-template-popup].popover.bottom-right > .arrow,
|
||||
[uib-popover-template-popup].popover.left-top > .arrow,
|
||||
[uib-popover-template-popup].popover.left-bottom > .arrow,
|
||||
[uib-popover-template-popup].popover.right-top > .arrow,
|
||||
[uib-popover-template-popup].popover.right-bottom > .arrow {
|
||||
top: auto;
|
||||
bottom: auto;
|
||||
left: auto;
|
||||
right: auto;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
[uib-popover-popup].popover,
|
||||
[uib-popover-html-popup].popover,
|
||||
[uib-popover-template-popup].popover {
|
||||
display: block !important;
|
||||
}
|
||||
|
||||
.uib-time input {
|
||||
width: 50px;
|
||||
}
|
||||
|
||||
[uib-typeahead-popup].dropdown-menu {
|
||||
display: block;
|
||||
}
|
||||
@@ -0,0 +1,337 @@
|
||||
/* global FastClick, smoothScroll */
|
||||
angular.module('ui.bootstrap.demo', ['ui.bootstrap', 'plunker', 'ngTouch', 'ngAnimate', 'ngSanitize'], function($httpProvider){
|
||||
if (!!window.FastClick) {
|
||||
FastClick.attach(document.body);
|
||||
}
|
||||
delete $httpProvider.defaults.headers.common['X-Requested-With'];
|
||||
}).run(['$location', function($location){
|
||||
//Allows us to navigate to the correct element on initialization
|
||||
if ($location.path() !== '' && $location.path() !== '/') {
|
||||
smoothScroll(document.getElementById($location.path().substring(1)), 500, function(el) {
|
||||
location.replace('#' + el.id);
|
||||
});
|
||||
}
|
||||
}]).factory('buildFilesService', function ($http, $q) {
|
||||
|
||||
var moduleMap;
|
||||
var rawFiles;
|
||||
|
||||
return {
|
||||
getModuleMap: getModuleMap,
|
||||
getRawFiles: getRawFiles,
|
||||
get: function () {
|
||||
return $q.all({
|
||||
moduleMap: getModuleMap(),
|
||||
rawFiles: getRawFiles()
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
function getModuleMap() {
|
||||
return moduleMap ? $q.when(moduleMap) : $http.get('assets/module-mapping.json')
|
||||
.then(function (result) {
|
||||
moduleMap = result.data;
|
||||
return moduleMap;
|
||||
});
|
||||
}
|
||||
|
||||
function getRawFiles() {
|
||||
return rawFiles ? $q.when(rawFiles) : $http.get('assets/raw-files.json')
|
||||
.then(function (result) {
|
||||
rawFiles = result.data;
|
||||
return rawFiles;
|
||||
});
|
||||
}
|
||||
|
||||
})
|
||||
.controller('MainCtrl', MainCtrl)
|
||||
.controller('SelectModulesCtrl', SelectModulesCtrl)
|
||||
.controller('DownloadCtrl', DownloadCtrl);
|
||||
|
||||
function MainCtrl($scope, $http, $document, $uibModal, orderByFilter) {
|
||||
$scope.isCollapsed = true;
|
||||
|
||||
// Grab old version docs
|
||||
$http.get('/ui-bootstrap4/versions-mapping.json')
|
||||
.then(function(result) {
|
||||
$scope.oldDocs = result.data;
|
||||
})
|
||||
.catch(function(response)
|
||||
{
|
||||
if(response.status === 404)
|
||||
{
|
||||
$http.get('/versions-mapping.json')
|
||||
.then(function(result) {
|
||||
$scope.oldDocs = result.data;
|
||||
})
|
||||
.catch(function(response)
|
||||
{
|
||||
console.log('failed to get versions mapping:', response);
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
console.log('failed to get versions mapping:', response);
|
||||
}
|
||||
});
|
||||
|
||||
$scope.showBuildModal = function() {
|
||||
var modalInstance = $uibModal.open({
|
||||
templateUrl: 'buildModal.html',
|
||||
controller: 'SelectModulesCtrl',
|
||||
resolve: {
|
||||
modules: function(buildFilesService) {
|
||||
return buildFilesService.getModuleMap()
|
||||
.then(function (moduleMap) {
|
||||
return Object.keys(moduleMap);
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
$scope.showDownloadModal = function() {
|
||||
var modalInstance = $uibModal.open({
|
||||
templateUrl: 'downloadModal.html',
|
||||
controller: 'DownloadCtrl'
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
function SelectModulesCtrl($scope, $uibModalInstance, modules, buildFilesService) {
|
||||
$scope.selectedModules = [];
|
||||
$scope.modules = modules;
|
||||
|
||||
$scope.selectedChanged = function(module, selected) {
|
||||
if (selected) {
|
||||
$scope.selectedModules.push(module);
|
||||
} else {
|
||||
$scope.selectedModules.splice($scope.selectedModules.indexOf(module), 1);
|
||||
}
|
||||
};
|
||||
|
||||
$scope.downloadBuild = function () {
|
||||
$uibModalInstance.close($scope.selectedModules);
|
||||
};
|
||||
|
||||
$scope.cancel = function () {
|
||||
$uibModalInstance.dismiss();
|
||||
};
|
||||
|
||||
$scope.isOldBrowser = function () {
|
||||
return isOldBrowser;
|
||||
};
|
||||
|
||||
$scope.build = function (selectedModules, version) {
|
||||
/* global JSZip, saveAs */
|
||||
var moduleMap, rawFiles;
|
||||
|
||||
buildFilesService.get().then(function (buildFiles) {
|
||||
moduleMap = buildFiles.moduleMap;
|
||||
rawFiles = buildFiles.rawFiles;
|
||||
|
||||
generateBuild();
|
||||
});
|
||||
|
||||
function generateBuild() {
|
||||
var srcModuleNames = selectedModules
|
||||
.map(function (module) {
|
||||
return moduleMap[module];
|
||||
})
|
||||
.reduce(function (toBuild, module) {
|
||||
addIfNotExists(toBuild, module.name);
|
||||
|
||||
module.dependencies.forEach(function (depName) {
|
||||
addIfNotExists(toBuild, depName);
|
||||
});
|
||||
return toBuild;
|
||||
}, []);
|
||||
|
||||
var srcModules = srcModuleNames
|
||||
.map(function (moduleName) {
|
||||
return moduleMap[moduleName];
|
||||
});
|
||||
|
||||
var srcModuleFullNames = srcModules
|
||||
.map(function (module) {
|
||||
return module.moduleName;
|
||||
});
|
||||
|
||||
var srcJsContent = srcModules
|
||||
.reduce(function (buildFiles, module) {
|
||||
return buildFiles.concat(module.srcFiles);
|
||||
}, [])
|
||||
.map(getFileContent)
|
||||
.join('\n')
|
||||
;
|
||||
|
||||
var jsFile = createNoTplFile(srcModuleFullNames, srcJsContent);
|
||||
|
||||
var tplModuleNames = srcModules
|
||||
.reduce(function (tplModuleNames, module) {
|
||||
return tplModuleNames.concat(module.tplModules);
|
||||
}, []);
|
||||
|
||||
var tplJsContent = srcModules
|
||||
.reduce(function (buildFiles, module) {
|
||||
return buildFiles.concat(module.tpljsFiles);
|
||||
}, [])
|
||||
.map(getFileContent)
|
||||
.join('\n')
|
||||
;
|
||||
|
||||
var jsTplFile = createWithTplFile(srcModuleFullNames, srcJsContent, tplModuleNames, tplJsContent);
|
||||
|
||||
var cssContent = srcModules
|
||||
.map(function (module) {
|
||||
return module.css;
|
||||
})
|
||||
.filter(function (css) {
|
||||
return css;
|
||||
})
|
||||
.join('\n')
|
||||
;
|
||||
|
||||
var cssJsContent = srcModules
|
||||
.map(function (module) {
|
||||
return module.cssJs;
|
||||
})
|
||||
.filter(function (cssJs) {
|
||||
return cssJs;
|
||||
})
|
||||
.join('\n')
|
||||
;
|
||||
|
||||
var footer = cssJsContent;
|
||||
|
||||
var zip = new JSZip();
|
||||
zip.file('ui-bootstrap-custom-' + version + '.js', rawFiles.banner + jsFile + footer);
|
||||
zip.file('ui-bootstrap-custom-' + version + '.min.js', rawFiles.banner + uglify(jsFile + footer));
|
||||
zip.file('ui-bootstrap-custom-tpls-' + version + '.js', rawFiles.banner + jsTplFile + footer);
|
||||
zip.file('ui-bootstrap-custom-tpls-' + version + '.min.js', rawFiles.banner + uglify(jsTplFile + footer));
|
||||
zip.file('ui-bootstrap-custom-tpls-' + version + '.min.js', rawFiles.banner + uglify(jsTplFile + footer));
|
||||
|
||||
if (cssContent) {
|
||||
zip.file('ui-bootstrap-custom-' + version + '-csp.css', rawFiles.cssBanner + cssContent);
|
||||
}
|
||||
|
||||
saveAs(zip.generate({type: 'blob'}), 'ui-bootstrap-custom-build.zip');
|
||||
}
|
||||
|
||||
function createNoTplFile(srcModuleNames, srcJsContent) {
|
||||
return 'angular.module("ui.bootstrap", [' + srcModuleNames.join(',') + ']);\n' +
|
||||
srcJsContent;
|
||||
}
|
||||
|
||||
function createWithTplFile(srcModuleNames, srcJsContent, tplModuleNames, tplJsContent) {
|
||||
var depModuleNames = srcModuleNames.slice();
|
||||
depModuleNames.unshift('"ui.bootstrap.tpls"');
|
||||
|
||||
return 'angular.module("ui.bootstrap", [' + depModuleNames.join(',') + ']);\n' +
|
||||
'angular.module("ui.bootstrap.tpls", [' + tplModuleNames.join(',') + ']);\n' +
|
||||
srcJsContent + '\n' + tplJsContent;
|
||||
|
||||
}
|
||||
|
||||
function addIfNotExists(array, element) {
|
||||
if (array.indexOf(element) == -1) {
|
||||
array.push(element);
|
||||
}
|
||||
}
|
||||
|
||||
function getFileContent(fileName) {
|
||||
return rawFiles.files[fileName];
|
||||
}
|
||||
|
||||
function uglify(js) {
|
||||
/* global UglifyJS */
|
||||
|
||||
var ast = UglifyJS.parse(js);
|
||||
ast.figure_out_scope();
|
||||
|
||||
var compressor = UglifyJS.Compressor();
|
||||
var compressedAst = ast.transform(compressor);
|
||||
|
||||
compressedAst.figure_out_scope();
|
||||
compressedAst.compute_char_frequency();
|
||||
compressedAst.mangle_names();
|
||||
|
||||
var stream = UglifyJS.OutputStream();
|
||||
compressedAst.print(stream);
|
||||
|
||||
return stream.toString();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
function DownloadCtrl($scope, $uibModalInstance) {
|
||||
$scope.options = {
|
||||
minified: true,
|
||||
tpls: true
|
||||
};
|
||||
|
||||
$scope.download = function (version) {
|
||||
var options = $scope.options;
|
||||
|
||||
var downloadUrl = ['ui-bootstrap-'];
|
||||
if (options.tpls) {
|
||||
downloadUrl.push('tpls-');
|
||||
}
|
||||
downloadUrl.push(version);
|
||||
if (options.minified) {
|
||||
downloadUrl.push('.min');
|
||||
}
|
||||
downloadUrl.push('.js');
|
||||
|
||||
return downloadUrl.join('');
|
||||
};
|
||||
|
||||
$scope.cancel = function () {
|
||||
$uibModalInstance.dismiss();
|
||||
};
|
||||
}
|
||||
|
||||
/*
|
||||
* The following compatibility check is from:
|
||||
*
|
||||
* Bootstrap Customizer (http://getbootstrap.com/customize/)
|
||||
* Copyright 2011-2014 Twitter, Inc.
|
||||
*
|
||||
* Licensed under the Creative Commons Attribution 3.0 Unported License. For
|
||||
* details, see http://creativecommons.org/licenses/by/3.0/.
|
||||
*/
|
||||
var isOldBrowser;
|
||||
(function () {
|
||||
|
||||
var supportsFile = (window.File && window.FileReader && window.FileList && window.Blob);
|
||||
function failback() {
|
||||
isOldBrowser = true;
|
||||
}
|
||||
/**
|
||||
* Based on:
|
||||
* Blob Feature Check v1.1.0
|
||||
* https://github.com/ssorallen/blob-feature-check/
|
||||
* License: Public domain (http://unlicense.org)
|
||||
*/
|
||||
var url = window.URL;
|
||||
var svg = new Blob(
|
||||
['<svg xmlns=\'http://www.w3.org/2000/svg\'></svg>'],
|
||||
{ type: 'image/svg+xml;charset=utf-8' }
|
||||
);
|
||||
var objectUrl = url.createObjectURL(svg);
|
||||
|
||||
if (/^blob:/.exec(objectUrl) === null || !supportsFile) {
|
||||
// `URL.createObjectURL` created a URL that started with something other
|
||||
// than "blob:", which means it has been polyfilled and is not supported by
|
||||
// this browser.
|
||||
failback();
|
||||
} else {
|
||||
angular.element('<img/>')
|
||||
.on('load', function () {
|
||||
isOldBrowser = false;
|
||||
})
|
||||
.on('error', failback)
|
||||
.attr('src', objectUrl);
|
||||
}
|
||||
|
||||
})();
|
||||
@@ -0,0 +1,317 @@
|
||||
body {
|
||||
opacity: 1;
|
||||
-webkit-transition: opacity 1s ease;
|
||||
-moz-transition: opacity 1s ease;
|
||||
transition: opacity 1s;
|
||||
}
|
||||
|
||||
.ng-cloak {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.ng-invalid {
|
||||
border: 1px solid red !important;
|
||||
}
|
||||
|
||||
section {
|
||||
padding-top: 30px;
|
||||
}
|
||||
|
||||
.page-header h1 > small > a {
|
||||
color: #999;
|
||||
}
|
||||
.page-header h1 > small > a:hover {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.footer {
|
||||
text-align: center;
|
||||
padding: 30px 0;
|
||||
margin-top: 70px;
|
||||
border-top: 1px solid #e5e5e5;
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
|
||||
.bs-social {
|
||||
margin-top: 20px;
|
||||
margin-bottom: 20px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
@media (min-width: 768px) {
|
||||
|
||||
.bs-social {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.nav, .pagination, .carousel, .panel-title a {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.bs-social-buttons {
|
||||
display: inline-block;
|
||||
margin-bottom: 0;
|
||||
padding-left: 0;
|
||||
list-style: none;
|
||||
}
|
||||
.bs-social-buttons li {
|
||||
display: inline-block;
|
||||
padding: 5px 8px;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
@media (max-width: 767px) {
|
||||
|
||||
.visible-xs.collapse.in {
|
||||
display: block!important;
|
||||
}
|
||||
.visible-xs.collapse {
|
||||
display: none!important;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.navbar-fixed-top .collapse {
|
||||
border-top: 1px solid #e7e7e7;
|
||||
margin-left: -15px;
|
||||
margin-right: -15px;
|
||||
padding-right: 15px;
|
||||
padding-left: 15px;
|
||||
}
|
||||
|
||||
.show-grid {
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
|
||||
/*
|
||||
* Container
|
||||
*
|
||||
* Tweak to width of container.
|
||||
*/
|
||||
|
||||
/*@media (min-width: 1200px) {
|
||||
.container{
|
||||
max-width: 970px;
|
||||
}
|
||||
}*/
|
||||
|
||||
/*
|
||||
* Tabs
|
||||
*
|
||||
* Tweaks to the Tabs.
|
||||
*/
|
||||
|
||||
.code .nav-tabs {
|
||||
border-bottom: 1px solid #ccc;
|
||||
}
|
||||
|
||||
.code pre, .code code {
|
||||
border-top: none;
|
||||
border-top-left-radius: 0;
|
||||
border-top-right-radius: 0;
|
||||
}
|
||||
|
||||
.code .nav-tabs>li.active>a, .code .nav-tabs>li.active>a:hover, .code .nav-tabs>li.active>a:focus {
|
||||
background-color: #f8f8f8;
|
||||
border: 1px solid #ccc;
|
||||
border-bottom-color: transparent;
|
||||
}
|
||||
|
||||
/*
|
||||
* Button Inverse
|
||||
*
|
||||
* Buttons in the masthead.
|
||||
*/
|
||||
|
||||
.btn-outline-inverse {
|
||||
color: #fff;
|
||||
background-color: transparent;
|
||||
border-color: #cdbfe3;
|
||||
margin: 10px;
|
||||
}
|
||||
|
||||
@media (min-width: 768px) {
|
||||
|
||||
.btn-outline-inverse {
|
||||
width: auto;
|
||||
margin: 20px 5px 20px 0;
|
||||
padding: 18px 24px;
|
||||
font-size: 21px;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.btn-outline-inverse:hover, .btn-outline-inverse:focus, .btn-outline-inverse:active {
|
||||
color: #563d7c;
|
||||
text-shadow: none;
|
||||
background-color: #fff;
|
||||
border-color: #fff;
|
||||
}
|
||||
|
||||
|
||||
/* Page headers */
|
||||
.bs-header {
|
||||
padding: 30px 15px 40px; /* side padding builds on .container 15px, so 30px */
|
||||
font-size: 16px;
|
||||
text-align: center;
|
||||
text-shadow: 0 1px 0 rgba(0,0,0,.15);
|
||||
color: #cdbfe3;
|
||||
background-color: #563d7c;
|
||||
background-image: url(header.png);
|
||||
}
|
||||
.bs-header a {
|
||||
color: #fff;
|
||||
font-weight: normal;
|
||||
}
|
||||
.bs-header h1 {
|
||||
color: #fff;
|
||||
}
|
||||
.bs-header p {
|
||||
font-weight: 200;
|
||||
line-height: 1.4;
|
||||
}
|
||||
.bs-header .container {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
@media (min-width: 768px) {
|
||||
.bs-header {
|
||||
font-size: 30px;
|
||||
text-align: left;
|
||||
}
|
||||
.bs-header h1 {
|
||||
font-size: 100px;
|
||||
line-height: 1;
|
||||
}
|
||||
}
|
||||
|
||||
.navbar-inner {
|
||||
-webkit-box-shadow: 0 3px 3px rgba(0,0,0,0.175);
|
||||
box-shadow: 0 3px 3px rgba(0,0,0,0.175);
|
||||
}
|
||||
|
||||
/*
|
||||
* Side navigation
|
||||
*
|
||||
* Scrollspy and affixed enhanced navigation to highlight sections and secondary
|
||||
* sections of docs content.
|
||||
*/
|
||||
|
||||
/* By default it's not affixed in mobile views, so undo that */
|
||||
.bs-sidebar.affix {
|
||||
position: static;
|
||||
}
|
||||
|
||||
/* First level of nav */
|
||||
.bs-sidenav {
|
||||
margin-top: 30px;
|
||||
margin-bottom: 30px;
|
||||
padding-top: 10px;
|
||||
padding-bottom: 10px;
|
||||
text-shadow: 0 1px 0 #fff;
|
||||
background-color: #f7f5fa;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
/* All levels of nav */
|
||||
.bs-sidebar .nav > li > a {
|
||||
display: block;
|
||||
color: #716b7a;
|
||||
padding: 5px 20px;
|
||||
}
|
||||
.bs-sidebar .nav > li > a:hover,
|
||||
.bs-sidebar .nav > li > a:focus {
|
||||
text-decoration: none;
|
||||
background-color: #e5e3e9;
|
||||
border-right: 1px solid #dbd8e0;
|
||||
}
|
||||
.bs-sidebar .nav > .active > a,
|
||||
.bs-sidebar .nav > .active:hover > a,
|
||||
.bs-sidebar .nav > .active:focus > a {
|
||||
font-weight: bold;
|
||||
color: #563d7c;
|
||||
background-color: transparent;
|
||||
border-right: 1px solid #563d7c;
|
||||
}
|
||||
|
||||
/* Nav: second level (shown on .active) */
|
||||
.bs-sidebar .nav .nav {
|
||||
display: none; /* Hide by default, but at >768px, show it */
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
.bs-sidebar .nav .nav > li > a {
|
||||
padding-top: 3px;
|
||||
padding-bottom: 3px;
|
||||
padding-left: 30px;
|
||||
font-size: 90%;
|
||||
}
|
||||
|
||||
/* Show and affix the side nav when space allows it */
|
||||
@media (min-width: 992px) {
|
||||
.bs-sidebar .nav > .active > ul {
|
||||
display: block;
|
||||
}
|
||||
/* Widen the fixed sidebar */
|
||||
.bs-sidebar.affix,
|
||||
.bs-sidebar.affix-bottom {
|
||||
width: 213px;
|
||||
}
|
||||
.bs-sidebar.affix {
|
||||
position: fixed; /* Undo the static from mobile first approach */
|
||||
top: 80px;
|
||||
}
|
||||
.bs-sidebar.affix-bottom {
|
||||
position: absolute; /* Undo the static from mobile first approach */
|
||||
}
|
||||
.bs-sidebar.affix-bottom .bs-sidenav,
|
||||
.bs-sidebar.affix .bs-sidenav {
|
||||
margin-top: 0;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
@media (min-width: 1200px) {
|
||||
/* Widen the fixed sidebar again */
|
||||
.bs-sidebar.affix-bottom,
|
||||
.bs-sidebar.affix {
|
||||
width: 263px;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Not enough room on mobile for markup tab, js tab, and plunk btn.
|
||||
And no one cares about plunk button on a phone anyway */
|
||||
@media only screen and (max-device-width: 480px) {
|
||||
#plunk-btn {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
.navbar-nav .dropdown .navbar-brand {
|
||||
max-width: 100%;
|
||||
margin-right: inherit;
|
||||
margin-left: inherit;
|
||||
}
|
||||
|
||||
.header-placeholder {
|
||||
height: 50px;
|
||||
}
|
||||
|
||||
@media screen and (min-width: 768px) {
|
||||
|
||||
.dropdown.open > .navbar-brand + .dropdown-menu {
|
||||
left: 10px;
|
||||
}
|
||||
|
||||
.header-placeholder {
|
||||
height: 50px;
|
||||
}
|
||||
|
||||
.navbar-nav .dropdown .navbar-brand {
|
||||
max-width: 200px;
|
||||
margin-right: 5px;
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
}
|
||||
|
After Width: | Height: | Size: 8.2 KiB |
|
After Width: | Height: | Size: 398 B |
|
After Width: | Height: | Size: 37 KiB |