summaryrefslogtreecommitdiff
path: root/addons/website_slides/static/src/js
diff options
context:
space:
mode:
authorPatrick Hoste <pko@odoo.com>2019-06-17 09:41:58 +0000
committerThibault Delavallée <tde@odoo.com>2019-06-18 11:25:03 +0000
commitf0ec2a8fc8b43c7b06d17ea67dd258459cdf3ac2 (patch)
tree1778c8119d4ab90141d09abb1261c5ec8ad59d09 /addons/website_slides/static/src/js
parent800a55c06f70d36673defa808b2a943130e69c8f (diff)
[FIX] website_slides: fix various issues to eLearning platform
Including * change h4 to h1 on the slide page; * add the rel='canonical' link header on the fullscreen view in order to improve SEO and links; * add space between quiz questions; * remove social share statistics as they are broken and not really useful; * moved tabs before the Quiz on the slide page; * allow to modify slide in backend by removing some readonly attributes; Linked to task ID 2010024 Related to PR #34176 Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Diffstat (limited to 'addons/website_slides/static/src/js')
-rw-r--r--addons/website_slides/static/src/js/slides_share.js39
1 files changed, 0 insertions, 39 deletions
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,49 +50,13 @@ 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');
}
});