# HG changeset patch # User Aurelien Campeas # Date 1242740552 -7200 # Node ID 015dfeaf1d89628a9d0f6dc1a21bf5fc00694a71 # Parent af1ae863606d5aa7ef97afdd2b6b81e3a61836a8 trailing space cleanup, js lint, a small indent for preference sections diff -r af1ae863606d -r 015dfeaf1d89 web/data/cubicweb.preferences.css --- a/web/data/cubicweb.preferences.css Tue May 19 14:31:42 2009 +0200 +++ b/web/data/cubicweb.preferences.css Tue May 19 15:42:32 2009 +0200 @@ -6,17 +6,21 @@ */ -.preferences .validateButton{ +.preferences .validateButton{ margin-top:0px; } -fieldset.preferences{ +fieldset.preferences{ border : 1px solid #CFCEB7; margin:7px 1em 0; padding:2px 6px 6px; } -div.componentLink{ +div.component { + margin-left: 1em; +} + +div.componentLink{ margin-top:0.3em; } @@ -39,7 +43,7 @@ font-size:89%; } -h2.propertiesform a:hover{ +h2.propertiesform a:hover{ background-color:#cfceb7; } @@ -50,57 +54,57 @@ } div.preffield { - margin-bottom: 5px; + margin-bottom: 5px; padding:2px 5px; background:#eeedd9; } -div.prefinput{ - margin:.3em; +div.prefinput{ + margin:.3em; } div.prefinput select.changed, -div.prefinput input.changed{ +div.prefinput input.changed{ border: 1px solid #000; font-weight:bold; } div.prefinput select, -div.prefinput input{ +div.prefinput input{ background:#fff; border: 1px solid #CFCEB7; } .prefinput input.error { /* background:#fff url(error.png) no-repeat scroll 100% 50% !important; */ - border:1px solid red !important; + border:1px solid red !important; color:red; padding-right:1em; } -div.formsg{ +div.formsg{ font-weight:bold; margin:0.5em 0px; } -div.critical{ +div.critical{ color:red; padding-left:20px; background:#fff url(critical.png) no-repeat; } -div.formsg .msg{ +div.formsg .msg{ color : green; } .helper{ font-size: 96%; color: #555544; - padding:0; + padding:0; } div.prefinput .helper:hover { @@ -108,6 +112,6 @@ cursor: default; } -div.openlink{ +div.openlink{ display:inline; } diff -r af1ae863606d -r 015dfeaf1d89 web/data/cubicweb.preferences.js --- a/web/data/cubicweb.preferences.js Tue May 19 14:31:42 2009 +0200 +++ b/web/data/cubicweb.preferences.js Tue May 19 15:42:32 2009 +0200 @@ -11,14 +11,14 @@ function closeFieldset(fieldsetid){ var linklabel = _('open all'); - var linkhref = 'javascript:openFieldset("' +fieldsetid + '")' - _toggleFieldset(fieldsetid, 1, linklabel, linkhref) + var linkhref = 'javascript:openFieldset("' +fieldsetid + '")'; + _toggleFieldset(fieldsetid, 1, linklabel, linkhref); } function openFieldset(fieldsetid){ var linklabel = _('close all'); - var linkhref = 'javascript:closeFieldset("'+ fieldsetid + '")' - _toggleFieldset(fieldsetid, 0, linklabel, linkhref) + var linkhref = 'javascript:closeFieldset("'+ fieldsetid + '")'; + _toggleFieldset(fieldsetid, 0, linklabel, linkhref); } @@ -26,13 +26,13 @@ jQuery('#'+fieldsetid).find('div.openlink').each(function(){ var link = A({'href' : "javascript:noop();", 'onclick' : linkhref}, - linklabel) + linklabel); jQuery(this).empty().append(link); }); jQuery('#'+fieldsetid).find('fieldset[id]').each(function(){ var fieldset = jQuery(this); if(closeaction){ - fieldset.addClass('hidden') + fieldset.addClass('hidden'); }else{ fieldset.removeClass('hidden'); linkLabel = (_('open all')); @@ -41,7 +41,6 @@ } function validatePrefsForm(formid){ - freezeFormButtons(formid); clearPreviousMessages(); clearPreviousErrors(formid); return validateForm(formid, null, submitSucces, submitFailure); @@ -79,18 +78,18 @@ function checkValues(form, success){ var unfreezeButtons = false; - jQuery(form).find('select').each(function () { + jQuery(form).find('select').each(function () { unfreezeButtons = _checkValue(jQuery(this), unfreezeButtons); }); jQuery(form).find('[type=text]').each(function () { unfreezeButtons = _checkValue(jQuery(this), unfreezeButtons); }); - jQuery(form).find('input[type=radio]').each(function () { + jQuery(form).find('input[type=radio]').each(function () { if (jQuery(this).attr('checked')){ unfreezeButtons = _checkValue(jQuery(this), unfreezeButtons); } - }); - + }); + if (unfreezeButtons){ unfreezeFormButtons(form.attr('id')); }else{ @@ -110,14 +109,14 @@ }else{ input.removeClass('changed'); jQuery("span[id=err-" + input.attr('id') + "]").remove(); - } + } input.removeClass('error'); - return unfreezeButtons + return unfreezeButtons; } function setCurrentValues(form){ - jQuery(form).find('input[name^=current-value]').each(function () { + jQuery(form).find('input[name^=current-value]').each(function () { var currentValueInput = jQuery(this); var name = currentValueInput.attr('name').split('-')[1]; jQuery(form).find("[name=" + name + "]").each(function (){ @@ -134,17 +133,17 @@ } function initEvents(){ - jQuery('form').each(function() { + jQuery('form').each(function() { var form = jQuery(this); freezeFormButtons(form.attr('id')); - form.find('input[type=text]').keyup(function(){ - checkValues(form); + form.find('input[type=text]').keyup(function(){ + checkValues(form); }); - form.find('input[type=radio]').change(function(){ - checkValues(form); + form.find('input[type=radio]').change(function(){ + checkValues(form); }); - form.find('select').change(function(){ - checkValues(form); + form.find('select').change(function(){ + checkValues(form); }); setCurrentValues(form); }); diff -r af1ae863606d -r 015dfeaf1d89 web/views/cwproperties.py --- a/web/views/cwproperties.py Tue May 19 14:31:42 2009 +0200 +++ b/web/views/cwproperties.py Tue May 19 15:42:32 2009 +0200 @@ -123,8 +123,6 @@ req = self.req _ = req._ w(u'

%s

\n' % _(self.title)) - # we don't want this in each sub-forms XXX - w(u'
%s
' % self.req._('validating...')) for label, group, form in sorted((_(g), g, f) for g, f in mainopts.iteritems()): status = css_class(self._group_status(group)) @@ -141,21 +139,25 @@ w(u'

%s

\n' % (make_togglable_link('fieldset_' + group, label.capitalize()))) w(u'
' % (group, status)) - + # create selection sorted_objects = sorted((self.req.__('%s_%s' % (group, o)), o, f) for o, f in objects.iteritems()) for label, oid, form in sorted_objects: - w(u'''