Author: nathangray
New Revision: 36192
URL: http://svn.stylite.de/viewvc/egroupware?rev=36192&view=rev
Log:
- Add labels to input widgets
- Add row & col properties to textarea
Modified:
trunk/etemplate/js/et2_checkbox.js
trunk/etemplate/js/et2_inputWidget.js
trunk/etemplate/js/et2_textbox.js
trunk/etemplate/js/test/et2_test_basic_widgets.xet
trunk/etemplate/js/test/test_xml.html
Modified: trunk/etemplate/js/et2_checkbox.js
URL: http://svn.stylite.de/viewvc/egroupware/trunk/etemplate/js/et2_checkbox.js?rev=36192&r1=36191&r2=36192&view=diff
— trunk/etemplate/js/et2_checkbox.js (original)
+++ trunk/etemplate/js/et2_checkbox.js Thu Aug 18 00:56:49 2011
@@ -61,7 +61,7 @@
set_value: function(_value) {
if(_value != this.value) {
if(_value == this.set_value) {
-
this.input.attr("checked", true);
-
this.input.attr("checked", "checked"); } else { this.input.removeAttr("checked"); }
Modified: trunk/etemplate/js/et2_inputWidget.js
URL: http://svn.stylite.de/viewvc/egroupware/trunk/etemplate/js/et2_inputWidget.js?rev=36192&r1=36191&r2=36192&view=diff
— trunk/etemplate/js/et2_inputWidget.js (original)
+++ trunk/etemplate/js/et2_inputWidget.js Thu Aug 18 00:56:49 2011
@@ -51,6 +51,12 @@
“default”: false,
“type”: “boolean”,
“description”: “If required, the user must enter a value before the form can be submitted”
-
}, -
"label": { -
"name": "Label", -
"default": "", -
"type": "string", -
},"description": "The label is displayed by default in front (for radiobuttons behind) each widget (if not empty). If you want to specify a different position, use a '%s' in the label, which gets replaced by the widget itself. Eg. '%s Name' to have the label Name behind a checkbox. The label can contain variables, as descript for name. If the label starts with a '@' it is replaced by the value of the content-array at this index (with the '@'-removed and after expanding the variables)." }
init: function() {
@@ -102,6 +108,16 @@
}
}
}, - set_label: function(_label) {
-
if(_label != this.label) -
{ -
label = et2_csvSplit(_label, 2, '%s'); -
if(label[0]) this.input.before("<span class='et2_label'>"+label[0]+"</span>"); -
if(label[1]) this.input.after("<span class='et2_label'>"+label[1]+"</span>"); -
} - },
- set_required: function(_value) {
var node = this.getInputNode();
if (node)
Modified: trunk/etemplate/js/et2_textbox.js
URL: http://svn.stylite.de/viewvc/egroupware/trunk/etemplate/js/et2_textbox.js?rev=36192&r1=36191&r2=36192&view=diff
— trunk/etemplate/js/et2_textbox.js (original)
+++ trunk/etemplate/js/et2_textbox.js Thu Aug 18 00:56:49 2011
@@ -35,7 +35,21 @@
“type”: “integer”,
“default”: et2_no_init,
“description”: “Field width”
-
}
-
}, -
// These for multi-line -
"rows": { -
"name": "Rows", -
"type": "integer", -
"default": et2_no_init, -
"description": "Multiline field height - better to use CSS" -
}, -
"cols": { -
"name": "Size", -
"type": "integer", -
"default": et2_no_init, -
"description": "Multiline field width - better to use CSS" -
},},
init: function(_parent) {
@@ -61,7 +75,6 @@
if(this.size) {
this.set_size(this.size);
}
-
this.input.addClass("et2_textbox"); this.setDOMNode(this.input[0]);
@@ -76,6 +89,33 @@
// Write all settings again
this.update();
-
} - },
- set_rows: function(_value) {
-
if (_value != this.rows) -
{ -
this.rows = _value; -
if(this.rows > 1) -
{ -
this.set_multiline(true); -
this.input.attr("rows", this.rows); -
} else { -
this.set_multiline(false); -
} -
} - },
- set_cols: function(_value) {
-
if (_value != this.cols) -
{ -
this.cols = _value; -
if(this.cols > 1) -
{ -
this.set_multiline(true); -
this.input.attr("cols", this.cols); -
} else { -
this.set_multiline(false); -
},} }
Modified: trunk/etemplate/js/test/et2_test_basic_widgets.xet
URL: http://svn.stylite.de/viewvc/egroupware/trunk/etemplate/js/test/et2_test_basic_widgets.xet?rev=36192&r1=36191&r2=36192&view=diff
— trunk/etemplate/js/test/et2_test_basic_widgets.xet (original)
+++ trunk/etemplate/js/test/et2_test_basic_widgets.xet Thu Aug 18 00:56:49 2011
@@ -6,8 +6,8 @@
@@ -22,10 +22,11 @@
-
<textbox label="This is required text" id="text_value" required="true"/> <int label="This is an integer" id="integer_value" min="5"/> <textbox type="float" label="This is a float" id="float_value"/>
-
<textbox multiline="true" label="This is a text area" id="text_area_value"/> -
<checkbox label="Checkbox" id="checkbox_value"/>
-
<textbox multiline="true" label="This is a text area" id="text_area_value" rows="3" cols="3"/> -
<checkbox label="Checkbox %s here" id="checkbox_value"/> <radio label="Radio" id="radio_value"/> <buttononly label="Button" id="button_value"/> <hrule label="HR"/>
Modified: trunk/etemplate/js/test/test_xml.html
URL: http://svn.stylite.de/viewvc/egroupware/trunk/etemplate/js/test/test_xml.html?rev=36192&r1=36191&r2=36192&view=diff
— trunk/etemplate/js/test/test_xml.html (original)
+++ trunk/etemplate/js/test/test_xml.html Thu Aug 18 00:56:49 2011
@@ -21,6 +21,7 @@
-
<script src="../et2_checkbox.js"></script> <script src="../et2_styles.js"></script> <script src="../et2_html.js"></script>
Get a FREE DOWNLOAD! and learn more about uberSVN rich system,
user administration capabilities and model configuration. Take
the hassle out of deploying and managing Subversion and the
tools developers use with it. http://p.sf.net/sfu/wandisco-d2d-2
eGroupWare-cvs mailing list
eGroupWare-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/egroupware-cvs