summaryrefslogtreecommitdiffstats
path: root/public_html
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2012-02-17 14:43:07 +0100
committerAleksander Machniak <alec@alec.pl>2012-02-17 14:43:07 +0100
commite08072b6994af0b943e63815655fab0557453c9b (patch)
tree60dc71a9ff52a619c2deb053ed1a6021a7da430d /public_html
parent4a13324b0700b726d45e0fe7c5ebb422b7ba260e (diff)
downloadwebadmin-e08072b6994af0b943e63815655fab0557453c9b.tar.gz
Support form_fields value, add password prepopulation
Diffstat (limited to 'public_html')
-rw-r--r--public_html/skins/default/style.css13
-rw-r--r--public_html/skins/default/ui.js23
2 files changed, 30 insertions, 6 deletions
diff --git a/public_html/skins/default/style.css b/public_html/skins/default/style.css
index 74c64a4..dd01ec5 100644
--- a/public_html/skins/default/style.css
+++ b/public_html/skins/default/style.css
@@ -512,7 +512,7 @@ span.listelement:first-child {
span.listelement input {
border: none;
- background-color: white;
+ background-color: transparent;
margin-left: 2px;
width: 325px;
}
@@ -554,6 +554,17 @@ span.listelement span.actions span.add {
background-position: -43px 0;
}
+span.listarea.readonly {
+ background-color: #f5f5f5;
+}
+
+span.listarea.readonly span.listelement input {
+ color: #a0a0a0;
+}
+
+span.listarea.readonly span.listelement span.actions {
+ opacity: .5;
+}
/***** tabbed interface elements *****/
diff --git a/public_html/skins/default/ui.js b/public_html/skins/default/ui.js
index ff16952..e2e2255 100644
--- a/public_html/skins/default/ui.js
+++ b/public_html/skins/default/ui.js
@@ -111,7 +111,7 @@ function form_serialize(data)
var form = $(data.id);
// replace some textarea fields with pretty/smart input lists
- $('textarea[data-type="list"]', form).not(':disabled')
+ $('textarea[data-type="list"]', form).not('disabled')
.each(function() {
var i, value = [], re = RegExp('^' + this.name + '\[[0-9]+\]$');
@@ -135,17 +135,27 @@ function form_init(id)
var form = $('#'+id), separator = /[,\s\r\n]+/;
// replace some textarea fields with pretty/smart input lists
- $('textarea[data-type="list"]', form).not(':disabled')
+ $('textarea[data-type="list"]', form)
.each(function() {
var i, len, elem, e = $(this),
list = this.value.split(separator),
- area = $('<span class="listarea">');
+ area = $('<span class="listarea">'),
+ disabled = e.attr('disabled') || e.attr('readonly');
e.hide();
+
for (i=0, len=list.length; i<len; i++) {
- elem = form_list_element(form, {name: this.name+'['+i+']', value: list[i]});
+ elem = form_list_element(form, {
+ name: this.name+'['+i+']',
+ value: list[i],
+ disabled: disabled
+ });
elem.appendTo(area);
}
+
+ if (disabled)
+ area.addClass('readonly');
+
area.appendTo(this.parentNode);
});
}
@@ -157,7 +167,10 @@ function form_list_element(form, data)
+ '<span title="" class="add"></span><span title="" class="reset"></span>'
+ '</span><input></span>');
- $('input', elem).attr({name: data.name, value: data.value});
+ $('input', elem).attr({name: data.name, value: data.value, disabled: data.disabled});
+
+ if (data.disabled)
+ return elem;
// attach element creation event
$('span[class="add"]', elem).click(function() {