Browse Source

Structure webpack

tags/0.1
Guillaume 3 years ago
parent
commit
d710ee2a38
46 changed files with 97 additions and 267 deletions
  1. +1
    -2
      Controller/Admin/DashboardController.php
  2. +1
    -1
      Field/FileManagerField.php
  3. +2
    -2
      Field/GalleryManagerField.php
  4. +1
    -1
      Field/ImageManagerField.php
  5. +11
    -18
      Resources/assets/app/adminlte/common/app.common.js
  6. +1
    -0
      Resources/assets/app/adminlte/common/common.js
  7. +9
    -0
      Resources/assets/app/adminlte/common/common.scss
  8. +0
    -0
      Resources/assets/app/adminlte/common/fonts/sourcesanspro-black-webfont.woff
  9. +0
    -0
      Resources/assets/app/adminlte/common/fonts/sourcesanspro-black-webfont.woff2
  10. +0
    -0
      Resources/assets/app/adminlte/common/fonts/sourcesanspro-blackit-webfont.woff
  11. +0
    -0
      Resources/assets/app/adminlte/common/fonts/sourcesanspro-blackit-webfont.woff2
  12. +0
    -0
      Resources/assets/app/adminlte/common/fonts/sourcesanspro-bold-webfont.woff
  13. +0
    -0
      Resources/assets/app/adminlte/common/fonts/sourcesanspro-bold-webfont.woff2
  14. +0
    -0
      Resources/assets/app/adminlte/common/fonts/sourcesanspro-boldit-webfont.woff
  15. +0
    -0
      Resources/assets/app/adminlte/common/fonts/sourcesanspro-boldit-webfont.woff2
  16. +0
    -0
      Resources/assets/app/adminlte/common/fonts/sourcesanspro-extralight-webfont.woff
  17. +0
    -0
      Resources/assets/app/adminlte/common/fonts/sourcesanspro-extralight-webfont.woff2
  18. +0
    -0
      Resources/assets/app/adminlte/common/fonts/sourcesanspro-extralightit-webfont.woff
  19. +0
    -0
      Resources/assets/app/adminlte/common/fonts/sourcesanspro-extralightit-webfont.woff2
  20. +0
    -0
      Resources/assets/app/adminlte/common/fonts/sourcesanspro-it-webfont.woff
  21. +0
    -0
      Resources/assets/app/adminlte/common/fonts/sourcesanspro-it-webfont.woff2
  22. +0
    -0
      Resources/assets/app/adminlte/common/fonts/sourcesanspro-light-webfont.woff
  23. +0
    -0
      Resources/assets/app/adminlte/common/fonts/sourcesanspro-light-webfont.woff2
  24. +0
    -0
      Resources/assets/app/adminlte/common/fonts/sourcesanspro-lightit-webfont.woff
  25. +0
    -0
      Resources/assets/app/adminlte/common/fonts/sourcesanspro-lightit-webfont.woff2
  26. +0
    -0
      Resources/assets/app/adminlte/common/fonts/sourcesanspro-regular-webfont.woff
  27. +0
    -0
      Resources/assets/app/adminlte/common/fonts/sourcesanspro-regular-webfont.woff2
  28. +0
    -0
      Resources/assets/app/adminlte/common/fonts/sourcesanspro-semibold-webfont.woff
  29. +0
    -0
      Resources/assets/app/adminlte/common/fonts/sourcesanspro-semibold-webfont.woff2
  30. +0
    -0
      Resources/assets/app/adminlte/common/fonts/sourcesanspro-semiboldit-webfont.woff
  31. +0
    -0
      Resources/assets/app/adminlte/common/fonts/sourcesanspro-semiboldit-webfont.woff2
  32. +0
    -14
      Resources/assets/app/adminlte/common/scss/_card.scss
  33. +9
    -0
      Resources/assets/app/adminlte/common/scss/_modal.scss
  34. +0
    -0
      Resources/assets/app/adminlte/common/scss/form/_checkboxradio.scss
  35. +0
    -0
      Resources/assets/app/adminlte/common/scss/form/_footer.scss
  36. +0
    -0
      Resources/assets/app/adminlte/common/utils/log.js
  37. +0
    -0
      Resources/assets/app/adminlte/field/collection/app.collection.js
  38. +0
    -0
      Resources/assets/app/adminlte/field/collection/form.scss
  39. +0
    -1
      Resources/assets/app/adminlte/field/filemanager/app.filemanager.js
  40. +0
    -0
      Resources/assets/app/adminlte/field/filemanager/form.scss
  41. +0
    -144
      Resources/assets/apps/backend-common/_fonts.scss
  42. +0
    -50
      Resources/assets/apps/backend-common/utils.js
  43. +0
    -16
      Resources/assets/apps/form/app.form.js
  44. +0
    -9
      Resources/assets/apps/form/form.js
  45. +0
    -9
      Resources/assets/apps/form/form.scss
  46. +62
    -0
      Resources/assets/tools/tools.js

+ 1
- 2
Controller/Admin/DashboardController.php View File

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;
} }

+ 1
- 1
Field/FileManagerField.php View File

->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)

+ 2
- 2
Field/GalleryManagerField.php View File

->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))

+ 1
- 1
Field/ImageManagerField.php View File

->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)

Resources/assets/apps/backend-common/app.common.js → Resources/assets/app/adminlte/common/app.common.js View File




//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' ;

Resources/assets/apps/backend-common/common.js → Resources/assets/app/adminlte/common/common.js View File


/* Tooltip */ /* Tooltip */
$('[data-toggle="tooltip"]').tooltip(); $('[data-toggle="tooltip"]').tooltip();



+ 9
- 0
Resources/assets/app/adminlte/common/common.scss View File


@import "adminlte-css";
@import "fontawesome-css";
@import 'scss/form/checkboxradio';
@import 'scss/form/footer';
@import 'scss/card';
@import 'scss/modal';



Resources/assets/apps/backend-common/fonts/sourcesanspro-black-webfont.woff → Resources/assets/app/adminlte/common/fonts/sourcesanspro-black-webfont.woff View File


Resources/assets/apps/backend-common/fonts/sourcesanspro-black-webfont.woff2 → Resources/assets/app/adminlte/common/fonts/sourcesanspro-black-webfont.woff2 View File


Resources/assets/apps/backend-common/fonts/sourcesanspro-blackit-webfont.woff → Resources/assets/app/adminlte/common/fonts/sourcesanspro-blackit-webfont.woff View File


Resources/assets/apps/backend-common/fonts/sourcesanspro-blackit-webfont.woff2 → Resources/assets/app/adminlte/common/fonts/sourcesanspro-blackit-webfont.woff2 View File


Resources/assets/apps/backend-common/fonts/sourcesanspro-bold-webfont.woff → Resources/assets/app/adminlte/common/fonts/sourcesanspro-bold-webfont.woff View File


Resources/assets/apps/backend-common/fonts/sourcesanspro-bold-webfont.woff2 → Resources/assets/app/adminlte/common/fonts/sourcesanspro-bold-webfont.woff2 View File


Resources/assets/apps/backend-common/fonts/sourcesanspro-boldit-webfont.woff → Resources/assets/app/adminlte/common/fonts/sourcesanspro-boldit-webfont.woff View File


Resources/assets/apps/backend-common/fonts/sourcesanspro-boldit-webfont.woff2 → Resources/assets/app/adminlte/common/fonts/sourcesanspro-boldit-webfont.woff2 View File


Resources/assets/apps/backend-common/fonts/sourcesanspro-extralight-webfont.woff → Resources/assets/app/adminlte/common/fonts/sourcesanspro-extralight-webfont.woff View File


Resources/assets/apps/backend-common/fonts/sourcesanspro-extralight-webfont.woff2 → Resources/assets/app/adminlte/common/fonts/sourcesanspro-extralight-webfont.woff2 View File


Resources/assets/apps/backend-common/fonts/sourcesanspro-extralightit-webfont.woff → Resources/assets/app/adminlte/common/fonts/sourcesanspro-extralightit-webfont.woff View File


Resources/assets/apps/backend-common/fonts/sourcesanspro-extralightit-webfont.woff2 → Resources/assets/app/adminlte/common/fonts/sourcesanspro-extralightit-webfont.woff2 View File


Resources/assets/apps/backend-common/fonts/sourcesanspro-it-webfont.woff → Resources/assets/app/adminlte/common/fonts/sourcesanspro-it-webfont.woff View File


Resources/assets/apps/backend-common/fonts/sourcesanspro-it-webfont.woff2 → Resources/assets/app/adminlte/common/fonts/sourcesanspro-it-webfont.woff2 View File


Resources/assets/apps/backend-common/fonts/sourcesanspro-light-webfont.woff → Resources/assets/app/adminlte/common/fonts/sourcesanspro-light-webfont.woff View File


Resources/assets/apps/backend-common/fonts/sourcesanspro-light-webfont.woff2 → Resources/assets/app/adminlte/common/fonts/sourcesanspro-light-webfont.woff2 View File


Resources/assets/apps/backend-common/fonts/sourcesanspro-lightit-webfont.woff → Resources/assets/app/adminlte/common/fonts/sourcesanspro-lightit-webfont.woff View File


Resources/assets/apps/backend-common/fonts/sourcesanspro-lightit-webfont.woff2 → Resources/assets/app/adminlte/common/fonts/sourcesanspro-lightit-webfont.woff2 View File


Resources/assets/apps/backend-common/fonts/sourcesanspro-regular-webfont.woff → Resources/assets/app/adminlte/common/fonts/sourcesanspro-regular-webfont.woff View File


Resources/assets/apps/backend-common/fonts/sourcesanspro-regular-webfont.woff2 → Resources/assets/app/adminlte/common/fonts/sourcesanspro-regular-webfont.woff2 View File


Resources/assets/apps/backend-common/fonts/sourcesanspro-semibold-webfont.woff → Resources/assets/app/adminlte/common/fonts/sourcesanspro-semibold-webfont.woff View File


Resources/assets/apps/backend-common/fonts/sourcesanspro-semibold-webfont.woff2 → Resources/assets/app/adminlte/common/fonts/sourcesanspro-semibold-webfont.woff2 View File


Resources/assets/apps/backend-common/fonts/sourcesanspro-semiboldit-webfont.woff → Resources/assets/app/adminlte/common/fonts/sourcesanspro-semiboldit-webfont.woff View File


Resources/assets/apps/backend-common/fonts/sourcesanspro-semiboldit-webfont.woff2 → Resources/assets/app/adminlte/common/fonts/sourcesanspro-semiboldit-webfont.woff2 View File


Resources/assets/apps/backend-common/common.scss → Resources/assets/app/adminlte/common/scss/_card.scss View File

@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% ;
}
}
} }

+ 9
- 0
Resources/assets/app/adminlte/common/scss/_modal.scss View File



.modal {
.modal-body {
img {
max-width: 100% ;
}
}
}

Resources/assets/apps/backend-common/scss/_formchecboxradio.scss → Resources/assets/app/adminlte/common/scss/form/_checkboxradio.scss View File


Resources/assets/apps/backend-common/scss/_formfooter.scss → Resources/assets/app/adminlte/common/scss/form/_footer.scss View File


Resources/assets/apps/backend-common/utils/log.js → Resources/assets/app/adminlte/common/utils/log.js View File


Resources/assets/fields/collection/app.field-collection.js → Resources/assets/app/adminlte/field/collection/app.collection.js View File


Resources/assets/fields/collection/form.scss → Resources/assets/app/adminlte/field/collection/form.scss View File


Resources/assets/fields/filemanager/app.field-filemanager.js → Resources/assets/app/adminlte/field/filemanager/app.filemanager.js View File



import "./form.scss" import "./form.scss"



$(document).ready(function () { $(document).ready(function () {
initFileManager(); initFileManager();
}); });

Resources/assets/fields/filemanager/form.scss → Resources/assets/app/adminlte/field/filemanager/form.scss View File


+ 0
- 144
Resources/assets/apps/backend-common/_fonts.scss View File

/*! 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;

}

+ 0
- 50
Resources/assets/apps/backend-common/utils.js View File


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;
}

+ 0
- 16
Resources/assets/apps/form/app.form.js View File

/*
* 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

+ 0
- 9
Resources/assets/apps/form/form.js
File diff suppressed because it is too large
View File


+ 0
- 9
Resources/assets/apps/form/form.scss
File diff suppressed because it is too large
View File


+ 62
- 0
Resources/assets/tools/tools.js View File


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;
}
}

Loading…
Cancel
Save