Parcourir la source

Suppression de module js inutiles

Sangfroid il y a 8 mois
Parent
commit
5bebe2fd1d
4 fichiers modifiés avec 15 ajouts et 122 suppressions
  1. 0 9
      assets/app.js
  2. 0 90
      assets/js/addCollectionWidget.js
  3. 3 4
      package.json
  4. 12 19
      yarn.lock

+ 0 - 9
assets/app.js

@@ -5,15 +5,12 @@ import './styles/app.scss';
 import 'bootstrap';
 import './bootstrap';
 import 'font-awesome/css/font-awesome.css';
-import 'jquery-ui/themes/base/all.css';
-import 'jquery-ui/ui/widgets/autocomplete';
 import 'bootstrap-star-rating';
 import 'bootstrap-star-rating/locales/fr'
 import 'bootstrap-star-rating/js/locales/fr'
 import 'bootstrap-star-rating/css/star-rating.css';
 import 'bootstrap-star-rating/themes/krajee-fa/theme';
 import 'bootstrap-star-rating/themes/krajee-fa/theme.css';
-//import './js/addCollectionWidget';
 import './js/filtre';
 import './js/colorModeBootstrap'
 import { switchView } from './js/switchViewVanilla';
@@ -24,11 +21,5 @@ const sv = switchView("#switchview");
 const se = switchEtat ('[data-fonction="switch"]');
 
 jQuery(function() {
-    //$('.add-another-collection-widget').addCollection();
-
-    //$('[data-fonction="switch"]').switchEtat();
-
     $('[data-toggle="star-filter"]').filtreParNote();
-
-    //$('#switchview').switchView();
 })

+ 0 - 90
assets/js/addCollectionWidget.js

@@ -1,90 +0,0 @@
-(function ($) {
-    $.fn.addCollection = function() {
-        function requete(chemin, handleData) {
-            $.ajax({
-                url: chemin,
-                type: 'POST',
-                dataType: 'json',
-                success: function (reponse) {
-                    let reponseArray = parseJson(reponse);
-                    handleData(reponseArray);
-                }
-            })
-        }
-        
-        function parseJson(data) {
-            let tableau = [];
-            for (let i = 0; i < data.length; i++) {
-                let UnObjetJson = data[i];
-                let obj = JSON.parse(UnObjetJson);
-                sortie = Object.values(obj)
-                tableau.push(sortie[0]);
-            }
-            return tableau;
-        }
-
-        function addDeleteLink($prototype) {
-            // Création du lien
-            let $deleteLink = $('<button type="button" class="btn btn-outline-secondary"><i class="fa fa-trash fa-lg text-danger"></i></button>');
-    
-            // Ajout du lien
-            $prototype.find(":input").after($deleteLink);
-    
-            // Ajout du listener sur le clic du lien pour effectivement supprimer la catégorie
-            $deleteLink.on("click", function(e) {
-                $prototype.remove();
-    
-                e.preventDefault(); // évite qu'un # apparaisse dans l'URL
-                return false;
-            });
-        }
-
-        this.each(function() {
-            // Chemin pour la requête
-            var chemin = $(this).data('path');
-
-            // On récupère le fieldset pour ajouter les delete-link aux éléments existants
-            var $container = $($(this).attr("data-list-selector"));
-            $li = $container.find('li');
-            $li.each(function() {
-                if (chemin !== "") {
-                    $(this).find(':input').prop("readonly", true);
-                }
-                addDeleteLink($(this));
-            })
-      
-            $(this).on("click", function(e) {
-                e.preventDefault();
-                var list = jQuery(jQuery(this).attr('data-list-selector'));
-                // Try to find the counter of the list or use the length of the list
-                var counter = list.data('widget-counter') | list.children().length;
-
-                // grab the prototype template
-                var newWidget = list.attr('data-prototype');
-                // replace the "__name__" used in the id and name of the prototype
-                // with a number that's unique to your emails
-                // end name attribute looks like name="contact[emails][2]"
-                newWidget = newWidget.replace(/__name__/g, counter);
-                // Increase the counter
-                counter++;
-                // And store it, the length cannot be used if deleting widgets is allowed
-                list.data('widget-counter', counter);
-                // create a new list element and add it to the list
-                var newElem = jQuery(list.attr('data-widget-tags')).html(newWidget);
-                
-                if (chemin !== "") {
-                    requete (chemin, function(output) {
-                        newElem.find(':input').autocomplete({
-                            source: output
-                        });
-                    });
-                }
-                
-                addDeleteLink(newElem);
-
-                newElem.appendTo(list);
-            })
-        })
-    }
-
-})(jQuery);

+ 3 - 4
package.json

@@ -3,15 +3,14 @@
         "@babel/core": "^7.17.0",
         "@babel/preset-env": "^7.16.0",
         "@hotwired/stimulus": "^3.0.0",
-        "@popperjs/core": "^2.10.2",
+        "@popperjs/core": "^2.11.8",
         "@symfony/stimulus-bridge": "^3.2.1",
         "@symfony/webpack-encore": "^4.0.0",
         "bootstrap": "^5.3.3",
         "bootstrap-star-rating": "^4.1.2",
-        "core-js": "^3.23.0",
+        "core-js": "^3.36.1",
         "font-awesome": "^4.7.0",
-        "jquery": "^3.6.0",
-        "jquery-ui": "^1.13.0",
+        "jquery": "^3.7.1",
         "regenerator-runtime": "^0.13.9",
         "sass": "^1.55.0",
         "sass-loader": "^13.0.0",

+ 12 - 19
yarn.lock

@@ -1004,10 +1004,10 @@
     error-stack-parser "^2.0.0"
     string-width "^4.2.3"
 
-"@popperjs/core@^2.10.2":
-  version "2.11.7"
-  resolved "https://registry.yarnpkg.com/@popperjs/core/-/core-2.11.7.tgz#ccab5c8f7dc557a52ca3288c10075c9ccd37fff7"
-  integrity sha512-Cr4OjIkipTtcXKjAsm8agyleBuDHvxzeBoa1v543lbv1YaIwQjESsVcmjiWiPEbC1FIeHOG/Op9kdCmAmiS3Kw==
+"@popperjs/core@^2.11.8":
+  version "2.11.8"
+  resolved "https://registry.yarnpkg.com/@popperjs/core/-/core-2.11.8.tgz#6b79032e760a0899cd4204710beede972a3a185f"
+  integrity sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A==
 
 "@sinclair/typebox@^0.25.16":
   version "0.25.24"
@@ -1860,10 +1860,10 @@ core-js-compat@^3.25.1:
   dependencies:
     browserslist "^4.21.5"
 
-core-js@^3.23.0:
-  version "3.30.0"
-  resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.30.0.tgz#64ac6f83bc7a49fd42807327051701d4b1478dea"
-  integrity sha512-hQotSSARoNh1mYPi9O2YaWeiq/cEB95kOrFb4NCrO4RIFt1qqNpKsaE+vy/L3oiqvND5cThqXzUU3r9F7Efztg==
+core-js@^3.36.1:
+  version "3.36.1"
+  resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.36.1.tgz#c97a7160ebd00b2de19e62f4bbd3406ab720e578"
+  integrity sha512-BTvUrwxVBezj5SZ3f10ImnX2oRByMxql3EimVqMysepbC9EeMUOpLwdy6Eoili2x6E4kf+ZUB5k/+Jv55alPfA==
 
 core-util-is@~1.0.0:
   version "1.0.3"
@@ -2758,17 +2758,10 @@ jest-worker@^29.1.2:
     merge-stream "^2.0.0"
     supports-color "^8.0.0"
 
-jquery-ui@^1.13.0:
-  version "1.13.2"
-  resolved "https://registry.yarnpkg.com/jquery-ui/-/jquery-ui-1.13.2.tgz#de03580ae6604773602f8d786ad1abfb75232034"
-  integrity sha512-wBZPnqWs5GaYJmo1Jj0k/mrSkzdQzKDwhXNtHKcBdAcKVxMM3KNYFq+iJ2i1rwiG53Z8M4mTn3Qxrm17uH1D4Q==
-  dependencies:
-    jquery ">=1.8.0 <4.0.0"
-
-"jquery@>=1.8.0 <4.0.0", jquery@^3.6.0:
-  version "3.6.4"
-  resolved "https://registry.yarnpkg.com/jquery/-/jquery-3.6.4.tgz#ba065c188142100be4833699852bf7c24dc0252f"
-  integrity sha512-v28EW9DWDFpzcD9O5iyJXg3R3+q+mET5JhnjJzQUZMHOv67bpSIHq81GEYpPNZHG+XXHsfSme3nxp/hndKEcsQ==
+jquery@^3.7.1:
+  version "3.7.1"
+  resolved "https://registry.yarnpkg.com/jquery/-/jquery-3.7.1.tgz#083ef98927c9a6a74d05a6af02806566d16274de"
+  integrity sha512-m4avr8yL8kmFN8psrbFFFmB/If14iN5o9nw/NgnnM+kybDJpRsAynV2BsfpTYrTRysYUdADVD7CkUUizgkpLfg==
 
 js-tokens@^4.0.0:
   version "4.0.0"