+ hideLinkedItems: function(result) {
+ var index=0;
+ while (index<4) {\r
+ this["linkedObjs" + (index+1)].empty();\r
+ index = index + 1;\r
+ }\r
+ },\r
+\r
+ listViewShower: function(listViewName, collection_name, regionName, title) {\r
+ var app=this;\r
+ return function() {\r
+ app[regionName].show(new app[listViewName]);\r
+ app.hideLinkedItems();\r
+ $("#contentTitle").html(templateFromId("#xos-title-list")({"title": title}));\r
+ $("#detail").show();\r
+ $("#xos-listview-button-box").show();\r
+ $("#tabs").hide();\r
+ $("#xos-detail-button-box").hide();\r
+ }\r
+ },\r
+\r
+ addShower: function(detailName, collection_name, regionName, title) {\r
+ var app=this;\r
+ return function() {\r
+ model = new xos[collection_name].model();\r
+ detailViewClass = app[detailName];\r
+ detailView = new detailViewClass({model: model, collection:xos[collection_name]});\r
+ app[regionName].show(detailView);\r
+ $("#xos-detail-button-box").show();\r
+ $("#xos-listview-button-box").hide();\r
+ }\r
+ },\r
+\r
+ detailShower: function(detailName, collection_name, regionName, title) {\r
+ var app=this;\r
+ showModelId = function(model_id) {\r
+ $("#contentTitle").html(templateFromId("#xos-title-detail")({"title": title}));\r
+\r
+ collection = xos[collection_name];\r
+ model = collection.get(model_id);\r
+ if (model == undefined) {\r
+ app[regionName].show(new HTMLView({html: "failed to load object " + model_id + " from collection " + collection_name}));\r
+ } else {\r
+ detailViewClass = app[detailName];\r
+ detailView = new detailViewClass({model: model});\r
+ app[regionName].show(detailView);\r
+ detailView.showLinkedItems();\r
+ $("#xos-detail-button-box").show();\r
+ $("#xos-listview-button-box").hide();\r
+ }\r
+ }\r
+ return showModelId;\r
+ },\r
+\r
+ /* error handling callbacks */\r
+\r
+ hideError: function() {\r
+ if (this.logWindowId) {
+ } else {
+ $(this.errorBoxId).hide();
+ $(this.successBoxId).hide();
+ }
+ },
+
+ showSuccess: function(result) {
+ result["statusclass"] = "success";
+ if (this.logTableId) {
+ this.appendLogWindow(result);
+ } else {
+ $(this.successBoxId).show();
+ $(this.successBoxId).html(_.template($(this.successTemplate).html())(result));
+ var that=this;
+ $(this.successCloseButtonId).unbind().bind('click', function() {
+ $(that.successBoxId).hide();
+ });
+ }
+ },\r
+\r
+ showError: function(result) {\r