forked from textAngular/textAngular
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdemo.html
60 lines (47 loc) · 2.63 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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>textAngular 1.1.2 Demo</title>
<meta name="robots" content="noindex">
<link rel='stylesheet prefetch' href='http://netdna.bootstrapcdn.com/bootstrap/3.0.1/css/bootstrap.min.css'>
<link rel='stylesheet prefetch' href='http://netdna.bootstrapcdn.com/font-awesome/4.0.0/css/font-awesome.min.css'>
<style>
.ta-editor {
min-height: 300px;
height: auto;
overflow: auto;
font-family: inherit;
font-size: 100%;
}
</style>
</head>
<body>
<div ng-app="textAngularTest" ng-controller="wysiwygeditor" class="container app">
<h1>Editor</h1>
<button ng-click="disabled = !disabled" unselectable>Disable text-angular Toggle</button>
<div text-angular="text-angular" name="htmlcontent" ng-model="htmlcontent" ta-disabled='disabled'></div>
<h1>Raw HTML in a text area</h1>
<textarea ng-model="htmlcontent" style="width: 100%"></textarea>
<h1>Bound with ng-bind-html</h1>
<div ng-bind-html="htmlcontent"></div>
<h1>Bound with ta-bind, our internal html-binding directive</h1>
<div ta-bind="text" ng-model="htmlcontent" ta-readonly='disabled'></div>
<button type="button" ng-click="htmlcontent = orightml">Reset</button>
<p>Note: although we support classes and styles, angularjs' ng-bind-html directive will strip out all style attributes.</p>
<h1>Option to masquerade as a fancy text-area - complete with form submission and optional ngModel</h1>
<text-angular name="htmlcontent"><p>Any <b>HTML</b> we put in-between the text-angular tags gets automatically put into the editor if there <strong style="font-size: 12pt;"><u><em>is not</em></u></strong> a ngModel</p></text-angular>
</div>
<script src='https://ajax.googleapis.com/ajax/libs/angularjs/1.2.4/angular.min.js'></script>
<script src='https://ajax.googleapis.com/ajax/libs/angularjs/1.2.4/angular-sanitize.min.js'></script>
<script src='textAngular.js'></script>
<script type="text/javascript">
angular.module("textAngularTest", ['textAngular']);
function wysiwygeditor($scope) {
$scope.orightml = '<h2>Try me!</h2><p>textAngular is a super cool WYSIWYG Text Editor directive for AngularJS</p><p><b>Features:</b></p><ol><li>Automatic Seamless Two-Way-Binding</li><li>Super Easy <b>Theming</b> Options</li><li style="color: green;">Simple Editor Instance Creation</li><li>Safely Parses Html for Custom Toolbar Icons</li><li class="text-danger">Doesn't Use an iFrame</li><li>Works with Firefox, Chrome, and IE8+</li></ol><p><b>Code at GitHub:</b> <a href="https://github.com/fraywing/textAngular">Here</a> </p>';
$scope.htmlcontent = $scope.orightml;
$scope.disabled = false;
};
</script>
</body>
</html>