Skip to content

Commit

Permalink
enable basic summernote
Browse files Browse the repository at this point in the history
  • Loading branch information
outsideris committed Jan 15, 2014
1 parent f135b22 commit adc7b1d
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .bowerrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"directory": "components"
"directory": "examples/components"
}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ tmp/
.project
.cache
.settings/

examples/components/
2 changes: 2 additions & 0 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
"components"
],
"dependencies": {
"summernote": "~0.5.0",
"angular": "~1.2.8"
},
"devDependencies": {}
}
27 changes: 27 additions & 0 deletions examples/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<!DOCTYPE html>
<html lang="en" ng-app="summernoteDemo">
<head>
<title>Angular-summernote Demo</title>

<!--summernote dependencies-->
<script src="components/jquery/jquery.min.js"></script>
<link rel="stylesheet" href="components/bootstrap/dist/css/bootstrap.min.css">
<script src="components/bootstrap/dist/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="components/font-awesome/css/font-awesome.min.css">

<!--summernote-->
<link rel="stylesheet" href="components/summernote/dist/summernote.css" />
<script src="components/summernote/dist/summernote.min.js"></script>

<!--angular-summernote dependencies -->
<script src="components/angular/angular.min.js"></script>
<script src="../src/angular-summernote.js"></script>
</head>
<body>
<summernote></summernote>

<script>
angular.module('summernoteDemo', ['summernote']);
</script>
</body>
</html>
30 changes: 30 additions & 0 deletions src/angular-summernote.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/**
* Copyright (c) 2013 JeongHoon Byun aka "Outsider", <http://blog.outsider.ne.kr/>
* Licensed under the MIT license.
* <http://outsider.mit-license.org/>
*/

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: '<div class="summernote"></div>',
link: function(scope, element, attrs, summernoteController) {
summernoteController.activate(scope, element);
}
};
}]);


0 comments on commit adc7b1d

Please sign in to comment.