Added change size poster viewed movies
This commit is contained in:
parent
c9a358cd08
commit
25bf40efef
4 changed files with 33 additions and 5 deletions
|
@ -137,7 +137,9 @@ module.exports = {
|
||||||
"viewed": {
|
"viewed": {
|
||||||
"status": true,
|
"status": true,
|
||||||
"data": {
|
"data": {
|
||||||
"count": 20
|
"count": 20,
|
||||||
|
"width": "50px",
|
||||||
|
"height": "70px"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"player": {
|
"player": {
|
||||||
|
|
|
@ -137,7 +137,9 @@ module.exports = {
|
||||||
"viewed": {
|
"viewed": {
|
||||||
"status": true,
|
"status": true,
|
||||||
"data": {
|
"data": {
|
||||||
"count": 20
|
"count": 20,
|
||||||
|
"width": "50px",
|
||||||
|
"height": "70px"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"player": {
|
"player": {
|
||||||
|
|
|
@ -21,11 +21,26 @@ function codeViewed() {
|
||||||
modules.viewed.data && modules.viewed.data.count
|
modules.viewed.data && modules.viewed.data.count
|
||||||
? modules.viewed.data.count
|
? modules.viewed.data.count
|
||||||
: 20;
|
: 20;
|
||||||
|
var width =
|
||||||
|
modules.viewed.data && modules.viewed.data.width
|
||||||
|
? modules.viewed.data.width
|
||||||
|
: '50px';
|
||||||
|
var height =
|
||||||
|
modules.viewed.data && modules.viewed.data.height
|
||||||
|
? modules.viewed.data.height
|
||||||
|
: '70px';
|
||||||
|
|
||||||
code =
|
code =
|
||||||
'function getCookie(e){var t=document.cookie.match(new RegExp("(?:^|; )"+e.replace(/([.$?*|{}()\\[\\]\\\\\\/+^])/g,"\\\\$1")+"=([^;]*)"));return t?decodeURIComponent(t[1]):""}function setCookie(e,t,n){var i=(n=n||{}).expires;if("number"===typeof i&&i){var r=new Date;r.setTime(r.getTime()+1e3*i),i=n.expires=r}i&&i.toUTCString&&(n.expires=i.toUTCString());var o=e+"="+(t=encodeURIComponent(t));for(var c in n)if(n.hasOwnProperty(c)){o+="; "+c;var a=n[c];!0!==a&&(o+="="+a)}document.cookie=o}window.addEventListener("load",function(){function e(){var e=new RegExp("([htps:]{5,6}//[^/]*/[^/]*/[^/]*)","ig").exec(window.location.href);return e&&e[1]?e[1]:""}var t,n,i,r=(n=e(),i=(t=document.querySelector("[data-cinemapress-poster]"))&&t.dataset.cinemapressPoster?t.dataset.cinemapressPoster:"",n&&i?n+"|"+i:""),o=e();c=getCookie("CP_viewed"),a=document.getElementById("recentlyViewed"),d=c?c.split("~"):[];var p=(o)?d.filter(function(e){return-1===e.indexOf(""+o)}):d;if(r&&((p.length>=parseInt(' +
|
'var viewed_count="' +
|
||||||
count +
|
count +
|
||||||
')||3200<p.join("~").length)&&p.pop(),p.unshift(r)),a){var l=document.querySelectorAll(".recentlyViewedBlock");if(l&&l.length)for(var s=0;s<l.length;s++)l[s].style.display="block";for(var u=0;u<p.length;u++)if(p[u]){var f=p[u].split("|"),m=document.createElement("a");if(!f[0]||!f[1]){p.splice(u,1),u--;continue}m.setAttribute("href",f[0]);var g=document.createElement("img");g.setAttribute("src",f[1]),g.setAttribute("style","width: 52px; height: 72px; margin: 3px; border-radius:3px;"),m.appendChild(g),a.appendChild(m)}}r&&setCookie("CP_viewed",p.join("~"),{expires:864e3,path:"/"})});';
|
'";' +
|
||||||
|
'var viewed_width="' +
|
||||||
|
width +
|
||||||
|
'";' +
|
||||||
|
'var viewed_height="' +
|
||||||
|
height +
|
||||||
|
'";' +
|
||||||
|
'function getCookie(e){var t=document.cookie.match(new RegExp("(?:^|; )"+e.replace(/([.$?*|{}()\\[\\]\\\\\\/+^])/g,"\\\\$1")+"=([^;]*)"));return t?decodeURIComponent(t[1]):""}function setCookie(e,t,n){var i=(n=n||{}).expires;if("number"===typeof i&&i){var r=new Date;r.setTime(r.getTime()+1e3*i),i=n.expires=r}i&&i.toUTCString&&(n.expires=i.toUTCString());var o=e+"="+(t=encodeURIComponent(t));for(var c in n)if(n.hasOwnProperty(c)){o+="; "+c;var a=n[c];!0!==a&&(o+="="+a)}document.cookie=o}window.addEventListener("load",function(){function e(){var e=new RegExp("([htps:]{5,6}//[^/]*/[^/]*/[^/]*)","ig").exec(window.location.href);return e&&e[1]?e[1]:""}var t,n,i,r=(n=e(),i=(t=document.querySelector("[data-cinemapress-poster]"))&&t.dataset.cinemapressPoster?t.dataset.cinemapressPoster:"",n&&i?n+"|"+i:""),o=e();c=getCookie("CP_viewed"),a=document.getElementById("recentlyViewed"),d=c?c.split("~"):[];var p=(o)?d.filter(function(e){return-1===e.indexOf(""+o)}):d;if(r&&((p.length>=parseInt(viewed_count)||3200<p.join("~").length)&&p.pop(),p.unshift(r)),a){var l=document.querySelectorAll(".recentlyViewedBlock");if(l&&l.length)for(var s=0;s<l.length;s++)l[s].style.display="block";for(var u=0;u<p.length;u++)if(p[u]){var f=p[u].split("|"),m=document.createElement("a");if(!f[0]||!f[1]){p.splice(u,1),u--;continue}m.setAttribute("href",f[0]);var g=document.createElement("img");g.setAttribute("src",f[1]),g.setAttribute("style","width:" + viewed_width + ";height:" + viewed_height + ";margin:3px;border-radius:3px;"),m.appendChild(g),a.appendChild(m)}}r&&setCookie("CP_viewed",p.join("~"),{expires:864e3,path:"/"})});';
|
||||||
|
|
||||||
code = '<script>' + code + '</script>';
|
code = '<script>' + code + '</script>';
|
||||||
}
|
}
|
||||||
|
|
|
@ -73,7 +73,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="inner-padding">
|
<div class="inner-padding">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-lg-12 col-xs-12 text-center">
|
<div class="col-lg-5 col-xs-5 text-center">
|
||||||
<select name="modules.viewed.data.count" class="form-control">
|
<select name="modules.viewed.data.count" class="form-control">
|
||||||
<% for (var i = 1; i <= 20; i++) { %>
|
<% for (var i = 1; i <= 20; i++) { %>
|
||||||
<% if (modules.viewed.data.count === i) { %>
|
<% if (modules.viewed.data.count === i) { %>
|
||||||
|
@ -88,6 +88,15 @@
|
||||||
<% } %>
|
<% } %>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="col-lg-3 col-xs-3">
|
||||||
|
<input name="modules.viewed.data.width" value="<%= modules.viewed.data.width %>" class="form-control text-right" type="text" placeholder="width">
|
||||||
|
</div>
|
||||||
|
<div class="col-lg-1 col-xs-1 text-center" style="padding: 5px;">
|
||||||
|
×
|
||||||
|
</div>
|
||||||
|
<div class="col-lg-3 col-xs-3">
|
||||||
|
<input name="modules.viewed.data.height" value="<%= modules.viewed.data.height %>" class="form-control" type="text" placeholder="height">
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in a new issue