forked from c9/cloud9
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocument.js
More file actions
41 lines (33 loc) · 909 Bytes
/
Copy pathdocument.js
File metadata and controls
41 lines (33 loc) · 909 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/**
* Document object for the Cloud9 IDE
*
* @copyright 2010, Ajax.org B.V.
* @license GPLv3 <http://www.gnu.org/licenses/gpl.txt>
*/
require.def("core/document",
function() {
var Document = function(node, docValue){
this.$init();
this.getNode = function(){
return node;
};
this.setNode = function(newNode) {
this.dispatchEvent("setnode", {node: newNode});
return (node = newNode);
};
this.hasValue = function(){
return this.getValue() !== undefined;
};
this.setValue = function(value){
this.setProperty("value", value);
docValue = value;
};
this.getValue = function(){
return (this.hasEventListener("retrievevalue")
? this.dispatchEvent("retrievevalue", {value: docValue})
: docValue);
};
};
Document.prototype = new apf.Class();
return Document;
});