Hi Forum,
aufbauend auf Romans gute Arbeit mit dem SELFBrowser 1.2 kommt hier der Quellcode für Version 1.21. Es sind keine große Veränderungen, aber trotzdem:
- Der Reload timeout wird jetzt gespeichert.
- Tastaturkürzel für sämtliche Buttons, inklusive Autoreload-Checkbox.
- Wenn der Autoreload-checkbox deselektiert wird, ist das Timeout-Feld disabled ("ausgegraut").
- Darstellung des IFRAMEs verbessert.
Was wir noch brauchen, abgesehen von Romans Vorschläge unten, wäre:
- Optimale Anpassung des IFRAMEs an das Browserfenster.
Nochmal, so dass keine Missverständnisse auftauchen: Der SELFBrowser funktioniert derzeit nur unter Internet Explorer 5.
Installationshinweis: Version 1.2 von http://195.202.152.140/selfbrowser12.zip holen, und in separates Verzeichnis entpacken. Die unten aufgeführte Code ersetzt die Datei selfBrowser.hta. Wie immer muss bei Copy&Paste beachtet werden, dass keine Zeilenumbrüche sich im Skriptcode einschleichen. Für bessere Erreichbarkeit kann eine Verknüpfung beispielsweise auf der Taskleiste erstellt werden. Somit ist das Forum immer über ein Mausklick erreichbar =$-).
Bis demnächst,
UlfL
<html>
<title>SELFBrowser</title>
<!-- SelfhtmlBrowser 1.21 281099 12:30 -->
<!-- idea and coding by Ulf Lieden, ulf.lieden@tlc.de -->
<!-- coding by Roman Pfarrhofer, r.pfarrhofer@kabsi.at -->
<!-- inspiration by Stefan Muenz, muenz@csi.com -->
<HTA:APPLICATION
ID="SELFBrowser"
BORDER="normal"
BORDERSTYLE="normal"
CAPTION="yes"
ICON="xweb.ico"
MAXIMIZEBUTTON="yes"
MINIMIZEBUTTON="yes"
SHOWINTASKBAR="yes"
SINGLEINSTANCE="no"
SYSMENU="yes"
WINDOWSTATE="normal"
VERSION="1.21"
<script>
// Global variables
baseURL = "http://www.teamone.de/";
function getReloadTimeOut() {
// get & calc the reloadTimeOut
var ReloadTimeOut = (document.all.autoReloadTimeOut.value * 60000);
// we don't want to kill the xdomain.gif *G* - so the min. timeout is 1 min.
if (ReloadTimeOut < 60000) {
ReloadTimeOut = 60000;
}
return ReloadTimeOut;
}
function reloadForum() {
// if location is at main page,
// and reload checkbox is checked,
// --> reload().
if(selfhtml.location == "http://www.teamone.de/selfaktuell/self_forum.html" && document.all.autoReloadcheck.checked){
selfhtml.location.reload();
}
// Start reload script after x minutes
autoReload = window.setTimeout("reloadForum()",getReloadTimeOut());
}
function resetReloadTimeOut() {
// stop the old timeout und start it again with the new value
window.clearTimeout(autoReload);
autoReload = window.setTimeout("reloadForum()",getReloadTimeOut());
}
function updateInputURL() {
// Write the current URL in the input-field "inputURL"
if (document.all.inputURL.value != selfhtml.document.URL) {
document.all.inputURL.value = selfhtml.document.URL;
}
window.setTimeout("updateInputURL()",100);
}
function openURL(url){
// Open new URL in SELFHTML window
if(!url) url = "";
selfhtml.location = baseURL+url;
}
function Chat(){
// Open chat window
F1 = open(baseURL+"selfaktuell/chat_leahcim.htm","Fenster1","width=600,height=400");
}
function saveReloadTimeOut(){
// This function persists reload timeout
oPersist=document.getElementById("autoReloadTimeOut");
oPersist.setAttribute("sPersist",oPersist.value);
oPersist.save("oXMLBranch");
}
function initSettings(){
// This function sets reload timeout
oPersist=document.getElementById("autoReloadTimeOut");
oPersist.load("oXMLBranch");
if(oPersist.getAttribute("sPersist")){
oPersist.value=oPersist.getAttribute("sPersist");
}
}
function disableTimeOutField(){
// Disabling or enabling the Timeout field
if(document.getElementById("autoReloadcheck").checked){
document.getElementById("autoReloadTimeOut").disabled=false;
} else { document.getElementById("autoReloadTimeOut").disabled=true;
}
}
</script>
<!-- This style is necessary for persisting Reload Timeout -->
<STYLE>
.userData {behavior:url(#default#userdata);}
</STYLE>
<style>
button { width:35; height:35; font-family:Arial; font-size:16pt }
iframe { width:103%; height:95% }
label { font-family:Arial; font-size:8pt }
body { font-family: Arial; font-size: 10pt; color: #000000}
h3 { font-size: 16pt}
</style>
<body scroll="no" bgcolor=#C0C0C0 onLoad="initSettings()">
<!-- Button bar -->
<div id="ButtonLayer" style="position:absolute; left:0px; top:0px; width:100%; height:35px; z-index:5">
<nobr> <button id="buttonBack" accesskey="y" onClick="parent.selfhtml.history.back()" title="Zurück [alt+y]"><b><img src="xgprev.gif" width="10" height="10"></b></button>
<button id="buttonForward" accesskey="x" onClick="parent.selfhtml.history.forward()" title="Vorwärts [alt+x]"><img src="xgnext.gif" width="10" height="10"></button>
<button id="buttonForum" accesskey="f" onClick="openURL('selfaktuell/self_forum.html')" title="SELFHTML Forum [alt+f]"><b>f</b></button>
<button id="buttonNachricht" accesskey="n" onClick="openURL('selfaktuell/self_forum_neu.html')" title="Neue Nachricht verfassen [alt+n]"><b>n</b></button>
<button id="buttonSuche" accesskey="s" onClick="openURL('cgi-local/sfasuch.pl')" title="Forumsarchiv / Suche [alt+s]"><b>s</b></button>
<button id="buttonReload" accesskey="r" onClick="javascript:parent.selfhtml.location.reload()" title="Neu laden [alt+r]"><b>r</b></button>
<button id="buttonChat" accesskey="c" onClick="Chat()" title="Kleiner Chat nebenbei...? [alt+c]"><image src="xsmile.gif" width="15" height="15"></button>
<!-- Reload checkbox -->
<input id="autoReloadcheck" accesskey="a" type="checkbox" title="AutoReload der Forumsseite an-/abstellen [alt+a]" name="AutoReloadcheckbox" value="checkbox" checked onClick="disableTimeOutField()">
<label for="autoReloadcheck"><u>A</u>utoReload</label> <label for="labelReload1">every</label>
<input id="autoReloadTimeOut" class="userData" type="text" style="width:19px; heigth:5px; font-family:Arial; font-size:8pt" title="AutoReloadTimeOut" name="AutoReloadinput" value="10" onKeyPress="resetReloadTimeOut()" onBlur="saveReloadTimeOut()">
<label for="labelReload1">min.</label> </nobr> </div>
<!-- SELFHTML title & logo -->
<div style="position:absolute; right:40px; top:5px; width:30px; height:30px; z-index:1" id="TitleLayer">
<h3>SELFHTML</h3>
</div>
<div id="LogoLayer" style="position:absolute; right:0px; top:0px; width:36px; height:32px; z-index:10; cursor:hand;" onClick="openURL('selfhtml/')"><img src="x4.gif" width="36" height="32"></div>
<!-- Main SELFHTML window -->
<iframe application="no" name="selfhtml" src="http://www.teamone.de/selfaktuell/self_forum.html" style="position:absolute; left:0px; top:63px;">
</iframe>
<div style="position:absolute; left:10px; right:10px; top:37px; width:100%; height:30px; z-index:1" id="divURL">
<input type="text" style="width:100%; background-color:#DDDDDD" id="inputURL" value="http://" readonly>
</div>
<script>
// Start update script for the field "InputURL"
updateInputURL();
// Start reload script after x minutes
autoReload = window.setTimeout("reloadForum()",getReloadTimeOut());
</script>
</body>
</html>