2017-02-18 01:56:23 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								'use strict' ; 
							 
						 
					
						
							
								
									
										
										
										
											2017-02-17 21:55:19 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-07-21 11:23:16 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-06-22 21:23:19 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								app  =  window . app  ||  { } ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-21 11:23:16 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								app . isFocused  =  true ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								app . currentRoom  =  null ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								app . widgets  =  { } ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-07-13 15:17:02 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								app . flags  =  { } ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-21 11:23:16 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								app . cacheBuster  =  null ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								( function  ( )  { 
							 
						 
					
						
							
								
									
										
										
										
											2017-12-05 13:18:37 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									var  params  =  utils . params ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									var  showWelcomeMessage  =  ! ! params . loggedin ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									var  registerMessage  =  params . register ; 
							 
						 
					
						
							
								
									
										
										
										
											2018-11-17 14:07:48 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									var  isTouchDevice  =  utils . isTouchDevice ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-21 11:23:16 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-08-24 17:26:50 -06:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									require ( [ 'benchpress' ] ,  function  ( Benchpress )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										Benchpress . setGlobal ( 'config' ,  config ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										if  ( Object . defineProperty )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											Object . defineProperty ( window ,  'templates' ,  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												configurable :  true , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												enumerable :  true , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												get :  function  ( )  { 
							 
						 
					
						
							
								
									
										
										
										
											2017-08-25 15:53:35 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													console . warn ( '[deprecated] Accessing benchpress (formerly known as templates.js) globally is deprecated. Use `require(["benchpress"], function (Benchpress) { ... })` instead' ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2017-08-24 17:26:50 -06:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													return  Benchpress ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												} , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											} ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										}  else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											window . templates  =  Benchpress ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-21 11:23:16 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-09-18 10:58:32 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									app . cacheBuster  =  config [ 'cache-buster' ] ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-21 11:23:16 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-09-18 10:58:32 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									bootbox . setDefaults ( { 
							 
						 
					
						
							
								
									
										
										
										
											2017-02-17 19:31:21 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										locale :  config . userLang , 
							 
						 
					
						
							
								
									
										
										
										
											2015-09-18 10:58:32 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									} ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-10-13 11:43:39 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									app . load  =  function  ( )  { 
							 
						 
					
						
							
								
									
										
										
										
											2016-11-25 21:11:33 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										overrides . overrideTimeago ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-06-20 13:39:08 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										var  url  =  ajaxify . start ( window . location . pathname . slice ( 1 )  +  window . location . search  +  window . location . hash ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										ajaxify . updateHistory ( url ,  true ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-08-26 16:39:03 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										ajaxify . parseData ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-03-27 18:56:21 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										ajaxify . end ( url ,  app . template ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-21 11:23:16 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-03-27 18:56:21 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										handleStatusChange ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-21 11:23:16 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-03-27 18:56:21 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										if  ( config . searchEnabled )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											app . handleSearch ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-21 11:23:16 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-07-20 08:51:04 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										$ ( 'body' ) . on ( 'click' ,  '#new_topic' ,  function  ( e )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											e . preventDefault ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-03-27 18:56:21 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											app . newTopic ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-21 11:23:16 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-05-27 12:15:02 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										$ ( '#header-menu .container' ) . on ( 'click' ,  '[component="user/logout"]' ,  function  ( )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											app . logout ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-06-08 15:09:11 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											return  false ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-27 12:15:02 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										} ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-21 11:23:16 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-10-25 21:34:47 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										Visibility . change ( function  ( event ,  state )  { 
							 
						 
					
						
							
								
									
										
										
										
											2016-03-27 18:56:21 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											if  ( state  ===  'visible' )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												app . isFocused  =  true ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												app . alternatingTitle ( '' ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											}  else  if  ( state  ===  'hidden' )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												app . isFocused  =  false ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-08-22 12:20:17 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-03-27 18:56:21 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										createHeaderTooltips ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										app . showEmailConfirmWarning ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-11-01 12:59:51 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										app . showCookieWarning ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-08-22 12:20:17 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-03-27 18:56:21 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										socket . removeAllListeners ( 'event:nodebb.ready' ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-10-13 11:43:39 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										socket . on ( 'event:nodebb.ready' ,  function  ( data )  { 
							 
						 
					
						
							
								
									
										
										
										
											2018-02-20 15:32:44 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											if  ( ( data . hostname  ===  app . upstreamHost )  &&  ( ! app . cacheBuster  ||  app . cacheBuster  !==  data [ 'cache-buster' ] ) )  { 
							 
						 
					
						
							
								
									
										
										
										
											2016-07-20 18:43:24 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												app . cacheBuster  =  data [ 'cache-buster' ] ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-08-22 12:21:51 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-03-27 18:56:21 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												app . alert ( { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													alert _id :  'forum_updated' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													title :  '[[global:updated.title]]' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													message :  '[[global:updated.message]]' , 
							 
						 
					
						
							
								
									
										
										
										
											2016-10-13 11:43:39 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													clickfn :  function  ( )  { 
							 
						 
					
						
							
								
									
										
										
										
											2016-03-27 18:56:21 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
														window . location . reload ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													} , 
							 
						 
					
						
							
								
									
										
										
										
											2017-02-17 19:31:21 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													type :  'warning' , 
							 
						 
					
						
							
								
									
										
										
										
											2016-03-27 18:56:21 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												} ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2017-05-25 16:41:32 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										socket . on ( 'event:livereload' ,  function  ( )  { 
							 
						 
					
						
							
								
									
										
										
										
											2017-05-25 15:16:55 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											if  ( app . user . isAdmin  &&  ! ajaxify . currentPage . match ( /admin/ ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												window . location . reload ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-07 16:13:37 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-10-13 11:43:39 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										require ( [ 'taskbar' ,  'helpers' ,  'forum/pagination' ] ,  function  ( taskbar ,  helpers ,  pagination )  { 
							 
						 
					
						
							
								
									
										
										
										
											2016-03-27 18:56:21 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											taskbar . init ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											helpers . register ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											pagination . init ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											$ ( window ) . trigger ( 'action:app.load' ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-09-18 10:58:32 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										} ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-08-22 12:21:51 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-05-27 12:15:02 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									app . logout  =  function  ( redirect )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										redirect  =  redirect  ===  undefined  ?  true  :  redirect ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-09-28 15:46:10 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										$ ( window ) . trigger ( 'action:app.logout' ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-11-11 16:47:59 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-07-14 21:44:33 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										$ . ajax ( config . relative _path  +  '/logout' ,  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											type :  'POST' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											headers :  { 
							 
						 
					
						
							
								
									
										
										
										
											2017-02-17 19:31:21 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												'x-csrf-token' :  config . csrf _token , 
							 
						 
					
						
							
								
									
										
										
										
											2016-07-14 21:44:33 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											} , 
							 
						 
					
						
							
								
									
										
										
										
											2020-07-13 15:17:02 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											beforeSend :  function  ( )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												app . flags . _logout  =  true ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											} , 
							 
						 
					
						
							
								
									
										
										
										
											2018-11-07 12:34:12 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											success :  function  ( data )  { 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-27 12:15:02 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												$ ( window ) . trigger ( 'action:app.loggedOut' ,  data ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												if  ( redirect )  { 
							 
						 
					
						
							
								
									
										
										
										
											2018-11-07 12:34:12 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													if  ( data . next )  { 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-27 12:15:02 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
														window . location . href  =  data . next ; 
							 
						 
					
						
							
								
									
										
										
										
											2018-11-07 12:34:12 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													}  else  { 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-27 12:15:02 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
														window . location . reload ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2018-11-07 12:34:12 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													} 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-27 12:15:02 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												} 
							 
						 
					
						
							
								
									
										
										
										
											2017-02-17 19:31:21 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											} , 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-21 11:23:16 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										} ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-27 12:15:02 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										return  false ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-21 11:23:16 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									} ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									app . alert  =  function  ( params )  { 
							 
						 
					
						
							
								
									
										
										
										
											2016-10-13 11:43:39 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										require ( [ 'alerts' ] ,  function  ( alerts )  { 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-21 11:23:16 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											alerts . alert ( params ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-10-13 11:43:39 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									app . removeAlert  =  function  ( id )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										require ( [ 'alerts' ] ,  function  ( alerts )  { 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-21 11:23:16 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											alerts . remove ( id ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									app . alertSuccess  =  function  ( message ,  timeout )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										app . alert ( { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											title :  '[[global:alert.success]]' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											message :  message , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											type :  'success' , 
							 
						 
					
						
							
								
									
										
										
										
											2017-02-18 12:59:46 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											timeout :  timeout  ||  5000 , 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-21 11:23:16 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										} ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									app . alertError  =  function  ( message ,  timeout )  { 
							 
						 
					
						
							
								
									
										
										
										
											2016-11-17 18:21:54 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										message  =  message . message  ||  message ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-11-17 18:08:44 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-08-16 13:48:53 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										if  ( message  ===  '[[error:invalid-session]]' )  { 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-27 13:07:51 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											app . logout ( false ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-08-16 13:48:53 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											return  app . handleInvalidSession ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-07-21 11:23:16 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										app . alert ( { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											title :  '[[global:alert.error]]' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											message :  message , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											type :  'danger' , 
							 
						 
					
						
							
								
									
										
										
										
											2017-02-18 12:59:46 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											timeout :  timeout  ||  10000 , 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-21 11:23:16 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										} ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-10-13 11:43:39 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									app . handleInvalidSession  =  function  ( )  { 
							 
						 
					
						
							
								
									
										
										
										
											2020-07-13 15:17:02 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										if  ( app . flags . _logout )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											return ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-12-21 15:09:13 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										socket . disconnect ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-27 12:15:02 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										bootbox . alert ( { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											title :  '[[error:invalid-session]]' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											message :  '[[error:invalid-session-text]]' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											closeButton :  false , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											callback :  function  ( )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												window . location . reload ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											} , 
							 
						 
					
						
							
								
									
										
										
										
											2016-08-16 13:48:53 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										} ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-07-21 11:23:16 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									app . enterRoom  =  function  ( room ,  callback )  { 
							 
						 
					
						
							
								
									
										
										
										
											2016-10-13 11:43:39 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										callback  =  callback  ||  function  ( )  { } ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-11-05 14:39:52 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										if  ( socket  &&  app . user . uid  &&  app . currentRoom  !==  room )  { 
							 
						 
					
						
							
								
									
										
										
										
											2016-05-12 09:31:52 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											var  previousRoom  =  app . currentRoom ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											app . currentRoom  =  room ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-21 11:23:16 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											socket . emit ( 'meta.rooms.enter' ,  { 
							 
						 
					
						
							
								
									
										
										
										
											2017-02-17 19:31:21 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												enter :  room , 
							 
						 
					
						
							
								
									
										
										
										
											2016-10-13 11:43:39 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											} ,  function  ( err )  { 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-21 11:23:16 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												if  ( err )  { 
							 
						 
					
						
							
								
									
										
										
										
											2016-05-12 09:31:52 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													app . currentRoom  =  previousRoom ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-20 17:53:44 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													return  app . alertError ( err . message ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-21 11:23:16 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												} 
							 
						 
					
						
							
								
									
										
										
										
											2016-05-12 09:31:52 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-11-05 14:39:52 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												callback ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-21 11:23:16 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											} ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-10-13 11:43:39 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									app . leaveCurrentRoom  =  function  ( )  { 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-20 17:53:44 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										if  ( ! socket )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											return ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
									
										
										
										
											2017-05-01 21:38:03 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										var  previousRoom  =  app . currentRoom ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										app . currentRoom  =  '' ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-10-13 11:43:39 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										socket . emit ( 'meta.rooms.leaveCurrent' ,  function  ( err )  { 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-20 17:53:44 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											if  ( err )  { 
							 
						 
					
						
							
								
									
										
										
										
											2017-05-01 21:38:03 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												app . currentRoom  =  previousRoom ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-20 17:53:44 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												return  app . alertError ( err . message ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-12-16 13:35:24 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									} ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-20 17:53:44 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-07-21 11:23:16 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									function  highlightNavigationLink ( )  { 
							 
						 
					
						
							
								
									
										
										
										
											2018-12-19 16:16:35 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										$ ( '#main-nav li' ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											. removeClass ( 'active' ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											. find ( 'a' ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											. filter ( function  ( i ,  x )  {  return  window . location . pathname . startsWith ( x . getAttribute ( 'href' ) ) ;  } ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											. parent ( ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											. addClass ( 'active' ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-21 11:23:16 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-10-13 11:43:39 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									app . createUserTooltips  =  function  ( els ,  placement )  { 
							 
						 
					
						
							
								
									
										
										
										
											2018-11-17 14:07:48 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										if  ( isTouchDevice )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											return ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-04 01:13:47 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										els  =  els  ||  $ ( 'body' ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-10-13 11:43:39 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										els . find ( '.avatar,img[title].teaser-pic,img[title].user-img,div.user-icon,span.user-icon' ) . each ( function  ( )  { 
							 
						 
					
						
							
								
									
										
										
										
											2018-11-17 14:07:48 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											$ ( this ) . tooltip ( { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												placement :  placement  ||  $ ( this ) . attr ( 'title-placement' )  ||  'top' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												title :  $ ( this ) . attr ( 'title' ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											} ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-21 11:23:16 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										} ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-10-13 11:43:39 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									app . createStatusTooltips  =  function  ( )  { 
							 
						 
					
						
							
								
									
										
										
										
											2018-11-17 14:07:48 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										if  ( ! isTouchDevice )  { 
							 
						 
					
						
							
								
									
										
										
										
											2015-11-02 11:16:31 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											$ ( 'body' ) . tooltip ( { 
							 
						 
					
						
							
								
									
										
										
										
											2017-02-18 01:27:46 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												selector :  '.fa-circle.status' , 
							 
						 
					
						
							
								
									
										
										
										
											2017-02-17 19:31:21 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												placement :  'top' , 
							 
						 
					
						
							
								
									
										
										
										
											2015-11-02 11:16:31 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											} ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-21 11:23:16 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									} ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									app . processPage  =  function  ( )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										highlightNavigationLink ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-08-11 11:06:46 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										$ ( '.timeago' ) . timeago ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-21 11:23:16 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										utils . makeNumbersHumanReadable ( $ ( '.human-readable-number' ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										utils . addCommasToNumbers ( $ ( '.formatted-number' ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										app . createUserTooltips ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										app . createStatusTooltips ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										// Scroll back to top of page
 
							 
						 
					
						
							
								
									
										
										
										
											2017-12-06 12:31:55 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										if  ( ! ajaxify . isCold ( ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											window . scrollTo ( 0 ,  0 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-21 11:23:16 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									} ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-10-27 14:14:54 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									app . showMessages  =  function  ( )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										var  messages  =  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											login :  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												format :  'alert' , 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-21 11:23:16 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												title :  '[[global:welcome_back]] '  +  app . user . username  +  '!' , 
							 
						 
					
						
							
								
									
										
										
										
											2017-02-17 19:31:21 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												message :  '[[global:you_have_successfully_logged_in]]' , 
							 
						 
					
						
							
								
									
										
										
										
											2016-10-27 14:14:54 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											} , 
							 
						 
					
						
							
								
									
										
										
										
											2017-12-05 13:18:37 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											register :  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												format :  'modal' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											} , 
							 
						 
					
						
							
								
									
										
										
										
											2016-10-27 14:14:54 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										} ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-12-05 13:18:37 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										function  showAlert ( type ,  message )  { 
							 
						 
					
						
							
								
									
										
										
										
											2016-10-27 14:14:54 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											switch  ( messages [ type ] . format )  { 
							 
						 
					
						
							
								
									
										
										
										
											2020-06-03 11:25:25 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												case  'alert' : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													app . alert ( { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														type :  'success' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														title :  messages [ type ] . title , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														message :  messages [ type ] . message , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														timeout :  5000 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													} ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												case  'modal' : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													require ( [ 'translator' ] ,  function  ( translator )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														translator . translate ( message  ||  messages [ type ] . message ,  function  ( translated )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
															bootbox . alert ( { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																title :  messages [ type ] . title , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																message :  translated , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
															} ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-10-27 14:14:54 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
														} ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													} ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-06-03 11:25:25 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													break ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-10-27 14:14:54 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											} 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-21 11:23:16 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										if  ( showWelcomeMessage )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											showWelcomeMessage  =  false ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-11-10 15:59:16 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											$ ( document ) . ready ( function  ( )  { 
							 
						 
					
						
							
								
									
										
										
										
											2016-10-27 14:14:54 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												showAlert ( 'login' ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-11-10 15:59:08 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											} ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-10-27 14:14:54 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
									
										
										
										
											2017-12-05 13:18:37 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										if  ( registerMessage )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											$ ( document ) . ready ( function  ( )  { 
							 
						 
					
						
							
								
									
										
										
										
											2020-01-19 22:03:18 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												showAlert ( 'register' ,  utils . escapeHTML ( decodeURIComponent ( registerMessage ) ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2017-12-05 13:18:37 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												registerMessage  =  false ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											} ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-21 11:23:16 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									} ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-10-02 15:17:22 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									app . openChat  =  function  ( roomId ,  uid )  { 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-21 11:23:16 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										if  ( ! app . user . uid )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											return  app . alertError ( '[[error:not-logged-in]]' ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										require ( [ 'chat' ] ,  function  ( chat )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											function  loadAndCenter ( chatModal )  { 
							 
						 
					
						
							
								
									
										
										
										
											2018-05-30 16:29:52 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												chat . load ( chatModal . attr ( 'data-uuid' ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-21 11:23:16 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												chat . center ( chatModal ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												chat . focusInput ( chatModal ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-12-16 13:35:24 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											if  ( chat . modalExists ( roomId ) )  { 
							 
						 
					
						
							
								
									
										
										
										
											2015-12-16 10:09:00 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												loadAndCenter ( chat . getModal ( roomId ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-12-16 13:35:24 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											}  else  { 
							 
						 
					
						
							
								
									
										
										
										
											2017-02-18 12:30:49 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												socket . emit ( 'modules.chats.loadRoom' ,  {  roomId :  roomId ,  uid :  uid  ||  app . user . uid  } ,  function  ( err ,  roomData )  { 
							 
						 
					
						
							
								
									
										
										
										
											2015-12-16 13:35:24 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													if  ( err )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														return  app . alertError ( err . message ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													} 
							 
						 
					
						
							
								
									
										
										
										
											2016-10-13 11:43:39 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													roomData . users  =  roomData . users . filter ( function  ( user )  { 
							 
						 
					
						
							
								
									
										
										
										
											2015-12-16 13:35:24 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
														return  user  &&  parseInt ( user . uid ,  10 )  !==  parseInt ( app . user . uid ,  10 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													} ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-10-02 15:17:22 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													roomData . uid  =  uid  ||  app . user . uid ; 
							 
						 
					
						
							
								
									
										
										
										
											2019-04-25 21:43:21 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													roomData . isSelf  =  true ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-12-23 11:27:34 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													chat . createModal ( roomData ,  loadAndCenter ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-12-16 13:35:24 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												} ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-21 11:23:16 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-08-17 16:32:53 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									app . newChat  =  function  ( touid ,  callback )  { 
							 
						 
					
						
							
								
									
										
										
										
											2017-04-14 10:08:50 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										function  createChat ( )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											socket . emit ( 'modules.chats.newRoom' ,  {  touid :  touid  } ,  function  ( err ,  roomId )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												if  ( err )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													return  app . alertError ( err . message ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												if  ( ! ajaxify . data . template . chats )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													app . openChat ( roomId ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												}  else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													ajaxify . go ( 'chats/'  +  roomId ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												callback ( false ,  roomId ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											} ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-10-13 11:43:39 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										callback  =  callback  ||  function  ( )  { } ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-12-16 11:30:10 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										if  ( ! app . user . uid )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											return  app . alertError ( '[[error:not-logged-in]]' ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-10-22 10:22:05 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										if  ( parseInt ( touid ,  10 )  ===  parseInt ( app . user . uid ,  10 ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											return  app . alertError ( '[[error:cant-chat-with-yourself]]' ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
									
										
										
										
											2017-04-14 10:08:50 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										socket . emit ( 'modules.chats.isDnD' ,  touid ,  function  ( err ,  isDnD )  { 
							 
						 
					
						
							
								
									
										
										
										
											2015-12-16 13:35:24 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											if  ( err )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												return  app . alertError ( err . message ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											} 
							 
						 
					
						
							
								
									
										
										
										
											2017-04-14 10:08:50 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											if  ( ! isDnD )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												return  createChat ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-02-08 23:01:23 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											} 
							 
						 
					
						
							
								
									
										
										
										
											2017-04-14 10:08:50 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											bootbox . confirm ( '[[modules:chat.confirm-chat-with-dnd-user]]' ,  function  ( ok )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												if  ( ok )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													createChat ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											} ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-12-16 13:35:24 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										} ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-12-16 11:30:10 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									} ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-07-21 11:23:16 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									var 	titleObj  =  { 
							 
						 
					
						
							
								
									
										
										
										
											2017-02-18 02:38:03 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										active :  false , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										interval :  undefined , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										titles :  [ ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-21 11:23:16 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									app . alternatingTitle  =  function  ( title )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										if  ( typeof  title  !==  'string' )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											return ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										if  ( title . length  >  0  &&  ! app . isFocused )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											if  ( ! titleObj . titles [ 0 ] )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												titleObj . titles [ 0 ]  =  window . document . title ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-10-13 11:43:39 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											require ( [ 'translator' ] ,  function  ( translator )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												translator . translate ( title ,  function  ( translated )  { 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-21 11:23:16 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													titleObj . titles [ 1 ]  =  translated ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													if  ( titleObj . interval )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														clearInterval ( titleObj . interval ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-10-13 11:43:39 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													titleObj . interval  =  setInterval ( function  ( )  { 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-21 11:23:16 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
														var  title  =  titleObj . titles [ titleObj . titles . indexOf ( window . document . title )  ^  1 ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														if  ( title )  { 
							 
						 
					
						
							
								
									
										
										
										
											2020-04-29 20:46:00 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
															window . document . title  =  $ ( '<div></div>' ) . html ( title ) . text ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-21 11:23:16 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
														} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													} ,  2000 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												} ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											} ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										}  else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											if  ( titleObj . interval )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												clearInterval ( titleObj . interval ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											if  ( titleObj . titles [ 0 ] )  { 
							 
						 
					
						
							
								
									
										
										
										
											2020-04-29 20:46:00 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												window . document . title  =  $ ( '<div></div>' ) . html ( titleObj . titles [ 0 ] ) . text ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-21 11:23:16 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-10-13 11:43:39 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									app . refreshTitle  =  function  ( title )  { 
							 
						 
					
						
							
								
									
										
										
										
											2015-09-23 01:59:13 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										if  ( ! title )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											return ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
									
										
										
										
											2016-10-13 11:43:39 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										require ( [ 'translator' ] ,  function  ( translator )  { 
							 
						 
					
						
							
								
									
										
										
										
											2016-03-22 11:19:33 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											title  =  config . titleLayout . replace ( /{/g ,  '{' ) . replace ( /}/g ,  '}' ) 
							 
						 
					
						
							
								
									
										
										
										
											2016-10-13 11:43:39 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												. replace ( '{pageTitle}' ,  function  ( )  {  return  title ;  } ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												. replace ( '{browserTitle}' ,  function  ( )  {  return  config . browserTitle ;  } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-03-22 11:19:33 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-09-13 12:09:31 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											// Allow translation strings in title on ajaxify (#5927)
 
							 
						 
					
						
							
								
									
										
										
										
											2017-09-13 17:06:00 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											title  =  translator . unescape ( title ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2017-09-13 12:09:31 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-10-13 11:43:39 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											translator . translate ( title ,  function  ( translated )  { 
							 
						 
					
						
							
								
									
										
										
										
											2015-08-26 15:54:54 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												titleObj . titles [ 0 ]  =  translated ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												app . alternatingTitle ( '' ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											} ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-21 11:23:16 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										} ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-10-13 11:43:39 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									app . toggleNavbar  =  function  ( state )  { 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-21 11:23:16 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										var  navbarEl  =  $ ( '.navbar' ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										if  ( navbarEl )  { 
							 
						 
					
						
							
								
									
										
										
										
											2020-06-15 17:35:05 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											navbarEl [ state  ?  'show'  :  'hide' ] ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-21 11:23:16 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									function  createHeaderTooltips ( )  { 
							 
						 
					
						
							
								
									
										
										
										
											2015-08-11 13:19:25 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										var  env  =  utils . findBootstrapEnvironment ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2018-11-17 14:07:48 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										if  ( env  ===  'xs'  ||  env  ===  'sm'  ||  isTouchDevice )  { 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-21 11:23:16 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											return ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
									
										
										
										
											2016-10-13 11:43:39 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										$ ( '#header-menu li a[title]' ) . each ( function  ( )  { 
							 
						 
					
						
							
								
									
										
										
										
											2018-11-17 14:07:48 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											$ ( this ) . tooltip ( { 
							 
						 
					
						
							
								
									
										
										
										
											2015-11-02 11:16:31 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												placement :  'bottom' , 
							 
						 
					
						
							
								
									
										
										
										
											2016-07-18 23:34:52 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												trigger :  'hover' , 
							 
						 
					
						
							
								
									
										
										
										
											2018-11-17 14:07:48 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												title :  $ ( this ) . attr ( 'title' ) , 
							 
						 
					
						
							
								
									
										
										
										
											2015-11-02 11:16:31 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											} ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2018-11-17 14:07:48 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										} ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-21 11:23:16 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-11-17 14:07:48 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										$ ( '#search-form' ) . parent ( ) . tooltip ( { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											placement :  'bottom' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											trigger :  'hover' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											title :  $ ( '#search-button i' ) . attr ( 'title' ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										$ ( '#user_dropdown' ) . tooltip ( { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											placement :  'bottom' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											trigger :  'hover' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											title :  $ ( '#user_dropdown' ) . attr ( 'title' ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-21 11:23:16 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-06-10 15:11:57 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									app . enableTopicSearch  =  function  ( options )  { 
							 
						 
					
						
							
								
									
										
										
										
											2020-06-10 16:56:05 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										/* eslint-disable-next-line */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										var  searchOptions  =  Object . assign ( {  in :  'titles'  } ,  options . searchOptions ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-06-10 15:11:57 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										var  quickSearchResults  =  options . searchElements . resultEl ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										var  inputEl  =  options . searchElements . inputEl ; 
							 
						 
					
						
							
								
									
										
										
										
											2019-02-16 16:20:58 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										var  searchTimeoutId  =  0 ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-06-09 16:49:56 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										var  oldValue  =  inputEl . val ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-06-10 16:56:05 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										function  doSearch ( )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											require ( [ 'search' ] ,  function  ( search )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												/* eslint-disable-next-line */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												options . searchOptions  =  Object . assign ( { } ,  searchOptions ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												options . searchOptions . term  =  inputEl . val ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												$ ( window ) . trigger ( 'action:search.quick.start' ,  options ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												options . searchOptions . searchOnly  =  1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												search . api ( options . searchOptions ,  function  ( data )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													var  resultEl  =  options . searchElements . resultEl ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													if  ( options . hideOnNoMatches  &&  ! data . posts . length )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														return  resultEl . addClass ( 'hidden' ) . find ( '.quick-search-results-container' ) . html ( '' ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													data . posts . forEach ( function  ( p )  { 
							 
						 
					
						
							
								
									
										
										
										
											2020-06-16 14:58:02 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
														var  text  =  $ ( '<div>'  +  p . content  +  '</div>' ) . text ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														var  start  =  Math . max ( 0 ,  text . toLowerCase ( ) . indexOf ( inputEl . val ( ) . toLowerCase ( ) )  -  40 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														p . snippet  =  utils . escapeHTML ( ( start  >  0  ?  '...'  :  '' )  + 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
															text . slice ( start ,  start  +  80 )  + 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
															( text . length  -  start  >  80  ?  '...'  :  '' ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-06-10 16:56:05 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													} ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													app . parseAndTranslate ( 'partials/quick-search-results' ,  data ,  function  ( html )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														if  ( html . length )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
															html . find ( '.timeago' ) . timeago ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														resultEl . toggleClass ( 'hidden' ,  ! html . length ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
															. find ( '.quick-search-results-container' ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
															. html ( html . length  ?  html  :  '' ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														$ ( window ) . trigger ( 'action:search.quick.complete' ,  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
															data :  data , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
															options :  options , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														} ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													} ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												} ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											} ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
									
										
										
										
											2020-06-09 16:49:56 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-05-22 11:18:16 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										inputEl . off ( 'keyup' ) . on ( 'keyup' ,  function  ( )  { 
							 
						 
					
						
							
								
									
										
										
										
											2019-02-16 16:20:58 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											if  ( searchTimeoutId )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												clearTimeout ( searchTimeoutId ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												searchTimeoutId  =  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											searchTimeoutId  =  setTimeout ( function  ( )  { 
							 
						 
					
						
							
								
									
										
										
										
											2020-06-09 16:49:56 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												if  ( inputEl . val ( ) . length  <  3 )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													quickSearchResults . addClass ( 'hidden' ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													oldValue  =  inputEl . val ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-27 13:25:30 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													return ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												} 
							 
						 
					
						
							
								
									
										
										
										
											2020-06-09 16:49:56 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												if  ( inputEl . val ( )  ===  oldValue )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													return ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												oldValue  =  inputEl . val ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2019-02-21 12:10:49 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												if  ( ! inputEl . is ( ':focus' ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													return  quickSearchResults . addClass ( 'hidden' ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												} 
							 
						 
					
						
							
								
									
										
										
										
											2020-06-10 16:56:05 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												doSearch ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2019-02-20 11:58:16 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											} ,  250 ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2019-02-16 16:20:58 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										} ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-06-10 16:56:05 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										inputEl . on ( 'blur' ,  function  ( )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											setTimeout ( function  ( )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												if  ( ! inputEl . is ( ':focus' ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													quickSearchResults . addClass ( 'hidden' ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											} ,  200 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										inputEl . on ( 'focus' ,  function  ( )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											if  ( inputEl . val ( )  &&  quickSearchResults . find ( '#quick-search-results' ) . children ( ) . length )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												quickSearchResults . removeClass ( 'hidden' ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										inputEl . off ( 'refresh' ) . on ( 'refresh' ,  function  ( )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											doSearch ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2019-02-19 11:26:26 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									} ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-06-10 15:11:57 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									app . handleSearch  =  function  ( searchOptions )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										searchOptions  =  searchOptions  ||  {  in :  'titles'  } ; 
							 
						 
					
						
							
								
									
										
										
										
											2019-02-19 11:26:26 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										var  searchButton  =  $ ( '#search-button' ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										var  searchFields  =  $ ( '#search-fields' ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										var  searchInput  =  $ ( '#search-fields input' ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-27 20:58:54 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										var  quickSearchContainer  =  $ ( '#quick-search-container' ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2019-02-19 11:26:26 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-05-22 11:18:16 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										$ ( '#search-form .advanced-search-link' ) . off ( 'mousedown' ) . on ( 'mousedown' ,  function  ( )  { 
							 
						 
					
						
							
								
									
										
										
										
											2019-02-19 11:26:26 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											ajaxify . go ( '/search' ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-05-22 11:18:16 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										$ ( '#search-form' ) . off ( 'submit' ) . on ( 'submit' ,  function  ( )  { 
							 
						 
					
						
							
								
									
										
										
										
											2019-02-21 12:10:49 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											searchInput . blur ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-22 11:18:16 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										searchInput . off ( 'blur' ) . on ( 'blur' ,  dismissSearch ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-06-09 16:49:56 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										searchInput . off ( 'focus' ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2019-02-19 11:26:26 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-06-10 15:11:57 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										var  searchElements  =  { 
							 
						 
					
						
							
								
									
										
										
										
											2019-02-19 11:26:26 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											inputEl :  searchInput , 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-27 20:58:54 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											resultEl :  quickSearchContainer , 
							 
						 
					
						
							
								
									
										
										
										
											2020-06-10 15:11:57 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										} ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										app . enableTopicSearch ( { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											searchOptions :  searchOptions , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											searchElements :  searchElements , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-21 11:23:16 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-10-25 21:34:47 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										function  dismissSearch ( )  { 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-31 15:46:55 -06:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											searchFields . addClass ( 'hidden' ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											searchButton . removeClass ( 'hidden' ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-21 11:23:16 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-05-22 11:18:16 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										searchButton . off ( 'click' ) . on ( 'click' ,  function  ( e )  { 
							 
						 
					
						
							
								
									
										
										
										
											2018-05-28 11:29:37 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											if  ( ! config . loggedIn  &&  ! app . user . privileges [ 'search:content' ] )  { 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-21 11:23:16 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												app . alert ( { 
							 
						 
					
						
							
								
									
										
										
										
											2017-02-18 01:27:46 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													message :  '[[error:search-requires-login]]' , 
							 
						 
					
						
							
								
									
										
										
										
											2017-02-17 19:31:21 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													timeout :  3000 , 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-21 11:23:16 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												} ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												ajaxify . go ( 'login' ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												return  false ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											e . stopPropagation ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											app . prepareSearch ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											return  false ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-05-22 11:18:16 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										$ ( '#search-form' ) . off ( 'submit' ) . on ( 'submit' ,  function  ( )  { 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-21 11:23:16 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											var  input  =  $ ( this ) . find ( 'input' ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-10-13 11:43:39 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											require ( [ 'search' ] ,  function  ( search )  { 
							 
						 
					
						
							
								
									
										
										
										
											2016-08-17 12:40:14 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												var  data  =  search . getSearchPreferences ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												data . term  =  input . val ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-06-10 15:11:57 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												$ ( window ) . trigger ( 'action:search.submit' ,  { 
							 
						 
					
						
							
								
									
										
										
										
											2020-06-10 16:56:05 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													searchOptions :  data , 
							 
						 
					
						
							
								
									
										
										
										
											2020-06-10 15:11:57 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													searchElements :  searchElements , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												} ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-10-13 11:43:39 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												search . query ( data ,  function  ( )  { 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-21 11:23:16 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													input . val ( '' ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												} ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											} ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											return  false ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-10-13 11:43:39 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									app . prepareSearch  =  function  ( )  { 
							 
						 
					
						
							
								
									
										
										
										
											2017-02-18 01:56:23 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										$ ( '#search-fields' ) . removeClass ( 'hidden' ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										$ ( '#search-button' ) . addClass ( 'hidden' ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-21 11:23:16 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										$ ( '#search-fields input' ) . focus ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									function  handleStatusChange ( )  { 
							 
						 
					
						
							
								
									
										
										
										
											2016-10-13 11:43:39 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										$ ( '[component="header/usercontrol"] [data-status]' ) . off ( 'click' ) . on ( 'click' ,  function  ( e )  { 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-21 11:23:16 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											var  status  =  $ ( this ) . attr ( 'data-status' ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-10-13 11:43:39 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											socket . emit ( 'user.setStatus' ,  status ,  function  ( err )  { 
							 
						 
					
						
							
								
									
										
										
										
											2017-02-18 01:52:56 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												if  ( err )  { 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-21 11:23:16 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													return  app . alertError ( err . message ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												} 
							 
						 
					
						
							
								
									
										
										
										
											2015-09-13 09:26:34 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												$ ( '[data-uid="'  +  app . user . uid  +  '"] [component="user/status"], [component="header/profilelink"] [component="user/status"]' ) 
							 
						 
					
						
							
								
									
										
										
										
											2015-08-27 14:07:24 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													. removeClass ( 'away online dnd offline' ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													. addClass ( status ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2018-10-10 22:46:36 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												$ ( '[component="header/usercontrol"] [data-status]' ) . each ( function  ( )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													$ ( this ) . find ( 'span' ) . toggleClass ( 'bold' ,  $ ( this ) . attr ( 'data-status' )  ===  status ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												} ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-30 15:14:02 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												app . user . status  =  status ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-21 11:23:16 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											} ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											e . preventDefault ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-10-13 11:43:39 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									app . updateUserStatus  =  function  ( el ,  status )  { 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-21 11:23:16 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										if  ( ! el . length )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											return ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-10-13 11:43:39 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										require ( [ 'translator' ] ,  function  ( translator )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											translator . translate ( '[[global:'  +  status  +  ']]' ,  function  ( translated )  { 
							 
						 
					
						
							
								
									
										
										
										
											2015-08-17 12:29:36 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												el . removeClass ( 'online offline dnd away' ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													. addClass ( status ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													. attr ( 'title' ,  translated ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													. attr ( 'data-original-title' ,  translated ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											} ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-21 11:23:16 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										} ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-09-08 14:01:20 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									app . newTopic  =  function  ( cid ,  tags )  { 
							 
						 
					
						
							
								
									
										
										
										
											2016-04-27 19:06:56 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										$ ( window ) . trigger ( 'action:composer.topic.new' ,  { 
							 
						 
					
						
							
								
									
										
										
										
											2016-09-08 14:01:20 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											cid :  cid  ||  ajaxify . data . cid  ||  0 , 
							 
						 
					
						
							
								
									
										
										
										
											2017-02-17 19:31:21 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											tags :  tags  ||  ( ajaxify . data . tag  ?  [ ajaxify . data . tag ]  :  [ ] ) , 
							 
						 
					
						
							
								
									
										
										
										
											2016-04-27 19:06:56 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										} ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-02-19 19:23:18 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									} ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-21 11:23:16 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-10-13 11:43:39 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									app . loadJQueryUI  =  function  ( callback )  { 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-21 11:23:16 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										if  ( typeof  $ ( ) . autocomplete  ===  'function' )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											return  callback ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-08-03 13:10:39 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										var  scriptEl  =  document . createElement ( 'script' ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										scriptEl . type  =  'text/javascript' ; 
							 
						 
					
						
							
								
									
										
										
										
											2017-02-18 14:42:15 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										scriptEl . src  =  config . relative _path  +  '/assets/vendor/jquery/js/jquery-ui.js?'  +  config [ 'cache-buster' ] ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-08-03 13:10:39 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										scriptEl . onload  =  callback ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										document . head . appendChild ( scriptEl ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-21 11:23:16 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									} ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-10-13 11:43:39 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									app . showEmailConfirmWarning  =  function  ( err )  { 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-21 11:23:16 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										if  ( ! config . requireEmailConfirmation  ||  ! app . user . uid )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											return ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
									
										
										
										
											2016-07-29 16:26:27 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										var  msg  =  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											alert _id :  'email_confirm' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											type :  'warning' , 
							 
						 
					
						
							
								
									
										
										
										
											2017-02-17 19:31:21 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											timeout :  0 , 
							 
						 
					
						
							
								
									
										
										
										
											2016-07-29 16:26:27 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										} ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-07-21 11:23:16 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										if  ( ! app . user . email )  { 
							 
						 
					
						
							
								
									
										
										
										
											2016-07-29 16:26:27 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											msg . message  =  '[[error:no-email-to-confirm]]' ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-10-13 11:43:39 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											msg . clickfn  =  function  ( )  { 
							 
						 
					
						
							
								
									
										
										
										
											2016-07-29 16:26:27 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												app . removeAlert ( 'email_confirm' ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												ajaxify . go ( 'user/'  +  app . user . userslug  +  '/edit' ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											} ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											app . alert ( msg ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										}  else  if  ( ! app . user [ 'email:confirmed' ]  &&  ! app . user . isEmailConfirmSent )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											msg . message  =  err  ?  err . message  :  '[[error:email-not-confirmed]]' ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-10-13 11:43:39 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											msg . clickfn  =  function  ( )  { 
							 
						 
					
						
							
								
									
										
										
										
											2016-07-29 16:26:27 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												app . removeAlert ( 'email_confirm' ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-10-13 11:43:39 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												socket . emit ( 'user.emailConfirm' ,  { } ,  function  ( err )  { 
							 
						 
					
						
							
								
									
										
										
										
											2016-07-29 16:26:27 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													if  ( err )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														return  app . alertError ( err . message ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													app . alertSuccess ( '[[notifications:email-confirm-sent]]' ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												} ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											} ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											app . alert ( msg ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										}  else  if  ( ! app . user [ 'email:confirmed' ]  &&  app . user . isEmailConfirmSent )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											msg . message  =  '[[error:email-not-confirmed-email-sent]]' ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											app . alert ( msg ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-21 11:23:16 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-10-13 11:43:39 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									app . parseAndTranslate  =  function  ( template ,  blockName ,  data ,  callback )  { 
							 
						 
					
						
							
								
									
										
										
										
											2017-08-30 10:51:25 -06:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										require ( [ 'translator' ,  'benchpress' ] ,  function  ( translator ,  Benchpress )  { 
							 
						 
					
						
							
								
									
										
										
										
											2016-08-12 15:29:41 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											function  translate ( html ,  callback )  { 
							 
						 
					
						
							
								
									
										
										
										
											2016-10-13 11:43:39 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												translator . translate ( html ,  function  ( translatedHTML )  { 
							 
						 
					
						
							
								
									
										
										
										
											2016-08-12 15:29:41 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													translatedHTML  =  translator . unescape ( translatedHTML ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													callback ( $ ( translatedHTML ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												} ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-01-20 16:00:11 -06:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											if  ( typeof  blockName  ===  'string' )  { 
							 
						 
					
						
							
								
									
										
										
										
											2017-08-30 10:51:25 -06:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												Benchpress . parse ( template ,  blockName ,  data ,  function  ( html )  { 
							 
						 
					
						
							
								
									
										
										
										
											2016-08-12 15:29:41 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													translate ( html ,  callback ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-29 23:58:48 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												} ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-01-20 16:00:11 -06:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											}  else  { 
							 
						 
					
						
							
								
									
										
										
										
											2016-08-12 15:29:41 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												callback  =  data ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												data  =  blockName ; 
							 
						 
					
						
							
								
									
										
										
										
											2017-08-30 10:51:25 -06:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												Benchpress . parse ( template ,  data ,  function  ( html )  { 
							 
						 
					
						
							
								
									
										
										
										
											2016-08-12 15:29:41 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													translate ( html ,  callback ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-29 23:58:48 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												} ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-01-20 16:00:11 -06:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-29 23:58:48 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									} ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-03-27 18:56:21 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-11-01 12:59:51 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									app . showCookieWarning  =  function  ( )  { 
							 
						 
					
						
							
								
									
										
										
										
											2017-04-19 20:33:03 -06:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										require ( [ 'translator' ,  'storage' ] ,  function  ( translator ,  storage )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											if  ( ! config . cookies . enabled  ||  ! navigator . cookieEnabled )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												// Skip warning if cookie consent subsystem disabled (obviously), or cookies not in use
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												return ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											}  else  if  ( window . location . pathname . startsWith ( config . relative _path  +  '/admin' ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												// No need to show cookie consent warning in ACP
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												return ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											}  else  if  ( storage . getItem ( 'cookieconsent' )  ===  '1' )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												return ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-11-20 15:11:34 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											config . cookies . message  =  translator . unescape ( config . cookies . message ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											config . cookies . dismiss  =  translator . unescape ( config . cookies . dismiss ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-11-20 17:50:39 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											config . cookies . link  =  translator . unescape ( config . cookies . link ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2019-06-13 11:54:39 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											config . cookies . link _url  =  translator . unescape ( config . cookies . link _url ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-11-20 15:11:34 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											app . parseAndTranslate ( 'partials/cookie-consent' ,  config . cookies ,  function  ( html )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												$ ( document . body ) . append ( html ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2018-10-23 17:23:21 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												$ ( document . body ) . addClass ( 'cookie-consent-open' ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-11-20 15:11:34 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												var  warningEl  =  $ ( '.cookie-consent' ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												var  dismissEl  =  warningEl . find ( 'button' ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												dismissEl . on ( 'click' ,  function  ( )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													// Save consent cookie and remove warning element
 
							 
						 
					
						
							
								
									
										
										
										
											2017-04-19 20:33:03 -06:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													storage . setItem ( 'cookieconsent' ,  '1' ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-11-20 15:11:34 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													warningEl . remove ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2018-10-23 17:23:21 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													$ ( document . body ) . removeClass ( 'cookie-consent-open' ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-11-20 15:11:34 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												} ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-11-10 13:50:37 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											} ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-11-01 12:59:51 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									} ; 
							 
						 
					
						
							
								
									
										
										
										
											2018-12-04 12:06:13 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									app . reskin  =  function  ( skinName )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										var  clientEl  =  Array . prototype . filter . call ( document . querySelectorAll ( 'link[rel="stylesheet"]' ) ,  function  ( el )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											return  el . href . indexOf ( config . relative _path  +  '/assets/client' )  !==  - 1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} ) [ 0 ]  ||  null ; 
							 
						 
					
						
							
								
									
										
										
										
											2018-12-12 11:16:49 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										if  ( ! clientEl )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											return ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
									
										
										
										
											2018-12-04 12:06:13 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-01-21 14:16:06 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										var  currentSkinClassName  =  $ ( 'body' ) . attr ( 'class' ) . split ( /\s+/ ) . filter ( function  ( className )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											return  className . startsWith ( 'skin-' ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2019-01-30 14:39:01 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										if  ( ! currentSkinClassName [ 0 ] )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											return ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
									
										
										
										
											2019-01-21 14:16:06 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										var  currentSkin  =  currentSkinClassName [ 0 ] . slice ( 5 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										currentSkin  =  currentSkin  !==  'noskin'  ?  currentSkin  :  '' ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										// Stop execution if skin didn't change
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										if  ( skinName  ===  currentSkin )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											return ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-01-02 16:01:54 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										var  linkEl  =  document . createElement ( 'link' ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										linkEl . rel  =  'stylesheet' ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										linkEl . type  =  'text/css' ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										linkEl . href  =  config . relative _path  +  '/assets/client'  +  ( skinName  ?  '-'  +  skinName  :  '' )  +  '.css' ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										linkEl . onload  =  function  ( )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											clientEl . parentNode . removeChild ( clientEl ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											// Update body class with proper skin name
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											$ ( 'body' ) . removeClass ( currentSkinClassName . join ( ' ' ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2019-01-21 14:16:06 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											$ ( 'body' ) . addClass ( 'skin-'  +  ( skinName  ||  'noskin' ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2019-01-02 16:01:54 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										} ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										document . head . appendChild ( linkEl ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2018-12-04 12:06:13 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									} ; 
							 
						 
					
						
							
								
									
										
										
										
											2019-05-16 09:41:56 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									app . updateTags  =  function  ( )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										var  metaWhitelist  =  [ 'title' ,  'description' ,  /og:.+/ ,  /article:.+/ ] . map ( function  ( val )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											return  new  RegExp ( val ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										var  linkWhitelist  =  [ 'canonical' ,  'alternate' ,  'up' ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										// Delete the old meta tags
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										Array . prototype . slice 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											. call ( document . querySelectorAll ( 'head meta' ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											. filter ( function  ( el )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												var  name  =  el . getAttribute ( 'property' )  ||  el . getAttribute ( 'name' ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												return  metaWhitelist . some ( function  ( exp )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													return  ! ! exp . test ( name ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												} ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											} ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											. forEach ( function  ( el )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												document . head . removeChild ( el ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											} ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										// Add new meta tags
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										ajaxify . data . _header . tags . meta 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											. filter ( function  ( tagObj )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												var  name  =  tagObj . name  ||  tagObj . property ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												return  metaWhitelist . some ( function  ( exp )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													return  ! ! exp . test ( name ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												} ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											} ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											. forEach ( function  ( tagObj )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												var  metaEl  =  document . createElement ( 'meta' ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												Object . keys ( tagObj ) . forEach ( function  ( prop )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													metaEl . setAttribute ( prop ,  tagObj [ prop ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												} ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												document . head . appendChild ( metaEl ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											} ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										// Delete the old link tags
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										Array . prototype . slice 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											. call ( document . querySelectorAll ( 'head link' ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											. filter ( function  ( el )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												var  name  =  el . getAttribute ( 'rel' ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												return  linkWhitelist . some ( function  ( item )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													return  item  ===  name ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												} ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											} ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											. forEach ( function  ( el )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												document . head . removeChild ( el ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											} ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										// Add new link tags
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										ajaxify . data . _header . tags . link 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											. filter ( function  ( tagObj )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												return  linkWhitelist . some ( function  ( item )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													return  item  ===  tagObj . rel ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												} ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											} ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											. forEach ( function  ( tagObj )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												var  linkEl  =  document . createElement ( 'link' ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												Object . keys ( tagObj ) . forEach ( function  ( prop )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													linkEl . setAttribute ( prop ,  tagObj [ prop ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												} ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												document . head . appendChild ( linkEl ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											} ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-21 11:23:16 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								} ( ) ) ;