rad_common_interface 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -0
- data/app/static/demo/images/img1.jpg +0 -0
- data/app/static/demo/images/img1_200.jpg +0 -0
- data/app/static/demo/images/img1_icon.jpg +0 -0
- data/app/static/demo/images/img1_thumb.jpg +0 -0
- data/app/static/demo/images/img2.jpg +0 -0
- data/app/static/demo/images/img2_200.jpg +0 -0
- data/app/static/demo/images/img2_icon.jpg +0 -0
- data/app/static/demo/images/img2_thumb.jpg +0 -0
- data/app/static/demo/images/img3.jpg +0 -0
- data/app/static/demo/images/img3_200.jpg +0 -0
- data/app/static/demo/images/img3_icon.jpg +0 -0
- data/app/static/demo/images/img3_thumb.jpg +0 -0
- data/app/static/demo/images/img_big.jpg +0 -0
- data/app/static/demo/images/img_big_icon.jpg +0 -0
- data/app/static/demo/images/img_big_thum.jpg +0 -0
- data/app/static/demo/images/video_icon.png +0 -0
- data/app/static/face/attachments.js +85 -0
- data/app/static/face/dialogs.js +189 -0
- data/app/static/face/discussion.js +47 -0
- data/app/static/face/markup.js +53 -0
- data/app/static/face/more.js +33 -0
- data/app/static/face/table.js +24 -0
- data/app/static/face/tabs.js +26 -0
- data/app/static/face.css +8 -0
- data/app/static/face.js +109 -0
- data/app/static/lib/SimpleDialog/SimpleDialog.ContextMenu.js +36 -0
- data/app/static/lib/SimpleDialog/SimpleDialog.Image.js +121 -0
- data/app/static/lib/SimpleDialog/SimpleDialog.Mask.js +76 -0
- data/app/static/lib/SimpleDialog/SimpleDialog.Static.js +0 -0
- data/app/static/lib/SimpleDialog/SimpleDialog.css +12 -0
- data/app/static/lib/SimpleDialog/SimpleDialog.js +158 -0
- data/app/static/lib/ajax_file_uploading.js +33 -0
- data/app/static/themes/default/reset.css +127 -0
- data/app/static/themes/default/style/application.less +51 -0
- data/app/static/themes/default/style/aspects.less +15 -0
- data/app/static/themes/default/style/basic.less +49 -0
- data/app/static/themes/default/style/forms.less +34 -0
- data/app/static/themes/default/style/items.less +43 -0
- data/app/static/themes/default/style/markup.less +16 -0
- data/app/static/themes/default/style/micelaneous.less +10 -0
- data/app/static/themes/default/style/mixins.less +72 -0
- data/app/static/themes/default/style/styles.less +57 -0
- data/app/static/themes/default/style/tools.less +15 -0
- data/app/static/themes/default/style/variables.less +38 -0
- data/app/static/themes/default/style.css +944 -0
- data/app/static/themes/default/style.js +127 -0
- data/app/static/themes/default/style.less +22 -0
- data/app/static/vendor/flext.js +254 -0
- data/app/static/vendor/formalize/formalize.css +311 -0
- data/app/static/vendor/formalize/mootools.formalize.js +163 -0
- data/app/static/vendor/formalize/reset.css +171 -0
- data/app/static/vendor/iFrameFormRequest.js +95 -0
- data/app/static/vendor/mootools-more.js +4185 -0
- data/app/static/vendor/purr/purr.css +43 -0
- data/app/static/vendor/purr/purr.js +308 -0
- data/app/views/face/_attachments_tag.html.haml +17 -0
- data/app/views/rad/face/demo/commons/aspects.html.haml +32 -0
- data/app/views/rad/face/demo/commons/basic.html.haml +86 -0
- data/app/views/rad/face/demo/commons/forms.html.haml +57 -0
- data/app/views/rad/face/demo/commons/items.html.haml +32 -0
- data/app/views/rad/face/demo/commons/style.html.erb +111 -0
- data/app/views/rad/face/demo/dialogs/dialog.js.haml +1 -0
- data/app/views/rad/face/demo/dialogs/dialog_form.html.haml +7 -0
- data/app/views/rad/face/demo/dialogs/dialog_form.js.erb +1 -0
- data/app/views/rad/face/demo/dialogs/inplace/_element.html.haml +3 -0
- data/app/views/rad/face/demo/dialogs/inplace/_form.html.haml +3 -0
- data/app/views/rad/face/demo/dialogs/inplace.js.haml +1 -0
- data/app/views/rad/face/demo/dialogs/inplace_form.js.haml +2 -0
- data/app/views/rad/face/demo/dialogs/show.html.haml +27 -0
- data/app/views/rad/face/demo/helps/help.html.haml +1 -0
- data/app/views/rad/face/demo/helps/index.html.haml +25 -0
- data/app/views/rad/face/demo/layout.html.haml +3 -0
- data/app/views/rad/face/demo/layout.js.haml +11 -0
- data/app/views/rad/face/demo/shared/_comments.html.haml +11 -0
- data/app/views/rad/face/demo/shared/_core_tools.html.haml +6 -0
- data/app/views/rad/face/demo/shared/_line_previews.html.haml +40 -0
- data/app/views/rad/face/demo/shared/_paginator.html.haml +7 -0
- data/app/views/rad/face/demo/shared/_tools.html.haml +25 -0
- data/app/views/rad/face/demo/shared/_top_navigation_bottom.html.haml +34 -0
- data/app/views/rad/face/demo/sites/blog.html.haml +12 -0
- data/app/views/rad/face/demo/sites/home.html.haml +8 -0
- data/app/views/rad/face/demo/sites/post.html.haml +10 -0
- data/app/views/rad/face/demo/sites/style.html.haml +8 -0
- data/app/views/themes/default/application.html.haml +25 -0
- data/app/views/themes/default/basic_list.html.haml +2 -0
- data/app/views/themes/default/basic_list_item.html.haml +5 -0
- data/app/views/themes/default/bottom_panel.html.haml +16 -0
- data/app/views/themes/default/comment.html.haml +20 -0
- data/app/views/themes/default/controls.html.haml +3 -0
- data/app/views/themes/default/demo_metadata.rb +118 -0
- data/app/views/themes/default/details.html.haml +6 -0
- data/app/views/themes/default/discussion.html.haml +7 -0
- data/app/views/themes/default/divider.html.haml +2 -0
- data/app/views/themes/default/forms/errors.html.haml +4 -0
- data/app/views/themes/default/forms/field.html.haml +18 -0
- data/app/views/themes/default/forms/form.html.haml +4 -0
- data/app/views/themes/default/forms/line.html.haml +8 -0
- data/app/views/themes/default/help.html.haml +3 -0
- data/app/views/themes/default/html.html.haml +1 -0
- data/app/views/themes/default/index.html.haml +6 -0
- data/app/views/themes/default/item.html.haml +12 -0
- data/app/views/themes/default/layout_templates/dashboard.html.haml +1 -0
- data/app/views/themes/default/layout_templates/default.html.haml +22 -0
- data/app/views/themes/default/line.html.haml +21 -0
- data/app/views/themes/default/message.html.haml +2 -0
- data/app/views/themes/default/more.html.haml +8 -0
- data/app/views/themes/default/narrow.html.haml +2 -0
- data/app/views/themes/default/navigation.html.haml +16 -0
- data/app/views/themes/default/paginator.html.haml +8 -0
- data/app/views/themes/default/shared/details.html.haml +17 -0
- data/app/views/themes/default/table.html.haml +9 -0
- data/app/views/themes/default/table_row.html.haml +4 -0
- data/app/views/themes/default/tabs.html.haml +27 -0
- data/app/views/themes/default/tag_selector.html.haml +10 -0
- data/app/views/themes/default/text.html.haml +4 -0
- data/app/views/themes/default/thumb.html.haml +10 -0
- data/app/views/themes/default/title.html.haml +3 -0
- data/app/views/themes/default/tool.html.haml +5 -0
- data/app/views/themes/default/toolbar.html.haml +16 -0
- data/app/views/themes/default/top_panel.html.haml +18 -0
- metadata +153 -25
@@ -0,0 +1,127 @@
|
|
1
|
+
// //
|
2
|
+
// // Css
|
3
|
+
// //
|
4
|
+
// css.add({
|
5
|
+
// // App layout
|
6
|
+
// // '.the_aspects': {autoWidth: '.the_tools'},
|
7
|
+
// // '.the_content': {autoWidth: '.the_tools'},
|
8
|
+
// // '.the_bottom_panel': {clear: 'before'},
|
9
|
+
// });
|
10
|
+
// (function(){
|
11
|
+
// // max-width
|
12
|
+
// var maxWidth = 1024;
|
13
|
+
// var increaseProperty = function(e, style, value){e.setStyle(style, e.getStyle(style).toInt() + value);};
|
14
|
+
// var updateMargin = function(diff){
|
15
|
+
// // aspects, content, tools
|
16
|
+
// var left = $$('.the_content, .the_aspects');
|
17
|
+
// var right = $$('.the_tools');
|
18
|
+
// if(right.blank()) right = left;
|
19
|
+
// left.each(function(e){increaseProperty(e, 'margin-left', diff)});
|
20
|
+
// right.each(function(e){increaseProperty(e, 'margin-right', diff)});
|
21
|
+
//
|
22
|
+
// // panels
|
23
|
+
// $$('.the_top_panel .l_left, .the_bottom_panel .l_left, .the_navigation').each(
|
24
|
+
// function(e){increaseProperty(e, 'margin-left', diff)}
|
25
|
+
// );
|
26
|
+
// $$('.the_top_panel .l_right, .the_bottom_panel .l_right').each(
|
27
|
+
// function(e){increaseProperty(e, 'margin-right', diff)}
|
28
|
+
// );
|
29
|
+
// };
|
30
|
+
//
|
31
|
+
// css.customCss = function(){
|
32
|
+
// // show tools
|
33
|
+
// $$('.the_top_panel, .the_bottom_panel, .the_navigation, .the_tools, .the_aspects').show();
|
34
|
+
//
|
35
|
+
// // max-width
|
36
|
+
// var previousDiff = window.retrieve('previousDiff') || 0;
|
37
|
+
// var diff = ((window.getSize().x - maxWidth) / 2).toInt();
|
38
|
+
// var diff = diff < 0 ? 0 : diff;
|
39
|
+
// diff = diff - previousDiff;
|
40
|
+
// if((diff + previousDiff) >= 0){
|
41
|
+
// p(diff)
|
42
|
+
// window.store('previousDiff', diff + previousDiff);
|
43
|
+
// updateMargin(diff);
|
44
|
+
// };
|
45
|
+
//
|
46
|
+
//
|
47
|
+
// // // hack for top & bottom panels outside background
|
48
|
+
// // (function(){
|
49
|
+
// // (['the_top_panel', 'the_bottom_panel']).each(function(name){
|
50
|
+
// // var hack_class = name + '_hack';
|
51
|
+
// // var panel = $$('.' + name).first();
|
52
|
+
// // var hack = $$('body > .' + hack_class).first();
|
53
|
+
// // if(panel){
|
54
|
+
// // if(!hack){
|
55
|
+
// // hack = new Element('div', {'class': hack_class});
|
56
|
+
// // hack.inject(document.body);
|
57
|
+
// // }
|
58
|
+
// // hack.setStyles({'height': panel.getSize().y, 'top': panel.getPosition().y});
|
59
|
+
// // }else if (hack){
|
60
|
+
// // hack.destroy();
|
61
|
+
// // }
|
62
|
+
// // });
|
63
|
+
// // }.delay(10));
|
64
|
+
// };
|
65
|
+
// })();
|
66
|
+
//
|
67
|
+
// window.addEvent('updateStyle', function(){
|
68
|
+
// css.removeClearfixes();
|
69
|
+
// css.customCss();
|
70
|
+
// css.addClearfixes();
|
71
|
+
// css.updateCss();
|
72
|
+
// });
|
73
|
+
|
74
|
+
|
75
|
+
//
|
76
|
+
// Initializers
|
77
|
+
//
|
78
|
+
window.addEvent('updateStyle', function(){
|
79
|
+
// Discussion
|
80
|
+
var discussion = $$('.the_discussion').first();
|
81
|
+
if(discussion && discussion.getElement('.the_comment')){
|
82
|
+
var divider = discussion.getElement('.the_divider')
|
83
|
+
if(divider) divider.show();
|
84
|
+
};
|
85
|
+
|
86
|
+
// Hover Controls
|
87
|
+
$$('.m_hover_controls').applyOnce('m_hover_controls', function(e){
|
88
|
+
var parent = e.getParent();
|
89
|
+
parent.setStyle('position', 'relative');
|
90
|
+
parent.hover(
|
91
|
+
function(){e.show()},
|
92
|
+
function(){e.hide()}
|
93
|
+
);
|
94
|
+
});
|
95
|
+
|
96
|
+
// Border around Items
|
97
|
+
$$('.m_selectable').applyOnce('m_selectable', function(e){
|
98
|
+
e.hover(
|
99
|
+
function(){this.addClass('m_selectable_hover')},
|
100
|
+
function(){this.removeClass('m_selectable_hover')}
|
101
|
+
);
|
102
|
+
});
|
103
|
+
|
104
|
+
// Development only
|
105
|
+
// $$('*').each(function(e){
|
106
|
+
// if(e.classNames().any(function(c){return c.match(/the_/)})){
|
107
|
+
// e.addClass('dev_border');
|
108
|
+
// };
|
109
|
+
// });
|
110
|
+
});
|
111
|
+
|
112
|
+
// //
|
113
|
+
// // Folder
|
114
|
+
// //
|
115
|
+
// // Empty title
|
116
|
+
// $.addOnceForElementEvent('update', 'empty_folder_title', '.folder', function(){
|
117
|
+
// $(this).hover(
|
118
|
+
// function(){
|
119
|
+
// $(this).find('> .empty_title').show()
|
120
|
+
// },
|
121
|
+
// function(){
|
122
|
+
// $(this).find('> .empty_title').hide()
|
123
|
+
// }
|
124
|
+
// );
|
125
|
+
// });
|
126
|
+
//
|
127
|
+
//
|
@@ -0,0 +1,22 @@
|
|
1
|
+
/*
|
2
|
+
Naming convention:
|
3
|
+
- global styles have 'the' prefix
|
4
|
+
- local styles have 'l' (local) prefix
|
5
|
+
- mixins have 'm' (mixin) prefix
|
6
|
+
|
7
|
+
- internal structural mixins have 't' (template) prefix
|
8
|
+
- internal style mixins have 's' (style) prefix
|
9
|
+
*/
|
10
|
+
|
11
|
+
@import "style/variables";
|
12
|
+
@import "style/styles";
|
13
|
+
@import "style/mixins";
|
14
|
+
|
15
|
+
@import "style/markup";
|
16
|
+
@import "style/application";
|
17
|
+
@import "style/aspects";
|
18
|
+
@import "style/basic";
|
19
|
+
@import "style/micelaneous";
|
20
|
+
@import "style/forms";
|
21
|
+
@import "style/items";
|
22
|
+
@import "style/tools";
|
@@ -0,0 +1,254 @@
|
|
1
|
+
/*
|
2
|
+
* Flext - A Mootools Based Flexible TextArea Class
|
3
|
+
* version 1.1 - for mootools 1.2
|
4
|
+
* by Graham McNicoll
|
5
|
+
*
|
6
|
+
* Copyright 2008-2009 - Education.com
|
7
|
+
* License: MIT-style license.
|
8
|
+
*
|
9
|
+
* Features:
|
10
|
+
* - Grows text areas when needed
|
11
|
+
* - Can set a max height to grow to
|
12
|
+
* - Grows parents if they have a fixed height
|
13
|
+
* - Ghost text replacement
|
14
|
+
* - Text input emulation (enter can submit form, instead of new line)
|
15
|
+
*
|
16
|
+
* Usage:
|
17
|
+
*
|
18
|
+
* include the source somewhere on your page. Textareas must have the class name: 'flext'
|
19
|
+
* for the class to watch them. Use additional class names to trigger features.
|
20
|
+
*
|
21
|
+
* 'growme' - grow the text area
|
22
|
+
* 'maxheight-[num]' - the max height to grow in pixels (replaces [num] )
|
23
|
+
* 'stopenter' - stop the enter key
|
24
|
+
* 'entersubmits' - submit the form when enter is pressed
|
25
|
+
* 'replaceghosttext' - tries to use the ghosted text features
|
26
|
+
* 'growparents' - grow the parent elements if needed
|
27
|
+
*
|
28
|
+
* if replaceghosttext is on, then you need to add two more attributes to the textarea.
|
29
|
+
* 'ghosttext' contains a copy of the original ghost text (needed for matching initial conditions),
|
30
|
+
* and 'ghostclass' which contains a class name to remove when the ghosting is removed (which
|
31
|
+
* is used to remove ghosting color).
|
32
|
+
*
|
33
|
+
* Examples:
|
34
|
+
*
|
35
|
+
* A simple growing text area: -
|
36
|
+
*
|
37
|
+
* <textarea name='mytext' class='flext growme maxheight-200' ></textarea>
|
38
|
+
*
|
39
|
+
* It will find this text area by the class name, 'flext', and the 'growme'
|
40
|
+
* class will tell it to grow until the max size, as given by the 'maxheight-[num]'
|
41
|
+
* class (integer, in pixels).
|
42
|
+
*
|
43
|
+
* Textarea which will grow the parent elements (if needed) -
|
44
|
+
*
|
45
|
+
* <textarea name='mytext' class='flext growme growparents maxheight-200' ></textarea>
|
46
|
+
*
|
47
|
+
* This is the same as above, except it will also grow any parent elements which
|
48
|
+
* have fixed heights when the textarea expands ('growparents').
|
49
|
+
*
|
50
|
+
*
|
51
|
+
* Adv. example:
|
52
|
+
*
|
53
|
+
* <textarea name='mytext' class='flext growme stopenter entersubmits replaceghosttext ghost-text growparents maxheight-60' ghosttext='enter something here' ghostclass='ghost-text'>
|
54
|
+
* enter something here
|
55
|
+
* </textarea>
|
56
|
+
*
|
57
|
+
* This example not only grows, but simulates a text input, in that 'enter'
|
58
|
+
* will not be passed to the textarea ('stopenter') instead it will submit
|
59
|
+
* the form ('entersubmits'). It also has ghosted text replacement and class
|
60
|
+
* changing. When this textarea receives focus, it will remove the default
|
61
|
+
* text (ghosttext property), and remove the class as specified by the
|
62
|
+
* ghostclass property. Use of these features as currently coded requires
|
63
|
+
* non valid xhtml, so dont use it if you require valid markup. (its on my list to fix)
|
64
|
+
*
|
65
|
+
* You can also instantiate this class manually, by leaving off the 'flext' class from
|
66
|
+
* any textareas, and instantiate a new class usual with the first variable being the
|
67
|
+
* textarea element, and the second the options object.
|
68
|
+
*/
|
69
|
+
|
70
|
+
|
71
|
+
|
72
|
+
var Flext = new Class({
|
73
|
+
Implements: Options,
|
74
|
+
options: {
|
75
|
+
aniTime: 300, //int (ms) - grow animation time
|
76
|
+
maxHeight: 0, //int (pixels) - one way to set a max height, if you dont set it via the class.
|
77
|
+
defaultMaxHeight: 1000, //int (pixels) - if not otherwise set, this is the max height
|
78
|
+
parentDepth: 6, //int - how many levels up should to check the parent el's height.
|
79
|
+
//trigger classes:
|
80
|
+
growClass: 'growme', //string (class name)- grow the text area
|
81
|
+
enterStoppedClass: 'stopenter', //string (class name)- stop the enter key
|
82
|
+
enterSubmitsClass: 'entersubmits', //string (class name)- submit the form when enter is pressed
|
83
|
+
replaceGhostTextClass: 'replaceghosttext', //string (class name)- tries to use the ghosted text features
|
84
|
+
growParentsClass: 'growparents', //string (class name)- grow the parent elements if needed
|
85
|
+
//other attributes:
|
86
|
+
ghostTextAttr: 'ghosttext',
|
87
|
+
ghostClassAttr: 'ghostclass'
|
88
|
+
},
|
89
|
+
initialize: function(el, options) {
|
90
|
+
this.setOptions(options);
|
91
|
+
|
92
|
+
this.el = document.id(el); //the textarea element.
|
93
|
+
|
94
|
+
//by default, we will do nothing to the text area unless it has the class...
|
95
|
+
this.autoGrow = el.hasClass(this.options.growClass);
|
96
|
+
this.stopEnter = el.hasClass(this.options.enterStoppedClass);
|
97
|
+
this.enterSubmits = el.hasClass(this.options.enterSubmitsClass);
|
98
|
+
this.useGhostText = el.hasClass(this.options.replaceGhostTextClass);
|
99
|
+
this.growParents = el.hasClass(this.options.growParentsClass);
|
100
|
+
|
101
|
+
//initialize, and add events:
|
102
|
+
if(this.autoGrow) {
|
103
|
+
this.resizer = new Fx.Tween(this.el, {duration: this.options.aniTime});
|
104
|
+
this.getMaxSize();
|
105
|
+
this.reachedMax = false;
|
106
|
+
this.startSize = this.origSize = this.el.getSize().y;
|
107
|
+
this.vertPadding = this.el.getStyle('padding-top').toInt()+this.el.getStyle('padding-bottom').toInt()+this.el.getStyle('border-top').toInt()+this.el.getStyle('border-bottom').toInt();
|
108
|
+
this.el.setStyle('overflow', 'hidden');
|
109
|
+
this.el.addEvents({
|
110
|
+
'keyup': function(e) {
|
111
|
+
this.checkSize(e);
|
112
|
+
}.bind(this),
|
113
|
+
'change': function(e) {
|
114
|
+
this.checkSize(e);
|
115
|
+
}.bind(this),
|
116
|
+
'click': function(e) {
|
117
|
+
this.checkSize(e);
|
118
|
+
}.bind(this)
|
119
|
+
});
|
120
|
+
|
121
|
+
//get inital state:
|
122
|
+
this.checkSize();
|
123
|
+
}
|
124
|
+
//watch this text area: keydown
|
125
|
+
if(this.stopEnter) {
|
126
|
+
this.el.addEvent('keydown', function(e) {
|
127
|
+
if(e.key == 'enter') {
|
128
|
+
e.stop();
|
129
|
+
if(this.enterSubmits) {
|
130
|
+
this.submitForm();
|
131
|
+
}
|
132
|
+
}
|
133
|
+
}.bind(this));
|
134
|
+
}
|
135
|
+
//replace ghost text:
|
136
|
+
if(this.useGhostText) {
|
137
|
+
this.ghostText = this.el.get(this.options.ghostTextAttr);
|
138
|
+
this.ghostClass = this.el.get(this.options.ghostClassAttr);
|
139
|
+
if(this.ghostText) {
|
140
|
+
//initial states: if populated with something else, remove the class:
|
141
|
+
if(this.el.value != this.ghostText) {
|
142
|
+
this.el.removeClass(this.ghostClass);
|
143
|
+
}
|
144
|
+
//add events to watch for ghosting:
|
145
|
+
this.el.addEvents({
|
146
|
+
//remove the ghosted text when the text area receives focus
|
147
|
+
'focus': function(e) {
|
148
|
+
if(this.el.value == this.ghostText) {
|
149
|
+
this.el.set('value', '');
|
150
|
+
if(this.ghostClass) {
|
151
|
+
this.el.removeClass(this.ghostClass);
|
152
|
+
}
|
153
|
+
}
|
154
|
+
}.bind(this),
|
155
|
+
//put the ghost text back if blur'ed and its empty
|
156
|
+
'blur': function(e) {
|
157
|
+
if(this.el.value == '') {
|
158
|
+
this.el.set('value', this.ghostText);
|
159
|
+
if(this.ghostClass) {
|
160
|
+
this.el.addClass(this.ghostClass);
|
161
|
+
}
|
162
|
+
}
|
163
|
+
}.bind(this)
|
164
|
+
});
|
165
|
+
}
|
166
|
+
}
|
167
|
+
|
168
|
+
},
|
169
|
+
getMaxSize: function() {
|
170
|
+
this.maxSize = this.options.maxHeight;
|
171
|
+
if(this.maxSize == 0) {
|
172
|
+
var testmax = this.el.className.match(/maxheight-(\d*)/);
|
173
|
+
if(testmax) {
|
174
|
+
this.maxSize = testmax[1];
|
175
|
+
}
|
176
|
+
else {
|
177
|
+
this.maxSize = this.options.defaultMaxHeight; //if one forgets to set a max height via options or class, use a reasonable number.
|
178
|
+
}
|
179
|
+
}
|
180
|
+
},
|
181
|
+
checkSize: function(e) {
|
182
|
+
var theSize = this.el.getSize();
|
183
|
+
var theScrollSize = this.el.getScrollSize();
|
184
|
+
if(navigator.userAgent.toLowerCase().indexOf('chrome') > -1) { var checksize = (theScrollSize.y); }
|
185
|
+
else var checksize = (theScrollSize.y+this.vertPadding);
|
186
|
+
|
187
|
+
if(checksize > theSize.y) {
|
188
|
+
//we are scrolling, so grow:
|
189
|
+
this.resizeIt(theSize, theScrollSize);
|
190
|
+
}
|
191
|
+
},
|
192
|
+
resizeIt: function(theSize, scrollSize) {
|
193
|
+
var newSize = scrollSize.y;
|
194
|
+
if((scrollSize.y+this.vertPadding) > this.maxSize && !this.reachedMax) {
|
195
|
+
//we've reached the max size, grow to max size and make textarea scrollable again:
|
196
|
+
newSize = this.maxSize;
|
197
|
+
this.el.setStyle('overflow', '');
|
198
|
+
this.resizer.start('height', newSize);
|
199
|
+
if(this.growParents) {
|
200
|
+
var increasedSize = newSize - this.startSize;
|
201
|
+
this.resizeParents(this.el, 0, increasedSize);
|
202
|
+
}
|
203
|
+
//remember that we've reached the max size:
|
204
|
+
this.reachedMax = true;
|
205
|
+
}
|
206
|
+
if(!this.reachedMax) {
|
207
|
+
//grow the text area:
|
208
|
+
var increasedSize = newSize - this.startSize;
|
209
|
+
if(increasedSize < 0) increasedSize = 0;
|
210
|
+
this.startSize = newSize;
|
211
|
+
this.resizer.start('height', newSize);
|
212
|
+
//resize parent objects if needed:
|
213
|
+
if(this.growParents) {
|
214
|
+
this.resizeParents(this.el, 0, increasedSize);
|
215
|
+
}
|
216
|
+
}
|
217
|
+
},
|
218
|
+
resizeParents: function(el, num, incSize) {
|
219
|
+
if(num < this.options.parentDepth) {
|
220
|
+
var newel = el.getParent();
|
221
|
+
if(newel) {
|
222
|
+
if(newel.style.height && newel.style.height != '' ) {
|
223
|
+
if(newel.retrieve('flextAdjusted')) {
|
224
|
+
var newheight = (newel.getStyle('height').toInt()+incSize);
|
225
|
+
} else {
|
226
|
+
newel.store('flextAdjusted', true); //when resizing parents, the first time we enlarge them we have to include vertical padding
|
227
|
+
var newheight = (newel.getStyle('height').toInt()+incSize+this.vertPadding);
|
228
|
+
}
|
229
|
+
newel.setStyle('height', newheight);
|
230
|
+
}
|
231
|
+
return this.resizeParents(newel, (num+1), incSize);
|
232
|
+
}
|
233
|
+
return true;
|
234
|
+
} else {
|
235
|
+
return true;
|
236
|
+
}
|
237
|
+
},
|
238
|
+
submitForm: function() {
|
239
|
+
var thisForm = this.el.getParent('form');
|
240
|
+
if(thisForm) {
|
241
|
+
var formName = thisForm.get('name');
|
242
|
+
document[formName].submit();
|
243
|
+
|
244
|
+
}
|
245
|
+
}
|
246
|
+
});
|
247
|
+
|
248
|
+
|
249
|
+
//watch the text areas:
|
250
|
+
window.addEvent('domready', function() {
|
251
|
+
$$('textarea.flext').each(function(el, i) {
|
252
|
+
new Flext(el);
|
253
|
+
});
|
254
|
+
});
|
@@ -0,0 +1,311 @@
|
|
1
|
+
/* `Widths
|
2
|
+
----------------------------------------------------------------------------------------------------*/
|
3
|
+
|
4
|
+
.input_tiny {
|
5
|
+
width: 50px;
|
6
|
+
}
|
7
|
+
|
8
|
+
.input_small {
|
9
|
+
width: 100px;
|
10
|
+
}
|
11
|
+
|
12
|
+
.input_medium {
|
13
|
+
width: 150px;
|
14
|
+
}
|
15
|
+
|
16
|
+
.input_large {
|
17
|
+
width: 200px;
|
18
|
+
}
|
19
|
+
|
20
|
+
.input_xlarge {
|
21
|
+
width: 250px;
|
22
|
+
}
|
23
|
+
|
24
|
+
.input_xxlarge {
|
25
|
+
width: 300px;
|
26
|
+
}
|
27
|
+
|
28
|
+
.input_full {
|
29
|
+
width: 100%;
|
30
|
+
}
|
31
|
+
|
32
|
+
/*
|
33
|
+
Added via JS to <textarea> and class="input_full".
|
34
|
+
Applies only to IE7. Other browsers don't need it.
|
35
|
+
*/
|
36
|
+
.input_full_wrap {
|
37
|
+
display: block;
|
38
|
+
padding-right: 8px;
|
39
|
+
}
|
40
|
+
|
41
|
+
/* `UI Consistency
|
42
|
+
----------------------------------------------------------------------------------------------------*/
|
43
|
+
|
44
|
+
::-moz-focus-inner {
|
45
|
+
border: 0;
|
46
|
+
}
|
47
|
+
|
48
|
+
input[type="search"]::-webkit-search-decoration {
|
49
|
+
display: none;
|
50
|
+
}
|
51
|
+
|
52
|
+
input,
|
53
|
+
button,
|
54
|
+
select,
|
55
|
+
textarea {
|
56
|
+
-moz-background-clip: padding;
|
57
|
+
-webkit-background-clip: padding;
|
58
|
+
background-clip: padding-box;
|
59
|
+
margin: 0;
|
60
|
+
vertical-align: middle;
|
61
|
+
}
|
62
|
+
|
63
|
+
button,
|
64
|
+
input[type="reset"],
|
65
|
+
input[type="submit"],
|
66
|
+
input[type="button"] {
|
67
|
+
-webkit-appearance: none;
|
68
|
+
-moz-border-radius: 11px;
|
69
|
+
-webkit-border-radius: 11px;
|
70
|
+
border-radius: 11px;
|
71
|
+
background: #ddd url(../images/button.png) repeat-x;
|
72
|
+
background: -webkit-gradient(linear, left top, left bottom, color-stop(0, #fff), color-stop(1, #ddd));
|
73
|
+
background: -moz-linear-gradient(top center, #fff 0%, #ddd 100%);
|
74
|
+
border: 1px solid;
|
75
|
+
border-color: #ddd #bbb #999;
|
76
|
+
cursor: pointer;
|
77
|
+
color: #333;
|
78
|
+
font: bold 12px/1.2 Arial, sans-serif;
|
79
|
+
outline: 0;
|
80
|
+
overflow: visible;
|
81
|
+
padding: 3px 10px 4px;
|
82
|
+
text-shadow: #fff 0 1px 1px;
|
83
|
+
width: auto;
|
84
|
+
|
85
|
+
/* IE7 */
|
86
|
+
*padding-top: 2px;
|
87
|
+
*padding-bottom: 0px;
|
88
|
+
}
|
89
|
+
|
90
|
+
button {
|
91
|
+
/* IE7 */
|
92
|
+
*padding-top: 1px;
|
93
|
+
*padding-bottom: 1px;
|
94
|
+
}
|
95
|
+
|
96
|
+
textarea,
|
97
|
+
select,
|
98
|
+
input[type="date"],
|
99
|
+
input[type="datetime"],
|
100
|
+
input[type="datetime-local"],
|
101
|
+
input[type="email"],
|
102
|
+
input[type="month"],
|
103
|
+
input[type="number"],
|
104
|
+
input[type="password"],
|
105
|
+
input[type="search"],
|
106
|
+
input[type="tel"],
|
107
|
+
input[type="text"],
|
108
|
+
input[type="time"],
|
109
|
+
input[type="url"],
|
110
|
+
input[type="week"] {
|
111
|
+
-webkit-appearance: none;
|
112
|
+
-moz-border-radius: 0;
|
113
|
+
-webkit-border-radius: 0;
|
114
|
+
border-radius: 0;
|
115
|
+
-webkit-box-sizing: border-box;
|
116
|
+
-moz-box-sizing: border-box;
|
117
|
+
box-sizing: border-box;
|
118
|
+
background-color: #fff;
|
119
|
+
border: 1px solid;
|
120
|
+
border-color: #848484 #c1c1c1 #e1e1e1;
|
121
|
+
color: #000;
|
122
|
+
outline: 0;
|
123
|
+
padding: 2px 3px;
|
124
|
+
font-size: 13px;
|
125
|
+
font-family: Arial, sans-serif;
|
126
|
+
height: 1.8em;
|
127
|
+
|
128
|
+
/* IE7 */
|
129
|
+
*padding-top: 2px;
|
130
|
+
*padding-bottom: 1px;
|
131
|
+
*height: auto;
|
132
|
+
}
|
133
|
+
|
134
|
+
/*
|
135
|
+
Separate rule for Firefox.
|
136
|
+
Cannot stack with WebKit's.
|
137
|
+
*/
|
138
|
+
input.placeholder_text,
|
139
|
+
textarea.placeholder_text,
|
140
|
+
input:-moz-placeholder,
|
141
|
+
textarea:-moz-placeholder {
|
142
|
+
color: #888;
|
143
|
+
}
|
144
|
+
|
145
|
+
::-webkit-input-placeholder {
|
146
|
+
color: #888;
|
147
|
+
}
|
148
|
+
|
149
|
+
button:focus,
|
150
|
+
button:active,
|
151
|
+
input:focus,
|
152
|
+
input:active,
|
153
|
+
select:focus,
|
154
|
+
select:active,
|
155
|
+
textarea:focus,
|
156
|
+
textarea:active {
|
157
|
+
-moz-box-shadow: #06f 0 0 7px;
|
158
|
+
-webkit-box-shadow: #06f 0 0 7px;
|
159
|
+
box-shadow: #06f 0 0 7px;
|
160
|
+
|
161
|
+
/* for Opera */
|
162
|
+
z-index: 1;
|
163
|
+
}
|
164
|
+
|
165
|
+
input[type="file"]:focus,
|
166
|
+
input[type="file"]:active,
|
167
|
+
input[type="radio"]:focus,
|
168
|
+
input[type="radio"]:active,
|
169
|
+
input[type="checkbox"]:focus,
|
170
|
+
input[type="checkbox"]:active {
|
171
|
+
-moz-box-shadow: none;
|
172
|
+
-webkit-box-shadow: none;
|
173
|
+
box-shadow: none;
|
174
|
+
}
|
175
|
+
|
176
|
+
select[disabled],
|
177
|
+
textarea[disabled],
|
178
|
+
input[type="date"][disabled],
|
179
|
+
input[type="datetime"][disabled],
|
180
|
+
input[type="datetime-local"][disabled],
|
181
|
+
input[type="email"][disabled],
|
182
|
+
input[type="month"][disabled],
|
183
|
+
input[type="number"][disabled],
|
184
|
+
input[type="password"][disabled],
|
185
|
+
input[type="search"][disabled],
|
186
|
+
input[type="tel"][disabled],
|
187
|
+
input[type="text"][disabled],
|
188
|
+
input[type="time"][disabled],
|
189
|
+
input[type="url"][disabled],
|
190
|
+
input[type="week"][disabled] {
|
191
|
+
background-color: #eee;
|
192
|
+
}
|
193
|
+
|
194
|
+
button[disabled],
|
195
|
+
input[disabled],
|
196
|
+
select[disabled],
|
197
|
+
select[disabled] option,
|
198
|
+
select[disabled] optgroup,
|
199
|
+
textarea[disabled] {
|
200
|
+
-moz-box-shadow: none;
|
201
|
+
-webkit-box-shadow: none;
|
202
|
+
box-shadow: none;
|
203
|
+
-webkit-user-select: none;
|
204
|
+
-moz-user-select: none;
|
205
|
+
user-select: none;
|
206
|
+
color: #888;
|
207
|
+
cursor: default;
|
208
|
+
}
|
209
|
+
|
210
|
+
.is_webkit select {
|
211
|
+
/* Tweaks for Safari + Chrome. */
|
212
|
+
/* background-image: url(../images/select_arrow.gif);*/
|
213
|
+
background-repeat: no-repeat;
|
214
|
+
background-position: right center;
|
215
|
+
padding-right: 20px;
|
216
|
+
}
|
217
|
+
|
218
|
+
textarea,
|
219
|
+
select[size],
|
220
|
+
select[multiple] {
|
221
|
+
height: auto;
|
222
|
+
}
|
223
|
+
|
224
|
+
.is_webkit select[size],
|
225
|
+
.is_webkit select[multiple] {
|
226
|
+
background-image: none;
|
227
|
+
padding: 0;
|
228
|
+
}
|
229
|
+
|
230
|
+
textarea {
|
231
|
+
min-height: 40px;
|
232
|
+
overflow: auto;
|
233
|
+
resize: vertical;
|
234
|
+
width: 100%;
|
235
|
+
}
|
236
|
+
|
237
|
+
optgroup {
|
238
|
+
color: #000;
|
239
|
+
font-style: normal;
|
240
|
+
font-weight: normal;
|
241
|
+
}
|
242
|
+
|
243
|
+
/* `IE6
|
244
|
+
----------------------------------------------------------------------------------------------------*/
|
245
|
+
|
246
|
+
/*
|
247
|
+
Everything below this line is for IE6.
|
248
|
+
Delete it if you don't support it! :)
|
249
|
+
|
250
|
+
Classes are added dynamically via JS,
|
251
|
+
because IE6 doesn't support attribute
|
252
|
+
selectors: .ie6_button, .ie6_input, etc.
|
253
|
+
|
254
|
+
Note: These style rules are somewhat
|
255
|
+
duplicated because IE6 bombs out when
|
256
|
+
it sees attribute selectors. Example:
|
257
|
+
|
258
|
+
.ie6_button {
|
259
|
+
This works in IE6.
|
260
|
+
}
|
261
|
+
|
262
|
+
.ie6_button,
|
263
|
+
input[type=submit] {
|
264
|
+
This doesn't work.
|
265
|
+
}
|
266
|
+
*/
|
267
|
+
|
268
|
+
.ie6_button,
|
269
|
+
* html button {
|
270
|
+
background: #ddd url(../images/button.png) repeat-x;
|
271
|
+
border: 1px solid;
|
272
|
+
border-color: #ddd #bbb #999;
|
273
|
+
cursor: pointer;
|
274
|
+
color: #333;
|
275
|
+
font: bold 12px/1.2 Arial, sans-serif;
|
276
|
+
padding: 2px 10px 0px;
|
277
|
+
overflow: visible;
|
278
|
+
width: auto;
|
279
|
+
}
|
280
|
+
|
281
|
+
* html button {
|
282
|
+
padding-top: 1px;
|
283
|
+
padding-bottom: 1px;
|
284
|
+
}
|
285
|
+
|
286
|
+
.ie6_input,
|
287
|
+
* html textarea,
|
288
|
+
* html select {
|
289
|
+
background: #fff;
|
290
|
+
border: 1px solid;
|
291
|
+
border-color: #848484 #c1c1c1 #e1e1e1;
|
292
|
+
color: #000;
|
293
|
+
padding: 2px 3px 1px;
|
294
|
+
font-size: 13px;
|
295
|
+
font-family: Arial, sans-serif;
|
296
|
+
vertical-align: top;
|
297
|
+
}
|
298
|
+
|
299
|
+
* html select {
|
300
|
+
margin-top: 1px;
|
301
|
+
}
|
302
|
+
|
303
|
+
.placeholder_text,
|
304
|
+
.ie6_input_disabled,
|
305
|
+
.ie6_button_disabled {
|
306
|
+
color: #888;
|
307
|
+
}
|
308
|
+
|
309
|
+
.ie6_input_disabled {
|
310
|
+
background: #eee;
|
311
|
+
}
|