first commit
This commit is contained in:
397
assets/javascript/backend/annonce.js
Normal file
397
assets/javascript/backend/annonce.js
Normal file
@@ -0,0 +1,397 @@
|
||||
import "jquery-ui";
|
||||
import 'datatables.net-bs5';
|
||||
|
||||
import 'cropperjs/dist/cropper.css';
|
||||
import "jquery-cropper/dist/jquery-cropper.js";
|
||||
|
||||
|
||||
|
||||
if(typeof pathUplodImageAdd !== 'undefined'){
|
||||
|
||||
uploderImagesAnnonce();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
function uploderImagesAnnonce()
|
||||
{
|
||||
let cropper;
|
||||
let base64Home;
|
||||
let base64Search;
|
||||
let base64Detail1;
|
||||
let base64Detail2;
|
||||
let base64Detail3;
|
||||
let base64Detail4;
|
||||
|
||||
|
||||
$( "#resize-image" ).click(function() {
|
||||
|
||||
let typeImage = $("#imgPreviewCropper").attr("data-type-img");
|
||||
|
||||
if(typeImage == "home"){
|
||||
|
||||
base64Home = $("#imgPreviewCropper").cropper('getCroppedCanvas', {width: widthImgAccueil, height: heightImgAccueil}).toDataURL('image/jpeg', 1);
|
||||
|
||||
$('#img-preview-home').attr('src', base64Home);
|
||||
|
||||
}else if(typeImage == "search"){
|
||||
|
||||
base64Search = $("#imgPreviewCropper").cropper('getCroppedCanvas', {width: 438, height: 240}).toDataURL('image/jpeg', 1);
|
||||
$('#img-preview-search').attr('src', base64Search);
|
||||
}
|
||||
$('#cropperModal').modal('hide');
|
||||
});
|
||||
|
||||
|
||||
/***************************************************************************** */
|
||||
|
||||
$("#upload_image_accueil").on('change', function(e) {
|
||||
const file = e.target.files[0];
|
||||
|
||||
if (file) {
|
||||
let reader = new FileReader();
|
||||
|
||||
reader.onload = function (event) {
|
||||
|
||||
$("#imgPreviewCropper").attr("src", event.target.result);
|
||||
$("#imgPreviewCropper").attr("data-type-img", "home");
|
||||
|
||||
var image = new Image();
|
||||
image.src = reader.result;
|
||||
image.onload = function() {
|
||||
|
||||
if(image.width != widthImgAccueil){
|
||||
$('#imgPreviewCropper').cropper('destroy');
|
||||
|
||||
cropper = $("#imgPreviewCropper").cropper({
|
||||
minContainerWidth: widthImgAccueil,
|
||||
minContainerHeight: heightImgAccueil,
|
||||
minCropBoxWidth: widthImgAccueil,
|
||||
minCropBoxHeight: heightImgAccueil,
|
||||
zoomable: true,
|
||||
dragMode: 'move',
|
||||
});
|
||||
|
||||
if(largeurAnnonce == 1){
|
||||
$('.modal-dialog').css({'max-width':"476px"});
|
||||
}else if(largeurAnnonce == 2){
|
||||
$('.modal-dialog').css({'max-width':"914px"});
|
||||
}else if(largeurAnnonce == 3){
|
||||
$('.modal-dialog').css({'max-width':"1352px"});
|
||||
}else if(largeurAnnonce == 4){
|
||||
$('.modal-dialog').css({'max-width':"1790px"});
|
||||
}
|
||||
|
||||
$('#cropperModal').modal('show');
|
||||
|
||||
}else{
|
||||
base64Home = event.target.result;
|
||||
$("#img-preview-home").attr("src", event.target.result);
|
||||
}
|
||||
};
|
||||
};
|
||||
reader.readAsDataURL(file);
|
||||
$("#progress-bar-accueil").css({'width':"0%"});
|
||||
$("#progress-bar-accueil").empty().append("0%");
|
||||
}
|
||||
});
|
||||
|
||||
$( "#submit-image-accueil" ).click(function() {
|
||||
$.ajax({
|
||||
url: pathUplodImageAdd,
|
||||
type: 'POST',
|
||||
data: {type:'home', image64:base64Home},
|
||||
xhr: function() {
|
||||
var xhr = $.ajaxSettings.xhr();
|
||||
if (xhr.upload) {
|
||||
xhr.upload.addEventListener('progress', function(evt) {
|
||||
var percent = (evt.loaded / evt.total) * 100;
|
||||
$("#progress-bar-accueil").css({'width': percent + "%"});
|
||||
$("#progress-bar-accueil").empty().append(percent + "%");
|
||||
}, false);
|
||||
}
|
||||
return xhr;
|
||||
},
|
||||
success: function() {
|
||||
$("#progress-bar-accueil").empty().append("Terminer");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
/****************************************************************************** */
|
||||
|
||||
$("#upload_image_search").on('change', function(e) {
|
||||
const file = e.target.files[0];
|
||||
|
||||
if (file) {
|
||||
let reader = new FileReader();
|
||||
|
||||
reader.onload = function (event) {
|
||||
|
||||
$("#imgPreviewCropper").attr("src", event.target.result);
|
||||
$("#imgPreviewCropper").attr("data-type-img", "search");
|
||||
|
||||
var image = new Image();
|
||||
image.src = reader.result;
|
||||
image.onload = function() {
|
||||
if(image.width != widthImgAccueil){
|
||||
$('#imgPreviewCropper').cropper('destroy');
|
||||
|
||||
cropper = $("#imgPreviewCropper").cropper({
|
||||
minContainerWidth: 438,
|
||||
minContainerHeight: 240,
|
||||
minCropBoxWidth: 438,
|
||||
minCropBoxHeight: 240,
|
||||
zoomable: true,
|
||||
dragMode: 'move',
|
||||
});
|
||||
|
||||
$('.modal-dialog').css({'max-width':"476px"});
|
||||
$('#cropperModal').modal('show');
|
||||
}else{
|
||||
base64Search = event.target.result;
|
||||
$("#img-preview-search").attr("src", event.target.result);
|
||||
}
|
||||
};
|
||||
};
|
||||
reader.readAsDataURL(file);
|
||||
$("#progress-bar-search").css({'width':"0%"});
|
||||
$("#progress-bar-search").empty().append("0%");
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
$( "#submit-image-search" ).click(function() {
|
||||
$.ajax({
|
||||
url: pathUplodImageAdd,
|
||||
type: 'POST',
|
||||
data: {type:'search', image64:base64Search},
|
||||
xhr: function() {
|
||||
var xhr = $.ajaxSettings.xhr();
|
||||
if (xhr.upload) {
|
||||
xhr.upload.addEventListener('progress', function(evt) {
|
||||
var percent = (evt.loaded / evt.total) * 100;
|
||||
$("#progress-bar-search").css({'width': percent + "%"});
|
||||
$("#progress-bar-search").empty().append(percent + "%");
|
||||
}, false);
|
||||
}
|
||||
return xhr;
|
||||
},
|
||||
success: function() {
|
||||
$("#progress-bar-search").empty().append("Terminer");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
/*********************************************************************************** */
|
||||
|
||||
|
||||
$("#upload_image_detail1").on('change', function(e) {
|
||||
|
||||
const file = e.target.files[0];
|
||||
|
||||
if (file) {
|
||||
let reader = new FileReader();
|
||||
|
||||
reader.onloadend = function (event) {
|
||||
|
||||
$("#img-preview-detail1").attr("src", event.target.result);
|
||||
|
||||
base64Detail1 = event.target.result;
|
||||
|
||||
//console.log(base64Detail1);
|
||||
};
|
||||
reader.readAsDataURL(file);
|
||||
|
||||
$("#progress-bar-detail1").css({'width':"0%"});
|
||||
$("#progress-bar-detail1").empty().append("0%");
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
$( "#submit-image-detail1" ).click(function() {
|
||||
$.ajax({
|
||||
url: pathUplodImageAdd,
|
||||
type: 'POST',
|
||||
data: {type:'detail1', image64:base64Detail1},
|
||||
xhr: function() {
|
||||
var xhr = $.ajaxSettings.xhr();
|
||||
if (xhr.upload) {
|
||||
xhr.upload.addEventListener('progress', function(evt) {
|
||||
var percent = (evt.loaded / evt.total) * 100;
|
||||
$("#progress-bar-detail1").css({'width': percent + "%"});
|
||||
$("#progress-bar-detail1").empty().append(percent + "%");
|
||||
}, false);
|
||||
}
|
||||
return xhr;
|
||||
},
|
||||
success: function() {
|
||||
$("#progress-bar-detail1").empty().append("Terminer");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
/******************************************************************************** */
|
||||
|
||||
|
||||
$("#upload_image_detail2").on('change', function(e) {
|
||||
|
||||
const file = e.target.files[0];
|
||||
|
||||
if (file) {
|
||||
let reader = new FileReader();
|
||||
|
||||
reader.onloadend = function (event) {
|
||||
|
||||
$("#img-preview-detail2").attr("src", event.target.result);
|
||||
|
||||
base64Detail2 = event.target.result;
|
||||
|
||||
//console.log(base64Detail2);
|
||||
};
|
||||
reader.readAsDataURL(file);
|
||||
|
||||
$("#progress-bar-detail2").css({'width':"0%"});
|
||||
$("#progress-bar-detail2").empty().append("0%");
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
$( "#submit-image-detail2" ).click(function() {
|
||||
$.ajax({
|
||||
url: pathUplodImageAdd,
|
||||
type: 'POST',
|
||||
data: {type:'detail2', image64:base64Detail2},
|
||||
xhr: function() {
|
||||
var xhr = $.ajaxSettings.xhr();
|
||||
if (xhr.upload) {
|
||||
xhr.upload.addEventListener('progress', function(evt) {
|
||||
var percent = (evt.loaded / evt.total) * 100;
|
||||
$("#progress-bar-detail2").css({'width': percent + "%"});
|
||||
$("#progress-bar-detail2").empty().append(percent + "%");
|
||||
}, false);
|
||||
}
|
||||
return xhr;
|
||||
},
|
||||
success: function() {
|
||||
$("#progress-bar-detail2").empty().append("Terminer");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
/*********************************************************************** */
|
||||
|
||||
$("#upload_image_detail3").on('change', function(e) {
|
||||
|
||||
const file = e.target.files[0];
|
||||
|
||||
if (file) {
|
||||
let reader = new FileReader();
|
||||
|
||||
reader.onloadend = function (event) {
|
||||
|
||||
$("#img-preview-detail3").attr("src", event.target.result);
|
||||
|
||||
base64Detail3 = event.target.result;
|
||||
|
||||
//console.log(base64Detail3);
|
||||
};
|
||||
reader.readAsDataURL(file);
|
||||
|
||||
$("#progress-bar-detail3").css({'width':"0%"});
|
||||
$("#progress-bar-detail3").empty().append("0%");
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
$( "#submit-image-detail3" ).click(function() {
|
||||
$.ajax({
|
||||
url: pathUplodImageAdd,
|
||||
type: 'POST',
|
||||
data: {type:'detail3', image64:base64Detail3},
|
||||
xhr: function() {
|
||||
var xhr = $.ajaxSettings.xhr();
|
||||
if (xhr.upload) {
|
||||
xhr.upload.addEventListener('progress', function(evt) {
|
||||
var percent = (evt.loaded / evt.total) * 100;
|
||||
$("#progress-bar-detail3").css({'width': percent + "%"});
|
||||
$("#progress-bar-detail3").empty().append(percent + "%");
|
||||
}, false);
|
||||
}
|
||||
return xhr;
|
||||
},
|
||||
success: function() {
|
||||
$("#progress-bar-detail3").empty().append("Terminer");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
/**************************************************************************** */
|
||||
|
||||
$("#upload_image_detail4").on('change', function(e) {
|
||||
|
||||
const file = e.target.files[0];
|
||||
|
||||
if (file) {
|
||||
let reader = new FileReader();
|
||||
|
||||
reader.onloadend = function (event) {
|
||||
|
||||
$("#img-preview-detail4").attr("src", event.target.result);
|
||||
|
||||
base64Detail4 = event.target.result;
|
||||
|
||||
//console.log(base64Detail4);
|
||||
};
|
||||
reader.readAsDataURL(file);
|
||||
|
||||
$("#progress-bar-detail4").css({'width':"0%"});
|
||||
$("#progress-bar-detail4").empty().append("0%");
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
$( "#submit-image-detail4" ).click(function() {
|
||||
$.ajax({
|
||||
url: pathUplodImageAdd,
|
||||
type: 'POST',
|
||||
data: {type:'detail4', image64:base64Detail4},
|
||||
xhr: function() {
|
||||
var xhr = $.ajaxSettings.xhr();
|
||||
if (xhr.upload) {
|
||||
xhr.upload.addEventListener('progress', function(evt) {
|
||||
var percent = (evt.loaded / evt.total) * 100;
|
||||
$("#progress-bar-detail4").css({'width': percent + "%"});
|
||||
$("#progress-bar-detail4").empty().append(percent + "%");
|
||||
}, false);
|
||||
}
|
||||
return xhr;
|
||||
},
|
||||
success: function() {
|
||||
$("#progress-bar-detail4").empty().append("Terminer");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
$('#dataTableAnnonce').DataTable({
|
||||
language: {
|
||||
url: '../../assets/json/fr-FR.json',
|
||||
},
|
||||
});
|
||||
308
assets/javascript/backend/article.js
Normal file
308
assets/javascript/backend/article.js
Normal file
@@ -0,0 +1,308 @@
|
||||
$( "#article_limit_type_0" ).click(function() {
|
||||
$('#article-limita-date').css('display','block');
|
||||
$('#article-limita-quanti').css('display',"none");
|
||||
$('#article_limit_quantite').val('');
|
||||
});
|
||||
|
||||
$( "#article_limit_type_1" ).click(function() {
|
||||
$('#article-limita-date').css('display','none');
|
||||
$('#article-limita-quanti').css('display',"block");
|
||||
$('#article_limit_date').val('');
|
||||
});
|
||||
|
||||
|
||||
|
||||
if(typeof pathArticleUplodImageAdd !== 'undefined'){
|
||||
|
||||
uploderImagesArticle();
|
||||
|
||||
}
|
||||
|
||||
function uploderImagesArticle(){
|
||||
|
||||
let cropper;
|
||||
let base64Default;
|
||||
let base64Detail1;
|
||||
let base64Detail2;
|
||||
let base64Detail3;
|
||||
let base64Detail4;
|
||||
|
||||
|
||||
$( "#resize-image" ).click(function() {
|
||||
|
||||
let typeImage = $("#imgPreviewCropper").attr("data-type-img");
|
||||
|
||||
if(typeImage == "default"){
|
||||
|
||||
base64Default = $("#imgPreviewCropper").cropper('getCroppedCanvas', {width: 438, height: 240}).toDataURL('image/jpeg', 1);
|
||||
$('#img-preview-default').attr('src', base64Default);
|
||||
}
|
||||
$('#cropperModal').modal('hide');
|
||||
});
|
||||
|
||||
/***************************************************************************** */
|
||||
|
||||
$("#upload_image_default").on('change', function(e) {
|
||||
const file = e.target.files[0];
|
||||
|
||||
if (file) {
|
||||
let reader = new FileReader();
|
||||
|
||||
reader.onload = function (event) {
|
||||
|
||||
$("#imgPreviewCropper").attr("src", event.target.result);
|
||||
$("#imgPreviewCropper").attr("data-type-img", "default");
|
||||
|
||||
var image = new Image();
|
||||
image.src = reader.result;
|
||||
image.onload = function() {
|
||||
|
||||
if(image.width != 438){
|
||||
$('#imgPreviewCropper').cropper('destroy');
|
||||
|
||||
cropper = $("#imgPreviewCropper").cropper({
|
||||
minContainerWidth: 438,
|
||||
minContainerHeight: 240,
|
||||
minCropBoxWidth: 438,
|
||||
minCropBoxHeight: 240,
|
||||
zoomable: true,
|
||||
dragMode: 'move',
|
||||
});
|
||||
|
||||
$('.modal-dialog').css({'max-width':"476px"});
|
||||
$('#cropperModal').modal('show');
|
||||
}else{
|
||||
base64Default = event.target.result;
|
||||
$("#img-preview-default").attr("src", event.target.result);
|
||||
}
|
||||
};
|
||||
};
|
||||
reader.readAsDataURL(file);
|
||||
$("#progress-bar-default").css({'width':"0%"});
|
||||
$("#progress-bar-default").empty().append("0%");
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
$( "#submit-image-default" ).click(function() {
|
||||
$.ajax({
|
||||
url: pathArticleUplodImageAdd,
|
||||
type: 'POST',
|
||||
data: {type:'default', image64:base64Default},
|
||||
xhr: function() {
|
||||
var xhr = $.ajaxSettings.xhr();
|
||||
if (xhr.upload) {
|
||||
xhr.upload.addEventListener('progress', function(evt) {
|
||||
var percent = (evt.loaded / evt.total) * 100;
|
||||
$("#progress-bar-default").css({'width': percent + "%"});
|
||||
$("#progress-bar-default").empty().append(percent + "%");
|
||||
}, false);
|
||||
}
|
||||
return xhr;
|
||||
},
|
||||
success: function() {
|
||||
$("#progress-bar-default").empty().append("Terminer");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
/****************************************************************************** */
|
||||
|
||||
|
||||
$("#upload_image_detail1").on('change', function(e) {
|
||||
|
||||
const file = e.target.files[0];
|
||||
|
||||
if (file) {
|
||||
let reader = new FileReader();
|
||||
|
||||
reader.onloadend = function (event) {
|
||||
|
||||
$("#img-preview-detail1").attr("src", event.target.result);
|
||||
|
||||
base64Detail1 = event.target.result;
|
||||
};
|
||||
reader.readAsDataURL(file);
|
||||
|
||||
$("#progress-bar-detail1").css({'width':"0%"});
|
||||
$("#progress-bar-detail1").empty().append("0%");
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
$( "#submit-image-detail1" ).click(function() {
|
||||
$.ajax({
|
||||
url: pathArticleUplodImageAdd,
|
||||
type: 'POST',
|
||||
data: {type:'detail1', image64:base64Detail1},
|
||||
xhr: function() {
|
||||
var xhr = $.ajaxSettings.xhr();
|
||||
if (xhr.upload) {
|
||||
xhr.upload.addEventListener('progress', function(evt) {
|
||||
var percent = (evt.loaded / evt.total) * 100;
|
||||
$("#progress-bar-detail1").css({'width': percent + "%"});
|
||||
$("#progress-bar-detail1").empty().append(percent + "%");
|
||||
}, false);
|
||||
}
|
||||
return xhr;
|
||||
},
|
||||
success: function() {
|
||||
$("#progress-bar-detail1").empty().append("Terminer");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
/******************************************************************************** */
|
||||
|
||||
|
||||
$("#upload_image_detail2").on('change', function(e) {
|
||||
|
||||
const file = e.target.files[0];
|
||||
|
||||
if (file) {
|
||||
let reader = new FileReader();
|
||||
|
||||
reader.onloadend = function (event) {
|
||||
|
||||
$("#img-preview-detail2").attr("src", event.target.result);
|
||||
|
||||
base64Detail2 = event.target.result;
|
||||
|
||||
//console.log(base64Detail2);
|
||||
};
|
||||
reader.readAsDataURL(file);
|
||||
|
||||
$("#progress-bar-detail2").css({'width':"0%"});
|
||||
$("#progress-bar-detail2").empty().append("0%");
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
$( "#submit-image-detail2" ).click(function() {
|
||||
$.ajax({
|
||||
url: pathArticleUplodImageAdd,
|
||||
type: 'POST',
|
||||
data: {type:'detail2', image64:base64Detail2},
|
||||
xhr: function() {
|
||||
var xhr = $.ajaxSettings.xhr();
|
||||
if (xhr.upload) {
|
||||
xhr.upload.addEventListener('progress', function(evt) {
|
||||
var percent = (evt.loaded / evt.total) * 100;
|
||||
$("#progress-bar-detail2").css({'width': percent + "%"});
|
||||
$("#progress-bar-detail2").empty().append(percent + "%");
|
||||
}, false);
|
||||
}
|
||||
return xhr;
|
||||
},
|
||||
success: function() {
|
||||
$("#progress-bar-detail2").empty().append("Terminer");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
/*********************************************************************** */
|
||||
|
||||
$("#upload_image_detail3").on('change', function(e) {
|
||||
|
||||
const file = e.target.files[0];
|
||||
|
||||
if (file) {
|
||||
let reader = new FileReader();
|
||||
|
||||
reader.onloadend = function (event) {
|
||||
|
||||
$("#img-preview-detail3").attr("src", event.target.result);
|
||||
|
||||
base64Detail3 = event.target.result;
|
||||
};
|
||||
reader.readAsDataURL(file);
|
||||
|
||||
$("#progress-bar-detail3").css({'width':"0%"});
|
||||
$("#progress-bar-detail3").empty().append("0%");
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
$( "#submit-image-detail3" ).click(function() {
|
||||
$.ajax({
|
||||
url: pathArticleUplodImageAdd,
|
||||
type: 'POST',
|
||||
data: {type:'detail3', image64:base64Detail3},
|
||||
xhr: function() {
|
||||
var xhr = $.ajaxSettings.xhr();
|
||||
if (xhr.upload) {
|
||||
xhr.upload.addEventListener('progress', function(evt) {
|
||||
var percent = (evt.loaded / evt.total) * 100;
|
||||
$("#progress-bar-detail3").css({'width': percent + "%"});
|
||||
$("#progress-bar-detail3").empty().append(percent + "%");
|
||||
}, false);
|
||||
}
|
||||
return xhr;
|
||||
},
|
||||
success: function() {
|
||||
$("#progress-bar-detail3").empty().append("Terminer");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
/**************************************************************************** */
|
||||
|
||||
$("#upload_image_detail4").on('change', function(e) {
|
||||
|
||||
const file = e.target.files[0];
|
||||
|
||||
if (file) {
|
||||
let reader = new FileReader();
|
||||
|
||||
reader.onloadend = function (event) {
|
||||
|
||||
$("#img-preview-detail4").attr("src", event.target.result);
|
||||
|
||||
base64Detail4 = event.target.result;
|
||||
|
||||
//console.log(base64Detail4);
|
||||
};
|
||||
reader.readAsDataURL(file);
|
||||
|
||||
$("#progress-bar-detail4").css({'width':"0%"});
|
||||
$("#progress-bar-detail4").empty().append("0%");
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
$( "#submit-image-detail4" ).click(function() {
|
||||
$.ajax({
|
||||
url: pathArticleUplodImageAdd,
|
||||
type: 'POST',
|
||||
data: {type:'detail4', image64:base64Detail4},
|
||||
xhr: function() {
|
||||
var xhr = $.ajaxSettings.xhr();
|
||||
if (xhr.upload) {
|
||||
xhr.upload.addEventListener('progress', function(evt) {
|
||||
var percent = (evt.loaded / evt.total) * 100;
|
||||
$("#progress-bar-detail4").css({'width': percent + "%"});
|
||||
$("#progress-bar-detail4").empty().append(percent + "%");
|
||||
}, false);
|
||||
}
|
||||
return xhr;
|
||||
},
|
||||
success: function() {
|
||||
$("#progress-bar-detail4").empty().append("Terminer");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
245
assets/javascript/backend/dashboard.js
Normal file
245
assets/javascript/backend/dashboard.js
Normal file
@@ -0,0 +1,245 @@
|
||||
import { Chart } from 'chart.js';
|
||||
|
||||
// Set new default font family and font color to mimic Bootstrap's default styling
|
||||
Chart.defaults.global.defaultFontFamily = 'Nunito', '-apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif';
|
||||
Chart.defaults.global.defaultFontColor = '#858796';
|
||||
|
||||
function number_format(number, decimals, dec_point, thousands_sep) {
|
||||
// * example: number_format(1234.56, 2, ',', ' ');
|
||||
// * return: '1 234,56'
|
||||
number = (number + '').replace(',', '').replace(' ', '');
|
||||
var n = !isFinite(+number) ? 0 : +number,
|
||||
prec = !isFinite(+decimals) ? 0 : Math.abs(decimals),
|
||||
sep = (typeof thousands_sep === 'undefined') ? ',' : thousands_sep,
|
||||
dec = (typeof dec_point === 'undefined') ? '.' : dec_point,
|
||||
s = '',
|
||||
toFixedFix = function(n, prec) {
|
||||
var k = Math.pow(10, prec);
|
||||
return '' + Math.round(n * k) / k;
|
||||
};
|
||||
// Fix for IE parseFloat(0.55).toFixed(0) = 0;
|
||||
s = (prec ? toFixedFix(n, prec) : '' + Math.round(n)).split('.');
|
||||
if (s[0].length > 3) {
|
||||
s[0] = s[0].replace(/\B(?=(?:\d{3})+(?!\d))/g, sep);
|
||||
}
|
||||
if ((s[1] || '').length < prec) {
|
||||
s[1] = s[1] || '';
|
||||
s[1] += new Array(prec - s[1].length + 1).join('0');
|
||||
}
|
||||
return s.join(dec);
|
||||
}
|
||||
|
||||
// Bar Chart Example
|
||||
var ctx = document.getElementById("myBarChart");
|
||||
if(ctx != null){
|
||||
var myBarChart = new Chart(ctx, {
|
||||
type: 'bar',
|
||||
data: {
|
||||
labels: ["January", "February", "March", "April", "May", "June"],
|
||||
datasets: [{
|
||||
label: "Revenue",
|
||||
backgroundColor: "#4e73df",
|
||||
hoverBackgroundColor: "#2e59d9",
|
||||
borderColor: "#4e73df",
|
||||
data: [4215, 5312, 6251, 7841, 9821, 14984],
|
||||
}],
|
||||
},
|
||||
options: {
|
||||
maintainAspectRatio: false,
|
||||
layout: {
|
||||
padding: {
|
||||
left: 10,
|
||||
right: 25,
|
||||
top: 25,
|
||||
bottom: 0
|
||||
}
|
||||
},
|
||||
scales: {
|
||||
xAxes: [{
|
||||
time: {
|
||||
unit: 'month'
|
||||
},
|
||||
gridLines: {
|
||||
display: false,
|
||||
drawBorder: false
|
||||
},
|
||||
ticks: {
|
||||
maxTicksLimit: 6
|
||||
},
|
||||
maxBarThickness: 25,
|
||||
}],
|
||||
yAxes: [{
|
||||
ticks: {
|
||||
min: 0,
|
||||
max: 15000,
|
||||
maxTicksLimit: 5,
|
||||
padding: 10,
|
||||
// Include a dollar sign in the ticks
|
||||
callback: function(value, index, values) {
|
||||
return '$' + number_format(value);
|
||||
}
|
||||
},
|
||||
gridLines: {
|
||||
color: "rgb(234, 236, 244)",
|
||||
zeroLineColor: "rgb(234, 236, 244)",
|
||||
drawBorder: false,
|
||||
borderDash: [2],
|
||||
zeroLineBorderDash: [2]
|
||||
}
|
||||
}],
|
||||
},
|
||||
legend: {
|
||||
display: false
|
||||
},
|
||||
tooltips: {
|
||||
titleMarginBottom: 10,
|
||||
titleFontColor: '#6e707e',
|
||||
titleFontSize: 14,
|
||||
backgroundColor: "rgb(255,255,255)",
|
||||
bodyFontColor: "#858796",
|
||||
borderColor: '#dddfeb',
|
||||
borderWidth: 1,
|
||||
xPadding: 15,
|
||||
yPadding: 15,
|
||||
displayColors: false,
|
||||
caretPadding: 10,
|
||||
callbacks: {
|
||||
label: function(tooltipItem, chart) {
|
||||
var datasetLabel = chart.datasets[tooltipItem.datasetIndex].label || '';
|
||||
return datasetLabel + ': $' + number_format(tooltipItem.yLabel);
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// Pie Chart Example
|
||||
var ctx = document.getElementById("myPieChart");
|
||||
if(ctx != null){
|
||||
var myPieChart = new Chart(ctx, {
|
||||
type: 'doughnut',
|
||||
data: {
|
||||
labels: ["Direct", "Referral", "Social"],
|
||||
datasets: [{
|
||||
data: [55, 30, 15],
|
||||
backgroundColor: ['#4e73df', '#1cc88a', '#36b9cc'],
|
||||
hoverBackgroundColor: ['#2e59d9', '#17a673', '#2c9faf'],
|
||||
hoverBorderColor: "rgba(234, 236, 244, 1)",
|
||||
}],
|
||||
},
|
||||
options: {
|
||||
maintainAspectRatio: false,
|
||||
tooltips: {
|
||||
backgroundColor: "rgb(255,255,255)",
|
||||
bodyFontColor: "#858796",
|
||||
borderColor: '#dddfeb',
|
||||
borderWidth: 1,
|
||||
xPadding: 15,
|
||||
yPadding: 15,
|
||||
displayColors: false,
|
||||
caretPadding: 10,
|
||||
},
|
||||
legend: {
|
||||
display: false
|
||||
},
|
||||
cutoutPercentage: 80,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// Area Chart Example
|
||||
var ctx = document.getElementById("myAreaChart");
|
||||
if(ctx != null){
|
||||
var myLineChart = new Chart(ctx, {
|
||||
type: 'line',
|
||||
data: {
|
||||
labels: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
|
||||
datasets: [{
|
||||
label: "Earnings",
|
||||
lineTension: 0.3,
|
||||
backgroundColor: "rgba(78, 115, 223, 0.05)",
|
||||
borderColor: "rgba(78, 115, 223, 1)",
|
||||
pointRadius: 3,
|
||||
pointBackgroundColor: "rgba(78, 115, 223, 1)",
|
||||
pointBorderColor: "rgba(78, 115, 223, 1)",
|
||||
pointHoverRadius: 3,
|
||||
pointHoverBackgroundColor: "rgba(78, 115, 223, 1)",
|
||||
pointHoverBorderColor: "rgba(78, 115, 223, 1)",
|
||||
pointHitRadius: 10,
|
||||
pointBorderWidth: 2,
|
||||
data: [0, 10000, 5000, 15000, 10000, 20000, 15000, 25000, 20000, 30000, 25000, 40000],
|
||||
}],
|
||||
},
|
||||
options: {
|
||||
maintainAspectRatio: false,
|
||||
layout: {
|
||||
padding: {
|
||||
left: 10,
|
||||
right: 25,
|
||||
top: 25,
|
||||
bottom: 0
|
||||
}
|
||||
},
|
||||
scales: {
|
||||
xAxes: [{
|
||||
time: {
|
||||
unit: 'date'
|
||||
},
|
||||
gridLines: {
|
||||
display: false,
|
||||
drawBorder: false
|
||||
},
|
||||
ticks: {
|
||||
maxTicksLimit: 7
|
||||
}
|
||||
}],
|
||||
yAxes: [{
|
||||
ticks: {
|
||||
maxTicksLimit: 5,
|
||||
padding: 10,
|
||||
// Include a dollar sign in the ticks
|
||||
callback: function(value, index, values) {
|
||||
return number_format(value);
|
||||
}
|
||||
},
|
||||
gridLines: {
|
||||
color: "rgb(234, 236, 244)",
|
||||
zeroLineColor: "rgb(234, 236, 244)",
|
||||
drawBorder: false,
|
||||
borderDash: [2],
|
||||
zeroLineBorderDash: [2]
|
||||
}
|
||||
}],
|
||||
},
|
||||
legend: {
|
||||
display: false
|
||||
},
|
||||
tooltips: {
|
||||
backgroundColor: "rgb(255,255,255)",
|
||||
bodyFontColor: "#858796",
|
||||
titleMarginBottom: 10,
|
||||
titleFontColor: '#6e707e',
|
||||
titleFontSize: 14,
|
||||
borderColor: '#dddfeb',
|
||||
borderWidth: 1,
|
||||
xPadding: 15,
|
||||
yPadding: 15,
|
||||
displayColors: false,
|
||||
intersect: false,
|
||||
mode: 'index',
|
||||
caretPadding: 10,
|
||||
callbacks: {
|
||||
label: function(tooltipItem, chart) {
|
||||
var datasetLabel = chart.datasets[tooltipItem.datasetIndex].label || '';
|
||||
return datasetLabel + ': ' + number_format(tooltipItem.yLabel);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
163
assets/javascript/backend/position.js
Normal file
163
assets/javascript/backend/position.js
Normal file
@@ -0,0 +1,163 @@
|
||||
var id_societe = "";
|
||||
var id_annonce = "";
|
||||
var id_ligne = "";
|
||||
var date_debut = "";
|
||||
var date_fin = "";
|
||||
|
||||
|
||||
$("#societe").change(function () {
|
||||
var option = $(this).find('option:selected');
|
||||
|
||||
if(option.val() != ''){
|
||||
Annonce(option.val());
|
||||
id_societe = option.val();
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
function Annonce(idSociete){
|
||||
|
||||
$('.annonce').css('display','none');
|
||||
$.post( pathReservation, {idSociete:idSociete}, function( data ) {
|
||||
if(data != ''){
|
||||
$('#annonce').empty().html('<option value=""></option>'+data);
|
||||
$('.annonce').css('display','block');
|
||||
}
|
||||
|
||||
}).fail(function(response) {
|
||||
console.log('Error: ' + response.responseText);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
$("#annonce").change(function () {
|
||||
|
||||
var option = $(this).find('option:selected');
|
||||
|
||||
if(option.val() != ''){
|
||||
|
||||
$('.largeur').css('display','block');
|
||||
|
||||
let dimention = option.attr("largeur");
|
||||
|
||||
if(dimention == "1"){
|
||||
$('#largeur').empty().append("1/4 (438 * 240) pixels");
|
||||
}else if(dimention == "2"){
|
||||
$('#largeur').empty().append("2/4 (876 * 240) pixels");
|
||||
}else if(dimention == "3"){
|
||||
$('#largeur').empty().append("3/4 (1314 * 240) pixels");
|
||||
}else if(dimention == "4"){
|
||||
$('#largeur').empty().append("4/4 (1752 * 240) pixels");
|
||||
}
|
||||
|
||||
$('.ligne').css('display','block');
|
||||
|
||||
id_annonce = option.val();
|
||||
|
||||
$.post( pathLigneDetail, { dimension:dimention}, function( data ) {
|
||||
|
||||
$("#ligne").empty().html(data);
|
||||
|
||||
}).fail(function(response) {
|
||||
console.log('Error: ' + response.responseText);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
$("#ligne").change(function () {
|
||||
|
||||
var option = $(this).find('option:selected');
|
||||
|
||||
if(option.val() != ''){
|
||||
|
||||
$('.intervalle-date').css('display','block');
|
||||
|
||||
id_ligne = option.val();
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
$("#dateDebut").change(function () {
|
||||
|
||||
let sysDate = new Date();
|
||||
sysDate.setHours(0,0,0,0);
|
||||
let selDate = new Date($("#dateDebut").val());
|
||||
|
||||
if(selDate >= sysDate ){
|
||||
$("#dateDebut").removeClass("is-invalid");
|
||||
$(".dateFin").css('display','block');
|
||||
|
||||
}else{
|
||||
$("#dateDebut").addClass("is-invalid");
|
||||
$(".dateFin").css('display','none');
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
$("#dateFin").change(function () {
|
||||
|
||||
let selDatedebut = new Date($("#dateDebut").val());
|
||||
let selDatefin = new Date($("#dateFin").val());
|
||||
|
||||
if(selDatedebut > selDatefin){
|
||||
$("#dateFin").addClass("is-invalid");
|
||||
$(".valOperation").css('display','none');
|
||||
}else{
|
||||
$("#dateFin").removeClass("is-invalid");
|
||||
date_fin = $("#dateFin").val();
|
||||
date_debut = $("#dateDebut").val();
|
||||
$(".valOperation").css('display','block');
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
$( "#valOperation" ).click(function() {
|
||||
|
||||
$("#loading-data").empty().html('<div style="height:600px"><div style="position: relative; top: 44%; left: 45%;"><div class="spinner-border" style="width: 4rem; height: 4rem;" role="status"></div></div></div>');
|
||||
console.log(date_debut);
|
||||
console.log(date_fin);
|
||||
$.post( pathTestReservation, {id_societe:id_societe,
|
||||
id_annonce:id_annonce,
|
||||
id_ligne:id_ligne,
|
||||
date_debut:date_debut,
|
||||
date_fin:date_fin }, function( data ) {
|
||||
|
||||
$("#loading-data").empty();
|
||||
|
||||
|
||||
$("#annonce-ligne").empty().html(data);
|
||||
|
||||
$(".save-operation").css('display','block');
|
||||
|
||||
}).fail(function(response) {
|
||||
console.log('Error: ' + response.responseText);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
$( "#save-operation" ).click(function() {
|
||||
$( "#save-operation" ).empty().append('<i class="fas fa-spinner fa-spin" style="color: #ffffff;"></i> enregister');
|
||||
$( "#save-operation" ).prop('disabled', 'disabled');
|
||||
|
||||
$.post( pathSave, { id_annonce:id_annonce, id_ligne:id_ligne, date_debut:date_debut, date_fin:date_fin }, function( data ) {
|
||||
|
||||
if(data != ""){
|
||||
window.open(pathPositionDetail+'?idPosition='+data+'&msg=add', "_self");
|
||||
}
|
||||
|
||||
}).fail(function(response) {
|
||||
console.log('Error: ' + response.responseText);
|
||||
});
|
||||
|
||||
});
|
||||
56
assets/javascript/backend/sb-admin-2.js
Normal file
56
assets/javascript/backend/sb-admin-2.js
Normal file
@@ -0,0 +1,56 @@
|
||||
(function($) {
|
||||
"use strict"; // Start of use strict
|
||||
|
||||
// Toggle the side navigation
|
||||
$("#sidebarToggle, #sidebarToggleTop").on('click', function(e) {
|
||||
$("body").toggleClass("sidebar-toggled");
|
||||
$(".sidebar").toggleClass("toggled");
|
||||
if ($(".sidebar").hasClass("toggled")) {
|
||||
$('.sidebar .collapse').collapse('hide');
|
||||
};
|
||||
});
|
||||
|
||||
// Close any open menu accordions when window is resized below 768px
|
||||
$(window).resize(function() {
|
||||
if ($(window).width() < 768) {
|
||||
$('.sidebar .collapse').collapse('hide');
|
||||
};
|
||||
|
||||
// Toggle the side navigation when window is resized below 480px
|
||||
if ($(window).width() < 480 && !$(".sidebar").hasClass("toggled")) {
|
||||
$("body").addClass("sidebar-toggled");
|
||||
$(".sidebar").addClass("toggled");
|
||||
$('.sidebar .collapse').collapse('hide');
|
||||
};
|
||||
});
|
||||
|
||||
// Prevent the content wrapper from scrolling when the fixed side navigation hovered over
|
||||
$('body.fixed-nav .sidebar').on('mousewheel DOMMouseScroll wheel', function(e) {
|
||||
if ($(window).width() > 768) {
|
||||
var e0 = e.originalEvent,
|
||||
delta = e0.wheelDelta || -e0.detail;
|
||||
this.scrollTop += (delta < 0 ? 1 : -1) * 30;
|
||||
e.preventDefault();
|
||||
}
|
||||
});
|
||||
|
||||
// Scroll to top button appear
|
||||
$(document).on('scroll', function() {
|
||||
var scrollDistance = $(this).scrollTop();
|
||||
if (scrollDistance > 100) {
|
||||
$('.scroll-to-top').fadeIn();
|
||||
} else {
|
||||
$('.scroll-to-top').fadeOut();
|
||||
}
|
||||
});
|
||||
|
||||
// Smooth scrolling using jQuery easing
|
||||
$(document).on('click', 'a.scroll-to-top', function(e) {
|
||||
var $anchor = $(this);
|
||||
$('html, body').stop().animate({
|
||||
scrollTop: ($($anchor.attr('href')).offset().top)
|
||||
}, 1000, 'easeInOutExpo');
|
||||
e.preventDefault();
|
||||
});
|
||||
|
||||
})(jQuery); // End of use strict
|
||||
324
assets/javascript/backend/service.js
Normal file
324
assets/javascript/backend/service.js
Normal file
@@ -0,0 +1,324 @@
|
||||
$( "#service_limit_type_0" ).click(function() {
|
||||
$('#service-limita-date').css('display','block');
|
||||
});
|
||||
|
||||
$( "#service_limit_type_1" ).click(function() {
|
||||
$('#service-limita-date').css('display','none');
|
||||
$('#service_limit_date').val('');
|
||||
});
|
||||
|
||||
/*********************************************/
|
||||
|
||||
$('#tablesService').DataTable({
|
||||
language: {
|
||||
url: '../../assets/json/fr-FR.json',
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
window.ServiceRdvAjaxShow = ServiceRdvAjaxShow;
|
||||
|
||||
function ServiceRdvAjaxShow(idRdv)
|
||||
{
|
||||
$.post( pathServiceRdvAjaxShow, {idRdv:idRdv}, function( data ) {
|
||||
$("#data-rdv").empty().prepend(data);
|
||||
$('#exampleModal').modal('show');
|
||||
|
||||
}).fail(function(response) {
|
||||
console.error('Error: ' + response.responseText);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**************************************************/
|
||||
|
||||
if(typeof pathServiceUplodImageAdd !== 'undefined'){
|
||||
|
||||
uploderImagesService();
|
||||
|
||||
}
|
||||
|
||||
function uploderImagesService(){
|
||||
|
||||
let cropper;
|
||||
let base64Default;
|
||||
let base64Detail1;
|
||||
let base64Detail2;
|
||||
let base64Detail3;
|
||||
let base64Detail4;
|
||||
|
||||
|
||||
$( "#resize-image" ).click(function() {
|
||||
|
||||
let typeImage = $("#imgPreviewCropper").attr("data-type-img");
|
||||
|
||||
if(typeImage == "default"){
|
||||
|
||||
base64Default = $("#imgPreviewCropper").cropper('getCroppedCanvas', {width: 438, height: 240}).toDataURL('image/jpeg', 1);
|
||||
$('#img-preview-default').attr('src', base64Default);
|
||||
}
|
||||
$('#cropperModal').modal('hide');
|
||||
});
|
||||
|
||||
/***************************************************************************** */
|
||||
|
||||
$("#upload_image_default").on('change', function(e) {
|
||||
const file = e.target.files[0];
|
||||
|
||||
if (file) {
|
||||
let reader = new FileReader();
|
||||
|
||||
reader.onload = function (event) {
|
||||
|
||||
$("#imgPreviewCropper").attr("src", event.target.result);
|
||||
$("#imgPreviewCropper").attr("data-type-img", "default");
|
||||
|
||||
var image = new Image();
|
||||
image.src = reader.result;
|
||||
image.onload = function() {
|
||||
|
||||
if(image.width != 438){
|
||||
$('#imgPreviewCropper').cropper('destroy');
|
||||
|
||||
cropper = $("#imgPreviewCropper").cropper({
|
||||
minContainerWidth: 438,
|
||||
minContainerHeight: 240,
|
||||
minCropBoxWidth: 438,
|
||||
minCropBoxHeight: 240,
|
||||
zoomable: true,
|
||||
dragMode: 'move',
|
||||
});
|
||||
|
||||
$('.modal-dialog').css({'max-width':"476px"});
|
||||
$('#cropperModal').modal('show');
|
||||
}else{
|
||||
base64Default = event.target.result;
|
||||
$("#img-preview-default").attr("src", event.target.result);
|
||||
}
|
||||
};
|
||||
};
|
||||
reader.readAsDataURL(file);
|
||||
$("#progress-bar-default").css({'width':"0%"});
|
||||
$("#progress-bar-default").empty().append("0%");
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
$( "#submit-image-default" ).click(function() {
|
||||
$.ajax({
|
||||
url: pathServiceUplodImageAdd,
|
||||
type: 'POST',
|
||||
data: {type:'default', image64:base64Default},
|
||||
xhr: function() {
|
||||
var xhr = $.ajaxSettings.xhr();
|
||||
if (xhr.upload) {
|
||||
xhr.upload.addEventListener('progress', function(evt) {
|
||||
var percent = (evt.loaded / evt.total) * 100;
|
||||
$("#progress-bar-default").css({'width': percent + "%"});
|
||||
$("#progress-bar-default").empty().append(percent + "%");
|
||||
}, false);
|
||||
}
|
||||
return xhr;
|
||||
},
|
||||
success: function() {
|
||||
$("#progress-bar-default").empty().append("Terminer");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
/****************************************************************************** */
|
||||
|
||||
|
||||
$("#upload_image_detail1").on('change', function(e) {
|
||||
|
||||
const file = e.target.files[0];
|
||||
|
||||
if (file) {
|
||||
let reader = new FileReader();
|
||||
|
||||
reader.onloadend = function (event) {
|
||||
|
||||
$("#img-preview-detail1").attr("src", event.target.result);
|
||||
|
||||
base64Detail1 = event.target.result;
|
||||
};
|
||||
reader.readAsDataURL(file);
|
||||
|
||||
$("#progress-bar-detail1").css({'width':"0%"});
|
||||
$("#progress-bar-detail1").empty().append("0%");
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
$( "#submit-image-detail1" ).click(function() {
|
||||
$.ajax({
|
||||
url: pathServiceUplodImageAdd,
|
||||
type: 'POST',
|
||||
data: {type:'detail1', image64:base64Detail1},
|
||||
xhr: function() {
|
||||
var xhr = $.ajaxSettings.xhr();
|
||||
if (xhr.upload) {
|
||||
xhr.upload.addEventListener('progress', function(evt) {
|
||||
var percent = (evt.loaded / evt.total) * 100;
|
||||
$("#progress-bar-detail1").css({'width': percent + "%"});
|
||||
$("#progress-bar-detail1").empty().append(percent + "%");
|
||||
}, false);
|
||||
}
|
||||
return xhr;
|
||||
},
|
||||
success: function() {
|
||||
$("#progress-bar-detail1").empty().append("Terminer");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
/******************************************************************************** */
|
||||
|
||||
|
||||
$("#upload_image_detail2").on('change', function(e) {
|
||||
|
||||
const file = e.target.files[0];
|
||||
|
||||
if (file) {
|
||||
let reader = new FileReader();
|
||||
|
||||
reader.onloadend = function (event) {
|
||||
|
||||
$("#img-preview-detail2").attr("src", event.target.result);
|
||||
|
||||
base64Detail2 = event.target.result;
|
||||
|
||||
//console.log(base64Detail2);
|
||||
};
|
||||
reader.readAsDataURL(file);
|
||||
|
||||
$("#progress-bar-detail2").css({'width':"0%"});
|
||||
$("#progress-bar-detail2").empty().append("0%");
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
$( "#submit-image-detail2" ).click(function() {
|
||||
$.ajax({
|
||||
url: pathServiceUplodImageAdd,
|
||||
type: 'POST',
|
||||
data: {type:'detail2', image64:base64Detail2},
|
||||
xhr: function() {
|
||||
var xhr = $.ajaxSettings.xhr();
|
||||
if (xhr.upload) {
|
||||
xhr.upload.addEventListener('progress', function(evt) {
|
||||
var percent = (evt.loaded / evt.total) * 100;
|
||||
$("#progress-bar-detail2").css({'width': percent + "%"});
|
||||
$("#progress-bar-detail2").empty().append(percent + "%");
|
||||
}, false);
|
||||
}
|
||||
return xhr;
|
||||
},
|
||||
success: function() {
|
||||
$("#progress-bar-detail2").empty().append("Terminer");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
/*********************************************************************** */
|
||||
|
||||
$("#upload_image_detail3").on('change', function(e) {
|
||||
|
||||
const file = e.target.files[0];
|
||||
|
||||
if (file) {
|
||||
let reader = new FileReader();
|
||||
|
||||
reader.onloadend = function (event) {
|
||||
|
||||
$("#img-preview-detail3").attr("src", event.target.result);
|
||||
|
||||
base64Detail3 = event.target.result;
|
||||
};
|
||||
reader.readAsDataURL(file);
|
||||
|
||||
$("#progress-bar-detail3").css({'width':"0%"});
|
||||
$("#progress-bar-detail3").empty().append("0%");
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
$( "#submit-image-detail3" ).click(function() {
|
||||
$.ajax({
|
||||
url: pathServiceUplodImageAdd,
|
||||
type: 'POST',
|
||||
data: {type:'detail3', image64:base64Detail3},
|
||||
xhr: function() {
|
||||
var xhr = $.ajaxSettings.xhr();
|
||||
if (xhr.upload) {
|
||||
xhr.upload.addEventListener('progress', function(evt) {
|
||||
var percent = (evt.loaded / evt.total) * 100;
|
||||
$("#progress-bar-detail3").css({'width': percent + "%"});
|
||||
$("#progress-bar-detail3").empty().append(percent + "%");
|
||||
}, false);
|
||||
}
|
||||
return xhr;
|
||||
},
|
||||
success: function() {
|
||||
$("#progress-bar-detail3").empty().append("Terminer");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
/**************************************************************************** */
|
||||
|
||||
$("#upload_image_detail4").on('change', function(e) {
|
||||
|
||||
const file = e.target.files[0];
|
||||
|
||||
if (file) {
|
||||
let reader = new FileReader();
|
||||
|
||||
reader.onloadend = function (event) {
|
||||
|
||||
$("#img-preview-detail4").attr("src", event.target.result);
|
||||
|
||||
base64Detail4 = event.target.result;
|
||||
};
|
||||
reader.readAsDataURL(file);
|
||||
|
||||
$("#progress-bar-detail4").css({'width':"0%"});
|
||||
$("#progress-bar-detail4").empty().append("0%");
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
$( "#submit-image-detail4" ).click(function() {
|
||||
$.ajax({
|
||||
url: pathServiceUplodImageAdd,
|
||||
type: 'POST',
|
||||
data: {type:'detail4', image64:base64Detail4},
|
||||
xhr: function() {
|
||||
var xhr = $.ajaxSettings.xhr();
|
||||
if (xhr.upload) {
|
||||
xhr.upload.addEventListener('progress', function(evt) {
|
||||
var percent = (evt.loaded / evt.total) * 100;
|
||||
$("#progress-bar-detail4").css({'width': percent + "%"});
|
||||
$("#progress-bar-detail4").empty().append(percent + "%");
|
||||
}, false);
|
||||
}
|
||||
return xhr;
|
||||
},
|
||||
success: function() {
|
||||
$("#progress-bar-detail4").empty().append("Terminer");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
20
assets/javascript/frontend/newslettre.js
Normal file
20
assets/javascript/frontend/newslettre.js
Normal file
@@ -0,0 +1,20 @@
|
||||
|
||||
$(".check-groupe").change(function () {
|
||||
|
||||
related = $(this).attr("data-related");
|
||||
operation = $(this).prop("checked");
|
||||
|
||||
console.log(related);
|
||||
console.log(operation);
|
||||
|
||||
$.post( pathAjaxUpdate, {related:related, operation:operation}, function( data ) {
|
||||
|
||||
console.log(data);
|
||||
|
||||
}).fail(function(response) {
|
||||
console.log(response.responseText);
|
||||
});
|
||||
|
||||
|
||||
//$("input:checkbox").prop('checked', $(this).prop("checked"));
|
||||
});
|
||||
9
assets/javascript/frontend/parrainage.js
Normal file
9
assets/javascript/frontend/parrainage.js
Normal file
@@ -0,0 +1,9 @@
|
||||
import copy from 'copy-text-to-clipboard';
|
||||
|
||||
jQuery(document).ready(function() {
|
||||
|
||||
$( "#copurl" ).click(function() {
|
||||
copy($("#urlParinage").val());
|
||||
});
|
||||
|
||||
})
|
||||
106
assets/javascript/frontend/register.js
Normal file
106
assets/javascript/frontend/register.js
Normal file
@@ -0,0 +1,106 @@
|
||||
import intlTelInput from 'intl-tel-input';
|
||||
import 'intl-tel-input/build/js/utils';
|
||||
import 'jquery-mask-plugin';
|
||||
|
||||
import countrySelect from 'country-select-bd';
|
||||
import 'country-select-bd/build/css/countrySelect.min.css';
|
||||
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
$("#user_registration_country , #user_adresse_country").countrySelect({
|
||||
defaultCountry: "tn",
|
||||
preferredCountries: ['tn','fr'],
|
||||
excludeCountries: ["il"],
|
||||
nationalMode: false,
|
||||
formatOnDisplay: true,
|
||||
separateDialCode: true,
|
||||
autoHideDialCode: true,
|
||||
});
|
||||
|
||||
|
||||
var input = document.querySelector("#user_registration_phoneNumber");
|
||||
|
||||
|
||||
if(input != null) {
|
||||
var iti = intlTelInput(input, {
|
||||
nationalMode: false,
|
||||
formatOnDisplay: true,
|
||||
separateDialCode: true,
|
||||
autoHideDialCode: true,
|
||||
autoPlaceholder: "aggressive" ,
|
||||
initialCountry: "tn",
|
||||
placeholderNumberType: "MOBILE",
|
||||
preferredCountries: ['tn','fr'],
|
||||
excludeCountries: ["il"]
|
||||
})
|
||||
|
||||
var phoneInputID = "#user_registration_phoneNumber";
|
||||
|
||||
$(phoneInputID).on("countrychange", function(event) {
|
||||
|
||||
// Get the selected country data to know which country is selected.
|
||||
var selectedCountryData = iti.getSelectedCountryData();
|
||||
|
||||
// Get an example number for the selected country to use as placeholder.
|
||||
var newPlaceholder = intlTelInputUtils.getExampleNumber(selectedCountryData.iso2, true, intlTelInputUtils.numberFormat.INTERNATIONAL);
|
||||
|
||||
// Reset the phone number input.
|
||||
iti.setNumber("");
|
||||
|
||||
// Convert placeholder as exploitable mask by replacing all 1-9 numbers with 0s
|
||||
var mask = newPlaceholder.replace(/[1-9]/g, "0");
|
||||
|
||||
// Apply the new mask for the input
|
||||
$(this).mask(mask);
|
||||
});
|
||||
|
||||
|
||||
iti.promise.then(function() {
|
||||
$(phoneInputID).trigger("countrychange");
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
var inputInfoPerson = document.querySelector("#user_info_perso_phoneNumber");
|
||||
|
||||
if(inputInfoPerson != null) {
|
||||
|
||||
var iti = intlTelInput(inputInfoPerson, {
|
||||
nationalMode: false,
|
||||
formatOnDisplay: true,
|
||||
separateDialCode: true,
|
||||
autoHideDialCode: true,
|
||||
autoPlaceholder: "aggressive" ,
|
||||
initialCountry: "tn",
|
||||
placeholderNumberType: "MOBILE",
|
||||
preferredCountries: ['tn','fr'],
|
||||
excludeCountries: ["il"]
|
||||
|
||||
})
|
||||
|
||||
$("#user_info_perso_phoneNumber").on("countrychange", function(event) {
|
||||
|
||||
// Get the selected country data to know which country is selected.
|
||||
var selectedCountryData = iti.getSelectedCountryData();
|
||||
|
||||
// Get an example number for the selected country to use as placeholder.
|
||||
var newPlaceholder = intlTelInputUtils.getExampleNumber(selectedCountryData.iso2, true, intlTelInputUtils.numberFormat.INTERNATIONAL);
|
||||
|
||||
// Reset the phone number input.
|
||||
iti.setNumber("");
|
||||
|
||||
// Convert placeholder as exploitable mask by replacing all 1-9 numbers with 0s
|
||||
var mask = newPlaceholder.replace(/[1-9]/g, "0");
|
||||
|
||||
// Apply the new mask for the input
|
||||
$(this).mask(mask);
|
||||
});
|
||||
|
||||
|
||||
iti.promise.then(function() {
|
||||
$("#user_info_perso_phoneNumber").trigger("countrychange");
|
||||
});
|
||||
}
|
||||
});
|
||||
354
assets/javascript/frontend/scripts.js
Normal file
354
assets/javascript/frontend/scripts.js
Normal file
@@ -0,0 +1,354 @@
|
||||
import 'jquery';
|
||||
import 'bootstrap';
|
||||
import 'bootstrap-dropdown-hover';
|
||||
import { WOW } from 'wow.js';
|
||||
import { echo } from 'echo-js';
|
||||
import 'jquery.rateit';
|
||||
import 'jquery.easing';
|
||||
import '../../../public/assets/js/owl.carousel.min.js';
|
||||
|
||||
|
||||
jQuery(document).ready(function() {
|
||||
"use strict";
|
||||
|
||||
/*===================================================================================*/
|
||||
/* OWL CAROUSEL
|
||||
/*===================================================================================*/
|
||||
jQuery(function () {
|
||||
var dragging = true;
|
||||
var owlElementID = "#owl-main";
|
||||
|
||||
function fadeInReset() {
|
||||
if (!dragging) {
|
||||
jQuery(owlElementID + " .caption .fadeIn-1, " + owlElementID + " .caption .fadeIn-2, " + owlElementID + " .caption .fadeIn-3").stop().delay(800).animate({ opacity: 0 }, { duration: 400, easing: "easeInCubic" });
|
||||
}
|
||||
else {
|
||||
jQuery(owlElementID + " .caption .fadeIn-1, " + owlElementID + " .caption .fadeIn-2, " + owlElementID + " .caption .fadeIn-3").css({ opacity: 0 });
|
||||
}
|
||||
}
|
||||
|
||||
function fadeInDownReset() {
|
||||
if (!dragging) {
|
||||
jQuery(owlElementID + " .caption .fadeInDown-1, " + owlElementID + " .caption .fadeInDown-2, " + owlElementID + " .caption .fadeInDown-3").stop().delay(800).animate({ opacity: 0, top: "-15px" }, { duration: 400, easing: "easeInCubic" });
|
||||
}
|
||||
else {
|
||||
jQuery(owlElementID + " .caption .fadeInDown-1, " + owlElementID + " .caption .fadeInDown-2, " + owlElementID + " .caption .fadeInDown-3").css({ opacity: 0, top: "-15px" });
|
||||
}
|
||||
}
|
||||
|
||||
function fadeInUpReset() {
|
||||
if (!dragging) {
|
||||
jQuery(owlElementID + " .caption .fadeInUp-1, " + owlElementID + " .caption .fadeInUp-2, " + owlElementID + " .caption .fadeInUp-3").stop().delay(800).animate({ opacity: 0, top: "15px" }, { duration: 400, easing: "easeInCubic" });
|
||||
}
|
||||
else {
|
||||
$(owlElementID + " .caption .fadeInUp-1, " + owlElementID + " .caption .fadeInUp-2, " + owlElementID + " .caption .fadeInUp-3").css({ opacity: 0, top: "15px" });
|
||||
}
|
||||
}
|
||||
|
||||
function fadeInLeftReset() {
|
||||
if (!dragging) {
|
||||
jQuery(owlElementID + " .caption .fadeInLeft-1, " + owlElementID + " .caption .fadeInLeft-2, " + owlElementID + " .caption .fadeInLeft-3").stop().delay(800).animate({ opacity: 0, left: "15px" }, { duration: 400, easing: "easeInCubic" });
|
||||
}
|
||||
else {
|
||||
jQuery(owlElementID + " .caption .fadeInLeft-1, " + owlElementID + " .caption .fadeInLeft-2, " + owlElementID + " .caption .fadeInLeft-3").css({ opacity: 0, left: "15px" });
|
||||
}
|
||||
}
|
||||
|
||||
function fadeInRightReset() {
|
||||
if (!dragging) {
|
||||
jQuery(owlElementID + " .caption .fadeInRight-1, " + owlElementID + " .caption .fadeInRight-2, " + owlElementID + " .caption .fadeInRight-3").stop().delay(800).animate({ opacity: 0, left: "-15px" }, { duration: 400, easing: "easeInCubic" });
|
||||
}
|
||||
else {
|
||||
jQuery(owlElementID + " .caption .fadeInRight-1, " + owlElementID + " .caption .fadeInRight-2, " + owlElementID + " .caption .fadeInRight-3").css({ opacity: 0, left: "-15px" });
|
||||
}
|
||||
}
|
||||
|
||||
function fadeIn() {
|
||||
jQuery(owlElementID + " .active .caption .fadeIn-1").stop().delay(500).animate({ opacity: 1 }, { duration: 800, easing: "easeOutCubic" });
|
||||
jQuery(owlElementID + " .active .caption .fadeIn-2").stop().delay(700).animate({ opacity: 1 }, { duration: 800, easing: "easeOutCubic" });
|
||||
jQuery(owlElementID + " .active .caption .fadeIn-3").stop().delay(1000).animate({ opacity: 1 }, { duration: 800, easing: "easeOutCubic" });
|
||||
}
|
||||
|
||||
function fadeInDown() {
|
||||
jQuery(owlElementID + " .active .caption .fadeInDown-1").stop().delay(500).animate({ opacity: 1, top: "0" }, { duration: 800, easing: "easeOutCubic" });
|
||||
jQuery(owlElementID + " .active .caption .fadeInDown-2").stop().delay(700).animate({ opacity: 1, top: "0" }, { duration: 800, easing: "easeOutCubic" });
|
||||
jQuery(owlElementID + " .active .caption .fadeInDown-3").stop().delay(1000).animate({ opacity: 1, top: "0" }, { duration: 800, easing: "easeOutCubic" });
|
||||
}
|
||||
|
||||
function fadeInUp() {
|
||||
jQuery(owlElementID + " .active .caption .fadeInUp-1").stop().delay(500).animate({ opacity: 1, top: "0" }, { duration: 800, easing: "easeOutCubic" });
|
||||
jQuery(owlElementID + " .active .caption .fadeInUp-2").stop().delay(700).animate({ opacity: 1, top: "0" }, { duration: 800, easing: "easeOutCubic" });
|
||||
jQuery(owlElementID + " .active .caption .fadeInUp-3").stop().delay(1000).animate({ opacity: 1, top: "0" }, { duration: 800, easing: "easeOutCubic" });
|
||||
}
|
||||
|
||||
function fadeInLeft() {
|
||||
jQuery(owlElementID + " .active .caption .fadeInLeft-1").stop().delay(500).animate({ opacity: 1, left: "0" }, { duration: 800, easing: "easeOutCubic" });
|
||||
jQuery(owlElementID + " .active .caption .fadeInLeft-2").stop().delay(700).animate({ opacity: 1, left: "0" }, { duration: 800, easing: "easeOutCubic" });
|
||||
jQuery(owlElementID + " .active .caption .fadeInLeft-3").stop().delay(1000).animate({ opacity: 1, left: "0" }, { duration: 800, easing: "easeOutCubic" });
|
||||
}
|
||||
|
||||
function fadeInRight() {
|
||||
jQuery(owlElementID + " .active .caption .fadeInRight-1").stop().delay(500).animate({ opacity: 1, left: "0" }, { duration: 800, easing: "easeOutCubic" });
|
||||
jQuery(owlElementID + " .active .caption .fadeInRight-2").stop().delay(700).animate({ opacity: 1, left: "0" }, { duration: 800, easing: "easeOutCubic" });
|
||||
jQuery(owlElementID + " .active .caption .fadeInRight-3").stop().delay(1000).animate({ opacity: 1, left: "0" }, { duration: 800, easing: "easeOutCubic" });
|
||||
}
|
||||
|
||||
jQuery(owlElementID).owlCarousel({
|
||||
|
||||
autoPlay: 5000,
|
||||
stopOnHover: true,
|
||||
navigation: true,
|
||||
pagination: true,
|
||||
singleItem: true,
|
||||
addClassActive: true,
|
||||
transitionStyle: "fade",
|
||||
navigationText: ["<i class='icon fa fa-angle-left'></i>", "<i class='icon fa fa-angle-right'></i>"],
|
||||
|
||||
afterInit: function() {
|
||||
fadeIn();
|
||||
fadeInDown();
|
||||
fadeInUp();
|
||||
fadeInLeft();
|
||||
fadeInRight();
|
||||
},
|
||||
|
||||
afterMove: function() {
|
||||
fadeIn();
|
||||
fadeInDown();
|
||||
fadeInUp();
|
||||
fadeInLeft();
|
||||
fadeInRight();
|
||||
},
|
||||
|
||||
afterUpdate: function() {
|
||||
fadeIn();
|
||||
fadeInDown();
|
||||
fadeInUp();
|
||||
fadeInLeft();
|
||||
fadeInRight();
|
||||
},
|
||||
|
||||
startDragging: function() {
|
||||
dragging = true;
|
||||
},
|
||||
|
||||
afterAction: function() {
|
||||
fadeInReset();
|
||||
fadeInDownReset();
|
||||
fadeInUpReset();
|
||||
fadeInLeftReset();
|
||||
fadeInRightReset();
|
||||
dragging = false;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
if (jQuery(owlElementID).hasClass("owl-one-item")) {
|
||||
jQuery(owlElementID + ".owl-one-item").data('owlCarousel').destroy();
|
||||
}
|
||||
|
||||
jQuery(owlElementID + ".owl-one-item").owlCarousel({
|
||||
singleItem: true,
|
||||
navigation: false,
|
||||
pagination: false
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
jQuery('.home-owl-carousel').each(function(){
|
||||
|
||||
var owl = $(this);
|
||||
var itemPerLine = owl.data('item');
|
||||
if(!itemPerLine){
|
||||
itemPerLine = 5;
|
||||
}
|
||||
owl.owlCarousel({
|
||||
items : itemPerLine,
|
||||
itemsDesktop : [1199,3],
|
||||
itemsTablet:[991,2],
|
||||
navigation : true,
|
||||
pagination : false,
|
||||
|
||||
navigationText: ["", ""]
|
||||
});
|
||||
});
|
||||
|
||||
jQuery('.homepage-owl-carousel').each(function(){
|
||||
|
||||
var owl = $(this);
|
||||
var itemPerLine = owl.data('item');
|
||||
if(!itemPerLine){
|
||||
itemPerLine = 4;
|
||||
}
|
||||
owl.owlCarousel({
|
||||
items : itemPerLine,
|
||||
itemsTablet:[991,2],
|
||||
itemsDesktop : [1199,3],
|
||||
navigation : true,
|
||||
pagination : false,
|
||||
|
||||
navigationText: ["", ""]
|
||||
});
|
||||
});
|
||||
|
||||
jQuery(".blog-slider").owlCarousel({
|
||||
items : 3,
|
||||
itemsDesktopSmall :[979,2],
|
||||
itemsDesktop : [1199,3],
|
||||
navigation : true,
|
||||
slideSpeed : 300,
|
||||
pagination: false,
|
||||
navigationText: ["", ""]
|
||||
});
|
||||
|
||||
jQuery(".best-seller").owlCarousel({
|
||||
items : 3,
|
||||
navigation : true,
|
||||
itemsDesktopSmall :[979,2],
|
||||
itemsDesktop : [1199,2],
|
||||
slideSpeed : 300,
|
||||
pagination: false,
|
||||
paginationSpeed : 400,
|
||||
navigationText: ["", ""]
|
||||
});
|
||||
|
||||
jQuery(".sidebar-carousel").owlCarousel({
|
||||
items : 1,
|
||||
itemsTablet:[978,1],
|
||||
itemsDesktopSmall :[979,2],
|
||||
itemsDesktop : [1199,1],
|
||||
navigation : true,
|
||||
slideSpeed : 300,
|
||||
pagination: false,
|
||||
paginationSpeed : 400,
|
||||
navigationText: ["", ""]
|
||||
});
|
||||
|
||||
jQuery(".brand-slider").owlCarousel({
|
||||
items :6,
|
||||
navigation : true,
|
||||
slideSpeed : 300,
|
||||
pagination: false,
|
||||
paginationSpeed : 400,
|
||||
navigationText: ["", ""]
|
||||
});
|
||||
jQuery("#advertisement").owlCarousel({
|
||||
items : 1,
|
||||
itemsTablet:[978,1],
|
||||
itemsDesktopSmall :[979,1],
|
||||
itemsDesktop : [1199,1],
|
||||
navigation : true,
|
||||
slideSpeed : 300,
|
||||
pagination: true,
|
||||
paginationSpeed : 400,
|
||||
navigationText: ["", ""]
|
||||
});
|
||||
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
$(window).on('load', function(){
|
||||
|
||||
/*===================================================================================*/
|
||||
/* LAZY LOAD IMAGES USING ECHO
|
||||
/*===================================================================================*/
|
||||
|
||||
echo.init({
|
||||
offset: 100,
|
||||
throttle: 250,
|
||||
unload: false
|
||||
});
|
||||
|
||||
|
||||
/*===================================================================================*/
|
||||
/* RATING
|
||||
/*===================================================================================*/
|
||||
jQuery('.rating').rateit({max: 5, step: 1, value : 4, resetable : false , readonly : true});
|
||||
|
||||
|
||||
|
||||
/*===================================================================================*/
|
||||
/* WOW
|
||||
/*===================================================================================*/
|
||||
|
||||
WOW.init();
|
||||
|
||||
|
||||
/*===================================================================================*/
|
||||
/* TOOLTIP
|
||||
/*===================================================================================*/
|
||||
jQuery("[data-toggle='tooltip']").tooltip();
|
||||
|
||||
});
|
||||
|
||||
/*===================================================================================*/
|
||||
/* PRICE SLIDER
|
||||
/*===================================================================================*/
|
||||
jQuery(function () {
|
||||
|
||||
// Price Slider
|
||||
if (jQuery('.price-slider').length > 0) {
|
||||
jQuery('.price-slider').slider({
|
||||
min: 100,
|
||||
max: 700,
|
||||
step: 10,
|
||||
value: [200, 500],
|
||||
handle: "square"
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
/*===================================================================================*/
|
||||
/* SINGLE PRODUCT GALLERY
|
||||
/*===================================================================================*/
|
||||
jQuery(function(){
|
||||
jQuery('#owl-single-product').owlCarousel({
|
||||
items:1,
|
||||
itemsTablet:[768,3],
|
||||
itemsDesktop : [1199,1],
|
||||
itemsTablet : [992,1],
|
||||
itemsDesktopSmall : [768,3]
|
||||
|
||||
});
|
||||
|
||||
jQuery('#owl-single-product-thumbnails').owlCarousel({
|
||||
items: 4,
|
||||
pagination: true,
|
||||
rewindNav: true,
|
||||
itemsTablet : [992,4],
|
||||
itemsDesktopSmall :[768,4],
|
||||
itemsDesktop : [992,1]
|
||||
});
|
||||
|
||||
jQuery('#owl-single-product2-thumbnails').owlCarousel({
|
||||
items: 6,
|
||||
pagination: true,
|
||||
rewindNav: true,
|
||||
itemsTablet : [768, 4],
|
||||
itemsDesktop : [1199,3]
|
||||
});
|
||||
|
||||
jQuery('.single-product-slider').owlCarousel({
|
||||
stopOnHover: true,
|
||||
rewindNav: true,
|
||||
singleItem: true,
|
||||
pagination: true
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
})
|
||||
Reference in New Issue
Block a user