Commit 675add30 authored by Frank Bergmann's avatar Frank Bergmann

- OpenACS 5.6

parent fec89630
ad_library {
Library for Ajax Helper Procs
based on ExtJs
@author Hamilton Chua (ham@solutiongrove.com)
@creation-date 2007-09-07
}
namespace eval ah::ext { }
ad_proc -public ah::ext::requires {
} {
Everything needed for ExtJs is in 2 javascript files and 1 css file.
These files were built by combining smaller css and javascript files.
@author Hamilton Chua (ham@solutiongrove.com)
@creation-date 2007-09-07
} {
set ah_base_url [ah::get_url]
template::head::add_css -href "${ah_base_url}ext/resources/css/ext-all.css"
template::head::add_css -href "${ah_base_url}ext/resources/css/xtheme-vista.css"
template::head::add_javascript -order 1 -src "${ah_base_url}ext/adapter/ext/ext-base.js"
template::head::add_javascript -order 2 -src "${ah_base_url}ext/ext-all.js"
}
ad_proc -public ah::ext::onready {
-body
} {
Wrapper for Ext.onReady.
http://extjs.com/deploy/ext/docs/output/Ext.html#onReady
@author Hamilton Chua (ham@solutiongrove.com)
@creation-date 2007-09-07
@param body The javascript to be executed inside the onReady funciton
} {
ah::ext::requires
set function_body [ah::create_js_function -body ${body}]
return "Ext.onReady( ${function_body} ); "
}
ad_proc -public ah::ext::ajax {
-url
{-params {}}
{-success ""}
{-failure ""}
} {
Wrapper for Ext.Ajax.request
http://extjs.com/deploy/ext/docs/output/Ext.Ajax.html#request
@author Hamilton Chua (ham@solutiongrove.com)
@creation-date 2007-09-07
@param url The url that the javascript will post to
@param params A tcl list of parameters to pass to the url
@param success A javascript function to be executed when the url is successfully accessed
@param failure A javascript function to execute if transaction failed.
} {
set script "Ext.Ajax.request({url:\"$url\""
if { [exists_and_not_null params] } { append script ",params:$params" }
if { [exists_and_not_null success] } { append script ",success:$success" }
if { [exists_and_not_null failure] } { append script ",failure:$failure" }
append script "}); "
return $script
}
ad_proc -public ah::ext::msgbox {
{-options {}}
} {
Wrapper for Ext.MessageBox.
http://extjs.com/deploy/ext/docs/output/Ext.MessageBox.html
Possible options are listed in
http://extjs.com/deploy/ext/docs/output/Ext.MessageBox.html#show
<b>options</b> is a list of lists e.g.
set options [list [list "title" "\"Sample Progress Bar\""] [list "progress" "true"] [list "progressText" "\"Please wait ...\""] ]
it is fed to ah::ext::msgbox like this
set popup_script [ah::ext::msgbox -options $options]
@author Hamilton Chua (ham@solutiongrove.com)
@creation-date 2007-09-07
@param options A tcl list of options, see above for more info on how to structure and pass options to this proc.
} {
ah::ext::requires
set script "Ext.Msg.show("
append script [ah::util_list_to_json -lists_of_pairs [list $options] ]
append script "); "
return $script
}
ad_proc -public ah::ext::updateprogress {
-progress_count
-progress_txt
} {
Wrapper for Ext.MessageBox.updateProgress.
http://extjs.com/deploy/ext/docs/output/Ext.MessageBox.html#updateProgress
@author Hamilton Chua (ham@solutiongrove.com)
@creation-date 2007-09-07
@param progress_count Sets the progress bar in the progress bar dialog.
@param progress_txt The text to display for the given count.
} {
ah::ext::requires
return "Ext.Msg.updateProgress(${progress_count},'${progress_txt}'); "
}
\ No newline at end of file
This diff is collapsed.
#
# JSON parser for Tcl.
#
# See http://www.json.org/ && http://www.ietf.org/rfc/rfc4627.txt
#
# Copyright 2006 ActiveState Software Inc.
#
# $Id$
#
# modified by Dave Bauer
if {$::tcl_version < 8.5} {
# package require dict
}
package provide json 1.0
namespace eval json {}
proc json::getc {{txtvar txt}} {
# pop single char off the front of the text
upvar 1 $txtvar txt
if {$txt eq ""} {
return -code error "unexpected end of text"
}
set c [string index $txt 0]
set txt [string range $txt 1 end]
return $c
}
proc json::json2dict {txt} {
return [_json2dict]
}
proc json::_json2dict {{txtvar txt}} {
upvar 1 $txtvar txt
set state TOP
set txt [string trimleft $txt]
while {$txt ne ""} {
set c [string index $txt 0]
# skip whitespace
while {[string is space $c]} {
getc
set c [string index $txt 0]
}
if {$c eq "\{"} {
# object
switch -- $state {
TOP {
# we are dealing with an Object
getc
set state OBJECT
set dictVal [list]
}
VALUE {
# this object element's value is an Object
lappend dictVal $name [_json2dict]
set state COMMA
}
LIST {
# next element of list is an Object
lappend listVal [_json2dict]
set state COMMA
}
default {
return -code error "unexpected open brace in $state mode"
}
}
} elseif {$c eq "\}"} {
getc
if {$state ne "OBJECT" && $state ne "COMMA"} {
return -code error "unexpected close brace in $state mode"
}
return $dictVal
} elseif {$c eq ":"} {
# name separator
getc
if {$state eq "COLON"} {
set state VALUE
} else {
return -code error "unexpected colon in $state mode"
}
} elseif {$c eq ","} {
# element separator
if {$state eq "COMMA"} {
getc
if {[info exists listVal]} {
set state LIST
} elseif {[info exists dictVal]} {
set state OBJECT
}
} else {
return -code error "unexpected comma in $state mode"
}
} elseif {$c eq "\""} {
# string
# capture quoted string with backslash sequences
set reStr {(?:(?:\")(?:[^\\\"]*(?:\\.[^\\\"]*)*)(?:\"))}
set string ""
if {![regexp $reStr $txt string]} {
set txt [string replace $txt 32 end ...]
return -code error "invalid formatted string in $txt"
}
set txt [string range $txt [string length $string] end]
# chop off outer ""s and substitute backslashes
# This does more than the RFC-specified backslash sequences,
# but it does cover them all
set string [subst -nocommand -novariable \
[string range $string 1 end-1]]
switch -- $state {
TOP {
return $string
}
OBJECT {
set name $string
set state COLON
}
LIST {
lappend listVal $string
set state COMMA
}
VALUE {
lappend dictVal $name $string
unset name
set state COMMA
}
}
} elseif {$c eq "\["} {
# JSON array == Tcl list
switch -- $state {
TOP {
getc
set state LIST
}
LIST {
lappend listVal [_json2dict]
set state COMMA
}
VALUE {
lappend dictVal $name [_json2dict]
set state COMMA
}
default {
return -code error "unexpected open bracket in $state mode"
}
}
} elseif {$c eq "\]"} {
# end of list
getc
if {![info exists listVal]} {
#return -code error "unexpected close bracket in $state mode"
# must be an empty list
return ""
}
return $listVal
} elseif {0 && $c eq "/"} {
# comment
# XXX: Not in RFC 4627
getc
set c [getc]
switch -- $c {
/ {
# // comment form
set i [string first "\n" $txt]
if {$i == -1} {
set txt ""
} else {
set txt [string range $txt [incr i] end]
}
}
* {
# /* comment */ form
getc
set i [string first "*/" $txt]
if {$i == -1} {
return -code error "incomplete /* comment"
} else {
set txt [string range $txt [incr i] end]
}
}
default {
return -code error "unexpected slash in $state mode"
}
}
} elseif {[string match {[-0-9]} $c]} {
# one last check for a number, no leading zeros allowed,
# but it may be 0.xxx
string is double -failindex last $txt
if {$last > 0} {
set num [string range $txt 0 [expr {$last - 1}]]
set txt [string range $txt $last end]
switch -- $state {
TOP {
return $num
}
LIST {
lappend listVal $num
set state COMMA
}
VALUE {
lappend dictVal $name $num
set state COMMA
}
default {
getc
return -code error "unexpected number '$c' in $state mode"
}
}
} else {
getc
return -code error "unexpected '$c' in $state mode"
}
} elseif {[string match {[ftn]} $c]
&& [regexp {^(t|f|true|false|null)} $txt val]} {
# bare word value: true | false | null
set txt [string range $txt [string length $val] end]
switch -- $state {
TOP {
return $val
}
LIST {
lappend listVal $val
set state COMMA
}
VALUE {
lappend dictVal $name $val
set state COMMA
}
default {
getc
return -code error "unexpected '$c' in $state mode"
}
}
} else {
# error, incorrect format or unexpected end of text
return -code error "unexpected '$c' in $state mode"
}
}
}
proc json::dict2json {dictVal} {
# XXX: Currently this API isn't symmetrical, as to create proper
# XXX: JSON text requires type knowledge of the input data
set json ""
dict for {key val} $dictVal {
# key must always be a string, val may be a number, string or
# bare word (true|false|null)
if {0 && ![string is double -strict $val]
&& ![regexp {^(?:true|false|null)$} $val]} {
set val "\"$val\""
}
append json "\"$key\": $val," \n
}
return "\{${json}\}"
}
proc json::list2json {listVal} {
return "\[$[join $listVal ,]\]"
}
proc json::string2json {str} {
return "\"$str\""
}
# Interface to the ACS for the ArsDigita Templating System
# Procedures in this file only make sense if you use the template system
# together with the ArsDigita Community System
# Copyright (C) 1999-2000 ArsDigita Corporation
# Authors: Christian Brechbuehler <christian@arsdigita.com
# $Id$
# This is free software distributed under the terms of the GNU Public
# License. Full text of the license is available from the GNU Project:
# http://www.fsf.org/copyleft/gpl.html
ad_proc -public ad_return_template {
-string:boolean
{template ""}
} {
This function is a wrapper for sundry template:: procs. Will set the
template for the current page to the file named in 'template'.
@param template Name of template file
@param string If specified, will return the resulting page to the caller
string instead sending it to the connection.
} {
if {![empty_string_p $template]} {
template::set_file \
[template::util::url_to_file $template [ad_conn file]]
}
if { $string_p } {
return [template::adp_parse \
[template::util::url_to_file $template [ad_conn file]] {}]
}
}
ad_proc -public ad_parse_template {
{-params ""}
template
} {
Return a string containing the parsed and evaluated template to the caller.
@param params The parameters to pass to the template. Note that pass-by-reference params must be in the page namespace, they cannot be in a local procedure, or any other namespace.
@param template The template file name.
Example:
<code>set page [ad_parse_template -params {errmsg {custom_message "My Message"}} some-template]</code>
@param template Name of template file
} {
set template_params [list]
foreach param $params {
switch [llength $param] {
1 { lappend template_params "&"
lappend template_params [lindex $param 0]
}
2 { lappend template_params [lindex $param 0]
lappend template_params [lindex $param 1]
}
default { return -code error [_ acs-templating.Template_parser_error_in_parameter_list] }
}
}
return [uplevel [list template::adp_parse [template::util::url_to_file $template [ad_conn file]] $template_params]]
}
ad_proc -public ad_return_exception_template {
{-status 500}
{-params ""}
template
} {
Return an exception template and abort the current script.
@param status The HTTP status to return, by default HTTP 500 (Error)
@param params The parameters to pass to the template.
@param template The template file name.
Example:
<code>ad_return_exception_template -params {errmsg {custom_message "My Message"}} some-template</code>
} {
ns_return $status text/html [ad_parse_template -params $params $template]
ad_script_abort
}
ad_proc -public get_server_root {} {
Get the server root directory (supposing we run under ACS)
} {
file dir [ns_info tcllib]
}
ad_proc adp_parse_ad_conn_file {} {
handle a request for an adp and/or tcl file in the template system.
} {
namespace eval template variable parse_level ""
#ns_log debug "adp_parse_ad_conn_file => file '[file root [ad_conn file]]'"
template::reset_request_vars
set parsed_template [template::adp_parse [file root [ad_conn file]] {}]
if {![empty_string_p $parsed_template]} {
#
# acs-lang translator mode
#
if { [lang::util::translator_mode_p] } {
# Attempt to move all message keys outside of tags
while { [regsub -all {(<[^>]*)(\x002\(\x001[^\x001]*\x001\)\x002)([^>]*>)} $parsed_template {\2\1\3} parsed_template] } {}
# Attempt to move all message keys outside of <select>...</select> statements
regsub -all -nocase {(<option\s[^>]*>[^<]*)(\x002\(\x001[^\x001]*\x001\)\x002)([^<]*</option[^>]*>)} $parsed_template {\2\1\3} parsed_template
while { [regsub -all -nocase {(<select[^>]*>[^<]*)(\x002\(\x001[^\x001]*\x001\)\x002)} $parsed_template {\2\1} parsed_template] } {}
set start 0
while { [regexp -nocase -indices -start $start {(<select[^\x002]*)(\x002\(\x001[^\x001]*\x001\)\x002)} $parsed_template indices select_idx message_idx] } {
set select [string range $parsed_template [lindex $select_idx 0] [lindex $select_idx 1]]
if { [string first "</select" [string tolower $select]] != -1 } {
set start [lindex $indices 1]
} else {
set before [string range $parsed_template 0 [expr [lindex $indices 0]-1]]
set message [string range $parsed_template [lindex $message_idx 0] [lindex $message_idx 1]]
set after [string range $parsed_template [expr [lindex $indices 1] + 1] end]
set parsed_template "${before}${message}${select}${after}"
}
}
# TODO: We could also move message keys out of <head>...</head>
while { [regexp -indices {\x002\(\x001([^\x001]*)\x001\)\x002} $parsed_template indices key] } {
set before [string range $parsed_template 0 [expr [lindex $indices 0] - 1]]
set after [string range $parsed_template [expr [lindex $indices 1] + 1] end]
set key [string range $parsed_template [lindex $key 0] [lindex $key 1]]
set keyv [split $key "."]
set package_key [lindex $keyv 0]
set message_key [lindex $keyv 1]
set edit_url [export_vars -base "[apm_package_url_from_key "acs-lang"]admin/edit-localized-message" { { locale {[ad_conn locale]} } package_key message_key { return_url [ad_return_url] } }]
if { [lang::message::message_exists_p [ad_conn locale] $key] } {
set edit_link "<a href=\"$edit_url\" title=\"$key\" style=\"color: green;\"><b>o</b></a>"
} else {
if { [lang::message::message_exists_p "en_US" $key] } {
# Translation missing in this locale
set edit_link "<a href=\"$edit_url\" title=\"$key\" style=\"background-color: yellow; color: red;\"><b>*</b></a>"
} else {
# Message key missing entirely
set new_url [export_vars -base "[apm_package_url_from_key "acs-lang"]admin/localized-message-new" { { locale en_US } package_key message_key { return_url [ad_return_url] } }]
set edit_link "<a href=\"$new_url\" title=\"$key\" style=\"background-color: red; color: white;\"><b>@</b></a>"
}
}
set parsed_template "${before}${edit_link}${after}"
}
}
set mime_type [template::get_mime_type]
set header_preamble [template::get_mime_header_preamble $mime_type]
doc_return 200 $mime_type "$header_preamble$parsed_template"
} else {
db_release_unused_handles
}
}
@doc.type;noquote@
<html<if @doc.lang@ not nil> lang="@doc.lang;noquote@"</if>>
<head>
<title<if @doc.title_lang@ not nil and @doc.title_lang@ ne @doc.lang@> lang="@doc.title_lang;noquote@"</if>>@doc.title;noquote@</title>
<multiple name="meta"> <meta<if @meta.http_equiv@ not nil> http-equiv="@meta.http_equiv;noquote@"</if><if @meta.name@ not nil> name="@meta.name;noquote@"</if><if @meta.scheme@ not nil> scheme="@meta.scheme;noquote@"</if><if @meta.lang@ not nil and @meta.lang@ ne @doc.lang@> lang="@meta.lang;noquote@"</if> content="@meta.content@">
</multiple>
<multiple name="link"> <link rel="@link.rel;noquote@" href="@link.href;noquote@"<if @link.lang@ not nil and @link.lang@ ne @doc.lang@> lang="@link.lang;noquote@"</if><if @link.title@ not nil> title="@link.title;noquote@"</if><if @link.type@ not nil> type="@link.type;noquote@"</if><if @link.media@ not nil> media="@link.media@"</if>>
</multiple>
<multiple name="headscript"> <script type="@headscript.type;noquote@"<if @headscript.src@ not nil> src="@headscript.src;noquote@"</if><if @headscript.charset@ not nil> charset="@headscript.charset;noquote@"</if><if @headscript.defer@ not nil> defer="@headscript.defer;noquote@"</if>><if @headscript.content@ not nil>@headscript.content;noquote@</if></script>
</multiple>
<if @head@ not nil>@head;noquote@</if>
<include src="/packages/ajaxhelper/lib/ajaxhelper-template">
</head>
<body<if @body.class@ not nil> class="@body.class;noquote@"</if><if @body.id@ not nil> id="@body.id;noquote@"</if><if @event_handlers@ not nil>@event_handlers;noquote@</if>>
<list name="header">
@header:item;noquote@
</list>
<slave>
<list name="footer">
@footer:item;noquote@
</list>
<multiple name="body_script"> <script type="@body_script.type;noquote@"<if @body_script.src@ not nil> src="@body_script.src;noquote@"</if><if @body_script.charset@ not nil> charset="@body_script.charset;noquote@"</if><if @body_script.defer@ not nil> defer="@body_script.defer;noquote@"</if>><if @body_script.content@ not nil>@body_script.content;noquote@</if></script>
</multiple>
</body>
</html>
ad_page_contract {
This is the top level master template. It allows the basic parts of an XHTML
document to be set through convenient data structures without introducing
anything site specific.
You should NEVER need to modify this file.
Most of the time your pages or master templates should not directly set this
file in their <master> tag. They should instead use site-master with
provides a set of standard OpenACS content. Only pages which need to return
raw HTML should use this template directly.
When using this template directly you MUST supply the following variables:
@property doc(title) The document title, ie. <title /> tag.
@property doc(title_lang) The language of the document title, if different
from the document language.
The document output can be customised by supplying the following variables:
@property doc(type) The declared xml DOCTYPE.
@property doc(charset) The document character set.
@property body(id) The id attribute of the body tag.
@property body(class) The class of the body tag.
ad_conn -set language Must be used to override the document language
if necessary.
To add a CSS or Javascripts to the <head> section of the document you can
call the corresponding template::head::add_* functions within your page.
@see template::head::add_css
@see template::head::add_javascript
More generally, meta, link and script tags can be added to the <head> section
of the document by calling their template::head::add_* function within your
page.
@see template::head::add_meta
@see template::head::add_link
@see template::head::add_script
Javascript event handlers, such as onload, an be added to the <body> tag by
calling template::add_body_handler within your page.
@see template::add_body_handler
Finally, for more advanced functionality see the documentation for
template::add_body_script, template::add_header and template::add_footer.
@see template::add_body_script
@see template::add_header
@see template::add_footer
@author Kevin Scaldeferri (kevin@arsdigita.com)
Lee Denison (lee@xarg.co.uk)
@creation-date 14 Sept 2000
$Id$
}
if {[template::util::is_nil doc(type)]} {
set doc(type) {<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">}
}
if {![info exists doc(title)]} {
set doc(title) "[ad_conn instance_name]"
ns_log warning "[ad_conn url] has no doc(title) set."
}
if {[template::util::is_nil doc(charset)]} {
set doc(charset) [ns_config ns/parameters OutputCharset [ad_conn charset]]
}
# The document language is always set from [ad_conn lang] which by default
# returns the language setting for the current user. This is probably
# not a bad guess, but the rest of OpenACS must override this setting when
# appropriate and set the lang attribxute of tags which differ from the language
# of the page. Otherwise we are lying to the browser.
set doc(lang) [ad_conn language]
# AG: Markup in <title> tags doesn't render well.
set doc(title) [ns_striphtml $doc(title)]
# Generate the <meta /> tag multirow
variable ::template::head::metas
template::multirow create meta name content http_equiv scheme lang
template::multirow append meta \
"" \
"text/html; charset=$doc(charset)" \
"content-type"
if {[array exists metas]} {
foreach name [array names metas] {
foreach {http_equiv name scheme content lang} $metas($name) {
template::multirow append meta \
$name \
$content \
$http_equiv \
$scheme \
$lang
}
}
unset metas
}
# Generate the <link /> tag multirow
variable ::template::head::links
template::multirow create link rel type href title lang media
if {[array exists links]} {
foreach name [array names links] {
foreach {rel href type media title lang} $links($name) {
template::multirow append link \
$rel \
$type \
$href \
$title \
$lang \
$media
}
}
unset links
}
# Generate the head <script /> tag multirow
variable ::template::head::scripts
template::multirow create headscript type src charset defer content order
if {[array exists scripts]} {
foreach name [array names scripts] {
foreach {type src charset defer content order} $scripts($name) {
template::multirow append headscript \
$type \
$src \
$charset \
$defer \
$content \
$order
}
}
template::multirow sort headscript order
unset scripts
}
# Generate the body <script /> tag multirow
variable ::template::body_scripts
template::multirow create body_script type src charset defer content
if {[info exists body_scripts]} {
foreach {type src charset script defer} $body_scripts {
template::multirow append body_script \
$type \
$src \
$charset \
$defer \
$content
}
unset body_scripts
}
# Concatenate the javascript event handlers for the body tag
variable ::template::body_handlers
if {[array exists body_handlers]} {
set names [array names body_handlers]
foreach name $names {
set event [lindex [split $name ","] 0]
foreach javascript $body_handlers($name) {
lappend body_handlers($event) "[string trimright $javascript "; "];"
}
unset body_handlers($name)
}
}
# Now create the event handlers string
foreach {event script} [array get body_handlers] {
append event_handlers " ${event}=\"$script\""
}
# Generate the body headers
variable ::template::headers
set header ""
if {[info exists headers]} {
foreach header_list $headers {
set type [lindex $header_list 0]
set src [lindex $header_list 1]
set params [lindex $header_list 2]
if {$type eq "literal"} {
append header $src
} elseif {$type eq "include"} {
set adp_html [template::adp_include $src $params]
if {$adp_html ne ""} {
append header $adp_html
}
}
}
unset headers
}
# Generate the body footers
variable ::template::footers
set footer ""
if {[info exists footers]} {
foreach footer_list $footers {
set type [lindex $footer_list 0]
set src [lindex $footer_list 1]
set params [lindex $footer_list 2]
if {$type eq "literal"} {
append footer $src
} else {
set adp_html [template::adp_include $src $params]
if {$adp_html ne ""} {
lappend footer
}
}
}
unset footers
}
<master src="/www/site-master">
<if @meta:rowcount@ not nil><property name="&meta">meta</property></if>
<if @link:rowcount@ not nil><property name="&link">link</property></if>
<if @script:rowcount@ not nil><property name="&script">script</property></if>
<if @doc@ defined><property name="&doc">doc</property></if>
<if @body@ defined><property name="&body">body</property></if>
<if @head@ not nil><property name="head">@head;noquote@</property></if>
<if @focus@ not nil><property name="focus">@focus;noquote@</property></if>
<property name="skip_link">#content-wrapper</property>
<div id="wrapper">
<div id="system-name">
<if @system_url@ not nil><a href="@system_url@">@system_name@</a></if>
<else>@system_name@</else>
</div>
<div id="header">
<div class="block-marker">Begin header</div>
<div id="header-navigation">
<ul class="compact">
<li>
<if @untrusted_user_id@ ne 0>#acs-subsite.Welcome_user#</if>
<else>#acs-subsite.Not_logged_in#</else> |
</li>
<li><a href="@whos_online_url@" title="#acs-subsite.view_all_online_members#">@num_users_online@ <if @num_users_online@ eq 1>#acs-subsite.Member#</if><else>#acs-subsite.Members#</else> #acs-subsite.Online#</a> |</li>
<if @pvt_home_url@ not nil>
<li><a href="@pvt_home_url@" title="#acs-subsite.Change_pass_email_por#">@pvt_home_name@</a> |</li>
</if>
<if @login_url@ not nil>
<li><a href="@login_url@" title="#acs-subsite.Log_in_to_system#">#acs-subsite.Log_In#</a></li>
</if>
<if @logout_url@ not nil>
<li><a href="@logout_url@" title="#acs-subsite.Logout_from_system#">#acs-subsite.Logout#</a></li>
</if>
</ul>
</div>
<div id="breadcrumbs">
<if @context_bar@ not nil>
@context_bar;noquote@
</if>
<else>
<if @context:rowcount@ not nil>
<ul class="compact">
<multiple name="context">
<if @context.url@ not nil>
<li><a href="@context.url@">@context.label@</a> :</li>
</if>
<else>
<li>@context.label@</li>
</else>
</multiple>
</ul>
</if>
</else>
</div>
</div> <!-- /header -->
<div id="content-wrapper">
<div class="block-marker">Begin main content</div>
<div id="inner-wrapper">
<if @user_messages:rowcount@ gt 0>
<div id="alert-message">
<multiple name="user_messages">
<div class="alert">
<strong>@user_messages.message;noquote@</strong>
</div>
</multiple>
</div>
</if>
<list name="navigation_groups">
<div id="@navigation_groups:item@-navigation">
<div class="block-marker">Begin @navigation_groups:item@ navigation</div>
<ul>
<multiple name="navigation">
<if @navigation.group@ eq @navigation_groups:item@>
<li<if @navigation.id@ not nil> id="@navigation.id"</if>><a href="@navigation.href@"<if @navigation.target@ not nil> target="@navigation.target;noquote@"</if><if @navigation.class@ not nil> class="@navigation.class;noquote@"</if><if @navigation.title@ not nil> title="@navigation.title;noquote@"</if><if @navigation.lang@ not nil> lang="@navigation.lang;noquote@"</if><if @navigation.accesskey@ not nil> accesskey="@navigation.accesskey;noquote@"</if><if @navigation.tabindex@ not nil> tabindex="@navigation.tabindex;noquote@"</if>>@navigation.label@</a></li>
</if>
</multiple>
</ul>
</div>
</list>
<div id="main">
<div id="main-content">
<div class="main-content-padding">
<slave />
</div>
</div>
</div>
</div>
</div> <!-- /content-wrapper -->
<comment>
TODO: remove this and add a more systematic / package independent way
TODO of getting this content here
</comment>
<if @curriculum_bar_p@ true><include src="/packages/curriculum/lib/bar" /></if>
<div id="footer">
<div class="block-marker">Begin footer</div>
<div id="footer-links">
<ul class="compact">
<if @num_of_locales@ gt 1>
<li><a href="@change_locale_url@">#acs-subsite.Change_locale_label#</a></li>
</if>
<else>
<if @locale_admin_url@ not nil>
<li><a href="@locale_admin_url@">Install locales</a></li>
</if>
</else>
</ul>
</div>
</div> <!-- /footer -->
</div> <!-- /wrapper -->
ad_page_contract {
This is the highest level site specific master template.
@author Lee Denison (lee@xarg.co.uk)
$Id$
}
#
# Set some basic variables
#
set system_name [ad_system_name]
if { [string equal [ad_conn url] "/"] } {
set system_url ""
} else {
set system_url [ad_url]
}
if {[template::util::is_nil title]} {
# TODO: decide how best to set the lang attribute for the title
set title [ad_conn instance_name]
}
if {![template::multirow exists link]} {
template::multirow create link rel type href title lang media
}
#
# Create standard top level navigation
#
if {![info exists navigation_groups]} {
# set navigation_groups [list]
set navigation_groups [list]
}
if {![template::multirow exists navigation]} {
template::multirow create navigation \
group \
label \
href \
target \
title \
lang \
accesskey \
class \
id \
tabindex
}
for {set i 1} {$i <= [template::multirow size navigation]} {incr i} {
template::multirow get navigation $i
if {[lsearch $navigation_groups $navigation(group)] < 0} {
lappend navigation_groups $navigation(group)
}
}
#
# Add standard css
#
template::multirow append link \
stylesheet \
"text/css" \
"/resources/acs-subsite/default-master.css" \
"" \
en \
"all"
#
# User information and top level navigation links
#
set user_id [ad_conn user_id]
set untrusted_user_id [ad_conn untrusted_user_id]
set sw_admin_p 0
if { $untrusted_user_id == 0 } {
# The browser does NOT claim to represent a user that we know about
set login_url [ad_get_login_url -return]
} else {
# The browser claims to represent a user that we know about
set user_name [person::name -person_id $untrusted_user_id]
set pvt_home_url [ad_pvt_home]
set pvt_home_name [_ acs-subsite.Your_Account]
set logout_url [ad_get_logout_url]
# Site-wide admin link
set admin_url {}
set sw_admin_p [acs_user::site_wide_admin_p -user_id $untrusted_user_id]
if { $sw_admin_p } {
set admin_url "/acs-admin/"
set devhome_url "/acs-admin/developer"
set locale_admin_url "/acs-lang/admin"
} else {
set subsite_admin_p [permission::permission_p \
-object_id [subsite::get_element -element object_id] \
-privilege admin \
-party_id $untrusted_user_id]
if { $subsite_admin_p } {
set admin_url "[subsite::get_element -element url]admin/"
}
}
}
#
# User messages
#
util_get_user_messages -multirow user_messages
#
# Set acs-lang urls
#
set acs_lang_url [apm_package_url_from_key "acs-lang"]
set num_of_locales [llength [lang::system::get_locales]]
if {[empty_string_p $acs_lang_url]} {
set lang_admin_p 0
} else {
set lang_admin_p [permission::permission_p \
-object_id [site_node::get_element \
-url $acs_lang_url \
-element object_id] \
-privilege admin \
-party_id [ad_conn untrusted_user_id]]
}
set toggle_translator_mode_url [export_vars \
-base ${acs_lang_url}admin/translator-mode-toggle \
{{return_url [ad_return_url]}}]
set package_id [ad_conn package_id]
if { $num_of_locales > 1 } {
set change_locale_url [export_vars -base $acs_lang_url {package_id}]
}
#
# Change locale link
#
if {[llength [lang::system::get_locales]] > 1} {
set change_locale_url [export_vars -base "/acs-lang/" {package_id}]
}
#
# Who's Online
#
set num_users_online [lc_numeric [whos_online::num_users]]
set whos_online_url "[subsite::get_element -element url]shared/whos-online"
#
# Context bar
#
if {[info exists context]} {
set context_tmp $context
unset context
} else {
set context_tmp {}
}
ad_context_bar_multirow -- $context_tmp
#
# Curriculum specific bar
# TODO: remove this and add a more systematic / package independent way
# TODO of getting this content here
#
set curriculum_bar_p [expr {
[site_node::get_package_url -package_key curriculum] ne ""
}]
This diff is collapsed.
<master src="/www/blank-master">
<if @doc@ defined><property name="&doc">doc</property></if>
<if @body@ defined><property name="&body">body</property></if>
<if @head@ not nil><property name="head">@head;noquote@</property></if>
<slave>
ad_page_contract {
This is the highest level site specific master template.
site-master adds site wide OpenACS functionality to every page.
You should NOT need to modify this file unless you are adding functionality
for a site wide service.
If you want to customise the look and feel of your site you probably want to
modify /www/default-master.
Note: currently site wide service content is hard coded in this file. At
some point we will want to determine this content dynamically which will
change the content of this file significantly.
@author Lee Denison (lee@xarg.co.uk)
$Id$
}
if {![info exists doc(title)] || $doc(title) eq ""} {
set doc(title) [ad_conn instance_name]
# There is no way to determine the language of instance_name so we guess
# that it is the same as the site wide locale setting - if not this must
# be overridden
set doc(title_lang) [lindex [split [lang::system::site_wide_locale] _] 0]
}
#
# Add standard meta tags
#
template::head::add_meta \
-name generator \
-lang en \
-content "OpenACS version [ad_acs_version]"
#
# Add standard css
#
template::head::add_css \
-href "/resources/acs-subsite/site-master.css" \
-media "all"
template::head::add_css \
-href "/resources/acs-templating/lists.css" \
-media "all"
template::head::add_css \
-href "/resources/acs-templating/forms.css" \
-media "all"
# Add standard javascript
template::head::add_javascript -src "/resources/acs-subsite/core.js"
#
# Fire subsite callbacks to get header content
#
# TODO: LJD - these callbacks should append to the relevant multirows to ensure
# TODO accessibility standards compliant output
# FIXME: it's not clear why these callbacks are scoped to subsite or if
# FIXME callbacks are the right way to add content of this type. Either way
# FIXME using the @head@ property or indeed having a callback for every
# FIXME possible javascript event handler is probably not the right way to go.
#
append head [join [callback subsite::get_extra_headers] "\n"]
# set body(onload) [concat $body(onload) [callback subsite::header_onload]]
set onload_handlers [callback subsite::header_onload]
foreach onload_handler $onload_handlers {
template::add_body_handler -event onload -script $onload_handler
}
# Determine if we should be displaying the dotLRN toolbar
#
set dotlrn_toolbar_p [expr {
[llength [namespace eval :: info procs dotlrn_toolbar::show_p]] == 1
}]
if {$dotlrn_toolbar_p} {
template::head::add_css \
-href "/resources/dotlrn/dotlrn-toolbar.css" \
-media "all"
template::add_header -src "/packages/dotlrn/lib/toolbar"
}
# DRB: Devsup and dotlrn toolbars moved here temporarily until we rewrite
# things so packages can push tool bars up to the blank master.
# Determine if developer support is installed and enabled
set developer_support_p [expr {
[llength [info procs ::ds_show_p]] == 1 && [ds_show_p]
}]
if {$developer_support_p} {
template::head::add_css \
-href "/resources/acs-developer-support/acs-developer-support.css" \
-media "all"
template::add_header -src "/packages/acs-developer-support/lib/toolbar"
template::add_footer -src "/packages/acs-developer-support/lib/footer"
}
ad_page_contract {
Add a filter to saved filter view for a list builder list
} {
return_url
list_name
{filter_name ""}
{filter_names ""}
{filter_value ""}
{filter_values ""}
}
# get filters from existing session property
# don't put URL vars in the key just the page we are looking at
regexp {([^\?]*)\??} $return_url discard base_url
set key [ns_sha1 [list $base_url $list_name]]
if {$filter_name eq "__list_view"} {
set current_filters(${list_name}:filter:${filter_name}:properties) $filter_value
} elseif {[llength $filter_names]} {
array set current_filters [ad_get_client_property acs-templating ${key}]
foreach name $filter_names value $filter_values {
set current_filters(${list_name}:filter:${name}:properties) $value
}
} elseif {$filter_name ne ""} {
array set current_filters [ad_get_client_property acs-templating ${key}]
set current_filters(${list_name}:filter:${filter_name}:properties) $filter_value
}
ns_log notice "current filters
[array get current_filters]
"
ad_set_client_property acs-templating $key [array get current_filters]
ad_returnredirect $return_url
\ No newline at end of file
ad_page_contract {
Delete a view for a list
} {
list_name
view_name
return_url
parent_id
}
set name "template:list:${list_name}:view:${view_name}"
set view_item_id [db_string get_item_id "select item_id from cr_items where name=:name and parent_id=:parent_id" -default ""]
if {$view_item_id ne ""} {
if {[permission::permission_p \
-object_id $view_item_id \
-party_id [ad_conn user_id] \
-privilege "admin"]} {
content::item::delete -item_id $view_item_id
}
}
regexp {([^\?]*)\??} $return_url discard base_url
set key [ns_sha1 [list $base_url $list_name]]
ad_set_client_property acs-templating $key ""
ad_returnredirect -message "[_ acs-templating.List_View_Deleted]" $return_url
\ No newline at end of file
// script.aculo.us sound.js v1.7.1_beta3, Fri May 25 17:19:41 +0200 2007
// Copyright (c) 2005-2007 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
//
// Based on code created by Jules Gravinese (http://www.webveteran.com/)
//
// script.aculo.us is freely distributable under the terms of an MIT-style license.
// For details, see the script.aculo.us web site: http://script.aculo.us/
Sound = {
tracks: {},
_enabled: true,
template:
new Template('<embed style="height:0" id="sound_#{track}_#{id}" src="#{url}" loop="false" autostart="true" hidden="true"/>'),
enable: function(){
Sound._enabled = true;
},
disable: function(){
Sound._enabled = false;
},
play: function(url){
if(!Sound._enabled) return;
var options = Object.extend({
track: 'global', url: url, replace: false
}, arguments[1] || {});
if(options.replace && this.tracks[options.track]) {
$R(0, this.tracks[options.track].id).each(function(id){
var sound = $('sound_'+options.track+'_'+id);
sound.Stop && sound.Stop();
sound.remove();
})
this.tracks[options.track] = null;
}
if(!this.tracks[options.track])
this.tracks[options.track] = { id: 0 }
else
this.tracks[options.track].id++;
options.id = this.tracks[options.track].id;
if (Prototype.Browser.IE) {
var sound = document.createElement('bgsound');
sound.setAttribute('id','sound_'+options.track+'_'+options.id);
sound.setAttribute('src',options.url);
sound.setAttribute('loop','1');
sound.setAttribute('autostart','true');
$$('body')[0].appendChild(sound);
}
else
new Insertion.Bottom($$('body')[0], Sound.template.evaluate(options));
}
};
if(Prototype.Browser.Gecko && navigator.userAgent.indexOf("Win") > 0){
if(navigator.plugins && $A(navigator.plugins).detect(function(p){ return p.name.indexOf('QuickTime') != -1 }))
Sound.template = new Template('<object id="sound_#{track}_#{id}" width="0" height="0" type="audio/mpeg" data="#{url}"/>')
else
Sound.play = function(){}
}
#!/bin/bash
# update_ah_resources.sh
# v 0.1
# author : Hamilton G. Chua (ham@solutiongrove.com)
# date : 4/1/2009
# This bash script is meant to be executed in
# packages/ajaxhelper/www/resources/.
# It is responsible for updating the javascript libraries
# for the ajaxhelper package.
# The idea behind this file is to be able to easily update
# the javascript libraries to the latest available versions
# by running this script.
# NOTE :
# the following must be in your PATH
# - unzip
# - wget
# To execute :
# ./update_ah_resources.sh
# CHANGELOG :
# 0.1 :
# initially works with YUI
# ******* START **********
STAMP=`date +%m%d%y%H%M`
# create an archive folder
ARCHFOLDER="archive"-$STAMP
mkdir $ARCHFOLDER
# create a temporary folder
TMPFOLDER="tmp"-$STAMP
mkdir $TMPFOLDER
# ****** YUI ************
# move yui to the archive folder
mv yui $ARCHFOLDER
# use wget to fetch YUI
# and put it into the TMPFOLDER
YUIZIP="yui_2.7.0b.zip"
cd $TMPFOLDER
wget http://developer.yahoo.com/yui/download/
# unzip the downloaded file
unzip $YUIZIP
cd yui/
# copy build/ in www/resources as yui
mv build ../../yui
# ****** EXT2 *************
# move ext2 to the archive folder
cd ../../
mv ext2 $ARCHFOLDER
# use wget to fetch ExtJS 2
# and put it into the TMPFOLDER
EXT2ZIP="ext-2.2.1.zip"
cd $TMPFOLDER
mkdir ext2
cd ext2
wget http://extjs.com/products/extjs/download.php?dl=extjs221
# unzip the downloaded file
unzip $EXT2ZIP
rm $EXT2ZIP
cd ../
# copy ext2/ in www/resources as ext2
mv ext2 ../
cd ../
# ****** CLEANUP **********
# delete temporary folder
rm -rf $TMPFOLDER
\ No newline at end of file
/*
Copyright (c) 2009, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 2.7.0
*/
/**
* CORE
*
* This is the set of CSS rules required by Calendar to drive core functionality and structure.
* Changes to these rules may result in the Calendar not functioning or rendering correctly.
*
* They should not be modified for skinning.
**/
/* CALENDAR BOUNDING BOX */
.yui-calcontainer {
position:relative;
float:left;
_overflow:hidden; /* IE6 only, to clip iframe shim */
}
/* IFRAME SHIM */
.yui-calcontainer iframe {
position:absolute;
border:none;
margin:0;padding:0;
z-index:0;
width:100%;
height:100%;
left:0px;
top:0px;
}
/* IFRAME SHIM IE6 only */
.yui-calcontainer iframe.fixedsize {
width:50em;
height:50em;
top:-1px;
left:-1px;
}
/* BOUNDING BOX FOR EACH CALENDAR GROUP PAGE */
.yui-calcontainer.multi .groupcal {
z-index:1;
float:left;
position:relative;
}
/* TITLE BAR */
.yui-calcontainer .title {
position:relative;
z-index:1;
}
/* CLOSE ICON CONTAINER */
.yui-calcontainer .close-icon {
position:absolute;
z-index:1;
text-indent:-10000em;
overflow:hidden;
}
/* CALENDAR TABLE */
.yui-calendar {
position:relative;
}
/* NAVBAR LEFT ARROW CONTAINER */
.yui-calendar .calnavleft {
position:absolute;
z-index:1;
text-indent:-10000em;
overflow:hidden;
}
/* NAVBAR RIGHT ARROW CONTAINER */
.yui-calendar .calnavright {
position:absolute;
z-index:1;
text-indent:-10000em;
overflow:hidden;
}
/* NAVBAR TEXT CONTAINER */
.yui-calendar .calheader {
position:relative;
width:100%;
text-align:center;
}
/* CalendarNavigator */
.yui-calcontainer .yui-cal-nav-mask {
position:absolute;
z-index:2;
margin:0;
padding:0;
width:100%;
height:100%;
_width:0; /* IE6, IE7 quirks - width/height set programmatically to match container */
_height:0;
left:0;
top:0;
display:none;
}
/* NAVIGATOR BOUNDING BOX */
.yui-calcontainer .yui-cal-nav {
position:absolute;
z-index:3;
top:0;
display:none;
}
/* NAVIGATOR BUTTONS (based on button-core.css) */
.yui-calcontainer .yui-cal-nav .yui-cal-nav-btn {
display: -moz-inline-box; /* Gecko */
display: inline-block; /* IE, Opera and Safari */
}
.yui-calcontainer .yui-cal-nav .yui-cal-nav-btn button {
display: block;
*display: inline-block; /* IE */
*overflow: visible; /* Remove superfluous padding for IE */
border: none;
background-color: transparent;
cursor: pointer;
}
/* Specific changes for calendar running under fonts/reset */
.yui-calendar .calbody a:hover {background:inherit;}
p#clear {clear:left; padding-top:10px;}
\ No newline at end of file
/*
Copyright (c) 2009, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 2.7.0
*/
.yui-overlay,
.yui-panel-container {
visibility: hidden;
position: absolute;
z-index: 2;
}
.yui-panel {
position:relative;
}
.yui-panel-container form {
margin: 0;
}
.mask {
z-index: 1;
display: none;
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
}
.mask.block-scrollbars {
/*
Application of "overflow:auto" prevents Mac scrollbars from bleeding
through the modality mask in Gecko. The block-scollbars class is only
added for Gecko on MacOS
*/
overflow: auto;
}
/*
PLEASE NOTE:
1) ".masked select" is used to prevent <SELECT> elements bleeding through
the modality mask in IE 6.
2) ".drag select" is used to hide <SELECT> elements when dragging a
Panel in IE 6. This is necessary to prevent some redraw problems with
the <SELECT> elements when a Panel instance is dragged.
3) ".hide-select select" is appended to an Overlay instance's root HTML
element when it is being annimated by YAHOO.widget.ContainerEffect.
This is necessary because <SELECT> elements don't inherit their parent
element's opacity in IE 6.
*/
.masked select,
.drag select,
.hide-select select {
_visibility: hidden;
}
.yui-panel-container select {
_visibility: inherit;
}
/*
There are two known issues with YAHOO.widget.Overlay (and its subclasses) that
manifest in Gecko-based browsers on Mac OS X:
1) Elements with scrollbars will poke through Overlay instances floating
above them.
2) An Overlay's scrollbars and the scrollbars of its child nodes remain
visible when the Overlay is hidden.
To fix these bugs:
1) The "overflow" property of an Overlay instance's root element and child
nodes is toggled between "hidden" and "auto" (through the application
and removal of the "hide-scrollbars" and "show-scrollbars" CSS classes)
as its "visibility" configuration property is toggled between
"false" and "true."
2) The "display" property of <SELECT> elements that are child nodes of the
Overlay instance's root element is set to "none" when it is hidden.
PLEASE NOTE:
1) The "hide-scrollbars" and "show-scrollbars" CSS classes classes are
applied only for Gecko on Mac OS X and are added/removed to/from the
Overlay's root HTML element (DIV) via the "hideMacGeckoScrollbars" and
"showMacGeckoScrollbars" methods of YAHOO.widget.Overlay.
2) There may be instances where the CSS for a web page or application
contains style rules whose specificity override the rules implemented by
the Container CSS files to fix this bug. In such cases, is necessary to
leverage the provided "hide-scrollbars" and "show-scrollbars" classes to
write custom style rules to guard against this bug.
** For more information on this issue, see:
+ https://bugzilla.mozilla.org/show_bug.cgi?id=187435
+ SourceForge bug #1723530
*/
.hide-scrollbars,
.hide-scrollbars * {
overflow: hidden;
}
.hide-scrollbars select {
display: none;
}
.show-scrollbars {
overflow: auto;
}
.yui-panel-container.show-scrollbars,
.yui-tt.show-scrollbars {
overflow: visible;
}
.yui-panel-container.show-scrollbars .underlay,
.yui-tt.show-scrollbars .yui-tt-shadow {
overflow: auto;
}
/*
Workaround for Safari 2.x - the yui-force-redraw class is applied, and then removed when
the Panel's content changes, to force Safari 2.x to redraw the underlay.
We attempt to choose a CSS property which has no visual impact when added,
removed.
*/
.yui-panel-container.shadow .underlay.yui-force-redraw {
padding-bottom: 1px;
}
.yui-effect-fade .underlay, .yui-effect-fade .yui-tt-shadow {
display:none;
}
/*
PLEASE NOTE: The <DIV> element used for a Tooltip's shadow is appended
to its root element via JavaScript once it has been rendered. The
code that creates the shadow lives in the Tooltip's public "onRender"
event handler that is a prototype method of YAHOO.widget.Tooltip.
Implementers wishing to remove a Tooltip's shadow or add any other markup
required for a given skin for Tooltip should override the "onRender" method.
*/
.yui-tt-shadow {
position: absolute;
}
.yui-override-padding {
padding:0 !important;
}
.yui-panel-container .container-close {
overflow:hidden;
text-indent:-10000em;
text-decoration:none;
}
.yui-overlay.yui-force-redraw, .yui-panel-container.yui-force-redraw {
margin-bottom:1px;
}
\ No newline at end of file
/*
Copyright (c) 2009, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 2.7.0
*/
/* This file intentionally left blank */
/*
Copyright (c) 2009, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 2.7.0
*/
/* Menu & MenuBar styles */
.yuimenu {
top: -999em;
left: -999em;
}
.yuimenubar {
position: static;
}
.yuimenu .yuimenu,
.yuimenubar .yuimenu {
position: absolute;
}
.yuimenubar li,
.yuimenu li {
list-style-type: none;
}
.yuimenubar ul,
.yuimenu ul,
.yuimenubar li,
.yuimenu li,
.yuimenu h6,
.yuimenubar h6 {
margin: 0;
padding: 0;
}
.yuimenuitemlabel,
.yuimenubaritemlabel {
text-align: left;
white-space: nowrap;
}
/*
The following style rule trigger the "hasLayout" property in
IE (http://msdn2.microsoft.com/en-us/library/ms533776.aspx) for a
MenuBar instance's <ul> element, allowing both to clear their floated
child <li> elements.
*/
.yuimenubar ul {
*zoom: 1;
}
/*
Remove the "hasLayout" trigger for submenus of MenuBar instances as it
is unnecessary.
*/
.yuimenubar .yuimenu ul {
*zoom: normal;
}
/*
The following style rule allows a MenuBar instance's <ul> element to clear
its floated <li> elements in Firefox, Safari and and Opera.
*/
.yuimenubar>.bd>ul:after {
content: ".";
display: block;
clear: both;
visibility: hidden;
height: 0;
line-height: 0;
}
.yuimenubaritem {
float: left;
}
.yuimenubaritemlabel,
.yuimenuitemlabel {
display: block;
}
.yuimenuitemlabel .helptext {
font-style: normal;
display: block;
/*
The value for the left margin controls how much the help text is
offset from the text of the menu item. This value will need to
be customized depending on the longest text label of a menu item.
*/
margin: -1em 0 0 10em;
}
/*
PLEASE NOTE: The <div> element used for a menu's shadow is appended
to its root element via JavaScript once it has been rendered. The
code that creates the shadow lives in the menu's public "onRender"
event handler that is a prototype method of YAHOO.widget.Menu.
Implementers wishing to remove a menu's shadow or add any other markup
required for a given skin for menu should override the "onRender" method.
*/
.yui-menu-shadow {
position: absolute;
visibility: hidden;
z-index: -1;
}
.yui-menu-shadow-visible {
top: 2px;
right: -3px;
left: -3px;
bottom: -3px;
visibility: visible;
}
/*
There are two known issues with YAHOO.widget.Overlay (the superclass class of
Menu) that manifest in Gecko-based browsers on Mac OS X:
1) Elements with scrollbars will poke through Overlay instances floating
above them.
2) An Overlay's scrollbars and the scrollbars of its child nodes remain
visible when the Overlay is hidden.
To fix these bugs in Menu (a subclass of YAHOO.widget.Overlay):
1) The "overflow" property of a Menu instance's shadow element and child
nodes is toggled between "hidden" and "auto" (through the application
and removal of the "hide-scrollbars" and "show-scrollbars" CSS classes)
as its "visibility" configuration property is toggled between
"false" and "true."
2) The "display" property of <select> elements that are child nodes of the
Menu instance's root element is set to "none" when it is hidden.
PLEASE NOTE:
1) The "hide-scrollbars" and "show-scrollbars" CSS classes classes are
applied only for Gecko on Mac OS X and are added/removed to/from the
Overlay's root HTML element (DIV) via the "hideMacGeckoScrollbars" and
"showMacGeckoScrollbars" methods of YAHOO.widget.Overlay.
2) There may be instances where the CSS for a web page or application
contains style rules whose specificity override the rules implemented by
the Menu CSS files to fix this bug. In such cases, is necessary to
leverage the provided "hide-scrollbars" and "show-scrollbars" classes to
write custom style rules to guard against this bug.
** For more information on this issue, see:
+ https://bugzilla.mozilla.org/show_bug.cgi?id=187435
+ SourceForge bug #1723530
*/
.hide-scrollbars * {
overflow: hidden;
}
.hide-scrollbars select {
display: none;
}
/*
The following style rule (".yuimenu.show-scrollbars") overrides the
".show-scrollbars" rule defined in container-core.css which sets the
"overflow" property of a YAHOO.widget.Overlay instance's root HTML element to
"auto" when it is visible. Without this override, a Menu would have scrollbars
when one of its submenus is visible.
*/
.yuimenu.show-scrollbars,
.yuimenubar.show-scrollbars {
overflow: visible;
}
.yuimenu.hide-scrollbars .yui-menu-shadow,
.yuimenubar.hide-scrollbars .yui-menu-shadow {
overflow: hidden;
}
.yuimenu.show-scrollbars .yui-menu-shadow,
.yuimenubar.show-scrollbars .yui-menu-shadow {
overflow: auto;
}
.yui-overlay.yui-force-redraw {
margin-bottom: 1px;
}
\ No newline at end of file
/*
Copyright (c) 2009, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 2.7.0
*/
.yui-navset .yui-nav li {
margin-right:0.16em; /* space between tabs */
padding-top:1px; /* gecko: make room for overflow */
zoom:1;
}
.yui-navset .yui-nav .selected {
margin-bottom:-1px; /* for overlap */
}
.yui-navset .yui-nav a {
background:#dadbdb url(../../assets/skins/sam/sprite.png) repeat-x; /* sprite position for normal gradient */
border:solid #a3a3a3;
border-width:0 1px;
color:#000;
text-decoration:none;
}
.yui-navset .yui-nav li a em {
border-top:solid 1px #a3a3a3;
border-bottom:0;
cursor:hand;
padding:0.2em 0.5em;
top:-1px; /* for 1px rounded corners */
position:relative;
}
.yui-navset .yui-nav .selected a,
.yui-navset .yui-nav a:focus,
.yui-navset .yui-nav a:hover {
background:#214197 url(../../assets/skins/sam/sprite.png) repeat-x left -1400px;
color:#fff;
}
.yui-navset .yui-nav .selected a em {
padding:0.3em 0.5em; /* raise selected tab */
}
.yui-navset .yui-nav .selected a,
.yui-navset .yui-nav a:hover,
.yui-navset .yui-nav a:focus {
border-color:#243356;
}
.yui-navset .yui-nav a:hover em,
.yui-navset .yui-nav a:focus em,
.yui-navset .yui-nav .selected a em {
border-color:#233356 #406ed9;
}
.yui-navset .yui-nav {
border-bottom:1px solid #243356;
position:relative;
zoom:1;
}
.yui-navset .yui-content {
background:#abceff;
border-top:5px solid #214095;
}
.yui-navset .yui-content div {
border:1px solid #808080;
border-top-color:#243356;
padding:0.25em 0.5em;
}
.yui-navset .yui-content div div { /* kill inheritance */
border:0;
padding:0;
}
/*
Copyright (c) 2009, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 2.7.0
*/
/* default space between tabs */
.yui-navset .yui-nav li,
.yui-navset .yui-navset-top .yui-nav li,
.yui-navset .yui-navset-bottom .yui-nav li {
margin:0 0.5em 0 0; /* horizontal tabs */
}
.yui-navset-left .yui-nav li,
.yui-navset-right .yui-nav li {
margin:0 0 0.5em; /* vertical tabs */
}
.yui-navset .yui-content .yui-hidden {
position:absolute;
left:-999999px;
visibility:hidden;
}
/* default width for side tabs */
.yui-navset .yui-navset-left .yui-nav,
.yui-navset .yui-navset-right .yui-nav,
.yui-navset-left .yui-nav,
.yui-navset-right .yui-nav { width:6em; }
.yui-navset-top .yui-nav,
.yui-navset-bottom .yui-nav {
width:auto;
}
.yui-navset .yui-navset-left,
.yui-navset-left { padding:0 0 0 6em; } /* map to nav width */
.yui-navset-right { padding:0 6em 0 0; } /* ditto */
.yui-navset-top,
.yui-navset-bottom {
padding:auto;
}
/* core */
.yui-nav,
.yui-nav li {
margin:0;
padding:0;
list-style:none;
}
.yui-navset li em { font-style:normal; }
.yui-navset {
position:relative; /* contain absolute positioned tabs (left/right) */
zoom:1;
}
.yui-navset .yui-content,
.yui-navset .yui-content div {
zoom:1;
}
.yui-navset .yui-content:after {
content:'';
display:block;
clear:both;
}
.yui-navset .yui-nav li,
.yui-navset .yui-navset-top .yui-nav li, /* in case nested */
.yui-navset .yui-navset-bottom .yui-nav li {
display:inline-block;
display:-moz-inline-stack;
*display:inline; /* IE */
vertical-align:bottom; /* safari: for overlap */
cursor:pointer; /* gecko: due to -moz-inline-stack on anchor */
zoom:1; /* IE: kill space between horizontal tabs */
}
.yui-navset-left .yui-nav li,
.yui-navset-right .yui-nav li {
display:block;
}
.yui-navset .yui-nav a { position:relative; } /* IE: to allow overlap */
.yui-navset .yui-nav li a,
.yui-navset-top .yui-nav li a,
.yui-navset-bottom .yui-nav li a {
display:block;
display:inline-block;
vertical-align:bottom; /* safari: for overlap */
zoom:1;
}
.yui-navset-left .yui-nav li a,
.yui-navset-right .yui-nav li a {
display:block;
}
.yui-navset-bottom .yui-nav li a {
vertical-align:text-top; /* for inline overlap (reverse for Opera border bug) */
}
.yui-navset .yui-nav li a em,
.yui-navset-top .yui-nav li a em,
.yui-navset-bottom .yui-nav li a em { display:block; }
/* position left and right oriented tabs */
.yui-navset .yui-navset-left .yui-nav,
.yui-navset .yui-navset-right .yui-nav,
.yui-navset-left .yui-nav,
.yui-navset-right .yui-nav {
position:absolute;
z-index:1;
}
.yui-navset-top .yui-nav,
.yui-navset-bottom .yui-nav {
position:static;
}
.yui-navset .yui-navset-left .yui-nav,
.yui-navset-left .yui-nav { left:0; right:auto; }
.yui-navset .yui-navset-right .yui-nav,
.yui-navset-right .yui-nav { right:0; left:auto; }
/*
Copyright (c) 2009, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 2.7.0
*/
/*
Copyright (c) 2009, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 2.7.0
*/
/*
Copyright (c) 2008, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 2.5.2
*/
/* the style of the div around each node */
.ygtvitem { }
table.ygtvtable {
margin-bottom:0;
border:none;
border-collapse:collapse;
}
/*.ygtvitem td {*/
td.ygtvcell {
border: none;
padding: 0;
}
a.ygtvspacer {
text-decoration:none;
outline-style:none;
}
/* first or middle sibling, no children */
.ygtvtn {
width:18px; height:22px;
background: url(treeview-sprite.gif) 0 -5600px no-repeat;
cursor:pointer ;
}
/* first or middle sibling, collapsable */
.ygtvtm {
width:18px; height:22px;
cursor:pointer ;
background: url(treeview-sprite.gif) 0 -4000px no-repeat;
}
/* first or middle sibling, collapsable, hover */
.ygtvtmh,.ygtvtmhh {
width:18px; height:22px;
cursor:pointer ;
background: url(treeview-sprite.gif) 0 -4800px no-repeat;
}
/* first or middle sibling, expandable */
.ygtvtp {
width:18px; height:22px;
cursor:pointer ;
background: url(treeview-sprite.gif) 0 -6400px no-repeat;
}
/* first or middle sibling, expandable, hover */
.ygtvtph ,.ygtvtphh {
width:18px; height:22px;
cursor:pointer ;
background: url(treeview-sprite.gif) 0 -7200px no-repeat;
}
/* last sibling, no children */
.ygtvln {
width:18px; height:22px;
background: url(treeview-sprite.gif) 0 -1600px no-repeat;
cursor:pointer ;
}
/* Last sibling, collapsable */
.ygtvlm {
width:18px; height:22px;
cursor:pointer ;
background: url(treeview-sprite.gif) 0 0px no-repeat;
}
/* Last sibling, collapsable, hover */
.ygtvlmh,.ygtvlmhh {
width:18px; height:22px;
cursor:pointer ;
background: url(treeview-sprite.gif) 0 -800px no-repeat;
}
/* Last sibling, expandable */
.ygtvlp {
width:18px; height:22px;
cursor:pointer ;
background: url(treeview-sprite.gif) 0 -2400px no-repeat;
}
/* Last sibling, expandable, hover */
.ygtvlph,.ygtvlphh {
width:18px; height:22px; cursor:pointer ;
background: url(treeview-sprite.gif) 0 -3200px no-repeat;
cursor:pointer ;
}
/* Loading icon */
.ygtvloading {
width:18px; height:22px;
background: url(treeview-loading.gif) 0 0 no-repeat;
}
/* the style for the empty cells that are used for rendering the depth
* of the node */
.ygtvdepthcell {
width:18px; height:22px;
background: url(treeview-sprite.gif) 0 -8000px no-repeat;
}
.ygtvblankdepthcell { width:18px; height:22px; }
/* the style of the div around each node's collection of children */
.ygtvchildren { }
* html .ygtvchildren { height:2%; }
/* the style of the text label in ygTextNode */
.ygtvlabel, .ygtvlabel:link, .ygtvlabel:visited, .ygtvlabel:hover {
margin-left:2px;
text-decoration: none;
background-color: white; /* workaround for IE font smoothing bug */
cursor:pointer;
}
.ygtvcontent {
cursor:default;
}
.ygtvspacer { height: 22px; width: 18px; }
.ygtvfocus {
background-color: #c0e0e0;
border: none;
}
.ygtvfocus .ygtvlabel, .ygtvfocus .ygtvlabel:link, .ygtvfocus .ygtvlabel:visited, .ygtvfocus .ygtvlabel:hover {
background-color: #c0e0e0;
}
.ygtvfocus a {
outline-style:none;
}
.ygtvok {
width:18px; height:22px;
background: url(treeview-sprite.gif) 0 -8800px no-repeat;
}
.ygtvok:hover {
background: url(treeview-sprite.gif) 0 -8844px no-repeat;
}
.ygtvcancel {
width:18px; height:22px;
background: url(treeview-sprite.gif) 0 -8822px no-repeat;
}
.ygtvcancel:hover {
background: url(treeview-sprite.gif) 0 -8866px no-repeat;
}
.ygtv-label-editor {
background-color:#f2f2f2;
border: 1px solid silver;
position:absolute;
display:none;
overflow:hidden;
margin:auto;
z-index:9000;
}
.ygtv-edit-TextNode {
width: 190px;
}
.ygtv-edit-TextNode .ygtvcancel, .ygtv-edit-TextNode .ygtvok {
border:none;
}
.ygtv-edit-TextNode .ygtv-button-container {
float: right;
}
.ygtv-edit-TextNode .ygtv-input input{
width: 140px;
}
.ygtv-edit-DateNode .ygtvcancel {
border:none;
}
.ygtv-edit-DateNode .ygtvok {
display:none;
}
.ygtv-edit-DateNode .ygtv-button-container {
text-align:right;
margin:auto;
}
.ygtv-highlight .ygtv-highlight0 , .ygtv-highlight .ygtv-highlight0 .ygtvlabel{
}
.ygtv-highlight .ygtv-highlight1 , .ygtv-highlight .ygtv-highlight1 .ygtvlabel{
background-color:blue;
color:white;
}
.ygtv-highlight .ygtv-highlight2 , .ygtv-highlight .ygtv-highlight2 .ygtvlabel {
background-color:silver;
}
.ygtv-highlight .ygtv-highlight0 .ygtvfocus .ygtvlabel,
.ygtv-highlight .ygtv-highlight1 .ygtvfocus .ygtvlabel,
.ygtv-highlight .ygtv-highlight2 .ygtvfocus .ygtvlabel {
background-color: #c0e0e0;
}
.ygtv-highlight .ygtvcontent {
padding-right: 1em;
}
.ygtv-checkbox .ygtv-highlight0 .ygtvcontent {
padding-left:1em;
background:url(check0.gif) no-repeat;
}
.ygtv-checkbox .ygtv-highlight0 .ygtvfocus.ygtvcontent,
.ygtv-checkbox .ygtv-highlight1 .ygtvfocus.ygtvcontent ,
.ygtv-checkbox .ygtv-highlight2 .ygtvfocus.ygtvcontent {
background-color:#c0e0e0;
}
.ygtv-checkbox .ygtv-highlight1 .ygtvcontent {
padding-left:1em;
background:url(check1.gif) no-repeat;
}
.ygtv-checkbox .ygtv-highlight2 .ygtvcontent{
padding-left:1em;
background:url(check2.gif) no-repeat;
}
/*
Copyright (c) 2007, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 2.3.0
*/
/* first or middle sibling, no children */
.ygtvtn {
width:18px; height:22px;
background: url(sprite-orig.gif) 0 -5600px no-repeat;
}
/* first or middle sibling, collapsable */
.ygtvtm {
width:18px; height:22px;
cursor:pointer ;
background: url(sprite-orig.gif) 0 -4000px no-repeat;
}
/* first or middle sibling, collapsable, hover */
.ygtvtmh {
width:18px; height:22px;
cursor:pointer ;
background: url(sprite-orig.gif) 0 -4800px no-repeat;
}
/* first or middle sibling, expandable */
.ygtvtp {
width:18px; height:22px;
cursor:pointer ;
background: url(sprite-orig.gif) 0 -6400px no-repeat;
}
/* first or middle sibling, expandable, hover */
.ygtvtph {
width:18px; height:22px;
cursor:pointer ;
background: url(sprite-orig.gif) 0 -7200px no-repeat;
}
/* last sibling, no children */
.ygtvln {
width:18px; height:22px;
background: url(sprite-orig.gif) 0 -1600px no-repeat;
}
/* Last sibling, collapsable */
.ygtvlm {
width:18px; height:22px;
cursor:pointer ;
background: url(sprite-orig.gif) 0 0px no-repeat;
}
/* Last sibling, collapsable, hover */
.ygtvlmh {
width:18px; height:22px;
cursor:pointer ;
background: url(sprite-orig.gif) 0 -800px no-repeat;
}
/* Last sibling, expandable */
.ygtvlp {
width:18px; height:22px;
cursor:pointer ;
background: url(sprite-orig.gif) 0 -2400px no-repeat;
}
/* Last sibling, expandable, hover */
.ygtvlph {
width:18px; height:22px; cursor:pointer ;
background: url(sprite-orig.gif) 0 -3200px no-repeat;
}
/* Loading icon */
.ygtvloading {
width:18px; height:22px;
background: url(treeview-loading.gif) 0 0 no-repeat;
}
/* the style for the empty cells that are used for rendering the depth
* of the node */
.ygtvdepthcell {
width:18px; height:22px;
background: url(sprite-orig.gif) 0 -8000px no-repeat;
}
.ygtvblankdepthcell { width:18px; height:22px; }
/* the style of the div around each node */
.ygtvitem { }
/* the style of the div around each node's collection of children */
.ygtvchildren { }
* html .ygtvchildren { height:2%; }
/* the style of the text label in ygTextNode */
.ygtvlabel, .ygtvlabel:link, .ygtvlabel:visited, .ygtvlabel:hover {
margin-left:2px;
text-decoration: none;
background-color: white; /* workaround for IE font smoothing bug */
}
.ygtvspacer { height: 22px; width: 18px; }
for { set x 0 } { $x< 21 } { incr x } {
set script [ah::create_js_function -body [ah::ext::updateprogress -progress_count "$x/20" -progress_txt "Installing $x files of My Sample Program" ] ]
ns_write "setTimeout($script,$x*1000); "
}
\ No newline at end of file
<master>
<property name="title">Progress Bar</property>
@script;noquote@
\ No newline at end of file
set options [list [list "minWidth" "350"] [list "closable" "false"] [list "title" "\"Sample Progress Bar\""] [list "progress" "true"] [list "msg" "\"Please wait ...\""] ]
set script [ah::ext::msgbox -options $options]
append script [ah::ext::ajax -url "test_extprogressbar-handler" -success [ah::create_js_function -body "eval(o.responseText)" -parameters "o"] ]
set script [ah::enclose_in_script -script [ah::ext::onready -body $script]]
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment