/*
 *     Copyright (c) 2013 CoNWeT Lab., Universidad Politécnica de Madrid
 *
 *     This file is part of Wirecloud Platform.
 *
 *     Wirecloud Platform is free software: you can redistribute it and/or
 *     modify it under the terms of the GNU Affero General Public License as
 *     published by the Free Software Foundation, either version 3 of the
 *     License, or (at your option) any later version.
 *
 *     Wirecloud is distributed in the hope that it will be useful, but WITHOUT
 *     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 *     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public
 *     License for more details.
 *
 *     You should have received a copy of the GNU Affero General Public License
 *     along with Wirecloud Platform.  If not, see
 *     <http://www.gnu.org/licenses/>.
 *
 */

/*global Constants, gettext, LogManagerFactory, StyledElements, Wirecloud, LayoutManagerFactory*/

(function () {

    "use strict";

    var GenericInterfaceSettingsMenuItems, clickCallback;

    GenericInterfaceSettingsMenuItems = function GenericInterfaceSettingsMenuItems(geinterface) {
        this.geinterface = geinterface;
    };
    GenericInterfaceSettingsMenuItems.prototype = new StyledElements.DynamicMenuItems();

    GenericInterfaceSettingsMenuItems.prototype.build = function build(context) {
        var label;
        var item, items = [];

        item = new StyledElements.MenuItem(gettext('Reorder endpoints'), function () {
                this.wiringEditor.ChangeObjectEditing(this);
        }.bind(this.geinterface));
        item.setDisabled(this.geinterface.sourceAnchors.length <= 1 && this.geinterface.targetAnchors.length <= 1);
        items.push(item);


        item = new StyledElements.MenuItem(gettext('Settings'), function () {
            var window_menu;
            if (this.ioperator) {
                window_menu = new Wirecloud.ui.OperatorPreferencesWindowMenu();
                window_menu.show(this.ioperator);
            } else {
                window_menu = new Wirecloud.Widget.PreferencesWindowMenu();
                window_menu.show(this.iwidget);
            }
        }.bind(this.geinterface));
        if ('ioperator' in this.geinterface) {
            item.setDisabled(this.geinterface.ioperator.meta.preferenceList.length == 0);
        } else {
            item.setDisabled(this.geinterface.iwidget.widget.getTemplate().getUserPrefs().length == 0);
        }
        items.push(item);

        return items;
    };

    Wirecloud.ui.WiringEditor.GenericInterfaceSettingsMenuItems = GenericInterfaceSettingsMenuItems;
})();

@@ -2497,24 +2497,841 @@
 ush(item);%0A%0A
+        if (this.geinterface.ioperator) %7B%0A            if (this.geinterface.isMinimized) %7B%0A                label = 'Maximize';%0A            %7D else %7B%0A                label = 'Minimize';%0A            %7D%0A            items.push(new StyledElements.MenuItem(gettext(label), function () %7B%0A                var interval;%0A%0A                if (this.isMinimized) %7B%0A                    this.restore();%0A                %7D else %7B%0A                    this.minimize();%0A                %7D%0A            %7D.bind(this.geinterface)));%0A        %7D%0A        if (this.geinterface.numberOfSources %3E 1 %7C%7C this.geinterface.numberOfTargets %3E 1) %7B%0A            items.push(new StyledElements.MenuItem(gettext('Reorder endpoints'), function () %7B%0A                    this.wiringEditor.ChangeObjectEditing(this);%0A            %7D.bind(this.geinterface)));%0A        %7D%0A
         retu

Add minimize option in operator settings menu