Produced by Araxis Merge on Thu Oct 16 22:30:03 2008 UTC. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a reasonably standards compliant browser such as the latest version of Firefox or Internet Explorer. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.
# | Location | File | Last Modified |
---|---|---|---|
1 | C:\Documents and Settings\lauren\Desktop\ww-version-snapshots\ww-version-snapshots\2008.2\WebWorks\ePublisher Pro\Formats\WebWorks Help 5.0\Files\wwhelp\wwhimpl\js\scripts | search.js | Fri Sep 7 17:51:28 2007 UTC |
2 | C:\Documents and Settings\lauren\Desktop\ww-version-snapshots\ww-version-snapshots\2008.3\WebWorks\ePublisher Pro\Formats\WebWorks Help 5.0\Files\wwhelp\wwhimpl\js\scripts | search.js | Mon Oct 13 05:51:54 2008 UTC |
Description | Between Files 1 and 2 |
|
---|---|---|
Text Blocks | Lines | |
Unchanged | 4 | 3202 |
Changed | 3 | 6 |
Inserted | 0 | 0 |
Removed | 0 | 0 |
Whitespace | All differences in whitespace within lines are ignored |
---|---|
Character case | Differences in character case are significant |
Line endings | Differences in line endings (CR and LF characters) are ignored |
CR/LF characters | Not shown in the comparison detail |
No regular expressions were active.
1 | // Copyrig ht (c) 200 0-2005 Qua dralay Cor poration. All right s reserved . | 1 | // Copyrig ht (c) 200 0-2005 Qua dralay Cor poration. All right s reserved . | |||
2 | // | 2 | // | |||
3 | 3 | |||||
4 | function WWHSearch_ Object() | 4 | function WWHSearch_ Object() | |||
5 | { | 5 | { | |||
6 | this.mbP anelInitia lized = false; | 6 | this.mbP anelInitia lized = false; | |||
7 | this.mPa nelAnchor = null; | 7 | this.mPa nelAnchor = null; | |||
8 | this.mPa nelTabTitl e = WWHFrame .WWHJavaSc ript.mMess ages.mTabs SearchLabe l; | 8 | this.mPa nelTabTitl e = WWHFrame .WWHJavaSc ript.mMess ages.mTabs SearchLabe l; | |||
9 | this.mPa nelTabInde x = -1; | 9 | this.mPa nelTabInde x = -1; | |||
10 | this.mPa nelFilenam e = ((WWHFra me.WWHBrow ser.mBrows er == 1) ? "panelfns .htm" : "p anelfss.ht m"); | 10 | this.mPa nelFilenam e = ((WWHFra me.WWHBrow ser.mBrows er == 1) ? "panelfns .htm" : "p anelfss.ht m"); | |||
11 | this.mIn itIndex = 0; | 11 | this.mIn itIndex = 0; | |||
12 | this.mNo nBreakingC haracters = new Obje ct(); | 12 | this.mNo nBreakingC haracters = new Obje ct(); | |||
13 | this.mBo okSearchIn foList = new Arra y(); | 13 | this.mBo okSearchIn foList = new Arra y(); | |||
14 | this.mMu ltiPhraseL ist = new Arra y(); | 14 | this.mMu ltiPhraseL ist = new Arra y(); | |||
15 | this.mSe archState = null; | 15 | this.mSe archState = null; | |||
16 | this.mSe archScopeI nfo = null; | 16 | this.mSe archScopeI nfo = null; | |||
17 | this.mSa vedSearchW ords = ""; | 17 | this.mSa vedSearchW ords = ""; | |||
18 | this.mSa vedSearchS cope = 0; | 18 | this.mSa vedSearchS cope = 0; | |||
19 | this.mSe archWordLi st = new Arra y(); | 19 | this.mSe archWordLi st = new Arra y(); | |||
20 | this.mSe archWordRe gExpList = new Arra y(); | 20 | this.mSe archWordRe gExpList = new Arra y(); | |||
21 | this.mBo okIndex = 0; | 21 | this.mBo okIndex = 0; | |||
22 | this.mBo okMatchesL ist = new Arra y(); | 22 | this.mBo okMatchesL ist = new Arra y(); | |||
23 | this.mCo mbinedResu lts = new WWHS earchResul ts_Object( ); | 23 | this.mCo mbinedResu lts = new WWHS earchResul ts_Object( ); | |||
24 | this.mCo mbinedResu ltsIndex = 0; | 24 | this.mCo mbinedResu ltsIndex = 0; | |||
25 | 25 | |||||
26 | this.fIn itialize = WWHSear ch_Initial ize; | 26 | this.fIn itialize = WWHSear ch_Initial ize; | |||
27 | this.fIn itHeadHTML = WWHSear ch_InitHea dHTML; | 27 | this.fIn itHeadHTML = WWHSear ch_InitHea dHTML; | |||
28 | this.fIn itBodyHTML = WWHSear ch_InitBod yHTML; | 28 | this.fIn itBodyHTML = WWHSear ch_InitBod yHTML; | |||
29 | this.fIn itLoadBook SearchInfo = WWHSear ch_InitLoa dBookSearc hInfo; | 29 | this.fIn itLoadBook SearchInfo = WWHSear ch_InitLoa dBookSearc hInfo; | |||
30 | this.fNa vigationHe adHTML = WWHSear ch_Navigat ionHeadHTM L; | 30 | this.fNa vigationHe adHTML = WWHSear ch_Navigat ionHeadHTM L; | |||
31 | this.fNa vigationBo dyHTML = WWHSear ch_Navigat ionBodyHTM L; | 31 | this.fNa vigationBo dyHTML = WWHSear ch_Navigat ionBodyHTM L; | |||
32 | this.fHe adHTML = WWHSear ch_HeadHTM L; | 32 | this.fHe adHTML = WWHSear ch_HeadHTM L; | |||
33 | this.fSt artHTMLSeg ments = WWHSear ch_StartHT MLSegments ; | 33 | this.fSt artHTMLSeg ments = WWHSear ch_StartHT MLSegments ; | |||
34 | this.fAd vanceHTMLS egment = WWHSear ch_Advance HTMLSegmen t; | 34 | this.fAd vanceHTMLS egment = WWHSear ch_Advance HTMLSegmen t; | |||
35 | this.fGe tHTMLSegme nt = WWHSear ch_GetHTML Segment; | 35 | this.fGe tHTMLSegme nt = WWHSear ch_GetHTML Segment; | |||
36 | this.fEn dHTMLSegme nts = WWHSear ch_EndHTML Segments; | 36 | this.fEn dHTMLSegme nts = WWHSear ch_EndHTML Segments; | |||
37 | this.fPa nelNavigat ionLoaded = WWHSear ch_PanelNa vigationLo aded; | 37 | this.fPa nelNavigat ionLoaded = WWHSear ch_PanelNa vigationLo aded; | |||
38 | this.fPa nelViewLoa ded = WWHSear ch_PanelVi ewLoaded; | 38 | this.fPa nelViewLoa ded = WWHSear ch_PanelVi ewLoaded; | |||
39 | this.fHo verTextTra nslate = WWHSear ch_HoverTe xtTranslat e; | 39 | this.fHo verTextTra nslate = WWHSear ch_HoverTe xtTranslat e; | |||
40 | this.fHo verTextFor mat = WWHSear ch_HoverTe xtFormat; | 40 | this.fHo verTextFor mat = WWHSear ch_HoverTe xtFormat; | |||
41 | this.fDi splaySearc hForm = WWHSear ch_Display SearchForm ; | 41 | this.fDi splaySearc hForm = WWHSear ch_Display SearchForm ; | |||
42 | this.fSu bmit = WWHSear ch_Submit; | 42 | this.fSu bmit = WWHSear ch_Submit; | |||
43 | this.fAp plyWordBre aks = WWHSear ch_ApplyWo rdBreaks; | 43 | this.fAp plyWordBre aks = WWHSear ch_ApplyWo rdBreaks; | |||
44 | this.fSe tSearchWor ds = WWHSear ch_SetSear chWords; | 44 | this.fSe tSearchWor ds = WWHSear ch_SetSear chWords; | |||
45 | this.fCh eckForMatc h = WWHSear ch_CheckFo rMatch; | 45 | this.fCh eckForMatc h = WWHSear ch_CheckFo rMatch; | |||
46 | this.fSe archWordsC omplete = WWHSear ch_SearchW ordsComple te; | 46 | this.fSe archWordsC omplete = WWHSear ch_SearchW ordsComple te; | |||
47 | this.fCh eckForPhra seMatch = WWHSear ch_CheckFo rPhraseMat ch; | 47 | this.fCh eckForPhra seMatch = WWHSear ch_CheckFo rPhraseMat ch; | |||
48 | this.fSe archPairsC omplete = WWHSear ch_SearchP airsComple te; | 48 | this.fSe archPairsC omplete = WWHSear ch_SearchP airsComple te; | |||
49 | this.fCo mbineResul ts = WWHSear ch_Combine Results; | 49 | this.fCo mbineResul ts = WWHSear ch_Combine Results; | |||
50 | this.fSh owEntry = WWHSear ch_ShowEnt ry; | 50 | this.fSh owEntry = WWHSear ch_ShowEnt ry; | |||
51 | 51 | |||||
52 | // Initi alize | 52 | // Initi alize | |||
53 | // | 53 | // | |||
54 | this.fIn itialize() ; | 54 | this.fIn itialize() ; | |||
55 | } | 55 | } | |||
56 | 56 | |||||
57 | function WWHSearch_ Initialize () | 57 | function WWHSearch_ Initialize () | |||
58 | { | 58 | { | |||
59 | // Initi alize non- breaking c haracters | 59 | // Initi alize non- breaking c haracters | |||
60 | // | 60 | // | |||
61 | this.mNo nBreakingC haracters[ 65392] = t rue; // H alfwidth K atakana-Hi ragana Pro longed Sou nd Mark | 61 | this.mNo nBreakingC haracters[ 65392] = t rue; // H alfwidth K atakana-Hi ragana Pro longed Sou nd Mark | |||
62 | this.mNo nBreakingC haracters[ 65438] = t rue; // H alfwidth K atakana Vo iced Sound Mark | 62 | this.mNo nBreakingC haracters[ 65438] = t rue; // H alfwidth K atakana Vo iced Sound Mark | |||
63 | this.mNo nBreakingC haracters[ 65439] = t rue; // H alfwidth K atakana Se mi-Voiced Sound Mark | 63 | this.mNo nBreakingC haracters[ 65439] = t rue; // H alfwidth K atakana Se mi-Voiced Sound Mark | |||
64 | this.mNo nBreakingC haracters[ 1523] = tr ue; // H ebrew Punc tuation Ge resh | 64 | this.mNo nBreakingC haracters[ 1523] = tr ue; // H ebrew Punc tuation Ge resh | |||
65 | this.mNo nBreakingC haracters[ 1524] = tr ue; // H ebrew Punc tuation Ge rshayim | 65 | this.mNo nBreakingC haracters[ 1524] = tr ue; // H ebrew Punc tuation Ge rshayim | |||
66 | this.mNo nBreakingC haracters[ 8217] = tr ue; // R ight Singl e Quotatio n Mark (cu rly apostr ophe) | 66 | this.mNo nBreakingC haracters[ 8217] = tr ue; // R ight Singl e Quotatio n Mark (cu rly apostr ophe) | |||
67 | this.mNo nBreakingC haracters[ 8231] = tr ue; // H yphenation Point | 67 | this.mNo nBreakingC haracters[ 8231] = tr ue; // H yphenation Point | |||
68 | } | 68 | } | |||
69 | 69 | |||||
70 | function WWHSearch_ InitHeadHT ML() | 70 | function WWHSearch_ InitHeadHT ML() | |||
71 | { | 71 | { | |||
72 | var Ini tHeadHTML = ""; | 72 | var Ini tHeadHTML = ""; | |||
73 | 73 | |||||
74 | 74 | |||||
75 | // Creat e search s cope info | 75 | // Creat e search s cope info | |||
76 | // | 76 | // | |||
77 | this.mSe archScopeI nfo = new WWHSearchS cope_Objec t(); | 77 | this.mSe archScopeI nfo = new WWHSearchS cope_Objec t(); | |||
78 | 78 | |||||
79 | return I nitHeadHTM L; | 79 | return I nitHeadHTM L; | |||
80 | } | 80 | } | |||
81 | 81 | |||||
82 | function WWHSearch_ InitBodyHT ML() | 82 | function WWHSearch_ InitBodyHT ML() | |||
83 | { | 83 | { | |||
84 | var HTM L = new WW HStringBuf fer_Object (); | 84 | var HTM L = new WW HStringBuf fer_Object (); | |||
85 | var Var Parameters ; | 85 | var Var Parameters ; | |||
86 | var Boo kList; | 86 | var Boo kList; | |||
87 | var Max Index; | 87 | var Max Index; | |||
88 | var Ind ex; | 88 | var Ind ex; | |||
89 | 89 | |||||
90 | 90 | |||||
91 | // Worka round Safa ri reload bug | 91 | // Worka round Safa ri reload bug | |||
92 | // | 92 | // | |||
93 | VarParam eters = "" ; | 93 | VarParam eters = "" ; | |||
94 | if (WWHF rame.WWHBr owser.mBro wser == 5) // Short hhand for Safari | 94 | if (WWHF rame.WWHBr owser.mBro wser == 5) // Short hhand for Safari | |||
95 | { | 95 | { | |||
96 | VarPar ameters = "?" + (new Date() * 1); | 96 | VarPar ameters = "?" + (new Date() * 1); | |||
97 | } | 97 | } | |||
98 | 98 | |||||
99 | // Displ ay initial izing mess age | 99 | // Displ ay initial izing mess age | |||
100 | // | 100 | // | |||
101 | HTML.fAp pend("<h2> " + WWHFra me.WWHJava Script.mMe ssages.mIn itializing Message + "</h2>\n") ; | 101 | HTML.fAp pend("<h2> " + WWHFra me.WWHJava Script.mMe ssages.mIn itializing Message + "</h2>\n") ; | |||
102 | 102 | |||||
103 | // Load search inf o | 103 | // Load search inf o | |||
104 | // | 104 | // | |||
105 | this.mIn itIndex = 0; | 105 | this.mIn itIndex = 0; | |||
106 | BookList = WWHFram e.WWHHelp. mBooks.mBo okList; | 106 | BookList = WWHFram e.WWHHelp. mBooks.mBo okList; | |||
107 | for (Max Index = Bo okList.len gth, Index = 0 ; Ind ex < MaxIn dex ; Inde x++) | 107 | for (Max Index = Bo okList.len gth, Index = 0 ; Ind ex < MaxIn dex ; Inde x++) | |||
108 | { | 108 | { | |||
109 | // Ref erence sea rch info | 109 | // Ref erence sea rch info | |||
110 | // | 110 | // | |||
111 | HTML.fAppe nd("<scrip t language=\ "JavaScrip t1.2\" src=\"" + WWHFrame.W WHHelp.mHe lpURLPrefi x + WWHFrame.W WHBrowser. fRestoreEs capedSpace s( BookList[I ndex].mDir ectory ) + "wwhdata/j s/search.j s" + VarParamet ers + "\"></scri pt>\n"); | 111 |
HTML.fAppe
nd("<scrip
t
language=\
"JavaScrip
t1.2\"
src=\""
+
WWHFrame.W
WHHelp.mHe
lpURLPrefi
x
+
|
|||
112 | 112 | |||||
113 | // Loa d search i nfo for cu rrent book | 113 | // Loa d search i nfo for cu rrent book | |||
114 | // | 114 | // | |||
115 | HTML.f Append("<s cript lang uage=\"Jav aScript1.2 \" src=\"" + WWHFram e.WWHHelp. mHelpURLPr efix + "ww help/wwhim pl/js/scri pts/search 1s.js" + V arParamete rs + "\">< /script>\n "); | 115 | HTML.f Append("<s cript lang uage=\"Jav aScript1.2 \" src=\"" + WWHFram e.WWHHelp. mHelpURLPr efix + "ww help/wwhim pl/js/scri pts/search 1s.js" + V arParamete rs + "\">< /script>\n "); | |||
116 | } | 116 | } | |||
117 | 117 | |||||
118 | return H TML.fGetBu ffer(); | 118 | return H TML.fGetBu ffer(); | |||
119 | } | 119 | } | |||
120 | 120 | |||||
121 | function WWHSearch_ InitLoadBo okSearchIn fo(ParamSe archFileCo unt, | 121 | function WWHSearch_ InitLoadBo okSearchIn fo(ParamSe archFileCo unt, | |||
122 | ParamMi nimumWordL ength, | 122 | ParamMi nimumWordL ength, | |||
123 | ParamSe archSkipWo rdsFunc) | 123 | ParamSe archSkipWo rdsFunc) | |||
124 | { | 124 | { | |||
125 | // Load book searc h info | 125 | // Load book searc h info | |||
126 | // | 126 | // | |||
127 | this.mBo okSearchIn foList[thi s.mInitInd ex] = new WWHBookSea rchInfo_Ob ject(Param SearchFile Count, Par amMinimumW ordLength) ; | 127 | this.mBo okSearchIn foList[thi s.mInitInd ex] = new WWHBookSea rchInfo_Ob ject(Param SearchFile Count, Par amMinimumW ordLength) ; | |||
128 | ParamSea rchSkipWor dsFunc(thi s.mBookSea rchInfoLis t[this.mIn itIndex]); | 128 | ParamSea rchSkipWor dsFunc(thi s.mBookSea rchInfoLis t[this.mIn itIndex]); | |||
129 | 129 | |||||
130 | // Creat e match ob jects for each book | 130 | // Creat e match ob jects for each book | |||
131 | // | 131 | // | |||
132 | this.mBo okMatchesL ist[this.m BookMatche sList.leng th] = new WWHSearchB ookMatches _Object(); | 132 | this.mBo okMatchesL ist[this.m BookMatche sList.leng th] = new WWHSearchB ookMatches _Object(); | |||
133 | 133 | |||||
134 | // Incre ment init book index | 134 | // Incre ment init book index | |||
135 | // | 135 | // | |||
136 | this.mIn itIndex++; | 136 | this.mIn itIndex++; | |||
137 | 137 | |||||
138 | // Mark initialize d if done | 138 | // Mark initialize d if done | |||
139 | // | 139 | // | |||
140 | if (this .mInitInde x == WWHFr ame.WWHHel p.mBooks.m BookList.l ength) | 140 | if (this .mInitInde x == WWHFr ame.WWHHel p.mBooks.m BookList.l ength) | |||
141 | { | 141 | { | |||
142 | this.m bPanelInit ialized = true; | 142 | this.m bPanelInit ialized = true; | |||
143 | } | 143 | } | |||
144 | } | 144 | } | |||
145 | 145 | |||||
146 | function WWHSearch_ Navigation HeadHTML() | 146 | function WWHSearch_ Navigation HeadHTML() | |||
147 | { | 147 | { | |||
148 | return " "; | 148 | return " "; | |||
149 | } | 149 | } | |||
150 | 150 | |||||
151 | function WWHSearch_ Navigation BodyHTML() | 151 | function WWHSearch_ Navigation BodyHTML() | |||
152 | { | 152 | { | |||
153 | return t his.fDispl aySearchFo rm(); | 153 | return t his.fDispl aySearchFo rm(); | |||
154 | } | 154 | } | |||
155 | 155 | |||||
156 | function WWHSearch_ HeadHTML() | 156 | function WWHSearch_ HeadHTML() | |||
157 | { | 157 | { | |||
158 | var HTM L = new WW HStringBuf fer_Object (); | 158 | var HTM L = new WW HStringBuf fer_Object (); | |||
159 | var Set tings = WW HFrame.WWH JavaScript .mSettings .mSearch; | 159 | var Set tings = WW HFrame.WWH JavaScript .mSettings .mSearch; | |||
160 | 160 | |||||
161 | 161 | |||||
162 | // Gener ate style section | 162 | // Gener ate style section | |||
163 | // | 163 | // | |||
164 | HTML.fAp pend("<sty le type=\" text/css\" >\n"); | 164 | HTML.fAp pend("<sty le type=\" text/css\" >\n"); | |||
165 | HTML.fAp pend(" <!- -\n"); | 165 | HTML.fAp pend(" <!- -\n"); | |||
166 | HTML.fAp pend(" a: active\n") ; | 166 | HTML.fAp pend(" a: active\n") ; | |||
167 | HTML.fAp pend(" {\ n"); | 167 | HTML.fAp pend(" {\ n"); | |||
168 | HTML.fAp pend(" text-decor ation: non e;\n"); | 168 | HTML.fAp pend(" text-decor ation: non e;\n"); | |||
169 | HTML.fAp pend(" background -color: " + Settings .mHighligh tColor + " ;\n"); | 169 | HTML.fAp pend(" background -color: " + Settings .mHighligh tColor + " ;\n"); | |||
170 | HTML.fAp pend(" }\ n"); | 170 | HTML.fAp pend(" }\ n"); | |||
171 | HTML.fAp pend(" a: hover\n"); | 171 | HTML.fAp pend(" a: hover\n"); | |||
172 | HTML.fAp pend(" {\ n"); | 172 | HTML.fAp pend(" {\ n"); | |||
173 | HTML.fAp pend(" text-decor ation: und erline;\n" ); | 173 | HTML.fAp pend(" text-decor ation: und erline;\n" ); | |||
174 | HTML.fAp pend(" color: " + Settings. mEnabledCo lor + ";\n "); | 174 | HTML.fAp pend(" color: " + Settings. mEnabledCo lor + ";\n "); | |||
175 | HTML.fAp pend(" }\ n"); | 175 | HTML.fAp pend(" }\ n"); | |||
176 | HTML.fAp pend(" a\ n"); | 176 | HTML.fAp pend(" a\ n"); | |||
177 | HTML.fAp pend(" {\ n"); | 177 | HTML.fAp pend(" {\ n"); | |||
178 | HTML.fAp pend(" text-decor ation: non e;\n"); | 178 | HTML.fAp pend(" text-decor ation: non e;\n"); | |||
179 | HTML.fAp pend(" color: " + Settings. mEnabledCo lor + ";\n "); | 179 | HTML.fAp pend(" color: " + Settings. mEnabledCo lor + ";\n "); | |||
180 | HTML.fAp pend(" }\ n"); | 180 | HTML.fAp pend(" }\ n"); | |||
181 | HTML.fAp pend(" p\ n"); | 181 | HTML.fAp pend(" p\ n"); | |||
182 | HTML.fAp pend(" {\ n"); | 182 | HTML.fAp pend(" {\ n"); | |||
183 | HTML.fAp pend(" margin-top : 1pt;\n") ; | 183 | HTML.fAp pend(" margin-top : 1pt;\n") ; | |||
184 | HTML.fAp pend(" margin-bot tom: 1pt;\ n"); | 184 | HTML.fAp pend(" margin-bot tom: 1pt;\ n"); | |||
185 | HTML.fAp pend(" " + Settin gs.mFontSt yle + ";\n "); | 185 | HTML.fAp pend(" " + Settin gs.mFontSt yle + ";\n "); | |||
186 | HTML.fAp pend(" }\ n"); | 186 | HTML.fAp pend(" }\ n"); | |||
187 | HTML.fAp pend(" p. BookTitle\ n"); | 187 | HTML.fAp pend(" p. BookTitle\ n"); | |||
188 | HTML.fAp pend(" {\ n"); | 188 | HTML.fAp pend(" {\ n"); | |||
189 | HTML.fAp pend(" margin-top : 1pt;\n") ; | 189 | HTML.fAp pend(" margin-top : 1pt;\n") ; | |||
190 | HTML.fAp pend(" margin-bot tom: 1pt;\ n"); | 190 | HTML.fAp pend(" margin-bot tom: 1pt;\ n"); | |||
191 | HTML.fAp pend(" font-weigh t: bold;\n "); | 191 | HTML.fAp pend(" font-weigh t: bold;\n "); | |||
192 | HTML.fAp pend(" " + Settin gs.mFontSt yle + ";\n "); | 192 | HTML.fAp pend(" " + Settin gs.mFontSt yle + ";\n "); | |||
193 | HTML.fAp pend(" }\ n"); | 193 | HTML.fAp pend(" }\ n"); | |||
194 | HTML.fAp pend(" ol \n"); | 194 | HTML.fAp pend(" ol \n"); | |||
195 | HTML.fAp pend(" {\ n"); | 195 | HTML.fAp pend(" {\ n"); | |||
196 | HTML.fAp pend(" margin-top : 1pt;\n") ; | 196 | HTML.fAp pend(" margin-top : 1pt;\n") ; | |||
197 | HTML.fAp pend(" margin-bot tom: 1pt;\ n"); | 197 | HTML.fAp pend(" margin-bot tom: 1pt;\ n"); | |||
198 | if (Sett ings.mbSho wRank) | 198 | if (Sett ings.mbSho wRank) | |||
199 | { | 199 | { | |||
200 | HTML.f Append(" " + Sett ings.mFont Style + "; \n"); | 200 | HTML.f Append(" " + Sett ings.mFont Style + "; \n"); | |||
201 | } | 201 | } | |||
202 | else | 202 | else | |||
203 | { | 203 | { | |||
204 | HTML.f Append(" list-sty le: none;\ n"); | 204 | HTML.f Append(" list-sty le: none;\ n"); | |||
205 | } | 205 | } | |||
206 | HTML.fAp pend(" }\ n"); | 206 | HTML.fAp pend(" }\ n"); | |||
207 | HTML.fAp pend(" li \n"); | 207 | HTML.fAp pend(" li \n"); | |||
208 | HTML.fAp pend(" {\ n"); | 208 | HTML.fAp pend(" {\ n"); | |||
209 | HTML.fAp pend(" margin-top : 2pt;\n") ; | 209 | HTML.fAp pend(" margin-top : 2pt;\n") ; | |||
210 | HTML.fAp pend(" margin-bot tom: 0pt;\ n"); | 210 | HTML.fAp pend(" margin-bot tom: 0pt;\ n"); | |||
211 | HTML.fAp pend(" " + Settin gs.mFontSt yle + ";\n "); | 211 | HTML.fAp pend(" " + Settin gs.mFontSt yle + ";\n "); | |||
212 | HTML.fAp pend(" }\ n"); | 212 | HTML.fAp pend(" }\ n"); | |||
213 | HTML.fAp pend(" --> \n"); | 213 | HTML.fAp pend(" --> \n"); | |||
214 | HTML.fAp pend("</st yle>\n"); | 214 | HTML.fAp pend("</st yle>\n"); | |||
215 | 215 | |||||
216 | return H TML.fGetBu ffer(); | 216 | return H TML.fGetBu ffer(); | |||
217 | } | 217 | } | |||
218 | 218 | |||||
219 | function WWHSearch_ StartHTMLS egments() | 219 | function WWHSearch_ StartHTMLS egments() | |||
220 | { | 220 | { | |||
221 | var HTM L = new WW HStringBuf fer_Object (); | 221 | var HTM L = new WW HStringBuf fer_Object (); | |||
222 | var Var Parameters ; | 222 | var Var Parameters ; | |||
223 | var Max BookIndex; | 223 | var Max BookIndex; | |||
224 | var Boo kIndex; | 224 | var Boo kIndex; | |||
225 | var Boo kList; | 225 | var Boo kList; | |||
226 | var Max Index; | 226 | var Max Index; | |||
227 | var Ind ex; | 227 | var Ind ex; | |||
228 | var Boo kDirectory ; | 228 | var Boo kDirectory ; | |||
229 | var bDi splayBookT itles; | 229 | var bDi splayBookT itles; | |||
230 | var Ent ry; | 230 | var Ent ry; | |||
231 | var Mul tiPhraseEn try; | 231 | var Mul tiPhraseEn try; | |||
232 | 232 | |||||
233 | 233 | |||||
234 | if (this .mbPanelIn itialized) | 234 | if (this .mbPanelIn itialized) | |||
235 | { | 235 | { | |||
236 | // Wor karound Sa fari reloa d bug | 236 | // Wor karound Sa fari reloa d bug | |||
237 | // | 237 | // | |||
238 | VarPar ameters = ""; | 238 | VarPar ameters = ""; | |||
239 | if (WW HFrame.WWH Browser.mB rowser == 5) // Sho rthhand fo r Safari | 239 | if (WW HFrame.WWH Browser.mB rowser == 5) // Sho rthhand fo r Safari | |||
240 | { | 240 | { | |||
241 | VarP arameters = "?" + (n ew Date() * 1); | 241 | VarP arameters = "?" + (n ew Date() * 1); | |||
242 | } | 242 | } | |||
243 | 243 | |||||
244 | // Per form searc h if requi red | 244 | // Per form searc h if requi red | |||
245 | // | 245 | // | |||
246 | if (th is.mSearch State == " words") | 246 | if (th is.mSearch State == " words") | |||
247 | { | 247 | { | |||
248 | // D isplay sea rching mes sage | 248 | // D isplay sea rching mes sage | |||
249 | // | 249 | // | |||
250 | HTML .fAppend(" <h2>" + WW HFrame.WWH JavaScript .mMessages .mSearchSe archingMes sage + "</ h2>\n"); | 250 | HTML .fAppend(" <h2>" + WW HFrame.WWH JavaScript .mMessages .mSearchSe archingMes sage + "</ h2>\n"); | |||
251 | 251 | |||||
252 | // H andle sing le book se arch | 252 | // H andle sing le book se arch | |||
253 | // | 253 | // | |||
254 | Book List = WWH Frame.WWHH elp.mBooks .mBookList ; | 254 | Book List = WWH Frame.WWHH elp.mBooks .mBookList ; | |||
255 | if ( this.mSave dSearchSco pe > 0) | 255 | if ( this.mSave dSearchSco pe > 0) | |||
256 | { | 256 | { | |||
257 | Bo okIndex = this.mS earchScope Info.mEntr ies[this.m SavedSearc hScope - 1 ].mStartBo okIndex; | 257 | Bo okIndex = this.mS earchScope Info.mEntr ies[this.m SavedSearc hScope - 1 ].mStartBo okIndex; | |||
258 | Ma xBookIndex = this.mS earchScope Info.mEntr ies[this.m SavedSearc hScope - 1 ].mEndBook Index + 1; | 258 | Ma xBookIndex = this.mS earchScope Info.mEntr ies[this.m SavedSearc hScope - 1 ].mEndBook Index + 1; | |||
259 | } | 259 | } | |||
260 | else | 260 | else | |||
261 | { | 261 | { | |||
262 | Bo okIndex = 0; | 262 | Bo okIndex = 0; | |||
263 | Ma xBookIndex = BookLis t.length; | 263 | Ma xBookIndex = BookLis t.length; | |||
264 | } | 264 | } | |||
265 | 265 | |||||
266 | // G enerate se arch actio ns | 266 | // G enerate se arch actio ns | |||
267 | // | 267 | // | |||
268 | this .mBookInde x = BookIn dex; | 268 | this .mBookInde x = BookIn dex; | |||
269 | for ( ; BookIn dex < MaxB ookIndex ; BookIndex ++) | 269 | for ( ; BookIn dex < MaxB ookIndex ; BookIndex ++) | |||
270 | { | 270 | { | |||
271 | Bo okDirector y = BookLi st[BookInd ex].mDirec tory; | 271 | Bo okDirector y = BookLi st[BookInd ex].mDirec tory; | |||
272 | 272 | |||||
273 | fo r (MaxInde x = this.m BookSearch InfoList[B ookIndex]. mSearchFil eCount, In dex = 0 ; Index < Ma xIndex ; I ndex++) | 273 | fo r (MaxInde x = this.m BookSearch InfoList[B ookIndex]. mSearchFil eCount, In dex = 0 ; Index < Ma xIndex ; I ndex++) | |||
274 | { | 274 | { | |||
275 | HTML.fAppe nd("<scrip t type=\"tex t/javascri pt\" language=\ "JavaScrip t1.2\" src=\"" + WWHFrame.W WHHelp.mHe lpURLPrefi x + WWHFrame.W WHBrowser. fRestoreEs capedSpace s( BookDirect ory ) + "wwhdata/j s/search/s earch" + Index + ".js" + VarParamet ers + "\"></scri pt>\n"); | 275 |
HTML.fAppe
nd("<scrip
t
type=\"tex
t/javascri
pt\"
language=\
"JavaScrip
t1.2\"
src=\""
+
WWHFrame.W
WHHelp.mHe
lpURLPrefi
x
+
|
|||
276 | HTML.fAppe nd("<scrip t type=\"t ext/javasc ript\" lan guage=\"Ja vaScript1. 2\" src=\" " + WWHFra me.WWHHelp .mHelpURLP refix + "w whelp/wwhi mpl/js/scr ipts/searc h2s.js" + VarParamet ers + "\"> </script>\ n"); | 276 | HTML.fAppe nd("<scrip t type=\"t ext/javasc ript\" lan guage=\"Ja vaScript1. 2\" src=\" " + WWHFra me.WWHHelp .mHelpURLP refix + "w whelp/wwhi mpl/js/scr ipts/searc h2s.js" + VarParamet ers + "\"> </script>\ n"); | |||
277 | } | 277 | } | |||
278 | 278 | |||||
279 | HT ML.fAppend ("<script type=\"tex t/javascri pt\" langu age=\"Java Script1.2\ " src=\"" + WWHFrame .WWHHelp.m HelpURLPre fix + "wwh elp/wwhimp l/js/scrip ts/search3 s.js" + Va rParameter s + "\"></ script>\n" ); | 279 | HT ML.fAppend ("<script type=\"tex t/javascri pt\" langu age=\"Java Script1.2\ " src=\"" + WWHFrame .WWHHelp.m HelpURLPre fix + "wwh elp/wwhimp l/js/scrip ts/search3 s.js" + Va rParameter s + "\"></ script>\n" ); | |||
280 | } | 280 | } | |||
281 | 281 | |||||
282 | HTML .fAppend(" <script ty pe=\"text/ javascript \" languag e=\"JavaSc ript1.2\" src=\"" + WWHFrame.W WHHelp.mHe lpURLPrefi x + "wwhel p/wwhimpl/ js/scripts /search4s. js" + VarP arameters + "\"></sc ript>\n"); | 282 | HTML .fAppend(" <script ty pe=\"text/ javascript \" languag e=\"JavaSc ript1.2\" src=\"" + WWHFrame.W WHHelp.mHe lpURLPrefi x + "wwhel p/wwhimpl/ js/scripts /search4s. js" + VarP arameters + "\"></sc ript>\n"); | |||
283 | } | 283 | } | |||
284 | else i f (this.mS earchState == "pairs ") | 284 | else i f (this.mS earchState == "pairs ") | |||
285 | { | 285 | { | |||
286 | // D isplay sea rching mes sage | 286 | // D isplay sea rching mes sage | |||
287 | // | 287 | // | |||
288 | HTML .fAppend(" <h2>" + WW HFrame.WWH JavaScript .mMessages .mSearchSe archingMes sage + "</ h2>\n"); | 288 | HTML .fAppend(" <h2>" + WW HFrame.WWH JavaScript .mMessages .mSearchSe archingMes sage + "</ h2>\n"); | |||
289 | 289 | |||||
290 | Book List = WWH Frame.WWHH elp.mBooks .mBookList ; | 290 | Book List = WWH Frame.WWHH elp.mBooks .mBookList ; | |||
291 | 291 | |||||
292 | // G enerate se arch actio ns | 292 | // G enerate se arch actio ns | |||
293 | // | 293 | // | |||
294 | for (MaxIndex = this.mCo mbinedResu lts.mEntri es.length, Index = 0 ; Index < MaxIndex ; Index++) | 294 | for (MaxIndex = this.mCo mbinedResu lts.mEntri es.length, Index = 0 ; Index < MaxIndex ; Index++) | |||
295 | { | 295 | { | |||
296 | En try = this .mCombined Results.mE ntries[Ind ex]; | 296 | En try = this .mCombined Results.mE ntries[Ind ex]; | |||
297 | 297 | |||||
298 | Mu ltiPhraseE ntry = thi s.mMultiPh raseList[E ntry.mBook Index]; | 298 | Mu ltiPhraseE ntry = thi s.mMultiPh raseList[E ntry.mBook Index]; | |||
299 | if (MultiPhr aseEntry.f PhraseCoun t() > 0) | 299 | if (MultiPhr aseEntry.f PhraseCoun t() > 0) | |||
300 | { | 300 | { | |||
301 | BookDirect ory = Book List[Entry .mBookInde x].mDirect ory; | 301 | BookDirect ory = Book List[Entry .mBookInde x].mDirect ory; | |||
302 | 302 | |||||
303 | HTML.fAppe nd("<scrip t type=\"tex t/javascri pt\" language=\ "JavaScrip t1.2\" src=\"" + WWHFrame.W WHHelp.mHe lpURLPrefi x + WWHFrame.W WHBrowser. fRestoreEs capedSpace s( BookDirect ory ) + "wwhdata/j s/search/p airs/pair" + Entry.mFil eIndex + ".js" + VarParamet ers + "\"></scri pt>\n"); | 303 |
HTML.fAppe
nd("<scrip
t
type=\"tex
t/javascri
pt\"
language=\
"JavaScrip
t1.2\"
src=\""
+
WWHFrame.W
WHHelp.mHe
lpURLPrefi
x
+
|
|||
304 | HTML.fAppe nd("<scrip t type=\"t ext/javasc ript\" lan guage=\"Ja vaScript1. 2\" src=\" " + WWHFra me.WWHHelp .mHelpURLP refix + "w whelp/wwhi mpl/js/scr ipts/searc h5s.js" + VarParamet ers + "\"> </script>\ n"); | 304 | HTML.fAppe nd("<scrip t type=\"t ext/javasc ript\" lan guage=\"Ja vaScript1. 2\" src=\" " + WWHFra me.WWHHelp .mHelpURLP refix + "w whelp/wwhi mpl/js/scr ipts/searc h5s.js" + VarParamet ers + "\"> </script>\ n"); | |||
305 | } | 305 | } | |||
306 | 306 | |||||
307 | HT ML.fAppend ("<script type=\"tex t/javascri pt\" langu age=\"Java Script1.2\ " src=\"" + WWHFrame .WWHHelp.m HelpURLPre fix + "wwh elp/wwhimp l/js/scrip ts/search6 s.js" + Va rParameter s + "\"></ script>\n" ); | 307 | HT ML.fAppend ("<script type=\"tex t/javascri pt\" langu age=\"Java Script1.2\ " src=\"" + WWHFrame .WWHHelp.m HelpURLPre fix + "wwh elp/wwhimp l/js/scrip ts/search6 s.js" + Va rParameter s + "\"></ script>\n" ); | |||
308 | } | 308 | } | |||
309 | 309 | |||||
310 | HTML .fAppend(" <script ty pe=\"text/ javascript \" languag e=\"JavaSc ript1.2\" src=\"" + WWHFrame.W WHHelp.mHe lpURLPrefi x + "wwhel p/wwhimpl/ js/scripts /search7s. js" + VarP arameters + "\"></sc ript>\n"); | 310 | HTML .fAppend(" <script ty pe=\"text/ javascript \" languag e=\"JavaSc ript1.2\" src=\"" + WWHFrame.W WHHelp.mHe lpURLPrefi x + "wwhel p/wwhimpl/ js/scripts /search7s. js" + VarP arameters + "\"></sc ript>\n"); | |||
311 | } | 311 | } | |||
312 | else | 312 | else | |||
313 | { | 313 | { | |||
314 | // D efine acce ssor funct ions to re duce file size | 314 | // D efine acce ssor funct ions to re duce file size | |||
315 | // | 315 | // | |||
316 | HTML .fAppend(" <script ty pe=\"text/ javascript \" languag e=\"JavaSc ript1.2\"> \n"); | 316 | HTML .fAppend(" <script ty pe=\"text/ javascript \" languag e=\"JavaSc ript1.2\"> \n"); | |||
317 | HTML .fAppend(" <!--\n"); | 317 | HTML .fAppend(" <!--\n"); | |||
318 | HTML .fAppend(" function fC(Param EntryID)\n "); | 318 | HTML .fAppend(" function fC(Param EntryID)\n "); | |||
319 | HTML .fAppend(" {\n"); | 319 | HTML .fAppend(" {\n"); | |||
320 | HTML .fAppend(" WWHFra me.WWHSear ch.fShowEn try(ParamE ntryID);\n "); | 320 | HTML .fAppend(" WWHFra me.WWHSear ch.fShowEn try(ParamE ntryID);\n "); | |||
321 | HTML .fAppend(" }\n"); | 321 | HTML .fAppend(" }\n"); | |||
322 | HTML .fAppend(" \n"); | 322 | HTML .fAppend(" \n"); | |||
323 | HTML .fAppend(" function fS(Param EntryID,\n "); | 323 | HTML .fAppend(" function fS(Param EntryID,\n "); | |||
324 | HTML .fAppend(" Param Event)\n") ; | 324 | HTML .fAppend(" Param Event)\n") ; | |||
325 | HTML .fAppend(" {\n"); | 325 | HTML .fAppend(" {\n"); | |||
326 | HTML .fAppend(" WWHFra me.WWHJava Script.mPa nels.mPopu p.fShow(Pa ramEntryID , ParamEve nt);\n"); | 326 | HTML .fAppend(" WWHFra me.WWHJava Script.mPa nels.mPopu p.fShow(Pa ramEntryID , ParamEve nt);\n"); | |||
327 | HTML .fAppend(" }\n"); | 327 | HTML .fAppend(" }\n"); | |||
328 | HTML .fAppend(" \n"); | 328 | HTML .fAppend(" \n"); | |||
329 | HTML .fAppend(" function fH()\n") ; | 329 | HTML .fAppend(" function fH()\n") ; | |||
330 | HTML .fAppend(" {\n"); | 330 | HTML .fAppend(" {\n"); | |||
331 | HTML .fAppend(" WWHFra me.WWHJava Script.mPa nels.mPopu p.fHide(); \n"); | 331 | HTML .fAppend(" WWHFra me.WWHJava Script.mPa nels.mPopu p.fHide(); \n"); | |||
332 | HTML .fAppend(" }\n"); | 332 | HTML .fAppend(" }\n"); | |||
333 | HTML .fAppend(" // -->\n" ); | 333 | HTML .fAppend(" // -->\n" ); | |||
334 | HTML .fAppend(" </script>\ n"); | 334 | HTML .fAppend(" </script>\ n"); | |||
335 | 335 | |||||
336 | // D isplay sea rch messag e and/or p repare res ults for d isplay | 336 | // D isplay sea rch messag e and/or p repare res ults for d isplay | |||
337 | // | 337 | // | |||
338 | if ( this.mSave dSearchWor ds.length == 0) | 338 | if ( this.mSave dSearchWor ds.length == 0) | |||
339 | { | 339 | { | |||
340 | HT ML.fAppend ("<h3>" + WWHFrame.W WHJavaScri pt.mMessag es.mSearch DefaultMes sage + "</ h3>\n"); | 340 | HT ML.fAppend ("<h3>" + WWHFrame.W WHJavaScri pt.mMessag es.mSearch DefaultMes sage + "</ h3>\n"); | |||
341 | } | 341 | } | |||
342 | else if ((type of(this.mC ombinedRes ults.mEntr ies) != "u ndefined") && | 342 | else if ((type of(this.mC ombinedRes ults.mEntr ies) != "u ndefined") && | |||
343 | (this .mCombined Results.mE ntries.len gth > 0)) | 343 | (this .mCombined Results.mE ntries.len gth > 0)) | |||
344 | { | 344 | { | |||
345 | // Determine if book n ame should be displa yed about results | 345 | // Determine if book n ame should be displa yed about results | |||
346 | // | 346 | // | |||
347 | if ((WWHFram e.WWHHelp. mBooks.mBo okList.len gth == 1) || | 347 | if ((WWHFram e.WWHHelp. mBooks.mBo okList.len gth == 1) || | |||
348 | ((this.m SavedSearc hScope > 0 ) && | 348 | ((this.m SavedSearc hScope > 0 ) && | |||
349 | (this.m SearchScop eInfo.mEnt ries[this. mSavedSear chScope - 1].mStartB ookIndex = = this.mSe archScopeI nfo.mEntri es[this.mS avedSearch Scope - 1] .mEndBookI ndex))) | 349 | (this.m SearchScop eInfo.mEnt ries[this. mSavedSear chScope - 1].mStartB ookIndex = = this.mSe archScopeI nfo.mEntri es[this.mS avedSearch Scope - 1] .mEndBookI ndex))) | |||
350 | { | 350 | { | |||
351 | // Single book scope selected, do not di splay book titles | 351 | // Single book scope selected, do not di splay book titles | |||
352 | // | 352 | // | |||
353 | bDisplayBo okTitles = false; | 353 | bDisplayBo okTitles = false; | |||
354 | } | 354 | } | |||
355 | el se | 355 | el se | |||
356 | { | 356 | { | |||
357 | // More th an one boo k in searc h scope, d isplay boo k titles | 357 | // More th an one boo k in searc h scope, d isplay boo k titles | |||
358 | // | 358 | // | |||
359 | bDisplayBo okTitles = true; | 359 | bDisplayBo okTitles = true; | |||
360 | } | 360 | } | |||
361 | 361 | |||||
362 | th is.mCombin edResults. fDisplayRe set(bDispl ayBookTitl es); | 362 | th is.mCombin edResults. fDisplayRe set(bDispl ayBookTitl es); | |||
363 | } | 363 | } | |||
364 | else | 364 | else | |||
365 | { | 365 | { | |||
366 | HT ML.fAppend ("<h3>" + WWHFrame.W WHJavaScri pt.mMessag es.mSearch NothingFou ndMessage + "</h3>\n "); | 366 | HT ML.fAppend ("<h3>" + WWHFrame.W WHJavaScri pt.mMessag es.mSearch NothingFou ndMessage + "</h3>\n "); | |||
367 | } | 367 | } | |||
368 | } | 368 | } | |||
369 | } | 369 | } | |||
370 | 370 | |||||
371 | return H TML.fGetBu ffer(); | 371 | return H TML.fGetBu ffer(); | |||
372 | } | 372 | } | |||
373 | 373 | |||||
374 | function WWHSearch_ AdvanceHTM LSegment() | 374 | function WWHSearch_ AdvanceHTM LSegment() | |||
375 | { | 375 | { | |||
376 | var bSe gmentCreat ed = false ; | 376 | var bSe gmentCreat ed = false ; | |||
377 | 377 | |||||
378 | 378 | |||||
379 | if (this .mbPanelIn itialized) | 379 | if (this .mbPanelIn itialized) | |||
380 | { | 380 | { | |||
381 | if (th is.mSearch State == n ull) | 381 | if (th is.mSearch State == n ull) | |||
382 | { | 382 | { | |||
383 | bSeg mentCreate d = this.m CombinedRe sults.fDis playAdvanc e(); | 383 | bSeg mentCreate d = this.m CombinedRe sults.fDis playAdvanc e(); | |||
384 | } | 384 | } | |||
385 | } | 385 | } | |||
386 | 386 | |||||
387 | return b SegmentCre ated; | 387 | return b SegmentCre ated; | |||
388 | } | 388 | } | |||
389 | 389 | |||||
390 | function WWHSearch_ GetHTMLSeg ment() | 390 | function WWHSearch_ GetHTMLSeg ment() | |||
391 | { | 391 | { | |||
392 | return t his.mCombi nedResults .mHTMLSegm ent.fGetBu ffer(); | 392 | return t his.mCombi nedResults .mHTMLSegm ent.fGetBu ffer(); | |||
393 | } | 393 | } | |||
394 | 394 | |||||
395 | function WWHSearch_ EndHTMLSeg ments() | 395 | function WWHSearch_ EndHTMLSeg ments() | |||
396 | { | 396 | { | |||
397 | return " "; | 397 | return " "; | |||
398 | } | 398 | } | |||
399 | 399 | |||||
400 | function WWHSearch_ PanelNavig ationLoade d() | 400 | function WWHSearch_ PanelNavig ationLoade d() | |||
401 | { | 401 | { | |||
402 | // Set f ocus | 402 | // Set f ocus | |||
403 | // | 403 | // | |||
404 | WWHFrame .WWHHelp.f Focus("WWH PanelNavig ationFrame "); | 404 | WWHFrame .WWHHelp.f Focus("WWH PanelNavig ationFrame "); | |||
405 | } | 405 | } | |||
406 | 406 | |||||
407 | function WWHSearch_ PanelViewL oaded() | 407 | function WWHSearch_ PanelViewL oaded() | |||
408 | { | 408 | { | |||
409 | // Displ ay search results if necessary | 409 | // Displ ay search results if necessary | |||
410 | // | 410 | // | |||
411 | if (this .mSearchSt ate == "wo rds") | 411 | if (this .mSearchSt ate == "wo rds") | |||
412 | { | 412 | { | |||
413 | this.m SearchStat e = "pairs "; | 413 | this.m SearchStat e = "pairs "; | |||
414 | 414 | |||||
415 | WWHFra me.WWHJava Script.mPa nels.fRelo adView(); | 415 | WWHFra me.WWHJava Script.mPa nels.fRelo adView(); | |||
416 | } | 416 | } | |||
417 | else if (this.mSea rchState = = "pairs") | 417 | else if (this.mSea rchState = = "pairs") | |||
418 | { | 418 | { | |||
419 | this.m SearchStat e = null; | 419 | this.m SearchStat e = null; | |||
420 | 420 | |||||
421 | WWHFra me.WWHJava Script.mPa nels.fRelo adView(); | 421 | WWHFra me.WWHJava Script.mPa nels.fRelo adView(); | |||
422 | } | 422 | } | |||
423 | } | 423 | } | |||
424 | 424 | |||||
425 | function WWHSearch_ HoverTextT ranslate(P aramEntryI D) | 425 | function WWHSearch_ HoverTextT ranslate(P aramEntryI D) | |||
426 | { | 426 | { | |||
427 | var HTM L = "" ; | 427 | var HTM L = "" ; | |||
428 | var Boo kList = WW HFrame.WWH Help.mBook s.mBookLis t; | 428 | var Boo kList = WW HFrame.WWH Help.mBook s.mBookLis t; | |||
429 | var Set tings = WW HFrame.WWH JavaScript .mSettings .mSearch; | 429 | var Set tings = WW HFrame.WWH JavaScript .mSettings .mSearch; | |||
430 | var Mes sages = WW HFrame.WWH JavaScript .mMessages ; | 430 | var Mes sages = WW HFrame.WWH JavaScript .mMessages ; | |||
431 | var Ent ry; | 431 | var Ent ry; | |||
432 | var Ran k = ""; | 432 | var Ran k = ""; | |||
433 | var Tit le; | 433 | var Tit le; | |||
434 | var Boo k = ""; | 434 | var Boo k = ""; | |||
435 | var For mat; | 435 | var For mat; | |||
436 | 436 | |||||
437 | 437 | |||||
438 | // Retri eve specif ied entry | 438 | // Retri eve specif ied entry | |||
439 | // | 439 | // | |||
440 | Entry = this.mComb inedResult s.mEntries [ParamEntr yID]; | 440 | Entry = this.mComb inedResult s.mEntries [ParamEntr yID]; | |||
441 | 441 | |||||
442 | // Get R ank | 442 | // Get R ank | |||
443 | // | 443 | // | |||
444 | if (Sett ings.mbSho wRank) | 444 | if (Sett ings.mbSho wRank) | |||
445 | { | 445 | { | |||
446 | Rank = Math.floo r((Entry.m Score / th is.mCombin edResults. mMaxScore) * 100) + "%"; | 446 | Rank = Math.floo r((Entry.m Score / th is.mCombin edResults. mMaxScore) * 100) + "%"; | |||
447 | } | 447 | } | |||
448 | 448 | |||||
449 | // Get T itle | 449 | // Get T itle | |||
450 | // | 450 | // | |||
451 | Title = Entry.mTit le; | 451 | Title = Entry.mTit le; | |||
452 | 452 | |||||
453 | // Get B ook | 453 | // Get B ook | |||
454 | // | 454 | // | |||
455 | if ((Boo kList.leng th > 1) && // More than one book e xists | 455 | if ((Boo kList.leng th > 1) && // More than one book e xists | |||
456 | (thi s.mCombine dResults.m SortedBy = = 1)) // By Score | 456 | (thi s.mCombine dResults.m SortedBy = = 1)) // By Score | |||
457 | { | 457 | { | |||
458 | Book = BookList[ Entry.mBoo kIndex].mT itle; | 458 | Book = BookList[ Entry.mBoo kIndex].mT itle; | |||
459 | } | 459 | } | |||
460 | 460 | |||||
461 | // Forma t for disp lay | 461 | // Forma t for disp lay | |||
462 | // | 462 | // | |||
463 | if ((Ran k.length = = 0) && | 463 | if ((Ran k.length = = 0) && | |||
464 | (Boo k.length = = 0)) | 464 | (Boo k.length = = 0)) | |||
465 | { | 465 | { | |||
466 | // Sim ple format , just the title | 466 | // Sim ple format , just the title | |||
467 | // | 467 | // | |||
468 | HTML = Title; | 468 | HTML = Title; | |||
469 | } | 469 | } | |||
470 | else | 470 | else | |||
471 | { | 471 | { | |||
472 | Format = " align =\"left\" valign=\"t op\"><span style=\"" + WWHFram e.WWHJavaS cript.mSet tings.mHov erText.mFo ntStyle + "\">"; | 472 | Format = " align =\"left\" valign=\"t op\"><span style=\"" + WWHFram e.WWHJavaS cript.mSet tings.mHov erText.mFo ntStyle + "\">"; | |||
473 | 473 | |||||
474 | // Com plex forma t, require s a table | 474 | // Com plex forma t, require s a table | |||
475 | // | 475 | // | |||
476 | HTML + = "<table width=\"10 0%\" borde r=\"0\" ce llpadding= \"4\" cell spacing=\" 0\">"; | 476 | HTML + = "<table width=\"10 0%\" borde r=\"0\" ce llpadding= \"4\" cell spacing=\" 0\">"; | |||
477 | if (Ra nk.length > 0) | 477 | if (Ra nk.length > 0) | |||
478 | { | 478 | { | |||
479 | HTML += "<tr>" ; | 479 | HTML += "<tr>" ; | |||
480 | HTML += "<th" + Format + Messages. mSearchRan kLabel + " </span></t h>"; | 480 | HTML += "<th" + Format + Messages. mSearchRan kLabel + " </span></t h>"; | |||
481 | HTML += "<td" + Format + Rank + "< /span></td >"; | 481 | HTML += "<td" + Format + Rank + "< /span></td >"; | |||
482 | HTML += "</tr> "; | 482 | HTML += "</tr> "; | |||
483 | } | 483 | } | |||
484 | HTML + = "<tr>"; | 484 | HTML + = "<tr>"; | |||
485 | HTML + = "<th" + Format + M essages.mS earchTitle Label + "< /span></th >"; | 485 | HTML + = "<th" + Format + M essages.mS earchTitle Label + "< /span></th >"; | |||
486 | HTML + = "<td" + Format + T itle + "</ span></td> "; | 486 | HTML + = "<td" + Format + T itle + "</ span></td> "; | |||
487 | HTML + = "</tr>"; | 487 | HTML + = "</tr>"; | |||
488 | if (Bo ok.length > 0) | 488 | if (Bo ok.length > 0) | |||
489 | { | 489 | { | |||
490 | HTML += "<tr>" ; | 490 | HTML += "<tr>" ; | |||
491 | HTML += "<th" + Format + Messages. mSearchBoo kLabel + " </span></t h>"; | 491 | HTML += "<th" + Format + Messages. mSearchBoo kLabel + " </span></t h>"; | |||
492 | HTML += "<td" + Format + Book + "< /span></td >"; | 492 | HTML += "<td" + Format + Book + "< /span></td >"; | |||
493 | HTML += "</tr> "; | 493 | HTML += "</tr> "; | |||
494 | } | 494 | } | |||
495 | HTML + = "</table >"; | 495 | HTML + = "</table >"; | |||
496 | 496 | |||||
497 | // IE 5.0 on the Macintosh drops the last tabl e for some reason | 497 | // IE 5.0 on the Macintosh drops the last tabl e for some reason | |||
498 | // | 498 | // | |||
499 | if (WW HFrame.WWH Browser.mb MacIE50) | 499 | if (WW HFrame.WWH Browser.mb MacIE50) | |||
500 | { | 500 | { | |||
501 | HTML += "<tabl e><tr><td> </td></tr> </table>"; | 501 | HTML += "<tabl e><tr><td> </td></tr> </table>"; | |||
502 | } | 502 | } | |||
503 | } | 503 | } | |||
504 | 504 | |||||
505 | return H TML; | 505 | return H TML; | |||
506 | } | 506 | } | |||
507 | 507 | |||||
508 | function WWHSearch_ HoverTextF ormat(Para mWidth, | 508 | function WWHSearch_ HoverTextF ormat(Para mWidth, | |||
509 | Para mTextID, | 509 | Para mTextID, | |||
510 | Para mText) | 510 | Para mText) | |||
511 | { | 511 | { | |||
512 | var For mattedText = ""; | 512 | var For mattedText = ""; | |||
513 | var For egroundCol or = WWHFr ame.WWHJav aScript.mS ettings.mH overText.m Foreground Color; | 513 | var For egroundCol or = WWHFr ame.WWHJav aScript.mS ettings.mH overText.m Foreground Color; | |||
514 | var Bac kgroundCol or = WWHFr ame.WWHJav aScript.mS ettings.mH overText.m Background Color; | 514 | var Bac kgroundCol or = WWHFr ame.WWHJav aScript.mS ettings.mH overText.m Background Color; | |||
515 | var Bor derColor = WWHFr ame.WWHJav aScript.mS ettings.mH overText.m BorderColo r; | 515 | var Bor derColor = WWHFr ame.WWHJav aScript.mS ettings.mH overText.m BorderColo r; | |||
516 | var Ima geDir = WWHFr ame.WWHHel p.mHelpURL Prefix + " wwhelp/wwh impl/commo n/images"; | 516 | var Ima geDir = WWHFr ame.WWHHel p.mHelpURL Prefix + " wwhelp/wwh impl/commo n/images"; | |||
517 | var Req Spacer1w2h = "<img src=\"" + ImageDir + "/spc1w2 h.gif\" wi dth=1 heig ht=2 alt=\ "\">"; | 517 | var Req Spacer1w2h = "<img src=\"" + ImageDir + "/spc1w2 h.gif\" wi dth=1 heig ht=2 alt=\ "\">"; | |||
518 | var Req Spacer2w1h = "<img src=\"" + ImageDir + "/spc2w1 h.gif\" wi dth=2 heig ht=1 alt=\ "\">"; | 518 | var Req Spacer2w1h = "<img src=\"" + ImageDir + "/spc2w1 h.gif\" wi dth=2 heig ht=1 alt=\ "\">"; | |||
519 | var Req Spacer1w7h = "<img src=\"" + ImageDir + "/spc1w7 h.gif\" wi dth=1 heig ht=7 alt=\ "\">"; | 519 | var Req Spacer1w7h = "<img src=\"" + ImageDir + "/spc1w7 h.gif\" wi dth=1 heig ht=7 alt=\ "\">"; | |||
520 | var Req Spacer5w1h = "<img src=\"" + ImageDir + "/spc5w1 h.gif\" wi dth=5 heig ht=1 alt=\ "\">"; | 520 | var Req Spacer5w1h = "<img src=\"" + ImageDir + "/spc5w1 h.gif\" wi dth=5 heig ht=1 alt=\ "\">"; | |||
521 | var Spa cer1w2h = ReqSp acer1w2h; | 521 | var Spa cer1w2h = ReqSp acer1w2h; | |||
522 | var Spa cer2w1h = ReqSp acer2w1h; | 522 | var Spa cer2w1h = ReqSp acer2w1h; | |||
523 | var Spa cer1w7h = ReqSp acer1w7h; | 523 | var Spa cer1w7h = ReqSp acer1w7h; | |||
524 | var Spa cer5w1h = ReqSp acer5w1h; | 524 | var Spa cer5w1h = ReqSp acer5w1h; | |||
525 | var Sty leAtttribu te; | 525 | var Sty leAtttribu te; | |||
526 | 526 | |||||
527 | 527 | |||||
528 | // Set s tyle attri bute to in sure small image hei ght | 528 | // Set s tyle attri bute to in sure small image hei ght | |||
529 | // | 529 | // | |||
530 | StyleAtt ribute = " style=\"f ont-size: 1px; line- height: 1p x;\""; | 530 | StyleAtt ribute = " style=\"f ont-size: 1px; line- height: 1p x;\""; | |||
531 | 531 | |||||
532 | Formatte dText += " <table wid th=\"" + P aramWidth + "\" bord er=0 cells pacing=0 c ellpadding =0 bgcolor =\"" + Bac kgroundCol or + "\">" ; | 532 | Formatte dText += " <table wid th=\"" + P aramWidth + "\" bord er=0 cells pacing=0 c ellpadding =0 bgcolor =\"" + Bac kgroundCol or + "\">" ; | |||
533 | Formatte dText += " <tr>"; | 533 | Formatte dText += " <tr>"; | |||
534 | Formatte dText += " <td" + S tyleAttrib ute + " he ight=2 col span=5 bgc olor=\"" + BorderCol or + "\">" + Spacer1 w2h + "</t d>"; | 534 | Formatte dText += " <td" + S tyleAttrib ute + " he ight=2 col span=5 bgc olor=\"" + BorderCol or + "\">" + Spacer1 w2h + "</t d>"; | |||
535 | Formatte dText += " </tr>"; | 535 | Formatte dText += " </tr>"; | |||
536 | 536 | |||||
537 | Formatte dText += " <tr>"; | 537 | Formatte dText += " <tr>"; | |||
538 | Formatte dText += " <td" + S tyleAttrib ute + " he ight=7 bgc olor=\"" + BorderCol or + "\">" + Spacer2 w1h + "</t d>"; | 538 | Formatte dText += " <td" + S tyleAttrib ute + " he ight=7 bgc olor=\"" + BorderCol or + "\">" + Spacer2 w1h + "</t d>"; | |||
539 | Formatte dText += " <td" + S tyleAttrib ute + " he ight=7 col span=3>" + Spacer1w7 h + "</td> "; | 539 | Formatte dText += " <td" + S tyleAttrib ute + " he ight=7 col span=3>" + Spacer1w7 h + "</td> "; | |||
540 | Formatte dText += " <td" + S tyleAttrib ute + " he ight=7 bgc olor=\"" + BorderCol or + "\">" + Spacer2 w1h + "</t d>"; | 540 | Formatte dText += " <td" + S tyleAttrib ute + " he ight=7 bgc olor=\"" + BorderCol or + "\">" + Spacer2 w1h + "</t d>"; | |||
541 | Formatte dText += " </tr>"; | 541 | Formatte dText += " </tr>"; | |||
542 | 542 | |||||
543 | Formatte dText += " <tr>"; | 543 | Formatte dText += " <tr>"; | |||
544 | Formatte dText += " <td bgco lor=\"" + BorderColo r + "\">" + ReqSpace r2w1h + "< /td>"; | 544 | Formatte dText += " <td bgco lor=\"" + BorderColo r + "\">" + ReqSpace r2w1h + "< /td>"; | |||
545 | Formatte dText += " <td>" + ReqSpacer5 w1h + "</t d>"; | 545 | Formatte dText += " <td>" + ReqSpacer5 w1h + "</t d>"; | |||
546 | Formatte dText += " <td widt h=\"100%\" id=\"" + ParamTextI D + "\" st yle=\"colo r: " + For egroundCol or + " ; " + WWHFram e.WWHJavaS cript.mSet tings.mHov erText.mFo ntStyle + "\">" + Pa ramText + "</td>"; | 546 | Formatte dText += " <td widt h=\"100%\" id=\"" + ParamTextI D + "\" st yle=\"colo r: " + For egroundCol or + " ; " + WWHFram e.WWHJavaS cript.mSet tings.mHov erText.mFo ntStyle + "\">" + Pa ramText + "</td>"; | |||
547 | Formatte dText += " <td>" + ReqSpacer5 w1h + "</t d>"; | 547 | Formatte dText += " <td>" + ReqSpacer5 w1h + "</t d>"; | |||
548 | Formatte dText += " <td bgco lor=\"" + BorderColo r + "\">" + ReqSpace r2w1h + "< /td>"; | 548 | Formatte dText += " <td bgco lor=\"" + BorderColo r + "\">" + ReqSpace r2w1h + "< /td>"; | |||
549 | Formatte dText += " </tr>"; | 549 | Formatte dText += " </tr>"; | |||
550 | 550 | |||||
551 | Formatte dText += " <tr>"; | 551 | Formatte dText += " <tr>"; | |||
552 | Formatte dText += " <td" + S tyleAttrib ute + " he ight=7 bgc olor=\"" + BorderCol or + "\">" + Spacer2 w1h + "</t d>"; | 552 | Formatte dText += " <td" + S tyleAttrib ute + " he ight=7 bgc olor=\"" + BorderCol or + "\">" + Spacer2 w1h + "</t d>"; | |||
553 | Formatte dText += " <td" + S tyleAttrib ute + " he ight=7 col span=3>" + Spacer1w7 h + "</td> "; | 553 | Formatte dText += " <td" + S tyleAttrib ute + " he ight=7 col span=3>" + Spacer1w7 h + "</td> "; | |||
554 | Formatte dText += " <td" + S tyleAttrib ute + " he ight=7 bgc olor=\"" + BorderCol or + "\">" + Spacer2 w1h + "</t d>"; | 554 | Formatte dText += " <td" + S tyleAttrib ute + " he ight=7 bgc olor=\"" + BorderCol or + "\">" + Spacer2 w1h + "</t d>"; | |||
555 | Formatte dText += " </tr>"; | 555 | Formatte dText += " </tr>"; | |||
556 | 556 | |||||
557 | Formatte dText += " <tr>"; | 557 | Formatte dText += " <tr>"; | |||
558 | Formatte dText += " <td" + S tyleAttrib ute + " he ight=2 col span=5 bgc olor=\"" + BorderCol or + "\">" + Spacer1 w2h + "</t d>"; | 558 | Formatte dText += " <td" + S tyleAttrib ute + " he ight=2 col span=5 bgc olor=\"" + BorderCol or + "\">" + Spacer1 w2h + "</t d>"; | |||
559 | Formatte dText += " </tr>"; | 559 | Formatte dText += " </tr>"; | |||
560 | Formatte dText += " </table>"; | 560 | Formatte dText += " </table>"; | |||
561 | 561 | |||||
562 | return F ormattedTe xt; | 562 | return F ormattedTe xt; | |||
563 | } | 563 | } | |||
564 | 564 | |||||
565 | function WWHSearch_ DisplaySea rchForm() | 565 | function WWHSearch_ DisplaySea rchForm() | |||
566 | { | 566 | { | |||
567 | var HTM L = ""; | 567 | var HTM L = ""; | |||
568 | var Boo kList = WW HFrame.WWH Help.mBook s.mBookLis t; | 568 | var Boo kList = WW HFrame.WWH Help.mBook s.mBookLis t; | |||
569 | var Sel ectedIndex ; | 569 | var Sel ectedIndex ; | |||
570 | var Max Index; | 570 | var Max Index; | |||
571 | var Ind ex; | 571 | var Ind ex; | |||
572 | var Sea rchScopeEn try; | 572 | var Sea rchScopeEn try; | |||
573 | var Max Level; | 573 | var Max Level; | |||
574 | var Lev el; | 574 | var Lev el; | |||
575 | 575 | |||||
576 | 576 | |||||
577 | HTML += "<form nam e=\"WWHSea rchForm\" onsubmit=\ "WWHFrame. WWHSearch. fSubmit(); \">\n"; | 577 | HTML += "<form nam e=\"WWHSea rchForm\" onsubmit=\ "WWHFrame. WWHSearch. fSubmit(); \">\n"; | |||
578 | HTML += "<nobr>\n" ; | 578 | HTML += "<nobr>\n" ; | |||
579 | HTML += "<input ty pe=\"text\ " name=\"W WHSearchWo rdsText\" size=\"20\ " value=\" " + WWHStr ingUtiliti es_EscapeH TML(this.m SavedSearc hWords) + "\" onkeyd own=\"WWHF rame.WWHHe lp.fIgnore NextKeyPre ss((docume nt.all||do cument.get ElementByI d||documen t.layers)? event:null );\">\n"; | 579 | HTML += "<input ty pe=\"text\ " name=\"W WHSearchWo rdsText\" size=\"20\ " value=\" " + WWHStr ingUtiliti es_EscapeH TML(this.m SavedSearc hWords) + "\" onkeyd own=\"WWHF rame.WWHHe lp.fIgnore NextKeyPre ss((docume nt.all||do cument.get ElementByI d||documen t.layers)? event:null );\">\n"; | |||
580 | HTML += "<input ty pe=\"submi t\" value= \"" + WWHF rame.WWHJa vaScript.m Messages.m SearchButt onLabel + "\">\n"; | 580 | HTML += "<input ty pe=\"submi t\" value= \"" + WWHF rame.WWHJa vaScript.m Messages.m SearchButt onLabel + "\">\n"; | |||
581 | HTML += "</nobr>\n "; | 581 | HTML += "</nobr>\n "; | |||
582 | 582 | |||||
583 | if (Book List.lengt h > 1) | 583 | if (Book List.lengt h > 1) | |||
584 | { | 584 | { | |||
585 | Select edIndex = this.mSave dSearchSco pe - 1; | 585 | Select edIndex = this.mSave dSearchSco pe - 1; | |||
586 | 586 | |||||
587 | HTML + = "<br>\n" ; | 587 | HTML + = "<br>\n" ; | |||
588 | HTML + = "<select name=\"WW HSearchSco pe\">\n"; | 588 | HTML + = "<select name=\"WW HSearchSco pe\">\n"; | |||
589 | HTML + = "<option >" + WWHFr ame.WWHJav aScript.mM essages.mS earchScope AllLabel + "</option >\n"; | 589 | HTML + = "<option >" + WWHFr ame.WWHJav aScript.mM essages.mS earchScope AllLabel + "</option >\n"; | |||
590 | for (M axIndex = this.mSear chScopeInf o.mEntries .length, I ndex = 0 ; Index < M axIndex ; Index++) | 590 | for (M axIndex = this.mSear chScopeInf o.mEntries .length, I ndex = 0 ; Index < M axIndex ; Index++) | |||
591 | { | 591 | { | |||
592 | // A ccess curr ent search scope ent ry | 592 | // A ccess curr ent search scope ent ry | |||
593 | // | 593 | // | |||
594 | Sear chScopeEnt ry = this. mSearchSco peInfo.mEn tries[Inde x]; | 594 | Sear chScopeEnt ry = this. mSearchSco peInfo.mEn tries[Inde x]; | |||
595 | 595 | |||||
596 | // R estore sel ection | 596 | // R estore sel ection | |||
597 | // | 597 | // | |||
598 | if ( Index == S electedInd ex) | 598 | if ( Index == S electedInd ex) | |||
599 | { | 599 | { | |||
600 | HT ML += "<op tion selec ted>"; | 600 | HT ML += "<op tion selec ted>"; | |||
601 | } | 601 | } | |||
602 | else | 602 | else | |||
603 | { | 603 | { | |||
604 | HT ML += "<op tion>"; | 604 | HT ML += "<op tion>"; | |||
605 | } | 605 | } | |||
606 | 606 | |||||
607 | // I ndent to s how differ ent levels | 607 | // I ndent to s how differ ent levels | |||
608 | // | 608 | // | |||
609 | for (MaxLevel = SearchSc opeEntry.m Level, Lev el = 0 ; L evel < Max Level ; Le vel++) | 609 | for (MaxLevel = SearchSc opeEntry.m Level, Lev el = 0 ; L evel < Max Level ; Le vel++) | |||
610 | { | 610 | { | |||
611 | HT ML += "- " ; | 611 | HT ML += "- " ; | |||
612 | } | 612 | } | |||
613 | 613 | |||||
614 | // C lose out e ntry | 614 | // C lose out e ntry | |||
615 | // | 615 | // | |||
616 | HTML += Search ScopeEntry .mTitle + "</option> \n"; | 616 | HTML += Search ScopeEntry .mTitle + "</option> \n"; | |||
617 | } | 617 | } | |||
618 | HTML + = "</selec t>\n"; | 618 | HTML + = "</selec t>\n"; | |||
619 | } | 619 | } | |||
620 | 620 | |||||
621 | HTML += "</form>\n "; | 621 | HTML += "</form>\n "; | |||
622 | 622 | |||||
623 | return H TML; | 623 | return H TML; | |||
624 | } | 624 | } | |||
625 | 625 | |||||
626 | function WWHSearch_ Submit() | 626 | function WWHSearch_ Submit() | |||
627 | { | 627 | { | |||
628 | var Var PanelNavig ationFrame ; | 628 | var Var PanelNavig ationFrame ; | |||
629 | var Sea rchForm; | 629 | var Sea rchForm; | |||
630 | var New SearchWord s; | 630 | var New SearchWord s; | |||
631 | var New SearchScop e; | 631 | var New SearchScop e; | |||
632 | var Max Index; | 632 | var Max Index; | |||
633 | var Ind ex; | 633 | var Ind ex; | |||
634 | 634 | |||||
635 | 635 | |||||
636 | if ((WWH Frame.WWHH andler.fIs Ready()) & & | 636 | if ((WWH Frame.WWHH andler.fIs Ready()) & & | |||
637 | (thi s.mSearchS tate == nu ll)) | 637 | (thi s.mSearchS tate == nu ll)) | |||
638 | { | 638 | { | |||
639 | VarPan elNavigati onFrame = eval(WWHFr ame.WWHHel p.fGetFram eReference ("WWHPanel Navigation Frame")); | 639 | VarPan elNavigati onFrame = eval(WWHFr ame.WWHHel p.fGetFram eReference ("WWHPanel Navigation Frame")); | |||
640 | Search Form = Var PanelNavig ationFrame .document. forms["WWH SearchForm "]; | 640 | Search Form = Var PanelNavig ationFrame .document. forms["WWH SearchForm "]; | |||
641 | 641 | |||||
642 | // Upd ate search words | 642 | // Upd ate search words | |||
643 | // | 643 | // | |||
644 | NewSea rchWords = SearchFor m.elements ["WWHSearc hWordsText "].value; | 644 | NewSea rchWords = SearchFor m.elements ["WWHSearc hWordsText "].value; | |||
645 | if (Ne wSearchWor ds != this .mSavedSea rchWords) | 645 | if (Ne wSearchWor ds != this .mSavedSea rchWords) | |||
646 | { | 646 | { | |||
647 | this .mSavedSea rchWords = NewSearch Words; | 647 | this .mSavedSea rchWords = NewSearch Words; | |||
648 | 648 | |||||
649 | this .mSearchSt ate = "wor ds"; | 649 | this .mSearchSt ate = "wor ds"; | |||
650 | } | 650 | } | |||
651 | 651 | |||||
652 | // Upd ate search scope | 652 | // Upd ate search scope | |||
653 | // | 653 | // | |||
654 | if (WW HFrame.WWH Help.mBook s.mBookLis t.length > 1) | 654 | if (WW HFrame.WWH Help.mBook s.mBookLis t.length > 1) | |||
655 | { | 655 | { | |||
656 | NewS earchScope = SearchF orm.elemen ts["WWHSea rchScope"] .selectedI ndex; | 656 | NewS earchScope = SearchF orm.elemen ts["WWHSea rchScope"] .selectedI ndex; | |||
657 | if ( NewSearchS cope != th is.mSavedS earchScope ) | 657 | if ( NewSearchS cope != th is.mSavedS earchScope ) | |||
658 | { | 658 | { | |||
659 | th is.mSavedS earchScope = NewSear chScope; | 659 | th is.mSavedS earchScope = NewSear chScope; | |||
660 | 660 | |||||
661 | th is.mSearch State = "w ords"; | 661 | th is.mSearch State = "w ords"; | |||
662 | } | 662 | } | |||
663 | } | 663 | } | |||
664 | 664 | |||||
665 | // Per form searc h if somet hing chang ed | 665 | // Per form searc h if somet hing chang ed | |||
666 | // | 666 | // | |||
667 | if (th is.mSearch State == " words") | 667 | if (th is.mSearch State == " words") | |||
668 | { | 668 | { | |||
669 | if ( this.mSave dSearchWor ds.length > 0) | 669 | if ( this.mSave dSearchWor ds.length > 0) | |||
670 | { | 670 | { | |||
671 | // Clear pre vious resu lts | 671 | // Clear pre vious resu lts | |||
672 | // | 672 | // | |||
673 | fo r (MaxInde x = this.m BookMatche sList.leng th, Index = 0 ; Inde x < MaxInd ex ; Index ++) | 673 | fo r (MaxInde x = this.m BookMatche sList.leng th, Index = 0 ; Inde x < MaxInd ex ; Index ++) | |||
674 | { | 674 | { | |||
675 | this.mBook MatchesLis t[Index].f Clear(); | 675 | this.mBook MatchesLis t[Index].f Clear(); | |||
676 | } | 676 | } | |||
677 | th is.mCombin edResults. fClear(); | 677 | th is.mCombin edResults. fClear(); | |||
678 | 678 | |||||
679 | // Perform s earch | 679 | // Perform s earch | |||
680 | // | 680 | // | |||
681 | th is.fSetSea rchWords(t his.mSaved SearchWord s); | 681 | th is.fSetSea rchWords(t his.mSaved SearchWord s); | |||
682 | WW HFrame.WWH JavaScript .mPanels.f ClearScrol lPosition( ); | 682 | WW HFrame.WWH JavaScript .mPanels.f ClearScrol lPosition( ); | |||
683 | 683 | |||||
684 | // Submit wi ll cause n avigation area to re load which will trig ger the vi ew pane | 684 | // Submit wi ll cause n avigation area to re load which will trig ger the vi ew pane | |||
685 | // to reload and perfo rm the sea rch. | 685 | // to reload and perfo rm the sea rch. | |||
686 | // | 686 | // | |||
687 | } | 687 | } | |||
688 | } | 688 | } | |||
689 | } | 689 | } | |||
690 | 690 | |||||
691 | return ( this.mSear chState == "words"); | 691 | return ( this.mSear chState == "words"); | |||
692 | } | 692 | } | |||
693 | 693 | |||||
694 | function WWHSearch_ ApplyWordB reaks(Para mSearchWor dsString) | 694 | function WWHSearch_ ApplyWordB reaks(Para mSearchWor dsString) | |||
695 | { | 695 | { | |||
696 | var Var Result = " "; | 696 | var Var Result = " "; | |||
697 | var Var MaxIndex; | 697 | var Var MaxIndex; | |||
698 | var Var Index; | 698 | var Var Index; | |||
699 | var Var CharacterC ode; | 699 | var Var CharacterC ode; | |||
700 | var Var SingleChar acterWord; | 700 | var Var SingleChar acterWord; | |||
701 | 701 | |||||
702 | // Apply Unicode r ules for w ord breaki ng | 702 | // Apply Unicode r ules for w ord breaki ng | |||
703 | // These rules tak en from ht tp://www.u nicode.org /unicode/r eports/tr2 9/ | 703 | // These rules tak en from ht tp://www.u nicode.org /unicode/r eports/tr2 9/ | |||
704 | // | 704 | // | |||
705 | for (Var MaxIndex = ParamSear chWordsStr ing.length , VarIndex = 0; VarI ndex < Var MaxIndex ; VarIndex+ +) | 705 | for (Var MaxIndex = ParamSear chWordsStr ing.length , VarIndex = 0; VarI ndex < Var MaxIndex ; VarIndex+ +) | |||
706 | { | 706 | { | |||
707 | VarCha racterCode = ParamSe archWordsS tring.char CodeAt(Var Index); | 707 | VarCha racterCode = ParamSe archWordsS tring.char CodeAt(Var Index); | |||
708 | 708 | |||||
709 | // If non-extend ed latin o r katakana , treat as a single character word. | 709 | // If non-extend ed latin o r katakana , treat as a single character word. | |||
710 | // | 710 | // | |||
711 | if ((V arCharacte rCode > 0x 00FF) && | 711 | if ((V arCharacte rCode > 0x 00FF) && | |||
712 | (V arCharacte rCode < 0x 30A0) || | 712 | (V arCharacte rCode < 0x 30A0) || | |||
713 | (V arCharacte rCode > 0x 30FF)) | 713 | (V arCharacte rCode > 0x 30FF)) | |||
714 | { | 714 | { | |||
715 | VarS ingleChara cterWord = true; | 715 | VarS ingleChara cterWord = true; | |||
716 | 716 | |||||
717 | // H andle exce ptions | 717 | // H andle exce ptions | |||
718 | // | 718 | // | |||
719 | if ( this.mNonB reakingCha racters[Va rCharacter Code] == t rue) | 719 | if ( this.mNonB reakingCha racters[Va rCharacter Code] == t rue) | |||
720 | { | 720 | { | |||
721 | Va rSingleCha racterWord = false; | 721 | Va rSingleCha racterWord = false; | |||
722 | } | 722 | } | |||
723 | } | 723 | } | |||
724 | else | 724 | else | |||
725 | { | 725 | { | |||
726 | VarS ingleChara cterWord = false; | 726 | VarS ingleChara cterWord = false; | |||
727 | } | 727 | } | |||
728 | 728 | |||||
729 | // Ins ert whites pace break s | 729 | // Ins ert whites pace break s | |||
730 | // | 730 | // | |||
731 | if (Va rSingleCha racterWord ) | 731 | if (Va rSingleCha racterWord ) | |||
732 | { | 732 | { | |||
733 | VarR esult += " " + Param SearchWord sString.ch arAt(VarIn dex) + " " ; | 733 | VarR esult += " " + Param SearchWord sString.ch arAt(VarIn dex) + " " ; | |||
734 | } | 734 | } | |||
735 | else | 735 | else | |||
736 | { | 736 | { | |||
737 | VarR esult += P aramSearch WordsStrin g.charAt(V arIndex); | 737 | VarR esult += P aramSearch WordsStrin g.charAt(V arIndex); | |||
738 | } | 738 | } | |||
739 | } | 739 | } | |||
740 | 740 | |||||
741 | return V arResult; | 741 | return V arResult; | |||
742 | } | 742 | } | |||
743 | 743 | |||||
744 | function WWHSearch_ SetSearchW ords(Param SearchWord sString) | 744 | function WWHSearch_ SetSearchW ords(Param SearchWord sString) | |||
745 | { | 745 | { | |||
746 | var Var SearchWord sString; | 746 | var Var SearchWord sString; | |||
747 | var Sea rchWordAnd PhraseList ; | 747 | var Sea rchWordAnd PhraseList ; | |||
748 | var Sea rchWordLis t; | 748 | var Sea rchWordLis t; | |||
749 | var Max Index; | 749 | var Max Index; | |||
750 | var Ind ex; | 750 | var Ind ex; | |||
751 | var Max WordIndex; | 751 | var Max WordIndex; | |||
752 | var Wor dIndex; | 752 | var Wor dIndex; | |||
753 | var Sea rchWord; | 753 | var Sea rchWord; | |||
754 | var Sea rchRegExpP attern; | 754 | var Sea rchRegExpP attern; | |||
755 | 755 | |||||
756 | 756 | |||||
757 | // Clear search wo rds | 757 | // Clear search wo rds | |||
758 | // | 758 | // | |||
759 | this.mSe archWordLi st.length = 0; | 759 | this.mSe archWordLi st.length = 0; | |||
760 | this.mSe archWordRe gExpList.l ength = 0; | 760 | this.mSe archWordRe gExpList.l ength = 0; | |||
761 | 761 | |||||
762 | // Add s earch word s to hash | 762 | // Add s earch word s to hash | |||
763 | // | 763 | // | |||
764 | VarSearc hWordsStri ng = this. fApplyWord Breaks(Par amSearchWo rdsString) ; | 764 | VarSearc hWordsStri ng = this. fApplyWord Breaks(Par amSearchWo rdsString) ; | |||
765 | SearchWo rdAndPhras eList = WW HStringUti lities_Par seWordsAnd Phrases(Va rSearchWor dsString); | 765 | SearchWo rdAndPhras eList = WW HStringUti lities_Par seWordsAnd Phrases(Va rSearchWor dsString); | |||
766 | for (Max Index = Se archWordAn dPhraseLis t.length, Index = 0 ; Index < MaxIndex ; Index++) | 766 | for (Max Index = Se archWordAn dPhraseLis t.length, Index = 0 ; Index < MaxIndex ; Index++) | |||
767 | { | 767 | { | |||
768 | Search WordList = WWHString Utilities_ ParseWords AndPhrases (SearchWor dAndPhrase List[Index ]); | 768 | Search WordList = WWHString Utilities_ ParseWords AndPhrases (SearchWor dAndPhrase List[Index ]); | |||
769 | for (M axWordInde x = Search WordList.l ength, Wor dIndex = 0 ; WordInd ex < MaxWo rdIndex ; WordIndex+ +) | 769 | for (M axWordInde x = Search WordList.l ength, Wor dIndex = 0 ; WordInd ex < MaxWo rdIndex ; WordIndex+ +) | |||
770 | { | 770 | { | |||
771 | Sear chWord = S earchWordL ist[WordIn dex]; | 771 | Sear chWord = S earchWordL ist[WordIn dex]; | |||
772 | 772 | |||||
773 | // S kip 0 leng th words | 773 | // S kip 0 leng th words | |||
774 | // | 774 | // | |||
775 | if ( SearchWord .length > 0) | 775 | if ( SearchWord .length > 0) | |||
776 | { | 776 | { | |||
777 | // Add to se arch words hash | 777 | // Add to se arch words hash | |||
778 | // | 778 | // | |||
779 | Se archRegExp Pattern = WWHStringU tilities_W ordToRegEx pPattern(S earchWord) ; | 779 | Se archRegExp Pattern = WWHStringU tilities_W ordToRegEx pPattern(S earchWord) ; | |||
780 | 780 | |||||
781 | th is.mSearch WordList[t his.mSearc hWordList. length] = SearchWord ; | 781 | th is.mSearch WordList[t his.mSearc hWordList. length] = SearchWord ; | |||
782 | th is.mSearch WordRegExp List[this. mSearchWor dRegExpLis t.length] = new RegE xp(SearchR egExpPatte rn, "i"); | 782 | th is.mSearch WordRegExp List[this. mSearchWor dRegExpLis t.length] = new RegE xp(SearchR egExpPatte rn, "i"); | |||
783 | } | 783 | } | |||
784 | } | 784 | } | |||
785 | } | 785 | } | |||
786 | 786 | |||||
787 | // Creat e a items in mMultiP hraseList array that parallel the mBookS earchInfoL ist array | 787 | // Creat e a items in mMultiP hraseList array that parallel the mBookS earchInfoL ist array | |||
788 | // each MultiPhras e item is passed the correspon ding index from mBoo kSearchInf oList and | 788 | // each MultiPhras e item is passed the correspon ding index from mBoo kSearchInf oList and | |||
789 | // the s earch word s | 789 | // the s earch word s | |||
790 | // | 790 | // | |||
791 | var Book SearchInde x; | 791 | var Book SearchInde x; | |||
792 | var NewM ultiPhrase ; | 792 | var NewM ultiPhrase ; | |||
793 | var Curr entBookSea rch; | 793 | var Curr entBookSea rch; | |||
794 | this.mMu ltiPhraseL ist.length = 0; | 794 | this.mMu ltiPhraseL ist.length = 0; | |||
795 | for(Book SearchInde x = 0; Boo kSearchInd ex < this. mBookSearc hInfoList. length; ++ BookSearch Index) | 795 | for(Book SearchInde x = 0; Boo kSearchInd ex < this. mBookSearc hInfoList. length; ++ BookSearch Index) | |||
796 | { | 796 | { | |||
797 | Curren tBookSearc h = this.m BookSearch InfoList[B ookSearchI ndex]; | 797 | Curren tBookSearc h = this.m BookSearch InfoList[B ookSearchI ndex]; | |||
798 | NewMul tiPhrase = new Multi Phrase_Obj ect(ParamS earchWords String.toL owerCase() , CurrentB ookSearch) ; | 798 | NewMul tiPhrase = new Multi Phrase_Obj ect(ParamS earchWords String.toL owerCase() , CurrentB ookSearch) ; | |||
799 | NewMul tiPhrase.f Parse(); | 799 | NewMul tiPhrase.f Parse(); | |||
800 | this.m MultiPhras eList[this .mMultiPhr aseList.le ngth] = Ne wMultiPhra se; | 800 | this.m MultiPhras eList[this .mMultiPhr aseList.le ngth] = Ne wMultiPhra se; | |||
801 | } | 801 | } | |||
802 | } | 802 | } | |||
803 | 803 | |||||
804 | function WWHSearch_ CheckForMa tch(ParamS earchFunc) | 804 | function WWHSearch_ CheckForMa tch(ParamS earchFunc) | |||
805 | { | 805 | { | |||
806 | var Cou nt; | 806 | var Cou nt; | |||
807 | var Max Index; | 807 | var Max Index; | |||
808 | var Ind ex; | 808 | var Ind ex; | |||
809 | var Boo kMatchesLi stEntry; | 809 | var Boo kMatchesLi stEntry; | |||
810 | var Sea rchPattern ; | 810 | var Sea rchPattern ; | |||
811 | 811 | |||||
812 | 812 | |||||
813 | Count = 0; | 813 | Count = 0; | |||
814 | for (Max Index = th is.mSearch WordList.l ength, Ind ex = 0 ; I ndex < Max Index ; In dex++) | 814 | for (Max Index = th is.mSearch WordList.l ength, Ind ex = 0 ; I ndex < Max Index ; In dex++) | |||
815 | { | 815 | { | |||
816 | if (th is.mBookSe archInfoLi st[this.mB ookIndex]. fValidSear chWord(thi s.mSearchW ordList[In dex])) | 816 | if (th is.mBookSe archInfoLi st[this.mB ookIndex]. fValidSear chWord(thi s.mSearchW ordList[In dex])) | |||
817 | { | 817 | { | |||
818 | Book MatchesLis tEntry = t his.mBookM atchesList [this.mBoo kIndex]; | 818 | Book MatchesLis tEntry = t his.mBookM atchesList [this.mBoo kIndex]; | |||
819 | 819 | |||||
820 | Book MatchesLis tEntry.fSe tMatchedWo rdIndex(Co unt); | 820 | Book MatchesLis tEntry.fSe tMatchedWo rdIndex(Co unt); | |||
821 | 821 | |||||
822 | Sear chPattern = this.mSe archWordRe gExpList[I ndex]; | 822 | Sear chPattern = this.mSe archWordRe gExpList[I ndex]; | |||
823 | Sear chPattern. t = Search Pattern.te st; | 823 | Sear chPattern. t = Search Pattern.te st; | |||
824 | 824 | |||||
825 | Para mSearchFun c(SearchPa ttern, Boo kMatchesLi stEntry); | 825 | Para mSearchFun c(SearchPa ttern, Boo kMatchesLi stEntry); | |||
826 | 826 | |||||
827 | Coun t++; | 827 | Coun t++; | |||
828 | } | 828 | } | |||
829 | } | 829 | } | |||
830 | } | 830 | } | |||
831 | 831 | |||||
832 | function WWHSearch_ SearchWord sComplete( ) | 832 | function WWHSearch_ SearchWord sComplete( ) | |||
833 | { | 833 | { | |||
834 | // Combi ne results for displ ay | 834 | // Combi ne results for displ ay | |||
835 | // | 835 | // | |||
836 | this.fCo mbineResul ts(); | 836 | this.fCo mbineResul ts(); | |||
837 | this.mCo mbinedResu ltsIndex = 0; | 837 | this.mCo mbinedResu ltsIndex = 0; | |||
838 | } | 838 | } | |||
839 | 839 | |||||
840 | function WWHSearch_ CheckForPh raseMatch( ParamSearc hFunc) | 840 | function WWHSearch_ CheckForPh raseMatch( ParamSearc hFunc) | |||
841 | { | 841 | { | |||
842 | var Ent ry; | 842 | var Ent ry; | |||
843 | var Boo kIndex; | 843 | var Boo kIndex; | |||
844 | var Fil eIndex; | 844 | var Fil eIndex; | |||
845 | var Mul tiPhraseEn try; | 845 | var Mul tiPhraseEn try; | |||
846 | 846 | |||||
847 | Entry = this.mCom binedResul ts.mEntrie s[this.mCo mbinedResu ltsIndex]; | 847 | Entry = this.mCom binedResul ts.mEntrie s[this.mCo mbinedResu ltsIndex]; | |||
848 | BookInde x = Entry.mBo okIndex; | 848 | BookInde x = Entry.mBo okIndex; | |||
849 | FileInde x = Entry.mFi leIndex; | 849 | FileInde x = Entry.mFi leIndex; | |||
850 | MultiPhr aseEntry = this.mMul tiPhraseLi st[BookInd ex]; | 850 | MultiPhr aseEntry = this.mMul tiPhraseLi st[BookInd ex]; | |||
851 | 851 | |||||
852 | // Reset the incre mented val ues of the matching word pairs | 852 | // Reset the incre mented val ues of the matching word pairs | |||
853 | // for t his multip hrase obje ct for a n ew round o f testing | 853 | // for t his multip hrase obje ct for a n ew round o f testing | |||
854 | // | 854 | // | |||
855 | MultiPhr aseEntry.f ResetMatch es(); | 855 | MultiPhr aseEntry.f ResetMatch es(); | |||
856 | 856 | |||||
857 | // Perfo rm Test | 857 | // Perfo rm Test | |||
858 | // | 858 | // | |||
859 | ParamSea rchFunc(Mu ltiPhraseE ntry); | 859 | ParamSea rchFunc(Mu ltiPhraseE ntry); | |||
860 | 860 | |||||
861 | // Match ? | 861 | // Match ? | |||
862 | // | 862 | // | |||
863 | if (Mult iPhraseEnt ry.fCheckF orMatch()) | 863 | if (Mult iPhraseEnt ry.fCheckF orMatch()) | |||
864 | { | 864 | { | |||
865 | // Mat ch - Do No thing | 865 | // Mat ch - Do No thing | |||
866 | // | 866 | // | |||
867 | } | 867 | } | |||
868 | else | 868 | else | |||
869 | { | 869 | { | |||
870 | // Rem ove from r esults | 870 | // Rem ove from r esults | |||
871 | // | 871 | // | |||
872 | this.m CombinedRe sults.mEnt ries[this. mCombinedR esultsInde x] = null; | 872 | this.m CombinedRe sults.mEnt ries[this. mCombinedR esultsInde x] = null; | |||
873 | } | 873 | } | |||
874 | } | 874 | } | |||
875 | 875 | |||||
876 | function WWHSearch_ SearchPair sComplete( ) | 876 | function WWHSearch_ SearchPair sComplete( ) | |||
877 | { | 877 | { | |||
878 | var Ent ries = new Array(); | 878 | var Ent ries = new Array(); | |||
879 | var Max Index; | 879 | var Max Index; | |||
880 | var Ind ex; | 880 | var Ind ex; | |||
881 | 881 | |||||
882 | // Remov e failed m atches | 882 | // Remov e failed m atches | |||
883 | // | 883 | // | |||
884 | for (Max Index = th is.mCombin edResults. mEntries.l ength, Ind ex = 0 ; I ndex < Max Index ; In dex++) | 884 | for (Max Index = th is.mCombin edResults. mEntries.l ength, Ind ex = 0 ; I ndex < Max Index ; In dex++) | |||
885 | { | 885 | { | |||
886 | if (th is.mCombin edResults. mEntries[I ndex] != n ull) | 886 | if (th is.mCombin edResults. mEntries[I ndex] != n ull) | |||
887 | { | 887 | { | |||
888 | Entr ies[Entrie s.length] = this.mCo mbinedResu lts.mEntri es[Index]; | 888 | Entr ies[Entrie s.length] = this.mCo mbinedResu lts.mEntri es[Index]; | |||
889 | } | 889 | } | |||
890 | } | 890 | } | |||
891 | this.mCo mbinedResu lts.mEntri es = Entri es; | 891 | this.mCo mbinedResu lts.mEntri es = Entri es; | |||
892 | 892 | |||||
893 | // Sort results ba sed on sin gle or mul ti-book di splay | 893 | // Sort results ba sed on sin gle or mul ti-book di splay | |||
894 | // | 894 | // | |||
895 | if ((WWH Frame.WWHJ avaScript. mSettings. mSearch.mb ResultsByB ook) || | 895 | if ((WWH Frame.WWHJ avaScript. mSettings. mSearch.mb ResultsByB ook) || | |||
896 | ((WW HFrame.WWH Help.mBook s.mBookLis t.length = = 1) || | 896 | ((WW HFrame.WWH Help.mBook s.mBookLis t.length = = 1) || | |||
897 | ((t his.mSaved SearchScop e > 0) && | 897 | ((t his.mSaved SearchScop e > 0) && | |||
898 | (t his.mSearc hScopeInfo .mEntries[ this.mSave dSearchSco pe - 1].mS tartBookIn dex == thi s.mSearchS copeInfo.m Entries[th is.mSavedS earchScope - 1].mEnd BookIndex) ))) | 898 | (t his.mSearc hScopeInfo .mEntries[ this.mSave dSearchSco pe - 1].mS tartBookIn dex == thi s.mSearchS copeInfo.m Entries[th is.mSavedS earchScope - 1].mEnd BookIndex) ))) | |||
899 | { | 899 | { | |||
900 | this.m CombinedRe sults.fSor tByBookInd ex(); | 900 | this.m CombinedRe sults.fSor tByBookInd ex(); | |||
901 | } | 901 | } | |||
902 | else | 902 | else | |||
903 | { | 903 | { | |||
904 | this.m CombinedRe sults.fSor tByScore() ; | 904 | this.m CombinedRe sults.fSor tByScore() ; | |||
905 | } | 905 | } | |||
906 | } | 906 | } | |||
907 | 907 | |||||
908 | function WWHSearch_ CombineRes ults() | 908 | function WWHSearch_ CombineRes ults() | |||
909 | { | 909 | { | |||
910 | var Max BookIndex; | 910 | var Max BookIndex; | |||
911 | var Boo kIndex; | 911 | var Boo kIndex; | |||
912 | var Boo kMatches; | 912 | var Boo kMatches; | |||
913 | var Boo kListEntry ; | 913 | var Boo kListEntry ; | |||
914 | var Fil eID; | 914 | var Fil eID; | |||
915 | var Fil eIndex; | 915 | var Fil eIndex; | |||
916 | 916 | |||||
917 | 917 | |||||
918 | this.mCo mbinedResu lts.fClear (); | 918 | this.mCo mbinedResu lts.fClear (); | |||
919 | for (Max BookIndex = this.mBo okMatchesL ist.length , BookInde x = 0 ; Bo okIndex < MaxBookInd ex ; BookI ndex++) | 919 | for (Max BookIndex = this.mBo okMatchesL ist.length , BookInde x = 0 ; Bo okIndex < MaxBookInd ex ; BookI ndex++) | |||
920 | { | 920 | { | |||
921 | BookMa tches = th is.mBookMa tchesList[ BookIndex] ; | 921 | BookMa tches = th is.mBookMa tchesList[ BookIndex] ; | |||
922 | BookLi stEntry = WWHFrame.W WHHelp.mBo oks.mBookL ist[BookIn dex]; | 922 | BookLi stEntry = WWHFrame.W WHHelp.mBo oks.mBookL ist[BookIn dex]; | |||
923 | 923 | |||||
924 | // Add results | 924 | // Add results | |||
925 | // | 925 | // | |||
926 | BookMa tches.fJoi nFileScore s(); | 926 | BookMa tches.fJoi nFileScore s(); | |||
927 | for (F ileID in B ookMatches .mFileScor es) | 927 | for (F ileID in B ookMatches .mFileScor es) | |||
928 | { | 928 | { | |||
929 | File Index = pa rseInt(Fil eID.substr ing(1, Fil eID.length )); | 929 | File Index = pa rseInt(Fil eID.substr ing(1, Fil eID.length )); | |||
930 | 930 | |||||
931 | this .mCombined Results.fA ddEntry(Bo okIndex, F ileIndex, BookMatche s.mFileSco res[FileID ], BookLis tEntry.mFi les.fFileI ndexToTitl e(FileInde x)); | 931 | this .mCombined Results.fA ddEntry(Bo okIndex, F ileIndex, BookMatche s.mFileSco res[FileID ], BookLis tEntry.mFi les.fFileI ndexToTitl e(FileInde x)); | |||
932 | } | 932 | } | |||
933 | } | 933 | } | |||
934 | } | 934 | } | |||
935 | 935 | |||||
936 | function WWHSearch_ ShowEntry( ParamIndex ) | 936 | function WWHSearch_ ShowEntry( ParamIndex ) | |||
937 | { | 937 | { | |||
938 | this.mCo mbinedResu lts.fShowE ntry(Param Index); | 938 | this.mCo mbinedResu lts.fShowE ntry(Param Index); | |||
939 | } | 939 | } | |||
940 | 940 | |||||
941 | function WWHSearchS cope_Entry _Object(Pa ramLevel, | 941 | function WWHSearchS cope_Entry _Object(Pa ramLevel, | |||
942 | Pa ramTitle, | 942 | Pa ramTitle, | |||
943 | Pa ramBookInd ex) | 943 | Pa ramBookInd ex) | |||
944 | { | 944 | { | |||
945 | this.mLe vel = Param Level; | 945 | this.mLe vel = Param Level; | |||
946 | this.mTi tle = Param Title; | 946 | this.mTi tle = Param Title; | |||
947 | this.mSt artBookInd ex = Param BookIndex; | 947 | this.mSt artBookInd ex = Param BookIndex; | |||
948 | this.mEn dBookIndex = Param BookIndex; | 948 | this.mEn dBookIndex = Param BookIndex; | |||
949 | } | 949 | } | |||
950 | 950 | |||||
951 | function WWHSearchS cope_Objec t() | 951 | function WWHSearchS cope_Objec t() | |||
952 | { | 952 | { | |||
953 | this.mEn tries = ne w Array(); | 953 | this.mEn tries = ne w Array(); | |||
954 | this.mGr oupStack = new Array (); | 954 | this.mGr oupStack = new Array (); | |||
955 | this.mBo okIndex = 0; | 955 | this.mBo okIndex = 0; | |||
956 | 956 | |||||
957 | this.fAd dScopeEntr ies = WWHS earchScope _AddScopeE ntries; | 957 | this.fAd dScopeEntr ies = WWHS earchScope _AddScopeE ntries; | |||
958 | 958 | |||||
959 | // Set s cope entri es | 959 | // Set s cope entri es | |||
960 | // | 960 | // | |||
961 | this.fAd dScopeEntr ies(WWHFra me.WWHHelp .mBookGrou ps); | 961 | this.fAd dScopeEntr ies(WWHFra me.WWHHelp .mBookGrou ps); | |||
962 | } | 962 | } | |||
963 | 963 | |||||
964 | function WWHSearchS cope_AddSc opeEntries (ParamGrou p) | 964 | function WWHSearchS cope_AddSc opeEntries (ParamGrou p) | |||
965 | { | 965 | { | |||
966 | var Max Index; | 966 | var Max Index; | |||
967 | var Ind ex; | 967 | var Ind ex; | |||
968 | var Max GroupStack Index; | 968 | var Max GroupStack Index; | |||
969 | var Gro upStackInd ex; | 969 | var Gro upStackInd ex; | |||
970 | var Sco peEntry; | 970 | var Sco peEntry; | |||
971 | 971 | |||||
972 | 972 | |||||
973 | for (Max Index = Pa ramGroup.m Children.l ength, Ind ex = 0 ; I ndex < Max Index ; In dex++) | 973 | for (Max Index = Pa ramGroup.m Children.l ength, Ind ex = 0 ; I ndex < Max Index ; In dex++) | |||
974 | { | 974 | { | |||
975 | if (Pa ramGroup.m Children[I ndex].mbGr ouping) | 975 | if (Pa ramGroup.m Children[I ndex].mbGr ouping) | |||
976 | { | 976 | { | |||
977 | // A dd an entr y | 977 | // A dd an entr y | |||
978 | // | 978 | // | |||
979 | Scop eEntry = n ew WWHSear chScope_En try_Object (this.mGro upStack.le ngth, Para mGroup.mCh ildren[Ind ex].mTitle , -1); | 979 | Scop eEntry = n ew WWHSear chScope_En try_Object (this.mGro upStack.le ngth, Para mGroup.mCh ildren[Ind ex].mTitle , -1); | |||
980 | this .mEntries[ this.mEntr ies.length ] = ScopeE ntry; | 980 | this .mEntries[ this.mEntr ies.length ] = ScopeE ntry; | |||
981 | 981 | |||||
982 | // P ush this e ntry onto the group stack | 982 | // P ush this e ntry onto the group stack | |||
983 | // | 983 | // | |||
984 | this .mGroupSta ck[this.mG roupStack. length] = ScopeEntry ; | 984 | this .mGroupSta ck[this.mG roupStack. length] = ScopeEntry ; | |||
985 | 985 | |||||
986 | // P rocess gro up entries | 986 | // P rocess gro up entries | |||
987 | // | 987 | // | |||
988 | this .fAddScope Entries(Pa ramGroup.m Children[I ndex]); | 988 | this .fAddScope Entries(Pa ramGroup.m Children[I ndex]); | |||
989 | 989 | |||||
990 | // P op this en try off th e group st ack | 990 | // P op this en try off th e group st ack | |||
991 | // | 991 | // | |||
992 | this .mGroupSta ck.length -= 1; | 992 | this .mGroupSta ck.length -= 1; | |||
993 | } | 993 | } | |||
994 | else | 994 | else | |||
995 | { | 995 | { | |||
996 | // A dd an entr y | 996 | // A dd an entr y | |||
997 | // | 997 | // | |||
998 | this .mEntries[ this.mEntr ies.length ] = new WW HSearchSco pe_Entry_O bject(this .mGroupSta ck.length, WWHFrame. WWHHelp.mB ooks.mBook List[this. mBookIndex ].mTitle, this.mBook Index); | 998 | this .mEntries[ this.mEntr ies.length ] = new WW HSearchSco pe_Entry_O bject(this .mGroupSta ck.length, WWHFrame. WWHHelp.mB ooks.mBook List[this. mBookIndex ].mTitle, this.mBook Index); | |||
999 | 999 | |||||
1000 | // P rocess all entries i n the grou p stack, u pdating st art/end bo ok indicie s | 1000 | // P rocess all entries i n the grou p stack, u pdating st art/end bo ok indicie s | |||
1001 | // | 1001 | // | |||
1002 | for (MaxGroupS tackIndex = this.mGr oupStack.l ength, Gro upStackInd ex = 0 ; G roupStackI ndex < Max GroupStack Index ; Gr oupStackIn dex++) | 1002 | for (MaxGroupS tackIndex = this.mGr oupStack.l ength, Gro upStackInd ex = 0 ; G roupStackI ndex < Max GroupStack Index ; Gr oupStackIn dex++) | |||
1003 | { | 1003 | { | |||
1004 | Sc opeEntry = this.mGro upStack[Gr oupStackIn dex]; | 1004 | Sc opeEntry = this.mGro upStack[Gr oupStackIn dex]; | |||
1005 | 1005 | |||||
1006 | // Update st art | 1006 | // Update st art | |||
1007 | // | 1007 | // | |||
1008 | if (ScopeEnt ry.mStartB ookIndex = = -1) | 1008 | if (ScopeEnt ry.mStartB ookIndex = = -1) | |||
1009 | { | 1009 | { | |||
1010 | ScopeEntry .mStartBoo kIndex = t his.mBookI ndex; | 1010 | ScopeEntry .mStartBoo kIndex = t his.mBookI ndex; | |||
1011 | } | 1011 | } | |||
1012 | 1012 | |||||
1013 | // Update en d | 1013 | // Update en d | |||
1014 | // | 1014 | // | |||
1015 | Sc opeEntry.m EndBookInd ex = this. mBookIndex ; | 1015 | Sc opeEntry.m EndBookInd ex = this. mBookIndex ; | |||
1016 | } | 1016 | } | |||
1017 | 1017 | |||||
1018 | // I ncrement b ook index | 1018 | // I ncrement b ook index | |||
1019 | // | 1019 | // | |||
1020 | this .mBookInde x += 1; | 1020 | this .mBookInde x += 1; | |||
1021 | } | 1021 | } | |||
1022 | } | 1022 | } | |||
1023 | } | 1023 | } | |||
1024 | 1024 | |||||
1025 | function WWHBookSea rchInfo_Ob ject(Param SearchFile Count, | 1025 | function WWHBookSea rchInfo_Ob ject(Param SearchFile Count, | |||
1026 | Param MinimumWor dLength) | 1026 | Param MinimumWor dLength) | |||
1027 | { | 1027 | { | |||
1028 | this.mSe archFileCo unt = Pa ramSearchF ileCount; | 1028 | this.mSe archFileCo unt = Pa ramSearchF ileCount; | |||
1029 | this.mMi nimumWordL ength = Pa ramMinimum WordLength ; | 1029 | this.mMi nimumWordL ength = Pa ramMinimum WordLength ; | |||
1030 | this.mSk ipWords = ne w WWHBookS earchInfo_ SkipWords_ Object(); | 1030 | this.mSk ipWords = ne w WWHBookS earchInfo_ SkipWords_ Object(); | |||
1031 | 1031 | |||||
1032 | this.fAd dSkipWord = WWHB ookSearchI nfo_AddSki pWord; | 1032 | this.fAd dSkipWord = WWHB ookSearchI nfo_AddSki pWord; | |||
1033 | this.fA = WWHB ookSearchI nfo_AddSki pWord; | 1033 | this.fA = WWHB ookSearchI nfo_AddSki pWord; | |||
1034 | this.fVa lidSearchW ord = WWHB ookSearchI nfo_ValidS earchWord; | 1034 | this.fVa lidSearchW ord = WWHB ookSearchI nfo_ValidS earchWord; | |||
1035 | } | 1035 | } | |||
1036 | 1036 | |||||
1037 | function WWHBookSea rchInfo_Ad dSkipWord( ParamSkipW ord) | 1037 | function WWHBookSea rchInfo_Ad dSkipWord( ParamSkipW ord) | |||
1038 | { | 1038 | { | |||
1039 | if (Para mSkipWord. length > 0 ) | 1039 | if (Para mSkipWord. length > 0 ) | |||
1040 | { | 1040 | { | |||
1041 | this.m SkipWords[ ParamSkipW ord + "~"] = 1; | 1041 | this.m SkipWords[ ParamSkipW ord + "~"] = 1; | |||
1042 | } | 1042 | } | |||
1043 | } | 1043 | } | |||
1044 | 1044 | |||||
1045 | function WWHBookSea rchInfo_Va lidSearchW ord(ParamS earchWord) | 1045 | function WWHBookSea rchInfo_Va lidSearchW ord(ParamS earchWord) | |||
1046 | { | 1046 | { | |||
1047 | var bVa lid = true ; | 1047 | var bVa lid = true ; | |||
1048 | 1048 | |||||
1049 | 1049 | |||||
1050 | if ((Par amSearchWo rd.length < this.mMi nimumWordL ength) || | 1050 | if ((Par amSearchWo rd.length < this.mMi nimumWordL ength) || | |||
1051 | (typ eof(this.m SkipWords[ ParamSearc hWord + "~ "]) == "nu mber")) | 1051 | (typ eof(this.m SkipWords[ ParamSearc hWord + "~ "]) == "nu mber")) | |||
1052 | { | 1052 | { | |||
1053 | bValid = false; | 1053 | bValid = false; | |||
1054 | } | 1054 | } | |||
1055 | 1055 | |||||
1056 | return b Valid; | 1056 | return b Valid; | |||
1057 | } | 1057 | } | |||
1058 | 1058 | |||||
1059 | function WWHBookSea rchInfo_Sk ipWords_Ob ject() | 1059 | function WWHBookSea rchInfo_Sk ipWords_Ob ject() | |||
1060 | { | 1060 | { | |||
1061 | } | 1061 | } | |||
1062 | 1062 | |||||
1063 | function WWHSearchB ookMatches _Object() | 1063 | function WWHSearchB ookMatches _Object() | |||
1064 | { | 1064 | { | |||
1065 | this.mFi rstMatched WordIndex = -1; | 1065 | this.mFi rstMatched WordIndex = -1; | |||
1066 | this.mMa tchedWordI ndex = -1; | 1066 | this.mMa tchedWordI ndex = -1; | |||
1067 | this.mWo rdFileScor es = new Arra y(); | 1067 | this.mWo rdFileScor es = new Arra y(); | |||
1068 | this.mFi leScores = new WWHS earchBookM atches_Fil eScores_Ob ject(); | 1068 | this.mFi leScores = new WWHS earchBookM atches_Fil eScores_Ob ject(); | |||
1069 | 1069 | |||||
1070 | this.fCl ear = WWHSearchB ookMatches _Clear; | 1070 | this.fCl ear = WWHSearchB ookMatches _Clear; | |||
1071 | this.fSe tMatchedWo rdIndex = WWHSearchB ookMatches _SetMatche dWordIndex ; | 1071 | this.fSe tMatchedWo rdIndex = WWHSearchB ookMatches _SetMatche dWordIndex ; | |||
1072 | this.fAd dMatches = WWHSearchB ookMatches _AddMatche s; | 1072 | this.fAd dMatches = WWHSearchB ookMatches _AddMatche s; | |||
1073 | this.f = WWHSearchB ookMatches _AddMatche s; // For smaller s earch file s | 1073 | this.f = WWHSearchB ookMatches _AddMatche s; // For smaller s earch file s | |||
1074 | this.fJo inFileScor es = WWHSearchB ookMatches _JoinFileS cores; | 1074 | this.fJo inFileScor es = WWHSearchB ookMatches _JoinFileS cores; | |||
1075 | } | 1075 | } | |||
1076 | 1076 | |||||
1077 | function WWHSearchB ookMatches _Clear() | 1077 | function WWHSearchB ookMatches _Clear() | |||
1078 | { | 1078 | { | |||
1079 | this.mFi rstMatched WordIndex = -1; | 1079 | this.mFi rstMatched WordIndex = -1; | |||
1080 | this.mMa tchedWordI ndex = -1; | 1080 | this.mMa tchedWordI ndex = -1; | |||
1081 | this.mWo rdFileScor es.length = 0; | 1081 | this.mWo rdFileScor es.length = 0; | |||
1082 | this.mFi leScores = new WWHS earchBookM atches_Fil eScores_Ob ject(); | 1082 | this.mFi leScores = new WWHS earchBookM atches_Fil eScores_Ob ject(); | |||
1083 | } | 1083 | } | |||
1084 | 1084 | |||||
1085 | function WWHSearchB ookMatches _SetMatche dWordIndex (ParamMatc hedWordInd ex) | 1085 | function WWHSearchB ookMatches _SetMatche dWordIndex (ParamMatc hedWordInd ex) | |||
1086 | { | 1086 | { | |||
1087 | this.mMa tchedWordI ndex = Par amMatchedW ordIndex; | 1087 | this.mMa tchedWordI ndex = Par amMatchedW ordIndex; | |||
1088 | if (Para mMatchedWo rdIndex == this.mWor dFileScore s.length) | 1088 | if (Para mMatchedWo rdIndex == this.mWor dFileScore s.length) | |||
1089 | { | 1089 | { | |||
1090 | this.m WordFileSc ores[this. mWordFileS cores.leng th] = new WWHSearchB ookMatches _FileScore s_Object() ; | 1090 | this.m WordFileSc ores[this. mWordFileS cores.leng th] = new WWHSearchB ookMatches _FileScore s_Object() ; | |||
1091 | } | 1091 | } | |||
1092 | } | 1092 | } | |||
1093 | 1093 | |||||
1094 | function WWHSearchB ookMatches _AddMatche s(ParamMat chString) | 1094 | function WWHSearchB ookMatches _AddMatche s(ParamMat chString) | |||
1095 | { | 1095 | { | |||
1096 | var Mat chList = n ull; | 1096 | var Mat chList = n ull; | |||
1097 | var Wor dFileScore sEntry; | 1097 | var Wor dFileScore sEntry; | |||
1098 | var Max Index; | 1098 | var Max Index; | |||
1099 | var Ind ex; | 1099 | var Ind ex; | |||
1100 | var Fil eID; | 1100 | var Fil eID; | |||
1101 | var Sco re; | 1101 | var Sco re; | |||
1102 | 1102 | |||||
1103 | 1103 | |||||
1104 | if (type of(ParamMa tchString) != "undef ined") | 1104 | if (type of(ParamMa tchString) != "undef ined") | |||
1105 | { | 1105 | { | |||
1106 | MatchL ist = Para mMatchStri ng.split(" ,"); | 1106 | MatchL ist = Para mMatchStri ng.split(" ,"); | |||
1107 | } | 1107 | } | |||
1108 | 1108 | |||||
1109 | if ((Mat chList != null) && | 1109 | if ((Mat chList != null) && | |||
1110 | (Mat chList.len gth > 0)) | 1110 | (Mat chList.len gth > 0)) | |||
1111 | { | 1111 | { | |||
1112 | WordFi leScoresEn try = this .mWordFile Scores[thi s.mMatched WordIndex] ; | 1112 | WordFi leScoresEn try = this .mWordFile Scores[thi s.mMatched WordIndex] ; | |||
1113 | 1113 | |||||
1114 | // Add all entri es to word file scor e entry | 1114 | // Add all entri es to word file scor e entry | |||
1115 | // | 1115 | // | |||
1116 | for (M axIndex = MatchList. length, In dex = 0 ; Index < Ma xIndex ; I ndex += 2) | 1116 | for (M axIndex = MatchList. length, In dex = 0 ; Index < Ma xIndex ; I ndex += 2) | |||
1117 | { | 1117 | { | |||
1118 | File ID = "i" + MatchList [Index]; | 1118 | File ID = "i" + MatchList [Index]; | |||
1119 | Scor e = Match List[Index + 1]; | 1119 | Scor e = Match List[Index + 1]; | |||
1120 | 1120 | |||||
1121 | Word FileScores Entry[File ID] = pars eInt(Score ); | 1121 | Word FileScores Entry[File ID] = pars eInt(Score ); | |||
1122 | } | 1122 | } | |||
1123 | } | 1123 | } | |||
1124 | } | 1124 | } | |||
1125 | 1125 | |||||
1126 | function WWHSearchB ookMatches _JoinFileS cores() | 1126 | function WWHSearchB ookMatches _JoinFileS cores() | |||
1127 | { | 1127 | { | |||
1128 | var Max Index; | 1128 | var Max Index; | |||
1129 | var Ind ex; | 1129 | var Ind ex; | |||
1130 | var Wor dFileScore sEntry; | 1130 | var Wor dFileScore sEntry; | |||
1131 | 1131 | |||||
1132 | 1132 | |||||
1133 | this.mFi leScores = new WWHSe archBookMa tches_File Scores_Obj ect(); | 1133 | this.mFi leScores = new WWHSe archBookMa tches_File Scores_Obj ect(); | |||
1134 | for (Max Index = th is.mWordFi leScores.l ength, Ind ex = 0 ; I ndex < Max Index ; In dex++) | 1134 | for (Max Index = th is.mWordFi leScores.l ength, Ind ex = 0 ; I ndex < Max Index ; In dex++) | |||
1135 | { | 1135 | { | |||
1136 | WordFi leScoresEn try = this .mWordFile Scores[Ind ex]; | 1136 | WordFi leScoresEn try = this .mWordFile Scores[Ind ex]; | |||
1137 | 1137 | |||||
1138 | if (In dex == 0) | 1138 | if (In dex == 0) | |||
1139 | { | 1139 | { | |||
1140 | // A dd all ent ries if fi rst entry | 1140 | // A dd all ent ries if fi rst entry | |||
1141 | // | 1141 | // | |||
1142 | this .mFileScor es = WordF ileScoresE ntry; | 1142 | this .mFileScor es = WordF ileScoresE ntry; | |||
1143 | } | 1143 | } | |||
1144 | else | 1144 | else | |||
1145 | { | 1145 | { | |||
1146 | // R emove all entries no t found in results s et | 1146 | // R emove all entries no t found in results s et | |||
1147 | // | 1147 | // | |||
1148 | for (FileID in this.mFil eScores) | 1148 | for (FileID in this.mFil eScores) | |||
1149 | { | 1149 | { | |||
1150 | if (typeof(W ordFileSco resEntry[F ileID]) == "number") | 1150 | if (typeof(W ordFileSco resEntry[F ileID]) == "number") | |||
1151 | { | 1151 | { | |||
1152 | this.mFile Scores[Fil eID] += Wo rdFileScor esEntry[Fi leID]; | 1152 | this.mFile Scores[Fil eID] += Wo rdFileScor esEntry[Fi leID]; | |||
1153 | } | 1153 | } | |||
1154 | el se | 1154 | el se | |||
1155 | { | 1155 | { | |||
1156 | delete thi s.mFileSco res[FileID ]; | 1156 | delete thi s.mFileSco res[FileID ]; | |||
1157 | } | 1157 | } | |||
1158 | } | 1158 | } | |||
1159 | } | 1159 | } | |||
1160 | } | 1160 | } | |||
1161 | } | 1161 | } | |||
1162 | 1162 | |||||
1163 | function WWHSearchB ookMatches _FileScore s_Object() | 1163 | function WWHSearchB ookMatches _FileScore s_Object() | |||
1164 | { | 1164 | { | |||
1165 | } | 1165 | } | |||
1166 | 1166 | |||||
1167 | function WWHSearchR esults_Obj ect() | 1167 | function WWHSearchR esults_Obj ect() | |||
1168 | { | 1168 | { | |||
1169 | this.mSo rtedBy = null; | 1169 | this.mSo rtedBy = null; | |||
1170 | this.mEn tries = new Arr ay(); | 1170 | this.mEn tries = new Arr ay(); | |||
1171 | this.mMa xScore = 0; | 1171 | this.mMa xScore = 0; | |||
1172 | this.mDi splayIndex = 0; | 1172 | this.mDi splayIndex = 0; | |||
1173 | this.mBy BookDetect = -1; | 1173 | this.mBy BookDetect = -1; | |||
1174 | this.mHT MLSegment = new WWH StringBuff er_Object( ); | 1174 | this.mHT MLSegment = new WWH StringBuff er_Object( ); | |||
1175 | this.mEv entString = WWHPopu p_EventStr ing(); | 1175 | this.mEv entString = WWHPopu p_EventStr ing(); | |||
1176 | 1176 | |||||
1177 | this.fCl ear = WWHS earchResul ts_Clear; | 1177 | this.fCl ear = WWHS earchResul ts_Clear; | |||
1178 | this.fAd dEntry = WWHS earchResul ts_AddEntr y; | 1178 | this.fAd dEntry = WWHS earchResul ts_AddEntr y; | |||
1179 | this.fSo rtByScore = WWHS earchResul ts_SortByS core; | 1179 | this.fSo rtByScore = WWHS earchResul ts_SortByS core; | |||
1180 | this.fSo rtByBookIn dex = WWHS earchResul ts_SortByB ookIndex; | 1180 | this.fSo rtByBookIn dex = WWHS earchResul ts_SortByB ookIndex; | |||
1181 | this.fDi splayReset = WWHS earchResul ts_Display Reset; | 1181 | this.fDi splayReset = WWHS earchResul ts_Display Reset; | |||
1182 | this.fDi splayAdvan ce = WWHS earchResul ts_Display Advance; | 1182 | this.fDi splayAdvan ce = WWHS earchResul ts_Display Advance; | |||
1183 | this.fGe tPopupActi on = WWHS earchResul ts_GetPopu pAction; | 1183 | this.fGe tPopupActi on = WWHS earchResul ts_GetPopu pAction; | |||
1184 | this.fSh owEntry = WWHS earchResul ts_ShowEnt ry; | 1184 | this.fSh owEntry = WWHS earchResul ts_ShowEnt ry; | |||
1185 | } | 1185 | } | |||
1186 | 1186 | |||||
1187 | function WWHSearchR esults_Cle ar() | 1187 | function WWHSearchR esults_Cle ar() | |||
1188 | { | 1188 | { | |||
1189 | this.mSo rtedBy = null; | 1189 | this.mSo rtedBy = null; | |||
1190 | this.mEn tries.leng th = 0; | 1190 | this.mEn tries.leng th = 0; | |||
1191 | this.mMa xScore = 0; | 1191 | this.mMa xScore = 0; | |||
1192 | } | 1192 | } | |||
1193 | 1193 | |||||
1194 | function WWHSearchR esults_Add Entry(Para mBookIndex , | 1194 | function WWHSearchR esults_Add Entry(Para mBookIndex , | |||
1195 | Para mFileIndex , | 1195 | Para mFileIndex , | |||
1196 | Para mScore, | 1196 | Para mScore, | |||
1197 | Para mTitle) | 1197 | Para mTitle) | |||
1198 | { | 1198 | { | |||
1199 | // Add a new entry | 1199 | // Add a new entry | |||
1200 | // | 1200 | // | |||
1201 | this.mEn tries[this .mEntries. length] = new WWHSea rchResults Entry_Obje ct(ParamBo okIndex, | 1201 | this.mEn tries[this .mEntries. length] = new WWHSea rchResults Entry_Obje ct(ParamBo okIndex, | |||
1202 | ParamFi leIndex, | 1202 | ParamFi leIndex, | |||
1203 | ParamSc ore, | 1203 | ParamSc ore, | |||
1204 | ParamTi tle); | 1204 | ParamTi tle); | |||
1205 | 1205 | |||||
1206 | // Bump mMaxScore if necessa ry | 1206 | // Bump mMaxScore if necessa ry | |||
1207 | // | 1207 | // | |||
1208 | if (Para mScore > t his.mMaxSc ore) | 1208 | if (Para mScore > t his.mMaxSc ore) | |||
1209 | { | 1209 | { | |||
1210 | this.m MaxScore = ParamScor e; | 1210 | this.m MaxScore = ParamScor e; | |||
1211 | } | 1211 | } | |||
1212 | } | 1212 | } | |||
1213 | 1213 | |||||
1214 | function WWHSearchR esults_Sor tByScore() | 1214 | function WWHSearchR esults_Sor tByScore() | |||
1215 | { | 1215 | { | |||
1216 | this.mSo rtedBy = 1 ; // By S core | 1216 | this.mSo rtedBy = 1 ; // By S core | |||
1217 | 1217 | |||||
1218 | if (this .mEntries. length > 0 ) | 1218 | if (this .mEntries. length > 0 ) | |||
1219 | { | 1219 | { | |||
1220 | this.m Entries = this.mEntr ies.sort(W WHSearchRe sultsEntry _ByScoreBy BookIndexB yTitleFile IndexURL); | 1220 | this.m Entries = this.mEntr ies.sort(W WHSearchRe sultsEntry _ByScoreBy BookIndexB yTitleFile IndexURL); | |||
1221 | } | 1221 | } | |||
1222 | } | 1222 | } | |||
1223 | 1223 | |||||
1224 | function WWHSearchR esults_Sor tByBookInd ex() | 1224 | function WWHSearchR esults_Sor tByBookInd ex() | |||
1225 | { | 1225 | { | |||
1226 | this.mSo rtedBy = 2 ; // By B ookIndex | 1226 | this.mSo rtedBy = 2 ; // By B ookIndex | |||
1227 | 1227 | |||||
1228 | if (this .mEntries. length > 0 ) | 1228 | if (this .mEntries. length > 0 ) | |||
1229 | { | 1229 | { | |||
1230 | this.m Entries = this.mEntr ies.sort(W WHSearchRe sultsEntry _ByBookInd exByScoreB yTitleFile IndexURL); | 1230 | this.m Entries = this.mEntr ies.sort(W WHSearchRe sultsEntry _ByBookInd exByScoreB yTitleFile IndexURL); | |||
1231 | } | 1231 | } | |||
1232 | } | 1232 | } | |||
1233 | 1233 | |||||
1234 | function WWHSearchR esults_Dis playReset( bParamDisp layBookTit les) | 1234 | function WWHSearchR esults_Dis playReset( bParamDisp layBookTit les) | |||
1235 | { | 1235 | { | |||
1236 | this.mDi splayIndex = 0; | 1236 | this.mDi splayIndex = 0; | |||
1237 | this.mBy BookDetect = -1; | 1237 | this.mBy BookDetect = -1; | |||
1238 | 1238 | |||||
1239 | if ( ! b ParamDispl ayBookTitl es) | 1239 | if ( ! b ParamDispl ayBookTitl es) | |||
1240 | { | 1240 | { | |||
1241 | this.m ByBookDete ct = -2; | 1241 | this.m ByBookDete ct = -2; | |||
1242 | } | 1242 | } | |||
1243 | } | 1243 | } | |||
1244 | 1244 | |||||
1245 | function WWHSearchR esults_Dis playAdvanc e() | 1245 | function WWHSearchR esults_Dis playAdvanc e() | |||
1246 | { | 1246 | { | |||
1247 | var bSe gmentCreat ed = false ; | 1247 | var bSe gmentCreat ed = false ; | |||
1248 | var Set tings = WW HFrame.WWH JavaScript .mSettings .mSearch; | 1248 | var Set tings = WW HFrame.WWH JavaScript .mSettings .mSearch; | |||
1249 | var HTM L; | 1249 | var HTM L; | |||
1250 | var Max HTMLSegmen tSize; | 1250 | var Max HTMLSegmen tSize; | |||
1251 | var Boo kList; | 1251 | var Boo kList; | |||
1252 | var Max Index; | 1252 | var Max Index; | |||
1253 | var Ind ex; | 1253 | var Ind ex; | |||
1254 | var Ent ry; | 1254 | var Ent ry; | |||
1255 | var Var Accessibil ityTitle = ""; | 1255 | var Var Accessibil ityTitle = ""; | |||
1256 | var Var Percent; | 1256 | var Var Percent; | |||
1257 | 1257 | |||||
1258 | 1258 | |||||
1259 | // Insur e that the re is some thing to d isplay | 1259 | // Insur e that the re is some thing to d isplay | |||
1260 | // | 1260 | // | |||
1261 | if ((thi s.mSortedB y != null) && | 1261 | if ((thi s.mSortedB y != null) && | |||
1262 | (thi s.mEntries .length > 0)) | 1262 | (thi s.mEntries .length > 0)) | |||
1263 | { | 1263 | { | |||
1264 | MaxHTM LSegmentSi ze = WWHFr ame.WWHJav aScript.mM axHTMLSegm entSize; | 1264 | MaxHTM LSegmentSi ze = WWHFr ame.WWHJav aScript.mM axHTMLSegm entSize; | |||
1265 | this.m HTMLSegmen t.fReset() ; | 1265 | this.m HTMLSegmen t.fReset() ; | |||
1266 | BookLi st = WWHFr ame.WWHHel p.mBooks.m BookList; | 1266 | BookLi st = WWHFr ame.WWHHel p.mBooks.m BookList; | |||
1267 | 1267 | |||||
1268 | // If this is th e first en try, displ ay the hea ders and o pen the li st | 1268 | // If this is th e first en try, displ ay the hea ders and o pen the li st | |||
1269 | // | 1269 | // | |||
1270 | if (th is.mDispla yIndex == 0) | 1270 | if (th is.mDispla yIndex == 0) | |||
1271 | { | 1271 | { | |||
1272 | HTML = ""; | 1272 | HTML = ""; | |||
1273 | 1273 | |||||
1274 | HTML += "<p><n obr><b>"; | 1274 | HTML += "<p><n obr><b>"; | |||
1275 | 1275 | |||||
1276 | // D isplay col umn header s | 1276 | // D isplay col umn header s | |||
1277 | // | 1277 | // | |||
1278 | if ( Settings.m bShowRank) | 1278 | if ( Settings.m bShowRank) | |||
1279 | { | 1279 | { | |||
1280 | HT ML += WWHF rame.WWHJa vaScript.m Messages.m SearchRank Label + " "; | 1280 | HT ML += WWHF rame.WWHJa vaScript.m Messages.m SearchRank Label + " "; | |||
1281 | } | 1281 | } | |||
1282 | HTML += WWHFra me.WWHJava Script.mMe ssages.mSe archTitleL abel; | 1282 | HTML += WWHFra me.WWHJava Script.mMe ssages.mSe archTitleL abel; | |||
1283 | if ( (BookList. length > 1 ) && // M ore than o ne book ex ists | 1283 | if ( (BookList. length > 1 ) && // M ore than o ne book ex ists | |||
1284 | (this.mSor tedBy == 1 )) // B y Score | 1284 | (this.mSor tedBy == 1 )) // B y Score | |||
1285 | { | 1285 | { | |||
1286 | HT ML += ", " + WWHFram e.WWHJavaS cript.mMes sages.mSea rchBookLab el; | 1286 | HT ML += ", " + WWHFram e.WWHJavaS cript.mMes sages.mSea rchBookLab el; | |||
1287 | } | 1287 | } | |||
1288 | HTML += "</b>< /nobr></p> \n"; | 1288 | HTML += "</b>< /nobr></p> \n"; | |||
1289 | 1289 | |||||
1290 | HTML += "<ol>\ n"; | 1290 | HTML += "<ol>\ n"; | |||
1291 | 1291 | |||||
1292 | this .mHTMLSegm ent.fAppen d(HTML); | 1292 | this .mHTMLSegm ent.fAppen d(HTML); | |||
1293 | } | 1293 | } | |||
1294 | 1294 | |||||
1295 | // Dis play resul t entries | 1295 | // Dis play resul t entries | |||
1296 | // | 1296 | // | |||
1297 | MaxInd ex = this. mEntries.l ength; | 1297 | MaxInd ex = this. mEntries.l ength; | |||
1298 | Index = this.mDi splayIndex ; | 1298 | Index = this.mDi splayIndex ; | |||
1299 | while ((this.mHT MLSegment. fSize() < MaxHTMLSeg mentSize) && | 1299 | while ((this.mHT MLSegment. fSize() < MaxHTMLSeg mentSize) && | |||
1300 | (Index < MaxIndex)) | 1300 | (Index < MaxIndex)) | |||
1301 | { | 1301 | { | |||
1302 | HTML = ""; | 1302 | HTML = ""; | |||
1303 | 1303 | |||||
1304 | Entr y = this.m Entries[In dex]; | 1304 | Entr y = this.m Entries[In dex]; | |||
1305 | 1305 | |||||
1306 | // D isplay Boo k | 1306 | // D isplay Boo k | |||
1307 | // | 1307 | // | |||
1308 | if ( (BookList. length > 1 ) && // M ore than o ne book ex ists | 1308 | if ( (BookList. length > 1 ) && // M ore than o ne book ex ists | |||
1309 | (this.mSor tedBy == 2 )) // B y BookInde x | 1309 | (this.mSor tedBy == 2 )) // B y BookInde x | |||
1310 | { | 1310 | { | |||
1311 | if (this.mBy BookDetect == -2) | 1311 | if (this.mBy BookDetect == -2) | |||
1312 | { | 1312 | { | |||
1313 | // Do not display bo ok titles | 1313 | // Do not display bo ok titles | |||
1314 | // | 1314 | // | |||
1315 | } | 1315 | } | |||
1316 | el se if (thi s.mByBookD etect != E ntry.mBook Index) | 1316 | el se if (thi s.mByBookD etect != E ntry.mBook Index) | |||
1317 | { | 1317 | { | |||
1318 | // Close l ist for pr evious boo k | 1318 | // Close l ist for pr evious boo k | |||
1319 | // | 1319 | // | |||
1320 | if (Index > 0) | 1320 | if (Index > 0) | |||
1321 | { | 1321 | { | |||
1322 | HTML += "</ol>\n"; | 1322 | HTML += "</ol>\n"; | |||
1323 | } | 1323 | } | |||
1324 | 1324 | |||||
1325 | HTML += "< p><nobr>&n bsp;</nobr ></p>"; | 1325 | HTML += "< p><nobr>&n bsp;</nobr ></p>"; | |||
1326 | HTML += "< p class=\" BookTitle\ "><nobr>" + BookList [Entry.mBo okIndex].m Title + "< /nobr></p> "; | 1326 | HTML += "< p class=\" BookTitle\ "><nobr>" + BookList [Entry.mBo okIndex].m Title + "< /nobr></p> "; | |||
1327 | 1327 | |||||
1328 | this.mByBo okDetect = Entry.mBo okIndex; | 1328 | this.mByBo okDetect = Entry.mBo okIndex; | |||
1329 | 1329 | |||||
1330 | // Open ne w list for next book | 1330 | // Open ne w list for next book | |||
1331 | // | 1331 | // | |||
1332 | HTML += "< ol>\n"; | 1332 | HTML += "< ol>\n"; | |||
1333 | } | 1333 | } | |||
1334 | } | 1334 | } | |||
1335 | 1335 | |||||
1336 | // A ccessibili ty support | 1336 | // A ccessibili ty support | |||
1337 | // | 1337 | // | |||
1338 | if ( WWHFrame.W WHHelp.mbA ccessible) | 1338 | if ( WWHFrame.W WHHelp.mbA ccessible) | |||
1339 | { | 1339 | { | |||
1340 | Va rAccessibi lityTitle = ""; | 1340 | Va rAccessibi lityTitle = ""; | |||
1341 | 1341 | |||||
1342 | // Rank | 1342 | // Rank | |||
1343 | // | 1343 | // | |||
1344 | if (Settings .mbShowRan k) | 1344 | if (Settings .mbShowRan k) | |||
1345 | { | 1345 | { | |||
1346 | VarPercent = Math.fl oor((Entry .mScore / this.mMaxS core) * 10 0); | 1346 | VarPercent = Math.fl oor((Entry .mScore / this.mMaxS core) * 10 0); | |||
1347 | 1347 | |||||
1348 | // Some br owsers do not allow value attr ibutes to be 0 | 1348 | // Some br owsers do not allow value attr ibutes to be 0 | |||
1349 | // | 1349 | // | |||
1350 | if (VarPer cent < 1) | 1350 | if (VarPer cent < 1) | |||
1351 | { | 1351 | { | |||
1352 | VarPerce nt = 1; | 1352 | VarPerce nt = 1; | |||
1353 | } | 1353 | } | |||
1354 | 1354 | |||||
1355 | VarAccessi bilityTitl e += WWHSt ringUtilit ies_Escape HTML(WWHFr ame.WWHJav aScript.mM essages.mS earchRankL abel + " " + VarPerc ent + ", " ); | 1355 | VarAccessi bilityTitl e += WWHSt ringUtilit ies_Escape HTML(WWHFr ame.WWHJav aScript.mM essages.mS earchRankL abel + " " + VarPerc ent + ", " ); | |||
1356 | } | 1356 | } | |||
1357 | 1357 | |||||
1358 | // Title | 1358 | // Title | |||
1359 | // | 1359 | // | |||
1360 | Va rAccessibi lityTitle += WWHStri ngUtilitie s_EscapeHT ML(WWHFram e.WWHJavaS cript.mMes sages.mSea rchTitleLa bel + " " + Entry.mT itle); | 1360 | Va rAccessibi lityTitle += WWHStri ngUtilitie s_EscapeHT ML(WWHFram e.WWHJavaS cript.mMes sages.mSea rchTitleLa bel + " " + Entry.mT itle); | |||
1361 | 1361 | |||||
1362 | // Book | 1362 | // Book | |||
1363 | // | 1363 | // | |||
1364 | if (BookList .length > 1) // Mor e than one book exis ts | 1364 | if (BookList .length > 1) // Mor e than one book exis ts | |||
1365 | { | 1365 | { | |||
1366 | VarAccessi bilityTitl e += WWHSt ringUtilit ies_Escape HTML(WWHFr ame.WWHHel p.mMessage s.mAccessi bilityList Separator + " " + WW HFrame.WWH JavaScript .mMessages .mSearchBo okLabel + " " + Book List[Entry .mBookInde x].mTitle) ; | 1366 | VarAccessi bilityTitl e += WWHSt ringUtilit ies_Escape HTML(WWHFr ame.WWHHel p.mMessage s.mAccessi bilityList Separator + " " + WW HFrame.WWH JavaScript .mMessages .mSearchBo okLabel + " " + Book List[Entry .mBookInde x].mTitle) ; | |||
1367 | } | 1367 | } | |||
1368 | 1368 | |||||
1369 | Va rAccessibi lityTitle = " title= \"" + VarA ccessibili tyTitle + "\""; | 1369 | Va rAccessibi lityTitle = " title= \"" + VarA ccessibili tyTitle + "\""; | |||
1370 | } | 1370 | } | |||
1371 | 1371 | |||||
1372 | // D isplay Ran k | 1372 | // D isplay Ran k | |||
1373 | // | 1373 | // | |||
1374 | if ( Settings.m bShowRank) | 1374 | if ( Settings.m bShowRank) | |||
1375 | { | 1375 | { | |||
1376 | Va rPercent = Math.floo r((Entry.m Score / th is.mMaxSco re) * 100) ; | 1376 | Va rPercent = Math.floo r((Entry.m Score / th is.mMaxSco re) * 100) ; | |||
1377 | 1377 | |||||
1378 | // Some brow sers do no t allow va lue attrib utes to be 0 | 1378 | // Some brow sers do no t allow va lue attrib utes to be 0 | |||
1379 | // | 1379 | // | |||
1380 | if (VarPerce nt < 1) | 1380 | if (VarPerce nt < 1) | |||
1381 | { | 1381 | { | |||
1382 | VarPercent = 1; | 1382 | VarPercent = 1; | |||
1383 | } | 1383 | } | |||
1384 | 1384 | |||||
1385 | HT ML += "<li value=\"" + VarPerc ent + "\"> "; | 1385 | HT ML += "<li value=\"" + VarPerc ent + "\"> "; | |||
1386 | } | 1386 | } | |||
1387 | else | 1387 | else | |||
1388 | { | 1388 | { | |||
1389 | HT ML += "<li >"; | 1389 | HT ML += "<li >"; | |||
1390 | } | 1390 | } | |||
1391 | 1391 | |||||
1392 | // D isplay Tit le | 1392 | // D isplay Tit le | |||
1393 | // | 1393 | // | |||
1394 | HTML += "<a hr ef=\"javas cript:fC(" + Index + ");\"" + this.fGetP opupAction (Index) + VarAccessi bilityTitl e + ">"; | 1394 | HTML += "<a hr ef=\"javas cript:fC(" + Index + ");\"" + this.fGetP opupAction (Index) + VarAccessi bilityTitl e + ">"; | |||
1395 | HTML += Entry. mTitle; | 1395 | HTML += Entry. mTitle; | |||
1396 | HTML += "</a>" ; | 1396 | HTML += "</a>" ; | |||
1397 | 1397 | |||||
1398 | // D isplay Boo k | 1398 | // D isplay Boo k | |||
1399 | // | 1399 | // | |||
1400 | if ( (BookList. length > 1 ) && // M ore than o ne book ex ists | 1400 | if ( (BookList. length > 1 ) && // M ore than o ne book ex ists | |||
1401 | (this.mSor tedBy == 1 )) // B y Score | 1401 | (this.mSor tedBy == 1 )) // B y Score | |||
1402 | { | 1402 | { | |||
1403 | HT ML += ", " + BookLis t[Entry.mB ookIndex]. mTitle; | 1403 | HT ML += ", " + BookLis t[Entry.mB ookIndex]. mTitle; | |||
1404 | } | 1404 | } | |||
1405 | 1405 | |||||
1406 | HTML += "</li> \n"; | 1406 | HTML += "</li> \n"; | |||
1407 | 1407 | |||||
1408 | this .mHTMLSegm ent.fAppen d(HTML); | 1408 | this .mHTMLSegm ent.fAppen d(HTML); | |||
1409 | 1409 | |||||
1410 | Inde x++; | 1410 | Inde x++; | |||
1411 | } | 1411 | } | |||
1412 | 1412 | |||||
1413 | // Rec ord curren t display index so w e can pick up where we left of f | 1413 | // Rec ord curren t display index so w e can pick up where we left of f | |||
1414 | // | 1414 | // | |||
1415 | this.m DisplayInd ex = Index ; | 1415 | this.m DisplayInd ex = Index ; | |||
1416 | if (th is.mHTMLSe gment.fSiz e() > 0) | 1416 | if (th is.mHTMLSe gment.fSiz e() > 0) | |||
1417 | { | 1417 | { | |||
1418 | bSeg mentCreate d = true; | 1418 | bSeg mentCreate d = true; | |||
1419 | } | 1419 | } | |||
1420 | 1420 | |||||
1421 | // If this is th e last ent ry, close the list | 1421 | // If this is th e last ent ry, close the list | |||
1422 | // | 1422 | // | |||
1423 | if (th is.mDispla yIndex == this.mEntr ies.length ) | 1423 | if (th is.mDispla yIndex == this.mEntr ies.length ) | |||
1424 | { | 1424 | { | |||
1425 | this .mHTMLSegm ent.fAppen d("</ol>\n "); | 1425 | this .mHTMLSegm ent.fAppen d("</ol>\n "); | |||
1426 | } | 1426 | } | |||
1427 | } | 1427 | } | |||
1428 | 1428 | |||||
1429 | return b SegmentCre ated; | 1429 | return b SegmentCre ated; | |||
1430 | } | 1430 | } | |||
1431 | 1431 | |||||
1432 | function WWHSearchR esults_Get PopupActio n(ParamEnt ryIndex) | 1432 | function WWHSearchR esults_Get PopupActio n(ParamEnt ryIndex) | |||
1433 | { | 1433 | { | |||
1434 | var Pop upAction = ""; | 1434 | var Pop upAction = ""; | |||
1435 | 1435 | |||||
1436 | 1436 | |||||
1437 | if (WWHF rame.WWHJa vaScript.m Settings.m HoverText. mbEnabled) | 1437 | if (WWHF rame.WWHJa vaScript.m Settings.m HoverText. mbEnabled) | |||
1438 | { | 1438 | { | |||
1439 | PopupA ction += " onmouseov er=\"fS('" + ParamEn tryIndex + "', " + t his.mEvent String + " );\""; | 1439 | PopupA ction += " onmouseov er=\"fS('" + ParamEn tryIndex + "', " + t his.mEvent String + " );\""; | |||
1440 | PopupA ction += " onmouseou t=\"fH();\ ""; | 1440 | PopupA ction += " onmouseou t=\"fH();\ ""; | |||
1441 | } | 1441 | } | |||
1442 | 1442 | |||||
1443 | return P opupAction ; | 1443 | return P opupAction ; | |||
1444 | } | 1444 | } | |||
1445 | 1445 | |||||
1446 | function WWHSearchR esults_Sho wEntry(Par amIndex) | 1446 | function WWHSearchR esults_Sho wEntry(Par amIndex) | |||
1447 | { | 1447 | { | |||
1448 | var Ent ry; | 1448 | var Ent ry; | |||
1449 | var URL ; | 1449 | var URL ; | |||
1450 | 1450 | |||||
1451 | 1451 | |||||
1452 | // Updat e highligh t words | 1452 | // Updat e highligh t words | |||
1453 | // | 1453 | // | |||
1454 | WWHFrame .WWHHighli ghtWords.f SetWordLis t(WWHStrin gUtilities _ParseWord sAndPhrase s(WWHFrame .WWHSearch .mSavedSea rchWords)) ; | 1454 | WWHFrame .WWHHighli ghtWords.f SetWordLis t(WWHStrin gUtilities _ParseWord sAndPhrase s(WWHFrame .WWHSearch .mSavedSea rchWords)) ; | |||
1455 | 1455 | |||||
1456 | // Displ ay documen t | 1456 | // Displ ay documen t | |||
1457 | // | 1457 | // | |||
1458 | Entry = this.mEntr ies[ParamI ndex]; | 1458 | Entry = this.mEntr ies[ParamI ndex]; | |||
1459 | URL = WW HFrame.WWH Help.fGetB ookIndexFi leIndexURL (Entry.mBo okIndex, E ntry.mFile Index, nul l); | 1459 | URL = WW HFrame.WWH Help.fGetB ookIndexFi leIndexURL (Entry.mBo okIndex, E ntry.mFile Index, nul l); | |||
1460 | WWHFrame .WWHHelp.f SetDocumen tHREF(URL, false); | 1460 | WWHFrame .WWHHelp.f SetDocumen tHREF(URL, false); | |||
1461 | } | 1461 | } | |||
1462 | 1462 | |||||
1463 | function WWHSearchR esultsEntr y_Object(P aramBookIn dex, | 1463 | function WWHSearchR esultsEntr y_Object(P aramBookIn dex, | |||
1464 | P aramFileIn dex, | 1464 | P aramFileIn dex, | |||
1465 | P aramScore, | 1465 | P aramScore, | |||
1466 | P aramTitle) | 1466 | P aramTitle) | |||
1467 | { | 1467 | { | |||
1468 | this.mBo okIndex = ParamBookI ndex; | 1468 | this.mBo okIndex = ParamBookI ndex; | |||
1469 | this.mFi leIndex = ParamFileI ndex; | 1469 | this.mFi leIndex = ParamFileI ndex; | |||
1470 | this.mSc ore = ParamScore ; | 1470 | this.mSc ore = ParamScore ; | |||
1471 | this.mTi tle = ParamTitle ; | 1471 | this.mTi tle = ParamTitle ; | |||
1472 | } | 1472 | } | |||
1473 | 1473 | |||||
1474 | function WWHSearchR esultsEntr y_ByScoreB yBookIndex ByTitleFil eIndexURL( ParamAlpha Entry, | 1474 | function WWHSearchR esultsEntr y_ByScoreB yBookIndex ByTitleFil eIndexURL( ParamAlpha Entry, | |||
1475 | ParamBetaE ntry) | 1475 | ParamBetaE ntry) | |||
1476 | { | 1476 | { | |||
1477 | var Res ult; | 1477 | var Res ult; | |||
1478 | 1478 | |||||
1479 | 1479 | |||||
1480 | Result = WWHSearch ResultsEnt ry_Compare ByScore(Pa ramAlphaEn try, Param BetaEntry) ; | 1480 | Result = WWHSearch ResultsEnt ry_Compare ByScore(Pa ramAlphaEn try, Param BetaEntry) ; | |||
1481 | if (Resu lt == 0) | 1481 | if (Resu lt == 0) | |||
1482 | { | 1482 | { | |||
1483 | Result = WWHSear chResultsE ntry_Compa reByBookIn dex(ParamA lphaEntry, ParamBeta Entry); | 1483 | Result = WWHSear chResultsE ntry_Compa reByBookIn dex(ParamA lphaEntry, ParamBeta Entry); | |||
1484 | } | 1484 | } | |||
1485 | if (Resu lt == 0) | 1485 | if (Resu lt == 0) | |||
1486 | { | 1486 | { | |||
1487 | Result = WWHSear chResultsE ntry_Compa reByTitleF ileIndexUR L(ParamAlp haEntry, P aramBetaEn try); | 1487 | Result = WWHSear chResultsE ntry_Compa reByTitleF ileIndexUR L(ParamAlp haEntry, P aramBetaEn try); | |||
1488 | } | 1488 | } | |||
1489 | 1489 | |||||
1490 | return R esult; | 1490 | return R esult; | |||
1491 | } | 1491 | } | |||
1492 | 1492 | |||||
1493 | function WWHSearchR esultsEntr y_ByBookIn dexByScore ByTitleFil eIndexURL( ParamAlpha Entry, | 1493 | function WWHSearchR esultsEntr y_ByBookIn dexByScore ByTitleFil eIndexURL( ParamAlpha Entry, | |||
1494 | ParamBetaE ntry) | 1494 | ParamBetaE ntry) | |||
1495 | { | 1495 | { | |||
1496 | var Res ult; | 1496 | var Res ult; | |||
1497 | 1497 | |||||
1498 | 1498 | |||||
1499 | Result = WWHSearch ResultsEnt ry_Compare ByBookInde x(ParamAlp haEntry, P aramBetaEn try); | 1499 | Result = WWHSearch ResultsEnt ry_Compare ByBookInde x(ParamAlp haEntry, P aramBetaEn try); | |||
1500 | if (Resu lt == 0) | 1500 | if (Resu lt == 0) | |||
1501 | { | 1501 | { | |||
1502 | Result = WWHSear chResultsE ntry_Compa reByScore( ParamAlpha Entry, Par amBetaEntr y); | 1502 | Result = WWHSear chResultsE ntry_Compa reByScore( ParamAlpha Entry, Par amBetaEntr y); | |||
1503 | } | 1503 | } | |||
1504 | if (Resu lt == 0) | 1504 | if (Resu lt == 0) | |||
1505 | { | 1505 | { | |||
1506 | Result = WWHSear chResultsE ntry_Compa reByTitleF ileIndexUR L(ParamAlp haEntry, P aramBetaEn try); | 1506 | Result = WWHSear chResultsE ntry_Compa reByTitleF ileIndexUR L(ParamAlp haEntry, P aramBetaEn try); | |||
1507 | } | 1507 | } | |||
1508 | 1508 | |||||
1509 | return R esult; | 1509 | return R esult; | |||
1510 | } | 1510 | } | |||
1511 | 1511 | |||||
1512 | function WWHSearchR esultsEntr y_CompareB yScore(Par amAlphaEnt ry, | 1512 | function WWHSearchR esultsEntr y_CompareB yScore(Par amAlphaEnt ry, | |||
1513 | Par amBetaEntr y) | 1513 | Par amBetaEntr y) | |||
1514 | { | 1514 | { | |||
1515 | var Res ult = 0; | 1515 | var Res ult = 0; | |||
1516 | 1516 | |||||
1517 | 1517 | |||||
1518 | // Sort by score | 1518 | // Sort by score | |||
1519 | // | 1519 | // | |||
1520 | if (Para mAlphaEntr y.mScore < ParamBeta Entry.mSco re) | 1520 | if (Para mAlphaEntr y.mScore < ParamBeta Entry.mSco re) | |||
1521 | { | 1521 | { | |||
1522 | Result = 1; | 1522 | Result = 1; | |||
1523 | } | 1523 | } | |||
1524 | else if (ParamAlph aEntry.mSc ore > Para mBetaEntry .mScore) | 1524 | else if (ParamAlph aEntry.mSc ore > Para mBetaEntry .mScore) | |||
1525 | { | 1525 | { | |||
1526 | Result = -1; | 1526 | Result = -1; | |||
1527 | } | 1527 | } | |||
1528 | 1528 | |||||
1529 | return R esult; | 1529 | return R esult; | |||
1530 | } | 1530 | } | |||
1531 | 1531 | |||||
1532 | function WWHSearchR esultsEntr y_CompareB yBookIndex (ParamAlph aEntry, | 1532 | function WWHSearchR esultsEntr y_CompareB yBookIndex (ParamAlph aEntry, | |||
1533 | ParamBeta Entry) | 1533 | ParamBeta Entry) | |||
1534 | { | 1534 | { | |||
1535 | var Res ult = 0; | 1535 | var Res ult = 0; | |||
1536 | 1536 | |||||
1537 | 1537 | |||||
1538 | if (Para mAlphaEntr y.mBookInd ex < Param BetaEntry. mBookIndex ) | 1538 | if (Para mAlphaEntr y.mBookInd ex < Param BetaEntry. mBookIndex ) | |||
1539 | { | 1539 | { | |||
1540 | Result = -1; | 1540 | Result = -1; | |||
1541 | } | 1541 | } | |||
1542 | else if (ParamAlph aEntry.mBo okIndex > ParamBetaE ntry.mBook Index) | 1542 | else if (ParamAlph aEntry.mBo okIndex > ParamBetaE ntry.mBook Index) | |||
1543 | { | 1543 | { | |||
1544 | Result = 1; | 1544 | Result = 1; | |||
1545 | } | 1545 | } | |||
1546 | 1546 | |||||
1547 | return R esult; | 1547 | return R esult; | |||
1548 | } | 1548 | } | |||
1549 | 1549 | |||||
1550 | function WWHSearchR esultsEntr y_CompareB yTitleFile IndexURL(P aramAlphaE ntry, | 1550 | function WWHSearchR esultsEntr y_CompareB yTitleFile IndexURL(P aramAlphaE ntry, | |||
1551 | P aramBetaEn try) | 1551 | P aramBetaEn try) | |||
1552 | { | 1552 | { | |||
1553 | var Res ult = 0; | 1553 | var Res ult = 0; | |||
1554 | var Boo kList; | 1554 | var Boo kList; | |||
1555 | var Alp haBookEntr y; | 1555 | var Alp haBookEntr y; | |||
1556 | var Bet aBookEntry ; | 1556 | var Bet aBookEntry ; | |||
1557 | var Alp haURL; | 1557 | var Alp haURL; | |||
1558 | var Bet aURL; | 1558 | var Bet aURL; | |||
1559 | 1559 | |||||
1560 | 1560 | |||||
1561 | // Sort by Title | 1561 | // Sort by Title | |||
1562 | // | 1562 | // | |||
1563 | if (Para mAlphaEntr y.mTitle < ParamBeta Entry.mTit le) | 1563 | if (Para mAlphaEntr y.mTitle < ParamBeta Entry.mTit le) | |||
1564 | { | 1564 | { | |||
1565 | Result = -1; | 1565 | Result = -1; | |||
1566 | } | 1566 | } | |||
1567 | else if (ParamAlph aEntry.mTi tle > Para mBetaEntry .mTitle) | 1567 | else if (ParamAlph aEntry.mTi tle > Para mBetaEntry .mTitle) | |||
1568 | { | 1568 | { | |||
1569 | Result = 1; | 1569 | Result = 1; | |||
1570 | } | 1570 | } | |||
1571 | // Sort by FileInd ex | 1571 | // Sort by FileInd ex | |||
1572 | // | 1572 | // | |||
1573 | else if (ParamAlph aEntry.mFi leIndex < ParamBetaE ntry.mFile Index) | 1573 | else if (ParamAlph aEntry.mFi leIndex < ParamBetaE ntry.mFile Index) | |||
1574 | { | 1574 | { | |||
1575 | Result = -1; | 1575 | Result = -1; | |||
1576 | } | 1576 | } | |||
1577 | else if (ParamAlph aEntry.mFi leIndex > ParamBetaE ntry.mFile Index) | 1577 | else if (ParamAlph aEntry.mFi leIndex > ParamBetaE ntry.mFile Index) | |||
1578 | { | 1578 | { | |||
1579 | Result = 1; | 1579 | Result = 1; | |||
1580 | } | 1580 | } | |||
1581 | // Sort by URL | 1581 | // Sort by URL | |||
1582 | // | 1582 | // | |||
1583 | else | 1583 | else | |||
1584 | { | 1584 | { | |||
1585 | BookLi st = WWHFr ame.WWHHel p.mBooks.m BookList; | 1585 | BookLi st = WWHFr ame.WWHHel p.mBooks.m BookList; | |||
1586 | 1586 | |||||
1587 | AlphaB ookEntry = BookList[ ParamAlpha Entry.mBoo kIndex]; | 1587 | AlphaB ookEntry = BookList[ ParamAlpha Entry.mBoo kIndex]; | |||
1588 | BetaBo okEntry = BookList[ ParamBetaE ntry.mBook Index]; | 1588 | BetaBo okEntry = BookList[ ParamBetaE ntry.mBook Index]; | |||
1589 | 1589 | |||||
1590 | AlphaU RL = WWHFr ame.WWHHel p.mBaseURL + AlphaBo okEntry.mD irectory + AlphaBook Entry.mFil es.fFileIn dexToHREF( ParamAlpha Entry.mFil eIndex); | 1590 | AlphaU RL = WWHFr ame.WWHHel p.mBaseURL + AlphaBo okEntry.mD irectory + AlphaBook Entry.mFil es.fFileIn dexToHREF( ParamAlpha Entry.mFil eIndex); | |||
1591 | BetaUR L = WWHFr ame.WWHHel p.mBaseURL + BetaBoo kEntry.mDi rectory + BetaBookEn try.mFiles .fFileInde xToHREF(Pa ramBetaEnt ry.mFileIn dex); | 1591 | BetaUR L = WWHFr ame.WWHHel p.mBaseURL + BetaBoo kEntry.mDi rectory + BetaBookEn try.mFiles .fFileInde xToHREF(Pa ramBetaEnt ry.mFileIn dex); | |||
1592 | 1592 | |||||
1593 | if (Al phaURL < B etaURL) | 1593 | if (Al phaURL < B etaURL) | |||
1594 | { | 1594 | { | |||
1595 | Resu lt = -1; | 1595 | Resu lt = -1; | |||
1596 | } | 1596 | } | |||
1597 | else i f (AlphaUR L > BetaUR L) | 1597 | else i f (AlphaUR L > BetaUR L) | |||
1598 | { | 1598 | { | |||
1599 | Resu lt = 1; | 1599 | Resu lt = 1; | |||
1600 | } | 1600 | } | |||
1601 | } | 1601 | } | |||
1602 | 1602 | |||||
1603 | return R esult; | 1603 | return R esult; | |||
1604 | } | 1604 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2007 Araxis Ltd (www.araxis.com). All rights reserved.