Skip to content

Commit 7a0aeb5

Browse files
committed
Removed deprecated editor flags.
The editor flags were only used in an alpha version and are not used since then. Which mean they could be safetly removed from all integrations.
1 parent fab7aeb commit 7a0aeb5

File tree

7 files changed

+14
-186
lines changed

7 files changed

+14
-186
lines changed

src/file_format/file_format.js

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ goog.provide('cwc.fileFormat.File');
2424
goog.require('cwc.file.Files');
2525
goog.require('cwc.file.MimeType');
2626
goog.require('cwc.mode.Type');
27-
goog.require('cwc.ui.EditorFlags');
2827
goog.require('cwc.utils.Logger');
2928

3029

@@ -107,7 +106,6 @@ cwc.fileFormat.File.prototype.init = function(silent = false) {
107106
this.frameworks_ = new cwc.file.Files();
108107
this.history_ = '';
109108
this.mode_ = cwc.mode.Type.NONE;
110-
this.setFlag('__editor__', new cwc.ui.EditorFlags());
111109
this.ui_ = 'default';
112110
this.metadata_ = {};
113111
};
@@ -199,22 +197,6 @@ cwc.fileFormat.File.prototype.getDescription = function() {
199197
};
200198

201199

202-
/**
203-
* @return {cwc.ui.EditorFlags}
204-
*/
205-
cwc.fileFormat.File.prototype.getEditorFlags = function() {
206-
return /** @type {cwc.ui.EditorFlags} */ (this.getFlag('__editor__'));
207-
};
208-
209-
210-
/**
211-
* @param {cwc.ui.EditorFlags} flags
212-
*/
213-
cwc.fileFormat.File.prototype.setEditorFlags = function(flags) {
214-
this.setFlag('__editor__', flags);
215-
};
216-
217-
218200
/**
219201
* @param {string} name
220202
* @param {string=} group
@@ -261,7 +243,7 @@ cwc.fileFormat.File.prototype.hasFiles = function() {
261243

262244
/**
263245
* @param {!string} name
264-
* @return {Object.<string>|string|cwc.ui.EditorFlags}
246+
* @return {Object.<string>|string}
265247
*/
266248
cwc.fileFormat.File.prototype.getFlag = function(name) {
267249
return this.flags_[name] || '';
@@ -278,7 +260,7 @@ cwc.fileFormat.File.prototype.getFlags = function() {
278260

279261
/**
280262
* @param {!string} name
281-
* @param {Object.<string>|string|cwc.ui.EditorFlags} value
263+
* @param {Object.<string>|string} value
282264
*/
283265
cwc.fileFormat.File.prototype.setFlag = function(name, value) {
284266
this.flags_[name] = value;

src/file_handler/file_handler.js

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ cwc.fileHandler.File.prototype.clear = function(silent = false) {
8282
* @param {!cwc.fileFormat.File} file
8383
*/
8484
cwc.fileHandler.File.prototype.setFile = function(file) {
85-
console.log('Set instance file to:', file);
8685
this.clear(true);
8786
this.file_ = file;
8887
};
@@ -130,7 +129,6 @@ cwc.fileHandler.File.prototype.getMimeType = function() {
130129
* @param {!cwc.file.MimeType} mimeType
131130
*/
132131
cwc.fileHandler.File.prototype.setMimeType = function(mimeType) {
133-
console.log('setMimeType:', mimeType);
134132
this.mimeType_ = mimeType;
135133
};
136134

@@ -229,7 +227,7 @@ cwc.fileHandler.File.prototype.getUi = function() {
229227

230228
/**
231229
* @param {!string} name
232-
* @param {Object.<string>|string|cwc.ui.EditorFlags} value
230+
* @param {Object.<string>|string} value
233231
*/
234232
cwc.fileHandler.File.prototype.setFlag = function(name, value) {
235233
this.file_.setFlag(name, value);
@@ -238,29 +236,13 @@ cwc.fileHandler.File.prototype.setFlag = function(name, value) {
238236

239237
/**
240238
* @param {!string} name
241-
* @return {Object.<string>|string|cwc.ui.EditorFlags}
239+
* @return {Object.<string>|string}
242240
*/
243241
cwc.fileHandler.File.prototype.getFlag = function(name) {
244242
return this.file_.getFlag(name);
245243
};
246244

247245

248-
/**
249-
* @return {cwc.ui.EditorFlags}
250-
*/
251-
cwc.fileHandler.File.prototype.getEditorFlags = function() {
252-
return this.file_.getEditorFlags();
253-
};
254-
255-
256-
/**
257-
* @param {cwc.ui.EditorFlags} flags
258-
*/
259-
cwc.fileHandler.File.prototype.setEditorFlags = function(flags) {
260-
this.file_.setEditorFlags(flags);
261-
};
262-
263-
264246
/**
265247
* @param {string} title
266248
*/

src/mode/modder.js

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -181,13 +181,11 @@ cwc.mode.Modder.prototype.addBlocklyView = function(name, content) {
181181
* @param {string=} content
182182
* @param {cwc.ui.EditorType=} type
183183
* @param {cwc.ui.EditorHint=} hints
184-
* @param {cwc.ui.EditorFlags=} flags
185184
*/
186-
cwc.mode.Modder.prototype.addEditorView = function(name, content, type, hints,
187-
flags) {
185+
cwc.mode.Modder.prototype.addEditorView = function(name, content, type, hints) {
188186
let editorInstance = this.helper.getInstance('editor');
189187
if (editorInstance) {
190-
editorInstance.addView(name, content, type, hints, flags);
188+
editorInstance.addView(name, content, type, hints);
191189
}
192190
};
193191

@@ -246,18 +244,6 @@ cwc.mode.Modder.prototype.runPreview = function() {
246244
};
247245

248246

249-
/**
250-
* Sets editor flags.
251-
* @param {!cwc.ui.EditorFlags} flags
252-
*/
253-
cwc.mode.Modder.prototype.setEditorFlags = function(flags) {
254-
let editorInstance = this.helper.getInstance('editor');
255-
if (editorInstance) {
256-
editorInstance.setEditorFlags(flags);
257-
}
258-
};
259-
260-
261247
/**
262248
* @param {boolean} active
263249
*/

src/renderer/internal/html5.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,11 @@ cwc.renderer.internal.HTML5.prototype.render = function(
9595
// C64 screen
9696
if (script.startsWith('10 ')) {
9797
css = 'body {color: #6076c5; background: #20398d; font-size: 24px;' +
98-
'font-family: "Lucida Console";}';
99-
javascript = '';
100-
html = '**** COMMODORE 64 BASIC V2 ****<br>' +
98+
'font-family: "Lucida Console"; padding: 20px;}';
99+
html = ' **** COMMODORE 64 BASIC V2 ****<br>' +
101100
'64K RAM SYSTEM 38911 BASIC BYTES FREE<br>' +
102101
'READY.<br><br>Nice try, clever clogs.<br>';
102+
javascript = '';
103103
}
104104

105105
// Simple framework.

src/ui/editor/editor.js

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ goog.require('cwc.ui.EditorAutocompleteBlacklistCodes');
2525
goog.require('cwc.ui.EditorAutocompleteBlacklistKeys');
2626
goog.require('cwc.ui.EditorAutocompleteList');
2727
goog.require('cwc.ui.EditorContent');
28-
goog.require('cwc.ui.EditorFlags');
2928
goog.require('cwc.ui.EditorHint');
3029
goog.require('cwc.ui.EditorInfobar');
3130
goog.require('cwc.ui.EditorToolbar');
@@ -64,9 +63,6 @@ cwc.ui.Editor = function(helper) {
6463
/** @type {CodeMirror} */
6564
this.editor = null;
6665

67-
/** @type {cwc.ui.EditorFlags} */
68-
this.editorFlags = new cwc.ui.EditorFlags();
69-
7066
/** @type {Object} */
7167
this.editorView = {};
7268

@@ -182,7 +178,6 @@ cwc.ui.Editor.prototype.decorate = function(node) {
182178

183179
// Render code editor template.
184180
this.log_.debug('Decorate', this.name, 'into node', this.node);
185-
this.editorFlags = new cwc.ui.EditorFlags();
186181
this.editorView = {};
187182
this.modified = false;
188183

@@ -466,23 +461,6 @@ cwc.ui.Editor.prototype.syncJavaScript = function() {
466461
}
467462
};
468463

469-
470-
/**
471-
* @return {cwc.ui.EditorFlags}
472-
*/
473-
cwc.ui.Editor.prototype.getEditorFlags = function() {
474-
return this.editorFlags;
475-
};
476-
477-
478-
/**
479-
* @param {!cwc.ui.EditorFlags} flags
480-
*/
481-
cwc.ui.Editor.prototype.setEditorFlags = function(flags) {
482-
this.editorFlags = flags;
483-
};
484-
485-
486464
/**
487465
* Syntax checks for supported formats.
488466
* @param {!boolean} active
@@ -580,10 +558,8 @@ cwc.ui.Editor.prototype.changeView = function(name) {
580558
* @param {string=} content
581559
* @param {cwc.ui.EditorType=} type
582560
* @param {cwc.ui.EditorHint=} hints
583-
* @param {cwc.ui.EditorFlags=} flags
584561
*/
585-
cwc.ui.Editor.prototype.addView = function(name, content = '', type, hints,
586-
flags) {
562+
cwc.ui.Editor.prototype.addView = function(name, content = '', type, hints) {
587563
if (name in this.editorView) {
588564
this.log_.error('Editor View', name, 'already exists!');
589565
return;
@@ -593,7 +569,7 @@ cwc.ui.Editor.prototype.addView = function(name, content = '', type, hints,
593569
(type ? 'with type ' + type : ''),
594570
(hints ? 'and hints ' + hints : ''),
595571
(content ? 'for content:' : ''), content);
596-
this.editorView[name] = new cwc.ui.EditorView(content, type, hints, flags);
572+
this.editorView[name] = new cwc.ui.EditorView(content, type, hints);
597573

598574
if (this.toolbar) {
599575
this.toolbar.addView(name);

src/ui/editor/editor_flags.js

Lines changed: 0 additions & 84 deletions
This file was deleted.

src/ui/editor/editor_view.js

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -19,21 +19,19 @@
1919
*/
2020
goog.provide('cwc.ui.EditorView');
2121

22-
goog.require('cwc.ui.EditorFlags');
2322
goog.require('cwc.ui.EditorHint');
2423
goog.require('cwc.ui.EditorType');
2524

2625

2726
/**
28-
* @constructor
29-
* @struct
3027
* @param {string=} content
3128
* @param {cwc.ui.EditorType=} type
3229
* @param {cwc.ui.EditorHint=} hints
33-
* @param {cwc.ui.EditorFlags=} flags
30+
* @constructor
31+
* @struct
3432
* @final
3533
*/
36-
cwc.ui.EditorView = function(content, type, hints, flags) {
34+
cwc.ui.EditorView = function(content, type, hints) {
3735
/** @type {!CodeMirror.Doc} */
3836
this.doc = new CodeMirror.Doc(content || '');
3937

@@ -43,9 +41,6 @@ cwc.ui.EditorView = function(content, type, hints, flags) {
4341
/** @type {!cwc.ui.EditorHint} */
4442
this.hints = hints || cwc.ui.EditorHint.UNKNOWN;
4543

46-
/** @type {!cwc.ui.EditorFlags} */
47-
this.flags = flags || new cwc.ui.EditorFlags();
48-
4944
/** @type {number} */
5045
this.cursorPosition = 0;
5146
};
@@ -59,15 +54,6 @@ cwc.ui.EditorView.prototype.getDoc = function() {
5954
};
6055

6156

62-
/**
63-
* @param {!string} name
64-
* @return {string}
65-
*/
66-
cwc.ui.EditorView.prototype.getFlag = function(name) {
67-
return this.flags.getFlag(name);
68-
};
69-
70-
7157
/**
7258
* Returns whether the document is currently clean.
7359
* @return {boolean}

0 commit comments

Comments
 (0)