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.224 -r1.225 --- openacs-4/packages/xowiki/tcl/form-field-procs.tcl 30 Dec 2012 13:49:44 -0000 1.224 +++ openacs-4/packages/xowiki/tcl/form-field-procs.tcl 28 Feb 2013 17:13:38 -0000 1.225 @@ -764,21 +764,19 @@ return [list name file:[my name] parent_id [[my object] item_id]] } - file instproc get_value_from_form {} { - set old_value [[my object] form_parameter __old_value_[my name] ""] + file instproc no_value_provided {} { set v [my set value] - #my msg "value '$v' // old_value '$old_value'" - # - # Figure out, if we got a different file-name (value). If the - # file-name is the same as in the last revision, we return a - # "-". This has the effect, that file file is not uploaded again. - # - #if {$old_value ne "" && $old_value eq [my set value]} {} - - if {$old_value ne "" && $v eq ""} { - return "-" + expr {$v eq "" || $v eq "-"} + } + file instproc get_old_value {} { + return [[my object] form_parameter __old_value_[my name] ""] + } + + file instproc get_value {} { + if {[my no_value_provided]} { + return [my get_old_value] } - return $v + return [my set value] } file instproc get_from_value {value attribute {raw ""}} { @@ -801,21 +799,28 @@ return [lindex $raw 0] } + file instproc value {args} { + if {[llength $args] == 0} { + set r [my get_value] + } else { + set r [next] + } + #my msg "[my name]: value -> '$r' [my exists value] '[my set value]'" + return $r + } + file instproc convert_to_internal {} { - my msg "convert_to_internal" + #my msg "convert_to_internal" my instvar value - set v [my get_value_from_form] - if {$v eq "-" || $v eq ""} { - # nothing to do, keep the old value - #my msg "nothing to do with '$v'" - set value [[my object] form_parameter __old_value_[my name] ""] - [my object] set_property [my name] $value + if {[my no_value_provided]} { + [my object] set_property -new 1 [my name] [my get_old_value] return } + #my msg "[my name]: got value '$value'" regsub -all {\\+} $value {/} value ;# fix IE upload path set value [::file tail $value] - [my object] set_property [my name] $value + [my object] set_property -new 1 [my name] $value set package_id [[my object] package_id] array set entry_info [my entry_info $value] @@ -839,6 +844,7 @@ # Update the value with the attribute value pair list containing # the revision_id. TODO: clear revision_id on export. # + #my msg "[my name]: set_property [my name] [list name $value revision_id [$file_object revision_id]]" [my object] set_property -new 1 [my name] [list name $value revision_id [$file_object revision_id]] } else { # create a new file @@ -879,19 +885,72 @@ } } + # file instproc render_input {} { + # util_createDom [list [my get_spec]] + # } + + # file instproc get_spec {} { + # my instvar value + # set package_id [[my object] package_id] + # array set entry_info [my entry_info $value] + # set fn [my get_from_value $value name $value] + # set href [$package_id pretty_link -download 1 -parent_id $entry_info(parent_id) $entry_info(name)] + # if {![my istype image]} { + # append href ?filename=[ns_urlencode $fn] + # } + # # + # # The HTML5 handling of "required" would force us to upload in + # # every form the file again. To implement the sticky option, we + # # set temporarily the "required" attribute to false + # # + # if {[my exists required]} { + # set reset_required 1 + # my set required false + # } + # + # lassign [next] tag atts children + # + # if {[info exists reset_required]} { + # my set required true + # } + # + # set additional_spec [util_tdom2list { + # # FOLLOWING GIVES TROUBLE, SEE util_spec2json FOR DETAILS + # ::html::t " " + # set id __old_value_[my name] + # ::html::input -type hidden -name $id -id $id -value $value + # #my msg "old_value '$value'" + # ::html::span -class file-control -id __a$id { + # ::html::a -href $href {::html::t [my label_or_value $fn] } + # # Show the clear button just when + # # - there is something to clear, and + # # - the formfield is not disabled, and + # # - the form-field is not sticky (default) + # set disabled [expr {[my exists disabled] && [my disabled] ne "false"}] + # if {$value ne "" && !$disabled && ![my sticky] } { + # ::html::input -type button -value clear \ + # -onClick "document.getElementById('$id').value = ''; document.getElementById('__a$id').style.display = 'none';" + # } + # } + # }] + # + # lappend children $additional_spec + # return [list $tag $atts $children] + # } + file instproc render_input {} { - util_createDom [list [my get_spec]] - } - file instproc get_spec {} { my instvar value set package_id [[my object] package_id] + array set entry_info [my entry_info $value] set fn [my get_from_value $value name $value] + #my msg "[my name]: [list my get_from_value $value name $value] => '$fn'" set href [$package_id pretty_link -download 1 -parent_id $entry_info(parent_id) $entry_info(name)] if {![my istype image]} { append href ?filename=[ns_urlencode $fn] } + # # The HTML5 handling of "required" would force us to upload in # every form the file again. To implement the sticky option, we @@ -901,35 +960,29 @@ set reset_required 1 my set required false } - - lassign [next] tag atts children + next if {[info exists reset_required]} { my set required true } - set additional_spec [util_tdom2list { - # FOLLOWING GIVES TROUBLE, SEE util_spec2json FOR DETAILS - ::html::t " " - set id __old_value_[my name] - ::html::input -type hidden -name $id -id $id -value $value - #my msg "old_value '$value'" - ::html::span -class file-control -id __a$id { - ::html::a -href $href {::html::t [my label_or_value $fn] } - # Show the clear button just when - # - there is something to clear, and - # - the formfield is not disabled, and - # - the form-field is not sticky (default) - set disabled [expr {[my exists disabled] && [my disabled] ne "false"}] - if {$value ne "" && !$disabled && ![my sticky] } { - ::html::input -type button -value clear \ - -onClick "document.getElementById('$id').value = ''; document.getElementById('__a$id').style.display = 'none';" - } + ::html::t " " + set id __old_value_[my name] + ::html::input -type hidden -name $id -id $id -value $value + ::html::span -class file-control -id __a$id { + ::html::a -href $href {::html::t [my label_or_value $fn] } + + # Show the clear button just when + # - there is something to clear, and + # - the formfield is not disabled, and + # - the form-field is not sticky (default) + + set disabled [expr {[my exists disabled] && [my disabled] ne "false"}] + if {$value ne "" && !$disabled && ![my sticky] } { + ::html::input -type button -value clear \ + -onClick "document.getElementById('$id').value = ''; document.getElementById('__a$id').style.display = 'none';" } - }] - - lappend children $additional_spec - return [list $tag $atts $children] + } } ########################################################### @@ -1619,11 +1672,9 @@ function calc_wiki_image_links_to_image_tags (data) { var pathname = window.location.pathname; pathname = pathname.substr(pathname.lastIndexOf("/")+1,pathname.length) - console.log('pathname' + pathname); pathname = pathname.replace(/:/ig,"%3a"); - var regex_wikilink = new RegExp('(\\[\\[./image:)(.*?)(\\]\\])', 'g'); - data = data.replace(regex_wikilink,'./image:$2'); - console.log('data' + data); + var regex_wikilink = new RegExp('(\\[\\[.SELF./image:)(.*?)(\\]\\])', 'g'); + data = data.replace(regex_wikilink,'.SELF./image:$2'); return data } } @@ -2754,7 +2805,7 @@ # Set the internal representation based on the components values. set value [list] foreach c [my components] { - #my msg "lappending [$c name] [$c value] " + #my msg "$c [$c info class] lappending [list [$c name] [$c value]]" lappend value [$c name] [$c value] } #my msg "[my name]: get_compound_value returns value=$value" Index: openacs-4/packages/xowiki/tcl/package-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/package-procs.tcl,v diff -u -r1.265 -r1.266 --- openacs-4/packages/xowiki/tcl/package-procs.tcl 7 Dec 2012 15:50:12 -0000 1.265 +++ openacs-4/packages/xowiki/tcl/package-procs.tcl 28 Feb 2013 17:13:38 -0000 1.266 @@ -1146,7 +1146,7 @@ -parent_id $parent_id \ -assume_folder [expr {[incr n] < $nr_elements}] \ $element] - #my log "$element => [array get {}]" + #my msg "simple_item_ref $element => [array get {}]" if {$(item_id) == 0} { set parent_id $(parent_id) break @@ -1340,6 +1340,8 @@ if {[$item_id is_folder_page]} { return [list link_type "folder" prefix "" stripped_name $name parent_id $parent_id] } + set stripped_name $name + set prefix "" regexp {^(.+):(.+)$} $name _ prefix stripped_name return [list link_type "link" prefix $prefix stripped_name $stripped_name parent_id $parent_id] } Index: openacs-4/packages/xowiki/tcl/xowiki-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/xowiki-procs.tcl,v diff -u -r1.462 -r1.463 --- openacs-4/packages/xowiki/tcl/xowiki-procs.tcl 22 Feb 2013 14:00:32 -0000 1.462 +++ openacs-4/packages/xowiki/tcl/xowiki-procs.tcl 28 Feb 2013 17:13:38 -0000 1.463 @@ -1546,6 +1546,7 @@ ${lang}:$stripped_name] set (link_type) language } else { + regsub {^[.]SELF[.]/} $(link) [my name]/ (link) array set "" [$package_id item_ref \ -use_package_path $use_package_path \ -default_lang [my lang] \ Index: openacs-4/packages/xowiki/tcl/xowiki-www-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/xowiki-www-procs.tcl,v diff -u -r1.312 -r1.313 --- openacs-4/packages/xowiki/tcl/xowiki-www-procs.tcl 7 Dec 2012 15:50:12 -0000 1.312 +++ openacs-4/packages/xowiki/tcl/xowiki-www-procs.tcl 28 Feb 2013 17:13:38 -0000 1.313 @@ -1779,7 +1779,6 @@ } #my msg "fields $field_names // $form_fields" #foreach f $form_fields { my msg "... $f [$f name]" } - # # We have a form and get all form input from the fields of the # from into form field objects. @@ -1812,6 +1811,7 @@ if {[regexp {^(.+)[.](tmpfile|content-type)} $att _ file field]} { set f [my lookup_form_field -name $file $form_fields] $f $field [string trim [$cc form_parameter $att]] + #my msg "[$f name]: [list $f $field [string trim [$cc form_parameter $att]]]" } else { set f [my lookup_form_field -name $att $form_fields] set value [$f value [string trim [$cc form_parameter $att]]] @@ -1844,9 +1844,9 @@ default { set f [my lookup_form_field -name $c $form_fields] set processed($c) 1 - #my msg "compute value of $c" + #my msg "container $c: compute value of $c [$f info class]" set __ia($c) [$f value] - #my msg "__ia($c) is set to '$__ia($c)'" + #my msg "container $c: __ia($c) is set to '$__ia($c)'" } } } Index: openacs-4/packages/xowiki/www/oacs-view.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/Attic/oacs-view.adp,v diff -u -r1.65 -r1.66 --- openacs-4/packages/xowiki/www/oacs-view.adp 13 Sep 2012 16:05:30 -0000 1.65 +++ openacs-4/packages/xowiki/www/oacs-view.adp 28 Feb 2013 17:13:38 -0000 1.66 @@ -1,4 +1,4 @@ - + @title;noquote@ @context;noquote@ @@ -86,7 +86,11 @@ @top_includelets;noquote@

@title@ (@page_context@)

@title@

- @content;noquote@ + +
@folderhtml;noquote@
+
@content;noquote@
+
+ @content;noquote@ @footer;noquote@ Index: openacs-4/packages/xowiki/www/oacs-view2.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/Attic/oacs-view2.adp,v diff -u -r1.44 -r1.45 --- openacs-4/packages/xowiki/www/oacs-view2.adp 13 Sep 2012 16:05:30 -0000 1.44 +++ openacs-4/packages/xowiki/www/oacs-view2.adp 28 Feb 2013 17:13:38 -0000 1.45 @@ -1,4 +1,4 @@ - + @title;noquote@ @context;noquote@ @@ -93,7 +93,11 @@ @top_includelets;noquote@

@title@ (@page_context@)

@title@

- @content;noquote@ + +
@folderhtml;noquote@
+
@content;noquote@
+
+ @content;noquote@ Index: openacs-4/packages/xowiki/www/view-book-no-ajax.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/Attic/view-book-no-ajax.adp,v diff -u -r1.22 -r1.23 --- openacs-4/packages/xowiki/www/view-book-no-ajax.adp 7 Dec 2012 15:50:12 -0000 1.22 +++ openacs-4/packages/xowiki/www/view-book-no-ajax.adp 28 Feb 2013 17:13:38 -0000 1.23 @@ -1,4 +1,4 @@ - + @title;noquote@ @context;noquote@ Index: openacs-4/packages/xowiki/www/view-book.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/Attic/view-book.adp,v diff -u -r1.33 -r1.34 --- openacs-4/packages/xowiki/www/view-book.adp 7 Dec 2012 15:50:13 -0000 1.33 +++ openacs-4/packages/xowiki/www/view-book.adp 28 Feb 2013 17:13:38 -0000 1.34 @@ -1,4 +1,4 @@ - + @title;noquote@ @context;noquote@ Index: openacs-4/packages/xowiki/www/view-default.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/Attic/view-default.adp,v diff -u -r1.62 -r1.63 --- openacs-4/packages/xowiki/www/view-default.adp 7 Dec 2012 15:50:13 -0000 1.62 +++ openacs-4/packages/xowiki/www/view-default.adp 28 Feb 2013 17:13:38 -0000 1.63 @@ -1,4 +1,4 @@ - + @title;noquote@ @context;noquote@ Index: openacs-4/packages/xowiki/www/view-links.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/Attic/view-links.adp,v diff -u -r1.52 -r1.53 --- openacs-4/packages/xowiki/www/view-links.adp 7 Dec 2012 15:50:13 -0000 1.52 +++ openacs-4/packages/xowiki/www/view-links.adp 28 Feb 2013 17:13:38 -0000 1.53 @@ -1,4 +1,4 @@ - +
Index: openacs-4/packages/xowiki/www/view-plain.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/Attic/view-plain.adp,v diff -u -r1.48 -r1.49 --- openacs-4/packages/xowiki/www/view-plain.adp 7 Dec 2012 15:50:13 -0000 1.48 +++ openacs-4/packages/xowiki/www/view-plain.adp 28 Feb 2013 17:13:38 -0000 1.49 @@ -1,4 +1,4 @@ - +
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.59 -r1.60 --- openacs-4/packages/xowiki/www/resources/xowiki.css 13 Sep 2012 16:05:42 -0000 1.59 +++ openacs-4/packages/xowiki/www/resources/xowiki.css 28 Feb 2013 17:13:38 -0000 1.60 @@ -460,6 +460,10 @@ margin-left: 10em; } +div.xowiki-content .content-with-folders fieldset.compound-field .repeatable { + margin-left: 1em; +} + div.xowiki-content #menubar a.disabled { color: #A0A0A0; /* or maybe display none */ Index: openacs-4/packages/xowiki/www/resources/ckeditor/_source/plugins/xowikiimage/plugin.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/resources/ckeditor/_source/plugins/xowikiimage/Attic/plugin.js,v diff -u -r1.3 -r1.4 --- openacs-4/packages/xowiki/www/resources/ckeditor/_source/plugins/xowikiimage/plugin.js 13 Sep 2012 16:06:14 -0000 1.3 +++ openacs-4/packages/xowiki/www/resources/ckeditor/_source/plugins/xowikiimage/plugin.js 28 Feb 2013 17:13:38 -0000 1.4 @@ -9,7 +9,6 @@ }); CKEDITOR.plugins.add( 'xowikiimage', { - icon: this.path + 'image.gif', lang : [ 'en', 'de' ], init : function( editor ) { @@ -28,7 +27,9 @@ xowikiimage_dialog.find("#insert_form").submit(function() { var pathname = window.location.pathname; pathname = pathname.substr(pathname.lastIndexOf("/")+1,pathname.length) - insert_the_image(xowikiimage_dialog.find("#f_url").val().replace(/file:/g, "image:"),pathname+'/'+xowikiimage_dialog.find("#f_url").val()+'?m=download',editor); + insert_the_image(xowikiimage_dialog.find("#f_url").val().replace(/file:/g, "image:"), + pathname+'/'+xowikiimage_dialog.find("#f_url").val()+'?m=download', + editor); xowikiimage_dialog.dialog("close"); return false; }); @@ -38,14 +39,15 @@ // Register the toolbar button. editor.ui.addButton( 'xowikiImage', { label : editor.lang.xowikiimage['insertImage'], - command : pluginName + command : pluginName, + icon: this.path + 'images/image.gif' }); } } ); var insert_the_image=function (me,src,editor) { - editor.insertHtml("\""+me+"\""); + editor.insertHtml("\".SELF./"+me+"\""); //editor.insertHtml(me); } Index: openacs-4/packages/xowiki/www/resources/ckeditor/_source/plugins/xowikiimage/images/image.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/resources/ckeditor/_source/plugins/xowikiimage/images/Attic/image.gif,v diff -u Binary files differ Index: openacs-4/packages/xowiki/www/resources/ckeditor/_source/plugins/xowikiimage/lang/de.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/resources/ckeditor/_source/plugins/xowikiimage/lang/Attic/de.js,v diff -u -r1.3 -r1.4 --- openacs-4/packages/xowiki/www/resources/ckeditor/_source/plugins/xowikiimage/lang/de.js 13 Sep 2012 16:06:14 -0000 1.3 +++ openacs-4/packages/xowiki/www/resources/ckeditor/_source/plugins/xowikiimage/lang/de.js 28 Feb 2013 17:13:38 -0000 1.4 @@ -1,6 +1,6 @@ CKEDITOR.plugins.setLang( 'xowikiimage', 'de', { xowikiimage : { - insertImage : 'Bild einf�gen' + insertImage : 'Bild einfügen' } }); Index: openacs-4/packages/xowiki/www/resources/ckeditor/plugins/xowikiimage/plugin.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/resources/ckeditor/plugins/xowikiimage/Attic/plugin.js,v diff -u -r1.3 -r1.4 --- openacs-4/packages/xowiki/www/resources/ckeditor/plugins/xowikiimage/plugin.js 13 Sep 2012 16:06:40 -0000 1.3 +++ openacs-4/packages/xowiki/www/resources/ckeditor/plugins/xowikiimage/plugin.js 28 Feb 2013 17:13:38 -0000 1.4 @@ -9,7 +9,6 @@ }); CKEDITOR.plugins.add( 'xowikiimage', { - icon: this.path + 'image.gif', lang : [ 'en', 'de' ], init : function( editor ) { @@ -28,7 +27,9 @@ xowikiimage_dialog.find("#insert_form").submit(function() { var pathname = window.location.pathname; pathname = pathname.substr(pathname.lastIndexOf("/")+1,pathname.length) - insert_the_image(xowikiimage_dialog.find("#f_url").val().replace(/file:/g, "image:"),pathname+'/'+xowikiimage_dialog.find("#f_url").val()+'?m=download',editor); + insert_the_image(xowikiimage_dialog.find("#f_url").val().replace(/file:/g, "image:"), + pathname+'/'+xowikiimage_dialog.find("#f_url").val()+'?m=download', + editor); xowikiimage_dialog.dialog("close"); return false; }); @@ -38,14 +39,15 @@ // Register the toolbar button. editor.ui.addButton( 'xowikiImage', { label : editor.lang.xowikiimage['insertImage'], - command : pluginName + command : pluginName, + icon: this.path + 'images/image.gif' }); } } ); var insert_the_image=function (me,src,editor) { - editor.insertHtml("\""+me+"\""); + editor.insertHtml("\".SELF./"+me+"\""); //editor.insertHtml(me); } Index: openacs-4/packages/xowiki/www/resources/ckeditor/plugins/xowikiimage/images/image.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/resources/ckeditor/plugins/xowikiimage/images/Attic/image.gif,v diff -u Binary files differ Index: openacs-4/packages/xowiki/www/resources/ckeditor/plugins/xowikiimage/lang/de.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/resources/ckeditor/plugins/xowikiimage/lang/Attic/de.js,v diff -u -r1.3 -r1.4 --- openacs-4/packages/xowiki/www/resources/ckeditor/plugins/xowikiimage/lang/de.js 13 Sep 2012 16:06:40 -0000 1.3 +++ openacs-4/packages/xowiki/www/resources/ckeditor/plugins/xowikiimage/lang/de.js 28 Feb 2013 17:13:38 -0000 1.4 @@ -1,6 +1,6 @@ CKEDITOR.plugins.setLang( 'xowikiimage', 'de', { xowikiimage : { - insertImage : 'Bild einf�gen' + insertImage : 'Bild einfügen' } });