Index: openacs-4/packages/acs-api-browser/www/tcl-proc-view.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-api-browser/www/tcl-proc-view.tcl,v diff -u -N -r1.6.8.3 -r1.6.8.4 --- openacs-4/packages/acs-api-browser/www/tcl-proc-view.tcl 3 Aug 2014 19:11:11 -0000 1.6.8.3 +++ openacs-4/packages/acs-api-browser/www/tcl-proc-view.tcl 5 Sep 2014 10:31:16 -0000 1.6.8.4 @@ -1,5 +1,5 @@ ad_page_contract { - Will redirect you to aolserver.com if documentation can be found + Will redirect you to the server containing the documentation if it can be found @cvs-id $Id$ } { tcl_proc @@ -9,38 +9,19 @@ tcl_proc:onevalue } -# old aolserver documentation -#set tcl_api_host "http://www.aolserver.com/" -#set tcl_api_index "docs/devel/tcl/api/" +set ns_api_index_result [util_memoize [list ::util::http::get -url $::apidoc::ns_api_html_index]] +set ns_api_index_page [dict get $ns_api_index_result page] -# wiki on panpotic -#set tcl_api_host "http://panoptic.com/" -#set tcl_api_index "wiki/aolserver/Tcl_API" -#set tcl_api_root ${tcl_api_host}${tcl_api_index} -#set tcl_api_index_page [util_memoize [list ns_httpget $tcl_api_root]] +set url [apidoc::search_on_webindex \ + -page $ns_api_index_page \ + -root $::apidoc::ns_api_root \ + -host $::apidoc::ns_api_host \ + -proc $tcl_proc] -# naviserver at sourceforge -set tcl_api_host "http://naviserver.sourceforge.net/" -set tcl_api_index "n/naviserver/files/" -set tcl_api_root ${tcl_api_host}${tcl_api_index} -set tcl_api_html_index $tcl_api_root/commandlist.html -set tcl_api_index_result [util_memoize [list util::http::get -url $tcl_api_html_index]] -set tcl_api_index_page [dict get $tcl_api_index_result page] +if {$url ne ""} { + ad_returnredirect -allow_complete_url $url + ad_script_abort +} -set tcl_proc [lindex $tcl_proc 0] - -for { set i [expr { [string length $tcl_proc] - 1 }] } { $i >= 0 } { incr i -1 } { - set search_for [string range $tcl_proc 0 $i] - if { [regexp "\"'\]+)\[\"'\]\[^>\]*>$search_for" $tcl_api_index_page match relative_url] } { - if {[string match "/*" $relative_url]} { - set url ${tcl_api_host}$relative_url - } else { - set url ${tcl_api_root}$relative_url - } - ad_returnredirect -allow_complete_url $url - ad_script_abort - } -} - -set title "AOLserver Tcl API Search for: \"$tcl_proc\"" -set context [list "TCL API Search: $tcl_proc"] +set title "[ns_info name] Tcl API Search for: \"$tcl_proc\"" +set context [list "Tcl API Search: $tcl_proc"]