Post by Sean on Oct 21, 2008 19:51:19 GMT -5
<script type="text/javascript"><!--
/*
Ajax Calendar Entry, by Charles Stover (a.k.a. GAMEchief, SegaDragon)
This notice may not be removed for any reason.
gamingmedley.com
*/
if ((location.href.match("action=calendar")) && (!location.href.match("action=calendarpost")))
{
if (!window.quickCreateElement)
{
function quickCreateElement(name, attr)
{
var temp = document.createElement(name);
if (attr != "")
{
attr = attr.split(", ");
for (var qce = 0; qce < attr.length; qce++)
{
attr[qce] = attr[qce].split("=");
if (attr[qce][0] == "innerHTML")
temp.innerHTML = attr[qce][1];
else
{
temp.setAttribute(attr[qce][0], attr[qce][1]);
if (attr[qce][0] == "class")
temp.setAttribute("className", attr[qce][1]);
}
}
}
return temp;
}
}
var tables = document.getElementsByTagName("table"),
temp = new Array(), nextAction = "post",
entryDay = 1, entryMonth = 1, entryYear = 2000, x;
temp[0] = quickCreateElement("form", "action=/index.cgi, enctype=multipart/form-data, method=post, name=postForm");
temp[0].style.margin = "0";
temp[0].onsubmit = function()
{
disable(this);
http = null;
/*@cc_on
@if (@_jscript_version >= 5)
try {
http = new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e) {
try {
http = new ActiveXObject("Microsoft.XMLHTTP");
}
catch (E) {
http = false;
}
}
@else
xmlhttp = http;
@end @*/
if (!http && typeof XMLHttpRequest != "undefined") {
try {
http = new XMLHttpRequest();
}
catch (e) {
http = false;
}
}
http.open("POST", "/index.cgi", true);
http.onreadystatechange = function()
{
if (http.readyState == 1)
{
temp = document.getElementById("addEntry");
while (temp.getElementsByTagName("tr")[2])
temp.removeChild(temp.getElementsByTagName("tr")[1]);
temp.getElementsByTagName("td")[1].innerHTML = "<font size=\"2\">Posting...<\/font><br /><br /><br />";
}
if (http.readyState == 4)
temp.getElementsByTagName("td")[1].innerHTML = "<font size=\"2\"><b>Posted!</b><\/font><br /><br /><a href=\"index.cgi?action=calendar&month=" + entryMonth + "&year=" + entryYear + "\">Click here to go back to the Calendar.<\/a>";
}
var params = "action=calendarpost2&subject=" + encodeURIComponent(this.subject.value) + "&month=" + entryMonth + "&;day=" + entryDay + "&year=" + entryYear + "&message=" + encodeURIComponent(this.message.value) + "&nextaction=" + nextAction;
http.setRequestHeader("Connection", "close");
http.setRequestHeader("Content-Length", params.length);
http.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
http.send(params);
return false;
}
temp[1] = quickCreateElement("table", "border=0, cellPadding=4, cellSpacing=1, id=addEntry, width=100%");
temp[1].style.display = "none";
temp[2] = document.createElement("tr");
temp[3] = quickCreateElement("td", "align=center, bgColor=4080b0, class=titlebg, colSpan=7");
temp[4] = quickCreateElement("font", "class=titletext, color=f1f1f1, innerHTML=Add Calendar Entry, size=-1");
temp[3].appendChild(temp[4]); temp[2].appendChild(temp[3]); temp[1].appendChild(temp[2]);
temp[5] = document.createElement("tr");
temp[6] = quickCreateElement("td", "bgColor=efefef, class=windowbg, width=30%");
temp[7] = quickCreateElement("font", "innerHTML=Subject:, size=2");
temp[6].appendChild(temp[7]); temp[5].appendChild(temp[6]); temp[1].appendChild(temp[5]);
temp[8] = quickCreateElement("td", "bgColor=efefef, class=windowbg, width=70%");
temp[9] = quickCreateElement("input", "maxlength=50, name=subject, size=40, tabindex=1, type=text");
temp[8].appendChild(temp[9]); temp[5].appendChild(temp[8]); temp[1].appendChild(temp[5]);
temp[10] = document.createElement("tr");
temp[11] = quickCreateElement("td", "bgColor=f6f6f6, class=windowbg2, vAlign=top, width=30%");
temp[12] = quickCreateElement("font", "innerHTML=Message:, size=2");
temp[11].appendChild(temp[12]); temp[10].appendChild(temp[11]);
temp[13] = quickCreateElement("td", "bgColor=f6f6f6, class=windowbg2, width=70%");
temp[14] = quickCreateElement("textarea", "cols=70, name=message, wrap=soft, rows=18, tabindex=2");
temp[13].appendChild(temp[14]); temp[10].appendChild(temp[13]); temp[1].appendChild(temp[10]);
temp[15] = document.createElement("tr");
temp[16] = quickCreateElement("td", "bgColor=efefef, class=windowbg, width=30%");
temp[17] = quickCreateElement("font", "innerHTML=Disable Smilies:, size=2");
temp[16].appendChild(temp[17]); temp[15].appendChild(temp[16]);
temp[18] = quickCreateElement("td", "bgColor=efefef, class=windowbg, width=70%");
temp[18].innerHTML = "<input name=\"nosmiles\" type=\"checkbox\" value=\"1\" /> <font size=\"1\">If this box is checked, smiley emoticons will be disabled in your message.<\/font>";
temp[15].appendChild(temp[18]);
temp[1].appendChild(temp[15]);
temp[19] = document.createElement("tr");
temp[20] = quickCreateElement("td", "align=center, bgColor=f6f6f6, class=windowbg2, colSpan=2, width=100%");
temp[20].innerHTML = "<font size=\"1\">shortcuts: hit alt+s to send, alt+p to preview, or alt+r to reset<\/font><br /><input accesskey=\"s\" tabindex=\"3\" type=\"submit\" value=\"Add Calendar Entry\" /> <input accesskey=\"p\" onclick=\"nextAction = 'preview';\" tabindex=\"4\" type=\"submit\" value=\"Preview\" /> <input accesskey=\"r\" type=\"reset\" value=\"Reset\" />";
temp[19].appendChild(temp[20]);
temp[1].appendChild(temp[19]);
temp[0].appendChild(temp[1]);
for (x = 0; x < tables.length; x++)
{
if ((tables[x].align == "center") && (tables[x].width == "92%") && (tables[x].innerHTML.match(" :: Calendar")))
{
tables[x].getElementsByTagName("td")[1].appendChild(temp[0]);
var anchs = tables[x].getElementsByTagName("a"), an;
for (an = 0; an < anchs.length; an++)
{
if (anchs[an].getAttribute("href").match("action=calendarpost"))
{
anchs[an].onclick = function()
{
entryMonth = this.href.split("month=")[1].split("&")[0];
entryDay = this.href.split("day=")[1].split("&")[0];
entryYear = this.href.split("year=")[1];
for (x = 0; x < tables.length; x++)
{
if ((tables[x].align == "center") && (tables[x].width == "92%") && (tables[x].innerHTML.match(" :: Calendar")))
{
tables[x].getElementsByTagName("table")[1].style.display = "none";
document.getElementById("addEntry").style.display = "";
}
}
return false;
}
}
}
}
}
}
//--></script>
/*
Ajax Calendar Entry, by Charles Stover (a.k.a. GAMEchief, SegaDragon)
This notice may not be removed for any reason.
gamingmedley.com
*/
if ((location.href.match("action=calendar")) && (!location.href.match("action=calendarpost")))
{
if (!window.quickCreateElement)
{
function quickCreateElement(name, attr)
{
var temp = document.createElement(name);
if (attr != "")
{
attr = attr.split(", ");
for (var qce = 0; qce < attr.length; qce++)
{
attr[qce] = attr[qce].split("=");
if (attr[qce][0] == "innerHTML")
temp.innerHTML = attr[qce][1];
else
{
temp.setAttribute(attr[qce][0], attr[qce][1]);
if (attr[qce][0] == "class")
temp.setAttribute("className", attr[qce][1]);
}
}
}
return temp;
}
}
var tables = document.getElementsByTagName("table"),
temp = new Array(), nextAction = "post",
entryDay = 1, entryMonth = 1, entryYear = 2000, x;
temp[0] = quickCreateElement("form", "action=/index.cgi, enctype=multipart/form-data, method=post, name=postForm");
temp[0].style.margin = "0";
temp[0].onsubmit = function()
{
disable(this);
http = null;
/*@cc_on
@if (@_jscript_version >= 5)
try {
http = new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e) {
try {
http = new ActiveXObject("Microsoft.XMLHTTP");
}
catch (E) {
http = false;
}
}
@else
xmlhttp = http;
@end @*/
if (!http && typeof XMLHttpRequest != "undefined") {
try {
http = new XMLHttpRequest();
}
catch (e) {
http = false;
}
}
http.open("POST", "/index.cgi", true);
http.onreadystatechange = function()
{
if (http.readyState == 1)
{
temp = document.getElementById("addEntry");
while (temp.getElementsByTagName("tr")[2])
temp.removeChild(temp.getElementsByTagName("tr")[1]);
temp.getElementsByTagName("td")[1].innerHTML = "<font size=\"2\">Posting...<\/font><br /><br /><br />";
}
if (http.readyState == 4)
temp.getElementsByTagName("td")[1].innerHTML = "<font size=\"2\"><b>Posted!</b><\/font><br /><br /><a href=\"index.cgi?action=calendar&month=" + entryMonth + "&year=" + entryYear + "\">Click here to go back to the Calendar.<\/a>";
}
var params = "action=calendarpost2&subject=" + encodeURIComponent(this.subject.value) + "&month=" + entryMonth + "&;day=" + entryDay + "&year=" + entryYear + "&message=" + encodeURIComponent(this.message.value) + "&nextaction=" + nextAction;
http.setRequestHeader("Connection", "close");
http.setRequestHeader("Content-Length", params.length);
http.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
http.send(params);
return false;
}
temp[1] = quickCreateElement("table", "border=0, cellPadding=4, cellSpacing=1, id=addEntry, width=100%");
temp[1].style.display = "none";
temp[2] = document.createElement("tr");
temp[3] = quickCreateElement("td", "align=center, bgColor=4080b0, class=titlebg, colSpan=7");
temp[4] = quickCreateElement("font", "class=titletext, color=f1f1f1, innerHTML=Add Calendar Entry, size=-1");
temp[3].appendChild(temp[4]); temp[2].appendChild(temp[3]); temp[1].appendChild(temp[2]);
temp[5] = document.createElement("tr");
temp[6] = quickCreateElement("td", "bgColor=efefef, class=windowbg, width=30%");
temp[7] = quickCreateElement("font", "innerHTML=Subject:, size=2");
temp[6].appendChild(temp[7]); temp[5].appendChild(temp[6]); temp[1].appendChild(temp[5]);
temp[8] = quickCreateElement("td", "bgColor=efefef, class=windowbg, width=70%");
temp[9] = quickCreateElement("input", "maxlength=50, name=subject, size=40, tabindex=1, type=text");
temp[8].appendChild(temp[9]); temp[5].appendChild(temp[8]); temp[1].appendChild(temp[5]);
temp[10] = document.createElement("tr");
temp[11] = quickCreateElement("td", "bgColor=f6f6f6, class=windowbg2, vAlign=top, width=30%");
temp[12] = quickCreateElement("font", "innerHTML=Message:, size=2");
temp[11].appendChild(temp[12]); temp[10].appendChild(temp[11]);
temp[13] = quickCreateElement("td", "bgColor=f6f6f6, class=windowbg2, width=70%");
temp[14] = quickCreateElement("textarea", "cols=70, name=message, wrap=soft, rows=18, tabindex=2");
temp[13].appendChild(temp[14]); temp[10].appendChild(temp[13]); temp[1].appendChild(temp[10]);
temp[15] = document.createElement("tr");
temp[16] = quickCreateElement("td", "bgColor=efefef, class=windowbg, width=30%");
temp[17] = quickCreateElement("font", "innerHTML=Disable Smilies:, size=2");
temp[16].appendChild(temp[17]); temp[15].appendChild(temp[16]);
temp[18] = quickCreateElement("td", "bgColor=efefef, class=windowbg, width=70%");
temp[18].innerHTML = "<input name=\"nosmiles\" type=\"checkbox\" value=\"1\" /> <font size=\"1\">If this box is checked, smiley emoticons will be disabled in your message.<\/font>";
temp[15].appendChild(temp[18]);
temp[1].appendChild(temp[15]);
temp[19] = document.createElement("tr");
temp[20] = quickCreateElement("td", "align=center, bgColor=f6f6f6, class=windowbg2, colSpan=2, width=100%");
temp[20].innerHTML = "<font size=\"1\">shortcuts: hit alt+s to send, alt+p to preview, or alt+r to reset<\/font><br /><input accesskey=\"s\" tabindex=\"3\" type=\"submit\" value=\"Add Calendar Entry\" /> <input accesskey=\"p\" onclick=\"nextAction = 'preview';\" tabindex=\"4\" type=\"submit\" value=\"Preview\" /> <input accesskey=\"r\" type=\"reset\" value=\"Reset\" />";
temp[19].appendChild(temp[20]);
temp[1].appendChild(temp[19]);
temp[0].appendChild(temp[1]);
for (x = 0; x < tables.length; x++)
{
if ((tables[x].align == "center") && (tables[x].width == "92%") && (tables[x].innerHTML.match(" :: Calendar")))
{
tables[x].getElementsByTagName("td")[1].appendChild(temp[0]);
var anchs = tables[x].getElementsByTagName("a"), an;
for (an = 0; an < anchs.length; an++)
{
if (anchs[an].getAttribute("href").match("action=calendarpost"))
{
anchs[an].onclick = function()
{
entryMonth = this.href.split("month=")[1].split("&")[0];
entryDay = this.href.split("day=")[1].split("&")[0];
entryYear = this.href.split("year=")[1];
for (x = 0; x < tables.length; x++)
{
if ((tables[x].align == "center") && (tables[x].width == "92%") && (tables[x].innerHTML.match(" :: Calendar")))
{
tables[x].getElementsByTagName("table")[1].style.display = "none";
document.getElementById("addEntry").style.display = "";
}
}
return false;
}
}
}
}
}
}
//--></script>