Video autoplay with cookie
This commit is contained in:
parent
bed539c0cf
commit
e173d7ced7
@ -22,11 +22,17 @@ class Public::CustomersAuthsController < ApplicationController
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if cookies[:video_read] == "true"
|
||||||
|
|
||||||
|
@video_must_read = false
|
||||||
|
else
|
||||||
|
cookies.permanent[:video_read] = "true"
|
||||||
|
@video_must_read = true
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def create
|
def create
|
||||||
|
@video_must_read = false
|
||||||
@biglogo = true
|
@biglogo = true
|
||||||
@customer = Customer.new()
|
@customer = Customer.new()
|
||||||
if cookies[:mlm_token] and @parent = Customer.find_parrain(cookies[:mlm_token])
|
if cookies[:mlm_token] and @parent = Customer.find_parrain(cookies[:mlm_token])
|
||||||
|
@ -57,10 +57,36 @@
|
|||||||
|
|
||||||
|
|
||||||
#flashs= bootstrap_flash
|
#flashs= bootstrap_flash
|
||||||
|
|
||||||
|
-if @video_must_read
|
||||||
|
:javascript
|
||||||
|
$(document).ready(function() {
|
||||||
|
$.magnificPopup.open({
|
||||||
|
items: {
|
||||||
|
src: 'http://www.youtube.com/watch?v=0uf7X-fcu1o'
|
||||||
|
},
|
||||||
|
type:'iframe',
|
||||||
|
iframe: {
|
||||||
|
markup: '<div class="mfp-iframe-scaler">'+'<div class="mfp-close"></div>'+'<iframe class="mfp-iframe" frameborder="0" allowfullscreen></iframe>'+'</div>',
|
||||||
|
patterns: {
|
||||||
|
youtube: {
|
||||||
|
index: 'youtube.com/',
|
||||||
|
id: 'v=',
|
||||||
|
src: '//www.youtube.com/embed/%id%?autoplay=1'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
srcAction: 'iframe_src',
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
:javascript
|
:javascript
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
|
|
||||||
$('#negos-video').magnificPopup({
|
$('.negos-video').magnificPopup({
|
||||||
items: {
|
items: {
|
||||||
src: 'http://www.youtube.com/watch?v=0uf7X-fcu1o'
|
src: 'http://www.youtube.com/watch?v=0uf7X-fcu1o'
|
||||||
},
|
},
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
|
|
||||||
-if current_customer
|
-if current_customer
|
||||||
%ul
|
%ul
|
||||||
-if current_customer.account_validated?
|
|
||||||
%li=link_to ic(:"youtube-play")+" Négos, comment ça marche ?","", :class => "btn", id:"negos-video"
|
%li=link_to ic(:"youtube-play")+" Négos, comment ça marche ?","", :class => "btn negos-video"
|
||||||
-if current_customer.account_validated?
|
-if current_customer.account_validated?
|
||||||
%li=link_to ic(:star)+" Besoins", public_needs_path, :class => "btn"
|
%li=link_to ic(:star)+" Besoins", public_needs_path, :class => "btn"
|
||||||
- unread_message = ContactMessage.where(contact_id: current_customer.id, read_by_customer: false).count
|
- unread_message = ContactMessage.where(contact_id: current_customer.id, read_by_customer: false).count
|
||||||
@ -15,5 +15,6 @@
|
|||||||
|
|
||||||
-else
|
-else
|
||||||
%ul
|
%ul
|
||||||
|
%li=link_to ic(:"youtube-play")+" Négos, comment ça marche ?","", :class => "btn negos-video"
|
||||||
%li=link_to "S'inscrire", new_public_customer_path(:p => params[:p]), :class => "btn"
|
%li=link_to "S'inscrire", new_public_customer_path(:p => params[:p]), :class => "btn"
|
||||||
%li=link_to "Se connecter", new_public_customers_auth_path(:p => params[:p]), :class => "btn"
|
%li=link_to "Se connecter", new_public_customers_auth_path(:p => params[:p]), :class => "btn"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user