qsos-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qsos-commits] qsos/apps/xuleditor/chrome/content Document.js ...


From: Raphaël Semeteys
Subject: [Qsos-commits] qsos/apps/xuleditor/chrome/content Document.js ...
Date: Mon, 22 May 2006 06:22:12 +0000

CVSROOT:        /sources/qsos
Module name:    qsos
Branch:         
Changes by:     Raphaël Semeteys <address@hidden>      06/05/22 06:22:12

Modified files:
        apps/xuleditor/chrome/content: Document.js editor.js 

Log message:
        Comments

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/qsos/qsos/apps/xuleditor/chrome/content/Document.js.diff?tr1=1.6&tr2=1.7&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/qsos/qsos/apps/xuleditor/chrome/content/editor.js.diff?tr1=1.6&tr2=1.7&r1=text&r2=text

Patches:
Index: qsos/apps/xuleditor/chrome/content/Document.js
diff -u qsos/apps/xuleditor/chrome/content/Document.js:1.6 
qsos/apps/xuleditor/chrome/content/Document.js:1.7
--- qsos/apps/xuleditor/chrome/content/Document.js:1.6  Mon May 22 00:25:46 2006
+++ qsos/apps/xuleditor/chrome/content/Document.js      Mon May 22 06:22:12 2006
@@ -562,6 +562,7 @@
     // Chart functions
     ////////////////////////////////////////////////////////////////////
 
+    //Returns the name of a criterion's parent
     function getChartDataParent(name) {
        var node = sheet.evaluate("//address@hidden'"+name+"']", sheet, null, 
XPathResult.ANY_TYPE,null).iterateNext();
        if (node) {
@@ -572,6 +573,12 @@
        }
     }
 
+    //Returns the scored criteria of QSOS document
+    //Returned object: array of chartData
+    //         chartData.name: name of the subcriterion
+    //         chartData.title: title of the subcriterion
+    //         chartData.children: null or array of chartData representing the 
subcriterion's subcritria
+    //         chartData.score: score of the subcriterion (mean value of 
subcriretia)
     function getChartData() {
        var chartData = new Array();
        var sections = sheet.evaluate("//section", sheet, null, 
XPathResult.ANY_TYPE,null);
@@ -588,6 +595,12 @@
        return chartData;
     }
 
+    //Recursive function returning the scored subcriteria of a criteria
+    //Returned object: array of chartData
+    //         chartData.name: name of the subcriterion
+    //         chartData.title: title of the subcriterion
+    //         chartData.children: null or array of chartData representing the 
subcriterion's subcritria
+    //         chartData.score: score of the subcriterion
     function getSubChartData(name) {
        var chartData = new Array();
        var elements = sheet.evaluate("//address@hidden'"+name+"']/element", 
sheet, null, XPathResult.ANY_TYPE,null);
@@ -615,6 +628,12 @@
        return chartData;
     }
     
+    //Renders the value of a criterion based on its subecriteria's values
+    //chartData: object representing the criterion
+    //         chartData.name: name of the subcriterion
+    //         chartData.title: title of the subcriterion
+    //         chartData.children: null or array of chartData representing the 
subcriterion's subcritria
+    //         chartData.score: score of the subcriterion
     function renderScore(chartData) {
        var score = 0;
        var sum = 0;
Index: qsos/apps/xuleditor/chrome/content/editor.js
diff -u qsos/apps/xuleditor/chrome/content/editor.js:1.6 
qsos/apps/xuleditor/chrome/content/editor.js:1.7
--- qsos/apps/xuleditor/chrome/content/editor.js:1.6    Mon May 22 00:25:46 2006
+++ qsos/apps/xuleditor/chrome/content/editor.js        Mon May 22 06:22:12 2006
@@ -451,7 +451,7 @@
 // SVG Chart functions
 ////////////////////////////////////////////////////////////////////
 
-const SCALE = 100;
+const SCALE = 100; //1 QSOS unit in pixels
 const FONT_SIZE = SCALE/10;
 
 //Clear the SVG chart
@@ -511,6 +511,8 @@
        myChart.appendChild(myPath);
 }
 
+//Add the root label of the chart navigation bar
+//marker: label before which the new label is to be inserted, can be null
 function addFirstLabel(marker) {
        var label = document.getElementById("chart-label");
        var newLabel = document.createElement("label");
@@ -528,6 +530,7 @@
        return newLabel;
 }
 
+//Add a label to the chart navigation bar
 function addLabel(name, marker) {
        var label = document.getElementById("chart-label");
        var newLabel = document.createElement("label");
@@ -545,6 +548,7 @@
        return newLabel;
 }
 
+//Clear all labels
 function clearLabels() {
        var label = document.getElementById("chart-label");
        while (label.firstChild) {




reply via email to

[Prev in Thread] Current Thread [Next in Thread]