summaryrefslogtreecommitdiff
path: root/web/cgi/pub
diff options
context:
space:
mode:
authorEduardo Chappa <echappa@gmx.com>2013-02-03 00:59:38 -0700
committerEduardo Chappa <echappa@gmx.com>2013-02-03 00:59:38 -0700
commit094ca96844842928810f14844413109fc6cdd890 (patch)
treee60efbb980f38ba9308ccb4fb2b77b87bbc115f3 /web/cgi/pub
downloadalpine-094ca96844842928810f14844413109fc6cdd890.tar.xz
Initial Alpine Version
Diffstat (limited to 'web/cgi/pub')
l---------web/cgi/pub/alpine.tcl1
-rwxr-xr-xweb/cgi/pub/getach.tcl87
-rw-r--r--web/cgi/pub/standard.css45
-rw-r--r--web/cgi/pub/standard.js414
l---------web/cgi/pub/tclsh1
5 files changed, 548 insertions, 0 deletions
diff --git a/web/cgi/pub/alpine.tcl b/web/cgi/pub/alpine.tcl
new file mode 120000
index 00000000..5ad8d42f
--- /dev/null
+++ b/web/cgi/pub/alpine.tcl
@@ -0,0 +1 @@
+../alpine.tcl \ No newline at end of file
diff --git a/web/cgi/pub/getach.tcl b/web/cgi/pub/getach.tcl
new file mode 100755
index 00000000..dce5047c
--- /dev/null
+++ b/web/cgi/pub/getach.tcl
@@ -0,0 +1,87 @@
+#!./tclsh
+
+# ========================================================================
+# Copyright 2006-2007 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# getach.tcl
+#
+# Purpose: CGI script to retrieve requested attachment
+#
+# Input:
+#
+# h : handle referring to temp file holding attachment particulars
+
+# inherit global config
+source ./alpine.tcl
+
+cgi_eval {
+
+ # verify that the format of the request is correct. Mainly it's
+ # to reasonably handle relative urls in viewed html attachments. Ugh.
+ if {[regexp {^h=[A-Za-z0-9]*$} $env(QUERY_STRING)]} {
+
+ cgi_input
+
+ WPImport h
+
+ if {[regexp {^[A-Za-z0-9]+$} $h] != 1} {
+ WPInfoPage "Web Alpine Error" [font size=+2 "Bogus Attachment Handle: $h"] "Please close this window."
+ exit
+ }
+
+ set cmdfile [file join $_wp(detachpath) detach.${h}-control]
+
+ if {[file exists $cmdfile] == 0} {
+ WPInfoPage "Webpine Error" [font size=+2 "Stale Handle Reference"] "Please click the attachment link to view this attachment."
+ } elseif {[catch {
+ set cid [open $cmdfile r]
+
+ while {1} {
+ if {[gets $cid line] == 0} {
+ if {[gets $cid tmpfile] != 0} {
+ puts stdout ""
+
+ set fp [open $tmpfile r]
+
+ fconfigure $fp -translation binary
+ fconfigure stdout -translation binary
+
+ fcopy $fp stdout
+
+ close $fp
+ }
+
+ break
+ } else {
+ puts stdout $line
+ }
+ }
+ } errstr]} {
+ WPInfoPage "Webpine Error" [font size=+2 $errstr] "Please close this window."
+ }
+
+ #
+ # Don't delete the temp files immediately because *some* browsers
+ # <cough>IE<cough> will download the attachment, then hand the
+ # URL of the downloaded attachment to the viewer <cough>WMP<cough>
+ # so the viewer can then *REFETCH* the data for display. No,
+ # they don't pay attention to the redirect code.
+ #
+ # The script that created them is responsible for having set in motion
+ # a process to delete them at some point in the future.
+ #
+ # catch {file delete -force $cmdfile}
+ # catch {file delete -force $tmpfile}
+ } else {
+ WPInfoPage "Invalid Attachment Reference" "[font size=+2 "Invalid Attachment Reference"]" \
+ "This page is the result of clicking a link in an attached HTML document. It's author likely used an incomplete hypertext link which resulted in a bogus link to the WebPine server.<p>Clicking your browser's Back button should restore the attachment's display."
+ }
+}
diff --git a/web/cgi/pub/standard.css b/web/cgi/pub/standard.css
new file mode 100644
index 00000000..e2b0fd21
--- /dev/null
+++ b/web/cgi/pub/standard.css
@@ -0,0 +1,45 @@
+TD.nosize { font-size: 16px }
+DIV.fname { font-family: arial, sans-serif; font-size: 10pt }
+.prog { font-family: arial, sans-serif ; font-weight: bold ; font-size: 16px ; color: #50056E }
+.title { font-family: arial, sans-serif ; color: white }
+.flymenu { visibility: hidden; position: absolute; left: 0; top: 0 }
+.flydata { font-family: arial, sans-serif ; font-size: 10pt }
+.flydata:hover { color: #ff0066 }
+TABLE.flydata { background-color: #fefac9 ; border: #006400 2px solid }
+TH.flydata { text-align: center ; color: white ; background-color: #006400 }
+HR.flydata { color: #006400 }
+A.flydata { font-size: 10pt ; text-decoration: none ; color: black }
+.menubar { color: white; font-family: arial, sans-serif; font-size: 8pt }
+.menubar:hover { color:yellow }
+DIV.menubar { position: absolute; visibility: visible; top: 62px; left: 2px; }
+A.menubar { color:black; text-decoration:none; font-weight:bold ; height: 16px ; width: 100px ; vertical-align: middle }
+HR.menubar { border-top: solid; color: black }
+.body { background-color: white }
+input.body { color: white; }
+.indexhdr { font-family: geneva, arial, sans-serif ; font-size: 8pt ; color: black }
+.indexsort { font-family: geneva, arial, sans-serif ; background-color: #999999 ; font-size: 8pt ; color: white }
+.auth { font-family: Arial, Sans-Serif ; font-size: 10pt ; font-weight: bold }
+.extrahdrs { background-color: white; display: none }
+.navtext { font-family: geneva, arial, sans-serif ; font-size: 9pt }
+.navbar { color: white ; font-family: geneva, arial, sans-serif ; font-size: 9pt ; letter-spacing: 0pt }
+FORM { margin-bottom: 0px ; margin-top: 0px }
+.statustext { color: black ; font-family: geneva, arial, sans-serif ; font-size: 8pt }
+.morestatus { color: #ff3333 ; font-size: 10pt ; font-weight : bold }
+.ifakebar { visibility: hidden; position: absolute; left: 0; top: 0 }
+.ithumb { position: relative }
+.iflags { font-family: sans-serif ; color: red }
+.isize { font-size: 9pt }
+.notice { color: red ; font-weight: bold }
+A.notice { color: red }
+.attach { visibility: hidden; position: absolute; left: 0; top: 0 }
+.mispell { background: #ffcccc ; color: #000000; text-decoration: none }
+.spelltext { position: relative }
+.dialog { background-color: #fefac9 ; font-family: arial, sans-serif ; font-size: 12pt }
+.context { background-color: #999999 ; color: black ; font-family: Helvetica, sans-serif ; font-size: 9pt }
+.ops { background-color: #666666 ; color: white ; font-family: Helvetica, sans-serif }
+.i0 { background-color: #eeeeee }
+.i1 { background-color: #ffffff }
+.cfntc { color: red; font-size: 8pt }
+.cfval { font-size: 9pt }
+.cfvn { font-weight: bold; font-size: 10pt }
+.foldpic { background-color: #eeeeee }
diff --git a/web/cgi/pub/standard.js b/web/cgi/pub/standard.js
new file mode 100644
index 00000000..89157e1f
--- /dev/null
+++ b/web/cgi/pub/standard.js
@@ -0,0 +1,414 @@
+var child = new Object();
+child.win = null;
+var reloadtimer = null
+var resizer = null;
+var resized = null;
+var resizex = 0;
+var resizey = 0;
+
+if (navigator.appName.indexOf('Netscape') >= 0) {
+ if (navigator.appVersion.substr(0,1) < 5) {
+ isW3C = false;
+ isIE = false;
+ sEvent='e';
+ sKey='.which';
+ yRef='.top';
+ xRef='.left';
+ xOff='.clip.width';
+ yOff='.clip.height';
+ xEvent='.pageX';
+ yEvent='.pageY';
+ dS='document.';
+ sD='';
+ sHideV="'hide'";
+ sShowV="'show'";
+ dRef='self';
+ hRef='.innerHeight';
+ wRef='.innerWidth';
+ xSRef='.screenX';
+ ySRef='.screenY';
+ xPos=dRef+'.pageXOffset';
+ yPos=dRef+'.pageYOffset';
+ eSrc='.target';
+ } else {
+ isW3C = true;
+ isIE = false;
+ sEvent='e';
+ sKey='.which';
+ yRef='.top';
+ xRef='.left';
+ xOff='.offsetWidth';
+ yOff='.offsetHeight';
+ xEvent='.pageX';
+ yEvent='.pageY';
+ dS='document.';
+ sD='.style';
+ sHideV="'hidden'";
+ sShowV="'visible'";
+ dRef='self';
+ hRef='.innerHeight';
+ wRef='.innerWidth';
+ xSRef='.screenX';
+ ySRef='.screenY';
+ xPos=dRef+'.pageXOffset';
+ yPos=dRef+'.pageYOffset';
+ eSrc='.target';
+ }
+}
+else {
+ isIE = true;
+ isW3C = 0;
+ sEvent='window.event';
+ sKey='.keyCode';
+ yRef='.pixelTop';
+ xRef='.pixelLeft';
+ xOff='.offsetWidth';
+ yOff='.offsetHeight';
+ xEvent='.clientX';
+ yEvent='.clientY';
+ dS='';
+ sD='.style';
+ sHideV="'hidden'";
+ sShowV="'visible'";
+ dRef='document.body';
+ hRef='.clientHeight';
+ wRef='.clientWidth';
+ xPos=dRef+'.scrollLeft';
+ yPos=dRef+'.scrollTop';
+ xSRef='.screenLeft';
+ ySRef='.screenTop';
+ eSrc='.srcElement';
+}
+
+function setLayout() {
+ updateLayout();
+}
+
+function updateLayout() {
+ var yy = eval(yPos);
+ yy += Math.max(64 - yy, 0);
+ moveLayerY(getLayer('tasks'),yy);
+ setTimeout('updateLayout()',100);
+}
+
+function setResize(f,w) {
+ document.resized = (f) ? f : doResize;
+
+ document.resizex = getDisplayWidth();
+ document.resizey = getDisplayHeight();
+
+ if (isIE){
+ document.resizer = (w) ? w : null;
+ window.onresize = armResize;
+ }
+ else{
+ window.onresize = document.resized;
+ }
+}
+
+function armResize(e) {
+ if(document.resizer) document.resizer(e);
+ document.onmouseover = document.resized;
+}
+
+function doResize(e) {
+ if(!(document.resizex == getDisplayWidth() && document.resizey == getDisplayHeight())){
+ var newurl = window.location.href.replace(/\?.*$/, '');
+ document.onmouseover = null;
+ window.location.replace(newurl+'?ppg='+getResizedLines(e));
+ }
+}
+
+function getResizedLines(e) {
+ var h = (isW3C || document.all) ? eval(dRef+hRef) : e.height;
+ return Math.max(Math.floor((h - 66) / getIndexHeight()) - 1, 2);
+}
+
+function getDisplayWidth() {
+ return eval(dRef+wRef);
+}
+
+function getDisplayHeight() {
+ return eval(dRef+hRef);
+}
+
+function getWindowX() {
+ return eval('window'+xSRef);
+}
+
+function getWindowY() {
+ return eval('window'+ySRef);
+}
+
+function showElement(o) {
+ eval('o'+sD+'.visibility = '+sShowV);
+}
+
+function hideElement(o) {
+ eval('o'+sD+'.visibility = '+sHideV);
+}
+
+function isElementDisplayed(o) {
+ var d = eval('o'+sD+'.display');
+ return (d == 'block');
+}
+
+function displayElement(o) {
+ eval('o'+sD+'.display = "block"');
+}
+
+function concealElement(o) {
+ eval('o'+sD+'.display = "none"');
+}
+
+function getScrollAbove() {
+ return(eval(yPos));
+}
+
+function getScrollLeft() {
+ return(eval(xPos));
+}
+
+function layerWalk(l,t) {
+ var o;
+ for(var i = 0; i < l.length; i++){
+ o = eval('l[i]'+t);
+ if(o) return o;
+ o = layerWalk(l[i].document.layers,t);
+ if(o) return o;
+ }
+
+ return null;
+}
+
+function getImage(id) {
+ if(isW3C)
+ return document.getElementById(id);
+ else if(isIE)
+ return document.all[id];
+ else if(window.document.images[id])
+ return window.document.images[id];
+ else
+ return layerWalk(window.document.layers,'.document.images.'+id);
+}
+
+function getImageX(o) {
+ if(isIE || isW3C){
+ var x = o.offsetLeft;
+ for(var p = o.offsetParent; p != null; p = p.offsetParent)
+ x += p.offsetLeft;
+
+ return x;
+ }
+ else
+ return o.x;
+}
+
+function getImageY(o) {
+ if(isIE || isW3C){
+ var y = o.offsetTop;
+ for(var p = o.offsetParent; p != null; p = p.offsetParent)
+ y += p.offsetTop;
+
+ return y;
+ }
+ else
+ return o.y;
+}
+
+function getLayer(id) {
+ if(isW3C)
+ return document.getElementById(id);
+ else if(isIE)
+ return document.all[id];
+ else if(window.document.layers[id])
+ return window.document.layers[id];
+ else
+ return layerWalk(window.document.layers,'.document.layers.'+id);
+}
+
+function getElementWidth(l){
+ return l.width;
+}
+
+function getLayerHeight(l){
+ return eval('l'+yOff);
+}
+
+function getLayerWidth(l){
+ return eval('l'+xOff);
+}
+
+function getLayerX(l) {
+ return eval('l'+sD+xRef);
+}
+
+function getLayerY(l) {
+ return eval('l'+sD+yRef);
+}
+
+function moveLayerX(l,left) {
+ eval ('l'+sD+xRef+'='+left);
+}
+
+function moveLayerY(l,top) {
+ eval ('l'+sD+yRef+'='+top);
+}
+
+function moveLayer(l,left,top) {
+ moveLayerX(l,left);
+ moveLayerY(l,top);
+}
+
+function setLayerText(l,t) {
+ if(isIE || isW3C){
+ l.innerHTML = t;
+ }
+ else{
+ l.document.open();
+ l.document.write(t);
+ l.document.close();
+ }
+}
+
+function getEvent(e) {
+ return eval(sEvent);
+}
+
+function getEventElement(e) {
+ return eval('getEvent(e)'+eSrc);
+}
+
+function getEventX(e) {
+ return eval('getEvent(e)'+xEvent);
+}
+
+function getEventY(e) {
+ return eval('getEvent(e)'+yEvent);
+}
+
+function getKeyCode(e) {
+ return eval('getEvent(e)'+sKey);
+}
+
+function getControlKey(e) {
+ if(isW3C || isIE){
+ return getEvent(e).ctrlKey;
+ }
+ else{
+ return (e.modifiers & Event.CONTROL_MASK) != 0;
+ }
+}
+
+function getKeyStr(e) {
+ return String.fromCharCode(getKeyCode(e)).toLowerCase();
+}
+
+function focuschild() {
+ var rv = false;
+ var ourif = 'child.win.focus(); rv = true;';
+ var ourelse = 'child.win = null; window.onfocus = null;';
+
+ if(isIE && js_version >= 1.3){
+ eval('try {'+ourif+'} catch (all) {'+ourelse+'}');
+ }
+ else{
+ eval('if((child.win == null) || (child.win.closed)){'+ourelse+'}else{'+ourif+'}');
+ }
+
+ return rv;
+}
+
+function cOpen(u,n,a,w,h) {
+ if(!focuschild()){
+ var xWin = getWindowX(), yWin = getWindowY();
+ var wPage = getDisplayWidth(), hPage = getDisplayHeight();;
+ var x = Math.min(window.screen.width - wPage, Math.max(0, xWin + ((wPage - w)/2)));
+ var y = Math.min(window.screen.height - hPage, Math.max(0, yWin + ((hPage - h)/2)));
+ var f = a ? a+',' : '';
+ var now = new Date();
+
+ child.win = window.open(u,n+now.getTime(),f+'width='+w+',height='+h+',screenX='+x+',screenY='+y+',top='+y+',left='+x);
+ window.onfocus = focuschild;
+ }
+
+ return child.win;
+}
+
+function cnOpen(u,n,a,w,h) {
+ var xOffset = (window.screen.width - w)/2, yOffset = (window.screen.height - h)/2;
+ window.open(u,n,a+',width='+w+',height='+h+',screenX='+xOffset+',screenY='+yOffset+',top='+yOffset+',left='+xOffset);
+}
+
+function composeMsg(f,d,k) {
+ var s = 'compose.tcl', replace = 0;
+ switch(f) {
+ //case 'reply' : if(confirm('Include all recipients in Reply') == true) c = '?style=ReplyAll&uid='+d ; else c = '?style=Reply&uid='+d ; break;
+ case 'reply' : s='reply.tcl'; c = '?style=ReplyAll&uid='+d+'&cid='+k ; break;
+ case 'fwd' : c = '?style=Forward&uid='+d+'&cid='+k ; break;
+ case 'mailto' : c = '?to='+d+'&cid='+k ; break;
+ case 'nickto' : c = '?nickto='+d+'&cid='+k ; replace = 1; break;
+ default : c = '?cid='+k ; break;
+ }
+ if(!replace)
+ cOpen(s+c, 'compose', 'scrollbars=yes,resizable=yes', 800, 560);
+ else
+ window.location.href = s + c;
+ return false;
+}
+
+function isanum(s) {
+ if(s.length == 0)
+ return false;
+
+ for(var i = 0; i < s.length; i++)
+ if(s.charCodeAt(i) < 48 || s.charCodeAt(i) > 57)
+ return false;
+
+ return true;
+}
+
+function confOpen(s) {cOpen(s,'config','scrollbars=yes',800,560); return false;}
+function abookOpen(s) {cOpen(s,'addrbook','scrollbars=yes,resizable=yes',800,560); return false;}
+function helpOpen(s) {cOpen(s,'help','scrollbars=yes,resizable=yes',600,600); return false;}
+function aeOpen(s) {cOpen(s, 'addredit', 'scrollbars=yes,resizable=yes', 700, 500); return false}
+function taOpen(s) {cOpen(s, 'takeaddr', 'scrollbars=yes,resizable=yes', 700, 500); return false}
+function quitOpen(s) {cOpen(s, 'quit', '', 420, 200); return false}
+
+function doReload(ival) {
+ if((child.win == null) || (child.win.closed)){
+ var newurl = window.location.href.replace(/\?.*$/, '');
+ window.location.replace(newurl+'?reload=1');
+ }
+ else{
+ var i = getImage('logo');
+ if(i){
+ var now = new Date();
+ var t = new String();
+
+ t += now.getYear();
+ t += now.getMonth();
+ t += now.getDate();
+ t += now.getHours();
+ t += now.getMinutes();
+ t += now.getSeconds();
+ i.src = location.href.replace(/(.*)\/[^\/]*\.tcl.*/,'$1/ping.tcl/'+t+'/'+ival+'/'+(t - (t % ival))+'.gif');
+ }
+ }
+}
+
+function reloadTimer(s) {
+ reloadtimer = window.setInterval('doReload('+s+')', s * 1000);
+}
+
+function wp_escape(s) {
+ var t = escape(s);
+ t = t.replace(/\+/, '%2b');
+ return t;
+}
+
+function flipCheck(eid){
+ var cb = window.document.getElementById(eid);
+ if(cb) cb.checked = !cb.checked;
+ return false;
+}
diff --git a/web/cgi/pub/tclsh b/web/cgi/pub/tclsh
new file mode 120000
index 00000000..385fc6c6
--- /dev/null
+++ b/web/cgi/pub/tclsh
@@ -0,0 +1 @@
+../tclsh \ No newline at end of file