port.js (1269B)
1 function MPort(estEntrée, mPortsParent) { 2 $.extend(this, { 3 uid: singleton.uid(), 4 // Propriétés 5 entrée: true, /* entrée / sortie */ 6 nom: '', 7 description: '', 8 // ? 9 //instances: [], 10 // Parents 11 mPorts: mPortsParent, 12 // Enfants 13 //connexions: [] 14 }); 15 } 16 17 function VPort(vPortsParente, mPorts) { 18 $.extend(this, ( 19 $('#vue-port') 20 .jqote({}) 21 .toDom())); 22 23 this.bind('dragstart', function(event){ 24 $.dropManage({ mode:'intersect', filter:'.port-target' }); 25 return $('#vue-port-drag').jqote({}).appendTo('body'); 26 }); 27 28 this.bind('drag', function(event){ 29 $(event.dragProxy).position({my: 'center', at: 'center', of: event}); 30 return true; 31 }); 32 33 this.bind('dragend', function(event){ 34 $(event.dragProxy).fadeOut(); 35 }); 36 37 vPortsParente.addVPort(this, mPorts); 38 } 39 40 function CPort(mPort, vPortsParente) { 41 this.modèle = mPort; 42 this.vue = new VPort(vPortsParente, this.modèle.mPorts); 43 44 this.vue[0].droppedOn = function(destination, insertBefore) { // unsing this.vue[0] is a bit of a hack… 45 console.log("dropped on", destination, insertBefore); 46 }; 47 }