Produced by Araxis Merge on Thu Oct 16 22:30:02 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\common\scripts | browser.js | Tue Sep 4 22:03:42 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\common\scripts | browser.js | Mon Oct 13 05:51:54 2008 UTC |
Description | Between Files 1 and 2 |
|
---|---|---|
Text Blocks | Lines | |
Unchanged | 7 | 1132 |
Changed | 1 | 2 |
Inserted | 0 | 0 |
Removed | 5 | 40 |
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 WWHBrowser Utilities_ SearchRepl ace(ParamS tring, | 4 | function WWHBrowser Utilities_ SearchRepl ace(ParamS tring, | |||
5 | ParamS earchStrin g, | 5 | ParamS earchStrin g, | |||
6 | ParamR eplaceStri ng) | 6 | ParamR eplaceStri ng) | |||
7 | { | 7 | { | |||
8 | var Res ultString; | 8 | var Res ultString; | |||
9 | var Ind ex; | 9 | var Ind ex; | |||
10 | 10 | |||||
11 | 11 | |||||
12 | ResultSt ring = Par amString; | 12 | ResultSt ring = Par amString; | |||
13 | 13 | |||||
14 | if ((Par amSearchSt ring.lengt h > 0) && | 14 | if ((Par amSearchSt ring.lengt h > 0) && | |||
15 | (Res ultString. length > 0 )) | 15 | (Res ultString. length > 0 )) | |||
16 | { | 16 | { | |||
17 | Index = 0; | 17 | Index = 0; | |||
18 | while ((Index = ResultStri ng.indexOf (ParamSear chString, Index)) != -1) | 18 | while ((Index = ResultStri ng.indexOf (ParamSear chString, Index)) != -1) | |||
19 | { | 19 | { | |||
20 | Resu ltString = ResultStr ing.substr ing(0, Ind ex) + Para mReplaceSt ring + Res ultString. substring( Index + Pa ramSearchS tring.leng th, Result String.len gth); | 20 | Resu ltString = ResultStr ing.substr ing(0, Ind ex) + Para mReplaceSt ring + Res ultString. substring( Index + Pa ramSearchS tring.leng th, Result String.len gth); | |||
21 | Inde x += Param ReplaceStr ing.length ; | 21 | Inde x += Param ReplaceStr ing.length ; | |||
22 | } | 22 | } | |||
23 | } | 23 | } | |||
24 | 24 | |||||
25 | return R esultStrin g; | 25 | return R esultStrin g; | |||
26 | } | 26 | } | |||
27 | 27 | |||||
28 | function WWHBrowser Utilities_ EscapeURLF orJavaScri ptAnchor(P aramURL) | 28 | function WWHBrowser Utilities_ EscapeURLF orJavaScri ptAnchor(P aramURL) | |||
29 | { | 29 | { | |||
30 | var Esc apedURL = ParamURL; | 30 | var Esc apedURL = ParamURL; | |||
31 | 31 | |||||
32 | 32 | |||||
33 | // Escap e problema tic charac ters | 33 | // Escap e problema tic charac ters | |||
34 | // \ " ' < > | 34 | // \ " ' < > | |||
35 | // | 35 | // | |||
36 | EscapedU RL = WWHBr owserUtili ties_Searc hReplace(E scapedURL, "\\", "\\ \\"); | 36 | EscapedU RL = WWHBr owserUtili ties_Searc hReplace(E scapedURL, "\\", "\\ \\"); | |||
37 | EscapedU RL = WWHBr owserUtili ties_Searc hReplace(E scapedURL, "\"", "\\ u0022"); | 37 | EscapedU RL = WWHBr owserUtili ties_Searc hReplace(E scapedURL, "\"", "\\ u0022"); | |||
38 | EscapedU RL = WWHBr owserUtili ties_Searc hReplace(E scapedURL, "'", "\\u 0027"); | 38 | EscapedU RL = WWHBr owserUtili ties_Searc hReplace(E scapedURL, "'", "\\u 0027"); | |||
39 | EscapedU RL = WWHBr owserUtili ties_Searc hReplace(E scapedURL, "<", "\\u 003c"); | 39 | EscapedU RL = WWHBr owserUtili ties_Searc hReplace(E scapedURL, "<", "\\u 003c"); | |||
40 | EscapedU RL = WWHBr owserUtili ties_Searc hReplace(E scapedURL, ">", "\\u 003e"); | 40 | EscapedU RL = WWHBr owserUtili ties_Searc hReplace(E scapedURL, ">", "\\u 003e"); | |||
41 | 41 | |||||
42 | return E scapedURL; | 42 | return E scapedURL; | |||
43 | } | 43 | } | |||
44 | 44 | |||||
45 | function WWHBrowser _Object() | 45 | function WWHBrowser _Object() | |||
46 | { | 46 | { | |||
47 | this.mLo cale = "en"; | 47 | this.mLo cale = "en"; | |||
48 | this.mPl atform = 0; // Shorth and for Un known | 48 | this.mPl atform = 0; // Shorth and for Un known | |||
49 | this.mBr owser = 0; // Shorth and for Un known | 49 | this.mBr owser = 0; // Shorth and for Un known | |||
50 | this.mCo okiePath = "/"; | 50 | this.mCo okiePath = "/"; | |||
51 | this.mbC ookiesEnab led = null; | 51 | this.mbC ookiesEnab led = null; | |||
52 | this.mbS upportsFoc us = false; | 52 | this.mbS upportsFoc us = false; | |||
53 | this.mbS upportsPop ups = true; | 53 | this.mbS upportsPop ups = true; | |||
54 | this.mbS upportsIFr ames = false; | 54 | this.mbS upportsIFr ames = false; | |||
55 | this.mbS upportsFra meRenaming = true; | 55 | this.mbS upportsFra meRenaming = true; | |||
56 | this.mbW indowIE40 = false; // Needed for speci al case ha ndling | 56 | this.mbW indowIE40 = false; // Needed for speci al case ha ndling | |||
57 | this.mbM acIE45 = false; // Needed for speci al case ha ndling | 57 | this.mbM acIE45 = false; // Needed for speci al case ha ndling | |||
58 | this.mbM acIE50 = false; // Needed for speci al case ha ndling | 58 | this.mbM acIE50 = false; // Needed for speci al case ha ndling | |||
59 | this.mbU nescapeHRE Fs = true; // Needed for speci al case ha ndling | |||||
60 | this.mbW indowsIE60 = false; // Needed for speci al case ha ndling | 59 | this.mbW indowsIE60 = false; // Needed for speci al case ha ndling | |||
61 | this.mbU nsupported = false; | 60 | this.mbU nsupported = false; | |||
62 | 61 | |||||
63 | this.fIn itialize = WWHBrowse r_Initiali ze; | 62 | this.fIn itialize = WWHB rowser_Ini tialize; | |||
64 | this.fNo rmalizeURL = WWHBrowse r_Normaliz eURL; | 63 | this.fNo rmalizeURL = WWHB rowser_Nor malizeURL; | |||
65 | this.fRe storeEscap edSpaces = WWHBrowse r_RestoreE scapedSpac es; | |||||
66 | this.fSe tLocation = WWHBrowse r_SetLocat ion; | 64 | this.fSe tLocation = WWHB rowser_Set Location; | |||
67 | this.fRe placeLocat ion = WWHBrowse r_ReplaceL ocation; | 65 | this.fRe placeLocat ion = WWHB rowser_Rep laceLocati on; | |||
68 | this.fRe loadLocati on = WWHBrowse r_ReloadLo cation; | 66 | this.fRe loadLocati on = WWHB rowser_Rel oadLocatio n; | |||
69 | this.fSe tCookiePat h = WWHBrowse r_SetCooki ePath; | 67 | this.fSe tCookiePat h = WWHB rowser_Set CookiePath ; | |||
70 | this.fCo okiesEnabl ed = WWHBrowse r_CookiesE nabled; | 68 | this.fCo okiesEnabl ed = WWHB rowser_Coo kiesEnable d; | |||
71 | this.fSe tCookie = WWHBrowse r_SetCooki e; | 69 | this.fSe tCookie = WWHB rowser_Set Cookie; | |||
72 | this.fGe tCookie = WWHBrowse r_GetCooki e; | 70 | this.fGe tCookie = WWHB rowser_Get Cookie; | |||
73 | this.fDe leteCookie = WWHBrowse r_DeleteCo okie; | 71 | this.fDe leteCookie = WWHB rowser_Del eteCookie; | |||
74 | this.fFo cus = WWHBrowse r_Focus; | 72 | this.fFo cus = WWHB rowser_Foc us; | |||
75 | 73 | |||||
76 | // Initi alize obje ct | 74 | // Initi alize obje ct | |||
77 | // | 75 | // | |||
78 | this.fIn itialize() ; | 76 | this.fIn itialize() ; | |||
79 | } | 77 | } | |||
80 | 78 | |||||
81 | function WWHBrowser _Initializ e() | 79 | function WWHBrowser _Initializ e() | |||
82 | { | 80 | { | |||
83 | var Age nt; | 81 | var Age nt; | |||
84 | var Maj orVersion = 0; | 82 | var Maj orVersion = 0; | |||
85 | var Ver sionString ; | 83 | var Ver sionString ; | |||
86 | var Ver sion = 0.0 ; | 84 | var Ver sion = 0.0 ; | |||
87 | 85 | |||||
88 | 86 | |||||
89 | // Reset locale to correct l anguage va lue | 87 | // Reset locale to correct l anguage va lue | |||
90 | // | 88 | // | |||
91 | if ((typ eof(naviga tor.langua ge) != "un defined") && | 89 | if ((typ eof(naviga tor.langua ge) != "un defined") && | |||
92 | (nav igator.lan guage != n ull)) | 90 | (nav igator.lan guage != n ull)) | |||
93 | { | 91 | { | |||
94 | this.m Locale = n avigator.l anguage; | 92 | this.m Locale = n avigator.l anguage; | |||
95 | } | 93 | } | |||
96 | else if ((typeof(n avigator.u serLanguag e) != "und efined") & & | 94 | else if ((typeof(n avigator.u serLanguag e) != "und efined") & & | |||
97 | (navigato r.userLang uage != nu ll)) | 95 | (navigato r.userLang uage != nu ll)) | |||
98 | { | 96 | { | |||
99 | this.m Locale = n avigator.u serLanguag e; | 97 | this.m Locale = n avigator.u serLanguag e; | |||
100 | } | 98 | } | |||
101 | 99 | |||||
102 | // Conve rt everyth ing to low ercase | 100 | // Conve rt everyth ing to low ercase | |||
103 | // | 101 | // | |||
104 | this.mLo cale = thi s.mLocale. toLowerCas e(); | 102 | this.mLo cale = thi s.mLocale. toLowerCas e(); | |||
105 | 103 | |||||
106 | // Repla ce '-'s wi th '_'s | 104 | // Repla ce '-'s wi th '_'s | |||
107 | // | 105 | // | |||
108 | this.mLo cale = WWH BrowserUti lities_Sea rchReplace (this.mLoc ale, "-", "_"); | 106 | this.mLo cale = WWH BrowserUti lities_Sea rchReplace (this.mLoc ale, "-", "_"); | |||
109 | 107 | |||||
110 | // Get b rowser inf o | 108 | // Get b rowser inf o | |||
111 | // | 109 | // | |||
112 | Agent = navigator. userAgent. toLowerCas e(); | 110 | Agent = navigator. userAgent. toLowerCas e(); | |||
113 | 111 | |||||
114 | // Deter mine platf orm | 112 | // Deter mine platf orm | |||
115 | // | 113 | // | |||
116 | if ((Age nt.indexOf ("win") != -1) || | 114 | if ((Age nt.indexOf ("win") != -1) || | |||
117 | (Age nt.indexOf ("16bit") != -1)) | 115 | (Age nt.indexOf ("16bit") != -1)) | |||
118 | { | 116 | { | |||
119 | this.m Platform = 1; // Sh orthand fo r Windows | 117 | this.m Platform = 1; // Sh orthand fo r Windows | |||
120 | } | 118 | } | |||
121 | else if (Agent.ind exOf("mac" ) != -1) | 119 | else if (Agent.ind exOf("mac" ) != -1) | |||
122 | { | 120 | { | |||
123 | this.m Platform = 2; // Sh orthand fo r Macintos h | 121 | this.m Platform = 2; // Sh orthand fo r Macintos h | |||
124 | } | 122 | } | |||
125 | 123 | |||||
126 | // Deter mine brows er | 124 | // Deter mine brows er | |||
127 | // | 125 | // | |||
128 | if ((Age nt.indexOf ("mozilla" ) != -1) & & | 126 | if ((Age nt.indexOf ("mozilla" ) != -1) & & | |||
129 | (Age nt.indexOf ("spoofer" ) == -1) & & | 127 | (Age nt.indexOf ("spoofer" ) == -1) & & | |||
130 | (Age nt.indexOf ("compatib le") == -1 )) | 128 | (Age nt.indexOf ("compatib le") == -1 )) | |||
131 | { | 129 | { | |||
132 | MajorV ersion = p arseInt(na vigator.ap pVersion) | 130 | MajorV ersion = p arseInt(na vigator.ap pVersion) | |||
133 | 131 | |||||
134 | if (Ma jorVersion >= 5) | 132 | if (Ma jorVersion >= 5) | |||
135 | { | 133 | { | |||
136 | this .mBrowser = 4; // S horthand f or Netscap e 6.0 | 134 | this .mBrowser = 4; // S horthand f or Netscap e 6.0 | |||
137 | this .mbSupport sIFrames = true; | 135 | this .mbSupport sIFrames = true; | |||
138 | this .mbSupport sFocus = t rue; | 136 | this .mbSupport sFocus = t rue; | |||
139 | 137 | |||||
140 | // N etscape 6. 0 is unsup ported | 138 | // N etscape 6. 0 is unsup ported | |||
141 | // | 139 | // | |||
142 | if ( navigator. userAgent. indexOf("m 18") != -1 ) | 140 | if ( navigator. userAgent. indexOf("m 18") != -1 ) | |||
143 | { | 141 | { | |||
144 | th is.mbUnsup ported = t rue; | 142 | th is.mbUnsup ported = t rue; | |||
145 | } | 143 | } | |||
146 | } | 144 | } | |||
147 | else i f (MajorVe rsion >= 4 ) | 145 | else i f (MajorVe rsion >= 4 ) | |||
148 | { | 146 | { | |||
149 | this .mBrowser = 1; // S horthand f or Netscap e | 147 | this .mBrowser = 1; // S horthand f or Netscap e | |||
150 | 148 | |||||
151 | this .mbSupport sFrameRena ming = fal se; | 149 | this .mbSupport sFrameRena ming = fal se; | |||
152 | } | 150 | } | |||
153 | } | 151 | } | |||
154 | else if (Agent.ind exOf("msie ") != -1) | 152 | else if (Agent.ind exOf("msie ") != -1) | |||
155 | { | 153 | { | |||
156 | MajorV ersion = p arseInt(na vigator.ap pVersion) | 154 | MajorV ersion = p arseInt(na vigator.ap pVersion) | |||
157 | if (Ma jorVersion >= 4) | 155 | if (Ma jorVersion >= 4) | |||
158 | { | 156 | { | |||
159 | this .mBrowser = 2; // S horthand f or IE | 157 | this .mBrowser = 2; // S horthand f or IE | |||
160 | this .mbSupport sFocus = t rue; | 158 | this .mbSupport sFocus = t rue; | |||
161 | 159 | |||||
162 | // A dditional info neede d for popu ps | 160 | // A dditional info neede d for popu ps | |||
163 | // | 161 | // | |||
164 | Vers ionString = navigato r.appVersi on.toLower Case(); | 162 | Vers ionString = navigato r.appVersi on.toLower Case(); | |||
165 | MSIE VersionStr ing = Vers ionString. substring( VersionStr ing.indexO f("msie") + 4); | 163 | MSIE VersionStr ing = Vers ionString. substring( VersionStr ing.indexO f("msie") + 4); | |||
166 | Vers ion = pars eFloat(MSI EVersionSt ring); | 164 | Vers ion = pars eFloat(MSI EVersionSt ring); | |||
167 | if ( (Version > = 4.0) && | 165 | if ( (Version > = 4.0) && | |||
168 | (Version < 4.1)) | 166 | (Version < 4.1)) | |||
169 | { | 167 | { | |||
170 | if (this.mPl atform == 1) // Sho rthand for Windows | 168 | if (this.mPl atform == 1) // Sho rthand for Windows | |||
171 | { | 169 | { | |||
172 | this.mbWin dowsIE40 = true; | 170 | this.mbWin dowsIE40 = true; | |||
173 | } | 171 | } | |||
174 | } | 172 | } | |||
175 | else if ((Vers ion >= 4.5 ) && | 173 | else if ((Vers ion >= 4.5 ) && | |||
176 | (Vers ion < 4.6) ) | 174 | (Vers ion < 4.6) ) | |||
177 | { | 175 | { | |||
178 | if (this.mPl atform == 2) // Sho rthand for Macintosh | 176 | if (this.mPl atform == 2) // Sho rthand for Macintosh | |||
179 | { | 177 | { | |||
180 | this.mbMac IE45 = tru e; | 178 | this.mbMac IE45 = tru e; | |||
181 | } | 179 | } | |||
182 | } | 180 | } | |||
183 | else if ((Vers ion >= 5.0 ) && | 181 | else if ((Vers ion >= 5.0 ) && | |||
184 | (Vers ion < 5.1) ) | 182 | (Vers ion < 5.1) ) | |||
185 | { | 183 | { | |||
186 | if (this.mPl atform == 2) // Sho rthand for Macintosh | 184 | if (this.mPl atform == 2) // Sho rthand for Macintosh | |||
187 | { | 185 | { | |||
188 | this.mbMac IE50 = tru e; | 186 | this.mbMac IE50 = tru e; | |||
189 | } | 187 | } | |||
190 | } | 188 | } | |||
191 | else if ((Vers ion >= 5.5 ) && | 189 | else if ((Vers ion >= 5.5 ) && | |||
192 | (Vers ion < 6.0) ) | 190 | (Vers ion < 6.0) ) | |||
193 | { | 191 | { | |||
194 | th is.mbSuppo rtsIFrames = true; | 192 | th is.mbSuppo rtsIFrames = true; | |||
195 | } | 193 | } | |||
196 | else if (Versi on >= 6.0) | 194 | else if (Versi on >= 6.0) | |||
197 | { | 195 | { | |||
198 | th is.mbSuppo rtsIFrames = true; | 196 | th is.mbSuppo rtsIFrames = true; | |||
199 | th is.mbWindo wsIE60 = t rue; | 197 | th is.mbWindo wsIE60 = t rue; | |||
200 | } | 198 | } | |||
201 | } | 199 | } | |||
202 | } | 200 | } | |||
203 | else if (Agent.ind exOf("icab ") != -1) | 201 | else if (Agent.ind exOf("icab ") != -1) | |||
204 | { | 202 | { | |||
205 | this.m Browser = 3; // Sho rthand for iCab | 203 | this.m Browser = 3; // Sho rthand for iCab | |||
206 | 204 | |||||
207 | this.m bSupportsP opups = fa lse; | 205 | this.m bSupportsP opups = fa lse; | |||
208 | } | 206 | } | |||
209 | 207 | |||||
210 | // Safar i may spoo f as just about anyt hing | 208 | // Safar i may spoo f as just about anyt hing | |||
211 | // | 209 | // | |||
212 |
if
(Agent.ind
exOf("
saf
a
r
i
|
210 |
if
(Agent.ind
exOf("
|
|||
213 | { | 211 | { | |||
214 | this.m Browser = 5; // Sho rthand for Safari | 212 | this.m Browser = 5; // Sho rthand for Safari | |||
215 | 213 | |||||
216 | this.m bSupportsP opups = tr ue; | 214 | this.m bSupportsP opups = tr ue; | |||
217 | this.m bSupportsI Frames = t rue; | 215 | this.m bSupportsI Frames = t rue; | |||
218 | this.m bSupportsF ocus = fal se; | 216 | this.m bSupportsF ocus = fal se; | |||
219 | } | 217 | } | |||
220 | ||||||
221 | // Set m bUnescapeH REFs boole an | |||||
222 | // | |||||
223 | if ((thi s.mBrowser == 2) && // Shorth and for IE | |||||
224 | (thi s.mPlatfor m == 1)) // Shorth and for Wi ndows | |||||
225 | { | |||||
226 | if (Ma jorVersion >= 5) | |||||
227 | { | |||||
228 | this .mbUnescap eHREFs = f alse; | |||||
229 | } | |||||
230 | } | |||||
231 | } | 218 | } | |||
232 | 219 | |||||
233 | function WWHBrowser _Normalize URL(ParamU RL) | 220 | function WWHBrowser _Normalize URL(ParamU RL) | |||
234 | { | 221 | { | |||
235 | var URL = ParamUR L; | 222 | var URL = ParamUR L; | |||
236 | var Par ts; | 223 | var Par ts; | |||
237 | var Max Index; | 224 | var Max Index; | |||
238 | var Ind ex; | 225 | var Ind ex; | |||
239 | var Dri vePattern; | 226 | var Dri vePattern; | |||
240 | var Dri vePatternM atch; | 227 | var Dri vePatternM atch; | |||
241 | 228 | |||||
242 | 229 | |||||
243 | // Unesc ape URL fo r most bro wsers | |||||
244 | // | |||||
245 | if (this .mbUnescap eHREFs) | |||||
246 | { | |||||
247 | URL = unescape(U RL); | |||||
248 | } | |||||
249 | else // IE unesca pes everyt hing autom atically, except & | |||||
250 | { | |||||
251 | URL = WWHBrowser Utilities_ SearchRepl ace(URL, " %26", "&") ; | |||||
252 | } | |||||
253 | ||||||
254 | // Stand ardize pro tocol case | 230 | // Stand ardize pro tocol case | |||
255 | // | 231 | // | |||
256 | if (URL. indexOf(": ") != -1) | 232 | if (URL. indexOf(": ") != -1) | |||
257 | { | 233 | { | |||
258 | Parts = URL.spli t(":"); | 234 | Parts = URL.spli t(":"); | |||
259 | 235 | |||||
260 | URL = Parts[0].t oLowerCase (); | 236 | URL = Parts[0].t oLowerCase (); | |||
261 | for (M axIndex = Parts.leng th, Index = 1 ; Inde x < MaxInd ex ; Index ++) | 237 | for (M axIndex = Parts.leng th, Index = 1 ; Inde x < MaxInd ex ; Index ++) | |||
262 | { | 238 | { | |||
263 | URL += ":" + P arts[Index ]; | 239 | URL += ":" + P arts[Index ]; | |||
264 | } | 240 | } | |||
265 | } | 241 | } | |||
266 | 242 | |||||
267 | // Handl e drive le tters unde r Windows | 243 | // Handl e drive le tters unde r Windows | |||
268 | // | 244 | // | |||
269 | if (this .mPlatform == 1) // Shorthand for Windo ws | 245 | if (this .mPlatform == 1) // Shorthand for Windo ws | |||
270 | { | 246 | { | |||
271 | DriveP attern = n ew RegExp( "^file:[/] +([a-zA-Z] )[:\|][/]( .*)$", "i" ); | 247 | DriveP attern = n ew RegExp( "^file:[/] +([a-zA-Z] )[:\|][/]( .*)$", "i" ); | |||
272 | DriveP atternMatc h = DriveP attern.exe c(URL); | 248 | DriveP atternMatc h = DriveP attern.exe c(URL); | |||
273 | if (Dr ivePattern Match != n ull) | 249 | if (Dr ivePattern Match != n ull) | |||
274 | { | 250 | { | |||
275 | URL = "file:// /" + Drive PatternMat ch[1] + ": /" + Drive PatternMat ch[2]; | 251 | URL = "file:// /" + Drive PatternMat ch[1] + ": /" + Drive PatternMat ch[2]; | |||
276 | } | 252 | } | |||
277 | } | 253 | } | |||
278 | 254 | |||||
279 | return U RL; | 255 | return U RL; | |||
280 | } | 256 | } | |||
281 | 257 | |||||
282 | function WWHBrowser _RestoreEs capedSpace s(ParamURL ) | |||||
283 | { | |||||
284 | // Worka round for stupid Net scape 4.x bug | |||||
285 | // | |||||
286 | var Str ingWithSpa ce = "x x" ; | |||||
287 | var Esc apedURL = ParamURL; | |||||
288 | ||||||
289 | ||||||
290 | if (this .mbUnescap eHREFs) | |||||
291 | { | |||||
292 | Escape dURL = WWH BrowserUti lities_Sea rchReplace (EscapedUR L, StringW ithSpace.s ubstring(1 , 2), "%20 "); | |||||
293 | } | |||||
294 | ||||||
295 | return E scapedURL; | |||||
296 | } | |||||
297 | ||||||
298 | function WWHBrowser _SetLocati on(ParamFr ameReferen ce, | 258 | function WWHBrowser _SetLocati on(ParamFr ameReferen ce, | |||
299 | ParamUR L) | 259 | ParamUR L) | |||
300 | { | 260 | { | |||
301 | var Esc apedURL; | 261 | var Esc apedURL; | |||
302 | 262 | |||||
303 | 263 | |||||
304 | EscapedU RL = WWHBr owserUtili ties_Escap eURLForJav aScriptAnc hor(ParamU RL); | 264 | EscapedU RL = WWHBr owserUtili ties_Escap eURLForJav aScriptAnc hor(ParamU RL); | |||
305 | setTimeo ut(ParamFr ameReferen ce + ".loc ation = \" " + Escape dURL + "\" ;", 1); | 265 | setTimeo ut(ParamFr ameReferen ce + ".loc ation = \" " + Escape dURL + "\" ;", 1); | |||
306 | } | 266 | } | |||
307 | 267 | |||||
308 | function WWHBrowser _ReplaceLo cation(Par amFrameRef erence, | 268 | function WWHBrowser _ReplaceLo cation(Par amFrameRef erence, | |||
309 | Par amURL) | 269 | Par amURL) | |||
310 | { | 270 | { | |||
311 | var Esc apedURL; | 271 | var Esc apedURL; | |||
312 | 272 | |||||
313 | 273 | |||||
314 | EscapedU RL = WWHBr owserUtili ties_Escap eURLForJav aScriptAnc hor(ParamU RL); | 274 | EscapedU RL = WWHBr owserUtili ties_Escap eURLForJav aScriptAnc hor(ParamU RL); | |||
315 | setTimeo ut(ParamFr ameReferen ce + ".loc ation.repl ace(\"" + EscapedURL + "\");", 1); | 275 | setTimeo ut(ParamFr ameReferen ce + ".loc ation.repl ace(\"" + EscapedURL + "\");", 1); | |||
316 | } | 276 | } | |||
317 | 277 | |||||
318 | function WWHBrowser _ReloadLoc ation(Para mFrameRefe rence) | 278 | function WWHBrowser _ReloadLoc ation(Para mFrameRefe rence) | |||
319 | { | 279 | { | |||
320 | var Var Frame; | 280 | var Var Frame; | |||
321 | 281 | |||||
322 | 282 | |||||
323 | VarFrame = eval(Pa ramFrameRe ference); | 283 | VarFrame = eval(Pa ramFrameRe ference); | |||
324 | this.fRe placeLocat ion(ParamF rameRefere nce, VarFr ame.locati on.href); | 284 | this.fRe placeLocat ion(ParamF rameRefere nce, VarFr ame.locati on.href); | |||
325 | } | 285 | } | |||
326 | 286 | |||||
327 | function WWHBrowser _SetCookie Path(Param URL) | 287 | function WWHBrowser _SetCookie Path(Param URL) | |||
328 | { | 288 | { | |||
329 | var Pat hname; | 289 | var Pat hname; | |||
330 | var Wor kingURL; | 290 | var Wor kingURL; | |||
331 | var Par ts; | 291 | var Par ts; | |||
332 | var Ind ex; | 292 | var Ind ex; | |||
333 | var Pro tocol = "" ; | 293 | var Pro tocol = "" ; | |||
334 | 294 | |||||
335 | 295 | |||||
336 | // Initi alize retu rn value | 296 | // Initi alize retu rn value | |||
337 | // | 297 | // | |||
338 | Pathname = "/"; | 298 | Pathname = "/"; | |||
339 | 299 | |||||
340 | // Remov e URL para meters | 300 | // Remov e URL para meters | |||
341 | // | 301 | // | |||
342 | WorkingU RL = Param URL; | 302 | WorkingU RL = Param URL; | |||
343 | if (Work ingURL.ind exOf("?") != -1) | 303 | if (Work ingURL.ind exOf("?") != -1) | |||
344 | { | 304 | { | |||
345 | Parts = WorkingU RL.split(" ?"); | 305 | Parts = WorkingU RL.split(" ?"); | |||
346 | Workin gURL = Par ts[0]; | 306 | Workin gURL = Par ts[0]; | |||
347 | } | 307 | } | |||
348 | else if (WorkingUR L.indexOf( "#") != -1 ) | 308 | else if (WorkingUR L.indexOf( "#") != -1 ) | |||
349 | { | 309 | { | |||
350 | Parts = WorkingU RL.split(" #"); | 310 | Parts = WorkingU RL.split(" #"); | |||
351 | Workin gURL = Par ts[0]; | 311 | Workin gURL = Par ts[0]; | |||
352 | } | 312 | } | |||
353 | 313 | |||||
354 | // Remov e last ent ry if path does not end with / | 314 | // Remov e last ent ry if path does not end with / | |||
355 | // | 315 | // | |||
356 | Index = WorkingURL .lastIndex Of("/"); | 316 | Index = WorkingURL .lastIndex Of("/"); | |||
357 | if ((Ind ex + 1) < WorkingURL .length) | 317 | if ((Ind ex + 1) < WorkingURL .length) | |||
358 | { | 318 | { | |||
359 | Workin gURL = Wor kingURL.su bstring(0, Index); | 319 | Workin gURL = Wor kingURL.su bstring(0, Index); | |||
360 | } | 320 | } | |||
361 | 321 | |||||
362 | // Remov e protocol | 322 | // Remov e protocol | |||
363 | // | 323 | // | |||
364 | Index = -1; | 324 | Index = -1; | |||
365 | if (Work ingURL.ind exOf("http :/") == 0) | 325 | if (Work ingURL.ind exOf("http :/") == 0) | |||
366 | { | 326 | { | |||
367 | Index = WorkingU RL.indexOf ("/", 6); | 327 | Index = WorkingU RL.indexOf ("/", 6); | |||
368 | Protoc ol = "http "; | 328 | Protoc ol = "http "; | |||
369 | } | 329 | } | |||
370 | else if (WorkingUR L.indexOf( "ftp:/") = = 0) | 330 | else if (WorkingUR L.indexOf( "ftp:/") = = 0) | |||
371 | { | 331 | { | |||
372 | Index = WorkingU RL.indexOf ("/", 5); | 332 | Index = WorkingU RL.indexOf ("/", 5); | |||
373 | Protoc ol = "ftp" ; | 333 | Protoc ol = "ftp" ; | |||
374 | } | 334 | } | |||
375 | else if (WorkingUR L.indexOf( "file:///" ) == 0) | 335 | else if (WorkingUR L.indexOf( "file:///" ) == 0) | |||
376 | { | 336 | { | |||
377 | Index = 7; | 337 | Index = 7; | |||
378 | Protoc ol = "file "; | 338 | Protoc ol = "file "; | |||
379 | } | 339 | } | |||
380 | 340 | |||||
381 | // Set b ase URL pa thname | 341 | // Set b ase URL pa thname | |||
382 | // | 342 | // | |||
383 | if (Inde x != -1) | 343 | if (Inde x != -1) | |||
384 | { | 344 | { | |||
385 | Pathna me = Worki ngURL.subs tring(Inde x, Working URL.length ); | 345 | Pathna me = Worki ngURL.subs tring(Inde x, Working URL.length ); | |||
386 | 346 | |||||
387 | // Cle an up path name | 347 | // Cle an up path name | |||
388 | // | 348 | // | |||
389 | if (Pr otocol == "file") | 349 | if (Pr otocol == "file") | |||
390 | { | 350 | { | |||
391 | if ( this.mPlat form == 1) // Short hand for W indows | 351 | if ( this.mPlat form == 1) // Short hand for W indows | |||
392 | { | 352 | { | |||
393 | if (this.mBr owser == 2 ) // Shor thand for IE | 353 | if (this.mBr owser == 2 ) // Shor thand for IE | |||
394 | { | 354 | { | |||
395 | // file UR Ls must ha ve slashes replaced with backs lashes, ex cept the f irst one | 355 | // file UR Ls must ha ve slashes replaced with backs lashes, ex cept the f irst one | |||
396 | // | 356 | // | |||
397 | if (Pathna me.length > 1) | 357 | if (Pathna me.length > 1) | |||
398 | { | 358 | { | |||
399 | Pathname = unescap e(Pathname ); | 359 | Pathname = unescap e(Pathname ); | |||
400 | Pathname = WWHBrow serUtiliti es_SearchR eplace(Pat hname, "/" , "\\"); | 360 | Pathname = WWHBrow serUtiliti es_SearchR eplace(Pat hname, "/" , "\\"); | |||
401 | if (Path name.index Of("\\") = = 0) | 361 | if (Path name.index Of("\\") = = 0) | |||
402 | { | 362 | { | |||
403 | Pathna me = "/" + Pathname. substring( 1, Pathnam e.length); | 363 | Pathna me = "/" + Pathname. substring( 1, Pathnam e.length); | |||
404 | } | 364 | } | |||
405 | } | 365 | } | |||
406 | } | 366 | } | |||
407 | } | 367 | } | |||
408 | } | 368 | } | |||
409 | else | 369 | else | |||
410 | { | 370 | { | |||
411 | // T rim server info | 371 | // T rim server info | |||
412 | // | 372 | // | |||
413 | Inde x = Pathna me.indexOf ("/", Inde x); | 373 | Inde x = Pathna me.indexOf ("/", Inde x); | |||
414 | if ( Index != - 1) | 374 | if ( Index != - 1) | |||
415 | { | 375 | { | |||
416 | Pa thname = P athname.su bstring(In dex, Pathn ame.length ); | 376 | Pa thname = P athname.su bstring(In dex, Pathn ame.length ); | |||
417 | } | 377 | } | |||
418 | else | 378 | else | |||
419 | { | 379 | { | |||
420 | Pa thname = " /"; | 380 | Pa thname = " /"; | |||
421 | } | 381 | } | |||
422 | } | 382 | } | |||
423 | } | 383 | } | |||
424 | 384 | |||||
425 | // Set c ookie path | 385 | // Set c ookie path | |||
426 | // | 386 | // | |||
427 | this.mCo okiePath = Pathname; | 387 | this.mCo okiePath = Pathname; | |||
428 | } | 388 | } | |||
429 | 389 | |||||
430 | function WWHBrowser _CookiesEn abled() | 390 | function WWHBrowser _CookiesEn abled() | |||
431 | { | 391 | { | |||
432 | // Cache result | 392 | // Cache result | |||
433 | // | 393 | // | |||
434 | if (this .mbCookies Enabled == null) | 394 | if (this .mbCookies Enabled == null) | |||
435 | { | 395 | { | |||
436 | // Def ault to di sabled | 396 | // Def ault to di sabled | |||
437 | // | 397 | // | |||
438 | this.m bCookiesEn abled = fa lse; | 398 | this.m bCookiesEn abled = fa lse; | |||
439 | 399 | |||||
440 | // Try setting a cookie | 400 | // Try setting a cookie | |||
441 | // | 401 | // | |||
442 | this.f SetCookie( "WWHBrowse r_CookiesE nabled", " True"); | 402 | this.f SetCookie( "WWHBrowse r_CookiesE nabled", " True"); | |||
443 | 403 | |||||
444 | // Ret rieve the cookie | 404 | // Ret rieve the cookie | |||
445 | // | 405 | // | |||
446 | if (th is.fGetCoo kie("WWHBr owser_Cook iesEnabled ") != null ) | 406 | if (th is.fGetCoo kie("WWHBr owser_Cook iesEnabled ") != null ) | |||
447 | { | 407 | { | |||
448 | // D elete the test cooki e | 408 | // D elete the test cooki e | |||
449 | // | 409 | // | |||
450 | this .fDeleteCo okie("WWHB rowser_Coo kiesEnable d"); | 410 | this .fDeleteCo okie("WWHB rowser_Coo kiesEnable d"); | |||
451 | 411 | |||||
452 | // S uccess! | 412 | // S uccess! | |||
453 | // | 413 | // | |||
454 | this .mbCookies Enabled = true; | 414 | this .mbCookies Enabled = true; | |||
455 | } | 415 | } | |||
456 | } | 416 | } | |||
457 | 417 | |||||
458 | return t his.mbCook iesEnabled ; | 418 | return t his.mbCook iesEnabled ; | |||
459 | } | 419 | } | |||
460 | 420 | |||||
461 | function WWHBrowser _SetCookie (ParamName , | 421 | function WWHBrowser _SetCookie (ParamName , | |||
462 | ParamValu e, | 422 | ParamValu e, | |||
463 | ParamExpi ration) | 423 | ParamExpi ration) | |||
464 | { | 424 | { | |||
465 | var Var FormattedC ookie; | 425 | var Var FormattedC ookie; | |||
466 | var Var Path; | 426 | var Var Path; | |||
467 | var Var Expiration Date; | 427 | var Var Expiration Date; | |||
468 | 428 | |||||
469 | 429 | |||||
470 | // Forma t the cook ie | 430 | // Forma t the cook ie | |||
471 | // | 431 | // | |||
472 | VarForma ttedCookie = escape( ParamName) + "=" + e scape(Para mValue); | 432 | VarForma ttedCookie = escape( ParamName) + "=" + e scape(Para mValue); | |||
473 | 433 | |||||
474 | // Add p ath | 434 | // Add p ath | |||
475 | // | 435 | // | |||
476 | VarForma ttedCookie += "; pat h=" + this .mCookiePa th; | 436 | VarForma ttedCookie += "; pat h=" + this .mCookiePa th; | |||
477 | 437 | |||||
478 | // Add e xpiration day, if sp ecified | 438 | // Add e xpiration day, if sp ecified | |||
479 | // | 439 | // | |||
480 | if ((typ eof(ParamE xpiration) != "undef ined") && | 440 | if ((typ eof(ParamE xpiration) != "undef ined") && | |||
481 | (Par amExpirati on != null ) && | 441 | (Par amExpirati on != null ) && | |||
482 | (Par amExpirati on != 0)) | 442 | (Par amExpirati on != 0)) | |||
483 | { | 443 | { | |||
484 | VarExp irationDat e = new Da te(); | 444 | VarExp irationDat e = new Da te(); | |||
485 | VarExp irationDat e.setTime( VarExpirat ionDate.ge tTime() + (ParamExpi ration * 1 000 * 60 * 60 * 24)) ; | 445 | VarExp irationDat e.setTime( VarExpirat ionDate.ge tTime() + (ParamExpi ration * 1 000 * 60 * 60 * 24)) ; | |||
486 | VarFor mattedCook ie += "; e xpires=" + VarExpira tionDate.t oGMTString (); | 446 | VarFor mattedCook ie += "; e xpires=" + VarExpira tionDate.t oGMTString (); | |||
487 | } | 447 | } | |||
488 | 448 | |||||
489 | // Set t he cookie for the sp ecified do cument | 449 | // Set t he cookie for the sp ecified do cument | |||
490 | // | 450 | // | |||
491 | document .cookie = VarFormatt edCookie | 451 | document .cookie = VarFormatt edCookie | |||
492 | } | 452 | } | |||
493 | 453 | |||||
494 | function WWHBrowser _GetCookie (ParamName ) | 454 | function WWHBrowser _GetCookie (ParamName ) | |||
495 | { | 455 | { | |||
496 | var Var Value; | 456 | var Var Value; | |||
497 | var Var Cookies; | 457 | var Var Cookies; | |||
498 | var Var Key; | 458 | var Var Key; | |||
499 | var Var StartIndex ; | 459 | var Var StartIndex ; | |||
500 | var Var EndIndex; | 460 | var Var EndIndex; | |||
501 | 461 | |||||
502 | 462 | |||||
503 | // Initi alize retu rn value | 463 | // Initi alize retu rn value | |||
504 | // | 464 | // | |||
505 | VarValue = null; | 465 | VarValue = null; | |||
506 | 466 | |||||
507 | // Get d ocument co okies | 467 | // Get d ocument co okies | |||
508 | // | 468 | // | |||
509 | VarCooki es = docum ent.cookie ; | 469 | VarCooki es = docum ent.cookie ; | |||
510 | 470 | |||||
511 | // Parse out reque sted cooki e | 471 | // Parse out reque sted cooki e | |||
512 | // | 472 | // | |||
513 | 473 | |||||
514 | // Try f irst posit ion | 474 | // Try f irst posit ion | |||
515 | // | 475 | // | |||
516 | VarKey = escape(Pa ramName) + "="; | 476 | VarKey = escape(Pa ramName) + "="; | |||
517 | VarStart Index = Va rCookies.i ndexOf(Var Key); | 477 | VarStart Index = Va rCookies.i ndexOf(Var Key); | |||
518 | if (VarS tartIndex != 0) | 478 | if (VarS tartIndex != 0) | |||
519 | { | 479 | { | |||
520 | // Try any other position | 480 | // Try any other position | |||
521 | // | 481 | // | |||
522 | VarKey = "; " + escape(Par amName) + "="; | 482 | VarKey = "; " + escape(Par amName) + "="; | |||
523 | VarSta rtIndex = VarCookies .indexOf(V arKey); | 483 | VarSta rtIndex = VarCookies .indexOf(V arKey); | |||
524 | } | 484 | } | |||
525 | 485 | |||||
526 | // Match found? | 486 | // Match found? | |||
527 | // | 487 | // | |||
528 | if (VarS tartIndex != -1) | 488 | if (VarS tartIndex != -1) | |||
529 | { | 489 | { | |||
530 | // Adv ance past cookie key | 490 | // Adv ance past cookie key | |||
531 | // | 491 | // | |||
532 | VarSta rtIndex += VarKey.le ngth; | 492 | VarSta rtIndex += VarKey.le ngth; | |||
533 | 493 | |||||
534 | // Fin d end | 494 | // Fin d end | |||
535 | // | 495 | // | |||
536 | VarEnd Index = Va rCookies.i ndexOf(";" , VarStart Index); | 496 | VarEnd Index = Va rCookies.i ndexOf(";" , VarStart Index); | |||
537 | if (Va rEndIndex == -1) | 497 | if (Va rEndIndex == -1) | |||
538 | { | 498 | { | |||
539 | VarE ndIndex = VarCookies .length; | 499 | VarE ndIndex = VarCookies .length; | |||
540 | } | 500 | } | |||
541 | VarVal ue = unesc ape(VarCoo kies.subst ring(VarSt artIndex, VarEndInde x)); | 501 | VarVal ue = unesc ape(VarCoo kies.subst ring(VarSt artIndex, VarEndInde x)); | |||
542 | } | 502 | } | |||
543 | 503 | |||||
544 | return V arValue; | 504 | return V arValue; | |||
545 | } | 505 | } | |||
546 | 506 | |||||
547 | function WWHBrowser _DeleteCoo kie(ParamN ame) | 507 | function WWHBrowser _DeleteCoo kie(ParamN ame) | |||
548 | { | 508 | { | |||
549 | // Set c ookie to e xpire yest erday | 509 | // Set c ookie to e xpire yest erday | |||
550 | // | 510 | // | |||
551 | this.fSe tCookie(Pa ramName, " ", -1); | 511 | this.fSe tCookie(Pa ramName, " ", -1); | |||
552 | } | 512 | } | |||
553 | 513 | |||||
554 | function WWHBrowser _Focus(Par amFrameRef erence, | 514 | function WWHBrowser _Focus(Par amFrameRef erence, | |||
555 | Par amAnchorNa me) | 515 | Par amAnchorNa me) | |||
556 | { | 516 | { | |||
557 | var Var Frame; | 517 | var Var Frame; | |||
558 | var Var Anchor; | 518 | var Var Anchor; | |||
559 | var Var MaxIndex; | 519 | var Var MaxIndex; | |||
560 | var Var Index; | 520 | var Var Index; | |||
561 | 521 | |||||
562 | 522 | |||||
563 | if (this .mbSupport sFocus) | 523 | if (this .mbSupport sFocus) | |||
564 | { | 524 | { | |||
565 | if (Pa ramFrameRe ference.le ngth > 0) | 525 | if (Pa ramFrameRe ference.le ngth > 0) | |||
566 | { | 526 | { | |||
567 | // A ccess fram e | 527 | // A ccess fram e | |||
568 | // | 528 | // | |||
569 | VarF rame = eva l(ParamFra meReferenc e); | 529 | VarF rame = eva l(ParamFra meReferenc e); | |||
570 | 530 | |||||
571 | // F ocus frame | 531 | // F ocus frame | |||
572 | // | 532 | // | |||
573 | VarF rame.focus (); | 533 | VarF rame.focus (); | |||
574 | 534 | |||||
575 | // F ocusing an chor? | 535 | // F ocusing an chor? | |||
576 | // | 536 | // | |||
577 | if ( (typeof(Pa ramAnchorN ame) != "u ndefined") && | 537 | if ( (typeof(Pa ramAnchorN ame) != "u ndefined") && | |||
578 | (ParamAnch orName != null) && | 538 | (ParamAnch orName != null) && | |||
579 | (ParamAnch orName.len gth > 0)) | 539 | (ParamAnch orName.len gth > 0)) | |||
580 | { | 540 | { | |||
581 | // Focus anc hor | 541 | // Focus anc hor | |||
582 | // | 542 | // | |||
583 | Va rAnchor = VarFrame.d ocument.an chors[Para mAnchorNam e]; | 543 | Va rAnchor = VarFrame.d ocument.an chors[Para mAnchorNam e]; | |||
584 | if ((typeof( VarAnchor) != "undef ined") && | 544 | if ((typeof( VarAnchor) != "undef ined") && | |||
585 | (VarAnch or != null )) | 545 | (VarAnch or != null )) | |||
586 | { | 546 | { | |||
587 | VarAnchor. focus(); | 547 | VarAnchor. focus(); | |||
588 | } | 548 | } | |||
589 | el se | 549 | el se | |||
590 | { | 550 | { | |||
591 | VarAnchorA rray = Var Frame.docu ment.ancho rs; | 551 | VarAnchorA rray = Var Frame.docu ment.ancho rs; | |||
592 | for (VarMa xIndex = V arFrame.do cument.anc hors.lengt h, VarInde x = 0 ; Va rIndex < V arMaxIndex ; VarInde x++) | 552 | for (VarMa xIndex = V arFrame.do cument.anc hors.lengt h, VarInde x = 0 ; Va rIndex < V arMaxIndex ; VarInde x++) | |||
593 | { | 553 | { | |||
594 | if (VarF rame.docum ent.anchor s[VarIndex ].name == ParamAncho rName) | 554 | if (VarF rame.docum ent.anchor s[VarIndex ].name == ParamAncho rName) | |||
595 | { | 555 | { | |||
596 | VarFra me.documen t.anchors[ VarIndex]. focus(); | 556 | VarFra me.documen t.anchors[ VarIndex]. focus(); | |||
597 | 557 | |||||
598 | // Exi t loop | 558 | // Exi t loop | |||
599 | // | 559 | // | |||
600 | VarInd ex = VarMa xIndex; | 560 | VarInd ex = VarMa xIndex; | |||
601 | } | 561 | } | |||
602 | } | 562 | } | |||
603 | } | 563 | } | |||
604 | } | 564 | } | |||
605 | } | 565 | } | |||
606 | } | 566 | } | |||
607 | } | 567 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2007 Araxis Ltd (www.araxis.com). All rights reserved.