Daniel@0: "use strict"; Daniel@0: Daniel@0: App.module("RepresentationModule", function(RepresentationModule, App, Backbone, Marionette, $, _, Logger) { Daniel@0: Daniel@0: RepresentationModule.addInitializer(function(options){ Daniel@0: Daniel@0: RepresentationModule.Error = Marionette.Object.extend({ Daniel@0: defaults: { Daniel@0: type: "unknown" Daniel@0: }, Daniel@0: Daniel@0: knownErrorTypes: { Daniel@0: "drawing": {needToEmptyContent: true}, Daniel@0: "view_default": {needToEmptyContent: true}, Daniel@0: "view_unknown": {needToEmptyContent: true}, Daniel@0: Daniel@0: "data-preparing_entity-derived": {needToEmptyContent: false}, Daniel@0: "data-preparing_base": {needToEmptyContent: false}, Daniel@0: "data-preparing_overlay": {needToEmptyContent: false}, Daniel@0: Daniel@0: "api-error_entity-derived": {needToEmptyContent: true}, Daniel@0: "api-error_base": {needToEmptyContent: true}, Daniel@0: "api-error_overlay": {needToEmptyContent: true}, Daniel@0: Daniel@0: "api-message_progress_base": {needToEmptyContent: true}, Daniel@0: Daniel@0: "data-error_entity-config": {needToEmptyContent: true}, Daniel@0: "data-error_view-config": {needToEmptyContent: true}, Daniel@0: "data-error_entity-derived": {needToEmptyContent: true}, Daniel@0: "data-error_base": {needToEmptyContent: true}, Daniel@0: "data-error_overlay": {needToEmptyContent: true}, Daniel@0: Daniel@0: "collection_undefined": {needToEmptyContent: true}, Daniel@0: "collection_no-recordings": {needToEmptyContent: true}, Daniel@0: "pair_incomplete": {needToEmptyContent: true}, Daniel@0: "comparison_not-supported": {needToEmptyContent: true}, Daniel@0: "comparison_wrong-type": {needToEmptyContent: true}, Daniel@0: "recording_undefined": {needToEmptyContent: true}, Daniel@0: "ok-count-0": {needToEmptyContent: true}, Daniel@0: Daniel@0: "auxiliary-resources_pending": {needToEmptyContent: false}, Daniel@0: "auxiliary-resources_fail": {needToEmptyContent: true}, Daniel@0: Daniel@0: "unknown": {needToEmptyContent: true} Daniel@0: }, Daniel@0: Daniel@0: initialize: function(options) { Daniel@0: this.options = _.defaults(options, this.defaults); Daniel@0: }, Daniel@0: Daniel@0: needToEmptyContent: function() { Daniel@0: return this.knownErrorTypes[this.options.type].needToEmptyContent; Daniel@0: } Daniel@0: }); Daniel@0: RepresentationModule.Error.protot Daniel@0: }); Daniel@0: }, Logger);