├── .editorconfig ├── .gitattributes ├── .gitignore ├── CHANGELOG.md ├── CONTRIBUTING.md ├── Gruntfile.js ├── LICENSE ├── README.md ├── bower.json ├── docs ├── css │ └── style.css └── nav.html ├── karma.conf.js ├── misc ├── changelog.tpl.md ├── demo │ ├── assets │ │ ├── app.js │ │ ├── demo.css │ │ ├── github-16px.png │ │ ├── header.png │ │ ├── img │ │ │ ├── glyphicons-halflings-white.png │ │ │ ├── glyphicons-halflings.png │ │ │ ├── space-large.jpg │ │ │ ├── space-medium.jpg │ │ │ └── space-small.jpg │ │ ├── logo.png │ │ ├── plunker.js │ │ ├── rainbow-generic.js │ │ ├── rainbow-html.js │ │ ├── rainbow-javascript.js │ │ ├── rainbow.css │ │ ├── rainbow.js │ │ └── smoothscroll-angular-custom.js │ └── index.html ├── test-lib │ └── helpers.js └── validate-commit-msg.js ├── package.json ├── src ├── accordion │ ├── accordion.js │ ├── docs │ │ ├── demo.html │ │ ├── demo.js │ │ └── readme.md │ └── test │ │ └── accordion.spec.js ├── alert │ ├── alert.js │ ├── docs │ │ ├── demo.html │ │ ├── demo.js │ │ └── readme.md │ └── test │ │ └── alert.spec.js ├── bindHtml │ └── bindHtml.js ├── buttons │ ├── buttons.js │ ├── docs │ │ ├── demo.html │ │ ├── demo.js │ │ └── readme.md │ └── test │ │ └── buttons.spec.js ├── dropdownToggle │ ├── docs │ │ ├── demo.html │ │ ├── demo.js │ │ └── readme.md │ ├── dropdownToggle.js │ └── test │ │ └── dropdownToggle.spec.js ├── interchange │ ├── docs │ │ ├── demo.html │ │ ├── demo.js │ │ └── readme.md │ ├── interchange.js │ └── test │ │ └── interchange.spec.js ├── mediaQueries │ ├── docs │ │ └── readme.md │ └── mediaQueries.js ├── modal │ ├── docs │ │ ├── demo.html │ │ ├── demo.js │ │ └── readme.md │ ├── modal.js │ └── test │ │ ├── modal.spec.js │ │ ├── modalWindow.spec.js │ │ └── stackedMap.spec.js ├── offcanvas │ ├── docs │ │ ├── demo.html │ │ ├── demo.js │ │ └── readme.md │ ├── offcanvas.js │ └── test │ │ └── offcanvas.spec.js ├── pagination │ ├── docs │ │ ├── demo.html │ │ ├── demo.js │ │ └── readme.md │ ├── pagination.js │ └── test │ │ ├── pager.spec.js │ │ └── pagination.spec.js ├── popover │ ├── docs │ │ ├── demo.html │ │ ├── demo.js │ │ └── readme.md │ ├── popover.js │ └── test │ │ └── popover.spec.js ├── position │ ├── position.js │ └── test │ │ └── test.html ├── progressbar │ ├── docs │ │ ├── demo.html │ │ ├── demo.js │ │ └── readme.md │ ├── progressbar.js │ └── test │ │ └── progressbar.spec.js ├── rating │ ├── docs │ │ ├── demo.html │ │ ├── demo.js │ │ └── readme.md │ ├── rating.js │ └── test │ │ └── rating.spec.js ├── tabs │ ├── docs │ │ ├── demo.html │ │ ├── demo.js │ │ └── readme.md │ ├── tabs.js │ └── test │ │ └── tabs.spec.js ├── tooltip │ ├── docs │ │ ├── demo.html │ │ ├── demo.js │ │ └── readme.md │ ├── test │ │ ├── tooltip.spec.js │ │ └── tooltip2.spec.js │ └── tooltip.js ├── topbar │ ├── docs │ │ ├── demo.html │ │ ├── demo.js │ │ └── readme.md │ ├── test │ │ └── topbar.spec.js │ └── topbar.js ├── tour │ ├── docs │ │ ├── demo.html │ │ ├── demo.js │ │ └── readme.md │ ├── test │ │ └── tour.spec.js │ └── tour.js ├── transition │ ├── test │ │ └── transition.spec.js │ └── transition.js └── typeahead │ ├── docs │ ├── demo.html │ ├── demo.js │ └── readme.md │ ├── test │ ├── typeahead-highlight.spec.js │ ├── typeahead-parser.spec.js │ ├── typeahead-popup.spec.js │ └── typeahead.spec.js │ └── typeahead.js └── template ├── accordion ├── accordion-group.html └── accordion.html ├── alert └── alert.html ├── modal ├── backdrop.html └── window.html ├── pagination ├── pager.html └── pagination.html ├── popover └── popover.html ├── progressbar ├── bar.html ├── progress.html └── progressbar.html ├── rating └── rating.html ├── tabs ├── tab.html └── tabset.html ├── tooltip ├── tooltip-html-unsafe-popup.html └── tooltip-popup.html ├── topbar ├── has-dropdown.html ├── toggle-top-bar.html ├── top-bar-dropdown.html ├── top-bar-section.html └── top-bar.html ├── tour └── tour.html └── typeahead ├── typeahead-match.html └── typeahead-popup.html /.editorconfig: -------------------------------------------------------------------------------- 1 | # This file is for unifying the coding style for different editors and IDEs 2 | # editorconfig.org 3 | 4 | root = true 5 | 6 | [*] 7 | end_of_line = lf 8 | charset = utf-8 9 | trim_trailing_whitespace = true 10 | insert_final_newline = true 11 | 12 | # Tabs in JS unless otherwise specified 13 | [**.js] 14 | indent_style = space 15 | indent_size = 2 16 | 17 | [*.md] 18 | trim_trailing_whitespace = false -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | *.html eol=lf 2 | *.css eol=lf 3 | *.js eol=lf 4 | *.md eol=lf 5 | *.json eol=lf 6 | *.yml eol=lf 7 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | lib-cov 2 | *.seed 3 | *.log 4 | *.csv 5 | *.dat 6 | *.out 7 | *.pid 8 | *.gz 9 | *.swp 10 | *.swo 11 | .DS_Store 12 | 13 | pids 14 | logs 15 | results 16 | dist 17 | # test coverage files 18 | coverage/ 19 | 20 | node_modules 21 | bower_components 22 | npm-debug.log 23 | 24 | template/**/*.js 25 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | This project would not be possible without your help and support and we appreciate your willingness to contribute! 2 | 3 | ## Issues 4 | 5 | When reporting an issue, please create a demonstration of your issue using [plunker](http://plnkr.co/) or a similar service. We prefer to reserve issue reporting for actual issues. Instead of simply asking for a new feature, why not create it yourself and open a pull request? :wink: 6 | 7 | ## Pull Requests 8 | 9 | Please make sure that your contribution fits according to the project's goals: 10 | 11 | * we are aiming at rebuilding Foundation directives in pure AngularJS, without any dependencies on any external JavaScript library 12 | * the only dependency should be Foundation CSS and its markup structure 13 | * behavior should be properly tested 14 | * directives should be html-agnostic as much as possible which in practice means: 15 | * templates should be referred to using the `templateUrl` property 16 | * it should be easy to change a default template to a custom one 17 | * directives shouldn't manipulate DOM structure directly (when possible) 18 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Any new directives or rewrites of existing directives are subject to the following license: 2 | 3 | The MIT License 4 | 5 | Copyright (c) 2015 Pinecone, LLC 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in 15 | all copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | THE SOFTWARE. 24 | 25 | 26 | Shared angular-bootstrap code is subject to the following license: 27 | 28 | The MIT License 29 | 30 | Copyright (c) 2012-2013 the AngularUI Team, https://github.com/organizations/angular-ui/teams/291112 31 | 32 | Permission is hereby granted, free of charge, to any person obtaining a copy 33 | of this software and associated documentation files (the "Software"), to deal 34 | in the Software without restriction, including without limitation the rights 35 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 36 | copies of the Software, and to permit persons to whom the Software is 37 | furnished to do so, subject to the following conditions: 38 | 39 | The above copyright notice and this permission notice shall be included in 40 | all copies or substantial portions of the Software. 41 | 42 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 43 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 44 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 45 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 46 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 47 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 48 | THE SOFTWARE. 49 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ### Please see [this issue](https://github.com/pineconellc/angular-foundation/issues/311) for an important update regarding this project. 2 | 3 | # Angular Components for [Foundation](http://foundation.zurb.com/) 4 | [![Build Status](https://semaphoreapp.com/api/v1/projects/670cabb5-3c50-4197-9df5-e75cf62c9d20/237671/badge.png)](https://semaphoreapp.com/pinecone/angular-foundation) 5 | [![Latest Version](https://badge.fury.io/bo/angular-foundation.svg)](https://github.com/pineconellc/angular-foundation-bower) 6 | *** 7 | 8 | This project is a port of the AngularUI team's excellent [angular-bootstrap](https://github.com/angular-ui/bootstrap) project for use in the [Foundation](http://foundation.zurb.com/) framework. 9 | 10 | ## Demo 11 | 12 | Do you want to see this in action? Visit http://pineconellc.github.io/angular-foundation/ 13 | 14 | ## Installation 15 | 16 | Installation is easy as angular-mm-foundation has minimal dependencies - only the AngularJS and Foundation's CSS are required. 17 | After downloading dependencies (or better yet, referencing them from your favourite CDN) you need to download build version of this project. All the files and their purposes are described here: 18 | https://github.com/pineconellc/angular-foundation/tree/gh-pages 19 | Don't worry, if you are not sure which file to take, opt for `mm-foundation-tpls-[version].min.js`. 20 | 21 | When you are done downloading all the dependencies and project files the only remaining part is to add dependencies on the `mm.foundation` AngularJS module: 22 | 23 | ```javascript 24 | angular.module('myModule', ['mm.foundation']); 25 | ``` 26 | 27 | ## Supported Foundation components 28 | 29 | * Split Buttons 30 | * Reveal Modal 31 | * Alerts 32 | * Joyride 33 | * Dropdowns 34 | * Tabs 35 | * Offcanvas 36 | * Interchange 37 | 38 | We'd gladly accept contributions for any remaining components. 39 | 40 | ## Supported Browsers 41 | 42 | Directives **should** work with the following browsers: 43 | 44 | * Chrome (stable and canary channel) 45 | * Firefox 46 | * IE 10 and Edge 47 | * Opera 48 | * Safari 49 | 50 | Modern mobile browsers should work without problems. 51 | 52 | **IE 8 and 9 are not officially supported.** 53 | 54 | ## Project philosophy 55 | 56 | ### Native, lightweight directives 57 | 58 | We are aiming at providing a set of AngularJS directives based on Foundation's markup and CSS. The goal is to provide **native AngularJS directives** without any dependency on jQuery or Foundation's JavaScript. 59 | It is often better to rewrite an existing JavaScript code and create a new, pure AngularJS directive. Most of the time the resulting directive is smaller as compared to the orginal JavaScript code size and better integrated into the AngularJS ecosystem. 60 | 61 | ### Customizability 62 | 63 | All the directives in this repository should have their markup externalized as templates (loaded via `templateUrl`). In practice it means that you can **customize directive's markup at will**. One could even imagine providing a non-Foundation version of the templates! 64 | 65 | ### Take what you need and not more 66 | 67 | Each directive has its own AngularJS module without any dependencies on other modules or third-pary JavaScript code. In practice it means that you can **just grab the code for the directives you need** and you are not obliged to drag the whole repository. 68 | 69 | ### Quality and stability 70 | 71 | **Note:** Full test coverage is pending 72 | 73 | Directives should work. All the time and in all browsers. This is why all the directives have a comprehensive suite of unit tests. All the automated tests are executed on each checkin in several browsers: Chrome, ChromeCanary, Firefox, Opera, Safari, IE9. 74 | In fact we are fortunate enough to **benefit from the same testing infrastructure as AngularJS**! 75 | 76 | ## Contributing to the project 77 | 78 | We are always looking for the quality contributions! Please check the [CONTRIBUTING.md](CONTRIBUTING.md) for the contribution guidelines. 79 | 80 | ### Development 81 | #### Prepare your environment 82 | * Install [Node.js](http://nodejs.org/) which should include `npm` 83 | * Install global dev dependencies: `npm install -g grunt-cli karma bower` 84 | * Instal local dev dependencies: `npm install` while current directory is foundation repo 85 | * Install test dependencies: `bower install` 86 | 87 | #### Build 88 | * Build the whole project: `grunt` - this will run `lint`, `test`, and `concat` targets 89 | * To build modules, first run `grunt html2js` then `grunt build:module1:module2...:moduleN` 90 | 91 | You can generate a custom build, containing only needed modules, from the project's homepage. 92 | Alternativelly you can run local Grunt build from the command line and list needed modules as shown below: 93 | 94 | ``` 95 | grunt build:modal:tabs:alert:popover:dropdownToggle:buttons:progressbar 96 | ``` 97 | 98 | Check the Grunt build file for other tasks that are defined for this project. 99 | 100 | #### TDD 101 | * Run test: `grunt watch` 102 | 103 | This will start Karma server and will continously watch files in the project, executing tests upon every change. 104 | 105 | #### Test coverage 106 | Add the `--coverage` option (e.g. `grunt test --coverage`, `grunt watch --coverage`) to see reports on the test coverage. These coverage reports are found in the coverage folder. 107 | 108 | ### Customize templates 109 | 110 | As mentioned directives from this repository have all the markup externalized in templates. You might want to customize default 111 | templates to match your desired look & feel, add new functionality etc. 112 | 113 | The easiest way to override an individual template is to use the ` 122 | ``` 123 | 124 | If you want to override more templates it makes sense to store them as individual files and feed the `$templateCache` from those partials. 125 | For people using Grunt as the build tool it can be easily done using the `grunt-html2js` plugin. You can also configure your own template url. 126 | Let's have a look: 127 | 128 | Your own template url is `views/partials/mm-foundation-tpls/alert/alert.html`. 129 | 130 | Add "html2js" task to your Gruntfile 131 | ``` 132 | html2js: { 133 | options: { 134 | base: '.', 135 | module: 'ui-templates', 136 | rename: function (modulePath) { 137 | var moduleName = modulePath.replace('app/views/partials/mm-foundation-tpls/', '').replace('.html', ''); 138 | return 'template' + '/' + moduleName + '.html'; 139 | } 140 | }, 141 | main: { 142 | src: ['app/views/partials/mm-foundation-tpls/**/*.html'], 143 | dest: '.tmp/ui-templates.js' 144 | } 145 | } 146 | ``` 147 | 148 | Make sure to load your template.js file 149 | `` 150 | 151 | Inject the `ui-templates` module in your `app.js` 152 | ``` 153 | angular.module('myApp', [ 154 | 'mm.foundation', 155 | 'ui-templates' 156 | ]); 157 | ``` 158 | 159 | Then it will work fine! 160 | 161 | For more information visit: https://github.com/karlgoldstein/grunt-html2js 162 | 163 | ### Release 164 | * Bump up version number in `package.json` 165 | * Commit the version change with the following message: `chore(release): [version number]` 166 | * tag 167 | * push changes and a tag (`git push --tags`) 168 | * switch to the `gh-pages` branch: `git checkout gh-pages` 169 | * copy content of the dist folder to the main folder 170 | * Commit the version change with the following message: `chore(release): [version number]` 171 | * push changes 172 | * switch back to the `main branch` and modify `package.json` to bump up version for the next iteration 173 | * commit (`chore(release): starting [version number]`) and push 174 | * publish Bower and NuGet packages 175 | 176 | Well done! (If you don't like repeating yourself open a PR with a grunt task taking care of the above!) 177 | 178 | ## Credits 179 | 180 | Again, many thanks to the AngularUI team for the angular-bootstrap project. 181 | -------------------------------------------------------------------------------- /bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "angular-foundation", 3 | "homepage": "http://pineconellc.github.io/angular-foundation/", 4 | "authors": [ 5 | "Pinecone, LLC" 6 | ], 7 | "license": "MIT", 8 | "private": true, 9 | "ignore": [ 10 | "**/.*", 11 | "node_modules", 12 | "bower_components", 13 | "test", 14 | "tests" 15 | ], 16 | "dependencies": { 17 | "angular": ">=1.3.0" 18 | }, 19 | "devDependencies": { 20 | "angular": "=1.4.6", 21 | "angular-legacy": "angular#1.3.19", 22 | "angular-mocks": "=1.4.6", 23 | "angular-mocks-legacy": "angular-mocks#1.3.19", 24 | "jquery": "=1.8.2" 25 | }, 26 | "resolutions": { 27 | "angular": "=1.4.6" 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /docs/css/style.css: -------------------------------------------------------------------------------- 1 | .bs-docs-social { 2 | margin-top: 1em; 3 | padding: 15px 0; 4 | text-align: center; 5 | background-color: rgba(245,245,245,0.3); 6 | border-top: 1px solid rgba(255,255,255,0.3); 7 | border-bottom: 1px solid rgba(221,221,221,0.3); 8 | } 9 | .bs-docs-social-buttons { 10 | position: absolute; 11 | top: 8px; 12 | margin-left: 0; 13 | margin-bottom: 0; 14 | padding-left: 0; 15 | list-style: none; 16 | } 17 | .bs-docs-social-buttons li { 18 | list-style: none; 19 | display: inline-block; 20 | line-height: 1; 21 | } 22 | -------------------------------------------------------------------------------- /docs/nav.html: -------------------------------------------------------------------------------- 1 |
2 | 3 | Download (<%= pkg.version%>) 4 | 5 |
6 |
7 | 13 | -------------------------------------------------------------------------------- /karma.conf.js: -------------------------------------------------------------------------------- 1 | module.exports = function(config) { 2 | config.set({ 3 | // base path, that will be used to resolve files and exclude 4 | basePath: '.', 5 | 6 | frameworks: ['jasmine'], 7 | // list of files / patterns to load in the browser 8 | files: [ 9 | 'bower_components/jquery/jquery.js', 10 | 'bower_components/angular/angular.js', 11 | 'bower_components/angular-mocks/angular-mocks.js', 12 | 'misc/test-lib/helpers.js', 13 | 'src/**/*.js', 14 | 'template/**/*.js' 15 | ], 16 | 17 | // list of files to exclude 18 | exclude: [ 19 | 'src/**/demo.js' 20 | ], 21 | 22 | browsers: [ 23 | 'Chrome' 24 | ], 25 | 26 | // test results reporter to use 27 | // possible values: dots || progress 28 | reporters: ['progress'], 29 | 30 | // web server port 31 | port: 9018, 32 | 33 | // cli runner port 34 | runnerPort: 9100, 35 | 36 | // enable / disable colors in the output (reporters and logs) 37 | colors: true, 38 | 39 | // level of logging 40 | // possible values: LOG_DISABLE || LOG_ERROR || LOG_WARN || LOG_INFO || LOG_DEBUG 41 | logLevel: config.LOG_INFO, 42 | 43 | // enable / disable watching file and executing tests whenever any file changes 44 | autoWatch: false, 45 | 46 | // Continuous Integration mode 47 | // if true, it capture browsers, run tests and exit 48 | singleRun: false 49 | }); 50 | }; 51 | -------------------------------------------------------------------------------- /misc/changelog.tpl.md: -------------------------------------------------------------------------------- 1 | # <%= version%> (<%= today%>) 2 | <% if (_(changelog.feat).size() > 0) { %> 3 | ## Features 4 | <% _(changelog.feat).keys().sort().forEach(function(scope) { %> 5 | - **<%= scope%>:** <% changelog.feat[scope].forEach(function(change) { %> 6 | - <%= change.msg%> (<%= helpers.commitLink(change.sha1) %>) <% }); %><% }); %> <% } %> 7 | <% if (_(changelog.fix).size() > 0) { %> 8 | ## Bug Fixes 9 | <% _(changelog.fix).keys().sort().forEach(function(scope) { %> 10 | - **<%= scope%>:** <% changelog.fix[scope].forEach(function(change) { %> 11 | - <%= change.msg%> (<%= helpers.commitLink(change.sha1) %>) <% }); %><% }); %> <% } %> 12 | <% if (_(changelog.breaking).size() > 0) { %> 13 | ## Breaking Changes 14 | <% _(changelog.breaking).keys().sort().forEach(function(scope) { %> 15 | - **<%= scope%>:** <% changelog.breaking[scope].forEach(function(change) { %> 16 | <%= change.msg%><% }); %><% }); %> <% } %> 17 | -------------------------------------------------------------------------------- /misc/demo/assets/app.js: -------------------------------------------------------------------------------- 1 | var app = angular.module('foundationDemoApp', ['mm.foundation', 'plunker'], function($httpProvider){ 2 | FastClick.attach(document.body); 3 | delete $httpProvider.defaults.headers.common['X-Requested-With']; 4 | }); 5 | 6 | app.controller('MainCtrl', function($scope, $http, $document, $modal, orderByFilter) { 7 | var url = "http://50.116.42.77:3001"; 8 | //iFrame for downloading 9 | var $iframe = angular.element('