| Author | 
         | 
         
      
        
         
         ghadah Newbie 
          
  
  Joined: 03 April 2012 Location: Saudi Arabia
 Online Status: Offline Posts: 3
          | 
        
         
          
           | Posted: 03 April 2012 at 4:31am | IP Logged
		     | 
                    
            		  
           | 
           
          
           
  | 
           
          
HI
 
 how to add JS link to the menu ? 
 for example if i need to move the   (Manage Folders) link besides the calendar link.
 
 
 
 
         | 
       
       
        | Back to Top | 
         
          
         | 
       
       
       
        |   | 
      
        
         
         Igor AfterLogic Support 
          
 
  Joined: 24 June 2008 Location: United States
 Online Status: Offline Posts: 6168
          | 
        
         
          
           | Posted: 04 April 2012 at 12:47am | IP Logged
		     | 
                    
            		  
           | 
           
          
           
  | 
           
          
Adding the links to top menu of WebMail Pro is described here. Using "javascript:your_js_code" notation, you can add JavaScript link there as well. For instance, if you need a "Manage Folders" link, you should take the code from js/mail/folders-pane.js file, lines 216-223:
 
 
Code: 
   
    
    
      
          SetHistoryHandler(
     {
      ScreenId: SCREEN_USER_SETTINGS,
      iEntity: PART_MANAGE_FOLDERS,
      iEditableAcctId: WebMail.Accounts.currId,
      bNewMode: false
     }
    ); | 
       
       | 
    
    | 
 
 
 
 and supply it in js/common/defines.js file:
 
 
Code: 
   
    
    
      
       var CustomTopLinks = [
  { Name: 'Manage Folders', Link: 'javascript:SetHistoryHandler({ScreenId: SCREEN_USER_SETTINGS,iEntity: PART_MANAGE_FOLDERS,iEditableAcctId: WebMail.Accounts.currId,bNewMode: false});' }
 ]; | 
       
       | 
    
    | 
 
 
 
 One more thing: links added this way have target="_blank" attribute which makes them open in new tab/window. With JavaScript links, however, this won't work, so you'll need to edit js/mail/webmail.js file (line ~1878):
 
 
Code: 
   
    
    
      
       | a = CreateChild(div, 'a', [['href', topLink.Link], ['target', '_blank']]); | 
       
       | 
    
    | 
 
 
 
 so that it looks like:
 
 
Code: 
   
    
    
      
       | a = CreateChild(div, 'a', [['href', topLink.Link]]); | 
       
       | 
    
    | 
 
 
 
 --
 Regards,
 Igor, AfterLogic Support
         | 
       
       
        | Back to Top | 
         
          
         | 
       
       
       
        |   | 
      
        
         
         ghadah Newbie 
          
  
  Joined: 03 April 2012 Location: Saudi Arabia
 Online Status: Offline Posts: 3
          | 
        
         
          
           | Posted: 04 April 2012 at 3:19am | IP Logged
		     | 
                    
            		  
           | 
           
          
           
  | 
           
          
Hi Igor,
 
 Thanks for your help Your Great :)
 
 I found code in the file js/common/webmail.js
 
 
         | 
       
       
        | Back to Top | 
         
          
         | 
       
       
       
        |   |