mirror of
https://github.com/Radarr/Radarr
synced 2025-02-28 00:45:50 +00:00
Updated zero.clipboard to fix copy to clipboard function for requirejs.
Removed wrapper function.
This commit is contained in:
parent
58f0e713fa
commit
00dddfeaf3
4 changed files with 2533 additions and 961 deletions
Binary file not shown.
File diff suppressed because it is too large
Load diff
|
@ -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());
|
|
||||||
});
|
});
|
||||||
client.on('complete', function(){
|
|
||||||
|
var client = new ZeroClipboard(this);
|
||||||
|
|
||||||
|
client.on('ready', function(e) {
|
||||||
|
client.on('copy', function(e) {
|
||||||
|
e.clipboardData.setData("text/plain", input.val());
|
||||||
|
});
|
||||||
|
client.on('aftercopy', function() {
|
||||||
Messenger.show({message : 'Copied text to clipboard'});
|
Messenger.show({message : 'Copied text to clipboard'});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
}).call(this);
|
|
|
@ -1,13 +1,12 @@
|
||||||
'use strict';
|
|
||||||
define(
|
var vent = require('../../vent');
|
||||||
[
|
var Marionette = require('marionette');
|
||||||
'vent',
|
var CommandController = require('../../Commands/CommandController');
|
||||||
'marionette',
|
var AsModelBoundView = require('../../Mixins/AsModelBoundView');
|
||||||
'Commands/CommandController',
|
var AsValidatedView = require('../../Mixins/AsValidatedView');
|
||||||
'Mixins/AsModelBoundView',
|
|
||||||
'Mixins/AsValidatedView',
|
require('../../Mixins/CopyToClipboard');
|
||||||
'Mixins/CopyToClipboard'
|
|
||||||
], function (vent, Marionette, CommandController, AsModelBoundView, AsValidatedView) {
|
|
||||||
var view = Marionette.ItemView.extend({
|
var view = Marionette.ItemView.extend({
|
||||||
template: 'Settings/General/GeneralViewTemplate',
|
template: 'Settings/General/GeneralViewTemplate',
|
||||||
|
|
||||||
|
@ -118,6 +117,5 @@ define(
|
||||||
AsModelBoundView.call(view);
|
AsModelBoundView.call(view);
|
||||||
AsValidatedView.call(view);
|
AsValidatedView.call(view);
|
||||||
|
|
||||||
return view;
|
module.exports = view;
|
||||||
});
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue