9 this.mode = this.INACTIVE_MODE;
12 (function () { // strict mode wrapper
14 Clipboard.prototype = {
16 * Clipboard mode for copying
21 * Clipboard mode for moving
26 * Clipbboard inactive mode
36 * Clipboard mode: [copy | move | inactive]
41 * Returns all paths in clipboard
44 get: function Clipboard_get() {
49 * Add new path to clipboard
50 * @param {array} paths aray of full paths
51 * @returns {number} current length of clipboard objects
53 add: function Clipboard_add(paths) {
54 var len = paths.length,
59 for (i = 0; i < len; i += 1) {
60 if (this.has(paths[i]) === false) {
61 this.data.push(paths[i]);
65 return this.data.length;
69 * Checks if specified path is already in clipboard
70 * @param {string} path full path
73 has: function Clipboard_has(path) {
74 return $.inArray(path, this.data) === -1 ? false : true;
78 * Clears all clipboard data and resets clipboard mode
80 clear: function Clipboard_clear() {
82 this.mode = this.INACTIVE_MODE;
87 * @param {number} mode
90 setMode: function Clipboard_setMode(mode) {
91 if ($.inArray(mode, [this.MOVE_MODE_ID, this.COPY_MODE_ID]) === false) {
92 console.error('Incorrect clipboard mode');
100 * @returns {number} mode Clipboard mode
102 getMode: function Clipboard_getMode() {
109 isEmpty: function Clipboard_isEmpty() {
110 return this.data.length === 0;