[REF] website_links: remove ZeroClipboard lib

... and use Clipboard instead, which is already in web (put in the
assets_common).

Task #33274
This commit is contained in:
Akash Bhavsar
2018-01-16 10:19:39 +01:00
committed by Aaron Bohy
parent 04cd3771c4
commit 762eb49e09
6 changed files with 4 additions and 2326 deletions
File diff suppressed because it is too large Load Diff
@@ -10,7 +10,6 @@ var base = require('web_editor.base');
var qweb = core.qweb;
var _t = core._t;
var ZeroClipboard = window.ZeroClipboard;
var exports = {};
@@ -108,7 +107,8 @@ if (!$('.o_website_links_create_tracked_url').length) {
this.animating_copy = false;
},
start: function () {
new ZeroClipboard(this.$('.btn_shorten_url_clipboard'));
new Clipboard(this.$('.btn_shorten_url_clipboard').get(0));
return this._super.apply(this, arguments);
},
toggle_copy_button: function () {
var self = this;
@@ -258,8 +258,6 @@ if (!$('.o_website_links_create_tracked_url').length) {
base.ready().done(function () {
ZeroClipboard.config({swfPath: window.location.origin + "/website_links/static/lib/zeroclipboard/ZeroClipboard.swf" });
// UTMS selects widgets
var campaign_select = new SelectBox('utm.campaign');
campaign_select.start($("#campaign-select"), _t('e.g. Promotion of June, Winter Newsletter, ..'));
@@ -291,7 +289,7 @@ if (!$('.o_website_links_create_tracked_url').length) {
});
// Clipboard Library
new ZeroClipboard($("#btn_shorten_url"));
new Clipboard($("#btn_shorten_url").get(0));
$("#generated_tracked_link a").click(function () {
$("#generated_tracked_link a").text("Copied").removeClass("btn-primary").addClass("btn-success");
@@ -233,8 +233,7 @@ if (!$('.o_website_links_chart').length) {
});
// Copy to clipboard link
ZeroClipboard.config({swfPath: window.location.origin + "/website_links/static/lib/zeroclipboard/ZeroClipboard.swf" });
new ZeroClipboard($('.copy-to-clipboard'));
new Clipboard($('.copy-to-clipboard')[0]);
var animating_copy = false;
@@ -3,7 +3,6 @@
<template id="assets_website_links" inherit_id="website.assets_frontend">
<xpath expr="." position="inside">
<script type="text/javascript" src="/website_links/static/lib/zeroclipboard/ZeroClipboard.js"/>
<script type="text/javascript" src="/website_links/static/src/js/website_links.js"/>
<script type="text/javascript" src="/website_links/static/src/js/website_links_code_editor.js"/>
<script type="text/javascript" src="/website_links/static/src/js/website_links_charts.js"/>
-4
View File
@@ -148,10 +148,6 @@ Files: addons/website/static/lib/jQuery.transfo.js
Copyright: Copyright (c) 2014 Christophe Matthieu
Licence: MIT
Files: addons/website_links/static/lib/zeroclipboard/*
Copyright: Copyright (c) 2014 Jon Rohan, James M. Greene
License: MIT
Files: addons/web_editor/static/lib/vkbeautify/vkbeautify.0.99.00.beta.js
Copyright: Copyright (c) 2012 Vadim Kiryukhin
License: MIT and GPL-2+