custom.js 150 KB

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