praxis 0.0.1 → 0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +11 -0
- data/.rspec +3 -0
- data/.ruby-version +1 -0
- data/.simplecov +7 -0
- data/.travis.yml +4 -0
- data/CONTRIBUTING.md +183 -0
- data/Gemfile +3 -0
- data/Guardfile +8 -0
- data/LICENSE +22 -0
- data/MAINTAINERS +2 -0
- data/MAINTAINERS.md +86 -0
- data/README.md +69 -3
- data/Rakefile +18 -0
- data/bin/praxis +10 -0
- data/lib/api_browser/.bowerrc +3 -0
- data/lib/api_browser/.editorconfig +21 -0
- data/lib/api_browser/Gruntfile.js +264 -0
- data/lib/api_browser/app/bower_components/angular/.bower.json +16 -0
- data/lib/api_browser/app/bower_components/angular/README.md +48 -0
- data/lib/api_browser/app/bower_components/angular/angular-csp.css +18 -0
- data/lib/api_browser/app/bower_components/angular/angular.js +21464 -0
- data/lib/api_browser/app/bower_components/angular/angular.min.js +210 -0
- data/lib/api_browser/app/bower_components/angular/angular.min.js.gzip +0 -0
- data/lib/api_browser/app/bower_components/angular/angular.min.js.map +8 -0
- data/lib/api_browser/app/bower_components/angular/bower.json +7 -0
- data/lib/api_browser/app/bower_components/angular-sanitize/.bower.json +19 -0
- data/lib/api_browser/app/bower_components/angular-sanitize/README.md +54 -0
- data/lib/api_browser/app/bower_components/angular-sanitize/angular-sanitize.js +624 -0
- data/lib/api_browser/app/bower_components/angular-sanitize/angular-sanitize.min.js +14 -0
- data/lib/api_browser/app/bower_components/angular-sanitize/angular-sanitize.min.js.map +8 -0
- data/lib/api_browser/app/bower_components/angular-sanitize/bower.json +8 -0
- data/lib/api_browser/app/bower_components/angular-ui-bootstrap-bower/.bower.json +24 -0
- data/lib/api_browser/app/bower_components/angular-ui-bootstrap-bower/bower.json +11 -0
- data/lib/api_browser/app/bower_components/angular-ui-bootstrap-bower/ui-bootstrap-tpls.js +4116 -0
- data/lib/api_browser/app/bower_components/angular-ui-bootstrap-bower/ui-bootstrap-tpls.min.js +10 -0
- data/lib/api_browser/app/bower_components/angular-ui-bootstrap-bower/ui-bootstrap.js +3799 -0
- data/lib/api_browser/app/bower_components/angular-ui-bootstrap-bower/ui-bootstrap.min.js +9 -0
- data/lib/api_browser/app/bower_components/angular-ui-router/.bower.json +34 -0
- data/lib/api_browser/app/bower_components/angular-ui-router/CHANGELOG.md +23 -0
- data/lib/api_browser/app/bower_components/angular-ui-router/LICENSE +21 -0
- data/lib/api_browser/app/bower_components/angular-ui-router/README.md +280 -0
- data/lib/api_browser/app/bower_components/angular-ui-router/bower.json +23 -0
- data/lib/api_browser/app/bower_components/angular-ui-router/release/angular-ui-router.js +3223 -0
- data/lib/api_browser/app/bower_components/angular-ui-router/release/angular-ui-router.min.js +7 -0
- data/lib/api_browser/app/bower_components/angular-ui-router/src/common.js +246 -0
- data/lib/api_browser/app/bower_components/angular-ui-router/src/compat.js +146 -0
- data/lib/api_browser/app/bower_components/angular-ui-router/src/resolve.js +242 -0
- data/lib/api_browser/app/bower_components/angular-ui-router/src/state.js +1204 -0
- data/lib/api_browser/app/bower_components/angular-ui-router/src/stateDirectives.js +226 -0
- data/lib/api_browser/app/bower_components/angular-ui-router/src/stateFilters.js +35 -0
- data/lib/api_browser/app/bower_components/angular-ui-router/src/templateFactory.js +110 -0
- data/lib/api_browser/app/bower_components/angular-ui-router/src/urlMatcherFactory.js +325 -0
- data/lib/api_browser/app/bower_components/angular-ui-router/src/urlRouter.js +273 -0
- data/lib/api_browser/app/bower_components/angular-ui-router/src/view.js +71 -0
- data/lib/api_browser/app/bower_components/angular-ui-router/src/viewDirective.js +290 -0
- data/lib/api_browser/app/bower_components/angular-ui-router/src/viewScroll.js +52 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/.bower.json +26 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/CNAME +1 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/CONTRIBUTING.md +61 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/DOCS-LICENSE +319 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/Gemfile +5 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/Gemfile.lock +14 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/Gruntfile.js +244 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/LICENSE +176 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/LICENSE-MIT +21 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/README.md +277 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/Rakefile +44 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/_config.yml +25 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/_includes/ads.html +1 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/_includes/footer.html +34 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/_includes/header.html +42 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/_includes/nav-about.html +12 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/_includes/nav-components.html +137 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/_includes/nav-css.html +99 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/_includes/nav-customize.html +40 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/_includes/nav-getting-started.html +44 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/_includes/nav-javascript.html +88 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/_includes/nav-main.html +37 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/_includes/old-bs-docs.html +8 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/_includes/social-buttons.html +16 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/_layouts/default.html +79 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/_layouts/home.html +47 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/about.html +93 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/bower.json +11 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/browserstack.json +37 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/components.html +3689 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/composer.json +28 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/css.html +2674 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/customize.html +1715 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/dist/css/bootstrap-theme.css +427 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/dist/css/bootstrap-theme.min.css +1 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/dist/css/bootstrap.css +6350 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/dist/css/bootstrap.min.css +1 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/dist/fonts/glyphicons-halflings-regular.eot +0 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/dist/fonts/glyphicons-halflings-regular.svg +229 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/dist/fonts/glyphicons-halflings-regular.ttf +0 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/dist/fonts/glyphicons-halflings-regular.woff +0 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/dist/js/bootstrap.js +2002 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/dist/js/bootstrap.min.js +9 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/docs-assets/css/docs.css +1195 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/docs-assets/css/pygments-manni.css +66 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/docs-assets/ico/apple-touch-icon-144-precomposed.png +0 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/docs-assets/ico/favicon.png +0 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/docs-assets/js/application.js +103 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/docs-assets/js/customizer.js +332 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/docs-assets/js/filesaver.js +169 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/docs-assets/js/holder.js +404 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/docs-assets/js/ie8-responsive-file-warning.js +12 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/docs-assets/js/jszip.js +1467 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/docs-assets/js/less.js +9 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/docs-assets/js/raw-files.js +3 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/docs-assets/js/uglify.js +14 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/examples/carousel/carousel.css +148 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/examples/carousel/index.html +206 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/examples/grid/grid.css +28 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/examples/grid/index.html +148 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/examples/jumbotron/index.html +99 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/examples/jumbotron/jumbotron.css +5 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/examples/jumbotron-narrow/index.html +82 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/examples/jumbotron-narrow/jumbotron-narrow.css +79 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/examples/justified-nav/index.html +83 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/examples/justified-nav/justified-nav.css +88 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/examples/navbar/index.html +88 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/examples/navbar/navbar.css +8 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/examples/navbar-fixed-top/index.html +91 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/examples/navbar-fixed-top/navbar-fixed-top.css +4 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/examples/navbar-static-top/index.html +92 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/examples/navbar-static-top/navbar-static-top.css +7 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/examples/non-responsive/index.html +101 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/examples/non-responsive/non-responsive.css +116 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/examples/offcanvas/index.html +130 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/examples/offcanvas/offcanvas.css +50 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/examples/offcanvas/offcanvas.js +5 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/examples/screenshots/carousel.jpg +0 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/examples/screenshots/grid.jpg +0 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/examples/screenshots/jumbotron-narrow.jpg +0 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/examples/screenshots/jumbotron.jpg +0 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/examples/screenshots/justified-nav.jpg +0 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/examples/screenshots/navbar-fixed.jpg +0 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/examples/screenshots/navbar-static.jpg +0 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/examples/screenshots/navbar.jpg +0 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/examples/screenshots/non-responsive.jpg +0 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/examples/screenshots/offcanvas.jpg +0 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/examples/screenshots/sign-in.jpg +0 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/examples/screenshots/starter-template.jpg +0 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/examples/screenshots/sticky-footer-navbar.jpg +0 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/examples/screenshots/sticky-footer.jpg +0 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/examples/screenshots/theme.jpg +0 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/examples/signin/index.html +50 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/examples/signin/signin.css +40 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/examples/starter-template/index.html +68 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/examples/starter-template/starter-template.css +7 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/examples/sticky-footer/index.html +55 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/examples/sticky-footer/sticky-footer.css +38 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/examples/sticky-footer-navbar/index.html +91 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/examples/sticky-footer-navbar/sticky-footer-navbar.css +45 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/examples/theme/index.html +384 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/examples/theme/theme.css +14 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/fonts/glyphicons-halflings-regular.eot +0 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/fonts/glyphicons-halflings-regular.svg +229 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/fonts/glyphicons-halflings-regular.ttf +0 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/fonts/glyphicons-halflings-regular.woff +0 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/getting-started.html +1021 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/index.html +16 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/javascript.html +1983 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/js/affix.js +126 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/js/alert.js +98 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/js/button.js +109 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/js/carousel.js +217 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/js/collapse.js +179 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/js/dropdown.js +154 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/js/modal.js +246 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/js/popover.js +117 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/js/scrollspy.js +158 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/js/tab.js +135 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/js/tests/index.html +52 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/js/tests/unit/affix.js +25 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/js/tests/unit/alert.js +62 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/js/tests/unit/button.js +116 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/js/tests/unit/carousel.js +87 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/js/tests/unit/collapse.js +164 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/js/tests/unit/dropdown.js +219 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/js/tests/unit/modal.js +196 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/js/tests/unit/phantom.js +69 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/js/tests/unit/popover.js +133 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/js/tests/unit/scrollspy.js +37 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/js/tests/unit/tab.js +86 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/js/tests/unit/tooltip.js +437 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/js/tests/unit/transition.js +13 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/js/tests/vendor/jquery.js +6 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/js/tests/vendor/qunit.css +232 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/js/tests/vendor/qunit.js +1510 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/js/tooltip.js +386 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/js/transition.js +56 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/lib/_alerts.scss +67 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/lib/_badges.scss +51 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/lib/_breadcrumbs.scss +23 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/lib/_button-groups.scss +253 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/lib/_buttons.scss +158 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/lib/_carousel.scss +231 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/lib/_close.scss +35 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/lib/_code.scss +53 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/lib/_component-animations.scss +29 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/lib/_dropdowns.scss +193 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/lib/_forms.scss +363 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/lib/_glyphicons.scss +237 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/lib/_grid.scss +93 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/lib/_input-groups.scss +136 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/lib/_jumbotron.scss +40 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/lib/_labels.scss +58 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/lib/_list-group.scss +88 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/lib/_media.scss +56 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/lib/_mixins.scss +861 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/lib/_modals.scss +132 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/lib/_navbar.scss +628 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/lib/_navs.scss +262 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/lib/_normalize.scss +406 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/lib/_pager.scss +55 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/lib/_pagination.scss +85 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/lib/_panels.scss +172 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/lib/_popovers.scss +133 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/lib/_print.scss +105 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/lib/_progress-bars.scss +92 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/lib/_responsive-utilities.scss +198 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/lib/_scaffolding.scss +119 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/lib/_tables.scss +244 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/lib/_theme.scss +247 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/lib/_thumbnails.scss +32 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/lib/_tooltip.scss +95 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/lib/_type.scss +279 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/lib/_utilities.scss +56 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/lib/_variables.scss +637 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/lib/_wells.scss +29 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/lib/bootstrap.scss +49 -0
- data/lib/api_browser/app/bower_components/bootstrap-sass/package.json +40 -0
- data/lib/api_browser/app/bower_components/jquery/.bower.json +38 -0
- data/lib/api_browser/app/bower_components/jquery/MIT-LICENSE.txt +21 -0
- data/lib/api_browser/app/bower_components/jquery/bower.json +27 -0
- data/lib/api_browser/app/bower_components/jquery/dist/jquery.js +9190 -0
- data/lib/api_browser/app/bower_components/jquery/dist/jquery.min.js +5 -0
- data/lib/api_browser/app/bower_components/jquery/dist/jquery.min.map +1 -0
- data/lib/api_browser/app/bower_components/jquery/src/ajax/jsonp.js +89 -0
- data/lib/api_browser/app/bower_components/jquery/src/ajax/load.js +75 -0
- data/lib/api_browser/app/bower_components/jquery/src/ajax/parseJSON.js +13 -0
- data/lib/api_browser/app/bower_components/jquery/src/ajax/parseXML.js +28 -0
- data/lib/api_browser/app/bower_components/jquery/src/ajax/script.js +64 -0
- data/lib/api_browser/app/bower_components/jquery/src/ajax/var/nonce.js +5 -0
- data/lib/api_browser/app/bower_components/jquery/src/ajax/var/rquery.js +3 -0
- data/lib/api_browser/app/bower_components/jquery/src/ajax/xhr.js +135 -0
- data/lib/api_browser/app/bower_components/jquery/src/ajax.js +806 -0
- data/lib/api_browser/app/bower_components/jquery/src/attributes/attr.js +143 -0
- data/lib/api_browser/app/bower_components/jquery/src/attributes/classes.js +158 -0
- data/lib/api_browser/app/bower_components/jquery/src/attributes/prop.js +96 -0
- data/lib/api_browser/app/bower_components/jquery/src/attributes/support.js +35 -0
- data/lib/api_browser/app/bower_components/jquery/src/attributes/val.js +163 -0
- data/lib/api_browser/app/bower_components/jquery/src/attributes.js +11 -0
- data/lib/api_browser/app/bower_components/jquery/src/callbacks.js +205 -0
- data/lib/api_browser/app/bower_components/jquery/src/core/access.js +60 -0
- data/lib/api_browser/app/bower_components/jquery/src/core/init.js +123 -0
- data/lib/api_browser/app/bower_components/jquery/src/core/parseHTML.js +39 -0
- data/lib/api_browser/app/bower_components/jquery/src/core/ready.js +97 -0
- data/lib/api_browser/app/bower_components/jquery/src/core/var/rsingleTag.js +4 -0
- data/lib/api_browser/app/bower_components/jquery/src/core.js +498 -0
- data/lib/api_browser/app/bower_components/jquery/src/css/addGetHookIf.js +24 -0
- data/lib/api_browser/app/bower_components/jquery/src/css/curCSS.js +57 -0
- data/lib/api_browser/app/bower_components/jquery/src/css/defaultDisplay.js +70 -0
- data/lib/api_browser/app/bower_components/jquery/src/css/hiddenVisibleSelectors.js +15 -0
- data/lib/api_browser/app/bower_components/jquery/src/css/support.js +91 -0
- data/lib/api_browser/app/bower_components/jquery/src/css/swap.js +28 -0
- data/lib/api_browser/app/bower_components/jquery/src/css/var/cssExpand.js +3 -0
- data/lib/api_browser/app/bower_components/jquery/src/css/var/getStyles.js +5 -0
- data/lib/api_browser/app/bower_components/jquery/src/css/var/isHidden.js +13 -0
- data/lib/api_browser/app/bower_components/jquery/src/css/var/rmargin.js +3 -0
- data/lib/api_browser/app/bower_components/jquery/src/css/var/rnumnonpx.js +5 -0
- data/lib/api_browser/app/bower_components/jquery/src/css.js +451 -0
- data/lib/api_browser/app/bower_components/jquery/src/data/Data.js +181 -0
- data/lib/api_browser/app/bower_components/jquery/src/data/accepts.js +20 -0
- data/lib/api_browser/app/bower_components/jquery/src/data/var/data_priv.js +5 -0
- data/lib/api_browser/app/bower_components/jquery/src/data/var/data_user.js +5 -0
- data/lib/api_browser/app/bower_components/jquery/src/data.js +179 -0
- data/lib/api_browser/app/bower_components/jquery/src/deferred.js +149 -0
- data/lib/api_browser/app/bower_components/jquery/src/deprecated.js +13 -0
- data/lib/api_browser/app/bower_components/jquery/src/dimensions.js +50 -0
- data/lib/api_browser/app/bower_components/jquery/src/effects/Tween.js +114 -0
- data/lib/api_browser/app/bower_components/jquery/src/effects/animatedSelector.js +13 -0
- data/lib/api_browser/app/bower_components/jquery/src/effects.js +649 -0
- data/lib/api_browser/app/bower_components/jquery/src/event/alias.js +39 -0
- data/lib/api_browser/app/bower_components/jquery/src/event/support.js +9 -0
- data/lib/api_browser/app/bower_components/jquery/src/event.js +868 -0
- data/lib/api_browser/app/bower_components/jquery/src/exports/amd.js +24 -0
- data/lib/api_browser/app/bower_components/jquery/src/exports/global.js +32 -0
- data/lib/api_browser/app/bower_components/jquery/src/intro.js +44 -0
- data/lib/api_browser/app/bower_components/jquery/src/jquery.js +36 -0
- data/lib/api_browser/app/bower_components/jquery/src/manipulation/_evalUrl.js +18 -0
- data/lib/api_browser/app/bower_components/jquery/src/manipulation/support.js +31 -0
- data/lib/api_browser/app/bower_components/jquery/src/manipulation/var/rcheckableType.js +3 -0
- data/lib/api_browser/app/bower_components/jquery/src/manipulation.js +582 -0
- data/lib/api_browser/app/bower_components/jquery/src/offset.js +204 -0
- data/lib/api_browser/app/bower_components/jquery/src/outro.js +1 -0
- data/lib/api_browser/app/bower_components/jquery/src/queue/delay.js +22 -0
- data/lib/api_browser/app/bower_components/jquery/src/queue.js +142 -0
- data/lib/api_browser/app/bower_components/jquery/src/selector-native.js +172 -0
- data/lib/api_browser/app/bower_components/jquery/src/selector-sizzle.js +14 -0
- data/lib/api_browser/app/bower_components/jquery/src/selector.js +1 -0
- data/lib/api_browser/app/bower_components/jquery/src/serialize.js +111 -0
- data/lib/api_browser/app/bower_components/jquery/src/sizzle/dist/sizzle.js +2044 -0
- data/lib/api_browser/app/bower_components/jquery/src/sizzle/dist/sizzle.min.js +3 -0
- data/lib/api_browser/app/bower_components/jquery/src/sizzle/dist/sizzle.min.map +1 -0
- data/lib/api_browser/app/bower_components/jquery/src/traversing/findFilter.js +100 -0
- data/lib/api_browser/app/bower_components/jquery/src/traversing/var/rneedsContext.js +6 -0
- data/lib/api_browser/app/bower_components/jquery/src/traversing.js +200 -0
- data/lib/api_browser/app/bower_components/jquery/src/var/arr.js +3 -0
- data/lib/api_browser/app/bower_components/jquery/src/var/class2type.js +4 -0
- data/lib/api_browser/app/bower_components/jquery/src/var/concat.js +5 -0
- data/lib/api_browser/app/bower_components/jquery/src/var/hasOwn.js +5 -0
- data/lib/api_browser/app/bower_components/jquery/src/var/indexOf.js +5 -0
- data/lib/api_browser/app/bower_components/jquery/src/var/pnum.js +3 -0
- data/lib/api_browser/app/bower_components/jquery/src/var/push.js +5 -0
- data/lib/api_browser/app/bower_components/jquery/src/var/rnotwhite.js +3 -0
- data/lib/api_browser/app/bower_components/jquery/src/var/slice.js +5 -0
- data/lib/api_browser/app/bower_components/jquery/src/var/strundefined.js +3 -0
- data/lib/api_browser/app/bower_components/jquery/src/var/support.js +4 -0
- data/lib/api_browser/app/bower_components/jquery/src/var/toString.js +5 -0
- data/lib/api_browser/app/bower_components/jquery/src/wrap.js +78 -0
- data/lib/api_browser/app/bower_components/lodash/.bower.json +34 -0
- data/lib/api_browser/app/bower_components/lodash/LICENSE.txt +22 -0
- data/lib/api_browser/app/bower_components/lodash/bower.json +23 -0
- data/lib/api_browser/app/bower_components/lodash/dist/lodash.compat.js +7157 -0
- data/lib/api_browser/app/bower_components/lodash/dist/lodash.compat.min.js +61 -0
- data/lib/api_browser/app/bower_components/lodash/dist/lodash.js +6785 -0
- data/lib/api_browser/app/bower_components/lodash/dist/lodash.min.js +56 -0
- data/lib/api_browser/app/bower_components/lodash/dist/lodash.underscore.js +4979 -0
- data/lib/api_browser/app/bower_components/lodash/dist/lodash.underscore.min.js +39 -0
- data/lib/api_browser/app/css/main.css +4510 -0
- data/lib/api_browser/app/index.html +51 -0
- data/lib/api_browser/app/js/app.js +32 -0
- data/lib/api_browser/app/js/controllers/action.js +51 -0
- data/lib/api_browser/app/js/controllers/controller.js +10 -0
- data/lib/api_browser/app/js/controllers/menu.js +49 -0
- data/lib/api_browser/app/js/controllers/type.js +28 -0
- data/lib/api_browser/app/js/directives/attribute_description.js +43 -0
- data/lib/api_browser/app/js/directives/attribute_table.js +27 -0
- data/lib/api_browser/app/js/directives/attribute_table_row.js +17 -0
- data/lib/api_browser/app/js/directives/no_container.js +8 -0
- data/lib/api_browser/app/js/directives/request_body.js +25 -0
- data/lib/api_browser/app/js/directives/request_headers.js +20 -0
- data/lib/api_browser/app/js/directives/request_parameters.js +20 -0
- data/lib/api_browser/app/js/directives/type_label.js +53 -0
- data/lib/api_browser/app/js/factories/Documentation.js +16 -0
- data/lib/api_browser/app/js/factories/PayloadTemplates.js +10 -0
- data/lib/api_browser/app/js/factories/TemplateProvider.js +45 -0
- data/lib/api_browser/app/js/factories/TypeTemplates.js +11 -0
- data/lib/api_browser/app/js/filters/attribute_name.js +9 -0
- data/lib/api_browser/app/js/filters/friendly_json.js +5 -0
- data/lib/api_browser/app/js/filters/is_empty.js +8 -0
- data/lib/api_browser/app/js/filters/resource_name.js +5 -0
- data/lib/api_browser/app/sass/main.scss +59 -0
- data/lib/api_browser/app/sass/modules/_body.scss +11 -0
- data/lib/api_browser/app/sass/modules/_cloke.scss +8 -0
- data/lib/api_browser/app/sass/modules/_header.scss +15 -0
- data/lib/api_browser/app/sass/modules/_nav.scss +7 -0
- data/lib/api_browser/app/sass/modules/_sidebar.scss +26 -0
- data/lib/api_browser/app/sass/modules/_switch.scss +55 -0
- data/lib/api_browser/app/sass/modules/_table.scss +13 -0
- data/lib/api_browser/app/sass/variables/_bootstrap-variables.scss +762 -0
- data/lib/api_browser/app/views/action.html +83 -0
- data/lib/api_browser/app/views/controller.html +24 -0
- data/lib/api_browser/app/views/directives/attribute_description/_default.html +2 -0
- data/lib/api_browser/app/views/directives/attribute_description/_example.html +8 -0
- data/lib/api_browser/app/views/directives/attribute_description/_headers.html +8 -0
- data/lib/api_browser/app/views/directives/attribute_description.html +2 -0
- data/lib/api_browser/app/views/directives/attribute_table.html +23 -0
- data/lib/api_browser/app/views/directives/attribute_table_row/_default.html +10 -0
- data/lib/api_browser/app/views/directives/attribute_table_row/_links.html +10 -0
- data/lib/api_browser/app/views/directives/attribute_table_row/_struct.html +2 -0
- data/lib/api_browser/app/views/directives/request_body/_default.html +20 -0
- data/lib/api_browser/app/views/directives/request_body/_struct.html +1 -0
- data/lib/api_browser/app/views/home.html +7 -0
- data/lib/api_browser/app/views/layout.html +50 -0
- data/lib/api_browser/app/views/resource/_actions.html +23 -0
- data/lib/api_browser/app/views/type/_details.html +29 -0
- data/lib/api_browser/app/views/type.html +25 -0
- data/lib/api_browser/bower.json +26 -0
- data/lib/api_browser/package.json +30 -0
- data/lib/praxis/action_definition/headers_dsl_compiler.rb +36 -0
- data/lib/praxis/action_definition.rb +153 -0
- data/lib/praxis/api_definition.rb +59 -0
- data/lib/praxis/application.rb +65 -0
- data/lib/praxis/bootloader.rb +91 -0
- data/lib/praxis/bootloader_stages/environment.rb +57 -0
- data/lib/praxis/bootloader_stages/file_loader.rb +31 -0
- data/lib/praxis/bootloader_stages/routing.rb +34 -0
- data/lib/praxis/bootloader_stages/subgroup_loader.rb +27 -0
- data/lib/praxis/bootloader_stages/warn_unloaded_files.rb +40 -0
- data/lib/praxis/config.rb +92 -0
- data/lib/praxis/content_type_parser.rb +62 -0
- data/lib/praxis/controller.rb +59 -0
- data/lib/praxis/dispatcher.rb +102 -0
- data/lib/praxis/exception.rb +4 -0
- data/lib/praxis/exceptions/config.rb +6 -0
- data/lib/praxis/exceptions/config_load.rb +9 -0
- data/lib/praxis/exceptions/config_validation.rb +9 -0
- data/lib/praxis/exceptions/invalid_configuration.rb +6 -0
- data/lib/praxis/exceptions/invalid_response.rb +6 -0
- data/lib/praxis/exceptions/invalid_trait.rb +6 -0
- data/lib/praxis/exceptions/stage_not_found.rb +6 -0
- data/lib/praxis/exceptions/validation.rb +6 -0
- data/lib/praxis/file_group.rb +39 -0
- data/lib/praxis/links.rb +110 -0
- data/lib/praxis/media_type.rb +40 -0
- data/lib/praxis/media_type_collection.rb +120 -0
- data/lib/praxis/multipart/parser.rb +213 -0
- data/lib/praxis/multipart/part.rb +26 -0
- data/lib/praxis/plugin.rb +30 -0
- data/lib/praxis/request.rb +131 -0
- data/lib/praxis/request_stages/action.rb +20 -0
- data/lib/praxis/request_stages/load_request.rb +13 -0
- data/lib/praxis/request_stages/request_stage.rb +52 -0
- data/lib/praxis/request_stages/response.rb +26 -0
- data/lib/praxis/request_stages/validate.rb +20 -0
- data/lib/praxis/request_stages/validate_params_and_headers.rb +38 -0
- data/lib/praxis/request_stages/validate_payload.rb +32 -0
- data/lib/praxis/resource_definition.rb +89 -0
- data/lib/praxis/response.rb +107 -0
- data/lib/praxis/response_definition.rb +264 -0
- data/lib/praxis/response_template.rb +34 -0
- data/lib/praxis/responses/http.rb +166 -0
- data/lib/praxis/responses/validation_error.rb +36 -0
- data/lib/praxis/route.rb +27 -0
- data/lib/praxis/router.rb +89 -0
- data/lib/praxis/simple_media_type.rb +24 -0
- data/lib/praxis/skeletor/restful_routing_config.rb +45 -0
- data/lib/praxis/stage.rb +94 -0
- data/lib/praxis/tasks/api_docs.rb +336 -0
- data/lib/praxis/tasks/console.rb +11 -0
- data/lib/praxis/tasks/environment.rb +5 -0
- data/lib/praxis/tasks/routes.rb +45 -0
- data/lib/praxis/tasks.rb +4 -0
- data/lib/praxis/types/collection.rb +17 -0
- data/lib/praxis/types/multipart.rb +69 -0
- data/lib/praxis/version.rb +3 -0
- data/lib/praxis.rb +119 -1
- data/praxis.gemspec +50 -0
- data/spec/functional_spec.rb +186 -0
- data/spec/praxis/action_definition_spec.rb +134 -0
- data/spec/praxis/api_resource_spec.rb +0 -0
- data/spec/praxis/application_spec.rb +46 -0
- data/spec/praxis/bootloader_spec.rb +58 -0
- data/spec/praxis/config_spec.rb +118 -0
- data/spec/praxis/content_type_parser_spec.rb +91 -0
- data/spec/praxis/controller_spec.rb +73 -0
- data/spec/praxis/dispatcher_spec.rb +0 -0
- data/spec/praxis/file_group_spec.rb +34 -0
- data/spec/praxis/links_spec.rb +45 -0
- data/spec/praxis/media_type_collection_spec.rb +145 -0
- data/spec/praxis/media_type_spec.rb +80 -0
- data/spec/praxis/multipart/parser_spec.rb +54 -0
- data/spec/praxis/request_spec.rb +109 -0
- data/spec/praxis/request_stages_validate_spec.rb +34 -0
- data/spec/praxis/resource_definition_spec.rb +116 -0
- data/spec/praxis/response_definition_spec.rb +500 -0
- data/spec/praxis/response_spec.rb +166 -0
- data/spec/praxis/restful_routing_config_spec.rb +88 -0
- data/spec/praxis/route_spec.rb +42 -0
- data/spec/praxis/router_spec.rb +148 -0
- data/spec/praxis/stage_spec.rb +110 -0
- data/spec/praxis/types/multipart_spec.rb +81 -0
- data/spec/spec_app/app/controllers/instances.rb +63 -0
- data/spec/spec_app/app/responses/bulk_response.rb +6 -0
- data/spec/spec_app/app/responses/multipart.rb +10 -0
- data/spec/spec_app/app/responses/other_response.rb +6 -0
- data/spec/spec_app/config/environment.rb +17 -0
- data/spec/spec_app/config.ru +17 -0
- data/spec/spec_app/design/api.rb +27 -0
- data/spec/spec_app/design/media_types/instance.rb +35 -0
- data/spec/spec_app/design/media_types/volume.rb +34 -0
- data/spec/spec_app/design/media_types/volume_snapshot.rb +38 -0
- data/spec/spec_app/design/resources/instances.rb +161 -0
- data/spec/spec_helper.rb +39 -0
- data/spec/support/spec_media_types.rb +46 -0
- data/spec/support/spec_resource_definitions.rb +33 -0
- data/tasks/praxis_app_generator.thor +307 -0
- metadata +847 -12
@@ -0,0 +1,404 @@
|
|
1
|
+
/*
|
2
|
+
|
3
|
+
Holder - 2.1 - client side image placeholders
|
4
|
+
(c) 2012-2013 Ivan Malopinsky / http://imsky.co
|
5
|
+
|
6
|
+
Provided under the MIT License.
|
7
|
+
Commercial use requires attribution.
|
8
|
+
|
9
|
+
*/
|
10
|
+
|
11
|
+
var Holder = Holder || {};
|
12
|
+
(function (app, win) {
|
13
|
+
|
14
|
+
var preempted = false,
|
15
|
+
fallback = false,
|
16
|
+
canvas = document.createElement('canvas');
|
17
|
+
|
18
|
+
if (!canvas.getContext) {
|
19
|
+
fallback = true;
|
20
|
+
} else {
|
21
|
+
if (canvas.toDataURL("image/png")
|
22
|
+
.indexOf("data:image/png") < 0) {
|
23
|
+
//Android doesn't support data URI
|
24
|
+
fallback = true;
|
25
|
+
} else {
|
26
|
+
var ctx = canvas.getContext("2d");
|
27
|
+
}
|
28
|
+
}
|
29
|
+
|
30
|
+
var dpr = 1, bsr = 1;
|
31
|
+
|
32
|
+
if(!fallback){
|
33
|
+
dpr = window.devicePixelRatio || 1,
|
34
|
+
bsr = ctx.webkitBackingStorePixelRatio || ctx.mozBackingStorePixelRatio || ctx.msBackingStorePixelRatio || ctx.oBackingStorePixelRatio || ctx.backingStorePixelRatio || 1;
|
35
|
+
}
|
36
|
+
|
37
|
+
var ratio = dpr / bsr;
|
38
|
+
|
39
|
+
//getElementsByClassName polyfill
|
40
|
+
document.getElementsByClassName||(document.getElementsByClassName=function(e){var t=document,n,r,i,s=[];if(t.querySelectorAll)return t.querySelectorAll("."+e);if(t.evaluate){r=".//*[contains(concat(' ', @class, ' '), ' "+e+" ')]",n=t.evaluate(r,t,null,0,null);while(i=n.iterateNext())s.push(i)}else{n=t.getElementsByTagName("*"),r=new RegExp("(^|\\s)"+e+"(\\s|$)");for(i=0;i<n.length;i++)r.test(n[i].className)&&s.push(n[i])}return s})
|
41
|
+
|
42
|
+
//getComputedStyle polyfill
|
43
|
+
window.getComputedStyle||(window.getComputedStyle=function(e){return this.el=e,this.getPropertyValue=function(t){var n=/(\-([a-z]){1})/g;return t=="float"&&(t="styleFloat"),n.test(t)&&(t=t.replace(n,function(){return arguments[2].toUpperCase()})),e.currentStyle[t]?e.currentStyle[t]:null},this})
|
44
|
+
|
45
|
+
//http://javascript.nwbox.com/ContentLoaded by Diego Perini with modifications
|
46
|
+
function contentLoaded(n,t){var l="complete",s="readystatechange",u=!1,h=u,c=!0,i=n.document,a=i.documentElement,e=i.addEventListener?"addEventListener":"attachEvent",v=i.addEventListener?"removeEventListener":"detachEvent",f=i.addEventListener?"":"on",r=function(e){(e.type!=s||i.readyState==l)&&((e.type=="load"?n:i)[v](f+e.type,r,u),!h&&(h=!0)&&t.call(n,null))},o=function(){try{a.doScroll("left")}catch(n){setTimeout(o,50);return}r("poll")};if(i.readyState==l)t.call(n,"lazy");else{if(i.createEventObject&&a.doScroll){try{c=!n.frameElement}catch(y){}c&&o()}i[e](f+"DOMContentLoaded",r,u),i[e](f+s,r,u),n[e](f+"load",r,u)}}
|
47
|
+
|
48
|
+
//https://gist.github.com/991057 by Jed Schmidt with modifications
|
49
|
+
function selector(a){
|
50
|
+
a=a.match(/^(\W)?(.*)/);var b=document["getElement"+(a[1]?a[1]=="#"?"ById":"sByClassName":"sByTagName")](a[2]);
|
51
|
+
var ret=[]; b!==null&&(b.length?ret=b:b.length===0?ret=b:ret=[b]); return ret;
|
52
|
+
}
|
53
|
+
|
54
|
+
//shallow object property extend
|
55
|
+
function extend(a,b){var c={};for(var d in a)c[d]=a[d];for(var e in b)c[e]=b[e];return c}
|
56
|
+
|
57
|
+
//hasOwnProperty polyfill
|
58
|
+
if (!Object.prototype.hasOwnProperty)
|
59
|
+
/*jshint -W001, -W103 */
|
60
|
+
Object.prototype.hasOwnProperty = function(prop) {
|
61
|
+
var proto = this.__proto__ || this.constructor.prototype;
|
62
|
+
return (prop in this) && (!(prop in proto) || proto[prop] !== this[prop]);
|
63
|
+
}
|
64
|
+
/*jshint +W001, +W103 */
|
65
|
+
|
66
|
+
function text_size(width, height, template) {
|
67
|
+
height = parseInt(height, 10);
|
68
|
+
width = parseInt(width, 10);
|
69
|
+
var bigSide = Math.max(height, width)
|
70
|
+
var smallSide = Math.min(height, width)
|
71
|
+
var scale = 1 / 12;
|
72
|
+
var newHeight = Math.min(smallSide * 0.75, 0.75 * bigSide * scale);
|
73
|
+
return {
|
74
|
+
height: Math.round(Math.max(template.size, newHeight))
|
75
|
+
}
|
76
|
+
}
|
77
|
+
|
78
|
+
function draw(ctx, dimensions, template, ratio, literal) {
|
79
|
+
var ts = text_size(dimensions.width, dimensions.height, template);
|
80
|
+
var text_height = ts.height;
|
81
|
+
var width = dimensions.width * ratio,
|
82
|
+
height = dimensions.height * ratio;
|
83
|
+
var font = template.font ? template.font : "sans-serif";
|
84
|
+
canvas.width = width;
|
85
|
+
canvas.height = height;
|
86
|
+
ctx.textAlign = "center";
|
87
|
+
ctx.textBaseline = "middle";
|
88
|
+
ctx.fillStyle = template.background;
|
89
|
+
ctx.fillRect(0, 0, width, height);
|
90
|
+
ctx.fillStyle = template.foreground;
|
91
|
+
ctx.font = "bold " + text_height + "px " + font;
|
92
|
+
var text = template.text ? template.text : (Math.floor(dimensions.width) + "x" + Math.floor(dimensions.height));
|
93
|
+
if (literal) {
|
94
|
+
text = template.literalText;
|
95
|
+
}
|
96
|
+
var text_width = ctx.measureText(text).width;
|
97
|
+
if (text_width / width >= 0.75) {
|
98
|
+
text_height = Math.floor(text_height * 0.75 * (width / text_width));
|
99
|
+
}
|
100
|
+
//Resetting font size if necessary
|
101
|
+
ctx.font = "bold " + (text_height * ratio) + "px " + font;
|
102
|
+
ctx.fillText(text, (width / 2), (height / 2), width);
|
103
|
+
return canvas.toDataURL("image/png");
|
104
|
+
}
|
105
|
+
|
106
|
+
function render(mode, el, holder, src) {
|
107
|
+
var dimensions = holder.dimensions,
|
108
|
+
theme = holder.theme,
|
109
|
+
text = holder.text ? decodeURIComponent(holder.text) : holder.text;
|
110
|
+
var dimensions_caption = dimensions.width + "x" + dimensions.height;
|
111
|
+
theme = (text ? extend(theme, {
|
112
|
+
text: text
|
113
|
+
}) : theme);
|
114
|
+
theme = (holder.font ? extend(theme, {
|
115
|
+
font: holder.font
|
116
|
+
}) : theme);
|
117
|
+
el.setAttribute("data-src", src);
|
118
|
+
theme.literalText = dimensions_caption;
|
119
|
+
holder.originalTheme = holder.theme;
|
120
|
+
holder.theme = theme;
|
121
|
+
|
122
|
+
if (mode == "image") {
|
123
|
+
el.setAttribute("alt", text ? text : theme.text ? theme.text + " [" + dimensions_caption + "]" : dimensions_caption);
|
124
|
+
if (fallback || !holder.auto) {
|
125
|
+
el.style.width = dimensions.width + "px";
|
126
|
+
el.style.height = dimensions.height + "px";
|
127
|
+
}
|
128
|
+
if (fallback) {
|
129
|
+
el.style.backgroundColor = theme.background;
|
130
|
+
} else {
|
131
|
+
el.setAttribute("src", draw(ctx, dimensions, theme, ratio));
|
132
|
+
}
|
133
|
+
} else if (mode == "background") {
|
134
|
+
if (!fallback) {
|
135
|
+
el.style.backgroundImage = "url(" + draw(ctx, dimensions, theme, ratio) + ")";
|
136
|
+
el.style.backgroundSize = dimensions.width + "px " + dimensions.height + "px";
|
137
|
+
}
|
138
|
+
} else if (mode == "fluid") {
|
139
|
+
el.setAttribute("alt", text ? text : theme.text ? theme.text + " [" + dimensions_caption + "]" : dimensions_caption);
|
140
|
+
if (dimensions.height.slice(-1) == "%") {
|
141
|
+
el.style.height = dimensions.height
|
142
|
+
} else {
|
143
|
+
el.style.height = dimensions.height + "px"
|
144
|
+
}
|
145
|
+
if (dimensions.width.slice(-1) == "%") {
|
146
|
+
el.style.width = dimensions.width
|
147
|
+
} else {
|
148
|
+
el.style.width = dimensions.width + "px"
|
149
|
+
}
|
150
|
+
if (el.style.display == "inline" || el.style.display === "") {
|
151
|
+
el.style.display = "block";
|
152
|
+
}
|
153
|
+
if (fallback) {
|
154
|
+
el.style.backgroundColor = theme.background;
|
155
|
+
} else {
|
156
|
+
el.holderData = holder;
|
157
|
+
fluid_images.push(el);
|
158
|
+
fluid_update(el);
|
159
|
+
}
|
160
|
+
}
|
161
|
+
}
|
162
|
+
|
163
|
+
function fluid_update(element) {
|
164
|
+
var images;
|
165
|
+
if (element.nodeType == null) {
|
166
|
+
images = fluid_images;
|
167
|
+
} else {
|
168
|
+
images = [element]
|
169
|
+
}
|
170
|
+
for (var i in images) {
|
171
|
+
var el = images[i]
|
172
|
+
if (el.holderData) {
|
173
|
+
var holder = el.holderData;
|
174
|
+
el.setAttribute("src", draw(ctx, {
|
175
|
+
height: el.clientHeight,
|
176
|
+
width: el.clientWidth
|
177
|
+
}, holder.theme, ratio, !! holder.literal));
|
178
|
+
}
|
179
|
+
}
|
180
|
+
}
|
181
|
+
|
182
|
+
function parse_flags(flags, options) {
|
183
|
+
var ret = {
|
184
|
+
theme: settings.themes.gray
|
185
|
+
};
|
186
|
+
var render = false;
|
187
|
+
for (sl = flags.length, j = 0; j < sl; j++) {
|
188
|
+
var flag = flags[j];
|
189
|
+
if (app.flags.dimensions.match(flag)) {
|
190
|
+
render = true;
|
191
|
+
ret.dimensions = app.flags.dimensions.output(flag);
|
192
|
+
} else if (app.flags.fluid.match(flag)) {
|
193
|
+
render = true;
|
194
|
+
ret.dimensions = app.flags.fluid.output(flag);
|
195
|
+
ret.fluid = true;
|
196
|
+
} else if (app.flags.literal.match(flag)) {
|
197
|
+
ret.literal = true;
|
198
|
+
} else if (app.flags.colors.match(flag)) {
|
199
|
+
ret.theme = app.flags.colors.output(flag);
|
200
|
+
} else if (options.themes[flag]) {
|
201
|
+
//If a theme is specified, it will override custom colors
|
202
|
+
ret.theme = options.themes[flag];
|
203
|
+
} else if (app.flags.font.match(flag)) {
|
204
|
+
ret.font = app.flags.font.output(flag);
|
205
|
+
} else if (app.flags.auto.match(flag)) {
|
206
|
+
ret.auto = true;
|
207
|
+
} else if (app.flags.text.match(flag)) {
|
208
|
+
ret.text = app.flags.text.output(flag);
|
209
|
+
}
|
210
|
+
}
|
211
|
+
return render ? ret : false;
|
212
|
+
}
|
213
|
+
var fluid_images = [];
|
214
|
+
var settings = {
|
215
|
+
domain: "holder.js",
|
216
|
+
images: "img",
|
217
|
+
bgnodes: ".holderjs",
|
218
|
+
themes: {
|
219
|
+
"gray": {
|
220
|
+
background: "#eee",
|
221
|
+
foreground: "#aaa",
|
222
|
+
size: 12
|
223
|
+
},
|
224
|
+
"social": {
|
225
|
+
background: "#3a5a97",
|
226
|
+
foreground: "#fff",
|
227
|
+
size: 12
|
228
|
+
},
|
229
|
+
"industrial": {
|
230
|
+
background: "#434A52",
|
231
|
+
foreground: "#C2F200",
|
232
|
+
size: 12
|
233
|
+
}
|
234
|
+
},
|
235
|
+
stylesheet: ""
|
236
|
+
};
|
237
|
+
app.flags = {
|
238
|
+
dimensions: {
|
239
|
+
regex: /^(\d+)x(\d+)$/,
|
240
|
+
output: function (val) {
|
241
|
+
var exec = this.regex.exec(val);
|
242
|
+
return {
|
243
|
+
width: +exec[1],
|
244
|
+
height: +exec[2]
|
245
|
+
}
|
246
|
+
}
|
247
|
+
},
|
248
|
+
fluid: {
|
249
|
+
regex: /^([0-9%]+)x([0-9%]+)$/,
|
250
|
+
output: function (val) {
|
251
|
+
var exec = this.regex.exec(val);
|
252
|
+
return {
|
253
|
+
width: exec[1],
|
254
|
+
height: exec[2]
|
255
|
+
}
|
256
|
+
}
|
257
|
+
},
|
258
|
+
colors: {
|
259
|
+
regex: /#([0-9a-f]{3,})\:#([0-9a-f]{3,})/i,
|
260
|
+
output: function (val) {
|
261
|
+
var exec = this.regex.exec(val);
|
262
|
+
return {
|
263
|
+
size: settings.themes.gray.size,
|
264
|
+
foreground: "#" + exec[2],
|
265
|
+
background: "#" + exec[1]
|
266
|
+
}
|
267
|
+
}
|
268
|
+
},
|
269
|
+
text: {
|
270
|
+
regex: /text\:(.*)/,
|
271
|
+
output: function (val) {
|
272
|
+
return this.regex.exec(val)[1];
|
273
|
+
}
|
274
|
+
},
|
275
|
+
font: {
|
276
|
+
regex: /font\:(.*)/,
|
277
|
+
output: function (val) {
|
278
|
+
return this.regex.exec(val)[1];
|
279
|
+
}
|
280
|
+
},
|
281
|
+
auto: {
|
282
|
+
regex: /^auto$/
|
283
|
+
},
|
284
|
+
literal: {
|
285
|
+
regex: /^literal$/
|
286
|
+
}
|
287
|
+
}
|
288
|
+
for (var flag in app.flags) {
|
289
|
+
if (!app.flags.hasOwnProperty(flag)) continue;
|
290
|
+
app.flags[flag].match = function (val) {
|
291
|
+
return val.match(this.regex)
|
292
|
+
}
|
293
|
+
}
|
294
|
+
app.add_theme = function (name, theme) {
|
295
|
+
name != null && theme != null && (settings.themes[name] = theme);
|
296
|
+
return app;
|
297
|
+
};
|
298
|
+
app.add_image = function (src, el) {
|
299
|
+
var node = selector(el);
|
300
|
+
if (node.length) {
|
301
|
+
for (var i = 0, l = node.length; i < l; i++) {
|
302
|
+
var img = document.createElement("img")
|
303
|
+
img.setAttribute("data-src", src);
|
304
|
+
node[i].appendChild(img);
|
305
|
+
}
|
306
|
+
}
|
307
|
+
return app;
|
308
|
+
};
|
309
|
+
app.run = function (o) {
|
310
|
+
var options = extend(settings, o),
|
311
|
+
images = [],
|
312
|
+
imageNodes = [],
|
313
|
+
bgnodes = [];
|
314
|
+
if (typeof (options.images) == "string") {
|
315
|
+
imageNodes = selector(options.images);
|
316
|
+
} else if (window.NodeList && options.images instanceof window.NodeList) {
|
317
|
+
imageNodes = options.images;
|
318
|
+
} else if (window.Node && options.images instanceof window.Node) {
|
319
|
+
imageNodes = [options.images];
|
320
|
+
}
|
321
|
+
if (typeof (options.bgnodes) == "string") {
|
322
|
+
bgnodes = selector(options.bgnodes);
|
323
|
+
} else if (window.NodeList && options.elements instanceof window.NodeList) {
|
324
|
+
bgnodes = options.bgnodes;
|
325
|
+
} else if (window.Node && options.bgnodes instanceof window.Node) {
|
326
|
+
bgnodes = [options.bgnodes];
|
327
|
+
}
|
328
|
+
preempted = true;
|
329
|
+
for (i = 0, l = imageNodes.length; i < l; i++) images.push(imageNodes[i]);
|
330
|
+
var holdercss = document.getElementById("holderjs-style");
|
331
|
+
if (!holdercss) {
|
332
|
+
holdercss = document.createElement("style");
|
333
|
+
holdercss.setAttribute("id", "holderjs-style");
|
334
|
+
holdercss.type = "text/css";
|
335
|
+
document.getElementsByTagName("head")[0].appendChild(holdercss);
|
336
|
+
}
|
337
|
+
if (!options.nocss) {
|
338
|
+
if (holdercss.styleSheet) {
|
339
|
+
holdercss.styleSheet.cssText += options.stylesheet;
|
340
|
+
} else {
|
341
|
+
holdercss.appendChild(document.createTextNode(options.stylesheet));
|
342
|
+
}
|
343
|
+
}
|
344
|
+
var cssregex = new RegExp(options.domain + "\/(.*?)\"?\\)");
|
345
|
+
for (var l = bgnodes.length, i = 0; i < l; i++) {
|
346
|
+
var src = window.getComputedStyle(bgnodes[i], null)
|
347
|
+
.getPropertyValue("background-image");
|
348
|
+
var flags = src.match(cssregex);
|
349
|
+
var bgsrc = bgnodes[i].getAttribute("data-background-src");
|
350
|
+
if (flags) {
|
351
|
+
var holder = parse_flags(flags[1].split("/"), options);
|
352
|
+
if (holder) {
|
353
|
+
render("background", bgnodes[i], holder, src);
|
354
|
+
}
|
355
|
+
} else if (bgsrc != null) {
|
356
|
+
var holder = parse_flags(bgsrc.substr(bgsrc.lastIndexOf(options.domain) + options.domain.length + 1)
|
357
|
+
.split("/"), options);
|
358
|
+
if (holder) {
|
359
|
+
render("background", bgnodes[i], holder, src);
|
360
|
+
}
|
361
|
+
}
|
362
|
+
}
|
363
|
+
for (l = images.length, i = 0; i < l; i++) {
|
364
|
+
var attr_data_src, attr_src;
|
365
|
+
attr_src = attr_data_src = src = null;
|
366
|
+
try {
|
367
|
+
attr_src = images[i].getAttribute("src");
|
368
|
+
attr_datasrc = images[i].getAttribute("data-src");
|
369
|
+
} catch (e) {}
|
370
|
+
if (attr_datasrc == null && !! attr_src && attr_src.indexOf(options.domain) >= 0) {
|
371
|
+
src = attr_src;
|
372
|
+
} else if ( !! attr_datasrc && attr_datasrc.indexOf(options.domain) >= 0) {
|
373
|
+
src = attr_datasrc;
|
374
|
+
}
|
375
|
+
if (src) {
|
376
|
+
var holder = parse_flags(src.substr(src.lastIndexOf(options.domain) + options.domain.length + 1)
|
377
|
+
.split("/"), options);
|
378
|
+
if (holder) {
|
379
|
+
if (holder.fluid) {
|
380
|
+
render("fluid", images[i], holder, src)
|
381
|
+
} else {
|
382
|
+
render("image", images[i], holder, src);
|
383
|
+
}
|
384
|
+
}
|
385
|
+
}
|
386
|
+
}
|
387
|
+
return app;
|
388
|
+
};
|
389
|
+
contentLoaded(win, function () {
|
390
|
+
if (window.addEventListener) {
|
391
|
+
window.addEventListener("resize", fluid_update, false);
|
392
|
+
window.addEventListener("orientationchange", fluid_update, false);
|
393
|
+
} else {
|
394
|
+
window.attachEvent("onresize", fluid_update)
|
395
|
+
}
|
396
|
+
preempted || app.run();
|
397
|
+
});
|
398
|
+
if (typeof define === "function" && define.amd) {
|
399
|
+
define([], function () {
|
400
|
+
return app;
|
401
|
+
});
|
402
|
+
}
|
403
|
+
|
404
|
+
})(Holder, window);
|
@@ -0,0 +1,12 @@
|
|
1
|
+
// NOTICE!! DO NOT USE ANY OF THIS JAVASCRIPT
|
2
|
+
// IT'S JUST JUNK FOR OUR DOCS!
|
3
|
+
// ++++++++++++++++++++++++++++++++++++++++++
|
4
|
+
/*!
|
5
|
+
* Copyright 2013 Twitter, Inc.
|
6
|
+
*
|
7
|
+
* Licensed under the Creative Commons Attribution 3.0 Unported License. For
|
8
|
+
* details, see http://creativecommons.org/licenses/by/3.0/.
|
9
|
+
*/
|
10
|
+
// Intended to prevent false-positive bug reports about responsive styling supposedly not working in IE8.
|
11
|
+
if (window.location.protocol == 'file:')
|
12
|
+
alert("ERROR: Bootstrap's responsive CSS is disabled!\nSee getbootstrap.com/getting-started/#respond-file-proto for details.")
|