diff options
author | Bernhard Posselt <nukeawhale@gmail.com> | 2013-09-09 15:57:10 +0200 |
---|---|---|
committer | Bernhard Posselt <nukeawhale@gmail.com> | 2013-09-09 15:57:18 +0200 |
commit | 2824b43b7332e847810f042c4183ce95ee90e852 (patch) | |
tree | 9a10f31c8acbf01d72336d3d065f8c8fda4b83c5 /js/vendor/angular-ui/common | |
parent | f0abeddd07fcf21e30c95d58885416ef40d65391 (diff) |
use bower for managing deps
Diffstat (limited to 'js/vendor/angular-ui/common')
-rw-r--r-- | js/vendor/angular-ui/common/ieshiv/README.md | 47 | ||||
-rw-r--r-- | js/vendor/angular-ui/common/ieshiv/ieshiv.js | 52 | ||||
-rw-r--r-- | js/vendor/angular-ui/common/module.js | 5 | ||||
-rw-r--r-- | js/vendor/angular-ui/common/stylesheets/angular-ui.less | 7 | ||||
-rw-r--r-- | js/vendor/angular-ui/common/stylesheets/mixins.less | 11 |
5 files changed, 122 insertions, 0 deletions
diff --git a/js/vendor/angular-ui/common/ieshiv/README.md b/js/vendor/angular-ui/common/ieshiv/README.md new file mode 100644 index 000000000..0c77cec20 --- /dev/null +++ b/js/vendor/angular-ui/common/ieshiv/README.md @@ -0,0 +1,47 @@ +# angular-ui-ieshiv + +## Important! + +If not installed properly, angular WILL throw an exception. + + "No module: ui.directives" + +Which means you have not included the angular-ui library in the file, or the shiv is in the wrong place. + +WHY? Well, angular is throwing the exception and I can't catch and stop it. If properly setup, you should be good. +If not, then you should probably fix it or yank it out. Of course, then you won't have the shiv for ie. + +## Description + +This is used in order to support IE versions that do not support custom elements. For example: + + <ng-view></ng-view> + <ui-currency ng-model="somenum"></ui-currency> + +IE 8 and earlier do not allow custom tag elements into the DOM. It just ignores them. +In order to remedy, the trick is to tell browser by calling document.createElement('my-custom-element'). +Then you can use, <my-custom-element>...</my-custom-element>, you also may need to define css styles. + +In current version, this will automagically define directives found in the ui.directives module and +angular's ngView, ngInclude, ngPluralize directives. + +## Usage + +The shiv needs to run after angular has compiled the application. Best to load angular-ui-ieshiv.js at +bottom of <head> section. + + <!--[if lte IE 8]> <script src="build/angular-ui-ieshiv.js"></script><![endif]--> + +### Options + + There will be + +### Notes + - modules are searched for directives + - only IE 8 and earlier will cause shiv to run + - there will be a slight performance hit (for IE) + +### Todo + - provide ability to specify which directives to include/exclude + - automagically locate all custom directives in current ng-app (this will involve recursion) +
\ No newline at end of file diff --git a/js/vendor/angular-ui/common/ieshiv/ieshiv.js b/js/vendor/angular-ui/common/ieshiv/ieshiv.js new file mode 100644 index 000000000..c34b27d36 --- /dev/null +++ b/js/vendor/angular-ui/common/ieshiv/ieshiv.js @@ -0,0 +1,52 @@ +// READ: http://docs-next.angularjs.org/guide/ie +// element tags are statically defined in order to accommodate lazy-loading whereby directives are also unknown + +// The ieshiv takes care of our ui.directives and AngularJS's ng-view, ng-include, ng-pluralize, ng-switch. +// However, IF you have custom directives that can be used as html tags (yours or someone else's) then +// add list of directives into <code>window.myCustomTags</code> + +// <!--[if lte IE 8]> +// <script> +// window.myCustomTags = [ 'yourCustomDirective', 'somebodyElsesDirective' ]; // optional +// </script> +// <script src="build/angular-ui-ieshiv.js"></script> +// <![endif]--> + +(function (exports) { + + var debug = window.ieShivDebug || false, + tags = [ "ngInclude", "ngPluralize", "ngView", "ngSwitch", "uiCurrency", "uiCodemirror", "uiDate", "uiEvent", + "uiKeypress", "uiKeyup", "uiKeydown", "uiMask", "uiMapInfoWindow", "uiMapMarker", "uiMapPolyline", + "uiMapPolygon", "uiMapRectangle", "uiMapCircle", "uiMapGroundOverlay", "uiModal", "uiReset", + "uiScrollfix", "uiSelect2", "uiShow", "uiHide", "uiToggle", "uiSortable", "uiTinymce" + ]; + + window.myCustomTags = window.myCustomTags || []; // externally defined by developer using angular-ui directives + tags.push.apply(tags, window.myCustomTags); + + var toCustomElements = function (str) { + var result = []; + var dashed = str.replace(/([A-Z])/g, function ($1) { + return " " + $1.toLowerCase(); + }); + var tokens = dashed.split(' '); + var ns = tokens[0]; + var dirname = tokens.slice(1).join('-'); + + // this is finite list and it seemed senseless to create a custom method + result.push(ns + ":" + dirname); + result.push(ns + "-" + dirname); + result.push("x-" + ns + "-" + dirname); + result.push("data-" + ns + "-" + dirname); + return result; + }; + + for (var i = 0, tlen = tags.length; i < tlen; i++) { + var customElements = toCustomElements(tags[i]); + for (var j = 0, clen = customElements.length; j < clen; j++) { + var customElement = customElements[j]; + document.createElement(customElement); + } + } + +})(window);
\ No newline at end of file diff --git a/js/vendor/angular-ui/common/module.js b/js/vendor/angular-ui/common/module.js new file mode 100644 index 000000000..32782e77b --- /dev/null +++ b/js/vendor/angular-ui/common/module.js @@ -0,0 +1,5 @@ + +angular.module('ui.config', []).value('ui.config', {}); +angular.module('ui.filters', ['ui.config']); +angular.module('ui.directives', ['ui.config']); +angular.module('ui', ['ui.filters', 'ui.directives', 'ui.config']); diff --git a/js/vendor/angular-ui/common/stylesheets/angular-ui.less b/js/vendor/angular-ui/common/stylesheets/angular-ui.less new file mode 100644 index 000000000..c388a8eae --- /dev/null +++ b/js/vendor/angular-ui/common/stylesheets/angular-ui.less @@ -0,0 +1,7 @@ +/** + * import components to builds angular-ui.css + */ +@import "mixins.less"; +@import "modules/directives/reset/stylesheets/reset.less"; +@import "modules/directives/currency/stylesheets/currency.less"; +@import "modules/filters/highlight/highlight.less";
\ No newline at end of file diff --git a/js/vendor/angular-ui/common/stylesheets/mixins.less b/js/vendor/angular-ui/common/stylesheets/mixins.less new file mode 100644 index 000000000..46728ec7f --- /dev/null +++ b/js/vendor/angular-ui/common/stylesheets/mixins.less @@ -0,0 +1,11 @@ +.border-radius(@radius: 5px) { + -webkit-border-radius: @radius; + -moz-border-radius: @radius; + border-radius: @radius; +} + +.box-shadow(@shadow: 0 1px 3px rgba(0,0,0,.25)) { + -webkit-box-shadow: @shadow; + -moz-box-shadow: @shadow; + box-shadow: @shadow; +}
\ No newline at end of file |