Skip to content
Snippets Groups Projects
Select Git revision
  • be594df6bafb3e3766eb6c620c65d205b58d6eb4
  • master default protected
  • test
  • release_10.3.0
  • feature_module_doctorant
  • feature_module_admission
  • feature_fiche_rncp
  • feature_convention_mel_template
  • release_10.2.0
  • release_10.1.1
  • feature_portfolio
  • ameliorations_index_rapporteur
  • feature_flux_diplomation
  • feature_formation_export_xls
  • feature_fichiers
  • api_inscription_admin
  • feature_module_unicaen_maintenance_mode
  • dev
  • feature_renderer_template_variables
  • feature_notif_forcage_correc
  • feature_wf_rapport_activite
  • 10.2.1
  • 10.2.0
  • 10.1.0
  • 10.0.3
  • 10.0.2
  • 10.0.1
  • 10.0.0
  • 9.4.1
  • 9.4.0
  • 9.3.1
  • 9.3.0
  • 9.2.1
  • 9.2.0
  • 9.1.1
  • 9.1.0
  • 9.0.1
  • 9.0.0
  • 8.6.0
  • 8.5.1
  • 8.5.0
41 results

README.md

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    ajout.js 1.30 KiB
    
    import {Plugin} from '../../core/ui/js/Plugin.js';
    
    const ADD_CLASS = "add";
    const DEL_CLASS = "del";
    
    class AjoutPlugin extends Plugin{
      constructor(name) {
        super(name);
      }
    
      run(){
        console.log("Plugin ajout running")
        var checkAttr = "";
        if(localStorage.
               getItem(MAX_LOCAL_STORAGE_PREFIX + ADD_CLASS) === MAX_VISIBLE_PROPERTY_STRING)
        {
          checkAttr = "checked='checked' ";
          //updates visibility
          this.on();
        }
        else{
          //updates visibility
          this.off();
         }
    
        $("#options-list").append("<li><a><input id='toggle_add' type='checkbox' "
              +checkAttr
              +" name='toggle_add'>Afficher les interventions</a></li>");
        let self = this;
        $('#toggle_add').change(function(){
          self.setExVisible()
        })
      }
    
      setExVisible(){
        if($('#toggle_add').is(":checked"))
        {
          this.on();
          localStorage.setItem(MAX_LOCAL_STORAGE_PREFIX + ADD_CLASS, MAX_VISIBLE_PROPERTY_STRING);
        }
        else{
          this.off();
          localStorage.removeItem(MAX_LOCAL_STORAGE_PREFIX + ADD_CLASS);
        }
      }
    
    
      /*ex visibles*/
      on(){
        $("." + DEL_CLASS).hide();
        $("." + ADD_CLASS).show();
      }
      /*corr hidden (sic visibles)*/
      off(){
        $("." + DEL_CLASS).show();
        $("." + ADD_CLASS).hide();
      }
    }
    
    MAX.addPlugin(new AjoutPlugin('Ajout'));