/************************************************************************** * * @@@BUILDINFO@@@ 06favorites.jsx 2.0.1.63 27-March-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. **************************************************************************/ function Favorites() { this.length = 0; this.items = []; var trusted = Folder.myDocuments; trusted.changePath( 'Adobe Scripts' ); if( !trusted.exists ) trusted.create(); this.add( localize( "$$$/ESToolkit/Panes/Scripts/DefaultFavorite=Default" ), trusted.absoluteURI, true, "*.jsx", true ); globalBroadcaster.registerClient( this ); } Favorites.prototype.add = function( name, path, isDefault, filter, recursive ) { for( var i=0; i 0 ) { while( this.items.length > 1 ) if( !this.items[this.items.length-1].isDefault ) this.items.pop(); for( var i=0; i 0 ) { for( var i=0; i 0 ) ret = new FavoriteItem( this.window.nameField.text, this.window.pathField.text, false, this.window.filterField.text, this.window.recursBtn.value ); this.window.close(); } dlg.onShow = function() { this.window.nameField.active = true; } dlg.defaultElement = dlg.g2.btOK; dlg.cancelElement = dlg.g2.btCancel; dlg.show(); return ret; } function FavoriteItem( name, path, isDefault, filter, recursive ) { this.name = name; this.path = path; this.isDefault = ( isDefault ? isDefault : false ); this.filter = ( filter ? filter : '*.*' ); this.recursive = ( recursive ? recursive : false ); } FavoriteItem.prototype.equal = function( favorite ) { return ( favorite.name == this.name && favorite.path == this.path && favorite.isDefault == this.isDefault && favorite.filter == this.filter && favorite.recursive == this.recursive ); }