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 -r1.7.2.2 -r1.7.2.3
--- openacs-4/packages/xowiki/www/ckeditor-images/thumb-view.adp 11 Nov 2016 00:08:16 -0000 1.7.2.2
+++ openacs-4/packages/xowiki/www/ckeditor-images/thumb-view.adp 30 Nov 2016 19:07:06 -0000 1.7.2.3
@@ -31,7 +31,8 @@
@sub_files.title@
@sub_files.mime_type@
-
+
+
@sub_files.date@
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 -r1.6.2.1 -r1.6.2.2
--- openacs-4/packages/xowiki/www/ckeditor-images/thumb-view.tcl 10 Sep 2015 08:10:42 -0000 1.6.2.1
+++ openacs-4/packages/xowiki/www/ckeditor-images/thumb-view.tcl 30 Nov 2016 19:07:06 -0000 1.6.2.2
@@ -11,19 +11,32 @@
}
set output ""
-set return_url [ns_urlencode "[ad_conn url]?parent_id=$parent_id"]
-db_multirow -extend url sub_files get_children "
+set return_url [export_vars -base [ad_conn url] {parent_id}]
+db_multirow -extend {
+ url
+ download_url
+ img_id
+} sub_files get_children "
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)
+ 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/%'
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]
+ set download_url "${url}?m=download"
+ set img_id "preview-img-${revision_id}"
+ if {$mime_type in {"image/jpeg" "image/png" "image/gif"}} {
+ template::add_event_listener -id $img_id -script [subst {
+ changePreview('${download_url}','${name}', '${mime_type}');
+ }]
+ }
}
+
+
set server_url ""
# Local variables: