These forums are read-only and considered to be an archive. Please use the new Community for future interaction and posts.

use html editor on displayed text file

I would like to be able to right click a listed text file and open a window for an html editor so that I could edit the file on the server.

How could another function be added to the right click context menu so that my client side js function is called and the listed file be used as a parameter?
Dave 7/8/2008 6:22 PM
Open FileVistaControl/ui/default.menus.xml and add your new menu item (MyNewCommand) after OpenWithWebBrowser item:

    <Item command="OpenWith" text="106" icon="openwith.png">

      <Menu>

        <Item command="OpenWithWebBrowser" text="107" icon="webbrowser.png" value="Download" />

<Item command="MyNewCommand" text="999" />

      </Menu>

    </Item> 

Note that value of text is the string id of the text in the language file, so you need to add your command text with a new id to the language file. You will use the value of command property below.


Then open FileVistaControl/scripts/filevista.js and find executeCommand function. In this function there is a long switch statement, add your new command to this statement:

case "MyNewCommand":

    var fileName = grid.getSelectedFirstRow().cells[nameColumn.index];

    var rootFolderID = currentFolder.rootFolderID;

    var relativePath = currentFolder.relativePath;

    // Call your custom function or do something here with the above information.
    
    break;            
Cem Alacayir 7/28/2008 3:52 PM