|
@@ -6,16 +6,6 @@ var smf_editorArray = new Array();
|
|
|
var ua = navigator.userAgent.toLowerCase();
|
|
|
|
|
|
var is_opera = ua.indexOf('opera') != -1;
|
|
|
-var is_opera5 = ua.indexOf('opera/5') != -1 || ua.indexOf('opera 5') != -1;
|
|
|
-var is_opera6 = ua.indexOf('opera/6') != -1 || ua.indexOf('opera 6') != -1;
|
|
|
-var is_opera7 = ua.indexOf('opera/7') != -1 || ua.indexOf('opera 7') != -1;
|
|
|
-var is_opera8 = ua.indexOf('opera/8') != -1 || ua.indexOf('opera 8') != -1;
|
|
|
-var is_opera9 = ua.indexOf('opera/9') != -1 || ua.indexOf('opera 9') != -1;
|
|
|
-var is_opera95 = ua.indexOf('opera/9.5') != -1 || ua.indexOf('opera 9.5') != -1;
|
|
|
-var is_opera96 = ua.indexOf('opera/9.6') != -1 || ua.indexOf('opera 9.6') != -1;
|
|
|
-var is_opera10 = (ua.indexOf('opera/9.8') != -1 || ua.indexOf('opera 9.8') != -1 || ua.indexOf('opera/10.') != -1 || ua.indexOf('opera 10.') != -1) || ua.indexOf('version/10.') != -1;
|
|
|
-var is_opera95up = is_opera95 || is_opera96 || is_opera10;
|
|
|
-
|
|
|
var is_ff = (ua.indexOf('firefox') != -1 || ua.indexOf('iceweasel') != -1 || ua.indexOf('icecat') != -1 || ua.indexOf('shiretoko') != -1 || ua.indexOf('minefield') != -1) && !is_opera;
|
|
|
var is_gecko = ua.indexOf('gecko') != -1 && !is_opera;
|
|
|
|
|
@@ -24,44 +14,17 @@ var is_safari = ua.indexOf('applewebkit') != -1 && !is_chrome;
|
|
|
var is_webkit = ua.indexOf('applewebkit') != -1;
|
|
|
|
|
|
var is_ie = ua.indexOf('msie') != -1 && !is_opera;
|
|
|
-var is_ie4 = is_ie && ua.indexOf('msie 4') != -1;
|
|
|
-var is_ie5 = is_ie && ua.indexOf('msie 5') != -1;
|
|
|
-var is_ie50 = is_ie && ua.indexOf('msie 5.0') != -1;
|
|
|
-var is_ie55 = is_ie && ua.indexOf('msie 5.5') != -1;
|
|
|
-var is_ie5up = is_ie && !is_ie4;
|
|
|
-var is_ie6 = is_ie && ua.indexOf('msie 6') != -1;
|
|
|
-var is_ie6up = is_ie5up && !is_ie55 && !is_ie5;
|
|
|
-var is_ie6down = is_ie6 || is_ie5 || is_ie4;
|
|
|
-var is_ie7 = is_ie && ua.indexOf('msie 7') != -1;
|
|
|
-var is_ie7up = is_ie6up && !is_ie6;
|
|
|
-var is_ie7down = is_ie7 || is_ie6 || is_ie5 || is_ie4;
|
|
|
-
|
|
|
-var is_ie8 = is_ie && ua.indexOf('msie 8') != -1;
|
|
|
-var is_ie8up = is_ie8 && !is_ie7down;
|
|
|
-
|
|
|
var is_iphone = ua.indexOf('iphone') != -1 || ua.indexOf('ipod') != -1;
|
|
|
var is_android = ua.indexOf('android') != -1;
|
|
|
|
|
|
var ajax_indicator_ele = null;
|
|
|
|
|
|
-// Define document.getElementById for Internet Explorer 4.
|
|
|
-if (!('getElementById' in document) && 'all' in document)
|
|
|
- document.getElementById = function (sId) {
|
|
|
- return document.all[sId];
|
|
|
- }
|
|
|
-
|
|
|
-// Define XMLHttpRequest for IE 5 and above. (don't bother for IE 4 :/.... works in Opera 7.6 and Safari 1.2!)
|
|
|
-else if (!('XMLHttpRequest' in window) && 'ActiveXObject' in window)
|
|
|
+// Define XMLHttpRequest for IE
|
|
|
+if (!('XMLHttpRequest' in window) && 'ActiveXObject' in window)
|
|
|
window.XMLHttpRequest = function () {
|
|
|
- return new ActiveXObject(is_ie5 ? 'Microsoft.XMLHTTP' : 'MSXML2.XMLHTTP');
|
|
|
+ return new ActiveXObject('MSXML2.XMLHTTP');
|
|
|
};
|
|
|
|
|
|
-// Ensure the getElementsByTagName exists.
|
|
|
-if (!'getElementsByTagName' in document && 'all' in document)
|
|
|
- document.getElementsByTagName = function (sName) {
|
|
|
- return document.all.tags[sName];
|
|
|
- }
|
|
|
-
|
|
|
// Some older versions of Mozilla don't have this, for some reason.
|
|
|
if (!('forms' in document))
|
|
|
document.forms = document.getElementsByTagName('form');
|
|
@@ -529,10 +492,6 @@ function submitonce(theform)
|
|
|
}
|
|
|
function submitThisOnce(oControl)
|
|
|
{
|
|
|
- // Hateful, hateful fix for Safari 1.3 beta.
|
|
|
- if (is_safari)
|
|
|
- return !smf_formSubmitted;
|
|
|
-
|
|
|
// oControl might also be a form.
|
|
|
var oForm = 'form' in oControl ? oControl.form : oControl;
|
|
|
|
|
@@ -764,7 +723,7 @@ function expandPages(spanNode, baseURL, firstPage, lastPage, perPage)
|
|
|
replacement += '<a class="navPages" href="' + baseURL.replace(/%1\$d/, i).replace(/%%/g, '%') + '">' + (1 + i / perPage) + '</a> ';
|
|
|
|
|
|
if (oldLastPage > 0)
|
|
|
- replacement += '<span style="font-weight: bold; cursor: ' + (is_ie && !is_ie6up ? 'hand' : 'pointer') + ';" onclick="expandPages(this, \'' + baseURL + '\', ' + lastPage + ', ' + oldLastPage + ', ' + perPage + ');"> ... </span> ';
|
|
|
+ replacement += '<span style="font-weight: bold; cursor: pointer" onclick="expandPages(this, \'' + baseURL + '\', ' + lastPage + ', ' + oldLastPage + ', ' + perPage + ');"> ... </span> ';
|
|
|
|
|
|
// Replace the dots by the new page links.
|
|
|
setInnerHTML(spanNode, replacement);
|
|
@@ -993,12 +952,6 @@ function ajax_indicator(turn_on)
|
|
|
|
|
|
if (ajax_indicator_ele != null)
|
|
|
{
|
|
|
- if (navigator.appName == 'Microsoft Internet Explorer' && !is_ie7up)
|
|
|
- {
|
|
|
- ajax_indicator_ele.style.position = 'absolute';
|
|
|
- ajax_indicator_ele.style.top = document.documentElement.scrollTop;
|
|
|
- }
|
|
|
-
|
|
|
ajax_indicator_ele.style.display = turn_on ? 'block' : 'none';
|
|
|
}
|
|
|
}
|
|
@@ -1112,7 +1065,6 @@ JumpTo.prototype.showSelect = function ()
|
|
|
// Fill the jump to box with entries. Method of the JumpTo class.
|
|
|
JumpTo.prototype.fillSelect = function (aBoardsAndCategories)
|
|
|
{
|
|
|
- var bIE5x = !('implementation' in document);
|
|
|
var iIndexPointer = 0;
|
|
|
|
|
|
// Create an option that'll be above and below the category.
|
|
@@ -1121,19 +1073,13 @@ JumpTo.prototype.fillSelect = function (aBoardsAndCategories)
|
|
|
oDashOption.disabled = 'disabled';
|
|
|
oDashOption.value = '';
|
|
|
|
|
|
- // Reset the events and clear the list (IE5.x only).
|
|
|
- if (bIE5x)
|
|
|
- {
|
|
|
- this.dropdownList.onmouseover = null;
|
|
|
- this.dropdownList.remove(0);
|
|
|
- }
|
|
|
if ('onbeforeactivate' in document)
|
|
|
this.dropdownList.onbeforeactivate = null;
|
|
|
else
|
|
|
this.dropdownList.onfocus = null;
|
|
|
|
|
|
// Create a document fragment that'll allowing inserting big parts at once.
|
|
|
- var oListFragment = bIE5x ? this.dropdownList : document.createDocumentFragment();
|
|
|
+ var oListFragment = document.createDocumentFragment();
|
|
|
|
|
|
// Loop through all items to be added.
|
|
|
for (var i = 0, n = aBoardsAndCategories.length; i < n; i++)
|
|
@@ -1143,14 +1089,9 @@ JumpTo.prototype.fillSelect = function (aBoardsAndCategories)
|
|
|
// If we've reached the currently selected board add all items so far.
|
|
|
if (!aBoardsAndCategories[i].isCategory && aBoardsAndCategories[i].id == this.opt.iCurBoardId)
|
|
|
{
|
|
|
- if (bIE5x)
|
|
|
- iIndexPointer = this.dropdownList.options.length;
|
|
|
- else
|
|
|
- {
|
|
|
this.dropdownList.insertBefore(oListFragment, this.dropdownList.options[0]);
|
|
|
oListFragment = document.createDocumentFragment();
|
|
|
continue;
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
if (aBoardsAndCategories[i].isCategory)
|
|
@@ -1171,9 +1112,6 @@ JumpTo.prototype.fillSelect = function (aBoardsAndCategories)
|
|
|
// Add the remaining items after the currently selected item.
|
|
|
this.dropdownList.appendChild(oListFragment);
|
|
|
|
|
|
- if (bIE5x)
|
|
|
- this.dropdownList.options[iIndexPointer].selected = true;
|
|
|
-
|
|
|
// Internet Explorer needs this to keep the box dropped down.
|
|
|
this.dropdownList.style.width = 'auto';
|
|
|
this.dropdownList.focus();
|
|
@@ -1214,7 +1152,7 @@ IconList.prototype.initIcons = function ()
|
|
|
{
|
|
|
for (var i = document.images.length - 1, iPrefixLength = this.opt.sIconIdPrefix.length; i >= 0; i--)
|
|
|
if (document.images[i].id.substr(0, iPrefixLength) == this.opt.sIconIdPrefix)
|
|
|
- setOuterHTML(document.images[i], '<div title="' + this.opt.sLabelIconList + '" onclick="' + this.opt.sBackReference + '.openPopup(this, ' + document.images[i].id.substr(iPrefixLength) + ')" onmouseover="' + this.opt.sBackReference + '.onBoxHover(this, true)" onmouseout="' + this.opt.sBackReference + '.onBoxHover(this, false)" style="background: ' + this.opt.sBoxBackground + '; cursor: ' + (is_ie && !is_ie6up ? 'hand' : 'pointer') + '; padding: 3px; text-align: center;"><img src="' + document.images[i].src + '" alt="' + document.images[i].alt + '" id="' + document.images[i].id + '" style="margin: 0px; padding: ' + (is_ie ? '3px' : '3px 0px 3px 0px') + ';" /></div>');
|
|
|
+ setOuterHTML(document.images[i], '<div title="' + this.opt.sLabelIconList + '" onclick="' + this.opt.sBackReference + '.openPopup(this, ' + document.images[i].id.substr(iPrefixLength) + ')" onmouseover="' + this.opt.sBackReference + '.onBoxHover(this, true)" onmouseout="' + this.opt.sBackReference + '.onBoxHover(this, false)" style="background: ' + this.opt.sBoxBackground + '; cursor: pointer; padding: 3px; text-align: center;"><img src="' + document.images[i].src + '" alt="' + document.images[i].alt + '" id="' + document.images[i].id + '" style="margin: 0px; padding: ' + (is_ie ? '3px' : '3px 0px 3px 0px') + ';" /></div>');
|
|
|
}
|
|
|
|
|
|
// Event for the mouse hovering over the original icon.
|
|
@@ -1236,7 +1174,7 @@ IconList.prototype.openPopup = function (oDiv, iMessageId)
|
|
|
this.oContainerDiv = document.createElement('div');
|
|
|
this.oContainerDiv.id = 'iconList';
|
|
|
this.oContainerDiv.style.display = 'none';
|
|
|
- this.oContainerDiv.style.cursor = is_ie && !is_ie6up ? 'hand' : 'pointer';
|
|
|
+ this.oContainerDiv.style.cursor = 'pointer';
|
|
|
this.oContainerDiv.style.position = 'absolute';
|
|
|
this.oContainerDiv.style.width = oDiv.offsetWidth + 'px';
|
|
|
this.oContainerDiv.style.background = this.opt.sContainerBackground;
|
|
@@ -1256,8 +1194,6 @@ IconList.prototype.openPopup = function (oDiv, iMessageId)
|
|
|
|
|
|
// Set the position of the container.
|
|
|
var aPos = smf_itemPos(oDiv);
|
|
|
- if (is_ie50)
|
|
|
- aPos[1] += 4;
|
|
|
|
|
|
this.oContainerDiv.style.top = (aPos[1] + oDiv.offsetHeight) + 'px';
|
|
|
this.oContainerDiv.style.left = (aPos[0] - 1) + 'px';
|