diff --git a/snippet_video_bg/__manifest__.py b/snippet_video_bg/__manifest__.py index 31f126620..247e2ebee 100644 --- a/snippet_video_bg/__manifest__.py +++ b/snippet_video_bg/__manifest__.py @@ -23,7 +23,7 @@ { 'name': "Website Video Background", - 'version': '10.0.1.0.1', + 'version': '10.0.1.0.2', 'summary': """Make Website Background as Video""", 'description': """ Website page background as youtube video. diff --git a/snippet_video_bg/__manifest__.py~ b/snippet_video_bg/__manifest__.py~ new file mode 100644 index 000000000..31f126620 --- /dev/null +++ b/snippet_video_bg/__manifest__.py~ @@ -0,0 +1,47 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# Author: Hilar AK() +# you can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# It is forbidden to publish, distribute, sublicense, or sell copies +# of the Software or modified copies of the Software. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# GENERAL PUBLIC LICENSE (LGPL v3) along with this program. +# If not, see . +# +############################################################################## + +{ + 'name': "Website Video Background", + 'version': '10.0.1.0.1', + 'summary': """Make Website Background as Video""", + 'description': """ + Website page background as youtube video. + """, + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'website': "https://cybrosys.com/", + 'category': 'Website', + 'depends': ['base', 'website'], + 'data': [ + 'views/views.xml', + 'views/conf_view.xml', + 'views/templates.xml', + ], + 'demo': [ + ], + 'images': ['static/description/banner.jpg'], + 'license': 'LGPL-3', + 'installable': True, + 'application': False +} diff --git a/snippet_video_bg/static/src/js/bg_video.js b/snippet_video_bg/static/src/js/bg_video.js index 01f950589..c85dc6518 100644 --- a/snippet_video_bg/static/src/js/bg_video.js +++ b/snippet_video_bg/static/src/js/bg_video.js @@ -8,6 +8,7 @@ odoo.define('snippet_video_bg.wrapwrap_bg_video', function (require) { // var session = require('web.session'); var base = require('web_editor.base'); var contentMenu = require('website.contentMenu'); + var website = require('website.website'); var qweb = core.qweb; var _t = core._t; @@ -56,4 +57,4 @@ odoo.define('snippet_video_bg.wrapwrap_bg_video_load', function (require) { }); -}); \ No newline at end of file +}); diff --git a/snippet_video_bg/static/src/js/bg_video.js~ b/snippet_video_bg/static/src/js/bg_video.js~ new file mode 100644 index 000000000..01f950589 --- /dev/null +++ b/snippet_video_bg/static/src/js/bg_video.js~ @@ -0,0 +1,59 @@ +odoo.define('snippet_video_bg.wrapwrap_bg_video', function (require) { + 'use strict'; + + var ajax = require('web.ajax'); + var Dialog = require("web.Dialog"); + var core = require('web.core'); + var Widget = require('web.Widget'); +// var session = require('web.session'); + var base = require('web_editor.base'); + var contentMenu = require('website.contentMenu'); + + var qweb = core.qweb; + var _t = core._t; + base.url_translations = '/website/translations'; + + contentMenu.TopBar.include({ + new_bg_video_id: function() { + website.prompt({ + id: "bg_video_id", + window_title: _t("Add a YouTube Video Id here"), + input: "Video ID", + }).then(function (id) { + website.form('/set_video_id', 'POST', { + id: id + }); + }); + }, + }); +}); + +odoo.define('snippet_video_bg.wrapwrap_bg_video_load', function (require) { + 'use strict'; + var ajax = require('web.ajax'); + var Dialog = require("web.Dialog"); + var core = require('web.core'); + var Widget = require('web.Widget'); + var session = require('web.session'); + var base = require('web_editor.base'); + var Model = require('web.Model'); + + var qweb = core.qweb; + var _t = core._t; + base.url_translations = '/website/translations'; + + $('document').ready(function() { + + session.rpc("/get_video_id", {}) + .done(function(res) { + var options = { + videoId: res.video_id || false, + start: 0, + mute: true, + }; + $('#wrapwrap').tubular(options); + }); + + }); + +}); \ No newline at end of file