|
|
@ -3,17 +3,20 @@ var StatusModel = require('../System/StatusModel');
|
|
|
|
var ZeroClipboard = require('zero.clipboard');
|
|
|
|
var ZeroClipboard = require('zero.clipboard');
|
|
|
|
var Messenger = require('../Shared/Messenger');
|
|
|
|
var Messenger = require('../Shared/Messenger');
|
|
|
|
|
|
|
|
|
|
|
|
module.exports = (function(){
|
|
|
|
|
|
|
|
$.fn.copyToClipboard = function(input) {
|
|
|
|
$.fn.copyToClipboard = function(input) {
|
|
|
|
var moviePath = StatusModel.get('urlBase') + '/Content/zero.clipboard.swf';
|
|
|
|
|
|
|
|
var client = new ZeroClipboard(this, {moviePath : moviePath});
|
|
|
|
ZeroClipboard.config({
|
|
|
|
client.on('load', function(client){
|
|
|
|
swfPath: StatusModel.get('urlBase') + '/Content/zero.clipboard.swf'
|
|
|
|
client.on('dataRequested', function(client){
|
|
|
|
});
|
|
|
|
client.setText(input.val());
|
|
|
|
|
|
|
|
|
|
|
|
var client = new ZeroClipboard(this);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
client.on('ready', function(e) {
|
|
|
|
|
|
|
|
client.on('copy', function(e) {
|
|
|
|
|
|
|
|
e.clipboardData.setData("text/plain", input.val());
|
|
|
|
});
|
|
|
|
});
|
|
|
|
client.on('complete', function(){
|
|
|
|
client.on('aftercopy', function() {
|
|
|
|
Messenger.show({message : 'Copied text to clipboard'});
|
|
|
|
Messenger.show({message : 'Copied text to clipboard'});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}).call(this);
|
|
|
|
|