- console.log(this.editor);
- $(this.editor.frame).css({width: '100%', height: '100%'});
+ },
+
+ changed: function() {
+ this.model.set('text', this.editor.getCode());
+ },
+
+ editorDidLoad: function(editor) {
+ editor.setCode('Ładowanie edytora...');
+ $(editor.frame).css({width: '100%', height: '100%'});
+ this.editor.setCode(this.model.get('text'));
+ this.model.addObserver(this, 'text-changed');
+ this.unfreeze();
+ // editor.grabKeys(
+ // $.fbind(self, self.hotkeyPressed),
+ // $.fbind(self, self.isHotkey)
+ // );
+ },
+
+ handle: function(event, data) {
+ console.log('handle', this, event, data);
+ if (event == 'text-changed') {
+ this.freeze('Niezsynchronizowany');
+ // this.unfreeze();
+ } else if (event == 'xml-freeze') {
+ this.freeze('Ładowanie XMLa...');
+ } else if (event == 'xml-unfreeze') {
+ this.editor.setCode(this.model.get('text'));
+ this.unfreeze();
+ }