www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

definition.js (1599B)


      1 function MDéfinition() {
      2     $.extend(this, {
      3         uid: singleton.uid(),
      4         // Propriétés
      5         nom: "Nouvelle définition",
      6         type: null,
      7         //description: '',
      8         // Parents
      9         bloc: null,
     10         // Enfants
     11         connexions: [],
     12         instancesBloc: [],
     13         // Ajout
     14         ajouterInstanceBloc: function(ib) {
     15             ib.définition = this;
     16             this.instancesBloc.push(ib);
     17             faireCallbacks(this.cbAjoutInstanceBloc, ib);
     18         },
     19         ajouterConnexion: function(c) {
     20             c.définition = this;
     21             this.connexion.push(c);
     22         },
     23         cbAjoutInstanceBloc: [],
     24         onAjoutInstanceBloc: function(callback) {
     25             this.cbAjoutInstanceBloc.push(callback);
     26         }
     27     });
     28 }
     29 
     30 function VDéfinition(vDéfinitionsParente) {
     31     $.extend(this,(
     32         $('#vue-définition')
     33             .jqote({})
     34             .toDom()));
     35     this.vTitre = $('#vue-définition-titre').jqote({});
     36     vDéfinitionsParente.ajoutVDéfinition(this.vTitre, this);
     37 }
     38 
     39 function CDéfinition(mDéfinition, vDéfinitionsParente) {
     40     this.modèle = mDéfinition;
     41     this.vue = new VDéfinition(vDéfinitionsParente);
     42     
     43     var that = this;
     44     this.vue.zonable({
     45         start: function() {
     46         },
     47         zone: function() {
     48         },
     49         end: function(start, end, rect) {
     50             that.modèle.bloc.monde.outilZone(that, rect, getRectangle(that.vue));
     51         }
     52     });
     53     
     54     this.modèle.onAjoutInstanceBloc(function(instanceBloc) {
     55         var cib = new CInstanceBloc(instanceBloc, that.vue);
     56     });
     57 }