Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/OacsFs/popups/file-selector.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/OacsFs/popups/Attic/file-selector.tcl,v
diff -u -r1.1.2.3 -r1.1.2.4
--- openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/OacsFs/popups/file-selector.tcl 5 Jul 2016 16:49:33 -0000 1.1.2.3
+++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/OacsFs/popups/file-selector.tcl 5 Nov 2016 17:54:57 -0000 1.1.2.4
@@ -161,8 +161,7 @@
display_template {
+ id="oi@contents.object_id@" />
- onclick="selectImage('@contents.object_id@','@contents.file_url@','@contents.type@');return false;">@contents.name@
+ @contents.name@
}
orderby_desc {name desc}
orderby_asc {name asc}
@@ -240,8 +239,9 @@
} else {
append content_size_pretty " [_ file-storage.bytes]"
}
- if {$title eq ""} {set title $name}
-
+ if {$title eq ""} {
+ set title $name
+ }
set file_upload_name [fs::remove_special_file_system_characters \
-string $file_upload_name]
@@ -276,6 +276,18 @@
# this trick on some of its folders). If we don't, the hashes will cause
# the path to be chopped off (by ns_conn url) at the leftmost hash.
regsub -all {\#} $file_url {%23} file_url
+
+ #
+ # Register listeners
+ #
+ ad_proc template::add_event_listener -id "oi$object_id" -script [subst {
+ onPreview('$file_url','$type');
+ }]
+ if {$folder_p == 0} {
+ ad_proc template::add_event_listener -id "link$object_id" -script [subst {
+ selectImage('$object_id','$file_url','$type');
+ }]
+ }
}
set HTML_NothingSelected [_ acs-templating.HTMLArea_SelectImageNothingSelected]
Index: openacs-4/packages/xowiki/www/xinha/file-selector.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/xinha/file-selector.tcl,v
diff -u -r1.18.2.1 -r1.18.2.2
--- openacs-4/packages/xowiki/www/xinha/file-selector.tcl 10 Sep 2015 08:10:43 -0000 1.18.2.1
+++ openacs-4/packages/xowiki/www/xinha/file-selector.tcl 5 Nov 2016 17:54:57 -0000 1.18.2.2
@@ -212,18 +212,16 @@
display_template {
+ id="oi@contents.object_id@" />
-
- onclick="selectImage('@contents.object_id@','@contents.file_url@','@contents.type@');return false;">@contents.name@
+
+ @contents.name@
}
orderby_desc {name desc}
orderby_asc {name asc}
@@ -281,21 +279,23 @@
icon last_modified_pretty content_size_pretty
properties_link properties_url folder_p title
} contents get_fs_contents $fs_sql {
- set last_modified_ansi [lc_time_system_to_conn $last_modified_ansi]
+ set last_modified_ansi [lc_time_system_to_conn $last_modified_ansi]
set last_modified_pretty [lc_time_fmt $last_modified_ansi "%x %X"]
- set content_size_pretty [lc_numeric $content_size]
+ set content_size_pretty [lc_numeric $content_size]
if {$type eq "folder"} {
# append content_size_pretty " [_ file-storage.items]"
set content_size_pretty ""
} else {
append content_size_pretty " [_ file-storage.bytes]"
}
- if {$title eq ""} {set title $name}
+ if {$title eq ""} {
+ set title $name
+ }
set file_upload_name [fs::remove_special_file_system_characters \
-string $file_upload_name]
-
+
if { $content_size ne "" } {
incr content_size_total $content_size
}
@@ -322,16 +322,25 @@
}
}
-
# We need to encode the hashes in any i18n message keys (.LRN plays
# this trick on some of its folders). If we don't, the hashes will cause
# the path to be chopped off (by ns_conn url) at the leftmost hash.
regsub -all {\#} $file_url {%23} file_url
+
+ #
+ # Register listeners
+ #
+ ad_proc template::add_event_listener -id "oi$object_id" -script [subst {
+ onPreview('$file_url','$type');
+ }]
+ if {$folder_p == 0} {
+ ad_proc template::add_event_listener -id "link$object_id" -script [subst {
+ selectImage('$object_id','$file_url','$type');
+ }]
+ }
}
-
-
ad_return_template
# Local variables: