oxjs/source/Ox.UI/js/Core/Clipboard.js

28 lines
690 B
JavaScript
Raw Normal View History

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