minmod
This commit is contained in:
parent
1ba67b9175
commit
d4295d08c2
|
@ -18,7 +18,7 @@
|
|||
function sociogramClass(container){
|
||||
this.container = container;
|
||||
this.log('sociogram created');
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -122,7 +122,7 @@ sociogramClass.prototype.load = function(){
|
|||
thisPtr.log(response);
|
||||
|
||||
// Si erreur, on quitte
|
||||
if( response.ModuleError != 0 ) return;
|
||||
if( response.ModuleError !== 0 ) return;
|
||||
|
||||
// On enregistre la réponse
|
||||
thisPtr.response = response;
|
||||
|
@ -204,10 +204,9 @@ sociogramClass.prototype.load = function(){
|
|||
sociogramClass.prototype.nodeAt = function(x, y){
|
||||
var nodes = this.sigma.graph.nodes();
|
||||
var minDistance = null;
|
||||
|
||||
for( nodeId in nodes ){
|
||||
for( var nodeId in nodes ){
|
||||
var distance = Math.sqrt( Math.pow(x-nodes[nodeId].x, 2) + Math.pow(y-nodes[nodeId].y, 2) );
|
||||
if( minDistance == null || distance < minDistance )
|
||||
if( minDistance === null || distance < minDistance )
|
||||
minDistance = distance;
|
||||
}
|
||||
|
||||
|
@ -232,9 +231,9 @@ sociogramClass.prototype.arrange = function(nodeId, pos, alone){
|
|||
var node = this.sigma.graph.nodes(nodeId);
|
||||
|
||||
// Si le noeud est deja place, on ne fais rien
|
||||
if( node.x != 0 || node.y != 0 ) return;
|
||||
if( node.x !== 0 || node.y !== 0 ) return;
|
||||
|
||||
var pos = (pos==null) ? {x: node.x, y: node.y} : pos; // On recupere la position
|
||||
pos = (pos===null) ? {x: node.x, y: node.y} : pos; // On recupere la position
|
||||
|
||||
// Tant que le noeud est trop proche d'un autre, on l'eloigne
|
||||
// UNIQUEMENT si alone n'est pas NULL
|
||||
|
@ -263,7 +262,7 @@ sociogramClass.prototype.arrange = function(nodeId, pos, alone){
|
|||
|
||||
|
||||
var neighborsCount = 0;
|
||||
for( neighborId in neighborsId ){
|
||||
for( var neighborId in neighborsId ){
|
||||
neighbors[neighborId] = this.sigma.graph.nodes(neighborId);
|
||||
neighborsCount++;
|
||||
}
|
||||
|
@ -279,7 +278,7 @@ sociogramClass.prototype.arrange = function(nodeId, pos, alone){
|
|||
for( neighborId in neighbors ){
|
||||
var current = this.sigma.graph.nodes(neighborId);
|
||||
// Si n'est pas deja positionne
|
||||
if( current.x == 0 && current.y == 0 ){
|
||||
if( current.x === 0 && current.y === 0 ){
|
||||
// On cherche un angle tant qu'il est pas trop pres d'un deja pris
|
||||
var angle, alreadyUsed = false;
|
||||
do{
|
||||
|
@ -322,14 +321,14 @@ sociogramClass.prototype.overload.nodeNeighbors = function(nodeId){
|
|||
|
||||
// Pile des voisins pour lesquels il faut chercher leurs voisins
|
||||
var stack = [];
|
||||
for( neighborId in neighbors ) stack.push(neighborId);
|
||||
for( var neighborId in neighbors ) stack.push(neighborId);
|
||||
|
||||
// Tant qu'il reste des voisins a trouver
|
||||
while( stack.length > 0 ){
|
||||
var subneighbors = this.allNeighborsIndex[stack[0]];
|
||||
for( subId in subneighbors )
|
||||
for( var subId in subneighbors )
|
||||
// Si le voisin est pas deja dans la liste/pile, on l'ajoute a la liste des voisins
|
||||
if( neighbors[subId] == null ){
|
||||
if( neighbors[subId] === null ){
|
||||
stack.push(subId); // On ajoute a la pile
|
||||
neighbors[subId] = subneighbors[subId]; // On ajoute a la liste complete
|
||||
}
|
||||
|
@ -456,7 +455,7 @@ sociogramClass.prototype.bindings.clickNode = function(thisPtr, e){
|
|||
neighborNodes[nodeId] = e.data.node; // on ajoute le noeud clique
|
||||
|
||||
thisPtr.sigma.graph.nodes().forEach(function(n) {
|
||||
if( neighborNodes[n.id] != null ) n.color = n.originalColor;
|
||||
if( neighborNodes[n.id] !== null ) n.color = n.originalColor;
|
||||
else n.color = '#eee';
|
||||
});
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
/* */
|
||||
/***************************************/
|
||||
|
||||
function pageManagerClass(){};
|
||||
function pageManagerClass(){}
|
||||
|
||||
var ptrPageManagerClass; // pointeur global pour l'utilisation de fonctions de fonctions
|
||||
|
||||
|
@ -276,4 +276,4 @@ pageManagerClass.prototype = {
|
|||
return this;
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
|
|
|
@ -72,7 +72,7 @@
|
|||
|
||||
/* (2) On enregistre le contact dans l'annuaire s'il y est pas déjà */
|
||||
if( !isset($phone_directory[$number]) )
|
||||
$phone_directory[$number] = strlen($log['Name']) ? $log['Name'] : null;
|
||||
$phone_directory[$number] = strlen($log['Name']) ? (string) $log['Name'] : null;
|
||||
|
||||
/* (3) On complète le log */
|
||||
$phone_log = array(
|
||||
|
|
10
view.php
10
view.php
|
@ -25,13 +25,13 @@
|
|||
|
||||
|
||||
<!-- Dépendences Javascript -->
|
||||
<script type='text/javascript' src='/f/js/input-checker/js/lib' ></script> <!-- Gestion dynamique des saisies -->
|
||||
<script type='text/javascript' src='/f/js/reset/js/lib' ></script> <!-- Corrections Javascript natif (ajouts) -->
|
||||
<script type='text/javascript' src='/f/js/api/js/lib' ></script> <!-- Gestion des transactions avec le serveur -->
|
||||
<script type='text/javascript' src='/f/js/page-manager/js/lib' ></script> <!-- Gestion réseau/chargement/liens/URL -->
|
||||
<script type='text/javascript' src='/f/js/input-checker/js/lib' ></script> <!-- Gestion dynamique des saisies -->
|
||||
<script type='text/javascript' src='/f/js/reset/js/lib' ></script> <!-- Corrections Javascript natif (ajouts) -->
|
||||
<script type='text/javascript' src='/f/js/api/js/lib' ></script> <!-- Gestion des transactions avec le serveur -->
|
||||
<script type='text/javascript' src='/f/js/page-manager/js/lib' ></script> <!-- Gestion réseau/chargement/liens/URL -->
|
||||
|
||||
<!-- Librairies Externes Javascript -->
|
||||
<script type='text/javascript' src='/f/js/sigma-min/sigma' ></script> <!-- Gestion du graphique de type réseau -->
|
||||
<script type='text/javascript' src='/f/js/sigma-min/sigma' ></script> <!-- Gestion du graphique de type réseau -->
|
||||
<!-- <script type='text/javascript' src='/f/js/sigma-plugins-animate-min/sigma/plugins' ></script> for animations -->
|
||||
</head>
|
||||
<body>
|
||||
|
|
Loading…
Reference in New Issue