Completed
Push — task/context-menu ( 799c34...14c51a )
by Frank
08:30 queued 03:12
created

ContextMenuActions.actionUpload   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 7
nc 1
nop 2
dl 0
loc 10
rs 10
c 1
b 0
f 0
1
/**
2
 * Module: TYPO3/CMS/ExtensionKey/ContextMenuActions
3
 *
4
 * JavaScript to handle the click action of the "Hello World" context menu item
5
 * @exports TYPO3/CMS/ExtensionKey/ContextMenuActions
6
 */
7
define(function () {
8
  'use strict';
9
10
  /**
11
   * @exports TYPO3/CMS/DigitalAssetManagement/ContextMenuActions
12
   */
13
  let ContextMenuActions = {};
14
15
  /**
16
   *
17
   * @param {string} menuType
18
   * @param {string} identifier of the page
19
   */
20
  ContextMenuActions.actionNewFile = function (menuType, identifier) {
21
    let event = new CustomEvent('resolveEvent', {
0 ignored issues
show
Bug introduced by
The variable CustomEvent seems to be never declared. If this is a global, consider adding a /** global: CustomEvent */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
22
      detail: {
23
        'event': 'actionNewFile',
24
        'menuType': menuType,
25
        'identifier': identifier
26
      }
27
    });
28
    document.dispatchEvent(event);
29
  };
30
31
  /**
32
   *
33
   * @param {string} menuType
34
   * @param {string} identifier of the page
35
   */
36
  ContextMenuActions.actionNewFolder = function (menuType, identifier) {
37
    let event = new CustomEvent('resolveEvent', {
0 ignored issues
show
Bug introduced by
The variable CustomEvent seems to be never declared. If this is a global, consider adding a /** global: CustomEvent */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
38
      detail: {
39
        'event': 'actionNewFolder',
40
        'menuType': menuType,
41
        'identifier': identifier
42
      }
43
    });
44
    document.dispatchEvent(event);
45
  };
46
47
  /**
48
   *
49
   * @param {string} menuType
50
   * @param {string} identifier of the page
51
   */
52
  ContextMenuActions.actionUpload = function (menuType, identifier) {
53
    let event = new CustomEvent('resolveEvent', {
0 ignored issues
show
Bug introduced by
The variable CustomEvent seems to be never declared. If this is a global, consider adding a /** global: CustomEvent */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
54
      detail: {
55
        'event': 'actionUpload',
56
        'menuType': menuType,
57
        'identifier': identifier
58
      }
59
    });
60
    document.dispatchEvent(event);
61
  };
62
63
  /**
64
   *
65
   * @param {string} menuType
66
   * @param {string} identifier of the page
67
   */
68
  ContextMenuActions.actionDownload = function (menuType, identifier) {
69
    let event = new CustomEvent('resolveEvent', {
0 ignored issues
show
Bug introduced by
The variable CustomEvent seems to be never declared. If this is a global, consider adding a /** global: CustomEvent */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
70
      detail: {
71
        'event': 'actionDownload',
72
        'menuType': menuType,
73
        'identifier': identifier
74
      }
75
    });
76
    document.dispatchEvent(event);
77
  };
78
79
  /**
80
   *
81
   * @param {string} menuType
82
   * @param {string} identifier of the page
83
   */
84
  ContextMenuActions.actionMoveTo = function (menuType, identifier) {
85
    let event = new CustomEvent('resolveEvent', {
0 ignored issues
show
Bug introduced by
The variable CustomEvent seems to be never declared. If this is a global, consider adding a /** global: CustomEvent */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
86
      detail: {
87
        'event': 'actionMoveTo',
88
        'menuType': menuType,
89
        'identifier': identifier
90
      }
91
    });
92
    document.dispatchEvent(event);
93
  };
94
95
  /**
96
   *
97
   * @param {string} menuType
98
   * @param {string} identifier of the page
99
   */
100
  ContextMenuActions.actionCopyTo = function (menuType, identifier) {
101
    let event = new CustomEvent('resolveEvent', {
0 ignored issues
show
Bug introduced by
The variable CustomEvent seems to be never declared. If this is a global, consider adding a /** global: CustomEvent */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
102
      detail: {
103
        'event': 'actionCopyTo',
104
        'menuType': menuType,
105
        'identifier': identifier
106
      }
107
    });
108
    document.dispatchEvent(event);
109
  };
110
111
  /**
112
   *
113
   * @param {string} menuType
114
   * @param {string} identifier of the page
115
   */
116
  ContextMenuActions.actionDelete = function (menuType, identifier) {
117
    let event = new CustomEvent('resolveEvent', {
0 ignored issues
show
Bug introduced by
The variable CustomEvent seems to be never declared. If this is a global, consider adding a /** global: CustomEvent */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
118
      detail: {
119
        'event': 'actionDelete',
120
        'menuType': menuType,
121
        'identifier': identifier
122
      }
123
    });
124
    document.dispatchEvent(event);
125
  };
126
127
  /**
128
   *
129
   * @param {string} menuType
130
   * @param {string} identifier of the page
131
   */
132
  ContextMenuActions.actionRename = function (menuType, identifier) {
133
    let event = new CustomEvent('resolveEvent', {
0 ignored issues
show
Bug introduced by
The variable CustomEvent seems to be never declared. If this is a global, consider adding a /** global: CustomEvent */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
134
      detail: {
135
        'event': 'actionRename',
136
        'menuType': menuType,
137
        'identifier': identifier
138
      }
139
    });
140
    document.dispatchEvent(event);
141
  };
142
143
  /**
144
   *
145
   * @param {string} menuType
146
   * @param {string} identifier of the page
147
   */
148
  ContextMenuActions.actionInfo = function (menuType, identifier) {
149
    let event = new CustomEvent('resolveEvent', {
0 ignored issues
show
Bug introduced by
The variable CustomEvent seems to be never declared. If this is a global, consider adding a /** global: CustomEvent */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
150
      detail: {
151
        'event': 'actionInfo',
152
        'menuType': menuType,
153
        'identifier': identifier
154
      }
155
    });
156
    document.dispatchEvent(event);
157
  };
158
159
  /**
160
   *
161
   * @param {string} menuType
162
   * @param {string} identifier of the page
163
   */
164
  ContextMenuActions.actionPreview = function (menuType, identifier) {
165
    let event = new CustomEvent('resolveEvent', {
0 ignored issues
show
Bug introduced by
The variable CustomEvent seems to be never declared. If this is a global, consider adding a /** global: CustomEvent */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
166
      detail: {
167
        'event': 'actionPreview',
168
        'menuType': menuType,
169
        'identifier': identifier
170
      }
171
    });
172
    document.dispatchEvent(event);
173
  };
174
175
  /**
176
   *
177
   * @param {string} menuType
178
   * @param {string} identifier of the page
179
   */
180
  ContextMenuActions.actionReplace = function (menuType, identifier) {
181
    let event = new CustomEvent('resolveEvent', {
0 ignored issues
show
Bug introduced by
The variable CustomEvent seems to be never declared. If this is a global, consider adding a /** global: CustomEvent */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
182
      detail: {
183
        'event': 'actionReplace',
184
        'menuType': menuType,
185
        'identifier': identifier
186
      }
187
    });
188
    document.dispatchEvent(event);
189
  };
190
191
  /**
192
   *
193
   * @param {string} menuType
194
   * @param {string} identifier of the page
195
   */
196
  ContextMenuActions.actionEditStorage = function (menuType, identifier) {
197
    let event = new CustomEvent('resolveEvent', {
0 ignored issues
show
Bug introduced by
The variable CustomEvent seems to be never declared. If this is a global, consider adding a /** global: CustomEvent */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
198
      detail: {
199
        'event': 'actionEditStorage',
200
        'menuType': menuType,
201
        'identifier': identifier
202
      }
203
    });
204
    document.dispatchEvent(event);
205
  };
206
207
  return ContextMenuActions;
208
});