2011-07-01 22:56:53 +00:00
|
|
|
|
|
|
|
if {![exists -proc require]} {
|
2011-07-05 18:38:42 +00:00
|
|
|
proc require {args} {{done {}}} {
|
2011-07-01 22:56:53 +00:00
|
|
|
foreach file $args {
|
2011-07-07 22:33:19 +00:00
|
|
|
if {$file ni $done} {
|
2012-05-21 20:23:41 +00:00
|
|
|
uplevel source "/mod/webif/lib/$file"
|
2013-09-07 22:13:03 +00:00
|
|
|
lappend done $file
|
2011-07-05 18:38:42 +00:00
|
|
|
}
|
2011-07-01 22:56:53 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-02-09 22:46:15 +00:00
|
|
|
proc httpheader {{type "text/html"} {cache 0} {extra ""}} {{done 0}} {
|
|
|
|
if {$done} return
|
|
|
|
if {!$cache} {
|
2013-02-25 22:31:54 +00:00
|
|
|
puts -nonewline "Content-Type: $type; charset=\"UTF-8\"; no-cache\r\n"
|
2013-02-09 22:46:15 +00:00
|
|
|
puts -nonewline "Expires: -1\r\n"
|
|
|
|
puts -nonewline "Pragma: no-cache\r\n"
|
|
|
|
puts -nonewline "Cache-Control: no-cache\r\n"
|
|
|
|
} else {
|
2013-04-10 21:49:11 +00:00
|
|
|
puts -nonewline "Content-Type: $type; charset=\"UTF-8\"\r\n"
|
2013-02-09 22:46:15 +00:00
|
|
|
}
|
2013-04-10 21:49:11 +00:00
|
|
|
if {$extra ne ""} { puts -nonewline "$extra" }
|
2013-02-09 22:46:15 +00:00
|
|
|
puts -nonewline "\r\n"
|
|
|
|
set done 1
|
|
|
|
}
|
|
|
|
|
|
|
|
proc header {{type "text/html"} {cache 0}} {
|
|
|
|
httpheader $type $cache
|
2012-05-21 20:23:41 +00:00
|
|
|
uplevel source /mod/webif/html/lib/header.jim
|
2011-07-01 22:56:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
proc footer {} {
|
2012-05-21 20:23:41 +00:00
|
|
|
uplevel source /mod/webif/html/lib/footer.jim
|
2011-07-01 22:56:53 +00:00
|
|
|
}
|
2012-01-22 19:47:47 +00:00
|
|
|
|
2012-10-23 22:51:54 +00:00
|
|
|
proc mheader {} {
|
|
|
|
uplevel source /mod/webif/html/m/lib/header.jim
|
|
|
|
}
|
|
|
|
|
|
|
|
proc mfooter {} {
|
|
|
|
uplevel source /mod/webif/html/m/lib/footer.jim
|
|
|
|
}
|
|
|
|
|
2013-09-07 22:13:03 +00:00
|
|
|
proc jqplugin {name} {{done {}}} {
|
|
|
|
if {$name in $done} return
|
|
|
|
lappend done $name
|
2013-07-30 20:07:13 +00:00
|
|
|
foreach file [glob "/mod/webif/html/lib/jquery.$name/*.js"] {
|
|
|
|
set file [join [lrange [split $file /] 4 end] /]
|
|
|
|
puts "<script type=text/javascript src=/$file></script>"
|
|
|
|
}
|
|
|
|
foreach file [glob "/mod/webif/html/lib/jquery.$name/*.css"] {
|
|
|
|
set file [join [lrange [split $file /] 4 end] /]
|
|
|
|
puts "<link href=/$file rel=stylesheet type=text/css />"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-11-26 21:47:58 +00:00
|
|
|
require fileops overrides
|
2011-07-01 22:56:53 +00:00
|
|
|
}
|
|
|
|
|