Skip to content
This repository was archived by the owner on Sep 8, 2020. It is now read-only.

Commit 5e676bc

Browse files
committed
Updated README
1 parent a8f1013 commit 5e676bc

File tree

1 file changed

+24
-48
lines changed

1 file changed

+24
-48
lines changed

README.md

Lines changed: 24 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,98 +1,74 @@
11
# ui-date directive [![Build Status](https://travis-ci.org/angular-ui/ui-tinymce.png)](https://travis-ci.org/angular-ui/ui-tinymce)
22

3-
This directive allows you to add a date-picker to your form elements.
3+
This directive allows you to add a TinyMCE editor to your form elements.
44

55
# Requirements
66

77
- AngularJS
8-
- JQuery
9-
- JQueryUI
10-
- [Date.toISOString()](https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Date/toISOString) (requires [polyfill](https://github.com/kriskowal/es5-shim/) for ≤IE8)
8+
- TinyMCE 3
119

1210
# Testing
1311

14-
We use testacular and jshint to ensure the quality of the code. The easiest way to run these checks is to use grunt:
12+
We use karma and jshint to ensure the quality of the code. The easiest way to run these checks is to use grunt:
1513

1614
npm install -g grunt-cli
1715
npm install
1816
bower install
1917
grunt
2018

21-
The testacular task will try to open Chrome as a browser in which to run the tests. Make sure this is available or change the configuration in `test\test.config.js`
19+
The karma task will try to open Chrome as a browser in which to run the tests. Make sure this is available or change the configuration in `test\test.config.js`
2220

2321
# Usage
2422

2523
We use [bower](http://twitter.github.com/bower/) for dependency management. Add
2624

2725
dependencies: {
28-
"angular-ui-date": "latest"
26+
"angular-ui-tinymce": "latest"
2927
}
3028

3129
To your `components.json` file. Then run
3230

3331
bower install
3432

35-
This will copy the ui-date files into your `components` folder, along with its dependencies. Load the script files in your application:
33+
This will copy the ui-tinymce files into your `components` folder, along with its dependencies. Load the script files in your application:
3634

37-
<script type="text/javascript" src="components/jquery/jquery.js"></script>
38-
<script type="text/javascript" src="components/jquery-ui\ui\jquery-ui.custom.js"></script>
35+
<script type="text/javascript" src="components/tinymce/tinymce.js"></script>
3936
<script type="text/javascript" src="components/angular/angular.js"></script>
40-
<script type="text/javascript" src="components/angular-ui-date/date.js"></script>
37+
<script type="text/javascript" src="components/angular-ui-tinymce/tinymce.js"></script>
4138

4239
Add the date module as a dependency to your application module:
4340

44-
var myAppModule = angular.module('MyApp', ['ui.date'])
41+
var myAppModule = angular.module('MyApp', ['ui.tinymce'])
4542

4643
Apply the directive to your form elements:
4744

48-
<input ui-date>
45+
<form method="post">
46+
<textarea id="tinymce" ui-tinymce ng-model="tinymceModel"></textarea>
47+
</form>
4948

5049
## Options
5150

52-
All the jQueryUI DatePicker options can be passed through the directive.
51+
All the TinyMCE options can be passed through the directive.
5352

5453
myAppModule.controller('MyController', function($scope) {
55-
$scope.dateOptions = {
56-
changeYear: true,
57-
changeMonth: true,
58-
yearRange: '1900:-0'
54+
$scope.tinymceOptions = {
55+
handle_event_callback: function (e) {
56+
// put logic here for keypress
57+
}
5958
};
6059
});
6160

62-
<input ui-date="dateOptions" name="DateOfBirth">
63-
64-
## Static Inline Picker
65-
66-
If you want a static picker then simply apply the directive to a div rather than an input element.
67-
68-
<div ui-date="dateOptions" name="DateOfBirth"></div>
61+
<form method="post">
62+
<textarea id="tinymce" ui-tinymce ng-model="tinymceModel"></textarea>
63+
</form>
6964

7065
## Working with ng-model
7166

72-
The ui-date directive plays nicely with ng-model and validation directives such as ng-required.
73-
74-
If you add the ng-model directive to same the element as ui-date then the picked date is automatically synchronized with the model value.
75-
76-
_The ui-date directive stores and expects the model value to be a standard javascript Date object._
77-
78-
## ui-date-format directive
79-
The ui-date directive only works with Date objects.
80-
If you want to pass date strings to and from the date directive via ng-model then you must use the ui-date-format directive.
81-
This directive specifies the format of the date string that will be expected in the ng-model.
82-
The format string syntax is that defined by the JQueryUI Date picker. For example
67+
The ui-date directive plays nicely with the ng-model directive such as ng-required.
8368

84-
<input ui-date ui-date-format="DD, d MM, yy" ng-model="myDate">
69+
If you add the ng-model directive to same the element as ui-tinymce then the text in the editor is automatically synchronized with the model value.
8570

86-
Now you can set myDate in the controller.
87-
88-
$scope.myDate = "Thursday, 11 October, 2012";
89-
90-
## ng-required directive
91-
92-
If you apply the required directive to element then the form element is invalid until a date is picked.
93-
94-
Note: Remember that the ng-required directive must be explictly set, i.e. to "true". This is especially true on divs:
95-
96-
<div ui-date="dateOptions" name="DateOfBirth" ng-required="true"></div>
71+
_ng-model and the id are required_.
9772

73+
_The ui-date directive stores and expects the model value to be a standard javascript Date object._
9874

0 commit comments

Comments
 (0)