Module: nagvis
Branch: master
Commit: 78ba9767215865c3ab1285c7dfbc0e1146bb65af
URL:    
http://nagvis.git.sourceforge.net/git/gitweb.cgi?p=nagvis/nagvis/commit/?id=78ba9767215865c3ab1285c7dfbc0e1146bb65af

Author: Roman Kyrylych <[email protected]>
Date:   Fri Aug 14 16:42:30 2009 +0300

gmap: Execute actions when doubleclicking on locations

Signed-off-by: Roman Kyrylych <[email protected]>

---

 uifx/src/modules/gmap/mediator/MainMD.as |   36 ++++++++++++++++++++++++++---
 1 files changed, 32 insertions(+), 4 deletions(-)

diff --git a/uifx/src/modules/gmap/mediator/MainMD.as 
b/uifx/src/modules/gmap/mediator/MainMD.as
index cf6a4b3..79f84c7 100644
--- a/uifx/src/modules/gmap/mediator/MainMD.as
+++ b/uifx/src/modules/gmap/mediator/MainMD.as
@@ -1,14 +1,13 @@
 package modules.gmap.mediator

 {

        import flash.events.IEventDispatcher;

+       import flash.external.ExternalInterface;

        import flash.system.Security;

        

        import modules.gmap.domain.Location;

        import modules.gmap.domain.Settings;

        import modules.gmap.events.ModeEvent;

-       import modules.gmap.view.MainView;

-       

-       import mx.controls.Alert; 

+       import modules.gmap.view.MainView; 

        

        public class MainMD

        {

@@ -85,7 +84,36 @@ package modules.gmap.mediator
                

                public function activateLocation(location:Location, 
settings:Settings):void

                {

-                               

+                       var slices1:Array = location.action.split(':', 2);

+                       switch(slices1[0])

+                       {

+                               case 'nagios':

+                                       gotoURL('/nagios', 
settings.openLinksInNewWindow);

+                                       return;

+                               case 'nagvis':

+                                       gotoURL('/nagvis', 
settings.openLinksInNewWindow);

+                                       return;

+                               case 'http':

+                               case 'https':

+                                       gotoURL(location.action, 
settings.openLinksInNewWindow);

+                                       return;

+                       }                               

+

+                       var slices2:Array = 
settings.defaultLocationAction.split(':', 2);

+                       switch(slices2[0])

+                       {

+                               case 'nagios':

+                                       gotoURL('/nagios', 
settings.openLinksInNewWindow);

+                                       return;

+                       }                               

+               }

+               

+               public function gotoURL(url:String, newWindow:Boolean):void

+               {

+                       if(newWindow)

+                               ExternalInterface.call('window.open("' + url + 
'")');

+                       else

+                               
ExternalInterface.call('window.location.assign("' + url + '")');

                }

        }

 }
\ No newline at end of file


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Nagvis-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nagvis-checkins

Reply via email to