-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add boilerplate, bower and update readme/demo's
- Loading branch information
1 parent
36b2081
commit 63ec336
Showing
15 changed files
with
475 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# jetbrains | ||
idea/ | ||
/*.iml | ||
|
||
# osx | ||
.DS_Store | ||
.AppleDouble | ||
.LSOverride | ||
|
||
# windows | ||
Thumbs.db | ||
ehthumbs.db | ||
Desktop.ini | ||
|
||
# node | ||
logs | ||
*.log | ||
pids | ||
*.pid | ||
*.seed | ||
lib-cov | ||
coverage | ||
.grunt | ||
build/Release | ||
node_modules | ||
.lock-wscript | ||
|
||
# sass | ||
.sass-cache | ||
|
||
# bower | ||
bower_components/ | ||
build/ | ||
dist/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
angular-clndr.10kb.nl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
module.exports = (grunt) -> | ||
require('load-grunt-tasks')(grunt) | ||
|
||
grunt.initConfig | ||
pkg: grunt.file.readJSON('package.json') | ||
|
||
connect: | ||
server: | ||
options: | ||
keepalive: true | ||
|
||
coffee: | ||
dist: | ||
src: './src/angular-clndr.coffee' | ||
dest: './angular-clndr.js' | ||
|
||
sass: | ||
dist: | ||
src: './src/angular-clndr.sass' | ||
dest: './angular-clndr.css' | ||
|
||
ngAnnotate: | ||
dist: | ||
src: './angular-clndr.js' | ||
dest: './angular-clndr.js' | ||
|
||
uglify: | ||
options: | ||
preserveComments: 'some' | ||
dist: | ||
src: './angular-clndr.js' | ||
dest: './angular-clndr.min.js' | ||
|
||
watch: | ||
coffee: | ||
files: './src/angular-clndr.coffee' | ||
tasks: ['coffee'] | ||
sass: | ||
files: './src/angular-clndr.sass' | ||
tasks: ['sass'] | ||
|
||
grunt.registerTask('default', ['ngAnnotate', 'uglify']) | ||
grunt.registerTask('server', ['default', 'connect', 'watch']) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/*! | ||
* angular-clndr 0.2.0 | ||
* 10KB, http://10kb.nl/ | ||
* License: MIT | ||
*/ | ||
(function(){var a;a=angular.module("tien.clndr",[]),a.directive("tienClndr",function(){return{restrict:"E",replace:!0,transclude:!0,scope:{clndr:"=tienClndrObject",events:"=tienClndrEvents"},controller:["$scope","$element","$attrs","$transclude",function(a,b,c,d){return d(function(c,d){var e;return b.append(c),a.$watch("events",function(b){return(null!=b?b.length:void 0)?a.clndr.setEvents(angular.copy(b)):void 0}),e=function(a){return angular.extend(d,a)},a.clndr=angular.element("<div/>").clndr({render:e})})}]}})}).call(this); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"name": "angular-clndr", | ||
"description": "Angular directive for the CLNDR.js package.", | ||
"version": "0.2.0", | ||
"author": "10KB", | ||
"main": "./angular-clndr.js", | ||
"ignore": [ | ||
"src", | ||
"Gruntfile.coffee", | ||
"package.json", | ||
"CNAME" | ||
], | ||
"dependencies": { | ||
"angular": ">=1", | ||
"clndr": ">=1.2" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,152 @@ | ||
<!doctype html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>AngularJS Clndr Directive</title> | ||
<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet"> | ||
<link href="angular-clndr.css" rel="stylesheet"> | ||
<style> | ||
body { | ||
margin-top: 1em; | ||
} | ||
p { | ||
line-height: 24px; | ||
} | ||
</style> | ||
</head> | ||
<body class="container"> | ||
<div class="row"> | ||
<div class="col-lg-10 col-lg-offset-1 col-md-12"> | ||
<div class="jumbotron"> | ||
<h1>angular-clndr</h1> | ||
|
||
<p>Angular directive for CLNDR.js</p> | ||
</div> | ||
<div class="row"> | ||
<div class="col-md-12"> | ||
<h2>Getting Started</h2> | ||
<ol> | ||
<li>Install with bower: <code>bower install --save angular-clndr</code></li> | ||
<li>Include <code>angular-clndr.js</code>.</li> | ||
<li>Make sure to include all CLNDR.js dependencies.</li> | ||
<li>Add <code>tien.clndr</code> to you app modules.</li> | ||
<li>Use the <code>tien-clndr</code> directive.</li> | ||
</ol> | ||
|
||
If you don't like package managers, you can also directly download | ||
<a href="./angular-clndr.js">angular-clndr.js</a> or | ||
<a href="./angular-clndr.min.js">angular-clndr.min.js</a>. | ||
</div> | ||
</div> | ||
<hr> | ||
<div class="row" ng-app="clndrApp"> | ||
<div class="col-md-12" ng-controller="DemoCtrl"> | ||
<h2>Demo</h2> | ||
|
||
<tien-clndr class="clndr" tien-clndr-object="clndr" tien-clndr-events="events"> | ||
<div class="clndr-controls"> | ||
<div class="clndr-previous-button" ng-click="clndr.back()"> | ||
‹ | ||
</div> | ||
<div class="month"> | ||
{{month}} | ||
</div> | ||
<div class="clndr-next-button" ng-click="clndr.forward()"> | ||
› | ||
</div> | ||
</div> | ||
<div class="clndr-grid"> | ||
<div class="days-of-the-week"> | ||
<div class="header-day" ng-repeat="day in daysOfTheWeek track by $index"> | ||
{{day}} | ||
</div> | ||
</div> | ||
<div class="days"> | ||
<div class="{{day.classes}}" ng-repeat="day in days"> | ||
<div class="event-indicator" ng-show="day.events" ng-click="showEvents(day.events)">{{day.events.length}}</div> | ||
{{day.day}} | ||
</div> | ||
</div> | ||
</div> | ||
</tien-clndr> | ||
</div> | ||
</div> | ||
|
||
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> | ||
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.22/angular.min.js"></script> | ||
<script src="//kylestetz.github.io/CLNDR/js/moment.js"></script> | ||
<script src="//kylestetz.github.io/CLNDR/js/clndr.js"></script> | ||
<script src="angular-clndr.js"></script> | ||
<script> | ||
app = angular.module('clndrApp', ['tien.clndr']); | ||
app.controller('DemoCtrl', function ($scope) { | ||
$scope.events = [ | ||
{ date: moment().add(3, 'days').format(), title: "Happy days" }, | ||
{ date: moment().subtract(5, 'days').format(), title: "Good old days" }, | ||
{ date: moment().subtract(5, 'days').format(), title: "And some more" } | ||
]; | ||
$scope.showEvents = function(events) { | ||
alert(events.map(function(e) { return e.title }).join("\n")); | ||
}; | ||
}); | ||
</script> | ||
|
||
<hr> | ||
<div class="row"> | ||
<div class="col-md-12"> | ||
<h2>Usage</h2> | ||
<p> | ||
Use the <code>tien-clndr</code> directive as element, all childs of this element have | ||
CLNDR.js data available on the object provided with the <code>tien-clndr-object</code> | ||
attributes. With this object on the child's scope, you can for example ng-repeat over the | ||
days and render the template Angular-style. | ||
</p> | ||
<p> | ||
Optionally pass an <a href="https://github.com/kylestetz/CLNDR#pass-in-your-events">array of events</a> | ||
to the directive with the <code>tien-clndr-events</code> attribute. Events are available | ||
on the scope at <code>day.events</code>, as shown in the example below: | ||
</p> | ||
<pre><code><tien-clndr class="clndr" tien-clndr-object="clndr" tien-clndr-events="events"> | ||
<div class="clndr-controls"> | ||
<div class="clndr-previous-button" ng-click="clndr.back()"> | ||
&lsaquo; | ||
</div> | ||
<div class="month"> | ||
{{month}} | ||
</div> | ||
<div class="clndr-next-button" ng-click="clndr.forward()"> | ||
&rsaquo; | ||
</div> | ||
</div> | ||
<div class="clndr-grid"> | ||
<div class="days-of-the-week"> | ||
<div class="header-day" ng-repeat="day in daysOfTheWeek track by $index"> | ||
{{day}} | ||
</div> | ||
</div> | ||
<div class="days"> | ||
<div class="{{day.classes}}" ng-repeat="day in days"> | ||
<div class="event-indicator" ng-show="day.events" ng-click="showEvents(day.events)">{{day.events.length}}</div> | ||
{{day.day}} | ||
</div> | ||
</div> | ||
</div> | ||
</tien-clndr></code></pre> | ||
</div> | ||
</div> | ||
<hr> | ||
<div class="row"> | ||
<div class="col-md-12"> | ||
<p class="text-center"> | ||
angular-clndr 0.1.0 · Created by <a href="http://10kb.nl/">10KB</a><br> | ||
Based on <a href="http://kylestetz.github.io/CLNDR/">CLNDR.js</a>. | ||
</p> | ||
<p class="text-center"> | ||
<a href="https://github.com/10KB/angular-clndr">GitHub Project</a> | ||
</p> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</body> | ||
</html> |
Oops, something went wrong.