diff options
Diffstat (limited to 'node_modules/montage/ui/textarea.reel')
-rw-r--r-- | node_modules/montage/ui/textarea.reel/textarea.css | 26 | ||||
-rw-r--r-- | node_modules/montage/ui/textarea.reel/textarea.html | 14 | ||||
-rw-r--r-- | node_modules/montage/ui/textarea.reel/textarea.js | 125 |
3 files changed, 51 insertions, 114 deletions
diff --git a/node_modules/montage/ui/textarea.reel/textarea.css b/node_modules/montage/ui/textarea.reel/textarea.css new file mode 100644 index 00000000..67a9738d --- /dev/null +++ b/node_modules/montage/ui/textarea.reel/textarea.css | |||
@@ -0,0 +1,26 @@ | |||
1 | /* <copyright> | ||
2 | This file contains proprietary software owned by Motorola Mobility, Inc.<br/> | ||
3 | No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.<br/> | ||
4 | (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. | ||
5 | </copyright> */ | ||
6 | |||
7 | .montage-textarea { | ||
8 | outline: none; | ||
9 | box-sizing: border-box; | ||
10 | font-size: 12px; | ||
11 | width: 10em; | ||
12 | min-width: 10em; | ||
13 | padding: 0.5em; | ||
14 | resize: vertical; | ||
15 | border: 1px solid #b3b3b3; | ||
16 | border-radius: 3px; | ||
17 | background-color: #fff; | ||
18 | } | ||
19 | |||
20 | .montage-textarea:hover { | ||
21 | border-color: #ccc; | ||
22 | } | ||
23 | |||
24 | .montage-textarea:focus { | ||
25 | border-color: #7f7f7f; | ||
26 | } \ No newline at end of file | ||
diff --git a/node_modules/montage/ui/textarea.reel/textarea.html b/node_modules/montage/ui/textarea.reel/textarea.html new file mode 100644 index 00000000..d323bb53 --- /dev/null +++ b/node_modules/montage/ui/textarea.reel/textarea.html | |||
@@ -0,0 +1,14 @@ | |||
1 | <!DOCTYPE html> | ||
2 | <!-- <copyright> | ||
3 | This file contains proprietary software owned by Motorola Mobility, Inc.<br/> | ||
4 | No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.<br/> | ||
5 | (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. | ||
6 | </copyright> --> | ||
7 | <html> | ||
8 | <head> | ||
9 | <meta charset="utf-8"> | ||
10 | <link rel="stylesheet" href="textarea.css"> | ||
11 | </head> | ||
12 | <body> | ||
13 | </body> | ||
14 | </html> \ No newline at end of file | ||
diff --git a/node_modules/montage/ui/textarea.reel/textarea.js b/node_modules/montage/ui/textarea.reel/textarea.js index 4fa0d23e..bb0b6570 100644 --- a/node_modules/montage/ui/textarea.reel/textarea.js +++ b/node_modules/montage/ui/textarea.reel/textarea.js | |||
@@ -3,125 +3,22 @@ | |||
3 | No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.<br/> | 3 | No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.<br/> |
4 | (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. | 4 | (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. |
5 | </copyright> */ | 5 | </copyright> */ |
6 | 6 | /*global require,exports */ | |
7 | /** | ||
8 | @module "montage/ui/textarea.reel" | ||
9 | @requires montage/ui/component | ||
10 | @requires montage/ui/text-input | ||
11 | */ | ||
12 | |||
13 | var Montage = require("montage").Montage, | 7 | var Montage = require("montage").Montage, |
14 | Component = require("ui/component").Component, | 8 | Component = require("ui/component").Component, |
15 | TextInput = require("ui/text-input").TextInput; | 9 | NativeTextarea = require("ui/native/textarea.reel").Textarea; |
16 | 10 | ||
17 | /** | 11 | /** |
18 | * Wraps the a <textarea> element with binding support for the element's standard attributes. Uses an ArrayController instance to manage the element's contents and selection. | 12 | * Textarea |
19 | @class module:"montage/ui/textarea.reel".Textarea | ||
20 | @extends module:montage/text-input.TextInput | ||
21 | */ | 13 | */ |
14 | exports.Textarea = Montage.create(NativeTextarea, { | ||
22 | 15 | ||
23 | var Textarea = exports.Textarea = Montage.create(TextInput, /** @lends module:"montage/ui/textarea.reel".Textarea# */ { | 16 | hasTemplate: {value: true}, |
24 | |||
25 | select: { value: function() { this._element.select(); } }, | ||
26 | 17 | ||
27 | /** | 18 | didSetElement: { |
28 | The text display by the Textarea component's element. | 19 | value: function() { |
29 | @type {string} | 20 | NativeTextarea.didSetElement.call(this); |
30 | @default "" | 21 | this['class'] = (this['class'] || '') + ' montage-textarea'; |
31 | */ | ||
32 | textContent: { | ||
33 | get: function() { | ||
34 | return this.value; | ||
35 | }, | ||
36 | set: function(v) { | ||
37 | this.value = v; | ||
38 | } | 22 | } |
39 | } | 23 | } |
40 | 24 | }); \ No newline at end of file | |
41 | }); | ||
42 | |||
43 | Textarea.addAttributes( /** @lends module:"montage/ui/textarea.reel".Textarea# */ { | ||
44 | /** | ||
45 | Specifies whether the element should be focused as soon as the page is loaded. | ||
46 | @type {boolean} | ||
47 | @default false | ||
48 | */ | ||
49 | autofocus: {dataType: 'boolean'}, | ||
50 | |||
51 | /** | ||
52 | The maximum number of characters per line of text to display. | ||
53 | @type {number} | ||
54 | @default null | ||
55 | */ | ||
56 | cols: null, | ||
57 | |||
58 | /** | ||
59 | The name of the field that contains that value that specifies the element's directionality. | ||
60 | @type {string} | ||
61 | @default null | ||
62 | */ | ||
63 | dirname: null, | ||
64 | |||
65 | /** | ||
66 | When true, the textarea element is disabled to user input, and "disabled" is added to the element's CSS class list. | ||
67 | @type {boolean} | ||
68 | @default false | ||
69 | */ | ||
70 | disabled: {dataType: 'boolean'}, | ||
71 | |||
72 | /** | ||
73 | The value of the <code>id</code> attribute of the form with which to associate the component's element. | ||
74 | @type string} | ||
75 | @default null | ||
76 | */ | ||
77 | form: null, | ||
78 | |||
79 | /** | ||
80 | The maximum allowed value length of the element. | ||
81 | @type {number} | ||
82 | @default null | ||
83 | */ | ||
84 | maxlength: null, | ||
85 | |||
86 | /** | ||
87 | The name associated with the textarea element. | ||
88 | @type {string} | ||
89 | @default null | ||
90 | */ | ||
91 | name: null, | ||
92 | |||
93 | /** | ||
94 | Placeholder text to display in the textarea before the user has entered any text. | ||
95 | @type {string} | ||
96 | @default null | ||
97 | */ | ||
98 | placeholder: null, | ||
99 | |||
100 | /** | ||
101 | Specifies if this control is readonly. | ||
102 | @type {boolean} | ||
103 | @default false | ||
104 | */ | ||
105 | readonly: {dataType: 'boolean'}, | ||
106 | |||
107 | /** | ||
108 | When true, the user will be required to enter a value in the textarea before submitting the form. | ||
109 | @type {string} | ||
110 | @default false | ||
111 | */ | ||
112 | required: {dataType: 'boolean'}, | ||
113 | |||
114 | /** | ||
115 | The number of lines of text the browser should render for the textarea. | ||
116 | @type {number} | ||
117 | @default null | ||
118 | */ | ||
119 | rows: null, | ||
120 | |||
121 | /** | ||
122 | If the value of this property is "hard", the browser will insert line breaks such that each line of user input has no more characters than the value specified by the <code>cols</code> property. If the value is "soft" then no line breaks will be added. | ||
123 | @type {string} | ||
124 | @default | ||
125 | */ | ||
126 | wrap: null | ||
127 | }); | ||