diff --git a/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/index.html b/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/index.html index 8736e8043671042f9740afc0a5f2d7e519ae0223..65483c87520e87c1b27c57e2a7f5f04f4e9b43ae 100644 --- a/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/index.html +++ b/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/index.html @@ -92,6 +92,10 @@ <script type="text/javascript" src="./js/util/FormUtil.js"></script> <script type="text/javascript" src="./js/util/BlockScrollUtil.js"></script> + <script type="text/javascript" src="./js/views/TrashManager/TrashManagerController.js"></script> + <script type="text/javascript" src="./js/views/TrashManager/TrashManagerModel.js"></script> + <script type="text/javascript" src="./js/views/TrashManager/TrashManagerView.js"></script> + <script type="text/javascript" src="./js/views/StorageManager/StorageManagerController.js"></script> <script type="text/javascript" src="./js/views/StorageManager/StorageManagerModel.js"></script> <script type="text/javascript" src="./js/views/StorageManager/StorageManagerView.js"></script> diff --git a/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/controllers/MainController.js b/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/controllers/MainController.js index 420db054701f01c649365874235d086342da6cbc..a02eebc2afc12208648e3e69ec07e027d5e00ff5 100644 --- a/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/controllers/MainController.js +++ b/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/controllers/MainController.js @@ -90,8 +90,6 @@ function MainController(profile) { $("#main").show(); //Get Metadata from all sample types before showing the main menu - - this.serverFacade.listSampleTypes ( function(result) { //Load Sample Types @@ -166,6 +164,11 @@ function MainController(profile) { // switch (newViewChange) { + case "showTrashcanPage": + document.title = "Storage Manager"; + this._showTrashcan(); + window.scrollTo(0,0); + break; case "showStorageManager": document.title = "Storage Manager"; this._showStorageManager(); @@ -370,9 +373,6 @@ function MainController(profile) { this._showInspectors = function() { //Show Inspectors - //var examineController = new ExamineController(this); - //examineController.init($("#mainContainer")); - //this.currentView = examineController; this.inspector.repaint(); } @@ -401,7 +401,6 @@ function MainController(profile) { } this._showSampleHierarchyPage = function(permId) { - //Show View var localInstance = this; this.serverFacade.searchWithUniqueId(permId, function(data) { @@ -440,7 +439,12 @@ function MainController(profile) { this.currentView = sampleFormController; sampleFormController.init($("#mainContainer")); } - + + this._showTrashcan = function() { + var trashcanController = new TrashManagerController(this); + this.trashcanController = trashcanController; + trashcanController.init($("#mainContainer")); + } this._showViewSamplePage = function(sample, isELNSubExperiment) { //Show Form diff --git a/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/views/SideMenu/SideMenuWidgetController.js b/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/views/SideMenu/SideMenuWidgetController.js index 342e3c0ddcdc67811c3619de49140dc50742ddb1..691ebb86bd5fc130c5cc51695b721c5368ffb708 100644 --- a/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/views/SideMenu/SideMenuWidgetController.js +++ b/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/views/SideMenu/SideMenuWidgetController.js @@ -304,6 +304,9 @@ function SideMenuWidgetController(mainController) { new SideMenuWidgetComponent(true, false, "Storage Manager", "Storage Manager", _this._sideMenuWidgetModel.menuStructure, null, "showStorageManager", null, "") ); } + _this._sideMenuWidgetModel.menuStructure.newMenuIfSelected.children.push( + new SideMenuWidgetComponent(true, false, "Trashcan", "Trashcan", _this._sideMenuWidgetModel.menuStructure, null, "showTrashcanPage", null, "") + ); _this._sideMenuWidgetView.repaintFirst($container); }); diff --git a/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/views/TrashManager/TrashManagerController.js b/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/views/TrashManager/TrashManagerController.js new file mode 100644 index 0000000000000000000000000000000000000000..5b2108166ca013ba5c5eabc36abc48e3c65ef4e6 --- /dev/null +++ b/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/views/TrashManager/TrashManagerController.js @@ -0,0 +1,31 @@ +/* + * Copyright 2014 ETH Zuerich, Scientific IT Services + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +function TrashManagerController(mainController) { + this._mainController = mainController; + this._trashManagerModel = new TrashManagerModel(); + this._trashManagerView = new TrashManagerView(this, this._trashManagerModel); + + this.init = function($container) { + var _this = this; + mainController.serverFacade.listDeletions(function(data) { + if(data.result && data.result.length > 0) { + //Fill Model + } + _this._trashManagerView.repaint($container); + }); + } +} \ No newline at end of file diff --git a/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/views/TrashManager/TrashManagerModel.js b/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/views/TrashManager/TrashManagerModel.js new file mode 100644 index 0000000000000000000000000000000000000000..d43ebb7858733eb782e75dca461a3597a3782f6e --- /dev/null +++ b/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/views/TrashManager/TrashManagerModel.js @@ -0,0 +1,19 @@ +/* + * Copyright 2014 ETH Zuerich, Scientific IT Services + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +function TrashManagerModel() { + +} \ No newline at end of file diff --git a/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/views/TrashManager/TrashManagerView.js b/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/views/TrashManager/TrashManagerView.js new file mode 100644 index 0000000000000000000000000000000000000000..eaf33f6435319c6bb067c167a69c0474ddfe2430 --- /dev/null +++ b/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/views/TrashManager/TrashManagerView.js @@ -0,0 +1,25 @@ +/* + * Copyright 2014 ETH Zuerich, Scientific IT Services + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +function TrashManagerView(trashManagerController, trashManagerModel) { + this._trashManagerController = trashManagerController; + this._trashManagerModel = trashManagerModel; + + this.repaint = function($container) { + $container.empty(); + $container.append("Hello Trashcan!"); + } +} \ No newline at end of file