| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601 | 
							- !function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.UI=e()}}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
 - var UI = {};
 - 
 - var VideoLayout = require("./videolayout/VideoLayout.js");
 - var AudioLevels = require("./audio_levels/AudioLevels.js");
 - var Prezi = require("./prezi/Prezi.js");
 - var Etherpad = require("./etherpad/Etherpad.js");
 - var Chat = require("./side_pannels/chat/Chat.js");
 - var Toolbar = require("./toolbars/toolbar");
 - var ToolbarToggler = require("./toolbars/toolbartoggler");
 - var BottomToolbar = require("./toolbars/BottomToolbar");
 - var ContactList = require("./side_pannels/contactlist/ContactList");
 - var Avatar = require("./avatar/Avatar");
 - //var EventEmitter = require("events");
 - var SettingsMenu = require("./side_pannels/settings/SettingsMenu");
 - var Settings = require("./side_pannels/settings/Settings");
 - var PanelToggler = require("./side_pannels/SidePanelToggler");
 - var RoomNameGenerator = require("./welcome_page/RoomnameGenerator");
 - UI.messageHandler = require("./util/MessageHandler");
 - var messageHandler = UI.messageHandler;
 - 
 - //var eventEmitter = new EventEmitter();
 - 
 - 
 - 
 - function setupPrezi()
 - {
 -     $("#reloadPresentationLink").click(function()
 -     {
 -         Prezi.reloadPresentation();
 -     });
 - }
 - 
 - function setupChat()
 - {
 -     Chat.init();
 -     $("#toggle_smileys").click(function() {
 -         Chat.toggleSmileys();
 -     });
 - }
 - 
 - function setupToolbars() {
 -     Toolbar.init();
 -     Toolbar.setupButtonsFromConfig();
 -     BottomToolbar.init();
 - }
 - 
 - function streamHandler(stream) {
 -     switch (stream.type)
 -     {
 -         case "audio":
 -             VideoLayout.changeLocalAudio(stream);
 -             break;
 -         case "video":
 -             VideoLayout.changeLocalVideo(stream);
 -             break;
 -         case "stream":
 -             VideoLayout.changeLocalStream(stream);
 -             break;
 -         case "desktop":
 -             VideoLayout.changeLocalVideo(stream);
 -             break;
 -     }
 - }
 - 
 - function registerListeners() {
 -     RTC.addStreamListener(streamHandler, StreamEventTypes.EVENT_TYPE_LOCAL_CREATED);
 - 
 -     RTC.addStreamListener(streamHandler, StreamEventTypes.EVENT_TYPE_LOCAL_CHANGED);
 -     RTC.addStreamListener(function (stream) {
 -         VideoLayout.onRemoteStreamAdded(stream);
 -     }, StreamEventTypes.EVENT_TYPE_REMOTE_CREATED);
 - 
 -     // Listen for large video size updates
 -     document.getElementById('largeVideo')
 -         .addEventListener('loadedmetadata', function (e) {
 -             currentVideoWidth = this.videoWidth;
 -             currentVideoHeight = this.videoHeight;
 -             VideoLayout.positionLarge(currentVideoWidth, currentVideoHeight);
 -         });
 - 
 - 
 -     statistics.addAudioLevelListener(function(jid, audioLevel)
 -     {
 -         var resourceJid;
 -         if(jid === statistics.LOCAL_JID)
 -         {
 -             resourceJid = AudioLevels.LOCAL_LEVEL;
 -             if(RTC.localAudio.isMuted())
 -             {
 -                 audioLevel = 0;
 -             }
 -         }
 -         else
 -         {
 -             resourceJid = Strophe.getResourceFromJid(jid);
 -         }
 - 
 -         AudioLevels.updateAudioLevel(resourceJid, audioLevel,
 -             UI.getLargeVideoState().userResourceJid);
 -     });
 -     desktopsharing.addListener(function () {
 -         ToolbarToggler.showDesktopSharingButton();
 -     }, DesktopSharingEventTypes.INIT);
 -     desktopsharing.addListener(
 -         Toolbar.changeDesktopSharingButtonState,
 -         DesktopSharingEventTypes.SWITCHING_DONE);
 - 
 - 
 - }
 - 
 - function bindEvents()
 - {
 -     /**
 -      * Resizes and repositions videos in full screen mode.
 -      */
 -     $(document).on('webkitfullscreenchange mozfullscreenchange fullscreenchange',
 -         function () {
 -             VideoLayout.resizeLargeVideoContainer();
 -             VideoLayout.positionLarge();
 -             isFullScreen = document.fullScreen ||
 -                 document.mozFullScreen ||
 -                 document.webkitIsFullScreen;
 - 
 -         }
 -     );
 - 
 -     $(window).resize(function () {
 -         VideoLayout.resizeLargeVideoContainer();
 -         VideoLayout.positionLarge();
 -     });
 - }
 - 
 - UI.start = function () {
 -     document.title = interfaceConfig.APP_NAME;
 -     if(config.enableWelcomePage && window.location.pathname == "/" &&
 -         (!window.localStorage.welcomePageDisabled || window.localStorage.welcomePageDisabled == "false"))
 -     {
 -         $("#videoconference_page").hide();
 -         var setupWelcomePage = require("./welcome_page/WelcomePage");
 -         setupWelcomePage();
 - 
 -         return;
 -     }
 - 
 -     if (interfaceConfig.SHOW_JITSI_WATERMARK) {
 -         var leftWatermarkDiv
 -             = $("#largeVideoContainer div[class='watermark leftwatermark']");
 - 
 -         leftWatermarkDiv.css({display: 'block'});
 -         leftWatermarkDiv.parent().get(0).href
 -             = interfaceConfig.JITSI_WATERMARK_LINK;
 -     }
 - 
 -     if (interfaceConfig.SHOW_BRAND_WATERMARK) {
 -         var rightWatermarkDiv
 -             = $("#largeVideoContainer div[class='watermark rightwatermark']");
 - 
 -         rightWatermarkDiv.css({display: 'block'});
 -         rightWatermarkDiv.parent().get(0).href
 -             = interfaceConfig.BRAND_WATERMARK_LINK;
 -         rightWatermarkDiv.get(0).style.backgroundImage
 -             = "url(images/rightwatermark.png)";
 -     }
 - 
 -     if (interfaceConfig.SHOW_POWERED_BY) {
 -         $("#largeVideoContainer>a[class='poweredby']").css({display: 'block'});
 -     }
 - 
 -     $("#welcome_page").hide();
 - 
 -     $('body').popover({ selector: '[data-toggle=popover]',
 -         trigger: 'click hover',
 -         content: function() {
 -             return this.getAttribute("content") +
 -                 KeyboardShortcut.getShortcut(this.getAttribute("shortcut"));
 -         }
 -     });
 -     VideoLayout.resizeLargeVideoContainer();
 -     $("#videospace").mousemove(function () {
 -         return ToolbarToggler.showToolbar();
 -     });
 -     // Set the defaults for prompt dialogs.
 -     jQuery.prompt.setDefaults({persistent: false});
 - 
 - //    KeyboardShortcut.init();
 -     registerListeners();
 -     bindEvents();
 -     setupPrezi();
 -     setupToolbars();
 -     setupChat();
 - 
 -     document.title = interfaceConfig.APP_NAME;
 - 
 -     $("#downloadlog").click(function (event) {
 -         dump(event.target);
 -     });
 - 
 -     if(config.enableWelcomePage && window.location.pathname == "/" &&
 -         (!window.localStorage.welcomePageDisabled || window.localStorage.welcomePageDisabled == "false"))
 -     {
 -         $("#videoconference_page").hide();
 -         var setupWelcomePage = require("./welcome_page/WelcomePage");
 -         setupWelcomePage();
 - 
 -         return;
 -     }
 - 
 -     $("#welcome_page").hide();
 - 
 -     document.getElementById('largeVideo').volume = 0;
 - 
 -     if (!$('#settings').is(':visible')) {
 -         console.log('init');
 -         init();
 -     } else {
 -         loginInfo.onsubmit = function (e) {
 -             if (e.preventDefault) e.preventDefault();
 -             $('#settings').hide();
 -             init();
 -         };
 -     }
 - 
 -     toastr.options = {
 -         "closeButton": true,
 -         "debug": false,
 -         "positionClass": "notification-bottom-right",
 -         "onclick": null,
 -         "showDuration": "300",
 -         "hideDuration": "1000",
 -         "timeOut": "2000",
 -         "extendedTimeOut": "1000",
 -         "showEasing": "swing",
 -         "hideEasing": "linear",
 -         "showMethod": "fadeIn",
 -         "hideMethod": "fadeOut",
 -         "reposition": function() {
 -             if(PanelToggler.isVisible()) {
 -                 $("#toast-container").addClass("notification-bottom-right-center");
 -             } else {
 -                 $("#toast-container").removeClass("notification-bottom-right-center");
 -             }
 -         },
 -         "newestOnTop": false
 -     };
 - 
 -     $('#settingsmenu>input').keyup(function(event){
 -         if(event.keyCode === 13) {//enter
 -             SettingsMenu.update();
 -         }
 -     });
 - 
 -     $("#updateSettings").click(function () {
 -         SettingsMenu.update();
 -     });
 - 
 - };
 - 
 - 
 - UI.setUserAvatar = function (jid, id) {
 -     Avatar.setUserAvatar(jid, id);
 - };
 - 
 - UI.toggleSmileys = function () {
 -     Chat.toggleSmileys();
 - };
 - 
 - UI.chatAddError = function(errorMessage, originalText)
 - {
 -     return Chat.chatAddError(errorMessage, originalText);
 - };
 - 
 - UI.chatSetSubject = function(text)
 - {
 -     return Chat.chatSetSubject(text);
 - };
 - 
 - UI.updateChatConversation = function (from, displayName, message) {
 -     return Chat.updateChatConversation(from, displayName, message);
 - };
 - 
 - UI.onMucJoined = function (jid, info) {
 -     Toolbar.updateRoomUrl(window.location.href);
 -     document.getElementById('localNick').appendChild(
 -         document.createTextNode(Strophe.getResourceFromJid(jid) + ' (me)')
 -     );
 - 
 -     var settings = Settings.getSettings();
 -     // Add myself to the contact list.
 -     ContactList.addContact(jid, settings.email || settings.uid);
 - 
 -     // Once we've joined the muc show the toolbar
 -     ToolbarToggler.showToolbar();
 - 
 -     // Show authenticate button if needed
 -     Toolbar.showAuthenticateButton(
 -             Moderator.isExternalAuthEnabled() && !Moderator.isModerator());
 - 
 -     var displayName = !config.displayJids
 -         ? info.displayName : Strophe.getResourceFromJid(jid);
 - 
 -     if (displayName)
 -         $(document).trigger('displaynamechanged',
 -             ['localVideoContainer', displayName + ' (me)']);
 - };
 - 
 - UI.initEtherpad = function (name) {
 -     Etherpad.init(name);
 - };
 - 
 - UI.onMucLeft = function (jid) {
 -     console.log('left.muc', jid);
 -     var displayName = $('#participant_' + Strophe.getResourceFromJid(jid) +
 -         '>.displayname').html();
 -     messageHandler.notify(displayName || 'Somebody',
 -         'disconnected',
 -         'disconnected');
 -     // Need to call this with a slight delay, otherwise the element couldn't be
 -     // found for some reason.
 -     // XXX(gp) it works fine without the timeout for me (with Chrome 38).
 -     window.setTimeout(function () {
 -         var container = document.getElementById(
 -                 'participant_' + Strophe.getResourceFromJid(jid));
 -         if (container) {
 -             ContactList.removeContact(jid);
 -             VideoLayout.removeConnectionIndicator(jid);
 -             // hide here, wait for video to close before removing
 -             $(container).hide();
 -             VideoLayout.resizeThumbnails();
 -         }
 -     }, 10);
 - 
 -     // Unlock large video
 -     if (focusedVideoInfo && focusedVideoInfo.jid === jid)
 -     {
 -         console.info("Focused video owner has left the conference");
 -         focusedVideoInfo = null;
 -     }
 - 
 - };
 - 
 - UI.getSettings = function () {
 -     return Settings.getSettings();
 - };
 - 
 - UI.toggleFilmStrip = function () {
 -     return BottomToolbar.toggleFilmStrip();
 - };
 - 
 - UI.toggleChat = function () {
 -     return BottomToolbar.toggleChat();
 - };
 - 
 - UI.toggleContactList = function () {
 -     return BottomToolbar.toggleContactList();
 - };
 - 
 - UI.onLocalRoleChange = function (jid, info, pres) {
 - 
 -     console.info("My role changed, new role: " + info.role);
 -     var isModerator = Moderator.isModerator();
 - 
 -     VideoLayout.showModeratorIndicator();
 -     Toolbar.showAuthenticateButton(
 -             Moderator.isExternalAuthEnabled() && !isModerator);
 - 
 -     if (isModerator) {
 -         Toolbar.closeAuthenticationWindow();
 -         messageHandler.notify(
 -             'Me', 'connected', 'Moderator rights granted !');
 -     }
 - };
 - 
 - UI.onDisposeConference = function (unload) {
 -     Toolbar.showAuthenticateButton(false);
 - };
 - 
 - UI.onModeratorStatusChanged = function (isModerator) {
 - 
 -     Toolbar.showSipCallButton(isModerator);
 -     Toolbar.showRecordingButton(
 -         isModerator); //&&
 -     // FIXME:
 -     // Recording visible if
 -     // there are at least 2(+ 1 focus) participants
 -     //Object.keys(connection.emuc.members).length >= 3);
 - 
 -     if (isModerator && config.etherpad_base) {
 -         Etherpad.init();
 -     }
 - };
 - 
 - UI.onPasswordReqiured = function (callback) {
 -     // password is required
 -     Toolbar.lockLockButton();
 - 
 -     messageHandler.openTwoButtonDialog(null,
 -             '<h2>Password required</h2>' +
 -             '<input id="lockKey" type="text" placeholder="password" autofocus>',
 -         true,
 -         "Ok",
 -         function (e, v, m, f) {},
 -         function (event) {
 -             document.getElementById('lockKey').focus();
 -         },
 -         function (e, v, m, f) {
 -             if (v) {
 -                 var lockKey = document.getElementById('lockKey');
 -                 if (lockKey.value !== null) {
 -                     Toolbar.setSharedKey(lockKey.value);
 -                     callback(lockKey.value);
 -                 }
 -             }
 -         }
 -     );
 - };
 - 
 - UI.onAuthenticationRequired = function () {
 -     // This is the loop that will wait for the room to be created by
 -     // someone else. 'auth_required.moderator' will bring us back here.
 -     authRetryId = window.setTimeout(
 -         function () {
 -             Moderator.allocateConferenceFocus(roomName, doJoinAfterFocus);
 -         }, 5000);
 -     // Show prompt only if it's not open
 -     if (authDialog !== null) {
 -         return;
 -     }
 -     // extract room name from 'room@muc.server.net'
 -     var room = roomName.substr(0, roomName.indexOf('@'));
 - 
 -     authDialog = messageHandler.openDialog(
 -         'Stop',
 -             'Authentication is required to create room:<br/><b>' + room +
 -             '</b></br> You can either authenticate to create the room or ' +
 -             'just wait for someone else to do so.',
 -         true,
 -         {
 -             Authenticate: 'authNow'
 -         },
 -         function (onSubmitEvent, submitValue) {
 - 
 -             // Do not close the dialog yet
 -             onSubmitEvent.preventDefault();
 - 
 -             // Open login popup
 -             if (submitValue === 'authNow') {
 -                 Toolbar.authenticateClicked();
 -             }
 -         }
 -     );
 - };
 - 
 - UI.setRecordingButtonState = function (state) {
 -     Toolbar.setRecordingButtonState(state);
 - };
 - 
 - UI.inputDisplayNameHandler = function (value) {
 -     VideoLayout.inputDisplayNameHandler(value);
 - };
 - 
 - UI.onMucEntered = function (jid, id, displayName) {
 -     messageHandler.notify(displayName || 'Somebody',
 -         'connected',
 -         'connected');
 - 
 -     // Add Peer's container
 -     VideoLayout.ensurePeerContainerExists(jid,id);
 - };
 - 
 - UI.onMucPresenceStatus = function ( jid, info) {
 -     VideoLayout.setPresenceStatus(
 -             'participant_' + Strophe.getResourceFromJid(jid), info.status);
 - };
 - 
 - UI.onMucRoleChanged = function (role, displayName) {
 -     VideoLayout.showModeratorIndicator();
 - 
 -     if (role === 'moderator') {
 -         var displayName = displayName;
 -         if (!displayName) {
 -             displayName = 'Somebody';
 -         }
 -         messageHandler.notify(
 -             displayName,
 -             'connected',
 -                 'Moderator rights granted to ' + displayName + '!');
 -     }
 - };
 - 
 - UI.updateLocalConnectionStats = function(percent, stats)
 - {
 -     VideoLayout.updateLocalConnectionStats(percent, stats);
 - };
 - 
 - UI.updateConnectionStats = function(jid, percent, stats)
 - {
 -     VideoLayout.updateConnectionStats(jid, percent, stats);
 - };
 - 
 - UI.onStatsStop = function () {
 -     VideoLayout.onStatsStop();
 - };
 - 
 - UI.getLargeVideoState = function()
 - {
 -     return VideoLayout.getLargeVideoState();
 - };
 - 
 - UI.showLocalAudioIndicator = function (mute) {
 -     VideoLayout.showLocalAudioIndicator(mute);
 - };
 - 
 - UI.generateRoomName = function() {
 -     var roomnode = null;
 -     var path = window.location.pathname;
 - 
 -     // determinde the room node from the url
 -     // TODO: just the roomnode or the whole bare jid?
 -     if (config.getroomnode && typeof config.getroomnode === 'function') {
 -         // custom function might be responsible for doing the pushstate
 -         roomnode = config.getroomnode(path);
 -     } else {
 -         /* fall back to default strategy
 -          * this is making assumptions about how the URL->room mapping happens.
 -          * It currently assumes deployment at root, with a rewrite like the
 -          * following one (for nginx):
 -          location ~ ^/([a-zA-Z0-9]+)$ {
 -          rewrite ^/(.*)$ / break;
 -          }
 -          */
 -         if (path.length > 1) {
 -             roomnode = path.substr(1).toLowerCase();
 -         } else {
 -             var word = RoomNameGenerator.generateRoomWithoutSeparator();
 -             roomnode = word.toLowerCase();
 - 
 -             window.history.pushState('VideoChat',
 -                     'Room: ' + word, window.location.pathname + word);
 -         }
 -     }
 - 
 -     roomName = roomnode + '@' + config.hosts.muc;
 - };
 - 
 - 
 - UI.connectionIndicatorShowMore = function(id)
 - {
 -     return VideoLayout.connectionIndicators[id].showMore();
 - };
 - 
 - UI.showToolbar = function () {
 -     return ToolbarToggler.showToolbar();
 - };
 - 
 - UI.dockToolbar = function (isDock) {
 -     return ToolbarToggler.dockToolbar(isDock);
 - };
 - 
 - function dump(elem, filename) {
 -     elem = elem.parentNode;
 -     elem.download = filename || 'meetlog.json';
 -     elem.href = 'data:application/json;charset=utf-8,\n';
 -     var data = {};
 -     if (connection.jingle) {
 -         data = connection.jingle.populateData();
 -     }
 -     var metadata = {};
 -     metadata.time = new Date();
 -     metadata.url = window.location.href;
 -     metadata.ua = navigator.userAgent;
 -     if (connection.logger) {
 -         metadata.xmpp = connection.logger.log;
 -     }
 -     data.metadata = metadata;
 -     elem.href += encodeURIComponent(JSON.stringify(data, null, '  '));
 -     return false;
 - }
 - 
 - module.exports = UI;
 - 
 - 
 - },{"./audio_levels/AudioLevels.js":2,"./avatar/Avatar":4,"./etherpad/Etherpad.js":5,"./prezi/Prezi.js":6,"./side_pannels/SidePanelToggler":7,"./side_pannels/chat/Chat.js":8,"./side_pannels/contactlist/ContactList":12,"./side_pannels/settings/Settings":13,"./side_pannels/settings/SettingsMenu":14,"./toolbars/BottomToolbar":15,"./toolbars/toolbar":17,"./toolbars/toolbartoggler":18,"./util/MessageHandler":20,"./videolayout/VideoLayout.js":23,"./welcome_page/RoomnameGenerator":24,"./welcome_page/WelcomePage":25}],2:[function(require,module,exports){
 - var CanvasUtil = require("./CanvasUtils");
 - 
 - /**
 -  * The audio Levels plugin.
 -  */
 - var AudioLevels = (function(my) {
 -     var audioLevelCanvasCache = {};
 - 
 -     my.LOCAL_LEVEL = 'local';
 - 
 -     /**
 -      * Updates the audio level canvas for the given peerJid. If the canvas
 -      * didn't exist we create it.
 -      */
 -     my.updateAudioLevelCanvas = function (peerJid, VideoLayout) {
 -         var resourceJid = null;
 -         var videoSpanId = null;
 -         if (!peerJid)
 -             videoSpanId = 'localVideoContainer';
 -         else {
 -             resourceJid = Strophe.getResourceFromJid(peerJid);
 - 
 -             videoSpanId = 'participant_' + resourceJid;
 -         }
 - 
 -         var videoSpan = document.getElementById(videoSpanId);
 - 
 -         if (!videoSpan) {
 -             if (resourceJid)
 -                 console.error("No video element for jid", resourceJid);
 -             else
 -                 console.error("No video element for local video.");
 - 
 -             return;
 -         }
 - 
 -         var audioLevelCanvas = $('#' + videoSpanId + '>canvas');
 - 
 -         var videoSpaceWidth = $('#remoteVideos').width();
 -         var thumbnailSize = VideoLayout.calculateThumbnailSize(videoSpaceWidth);
 -         var thumbnailWidth = thumbnailSize[0];
 -         var thumbnailHeight = thumbnailSize[1];
 - 
 -         if (!audioLevelCanvas || audioLevelCanvas.length === 0) {
 - 
 -             audioLevelCanvas = document.createElement('canvas');
 -             audioLevelCanvas.className = "audiolevel";
 -             audioLevelCanvas.style.bottom = "-" + interfaceConfig.CANVAS_EXTRA/2 + "px";
 -             audioLevelCanvas.style.left = "-" + interfaceConfig.CANVAS_EXTRA/2 + "px";
 -             resizeAudioLevelCanvas( audioLevelCanvas,
 -                     thumbnailWidth,
 -                     thumbnailHeight);
 - 
 -             videoSpan.appendChild(audioLevelCanvas);
 -         } else {
 -             audioLevelCanvas = audioLevelCanvas.get(0);
 - 
 -             resizeAudioLevelCanvas( audioLevelCanvas,
 -                     thumbnailWidth,
 -                     thumbnailHeight);
 -         }
 -     };
 - 
 -     /**
 -      * Updates the audio level UI for the given resourceJid.
 -      *
 -      * @param resourceJid the resource jid indicating the video element for
 -      * which we draw the audio level
 -      * @param audioLevel the newAudio level to render
 -      */
 -     my.updateAudioLevel = function (resourceJid, audioLevel, largeVideoResourceJid) {
 -         drawAudioLevelCanvas(resourceJid, audioLevel);
 - 
 -         var videoSpanId = getVideoSpanId(resourceJid);
 - 
 -         var audioLevelCanvas = $('#' + videoSpanId + '>canvas').get(0);
 - 
 -         if (!audioLevelCanvas)
 -             return;
 - 
 -         var drawContext = audioLevelCanvas.getContext('2d');
 - 
 -         var canvasCache = audioLevelCanvasCache[resourceJid];
 - 
 -         drawContext.clearRect (0, 0,
 -                 audioLevelCanvas.width, audioLevelCanvas.height);
 -         drawContext.drawImage(canvasCache, 0, 0);
 - 
 -         if(resourceJid === AudioLevels.LOCAL_LEVEL) {
 -             if(!connection.emuc.myroomjid) {
 -                 return;
 -             }
 -             resourceJid = Strophe.getResourceFromJid(connection.emuc.myroomjid);
 -         }
 - 
 -         if(resourceJid  === largeVideoResourceJid) {
 -             AudioLevels.updateActiveSpeakerAudioLevel(audioLevel);
 -         }
 -     };
 - 
 -     my.updateActiveSpeakerAudioLevel = function(audioLevel) {
 -         var drawContext = $('#activeSpeakerAudioLevel')[0].getContext('2d');
 -         var r = interfaceConfig.ACTIVE_SPEAKER_AVATAR_SIZE / 2;
 -         var center = (interfaceConfig.ACTIVE_SPEAKER_AVATAR_SIZE + r) / 2;
 - 
 -         // Save the previous state of the context.
 -         drawContext.save();
 - 
 -         drawContext.clearRect(0, 0, 300, 300);
 - 
 -         // Draw a circle.
 -         drawContext.arc(center, center, r, 0, 2 * Math.PI);
 - 
 -         // Add a shadow around the circle
 -         drawContext.shadowColor = interfaceConfig.SHADOW_COLOR;
 -         drawContext.shadowBlur = getShadowLevel(audioLevel);
 -         drawContext.shadowOffsetX = 0;
 -         drawContext.shadowOffsetY = 0;
 - 
 -         // Fill the shape.
 -         drawContext.fill();
 - 
 -         drawContext.save();
 - 
 -         drawContext.restore();
 - 
 - 
 -         drawContext.arc(center, center, r, 0, 2 * Math.PI);
 - 
 -         drawContext.clip();
 -         drawContext.clearRect(0, 0, 277, 200);
 - 
 -         // Restore the previous context state.
 -         drawContext.restore();
 -     };
 - 
 -     /**
 -      * Resizes the given audio level canvas to match the given thumbnail size.
 -      */
 -     function resizeAudioLevelCanvas(audioLevelCanvas,
 -                                     thumbnailWidth,
 -                                     thumbnailHeight) {
 -         audioLevelCanvas.width = thumbnailWidth + interfaceConfig.CANVAS_EXTRA;
 -         audioLevelCanvas.height = thumbnailHeight + interfaceConfig.CANVAS_EXTRA;
 -     }
 - 
 -     /**
 -      * Draws the audio level canvas into the cached canvas object.
 -      *
 -      * @param resourceJid the resource jid indicating the video element for
 -      * which we draw the audio level
 -      * @param audioLevel the newAudio level to render
 -      */
 -     function drawAudioLevelCanvas(resourceJid, audioLevel) {
 -         if (!audioLevelCanvasCache[resourceJid]) {
 - 
 -             var videoSpanId = getVideoSpanId(resourceJid);
 - 
 -             var audioLevelCanvasOrig = $('#' + videoSpanId + '>canvas').get(0);
 - 
 -             /*
 -              * FIXME Testing has shown that audioLevelCanvasOrig may not exist.
 -              * In such a case, the method CanvasUtil.cloneCanvas may throw an
 -              * error. Since audio levels are frequently updated, the errors have
 -              * been observed to pile into the console, strain the CPU.
 -              */
 -             if (audioLevelCanvasOrig)
 -             {
 -                 audioLevelCanvasCache[resourceJid]
 -                     = CanvasUtil.cloneCanvas(audioLevelCanvasOrig);
 -             }
 -         }
 - 
 -         var canvas = audioLevelCanvasCache[resourceJid];
 - 
 -         if (!canvas)
 -             return;
 - 
 -         var drawContext = canvas.getContext('2d');
 - 
 -         drawContext.clearRect(0, 0, canvas.width, canvas.height);
 - 
 -         var shadowLevel = getShadowLevel(audioLevel);
 - 
 -         if (shadowLevel > 0)
 -             // drawContext, x, y, w, h, r, shadowColor, shadowLevel
 -             CanvasUtil.drawRoundRectGlow(   drawContext,
 -                 interfaceConfig.CANVAS_EXTRA/2, interfaceConfig.CANVAS_EXTRA/2,
 -                 canvas.width - interfaceConfig.CANVAS_EXTRA,
 -                 canvas.height - interfaceConfig.CANVAS_EXTRA,
 -                 interfaceConfig.CANVAS_RADIUS,
 -                 interfaceConfig.SHADOW_COLOR,
 -                 shadowLevel);
 -     }
 - 
 -     /**
 -      * Returns the shadow/glow level for the given audio level.
 -      *
 -      * @param audioLevel the audio level from which we determine the shadow
 -      * level
 -      */
 -     function getShadowLevel (audioLevel) {
 -         var shadowLevel = 0;
 - 
 -         if (audioLevel <= 0.3) {
 -             shadowLevel = Math.round(interfaceConfig.CANVAS_EXTRA/2*(audioLevel/0.3));
 -         }
 -         else if (audioLevel <= 0.6) {
 -             shadowLevel = Math.round(interfaceConfig.CANVAS_EXTRA/2*((audioLevel - 0.3) / 0.3));
 -         }
 -         else {
 -             shadowLevel = Math.round(interfaceConfig.CANVAS_EXTRA/2*((audioLevel - 0.6) / 0.4));
 -         }
 -         return shadowLevel;
 -     }
 - 
 -     /**
 -      * Returns the video span id corresponding to the given resourceJid or local
 -      * user.
 -      */
 -     function getVideoSpanId(resourceJid) {
 -         var videoSpanId = null;
 -         if (resourceJid === AudioLevels.LOCAL_LEVEL
 -                 || (connection.emuc.myroomjid && resourceJid
 -                     === Strophe.getResourceFromJid(connection.emuc.myroomjid)))
 -             videoSpanId = 'localVideoContainer';
 -         else
 -             videoSpanId = 'participant_' + resourceJid;
 - 
 -         return videoSpanId;
 -     }
 - 
 -     /**
 -      * Indicates that the remote video has been resized.
 -      */
 -     $(document).bind('remotevideo.resized', function (event, width, height) {
 -         var resized = false;
 -         $('#remoteVideos>span>canvas').each(function() {
 -             var canvas = $(this).get(0);
 -             if (canvas.width !== width + interfaceConfig.CANVAS_EXTRA) {
 -                 canvas.width = width + interfaceConfig.CANVAS_EXTRA;
 -                 resized = true;
 -             }
 - 
 -             if (canvas.heigh !== height + interfaceConfig.CANVAS_EXTRA) {
 -                 canvas.height = height + interfaceConfig.CANVAS_EXTRA;
 -                 resized = true;
 -             }
 -         });
 - 
 -         if (resized)
 -             Object.keys(audioLevelCanvasCache).forEach(function (resourceJid) {
 -                 audioLevelCanvasCache[resourceJid].width
 -                     = width + interfaceConfig.CANVAS_EXTRA;
 -                 audioLevelCanvasCache[resourceJid].height
 -                     = height + interfaceConfig.CANVAS_EXTRA;
 -             });
 -     });
 - 
 -     return my;
 - 
 - })(AudioLevels || {});
 - 
 - module.exports = AudioLevels;
 - },{"./CanvasUtils":3}],3:[function(require,module,exports){
 - /**
 -  * Utility class for drawing canvas shapes.
 -  */
 - var CanvasUtil = (function(my) {
 - 
 -     /**
 -      * Draws a round rectangle with a glow. The glowWidth indicates the depth
 -      * of the glow.
 -      *
 -      * @param drawContext the context of the canvas to draw to
 -      * @param x the x coordinate of the round rectangle
 -      * @param y the y coordinate of the round rectangle
 -      * @param w the width of the round rectangle
 -      * @param h the height of the round rectangle
 -      * @param glowColor the color of the glow
 -      * @param glowWidth the width of the glow
 -      */
 -     my.drawRoundRectGlow
 -         = function(drawContext, x, y, w, h, r, glowColor, glowWidth) {
 - 
 -         // Save the previous state of the context.
 -         drawContext.save();
 - 
 -         if (w < 2 * r) r = w / 2;
 -         if (h < 2 * r) r = h / 2;
 - 
 -         // Draw a round rectangle.
 -         drawContext.beginPath();
 -         drawContext.moveTo(x+r, y);
 -         drawContext.arcTo(x+w, y,   x+w, y+h, r);
 -         drawContext.arcTo(x+w, y+h, x,   y+h, r);
 -         drawContext.arcTo(x,   y+h, x,   y,   r);
 -         drawContext.arcTo(x,   y,   x+w, y,   r);
 -         drawContext.closePath();
 - 
 -         // Add a shadow around the rectangle
 -         drawContext.shadowColor = glowColor;
 -         drawContext.shadowBlur = glowWidth;
 -         drawContext.shadowOffsetX = 0;
 -         drawContext.shadowOffsetY = 0;
 - 
 -         // Fill the shape.
 -         drawContext.fill();
 - 
 -         drawContext.save();
 - 
 -         drawContext.restore();
 - 
 - //      1) Uncomment this line to use Composite Operation, which is doing the
 - //      same as the clip function below and is also antialiasing the round
 - //      border, but is said to be less fast performance wise.
 - 
 - //      drawContext.globalCompositeOperation='destination-out';
 - 
 -         drawContext.beginPath();
 -         drawContext.moveTo(x+r, y);
 -         drawContext.arcTo(x+w, y,   x+w, y+h, r);
 -         drawContext.arcTo(x+w, y+h, x,   y+h, r);
 -         drawContext.arcTo(x,   y+h, x,   y,   r);
 -         drawContext.arcTo(x,   y,   x+w, y,   r);
 -         drawContext.closePath();
 - 
 - //      2) Uncomment this line to use Composite Operation, which is doing the
 - //      same as the clip function below and is also antialiasing the round
 - //      border, but is said to be less fast performance wise.
 - 
 - //      drawContext.fill();
 - 
 -         // Comment these two lines if choosing to do the same with composite
 -         // operation above 1 and 2.
 -         drawContext.clip();
 -         drawContext.clearRect(0, 0, 277, 200);
 - 
 -         // Restore the previous context state.
 -         drawContext.restore();
 -     };
 - 
 -     /**
 -      * Clones the given canvas.
 -      *
 -      * @return the new cloned canvas.
 -      */
 -     my.cloneCanvas = function (oldCanvas) {
 -         /*
 -          * FIXME Testing has shown that oldCanvas may not exist. In such a case,
 -          * the method CanvasUtil.cloneCanvas may throw an error. Since audio
 -          * levels are frequently updated, the errors have been observed to pile
 -          * into the console, strain the CPU.
 -          */
 -         if (!oldCanvas)
 -             return oldCanvas;
 - 
 -         //create a new canvas
 -         var newCanvas = document.createElement('canvas');
 -         var context = newCanvas.getContext('2d');
 - 
 -         //set dimensions
 -         newCanvas.width = oldCanvas.width;
 -         newCanvas.height = oldCanvas.height;
 - 
 -         //apply the old canvas to the new one
 -         context.drawImage(oldCanvas, 0, 0);
 - 
 -         //return the new canvas
 -         return newCanvas;
 -     };
 - 
 -     return my;
 - })(CanvasUtil || {});
 - 
 - module.exports = CanvasUtil;
 - },{}],4:[function(require,module,exports){
 - var Settings = require("../side_pannels/settings/Settings");
 - 
 - var users = {};
 - var activeSpeakerJid;
 - 
 - function setVisibility(selector, show) {
 -     if (selector && selector.length > 0) {
 -         selector.css("visibility", show ? "visible" : "hidden");
 -     }
 - }
 - 
 - function isUserMuted(jid) {
 -     // XXX(gp) we may want to rename this method to something like
 -     // isUserStreaming, for example.
 -     if (jid && jid != connection.emuc.myroomjid) {
 -         var resource = Strophe.getResourceFromJid(jid);
 -         if (!require("../videolayout/VideoLayout").isInLastN(resource)) {
 -             return true;
 -         }
 -     }
 - 
 -     if (!RTC.remoteStreams[jid] || !RTC.remoteStreams[jid][MediaStreamType.VIDEO_TYPE]) {
 -         return null;
 -     }
 -     return RTC.remoteStreams[jid][MediaStreamType.VIDEO_TYPE].muted;
 - }
 - 
 - function getGravatarUrl(id, size) {
 -     if(id === connection.emuc.myroomjid || !id) {
 -         id = Settings.getSettings().uid;
 -     }
 -     return 'https://www.gravatar.com/avatar/' +
 -         MD5.hexdigest(id.trim().toLowerCase()) +
 -         "?d=wavatar&size=" + (size || "30");
 - }
 - 
 - var Avatar = {
 - 
 -     /**
 -      * Sets the user's avatar in the settings menu(if local user), contact list
 -      * and thumbnail
 -      * @param jid jid of the user
 -      * @param id email or userID to be used as a hash
 -      */
 -     setUserAvatar: function (jid, id) {
 -         if (id) {
 -             if (users[jid] === id) {
 -                 return;
 -             }
 -             users[jid] = id;
 -         }
 -         var thumbUrl = getGravatarUrl(users[jid] || jid, 100);
 -         var contactListUrl = getGravatarUrl(users[jid] || jid);
 -         var resourceJid = Strophe.getResourceFromJid(jid);
 -         var thumbnail = $('#participant_' + resourceJid);
 -         var avatar = $('#avatar_' + resourceJid);
 - 
 -         // set the avatar in the settings menu if it is local user and get the
 -         // local video container
 -         if (jid === connection.emuc.myroomjid) {
 -             $('#avatar').get(0).src = thumbUrl;
 -             thumbnail = $('#localVideoContainer');
 -         }
 - 
 -         // set the avatar in the contact list
 -         var contact = $('#' + resourceJid + '>img');
 -         if (contact && contact.length > 0) {
 -             contact.get(0).src = contactListUrl;
 -         }
 - 
 -         // set the avatar in the thumbnail
 -         if (avatar && avatar.length > 0) {
 -             avatar[0].src = thumbUrl;
 -         } else {
 -             if (thumbnail && thumbnail.length > 0) {
 -                 avatar = document.createElement('img');
 -                 avatar.id = 'avatar_' + resourceJid;
 -                 avatar.className = 'userAvatar';
 -                 avatar.src = thumbUrl;
 -                 thumbnail.append(avatar);
 -             }
 -         }
 - 
 -         //if the user is the current active speaker - update the active speaker
 -         // avatar
 -         if (jid === activeSpeakerJid) {
 -             this.updateActiveSpeakerAvatarSrc(jid);
 -         }
 -     },
 - 
 -     /**
 -      * Hides or shows the user's avatar
 -      * @param jid jid of the user
 -      * @param show whether we should show the avatar or not
 -      * video because there is no dominant speaker and no focused speaker
 -      */
 -     showUserAvatar: function (jid, show) {
 -         if (users[jid]) {
 -             var resourceJid = Strophe.getResourceFromJid(jid);
 -             var video = $('#participant_' + resourceJid + '>video');
 -             var avatar = $('#avatar_' + resourceJid);
 - 
 -             if (jid === connection.emuc.myroomjid) {
 -                 video = $('#localVideoWrapper>video');
 -             }
 -             if (show === undefined || show === null) {
 -                 show = isUserMuted(jid);
 -             }
 - 
 -             //if the user is the currently focused, the dominant speaker or if
 -             //there is no focused and no dominant speaker and the large video is
 -             //currently shown
 -             if (activeSpeakerJid === jid && require("../videolayout/VideoLayout").isLargeVideoOnTop()) {
 -                 setVisibility($("#largeVideo"), !show);
 -                 setVisibility($('#activeSpeaker'), show);
 -                 setVisibility(avatar, false);
 -                 setVisibility(video, false);
 -             } else {
 -                 if (video && video.length > 0) {
 -                     setVisibility(video, !show);
 -                     setVisibility(avatar, show);
 -                 }
 -             }
 -         }
 -     },
 - 
 -     /**
 -      * Updates the src of the active speaker avatar
 -      * @param jid of the current active speaker
 -      */
 -     updateActiveSpeakerAvatarSrc: function (jid) {
 -         if (!jid) {
 -             jid = connection.emuc.findJidFromResource(
 -                 require("../videolayout/VideoLayout").getLargeVideoState().userResourceJid);
 -         }
 -         var avatar = $("#activeSpeakerAvatar")[0];
 -         var url = getGravatarUrl(users[jid],
 -             interfaceConfig.ACTIVE_SPEAKER_AVATAR_SIZE);
 -         if (jid === activeSpeakerJid && avatar.src === url) {
 -             return;
 -         }
 -         activeSpeakerJid = jid;
 -         var isMuted = isUserMuted(jid);
 -         if (jid && isMuted !== null) {
 -             avatar.src = url;
 -             setVisibility($("#largeVideo"), !isMuted);
 -             Avatar.showUserAvatar(jid, isMuted);
 -         }
 -     }
 - 
 - };
 - 
 - 
 - module.exports = Avatar;
 - },{"../side_pannels/settings/Settings":13,"../videolayout/VideoLayout":23}],5:[function(require,module,exports){
 - /* global $, config, connection, dockToolbar, Moderator,
 -    setLargeVideoVisible, Util */
 - 
 - var VideoLayout = require("../videolayout/VideoLayout");
 - var Prezi = require("../prezi/Prezi");
 - var UIUtil = require("../util/UIUtil");
 - 
 - var etherpadName = null;
 - var etherpadIFrame = null;
 - var domain = null;
 - var options = "?showControls=true&showChat=false&showLineNumbers=true&useMonospaceFont=false";
 - 
 - 
 - /**
 -  * Resizes the etherpad.
 -  */
 - function resize() {
 -     if ($('#etherpad>iframe').length) {
 -         var remoteVideos = $('#remoteVideos');
 -         var availableHeight
 -             = window.innerHeight - remoteVideos.outerHeight();
 -         var availableWidth = UIUtil.getAvailableVideoWidth();
 - 
 -         $('#etherpad>iframe').width(availableWidth);
 -         $('#etherpad>iframe').height(availableHeight);
 -     }
 - }
 - 
 - /**
 -  * Shares the Etherpad name with other participants.
 -  */
 - function shareEtherpad() {
 -     connection.emuc.addEtherpadToPresence(etherpadName);
 -     connection.emuc.sendPresence();
 - }
 - 
 - /**
 -  * Creates the Etherpad button and adds it to the toolbar.
 -  */
 - function enableEtherpadButton() {
 -     if (!$('#etherpadButton').is(":visible"))
 -         $('#etherpadButton').css({display: 'inline-block'});
 - }
 - 
 - /**
 -  * Creates the IFrame for the etherpad.
 -  */
 - function createIFrame() {
 -     etherpadIFrame = document.createElement('iframe');
 -     etherpadIFrame.src = domain + etherpadName + options;
 -     etherpadIFrame.frameBorder = 0;
 -     etherpadIFrame.scrolling = "no";
 -     etherpadIFrame.width = $('#largeVideoContainer').width() || 640;
 -     etherpadIFrame.height = $('#largeVideoContainer').height() || 480;
 -     etherpadIFrame.setAttribute('style', 'visibility: hidden;');
 - 
 -     document.getElementById('etherpad').appendChild(etherpadIFrame);
 - 
 -     etherpadIFrame.onload = function() {
 - 
 -         document.domain = document.domain;
 -         bubbleIframeMouseMove(etherpadIFrame);
 -         setTimeout(function() {
 -             // the iframes inside of the etherpad are
 -             // not yet loaded when the etherpad iframe is loaded
 -             var outer = etherpadIFrame.
 -                 contentDocument.getElementsByName("ace_outer")[0];
 -             bubbleIframeMouseMove(outer);
 -             var inner = outer.
 -                 contentDocument.getElementsByName("ace_inner")[0];
 -             bubbleIframeMouseMove(inner);
 -         }, 2000);
 -     };
 - }
 - 
 - function bubbleIframeMouseMove(iframe){
 -     var existingOnMouseMove = iframe.contentWindow.onmousemove;
 -     iframe.contentWindow.onmousemove = function(e){
 -         if(existingOnMouseMove) existingOnMouseMove(e);
 -         var evt = document.createEvent("MouseEvents");
 -         var boundingClientRect = iframe.getBoundingClientRect();
 -         evt.initMouseEvent(
 -             "mousemove",
 -             true, // bubbles
 -             false, // not cancelable
 -             window,
 -             e.detail,
 -             e.screenX,
 -             e.screenY,
 -                 e.clientX + boundingClientRect.left,
 -                 e.clientY + boundingClientRect.top,
 -             e.ctrlKey,
 -             e.altKey,
 -             e.shiftKey,
 -             e.metaKey,
 -             e.button,
 -             null // no related element
 -         );
 -         iframe.dispatchEvent(evt);
 -     };
 - }
 - 
 - 
 - /**
 -  * On video selected event.
 -  */
 - $(document).bind('video.selected', function (event, isPresentation) {
 -     if (config.etherpad_base && etherpadIFrame && etherpadIFrame.style.visibility !== 'hidden')
 -         Etherpad.toggleEtherpad(isPresentation);
 - });
 - 
 - 
 - var Etherpad = {
 -     /**
 -      * Initializes the etherpad.
 -      */
 -     init: function (name) {
 - 
 -         if (config.etherpad_base && !etherpadName) {
 - 
 -             domain = config.etherpad_base;
 - 
 -             if (!name) {
 -                 // In case we're the focus we generate the name.
 -                 etherpadName = Math.random().toString(36).substring(7) +
 -                                 '_' + (new Date().getTime()).toString();
 -                 shareEtherpad();
 -             }
 -             else
 -                 etherpadName = name;
 - 
 -             enableEtherpadButton();
 - 
 -             /**
 -              * Resizes the etherpad, when the window is resized.
 -              */
 -             $(window).resize(function () {
 -                 resize();
 -             });
 -         }
 -     },
 - 
 -     /**
 -      * Opens/hides the Etherpad.
 -      */
 -     toggleEtherpad: function (isPresentation) {
 -         if (!etherpadIFrame)
 -             createIFrame();
 - 
 -         var largeVideo = null;
 -         if (Prezi.isPresentationVisible())
 -             largeVideo = $('#presentation>iframe');
 -         else
 -             largeVideo = $('#largeVideo');
 - 
 -         if ($('#etherpad>iframe').css('visibility') === 'hidden') {
 -             $('#activeSpeaker').css('visibility', 'hidden');
 -             largeVideo.fadeOut(300, function () {
 -                 if (Prezi.isPresentationVisible()) {
 -                     largeVideo.css({opacity: '0'});
 -                 } else {
 -                     VideoLayout.setLargeVideoVisible(false);
 -                 }
 -             });
 - 
 -             $('#etherpad>iframe').fadeIn(300, function () {
 -                 document.body.style.background = '#eeeeee';
 -                 $('#etherpad>iframe').css({visibility: 'visible'});
 -                 $('#etherpad').css({zIndex: 2});
 -             });
 -         }
 -         else if ($('#etherpad>iframe')) {
 -             $('#etherpad>iframe').fadeOut(300, function () {
 -                 $('#etherpad>iframe').css({visibility: 'hidden'});
 -                 $('#etherpad').css({zIndex: 0});
 -                 document.body.style.background = 'black';
 -             });
 - 
 -             if (!isPresentation) {
 -                 $('#largeVideo').fadeIn(300, function () {
 -                     VideoLayout.setLargeVideoVisible(true);
 -                 });
 -             }
 -         }
 -         resize();
 -     },
 - 
 -     isVisible: function() {
 -         var etherpadIframe = $('#etherpad>iframe');
 -         return etherpadIframe && etherpadIframe.is(':visible');
 -     }
 - 
 - };
 - 
 - module.exports = Etherpad;
 - 
 - },{"../prezi/Prezi":6,"../util/UIUtil":21,"../videolayout/VideoLayout":23}],6:[function(require,module,exports){
 - var ToolbarToggler = require("../toolbars/ToolbarToggler");
 - var UIUtil = require("../util/UIUtil");
 - var VideoLayout = require("../videolayout/VideoLayout");
 - var messageHandler = require("../util/MessageHandler");
 - 
 - var preziPlayer = null;
 - 
 - var Prezi = {
 - 
 - 
 -     /**
 -      * Reloads the current presentation.
 -      */
 -     reloadPresentation: function() {
 -         var iframe = document.getElementById(preziPlayer.options.preziId);
 -         iframe.src = iframe.src;
 -     },
 - 
 -     /**
 -      * Returns <tt>true</tt> if the presentation is visible, <tt>false</tt> -
 -      * otherwise.
 -      */
 -     isPresentationVisible: function () {
 -         return ($('#presentation>iframe') != null
 -                 && $('#presentation>iframe').css('opacity') == 1);
 -     },
 - 
 -     /**
 -      * Opens the Prezi dialog, from which the user could choose a presentation
 -      * to load.
 -      */
 -     openPreziDialog: function() {
 -         var myprezi = connection.emuc.getPrezi(connection.emuc.myroomjid);
 -         if (myprezi) {
 -             messageHandler.openTwoButtonDialog("Remove Prezi",
 -                 "Are you sure you would like to remove your Prezi?",
 -                 false,
 -                 "Remove",
 -                 function(e,v,m,f) {
 -                     if(v) {
 -                         connection.emuc.removePreziFromPresence();
 -                         connection.emuc.sendPresence();
 -                     }
 -                 }
 -             );
 -         }
 -         else if (preziPlayer != null) {
 -             messageHandler.openTwoButtonDialog("Share a Prezi",
 -                 "Another participant is already sharing a Prezi." +
 -                     "This conference allows only one Prezi at a time.",
 -                 false,
 -                 "Ok",
 -                 function(e,v,m,f) {
 -                     $.prompt.close();
 -                 }
 -             );
 -         }
 -         else {
 -             var openPreziState = {
 -                 state0: {
 -                     html:   '<h2>Share a Prezi</h2>' +
 -                             '<input id="preziUrl" type="text" ' +
 -                             'placeholder="e.g. ' +
 -                             'http://prezi.com/wz7vhjycl7e6/my-prezi" autofocus>',
 -                     persistent: false,
 -                     buttons: { "Share": true , "Cancel": false},
 -                     defaultButton: 1,
 -                     submit: function(e,v,m,f){
 -                         e.preventDefault();
 -                         if(v)
 -                         {
 -                             var preziUrl = document.getElementById('preziUrl');
 - 
 -                             if (preziUrl.value)
 -                             {
 -                                 var urlValue
 -                                     = encodeURI(Util.escapeHtml(preziUrl.value));
 - 
 -                                 if (urlValue.indexOf('http://prezi.com/') != 0
 -                                     && urlValue.indexOf('https://prezi.com/') != 0)
 -                                 {
 -                                     $.prompt.goToState('state1');
 -                                     return false;
 -                                 }
 -                                 else {
 -                                     var presIdTmp = urlValue.substring(
 -                                             urlValue.indexOf("prezi.com/") + 10);
 -                                     if (!isAlphanumeric(presIdTmp)
 -                                             || presIdTmp.indexOf('/') < 2) {
 -                                         $.prompt.goToState('state1');
 -                                         return false;
 -                                     }
 -                                     else {
 -                                         connection.emuc
 -                                             .addPreziToPresence(urlValue, 0);
 -                                         connection.emuc.sendPresence();
 -                                         $.prompt.close();
 -                                     }
 -                                 }
 -                             }
 -                         }
 -                         else
 -                             $.prompt.close();
 -                     }
 -                 },
 -                 state1: {
 -                     html:   '<h2>Share a Prezi</h2>' +
 -                             'Please provide a correct prezi link.',
 -                     persistent: false,
 -                     buttons: { "Back": true, "Cancel": false },
 -                     defaultButton: 1,
 -                     submit:function(e,v,m,f) {
 -                         e.preventDefault();
 -                         if(v==0)
 -                             $.prompt.close();
 -                         else
 -                             $.prompt.goToState('state0');
 -                     }
 -                 }
 -             };
 -             var focusPreziUrl =  function(e) {
 -                     document.getElementById('preziUrl').focus();
 -                 };
 -             messageHandler.openDialogWithStates(openPreziState, focusPreziUrl, focusPreziUrl);
 -         }
 -     }
 - 
 - };
 - 
 - /**
 -  * A new presentation has been added.
 -  *
 -  * @param event the event indicating the add of a presentation
 -  * @param jid the jid from which the presentation was added
 -  * @param presUrl url of the presentation
 -  * @param currentSlide the current slide to which we should move
 -  */
 - function presentationAdded(event, jid, presUrl, currentSlide) {
 -     console.log("presentation added", presUrl);
 - 
 -     var presId = getPresentationId(presUrl);
 - 
 -     var elementId = 'participant_'
 -         + Strophe.getResourceFromJid(jid)
 -         + '_' + presId;
 - 
 -     // We explicitly don't specify the peer jid here, because we don't want
 -     // this video to be dealt with as a peer related one (for example we
 -     // don't want to show a mute/kick menu for this one, etc.).
 -     VideoLayout.addRemoteVideoContainer(null, elementId);
 -     VideoLayout.resizeThumbnails();
 - 
 -     var controlsEnabled = false;
 -     if (jid === connection.emuc.myroomjid)
 -         controlsEnabled = true;
 - 
 -     setPresentationVisible(true);
 -     $('#largeVideoContainer').hover(
 -         function (event) {
 -             if (Prezi.isPresentationVisible()) {
 -                 var reloadButtonRight = window.innerWidth
 -                     - $('#presentation>iframe').offset().left
 -                     - $('#presentation>iframe').width();
 - 
 -                 $('#reloadPresentation').css({  right: reloadButtonRight,
 -                     display:'inline-block'});
 -             }
 -         },
 -         function (event) {
 -             if (!Prezi.isPresentationVisible())
 -                 $('#reloadPresentation').css({display:'none'});
 -             else {
 -                 var e = event.toElement || event.relatedTarget;
 - 
 -                 if (e && e.id != 'reloadPresentation' && e.id != 'header')
 -                     $('#reloadPresentation').css({display:'none'});
 -             }
 -         });
 - 
 -     preziPlayer = new PreziPlayer(
 -         'presentation',
 -         {preziId: presId,
 -             width: getPresentationWidth(),
 -             height: getPresentationHeihgt(),
 -             controls: controlsEnabled,
 -             debug: true
 -         });
 - 
 -     $('#presentation>iframe').attr('id', preziPlayer.options.preziId);
 - 
 -     preziPlayer.on(PreziPlayer.EVENT_STATUS, function(event) {
 -         console.log("prezi status", event.value);
 -         if (event.value == PreziPlayer.STATUS_CONTENT_READY) {
 -             if (jid != connection.emuc.myroomjid)
 -                 preziPlayer.flyToStep(currentSlide);
 -         }
 -     });
 - 
 -     preziPlayer.on(PreziPlayer.EVENT_CURRENT_STEP, function(event) {
 -         console.log("event value", event.value);
 -         connection.emuc.addCurrentSlideToPresence(event.value);
 -         connection.emuc.sendPresence();
 -     });
 - 
 -     $("#" + elementId).css( 'background-image',
 -         'url(../images/avatarprezi.png)');
 -     $("#" + elementId).click(
 -         function () {
 -             setPresentationVisible(true);
 -         }
 -     );
 - };
 - 
 - /**
 -  * A presentation has been removed.
 -  *
 -  * @param event the event indicating the remove of a presentation
 -  * @param jid the jid for which the presentation was removed
 -  * @param the url of the presentation
 -  */
 - function presentationRemoved(event, jid, presUrl) {
 -     console.log('presentation removed', presUrl);
 -     var presId = getPresentationId(presUrl);
 -     setPresentationVisible(false);
 -     $('#participant_'
 -         + Strophe.getResourceFromJid(jid)
 -         + '_' + presId).remove();
 -     $('#presentation>iframe').remove();
 -     if (preziPlayer != null) {
 -         preziPlayer.destroy();
 -         preziPlayer = null;
 -     }
 - };
 - 
 - /**
 -  * Indicates if the given string is an alphanumeric string.
 -  * Note that some special characters are also allowed (-, _ , /, &, ?, =, ;) for the
 -  * purpose of checking URIs.
 -  */
 - function isAlphanumeric(unsafeText) {
 -     var regex = /^[a-z0-9-_\/&\?=;]+$/i;
 -     return regex.test(unsafeText);
 - }
 - 
 - /**
 -  * Returns the presentation id from the given url.
 -  */
 - function getPresentationId (presUrl) {
 -     var presIdTmp = presUrl.substring(presUrl.indexOf("prezi.com/") + 10);
 -     return presIdTmp.substring(0, presIdTmp.indexOf('/'));
 - }
 - 
 - /**
 -  * Returns the presentation width.
 -  */
 - function getPresentationWidth() {
 -     var availableWidth = UIUtil.getAvailableVideoWidth();
 -     var availableHeight = getPresentationHeihgt();
 - 
 -     var aspectRatio = 16.0 / 9.0;
 -     if (availableHeight < availableWidth / aspectRatio) {
 -         availableWidth = Math.floor(availableHeight * aspectRatio);
 -     }
 -     return availableWidth;
 - }
 - 
 - /**
 -  * Returns the presentation height.
 -  */
 - function getPresentationHeihgt() {
 -     var remoteVideos = $('#remoteVideos');
 -     return window.innerHeight - remoteVideos.outerHeight();
 - }
 - 
 - /**
 -  * Resizes the presentation iframe.
 -  */
 - function resize() {
 -     if ($('#presentation>iframe')) {
 -         $('#presentation>iframe').width(getPresentationWidth());
 -         $('#presentation>iframe').height(getPresentationHeihgt());
 -     }
 - }
 - 
 - /**
 -  * Shows/hides a presentation.
 -  */
 - function setPresentationVisible(visible) {
 -     var prezi = $('#presentation>iframe');
 -     if (visible) {
 -         // Trigger the video.selected event to indicate a change in the
 -         // large video.
 -         $(document).trigger("video.selected", [true]);
 - 
 -         $('#largeVideo').fadeOut(300);
 -         prezi.fadeIn(300, function() {
 -             prezi.css({opacity:'1'});
 -             ToolbarToggler.dockToolbar(true);
 -             VideoLayout.setLargeVideoVisible(false);
 -         });
 -         $('#activeSpeaker').css('visibility', 'hidden');
 -     }
 -     else {
 -         if (prezi.css('opacity') == '1') {
 -             prezi.fadeOut(300, function () {
 -                 prezi.css({opacity:'0'});
 -                 $('#reloadPresentation').css({display:'none'});
 -                 $('#largeVideo').fadeIn(300, function() {
 -                     VideoLayout.setLargeVideoVisible(true);
 -                     ToolbarToggler.dockToolbar(false);
 -                 });
 -             });
 -         }
 -     }
 - }
 - 
 - /**
 -  * Presentation has been removed.
 -  */
 - $(document).bind('presentationremoved.muc', presentationRemoved);
 - 
 - /**
 -  * Presentation has been added.
 -  */
 - $(document).bind('presentationadded.muc', presentationAdded);
 - 
 - /*
 -  * Indicates presentation slide change.
 -  */
 - $(document).bind('gotoslide.muc', function (event, jid, presUrl, current) {
 -     if (preziPlayer && preziPlayer.getCurrentStep() != current) {
 -         preziPlayer.flyToStep(current);
 - 
 -         var animationStepsArray = preziPlayer.getAnimationCountOnSteps();
 -         for (var i = 0; i < parseInt(animationStepsArray[current]); i++) {
 -             preziPlayer.flyToStep(current, i);
 -         }
 -     }
 - });
 - 
 - /**
 -  * On video selected event.
 -  */
 - $(document).bind('video.selected', function (event, isPresentation) {
 -     if (!isPresentation && $('#presentation>iframe')) {
 -         setPresentationVisible(false);
 -     }
 - });
 - 
 - $(window).resize(function () {
 -     resize();
 - });
 - 
 - module.exports = Prezi;
 - 
 - },{"../toolbars/ToolbarToggler":16,"../util/MessageHandler":20,"../util/UIUtil":21,"../videolayout/VideoLayout":23}],7:[function(require,module,exports){
 - var Chat = require("./chat/Chat");
 - var ContactList = require("./contactlist/ContactList");
 - var Settings = require("./settings/Settings");
 - var SettingsMenu = require("./settings/SettingsMenu");
 - var VideoLayout = require("../videolayout/VideoLayout");
 - var ToolbarToggler = require("../toolbars/ToolbarToggler");
 - 
 - /**
 -  * Toggler for the chat, contact list, settings menu, etc..
 -  */
 - var PanelToggler = (function(my) {
 - 
 -     var currentlyOpen = null;
 -     var buttons = {
 -         '#chatspace': '#chatBottomButton',
 -         '#contactlist': '#contactListButton',
 -         '#settingsmenu': '#settingsButton'
 -     };
 - 
 -     /**
 -      * Resizes the video area
 -      * @param isClosing whether the side panel is going to be closed or is going to open / remain opened
 -      * @param completeFunction a function to be called when the video space is resized
 -      */
 -     var resizeVideoArea = function(isClosing, completeFunction) {
 -         var videospace = $('#videospace');
 - 
 -         var panelSize = isClosing ? [0, 0] : PanelToggler.getPanelSize();
 -         var videospaceWidth = window.innerWidth - panelSize[0];
 -         var videospaceHeight = window.innerHeight;
 -         var videoSize
 -             = VideoLayout.getVideoSize(null, null, videospaceWidth, videospaceHeight);
 -         var videoWidth = videoSize[0];
 -         var videoHeight = videoSize[1];
 -         var videoPosition = VideoLayout.getVideoPosition(videoWidth,
 -             videoHeight,
 -             videospaceWidth,
 -             videospaceHeight);
 -         var horizontalIndent = videoPosition[0];
 -         var verticalIndent = videoPosition[1];
 - 
 -         var thumbnailSize = VideoLayout.calculateThumbnailSize(videospaceWidth);
 -         var thumbnailsWidth = thumbnailSize[0];
 -         var thumbnailsHeight = thumbnailSize[1];
 -         //for chat
 - 
 -         videospace.animate({
 -                 right: panelSize[0],
 -                 width: videospaceWidth,
 -                 height: videospaceHeight
 -             },
 -             {
 -                 queue: false,
 -                 duration: 500,
 -                 complete: completeFunction
 -             });
 - 
 -         $('#remoteVideos').animate({
 -                 height: thumbnailsHeight
 -             },
 -             {
 -                 queue: false,
 -                 duration: 500
 -             });
 - 
 -         $('#remoteVideos>span').animate({
 -                 height: thumbnailsHeight,
 -                 width: thumbnailsWidth
 -             },
 -             {
 -                 queue: false,
 -                 duration: 500,
 -                 complete: function () {
 -                     $(document).trigger(
 -                         "remotevideo.resized",
 -                         [thumbnailsWidth,
 -                             thumbnailsHeight]);
 -                 }
 -             });
 - 
 -         $('#largeVideoContainer').animate({
 -                 width: videospaceWidth,
 -                 height: videospaceHeight
 -             },
 -             {
 -                 queue: false,
 -                 duration: 500
 -             });
 - 
 -         $('#largeVideo').animate({
 -                 width: videoWidth,
 -                 height: videoHeight,
 -                 top: verticalIndent,
 -                 bottom: verticalIndent,
 -                 left: horizontalIndent,
 -                 right: horizontalIndent
 -             },
 -             {
 -                 queue: false,
 -                 duration: 500
 -             });
 -     };
 - 
 -     /**
 -      * Toggles the windows in the side panel
 -      * @param object the window that should be shown
 -      * @param selector the selector for the element containing the panel
 -      * @param onOpenComplete function to be called when the panel is opened
 -      * @param onOpen function to be called if the window is going to be opened
 -      * @param onClose function to be called if the window is going to be closed
 -      */
 -     var toggle = function(object, selector, onOpenComplete, onOpen, onClose) {
 -         buttonClick(buttons[selector], "active");
 - 
 -         if (object.isVisible()) {
 -             $("#toast-container").animate({
 -                     right: '5px'
 -                 },
 -                 {
 -                     queue: false,
 -                     duration: 500
 -                 });
 -             $(selector).hide("slide", {
 -                 direction: "right",
 -                 queue: false,
 -                 duration: 500
 -             });
 -             if(typeof onClose === "function") {
 -                 onClose();
 -             }
 - 
 -             currentlyOpen = null;
 -         }
 -         else {
 -             // Undock the toolbar when the chat is shown and if we're in a
 -             // video mode.
 -             if (VideoLayout.isLargeVideoVisible()) {
 -                 ToolbarToggler.dockToolbar(false);
 -             }
 - 
 -             if(currentlyOpen) {
 -                 var current = $(currentlyOpen);
 -                 buttonClick(buttons[currentlyOpen], "active");
 -                 current.css('z-index', 4);
 -                 setTimeout(function () {
 -                     current.css('display', 'none');
 -                     current.css('z-index', 5);
 -                 }, 500);
 -             }
 - 
 -             $("#toast-container").animate({
 -                     right: (PanelToggler.getPanelSize()[0] + 5) + 'px'
 -                 },
 -                 {
 -                     queue: false,
 -                     duration: 500
 -                 });
 -             $(selector).show("slide", {
 -                 direction: "right",
 -                 queue: false,
 -                 duration: 500,
 -                 complete: onOpenComplete
 -             });
 -             if(typeof onOpen === "function") {
 -                 onOpen();
 -             }
 - 
 -             currentlyOpen = selector;
 -         }
 -     };
 - 
 -     /**
 -      * Opens / closes the chat area.
 -      */
 -     my.toggleChat = function() {
 -         var chatCompleteFunction = Chat.isVisible() ?
 -             function() {} : function () {
 -             Chat.scrollChatToBottom();
 -             $('#chatspace').trigger('shown');
 -         };
 - 
 -         resizeVideoArea(Chat.isVisible(), chatCompleteFunction);
 - 
 -         toggle(Chat,
 -             '#chatspace',
 -             function () {
 -                 // Request the focus in the nickname field or the chat input field.
 -                 if ($('#nickname').css('visibility') === 'visible') {
 -                     $('#nickinput').focus();
 -                 } else {
 -                     $('#usermsg').focus();
 -                 }
 -             },
 -             null,
 -             Chat.resizeChat,
 -             null);
 -     };
 - 
 -     /**
 -      * Opens / closes the contact list area.
 -      */
 -     my.toggleContactList = function () {
 -         var completeFunction = ContactList.isVisible() ?
 -             function() {} : function () { $('#contactlist').trigger('shown');};
 -         resizeVideoArea(ContactList.isVisible(), completeFunction);
 - 
 -         toggle(ContactList,
 -             '#contactlist',
 -             null,
 -             function() {
 -                 ContactList.setVisualNotification(false);
 -             },
 -             null);
 -     };
 - 
 -     /**
 -      * Opens / closes the settings menu
 -      */
 -     my.toggleSettingsMenu = function() {
 -         resizeVideoArea(SettingsMenu.isVisible(), function (){});
 -         toggle(SettingsMenu,
 -             '#settingsmenu',
 -             null,
 -             function() {
 -                 var settings = Settings.getSettings();
 -                 $('#setDisplayName').get(0).value = settings.displayName;
 -                 $('#setEmail').get(0).value = settings.email;
 -             },
 -             null);
 -     };
 - 
 -     /**
 -      * Returns the size of the side panel.
 -      */
 -     my.getPanelSize = function () {
 -         var availableHeight = window.innerHeight;
 -         var availableWidth = window.innerWidth;
 - 
 -         var panelWidth = 200;
 -         if (availableWidth * 0.2 < 200) {
 -             panelWidth = availableWidth * 0.2;
 -         }
 - 
 -         return [panelWidth, availableHeight];
 -     };
 - 
 -     my.isVisible = function() {
 -         return (Chat.isVisible() || ContactList.isVisible() || SettingsMenu.isVisible());
 -     };
 - 
 -     return my;
 - 
 - }(PanelToggler || {}));
 - 
 - module.exports = PanelToggler;
 - },{"../toolbars/ToolbarToggler":16,"../videolayout/VideoLayout":23,"./chat/Chat":8,"./contactlist/ContactList":12,"./settings/Settings":13,"./settings/SettingsMenu":14}],8:[function(require,module,exports){
 - /* global $, Util, connection, nickname:true, showToolbar */
 - var Replacement = require("./Replacement");
 - var CommandsProcessor = require("./Commands");
 - var ToolbarToggler = require("../../toolbars/ToolbarToggler");
 - var smileys = require("./smileys.json").smileys;
 - 
 - var notificationInterval = false;
 - var unreadMessages = 0;
 - 
 - 
 - /**
 -  * Shows/hides a visual notification, indicating that a message has arrived.
 -  */
 - function setVisualNotification(show) {
 -     var unreadMsgElement = document.getElementById('unreadMessages');
 -     var unreadMsgBottomElement
 -         = document.getElementById('bottomUnreadMessages');
 - 
 -     var glower = $('#chatButton');
 -     var bottomGlower = $('#chatBottomButton');
 - 
 -     if (unreadMessages) {
 -         unreadMsgElement.innerHTML = unreadMessages.toString();
 -         unreadMsgBottomElement.innerHTML = unreadMessages.toString();
 - 
 -         ToolbarToggler.dockToolbar(true);
 - 
 -         var chatButtonElement
 -             = document.getElementById('chatButton').parentNode;
 -         var leftIndent = (Util.getTextWidth(chatButtonElement) -
 -             Util.getTextWidth(unreadMsgElement)) / 2;
 -         var topIndent = (Util.getTextHeight(chatButtonElement) -
 -             Util.getTextHeight(unreadMsgElement)) / 2 - 3;
 - 
 -         unreadMsgElement.setAttribute(
 -             'style',
 -                 'top:' + topIndent +
 -                 '; left:' + leftIndent + ';');
 - 
 -         var chatBottomButtonElement
 -             = document.getElementById('chatBottomButton').parentNode;
 -         var bottomLeftIndent = (Util.getTextWidth(chatBottomButtonElement) -
 -             Util.getTextWidth(unreadMsgBottomElement)) / 2;
 -         var bottomTopIndent = (Util.getTextHeight(chatBottomButtonElement) -
 -             Util.getTextHeight(unreadMsgBottomElement)) / 2 - 2;
 - 
 -         unreadMsgBottomElement.setAttribute(
 -             'style',
 -                 'top:' + bottomTopIndent +
 -                 '; left:' + bottomLeftIndent + ';');
 - 
 - 
 -         if (!glower.hasClass('icon-chat-simple')) {
 -             glower.removeClass('icon-chat');
 -             glower.addClass('icon-chat-simple');
 -         }
 -     }
 -     else {
 -         unreadMsgElement.innerHTML = '';
 -         unreadMsgBottomElement.innerHTML = '';
 -         glower.removeClass('icon-chat-simple');
 -         glower.addClass('icon-chat');
 -     }
 - 
 -     if (show && !notificationInterval) {
 -         notificationInterval = window.setInterval(function () {
 -             glower.toggleClass('active');
 -             bottomGlower.toggleClass('active glowing');
 -         }, 800);
 -     }
 -     else if (!show && notificationInterval) {
 -         window.clearInterval(notificationInterval);
 -         notificationInterval = false;
 -         glower.removeClass('active');
 -         bottomGlower.removeClass('glowing');
 -         bottomGlower.addClass('active');
 -     }
 - }
 - 
 - 
 - /**
 -  * Returns the current time in the format it is shown to the user
 -  * @returns {string}
 -  */
 - function getCurrentTime() {
 -     var now     = new Date();
 -     var hour    = now.getHours();
 -     var minute  = now.getMinutes();
 -     var second  = now.getSeconds();
 -     if(hour.toString().length === 1) {
 -         hour = '0'+hour;
 -     }
 -     if(minute.toString().length === 1) {
 -         minute = '0'+minute;
 -     }
 -     if(second.toString().length === 1) {
 -         second = '0'+second;
 -     }
 -     return hour+':'+minute+':'+second;
 - }
 - 
 - function toggleSmileys()
 - {
 -     var smileys = $('#smileysContainer');
 -     if(!smileys.is(':visible')) {
 -         smileys.show("slide", { direction: "down", duration: 300});
 -     } else {
 -         smileys.hide("slide", { direction: "down", duration: 300});
 -     }
 -     $('#usermsg').focus();
 - }
 - 
 - function addClickFunction(smiley, number) {
 -     smiley.onclick = function addSmileyToMessage() {
 -         var usermsg = $('#usermsg');
 -         var message = usermsg.val();
 -         message += smileys['smiley' + number];
 -         usermsg.val(message);
 -         usermsg.get(0).setSelectionRange(message.length, message.length);
 -         toggleSmileys();
 -         usermsg.focus();
 -     };
 - }
 - 
 - /**
 -  * Adds the smileys container to the chat
 -  */
 - function addSmileys() {
 -     var smileysContainer = document.createElement('div');
 -     smileysContainer.id = 'smileysContainer';
 -     for(var i = 1; i <= 21; i++) {
 -         var smileyContainer = document.createElement('div');
 -         smileyContainer.id = 'smiley' + i;
 -         smileyContainer.className = 'smileyContainer';
 -         var smiley = document.createElement('img');
 -         smiley.src = 'images/smileys/smiley' + i + '.svg';
 -         smiley.className =  'smiley';
 -         addClickFunction(smiley, i);
 -         smileyContainer.appendChild(smiley);
 -         smileysContainer.appendChild(smileyContainer);
 -     }
 - 
 -     $("#chatspace").append(smileysContainer);
 - }
 - 
 - /**
 -  * Resizes the chat conversation.
 -  */
 - function resizeChatConversation() {
 -     var msgareaHeight = $('#usermsg').outerHeight();
 -     var chatspace = $('#chatspace');
 -     var width = chatspace.width();
 -     var chat = $('#chatconversation');
 -     var smileys = $('#smileysarea');
 - 
 -     smileys.height(msgareaHeight);
 -     $("#smileys").css('bottom', (msgareaHeight - 26) / 2);
 -     $('#smileysContainer').css('bottom', msgareaHeight);
 -     chat.width(width - 10);
 -     chat.height(window.innerHeight - 15 - msgareaHeight);
 - }
 - 
 - /**
 -  * Chat related user interface.
 -  */
 - var Chat = (function (my) {
 -     /**
 -      * Initializes chat related interface.
 -      */
 -     my.init = function () {
 -         var storedDisplayName = window.localStorage.displayname;
 -         if (storedDisplayName) {
 -             nickname = storedDisplayName;
 - 
 -             Chat.setChatConversationMode(true);
 -         }
 - 
 -         $('#nickinput').keydown(function (event) {
 -             if (event.keyCode === 13) {
 -                 event.preventDefault();
 -                 var val = Util.escapeHtml(this.value);
 -                 this.value = '';
 -                 if (!nickname) {
 -                     nickname = val;
 -                     window.localStorage.displayname = nickname;
 - 
 -                     connection.emuc.addDisplayNameToPresence(nickname);
 -                     connection.emuc.sendPresence();
 - 
 -                     Chat.setChatConversationMode(true);
 - 
 -                     return;
 -                 }
 -             }
 -         });
 - 
 -         $('#usermsg').keydown(function (event) {
 -             if (event.keyCode === 13) {
 -                 event.preventDefault();
 -                 var value = this.value;
 -                 $('#usermsg').val('').trigger('autosize.resize');
 -                 this.focus();
 -                 var command = new CommandsProcessor(value);
 -                 if(command.isCommand())
 -                 {
 -                     command.processCommand();
 -                 }
 -                 else
 -                 {
 -                     var message = Util.escapeHtml(value);
 -                     connection.emuc.sendMessage(message, nickname);
 -                 }
 -             }
 -         });
 - 
 -         var onTextAreaResize = function () {
 -             resizeChatConversation();
 -             Chat.scrollChatToBottom();
 -         };
 -         $('#usermsg').autosize({callback: onTextAreaResize});
 - 
 -         $("#chatspace").bind("shown",
 -             function () {
 -                 unreadMessages = 0;
 -                 setVisualNotification(false);
 -             });
 - 
 -         addSmileys();
 -     };
 - 
 -     /**
 -      * Appends the given message to the chat conversation.
 -      */
 -     my.updateChatConversation = function (from, displayName, message) {
 -         var divClassName = '';
 - 
 -         if (connection.emuc.myroomjid === from) {
 -             divClassName = "localuser";
 -         }
 -         else {
 -             divClassName = "remoteuser";
 - 
 -             if (!Chat.isVisible()) {
 -                 unreadMessages++;
 -                 Util.playSoundNotification('chatNotification');
 -                 setVisualNotification(true);
 -             }
 -         }
 - 
 -         // replace links and smileys
 -         // Strophe already escapes special symbols on sending,
 -         // so we escape here only tags to avoid double &
 -         var escMessage = message.replace(/</g, '<').
 -             replace(/>/g, '>').replace(/\n/g, '<br/>');
 -         var escDisplayName = Util.escapeHtml(displayName);
 -         message = Replacement.processReplacements(escMessage);
 - 
 -         var messageContainer =
 -             '<div class="chatmessage">'+
 -                 '<img src="../images/chatArrow.svg" class="chatArrow">' +
 -                 '<div class="username ' + divClassName +'">' + escDisplayName +
 -                 '</div>' + '<div class="timestamp">' + getCurrentTime() +
 -                 '</div>' + '<div class="usermessage">' + message + '</div>' +
 -             '</div>';
 - 
 -         $('#chatconversation').append(messageContainer);
 -         $('#chatconversation').animate(
 -                 { scrollTop: $('#chatconversation')[0].scrollHeight}, 1000);
 -     };
 - 
 -     /**
 -      * Appends error message to the conversation
 -      * @param errorMessage the received error message.
 -      * @param originalText the original message.
 -      */
 -     my.chatAddError = function(errorMessage, originalText)
 -     {
 -         errorMessage = Util.escapeHtml(errorMessage);
 -         originalText = Util.escapeHtml(originalText);
 - 
 -         $('#chatconversation').append(
 -             '<div class="errorMessage"><b>Error: </b>' + 'Your message' +
 -             (originalText? (' \"'+ originalText + '\"') : "") +
 -             ' was not sent.' +
 -             (errorMessage? (' Reason: ' + errorMessage) : '') +  '</div>');
 -         $('#chatconversation').animate(
 -             { scrollTop: $('#chatconversation')[0].scrollHeight}, 1000);
 -     };
 - 
 -     /**
 -      * Sets the subject to the UI
 -      * @param subject the subject
 -      */
 -     my.chatSetSubject = function(subject)
 -     {
 -         if(subject)
 -             subject = subject.trim();
 -         $('#subject').html(Replacement.linkify(Util.escapeHtml(subject)));
 -         if(subject === "")
 -         {
 -             $("#subject").css({display: "none"});
 -         }
 -         else
 -         {
 -             $("#subject").css({display: "block"});
 -         }
 -     };
 - 
 - 
 - 
 -     /**
 -      * Sets the chat conversation mode.
 -      */
 -     my.setChatConversationMode = function (isConversationMode) {
 -         if (isConversationMode) {
 -             $('#nickname').css({visibility: 'hidden'});
 -             $('#chatconversation').css({visibility: 'visible'});
 -             $('#usermsg').css({visibility: 'visible'});
 -             $('#smileysarea').css({visibility: 'visible'});
 -             $('#usermsg').focus();
 -         }
 -     };
 - 
 -     /**
 -      * Resizes the chat area.
 -      */
 -     my.resizeChat = function () {
 -         var chatSize = require("../SidePanelToggler").getPanelSize();
 - 
 -         $('#chatspace').width(chatSize[0]);
 -         $('#chatspace').height(chatSize[1]);
 - 
 -         resizeChatConversation();
 -     };
 - 
 -     /**
 -      * Indicates if the chat is currently visible.
 -      */
 -     my.isVisible = function () {
 -         return $('#chatspace').is(":visible");
 -     };
 -     /**
 -      * Shows and hides the window with the smileys
 -      */
 -     my.toggleSmileys = toggleSmileys;
 - 
 -     /**
 -      * Scrolls chat to the bottom.
 -      */
 -     my.scrollChatToBottom = function() {
 -         setTimeout(function () {
 -             $('#chatconversation').scrollTop(
 -                 $('#chatconversation')[0].scrollHeight);
 -         }, 5);
 -     };
 - 
 - 
 -     return my;
 - }(Chat || {}));
 - module.exports = Chat;
 - },{"../../toolbars/ToolbarToggler":16,"../SidePanelToggler":7,"./Commands":9,"./Replacement":10,"./smileys.json":11}],9:[function(require,module,exports){
 - /**
 -  * List with supported commands. The keys are the names of the commands and
 -  * the value is the function that processes the message.
 -  * @type {{String: function}}
 -  */
 - var commands = {
 -     "topic" : processTopic
 - };
 - 
 - /**
 -  * Extracts the command from the message.
 -  * @param message the received message
 -  * @returns {string} the command
 -  */
 - function getCommand(message)
 - {
 -     if(message)
 -     {
 -         for(var command in commands)
 -         {
 -             if(message.indexOf("/" + command) == 0)
 -                 return command;
 -         }
 -     }
 -     return "";
 - };
 - 
 - /**
 -  * Processes the data for topic command.
 -  * @param commandArguments the arguments of the topic command.
 -  */
 - function processTopic(commandArguments)
 - {
 -     var topic = Util.escapeHtml(commandArguments);
 -     connection.emuc.setSubject(topic);
 - }
 - 
 - /**
 -  * Constructs new CommandProccessor instance from a message that
 -  * handles commands received via chat messages.
 -  * @param message the message
 -  * @constructor
 -  */
 - function CommandsProcessor(message)
 - {
 - 
 - 
 -     var command = getCommand(message);
 - 
 -     /**
 -      * Returns the name of the command.
 -      * @returns {String} the command
 -      */
 -     this.getCommand = function()
 -     {
 -         return command;
 -     };
 - 
 - 
 -     var messageArgument = message.substr(command.length + 2);
 - 
 -     /**
 -      * Returns the arguments of the command.
 -      * @returns {string}
 -      */
 -     this.getArgument = function()
 -     {
 -         return messageArgument;
 -     };
 - }
 - 
 - /**
 -  * Checks whether this instance is valid command or not.
 -  * @returns {boolean}
 -  */
 - CommandsProcessor.prototype.isCommand = function()
 - {
 -     if(this.getCommand())
 -         return true;
 -     return false;
 - };
 - 
 - /**
 -  * Processes the command.
 -  */
 - CommandsProcessor.prototype.processCommand = function()
 - {
 -     if(!this.isCommand())
 -         return;
 - 
 -     commands[this.getCommand()](this.getArgument());
 - 
 - };
 - 
 - module.exports = CommandsProcessor;
 - },{}],10:[function(require,module,exports){
 - var Smileys = require("./smileys.json");
 - /**
 -  * Processes links and smileys in "body"
 -  */
 - function processReplacements(body)
 - {
 -     //make links clickable
 -     body = linkify(body);
 - 
 -     //add smileys
 -     body = smilify(body);
 - 
 -     return body;
 - }
 - 
 - /**
 -  * Finds and replaces all links in the links in "body"
 -  * with their <a href=""></a>
 -  */
 - function linkify(inputText)
 - {
 -     var replacedText, replacePattern1, replacePattern2, replacePattern3;
 - 
 -     //URLs starting with http://, https://, or ftp://
 -     replacePattern1 = /(\b(https?|ftp):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/gim;
 -     replacedText = inputText.replace(replacePattern1, '<a href="$1" target="_blank">$1</a>');
 - 
 -     //URLs starting with "www." (without // before it, or it'd re-link the ones done above).
 -     replacePattern2 = /(^|[^\/])(www\.[\S]+(\b|$))/gim;
 -     replacedText = replacedText.replace(replacePattern2, '$1<a href="http://$2" target="_blank">$2</a>');
 - 
 -     //Change email addresses to mailto:: links.
 -     replacePattern3 = /(([a-zA-Z0-9\-\_\.])+@[a-zA-Z\_]+?(\.[a-zA-Z]{2,6})+)/gim;
 -     replacedText = replacedText.replace(replacePattern3, '<a href="mailto:$1">$1</a>');
 - 
 -     return replacedText;
 - }
 - 
 - /**
 -  * Replaces common smiley strings with images
 -  */
 - function smilify(body)
 - {
 -     if(!body) {
 -         return body;
 -     }
 - 
 -     var regexs = Smileys["regexs"];
 -     for(var smiley in regexs) {
 -         if(regexs.hasOwnProperty(smiley)) {
 -             body = body.replace(regexs[smiley],
 -                     '<img class="smiley" src="images/smileys/' + smiley + '.svg">');
 -         }
 -     }
 - 
 -     return body;
 - }
 - 
 - module.exports = {
 -     processReplacements: processReplacements,
 -     linkify: linkify
 - };
 - 
 - },{"./smileys.json":11}],11:[function(require,module,exports){
 - module.exports={
 -     "smileys": {
 -         "smiley1": ":)",
 -         "smiley2": ":(",
 -         "smiley3": ":D",
 -         "smiley4": "(y)",
 -         "smiley5": " :P",
 -         "smiley6": "(wave)",
 -         "smiley7": "(blush)",
 -         "smiley8": "(chuckle)",
 -         "smiley9": "(shocked)",
 -         "smiley10": ":*",
 -         "smiley11": "(n)",
 -         "smiley12": "(search)",
 -         "smiley13": " <3",
 -         "smiley14": "(oops)",
 -         "smiley15": "(angry)",
 -         "smiley16": "(angel)",
 -         "smiley17": "(sick)",
 -         "smiley18": ";(",
 -         "smiley19": "(bomb)",
 -         "smiley20": "(clap)",
 -         "smiley21": " ;)"
 -     },
 -     "regexs": {
 -         "smiley2": /(:-\(\(|:-\(|:\(\(|:\(|\(sad\))/gi,
 -         "smiley3": /(:-\)\)|:\)\)|\(lol\)|:-D|:D)/gi,
 -         "smiley1": /(:-\)|:\))/gi,
 -         "smiley4": /(\(y\)|\(Y\)|\(ok\))/gi,
 -         "smiley5": /(:-P|:P|:-p|:p)/gi,
 -         "smiley6": /(\(wave\))/gi,
 -         "smiley7": /(\(blush\))/gi,
 -         "smiley8": /(\(chuckle\))/gi,
 -         "smiley9": /(:-0|\(shocked\))/gi,
 -         "smiley10": /(:-\*|:\*|\(kiss\))/gi,
 -         "smiley11": /(\(n\))/gi,
 -         "smiley12": /(\(search\))/g,
 -         "smiley13": /(<3|<3|&lt;3|\(L\)|\(l\)|\(H\)|\(h\))/gi,
 -         "smiley14": /(\(oops\))/gi,
 -         "smiley15": /(\(angry\))/gi,
 -         "smiley16": /(\(angel\))/gi,
 -         "smiley17": /(\(sick\))/gi,
 -         "smiley18": /(;-\(\(|;\(\(|;-\(|;\(|:"\(|:"-\(|:~-\(|:~\(|\(upset\))/gi,
 -         "smiley19": /(\(bomb\))/gi,
 -         "smiley20": /(\(clap\))/gi,
 -         "smiley21": /(;-\)|;\)|;-\)\)|;\)\)|;-D|;D|\(wink\))/gi
 -     }
 - }
 - 
 - },{}],12:[function(require,module,exports){
 - 
 - var numberOfContacts = 0;
 - var notificationInterval;
 - 
 - /**
 -  * Updates the number of participants in the contact list button and sets
 -  * the glow
 -  * @param delta indicates whether a new user has joined (1) or someone has
 -  * left(-1)
 -  */
 - function updateNumberOfParticipants(delta) {
 -     //when the user is alone we don't show the number of participants
 -     if(numberOfContacts === 0) {
 -         $("#numberOfParticipants").text('');
 -         numberOfContacts += delta;
 -     } else if(numberOfContacts !== 0 && !ContactList.isVisible()) {
 -         ContactList.setVisualNotification(true);
 -         numberOfContacts += delta;
 -         $("#numberOfParticipants").text(numberOfContacts);
 -     }
 - }
 - 
 - /**
 -  * Creates the avatar element.
 -  *
 -  * @return the newly created avatar element
 -  */
 - function createAvatar(id) {
 -     var avatar = document.createElement('img');
 -     avatar.className = "icon-avatar avatar";
 -     avatar.src = "https://www.gravatar.com/avatar/" + id + "?d=wavatar&size=30";
 - 
 -     return avatar;
 - }
 - 
 - /**
 -  * Creates the display name paragraph.
 -  *
 -  * @param displayName the display name to set
 -  */
 - function createDisplayNameParagraph(displayName) {
 -     var p = document.createElement('p');
 -     p.innerText = displayName;
 - 
 -     return p;
 - }
 - 
 - 
 - /**
 -  * Indicates that the display name has changed.
 -  */
 - $(document).bind(   'displaynamechanged',
 -     function (event, peerJid, displayName) {
 -         if (peerJid === 'localVideoContainer')
 -             peerJid = connection.emuc.myroomjid;
 - 
 -         var resourceJid = Strophe.getResourceFromJid(peerJid);
 - 
 -         var contactName = $('#contactlist #' + resourceJid + '>p');
 - 
 -         if (contactName && displayName && displayName.length > 0)
 -             contactName.html(displayName);
 -     });
 - 
 - 
 - function stopGlowing(glower) {
 -     window.clearInterval(notificationInterval);
 -     notificationInterval = false;
 -     glower.removeClass('glowing');
 -     if (!ContactList.isVisible()) {
 -         glower.removeClass('active');
 -     }
 - }
 - 
 - 
 - /**
 -  * Contact list.
 -  */
 - var ContactList = {
 -     /**
 -      * Indicates if the chat is currently visible.
 -      *
 -      * @return <tt>true</tt> if the chat is currently visible, <tt>false</tt> -
 -      * otherwise
 -      */
 -     isVisible: function () {
 -         return $('#contactlist').is(":visible");
 -     },
 - 
 -     /**
 -      * Adds a contact for the given peerJid if such doesn't yet exist.
 -      *
 -      * @param peerJid the peerJid corresponding to the contact
 -      * @param id the user's email or userId used to get the user's avatar
 -      */
 -     ensureAddContact: function (peerJid, id) {
 -         var resourceJid = Strophe.getResourceFromJid(peerJid);
 - 
 -         var contact = $('#contactlist>ul>li[id="' + resourceJid + '"]');
 - 
 -         if (!contact || contact.length <= 0)
 -             ContactList.addContact(peerJid, id);
 -     },
 - 
 -     /**
 -      * Adds a contact for the given peer jid.
 -      *
 -      * @param peerJid the jid of the contact to add
 -      * @param id the email or userId of the user
 -      */
 -     addContact: function (peerJid, id) {
 -         var resourceJid = Strophe.getResourceFromJid(peerJid);
 - 
 -         var contactlist = $('#contactlist>ul');
 - 
 -         var newContact = document.createElement('li');
 -         newContact.id = resourceJid;
 -         newContact.className = "clickable";
 -         newContact.onclick = function (event) {
 -             if (event.currentTarget.className === "clickable") {
 -                 $(ContactList).trigger('contactclicked', [peerJid]);
 -             }
 -         };
 - 
 -         newContact.appendChild(createAvatar(id));
 -         newContact.appendChild(createDisplayNameParagraph("Participant"));
 - 
 -         var clElement = contactlist.get(0);
 - 
 -         if (resourceJid === Strophe.getResourceFromJid(connection.emuc.myroomjid)
 -             && $('#contactlist>ul .title')[0].nextSibling.nextSibling) {
 -             clElement.insertBefore(newContact,
 -                 $('#contactlist>ul .title')[0].nextSibling.nextSibling);
 -         }
 -         else {
 -             clElement.appendChild(newContact);
 -         }
 -         updateNumberOfParticipants(1);
 -     },
 - 
 -     /**
 -      * Removes a contact for the given peer jid.
 -      *
 -      * @param peerJid the peerJid corresponding to the contact to remove
 -      */
 -     removeContact: function (peerJid) {
 -         var resourceJid = Strophe.getResourceFromJid(peerJid);
 - 
 -         var contact = $('#contactlist>ul>li[id="' + resourceJid + '"]');
 - 
 -         if (contact && contact.length > 0) {
 -             var contactlist = $('#contactlist>ul');
 - 
 -             contactlist.get(0).removeChild(contact.get(0));
 - 
 -             updateNumberOfParticipants(-1);
 -         }
 -     },
 - 
 -     setVisualNotification: function (show, stopGlowingIn) {
 -         var glower = $('#contactListButton');
 - 
 -         if (show && !notificationInterval) {
 -             notificationInterval = window.setInterval(function () {
 -                 glower.toggleClass('active glowing');
 -             }, 800);
 -         }
 -         else if (!show && notificationInterval) {
 -             stopGlowing(glower);
 -         }
 -         if (stopGlowingIn) {
 -             setTimeout(function () {
 -                 stopGlowing(glower);
 -             }, stopGlowingIn);
 -         }
 -     },
 - 
 -     setClickable: function (resourceJid, isClickable) {
 -         var contact = $('#contactlist>ul>li[id="' + resourceJid + '"]');
 -         if (isClickable) {
 -             contact.addClass('clickable');
 -         } else {
 -             contact.removeClass('clickable');
 -         }
 -     }
 - };
 - 
 - module.exports = ContactList;
 - },{}],13:[function(require,module,exports){
 - var email = '';
 - var displayName = '';
 - var userId;
 - 
 - 
 - function supportsLocalStorage() {
 -     try {
 -         return 'localStorage' in window && window.localStorage !== null;
 -     } catch (e) {
 -         console.log("localstorage is not supported");
 -         return false;
 -     }
 - }
 - 
 - 
 - function generateUniqueId() {
 -     function _p8() {
 -         return (Math.random().toString(16)+"000000000").substr(2,8);
 -     }
 -     return _p8() + _p8() + _p8() + _p8();
 - }
 - 
 - if(supportsLocalStorage()) {
 -     if(!window.localStorage.jitsiMeetId) {
 -         window.localStorage.jitsiMeetId = generateUniqueId();
 -         console.log("generated id", window.localStorage.jitsiMeetId);
 -     }
 -     userId = window.localStorage.jitsiMeetId || '';
 -     email = window.localStorage.email || '';
 -     displayName = window.localStorage.displayname || '';
 - } else {
 -     console.log("local storage is not supported");
 -     userId = generateUniqueId();
 - }
 - 
 - var Settings =
 - {
 -     setDisplayName: function (newDisplayName) {
 -         displayName = newDisplayName;
 -         window.localStorage.displayname = displayName;
 -         return displayName;
 -     },
 -     setEmail: function(newEmail)
 -     {
 -         email = newEmail;
 -         window.localStorage.email = newEmail;
 -         return email;
 -     },
 -     getSettings: function () {
 -         return {
 -             email: email,
 -             displayName: displayName,
 -             uid: userId
 -         };
 -     }
 - };
 - 
 - module.exports = Settings;
 - 
 - },{}],14:[function(require,module,exports){
 - var Avatar = require("../../avatar/Avatar");
 - var Settings = require("./Settings");
 - 
 - 
 - var SettingsMenu = {
 - 
 -     update: function() {
 -         var newDisplayName = Util.escapeHtml($('#setDisplayName').get(0).value);
 -         var newEmail = Util.escapeHtml($('#setEmail').get(0).value);
 - 
 -         if(newDisplayName) {
 -             var displayName = Settings.setDisplayName(newDisplayName);
 -             connection.emuc.addDisplayNameToPresence(displayName);
 -         }
 - 
 - 
 -         connection.emuc.addEmailToPresence(newEmail);
 -         var email = Settings.setEmail(newEmail);
 - 
 - 
 -         connection.emuc.sendPresence();
 -         Avatar.setUserAvatar(connection.emuc.myroomjid, email);
 -     },
 - 
 -     isVisible: function() {
 -         return $('#settingsmenu').is(':visible');
 -     },
 - 
 -     setDisplayName: function(newDisplayName) {
 -         var displayName = Settings.setDisplayName(newDisplayName);
 -         $('#setDisplayName').get(0).value = displayName;
 -     }
 - };
 - 
 - $(document).bind('displaynamechanged', function(event, peerJid, newDisplayName) {
 -     if(peerJid === 'localVideoContainer' ||
 -         peerJid === connection.emuc.myroomjid) {
 -         SettingsMenu.setDisplayName(newDisplayName);
 -     }
 - });
 - 
 - module.exports = SettingsMenu;
 - },{"../../avatar/Avatar":4,"./Settings":13}],15:[function(require,module,exports){
 - var PanelToggler = require("../side_pannels/SidePanelToggler");
 - 
 - var buttonHandlers = {
 -     "bottom_toolbar_contact_list": function () {
 -         BottomToolbar.toggleContactList();
 -     },
 -     "bottom_toolbar_film_strip": function () {
 -         BottomToolbar.toggleFilmStrip();
 -     },
 -     "bottom_toolbar_chat": function () {
 -         BottomToolbar.toggleChat();
 -     }
 - };
 - 
 - var BottomToolbar = (function (my) {
 -     my.init = function () {
 -         for(var k in buttonHandlers)
 -             $("#" + k).click(buttonHandlers[k]);
 -     };
 - 
 -     my.toggleChat = function() {
 -         PanelToggler.toggleChat();
 -     };
 - 
 -     my.toggleContactList = function() {
 -         PanelToggler.toggleContactList();
 -     };
 - 
 -     my.toggleFilmStrip = function() {
 -         var filmstrip = $("#remoteVideos");
 -         filmstrip.toggleClass("hidden");
 -     };
 - 
 -     $(document).bind("remotevideo.resized", function (event, width, height) {
 -         var bottom = (height - $('#bottomToolbar').outerHeight())/2 + 18;
 - 
 -         $('#bottomToolbar').css({bottom: bottom + 'px'});
 -     });
 - 
 -     return my;
 - }(BottomToolbar || {}));
 - 
 - module.exports = BottomToolbar;
 - 
 - },{"../side_pannels/SidePanelToggler":7}],16:[function(require,module,exports){
 - /* global $, interfaceConfig, Moderator, DesktopStreaming.showDesktopSharingButton */
 - 
 - var toolbarTimeoutObject,
 -     toolbarTimeout = interfaceConfig.INITIAL_TOOLBAR_TIMEOUT;
 - 
 - function showDesktopSharingButton() {
 -     if (desktopsharing.isDesktopSharingEnabled()) {
 -         $('#desktopsharing').css({display: "inline"});
 -     } else {
 -         $('#desktopsharing').css({display: "none"});
 -     }
 - }
 - 
 - /**
 -  * Hides the toolbar.
 -  */
 - function hideToolbar() {
 -     var header = $("#header"),
 -         bottomToolbar = $("#bottomToolbar");
 -     var isToolbarHover = false;
 -     header.find('*').each(function () {
 -         var id = $(this).attr('id');
 -         if ($("#" + id + ":hover").length > 0) {
 -             isToolbarHover = true;
 -         }
 -     });
 -     if ($("#bottomToolbar:hover").length > 0) {
 -         isToolbarHover = true;
 -     }
 - 
 -     clearTimeout(toolbarTimeoutObject);
 -     toolbarTimeoutObject = null;
 - 
 -     if (!isToolbarHover) {
 -         header.hide("slide", { direction: "up", duration: 300});
 -         $('#subject').animate({top: "-=40"}, 300);
 -         if ($("#remoteVideos").hasClass("hidden")) {
 -             bottomToolbar.hide(
 -                 "slide", {direction: "right", duration: 300});
 -         }
 -     }
 -     else {
 -         toolbarTimeoutObject = setTimeout(hideToolbar, toolbarTimeout);
 -     }
 - }
 - 
 - var ToolbarToggler = {
 -     /**
 -      * Shows the main toolbar.
 -      */
 -     showToolbar: function () {
 -         var header = $("#header"),
 -             bottomToolbar = $("#bottomToolbar");
 -         if (!header.is(':visible') || !bottomToolbar.is(":visible")) {
 -             header.show("slide", { direction: "up", duration: 300});
 -             $('#subject').animate({top: "+=40"}, 300);
 -             if (!bottomToolbar.is(":visible")) {
 -                 bottomToolbar.show(
 -                     "slide", {direction: "right", duration: 300});
 -             }
 - 
 -             if (toolbarTimeoutObject) {
 -                 clearTimeout(toolbarTimeoutObject);
 -                 toolbarTimeoutObject = null;
 -             }
 -             toolbarTimeoutObject = setTimeout(hideToolbar, toolbarTimeout);
 -             toolbarTimeout = interfaceConfig.TOOLBAR_TIMEOUT;
 -         }
 - 
 -         if (Moderator.isModerator())
 -         {
 - //            TODO: Enable settings functionality.
 - //                  Need to uncomment the settings button in index.html.
 - //            $('#settingsButton').css({visibility:"visible"});
 -         }
 - 
 -         // Show/hide desktop sharing button
 -         showDesktopSharingButton();
 -     },
 - 
 - 
 -     /**
 -      * Docks/undocks the toolbar.
 -      *
 -      * @param isDock indicates what operation to perform
 -      */
 -     dockToolbar: function (isDock) {
 -         if (isDock) {
 -             // First make sure the toolbar is shown.
 -             if (!$('#header').is(':visible')) {
 -                 this.showToolbar();
 -             }
 - 
 -             // Then clear the time out, to dock the toolbar.
 -             if (toolbarTimeoutObject) {
 -                 clearTimeout(toolbarTimeoutObject);
 -                 toolbarTimeoutObject = null;
 -             }
 -         }
 -         else {
 -             if (!$('#header').is(':visible')) {
 -                 this.showToolbar();
 -             }
 -             else {
 -                 toolbarTimeoutObject = setTimeout(hideToolbar, toolbarTimeout);
 -             }
 -         }
 -     },
 - 
 -     showDesktopSharingButton: showDesktopSharingButton
 - 
 - };
 - 
 - module.exports = ToolbarToggler;
 - },{}],17:[function(require,module,exports){
 - /* global $, buttonClick, config, lockRoom,  Moderator, roomName,
 -    setSharedKey, sharedKey, Util */
 - var messageHandler = require("../util/MessageHandler");
 - var BottomToolbar = require("./BottomToolbar");
 - var Prezi = require("../prezi/Prezi");
 - var Etherpad = require("../etherpad/Etherpad");
 - var PanelToggler = require("../side_pannels/SidePanelToggler");
 - 
 - var roomUrl = null;
 - var sharedKey = '';
 - var authenticationWindow = null;
 - 
 - var buttonHandlers =
 - {
 -     "toolbar_button_mute": function () {
 -         return toggleAudio();
 -     },
 -     "toolbar_button_camera": function () {
 -         return toggleVideo();
 -     },
 -     "toolbar_button_authentication": function () {
 -         return Toolbar.authenticateClicked();
 -     },
 -     "toolbar_button_record": function () {
 -         return toggleRecording();
 -     },
 -     "toolbar_button_security": function () {
 -         return Toolbar.openLockDialog();
 -     },
 -     "toolbar_button_link": function () {
 -         return Toolbar.openLinkDialog();
 -     },
 -     "toolbar_button_chat": function () {
 -         return BottomToolbar.toggleChat();
 -     },
 -     "toolbar_button_prezi": function () {
 -         return Prezi.openPreziDialog();
 -     },
 -     "toolbar_button_etherpad": function () {
 -         return Etherpad.toggleEtherpad(0);
 -     },
 -     "toolbar_button_desktopsharing": function () {
 -         return desktopsharing.toggleScreenSharing();
 -     },
 -     "toolbar_button_fullScreen": function()
 -     {
 -         buttonClick("#fullScreen", "icon-full-screen icon-exit-full-screen");
 -         return Toolbar.toggleFullScreen();
 -     },
 -     "toolbar_button_sip": function () {
 -         return callSipButtonClicked();
 -     },
 -     "toolbar_button_settings": function () {
 -         PanelToggler.toggleSettingsMenu();
 -     },
 -     "toolbar_button_hangup": function () {
 -         return hangup();
 -     }
 - };
 - 
 - function hangup() {
 -     disposeConference();
 -     sessionTerminated = true;
 -     connection.emuc.doLeave();
 -     if(config.enableWelcomePage)
 -     {
 -         setTimeout(function()
 -         {
 -             window.localStorage.welcomePageDisabled = false;
 -             window.location.pathname = "/";
 -         }, 10000);
 - 
 -     }
 - 
 -     UI.messageHandler.openDialog(
 -         "Session Terminated",
 -         "You hung up the call",
 -         true,
 -         { "Join again": true },
 -         function(event, value, message, formVals)
 -         {
 -             window.location.reload();
 -             return false;
 -         }
 -     );
 - }
 - 
 - /**
 -  * Starts or stops the recording for the conference.
 -  */
 - 
 - function toggleRecording() {
 -     Recording.toggleRecording();
 - }
 - 
 - /**
 -  * Locks / unlocks the room.
 -  */
 - function lockRoom(lock) {
 -     var currentSharedKey = '';
 -     if (lock)
 -         currentSharedKey = sharedKey;
 - 
 -     connection.emuc.lockRoom(currentSharedKey, function (res) {
 -         // password is required
 -         if (sharedKey)
 -         {
 -             console.log('set room password');
 -             Toolbar.lockLockButton();
 -         }
 -         else
 -         {
 -             console.log('removed room password');
 -             Toolbar.unlockLockButton();
 -         }
 -     }, function (err) {
 -         console.warn('setting password failed', err);
 -         messageHandler.showError('Lock failed',
 -             'Failed to lock conference.',
 -             err);
 -         Toolbar.setSharedKey('');
 -     }, function () {
 -         console.warn('room passwords not supported');
 -         messageHandler.showError('Warning',
 -             'Room passwords are currently not supported.');
 -         Toolbar.setSharedKey('');
 -     });
 - };
 - 
 - /**
 -  * Invite participants to conference.
 -  */
 - function inviteParticipants() {
 -     if (roomUrl === null)
 -         return;
 - 
 -     var sharedKeyText = "";
 -     if (sharedKey && sharedKey.length > 0) {
 -         sharedKeyText =
 -             "This conference is password protected. Please use the " +
 -             "following pin when joining:%0D%0A%0D%0A" +
 -             sharedKey + "%0D%0A%0D%0A";
 -     }
 - 
 -     var conferenceName = roomUrl.substring(roomUrl.lastIndexOf('/') + 1);
 -     var subject = "Invitation to a " + interfaceConfig.APP_NAME + " (" + conferenceName + ")";
 -     var body = "Hey there, I%27d like to invite you to a " + interfaceConfig.APP_NAME +
 -         " conference I%27ve just set up.%0D%0A%0D%0A" +
 -         "Please click on the following link in order" +
 -         " to join the conference.%0D%0A%0D%0A" +
 -         roomUrl +
 -         "%0D%0A%0D%0A" +
 -         sharedKeyText +
 -         "Note that " + interfaceConfig.APP_NAME + " is currently" +
 -         " only supported by Chromium," +
 -         " Google Chrome and Opera, so you need" +
 -         " to be using one of these browsers.%0D%0A%0D%0A" +
 -         "Talk to you in a sec!";
 - 
 -     if (window.localStorage.displayname) {
 -         body += "%0D%0A%0D%0A" + window.localStorage.displayname;
 -     }
 - 
 -     if (interfaceConfig.INVITATION_POWERED_BY) {
 -         body += "%0D%0A%0D%0A--%0D%0Apowered by jitsi.org";
 -     }
 - 
 -     window.open("mailto:?subject=" + subject + "&body=" + body, '_blank');
 - }
 - 
 - function callSipButtonClicked()
 - {
 -     var defaultNumber
 -         = config.defaultSipNumber ? config.defaultSipNumber : '';
 - 
 -     messageHandler.openTwoButtonDialog(null,
 -         '<h2>Enter SIP number</h2>' +
 -         '<input id="sipNumber" type="text"' +
 -         ' value="' + defaultNumber + '" autofocus>',
 -         false,
 -         "Dial",
 -         function (e, v, m, f) {
 -             if (v) {
 -                 var numberInput = document.getElementById('sipNumber');
 -                 if (numberInput.value) {
 -                     connection.rayo.dial(
 -                         numberInput.value, 'fromnumber',
 -                         roomName, sharedKey);
 -                 }
 -             }
 -         },
 -         function (event) {
 -             document.getElementById('sipNumber').focus();
 -         }
 -     );
 - }
 - 
 - var Toolbar = (function (my) {
 - 
 -     my.init = function () {
 -         for(var k in buttonHandlers)
 -             $("#" + k).click(buttonHandlers[k]);
 -     }
 - 
 -     /**
 -      * Sets shared key
 -      * @param sKey the shared key
 -      */
 -     my.setSharedKey = function (sKey) {
 -         sharedKey = sKey;
 -     };
 - 
 -     my.closeAuthenticationWindow = function () {
 -         if (authenticationWindow) {
 -             authenticationWindow.close();
 -             authenticationWindow = null;
 -         }
 -     }
 - 
 -     my.authenticateClicked = function () {
 -         // If auth window exists just bring it to the front
 -         if (authenticationWindow) {
 -             authenticationWindow.focus();
 -             return;
 -         }
 -         // Get authentication URL
 -         Moderator.getAuthUrl(function (url) {
 -             // Open popup with authentication URL
 -             authenticationWindow = messageHandler.openCenteredPopup(
 -                 url, 910, 660,
 -                 // On closed
 -                 function () {
 -                     // Close authentication dialog if opened
 -                     if (authDialog) {
 -                         messageHandler.closeDialog();
 -                         authDialog = null;
 -                     }
 -                     // On popup closed - retry room allocation
 -                     Moderator.allocateConferenceFocus(roomName, doJoinAfterFocus);
 -                     authenticationWindow = null;
 -                 });
 -             if (!authenticationWindow) {
 -                 Toolbar.showAuthenticateButton(true);
 -                 messageHandler.openMessageDialog(
 -                     null, "Your browser is blocking popup windows from this site." +
 -                         " Please enable popups in your browser security settings" +
 -                         " and try again.");
 -             }
 -         });
 -     };
 - 
 -     /**
 -      * Updates the room invite url.
 -      */
 -     my.updateRoomUrl = function (newRoomUrl) {
 -         roomUrl = newRoomUrl;
 - 
 -         // If the invite dialog has been already opened we update the information.
 -         var inviteLink = document.getElementById('inviteLinkRef');
 -         if (inviteLink) {
 -             inviteLink.value = roomUrl;
 -             inviteLink.select();
 -             document.getElementById('jqi_state0_buttonInvite').disabled = false;
 -         }
 -     };
 - 
 -     /**
 -      * Disables and enables some of the buttons.
 -      */
 -     my.setupButtonsFromConfig = function () {
 -         if (config.disablePrezi)
 -         {
 -             $("#prezi_button").css({display: "none"});
 -         }
 -     };
 - 
 -     /**
 -      * Opens the lock room dialog.
 -      */
 -     my.openLockDialog = function () {
 -         // Only the focus is able to set a shared key.
 -         if (!Moderator.isModerator()) {
 -             if (sharedKey) {
 -                 messageHandler.openMessageDialog(null,
 -                         "This conversation is currently protected by" +
 -                         " a password. Only the owner of the conference" +
 -                         " could set a password.",
 -                     false,
 -                     "Password");
 -             } else {
 -                 messageHandler.openMessageDialog(null,
 -                     "This conversation isn't currently protected by" +
 -                         " a password. Only the owner of the conference" +
 -                         " could set a password.",
 -                     false,
 -                     "Password");
 -             }
 -         } else {
 -             if (sharedKey) {
 -                 messageHandler.openTwoButtonDialog(null,
 -                     "Are you sure you would like to remove your password?",
 -                     false,
 -                     "Remove",
 -                     function (e, v) {
 -                         if (v) {
 -                             Toolbar.setSharedKey('');
 -                             lockRoom(false);
 -                         }
 -                     });
 -             } else {
 -                 messageHandler.openTwoButtonDialog(null,
 -                     '<h2>Set a password to lock your room</h2>' +
 -                         '<input id="lockKey" type="text"' +
 -                         'placeholder="your password" autofocus>',
 -                     false,
 -                     "Save",
 -                     function (e, v) {
 -                         if (v) {
 -                             var lockKey = document.getElementById('lockKey');
 - 
 -                             if (lockKey.value) {
 -                                 Toolbar.setSharedKey(Util.escapeHtml(lockKey.value));
 -                                 lockRoom(true);
 -                             }
 -                         }
 -                     },
 -                     function () {
 -                         document.getElementById('lockKey').focus();
 -                     }
 -                 );
 -             }
 -         }
 -     };
 - 
 -     /**
 -      * Opens the invite link dialog.
 -      */
 -     my.openLinkDialog = function () {
 -         var inviteLink;
 -         if (roomUrl === null) {
 -             inviteLink = "Your conference is currently being created...";
 -         } else {
 -             inviteLink = encodeURI(roomUrl);
 -         }
 -         messageHandler.openTwoButtonDialog(
 -             "Share this link with everyone you want to invite",
 -             '<input id="inviteLinkRef" type="text" value="' +
 -                 inviteLink + '" onclick="this.select();" readonly>',
 -             false,
 -             "Invite",
 -             function (e, v) {
 -                 if (v) {
 -                     if (roomUrl) {
 -                         inviteParticipants();
 -                     }
 -                 }
 -             },
 -             function () {
 -                 if (roomUrl) {
 -                     document.getElementById('inviteLinkRef').select();
 -                 } else {
 -                     document.getElementById('jqi_state0_buttonInvite')
 -                         .disabled = true;
 -                 }
 -             }
 -         );
 -     };
 - 
 -     /**
 -      * Opens the settings dialog.
 -      */
 -     my.openSettingsDialog = function () {
 -         messageHandler.openTwoButtonDialog(
 -             '<h2>Configure your conference</h2>' +
 -                 '<input type="checkbox" id="initMuted">' +
 -                 'Participants join muted<br/>' +
 -                 '<input type="checkbox" id="requireNicknames">' +
 -                 'Require nicknames<br/><br/>' +
 -                 'Set a password to lock your room:' +
 -                 '<input id="lockKey" type="text" placeholder="your password"' +
 -                 'autofocus>',
 -             null,
 -             false,
 -             "Save",
 -             function () {
 -                 document.getElementById('lockKey').focus();
 -             },
 -             function (e, v) {
 -                 if (v) {
 -                     if ($('#initMuted').is(":checked")) {
 -                         // it is checked
 -                     }
 - 
 -                     if ($('#requireNicknames').is(":checked")) {
 -                         // it is checked
 -                     }
 -                     /*
 -                     var lockKey = document.getElementById('lockKey');
 - 
 -                     if (lockKey.value) {
 -                         setSharedKey(lockKey.value);
 -                         lockRoom(true);
 -                     }
 -                     */
 -                 }
 -             }
 -         );
 -     };
 - 
 -     /**
 -      * Toggles the application in and out of full screen mode
 -      * (a.k.a. presentation mode in Chrome).
 -      */
 -     my.toggleFullScreen = function () {
 -         var fsElement = document.documentElement;
 - 
 -         if (!document.mozFullScreen && !document.webkitIsFullScreen) {
 -             //Enter Full Screen
 -             if (fsElement.mozRequestFullScreen) {
 -                 fsElement.mozRequestFullScreen();
 -             }
 -             else {
 -                 fsElement.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT);
 -             }
 -         } else {
 -             //Exit Full Screen
 -             if (document.mozCancelFullScreen) {
 -                 document.mozCancelFullScreen();
 -             } else {
 -                 document.webkitCancelFullScreen();
 -             }
 -         }
 -     };
 -     /**
 -      * Unlocks the lock button state.
 -      */
 -     my.unlockLockButton = function () {
 -         if ($("#lockIcon").hasClass("icon-security-locked"))
 -             buttonClick("#lockIcon", "icon-security icon-security-locked");
 -     };
 -     /**
 -      * Updates the lock button state to locked.
 -      */
 -     my.lockLockButton = function () {
 -         if ($("#lockIcon").hasClass("icon-security"))
 -             buttonClick("#lockIcon", "icon-security icon-security-locked");
 -     };
 - 
 -     /**
 -      * Shows or hides authentication button
 -      * @param show <tt>true</tt> to show or <tt>false</tt> to hide
 -      */
 -     my.showAuthenticateButton = function (show) {
 -         if (show) {
 -             $('#authentication').css({display: "inline"});
 -         }
 -         else {
 -             $('#authentication').css({display: "none"});
 -         }
 -     };
 - 
 -     // Shows or hides the 'recording' button.
 -     my.showRecordingButton = function (show) {
 -         if (!config.enableRecording) {
 -             return;
 -         }
 - 
 -         if (show) {
 -             $('#recording').css({display: "inline"});
 -         }
 -         else {
 -             $('#recording').css({display: "none"});
 -         }
 -     };
 - 
 -     // Sets the state of the recording button
 -     my.setRecordingButtonState = function (isRecording) {
 -         if (isRecording) {
 -             $('#recordButton').removeClass("icon-recEnable");
 -             $('#recordButton').addClass("icon-recEnable active");
 -         } else {
 -             $('#recordButton').removeClass("icon-recEnable active");
 -             $('#recordButton').addClass("icon-recEnable");
 -         }
 -     };
 - 
 -     // Shows or hides SIP calls button
 -     my.showSipCallButton = function (show) {
 -         if (Moderator.isSipGatewayEnabled() && show) {
 -             $('#sipCallButton').css({display: "inline"});
 -         } else {
 -             $('#sipCallButton').css({display: "none"});
 -         }
 -     };
 - 
 -     /**
 -      * Sets the state of the button. The button has blue glow if desktop
 -      * streaming is active.
 -      * @param active the state of the desktop streaming.
 -      */
 -     my.changeDesktopSharingButtonState = function (active) {
 -         var button = $("#desktopsharing > a");
 -         if (active)
 -         {
 -             button.addClass("glow");
 -         }
 -         else
 -         {
 -             button.removeClass("glow");
 -         }
 -     };
 - 
 -     return my;
 - }(Toolbar || {}));
 - 
 - module.exports = Toolbar;
 - },{"../etherpad/Etherpad":5,"../prezi/Prezi":6,"../side_pannels/SidePanelToggler":7,"../util/MessageHandler":20,"./BottomToolbar":15}],18:[function(require,module,exports){
 - module.exports=require(16)
 - },{}],19:[function(require,module,exports){
 - var JitsiPopover = (function () {
 -     /**
 -      * Constructs new JitsiPopover and attaches it to the element
 -      * @param element jquery selector
 -      * @param options the options for the popover.
 -      * @constructor
 -      */
 -     function JitsiPopover(element, options)
 -     {
 -         this.options = {
 -             skin: "white",
 -             content: ""
 -         };
 -         if(options)
 -         {
 -             if(options.skin)
 -                 this.options.skin = options.skin;
 - 
 -             if(options.content)
 -                 this.options.content = options.content;
 -         }
 - 
 -         this.elementIsHovered = false;
 -         this.popoverIsHovered = false;
 -         this.popoverShown = false;
 - 
 -         element.data("jitsi_popover", this);
 -         this.element = element;
 -         this.template = ' <div class="jitsipopover ' + this.options.skin +
 -             '"><div class="arrow"></div><div class="jitsipopover-content"></div>' +
 -             '<div class="jitsiPopupmenuPadding"></div></div>';
 -         var self = this;
 -         this.element.on("mouseenter", function () {
 -             self.elementIsHovered = true;
 -             self.show();
 -         }).on("mouseleave", function () {
 -             self.elementIsHovered = false;
 -             setTimeout(function () {
 -                 self.hide();
 -             }, 10);
 -         });
 -     }
 - 
 -     /**
 -      * Shows the popover
 -      */
 -     JitsiPopover.prototype.show = function () {
 -         this.createPopover();
 -         this.popoverShown = true;
 - 
 -     };
 - 
 -     /**
 -      * Hides the popover
 -      */
 -     JitsiPopover.prototype.hide = function () {
 -         if(!this.elementIsHovered && !this.popoverIsHovered && this.popoverShown)
 -         {
 -             this.forceHide();
 -         }
 -     };
 - 
 -     /**
 -      * Hides the popover
 -      */
 -     JitsiPopover.prototype.forceHide = function () {
 -         $(".jitsipopover").remove();
 -         this.popoverShown = false;
 -     };
 - 
 -     /**
 -      * Creates the popover html
 -      */
 -     JitsiPopover.prototype.createPopover = function () {
 -         $("body").append(this.template);
 -         $(".jitsipopover > .jitsipopover-content").html(this.options.content);
 -         var self = this;
 -         $(".jitsipopover").on("mouseenter", function () {
 -             self.popoverIsHovered = true;
 -         }).on("mouseleave", function () {
 -             self.popoverIsHovered = false;
 -             self.hide();
 -         });
 - 
 -         this.refreshPosition();
 -     };
 - 
 -     /**
 -      * Refreshes the position of the popover
 -      */
 -     JitsiPopover.prototype.refreshPosition = function () {
 -         $(".jitsipopover").position({
 -             my: "bottom",
 -             at: "top",
 -             collision: "fit",
 -             of: this.element,
 -             using: function (position, elements) {
 -                 var calcLeft = elements.target.left - elements.element.left + elements.target.width/2;
 -                 $(".jitsipopover").css({top: position.top, left: position.left, display: "table"});
 -                 $(".jitsipopover > .arrow").css({left: calcLeft});
 -                 $(".jitsipopover > .jitsiPopupmenuPadding").css({left: calcLeft - 50});
 -             }
 -         });
 -     };
 - 
 -     /**
 -      * Updates the content of popover.
 -      * @param content new content
 -      */
 -     JitsiPopover.prototype.updateContent = function (content) {
 -         this.options.content = content;
 -         if(!this.popoverShown)
 -             return;
 -         $(".jitsipopover").remove();
 -         this.createPopover();
 -     };
 - 
 -     return JitsiPopover;
 - 
 - 
 - })();
 - 
 - module.exports = JitsiPopover;
 - },{}],20:[function(require,module,exports){
 - /* global $, jQuery */
 - var messageHandler = (function(my) {
 - 
 -     /**
 -      * Shows a message to the user.
 -      *
 -      * @param titleString the title of the message
 -      * @param messageString the text of the message
 -      */
 -     my.openMessageDialog = function(titleString, messageString) {
 -         $.prompt(messageString,
 -             {
 -                 title: titleString,
 -                 persistent: false
 -             }
 -         );
 -     };
 - 
 -     /**
 -      * Shows a message to the user with two buttons: first is given as a parameter and the second is Cancel.
 -      *
 -      * @param titleString the title of the message
 -      * @param msgString the text of the message
 -      * @param persistent boolean value which determines whether the message is persistent or not
 -      * @param leftButton the fist button's text
 -      * @param submitFunction function to be called on submit
 -      * @param loadedFunction function to be called after the prompt is fully loaded
 -      * @param closeFunction function to be called after the prompt is closed
 -      */
 -     my.openTwoButtonDialog = function(titleString, msgString, persistent, leftButton,
 -                                       submitFunction, loadedFunction, closeFunction) {
 -         var buttons = {};
 -         buttons[leftButton] = true;
 -         buttons.Cancel = false;
 -         $.prompt(msgString, {
 -             title: titleString,
 -             persistent: false,
 -             buttons: buttons,
 -             defaultButton: 1,
 -             loaded: loadedFunction,
 -             submit: submitFunction,
 -             close: closeFunction
 -         });
 -     };
 - 
 -     /**
 -      * Shows a message to the user with two buttons: first is given as a parameter and the second is Cancel.
 -      *
 -      * @param titleString the title of the message
 -      * @param msgString the text of the message
 -      * @param persistent boolean value which determines whether the message is persistent or not
 -      * @param buttons object with the buttons. The keys must be the name of the button and value is the value
 -      * that will be passed to submitFunction
 -      * @param submitFunction function to be called on submit
 -      * @param loadedFunction function to be called after the prompt is fully loaded
 -      */
 -     my.openDialog = function (titleString,    msgString, persistent, buttons,
 -                               submitFunction, loadedFunction) {
 -         var args = {
 -             title: titleString,
 -             persistent: persistent,
 -             buttons: buttons,
 -             defaultButton: 1,
 -             loaded: loadedFunction,
 -             submit: submitFunction
 -         };
 -         if (persistent) {
 -             args.closeText = '';
 -         }
 -         return $.prompt(msgString, args);
 -     };
 - 
 -     /**
 -      * Closes currently opened dialog.
 -      */
 -     my.closeDialog = function () {
 -         $.prompt.close();
 -     };
 - 
 -     /**
 -      * Shows a dialog with different states to the user.
 -      *
 -      * @param statesObject object containing all the states of the dialog
 -      * @param loadedFunction function to be called after the prompt is fully loaded
 -      * @param stateChangedFunction function to be called when the state of the dialog is changed
 -      */
 -     my.openDialogWithStates = function(statesObject, loadedFunction, stateChangedFunction) {
 - 
 - 
 -         var myPrompt = $.prompt(statesObject);
 - 
 -         myPrompt.on('impromptu:loaded', loadedFunction);
 -         myPrompt.on('impromptu:statechanged', stateChangedFunction);
 -     };
 - 
 -     /**
 -      * Opens new popup window for given <tt>url</tt> centered over current
 -      * window.
 -      *
 -      * @param url the URL to be displayed in the popup window
 -      * @param w the width of the popup window
 -      * @param h the height of the popup window
 -      * @param onPopupClosed optional callback function called when popup window
 -      *        has been closed.
 -      *
 -      * @returns popup window object if opened successfully or undefined
 -      *          in case we failed to open it(popup blocked)
 -      */
 -     my.openCenteredPopup = function (url, w, h, onPopupClosed) {
 -         var l = window.screenX + (window.innerWidth / 2) - (w / 2);
 -         var t = window.screenY + (window.innerHeight / 2) - (h / 2);
 -         var popup = window.open(
 -             url, '_blank',
 -             'top=' + t + ', left=' + l + ', width=' + w + ', height=' + h + '');
 -         if (popup && onPopupClosed) {
 -             var pollTimer = window.setInterval(function () {
 -                 if (popup.closed !== false) {
 -                     window.clearInterval(pollTimer);
 -                     onPopupClosed();
 -                 }
 -             }, 200);
 -         }
 -         return popup;
 -     };
 - 
 -     /**
 -      * Shows a dialog prompting the user to send an error report.
 -      *
 -      * @param titleString the title of the message
 -      * @param msgString the text of the message
 -      * @param error the error that is being reported
 -      */
 -     my.openReportDialog = function(titleString, msgString, error) {
 -         my.openMessageDialog(titleString, msgString);
 -         console.log(error);
 -         //FIXME send the error to the server
 -     };
 - 
 -     /**
 -      *  Shows an error dialog to the user.
 -      * @param title the title of the message
 -      * @param message the text of the messafe
 -      */
 -     my.showError = function(title, message) {
 -         if(!(title || message)) {
 -             title = title || "Oops!";
 -             message = message || "There was some kind of error";
 -         }
 -         messageHandler.openMessageDialog(title, message);
 -     };
 - 
 -     my.notify = function(displayName, cls, message) {
 -         toastr.info(
 -             '<span class="nickname">' +
 -                 displayName +
 -             '</span><br>' +
 -             '<span class=' + cls + '>' +
 -                 message +
 -             '</span>');
 -     };
 - 
 -     return my;
 - }(messageHandler || {}));
 - 
 - module.exports = messageHandler;
 - 
 - 
 - 
 - },{}],21:[function(require,module,exports){
 - /**
 -  * Created by hristo on 12/22/14.
 -  */
 - module.exports = {
 -     /**
 -      * Returns the available video width.
 -      */
 -     getAvailableVideoWidth: function () {
 -         var PanelToggler = require("../side_pannels/SidePanelToggler");
 -         var rightPanelWidth
 -             = PanelToggler.isVisible() ? PanelToggler.getPanelSize()[0] : 0;
 - 
 -         return window.innerWidth - rightPanelWidth;
 -     }
 - 
 - };
 - },{"../side_pannels/SidePanelToggler":7}],22:[function(require,module,exports){
 - var JitsiPopover = require("../util/JitsiPopover");
 - 
 - /**
 -  * Constructs new connection indicator.
 -  * @param videoContainer the video container associated with the indicator.
 -  * @constructor
 -  */
 - function ConnectionIndicator(videoContainer, jid, VideoLayout)
 - {
 -     this.videoContainer = videoContainer;
 -     this.bandwidth = null;
 -     this.packetLoss = null;
 -     this.bitrate = null;
 -     this.showMoreValue = false;
 -     this.resolution = null;
 -     this.transport = [];
 -     this.popover = null;
 -     this.jid = jid;
 -     this.create();
 -     this.videoLayout = VideoLayout;
 - }
 - 
 - /**
 -  * Values for the connection quality
 -  * @type {{98: string,
 -  *         81: string,
 -  *         64: string,
 -  *         47: string,
 -  *         30: string,
 -  *         0: string}}
 -  */
 - ConnectionIndicator.connectionQualityValues = {
 -     98: "18px", //full
 -     81: "15px",//4 bars
 -     64: "11px",//3 bars
 -     47: "7px",//2 bars
 -     30: "3px",//1 bar
 -     0: "0px"//empty
 - };
 - 
 - ConnectionIndicator.getIP = function(value)
 - {
 -     return value.substring(0, value.lastIndexOf(":"));
 - };
 - 
 - ConnectionIndicator.getPort = function(value)
 - {
 -     return value.substring(value.lastIndexOf(":") + 1, value.length);
 - };
 - 
 - ConnectionIndicator.getStringFromArray = function (array) {
 -     var res = "";
 -     for(var i = 0; i < array.length; i++)
 -     {
 -         res += (i === 0? "" : ", ") + array[i];
 -     }
 -     return res;
 - };
 - 
 - /**
 -  * Generates the html content.
 -  * @returns {string} the html content.
 -  */
 - ConnectionIndicator.prototype.generateText = function () {
 -     var downloadBitrate, uploadBitrate, packetLoss, resolution, i;
 - 
 -     if(this.bitrate === null)
 -     {
 -         downloadBitrate = "N/A";
 -         uploadBitrate = "N/A";
 -     }
 -     else
 -     {
 -         downloadBitrate =
 -             this.bitrate.download? this.bitrate.download + " Kbps" : "N/A";
 -         uploadBitrate =
 -             this.bitrate.upload? this.bitrate.upload + " Kbps" : "N/A";
 -     }
 - 
 -     if(this.packetLoss === null)
 -     {
 -         packetLoss = "N/A";
 -     }
 -     else
 -     {
 - 
 -         packetLoss = "<span class='jitsipopover_green'>↓</span>" +
 -             (this.packetLoss.download !== null? this.packetLoss.download : "N/A") +
 -             "% <span class='jitsipopover_orange'>↑</span>" +
 -             (this.packetLoss.upload !== null? this.packetLoss.upload : "N/A") + "%";
 -     }
 - 
 -     var resolutionValue = null;
 -     if(this.resolution && this.jid != null)
 -     {
 -         var keys = Object.keys(this.resolution);
 -         if(keys.length == 1)
 -         {
 -             for(var ssrc in this.resolution)
 -             {
 -                 resolutionValue = this.resolution[ssrc];
 -             }
 -         }
 -         else if(keys.length > 1)
 -         {
 -             var displayedSsrc = simulcast.getReceivingSSRC(this.jid);
 -             resolutionValue = this.resolution[displayedSsrc];
 -         }
 -     }
 - 
 -     if(this.jid === null)
 -     {
 -         resolution = "";
 -         if(this.resolution === null || !Object.keys(this.resolution) ||
 -             Object.keys(this.resolution).length === 0)
 -         {
 -             resolution = "N/A";
 -         }
 -         else
 -             for(i in this.resolution)
 -             {
 -                 resolutionValue = this.resolution[i];
 -                 if(resolutionValue)
 -                 {
 -                     if(resolutionValue.height &&
 -                         resolutionValue.width)
 -                     {
 -                         resolution += (resolution === ""? "" : ", ") +
 -                             resolutionValue.width + "x" +
 -                             resolutionValue.height;
 -                     }
 -                 }
 -             }
 -     }
 -     else if(!resolutionValue ||
 -         !resolutionValue.height ||
 -         !resolutionValue.width)
 -     {
 -         resolution = "N/A";
 -     }
 -     else
 -     {
 -         resolution = resolutionValue.width + "x" + resolutionValue.height;
 -     }
 - 
 -     var result = "<table style='width:100%'>" +
 -         "<tr>" +
 -         "<td><span class='jitsipopover_blue'>Bitrate:</span></td>" +
 -         "<td><span class='jitsipopover_green'>↓</span>" +
 -         downloadBitrate + " <span class='jitsipopover_orange'>↑</span>" +
 -         uploadBitrate + "</td>" +
 -         "</tr><tr>" +
 -         "<td><span class='jitsipopover_blue'>Packet loss: </span></td>" +
 -         "<td>" + packetLoss  + "</td>" +
 -         "</tr><tr>" +
 -         "<td><span class='jitsipopover_blue'>Resolution:</span></td>" +
 -         "<td>" + resolution + "</td></tr></table>";
 - 
 -     if(this.videoContainer.id == "localVideoContainer")
 -         result += "<div class=\"jitsipopover_showmore\" " +
 -             "onclick = \"UI.connectionIndicatorShowMore('" +
 -             this.videoContainer.id + "')\">" +
 -             (this.showMoreValue? "Show less" : "Show More") + "</div><br />";
 - 
 -     if(this.showMoreValue)
 -     {
 -         var downloadBandwidth, uploadBandwidth, transport;
 -         if(this.bandwidth === null)
 -         {
 -             downloadBandwidth = "N/A";
 -             uploadBandwidth = "N/A";
 -         }
 -         else
 -         {
 -             downloadBandwidth = this.bandwidth.download?
 -                 this.bandwidth.download + " Kbps" :
 -                 "N/A";
 -             uploadBandwidth = this.bandwidth.upload?
 -                 this.bandwidth.upload + " Kbps" :
 -                 "N/A";
 -         }
 - 
 -         if(!this.transport || this.transport.length === 0)
 -         {
 -             transport = "<tr>" +
 -                 "<td><span class='jitsipopover_blue'>Address:</span></td>" +
 -                 "<td> N/A</td></tr>";
 -         }
 -         else
 -         {
 -             var data = {remoteIP: [], localIP:[], remotePort:[], localPort:[]};
 -             for(i = 0; i < this.transport.length; i++)
 -             {
 -                 var ip =  ConnectionIndicator.getIP(this.transport[i].ip);
 -                 var port = ConnectionIndicator.getPort(this.transport[i].ip);
 -                 var localIP =
 -                     ConnectionIndicator.getIP(this.transport[i].localip);
 -                 var localPort =
 -                     ConnectionIndicator.getPort(this.transport[i].localip);
 -                 if(data.remoteIP.indexOf(ip) == -1)
 -                 {
 -                     data.remoteIP.push(ip);
 -                 }
 - 
 -                 if(data.remotePort.indexOf(port) == -1)
 -                 {
 -                     data.remotePort.push(port);
 -                 }
 - 
 -                 if(data.localIP.indexOf(localIP) == -1)
 -                 {
 -                     data.localIP.push(localIP);
 -                 }
 - 
 -                 if(data.localPort.indexOf(localPort) == -1)
 -                 {
 -                     data.localPort.push(localPort);
 -                 }
 - 
 -             }
 -             var localTransport =
 -                 "<tr><td><span class='jitsipopover_blue'>Local address" +
 -                 (data.localIP.length > 1? "es" : "") + ": </span></td><td> " +
 -                 ConnectionIndicator.getStringFromArray(data.localIP) +
 -                 "</td></tr>";
 -             transport =
 -                 "<tr><td><span class='jitsipopover_blue'>Remote address"+
 -                 (data.remoteIP.length > 1? "es" : "") + ":</span></td><td> " +
 -                 ConnectionIndicator.getStringFromArray(data.remoteIP) +
 -                 "</td></tr>";
 -             if(this.transport.length > 1)
 -             {
 -                 transport += "<tr>" +
 -                     "<td>" +
 -                     "<span class='jitsipopover_blue'>Remote ports:</span>" +
 -                     "</td><td>";
 -                 localTransport += "<tr>" +
 -                     "<td>" +
 -                     "<span class='jitsipopover_blue'>Local ports:</span>" +
 -                     "</td><td>";
 -             }
 -             else
 -             {
 -                 transport +=
 -                     "<tr>" +
 -                     "<td>" +
 -                     "<span class='jitsipopover_blue'>Remote port:</span>" +
 -                     "</td><td>";
 -                 localTransport +=
 -                     "<tr>" +
 -                     "<td>" +
 -                     "<span class='jitsipopover_blue'>Local port:</span>" +
 -                     "</td><td>";
 -             }
 - 
 -             transport +=
 -                 ConnectionIndicator.getStringFromArray(data.remotePort);
 -             localTransport +=
 -                 ConnectionIndicator.getStringFromArray(data.localPort);
 -             transport += "</td></tr>";
 -             transport += localTransport + "</td></tr>";
 -             transport +="<tr>" +
 -                 "<td><span class='jitsipopover_blue'>Transport:</span></td>" +
 -                 "<td>" + this.transport[0].type + "</td></tr>";
 - 
 -         }
 - 
 -         result += "<table  style='width:100%'>" +
 -             "<tr>" +
 -             "<td>" +
 -             "<span class='jitsipopover_blue'>Estimated bandwidth:</span>" +
 -             "</td><td>" +
 -             "<span class='jitsipopover_green'>↓</span>" +
 -             downloadBandwidth +
 -             " <span class='jitsipopover_orange'>↑</span>" +
 -             uploadBandwidth + "</td></tr>";
 - 
 -         result += transport + "</table>";
 - 
 -     }
 - 
 -     return result;
 - };
 - 
 - /**
 -  * Shows or hide the additional information.
 -  */
 - ConnectionIndicator.prototype.showMore = function () {
 -     this.showMoreValue = !this.showMoreValue;
 -     this.updatePopoverData();
 - };
 - 
 - 
 - function createIcon(classes)
 - {
 -     var icon = document.createElement("span");
 -     for(var i in classes)
 -     {
 -         icon.classList.add(classes[i]);
 -     }
 -     icon.appendChild(
 -         document.createElement("i")).classList.add("icon-connection");
 -     return icon;
 - }
 - 
 - /**
 -  * Creates the indicator
 -  */
 - ConnectionIndicator.prototype.create = function () {
 -     this.connectionIndicatorContainer = document.createElement("div");
 -     this.connectionIndicatorContainer.className = "connectionindicator";
 -     this.connectionIndicatorContainer.style.display = "none";
 -     this.videoContainer.appendChild(this.connectionIndicatorContainer);
 -     this.popover = new JitsiPopover(
 -         $("#" + this.videoContainer.id + " > .connectionindicator"),
 -         {content: "<div class=\"connection_info\">Come back here for " +
 -             "connection information once the conference starts</div>",
 -             skin: "black"});
 - 
 -     this.emptyIcon = this.connectionIndicatorContainer.appendChild(
 -         createIcon(["connection", "connection_empty"]));
 -     this.fullIcon = this.connectionIndicatorContainer.appendChild(
 -         createIcon(["connection", "connection_full"]));
 - 
 - };
 - 
 - /**
 -  * Removes the indicator
 -  */
 - ConnectionIndicator.prototype.remove = function()
 - {
 -     this.connectionIndicatorContainer.remove();
 -     this.popover.forceHide();
 - 
 - };
 - 
 - /**
 -  * Updates the data of the indicator
 -  * @param percent the percent of connection quality
 -  * @param object the statistics data.
 -  */
 - ConnectionIndicator.prototype.updateConnectionQuality =
 - function (percent, object) {
 - 
 -     if(percent === null)
 -     {
 -         this.connectionIndicatorContainer.style.display = "none";
 -         this.popover.forceHide();
 -         return;
 -     }
 -     else
 -     {
 -         if(this.connectionIndicatorContainer.style.display == "none") {
 -             this.connectionIndicatorContainer.style.display = "block";
 -             this.videoLayout.updateMutePosition(this.videoContainer.id);
 -         }
 -     }
 -     this.bandwidth = object.bandwidth;
 -     this.bitrate = object.bitrate;
 -     this.packetLoss = object.packetLoss;
 -     this.transport = object.transport;
 -     if(object.resolution)
 -     {
 -         this.resolution = object.resolution;
 -     }
 -     for(var quality in ConnectionIndicator.connectionQualityValues)
 -     {
 -         if(percent >= quality)
 -         {
 -             this.fullIcon.style.width =
 -                 ConnectionIndicator.connectionQualityValues[quality];
 -         }
 -     }
 -     this.updatePopoverData();
 - };
 - 
 - /**
 -  * Updates the resolution
 -  * @param resolution the new resolution
 -  */
 - ConnectionIndicator.prototype.updateResolution = function (resolution) {
 -     this.resolution = resolution;
 -     this.updatePopoverData();
 - };
 - 
 - /**
 -  * Updates the content of the popover
 -  */
 - ConnectionIndicator.prototype.updatePopoverData = function () {
 -     this.popover.updateContent(
 -             "<div class=\"connection_info\">" + this.generateText() + "</div>");
 - };
 - 
 - /**
 -  * Hides the popover
 -  */
 - ConnectionIndicator.prototype.hide = function () {
 -     this.popover.forceHide();
 - };
 - 
 - /**
 -  * Hides the indicator
 -  */
 - ConnectionIndicator.prototype.hideIndicator = function () {
 -     this.connectionIndicatorContainer.style.display = "none";
 -     if(this.popover)
 -         this.popover.forceHide();
 - };
 - 
 - module.exports = ConnectionIndicator;
 - },{"../util/JitsiPopover":19}],23:[function(require,module,exports){
 - var AudioLevels = require("../audio_levels/AudioLevels");
 - var Avatar = require("../avatar/Avatar");
 - var Chat = require("../side_pannels/chat/Chat");
 - var ContactList = require("../side_pannels/contactlist/ContactList");
 - var UIUtil = require("../util/UIUtil");
 - var ConnectionIndicator = require("./ConnectionIndicator");
 - 
 - var currentDominantSpeaker = null;
 - var lastNCount = config.channelLastN;
 - var localLastNCount = config.channelLastN;
 - var localLastNSet = [];
 - var lastNEndpointsCache = [];
 - var lastNPickupJid = null;
 - var largeVideoState = {
 -     updateInProgress: false,
 -     newSrc: ''
 - };
 - 
 - var defaultLocalDisplayName = "Me";
 - 
 - /**
 -  * Returns an array of the video horizontal and vertical indents,
 -  * so that if fits its parent.
 -  *
 -  * @return an array with 2 elements, the horizontal indent and the vertical
 -  * indent
 -  */
 - function getCameraVideoPosition(videoWidth,
 -                                 videoHeight,
 -                                 videoSpaceWidth,
 -                                 videoSpaceHeight) {
 -     // Parent height isn't completely calculated when we position the video in
 -     // full screen mode and this is why we use the screen height in this case.
 -     // Need to think it further at some point and implement it properly.
 -     var isFullScreen = document.fullScreen ||
 -         document.mozFullScreen ||
 -         document.webkitIsFullScreen;
 -     if (isFullScreen)
 -         videoSpaceHeight = window.innerHeight;
 - 
 -     var horizontalIndent = (videoSpaceWidth - videoWidth) / 2;
 -     var verticalIndent = (videoSpaceHeight - videoHeight) / 2;
 - 
 -     return [horizontalIndent, verticalIndent];
 - }
 - 
 - /**
 -  * Returns an array of the video horizontal and vertical indents.
 -  * Centers horizontally and top aligns vertically.
 -  *
 -  * @return an array with 2 elements, the horizontal indent and the vertical
 -  * indent
 -  */
 - function getDesktopVideoPosition(videoWidth,
 -                                  videoHeight,
 -                                  videoSpaceWidth,
 -                                  videoSpaceHeight) {
 - 
 -     var horizontalIndent = (videoSpaceWidth - videoWidth) / 2;
 - 
 -     var verticalIndent = 0;// Top aligned
 - 
 -     return [horizontalIndent, verticalIndent];
 - }
 - 
 - 
 - /**
 -  * Returns an array of the video dimensions, so that it covers the screen.
 -  * It leaves no empty areas, but some parts of the video might not be visible.
 -  *
 -  * @return an array with 2 elements, the video width and the video height
 -  */
 - function getCameraVideoSize(videoWidth,
 -                             videoHeight,
 -                             videoSpaceWidth,
 -                             videoSpaceHeight) {
 -     if (!videoWidth)
 -         videoWidth = currentVideoWidth;
 -     if (!videoHeight)
 -         videoHeight = currentVideoHeight;
 - 
 -     var aspectRatio = videoWidth / videoHeight;
 - 
 -     var availableWidth = Math.max(videoWidth, videoSpaceWidth);
 -     var availableHeight = Math.max(videoHeight, videoSpaceHeight);
 - 
 -     if (availableWidth / aspectRatio < videoSpaceHeight) {
 -         availableHeight = videoSpaceHeight;
 -         availableWidth = availableHeight * aspectRatio;
 -     }
 - 
 -     if (availableHeight * aspectRatio < videoSpaceWidth) {
 -         availableWidth = videoSpaceWidth;
 -         availableHeight = availableWidth / aspectRatio;
 -     }
 - 
 -     return [availableWidth, availableHeight];
 - }
 - 
 - /**
 -  * Sets the display name for the given video span id.
 -  */
 - function setDisplayName(videoSpanId, displayName) {
 -     var nameSpan = $('#' + videoSpanId + '>span.displayname');
 -     var defaultLocalDisplayName = interfaceConfig.DEFAULT_LOCAL_DISPLAY_NAME;
 - 
 -     // If we already have a display name for this video.
 -     if (nameSpan.length > 0) {
 -         var nameSpanElement = nameSpan.get(0);
 - 
 -         if (nameSpanElement.id === 'localDisplayName' &&
 -             $('#localDisplayName').text() !== displayName) {
 -             if (displayName && displayName.length > 0)
 -                 $('#localDisplayName').html(displayName + ' (me)');
 -             else
 -                 $('#localDisplayName').text(defaultLocalDisplayName);
 -         } else {
 -             if (displayName && displayName.length > 0)
 -                 $('#' + videoSpanId + '_name').html(displayName);
 -             else
 -                 $('#' + videoSpanId + '_name').text(interfaceConfig.DEFAULT_REMOTE_DISPLAY_NAME);
 -         }
 -     } else {
 -         var editButton = null;
 - 
 -         nameSpan = document.createElement('span');
 -         nameSpan.className = 'displayname';
 -         $('#' + videoSpanId)[0].appendChild(nameSpan);
 - 
 -         if (videoSpanId === 'localVideoContainer') {
 -             editButton = createEditDisplayNameButton();
 -             nameSpan.innerText = defaultLocalDisplayName;
 -         }
 -         else {
 -             nameSpan.innerText = interfaceConfig.DEFAULT_REMOTE_DISPLAY_NAME;
 -         }
 - 
 -         if (displayName && displayName.length > 0) {
 -             nameSpan.innerText = displayName;
 -         }
 - 
 -         if (!editButton) {
 -             nameSpan.id = videoSpanId + '_name';
 -         } else {
 -             nameSpan.id = 'localDisplayName';
 -             $('#' + videoSpanId)[0].appendChild(editButton);
 - 
 -             var editableText = document.createElement('input');
 -             editableText.className = 'displayname';
 -             editableText.type = 'text';
 -             editableText.id = 'editDisplayName';
 - 
 -             if (displayName && displayName.length) {
 -                 editableText.value
 -                     = displayName.substring(0, displayName.indexOf(' (me)'));
 -             }
 - 
 -             editableText.setAttribute('style', 'display:none;');
 -             editableText.setAttribute('placeholder', 'ex. Jane Pink');
 -             $('#' + videoSpanId)[0].appendChild(editableText);
 - 
 -             $('#localVideoContainer .displayname')
 -                 .bind("click", function (e) {
 - 
 -                     e.preventDefault();
 -                     e.stopPropagation();
 -                     $('#localDisplayName').hide();
 -                     $('#editDisplayName').show();
 -                     $('#editDisplayName').focus();
 -                     $('#editDisplayName').select();
 - 
 -                     $('#editDisplayName').one("focusout", function (e) {
 -                         VideoLayout.inputDisplayNameHandler(this.value);
 -                     });
 - 
 -                     $('#editDisplayName').on('keydown', function (e) {
 -                         if (e.keyCode === 13) {
 -                             e.preventDefault();
 -                             VideoLayout.inputDisplayNameHandler(this.value);
 -                         }
 -                     });
 -                 });
 -         }
 -     }
 - }
 - 
 - /**
 -  * Gets the selector of video thumbnail container for the user identified by
 -  * given <tt>userJid</tt>
 -  * @param resourceJid user's Jid for whom we want to get the video container.
 -  */
 - function getParticipantContainer(resourceJid)
 - {
 -     if (!resourceJid)
 -         return null;
 - 
 -     if (resourceJid === Strophe.getResourceFromJid(connection.emuc.myroomjid))
 -         return $("#localVideoContainer");
 -     else
 -         return $("#participant_" + resourceJid);
 - }
 - 
 - /**
 -  * Sets the size and position of the given video element.
 -  *
 -  * @param video the video element to position
 -  * @param width the desired video width
 -  * @param height the desired video height
 -  * @param horizontalIndent the left and right indent
 -  * @param verticalIndent the top and bottom indent
 -  */
 - function positionVideo(video,
 -                        width,
 -                        height,
 -                        horizontalIndent,
 -                        verticalIndent) {
 -     video.width(width);
 -     video.height(height);
 -     video.css({  top: verticalIndent + 'px',
 -         bottom: verticalIndent + 'px',
 -         left: horizontalIndent + 'px',
 -         right: horizontalIndent + 'px'});
 - }
 - 
 - /**
 -  * Adds the remote video menu element for the given <tt>jid</tt> in the
 -  * given <tt>parentElement</tt>.
 -  *
 -  * @param jid the jid indicating the video for which we're adding a menu.
 -  * @param parentElement the parent element where this menu will be added
 -  */
 - function addRemoteVideoMenu(jid, parentElement) {
 -     var spanElement = document.createElement('span');
 -     spanElement.className = 'remotevideomenu';
 - 
 -     parentElement.appendChild(spanElement);
 - 
 -     var menuElement = document.createElement('i');
 -     menuElement.className = 'fa fa-angle-down';
 -     menuElement.title = 'Remote user controls';
 -     spanElement.appendChild(menuElement);
 - 
 - //        <ul class="popupmenu">
 - //        <li><a href="#">Mute</a></li>
 - //        <li><a href="#">Eject</a></li>
 - //        </ul>
 - 
 -     var popupmenuElement = document.createElement('ul');
 -     popupmenuElement.className = 'popupmenu';
 -     popupmenuElement.id
 -         = 'remote_popupmenu_' + Strophe.getResourceFromJid(jid);
 -     spanElement.appendChild(popupmenuElement);
 - 
 -     var muteMenuItem = document.createElement('li');
 -     var muteLinkItem = document.createElement('a');
 - 
 -     var mutedIndicator = "<i class='icon-mic-disabled'></i>";
 - 
 -     if (!mutedAudios[jid]) {
 -         muteLinkItem.innerHTML = mutedIndicator + 'Mute';
 -         muteLinkItem.className = 'mutelink';
 -     }
 -     else {
 -         muteLinkItem.innerHTML = mutedIndicator + ' Muted';
 -         muteLinkItem.className = 'mutelink disabled';
 -     }
 - 
 -     muteLinkItem.onclick = function(){
 -         if ($(this).attr('disabled') != undefined) {
 -             event.preventDefault();
 -         }
 -         var isMute = mutedAudios[jid] == true;
 -         connection.moderate.setMute(jid, !isMute);
 -         popupmenuElement.setAttribute('style', 'display:none;');
 - 
 -         if (isMute) {
 -             this.innerHTML = mutedIndicator + ' Muted';
 -             this.className = 'mutelink disabled';
 -         }
 -         else {
 -             this.innerHTML = mutedIndicator + ' Mute';
 -             this.className = 'mutelink';
 -         }
 -     };
 - 
 -     muteMenuItem.appendChild(muteLinkItem);
 -     popupmenuElement.appendChild(muteMenuItem);
 - 
 -     var ejectIndicator = "<i class='fa fa-eject'></i>";
 - 
 -     var ejectMenuItem = document.createElement('li');
 -     var ejectLinkItem = document.createElement('a');
 -     ejectLinkItem.innerHTML = ejectIndicator + ' Kick out';
 -     ejectLinkItem.onclick = function(){
 -         connection.moderate.eject(jid);
 -         popupmenuElement.setAttribute('style', 'display:none;');
 -     };
 - 
 -     ejectMenuItem.appendChild(ejectLinkItem);
 -     popupmenuElement.appendChild(ejectMenuItem);
 - 
 -     var paddingSpan = document.createElement('span');
 -     paddingSpan.className = 'popupmenuPadding';
 -     popupmenuElement.appendChild(paddingSpan);
 - }
 - 
 - /**
 -  * Removes remote video menu element from video element identified by
 -  * given <tt>videoElementId</tt>.
 -  *
 -  * @param videoElementId the id of local or remote video element.
 -  */
 - function removeRemoteVideoMenu(videoElementId) {
 -     var menuSpan = $('#' + videoElementId + '>span.remotevideomenu');
 -     if (menuSpan.length) {
 -         menuSpan.remove();
 -     }
 - }
 - 
 - /**
 -  * Updates the data for the indicator
 -  * @param id the id of the indicator
 -  * @param percent the percent for connection quality
 -  * @param object the data
 -  */
 - function updateStatsIndicator(id, percent, object) {
 -     if(VideoLayout.connectionIndicators[id])
 -         VideoLayout.connectionIndicators[id].updateConnectionQuality(percent, object);
 - }
 - 
 - 
 - /**
 -  * Returns an array of the video dimensions, so that it keeps it's aspect
 -  * ratio and fits available area with it's larger dimension. This method
 -  * ensures that whole video will be visible and can leave empty areas.
 -  *
 -  * @return an array with 2 elements, the video width and the video height
 -  */
 - function getDesktopVideoSize(videoWidth,
 -                              videoHeight,
 -                              videoSpaceWidth,
 -                              videoSpaceHeight) {
 -     if (!videoWidth)
 -         videoWidth = currentVideoWidth;
 -     if (!videoHeight)
 -         videoHeight = currentVideoHeight;
 - 
 -     var aspectRatio = videoWidth / videoHeight;
 - 
 -     var availableWidth = Math.max(videoWidth, videoSpaceWidth);
 -     var availableHeight = Math.max(videoHeight, videoSpaceHeight);
 - 
 -     videoSpaceHeight -= $('#remoteVideos').outerHeight();
 - 
 -     if (availableWidth / aspectRatio >= videoSpaceHeight)
 -     {
 -         availableHeight = videoSpaceHeight;
 -         availableWidth = availableHeight * aspectRatio;
 -     }
 - 
 -     if (availableHeight * aspectRatio >= videoSpaceWidth)
 -     {
 -         availableWidth = videoSpaceWidth;
 -         availableHeight = availableWidth / aspectRatio;
 -     }
 - 
 -     return [availableWidth, availableHeight];
 - }
 - 
 - /**
 -  * Creates the edit display name button.
 -  *
 -  * @returns the edit button
 -  */
 - function createEditDisplayNameButton() {
 -     var editButton = document.createElement('a');
 -     editButton.className = 'displayname';
 -     Util.setTooltip(editButton,
 -         'Click to edit your<br/>display name',
 -         "top");
 -     editButton.innerHTML = '<i class="fa fa-pencil"></i>';
 - 
 -     return editButton;
 - }
 - 
 - /**
 -  * Creates the element indicating the moderator(owner) of the conference.
 -  *
 -  * @param parentElement the parent element where the owner indicator will
 -  * be added
 -  */
 - function createModeratorIndicatorElement(parentElement) {
 -     var moderatorIndicator = document.createElement('i');
 -     moderatorIndicator.className = 'fa fa-star';
 -     parentElement.appendChild(moderatorIndicator);
 - 
 -     Util.setTooltip(parentElement,
 -         "The owner of<br/>this conference",
 -         "top");
 - }
 - 
 - 
 - var VideoLayout = (function (my) {
 -     my.connectionIndicators = {};
 - 
 -     // By default we use camera
 -     my.getVideoSize = getCameraVideoSize;
 -     my.getVideoPosition = getCameraVideoPosition;
 - 
 -     my.isInLastN = function(resource) {
 -         return lastNCount < 0 // lastN is disabled, return true
 -             || (lastNCount > 0 && lastNEndpointsCache.length == 0) // lastNEndpoints cache not built yet, return true
 -             || (lastNEndpointsCache && lastNEndpointsCache.indexOf(resource) !== -1);
 -     };
 - 
 -     my.changeLocalStream = function (stream) {
 -         VideoLayout.changeLocalVideo(stream);
 -     };
 - 
 -     my.changeLocalAudio = function(stream) {
 -         RTC.attachMediaStream($('#localAudio'), stream.getOriginalStream());
 -         document.getElementById('localAudio').autoplay = true;
 -         document.getElementById('localAudio').volume = 0;
 -         if (preMuted) {
 -             setAudioMuted(true);
 -             preMuted = false;
 -         }
 -     };
 - 
 -     my.changeLocalVideo = function(stream) {
 -         var flipX = true;
 -         if(stream.type == "desktop")
 -             flipX = false;
 -         var localVideo = document.createElement('video');
 -         localVideo.id = 'localVideo_' +
 -             RTC.getStreamID(stream.getOriginalStream());
 -         localVideo.autoplay = true;
 -         localVideo.volume = 0; // is it required if audio is separated ?
 -         localVideo.oncontextmenu = function () { return false; };
 - 
 -         var localVideoContainer = document.getElementById('localVideoWrapper');
 -         localVideoContainer.appendChild(localVideo);
 - 
 -         // Set default display name.
 -         setDisplayName('localVideoContainer');
 - 
 -         if(!VideoLayout.connectionIndicators["localVideoContainer"]) {
 -             VideoLayout.connectionIndicators["localVideoContainer"]
 -                 = new ConnectionIndicator($("#localVideoContainer")[0], null, VideoLayout);
 -         }
 - 
 -         AudioLevels.updateAudioLevelCanvas(null, VideoLayout);
 - 
 -         var localVideoSelector = $('#' + localVideo.id);
 -         // Add click handler to both video and video wrapper elements in case
 -         // there's no video.
 -         localVideoSelector.click(function (event) {
 -             event.stopPropagation();
 -             VideoLayout.handleVideoThumbClicked(
 -                 RTC.getVideoSrc(localVideo),
 -                 false,
 -                 Strophe.getResourceFromJid(connection.emuc.myroomjid));
 -         });
 -         $('#localVideoContainer').click(function (event) {
 -             event.stopPropagation();
 -             VideoLayout.handleVideoThumbClicked(
 -                 RTC.getVideoSrc(localVideo),
 -                 false,
 -                 Strophe.getResourceFromJid(connection.emuc.myroomjid));
 -         });
 - 
 -         // Add hover handler
 -         $('#localVideoContainer').hover(
 -             function() {
 -                 VideoLayout.showDisplayName('localVideoContainer', true);
 -             },
 -             function() {
 -                 if (!VideoLayout.isLargeVideoVisible()
 -                         || RTC.getVideoSrc(localVideo) !== RTC.getVideoSrc($('#largeVideo')[0]))
 -                     VideoLayout.showDisplayName('localVideoContainer', false);
 -             }
 -         );
 -         // Add stream ended handler
 -         stream.getOriginalStream().onended = function () {
 -             localVideoContainer.removeChild(localVideo);
 -             VideoLayout.updateRemovedVideo(RTC.getVideoSrc(localVideo));
 -         };
 -         // Flip video x axis if needed
 -         flipXLocalVideo = flipX;
 -         if (flipX) {
 -             localVideoSelector.addClass("flipVideoX");
 -         }
 -         // Attach WebRTC stream
 -         var videoStream = simulcast.getLocalVideoStream();
 -         RTC.attachMediaStream(localVideoSelector, videoStream);
 - 
 -         localVideoSrc = RTC.getVideoSrc(localVideo);
 - 
 -         var myResourceJid = null;
 -         if(connection.emuc.myroomjid)
 -         {
 -            myResourceJid = Strophe.getResourceFromJid(connection.emuc.myroomjid);
 -         }
 -         VideoLayout.updateLargeVideo(localVideoSrc, 0,
 -             myResourceJid);
 - 
 -     };
 - 
 -     /**
 -      * Checks if removed video is currently displayed and tries to display
 -      * another one instead.
 -      * @param removedVideoSrc src stream identifier of the video.
 -      */
 -     my.updateRemovedVideo = function(removedVideoSrc) {
 -         if (removedVideoSrc === RTC.getVideoSrc($('#largeVideo')[0])) {
 -             // this is currently displayed as large
 -             // pick the last visible video in the row
 -             // if nobody else is left, this picks the local video
 -             var pick
 -                 = $('#remoteVideos>span[id!="mixedstream"]:visible:last>video')
 -                     .get(0);
 - 
 -             if (!pick) {
 -                 console.info("Last visible video no longer exists");
 -                 pick = $('#remoteVideos>span[id!="mixedstream"]>video').get(0);
 - 
 -                 if (!pick || !RTC.getVideoSrc(pick)) {
 -                     // Try local video
 -                     console.info("Fallback to local video...");
 -                     pick = $('#remoteVideos>span>span>video').get(0);
 -                 }
 -             }
 - 
 -             // mute if localvideo
 -             if (pick) {
 -                 var container = pick.parentNode;
 -                 var jid = null;
 -                 if(container)
 -                 {
 -                     if(container.id == "localVideoWrapper")
 -                     {
 -                         jid = Strophe.getResourceFromJid(connection.emuc.myroomjid);
 -                     }
 -                     else
 -                     {
 -                         jid = VideoLayout.getPeerContainerResourceJid(container);
 -                     }
 -                 }
 - 
 -                 VideoLayout.updateLargeVideo(RTC.getVideoSrc(pick), pick.volume, jid);
 -             } else {
 -                 console.warn("Failed to elect large video");
 -             }
 -         }
 -     };
 -     
 -     my.onRemoteStreamAdded = function (stream) {
 -         var container;
 -         var remotes = document.getElementById('remoteVideos');
 - 
 -         if (stream.peerjid) {
 -             VideoLayout.ensurePeerContainerExists(stream.peerjid);
 - 
 -             container  = document.getElementById(
 -                     'participant_' + Strophe.getResourceFromJid(stream.peerjid));
 -         } else {
 -             var id = stream.getOriginalStream().id;
 -             if (id !== 'mixedmslabel'
 -                 // FIXME: default stream is added always with new focus
 -                 // (to be investigated)
 -                 && id !== 'default') {
 -                 console.error('can not associate stream',
 -                     id,
 -                     'with a participant');
 -                 // We don't want to add it here since it will cause troubles
 -                 return;
 -             }
 -             // FIXME: for the mixed ms we dont need a video -- currently
 -             container = document.createElement('span');
 -             container.id = 'mixedstream';
 -             container.className = 'videocontainer';
 -             remotes.appendChild(container);
 -             Util.playSoundNotification('userJoined');
 -         }
 - 
 -         if (container) {
 -             VideoLayout.addRemoteStreamElement( container,
 -                 stream.sid,
 -                 stream.getOriginalStream(),
 -                 stream.peerjid,
 -                 stream.ssrc);
 -         }
 -     }
 - 
 -     my.getLargeVideoState = function () {
 -         return largeVideoState;
 -     };
 - 
 -     /**
 -      * Updates the large video with the given new video source.
 -      */
 -     my.updateLargeVideo = function(newSrc, vol, resourceJid) {
 -         console.log('hover in', newSrc);
 - 
 -         if (RTC.getVideoSrc($('#largeVideo')[0]) !== newSrc) {
 - 
 -             $('#activeSpeaker').css('visibility', 'hidden');
 -             // Due to the simulcast the localVideoSrc may have changed when the
 -             // fadeOut event triggers. In that case the getJidFromVideoSrc and
 -             // isVideoSrcDesktop methods will not function correctly.
 -             //
 -             // Also, again due to the simulcast, the updateLargeVideo method can
 -             // be called multiple times almost simultaneously. Therefore, we
 -             // store the state here and update only once.
 - 
 -             largeVideoState.newSrc = newSrc;
 -             largeVideoState.isVisible = $('#largeVideo').is(':visible');
 -             largeVideoState.isDesktop = isVideoSrcDesktop(resourceJid);
 -             if(jid2Ssrc[largeVideoState.userResourceJid] ||
 -                 (connection && connection.emuc.myroomjid &&
 -                     largeVideoState.userResourceJid ===
 -                     Strophe.getResourceFromJid(connection.emuc.myroomjid))) {
 -                 largeVideoState.oldResourceJid = largeVideoState.userResourceJid;
 -             } else {
 -                 largeVideoState.oldResourceJid = null;
 -             }
 -             largeVideoState.userResourceJid = resourceJid;
 - 
 -             // Screen stream is already rotated
 -             largeVideoState.flipX = (newSrc === localVideoSrc) && flipXLocalVideo;
 - 
 -             var userChanged = false;
 -             if (largeVideoState.oldResourceJid !== largeVideoState.userResourceJid) {
 -                 userChanged = true;
 -                 // we want the notification to trigger even if userJid is undefined,
 -                 // or null.
 -                 $(document).trigger("selectedendpointchanged", [largeVideoState.userResourceJid]);
 -             }
 - 
 -             if (!largeVideoState.updateInProgress) {
 -                 largeVideoState.updateInProgress = true;
 - 
 -                 var doUpdate = function () {
 - 
 -                     Avatar.updateActiveSpeakerAvatarSrc(
 -                         connection.emuc.findJidFromResource(
 -                             largeVideoState.userResourceJid));
 - 
 -                     if (!userChanged && largeVideoState.preload &&
 -                         largeVideoState.preload !== null &&
 -                         RTC.getVideoSrc($(largeVideoState.preload)[0]) === newSrc)
 -                     {
 - 
 -                         console.info('Switching to preloaded video');
 -                         var attributes = $('#largeVideo').prop("attributes");
 - 
 -                         // loop through largeVideo attributes and apply them on
 -                         // preload.
 -                         $.each(attributes, function () {
 -                             if (this.name !== 'id' && this.name !== 'src') {
 -                                 largeVideoState.preload.attr(this.name, this.value);
 -                             }
 -                         });
 - 
 -                         largeVideoState.preload.appendTo($('#largeVideoContainer'));
 -                         $('#largeVideo').attr('id', 'previousLargeVideo');
 -                         largeVideoState.preload.attr('id', 'largeVideo');
 -                         $('#previousLargeVideo').remove();
 - 
 -                         largeVideoState.preload.on('loadedmetadata', function (e) {
 -                             currentVideoWidth = this.videoWidth;
 -                             currentVideoHeight = this.videoHeight;
 -                             VideoLayout.positionLarge(currentVideoWidth, currentVideoHeight);
 -                         });
 -                         largeVideoState.preload = null;
 -                         largeVideoState.preload_ssrc = 0;
 -                     } else {
 -                         RTC.setVideoSrc($('#largeVideo')[0], largeVideoState.newSrc);
 -                     }
 - 
 -                     var videoTransform = document.getElementById('largeVideo')
 -                         .style.webkitTransform;
 - 
 -                     if (largeVideoState.flipX && videoTransform !== 'scaleX(-1)') {
 -                         document.getElementById('largeVideo').style.webkitTransform
 -                             = "scaleX(-1)";
 -                     }
 -                     else if (!largeVideoState.flipX && videoTransform === 'scaleX(-1)') {
 -                         document.getElementById('largeVideo').style.webkitTransform
 -                             = "none";
 -                     }
 - 
 -                     // Change the way we'll be measuring and positioning large video
 - 
 -                     VideoLayout.getVideoSize = largeVideoState.isDesktop
 -                         ? getDesktopVideoSize
 -                         : getCameraVideoSize;
 -                     VideoLayout.getVideoPosition = largeVideoState.isDesktop
 -                         ? getDesktopVideoPosition
 -                         : getCameraVideoPosition;
 - 
 - 
 -                     // Only if the large video is currently visible.
 -                     // Disable previous dominant speaker video.
 -                     if (largeVideoState.oldResourceJid) {
 -                         VideoLayout.enableDominantSpeaker(
 -                             largeVideoState.oldResourceJid,
 -                             false);
 -                     }
 - 
 -                     // Enable new dominant speaker in the remote videos section.
 -                     if (largeVideoState.userResourceJid) {
 -                         VideoLayout.enableDominantSpeaker(
 -                             largeVideoState.userResourceJid,
 -                             true);
 -                     }
 - 
 -                     if (userChanged && largeVideoState.isVisible) {
 -                         // using "this" should be ok because we're called
 -                         // from within the fadeOut event.
 -                         $(this).fadeIn(300);
 -                     }
 - 
 -                     if(userChanged) {
 -                         Avatar.showUserAvatar(
 -                             connection.emuc.findJidFromResource(
 -                                 largeVideoState.oldResourceJid));
 -                     }
 - 
 -                     largeVideoState.updateInProgress = false;
 -                 };
 - 
 -                 if (userChanged) {
 -                     $('#largeVideo').fadeOut(300, doUpdate);
 -                 } else {
 -                     doUpdate();
 -                 }
 -             }
 -         } else {
 -             Avatar.showUserAvatar(
 -                 connection.emuc.findJidFromResource(
 -                     largeVideoState.userResourceJid));
 -         }
 - 
 -     };
 - 
 -     my.handleVideoThumbClicked = function(videoSrc,
 -                                           noPinnedEndpointChangedEvent, 
 -                                           resourceJid) {
 -         // Restore style for previously focused video
 -         var oldContainer = null;
 -         if(focusedVideoInfo) {
 -             var focusResourceJid = focusedVideoInfo.resourceJid;
 -             oldContainer = getParticipantContainer(focusResourceJid);
 -         }
 - 
 -         if (oldContainer) {
 -             oldContainer.removeClass("videoContainerFocused");
 -         }
 - 
 -         // Unlock current focused.
 -         if (focusedVideoInfo && focusedVideoInfo.src === videoSrc)
 -         {
 -             focusedVideoInfo = null;
 -             var dominantSpeakerVideo = null;
 -             // Enable the currently set dominant speaker.
 -             if (currentDominantSpeaker) {
 -                 dominantSpeakerVideo
 -                     = $('#participant_' + currentDominantSpeaker + '>video')
 -                         .get(0);
 - 
 -                 if (dominantSpeakerVideo) {
 -                     VideoLayout.updateLargeVideo(
 -                         RTC.getVideoSrc(dominantSpeakerVideo),
 -                         1,
 -                         currentDominantSpeaker);
 -                 }
 -             }
 - 
 -             if (!noPinnedEndpointChangedEvent) {
 -                 $(document).trigger("pinnedendpointchanged");
 -             }
 -             return;
 -         }
 - 
 -         // Lock new video
 -         focusedVideoInfo = {
 -             src: videoSrc,
 -             resourceJid: resourceJid
 -         };
 - 
 -         // Update focused/pinned interface.
 -         if (resourceJid)
 -         {
 -             var container = getParticipantContainer(resourceJid);
 -             container.addClass("videoContainerFocused");
 - 
 -             if (!noPinnedEndpointChangedEvent) {
 -                 $(document).trigger("pinnedendpointchanged", [resourceJid]);
 -             }
 -         }
 - 
 -         if ($('#largeVideo').attr('src') === videoSrc &&
 -             VideoLayout.isLargeVideoOnTop()) {
 -             return;
 -         }
 - 
 -         // Triggers a "video.selected" event. The "false" parameter indicates
 -         // this isn't a prezi.
 -         $(document).trigger("video.selected", [false]);
 - 
 -         VideoLayout.updateLargeVideo(videoSrc, 1, resourceJid);
 - 
 -         $('audio').each(function (idx, el) {
 -             if (el.id.indexOf('mixedmslabel') !== -1) {
 -                 el.volume = 0;
 -                 el.volume = 1;
 -             }
 -         });
 -     };
 - 
 -     /**
 -      * Positions the large video.
 -      *
 -      * @param videoWidth the stream video width
 -      * @param videoHeight the stream video height
 -      */
 -     my.positionLarge = function (videoWidth, videoHeight) {
 -         var videoSpaceWidth = $('#videospace').width();
 -         var videoSpaceHeight = window.innerHeight;
 - 
 -         var videoSize = VideoLayout.getVideoSize(videoWidth,
 -                                      videoHeight,
 -                                      videoSpaceWidth,
 -                                      videoSpaceHeight);
 - 
 -         var largeVideoWidth = videoSize[0];
 -         var largeVideoHeight = videoSize[1];
 - 
 -         var videoPosition = VideoLayout.getVideoPosition(largeVideoWidth,
 -                                              largeVideoHeight,
 -                                              videoSpaceWidth,
 -                                              videoSpaceHeight);
 - 
 -         var horizontalIndent = videoPosition[0];
 -         var verticalIndent = videoPosition[1];
 - 
 -         positionVideo($('#largeVideo'),
 -                       largeVideoWidth,
 -                       largeVideoHeight,
 -                       horizontalIndent, verticalIndent);
 -     };
 - 
 -     /**
 -      * Shows/hides the large video.
 -      */
 -     my.setLargeVideoVisible = function(isVisible) {
 -         var resourceJid = largeVideoState.userResourceJid;
 - 
 -         if (isVisible) {
 -             $('#largeVideo').css({visibility: 'visible'});
 -             $('.watermark').css({visibility: 'visible'});
 -             VideoLayout.enableDominantSpeaker(resourceJid, true);
 -         }
 -         else {
 -             $('#largeVideo').css({visibility: 'hidden'});
 -             $('#activeSpeaker').css('visibility', 'hidden');
 -             $('.watermark').css({visibility: 'hidden'});
 -             VideoLayout.enableDominantSpeaker(resourceJid, false);
 -             if(focusedVideoInfo) {
 -                 var focusResourceJid = focusedVideoInfo.resourceJid;
 -                 var oldContainer = getParticipantContainer(focusResourceJid);
 - 
 -                 if (oldContainer && oldContainer.length > 0) {
 -                     oldContainer.removeClass("videoContainerFocused");
 -                 }
 -                 focusedVideoInfo = null;
 -                 if(focusResourceJid) {
 -                     Avatar.showUserAvatar(
 -                         connection.emuc.findJidFromResource(focusResourceJid));
 -                 }
 -             }
 -         }
 -     };
 - 
 -     /**
 -      * Indicates if the large video is currently visible.
 -      *
 -      * @return <tt>true</tt> if visible, <tt>false</tt> - otherwise
 -      */
 -     my.isLargeVideoVisible = function() {
 -         return $('#largeVideo').is(':visible');
 -     };
 - 
 -     my.isLargeVideoOnTop = function () {
 -         var Etherpad = require("../etherpad/Etherpad");
 -         var Prezi = require("../prezi/Prezi");
 -         return !Prezi.isPresentationVisible() && !Etherpad.isVisible();
 -     };
 - 
 -     /**
 -      * Checks if container for participant identified by given peerJid exists
 -      * in the document and creates it eventually.
 -      * 
 -      * @param peerJid peer Jid to check.
 -      * @param userId user email or id for setting the avatar
 -      * 
 -      * @return Returns <tt>true</tt> if the peer container exists,
 -      * <tt>false</tt> - otherwise
 -      */
 -     my.ensurePeerContainerExists = function(peerJid, userId) {
 -         ContactList.ensureAddContact(peerJid, userId);
 - 
 -         var resourceJid = Strophe.getResourceFromJid(peerJid);
 - 
 -         var videoSpanId = 'participant_' + resourceJid;
 - 
 -         if (!$('#' + videoSpanId).length) {
 -             var container =
 -                 VideoLayout.addRemoteVideoContainer(peerJid, videoSpanId, userId);
 -             Avatar.setUserAvatar(peerJid, userId);
 -             // Set default display name.
 -             setDisplayName(videoSpanId);
 - 
 -             VideoLayout.connectionIndicators[videoSpanId] =
 -                 new ConnectionIndicator(container, peerJid, VideoLayout);
 - 
 -             var nickfield = document.createElement('span');
 -             nickfield.className = "nick";
 -             nickfield.appendChild(document.createTextNode(resourceJid));
 -             container.appendChild(nickfield);
 - 
 -             // In case this is not currently in the last n we don't show it.
 -             if (localLastNCount
 -                 && localLastNCount > 0
 -                 && $('#remoteVideos>span').length >= localLastNCount + 2) {
 -                 showPeerContainer(resourceJid, 'hide');
 -             }
 -             else
 -                 VideoLayout.resizeThumbnails();
 -         }
 -     };
 - 
 -     my.addRemoteVideoContainer = function(peerJid, spanId) {
 -         var container = document.createElement('span');
 -         container.id = spanId;
 -         container.className = 'videocontainer';
 -         var remotes = document.getElementById('remoteVideos');
 - 
 -         // If the peerJid is null then this video span couldn't be directly
 -         // associated with a participant (this could happen in the case of prezi).
 -         if (Moderator.isModerator() && peerJid !== null)
 -             addRemoteVideoMenu(peerJid, container);
 - 
 -         remotes.appendChild(container);
 -         AudioLevels.updateAudioLevelCanvas(peerJid, VideoLayout);
 - 
 -         return container;
 -     };
 - 
 -     /**
 -      * Creates an audio or video stream element.
 -      */
 -     my.createStreamElement = function (sid, stream) {
 -         var isVideo = stream.getVideoTracks().length > 0;
 - 
 -         var element = isVideo
 -                         ? document.createElement('video')
 -                         : document.createElement('audio');
 -         var id = (isVideo ? 'remoteVideo_' : 'remoteAudio_')
 -                     + sid + '_' + RTC.getStreamID(stream);
 - 
 -         element.id = id;
 -         element.autoplay = true;
 -         element.oncontextmenu = function () { return false; };
 - 
 -         return element;
 -     };
 - 
 -     my.addRemoteStreamElement
 -         = function (container, sid, stream, peerJid, thessrc) {
 -         var newElementId = null;
 - 
 -         var isVideo = stream.getVideoTracks().length > 0;
 - 
 -         if (container) {
 -             var streamElement = VideoLayout.createStreamElement(sid, stream);
 -             newElementId = streamElement.id;
 - 
 -             container.appendChild(streamElement);
 - 
 -             var sel = $('#' + newElementId);
 -             sel.hide();
 - 
 -             // If the container is currently visible we attach the stream.
 -             if (!isVideo
 -                 || (container.offsetParent !== null && isVideo)) {
 -                 var videoStream = simulcast.getReceivingVideoStream(stream);
 -                 RTC.attachMediaStream(sel, videoStream);
 - 
 -                 if (isVideo)
 -                     waitForRemoteVideo(sel, thessrc, stream, peerJid);
 -             }
 - 
 -             stream.onended = function () {
 -                 console.log('stream ended', this);
 - 
 -                 VideoLayout.removeRemoteStreamElement(
 -                     stream, isVideo, container);
 - 
 -                 // NOTE(gp) it seems that under certain circumstances, the
 -                 // onended event is not fired and thus the contact list is not
 -                 // updated.
 -                 //
 -                 // The onended event of a stream should be fired when the SSRCs
 -                 // corresponding to that stream are removed from the SDP; but
 -                 // this doesn't seem to always be the case, resulting in ghost
 -                 // contacts.
 -                 //
 -                 // In an attempt to fix the ghost contacts problem, I'm moving
 -                 // the removeContact() method call in app.js, inside the
 -                 // 'muc.left' event handler.
 - 
 -                 //if (peerJid)
 -                 //    ContactList.removeContact(peerJid);
 -             };
 - 
 -             // Add click handler.
 -             container.onclick = function (event) {
 -                 /*
 -                  * FIXME It turns out that videoThumb may not exist (if there is
 -                  * no actual video).
 -                  */
 -                 var videoThumb = $('#' + container.id + '>video').get(0);
 -                 if (videoThumb) {
 -                     VideoLayout.handleVideoThumbClicked(
 -                         RTC.getVideoSrc(videoThumb),
 -                         false,
 -                         Strophe.getResourceFromJid(peerJid));
 -                 }
 - 
 -                 event.stopPropagation();
 -                 event.preventDefault();
 -                 return false;
 -             };
 - 
 -             // Add hover handler
 -             $(container).hover(
 -                 function() {
 -                     VideoLayout.showDisplayName(container.id, true);
 -                 },
 -                 function() {
 -                     var videoSrc = null;
 -                     if ($('#' + container.id + '>video')
 -                             && $('#' + container.id + '>video').length > 0) {
 -                         videoSrc = RTC.getVideoSrc($('#' + container.id + '>video').get(0));
 -                     }
 - 
 -                     // If the video has been "pinned" by the user we want to
 -                     // keep the display name on place.
 -                     if (!VideoLayout.isLargeVideoVisible()
 -                             || videoSrc !== RTC.getVideoSrc($('#largeVideo')[0]))
 -                         VideoLayout.showDisplayName(container.id, false);
 -                 }
 -             );
 -         }
 - 
 -         return newElementId;
 -     };
 - 
 -     /**
 -      * Removes the remote stream element corresponding to the given stream and
 -      * parent container.
 -      * 
 -      * @param stream the stream
 -      * @param isVideo <tt>true</tt> if given <tt>stream</tt> is a video one.
 -      * @param container
 -      */
 -     my.removeRemoteStreamElement = function (stream, isVideo, container) {
 -         if (!container)
 -             return;
 - 
 -         var select = null;
 -         var removedVideoSrc = null;
 -         if (isVideo) {
 -             select = $('#' + container.id + '>video');
 -             removedVideoSrc = RTC.getVideoSrc(select.get(0));
 -         }
 -         else
 -             select = $('#' + container.id + '>audio');
 - 
 - 
 -         // Mark video as removed to cancel waiting loop(if video is removed
 -         // before has started)
 -         select.removed = true;
 -         select.remove();
 - 
 -         var audioCount = $('#' + container.id + '>audio').length;
 -         var videoCount = $('#' + container.id + '>video').length;
 - 
 -         if (!audioCount && !videoCount) {
 -             console.log("Remove whole user", container.id);
 -             if(VideoLayout.connectionIndicators[container.id])
 -                 VideoLayout.connectionIndicators[container.id].remove();
 -             // Remove whole container
 -             container.remove();
 - 
 -             Util.playSoundNotification('userLeft');
 -             VideoLayout.resizeThumbnails();
 -         }
 - 
 -         if (removedVideoSrc)
 -             VideoLayout.updateRemovedVideo(removedVideoSrc);
 -     };
 - 
 -     /**
 -      * Show/hide peer container for the given resourceJid.
 -      */
 -     function showPeerContainer(resourceJid, state) {
 -         var peerContainer = $('#participant_' + resourceJid);
 - 
 -         if (!peerContainer)
 -             return;
 - 
 -         var isHide = state === 'hide';
 -         var resizeThumbnails = false;
 - 
 -         if (!isHide) {
 -             if (!peerContainer.is(':visible')) {
 -                 resizeThumbnails = true;
 -                 peerContainer.show();
 -             }
 - 
 -             if (state == 'show')
 -             {
 -                 // peerContainer.css('-webkit-filter', '');
 -                 var jid = connection.emuc.findJidFromResource(resourceJid);
 -                 Avatar.showUserAvatar(jid, false);
 -             }
 -             else // if (state == 'avatar')
 -             {
 -                 // peerContainer.css('-webkit-filter', 'grayscale(100%)');
 -                 var jid = connection.emuc.findJidFromResource(resourceJid);
 -                 Avatar.showUserAvatar(jid, true);
 -             }
 -         }
 -         else if (peerContainer.is(':visible') && isHide)
 -         {
 -             resizeThumbnails = true;
 -             peerContainer.hide();
 -             if(VideoLayout.connectionIndicators['participant_' + resourceJid])
 -                 VideoLayout.connectionIndicators['participant_' + resourceJid].hide();
 -         }
 - 
 -         if (resizeThumbnails) {
 -             VideoLayout.resizeThumbnails();
 -         }
 - 
 -         // We want to be able to pin a participant from the contact list, even
 -         // if he's not in the lastN set!
 -         // ContactList.setClickable(resourceJid, !isHide);
 - 
 -     };
 - 
 -     my.inputDisplayNameHandler = function (name) {
 -         if (name && nickname !== name) {
 -             nickname = name;
 -             window.localStorage.displayname = nickname;
 -             connection.emuc.addDisplayNameToPresence(nickname);
 -             connection.emuc.sendPresence();
 - 
 -             Chat.setChatConversationMode(true);
 -         }
 - 
 -         if (!$('#localDisplayName').is(":visible")) {
 -             if (nickname)
 -                 $('#localDisplayName').text(nickname + " (me)");
 -             else
 -                 $('#localDisplayName')
 -                     .text(interfaceConfig.DEFAULT_LOCAL_DISPLAY_NAME);
 -             $('#localDisplayName').show();
 -         }
 - 
 -         $('#editDisplayName').hide();
 -     };
 - 
 -     /**
 -      * Shows/hides the display name on the remote video.
 -      * @param videoSpanId the identifier of the video span element
 -      * @param isShow indicates if the display name should be shown or hidden
 -      */
 -     my.showDisplayName = function(videoSpanId, isShow) {
 -         var nameSpan = $('#' + videoSpanId + '>span.displayname').get(0);
 -         if (isShow) {
 -             if (nameSpan && nameSpan.innerHTML && nameSpan.innerHTML.length) 
 -                 nameSpan.setAttribute("style", "display:inline-block;");
 -         }
 -         else {
 -             if (nameSpan)
 -                 nameSpan.setAttribute("style", "display:none;");
 -         }
 -     };
 - 
 -     /**
 -      * Shows the presence status message for the given video.
 -      */
 -     my.setPresenceStatus = function (videoSpanId, statusMsg) {
 - 
 -         if (!$('#' + videoSpanId).length) {
 -             // No container
 -             return;
 -         }
 - 
 -         var statusSpan = $('#' + videoSpanId + '>span.status');
 -         if (!statusSpan.length) {
 -             //Add status span
 -             statusSpan = document.createElement('span');
 -             statusSpan.className = 'status';
 -             statusSpan.id = videoSpanId + '_status';
 -             $('#' + videoSpanId)[0].appendChild(statusSpan);
 - 
 -             statusSpan = $('#' + videoSpanId + '>span.status');
 -         }
 - 
 -         // Display status
 -         if (statusMsg && statusMsg.length) {
 -             $('#' + videoSpanId + '_status').text(statusMsg);
 -             statusSpan.get(0).setAttribute("style", "display:inline-block;");
 -         }
 -         else {
 -             // Hide
 -             statusSpan.get(0).setAttribute("style", "display:none;");
 -         }
 -     };
 - 
 -     /**
 -      * Shows a visual indicator for the moderator of the conference.
 -      */
 -     my.showModeratorIndicator = function () {
 - 
 -         var isModerator = Moderator.isModerator();
 -         if (isModerator) {
 -             var indicatorSpan = $('#localVideoContainer .focusindicator');
 - 
 -             if (indicatorSpan.children().length === 0)
 -             {
 -                 createModeratorIndicatorElement(indicatorSpan[0]);
 -             }
 -         }
 -         Object.keys(connection.emuc.members).forEach(function (jid) {
 - 
 -             if (Strophe.getResourceFromJid(jid) === 'focus') {
 -                 // Skip server side focus
 -                 return;
 -             }
 - 
 -             var resourceJid = Strophe.getResourceFromJid(jid);
 -             var videoSpanId = 'participant_' + resourceJid;
 -             var videoContainer = document.getElementById(videoSpanId);
 - 
 -             if (!videoContainer) {
 -                 console.error("No video container for " + jid);
 -                 return;
 -             }
 - 
 -             var member = connection.emuc.members[jid];
 - 
 -             if (member.role === 'moderator') {
 -                 // Remove menu if peer is moderator
 -                 var menuSpan = $('#' + videoSpanId + '>span.remotevideomenu');
 -                 if (menuSpan.length) {
 -                     removeRemoteVideoMenu(videoSpanId);
 -                 }
 -                 // Show moderator indicator
 -                 var indicatorSpan
 -                     = $('#' + videoSpanId + ' .focusindicator');
 - 
 -                 if (!indicatorSpan || indicatorSpan.length === 0) {
 -                     indicatorSpan = document.createElement('span');
 -                     indicatorSpan.className = 'focusindicator';
 - 
 -                     videoContainer.appendChild(indicatorSpan);
 - 
 -                     createModeratorIndicatorElement(indicatorSpan);
 -                 }
 -             } else if (isModerator) {
 -                 // We are moderator, but user is not - add menu
 -                 if ($('#remote_popupmenu_' + resourceJid).length <= 0) {
 -                     addRemoteVideoMenu(
 -                         jid,
 -                         document.getElementById('participant_' + resourceJid));
 -                 }
 -             }
 -         });
 -     };
 - 
 -     /**
 -      * Shows video muted indicator over small videos.
 -      */
 -     my.showVideoIndicator = function(videoSpanId, isMuted) {
 -         var videoMutedSpan = $('#' + videoSpanId + '>span.videoMuted');
 - 
 -         if (isMuted === 'false') {
 -             if (videoMutedSpan.length > 0) {
 -                 videoMutedSpan.remove();
 -             }
 -         }
 -         else {
 -             if(videoMutedSpan.length == 0) {
 -                 videoMutedSpan = document.createElement('span');
 -                 videoMutedSpan.className = 'videoMuted';
 - 
 -                 $('#' + videoSpanId)[0].appendChild(videoMutedSpan);
 - 
 -                 var mutedIndicator = document.createElement('i');
 -                 mutedIndicator.className = 'icon-camera-disabled';
 -                 Util.setTooltip(mutedIndicator,
 -                     "Participant has<br/>stopped the camera.",
 -                     "top");
 -                 videoMutedSpan.appendChild(mutedIndicator);
 -             }
 - 
 -             VideoLayout.updateMutePosition(videoSpanId);
 - 
 -         }
 -     };
 - 
 -     my.updateMutePosition = function (videoSpanId) {
 -         var audioMutedSpan = $('#' + videoSpanId + '>span.audioMuted');
 -         var connectionIndicator = $('#' + videoSpanId + '>div.connectionindicator');
 -         var videoMutedSpan = $('#' + videoSpanId + '>span.videoMuted');
 -         if(connectionIndicator.length > 0
 -             && connectionIndicator[0].style.display != "none") {
 -             audioMutedSpan.css({right: "23px"});
 -             videoMutedSpan.css({right: ((audioMutedSpan.length > 0? 23 : 0) + 30) + "px"});
 -         }
 -         else
 -         {
 -             audioMutedSpan.css({right: "0px"});
 -             videoMutedSpan.css({right: (audioMutedSpan.length > 0? 30 : 0) + "px"});
 -         }
 -     }
 -     /**
 -      * Shows audio muted indicator over small videos.
 -      * @param {string} isMuted
 -      */
 -     my.showAudioIndicator = function(videoSpanId, isMuted) {
 -         var audioMutedSpan = $('#' + videoSpanId + '>span.audioMuted');
 - 
 -         if (isMuted === 'false') {
 -             if (audioMutedSpan.length > 0) {
 -                 audioMutedSpan.popover('hide');
 -                 audioMutedSpan.remove();
 -             }
 -         }
 -         else {
 -             if(audioMutedSpan.length == 0 ) {
 -                 audioMutedSpan = document.createElement('span');
 -                 audioMutedSpan.className = 'audioMuted';
 -                 Util.setTooltip(audioMutedSpan,
 -                     "Participant is muted",
 -                     "top");
 - 
 -                 $('#' + videoSpanId)[0].appendChild(audioMutedSpan);
 -                 var mutedIndicator = document.createElement('i');
 -                 mutedIndicator.className = 'icon-mic-disabled';
 -                 audioMutedSpan.appendChild(mutedIndicator);
 - 
 -             }
 -             VideoLayout.updateMutePosition(videoSpanId);
 -         }
 -     };
 - 
 -     /*
 -      * Shows or hides the audio muted indicator over the local thumbnail video.
 -      * @param {boolean} isMuted
 -      */
 -     my.showLocalAudioIndicator = function(isMuted) {
 -         VideoLayout.showAudioIndicator('localVideoContainer', isMuted.toString());
 -     };
 - 
 -     /**
 -      * Resizes the large video container.
 -      */
 -     my.resizeLargeVideoContainer = function () {
 -         Chat.resizeChat();
 -         var availableHeight = window.innerHeight;
 -         var availableWidth = UIUtil.getAvailableVideoWidth();
 - 
 -         if (availableWidth < 0 || availableHeight < 0) return;
 - 
 -         $('#videospace').width(availableWidth);
 -         $('#videospace').height(availableHeight);
 -         $('#largeVideoContainer').width(availableWidth);
 -         $('#largeVideoContainer').height(availableHeight);
 - 
 -         var avatarSize = interfaceConfig.ACTIVE_SPEAKER_AVATAR_SIZE;
 -         var top = availableHeight / 2 - avatarSize / 4 * 3;
 -         $('#activeSpeaker').css('top', top);
 - 
 -         VideoLayout.resizeThumbnails();
 -     };
 - 
 -     /**
 -      * Resizes thumbnails.
 -      */
 -     my.resizeThumbnails = function() {
 -         var videoSpaceWidth = $('#remoteVideos').width();
 - 
 -         var thumbnailSize = VideoLayout.calculateThumbnailSize(videoSpaceWidth);
 -         var width = thumbnailSize[0];
 -         var height = thumbnailSize[1];
 - 
 -         // size videos so that while keeping AR and max height, we have a
 -         // nice fit
 -         $('#remoteVideos').height(height);
 -         $('#remoteVideos>span').width(width);
 -         $('#remoteVideos>span').height(height);
 - 
 -         $('.userAvatar').css('left', (width - height) / 2);
 - 
 -         $(document).trigger("remotevideo.resized", [width, height]);
 -     };
 - 
 -     /**
 -      * Enables the dominant speaker UI.
 -      *
 -      * @param resourceJid the jid indicating the video element to
 -      * activate/deactivate
 -      * @param isEnable indicates if the dominant speaker should be enabled or
 -      * disabled
 -      */
 -     my.enableDominantSpeaker = function(resourceJid, isEnable) {
 - 
 -         var videoSpanId = null;
 -         var videoContainerId = null;
 -         if (resourceJid
 -                 === Strophe.getResourceFromJid(connection.emuc.myroomjid)) {
 -             videoSpanId = 'localVideoWrapper';
 -             videoContainerId = 'localVideoContainer';
 -         }
 -         else {
 -             videoSpanId = 'participant_' + resourceJid;
 -             videoContainerId = videoSpanId;
 -         }
 - 
 -         var displayName = resourceJid;
 -         var nameSpan = $('#' + videoContainerId + '>span.displayname');
 -         if (nameSpan.length > 0)
 -             displayName = nameSpan.html();
 - 
 -         console.log("UI enable dominant speaker",
 -             displayName,
 -             resourceJid,
 -             isEnable);
 - 
 -         videoSpan = document.getElementById(videoContainerId);
 - 
 -         if (!videoSpan) {
 -             return;
 -         }
 - 
 -         var video = $('#' + videoSpanId + '>video');
 - 
 -         if (video && video.length > 0) {
 -             if (isEnable) {
 -                 var isLargeVideoVisible = VideoLayout.isLargeVideoOnTop();
 -                 VideoLayout.showDisplayName(videoContainerId, isLargeVideoVisible);
 - 
 -                 if (!videoSpan.classList.contains("dominantspeaker"))
 -                     videoSpan.classList.add("dominantspeaker");
 -             }
 -             else {
 -                 VideoLayout.showDisplayName(videoContainerId, false);
 - 
 -                 if (videoSpan.classList.contains("dominantspeaker"))
 -                     videoSpan.classList.remove("dominantspeaker");
 -             }
 - 
 -             Avatar.showUserAvatar(
 -                 connection.emuc.findJidFromResource(resourceJid));
 -         }
 -     };
 - 
 -     /**
 -      * Calculates the thumbnail size.
 -      *
 -      * @param videoSpaceWidth the width of the video space
 -      */
 -     my.calculateThumbnailSize = function (videoSpaceWidth) {
 -         // Calculate the available height, which is the inner window height minus
 -        // 39px for the header minus 2px for the delimiter lines on the top and
 -        // bottom of the large video, minus the 36px space inside the remoteVideos
 -        // container used for highlighting shadow.
 -        var availableHeight = 100;
 - 
 -         var numvids = $('#remoteVideos>span:visible').length;
 -         if (localLastNCount && localLastNCount > 0) {
 -             numvids = Math.min(localLastNCount + 1, numvids);
 -         }
 - 
 -        // Remove the 3px borders arround videos and border around the remote
 -        // videos area and the 4 pixels between the local video and the others
 -        //TODO: Find out where the 4 pixels come from and remove them
 -        var availableWinWidth = videoSpaceWidth - 2 * 3 * numvids - 70 - 4;
 - 
 -        var availableWidth = availableWinWidth / numvids;
 -        var aspectRatio = 16.0 / 9.0;
 -        var maxHeight = Math.min(160, availableHeight);
 -        availableHeight = Math.min(maxHeight, availableWidth / aspectRatio);
 -        if (availableHeight < availableWidth / aspectRatio) {
 -            availableWidth = Math.floor(availableHeight * aspectRatio);
 -        }
 - 
 -        return [availableWidth, availableHeight];
 -    };
 - 
 -     /**
 -      * Updates the remote video menu.
 -      *
 -      * @param jid the jid indicating the video for which we're adding a menu.
 -      * @param isMuted indicates the current mute state
 -      */
 -     my.updateRemoteVideoMenu = function(jid, isMuted) {
 -         var muteMenuItem
 -             = $('#remote_popupmenu_'
 -                     + Strophe.getResourceFromJid(jid)
 -                     + '>li>a.mutelink');
 - 
 -         var mutedIndicator = "<i class='icon-mic-disabled'></i>";
 - 
 -         if (muteMenuItem.length) {
 -             var muteLink = muteMenuItem.get(0);
 - 
 -             if (isMuted === 'true') {
 -                 muteLink.innerHTML = mutedIndicator + ' Muted';
 -                 muteLink.className = 'mutelink disabled';
 -             }
 -             else {
 -                 muteLink.innerHTML = mutedIndicator + ' Mute';
 -                 muteLink.className = 'mutelink';
 -             }
 -         }
 -     };
 - 
 -     /**
 -      * Returns the current dominant speaker resource jid.
 -      */
 -     my.getDominantSpeakerResourceJid = function () {
 -         return currentDominantSpeaker;
 -     };
 - 
 -     /**
 -      * Returns the corresponding resource jid to the given peer container
 -      * DOM element.
 -      *
 -      * @return the corresponding resource jid to the given peer container
 -      * DOM element
 -      */
 -     my.getPeerContainerResourceJid = function (containerElement) {
 -         var i = containerElement.id.indexOf('participant_');
 - 
 -         if (i >= 0)
 -             return containerElement.id.substring(i + 12); 
 -     };
 - 
 -     /**
 -      * On contact list item clicked.
 -      */
 -     $(ContactList).bind('contactclicked', function(event, jid) {
 -         if (!jid) {
 -             return;
 -         }
 - 
 -         var resource = Strophe.getResourceFromJid(jid);
 -         var videoContainer = $("#participant_" + resource);
 -         if (videoContainer.length > 0) {
 -             var videoThumb = $('video', videoContainer).get(0);
 -             // It is not always the case that a videoThumb exists (if there is
 -             // no actual video).
 -             if (videoThumb) {
 -                 if (videoThumb.src && videoThumb.src != '') {
 - 
 -                     // We have a video src, great! Let's update the large video
 -                     // now.
 - 
 -                     VideoLayout.handleVideoThumbClicked(
 -                         videoThumb.src,
 -                         false,
 -                         Strophe.getResourceFromJid(jid));
 -                 } else {
 - 
 -                     // If we don't have a video src for jid, there's absolutely
 -                     // no point in calling handleVideoThumbClicked; Quite
 -                     // simply, it won't work because it needs an src to attach
 -                     // to the large video.
 -                     //
 -                     // Instead, we trigger the pinned endpoint changed event to
 -                     // let the bridge adjust its lastN set for myjid and store
 -                     // the pinned user in the lastNPickupJid variable to be
 -                     // picked up later by the lastN changed event handler.
 - 
 -                     lastNPickupJid = jid;
 -                     $(document).trigger("pinnedendpointchanged", [jid]);
 -                 }
 -             } else if (jid == connection.emuc.myroomjid) {
 -                 $("#localVideoContainer").click();
 -             }
 -         }
 -     });
 - 
 -     /**
 -      * On audio muted event.
 -      */
 -     $(document).bind('audiomuted.muc', function (event, jid, isMuted) {
 -         /*
 -          // FIXME: but focus can not mute in this case ? - check
 -         if (jid === connection.emuc.myroomjid) {
 - 
 -             // The local mute indicator is controlled locally
 -             return;
 -         }*/
 -         var videoSpanId = null;
 -         if (jid === connection.emuc.myroomjid) {
 -             videoSpanId = 'localVideoContainer';
 -         } else {
 -             VideoLayout.ensurePeerContainerExists(jid);
 -             videoSpanId = 'participant_' + Strophe.getResourceFromJid(jid);
 -         }
 - 
 -         mutedAudios[jid] = isMuted;
 - 
 -         if (Moderator.isModerator()) {
 -             VideoLayout.updateRemoteVideoMenu(jid, isMuted);
 -         }
 - 
 -         if (videoSpanId)
 -             VideoLayout.showAudioIndicator(videoSpanId, isMuted);
 -     });
 - 
 -     /**
 -      * On video muted event.
 -      */
 -     $(document).bind('videomuted.muc', function (event, jid, value) {
 -         var isMuted = (value === "true");
 -         if(!RTC.muteRemoteVideoStream(jid, isMuted))
 -             return;
 - 
 -         Avatar.showUserAvatar(jid, isMuted);
 -         var videoSpanId = null;
 -         if (jid === connection.emuc.myroomjid) {
 -             videoSpanId = 'localVideoContainer';
 -         } else {
 -             VideoLayout.ensurePeerContainerExists(jid);
 -             videoSpanId = 'participant_' + Strophe.getResourceFromJid(jid);
 -         }
 - 
 -         if (videoSpanId)
 -             VideoLayout.showVideoIndicator(videoSpanId, value);
 -     });
 - 
 -     /**
 -      * Display name changed.
 -      */
 -     $(document).bind('displaynamechanged',
 -                     function (event, jid, displayName, status) {
 -         var name = null;
 -         if (jid === 'localVideoContainer'
 -             || jid === connection.emuc.myroomjid) {
 -             name = nickname;
 -             setDisplayName('localVideoContainer',
 -                            displayName);
 -         } else {
 -             VideoLayout.ensurePeerContainerExists(jid);
 -             name = $('#participant_' + Strophe.getResourceFromJid(jid) + "_name").text();
 -             setDisplayName(
 -                 'participant_' + Strophe.getResourceFromJid(jid),
 -                 displayName,
 -                 status);
 -         }
 - 
 -         if(jid === 'localVideoContainer')
 -             jid = connection.emuc.myroomjid;
 -         if(!name || name != displayName)
 -             API.triggerEvent("displayNameChange",{jid: jid, displayname: displayName});
 -     });
 - 
 -     /**
 -      * On dominant speaker changed event.
 -      */
 -     $(document).bind('dominantspeakerchanged', function (event, resourceJid) {
 -         // We ignore local user events.
 -         if (resourceJid
 -                 === Strophe.getResourceFromJid(connection.emuc.myroomjid))
 -             return;
 - 
 -         // Update the current dominant speaker.
 -         if (resourceJid !== currentDominantSpeaker) {
 -             var oldSpeakerVideoSpanId = "participant_" + currentDominantSpeaker,
 -                 newSpeakerVideoSpanId = "participant_" + resourceJid;
 -             if($("#" + oldSpeakerVideoSpanId + ">span.displayname").text() ===
 -                 interfaceConfig.DEFAULT_DOMINANT_SPEAKER_DISPLAY_NAME) {
 -                 setDisplayName(oldSpeakerVideoSpanId, null);
 -             }
 -             if($("#" + newSpeakerVideoSpanId + ">span.displayname").text() ===
 -                 interfaceConfig.DEFAULT_REMOTE_DISPLAY_NAME) {
 -                 setDisplayName(newSpeakerVideoSpanId,
 -                     interfaceConfig.DEFAULT_DOMINANT_SPEAKER_DISPLAY_NAME);
 -             }
 -             currentDominantSpeaker = resourceJid;
 -         } else {
 -             return;
 -         }
 - 
 -         // Obtain container for new dominant speaker.
 -         var container  = document.getElementById(
 -                 'participant_' + resourceJid);
 - 
 -         // Local video will not have container found, but that's ok
 -         // since we don't want to switch to local video.
 -         if (container && !focusedVideoInfo)
 -         {
 -             var video = container.getElementsByTagName("video");
 - 
 -             // Update the large video if the video source is already available,
 -             // otherwise wait for the "videoactive.jingle" event.
 -             if (video.length && video[0].currentTime > 0)
 -                 VideoLayout.updateLargeVideo(RTC.getVideoSrc(video[0]), resourceJid);
 -         }
 -     });
 - 
 -     /**
 -      * On last N change event.
 -      *
 -      * @param event the event that notified us
 -      * @param lastNEndpoints the list of last N endpoints
 -      * @param endpointsEnteringLastN the list currently entering last N
 -      * endpoints
 -      */
 -     $(document).bind('lastnchanged', function ( event,
 -                                                 lastNEndpoints,
 -                                                 endpointsEnteringLastN,
 -                                                 stream) {
 -         if (lastNCount !== lastNEndpoints.length)
 -             lastNCount = lastNEndpoints.length;
 - 
 -         lastNEndpointsCache = lastNEndpoints;
 - 
 -         // Say A, B, C, D, E, and F are in a conference and LastN = 3.
 -         //
 -         // If LastN drops to, say, 2, because of adaptivity, then E should see
 -         // thumbnails for A, B and C. A and B are in E's server side LastN set,
 -         // so E sees them. C is only in E's local LastN set.
 -         //
 -         // If F starts talking and LastN = 3, then E should see thumbnails for
 -         // F, A, B. B gets "ejected" from E's server side LastN set, but it
 -         // enters E's local LastN ejecting C.
 - 
 -         // Increase the local LastN set size, if necessary.
 -         if (lastNCount > localLastNCount) {
 -             localLastNCount = lastNCount;
 -         }
 - 
 -         // Update the local LastN set preserving the order in which the
 -         // endpoints appeared in the LastN/local LastN set.
 - 
 -         var nextLocalLastNSet = lastNEndpoints.slice(0);
 -         for (var i = 0; i < localLastNSet.length; i++) {
 -             if (nextLocalLastNSet.length >= localLastNCount) {
 -                 break;
 -             }
 - 
 -             var resourceJid = localLastNSet[i];
 -             if (nextLocalLastNSet.indexOf(resourceJid) === -1) {
 -                 nextLocalLastNSet.push(resourceJid);
 -             }
 -         }
 - 
 -         localLastNSet = nextLocalLastNSet;
 - 
 -         var updateLargeVideo = false;
 - 
 -         // Handle LastN/local LastN changes.
 -         $('#remoteVideos>span').each(function( index, element ) {
 -             var resourceJid = VideoLayout.getPeerContainerResourceJid(element);
 - 
 -             var isReceived = true;
 -             if (resourceJid
 -                 && lastNEndpoints.indexOf(resourceJid) < 0
 -                 && localLastNSet.indexOf(resourceJid) < 0) {
 -                 console.log("Remove from last N", resourceJid);
 -                 showPeerContainer(resourceJid, 'hide');
 -                 isReceived = false;
 -             } else if (resourceJid
 -                 && $('#participant_' + resourceJid).is(':visible')
 -                 && lastNEndpoints.indexOf(resourceJid) < 0
 -                 && localLastNSet.indexOf(resourceJid) >= 0) {
 -                 showPeerContainer(resourceJid, 'avatar');
 -                 isReceived = false;
 -             }
 - 
 -             if (!isReceived) {
 -                 // resourceJid has dropped out of the server side lastN set, so
 -                 // it is no longer being received. If resourceJid was being
 -                 // displayed in the large video we have to switch to another
 -                 // user.
 -                 var largeVideoResource = largeVideoState.userResourceJid;
 -                 if (!updateLargeVideo && resourceJid === largeVideoResource) {
 -                     updateLargeVideo = true;
 -                 }
 -             }
 -         });
 - 
 -         if (!endpointsEnteringLastN || endpointsEnteringLastN.length < 0)
 -             endpointsEnteringLastN = lastNEndpoints;
 - 
 -         if (endpointsEnteringLastN && endpointsEnteringLastN.length > 0) {
 -             endpointsEnteringLastN.forEach(function (resourceJid) {
 - 
 -                 var isVisible = $('#participant_' + resourceJid).is(':visible');
 -                 showPeerContainer(resourceJid, 'show');
 -                 if (!isVisible) {
 -                     console.log("Add to last N", resourceJid);
 - 
 -                     var jid = connection.emuc.findJidFromResource(resourceJid);
 -                     var mediaStream = RTC.remoteStreams[jid][MediaStreamType.VIDEO_TYPE];
 -                     var sel = $('#participant_' + resourceJid + '>video');
 - 
 -                     var videoStream = simulcast.getReceivingVideoStream(
 -                         mediaStream.stream);
 -                     RTC.attachMediaStream(sel, videoStream);
 -                     if (lastNPickupJid == mediaStream.peerjid) {
 -                         // Clean up the lastN pickup jid.
 -                         lastNPickupJid = null;
 - 
 -                         // Don't fire the events again, they've already
 -                         // been fired in the contact list click handler.
 -                         VideoLayout.handleVideoThumbClicked(
 -                             $(sel).attr('src'),
 -                             false,
 -                             Strophe.getResourceFromJid(mediaStream.peerjid));
 - 
 -                         updateLargeVideo = false;
 -                     }
 -                     waitForRemoteVideo(sel, mediaStream.ssrc, mediaStream.stream, resourceJid);
 -                 }
 -             })
 -         }
 - 
 -         // The endpoint that was being shown in the large video has dropped out
 -         // of the lastN set and there was no lastN pickup jid. We need to update
 -         // the large video now.
 - 
 -         if (updateLargeVideo) {
 - 
 -             var resource, container, src;
 -             var myResource
 -                 = Strophe.getResourceFromJid(connection.emuc.myroomjid);
 - 
 -             // Find out which endpoint to show in the large video.
 -             for (var i = 0; i < lastNEndpoints.length; i++) {
 -                 resource = lastNEndpoints[i];
 -                 if (!resource || resource === myResource)
 -                     continue;
 - 
 -                 container = $("#participant_" + resource);
 -                 if (container.length == 0)
 -                     continue;
 - 
 -                 src = $('video', container).attr('src');
 -                 if (!src)
 -                     continue;
 - 
 -                 // videoSrcToSsrc needs to be update for this call to succeed.
 -                 VideoLayout.updateLargeVideo(src);
 -                 break;
 - 
 -             }
 -         }
 -     });
 - 
 -     $(document).bind('videoactive.jingle', function (event, videoelem) {
 -         if (videoelem.attr('id').indexOf('mixedmslabel') === -1) {
 -             // ignore mixedmslabela0 and v0
 - 
 -             videoelem.show();
 -             VideoLayout.resizeThumbnails();
 - 
 -             var videoParent = videoelem.parent();
 -             var parentResourceJid = null;
 -             if (videoParent)
 -                 parentResourceJid
 -                     = VideoLayout.getPeerContainerResourceJid(videoParent[0]);
 - 
 -             // Update the large video to the last added video only if there's no
 -             // current dominant, focused speaker or prezi playing or update it to
 -             // the current dominant speaker.
 -             if ((!focusedVideoInfo &&
 -                 !VideoLayout.getDominantSpeakerResourceJid() &&
 -                 !require("../prezi/Prezi").isPresentationVisible()) ||
 -                 (parentResourceJid &&
 -                 VideoLayout.getDominantSpeakerResourceJid() === parentResourceJid)) {
 -                 VideoLayout.updateLargeVideo(
 -                     RTC.getVideoSrc(videoelem[0]),
 -                     1,
 -                     parentResourceJid);
 -             }
 - 
 -             VideoLayout.showModeratorIndicator();
 -         }
 -     });
 - 
 -     $(document).bind('simulcastlayerschanging', function (event, endpointSimulcastLayers) {
 -         endpointSimulcastLayers.forEach(function (esl) {
 - 
 -             var resource = esl.endpoint;
 - 
 -             // if lastN is enabled *and* the endpoint is *not* in the lastN set,
 -             // then ignore the event (= do not preload anything).
 -             //
 -             // The bridge could probably stop sending this message if it's for
 -             // an endpoint that's not in lastN.
 - 
 -             if (lastNCount != -1
 -                 && (lastNCount < 1 || lastNEndpointsCache.indexOf(resource) === -1)) {
 -                 return;
 -             }
 - 
 -             var primarySSRC = esl.simulcastLayer.primarySSRC;
 - 
 -             // Get session and stream from primary ssrc.
 -             var res = simulcast.getReceivingVideoStreamBySSRC(primarySSRC);
 -             var session = res.session;
 -             var electedStream = res.stream;
 - 
 -             if (session && electedStream) {
 -                 var msid = simulcast.getRemoteVideoStreamIdBySSRC(primarySSRC);
 - 
 -                 console.info([esl, primarySSRC, msid, session, electedStream]);
 - 
 -                 var msidParts = msid.split(' ');
 - 
 -                 var preload = (Strophe.getResourceFromJid(ssrc2jid[primarySSRC]) == largeVideoState.userResourceJid);
 - 
 -                 if (preload) {
 -                     if (largeVideoState.preload)
 -                     {
 -                         $(largeVideoState.preload).remove();
 -                     }
 -                     console.info('Preloading remote video');
 -                     largeVideoState.preload = $('<video autoplay></video>');
 -                     // ssrcs are unique in an rtp session
 -                     largeVideoState.preload_ssrc = primarySSRC;
 - 
 -                     RTC.attachMediaStream(largeVideoState.preload, electedStream)
 -                 }
 - 
 -             } else {
 -                 console.error('Could not find a stream or a session.', session, electedStream);
 -             }
 -         });
 -     });
 - 
 -     /**
 -      * On simulcast layers changed event.
 -      */
 -     $(document).bind('simulcastlayerschanged', function (event, endpointSimulcastLayers) {
 -         endpointSimulcastLayers.forEach(function (esl) {
 - 
 -             var resource = esl.endpoint;
 - 
 -             // if lastN is enabled *and* the endpoint is *not* in the lastN set,
 -             // then ignore the event (= do not change large video/thumbnail
 -             // SRCs).
 -             //
 -             // Note that even if we ignore the "changed" event in this event
 -             // handler, the bridge must continue sending these events because
 -             // the simulcast code in simulcast.js uses it to know what's going
 -             // to be streamed by the bridge when/if the endpoint gets back into
 -             // the lastN set.
 - 
 -             if (lastNCount != -1
 -                 && (lastNCount < 1 || lastNEndpointsCache.indexOf(resource) === -1)) {
 -                 return;
 -             }
 - 
 -             var primarySSRC = esl.simulcastLayer.primarySSRC;
 - 
 -             // Get session and stream from primary ssrc.
 -             var res = simulcast.getReceivingVideoStreamBySSRC(primarySSRC);
 -             var session = res.session;
 -             var electedStream = res.stream;
 - 
 -             if (session && electedStream) {
 -                 var msid = simulcast.getRemoteVideoStreamIdBySSRC(primarySSRC);
 - 
 -                 console.info('Switching simulcast substream.');
 -                 console.info([esl, primarySSRC, msid, session, electedStream]);
 - 
 -                 var msidParts = msid.split(' ');
 -                 var selRemoteVideo = $(['#', 'remoteVideo_', session.sid, '_', msidParts[0]].join(''));
 - 
 -                 var updateLargeVideo = (Strophe.getResourceFromJid(ssrc2jid[primarySSRC])
 -                     == largeVideoState.userResourceJid);
 -                 var updateFocusedVideoSrc = (focusedVideoInfo && focusedVideoInfo.src && focusedVideoInfo.src != '' &&
 -                     (RTC.getVideoSrc(selRemoteVideo[0]) == focusedVideoInfo.src));
 - 
 -                 var electedStreamUrl;
 -                 if (largeVideoState.preload_ssrc == primarySSRC)
 -                 {
 -                     RTC.setVideoSrc(selRemoteVideo[0], RTC.getVideoSrc(largeVideoState.preload[0]));
 -                 }
 -                 else
 -                 {
 -                     if (largeVideoState.preload
 -                         && largeVideoState.preload != null) {
 -                         $(largeVideoState.preload).remove();
 -                     }
 - 
 -                     largeVideoState.preload_ssrc = 0;
 - 
 -                     RTC.attachMediaStream(selRemoteVideo, electedStream);
 -                 }
 - 
 -                 var jid = ssrc2jid[primarySSRC];
 -                 jid2Ssrc[jid] = primarySSRC;
 - 
 -                 if (updateLargeVideo) {
 -                     VideoLayout.updateLargeVideo(RTC.getVideoSrc(selRemoteVideo[0]), null,
 -                         Strophe.getResourceFromJid(jid));
 -                 }
 - 
 -                 if (updateFocusedVideoSrc) {
 -                     focusedVideoInfo.src = RTC.getVideoSrc(selRemoteVideo[0]);
 -                 }
 - 
 -                 var videoId;
 -                 if(resource == Strophe.getResourceFromJid(connection.emuc.myroomjid))
 -                 {
 -                     videoId = "localVideoContainer";
 -                 }
 -                 else
 -                 {
 -                     videoId = "participant_" + resource;
 -                 }
 -                 var connectionIndicator = VideoLayout.connectionIndicators[videoId];
 -                 if(connectionIndicator)
 -                     connectionIndicator.updatePopoverData();
 - 
 -             } else {
 -                 console.error('Could not find a stream or a session.', session, electedStream);
 -             }
 -         });
 -     });
 - 
 -     /**
 -      * Updates local stats
 -      * @param percent
 -      * @param object
 -      */
 -     my.updateLocalConnectionStats = function (percent, object) {
 -         var resolution = null;
 -         if(object.resolution !== null)
 -         {
 -             resolution = object.resolution;
 -             object.resolution = resolution[connection.emuc.myroomjid];
 -             delete resolution[connection.emuc.myroomjid];
 -         }
 -         updateStatsIndicator("localVideoContainer", percent, object);
 -         for(var jid in resolution)
 -         {
 -             if(resolution[jid] === null)
 -                 continue;
 -             var id = 'participant_' + Strophe.getResourceFromJid(jid);
 -             if(VideoLayout.connectionIndicators[id])
 -             {
 -                 VideoLayout.connectionIndicators[id].updateResolution(resolution[jid]);
 -             }
 -         }
 - 
 -     };
 - 
 -     /**
 -      * Updates remote stats.
 -      * @param jid the jid associated with the stats
 -      * @param percent the connection quality percent
 -      * @param object the stats data
 -      */
 -     my.updateConnectionStats = function (jid, percent, object) {
 -         var resourceJid = Strophe.getResourceFromJid(jid);
 - 
 -         var videoSpanId = 'participant_' + resourceJid;
 -         updateStatsIndicator(videoSpanId, percent, object);
 -     };
 - 
 -     /**
 -      * Removes the connection
 -      * @param jid
 -      */
 -     my.removeConnectionIndicator = function (jid) {
 -         if(VideoLayout.connectionIndicators['participant_' + Strophe.getResourceFromJid(jid)])
 -             VideoLayout.connectionIndicators['participant_' + Strophe.getResourceFromJid(jid)].remove();
 -     };
 - 
 -     /**
 -      * Hides the connection indicator
 -      * @param jid
 -      */
 -     my.hideConnectionIndicator = function (jid) {
 -         if(VideoLayout.connectionIndicators['participant_' + Strophe.getResourceFromJid(jid)])
 -             VideoLayout.connectionIndicators['participant_' + Strophe.getResourceFromJid(jid)].hide();
 -     };
 - 
 -     /**
 -      * Hides all the indicators
 -      */
 -     my.onStatsStop = function () {
 -         for(var indicator in VideoLayout.connectionIndicators)
 -         {
 -             VideoLayout.connectionIndicators[indicator].hideIndicator();
 -         }
 -     };
 - 
 -     return my;
 - }(VideoLayout || {}));
 - 
 - module.exports = VideoLayout;
 - },{"../audio_levels/AudioLevels":2,"../avatar/Avatar":4,"../etherpad/Etherpad":5,"../prezi/Prezi":6,"../side_pannels/chat/Chat":8,"../side_pannels/contactlist/ContactList":12,"../util/UIUtil":21,"./ConnectionIndicator":22}],24:[function(require,module,exports){
 - //var nouns = [
 - //];
 - var pluralNouns = [
 -     "Aliens", "Animals", "Antelopes", "Ants", "Apes", "Apples", "Baboons", "Bacteria", "Badgers", "Bananas", "Bats",
 -     "Bears", "Birds", "Bonobos", "Brides", "Bugs", "Bulls", "Butterflies", "Cheetahs",
 -     "Cherries", "Chicken", "Children", "Chimps", "Clowns", "Cows", "Creatures", "Dinosaurs", "Dogs", "Dolphins",
 -     "Donkeys", "Dragons", "Ducks", "Dwarfs", "Eagles", "Elephants", "Elves", "FAIL", "Fathers",
 -     "Fish", "Flowers", "Frogs", "Fruit", "Fungi", "Galaxies", "Geese", "Goats",
 -     "Gorillas", "Hedgehogs", "Hippos", "Horses", "Hunters", "Insects", "Kids", "Knights",
 -     "Lemons", "Lemurs", "Leopards", "LifeForms", "Lions", "Lizards", "Mice", "Monkeys", "Monsters",
 -     "Mushrooms", "Octopodes", "Oranges", "Orangutans", "Organisms", "Pants", "Parrots", "Penguins",
 -     "People", "Pigeons", "Pigs", "Pineapples", "Plants", "Potatoes", "Priests", "Rats", "Reptiles", "Reptilians",
 -     "Rhinos", "Seagulls", "Sheep", "Siblings", "Snakes", "Spaghetti", "Spiders", "Squid", "Squirrels",
 -     "Stars", "Students", "Teachers", "Tigers", "Tomatoes", "Trees", "Vampires", "Vegetables", "Viruses", "Vulcans",
 -     "Warewolves", "Weasels", "Whales", "Witches", "Wizards", "Wolves", "Workers", "Worms", "Zebras"
 - ];
 - //var places = [
 - //"Pub", "University", "Airport", "Library", "Mall", "Theater", "Stadium", "Office", "Show", "Gallows", "Beach",
 - // "Cemetery", "Hospital", "Reception", "Restaurant", "Bar", "Church", "House", "School", "Square", "Village",
 - // "Cinema", "Movies", "Party", "Restroom", "End", "Jail", "PostOffice", "Station", "Circus", "Gates", "Entrance",
 - // "Bridge"
 - //];
 - var verbs = [
 -     "Abandon", "Adapt", "Advertise", "Answer", "Anticipate", "Appreciate",
 -     "Approach", "Argue", "Ask", "Bite", "Blossom", "Blush", "Breathe", "Breed", "Bribe", "Burn", "Calculate",
 -     "Clean", "Code", "Communicate", "Compute", "Confess", "Confiscate", "Conjugate", "Conjure", "Consume",
 -     "Contemplate", "Crawl", "Dance", "Delegate", "Devour", "Develop", "Differ", "Discuss",
 -     "Dissolve", "Drink", "Eat", "Elaborate", "Emancipate", "Estimate", "Expire", "Extinguish",
 -     "Extract", "FAIL", "Facilitate", "Fall", "Feed", "Finish", "Floss", "Fly", "Follow", "Fragment", "Freeze",
 -     "Gather", "Glow", "Grow", "Hex", "Hide", "Hug", "Hurry", "Improve", "Intersect", "Investigate", "Jinx",
 -     "Joke", "Jubilate", "Kiss", "Laugh", "Manage", "Meet", "Merge", "Move", "Object", "Observe", "Offer",
 -     "Paint", "Participate", "Party", "Perform", "Plan", "Pursue", "Pierce", "Play", "Postpone", "Pray", "Proclaim",
 -     "Question", "Read", "Reckon", "Rejoice", "Represent", "Resize", "Rhyme", "Scream", "Search", "Select", "Share", "Shoot",
 -     "Shout", "Signal", "Sing", "Skate", "Sleep", "Smile", "Smoke", "Solve", "Spell", "Steer", "Stink",
 -     "Substitute", "Swim", "Taste", "Teach", "Terminate", "Think", "Type", "Unite", "Vanish", "Worship"
 - ];
 - var adverbs = [
 -     "Absently", "Accurately", "Accusingly", "Adorably", "AllTheTime", "Alone", "Always", "Amazingly", "Angrily",
 -     "Anxiously", "Anywhere", "Appallingly", "Apparently", "Articulately", "Astonishingly", "Badly", "Barely",
 -     "Beautifully", "Blindly", "Bravely", "Brightly", "Briskly", "Brutally", "Calmly", "Carefully", "Casually",
 -     "Cautiously", "Cleverly", "Constantly", "Correctly", "Crazily", "Curiously", "Cynically", "Daily",
 -     "Dangerously", "Deliberately", "Delicately", "Desperately", "Discreetly", "Eagerly", "Easily", "Euphoricly",
 -     "Evenly", "Everywhere", "Exactly", "Expectantly", "Extensively", "FAIL", "Ferociously", "Fiercely", "Finely",
 -     "Flatly", "Frequently", "Frighteningly", "Gently", "Gloriously", "Grimly", "Guiltily", "Happily",
 -     "Hard", "Hastily", "Heroically", "High", "Highly", "Hourly", "Humbly", "Hysterically", "Immensely",
 -     "Impartially", "Impolitely", "Indifferently", "Intensely", "Jealously", "Jovially", "Kindly", "Lazily",
 -     "Lightly", "Loudly", "Lovingly", "Loyally", "Magnificently", "Malevolently", "Merrily", "Mightily", "Miserably",
 -     "Mysteriously", "NOT", "Nervously", "Nicely", "Nowhere", "Objectively", "Obnoxiously", "Obsessively",
 -     "Obviously", "Often", "Painfully", "Patiently", "Playfully", "Politely", "Poorly", "Precisely", "Promptly",
 -     "Quickly", "Quietly", "Randomly", "Rapidly", "Rarely", "Recklessly", "Regularly", "Remorsefully", "Responsibly",
 -     "Rudely", "Ruthlessly", "Sadly", "Scornfully", "Seamlessly", "Seldom", "Selfishly", "Seriously", "Shakily",
 -     "Sharply", "Sideways", "Silently", "Sleepily", "Slightly", "Slowly", "Slyly", "Smoothly", "Softly", "Solemnly", "Steadily", "Sternly", "Strangely", "Strongly", "Stunningly", "Surely", "Tenderly", "Thoughtfully",
 -     "Tightly", "Uneasily", "Vanishingly", "Violently", "Warmly", "Weakly", "Wearily", "Weekly", "Weirdly", "Well",
 -     "Well", "Wickedly", "Wildly", "Wisely", "Wonderfully", "Yearly"
 - ];
 - var adjectives = [
 -     "Abominable", "Accurate", "Adorable", "All", "Alleged", "Ancient", "Angry", "Angry", "Anxious", "Appalling",
 -     "Apparent", "Astonishing", "Attractive", "Awesome", "Baby", "Bad", "Beautiful", "Benign", "Big", "Bitter",
 -     "Blind", "Blue", "Bold", "Brave", "Bright", "Brisk", "Calm", "Camouflaged", "Casual", "Cautious",
 -     "Choppy", "Chosen", "Clever", "Cold", "Cool", "Crawly", "Crazy", "Creepy", "Cruel", "Curious", "Cynical",
 -     "Dangerous", "Dark", "Delicate", "Desperate", "Difficult", "Discreet", "Disguised", "Dizzy",
 -     "Dumb", "Eager", "Easy", "Edgy", "Electric", "Elegant", "Emancipated", "Enormous", "Euphoric", "Evil",
 -     "FAIL", "Fast", "Ferocious", "Fierce", "Fine", "Flawed", "Flying", "Foolish", "Foxy",
 -     "Freezing", "Funny", "Furious", "Gentle", "Glorious", "Golden", "Good", "Green", "Green", "Guilty",
 -     "Hairy", "Happy", "Hard", "Hasty", "Hazy", "Heroic", "Hostile", "Hot", "Humble", "Humongous",
 -     "Humorous", "Hysterical", "Idealistic", "Ignorant", "Immense", "Impartial", "Impolite", "Indifferent",
 -     "Infuriated", "Insightful", "Intense", "Interesting", "Intimidated", "Intriguing", "Jealous", "Jolly", "Jovial",
 -     "Jumpy", "Kind", "Laughing", "Lazy", "Liquid", "Lonely", "Longing", "Loud", "Loving", "Loyal", "Macabre", "Mad",
 -     "Magical", "Magnificent", "Malevolent", "Medieval", "Memorable", "Mere", "Merry", "Mighty",
 -     "Mischievous", "Miserable", "Modified", "Moody", "Most", "Mysterious", "Mystical", "Needy",
 -     "Nervous", "Nice", "Objective", "Obnoxious", "Obsessive", "Obvious", "Opinionated", "Orange",
 -     "Painful", "Passionate", "Perfect", "Pink", "Playful", "Poisonous", "Polite", "Poor", "Popular", "Powerful",
 -     "Precise", "Preserved", "Pretty", "Purple", "Quick", "Quiet", "Random", "Rapid", "Rare", "Real",
 -     "Reassuring", "Reckless", "Red", "Regular", "Remorseful", "Responsible", "Rich", "Rude", "Ruthless",
 -     "Sad", "Scared", "Scary", "Scornful", "Screaming", "Selfish", "Serious", "Shady", "Shaky", "Sharp",
 -     "Shiny", "Shy", "Simple", "Sleepy", "Slow", "Sly", "Small", "Smart", "Smelly", "Smiling", "Smooth",
 -     "Smug", "Sober", "Soft", "Solemn", "Square", "Square", "Steady", "Strange", "Strong",
 -     "Stunning", "Subjective", "Successful", "Surly", "Sweet", "Tactful", "Tense",
 -     "Thoughtful", "Tight", "Tiny", "Tolerant", "Uneasy", "Unique", "Unseen", "Warm", "Weak",
 -     "Weird", "WellCooked", "Wild", "Wise", "Witty", "Wonderful", "Worried", "Yellow", "Young",
 -     "Zealous"
 -     ];
 - //var pronouns = [
 - //];
 - //var conjunctions = [
 - //"And", "Or", "For", "Above", "Before", "Against", "Between"
 - //];
 - 
 - /*
 -  * Maps a string (category name) to the array of words from that category.
 -  */
 - var CATEGORIES =
 - {
 -     //"_NOUN_": nouns,
 -     "_PLURALNOUN_": pluralNouns,
 -     //"_PLACE_": places,
 -     "_VERB_": verbs,
 -     "_ADVERB_": adverbs,
 -     "_ADJECTIVE_": adjectives
 -     //"_PRONOUN_": pronouns,
 -     //"_CONJUNCTION_": conjunctions,
 - };
 - 
 - var PATTERNS = [
 -     "_ADJECTIVE__PLURALNOUN__VERB__ADVERB_"
 - 
 -     // BeautifulFungiOrSpaghetti
 -     //"_ADJECTIVE__PLURALNOUN__CONJUNCTION__PLURALNOUN_",
 - 
 -     // AmazinglyScaryToy
 -     //"_ADVERB__ADJECTIVE__NOUN_",
 - 
 -     // NeitherTrashNorRifle
 -     //"Neither_NOUN_Nor_NOUN_",
 -     //"Either_NOUN_Or_NOUN_",
 - 
 -     // EitherCopulateOrInvestigate
 -     //"Either_VERB_Or_VERB_",
 -     //"Neither_VERB_Nor_VERB_",
 - 
 -     //"The_ADJECTIVE__ADJECTIVE__NOUN_",
 -     //"The_ADVERB__ADJECTIVE__NOUN_",
 -     //"The_ADVERB__ADJECTIVE__NOUN_s",
 -     //"The_ADVERB__ADJECTIVE__PLURALNOUN__VERB_",
 - 
 -     // WolvesComputeBadly
 -     //"_PLURALNOUN__VERB__ADVERB_",
 - 
 -     // UniteFacilitateAndMerge
 -     //"_VERB__VERB_And_VERB_",
 - 
 -     //NastyWitchesAtThePub
 -     //"_ADJECTIVE__PLURALNOUN_AtThe_PLACE_",
 - ];
 - 
 - 
 - /*
 -  * Returns a random element from the array 'arr'
 -  */
 - function randomElement(arr)
 - {
 -     return arr[Math.floor(Math.random() * arr.length)];
 - }
 - 
 - /*
 -  * Returns true if the string 's' contains one of the
 -  * template strings.
 -  */
 - function hasTemplate(s)
 - {
 -     for (var template in CATEGORIES){
 -         if (s.indexOf(template) >= 0){
 -             return true;
 -         }
 -     }
 - }
 - 
 - /**
 -  * Generates new room name.
 -  */
 - var RoomNameGenerator = {
 -     generateRoomWithoutSeparator: function()
 -     {
 -         // Note that if more than one pattern is available, the choice of 'name' won't be random (names from patterns
 -         // with fewer options will have higher probability of being chosen that names from patterns with more options).
 -         var name = randomElement(PATTERNS);
 -         var word;
 -         while (hasTemplate(name)){
 -             for (var template in CATEGORIES){
 -                 word = randomElement(CATEGORIES[template]);
 -                 name = name.replace(template, word);
 -             }
 -         }
 - 
 -         return name;
 -     }
 - }
 - 
 - module.exports = RoomNameGenerator;
 - 
 - },{}],25:[function(require,module,exports){
 - var animateTimeout, updateTimeout;
 - 
 - var RoomNameGenerator = require("./RoomnameGenerator");
 - 
 - function enter_room()
 - {
 -     var val = $("#enter_room_field").val();
 -     if(!val) {
 -         val = $("#enter_room_field").attr("room_name");
 -     }
 -     if (val) {
 -         window.location.pathname = "/" + val;
 -     }
 - }
 - 
 - function animate(word) {
 -     var currentVal = $("#enter_room_field").attr("placeholder");
 -     $("#enter_room_field").attr("placeholder", currentVal + word.substr(0, 1));
 -     animateTimeout = setTimeout(function() {
 -         animate(word.substring(1, word.length))
 -     }, 70);
 - }
 - 
 - function update_roomname()
 - {
 -     var word = RoomNameGenerator.generateRoomWithoutSeparator();
 -     $("#enter_room_field").attr("room_name", word);
 -     $("#enter_room_field").attr("placeholder", "");
 -     clearTimeout(animateTimeout);
 -     animate(word);
 -     updateTimeout = setTimeout(update_roomname, 10000);
 - }
 - 
 - 
 - function setupWelcomePage()
 - {
 -     $("#videoconference_page").hide();
 -     $("#domain_name").text(
 -             window.location.protocol + "//" + window.location.host + "/");
 -     $("span[name='appName']").text(interfaceConfig.APP_NAME);
 - 
 -     if (interfaceConfig.SHOW_JITSI_WATERMARK) {
 -         var leftWatermarkDiv
 -             = $("#welcome_page_header div[class='watermark leftwatermark']");
 -         if(leftWatermarkDiv && leftWatermarkDiv.length > 0)
 -         {
 -             leftWatermarkDiv.css({display: 'block'});
 -             leftWatermarkDiv.parent().get(0).href
 -                 = interfaceConfig.JITSI_WATERMARK_LINK;
 -         }
 - 
 -     }
 - 
 -     if (interfaceConfig.SHOW_BRAND_WATERMARK) {
 -         var rightWatermarkDiv
 -             = $("#welcome_page_header div[class='watermark rightwatermark']");
 -         if(rightWatermarkDiv && rightWatermarkDiv.length > 0) {
 -             rightWatermarkDiv.css({display: 'block'});
 -             rightWatermarkDiv.parent().get(0).href
 -                 = interfaceConfig.BRAND_WATERMARK_LINK;
 -             rightWatermarkDiv.get(0).style.backgroundImage
 -                 = "url(images/rightwatermark.png)";
 -         }
 -     }
 - 
 -     if (interfaceConfig.SHOW_POWERED_BY) {
 -         $("#welcome_page_header>a[class='poweredby']")
 -             .css({display: 'block'});
 -     }
 - 
 -     $("#enter_room_button").click(function()
 -     {
 -         enter_room();
 -     });
 - 
 -     $("#enter_room_field").keydown(function (event) {
 -         if (event.keyCode === 13 /* enter */) {
 -             enter_room();
 -         }
 -     });
 - 
 -     if (!(interfaceConfig.GENERATE_ROOMNAMES_ON_WELCOME_PAGE === false)){
 -         var updateTimeout;
 -         var animateTimeout;
 -         $("#reload_roomname").click(function () {
 -             clearTimeout(updateTimeout);
 -             clearTimeout(animateTimeout);
 -             update_roomname();
 -         });
 -         $("#reload_roomname").show();
 - 
 - 
 -         update_roomname();
 -     }
 - 
 -     $("#disable_welcome").click(function () {
 -         window.localStorage.welcomePageDisabled
 -             = $("#disable_welcome").is(":checked");
 -     });
 - 
 - }
 - 
 - module.exports = setupWelcomePage;
 - },{"./RoomnameGenerator":24}]},{},[1])(1)
 - });
 
 
  |