diff --git a/addons/website_slides/models/slide_slide.py b/addons/website_slides/models/slide_slide.py
index 7b05ed91584..f3fc22784f5 100644
--- a/addons/website_slides/models/slide_slide.py
+++ b/addons/website_slides/models/slide_slide.py
@@ -135,7 +135,7 @@ class Slide(models.Model):
('video', 'Video'),
('quiz', "Quiz")],
string='Type', required=True,
- default='document', readonly=True,
+ default='document',
help="The document type will be set automatically based on the document URL and properties (e.g. height and width for presentation and document).")
index_content = fields.Text('Transcript')
datas = fields.Binary('Content', attachment=True)
diff --git a/addons/website_slides/static/src/js/slides_share.js b/addons/website_slides/static/src/js/slides_share.js
index 423b84bda1b..3157604e34e 100644
--- a/addons/website_slides/static/src/js/slides_share.js
+++ b/addons/website_slides/static/src/js/slides_share.js
@@ -50,48 +50,12 @@ sAnimations.registry.websiteSlidesShare = sAnimations.Class.extend({
* @param {Object} parent
*/
start: function (parent) {
- var self = this;
var defs = [this._super.apply(this, arguments)];
defs.push(new ShareMail(this).attachTo($('.oe_slide_js_share_email')));
- if ($('div#statistic').length) {
- this.slideURL = $('div#statistic').attr('slide-url');
- this.socialURLs = {
- linkedin: 'https://www.linkedin.com/countserv/count/share?url=',
- twitter: 'https://cdn.api.twitter.com/1/urls/count.json?url=',
- facebook: 'https://graph.facebook.com/?id=',
- };
- }
-
- _.each(this.socialURLs, function (value, key) {
- self._updateStatistics(key, self.slideURL);
- });
-
return $.when.apply($, defs);
},
- //--------------------------------------------------------------------------
- // Private
- //--------------------------------------------------------------------------
-
- /**
- * @private
- * @param {string} socialSite
- * @param {string} slide_url
- */
- _updateStatistics: function (socialSite, slideURL) {
- var self = this;
- $.ajax({
- url: self.socialURLs[socialSite] + slideURL,
- dataType: 'jsonp',
- success: function (data) {
- var shareCount = (socialSite === 'facebook' ? data.shares : data.count) || 0;
- $('#' + socialSite + '-badge').text(shareCount);
- $('#total-share').text(parseInt($('#total-share').text()) + parseInt($('#' + socialSite + '-badge').text()));
- },
- });
- },
-
//--------------------------------------------------------------------------
// Handlers
//--------------------------------------------------------------------------
@@ -101,14 +65,11 @@ sAnimations.registry.websiteSlidesShare = sAnimations.Class.extend({
* @param {Object} ev
*/
_onSlidesSocialShare: function (ev) {
- var self = this;
ev.preventDefault();
- var key = $(ev.currentTarget).attr('social-key');
var popUpURL = $(ev.currentTarget).attr('href');
var popUp = window.open(popUpURL, 'Share Dialog', 'width=626,height=436');
$(window).on('focus', function () {
if (popUp.closed) {
- self._updateStatistics(key, self.slide_url);
$(window).off('focus');
}
});
diff --git a/addons/website_slides/views/slide_slide_views.xml b/addons/website_slides/views/slide_slide_views.xml
index b2dd1585ff0..1bb07a32a6d 100644
--- a/addons/website_slides/views/slide_slide_views.xml
+++ b/addons/website_slides/views/slide_slide_views.xml
@@ -71,13 +71,13 @@
| Share count | -|
|---|---|
| 0 | -|
| 0 | -|
| - | |