forked from KillerCodeMonkey/ng-quill
-
Notifications
You must be signed in to change notification settings - Fork 0
/
demo.html
93 lines (86 loc) · 3.49 KB
/
demo.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
<html>
<head>
<title>Quill Test</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta charset="utf-8">
<!-- Style -->
<link rel="stylesheet" href="bower_components/quill/dist/quill.snow.css">
<style>
.input-error {
border: 2px dashed red;
}
</style>
<!-- Scripts -->
<script type="text/javascript" src="bower_components/quill/dist/quill.js"></script>
<script type="text/javascript" src="bower_components/angular/angular.min.js"></script>
<script type="text/javascript" src="src/ng-quill.js"></script>
<script>
// declare a module and load quillModule
var myAppModule = angular.module('quillTest', ['ngQuill']);
myAppModule.config(['ngQuillConfigProvider', function (ngQuillConfigProvider) {
ngQuillConfigProvider.set([{
alias: '10',
size: '10px'
}, {
alias: '12',
size: '12px'
}, {
alias: '14',
size: '14px'
}, {
alias: '16',
size: '16px'
}, {
alias: '18',
size: '18px'
}, {
alias: '20',
size: '20px'
}, {
alias: '22',
size: '22px'
}, {
alias: '24',
size: '24px'
}], [{
label: 'Arial',
alias: 'Arial'
}, {
label: 'Sans Serif',
alias: 'sans-serif'
}, {
label: 'Serif',
alias: 'serif'
}, {
label: 'Monospace',
alias: 'monospace'
}, {
label: 'Trebuchet MS',
alias: '"Trebuchet MS"'
}, {
label: 'Verdana',
alias: 'Verdana'
}])
}]);
myAppModule.controller('AppCtrl', [
'$scope',
'ngQuillConfig',
function($scope, ngQuillConfig) {
$scope.showToolbar = true;
$scope.translations = angular.extend({}, ngQuillConfig.translations, {
10: 'smallest'
});
$scope.toggle = function() {
$scope.showToolbar = !$scope.showToolbar;
};
}
]);
</script>
<body ng-app="quillTest" ng-strict-di ng-controller="AppCtrl">
<button ng-click="toggle()">Toggle toolbar</button>
<div style="width: 500px; height: 300px;">
<ng-quill-editor 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"
fontsize-options="fontsizeOptions" fontfamily-options="fontfamilyOptions"></ng-quill-editor>
</div>
</body>
</html>