├── .gitignore ├── CNAME ├── Gruntfile.coffee ├── angular-clndr.css ├── angular-clndr.css.map ├── angular-clndr.js ├── angular-clndr.min.js ├── bower.json ├── index.html ├── package.json ├── readme.md └── src ├── angular-clndr.coffee └── angular-clndr.sass /.gitignore: -------------------------------------------------------------------------------- 1 | # jetbrains 2 | idea/ 3 | /*.iml 4 | 5 | # osx 6 | .DS_Store 7 | .AppleDouble 8 | .LSOverride 9 | 10 | # windows 11 | Thumbs.db 12 | ehthumbs.db 13 | Desktop.ini 14 | 15 | # node 16 | logs 17 | *.log 18 | pids 19 | *.pid 20 | *.seed 21 | lib-cov 22 | coverage 23 | .grunt 24 | build/Release 25 | node_modules 26 | .lock-wscript 27 | 28 | # sass 29 | .sass-cache 30 | 31 | # bower 32 | bower_components/ 33 | build/ 34 | dist/ -------------------------------------------------------------------------------- /CNAME: -------------------------------------------------------------------------------- 1 | angular-clndr.10kb.nl -------------------------------------------------------------------------------- /Gruntfile.coffee: -------------------------------------------------------------------------------- 1 | module.exports = (grunt) -> 2 | require('load-grunt-tasks')(grunt) 3 | 4 | grunt.initConfig 5 | pkg: grunt.file.readJSON('package.json') 6 | 7 | connect: 8 | server: 9 | options: 10 | keepalive: true 11 | 12 | coffee: 13 | dist: 14 | src: './src/angular-clndr.coffee' 15 | dest: './angular-clndr.js' 16 | 17 | sass: 18 | dist: 19 | src: './src/angular-clndr.sass' 20 | dest: './angular-clndr.css' 21 | 22 | ngAnnotate: 23 | dist: 24 | src: './angular-clndr.js' 25 | dest: './angular-clndr.js' 26 | 27 | uglify: 28 | options: 29 | preserveComments: 'some' 30 | dist: 31 | src: './angular-clndr.js' 32 | dest: './angular-clndr.min.js' 33 | 34 | watch: 35 | coffee: 36 | files: './src/angular-clndr.coffee' 37 | tasks: ['coffee'] 38 | sass: 39 | files: './src/angular-clndr.sass' 40 | tasks: ['sass'] 41 | 42 | grunt.registerTask('default', ['coffee', 'ngAnnotate', 'uglify', 'sass']) 43 | grunt.registerTask('server', ['default', 'connect', 'watch']) -------------------------------------------------------------------------------- /angular-clndr.css: -------------------------------------------------------------------------------- 1 | .clndr { 2 | display: block; 3 | margin: 0 auto; 4 | max-width: 400px; } 5 | .clndr .clndr-controls { 6 | border-bottom: 1px solid #ccc; 7 | position: relative; } 8 | .clndr .clndr-controls .month { 9 | padding: 12px 0; 10 | text-align: center; } 11 | .clndr .clndr-controls .clndr-previous-button, .clndr .clndr-controls .clndr-next-button { 12 | cursor: pointer; 13 | top: 0px; 14 | left: 0px; 15 | padding: 12px; 16 | position: absolute; } 17 | .clndr .clndr-controls .clndr-next-button { 18 | left: auto; 19 | right: 0px; } 20 | .clndr .clndr-grid .days-of-the-week { 21 | width: 100%; } 22 | .clndr .clndr-grid .days-of-the-week .header-day { 23 | float: left; 24 | width: 14.28571%; 25 | padding: 12px 0; 26 | text-align: center; } 27 | .clndr .days .day, .clndr .days .empty { 28 | float: left; 29 | width: 14.28571%; 30 | padding: 12px 0; 31 | position: relative; 32 | text-align: center; } 33 | .clndr .days .day.today, .clndr .days .empty.today { 34 | background-color: #ccc; } 35 | .clndr .days .day .event-indicator, .clndr .days .empty .event-indicator { 36 | background-color: #3BB7E8; 37 | border-radius: 100%; 38 | color: #fff; 39 | cursor: pointer; 40 | font-size: 9px; 41 | height: 15px; 42 | line-height: 16px; 43 | position: absolute; 44 | right: 0px; 45 | top: 0px; 46 | width: 15px; } 47 | .clndr .days .day.adjacent-month, .clndr .days .day.inactive, .clndr .days .empty.adjacent-month, .clndr .days .empty.inactive { 48 | opacity: 0.3; } 49 | 50 | /*# sourceMappingURL=angular-clndr.css.map */ 51 | -------------------------------------------------------------------------------- /angular-clndr.css.map: -------------------------------------------------------------------------------- 1 | { 2 | "version": 3, 3 | "mappings": "AAAA,MAAM;EACJ,OAAO,EAAE,KAAK;EACd,MAAM,EAAE,MAAM;EACd,SAAS,EAAE,KAAK;EAEhB,sBAAe;IACb,aAAa,EAAE,cAAc;IAC7B,QAAQ,EAAE,QAAQ;IAElB,6BAAM;MACJ,OAAO,EAAE,MAAM;MACf,UAAU,EAAE,MAAM;IAEpB,wFAA0C;MACxC,MAAM,EAAE,OAAO;MACf,GAAG,EAAE,GAAG;MACR,IAAI,EAAE,GAAG;MACT,OAAO,EAAE,IAAI;MACb,QAAQ,EAAE,QAAQ;IAEpB,yCAAkB;MAChB,IAAI,EAAE,IAAI;MACV,KAAK,EAAE,GAAG;EAGZ,oCAAiB;IACf,KAAK,EAAE,IAAI;IAEX,gDAAW;MACT,KAAK,EAAE,IAAI;MACX,KAAK,EAAE,SAAS;MAChB,OAAO,EAAE,MAAM;MACf,UAAU,EAAE,MAAM;EAGtB,sCAAY;IACV,KAAK,EAAE,IAAI;IACX,KAAK,EAAE,SAAS;IAChB,OAAO,EAAE,MAAM;IACf,QAAQ,EAAE,QAAQ;IAClB,UAAU,EAAE,MAAM;IAElB,kDAAO;MACL,gBAAgB,EAAE,IAAI;IAExB,wEAAgB;MACd,gBAAgB,EAAE,OAAO;MACzB,aAAa,EAAE,IAAI;MACnB,KAAK,EAAE,IAAI;MACX,MAAM,EAAE,OAAO;MACf,SAAS,EAAE,GAAG;MACd,MAAM,EAAE,IAAI;MACZ,WAAW,EAAE,IAAI;MACjB,QAAQ,EAAE,QAAQ;MAClB,KAAK,EAAE,GAAG;MACV,GAAG,EAAE,GAAG;MACR,KAAK,EAAE,IAAI;IAEb,8HAA4B;MAC1B,OAAO,EAAE,GAAG", 4 | "sources": ["src/angular-clndr.sass"], 5 | "names": [], 6 | "file": "angular-clndr.css" 7 | } 8 | -------------------------------------------------------------------------------- /angular-clndr.js: -------------------------------------------------------------------------------- 1 | 2 | /*! 3 | * angular-clndr 0.3.0 4 | * 10KB, http://10kb.nl/ 5 | * License: MIT 6 | */ 7 | 8 | (function() { 9 | var TienClndrDirective, module; 10 | 11 | module = angular.module('tien.clndr', []); 12 | 13 | TienClndrDirective = function() { 14 | var controller, scope; 15 | scope = { 16 | clndr: '=tienClndrObject', 17 | events: '=tienClndrEvents', 18 | options: '=?tienClndrOptions' 19 | }; 20 | controller = [ 21 | "$scope", "$element", "$attrs", "$transclude", function($scope, $element, $attrs, $transclude) { 22 | return $transclude(function(clone, scope) { 23 | var options, render; 24 | $element.append(clone); 25 | $scope.$watch('events', function(val) { 26 | return $scope.clndr.setEvents(angular.copy(val || [])); 27 | }); 28 | render = function(data) { 29 | return angular.extend(scope, data); 30 | }; 31 | options = angular.extend($scope.options || {}, { 32 | render: render 33 | }); 34 | return $scope.clndr = angular.element("
").clndr(options); 35 | }); 36 | } 37 | ]; 38 | return { 39 | restrict: 'E', 40 | replace: true, 41 | transclude: true, 42 | scope: scope, 43 | controller: controller 44 | }; 45 | }; 46 | 47 | module.directive('tienClndr', TienClndrDirective); 48 | 49 | }).call(this); 50 | -------------------------------------------------------------------------------- /angular-clndr.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * angular-clndr 0.3.0 3 | * 10KB, http://10kb.nl/ 4 | * License: MIT 5 | */ 6 | (function(){var a,b;b=angular.module("tien.clndr",[]),a=function(){var a,b;return b={clndr:"=tienClndrObject",events:"=tienClndrEvents",options:"=?tienClndrOptions"},a=["$scope","$element","$attrs","$transclude",function(a,b,c,d){return d(function(c,d){var e,f;return b.append(c),a.$watch("events",function(b){return a.clndr.setEvents(angular.copy(b||[]))}),f=function(a){return angular.extend(d,a)},e=angular.extend(a.options||{},{render:f}),a.clndr=angular.element("").clndr(e)})}],{restrict:"E",replace:!0,transclude:!0,scope:b,controller:a}},b.directive("tienClndr",a)}).call(this); -------------------------------------------------------------------------------- /bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "angular-clndr", 3 | "description": "Angular directive for the CLNDR.js package.", 4 | "author": "10KB", 5 | "main": ["./angular-clndr.js", "./angular-clndr.css"], 6 | "ignore": [ 7 | "src", 8 | "Gruntfile.coffee", 9 | "package.json", 10 | "CNAME" 11 | ], 12 | "dependencies": { 13 | "angular": ">=1", 14 | "clndr": ">=1.2" 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |Angular directive for CLNDR.js
24 |bower install --save angular-clndr
angular-clndr.js
.tien.clndr
to you app modules.tien-clndr
directive.
107 | Use the tien-clndr
directive as element, all childs of this element have
108 | CLNDR.js data available on the object provided with the tien-clndr-object
109 | attributes. With this object on the child's scope, you can for example ng-repeat over the
110 | days and render the template Angular-style.
111 |
113 | Optionally pass an array of events
114 | to the directive with the tien-clndr-events
attribute. Events are available
115 | on the scope at day.events
, as shown in the example below:
116 |
118 | To pass additional options on initialization of CLNDR, provide an options object to the
119 | tien-clndr-options
attribute. See CLNDR Usage
120 | for all possible settings. Heads up: the tien-clndr-options
object is only read
121 | once during transclusion!
122 |
<tien-clndr class="clndr" tien-clndr-object="clndr" tien-clndr-events="events">
124 | <div class="clndr-controls">
125 | <div class="clndr-previous-button" ng-click="clndr.back()">
126 | ‹
127 | </div>
128 | <div class="month">
129 | {{month}}
130 | </div>
131 | <div class="clndr-next-button" ng-click="clndr.forward()">
132 | ›
133 | </div>
134 | </div>
135 | <div class="clndr-grid">
136 | <div class="days-of-the-week">
137 | <div class="header-day" ng-repeat="day in daysOfTheWeek track by $index">
138 | {{day}}
139 | </div>
140 | </div>
141 | <div class="days">
142 | <div class="{{day.classes}}" ng-repeat="day in days">
143 | <div class="event-indicator" ng-show="day.events.length" ng-click="showEvents(day.events)">{{day.events.length}}</div>
144 | {{day.day}}
145 | </div>
146 | </div>
147 | </div>
148 | </tien-clndr>
149 |
155 | angular-clndr 0.3.0 · Created by 10KB
156 | Based on CLNDR.js.
157 |
159 | GitHub Project 160 |
161 |