]>
git.r.bdr.sh - rbdr/dotfiles/blob - atom/packages/ex-mode/node_modules/atom-space-pen-views/lib/text-editor-view.js
e957a2bf041230fd6a7f9ee7efb253972a438d88
2 var $, TextEditorView
, View
, _ref
,
3 __hasProp
= {}.hasOwnProperty
,
4 __extends = function(child
, parent
) { for (var key
in parent
) { if (__hasProp
.call(parent
, key
)) child
[key
] = parent
[key
]; } function ctor() { this.constructor = child
; } ctor
.prototype = parent
.prototype; child
.prototype = new ctor(); child
.__super__
= parent
.prototype; return child
; };
6 _ref
= require('space-pen'), View
= _ref
.View
, $ = _ref
.$;
8 module
.exports
= TextEditorView
= (function(_super
) {
9 __extends(TextEditorView
, _super
);
11 function TextEditorView(params
) {
12 var attributes
, mini
, name
, placeholderText
, value
;
16 mini
= params
.mini
, placeholderText
= params
.placeholderText
, attributes
= params
.attributes
;
17 if (attributes
== null) {
21 attributes
['mini'] = mini
;
23 if (placeholderText
!= null) {
24 attributes
['placeholder-text'] = placeholderText
;
26 this.element
= document
.createElement('atom-text-editor');
27 for (name
in attributes
) {
28 value
= attributes
[name
];
29 this.element
.setAttribute(name
, value
);
31 if (this.element
.__spacePenView
!= null) {
32 this.element
.__spacePenView
= this;
33 this.element
.__allowViewAccess
= true;
35 TextEditorView
.__super__
.constructor.apply(this, arguments
);
36 this.setModel(this.element
.getModel());
39 TextEditorView
.prototype.setModel = function(model
) {
43 TextEditorView
.prototype.getModel = function() {
47 TextEditorView
.prototype.getText = function() {
48 return this.model
.getText();
51 TextEditorView
.prototype.setText = function(text
) {
52 return this.model
.setText(text
);
55 TextEditorView
.prototype.hasFocus = function() {
56 return this.element
.hasFocus();
59 return TextEditorView
;