Produced by Araxis Merge on 1/2/2018 11:56:49 AM Eastern Standard Time. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. 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 | Tue Jan 2 16:56:49 2018 UTC | ||
| 2 | HTRE_P2.zip\src.zip\output\IHTA OLH Files.zip\admin.zip\admin | whtopic.js | Wed May 31 16:59:36 2017 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 0 | 0 |
| Changed | 0 | 0 |
| Inserted | 1 | 2121 |
| Removed | 0 | 0 |
| Whitespace | |
|---|---|
| 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 | // We bHelp 5.10 .005 | |||||
| 2 | var gsPPat h=""; | |||||
| 3 | var gaPath s=new Arra y(); | |||||
| 4 | var gaAven ues=new Ar ray(); | |||||
| 5 | var gaSear chTerms = new Array( ); | |||||
| 6 | ||||||
| 7 | var goFram e=null; | |||||
| 8 | var gsStar tPage=""; | |||||
| 9 | var gsRelC urPagePath =""; | |||||
| 10 | var gsSear chFormHref =""; | |||||
| 11 | var gnTopi cOnly=-1; | |||||
| 12 | var gnOutm ostTopic=- 1; | |||||
| 13 | var gsHili teSearchSe tting = "d isable,#cc ffff,black "; | |||||
| 14 | var g_Rune sVowels="\ u0061\u006 5\u0069\u0 06F\u0075\ u0079"; | |||||
| 15 | var g_Rune sWordBreak s="\u0001\ u0002\u000 3\u0004\u0 005\u0006\ u0007\u000 8\u0009\u0 00A\u000B\ u000C\u000 D\u000E\u0 00F\u0010\ u0011\u001 2\u0013\u0 014\u0015\ u0016\u001 7\u0018\u0 019\u001A\ u001B\u001 C\u001D\u0 01E\u001F\ u0022\u005 C\u0020\u0 02E\u002C\ u0021\u004 0\u0023\u0 024\u0025\ u005E\u002 6\u002A\u0 028\u0029\ u007E\u002 7\u0060\u0 03A\u003B\ u003C\u003 E\u003F\u0 02F\u007B\ u007D\u005 B\u005D\u0 07C\u002B\ u002D\u003 D\u0081\u0 082\u0083\ u0084\u008 5\u0086\u0 087\u0088\ u0089\u008 A\u008B\u0 08C\u008D\ u008E\u008 F\u0090\u0 091\u0092\ u0093\u009 4\u0095\u0 096\u0097\ u0098\u009 9\u009A\u0 09B\u009C\ u009D\u009 E\u009F\u0 0A1\u00A9\ u00AB\u00A E\u00B7\u0 0BB\u00BF\ u00A0\u200 0\u2001\u2 002\u2003\ u2004\u200 5\u2006\u2 007\u2008\ u2009\u200 A\u2028\u2 029\u202F\ u205F\u300 0"; | |||||
| 16 | var g_Rune sWhiteSpac es="\u0020 \u0009\u00 0D\u000A\u 00A0\u2000 \u2001\u20 02\u2003\u 2004\u2005 \u2006\u20 07\u2008\u 2009\u200A \u2028\u20 29\u202F\u 205F\u3000 "; | |||||
| 17 | var g_Rune sSpecialBr eaks = ",! @#$%^&*()~ '`:;<>?/{} []|+-=" ; | |||||
| 18 | var g_Rune sQuote='\x 22'; | |||||
| 19 | var g_Rune sHelSuffix es=new Arr ay("ed,0", "ingly,0", "ings,0"," ing,0","ly ,1","s,1", "e,1"); | |||||
| 20 | var gsBkgn dColor=""; | |||||
| 21 | var gsText Color=""; | |||||
| 22 | var BTN_TE XT=1; | |||||
| 23 | var BTN_IM G=2; | |||||
| 24 | ||||||
| 25 | var goSync =null; | |||||
| 26 | ||||||
| 27 | var goShow =null; | |||||
| 28 | var goHide =null; | |||||
| 29 | ||||||
| 30 | var goPrev =null; | |||||
| 31 | var goNext =null; | |||||
| 32 | var gnForm =0; | |||||
| 33 | var goShow Nav=null; | |||||
| 34 | var goHide Nav=null; | |||||
| 35 | ||||||
| 36 | var goWebS earch=null ; | |||||
| 37 | ||||||
| 38 | var gsBtnS tyle=""; | |||||
| 39 | var gaButt ons=new Ar ray(); | |||||
| 40 | var gaType s=new Arra y(); | |||||
| 41 | var whtopi c_foldUnlo ad=null; | |||||
| 42 | var gbWhTo pic=false; | |||||
| 43 | var gbSync Enabled=fa lse; | |||||
| 44 | var gBCId = 0; | |||||
| 45 | var gnYPos = -1; | |||||
| 46 | var gbBadU riError = false; | |||||
| 47 | var gFrame Id = null; | |||||
| 48 | var gsPage Dir="ltr" | |||||
| 49 | ||||||
| 50 | var gBread CrumbInfo = new Arra y; | |||||
| 51 | ||||||
| 52 | function B readCrumbI nfo(relHom ePage, sty leInfo, se parator, s trHome, st rHomePath) { | |||||
| 53 | this.r elHomePage = relHome Page; | |||||
| 54 | this.s tyleInfo = styleInfo ; | |||||
| 55 | this.s eparator = separator ; | |||||
| 56 | this.s trHome = s trHome; | |||||
| 57 | this.s trHomePath = strHome Path; | |||||
| 58 | this.b cLinks = [ ]; | |||||
| 59 | } | |||||
| 60 | ||||||
| 61 | function A ddMasterBr eadcrumbs( relHomePag e, styleIn fo, separa tor, strHo me, strHom ePath) { | |||||
| 62 | docume nt.write(" <span id=\ "brseq" + gBCId + "\ " ></span> "); | |||||
| 63 | gBread CrumbInfo[ gBCId] = n ew BreadCr umbInfo(re lHomePage, styleInfo , separato r, strHome , strHomeP ath); | |||||
| 64 | gBCId+ +; | |||||
| 65 | } | |||||
| 66 | ||||||
| 67 | function U pdateBread CrumbsMark er() { | |||||
| 68 | if (gBreadCru mbInfo.len gth > 0) | |||||
| 69 | { | |||||
| 70 | var bcInfo = g BreadCrumb Info[0]; | |||||
| 71 | var sCurTopicP ath = _get Path(docum ent.locati on.href); | |||||
| 72 | var sHomePath = _getFull Path(sCurT opicPath, bcInfo.rel HomePage); | |||||
| 73 | var sHomeFolde r = _getPa th(sHomePa th); | |||||
| 74 | var sMasterDat aPath = _g etFullPath (sHomeFold er, "Maste rData.xml" ); | |||||
| 75 | GetM asterBread crumbs(sMa sterDataPa th); | |||||
| 76 | } | |||||
| 77 | } | |||||
| 78 | ||||||
| 79 | function G etMasterBr eadcrumbs( sMasterDat aPath) { | |||||
| 80 | //dont read if n ot part of merged pr ojects | |||||
| 81 | if (sMasterDa taPath.ind exOf("/mer gedProject s/") == -1 && | |||||
| 82 | sMaste rDataPath. indexOf("\ \mergedPro jects\\") == -1) | |||||
| 83 | { | |||||
| 84 | writeBre adCrumbs() ; | |||||
| 85 | return ; | |||||
| 86 | } | |||||
| 87 | ||||||
| 88 | var sC urrentDocP ath = _get Path(docum ent.locati on.href); | |||||
| 89 | var fi leName = _ getRelativ eFileName( sCurrentDo cPath, sMa sterDataPa th); | |||||
| 90 | ||||||
| 91 | xmlJsR eader.load File(fileN ame, funct ion (a_xml Doc, args) { | |||||
| 92 | on LoadingMas terDataXML (a_xmlDoc, args); | |||||
| 93 | }, sMa sterDataPa th); | |||||
| 94 | } | |||||
| 95 | ||||||
| 96 | ||||||
| 97 | function o nLoadingMa sterDataXM L(xmlDoc1, sMasterDa taPath) | |||||
| 98 | { | |||||
| 99 | if(xml Doc1 == nu ll) | |||||
| 100 | { | |||||
| 101 | wr iteBreadCr umbs(); | |||||
| 102 | re turn; | |||||
| 103 | } | |||||
| 104 | var ro ot = xmlDo c1.documen tElement; | |||||
| 105 | va r masterPr oj = xmlDo c1.getElem entsByTagN ame("Maste rProject") ; | |||||
| 106 | va r masterNa me=""; | |||||
| 107 | va r masterRe lPath=""; | |||||
| 108 | ||||||
| 109 | if (masterPro j.length > 0) | |||||
| 110 | { | |||||
| 111 | mast erName = m asterProj[ 0].getAttr ibute("nam e"); | |||||
| 112 | mast erRelPath = masterPr oj[0].getA ttribute(" url"); | |||||
| 113 | } | |||||
| 114 | ||||||
| 115 | va r x = xmlD oc1.getEle mentsByTag Name("item "); | |||||
| 116 | va r i = 0; | |||||
| 117 | va r strTrail = ""; | |||||
| 118 | ||||||
| 119 | fo r(i=x.leng th-1; i>=0 ; i--) | |||||
| 120 | { | |||||
| 121 | var bcName= x[ i].getAttr ibute("nam e"); | |||||
| 122 | var path = x[i ].getAttri bute("url" ); | |||||
| 123 | ||||||
| 124 | bcNa me = bcNam e.replace( /\\\\/g, ' \\'); | |||||
| 125 | ||||||
| 126 | va r strLink = ""; | |||||
| 127 | va r sMasterP ath = _get FullPath(_ getPath(sM asterDataP ath), mast erRelPath) ; | |||||
| 128 | if (path != " ") | |||||
| 129 | { | |||||
| 130 | strLink = _getFullP ath(sMaste rPath, pat h); | |||||
| 131 | } | |||||
| 132 | fo r(var j=0; j<gBCId;j+ +) | |||||
| 133 | { | |||||
| 134 | var bcli nk = new O bject(); | |||||
| 135 | bclink.n ame = bcNa me; | |||||
| 136 | bclink.s trLink = s trLink; | |||||
| 137 | bclink .firstEntr y = (i==0? true:false ); | |||||
| 138 | gBreadCr umbInfo[j] .bcLinks.p ush(bclink ); | |||||
| 139 | } | |||||
| 140 | } | |||||
| 141 | ||||||
| 142 | // call for master bre adcrumbs | |||||
| 143 | sM asterDataP ath = _get FullPath(s MasterPath , "MasterD ata.xml"); | |||||
| 144 | Ge tMasterBre adcrumbs(s MasterData Path); | |||||
| 145 | } | |||||
| 146 | ||||||
| 147 | function w riteBreadC rumbs() { | |||||
| 148 | for(va r i=0;i<gB CId;i++) { | |||||
| 149 | va r bHomeFou nd = false ; | |||||
| 150 | va r strTrail = ""; | |||||
| 151 | if (gBreadCru mbInfo[i]. bcLinks.le ngth == 0) | |||||
| 152 | { | |||||
| 153 | if(g BreadCrumb Info[i].st yleInfo == "breadcru mbs") | |||||
| 154 | strTra il = "<a c lass=\""+ gBreadCrum bInfo[i].s tyleInfo + "\"" + " href=\"" + gBreadCru mbInfo[i]. strHomePat h + "\">" + gBreadCr umbInfo[i] .strHome + "</a> " + ((gBreadC rumbInfo[i ].strHome == "")? "" :gBreadCru mbInfo[i]. separator) + " "; | |||||
| 155 | else | |||||
| 156 | strTrail = "<a style =\""+ gBre adCrumbInf o[i].style Info + "\" " + " href =\"" + gBr eadCrumbIn fo[i].strH omePath + "\">" + gB readCrumbI nfo[i].str Home + "</ a> " + ((g BreadCrumb Info[i].st rHome == " ")? "":gBr eadCrumbIn fo[i].sepa rator) + " "; | |||||
| 157 | } | |||||
| 158 | el se{ | |||||
| 159 | var len = gBreadCr umbInfo[i] .bcLinks.l ength; | |||||
| 160 | for(var j=len-1;j> =0;j--) | |||||
| 161 | { | |||||
| 162 | if(g BreadCrumb Info[i].bc Links[j].f irstEntry == true) | |||||
| 163 | { | |||||
| 164 | if(bHo meFound) | |||||
| 165 | con tinue; | |||||
| 166 | else | |||||
| 167 | bHo meFound = true; | |||||
| 168 | } | |||||
| 169 | if(g BreadCrumb Info[i].bc Links[j].s trLink == "") | |||||
| 170 | { | |||||
| 171 | strTrail + = gBreadCr umbInfo[i] .bcLinks[j ].name + " " + gBrea dCrumbInfo [i].separa tor + " "; | |||||
| 172 | } | |||||
| 173 | else { | |||||
| 174 | if(gBreadC rumbInfo[i ].styleInf o == "brea dcrumbs") | |||||
| 175 | strT rail += "< a class=\" "+ gBreadC rumbInfo[i ].styleInf o + "\"" + " href=\" " + gBread CrumbInfo[ i].bcLinks [j].strLin k + "\">" + gBreadCr umbInfo[i] .bcLinks[j ].name + " </a> " + g BreadCrumb Info[i].se parator + " "; | |||||
| 176 | else | |||||
| 177 | strT rail += "< a style=\" "+ gBreadC rumbInfo[i ].styleInf o + "\"" + " href=\" " + gBread CrumbInfo[ i].bcLinks [j].strLin k + "\">" + gBreadCr umbInfo[i] .bcLinks[j ].name + " </a> " + g BreadCrumb Info[i].se parator + " "; | |||||
| 178 | } | |||||
| 179 | } | |||||
| 180 | } | |||||
| 181 | va r brselem = document .getElemen tById("brs eq"+i); | |||||
| 182 | if (typeof(br selem) != 'undefined ' && brsel em != null ) | |||||
| 183 | brselem. innerHTML = strTrail ; | |||||
| 184 | el se | |||||
| 185 | { | |||||
| 186 | //used i n air help | |||||
| 187 | RH_Bread CrumbDataS tringVaria ble = RH_B readCrumbD ataStringV ariable.re place(/__b rseq__/g, strTrail); | |||||
| 188 | if(gbA IR) | |||||
| 189 | { | |||||
| 190 | try{ | |||||
| 191 | Up dateBreadC rumbState( ); | |||||
| 192 | }catch(e ) {} | |||||
| 193 | } | |||||
| 194 | else i f(gbAIRSSL ) | |||||
| 195 | createFr ameInfo(); | |||||
| 196 | } | |||||
| 197 | } | |||||
| 198 | } | |||||
| 199 | ||||||
| 200 | /////////h ighlight S earch Rout ines ///// //// | |||||
| 201 | function C losedRange ( a_nStart , a_nEnd ) | |||||
| 202 | { | |||||
| 203 | th is.nStart = a_nStart ; | |||||
| 204 | th is.nEnd = a_nEnd; | |||||
| 205 | } | |||||
| 206 | ||||||
| 207 | ////////// / Dom Text node //// ////////// / | |||||
| 208 | var s_strH lStart=nul l; | |||||
| 209 | var s_strH lEnd =null ; | |||||
| 210 | ||||||
| 211 | function D omTextNode ( a_Node, a_nFrom ) | |||||
| 212 | { | |||||
| 213 | th is.node = a_Node; | |||||
| 214 | th is.nFrom = a_nFrom; | |||||
| 215 | ||||||
| 216 | th is.aClosed Ranges = n ew Array() ; | |||||
| 217 | ||||||
| 218 | th is.getClos edRanges = function( a_aRanges , a_nStart ) | |||||
| 219 | { | |||||
| 220 | var nTo = this .nFrom + a _Node.data .length; | |||||
| 221 | for ( var i = a_nStart; i < a_aRan ges.length ; i++ ) | |||||
| 222 | { | |||||
| 223 | if ( a _aRanges[i ].nStart < = nTo && | |||||
| 224 | a_aRang es[i].nEnd >= this.n From ) | |||||
| 225 | { | |||||
| 226 | this.aCl osedRanges [this.aClo sedRanges. length] = new Closed Range( a_a Ranges[i]. nStart > t his.nFrom ? a_aRange s[i].nStar t : this.n From, | |||||
| 227 | a_aRanges [i].nEnd < nTo ? a_a Ranges[i]. nEnd : nTo ); | |||||
| 228 | } | |||||
| 229 | if ( a _aRanges[i ].nEnd > n To ) | |||||
| 230 | { | |||||
| 231 | return i ; | |||||
| 232 | } | |||||
| 233 | } | |||||
| 234 | retu rn i; | |||||
| 235 | } | |||||
| 236 | ||||||
| 237 | th is.doHighl ight = fun ction( a_a Ranges, a_ nStart ) | |||||
| 238 | { | |||||
| 239 | s_st rHlStart = "<font st yle='color :" + gsTex tColor + " ; backgrou nd-color:" + gsBkgnd Color + "' >"; | |||||
| 240 | s_st rHlEnd = " </font>"; | |||||
| 241 | ||||||
| 242 | if ( a_nStart >= a_aRang es.length ) | |||||
| 243 | return a_nStart; | |||||
| 244 | ||||||
| 245 | var nEnd = thi s.getClose dRanges( a _aRanges, a_nStart ) ; | |||||
| 246 | if ( this.aClo sedRanges. length == 0 ) | |||||
| 247 | return nEnd; | |||||
| 248 | var strText = this.node. data; | |||||
| 249 | //re place newl ine, carri age return , tab char acters wit h space | |||||
| 250 | strT ext = strT ext.replac e(/[\n\r\t ]/g," "); | |||||
| 251 | ||||||
| 252 | var strHTML = ""; | |||||
| 253 | var nLastStart = 0; | |||||
| 254 | for ( var i = 0; i < thi s.aClosedR anges.leng th; i++ ) | |||||
| 255 | { | |||||
| 256 | strHTM L += _text ToHtml_non bsp(strTex t.substrin g( nLastSt art, this. aClosedRan ges[i].nSt art - this .nFrom )); | |||||
| 257 | strHTM L += s_str HlStart; | |||||
| 258 | strHTM L += _text ToHtml_non bsp(strTex t.substrin g( this.aC losedRange s[i].nStar t - this.n From, | |||||
| 259 | this.aCl osedRanges [i].nEnd - this.nFro m )); | |||||
| 260 | strHTM L += s_str HlEnd; | |||||
| 261 | ||||||
| 262 | nLastS tart = thi s.aClosedR anges[i].n End - this .nFrom; | |||||
| 263 | } | |||||
| 264 | strH TML += _te xtToHtml_n onbsp(strT ext.substr ( nLastSta rt )); | |||||
| 265 | ||||||
| 266 | var spanElemen t = docume nt.createE lement( "s pan" ); | |||||
| 267 | span Element.in nerHTML = strHTML; | |||||
| 268 | if ( gbIE) | |||||
| 269 | { | |||||
| 270 | //for IE, when assig ning strin g to inner HTML, lead ing whites paces are dropped | |||||
| 271 | if ((strHT ML.length >0)&&(strH TML.charAt (0) == " " )) | |||||
| 272 | spanEl ement.inne rHTML = "& nbsp;" + s panElement .innerHTML ; | |||||
| 273 | } | |||||
| 274 | ||||||
| 275 | this .node.pare ntNode.rep laceChild( spanEleme nt, this.n ode ); | |||||
| 276 | if(g nYPos == - 1) | |||||
| 277 | { | |||||
| 278 | var el emObj = sp anElement; | |||||
| 279 | var cu rtop = 0; | |||||
| 280 | if (el emObj.offs etParent) | |||||
| 281 | { | |||||
| 282 | while (e lemObj.off setParent) | |||||
| 283 | { | |||||
| 284 | curtop += elemObj.of fsetTop | |||||
| 285 | elemObj = elemObj.of fsetParent ; | |||||
| 286 | } | |||||
| 287 | } | |||||
| 288 | else i f (elemObj .y) | |||||
| 289 | curtop + = elemObj. y; | |||||
| 290 | ||||||
| 291 | gnYPos = curtop; | |||||
| 292 | } | |||||
| 293 | show Highlighte dElement(s panElement ); | |||||
| 294 | retu rn nEnd; | |||||
| 295 | }; | |||||
| 296 | } | |||||
| 297 | ||||||
| 298 | function g etDropSpot Id(dropTex tId) | |||||
| 299 | { | |||||
| 300 | va r src = nu ll; | |||||
| 301 | if (!src&&dro pTextId) | |||||
| 302 | { | |||||
| 303 | for (var i=0;i <gPopupDat a.length;i ++) | |||||
| 304 | { | |||||
| 305 | if(gPo pupData[i] .popupId = = dropText Id) | |||||
| 306 | { | |||||
| 307 | src=gPop upData[i]. el; | |||||
| 308 | break; | |||||
| 309 | } | |||||
| 310 | else i f(gPopupDa ta[i].popu pId == "#" + dropTex tId) | |||||
| 311 | { | |||||
| 312 | src=gPop upData[i]. el; | |||||
| 313 | break; | |||||
| 314 | } | |||||
| 315 | } | |||||
| 316 | } | |||||
| 317 | re turn src; | |||||
| 318 | } | |||||
| 319 | ||||||
| 320 | function s howHighlig htedElemen t(highligh tElement) { | |||||
| 321 | // display a dropdown/e xpand text if highli ghted elem ent is ins ide it | |||||
| 322 | va r parent = highlight Element.pa rentNode; | |||||
| 323 | wh ile( (type of parent != 'undefi ned') && p arent != n ull ) | |||||
| 324 | { | |||||
| 325 | var tagname = parent.tag Name.toLow erCase(); | |||||
| 326 | if( tagname == 'body') | |||||
| 327 | break; | |||||
| 328 | if( (tagname = = "div" && parent.cl assName == "droptext ")) | |||||
| 329 | { | |||||
| 330 | if(par ent.style. display == "none") | |||||
| 331 | parent.s tyle.displ ay = ""; | |||||
| 332 | var ds Id = getDr opSpotId(p arent.getA ttribute(" id")); | |||||
| 333 | if(dsI d != null) | |||||
| 334 | { | |||||
| 335 | var dsEl em = docum ent.getEle mentById(d sId); | |||||
| 336 | showHigh lightedEle ment(dsEle m); | |||||
| 337 | } | |||||
| 338 | } | |||||
| 339 | else if((tagna me == "spa n" && pare nt.classNa me == "exp andtext") || | |||||
| 340 | (tagna me == "spa n" && pare nt.classNa me == "glo sstext")) | |||||
| 341 | { | |||||
| 342 | if(par ent.style. display == "none") | |||||
| 343 | parent.s tyle.displ ay = ""; | |||||
| 344 | } | |||||
| 345 | pare nt = paren t.parentNo de; | |||||
| 346 | } | |||||
| 347 | } | |||||
| 348 | ||||||
| 349 | function D omTexts() | |||||
| 350 | { | |||||
| 351 | th is.strText = ""; | |||||
| 352 | th is.aNodes = new Arra y(); | |||||
| 353 | th is.aRanges = new Arr ay(); | |||||
| 354 | ||||||
| 355 | th is.addElem entNode = function( a_Node ) | |||||
| 356 | { | |||||
| 357 | if ( a_Node == null || a _Node.chil dNodes == null ) | |||||
| 358 | return ; | |||||
| 359 | ||||||
| 360 | var nLen = a_N ode.childN odes.lengt h; | |||||
| 361 | for ( var i = 0; i < nLe n; i++ ) | |||||
| 362 | { | |||||
| 363 | var no de = a_Nod e.childNod es.item( i ); | |||||
| 364 | if ( n ode != nul l ) | |||||
| 365 | { | |||||
| 366 | if ( nod e.nodeType == 3 ) | |||||
| 367 | { | |||||
| 368 | this.addTe xtNode( no de ); | |||||
| 369 | } | |||||
| 370 | else if ( node.nod eType == 1 ) | |||||
| 371 | { | |||||
| 372 | this.addEl ementNode( node ); | |||||
| 373 | } | |||||
| 374 | } | |||||
| 375 | } | |||||
| 376 | } | |||||
| 377 | ||||||
| 378 | th is.addText Node = fun ction( a_N ode ) | |||||
| 379 | { | |||||
| 380 | if ( a_Node == null ) | |||||
| 381 | return ; | |||||
| 382 | ||||||
| 383 | var strInnerTe xt = a_Nod e.data; | |||||
| 384 | ||||||
| 385 | //re place newl ine, carri age return , tab char acters wit h space | |||||
| 386 | strI nnerText = strInnerT ext.replac e(/[\n\r\t ]/g," "); | |||||
| 387 | if ( strInnerT ext.length != 0 ) | |||||
| 388 | { | |||||
| 389 | var nF rom = this .strText.l ength; | |||||
| 390 | this.s trText += strInnerTe xt; | |||||
| 391 | this.a Nodes[this .aNodes.le ngth] = ne w DomTextN ode( a_Nod e, nFrom ) ; | |||||
| 392 | } | |||||
| 393 | } | |||||
| 394 | ||||||
| 395 | th is.isWordM atch = fun ction( a_s trHlWord, a_strTextW ord ) | |||||
| 396 | { | |||||
| 397 | retu rn a_strTe xtWord.ind exOf(a_str HlWord.toL owerCase() ) != -1; | |||||
| 398 | } | |||||
| 399 | ||||||
| 400 | th is.makeHig hlightRang es = funct ion() | |||||
| 401 | { | |||||
| 402 | if(t ypeof(gaSe archTerms[ 0]) == "un defined") | |||||
| 403 | return ; | |||||
| 404 | ||||||
| 405 | var str = esca peRegExp(g aSearchTer ms[0].toLo werCase()) ; | |||||
| 406 | for( var j = 1; j < gaSea rchTerms.l ength; j++ ) | |||||
| 407 | { | |||||
| 408 | str += "|" + esc apeRegExp( gaSearchTe rms[j].toL owerCase() ); | |||||
| 409 | ||||||
| 410 | } | |||||
| 411 | ||||||
| 412 | var regexp = n ew RegExp( str, "i"); | |||||
| 413 | ||||||
| 414 | var n = new Ob ject; | |||||
| 415 | n.in dex = 0; | |||||
| 416 | var prevLen = 0; | |||||
| 417 | var tmpStr1 = this.strTe xt.toLower Case(); | |||||
| 418 | ||||||
| 419 | whil e(n != nul l && n.ind ex > -1) | |||||
| 420 | { | |||||
| 421 | n = re gexp.exec( tmpStr1); | |||||
| 422 | ||||||
| 423 | if (n != null && n.index > -1 ) | |||||
| 424 | { | |||||
| 425 | var strW ord = n[0] ; | |||||
| 426 | this.aRa nges[this. aRanges.le ngth] = ne w ClosedRa nge( prev Len + n.in dex, prevLen + n.index + strWord. length); | |||||
| 427 | prevLen = prevLen + n.index + strWord. length; | |||||
| 428 | tmpStr1 = tmpStr1. substring( n.index + strWord.le ngth, tmpS tr1.length ); | |||||
| 429 | } | |||||
| 430 | } | |||||
| 431 | } | |||||
| 432 | ||||||
| 433 | th is.highlig htNodes = function() | |||||
| 434 | { | |||||
| 435 | var nFrom = 0; | |||||
| 436 | for ( var i = 0; i < thi s.aNodes.l ength; i++ ) | |||||
| 437 | nFrom = this.aNo des[i].doH ighlight( this.aRang es, nFrom ); | |||||
| 438 | } | |||||
| 439 | ||||||
| 440 | th is.jump2Fi rstHighlig htedWord = function( ) | |||||
| 441 | { | |||||
| 442 | if ( gnYPos > 5 1) | |||||
| 443 | window .scrollTo( 0, gnYPos- 50); | |||||
| 444 | } | |||||
| 445 | } | |||||
| 446 | ||||||
| 447 | function p rocessSusp endNodes( a_aNodes ) | |||||
| 448 | { | |||||
| 449 | if ( a_aNode s.length = = 0 ) | |||||
| 450 | retu rn false; | |||||
| 451 | ||||||
| 452 | va r dt = new DomTexts( ); | |||||
| 453 | ||||||
| 454 | // build dom texts... | |||||
| 455 | fo r ( var i = 0; i < a _aNodes.le ngth; i++ ) | |||||
| 456 | { | |||||
| 457 | var node = a_a Nodes[i]; | |||||
| 458 | if ( node.node Type == 1 ) | |||||
| 459 | { | |||||
| 460 | dt.add ElementNod e( node ); | |||||
| 461 | } | |||||
| 462 | else if ( node .nodeType == 3 ) | |||||
| 463 | { | |||||
| 464 | dt.add TextNode( node ); | |||||
| 465 | } | |||||
| 466 | } | |||||
| 467 | ||||||
| 468 | dt .makeHighl ightRanges (); | |||||
| 469 | dt .highlight Nodes(); | |||||
| 470 | dt .jump2Firs tHighlight edWord(); | |||||
| 471 | } | |||||
| 472 | ||||||
| 473 | var s_strR ecursiveTa gs = "sub sup img ap plet objec t br ifram e embed no embed para m area inp ut " + | |||||
| 474 | " select tex tarea butt on option hr frame n oframes ma rquee labe l p dl " + | |||||
| 475 | " div center noscript blockquote form isin dex table fieldset a ddress lay er " + | |||||
| 476 | " dt dd capt ion thead tfoot tbod y tr th td lengend h 1 h2 h3 h4 h5 h6 " + | |||||
| 477 | " ul ol dir menu li pr e xmp list ing plaint ext ins de l"; | |||||
| 478 | ||||||
| 479 | function d oesTagRecu rsiveProce ss( a_Node ) | |||||
| 480 | { | |||||
| 481 | if ( a_Node == null ) | |||||
| 482 | retu rn false; | |||||
| 483 | ||||||
| 484 | va r strTagNa me = a_Nod e.tagName. toLowerCas e(); | |||||
| 485 | va r rg = "\\ b" + strTa gName + "\ \b"; | |||||
| 486 | va r ss = s_s trRecursiv eTags.matc h( rg ); | |||||
| 487 | re turn ss != null; | |||||
| 488 | } | |||||
| 489 | ||||||
| 490 | function d oHighLight DomElement ( a_aSuspe ndedNodes, a_Node ) | |||||
| 491 | { | |||||
| 492 | va r childNod es = a_Nod e.childNod es; | |||||
| 493 | ||||||
| 494 | if ( childNo des == nul l || child Nodes.leng th == 0 ) | |||||
| 495 | retu rn; | |||||
| 496 | ||||||
| 497 | va r nLen = c hildNodes. length; | |||||
| 498 | fo r ( var i = 0; i < n Len; i++ ) | |||||
| 499 | { | |||||
| 500 | var node = chi ldNodes.it em( i ); | |||||
| 501 | if ( node == n ull ) | |||||
| 502 | contin ue; | |||||
| 503 | ||||||
| 504 | if ( node.node Type == 1 ) | |||||
| 505 | { //elem ent | |||||
| 506 | if ( d oesTagRecu rsiveProce ss( node ) ) | |||||
| 507 | { | |||||
| 508 | if ( a_a SuspendedN odes.lengt h > 0 ) | |||||
| 509 | { | |||||
| 510 | processSus pendNodes( a_aSuspen dedNodes ) ; | |||||
| 511 | a_aSuspend edNodes.le ngth = 0; | |||||
| 512 | } | |||||
| 513 | } | |||||
| 514 | doHigh LightDomEl ement( a_a SuspendedN odes, node ); | |||||
| 515 | } | |||||
| 516 | else if ( node .nodeType == 3 ) | |||||
| 517 | { //text | |||||
| 518 | a_aSus pendedNode s[a_aSuspe ndedNodes. length] = node; | |||||
| 519 | } | |||||
| 520 | } | |||||
| 521 | } | |||||
| 522 | ||||||
| 523 | function h ighlightDo cument() | |||||
| 524 | { | |||||
| 525 | if ( !docume nt.body || document. body == nu ll ) | |||||
| 526 | retu rn; | |||||
| 527 | ||||||
| 528 | va r aSuspend edNodes = new Array( ); | |||||
| 529 | do HighLightD omElement( aSuspende dNodes, do cument.bod y ); | |||||
| 530 | pr ocessSuspe ndNodes( a SuspendedN odes ); | |||||
| 531 | } | |||||
| 532 | ||||||
| 533 | /////// st art routin e //////// / | |||||
| 534 | function I sHighLight Required() | |||||
| 535 | { | |||||
| 536 | va r bRetVal = false; | |||||
| 537 | va r searchSe tting = gs HiliteSear chSetting. match( "^( .+),(.+),( .*)$" ); | |||||
| 538 | ||||||
| 539 | if (searchSet ting != nu ll) | |||||
| 540 | { | |||||
| 541 | if(s earchSetti ng[1] == " enable") | |||||
| 542 | { | |||||
| 543 | gsBkgn dColor = s earchSetti ng[2]; | |||||
| 544 | gsText Color = se archSettin g[3]; | |||||
| 545 | bRetVa l = true; | |||||
| 546 | } | |||||
| 547 | } | |||||
| 548 | re turn bRetV al; | |||||
| 549 | } | |||||
| 550 | ||||||
| 551 | function o nGetHighli ghtInfo(oM sg) | |||||
| 552 | { | |||||
| 553 | if(oMs g && oMsg. oParam) | |||||
| 554 | { | |||||
| 555 | if (typeof(oM sg.oParam. bHighlight ) == 'unde fined' || oMsg.oPara m.bHighlig ht == fals e) | |||||
| 556 | return; | |||||
| 557 | if (oMsg.oPar am.nResult s <= 0) | |||||
| 558 | return; | |||||
| 559 | va r strTerms = ""; | |||||
| 560 | st rTerms = o Msg.oParam .strTerms; | |||||
| 561 | St artHighLig htSearch(s trTerms); | |||||
| 562 | } | |||||
| 563 | } | |||||
| 564 | ||||||
| 565 | function o nGetPaneIn foToHighli ght(oMsg) | |||||
| 566 | { | |||||
| 567 | if (oM sg) | |||||
| 568 | { | |||||
| 569 | if (oMsg.oPar am != "fts ") | |||||
| 570 | return ; | |||||
| 571 | var oMsg = new whM essage(WH_ MSG_GETHIG HLIGHTINFO , null, ne w Object() ); | |||||
| 572 | re quest(oMsg , onGetHig hlightInfo ); | |||||
| 573 | } | |||||
| 574 | } | |||||
| 575 | ||||||
| 576 | function h ighlightSe arch() | |||||
| 577 | { | |||||
| 578 | if (!IsHighLi ghtRequire d()) return; | |||||
| 579 | ||||||
| 580 | // check pane in focus is Search pane. | |||||
| 581 | va r oMsg=new whMessage (WH_MSG_GE TPANEINFO, null, nul l); | |||||
| 582 | re quest(oMsg , onGetPan eInfoToHig hlight); | |||||
| 583 | } | |||||
| 584 | ||||||
| 585 | function S tartHighLi ghtSearch( strTerms) | |||||
| 586 | { | |||||
| 587 | if (!IsHighLi ghtRequire d()) return; | |||||
| 588 | ||||||
| 589 | fi ndSearchTe rms(strTer ms); | |||||
| 590 | ||||||
| 591 | hi ghlightDoc ument(); | |||||
| 592 | } | |||||
| 593 | ||||||
| 594 | //////// c ommon with FTS routi nes to ide ntify stop word etc. ///////// /// | |||||
| 595 | // Languag eService.j s--------- ---------- -------- | |||||
| 596 | ||||||
| 597 | function L anguageSer vice() | |||||
| 598 | { | |||||
| 599 | th is.getNorm alizedOrg = function ( a_strOrg , a_Result ) | |||||
| 600 | { | |||||
| 601 | var strUpper = a_strOrg. toUpperCas e(); | |||||
| 602 | var strLower = a_strOrg. toLowerCas e(); | |||||
| 603 | ||||||
| 604 | if ( utf8Compa re(strUppe r, strLowe r) == 0 || utf8Compa re(strUppe r, a_strOr g) != 0 ) | |||||
| 605 | { | |||||
| 606 | a_Resu lt.strNorm alizedOrg = strLower ; | |||||
| 607 | a_Resu lt.bUpperC ase = fals e; | |||||
| 608 | } | |||||
| 609 | else | |||||
| 610 | { | |||||
| 611 | a_Resu lt.strNorm alizedOrg = strUpper ; | |||||
| 612 | a_Resu lt.bUpperC ase = true ; | |||||
| 613 | } | |||||
| 614 | } | |||||
| 615 | th is.stemWit h = functi on( a_strW ord, a_str Suffix ) | |||||
| 616 | { | |||||
| 617 | var s = a_strS uffix.spli t( "," ); | |||||
| 618 | var strSuffix = s[0]; | |||||
| 619 | var bRemoveOnl y = ( s[1] == '1' ); | |||||
| 620 | ||||||
| 621 | var ss = a_str Word.match ( "^..+" + strSuffix + "$" ); | |||||
| 622 | if ( ss == nul l ) | |||||
| 623 | return null; | |||||
| 624 | ||||||
| 625 | var nLenRest = a_strWord .length - strSuffix. length; | |||||
| 626 | var bAddE = fa lse; | |||||
| 627 | if ( !bRemoveO nly ) | |||||
| 628 | { | |||||
| 629 | if ( ! this.isVow el( a_strW ord.charAt ( nLenRest - 1 ) ) ) | |||||
| 630 | { | |||||
| 631 | if ( a_s trWord.cha rAt( nLenR est - 1 ) == a_strWo rd.charAt( nLenRest - 2 ) ) | |||||
| 632 | nLenRest-- ; | |||||
| 633 | else | |||||
| 634 | bAddE = tr ue; | |||||
| 635 | } | |||||
| 636 | } | |||||
| 637 | ||||||
| 638 | var strStem = a_strWord. substr( 0, nLenRest ); | |||||
| 639 | ||||||
| 640 | if ( strStem.l ength < 2 || (( strS tem.length == 2) && !bAddE ) ) | |||||
| 641 | return null; | |||||
| 642 | ||||||
| 643 | //if ( strStem .length <= 2 ) | |||||
| 644 | //retu rn null; | |||||
| 645 | ||||||
| 646 | retu rn strStem ; | |||||
| 647 | } | |||||
| 648 | th is.helStem = functio n( a_Resul t ) | |||||
| 649 | { | |||||
| 650 | var strWord = a_Result.s trNormaliz edOrg.toLo werCase(); | |||||
| 651 | ||||||
| 652 | var nSuffixNum = g_Runes HelSuffixe s.length; | |||||
| 653 | var nStemFound = 0; | |||||
| 654 | var strStem = null; | |||||
| 655 | for ( var i = 0; i < nSu ffixNum; i ++ ) | |||||
| 656 | { | |||||
| 657 | strSte m = this.s temWith( s trWord, g_ RunesHelSu ffixes[i] ); | |||||
| 658 | if ( s trStem != null ) | |||||
| 659 | { | |||||
| 660 | nStemFou nd = i + 1 ; | |||||
| 661 | break; | |||||
| 662 | } | |||||
| 663 | } | |||||
| 664 | if ( strStem = = null ) | |||||
| 665 | strSte m = strWor d; | |||||
| 666 | ||||||
| 667 | a_Re sult.strHe lStem = st rStem; | |||||
| 668 | a_Re sult.nHelW ordShape = a_Result. bUpperCase ? nStemFo und * 2 + 1 : nStemF ound * 2; | |||||
| 669 | } | |||||
| 670 | th is.isVowel = functio n( a_ch ) | |||||
| 671 | { | |||||
| 672 | retu rn g_Runes Vowels.ind exOf( a_ch ) >= 0; | |||||
| 673 | } | |||||
| 674 | th is.isWordB reak = fun ction( a_c h ) | |||||
| 675 | { | |||||
| 676 | retu rn ( !this .isQuote( a_ch ) && g_RunesWor dBreaks.in dexOf( a_c h ) >= 0 ) ; | |||||
| 677 | } | |||||
| 678 | th is.isWhite Space = fu nction( a_ ch ) | |||||
| 679 | { | |||||
| 680 | retu rn ( g_Run esWhiteSpa ces.indexO f( a_ch ) >= 0 ); | |||||
| 681 | } | |||||
| 682 | th is.isSpeci alBreak = function( a_ch ) | |||||
| 683 | { | |||||
| 684 | retu rn ( g_Run esSpecialB reaks.inde xOf( a_ch ) >= 0 ); | |||||
| 685 | } | |||||
| 686 | th is.isCJKCo dePoint = function( a_ch ) | |||||
| 687 | { | |||||
| 688 | //fr om http:// en.wikiped ia.org/wik i/Plane_%2 8Unicode%2 9 | |||||
| 689 | if ( (typeof(a _ch) == "u ndefined" ) || (a_ch == "" ) ) | |||||
| 690 | return false ; | |||||
| 691 | var val = a_ch .charCodeA t(0) ; | |||||
| 692 | ||||||
| 693 | retu rn ( ((0x 2E80 <= va l) && ( v al <= 0x9F FF)) //Eas t Asian sc ripts and symbols | |||||
| 694 | || ((0x F900 <= va l) && ( v al <= 0xFA FF)) //CJ K Compatib ility Ideo graphs | |||||
| 695 | || ((0x FE30 <= va l) && ( v al <= 0xFE 4F)) //CJK Com patibility Forms | |||||
| 696 | || ((0x FF00 <= va l) && ( v al <= 0xFF EF)) ); // Halfwidth and Fullwi dth Forms (FF00�FF EF) | |||||
| 697 | } | |||||
| 698 | th is.isQuote = functio n( a_ch ) | |||||
| 699 | { | |||||
| 700 | retu rn ( a_ch == g_Runes Quote ); | |||||
| 701 | } | |||||
| 702 | th is.isAND = function( a_strOp ) | |||||
| 703 | { retu rn ( a_str Op == "and " ); } | |||||
| 704 | th is.isOR = function( a_strOp ) | |||||
| 705 | { retu rn ( a_str Op == "or" ); } | |||||
| 706 | th is.isNOT = function( a_strOp ) | |||||
| 707 | { retu rn ( a_str Op == "not " ); } | |||||
| 708 | th is.isOpera tor = func tion( strO p ) | |||||
| 709 | { if ( strOp == "and" || | |||||
| 710 | strOp == "or" | | | |||||
| 711 | strOp == "not" ) | |||||
| 712 | return true; | |||||
| 713 | } | |||||
| 714 | } | |||||
| 715 | ||||||
| 716 | // Runes.j s--------- ---------- ---------- ----- | |||||
| 717 | ||||||
| 718 | var ES NT_AND = 1; | |||||
| 719 | var ES NT_OR = 2; | |||||
| 720 | var ES NT_NOT = 3; | |||||
| 721 | var ES NT_DEFAULT = 4; | |||||
| 722 | var ES NT_PHRASE = 5; | |||||
| 723 | ||||||
| 724 | function R unesContex t( a_strSr c ) | |||||
| 725 | { | |||||
| 726 | th is.strSrc = a_strSrc ; | |||||
| 727 | th is.nCur = 0; | |||||
| 728 | th is.bFailed = false; | |||||
| 729 | th is.bNot = false; | |||||
| 730 | th is.nWordIn dex = 0; | |||||
| 731 | ||||||
| 732 | th is.getCurC har = func tion() | |||||
| 733 | { | |||||
| 734 | retu rn this.st rSrc.charA t( this.nC ur ); | |||||
| 735 | } | |||||
| 736 | th is.getChar = functio n( i ) | |||||
| 737 | { | |||||
| 738 | retu rn this.st rSrc.charA t( i ); | |||||
| 739 | } | |||||
| 740 | th is.reachEn d = functi on() | |||||
| 741 | { | |||||
| 742 | retu rn this.nC ur >= this .strSrc.le ngth; | |||||
| 743 | } | |||||
| 744 | } | |||||
| 745 | ||||||
| 746 | function D olWord( a_ strWord, a _nPosition ) | |||||
| 747 | { | |||||
| 748 | th is.strWord = a_strW ord; | |||||
| 749 | th is.nPositi on = a_nPos ition; | |||||
| 750 | } | |||||
| 751 | ||||||
| 752 | function S olNode(){} | |||||
| 753 | ||||||
| 754 | function R unesServic e() | |||||
| 755 | { | |||||
| 756 | th is.langSev = new Lan guageServi ce(); | |||||
| 757 | ||||||
| 758 | th is.isOpera tor = func tion( a_st r, a_nFrom ) | |||||
| 759 | { | |||||
| 760 | var strOp = th is.getWord ( a_str, a _nFrom ).t oLowerCase (); | |||||
| 761 | ||||||
| 762 | if ( this.lang Sev.isOper ator( strO p ) ) | |||||
| 763 | return true; | |||||
| 764 | ||||||
| 765 | retu rn false; | |||||
| 766 | } | |||||
| 767 | ||||||
| 768 | th is.getLeng thOfWordBr eak = func tion( a_st r, a_nFrom ) | |||||
| 769 | { | |||||
| 770 | var i = a_nFro m, nLen = a_str.leng th; | |||||
| 771 | whil e ( i < nL en && this .langSev.i sWordBreak ( a_str.ch arAt( i ) ) ) | |||||
| 772 | i++; | |||||
| 773 | retu rn i - a_n From; | |||||
| 774 | } | |||||
| 775 | ||||||
| 776 | th is.getLeng thOfCJKWor dBreak = f unction( a _str, a_nF rom ) | |||||
| 777 | { | |||||
| 778 | var i = a_nFro m, nLen = a_str.leng th; | |||||
| 779 | whil e ( i < nL en && (thi s.langSev. isWordBrea k( a_str.c harAt( i ) ) || this .langSev.i sCJKCodePo int( a_str .charAt( i ) ))) | |||||
| 780 | i++; | |||||
| 781 | retu rn i - a_n From; | |||||
| 782 | } | |||||
| 783 | ||||||
| 784 | th is.getLeng thOfWord = function( a_str, a_ nFrom ) | |||||
| 785 | { | |||||
| 786 | var i = a_nFro m, nLen = a_str.leng th; | |||||
| 787 | whil e ( i < nL en && | |||||
| 788 | !this.la ngSev.isWo rdBreak( a _str.charA t( i ) ) & & | |||||
| 789 | !this.la ngSev.isQu ote( a_str .charAt( i ) ) ) | |||||
| 790 | ++i; | |||||
| 791 | retu rn i - a_n From; | |||||
| 792 | } | |||||
| 793 | ||||||
| 794 | th is.getNonC JKWord = f unction( a _str, a_nF rom ) | |||||
| 795 | { | |||||
| 796 | var i = a_nFro m, nLen = a_str.leng th; | |||||
| 797 | whil e ( i < nL en && | |||||
| 798 | !this.la ngSev.isWo rdBreak( a _str.charA t( i ) ) & & | |||||
| 799 | !this.la ngSev.isCJ KCodePoint ( a_str.ch arAt( i ) ) && | |||||
| 800 | !this.la ngSev.isQu ote( a_str .charAt( i ) ) ) | |||||
| 801 | ++i; | |||||
| 802 | var nLen = i - a_nFrom; | |||||
| 803 | retu rn a_str.s ubstr( a_n From, nLen ); | |||||
| 804 | } | |||||
| 805 | ||||||
| 806 | th is.getWord = functio n( a_str, a_nFrom ) | |||||
| 807 | { | |||||
| 808 | var nLen = thi s.getLengt hOfWord( a _str, a_nF rom ); | |||||
| 809 | retu rn a_str.s ubstr( a_n From, nLen ); | |||||
| 810 | } | |||||
| 811 | ||||||
| 812 | th is.getTerm = functio n( a_Conte xt, a_Rslt ) | |||||
| 813 | { | |||||
| 814 | if ( this.lang Sev.isQuot e( a_Conte xt.getCurC har() ) ) | |||||
| 815 | { | |||||
| 816 | a_Cont ext.nCur++ ; | |||||
| 817 | ||||||
| 818 | var nL en = this. getLengthO fPhrase( a _Context.s trSrc, a_C ontext.nCu r ); | |||||
| 819 | if ( n Len <= 0 ) | |||||
| 820 | return f alse; | |||||
| 821 | ||||||
| 822 | a_Rslt .eType = E SNT_PHRASE ; | |||||
| 823 | a_Rslt .strTerm = a_Context .strSrc.su bstr( a_Co ntext.nCur , nLen ); | |||||
| 824 | a_Cont ext.nCur + = nLen + 1 ; | |||||
| 825 | } | |||||
| 826 | else | |||||
| 827 | { | |||||
| 828 | var nL en = this. getLengthO fDefault( a_Context. strSrc, a_ Context.nC ur ); | |||||
| 829 | if ( n Len <= 0 ) | |||||
| 830 | return f alse; | |||||
| 831 | ||||||
| 832 | a_Rslt .eType = E SNT_DEFAUL T; | |||||
| 833 | a_Rslt .strTerm = a_Context .strSrc.su bstr( a_Co ntext.nCur , nLen ); | |||||
| 834 | a_Cont ext.nCur + = nLen; | |||||
| 835 | } | |||||
| 836 | ||||||
| 837 | retu rn true; | |||||
| 838 | } | |||||
| 839 | ||||||
| 840 | th is.getOper ator = fun ction( a_C ontext, a_ Rslt ) | |||||
| 841 | { | |||||
| 842 | if ( a_Context .reachEnd( ) ) | |||||
| 843 | return false; | |||||
| 844 | ||||||
| 845 | var strOp = th is.getWord ( a_Contex t.strSrc, a_Context. nCur ).toL owerCase() ; | |||||
| 846 | ||||||
| 847 | if ( this.lang Sev.isAND( strOp ) ) | |||||
| 848 | { | |||||
| 849 | a_Rslt .eType = E SNT_AND; | |||||
| 850 | a_Cont ext.nCur + = strOp.le ngth; | |||||
| 851 | } | |||||
| 852 | else if ( this .langSev.i sOR( strOp ) ) | |||||
| 853 | { | |||||
| 854 | a_Rslt .eType = E SNT_OR; | |||||
| 855 | a_Cont ext.nCur + = strOp.le ngth; | |||||
| 856 | } | |||||
| 857 | else if ( this .langSev.i sNOT( strO p ) ) | |||||
| 858 | { | |||||
| 859 | a_Rslt .eType = E SNT_NOT; | |||||
| 860 | a_Cont ext.nCur + = strOp.le ngth; | |||||
| 861 | } | |||||
| 862 | else | |||||
| 863 | { | |||||
| 864 | a_Rslt .eType = E SNT_OR; | |||||
| 865 | } | |||||
| 866 | ||||||
| 867 | retu rn true; | |||||
| 868 | } | |||||
| 869 | ||||||
| 870 | th is.getLeng thOfPhrase = functio n( a_str, a_nFrom ) | |||||
| 871 | { | |||||
| 872 | var i = a_nFro m, nLen = a_str.leng th; | |||||
| 873 | whil e ( i < nL en ) | |||||
| 874 | { | |||||
| 875 | if ( t his.langSe v.isQuote( a_str.cha rAt( i ) ) ) | |||||
| 876 | return i - a_nFrom ; | |||||
| 877 | ++i; | |||||
| 878 | } | |||||
| 879 | retu rn -1; | |||||
| 880 | } | |||||
| 881 | ||||||
| 882 | th is.getLeng thOfDefaul t = functi on( a_str, a_nFrom ) | |||||
| 883 | { | |||||
| 884 | var i = a_nFro m, nLen = a_str.leng th; | |||||
| 885 | whil e ( i < nL en && | |||||
| 886 | !this.is Operator( a_str, i ) && | |||||
| 887 | !this.la ngSev.isQu ote( a_str .charAt( i ) ) ) | |||||
| 888 | { | |||||
| 889 | i += t his.getLen gthOfWord( a_str, i ); | |||||
| 890 | i += t his.getLen gthOfWordB reak( a_st r, i ); | |||||
| 891 | } | |||||
| 892 | retu rn i - a_n From; | |||||
| 893 | } | |||||
| 894 | ||||||
| 895 | th is.parseOp erator = f unction( a _Context, a_Result, a_bNotAllo wed ) | |||||
| 896 | { | |||||
| 897 | a_Co ntext.nCur += this.g etLengthOf WordBreak( a_Context .strSrc, a _Context.n Cur ); | |||||
| 898 | ||||||
| 899 | var rslt = new Object; | |||||
| 900 | if ( !this.get Operator( a_Context, rslt ) ) | |||||
| 901 | return false; | |||||
| 902 | ||||||
| 903 | if ( rslt.eTyp e == ESNT_ NOT ) | |||||
| 904 | { | |||||
| 905 | if (a_ bNotAllowe d) | |||||
| 906 | { | |||||
| 907 | if ( a_Conte xt.bNOT ) | |||||
| 908 | { | |||||
| 909 | rslt .eType = E SNT_OR; | |||||
| 910 | } | |||||
| 911 | el se | |||||
| 912 | { | |||||
| 913 | a_Co ntext.bNOT = true; | |||||
| 914 | } | |||||
| 915 | } | |||||
| 916 | else | |||||
| 917 | { | |||||
| 918 | a_ Context.bF ailed = tr ue; | |||||
| 919 | re turn false ; | |||||
| 920 | } | |||||
| 921 | } | |||||
| 922 | a_Re sult.eType = rslt.eT ype; | |||||
| 923 | a_Re sult.right = new Sol Node(); | |||||
| 924 | if ( !this.par seTerm( a_ Context, a _Result.ri ght ) ) | |||||
| 925 | return false; | |||||
| 926 | ||||||
| 927 | retu rn true; | |||||
| 928 | } | |||||
| 929 | ||||||
| 930 | /* * | |||||
| 931 | St art parsin g the sear ch query f rom a_Cont ext.nCur a nd check f or presenc e of a phr ase or nor mal term | |||||
| 932 | Or a term pr efixed wit h NOT oper ator. In c ase a phra se or norm al term is encounter ed, check for operat ors | |||||
| 933 | in the rest of the exp ression. | |||||
| 934 | A term can c ontain man y words fo r e.g. | |||||
| 935 | Se arch query : hello wo rld AND fi rst topic | |||||
| 936 | Th is consist of two se arch terms : | |||||
| 937 | 1) hello wor ld | |||||
| 938 | 2) first top ic | |||||
| 939 | An d each of these term s have two words eac h. | |||||
| 940 | ** / | |||||
| 941 | th is.parseTe rm = funct ion( a_Con text, a_Re sult ) | |||||
| 942 | { | |||||
| 943 | a_Co ntext.nCur += this.g etLengthOf WordBreak( a_Context .strSrc, a _Context.n Cur ); | |||||
| 944 | ||||||
| 945 | var rslt = new Object; | |||||
| 946 | if ( !this.get Term( a_Co ntext, rsl t ) ) | |||||
| 947 | { | |||||
| 948 | if (( this.parse Operator( a_Context, rslt, tru e ) )&&(rs lt.eType = = ESNT_NOT )) | |||||
| 949 | { | |||||
| 950 | a_Resu lt.eType = rslt.eTyp e; | |||||
| 951 | if (rs lt.right.e Type == ES NT_DEFAULT ) | |||||
| 952 | { | |||||
| 953 | a_Result .strTerm = rslt.righ t.strTerm; | |||||
| 954 | return t rue ; | |||||
| 955 | } | |||||
| 956 | el se | |||||
| 957 | { | |||||
| 958 | a_Contex t.bFailed = true; | |||||
| 959 | return f alse; | |||||
| 960 | } | |||||
| 961 | } | |||||
| 962 | else | |||||
| 963 | { | |||||
| 964 | a_Cont ext.bFaile d = true; | |||||
| 965 | re turn false ; | |||||
| 966 | } | |||||
| 967 | } | |||||
| 968 | ||||||
| 969 | if ( this.pars eOperator( a_Context , a_Result , false ) ) | |||||
| 970 | { | |||||
| 971 | a_Resu lt.left = new SolNod e(); | |||||
| 972 | a_Resu lt.left.eT ype = rslt .eType; | |||||
| 973 | a_Resu lt.left.st rTerm = rs lt.strTerm ; | |||||
| 974 | } | |||||
| 975 | else | |||||
| 976 | { | |||||
| 977 | a_Resu lt.eType = rslt.eTyp e; | |||||
| 978 | a_Resu lt.strTerm = rslt.st rTerm; | |||||
| 979 | } | |||||
| 980 | ||||||
| 981 | retu rn true; | |||||
| 982 | } | |||||
| 983 | ||||||
| 984 | th is.extract Term = fun ction( a_C ontext, a_ Term ) | |||||
| 985 | { | |||||
| 986 | a_Te rm.aWords = new Arra y(); | |||||
| 987 | this .dolSegmen t( a_Term ); | |||||
| 988 | ||||||
| 989 | if ( a_Term.aW ords.lengt h == 0 ) | |||||
| 990 | return false; | |||||
| 991 | ||||||
| 992 | if(a _Term.eTyp e != ESNT_ PHRASE) | |||||
| 993 | { | |||||
| 994 | //if s earch type is not ph rase searc h, remove special br eak charac ters | |||||
| 995 | var j =0; | |||||
| 996 | for ( var i = 0; i < a_Ter m.aWords.l ength; i++ ) | |||||
| 997 | { | |||||
| 998 | if(!this .langSev.i sSpecialBr eak( a_Ter m.aWords[i ].strWord. charAt( 0 ) )) | |||||
| 999 | { | |||||
| 1000 | a_Term.aWo rds[j] = a _Term.aWor ds[i]; | |||||
| 1001 | j++; | |||||
| 1002 | } | |||||
| 1003 | } | |||||
| 1004 | a_Term .aWords.le ngth = j; | |||||
| 1005 | } | |||||
| 1006 | ||||||
| 1007 | for ( var i = 0; i < a_T erm.aWords .length; i ++ ) | |||||
| 1008 | { | |||||
| 1009 | a_Term .aWords[i] .nWordId = a_Term.aW ords[i].nP osition + a_Context. nWordIndex ; | |||||
| 1010 | } | |||||
| 1011 | a_Co ntext.nWor dIndex = a _Term.aWor ds[a_Term. aWords.len gth - 1].n WordId + 1 ; | |||||
| 1012 | retu rn true; | |||||
| 1013 | } | |||||
| 1014 | ||||||
| 1015 | /* * | |||||
| 1016 | Ch eck each t erm in the query and break up each term in individ ual words. | |||||
| 1017 | ** / | |||||
| 1018 | th is.parsePh raseAndDef ault = fun ction( a_C ontext, a_ Node ) | |||||
| 1019 | { | |||||
| 1020 | if ( a_Node.eT ype == ESN T_PHRASE | | a_Node.e Type == ES NT_DEFAULT || a_Node .eType == ESNT_NOT) | |||||
| 1021 | { | |||||
| 1022 | if ( ! this.extra ctTerm( a_ Context, a _Node ) && | |||||
| 1023 | a_Node. eType == E SNT_PHRASE ) | |||||
| 1024 | a_Contex t.bFailed = true; | |||||
| 1025 | } | |||||
| 1026 | else | |||||
| 1027 | { | |||||
| 1028 | this.p arsePhrase AndDefault ( a_Contex t, a_Node. left ); | |||||
| 1029 | this.p arsePhrase AndDefault ( a_Contex t, a_Node. right ); | |||||
| 1030 | } | |||||
| 1031 | } | |||||
| 1032 | ||||||
| 1033 | th is.helStem = functio n( a_strOr g, a_Resul t ) | |||||
| 1034 | { | |||||
| 1035 | this .langSev.g etNormaliz edOrg( a_s trOrg, a_R esult ); | |||||
| 1036 | this .langSev.h elStem( a_ Result ); | |||||
| 1037 | } | |||||
| 1038 | ||||||
| 1039 | /* * | |||||
| 1040 | * Check pre sence of a ny break c haracters in given t erm, start ing from " cur" posit ion. | |||||
| 1041 | * If the br eak charac ters prese nt are spe cial break /CJK, incl ude them i n a_Result . | |||||
| 1042 | * Update po sition of next word and also c haracter p osition of next non breaking | |||||
| 1043 | * character in the te rm. | |||||
| 1044 | * Change th e term typ e to phras e, if a CJ K break is encounter ed. | |||||
| 1045 | * / | |||||
| 1046 | th is.parseBr eakCharact ers = fun ction( a_T erm , a_po sitions) | |||||
| 1047 | { | |||||
| 1048 | var a_strSrc = a_Term.st rTerm; | |||||
| 1049 | var a_Result = a_Term.aW ords ; | |||||
| 1050 | var nLen = a_s trSrc.leng th; | |||||
| 1051 | var nCur = a_p ositions[" cur"]; | |||||
| 1052 | var nPosition = a_positi ons["pos"] ; | |||||
| 1053 | var bCJKTerm = false ; | |||||
| 1054 | var bCJKBreak = false ; | |||||
| 1055 | whil e ( nCur < nLen && ( this.langS ev.isWordB reak( a_st rSrc.charA t( nCur )) || this.l angSev.isC JKCodePoin t( a_strSr c.charAt( nCur ))) ) | |||||
| 1056 | { | |||||
| 1057 | ||||||
| 1058 | if ( t his.langSe v.isSpecia lBreak( a_ strSrc.cha rAt( nCur ) ) || (bC JKBreak = this.langS ev.isCJKCo dePoint( a _strSrc.ch arAt( nCur ))) ) | |||||
| 1059 | { | |||||
| 1060 | //it's a special w ord/CJK br eak, inclu de it in s earch | |||||
| 1061 | a_Result [a_Result. length] = new DolWor d( a_strSr c.charAt( nCur ), nP osition ); | |||||
| 1062 | nPositio n++; | |||||
| 1063 | ||||||
| 1064 | if (!bCJ KTerm && b CJKBreak) //set the term as CJ K term | |||||
| 1065 | bCJKTerm = true ; | |||||
| 1066 | } | |||||
| 1067 | nCur++ ; | |||||
| 1068 | } | |||||
| 1069 | a_po sitions["c ur"] = nCu r ; | |||||
| 1070 | a_po sitions["p os"] = nPo sition ; | |||||
| 1071 | ||||||
| 1072 | if ( bCJKTerm) | |||||
| 1073 | a_Term .eType = E SNT_PHRASE ; | |||||
| 1074 | } | |||||
| 1075 | ||||||
| 1076 | /* * | |||||
| 1077 | Br eak the cu rrent term in words. | |||||
| 1078 | If the term contains C JK charact ers, treat each one of them | |||||
| 1079 | as a seperat e word. | |||||
| 1080 | If any of th e words is a CJK cha racter, tr eat this t erm as a p hrase term . | |||||
| 1081 | ** / | |||||
| 1082 | th is.dolSegm ent = func tion( a_Te rm ) | |||||
| 1083 | { | |||||
| 1084 | var a_strSrc = a_Term.st rTerm; | |||||
| 1085 | var a_Result = a_Term.aW ords ; | |||||
| 1086 | var nLen = a_s trSrc.leng th; | |||||
| 1087 | var strWord = ""; | |||||
| 1088 | var positions = new Arra y(); | |||||
| 1089 | posi tions["cur "] = 0 ; | |||||
| 1090 | posi tions["pos "] = 1 ; | |||||
| 1091 | ||||||
| 1092 | this .parseBrea kCharacter s( a_Term, positions ); | |||||
| 1093 | ||||||
| 1094 | whil e ( positi ons["cur"] < nLen ) | |||||
| 1095 | { | |||||
| 1096 | strWor d = this.g etNonCJKWo rd( a_strS rc, positi ons["cur"] ); | |||||
| 1097 | a_Resu lt[a_Resul t.length] = new DolW ord( strWo rd, positi ons["pos"] ); | |||||
| 1098 | ||||||
| 1099 | positi ons["cur"] += strWor d.length; | |||||
| 1100 | positi ons["pos"] ++ ; | |||||
| 1101 | ||||||
| 1102 | //chec k if we ca n find som e special break/CJK characters in betwee n this and next word | |||||
| 1103 | this.p arseBreakC haracters( a_Term, p ositions ); | |||||
| 1104 | } | |||||
| 1105 | } | |||||
| 1106 | ||||||
| 1107 | th is.solPars e = functi on( a_strS rc, a_Resu lt ) | |||||
| 1108 | { | |||||
| 1109 | var context = new RunesC ontext( a_ strSrc ); | |||||
| 1110 | this .parseTerm ( context, a_Result ); | |||||
| 1111 | ||||||
| 1112 | if ( context.b Failed ) | |||||
| 1113 | return false; | |||||
| 1114 | ||||||
| 1115 | this .parsePhra seAndDefau lt( contex t, a_Resul t ); | |||||
| 1116 | if ( context.b Failed ) | |||||
| 1117 | return false; | |||||
| 1118 | ||||||
| 1119 | retu rn true; | |||||
| 1120 | } | |||||
| 1121 | } | |||||
| 1122 | ||||||
| 1123 | function _ helStemNod e( a_Runes , a_Node ) | |||||
| 1124 | { | |||||
| 1125 | wi th ( a_Nod e ) | |||||
| 1126 | { | |||||
| 1127 | if ( eType == ESNT_PHRAS E || eType == ESNT_D EFAULT || eType == E SNT_NOT) | |||||
| 1128 | { | |||||
| 1129 | for ( var i = 0; i < aWord s.length; i++ ) | |||||
| 1130 | { | |||||
| 1131 | a_Runes. helStem( a Words[i].s trWord, aW ords[i] ) | |||||
| 1132 | } | |||||
| 1133 | } | |||||
| 1134 | else | |||||
| 1135 | { | |||||
| 1136 | _helSt emNode( a_ Runes, lef t ); | |||||
| 1137 | _helSt emNode( a_ Runes, rig ht ); | |||||
| 1138 | } | |||||
| 1139 | } | |||||
| 1140 | } | |||||
| 1141 | ||||||
| 1142 | function f indSearchT erms(searc hTerms) | |||||
| 1143 | { | |||||
| 1144 | va r runes = new RunesS ervice(); | |||||
| 1145 | va r expressi on = new S olNode(); | |||||
| 1146 | if ( !runes. solParse( searchTerm s, express ion ) ) | |||||
| 1147 | retu rn ; | |||||
| 1148 | ||||||
| 1149 | _h elStemNode ( runes, e xpression ) | |||||
| 1150 | ||||||
| 1151 | bu ildSearchT erms(expre ssion) ; | |||||
| 1152 | } | |||||
| 1153 | ||||||
| 1154 | function b uildSearch Terms(a_No de) | |||||
| 1155 | { | |||||
| 1156 | if (a_Node.e Type == ES NT_NOT ) | |||||
| 1157 | retu rn ; | |||||
| 1158 | el se if ( a_ Node.eType == ESNT_P HRASE ) | |||||
| 1159 | { | |||||
| 1160 | gaSe archTerms[ gaSearchTe rms.length ] = trim( a_Node.str Term ) ; | |||||
| 1161 | } | |||||
| 1162 | el se if ( a_ Node.eType == ESNT_D EFAULT ) | |||||
| 1163 | { | |||||
| 1164 | with ( a_Node ) | |||||
| 1165 | { | |||||
| 1166 | for ( var i = 0; i < aWord s.length; i++ ) | |||||
| 1167 | { | |||||
| 1168 | gaSearch Terms[gaSe archTerms. length] = aWords[i]. strHelStem ; | |||||
| 1169 | } | |||||
| 1170 | } | |||||
| 1171 | } | |||||
| 1172 | el se | |||||
| 1173 | { | |||||
| 1174 | buil dSearchTer ms( a_Nod e.left ); | |||||
| 1175 | buil dSearchTer ms( a_Nod e.right ); | |||||
| 1176 | } | |||||
| 1177 | } | |||||
| 1178 | ||||||
| 1179 | function t rim(string ToTrim) { | |||||
| 1180 | re turn strin gToTrim.re place(/^\s +|\s+$/g," "); | |||||
| 1181 | } | |||||
| 1182 | ||||||
| 1183 | function u tf8Compare (strText1, strText2) | |||||
| 1184 | { | |||||
| 1185 | va r strt1=st rText1; | |||||
| 1186 | va r strt2=st rText2; | |||||
| 1187 | ||||||
| 1188 | tr y { | |||||
| 1189 | strt 1=strText1 .toLowerCa se(); | |||||
| 1190 | } | |||||
| 1191 | ca tch(er) { | |||||
| 1192 | } | |||||
| 1193 | ||||||
| 1194 | tr y { | |||||
| 1195 | strt 2=strText2 .toLowerCa se(); | |||||
| 1196 | } | |||||
| 1197 | ca tch(er) { | |||||
| 1198 | } | |||||
| 1199 | ||||||
| 1200 | if (strt1<str t2) return -1; | |||||
| 1201 | if (strt1>str t2) return 1; | |||||
| 1202 | re turn 0; | |||||
| 1203 | } | |||||
| 1204 | ||||||
| 1205 | ||||||
| 1206 | ||||||
| 1207 | /////// en d highligh t search r ountines / ////////// // | |||||
| 1208 | ||||||
| 1209 | function s etButtonFo nt(sType,s FontName,s FontSize,s FontColor, sFontStyle ,sFontWeig ht,sFontDe coration) | |||||
| 1210 | { | |||||
| 1211 | va r vFont=ne w whFont(s FontName,s FontSize,s FontColor, sFontStyle ,sFontWeig ht,sFontDe coration); | |||||
| 1212 | gs BtnStyle+= ".whtbtn"+ sType+"{"+ getFontSty le(vFont)+ "}"; | |||||
| 1213 | } | |||||
| 1214 | ||||||
| 1215 | function w riteBtnSty le() | |||||
| 1216 | { | |||||
| 1217 | if (gaButtons .length>0) | |||||
| 1218 | { | |||||
| 1219 | if(g sBtnStyle. length>0) | |||||
| 1220 | { | |||||
| 1221 | var sS tyle="<sty le type='t ext/css'>" ; | |||||
| 1222 | sStyle +=gsBtnSty le+"</styl e>"; | |||||
| 1223 | docume nt.write(s Style); | |||||
| 1224 | } | |||||
| 1225 | } | |||||
| 1226 | } | |||||
| 1227 | ||||||
| 1228 | function b utton(sTex t,nWidth,n Height) | |||||
| 1229 | { | |||||
| 1230 | th is.sText=s Text; | |||||
| 1231 | th is.nWidth= nWidth; | |||||
| 1232 | th is.nHeight =nHeight; | |||||
| 1233 | ||||||
| 1234 | th is.aImgs=n ew Array() ; | |||||
| 1235 | va r i=0; | |||||
| 1236 | wh ile(button .arguments .length>i+ 3) | |||||
| 1237 | { | |||||
| 1238 | this .aImgs[i]= button.arg uments[3+i ]; | |||||
| 1239 | i++; | |||||
| 1240 | } | |||||
| 1241 | } | |||||
| 1242 | ||||||
| 1243 | ||||||
| 1244 | //recursiv ely finds the parent project S tartPage p ath if exi sts | |||||
| 1245 | //also com putes the child toc path in th e parent t oc recursi vely until | |||||
| 1246 | //main pro j | |||||
| 1247 | ||||||
| 1248 | function o nGetPPStar tPage(xmlD oc, sPath) | |||||
| 1249 | { | |||||
| 1250 | if(xml Doc == nul l) | |||||
| 1251 | return; | |||||
| 1252 | ||||||
| 1253 | va r root = x mlDoc.docu mentElemen t; | |||||
| 1254 | va r masterPr oj = null; | |||||
| 1255 | tr y | |||||
| 1256 | { | |||||
| 1257 | mast erProj = x mlDoc.getE lementsByT agName("sy ncinfo"); | |||||
| 1258 | if(m asterProj. length > 0 ) | |||||
| 1259 | { | |||||
| 1260 | var st artpage = xmlDoc.get ElementsBy TagName("s tartpage") ; | |||||
| 1261 | if(sta rtpage.len gth>0) | |||||
| 1262 | { | |||||
| 1263 | ma sterStartP ageName = startpage[ 0].getAttr ibute("nam e"); | |||||
| 1264 | ma sterStartP ageRelPath = startpa ge[0].getA ttribute(" url"); | |||||
| 1265 | va r sXmlFold erPath = _ getPath(sP ath); | |||||
| 1266 | sXmlFolder Path = _ge tFullPath( sXmlFolder Path, mast erStartPag eRelPath+m asterStart PageName); | |||||
| 1267 | ||||||
| 1268 | gsSt artPage = sXmlFolder Path; | |||||
| 1269 | gsRe lCurPagePa th=_getRel ativeFileN ame(gsStar tPage, doc ument.loca tion.href) ; | |||||
| 1270 | ||||||
| 1271 | getPPStart PagePath(s XmlFolderP ath); | |||||
| 1272 | } | |||||
| 1273 | } | |||||
| 1274 | } | |||||
| 1275 | ca tch(e) | |||||
| 1276 | { | |||||
| 1277 | return; | |||||
| 1278 | } | |||||
| 1279 | } | |||||
| 1280 | ||||||
| 1281 | function g etPPStartP agePath(sP ath) | |||||
| 1282 | { | |||||
| 1283 | if (sPath.len gth != 0) | |||||
| 1284 | { | |||||
| 1285 | var sXmlFolder Path = _ge tPath(sPat h); | |||||
| 1286 | if(s XmlFolderP ath.indexO f("/merged Projects/" ) == -1 && | |||||
| 1287 | sXmlFo lderPath.i ndexOf("\\ mergedProj ects\\") = = -1) | |||||
| 1288 | { | |||||
| 1289 | return ; | |||||
| 1290 | } | |||||
| 1291 | ||||||
| 1292 | var sdocPath = _getFullP ath(sXmlFo lderPath, "MasterDat a.xml"); | |||||
| 1293 | va r sCurrent DocPath = _getPath(d ocument.lo cation.hre f); | |||||
| 1294 | va r fileName = _getRel ativeFileN ame(sCurre ntDocPath, sdocPath) ; | |||||
| 1295 | ||||||
| 1296 | xm lJsReader. loadFile(f ileName, f unction (a _xmlDoc, a rgs) { | |||||
| 1297 | onGetPPS tartPage(a _xmlDoc, a rgs); | |||||
| 1298 | }, sPath); | |||||
| 1299 | } | |||||
| 1300 | } | |||||
| 1301 | ||||||
| 1302 | //project info | |||||
| 1303 | function s etRelStart Page(sPath ) | |||||
| 1304 | { | |||||
| 1305 | if (gsPPath.l ength==0) | |||||
| 1306 | { | |||||
| 1307 | gsPP ath=_getFu llPath(_ge tPath(docu ment.locat ion.href), _getPath( sPath)); | |||||
| 1308 | onSe tStartPage (); | |||||
| 1309 | ||||||
| 1310 | gsSt artPage=_g etFullPath (_getPath( document.l ocation.hr ef), sPath ); | |||||
| 1311 | gsRe lCurPagePa th=_getRel ativeFileN ame(gsStar tPage, doc ument.loca tion.href) ; | |||||
| 1312 | ||||||
| 1313 | try{ | |||||
| 1314 | getPPS tartPagePa th(gsStart Page); | |||||
| 1315 | } | |||||
| 1316 | catc h(e) | |||||
| 1317 | { | |||||
| 1318 | alert( "Error rea ding maste rData.xml" ); | |||||
| 1319 | } | |||||
| 1320 | } | |||||
| 1321 | } | |||||
| 1322 | ||||||
| 1323 | function g etImage(oI mage,sType ) | |||||
| 1324 | { | |||||
| 1325 | va r sImg=""; | |||||
| 1326 | if (oImage&&o Image.aImg s&&(oImage .aImgs.len gth>0)) | |||||
| 1327 | { | |||||
| 1328 | sImg +="<img al t=\""+sTyp e+"\" src= \""+oImage .aImgs[0]+ "\""; | |||||
| 1329 | if(o Image.nWid th>0) | |||||
| 1330 | sImg+= " width="+ oImage.nWi dth; | |||||
| 1331 | if(o Image.nHei ght>0) | |||||
| 1332 | sImg+= " height=" +oImage.nH eight; | |||||
| 1333 | sImg +=" border =0>"; | |||||
| 1334 | } | |||||
| 1335 | re turn sImg; | |||||
| 1336 | } | |||||
| 1337 | ||||||
| 1338 | function a ddTocInfo( sTocPath) | |||||
| 1339 | { | |||||
| 1340 | ga Paths[gaPa ths.length ]=sTocPath ; | |||||
| 1341 | } | |||||
| 1342 | ||||||
| 1343 | ||||||
| 1344 | var flex_n extLocatio n; | |||||
| 1345 | var flex_p reviousLoc ation; | |||||
| 1346 | ||||||
| 1347 | function a ddAvenueIn fo(sName,s Prev,sNext ) | |||||
| 1348 | { | |||||
| 1349 | ga Avenues[ga Avenues.le ngth]=new avenueInfo (sName,sPr ev,sNext); | |||||
| 1350 | fl ex_previou sLocation = sPrev; | |||||
| 1351 | fl ex_nextLoc ation = sN ext; | |||||
| 1352 | } | |||||
| 1353 | ||||||
| 1354 | function a ddButton(s Type,nStyl e,sText,sH ref,sOnCli ck,sOnMous eOver,sOnL oad,nWidth ,nHeight,s Img1,sImg2 ,sImg3) | |||||
| 1355 | { | |||||
| 1356 | va r sButton= ""; | |||||
| 1357 | va r nBtn=gaB uttons.len gth; | |||||
| 1358 | if (sType=="p rev") | |||||
| 1359 | { | |||||
| 1360 | if(c anGo(false )) | |||||
| 1361 | { | |||||
| 1362 | var sT itle="Prev ious Topic "; | |||||
| 1363 | goPrev =new butto n(sText,nW idth,nHeig ht,sImg1,s Img2,sImg3 ); | |||||
| 1364 | sButto n="<a titl e=\""+sTit le+"\" cla ss=\"whtbt nprev\" hr ef=\"javas cript:void (0);\" onc lick=\"goA venue(fals e);return false;\">" ; | |||||
| 1365 | if(nSt yle==BTN_T EXT) | |||||
| 1366 | sButton+ =goPrev.sT ext; | |||||
| 1367 | else | |||||
| 1368 | sButton+ =getImage( goPrev,sTi tle); | |||||
| 1369 | sButto n+="</a>"; | |||||
| 1370 | } | |||||
| 1371 | } | |||||
| 1372 | el se if(sTyp e=="next") | |||||
| 1373 | { | |||||
| 1374 | if(c anGo(true) ) | |||||
| 1375 | { | |||||
| 1376 | var sT itle="Next Topic"; | |||||
| 1377 | goNext =new butto n(sText,nW idth,nHeig ht,sImg1,s Img2,sImg3 ); | |||||
| 1378 | sButto n="<a titl e=\""+sTit le+"\" cla ss=\"whtbt nnext\" hr ef=\"javas cript:void (0);\" onc lick=\"goA venue(true );return f alse;\">"; | |||||
| 1379 | if(nSt yle==BTN_T EXT) | |||||
| 1380 | sButton+ =goNext.sT ext; | |||||
| 1381 | else | |||||
| 1382 | sButton+ =getImage( goNext,sTi tle); | |||||
| 1383 | sButto n+="</a>"; | |||||
| 1384 | } | |||||
| 1385 | } | |||||
| 1386 | el se if(sTyp e=="show") | |||||
| 1387 | { | |||||
| 1388 | if(i sTopicOnly ()&&(!gbOp era6||gbOp era7)) | |||||
| 1389 | { | |||||
| 1390 | var sT itle="Show Navigatio n Componen t"; | |||||
| 1391 | goShow =new butto n(sText,nW idth,nHeig ht,sImg1,s Img2,sImg3 ); | |||||
| 1392 | sButto n="<a titl e=\""+sTit le+"\" cla ss=\"whtbt nshow\" hr ef=\"javas cript:void (0);\" onc lick=\"sho w();return false;\"> "; | |||||
| 1393 | if(nSt yle==BTN_T EXT) | |||||
| 1394 | sButton+ =goShow.sT ext; | |||||
| 1395 | else | |||||
| 1396 | sButton+ =getImage( goShow,sTi tle); | |||||
| 1397 | sButto n+="</a>"; | |||||
| 1398 | } | |||||
| 1399 | } | |||||
| 1400 | el se if(sTyp e=="hide") | |||||
| 1401 | { | |||||
| 1402 | if(! isTopicOnl y()&&!gbOp era6) | |||||
| 1403 | { | |||||
| 1404 | var sT itle="Hide Navigatio n Componen t"; | |||||
| 1405 | goHide =new butto n(sText,nW idth,nHeig ht,sImg1,s Img2,sImg3 ); | |||||
| 1406 | sButto n="<a titl e=\""+sTit le+"\" cla ss=\"whtbt nhide\" hr ef=\"javas cript:void (0);\" onc lick=\"hid e();return false;\"> "; | |||||
| 1407 | if(nSt yle==BTN_T EXT) | |||||
| 1408 | sButton+ =goHide.sT ext; | |||||
| 1409 | else | |||||
| 1410 | sButton+ =getImage( goHide,sTi tle); | |||||
| 1411 | sButto n+="</a>"; | |||||
| 1412 | } | |||||
| 1413 | } | |||||
| 1414 | el se if(sTyp e=="showna v") | |||||
| 1415 | { | |||||
| 1416 | if(i sShowHideE nable()) | |||||
| 1417 | { | |||||
| 1418 | var sT itle="Show Navigatio n Componen t"; | |||||
| 1419 | goShow Nav=new bu tton(sText ,nWidth,nH eight,sImg 1,sImg2,sI mg3); | |||||
| 1420 | sButto n="<a titl e=\""+sTit le+"\" cla ss=\"whtbt nshownav\" href=\"ja vascript:v oid(0);\" onclick=\" showHidePa ne(true);r eturn fals e;\">"; | |||||
| 1421 | if(nSt yle==BTN_T EXT) | |||||
| 1422 | sButton+ =goShowNav .sText; | |||||
| 1423 | else | |||||
| 1424 | sButton+ =getImage( goShowNav, sTitle); | |||||
| 1425 | sButto n+="</a>"; | |||||
| 1426 | } | |||||
| 1427 | } | |||||
| 1428 | el se if(sTyp e=="hidena v") | |||||
| 1429 | { | |||||
| 1430 | if(i sShowHideE nable()) | |||||
| 1431 | { | |||||
| 1432 | var sT itle="Hide Navigatio n Componen t"; | |||||
| 1433 | goHide Nav=new bu tton(sText ,nWidth,nH eight,sImg 1,sImg2,sI mg3); | |||||
| 1434 | sButto n="<a titl e=\""+sTit le+"\" cla ss=\"whtbt nhidenav\" href=\"ja vascript:v oid(0);\" onclick=\" showHidePa ne(false); return fal se;\">"; | |||||
| 1435 | if(nSt yle==BTN_T EXT) | |||||
| 1436 | sButton+ =goHideNav .sText; | |||||
| 1437 | else | |||||
| 1438 | sButton+ =getImage( goHideNav, sTitle); | |||||
| 1439 | sButto n+="</a>"; | |||||
| 1440 | } | |||||
| 1441 | } | |||||
| 1442 | el se if(sTyp e=="syncto c") | |||||
| 1443 | { | |||||
| 1444 | if(g aPaths.len gth>0) | |||||
| 1445 | { | |||||
| 1446 | var sT itle="Sync TOC"; | |||||
| 1447 | goSync =new butto n(sText,nW idth,nHeig ht,sImg1,s Img2,sImg3 ); | |||||
| 1448 | sButto n="<a titl e=\""+sTit le+"\" cla ss=\"whtbt nsynctoc\" href=\"ja vascript:v oid(0);\" onclick=\" syncWithSh ow();retur n false;\" >"; | |||||
| 1449 | if(nSt yle==BTN_T EXT) | |||||
| 1450 | sButton+ =goSync.sT ext; | |||||
| 1451 | else | |||||
| 1452 | sButton+ =getImage( goSync,sTi tle); | |||||
| 1453 | sButto n+="</a>"; | |||||
| 1454 | } | |||||
| 1455 | } | |||||
| 1456 | el se if(sTyp e=="websea rch") | |||||
| 1457 | { | |||||
| 1458 | if(g sSearchFor mHref.leng th>0) | |||||
| 1459 | { | |||||
| 1460 | var sT itle="WebS earch"; | |||||
| 1461 | goWebS earch=new button(sTe xt,nWidth, nHeight,sI mg1,sImg2, sImg3); | |||||
| 1462 | sButto n="<a titl e=\""+sTit le+"\" cla ss=\"whtbt nwebsearch \" href=\" "+gsSearch FormHref+" \">"; | |||||
| 1463 | if(nSt yle==BTN_T EXT) | |||||
| 1464 | sButton+ =goWebSear ch.sText; | |||||
| 1465 | else | |||||
| 1466 | sButton+ =getImage( goWebSearc h,sTitle); | |||||
| 1467 | sButto n+="</a>"; | |||||
| 1468 | } | |||||
| 1469 | } | |||||
| 1470 | el se if(sTyp e=="search form") | |||||
| 1471 | { | |||||
| 1472 | gaBu ttons[nBtn ]="NeedSea rchForm"; | |||||
| 1473 | gaTy pes[nBtn]= sType; | |||||
| 1474 | } | |||||
| 1475 | if (sButton.l ength!=0) | |||||
| 1476 | { | |||||
| 1477 | if(n Style==BTN _TEXT) | |||||
| 1478 | sButto n+=" "; | |||||
| 1479 | gaBu ttons[nBtn ]="<td>"+s Button+"</ td>"; | |||||
| 1480 | gaTy pes[nBtn]= sType; | |||||
| 1481 | } | |||||
| 1482 | } | |||||
| 1483 | ||||||
| 1484 | function o nGetSyncSu pport(oMsg ) | |||||
| 1485 | { | |||||
| 1486 | if (oMsg && o Msg.oParam ) | |||||
| 1487 | { | |||||
| 1488 | gbSy ncEnabled= oMsg.oPara m; | |||||
| 1489 | } | |||||
| 1490 | } | |||||
| 1491 | ||||||
| 1492 | function G etSyncEnab led() | |||||
| 1493 | { | |||||
| 1494 | va r oMsg=new whMessage (WH_MSG_IS SYNCSSUPPO RT,null,nu ll); | |||||
| 1495 | re quest(oMsg , onGetSyn cSupport); | |||||
| 1496 | } | |||||
| 1497 | ||||||
| 1498 | function i sInPopup() | |||||
| 1499 | { | |||||
| 1500 | re turn (wind ow.name.in dexOf("BSS CPopup")!= -1); | |||||
| 1501 | } | |||||
| 1502 | ||||||
| 1503 | function g etIntopicB ar(sAlign) | |||||
| 1504 | { | |||||
| 1505 | va r sHTML="" ; | |||||
| 1506 | if (gaButtons .length>0) | |||||
| 1507 | { | |||||
| 1508 | sHTM L+="<div a lign="+sAl ign+">"; | |||||
| 1509 | ||||||
| 1510 | sHTM L+="<table cellpaddi ng=\"2\" c ellspacing =\"0\" bor der=\"0\"> <tr>"; | |||||
| 1511 | for( var i=0;i< gaButtons. length;i++ ) | |||||
| 1512 | { | |||||
| 1513 | if(gaT ypes[i]!=" synctoc"|| gbSyncEnab led) | |||||
| 1514 | { | |||||
| 1515 | if(gaBut tons[i]==" NeedSearch Form") | |||||
| 1516 | sHTML+=get SearchForm HTML(); | |||||
| 1517 | else | |||||
| 1518 | sHTML+=gaB uttons[i]; | |||||
| 1519 | } | |||||
| 1520 | } | |||||
| 1521 | sHTM L+="</tr>< /table>"; | |||||
| 1522 | ||||||
| 1523 | sHTM L+="</div> "; | |||||
| 1524 | } | |||||
| 1525 | re turn sHTML ; | |||||
| 1526 | } | |||||
| 1527 | ||||||
| 1528 | ||||||
| 1529 | function w riteIntopi cBar(nAlig ns) | |||||
| 1530 | { | |||||
| 1531 | if (isInPopup ()) return ; | |||||
| 1532 | if (gaButtons .length>0) | |||||
| 1533 | { | |||||
| 1534 | var sHTML=""; | |||||
| 1535 | var alignment1 = (gsPage Dir == "rt l")?"right ":"left"; | |||||
| 1536 | var alignment2 = (gsPage Dir == "lt r")?"right ":"left"; | |||||
| 1537 | if(n Aligns!=0) | |||||
| 1538 | { | |||||
| 1539 | sHTML+ ="<table w idth=100%> <tr>" | |||||
| 1540 | if(nAl igns&1) | |||||
| 1541 | sHTML+=" <td width= 33%>"+getI ntopicBar( alignment1 )+"</td>"; | |||||
| 1542 | if(nAl igns&2) | |||||
| 1543 | sHTML+=" <td width= 34%>"+getI ntopicBar( "center")+ "</td>"; | |||||
| 1544 | if(nAl igns&4) | |||||
| 1545 | sHTML+=" <td width= 33%>"+getI ntopicBar( alignment2 )+"</td>"; | |||||
| 1546 | sHTML+ ="</tr></t able>"; | |||||
| 1547 | docume nt.write(s HTML); | |||||
| 1548 | } | |||||
| 1549 | } | |||||
| 1550 | } | |||||
| 1551 | ||||||
| 1552 | function s endAveInfo Out() | |||||
| 1553 | { | |||||
| 1554 | if (!isInPopu p()) | |||||
| 1555 | setT imeout("se ndAveInfo( );",100); | |||||
| 1556 | } | |||||
| 1557 | ||||||
| 1558 | function s endAveInfo () | |||||
| 1559 | { | |||||
| 1560 | va r oMsg=new whMessage (WH_MSG_AV ENUEINFO,g aAvenues, null); | |||||
| 1561 | no tify(oMsg) ; | |||||
| 1562 | } | |||||
| 1563 | ||||||
| 1564 | ||||||
| 1565 | function o nNext() | |||||
| 1566 | { | |||||
| 1567 | va r oMsg=new whMessage (WH_MSG_NE XT,null,nu ll); | |||||
| 1568 | no tify(oMsg) ; | |||||
| 1569 | } | |||||
| 1570 | ||||||
| 1571 | function o nPrev() | |||||
| 1572 | { | |||||
| 1573 | va r oMsg=new whMessage (WH_MSG_PR EV,null,nu ll); | |||||
| 1574 | no tify(oMsg) ; | |||||
| 1575 | } | |||||
| 1576 | ||||||
| 1577 | function c reateSyncI nfo() | |||||
| 1578 | { | |||||
| 1579 | va r oParam=n ew Object( ); | |||||
| 1580 | va r sPath = null; | |||||
| 1581 | if(gsP Path.lengt h==0) | |||||
| 1582 | sPat h =_getPat h(document .location. href); | |||||
| 1583 | el se | |||||
| 1584 | sPat h = gsPPat h; | |||||
| 1585 | oP aram.sPPat h=sPath; | |||||
| 1586 | oP aram.sTPat h=document .location. href; | |||||
| 1587 | oP aram.aPath s=gaPaths; | |||||
| 1588 | re turn oPara m; | |||||
| 1589 | } | |||||
| 1590 | ||||||
| 1591 | function s yncWithSho w() | |||||
| 1592 | { | |||||
| 1593 | if (isTopicOn ly()) | |||||
| 1594 | show (); | |||||
| 1595 | el se | |||||
| 1596 | { | |||||
| 1597 | sync (); | |||||
| 1598 | show TocPane(); | |||||
| 1599 | } | |||||
| 1600 | } | |||||
| 1601 | ||||||
| 1602 | function s howTocPane () | |||||
| 1603 | { | |||||
| 1604 | va r oMsg=new whMessage (WH_MSG_SH OWTOC,null ,null); | |||||
| 1605 | no tify(oMsg) ; | |||||
| 1606 | } | |||||
| 1607 | ||||||
| 1608 | function s endSyncInf o() | |||||
| 1609 | { | |||||
| 1610 | if (!isInPopu p()) | |||||
| 1611 | { | |||||
| 1612 | var iParam=nul l; | |||||
| 1613 | if(g aPaths.len gth>0) | |||||
| 1614 | { | |||||
| 1615 | iParam =createSyn cInfo(); | |||||
| 1616 | } | |||||
| 1617 | var oMsg=new w hMessage(W H_MSG_SYNC INFO, iPar am, null); | |||||
| 1618 | noti fy(oMsg); | |||||
| 1619 | } | |||||
| 1620 | } | |||||
| 1621 | ||||||
| 1622 | function s endInvalid SyncInfo() | |||||
| 1623 | { | |||||
| 1624 | if (!isInPopu p()) | |||||
| 1625 | { | |||||
| 1626 | var oMsg=new w hMessage(W H_MSG_SYNC INFO,null, null); | |||||
| 1627 | noti fy(oMsg); | |||||
| 1628 | } | |||||
| 1629 | } | |||||
| 1630 | ||||||
| 1631 | function e nableWebSe arch(bEnab le) | |||||
| 1632 | { | |||||
| 1633 | if (!isInPopu p()) | |||||
| 1634 | { | |||||
| 1635 | var oMsg=new w hMessage(W H_MSG_ENAB LEWEBSEARC H, bEnable , null); | |||||
| 1636 | noti fy(oMsg); | |||||
| 1637 | } | |||||
| 1638 | } | |||||
| 1639 | ||||||
| 1640 | function a utoSync(nS ync) | |||||
| 1641 | { | |||||
| 1642 | if (nSync==0) return; | |||||
| 1643 | if (isInPopup ()) return ; | |||||
| 1644 | if (isOutMost Topic()) | |||||
| 1645 | sync (); | |||||
| 1646 | } | |||||
| 1647 | ||||||
| 1648 | function i sOutMostTo pic() | |||||
| 1649 | { | |||||
| 1650 | if (gnOutmost Topic==-1) { | |||||
| 1651 | if (wind ow.name == 'bsscrigh t') | |||||
| 1652 | gnOu tmostTopic = 1; | |||||
| 1653 | else | |||||
| 1654 | gnOu tmostTopic = 0; | |||||
| 1655 | } | |||||
| 1656 | re turn (gnOu tmostTopic ==1); | |||||
| 1657 | } | |||||
| 1658 | ||||||
| 1659 | function s ync() | |||||
| 1660 | { | |||||
| 1661 | if (gaPaths.l ength>0) | |||||
| 1662 | { | |||||
| 1663 | var iParam=cre ateSyncInf o(); | |||||
| 1664 | var oMessage=n ew whMessa ge(WH_MSG_ SYNCTOC,iP aram, null ); | |||||
| 1665 | noti fy(oMessag e); | |||||
| 1666 | } | |||||
| 1667 | } | |||||
| 1668 | ||||||
| 1669 | ||||||
| 1670 | function a venueInfo( sName,sPre v,sNext) | |||||
| 1671 | { | |||||
| 1672 | th is.sName=s Name; | |||||
| 1673 | th is.sPrev=s Prev; | |||||
| 1674 | th is.sNext=s Next; | |||||
| 1675 | } | |||||
| 1676 | ||||||
| 1677 | ||||||
| 1678 | ||||||
| 1679 | function u nRegisterL istener() | |||||
| 1680 | { | |||||
| 1681 | if (gbAIRSSL) | |||||
| 1682 | retu rn; | |||||
| 1683 | se ndInvalidS yncInfo(); | |||||
| 1684 | en ableWebSea rch(false) ; | |||||
| 1685 | if (whtopic_f oldUnload) | |||||
| 1686 | whto pic_foldUn load(); | |||||
| 1687 | } | |||||
| 1688 | ||||||
| 1689 | function o nReceiveNo tification (oMsg) | |||||
| 1690 | { | |||||
| 1691 | va r nMsgId=o Msg.msgId; | |||||
| 1692 | if (nMsgId==W H_MSG_NEXT ) | |||||
| 1693 | { | |||||
| 1694 | goAv enue(true) ; | |||||
| 1695 | } | |||||
| 1696 | el se if(nMsg Id==WH_MSG _PREV) | |||||
| 1697 | { | |||||
| 1698 | goAv enue(false ); | |||||
| 1699 | } | |||||
| 1700 | el se if(nMsg Id==WH_MSG _WEBSEARCH ) | |||||
| 1701 | { | |||||
| 1702 | webs earch(); | |||||
| 1703 | } | |||||
| 1704 | el se if(nMsg Id==WH_MSG _PRINT) | |||||
| 1705 | { | |||||
| 1706 | wind ow.print() ; | |||||
| 1707 | } | |||||
| 1708 | re turn true; | |||||
| 1709 | } | |||||
| 1710 | ||||||
| 1711 | function o nReceiveRe quest(oMsg ) | |||||
| 1712 | { | |||||
| 1713 | var nM sgId=oMsg. msgId; | |||||
| 1714 | if(nMs gId==WH_MS G_GETAVIAV ENUES) | |||||
| 1715 | { | |||||
| 1716 | oMsg .oParam.aA venues=gaA venues; | |||||
| 1717 | repl y(oMsg); | |||||
| 1718 | retu rn false; | |||||
| 1719 | } | |||||
| 1720 | el se if(nMsg Id==WH_MSG _GETTOCPAT HS) | |||||
| 1721 | { | |||||
| 1722 | if(i sOutMostTo pic()) | |||||
| 1723 | { | |||||
| 1724 | oMsg.o Param.oToc Info=creat eSyncInfo( ); | |||||
| 1725 | reply( oMsg); | |||||
| 1726 | return false; | |||||
| 1727 | } | |||||
| 1728 | else | |||||
| 1729 | return true; | |||||
| 1730 | } | |||||
| 1731 | re turn true; | |||||
| 1732 | } | |||||
| 1733 | ||||||
| 1734 | ||||||
| 1735 | function o nGetCurren tAvenue(oM sg) | |||||
| 1736 | { | |||||
| 1737 | if (oMsg && o Msg.oParam ) | |||||
| 1738 | { | |||||
| 1739 | var sTop ic=null; | |||||
| 1740 | var sAve nue= oMsg. oParam.sAv enue; | |||||
| 1741 | var nAve nue=-1; | |||||
| 1742 | if(sAven ue!=null&& sAvenue!=" ") | |||||
| 1743 | { | |||||
| 1744 | for(var i= 0;i<gaAven ues.length ;i++) | |||||
| 1745 | { | |||||
| 1746 | if (gaAvenues [i].sName= =sAvenue) | |||||
| 1747 | { | |||||
| 1748 | nAve nue=i; | |||||
| 1749 | brea k; | |||||
| 1750 | } | |||||
| 1751 | } | |||||
| 1752 | if(nAvenue !=-1) | |||||
| 1753 | { | |||||
| 1754 | if (oMsg.iPar am.bNext) | |||||
| 1755 | sTop ic=gaAvenu es[nAvenue ].sNext; | |||||
| 1756 | el se | |||||
| 1757 | sTop ic=gaAvenu es[nAvenue ].sPrev; | |||||
| 1758 | } | |||||
| 1759 | } | |||||
| 1760 | else | |||||
| 1761 | { | |||||
| 1762 | for(var i= 0;i<gaAven ues.length ;i++) | |||||
| 1763 | { | |||||
| 1764 | if (gaAvenues [i].sNext! =null&&gaA venues[i]. sNext.leng th>0&&oMsg .iParam.bN ext) | |||||
| 1765 | { | |||||
| 1766 | sTop ic=gaAvenu es[i].sNex t; | |||||
| 1767 | brea k; | |||||
| 1768 | } | |||||
| 1769 | el se if(gaAv enues[i].s Prev!=null &&gaAvenue s[i].sPrev .length>0& &!oMsg.iPa ram.bNext) | |||||
| 1770 | { | |||||
| 1771 | sTop ic=gaAvenu es[i].sPre v; | |||||
| 1772 | brea k; | |||||
| 1773 | } | |||||
| 1774 | } | |||||
| 1775 | } | |||||
| 1776 | ||||||
| 1777 | if(sTopi c!=null&&s Topic!="") | |||||
| 1778 | { | |||||
| 1779 | if(gsPPath !=null&&gs PPath!="") | |||||
| 1780 | { | |||||
| 1781 | sF ullTopicPa th=_getFul lPath(gsPP ath,sTopic ); | |||||
| 1782 | do cument.loc ation=sFul lTopicPath ; | |||||
| 1783 | } | |||||
| 1784 | } | |||||
| 1785 | ||||||
| 1786 | } | |||||
| 1787 | } | |||||
| 1788 | ||||||
| 1789 | function g oAvenue(bN ext) | |||||
| 1790 | { | |||||
| 1791 | var iP aram = new Object(); | |||||
| 1792 | iParam .bNext = b Next; | |||||
| 1793 | var oP aram=new O bject(); | |||||
| 1794 | oP aram.sAven ue=null; | |||||
| 1795 | va r oMsg=new whMessage (WH_MSG_GE TCURRENTAV ENUE, iPar am, oParam ); | |||||
| 1796 | if (isChromeL ocal()) | |||||
| 1797 | { | |||||
| 1798 | //browse sequence selection is not yet implement ed fully i n webhelp, | |||||
| 1799 | //so jus t ignoring current a venue | |||||
| 1800 | onGetCur rentAvenue (oMsg); | |||||
| 1801 | } | |||||
| 1802 | el se | |||||
| 1803 | re quest(oMsg , onGetCur rentAvenue ); | |||||
| 1804 | } | |||||
| 1805 | ||||||
| 1806 | function c anGo(bNext ) | |||||
| 1807 | { | |||||
| 1808 | fo r(var i=0; i<gaAvenue s.length;i ++) | |||||
| 1809 | { | |||||
| 1810 | if(( gaAvenues[ i].sNext!= null&&gaAv enues[i].s Next.lengt h>0&&bNext )|| | |||||
| 1811 | (gaAve nues[i].sP rev!=null& &gaAvenues [i].sPrev. length>0&& !bNext)) | |||||
| 1812 | return true; | |||||
| 1813 | } | |||||
| 1814 | re turn false ; | |||||
| 1815 | } | |||||
| 1816 | ||||||
| 1817 | function s how() | |||||
| 1818 | { | |||||
| 1819 | va r strUrl = ''; | |||||
| 1820 | if (gbBadUriE rror) | |||||
| 1821 | { | |||||
| 1822 | var strMainPag e = docume nt.locatio n.href; | |||||
| 1823 | var indx = str MainPage.t oLowerCase ().indexOf ("/mergedp rojects/") ; | |||||
| 1824 | if(i ndx != -1) | |||||
| 1825 | strUrl = strMain Page.subst ring(0, in dx+1) + "w hcsh_home. htm#topicu rl=" + str MainPage.s ubstring(i ndx+1); | |||||
| 1826 | else if(gsStar tPage!="") | |||||
| 1827 | strUrl =gsStartP age+"#"+gs RelCurPage Path; | |||||
| 1828 | } | |||||
| 1829 | el se if(gsSt artPage!=" ") | |||||
| 1830 | strUrl =gsStartP age+"#"+gs RelCurPage Path; | |||||
| 1831 | wi ndow.locat ion = strU rl; | |||||
| 1832 | } | |||||
| 1833 | ||||||
| 1834 | function h ide() | |||||
| 1835 | { | |||||
| 1836 | if (goFrame!= null) | |||||
| 1837 | { | |||||
| 1838 | goFr ame.locati on=window. location; | |||||
| 1839 | } | |||||
| 1840 | el se | |||||
| 1841 | { | |||||
| 1842 | var oParam=new Object(); | |||||
| 1843 | oP aram.oFram eName = "" ; | |||||
| 1844 | oPar am.oFrame= null; | |||||
| 1845 | var oMsg=new w hMessage(W H_MSG_GETS TARTFRAME, null,oPara m); | |||||
| 1846 | requ est(oMsg, function(o Msg){ | |||||
| 1847 | if(oMsg && oMsg.oP aram) | |||||
| 1848 | { | |||||
| 1849 | if(o Msg.oParam .oFrame != null) | |||||
| 1850 | { | |||||
| 1851 | goFrame= o Msg.oParam .oFrame; | |||||
| 1852 | } | |||||
| 1853 | else if(typeof (oMsg.oPar am.oFrameN ame) != un defined && oMsg.oPar am.oFrameN ame != "") | |||||
| 1854 | { | |||||
| 1855 | try{ | |||||
| 1856 | var oW nd = top.f rames[oMsg .oParam.oF rameName]; | |||||
| 1857 | if (ty peof (oWnd ) != 'unde fined' && oWnd != nu ll) | |||||
| 1858 | { | |||||
| 1859 | go Frame = oW nd; | |||||
| 1860 | } | |||||
| 1861 | }catch(e) {} | |||||
| 1862 | } | |||||
| 1863 | else if(isChro meLocal()) | |||||
| 1864 | goFrame = top; | |||||
| 1865 | if(g oFrame != null) | |||||
| 1866 | goFram e.location =window.lo cation; | |||||
| 1867 | } | |||||
| 1868 | }) ; | |||||
| 1869 | } | |||||
| 1870 | } | |||||
| 1871 | ||||||
| 1872 | function i sTopicOnly () | |||||
| 1873 | { | |||||
| 1874 | if (gnTopicOn ly==-1) | |||||
| 1875 | { | |||||
| 1876 | if(isChr omeLocal() ) | |||||
| 1877 | { | |||||
| 1878 | if(w indow.name == 'bsscm ain' || // for webhel p pro outp uts one pa ne view to pic opens in a frame with name 'bsscmain ' | |||||
| 1879 | wind ow.name == 'topicwin dow' || // 'topicwind ow' is for opening C SH with wi ndow | |||||
| 1880 | wind ow.name == 'ContentF rame') // Topic can be directl y open in 'ContentFr ame' for D UCC 508 co mpliant ou tput, when toc pane is hidden | |||||
| 1881 | gnTopicOnl y=1; | |||||
| 1882 | else if (windo w.name == 'bsscright ' || windo w != top) | |||||
| 1883 | gnTopicOnl y=0; | |||||
| 1884 | else | |||||
| 1885 | gnTopicOnl y=1; | |||||
| 1886 | } | |||||
| 1887 | else | |||||
| 1888 | { | |||||
| 1889 | var mainW nd = getSt ubPage(); | |||||
| 1890 | if(mainWn d != null) | |||||
| 1891 | g nTopicOnly = 0; | |||||
| 1892 | else | |||||
| 1893 | g nTopicOnly = 1; | |||||
| 1894 | } | |||||
| 1895 | } | |||||
| 1896 | re turn (gnTo picOnly==1 ); | |||||
| 1897 | } | |||||
| 1898 | ||||||
| 1899 | function w ebsearch() | |||||
| 1900 | { | |||||
| 1901 | if (gbNav4) | |||||
| 1902 | { | |||||
| 1903 | if(d ocument.eh elpform) | |||||
| 1904 | docume nt.ehelpfo rm.submit( ); | |||||
| 1905 | } | |||||
| 1906 | el se | |||||
| 1907 | { | |||||
| 1908 | if(w indow.ehel pform) | |||||
| 1909 | window .ehelpform .submit(); | |||||
| 1910 | } | |||||
| 1911 | } | |||||
| 1912 | ||||||
| 1913 | function a ddSearchFo rmHref(sHr ef) | |||||
| 1914 | { | |||||
| 1915 | gs SearchForm Href=sHref ; | |||||
| 1916 | en ableWebSea rch(true); | |||||
| 1917 | } | |||||
| 1918 | ||||||
| 1919 | function s earchB(nFo rm) | |||||
| 1920 | { | |||||
| 1921 | va r sValue=e val("docum ent.search Form"+nFor m+".search String.val ue"); | |||||
| 1922 | va r oMsg=new whMessage (WH_MSG_SE ARCHTHIS, sValue, nu ll); | |||||
| 1923 | no tify(oMsg) ; | |||||
| 1924 | } | |||||
| 1925 | ||||||
| 1926 | ||||||
| 1927 | function g etSearchFo rmHTML() | |||||
| 1928 | { | |||||
| 1929 | va r sHTML="" ; | |||||
| 1930 | gn Form++; | |||||
| 1931 | va r sFormNam e="searchF orm"+gnFor m; | |||||
| 1932 | va r sButton= "<form nam e=\""+sFor mName+"\" method=\"P OST\" acti on=\"javas cript:sear chB("+gnFo rm+")\">" | |||||
| 1933 | sB utton+="<i nput type= \"text\" n ame=\"sear chString\" value=\"- Full Text search -\ " size=\"2 0\"/>"; | |||||
| 1934 | if (""=="text ") | |||||
| 1935 | { | |||||
| 1936 | sBut ton+="<a c lass=\"sea rchbtn\" h ref=\"java script:voi d(0);\" on click=\""+ sFormName+ ".submit() ;return fa lse;\"></a >"; | |||||
| 1937 | } | |||||
| 1938 | el se if(""== "image") | |||||
| 1939 | { | |||||
| 1940 | sBut ton+="<a c lass=\"sea rchbtn\" h ref=\"java script:voi d(0);\" on click=\""+ sFormName+ ".submit() ;return fa lse;\">" | |||||
| 1941 | sBut ton+="<img src=\"\" border=0>< /a>"; | |||||
| 1942 | } | |||||
| 1943 | sB utton+="</ form>"; | |||||
| 1944 | sH TML="<td a lign=\"cen ter\">"+sB utton+"</t d>"; | |||||
| 1945 | re turn sHTML ; | |||||
| 1946 | } | |||||
| 1947 | ||||||
| 1948 | ||||||
| 1949 | ||||||
| 1950 | ||||||
| 1951 | function s howHidePan e(bShow) | |||||
| 1952 | { | |||||
| 1953 | va r oMsg=nul l; | |||||
| 1954 | if (bShow) | |||||
| 1955 | oMsg =new whMes sage(WH_MS G_SHOWPANE ,null,null ); | |||||
| 1956 | el se | |||||
| 1957 | oMsg =new whMes sage(WH_MS G_HIDEPANE ,null,null ); | |||||
| 1958 | no tify(oMsg) ; | |||||
| 1959 | } | |||||
| 1960 | ||||||
| 1961 | function i sShowHideE nable() | |||||
| 1962 | { | |||||
| 1963 | if (gbIE4) | |||||
| 1964 | retu rn true; | |||||
| 1965 | el se | |||||
| 1966 | retu rn false; | |||||
| 1967 | } | |||||
| 1968 | ||||||
| 1969 | var gMsgSe parator = "::"; | |||||
| 1970 | function i nstallList erner_air( ) | |||||
| 1971 | { | |||||
| 1972 | /* thi s function will inst all msg li stener for browser b ased air h elp */ | |||||
| 1973 | if (is ChromeLoca l()) { | |||||
| 1974 | wi ndow.addEv entListene r("message ", onRecei veMsg_air, false); | |||||
| 1975 | } | |||||
| 1976 | } | |||||
| 1977 | ||||||
| 1978 | function c reateFrame Info() | |||||
| 1979 | { | |||||
| 1980 | va r frameInf o = new Ob ject(); | |||||
| 1981 | fr ameInfo.fr ameID = gF rameId; | |||||
| 1982 | fr ameInfo.ti tle = esca pe(documen t.title); | |||||
| 1983 | if (typeof(RH _BreadCrum bDataStrin gVariable) != 'undef ined') | |||||
| 1984 | frameInf o.breadCru mbString = escape(RH _BreadCrum bDataStrin gVariable) ; | |||||
| 1985 | el se | |||||
| 1986 | frameInf o.breadCru mbString = ""; | |||||
| 1987 | ||||||
| 1988 | if (typeof(fl ex_previou sLocation) != 'undef ined') | |||||
| 1989 | frameInf o.previous = escape( flex_previ ousLocatio n); | |||||
| 1990 | el se | |||||
| 1991 | frameInf o.previous = ""; | |||||
| 1992 | ||||||
| 1993 | if (typeof(fl ex_nextLoc ation) != 'undefined ') | |||||
| 1994 | frameInf o.next = e scape(flex _nextLocat ion); | |||||
| 1995 | el se | |||||
| 1996 | frameInf o.next = " "; | |||||
| 1997 | fr ameInfo.re lativepath = escape( gsRelCurPa gePath); | |||||
| 1998 | fr ameInfo.ne wLocation = escape(w indow.loca tion.href) ; | |||||
| 1999 | if (isChromeL ocal()) | |||||
| 2000 | this .parent.po stMessage( "getFrameI nfo" + gMs gSeparator + JSON.st ringify(fr ameInfo), "*"); | |||||
| 2001 | else if(typeof (this.pare nt.updateF rameInfo) == 'functi on') | |||||
| 2002 | this.p arent.upda teFrameInf o(frameInf o); | |||||
| 2003 | } | |||||
| 2004 | ||||||
| 2005 | function o nReceiveMs g_air(even t) | |||||
| 2006 | { | |||||
| 2007 | var ms g = event. data.split (gMsgSepar ator); | |||||
| 2008 | var ms gType = ms g[0]; | |||||
| 2009 | var ms gData = ms g[1]; | |||||
| 2010 | switch (msgType) | |||||
| 2011 | { | |||||
| 2012 | case " startHight light": | |||||
| 2013 | St artHighLig htSearch(m sgData); | |||||
| 2014 | br eak; | |||||
| 2015 | case " getFrameIn fo": | |||||
| 2016 | gFra meId = msg Data; | |||||
| 2017 | br eak; | |||||
| 2018 | case "print": | |||||
| 2019 | window.p rint() | |||||
| 2020 | break; | |||||
| 2021 | } | |||||
| 2022 | } | |||||
| 2023 | ||||||
| 2024 | if(window. gbWhUtil & & window.g bWhVer && (gbAIRSSL ||(window. gbWhMsg&&w indow.gbWh Proxy))) | |||||
| 2025 | { | |||||
| 2026 | if (!gbAIRSSL ) | |||||
| 2027 | { | |||||
| 2028 | regi sterListen er("bsscri ght",WH_MS G_GETAVIAV ENUES); | |||||
| 2029 | regi sterListen er("bsscri ght",WH_MS G_GETTOCPA THS); | |||||
| 2030 | regi sterListen er("bsscri ght",WH_MS G_NEXT); | |||||
| 2031 | regi sterListen er("bsscri ght",WH_MS G_PREV); | |||||
| 2032 | regi sterListen er("bsscri ght",WH_MS G_WEBSEARC H); | |||||
| 2033 | regi sterListen er("bsscri ght",WH_MS G_PRINT); | |||||
| 2034 | } | |||||
| 2035 | el se | |||||
| 2036 | { | |||||
| 2037 | installL isterner_a ir(); | |||||
| 2038 | } | |||||
| 2039 | if (gbMac&&gb IE4) | |||||
| 2040 | { | |||||
| 2041 | if(t ypeof(wind ow.onunloa d)!="unkno wn") | |||||
| 2042 | if(win dow.onunlo ad.toStrin g!=unRegis terListene r.toString ) | |||||
| 2043 | whtopic_ foldUnload =window.on unload; | |||||
| 2044 | } | |||||
| 2045 | el se | |||||
| 2046 | { | |||||
| 2047 | if(w indow.onun load) | |||||
| 2048 | if(win dow.onunlo ad.toStrin g!=unRegis terListene r.toString ) | |||||
| 2049 | whtopic_ foldUnload =window.on unload; | |||||
| 2050 | } | |||||
| 2051 | wi ndow.onunl oad=unRegi sterListen er; | |||||
| 2052 | ||||||
| 2053 | if (!gbAIRSSL ) | |||||
| 2054 | GetSyncE nabled(); | |||||
| 2055 | gb WhTopic=tr ue; | |||||
| 2056 | } | |||||
| 2057 | else | |||||
| 2058 | do cument.loc ation.relo ad(); | |||||
| 2059 | ||||||
| 2060 | function P ickupDialo g_Invoke() | |||||
| 2061 | { | |||||
| 2062 | if (gbIE4 || gbNav6) | |||||
| 2063 | { | |||||
| 2064 | if(P ickupDialo g_Invoke.a rguments.l ength>2) | |||||
| 2065 | { | |||||
| 2066 | var sP ickup="whs kin_pickup .htm"; | |||||
| 2067 | var sP ickupPath= gsPPath+sP ickup; | |||||
| 2068 | { | |||||
| 2069 | var sFra me=PickupD ialog_Invo ke.argumen ts[1]; | |||||
| 2070 | var aTop ics=new Ar ray(); | |||||
| 2071 | for(var i=2;i<Pick upDialog_I nvoke.argu ments.leng th;i+=2) | |||||
| 2072 | { | |||||
| 2073 | var j=aTop ics.length ; | |||||
| 2074 | aTopics[j] =new Objec t(); | |||||
| 2075 | aTopics[j] .m_sName=P ickupDialo g_Invoke.a rguments[i ]; | |||||
| 2076 | aTopics[j] .m_sURL=Pi ckupDialog _Invoke.ar guments[i+ 1]; | |||||
| 2077 | } | |||||
| 2078 | ||||||
| 2079 | if(aTopi cs.length> 1) | |||||
| 2080 | { | |||||
| 2081 | var nWidth =300; | |||||
| 2082 | var nHeigh t=180; | |||||
| 2083 | var nS creenWidth =screen.wi dth; | |||||
| 2084 | var nS creenHeigh t=screen.h eight; | |||||
| 2085 | var nLeft= (nScreenWi dth-nWidth )/2; | |||||
| 2086 | var nTop=( nScreenHei ght-nHeigh t)/2; | |||||
| 2087 | { | |||||
| 2088 | va r vRet=win dow.showMo dalDialog( sPickupPat h,aTopics, "center:ye s;dialogHe ight:"+nHe ight+"px;d ialogWidth :"+nWidth+ "px;resiza ble:yes;st atus:no;sc roll:no;he lp:no;"); | |||||
| 2089 | if (vRet) | |||||
| 2090 | { | |||||
| 2091 | var sURL=vRet. m_url; | |||||
| 2092 | if(s Frame) | |||||
| 2093 | window .open(sURL ,sFrame); | |||||
| 2094 | else | |||||
| 2095 | window .open(sURL ,"_self"); | |||||
| 2096 | } | |||||
| 2097 | } | |||||
| 2098 | } | |||||
| 2099 | else if( aTopics.le ngth==1) | |||||
| 2100 | { | |||||
| 2101 | var sURL=a Topics[0]. m_sURL | |||||
| 2102 | if(sFrame) | |||||
| 2103 | wi ndow.open( sURL,sFram e); | |||||
| 2104 | else | |||||
| 2105 | wi ndow.open( sURL,"_sel f"); | |||||
| 2106 | } | |||||
| 2107 | } | |||||
| 2108 | } | |||||
| 2109 | } | |||||
| 2110 | el se | |||||
| 2111 | { | |||||
| 2112 | if(t ypeof(_Pop upMenu_Inv oke)=="fun ction") | |||||
| 2113 | return _PopupMen u_Invoke(P ickupDialo g_Invoke.a rguments); | |||||
| 2114 | } | |||||
| 2115 | } | |||||
| 2116 | ||||||
| 2117 | function e scapeRegEx p(str) | |||||
| 2118 | { | |||||
| 2119 | va r specials = new Reg Exp("[.*+? |()\\^\\$\ \[\\]{}\\\ \]", "g"); // .*+?|( )^$[]{}\ | |||||
| 2120 | re turn str.r eplace(spe cials, "\\ $&"); | |||||
| 2121 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.