ninegate
Some checks failed
Cadoles/nineskeletor/pipeline/head There was a failure building this commit

This commit is contained in:
2023-02-01 09:03:27 +01:00
parent fb33724d9b
commit 9554b9cdd3
235 changed files with 2964 additions and 1573 deletions

View File

@ -99,7 +99,7 @@
{% endblock %}
{% block menuuser %}
{% if canadd %}
{% if canadd and app.user %}
<a id="menusubmit" style="cursor:pointer" onclick="submitPage()" title='Ajouter une page'><i class='fa fa-plus fa-fw'></i></a>
{% endif %}
<a id="menuupdate" style="cursor:pointer;display:none" onclick="updatePage()" title='Modifier une page'><i class='fa fa-file fa-fw'></i></a>

View File

@ -68,7 +68,12 @@
{% block localscript %}
<script>
var optiongrid={columnWidth: '.grid-sizer',itemSelector: '.grid-item', gutter: '.grid-gutter-sizer'};
// Ajustement des frames
$(window).resize(function() {
AjustFrame();
Masonry();
});
$('document').ready(function(){
@ -81,10 +86,6 @@
scrollX: false,
});
// Ajustement des frames
$(window).resize(function() {
AjustFrame();
});
// Création de la grille des widgets
@ -162,14 +163,11 @@
// Mettre une taille mini de colonne sinon on ne pourra pas déplacer le widget dans la colonne
$(".colcontainer .col").css("min-height","80px");
// Cursor move sur les widgets header
//$(".widgetheader").css("cursor","move");
// Rendre les widgets déplacable
$("#widget-container .mycol").sortable({
connectWith: "#widget-container .mycol",
handle: '.widget-sortable',
placeholder: "widget widgetplacehorder",
placeholder: "widgetplaceholder",
tolerance: "pointer",
cursor: "move",
opacity: 0.6,
@ -177,21 +175,23 @@
ui.placeholder.css("height",ui.item.height());
$(".widgetbody").hide();
$(".colcontainer .mycol").css("border","1px solid #cdcdcd");
$(".colcontainer .mycol").css("padding-bottom","15px");
//$(".colcontainer .mycol").css("padding","15px");
$(".colcontainer .mycol").css("min-height","200px");
ui.placeholder.css("margin-right","-15px");
ui.placeholder.css("margin-left","-15px");
ui.placeholder.css("margin-bottom","30px");
},
stop: function( event, ui ) {
$(".widgetbody").show();
$(".colcontainer .mycol").css("border","none");
$(".colcontainer .mycol").css("padding-bottom","");
$(".colcontainer .mycol").css("padding-bottom","");
$(".colcontainer .mycol").css("min-height","");
},
update: updateLocalisation
});
{% endif %}
// Création des slick
//slick();
// Sur le click des titres de widgets ouvrir / fermer le widget
$( ".widget-header .widget-title" ).click(function() {
showhideWidget(this);
@ -202,25 +202,70 @@
// balise h des widget editor
$(".widget-editor .widgetbody :header").css("color",$(".widgetbody").css("color"));
// Création des slick
Slick();
// Masonry
Masonry();
});
// function slick
function slick() {
$('.slick').slick({
slidesToShow: 1,
slidesToScroll: 1,
autoplay: true,
//autoplaySpeed: ($(this).data("interval")*1000),
dots: false,
touchMove: false,
pauseOnHover: false,
fade: true,
cssEase: 'linear',
prevArrow: '<button type="button" class="slick-prev"></button>',
nextArrow: '<button type="button" class="slick-next"></button>',
function Slick() {
$('.widget-body .slick').each(function() {
if(!$(this).parent().hasClass("widget-adjust"))
$(this).height($(this).parent().height());
height=$(this).height();
$(this).slick({
dots: true,
infinite: true,
fade: true,
cssEase: 'linear',
autoplay: true,
autoplaySpeed: $(this).data("slicktime"),
});
});
$('.widget-body .slick-slide ').each(function() {
if(!$(this).parent().parent().parent().hasClass("widget-adjust"))
$(this).height($(this).parent().parent().parent().height());
});
}
function Masonry() {
$('.masonry').imagesLoaded(function() {
$('.widget-body .masonry').each(function() {
$(this).show();
var perc;
if($(this).width() >= 1500) perc="14,285714286%";
else if($(this).width() >= 1200) perc="16,666666667%";
else if($(this).width() >= 1000) perc="20%";
else if($(this).width() >= 800) perc="25%";
else if($(this).width() >= 500) perc="33.333333333%";
else if($(this).width() >= 350) perc="50%";
else perc="100%";
$(".masonry-item",$(this)).each(function() {
$(this).css("width",perc.toString().replace(",","."));
});
$(".masonry-sizer",$(this)).each(function() {
$(this).css("width",perc.toString().replace(",","."));
});
$(this).masonry({
itemSelector: '.masonry-item',
columnWidth: '.masonry-sizer',
percentPosition: true,
});
});
});
}
// Cacher afficher le menu des widgets
$(".widget").hover(function() {
@ -264,10 +309,8 @@
function updateLocalisation() {
$('.colcontainer .mycol').each(function(index) {
var idloc=$(this).attr('id');
console.log(idloc);
$(this).children(".widget").each(function(order){
var idwidget=$(this).data('id');
console.log(idwidget);
$.ajax({
method: "POST",
url: "{{ path('app_'~access~'_pagewidget_order') }}",
@ -279,6 +322,9 @@
});
});
});
// On remasone
Masonry();
}
// Création d'un widget selectionné
@ -396,13 +442,29 @@
}
}
// Ajouter image
function addImage(idwidget) {
var url="{{ path('app_'~access~'_file_upload',{category:'pagewidget', id:'yy', type:'image', usage:usage})}}";
url=url.replace('yy',idwidget);
url=url.replace(/&amp;/g,"&");
$("#mymodallarge .modal-title").text("Téléchargement");
$("#mymodallarge iframe").attr("src",url);
$("#mymodallarge").modal("show");
}
// Supprimer un fichier
function delFile(directory,filename) {
function delFile(idwidget,file,navigation=false) {
var url="{{ path('app_'~access~'_file_delete',{category:'pagewidget', id:'yy', file:'zz', navigation: 'xx', usage:usage})}}";
url=url.replace('yy',idwidget);
url=url.replace('zz',file);
url=url.replace('xx',navigation);
var r = confirm("Confirmez-vous la suppression de ce fichier ?");
if (r == true) {
$.ajax({
method: "POST",
url: "{{ path('app_'~access~'_file_delete') }}",
url:url,
data: {
directory:directory,
filename:filename
@ -414,9 +476,21 @@
}
}
function viewFile(idwidget,file,navigation=false) {
file=file.replace(".thumb/","");
var url="{{ path('app_'~access~'_file_view',{category:'pagewidget', id:'yy', file:'zz', navigation: 'xx', usage:usage})}}";
url=url.replace('yy',idwidget);
url=url.replace('zz',file);
url=url.replace('xx',navigation);
url=url.replace(/&amp;/g,"&");
$(location).attr('href', url);
}
// Liste des slides
function listSlide(idwidget) {
var url="{{ path('app_'~access~'_slide_list',{idpage:page.id,idwidget:'xx',usage:usage})}}";
var url="{{ path('app_'~access~'_pagewidgetslide_list',{idwidget:'xx',usage:usage})}}";
url=url.replace('xx',idwidget);
url=url.replace(/&amp;/g,"&");
@ -424,6 +498,16 @@
$(location).attr('href', url);
}
// Forum ckeditor
function ckeditor(idwidget) {
var url="{{ path('app_'~access~'_pagewidget_ckeditor',{idwidget:'xx',usage:usage})}}";
url=url.replace('xx',idwidget);
url=url.replace(/&amp;/g,"&");
$(location).attr('href', url);
}
// Ajustement des frames
function AjustFrame() {
if($(".itemframe").length>0) {
@ -497,25 +581,6 @@
}
}
// Place un message en lu
function hideMessage(id) {
$.ajax({
method: "POST",
url: "{{ path('app_all_message_see') }}",
data: {
id:id
},
success: function() {
$(".msg-"+id).remove();
var ele = $(".msg-hidden").first();
ele.show();
ele.removeClass("msg-hidden");
var grid = $('.grid').masonry(optiongrid);
}
});
}
// Place un message en lu
function hideAlert(id) {
$.ajax({