Produced by Araxis Merge on 2/1/2017 2:57:59 PM 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 | C:\Araxis_Merge_Comprasion\Pub_un\BTSSS_CIF_122016.zip\BTSSS_CIF_12_20_16\clean\CRM Portal\trunk\BTSSSPortal\js | jquery.blockUI.js | Tue Dec 20 19:50:52 2016 UTC |
| 2 | Wed Feb 1 19:57:59 2017 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 0 | 0 |
| Changed | 0 | 0 |
| Inserted | 0 | 0 |
| Removed | 1 | 575 |
| 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 | /* | |||||
| 2 | jQuery blo ckUI plugi n | |||||
| 3 | Version 2. 56.0-2013. 01.31 | |||||
| 4 | requires j Query v1.7 or later | |||||
| 5 | Copyright (c) 2007-2 013 M. Als up | |||||
| 6 | Thanks to Amir-Hosse in Sobhi f or some ex cellent co ntribution s! | |||||
| 7 | ||||||
| 8 | Permission is hereby granted, free of ch arge, to a ny person obtaining a copy of this softw are and as sociated d ocumentati on files ( the "Softw are"), to deal in th e Software without r estriction , includin g without limitation the right s to use, copy, modi fy, merge, publish, distribute , sublicen se, and/or sell copi es of the Software, and to per mit person s to whom the Softwa re is furn ished to d o so, subj ect to the following condition s: | |||||
| 9 | ||||||
| 10 | The above copyright notice and this perm ission not ice shall be include d in all c opies or s ubstantial portions of the Sof tware. | |||||
| 11 | ||||||
| 12 | THE SOFTWA RE IS PROV IDED "AS I S", WITHOU T WARRANTY OF ANY KI ND, EXPRES S OR IMPLI ED, INCLUD ING BUT NO T LIMITED TO THE WAR RANTIES OF MERCHANTA BILITY, FI TNESS FOR A PARTICUL AR PURPOSE AND NONIN FRINGEMENT . IN NO EV ENT SHALL THE AUTHOR S OR COPYR IGHT HOLDE RS BE LIAB LE FOR ANY CLAIM, DA MAGES OR O THER LIABI LITY, WHET HER IN AN ACTION OF CONTRACT, TORT OR OT HERWISE, A RISING FRO M, OUT OF OR IN CONN ECTION WIT H THE SOFT WARE OR TH E USE OR O THER DEALI NGS IN THE SOFTWARE. | |||||
| 13 | */ | |||||
| 14 | ||||||
| 15 | ;(function () { | |||||
| 16 | "use stric t"; | |||||
| 17 | ||||||
| 18 | fu nction set up($) { | |||||
| 19 | $.fn ._fadeIn = $.fn.fade In; | |||||
| 20 | ||||||
| 21 | var noOp = $.n oop || fun ction() {} ; | |||||
| 22 | ||||||
| 23 | // t his bit is to ensure we don't call setEx pression w hen we sho uldn't (wi th extra m uscle to h andle | |||||
| 24 | // r etarded us erAgent st rings on V ista) | |||||
| 25 | var msie = /MS IE/.test(n avigator.u serAgent); | |||||
| 26 | var ie6 = /MS IE 6.0/.te st(navigat or.userAge nt) && ! / MSIE 8.0/. test(navig ator.userA gent); | |||||
| 27 | var mode = doc ument.docu mentMode | | 0; | |||||
| 28 | // v ar setExpr = msie && (($.brows er.version < 8 && !m ode) || mo de < 8); | |||||
| 29 | var setExpr = $.isFuncti on( docume nt.createE lement('di v').style. setExpress ion ); | |||||
| 30 | ||||||
| 31 | // g lobal $ me thods for blocking/u nblocking the entire page | |||||
| 32 | $.bl ockUI = function(o pts) { ins tall(windo w, opts); }; | |||||
| 33 | $.un blockUI = function(o pts) { rem ove(window , opts); } ; | |||||
| 34 | ||||||
| 35 | // c onvenience method fo r quick gr owl-like n otificatio ns (http: //www.goog le.com/sea rch?q=grow l) | |||||
| 36 | $.gr owlUI = fu nction(tit le, messag e, timeout , onClose) { | |||||
| 37 | var $m = $('<div class="gr owlUI"></d iv>'); | |||||
| 38 | if (ti tle) $m.ap pend('<h1> '+title+'< /h1>'); | |||||
| 39 | if (me ssage) $m. append('<h 2>'+messag e+'</h2>') ; | |||||
| 40 | if (ti meout === undefined) timeout = 3000; | |||||
| 41 | $.bloc kUI({ | |||||
| 42 | message: $m, fadeI n: 700, fa deOut: 100 0, centerY : false, | |||||
| 43 | timeout: timeout, showOverla y: false, | |||||
| 44 | onUnbloc k: onClose , | |||||
| 45 | css: $.b lockUI.def aults.grow lCSS | |||||
| 46 | }); | |||||
| 47 | }; | |||||
| 48 | ||||||
| 49 | // p lugin meth od for blo cking elem ent conten t | |||||
| 50 | $.fn .block = f unction(op ts) { | |||||
| 51 | var fu llOpts = $ .extend({} , $.blockU I.defaults , opts || {}); | |||||
| 52 | this.e ach(functi on() { | |||||
| 53 | var $el = $(this); | |||||
| 54 | if (full Opts.ignor eIfBlocked && $el.da ta('blockU I.isBlocke d')) | |||||
| 55 | return; | |||||
| 56 | $el.unbl ock({ fade Out: 0 }); | |||||
| 57 | }); | |||||
| 58 | ||||||
| 59 | return this.each (function( ) { | |||||
| 60 | if ($.cs s(this,'po sition') = = 'static' ) { | |||||
| 61 | this.style .position = 'relativ e'; | |||||
| 62 | $(this).da ta('blockU I.static', true); | |||||
| 63 | } | |||||
| 64 | this.sty le.zoom = 1; // forc e 'hasLayo ut' in ie | |||||
| 65 | install( this, opts ); | |||||
| 66 | }); | |||||
| 67 | }; | |||||
| 68 | ||||||
| 69 | // p lugin meth od for unb locking el ement cont ent | |||||
| 70 | $.fn .unblock = function( opts) { | |||||
| 71 | return this.each (function( ) { | |||||
| 72 | remove(t his, opts) ; | |||||
| 73 | }); | |||||
| 74 | }; | |||||
| 75 | ||||||
| 76 | $.bl ockUI.vers ion = 2.56 ; // 2nd g eneration blocking a t no extra cost! | |||||
| 77 | ||||||
| 78 | // o verride th ese in you r code to change the default b ehavior an d style | |||||
| 79 | $.bl ockUI.defa ults = { | |||||
| 80 | // mes sage displ ayed when blocking ( use null f or no mess age) | |||||
| 81 | messag e: '<h1>P lease wait ...</h1>', | |||||
| 82 | ||||||
| 83 | title: null, // title str ing; only used when theme == t rue | |||||
| 84 | dragga ble: true, // only used when them e == true (requires jquery-ui. js to be l oaded) | |||||
| 85 | ||||||
| 86 | theme: false, // set to tr ue to use with jQuer y UI theme s | |||||
| 87 | ||||||
| 88 | // sty les for th e message when block ing; if yo u wish to disable | |||||
| 89 | // the se and use an extern al stylesh eet then d o this in your code: | |||||
| 90 | // $.b lockUI.def aults.css = {}; | |||||
| 91 | css: { | |||||
| 92 | padding: 0, | |||||
| 93 | margin: 0, | |||||
| 94 | width: '3 0%', | |||||
| 95 | top: '4 0%', | |||||
| 96 | left: '3 5%', | |||||
| 97 | textAlig n: 'c enter', | |||||
| 98 | color: '# 000', | |||||
| 99 | border: '3 px solid # aaa', | |||||
| 100 | backgrou ndColor:'# fff', | |||||
| 101 | cursor: 'w ait' | |||||
| 102 | }, | |||||
| 103 | ||||||
| 104 | // min imal style set used when theme s are used | |||||
| 105 | themed CSS: { | |||||
| 106 | width: '30%', | |||||
| 107 | top: '40%', | |||||
| 108 | left: '35%' | |||||
| 109 | }, | |||||
| 110 | ||||||
| 111 | // sty les for th e overlay | |||||
| 112 | overla yCSS: { | |||||
| 113 | backgrou ndColor: '#00 0', | |||||
| 114 | opacity: 0.6, | |||||
| 115 | cursor: 'wait' | |||||
| 116 | }, | |||||
| 117 | ||||||
| 118 | // sty le to repl ace wait c ursor befo re unblock ing to cor rect issue | |||||
| 119 | // of lingering wait curso r | |||||
| 120 | cursor Reset: 'de fault', | |||||
| 121 | ||||||
| 122 | // sty les applie d when usi ng $.growl UI | |||||
| 123 | growlC SS: { | |||||
| 124 | width: '3 50px', | |||||
| 125 | top: '1 0px', | |||||
| 126 | left: '' , | |||||
| 127 | right: '1 0px', | |||||
| 128 | border: 'n one', | |||||
| 129 | padding: '5 px', | |||||
| 130 | opacity: 0. 6, | |||||
| 131 | cursor: 'd efault', | |||||
| 132 | color: '# fff', | |||||
| 133 | backgrou ndColor: ' #000', | |||||
| 134 | '-webkit -border-ra dius':'10p x', | |||||
| 135 | '-moz-bo rder-radiu s': '10p x', | |||||
| 136 | 'border- radius': '10px' | |||||
| 137 | }, | |||||
| 138 | ||||||
| 139 | // IE issues: 'a bout:blank ' fails on HTTPS and javascrip t:false is s-l-o-w | |||||
| 140 | // (ha t tip to J orge H. N. de Vascon celos) | |||||
| 141 | /*jshi nt scriptu rl:true */ | |||||
| 142 | iframe Src: /^htt ps/i.test( window.loc ation.href || '') ? 'javascrip t:false' : 'about:bl ank', | |||||
| 143 | ||||||
| 144 | // for ce usage o f iframe i n non-IE b rowsers (h andy for b locking ap plets) | |||||
| 145 | forceI frame: fal se, | |||||
| 146 | ||||||
| 147 | // z-i ndex for t he blockin g overlay | |||||
| 148 | baseZ: 1000, | |||||
| 149 | ||||||
| 150 | // set these to true to ha ve the mes sage autom atically c entered | |||||
| 151 | center X: true, / / <-- only effects e lement blo cking (pag e block co ntrolled v ia css abo ve) | |||||
| 152 | center Y: true, | |||||
| 153 | ||||||
| 154 | // all ow body el ement to b e stetched in ie6; t his makes blocking l ook better | |||||
| 155 | // on "short" pa ges. disa ble if you wish to p revent cha nges to th e body hei ght | |||||
| 156 | allowB odyStretch : true, | |||||
| 157 | ||||||
| 158 | // ena ble if you want key and mouse events to be disable d for cont ent that i s blocked | |||||
| 159 | bindEv ents: true , | |||||
| 160 | ||||||
| 161 | // be default bl ockUI will supress t ab navigat ion from l eaving blo cking cont ent | |||||
| 162 | // (if bindEvent s is true) | |||||
| 163 | constr ainTabKey: true, | |||||
| 164 | ||||||
| 165 | // fad eIn time i n millis; set to 0 t o disable fadeIn on block | |||||
| 166 | fadeIn : 200, | |||||
| 167 | ||||||
| 168 | // fad eOut time in millis; set to 0 to disable fadeOut o n unblock | |||||
| 169 | fadeOu t: 400, | |||||
| 170 | ||||||
| 171 | // tim e in milli s to wait before aut o-unblocki ng; set to 0 to disa ble auto-u nblock | |||||
| 172 | timeou t: 0, | |||||
| 173 | ||||||
| 174 | // dis able if yo u don't wa nt to show the overl ay | |||||
| 175 | showOv erlay: tru e, | |||||
| 176 | ||||||
| 177 | // if true, focu s will be placed in the first available input fiel d when | |||||
| 178 | // pag e blocking | |||||
| 179 | focusI nput: true , | |||||
| 180 | ||||||
| 181 | // sup presses th e use of o verlay sty les on FF/ Linux (due to perfor mance issu es with op acity) | |||||
| 182 | // no longer nee ded in 201 2 | |||||
| 183 | // app lyPlatform OpacityRul es: true, | |||||
| 184 | ||||||
| 185 | // cal lback meth od invoked when fade In has com pleted and blocking message is visible | |||||
| 186 | onBloc k: null, | |||||
| 187 | ||||||
| 188 | // cal lback meth od invoked when unbl ocking has completed ; the call back is | |||||
| 189 | // pas sed the el ement that has been unblocked (which is the window object fo r page | |||||
| 190 | // blo cks) and t he options that were passed to the unblo ck call: | |||||
| 191 | // onUnbloc k(element, options) | |||||
| 192 | onUnbl ock: null, | |||||
| 193 | ||||||
| 194 | // cal lback meth od invoked when the overlay ar ea is clic ked. | |||||
| 195 | // set ting this will turn the cursor to a poin ter, other wise curso r defined in overlay Css will b e used. | |||||
| 196 | onOver layClick: null, | |||||
| 197 | ||||||
| 198 | // don 't ask; if you reall y must kno w: http:// groups.goo gle.com/gr oup/jquery -en/browse _thread/th read/36640 a873050359 5/2f6a79a7 7a78e493#2 f6a79a77a7 8e493 | |||||
| 199 | quirks modeOffset Hack: 4, | |||||
| 200 | ||||||
| 201 | // cla ss name of the messa ge block | |||||
| 202 | blockM sgClass: ' blockMsg', | |||||
| 203 | ||||||
| 204 | // if it is alre ady blocke d, then ig nore it (d on't unblo ck and reb lock) | |||||
| 205 | ignore IfBlocked: false | |||||
| 206 | }; | |||||
| 207 | ||||||
| 208 | // p rivate dat a and func tions foll ow... | |||||
| 209 | ||||||
| 210 | var pageBlock = null; | |||||
| 211 | var pageBlockE ls = []; | |||||
| 212 | ||||||
| 213 | func tion insta ll(el, opt s) { | |||||
| 214 | var cs s, themedC SS; | |||||
| 215 | var fu ll = (el = = window); | |||||
| 216 | var ms g = (opts && opts.me ssage !== undefined ? opts.mes sage : und efined); | |||||
| 217 | opts = $.extend( {}, $.bloc kUI.defaul ts, opts | | {}); | |||||
| 218 | ||||||
| 219 | if (op ts.ignoreI fBlocked & & $(el).da ta('blockU I.isBlocke d')) | |||||
| 220 | return; | |||||
| 221 | ||||||
| 222 | opts.o verlayCSS = $.extend ({}, $.blo ckUI.defau lts.overla yCSS, opts .overlayCS S || {}); | |||||
| 223 | css = $.extend({ }, $.block UI.default s.css, opt s.css || { }); | |||||
| 224 | if (op ts.onOverl ayClick) | |||||
| 225 | opts.ove rlayCSS.cu rsor = 'po inter'; | |||||
| 226 | ||||||
| 227 | themed CSS = $.ex tend({}, $ .blockUI.d efaults.th emedCSS, o pts.themed CSS || {}) ; | |||||
| 228 | msg = msg === un defined ? opts.messa ge : msg; | |||||
| 229 | ||||||
| 230 | // rem ove the cu rrent bloc k (if ther e is one) | |||||
| 231 | if (fu ll && page Block) | |||||
| 232 | remove(w indow, {fa deOut:0}); | |||||
| 233 | ||||||
| 234 | // if an existin g element is being u sed as the blocking content th en we capt ure | |||||
| 235 | // its current p lace in th e DOM (and current d isplay sty le) so we can restor e | |||||
| 236 | // it when we un block | |||||
| 237 | if (ms g && typeo f msg != ' string' && (msg.pare ntNode || msg.jquery )) { | |||||
| 238 | var node = msg.jqu ery ? msg[ 0] : msg; | |||||
| 239 | var data = {}; | |||||
| 240 | $(el).da ta('blockU I.history' , data); | |||||
| 241 | data.el = node; | |||||
| 242 | data.par ent = node .parentNod e; | |||||
| 243 | data.dis play = nod e.style.di splay; | |||||
| 244 | data.pos ition = no de.style.p osition; | |||||
| 245 | if (data .parent) | |||||
| 246 | data.paren t.removeCh ild(node); | |||||
| 247 | } | |||||
| 248 | ||||||
| 249 | $(el). data('bloc kUI.onUnbl ock', opts .onUnblock ); | |||||
| 250 | var z = opts.bas eZ; | |||||
| 251 | ||||||
| 252 | // blo ckUI uses 3 layers f or blockin g, for sim plicity th ey are all used on e very platf orm; | |||||
| 253 | // lay er1 is the iframe la yer which is used to supress b leed throu gh of unde rlying con tent | |||||
| 254 | // lay er2 is the overlay l ayer which has opaci ty and a w ait cursor (by defau lt) | |||||
| 255 | // lay er3 is the message c ontent tha t is displ ayed while blocking | |||||
| 256 | var ly r1, lyr2, lyr3, s; | |||||
| 257 | if (ms ie || opts .forceIfra me) | |||||
| 258 | lyr1 = $ ('<iframe class="blo ckUI" styl e="z-index :'+ (z++) +';display :none;bord er:none;ma rgin:0;pad ding:0;pos ition:abso lute;width :100%;heig ht:100%;to p:0;left:0 " src="'+o pts.iframe Src+'"></i frame>'); | |||||
| 259 | else | |||||
| 260 | lyr1 = $ ('<div cla ss="blockU I" style=" display:no ne"></div> '); | |||||
| 261 | ||||||
| 262 | if (op ts.theme) | |||||
| 263 | lyr2 = $ ('<div cla ss="blockU I blockOve rlay ui-wi dget-overl ay" style= "z-index:' + (z++) +' ;display:n one"></div >'); | |||||
| 264 | else | |||||
| 265 | lyr2 = $ ('<div cla ss="blockU I blockOve rlay" styl e="z-index :'+ (z++) +';display :none;bord er:none;ma rgin:0;pad ding:0;wid th:100%;he ight:100%; top:0;left :0"></div> '); | |||||
| 266 | ||||||
| 267 | if (op ts.theme & & full) { | |||||
| 268 | s = '<di v class="b lockUI ' + opts.bloc kMsgClass + ' blockP age ui-dia log ui-wid get ui-cor ner-all" s tyle="z-in dex:'+(z+1 0)+';displ ay:none;po sition:fix ed">'; | |||||
| 269 | if ( opt s.title ) { | |||||
| 270 | s += '<div class="ui -widget-he ader ui-di alog-title bar ui-cor ner-all bl ockTitle"> '+(opts.ti tle || '&n bsp;')+'</ div>'; | |||||
| 271 | } | |||||
| 272 | s += '<d iv class=" ui-widget- content ui -dialog-co ntent"></d iv>'; | |||||
| 273 | s += '</ div>'; | |||||
| 274 | } | |||||
| 275 | else i f (opts.th eme) { | |||||
| 276 | s = '<di v class="b lockUI ' + opts.bloc kMsgClass + ' blockE lement ui- dialog ui- widget ui- corner-all " style="z -index:'+( z+10)+';di splay:none ;position: absolute"> '; | |||||
| 277 | if ( opt s.title ) { | |||||
| 278 | s += '<div class="ui -widget-he ader ui-di alog-title bar ui-cor ner-all bl ockTitle"> '+(opts.ti tle || '&n bsp;')+'</ div>'; | |||||
| 279 | } | |||||
| 280 | s += '<d iv class=" ui-widget- content ui -dialog-co ntent"></d iv>'; | |||||
| 281 | s += '</ div>'; | |||||
| 282 | } | |||||
| 283 | else i f (full) { | |||||
| 284 | s = '<di v class="b lockUI ' + opts.bloc kMsgClass + ' blockP age" style ="z-index: '+(z+10)+' ;display:n one;positi on:fixed"> </div>'; | |||||
| 285 | } | |||||
| 286 | else { | |||||
| 287 | s = '<di v class="b lockUI ' + opts.bloc kMsgClass + ' blockE lement" st yle="z-ind ex:'+(z+10 )+';displa y:none;pos ition:abso lute"></di v>'; | |||||
| 288 | } | |||||
| 289 | lyr3 = $(s); | |||||
| 290 | ||||||
| 291 | // if we have a message, s tyle it | |||||
| 292 | if (ms g) { | |||||
| 293 | if (opts .theme) { | |||||
| 294 | lyr3.css(t hemedCSS); | |||||
| 295 | lyr3.addCl ass('ui-wi dget-conte nt'); | |||||
| 296 | } | |||||
| 297 | else | |||||
| 298 | lyr3.css(c ss); | |||||
| 299 | } | |||||
| 300 | ||||||
| 301 | // sty le the ove rlay | |||||
| 302 | if (!o pts.theme /*&& (!opt s.applyPla tformOpaci tyRules)*/ ) | |||||
| 303 | lyr2.css (opts.over layCSS); | |||||
| 304 | lyr2.c ss('positi on', full ? 'fixed' : 'absolut e'); | |||||
| 305 | ||||||
| 306 | // mak e iframe l ayer trans parent in IE | |||||
| 307 | if (ms ie || opts .forceIfra me) | |||||
| 308 | lyr1.css ('opacity' ,0.0); | |||||
| 309 | ||||||
| 310 | //$([l yr1[0],lyr 2[0],lyr3[ 0]]).appen dTo(full ? 'body' : el); | |||||
| 311 | var la yers = [ly r1,lyr2,ly r3], $par = full ? $ ('body') : $(el); | |||||
| 312 | $.each (layers, f unction() { | |||||
| 313 | this.app endTo($par ); | |||||
| 314 | }); | |||||
| 315 | ||||||
| 316 | if (op ts.theme & & opts.dra ggable && $.fn.dragg able) { | |||||
| 317 | lyr3.dra ggable({ | |||||
| 318 | handle: '. ui-dialog- titlebar', | |||||
| 319 | cancel: 'l i' | |||||
| 320 | }); | |||||
| 321 | } | |||||
| 322 | ||||||
| 323 | // ie7 must use absolute p ositioning in quirks mode and to account for activ ex issues (when scro lling) | |||||
| 324 | var ex pr = setEx pr && (!$. support.bo xModel || $('object, embed', fu ll ? null : el).leng th > 0); | |||||
| 325 | if (ie 6 || expr) { | |||||
| 326 | // give body 100% height | |||||
| 327 | if (full && opts.a llowBodySt retch && $ .support.b oxModel) | |||||
| 328 | $('html,bo dy').css(' height','1 00%'); | |||||
| 329 | ||||||
| 330 | // fix i e6 issue w hen blocke d element has a bord er width | |||||
| 331 | if ((ie6 || !$.sup port.boxMo del) && !f ull) { | |||||
| 332 | var t = sz (el,'borde rTopWidth' ), l = sz( el,'border LeftWidth' ); | |||||
| 333 | var fixT = t ? '(0 - '+t+')' : 0; | |||||
| 334 | var fixL = l ? '(0 - '+l+')' : 0; | |||||
| 335 | } | |||||
| 336 | ||||||
| 337 | // simul ate fixed position | |||||
| 338 | $.each(l ayers, fun ction(i,o) { | |||||
| 339 | var s = o[ 0].style; | |||||
| 340 | s.position = 'absolu te'; | |||||
| 341 | if (i < 2) { | |||||
| 342 | if (full) | |||||
| 343 | s.se tExpressio n('height' ,'Math.max (document. body.scrol lHeight, d ocument.bo dy.offsetH eight) - ( jQuery.sup port.boxMo del?0:'+op ts.quirksm odeOffsetH ack+') + " px"'); | |||||
| 344 | el se | |||||
| 345 | s.se tExpressio n('height' ,'this.par entNode.of fsetHeight + "px"'); | |||||
| 346 | if (full) | |||||
| 347 | s.se tExpressio n('width', 'jQuery.su pport.boxM odel && do cument.doc umentEleme nt.clientW idth || do cument.bod y.clientWi dth + "px" '); | |||||
| 348 | el se | |||||
| 349 | s.se tExpressio n('width', 'this.pare ntNode.off setWidth + "px"'); | |||||
| 350 | if (fixL) s. setExpress ion('left' , fixL); | |||||
| 351 | if (fixT) s. setExpress ion('top', fixT); | |||||
| 352 | } | |||||
| 353 | else if (o pts.center Y) { | |||||
| 354 | if (full) s. setExpress ion('top', '(document .documentE lement.cli entHeight || documen t.body.cli entHeight) / 2 - (th is.offsetH eight / 2) + (blah = document. documentEl ement.scro llTop ? do cument.doc umentEleme nt.scrollT op : docum ent.body.s crollTop) + "px"'); | |||||
| 355 | s. marginTop = 0; | |||||
| 356 | } | |||||
| 357 | else if (! opts.cente rY && full ) { | |||||
| 358 | va r top = (o pts.css && opts.css. top) ? par seInt(opts .css.top, 10) : 0; | |||||
| 359 | va r expressi on = '((do cument.doc umentEleme nt.scrollT op ? docum ent.docume ntElement. scrollTop : document .body.scro llTop) + ' +top+') + "px"'; | |||||
| 360 | s. setExpress ion('top', expression ); | |||||
| 361 | } | |||||
| 362 | }); | |||||
| 363 | } | |||||
| 364 | ||||||
| 365 | // sho w the mess age | |||||
| 366 | if (ms g) { | |||||
| 367 | if (opts .theme) | |||||
| 368 | lyr3.find( '.ui-widge t-content' ).append(m sg); | |||||
| 369 | else | |||||
| 370 | lyr3.appen d(msg); | |||||
| 371 | if (msg. jquery || msg.nodeTy pe) | |||||
| 372 | $(msg).sho w(); | |||||
| 373 | } | |||||
| 374 | ||||||
| 375 | if ((m sie || opt s.forceIfr ame) && op ts.showOve rlay) | |||||
| 376 | lyr1.sho w(); // op acity is z ero | |||||
| 377 | if (op ts.fadeIn) { | |||||
| 378 | var cb = opts.onBl ock ? opts .onBlock : noOp; | |||||
| 379 | var cb1 = (opts.sh owOverlay && !msg) ? cb : noOp ; | |||||
| 380 | var cb2 = msg ? cb : noOp; | |||||
| 381 | if (opts .showOverl ay) | |||||
| 382 | lyr2._fade In(opts.fa deIn, cb1) ; | |||||
| 383 | if (msg) | |||||
| 384 | lyr3._fade In(opts.fa deIn, cb2) ; | |||||
| 385 | } | |||||
| 386 | else { | |||||
| 387 | if (opts .showOverl ay) | |||||
| 388 | lyr2.show( ); | |||||
| 389 | if (msg) | |||||
| 390 | lyr3.show( ); | |||||
| 391 | if (opts .onBlock) | |||||
| 392 | opts.onBlo ck(); | |||||
| 393 | } | |||||
| 394 | ||||||
| 395 | // bin d key and mouse even ts | |||||
| 396 | bind(1 , el, opts ); | |||||
| 397 | ||||||
| 398 | if (fu ll) { | |||||
| 399 | pageBloc k = lyr3[0 ]; | |||||
| 400 | pageBloc kEls = $(' :input:ena bled:visib le',pageBl ock); | |||||
| 401 | if (opts .focusInpu t) | |||||
| 402 | setTimeout (focus, 20 ); | |||||
| 403 | } | |||||
| 404 | else | |||||
| 405 | center(l yr3[0], op ts.centerX , opts.cen terY); | |||||
| 406 | ||||||
| 407 | if (op ts.timeout ) { | |||||
| 408 | // auto- unblock | |||||
| 409 | var to = setTimeou t(function () { | |||||
| 410 | if (full) | |||||
| 411 | $. unblockUI( opts); | |||||
| 412 | else | |||||
| 413 | $( el).unbloc k(opts); | |||||
| 414 | }, opts. timeout); | |||||
| 415 | $(el).da ta('blockU I.timeout' , to); | |||||
| 416 | } | |||||
| 417 | } | |||||
| 418 | ||||||
| 419 | // r emove the block | |||||
| 420 | func tion remov e(el, opts ) { | |||||
| 421 | var fu ll = (el = = window); | |||||
| 422 | var $e l = $(el); | |||||
| 423 | var da ta = $el.d ata('block UI.history '); | |||||
| 424 | var to = $el.dat a('blockUI .timeout') ; | |||||
| 425 | if (to ) { | |||||
| 426 | clearTim eout(to); | |||||
| 427 | $el.remo veData('bl ockUI.time out'); | |||||
| 428 | } | |||||
| 429 | opts = $.extend( {}, $.bloc kUI.defaul ts, opts | | {}); | |||||
| 430 | bind(0 , el, opts ); // unbi nd events | |||||
| 431 | ||||||
| 432 | if (op ts.onUnblo ck === nul l) { | |||||
| 433 | opts.onU nblock = $ el.data('b lockUI.onU nblock'); | |||||
| 434 | $el.remo veData('bl ockUI.onUn block'); | |||||
| 435 | } | |||||
| 436 | ||||||
| 437 | var el s; | |||||
| 438 | if (fu ll) // cra zy selecto r to handl e odd fiel d errors i n ie6/7 | |||||
| 439 | els = $( 'body').ch ildren().f ilter('.bl ockUI').ad d('body > .blockUI') ; | |||||
| 440 | else | |||||
| 441 | els = $e l.find('>. blockUI'); | |||||
| 442 | ||||||
| 443 | // fix cursor is sue | |||||
| 444 | if ( o pts.cursor Reset ) { | |||||
| 445 | if ( els .length > 1 ) | |||||
| 446 | els[1].sty le.cursor = opts.cur sorReset; | |||||
| 447 | if ( els .length > 2 ) | |||||
| 448 | els[2].sty le.cursor = opts.cur sorReset; | |||||
| 449 | } | |||||
| 450 | ||||||
| 451 | if (fu ll) | |||||
| 452 | pageBloc k = pageBl ockEls = n ull; | |||||
| 453 | ||||||
| 454 | if (op ts.fadeOut ) { | |||||
| 455 | els.fade Out(opts.f adeOut); | |||||
| 456 | setTimeo ut(functio n() { rese t(els,data ,opts,el); }, opts.f adeOut); | |||||
| 457 | } | |||||
| 458 | else | |||||
| 459 | reset(el s, data, o pts, el); | |||||
| 460 | } | |||||
| 461 | ||||||
| 462 | // m ove blocki ng element back into the DOM w here it st arted | |||||
| 463 | func tion reset (els,data, opts,el) { | |||||
| 464 | var $e l = $(el); | |||||
| 465 | els.ea ch(functio n(i,o) { | |||||
| 466 | // remov e via DOM calls so w e don't lo se event h andlers | |||||
| 467 | if (this .parentNod e) | |||||
| 468 | this.paren tNode.remo veChild(th is); | |||||
| 469 | }); | |||||
| 470 | ||||||
| 471 | if (da ta && data .el) { | |||||
| 472 | data.el. style.disp lay = data .display; | |||||
| 473 | data.el. style.posi tion = dat a.position ; | |||||
| 474 | if (data .parent) | |||||
| 475 | data.paren t.appendCh ild(data.e l); | |||||
| 476 | $el.remo veData('bl ockUI.hist ory'); | |||||
| 477 | } | |||||
| 478 | ||||||
| 479 | if ($e l.data('bl ockUI.stat ic')) { | |||||
| 480 | $el.css( 'position' , 'static' ); // #22 | |||||
| 481 | } | |||||
| 482 | ||||||
| 483 | if (ty peof opts. onUnblock == 'functi on') | |||||
| 484 | opts.onU nblock(el, opts); | |||||
| 485 | ||||||
| 486 | // fix issue in Safari 6 w here block artifacts remain un til reflow | |||||
| 487 | var bo dy = $(doc ument.body ), w = bod y.width(), cssW = bo dy[0].styl e.width; | |||||
| 488 | body.w idth(w-1). width(w); | |||||
| 489 | body[0 ].style.wi dth = cssW ; | |||||
| 490 | } | |||||
| 491 | ||||||
| 492 | // b ind/unbind the handl er | |||||
| 493 | func tion bind( b, el, opt s) { | |||||
| 494 | var fu ll = el == window, $ el = $(el) ; | |||||
| 495 | ||||||
| 496 | // don 't bother unbinding if there i s nothing to unbind | |||||
| 497 | if (!b && (full && !pageBl ock || !fu ll && !$el .data('blo ckUI.isBlo cked'))) | |||||
| 498 | return; | |||||
| 499 | ||||||
| 500 | $el.da ta('blockU I.isBlocke d', b); | |||||
| 501 | ||||||
| 502 | // don 't bind ev ents when overlay is not in us e or if bi ndEvents i s false | |||||
| 503 | if (!o pts.bindEv ents || (b && !opts. showOverla y)) | |||||
| 504 | return; | |||||
| 505 | ||||||
| 506 | // bin d anchors and inputs for mouse and key e vents | |||||
| 507 | var ev ents = 'mo usedown mo useup keyd own keypre ss keyup t ouchstart touchend t ouchmove'; | |||||
| 508 | if (b) | |||||
| 509 | $(docume nt).bind(e vents, opt s, handler ); | |||||
| 510 | else | |||||
| 511 | $(docume nt).unbind (events, h andler); | |||||
| 512 | ||||||
| 513 | // f ormer impl ... | |||||
| 514 | // var $e = $('a,:inp ut'); | |||||
| 515 | // b ? $e.b ind(events , opts, ha ndler) : $ e.unbind(e vents, han dler); | |||||
| 516 | } | |||||
| 517 | ||||||
| 518 | // e vent handl er to supp ress keybo ard/mouse events whe n blocking | |||||
| 519 | func tion handl er(e) { | |||||
| 520 | // all ow tab nav igation (c onditional ly) | |||||
| 521 | if (e. keyCode && e.keyCode == 9) { | |||||
| 522 | if (page Block && e .data.cons trainTabKe y) { | |||||
| 523 | var els = pageBlockE ls; | |||||
| 524 | var fwd = !e.shiftKe y && e.tar get === el s[els.leng th-1]; | |||||
| 525 | var back = e.shiftKe y && e.tar get === el s[0]; | |||||
| 526 | if (fwd || back) { | |||||
| 527 | se tTimeout(f unction(){ focus(back );},10); | |||||
| 528 | re turn false ; | |||||
| 529 | } | |||||
| 530 | } | |||||
| 531 | } | |||||
| 532 | var op ts = e.dat a; | |||||
| 533 | var ta rget = $(e .target); | |||||
| 534 | if (ta rget.hasCl ass('block Overlay') && opts.on OverlayCli ck) | |||||
| 535 | opts.onO verlayClic k(); | |||||
| 536 | ||||||
| 537 | // all ow events within the message c ontent | |||||
| 538 | if (ta rget.paren ts('div.' + opts.blo ckMsgClass ).length > 0) | |||||
| 539 | return t rue; | |||||
| 540 | ||||||
| 541 | // all ow events for conten t that is not being blocked | |||||
| 542 | return target.pa rents().ch ildren().f ilter('div .blockUI') .length == = 0; | |||||
| 543 | } | |||||
| 544 | ||||||
| 545 | func tion focus (back) { | |||||
| 546 | if (!p ageBlockEl s) | |||||
| 547 | return; | |||||
| 548 | var e = pageBloc kEls[back= ==true ? p ageBlockEl s.length-1 : 0]; | |||||
| 549 | if (e) | |||||
| 550 | e.focus( ); | |||||
| 551 | } | |||||
| 552 | ||||||
| 553 | func tion cente r(el, x, y ) { | |||||
| 554 | var p = el.paren tNode, s = el.style; | |||||
| 555 | var l = ((p.offs etWidth - el.offsetW idth)/2) - sz(p,'bor derLeftWid th'); | |||||
| 556 | var t = ((p.offs etHeight - el.offset Height)/2) - sz(p,'b orderTopWi dth'); | |||||
| 557 | if (x) s.left = l > 0 ? (l +'px') : ' 0'; | |||||
| 558 | if (y) s.top = t > 0 ? (t +'px') : ' 0'; | |||||
| 559 | } | |||||
| 560 | ||||||
| 561 | func tion sz(el , p) { | |||||
| 562 | return parseInt( $.css(el,p ),10)||0; | |||||
| 563 | } | |||||
| 564 | ||||||
| 565 | } | |||||
| 566 | ||||||
| 567 | ||||||
| 568 | /* global def ine:true * / | |||||
| 569 | if (typeof d efine === 'function' && define .amd && de fine.amd.j Query) { | |||||
| 570 | defi ne(['jquer y'], setup ); | |||||
| 571 | } else { | |||||
| 572 | setu p(jQuery); | |||||
| 573 | } | |||||
| 574 | ||||||
| 575 | })(); |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.