|
From: <de...@de...> - 2013-04-19 07:23:17
|
Author: HideyoImazu Date: 2013-04-19 02:23:07 -0500 (Fri, 19 Apr 2013) New Revision: 25781 Trac url: http://develop.twiki.org/trac/changeset/25781 Modified: twiki/branches/TWikiRelease05x01/PreferencesPlugin/data/TWiki/PreferencesPlugin.txt twiki/branches/TWikiRelease05x01/PreferencesPlugin/lib/TWiki/Plugins/PreferencesPlugin.pm Log: Item7236: PreferencesPlugin not to touch a variable whose type is label Modified: twiki/branches/TWikiRelease05x01/PreferencesPlugin/data/TWiki/PreferencesPlugin.txt =================================================================== --- twiki/branches/TWikiRelease05x01/PreferencesPlugin/data/TWiki/PreferencesPlugin.txt 2013-04-19 07:19:30 UTC (rev 25780) +++ twiki/branches/TWikiRelease05x01/PreferencesPlugin/data/TWiki/PreferencesPlugin.txt 2013-04-19 07:23:07 UTC (rev 25781) @@ -1,4 +1,4 @@ -%META:TOPICINFO{author="TWikiContributor" date="1366106257" format="1.1" version="$Rev$"}% +%META:TOPICINFO{author="TWikiContributor" date="1366355936" format="1.1" version="$Rev$"}% ---+!! <nop>%TOPIC% <!-- Contributions to this TWiki plugin are appreciated. Please update the plugin page @@ -58,13 +58,14 @@ | Plugin Author: | TWiki:Main.ThomasWeigert | | Copyright: | © 2005 TWiki:Main.ThomasWeigert %BR% © 2005-2013 TWiki:TWiki.TWikiContributor | | License: | GPL ([[http://www.gnu.org/copyleft/gpl.html][GNU General Public License]]) | -| Plugin Version: | 2013-04-16 | +| Plugin Version: | 2013-04-19 | %TWISTY{ mode="div" showlink="Show Change History %ICONURL{toggleopen}%" hidelink="Hide Change History %ICONURL{toggleclose}% " }% %TABLE{ tablewidth="100%" columnwidths="170," }% +| 2013-04-19: | TWikibug:Item7236: It should not touch a variable whose type is label -- TWiki:Main.HideyoImazu | | 2013-04-16: | TWikibug:Item7231: It was confused by Set and Local of a same variable -- TWiki:Main.HideyoImazu | | 2013-04-08: | TWikibug:Item7219: Preserve order of type checkbox and select+multi as defined; support select+multi+values -- TWiki:Main.PeterThoeny | | 2013-04-08: | TWikibug:Item7202: Make "#" transparent so it also works when bgcolor is not white; Show "#" when the checkbox is disabled -- TWiki:Main.MahiroAndo | Modified: twiki/branches/TWikiRelease05x01/PreferencesPlugin/lib/TWiki/Plugins/PreferencesPlugin.pm =================================================================== --- twiki/branches/TWikiRelease05x01/PreferencesPlugin/lib/TWiki/Plugins/PreferencesPlugin.pm 2013-04-19 07:19:30 UTC (rev 25780) +++ twiki/branches/TWikiRelease05x01/PreferencesPlugin/lib/TWiki/Plugins/PreferencesPlugin.pm 2013-04-19 07:23:07 UTC (rev 25781) @@ -54,6 +54,46 @@ return 1; } +# Item7008 +my $TO_ADDTOHEAD_WHEN_EDIT = <<'END'; +<style type='text/css'> +.twikiPrefFieldTable {display: inline-table; vertical-align: top;} +.twikiPrefFieldDiv {display: inline} +.twikiPrefFieldLabelDisabled {color: #888;} +.twikiPrefFieldHash {visibility: hidden;} +.twikiPrefFieldLabelDisabled .twikiPrefFieldHash {visibility: visible;} +</style> +<!--[if IE]> +<style type='text/css'> +.twikiPrefFieldTable {display: inline; vertical-align: top;} +</style> +<![endif]--> +<script type='text/javascript'> +if( window.jQuery ) { + $( function () { + var disabledClass = 'twikiPrefFieldLabelDisabled'; + $( '.twikiPrefEnableCheckbox' ).each( function () { + var $checkbox = $(this); + if( $checkbox.attr( 'name' ).match( /(.*?)!/ ) ) { + var name = RegExp.$1; + var $label = $( '#twikiPrefFieldLabel-' + name ); + if( !$checkbox.attr( 'checked' ) ) { + $label.addClass( disabledClass ); + } + $checkbox.change( function () { + if( $checkbox.attr( 'checked' ) ) { + $label.removeClass( disabledClass ); + } else { + $label.addClass( disabledClass ); + } + } ); + } + } ); + } ); +} +</script> +END + sub beforeCommonTagsHandler { ### my ( $text, $topic, $web ) = @_; my $topic = $_[1]; @@ -99,44 +139,7 @@ TWiki::Func::setTopicEditLock( $web, $topic, 1 ); # Item7008 - TWiki::Func::addToHEAD('PreferencesPlugin', <<'END'); -<style type='text/css'> -.twikiPrefFieldTable {display: inline-table; vertical-align: top;} -.twikiPrefFieldDiv {display: inline} -.twikiPrefFieldLabelDisabled {color: #888;} -.twikiPrefFieldHash {visibility: hidden;} -.twikiPrefFieldLabelDisabled .twikiPrefFieldHash {visibility: visible;} -</style> -<!--[if IE]> -<style type='text/css'> -.twikiPrefFieldTable {display: inline; vertical-align: top;} -</style> -<![endif]--> -<script type='text/javascript'> -if( window.jQuery ) { - $( function () { - var disabledClass = 'twikiPrefFieldLabelDisabled'; - $( '.twikiPrefEnableCheckbox' ).each( function () { - var $checkbox = $(this); - if( $checkbox.attr( 'name' ).match( /(.*?)!/ ) ) { - var name = RegExp.$1; - var $label = $( '#twikiPrefFieldLabel-' + name ); - if( !$checkbox.attr( 'checked' ) ) { - $label.addClass( disabledClass ); - } - $checkbox.change( function () { - if( $checkbox.attr( 'checked' ) ) { - $label.removeClass( disabledClass ); - } else { - $label.addClass( disabledClass ); - } - } ); - } - } ); - } ); -} -</script> -END + TWiki::Func::addToHEAD('PreferencesPlugin', $TO_ADDTOHEAD_WHEN_EDIT); # Replace setting values by form fields but not inside comments Item4816 my $outtext = ''; @@ -239,6 +242,9 @@ $fieldDef = _getField( $formDef, $name ); } if ( $fieldDef ) { + if ( $fieldDef->{type} && $fieldDef->{type} eq 'label' ) { + return "$prefix$name = $value"; + } if( defined(&TWiki::Form::renderFieldForEdit)) { # TWiki < 4.2 SMELL: use of unpublished core function ( $extras, $html ) = @@ -353,6 +359,9 @@ if( $formDef ) { my $fieldDef = _getField( $formDef, $name ); my $type = $fieldDef->{type} || ''; + if ( $type eq 'label' ) { + return "$prefix$name =$value"; + } if( $type && $type =~ /^(checkbox|select.*\+multi)/ ) { my @values = $query->param( $name ); my %vset = (); |