refactor: drop IE support

This commit is contained in:
d0p1 🏳️‍⚧️ 2025-10-07 13:15:16 +02:00
parent 3b59d1e722
commit e2f2fc3ed0
5 changed files with 18 additions and 122 deletions

View file

@ -1,4 +1,4 @@
// This file is part of Natural Docs, which is Copyright <EFBFBD> 2003-2010 Greg Valure
// This file is part of Natural Docs, which is Copyright © 2003-2010 Greg Valure
// Natural Docs is licensed under version 3 of the GNU Affero General Public License (AGPL)
// Refer to License.txt for the complete details
@ -42,16 +42,6 @@ else if (agt.indexOf("khtml") != -1)
browserType = "Konqueror";
}
else if (agt.indexOf("msie") != -1)
{
browserType = "IE";
if (agt.indexOf("msie 6") != -1)
{ browserVer = "IE6"; }
else if (agt.indexOf("msie 7") != -1)
{ browserVer = "IE7"; }
}
else if (agt.indexOf("gecko") != -1)
{
browserType = "Firefox";
@ -261,65 +251,10 @@ function HideTip(tooltipID)
{ tooltip.style.visibility = "hidden"; }
}
//
// Blockquote fix for IE
// ____________________________________________________________________________
function NDOnLoad()
{
if (browserVer == "IE6")
{
var scrollboxes = document.getElementsByTagName('blockquote');
if (scrollboxes.item(0))
{
NDDoResize();
window.onresize=NDOnResize;
};
};
};
var resizeTimer = 0;
function NDOnResize()
{
if (resizeTimer != 0)
{ clearTimeout(resizeTimer); };
resizeTimer = setTimeout(NDDoResize, 250);
};
function NDDoResize()
{
var scrollboxes = document.getElementsByTagName('blockquote');
var i;
var item;
i = 0;
while (item = scrollboxes.item(i))
{
item.style.width = 100;
i++;
};
i = 0;
while (item = scrollboxes.item(i))
{
item.style.width = item.parentNode.offsetWidth;
i++;
};
clearTimeout(resizeTimer);
resizeTimer = 0;
}
/* ________________________________________________________________________________________________________
Class: SearchPanel
@ -561,20 +496,13 @@ function SearchPanel(name, mode, resultsPath)
{ resultsFrame = window.frames.MSearchResults; }
if (resultsPage != this.lastResultsPage ||
// Bug in IE. If everything becomes hidden in a run, none of them will be able to be reshown in the next for some
// reason. It counts the right number of results, and you can even read the display as "block" after setting it, but it
// just doesn't work in IE 6 or IE 7. So if we're on the right page but the previous search had no results, reload the
// page anyway to get around the bug.
(browserType == "IE" && hasResultsPage &&
(!resultsFrame.searchResults || resultsFrame.searchResults.lastMatchCount == 0)) )
if (resultsPage != this.lastResultsPage)
{
resultsFrame.location.href = resultsPageWithSearch;
}
// So if the results page is right and there's no IE bug, reperform the search on the existing page. We have to check if there
// So if the results page is right, reperform the search on the existing page. We have to check if there
// are results because NoResults.html doesn't have any JavaScript, and it would be useless to do anything on that page even
// if it did.
else if (hasResultsPage)

View file

@ -18,7 +18,7 @@
#
###############################################################################
# This file is part of Natural Docs, which is Copyright <EFBFBD> 2003-2010 Greg Valure
# This file is part of Natural Docs, which is Copyright © 2003-2010 Greg Valure
# Natural Docs is licensed under version 3 of the GNU Affero General Public License (AGPL)
# Refer to License.txt for the complete details

View file

@ -8,7 +8,7 @@
#
###############################################################################
# This file is part of Natural Docs, which is Copyright <EFBFBD> 2003-2010 Greg Valure
# This file is part of Natural Docs, which is Copyright © 2003-2010 Greg Valure
# Natural Docs is licensed under version 3 of the GNU Affero General Public License (AGPL)
# Refer to License.txt for the complete details

View file

@ -10,7 +10,7 @@
#
###############################################################################
# This file is part of Natural Docs, which is Copyright © 2003-2010 Greg Valure
# This file is part of Natural Docs, which is Copyright © 2003-2010 Greg Valure
# Natural Docs is licensed under version 3 of the GNU Affero General Public License (AGPL)
# Refer to License.txt for the complete details
@ -82,12 +82,10 @@ sub BuildFile #(sourceFile, parsedFile)
print OUTPUTFILEHANDLE
'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" '
. '"http://www.w3.org/TR/REC-html40/strict.dtd">' . "\n\n"
'<!DOCTYPE html>' . "\n"
. '<html lang="en">' . "\n" . '<head>'
. '<html><head>'
. '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">'
. '<meta charset="utf-8">'
. '<title>'
. $self->BuildTitle($sourceFile)
@ -153,13 +151,10 @@ sub BuildIndex #(type)
my $indexTitle = $self->IndexTitleOf($type);
my $startIndexPage =
'<!DOCTYPE html>' . "\n"
. '<html lang="en">' . "\n" . '<head>'
'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" '
. '"http://www.w3.org/TR/REC-html40/strict.dtd">' . "\n\n"
. '<html><head>'
. '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">'
. '<meta charset="utf-8">'
. '<title>'
. $indexTitle;
@ -211,12 +206,10 @@ sub BuildIndex #(type)
my $startSearchResultsPage =
'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" '
. '"http://www.w3.org/TR/REC-html40/strict.dtd">' . "\n\n"
'<!DOCTYPE html>' . "\n"
. '<html lang="en">' . "\n" . '<head>'
. '<html><head>'
. '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">'
. '<meta charset="utf-8">'
. '<link rel="stylesheet" type="text/css" href="' . $self->MakeRelativeURL($self->SearchResultsDirectory(),
$self->MainCSSFile()) . '">'

View file

@ -8,7 +8,7 @@
#
###############################################################################
# This file is part of Natural Docs, which is Copyright <EFBFBD> 2003-2010 Greg Valure
# This file is part of Natural Docs, which is Copyright © 2003-2010 Greg Valure
# Natural Docs is licensed under version 3 of the GNU Affero General Public License (AGPL)
# Refer to License.txt for the complete details
@ -1794,8 +1794,7 @@ sub ClosingBrowserStyles
#
# Function: StandardComments
#
# Returns the standard HTML comments that should be included in every generated file. This includes <IEWebMark()>, so this
# really is required for proper functionality.
# Returns the standard HTML comments that should be included in every generated file.
#
sub StandardComments
{
@ -1803,34 +1802,10 @@ sub StandardComments
return "\n\n"
. '<!-- Generated by Natural Docs, version ' . NaturalDocs::Settings->TextAppVersion() . ' -->' . "\n"
. '<!-- Generated by Synthetic Docs, version ' . NaturalDocs::Settings->TextAppVersion() . ' -->' . "\n"
. '<!-- ' . NaturalDocs::Settings->AppURL() . ' -->' . "\n\n"
. $self->IEWebMark() . "\n\n";
};
#
# Function: IEWebMark
#
# Returns the HTML comment necessary to get around the security warnings in IE starting with Windows XP Service Pack 2.
#
# With this mark, the HTML page is treated as if it were in the Internet security zone instead of the Local Machine zone. This
# prevents the lockdown on scripting that causes an error message to appear with each page.
#
# More Information:
#
# - http://www.microsoft.com/technet/prodtechnol/winxppro/maintain/sp2brows.mspx#EHAA
# - http://www.phdcc.com/xpsp2.htm#markoftheweb
#
sub IEWebMark
{
my $self = shift;
return '<!-- saved from url=(0026)http://www.naturaldocs.org -->';
};
###############################################################################
# Group: Index Functions