News:

BB code in posts seems to be working again!
I haven't turned on every single tag, so please let me know if there are any that are used/needed but not activated.

Main Menu

remove "Page-1" on mouseover when saved as web page?

Started by rdandy5875, November 03, 2010, 07:57:47 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

rdandy5875

When I save my visio documents as a web page, there is a mouseover on the entire .htm page it creates that says "Page-1"

Can anyone help remove this? Post-Publish editing is just fine. I've looked through the page(s) and taken out the "Page-1" references I've found, but none of them seem to alleviate the problem.

Thanks, Randy

rdandy5875

Nevermind I found it

I'm exporting in .GIF format, in the file folder there is a .htm file named "gif_1.htm"

remove the ALT= description:

<IMG id="ConvertedImage" SRC="gif_1.gif" ALT="" name=RasterImage BORDER="0" USEMAP="#visImageMap">

Paul Herber

Quote from: rdandy5875 on November 03, 2010, 08:04:21 PM
<IMG id="ConvertedImage" SRC="gif_1.gif" ALT="" name=RasterImage BORDER="0" USEMAP="#visImageMap">

That's not really the right way to do it, instead set the title to blank viz.

<IMG id="ConvertedImage" SRC="gif_1.gif" ALT="put the old alt text back here" title="" name=RasterImage BORDER="0" USEMAP="#visImageMap">
Electronic and Electrical engineering, business and software stencils for Visio -

https://www.paulherber.co.uk/


Hey Ken

Paul:

Pardon me for resurrecting a two-year-old thread, but this is exactly the situation I find myself in, and have not been able to locate any other mention of the problem anywhere else on the web.

You are correct when you suggest adding TITLE="".  It works superbly (even though it's a jpeg in jpg_1.htm rather than a gif in gif_1.htm).  I made the change and none of the shapes on the page exhibit any spurious hover text.  However, the Visio drawing that I save as a web page has over a hundred pages to it, and hence over a hundred htm files I'd need to diddle.  I've hacked at it and could not find any easy way out. 

For a lot more background on how I'm using hover text, check out http://visguy.com/vgforum/index.php?topic=4337.0.  For some additional info, the bad hover text occurs in IE 8 and 9, but not in Firefox 13, so I only need to diddle for IE.  It does not occur where I have a shape with a User.visEquivTitle cell or a hyperlink; I get the text I expect rather than the page name.  It's only the vanilla shapes and page backgrounds that give me problems.    Replacing 'var gParams = ParseParams (location.search); with var gParams = "" did no good either.

Always something,

   - Ken

Ken V. Krawchuk
Author
No Dogs on Mars - A Starship Story
http://astarshipstory.com

Paul Herber

Have a look at Notepad++, this has a Replace feature that works in all files within a folder, and can do a search and replace with a regular expression.
A regex to replace title="xxxxx" with title="" shouldn't be too difficult (though please don't ask me!).
Electronic and Electrical engineering, business and software stencils for Visio -

https://www.paulherber.co.uk/

Hey Ken

Paul:

   Thanks for the suggestion, but I was really hoping for a zero-effort solution, maybe something cutely esoteric along the lines of the visEquivTitle that I could sneak in somewhere somehow and have everything automagically work.  Unfortunately, using a gang editor like Notepad++ would add another step to my release process, something I had hoped I could avoid because I expect to be doing a lot of releases.  Still, it is a solution and a viable way to get around a minor user experience annoyance.  Maybe I'll put together a macro that'll generate the web version, then spin thru the html and make the changes with no additional effort on my part.  Can you tell I'm a firm believer that laziness is a virtue?

   As always, I appreciate the thought.

   - Ken
Ken V. Krawchuk
Author
No Dogs on Mars - A Starship Story
http://astarshipstory.com

Paul Herber

Quote from: Hey Ken on December 04, 2012, 07:48:30 PM
Can you tell I'm a firm believer that laziness is a virtue?

Software is *all* about saving one key-stroke.
(but we ignore Cobol).
Electronic and Electrical engineering, business and software stencils for Visio -

https://www.paulherber.co.uk/

Paul Herber

Have a look at Windows Power Shell, any file editing should be quite viable within a script. Might be able to create a script to loop through all your files, edit the HTML and save, might take just seconds.

Electronic and Electrical engineering, business and software stencils for Visio -

https://www.paulherber.co.uk/

Hey Ken

#9
Quote from: Hey Ken on December 04, 2012, 07:48:30 PM

   Maybe I'll put together a macro that'll generate the web version, then spin thru the html and make the changes with no additional effort on my part.  Can you tell I'm a firm believer that laziness is a virtue?


   Well, laziness notwithstanding, today is the day. 

   I had been using Notepad++ to do the gang editing (despite the hassle of the added step I sometimes forgot to do), but my latest client doesn't have it installed and it would take special papal dispensation to get it.  So I bit the bullet and took the VBA route.  Took a couple of twists and turns, but it wasn't all that difficult to develop.  One of the biggest twists was that I could not reference Visio's file system object (the security folks here have everything locked down tight), so I had to work around it using Addons("SaveAsWeb").Run. 

   So I finally have what I really wanted: a one-shot fire-and-forget solution to publish to html that eliminates all the annoying behavior.  Another nice upshot is that I now have a gang editor that can also be used in a variety of non-Visio situations.  I'll turn Visio into a full-blown operating system yet!  The code is below.

   - Ken




Public Sub BuildWebVersion()

Dim PathName           As String
Dim FileNames          As String
Dim InputFileName      As String
Dim OutputFileName     As String
Dim I                  As Integer
Dim AString            As String
Dim ThisFileName       As String
Dim ExecutableHtml     As String
Dim BrowserTitle       As String
Dim ActiveDocumentName As String

' Extract file name without extension (not always needed, though)
ActiveDocumentName = ActiveDocument.Name
If LCase(Right(ActiveDocumentName, 4)) = ".vsd" Then
    ActiveDocumentName = Left(ActiveDocumentName, Len(ActiveDocumentName) - 4)
    End If

PathName = ActiveDocument.Path
If PathName = "" Then
    MsgBox "Visio does not allow a web version to be created until after the document has been saved once.  Please save the file, then re-try publishing the web version.", vbCritical, "Web Options"
    Exit Sub
    End If
   
BrowserTitle = InputBox("Enter title for browser tab (blank to abort):", "Web Options", ActiveDocumentName)
If BrowserTitle = "" Then Exit Sub

' build full name of the executable html file
ExecutableHtml = PathName & ActiveDocumentName & ".htm"

Addons("SaveAsWeb").Run _
    " /Target=""" & ExecutableHtml & """" & _
    " /PageTitle=" & BrowserTitle & _
    " /Prop=False " & _
    " /Folder=True " & _
    " /StartPage=-1 " & _
    " /EndPage=-1 " & _
    " /OpenBrowser=false " & _
    " /PriFormat=jpg " & _
    " /ScreenRes=1024x768 " & _
    " /Quiet=true " & _
    " /Silent=false " & _
    " /Search=False " & _
    " /PanZoom=False " & _
    " /NavBar=false "

' Fix annoying behavior in the executable html file
Open ExecutableHtml For Input Shared As #3

' build name for temporary file to hold fixes
OutputFileName = Left(ExecutableHtml, InStr(1, ExecutableHtml, ".htm")) & "kvk"
Open OutputFileName For Output Shared As #4

Do While Not EOF(3)
    Line Input #3, AString
    '''''''''''''''''''''''''''''''''''''''''''''''''''''''
    ' Remove "undefined" hover text
    I = InStr(1, AString, "var gParams = ParseParams (location.search);")
    If I > 0 Then
        AString = "var gParams = """""
        End If
    ' Remove "Click to follow hyperlink." hover text
    I = InStr(1, AString, "var strHLTooltipText = ""Click to follow hyperlink."";")
    If I > 0 Then
        AString = "var strHLTooltipText = """";"
        End If
    ' Remove "This frame contains the pages of your drawing." hover text
    I = InStr(1, AString, "title=""This frame contains the pages of your drawing.""")
    If I > 0 Then
        AString = Left(AString, I - 2) & " " & Right(AString, Len(AString) - I - 54)
        End If
    '''''''''''''''''''''''''''''''''''''''''''''''''''''''
    Print #4, AString
    Loop

Close #3
Close #4
Kill ExecutableHtml
Name OutputFileName As ExecutableHtml

' fix annoying behavior in all of the individual browser pages
PathName = PathName & ActiveDocumentName & "_files\"
FileNames = PathName & "*.htm"
' Get first file
ThisFileName = Dir(FileNames)

Do While ThisFileName <> ""
    InputFileName = PathName & ThisFileName
    Open InputFileName For Input Shared As #1
    ' build name for temporary file to hold fixes
    OutputFileName = Left(InputFileName, InStr(1, InputFileName, ".htm")) & "kvk"
    Open OutputFileName For Output Shared As #2
   
    Do While Not EOF(1)
        Line Input #1, AString
        '''''''''''''''''''''''''''''''''''''''''''''''''''''''
        ' Remove floating page name (only appears in IE)
        I = InStr(1, LCase(AString), "<img id=""convertedimage""") + 24
        If I > 24 Then
            AString = Left(AString, I) & "  title=""""  " & Right(AString, Len(AString) - I)
            End If
        '''''''''''''''''''''''''''''''''''''''''''''''''''''''
        Print #2, AString
        Loop
   
    Close #2
    Close #1
    Kill InputFileName
    Name OutputFileName As InputFileName
    ThisFileName = Dir ' sets up for next file, if there
    Loop

' Launch the html
ActiveDocument.FollowHyperlink ExecutableHtml, ActiveDocument.Pages.Item(1).Name

End Sub

Ken V. Krawchuk
Author
No Dogs on Mars - A Starship Story
http://astarshipstory.com

Yacine

Yacine

Hey Ken

Ken V. Krawchuk
Author
No Dogs on Mars - A Starship Story
http://astarshipstory.com

Browser ID: smf (possibly_robot)
Templates: 4: index (default), Display (default), GenericControls (default), GenericControls (default).
Sub templates: 6: init, html_above, body_above, main, body_below, html_below.
Language files: 4: index+Modifications.english (default), Post.english (default), Editor.english (default), Drafts.english (default).
Style sheets: 4: index.css, attachments.css, jquery.sceditor.css, responsive.css.
Hooks called: 371 (show)
Files included: 40 - 1775KB. (show)
Memory used: 2112KB.
Tokens: post-login.
Cache hits: 14: 0.00214s for 26,724 bytes (show)
Cache misses: 4: (show)
Queries used: 17.

[Show Queries]