/************************************************************************** * * @@@BUILDINFO@@@ 69helpMenu-2.jsx 2.0.1.62 22-Mar-2007 * Copyright 2006-2007 Adobe Systems Incorporated * All Rights Reserved. * * NOTICE: All information contained herein is, and remains the property of * Adobe Systems Incorporated and its suppliers, if any. The intellectual * and technical concepts contained herein are proprietary to Adobe Systems * Incorporated and its suppliers and may be covered by U.S. and Foreign * Patents,patents in process,and are protected by trade secret or copyright * law. Dissemination of this information or reproduction of this material * is strictly forbidden unless prior written permission is obtained from * Adobe Systems Incorporated. **************************************************************************/ /////////////////////////////////////////////////////////////////////////////// // // help menu // menus.help = new MenuElement ("menu", "$$$/ESToolkit/Menu/Help=&Help", "at the end of menubar", "help"); // Add this setup to the late startup tasks. addDelayedTask (setupHelpMenu); function setupHelpMenu() { setupHelpDocs(); menus.help.updates = new MenuElement ("command", "$$$/ESToolkit/Menu/Help/Updates=&Updates...", "---at the end of help", "help/updates"); menus.help.updates.onDisplay = function() { this.enabled = app.isUpdaterInstalled && app.isUpdaterEnabled; } menus.help.updates.onSelect = function() { app.checkForUpdates(); } menus.help.about = new MenuElement ("command", localize ("$$$/ESToolkit/Menu/Help/About=&About %1...", app.title), "at the end of help", "help/about"); menus.help.about.onSelect = function() { app.showAboutBox(); } OMV.setup(); } //----------------------------------------------------------------------------- // // setupHelpDocs(...) // // Purpose: Populate help menu with PDF files of the application folder (or sub folder) // //----------------------------------------------------------------------------- function setupHelpDocs() { var startFolder = Folder.appPackage; if( !startFolder ) return; if( !_win ) startFolder = startFolder.parent; var tree = []; // // create file info tree // iterateHelpDocs( startFolder, tree, true ); // // populate help menu // populateHelpDocs( tree, 'help', true ); // // find PDF files in given folder // function iterateHelpDocs( folder, info, recursive ) { if( folder instanceof Folder ) { var subFolders = folder.getFiles(); for( var i=0; i 0 ? tree[i].file.displayName : decodeURI(tree[i].file.name) ); if( displayName.lastIndexOf( '.pdf' ) == displayName.length-4 ) displayName = displayName.substr( 0, displayName.length-4 ); item = new MenuElement( "command", displayName, location, menuID ); item.file = tree[i].file; item.disabled = false; separator = false; item.onDisplay = function() { this.enabled = !this.disabled; } item.onSelect = function() { this.disable = !this.file.execute(); } } } } function validatePDFFolder( obj ) { var ret = false; if( obj.sub && obj.file instanceof Folder ) { for( var i=0; i