Index: openacs-4/packages/xowiki/xowiki.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/xowiki.info,v diff -u -N -r1.148.2.24 -r1.148.2.25 --- openacs-4/packages/xowiki/xowiki.info 9 Feb 2015 09:17:12 -0000 1.148.2.24 +++ openacs-4/packages/xowiki/xowiki.info 11 Feb 2015 12:31:40 -0000 1.148.2.25 @@ -10,10 +10,10 @@ t xowiki - + Gustaf Neumann A xotcl-based enterprise wiki system with multiple object types - 2015-02-09 + 2015-02-11 WU Vienna <pre> XoWiki is a Wiki implementation for OpenACS in XOTcl. Instead of @@ -55,14 +55,14 @@ BSD-Style 2 - + - + Index: openacs-4/packages/xowiki/catalog/xowiki.en_US.ISO-8859-1.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/catalog/xowiki.en_US.ISO-8859-1.xml,v diff -u -N -r1.64.2.3 -r1.64.2.4 --- openacs-4/packages/xowiki/catalog/xowiki.en_US.ISO-8859-1.xml 1 Feb 2015 16:47:23 -0000 1.64.2.3 +++ openacs-4/packages/xowiki/catalog/xowiki.en_US.ISO-8859-1.xml 11 Feb 2015 12:31:40 -0000 1.64.2.4 @@ -223,4 +223,12 @@ year years Your Tags + Attached images + Attached media + Choose file + Upload file + Width + Height + The width and height are calculated in pixels (proportions might get lost). + Insert image 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 -N -r1.239.2.28 -r1.239.2.29 --- openacs-4/packages/xowiki/tcl/form-field-procs.tcl 9 Feb 2015 09:38:09 -0000 1.239.2.28 +++ openacs-4/packages/xowiki/tcl/form-field-procs.tcl 11 Feb 2015 12:31:40 -0000 1.239.2.29 @@ -1799,19 +1799,21 @@ Class create richtext::ckeditor4 -superclass richtext -parameter { {editor ckeditor4} {mode wysiwyg} - {skin moono} + {skin bootstrapck} {toolbar Full} {CSSclass xowiki-ckeditor} {uiColor ""} {CSSclass xowiki-ckeditor} {customConfig "config.js"} {callback "/* callback code */"} {destroy_callback "/* callback code */"} - {extraPlugins ""} + {submit_callback ""} + {extraPlugins "xowikiimage"} {templatesFiles ""} {templates ""} {contentsCss /resources/xowiki/ck_contents.css} {imageSelectorDialog /xowiki/ckeditor-images/} + {additionalConfigOptions ""} } richtext::ckeditor4 set editor_mixin 1 richtext::ckeditor4 instproc initialize {} { @@ -1856,12 +1858,13 @@ } function calc_image_tags_to_wiki_image_links_inline (e) { - var data = $('
'+e.editor.getData()+'
'); + var data = $('
'+CKEDITOR.instances[e].getData()+'
'); data.find('img[type="wikilink"]').each( function() { var wiki_link = $(this).attr('alt'); $(this).replaceWith('[['+wiki_link+']]'); }); - document.getElementById(e.editor.config.textarea_id).innerHTML=data.html(); + CKEDITOR.instances[e].setData(data.html()); + CKEDITOR.instances[e].updateElement(); } function calc_wiki_image_links_to_image_tags (data) { @@ -1904,26 +1907,26 @@ ::xo::Page requireJS "/resources/xowiki/jquery/jquery.min.js" ::xo::Page requireJS "/resources/xowiki/ckeditor4/ckeditor.js" ::xo::Page requireJS "/resources/xowiki/ckeditor4/adapters/jquery.js" - ::xo::Page requireJS "/resources/xowiki/jquery-ui-1.8.17.custom.min.js" - ::xo::Page requireCSS "/resources/xowiki/jquery-ui-1.8.17.custom.css" - + #::xo::Page requireJS "/resources/xowiki/jquery-ui-1.8.17.custom.min.js" + #::xo::Page requireCSS "/resources/xowiki/jquery-ui-1.8.17.custom.css" + # In contrary to the doc, ckeditor4 names instances after the id, # not the name. set id [my id] set name [my name] set package_id [[my object] package_id] - #my extraPlugins {xowikiimage tlflrn} - #my extraPlugins {} if {[my set displayMode] eq "inline"} {my lappend extraPlugins sourcedialog} + if {"xowikiimage" in [my extraPlugins]} { my js_image_helper set ready_callback {xowiki_image_callback(e.editor);} } else { set ready_callback "/*none*/;" - set blur_callback "/*none*/;" + set submit_callback "/*none*/;" } set options [subst { + [my set additionalConfigOptions] toolbar : '[my toolbar]', uiColor: '[my uiColor]', language: '[lang::conn::language]', @@ -1975,40 +1978,40 @@ } elseif {[my set displayMode] eq "inline"} { if {!$is_repeat_template} { if {"xowikiimage" in [my extraPlugins]} { - set ready_callback "xowiki_image_callback(CKEDITOR.instances\['ckinline_$id'\]);" - set blur_callback "calc_image_tags_to_wiki_image_links_inline(e);" + set ready_callback "xowiki_image_callback(CKEDITOR.instances\['$id'\]);" + set submit_callback "calc_image_tags_to_wiki_image_links_inline('$id');" } - - ::xo::Page requireJS [subst -nocommands { - function load_ckinline_$id () { - CKEDITOR.inline('ckinline_$id', { + + set submit_callback "$submit_callback [my submit_callback]" + ::xo::Page requireJS [subst { + function load_$id () { + CKEDITOR.inline('$id', { on: { - blur: function(e) { - $blur_callback + instanceReady: function(e) { + \$(e.editor.element.\$).attr('title', '[my set label]'); + \$(e.editor.element.\$.form).submit(function(e) { + $submit_callback + }); } }, $options }); } \$(document).ready(function() { - load_ckinline_$id (); + load_$id (); $ready_callback - }); + }); }] } - my set style "display:none;" next - ::html::div "id ckinline_[my set id] name [my set name] class xowiki-ckeditor contenteditable true" { - ::html::t -disableOutputEscaping [my value] - } } else { if {!$is_repeat_template} { set callback [my callback] ::xo::Page requireJS [subst -nocommands { function load_$id () { \$( '#$id' ).ckeditor(function() { $callback }, { $options - }); + }); } \$(document).ready(function() { load_$id (); @@ -2019,7 +2022,7 @@ next } } - } + } ########################################################### # Index: openacs-4/packages/xowiki/www/ckeditor-images/image.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/ckeditor-images/image.png,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/xowiki/www/ckeditor-images/index.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/ckeditor-images/index.adp,v diff -u -N -r1.3 -r1.3.2.1 --- openacs-4/packages/xowiki/www/ckeditor-images/index.adp 13 Sep 2012 16:05:34 -0000 1.3 +++ openacs-4/packages/xowiki/www/ckeditor-images/index.adp 11 Feb 2015 12:31:41 -0000 1.3.2.1 @@ -1,111 +1,144 @@ - + - + + -#xowiki.attached_images#: +#xowiki.attached_media#: + + + +
-
-
- +
+ + +
+ + +
+
- - - -
+ - - + + - - + + +
+
URL: - - - - - URL: + + + + + +
Alternativtext: - - + +
- \ No newline at end of file + Index: openacs-4/packages/xowiki/www/ckeditor-images/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/ckeditor-images/index.tcl,v diff -u -N -r1.4.2.1 -r1.4.2.2 --- openacs-4/packages/xowiki/www/ckeditor-images/index.tcl 5 Aug 2014 13:10:50 -0000 1.4.2.1 +++ openacs-4/packages/xowiki/www/ckeditor-images/index.tcl 11 Feb 2015 12:31:41 -0000 1.4.2.2 @@ -3,7 +3,7 @@ } { parent_id:notnull,naturalnum {bild_url ""} -} +} set package_url [ad_conn package_url] set image_browser_url $package_url/ckeditor-images set fs_package_id $parent_id Index: openacs-4/packages/xowiki/www/ckeditor-images/thumb-view.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/ckeditor-images/thumb-view.adp,v diff -u -N -r1.4 -r1.4.2.1 --- openacs-4/packages/xowiki/www/ckeditor-images/thumb-view.adp 13 Sep 2012 16:05:34 -0000 1.4 +++ openacs-4/packages/xowiki/www/ckeditor-images/thumb-view.adp 11 Feb 2015 12:31:41 -0000 1.4.2.1 @@ -1,25 +1,41 @@ - +
-
- - - - -
@sub_files.date@
Löschen +
+ + @sub_files.title@ + @sub_files.mime_type@ + + + +
@sub_files.date@
Löschen

- \ No newline at end of file + Index: openacs-4/packages/xowiki/www/ckeditor-images/thumb-view.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/ckeditor-images/thumb-view.tcl,v diff -u -N -r1.4.2.2 -r1.4.2.3 --- openacs-4/packages/xowiki/www/ckeditor-images/thumb-view.tcl 5 Aug 2014 13:10:50 -0000 1.4.2.2 +++ openacs-4/packages/xowiki/www/ckeditor-images/thumb-view.tcl 11 Feb 2015 12:31:41 -0000 1.4.2.3 @@ -1,27 +1,27 @@ ad_page_contract { } { - {parent_id:naturalnum ""} + {parent_id:naturalnum ""} } -validate { - parent_id_exists -requires {parent_id} { - if {[xo::dc 0or1row object_exists "select item_id from cr_items where item_id =:parent_id"] == 0} { - #ad_complain "Das angegebene Objekt existiert nicht." + parent_id_exists -requires {parent_id} { + if {[xo::dc 0or1row object_exists "select item_id from cr_items where item_id = :parent_id"] == 0} { + ad_complain "Specified item does not exist" + } } - } } set output "" set return_url [ns_urlencode "[ad_conn url]?parent_id=$parent_id"] db_multirow -extend url sub_files get_children " -select package_id,name,cr.item_id ,revision_id,mime_type, to_char(publish_date, 'yyyy-mm-dd, HH:MM') as date +select package_id,name,cr.title,cr.item_id,revision_id,mime_type, to_char(publish_date, 'yyyy-mm-dd, HH:MM') as date from cr_items ci inner join cr_revisions cr on (ci.item_id = cr.item_id) join acs_objects o on o.object_id=cr.item_id where parent_id = :parent_id and revision_id = ci.live_revision - AND cr.mime_type LIKE 'image/%' + AND cr.mime_type LIKE 'image/%' ORDER BY publish_date DESC" { - ::xowiki::Package initialize -package_id $package_id - set item [::xowiki::File get_instance_from_db -item_id $item_id] - set url "[$item pretty_link]" + ::xowiki::Package initialize -package_id $package_id + set item [::xowiki::File get_instance_from_db -item_id $item_id] + set url [$item pretty_link] } set server_url "" Index: openacs-4/packages/xowiki/www/ckeditor-images/upload_image.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/ckeditor-images/upload_image.adp,v diff -u -N -r1.3 -r1.3.2.1 --- openacs-4/packages/xowiki/www/ckeditor-images/upload_image.adp 13 Sep 2012 16:05:34 -0000 1.3 +++ openacs-4/packages/xowiki/www/ckeditor-images/upload_image.adp 11 Feb 2015 12:31:41 -0000 1.3.2.1 @@ -19,7 +19,7 @@ fieldset { padding: 0px 10px 5px 5px; } select, input, button { font: 11px Tahoma,Verdana,sans-serif; } .space { padding: 2px; } - + .title { background: #ddf; color: #000; font-weight: bold; font-size: 120%; padding: 3px 10px; margin-bottom: 10px; border-bottom: 1px solid black; letter-spacing: 2px; } @@ -36,15 +36,15 @@ - +
-#xowiki.choose_image#: +#xowiki.choose_file#:
#xowiki.width#: #xowiki.height#:
-#xowiki.image_width_hint# +
@@ -55,4 +55,4 @@ - \ No newline at end of file + Index: openacs-4/packages/xowiki/www/ckeditor-images/upload_image.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/ckeditor-images/upload_image.tcl,v diff -u -N -r1.7.2.3 -r1.7.2.4 --- openacs-4/packages/xowiki/www/ckeditor-images/upload_image.tcl 5 Aug 2014 13:10:50 -0000 1.7.2.3 +++ openacs-4/packages/xowiki/www/ckeditor-images/upload_image.tcl 11 Feb 2015 12:31:41 -0000 1.7.2.4 @@ -10,9 +10,9 @@ -html { enctype multipart/form-data } \ -mode edit \ -form { - {upload_file:file(file),optional {label "Bild zum Hochladen auswählen"}} - {width:text(text),optional {label "Breite in Pixel"}} - {height:text(text),optional {label "Höhe in Pixel"}} + {upload_file:file(file),optional {label #xowiki.choose_file#}} + {width:text(text),optional {label #xowiki.width_in_pixel}} + {height:text(text),optional {label #xowiki.height_in_pixel}} } -on_submit { set width [template::element::get_values upload_form width] set height [template::element::get_values upload_form height] @@ -22,36 +22,33 @@ set file_name [template::util::file::get_property filename $upload_file] set upload_tmpfile [template::util::file::get_property tmp_filename $upload_file] - set mime_type [template::util::file::get_property mime_type $upload_file] - #ds_comment $upload_tmpfile + set mime_type [::xowiki::guesstype $file_name] + set tmp_size [file size $upload_tmpfile] + if {$size ne ""} {exec convert -resize $size $upload_tmpfile $upload_tmpfile} + if {![regexp (image/*|audio/mpeg|application/x-shockwave-flash|video/mp4) $mime_type]} { + #template::form::set_error "upload_image" "upload_file" "[_ tlf-resource-integrator.HTMLArea_SelectImageUploadNoImage]" + break + } - if {![string match "image/*" $mime_type]} { - # File is no image - template::form::set_error "upload_image" "upload_file" "[_ acs-templating.HTMLArea_SelectImageUploadNoImage]" - break - } - - #set parent_id [xo::dc get_value _ "select parent_id from cr_items where item_id=:fs_package_id"] set title $file_name - set existing_filenames [xo::dc list _ "select name from cr_items where parent_id = :parent_id" ] - ns_log notice "util_text_to_url -text ${title} -existing_urls \"$existing_filenames\" -replacement \"_\"" - set filename [util_text_to_url -text "${title}" -existing_urls "$existing_filenames" -replacement "_"] + set filename [util_text_to_url -text $title -existing_urls $existing_filenames -replacement "_"] set package_id [xo::dc get_value _ "select package_id from acs_objects where object_id=:parent_id"] + ::xowiki::Package initialize -package_id $package_id set file_object [::xowiki::File new -destroy_on_cleanup \ -title $title \ -name file:$filename \ -parent_id $parent_id \ -package_id $package_id \ - -mime_type [::xowiki::guesstype $title] \ + -mime_type $mime_type \ -creation_user [ad_conn user_id]] $file_object set import_file $upload_tmpfile $file_object save_new set revision_id [$file_object set revision_id] set bild_url "[$file_object pretty_link]?m=download" set image_browser_url [ad_conn package_url]/ckeditor-images - set js_update "parent.frames\['thumbs'\].location='$image_browser_url/thumb-view?parent_id=${parent_id}';" + set js_update "parent.frames\['thumbs'\].location='$image_browser_url/thumb-view?parent_id=$parent_id';" }