mirror of
https://github.com/avatao-content/frontend-tutorial-framework
synced 2025-01-15 21:51:57 +00:00
Merge pull request #18 from avatao-content/webide_enhancements
Webide enhancements
This commit is contained in:
commit
ce97228a51
@ -41,14 +41,9 @@ export class WebSocketService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public send(key: string, data?: any, trigger?: any): void {
|
public send(key: string, data?: any, trigger?: any): void {
|
||||||
// TODO: do this nicer?
|
|
||||||
const message = {'key': key};
|
const message = {'key': key};
|
||||||
if (data) {
|
if (data) { message['data'] = data; }
|
||||||
message['data'] = data;
|
if (trigger) { message['trigger'] = trigger; }
|
||||||
}
|
|
||||||
if (trigger) {
|
|
||||||
message['trigger'] = trigger;
|
|
||||||
}
|
|
||||||
this.uplink.next(message);
|
this.uplink.next(message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,7 @@ import { DeploymentNotificationService } from '../services/deployment-notificati
|
|||||||
|
|
||||||
const modelist = brace.acequire('ace/ext/modelist');
|
const modelist = brace.acequire('ace/ext/modelist');
|
||||||
|
|
||||||
const defaultSourceCode = 'Oops! Something went wrong :(';
|
const defaultSourceCode = 'Loading your file...';
|
||||||
const autosave_interval = 2000;
|
const autosave_interval = 2000;
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
@ -69,7 +69,7 @@ export class WebideComponent implements OnInit {
|
|||||||
updateFileData(data: SourceCode) {
|
updateFileData(data: SourceCode) {
|
||||||
this.filename = data.filename;
|
this.filename = data.filename;
|
||||||
this.directory = data.directory;
|
this.directory = data.directory;
|
||||||
this.code = data.content;
|
this.code = (data.content != null) ? data.content : this.code;
|
||||||
this.language = modelist.getModeForPath(this.filename).name;
|
this.language = modelist.getModeForPath(this.filename).name;
|
||||||
this.files = data.files;
|
this.files = data.files;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user