| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180 |
- /*!
- DataTables 1.10.16
- ©2008-2017 SpryMedia Ltd - datatables.net/license
- */
- (function(h){"function"===typeof define&&define.amd?define(["jquery"],function(E){return h(E,window,document)}):"object"===typeof exports?module.exports=function(E,G){E||(E=window);G||(G="undefined"!==typeof window?require("jquery"):require("jquery")(E));return h(G,E,E.document)}:h(jQuery,window,document)})(function(h,E,G,k){function X(a){var b,c,d={};h.each(a,function(e){if((b=e.match(/^([^A-Z]+?)([A-Z])/))&&-1!=="a aa ai ao as b fn i m o s ".indexOf(b[1]+" "))c=e.replace(b[0],b[2].toLowerCase()),
- d[c]=e,"o"===b[1]&&X(a[e])});a._hungarianMap=d}function I(a,b,c){a._hungarianMap||X(a);var d;h.each(b,function(e){d=a._hungarianMap[e];if(d!==k&&(c||b[d]===k))"o"===d.charAt(0)?(b[d]||(b[d]={}),h.extend(!0,b[d],b[e]),I(a[d],b[d],c)):b[d]=b[e]})}function Ca(a){var b=m.defaults.oLanguage,c=a.sZeroRecords;!a.sEmptyTable&&(c&&"No data available in table"===b.sEmptyTable)&&F(a,a,"sZeroRecords","sEmptyTable");!a.sLoadingRecords&&(c&&"Loading..."===b.sLoadingRecords)&&F(a,a,"sZeroRecords","sLoadingRecords");
- a.sInfoThousands&&(a.sThousands=a.sInfoThousands);(a=a.sDecimal)&&cb(a)}function db(a){A(a,"ordering","bSort");A(a,"orderMulti","bSortMulti");A(a,"orderClasses","bSortClasses");A(a,"orderCellsTop","bSortCellsTop");A(a,"order","aaSorting");A(a,"orderFixed","aaSortingFixed");A(a,"paging","bPaginate");A(a,"pagingType","sPaginationType");A(a,"pageLength","iDisplayLength");A(a,"searching","bFilter");"boolean"===typeof a.sScrollX&&(a.sScrollX=a.sScrollX?"100%":"");"boolean"===typeof a.scrollX&&(a.scrollX=
- a.scrollX?"100%":"");if(a=a.aoSearchCols)for(var b=0,c=a.length;b<c;b++)a[b]&&I(m.models.oSearch,a[b])}function eb(a){A(a,"orderable","bSortable");A(a,"orderData","aDataSort");A(a,"orderSequence","asSorting");A(a,"orderDataType","sortDataType");var b=a.aDataSort;"number"===typeof b&&!h.isArray(b)&&(a.aDataSort=[b])}function fb(a){if(!m.__browser){var b={};m.__browser=b;var c=h("<div/>").css({position:"fixed",top:0,left:-1*h(E).scrollLeft(),height:1,width:1,overflow:"hidden"}).append(h("<div/>").css({position:"absolute",
- top:1,left:1,width:100,overflow:"scroll"}).append(h("<div/>").css({width:"100%",height:10}))).appendTo("body"),d=c.children(),e=d.children();b.barWidth=d[0].offsetWidth-d[0].clientWidth;b.bScrollOversize=100===e[0].offsetWidth&&100!==d[0].clientWidth;b.bScrollbarLeft=1!==Math.round(e.offset().left);b.bBounding=c[0].getBoundingClientRect().width?!0:!1;c.remove()}h.extend(a.oBrowser,m.__browser);a.oScroll.iBarWidth=m.__browser.barWidth}function gb(a,b,c,d,e,f){var g,j=!1;c!==k&&(g=c,j=!0);for(;d!==
- e;)a.hasOwnProperty(d)&&(g=j?b(g,a[d],d,a):a[d],j=!0,d+=f);return g}function Da(a,b){var c=m.defaults.column,d=a.aoColumns.length,c=h.extend({},m.models.oColumn,c,{nTh:b?b:G.createElement("th"),sTitle:c.sTitle?c.sTitle:b?b.innerHTML:"",aDataSort:c.aDataSort?c.aDataSort:[d],mData:c.mData?c.mData:d,idx:d});a.aoColumns.push(c);c=a.aoPreSearchCols;c[d]=h.extend({},m.models.oSearch,c[d]);ja(a,d,h(b).data())}function ja(a,b,c){var b=a.aoColumns[b],d=a.oClasses,e=h(b.nTh);if(!b.sWidthOrig){b.sWidthOrig=
- e.attr("width")||null;var f=(e.attr("style")||"").match(/width:\s*(\d+[pxem%]+)/);f&&(b.sWidthOrig=f[1])}c!==k&&null!==c&&(eb(c),I(m.defaults.column,c),c.mDataProp!==k&&!c.mData&&(c.mData=c.mDataProp),c.sType&&(b._sManualType=c.sType),c.className&&!c.sClass&&(c.sClass=c.className),c.sClass&&e.addClass(c.sClass),h.extend(b,c),F(b,c,"sWidth","sWidthOrig"),c.iDataSort!==k&&(b.aDataSort=[c.iDataSort]),F(b,c,"aDataSort"));var g=b.mData,j=Q(g),i=b.mRender?Q(b.mRender):null,c=function(a){return"string"===
- typeof a&&-1!==a.indexOf("@")};b._bAttrSrc=h.isPlainObject(g)&&(c(g.sort)||c(g.type)||c(g.filter));b._setter=null;b.fnGetData=function(a,b,c){var d=j(a,b,k,c);return i&&b?i(d,b,a,c):d};b.fnSetData=function(a,b,c){return R(g)(a,b,c)};"number"!==typeof g&&(a._rowReadObject=!0);a.oFeatures.bSort||(b.bSortable=!1,e.addClass(d.sSortableNone));a=-1!==h.inArray("asc",b.asSorting);c=-1!==h.inArray("desc",b.asSorting);!b.bSortable||!a&&!c?(b.sSortingClass=d.sSortableNone,b.sSortingClassJUI=""):a&&!c?(b.sSortingClass=
- d.sSortableAsc,b.sSortingClassJUI=d.sSortJUIAscAllowed):!a&&c?(b.sSortingClass=d.sSortableDesc,b.sSortingClassJUI=d.sSortJUIDescAllowed):(b.sSortingClass=d.sSortable,b.sSortingClassJUI=d.sSortJUI)}function Y(a){if(!1!==a.oFeatures.bAutoWidth){var b=a.aoColumns;Ea(a);for(var c=0,d=b.length;c<d;c++)b[c].nTh.style.width=b[c].sWidth}b=a.oScroll;(""!==b.sY||""!==b.sX)&&ka(a);r(a,null,"column-sizing",[a])}function Z(a,b){var c=la(a,"bVisible");return"number"===typeof c[b]?c[b]:null}function $(a,b){var c=
- la(a,"bVisible"),c=h.inArray(b,c);return-1!==c?c:null}function aa(a){var b=0;h.each(a.aoColumns,function(a,d){d.bVisible&&"none"!==h(d.nTh).css("display")&&b++});return b}function la(a,b){var c=[];h.map(a.aoColumns,function(a,e){a[b]&&c.push(e)});return c}function Fa(a){var b=a.aoColumns,c=a.aoData,d=m.ext.type.detect,e,f,g,j,i,h,l,q,t;e=0;for(f=b.length;e<f;e++)if(l=b[e],t=[],!l.sType&&l._sManualType)l.sType=l._sManualType;else if(!l.sType){g=0;for(j=d.length;g<j;g++){i=0;for(h=c.length;i<h;i++){t[i]===
- k&&(t[i]=B(a,i,e,"type"));q=d[g](t[i],a);if(!q&&g!==d.length-1)break;if("html"===q)break}if(q){l.sType=q;break}}l.sType||(l.sType="string")}}function hb(a,b,c,d){var e,f,g,j,i,n,l=a.aoColumns;if(b)for(e=b.length-1;0<=e;e--){n=b[e];var q=n.targets!==k?n.targets:n.aTargets;h.isArray(q)||(q=[q]);f=0;for(g=q.length;f<g;f++)if("number"===typeof q[f]&&0<=q[f]){for(;l.length<=q[f];)Da(a);d(q[f],n)}else if("number"===typeof q[f]&&0>q[f])d(l.length+q[f],n);else if("string"===typeof q[f]){j=0;for(i=l.length;j<
- i;j++)("_all"==q[f]||h(l[j].nTh).hasClass(q[f]))&&d(j,n)}}if(c){e=0;for(a=c.length;e<a;e++)d(e,c[e])}}function M(a,b,c,d){var e=a.aoData.length,f=h.extend(!0,{},m.models.oRow,{src:c?"dom":"data",idx:e});f._aData=b;a.aoData.push(f);for(var g=a.aoColumns,j=0,i=g.length;j<i;j++)g[j].sType=null;a.aiDisplayMaster.push(e);b=a.rowIdFn(b);b!==k&&(a.aIds[b]=f);(c||!a.oFeatures.bDeferRender)&&Ga(a,e,c,d);return e}function ma(a,b){var c;b instanceof h||(b=h(b));return b.map(function(b,e){c=Ha(a,e);return M(a,
- c.data,e,c.cells)})}function B(a,b,c,d){var e=a.iDraw,f=a.aoColumns[c],g=a.aoData[b]._aData,j=f.sDefaultContent,i=f.fnGetData(g,d,{settings:a,row:b,col:c});if(i===k)return a.iDrawError!=e&&null===j&&(J(a,0,"Requested unknown parameter "+("function"==typeof f.mData?"{function}":"'"+f.mData+"'")+" for row "+b+", column "+c,4),a.iDrawError=e),j;if((i===g||null===i)&&null!==j&&d!==k)i=j;else if("function"===typeof i)return i.call(g);return null===i&&"display"==d?"":i}function ib(a,b,c,d){a.aoColumns[c].fnSetData(a.aoData[b]._aData,
- d,{settings:a,row:b,col:c})}function Ia(a){return h.map(a.match(/(\\.|[^\.])+/g)||[""],function(a){return a.replace(/\\\./g,".")})}function Q(a){if(h.isPlainObject(a)){var b={};h.each(a,function(a,c){c&&(b[a]=Q(c))});return function(a,c,f,g){var j=b[c]||b._;return j!==k?j(a,c,f,g):a}}if(null===a)return function(a){return a};if("function"===typeof a)return function(b,c,f,g){return a(b,c,f,g)};if("string"===typeof a&&(-1!==a.indexOf(".")||-1!==a.indexOf("[")||-1!==a.indexOf("("))){var c=function(a,
- b,f){var g,j;if(""!==f){j=Ia(f);for(var i=0,n=j.length;i<n;i++){f=j[i].match(ba);g=j[i].match(U);if(f){j[i]=j[i].replace(ba,"");""!==j[i]&&(a=a[j[i]]);g=[];j.splice(0,i+1);j=j.join(".");if(h.isArray(a)){i=0;for(n=a.length;i<n;i++)g.push(c(a[i],b,j))}a=f[0].substring(1,f[0].length-1);a=""===a?g:g.join(a);break}else if(g){j[i]=j[i].replace(U,"");a=a[j[i]]();continue}if(null===a||a[j[i]]===k)return k;a=a[j[i]]}}return a};return function(b,e){return c(b,e,a)}}return function(b){return b[a]}}function R(a){if(h.isPlainObject(a))return R(a._);
- if(null===a)return function(){};if("function"===typeof a)return function(b,d,e){a(b,"set",d,e)};if("string"===typeof a&&(-1!==a.indexOf(".")||-1!==a.indexOf("[")||-1!==a.indexOf("("))){var b=function(a,d,e){var e=Ia(e),f;f=e[e.length-1];for(var g,j,i=0,n=e.length-1;i<n;i++){g=e[i].match(ba);j=e[i].match(U);if(g){e[i]=e[i].replace(ba,"");a[e[i]]=[];f=e.slice();f.splice(0,i+1);g=f.join(".");if(h.isArray(d)){j=0;for(n=d.length;j<n;j++)f={},b(f,d[j],g),a[e[i]].push(f)}else a[e[i]]=d;return}j&&(e[i]=e[i].replace(U,
- ""),a=a[e[i]](d));if(null===a[e[i]]||a[e[i]]===k)a[e[i]]={};a=a[e[i]]}if(f.match(U))a[f.replace(U,"")](d);else a[f.replace(ba,"")]=d};return function(c,d){return b(c,d,a)}}return function(b,d){b[a]=d}}function Ja(a){return D(a.aoData,"_aData")}function na(a){a.aoData.length=0;a.aiDisplayMaster.length=0;a.aiDisplay.length=0;a.aIds={}}function oa(a,b,c){for(var d=-1,e=0,f=a.length;e<f;e++)a[e]==b?d=e:a[e]>b&&a[e]--; -1!=d&&c===k&&a.splice(d,1)}function ca(a,b,c,d){var e=a.aoData[b],f,g=function(c,d){for(;c.childNodes.length;)c.removeChild(c.firstChild);
- c.innerHTML=B(a,b,d,"display")};if("dom"===c||(!c||"auto"===c)&&"dom"===e.src)e._aData=Ha(a,e,d,d===k?k:e._aData).data;else{var j=e.anCells;if(j)if(d!==k)g(j[d],d);else{c=0;for(f=j.length;c<f;c++)g(j[c],c)}}e._aSortData=null;e._aFilterData=null;g=a.aoColumns;if(d!==k)g[d].sType=null;else{c=0;for(f=g.length;c<f;c++)g[c].sType=null;Ka(a,e)}}function Ha(a,b,c,d){var e=[],f=b.firstChild,g,j,i=0,n,l=a.aoColumns,q=a._rowReadObject,d=d!==k?d:q?{}:[],t=function(a,b){if("string"===typeof a){var c=a.indexOf("@");
- -1!==c&&(c=a.substring(c+1),R(a)(d,b.getAttribute(c)))}},m=function(a){if(c===k||c===i)j=l[i],n=h.trim(a.innerHTML),j&&j._bAttrSrc?(R(j.mData._)(d,n),t(j.mData.sort,a),t(j.mData.type,a),t(j.mData.filter,a)):q?(j._setter||(j._setter=R(j.mData)),j._setter(d,n)):d[i]=n;i++};if(f)for(;f;){g=f.nodeName.toUpperCase();if("TD"==g||"TH"==g)m(f),e.push(f);f=f.nextSibling}else{e=b.anCells;f=0;for(g=e.length;f<g;f++)m(e[f])}if(b=b.firstChild?b:b.nTr)(b=b.getAttribute("id"))&&R(a.rowId)(d,b);return{data:d,cells:e}}
- function Ga(a,b,c,d){var e=a.aoData[b],f=e._aData,g=[],j,i,n,l,q;if(null===e.nTr){j=c||G.createElement("tr");e.nTr=j;e.anCells=g;j._DT_RowIndex=b;Ka(a,e);l=0;for(q=a.aoColumns.length;l<q;l++){n=a.aoColumns[l];i=c?d[l]:G.createElement(n.sCellType);i._DT_CellIndex={row:b,column:l};g.push(i);if((!c||n.mRender||n.mData!==l)&&(!h.isPlainObject(n.mData)||n.mData._!==l+".display"))i.innerHTML=B(a,b,l,"display");n.sClass&&(i.className+=" "+n.sClass);n.bVisible&&!c?j.appendChild(i):!n.bVisible&&c&&i.parentNode.removeChild(i);
- n.fnCreatedCell&&n.fnCreatedCell.call(a.oInstance,i,B(a,b,l),f,b,l)}r(a,"aoRowCreatedCallback",null,[j,f,b])}e.nTr.setAttribute("role","row")}function Ka(a,b){var c=b.nTr,d=b._aData;if(c){var e=a.rowIdFn(d);e&&(c.id=e);d.DT_RowClass&&(e=d.DT_RowClass.split(" "),b.__rowc=b.__rowc?qa(b.__rowc.concat(e)):e,h(c).removeClass(b.__rowc.join(" ")).addClass(d.DT_RowClass));d.DT_RowAttr&&h(c).attr(d.DT_RowAttr);d.DT_RowData&&h(c).data(d.DT_RowData)}}function jb(a){var b,c,d,e,f,g=a.nTHead,j=a.nTFoot,i=0===
- h("th, td",g).length,n=a.oClasses,l=a.aoColumns;i&&(e=h("<tr/>").appendTo(g));b=0;for(c=l.length;b<c;b++)f=l[b],d=h(f.nTh).addClass(f.sClass),i&&d.appendTo(e),a.oFeatures.bSort&&(d.addClass(f.sSortingClass),!1!==f.bSortable&&(d.attr("tabindex",a.iTabIndex).attr("aria-controls",a.sTableId),La(a,f.nTh,b))),f.sTitle!=d[0].innerHTML&&d.html(f.sTitle),Ma(a,"header")(a,d,f,n);i&&da(a.aoHeader,g);h(g).find(">tr").attr("role","row");h(g).find(">tr>th, >tr>td").addClass(n.sHeaderTH);h(j).find(">tr>th, >tr>td").addClass(n.sFooterTH);
- if(null!==j){a=a.aoFooter[0];b=0;for(c=a.length;b<c;b++)f=l[b],f.nTf=a[b].cell,f.sClass&&h(f.nTf).addClass(f.sClass)}}function ea(a,b,c){var d,e,f,g=[],j=[],i=a.aoColumns.length,n;if(b){c===k&&(c=!1);d=0;for(e=b.length;d<e;d++){g[d]=b[d].slice();g[d].nTr=b[d].nTr;for(f=i-1;0<=f;f--)!a.aoColumns[f].bVisible&&!c&&g[d].splice(f,1);j.push([])}d=0;for(e=g.length;d<e;d++){if(a=g[d].nTr)for(;f=a.firstChild;)a.removeChild(f);f=0;for(b=g[d].length;f<b;f++)if(n=i=1,j[d][f]===k){a.appendChild(g[d][f].cell);
- for(j[d][f]=1;g[d+i]!==k&&g[d][f].cell==g[d+i][f].cell;)j[d+i][f]=1,i++;for(;g[d][f+n]!==k&&g[d][f].cell==g[d][f+n].cell;){for(c=0;c<i;c++)j[d+c][f+n]=1;n++}h(g[d][f].cell).attr("rowspan",i).attr("colspan",n)}}}}function N(a){var b=r(a,"aoPreDrawCallback","preDraw",[a]);if(-1!==h.inArray(!1,b))C(a,!1);else{var b=[],c=0,d=a.asStripeClasses,e=d.length,f=a.oLanguage,g=a.iInitDisplayStart,j="ssp"==y(a),i=a.aiDisplay;a.bDrawing=!0;g!==k&&-1!==g&&(a._iDisplayStart=j?g:g>=a.fnRecordsDisplay()?0:g,a.iInitDisplayStart=
- -1);var g=a._iDisplayStart,n=a.fnDisplayEnd();if(a.bDeferLoading)a.bDeferLoading=!1,a.iDraw++,C(a,!1);else if(j){if(!a.bDestroying&&!kb(a))return}else a.iDraw++;if(0!==i.length){f=j?a.aoData.length:n;for(j=j?0:g;j<f;j++){var l=i[j],q=a.aoData[l];null===q.nTr&&Ga(a,l);l=q.nTr;if(0!==e){var t=d[c%e];q._sRowStripe!=t&&(h(l).removeClass(q._sRowStripe).addClass(t),q._sRowStripe=t)}r(a,"aoRowCallback",null,[l,q._aData,c,j]);b.push(l);c++}}else c=f.sZeroRecords,1==a.iDraw&&"ajax"==y(a)?c=f.sLoadingRecords:
- f.sEmptyTable&&0===a.fnRecordsTotal()&&(c=f.sEmptyTable),b[0]=h("<tr/>",{"class":e?d[0]:""}).append(h("<td />",{valign:"top",colSpan:aa(a),"class":a.oClasses.sRowEmpty}).html(c))[0];r(a,"aoHeaderCallback","header",[h(a.nTHead).children("tr")[0],Ja(a),g,n,i]);r(a,"aoFooterCallback","footer",[h(a.nTFoot).children("tr")[0],Ja(a),g,n,i]);d=h(a.nTBody);d.children().detach();d.append(h(b));r(a,"aoDrawCallback","draw",[a]);a.bSorted=!1;a.bFiltered=!1;a.bDrawing=!1}}function S(a,b){var c=a.oFeatures,d=c.bFilter;
- c.bSort&&lb(a);d?fa(a,a.oPreviousSearch):a.aiDisplay=a.aiDisplayMaster.slice();!0!==b&&(a._iDisplayStart=0);a._drawHold=b;N(a);a._drawHold=!1}function mb(a){var b=a.oClasses,c=h(a.nTable),c=h("<div/>").insertBefore(c),d=a.oFeatures,e=h("<div/>",{id:a.sTableId+"_wrapper","class":b.sWrapper+(a.nTFoot?"":" "+b.sNoFooter)});a.nHolding=c[0];a.nTableWrapper=e[0];a.nTableReinsertBefore=a.nTable.nextSibling;for(var f=a.sDom.split(""),g,j,i,n,l,q,k=0;k<f.length;k++){g=null;j=f[k];if("<"==j){i=h("<div/>")[0];
- n=f[k+1];if("'"==n||'"'==n){l="";for(q=2;f[k+q]!=n;)l+=f[k+q],q++;"H"==l?l=b.sJUIHeader:"F"==l&&(l=b.sJUIFooter);-1!=l.indexOf(".")?(n=l.split("."),i.id=n[0].substr(1,n[0].length-1),i.className=n[1]):"#"==l.charAt(0)?i.id=l.substr(1,l.length-1):i.className=l;k+=q}e.append(i);e=h(i)}else if(">"==j)e=e.parent();else if("l"==j&&d.bPaginate&&d.bLengthChange)g=nb(a);else if("f"==j&&d.bFilter)g=ob(a);else if("r"==j&&d.bProcessing)g=pb(a);else if("t"==j)g=qb(a);else if("i"==j&&d.bInfo)g=rb(a);else if("p"==
- j&&d.bPaginate)g=sb(a);else if(0!==m.ext.feature.length){i=m.ext.feature;q=0;for(n=i.length;q<n;q++)if(j==i[q].cFeature){g=i[q].fnInit(a);break}}g&&(i=a.aanFeatures,i[j]||(i[j]=[]),i[j].push(g),e.append(g))}c.replaceWith(e);a.nHolding=null}function da(a,b){var c=h(b).children("tr"),d,e,f,g,j,i,n,l,q,k;a.splice(0,a.length);f=0;for(i=c.length;f<i;f++)a.push([]);f=0;for(i=c.length;f<i;f++){d=c[f];for(e=d.firstChild;e;){if("TD"==e.nodeName.toUpperCase()||"TH"==e.nodeName.toUpperCase()){l=1*e.getAttribute("colspan");
- q=1*e.getAttribute("rowspan");l=!l||0===l||1===l?1:l;q=!q||0===q||1===q?1:q;g=0;for(j=a[f];j[g];)g++;n=g;k=1===l?!0:!1;for(j=0;j<l;j++)for(g=0;g<q;g++)a[f+g][n+j]={cell:e,unique:k},a[f+g].nTr=d}e=e.nextSibling}}}function ra(a,b,c){var d=[];c||(c=a.aoHeader,b&&(c=[],da(c,b)));for(var b=0,e=c.length;b<e;b++)for(var f=0,g=c[b].length;f<g;f++)if(c[b][f].unique&&(!d[f]||!a.bSortCellsTop))d[f]=c[b][f].cell;return d}function sa(a,b,c){r(a,"aoServerParams","serverParams",[b]);if(b&&h.isArray(b)){var d={},
- e=/(.*?)\[\]$/;h.each(b,function(a,b){var c=b.name.match(e);c?(c=c[0],d[c]||(d[c]=[]),d[c].push(b.value)):d[b.name]=b.value});b=d}var f,g=a.ajax,j=a.oInstance,i=function(b){r(a,null,"xhr",[a,b,a.jqXHR]);c(b)};if(h.isPlainObject(g)&&g.data){f=g.data;var n=h.isFunction(f)?f(b,a):f,b=h.isFunction(f)&&n?n:h.extend(!0,b,n);delete g.data}n={data:b,success:function(b){var c=b.error||b.sError;c&&J(a,0,c);a.json=b;i(b)},dataType:"json",cache:!1,type:a.sServerMethod,error:function(b,c){var d=r(a,null,"xhr",
- [a,null,a.jqXHR]);-1===h.inArray(!0,d)&&("parsererror"==c?J(a,0,"Invalid JSON response",1):4===b.readyState&&J(a,0,"Ajax error",7));C(a,!1)}};a.oAjaxData=b;r(a,null,"preXhr",[a,b]);a.fnServerData?a.fnServerData.call(j,a.sAjaxSource,h.map(b,function(a,b){return{name:b,value:a}}),i,a):a.sAjaxSource||"string"===typeof g?a.jqXHR=h.ajax(h.extend(n,{url:g||a.sAjaxSource})):h.isFunction(g)?a.jqXHR=g.call(j,b,i,a):(a.jqXHR=h.ajax(h.extend(n,g)),g.data=f)}function kb(a){return a.bAjaxDataGet?(a.iDraw++,C(a,
- !0),sa(a,tb(a),function(b){ub(a,b)}),!1):!0}function tb(a){var b=a.aoColumns,c=b.length,d=a.oFeatures,e=a.oPreviousSearch,f=a.aoPreSearchCols,g,j=[],i,n,l,k=V(a);g=a._iDisplayStart;i=!1!==d.bPaginate?a._iDisplayLength:-1;var t=function(a,b){j.push({name:a,value:b})};t("sEcho",a.iDraw);t("iColumns",c);t("sColumns",D(b,"sName").join(","));t("iDisplayStart",g);t("iDisplayLength",i);var pa={draw:a.iDraw,columns:[],order:[],start:g,length:i,search:{value:e.sSearch,regex:e.bRegex}};for(g=0;g<c;g++)n=b[g],
- l=f[g],i="function"==typeof n.mData?"function":n.mData,pa.columns.push({data:i,name:n.sName,searchable:n.bSearchable,orderable:n.bSortable,search:{value:l.sSearch,regex:l.bRegex}}),t("mDataProp_"+g,i),d.bFilter&&(t("sSearch_"+g,l.sSearch),t("bRegex_"+g,l.bRegex),t("bSearchable_"+g,n.bSearchable)),d.bSort&&t("bSortable_"+g,n.bSortable);d.bFilter&&(t("sSearch",e.sSearch),t("bRegex",e.bRegex));d.bSort&&(h.each(k,function(a,b){pa.order.push({column:b.col,dir:b.dir});t("iSortCol_"+a,b.col);t("sSortDir_"+
- a,b.dir)}),t("iSortingCols",k.length));b=m.ext.legacy.ajax;return null===b?a.sAjaxSource?j:pa:b?j:pa}function ub(a,b){var c=ta(a,b),d=b.sEcho!==k?b.sEcho:b.draw,e=b.iTotalRecords!==k?b.iTotalRecords:b.recordsTotal,f=b.iTotalDisplayRecords!==k?b.iTotalDisplayRecords:b.recordsFiltered;if(d){if(1*d<a.iDraw)return;a.iDraw=1*d}na(a);a._iRecordsTotal=parseInt(e,10);a._iRecordsDisplay=parseInt(f,10);d=0;for(e=c.length;d<e;d++)M(a,c[d]);a.aiDisplay=a.aiDisplayMaster.slice();a.bAjaxDataGet=!1;N(a);a._bInitComplete||
- ua(a,b);a.bAjaxDataGet=!0;C(a,!1)}function ta(a,b){var c=h.isPlainObject(a.ajax)&&a.ajax.dataSrc!==k?a.ajax.dataSrc:a.sAjaxDataProp;return"data"===c?b.aaData||b[c]:""!==c?Q(c)(b):b}function ob(a){var b=a.oClasses,c=a.sTableId,d=a.oLanguage,e=a.oPreviousSearch,f=a.aanFeatures,g='<input type="search" class="'+b.sFilterInput+'"/>',j=d.sSearch,j=j.match(/_INPUT_/)?j.replace("_INPUT_",g):j+g,b=h("<div/>",{id:!f.f?c+"_filter":null,"class":b.sFilter}).append(h("<label/>").append(j)),f=function(){var b=!this.value?
- "":this.value;b!=e.sSearch&&(fa(a,{sSearch:b,bRegex:e.bRegex,bSmart:e.bSmart,bCaseInsensitive:e.bCaseInsensitive}),a._iDisplayStart=0,N(a))},g=null!==a.searchDelay?a.searchDelay:"ssp"===y(a)?400:0,i=h("input",b).val(e.sSearch).attr("placeholder",d.sSearchPlaceholder).on("keyup.DT search.DT input.DT paste.DT cut.DT",g?Na(f,g):f).on("keypress.DT",function(a){if(13==a.keyCode)return!1}).attr("aria-controls",c);h(a.nTable).on("search.dt.DT",function(b,c){if(a===c)try{i[0]!==G.activeElement&&i.val(e.sSearch)}catch(d){}});
- return b[0]}function fa(a,b,c){var d=a.oPreviousSearch,e=a.aoPreSearchCols,f=function(a){d.sSearch=a.sSearch;d.bRegex=a.bRegex;d.bSmart=a.bSmart;d.bCaseInsensitive=a.bCaseInsensitive};Fa(a);if("ssp"!=y(a)){vb(a,b.sSearch,c,b.bEscapeRegex!==k?!b.bEscapeRegex:b.bRegex,b.bSmart,b.bCaseInsensitive);f(b);for(b=0;b<e.length;b++)wb(a,e[b].sSearch,b,e[b].bEscapeRegex!==k?!e[b].bEscapeRegex:e[b].bRegex,e[b].bSmart,e[b].bCaseInsensitive);xb(a)}else f(b);a.bFiltered=!0;r(a,null,"search",[a])}function xb(a){for(var b=
- m.ext.search,c=a.aiDisplay,d,e,f=0,g=b.length;f<g;f++){for(var j=[],i=0,n=c.length;i<n;i++)e=c[i],d=a.aoData[e],b[f](a,d._aFilterData,e,d._aData,i)&&j.push(e);c.length=0;h.merge(c,j)}}function wb(a,b,c,d,e,f){if(""!==b){for(var g=[],j=a.aiDisplay,d=Oa(b,d,e,f),e=0;e<j.length;e++)b=a.aoData[j[e]]._aFilterData[c],d.test(b)&&g.push(j[e]);a.aiDisplay=g}}function vb(a,b,c,d,e,f){var d=Oa(b,d,e,f),f=a.oPreviousSearch.sSearch,g=a.aiDisplayMaster,j,e=[];0!==m.ext.search.length&&(c=!0);j=yb(a);if(0>=b.length)a.aiDisplay=
- g.slice();else{if(j||c||f.length>b.length||0!==b.indexOf(f)||a.bSorted)a.aiDisplay=g.slice();b=a.aiDisplay;for(c=0;c<b.length;c++)d.test(a.aoData[b[c]]._sFilterRow)&&e.push(b[c]);a.aiDisplay=e}}function Oa(a,b,c,d){a=b?a:Pa(a);c&&(a="^(?=.*?"+h.map(a.match(/"[^"]+"|[^ ]+/g)||[""],function(a){if('"'===a.charAt(0))var b=a.match(/^"(.*)"$/),a=b?b[1]:a;return a.replace('"',"")}).join(")(?=.*?")+").*$");return RegExp(a,d?"i":"")}function yb(a){var b=a.aoColumns,c,d,e,f,g,j,i,h,l=m.ext.type.search;c=!1;
- d=0;for(f=a.aoData.length;d<f;d++)if(h=a.aoData[d],!h._aFilterData){j=[];e=0;for(g=b.length;e<g;e++)c=b[e],c.bSearchable?(i=B(a,d,e,"filter"),l[c.sType]&&(i=l[c.sType](i)),null===i&&(i=""),"string"!==typeof i&&i.toString&&(i=i.toString())):i="",i.indexOf&&-1!==i.indexOf("&")&&(va.innerHTML=i,i=Wb?va.textContent:va.innerText),i.replace&&(i=i.replace(/[\r\n]/g,"")),j.push(i);h._aFilterData=j;h._sFilterRow=j.join(" ");c=!0}return c}function zb(a){return{search:a.sSearch,smart:a.bSmart,regex:a.bRegex,
- caseInsensitive:a.bCaseInsensitive}}function Ab(a){return{sSearch:a.search,bSmart:a.smart,bRegex:a.regex,bCaseInsensitive:a.caseInsensitive}}function rb(a){var b=a.sTableId,c=a.aanFeatures.i,d=h("<div/>",{"class":a.oClasses.sInfo,id:!c?b+"_info":null});c||(a.aoDrawCallback.push({fn:Bb,sName:"information"}),d.attr("role","status").attr("aria-live","polite"),h(a.nTable).attr("aria-describedby",b+"_info"));return d[0]}function Bb(a){var b=a.aanFeatures.i;if(0!==b.length){var c=a.oLanguage,d=a._iDisplayStart+
- 1,e=a.fnDisplayEnd(),f=a.fnRecordsTotal(),g=a.fnRecordsDisplay(),j=g?c.sInfo:c.sInfoEmpty;g!==f&&(j+=" "+c.sInfoFiltered);j+=c.sInfoPostFix;j=Cb(a,j);c=c.fnInfoCallback;null!==c&&(j=c.call(a.oInstance,a,d,e,f,g,j));h(b).html(j)}}function Cb(a,b){var c=a.fnFormatNumber,d=a._iDisplayStart+1,e=a._iDisplayLength,f=a.fnRecordsDisplay(),g=-1===e;return b.replace(/_START_/g,c.call(a,d)).replace(/_END_/g,c.call(a,a.fnDisplayEnd())).replace(/_MAX_/g,c.call(a,a.fnRecordsTotal())).replace(/_TOTAL_/g,c.call(a,
- f)).replace(/_PAGE_/g,c.call(a,g?1:Math.ceil(d/e))).replace(/_PAGES_/g,c.call(a,g?1:Math.ceil(f/e)))}function ga(a){var b,c,d=a.iInitDisplayStart,e=a.aoColumns,f;c=a.oFeatures;var g=a.bDeferLoading;if(a.bInitialised){mb(a);jb(a);ea(a,a.aoHeader);ea(a,a.aoFooter);C(a,!0);c.bAutoWidth&&Ea(a);b=0;for(c=e.length;b<c;b++)f=e[b],f.sWidth&&(f.nTh.style.width=v(f.sWidth));r(a,null,"preInit",[a]);S(a);e=y(a);if("ssp"!=e||g)"ajax"==e?sa(a,[],function(c){var f=ta(a,c);for(b=0;b<f.length;b++)M(a,f[b]);a.iInitDisplayStart=
- d;S(a);C(a,!1);ua(a,c)},a):(C(a,!1),ua(a))}else setTimeout(function(){ga(a)},200)}function ua(a,b){a._bInitComplete=!0;(b||a.oInit.aaData)&&Y(a);r(a,null,"plugin-init",[a,b]);r(a,"aoInitComplete","init",[a,b])}function Qa(a,b){var c=parseInt(b,10);a._iDisplayLength=c;Ra(a);r(a,null,"length",[a,c])}function nb(a){for(var b=a.oClasses,c=a.sTableId,d=a.aLengthMenu,e=h.isArray(d[0]),f=e?d[0]:d,d=e?d[1]:d,e=h("<select/>",{name:c+"_length","aria-controls":c,"class":b.sLengthSelect}),g=0,j=f.length;g<j;g++)e[0][g]=
- new Option("number"===typeof d[g]?a.fnFormatNumber(d[g]):d[g],f[g]);var i=h("<div><label/></div>").addClass(b.sLength);a.aanFeatures.l||(i[0].id=c+"_length");i.children().append(a.oLanguage.sLengthMenu.replace("_MENU_",e[0].outerHTML));h("select",i).val(a._iDisplayLength).on("change.DT",function(){Qa(a,h(this).val());N(a)});h(a.nTable).on("length.dt.DT",function(b,c,d){a===c&&h("select",i).val(d)});return i[0]}function sb(a){var b=a.sPaginationType,c=m.ext.pager[b],d="function"===typeof c,e=function(a){N(a)},
- b=h("<div/>").addClass(a.oClasses.sPaging+b)[0],f=a.aanFeatures;d||c.fnInit(a,b,e);f.p||(b.id=a.sTableId+"_paginate",a.aoDrawCallback.push({fn:function(a){if(d){var b=a._iDisplayStart,i=a._iDisplayLength,h=a.fnRecordsDisplay(),l=-1===i,b=l?0:Math.ceil(b/i),i=l?1:Math.ceil(h/i),h=c(b,i),k,l=0;for(k=f.p.length;l<k;l++)Ma(a,"pageButton")(a,f.p[l],l,h,b,i)}else c.fnUpdate(a,e)},sName:"pagination"}));return b}function Sa(a,b,c){var d=a._iDisplayStart,e=a._iDisplayLength,f=a.fnRecordsDisplay();0===f||-1===
- e?d=0:"number"===typeof b?(d=b*e,d>f&&(d=0)):"first"==b?d=0:"previous"==b?(d=0<=e?d-e:0,0>d&&(d=0)):"next"==b?d+e<f&&(d+=e):"last"==b?d=Math.floor((f-1)/e)*e:J(a,0,"Unknown paging action: "+b,5);b=a._iDisplayStart!==d;a._iDisplayStart=d;b&&(r(a,null,"page",[a]),c&&N(a));return b}function pb(a){return h("<div/>",{id:!a.aanFeatures.r?a.sTableId+"_processing":null,"class":a.oClasses.sProcessing}).html(a.oLanguage.sProcessing).insertBefore(a.nTable)[0]}function C(a,b){a.oFeatures.bProcessing&&h(a.aanFeatures.r).css("display",
- b?"block":"none");r(a,null,"processing",[a,b])}function qb(a){var b=h(a.nTable);b.attr("role","grid");var c=a.oScroll;if(""===c.sX&&""===c.sY)return a.nTable;var d=c.sX,e=c.sY,f=a.oClasses,g=b.children("caption"),j=g.length?g[0]._captionSide:null,i=h(b[0].cloneNode(!1)),n=h(b[0].cloneNode(!1)),l=b.children("tfoot");l.length||(l=null);i=h("<div/>",{"class":f.sScrollWrapper}).append(h("<div/>",{"class":f.sScrollHead}).css({overflow:"hidden",position:"relative",border:0,width:d?!d?null:v(d):"100%"}).append(h("<div/>",
- {"class":f.sScrollHeadInner}).css({"box-sizing":"content-box",width:c.sXInner||"100%"}).append(i.removeAttr("id").css("margin-left",0).append("top"===j?g:null).append(b.children("thead"))))).append(h("<div/>",{"class":f.sScrollBody}).css({position:"relative",overflow:"auto",width:!d?null:v(d)}).append(b));l&&i.append(h("<div/>",{"class":f.sScrollFoot}).css({overflow:"hidden",border:0,width:d?!d?null:v(d):"100%"}).append(h("<div/>",{"class":f.sScrollFootInner}).append(n.removeAttr("id").css("margin-left",
- 0).append("bottom"===j?g:null).append(b.children("tfoot")))));var b=i.children(),k=b[0],f=b[1],t=l?b[2]:null;if(d)h(f).on("scroll.DT",function(){var a=this.scrollLeft;k.scrollLeft=a;l&&(t.scrollLeft=a)});h(f).css(e&&c.bCollapse?"max-height":"height",e);a.nScrollHead=k;a.nScrollBody=f;a.nScrollFoot=t;a.aoDrawCallback.push({fn:ka,sName:"scrolling"});return i[0]}function ka(a){var b=a.oScroll,c=b.sX,d=b.sXInner,e=b.sY,b=b.iBarWidth,f=h(a.nScrollHead),g=f[0].style,j=f.children("div"),i=j[0].style,n=j.children("table"),
- j=a.nScrollBody,l=h(j),q=j.style,t=h(a.nScrollFoot).children("div"),m=t.children("table"),o=h(a.nTHead),p=h(a.nTable),s=p[0],r=s.style,u=a.nTFoot?h(a.nTFoot):null,x=a.oBrowser,T=x.bScrollOversize,Xb=D(a.aoColumns,"nTh"),O,K,P,w,Ta=[],y=[],z=[],A=[],B,C=function(a){a=a.style;a.paddingTop="0";a.paddingBottom="0";a.borderTopWidth="0";a.borderBottomWidth="0";a.height=0};K=j.scrollHeight>j.clientHeight;if(a.scrollBarVis!==K&&a.scrollBarVis!==k)a.scrollBarVis=K,Y(a);else{a.scrollBarVis=K;p.children("thead, tfoot").remove();
- u&&(P=u.clone().prependTo(p),O=u.find("tr"),P=P.find("tr"));w=o.clone().prependTo(p);o=o.find("tr");K=w.find("tr");w.find("th, td").removeAttr("tabindex");c||(q.width="100%",f[0].style.width="100%");h.each(ra(a,w),function(b,c){B=Z(a,b);c.style.width=a.aoColumns[B].sWidth});u&&H(function(a){a.style.width=""},P);f=p.outerWidth();if(""===c){r.width="100%";if(T&&(p.find("tbody").height()>j.offsetHeight||"scroll"==l.css("overflow-y")))r.width=v(p.outerWidth()-b);f=p.outerWidth()}else""!==d&&(r.width=
- v(d),f=p.outerWidth());H(C,K);H(function(a){z.push(a.innerHTML);Ta.push(v(h(a).css("width")))},K);H(function(a,b){if(h.inArray(a,Xb)!==-1)a.style.width=Ta[b]},o);h(K).height(0);u&&(H(C,P),H(function(a){A.push(a.innerHTML);y.push(v(h(a).css("width")))},P),H(function(a,b){a.style.width=y[b]},O),h(P).height(0));H(function(a,b){a.innerHTML='<div class="dataTables_sizing" style="height:0;overflow:hidden;">'+z[b]+"</div>";a.style.width=Ta[b]},K);u&&H(function(a,b){a.innerHTML='<div class="dataTables_sizing" style="height:0;overflow:hidden;">'+
- A[b]+"</div>";a.style.width=y[b]},P);if(p.outerWidth()<f){O=j.scrollHeight>j.offsetHeight||"scroll"==l.css("overflow-y")?f+b:f;if(T&&(j.scrollHeight>j.offsetHeight||"scroll"==l.css("overflow-y")))r.width=v(O-b);(""===c||""!==d)&&J(a,1,"Possible column misalignment",6)}else O="100%";q.width=v(O);g.width=v(O);u&&(a.nScrollFoot.style.width=v(O));!e&&T&&(q.height=v(s.offsetHeight+b));c=p.outerWidth();n[0].style.width=v(c);i.width=v(c);d=p.height()>j.clientHeight||"scroll"==l.css("overflow-y");e="padding"+
- (x.bScrollbarLeft?"Left":"Right");i[e]=d?b+"px":"0px";u&&(m[0].style.width=v(c),t[0].style.width=v(c),t[0].style[e]=d?b+"px":"0px");p.children("colgroup").insertBefore(p.children("thead"));l.scroll();if((a.bSorted||a.bFiltered)&&!a._drawHold)j.scrollTop=0}}function H(a,b,c){for(var d=0,e=0,f=b.length,g,j;e<f;){g=b[e].firstChild;for(j=c?c[e].firstChild:null;g;)1===g.nodeType&&(c?a(g,j,d):a(g,d),d++),g=g.nextSibling,j=c?j.nextSibling:null;e++}}function Ea(a){var b=a.nTable,c=a.aoColumns,d=a.oScroll,
- e=d.sY,f=d.sX,g=d.sXInner,j=c.length,i=la(a,"bVisible"),n=h("th",a.nTHead),l=b.getAttribute("width"),k=b.parentNode,t=!1,m,o,p=a.oBrowser,d=p.bScrollOversize;(m=b.style.width)&&-1!==m.indexOf("%")&&(l=m);for(m=0;m<i.length;m++)o=c[i[m]],null!==o.sWidth&&(o.sWidth=Db(o.sWidthOrig,k),t=!0);if(d||!t&&!f&&!e&&j==aa(a)&&j==n.length)for(m=0;m<j;m++)i=Z(a,m),null!==i&&(c[i].sWidth=v(n.eq(m).width()));else{j=h(b).clone().css("visibility","hidden").removeAttr("id");j.find("tbody tr").remove();var s=h("<tr/>").appendTo(j.find("tbody"));
- j.find("thead, tfoot").remove();j.append(h(a.nTHead).clone()).append(h(a.nTFoot).clone());j.find("tfoot th, tfoot td").css("width","");n=ra(a,j.find("thead")[0]);for(m=0;m<i.length;m++)o=c[i[m]],n[m].style.width=null!==o.sWidthOrig&&""!==o.sWidthOrig?v(o.sWidthOrig):"",o.sWidthOrig&&f&&h(n[m]).append(h("<div/>").css({width:o.sWidthOrig,margin:0,padding:0,border:0,height:1}));if(a.aoData.length)for(m=0;m<i.length;m++)t=i[m],o=c[t],h(Eb(a,t)).clone(!1).append(o.sContentPadding).appendTo(s);h("[name]",
- j).removeAttr("name");o=h("<div/>").css(f||e?{position:"absolute",top:0,left:0,height:1,right:0,overflow:"hidden"}:{}).append(j).appendTo(k);f&&g?j.width(g):f?(j.css("width","auto"),j.removeAttr("width"),j.width()<k.clientWidth&&l&&j.width(k.clientWidth)):e?j.width(k.clientWidth):l&&j.width(l);for(m=e=0;m<i.length;m++)k=h(n[m]),g=k.outerWidth()-k.width(),k=p.bBounding?Math.ceil(n[m].getBoundingClientRect().width):k.outerWidth(),e+=k,c[i[m]].sWidth=v(k-g);b.style.width=v(e);o.remove()}l&&(b.style.width=
- v(l));if((l||f)&&!a._reszEvt)b=function(){h(E).on("resize.DT-"+a.sInstance,Na(function(){Y(a)}))},d?setTimeout(b,1E3):b(),a._reszEvt=!0}function Db(a,b){if(!a)return 0;var c=h("<div/>").css("width",v(a)).appendTo(b||G.body),d=c[0].offsetWidth;c.remove();return d}function Eb(a,b){var c=Fb(a,b);if(0>c)return null;var d=a.aoData[c];return!d.nTr?h("<td/>").html(B(a,c,b,"display"))[0]:d.anCells[b]}function Fb(a,b){for(var c,d=-1,e=-1,f=0,g=a.aoData.length;f<g;f++)c=B(a,f,b,"display")+"",c=c.replace(Yb,
- ""),c=c.replace(/ /g," "),c.length>d&&(d=c.length,e=f);return e}function v(a){return null===a?"0px":"number"==typeof a?0>a?"0px":a+"px":a.match(/\d$/)?a+"px":a}function V(a){var b,c,d=[],e=a.aoColumns,f,g,j,i;b=a.aaSortingFixed;c=h.isPlainObject(b);var n=[];f=function(a){a.length&&!h.isArray(a[0])?n.push(a):h.merge(n,a)};h.isArray(b)&&f(b);c&&b.pre&&f(b.pre);f(a.aaSorting);c&&b.post&&f(b.post);for(a=0;a<n.length;a++){i=n[a][0];f=e[i].aDataSort;b=0;for(c=f.length;b<c;b++)g=f[b],j=e[g].sType||
- "string",n[a]._idx===k&&(n[a]._idx=h.inArray(n[a][1],e[g].asSorting)),d.push({src:i,col:g,dir:n[a][1],index:n[a]._idx,type:j,formatter:m.ext.type.order[j+"-pre"]})}return d}function lb(a){var b,c,d=[],e=m.ext.type.order,f=a.aoData,g=0,j,i=a.aiDisplayMaster,h;Fa(a);h=V(a);b=0;for(c=h.length;b<c;b++)j=h[b],j.formatter&&g++,Gb(a,j.col);if("ssp"!=y(a)&&0!==h.length){b=0;for(c=i.length;b<c;b++)d[i[b]]=b;g===h.length?i.sort(function(a,b){var c,e,g,j,i=h.length,k=f[a]._aSortData,m=f[b]._aSortData;for(g=
- 0;g<i;g++)if(j=h[g],c=k[j.col],e=m[j.col],c=c<e?-1:c>e?1:0,0!==c)return"asc"===j.dir?c:-c;c=d[a];e=d[b];return c<e?-1:c>e?1:0}):i.sort(function(a,b){var c,g,j,i,k=h.length,m=f[a]._aSortData,o=f[b]._aSortData;for(j=0;j<k;j++)if(i=h[j],c=m[i.col],g=o[i.col],i=e[i.type+"-"+i.dir]||e["string-"+i.dir],c=i(c,g),0!==c)return c;c=d[a];g=d[b];return c<g?-1:c>g?1:0})}a.bSorted=!0}function Hb(a){for(var b,c,d=a.aoColumns,e=V(a),a=a.oLanguage.oAria,f=0,g=d.length;f<g;f++){c=d[f];var j=c.asSorting;b=c.sTitle.replace(/<.*?>/g,
- "");var i=c.nTh;i.removeAttribute("aria-sort");c.bSortable&&(0<e.length&&e[0].col==f?(i.setAttribute("aria-sort","asc"==e[0].dir?"ascending":"descending"),c=j[e[0].index+1]||j[0]):c=j[0],b+="asc"===c?a.sSortAscending:a.sSortDescending);i.setAttribute("aria-label",b)}}function Ua(a,b,c,d){var e=a.aaSorting,f=a.aoColumns[b].asSorting,g=function(a,b){var c=a._idx;c===k&&(c=h.inArray(a[1],f));return c+1<f.length?c+1:b?null:0};"number"===typeof e[0]&&(e=a.aaSorting=[e]);c&&a.oFeatures.bSortMulti?(c=h.inArray(b,
- D(e,"0")),-1!==c?(b=g(e[c],!0),null===b&&1===e.length&&(b=0),null===b?e.splice(c,1):(e[c][1]=f[b],e[c]._idx=b)):(e.push([b,f[0],0]),e[e.length-1]._idx=0)):e.length&&e[0][0]==b?(b=g(e[0]),e.length=1,e[0][1]=f[b],e[0]._idx=b):(e.length=0,e.push([b,f[0]]),e[0]._idx=0);S(a);"function"==typeof d&&d(a)}function La(a,b,c,d){var e=a.aoColumns[c];Va(b,{},function(b){!1!==e.bSortable&&(a.oFeatures.bProcessing?(C(a,!0),setTimeout(function(){Ua(a,c,b.shiftKey,d);"ssp"!==y(a)&&C(a,!1)},0)):Ua(a,c,b.shiftKey,d))})}
- function wa(a){var b=a.aLastSort,c=a.oClasses.sSortColumn,d=V(a),e=a.oFeatures,f,g;if(e.bSort&&e.bSortClasses){e=0;for(f=b.length;e<f;e++)g=b[e].src,h(D(a.aoData,"anCells",g)).removeClass(c+(2>e?e+1:3));e=0;for(f=d.length;e<f;e++)g=d[e].src,h(D(a.aoData,"anCells",g)).addClass(c+(2>e?e+1:3))}a.aLastSort=d}function Gb(a,b){var c=a.aoColumns[b],d=m.ext.order[c.sSortDataType],e;d&&(e=d.call(a.oInstance,a,b,$(a,b)));for(var f,g=m.ext.type.order[c.sType+"-pre"],j=0,i=a.aoData.length;j<i;j++)if(c=a.aoData[j],
- c._aSortData||(c._aSortData=[]),!c._aSortData[b]||d)f=d?e[j]:B(a,j,b,"sort"),c._aSortData[b]=g?g(f):f}function xa(a){if(a.oFeatures.bStateSave&&!a.bDestroying){var b={time:+new Date,start:a._iDisplayStart,length:a._iDisplayLength,order:h.extend(!0,[],a.aaSorting),search:zb(a.oPreviousSearch),columns:h.map(a.aoColumns,function(b,d){return{visible:b.bVisible,search:zb(a.aoPreSearchCols[d])}})};r(a,"aoStateSaveParams","stateSaveParams",[a,b]);a.oSavedState=b;a.fnStateSaveCallback.call(a.oInstance,a,
- b)}}function Ib(a,b,c){var d,e,f=a.aoColumns,b=function(b){if(b&&b.time){var g=r(a,"aoStateLoadParams","stateLoadParams",[a,b]);if(-1===h.inArray(!1,g)&&(g=a.iStateDuration,!(0<g&&b.time<+new Date-1E3*g)&&!(b.columns&&f.length!==b.columns.length))){a.oLoadedState=h.extend(!0,{},b);b.start!==k&&(a._iDisplayStart=b.start,a.iInitDisplayStart=b.start);b.length!==k&&(a._iDisplayLength=b.length);b.order!==k&&(a.aaSorting=[],h.each(b.order,function(b,c){a.aaSorting.push(c[0]>=f.length?[0,c[1]]:c)}));b.search!==
- k&&h.extend(a.oPreviousSearch,Ab(b.search));if(b.columns){d=0;for(e=b.columns.length;d<e;d++)g=b.columns[d],g.visible!==k&&(f[d].bVisible=g.visible),g.search!==k&&h.extend(a.aoPreSearchCols[d],Ab(g.search))}r(a,"aoStateLoaded","stateLoaded",[a,b])}}c()};if(a.oFeatures.bStateSave){var g=a.fnStateLoadCallback.call(a.oInstance,a,b);g!==k&&b(g)}else c()}function ya(a){var b=m.settings,a=h.inArray(a,D(b,"nTable"));return-1!==a?b[a]:null}function J(a,b,c,d){c="DataTables warning: "+(a?"table id="+a.sTableId+
- " - ":"")+c;d&&(c+=". For more information about this error, please see http://datatables.net/tn/"+d);if(b)E.console&&console.log&&console.log(c);else if(b=m.ext,b=b.sErrMode||b.errMode,a&&r(a,null,"error",[a,d,c]),"alert"==b)alert(c);else{if("throw"==b)throw Error(c);"function"==typeof b&&b(a,d,c)}}function F(a,b,c,d){h.isArray(c)?h.each(c,function(c,d){h.isArray(d)?F(a,b,d[0],d[1]):F(a,b,d)}):(d===k&&(d=c),b[c]!==k&&(a[d]=b[c]))}function Jb(a,b,c){var d,e;for(e in b)b.hasOwnProperty(e)&&(d=b[e],
- h.isPlainObject(d)?(h.isPlainObject(a[e])||(a[e]={}),h.extend(!0,a[e],d)):a[e]=c&&"data"!==e&&"aaData"!==e&&h.isArray(d)?d.slice():d);return a}function Va(a,b,c){h(a).on("click.DT",b,function(b){a.blur();c(b)}).on("keypress.DT",b,function(a){13===a.which&&(a.preventDefault(),c(a))}).on("selectstart.DT",function(){return!1})}function z(a,b,c,d){c&&a[b].push({fn:c,sName:d})}function r(a,b,c,d){var e=[];b&&(e=h.map(a[b].slice().reverse(),function(b){return b.fn.apply(a.oInstance,d)}));null!==c&&(b=h.Event(c+
- ".dt"),h(a.nTable).trigger(b,d),e.push(b.result));return e}function Ra(a){var b=a._iDisplayStart,c=a.fnDisplayEnd(),d=a._iDisplayLength;b>=c&&(b=c-d);b-=b%d;if(-1===d||0>b)b=0;a._iDisplayStart=b}function Ma(a,b){var c=a.renderer,d=m.ext.renderer[b];return h.isPlainObject(c)&&c[b]?d[c[b]]||d._:"string"===typeof c?d[c]||d._:d._}function y(a){return a.oFeatures.bServerSide?"ssp":a.ajax||a.sAjaxSource?"ajax":"dom"}function ha(a,b){var c=[],c=Kb.numbers_length,d=Math.floor(c/2);b<=c?c=W(0,b):a<=d?(c=W(0,
- c-2),c.push("ellipsis"),c.push(b-1)):(a>=b-1-d?c=W(b-(c-2),b):(c=W(a-d+2,a+d-1),c.push("ellipsis"),c.push(b-1)),c.splice(0,0,"ellipsis"),c.splice(0,0,0));c.DT_el="span";return c}function cb(a){h.each({num:function(b){return za(b,a)},"num-fmt":function(b){return za(b,a,Wa)},"html-num":function(b){return za(b,a,Aa)},"html-num-fmt":function(b){return za(b,a,Aa,Wa)}},function(b,c){x.type.order[b+a+"-pre"]=c;b.match(/^html\-/)&&(x.type.search[b+a]=x.type.search.html)})}function Lb(a){return function(){var b=
- [ya(this[m.ext.iApiIndex])].concat(Array.prototype.slice.call(arguments));return m.ext.internal[a].apply(this,b)}}var m=function(a){this.$=function(a,b){return this.api(!0).$(a,b)};this._=function(a,b){return this.api(!0).rows(a,b).data()};this.api=function(a){return a?new s(ya(this[x.iApiIndex])):new s(this)};this.fnAddData=function(a,b){var c=this.api(!0),d=h.isArray(a)&&(h.isArray(a[0])||h.isPlainObject(a[0]))?c.rows.add(a):c.row.add(a);(b===k||b)&&c.draw();return d.flatten().toArray()};this.fnAdjustColumnSizing=
- function(a){var b=this.api(!0).columns.adjust(),c=b.settings()[0],d=c.oScroll;a===k||a?b.draw(!1):(""!==d.sX||""!==d.sY)&&ka(c)};this.fnClearTable=function(a){var b=this.api(!0).clear();(a===k||a)&&b.draw()};this.fnClose=function(a){this.api(!0).row(a).child.hide()};this.fnDeleteRow=function(a,b,c){var d=this.api(!0),a=d.rows(a),e=a.settings()[0],h=e.aoData[a[0][0]];a.remove();b&&b.call(this,e,h);(c===k||c)&&d.draw();return h};this.fnDestroy=function(a){this.api(!0).destroy(a)};this.fnDraw=function(a){this.api(!0).draw(a)};
- this.fnFilter=function(a,b,c,d,e,h){e=this.api(!0);null===b||b===k?e.search(a,c,d,h):e.column(b).search(a,c,d,h);e.draw()};this.fnGetData=function(a,b){var c=this.api(!0);if(a!==k){var d=a.nodeName?a.nodeName.toLowerCase():"";return b!==k||"td"==d||"th"==d?c.cell(a,b).data():c.row(a).data()||null}return c.data().toArray()};this.fnGetNodes=function(a){var b=this.api(!0);return a!==k?b.row(a).node():b.rows().nodes().flatten().toArray()};this.fnGetPosition=function(a){var b=this.api(!0),c=a.nodeName.toUpperCase();
- return"TR"==c?b.row(a).index():"TD"==c||"TH"==c?(a=b.cell(a).index(),[a.row,a.columnVisible,a.column]):null};this.fnIsOpen=function(a){return this.api(!0).row(a).child.isShown()};this.fnOpen=function(a,b,c){return this.api(!0).row(a).child(b,c).show().child()[0]};this.fnPageChange=function(a,b){var c=this.api(!0).page(a);(b===k||b)&&c.draw(!1)};this.fnSetColumnVis=function(a,b,c){a=this.api(!0).column(a).visible(b);(c===k||c)&&a.columns.adjust().draw()};this.fnSettings=function(){return ya(this[x.iApiIndex])};
- this.fnSort=function(a){this.api(!0).order(a).draw()};this.fnSortListener=function(a,b,c){this.api(!0).order.listener(a,b,c)};this.fnUpdate=function(a,b,c,d,e){var h=this.api(!0);c===k||null===c?h.row(b).data(a):h.cell(b,c).data(a);(e===k||e)&&h.columns.adjust();(d===k||d)&&h.draw();return 0};this.fnVersionCheck=x.fnVersionCheck;var b=this,c=a===k,d=this.length;c&&(a={});this.oApi=this.internal=x.internal;for(var e in m.ext.internal)e&&(this[e]=Lb(e));this.each(function(){var e={},g=1<d?Jb(e,a,!0):
- a,j=0,i,e=this.getAttribute("id"),n=!1,l=m.defaults,q=h(this);if("table"!=this.nodeName.toLowerCase())J(null,0,"Non-table node initialisation ("+this.nodeName+")",2);else{db(l);eb(l.column);I(l,l,!0);I(l.column,l.column,!0);I(l,h.extend(g,q.data()));var t=m.settings,j=0;for(i=t.length;j<i;j++){var o=t[j];if(o.nTable==this||o.nTHead.parentNode==this||o.nTFoot&&o.nTFoot.parentNode==this){var s=g.bRetrieve!==k?g.bRetrieve:l.bRetrieve;if(c||s)return o.oInstance;if(g.bDestroy!==k?g.bDestroy:l.bDestroy){o.oInstance.fnDestroy();
- break}else{J(o,0,"Cannot reinitialise DataTable",3);return}}if(o.sTableId==this.id){t.splice(j,1);break}}if(null===e||""===e)this.id=e="DataTables_Table_"+m.ext._unique++;var p=h.extend(!0,{},m.models.oSettings,{sDestroyWidth:q[0].style.width,sInstance:e,sTableId:e});p.nTable=this;p.oApi=b.internal;p.oInit=g;t.push(p);p.oInstance=1===b.length?b:q.dataTable();db(g);g.oLanguage&&Ca(g.oLanguage);g.aLengthMenu&&!g.iDisplayLength&&(g.iDisplayLength=h.isArray(g.aLengthMenu[0])?g.aLengthMenu[0][0]:g.aLengthMenu[0]);
- g=Jb(h.extend(!0,{},l),g);F(p.oFeatures,g,"bPaginate bLengthChange bFilter bSort bSortMulti bInfo bProcessing bAutoWidth bSortClasses bServerSide bDeferRender".split(" "));F(p,g,["asStripeClasses","ajax","fnServerData","fnFormatNumber","sServerMethod","aaSorting","aaSortingFixed","aLengthMenu","sPaginationType","sAjaxSource","sAjaxDataProp","iStateDuration","sDom","bSortCellsTop","iTabIndex","fnStateLoadCallback","fnStateSaveCallback","renderer","searchDelay","rowId",["iCookieDuration","iStateDuration"],
- ["oSearch","oPreviousSearch"],["aoSearchCols","aoPreSearchCols"],["iDisplayLength","_iDisplayLength"]]);F(p.oScroll,g,[["sScrollX","sX"],["sScrollXInner","sXInner"],["sScrollY","sY"],["bScrollCollapse","bCollapse"]]);F(p.oLanguage,g,"fnInfoCallback");z(p,"aoDrawCallback",g.fnDrawCallback,"user");z(p,"aoServerParams",g.fnServerParams,"user");z(p,"aoStateSaveParams",g.fnStateSaveParams,"user");z(p,"aoStateLoadParams",g.fnStateLoadParams,"user");z(p,"aoStateLoaded",g.fnStateLoaded,"user");z(p,"aoRowCallback",
- g.fnRowCallback,"user");z(p,"aoRowCreatedCallback",g.fnCreatedRow,"user");z(p,"aoHeaderCallback",g.fnHeaderCallback,"user");z(p,"aoFooterCallback",g.fnFooterCallback,"user");z(p,"aoInitComplete",g.fnInitComplete,"user");z(p,"aoPreDrawCallback",g.fnPreDrawCallback,"user");p.rowIdFn=Q(g.rowId);fb(p);var u=p.oClasses;h.extend(u,m.ext.classes,g.oClasses);q.addClass(u.sTable);p.iInitDisplayStart===k&&(p.iInitDisplayStart=g.iDisplayStart,p._iDisplayStart=g.iDisplayStart);null!==g.iDeferLoading&&(p.bDeferLoading=
- !0,e=h.isArray(g.iDeferLoading),p._iRecordsDisplay=e?g.iDeferLoading[0]:g.iDeferLoading,p._iRecordsTotal=e?g.iDeferLoading[1]:g.iDeferLoading);var v=p.oLanguage;h.extend(!0,v,g.oLanguage);v.sUrl&&(h.ajax({dataType:"json",url:v.sUrl,success:function(a){Ca(a);I(l.oLanguage,a);h.extend(true,v,a);ga(p)},error:function(){ga(p)}}),n=!0);null===g.asStripeClasses&&(p.asStripeClasses=[u.sStripeOdd,u.sStripeEven]);var e=p.asStripeClasses,x=q.children("tbody").find("tr").eq(0);-1!==h.inArray(!0,h.map(e,function(a){return x.hasClass(a)}))&&
- (h("tbody tr",this).removeClass(e.join(" ")),p.asDestroyStripes=e.slice());e=[];t=this.getElementsByTagName("thead");0!==t.length&&(da(p.aoHeader,t[0]),e=ra(p));if(null===g.aoColumns){t=[];j=0;for(i=e.length;j<i;j++)t.push(null)}else t=g.aoColumns;j=0;for(i=t.length;j<i;j++)Da(p,e?e[j]:null);hb(p,g.aoColumnDefs,t,function(a,b){ja(p,a,b)});if(x.length){var w=function(a,b){return a.getAttribute("data-"+b)!==null?b:null};h(x[0]).children("th, td").each(function(a,b){var c=p.aoColumns[a];if(c.mData===
- a){var d=w(b,"sort")||w(b,"order"),e=w(b,"filter")||w(b,"search");if(d!==null||e!==null){c.mData={_:a+".display",sort:d!==null?a+".@data-"+d:k,type:d!==null?a+".@data-"+d:k,filter:e!==null?a+".@data-"+e:k};ja(p,a)}}})}var T=p.oFeatures,e=function(){if(g.aaSorting===k){var a=p.aaSorting;j=0;for(i=a.length;j<i;j++)a[j][1]=p.aoColumns[j].asSorting[0]}wa(p);T.bSort&&z(p,"aoDrawCallback",function(){if(p.bSorted){var a=V(p),b={};h.each(a,function(a,c){b[c.src]=c.dir});r(p,null,"order",[p,a,b]);Hb(p)}});
- z(p,"aoDrawCallback",function(){(p.bSorted||y(p)==="ssp"||T.bDeferRender)&&wa(p)},"sc");var a=q.children("caption").each(function(){this._captionSide=h(this).css("caption-side")}),b=q.children("thead");b.length===0&&(b=h("<thead/>").appendTo(q));p.nTHead=b[0];b=q.children("tbody");b.length===0&&(b=h("<tbody/>").appendTo(q));p.nTBody=b[0];b=q.children("tfoot");if(b.length===0&&a.length>0&&(p.oScroll.sX!==""||p.oScroll.sY!==""))b=h("<tfoot/>").appendTo(q);if(b.length===0||b.children().length===0)q.addClass(u.sNoFooter);
- else if(b.length>0){p.nTFoot=b[0];da(p.aoFooter,p.nTFoot)}if(g.aaData)for(j=0;j<g.aaData.length;j++)M(p,g.aaData[j]);else(p.bDeferLoading||y(p)=="dom")&&ma(p,h(p.nTBody).children("tr"));p.aiDisplay=p.aiDisplayMaster.slice();p.bInitialised=true;n===false&&ga(p)};g.bStateSave?(T.bStateSave=!0,z(p,"aoDrawCallback",xa,"state_save"),Ib(p,g,e)):e()}});b=null;return this},x,s,o,u,Xa={},Mb=/[\r\n]/g,Aa=/<.*?>/g,Zb=/^\d{2,4}[\.\/\-]\d{1,2}[\.\/\-]\d{1,2}([T ]{1}\d{1,2}[:\.]\d{2}([\.:]\d{2})?)?$/,$b=RegExp("(\\/|\\.|\\*|\\+|\\?|\\||\\(|\\)|\\[|\\]|\\{|\\}|\\\\|\\$|\\^|\\-)",
- "g"),Wa=/[',$£€¥%\u2009\u202F\u20BD\u20a9\u20BArfk]/gi,L=function(a){return!a||!0===a||"-"===a?!0:!1},Nb=function(a){var b=parseInt(a,10);return!isNaN(b)&&isFinite(a)?b:null},Ob=function(a,b){Xa[b]||(Xa[b]=RegExp(Pa(b),"g"));return"string"===typeof a&&"."!==b?a.replace(/\./g,"").replace(Xa[b],"."):a},Ya=function(a,b,c){var d="string"===typeof a;if(L(a))return!0;b&&d&&(a=Ob(a,b));c&&d&&(a=a.replace(Wa,""));return!isNaN(parseFloat(a))&&isFinite(a)},Pb=function(a,b,c){return L(a)?!0:!(L(a)||"string"===
- typeof a)?null:Ya(a.replace(Aa,""),b,c)?!0:null},D=function(a,b,c){var d=[],e=0,f=a.length;if(c!==k)for(;e<f;e++)a[e]&&a[e][b]&&d.push(a[e][b][c]);else for(;e<f;e++)a[e]&&d.push(a[e][b]);return d},ia=function(a,b,c,d){var e=[],f=0,g=b.length;if(d!==k)for(;f<g;f++)a[b[f]][c]&&e.push(a[b[f]][c][d]);else for(;f<g;f++)e.push(a[b[f]][c]);return e},W=function(a,b){var c=[],d;b===k?(b=0,d=a):(d=b,b=a);for(var e=b;e<d;e++)c.push(e);return c},Qb=function(a){for(var b=[],c=0,d=a.length;c<d;c++)a[c]&&b.push(a[c]);
- return b},qa=function(a){var b;a:{if(!(2>a.length)){b=a.slice().sort();for(var c=b[0],d=1,e=b.length;d<e;d++){if(b[d]===c){b=!1;break a}c=b[d]}}b=!0}if(b)return a.slice();b=[];var e=a.length,f,g=0,d=0;a:for(;d<e;d++){c=a[d];for(f=0;f<g;f++)if(b[f]===c)continue a;b.push(c);g++}return b};m.util={throttle:function(a,b){var c=b!==k?b:200,d,e;return function(){var b=this,g=+new Date,j=arguments;d&&g<d+c?(clearTimeout(e),e=setTimeout(function(){d=k;a.apply(b,j)},c)):(d=g,a.apply(b,j))}},escapeRegex:function(a){return a.replace($b,
- "\\$1")}};var A=function(a,b,c){a[b]!==k&&(a[c]=a[b])},ba=/\[.*?\]$/,U=/\(\)$/,Pa=m.util.escapeRegex,va=h("<div>")[0],Wb=va.textContent!==k,Yb=/<.*?>/g,Na=m.util.throttle,Rb=[],w=Array.prototype,ac=function(a){var b,c,d=m.settings,e=h.map(d,function(a){return a.nTable});if(a){if(a.nTable&&a.oApi)return[a];if(a.nodeName&&"table"===a.nodeName.toLowerCase())return b=h.inArray(a,e),-1!==b?[d[b]]:null;if(a&&"function"===typeof a.settings)return a.settings().toArray();"string"===typeof a?c=h(a):a instanceof
- h&&(c=a)}else return[];if(c)return c.map(function(){b=h.inArray(this,e);return-1!==b?d[b]:null}).toArray()};s=function(a,b){if(!(this instanceof s))return new s(a,b);var c=[],d=function(a){(a=ac(a))&&(c=c.concat(a))};if(h.isArray(a))for(var e=0,f=a.length;e<f;e++)d(a[e]);else d(a);this.context=qa(c);b&&h.merge(this,b);this.selector={rows:null,cols:null,opts:null};s.extend(this,this,Rb)};m.Api=s;h.extend(s.prototype,{any:function(){return 0!==this.count()},concat:w.concat,context:[],count:function(){return this.flatten().length},
- each:function(a){for(var b=0,c=this.length;b<c;b++)a.call(this,this[b],b,this);return this},eq:function(a){var b=this.context;return b.length>a?new s(b[a],this[a]):null},filter:function(a){var b=[];if(w.filter)b=w.filter.call(this,a,this);else for(var c=0,d=this.length;c<d;c++)a.call(this,this[c],c,this)&&b.push(this[c]);return new s(this.context,b)},flatten:function(){var a=[];return new s(this.context,a.concat.apply(a,this.toArray()))},join:w.join,indexOf:w.indexOf||function(a,b){for(var c=b||0,
- d=this.length;c<d;c++)if(this[c]===a)return c;return-1},iterator:function(a,b,c,d){var e=[],f,g,j,h,n,l=this.context,m,o,u=this.selector;"string"===typeof a&&(d=c,c=b,b=a,a=!1);g=0;for(j=l.length;g<j;g++){var r=new s(l[g]);if("table"===b)f=c.call(r,l[g],g),f!==k&&e.push(f);else if("columns"===b||"rows"===b)f=c.call(r,l[g],this[g],g),f!==k&&e.push(f);else if("column"===b||"column-rows"===b||"row"===b||"cell"===b){o=this[g];"column-rows"===b&&(m=Ba(l[g],u.opts));h=0;for(n=o.length;h<n;h++)f=o[h],f=
- "cell"===b?c.call(r,l[g],f.row,f.column,g,h):c.call(r,l[g],f,g,h,m),f!==k&&e.push(f)}}return e.length||d?(a=new s(l,a?e.concat.apply([],e):e),b=a.selector,b.rows=u.rows,b.cols=u.cols,b.opts=u.opts,a):this},lastIndexOf:w.lastIndexOf||function(a,b){return this.indexOf.apply(this.toArray.reverse(),arguments)},length:0,map:function(a){var b=[];if(w.map)b=w.map.call(this,a,this);else for(var c=0,d=this.length;c<d;c++)b.push(a.call(this,this[c],c));return new s(this.context,b)},pluck:function(a){return this.map(function(b){return b[a]})},
- pop:w.pop,push:w.push,reduce:w.reduce||function(a,b){return gb(this,a,b,0,this.length,1)},reduceRight:w.reduceRight||function(a,b){return gb(this,a,b,this.length-1,-1,-1)},reverse:w.reverse,selector:null,shift:w.shift,slice:function(){return new s(this.context,this)},sort:w.sort,splice:w.splice,toArray:function(){return w.slice.call(this)},to$:function(){return h(this)},toJQuery:function(){return h(this)},unique:function(){return new s(this.context,qa(this))},unshift:w.unshift});s.extend=function(a,
- b,c){if(c.length&&b&&(b instanceof s||b.__dt_wrapper)){var d,e,f,g=function(a,b,c){return function(){var d=b.apply(a,arguments);s.extend(d,d,c.methodExt);return d}};d=0;for(e=c.length;d<e;d++)f=c[d],b[f.name]="function"===typeof f.val?g(a,f.val,f):h.isPlainObject(f.val)?{}:f.val,b[f.name].__dt_wrapper=!0,s.extend(a,b[f.name],f.propExt)}};s.register=o=function(a,b){if(h.isArray(a))for(var c=0,d=a.length;c<d;c++)s.register(a[c],b);else for(var e=a.split("."),f=Rb,g,j,c=0,d=e.length;c<d;c++){g=(j=-1!==
- e[c].indexOf("()"))?e[c].replace("()",""):e[c];var i;a:{i=0;for(var n=f.length;i<n;i++)if(f[i].name===g){i=f[i];break a}i=null}i||(i={name:g,val:{},methodExt:[],propExt:[]},f.push(i));c===d-1?i.val=b:f=j?i.methodExt:i.propExt}};s.registerPlural=u=function(a,b,c){s.register(a,c);s.register(b,function(){var a=c.apply(this,arguments);return a===this?this:a instanceof s?a.length?h.isArray(a[0])?new s(a.context,a[0]):a[0]:k:a})};o("tables()",function(a){var b;if(a){b=s;var c=this.context;if("number"===
- typeof a)a=[c[a]];else var d=h.map(c,function(a){return a.nTable}),a=h(d).filter(a).map(function(){var a=h.inArray(this,d);return c[a]}).toArray();b=new b(a)}else b=this;return b});o("table()",function(a){var a=this.tables(a),b=a.context;return b.length?new s(b[0]):a});u("tables().nodes()","table().node()",function(){return this.iterator("table",function(a){return a.nTable},1)});u("tables().body()","table().body()",function(){return this.iterator("table",function(a){return a.nTBody},1)});u("tables().header()",
- "table().header()",function(){return this.iterator("table",function(a){return a.nTHead},1)});u("tables().footer()","table().footer()",function(){return this.iterator("table",function(a){return a.nTFoot},1)});u("tables().containers()","table().container()",function(){return this.iterator("table",function(a){return a.nTableWrapper},1)});o("draw()",function(a){return this.iterator("table",function(b){"page"===a?N(b):("string"===typeof a&&(a="full-hold"===a?!1:!0),S(b,!1===a))})});o("page()",function(a){return a===
- k?this.page.info().page:this.iterator("table",function(b){Sa(b,a)})});o("page.info()",function(){if(0===this.context.length)return k;var a=this.context[0],b=a._iDisplayStart,c=a.oFeatures.bPaginate?a._iDisplayLength:-1,d=a.fnRecordsDisplay(),e=-1===c;return{page:e?0:Math.floor(b/c),pages:e?1:Math.ceil(d/c),start:b,end:a.fnDisplayEnd(),length:c,recordsTotal:a.fnRecordsTotal(),recordsDisplay:d,serverSide:"ssp"===y(a)}});o("page.len()",function(a){return a===k?0!==this.context.length?this.context[0]._iDisplayLength:
- k:this.iterator("table",function(b){Qa(b,a)})});var Sb=function(a,b,c){if(c){var d=new s(a);d.one("draw",function(){c(d.ajax.json())})}if("ssp"==y(a))S(a,b);else{C(a,!0);var e=a.jqXHR;e&&4!==e.readyState&&e.abort();sa(a,[],function(c){na(a);for(var c=ta(a,c),d=0,e=c.length;d<e;d++)M(a,c[d]);S(a,b);C(a,!1)})}};o("ajax.json()",function(){var a=this.context;if(0<a.length)return a[0].json});o("ajax.params()",function(){var a=this.context;if(0<a.length)return a[0].oAjaxData});o("ajax.reload()",function(a,
- b){return this.iterator("table",function(c){Sb(c,!1===b,a)})});o("ajax.url()",function(a){var b=this.context;if(a===k){if(0===b.length)return k;b=b[0];return b.ajax?h.isPlainObject(b.ajax)?b.ajax.url:b.ajax:b.sAjaxSource}return this.iterator("table",function(b){h.isPlainObject(b.ajax)?b.ajax.url=a:b.ajax=a})});o("ajax.url().load()",function(a,b){return this.iterator("table",function(c){Sb(c,!1===b,a)})});var Za=function(a,b,c,d,e){var f=[],g,j,i,n,l,m;i=typeof b;if(!b||"string"===i||"function"===
- i||b.length===k)b=[b];i=0;for(n=b.length;i<n;i++){j=b[i]&&b[i].split&&!b[i].match(/[\[\(:]/)?b[i].split(","):[b[i]];l=0;for(m=j.length;l<m;l++)(g=c("string"===typeof j[l]?h.trim(j[l]):j[l]))&&g.length&&(f=f.concat(g))}a=x.selector[a];if(a.length){i=0;for(n=a.length;i<n;i++)f=a[i](d,e,f)}return qa(f)},$a=function(a){a||(a={});a.filter&&a.search===k&&(a.search=a.filter);return h.extend({search:"none",order:"current",page:"all"},a)},ab=function(a){for(var b=0,c=a.length;b<c;b++)if(0<a[b].length)return a[0]=
- a[b],a[0].length=1,a.length=1,a.context=[a.context[b]],a;a.length=0;return a},Ba=function(a,b){var c,d,e,f=[],g=a.aiDisplay;c=a.aiDisplayMaster;var j=b.search;d=b.order;e=b.page;if("ssp"==y(a))return"removed"===j?[]:W(0,c.length);if("current"==e){c=a._iDisplayStart;for(d=a.fnDisplayEnd();c<d;c++)f.push(g[c])}else if("current"==d||"applied"==d)f="none"==j?c.slice():"applied"==j?g.slice():h.map(c,function(a){return-1===h.inArray(a,g)?a:null});else if("index"==d||"original"==d){c=0;for(d=a.aoData.length;c<
- d;c++)"none"==j?f.push(c):(e=h.inArray(c,g),(-1===e&&"removed"==j||0<=e&&"applied"==j)&&f.push(c))}return f};o("rows()",function(a,b){a===k?a="":h.isPlainObject(a)&&(b=a,a="");var b=$a(b),c=this.iterator("table",function(c){var e=b,f;return Za("row",a,function(a){var b=Nb(a);if(b!==null&&!e)return[b];f||(f=Ba(c,e));if(b!==null&&h.inArray(b,f)!==-1)return[b];if(a===null||a===k||a==="")return f;if(typeof a==="function")return h.map(f,function(b){var e=c.aoData[b];return a(b,e._aData,e.nTr)?b:null});
- b=Qb(ia(c.aoData,f,"nTr"));if(a.nodeName){if(a._DT_RowIndex!==k)return[a._DT_RowIndex];if(a._DT_CellIndex)return[a._DT_CellIndex.row];b=h(a).closest("*[data-dt-row]");return b.length?[b.data("dt-row")]:[]}if(typeof a==="string"&&a.charAt(0)==="#"){var i=c.aIds[a.replace(/^#/,"")];if(i!==k)return[i.idx]}return h(b).filter(a).map(function(){return this._DT_RowIndex}).toArray()},c,e)},1);c.selector.rows=a;c.selector.opts=b;return c});o("rows().nodes()",function(){return this.iterator("row",function(a,
- b){return a.aoData[b].nTr||k},1)});o("rows().data()",function(){return this.iterator(!0,"rows",function(a,b){return ia(a.aoData,b,"_aData")},1)});u("rows().cache()","row().cache()",function(a){return this.iterator("row",function(b,c){var d=b.aoData[c];return"search"===a?d._aFilterData:d._aSortData},1)});u("rows().invalidate()","row().invalidate()",function(a){return this.iterator("row",function(b,c){ca(b,c,a)})});u("rows().indexes()","row().index()",function(){return this.iterator("row",function(a,
- b){return b},1)});u("rows().ids()","row().id()",function(a){for(var b=[],c=this.context,d=0,e=c.length;d<e;d++)for(var f=0,g=this[d].length;f<g;f++){var h=c[d].rowIdFn(c[d].aoData[this[d][f]]._aData);b.push((!0===a?"#":"")+h)}return new s(c,b)});u("rows().remove()","row().remove()",function(){var a=this;this.iterator("row",function(b,c,d){var e=b.aoData,f=e[c],g,h,i,n,l;e.splice(c,1);g=0;for(h=e.length;g<h;g++)if(i=e[g],l=i.anCells,null!==i.nTr&&(i.nTr._DT_RowIndex=g),null!==l){i=0;for(n=l.length;i<
- n;i++)l[i]._DT_CellIndex.row=g}oa(b.aiDisplayMaster,c);oa(b.aiDisplay,c);oa(a[d],c,!1);0<b._iRecordsDisplay&&b._iRecordsDisplay--;Ra(b);c=b.rowIdFn(f._aData);c!==k&&delete b.aIds[c]});this.iterator("table",function(a){for(var c=0,d=a.aoData.length;c<d;c++)a.aoData[c].idx=c});return this});o("rows.add()",function(a){var b=this.iterator("table",function(b){var c,f,g,h=[];f=0;for(g=a.length;f<g;f++)c=a[f],c.nodeName&&"TR"===c.nodeName.toUpperCase()?h.push(ma(b,c)[0]):h.push(M(b,c));return h},1),c=this.rows(-1);
- c.pop();h.merge(c,b);return c});o("row()",function(a,b){return ab(this.rows(a,b))});o("row().data()",function(a){var b=this.context;if(a===k)return b.length&&this.length?b[0].aoData[this[0]]._aData:k;b[0].aoData[this[0]]._aData=a;ca(b[0],this[0],"data");return this});o("row().node()",function(){var a=this.context;return a.length&&this.length?a[0].aoData[this[0]].nTr||null:null});o("row.add()",function(a){a instanceof h&&a.length&&(a=a[0]);var b=this.iterator("table",function(b){return a.nodeName&&
- "TR"===a.nodeName.toUpperCase()?ma(b,a)[0]:M(b,a)});return this.row(b[0])});var bb=function(a,b){var c=a.context;if(c.length&&(c=c[0].aoData[b!==k?b:a[0]])&&c._details)c._details.remove(),c._detailsShow=k,c._details=k},Tb=function(a,b){var c=a.context;if(c.length&&a.length){var d=c[0].aoData[a[0]];if(d._details){(d._detailsShow=b)?d._details.insertAfter(d.nTr):d._details.detach();var e=c[0],f=new s(e),g=e.aoData;f.off("draw.dt.DT_details column-visibility.dt.DT_details destroy.dt.DT_details");0<D(g,
- "_details").length&&(f.on("draw.dt.DT_details",function(a,b){e===b&&f.rows({page:"current"}).eq(0).each(function(a){a=g[a];a._detailsShow&&a._details.insertAfter(a.nTr)})}),f.on("column-visibility.dt.DT_details",function(a,b){if(e===b)for(var c,d=aa(b),f=0,h=g.length;f<h;f++)c=g[f],c._details&&c._details.children("td[colspan]").attr("colspan",d)}),f.on("destroy.dt.DT_details",function(a,b){if(e===b)for(var c=0,d=g.length;c<d;c++)g[c]._details&&bb(f,c)}))}}};o("row().child()",function(a,b){var c=this.context;
- if(a===k)return c.length&&this.length?c[0].aoData[this[0]]._details:k;if(!0===a)this.child.show();else if(!1===a)bb(this);else if(c.length&&this.length){var d=c[0],c=c[0].aoData[this[0]],e=[],f=function(a,b){if(h.isArray(a)||a instanceof h)for(var c=0,k=a.length;c<k;c++)f(a[c],b);else a.nodeName&&"tr"===a.nodeName.toLowerCase()?e.push(a):(c=h("<tr><td/></tr>").addClass(b),h("td",c).addClass(b).html(a)[0].colSpan=aa(d),e.push(c[0]))};f(a,b);c._details&&c._details.detach();c._details=h(e);c._detailsShow&&
- c._details.insertAfter(c.nTr)}return this});o(["row().child.show()","row().child().show()"],function(){Tb(this,!0);return this});o(["row().child.hide()","row().child().hide()"],function(){Tb(this,!1);return this});o(["row().child.remove()","row().child().remove()"],function(){bb(this);return this});o("row().child.isShown()",function(){var a=this.context;return a.length&&this.length?a[0].aoData[this[0]]._detailsShow||!1:!1});var bc=/^([^:]+):(name|visIdx|visible)$/,Ub=function(a,b,c,d,e){for(var c=
- [],d=0,f=e.length;d<f;d++)c.push(B(a,e[d],b));return c};o("columns()",function(a,b){a===k?a="":h.isPlainObject(a)&&(b=a,a="");var b=$a(b),c=this.iterator("table",function(c){var e=a,f=b,g=c.aoColumns,j=D(g,"sName"),i=D(g,"nTh");return Za("column",e,function(a){var b=Nb(a);if(a==="")return W(g.length);if(b!==null)return[b>=0?b:g.length+b];if(typeof a==="function"){var e=Ba(c,f);return h.map(g,function(b,f){return a(f,Ub(c,f,0,0,e),i[f])?f:null})}var k=typeof a==="string"?a.match(bc):"";if(k)switch(k[2]){case "visIdx":case "visible":b=
- parseInt(k[1],10);if(b<0){var m=h.map(g,function(a,b){return a.bVisible?b:null});return[m[m.length+b]]}return[Z(c,b)];case "name":return h.map(j,function(a,b){return a===k[1]?b:null});default:return[]}if(a.nodeName&&a._DT_CellIndex)return[a._DT_CellIndex.column];b=h(i).filter(a).map(function(){return h.inArray(this,i)}).toArray();if(b.length||!a.nodeName)return b;b=h(a).closest("*[data-dt-column]");return b.length?[b.data("dt-column")]:[]},c,f)},1);c.selector.cols=a;c.selector.opts=b;return c});u("columns().header()",
- "column().header()",function(){return this.iterator("column",function(a,b){return a.aoColumns[b].nTh},1)});u("columns().footer()","column().footer()",function(){return this.iterator("column",function(a,b){return a.aoColumns[b].nTf},1)});u("columns().data()","column().data()",function(){return this.iterator("column-rows",Ub,1)});u("columns().dataSrc()","column().dataSrc()",function(){return this.iterator("column",function(a,b){return a.aoColumns[b].mData},1)});u("columns().cache()","column().cache()",
- function(a){return this.iterator("column-rows",function(b,c,d,e,f){return ia(b.aoData,f,"search"===a?"_aFilterData":"_aSortData",c)},1)});u("columns().nodes()","column().nodes()",function(){return this.iterator("column-rows",function(a,b,c,d,e){return ia(a.aoData,e,"anCells",b)},1)});u("columns().visible()","column().visible()",function(a,b){var c=this.iterator("column",function(b,c){if(a===k)return b.aoColumns[c].bVisible;var f=b.aoColumns,g=f[c],j=b.aoData,i,n,l;if(a!==k&&g.bVisible!==a){if(a){var m=
- h.inArray(!0,D(f,"bVisible"),c+1);i=0;for(n=j.length;i<n;i++)l=j[i].nTr,f=j[i].anCells,l&&l.insertBefore(f[c],f[m]||null)}else h(D(b.aoData,"anCells",c)).detach();g.bVisible=a;ea(b,b.aoHeader);ea(b,b.aoFooter);xa(b)}});a!==k&&(this.iterator("column",function(c,e){r(c,null,"column-visibility",[c,e,a,b])}),(b===k||b)&&this.columns.adjust());return c});u("columns().indexes()","column().index()",function(a){return this.iterator("column",function(b,c){return"visible"===a?$(b,c):c},1)});o("columns.adjust()",
- function(){return this.iterator("table",function(a){Y(a)},1)});o("column.index()",function(a,b){if(0!==this.context.length){var c=this.context[0];if("fromVisible"===a||"toData"===a)return Z(c,b);if("fromData"===a||"toVisible"===a)return $(c,b)}});o("column()",function(a,b){return ab(this.columns(a,b))});o("cells()",function(a,b,c){h.isPlainObject(a)&&(a.row===k?(c=a,a=null):(c=b,b=null));h.isPlainObject(b)&&(c=b,b=null);if(null===b||b===k)return this.iterator("table",function(b){var d=a,e=$a(c),f=
- b.aoData,g=Ba(b,e),j=Qb(ia(f,g,"anCells")),i=h([].concat.apply([],j)),l,n=b.aoColumns.length,m,o,u,s,r,v;return Za("cell",d,function(a){var c=typeof a==="function";if(a===null||a===k||c){m=[];o=0;for(u=g.length;o<u;o++){l=g[o];for(s=0;s<n;s++){r={row:l,column:s};if(c){v=f[l];a(r,B(b,l,s),v.anCells?v.anCells[s]:null)&&m.push(r)}else m.push(r)}}return m}if(h.isPlainObject(a))return[a];c=i.filter(a).map(function(a,b){return{row:b._DT_CellIndex.row,column:b._DT_CellIndex.column}}).toArray();if(c.length||
- !a.nodeName)return c;v=h(a).closest("*[data-dt-row]");return v.length?[{row:v.data("dt-row"),column:v.data("dt-column")}]:[]},b,e)});var d=this.columns(b,c),e=this.rows(a,c),f,g,j,i,n,l=this.iterator("table",function(a,b){f=[];g=0;for(j=e[b].length;g<j;g++){i=0;for(n=d[b].length;i<n;i++)f.push({row:e[b][g],column:d[b][i]})}return f},1);h.extend(l.selector,{cols:b,rows:a,opts:c});return l});u("cells().nodes()","cell().node()",function(){return this.iterator("cell",function(a,b,c){return(a=a.aoData[b])&&
- a.anCells?a.anCells[c]:k},1)});o("cells().data()",function(){return this.iterator("cell",function(a,b,c){return B(a,b,c)},1)});u("cells().cache()","cell().cache()",function(a){a="search"===a?"_aFilterData":"_aSortData";return this.iterator("cell",function(b,c,d){return b.aoData[c][a][d]},1)});u("cells().render()","cell().render()",function(a){return this.iterator("cell",function(b,c,d){return B(b,c,d,a)},1)});u("cells().indexes()","cell().index()",function(){return this.iterator("cell",function(a,
- b,c){return{row:b,column:c,columnVisible:$(a,c)}},1)});u("cells().invalidate()","cell().invalidate()",function(a){return this.iterator("cell",function(b,c,d){ca(b,c,a,d)})});o("cell()",function(a,b,c){return ab(this.cells(a,b,c))});o("cell().data()",function(a){var b=this.context,c=this[0];if(a===k)return b.length&&c.length?B(b[0],c[0].row,c[0].column):k;ib(b[0],c[0].row,c[0].column,a);ca(b[0],c[0].row,"data",c[0].column);return this});o("order()",function(a,b){var c=this.context;if(a===k)return 0!==
- c.length?c[0].aaSorting:k;"number"===typeof a?a=[[a,b]]:a.length&&!h.isArray(a[0])&&(a=Array.prototype.slice.call(arguments));return this.iterator("table",function(b){b.aaSorting=a.slice()})});o("order.listener()",function(a,b,c){return this.iterator("table",function(d){La(d,a,b,c)})});o("order.fixed()",function(a){if(!a){var b=this.context,b=b.length?b[0].aaSortingFixed:k;return h.isArray(b)?{pre:b}:b}return this.iterator("table",function(b){b.aaSortingFixed=h.extend(!0,{},a)})});o(["columns().order()",
- "column().order()"],function(a){var b=this;return this.iterator("table",function(c,d){var e=[];h.each(b[d],function(b,c){e.push([c,a])});c.aaSorting=e})});o("search()",function(a,b,c,d){var e=this.context;return a===k?0!==e.length?e[0].oPreviousSearch.sSearch:k:this.iterator("table",function(e){e.oFeatures.bFilter&&fa(e,h.extend({},e.oPreviousSearch,{sSearch:a+"",bRegex:null===b?!1:b,bSmart:null===c?!0:c,bCaseInsensitive:null===d?!0:d}),1)})});u("columns().search()","column().search()",function(a,
- b,c,d){return this.iterator("column",function(e,f){var g=e.aoPreSearchCols;if(a===k)return g[f].sSearch;e.oFeatures.bFilter&&(h.extend(g[f],{sSearch:a+"",bRegex:null===b?!1:b,bSmart:null===c?!0:c,bCaseInsensitive:null===d?!0:d}),fa(e,e.oPreviousSearch,1))})});o("state()",function(){return this.context.length?this.context[0].oSavedState:null});o("state.clear()",function(){return this.iterator("table",function(a){a.fnStateSaveCallback.call(a.oInstance,a,{})})});o("state.loaded()",function(){return this.context.length?
- this.context[0].oLoadedState:null});o("state.save()",function(){return this.iterator("table",function(a){xa(a)})});m.versionCheck=m.fnVersionCheck=function(a){for(var b=m.version.split("."),a=a.split("."),c,d,e=0,f=a.length;e<f;e++)if(c=parseInt(b[e],10)||0,d=parseInt(a[e],10)||0,c!==d)return c>d;return!0};m.isDataTable=m.fnIsDataTable=function(a){var b=h(a).get(0),c=!1;if(a instanceof m.Api)return!0;h.each(m.settings,function(a,e){var f=e.nScrollHead?h("table",e.nScrollHead)[0]:null,g=e.nScrollFoot?
- h("table",e.nScrollFoot)[0]:null;if(e.nTable===b||f===b||g===b)c=!0});return c};m.tables=m.fnTables=function(a){var b=!1;h.isPlainObject(a)&&(b=a.api,a=a.visible);var c=h.map(m.settings,function(b){if(!a||a&&h(b.nTable).is(":visible"))return b.nTable});return b?new s(c):c};m.camelToHungarian=I;o("$()",function(a,b){var c=this.rows(b).nodes(),c=h(c);return h([].concat(c.filter(a).toArray(),c.find(a).toArray()))});h.each(["on","one","off"],function(a,b){o(b+"()",function(){var a=Array.prototype.slice.call(arguments);
- a[0]=h.map(a[0].split(/\s/),function(a){return!a.match(/\.dt\b/)?a+".dt":a}).join(" ");var d=h(this.tables().nodes());d[b].apply(d,a);return this})});o("clear()",function(){return this.iterator("table",function(a){na(a)})});o("settings()",function(){return new s(this.context,this.context)});o("init()",function(){var a=this.context;return a.length?a[0].oInit:null});o("data()",function(){return this.iterator("table",function(a){return D(a.aoData,"_aData")}).flatten()});o("destroy()",function(a){a=a||
- !1;return this.iterator("table",function(b){var c=b.nTableWrapper.parentNode,d=b.oClasses,e=b.nTable,f=b.nTBody,g=b.nTHead,j=b.nTFoot,i=h(e),f=h(f),k=h(b.nTableWrapper),l=h.map(b.aoData,function(a){return a.nTr}),o;b.bDestroying=!0;r(b,"aoDestroyCallback","destroy",[b]);a||(new s(b)).columns().visible(!0);k.off(".DT").find(":not(tbody *)").off(".DT");h(E).off(".DT-"+b.sInstance);e!=g.parentNode&&(i.children("thead").detach(),i.append(g));j&&e!=j.parentNode&&(i.children("tfoot").detach(),i.append(j));
- b.aaSorting=[];b.aaSortingFixed=[];wa(b);h(l).removeClass(b.asStripeClasses.join(" "));h("th, td",g).removeClass(d.sSortable+" "+d.sSortableAsc+" "+d.sSortableDesc+" "+d.sSortableNone);f.children().detach();f.append(l);g=a?"remove":"detach";i[g]();k[g]();!a&&c&&(c.insertBefore(e,b.nTableReinsertBefore),i.css("width",b.sDestroyWidth).removeClass(d.sTable),(o=b.asDestroyStripes.length)&&f.children().each(function(a){h(this).addClass(b.asDestroyStripes[a%o])}));c=h.inArray(b,m.settings);-1!==c&&m.settings.splice(c,
- 1)})});h.each(["column","row","cell"],function(a,b){o(b+"s().every()",function(a){var d=this.selector.opts,e=this;return this.iterator(b,function(f,g,h,i,n){a.call(e[b](g,"cell"===b?h:d,"cell"===b?d:k),g,h,i,n)})})});o("i18n()",function(a,b,c){var d=this.context[0],a=Q(a)(d.oLanguage);a===k&&(a=b);c!==k&&h.isPlainObject(a)&&(a=a[c]!==k?a[c]:a._);return a.replace("%d",c)});m.version="1.10.16";m.settings=[];m.models={};m.models.oSearch={bCaseInsensitive:!0,sSearch:"",bRegex:!1,bSmart:!0};m.models.oRow=
- {nTr:null,anCells:null,_aData:[],_aSortData:null,_aFilterData:null,_sFilterRow:null,_sRowStripe:"",src:null,idx:-1};m.models.oColumn={idx:null,aDataSort:null,asSorting:null,bSearchable:null,bSortable:null,bVisible:null,_sManualType:null,_bAttrSrc:!1,fnCreatedCell:null,fnGetData:null,fnSetData:null,mData:null,mRender:null,nTh:null,nTf:null,sClass:null,sContentPadding:null,sDefaultContent:null,sName:null,sSortDataType:"std",sSortingClass:null,sSortingClassJUI:null,sTitle:null,sType:null,sWidth:null,
- sWidthOrig:null};m.defaults={aaData:null,aaSorting:[[0,"asc"]],aaSortingFixed:[],ajax:null,aLengthMenu:[10,25,50,100],aoColumns:null,aoColumnDefs:null,aoSearchCols:[],asStripeClasses:null,bAutoWidth:!0,bDeferRender:!1,bDestroy:!1,bFilter:!0,bInfo:!0,bLengthChange:!0,bPaginate:!0,bProcessing:!1,bRetrieve:!1,bScrollCollapse:!1,bServerSide:!1,bSort:!0,bSortMulti:!0,bSortCellsTop:!1,bSortClasses:!0,bStateSave:!1,fnCreatedRow:null,fnDrawCallback:null,fnFooterCallback:null,fnFormatNumber:function(a){return a.toString().replace(/\B(?=(\d{3})+(?!\d))/g,
- this.oLanguage.sThousands)},fnHeaderCallback:null,fnInfoCallback:null,fnInitComplete:null,fnPreDrawCallback:null,fnRowCallback:null,fnServerData:null,fnServerParams:null,fnStateLoadCallback:function(a){try{return JSON.parse((-1===a.iStateDuration?sessionStorage:localStorage).getItem("DataTables_"+a.sInstance+"_"+location.pathname))}catch(b){}},fnStateLoadParams:null,fnStateLoaded:null,fnStateSaveCallback:function(a,b){try{(-1===a.iStateDuration?sessionStorage:localStorage).setItem("DataTables_"+a.sInstance+
- "_"+location.pathname,JSON.stringify(b))}catch(c){}},fnStateSaveParams:null,iStateDuration:7200,iDeferLoading:null,iDisplayLength:10,iDisplayStart:0,iTabIndex:0,oClasses:{},oLanguage:{oAria:{sSortAscending:": activate to sort column ascending",sSortDescending:": activate to sort column descending"},oPaginate:{sFirst:"First",sLast:"Last",sNext:"Next",sPrevious:"Previous"},sEmptyTable:"No data available in table",sInfo:"Showing _START_ to _END_ of _TOTAL_ entries",sInfoEmpty:"Showing 0 to 0 of 0 entries",
- sInfoFiltered:"(filtered from _MAX_ total entries)",sInfoPostFix:"",sDecimal:"",sThousands:",",sLengthMenu:"Show _MENU_ entries",sLoadingRecords:"Loading...",sProcessing:"Processing...",sSearch:"Search:",sSearchPlaceholder:"",sUrl:"",sZeroRecords:"No matching records found"},oSearch:h.extend({},m.models.oSearch),sAjaxDataProp:"data",sAjaxSource:null,sDom:"lfrtip",searchDelay:null,sPaginationType:"simple_numbers",sScrollX:"",sScrollXInner:"",sScrollY:"",sServerMethod:"GET",renderer:null,rowId:"DT_RowId"};
- X(m.defaults);m.defaults.column={aDataSort:null,iDataSort:-1,asSorting:["asc","desc"],bSearchable:!0,bSortable:!0,bVisible:!0,fnCreatedCell:null,mData:null,mRender:null,sCellType:"td",sClass:"",sContentPadding:"",sDefaultContent:null,sName:"",sSortDataType:"std",sTitle:null,sType:null,sWidth:null};X(m.defaults.column);m.models.oSettings={oFeatures:{bAutoWidth:null,bDeferRender:null,bFilter:null,bInfo:null,bLengthChange:null,bPaginate:null,bProcessing:null,bServerSide:null,bSort:null,bSortMulti:null,
- bSortClasses:null,bStateSave:null},oScroll:{bCollapse:null,iBarWidth:0,sX:null,sXInner:null,sY:null},oLanguage:{fnInfoCallback:null},oBrowser:{bScrollOversize:!1,bScrollbarLeft:!1,bBounding:!1,barWidth:0},ajax:null,aanFeatures:[],aoData:[],aiDisplay:[],aiDisplayMaster:[],aIds:{},aoColumns:[],aoHeader:[],aoFooter:[],oPreviousSearch:{},aoPreSearchCols:[],aaSorting:null,aaSortingFixed:[],asStripeClasses:null,asDestroyStripes:[],sDestroyWidth:0,aoRowCallback:[],aoHeaderCallback:[],aoFooterCallback:[],
- aoDrawCallback:[],aoRowCreatedCallback:[],aoPreDrawCallback:[],aoInitComplete:[],aoStateSaveParams:[],aoStateLoadParams:[],aoStateLoaded:[],sTableId:"",nTable:null,nTHead:null,nTFoot:null,nTBody:null,nTableWrapper:null,bDeferLoading:!1,bInitialised:!1,aoOpenRows:[],sDom:null,searchDelay:null,sPaginationType:"two_button",iStateDuration:0,aoStateSave:[],aoStateLoad:[],oSavedState:null,oLoadedState:null,sAjaxSource:null,sAjaxDataProp:null,bAjaxDataGet:!0,jqXHR:null,json:k,oAjaxData:k,fnServerData:null,
- aoServerParams:[],sServerMethod:null,fnFormatNumber:null,aLengthMenu:null,iDraw:0,bDrawing:!1,iDrawError:-1,_iDisplayLength:10,_iDisplayStart:0,_iRecordsTotal:0,_iRecordsDisplay:0,oClasses:{},bFiltered:!1,bSorted:!1,bSortCellsTop:null,oInit:null,aoDestroyCallback:[],fnRecordsTotal:function(){return"ssp"==y(this)?1*this._iRecordsTotal:this.aiDisplayMaster.length},fnRecordsDisplay:function(){return"ssp"==y(this)?1*this._iRecordsDisplay:this.aiDisplay.length},fnDisplayEnd:function(){var a=this._iDisplayLength,
- b=this._iDisplayStart,c=b+a,d=this.aiDisplay.length,e=this.oFeatures,f=e.bPaginate;return e.bServerSide?!1===f||-1===a?b+d:Math.min(b+a,this._iRecordsDisplay):!f||c>d||-1===a?d:c},oInstance:null,sInstance:null,iTabIndex:0,nScrollHead:null,nScrollFoot:null,aLastSort:[],oPlugins:{},rowIdFn:null,rowId:null};m.ext=x={buttons:{},classes:{},builder:"-source-",errMode:"alert",feature:[],search:[],selector:{cell:[],column:[],row:[]},internal:{},legacy:{ajax:null},pager:{},renderer:{pageButton:{},header:{}},
- order:{},type:{detect:[],search:{},order:{}},_unique:0,fnVersionCheck:m.fnVersionCheck,iApiIndex:0,oJUIClasses:{},sVersion:m.version};h.extend(x,{afnFiltering:x.search,aTypes:x.type.detect,ofnSearch:x.type.search,oSort:x.type.order,afnSortData:x.order,aoFeatures:x.feature,oApi:x.internal,oStdClasses:x.classes,oPagination:x.pager});h.extend(m.ext.classes,{sTable:"dataTable",sNoFooter:"no-footer",sPageButton:"paginate_button",sPageButtonActive:"current",sPageButtonDisabled:"disabled",sStripeOdd:"odd",
- sStripeEven:"even",sRowEmpty:"dataTables_empty",sWrapper:"dataTables_wrapper",sFilter:"dataTables_filter",sInfo:"dataTables_info",sPaging:"dataTables_paginate paging_",sLength:"dataTables_length",sProcessing:"dataTables_processing",sSortAsc:"sorting_asc",sSortDesc:"sorting_desc",sSortable:"sorting",sSortableAsc:"sorting_asc_disabled",sSortableDesc:"sorting_desc_disabled",sSortableNone:"sorting_disabled",sSortColumn:"sorting_",sFilterInput:"",sLengthSelect:"",sScrollWrapper:"dataTables_scroll",sScrollHead:"dataTables_scrollHead",
- sScrollHeadInner:"dataTables_scrollHeadInner",sScrollBody:"dataTables_scrollBody",sScrollFoot:"dataTables_scrollFoot",sScrollFootInner:"dataTables_scrollFootInner",sHeaderTH:"",sFooterTH:"",sSortJUIAsc:"",sSortJUIDesc:"",sSortJUI:"",sSortJUIAscAllowed:"",sSortJUIDescAllowed:"",sSortJUIWrapper:"",sSortIcon:"",sJUIHeader:"",sJUIFooter:""});var Kb=m.ext.pager;h.extend(Kb,{simple:function(){return["previous","next"]},full:function(){return["first","previous","next","last"]},numbers:function(a,b){return[ha(a,
- b)]},simple_numbers:function(a,b){return["previous",ha(a,b),"next"]},full_numbers:function(a,b){return["first","previous",ha(a,b),"next","last"]},first_last_numbers:function(a,b){return["first",ha(a,b),"last"]},_numbers:ha,numbers_length:7});h.extend(!0,m.ext.renderer,{pageButton:{_:function(a,b,c,d,e,f){var g=a.oClasses,j=a.oLanguage.oPaginate,i=a.oLanguage.oAria.paginate||{},n,l,m=0,o=function(b,d){var k,s,u,r,v=function(b){Sa(a,b.data.action,true)};k=0;for(s=d.length;k<s;k++){r=d[k];if(h.isArray(r)){u=
- h("<"+(r.DT_el||"div")+"/>").appendTo(b);o(u,r)}else{n=null;l="";switch(r){case "ellipsis":b.append('<span class="ellipsis">…</span>');break;case "first":n=j.sFirst;l=r+(e>0?"":" "+g.sPageButtonDisabled);break;case "previous":n=j.sPrevious;l=r+(e>0?"":" "+g.sPageButtonDisabled);break;case "next":n=j.sNext;l=r+(e<f-1?"":" "+g.sPageButtonDisabled);break;case "last":n=j.sLast;l=r+(e<f-1?"":" "+g.sPageButtonDisabled);break;default:n=r+1;l=e===r?g.sPageButtonActive:""}if(n!==null){u=h("<a>",{"class":g.sPageButton+
- " "+l,"aria-controls":a.sTableId,"aria-label":i[r],"data-dt-idx":m,tabindex:a.iTabIndex,id:c===0&&typeof r==="string"?a.sTableId+"_"+r:null}).html(n).appendTo(b);Va(u,{action:r},v);m++}}}},s;try{s=h(b).find(G.activeElement).data("dt-idx")}catch(u){}o(h(b).empty(),d);s!==k&&h(b).find("[data-dt-idx="+s+"]").focus()}}});h.extend(m.ext.type.detect,[function(a,b){var c=b.oLanguage.sDecimal;return Ya(a,c)?"num"+c:null},function(a){if(a&&!(a instanceof Date)&&!Zb.test(a))return null;var b=Date.parse(a);
- return null!==b&&!isNaN(b)||L(a)?"date":null},function(a,b){var c=b.oLanguage.sDecimal;return Ya(a,c,!0)?"num-fmt"+c:null},function(a,b){var c=b.oLanguage.sDecimal;return Pb(a,c)?"html-num"+c:null},function(a,b){var c=b.oLanguage.sDecimal;return Pb(a,c,!0)?"html-num-fmt"+c:null},function(a){return L(a)||"string"===typeof a&&-1!==a.indexOf("<")?"html":null}]);h.extend(m.ext.type.search,{html:function(a){return L(a)?a:"string"===typeof a?a.replace(Mb," ").replace(Aa,""):""},string:function(a){return L(a)?
- a:"string"===typeof a?a.replace(Mb," "):a}});var za=function(a,b,c,d){if(0!==a&&(!a||"-"===a))return-Infinity;b&&(a=Ob(a,b));a.replace&&(c&&(a=a.replace(c,"")),d&&(a=a.replace(d,"")));return 1*a};h.extend(x.type.order,{"date-pre":function(a){return Date.parse(a)||-Infinity},"html-pre":function(a){return L(a)?"":a.replace?a.replace(/<.*?>/g,"").toLowerCase():a+""},"string-pre":function(a){return L(a)?"":"string"===typeof a?a.toLowerCase():!a.toString?"":a.toString()},"string-asc":function(a,b){return a<
- b?-1:a>b?1:0},"string-desc":function(a,b){return a<b?1:a>b?-1:0}});cb("");h.extend(!0,m.ext.renderer,{header:{_:function(a,b,c,d){h(a.nTable).on("order.dt.DT",function(e,f,g,h){if(a===f){e=c.idx;b.removeClass(c.sSortingClass+" "+d.sSortAsc+" "+d.sSortDesc).addClass(h[e]=="asc"?d.sSortAsc:h[e]=="desc"?d.sSortDesc:c.sSortingClass)}})},jqueryui:function(a,b,c,d){h("<div/>").addClass(d.sSortJUIWrapper).append(b.contents()).append(h("<span/>").addClass(d.sSortIcon+" "+c.sSortingClassJUI)).appendTo(b);
- h(a.nTable).on("order.dt.DT",function(e,f,g,h){if(a===f){e=c.idx;b.removeClass(d.sSortAsc+" "+d.sSortDesc).addClass(h[e]=="asc"?d.sSortAsc:h[e]=="desc"?d.sSortDesc:c.sSortingClass);b.find("span."+d.sSortIcon).removeClass(d.sSortJUIAsc+" "+d.sSortJUIDesc+" "+d.sSortJUI+" "+d.sSortJUIAscAllowed+" "+d.sSortJUIDescAllowed).addClass(h[e]=="asc"?d.sSortJUIAsc:h[e]=="desc"?d.sSortJUIDesc:c.sSortingClassJUI)}})}}});var Vb=function(a){return"string"===typeof a?a.replace(/</g,"<").replace(/>/g,">").replace(/"/g,
- """):a};m.render={number:function(a,b,c,d,e){return{display:function(f){if("number"!==typeof f&&"string"!==typeof f)return f;var g=0>f?"-":"",h=parseFloat(f);if(isNaN(h))return Vb(f);h=h.toFixed(c);f=Math.abs(h);h=parseInt(f,10);f=c?b+(f-h).toFixed(c).substring(2):"";return g+(d||"")+h.toString().replace(/\B(?=(\d{3})+(?!\d))/g,a)+f+(e||"")}}},text:function(){return{display:Vb}}};h.extend(m.ext.internal,{_fnExternApiFunc:Lb,_fnBuildAjax:sa,_fnAjaxUpdate:kb,_fnAjaxParameters:tb,_fnAjaxUpdateDraw:ub,
- _fnAjaxDataSrc:ta,_fnAddColumn:Da,_fnColumnOptions:ja,_fnAdjustColumnSizing:Y,_fnVisibleToColumnIndex:Z,_fnColumnIndexToVisible:$,_fnVisbleColumns:aa,_fnGetColumns:la,_fnColumnTypes:Fa,_fnApplyColumnDefs:hb,_fnHungarianMap:X,_fnCamelToHungarian:I,_fnLanguageCompat:Ca,_fnBrowserDetect:fb,_fnAddData:M,_fnAddTr:ma,_fnNodeToDataIndex:function(a,b){return b._DT_RowIndex!==k?b._DT_RowIndex:null},_fnNodeToColumnIndex:function(a,b,c){return h.inArray(c,a.aoData[b].anCells)},_fnGetCellData:B,_fnSetCellData:ib,
- _fnSplitObjNotation:Ia,_fnGetObjectDataFn:Q,_fnSetObjectDataFn:R,_fnGetDataMaster:Ja,_fnClearTable:na,_fnDeleteIndex:oa,_fnInvalidate:ca,_fnGetRowElements:Ha,_fnCreateTr:Ga,_fnBuildHead:jb,_fnDrawHead:ea,_fnDraw:N,_fnReDraw:S,_fnAddOptionsHtml:mb,_fnDetectHeader:da,_fnGetUniqueThs:ra,_fnFeatureHtmlFilter:ob,_fnFilterComplete:fa,_fnFilterCustom:xb,_fnFilterColumn:wb,_fnFilter:vb,_fnFilterCreateSearch:Oa,_fnEscapeRegex:Pa,_fnFilterData:yb,_fnFeatureHtmlInfo:rb,_fnUpdateInfo:Bb,_fnInfoMacros:Cb,_fnInitialise:ga,
- _fnInitComplete:ua,_fnLengthChange:Qa,_fnFeatureHtmlLength:nb,_fnFeatureHtmlPaginate:sb,_fnPageChange:Sa,_fnFeatureHtmlProcessing:pb,_fnProcessingDisplay:C,_fnFeatureHtmlTable:qb,_fnScrollDraw:ka,_fnApplyToChildren:H,_fnCalculateColumnWidths:Ea,_fnThrottle:Na,_fnConvertToWidth:Db,_fnGetWidestNode:Eb,_fnGetMaxLenString:Fb,_fnStringToCss:v,_fnSortFlatten:V,_fnSort:lb,_fnSortAria:Hb,_fnSortListener:Ua,_fnSortAttachListener:La,_fnSortingClasses:wa,_fnSortData:Gb,_fnSaveState:xa,_fnLoadState:Ib,_fnSettingsFromNode:ya,
- _fnLog:J,_fnMap:F,_fnBindAction:Va,_fnCallbackReg:z,_fnCallbackFire:r,_fnLengthOverflow:Ra,_fnRenderer:Ma,_fnDataSource:y,_fnRowAttributes:Ka,_fnCalculateEnd:function(){}});h.fn.dataTable=m;m.$=h;h.fn.dataTableSettings=m.settings;h.fn.dataTableExt=m.ext;h.fn.DataTable=function(a){return h(this).dataTable(a).api()};h.each(m,function(a,b){h.fn.DataTable[a]=b});return h.fn.dataTable});
- /*!
- DataTables Bootstrap 3 integration
- ©2011-2014 SpryMedia Ltd - datatables.net/license
- */
- (function(l,q){var e=function(b,c){b.extend(!0,c.defaults,{dom:"<'row'<'col-sm-6'l><'col-sm-6'f>><'row'<'col-sm-12'tr>><'row'<'col-sm-5'i><'col-sm-7'p>>",renderer:"bootstrap"});b.extend(c.ext.classes,{sWrapper:"dataTables_wrapper form-inline dt-bootstrap",sFilterInput:"form-control input-sm",sLengthSelect:"form-control input-sm"});c.ext.renderer.pageButton.bootstrap=function(g,e,r,s,i,m){var t=new c.Api(g),u=g.oClasses,j=g.oLanguage.oPaginate,d,f,n=0,p=function(c,e){var k,h,o,a,l=function(a){a.preventDefault();
- b(a.currentTarget).hasClass("disabled")||t.page(a.data.action).draw(!1)};k=0;for(h=e.length;k<h;k++)if(a=e[k],b.isArray(a))p(c,a);else{f=d="";switch(a){case "ellipsis":d="…";f="disabled";break;case "first":d=j.sFirst;f=a+(0<i?"":" disabled");break;case "previous":d=j.sPrevious;f=a+(0<i?"":" disabled");break;case "next":d=j.sNext;f=a+(i<m-1?"":" disabled");break;case "last":d=j.sLast;f=a+(i<m-1?"":" disabled");break;default:d=a+1,f=i===a?"active":""}d&&(o=b("<li>",{"class":u.sPageButton+" "+
- f,id:0===r&&"string"===typeof a?g.sTableId+"_"+a:null}).append(b("<a>",{href:"#","aria-controls":g.sTableId,"data-dt-idx":n,tabindex:g.iTabIndex}).html(d)).appendTo(c),g.oApi._fnBindAction(o,{action:a},l),n++)}},h;try{h=b(q.activeElement).data("dt-idx")}catch(l){}p(b(e).empty().html('<ul class="pagination"/>').children("ul"),s);h&&b(e).find("[data-dt-idx="+h+"]").focus()};c.TableTools&&(b.extend(!0,c.TableTools.classes,{container:"DTTT btn-group",buttons:{normal:"btn btn-default",disabled:"disabled"},
- collection:{container:"DTTT_dropdown dropdown-menu",buttons:{normal:"",disabled:"disabled"}},print:{info:"DTTT_print_info"},select:{row:"active"}}),b.extend(!0,c.TableTools.DEFAULTS.oTags,{collection:{container:"ul",button:"li",liner:"a"}}))};"function"===typeof define&&define.amd?define(["jquery","datatables"],e):"object"===typeof exports?e(require("jquery"),require("datatables")):jQuery&&e(jQuery,jQuery.fn.dataTable)})(window,document);
- /*! TableTools 2.2.4
- * 2009-2015 SpryMedia Ltd - datatables.net/license
- *
- * ZeroClipboard 1.0.4
- * Author: Joseph Huckaby - MIT licensed
- */
- /**
- * @summary TableTools
- * @description Tools and buttons for DataTables
- * @version 2.2.4
- * @file dataTables.tableTools.js
- * @author SpryMedia Ltd (www.sprymedia.co.uk)
- * @contact www.sprymedia.co.uk/contact
- * @copyright Copyright 2009-2015 SpryMedia Ltd.
- *
- * This source file is free software, available under the following license:
- * MIT license - http://datatables.net/license/mit
- *
- * This source file is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE. See the license files for details.
- *
- * For details please refer to: http://www.datatables.net
- */
- /* Global scope for TableTools for backwards compatibility.
- * Will be removed in 2.3
- */
- var TableTools;
- (function(window, document, undefined) {
- var factory = function( $, DataTable ) {
- "use strict";
- //include ZeroClipboard.js
- /* ZeroClipboard 1.0.4
- * Author: Joseph Huckaby
- */
- var ZeroClipboard_TableTools = {
- version: "1.0.4-TableTools2",
- clients: {}, // registered upload clients on page, indexed by id
- moviePath: '', // URL to movie
- nextId: 1, // ID of next movie
- $: function(thingy) {
- // simple DOM lookup utility function
- if (typeof(thingy) == 'string') {
- thingy = document.getElementById(thingy);
- }
- if (!thingy.addClass) {
- // extend element with a few useful methods
- thingy.hide = function() { this.style.display = 'none'; };
- thingy.show = function() { this.style.display = ''; };
- thingy.addClass = function(name) { this.removeClass(name); this.className += ' ' + name; };
- thingy.removeClass = function(name) {
- this.className = this.className.replace( new RegExp("\\s*" + name + "\\s*"), " ").replace(/^\s+/, '').replace(/\s+$/, '');
- };
- thingy.hasClass = function(name) {
- return !!this.className.match( new RegExp("\\s*" + name + "\\s*") );
- };
- }
- return thingy;
- },
- setMoviePath: function(path) {
- // set path to ZeroClipboard.swf
- this.moviePath = path;
- },
- dispatch: function(id, eventName, args) {
- // receive event from flash movie, send to client
- var client = this.clients[id];
- if (client) {
- client.receiveEvent(eventName, args);
- }
- },
- register: function(id, client) {
- // register new client to receive events
- this.clients[id] = client;
- },
- getDOMObjectPosition: function(obj) {
- // get absolute coordinates for dom element
- var info = {
- left: 0,
- top: 0,
- width: obj.width ? obj.width : obj.offsetWidth,
- height: obj.height ? obj.height : obj.offsetHeight
- };
- if ( obj.style.width !== "" ) {
- info.width = obj.style.width.replace("px","");
- }
- if ( obj.style.height !== "" ) {
- info.height = obj.style.height.replace("px","");
- }
- while (obj) {
- info.left += obj.offsetLeft;
- info.top += obj.offsetTop;
- obj = obj.offsetParent;
- }
- return info;
- },
- Client: function(elem) {
- // constructor for new simple upload client
- this.handlers = {};
- // unique ID
- this.id = ZeroClipboard_TableTools.nextId++;
- this.movieId = 'ZeroClipboard_TableToolsMovie_' + this.id;
- // register client with singleton to receive flash events
- ZeroClipboard_TableTools.register(this.id, this);
- // create movie
- if (elem) {
- this.glue(elem);
- }
- }
- };
- ZeroClipboard_TableTools.Client.prototype = {
- id: 0, // unique ID for us
- ready: false, // whether movie is ready to receive events or not
- movie: null, // reference to movie object
- clipText: '', // text to copy to clipboard
- fileName: '', // default file save name
- action: 'copy', // action to perform
- handCursorEnabled: true, // whether to show hand cursor, or default pointer cursor
- cssEffects: true, // enable CSS mouse effects on dom container
- handlers: null, // user event handlers
- sized: false,
- glue: function(elem, title) {
- // glue to DOM element
- // elem can be ID or actual DOM element object
- this.domElement = ZeroClipboard_TableTools.$(elem);
- // float just above object, or zIndex 99 if dom element isn't set
- var zIndex = 99;
- if (this.domElement.style.zIndex) {
- zIndex = parseInt(this.domElement.style.zIndex, 10) + 1;
- }
- // find X/Y position of domElement
- var box = ZeroClipboard_TableTools.getDOMObjectPosition(this.domElement);
- // create floating DIV above element
- this.div = document.createElement('div');
- var style = this.div.style;
- style.position = 'absolute';
- style.left = '0px';
- style.top = '0px';
- style.width = (box.width) + 'px';
- style.height = box.height + 'px';
- style.zIndex = zIndex;
- if ( typeof title != "undefined" && title !== "" ) {
- this.div.title = title;
- }
- if ( box.width !== 0 && box.height !== 0 ) {
- this.sized = true;
- }
- // style.backgroundColor = '#f00'; // debug
- if ( this.domElement ) {
- this.domElement.appendChild(this.div);
- this.div.innerHTML = this.getHTML( box.width, box.height ).replace(/&/g, '&');
- }
- },
- positionElement: function() {
- var box = ZeroClipboard_TableTools.getDOMObjectPosition(this.domElement);
- var style = this.div.style;
- style.position = 'absolute';
- //style.left = (this.domElement.offsetLeft)+'px';
- //style.top = this.domElement.offsetTop+'px';
- style.width = box.width + 'px';
- style.height = box.height + 'px';
- if ( box.width !== 0 && box.height !== 0 ) {
- this.sized = true;
- } else {
- return;
- }
- var flash = this.div.childNodes[0];
- flash.width = box.width;
- flash.height = box.height;
- },
- getHTML: function(width, height) {
- // return HTML for movie
- var html = '';
- var flashvars = 'id=' + this.id +
- '&width=' + width +
- '&height=' + height;
- if (navigator.userAgent.match(/MSIE/)) {
- // IE gets an OBJECT tag
- var protocol = location.href.match(/^https/i) ? 'https://' : 'http://';
- html += '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="'+protocol+'download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0" width="'+width+'" height="'+height+'" id="'+this.movieId+'" align="middle"><param name="allowScriptAccess" value="always" /><param name="allowFullScreen" value="false" /><param name="movie" value="'+ZeroClipboard_TableTools.moviePath+'" /><param name="loop" value="false" /><param name="menu" value="false" /><param name="quality" value="best" /><param name="bgcolor" value="#ffffff" /><param name="flashvars" value="'+flashvars+'"/><param name="wmode" value="transparent"/></object>';
- }
- else {
- // all other browsers get an EMBED tag
- html += '<embed id="'+this.movieId+'" src="'+ZeroClipboard_TableTools.moviePath+'" loop="false" menu="false" quality="best" bgcolor="#ffffff" width="'+width+'" height="'+height+'" name="'+this.movieId+'" align="middle" allowScriptAccess="always" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="'+flashvars+'" wmode="transparent" />';
- }
- return html;
- },
- hide: function() {
- // temporarily hide floater offscreen
- if (this.div) {
- this.div.style.left = '-2000px';
- }
- },
- show: function() {
- // show ourselves after a call to hide()
- this.reposition();
- },
- destroy: function() {
- // destroy control and floater
- if (this.domElement && this.div) {
- this.hide();
- this.div.innerHTML = '';
- var body = document.getElementsByTagName('body')[0];
- try { body.removeChild( this.div ); } catch(e) {}
- this.domElement = null;
- this.div = null;
- }
- },
- reposition: function(elem) {
- // reposition our floating div, optionally to new container
- // warning: container CANNOT change size, only position
- if (elem) {
- this.domElement = ZeroClipboard_TableTools.$(elem);
- if (!this.domElement) {
- this.hide();
- }
- }
- if (this.domElement && this.div) {
- var box = ZeroClipboard_TableTools.getDOMObjectPosition(this.domElement);
- var style = this.div.style;
- style.left = '' + box.left + 'px';
- style.top = '' + box.top + 'px';
- }
- },
- clearText: function() {
- // clear the text to be copy / saved
- this.clipText = '';
- if (this.ready) {
- this.movie.clearText();
- }
- },
- appendText: function(newText) {
- // append text to that which is to be copied / saved
- this.clipText += newText;
- if (this.ready) { this.movie.appendText(newText) ;}
- },
- setText: function(newText) {
- // set text to be copied to be copied / saved
- this.clipText = newText;
- if (this.ready) { this.movie.setText(newText) ;}
- },
- setCharSet: function(charSet) {
- // set the character set (UTF16LE or UTF8)
- this.charSet = charSet;
- if (this.ready) { this.movie.setCharSet(charSet) ;}
- },
- setBomInc: function(bomInc) {
- // set if the BOM should be included or not
- this.incBom = bomInc;
- if (this.ready) { this.movie.setBomInc(bomInc) ;}
- },
- setFileName: function(newText) {
- // set the file name
- this.fileName = newText;
- if (this.ready) {
- this.movie.setFileName(newText);
- }
- },
- setAction: function(newText) {
- // set action (save or copy)
- this.action = newText;
- if (this.ready) {
- this.movie.setAction(newText);
- }
- },
- addEventListener: function(eventName, func) {
- // add user event listener for event
- // event types: load, queueStart, fileStart, fileComplete, queueComplete, progress, error, cancel
- eventName = eventName.toString().toLowerCase().replace(/^on/, '');
- if (!this.handlers[eventName]) {
- this.handlers[eventName] = [];
- }
- this.handlers[eventName].push(func);
- },
- setHandCursor: function(enabled) {
- // enable hand cursor (true), or default arrow cursor (false)
- this.handCursorEnabled = enabled;
- if (this.ready) {
- this.movie.setHandCursor(enabled);
- }
- },
- setCSSEffects: function(enabled) {
- // enable or disable CSS effects on DOM container
- this.cssEffects = !!enabled;
- },
- receiveEvent: function(eventName, args) {
- var self;
- // receive event from flash
- eventName = eventName.toString().toLowerCase().replace(/^on/, '');
- // special behavior for certain events
- switch (eventName) {
- case 'load':
- // movie claims it is ready, but in IE this isn't always the case...
- // bug fix: Cannot extend EMBED DOM elements in Firefox, must use traditional function
- this.movie = document.getElementById(this.movieId);
- if (!this.movie) {
- self = this;
- setTimeout( function() { self.receiveEvent('load', null); }, 1 );
- return;
- }
- // firefox on pc needs a "kick" in order to set these in certain cases
- if (!this.ready && navigator.userAgent.match(/Firefox/) && navigator.userAgent.match(/Windows/)) {
- self = this;
- setTimeout( function() { self.receiveEvent('load', null); }, 100 );
- this.ready = true;
- return;
- }
- this.ready = true;
- this.movie.clearText();
- this.movie.appendText( this.clipText );
- this.movie.setFileName( this.fileName );
- this.movie.setAction( this.action );
- this.movie.setCharSet( this.charSet );
- this.movie.setBomInc( this.incBom );
- this.movie.setHandCursor( this.handCursorEnabled );
- break;
- case 'mouseover':
- if (this.domElement && this.cssEffects) {
- //this.domElement.addClass('hover');
- if (this.recoverActive) {
- this.domElement.addClass('active');
- }
- }
- break;
- case 'mouseout':
- if (this.domElement && this.cssEffects) {
- this.recoverActive = false;
- if (this.domElement.hasClass('active')) {
- this.domElement.removeClass('active');
- this.recoverActive = true;
- }
- //this.domElement.removeClass('hover');
- }
- break;
- case 'mousedown':
- if (this.domElement && this.cssEffects) {
- this.domElement.addClass('active');
- }
- break;
- case 'mouseup':
- if (this.domElement && this.cssEffects) {
- this.domElement.removeClass('active');
- this.recoverActive = false;
- }
- break;
- } // switch eventName
- if (this.handlers[eventName]) {
- for (var idx = 0, len = this.handlers[eventName].length; idx < len; idx++) {
- var func = this.handlers[eventName][idx];
- if (typeof(func) == 'function') {
- // actual function reference
- func(this, args);
- }
- else if ((typeof(func) == 'object') && (func.length == 2)) {
- // PHP style object + method, i.e. [myObject, 'myMethod']
- func[0][ func[1] ](this, args);
- }
- else if (typeof(func) == 'string') {
- // name of function
- window[func](this, args);
- }
- } // foreach event handler defined
- } // user defined handler for event
- }
- };
- // For the Flash binding to work, ZeroClipboard_TableTools must be on the global
- // object list
- window.ZeroClipboard_TableTools = ZeroClipboard_TableTools;
- //include TableTools.js
- /* TableTools
- * 2009-2015 SpryMedia Ltd - datatables.net/license
- */
- /*globals TableTools,ZeroClipboard_TableTools*/
- (function($, window, document) {
- /**
- * TableTools provides flexible buttons and other tools for a DataTables enhanced table
- * @class TableTools
- * @constructor
- * @param {Object} oDT DataTables instance. When using DataTables 1.10 this can
- * also be a jQuery collection, jQuery selector, table node, DataTables API
- * instance or DataTables settings object.
- * @param {Object} oOpts TableTools options
- * @param {String} oOpts.sSwfPath ZeroClipboard SWF path
- * @param {String} oOpts.sRowSelect Row selection options - 'none', 'single', 'multi' or 'os'
- * @param {Function} oOpts.fnPreRowSelect Callback function just prior to row selection
- * @param {Function} oOpts.fnRowSelected Callback function just after row selection
- * @param {Function} oOpts.fnRowDeselected Callback function when row is deselected
- * @param {Array} oOpts.aButtons List of buttons to be used
- */
- TableTools = function( oDT, oOpts )
- {
- /* Santiy check that we are a new instance */
- if ( ! this instanceof TableTools )
- {
- alert( "Warning: TableTools must be initialised with the keyword 'new'" );
- }
- // In 1.10 we can use the API to get the settings object from a number of
- // sources
- var dtSettings = $.fn.dataTable.Api ?
- new $.fn.dataTable.Api( oDT ).settings()[0] :
- oDT.fnSettings();
- /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * Public class variables
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
- /**
- * @namespace Settings object which contains customisable information for TableTools instance
- */
- this.s = {
- /**
- * Store 'this' so the instance can be retrieved from the settings object
- * @property that
- * @type object
- * @default this
- */
- "that": this,
- /**
- * DataTables settings objects
- * @property dt
- * @type object
- * @default <i>From the oDT init option</i>
- */
- "dt": dtSettings,
- /**
- * @namespace Print specific information
- */
- "print": {
- /**
- * DataTables draw 'start' point before the printing display was shown
- * @property saveStart
- * @type int
- * @default -1
- */
- "saveStart": -1,
- /**
- * DataTables draw 'length' point before the printing display was shown
- * @property saveLength
- * @type int
- * @default -1
- */
- "saveLength": -1,
- /**
- * Page scrolling point before the printing display was shown so it can be restored
- * @property saveScroll
- * @type int
- * @default -1
- */
- "saveScroll": -1,
- /**
- * Wrapped function to end the print display (to maintain scope)
- * @property funcEnd
- * @type Function
- * @default function () {}
- */
- "funcEnd": function () {}
- },
- /**
- * A unique ID is assigned to each button in each instance
- * @property buttonCounter
- * @type int
- * @default 0
- */
- "buttonCounter": 0,
- /**
- * @namespace Select rows specific information
- */
- "select": {
- /**
- * Select type - can be 'none', 'single' or 'multi'
- * @property type
- * @type string
- * @default ""
- */
- "type": "",
- /**
- * Array of nodes which are currently selected
- * @property selected
- * @type array
- * @default []
- */
- "selected": [],
- /**
- * Function to run before the selection can take place. Will cancel the select if the
- * function returns false
- * @property preRowSelect
- * @type Function
- * @default null
- */
- "preRowSelect": null,
- /**
- * Function to run when a row is selected
- * @property postSelected
- * @type Function
- * @default null
- */
- "postSelected": null,
- /**
- * Function to run when a row is deselected
- * @property postDeselected
- * @type Function
- * @default null
- */
- "postDeselected": null,
- /**
- * Indicate if all rows are selected (needed for server-side processing)
- * @property all
- * @type boolean
- * @default false
- */
- "all": false,
- /**
- * Class name to add to selected TR nodes
- * @property selectedClass
- * @type String
- * @default ""
- */
- "selectedClass": ""
- },
- /**
- * Store of the user input customisation object
- * @property custom
- * @type object
- * @default {}
- */
- "custom": {},
- /**
- * SWF movie path
- * @property swfPath
- * @type string
- * @default ""
- */
- "swfPath": "",
- /**
- * Default button set
- * @property buttonSet
- * @type array
- * @default []
- */
- "buttonSet": [],
- /**
- * When there is more than one TableTools instance for a DataTable, there must be a
- * master which controls events (row selection etc)
- * @property master
- * @type boolean
- * @default false
- */
- "master": false,
- /**
- * Tag names that are used for creating collections and buttons
- * @namesapce
- */
- "tags": {}
- };
- /**
- * @namespace Common and useful DOM elements for the class instance
- */
- this.dom = {
- /**
- * DIV element that is create and all TableTools buttons (and their children) put into
- * @property container
- * @type node
- * @default null
- */
- "container": null,
- /**
- * The table node to which TableTools will be applied
- * @property table
- * @type node
- * @default null
- */
- "table": null,
- /**
- * @namespace Nodes used for the print display
- */
- "print": {
- /**
- * Nodes which have been removed from the display by setting them to display none
- * @property hidden
- * @type array
- * @default []
- */
- "hidden": [],
- /**
- * The information display saying telling the user about the print display
- * @property message
- * @type node
- * @default null
- */
- "message": null
- },
- /**
- * @namespace Nodes used for a collection display. This contains the currently used collection
- */
- "collection": {
- /**
- * The div wrapper containing the buttons in the collection (i.e. the menu)
- * @property collection
- * @type node
- * @default null
- */
- "collection": null,
- /**
- * Background display to provide focus and capture events
- * @property background
- * @type node
- * @default null
- */
- "background": null
- }
- };
- /**
- * @namespace Name space for the classes that this TableTools instance will use
- * @extends TableTools.classes
- */
- this.classes = $.extend( true, {}, TableTools.classes );
- if ( this.s.dt.bJUI )
- {
- $.extend( true, this.classes, TableTools.classes_themeroller );
- }
- /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * Public class methods
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
- /**
- * Retreieve the settings object from an instance
- * @method fnSettings
- * @returns {object} TableTools settings object
- */
- this.fnSettings = function () {
- return this.s;
- };
- /* Constructor logic */
- if ( typeof oOpts == 'undefined' )
- {
- oOpts = {};
- }
- TableTools._aInstances.push( this );
- this._fnConstruct( oOpts );
- return this;
- };
- TableTools.prototype = {
- /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * Public methods
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
- /**
- * Retreieve the settings object from an instance
- * @returns {array} List of TR nodes which are currently selected
- * @param {boolean} [filtered=false] Get only selected rows which are
- * available given the filtering applied to the table. By default
- * this is false - i.e. all rows, regardless of filtering are
- selected.
- */
- "fnGetSelected": function ( filtered )
- {
- var
- out = [],
- data = this.s.dt.aoData,
- displayed = this.s.dt.aiDisplay,
- i, iLen;
- if ( filtered )
- {
- // Only consider filtered rows
- for ( i=0, iLen=displayed.length ; i<iLen ; i++ )
- {
- if ( data[ displayed[i] ]._DTTT_selected )
- {
- out.push( data[ displayed[i] ].nTr );
- }
- }
- }
- else
- {
- // Use all rows
- for ( i=0, iLen=data.length ; i<iLen ; i++ )
- {
- if ( data[i]._DTTT_selected )
- {
- out.push( data[i].nTr );
- }
- }
- }
- return out;
- },
- /**
- * Get the data source objects/arrays from DataTables for the selected rows (same as
- * fnGetSelected followed by fnGetData on each row from the table)
- * @returns {array} Data from the TR nodes which are currently selected
- */
- "fnGetSelectedData": function ()
- {
- var out = [];
- var data=this.s.dt.aoData;
- var i, iLen;
- for ( i=0, iLen=data.length ; i<iLen ; i++ )
- {
- if ( data[i]._DTTT_selected )
- {
- out.push( this.s.dt.oInstance.fnGetData(i) );
- }
- }
- return out;
- },
- /**
- * Get the indexes of the selected rows
- * @returns {array} List of row indexes
- * @param {boolean} [filtered=false] Get only selected rows which are
- * available given the filtering applied to the table. By default
- * this is false - i.e. all rows, regardless of filtering are
- selected.
- */
- "fnGetSelectedIndexes": function ( filtered )
- {
- var
- out = [],
- data = this.s.dt.aoData,
- displayed = this.s.dt.aiDisplay,
- i, iLen;
- if ( filtered )
- {
- // Only consider filtered rows
- for ( i=0, iLen=displayed.length ; i<iLen ; i++ )
- {
- if ( data[ displayed[i] ]._DTTT_selected )
- {
- out.push( displayed[i] );
- }
- }
- }
- else
- {
- // Use all rows
- for ( i=0, iLen=data.length ; i<iLen ; i++ )
- {
- if ( data[i]._DTTT_selected )
- {
- out.push( i );
- }
- }
- }
- return out;
- },
- /**
- * Check to see if a current row is selected or not
- * @param {Node} n TR node to check if it is currently selected or not
- * @returns {Boolean} true if select, false otherwise
- */
- "fnIsSelected": function ( n )
- {
- var pos = this.s.dt.oInstance.fnGetPosition( n );
- return (this.s.dt.aoData[pos]._DTTT_selected===true) ? true : false;
- },
- /**
- * Select all rows in the table
- * @param {boolean} [filtered=false] Select only rows which are available
- * given the filtering applied to the table. By default this is false -
- * i.e. all rows, regardless of filtering are selected.
- */
- "fnSelectAll": function ( filtered )
- {
- this._fnRowSelect( filtered ?
- this.s.dt.aiDisplay :
- this.s.dt.aoData
- );
- },
- /**
- * Deselect all rows in the table
- * @param {boolean} [filtered=false] Deselect only rows which are available
- * given the filtering applied to the table. By default this is false -
- * i.e. all rows, regardless of filtering are deselected.
- */
- "fnSelectNone": function ( filtered )
- {
- this._fnRowDeselect( this.fnGetSelectedIndexes(filtered) );
- },
- /**
- * Select row(s)
- * @param {node|object|array} n The row(s) to select. Can be a single DOM
- * TR node, an array of TR nodes or a jQuery object.
- */
- "fnSelect": function ( n )
- {
- if ( this.s.select.type == "single" )
- {
- this.fnSelectNone();
- this._fnRowSelect( n );
- }
- else
- {
- this._fnRowSelect( n );
- }
- },
- /**
- * Deselect row(s)
- * @param {node|object|array} n The row(s) to deselect. Can be a single DOM
- * TR node, an array of TR nodes or a jQuery object.
- */
- "fnDeselect": function ( n )
- {
- this._fnRowDeselect( n );
- },
- /**
- * Get the title of the document - useful for file names. The title is retrieved from either
- * the configuration object's 'title' parameter, or the HTML document title
- * @param {Object} oConfig Button configuration object
- * @returns {String} Button title
- */
- "fnGetTitle": function( oConfig )
- {
- var sTitle = "";
- if ( typeof oConfig.sTitle != 'undefined' && oConfig.sTitle !== "" ) {
- sTitle = oConfig.sTitle;
- } else {
- var anTitle = document.getElementsByTagName('title');
- if ( anTitle.length > 0 )
- {
- sTitle = anTitle[0].innerHTML;
- }
- }
- /* Strip characters which the OS will object to - checking for UTF8 support in the scripting
- * engine
- */
- if ( "\u00A1".toString().length < 4 ) {
- return sTitle.replace(/[^a-zA-Z0-9_\u00A1-\uFFFF\.,\-_ !\(\)]/g, "");
- } else {
- return sTitle.replace(/[^a-zA-Z0-9_\.,\-_ !\(\)]/g, "");
- }
- },
- /**
- * Calculate a unity array with the column width by proportion for a set of columns to be
- * included for a button. This is particularly useful for PDF creation, where we can use the
- * column widths calculated by the browser to size the columns in the PDF.
- * @param {Object} oConfig Button configuration object
- * @returns {Array} Unity array of column ratios
- */
- "fnCalcColRatios": function ( oConfig )
- {
- var
- aoCols = this.s.dt.aoColumns,
- aColumnsInc = this._fnColumnTargets( oConfig.mColumns ),
- aColWidths = [],
- iWidth = 0, iTotal = 0, i, iLen;
- for ( i=0, iLen=aColumnsInc.length ; i<iLen ; i++ )
- {
- if ( aColumnsInc[i] )
- {
- iWidth = aoCols[i].nTh.offsetWidth;
- iTotal += iWidth;
- aColWidths.push( iWidth );
- }
- }
- for ( i=0, iLen=aColWidths.length ; i<iLen ; i++ )
- {
- aColWidths[i] = aColWidths[i] / iTotal;
- }
- return aColWidths.join('\t');
- },
- /**
- * Get the information contained in a table as a string
- * @param {Object} oConfig Button configuration object
- * @returns {String} Table data as a string
- */
- "fnGetTableData": function ( oConfig )
- {
- /* In future this could be used to get data from a plain HTML source as well as DataTables */
- if ( this.s.dt )
- {
- return this._fnGetDataTablesData( oConfig );
- }
- },
- /**
- * Pass text to a flash button instance, which will be used on the button's click handler
- * @param {Object} clip Flash button object
- * @param {String} text Text to set
- */
- "fnSetText": function ( clip, text )
- {
- this._fnFlashSetText( clip, text );
- },
- /**
- * Resize the flash elements of the buttons attached to this TableTools instance - this is
- * useful for when initialising TableTools when it is hidden (display:none) since sizes can't
- * be calculated at that time.
- */
- "fnResizeButtons": function ()
- {
- for ( var cli in ZeroClipboard_TableTools.clients )
- {
- if ( cli )
- {
- var client = ZeroClipboard_TableTools.clients[cli];
- if ( typeof client.domElement != 'undefined' &&
- client.domElement.parentNode )
- {
- client.positionElement();
- }
- }
- }
- },
- /**
- * Check to see if any of the ZeroClipboard client's attached need to be resized
- */
- "fnResizeRequired": function ()
- {
- for ( var cli in ZeroClipboard_TableTools.clients )
- {
- if ( cli )
- {
- var client = ZeroClipboard_TableTools.clients[cli];
- if ( typeof client.domElement != 'undefined' &&
- client.domElement.parentNode == this.dom.container &&
- client.sized === false )
- {
- return true;
- }
- }
- }
- return false;
- },
- /**
- * Programmatically enable or disable the print view
- * @param {boolean} [bView=true] Show the print view if true or not given. If false, then
- * terminate the print view and return to normal.
- * @param {object} [oConfig={}] Configuration for the print view
- * @param {boolean} [oConfig.bShowAll=false] Show all rows in the table if true
- * @param {string} [oConfig.sInfo] Information message, displayed as an overlay to the
- * user to let them know what the print view is.
- * @param {string} [oConfig.sMessage] HTML string to show at the top of the document - will
- * be included in the printed document.
- */
- "fnPrint": function ( bView, oConfig )
- {
- if ( oConfig === undefined )
- {
- oConfig = {};
- }
- if ( bView === undefined || bView )
- {
- this._fnPrintStart( oConfig );
- }
- else
- {
- this._fnPrintEnd();
- }
- },
- /**
- * Show a message to the end user which is nicely styled
- * @param {string} message The HTML string to show to the user
- * @param {int} time The duration the message is to be shown on screen for (mS)
- */
- "fnInfo": function ( message, time ) {
- var info = $('<div/>')
- .addClass( this.classes.print.info )
- .html( message )
- .appendTo( 'body' );
- setTimeout( function() {
- info.fadeOut( "normal", function() {
- info.remove();
- } );
- }, time );
- },
- /**
- * Get the container element of the instance for attaching to the DOM
- * @returns {node} DOM node
- */
- "fnContainer": function () {
- return this.dom.container;
- },
- /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * Private methods (they are of course public in JS, but recommended as private)
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
- /**
- * Constructor logic
- * @method _fnConstruct
- * @param {Object} oOpts Same as TableTools constructor
- * @returns void
- * @private
- */
- "_fnConstruct": function ( oOpts )
- {
- var that = this;
- this._fnCustomiseSettings( oOpts );
- /* Container element */
- this.dom.container = document.createElement( this.s.tags.container );
- this.dom.container.className = this.classes.container;
- /* Row selection config */
- if ( this.s.select.type != 'none' )
- {
- this._fnRowSelectConfig();
- }
- /* Buttons */
- this._fnButtonDefinations( this.s.buttonSet, this.dom.container );
- /* Destructor */
- this.s.dt.aoDestroyCallback.push( {
- "sName": "TableTools",
- "fn": function () {
- $(that.s.dt.nTBody)
- .off( 'click.DTTT_Select', that.s.custom.sRowSelector )
- .off( 'mousedown.DTTT_Select', 'tr' )
- .off( 'mouseup.DTTT_Select', 'tr' );
- $(that.dom.container).empty();
- // Remove the instance
- var idx = $.inArray( that, TableTools._aInstances );
- if ( idx !== -1 ) {
- TableTools._aInstances.splice( idx, 1 );
- }
- }
- } );
- },
- /**
- * Take the user defined settings and the default settings and combine them.
- * @method _fnCustomiseSettings
- * @param {Object} oOpts Same as TableTools constructor
- * @returns void
- * @private
- */
- "_fnCustomiseSettings": function ( oOpts )
- {
- /* Is this the master control instance or not? */
- if ( typeof this.s.dt._TableToolsInit == 'undefined' )
- {
- this.s.master = true;
- this.s.dt._TableToolsInit = true;
- }
- /* We can use the table node from comparisons to group controls */
- this.dom.table = this.s.dt.nTable;
- /* Clone the defaults and then the user options */
- this.s.custom = $.extend( {}, TableTools.DEFAULTS, oOpts );
- /* Flash file location */
- this.s.swfPath = this.s.custom.sSwfPath;
- if ( typeof ZeroClipboard_TableTools != 'undefined' )
- {
- ZeroClipboard_TableTools.moviePath = this.s.swfPath;
- }
- /* Table row selecting */
- this.s.select.type = this.s.custom.sRowSelect;
- this.s.select.preRowSelect = this.s.custom.fnPreRowSelect;
- this.s.select.postSelected = this.s.custom.fnRowSelected;
- this.s.select.postDeselected = this.s.custom.fnRowDeselected;
- // Backwards compatibility - allow the user to specify a custom class in the initialiser
- if ( this.s.custom.sSelectedClass )
- {
- this.classes.select.row = this.s.custom.sSelectedClass;
- }
- this.s.tags = this.s.custom.oTags;
- /* Button set */
- this.s.buttonSet = this.s.custom.aButtons;
- },
- /**
- * Take the user input arrays and expand them to be fully defined, and then add them to a given
- * DOM element
- * @method _fnButtonDefinations
- * @param {array} buttonSet Set of user defined buttons
- * @param {node} wrapper Node to add the created buttons to
- * @returns void
- * @private
- */
- "_fnButtonDefinations": function ( buttonSet, wrapper )
- {
- var buttonDef;
- for ( var i=0, iLen=buttonSet.length ; i<iLen ; i++ )
- {
- if ( typeof buttonSet[i] == "string" )
- {
- if ( typeof TableTools.BUTTONS[ buttonSet[i] ] == 'undefined' )
- {
- alert( "TableTools: Warning - unknown button type: "+buttonSet[i] );
- continue;
- }
- buttonDef = $.extend( {}, TableTools.BUTTONS[ buttonSet[i] ], true );
- }
- else
- {
- if ( typeof TableTools.BUTTONS[ buttonSet[i].sExtends ] == 'undefined' )
- {
- alert( "TableTools: Warning - unknown button type: "+buttonSet[i].sExtends );
- continue;
- }
- var o = $.extend( {}, TableTools.BUTTONS[ buttonSet[i].sExtends ], true );
- buttonDef = $.extend( o, buttonSet[i], true );
- }
- var button = this._fnCreateButton(
- buttonDef,
- $(wrapper).hasClass(this.classes.collection.container)
- );
- if ( button ) {
- wrapper.appendChild( button );
- }
- }
- },
- /**
- * Create and configure a TableTools button
- * @method _fnCreateButton
- * @param {Object} oConfig Button configuration object
- * @returns {Node} Button element
- * @private
- */
- "_fnCreateButton": function ( oConfig, bCollectionButton )
- {
- var nButton = this._fnButtonBase( oConfig, bCollectionButton );
- if ( oConfig.sAction.match(/flash/) )
- {
- if ( ! this._fnHasFlash() ) {
- return false;
- }
- this._fnFlashConfig( nButton, oConfig );
- }
- else if ( oConfig.sAction == "text" )
- {
- this._fnTextConfig( nButton, oConfig );
- }
- else if ( oConfig.sAction == "div" )
- {
- this._fnTextConfig( nButton, oConfig );
- }
- else if ( oConfig.sAction == "collection" )
- {
- this._fnTextConfig( nButton, oConfig );
- this._fnCollectionConfig( nButton, oConfig );
- }
- if ( this.s.dt.iTabIndex !== -1 ) {
- $(nButton)
- .attr( 'tabindex', this.s.dt.iTabIndex )
- .attr( 'aria-controls', this.s.dt.sTableId )
- .on( 'keyup.DTTT', function (e) {
- // Trigger the click event on return key when focused.
- // Note that for Flash buttons this has no effect since we
- // can't programmatically trigger the Flash export
- if ( e.keyCode === 13 ) {
- e.stopPropagation();
- $(this).trigger( 'click' );
- }
- } )
- .on( 'mousedown.DTTT', function (e) {
- // On mousedown we want to stop the focus occurring on the
- // button, focus is used only for the keyboard navigation.
- // But using preventDefault for the flash buttons stops the
- // flash action. However, it is not the button that gets
- // focused but the flash element for flash buttons, so this
- // works
- if ( ! oConfig.sAction.match(/flash/) ) {
- e.preventDefault();
- }
- } );
- }
- return nButton;
- },
- /**
- * Create the DOM needed for the button and apply some base properties. All buttons start here
- * @method _fnButtonBase
- * @param {o} oConfig Button configuration object
- * @returns {Node} DIV element for the button
- * @private
- */
- "_fnButtonBase": function ( o, bCollectionButton )
- {
- var sTag, sLiner, sClass;
- if ( bCollectionButton )
- {
- sTag = o.sTag && o.sTag !== "default" ? o.sTag : this.s.tags.collection.button;
- sLiner = o.sLinerTag && o.sLinerTag !== "default" ? o.sLiner : this.s.tags.collection.liner;
- sClass = this.classes.collection.buttons.normal;
- }
- else
- {
- sTag = o.sTag && o.sTag !== "default" ? o.sTag : this.s.tags.button;
- sLiner = o.sLinerTag && o.sLinerTag !== "default" ? o.sLiner : this.s.tags.liner;
- sClass = this.classes.buttons.normal;
- }
- var
- nButton = document.createElement( sTag ),
- nSpan = document.createElement( sLiner ),
- masterS = this._fnGetMasterSettings();
- nButton.className = sClass+" "+o.sButtonClass;
- nButton.setAttribute('id', "ToolTables_"+this.s.dt.sInstance+"_"+masterS.buttonCounter );
- nButton.appendChild( nSpan );
- nSpan.innerHTML = o.sButtonText;
- masterS.buttonCounter++;
- return nButton;
- },
- /**
- * Get the settings object for the master instance. When more than one TableTools instance is
- * assigned to a DataTable, only one of them can be the 'master' (for the select rows). As such,
- * we will typically want to interact with that master for global properties.
- * @method _fnGetMasterSettings
- * @returns {Object} TableTools settings object
- * @private
- */
- "_fnGetMasterSettings": function ()
- {
- if ( this.s.master )
- {
- return this.s;
- }
- else
- {
- /* Look for the master which has the same DT as this one */
- var instances = TableTools._aInstances;
- for ( var i=0, iLen=instances.length ; i<iLen ; i++ )
- {
- if ( this.dom.table == instances[i].s.dt.nTable )
- {
- return instances[i].s;
- }
- }
- }
- },
- /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * Button collection functions
- */
- /**
- * Create a collection button, when activated will present a drop down list of other buttons
- * @param {Node} nButton Button to use for the collection activation
- * @param {Object} oConfig Button configuration object
- * @returns void
- * @private
- */
- "_fnCollectionConfig": function ( nButton, oConfig )
- {
- var nHidden = document.createElement( this.s.tags.collection.container );
- nHidden.style.display = "none";
- nHidden.className = this.classes.collection.container;
- oConfig._collection = nHidden;
- document.body.appendChild( nHidden );
- this._fnButtonDefinations( oConfig.aButtons, nHidden );
- },
- /**
- * Show a button collection
- * @param {Node} nButton Button to use for the collection
- * @param {Object} oConfig Button configuration object
- * @returns void
- * @private
- */
- "_fnCollectionShow": function ( nButton, oConfig )
- {
- var
- that = this,
- oPos = $(nButton).offset(),
- nHidden = oConfig._collection,
- iDivX = oPos.left,
- iDivY = oPos.top + $(nButton).outerHeight(),
- iWinHeight = $(window).height(), iDocHeight = $(document).height(),
- iWinWidth = $(window).width(), iDocWidth = $(document).width();
- nHidden.style.position = "absolute";
- nHidden.style.left = iDivX+"px";
- nHidden.style.top = iDivY+"px";
- nHidden.style.display = "block";
- $(nHidden).css('opacity',0);
- var nBackground = document.createElement('div');
- nBackground.style.position = "absolute";
- nBackground.style.left = "0px";
- nBackground.style.top = "0px";
- nBackground.style.height = ((iWinHeight>iDocHeight)? iWinHeight : iDocHeight) +"px";
- nBackground.style.width = ((iWinWidth>iDocWidth)? iWinWidth : iDocWidth) +"px";
- nBackground.className = this.classes.collection.background;
- $(nBackground).css('opacity',0);
- document.body.appendChild( nBackground );
- document.body.appendChild( nHidden );
- /* Visual corrections to try and keep the collection visible */
- var iDivWidth = $(nHidden).outerWidth();
- var iDivHeight = $(nHidden).outerHeight();
- if ( iDivX + iDivWidth > iDocWidth )
- {
- nHidden.style.left = (iDocWidth-iDivWidth)+"px";
- }
- if ( iDivY + iDivHeight > iDocHeight )
- {
- nHidden.style.top = (iDivY-iDivHeight-$(nButton).outerHeight())+"px";
- }
- this.dom.collection.collection = nHidden;
- this.dom.collection.background = nBackground;
- /* This results in a very small delay for the end user but it allows the animation to be
- * much smoother. If you don't want the animation, then the setTimeout can be removed
- */
- setTimeout( function () {
- $(nHidden).animate({"opacity": 1}, 500);
- $(nBackground).animate({"opacity": 0.25}, 500);
- }, 10 );
- /* Resize the buttons to the Flash contents fit */
- this.fnResizeButtons();
- /* Event handler to remove the collection display */
- $(nBackground).click( function () {
- that._fnCollectionHide.call( that, null, null );
- } );
- },
- /**
- * Hide a button collection
- * @param {Node} nButton Button to use for the collection
- * @param {Object} oConfig Button configuration object
- * @returns void
- * @private
- */
- "_fnCollectionHide": function ( nButton, oConfig )
- {
- if ( oConfig !== null && oConfig.sExtends == 'collection' )
- {
- return;
- }
- if ( this.dom.collection.collection !== null )
- {
- $(this.dom.collection.collection).animate({"opacity": 0}, 500, function (e) {
- this.style.display = "none";
- } );
- $(this.dom.collection.background).animate({"opacity": 0}, 500, function (e) {
- this.parentNode.removeChild( this );
- } );
- this.dom.collection.collection = null;
- this.dom.collection.background = null;
- }
- },
- /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * Row selection functions
- */
- /**
- * Add event handlers to a table to allow for row selection
- * @method _fnRowSelectConfig
- * @returns void
- * @private
- */
- "_fnRowSelectConfig": function ()
- {
- if ( this.s.master )
- {
- var
- that = this,
- i, iLen,
- dt = this.s.dt,
- aoOpenRows = this.s.dt.aoOpenRows;
- $(dt.nTable).addClass( this.classes.select.table );
- // When using OS style selection, we want to cancel the shift text
- // selection, but only when the shift key is used (so you can
- // actually still select text in the table)
- if ( this.s.select.type === 'os' ) {
- $(dt.nTBody).on( 'mousedown.DTTT_Select', 'tr', function(e) {
- if ( e.shiftKey ) {
- $(dt.nTBody)
- .css( '-moz-user-select', 'none' )
- .one('selectstart.DTTT_Select', 'tr', function () {
- return false;
- } );
- }
- } );
- $(dt.nTBody).on( 'mouseup.DTTT_Select', 'tr', function(e) {
- $(dt.nTBody).css( '-moz-user-select', '' );
- } );
- }
- // Row selection
- $(dt.nTBody).on( 'click.DTTT_Select', this.s.custom.sRowSelector, function(e) {
- var row = this.nodeName.toLowerCase() === 'tr' ?
- this :
- $(this).parents('tr')[0];
- var select = that.s.select;
- var pos = that.s.dt.oInstance.fnGetPosition( row );
- /* Sub-table must be ignored (odd that the selector won't do this with >) */
- if ( row.parentNode != dt.nTBody ) {
- return;
- }
- /* Check that we are actually working with a DataTables controlled row */
- if ( dt.oInstance.fnGetData(row) === null ) {
- return;
- }
- // Shift click, ctrl click and simple click handling to make
- // row selection a lot like a file system in desktop OSs
- if ( select.type == 'os' ) {
- if ( e.ctrlKey || e.metaKey ) {
- // Add or remove from the selection
- if ( that.fnIsSelected( row ) ) {
- that._fnRowDeselect( row, e );
- }
- else {
- that._fnRowSelect( row, e );
- }
- }
- else if ( e.shiftKey ) {
- // Add a range of rows, from the last selected row to
- // this one
- var rowIdxs = that.s.dt.aiDisplay.slice(); // visible rows
- var idx1 = $.inArray( select.lastRow, rowIdxs );
- var idx2 = $.inArray( pos, rowIdxs );
- if ( that.fnGetSelected().length === 0 || idx1 === -1 ) {
- // select from top to here - slightly odd, but both
- // Windows and Mac OS do this
- rowIdxs.splice( $.inArray( pos, rowIdxs )+1, rowIdxs.length );
- }
- else {
- // reverse so we can shift click 'up' as well as down
- if ( idx1 > idx2 ) {
- var tmp = idx2;
- idx2 = idx1;
- idx1 = tmp;
- }
- rowIdxs.splice( idx2+1, rowIdxs.length );
- rowIdxs.splice( 0, idx1 );
- }
- if ( ! that.fnIsSelected( row ) ) {
- // Select range
- that._fnRowSelect( rowIdxs, e );
- }
- else {
- // Deselect range - need to keep the clicked on row selected
- rowIdxs.splice( $.inArray( pos, rowIdxs ), 1 );
- that._fnRowDeselect( rowIdxs, e );
- }
- }
- else {
- // No cmd or shift click. Deselect current if selected,
- // or select this row only
- if ( that.fnIsSelected( row ) && that.fnGetSelected().length === 1 ) {
- that._fnRowDeselect( row, e );
- }
- else {
- that.fnSelectNone();
- that._fnRowSelect( row, e );
- }
- }
- }
- else if ( that.fnIsSelected( row ) ) {
- that._fnRowDeselect( row, e );
- }
- else if ( select.type == "single" ) {
- that.fnSelectNone();
- that._fnRowSelect( row, e );
- }
- else if ( select.type == "multi" ) {
- that._fnRowSelect( row, e );
- }
- select.lastRow = pos;
- } );//.on('selectstart', function () { return false; } );
- // Bind a listener to the DataTable for when new rows are created.
- // This allows rows to be visually selected when they should be and
- // deferred rendering is used.
- dt.oApi._fnCallbackReg( dt, 'aoRowCreatedCallback', function (tr, data, index) {
- if ( dt.aoData[index]._DTTT_selected ) {
- $(tr).addClass( that.classes.select.row );
- }
- }, 'TableTools-SelectAll' );
- }
- },
- /**
- * Select rows
- * @param {*} src Rows to select - see _fnSelectData for a description of valid inputs
- * @private
- */
- "_fnRowSelect": function ( src, e )
- {
- var
- that = this,
- data = this._fnSelectData( src ),
- firstTr = data.length===0 ? null : data[0].nTr,
- anSelected = [],
- i, len;
- // Get all the rows that will be selected
- for ( i=0, len=data.length ; i<len ; i++ )
- {
- if ( data[i].nTr )
- {
- anSelected.push( data[i].nTr );
- }
- }
- // User defined pre-selection function
- if ( this.s.select.preRowSelect !== null && !this.s.select.preRowSelect.call(this, e, anSelected, true) )
- {
- return;
- }
- // Mark them as selected
- for ( i=0, len=data.length ; i<len ; i++ )
- {
- data[i]._DTTT_selected = true;
- if ( data[i].nTr )
- {
- $(data[i].nTr).addClass( that.classes.select.row );
- }
- }
- // Post-selection function
- if ( this.s.select.postSelected !== null )
- {
- this.s.select.postSelected.call( this, anSelected );
- }
- TableTools._fnEventDispatch( this, 'select', anSelected, true );
- },
- /**
- * Deselect rows
- * @param {*} src Rows to deselect - see _fnSelectData for a description of valid inputs
- * @private
- */
- "_fnRowDeselect": function ( src, e )
- {
- var
- that = this,
- data = this._fnSelectData( src ),
- firstTr = data.length===0 ? null : data[0].nTr,
- anDeselectedTrs = [],
- i, len;
- // Get all the rows that will be deselected
- for ( i=0, len=data.length ; i<len ; i++ )
- {
- if ( data[i].nTr )
- {
- anDeselectedTrs.push( data[i].nTr );
- }
- }
- // User defined pre-selection function
- if ( this.s.select.preRowSelect !== null && !this.s.select.preRowSelect.call(this, e, anDeselectedTrs, false) )
- {
- return;
- }
- // Mark them as deselected
- for ( i=0, len=data.length ; i<len ; i++ )
- {
- data[i]._DTTT_selected = false;
- if ( data[i].nTr )
- {
- $(data[i].nTr).removeClass( that.classes.select.row );
- }
- }
- // Post-deselection function
- if ( this.s.select.postDeselected !== null )
- {
- this.s.select.postDeselected.call( this, anDeselectedTrs );
- }
- TableTools._fnEventDispatch( this, 'select', anDeselectedTrs, false );
- },
- /**
- * Take a data source for row selection and convert it into aoData points for the DT
- * @param {*} src Can be a single DOM TR node, an array of TR nodes (including a
- * a jQuery object), a single aoData point from DataTables, an array of aoData
- * points or an array of aoData indexes
- * @returns {array} An array of aoData points
- */
- "_fnSelectData": function ( src )
- {
- var out = [], pos, i, iLen;
- if ( src.nodeName )
- {
- // Single node
- pos = this.s.dt.oInstance.fnGetPosition( src );
- out.push( this.s.dt.aoData[pos] );
- }
- else if ( typeof src.length !== 'undefined' )
- {
- // jQuery object or an array of nodes, or aoData points
- for ( i=0, iLen=src.length ; i<iLen ; i++ )
- {
- if ( src[i].nodeName )
- {
- pos = this.s.dt.oInstance.fnGetPosition( src[i] );
- out.push( this.s.dt.aoData[pos] );
- }
- else if ( typeof src[i] === 'number' )
- {
- out.push( this.s.dt.aoData[ src[i] ] );
- }
- else
- {
- out.push( src[i] );
- }
- }
- return out;
- }
- else if ( typeof src === 'number' )
- {
- out.push(this.s.dt.aoData[src]);
- }
- else
- {
- // A single aoData point
- out.push( src );
- }
- return out;
- },
- /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * Text button functions
- */
- /**
- * Configure a text based button for interaction events
- * @method _fnTextConfig
- * @param {Node} nButton Button element which is being considered
- * @param {Object} oConfig Button configuration object
- * @returns void
- * @private
- */
- "_fnTextConfig": function ( nButton, oConfig )
- {
- var that = this;
- if ( oConfig.fnInit !== null )
- {
- oConfig.fnInit.call( this, nButton, oConfig );
- }
- if ( oConfig.sToolTip !== "" )
- {
- nButton.title = oConfig.sToolTip;
- }
- $(nButton).hover( function () {
- if ( oConfig.fnMouseover !== null )
- {
- oConfig.fnMouseover.call( this, nButton, oConfig, null );
- }
- }, function () {
- if ( oConfig.fnMouseout !== null )
- {
- oConfig.fnMouseout.call( this, nButton, oConfig, null );
- }
- } );
- if ( oConfig.fnSelect !== null )
- {
- TableTools._fnEventListen( this, 'select', function (n) {
- oConfig.fnSelect.call( that, nButton, oConfig, n );
- } );
- }
- $(nButton).click( function (e) {
- //e.preventDefault();
- if ( oConfig.fnClick !== null )
- {
- oConfig.fnClick.call( that, nButton, oConfig, null, e );
- }
- /* Provide a complete function to match the behaviour of the flash elements */
- if ( oConfig.fnComplete !== null )
- {
- oConfig.fnComplete.call( that, nButton, oConfig, null, null );
- }
- that._fnCollectionHide( nButton, oConfig );
- } );
- },
- /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * Flash button functions
- */
-
- /**
- * Check if the Flash plug-in is available
- * @method _fnHasFlash
- * @returns {boolean} `true` if Flash available, `false` otherwise
- * @private
- */
- "_fnHasFlash": function ()
- {
- try {
- var fo = new ActiveXObject('ShockwaveFlash.ShockwaveFlash');
- if (fo) {
- return true;
- }
- }
- catch (e) {
- if (
- navigator.mimeTypes &&
- navigator.mimeTypes['application/x-shockwave-flash'] !== undefined &&
- navigator.mimeTypes['application/x-shockwave-flash'].enabledPlugin
- ) {
- return true;
- }
- }
- return false;
- },
- /**
- * Configure a flash based button for interaction events
- * @method _fnFlashConfig
- * @param {Node} nButton Button element which is being considered
- * @param {o} oConfig Button configuration object
- * @returns void
- * @private
- */
- "_fnFlashConfig": function ( nButton, oConfig )
- {
- var that = this;
- var flash = new ZeroClipboard_TableTools.Client();
- if ( oConfig.fnInit !== null )
- {
- oConfig.fnInit.call( this, nButton, oConfig );
- }
- flash.setHandCursor( true );
- if ( oConfig.sAction == "flash_save" )
- {
- flash.setAction( 'save' );
- flash.setCharSet( (oConfig.sCharSet=="utf16le") ? 'UTF16LE' : 'UTF8' );
- flash.setBomInc( oConfig.bBomInc );
- flash.setFileName( oConfig.sFileName.replace('*', this.fnGetTitle(oConfig)) );
- }
- else if ( oConfig.sAction == "flash_pdf" )
- {
- flash.setAction( 'pdf' );
- flash.setFileName( oConfig.sFileName.replace('*', this.fnGetTitle(oConfig)) );
- }
- else
- {
- flash.setAction( 'copy' );
- }
- flash.addEventListener('mouseOver', function(client) {
- if ( oConfig.fnMouseover !== null )
- {
- oConfig.fnMouseover.call( that, nButton, oConfig, flash );
- }
- } );
- flash.addEventListener('mouseOut', function(client) {
- if ( oConfig.fnMouseout !== null )
- {
- oConfig.fnMouseout.call( that, nButton, oConfig, flash );
- }
- } );
- flash.addEventListener('mouseDown', function(client) {
- if ( oConfig.fnClick !== null )
- {
- oConfig.fnClick.call( that, nButton, oConfig, flash );
- }
- } );
- flash.addEventListener('complete', function (client, text) {
- if ( oConfig.fnComplete !== null )
- {
- oConfig.fnComplete.call( that, nButton, oConfig, flash, text );
- }
- that._fnCollectionHide( nButton, oConfig );
- } );
- if ( oConfig.fnSelect !== null )
- {
- TableTools._fnEventListen( this, 'select', function (n) {
- oConfig.fnSelect.call( that, nButton, oConfig, n );
- } );
- }
- this._fnFlashGlue( flash, nButton, oConfig.sToolTip );
- },
- /**
- * Wait until the id is in the DOM before we "glue" the swf. Note that this function will call
- * itself (using setTimeout) until it completes successfully
- * @method _fnFlashGlue
- * @param {Object} clip Zero clipboard object
- * @param {Node} node node to glue swf to
- * @param {String} text title of the flash movie
- * @returns void
- * @private
- */
- "_fnFlashGlue": function ( flash, node, text )
- {
- var that = this;
- var id = node.getAttribute('id');
- if ( document.getElementById(id) )
- {
- flash.glue( node, text );
- }
- else
- {
- setTimeout( function () {
- that._fnFlashGlue( flash, node, text );
- }, 100 );
- }
- },
- /**
- * Set the text for the flash clip to deal with
- *
- * This function is required for large information sets. There is a limit on the
- * amount of data that can be transferred between Javascript and Flash in a single call, so
- * we use this method to build up the text in Flash by sending over chunks. It is estimated
- * that the data limit is around 64k, although it is undocumented, and appears to be different
- * between different flash versions. We chunk at 8KiB.
- * @method _fnFlashSetText
- * @param {Object} clip the ZeroClipboard object
- * @param {String} sData the data to be set
- * @returns void
- * @private
- */
- "_fnFlashSetText": function ( clip, sData )
- {
- var asData = this._fnChunkData( sData, 8192 );
- clip.clearText();
- for ( var i=0, iLen=asData.length ; i<iLen ; i++ )
- {
- clip.appendText( asData[i] );
- }
- },
- /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * Data retrieval functions
- */
- /**
- * Convert the mixed columns variable into a boolean array the same size as the columns, which
- * indicates which columns we want to include
- * @method _fnColumnTargets
- * @param {String|Array} mColumns The columns to be included in data retrieval. If a string
- * then it can take the value of "visible" or "hidden" (to include all visible or
- * hidden columns respectively). Or an array of column indexes
- * @returns {Array} A boolean array the length of the columns of the table, which each value
- * indicating if the column is to be included or not
- * @private
- */
- "_fnColumnTargets": function ( mColumns )
- {
- var aColumns = [];
- var dt = this.s.dt;
- var i, iLen;
- var columns = dt.aoColumns;
- var columnCount = columns.length;
- if ( typeof mColumns == "function" )
- {
- var a = mColumns.call( this, dt );
- for ( i=0, iLen=columnCount ; i<iLen ; i++ )
- {
- aColumns.push( $.inArray( i, a ) !== -1 ? true : false );
- }
- }
- else if ( typeof mColumns == "object" )
- {
- for ( i=0, iLen=columnCount ; i<iLen ; i++ )
- {
- aColumns.push( false );
- }
- for ( i=0, iLen=mColumns.length ; i<iLen ; i++ )
- {
- aColumns[ mColumns[i] ] = true;
- }
- }
- else if ( mColumns == "visible" )
- {
- for ( i=0, iLen=columnCount ; i<iLen ; i++ )
- {
- aColumns.push( columns[i].bVisible ? true : false );
- }
- }
- else if ( mColumns == "hidden" )
- {
- for ( i=0, iLen=columnCount ; i<iLen ; i++ )
- {
- aColumns.push( columns[i].bVisible ? false : true );
- }
- }
- else if ( mColumns == "sortable" )
- {
- for ( i=0, iLen=columnCount ; i<iLen ; i++ )
- {
- aColumns.push( columns[i].bSortable ? true : false );
- }
- }
- else /* all */
- {
- for ( i=0, iLen=columnCount ; i<iLen ; i++ )
- {
- aColumns.push( true );
- }
- }
- return aColumns;
- },
- /**
- * New line character(s) depend on the platforms
- * @method method
- * @param {Object} oConfig Button configuration object - only interested in oConfig.sNewLine
- * @returns {String} Newline character
- */
- "_fnNewline": function ( oConfig )
- {
- if ( oConfig.sNewLine == "auto" )
- {
- return navigator.userAgent.match(/Windows/) ? "\r\n" : "\n";
- }
- else
- {
- return oConfig.sNewLine;
- }
- },
- /**
- * Get data from DataTables' internals and format it for output
- * @method _fnGetDataTablesData
- * @param {Object} oConfig Button configuration object
- * @param {String} oConfig.sFieldBoundary Field boundary for the data cells in the string
- * @param {String} oConfig.sFieldSeperator Field separator for the data cells
- * @param {String} oConfig.sNewline New line options
- * @param {Mixed} oConfig.mColumns Which columns should be included in the output
- * @param {Boolean} oConfig.bHeader Include the header
- * @param {Boolean} oConfig.bFooter Include the footer
- * @param {Boolean} oConfig.bSelectedOnly Include only the selected rows in the output
- * @returns {String} Concatenated string of data
- * @private
- */
- "_fnGetDataTablesData": function ( oConfig )
- {
- var i, iLen, j, jLen;
- var aRow, aData=[], sLoopData='', arr;
- var dt = this.s.dt, tr, child;
- var regex = new RegExp(oConfig.sFieldBoundary, "g"); /* Do it here for speed */
- var aColumnsInc = this._fnColumnTargets( oConfig.mColumns );
- var bSelectedOnly = (typeof oConfig.bSelectedOnly != 'undefined') ? oConfig.bSelectedOnly : false;
- /*
- * Header
- */
- if ( oConfig.bHeader )
- {
- aRow = [];
- for ( i=0, iLen=dt.aoColumns.length ; i<iLen ; i++ )
- {
- if ( aColumnsInc[i] )
- {
- sLoopData = dt.aoColumns[i].sTitle.replace(/\n/g," ").replace( /<.*?>/g, "" ).replace(/^\s+|\s+$/g,"");
- sLoopData = this._fnHtmlDecode( sLoopData );
- aRow.push( this._fnBoundData( sLoopData, oConfig.sFieldBoundary, regex ) );
- }
- }
- aData.push( aRow.join(oConfig.sFieldSeperator) );
- }
- bSelectedOnly = true;
- /*
- * Body
- */
- var aDataIndex;
- var aSelected = this.fnGetSelectedIndexes();
- bSelectedOnly = this.s.select.type !== "none" && bSelectedOnly && aSelected.length !== 0;
- if ( bSelectedOnly ) {
- // Use the selected indexes
- aDataIndex = aSelected;
- }
- else if ( DataTable.Api ) {
- // 1.10+ style
- aDataIndex = new DataTable.Api( dt )
- .rows( oConfig.oSelectorOpts )
- .indexes()
- .flatten()
- .toArray();
- }
- else {
- // 1.9- style
- aDataIndex = dt.oInstance
- .$('tr', oConfig.oSelectorOpts)
- .map( function (id, row) {
- return dt.oInstance.fnGetPosition( row );
- } )
- .get();
- }
- for ( j=0, jLen=aDataIndex.length ; j<jLen ; j++ )
- {
- tr = dt.aoData[ aDataIndex[j] ].nTr;
- aRow = [];
- /* Columns */
- for ( i=0, iLen=dt.aoColumns.length ; i<iLen ; i++ )
- {
- if ( aColumnsInc[i] )
- {
- /* Convert to strings (with small optimisation) */
- var mTypeData = dt.oApi._fnGetCellData( dt, aDataIndex[j], i, 'display' );
- if ( oConfig.fnCellRender )
- {
- sLoopData = oConfig.fnCellRender( mTypeData, i, tr, aDataIndex[j] )+"";
- }
- else if ( typeof mTypeData == "string" )
- {
- /* Strip newlines, replace img tags with alt attr. and finally strip html... */
- sLoopData = mTypeData.replace(/\n/g," ");
- sLoopData =
- sLoopData.replace(/<img.*?\s+alt\s*=\s*(?:"([^"]+)"|'([^']+)'|([^\s>]+)).*?>/gi,
- '$1$2$3');
- sLoopData = sLoopData.replace( /<.*?>/g, "" );
- }
- else
- {
- sLoopData = mTypeData+"";
- }
- /* Trim and clean the data */
- sLoopData = sLoopData.replace(/^\s+/, '').replace(/\s+$/, '');
- sLoopData = this._fnHtmlDecode( sLoopData );
- /* Bound it and add it to the total data */
- aRow.push( this._fnBoundData( sLoopData, oConfig.sFieldBoundary, regex ) );
- }
- }
- aData.push( aRow.join(oConfig.sFieldSeperator) );
- /* Details rows from fnOpen */
- if ( oConfig.bOpenRows )
- {
- arr = $.grep(dt.aoOpenRows, function(o) { return o.nParent === tr; });
- if ( arr.length === 1 )
- {
- sLoopData = this._fnBoundData( $('td', arr[0].nTr).html(), oConfig.sFieldBoundary, regex );
- aData.push( sLoopData );
- }
- }
- }
- /*
- * Footer
- */
- if ( oConfig.bFooter && dt.nTFoot !== null )
- {
- aRow = [];
- for ( i=0, iLen=dt.aoColumns.length ; i<iLen ; i++ )
- {
- if ( aColumnsInc[i] && dt.aoColumns[i].nTf !== null )
- {
- sLoopData = dt.aoColumns[i].nTf.innerHTML.replace(/\n/g," ").replace( /<.*?>/g, "" );
- sLoopData = this._fnHtmlDecode( sLoopData );
- aRow.push( this._fnBoundData( sLoopData, oConfig.sFieldBoundary, regex ) );
- }
- }
- aData.push( aRow.join(oConfig.sFieldSeperator) );
- }
- var _sLastData = aData.join( this._fnNewline(oConfig) );
- return _sLastData;
- },
- /**
- * Wrap data up with a boundary string
- * @method _fnBoundData
- * @param {String} sData data to bound
- * @param {String} sBoundary bounding char(s)
- * @param {RegExp} regex search for the bounding chars - constructed outside for efficiency
- * in the loop
- * @returns {String} bound data
- * @private
- */
- "_fnBoundData": function ( sData, sBoundary, regex )
- {
- if ( sBoundary === "" )
- {
- return sData;
- }
- else
- {
- return sBoundary + sData.replace(regex, sBoundary+sBoundary) + sBoundary;
- }
- },
- /**
- * Break a string up into an array of smaller strings
- * @method _fnChunkData
- * @param {String} sData data to be broken up
- * @param {Int} iSize chunk size
- * @returns {Array} String array of broken up text
- * @private
- */
- "_fnChunkData": function ( sData, iSize )
- {
- var asReturn = [];
- var iStrlen = sData.length;
- for ( var i=0 ; i<iStrlen ; i+=iSize )
- {
- if ( i+iSize < iStrlen )
- {
- asReturn.push( sData.substring( i, i+iSize ) );
- }
- else
- {
- asReturn.push( sData.substring( i, iStrlen ) );
- }
- }
- return asReturn;
- },
- /**
- * Decode HTML entities
- * @method _fnHtmlDecode
- * @param {String} sData encoded string
- * @returns {String} decoded string
- * @private
- */
- "_fnHtmlDecode": function ( sData )
- {
- if ( sData.indexOf('&') === -1 )
- {
- return sData;
- }
- var n = document.createElement('div');
- return sData.replace( /&([^\s]*?);/g, function( match, match2 ) {
- if ( match.substr(1, 1) === '#' )
- {
- return String.fromCharCode( Number(match2.substr(1)) );
- }
- else
- {
- n.innerHTML = match;
- return n.childNodes[0].nodeValue;
- }
- } );
- },
- /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * Printing functions
- */
- /**
- * Show print display
- * @method _fnPrintStart
- * @param {Event} e Event object
- * @param {Object} oConfig Button configuration object
- * @returns void
- * @private
- */
- "_fnPrintStart": function ( oConfig )
- {
- var that = this;
- var oSetDT = this.s.dt;
- /* Parse through the DOM hiding everything that isn't needed for the table */
- this._fnPrintHideNodes( oSetDT.nTable );
- /* Show the whole table */
- this.s.print.saveStart = oSetDT._iDisplayStart;
- this.s.print.saveLength = oSetDT._iDisplayLength;
- if ( oConfig.bShowAll )
- {
- oSetDT._iDisplayStart = 0;
- oSetDT._iDisplayLength = -1;
- if ( oSetDT.oApi._fnCalculateEnd ) {
- oSetDT.oApi._fnCalculateEnd( oSetDT );
- }
- oSetDT.oApi._fnDraw( oSetDT );
- }
- /* Adjust the display for scrolling which might be done by DataTables */
- if ( oSetDT.oScroll.sX !== "" || oSetDT.oScroll.sY !== "" )
- {
- this._fnPrintScrollStart( oSetDT );
- // If the table redraws while in print view, the DataTables scrolling
- // setup would hide the header, so we need to readd it on draw
- $(this.s.dt.nTable).bind('draw.DTTT_Print', function () {
- that._fnPrintScrollStart( oSetDT );
- } );
- }
- /* Remove the other DataTables feature nodes - but leave the table! and info div */
- var anFeature = oSetDT.aanFeatures;
- for ( var cFeature in anFeature )
- {
- if ( cFeature != 'i' && cFeature != 't' && cFeature.length == 1 )
- {
- for ( var i=0, iLen=anFeature[cFeature].length ; i<iLen ; i++ )
- {
- this.dom.print.hidden.push( {
- "node": anFeature[cFeature][i],
- "display": "block"
- } );
- anFeature[cFeature][i].style.display = "none";
- }
- }
- }
- /* Print class can be used for styling */
- $(document.body).addClass( this.classes.print.body );
- /* Show information message to let the user know what is happening */
- if ( oConfig.sInfo !== "" )
- {
- this.fnInfo( oConfig.sInfo, 3000 );
- }
- /* Add a message at the top of the page */
- if ( oConfig.sMessage )
- {
- $('<div/>')
- .addClass( this.classes.print.message )
- .html( oConfig.sMessage )
- .prependTo( 'body' );
- }
- /* Cache the scrolling and the jump to the top of the page */
- this.s.print.saveScroll = $(window).scrollTop();
- window.scrollTo( 0, 0 );
- /* Bind a key event listener to the document for the escape key -
- * it is removed in the callback
- */
- $(document).bind( "keydown.DTTT", function(e) {
- /* Only interested in the escape key */
- if ( e.keyCode == 27 )
- {
- e.preventDefault();
- that._fnPrintEnd.call( that, e );
- }
- } );
- },
- /**
- * Printing is finished, resume normal display
- * @method _fnPrintEnd
- * @param {Event} e Event object
- * @returns void
- * @private
- */
- "_fnPrintEnd": function ( e )
- {
- var that = this;
- var oSetDT = this.s.dt;
- var oSetPrint = this.s.print;
- var oDomPrint = this.dom.print;
- /* Show all hidden nodes */
- this._fnPrintShowNodes();
- /* Restore DataTables' scrolling */
- if ( oSetDT.oScroll.sX !== "" || oSetDT.oScroll.sY !== "" )
- {
- $(this.s.dt.nTable).unbind('draw.DTTT_Print');
- this._fnPrintScrollEnd();
- }
- /* Restore the scroll */
- window.scrollTo( 0, oSetPrint.saveScroll );
- /* Drop the print message */
- $('div.'+this.classes.print.message).remove();
- /* Styling class */
- $(document.body).removeClass( 'DTTT_Print' );
- /* Restore the table length */
- oSetDT._iDisplayStart = oSetPrint.saveStart;
- oSetDT._iDisplayLength = oSetPrint.saveLength;
- if ( oSetDT.oApi._fnCalculateEnd ) {
- oSetDT.oApi._fnCalculateEnd( oSetDT );
- }
- oSetDT.oApi._fnDraw( oSetDT );
- $(document).unbind( "keydown.DTTT" );
- },
- /**
- * Take account of scrolling in DataTables by showing the full table
- * @returns void
- * @private
- */
- "_fnPrintScrollStart": function ()
- {
- var
- oSetDT = this.s.dt,
- nScrollHeadInner = oSetDT.nScrollHead.getElementsByTagName('div')[0],
- nScrollHeadTable = nScrollHeadInner.getElementsByTagName('table')[0],
- nScrollBody = oSetDT.nTable.parentNode,
- nTheadSize, nTfootSize;
- /* Copy the header in the thead in the body table, this way we show one single table when
- * in print view. Note that this section of code is more or less verbatim from DT 1.7.0
- */
- nTheadSize = oSetDT.nTable.getElementsByTagName('thead');
- if ( nTheadSize.length > 0 )
- {
- oSetDT.nTable.removeChild( nTheadSize[0] );
- }
- if ( oSetDT.nTFoot !== null )
- {
- nTfootSize = oSetDT.nTable.getElementsByTagName('tfoot');
- if ( nTfootSize.length > 0 )
- {
- oSetDT.nTable.removeChild( nTfootSize[0] );
- }
- }
- nTheadSize = oSetDT.nTHead.cloneNode(true);
- oSetDT.nTable.insertBefore( nTheadSize, oSetDT.nTable.childNodes[0] );
- if ( oSetDT.nTFoot !== null )
- {
- nTfootSize = oSetDT.nTFoot.cloneNode(true);
- oSetDT.nTable.insertBefore( nTfootSize, oSetDT.nTable.childNodes[1] );
- }
- /* Now adjust the table's viewport so we can actually see it */
- if ( oSetDT.oScroll.sX !== "" )
- {
- oSetDT.nTable.style.width = $(oSetDT.nTable).outerWidth()+"px";
- nScrollBody.style.width = $(oSetDT.nTable).outerWidth()+"px";
- nScrollBody.style.overflow = "visible";
- }
- if ( oSetDT.oScroll.sY !== "" )
- {
- nScrollBody.style.height = $(oSetDT.nTable).outerHeight()+"px";
- nScrollBody.style.overflow = "visible";
- }
- },
- /**
- * Take account of scrolling in DataTables by showing the full table. Note that the redraw of
- * the DataTable that we do will actually deal with the majority of the hard work here
- * @returns void
- * @private
- */
- "_fnPrintScrollEnd": function ()
- {
- var
- oSetDT = this.s.dt,
- nScrollBody = oSetDT.nTable.parentNode;
- if ( oSetDT.oScroll.sX !== "" )
- {
- nScrollBody.style.width = oSetDT.oApi._fnStringToCss( oSetDT.oScroll.sX );
- nScrollBody.style.overflow = "auto";
- }
- if ( oSetDT.oScroll.sY !== "" )
- {
- nScrollBody.style.height = oSetDT.oApi._fnStringToCss( oSetDT.oScroll.sY );
- nScrollBody.style.overflow = "auto";
- }
- },
- /**
- * Resume the display of all TableTools hidden nodes
- * @method _fnPrintShowNodes
- * @returns void
- * @private
- */
- "_fnPrintShowNodes": function ( )
- {
- var anHidden = this.dom.print.hidden;
- for ( var i=0, iLen=anHidden.length ; i<iLen ; i++ )
- {
- anHidden[i].node.style.display = anHidden[i].display;
- }
- anHidden.splice( 0, anHidden.length );
- },
- /**
- * Hide nodes which are not needed in order to display the table. Note that this function is
- * recursive
- * @method _fnPrintHideNodes
- * @param {Node} nNode Element which should be showing in a 'print' display
- * @returns void
- * @private
- */
- "_fnPrintHideNodes": function ( nNode )
- {
- var anHidden = this.dom.print.hidden;
- var nParent = nNode.parentNode;
- var nChildren = nParent.childNodes;
- for ( var i=0, iLen=nChildren.length ; i<iLen ; i++ )
- {
- if ( nChildren[i] != nNode && nChildren[i].nodeType == 1 )
- {
- /* If our node is shown (don't want to show nodes which were previously hidden) */
- var sDisplay = $(nChildren[i]).css("display");
- if ( sDisplay != "none" )
- {
- /* Cache the node and it's previous state so we can restore it */
- anHidden.push( {
- "node": nChildren[i],
- "display": sDisplay
- } );
- nChildren[i].style.display = "none";
- }
- }
- }
- if ( nParent.nodeName.toUpperCase() != "BODY" )
- {
- this._fnPrintHideNodes( nParent );
- }
- }
- };
- /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * Static variables
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
- /**
- * Store of all instances that have been created of TableTools, so one can look up other (when
- * there is need of a master)
- * @property _aInstances
- * @type Array
- * @default []
- * @private
- */
- TableTools._aInstances = [];
- /**
- * Store of all listeners and their callback functions
- * @property _aListeners
- * @type Array
- * @default []
- */
- TableTools._aListeners = [];
- /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * Static methods
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
- /**
- * Get an array of all the master instances
- * @method fnGetMasters
- * @returns {Array} List of master TableTools instances
- * @static
- */
- TableTools.fnGetMasters = function ()
- {
- var a = [];
- for ( var i=0, iLen=TableTools._aInstances.length ; i<iLen ; i++ )
- {
- if ( TableTools._aInstances[i].s.master )
- {
- a.push( TableTools._aInstances[i] );
- }
- }
- return a;
- };
- /**
- * Get the master instance for a table node (or id if a string is given)
- * @method fnGetInstance
- * @returns {Object} ID of table OR table node, for which we want the TableTools instance
- * @static
- */
- TableTools.fnGetInstance = function ( node )
- {
- if ( typeof node != 'object' )
- {
- node = document.getElementById(node);
- }
- for ( var i=0, iLen=TableTools._aInstances.length ; i<iLen ; i++ )
- {
- if ( TableTools._aInstances[i].s.master && TableTools._aInstances[i].dom.table == node )
- {
- return TableTools._aInstances[i];
- }
- }
- return null;
- };
- /**
- * Add a listener for a specific event
- * @method _fnEventListen
- * @param {Object} that Scope of the listening function (i.e. 'this' in the caller)
- * @param {String} type Event type
- * @param {Function} fn Function
- * @returns void
- * @private
- * @static
- */
- TableTools._fnEventListen = function ( that, type, fn )
- {
- TableTools._aListeners.push( {
- "that": that,
- "type": type,
- "fn": fn
- } );
- };
- /**
- * An event has occurred - look up every listener and fire it off. We check that the event we are
- * going to fire is attached to the same table (using the table node as reference) before firing
- * @method _fnEventDispatch
- * @param {Object} that Scope of the listening function (i.e. 'this' in the caller)
- * @param {String} type Event type
- * @param {Node} node Element that the event occurred on (may be null)
- * @param {boolean} [selected] Indicate if the node was selected (true) or deselected (false)
- * @returns void
- * @private
- * @static
- */
- TableTools._fnEventDispatch = function ( that, type, node, selected )
- {
- var listeners = TableTools._aListeners;
- for ( var i=0, iLen=listeners.length ; i<iLen ; i++ )
- {
- if ( that.dom.table == listeners[i].that.dom.table && listeners[i].type == type )
- {
- listeners[i].fn( node, selected );
- }
- }
- };
- /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * Constants
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
- TableTools.buttonBase = {
- // Button base
- "sAction": "text",
- "sTag": "default",
- "sLinerTag": "default",
- "sButtonClass": "DTTT_button_text",
- "sButtonText": "Button text",
- "sTitle": "",
- "sToolTip": "",
- // Common button specific options
- "sCharSet": "utf8",
- "bBomInc": false,
- "sFileName": "*.csv",
- "sFieldBoundary": "",
- "sFieldSeperator": "\t",
- "sNewLine": "auto",
- "mColumns": "all", /* "all", "visible", "hidden" or array of column integers */
- "bHeader": true,
- "bFooter": true,
- "bOpenRows": false,
- "bSelectedOnly": false,
- "oSelectorOpts": undefined, // See http://datatables.net/docs/DataTables/1.9.4/#$ for full options
- // Callbacks
- "fnMouseover": null,
- "fnMouseout": null,
- "fnClick": null,
- "fnSelect": null,
- "fnComplete": null,
- "fnInit": null,
- "fnCellRender": null
- };
- /**
- * @namespace Default button configurations
- */
- TableTools.BUTTONS = {
- "csv": $.extend( {}, TableTools.buttonBase, {
- "sAction": "flash_save",
- "sButtonClass": "DTTT_button_csv",
- "sButtonText": "CSV",
- "sFieldBoundary": '"',
- "sFieldSeperator": ",",
- "fnClick": function( nButton, oConfig, flash ) {
- this.fnSetText( flash, this.fnGetTableData(oConfig) );
- }
- } ),
- "xls": $.extend( {}, TableTools.buttonBase, {
- "sAction": "flash_save",
- "sCharSet": "utf16le",
- "bBomInc": true,
- "sButtonClass": "DTTT_button_xls",
- "sButtonText": "Excel",
- "fnClick": function( nButton, oConfig, flash ) {
- this.fnSetText( flash, this.fnGetTableData(oConfig) );
- }
- } ),
- "copy": $.extend( {}, TableTools.buttonBase, {
- "sAction": "flash_copy",
- "sButtonClass": "DTTT_button_copy",
- "sButtonText": "Copy",
- "fnClick": function( nButton, oConfig, flash ) {
- this.fnSetText( flash, this.fnGetTableData(oConfig) );
- },
- "fnComplete": function(nButton, oConfig, flash, text) {
- var lines = text.split('\n').length;
- if (oConfig.bHeader) lines--;
- if (this.s.dt.nTFoot !== null && oConfig.bFooter) lines--;
- var plural = (lines==1) ? "" : "s";
- this.fnInfo( '<h6>Table copied</h6>'+
- '<p>Copied '+lines+' row'+plural+' to the clipboard.</p>',
- 1500
- );
- }
- } ),
- "pdf": $.extend( {}, TableTools.buttonBase, {
- "sAction": "flash_pdf",
- "sNewLine": "\n",
- "sFileName": "*.pdf",
- "sButtonClass": "DTTT_button_pdf",
- "sButtonText": "PDF",
- "sPdfOrientation": "portrait",
- "sPdfSize": "A4",
- "sPdfMessage": "",
- "fnClick": function( nButton, oConfig, flash ) {
- this.fnSetText( flash,
- "title:"+ this.fnGetTitle(oConfig) +"\n"+
- "message:"+ oConfig.sPdfMessage +"\n"+
- "colWidth:"+ this.fnCalcColRatios(oConfig) +"\n"+
- "orientation:"+ oConfig.sPdfOrientation +"\n"+
- "size:"+ oConfig.sPdfSize +"\n"+
- "--/TableToolsOpts--\n" +
- this.fnGetTableData(oConfig)
- );
- }
- } ),
- "print": $.extend( {}, TableTools.buttonBase, {
- "sInfo": "<h6>Print view</h6><p>Please use your browser's print function to "+
- "print this table. Press escape when finished.</p>",
- "sMessage": null,
- "bShowAll": true,
- "sToolTip": "View print view",
- "sButtonClass": "DTTT_button_print",
- "sButtonText": "Print",
- "fnClick": function ( nButton, oConfig ) {
- this.fnPrint( true, oConfig );
- }
- } ),
- "text": $.extend( {}, TableTools.buttonBase ),
- "select": $.extend( {}, TableTools.buttonBase, {
- "sButtonText": "Select button",
- "fnSelect": function( nButton, oConfig ) {
- if ( this.fnGetSelected().length !== 0 ) {
- $(nButton).removeClass( this.classes.buttons.disabled );
- } else {
- $(nButton).addClass( this.classes.buttons.disabled );
- }
- },
- "fnInit": function( nButton, oConfig ) {
- $(nButton).addClass( this.classes.buttons.disabled );
- }
- } ),
- "select_single": $.extend( {}, TableTools.buttonBase, {
- "sButtonText": "Select button",
- "fnSelect": function( nButton, oConfig ) {
- var iSelected = this.fnGetSelected().length;
- if ( iSelected == 1 ) {
- $(nButton).removeClass( this.classes.buttons.disabled );
- } else {
- $(nButton).addClass( this.classes.buttons.disabled );
- }
- },
- "fnInit": function( nButton, oConfig ) {
- $(nButton).addClass( this.classes.buttons.disabled );
- }
- } ),
- "select_all": $.extend( {}, TableTools.buttonBase, {
- "sButtonText": "Select all",
- "fnClick": function( nButton, oConfig ) {
- this.fnSelectAll();
- },
- "fnSelect": function( nButton, oConfig ) {
- if ( this.fnGetSelected().length == this.s.dt.fnRecordsDisplay() ) {
- $(nButton).addClass( this.classes.buttons.disabled );
- } else {
- $(nButton).removeClass( this.classes.buttons.disabled );
- }
- }
- } ),
- "select_none": $.extend( {}, TableTools.buttonBase, {
- "sButtonText": "Deselect all",
- "fnClick": function( nButton, oConfig ) {
- this.fnSelectNone();
- },
- "fnSelect": function( nButton, oConfig ) {
- if ( this.fnGetSelected().length !== 0 ) {
- $(nButton).removeClass( this.classes.buttons.disabled );
- } else {
- $(nButton).addClass( this.classes.buttons.disabled );
- }
- },
- "fnInit": function( nButton, oConfig ) {
- $(nButton).addClass( this.classes.buttons.disabled );
- }
- } ),
- "ajax": $.extend( {}, TableTools.buttonBase, {
- "sAjaxUrl": "/xhr.php",
- "sButtonText": "Ajax button",
- "fnClick": function( nButton, oConfig ) {
- var sData = this.fnGetTableData(oConfig);
- $.ajax( {
- "url": oConfig.sAjaxUrl,
- "data": [
- { "name": "tableData", "value": sData }
- ],
- "success": oConfig.fnAjaxComplete,
- "dataType": "json",
- "type": "POST",
- "cache": false,
- "error": function () {
- alert( "Error detected when sending table data to server" );
- }
- } );
- },
- "fnAjaxComplete": function( json ) {
- alert( 'Ajax complete' );
- }
- } ),
- "div": $.extend( {}, TableTools.buttonBase, {
- "sAction": "div",
- "sTag": "div",
- "sButtonClass": "DTTT_nonbutton",
- "sButtonText": "Text button"
- } ),
- "collection": $.extend( {}, TableTools.buttonBase, {
- "sAction": "collection",
- "sButtonClass": "DTTT_button_collection",
- "sButtonText": "Collection",
- "fnClick": function( nButton, oConfig ) {
- this._fnCollectionShow(nButton, oConfig);
- }
- } )
- };
- /*
- * on* callback parameters:
- * 1. node - button element
- * 2. object - configuration object for this button
- * 3. object - ZeroClipboard reference (flash button only)
- * 4. string - Returned string from Flash (flash button only - and only on 'complete')
- */
- // Alias to match the other plug-ins styling
- TableTools.buttons = TableTools.BUTTONS;
- /**
- * @namespace Classes used by TableTools - allows the styles to be override easily.
- * Note that when TableTools initialises it will take a copy of the classes object
- * and will use its internal copy for the remainder of its run time.
- */
- TableTools.classes = {
- "container": "DTTT_container",
- "buttons": {
- "normal": "DTTT_button",
- "disabled": "DTTT_disabled"
- },
- "collection": {
- "container": "DTTT_collection",
- "background": "DTTT_collection_background",
- "buttons": {
- "normal": "DTTT_button",
- "disabled": "DTTT_disabled"
- }
- },
- "select": {
- "table": "DTTT_selectable",
- "row": "DTTT_selected selected"
- },
- "print": {
- "body": "DTTT_Print",
- "info": "DTTT_print_info",
- "message": "DTTT_PrintMessage"
- }
- };
- /**
- * @namespace ThemeRoller classes - built in for compatibility with DataTables'
- * bJQueryUI option.
- */
- TableTools.classes_themeroller = {
- "container": "DTTT_container ui-buttonset ui-buttonset-multi",
- "buttons": {
- "normal": "DTTT_button ui-button ui-state-default"
- },
- "collection": {
- "container": "DTTT_collection ui-buttonset ui-buttonset-multi"
- }
- };
- /**
- * @namespace TableTools default settings for initialisation
- */
- TableTools.DEFAULTS = {
- "sSwfPath": "../swf/copy_csv_xls_pdf.swf",
- "sRowSelect": "none",
- "sRowSelector": "tr",
- "sSelectedClass": null,
- "fnPreRowSelect": null,
- "fnRowSelected": null,
- "fnRowDeselected": null,
- "aButtons": [ "copy", "csv", "xls", "pdf", "print" ],
- "oTags": {
- "container": "div",
- "button": "a", // We really want to use buttons here, but Firefox and IE ignore the
- // click on the Flash element in the button (but not mouse[in|out]).
- "liner": "span",
- "collection": {
- "container": "div",
- "button": "a",
- "liner": "span"
- }
- }
- };
- // Alias to match the other plug-ins
- TableTools.defaults = TableTools.DEFAULTS;
- /**
- * Name of this class
- * @constant CLASS
- * @type String
- * @default TableTools
- */
- TableTools.prototype.CLASS = "TableTools";
- /**
- * TableTools version
- * @constant VERSION
- * @type String
- * @default See code
- */
- TableTools.version = "2.2.4";
- // DataTables 1.10 API
- //
- // This will be extended in a big way in in TableTools 3 to provide API methods
- // such as rows().select() and rows.selected() etc, but for the moment the
- // tabletools() method simply returns the instance.
- if ( $.fn.dataTable.Api ) {
- $.fn.dataTable.Api.register( 'tabletools()', function () {
- var tt = null;
- if ( this.context.length > 0 ) {
- tt = TableTools.fnGetInstance( this.context[0].nTable );
- }
- return tt;
- } );
- }
- /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * Initialisation
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
- /*
- * Register a new feature with DataTables
- */
- if ( typeof $.fn.dataTable == "function" &&
- typeof $.fn.dataTableExt.fnVersionCheck == "function" &&
- $.fn.dataTableExt.fnVersionCheck('1.9.0') )
- {
- $.fn.dataTableExt.aoFeatures.push( {
- "fnInit": function( oDTSettings ) {
- var init = oDTSettings.oInit;
- var opts = init ?
- init.tableTools || init.oTableTools || {} :
- {};
- return new TableTools( oDTSettings.oInstance, opts ).dom.container;
- },
- "cFeature": "T",
- "sFeature": "TableTools"
- } );
- }
- else
- {
- alert( "Warning: TableTools requires DataTables 1.9.0 or newer - www.datatables.net/download");
- }
- $.fn.DataTable.TableTools = TableTools;
- })(jQuery, window, document);
- /*
- * Register a new feature with DataTables
- */
- if ( typeof $.fn.dataTable == "function" &&
- typeof $.fn.dataTableExt.fnVersionCheck == "function" &&
- $.fn.dataTableExt.fnVersionCheck('1.9.0') )
- {
- $.fn.dataTableExt.aoFeatures.push( {
- "fnInit": function( oDTSettings ) {
- var oOpts = typeof oDTSettings.oInit.oTableTools != 'undefined' ?
- oDTSettings.oInit.oTableTools : {};
- var oTT = new TableTools( oDTSettings.oInstance, oOpts );
- TableTools._aInstances.push( oTT );
- return oTT.dom.container;
- },
- "cFeature": "T",
- "sFeature": "TableTools"
- } );
- }
- else
- {
- alert( "Warning: TableTools 2 requires DataTables 1.9.0 or newer - www.datatables.net/download");
- }
- $.fn.dataTable.TableTools = TableTools;
- $.fn.DataTable.TableTools = TableTools;
- return TableTools;
- }; // /factory
- // Define as an AMD module if possible
- if ( typeof define === 'function' && define.amd ) {
- define( ['jquery', 'datatables'], factory );
- }
- else if ( typeof exports === 'object' ) {
- // Node/CommonJS
- factory( require('jquery'), require('datatables') );
- }
- else if ( jQuery && !jQuery.fn.dataTable.TableTools ) {
- // Otherwise simply initialise as normal, stopping multiple evaluation
- factory( jQuery, jQuery.fn.dataTable );
- }
- })(window, document);
- /*! ColVis 1.1.2
- * ©2010-2015 SpryMedia Ltd - datatables.net/license
- */
- /**
- * @summary ColVis
- * @description Controls for column visibility in DataTables
- * @version 1.1.2
- * @file dataTables.colReorder.js
- * @author SpryMedia Ltd (www.sprymedia.co.uk)
- * @contact www.sprymedia.co.uk/contact
- * @copyright Copyright 2010-2015 SpryMedia Ltd.
- *
- * This source file is free software, available under the following license:
- * MIT license - http://datatables.net/license/mit
- *
- * This source file is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE. See the license files for details.
- *
- * For details please refer to: http://www.datatables.net
- */
- (function(window, document, undefined) {
- var factory = function( $, DataTable ) {
- "use strict";
- /**
- * ColVis provides column visibility control for DataTables
- *
- * @class ColVis
- * @constructor
- * @param {object} DataTables settings object. With DataTables 1.10 this can
- * also be and API instance, table node, jQuery collection or jQuery selector.
- * @param {object} ColVis configuration options
- */
- var ColVis = function( oDTSettings, oInit )
- {
- /* Santiy check that we are a new instance */
- if ( !this.CLASS || this.CLASS != "ColVis" )
- {
- alert( "Warning: ColVis must be initialised with the keyword 'new'" );
- }
- if ( typeof oInit == 'undefined' )
- {
- oInit = {};
- }
- var camelToHungarian = $.fn.dataTable.camelToHungarian;
- if ( camelToHungarian ) {
- camelToHungarian( ColVis.defaults, ColVis.defaults, true );
- camelToHungarian( ColVis.defaults, oInit );
- }
- /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * Public class variables
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
- /**
- * @namespace Settings object which contains customisable information for
- * ColVis instance. Augmented by ColVis.defaults
- */
- this.s = {
- /**
- * DataTables settings object
- * @property dt
- * @type Object
- * @default null
- */
- "dt": null,
- /**
- * Customisation object
- * @property oInit
- * @type Object
- * @default passed in
- */
- "oInit": oInit,
- /**
- * Flag to say if the collection is hidden
- * @property hidden
- * @type boolean
- * @default true
- */
- "hidden": true,
- /**
- * Store the original visibility settings so they could be restored
- * @property abOriginal
- * @type Array
- * @default []
- */
- "abOriginal": []
- };
- /**
- * @namespace Common and useful DOM elements for the class instance
- */
- this.dom = {
- /**
- * Wrapper for the button - given back to DataTables as the node to insert
- * @property wrapper
- * @type Node
- * @default null
- */
- "wrapper": null,
- /**
- * Activation button
- * @property button
- * @type Node
- * @default null
- */
- "button": null,
- /**
- * Collection list node
- * @property collection
- * @type Node
- * @default null
- */
- "collection": null,
- /**
- * Background node used for shading the display and event capturing
- * @property background
- * @type Node
- * @default null
- */
- "background": null,
- /**
- * Element to position over the activation button to catch mouse events when using mouseover
- * @property catcher
- * @type Node
- * @default null
- */
- "catcher": null,
- /**
- * List of button elements
- * @property buttons
- * @type Array
- * @default []
- */
- "buttons": [],
- /**
- * List of group button elements
- * @property groupButtons
- * @type Array
- * @default []
- */
- "groupButtons": [],
- /**
- * Restore button
- * @property restore
- * @type Node
- * @default null
- */
- "restore": null
- };
- /* Store global reference */
- ColVis.aInstances.push( this );
- /* Constructor logic */
- this.s.dt = $.fn.dataTable.Api ?
- new $.fn.dataTable.Api( oDTSettings ).settings()[0] :
- oDTSettings;
- this._fnConstruct( oInit );
- return this;
- };
- ColVis.prototype = {
- /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * Public methods
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
- /**
- * Get the ColVis instance's control button so it can be injected into the
- * DOM
- * @method button
- * @returns {node} ColVis button
- */
- button: function ()
- {
- return this.dom.wrapper;
- },
- /**
- * Alias of `rebuild` for backwards compatibility
- * @method fnRebuild
- */
- "fnRebuild": function ()
- {
- this.rebuild();
- },
- /**
- * Rebuild the list of buttons for this instance (i.e. if there is a column
- * header update)
- * @method fnRebuild
- */
- rebuild: function ()
- {
- /* Remove the old buttons */
- for ( var i=this.dom.buttons.length-1 ; i>=0 ; i-- ) {
- this.dom.collection.removeChild( this.dom.buttons[i] );
- }
- this.dom.buttons.splice( 0, this.dom.buttons.length );
- this.dom.groupButtons.splice(0, this.dom.groupButtons.length);
- if ( this.dom.restore ) {
- this.dom.restore.parentNode( this.dom.restore );
- }
- /* Re-add them (this is not the optimal way of doing this, it is fast and effective) */
- this._fnAddGroups();
- this._fnAddButtons();
- /* Update the checkboxes */
- this._fnDrawCallback();
- },
- /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * Private methods (they are of course public in JS, but recommended as private)
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
- /**
- * Constructor logic
- * @method _fnConstruct
- * @returns void
- * @private
- */
- "_fnConstruct": function ( init )
- {
- this._fnApplyCustomisation( init );
- var that = this;
- var i, iLen;
- this.dom.wrapper = document.createElement('div');
- this.dom.wrapper.className = "ColVis";
- this.dom.button = $( '<button />', {
- 'class': !this.s.dt.bJUI ?
- "ColVis_Button ColVis_MasterButton" :
- "ColVis_Button ColVis_MasterButton ui-button ui-state-default"
- } )
- .append( '<span>'+this.s.buttonText+'</span>' )
- .bind( this.s.activate=="mouseover" ? "mouseover" : "click", function (e) {
- e.preventDefault();
- that._fnCollectionShow();
- } )
- .appendTo( this.dom.wrapper )[0];
- this.dom.catcher = this._fnDomCatcher();
- this.dom.collection = this._fnDomCollection();
- this.dom.background = this._fnDomBackground();
- this._fnAddGroups();
- this._fnAddButtons();
- /* Store the original visibility information */
- for ( i=0, iLen=this.s.dt.aoColumns.length ; i<iLen ; i++ )
- {
- this.s.abOriginal.push( this.s.dt.aoColumns[i].bVisible );
- }
- /* Update on each draw */
- this.s.dt.aoDrawCallback.push( {
- "fn": function () {
- that._fnDrawCallback.call( that );
- },
- "sName": "ColVis"
- } );
- /* If columns are reordered, then we need to update our exclude list and
- * rebuild the displayed list
- */
- $(this.s.dt.oInstance).bind( 'column-reorder.dt', function ( e, oSettings, oReorder ) {
- for ( i=0, iLen=that.s.aiExclude.length ; i<iLen ; i++ ) {
- that.s.aiExclude[i] = oReorder.aiInvertMapping[ that.s.aiExclude[i] ];
- }
- var mStore = that.s.abOriginal.splice( oReorder.iFrom, 1 )[0];
- that.s.abOriginal.splice( oReorder.iTo, 0, mStore );
- that.fnRebuild();
- } );
- $(this.s.dt.oInstance).bind( 'destroy.dt', function () {
- $(that.dom.wrapper).remove();
- } );
- // Set the initial state
- this._fnDrawCallback();
- },
- /**
- * Apply any customisation to the settings from the DataTables initialisation
- * @method _fnApplyCustomisation
- * @returns void
- * @private
- */
- "_fnApplyCustomisation": function ( init )
- {
- $.extend( true, this.s, ColVis.defaults, init );
- // Slightly messy overlap for the camelCase notation
- if ( ! this.s.showAll && this.s.bShowAll ) {
- this.s.showAll = this.s.sShowAll;
- }
- if ( ! this.s.restore && this.s.bRestore ) {
- this.s.restore = this.s.sRestore;
- }
- // CamelCase to Hungarian for the column groups
- var groups = this.s.groups;
- var hungarianGroups = this.s.aoGroups;
- if ( groups ) {
- for ( var i=0, ien=groups.length ; i<ien ; i++ ) {
- if ( groups[i].title ) {
- hungarianGroups[i].sTitle = groups[i].title;
- }
- if ( groups[i].columns ) {
- hungarianGroups[i].aiColumns = groups[i].columns;
- }
- }
- }
- },
- /**
- * On each table draw, check the visibility checkboxes as needed. This allows any process to
- * update the table's column visibility and ColVis will still be accurate.
- * @method _fnDrawCallback
- * @returns void
- * @private
- */
- "_fnDrawCallback": function ()
- {
- var columns = this.s.dt.aoColumns;
- var buttons = this.dom.buttons;
- var groups = this.s.aoGroups;
- var button;
- for ( var i=0, ien=buttons.length ; i<ien ; i++ ) {
- button = buttons[i];
- if ( button.__columnIdx !== undefined ) {
- $('input', button).prop( 'checked', columns[ button.__columnIdx ].bVisible );
- }
- }
- var allVisible = function ( columnIndeces ) {
- for ( var k=0, kLen=columnIndeces.length ; k<kLen ; k++ )
- {
- if ( columns[columnIndeces[k]].bVisible === false ) { return false; }
- }
- return true;
- };
- var allHidden = function ( columnIndeces ) {
- for ( var m=0 , mLen=columnIndeces.length ; m<mLen ; m++ )
- {
- if ( columns[columnIndeces[m]].bVisible === true ) { return false; }
- }
- return true;
- };
- for ( var j=0, jLen=groups.length ; j<jLen ; j++ )
- {
- if ( allVisible(groups[j].aiColumns) )
- {
- $('input', this.dom.groupButtons[j]).prop('checked', true);
- $('input', this.dom.groupButtons[j]).prop('indeterminate', false);
- }
- else if ( allHidden(groups[j].aiColumns) )
- {
- $('input', this.dom.groupButtons[j]).prop('checked', false);
- $('input', this.dom.groupButtons[j]).prop('indeterminate', false);
- }
- else
- {
- $('input', this.dom.groupButtons[j]).prop('indeterminate', true);
- }
- }
- },
- /**
- * Loop through the groups (provided in the settings) and create a button for each.
- * @method _fnAddgroups
- * @returns void
- * @private
- */
- "_fnAddGroups": function ()
- {
- var nButton;
- if ( typeof this.s.aoGroups != 'undefined' )
- {
- for ( var i=0, iLen=this.s.aoGroups.length ; i<iLen ; i++ )
- {
- nButton = this._fnDomGroupButton( i );
- this.dom.groupButtons.push( nButton );
- this.dom.buttons.push( nButton );
- this.dom.collection.appendChild( nButton );
- }
- }
- },
- /**
- * Loop through the columns in the table and as a new button for each one.
- * @method _fnAddButtons
- * @returns void
- * @private
- */
- "_fnAddButtons": function ()
- {
- var
- nButton,
- columns = this.s.dt.aoColumns;
- if ( $.inArray( 'all', this.s.aiExclude ) === -1 ) {
- for ( var i=0, iLen=columns.length ; i<iLen ; i++ )
- {
- if ( $.inArray( i, this.s.aiExclude ) === -1 )
- {
- nButton = this._fnDomColumnButton( i );
- nButton.__columnIdx = i;
- this.dom.buttons.push( nButton );
- }
- }
- }
- if ( this.s.order === 'alpha' ) {
- this.dom.buttons.sort( function ( a, b ) {
- var titleA = columns[ a.__columnIdx ].sTitle;
- var titleB = columns[ b.__columnIdx ].sTitle;
- return titleA === titleB ?
- 0 :
- titleA < titleB ?
- -1 :
- 1;
- } );
- }
- if ( this.s.restore )
- {
- nButton = this._fnDomRestoreButton();
- nButton.className += " ColVis_Restore";
- this.dom.buttons.push( nButton );
- }
- if ( this.s.showAll )
- {
- nButton = this._fnDomShowXButton( this.s.showAll, true );
- nButton.className += " ColVis_ShowAll";
- this.dom.buttons.push( nButton );
- }
- if ( this.s.showNone )
- {
- nButton = this._fnDomShowXButton( this.s.showNone, false );
- nButton.className += " ColVis_ShowNone";
- this.dom.buttons.push( nButton );
- }
- $(this.dom.collection).append( this.dom.buttons );
- },
- /**
- * Create a button which allows a "restore" action
- * @method _fnDomRestoreButton
- * @returns {Node} Created button
- * @private
- */
- "_fnDomRestoreButton": function ()
- {
- var
- that = this,
- dt = this.s.dt;
- return $(
- '<li class="ColVis_Special '+(dt.bJUI ? 'ui-button ui-state-default' : '')+'">'+
- this.s.restore+
- '</li>'
- )
- .click( function (e) {
- for ( var i=0, iLen=that.s.abOriginal.length ; i<iLen ; i++ )
- {
- that.s.dt.oInstance.fnSetColumnVis( i, that.s.abOriginal[i], false );
- }
- that._fnAdjustOpenRows();
- that.s.dt.oInstance.fnAdjustColumnSizing( false );
- that.s.dt.oInstance.fnDraw( false );
- } )[0];
- },
- /**
- * Create a button which allows show all and show node actions
- * @method _fnDomShowXButton
- * @returns {Node} Created button
- * @private
- */
- "_fnDomShowXButton": function ( str, action )
- {
- var
- that = this,
- dt = this.s.dt;
- return $(
- '<li class="ColVis_Special '+(dt.bJUI ? 'ui-button ui-state-default' : '')+'">'+
- str+
- '</li>'
- )
- .click( function (e) {
- for ( var i=0, iLen=that.s.abOriginal.length ; i<iLen ; i++ )
- {
- if (that.s.aiExclude.indexOf(i) === -1)
- {
- that.s.dt.oInstance.fnSetColumnVis( i, action, false );
- }
- }
- that._fnAdjustOpenRows();
- that.s.dt.oInstance.fnAdjustColumnSizing( false );
- that.s.dt.oInstance.fnDraw( false );
- } )[0];
- },
- /**
- * Create the DOM for a show / hide group button
- * @method _fnDomGroupButton
- * @param {int} i Group in question, order based on that provided in settings
- * @returns {Node} Created button
- * @private
- */
- "_fnDomGroupButton": function ( i )
- {
- var
- that = this,
- dt = this.s.dt,
- oGroup = this.s.aoGroups[i];
- return $(
- '<li class="ColVis_Special '+(dt.bJUI ? 'ui-button ui-state-default' : '')+'">'+
- '<label>'+
- '<input type="checkbox" />'+
- '<span>'+oGroup.sTitle+'</span>'+
- '</label>'+
- '</li>'
- )
- .click( function (e) {
- var showHide = !$('input', this).is(":checked");
- if ( e.target.nodeName.toLowerCase() !== "li" )
- {
- showHide = ! showHide;
- }
- for ( var j=0 ; j < oGroup.aiColumns.length ; j++ )
- {
- that.s.dt.oInstance.fnSetColumnVis( oGroup.aiColumns[j], showHide );
- }
- } )[0];
- },
- /**
- * Create the DOM for a show / hide button
- * @method _fnDomColumnButton
- * @param {int} i Column in question
- * @returns {Node} Created button
- * @private
- */
- "_fnDomColumnButton": function ( i )
- {
- var
- that = this,
- column = this.s.dt.aoColumns[i],
- dt = this.s.dt;
- var title = this.s.fnLabel===null ?
- column.sTitle :
- this.s.fnLabel( i, column.sTitle, column.nTh );
- return $(
- '<li '+(dt.bJUI ? 'class="ui-button ui-state-default"' : '')+'>'+
- '<label>'+
- '<input type="checkbox" />'+
- '<span>'+title+'</span>'+
- '</label>'+
- '</li>'
- )
- .click( function (e) {
- var showHide = !$('input', this).is(":checked");
- if ( e.target.nodeName.toLowerCase() !== "li" )
- {
- if ( e.target.nodeName.toLowerCase() == "input" || that.s.fnStateChange === null )
- {
- showHide = ! showHide;
- }
- }
- /* Need to consider the case where the initialiser created more than one table - change the
- * API index that DataTables is using
- */
- var oldIndex = $.fn.dataTableExt.iApiIndex;
- $.fn.dataTableExt.iApiIndex = that._fnDataTablesApiIndex.call(that);
- // Optimisation for server-side processing when scrolling - don't do a full redraw
- if ( dt.oFeatures.bServerSide )
- {
- that.s.dt.oInstance.fnSetColumnVis( i, showHide, false );
- that.s.dt.oInstance.fnAdjustColumnSizing( false );
- if (dt.oScroll.sX !== "" || dt.oScroll.sY !== "" )
- {
- that.s.dt.oInstance.oApi._fnScrollDraw( that.s.dt );
- }
- that._fnDrawCallback();
- }
- else
- {
- that.s.dt.oInstance.fnSetColumnVis( i, showHide );
- }
- $.fn.dataTableExt.iApiIndex = oldIndex; /* Restore */
- if ( that.s.fnStateChange !== null )
- {
- if ( e.target.nodeName.toLowerCase() == "span" )
- {
- e.preventDefault();
- }
- that.s.fnStateChange.call( that, i, showHide );
- }
- } )[0];
- },
- /**
- * Get the position in the DataTables instance array of the table for this
- * instance of ColVis
- * @method _fnDataTablesApiIndex
- * @returns {int} Index
- * @private
- */
- "_fnDataTablesApiIndex": function ()
- {
- for ( var i=0, iLen=this.s.dt.oInstance.length ; i<iLen ; i++ )
- {
- if ( this.s.dt.oInstance[i] == this.s.dt.nTable )
- {
- return i;
- }
- }
- return 0;
- },
- /**
- * Create the element used to contain list the columns (it is shown and
- * hidden as needed)
- * @method _fnDomCollection
- * @returns {Node} div container for the collection
- * @private
- */
- "_fnDomCollection": function ()
- {
- return $('<ul />', {
- 'class': !this.s.dt.bJUI ?
- "ColVis_collection" :
- "ColVis_collection ui-buttonset ui-buttonset-multi"
- } )
- .css( {
- 'display': 'none',
- 'opacity': 0,
- 'position': ! this.s.bCssPosition ?
- 'absolute' :
- ''
- } )[0];
- },
- /**
- * An element to be placed on top of the activate button to catch events
- * @method _fnDomCatcher
- * @returns {Node} div container for the collection
- * @private
- */
- "_fnDomCatcher": function ()
- {
- var
- that = this,
- nCatcher = document.createElement('div');
- nCatcher.className = "ColVis_catcher";
- $(nCatcher).click( function () {
- that._fnCollectionHide.call( that, null, null );
- } );
- return nCatcher;
- },
- /**
- * Create the element used to shade the background, and capture hide events (it is shown and
- * hidden as needed)
- * @method _fnDomBackground
- * @returns {Node} div container for the background
- * @private
- */
- "_fnDomBackground": function ()
- {
- var that = this;
- var background = $('<div></div>')
- .addClass( 'ColVis_collectionBackground' )
- .css( 'opacity', 0 )
- .click( function () {
- that._fnCollectionHide.call( that, null, null );
- } );
- /* When considering a mouse over action for the activation, we also consider a mouse out
- * which is the same as a mouse over the background - without all the messing around of
- * bubbling events. Use the catcher element to avoid messing around with bubbling
- */
- if ( this.s.activate == "mouseover" )
- {
- background.mouseover( function () {
- that.s.overcollection = false;
- that._fnCollectionHide.call( that, null, null );
- } );
- }
- return background[0];
- },
- /**
- * Show the show / hide list and the background
- * @method _fnCollectionShow
- * @returns void
- * @private
- */
- "_fnCollectionShow": function ()
- {
- var that = this, i, iLen, iLeft;
- var oPos = $(this.dom.button).offset();
- var nHidden = this.dom.collection;
- var nBackground = this.dom.background;
- var iDivX = parseInt(oPos.left, 10);
- var iDivY = parseInt(oPos.top + $(this.dom.button).outerHeight(), 10);
- if ( ! this.s.bCssPosition )
- {
- nHidden.style.top = iDivY+"px";
- nHidden.style.left = iDivX+"px";
- }
- $(nHidden).css( {
- 'display': 'block',
- 'opacity': 0
- } );
- nBackground.style.bottom ='0px';
- nBackground.style.right = '0px';
- var oStyle = this.dom.catcher.style;
- oStyle.height = $(this.dom.button).outerHeight()+"px";
- oStyle.width = $(this.dom.button).outerWidth()+"px";
- oStyle.top = oPos.top+"px";
- oStyle.left = iDivX+"px";
- document.body.appendChild( nBackground );
- document.body.appendChild( nHidden );
- document.body.appendChild( this.dom.catcher );
- /* This results in a very small delay for the end user but it allows the animation to be
- * much smoother. If you don't want the animation, then the setTimeout can be removed
- */
- $(nHidden).animate({"opacity": 1}, that.s.iOverlayFade);
- $(nBackground).animate({"opacity": 0.1}, that.s.iOverlayFade, 'linear', function () {
- /* In IE6 if you set the checked attribute of a hidden checkbox, then this is not visually
- * reflected. As such, we need to do it here, once it is visible. Unbelievable.
- */
- if ( $.browser && $.browser.msie && $.browser.version == "6.0" )
- {
- that._fnDrawCallback();
- }
- });
- /* Visual corrections to try and keep the collection visible */
- if ( !this.s.bCssPosition )
- {
- iLeft = ( this.s.sAlign=="left" ) ?
- iDivX :
- iDivX - $(nHidden).outerWidth() + $(this.dom.button).outerWidth();
- nHidden.style.left = iLeft+"px";
- var iDivWidth = $(nHidden).outerWidth();
- var iDivHeight = $(nHidden).outerHeight();
- var iDocWidth = $(document).width();
- if ( iLeft + iDivWidth > iDocWidth )
- {
- nHidden.style.left = (iDocWidth-iDivWidth)+"px";
- }
- }
- this.s.hidden = false;
- },
- /**
- * Hide the show / hide list and the background
- * @method _fnCollectionHide
- * @returns void
- * @private
- */
- "_fnCollectionHide": function ( )
- {
- var that = this;
- if ( !this.s.hidden && this.dom.collection !== null )
- {
- this.s.hidden = true;
- $(this.dom.collection).animate({"opacity": 0}, that.s.iOverlayFade, function (e) {
- this.style.display = "none";
- } );
- $(this.dom.background).animate({"opacity": 0}, that.s.iOverlayFade, function (e) {
- document.body.removeChild( that.dom.background );
- document.body.removeChild( that.dom.catcher );
- } );
- }
- },
- /**
- * Alter the colspan on any fnOpen rows
- */
- "_fnAdjustOpenRows": function ()
- {
- var aoOpen = this.s.dt.aoOpenRows;
- var iVisible = this.s.dt.oApi._fnVisbleColumns( this.s.dt );
- for ( var i=0, iLen=aoOpen.length ; i<iLen ; i++ ) {
- aoOpen[i].nTr.getElementsByTagName('td')[0].colSpan = iVisible;
- }
- }
- };
- /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * Static object methods
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
- /**
- * Rebuild the collection for a given table, or all tables if no parameter given
- * @method ColVis.fnRebuild
- * @static
- * @param object oTable DataTable instance to consider - optional
- * @returns void
- */
- ColVis.fnRebuild = function ( oTable )
- {
- var nTable = null;
- if ( typeof oTable != 'undefined' )
- {
- nTable = $.fn.dataTable.Api ?
- new $.fn.dataTable.Api( oTable ).table().node() :
- oTable.fnSettings().nTable;
- }
- for ( var i=0, iLen=ColVis.aInstances.length ; i<iLen ; i++ )
- {
- if ( typeof oTable == 'undefined' || nTable == ColVis.aInstances[i].s.dt.nTable )
- {
- ColVis.aInstances[i].fnRebuild();
- }
- }
- };
- ColVis.defaults = {
- /**
- * Mode of activation. Can be 'click' or 'mouseover'
- * @property activate
- * @type string
- * @default click
- */
- active: 'click',
- /**
- * Text used for the button
- * @property buttonText
- * @type string
- * @default Show / hide columns
- */
- buttonText: 'Show / hide columns',
- /**
- * List of columns (integers) which should be excluded from the list
- * @property aiExclude
- * @type array
- * @default []
- */
- aiExclude: [],
- /**
- * Show restore button
- * @property bRestore
- * @type boolean
- * @default false
- */
- bRestore: false,
- /**
- * Restore button text
- * @property sRestore
- * @type string
- * @default Restore original
- */
- sRestore: 'Restore original',
- /**
- * Show Show-All button
- * @property bShowAll
- * @type boolean
- * @default false
- */
- bShowAll: false,
- /**
- * Show All button text
- * @property sShowAll
- * @type string
- * @default Restore original
- */
- sShowAll: 'Show All',
- /**
- * Position of the collection menu when shown - align "left" or "right"
- * @property sAlign
- * @type string
- * @default left
- */
- sAlign: 'left',
- /**
- * Callback function to tell the user when the state has changed
- * @property fnStateChange
- * @type function
- * @default null
- */
- fnStateChange: null,
- /**
- * Overlay animation duration in mS
- * @property iOverlayFade
- * @type integer|false
- * @default 500
- */
- iOverlayFade: 500,
- /**
- * Label callback for column names. Takes three parameters: 1. the
- * column index, 2. the column title detected by DataTables and 3. the
- * TH node for the column
- * @property fnLabel
- * @type function
- * @default null
- */
- fnLabel: null,
- /**
- * Indicate if the column list should be positioned by Javascript,
- * visually below the button or allow CSS to do the positioning
- * @property bCssPosition
- * @type boolean
- * @default false
- */
- bCssPosition: false,
- /**
- * Group buttons
- * @property aoGroups
- * @type array
- * @default []
- */
- aoGroups: [],
- /**
- * Button ordering - 'alpha' (alphabetical) or 'column' (table column
- * order)
- * @property order
- * @type string
- * @default column
- */
- order: 'column'
- };
- /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * Static object properties
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
- /**
- * Collection of all ColVis instances
- * @property ColVis.aInstances
- * @static
- * @type Array
- * @default []
- */
- ColVis.aInstances = [];
- /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * Constants
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
- /**
- * Name of this class
- * @constant CLASS
- * @type String
- * @default ColVis
- */
- ColVis.prototype.CLASS = "ColVis";
- /**
- * ColVis version
- * @constant VERSION
- * @type String
- * @default See code
- */
- ColVis.VERSION = "1.1.2";
- ColVis.prototype.VERSION = ColVis.VERSION;
- /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * Initialisation
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
- /*
- * Register a new feature with DataTables
- */
- if ( typeof $.fn.dataTable == "function" &&
- typeof $.fn.dataTableExt.fnVersionCheck == "function" &&
- $.fn.dataTableExt.fnVersionCheck('1.7.0') )
- {
- $.fn.dataTableExt.aoFeatures.push( {
- "fnInit": function( oDTSettings ) {
- var init = oDTSettings.oInit;
- var colvis = new ColVis( oDTSettings, init.colVis || init.oColVis || {} );
- return colvis.button();
- },
- "cFeature": "C",
- "sFeature": "ColVis"
- } );
- }
- else
- {
- alert( "Warning: ColVis requires DataTables 1.7 or greater - www.datatables.net/download");
- }
- // Make ColVis accessible from the DataTables instance
- $.fn.dataTable.ColVis = ColVis;
- $.fn.DataTable.ColVis = ColVis;
- return ColVis;
- }; // /factory
- // Define as an AMD module if possible
- if ( typeof define === 'function' && define.amd ) {
- define( ['jquery', 'datatables'], factory );
- }
- else if ( typeof exports === 'object' ) {
- // Node/CommonJS
- factory( require('jquery'), require('datatables') );
- }
- else if ( jQuery && !jQuery.fn.dataTable.ColVis ) {
- // Otherwise simply initialise as normal, stopping multiple evaluation
- factory( jQuery, jQuery.fn.dataTable );
- }
- })(window, document);
- /**
- * File: datatables.responsive.js
- * Version: 0.2.0
- * Author: Seen Sai Yang
- * Info: https://github.com/Comanche/datatables-responsive
- *
- * Copyright 2013 Seen Sai Yang, all rights reserved.
- *
- * This source file is free software, under either the GPL v2 license or a
- * BSD style license.
- *
- * This source file is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE. See the license files for details.
- *
- * You should have received a copy of the GNU General Public License and the
- * BSD license along with this program. These licenses are also available at:
- * https://raw.github.com/Comanche/datatables-responsive/master/license-gpl2.txt
- * https://raw.github.com/Comanche/datatables-responsive/master/license-bsd.txt
- */
- 'use strict';
- /**
- * Constructor for responsive datables helper.
- *
- * This helper class makes datatables responsive to the window size.
- *
- * The parameter, breakpoints, is an object for each breakpoint key/value pair
- * with the following format: { breakpoint_name: pixel_width_at_breakpoint }.
- *
- * An example is as follows:
- *
- * {
- * tablet: 1024,
- * phone: 480
- * }
- *
- * These breakpoint name may be used as possible values for the data-hide
- * attribute. The data-hide attribute is optional and may be defined for each
- * th element in the table header.
- *
- * The parameter, options, is an object of options supported by the responsive
- * helper. The following options are supported:
- *
- * {
- * hideEmptyColumnsInRowDetail - Boolean, default: false.
- * clickOn - icon|cell|row, default: icon
- * showDetail - function called when detail row shown
- * hideDetail - function called when detail row hidden
- * }
- *
- * @param {Object|string} tableSelector jQuery wrapped set or selector for
- * datatables container element.
- * @param {Object} breakpoints Object defining the responsive
- * breakpoint for datatables.
- * @param {Object} options Object of options.
- */
- function ResponsiveDatatablesHelper(tableSelector, breakpoints, options) {
- if (typeof tableSelector === 'string') {
- this.tableElement = $(tableSelector);
- } else {
- this.tableElement = tableSelector;
- }
- // Get data table API.
- this.api = this.tableElement.dataTable().api();
- // State of column indexes and which are shown or hidden.
- this.columnIndexes = [];
- this.columnsShownIndexes = [];
- this.columnsHiddenIndexes = [];
- this.currentBreakpoint = '';
- this.lastBreakpoint = '';
- this.lastColumnsHiddenIndexes = [];
- // Save state
- var fileName = window.location.pathname.split("/").pop();
- var context = this.api.settings().context[0];
- this.tableId = context.sTableId;
- this.saveState = context.oInit.bStateSave;
- this.cookieName = 'DataTablesResponsiveHelper_' + this.tableId + (fileName ? '_' + fileName : '');
- this.lastStateExists = false;
- // Index of the th in the header tr that stores where the attribute
- // data-class="expand"
- // is defined.
- this.expandColumn = undefined;
- // Stores original breakpoint defitions
- this.origBreakpointsDefs = undefined;
- // Stores the break points defined in the table header.
- // Each th in the header tr may contain an optional attribute like
- // data-hide="phone,tablet"
- // These attributes and the breakpoints object will be used to create this
- // object.
- this.breakpoints = {
- /**
- * We will be generating data in the following format:
- * phone : {
- * lowerLimit : undefined,
- * upperLimit : 320,
- * columnsToHide: []
- * },
- * tablet: {
- * lowerLimit : 320,
- * upperLimit : 724,
- * columnsToHide: []
- * }
- */
- };
- // Store default options
- this.options = {
- hideEmptyColumnsInRowDetail: false,
- clickOn: 'icon',
- showDetail: null,
- hideDetail: null
- };
- // Expand icon template
- this.expandIconTemplate = '<span class="responsiveExpander"></span>';
- // Row template
- this.rowTemplate = '<tr class="row-detail"><td><ul><!--column item--></ul></td></tr>';
- this.rowLiTemplate = '<li><span class="columnTitle"><!--column title--></span>: <span class="columnValue"><!--column value--></span></li>';
- // Responsive behavior on/off flag
- this.disabled = true;
- // Skip next windows width change flag
- this.skipNextWindowsWidthChange = false;
- // Initialize settings
- this.init(breakpoints, options);
- }
- /**
- * Responsive datatables helper init function.
- * Builds breakpoint limits for columns and begins to listen to window resize
- * event.
- *
- * See constructor for the breakpoints parameter.
- *
- * @param {Object} breakpoints
- * @param {Object} options
- */
- ResponsiveDatatablesHelper.prototype.init = function (breakpoints, options) {
- this.origBreakpointsDefs = breakpoints;
- this.initBreakpoints();
- // Enable responsive behavior.
- this.disable(false);
- // Extend options
- $.extend(this.options, options);
- };
- ResponsiveDatatablesHelper.prototype.initBreakpoints = function () {
- // Get last state if it exists
- if (this.saveState) {
- this.getState();
- }
- if (!this.lastStateExists) {
- /** Generate breakpoints in the format we need. ***********************/
- // First, we need to create a sorted array of the breakpoints given.
- var breakpointsSorted = [];
- for (var prop in this.origBreakpointsDefs) {
- breakpointsSorted.push({
- name: prop,
- upperLimit: this.origBreakpointsDefs[prop],
- columnsToHide: []
- });
- }
- breakpointsSorted.sort(function (a, b) {
- return a.upperLimit - b.upperLimit;
- });
- // Set lower and upper limits for each breakpoint.
- var lowerLimit = 0;
- for (var i = 0; i < breakpointsSorted.length; i++) {
- breakpointsSorted[i].lowerLimit = lowerLimit;
- lowerLimit = breakpointsSorted[i].upperLimit;
- }
- // Add the default breakpoint which shows all (has no upper limit).
- breakpointsSorted.push({
- name : 'always',
- lowerLimit : lowerLimit,
- upperLimit : Infinity,
- columnsToHide: []
- });
- // Copy the sorted breakpoint array into the breakpoints object using the
- // name as the key.
- this.breakpoints = {};
- var i, l;
- for (i = 0, l = breakpointsSorted.length; i < l; i++) {
- this.breakpoints[breakpointsSorted[i].name] = breakpointsSorted[i];
- }
- /** Create range of visible columns and their indexes *****************/
- // We need the range of all visible column indexes to calculate the
- // columns to show:
- // Columns to show = all visible columns - columns to hide
- var columns = this.api.columns().header();
- var visibleColumnsHeadersTds = [];
- for (i = 0, l = columns.length; i < l; i++) {
- if (this.api.column(i).visible()) {
- this.columnIndexes.push(i);
- visibleColumnsHeadersTds.push(columns[i]);
- }
- }
- /** Sort columns into breakpoints respectively ************************/
- // Read column headers' attributes and get needed info
- for (var index = 0; index < visibleColumnsHeadersTds.length; index++) {
- // Get the column with the attribute data-class="expand" so we know
- // where to display the expand icon.
- var col = $(visibleColumnsHeadersTds[index]);
- if (col.attr('data-class') === 'expand') {
- this.expandColumn = this.columnIndexes[index];
- }
- // The data-hide attribute has the breakpoints that this column
- // is associated with.
- // If it's defined, get the data-hide attribute and sort this
- // column into the appropriate breakpoint's columnsToHide array.
- var dataHide = col.attr('data-hide');
- if (dataHide !== undefined) {
- var splitBreakingPoints = dataHide.split(/,\s*/);
- for (var i = 0; i < splitBreakingPoints.length; i++) {
- var bp = splitBreakingPoints[i];
- if (bp === 'always') {
- // A column with an 'always' breakpoint is always hidden.
- // Loop through all breakpoints and add it to each except the
- // default breakpoint.
- for (var prop in this.breakpoints) {
- if (this.breakpoints[prop].name !== 'default') {
- this.breakpoints[prop].columnsToHide.push(this.columnIndexes[index]);
- }
- }
- } else if (this.breakpoints[bp] !== undefined) {
- // Translate visible column index to internal column index.
- this.breakpoints[bp].columnsToHide.push(this.columnIndexes[index]);
- }
- }
- }
- }
- }
- };
- /**
- * Sets or removes window resize handler.
- *
- * @param {Boolean} bindFlag
- */
- ResponsiveDatatablesHelper.prototype.setWindowsResizeHandler = function(bindFlag) {
- if (bindFlag === undefined) {
- bindFlag = true;
- }
- if (bindFlag) {
- var that = this;
- $(window).bind("resize", function () {
- that.respond();
- });
- } else {
- $(window).unbind("resize");
- }
- };
- /**
- * Respond window size change. This helps make datatables responsive.
- */
- ResponsiveDatatablesHelper.prototype.respond = function () {
- if (this.disabled) {
- return;
- }
- var that = this;
- // Get new windows width
- var newWindowWidth = $(window).width();
- // Loop through breakpoints to see which columns need to be shown/hidden.
- var newColumnsToHide = [];
- for (var prop in this.breakpoints) {
- var element = this.breakpoints[prop];
- if ((!element.lowerLimit || newWindowWidth > element.lowerLimit) && (!element.upperLimit || newWindowWidth <= element.upperLimit)) {
- this.currentBreakpoint = element.name;
- newColumnsToHide = element.columnsToHide;
- }
- }
- // Find out if a column show/hide should happen.
- // Skip column show/hide if this window width change follows immediately
- // after a previous column show/hide. This will help prevent a loop.
- var columnShowHide = false;
- if (!this.skipNextWindowsWidthChange) {
- // Check difference in length
- if (this.lastBreakpoint.length === 0 && newColumnsToHide.length) {
- // No previous breakpoint and new breakpoint
- columnShowHide = true;
- } else if (this.lastBreakpoint != this.currentBreakpoint) {
- // Different breakpoints
- columnShowHide = true;
- } else if (this.columnsHiddenIndexes.length !== newColumnsToHide.length) {
- // Difference in number of hidden columns
- columnShowHide = true;
- } else {
- // Possible same number of columns but check for difference in columns
- var d1 = this.difference(this.columnsHiddenIndexes, newColumnsToHide).length;
- var d2 = this.difference(newColumnsToHide, this.columnsHiddenIndexes).length;
- columnShowHide = d1 + d2 > 0;
- }
- }
- if (columnShowHide) {
- // Showing/hiding a column at breakpoint may cause a windows width
- // change. Let's flag to skip the column show/hide that may be
- // caused by the next windows width change.
- this.skipNextWindowsWidthChange = true;
- this.columnsHiddenIndexes = newColumnsToHide;
- this.columnsShownIndexes = this.difference(this.columnIndexes, this.columnsHiddenIndexes);
- this.showHideColumns();
- this.lastBreakpoint = this.currentBreakpoint;
- this.setState();
- this.skipNextWindowsWidthChange = false;
- }
- // We don't skip this part.
- // If one or more columns have been hidden, add the has-columns-hidden class to table.
- // This class will show what state the table is in.
- if (this.columnsHiddenIndexes.length) {
- this.tableElement.addClass('has-columns-hidden');
- // Show details for each row that is tagged with the class .detail-show.
- $('tr.detail-show', this.tableElement).each(function (index, element) {
- var tr = $(element);
- if (tr.next('.row-detail').length === 0) {
- ResponsiveDatatablesHelper.prototype.showRowDetail(that, tr);
- }
- });
- } else {
- this.tableElement.removeClass('has-columns-hidden');
- $('tr.row-detail', this.tableElement).each(function (event) {
- ResponsiveDatatablesHelper.prototype.hideRowDetail(that, $(this).prev());
- });
- }
- };
- /**
- * Show/hide datatables columns.
- */
- ResponsiveDatatablesHelper.prototype.showHideColumns = function () {
- // Calculate the columns to show
- // Show columns that may have been previously hidden.
- for (var i = 0, l = this.columnsShownIndexes.length; i < l; i++) {
- this.api.column(this.columnsShownIndexes[i]).visible(true);
- }
- // Hide columns that may have been previously shown.
- for (var i = 0, l = this.columnsHiddenIndexes.length; i < l; i++) {
- this.api.column(this.columnsHiddenIndexes[i]).visible(false);
- }
- // Rebuild details to reflect shown/hidden column changes.
- var that = this;
- $('tr.row-detail', this.tableElement).each(function () {
- ResponsiveDatatablesHelper.prototype.hideRowDetail(that, $(this).prev());
- });
- if (this.tableElement.hasClass('has-columns-hidden')) {
- $('tr.detail-show', this.tableElement).each(function (index, element) {
- ResponsiveDatatablesHelper.prototype.showRowDetail(that, $(element));
- });
- }
- };
- /**
- * Create the expand icon on the column with the data-class="expand" attribute
- * defined for it's header.
- *
- * @param {Object} tr table row object
- */
- ResponsiveDatatablesHelper.prototype.createExpandIcon = function (tr) {
- if (this.disabled) {
- return;
- }
- // Get the td for tr with the same index as the th in the header tr
- // that has the data-class="expand" attribute defined.
- var tds = $('td', tr);
- // Loop through tds and create an expand icon on the td that has a column
- // index equal to the expand column given.
- for (var i = 0, l = tds.length; i < l; i++) {
- var td = tds[i];
- var tdIndex = this.api.cell(td).index().column;
- td = $(td);
- if (tdIndex === this.expandColumn) {
- // Create expand icon if there isn't one already.
- if ($('span.responsiveExpander', td).length == 0) {
- td.prepend(this.expandIconTemplate);
- // Respond to click event on expander icon.
- switch (this.options.clickOn) {
- case 'cell':
- td.on('click', {responsiveDatatablesHelperInstance: this}, this.showRowDetailEventHandler);
- break;
- case 'row':
- $(tr).on('click', {responsiveDatatablesHelperInstance: this}, this.showRowDetailEventHandler);
- break;
- default:
- td.on('click', 'span.responsiveExpander', {responsiveDatatablesHelperInstance: this}, this.showRowDetailEventHandler);
- break;
- }
- }
- break;
- }
- }
- };
- /**
- * Show row detail event handler.
- *
- * This handler is used to handle the click event of the expand icon defined in
- * the table row data element.
- *
- * @param {Object} event jQuery event object
- */
- ResponsiveDatatablesHelper.prototype.showRowDetailEventHandler = function (event) {
- var responsiveDatatablesHelperInstance = event.data.responsiveDatatablesHelperInstance;
- if (responsiveDatatablesHelperInstance.disabled) {
- return;
- }
- var td = $(this);
- // Nothing to do if there are no columns hidden.
- if (!td.closest('table').hasClass('has-columns-hidden')) {
- return;
- }
- // Get the parent tr of which this td belongs to.
- var tr = td.closest('tr');
- // Show/hide row details
- if (tr.hasClass('detail-show')) {
- ResponsiveDatatablesHelper.prototype.hideRowDetail(responsiveDatatablesHelperInstance, tr);
- } else {
- ResponsiveDatatablesHelper.prototype.showRowDetail(responsiveDatatablesHelperInstance, tr);
- }
- tr.toggleClass('detail-show');
- // Prevent click event from bubbling up to higher-level DOM elements.
- event.stopPropagation();
- };
- /**
- * Show row details.
- *
- * @param {ResponsiveDatatablesHelper} responsiveDatatablesHelperInstance instance of ResponsiveDatatablesHelper
- * @param {Object} tr jQuery wrapped set
- */
- ResponsiveDatatablesHelper.prototype.showRowDetail = function (responsiveDatatablesHelperInstance, tr) {
- // Get column because we need their titles.
- var api = responsiveDatatablesHelperInstance.api;
- var columns = api.columns().header();
- // Create the new tr.
- var newTr = $(responsiveDatatablesHelperInstance.rowTemplate);
- // Get the ul that we'll insert li's into.
- var ul = $('ul', newTr);
- // Loop through hidden columns and create an li for each of them.
- for (var i = 0; i < responsiveDatatablesHelperInstance.columnsHiddenIndexes.length; i++) {
- var index = responsiveDatatablesHelperInstance.columnsHiddenIndexes[i];
- // Get row td
- var rowIndex = api.row(tr).index();
- var td = api.cell(rowIndex, index).node();
- // Don't create li if contents are empty (depends on hideEmptyColumnsInRowDetail option).
- if (!responsiveDatatablesHelperInstance.options.hideEmptyColumnsInRowDetail || td.innerHTML.trim().length) {
- var li = $(responsiveDatatablesHelperInstance.rowLiTemplate);
- var hiddenColumnName = $(columns[index]).attr('data-name');
- $('.columnTitle', li).html(hiddenColumnName !== undefined ? hiddenColumnName : columns[index].innerHTML);
- var contents = $(td).contents();
- var clonedContents = contents.clone();
- // Select elements' selectedIndex are not cloned. Do it manually.
- for (var n = 0, m = contents.length; n < m; n++) {
- var node = contents[n];
- if (node.nodeType === Node.ELEMENT_NODE && node.tagName === 'SELECT') {
- clonedContents[n].selectedIndex = node.selectedIndex
- }
- }
- // Set the column contents and save the original td source.
- $('.columnValue', li).append(clonedContents).data('originalTdSource', td);
- // Copy index to data attribute, so we'll know where to put the value when the tr.row-detail is removed.
- li.attr('data-column', index);
- // Copy td class to new li.
- var tdClass = $(td).attr('class');
- if (tdClass !== 'undefined' && tdClass !== false && tdClass !== '') {
- li.addClass(tdClass)
- }
- ul.append(li);
- }
- }
- // Create tr colspan attribute.
- var colspan = responsiveDatatablesHelperInstance.columnIndexes.length - responsiveDatatablesHelperInstance.columnsHiddenIndexes.length;
- newTr.find('> td').attr('colspan', colspan);
- // Append the new tr after the current tr.
- tr.after(newTr);
- // call the showDetail function if needbe
- if (responsiveDatatablesHelperInstance.options.showDetail){
- responsiveDatatablesHelperInstance.options.showDetail(newTr);
- }
- };
- /**
- * Hide row details.
- *
- * @param {ResponsiveDatatablesHelper} responsiveDatatablesHelperInstance instance of ResponsiveDatatablesHelper
- * @param {Object} tr jQuery wrapped set
- */
- ResponsiveDatatablesHelper.prototype.hideRowDetail = function (responsiveDatatablesHelperInstance, tr) {
- // If the value of an input has changed while in row detail, we need to copy its state back
- // to the DataTables object so that value will persist when the tr.row-detail is removed.
- var rowDetail = tr.next('.row-detail');
- if (responsiveDatatablesHelperInstance.options.hideDetail){
- responsiveDatatablesHelperInstance.options.hideDetail(rowDetail);
- }
- rowDetail.find('li').each(function () {
- var columnValueContainer = $(this).find('span.columnValue');
- var tdContents = columnValueContainer.contents();
- var td = columnValueContainer.data('originalTdSource');
- $(td).empty().append(tdContents);
- });
- rowDetail.remove();
- };
- /**
- * Enable/disable responsive behavior and restores changes made.
- *
- * @param {Boolean} disable, default is true
- */
- ResponsiveDatatablesHelper.prototype.disable = function (disable) {
- this.disabled = (disable === undefined) || disable;
- if (this.disabled) {
- // Remove windows resize handler.
- this.setWindowsResizeHandler(false);
- // Remove all trs that have row details.
- $('tbody tr.row-detail', this.tableElement).remove();
- // Remove all trs that are marked to have row details shown.
- $('tbody tr', this.tableElement).removeClass('detail-show');
- // Remove all expander icons.
- $('tbody tr span.responsiveExpander', this.tableElement).remove();
- this.columnsHiddenIndexes = [];
- this.columnsShownIndexes = this.columnIndexes;
- this.showHideColumns();
- this.tableElement.removeClass('has-columns-hidden');
- this.tableElement.off('click', 'span.responsiveExpander', this.showRowDetailEventHandler);
- } else {
- // Add windows resize handler.
- this.setWindowsResizeHandler();
- }
- };
- /**
- * Get state from cookie.
- */
- ResponsiveDatatablesHelper.prototype.getState = function () {
- if (typeof(Storage)) {
- // Use local storage
- var value = JSON.parse(localStorage.getItem(this.cookieName));
- if (value) {
- this.columnIndexes = value.columnIndexes;
- this.breakpoints = value.breakpoints;
- this.expandColumn = value.expandColumn;
- this.lastBreakpoint = value.lastBreakpoint;
- this.lastStateExists = true;
- }
- } else {
- // No local storage.
- }
- };
- /**
- * Saves state to cookie.
- */
- ResponsiveDatatablesHelper.prototype.setState = function () {
- if (typeof(Storage)) {
- // Use local storage
- var d1 = this.difference(this.lastColumnsHiddenIndexes, this.columnsHiddenIndexes).length;
- var d2 = this.difference(this.columnsHiddenIndexes, this.lastColumnsHiddenIndexes).length;
- if (d1 + d2 > 0) {
- var tt;
- var value = {
- columnIndexes: this.columnIndexes, // array
- columnsHiddenIndexes: this.columnsHiddenIndexes, // array
- breakpoints: this.breakpoints, // object
- expandColumn: this.expandColumn, // int|undefined
- lastBreakpoint: this.lastBreakpoint // string
- };
- localStorage.setItem(this.cookieName, JSON.stringify(value));
- this.lastColumnsHiddenIndexes = this.columnsHiddenIndexes.slice(0);
- }
- } else {
- // No local storage.
- }
- };
- /**
- * Get Difference.
- */
- ResponsiveDatatablesHelper.prototype.difference = function (a, b) {
- var arr = [], i, hash = {};
- for (i = b.length - 1; i >= 0; i--) {
- hash[b[i]] = true;
- }
- for (i = a.length - 1; i >= 0; i--) {
- if (hash[a[i]] !== true) {
- arr.push(a[i]);
- }
- }
- return arr;
- };
|