PageSourceSearch

https://webapp.oncoassist.com/public/themes/default/js/global.js

js oncoassist.com collected 2026-10-02 15:06:55 UTC 10,229 bytes, 273 lines download raw bytes

1function add_to_fav(username,mtype,isext,pagetitle)
2{
3	pagetitle = typeof pagetitle !== 'undefined' ? pagetitle : '';
4	
5	var options = {
6		'username': username,
7		'mtype':mtype,
8		'isext' : isext
9	};
10  
11
12	options[CSRF_NAME] = CSRF_TOKEN;
13  
14	jQuery.ajax({
15      	type: "POST", 
16      	url:window.location.protocol + "//" + window.location.host + "/public/index.php/favourite/make_fav",
17   	
18     	data: options,
19      	success: function(response) 
20      		{
21      			if(isext=='n'){
22					if (typeof Intercom !== 'undefined')Intercom('trackEvent', pagetitle,{Favorite:''});    
23					if(pagetitle == 'LIPS3' || pagetitle == 'Child' || pagetitle == 'IBW & ABW' || pagetitle == 'Karnofsky' || pagetitle == 'Heng' || pagetitle == 'Khorana' || pagetitle == 'Glasgow' || pagetitle == 'GermanHodgkin' || pagetitle == 'MelanomaTool' ||  pagetitle == 'CorrectedCalc' || pagetitle == 'Opioid' || pagetitle == 'Steroid' || pagetitle == 'Creatinine' || pagetitle == 'CLL-IPI' || pagetitle == 'Wright' || pagetitle == 'IPSS-R' || pagetitle == 'NCCNTreatment'  || pagetitle == 'BreastCancer' || pagetitle == 'MASCC' || pagetitle =='MGUS' || pagetitle =='MDS' || pagetitle == 'R-ISS' || pagetitle == 'SINS'|| pagetitle == 'CTS5' || pagetitle =='SSIGN' || pagetitle == 'Bellmunt' || pagetitle == 'CPSEG' || pagetitle == 'ASSURE' || pagetitle == 'CTCAE'){
24						var fireEventLIPS3Favourite = {profession: userJobdescription, primary_speciality: userProfession,isFavourite:true};
25					}					
26      			}else{
27					if (typeof Intercom !== 'undefined')Intercom('trackEvent', pagetitle,{Unfavorite:''});
28					if(pagetitle == 'LIPS3' || pagetitle == 'Child' || pagetitle == 'IBW & ABW' || pagetitle == 'Karnofsky' || pagetitle == 'Heng' || pagetitle == 'Khorana' || pagetitle == 'Glasgow' || pagetitle == 'GermanHodgkin' || pagetitle == 'MelanomaTool' ||  pagetitle == 'CorrectedCalc' || pagetitle == 'Opioid' || pagetitle == 'Steroid' || pagetitle == 'Creatinine' || pagetitle == 'CLL-IPI' || pagetitle == 'Wright' || pagetitle == 'IPSS-R' || pagetitle == 'NCCNTreatment'  || pagetitle == 'BreastCancer' || pagetitle == 'MASCC' || pagetitle =='MGUS' || pagetitle =='MDS' || pagetitle == 'R-ISS' || pagetitle == 'SINS'|| pagetitle == 'CTS5' || pagetitle =='SSIGN' || pagetitle == 'Bellmunt' || pagetitle == 'CPSEG' || pagetitle == 'ASSURE' || pagetitle == 'CTCAE'){
29						var fireEventLIPS3Favourite = {profession: userJobdescription, primary_speciality: userProfession,isFavourite:false};
30					} 
31      			}
32      			$("#addtofavph").html(response);
33
34				//Firebase event logging Start
35				//if(pagetitle == 'LIPS3')pushEvents('LIPS3_Favourite',fireEventLIPS3Favourite);			
36				switch(pagetitle) {
37					case 'LIPS3':
38					  //LIPS3_Favourite
39					  pushEvents('LIPS3_Favourite',fireEventLIPS3Favourite);
40					  break;
41					case 'Child':
42					  //Child Favourite
43					  pushEvents('ChildPS_Favourite',fireEventLIPS3Favourite);
44					  break;
45					case 'IBW & ABW':
46						//IBW & ABW Favourite
47						pushEvents('IBW_ABW_Favourite',fireEventLIPS3Favourite);
48						break;
49					case 'Heng':
50						//IMDC Heng Favourite
51						pushEvents('IMDC_Favourite',fireEventLIPS3Favourite);
52						break; 	  						
53					case 'Karnofsky':
54						//Child Favourite
55						pushEvents('Karnofsky_Favourite',fireEventLIPS3Favourite);
56						break;
57					case 'Glasgow':
58						//Child Favourite
59						pushEvents('Glasgow_Favourite',fireEventLIPS3Favourite);
60						break;	 	
61						
62					case 'Khorana':
63						//Child Favourite
64						pushEvents('Khorana_Favourite',fireEventLIPS3Favourite);
65						break; 	
66					case 'CorrectedCalc':
67						//Corrected Calcium Favourite
68						pushEvents('CorrectedCalc_Favorite',fireEventLIPS3Favourite);
69						break; 	
70					case 'Wright':
71						//Child Favourite
72						pushEvents('Wright_GFR_Favourite',fireEventLIPS3Favourite);	
73						break; 	
74					case 'MelanomaTool':
75						//Child Favourite
76						pushEvents('Melanoma_Favourite',fireEventLIPS3Favourite);
77						break; 		
78					case 'GermanHodgkin':
79						//German Hodgkin
80						pushEvents('GermanHodgkin_Favourite',fireEventLIPS3Favourite);
81						break;	
82				    case 'Opioid':
83						//Opiate Analgesic Converter
84						pushEvents('Opiate_Favourite',fireEventLIPS3Favourite);
85						break; 
86					case 'Steroid':
87						//Steroid Converter
88						pushEvents('Steroid_Favourite',fireEventLIPS3Favourite);
89						break;			
90					case 'Creatinine':
91						//Creatinine Clearance(GFR) Cockroft-Gault Equation
92						pushEvents('CreatinineCockroft_Favorite',fireEventLIPS3Favourite);
93						break; 																
94					case 'CLL-IPI':
95						//German Hodgkin
96						pushEvents('CLLIPI_Favourite',fireEventLIPS3Favourite);
97						break;			
98					case 'IPSS-R':
99						//IPSS-R
100						pushEvents('IPSSR_Favourite',fireEventLIPS3Favourite);
101						break;	
102					case 'NCCNTreatment':	
103					    //NCCNTreatment
104						pushEvents('NCCN_Favourite',fireEventLIPS3Favourite);
105						break;
106					case 'BreastCancer':	
107					    //BreastCancer
108						pushEvents('Breast_Favourite',fireEventLIPS3Favourite);
109						break;
110					case 'MASCC':
111						pushEvents('MASCC_Favourite',fireEventLIPS3Favourite);
112						break;
113					case 'AJCC':	
114					    //AJCC
115						pushEvents('AJCC_Favourite',fireEventLIPS3Favourite);
116						break;								
117					case 'MGUS':	
118						//MGUS
119						pushEvents('MGUS_Favourite',fireEventLIPS3Favourite);						
120						break;							
121					case 'MDS':	
122					    //MDS
123						pushEvents('MDSAnaemia_Favourite',fireEventLIPS3Favourite);
124						break;	
125					case 'R-ISS':	
126					    //RISS
127						pushEvents('RISS_Favourite',fireEventLIPS3Favourite);
128						break;
129					case 'SINS':	
130					    //SINS
131					pushEvents('SINS_Favourite',fireEventLIPS3Favourite);
132						break;		
133						//CTS5		
134					case 'CTS5':	
135					pushEvents('CTS5_Favourite',fireEventLIPS3Favourite);
136						break;	
137						//SSIGN
138					case 'SSIGN':
139						pushEvents('SSIGN_Favourite',fireEventLIPS3Favourite);
140						break;
141						//ASSURE
142					case 'ASSURE':						
143						pushEvents('ASSURE_Favourite',fireEventLIPS3Favourite);						
144						break;						
145					case 'Bellmunt':	
146					    //CRP-Bellmunt 
147						pushEvents('CRP_Bellmunt_Favourite',fireEventLIPS3Favourite);
148						break;		
149					//CTPS+EG		
150					case 'CPSEG':	
151						pushEvents('CPSEG_Favourite',fireEventLIPS3Favourite);
152						break;	
153					case 'CTCAE':
154						pushEvents('CTCAE',fireEventLIPS3Favourite);	
155						break;
156					default:
157					  //Nothing to execute
158				}
159				//Firebase event logging End
160      		},
161      	error: function(xhr, ajaxOptions, thrownError) 
162      		{ 
163      			alert(thrownError); 
164      		}
165 	});
166						
167}
168
169function tell_a_friend(){
170
171		Intercom('trackEvent', "Tell A Friend"); 
172		//Intercom('trackEvent', "Tell a Friend",{Email:emailid}); 
173	 BootstrapDialog.show({
174		 size: BootstrapDialog.SIZE_NORMAL,
175		 id : 'diaa',
176         title: 'Tell a Friend',
177         message: $('<input type="text" class="form-control" placeholder="your friend\'s email id" id="emailid"/>'),
178         buttons: [{
179             label: 'Send email',
180             cssClass: 'btn-primary',
181             action: function() {
182            	 
183            	 var emailid = $("#emailid").val();
184            	 //var emailcontent = $("#emailmsg").val();
185            	 
186				 var regex = /^([a-zA-Z0-9_.+-])+\@(([a-zA-Z0-9-])+\.)+([a-zA-Z0-9]{2,4})+$/;
187				 var options = {
188					'emailid': emailid
189				 };
190			  
191				options[CSRF_NAME] = CSRF_TOKEN;
192            	 if(regex.test(emailid))
193            	 {
194            			jQuery.ajax({
195            		      	type: "POST", 
196            		      	url:window.location.protocol + "//" + window.location.host + "/public/index.php/favourite/sendeumail",
197            		   	
198            		     	data: options,
199            		      	success: function(response) 
200            		      		{ 
201            		      		if(response == '1'){
202            		      			$('#diaa').modal('hide');
203            		      			BootstrapDialog.show({
204            		      			    id: 'diab',
205 	                 		            title: 'Cheers!!',
206 	                 		            message: 'Email has been sent.'
207 	                 		        });
208            		      			setTimeout(function() {$('#diab').modal('hide');}, 2000);
209            		      		
210            		      		}else{
211            		      			$('#diaa').modal('hide');
212            		      			 BootstrapDialog.show({
213            		      				id: 'diab',
214 	                 		            title: 'Opps!!',
215 	                 		            message: 'Failure in send email. Try again later.'
216 	                 		        });
217            		      			 
218            		      			setTimeout(function() {$('#diab').modal('hide');}, 2000);
219            		      		}
220	            		      		
221            		      		},
222            		      	error: function(xhr, ajaxOptions, thrownError) 
223            		      		{ 
224            		      			alert(thrownError); 
225            		      		}
226            		 	});
227            		 }else{
228            			 BootstrapDialog.show({
229            				 	id:'diac',
230            		            title: 'Error',
231            		            message: 'Please enter valid email id.'
232            		        });
233            			 
234            			 setTimeout(function() {$('#diac').modal('hide');}, 2000);
235            			 //setTimeout(function() {$('#diaa').modal('hide');}, 2000);
236            		 }                 
237             }
238         }]
239     }); 
240}
241function call_intercom_event(eventname,metadata)
242{
243	metadata = typeof metadata !== 'undefined' ? metadata : '';
244	if(metadata!=''){
245		Intercom('trackEvent', eventname,{metadata:''});
246	}else{
247		Intercom('trackEvent', eventname);
248	}						
249}
250
251$(document).ready(function(){
252
253    $('.btn-logout').on('click',function(e){
254      e.preventDefault();
255
256      $('.menu-link').trigger('click');
257      BootstrapDialog.confirm({
258        title: 'Alert',
259        message: 'Are you sure you want to logout?',
260        type: BootstrapDialog.TYPE_PRIMARY,
261        btnCancelLabel: 'No',
262        btnOKLabel: 'Yes',
263        btnOKClass: 'btn-primary',
264        callback: function(btnresult) {
265            // result will be true if button was click, while it will be false if users close the dialog directly.
266            if(btnresult) {
267              window.location ="/public/logout.php";
268            }
269        }
270      });
271    });
272    
273});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.