Daniel@0
|
1 "use strict";
|
Daniel@0
|
2
|
Daniel@0
|
3 App.module("RepresentationModule", function(RepresentationModule, App, Backbone, Marionette, $, _, Logger) {
|
Daniel@0
|
4
|
Daniel@0
|
5 RepresentationModule.addInitializer(function(options){
|
Daniel@0
|
6
|
Daniel@0
|
7 RepresentationModule.Error = Marionette.Object.extend({
|
Daniel@0
|
8 defaults: {
|
Daniel@0
|
9 type: "unknown"
|
Daniel@0
|
10 },
|
Daniel@0
|
11
|
Daniel@0
|
12 knownErrorTypes: {
|
Daniel@0
|
13 "drawing": {needToEmptyContent: true},
|
Daniel@0
|
14 "view_default": {needToEmptyContent: true},
|
Daniel@0
|
15 "view_unknown": {needToEmptyContent: true},
|
Daniel@0
|
16
|
Daniel@0
|
17 "data-preparing_entity-derived": {needToEmptyContent: false},
|
Daniel@0
|
18 "data-preparing_base": {needToEmptyContent: false},
|
Daniel@0
|
19 "data-preparing_overlay": {needToEmptyContent: false},
|
Daniel@0
|
20
|
Daniel@0
|
21 "api-error_entity-derived": {needToEmptyContent: true},
|
Daniel@0
|
22 "api-error_base": {needToEmptyContent: true},
|
Daniel@0
|
23 "api-error_overlay": {needToEmptyContent: true},
|
Daniel@0
|
24
|
Daniel@0
|
25 "api-message_progress_base": {needToEmptyContent: true},
|
Daniel@0
|
26
|
Daniel@0
|
27 "data-error_entity-config": {needToEmptyContent: true},
|
Daniel@0
|
28 "data-error_view-config": {needToEmptyContent: true},
|
Daniel@0
|
29 "data-error_entity-derived": {needToEmptyContent: true},
|
Daniel@0
|
30 "data-error_base": {needToEmptyContent: true},
|
Daniel@0
|
31 "data-error_overlay": {needToEmptyContent: true},
|
Daniel@0
|
32
|
Daniel@0
|
33 "collection_undefined": {needToEmptyContent: true},
|
Daniel@0
|
34 "collection_no-recordings": {needToEmptyContent: true},
|
Daniel@0
|
35 "pair_incomplete": {needToEmptyContent: true},
|
Daniel@0
|
36 "comparison_not-supported": {needToEmptyContent: true},
|
Daniel@0
|
37 "comparison_wrong-type": {needToEmptyContent: true},
|
Daniel@0
|
38 "recording_undefined": {needToEmptyContent: true},
|
Daniel@0
|
39 "ok-count-0": {needToEmptyContent: true},
|
Daniel@0
|
40
|
Daniel@0
|
41 "auxiliary-resources_pending": {needToEmptyContent: false},
|
Daniel@0
|
42 "auxiliary-resources_fail": {needToEmptyContent: true},
|
Daniel@0
|
43
|
Daniel@0
|
44 "unknown": {needToEmptyContent: true}
|
Daniel@0
|
45 },
|
Daniel@0
|
46
|
Daniel@0
|
47 initialize: function(options) {
|
Daniel@0
|
48 this.options = _.defaults(options, this.defaults);
|
Daniel@0
|
49 },
|
Daniel@0
|
50
|
Daniel@0
|
51 needToEmptyContent: function() {
|
Daniel@0
|
52 return this.knownErrorTypes[this.options.type].needToEmptyContent;
|
Daniel@0
|
53 }
|
Daniel@0
|
54 });
|
Daniel@0
|
55 RepresentationModule.Error.protot
|
Daniel@0
|
56 });
|
Daniel@0
|
57 }, Logger);
|