2011-11-05 16:46:53 +00:00
|
|
|
'use strict';
|
2012-05-21 10:38:18 +00:00
|
|
|
|
2011-05-16 08:24:46 +00:00
|
|
|
/*@
|
2011-05-16 10:49:48 +00:00
|
|
|
Ox.Clipboard <o> Basic clipboard handler
|
2011-09-09 10:41:13 +00:00
|
|
|
copy <f> Copy data to clipboard
|
|
|
|
(data) -> <u> undefined
|
|
|
|
paste <f> Paste data from clipboard
|
|
|
|
() -> <*> Clipboard data
|
2011-05-16 08:24:46 +00:00
|
|
|
@*/
|
2012-05-22 13:14:40 +00:00
|
|
|
Ox.Clipboard = (function() {
|
2011-04-22 22:03:10 +00:00
|
|
|
var clipboard = {};
|
|
|
|
return {
|
|
|
|
_print: function() {
|
2011-11-04 15:54:28 +00:00
|
|
|
Ox.Log('Core', JSON.stringify(clipboard));
|
2011-04-22 22:03:10 +00:00
|
|
|
},
|
|
|
|
copy: function(data) {
|
|
|
|
clipboard = data;
|
2011-11-04 15:54:28 +00:00
|
|
|
Ox.Log('Core', 'copy', JSON.stringify(clipboard));
|
2011-04-22 22:03:10 +00:00
|
|
|
},
|
|
|
|
paste: function(type) {
|
2011-09-20 21:50:00 +00:00
|
|
|
return type ? clipboard.type : clipboard;
|
|
|
|
},
|
|
|
|
type: function(type) {
|
|
|
|
return type in clipboard;
|
2011-04-22 22:03:10 +00:00
|
|
|
}
|
|
|
|
};
|
2012-05-22 13:14:40 +00:00
|
|
|
})();
|