|
1 | 1 | import Route from '@ember/routing/route';
|
2 | 2 |
|
3 |
| -export default class DemoCodeMirrorRoute extends Route { |
4 |
| - queryParams = { |
5 |
| - allowMultipleSelections: { |
6 |
| - replace: true, |
7 |
| - }, |
8 |
| - |
9 |
| - autocompletion: { |
10 |
| - replace: true, |
11 |
| - }, |
12 |
| - |
13 |
| - bracketMatching: { |
14 |
| - replace: true, |
15 |
| - }, |
16 |
| - |
17 |
| - closeBrackets: { |
18 |
| - replace: true, |
19 |
| - }, |
20 |
| - |
21 |
| - collapseUnchanged: { |
22 |
| - replace: true, |
23 |
| - }, |
24 |
| - |
25 |
| - crosshairCursor: { |
26 |
| - replace: true, |
27 |
| - }, |
28 |
| - |
29 |
| - document: { |
30 |
| - replace: true, |
31 |
| - }, |
32 |
| - |
33 |
| - drawSelection: { |
34 |
| - replace: true, |
35 |
| - }, |
36 |
| - |
37 |
| - dropCursor: { |
38 |
| - replace: true, |
39 |
| - }, |
40 |
| - |
41 |
| - editable: { |
42 |
| - replace: true, |
43 |
| - }, |
44 |
| - |
45 |
| - filename: { |
46 |
| - replace: true, |
47 |
| - }, |
48 |
| - |
49 |
| - foldGutter: { |
50 |
| - replace: true, |
51 |
| - }, |
52 |
| - |
53 |
| - highlightActiveLine: { |
54 |
| - replace: true, |
55 |
| - }, |
56 |
| - |
57 |
| - highlightSelectionMatches: { |
58 |
| - replace: true, |
59 |
| - }, |
60 |
| - |
61 |
| - highlightSpecialChars: { |
62 |
| - replace: true, |
63 |
| - }, |
64 |
| - |
65 |
| - highlightTrailingWhitespace: { |
66 |
| - replace: true, |
67 |
| - }, |
68 |
| - |
69 |
| - highlightWhitespace: { |
70 |
| - replace: true, |
71 |
| - }, |
72 |
| - |
73 |
| - history: { |
74 |
| - replace: true, |
75 |
| - }, |
76 |
| - |
77 |
| - indentOnInput: { |
78 |
| - replace: true, |
79 |
| - }, |
80 |
| - |
81 |
| - indentUnit: { |
82 |
| - replace: true, |
83 |
| - }, |
84 |
| - |
85 |
| - indentWithTab: { |
86 |
| - replace: true, |
87 |
| - }, |
88 |
| - |
89 |
| - language: { |
90 |
| - replace: true, |
91 |
| - }, |
92 |
| - |
93 |
| - lineNumbers: { |
94 |
| - replace: true, |
95 |
| - }, |
96 |
| - |
97 |
| - lineSeparator: { |
98 |
| - replace: true, |
99 |
| - }, |
100 |
| - |
101 |
| - lineWrapping: { |
102 |
| - replace: true, |
103 |
| - }, |
104 |
| - |
105 |
| - mergeControls: { |
106 |
| - replace: true, |
107 |
| - }, |
108 |
| - |
109 |
| - originalDocument: { |
110 |
| - replace: true, |
111 |
| - }, |
112 |
| - |
113 |
| - outline: { |
114 |
| - replace: true, |
115 |
| - }, |
116 |
| - |
117 |
| - placeholder: { |
118 |
| - replace: true, |
119 |
| - }, |
120 |
| - |
121 |
| - preserveHistory: { |
122 |
| - replace: true, |
123 |
| - }, |
124 |
| - |
125 |
| - readOnly: { |
126 |
| - replace: true, |
127 |
| - }, |
128 |
| - |
129 |
| - rectangularSelection: { |
130 |
| - replace: true, |
131 |
| - }, |
132 |
| - |
133 |
| - scrollPastEnd: { |
134 |
| - replace: true, |
135 |
| - }, |
136 |
| - |
137 |
| - selectedDocumentIndex: { |
138 |
| - replace: true, |
139 |
| - }, |
140 |
| - |
141 |
| - selectedIndentUnitIndex: { |
142 |
| - replace: true, |
143 |
| - }, |
144 |
| - |
145 |
| - selectedLineSeparatorIndex: { |
146 |
| - replace: true, |
147 |
| - }, |
148 |
| - |
149 |
| - selectedTabSizeIndex: { |
150 |
| - replace: true, |
151 |
| - }, |
152 |
| - |
153 |
| - selectedThemeIndex: { |
154 |
| - replace: true, |
155 |
| - }, |
156 |
| - |
157 |
| - syntaxHighlighting: { |
158 |
| - replace: true, |
159 |
| - }, |
160 |
| - |
161 |
| - tabSize: { |
162 |
| - replace: true, |
163 |
| - }, |
164 |
| - |
165 |
| - theme: { |
166 |
| - replace: true, |
167 |
| - }, |
| 3 | +const QUERY_PARAMS = [ |
| 4 | + 'allowMultipleSelections', |
| 5 | + 'autocompletion', |
| 6 | + 'bracketMatching', |
| 7 | + 'closeBrackets', |
| 8 | + 'collapseUnchanged', |
| 9 | + 'crosshairCursor', |
| 10 | + 'document', |
| 11 | + 'drawSelection', |
| 12 | + 'dropCursor', |
| 13 | + 'editable', |
| 14 | + 'filename', |
| 15 | + 'foldGutter', |
| 16 | + 'highlightActiveLine', |
| 17 | + 'highlightSelectionMatches', |
| 18 | + 'highlightSpecialChars', |
| 19 | + 'highlightTrailingWhitespace', |
| 20 | + 'highlightWhitespace', |
| 21 | + 'history', |
| 22 | + 'indentOnInput', |
| 23 | + 'indentUnit', |
| 24 | + 'indentWithTab', |
| 25 | + 'language', |
| 26 | + 'lineNumbers', |
| 27 | + 'lineSeparator', |
| 28 | + 'lineWrapping', |
| 29 | + 'mergeControls', |
| 30 | + 'originalDocument', |
| 31 | + 'outline', |
| 32 | + 'placeholder', |
| 33 | + 'preserveHistory', |
| 34 | + 'readOnly', |
| 35 | + 'rectangularSelection', |
| 36 | + 'scrollPastEnd', |
| 37 | + 'selectedDocumentIndex', |
| 38 | + 'selectedIndentUnitIndex', |
| 39 | + 'selectedLineSeparatorIndex', |
| 40 | + 'selectedTabSizeIndex', |
| 41 | + 'selectedThemeIndex', |
| 42 | + 'syntaxHighlighting', |
| 43 | + 'tabSize', |
| 44 | + 'theme', |
| 45 | +]; |
| 46 | + |
| 47 | +interface QueryParamOptions { |
| 48 | + [key: string]: { |
| 49 | + replace: boolean; |
168 | 50 | };
|
169 | 51 | }
|
| 52 | + |
| 53 | +export default class DemoCodeMirrorRoute extends Route { |
| 54 | + queryParams = QUERY_PARAMS.reduce<QueryParamOptions>((acc, param) => { |
| 55 | + acc[param] = { replace: true }; |
| 56 | + return acc; |
| 57 | + }, {}); |
| 58 | +} |
0 commit comments