From adc7b1d0cd9fb3f5a3dc1340f7e072e3f0df8805 Mon Sep 17 00:00:00 2001 From: Outsider Date: Wed, 15 Jan 2014 20:44:10 +0900 Subject: [PATCH] enable basic summernote --- .bowerrc | 2 +- .gitignore | 2 ++ bower.json | 2 ++ examples/index.html | 27 +++++++++++++++++++++++++++ src/angular-summernote.js | 30 ++++++++++++++++++++++++++++++ 5 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 examples/index.html create mode 100644 src/angular-summernote.js diff --git a/.bowerrc b/.bowerrc index cfacd73..130e4ff 100644 --- a/.bowerrc +++ b/.bowerrc @@ -1,3 +1,3 @@ { - "directory": "components" + "directory": "examples/components" } diff --git a/.gitignore b/.gitignore index c34ab48..4fd2753 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,5 @@ tmp/ .project .cache .settings/ + +examples/components/ diff --git a/bower.json b/bower.json index 94514c1..cb08d97 100644 --- a/bower.json +++ b/bower.json @@ -7,6 +7,8 @@ "components" ], "dependencies": { + "summernote": "~0.5.0", + "angular": "~1.2.8" }, "devDependencies": {} } diff --git a/examples/index.html b/examples/index.html new file mode 100644 index 0000000..787da9d --- /dev/null +++ b/examples/index.html @@ -0,0 +1,27 @@ + + + + Angular-summernote Demo + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/angular-summernote.js b/src/angular-summernote.js new file mode 100644 index 0000000..5c5de15 --- /dev/null +++ b/src/angular-summernote.js @@ -0,0 +1,30 @@ +/** + * Copyright (c) 2013 JeongHoon Byun aka "Outsider", + * Licensed under the MIT license. + * + */ + +angular.module('summernote', []) + + .controller('SummernoteController', ['$scope', '$attrs', function($scope, $attrs) { + + this.activate = function(scope, element) { + element.summernote(); + }; + + }]) + .directive('summernote', [function() { + return { + restrict: 'EA', + transclude: true, + replace: true, + controller: 'SummernoteController', + scope: {}, + template: '
', + link: function(scope, element, attrs, summernoteController) { + summernoteController.activate(scope, element); + } + }; + }]); + +