Prowlarr/src/UI/Mixins/CopyToClipboard.js
Mark McDowall 6b423c104c API Key in UI
New: view/reset API in General Settings
Fixed: API will reject unauthenticated requests
2014-03-13 21:23:47 -07:00

30 lines
761 B
JavaScript

'use strict';
define([
'jquery',
'System/StatusModel',
'zero.clipboard',
'Shared/Messenger'
],
function ($, StatusModel, ZeroClipboard, Messenger) {
$.fn.copyToClipboard = function (input) {
var moviePath = StatusModel.get('urlBase') + '/Content/zero.clipboard.swf';
var client = new ZeroClipboard(this, {
moviePath: moviePath
});
client.on('load', function(client) {
client.on('dataRequested', function (client) {
client.setText(input.val());
});
client.on('complete', function() {
Messenger.show({
message: 'Copied text to clipboard'
});
} );
} );
};
});