Changing click and ctrl-click functions on hyperlinks

Started by meverhart913, April 25, 2012, 08:26:16 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

meverhart913

Hi,
I am looking for a way to switch the default click to follow hyperlink and ctrl-click to see details on a diagram when it is saved as a webpage; I would like to make it where you can click to see the details and have to use a second function to leave the page.  I don't have a lot of experience with Visio so it may just be an oversight on my part but I can't seem to find it or any information on how to do this. Any help is greatly appreciated.

JohnGoldsmith

You can't alter the generation of the Save As Web output files but you can swap out your own version.

The part you want to get to is the OnShapeClick function in frameset.js and that's one of the files that remains fairly static given the same publish setting so you can modify your own version and just pop it back into the support folder for each output set.

If you want to change the behaviour have a look at reversing the logic in the following if statement:

if (frmToolbar.widgets && frmToolbar.widgets.Details &&
            ((e != null && e.ctrlKey) || (e == null && slEvent.Ctrl)))   // DOM or Silverlight events
      {
         UpdateProps (pageID, shapeID);
      }
      else
      {   
         var shapeNode = FindShapeXML (pageID, shapeID);
         var hlObj = GetHLAction (shapeNode, pageID, shapeID);
         if (hlObj != null)


As it is, it's just checking if the widgets panel (on the left) is not null and that the ctrl key is pressed.  If that's true it just updates the shape data table otherwise it trys to follow the hyperlink.

Hope that helps.

Best regards

John
John Goldsmith - Visio MVP
http://visualsignals.typepad.co.uk/