Skip to content

Commit 9c9dd3b

Browse files
committed
Make dist
1 parent 79d5537 commit 9c9dd3b

File tree

4 files changed

+104
-6
lines changed

4 files changed

+104
-6
lines changed

Gruntfile.js

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ module.exports = function(grunt) {
33
// Project configuration.
44
grunt.initConfig({
55
pkg: grunt.file.readJSON('package.json'),
6+
project: {
7+
src: 'src'
8+
},
69
bower: {
710
install: {
811
options: {
@@ -15,17 +18,43 @@ module.exports = function(grunt) {
1518
options: {
1619
port: 8080,
1720
base: '.',
18-
keepalive: true
21+
keepalive: false
1922
}
2023
}
24+
},
25+
concat: {
26+
options: {
27+
separator: ';',
28+
stripBanners: true,
29+
banner:
30+
'/*! \n' +
31+
'* <%= pkg.name %>\n' +
32+
'* Version - <%= pkg.version %>\n' +
33+
'* Built - <%= grunt.template.today("yyyy-mm-dd") %>\n' +
34+
'* Author - <%= pkg.author %>\n' +
35+
'* url - <%= pkg.repository.url %>\n' +
36+
'*/\n',
37+
},
38+
dist: {
39+
src: ['src/angular-aui.js', 'src/**.js'],
40+
dest: 'dist/angular-aui.js',
41+
},
42+
},
43+
watch: {
44+
concat: {
45+
files: '<%= project.src %>/*.js',
46+
tasks: ['concat']
47+
}
2148
}
2249
});
2350

2451
grunt.loadNpmTasks('grunt-contrib-connect');
52+
grunt.loadNpmTasks('grunt-contrib-concat');
53+
grunt.loadNpmTasks('grunt-contrib-watch');
2554
grunt.loadNpmTasks('grunt-bower-task');
2655
grunt.loadNpmTasks('grunt-release');
2756

2857
grunt.registerTask('install', ['bower:install'])
29-
grunt.registerTask('default', ['connect']);
58+
grunt.registerTask('default', ['connect', 'watch']);
3059

3160
};

dist/angular-aui.js

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
/*!
2+
* angular-aui
3+
* Version - 0.0.1
4+
* Built - 2014-09-30
5+
6+
* url - https://github.com/OleksandrBezhan/angular-aui.git
7+
*/
8+
'strict mode';
9+
10+
angular.module('angular-aui', ['angular-aui-directives']);;angular.module('angular-aui-directives', [])
11+
.directive('auiDatePicker', [function() {
12+
function link(scope, element, attrs, ngModelCtrl) {
13+
AJS.$(element).datePicker({
14+
overrideBrowserDefault: true,
15+
onSelect: function(newValue) {
16+
scope.$apply(function() {
17+
// model doesn't get updates when `overrideBrowserDefault` = true
18+
ngModelCtrl.$setViewValue(newValue);
19+
});
20+
}
21+
});
22+
}
23+
return {
24+
require: 'ngModel',
25+
link: link
26+
};
27+
}])
28+
.directive('auiInlineDialog', ['$compile', function($compile) {
29+
var dialogContent;
30+
function link(scope, element, attrs) {
31+
var dialog = AJS.InlineDialog(AJS.$(element), 1,
32+
function(content, trigger, showPopup) {
33+
content.html(dialogContent);
34+
showPopup();
35+
return false;
36+
}, scope.$eval(attrs.options));
37+
scope.$hide = dialog.hide.bind(dialog);
38+
scope.$refresh = dialog.refresh.bind(dialog);
39+
scope.$show = dialog.show.bind(dialog);
40+
}
41+
function controller($scope) {
42+
this.drawContent = function(html) {
43+
dialogContent = $compile(html)($scope);
44+
};
45+
}
46+
return {
47+
controller: controller,
48+
link: link
49+
};
50+
}])
51+
.directive('auiInlineDialogContent', ['$timeout', function($timeout) {
52+
function link(scope, element, attrs, inlineDialogCtrl) {
53+
inlineDialogCtrl.drawContent(element[0].innerHTML);
54+
element.css('display', 'none');
55+
}
56+
return {
57+
require: '^auiInlineDialog',
58+
link: link
59+
};
60+
}])
61+
.directive('auiSelect2', [function() {
62+
function link($scope, element, attrs) {
63+
AJS.$(element).auiSelect2();
64+
}
65+
return {
66+
link: link
67+
};
68+
}]);

index.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
<head>
44
<script src="/bower_components/angular/angular.js"></script>
55

6-
<script type="text/javascript" src="src/directives.js"></script>
7-
<script type="text/javascript" src="src/angular-aui.js"></script>
6+
<script type="text/javascript" src="dist/angular-aui.js"></script>
87
<script type="text/javascript" src="index.js"></script>
98

109
<!-- AUI -->

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,19 @@
1010
"type": "git",
1111
"url": "https://github.com/OleksandrBezhan/angular-aui.git"
1212
},
13-
"author": "",
14-
"license": "ISC",
13+
"author": "[email protected]",
14+
"license": "MIT",
1515
"bugs": {
1616
"url": "https://github.com/OleksandrBezhan/angular-aui/issues"
1717
},
1818
"homepage": "https://github.com/OleksandrBezhan/angular-aui",
1919
"devDependencies": {
2020
"grunt": "^0.4.5",
2121
"grunt-bower-task": "^0.4.0",
22+
"grunt-contrib-concat": "^0.5.0",
2223
"grunt-contrib-connect": "^0.8.0",
2324
"grunt-contrib-uglify": "^0.6.0",
25+
"grunt-contrib-watch": "^0.6.1",
2426
"grunt-release": "^0.7.0"
2527
}
2628
}

0 commit comments

Comments
 (0)