View the DQSD CVS repository here:
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/dqsd/
Update of /cvsroot/dqsd/dqsd
In directory usw-pr-cvs1:/tmp/cvs-serv30090
Modified Files:
preferences.js search.htm tools.js
Log Message:
Refactoring
Index: preferences.js
===================================================================
RCS file: /cvsroot/dqsd/dqsd/preferences.js,v
retrieving revision 1.47
retrieving revision 1.48
diff -C2 -d -r1.47 -r1.48
*** preferences.js 15 Sep 2002 23:11:43 -0000 1.47
--- preferences.js 4 Oct 2002 04:48:29 -0000 1.48
***************
*** 18,22 ****
* localaliases = "localaliases.txt"
* localstylesurl = "localsearch.css"
- * localprefs = "localprefs.js"
*
* NOTE:
--- 18,21 ----
***************
*** 25,29 ****
* localaliases - the format of this file is just like aliases.txt
* localstylesurl - this is a standard cascading stylesheet
- * localprefs - this is a standard javascript source file
*/
localeventsfileurl = "localevents.xml"; // local events to be added to the calendar
--- 24,27 ----
***************
*** 31,35 ****
localaliases = "localaliases.txt"; // local aliases file
localstylesurl = "localsearch.css"; // local stylsheet (to overwrite defaults
in search.css)
- localprefs = "localprefs.js"; // local preferences (to overwrite
defaults in this file)
--- 29,32 ----
Index: search.htm
===================================================================
RCS file: /cvsroot/dqsd/dqsd/search.htm,v
retrieving revision 1.160
retrieving revision 1.161
diff -C2 -d -r1.160 -r1.161
*** search.htm 28 Sep 2002 20:02:28 -0000 1.160
--- search.htm 4 Oct 2002 04:48:29 -0000 1.161
***************
*** 93,148 ****
-->
<head>
- <title>Search</title>
- <meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
- <link rel="stylesheet" type="text/css" href="search.css">
- <script type='text/Jscript'>
- // default language setting
- language=navigator.userLanguage.substr(0,2);
- </script>
- <script type='text/Jscript' src=preferences.js></script>
- <script type='text/Jscript'>
- // include local preferences file
- if (typeof localprefs != "undefined" && localprefs != "")
- document.write("</" + "script" + "><script src=" + localprefs + "></" +
"script" + ">");
! // include the overwriting stylesheet if necessary
! if (typeof localstylesurl != "undefined" && localstylesurl != "")
! document.write("<link rel='stylesheet' type='text/css' href='" +
localstylesurl + "'>");
! </script>
! <!-- <xml id='searchxml' src='search.xml'></xml> -->
! <script type='text/Jscript'>
! // include the localsearch file if necessary
! if (typeof localsearchurl != "undefined" && localsearchurl != "")
! document.write("<xml id='localsearch' src='" + localsearchurl + "'></xml>");
! </script>
! <script type='text/Jscript' src="helpmenu.js"></script>
! <script type='text/Jscript'>
! // catch errors
! function handleerror(msg, url, lineno)
! {
! if (!firsterror)
! {
! firsterror = msg;
! alert("Error (line " + lineno + "):\n" + msg);
! }
! return true;
! }
! firsterror = null;
! // window.onerror=handleerror;
! function qualifiedalert(s)
! {
! alertmode && alert(s);
! }
! </script>
- <script type='text/Jscript'>
<!--
! uaMatch=navigator.userAgent.toLowerCase().match("msie\\s+(\\d+\\.\\d*)");
! ie_version=(uaMatch ? parseFloat(uaMatch[1]) : 0.0);
-->
</script>
--- 93,147 ----
-->
<head>
! <title>Search</title>
! <meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
! <link rel="stylesheet" type="text/css" href="search.css">
! <!-- External Scripts -->
! <!--
! Include default values for all user customizable preferences.
! This file _should not_ be modified by the user because it will be overwritten
! during update installations. Make changes to the default values in localprefs.js.
! -->
! <script type="text/jscript" src="preferences.js"></script>
<!--
! Include overrides for user-customizable preferences. This file will not be
! overwritten when installing updates.
-->
+ <script type="text/jscript" src="localprefs.js"></script>
+
+ <script type='text/jscript'>
+ // include the overwriting stylesheet if necessary
+ if (typeof localstylesurl != "undefined" && localstylesurl != "")
+ document.write("<link rel='stylesheet' type='text/css' href='" + localstylesurl
++ "'>");
+ </script>
+
+ <script type="text/jscript" src="tools.js"></script>
+
+ <script type="text/jscript">
+
+ getDefaultLanguage();
+
+ initGlobals();
+
+ </script>
+
+ <script type='text/jscript' src="helpmenu.js"></script>
+ <script type='text/jscript' src="strings.js"></script>
+ <script type='text/jscript' src="version.js"></script>
+
+ <script type='text/jscript'>
+ // show localized title string
+ document.title=local(SEARCH_TITLE);
+ </script>
+
+ <script type='text/jscript'>
+ // include the localsearch file if necessary
+ if (typeof localsearchurl != "undefined" && localsearchurl != "")
+ document.write("<xml id='localsearch' src='" + localsearchurl + "'></xml>");
</script>
***************
*** 154,160 ****
<div style='display:none' id='delaymsg'></div>
! <script type='text/Jscript'>
! init = true;
! selfdrag = false;
// def() called when the user hits "enter" in the textbox
--- 153,157 ----
<div style='display:none' id='delaymsg'></div>
! <script type='text/jscript'>
// def() called when the user hits "enter" in the textbox
***************
*** 393,399 ****
}
- reuseBrowserWindowModeOverride = reuseBrowserWindowMode;
- searchPrefix = '';
-
// handle onkeypress: cut-copy-paste, ctrl-n, ctrl-p for next and previous
// we need to do this because for some reason it's not done for us when
--- 390,393 ----
***************
*** 565,570 ****
}
- bant = null;
-
// starts the banner timer
function startbanner(delay)
--- 559,562 ----
***************
*** 685,782 ****
! <table align='left'
! border=0
! cellpadding=0
! cellspacing=0>
! <tr>
! <td>
! <form name='deff'
! target='_blank'
! action='http://www.google.com/search'
! method='get'
! onsubmit="return def();">
! <nobr>
! <script type='text/Jscript'>
! <!--
! document.write(
! (multiline ? '<textarea ' : '<input ')
! + 'name=q '
! + 'type=text '
! + 'style="top:-100; display: none;" '
! + 'class=txtfld '
! + 'onfocus=clr() '
! + 'ondragstart="selfdrag=true;" '
! + 'ondragend="selfdrag=false;" '
! + 'ondragover=dodragover() '
! + 'ondrop=dodrop() '
! + 'onblur=rst() '
! + 'onhelp=showpop() '
! + (calStart ? 'ondblclick' : 'oncontextmenu') + '="return showcal();" '
! + 'onkeydown="return okd();" '
! + 'onkeypress="return okp();" '
! + 'value="" '
! + 'cols=20 '
! + 'rows=1 '
! + 'maxlength=256 '
! + 'tabindex=0 '
! + 'autocomplete=' + (autocomplete ? 'on' : 'off')
! + (multiline ? "></textarea>" : ">"));
!
! dopopup = (ie_version >= 5.5);
! if (dopopup)
! {
! document.write(
! "<input class=gobutton type=button"
! + " name=gobutton"
! + " value=»"
! + " onmousedown=this.className='mdgobutton';showpop();"
! + " ondblclick=showpop();"
! + " oncontextmenu=\"return showcal();\""
! + " onmouseup=this.className='mogobutton'"
! + " onmouseover=this.className='mogobutton'"
! + " onmouseout=this.className='gobutton'"
! + " style='top:-100'"
! + " tabindex=-1>");
! }
! -->
! </script>
</nobr>
! </form>
! </td>
</tr>
<tr>
! <td id='info' style='display:none'>
! <img width=0 height=36><br>
! <b><a style='text-decoration:none;color:black' href='http://www.dqsd.net/'
target='_blank' tabindex='-1'>
! Dave's Quick Search Deskbar</a></b>
! <br>
! Designed to be placed on the Windows taskbar.<br>
! For documentation,
! <a href="about:" onclick="about(); return false;" tabindex=-1>click here</a>.
! </td>
</tr>
! </table>
!
! <script type='text/Jscript' src="version.js"></script>
! <script type='text/Jscript' src="tools.js"></script>
! <script type='text/Jscript' src="strings.js"></script>
! <script type='text/Jscript' src="loader.js"></script>
! <script type='text/Jscript' src="history.js"></script>
! <script type='text/Jscript' src="calculate.js"></script>
! <script type='text/Jscript' src="translate.js"></script>
! <script type='text/Jscript' src="clock.js"></script>
! <script type='text/Jscript' src="calendar.js"></script>
! <script defer type='text/Jscript' src="defer_tools.js"></script>
! <script defer type='text/Jscript' src="helpbox.js"></script>
!
! <script type='text/Jscript'>
! // show localized title string
! document.title=local(SEARCH_TITLE);
! // eliminate Go button if window is narrow
! gowidth = -1;
! textheight = -1;
function handleResize()
--- 677,762 ----
! <table align='left'
! border=0
! cellpadding=0
! cellspacing=0>
! <tr>
! <td>
! <form name='deff'
! target='_blank'
! action='http://www.google.com/search'
! method='get'
! onsubmit="return def();">
! <nobr>
! <script type='text/jscript'>
! <!--
! document.write(
! (multiline ? '<textarea ' : '<input ')
! + 'name=q '
! + 'type=text '
! + 'style="top:-100; display: none;" '
! + 'class=txtfld '
! + 'onfocus=clr() '
! + 'ondragstart="selfdrag=true;" '
! + 'ondragend="selfdrag=false;" '
! + 'ondragover=dodragover() '
! + 'ondrop=dodrop() '
! + 'onblur=rst() '
! + 'onhelp=showpop() '
! + (calStart ? 'ondblclick' : 'oncontextmenu') + '="return showcal();" '
! + 'onkeydown="return okd();" '
! + 'onkeypress="return okp();" '
! + 'value="" '
! + 'cols=20 '
! + 'rows=1 '
! + 'maxlength=256 '
! + 'tabindex=0 '
! + 'autocomplete=' + (autocomplete ? 'on' : 'off')
! + (multiline ? "></textarea>" : ">"));
! if (dopopup)
! {
! document.write(
! "<input class=gobutton type=button"
! + " name=gobutton"
! + " value=»"
! + " onmousedown=this.className='mdgobutton';showpop();"
! + " ondblclick=showpop();"
! + " oncontextmenu=\"return showcal();\""
! + " onmouseup=this.className='mogobutton'"
! + " onmouseover=this.className='mogobutton'"
! + " onmouseout=this.className='gobutton'"
! + " style='top:-100'"
! + " tabindex=-1>");
! }
! -->
! </script>
</nobr>
! </form>
! </td>
</tr>
<tr>
! <td id='info' style='display:none'>
! <img width=0 height=36><br>
! <b><a style='text-decoration:none;color:black' href='http://www.dqsd.net/'
target='_blank' tabindex='-1'>
! Dave's Quick Search Deskbar</a></b>
! <br>
! Designed to be placed on the Windows taskbar.<br>
! For documentation,
! <a href="about:" onclick="about(); return false;" tabindex=-1>click here</a>.
! </td>
</tr>
! </table>
+ <script type='text/jscript' src="loader.js"></script>
+ <script type='text/jscript' src="history.js"></script>
+ <script type='text/jscript' src="calculate.js"></script>
+ <script type='text/jscript' src="translate.js"></script>
+ <script type='text/jscript' src="clock.js"></script>
+ <script type='text/jscript' src="calendar.js"></script>
+ <script defer type='text/jscript' src="defer_tools.js"></script>
+ <script defer type='text/jscript' src="helpbox.js"></script>
! <script type='text/jscript'>
function handleResize()
***************
*** 848,853 ****
paintclock();
}
-
- var keyboardHook;
function postStartup()
--- 828,831 ----
Index: tools.js
===================================================================
RCS file: /cvsroot/dqsd/dqsd/tools.js,v
retrieving revision 1.34
retrieving revision 1.35
diff -C2 -d -r1.34 -r1.35
*** tools.js 6 Sep 2002 16:48:38 -0000 1.34
--- tools.js 4 Oct 2002 04:48:29 -0000 1.35
***************
*** 31,38 ****
// Tools that rely on DQSDTools.dll
- var DQSDLauncher = null;
- var triedToCreateLauncher = false;
- useExternalBrowser = (launchmode > 0);
-
function ensureLauncher()
{
--- 31,34 ----
***************
*** 54,71 ****
}
- if (useExternalBrowser)
- {
- if (ensureLauncher())
- {
- var browserPath = DQSDLauncher.pathDefaultBrowser
- if (launchmode != 0 && browserPath.toLowerCase().indexOf("iexplore.exe") > 0)
- useExternalBrowser = false;
- }
- else // Gracefully ignore problems creating the control.
- {
- useExternalBrowser = false;
- }
- }
-
// read file
function readFile(filename)
--- 50,53 ----
***************
*** 202,204 ****
--- 184,249 ----
return new ActiveXObject("Msxml.DOMDocument");
}
+ }
+
+ function getDefaultLanguage()
+ {
+ language=navigator.userLanguage.substr(0,2);
+ }
+
+ function initGlobals()
+ {
+ DQSDLauncher = null;
+ triedToCreateLauncher = false;
+
+ firsterror = null;
+ // window.onerror=handleerror;
+
+ var uaMatch = navigator.userAgent.toLowerCase().match("msie\\s+(\\d+\\.\\d*)");
+ var ie_version = (uaMatch ? parseFloat(uaMatch[1]) : 0.0);
+ dopopup = (ie_version >= 5.5);
+
+ useExternalBrowser = (launchmode > 0);
+ if (useExternalBrowser)
+ {
+ if (ensureLauncher())
+ {
+ var browserPath = DQSDLauncher.pathDefaultBrowser
+ if (launchmode != 0 && browserPath.toLowerCase().indexOf("iexplore.exe") > 0)
+ useExternalBrowser = false;
+ }
+ else // Gracefully ignore problems creating the control.
+ {
+ useExternalBrowser = false;
+ }
+ }
+
+ reuseBrowserWindowModeOverride = reuseBrowserWindowMode;
+ searchPrefix = '';
+
+ init = true;
+ selfdrag = false;
+
+ bant = null;
+
+ // eliminate Go button if window is narrow
+ gowidth = -1;
+ textheight = -1;
+
+ keyboardHook = null;
+ }
+
+ // catch errors
+ function handleerror(msg, url, lineno)
+ {
+ if (!firsterror)
+ {
+ firsterror = msg;
+ alert("Error (line " + lineno + "):\n" + msg);
+ }
+ return true;
+ }
+
+ function qualifiedalert(s)
+ {
+ alertmode && alert(s);
}
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
DQSD-CVS mailing list
https://lists.sourceforge.net/lists/listinfo/dqsd-cvs
DQSD CVS repository:
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/dqsd/