public function configureAssets(): Assets | public function configureAssets(): Assets | ||||
{ | { | ||||
$assets = parent::configureAssets(); | $assets = parent::configureAssets(); | ||||
$assets->addWebpackEncoreEntry('backend-common'); | |||||
$assets->addWebpackEncoreEntry('form'); | |||||
$assets->addWebpackEncoreEntry('adminlte-common'); | |||||
return $assets; | return $assets; | ||||
} | } |
->setProperty($propertyName) | ->setProperty($propertyName) | ||||
->setLabel($label) | ->setLabel($label) | ||||
->setTemplatePath('@LcSov/adminlte/crud/field/file.html.twig') | ->setTemplatePath('@LcSov/adminlte/crud/field/file.html.twig') | ||||
->addWebpackEncoreEntries('field-filemanager') | |||||
->addWebpackEncoreEntries('adminlte-field-filemanager') | |||||
->setFormType(FileManagerType::class) | ->setFormType(FileManagerType::class) | ||||
->addCssClass('field-text') | ->addCssClass('field-text') | ||||
->setCustomOption(self::OPTION_MAX_LENGTH, null) | ->setCustomOption(self::OPTION_MAX_LENGTH, null) |
->setTemplatePath('@LcSov/tabler/crud/field/collection.html.twig') | ->setTemplatePath('@LcSov/tabler/crud/field/collection.html.twig') | ||||
->setFormType(CollectionType::class) | ->setFormType(CollectionType::class) | ||||
->addCssClass('field-collection') | ->addCssClass('field-collection') | ||||
->addWebpackEncoreEntries('field-collection') | |||||
->addWebpackEncoreEntries('field-filemanager') | |||||
->addWebpackEncoreEntries('adminlte-field-collection') | |||||
->addWebpackEncoreEntries('adminlte-field-filemanager') | |||||
->setFormTypeOption('allow_add', true) | ->setFormTypeOption('allow_add', true) | ||||
->setFormTypeOption('allow_delete', true) | ->setFormTypeOption('allow_delete', true) | ||||
->setFormTypeOption('entry_options', array('label'=> false)) | ->setFormTypeOption('entry_options', array('label'=> false)) |
->setProperty($propertyName) | ->setProperty($propertyName) | ||||
->setLabel($label) | ->setLabel($label) | ||||
->setTemplatePath('@LcSov/adminlte/crud/field/image.html.twig') | ->setTemplatePath('@LcSov/adminlte/crud/field/image.html.twig') | ||||
->addWebpackEncoreEntries('field-filemanager') | |||||
->addWebpackEncoreEntries('adminlte-field-filemanager') | |||||
->setFormType(FileManagerType::class) | ->setFormType(FileManagerType::class) | ||||
->addCssClass('field-text') | ->addCssClass('field-text') | ||||
->setCustomOption(self::OPTION_MAX_LENGTH, null) | ->setCustomOption(self::OPTION_MAX_LENGTH, null) |
//JQUERY | |||||
// JQuery | |||||
import 'jquery'; | import 'jquery'; | ||||
global.$ = global.jQuery = $; | global.$ = global.jQuery = $; | ||||
//ADMINLTE | |||||
// Adminlte | |||||
import 'adminlte-js' ; | import 'adminlte-js' ; | ||||
//BOOTSTRAP | |||||
// Bootstrap | |||||
import 'adminlte-plugin/bootstrap/js/bootstrap.min.js'; | import 'adminlte-plugin/bootstrap/js/bootstrap.min.js'; | ||||
// SELECT 2 | |||||
// Select2 | |||||
import 'adminlte-plugin/select2/js/select2.min.js'; | import 'adminlte-plugin/select2/js/select2.min.js'; | ||||
import 'adminlte-plugin/select2/js/i18n/fr.js'; | import 'adminlte-plugin/select2/js/i18n/fr.js'; | ||||
import 'adminlte-plugin/select2/css/select2.min.css'; | import 'adminlte-plugin/select2/css/select2.min.css'; | ||||
import 'adminlte-plugin/select2-bootstrap4-theme/select2-bootstrap4.min.css'; | import 'adminlte-plugin/select2-bootstrap4-theme/select2-bootstrap4.min.css'; | ||||
// SOV CSS | |||||
// Tools | |||||
import { Tools } from '../../../tools/tools.js'; | |||||
global.Tools = Tools; | |||||
// Common | |||||
import './common.scss'; | import './common.scss'; | ||||
import './common.js' | |||||
import log from './utils/log.js'; | |||||
//log('ncnnc'); | |||||
// JAVASCRIPT | |||||
import './common.js' | |||||
//require('select2'); | |||||
//require('adminlte'); | |||||
//import 'adminltePlugin/bootstrap/js/bootstrap.min.js' | |||||
///import 'admin-lte/dist/css/adminlte.min.css' ; | |||||
//require('admin-lte-css') ; | |||||
// import './common.js' ; |
/* Tooltip */ | /* Tooltip */ | ||||
$('[data-toggle="tooltip"]').tooltip(); | $('[data-toggle="tooltip"]').tooltip(); | ||||
@import "adminlte-css"; | |||||
@import "fontawesome-css"; | |||||
@import 'scss/form/checkboxradio'; | |||||
@import 'scss/form/footer'; | |||||
@import 'scss/card'; | |||||
@import 'scss/modal'; | |||||
@import 'scss/_formchecboxradio.scss'; | |||||
@import "adminlte-css"; | |||||
@import "fontawesome-css"; | |||||
@import "scss/_formfooter.scss"; | |||||
/* card */ | |||||
.card { | .card { | ||||
&.card-table { | &.card-table { | ||||
.card-header { | .card-header { | ||||
} | } | ||||
} | } | ||||
} | } | ||||
} | |||||
/* modal */ | |||||
.modal { | |||||
.modal-body { | |||||
img { | |||||
max-width: 100% ; | |||||
} | |||||
} | |||||
} | } |
.modal { | |||||
.modal-body { | |||||
img { | |||||
max-width: 100% ; | |||||
} | |||||
} | |||||
} |
import "./form.scss" | import "./form.scss" | ||||
$(document).ready(function () { | $(document).ready(function () { | ||||
initFileManager(); | initFileManager(); | ||||
}); | }); |
/*! Generated by Font Squirrel (https://www.fontsquirrel.com) on May 17, 2021 */ | |||||
@font-face { | |||||
font-family: 'source_sans_proregular'; | |||||
src: url('fonts/sourcesanspro-regular-webfont.woff2') format('woff2'), | |||||
url('fonts/sourcesanspro-regular-webfont.woff') format('woff'); | |||||
font-weight: normal; | |||||
font-style: normal; | |||||
} | |||||
@font-face { | |||||
font-family: 'source_sans_prolight'; | |||||
src: url('fonts/sourcesanspro-light-webfont.woff2') format('woff2'), | |||||
url('fonts/sourcesanspro-light-webfont.woff') format('woff'); | |||||
font-weight: normal; | |||||
font-style: normal; | |||||
} | |||||
@font-face { | |||||
font-family: 'source_sans_prolight_italic'; | |||||
src: url('fonts/sourcesanspro-lightit-webfont.woff2') format('woff2'), | |||||
url('fonts/sourcesanspro-lightit-webfont.woff') format('woff'); | |||||
font-weight: normal; | |||||
font-style: normal; | |||||
} | |||||
@font-face { | |||||
font-family: 'source_sans_proitalic'; | |||||
src: url('fonts/sourcesanspro-it-webfont.woff2') format('woff2'), | |||||
url('fonts/sourcesanspro-it-webfont.woff') format('woff'); | |||||
font-weight: normal; | |||||
font-style: normal; | |||||
} | |||||
@font-face { | |||||
font-family: 'source_sans_proXLtIt'; | |||||
src: url('fonts/sourcesanspro-extralightit-webfont.woff2') format('woff2'), | |||||
url('fonts/sourcesanspro-extralightit-webfont.woff') format('woff'); | |||||
font-weight: normal; | |||||
font-style: normal; | |||||
} | |||||
@font-face { | |||||
font-family: 'source_sans_proextralight'; | |||||
src: url('fonts/sourcesanspro-extralight-webfont.woff2') format('woff2'), | |||||
url('fonts/sourcesanspro-extralight-webfont.woff') format('woff'); | |||||
font-weight: normal; | |||||
font-style: normal; | |||||
} | |||||
@font-face { | |||||
font-family: 'source_sans_proSBdIt'; | |||||
src: url('fonts/sourcesanspro-semiboldit-webfont.woff2') format('woff2'), | |||||
url('fonts/sourcesanspro-semiboldit-webfont.woff') format('woff'); | |||||
font-weight: normal; | |||||
font-style: normal; | |||||
} | |||||
@font-face { | |||||
font-family: 'source_sans_prosemibold'; | |||||
src: url('fonts/sourcesanspro-semibold-webfont.woff2') format('woff2'), | |||||
url('fonts/sourcesanspro-semibold-webfont.woff') format('woff'); | |||||
font-weight: normal; | |||||
font-style: normal; | |||||
} | |||||
@font-face { | |||||
font-family: 'source_sans_probold_italic'; | |||||
src: url('fonts/sourcesanspro-boldit-webfont.woff2') format('woff2'), | |||||
url('fonts/sourcesanspro-boldit-webfont.woff') format('woff'); | |||||
font-weight: normal; | |||||
font-style: normal; | |||||
} | |||||
@font-face { | |||||
font-family: 'source_sans_probold'; | |||||
src: url('fonts/sourcesanspro-bold-webfont.woff2') format('woff2'), | |||||
url('fonts/sourcesanspro-bold-webfont.woff') format('woff'); | |||||
font-weight: normal; | |||||
font-style: normal; | |||||
} | |||||
@font-face { | |||||
font-family: 'source_sans_problack_italic'; | |||||
src: url('fonts/sourcesanspro-blackit-webfont.woff2') format('woff2'), | |||||
url('fonts/sourcesanspro-blackit-webfont.woff') format('woff'); | |||||
font-weight: normal; | |||||
font-style: normal; | |||||
} | |||||
@font-face { | |||||
font-family: 'source_sans_problack'; | |||||
src: url('fonts/sourcesanspro-black-webfont.woff2') format('woff2'), | |||||
url('fonts/sourcesanspro-black-webfont.woff') format('woff'); | |||||
font-weight: normal; | |||||
font-style: normal; | |||||
} |
function arrayRemove(arr, value) { return arr.filter(function(ele){ return ele != value; });} | |||||
const scratchDiv = document.createElement('div'); | |||||
function toPlainText(html) { | |||||
scratchDiv.innerHTML = html; | |||||
return scratchDiv.textContent; | |||||
} | |||||
function getDateFormatted(date, separator) { | |||||
if(date) { | |||||
var date = new Date(date); | |||||
var _d = date.getDate(), | |||||
d = _d > 9 ? _d : '0' + _d, | |||||
_m = date.getMonth() + 1, | |||||
m = _m > 9 ? _m : '0' + _m, | |||||
formatted = d + separator + m + separator + date.getFullYear(); | |||||
return formatted; | |||||
}else{ | |||||
return ''; | |||||
} | |||||
} | |||||
var getUrlParameter = function getUrlParameter(sParam) { | |||||
var sPageURL = window.location.search.substring(1), | |||||
sURLVariables = sPageURL.split('&'), | |||||
sParameterName, | |||||
i; | |||||
for (i = 0; i < sURLVariables.length; i++) { | |||||
sParameterName = sURLVariables[i].split('='); | |||||
if (sParameterName[0] === sParam) { | |||||
return sParameterName[1] === undefined ? true : decodeURIComponent(sParameterName[1]); | |||||
} | |||||
} | |||||
}; | |||||
function indexOfFirstDigit(input) { | |||||
let i = 0; | |||||
for (; input[i] < '0' || input[i] > '9'; i++) ; | |||||
return i == input.length ? -1 : i; | |||||
} | |||||
function indexOfLastDigit(input) { | |||||
let i = input.length - 1; | |||||
for (; input[i] < '0' || input[i] > '9'; i--) ; | |||||
return i == input.length ? -1 : i; | |||||
} |
/* | |||||
* Welcome to your app's main JavaScript file! | |||||
* | |||||
* We recommend including the built version of this JavaScript file | |||||
* (and its CSS file) in your base layout (base.html.twig). | |||||
*/ | |||||
// any CSS you import will output into a single css file (app.css in this case) | |||||
//import 'adminltePlugin/bootstrap/js/bootstrap.min.js'; | |||||
//$('#test22').modal('show'); | |||||
$('#test22').modal('show'); | |||||
// start the Stimulus application |
export class Tools { | |||||
static log(value) { | |||||
try { | |||||
console.log(value) ; | |||||
} | |||||
catch {} | |||||
} | |||||
static arrayRemove(arr, value) { | |||||
return arr.filter(function(ele){ return ele != value; }); | |||||
} | |||||
static toPlainText(html) { | |||||
let scratchDiv = document.createElement('div'); | |||||
scratchDiv.innerHTML = html; | |||||
return scratchDiv.textContent; | |||||
} | |||||
static getDateFormatted(date, separator) { | |||||
if(date) { | |||||
var date = new Date(date); | |||||
var _d = date.getDate(), | |||||
d = _d > 9 ? _d : '0' + _d, | |||||
_m = date.getMonth() + 1, | |||||
m = _m > 9 ? _m : '0' + _m, | |||||
formatted = d + separator + m + separator + date.getFullYear(); | |||||
return formatted; | |||||
} | |||||
else { | |||||
return ''; | |||||
} | |||||
} | |||||
static getUrlParameter(sParam) { | |||||
var sPageURL = window.location.search.substring(1), | |||||
sURLVariables = sPageURL.split('&'), | |||||
sParameterName, | |||||
i; | |||||
for (i = 0; i < sURLVariables.length; i++) { | |||||
sParameterName = sURLVariables[i].split('='); | |||||
if (sParameterName[0] === sParam) { | |||||
return sParameterName[1] === undefined ? true : decodeURIComponent(sParameterName[1]); | |||||
} | |||||
} | |||||
} | |||||
static indexOfFirstDigit(input) { | |||||
let i = 0; | |||||
for (; input[i] < '0' || input[i] > '9'; i++) ; | |||||
return i == input.length ? -1 : i; | |||||
} | |||||
static indexOfLastDigit(input) { | |||||
let i = input.length - 1; | |||||
for (; input[i] < '0' || input[i] > '9'; i--) ; | |||||
return i == input.length ? -1 : i; | |||||
} | |||||
} |