Skip to content

Commit ace2bfa

Browse files
committed
initial import
0 parents  commit ace2bfa

File tree

9 files changed

+199
-0
lines changed

9 files changed

+199
-0
lines changed

Diff for: .bowerrc

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"directory": "components"
3+
}

Diff for: .gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/nbproject/
2+
/node_modules/
3+
/build/
4+
/components/

Diff for: .jshintrc

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"node": true,
3+
"browser": true,
4+
"esnext": true,
5+
"bitwise": true,
6+
"camelcase": true,
7+
"curly": true,
8+
"eqeqeq": true,
9+
"immed": true,
10+
"indent": 2,
11+
"latedef": true,
12+
"newcap": true,
13+
"noarg": true,
14+
"quotmark": "single",
15+
"regexp": true,
16+
"undef": true,
17+
"unused": true,
18+
"strict": true,
19+
"trailing": true,
20+
"smarttabs": true,
21+
"predef": ["angular"]
22+
}

Diff for: bower.json

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"name": "adf-widget-markdown",
3+
"version": "0.1.0-SNAPSHOT",
4+
"main": "dist/adf-widget-markdown.js",
5+
"ignore": [
6+
"bower.json",
7+
".bowerrc",
8+
".jshintrc",
9+
".gitignore",
10+
"gulpfile.js",
11+
"node_modules",
12+
"package.json",
13+
"src"
14+
],
15+
"dependencies": {
16+
"angular-markdown-directive": "~0.1.0"
17+
}
18+
}

Diff for: gulpfile.js

+73
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
/*
2+
* The MIT License
3+
*
4+
* Copyright (c) 2015, Sebastian Sdorra
5+
*
6+
* Permission is hereby granted, free of charge, to any person obtaining a copy
7+
* of this software and associated documentation files (the "Software"), to deal
8+
* in the Software without restriction, including without limitation the rights
9+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
* copies of the Software, and to permit persons to whom the Software is
11+
* furnished to do so, subject to the following conditions:
12+
*
13+
* The above copyright notice and this permission notice shall be included in
14+
* all copies or substantial portions of the Software.
15+
*
16+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22+
* SOFTWARE.
23+
*/
24+
25+
26+
var gulp = require('gulp');
27+
var $ = require('gulp-load-plugins')();
28+
var rimraf = require('rimraf');
29+
var jsReporter = require('jshint-stylish');
30+
var pkg = require('./package.json');
31+
32+
var templateOptions = {
33+
root: '{widgetsPath}/markdown/src',
34+
module: 'adf.widget.markdown'
35+
};
36+
37+
gulp.task('csslint', function(){
38+
gulp.src('src/*.css')
39+
.pipe($.csslint())
40+
.pipe($.csslint.reporter());
41+
});
42+
43+
gulp.task('jslint', function(){
44+
gulp.src('src/*.js')
45+
.pipe($.jshint())
46+
.pipe($.jshint.reporter(jsReporter));
47+
});
48+
49+
gulp.task('lint', ['csslint', 'jslint']);
50+
51+
gulp.task('clean', function(cb){
52+
rimraf('dist', cb);
53+
});
54+
55+
gulp.task('css', function(){
56+
gulp.src('src/*.css')
57+
.pipe($.concat(pkg.name + '.min.css'))
58+
.pipe($.minifyCss())
59+
.pipe(gulp.dest('dist/'));
60+
});
61+
62+
gulp.task('js', function() {
63+
gulp.src(['src/*.js', 'src/*.html'])
64+
.pipe($.if('*.html', $.minifyHtml()))
65+
.pipe($.if('*.html', $.angularTemplatecache(pkg.name + '.tpl.js', templateOptions)))
66+
.pipe($.ngAnnotate())
67+
.pipe($.concat(pkg.name + '.min.js'))
68+
// https://github.com/olov/ng-annotate/issues/133
69+
//.pipe($.uglify())
70+
.pipe(gulp.dest('dist/'));
71+
});
72+
73+
gulp.task('default', ['css', 'js']);

Diff for: package.json

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"name": "adf-widget-markdown",
3+
"version": "0.1.0-SNAPSHOT",
4+
"repository": {
5+
"type": "git",
6+
"url": "https://github.com/sdorra/adf-widget-markdown"
7+
},
8+
"description": "Markdown widget for the angular-dashboard-framework",
9+
"devDependencies": {
10+
"gulp": "^3.8.10",
11+
"gulp-angular-templatecache": "^1.5.0",
12+
"gulp-concat": "^2.4.3",
13+
"gulp-csslint": "^0.1.5",
14+
"gulp-if": "^1.2.5",
15+
"gulp-jshint": "^1.9.0",
16+
"gulp-load-plugins": "^0.8.0",
17+
"gulp-minify-css": "^0.4.3",
18+
"gulp-minify-html": "^0.1.8",
19+
"gulp-ng-annotate": "^0.5.2",
20+
"gulp-uglify": "^1.1.0",
21+
"jshint-stylish": "^1.0.0",
22+
"rimraf": "^2.2.8",
23+
"ternary-stream": "^1.2.3",
24+
"through2": "^0.6.3"
25+
}
26+
}

Diff for: src/edit.html

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<form role="form">
2+
<div class="form-group">
3+
<label for="content">Markdown content</label>
4+
<textarea id="content" class="form-control" rows="5" ng-model="config.content"></textarea>
5+
</div>
6+
</form>

Diff for: src/markdown.js

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/*
2+
* The MIT License
3+
*
4+
* Copyright (c) 2015, Sebastian Sdorra
5+
*
6+
* Permission is hereby granted, free of charge, to any person obtaining a copy
7+
* of this software and associated documentation files (the "Software"), to deal
8+
* in the Software without restriction, including without limitation the rights
9+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
* copies of the Software, and to permit persons to whom the Software is
11+
* furnished to do so, subject to the following conditions:
12+
*
13+
* The above copyright notice and this permission notice shall be included in
14+
* all copies or substantial portions of the Software.
15+
*
16+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22+
* SOFTWARE.
23+
*/
24+
25+
'use strict';
26+
27+
angular.module('adf.widget.markdown', ['adf.provider', 'btford.markdown'])
28+
.config(function(dashboardProvider){
29+
dashboardProvider
30+
.widget('markdown', {
31+
title: 'Markdown',
32+
description: 'Markdown widget',
33+
controller: 'markdownCtrl',
34+
templateUrl: '{widgetPath}/markdown/src/view.html',
35+
edit: {
36+
templateUrl: '{widgetPath}/markdown/src/edit.html',
37+
reload: false
38+
}
39+
});
40+
}).controller('markdownCtrl', function($scope, config){
41+
if (!config.content){
42+
config.content = '';
43+
}
44+
$scope.config = config;
45+
});

Diff for: src/view.html

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<div class="markdown" btf-markdown="config.content">
2+
</div>

0 commit comments

Comments
 (0)