oxjs/source/Ox.UI/js/Core/Ox.Clipboard.js
2011-11-05 17:46:53 +01:00

27 lines
728 B
JavaScript

// vim: et:ts=4:sw=4:sts=4:ft=javascript
'use strict';
/*@
Ox.Clipboard <o> Basic clipboard handler
copy <f> Copy data to clipboard
(data) -> <u> undefined
paste <f> Paste data from clipboard
() -> <*> Clipboard data
@*/
Ox.Clipboard = function() {
var clipboard = {};
return {
_print: function() {
Ox.Log('Core', JSON.stringify(clipboard));
},
copy: function(data) {
clipboard = data;
Ox.Log('Core', 'copy', JSON.stringify(clipboard));
},
paste: function(type) {
return type ? clipboard.type : clipboard;
},
type: function(type) {
return type in clipboard;
}
};
}();