refactor: drop IE support
This commit is contained in:
		
							parent
							
								
									3b59d1e722
								
							
						
					
					
						commit
						e2f2fc3ed0
					
				
					 5 changed files with 18 additions and 122 deletions
				
			
		|  | @ -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)
 | // Natural Docs is licensed under version 3 of the GNU Affero General Public License (AGPL)
 | ||||||
| // Refer to License.txt for the complete details
 | // Refer to License.txt for the complete details
 | ||||||
| 
 | 
 | ||||||
|  | @ -42,16 +42,6 @@ else if (agt.indexOf("khtml") != -1) | ||||||
|     browserType = "Konqueror"; |     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) | else if (agt.indexOf("gecko") != -1) | ||||||
|     { |     { | ||||||
|     browserType = "Firefox"; |     browserType = "Firefox"; | ||||||
|  | @ -261,65 +251,10 @@ function HideTip(tooltipID) | ||||||
|         {  tooltip.style.visibility = "hidden";  } |         {  tooltip.style.visibility = "hidden";  } | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
| 
 |  | ||||||
| //
 |  | ||||||
| //  Blockquote fix for IE
 |  | ||||||
| // ____________________________________________________________________________
 |  | ||||||
| 
 |  | ||||||
| 
 |  | ||||||
| function NDOnLoad() | 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 |     Class: SearchPanel | ||||||
|  | @ -561,20 +496,13 @@ function SearchPanel(name, mode, resultsPath) | ||||||
|             {  resultsFrame = window.frames.MSearchResults;  } |             {  resultsFrame = window.frames.MSearchResults;  } | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|         if (resultsPage != this.lastResultsPage || |         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)) ) |  | ||||||
| 
 | 
 | ||||||
|             { |             { | ||||||
|             resultsFrame.location.href = resultsPageWithSearch; |             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
 |         // 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.
 |         // if it did.
 | ||||||
|         else if (hasResultsPage) |         else if (hasResultsPage) | ||||||
|  |  | ||||||
|  | @ -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) | # Natural Docs is licensed under version 3 of the GNU Affero General Public License (AGPL) | ||||||
| # Refer to License.txt for the complete details | # Refer to License.txt for the complete details | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -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) | # Natural Docs is licensed under version 3 of the GNU Affero General Public License (AGPL) | ||||||
| # Refer to License.txt for the complete details | # Refer to License.txt for the complete details | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -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) | # Natural Docs is licensed under version 3 of the GNU Affero General Public License (AGPL) | ||||||
| # Refer to License.txt for the complete details | # Refer to License.txt for the complete details | ||||||
| 
 | 
 | ||||||
|  | @ -82,12 +82,10 @@ sub BuildFile #(sourceFile, parsedFile) | ||||||
| 
 | 
 | ||||||
|     print OUTPUTFILEHANDLE |     print OUTPUTFILEHANDLE | ||||||
| 
 | 
 | ||||||
|         '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" ' |         '<!DOCTYPE html>' . "\n" | ||||||
|             . '"http://www.w3.org/TR/REC-html40/strict.dtd">' . "\n\n" |         . '<html lang="en">' . "\n" . '<head>' | ||||||
| 
 | 
 | ||||||
|         . '<html><head>' |             . '<meta charset="utf-8">' | ||||||
| 
 |  | ||||||
|             . '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">' |  | ||||||
| 
 | 
 | ||||||
|             . '<title>' |             . '<title>' | ||||||
|                 . $self->BuildTitle($sourceFile) |                 . $self->BuildTitle($sourceFile) | ||||||
|  | @ -153,13 +151,10 @@ sub BuildIndex #(type) | ||||||
|     my $indexTitle = $self->IndexTitleOf($type); |     my $indexTitle = $self->IndexTitleOf($type); | ||||||
| 
 | 
 | ||||||
|     my $startIndexPage = |     my $startIndexPage = | ||||||
|  |         '<!DOCTYPE html>' . "\n" | ||||||
|  |         . '<html lang="en">' . "\n" . '<head>' | ||||||
| 
 | 
 | ||||||
|         '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" ' |             . '<meta charset="utf-8">' | ||||||
|             . '"http://www.w3.org/TR/REC-html40/strict.dtd">' . "\n\n" |  | ||||||
| 
 |  | ||||||
|         . '<html><head>' |  | ||||||
| 
 |  | ||||||
|             . '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">' |  | ||||||
| 
 | 
 | ||||||
|             . '<title>' |             . '<title>' | ||||||
|                 . $indexTitle; |                 . $indexTitle; | ||||||
|  | @ -211,12 +206,10 @@ sub BuildIndex #(type) | ||||||
| 
 | 
 | ||||||
|     my $startSearchResultsPage = |     my $startSearchResultsPage = | ||||||
| 
 | 
 | ||||||
|         '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" ' |         '<!DOCTYPE html>' . "\n" | ||||||
|             . '"http://www.w3.org/TR/REC-html40/strict.dtd">' . "\n\n" |         . '<html lang="en">' . "\n" . '<head>' | ||||||
| 
 | 
 | ||||||
|         . '<html><head>' |             . '<meta charset="utf-8">' | ||||||
| 
 |  | ||||||
|             . '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">' |  | ||||||
| 
 | 
 | ||||||
|             . '<link rel="stylesheet" type="text/css" href="' . $self->MakeRelativeURL($self->SearchResultsDirectory(), |             . '<link rel="stylesheet" type="text/css" href="' . $self->MakeRelativeURL($self->SearchResultsDirectory(), | ||||||
|                                                                                                                        $self->MainCSSFile()) . '">' |                                                                                                                        $self->MainCSSFile()) . '">' | ||||||
|  |  | ||||||
|  | @ -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) | # Natural Docs is licensed under version 3 of the GNU Affero General Public License (AGPL) | ||||||
| # Refer to License.txt for the complete details | # Refer to License.txt for the complete details | ||||||
| 
 | 
 | ||||||
|  | @ -1794,8 +1794,7 @@ sub ClosingBrowserStyles | ||||||
| # | # | ||||||
| #   Function: StandardComments | #   Function: StandardComments | ||||||
| # | # | ||||||
| #   Returns the standard HTML comments that should be included in every generated file.  This includes <IEWebMark()>, so this | #   Returns the standard HTML comments that should be included in every generated file.  | ||||||
| #   really is required for proper functionality. |  | ||||||
| # | # | ||||||
| sub StandardComments | sub StandardComments | ||||||
|     { |     { | ||||||
|  | @ -1803,34 +1802,10 @@ sub StandardComments | ||||||
| 
 | 
 | ||||||
|     return "\n\n" |     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" |         . '<!--  ' . 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 | # Group: Index Functions | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		
		Reference in a new issue