Skip to content

Commit

Permalink
Merge branch 'release/1.5.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
KillerCodeMonkey committed Jun 11, 2016
2 parents 4c0c398 + dd092f7 commit cf5da6a
Show file tree
Hide file tree
Showing 6 changed files with 280 additions and 237 deletions.
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@ Installation
- or download zip from release page: https://github.com/KillerCodeMonkey/ngQuill/releases


Breaking Changes since 1.5.0
============================

- usage of AngularJS >1.5.6
- the editor directive is now a component
- all two way bindings are now one-way bindings
- read-only is a simple one-way data binding, too (previously an function binding '&')

Contribution
============

Expand Down Expand Up @@ -41,7 +49,7 @@ Configuration
- customized error class added to editors container div: `error-class="input-error"`
- set save format: `save="html"` (default: 'html', supports 'html', 'text', 'contents')
- set theme name: `theme="snow"` (default: 'snow')
- set readOnly: `read-only=""` (default: false) - requires function to be executed
- set readOnly: `read-only=""` (default: false) - requires true or false
- set translations: `translations="dict.editor"` (object with editor translations -> default is english)
- overwrite global config for each editor: `fontsize-options="fontsizeOptions" fontfamily-options="fontfamilyOptions"`
- name: `name="editoreName"` (optional, String) --> editor name is passed to the editorCreated event if set
Expand Down
4 changes: 2 additions & 2 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ngQuill",
"version": "1.4.4",
"version": "1.5.0",
"main": ["src/ng-quill.min.js"],
"description": "AngularJS directive for the QuillJS rich text editor",
"authors": [
Expand All @@ -16,7 +16,7 @@
],
"dependencies": {
"quill": "0.20.1",
"angular": "^1.4.7"
"angular": "^1.5.6"
},
"keywords": [
"quill",
Expand Down
31 changes: 26 additions & 5 deletions demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
</style>

<!-- Scripts -->
<script type="text/javascript" src="//code.angularjs.org/1.5.6/angular.min.js"></script>
<script type="text/javascript" src="//cdn.quilljs.com/0.20.1/quill.js"></script>
<script type="text/javascript" src="//code.angularjs.org/1.4.7/angular.min.js"></script>
<script type="text/javascript" src="src/ng-quill.js"></script>
<script>
// declare a module and load quillModule
Expand Down Expand Up @@ -66,8 +66,11 @@
}]);
myAppModule.controller('AppCtrl', [
'$scope',
'$timeout',
'ngQuillConfig',
function($scope, ngQuillConfig) {
function($scope, $timeout, ngQuillConfig) {

$scope.message = 'Test';

$scope.showToolbar = true;

Expand All @@ -82,20 +85,38 @@
$scope.editorCallback = function (editor, name) {
console.log('createCallback', editor, name);
};

$scope.readOnly = false;

$scope.isReadonly = function () {
return $scope.readOnly;
};

$scope.clear = function () {
return $scope.message = '';
};

// Event after an editor is created --> gets the editor instance on optional the editor name if set
$scope.$on('editorCreated', function (event, editor, name) {
console.log('createEvent', editor, name);
});

$timeout(function () {
$scope.message = 'Async Test content';
console.log($scope.message);
}, 3000);
}
]);

</script>

<body ng-app="quillTest" ng-strict-di ng-controller="AppCtrl">
<button ng-click="toggle()">Toggle toolbar</button>
<body ng-app="quillTest" ng-controller="AppCtrl">
<button ng-click="toggle()">Toggle toolbar</button><button ng-click="readOnly = !readOnly">Toggle readonly</button><button ng-click="clear()">clear model</button>
<div style="width: 500px; height: 300px;">
<ng-quill-editor name="editor1" callback="editorCallback(editor, name)" ng-model="message" translations="translations" toolbar="true" show-toolbar="showToolbar" link-tooltip="true" image-tooltip="true" toolbar-entries="font size bold list bullet italic underline strike align color background link image" editor-required="true" required="" error-class="input-error"
<ng-quill-editor name="editor1" callback="editorCallback(editor, name)" ng-model="message" translations="translations" toolbar="true" show-toolbar="showToolbar" link-tooltip="true" image-tooltip="true" toolbar-entries="font size bold list bullet italic underline strike align color background link image" editor-required="true" required="" read-only="isReadonly()" error-class="input-error"
fontsize-options="fontsizeOptions" fontfamily-options="fontfamilyOptions"></ng-quill-editor>
</div>

<b>current value</b><pre>{{message}}</pre>
</body>
</html>
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ng-quill",
"version": "1.4.4",
"version": "1.5.0",
"description": "Angular directive for rich text editor Quill",
"author": "Bengt Weiße <[email protected]>",
"homepage": "https://github.com/KillerCodeMonkey/ngQuill",
Expand All @@ -14,7 +14,7 @@
},
"dependencies": {
"quill": "0.20.1",
"angular": "^1.4.7"
"angular": "^1.5.6"
},
"license": "MIT",
"repository": {
Expand Down
Loading

0 comments on commit cf5da6a

Please sign in to comment.