Index: openacs-4/packages/xowiki/tcl/form-field-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/form-field-procs.tcl,v diff -u -r1.284.2.138 -r1.284.2.139 --- openacs-4/packages/xowiki/tcl/form-field-procs.tcl 13 Jan 2021 18:18:23 -0000 1.284.2.138 +++ openacs-4/packages/xowiki/tcl/form-field-procs.tcl 18 Jan 2021 14:11:28 -0000 1.284.2.139 @@ -567,7 +567,7 @@ # set old_value ${:value} set :value [:escape_message_keys $old_value] - ::html::input [:get_attributes type size maxlength id name value \ + ::html::input [:get_attributes type size maxlength id name value style \ autocomplete pattern placeholder {CSSclass class} {*}$booleanAtts] {} # # Reset values to original content @@ -1635,6 +1635,7 @@ {sticky:boolean false} {searchable:boolean false} {multiple:boolean false} + choose_file_label link_label } file instproc check=virus {value} { @@ -1824,9 +1825,12 @@ # Sanitize the filename regsub -all {\\+} $fn {/} fn ;# fix IE upload path set fn [ad_file tail $fn] - # Flip the two flags in the command below in case we want to - # become stricter. For now we just make sure the filename - # does not contain funky characters. + # + # Set the value of the two flags in the command below in + # case a more strict sanitizing is needed. With the settings + # below, ad_sanitize_filename makes just sure the filename + # does not contain invalid characters. + # set fn [ad_sanitize_filename \ -collapse_spaces=false \ -tolower=false $fn] @@ -1850,7 +1854,6 @@ # the revision_id. TODO: clear revision_id on export. # set newValue [list name $newValue revision_id $revision_ids] - ${:object} set_property -new 1 ${:name} $newValue set :value $newValue } @@ -1905,6 +1908,25 @@ set reset_required 1 set :required false } + #if {${:CSSclass} eq "form-control"} { + # append :CSSclass -file + #} + # + # The following snippet is Bootstrap-only and requires in + # non-bootstrap cases styling. + # + #if {[info exists :choose_file_label]} { + # ::html::label -for ${:id} -class "btn btn-default" { + # ::html::span -class upload-btn-label { + # ::html::t ${:choose_file_label} + # } + # set :CSSclass form-control-hidden + # next + # } + #} else { + # next + #} + next ::html::t " " @@ -1943,8 +1965,16 @@ # - the form-field is not sticky (default) # set disabled [:is_disabled] - if {${:value} ne "" && !$disabled && ![:sticky] } { - ::html::input -type button -value [_ xowiki.clear] -id $id-control + if {${:value} ne "" && !$disabled && !${:sticky}} { + #::html::input -type button -value [_ xowiki.clear] -id $id-control + + set del_id "$id-control" + ::html::a -href "#" \ + -id $del_id \ + -title [_ xowiki.clear] \ + -class "delete-item-button" { + html::t "" + } template::add_event_listener \ -id $id-control \ -script [subst {document.getElementById('$id').value = ''; document.getElementById('__a$id').style.display = 'none';}] @@ -3861,7 +3891,7 @@ # if {$r > 0} { # - # Certain correction schemes devide by $r. We cannot use + # Certain correction schemes divide by $r. We cannot use # these schemes in such cases. # if {$f == 0} { Index: openacs-4/packages/xowiki/www/resources/xowiki-bootstrap3-specific.css =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/resources/Attic/xowiki-bootstrap3-specific.css,v diff -u -r1.1.2.7 -r1.1.2.8 --- openacs-4/packages/xowiki/www/resources/xowiki-bootstrap3-specific.css 17 Oct 2020 16:05:00 -0000 1.1.2.7 +++ openacs-4/packages/xowiki/www/resources/xowiki-bootstrap3-specific.css 18 Jan 2021 14:11:28 -0000 1.1.2.8 @@ -45,7 +45,14 @@ font-family: 'Glyphicons Halflings'; content: "\2709"; } +div.xowiki-content .upload-btn-label::before { + /* glyphicon-upload */ + font-family: 'Glyphicons Halflings'; + content: "\e027"; + margin-right: 6px; +} + /* * info sign (in forms) */ @@ -75,6 +82,8 @@ font-family: 'Glyphicons Halflings'; content: "\e204"; } + + div.xowiki-content a.link-icon::before { /* glyphicon-arrow-right */ font-family: 'Glyphicons Halflings'; Index: openacs-4/packages/xowiki/www/resources/xowiki.css =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/resources/xowiki.css,v diff -u -r1.64.2.16 -r1.64.2.17 --- openacs-4/packages/xowiki/www/resources/xowiki.css 23 Nov 2020 19:45:01 -0000 1.64.2.16 +++ openacs-4/packages/xowiki/www/resources/xowiki.css 18 Jan 2021 14:11:28 -0000 1.64.2.17 @@ -428,6 +428,11 @@ width: 9em; }*/ +div.xowiki-content input.form-control-hidden { + display: none; +} + + div.xowiki-content .content-with-folders fieldset.compound-field .repeatable { margin-left: 1em; } @@ -552,6 +557,13 @@ font-size: smaller; } +.xowiki-content div.file-control div { + display: inline; + margin-right: 6px; +} +.xowiki-content div.repeatable input[type=file] { + width: 95% +} /* * Local Variables: * mode: css