From e2f2fc3ed07fe99536fceb6d7bedb3be667051e8 Mon Sep 17 00:00:00 2001 From: d0p1 Date: Tue, 7 Oct 2025 13:15:16 +0200 Subject: [PATCH] refactor: drop IE support --- JavaScript/NaturalDocs.js | 78 +------------------------ Modules/NaturalDocs/Builder.pm | 2 +- Modules/NaturalDocs/Builder/Base.pm | 2 +- Modules/NaturalDocs/Builder/HTML.pm | 27 ++++----- Modules/NaturalDocs/Builder/HTMLBase.pm | 31 +--------- 5 files changed, 18 insertions(+), 122 deletions(-) diff --git a/JavaScript/NaturalDocs.js b/JavaScript/NaturalDocs.js index fd280eb..c9dea15 100644 --- a/JavaScript/NaturalDocs.js +++ b/JavaScript/NaturalDocs.js @@ -1,4 +1,4 @@ -// 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 @@ -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) diff --git a/Modules/NaturalDocs/Builder.pm b/Modules/NaturalDocs/Builder.pm index fc3f89e..eb39ae9 100644 --- a/Modules/NaturalDocs/Builder.pm +++ b/Modules/NaturalDocs/Builder.pm @@ -18,7 +18,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 diff --git a/Modules/NaturalDocs/Builder/Base.pm b/Modules/NaturalDocs/Builder/Base.pm index d4d7be7..81c8747 100644 --- a/Modules/NaturalDocs/Builder/Base.pm +++ b/Modules/NaturalDocs/Builder/Base.pm @@ -8,7 +8,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 diff --git a/Modules/NaturalDocs/Builder/HTML.pm b/Modules/NaturalDocs/Builder/HTML.pm index 86bd8bf..2e08d89 100644 --- a/Modules/NaturalDocs/Builder/HTML.pm +++ b/Modules/NaturalDocs/Builder/HTML.pm @@ -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 - '' . "\n\n" + '' . "\n" + . '' . "\n" . '' - . '' - - . '' + . '' . '' . $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()) . '">' diff --git a/Modules/NaturalDocs/Builder/HTMLBase.pm b/Modules/NaturalDocs/Builder/HTMLBase.pm index 40bf87f..e119fc7 100644 --- a/Modules/NaturalDocs/Builder/HTMLBase.pm +++ b/Modules/NaturalDocs/Builder/HTMLBase.pm @@ -8,7 +8,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 @@ -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