├── README.md ├── code ├── 001-介绍依赖注入 │ └── index.html ├── 002-数据绑定 │ └── index.html ├── 003-控制器 │ ├── app │ │ └── index.js │ └── index.html ├── 004-ngBind │ ├── app │ │ └── index.js │ └── index.html ├── 005-多个控制器 │ ├── app │ │ └── index.js │ └── index.html ├── 006-$scope里$apply、$digest方法 │ ├── app │ │ └── index.js │ └── index.html ├── 007-$scope里的$watch方法 │ ├── app │ │ └── index.js │ └── index.html ├── 008~011-练习 购物车 │ ├── app │ │ └── index.js │ └── index.html ├── 012-模块和控制器 │ ├── app │ │ └── index.js │ └── index.html ├── 013-$provide里provider方法 │ ├── app │ │ └── index.js │ └── index.html ├── 014-$provide里factory、service方法 │ ├── app │ │ └── index.js │ └── index.html ├── 015-多个控制器内共享数据 │ ├── app │ │ └── index.js │ └── index.html ├── 016-过滤器 number、currency、date │ ├── app │ │ └── index.js │ └── index.html ├── 017-过滤器 limitTo、lowercase、uppercase 、filter 、orderBy、json │ ├── app │ │ └── index.js │ └── index.html ├── 018~019 - 练习 过滤器 产品列表 │ ├── app │ │ └── index.js │ └── index.html ├── 020-自定义过滤器、$controllerProvider使用 │ ├── app │ │ └── index.js │ └── index.html ├── 021-控制器的合理使用、显示和隐示的依赖注入 │ ├── app │ │ └── index.js │ └── index.html ├── 022~024-内置指令 │ ├── app │ │ └── index.js │ ├── index.html │ └── other.html ├── 025-自定义指令 restrict、template、replace属性 │ ├── app │ │ └── index.js │ └── index.html ├── 026-自定义指令 templateUrl属性 │ ├── app │ │ └── index.js │ ├── index.html │ └── tmp │ │ └── other.html ├── 027-自定义指令 transclude、priority、terminal属性 │ ├── app │ │ └── index.js │ └── index.html ├── 028-自定义指令 compile && link属性 │ ├── app │ │ └── index.js │ └── index.html ├── 029-自定义指令 controller && controllAs属性 │ ├── app │ │ └── index.js │ └── index.html ├── 030-自定义指令 require 属性 │ ├── app │ │ └── index.js │ └── index.html ├── 031-自定义指令 scope 属性 │ ├── app │ │ └── index.js │ └── index.html ├── 032-练习 自定义accordion指令 │ ├── app │ │ ├── index.js │ │ └── tmp │ │ │ └── kittencupCollapse.html │ └── index.html ├── 033-模块里的constant、value、run方法 │ ├── app │ │ └── index.js │ └── index.html └── 034-Form │ ├── app │ └── index.js │ └── index.html ├── index-template.html └── vendor ├── angular ├── angular-route.min.js └── angularjs.js └── bootstrap3 ├── css ├── bootstrap-theme.css ├── bootstrap-theme.min.css ├── bootstrap.css └── bootstrap.min.css ├── fonts ├── glyphicons-halflings-regular.eot ├── glyphicons-halflings-regular.svg ├── glyphicons-halflings-regular.ttf └── glyphicons-halflings-regular.woff └── js ├── bootstrap.js └── bootstrap.min.js /README.md: -------------------------------------------------------------------------------- 1 | kittencup-angularjs-code 2 | ======================== 3 | 教学代码,请结合angularjs视频学习 4 | 5 | 视频通过 免费观看 www.kittencup.com 6 | -------------------------------------------------------------------------------- /code/001-介绍依赖注入/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Angularjs-视频教程-001-简介 5 | 6 | 7 | 8 | 31 | 32 | -------------------------------------------------------------------------------- /code/002-数据绑定/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 15 | 16 | 17 | 18 | {{ name }} 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /code/003-控制器/app/index.js: -------------------------------------------------------------------------------- 1 | 2 | 3 | var firstController = function($scope){ 4 | 5 | // $scope 我们叫做作用域 6 | // 申明一个Model 7 | $scope.name = '张三'; 8 | 9 | $scope.age = 20; 10 | 11 | } -------------------------------------------------------------------------------- /code/003-控制器/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 |
10 | 11 | 12 | {{name}} 13 | {{age}} 14 |
15 |
16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /code/004-ngBind/app/index.js: -------------------------------------------------------------------------------- 1 | 2 | 3 | var firstController = function($scope){ 4 | 5 | // $scope 我们叫做作用域 6 | // 申明一个Model 7 | $scope.name = '张三'; 8 | 9 | $scope.age = 20; 10 | 11 | } -------------------------------------------------------------------------------- /code/004-ngBind/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 |
10 | 11 | 12 |
13 |
14 |
15 |
16 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /code/005-多个控制器/app/index.js: -------------------------------------------------------------------------------- 1 | 2 | 3 | var firstController = function($scope){ 4 | 5 | 6 | $scope.name = '张三'; 7 | console.log($scope); 8 | 9 | } 10 | 11 | var secondController = function($scope){ 12 | 13 | console.log($scope); 14 | } -------------------------------------------------------------------------------- /code/005-多个控制器/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 |
10 | 11 | 12 |
13 | 14 |
15 |
16 |
17 | 18 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /code/006-$scope里$apply、$digest方法/app/index.js: -------------------------------------------------------------------------------- 1 | 2 | 3 | var firstController = function($scope){ 4 | 5 | $scope.date = new Date(); 6 | 7 | // setInterval(function(){ 8 | // // 这里虽然变 但是并没有触发 脏检查 9 | // $scope.date = new Date(); 10 | // 11 | // },1000) 12 | 13 | setInterval(function(){ 14 | $scope.$apply(function(){ 15 | $scope.date = new Date(); 16 | //....会去触发脏检查 17 | }) 18 | },1000) 19 | 20 | 21 | // 触发一次脏检查 22 | } 23 | -------------------------------------------------------------------------------- /code/006-$scope里$apply、$digest方法/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 |
10 | {{date}} 11 |
12 |
13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /code/007-$scope里的$watch方法/app/index.js: -------------------------------------------------------------------------------- 1 | 2 | 3 | var firstController = function($scope){ 4 | 5 | $scope.name = '张三'; 6 | $scope.data = { 7 | name :'李四', 8 | count:20 9 | } 10 | $scope.count = 0; 11 | 12 | // 监听一个model 当一个model每次改变时 都会触发第2个函数 13 | $scope.$watch('name',function(newValue,oldValue){ 14 | 15 | ++$scope.count; 16 | 17 | if($scope.count > 30){ 18 | $scope.name = '已经大于30次了'; 19 | } 20 | }); 21 | 22 | 23 | $scope.$watch('data',function(){ 24 | 25 | },true) 26 | } -------------------------------------------------------------------------------- /code/007-$scope里的$watch方法/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 |
10 | 11 | 12 | 改变次数:{{count}}-{{name}} 13 |
14 |
15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /code/008~011-练习 购物车/app/index.js: -------------------------------------------------------------------------------- 1 | 2 | var cartController = function ($scope) { 3 | 4 | $scope.cart = [ 5 | { 6 | id: 1000, 7 | name: 'iphone5s', 8 | quantity: 3, 9 | price: 4300 10 | }, 11 | { 12 | id: 3300, 13 | name: 'iphone5', 14 | quantity: 30, 15 | price: 3300 16 | }, 17 | { 18 | id: 232, 19 | name: 'imac', 20 | quantity: 4, 21 | price: 23000 22 | }, 23 | { 24 | id: 1400, 25 | name: 'ipad', 26 | quantity: 5, 27 | price: 6900 28 | } 29 | ]; 30 | 31 | 32 | /** 33 | * 计算购物总价 34 | */ 35 | $scope.totalPrice = function () { 36 | var total = 0; 37 | angular.forEach($scope.cart, function (item) { 38 | total += item.quantity * item.price; 39 | }) 40 | return total; 41 | } 42 | 43 | /** 44 | * 计算总购买数 45 | */ 46 | $scope.totalQuantity = function () { 47 | var total = 0; 48 | angular.forEach($scope.cart, function (item) { 49 | total += parseInt(item.quantity); 50 | }) 51 | return total; 52 | } 53 | 54 | 55 | /** 56 | * 找一个元素的索引 57 | */ 58 | var findIndex = function (id) { 59 | var index = -1; 60 | 61 | angular.forEach($scope.cart, function (item, key) { 62 | if (item.id === id) { 63 | index = key; 64 | return; 65 | } 66 | }); 67 | 68 | return index; 69 | } 70 | 71 | 72 | /** 73 | * 为某个产品添加一个数量 74 | */ 75 | $scope.add = function (id) { 76 | var index = findIndex(id); 77 | 78 | if (index !== -1) { 79 | ++$scope.cart[index].quantity; 80 | } 81 | } 82 | 83 | 84 | /** 85 | * 为某个产品减少一个数量 86 | */ 87 | $scope.reduce = function (id) { 88 | var index = findIndex(id); 89 | 90 | if (index !== -1) { 91 | var item = $scope.cart[index]; 92 | if(item.quantity > 1){ 93 | --item.quantity; 94 | }else{ 95 | var returnKey = confirm('是否从购物车内删除该产品!'); 96 | if(returnKey){ 97 | $scope.remove(id); 98 | } 99 | } 100 | 101 | } 102 | } 103 | 104 | /** 105 | * 移除一项 106 | */ 107 | $scope.remove = function (id) { 108 | 109 | 110 | var index = findIndex(id); 111 | // 如果找到了那个item 112 | if (index !== -1) { 113 | $scope.cart.splice(index, 1); 114 | } 115 | 116 | // 自动做脏检查 117 | } 118 | 119 | // 监听数量 如果小于 1 则让用户判断是否要删除产品 120 | $scope.$watch('cart',function(newValue,oldValue){ 121 | 122 | angular.forEach(newValue,function(item,key){ 123 | if(item.quantity < 1){ 124 | var returnKey = confirm('是否从购物车内删除该产品!'); 125 | if(returnKey){ 126 | $scope.remove(item.id); 127 | }else{ 128 | item.quantity = oldValue[key].quantity; 129 | } 130 | } 131 | }) 132 | },true); 133 | 134 | 135 | 136 | } -------------------------------------------------------------------------------- /code/008~011-练习 购物车/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 35 | 36 | 37 | 40 | 43 | 46 | 49 | 52 | 53 | 54 |
产品编号产品名字购买数量产品单价产品总价操作
{{item.id}}{{item.name}} 26 | 27 | 28 | 29 | {{item.price}}{{item.price * item.quantity}} 33 | 34 |
38 | 总购买价 39 | 41 | {{totalPrice()}} 42 | 44 | 总购买数量 45 | 47 | {{totalQuantity()}} 48 | 50 | 51 |
55 | 56 |

您的购物车为空

57 |
58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /code/012-模块和控制器/app/index.js: -------------------------------------------------------------------------------- 1 | 2 | 3 | var myApp = angular.module('myApp',[]); 4 | 5 | 6 | myApp.controller('firstController',function($scope){ 7 | $scope.name = '张三'; 8 | }); 9 | 10 | 11 | -------------------------------------------------------------------------------- /code/012-模块和控制器/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 |
10 | {{name}} 11 |
12 | 13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /code/013-$provide里provider方法/app/index.js: -------------------------------------------------------------------------------- 1 | 2 | 3 | var myApp = angular.module('myApp',[],function($provide){ 4 | 5 | 6 | // 自定义服务 7 | $provide.provider('CustomService',function(){ 8 | 9 | this.$get = function(){ 10 | return { 11 | message : 'CustomService Message' 12 | } 13 | } 14 | }); 15 | 16 | $provide.provider('CustomService2',function(){ 17 | 18 | this.$get = function(){ 19 | return { 20 | message : 'CustomService2 Message' 21 | } 22 | } 23 | }); 24 | }); 25 | 26 | myApp.controller('firstController',function(CustomService,$scope,CustomService2){ 27 | $scope.name = '张三'; 28 | 29 | console.log(CustomService2); 30 | }); 31 | 32 | 33 | -------------------------------------------------------------------------------- /code/013-$provide里provider方法/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 |
10 | {{name}} 11 |
12 | 13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /code/014-$provide里factory、service方法/app/index.js: -------------------------------------------------------------------------------- 1 | 2 | 3 | var myApp = angular.module('myApp',[],function($provide){ 4 | 5 | // 自定义服务 6 | $provide.provider('CustomService',function(){ 7 | 8 | this.$get = function(){ 9 | return { 10 | message : 'CustomService Message' 11 | } 12 | } 13 | }); 14 | 15 | // 自定义工厂 16 | $provide.factory('CustomFactory',function(){ 17 | return [1,2,3,4,5,6,7]; 18 | }); 19 | 20 | // 自定义服务 21 | $provide.service('CustomService2',function(){ 22 | return 'aaa'; 23 | }) 24 | 25 | }); 26 | 27 | myApp.controller('firstController',function($scope,CustomFactory,CustomService2){ 28 | $scope.name = '张三'; 29 | 30 | console.log(CustomFactory); 31 | 32 | console.log(CustomService2); 33 | 34 | }); 35 | 36 | //myApp.service(); 37 | //myApp.factory(); 38 | -------------------------------------------------------------------------------- /code/014-$provide里factory、service方法/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 |
10 | {{name}} 11 |
12 | 13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /code/015-多个控制器内共享数据/app/index.js: -------------------------------------------------------------------------------- 1 | angular.module('myApp',[]) 2 | 3 | .factory('Data',function(){ 4 | // this.$get = function(){} 5 | return { 6 | message : '共享的数据' 7 | }; 8 | }) 9 | 10 | .controller('firstController',function($scope,Data){ 11 | $scope.data = { 12 | name : '张三' 13 | }; 14 | 15 | $scope.Data = Data; 16 | }) 17 | 18 | .controller('secondController',function($scope,Data){ 19 | $scope.data = $scope.$$prevSibling.data; 20 | 21 | $scope.Data = Data; 22 | }); -------------------------------------------------------------------------------- /code/015-多个控制器内共享数据/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 |
11 | first.data 12 | first.Data 13 |

14 | first-name:{{data.name}} 15 |

16 |

17 | first-message:{{Data.message}} 18 |

19 |
20 | 21 |
22 |

23 | second-name:{{data.name}} 24 |

25 |

26 | second-message:{{Data.message}} 27 |

28 |
29 |
30 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /code/016-过滤器 number、currency、date/app/index.js: -------------------------------------------------------------------------------- 1 | angular.module('myApp',[]) 2 | 3 | .factory('Data',function(){ 4 | 5 | return { 6 | message : '共享的数据' 7 | }; 8 | }) 9 | 10 | .controller('firstController',function($scope,Data,$filter){ 11 | $scope.data = Data; 12 | 13 | $scope.today = new Date; 14 | 15 | }) 16 | 17 | -------------------------------------------------------------------------------- /code/016-过滤器 number、currency、date/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 |
11 | 12 | 13 |

{{123456789 | number}}

14 | 15 |

{{12345.6789 | number:3}}

16 | 17 | 18 |

{{999999 | currency}}

19 | 20 |

{{999999 | currency:'rmb'}}

21 | 22 |

23 | default:{{ today }} 24 |

25 | 26 |

27 | medium: {{ today | date:'medium'}} 28 |

29 | 30 |

31 | short:{{ today | date:'short'}} 32 |

33 | 34 |

35 | fullDate:{{ today | date:'fullDate'}} 36 |

37 | 38 |

39 | longDate:{{ today | date:'longDate'}} 40 |

41 | 42 |

43 | mediumDate:{{ today | date:'mediumDate'}} 44 |

45 | 46 |

47 | 48 | shortDate:{{ today | date:'shortDate'}} 49 |

50 | 51 |

52 | mediumTime:{{ today | date:'mediumTime'}} 53 |

54 | 55 |

56 | shortTime:{{ today | date:'shortTime'}} 57 |

58 | 59 |

60 | year: 61 | {{today | date : 'y'}} 62 | {{today | date : 'yy'}} 63 | {{today | date : 'yyyy'}} 64 |

65 |

66 | month: 67 | {{today | date : 'M'}} 68 | {{today | date : 'MM'}} 69 | {{today | date : 'MMM'}} 70 | {{today | date : 'MMMM'}} 71 |

72 |

73 | day: 74 | {{today | date : 'd'}} 75 | Day in month {{today | date : 'dd'}} 76 | Day in week {{today | date : 'EEEE'}} 77 | {{today | date : 'EEE'}} 78 |

79 | 80 |

81 | hour: 82 | {{today | date : 'HH'}} 83 | {{today | date : 'H'}} 84 | {{today | date : 'hh'}} 85 | {{today | date : 'h'}} 86 |

87 | 88 |

89 | minute: 90 | {{today | date : 'mm'}} 91 | {{today | date : 'm'}} 92 |

93 | 94 |

95 | second: 96 | {{today | date : 'ss'}} 97 | {{today | date : 's'}} 98 | {{today | date : '.sss'}} 99 |

100 | 101 |

102 | {{today | date : 'y-MM-d H:m:s'}} 103 |

104 | 105 | 106 |
107 | 108 | 109 | 110 | 111 | 112 | 113 | -------------------------------------------------------------------------------- /code/017-过滤器 limitTo、lowercase、uppercase 、filter 、orderBy、json/app/index.js: -------------------------------------------------------------------------------- 1 | angular.module('myApp',[]) 2 | 3 | .factory('Data',function(){ 4 | 5 | return { 6 | message : 'Hello World', 7 | city : [ 8 | { 9 | name:'上海11212', 10 | py : 'shanghai' 11 | }, 12 | { 13 | name:'北京', 14 | py : 'beijing' 15 | }, 16 | { 17 | name:'四川', 18 | py : 'sichuan' 19 | } 20 | ] 21 | }; 22 | }) 23 | 24 | .controller('firstController',function($scope,Data,$filter){ 25 | $scope.data = Data; 26 | 27 | $scope.today = new Date; 28 | 29 | 30 | // 过滤器 31 | var number = $filter('number')(3000); 32 | 33 | var jsonString = $filter('json')($scope.data); 34 | 35 | console.log(jsonString); 36 | console.log($scope.data); 37 | 38 | $scope.checkName = function(obj){ 39 | if(obj.py.indexOf('h') === -1) 40 | return false; 41 | return true; 42 | } 43 | 44 | }) 45 | 46 | -------------------------------------------------------------------------------- /code/017-过滤器 limitTo、lowercase、uppercase 、filter 、orderBy、json/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 |
11 | 12 | 13 |

{{[1,2,3,4,5,6,7] | limitTo:5}}

14 | 15 | 16 |

{{[1,2,3,4,5,6,7] | limitTo:-5}}

17 | 18 | 19 |

{{data.message | lowercase}}

20 | 21 |

{{data.message | uppercase}}

22 | 23 |

24 | 25 | {{ data.city | filter : '上海'}} 26 |

27 |

28 | 29 | {{ data.city | filter : 'name'}} 30 |

31 | 32 |

33 | 34 | {{ data.city | filter : {py:'g'} }} 35 |

36 | 37 |

38 | 39 | {{ data.city | filter : checkName }} 40 |

41 | 42 |

43 | 44 | 45 | {{ data.city | orderBy : 'py'}} 46 | 47 | 48 | 49 | {{ data.city | orderBy : '-py'}} 50 |

51 | 52 | 53 | 54 | 55 | 56 |
57 | 58 | 59 | 60 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /code/018~019 - 练习 过滤器 产品列表/app/index.js: -------------------------------------------------------------------------------- 1 | angular.module('product', []) 2 | 3 | .service('productData', function () { 4 | return [ 5 | { 6 | id:3333, 7 | name:'iphone', 8 | price : 5400 9 | }, 10 | { 11 | id:885, 12 | name:'ipad', 13 | price : 3420 14 | }, 15 | { 16 | id:980, 17 | name:'imac', 18 | price : 15400 19 | }, 20 | { 21 | id:1212, 22 | name:'ipad air', 23 | price : 2340 24 | }, 25 | { 26 | id:3424, 27 | name:'ipad mini', 28 | price : 2200 29 | } 30 | ]; 31 | }) 32 | 33 | .controller('productController', function ($scope,productData) { 34 | $scope.productData = productData; 35 | 36 | $scope.orderType = 'id'; 37 | 38 | $scope.order = '-'; 39 | 40 | $scope.changeOrder = function(type){ 41 | 42 | $scope.orderType = type; 43 | 44 | if($scope.order === ''){ 45 | $scope.order = '-'; 46 | }else{ 47 | $scope.order = ''; 48 | } 49 | } 50 | }); -------------------------------------------------------------------------------- /code/018~019 - 练习 过滤器 产品列表/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 11 | 12 | 13 |
14 | 15 |
16 | 26 | 27 | 28 | 29 | 33 | 37 | 41 | 42 | 43 | 44 | 45 | 46 | 49 | 52 | 55 | 56 | 57 |
30 | 产品编号 31 | 32 | 34 | 产品名称 35 | 36 | 38 | 产品价钱 39 | 40 |
47 | {{product.id}} 48 | 50 | {{product.name}} 51 | 53 | {{product.price | currency : '(RMB)'}} 54 |
58 |
59 | 60 | 61 |
62 | 63 | 64 | 65 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /code/020-自定义过滤器、$controllerProvider使用/app/index.js: -------------------------------------------------------------------------------- 1 | var myApp = angular.module('myApp', [], function ($filterProvider, $provide, $controllerProvider) { 2 | 3 | $provide.service('Data', function () { 4 | return [ 5 | { 6 | name: '张三', 7 | age: '20', 8 | city: '上海' 9 | }, 10 | { 11 | name: '李四', 12 | age: '30', 13 | city: '北京' 14 | } 15 | ]; 16 | 17 | }); 18 | 19 | $filterProvider.register('filterAge', function () { 20 | return function (obj) { 21 | var newObj = []; 22 | 23 | angular.forEach(obj, function (o) { 24 | if (o.age > 20) { 25 | newObj.push(o); 26 | } 27 | }); 28 | 29 | return newObj; 30 | 31 | } 32 | }); 33 | 34 | 35 | $controllerProvider.register('firstController', function ($scope, Data) { 36 | $scope.data = Data; 37 | }) 38 | 39 | 40 | 41 | }) 42 | 43 | // module.filter 44 | .filter('filterCity',function(){ 45 | return function(obj){ 46 | var newObj = []; 47 | 48 | angular.forEach(obj, function (o) { 49 | if (o.city === '上海') { 50 | newObj.push(o); 51 | } 52 | }); 53 | 54 | return newObj; 55 | } 56 | }) 57 | -------------------------------------------------------------------------------- /code/020-自定义过滤器、$controllerProvider使用/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 |
10 |
    11 |
  • 12 | {{user.name}} 13 | {{user.age}} 14 | {{user.city}} 15 |
  • 16 |
17 |
18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /code/021-控制器的合理使用、显示和隐示的依赖注入/app/index.js: -------------------------------------------------------------------------------- 1 | var myApp = angular.module('myApp', [], ['$filterProvider', '$provide', '$controllerProvider', function (a, b, c) { 2 | console.log(a, b, c); 3 | }]) 4 | 5 | . 6 | factory('CustomService', ['$window', function (a) { 7 | console.log(a); 8 | }]) 9 | 10 | // 隐示的依赖注入 11 | .controller('firstController', function ($scope, CustomService) { 12 | console.log(CustomService); 13 | }) 14 | 15 | // 显示的依赖注入 16 | .controller('secondController', ['$scope', '$filter', function (a, b) { 17 | console.log(b('json')([1, 2, 3, 4, 5])); 18 | }]); 19 | 20 | function otherController(a) { 21 | console.log(a); 22 | } 23 | 24 | otherController.$inject = ['$scope']; -------------------------------------------------------------------------------- /code/021-控制器的合理使用、显示和隐示的依赖注入/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 |
10 | 11 |
12 | 13 |
14 | 15 |
16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /code/022~024-内置指令/app/index.js: -------------------------------------------------------------------------------- 1 | var myApp = angular.module('myApp', []) 2 | 3 | .controller('firstController', function ($scope) { 4 | $scope.status = false; 5 | 6 | $scope.changeStatus = function (event) { 7 | // 通过element转换成 jquery对象 8 | angular.element(event.target).html('切换状态为:' + $scope.status); 9 | 10 | $scope.status = !$scope.status; 11 | 12 | } 13 | 14 | $scope.defaultStyle = { 15 | color: 'red', 16 | 'margin-top': '50px' 17 | }; 18 | 19 | $scope.src = 'http://www.angularjs.org/img/AngularJS-large.png'; 20 | }) -------------------------------------------------------------------------------- /code/022~024-内置指令/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 10 | 11 | 12 |
13 | 14 |
15 |

{{1+1}}

16 |

2

17 |

18 | 19 | 20 |
    21 |
  • 22 | 23 | index:{{$index}} 24 | 25 | 26 | first:{{$first}} 27 | 28 | 29 | middle:{{$middle}} 30 | 31 | 32 | last :{{$last}} 33 | 34 | 35 | {{city}} 36 | 37 |
  • 38 |
39 | 40 | 41 | 42 |
43 | 44 |
45 | 46 |
47 | 48 |
49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 |
68 |
69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | -------------------------------------------------------------------------------- /code/022~024-内置指令/other.html: -------------------------------------------------------------------------------- 1 | other html template -------------------------------------------------------------------------------- /code/025-自定义指令 restrict、template、replace属性/app/index.js: -------------------------------------------------------------------------------- 1 | var myApp = angular.module('myApp', [], ['$compileProvider',function ($compileProvider) { 2 | 3 | $compileProvider.directive('customTags',function(){ 4 | return { 5 | restrict:'ECAM', 6 | template:'
custom-tags-html
', 7 | replace:true 8 | } 9 | }); 10 | 11 | }]) 12 | 13 | //.directive('') -------------------------------------------------------------------------------- /code/025-自定义指令 restrict、template、replace属性/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 1212 11 | 12 |
13 | 14 |
15 | 16 |
17 | 18 |
19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /code/026-自定义指令 templateUrl属性/app/index.js: -------------------------------------------------------------------------------- 1 | var myApp = angular.module('myApp', []) 2 | 3 | .directive('customTags', function () { 4 | return { 5 | restrict: 'ECAM', 6 | templateUrl: 'tmp/other.html', 7 | replace: true 8 | } 9 | }) 10 | 11 | .directive('customTags2', function () { 12 | return { 13 | restrict: 'ECAM', 14 | templateUrl: 'customTags2', 15 | replace: true 16 | } 17 | }) 18 | 19 | .controller('firstController', ['$scope', function ($scope) { 20 | $scope.name = '张三'; 21 | }]); -------------------------------------------------------------------------------- /code/026-自定义指令 templateUrl属性/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 15 | 16 |
17 | 18 | 19 |
20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /code/026-自定义指令 templateUrl属性/tmp/other.html: -------------------------------------------------------------------------------- 1 |
2 | {{name}} 3 |
-------------------------------------------------------------------------------- /code/027-自定义指令 transclude、priority、terminal属性/app/index.js: -------------------------------------------------------------------------------- 1 | var myApp = angular.module('myApp', []) 2 | 3 | .directive('customTags', function () { 4 | return { 5 | restrict: 'ECAM', 6 | template:'
新数据
', 7 | replace: true, 8 | transclude:true 9 | } 10 | }) 11 | 12 | .directive('customTags2', function () { 13 | return { 14 | restrict: 'ECAM', 15 | template:'
2
', 16 | replace: true, 17 | priority:-1 18 | } 19 | }) 20 | 21 | .directive('customTags3', function () { 22 | return { 23 | restrict: 'ECAM', 24 | template:'
3
', 25 | replace: true, 26 | priority: 0, 27 | // 小于0的directive 都不会执行 28 | terminal:true 29 | } 30 | }) 31 | 32 | .controller('firstController', ['$scope', function ($scope) { 33 | $scope.name = '张三'; 34 | }]); -------------------------------------------------------------------------------- /code/027-自定义指令 transclude、priority、terminal属性/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 |
11 | 原始数据 12 | 13 |
14 | 15 |
16 |
17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /code/028-自定义指令 compile && link属性/app/index.js: -------------------------------------------------------------------------------- 1 | var i = 0; 2 | 3 | var myApp = angular.module('myApp', []) 4 | 5 | .directive('customTags',function(){ 6 | return { 7 | restrict : 'ECAM', 8 | template : '
{{user.name}}
', 9 | replace : true, 10 | compile:function(tElement,tAttrs,transclude){ 11 | 12 | tElement.append(angular.element('
{{user.name}}{{user.count}}
')); 13 | 14 | // 编译阶段... 15 | console.log('customTags compile 编译阶段...'); 16 | 17 | return { 18 | // 表示在编译阶段之后,指令连接到子元素之前运行 19 | pre:function preLink(scope,iElement,iAttrs,controller){ 20 | console.log('customTags preLink..') 21 | }, 22 | // 表示在所有子元素指令都连接之后才运行 23 | post:function postLink(scope,iElement,iAttrs,controller){ 24 | 25 | iElement.on('click',function(){ 26 | scope.$apply(function(){ 27 | scope.user.name = 'click after'; 28 | scope.user.count = ++i; 29 | // 进行一次 脏检查 30 | }); 31 | }) 32 | 33 | console.log('customTags all child directive link..') 34 | } 35 | } 36 | // 可以直接返回 postLink 37 | // return postLink function(){ 38 | // console.log('compile return fun'); 39 | //} 40 | }, 41 | // 此link表示的就是 postLink 42 | link:function(){ 43 | // iElement.on('click',function(){ 44 | // scope.$apply(function(){ 45 | // scope.user.name = 'click after'; 46 | // scope.user.count = ++i; 47 | // // 进行一次 脏检查 48 | // }); 49 | // }) 50 | } 51 | } 52 | }) 53 | 54 | .directive('customTags2',function(){ 55 | return { 56 | restrict : 'ECAM', 57 | replace : true, 58 | compile:function(){ 59 | // 编译阶段... 60 | console.log('customTags2 compile 编译阶段...'); 61 | 62 | return { 63 | // 表示在编译阶段之后,指令连接到子元素之前运行 64 | pre:function preLink(){ 65 | console.log('customTags2 preLink..') 66 | }, 67 | // 表示在所有子元素指令都连接之后才运行 68 | post:function postLink(){ 69 | console.log('customTags2 all child directive link..') 70 | } 71 | } 72 | 73 | } 74 | } 75 | }) 76 | 77 | 78 | .directive('customTags3',function(){ 79 | 80 | // return postLink; 81 | return function(){ 82 | 83 | } 84 | }) 85 | 86 | .controller('firstController', ['$scope', function ($scope) { 87 | $scope.users = [ 88 | { 89 | id:10, 90 | name:'张三' 91 | }, 92 | { 93 | id:20, 94 | name:'李四' 95 | } 96 | ]; 97 | }]); -------------------------------------------------------------------------------- /code/028-自定义指令 compile && link属性/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 |
11 | 16 |
17 | 18 |
19 | 20 |
21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /code/029-自定义指令 controller && controllAs属性/app/index.js: -------------------------------------------------------------------------------- 1 | angular.module('myApp', []) 2 | 3 | .directive('bookList', function () { 4 | return { 5 | restrict: 'ECAM', 6 | controller: function ($scope) { 7 | $scope.books = [ 8 | { 9 | name: 'php' 10 | }, 11 | { 12 | name: 'javascript' 13 | }, 14 | { 15 | name: 'java' 16 | } 17 | ]; 18 | $scope.addBook = function(){ 19 | 20 | } 21 | this.addBook = function(){ 22 | // ... 23 | } 24 | }, 25 | controllerAs:'bookListController', 26 | template: '', 27 | replace:true, 28 | link:function(scope,iEelement,iAttrs,bookListController){ 29 | iEelement.on('click',bookListController.addBook) 30 | } 31 | } 32 | 33 | }) 34 | 35 | .controller('firstController', ['$scope', function ($scope) { 36 | // console.log($scope); 37 | 38 | 39 | }]); -------------------------------------------------------------------------------- /code/029-自定义指令 controller && controllAs属性/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 |
11 | 12 |
13 | 14 |
15 | 16 |
17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /code/030-自定义指令 require 属性/app/index.js: -------------------------------------------------------------------------------- 1 | angular.module('myApp', []) 2 | 3 | .directive('bookList', function () { 4 | return { 5 | restrict: 'ECAM', 6 | controller: function ($scope) { 7 | $scope.books = [ 8 | { 9 | name: 'php' 10 | }, 11 | { 12 | name: 'javascript' 13 | }, 14 | { 15 | name: 'java' 16 | } 17 | ]; 18 | 19 | this.addBook = function(){ 20 | 21 | $scope.$apply(function(){ 22 | $scope.books.push({ 23 | name:'Angularjs' 24 | }) 25 | }); 26 | } 27 | }, 28 | controllerAs:'bookListController', 29 | template: '
  • {{book.name}}
', 30 | replace:true 31 | 32 | } 33 | 34 | }) 35 | 36 | .directive('bookAdd',function(){ 37 | return { 38 | restrict:'ECAM', 39 | require:'^bookList', 40 | template:'', 41 | replace:true, 42 | link:function(scope,iElement,iAttrs,bookListController){ 43 | iElement.on('click',bookListController.addBook); 44 | } 45 | } 46 | }) 47 | 48 | .controller('firstController', ['$scope', function ($scope) { 49 | // console.log($scope); 50 | 51 | 52 | }]); -------------------------------------------------------------------------------- /code/030-自定义指令 require 属性/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 |
11 | 12 |
13 | 14 |
15 | 16 |
17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /code/031-自定义指令 scope 属性/app/index.js: -------------------------------------------------------------------------------- 1 | angular.module('myApp', []) 2 | 3 | .directive('bookList', function () { 4 | return { 5 | restrict: 'ECAM', 6 | controller: function ($scope) { 7 | 8 | // &books 9 | // $scope.books = $scope.a(); 10 | 11 | // =books; 12 | // $scope.books = $scope.b; 13 | // $scope.b.push({name:'nodejs'}); 14 | 15 | console.log($scope.c); 16 | 17 | }, 18 | // 创建一个有继承链的独立作用域 19 | // scope:true, 20 | 21 | // 当为对象的时候也会创建一个独立的作用域 22 | scope:{ 23 | // 将父元素books封装成一个a函数 24 | // a:'&books' 25 | // 双向绑定 b = parentBooks属性对应的父作用域的表达式 26 | // b:'=parentBooks' 27 | 28 | // 使用简单数据类型的方法 29 | c:'@parentTitle' 30 | }, 31 | controllerAs:'bookListController', 32 | template: '
  • {{book.name}}
', 33 | replace:true 34 | 35 | } 36 | 37 | }) 38 | 39 | 40 | .controller('firstController', ['$scope', function ($scope) { 41 | console.log($scope); 42 | 43 | $scope.books = [ 44 | { 45 | name: 'php' 46 | }, 47 | { 48 | name: 'javascript' 49 | }, 50 | { 51 | name: 'java' 52 | } 53 | ]; 54 | 55 | $scope.title = '张三'; 56 | 57 | }]); -------------------------------------------------------------------------------- /code/031-自定义指令 scope 属性/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 |
11 | {{ 12 | books 13 | }} 14 |
15 | 16 |
17 | 18 |
19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /code/032-练习 自定义accordion指令/app/index.js: -------------------------------------------------------------------------------- 1 | angular.module('myApp', []) 2 | // 数据 3 | .factory('Data', function () { 4 | return [ 5 | { 6 | title: 'no1', 7 | content: 'no1-content' 8 | }, 9 | { 10 | title: 'no2', 11 | content: 'no2-content' 12 | }, 13 | { 14 | title: 'no3', 15 | content: 'no3-content' 16 | } 17 | ]; 18 | }) 19 | // 控制器 20 | .controller('firstController', ['$scope','Data',function ($scope,Data) { 21 | $scope.data = Data; 22 | }]) 23 | 24 | .directive('kittencupGroup',function(){ 25 | return { 26 | restrict:'E', 27 | replace:true, 28 | template:'
', 29 | transclude:true, 30 | controllerAs:'kittencupGroupContrller', 31 | controller:function(){ 32 | this.groups = []; 33 | 34 | this.closeOtherCollapse = function(nowScope){ 35 | angular.forEach(this.groups,function(scope){ 36 | if(scope !== nowScope){ 37 | scope.isOpen = false; 38 | } 39 | }) 40 | } 41 | } 42 | } 43 | }) 44 | 45 | .directive('kittencupCollapse',function(){ 46 | return { 47 | restrict:'E', 48 | replace:true, 49 | require:'^kittencupGroup', 50 | templateUrl:'app/tmp/kittencupCollapse.html', 51 | scope:{ 52 | heading:'@' 53 | }, 54 | link:function(scope,element,attrs,kittencupGroupContrller){ 55 | scope.isOpen = false; 56 | 57 | scope.changeOpen = function(){ 58 | scope.isOpen = !scope.isOpen; 59 | 60 | kittencupGroupContrller.closeOtherCollapse(scope); 61 | } 62 | 63 | 64 | kittencupGroupContrller.groups.push(scope); 65 | }, 66 | transclude:true 67 | } 68 | }) -------------------------------------------------------------------------------- /code/032-练习 自定义accordion指令/app/tmp/kittencupCollapse.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |

4 | 5 | {{heading}} 6 | 7 |

8 |
9 |
10 |
11 |
12 |
13 |
-------------------------------------------------------------------------------- /code/032-练习 自定义accordion指令/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 |
11 |
12 | 13 | 14 | 15 | 16 | {{collapse.content}} 17 | 18 | 19 | 20 | 21 |
22 |
23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /code/033-模块里的constant、value、run方法/app/index.js: -------------------------------------------------------------------------------- 1 | angular.module('myApp',[],['$provide',function($provide){ 2 | console.log('config'); 3 | // $provide.factory 4 | // $provide.service 5 | 6 | // $provide.constant 7 | // $provide.value; 8 | 9 | }]) 10 | 11 | .config(function(APIKEY){ 12 | console.log(APIKEY); 13 | console.log('config'); 14 | }) 15 | 16 | // 在config之后controller等其他服务之前。。 17 | .run(function(){ 18 | console.log('run'); 19 | }) 20 | // 它只是可以注入任何方法 21 | .constant('APIKEY','xxxx') 22 | 23 | // 只能注入controller...service factory 24 | .value('vension','1.0.0') 25 | 26 | .controller('firstController',['APIKEY','vension',function(APIKEY,vension){ 27 | console.log(APIKEY); 28 | console.log(vension); 29 | console.log('controller'); 30 | 31 | 32 | }]); 33 | -------------------------------------------------------------------------------- /code/033-模块里的constant、value、run方法/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 |
11 | 12 |
13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /code/034-Form/app/index.js: -------------------------------------------------------------------------------- 1 | angular.module('myApp', []) 2 | 3 | .filter('cityFilter', function () { 4 | return function (data, parent) { 5 | var filterData = []; 6 | angular.forEach(data, function (obj) { 7 | if (obj.parent === parent) { 8 | filterData.push(obj); 9 | } 10 | }) 11 | 12 | return filterData; 13 | } 14 | }) 15 | 16 | .directive('even',function(){ 17 | return { 18 | require : 'ngModel', 19 | link:function(scope,elm,attrs,ngModelController){ 20 | ngModelController.$parsers.push(function(viewValue){ 21 | if(viewValue % 2 === 0){ 22 | ngModelController.$setValidity('even',true); 23 | }else{ 24 | ngModelController.$setValidity('even',false); 25 | } 26 | return viewValue; 27 | }); 28 | 29 | // ngModelController.$formatters.push(function(modelValue){ 30 | // return modelValue + 'kittencup'; 31 | // }) 32 | } 33 | }; 34 | }) 35 | 36 | .directive('customTextArea',function(){ 37 | return { 38 | restrict:'E', 39 | template:'
', 40 | replace:true, 41 | require : 'ngModel', 42 | link:function(scope,elm,attrs,ngModelController){ 43 | 44 | 45 | // view->model 46 | elm.on('keyup',function(){ 47 | scope.$apply(function(){ 48 | ngModelController.$setViewValue(elm.html()); 49 | }); 50 | }) 51 | 52 | ngModelController.$render = function(){ 53 | elm.html(ngModelController.$viewValue); 54 | } 55 | 56 | } 57 | }; 58 | }) 59 | 60 | 61 | .controller('firstController', ['$scope', function ($scope) { 62 | 63 | var that = this; 64 | 65 | $scope.hobbies = [ 66 | { 67 | id: 1, 68 | name: '玩游戏' 69 | }, 70 | { 71 | id: 2, 72 | name: '写代码' 73 | }, 74 | { 75 | id: 3, 76 | name: '睡觉' 77 | }, 78 | ]; 79 | 80 | $scope.cities = [ 81 | { 82 | name: '上海', 83 | parent: 0, 84 | id: 1 85 | }, 86 | { 87 | name: '上海市', 88 | parent: 1, 89 | id: 2 90 | }, 91 | { 92 | name: '徐汇区', 93 | parent: 2, 94 | id: 8 95 | }, 96 | { 97 | name: '长宁区', 98 | parent: 2, 99 | id: 3 100 | }, 101 | { 102 | name: '北京', 103 | parent: 0, 104 | id: 4 105 | }, 106 | { 107 | name: '北京市', 108 | parent: 4, 109 | id: 5 110 | }, 111 | { 112 | name: '东城区', 113 | parent: 5, 114 | id: 6 115 | }, 116 | { 117 | name: '丰台区', 118 | parent: 5, 119 | id: 7 120 | }, 121 | { 122 | name: '浙江', 123 | parent: 0, 124 | id: 9 125 | }, 126 | { 127 | name: '杭州', 128 | parent: 9, 129 | id: 100 130 | }, 131 | { 132 | name: '宁波', 133 | parent: 9, 134 | id: 11 135 | }, 136 | { 137 | name: '西湖区', 138 | parent: 100, 139 | id: 12 140 | }, 141 | { 142 | name: '北仑区‎', 143 | parent: 11, 144 | id: 13 145 | } 146 | ]; 147 | 148 | 149 | $scope.data = { 150 | hobbies: [1, 2], 151 | city: 3 152 | }; 153 | 154 | 155 | // 先保留一份默认值 156 | $scope.origData = angular.copy($scope.data); 157 | 158 | $scope.reset = function(){ 159 | 160 | $scope.data = angular.copy($scope.origData); 161 | that.initCity(); 162 | $scope.myForm.$setPristine(); 163 | } 164 | 165 | // 让城市关联使用 166 | this.findCityId = function (parent) { 167 | var parentId; 168 | angular.forEach($scope.cities, function (city) { 169 | if (city.id === parent) { 170 | parentId = city.parent; 171 | return; 172 | } 173 | }) 174 | 175 | return parentId; 176 | } 177 | 178 | this.initCity = function(){ 179 | if ($scope.data.city !== undefined) { 180 | $scope.data.area = this.findCityId($scope.data.city); 181 | $scope.data.province = this.findCityId($scope.data.area); 182 | } 183 | } 184 | 185 | // 第一次打开页面 需要初始化一下 186 | this.initCity.call(this); 187 | 188 | $scope.toggleHobbySelection = function (id) { 189 | 190 | var index = -1; 191 | if ($scope.data.hobbies === undefined) { 192 | $scope.data.hobbies = []; 193 | } else { 194 | index = $scope.data.hobbies.indexOf(id); 195 | } 196 | 197 | if (index === -1) { 198 | $scope.data.hobbies.push(id); 199 | } else { 200 | $scope.data.hobbies.splice(index, 1); 201 | } 202 | 203 | } 204 | }]); 205 | -------------------------------------------------------------------------------- /code/034-Form/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 |
11 |
12 | 13 |
14 | 15 |
16 | 用户名长度不能超过10位 17 |
18 |
19 | 用户名长度不能小于5位 20 |
21 |
22 | 用户名必须已英文字母开始 23 |
24 |
25 |
26 | 27 |
28 | 29 |
30 | 31 |
32 | 密码长度不能超过10位 33 |
34 |
35 | 密码长度不能小于5位 36 |
37 |
38 |
39 | 40 |
41 | 42 |
43 | 44 |
45 | 密码和确认密码不一致 46 |
47 |
48 |
49 | 50 |
51 | 52 |
53 | 54 |
55 | 邮箱长度不能超过30位 56 |
57 |
58 | 邮箱长度不能小于5位 59 |
60 |
61 | 邮箱格式不正确 62 |
63 |
64 |
65 | 66 |
67 | 68 |
69 | 70 |
71 | 网址长度不能超过30位 72 |
73 |
74 | 网址长度不能小于5位 75 |
76 |
77 | 网址格式不正确 78 |
79 |
80 |
81 | 82 |
83 | 84 |
85 | 86 |
87 | 年龄不能超过99岁 88 |
89 |
90 | 年龄不能小于10岁 91 |
92 |
93 |
94 | 95 |
96 | 97 |
98 | 101 | 104 |
105 |
106 | 107 |
108 | 109 |
110 | 113 |
114 |
115 | 116 |
117 | 118 |
119 | 120 |
121 |
122 | 123 |
124 |
125 | 126 |
127 |
128 | 129 |
130 | 131 |
132 | 133 |
134 | 数字必须是偶数 135 |
136 |
137 |
138 | 139 |
140 | 141 |
142 | aaa 143 | 144 |
145 |
146 | 147 |
148 |
149 | 150 | 151 |
152 | 153 |
154 | 155 | 156 |
157 | 158 |
159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | -------------------------------------------------------------------------------- /index-template.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /vendor/angular/angular-route.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | AngularJS v1.2.9 3 | (c) 2010-2014 Google, Inc. http://angularjs.org 4 | License: MIT 5 | */ 6 | (function(h,e,A){'use strict';function u(w,q,k){return{restrict:"ECA",terminal:!0,priority:400,transclude:"element",link:function(a,c,b,f,n){function y(){l&&(l.$destroy(),l=null);g&&(k.leave(g),g=null)}function v(){var b=w.current&&w.current.locals;if(e.isDefined(b&&b.$template)){var b=a.$new(),f=w.current;g=n(b,function(d){k.enter(d,null,g||c,function(){!e.isDefined(t)||t&&!a.$eval(t)||q()});y()});l=f.scope=b;l.$emit("$viewContentLoaded");l.$eval(h)}else y()}var l,g,t=b.autoscroll,h=b.onload||""; 7 | a.$on("$routeChangeSuccess",v);v()}}}function z(e,h,k){return{restrict:"ECA",priority:-400,link:function(a,c){var b=k.current,f=b.locals;c.html(f.$template);var n=e(c.contents());b.controller&&(f.$scope=a,f=h(b.controller,f),b.controllerAs&&(a[b.controllerAs]=f),c.data("$ngControllerController",f),c.children().data("$ngControllerController",f));n(a)}}}h=e.module("ngRoute",["ng"]).provider("$route",function(){function h(a,c){return e.extend(new (e.extend(function(){},{prototype:a})),c)}function q(a, 8 | e){var b=e.caseInsensitiveMatch,f={originalPath:a,regexp:a},h=f.keys=[];a=a.replace(/([().])/g,"\\$1").replace(/(\/)?:(\w+)([\?|\*])?/g,function(a,e,b,c){a="?"===c?c:null;c="*"===c?c:null;h.push({name:b,optional:!!a});e=e||"";return""+(a?"":e)+"(?:"+(a?e:"")+(c&&"(.+?)"||"([^/]+)")+(a||"")+")"+(a||"")}).replace(/([\/$\*])/g,"\\$1");f.regexp=RegExp("^"+a+"$",b?"i":"");return f}var k={};this.when=function(a,c){k[a]=e.extend({reloadOnSearch:!0},c,a&&q(a,c));if(a){var b="/"==a[a.length-1]?a.substr(0, 9 | a.length-1):a+"/";k[b]=e.extend({redirectTo:a},q(b,c))}return this};this.otherwise=function(a){this.when(null,a);return this};this.$get=["$rootScope","$location","$routeParams","$q","$injector","$http","$templateCache","$sce",function(a,c,b,f,n,q,v,l){function g(){var d=t(),m=r.current;if(d&&m&&d.$$route===m.$$route&&e.equals(d.pathParams,m.pathParams)&&!d.reloadOnSearch&&!x)m.params=d.params,e.copy(m.params,b),a.$broadcast("$routeUpdate",m);else if(d||m)x=!1,a.$broadcast("$routeChangeStart",d,m), 10 | (r.current=d)&&d.redirectTo&&(e.isString(d.redirectTo)?c.path(u(d.redirectTo,d.params)).search(d.params).replace():c.url(d.redirectTo(d.pathParams,c.path(),c.search())).replace()),f.when(d).then(function(){if(d){var a=e.extend({},d.resolve),c,b;e.forEach(a,function(d,c){a[c]=e.isString(d)?n.get(d):n.invoke(d)});e.isDefined(c=d.template)?e.isFunction(c)&&(c=c(d.params)):e.isDefined(b=d.templateUrl)&&(e.isFunction(b)&&(b=b(d.params)),b=l.getTrustedResourceUrl(b),e.isDefined(b)&&(d.loadedTemplateUrl= 11 | b,c=q.get(b,{cache:v}).then(function(a){return a.data})));e.isDefined(c)&&(a.$template=c);return f.all(a)}}).then(function(c){d==r.current&&(d&&(d.locals=c,e.copy(d.params,b)),a.$broadcast("$routeChangeSuccess",d,m))},function(c){d==r.current&&a.$broadcast("$routeChangeError",d,m,c)})}function t(){var a,b;e.forEach(k,function(f,k){var p;if(p=!b){var s=c.path();p=f.keys;var l={};if(f.regexp)if(s=f.regexp.exec(s)){for(var g=1,q=s.length;g li > a:hover, 174 | .dropdown-menu > li > a:focus { 175 | background-color: #e8e8e8; 176 | background-image: -webkit-linear-gradient(top, #f5f5f5 0%, #e8e8e8 100%); 177 | background-image: linear-gradient(to bottom, #f5f5f5 0%, #e8e8e8 100%); 178 | background-repeat: repeat-x; 179 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#ffe8e8e8', GradientType=0); 180 | } 181 | 182 | .dropdown-menu > .active > a, 183 | .dropdown-menu > .active > a:hover, 184 | .dropdown-menu > .active > a:focus { 185 | background-color: #357ebd; 186 | background-image: -webkit-linear-gradient(top, #428bca 0%, #357ebd 100%); 187 | background-image: linear-gradient(to bottom, #428bca 0%, #357ebd 100%); 188 | background-repeat: repeat-x; 189 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff357ebd', GradientType=0); 190 | } 191 | 192 | .navbar-default { 193 | background-image: -webkit-linear-gradient(top, #ffffff 0%, #f8f8f8 100%); 194 | background-image: linear-gradient(to bottom, #ffffff 0%, #f8f8f8 100%); 195 | background-repeat: repeat-x; 196 | border-radius: 4px; 197 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#fff8f8f8', GradientType=0); 198 | filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); 199 | -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 1px 5px rgba(0, 0, 0, 0.075); 200 | box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 1px 5px rgba(0, 0, 0, 0.075); 201 | } 202 | 203 | .navbar-default .navbar-nav > .active > a { 204 | background-image: -webkit-linear-gradient(top, #ebebeb 0%, #f3f3f3 100%); 205 | background-image: linear-gradient(to bottom, #ebebeb 0%, #f3f3f3 100%); 206 | background-repeat: repeat-x; 207 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffebebeb', endColorstr='#fff3f3f3', GradientType=0); 208 | -webkit-box-shadow: inset 0 3px 9px rgba(0, 0, 0, 0.075); 209 | box-shadow: inset 0 3px 9px rgba(0, 0, 0, 0.075); 210 | } 211 | 212 | .navbar-brand, 213 | .navbar-nav > li > a { 214 | text-shadow: 0 1px 0 rgba(255, 255, 255, 0.25); 215 | } 216 | 217 | .navbar-inverse { 218 | background-image: -webkit-linear-gradient(top, #3c3c3c 0%, #222222 100%); 219 | background-image: linear-gradient(to bottom, #3c3c3c 0%, #222222 100%); 220 | background-repeat: repeat-x; 221 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff3c3c3c', endColorstr='#ff222222', GradientType=0); 222 | filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); 223 | } 224 | 225 | .navbar-inverse .navbar-nav > .active > a { 226 | background-image: -webkit-linear-gradient(top, #222222 0%, #282828 100%); 227 | background-image: linear-gradient(to bottom, #222222 0%, #282828 100%); 228 | background-repeat: repeat-x; 229 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff222222', endColorstr='#ff282828', GradientType=0); 230 | -webkit-box-shadow: inset 0 3px 9px rgba(0, 0, 0, 0.25); 231 | box-shadow: inset 0 3px 9px rgba(0, 0, 0, 0.25); 232 | } 233 | 234 | .navbar-inverse .navbar-brand, 235 | .navbar-inverse .navbar-nav > li > a { 236 | text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); 237 | } 238 | 239 | .navbar-static-top, 240 | .navbar-fixed-top, 241 | .navbar-fixed-bottom { 242 | border-radius: 0; 243 | } 244 | 245 | .alert { 246 | text-shadow: 0 1px 0 rgba(255, 255, 255, 0.2); 247 | -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 1px 2px rgba(0, 0, 0, 0.05); 248 | box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 1px 2px rgba(0, 0, 0, 0.05); 249 | } 250 | 251 | .alert-success { 252 | background-image: -webkit-linear-gradient(top, #dff0d8 0%, #c8e5bc 100%); 253 | background-image: linear-gradient(to bottom, #dff0d8 0%, #c8e5bc 100%); 254 | background-repeat: repeat-x; 255 | border-color: #b2dba1; 256 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdff0d8', endColorstr='#ffc8e5bc', GradientType=0); 257 | } 258 | 259 | .alert-info { 260 | background-image: -webkit-linear-gradient(top, #d9edf7 0%, #b9def0 100%); 261 | background-image: linear-gradient(to bottom, #d9edf7 0%, #b9def0 100%); 262 | background-repeat: repeat-x; 263 | border-color: #9acfea; 264 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9edf7', endColorstr='#ffb9def0', GradientType=0); 265 | } 266 | 267 | .alert-warning { 268 | background-image: -webkit-linear-gradient(top, #fcf8e3 0%, #f8efc0 100%); 269 | background-image: linear-gradient(to bottom, #fcf8e3 0%, #f8efc0 100%); 270 | background-repeat: repeat-x; 271 | border-color: #f5e79e; 272 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffcf8e3', endColorstr='#fff8efc0', GradientType=0); 273 | } 274 | 275 | .alert-danger { 276 | background-image: -webkit-linear-gradient(top, #f2dede 0%, #e7c3c3 100%); 277 | background-image: linear-gradient(to bottom, #f2dede 0%, #e7c3c3 100%); 278 | background-repeat: repeat-x; 279 | border-color: #dca7a7; 280 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2dede', endColorstr='#ffe7c3c3', GradientType=0); 281 | } 282 | 283 | .progress { 284 | background-image: -webkit-linear-gradient(top, #ebebeb 0%, #f5f5f5 100%); 285 | background-image: linear-gradient(to bottom, #ebebeb 0%, #f5f5f5 100%); 286 | background-repeat: repeat-x; 287 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffebebeb', endColorstr='#fff5f5f5', GradientType=0); 288 | } 289 | 290 | .progress-bar { 291 | background-image: -webkit-linear-gradient(top, #428bca 0%, #3071a9 100%); 292 | background-image: linear-gradient(to bottom, #428bca 0%, #3071a9 100%); 293 | background-repeat: repeat-x; 294 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff3071a9', GradientType=0); 295 | } 296 | 297 | .progress-bar-success { 298 | background-image: -webkit-linear-gradient(top, #5cb85c 0%, #449d44 100%); 299 | background-image: linear-gradient(to bottom, #5cb85c 0%, #449d44 100%); 300 | background-repeat: repeat-x; 301 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5cb85c', endColorstr='#ff449d44', GradientType=0); 302 | } 303 | 304 | .progress-bar-info { 305 | background-image: -webkit-linear-gradient(top, #5bc0de 0%, #31b0d5 100%); 306 | background-image: linear-gradient(to bottom, #5bc0de 0%, #31b0d5 100%); 307 | background-repeat: repeat-x; 308 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff31b0d5', GradientType=0); 309 | } 310 | 311 | .progress-bar-warning { 312 | background-image: -webkit-linear-gradient(top, #f0ad4e 0%, #ec971f 100%); 313 | background-image: linear-gradient(to bottom, #f0ad4e 0%, #ec971f 100%); 314 | background-repeat: repeat-x; 315 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff0ad4e', endColorstr='#ffec971f', GradientType=0); 316 | } 317 | 318 | .progress-bar-danger { 319 | background-image: -webkit-linear-gradient(top, #d9534f 0%, #c9302c 100%); 320 | background-image: linear-gradient(to bottom, #d9534f 0%, #c9302c 100%); 321 | background-repeat: repeat-x; 322 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9534f', endColorstr='#ffc9302c', GradientType=0); 323 | } 324 | 325 | .list-group { 326 | border-radius: 4px; 327 | -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.075); 328 | box-shadow: 0 1px 2px rgba(0, 0, 0, 0.075); 329 | } 330 | 331 | .list-group-item.active, 332 | .list-group-item.active:hover, 333 | .list-group-item.active:focus { 334 | text-shadow: 0 -1px 0 #3071a9; 335 | background-image: -webkit-linear-gradient(top, #428bca 0%, #3278b3 100%); 336 | background-image: linear-gradient(to bottom, #428bca 0%, #3278b3 100%); 337 | background-repeat: repeat-x; 338 | border-color: #3278b3; 339 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff3278b3', GradientType=0); 340 | } 341 | 342 | .panel { 343 | -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); 344 | box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); 345 | } 346 | 347 | .panel-default > .panel-heading { 348 | background-image: -webkit-linear-gradient(top, #f5f5f5 0%, #e8e8e8 100%); 349 | background-image: linear-gradient(to bottom, #f5f5f5 0%, #e8e8e8 100%); 350 | background-repeat: repeat-x; 351 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#ffe8e8e8', GradientType=0); 352 | } 353 | 354 | .panel-primary > .panel-heading { 355 | background-image: -webkit-linear-gradient(top, #428bca 0%, #357ebd 100%); 356 | background-image: linear-gradient(to bottom, #428bca 0%, #357ebd 100%); 357 | background-repeat: repeat-x; 358 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff357ebd', GradientType=0); 359 | } 360 | 361 | .panel-success > .panel-heading { 362 | background-image: -webkit-linear-gradient(top, #dff0d8 0%, #d0e9c6 100%); 363 | background-image: linear-gradient(to bottom, #dff0d8 0%, #d0e9c6 100%); 364 | background-repeat: repeat-x; 365 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdff0d8', endColorstr='#ffd0e9c6', GradientType=0); 366 | } 367 | 368 | .panel-info > .panel-heading { 369 | background-image: -webkit-linear-gradient(top, #d9edf7 0%, #c4e3f3 100%); 370 | background-image: linear-gradient(to bottom, #d9edf7 0%, #c4e3f3 100%); 371 | background-repeat: repeat-x; 372 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9edf7', endColorstr='#ffc4e3f3', GradientType=0); 373 | } 374 | 375 | .panel-warning > .panel-heading { 376 | background-image: -webkit-linear-gradient(top, #fcf8e3 0%, #faf2cc 100%); 377 | background-image: linear-gradient(to bottom, #fcf8e3 0%, #faf2cc 100%); 378 | background-repeat: repeat-x; 379 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffcf8e3', endColorstr='#fffaf2cc', GradientType=0); 380 | } 381 | 382 | .panel-danger > .panel-heading { 383 | background-image: -webkit-linear-gradient(top, #f2dede 0%, #ebcccc 100%); 384 | background-image: linear-gradient(to bottom, #f2dede 0%, #ebcccc 100%); 385 | background-repeat: repeat-x; 386 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2dede', endColorstr='#ffebcccc', GradientType=0); 387 | } 388 | 389 | .well { 390 | background-image: -webkit-linear-gradient(top, #e8e8e8 0%, #f5f5f5 100%); 391 | background-image: linear-gradient(to bottom, #e8e8e8 0%, #f5f5f5 100%); 392 | background-repeat: repeat-x; 393 | border-color: #dcdcdc; 394 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe8e8e8', endColorstr='#fff5f5f5', GradientType=0); 395 | -webkit-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 0 rgba(255, 255, 255, 0.1); 396 | box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 0 rgba(255, 255, 255, 0.1); 397 | } -------------------------------------------------------------------------------- /vendor/bootstrap3/css/bootstrap-theme.min.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap v3.0.3 (http://getbootstrap.com) 3 | * Copyright 2013 Twitter, Inc. 4 | * Licensed under http://www.apache.org/licenses/LICENSE-2.0 5 | */ 6 | 7 | .btn-default,.btn-primary,.btn-success,.btn-info,.btn-warning,.btn-danger{text-shadow:0 -1px 0 rgba(0,0,0,0.2);-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.15),0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 0 rgba(255,255,255,0.15),0 1px 1px rgba(0,0,0,0.075)}.btn-default:active,.btn-primary:active,.btn-success:active,.btn-info:active,.btn-warning:active,.btn-danger:active,.btn-default.active,.btn-primary.active,.btn-success.active,.btn-info.active,.btn-warning.active,.btn-danger.active{-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,0.125);box-shadow:inset 0 3px 5px rgba(0,0,0,0.125)}.btn:active,.btn.active{background-image:none}.btn-default{text-shadow:0 1px 0 #fff;background-image:-webkit-linear-gradient(top,#fff 0,#e0e0e0 100%);background-image:linear-gradient(to bottom,#fff 0,#e0e0e0 100%);background-repeat:repeat-x;border-color:#dbdbdb;border-color:#ccc;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff',endColorstr='#ffe0e0e0',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.btn-default:hover,.btn-default:focus{background-color:#e0e0e0;background-position:0 -15px}.btn-default:active,.btn-default.active{background-color:#e0e0e0;border-color:#dbdbdb}.btn-primary{background-image:-webkit-linear-gradient(top,#428bca 0,#2d6ca2 100%);background-image:linear-gradient(to bottom,#428bca 0,#2d6ca2 100%);background-repeat:repeat-x;border-color:#2b669a;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca',endColorstr='#ff2d6ca2',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.btn-primary:hover,.btn-primary:focus{background-color:#2d6ca2;background-position:0 -15px}.btn-primary:active,.btn-primary.active{background-color:#2d6ca2;border-color:#2b669a}.btn-success{background-image:-webkit-linear-gradient(top,#5cb85c 0,#419641 100%);background-image:linear-gradient(to bottom,#5cb85c 0,#419641 100%);background-repeat:repeat-x;border-color:#3e8f3e;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5cb85c',endColorstr='#ff419641',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.btn-success:hover,.btn-success:focus{background-color:#419641;background-position:0 -15px}.btn-success:active,.btn-success.active{background-color:#419641;border-color:#3e8f3e}.btn-warning{background-image:-webkit-linear-gradient(top,#f0ad4e 0,#eb9316 100%);background-image:linear-gradient(to bottom,#f0ad4e 0,#eb9316 100%);background-repeat:repeat-x;border-color:#e38d13;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff0ad4e',endColorstr='#ffeb9316',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.btn-warning:hover,.btn-warning:focus{background-color:#eb9316;background-position:0 -15px}.btn-warning:active,.btn-warning.active{background-color:#eb9316;border-color:#e38d13}.btn-danger{background-image:-webkit-linear-gradient(top,#d9534f 0,#c12e2a 100%);background-image:linear-gradient(to bottom,#d9534f 0,#c12e2a 100%);background-repeat:repeat-x;border-color:#b92c28;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9534f',endColorstr='#ffc12e2a',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.btn-danger:hover,.btn-danger:focus{background-color:#c12e2a;background-position:0 -15px}.btn-danger:active,.btn-danger.active{background-color:#c12e2a;border-color:#b92c28}.btn-info{background-image:-webkit-linear-gradient(top,#5bc0de 0,#2aabd2 100%);background-image:linear-gradient(to bottom,#5bc0de 0,#2aabd2 100%);background-repeat:repeat-x;border-color:#28a4c9;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de',endColorstr='#ff2aabd2',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.btn-info:hover,.btn-info:focus{background-color:#2aabd2;background-position:0 -15px}.btn-info:active,.btn-info.active{background-color:#2aabd2;border-color:#28a4c9}.thumbnail,.img-thumbnail{-webkit-box-shadow:0 1px 2px rgba(0,0,0,0.075);box-shadow:0 1px 2px rgba(0,0,0,0.075)}.dropdown-menu>li>a:hover,.dropdown-menu>li>a:focus{background-color:#e8e8e8;background-image:-webkit-linear-gradient(top,#f5f5f5 0,#e8e8e8 100%);background-image:linear-gradient(to bottom,#f5f5f5 0,#e8e8e8 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5',endColorstr='#ffe8e8e8',GradientType=0)}.dropdown-menu>.active>a,.dropdown-menu>.active>a:hover,.dropdown-menu>.active>a:focus{background-color:#357ebd;background-image:-webkit-linear-gradient(top,#428bca 0,#357ebd 100%);background-image:linear-gradient(to bottom,#428bca 0,#357ebd 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca',endColorstr='#ff357ebd',GradientType=0)}.navbar-default{background-image:-webkit-linear-gradient(top,#fff 0,#f8f8f8 100%);background-image:linear-gradient(to bottom,#fff 0,#f8f8f8 100%);background-repeat:repeat-x;border-radius:4px;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff',endColorstr='#fff8f8f8',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.15),0 1px 5px rgba(0,0,0,0.075);box-shadow:inset 0 1px 0 rgba(255,255,255,0.15),0 1px 5px rgba(0,0,0,0.075)}.navbar-default .navbar-nav>.active>a{background-image:-webkit-linear-gradient(top,#ebebeb 0,#f3f3f3 100%);background-image:linear-gradient(to bottom,#ebebeb 0,#f3f3f3 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffebebeb',endColorstr='#fff3f3f3',GradientType=0);-webkit-box-shadow:inset 0 3px 9px rgba(0,0,0,0.075);box-shadow:inset 0 3px 9px rgba(0,0,0,0.075)}.navbar-brand,.navbar-nav>li>a{text-shadow:0 1px 0 rgba(255,255,255,0.25)}.navbar-inverse{background-image:-webkit-linear-gradient(top,#3c3c3c 0,#222 100%);background-image:linear-gradient(to bottom,#3c3c3c 0,#222 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff3c3c3c',endColorstr='#ff222222',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.navbar-inverse .navbar-nav>.active>a{background-image:-webkit-linear-gradient(top,#222 0,#282828 100%);background-image:linear-gradient(to bottom,#222 0,#282828 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff222222',endColorstr='#ff282828',GradientType=0);-webkit-box-shadow:inset 0 3px 9px rgba(0,0,0,0.25);box-shadow:inset 0 3px 9px rgba(0,0,0,0.25)}.navbar-inverse .navbar-brand,.navbar-inverse .navbar-nav>li>a{text-shadow:0 -1px 0 rgba(0,0,0,0.25)}.navbar-static-top,.navbar-fixed-top,.navbar-fixed-bottom{border-radius:0}.alert{text-shadow:0 1px 0 rgba(255,255,255,0.2);-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.25),0 1px 2px rgba(0,0,0,0.05);box-shadow:inset 0 1px 0 rgba(255,255,255,0.25),0 1px 2px rgba(0,0,0,0.05)}.alert-success{background-image:-webkit-linear-gradient(top,#dff0d8 0,#c8e5bc 100%);background-image:linear-gradient(to bottom,#dff0d8 0,#c8e5bc 100%);background-repeat:repeat-x;border-color:#b2dba1;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdff0d8',endColorstr='#ffc8e5bc',GradientType=0)}.alert-info{background-image:-webkit-linear-gradient(top,#d9edf7 0,#b9def0 100%);background-image:linear-gradient(to bottom,#d9edf7 0,#b9def0 100%);background-repeat:repeat-x;border-color:#9acfea;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9edf7',endColorstr='#ffb9def0',GradientType=0)}.alert-warning{background-image:-webkit-linear-gradient(top,#fcf8e3 0,#f8efc0 100%);background-image:linear-gradient(to bottom,#fcf8e3 0,#f8efc0 100%);background-repeat:repeat-x;border-color:#f5e79e;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffcf8e3',endColorstr='#fff8efc0',GradientType=0)}.alert-danger{background-image:-webkit-linear-gradient(top,#f2dede 0,#e7c3c3 100%);background-image:linear-gradient(to bottom,#f2dede 0,#e7c3c3 100%);background-repeat:repeat-x;border-color:#dca7a7;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2dede',endColorstr='#ffe7c3c3',GradientType=0)}.progress{background-image:-webkit-linear-gradient(top,#ebebeb 0,#f5f5f5 100%);background-image:linear-gradient(to bottom,#ebebeb 0,#f5f5f5 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffebebeb',endColorstr='#fff5f5f5',GradientType=0)}.progress-bar{background-image:-webkit-linear-gradient(top,#428bca 0,#3071a9 100%);background-image:linear-gradient(to bottom,#428bca 0,#3071a9 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca',endColorstr='#ff3071a9',GradientType=0)}.progress-bar-success{background-image:-webkit-linear-gradient(top,#5cb85c 0,#449d44 100%);background-image:linear-gradient(to bottom,#5cb85c 0,#449d44 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5cb85c',endColorstr='#ff449d44',GradientType=0)}.progress-bar-info{background-image:-webkit-linear-gradient(top,#5bc0de 0,#31b0d5 100%);background-image:linear-gradient(to bottom,#5bc0de 0,#31b0d5 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de',endColorstr='#ff31b0d5',GradientType=0)}.progress-bar-warning{background-image:-webkit-linear-gradient(top,#f0ad4e 0,#ec971f 100%);background-image:linear-gradient(to bottom,#f0ad4e 0,#ec971f 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff0ad4e',endColorstr='#ffec971f',GradientType=0)}.progress-bar-danger{background-image:-webkit-linear-gradient(top,#d9534f 0,#c9302c 100%);background-image:linear-gradient(to bottom,#d9534f 0,#c9302c 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9534f',endColorstr='#ffc9302c',GradientType=0)}.list-group{border-radius:4px;-webkit-box-shadow:0 1px 2px rgba(0,0,0,0.075);box-shadow:0 1px 2px rgba(0,0,0,0.075)}.list-group-item.active,.list-group-item.active:hover,.list-group-item.active:focus{text-shadow:0 -1px 0 #3071a9;background-image:-webkit-linear-gradient(top,#428bca 0,#3278b3 100%);background-image:linear-gradient(to bottom,#428bca 0,#3278b3 100%);background-repeat:repeat-x;border-color:#3278b3;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca',endColorstr='#ff3278b3',GradientType=0)}.panel{-webkit-box-shadow:0 1px 2px rgba(0,0,0,0.05);box-shadow:0 1px 2px rgba(0,0,0,0.05)}.panel-default>.panel-heading{background-image:-webkit-linear-gradient(top,#f5f5f5 0,#e8e8e8 100%);background-image:linear-gradient(to bottom,#f5f5f5 0,#e8e8e8 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5',endColorstr='#ffe8e8e8',GradientType=0)}.panel-primary>.panel-heading{background-image:-webkit-linear-gradient(top,#428bca 0,#357ebd 100%);background-image:linear-gradient(to bottom,#428bca 0,#357ebd 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca',endColorstr='#ff357ebd',GradientType=0)}.panel-success>.panel-heading{background-image:-webkit-linear-gradient(top,#dff0d8 0,#d0e9c6 100%);background-image:linear-gradient(to bottom,#dff0d8 0,#d0e9c6 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdff0d8',endColorstr='#ffd0e9c6',GradientType=0)}.panel-info>.panel-heading{background-image:-webkit-linear-gradient(top,#d9edf7 0,#c4e3f3 100%);background-image:linear-gradient(to bottom,#d9edf7 0,#c4e3f3 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9edf7',endColorstr='#ffc4e3f3',GradientType=0)}.panel-warning>.panel-heading{background-image:-webkit-linear-gradient(top,#fcf8e3 0,#faf2cc 100%);background-image:linear-gradient(to bottom,#fcf8e3 0,#faf2cc 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffcf8e3',endColorstr='#fffaf2cc',GradientType=0)}.panel-danger>.panel-heading{background-image:-webkit-linear-gradient(top,#f2dede 0,#ebcccc 100%);background-image:linear-gradient(to bottom,#f2dede 0,#ebcccc 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2dede',endColorstr='#ffebcccc',GradientType=0)}.well{background-image:-webkit-linear-gradient(top,#e8e8e8 0,#f5f5f5 100%);background-image:linear-gradient(to bottom,#e8e8e8 0,#f5f5f5 100%);background-repeat:repeat-x;border-color:#dcdcdc;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe8e8e8',endColorstr='#fff5f5f5',GradientType=0);-webkit-box-shadow:inset 0 1px 3px rgba(0,0,0,0.05),0 1px 0 rgba(255,255,255,0.1);box-shadow:inset 0 1px 3px rgba(0,0,0,0.05),0 1px 0 rgba(255,255,255,0.1)} -------------------------------------------------------------------------------- /vendor/bootstrap3/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kittencup/angularjs-video-code/c8290ffb372e33f3672d3ac01298f5c874c9b28c/vendor/bootstrap3/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /vendor/bootstrap3/fonts/glyphicons-halflings-regular.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | -------------------------------------------------------------------------------- /vendor/bootstrap3/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kittencup/angularjs-video-code/c8290ffb372e33f3672d3ac01298f5c874c9b28c/vendor/bootstrap3/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /vendor/bootstrap3/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kittencup/angularjs-video-code/c8290ffb372e33f3672d3ac01298f5c874c9b28c/vendor/bootstrap3/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /vendor/bootstrap3/js/bootstrap.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap v3.0.3 (http://getbootstrap.com) 3 | * Copyright 2013 Twitter, Inc. 4 | * Licensed under http://www.apache.org/licenses/LICENSE-2.0 5 | */ 6 | 7 | if("undefined"==typeof jQuery)throw new Error("Bootstrap requires jQuery");+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]}}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one(a.support.transition.end,function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b()})}(jQuery),+function(a){"use strict";var b='[data-dismiss="alert"]',c=function(c){a(c).on("click",b,this.close)};c.prototype.close=function(b){function c(){f.trigger("closed.bs.alert").remove()}var d=a(this),e=d.attr("data-target");e||(e=d.attr("href"),e=e&&e.replace(/.*(?=#[^\s]*$)/,""));var f=a(e);b&&b.preventDefault(),f.length||(f=d.hasClass("alert")?d:d.parent()),f.trigger(b=a.Event("close.bs.alert")),b.isDefaultPrevented()||(f.removeClass("in"),a.support.transition&&f.hasClass("fade")?f.one(a.support.transition.end,c).emulateTransitionEnd(150):c())};var d=a.fn.alert;a.fn.alert=function(b){return this.each(function(){var d=a(this),e=d.data("bs.alert");e||d.data("bs.alert",e=new c(this)),"string"==typeof b&&e[b].call(d)})},a.fn.alert.Constructor=c,a.fn.alert.noConflict=function(){return a.fn.alert=d,this},a(document).on("click.bs.alert.data-api",b,c.prototype.close)}(jQuery),+function(a){"use strict";var b=function(c,d){this.$element=a(c),this.options=a.extend({},b.DEFAULTS,d)};b.DEFAULTS={loadingText:"loading..."},b.prototype.setState=function(a){var b="disabled",c=this.$element,d=c.is("input")?"val":"html",e=c.data();a+="Text",e.resetText||c.data("resetText",c[d]()),c[d](e[a]||this.options[a]),setTimeout(function(){"loadingText"==a?c.addClass(b).attr(b,b):c.removeClass(b).removeAttr(b)},0)},b.prototype.toggle=function(){var a=this.$element.closest('[data-toggle="buttons"]'),b=!0;if(a.length){var c=this.$element.find("input");"radio"===c.prop("type")&&(c.prop("checked")&&this.$element.hasClass("active")?b=!1:a.find(".active").removeClass("active")),b&&c.prop("checked",!this.$element.hasClass("active")).trigger("change")}b&&this.$element.toggleClass("active")};var c=a.fn.button;a.fn.button=function(c){return this.each(function(){var d=a(this),e=d.data("bs.button"),f="object"==typeof c&&c;e||d.data("bs.button",e=new b(this,f)),"toggle"==c?e.toggle():c&&e.setState(c)})},a.fn.button.Constructor=b,a.fn.button.noConflict=function(){return a.fn.button=c,this},a(document).on("click.bs.button.data-api","[data-toggle^=button]",function(b){var c=a(b.target);c.hasClass("btn")||(c=c.closest(".btn")),c.button("toggle"),b.preventDefault()})}(jQuery),+function(a){"use strict";var b=function(b,c){this.$element=a(b),this.$indicators=this.$element.find(".carousel-indicators"),this.options=c,this.paused=this.sliding=this.interval=this.$active=this.$items=null,"hover"==this.options.pause&&this.$element.on("mouseenter",a.proxy(this.pause,this)).on("mouseleave",a.proxy(this.cycle,this))};b.DEFAULTS={interval:5e3,pause:"hover",wrap:!0},b.prototype.cycle=function(b){return b||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},b.prototype.getActiveIndex=function(){return this.$active=this.$element.find(".item.active"),this.$items=this.$active.parent().children(),this.$items.index(this.$active)},b.prototype.to=function(b){var c=this,d=this.getActiveIndex();return b>this.$items.length-1||0>b?void 0:this.sliding?this.$element.one("slid.bs.carousel",function(){c.to(b)}):d==b?this.pause().cycle():this.slide(b>d?"next":"prev",a(this.$items[b]))},b.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition.end&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},b.prototype.next=function(){return this.sliding?void 0:this.slide("next")},b.prototype.prev=function(){return this.sliding?void 0:this.slide("prev")},b.prototype.slide=function(b,c){var d=this.$element.find(".item.active"),e=c||d[b](),f=this.interval,g="next"==b?"left":"right",h="next"==b?"first":"last",i=this;if(!e.length){if(!this.options.wrap)return;e=this.$element.find(".item")[h]()}this.sliding=!0,f&&this.pause();var j=a.Event("slide.bs.carousel",{relatedTarget:e[0],direction:g});if(!e.hasClass("active")){if(this.$indicators.length&&(this.$indicators.find(".active").removeClass("active"),this.$element.one("slid.bs.carousel",function(){var b=a(i.$indicators.children()[i.getActiveIndex()]);b&&b.addClass("active")})),a.support.transition&&this.$element.hasClass("slide")){if(this.$element.trigger(j),j.isDefaultPrevented())return;e.addClass(b),e[0].offsetWidth,d.addClass(g),e.addClass(g),d.one(a.support.transition.end,function(){e.removeClass([b,g].join(" ")).addClass("active"),d.removeClass(["active",g].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger("slid.bs.carousel")},0)}).emulateTransitionEnd(600)}else{if(this.$element.trigger(j),j.isDefaultPrevented())return;d.removeClass("active"),e.addClass("active"),this.sliding=!1,this.$element.trigger("slid.bs.carousel")}return f&&this.cycle(),this}};var c=a.fn.carousel;a.fn.carousel=function(c){return this.each(function(){var d=a(this),e=d.data("bs.carousel"),f=a.extend({},b.DEFAULTS,d.data(),"object"==typeof c&&c),g="string"==typeof c?c:f.slide;e||d.data("bs.carousel",e=new b(this,f)),"number"==typeof c?e.to(c):g?e[g]():f.interval&&e.pause().cycle()})},a.fn.carousel.Constructor=b,a.fn.carousel.noConflict=function(){return a.fn.carousel=c,this},a(document).on("click.bs.carousel.data-api","[data-slide], [data-slide-to]",function(b){var c,d=a(this),e=a(d.attr("data-target")||(c=d.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,"")),f=a.extend({},e.data(),d.data()),g=d.attr("data-slide-to");g&&(f.interval=!1),e.carousel(f),(g=d.attr("data-slide-to"))&&e.data("bs.carousel").to(g),b.preventDefault()}),a(window).on("load",function(){a('[data-ride="carousel"]').each(function(){var b=a(this);b.carousel(b.data())})})}(jQuery),+function(a){"use strict";var b=function(c,d){this.$element=a(c),this.options=a.extend({},b.DEFAULTS,d),this.transitioning=null,this.options.parent&&(this.$parent=a(this.options.parent)),this.options.toggle&&this.toggle()};b.DEFAULTS={toggle:!0},b.prototype.dimension=function(){var a=this.$element.hasClass("width");return a?"width":"height"},b.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var b=a.Event("show.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.$parent&&this.$parent.find("> .panel > .in");if(c&&c.length){var d=c.data("bs.collapse");if(d&&d.transitioning)return;c.collapse("hide"),d||c.data("bs.collapse",null)}var e=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[e](0),this.transitioning=1;var f=function(){this.$element.removeClass("collapsing").addClass("in")[e]("auto"),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return f.call(this);var g=a.camelCase(["scroll",e].join("-"));this.$element.one(a.support.transition.end,a.proxy(f,this)).emulateTransitionEnd(350)[e](this.$element[0][g])}}},b.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var b=a.Event("hide.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.dimension();this.$element[c](this.$element[c]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse").removeClass("in"),this.transitioning=1;var d=function(){this.transitioning=0,this.$element.trigger("hidden.bs.collapse").removeClass("collapsing").addClass("collapse")};return a.support.transition?(this.$element[c](0).one(a.support.transition.end,a.proxy(d,this)).emulateTransitionEnd(350),void 0):d.call(this)}}},b.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()};var c=a.fn.collapse;a.fn.collapse=function(c){return this.each(function(){var d=a(this),e=d.data("bs.collapse"),f=a.extend({},b.DEFAULTS,d.data(),"object"==typeof c&&c);e||d.data("bs.collapse",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.collapse.Constructor=b,a.fn.collapse.noConflict=function(){return a.fn.collapse=c,this},a(document).on("click.bs.collapse.data-api","[data-toggle=collapse]",function(b){var c,d=a(this),e=d.attr("data-target")||b.preventDefault()||(c=d.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,""),f=a(e),g=f.data("bs.collapse"),h=g?"toggle":d.data(),i=d.attr("data-parent"),j=i&&a(i);g&&g.transitioning||(j&&j.find('[data-toggle=collapse][data-parent="'+i+'"]').not(d).addClass("collapsed"),d[f.hasClass("in")?"addClass":"removeClass"]("collapsed")),f.collapse(h)})}(jQuery),+function(a){"use strict";function b(){a(d).remove(),a(e).each(function(b){var d=c(a(this));d.hasClass("open")&&(d.trigger(b=a.Event("hide.bs.dropdown")),b.isDefaultPrevented()||d.removeClass("open").trigger("hidden.bs.dropdown"))})}function c(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}var d=".dropdown-backdrop",e="[data-toggle=dropdown]",f=function(b){a(b).on("click.bs.dropdown",this.toggle)};f.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=c(e),g=f.hasClass("open");if(b(),!g){if("ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a(''}),b.prototype=a.extend({},a.fn.tooltip.Constructor.prototype),b.prototype.constructor=b,b.prototype.getDefaults=function(){return b.DEFAULTS},b.prototype.setContent=function(){var a=this.tip(),b=this.getTitle(),c=this.getContent();a.find(".popover-title")[this.options.html?"html":"text"](b),a.find(".popover-content")[this.options.html?"html":"text"](c),a.removeClass("fade top bottom left right in"),a.find(".popover-title").html()||a.find(".popover-title").hide()},b.prototype.hasContent=function(){return this.getTitle()||this.getContent()},b.prototype.getContent=function(){var a=this.$element,b=this.options;return a.attr("data-content")||("function"==typeof b.content?b.content.call(a[0]):b.content)},b.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")},b.prototype.tip=function(){return this.$tip||(this.$tip=a(this.options.template)),this.$tip};var c=a.fn.popover;a.fn.popover=function(c){return this.each(function(){var d=a(this),e=d.data("bs.popover"),f="object"==typeof c&&c;e||d.data("bs.popover",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.popover.Constructor=b,a.fn.popover.noConflict=function(){return a.fn.popover=c,this}}(jQuery),+function(a){"use strict";function b(c,d){var e,f=a.proxy(this.process,this);this.$element=a(c).is("body")?a(window):a(c),this.$body=a("body"),this.$scrollElement=this.$element.on("scroll.bs.scroll-spy.data-api",f),this.options=a.extend({},b.DEFAULTS,d),this.selector=(this.options.target||(e=a(c).attr("href"))&&e.replace(/.*(?=#[^\s]+$)/,"")||"")+" .nav li > a",this.offsets=a([]),this.targets=a([]),this.activeTarget=null,this.refresh(),this.process()}b.DEFAULTS={offset:10},b.prototype.refresh=function(){var b=this.$element[0]==window?"offset":"position";this.offsets=a([]),this.targets=a([]);var c=this;this.$body.find(this.selector).map(function(){var d=a(this),e=d.data("target")||d.attr("href"),f=/^#\w/.test(e)&&a(e);return f&&f.length&&[[f[b]().top+(!a.isWindow(c.$scrollElement.get(0))&&c.$scrollElement.scrollTop()),e]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){c.offsets.push(this[0]),c.targets.push(this[1])})},b.prototype.process=function(){var a,b=this.$scrollElement.scrollTop()+this.options.offset,c=this.$scrollElement[0].scrollHeight||this.$body[0].scrollHeight,d=c-this.$scrollElement.height(),e=this.offsets,f=this.targets,g=this.activeTarget;if(b>=d)return g!=(a=f.last()[0])&&this.activate(a);for(a=e.length;a--;)g!=f[a]&&b>=e[a]&&(!e[a+1]||b<=e[a+1])&&this.activate(f[a])},b.prototype.activate=function(b){this.activeTarget=b,a(this.selector).parents(".active").removeClass("active");var c=this.selector+'[data-target="'+b+'"],'+this.selector+'[href="'+b+'"]',d=a(c).parents("li").addClass("active");d.parent(".dropdown-menu").length&&(d=d.closest("li.dropdown").addClass("active")),d.trigger("activate.bs.scrollspy")};var c=a.fn.scrollspy;a.fn.scrollspy=function(c){return this.each(function(){var d=a(this),e=d.data("bs.scrollspy"),f="object"==typeof c&&c;e||d.data("bs.scrollspy",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.scrollspy.Constructor=b,a.fn.scrollspy.noConflict=function(){return a.fn.scrollspy=c,this},a(window).on("load",function(){a('[data-spy="scroll"]').each(function(){var b=a(this);b.scrollspy(b.data())})})}(jQuery),+function(a){"use strict";var b=function(b){this.element=a(b)};b.prototype.show=function(){var b=this.element,c=b.closest("ul:not(.dropdown-menu)"),d=b.data("target");if(d||(d=b.attr("href"),d=d&&d.replace(/.*(?=#[^\s]*$)/,"")),!b.parent("li").hasClass("active")){var e=c.find(".active:last a")[0],f=a.Event("show.bs.tab",{relatedTarget:e});if(b.trigger(f),!f.isDefaultPrevented()){var g=a(d);this.activate(b.parent("li"),c),this.activate(g,g.parent(),function(){b.trigger({type:"shown.bs.tab",relatedTarget:e})})}}},b.prototype.activate=function(b,c,d){function e(){f.removeClass("active").find("> .dropdown-menu > .active").removeClass("active"),b.addClass("active"),g?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu")&&b.closest("li.dropdown").addClass("active"),d&&d()}var f=c.find("> .active"),g=d&&a.support.transition&&f.hasClass("fade");g?f.one(a.support.transition.end,e).emulateTransitionEnd(150):e(),f.removeClass("in")};var c=a.fn.tab;a.fn.tab=function(c){return this.each(function(){var d=a(this),e=d.data("bs.tab");e||d.data("bs.tab",e=new b(this)),"string"==typeof c&&e[c]()})},a.fn.tab.Constructor=b,a.fn.tab.noConflict=function(){return a.fn.tab=c,this},a(document).on("click.bs.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"]',function(b){b.preventDefault(),a(this).tab("show")})}(jQuery),+function(a){"use strict";var b=function(c,d){this.options=a.extend({},b.DEFAULTS,d),this.$window=a(window).on("scroll.bs.affix.data-api",a.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",a.proxy(this.checkPositionWithEventLoop,this)),this.$element=a(c),this.affixed=this.unpin=null,this.checkPosition()};b.RESET="affix affix-top affix-bottom",b.DEFAULTS={offset:0},b.prototype.checkPositionWithEventLoop=function(){setTimeout(a.proxy(this.checkPosition,this),1)},b.prototype.checkPosition=function(){if(this.$element.is(":visible")){var c=a(document).height(),d=this.$window.scrollTop(),e=this.$element.offset(),f=this.options.offset,g=f.top,h=f.bottom;"object"!=typeof f&&(h=g=f),"function"==typeof g&&(g=f.top()),"function"==typeof h&&(h=f.bottom());var i=null!=this.unpin&&d+this.unpin<=e.top?!1:null!=h&&e.top+this.$element.height()>=c-h?"bottom":null!=g&&g>=d?"top":!1;this.affixed!==i&&(this.unpin&&this.$element.css("top",""),this.affixed=i,this.unpin="bottom"==i?e.top-d:null,this.$element.removeClass(b.RESET).addClass("affix"+(i?"-"+i:"")),"bottom"==i&&this.$element.offset({top:document.body.offsetHeight-h-this.$element.height()}))}};var c=a.fn.affix;a.fn.affix=function(c){return this.each(function(){var d=a(this),e=d.data("bs.affix"),f="object"==typeof c&&c;e||d.data("bs.affix",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.affix.Constructor=b,a.fn.affix.noConflict=function(){return a.fn.affix=c,this},a(window).on("load",function(){a('[data-spy="affix"]').each(function(){var b=a(this),c=b.data();c.offset=c.offset||{},c.offsetBottom&&(c.offset.bottom=c.offsetBottom),c.offsetTop&&(c.offset.top=c.offsetTop),b.affix(c)})})}(jQuery); --------------------------------------------------------------------------------