Index: openacs-4/packages/xowiki/tcl/link-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/link-procs.tcl,v diff -u -N -r1.40 -r1.41 --- openacs-4/packages/xowiki/tcl/link-procs.tcl 11 Feb 2008 02:16:41 -0000 1.40 +++ openacs-4/packages/xowiki/tcl/link-procs.tcl 25 Feb 2008 11:16:01 -0000 1.41 @@ -194,12 +194,21 @@ } } + + # + # localimage link + # + Class create ::xowiki::Link::localimage -superclass ::xowiki::Link::image ::xowiki::Link::localimage instproc render {} { my render_found [my href] [my label] } - Class create ::xowiki::Link::file -superclass ::xowiki::Link::image -parameter { + # + # file link + # + + Class create ::xowiki::Link::file -superclass ::xowiki::Link::image -parameter { width height align pluginspage pluginurl hidden href target autostart loop volume controls controller mastersound starttime endtime } @@ -229,19 +238,30 @@ } } + # + # css link + # + Class create ::xowiki::Link::css -superclass ::xowiki::Link::file -parameter { } ::xowiki::Link::css instproc render_found {href label} { ::xo::Page requireCSS $href return "" } + + # + # js link + # Class create ::xowiki::Link::js -superclass ::xowiki::Link::file -parameter { } ::xowiki::Link::js instproc render_found {href label} { ::xo::Page requireJS $href return "" } + # + # swf link + # Class create ::xowiki::Link::swf -superclass ::xowiki::Link::file -parameter { width height bgcolor version quality wmode align salign play loop menu scale @@ -275,7 +295,99 @@ " } + # + # plugin link + # +# Class create ::xowiki::Link::plugin -superclass ::xowiki::Link::file -parameter { +# classid width height autostart params +# } +# ::xowiki::Link::plugin instproc render_found {href label} { +# my instvar package_id name + +# foreach {width height autostart} {320 240 true} break +# foreach a {classid width height autostart} {if {[my exists $a]} {set $a [my set $a]}} +# set arguments [list width height autostart] + +# set object_params "" +# if {[my exists params]} { +# set paramlist [split [my set params] ,] +# foreach p $paramlist { +# set pair [split $p =] +# set param([lindex $pair 0]) [lindex $pair 1] +# } +# } + +# #my msg [my name]-guess-type=[::xowiki::guesstype [my name]] +# set mime [::xowiki::guesstype [my name]] + +# switch $mime { +# video/x-ms-wmv { +# # TODO: using classid will stop firefox loading plugin, +# # without classid IE asks user to allow addon +# # also possible: application/x-mplayer2 +# if {![my exists classid]} {set classid "CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6"} +# foreach f $arguments {if {[info exists $f]} {append object_params ""}} +# set objectElement \ +# "\n\ +# \n$object_params\n\ +# " +# } +# video/quicktime { +# if {![my exists classid]} {set classid "CLSID:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"} +# foreach f $arguments {if {[info exists $f]} {append object_params ""}} +# set objectElement \ +# " \n\ +# \n\ +# \n\ +# $object_params \n\ +# \n\n" +# } +# application/x-shockwave-flash { +# if {![my exists classid]} {set classid "CLSID:D27CDB6E-AE6D-11cf-96B8-444553540000"} +# set embed_options "" +# set app_params "?" +# foreach f $arguments {if {[info exists $f]} { append embed_options "$f = '[set $f]' " }} +# foreach {att value} [array get param] {append app_params "$att=$value&"} ;# replace with export_vars +# set objectElement \ +# " \n\ +# \n\ +# \n\ +# \n" +# } +# application/java { +# if {![my exists classid]} {set classid "clsid:CAFEEFAC-0015-0000-0000-ABCDEFFEDCBA"} +# if {![info exists param(code)]} {set param(code) [my stripped_name]} +# if {![info exists codebase]} {set codebase [$package_id pretty_link -lang [my lang] -download true ""]} + +# foreach {att value} [array get param] {append object_params "\n"} +# set objectElement \ +# "\n\ +# \n\ +# $object_params \n\ +# No Java Support. \n\ +# \n\ +# $object_params \n\ +# \n" +# } +# default { +# my msg "unknown mime type '$mime' for plugin" +# #set mime "application/x-oleobject" +# } +# } + +# return "$objectElement +#
$label ([my name])
+# " +# } + + + # # glossary links # Index: openacs-4/packages/xowiki/tcl/xowiki-form-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/xowiki-form-procs.tcl,v diff -u -N -r1.95 -r1.96 --- openacs-4/packages/xowiki/tcl/xowiki-form-procs.tcl 28 Dec 2007 16:49:29 -0000 1.95 +++ openacs-4/packages/xowiki/tcl/xowiki-form-procs.tcl 25 Feb 2008 11:16:01 -0000 1.96 @@ -162,13 +162,15 @@ proc ::xowiki::guesstype {fn} { set mime [ns_guesstype $fn] - if {$mime eq "*/*"} { + if {$mime eq "*/*" || $mime eq "application/octet-stream"} { # ns_guesstype was failing switch [file extension $fn] { .mp3 {set mime audio/mpeg} .cdf {set mime application/x-netcdf} .flv {set mime video/x-flv} .swf {set mime application/x-shockwave-flash} + .wmv {set mime video/x-ms-wmv} + .class - .jar {set mime application/java} } } return $mime 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 -N -r1.204 -r1.205 --- openacs-4/packages/xowiki/tcl/xowiki-procs.tcl 10 Feb 2008 13:20:22 -0000 1.204 +++ openacs-4/packages/xowiki/tcl/xowiki-procs.tcl 25 Feb 2008 11:16:01 -0000 1.205 @@ -753,8 +753,10 @@ set link_type language } else { # do we have a typed link? more than two chars... - if {![regexp {^([^:][^:][^:]+):((..):)?(.+)$} $link _ \ + if {[regexp {^([^:][^:][^:]+):((..):)?(.+)$} $link _ \ link_type _ lang stripped_name]} { + set name file:$stripped_name + } else { # must be an untyped link; defaults, in case the second regexp does not match either set lang "" set stripped_name $link