Validate the code as submitted, not as it is in the database
[L-seed.git] / web / js / communication.js
index 79451ff..2c1ea6e 100644 (file)
@@ -380,7 +380,20 @@ Lseed.Communication = function() {
                        cmp.removeAll();
                        cmp.add(elem);
                } else {
-                       console.error("Lseed.Communication.clearNavigation: 'navTree' does not exist.");
+                       console.error("Lseed.Communication.closeAllTabs: 'contentTabPanel' does not exist.");
+               }
+       };
+       
+       this.closeTab = function(tabname) {
+               var cmp = Ext.getCmp('contentTabPanel');
+               if (cmp) {
+                       var tab = this.getTab(tabname);
+                       if (tab) {
+                               console.error("Lseed.Communication.closeTab: '"+tabname+"' does not exist.");
+                       }
+                       cmp.remove(tab);
+               } else {
+                       console.error("Lseed.Communication.closeTab: 'contentTabPanel' does not exist.");
                }
        };
        
@@ -464,7 +477,7 @@ Lseed.Communication = function() {
        // === Season Managerment ===
        
        this.GetSeasonList = function() {
-               Ext.MessageBox.wait("Staffeln werden geladen.", "Wird geladen...");
+               Ext.MessageBox.wait("Saisons werden geladen.", "Wird geladen...");
                
                this.sendMessage(Lseed.MessageCommands.RPC, { func: 'GetSeasonList' });
        };
@@ -582,7 +595,11 @@ Lseed.Editor = function() {
                                ,icon: Ext.MessageBox.Info
                        });
                } else {
+                       // This is a hack for now:
                        var pdEditor = Ext.getCmp("plantdefinitioneditor");
+                       if (!pdEditor) {
+                               var pdEditor = Ext.getCmp("editplantdefinitioneditor");
+                       }
                        if (pdEditor) {
                                communication.stopWaitingForPage();
                                Ext.MessageBox.show({