Fix youtube video mobile ed alcuni crash js
Signed-off-by: Riccardo Di Dato <r.didato@asdynamics.it>
This commit is contained in:
@@ -6,8 +6,6 @@ Creation Date: 13/gen/2016
|
||||
|
||||
GUIHandler::addStylesheet(GUIHandler::STYLESHEET_ADMIN, "normalize.css");
|
||||
|
||||
GUIHandlerMobile::addStylesheet(GUIHandlerMobile::STYLESHEET_USER, "normalize.css");
|
||||
|
||||
GUIHandler::addStylesheet(GUIHandler::STYLESHEET_ADMIN, "jquery-ui.css");
|
||||
|
||||
GUIHandler::addStylesheet(GUIHandler::STYLESHEET_ADMIN, "chosen.css");
|
||||
@@ -24,14 +22,20 @@ GUIHandler::addStylesheet(GUIHandler::STYLESHEET_USER, "photoswipe.css");
|
||||
|
||||
GUIHandler::addStylesheet(GUIHandler::STYLESHEET_USER, "default-skin.css");
|
||||
|
||||
GUIHandler::addJavascriptLib(GUIHandler::JAVASCRIPT_GENERAL, "jquery-1.12.0.min.js");
|
||||
|
||||
// MOBILE CSS
|
||||
|
||||
GUIHandlerMobile::addStylesheet(GUIHandlerMobile::STYLESHEET_USER, "normalize.css");
|
||||
|
||||
GUIHandlerMobile::addStylesheet(GUIHandlerMobile::STYLESHEET_USER, "photoswipe.css");
|
||||
|
||||
GUIHandlerMobile::addStylesheet(GUIHandlerMobile::STYLESHEET_USER, "default-skin.css");
|
||||
|
||||
GUIHandler::addJavascriptLib(GUIHandler::JAVASCRIPT_GENERAL, "jquery-1.12.0.min.js");
|
||||
|
||||
GUIHandlerMobile::addJavascriptLib(GUIHandlerMobile::JAVASCRIPT_GENERAL, "jquery-1.12.0.min.js");
|
||||
|
||||
// STD JS
|
||||
|
||||
GUIHandler::addJavascriptLib(GUIHandler::JAVASCRIPT_ADMIN, "jquery-ui.min.js");
|
||||
|
||||
// GUIHandler::addJavascriptLib(GUIHandler::JAVASCRIPT_ADMIN, "jquery.dataTables.min.js");
|
||||
@@ -50,19 +54,21 @@ GUIHandler::addJavascriptLib(GUIHandler::JAVASCRIPT_ADMIN,"datetimepicker-master
|
||||
|
||||
GUIHandler::addJavascriptLib(GUIHandler::JAVASCRIPT_GENERAL,"highcharts.js");
|
||||
|
||||
GUIHandler::addJavascriptLib(GUIHandler::JAVASCRIPT_GENERAL,"functions.js?rev=".time());
|
||||
|
||||
GUIHandlerMobile::addJavascriptLib(GUIHandlerMobile::JAVASCRIPT_GENERAL,"functions.js?rev=".time());
|
||||
|
||||
GUIHandler::addJavascriptLib(GUIHandler::JAVASCRIPT_USER,"photoswipe.min.js");
|
||||
|
||||
GUIHandler::addJavascriptLib(GUIHandler::JAVASCRIPT_USER,"photoswipe-ui-default.min.js");
|
||||
|
||||
GUIHandler::addJavascriptLib(GUIHandler::JAVASCRIPT_GENERAL,"functions.js?rev=".time());
|
||||
|
||||
GUIHandler::addJavascriptLib(GUIHandler::JAVASCRIPT_GENERAL,"calls.js");
|
||||
|
||||
// MOBILE JS
|
||||
|
||||
GUIHandlerMobile::addJavascriptLib(GUIHandlerMobile::JAVASCRIPT_USER,"photoswipe.min.js");
|
||||
|
||||
GUIHandlerMobile::addJavascriptLib(GUIHandlerMobile::JAVASCRIPT_USER,"photoswipe-ui-default.min.js");
|
||||
|
||||
GUIHandler::addJavascriptLib(GUIHandler::JAVASCRIPT_GENERAL,"calls.js");
|
||||
GUIHandlerMobile::addJavascriptLib(GUIHandlerMobile::JAVASCRIPT_GENERAL,"functions.js?rev=".time());
|
||||
|
||||
GUIHandlerMobile::addJavascriptLib(GUIHandlerMobile::JAVASCRIPT_USER,"calls.js");
|
||||
/*
|
||||
|
||||
@@ -391,29 +391,6 @@ GUIHandler::generateHtmlHeaders(array("additionalMetadata"=>$additionalHeaders,"
|
||||
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
<?php
|
||||
if(sizeof($medias)>0){
|
||||
?>
|
||||
function loadImage(pos){
|
||||
|
||||
var pswpElement = document.querySelectorAll('.pswp')[0];
|
||||
|
||||
//build items array
|
||||
pos = parseInt(pos);
|
||||
|
||||
//define options (if needed)
|
||||
var options = {
|
||||
index: pos // start at slide
|
||||
};
|
||||
|
||||
//Initializes and opens PhotoSwipe
|
||||
var gallery = new PhotoSwipe( pswpElement, PhotoSwipeUI_Default, items, options);
|
||||
gallery.init();
|
||||
}
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
$(document).ready(function(event){
|
||||
// $("video").on('loadstart',function (event){
|
||||
// var wid = $(this).innerWidth();
|
||||
|
||||
@@ -96,3 +96,20 @@ function printNews(newsId){
|
||||
// });
|
||||
openPagePost("printPage.php",[{name:'id',value:newsId}],true);
|
||||
}
|
||||
|
||||
function loadImage(pos){
|
||||
|
||||
var pswpElement = document.querySelectorAll('.pswp')[0];
|
||||
|
||||
//build items array
|
||||
pos = parseInt(pos);
|
||||
|
||||
//define options (if needed)
|
||||
var options = {
|
||||
index: pos // start at slide
|
||||
};
|
||||
|
||||
//Initializes and opens PhotoSwipe
|
||||
var gallery = new PhotoSwipe( pswpElement, PhotoSwipeUI_Default, items, options);
|
||||
gallery.init();
|
||||
}
|
||||
|
||||
+21
-28
@@ -145,11 +145,27 @@ GUIHandlerMobile::generateHtmlHeaders(array("additionalMetadata"=>$additionalHea
|
||||
if(sizeof($medias)>0){
|
||||
$pos = array_search($media, $medias);
|
||||
}
|
||||
?>
|
||||
<div onclick="javascript:loadImage('<?php echo $pos;?>')">
|
||||
<?php $media->renderMedia(array("size"=>MediaRenderer::SIZE_BIG,"clickable"=>true));?>
|
||||
</div>
|
||||
<?php
|
||||
if ($media->getType() == MediaModel::TYPE_YOUTUBE){
|
||||
?>
|
||||
<div class="youtubeContainer">
|
||||
<?php $media->renderMedia(array("size"=>MediaRenderer::SIZE_BIG,"clickable"=>true));?>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
else if ($media->getType() == MediaModel::TYPE_IMAGE){
|
||||
?>
|
||||
<div onclick="javascript:loadImage('<?php echo $pos;?>')">
|
||||
<?php $media->renderMedia(array("size"=>MediaRenderer::SIZE_BIG,"clickable"=>true));?>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
else {
|
||||
?>
|
||||
<div >
|
||||
<?php $media->renderMedia(array("size"=>MediaRenderer::SIZE_BIG,"clickable"=>true));?>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
@@ -312,29 +328,6 @@ GUIHandlerMobile::generateHtmlHeaders(array("additionalMetadata"=>$additionalHea
|
||||
|
||||
<!-- </div> -->
|
||||
<script type="text/javascript">
|
||||
<?php
|
||||
// if(sizeof($medias)>0){
|
||||
?>
|
||||
// function loadImage(pos){
|
||||
|
||||
// var pswpElement = document.querySelectorAll('.pswp')[0];
|
||||
|
||||
// //build items array
|
||||
// pos = parseInt(pos);
|
||||
|
||||
// //define options (if needed)
|
||||
// var options = {
|
||||
// index: pos // start at slide
|
||||
// };
|
||||
|
||||
// //Initializes and opens PhotoSwipe
|
||||
// var gallery = new PhotoSwipe( pswpElement, PhotoSwipeUI_Default, items, options);
|
||||
// gallery.init();
|
||||
// }
|
||||
<?php
|
||||
// }
|
||||
?>
|
||||
|
||||
$(document).ready(function(event){
|
||||
|
||||
$("#submit").click(function (){
|
||||
|
||||
@@ -88,11 +88,28 @@ function printNews(newsId){
|
||||
openPagePost("printPage.php",[{name:'id',value:newsId}],true);
|
||||
}
|
||||
|
||||
function openMenuWithLoginPage(){
|
||||
$("#loginMobile").trigger("click");
|
||||
}
|
||||
function openMenuWithLoginPage(){
|
||||
$("#loginMobile").trigger("click");
|
||||
}
|
||||
|
||||
function openMenuWithRegistrationPage(){
|
||||
openRegistration();
|
||||
$(".loginContainer").trigger("open");
|
||||
}
|
||||
function openMenuWithRegistrationPage(){
|
||||
openRegistration();
|
||||
$(".loginContainer").trigger("open");
|
||||
}
|
||||
|
||||
function loadImage(pos){
|
||||
|
||||
var pswpElement = document.querySelectorAll('.pswp')[0];
|
||||
|
||||
//build items array
|
||||
pos = parseInt(pos);
|
||||
|
||||
//define options (if needed)
|
||||
var options = {
|
||||
index: pos // start at slide
|
||||
};
|
||||
|
||||
//Initializes and opens PhotoSwipe
|
||||
var gallery = new PhotoSwipe( pswpElement, PhotoSwipeUI_Default, items, options);
|
||||
gallery.init();
|
||||
}
|
||||
@@ -299,4 +299,13 @@ video::-webkit-media-controls-enclosure {
|
||||
overflow:hidden;
|
||||
}
|
||||
|
||||
video.loading{background:black url(../images/loading.gif) center center no-repeat;}
|
||||
video.loading{background:black url(../images/loading.gif) center center no-repeat;}
|
||||
|
||||
|
||||
/*
|
||||
Fix sizing video youtube
|
||||
*/
|
||||
.headArticolo .youtubeContainer{width:100%; height:0; padding-bottom:55%; position:relative; overflow:visible;}
|
||||
.headArticolo .youtubeContainer iframe{position:absolute; width:100%; height:100%; left:0; top:0;}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user