-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdraft.js
58 lines (51 loc) · 1.23 KB
/
draft.js
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
_draft = function(){};
var _clipboard = '';
_draft.prototype.content = "Lorem Ipsum Dolor";
_draft.prototype.createdDate = '';
_draft.prototype.createdLatitude = '';
_draft.prototype.createdLongitude = '';
_draft.prototype.modifiedDate = '';
_draft.prototype.modifiedLatitude = '';
_draft.prototype.modifiedLongitude = '';
_draft.prototype.accessedDate = '';
_draft.prototype.flagged = false;
_draft.prototype.defineTag = function( tagName, tagString ){}
/**
* usually persists the changes to the drafts object
* the mock function only logs the given object
**/
function commit( draft ){
console.log( draft );
}
/**
* returns an arbitrary string functioning as clipboard
* @return string
**/
function getClipboard(){
return _clipboard;
}
/**
* set the mock clipboard content
* note: it's not the real clipboard
* @param string message
**/
function setClipboard( message ){
_clipboard = message;
}
/**
* just a mock function so no error will occur
**/
function stopAction(){
return 0;
}
/**
* should convert the string to markdown
* @todo find a lib to convert it to markdown
* @param string message
* @param bool useXHTML
* @return string
**/
function markdown(message, useXHTML){
return message;
}
var draft = new _draft();