custom.js 115 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069
  1. /**
  2. * Resize function without multiple trigger
  3. *
  4. * Usage:
  5. * $(window).smartresize(function(){
  6. * // code here
  7. * });
  8. */
  9. (function($,sr){
  10. // debouncing function from John Hann
  11. // http://unscriptable.com/index.php/2009/03/20/debouncing-javascript-methods/
  12. var debounce = function (func, threshold, execAsap) {
  13. var timeout;
  14. return function debounced () {
  15. var obj = this, args = arguments;
  16. function delayed () {
  17. if (!execAsap)
  18. func.apply(obj, args);
  19. timeout = null;
  20. }
  21. if (timeout)
  22. clearTimeout(timeout);
  23. else if (execAsap)
  24. func.apply(obj, args);
  25. timeout = setTimeout(delayed, threshold || 100);
  26. };
  27. };
  28. // smartresize
  29. jQuery.fn[sr] = function(fn){ return fn ? this.bind('resize', debounce(fn)) : this.trigger(sr); };
  30. })(jQuery,'smartresize');
  31. /**
  32. * To change this license header, choose License Headers in Project Properties.
  33. * To change this template file, choose Tools | Templates
  34. * and open the template in the editor.
  35. */
  36. var CURRENT_URL = window.location.href.split('#')[0].split('?')[0],
  37. $BODY = $('body'),
  38. $MENU_TOGGLE = $('#menu_toggle'),
  39. $SIDEBAR_MENU = $('#sidebar-menu'),
  40. $SIDEBAR_FOOTER = $('.sidebar-footer'),
  41. $LEFT_COL = $('.left_col'),
  42. $RIGHT_COL = $('.right_col'),
  43. $NAV_MENU = $('.nav_menu'),
  44. $FOOTER = $('footer');
  45. // Sidebar
  46. function init_sidebar() {
  47. // TODO: This is some kind of easy fix, maybe we can improve this
  48. var setContentHeight = function () {
  49. // reset height
  50. $RIGHT_COL.css('min-height', $(window).height());
  51. var bodyHeight = $BODY.outerHeight(),
  52. footerHeight = $BODY.hasClass('footer_fixed') ? -10 : $FOOTER.height(),
  53. leftColHeight = $LEFT_COL.eq(1).height() + $SIDEBAR_FOOTER.height(),
  54. contentHeight = bodyHeight < leftColHeight ? leftColHeight : bodyHeight;
  55. // normalize content
  56. contentHeight -= $NAV_MENU.height() + footerHeight;
  57. $RIGHT_COL.css('min-height', contentHeight);
  58. };
  59. $SIDEBAR_MENU.find('a').on('click', function(ev) {
  60. console.log('clicked - sidebar_menu');
  61. var $li = $(this).parent();
  62. if ($li.is('.active')) {
  63. $li.removeClass('active active-sm');
  64. $('ul:first', $li).slideUp(function() {
  65. setContentHeight();
  66. });
  67. } else {
  68. // prevent closing menu if we are on child menu
  69. if (!$li.parent().is('.child_menu')) {
  70. $SIDEBAR_MENU.find('li').removeClass('active active-sm');
  71. $SIDEBAR_MENU.find('li ul').slideUp();
  72. }else
  73. {
  74. if ( $BODY.is( ".nav-sm" ) )
  75. {
  76. $SIDEBAR_MENU.find( "li" ).removeClass( "active active-sm" );
  77. $SIDEBAR_MENU.find( "li ul" ).slideUp();
  78. }
  79. }
  80. $li.addClass('active');
  81. $('ul:first', $li).slideDown(function() {
  82. setContentHeight();
  83. });
  84. }
  85. });
  86. // toggle small or large menu
  87. $MENU_TOGGLE.on('click', function() {
  88. console.log('clicked - menu toggle');
  89. if ($BODY.hasClass('nav-md')) {
  90. $SIDEBAR_MENU.find('li.active ul').hide();
  91. $SIDEBAR_MENU.find('li.active').addClass('active-sm').removeClass('active');
  92. } else {
  93. $SIDEBAR_MENU.find('li.active-sm ul').show();
  94. $SIDEBAR_MENU.find('li.active-sm').addClass('active').removeClass('active-sm');
  95. }
  96. $BODY.toggleClass('nav-md nav-sm');
  97. setContentHeight();
  98. $('.dataTable').each ( function () { $(this).dataTable().fnDraw(); });
  99. });
  100. // check active menu
  101. $SIDEBAR_MENU.find('a[href="' + CURRENT_URL + '"]').parent('li').addClass('current-page');
  102. $SIDEBAR_MENU.find('a').filter(function () {
  103. return this.href == CURRENT_URL;
  104. }).parent('li').addClass('current-page').parents('ul').slideDown(function() {
  105. setContentHeight();
  106. }).parent().addClass('active');
  107. // recompute content when resizing
  108. $(window).smartresize(function(){
  109. setContentHeight();
  110. });
  111. setContentHeight();
  112. // fixed sidebar
  113. if ($.fn.mCustomScrollbar) {
  114. $('.menu_fixed').mCustomScrollbar({
  115. autoHideScrollbar: true,
  116. theme: 'minimal',
  117. mouseWheel:{ preventDefault: true }
  118. });
  119. }
  120. };
  121. // /Sidebar
  122. var randNum = function() {
  123. return (Math.floor(Math.random() * (1 + 40 - 20))) + 20;
  124. };
  125. // Panel toolbox
  126. $(document).ready(function() {
  127. $('.collapse-link').on('click', function() {
  128. var $BOX_PANEL = $(this).closest('.x_panel'),
  129. $ICON = $(this).find('i'),
  130. $BOX_CONTENT = $BOX_PANEL.find('.x_content');
  131. // fix for some div with hardcoded fix class
  132. if ($BOX_PANEL.attr('style')) {
  133. $BOX_CONTENT.slideToggle(200, function(){
  134. $BOX_PANEL.removeAttr('style');
  135. });
  136. } else {
  137. $BOX_CONTENT.slideToggle(200);
  138. $BOX_PANEL.css('height', 'auto');
  139. }
  140. $ICON.toggleClass('fa-chevron-up fa-chevron-down');
  141. });
  142. $('.close-link').click(function () {
  143. var $BOX_PANEL = $(this).closest('.x_panel');
  144. $BOX_PANEL.remove();
  145. });
  146. });
  147. // /Panel toolbox
  148. // Tooltip
  149. $(document).ready(function() {
  150. $('[data-toggle="tooltip"]').tooltip({
  151. container: 'body'
  152. });
  153. });
  154. // /Tooltip
  155. // Progressbar
  156. if ($(".progress .progress-bar")[0]) {
  157. $('.progress .progress-bar').progressbar();
  158. }
  159. // /Progressbar
  160. // Switchery
  161. $(document).ready(function() {
  162. if ($(".js-switch")[0]) {
  163. var elems = Array.prototype.slice.call(document.querySelectorAll('.js-switch'));
  164. elems.forEach(function (html) {
  165. var switchery = new Switchery(html, {
  166. color: '#26B99A'
  167. });
  168. });
  169. }
  170. });
  171. // /Switchery
  172. // iCheck
  173. $(document).ready(function() {
  174. if ($("input.flat")[0]) {
  175. $(document).ready(function () {
  176. $('input.flat').iCheck({
  177. checkboxClass: 'icheckbox_flat-green',
  178. radioClass: 'iradio_flat-green'
  179. });
  180. });
  181. }
  182. });
  183. // /iCheck
  184. // Table
  185. $('table input').on('ifChecked', function () {
  186. checkState = '';
  187. $(this).parent().parent().parent().addClass('selected');
  188. countChecked();
  189. });
  190. $('table input').on('ifUnchecked', function () {
  191. checkState = '';
  192. $(this).parent().parent().parent().removeClass('selected');
  193. countChecked();
  194. });
  195. var checkState = '';
  196. $('.bulk_action input').on('ifChecked', function () {
  197. checkState = '';
  198. $(this).parent().parent().parent().addClass('selected');
  199. countChecked();
  200. });
  201. $('.bulk_action input').on('ifUnchecked', function () {
  202. checkState = '';
  203. $(this).parent().parent().parent().removeClass('selected');
  204. countChecked();
  205. });
  206. $('.bulk_action input#check-all').on('ifChecked', function () {
  207. checkState = 'all';
  208. countChecked();
  209. });
  210. $('.bulk_action input#check-all').on('ifUnchecked', function () {
  211. checkState = 'none';
  212. countChecked();
  213. });
  214. function countChecked() {
  215. if (checkState === 'all') {
  216. $(".bulk_action input[name='table_records']").iCheck('check');
  217. }
  218. if (checkState === 'none') {
  219. $(".bulk_action input[name='table_records']").iCheck('uncheck');
  220. }
  221. var checkCount = $(".bulk_action input[name='table_records']:checked").length;
  222. if (checkCount) {
  223. $('.column-title').hide();
  224. $('.bulk-actions').show();
  225. $('.action-cnt').html(checkCount + ' Records Selected');
  226. } else {
  227. $('.column-title').show();
  228. $('.bulk-actions').hide();
  229. }
  230. }
  231. // Accordion
  232. $(document).ready(function() {
  233. $(".expand").on("click", function () {
  234. $(this).next().slideToggle(200);
  235. $expand = $(this).find(">:first-child");
  236. if ($expand.text() == "+") {
  237. $expand.text("-");
  238. } else {
  239. $expand.text("+");
  240. }
  241. });
  242. });
  243. // NProgress
  244. if (typeof NProgress != 'undefined') {
  245. $(document).ready(function () {
  246. NProgress.start();
  247. });
  248. $(window).load(function () {
  249. NProgress.done();
  250. });
  251. }
  252. //hover and retain popover when on popover content
  253. var originalLeave = $.fn.popover.Constructor.prototype.leave;
  254. $.fn.popover.Constructor.prototype.leave = function(obj) {
  255. var self = obj instanceof this.constructor ?
  256. obj : $(obj.currentTarget)[this.type](this.getDelegateOptions()).data('bs.' + this.type);
  257. var container, timeout;
  258. originalLeave.call(this, obj);
  259. if (obj.currentTarget) {
  260. container = $(obj.currentTarget).siblings('.popover');
  261. timeout = self.timeout;
  262. container.one('mouseenter', function() {
  263. //We entered the actual popover – call off the dogs
  264. clearTimeout(timeout);
  265. //Let's monitor popover content instead
  266. container.one('mouseleave', function() {
  267. $.fn.popover.Constructor.prototype.leave.call(self, self);
  268. });
  269. });
  270. }
  271. };
  272. $('body').popover({
  273. selector: '[data-popover]',
  274. trigger: 'click hover',
  275. delay: {
  276. show: 50,
  277. hide: 400
  278. }
  279. });
  280. function gd(year, month, day) {
  281. return new Date(year, month - 1, day).getTime();
  282. }
  283. function init_flot_chart(){
  284. if( typeof ($.plot) === 'undefined'){ return; }
  285. console.log('init_flot_chart');
  286. var arr_data1 = [
  287. [gd(2012, 1, 1), 17],
  288. [gd(2012, 1, 2), 74],
  289. [gd(2012, 1, 3), 6],
  290. [gd(2012, 1, 4), 39],
  291. [gd(2012, 1, 5), 20],
  292. [gd(2012, 1, 6), 85],
  293. [gd(2012, 1, 7), 7]
  294. ];
  295. var arr_data2 = [
  296. [gd(2012, 1, 1), 82],
  297. [gd(2012, 1, 2), 23],
  298. [gd(2012, 1, 3), 66],
  299. [gd(2012, 1, 4), 9],
  300. [gd(2012, 1, 5), 119],
  301. [gd(2012, 1, 6), 6],
  302. [gd(2012, 1, 7), 9]
  303. ];
  304. var arr_data3 = [
  305. [0, 1],
  306. [1, 9],
  307. [2, 6],
  308. [3, 10],
  309. [4, 5],
  310. [5, 17],
  311. [6, 6],
  312. [7, 10],
  313. [8, 7],
  314. [9, 11],
  315. [10, 35],
  316. [11, 9],
  317. [12, 12],
  318. [13, 5],
  319. [14, 3],
  320. [15, 4],
  321. [16, 9]
  322. ];
  323. var chart_plot_02_data = [];
  324. var chart_plot_03_data = [
  325. [0, 1],
  326. [1, 9],
  327. [2, 6],
  328. [3, 10],
  329. [4, 5],
  330. [5, 17],
  331. [6, 6],
  332. [7, 10],
  333. [8, 7],
  334. [9, 11],
  335. [10, 35],
  336. [11, 9],
  337. [12, 12],
  338. [13, 5],
  339. [14, 3],
  340. [15, 4],
  341. [16, 9]
  342. ];
  343. for (var i = 0; i < 30; i++) {
  344. chart_plot_02_data.push([new Date(Date.today().add(i).days()).getTime(), randNum() + i + i + 10]);
  345. }
  346. var chart_plot_01_settings = {
  347. series: {
  348. lines: {
  349. show: false,
  350. fill: true
  351. },
  352. splines: {
  353. show: true,
  354. tension: 0.4,
  355. lineWidth: 1,
  356. fill: 0.4
  357. },
  358. points: {
  359. radius: 0,
  360. show: true
  361. },
  362. shadowSize: 2
  363. },
  364. grid: {
  365. verticalLines: true,
  366. hoverable: true,
  367. clickable: true,
  368. tickColor: "#d5d5d5",
  369. borderWidth: 1,
  370. color: '#fff'
  371. },
  372. colors: ["rgba(38, 185, 154, 0.38)", "rgba(3, 88, 106, 0.38)"],
  373. xaxis: {
  374. tickColor: "rgba(51, 51, 51, 0.06)",
  375. mode: "time",
  376. tickSize: [1, "day"],
  377. //tickLength: 10,
  378. axisLabel: "Date",
  379. axisLabelUseCanvas: true,
  380. axisLabelFontSizePixels: 12,
  381. axisLabelFontFamily: 'Verdana, Arial',
  382. axisLabelPadding: 10
  383. },
  384. yaxis: {
  385. ticks: 8,
  386. tickColor: "rgba(51, 51, 51, 0.06)",
  387. },
  388. tooltip: false
  389. }
  390. var chart_plot_02_settings = {
  391. grid: {
  392. show: true,
  393. aboveData: true,
  394. color: "#3f3f3f",
  395. labelMargin: 10,
  396. axisMargin: 0,
  397. borderWidth: 0,
  398. borderColor: null,
  399. minBorderMargin: 5,
  400. clickable: true,
  401. hoverable: true,
  402. autoHighlight: true,
  403. mouseActiveRadius: 100
  404. },
  405. series: {
  406. lines: {
  407. show: true,
  408. fill: true,
  409. lineWidth: 2,
  410. steps: false
  411. },
  412. points: {
  413. show: true,
  414. radius: 4.5,
  415. symbol: "circle",
  416. lineWidth: 3.0
  417. }
  418. },
  419. legend: {
  420. position: "ne",
  421. margin: [0, -25],
  422. noColumns: 0,
  423. labelBoxBorderColor: null,
  424. labelFormatter: function(label, series) {
  425. return label + '&nbsp;&nbsp;';
  426. },
  427. width: 40,
  428. height: 1
  429. },
  430. colors: ['#96CA59', '#3F97EB', '#72c380', '#6f7a8a', '#f7cb38', '#5a8022', '#2c7282'],
  431. shadowSize: 0,
  432. tooltip: true,
  433. tooltipOpts: {
  434. content: "%s: %y.0",
  435. xDateFormat: "%d/%m",
  436. shifts: {
  437. x: -30,
  438. y: -50
  439. },
  440. defaultTheme: false
  441. },
  442. yaxis: {
  443. min: 0
  444. },
  445. xaxis: {
  446. mode: "time",
  447. minTickSize: [1, "day"],
  448. timeformat: "%d/%m/%y",
  449. min: chart_plot_02_data[0][0],
  450. max: chart_plot_02_data[20][0]
  451. }
  452. };
  453. var chart_plot_03_settings = {
  454. series: {
  455. curvedLines: {
  456. apply: true,
  457. active: true,
  458. monotonicFit: true
  459. }
  460. },
  461. colors: ["#26B99A"],
  462. grid: {
  463. borderWidth: {
  464. top: 0,
  465. right: 0,
  466. bottom: 1,
  467. left: 1
  468. },
  469. borderColor: {
  470. bottom: "#7F8790",
  471. left: "#7F8790"
  472. }
  473. }
  474. };
  475. if ($("#chart_plot_01").length){
  476. console.log('Plot1');
  477. $.plot( $("#chart_plot_01"), [ arr_data1, arr_data2 ], chart_plot_01_settings );
  478. }
  479. if ($("#chart_plot_02").length){
  480. console.log('Plot2');
  481. $.plot( $("#chart_plot_02"),
  482. [{
  483. label: "Email Sent",
  484. data: chart_plot_02_data,
  485. lines: {
  486. fillColor: "rgba(150, 202, 89, 0.12)"
  487. },
  488. points: {
  489. fillColor: "#fff" }
  490. }], chart_plot_02_settings);
  491. }
  492. if ($("#chart_plot_03").length){
  493. console.log('Plot3');
  494. $.plot($("#chart_plot_03"), [{
  495. label: "Registrations",
  496. data: chart_plot_03_data,
  497. lines: {
  498. fillColor: "rgba(150, 202, 89, 0.12)"
  499. },
  500. points: {
  501. fillColor: "#fff"
  502. }
  503. }], chart_plot_03_settings);
  504. };
  505. }
  506. /* STARRR */
  507. function init_starrr() {
  508. if( typeof (starrr) === 'undefined'){ return; }
  509. console.log('init_starrr');
  510. $(".stars").starrr();
  511. $('.stars-existing').starrr({
  512. rating: 4
  513. });
  514. $('.stars').on('starrr:change', function (e, value) {
  515. $('.stars-count').html(value);
  516. });
  517. $('.stars-existing').on('starrr:change', function (e, value) {
  518. $('.stars-count-existing').html(value);
  519. });
  520. };
  521. function init_JQVmap(){
  522. //console.log('check init_JQVmap [' + typeof (VectorCanvas) + '][' + typeof (jQuery.fn.vectorMap) + ']' );
  523. if(typeof (jQuery.fn.vectorMap) === 'undefined'){ return; }
  524. console.log('init_JQVmap');
  525. if ($('#world-map-gdp').length ){
  526. $('#world-map-gdp').vectorMap({
  527. map: 'world_en',
  528. backgroundColor: null,
  529. color: '#ffffff',
  530. hoverOpacity: 0.7,
  531. selectedColor: '#666666',
  532. enableZoom: true,
  533. showTooltip: true,
  534. values: sample_data,
  535. scaleColors: ['#E6F2F0', '#149B7E'],
  536. normalizeFunction: 'polynomial'
  537. });
  538. }
  539. if ($('#usa_map').length ){
  540. $('#usa_map').vectorMap({
  541. map: 'usa_en',
  542. backgroundColor: null,
  543. color: '#ffffff',
  544. hoverOpacity: 0.7,
  545. selectedColor: '#666666',
  546. enableZoom: true,
  547. showTooltip: true,
  548. values: sample_data,
  549. scaleColors: ['#E6F2F0', '#149B7E'],
  550. normalizeFunction: 'polynomial'
  551. });
  552. }
  553. };
  554. function init_skycons(){
  555. if( typeof (Skycons) === 'undefined'){ return; }
  556. console.log('init_skycons');
  557. var icons = new Skycons({
  558. "color": "#73879C"
  559. }),
  560. list = [
  561. "clear-day", "clear-night", "partly-cloudy-day",
  562. "partly-cloudy-night", "cloudy", "rain", "sleet", "snow", "wind",
  563. "fog"
  564. ],
  565. i;
  566. for (i = list.length; i--;)
  567. icons.set(list[i], list[i]);
  568. icons.play();
  569. }
  570. function init_chart_doughnut(){
  571. if( typeof (Chart) === 'undefined'){ return; }
  572. console.log('init_chart_doughnut');
  573. if ($('.canvasDoughnut').length){
  574. var chart_doughnut_settings = {
  575. type: 'doughnut',
  576. tooltipFillColor: "rgba(51, 51, 51, 0.55)",
  577. data: {
  578. labels: [
  579. "Symbian",
  580. "Blackberry",
  581. "Other",
  582. "Android",
  583. "IOS"
  584. ],
  585. datasets: [{
  586. data: [15, 20, 30, 10, 30],
  587. backgroundColor: [
  588. "#BDC3C7",
  589. "#9B59B6",
  590. "#E74C3C",
  591. "#26B99A",
  592. "#3498DB"
  593. ],
  594. hoverBackgroundColor: [
  595. "#CFD4D8",
  596. "#B370CF",
  597. "#E95E4F",
  598. "#36CAAB",
  599. "#49A9EA"
  600. ]
  601. }]
  602. },
  603. options: {
  604. legend: false,
  605. responsive: false
  606. }
  607. }
  608. $('.canvasDoughnut').each(function(){
  609. var chart_element = $(this);
  610. var chart_doughnut = new Chart( chart_element, chart_doughnut_settings);
  611. });
  612. }
  613. }
  614. function init_gauge() {
  615. if( typeof (Gauge) === 'undefined'){ return; }
  616. console.log('init_gauge [' + $('.gauge-chart').length + ']');
  617. console.log('init_gauge');
  618. var chart_gauge_settings = {
  619. lines: 12,
  620. angle: 0,
  621. lineWidth: 0.4,
  622. pointer: {
  623. length: 0.75,
  624. strokeWidth: 0.042,
  625. color: '#1D212A'
  626. },
  627. limitMax: 'false',
  628. colorStart: '#1ABC9C',
  629. colorStop: '#1ABC9C',
  630. strokeColor: '#F0F3F3',
  631. generateGradient: true
  632. };
  633. if ($('#chart_gauge_01').length){
  634. var chart_gauge_01_elem = document.getElementById('chart_gauge_01');
  635. var chart_gauge_01 = new Gauge(chart_gauge_01_elem).setOptions(chart_gauge_settings);
  636. }
  637. if ($('#gauge-text').length){
  638. chart_gauge_01.maxValue = 6000;
  639. chart_gauge_01.animationSpeed = 32;
  640. chart_gauge_01.set(3200);
  641. chart_gauge_01.setTextField(document.getElementById("gauge-text"));
  642. }
  643. if ($('#chart_gauge_02').length){
  644. var chart_gauge_02_elem = document.getElementById('chart_gauge_02');
  645. var chart_gauge_02 = new Gauge(chart_gauge_02_elem).setOptions(chart_gauge_settings);
  646. }
  647. if ($('#gauge-text2').length){
  648. chart_gauge_02.maxValue = 9000;
  649. chart_gauge_02.animationSpeed = 32;
  650. chart_gauge_02.set(2400);
  651. chart_gauge_02.setTextField(document.getElementById("gauge-text2"));
  652. }
  653. }
  654. /* SPARKLINES */
  655. function init_sparklines() {
  656. if(typeof (jQuery.fn.sparkline) === 'undefined'){ return; }
  657. console.log('init_sparklines');
  658. $(".sparkline_one").sparkline([2, 4, 3, 4, 5, 4, 5, 4, 3, 4, 5, 6, 4, 5, 6, 3, 5, 4, 5, 4, 5, 4, 3, 4, 5, 6, 7, 5, 4, 3, 5, 6], {
  659. type: 'bar',
  660. height: '125',
  661. barWidth: 13,
  662. colorMap: {
  663. '7': '#a1a1a1'
  664. },
  665. barSpacing: 2,
  666. barColor: '#26B99A'
  667. });
  668. $(".sparkline_two").sparkline([2, 4, 3, 4, 5, 4, 5, 4, 3, 4, 5, 6, 7, 5, 4, 3, 5, 6], {
  669. type: 'bar',
  670. height: '40',
  671. barWidth: 9,
  672. colorMap: {
  673. '7': '#a1a1a1'
  674. },
  675. barSpacing: 2,
  676. barColor: '#26B99A'
  677. });
  678. $(".sparkline_three").sparkline([2, 4, 3, 4, 5, 4, 5, 4, 3, 4, 5, 6, 7, 5, 4, 3, 5, 6], {
  679. type: 'line',
  680. width: '200',
  681. height: '40',
  682. lineColor: '#26B99A',
  683. fillColor: 'rgba(223, 223, 223, 0.57)',
  684. lineWidth: 2,
  685. spotColor: '#26B99A',
  686. minSpotColor: '#26B99A'
  687. });
  688. $(".sparkline11").sparkline([2, 4, 3, 4, 5, 4, 5, 4, 3, 4, 6, 2, 4, 3, 4, 5, 4, 5, 4, 3], {
  689. type: 'bar',
  690. height: '40',
  691. barWidth: 8,
  692. colorMap: {
  693. '7': '#a1a1a1'
  694. },
  695. barSpacing: 2,
  696. barColor: '#26B99A'
  697. });
  698. $(".sparkline22").sparkline([2, 4, 3, 4, 7, 5, 4, 3, 5, 6, 2, 4, 3, 4, 5, 4, 5, 4, 3, 4, 6], {
  699. type: 'line',
  700. height: '40',
  701. width: '200',
  702. lineColor: '#26B99A',
  703. fillColor: '#ffffff',
  704. lineWidth: 3,
  705. spotColor: '#34495E',
  706. minSpotColor: '#34495E'
  707. });
  708. $(".sparkline_bar").sparkline([2, 4, 3, 4, 5, 4, 5, 4, 3, 4, 5, 6, 4, 5, 6, 3, 5], {
  709. type: 'bar',
  710. colorMap: {
  711. '7': '#a1a1a1'
  712. },
  713. barColor: '#26B99A'
  714. });
  715. $(".sparkline_area").sparkline([5, 6, 7, 9, 9, 5, 3, 2, 2, 4, 6, 7], {
  716. type: 'line',
  717. lineColor: '#26B99A',
  718. fillColor: '#26B99A',
  719. spotColor: '#4578a0',
  720. minSpotColor: '#728fb2',
  721. maxSpotColor: '#6d93c4',
  722. highlightSpotColor: '#ef5179',
  723. highlightLineColor: '#8ba8bf',
  724. spotRadius: 2.5,
  725. width: 85
  726. });
  727. $(".sparkline_line").sparkline([2, 4, 3, 4, 5, 4, 5, 4, 3, 4, 5, 6, 4, 5, 6, 3, 5], {
  728. type: 'line',
  729. lineColor: '#26B99A',
  730. fillColor: '#ffffff',
  731. width: 85,
  732. spotColor: '#34495E',
  733. minSpotColor: '#34495E'
  734. });
  735. $(".sparkline_pie").sparkline([1, 1, 2, 1], {
  736. type: 'pie',
  737. sliceColors: ['#26B99A', '#ccc', '#75BCDD', '#D66DE2']
  738. });
  739. $(".sparkline_discreet").sparkline([4, 6, 7, 7, 4, 3, 2, 1, 4, 4, 2, 4, 3, 7, 8, 9, 7, 6, 4, 3], {
  740. type: 'discrete',
  741. barWidth: 3,
  742. lineColor: '#26B99A',
  743. width: '85',
  744. });
  745. };
  746. /* AUTOCOMPLETE */
  747. function init_autocomplete() {
  748. if( typeof (autocomplete) === 'undefined'){ return; }
  749. console.log('init_autocomplete');
  750. var countries = { AD:"Andorra",A2:"Andorra Test",AE:"United Arab Emirates",AF:"Afghanistan",AG:"Antigua and Barbuda",AI:"Anguilla",AL:"Albania",AM:"Armenia",AN:"Netherlands Antilles",AO:"Angola",AQ:"Antarctica",AR:"Argentina",AS:"American Samoa",AT:"Austria",AU:"Australia",AW:"Aruba",AX:"Åland Islands",AZ:"Azerbaijan",BA:"Bosnia and Herzegovina",BB:"Barbados",BD:"Bangladesh",BE:"Belgium",BF:"Burkina Faso",BG:"Bulgaria",BH:"Bahrain",BI:"Burundi",BJ:"Benin",BL:"Saint Barthélemy",BM:"Bermuda",BN:"Brunei",BO:"Bolivia",BQ:"British Antarctic Territory",BR:"Brazil",BS:"Bahamas",BT:"Bhutan",BV:"Bouvet Island",BW:"Botswana",BY:"Belarus",BZ:"Belize",CA:"Canada",CC:"Cocos [Keeling] Islands",CD:"Congo - Kinshasa",CF:"Central African Republic",CG:"Congo - Brazzaville",CH:"Switzerland",CI:"Côte d’Ivoire",CK:"Cook Islands",CL:"Chile",CM:"Cameroon",CN:"China",CO:"Colombia",CR:"Costa Rica",CS:"Serbia and Montenegro",CT:"Canton and Enderbury Islands",CU:"Cuba",CV:"Cape Verde",CX:"Christmas Island",CY:"Cyprus",CZ:"Czech Republic",DD:"East Germany",DE:"Germany",DJ:"Djibouti",DK:"Denmark",DM:"Dominica",DO:"Dominican Republic",DZ:"Algeria",EC:"Ecuador",EE:"Estonia",EG:"Egypt",EH:"Western Sahara",ER:"Eritrea",ES:"Spain",ET:"Ethiopia",FI:"Finland",FJ:"Fiji",FK:"Falkland Islands",FM:"Micronesia",FO:"Faroe Islands",FQ:"French Southern and Antarctic Territories",FR:"France",FX:"Metropolitan France",GA:"Gabon",GB:"United Kingdom",GD:"Grenada",GE:"Georgia",GF:"French Guiana",GG:"Guernsey",GH:"Ghana",GI:"Gibraltar",GL:"Greenland",GM:"Gambia",GN:"Guinea",GP:"Guadeloupe",GQ:"Equatorial Guinea",GR:"Greece",GS:"South Georgia and the South Sandwich Islands",GT:"Guatemala",GU:"Guam",GW:"Guinea-Bissau",GY:"Guyana",HK:"Hong Kong SAR China",HM:"Heard Island and McDonald Islands",HN:"Honduras",HR:"Croatia",HT:"Haiti",HU:"Hungary",ID:"Indonesia",IE:"Ireland",IL:"Israel",IM:"Isle of Man",IN:"India",IO:"British Indian Ocean Territory",IQ:"Iraq",IR:"Iran",IS:"Iceland",IT:"Italy",JE:"Jersey",JM:"Jamaica",JO:"Jordan",JP:"Japan",JT:"Johnston Island",KE:"Kenya",KG:"Kyrgyzstan",KH:"Cambodia",KI:"Kiribati",KM:"Comoros",KN:"Saint Kitts and Nevis",KP:"North Korea",KR:"South Korea",KW:"Kuwait",KY:"Cayman Islands",KZ:"Kazakhstan",LA:"Laos",LB:"Lebanon",LC:"Saint Lucia",LI:"Liechtenstein",LK:"Sri Lanka",LR:"Liberia",LS:"Lesotho",LT:"Lithuania",LU:"Luxembourg",LV:"Latvia",LY:"Libya",MA:"Morocco",MC:"Monaco",MD:"Moldova",ME:"Montenegro",MF:"Saint Martin",MG:"Madagascar",MH:"Marshall Islands",MI:"Midway Islands",MK:"Macedonia",ML:"Mali",MM:"Myanmar [Burma]",MN:"Mongolia",MO:"Macau SAR China",MP:"Northern Mariana Islands",MQ:"Martinique",MR:"Mauritania",MS:"Montserrat",MT:"Malta",MU:"Mauritius",MV:"Maldives",MW:"Malawi",MX:"Mexico",MY:"Malaysia",MZ:"Mozambique",NA:"Namibia",NC:"New Caledonia",NE:"Niger",NF:"Norfolk Island",NG:"Nigeria",NI:"Nicaragua",NL:"Netherlands",NO:"Norway",NP:"Nepal",NQ:"Dronning Maud Land",NR:"Nauru",NT:"Neutral Zone",NU:"Niue",NZ:"New Zealand",OM:"Oman",PA:"Panama",PC:"Pacific Islands Trust Territory",PE:"Peru",PF:"French Polynesia",PG:"Papua New Guinea",PH:"Philippines",PK:"Pakistan",PL:"Poland",PM:"Saint Pierre and Miquelon",PN:"Pitcairn Islands",PR:"Puerto Rico",PS:"Palestinian Territories",PT:"Portugal",PU:"U.S. Miscellaneous Pacific Islands",PW:"Palau",PY:"Paraguay",PZ:"Panama Canal Zone",QA:"Qatar",RE:"Réunion",RO:"Romania",RS:"Serbia",RU:"Russia",RW:"Rwanda",SA:"Saudi Arabia",SB:"Solomon Islands",SC:"Seychelles",SD:"Sudan",SE:"Sweden",SG:"Singapore",SH:"Saint Helena",SI:"Slovenia",SJ:"Svalbard and Jan Mayen",SK:"Slovakia",SL:"Sierra Leone",SM:"San Marino",SN:"Senegal",SO:"Somalia",SR:"Suriname",ST:"São Tomé and Príncipe",SU:"Union of Soviet Socialist Republics",SV:"El Salvador",SY:"Syria",SZ:"Swaziland",TC:"Turks and Caicos Islands",TD:"Chad",TF:"French Southern Territories",TG:"Togo",TH:"Thailand",TJ:"Tajikistan",TK:"Tokelau",TL:"Timor-Leste",TM:"Turkmenistan",TN:"Tunisia",TO:"Tonga",TR:"Turkey",TT:"Trinidad and Tobago",TV:"Tuvalu",TW:"Taiwan",TZ:"Tanzania",UA:"Ukraine",UG:"Uganda",UM:"U.S. Minor Outlying Islands",US:"United States",UY:"Uruguay",UZ:"Uzbekistan",VA:"Vatican City",VC:"Saint Vincent and the Grenadines",VD:"North Vietnam",VE:"Venezuela",VG:"British Virgin Islands",VI:"U.S. Virgin Islands",VN:"Vietnam",VU:"Vanuatu",WF:"Wallis and Futuna",WK:"Wake Island",WS:"Samoa",YD:"People's Democratic Republic of Yemen",YE:"Yemen",YT:"Mayotte",ZA:"South Africa",ZM:"Zambia",ZW:"Zimbabwe",ZZ:"Unknown or Invalid Region" };
  751. var countriesArray = $.map(countries, function(value, key) {
  752. return {
  753. value: value,
  754. data: key
  755. };
  756. });
  757. // initialize autocomplete with custom appendTo
  758. $('#autocomplete-custom-append').autocomplete({
  759. lookup: countriesArray
  760. });
  761. };
  762. /* AUTOSIZE */
  763. function init_autosize() {
  764. if(typeof $.fn.autosize !== 'undefined'){
  765. autosize($('.resizable_textarea'));
  766. }
  767. };
  768. /* PARSLEY */
  769. function init_parsley() {
  770. if( typeof (parsley) === 'undefined'){ return; }
  771. console.log('init_parsley');
  772. $/*.listen*/('parsley:field:validate', function() {
  773. validateFront();
  774. });
  775. $('#demo-form .btn').on('click', function() {
  776. $('#demo-form').parsley().validate();
  777. validateFront();
  778. });
  779. var validateFront = function() {
  780. if (true === $('#demo-form').parsley().isValid()) {
  781. $('.bs-callout-info').removeClass('hidden');
  782. $('.bs-callout-warning').addClass('hidden');
  783. } else {
  784. $('.bs-callout-info').addClass('hidden');
  785. $('.bs-callout-warning').removeClass('hidden');
  786. }
  787. };
  788. $/*.listen*/('parsley:field:validate', function() {
  789. validateFront();
  790. });
  791. $('#demo-form2 .btn').on('click', function() {
  792. $('#demo-form2').parsley().validate();
  793. validateFront();
  794. });
  795. var validateFront = function() {
  796. if (true === $('#demo-form2').parsley().isValid()) {
  797. $('.bs-callout-info').removeClass('hidden');
  798. $('.bs-callout-warning').addClass('hidden');
  799. } else {
  800. $('.bs-callout-info').addClass('hidden');
  801. $('.bs-callout-warning').removeClass('hidden');
  802. }
  803. };
  804. try {
  805. hljs.initHighlightingOnLoad();
  806. } catch (err) {}
  807. };
  808. /* INPUTS */
  809. function onAddTag(tag) {
  810. alert("Added a tag: " + tag);
  811. }
  812. function onRemoveTag(tag) {
  813. alert("Removed a tag: " + tag);
  814. }
  815. function onChangeTag(input, tag) {
  816. alert("Changed a tag: " + tag);
  817. }
  818. //tags input
  819. function init_TagsInput() {
  820. if(typeof $.fn.tagsInput !== 'undefined'){
  821. $('#tags_1').tagsInput({
  822. width: 'auto'
  823. });
  824. }
  825. };
  826. /* SELECT2 */
  827. function init_select2() {
  828. if( typeof (select2) === 'undefined'){ return; }
  829. console.log('init_toolbox');
  830. $(".select2_single").select2({
  831. placeholder: "Select a state",
  832. allowClear: true
  833. });
  834. $(".select2_group").select2({});
  835. $(".select2_multiple").select2({
  836. maximumSelectionLength: 4,
  837. placeholder: "With Max Selection limit 4",
  838. allowClear: true
  839. });
  840. };
  841. /* WYSIWYG EDITOR */
  842. function init_wysiwyg() {
  843. if( typeof ($.fn.wysiwyg) === 'undefined'){ return; }
  844. console.log('init_wysiwyg');
  845. function init_ToolbarBootstrapBindings() {
  846. var fonts = ['Serif', 'Sans', 'Arial', 'Arial Black', 'Courier',
  847. 'Courier New', 'Comic Sans MS', 'Helvetica', 'Impact', 'Lucida Grande', 'Lucida Sans', 'Tahoma', 'Times',
  848. 'Times New Roman', 'Verdana'
  849. ],
  850. fontTarget = $('[title=Font]').siblings('.dropdown-menu');
  851. $.each(fonts, function(idx, fontName) {
  852. fontTarget.append($('<li><a data-edit="fontName ' + fontName + '" style="font-family:\'' + fontName + '\'">' + fontName + '</a></li>'));
  853. });
  854. $('a[title]').tooltip({
  855. container: 'body'
  856. });
  857. $('.dropdown-menu input').click(function() {
  858. return false;
  859. })
  860. .change(function() {
  861. $(this).parent('.dropdown-menu').siblings('.dropdown-toggle').dropdown('toggle');
  862. })
  863. .keydown('esc', function() {
  864. this.value = '';
  865. $(this).change();
  866. });
  867. $('[data-role=magic-overlay]').each(function() {
  868. var overlay = $(this),
  869. target = $(overlay.data('target'));
  870. overlay.css('opacity', 0).css('position', 'absolute').offset(target.offset()).width(target.outerWidth()).height(target.outerHeight());
  871. });
  872. if ("onwebkitspeechchange" in document.createElement("input")) {
  873. var editorOffset = $('#editor').offset();
  874. $('.voiceBtn').css('position', 'absolute').offset({
  875. top: editorOffset.top,
  876. left: editorOffset.left + $('#editor').innerWidth() - 35
  877. });
  878. } else {
  879. $('.voiceBtn').hide();
  880. }
  881. }
  882. function showErrorAlert(reason, detail) {
  883. var msg = '';
  884. if (reason === 'unsupported-file-type') {
  885. msg = "Unsupported format " + detail;
  886. } else {
  887. console.log("error uploading file", reason, detail);
  888. }
  889. $('<div class="alert"> <button type="button" class="close" data-dismiss="alert">&times;</button>' +
  890. '<strong>File upload error</strong> ' + msg + ' </div>').prependTo('#alerts');
  891. }
  892. $('.editor-wrapper').each(function(){
  893. var id = $(this).attr('id'); //editor-one
  894. $(this).wysiwyg({
  895. toolbarSelector: '[data-target="#' + id + '"]',
  896. fileUploadError: showErrorAlert
  897. });
  898. });
  899. window.prettyPrint;
  900. prettyPrint();
  901. };
  902. /* CROPPER */
  903. function init_cropper() {
  904. if( typeof ($.fn.cropper) === 'undefined'){ return; }
  905. console.log('init_cropper');
  906. var $image = $('#image');
  907. var $download = $('#download');
  908. var $dataX = $('#dataX');
  909. var $dataY = $('#dataY');
  910. var $dataHeight = $('#dataHeight');
  911. var $dataWidth = $('#dataWidth');
  912. var $dataRotate = $('#dataRotate');
  913. var $dataScaleX = $('#dataScaleX');
  914. var $dataScaleY = $('#dataScaleY');
  915. var options = {
  916. aspectRatio: 16 / 9,
  917. preview: '.img-preview',
  918. crop: function (e) {
  919. $dataX.val(Math.round(e.x));
  920. $dataY.val(Math.round(e.y));
  921. $dataHeight.val(Math.round(e.height));
  922. $dataWidth.val(Math.round(e.width));
  923. $dataRotate.val(e.rotate);
  924. $dataScaleX.val(e.scaleX);
  925. $dataScaleY.val(e.scaleY);
  926. }
  927. };
  928. // Tooltip
  929. $('[data-toggle="tooltip"]').tooltip();
  930. // Cropper
  931. $image.on({
  932. 'build.cropper': function (e) {
  933. console.log(e.type);
  934. },
  935. 'built.cropper': function (e) {
  936. console.log(e.type);
  937. },
  938. 'cropstart.cropper': function (e) {
  939. console.log(e.type, e.action);
  940. },
  941. 'cropmove.cropper': function (e) {
  942. console.log(e.type, e.action);
  943. },
  944. 'cropend.cropper': function (e) {
  945. console.log(e.type, e.action);
  946. },
  947. 'crop.cropper': function (e) {
  948. console.log(e.type, e.x, e.y, e.width, e.height, e.rotate, e.scaleX, e.scaleY);
  949. },
  950. 'zoom.cropper': function (e) {
  951. console.log(e.type, e.ratio);
  952. }
  953. }).cropper(options);
  954. // Buttons
  955. if (!$.isFunction(document.createElement('canvas').getContext)) {
  956. $('button[data-method="getCroppedCanvas"]').prop('disabled', true);
  957. }
  958. if (typeof document.createElement('cropper').style.transition === 'undefined') {
  959. $('button[data-method="rotate"]').prop('disabled', true);
  960. $('button[data-method="scale"]').prop('disabled', true);
  961. }
  962. // Download
  963. if (typeof $download[0].download === 'undefined') {
  964. $download.addClass('disabled');
  965. }
  966. // Options
  967. $('.docs-toggles').on('change', 'input', function () {
  968. var $this = $(this);
  969. var name = $this.attr('name');
  970. var type = $this.prop('type');
  971. var cropBoxData;
  972. var canvasData;
  973. if (!$image.data('cropper')) {
  974. return;
  975. }
  976. if (type === 'checkbox') {
  977. options[name] = $this.prop('checked');
  978. cropBoxData = $image.cropper('getCropBoxData');
  979. canvasData = $image.cropper('getCanvasData');
  980. options.built = function () {
  981. $image.cropper('setCropBoxData', cropBoxData);
  982. $image.cropper('setCanvasData', canvasData);
  983. };
  984. } else if (type === 'radio') {
  985. options[name] = $this.val();
  986. }
  987. $image.cropper('destroy').cropper(options);
  988. });
  989. // Methods
  990. $('.docs-buttons').on('click', '[data-method]', function () {
  991. var $this = $(this);
  992. var data = $this.data();
  993. var $target;
  994. var result;
  995. if ($this.prop('disabled') || $this.hasClass('disabled')) {
  996. return;
  997. }
  998. if ($image.data('cropper') && data.method) {
  999. data = $.extend({}, data); // Clone a new one
  1000. if (typeof data.target !== 'undefined') {
  1001. $target = $(data.target);
  1002. if (typeof data.option === 'undefined') {
  1003. try {
  1004. data.option = JSON.parse($target.val());
  1005. } catch (e) {
  1006. console.log(e.message);
  1007. }
  1008. }
  1009. }
  1010. result = $image.cropper(data.method, data.option, data.secondOption);
  1011. switch (data.method) {
  1012. case 'scaleX':
  1013. case 'scaleY':
  1014. $(this).data('option', -data.option);
  1015. break;
  1016. case 'getCroppedCanvas':
  1017. if (result) {
  1018. // Bootstrap's Modal
  1019. $('#getCroppedCanvasModal').modal().find('.modal-body').html(result);
  1020. if (!$download.hasClass('disabled')) {
  1021. $download.attr('href', result.toDataURL());
  1022. }
  1023. }
  1024. break;
  1025. }
  1026. if ($.isPlainObject(result) && $target) {
  1027. try {
  1028. $target.val(JSON.stringify(result));
  1029. } catch (e) {
  1030. console.log(e.message);
  1031. }
  1032. }
  1033. }
  1034. });
  1035. // Keyboard
  1036. $(document.body).on('keydown', function (e) {
  1037. if (!$image.data('cropper') || this.scrollTop > 300) {
  1038. return;
  1039. }
  1040. switch (e.which) {
  1041. case 37:
  1042. e.preventDefault();
  1043. $image.cropper('move', -1, 0);
  1044. break;
  1045. case 38:
  1046. e.preventDefault();
  1047. $image.cropper('move', 0, -1);
  1048. break;
  1049. case 39:
  1050. e.preventDefault();
  1051. $image.cropper('move', 1, 0);
  1052. break;
  1053. case 40:
  1054. e.preventDefault();
  1055. $image.cropper('move', 0, 1);
  1056. break;
  1057. }
  1058. });
  1059. // Import image
  1060. var $inputImage = $('#inputImage');
  1061. var URL = window.URL || window.webkitURL;
  1062. var blobURL;
  1063. if (URL) {
  1064. $inputImage.change(function () {
  1065. var files = this.files;
  1066. var file;
  1067. if (!$image.data('cropper')) {
  1068. return;
  1069. }
  1070. if (files && files.length) {
  1071. file = files[0];
  1072. if (/^image\/\w+$/.test(file.type)) {
  1073. blobURL = URL.createObjectURL(file);
  1074. $image.one('built.cropper', function () {
  1075. // Revoke when load complete
  1076. URL.revokeObjectURL(blobURL);
  1077. }).cropper('reset').cropper('replace', blobURL);
  1078. $inputImage.val('');
  1079. } else {
  1080. window.alert('Please choose an image file.');
  1081. }
  1082. }
  1083. });
  1084. } else {
  1085. $inputImage.prop('disabled', true).parent().addClass('disabled');
  1086. }
  1087. };
  1088. /* CROPPER --- end */
  1089. /* KNOB */
  1090. function init_knob() {
  1091. if( typeof ($.fn.knob) === 'undefined'){ return; }
  1092. console.log('init_knob');
  1093. $(".knob").knob({
  1094. change: function(value) {
  1095. //console.log("change : " + value);
  1096. },
  1097. release: function(value) {
  1098. //console.log(this.$.attr('value'));
  1099. console.log("release : " + value);
  1100. },
  1101. cancel: function() {
  1102. console.log("cancel : ", this);
  1103. },
  1104. /*format : function (value) {
  1105. return value + '%';
  1106. },*/
  1107. draw: function() {
  1108. // "tron" case
  1109. if (this.$.data('skin') == 'tron') {
  1110. this.cursorExt = 0.3;
  1111. var a = this.arc(this.cv) // Arc
  1112. ,
  1113. pa // Previous arc
  1114. , r = 1;
  1115. this.g.lineWidth = this.lineWidth;
  1116. if (this.o.displayPrevious) {
  1117. pa = this.arc(this.v);
  1118. this.g.beginPath();
  1119. this.g.strokeStyle = this.pColor;
  1120. this.g.arc(this.xy, this.xy, this.radius - this.lineWidth, pa.s, pa.e, pa.d);
  1121. this.g.stroke();
  1122. }
  1123. this.g.beginPath();
  1124. this.g.strokeStyle = r ? this.o.fgColor : this.fgColor;
  1125. this.g.arc(this.xy, this.xy, this.radius - this.lineWidth, a.s, a.e, a.d);
  1126. this.g.stroke();
  1127. this.g.lineWidth = 2;
  1128. this.g.beginPath();
  1129. this.g.strokeStyle = this.o.fgColor;
  1130. this.g.arc(this.xy, this.xy, this.radius - this.lineWidth + 1 + this.lineWidth * 2 / 3, 0, 2 * Math.PI, false);
  1131. this.g.stroke();
  1132. return false;
  1133. }
  1134. }
  1135. });
  1136. // Example of infinite knob, iPod click wheel
  1137. var v, up = 0,
  1138. down = 0,
  1139. i = 0,
  1140. $idir = $("div.idir"),
  1141. $ival = $("div.ival"),
  1142. incr = function() {
  1143. i++;
  1144. $idir.show().html("+").fadeOut();
  1145. $ival.html(i);
  1146. },
  1147. decr = function() {
  1148. i--;
  1149. $idir.show().html("-").fadeOut();
  1150. $ival.html(i);
  1151. };
  1152. $("input.infinite").knob({
  1153. min: 0,
  1154. max: 20,
  1155. stopper: false,
  1156. change: function() {
  1157. if (v > this.cv) {
  1158. if (up) {
  1159. decr();
  1160. up = 0;
  1161. } else {
  1162. up = 1;
  1163. down = 0;
  1164. }
  1165. } else {
  1166. if (v < this.cv) {
  1167. if (down) {
  1168. incr();
  1169. down = 0;
  1170. } else {
  1171. down = 1;
  1172. up = 0;
  1173. }
  1174. }
  1175. }
  1176. v = this.cv;
  1177. }
  1178. });
  1179. };
  1180. /* INPUT MASK */
  1181. function init_InputMask() {
  1182. if( typeof ($.fn.inputmask) === 'undefined'){ return; }
  1183. console.log('init_InputMask');
  1184. $(":input").inputmask();
  1185. };
  1186. /* COLOR PICKER */
  1187. function init_ColorPicker() {
  1188. if( typeof ($.fn.colorpicker) === 'undefined'){ return; }
  1189. console.log('init_ColorPicker');
  1190. $('.demo1').colorpicker();
  1191. $('.demo2').colorpicker();
  1192. $('#demo_forceformat').colorpicker({
  1193. format: 'rgba',
  1194. horizontal: true
  1195. });
  1196. $('#demo_forceformat3').colorpicker({
  1197. format: 'rgba',
  1198. });
  1199. $('.demo-auto').colorpicker();
  1200. };
  1201. /* ION RANGE SLIDER */
  1202. function init_IonRangeSlider() {
  1203. if( typeof ($.fn.ionRangeSlider) === 'undefined'){ return; }
  1204. console.log('init_IonRangeSlider');
  1205. $("#range_27").ionRangeSlider({
  1206. type: "double",
  1207. min: 1000000,
  1208. max: 2000000,
  1209. grid: true,
  1210. force_edges: true
  1211. });
  1212. $("#range").ionRangeSlider({
  1213. hide_min_max: true,
  1214. keyboard: true,
  1215. min: 0,
  1216. max: 5000,
  1217. from: 1000,
  1218. to: 4000,
  1219. type: 'double',
  1220. step: 1,
  1221. prefix: "$",
  1222. grid: true
  1223. });
  1224. $("#range_25").ionRangeSlider({
  1225. type: "double",
  1226. min: 1000000,
  1227. max: 2000000,
  1228. grid: true
  1229. });
  1230. $("#range_26").ionRangeSlider({
  1231. type: "double",
  1232. min: 0,
  1233. max: 10000,
  1234. step: 500,
  1235. grid: true,
  1236. grid_snap: true
  1237. });
  1238. $("#range_31").ionRangeSlider({
  1239. type: "double",
  1240. min: 0,
  1241. max: 100,
  1242. from: 30,
  1243. to: 70,
  1244. from_fixed: true
  1245. });
  1246. $(".range_min_max").ionRangeSlider({
  1247. type: "double",
  1248. min: 0,
  1249. max: 100,
  1250. from: 30,
  1251. to: 70,
  1252. max_interval: 50
  1253. });
  1254. $(".range_time24").ionRangeSlider({
  1255. min: +moment().subtract(12, "hours").format("X"),
  1256. max: +moment().format("X"),
  1257. from: +moment().subtract(6, "hours").format("X"),
  1258. grid: true,
  1259. force_edges: true,
  1260. prettify: function(num) {
  1261. var m = moment(num, "X");
  1262. return m.format("Do MMMM, HH:mm");
  1263. }
  1264. });
  1265. };
  1266. /* DATERANGEPICKER */
  1267. function init_daterangepicker() {
  1268. if( typeof ($.fn.daterangepicker) === 'undefined'){ return; }
  1269. console.log('init_daterangepicker');
  1270. var cb = function(start, end, label) {
  1271. console.log(start.toISOString(), end.toISOString(), label);
  1272. $('#reportrange span').html(start.format('MMMM D, YYYY') + ' - ' + end.format('MMMM D, YYYY'));
  1273. };
  1274. var optionSet1 = {
  1275. startDate: moment().subtract(29, 'days'),
  1276. endDate: moment(),
  1277. minDate: '01/01/2012',
  1278. maxDate: '12/31/2015',
  1279. dateLimit: {
  1280. days: 60
  1281. },
  1282. showDropdowns: true,
  1283. showWeekNumbers: true,
  1284. timePicker: false,
  1285. timePickerIncrement: 1,
  1286. timePicker12Hour: true,
  1287. ranges: {
  1288. 'Today': [moment(), moment()],
  1289. 'Yesterday': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],
  1290. 'Last 7 Days': [moment().subtract(6, 'days'), moment()],
  1291. 'Last 30 Days': [moment().subtract(29, 'days'), moment()],
  1292. 'This Month': [moment().startOf('month'), moment().endOf('month')],
  1293. 'Last Month': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
  1294. },
  1295. opens: 'left',
  1296. buttonClasses: ['btn btn-default'],
  1297. applyClass: 'btn-small btn-primary',
  1298. cancelClass: 'btn-small',
  1299. format: 'MM/DD/YYYY',
  1300. separator: ' to ',
  1301. locale: {
  1302. applyLabel: 'Submit',
  1303. cancelLabel: 'Clear',
  1304. fromLabel: 'From',
  1305. toLabel: 'To',
  1306. customRangeLabel: 'Custom',
  1307. daysOfWeek: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],
  1308. monthNames: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
  1309. firstDay: 1
  1310. }
  1311. };
  1312. $('#reportrange span').html(moment().subtract(29, 'days').format('MMMM D, YYYY') + ' - ' + moment().format('MMMM D, YYYY'));
  1313. $('#reportrange').daterangepicker(optionSet1, cb);
  1314. $('#reportrange').on('show.daterangepicker', function() {
  1315. console.log("show event fired");
  1316. });
  1317. $('#reportrange').on('hide.daterangepicker', function() {
  1318. console.log("hide event fired");
  1319. });
  1320. $('#reportrange').on('apply.daterangepicker', function(ev, picker) {
  1321. console.log("apply event fired, start/end dates are " + picker.startDate.format('MMMM D, YYYY') + " to " + picker.endDate.format('MMMM D, YYYY'));
  1322. });
  1323. $('#reportrange').on('cancel.daterangepicker', function(ev, picker) {
  1324. console.log("cancel event fired");
  1325. });
  1326. $('#options1').click(function() {
  1327. $('#reportrange').data('daterangepicker').setOptions(optionSet1, cb);
  1328. });
  1329. $('#options2').click(function() {
  1330. $('#reportrange').data('daterangepicker').setOptions(optionSet2, cb);
  1331. });
  1332. $('#destroy').click(function() {
  1333. $('#reportrange').data('daterangepicker').remove();
  1334. });
  1335. }
  1336. function init_daterangepicker_right() {
  1337. if( typeof ($.fn.daterangepicker) === 'undefined'){ return; }
  1338. console.log('init_daterangepicker_right');
  1339. var cb = function(start, end, label) {
  1340. console.log(start.toISOString(), end.toISOString(), label);
  1341. $('#reportrange_right span').html(start.format('MMMM D, YYYY') + ' - ' + end.format('MMMM D, YYYY'));
  1342. };
  1343. var optionSet1 = {
  1344. startDate: moment().subtract(29, 'days'),
  1345. endDate: moment(),
  1346. minDate: '01/01/2012',
  1347. maxDate: '12/31/2020',
  1348. dateLimit: {
  1349. days: 60
  1350. },
  1351. showDropdowns: true,
  1352. showWeekNumbers: true,
  1353. timePicker: false,
  1354. timePickerIncrement: 1,
  1355. timePicker12Hour: true,
  1356. ranges: {
  1357. 'Today': [moment(), moment()],
  1358. 'Yesterday': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],
  1359. 'Last 7 Days': [moment().subtract(6, 'days'), moment()],
  1360. 'Last 30 Days': [moment().subtract(29, 'days'), moment()],
  1361. 'This Month': [moment().startOf('month'), moment().endOf('month')],
  1362. 'Last Month': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
  1363. },
  1364. opens: 'right',
  1365. buttonClasses: ['btn btn-default'],
  1366. applyClass: 'btn-small btn-primary',
  1367. cancelClass: 'btn-small',
  1368. format: 'MM/DD/YYYY',
  1369. separator: ' to ',
  1370. locale: {
  1371. applyLabel: 'Submit',
  1372. cancelLabel: 'Clear',
  1373. fromLabel: 'From',
  1374. toLabel: 'To',
  1375. customRangeLabel: 'Custom',
  1376. daysOfWeek: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],
  1377. monthNames: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
  1378. firstDay: 1
  1379. }
  1380. };
  1381. $('#reportrange_right span').html(moment().subtract(29, 'days').format('MMMM D, YYYY') + ' - ' + moment().format('MMMM D, YYYY'));
  1382. $('#reportrange_right').daterangepicker(optionSet1, cb);
  1383. $('#reportrange_right').on('show.daterangepicker', function() {
  1384. console.log("show event fired");
  1385. });
  1386. $('#reportrange_right').on('hide.daterangepicker', function() {
  1387. console.log("hide event fired");
  1388. });
  1389. $('#reportrange_right').on('apply.daterangepicker', function(ev, picker) {
  1390. console.log("apply event fired, start/end dates are " + picker.startDate.format('MMMM D, YYYY') + " to " + picker.endDate.format('MMMM D, YYYY'));
  1391. });
  1392. $('#reportrange_right').on('cancel.daterangepicker', function(ev, picker) {
  1393. console.log("cancel event fired");
  1394. });
  1395. $('#options1').click(function() {
  1396. $('#reportrange_right').data('daterangepicker').setOptions(optionSet1, cb);
  1397. });
  1398. $('#options2').click(function() {
  1399. $('#reportrange_right').data('daterangepicker').setOptions(optionSet2, cb);
  1400. });
  1401. $('#destroy').click(function() {
  1402. $('#reportrange_right').data('daterangepicker').remove();
  1403. });
  1404. }
  1405. function init_daterangepicker_single_call() {
  1406. if( typeof ($.fn.daterangepicker) === 'undefined'){ return; }
  1407. console.log('init_daterangepicker_single_call');
  1408. $('#single_cal1').daterangepicker({
  1409. singleDatePicker: true,
  1410. singleClasses: "picker_1"
  1411. }, function(start, end, label) {
  1412. console.log(start.toISOString(), end.toISOString(), label);
  1413. });
  1414. $('#single_cal2').daterangepicker({
  1415. singleDatePicker: true,
  1416. singleClasses: "picker_2"
  1417. }, function(start, end, label) {
  1418. console.log(start.toISOString(), end.toISOString(), label);
  1419. });
  1420. $('#single_cal3').daterangepicker({
  1421. singleDatePicker: true,
  1422. singleClasses: "picker_3"
  1423. }, function(start, end, label) {
  1424. console.log(start.toISOString(), end.toISOString(), label);
  1425. });
  1426. $('#single_cal4').daterangepicker({
  1427. singleDatePicker: true,
  1428. singleClasses: "picker_4"
  1429. }, function(start, end, label) {
  1430. console.log(start.toISOString(), end.toISOString(), label);
  1431. });
  1432. }
  1433. function init_daterangepicker_reservation() {
  1434. if( typeof ($.fn.daterangepicker) === 'undefined'){ return; }
  1435. console.log('init_daterangepicker_reservation');
  1436. $('#reservation').daterangepicker(null, function(start, end, label) {
  1437. console.log(start.toISOString(), end.toISOString(), label);
  1438. });
  1439. $('#reservation-time').daterangepicker({
  1440. timePicker: true,
  1441. timePickerIncrement: 30,
  1442. locale: {
  1443. format: 'MM/DD/YYYY h:mm A'
  1444. }
  1445. });
  1446. }
  1447. /* SMART WIZARD */
  1448. function init_SmartWizard() {
  1449. if( typeof ($.fn.smartWizard) === 'undefined'){ return; }
  1450. console.log('init_SmartWizard');
  1451. $('#wizard').smartWizard();
  1452. $('#wizard_verticle').smartWizard({
  1453. transitionEffect: 'slide'
  1454. });
  1455. $('.buttonNext').addClass('btn btn-success');
  1456. $('.buttonPrevious').addClass('btn btn-primary');
  1457. $('.buttonFinish').addClass('btn btn-default');
  1458. };
  1459. /* VALIDATOR */
  1460. function init_validator () {
  1461. if( typeof (validator) === 'undefined'){ return; }
  1462. console.log('init_validator');
  1463. // initialize the validator function
  1464. validator.message.date = 'not a real date';
  1465. // validate a field on "blur" event, a 'select' on 'change' event & a '.reuired' classed multifield on 'keyup':
  1466. $('form')
  1467. .on('blur', 'input[required], input.optional, select.required', validator.checkField)
  1468. .on('change', 'select.required', validator.checkField)
  1469. .on('keypress', 'input[required][pattern]', validator.keypress);
  1470. $('.multi.required').on('keyup blur', 'input', function() {
  1471. validator.checkField.apply($(this).siblings().last()[0]);
  1472. });
  1473. $('form').submit(function(e) {
  1474. e.preventDefault();
  1475. var submit = true;
  1476. // evaluate the form using generic validaing
  1477. if (!validator.checkAll($(this))) {
  1478. submit = false;
  1479. }
  1480. if (submit)
  1481. this.submit();
  1482. return false;
  1483. });
  1484. };
  1485. /* PNotify */
  1486. function init_PNotify() {
  1487. if( typeof (PNotify) === 'undefined'){ return; }
  1488. console.log('init_PNotify');
  1489. new PNotify({
  1490. title: "PNotify",
  1491. type: "info",
  1492. text: "Welcome. Try hovering over me. You can click things behind me, because I'm non-blocking.",
  1493. nonblock: {
  1494. nonblock: true
  1495. },
  1496. addclass: 'dark',
  1497. styling: 'bootstrap3',
  1498. hide: false,
  1499. before_close: function(PNotify) {
  1500. PNotify.update({
  1501. title: PNotify.options.title + " - Enjoy your Stay",
  1502. before_close: null
  1503. });
  1504. PNotify.queueRemove();
  1505. return false;
  1506. }
  1507. });
  1508. };
  1509. /* CUSTOM NOTIFICATION */
  1510. function init_CustomNotification() {
  1511. console.log('run_customtabs');
  1512. if( typeof (CustomTabs) === 'undefined'){ return; }
  1513. console.log('init_CustomTabs');
  1514. var cnt = 10;
  1515. TabbedNotification = function(options) {
  1516. var message = "<div id='ntf" + cnt + "' class='text alert-" + options.type + "' style='display:none'><h2><i class='fa fa-bell'></i> " + options.title +
  1517. "</h2><div class='close'><a href='javascript:;' class='notification_close'><i class='fa fa-close'></i></a></div><p>" + options.text + "</p></div>";
  1518. if (!document.getElementById('custom_notifications')) {
  1519. alert('doesnt exists');
  1520. } else {
  1521. $('#custom_notifications ul.notifications').append("<li><a id='ntlink" + cnt + "' class='alert-" + options.type + "' href='#ntf" + cnt + "'><i class='fa fa-bell animated shake'></i></a></li>");
  1522. $('#custom_notifications #notif-group').append(message);
  1523. cnt++;
  1524. CustomTabs(options);
  1525. }
  1526. };
  1527. CustomTabs = function(options) {
  1528. $('.tabbed_notifications > div').hide();
  1529. $('.tabbed_notifications > div:first-of-type').show();
  1530. $('#custom_notifications').removeClass('dsp_none');
  1531. $('.notifications a').click(function(e) {
  1532. e.preventDefault();
  1533. var $this = $(this),
  1534. tabbed_notifications = '#' + $this.parents('.notifications').data('tabbed_notifications'),
  1535. others = $this.closest('li').siblings().children('a'),
  1536. target = $this.attr('href');
  1537. others.removeClass('active');
  1538. $this.addClass('active');
  1539. $(tabbed_notifications).children('div').hide();
  1540. $(target).show();
  1541. });
  1542. };
  1543. CustomTabs();
  1544. var tabid = idname = '';
  1545. $(document).on('click', '.notification_close', function(e) {
  1546. idname = $(this).parent().parent().attr("id");
  1547. tabid = idname.substr(-2);
  1548. $('#ntf' + tabid).remove();
  1549. $('#ntlink' + tabid).parent().remove();
  1550. $('.notifications a').first().addClass('active');
  1551. $('#notif-group div').first().css('display', 'block');
  1552. });
  1553. };
  1554. /* EASYPIECHART */
  1555. function init_EasyPieChart() {
  1556. if( typeof ($.fn.easyPieChart) === 'undefined'){ return; }
  1557. console.log('init_EasyPieChart');
  1558. $('.chart').easyPieChart({
  1559. easing: 'easeOutElastic',
  1560. delay: 3000,
  1561. barColor: '#26B99A',
  1562. trackColor: '#fff',
  1563. scaleColor: false,
  1564. lineWidth: 20,
  1565. trackWidth: 16,
  1566. lineCap: 'butt',
  1567. onStep: function(from, to, percent) {
  1568. $(this.el).find('.percent').text(Math.round(percent));
  1569. }
  1570. });
  1571. var chart = window.chart = $('.chart').data('easyPieChart');
  1572. $('.js_update').on('click', function() {
  1573. chart.update(Math.random() * 200 - 100);
  1574. });
  1575. //hover and retain popover when on popover content
  1576. var originalLeave = $.fn.popover.Constructor.prototype.leave;
  1577. $.fn.popover.Constructor.prototype.leave = function(obj) {
  1578. var self = obj instanceof this.constructor ?
  1579. obj : $(obj.currentTarget)[this.type](this.getDelegateOptions()).data('bs.' + this.type);
  1580. var container, timeout;
  1581. originalLeave.call(this, obj);
  1582. if (obj.currentTarget) {
  1583. container = $(obj.currentTarget).siblings('.popover');
  1584. timeout = self.timeout;
  1585. container.one('mouseenter', function() {
  1586. //We entered the actual popover – call off the dogs
  1587. clearTimeout(timeout);
  1588. //Let's monitor popover content instead
  1589. container.one('mouseleave', function() {
  1590. $.fn.popover.Constructor.prototype.leave.call(self, self);
  1591. });
  1592. });
  1593. }
  1594. };
  1595. $('body').popover({
  1596. selector: '[data-popover]',
  1597. trigger: 'click hover',
  1598. delay: {
  1599. show: 50,
  1600. hide: 400
  1601. }
  1602. });
  1603. };
  1604. function init_charts() {
  1605. console.log('run_charts typeof [' + typeof (Chart) + ']');
  1606. if( typeof (Chart) === 'undefined'){ return; }
  1607. console.log('init_charts');
  1608. Chart.defaults.global.legend = {
  1609. enabled: false
  1610. };
  1611. if ($('#canvas_line').length ){
  1612. var canvas_line_00 = new Chart(document.getElementById("canvas_line"), {
  1613. type: 'line',
  1614. data: {
  1615. labels: ["January", "February", "March", "April", "May", "June", "July"],
  1616. datasets: [{
  1617. label: "My First dataset",
  1618. backgroundColor: "rgba(38, 185, 154, 0.31)",
  1619. borderColor: "rgba(38, 185, 154, 0.7)",
  1620. pointBorderColor: "rgba(38, 185, 154, 0.7)",
  1621. pointBackgroundColor: "rgba(38, 185, 154, 0.7)",
  1622. pointHoverBackgroundColor: "#fff",
  1623. pointHoverBorderColor: "rgba(220,220,220,1)",
  1624. pointBorderWidth: 1,
  1625. data: [31, 74, 6, 39, 20, 85, 7]
  1626. }, {
  1627. label: "My Second dataset",
  1628. backgroundColor: "rgba(3, 88, 106, 0.3)",
  1629. borderColor: "rgba(3, 88, 106, 0.70)",
  1630. pointBorderColor: "rgba(3, 88, 106, 0.70)",
  1631. pointBackgroundColor: "rgba(3, 88, 106, 0.70)",
  1632. pointHoverBackgroundColor: "#fff",
  1633. pointHoverBorderColor: "rgba(151,187,205,1)",
  1634. pointBorderWidth: 1,
  1635. data: [82, 23, 66, 9, 99, 4, 2]
  1636. }]
  1637. },
  1638. });
  1639. }
  1640. if ($('#canvas_line1').length ){
  1641. var canvas_line_01 = new Chart(document.getElementById("canvas_line1"), {
  1642. type: 'line',
  1643. data: {
  1644. labels: ["January", "February", "March", "April", "May", "June", "July"],
  1645. datasets: [{
  1646. label: "My First dataset",
  1647. backgroundColor: "rgba(38, 185, 154, 0.31)",
  1648. borderColor: "rgba(38, 185, 154, 0.7)",
  1649. pointBorderColor: "rgba(38, 185, 154, 0.7)",
  1650. pointBackgroundColor: "rgba(38, 185, 154, 0.7)",
  1651. pointHoverBackgroundColor: "#fff",
  1652. pointHoverBorderColor: "rgba(220,220,220,1)",
  1653. pointBorderWidth: 1,
  1654. data: [31, 74, 6, 39, 20, 85, 7]
  1655. }, {
  1656. label: "My Second dataset",
  1657. backgroundColor: "rgba(3, 88, 106, 0.3)",
  1658. borderColor: "rgba(3, 88, 106, 0.70)",
  1659. pointBorderColor: "rgba(3, 88, 106, 0.70)",
  1660. pointBackgroundColor: "rgba(3, 88, 106, 0.70)",
  1661. pointHoverBackgroundColor: "#fff",
  1662. pointHoverBorderColor: "rgba(151,187,205,1)",
  1663. pointBorderWidth: 1,
  1664. data: [82, 23, 66, 9, 99, 4, 2]
  1665. }]
  1666. },
  1667. });
  1668. }
  1669. if ($('#canvas_line2').length ){
  1670. var canvas_line_02 = new Chart(document.getElementById("canvas_line2"), {
  1671. type: 'line',
  1672. data: {
  1673. labels: ["January", "February", "March", "April", "May", "June", "July"],
  1674. datasets: [{
  1675. label: "My First dataset",
  1676. backgroundColor: "rgba(38, 185, 154, 0.31)",
  1677. borderColor: "rgba(38, 185, 154, 0.7)",
  1678. pointBorderColor: "rgba(38, 185, 154, 0.7)",
  1679. pointBackgroundColor: "rgba(38, 185, 154, 0.7)",
  1680. pointHoverBackgroundColor: "#fff",
  1681. pointHoverBorderColor: "rgba(220,220,220,1)",
  1682. pointBorderWidth: 1,
  1683. data: [31, 74, 6, 39, 20, 85, 7]
  1684. }, {
  1685. label: "My Second dataset",
  1686. backgroundColor: "rgba(3, 88, 106, 0.3)",
  1687. borderColor: "rgba(3, 88, 106, 0.70)",
  1688. pointBorderColor: "rgba(3, 88, 106, 0.70)",
  1689. pointBackgroundColor: "rgba(3, 88, 106, 0.70)",
  1690. pointHoverBackgroundColor: "#fff",
  1691. pointHoverBorderColor: "rgba(151,187,205,1)",
  1692. pointBorderWidth: 1,
  1693. data: [82, 23, 66, 9, 99, 4, 2]
  1694. }]
  1695. },
  1696. });
  1697. }
  1698. if ($('#canvas_line3').length ){
  1699. var canvas_line_03 = new Chart(document.getElementById("canvas_line3"), {
  1700. type: 'line',
  1701. data: {
  1702. labels: ["January", "February", "March", "April", "May", "June", "July"],
  1703. datasets: [{
  1704. label: "My First dataset",
  1705. backgroundColor: "rgba(38, 185, 154, 0.31)",
  1706. borderColor: "rgba(38, 185, 154, 0.7)",
  1707. pointBorderColor: "rgba(38, 185, 154, 0.7)",
  1708. pointBackgroundColor: "rgba(38, 185, 154, 0.7)",
  1709. pointHoverBackgroundColor: "#fff",
  1710. pointHoverBorderColor: "rgba(220,220,220,1)",
  1711. pointBorderWidth: 1,
  1712. data: [31, 74, 6, 39, 20, 85, 7]
  1713. }, {
  1714. label: "My Second dataset",
  1715. backgroundColor: "rgba(3, 88, 106, 0.3)",
  1716. borderColor: "rgba(3, 88, 106, 0.70)",
  1717. pointBorderColor: "rgba(3, 88, 106, 0.70)",
  1718. pointBackgroundColor: "rgba(3, 88, 106, 0.70)",
  1719. pointHoverBackgroundColor: "#fff",
  1720. pointHoverBorderColor: "rgba(151,187,205,1)",
  1721. pointBorderWidth: 1,
  1722. data: [82, 23, 66, 9, 99, 4, 2]
  1723. }]
  1724. },
  1725. });
  1726. }
  1727. if ($('#canvas_line4').length ){
  1728. var canvas_line_04 = new Chart(document.getElementById("canvas_line4"), {
  1729. type: 'line',
  1730. data: {
  1731. labels: ["January", "February", "March", "April", "May", "June", "July"],
  1732. datasets: [{
  1733. label: "My First dataset",
  1734. backgroundColor: "rgba(38, 185, 154, 0.31)",
  1735. borderColor: "rgba(38, 185, 154, 0.7)",
  1736. pointBorderColor: "rgba(38, 185, 154, 0.7)",
  1737. pointBackgroundColor: "rgba(38, 185, 154, 0.7)",
  1738. pointHoverBackgroundColor: "#fff",
  1739. pointHoverBorderColor: "rgba(220,220,220,1)",
  1740. pointBorderWidth: 1,
  1741. data: [31, 74, 6, 39, 20, 85, 7]
  1742. }, {
  1743. label: "My Second dataset",
  1744. backgroundColor: "rgba(3, 88, 106, 0.3)",
  1745. borderColor: "rgba(3, 88, 106, 0.70)",
  1746. pointBorderColor: "rgba(3, 88, 106, 0.70)",
  1747. pointBackgroundColor: "rgba(3, 88, 106, 0.70)",
  1748. pointHoverBackgroundColor: "#fff",
  1749. pointHoverBorderColor: "rgba(151,187,205,1)",
  1750. pointBorderWidth: 1,
  1751. data: [82, 23, 66, 9, 99, 4, 2]
  1752. }]
  1753. },
  1754. });
  1755. }
  1756. // Line chart
  1757. if ($('#lineChart').length ){
  1758. var ctx = document.getElementById("lineChart");
  1759. var lineChart = new Chart(ctx, {
  1760. type: 'line',
  1761. data: {
  1762. labels: ["January", "February", "March", "April", "May", "June", "July"],
  1763. datasets: [{
  1764. label: "My First dataset",
  1765. backgroundColor: "rgba(38, 185, 154, 0.31)",
  1766. borderColor: "rgba(38, 185, 154, 0.7)",
  1767. pointBorderColor: "rgba(38, 185, 154, 0.7)",
  1768. pointBackgroundColor: "rgba(38, 185, 154, 0.7)",
  1769. pointHoverBackgroundColor: "#fff",
  1770. pointHoverBorderColor: "rgba(220,220,220,1)",
  1771. pointBorderWidth: 1,
  1772. data: [31, 74, 6, 39, 20, 85, 7]
  1773. }, {
  1774. label: "My Second dataset",
  1775. backgroundColor: "rgba(3, 88, 106, 0.3)",
  1776. borderColor: "rgba(3, 88, 106, 0.70)",
  1777. pointBorderColor: "rgba(3, 88, 106, 0.70)",
  1778. pointBackgroundColor: "rgba(3, 88, 106, 0.70)",
  1779. pointHoverBackgroundColor: "#fff",
  1780. pointHoverBorderColor: "rgba(151,187,205,1)",
  1781. pointBorderWidth: 1,
  1782. data: [82, 23, 66, 9, 99, 4, 2]
  1783. }]
  1784. },
  1785. });
  1786. }
  1787. // Bar chart
  1788. if ($('#mybarChart').length ){
  1789. var ctx = document.getElementById("mybarChart");
  1790. var mybarChart = new Chart(ctx, {
  1791. type: 'bar',
  1792. data: {
  1793. labels: ["January", "February", "March", "April", "May", "June", "July"],
  1794. datasets: [{
  1795. label: '# of Votes',
  1796. backgroundColor: "#26B99A",
  1797. data: [51, 30, 40, 28, 92, 50, 45]
  1798. }, {
  1799. label: '# of Votes',
  1800. backgroundColor: "#03586A",
  1801. data: [41, 56, 25, 48, 72, 34, 12]
  1802. }]
  1803. },
  1804. options: {
  1805. scales: {
  1806. yAxes: [{
  1807. ticks: {
  1808. beginAtZero: true
  1809. }
  1810. }]
  1811. }
  1812. }
  1813. });
  1814. }
  1815. // Doughnut chart
  1816. if ($('#canvasDoughnut').length ){
  1817. var ctx = document.getElementById("canvasDoughnut");
  1818. var data = {
  1819. labels: [
  1820. "Dark Grey",
  1821. "Purple Color",
  1822. "Gray Color",
  1823. "Green Color",
  1824. "Blue Color"
  1825. ],
  1826. datasets: [{
  1827. data: [120, 50, 140, 180, 100],
  1828. backgroundColor: [
  1829. "#455C73",
  1830. "#9B59B6",
  1831. "#BDC3C7",
  1832. "#26B99A",
  1833. "#3498DB"
  1834. ],
  1835. hoverBackgroundColor: [
  1836. "#34495E",
  1837. "#B370CF",
  1838. "#CFD4D8",
  1839. "#36CAAB",
  1840. "#49A9EA"
  1841. ]
  1842. }]
  1843. };
  1844. var canvasDoughnut = new Chart(ctx, {
  1845. type: 'doughnut',
  1846. tooltipFillColor: "rgba(51, 51, 51, 0.55)",
  1847. data: data
  1848. });
  1849. }
  1850. // Radar chart
  1851. if ($('#canvasRadar').length ){
  1852. var ctx = document.getElementById("canvasRadar");
  1853. var data = {
  1854. labels: ["Eating", "Drinking", "Sleeping", "Designing", "Coding", "Cycling", "Running"],
  1855. datasets: [{
  1856. label: "My First dataset",
  1857. backgroundColor: "rgba(3, 88, 106, 0.2)",
  1858. borderColor: "rgba(3, 88, 106, 0.80)",
  1859. pointBorderColor: "rgba(3, 88, 106, 0.80)",
  1860. pointBackgroundColor: "rgba(3, 88, 106, 0.80)",
  1861. pointHoverBackgroundColor: "#fff",
  1862. pointHoverBorderColor: "rgba(220,220,220,1)",
  1863. data: [65, 59, 90, 81, 56, 55, 40]
  1864. }, {
  1865. label: "My Second dataset",
  1866. backgroundColor: "rgba(38, 185, 154, 0.2)",
  1867. borderColor: "rgba(38, 185, 154, 0.85)",
  1868. pointColor: "rgba(38, 185, 154, 0.85)",
  1869. pointStrokeColor: "#fff",
  1870. pointHighlightFill: "#fff",
  1871. pointHighlightStroke: "rgba(151,187,205,1)",
  1872. data: [28, 48, 40, 19, 96, 27, 100]
  1873. }]
  1874. };
  1875. var canvasRadar = new Chart(ctx, {
  1876. type: 'radar',
  1877. data: data,
  1878. });
  1879. }
  1880. // Pie chart
  1881. if ($('#pieChart').length ){
  1882. var ctx = document.getElementById("pieChart");
  1883. var data = {
  1884. datasets: [{
  1885. data: [120, 50, 140, 180, 100],
  1886. backgroundColor: [
  1887. "#455C73",
  1888. "#9B59B6",
  1889. "#BDC3C7",
  1890. "#26B99A",
  1891. "#3498DB"
  1892. ],
  1893. label: 'My dataset' // for legend
  1894. }],
  1895. labels: [
  1896. "Dark Gray",
  1897. "Purple",
  1898. "Gray",
  1899. "Green",
  1900. "Blue"
  1901. ]
  1902. };
  1903. var pieChart = new Chart(ctx, {
  1904. data: data,
  1905. type: 'pie',
  1906. otpions: {
  1907. legend: false
  1908. }
  1909. });
  1910. }
  1911. // PolarArea chart
  1912. if ($('#polarArea').length ){
  1913. var ctx = document.getElementById("polarArea");
  1914. var data = {
  1915. datasets: [{
  1916. data: [120, 50, 140, 180, 100],
  1917. backgroundColor: [
  1918. "#455C73",
  1919. "#9B59B6",
  1920. "#BDC3C7",
  1921. "#26B99A",
  1922. "#3498DB"
  1923. ],
  1924. label: 'My dataset'
  1925. }],
  1926. labels: [
  1927. "Dark Gray",
  1928. "Purple",
  1929. "Gray",
  1930. "Green",
  1931. "Blue"
  1932. ]
  1933. };
  1934. var polarArea = new Chart(ctx, {
  1935. data: data,
  1936. type: 'polarArea',
  1937. options: {
  1938. scale: {
  1939. ticks: {
  1940. beginAtZero: true
  1941. }
  1942. }
  1943. }
  1944. });
  1945. }
  1946. }
  1947. /* COMPOSE */
  1948. function init_compose() {
  1949. if( typeof ($.fn.slideToggle) === 'undefined'){ return; }
  1950. console.log('init_compose');
  1951. $('#compose, .compose-close').click(function(){
  1952. $('.compose').slideToggle();
  1953. });
  1954. };
  1955. /* CALENDAR */
  1956. function init_calendar() {
  1957. if( typeof ($.fn.fullCalendar) === 'undefined'){ return; }
  1958. console.log('init_calendar');
  1959. var date = new Date(),
  1960. d = date.getDate(),
  1961. m = date.getMonth(),
  1962. y = date.getFullYear(),
  1963. started,
  1964. categoryClass;
  1965. var calendar = $('#calendar').fullCalendar({
  1966. header: {
  1967. left: 'prev,next today',
  1968. center: 'title',
  1969. right: 'month,agendaWeek,agendaDay,listMonth'
  1970. },
  1971. selectable: true,
  1972. selectHelper: true,
  1973. select: function(start, end, allDay) {
  1974. $('#fc_create').click();
  1975. started = start;
  1976. ended = end;
  1977. $(".antosubmit").on("click", function() {
  1978. var title = $("#title").val();
  1979. if (end) {
  1980. ended = end;
  1981. }
  1982. categoryClass = $("#event_type").val();
  1983. if (title) {
  1984. calendar.fullCalendar('renderEvent', {
  1985. title: title,
  1986. start: started,
  1987. end: end,
  1988. allDay: allDay
  1989. },
  1990. true // make the event "stick"
  1991. );
  1992. }
  1993. $('#title').val('');
  1994. calendar.fullCalendar('unselect');
  1995. $('.antoclose').click();
  1996. return false;
  1997. });
  1998. },
  1999. eventClick: function(calEvent, jsEvent, view) {
  2000. $('#fc_edit').click();
  2001. $('#title2').val(calEvent.title);
  2002. categoryClass = $("#event_type").val();
  2003. $(".antosubmit2").on("click", function() {
  2004. calEvent.title = $("#title2").val();
  2005. calendar.fullCalendar('updateEvent', calEvent);
  2006. $('.antoclose2').click();
  2007. });
  2008. calendar.fullCalendar('unselect');
  2009. },
  2010. editable: true,
  2011. events: [{
  2012. title: 'All Day Event',
  2013. start: new Date(y, m, 1)
  2014. }, {
  2015. title: 'Long Event',
  2016. start: new Date(y, m, d - 5),
  2017. end: new Date(y, m, d - 2)
  2018. }, {
  2019. title: 'Meeting',
  2020. start: new Date(y, m, d, 10, 30),
  2021. allDay: false
  2022. }, {
  2023. title: 'Lunch',
  2024. start: new Date(y, m, d + 14, 12, 0),
  2025. end: new Date(y, m, d, 14, 0),
  2026. allDay: false
  2027. }, {
  2028. title: 'Birthday Party',
  2029. start: new Date(y, m, d + 1, 19, 0),
  2030. end: new Date(y, m, d + 1, 22, 30),
  2031. allDay: false
  2032. }, {
  2033. title: 'Click for Google',
  2034. start: new Date(y, m, 28),
  2035. end: new Date(y, m, 29),
  2036. url: 'http://google.com/'
  2037. }]
  2038. });
  2039. };
  2040. /* DATA TABLES */
  2041. function init_DataTables() {
  2042. console.log('run_datatables');
  2043. if( typeof ($.fn.DataTable) === 'undefined'){ return; }
  2044. console.log('init_DataTables');
  2045. var handleDataTableButtons = function() {
  2046. if ($("#datatable-buttons").length) {
  2047. $("#datatable-buttons").DataTable({
  2048. dom: "Bfrtip",
  2049. buttons: [
  2050. {
  2051. extend: "copy",
  2052. className: "btn-sm"
  2053. },
  2054. {
  2055. extend: "csv",
  2056. className: "btn-sm"
  2057. },
  2058. {
  2059. extend: "excel",
  2060. className: "btn-sm"
  2061. },
  2062. {
  2063. extend: "pdfHtml5",
  2064. className: "btn-sm"
  2065. },
  2066. {
  2067. extend: "print",
  2068. className: "btn-sm"
  2069. },
  2070. ],
  2071. responsive: true
  2072. });
  2073. }
  2074. };
  2075. TableManageButtons = function() {
  2076. "use strict";
  2077. return {
  2078. init: function() {
  2079. handleDataTableButtons();
  2080. }
  2081. };
  2082. }();
  2083. $('#datatable').dataTable();
  2084. $('#datatable-keytable').DataTable({
  2085. keys: true
  2086. });
  2087. $('#datatable-responsive').DataTable();
  2088. $('#datatable-scroller').DataTable({
  2089. ajax: "js/datatables/json/scroller-demo.json",
  2090. deferRender: true,
  2091. scrollY: 380,
  2092. scrollCollapse: true,
  2093. scroller: true
  2094. });
  2095. $('#datatable-fixed-header').DataTable({
  2096. fixedHeader: true
  2097. });
  2098. var $datatable = $('#datatable-checkbox');
  2099. $datatable.dataTable({
  2100. 'order': [[ 1, 'asc' ]],
  2101. 'columnDefs': [
  2102. { orderable: false, targets: [0] }
  2103. ]
  2104. });
  2105. $datatable.on('draw.dt', function() {
  2106. $('checkbox input').iCheck({
  2107. checkboxClass: 'icheckbox_flat-green'
  2108. });
  2109. });
  2110. TableManageButtons.init();
  2111. };
  2112. /* CHART - MORRIS */
  2113. function init_morris_charts() {
  2114. if( typeof (Morris) === 'undefined'){ return; }
  2115. console.log('init_morris_charts');
  2116. if ($('#graph_bar').length){
  2117. Morris.Bar({
  2118. element: 'graph_bar',
  2119. data: [
  2120. {device: 'iPhone 4', geekbench: 380},
  2121. {device: 'iPhone 4S', geekbench: 655},
  2122. {device: 'iPhone 3GS', geekbench: 275},
  2123. {device: 'iPhone 5', geekbench: 1571},
  2124. {device: 'iPhone 5S', geekbench: 655},
  2125. {device: 'iPhone 6', geekbench: 2154},
  2126. {device: 'iPhone 6 Plus', geekbench: 1144},
  2127. {device: 'iPhone 6S', geekbench: 2371},
  2128. {device: 'iPhone 6S Plus', geekbench: 1471},
  2129. {device: 'Other', geekbench: 1371}
  2130. ],
  2131. xkey: 'device',
  2132. ykeys: ['geekbench'],
  2133. labels: ['Geekbench'],
  2134. barRatio: 0.4,
  2135. barColors: ['#26B99A', '#34495E', '#ACADAC', '#3498DB'],
  2136. xLabelAngle: 35,
  2137. hideHover: 'auto',
  2138. resize: true
  2139. });
  2140. }
  2141. if ($('#graph_bar_group').length ){
  2142. Morris.Bar({
  2143. element: 'graph_bar_group',
  2144. data: [
  2145. {"period": "2016-10-01", "licensed": 807, "sorned": 660},
  2146. {"period": "2016-09-30", "licensed": 1251, "sorned": 729},
  2147. {"period": "2016-09-29", "licensed": 1769, "sorned": 1018},
  2148. {"period": "2016-09-20", "licensed": 2246, "sorned": 1461},
  2149. {"period": "2016-09-19", "licensed": 2657, "sorned": 1967},
  2150. {"period": "2016-09-18", "licensed": 3148, "sorned": 2627},
  2151. {"period": "2016-09-17", "licensed": 3471, "sorned": 3740},
  2152. {"period": "2016-09-16", "licensed": 2871, "sorned": 2216},
  2153. {"period": "2016-09-15", "licensed": 2401, "sorned": 1656},
  2154. {"period": "2016-09-10", "licensed": 2115, "sorned": 1022}
  2155. ],
  2156. xkey: 'period',
  2157. barColors: ['#26B99A', '#34495E', '#ACADAC', '#3498DB'],
  2158. ykeys: ['licensed', 'sorned'],
  2159. labels: ['Licensed', 'SORN'],
  2160. hideHover: 'auto',
  2161. xLabelAngle: 60,
  2162. resize: true
  2163. });
  2164. }
  2165. if ($('#graphx').length ){
  2166. Morris.Bar({
  2167. element: 'graphx',
  2168. data: [
  2169. {x: '2015 Q1', y: 2, z: 3, a: 4},
  2170. {x: '2015 Q2', y: 3, z: 5, a: 6},
  2171. {x: '2015 Q3', y: 4, z: 3, a: 2},
  2172. {x: '2015 Q4', y: 2, z: 4, a: 5}
  2173. ],
  2174. xkey: 'x',
  2175. ykeys: ['y', 'z', 'a'],
  2176. barColors: ['#26B99A', '#34495E', '#ACADAC', '#3498DB'],
  2177. hideHover: 'auto',
  2178. labels: ['Y', 'Z', 'A'],
  2179. resize: true
  2180. }).on('click', function (i, row) {
  2181. console.log(i, row);
  2182. });
  2183. }
  2184. if ($('#graph_area').length ){
  2185. Morris.Area({
  2186. element: 'graph_area',
  2187. data: [
  2188. {period: '2014 Q1', iphone: 2666, ipad: null, itouch: 2647},
  2189. {period: '2014 Q2', iphone: 2778, ipad: 2294, itouch: 2441},
  2190. {period: '2014 Q3', iphone: 4912, ipad: 1969, itouch: 2501},
  2191. {period: '2014 Q4', iphone: 3767, ipad: 3597, itouch: 5689},
  2192. {period: '2015 Q1', iphone: 6810, ipad: 1914, itouch: 2293},
  2193. {period: '2015 Q2', iphone: 5670, ipad: 4293, itouch: 1881},
  2194. {period: '2015 Q3', iphone: 4820, ipad: 3795, itouch: 1588},
  2195. {period: '2015 Q4', iphone: 15073, ipad: 5967, itouch: 5175},
  2196. {period: '2016 Q1', iphone: 10687, ipad: 4460, itouch: 2028},
  2197. {period: '2016 Q2', iphone: 8432, ipad: 5713, itouch: 1791}
  2198. ],
  2199. xkey: 'period',
  2200. ykeys: ['iphone', 'ipad', 'itouch'],
  2201. lineColors: ['#26B99A', '#34495E', '#ACADAC', '#3498DB'],
  2202. labels: ['iPhone', 'iPad', 'iPod Touch'],
  2203. pointSize: 2,
  2204. hideHover: 'auto',
  2205. resize: true
  2206. });
  2207. }
  2208. if ($('#graph_donut').length ){
  2209. Morris.Donut({
  2210. element: 'graph_donut',
  2211. data: [
  2212. {label: 'Jam', value: 25},
  2213. {label: 'Frosted', value: 40},
  2214. {label: 'Custard', value: 25},
  2215. {label: 'Sugar', value: 10}
  2216. ],
  2217. colors: ['#26B99A', '#34495E', '#ACADAC', '#3498DB'],
  2218. formatter: function (y) {
  2219. return y + "%";
  2220. },
  2221. resize: true
  2222. });
  2223. }
  2224. if ($('#graph_line').length ){
  2225. Morris.Line({
  2226. element: 'graph_line',
  2227. xkey: 'year',
  2228. ykeys: ['value'],
  2229. labels: ['Value'],
  2230. hideHover: 'auto',
  2231. lineColors: ['#26B99A', '#34495E', '#ACADAC', '#3498DB'],
  2232. data: [
  2233. {year: '2012', value: 20},
  2234. {year: '2013', value: 10},
  2235. {year: '2014', value: 5},
  2236. {year: '2015', value: 5},
  2237. {year: '2016', value: 20}
  2238. ],
  2239. resize: true
  2240. });
  2241. $MENU_TOGGLE.on('click', function() {
  2242. $(window).resize();
  2243. });
  2244. }
  2245. };
  2246. /* ECHRTS */
  2247. function init_echarts() {
  2248. if( typeof (echarts) === 'undefined'){ return; }
  2249. console.log('init_echarts');
  2250. var theme = {
  2251. color: [
  2252. '#26B99A', '#34495E', '#BDC3C7', '#3498DB',
  2253. '#9B59B6', '#8abb6f', '#759c6a', '#bfd3b7'
  2254. ],
  2255. title: {
  2256. itemGap: 8,
  2257. textStyle: {
  2258. fontWeight: 'normal',
  2259. color: '#408829'
  2260. }
  2261. },
  2262. dataRange: {
  2263. color: ['#1f610a', '#97b58d']
  2264. },
  2265. toolbox: {
  2266. color: ['#408829', '#408829', '#408829', '#408829']
  2267. },
  2268. tooltip: {
  2269. backgroundColor: 'rgba(0,0,0,0.5)',
  2270. axisPointer: {
  2271. type: 'line',
  2272. lineStyle: {
  2273. color: '#408829',
  2274. type: 'dashed'
  2275. },
  2276. crossStyle: {
  2277. color: '#408829'
  2278. },
  2279. shadowStyle: {
  2280. color: 'rgba(200,200,200,0.3)'
  2281. }
  2282. }
  2283. },
  2284. dataZoom: {
  2285. dataBackgroundColor: '#eee',
  2286. fillerColor: 'rgba(64,136,41,0.2)',
  2287. handleColor: '#408829'
  2288. },
  2289. grid: {
  2290. borderWidth: 0
  2291. },
  2292. categoryAxis: {
  2293. axisLine: {
  2294. lineStyle: {
  2295. color: '#408829'
  2296. }
  2297. },
  2298. splitLine: {
  2299. lineStyle: {
  2300. color: ['#eee']
  2301. }
  2302. }
  2303. },
  2304. valueAxis: {
  2305. axisLine: {
  2306. lineStyle: {
  2307. color: '#408829'
  2308. }
  2309. },
  2310. splitArea: {
  2311. show: true,
  2312. areaStyle: {
  2313. color: ['rgba(250,250,250,0.1)', 'rgba(200,200,200,0.1)']
  2314. }
  2315. },
  2316. splitLine: {
  2317. lineStyle: {
  2318. color: ['#eee']
  2319. }
  2320. }
  2321. },
  2322. timeline: {
  2323. lineStyle: {
  2324. color: '#408829'
  2325. },
  2326. controlStyle: {
  2327. normal: {color: '#408829'},
  2328. emphasis: {color: '#408829'}
  2329. }
  2330. },
  2331. k: {
  2332. itemStyle: {
  2333. normal: {
  2334. color: '#68a54a',
  2335. color0: '#a9cba2',
  2336. lineStyle: {
  2337. width: 1,
  2338. color: '#408829',
  2339. color0: '#86b379'
  2340. }
  2341. }
  2342. }
  2343. },
  2344. map: {
  2345. itemStyle: {
  2346. normal: {
  2347. areaStyle: {
  2348. color: '#ddd'
  2349. },
  2350. label: {
  2351. textStyle: {
  2352. color: '#c12e34'
  2353. }
  2354. }
  2355. },
  2356. emphasis: {
  2357. areaStyle: {
  2358. color: '#99d2dd'
  2359. },
  2360. label: {
  2361. textStyle: {
  2362. color: '#c12e34'
  2363. }
  2364. }
  2365. }
  2366. }
  2367. },
  2368. force: {
  2369. itemStyle: {
  2370. normal: {
  2371. linkStyle: {
  2372. strokeColor: '#408829'
  2373. }
  2374. }
  2375. }
  2376. },
  2377. chord: {
  2378. padding: 4,
  2379. itemStyle: {
  2380. normal: {
  2381. lineStyle: {
  2382. width: 1,
  2383. color: 'rgba(128, 128, 128, 0.5)'
  2384. },
  2385. chordStyle: {
  2386. lineStyle: {
  2387. width: 1,
  2388. color: 'rgba(128, 128, 128, 0.5)'
  2389. }
  2390. }
  2391. },
  2392. emphasis: {
  2393. lineStyle: {
  2394. width: 1,
  2395. color: 'rgba(128, 128, 128, 0.5)'
  2396. },
  2397. chordStyle: {
  2398. lineStyle: {
  2399. width: 1,
  2400. color: 'rgba(128, 128, 128, 0.5)'
  2401. }
  2402. }
  2403. }
  2404. }
  2405. },
  2406. gauge: {
  2407. startAngle: 225,
  2408. endAngle: -45,
  2409. axisLine: {
  2410. show: true,
  2411. lineStyle: {
  2412. color: [[0.2, '#86b379'], [0.8, '#68a54a'], [1, '#408829']],
  2413. width: 8
  2414. }
  2415. },
  2416. axisTick: {
  2417. splitNumber: 10,
  2418. length: 12,
  2419. lineStyle: {
  2420. color: 'auto'
  2421. }
  2422. },
  2423. axisLabel: {
  2424. textStyle: {
  2425. color: 'auto'
  2426. }
  2427. },
  2428. splitLine: {
  2429. length: 18,
  2430. lineStyle: {
  2431. color: 'auto'
  2432. }
  2433. },
  2434. pointer: {
  2435. length: '90%',
  2436. color: 'auto'
  2437. },
  2438. title: {
  2439. textStyle: {
  2440. color: '#333'
  2441. }
  2442. },
  2443. detail: {
  2444. textStyle: {
  2445. color: 'auto'
  2446. }
  2447. }
  2448. },
  2449. textStyle: {
  2450. fontFamily: 'Arial, Verdana, sans-serif'
  2451. }
  2452. };
  2453. //echart Bar
  2454. if ($('#mainb').length ){
  2455. var echartBar = echarts.init(document.getElementById('mainb'), theme);
  2456. echartBar.setOption({
  2457. title: {
  2458. text: 'Graph title',
  2459. subtext: 'Graph Sub-text'
  2460. },
  2461. tooltip: {
  2462. trigger: 'axis'
  2463. },
  2464. legend: {
  2465. data: ['sales', 'purchases']
  2466. },
  2467. toolbox: {
  2468. show: false
  2469. },
  2470. calculable: false,
  2471. xAxis: [{
  2472. type: 'category',
  2473. data: ['1?', '2?', '3?', '4?', '5?', '6?', '7?', '8?', '9?', '10?', '11?', '12?']
  2474. }],
  2475. yAxis: [{
  2476. type: 'value'
  2477. }],
  2478. series: [{
  2479. name: 'sales',
  2480. type: 'bar',
  2481. data: [2.0, 4.9, 7.0, 23.2, 25.6, 76.7, 135.6, 162.2, 32.6, 20.0, 6.4, 3.3],
  2482. markPoint: {
  2483. data: [{
  2484. type: 'max',
  2485. name: '???'
  2486. }, {
  2487. type: 'min',
  2488. name: '???'
  2489. }]
  2490. },
  2491. markLine: {
  2492. data: [{
  2493. type: 'average',
  2494. name: '???'
  2495. }]
  2496. }
  2497. }, {
  2498. name: 'purchases',
  2499. type: 'bar',
  2500. data: [2.6, 5.9, 9.0, 26.4, 28.7, 70.7, 175.6, 182.2, 48.7, 18.8, 6.0, 2.3],
  2501. markPoint: {
  2502. data: [{
  2503. name: 'sales',
  2504. value: 182.2,
  2505. xAxis: 7,
  2506. yAxis: 183,
  2507. }, {
  2508. name: 'purchases',
  2509. value: 2.3,
  2510. xAxis: 11,
  2511. yAxis: 3
  2512. }]
  2513. },
  2514. markLine: {
  2515. data: [{
  2516. type: 'average',
  2517. name: '???'
  2518. }]
  2519. }
  2520. }]
  2521. });
  2522. }
  2523. //echart Radar
  2524. if ($('#echart_sonar').length ){
  2525. var echartRadar = echarts.init(document.getElementById('echart_sonar'), theme);
  2526. echartRadar.setOption({
  2527. title: {
  2528. text: 'Budget vs spending',
  2529. subtext: 'Subtitle'
  2530. },
  2531. tooltip: {
  2532. trigger: 'item'
  2533. },
  2534. legend: {
  2535. orient: 'vertical',
  2536. x: 'right',
  2537. y: 'bottom',
  2538. data: ['Allocated Budget', 'Actual Spending']
  2539. },
  2540. toolbox: {
  2541. show: true,
  2542. feature: {
  2543. restore: {
  2544. show: true,
  2545. title: "Restore"
  2546. },
  2547. saveAsImage: {
  2548. show: true,
  2549. title: "Save Image"
  2550. }
  2551. }
  2552. },
  2553. polar: [{
  2554. indicator: [{
  2555. text: 'Sales',
  2556. max: 6000
  2557. }, {
  2558. text: 'Administration',
  2559. max: 16000
  2560. }, {
  2561. text: 'Information Techology',
  2562. max: 30000
  2563. }, {
  2564. text: 'Customer Support',
  2565. max: 38000
  2566. }, {
  2567. text: 'Development',
  2568. max: 52000
  2569. }, {
  2570. text: 'Marketing',
  2571. max: 25000
  2572. }]
  2573. }],
  2574. calculable: true,
  2575. series: [{
  2576. name: 'Budget vs spending',
  2577. type: 'radar',
  2578. data: [{
  2579. value: [4300, 10000, 28000, 35000, 50000, 19000],
  2580. name: 'Allocated Budget'
  2581. }, {
  2582. value: [5000, 14000, 28000, 31000, 42000, 21000],
  2583. name: 'Actual Spending'
  2584. }]
  2585. }]
  2586. });
  2587. }
  2588. //echart Funnel
  2589. if ($('#echart_pyramid').length ){
  2590. var echartFunnel = echarts.init(document.getElementById('echart_pyramid'), theme);
  2591. echartFunnel.setOption({
  2592. title: {
  2593. text: 'Echart Pyramid Graph',
  2594. subtext: 'Subtitle'
  2595. },
  2596. tooltip: {
  2597. trigger: 'item',
  2598. formatter: "{a} <br/>{b} : {c}%"
  2599. },
  2600. toolbox: {
  2601. show: true,
  2602. feature: {
  2603. restore: {
  2604. show: true,
  2605. title: "Restore"
  2606. },
  2607. saveAsImage: {
  2608. show: true,
  2609. title: "Save Image"
  2610. }
  2611. }
  2612. },
  2613. legend: {
  2614. data: ['Something #1', 'Something #2', 'Something #3', 'Something #4', 'Something #5'],
  2615. orient: 'vertical',
  2616. x: 'left',
  2617. y: 'bottom'
  2618. },
  2619. calculable: true,
  2620. series: [{
  2621. name: '漏斗图',
  2622. type: 'funnel',
  2623. width: '40%',
  2624. data: [{
  2625. value: 60,
  2626. name: 'Something #1'
  2627. }, {
  2628. value: 40,
  2629. name: 'Something #2'
  2630. }, {
  2631. value: 20,
  2632. name: 'Something #3'
  2633. }, {
  2634. value: 80,
  2635. name: 'Something #4'
  2636. }, {
  2637. value: 100,
  2638. name: 'Something #5'
  2639. }]
  2640. }]
  2641. });
  2642. }
  2643. //echart Gauge
  2644. if ($('#echart_gauge').length ){
  2645. var echartGauge = echarts.init(document.getElementById('echart_gauge'), theme);
  2646. echartGauge.setOption({
  2647. tooltip: {
  2648. formatter: "{a} <br/>{b} : {c}%"
  2649. },
  2650. toolbox: {
  2651. show: true,
  2652. feature: {
  2653. restore: {
  2654. show: true,
  2655. title: "Restore"
  2656. },
  2657. saveAsImage: {
  2658. show: true,
  2659. title: "Save Image"
  2660. }
  2661. }
  2662. },
  2663. series: [{
  2664. name: 'Performance',
  2665. type: 'gauge',
  2666. center: ['50%', '50%'],
  2667. startAngle: 140,
  2668. endAngle: -140,
  2669. min: 0,
  2670. max: 100,
  2671. precision: 0,
  2672. splitNumber: 10,
  2673. axisLine: {
  2674. show: true,
  2675. lineStyle: {
  2676. color: [
  2677. [0.2, 'lightgreen'],
  2678. [0.4, 'orange'],
  2679. [0.8, 'skyblue'],
  2680. [1, '#ff4500']
  2681. ],
  2682. width: 30
  2683. }
  2684. },
  2685. axisTick: {
  2686. show: true,
  2687. splitNumber: 5,
  2688. length: 8,
  2689. lineStyle: {
  2690. color: '#eee',
  2691. width: 1,
  2692. type: 'solid'
  2693. }
  2694. },
  2695. axisLabel: {
  2696. show: true,
  2697. formatter: function(v) {
  2698. switch (v + '') {
  2699. case '10':
  2700. return 'a';
  2701. case '30':
  2702. return 'b';
  2703. case '60':
  2704. return 'c';
  2705. case '90':
  2706. return 'd';
  2707. default:
  2708. return '';
  2709. }
  2710. },
  2711. textStyle: {
  2712. color: '#333'
  2713. }
  2714. },
  2715. splitLine: {
  2716. show: true,
  2717. length: 30,
  2718. lineStyle: {
  2719. color: '#eee',
  2720. width: 2,
  2721. type: 'solid'
  2722. }
  2723. },
  2724. pointer: {
  2725. length: '80%',
  2726. width: 8,
  2727. color: 'auto'
  2728. },
  2729. title: {
  2730. show: true,
  2731. offsetCenter: ['-65%', -10],
  2732. textStyle: {
  2733. color: '#333',
  2734. fontSize: 15
  2735. }
  2736. },
  2737. detail: {
  2738. show: true,
  2739. backgroundColor: 'rgba(0,0,0,0)',
  2740. borderWidth: 0,
  2741. borderColor: '#ccc',
  2742. width: 100,
  2743. height: 40,
  2744. offsetCenter: ['-60%', 10],
  2745. formatter: '{value}%',
  2746. textStyle: {
  2747. color: 'auto',
  2748. fontSize: 30
  2749. }
  2750. },
  2751. data: [{
  2752. value: 50,
  2753. name: 'Performance'
  2754. }]
  2755. }]
  2756. });
  2757. }
  2758. //echart Line
  2759. if ($('#echart_line').length ){
  2760. var echartLine = echarts.init(document.getElementById('echart_line'), theme);
  2761. echartLine.setOption({
  2762. title: {
  2763. text: 'Line Graph',
  2764. subtext: 'Subtitle'
  2765. },
  2766. tooltip: {
  2767. trigger: 'axis'
  2768. },
  2769. legend: {
  2770. x: 220,
  2771. y: 40,
  2772. data: ['Intent', 'Pre-order', 'Deal']
  2773. },
  2774. toolbox: {
  2775. show: true,
  2776. feature: {
  2777. magicType: {
  2778. show: true,
  2779. title: {
  2780. line: 'Line',
  2781. bar: 'Bar',
  2782. stack: 'Stack',
  2783. tiled: 'Tiled'
  2784. },
  2785. type: ['line', 'bar', 'stack', 'tiled']
  2786. },
  2787. restore: {
  2788. show: true,
  2789. title: "Restore"
  2790. },
  2791. saveAsImage: {
  2792. show: true,
  2793. title: "Save Image"
  2794. }
  2795. }
  2796. },
  2797. calculable: true,
  2798. xAxis: [{
  2799. type: 'category',
  2800. boundaryGap: false,
  2801. data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
  2802. }],
  2803. yAxis: [{
  2804. type: 'value'
  2805. }],
  2806. series: [{
  2807. name: 'Deal',
  2808. type: 'line',
  2809. smooth: true,
  2810. itemStyle: {
  2811. normal: {
  2812. areaStyle: {
  2813. type: 'default'
  2814. }
  2815. }
  2816. },
  2817. data: [10, 12, 21, 54, 260, 830, 710]
  2818. }, {
  2819. name: 'Pre-order',
  2820. type: 'line',
  2821. smooth: true,
  2822. itemStyle: {
  2823. normal: {
  2824. areaStyle: {
  2825. type: 'default'
  2826. }
  2827. }
  2828. },
  2829. data: [30, 182, 434, 791, 390, 30, 10]
  2830. }, {
  2831. name: 'Intent',
  2832. type: 'line',
  2833. smooth: true,
  2834. itemStyle: {
  2835. normal: {
  2836. areaStyle: {
  2837. type: 'default'
  2838. }
  2839. }
  2840. },
  2841. data: [1320, 1132, 601, 234, 120, 90, 20]
  2842. }]
  2843. });
  2844. }
  2845. //echart Scatter
  2846. if ($('#echart_scatter').length ){
  2847. var echartScatter = echarts.init(document.getElementById('echart_scatter'), theme);
  2848. echartScatter.setOption({
  2849. title: {
  2850. text: 'Scatter Graph',
  2851. subtext: 'Heinz 2003'
  2852. },
  2853. tooltip: {
  2854. trigger: 'axis',
  2855. showDelay: 0,
  2856. axisPointer: {
  2857. type: 'cross',
  2858. lineStyle: {
  2859. type: 'dashed',
  2860. width: 1
  2861. }
  2862. }
  2863. },
  2864. legend: {
  2865. data: ['Data2', 'Data1']
  2866. },
  2867. toolbox: {
  2868. show: true,
  2869. feature: {
  2870. saveAsImage: {
  2871. show: true,
  2872. title: "Save Image"
  2873. }
  2874. }
  2875. },
  2876. xAxis: [{
  2877. type: 'value',
  2878. scale: true,
  2879. axisLabel: {
  2880. formatter: '{value} cm'
  2881. }
  2882. }],
  2883. yAxis: [{
  2884. type: 'value',
  2885. scale: true,
  2886. axisLabel: {
  2887. formatter: '{value} kg'
  2888. }
  2889. }],
  2890. series: [{
  2891. name: 'Data1',
  2892. type: 'scatter',
  2893. tooltip: {
  2894. trigger: 'item',
  2895. formatter: function(params) {
  2896. if (params.value.length > 1) {
  2897. return params.seriesName + ' :<br/>' + params.value[0] + 'cm ' + params.value[1] + 'kg ';
  2898. } else {
  2899. return params.seriesName + ' :<br/>' + params.name + ' : ' + params.value + 'kg ';
  2900. }
  2901. }
  2902. },
  2903. data: [
  2904. [161.2, 51.6],
  2905. [167.5, 59.0],
  2906. [159.5, 49.2],
  2907. [157.0, 63.0],
  2908. [155.8, 53.6],
  2909. [170.0, 59.0],
  2910. [159.1, 47.6],
  2911. [166.0, 69.8],
  2912. [176.2, 66.8],
  2913. [160.2, 75.2],
  2914. [172.5, 55.2],
  2915. [170.9, 54.2],
  2916. [172.9, 62.5],
  2917. [153.4, 42.0],
  2918. [160.0, 50.0],
  2919. [147.2, 49.8],
  2920. [168.2, 49.2],
  2921. [175.0, 73.2],
  2922. [157.0, 47.8],
  2923. [167.6, 68.8],
  2924. [159.5, 50.6],
  2925. [175.0, 82.5],
  2926. [166.8, 57.2],
  2927. [176.5, 87.8],
  2928. [170.2, 72.8],
  2929. [174.0, 54.5],
  2930. [173.0, 59.8],
  2931. [179.9, 67.3],
  2932. [170.5, 67.8],
  2933. [160.0, 47.0],
  2934. [154.4, 46.2],
  2935. [162.0, 55.0],
  2936. [176.5, 83.0],
  2937. [160.0, 54.4],
  2938. [152.0, 45.8],
  2939. [162.1, 53.6],
  2940. [170.0, 73.2],
  2941. [160.2, 52.1],
  2942. [161.3, 67.9],
  2943. [166.4, 56.6],
  2944. [168.9, 62.3],
  2945. [163.8, 58.5],
  2946. [167.6, 54.5],
  2947. [160.0, 50.2],
  2948. [161.3, 60.3],
  2949. [167.6, 58.3],
  2950. [165.1, 56.2],
  2951. [160.0, 50.2],
  2952. [170.0, 72.9],
  2953. [157.5, 59.8],
  2954. [167.6, 61.0],
  2955. [160.7, 69.1],
  2956. [163.2, 55.9],
  2957. [152.4, 46.5],
  2958. [157.5, 54.3],
  2959. [168.3, 54.8],
  2960. [180.3, 60.7],
  2961. [165.5, 60.0],
  2962. [165.0, 62.0],
  2963. [164.5, 60.3],
  2964. [156.0, 52.7],
  2965. [160.0, 74.3],
  2966. [163.0, 62.0],
  2967. [165.7, 73.1],
  2968. [161.0, 80.0],
  2969. [162.0, 54.7],
  2970. [166.0, 53.2],
  2971. [174.0, 75.7],
  2972. [172.7, 61.1],
  2973. [167.6, 55.7],
  2974. [151.1, 48.7],
  2975. [164.5, 52.3],
  2976. [163.5, 50.0],
  2977. [152.0, 59.3],
  2978. [169.0, 62.5],
  2979. [164.0, 55.7],
  2980. [161.2, 54.8],
  2981. [155.0, 45.9],
  2982. [170.0, 70.6],
  2983. [176.2, 67.2],
  2984. [170.0, 69.4],
  2985. [162.5, 58.2],
  2986. [170.3, 64.8],
  2987. [164.1, 71.6],
  2988. [169.5, 52.8],
  2989. [163.2, 59.8],
  2990. [154.5, 49.0],
  2991. [159.8, 50.0],
  2992. [173.2, 69.2],
  2993. [170.0, 55.9],
  2994. [161.4, 63.4],
  2995. [169.0, 58.2],
  2996. [166.2, 58.6],
  2997. [159.4, 45.7],
  2998. [162.5, 52.2],
  2999. [159.0, 48.6],
  3000. [162.8, 57.8],
  3001. [159.0, 55.6],
  3002. [179.8, 66.8],
  3003. [162.9, 59.4],
  3004. [161.0, 53.6],
  3005. [151.1, 73.2],
  3006. [168.2, 53.4],
  3007. [168.9, 69.0],
  3008. [173.2, 58.4],
  3009. [171.8, 56.2],
  3010. [178.0, 70.6],
  3011. [164.3, 59.8],
  3012. [163.0, 72.0],
  3013. [168.5, 65.2],
  3014. [166.8, 56.6],
  3015. [172.7, 105.2],
  3016. [163.5, 51.8],
  3017. [169.4, 63.4],
  3018. [167.8, 59.0],
  3019. [159.5, 47.6],
  3020. [167.6, 63.0],
  3021. [161.2, 55.2],
  3022. [160.0, 45.0],
  3023. [163.2, 54.0],
  3024. [162.2, 50.2],
  3025. [161.3, 60.2],
  3026. [149.5, 44.8],
  3027. [157.5, 58.8],
  3028. [163.2, 56.4],
  3029. [172.7, 62.0],
  3030. [155.0, 49.2],
  3031. [156.5, 67.2],
  3032. [164.0, 53.8],
  3033. [160.9, 54.4],
  3034. [162.8, 58.0],
  3035. [167.0, 59.8],
  3036. [160.0, 54.8],
  3037. [160.0, 43.2],
  3038. [168.9, 60.5],
  3039. [158.2, 46.4],
  3040. [156.0, 64.4],
  3041. [160.0, 48.8],
  3042. [167.1, 62.2],
  3043. [158.0, 55.5],
  3044. [167.6, 57.8],
  3045. [156.0, 54.6],
  3046. [162.1, 59.2],
  3047. [173.4, 52.7],
  3048. [159.8, 53.2],
  3049. [170.5, 64.5],
  3050. [159.2, 51.8],
  3051. [157.5, 56.0],
  3052. [161.3, 63.6],
  3053. [162.6, 63.2],
  3054. [160.0, 59.5],
  3055. [168.9, 56.8],
  3056. [165.1, 64.1],
  3057. [162.6, 50.0],
  3058. [165.1, 72.3],
  3059. [166.4, 55.0],
  3060. [160.0, 55.9],
  3061. [152.4, 60.4],
  3062. [170.2, 69.1],
  3063. [162.6, 84.5],
  3064. [170.2, 55.9],
  3065. [158.8, 55.5],
  3066. [172.7, 69.5],
  3067. [167.6, 76.4],
  3068. [162.6, 61.4],
  3069. [167.6, 65.9],
  3070. [156.2, 58.6],
  3071. [175.2, 66.8],
  3072. [172.1, 56.6],
  3073. [162.6, 58.6],
  3074. [160.0, 55.9],
  3075. [165.1, 59.1],
  3076. [182.9, 81.8],
  3077. [166.4, 70.7],
  3078. [165.1, 56.8],
  3079. [177.8, 60.0],
  3080. [165.1, 58.2],
  3081. [175.3, 72.7],
  3082. [154.9, 54.1],
  3083. [158.8, 49.1],
  3084. [172.7, 75.9],
  3085. [168.9, 55.0],
  3086. [161.3, 57.3],
  3087. [167.6, 55.0],
  3088. [165.1, 65.5],
  3089. [175.3, 65.5],
  3090. [157.5, 48.6],
  3091. [163.8, 58.6],
  3092. [167.6, 63.6],
  3093. [165.1, 55.2],
  3094. [165.1, 62.7],
  3095. [168.9, 56.6],
  3096. [162.6, 53.9],
  3097. [164.5, 63.2],
  3098. [176.5, 73.6],
  3099. [168.9, 62.0],
  3100. [175.3, 63.6],
  3101. [159.4, 53.2],
  3102. [160.0, 53.4],
  3103. [170.2, 55.0],
  3104. [162.6, 70.5],
  3105. [167.6, 54.5],
  3106. [162.6, 54.5],
  3107. [160.7, 55.9],
  3108. [160.0, 59.0],
  3109. [157.5, 63.6],
  3110. [162.6, 54.5],
  3111. [152.4, 47.3],
  3112. [170.2, 67.7],
  3113. [165.1, 80.9],
  3114. [172.7, 70.5],
  3115. [165.1, 60.9],
  3116. [170.2, 63.6],
  3117. [170.2, 54.5],
  3118. [170.2, 59.1],
  3119. [161.3, 70.5],
  3120. [167.6, 52.7],
  3121. [167.6, 62.7],
  3122. [165.1, 86.3],
  3123. [162.6, 66.4],
  3124. [152.4, 67.3],
  3125. [168.9, 63.0],
  3126. [170.2, 73.6],
  3127. [175.2, 62.3],
  3128. [175.2, 57.7],
  3129. [160.0, 55.4],
  3130. [165.1, 104.1],
  3131. [174.0, 55.5],
  3132. [170.2, 77.3],
  3133. [160.0, 80.5],
  3134. [167.6, 64.5],
  3135. [167.6, 72.3],
  3136. [167.6, 61.4],
  3137. [154.9, 58.2],
  3138. [162.6, 81.8],
  3139. [175.3, 63.6],
  3140. [171.4, 53.4],
  3141. [157.5, 54.5],
  3142. [165.1, 53.6],
  3143. [160.0, 60.0],
  3144. [174.0, 73.6],
  3145. [162.6, 61.4],
  3146. [174.0, 55.5],
  3147. [162.6, 63.6],
  3148. [161.3, 60.9],
  3149. [156.2, 60.0],
  3150. [149.9, 46.8],
  3151. [169.5, 57.3],
  3152. [160.0, 64.1],
  3153. [175.3, 63.6],
  3154. [169.5, 67.3],
  3155. [160.0, 75.5],
  3156. [172.7, 68.2],
  3157. [162.6, 61.4],
  3158. [157.5, 76.8],
  3159. [176.5, 71.8],
  3160. [164.4, 55.5],
  3161. [160.7, 48.6],
  3162. [174.0, 66.4],
  3163. [163.8, 67.3]
  3164. ],
  3165. markPoint: {
  3166. data: [{
  3167. type: 'max',
  3168. name: 'Max'
  3169. }, {
  3170. type: 'min',
  3171. name: 'Min'
  3172. }]
  3173. },
  3174. markLine: {
  3175. data: [{
  3176. type: 'average',
  3177. name: 'Mean'
  3178. }]
  3179. }
  3180. }, {
  3181. name: 'Data2',
  3182. type: 'scatter',
  3183. tooltip: {
  3184. trigger: 'item',
  3185. formatter: function(params) {
  3186. if (params.value.length > 1) {
  3187. return params.seriesName + ' :<br/>' + params.value[0] + 'cm ' + params.value[1] + 'kg ';
  3188. } else {
  3189. return params.seriesName + ' :<br/>' + params.name + ' : ' + params.value + 'kg ';
  3190. }
  3191. }
  3192. },
  3193. data: [
  3194. [174.0, 65.6],
  3195. [175.3, 71.8],
  3196. [193.5, 80.7],
  3197. [186.5, 72.6],
  3198. [187.2, 78.8],
  3199. [181.5, 74.8],
  3200. [184.0, 86.4],
  3201. [184.5, 78.4],
  3202. [175.0, 62.0],
  3203. [184.0, 81.6],
  3204. [180.0, 76.6],
  3205. [177.8, 83.6],
  3206. [192.0, 90.0],
  3207. [176.0, 74.6],
  3208. [174.0, 71.0],
  3209. [184.0, 79.6],
  3210. [192.7, 93.8],
  3211. [171.5, 70.0],
  3212. [173.0, 72.4],
  3213. [176.0, 85.9],
  3214. [176.0, 78.8],
  3215. [180.5, 77.8],
  3216. [172.7, 66.2],
  3217. [176.0, 86.4],
  3218. [173.5, 81.8],
  3219. [178.0, 89.6],
  3220. [180.3, 82.8],
  3221. [180.3, 76.4],
  3222. [164.5, 63.2],
  3223. [173.0, 60.9],
  3224. [183.5, 74.8],
  3225. [175.5, 70.0],
  3226. [188.0, 72.4],
  3227. [189.2, 84.1],
  3228. [172.8, 69.1],
  3229. [170.0, 59.5],
  3230. [182.0, 67.2],
  3231. [170.0, 61.3],
  3232. [177.8, 68.6],
  3233. [184.2, 80.1],
  3234. [186.7, 87.8],
  3235. [171.4, 84.7],
  3236. [172.7, 73.4],
  3237. [175.3, 72.1],
  3238. [180.3, 82.6],
  3239. [182.9, 88.7],
  3240. [188.0, 84.1],
  3241. [177.2, 94.1],
  3242. [172.1, 74.9],
  3243. [167.0, 59.1],
  3244. [169.5, 75.6],
  3245. [174.0, 86.2],
  3246. [172.7, 75.3],
  3247. [182.2, 87.1],
  3248. [164.1, 55.2],
  3249. [163.0, 57.0],
  3250. [171.5, 61.4],
  3251. [184.2, 76.8],
  3252. [174.0, 86.8],
  3253. [174.0, 72.2],
  3254. [177.0, 71.6],
  3255. [186.0, 84.8],
  3256. [167.0, 68.2],
  3257. [171.8, 66.1],
  3258. [182.0, 72.0],
  3259. [167.0, 64.6],
  3260. [177.8, 74.8],
  3261. [164.5, 70.0],
  3262. [192.0, 101.6],
  3263. [175.5, 63.2],
  3264. [171.2, 79.1],
  3265. [181.6, 78.9],
  3266. [167.4, 67.7],
  3267. [181.1, 66.0],
  3268. [177.0, 68.2],
  3269. [174.5, 63.9],
  3270. [177.5, 72.0],
  3271. [170.5, 56.8],
  3272. [182.4, 74.5],
  3273. [197.1, 90.9],
  3274. [180.1, 93.0],
  3275. [175.5, 80.9],
  3276. [180.6, 72.7],
  3277. [184.4, 68.0],
  3278. [175.5, 70.9],
  3279. [180.6, 72.5],
  3280. [177.0, 72.5],
  3281. [177.1, 83.4],
  3282. [181.6, 75.5],
  3283. [176.5, 73.0],
  3284. [175.0, 70.2],
  3285. [174.0, 73.4],
  3286. [165.1, 70.5],
  3287. [177.0, 68.9],
  3288. [192.0, 102.3],
  3289. [176.5, 68.4],
  3290. [169.4, 65.9],
  3291. [182.1, 75.7],
  3292. [179.8, 84.5],
  3293. [175.3, 87.7],
  3294. [184.9, 86.4],
  3295. [177.3, 73.2],
  3296. [167.4, 53.9],
  3297. [178.1, 72.0],
  3298. [168.9, 55.5],
  3299. [157.2, 58.4],
  3300. [180.3, 83.2],
  3301. [170.2, 72.7],
  3302. [177.8, 64.1],
  3303. [172.7, 72.3],
  3304. [165.1, 65.0],
  3305. [186.7, 86.4],
  3306. [165.1, 65.0],
  3307. [174.0, 88.6],
  3308. [175.3, 84.1],
  3309. [185.4, 66.8],
  3310. [177.8, 75.5],
  3311. [180.3, 93.2],
  3312. [180.3, 82.7],
  3313. [177.8, 58.0],
  3314. [177.8, 79.5],
  3315. [177.8, 78.6],
  3316. [177.8, 71.8],
  3317. [177.8, 116.4],
  3318. [163.8, 72.2],
  3319. [188.0, 83.6],
  3320. [198.1, 85.5],
  3321. [175.3, 90.9],
  3322. [166.4, 85.9],
  3323. [190.5, 89.1],
  3324. [166.4, 75.0],
  3325. [177.8, 77.7],
  3326. [179.7, 86.4],
  3327. [172.7, 90.9],
  3328. [190.5, 73.6],
  3329. [185.4, 76.4],
  3330. [168.9, 69.1],
  3331. [167.6, 84.5],
  3332. [175.3, 64.5],
  3333. [170.2, 69.1],
  3334. [190.5, 108.6],
  3335. [177.8, 86.4],
  3336. [190.5, 80.9],
  3337. [177.8, 87.7],
  3338. [184.2, 94.5],
  3339. [176.5, 80.2],
  3340. [177.8, 72.0],
  3341. [180.3, 71.4],
  3342. [171.4, 72.7],
  3343. [172.7, 84.1],
  3344. [172.7, 76.8],
  3345. [177.8, 63.6],
  3346. [177.8, 80.9],
  3347. [182.9, 80.9],
  3348. [170.2, 85.5],
  3349. [167.6, 68.6],
  3350. [175.3, 67.7],
  3351. [165.1, 66.4],
  3352. [185.4, 102.3],
  3353. [181.6, 70.5],
  3354. [172.7, 95.9],
  3355. [190.5, 84.1],
  3356. [179.1, 87.3],
  3357. [175.3, 71.8],
  3358. [170.2, 65.9],
  3359. [193.0, 95.9],
  3360. [171.4, 91.4],
  3361. [177.8, 81.8],
  3362. [177.8, 96.8],
  3363. [167.6, 69.1],
  3364. [167.6, 82.7],
  3365. [180.3, 75.5],
  3366. [182.9, 79.5],
  3367. [176.5, 73.6],
  3368. [186.7, 91.8],
  3369. [188.0, 84.1],
  3370. [188.0, 85.9],
  3371. [177.8, 81.8],
  3372. [174.0, 82.5],
  3373. [177.8, 80.5],
  3374. [171.4, 70.0],
  3375. [185.4, 81.8],
  3376. [185.4, 84.1],
  3377. [188.0, 90.5],
  3378. [188.0, 91.4],
  3379. [182.9, 89.1],
  3380. [176.5, 85.0],
  3381. [175.3, 69.1],
  3382. [175.3, 73.6],
  3383. [188.0, 80.5],
  3384. [188.0, 82.7],
  3385. [175.3, 86.4],
  3386. [170.5, 67.7],
  3387. [179.1, 92.7],
  3388. [177.8, 93.6],
  3389. [175.3, 70.9],
  3390. [182.9, 75.0],
  3391. [170.8, 93.2],
  3392. [188.0, 93.2],
  3393. [180.3, 77.7],
  3394. [177.8, 61.4],
  3395. [185.4, 94.1],
  3396. [168.9, 75.0],
  3397. [185.4, 83.6],
  3398. [180.3, 85.5],
  3399. [174.0, 73.9],
  3400. [167.6, 66.8],
  3401. [182.9, 87.3],
  3402. [160.0, 72.3],
  3403. [180.3, 88.6],
  3404. [167.6, 75.5],
  3405. [186.7, 101.4],
  3406. [175.3, 91.1],
  3407. [175.3, 67.3],
  3408. [175.9, 77.7],
  3409. [175.3, 81.8],
  3410. [179.1, 75.5],
  3411. [181.6, 84.5],
  3412. [177.8, 76.6],
  3413. [182.9, 85.0],
  3414. [177.8, 102.5],
  3415. [184.2, 77.3],
  3416. [179.1, 71.8],
  3417. [176.5, 87.9],
  3418. [188.0, 94.3],
  3419. [174.0, 70.9],
  3420. [167.6, 64.5],
  3421. [170.2, 77.3],
  3422. [167.6, 72.3],
  3423. [188.0, 87.3],
  3424. [174.0, 80.0],
  3425. [176.5, 82.3],
  3426. [180.3, 73.6],
  3427. [167.6, 74.1],
  3428. [188.0, 85.9],
  3429. [180.3, 73.2],
  3430. [167.6, 76.3],
  3431. [183.0, 65.9],
  3432. [183.0, 90.9],
  3433. [179.1, 89.1],
  3434. [170.2, 62.3],
  3435. [177.8, 82.7],
  3436. [179.1, 79.1],
  3437. [190.5, 98.2],
  3438. [177.8, 84.1],
  3439. [180.3, 83.2],
  3440. [180.3, 83.2]
  3441. ],
  3442. markPoint: {
  3443. data: [{
  3444. type: 'max',
  3445. name: 'Max'
  3446. }, {
  3447. type: 'min',
  3448. name: 'Min'
  3449. }]
  3450. },
  3451. markLine: {
  3452. data: [{
  3453. type: 'average',
  3454. name: 'Mean'
  3455. }]
  3456. }
  3457. }]
  3458. });
  3459. }
  3460. //echart Bar Horizontal
  3461. if ($('#echart_bar_horizontal').length ){
  3462. var echartBar = echarts.init(document.getElementById('echart_bar_horizontal'), theme);
  3463. echartBar.setOption({
  3464. title: {
  3465. text: 'Bar Graph',
  3466. subtext: 'Graph subtitle'
  3467. },
  3468. tooltip: {
  3469. trigger: 'axis'
  3470. },
  3471. legend: {
  3472. x: 100,
  3473. data: ['2015', '2016']
  3474. },
  3475. toolbox: {
  3476. show: true,
  3477. feature: {
  3478. saveAsImage: {
  3479. show: true,
  3480. title: "Save Image"
  3481. }
  3482. }
  3483. },
  3484. calculable: true,
  3485. xAxis: [{
  3486. type: 'value',
  3487. boundaryGap: [0, 0.01]
  3488. }],
  3489. yAxis: [{
  3490. type: 'category',
  3491. data: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun']
  3492. }],
  3493. series: [{
  3494. name: '2015',
  3495. type: 'bar',
  3496. data: [18203, 23489, 29034, 104970, 131744, 630230]
  3497. }, {
  3498. name: '2016',
  3499. type: 'bar',
  3500. data: [19325, 23438, 31000, 121594, 134141, 681807]
  3501. }]
  3502. });
  3503. }
  3504. //echart Pie Collapse
  3505. if ($('#echart_pie2').length ){
  3506. var echartPieCollapse = echarts.init(document.getElementById('echart_pie2'), theme);
  3507. echartPieCollapse.setOption({
  3508. tooltip: {
  3509. trigger: 'item',
  3510. formatter: "{a} <br/>{b} : {c} ({d}%)"
  3511. },
  3512. legend: {
  3513. x: 'center',
  3514. y: 'bottom',
  3515. data: ['rose1', 'rose2', 'rose3', 'rose4', 'rose5', 'rose6']
  3516. },
  3517. toolbox: {
  3518. show: true,
  3519. feature: {
  3520. magicType: {
  3521. show: true,
  3522. type: ['pie', 'funnel']
  3523. },
  3524. restore: {
  3525. show: true,
  3526. title: "Restore"
  3527. },
  3528. saveAsImage: {
  3529. show: true,
  3530. title: "Save Image"
  3531. }
  3532. }
  3533. },
  3534. calculable: true,
  3535. series: [{
  3536. name: 'Area Mode',
  3537. type: 'pie',
  3538. radius: [25, 90],
  3539. center: ['50%', 170],
  3540. roseType: 'area',
  3541. x: '50%',
  3542. max: 40,
  3543. sort: 'ascending',
  3544. data: [{
  3545. value: 10,
  3546. name: 'rose1'
  3547. }, {
  3548. value: 5,
  3549. name: 'rose2'
  3550. }, {
  3551. value: 15,
  3552. name: 'rose3'
  3553. }, {
  3554. value: 25,
  3555. name: 'rose4'
  3556. }, {
  3557. value: 20,
  3558. name: 'rose5'
  3559. }, {
  3560. value: 35,
  3561. name: 'rose6'
  3562. }]
  3563. }]
  3564. });
  3565. }
  3566. //echart Donut
  3567. if ($('#echart_donut').length ){
  3568. var echartDonut = echarts.init(document.getElementById('echart_donut'), theme);
  3569. echartDonut.setOption({
  3570. tooltip: {
  3571. trigger: 'item',
  3572. formatter: "{a} <br/>{b} : {c} ({d}%)"
  3573. },
  3574. calculable: true,
  3575. legend: {
  3576. x: 'center',
  3577. y: 'bottom',
  3578. data: ['Direct Access', 'E-mail Marketing', 'Union Ad', 'Video Ads', 'Search Engine']
  3579. },
  3580. toolbox: {
  3581. show: true,
  3582. feature: {
  3583. magicType: {
  3584. show: true,
  3585. type: ['pie', 'funnel'],
  3586. option: {
  3587. funnel: {
  3588. x: '25%',
  3589. width: '50%',
  3590. funnelAlign: 'center',
  3591. max: 1548
  3592. }
  3593. }
  3594. },
  3595. restore: {
  3596. show: true,
  3597. title: "Restore"
  3598. },
  3599. saveAsImage: {
  3600. show: true,
  3601. title: "Save Image"
  3602. }
  3603. }
  3604. },
  3605. series: [{
  3606. name: 'Access to the resource',
  3607. type: 'pie',
  3608. radius: ['35%', '55%'],
  3609. itemStyle: {
  3610. normal: {
  3611. label: {
  3612. show: true
  3613. },
  3614. labelLine: {
  3615. show: true
  3616. }
  3617. },
  3618. emphasis: {
  3619. label: {
  3620. show: true,
  3621. position: 'center',
  3622. textStyle: {
  3623. fontSize: '14',
  3624. fontWeight: 'normal'
  3625. }
  3626. }
  3627. }
  3628. },
  3629. data: [{
  3630. value: 335,
  3631. name: 'Direct Access'
  3632. }, {
  3633. value: 310,
  3634. name: 'E-mail Marketing'
  3635. }, {
  3636. value: 234,
  3637. name: 'Union Ad'
  3638. }, {
  3639. value: 135,
  3640. name: 'Video Ads'
  3641. }, {
  3642. value: 1548,
  3643. name: 'Search Engine'
  3644. }]
  3645. }]
  3646. });
  3647. }
  3648. //echart Pie
  3649. if ($('#echart_pie').length ){
  3650. var echartPie = echarts.init(document.getElementById('echart_pie'), theme);
  3651. echartPie.setOption({
  3652. tooltip: {
  3653. trigger: 'item',
  3654. formatter: "{a} <br/>{b} : {c} ({d}%)"
  3655. },
  3656. legend: {
  3657. x: 'center',
  3658. y: 'bottom',
  3659. data: ['Direct Access', 'E-mail Marketing', 'Union Ad', 'Video Ads', 'Search Engine']
  3660. },
  3661. toolbox: {
  3662. show: true,
  3663. feature: {
  3664. magicType: {
  3665. show: true,
  3666. type: ['pie', 'funnel'],
  3667. option: {
  3668. funnel: {
  3669. x: '25%',
  3670. width: '50%',
  3671. funnelAlign: 'left',
  3672. max: 1548
  3673. }
  3674. }
  3675. },
  3676. restore: {
  3677. show: true,
  3678. title: "Restore"
  3679. },
  3680. saveAsImage: {
  3681. show: true,
  3682. title: "Save Image"
  3683. }
  3684. }
  3685. },
  3686. calculable: true,
  3687. series: [{
  3688. name: '访问来源',
  3689. type: 'pie',
  3690. radius: '55%',
  3691. center: ['50%', '48%'],
  3692. data: [{
  3693. value: 335,
  3694. name: 'Direct Access'
  3695. }, {
  3696. value: 310,
  3697. name: 'E-mail Marketing'
  3698. }, {
  3699. value: 234,
  3700. name: 'Union Ad'
  3701. }, {
  3702. value: 135,
  3703. name: 'Video Ads'
  3704. }, {
  3705. value: 1548,
  3706. name: 'Search Engine'
  3707. }]
  3708. }]
  3709. });
  3710. var dataStyle = {
  3711. normal: {
  3712. label: {
  3713. show: false
  3714. },
  3715. labelLine: {
  3716. show: false
  3717. }
  3718. }
  3719. };
  3720. var placeHolderStyle = {
  3721. normal: {
  3722. color: 'rgba(0,0,0,0)',
  3723. label: {
  3724. show: false
  3725. },
  3726. labelLine: {
  3727. show: false
  3728. }
  3729. },
  3730. emphasis: {
  3731. color: 'rgba(0,0,0,0)'
  3732. }
  3733. };
  3734. }
  3735. //echart Mini Pie
  3736. if ($('#echart_mini_pie').length ){
  3737. var echartMiniPie = echarts.init(document.getElementById('echart_mini_pie'), theme);
  3738. echartMiniPie .setOption({
  3739. title: {
  3740. text: 'Chart #2',
  3741. subtext: 'From ExcelHome',
  3742. sublink: 'http://e.weibo.com/1341556070/AhQXtjbqh',
  3743. x: 'center',
  3744. y: 'center',
  3745. itemGap: 20,
  3746. textStyle: {
  3747. color: 'rgba(30,144,255,0.8)',
  3748. fontFamily: '微软雅黑',
  3749. fontSize: 35,
  3750. fontWeight: 'bolder'
  3751. }
  3752. },
  3753. tooltip: {
  3754. show: true,
  3755. formatter: "{a} <br/>{b} : {c} ({d}%)"
  3756. },
  3757. legend: {
  3758. orient: 'vertical',
  3759. x: 170,
  3760. y: 45,
  3761. itemGap: 12,
  3762. data: ['68%Something #1', '29%Something #2', '3%Something #3'],
  3763. },
  3764. toolbox: {
  3765. show: true,
  3766. feature: {
  3767. mark: {
  3768. show: true
  3769. },
  3770. dataView: {
  3771. show: true,
  3772. title: "Text View",
  3773. lang: [
  3774. "Text View",
  3775. "Close",
  3776. "Refresh",
  3777. ],
  3778. readOnly: false
  3779. },
  3780. restore: {
  3781. show: true,
  3782. title: "Restore"
  3783. },
  3784. saveAsImage: {
  3785. show: true,
  3786. title: "Save Image"
  3787. }
  3788. }
  3789. },
  3790. series: [{
  3791. name: '1',
  3792. type: 'pie',
  3793. clockWise: false,
  3794. radius: [105, 130],
  3795. itemStyle: dataStyle,
  3796. data: [{
  3797. value: 68,
  3798. name: '68%Something #1'
  3799. }, {
  3800. value: 32,
  3801. name: 'invisible',
  3802. itemStyle: placeHolderStyle
  3803. }]
  3804. }, {
  3805. name: '2',
  3806. type: 'pie',
  3807. clockWise: false,
  3808. radius: [80, 105],
  3809. itemStyle: dataStyle,
  3810. data: [{
  3811. value: 29,
  3812. name: '29%Something #2'
  3813. }, {
  3814. value: 71,
  3815. name: 'invisible',
  3816. itemStyle: placeHolderStyle
  3817. }]
  3818. }, {
  3819. name: '3',
  3820. type: 'pie',
  3821. clockWise: false,
  3822. radius: [25, 80],
  3823. itemStyle: dataStyle,
  3824. data: [{
  3825. value: 3,
  3826. name: '3%Something #3'
  3827. }, {
  3828. value: 97,
  3829. name: 'invisible',
  3830. itemStyle: placeHolderStyle
  3831. }]
  3832. }]
  3833. });
  3834. }
  3835. //echart Map
  3836. if ($('#echart_world_map').length ){
  3837. var echartMap = echarts.init(document.getElementById('echart_world_map'), theme);
  3838. echartMap.setOption({
  3839. title: {
  3840. text: 'World Population (2010)',
  3841. subtext: 'from United Nations, Total population, both sexes combined, as of 1 July (thousands)',
  3842. x: 'center',
  3843. y: 'top'
  3844. },
  3845. tooltip: {
  3846. trigger: 'item',
  3847. formatter: function(params) {
  3848. var value = (params.value + '').split('.');
  3849. value = value[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g, '$1,') + '.' + value[1];
  3850. return params.seriesName + '<br/>' + params.name + ' : ' + value;
  3851. }
  3852. },
  3853. toolbox: {
  3854. show: true,
  3855. orient: 'vertical',
  3856. x: 'right',
  3857. y: 'center',
  3858. feature: {
  3859. mark: {
  3860. show: true
  3861. },
  3862. dataView: {
  3863. show: true,
  3864. title: "Text View",
  3865. lang: [
  3866. "Text View",
  3867. "Close",
  3868. "Refresh",
  3869. ],
  3870. readOnly: false
  3871. },
  3872. restore: {
  3873. show: true,
  3874. title: "Restore"
  3875. },
  3876. saveAsImage: {
  3877. show: true,
  3878. title: "Save Image"
  3879. }
  3880. }
  3881. },
  3882. dataRange: {
  3883. min: 0,
  3884. max: 1000000,
  3885. text: ['High', 'Low'],
  3886. realtime: false,
  3887. calculable: true,
  3888. color: ['#087E65', '#26B99A', '#CBEAE3']
  3889. },
  3890. series: [{
  3891. name: 'World Population (2010)',
  3892. type: 'map',
  3893. mapType: 'world',
  3894. roam: false,
  3895. mapLocation: {
  3896. y: 60
  3897. },
  3898. itemStyle: {
  3899. emphasis: {
  3900. label: {
  3901. show: true
  3902. }
  3903. }
  3904. },
  3905. data: [{
  3906. name: 'Afghanistan',
  3907. value: 28397.812
  3908. }, {
  3909. name: 'Angola',
  3910. value: 19549.124
  3911. }, {
  3912. name: 'Albania',
  3913. value: 3150.143
  3914. }, {
  3915. name: 'United Arab Emirates',
  3916. value: 8441.537
  3917. }, {
  3918. name: 'Argentina',
  3919. value: 40374.224
  3920. }, {
  3921. name: 'Armenia',
  3922. value: 2963.496
  3923. }, {
  3924. name: 'French Southern and Antarctic Lands',
  3925. value: 268.065
  3926. }, {
  3927. name: 'Australia',
  3928. value: 22404.488
  3929. }, {
  3930. name: 'Austria',
  3931. value: 8401.924
  3932. }, {
  3933. name: 'Azerbaijan',
  3934. value: 9094.718
  3935. }, {
  3936. name: 'Burundi',
  3937. value: 9232.753
  3938. }, {
  3939. name: 'Belgium',
  3940. value: 10941.288
  3941. }, {
  3942. name: 'Benin',
  3943. value: 9509.798
  3944. }, {
  3945. name: 'Burkina Faso',
  3946. value: 15540.284
  3947. }, {
  3948. name: 'Bangladesh',
  3949. value: 151125.475
  3950. }, {
  3951. name: 'Bulgaria',
  3952. value: 7389.175
  3953. }, {
  3954. name: 'The Bahamas',
  3955. value: 66402.316
  3956. }, {
  3957. name: 'Bosnia and Herzegovina',
  3958. value: 3845.929
  3959. }, {
  3960. name: 'Belarus',
  3961. value: 9491.07
  3962. }, {
  3963. name: 'Belize',
  3964. value: 308.595
  3965. }, {
  3966. name: 'Bermuda',
  3967. value: 64.951
  3968. }, {
  3969. name: 'Bolivia',
  3970. value: 716.939
  3971. }, {
  3972. name: 'Brazil',
  3973. value: 195210.154
  3974. }, {
  3975. name: 'Brunei',
  3976. value: 27.223
  3977. }, {
  3978. name: 'Bhutan',
  3979. value: 716.939
  3980. }, {
  3981. name: 'Botswana',
  3982. value: 1969.341
  3983. }, {
  3984. name: 'Central African Republic',
  3985. value: 4349.921
  3986. }, {
  3987. name: 'Canada',
  3988. value: 34126.24
  3989. }, {
  3990. name: 'Switzerland',
  3991. value: 7830.534
  3992. }, {
  3993. name: 'Chile',
  3994. value: 17150.76
  3995. }, {
  3996. name: 'China',
  3997. value: 1359821.465
  3998. }, {
  3999. name: 'Ivory Coast',
  4000. value: 60508.978
  4001. }, {
  4002. name: 'Cameroon',
  4003. value: 20624.343
  4004. }, {
  4005. name: 'Democratic Republic of the Congo',
  4006. value: 62191.161
  4007. }, {
  4008. name: 'Republic of the Congo',
  4009. value: 3573.024
  4010. }, {
  4011. name: 'Colombia',
  4012. value: 46444.798
  4013. }, {
  4014. name: 'Costa Rica',
  4015. value: 4669.685
  4016. }, {
  4017. name: 'Cuba',
  4018. value: 11281.768
  4019. }, {
  4020. name: 'Northern Cyprus',
  4021. value: 1.468
  4022. }, {
  4023. name: 'Cyprus',
  4024. value: 1103.685
  4025. }, {
  4026. name: 'Czech Republic',
  4027. value: 10553.701
  4028. }, {
  4029. name: 'Germany',
  4030. value: 83017.404
  4031. }, {
  4032. name: 'Djibouti',
  4033. value: 834.036
  4034. }, {
  4035. name: 'Denmark',
  4036. value: 5550.959
  4037. }, {
  4038. name: 'Dominican Republic',
  4039. value: 10016.797
  4040. }, {
  4041. name: 'Algeria',
  4042. value: 37062.82
  4043. }, {
  4044. name: 'Ecuador',
  4045. value: 15001.072
  4046. }, {
  4047. name: 'Egypt',
  4048. value: 78075.705
  4049. }, {
  4050. name: 'Eritrea',
  4051. value: 5741.159
  4052. }, {
  4053. name: 'Spain',
  4054. value: 46182.038
  4055. }, {
  4056. name: 'Estonia',
  4057. value: 1298.533
  4058. }, {
  4059. name: 'Ethiopia',
  4060. value: 87095.281
  4061. }, {
  4062. name: 'Finland',
  4063. value: 5367.693
  4064. }, {
  4065. name: 'Fiji',
  4066. value: 860.559
  4067. }, {
  4068. name: 'Falkland Islands',
  4069. value: 49.581
  4070. }, {
  4071. name: 'France',
  4072. value: 63230.866
  4073. }, {
  4074. name: 'Gabon',
  4075. value: 1556.222
  4076. }, {
  4077. name: 'United Kingdom',
  4078. value: 62066.35
  4079. }, {
  4080. name: 'Georgia',
  4081. value: 4388.674
  4082. }, {
  4083. name: 'Ghana',
  4084. value: 24262.901
  4085. }, {
  4086. name: 'Guinea',
  4087. value: 10876.033
  4088. }, {
  4089. name: 'Gambia',
  4090. value: 1680.64
  4091. }, {
  4092. name: 'Guinea Bissau',
  4093. value: 10876.033
  4094. }, {
  4095. name: 'Equatorial Guinea',
  4096. value: 696.167
  4097. }, {
  4098. name: 'Greece',
  4099. value: 11109.999
  4100. }, {
  4101. name: 'Greenland',
  4102. value: 56.546
  4103. }, {
  4104. name: 'Guatemala',
  4105. value: 14341.576
  4106. }, {
  4107. name: 'French Guiana',
  4108. value: 231.169
  4109. }, {
  4110. name: 'Guyana',
  4111. value: 786.126
  4112. }, {
  4113. name: 'Honduras',
  4114. value: 7621.204
  4115. }, {
  4116. name: 'Croatia',
  4117. value: 4338.027
  4118. }, {
  4119. name: 'Haiti',
  4120. value: 9896.4
  4121. }, {
  4122. name: 'Hungary',
  4123. value: 10014.633
  4124. }, {
  4125. name: 'Indonesia',
  4126. value: 240676.485
  4127. }, {
  4128. name: 'India',
  4129. value: 1205624.648
  4130. }, {
  4131. name: 'Ireland',
  4132. value: 4467.561
  4133. }, {
  4134. name: 'Iran',
  4135. value: 240676.485
  4136. }, {
  4137. name: 'Iraq',
  4138. value: 30962.38
  4139. }, {
  4140. name: 'Iceland',
  4141. value: 318.042
  4142. }, {
  4143. name: 'Israel',
  4144. value: 7420.368
  4145. }, {
  4146. name: 'Italy',
  4147. value: 60508.978
  4148. }, {
  4149. name: 'Jamaica',
  4150. value: 2741.485
  4151. }, {
  4152. name: 'Jordan',
  4153. value: 6454.554
  4154. }, {
  4155. name: 'Japan',
  4156. value: 127352.833
  4157. }, {
  4158. name: 'Kazakhstan',
  4159. value: 15921.127
  4160. }, {
  4161. name: 'Kenya',
  4162. value: 40909.194
  4163. }, {
  4164. name: 'Kyrgyzstan',
  4165. value: 5334.223
  4166. }, {
  4167. name: 'Cambodia',
  4168. value: 14364.931
  4169. }, {
  4170. name: 'South Korea',
  4171. value: 51452.352
  4172. }, {
  4173. name: 'Kosovo',
  4174. value: 97.743
  4175. }, {
  4176. name: 'Kuwait',
  4177. value: 2991.58
  4178. }, {
  4179. name: 'Laos',
  4180. value: 6395.713
  4181. }, {
  4182. name: 'Lebanon',
  4183. value: 4341.092
  4184. }, {
  4185. name: 'Liberia',
  4186. value: 3957.99
  4187. }, {
  4188. name: 'Libya',
  4189. value: 6040.612
  4190. }, {
  4191. name: 'Sri Lanka',
  4192. value: 20758.779
  4193. }, {
  4194. name: 'Lesotho',
  4195. value: 2008.921
  4196. }, {
  4197. name: 'Lithuania',
  4198. value: 3068.457
  4199. }, {
  4200. name: 'Luxembourg',
  4201. value: 507.885
  4202. }, {
  4203. name: 'Latvia',
  4204. value: 2090.519
  4205. }, {
  4206. name: 'Morocco',
  4207. value: 31642.36
  4208. }, {
  4209. name: 'Moldova',
  4210. value: 103.619
  4211. }, {
  4212. name: 'Madagascar',
  4213. value: 21079.532
  4214. }, {
  4215. name: 'Mexico',
  4216. value: 117886.404
  4217. }, {
  4218. name: 'Macedonia',
  4219. value: 507.885
  4220. }, {
  4221. name: 'Mali',
  4222. value: 13985.961
  4223. }, {
  4224. name: 'Myanmar',
  4225. value: 51931.231
  4226. }, {
  4227. name: 'Montenegro',
  4228. value: 620.078
  4229. }, {
  4230. name: 'Mongolia',
  4231. value: 2712.738
  4232. }, {
  4233. name: 'Mozambique',
  4234. value: 23967.265
  4235. }, {
  4236. name: 'Mauritania',
  4237. value: 3609.42
  4238. }, {
  4239. name: 'Malawi',
  4240. value: 15013.694
  4241. }, {
  4242. name: 'Malaysia',
  4243. value: 28275.835
  4244. }, {
  4245. name: 'Namibia',
  4246. value: 2178.967
  4247. }, {
  4248. name: 'New Caledonia',
  4249. value: 246.379
  4250. }, {
  4251. name: 'Niger',
  4252. value: 15893.746
  4253. }, {
  4254. name: 'Nigeria',
  4255. value: 159707.78
  4256. }, {
  4257. name: 'Nicaragua',
  4258. value: 5822.209
  4259. }, {
  4260. name: 'Netherlands',
  4261. value: 16615.243
  4262. }, {
  4263. name: 'Norway',
  4264. value: 4891.251
  4265. }, {
  4266. name: 'Nepal',
  4267. value: 26846.016
  4268. }, {
  4269. name: 'New Zealand',
  4270. value: 4368.136
  4271. }, {
  4272. name: 'Oman',
  4273. value: 2802.768
  4274. }, {
  4275. name: 'Pakistan',
  4276. value: 173149.306
  4277. }, {
  4278. name: 'Panama',
  4279. value: 3678.128
  4280. }, {
  4281. name: 'Peru',
  4282. value: 29262.83
  4283. }, {
  4284. name: 'Philippines',
  4285. value: 93444.322
  4286. }, {
  4287. name: 'Papua New Guinea',
  4288. value: 6858.945
  4289. }, {
  4290. name: 'Poland',
  4291. value: 38198.754
  4292. }, {
  4293. name: 'Puerto Rico',
  4294. value: 3709.671
  4295. }, {
  4296. name: 'North Korea',
  4297. value: 1.468
  4298. }, {
  4299. name: 'Portugal',
  4300. value: 10589.792
  4301. }, {
  4302. name: 'Paraguay',
  4303. value: 6459.721
  4304. }, {
  4305. name: 'Qatar',
  4306. value: 1749.713
  4307. }, {
  4308. name: 'Romania',
  4309. value: 21861.476
  4310. }, {
  4311. name: 'Russia',
  4312. value: 21861.476
  4313. }, {
  4314. name: 'Rwanda',
  4315. value: 10836.732
  4316. }, {
  4317. name: 'Western Sahara',
  4318. value: 514.648
  4319. }, {
  4320. name: 'Saudi Arabia',
  4321. value: 27258.387
  4322. }, {
  4323. name: 'Sudan',
  4324. value: 35652.002
  4325. }, {
  4326. name: 'South Sudan',
  4327. value: 9940.929
  4328. }, {
  4329. name: 'Senegal',
  4330. value: 12950.564
  4331. }, {
  4332. name: 'Solomon Islands',
  4333. value: 526.447
  4334. }, {
  4335. name: 'Sierra Leone',
  4336. value: 5751.976
  4337. }, {
  4338. name: 'El Salvador',
  4339. value: 6218.195
  4340. }, {
  4341. name: 'Somaliland',
  4342. value: 9636.173
  4343. }, {
  4344. name: 'Somalia',
  4345. value: 9636.173
  4346. }, {
  4347. name: 'Republic of Serbia',
  4348. value: 3573.024
  4349. }, {
  4350. name: 'Suriname',
  4351. value: 524.96
  4352. }, {
  4353. name: 'Slovakia',
  4354. value: 5433.437
  4355. }, {
  4356. name: 'Slovenia',
  4357. value: 2054.232
  4358. }, {
  4359. name: 'Sweden',
  4360. value: 9382.297
  4361. }, {
  4362. name: 'Swaziland',
  4363. value: 1193.148
  4364. }, {
  4365. name: 'Syria',
  4366. value: 7830.534
  4367. }, {
  4368. name: 'Chad',
  4369. value: 11720.781
  4370. }, {
  4371. name: 'Togo',
  4372. value: 6306.014
  4373. }, {
  4374. name: 'Thailand',
  4375. value: 66402.316
  4376. }, {
  4377. name: 'Tajikistan',
  4378. value: 7627.326
  4379. }, {
  4380. name: 'Turkmenistan',
  4381. value: 5041.995
  4382. }, {
  4383. name: 'East Timor',
  4384. value: 10016.797
  4385. }, {
  4386. name: 'Trinidad and Tobago',
  4387. value: 1328.095
  4388. }, {
  4389. name: 'Tunisia',
  4390. value: 10631.83
  4391. }, {
  4392. name: 'Turkey',
  4393. value: 72137.546
  4394. }, {
  4395. name: 'United Republic of Tanzania',
  4396. value: 44973.33
  4397. }, {
  4398. name: 'Uganda',
  4399. value: 33987.213
  4400. }, {
  4401. name: 'Ukraine',
  4402. value: 46050.22
  4403. }, {
  4404. name: 'Uruguay',
  4405. value: 3371.982
  4406. }, {
  4407. name: 'United States of America',
  4408. value: 312247.116
  4409. }, {
  4410. name: 'Uzbekistan',
  4411. value: 27769.27
  4412. }, {
  4413. name: 'Venezuela',
  4414. value: 236.299
  4415. }, {
  4416. name: 'Vietnam',
  4417. value: 89047.397
  4418. }, {
  4419. name: 'Vanuatu',
  4420. value: 236.299
  4421. }, {
  4422. name: 'West Bank',
  4423. value: 13.565
  4424. }, {
  4425. name: 'Yemen',
  4426. value: 22763.008
  4427. }, {
  4428. name: 'South Africa',
  4429. value: 51452.352
  4430. }, {
  4431. name: 'Zambia',
  4432. value: 13216.985
  4433. }, {
  4434. name: 'Zimbabwe',
  4435. value: 13076.978
  4436. }]
  4437. }]
  4438. });
  4439. }
  4440. }
  4441. $(document).ready(function() {
  4442. init_sparklines();
  4443. init_flot_chart();
  4444. init_sidebar();
  4445. init_wysiwyg();
  4446. init_InputMask();
  4447. init_JQVmap();
  4448. init_cropper();
  4449. init_knob();
  4450. init_IonRangeSlider();
  4451. init_ColorPicker();
  4452. init_TagsInput();
  4453. init_parsley();
  4454. init_daterangepicker();
  4455. init_daterangepicker_right();
  4456. init_daterangepicker_single_call();
  4457. init_daterangepicker_reservation();
  4458. init_SmartWizard();
  4459. init_EasyPieChart();
  4460. init_charts();
  4461. init_echarts();
  4462. init_morris_charts();
  4463. init_skycons();
  4464. init_select2();
  4465. init_validator();
  4466. init_DataTables();
  4467. init_chart_doughnut();
  4468. init_gauge();
  4469. init_PNotify();
  4470. init_starrr();
  4471. init_calendar();
  4472. init_compose();
  4473. init_CustomNotification();
  4474. init_autosize();
  4475. init_autocomplete();
  4476. });