[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Noalyss-commit] [noalyss] 05/11: Javascript : documentation avec JSDOC
From: |
dwm |
Subject: |
[Noalyss-commit] [noalyss] 05/11: Javascript : documentation avec JSDOC |
Date: |
Thu, 8 Aug 2024 14:52:16 -0400 (EDT) |
sparkyx pushed a commit to branch unstable
in repository noalyss.
commit 508e8cc051dcdaf84291254201cdc902c5a6d9e1
Author: sparkyx <danydb@noalyss.eu>
AuthorDate: Tue Aug 6 21:38:20 2024 +0200
Javascript : documentation avec JSDOC
---
html/js/acc_ledger.js | 6 ++--
html/js/accounting_item.js | 4 +++
html/js/ajax_fiche.js | 4 +--
html/js/calc.js | 7 +++--
html/js/card.js | 9 +++---
html/js/compute_direct.js | 7 +++--
html/js/gestion.js | 11 +++----
html/js/infobulle.js | 9 +++---
html/js/managetable.js | 75 +++++++++++++++++++++-------------------------
html/js/noalyss_script.js | 6 ++--
html/js/taggroup.js | 7 +++--
11 files changed, 76 insertions(+), 69 deletions(-)
diff --git a/html/js/acc_ledger.js b/html/js/acc_ledger.js
index e0055181b..d69d0bf80 100644
--- a/html/js/acc_ledger.js
+++ b/html/js/acc_ledger.js
@@ -19,9 +19,9 @@
// Copyright Author Dany De Bontridder danydb@aevalys.eu
-/*!
- * \file
- * \brief javascript script for the ledger in accountancy,
+/**
+ * @file
+ * javascript script for the ledger in accountancy,
* compute the sum, add a row at the table..
*
*/
diff --git a/html/js/accounting_item.js b/html/js/accounting_item.js
index 1a0292080..20db90d03 100644
--- a/html/js/accounting_item.js
+++ b/html/js/accounting_item.js
@@ -16,6 +16,10 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* $Revision$ */
+/**
+ * @file
+ * manage accounting
+ */
// Copyright Author Dany De Bontridder danydb@aevalys.eu
/**
diff --git a/html/js/ajax_fiche.js b/html/js/ajax_fiche.js
index be7a7a4fa..efecc0e45 100644
--- a/html/js/ajax_fiche.js
+++ b/html/js/ajax_fiche.js
@@ -18,8 +18,8 @@
/* $Revision$ */
// Copyright Author Dany De Bontridder danydb@aevalys.eu
-
-/*
+/**
+ * @file
* This file permit to use the AJAX function to fill up
* info from fiche
*
diff --git a/html/js/calc.js b/html/js/calc.js
index d62f80afa..dbc48745b 100644
--- a/html/js/calc.js
+++ b/html/js/calc.js
@@ -19,9 +19,10 @@
// Copyright Author Dany De Bontridder danydb@aevalys.eu
-/*! \file
- * \brief This file show a little online calculator, in the caller
- * the span id result, listing, the id form calc_line and the
+/**
+ * @file
+ * This file show a little online calculator, in the caller the span id
result,
+ * listing, the id form calc_line and the
*
*
*/
diff --git a/html/js/card.js b/html/js/card.js
index ad5cde65e..a3f74ad44 100644
--- a/html/js/card.js
+++ b/html/js/card.js
@@ -19,8 +19,9 @@
// Copyright Author Dany De Bontridder danydb@aevalys.eu
-/** \file
- * \brief javascript for searching a card
+/**
+ * @file
+ * javascript for searching a card
*/
var card_layer=1;
@@ -1170,7 +1171,7 @@ function
action_remove_concerned(p_dossier,p_fiche_id,p_action_id)
}
/**
* Remove a card after checking it is not used
- * @param object obj {gDossier,op,op2:rm_card,ctl,f_id}
+ * @param obj {json} = gDossier,op,op2:rm_card,ctl,f_id
*/
function delete_card(obj) {
smoke.confirm("Confirmez ? ", function (e) {
@@ -1418,4 +1419,4 @@ function save_linked_card_option(obj)
}
});
return false;
-}
\ No newline at end of file
+}
diff --git a/html/js/compute_direct.js b/html/js/compute_direct.js
index 3e2457f42..4c4f7c5bb 100644
--- a/html/js/compute_direct.js
+++ b/html/js/compute_direct.js
@@ -15,8 +15,9 @@
* along with NOALYSS; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-/*!\file
- *\brief common function for "Ecriture directe"
+/**
+ * @file
+ *common function for "Ecriture directe"
*/
/**
* Compute the sum of the debit and credit of the operation in the input
screen for misceallenous operation
@@ -112,4 +113,4 @@ function controleBalance()
smoke.alert(content[58]);
return false;
}
-}
\ No newline at end of file
+}
diff --git a/html/js/gestion.js b/html/js/gestion.js
index 4e0258ed7..0364b477b 100644
--- a/html/js/gestion.js
+++ b/html/js/gestion.js
@@ -19,8 +19,9 @@
// Copyright Author Dany De Bontridder danydb@aevalys.eu
-/*!\file
- * \brief javascript scripts for the gestion
+/**
+ * @file
+ * javascript scripts for the gestion
*
*/
@@ -28,8 +29,8 @@
/**
* remove an attached document of an action
- *@param dossier
- *@param dt_id id of the document (pk document:d_id)
+ *@param {int} dossier
+ *@param {int} dt_id id of the document (pk document:d_id)
*/
function remove_document(p_dossier,p_id)
{
@@ -460,4 +461,4 @@ function delete_filter_followup(p_dossier,filter_id)
}
}
);
-}
\ No newline at end of file
+}
diff --git a/html/js/infobulle.js b/html/js/infobulle.js
index 94e160e31..e2d054392 100644
--- a/html/js/infobulle.js
+++ b/html/js/infobulle.js
@@ -15,13 +15,14 @@
* along with NOALYSS; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-/*!\file
- * \brief create the infobulle, the internalization is not yet implemented
- * \code
+/**
+ * @file
+ * create the infobulle, the internalization is not yet implemented
+ * @code
// Example
echo JS_INFOBULLE;
echo Icon_Action::infobulle(x);
- \endcode
+ @endcode
*/
var posX=0,posY=0,offsetX=10,offsetY=10;
diff --git a/html/js/managetable.js b/html/js/managetable.js
index 4630700fb..7b522288d 100644
--- a/html/js/managetable.js
+++ b/html/js/managetable.js
@@ -16,44 +16,16 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
// Copyright Author Dany De Bontridder danydb@aevalys.eu
-
/**
- *@class ManageTable Javascript object to manage ajax calls to
+ * @class
+ * Javascript object to manage ajax calls to
* save , input or delete data row.
* The callback must
respond with a XML file , the tag status for the result
and data the HTML code to display
- *@param {string} p_table_name the data table on which we're working
- in javascript , to create an object to manipulate the table
- version.
-
- Example of code
- @code
- // Version will manage the table "version"
- var version=new ManageTable("version");
-
- // the file ajax_my.php will be called
- version.set_callback("ajax_my.php");
-
- // Add supplemental parameter to this file
- version.param_add ({"plugin_code":"OIC"};
-
- // Set the id of dialog box , table and tr prefix
- version.set_control("dialbox1");
-
- @endcode
-
-
- The answer from ajax must be like this template
- @verbatim
- <xml>
- <ctl> id of the control to update for diag.box, row </ctl>
- <status> OK , FAIL ...</status>
- <html> Html to display</html>
- </xml>
- @endverbatim
-
+
List of function
+ ====================
- set_control(p_ctl_name)
- set_callback (p_new_callback)
- param_add (json object)
@@ -61,12 +33,11 @@
- save
- delete
- input
-
How to call a function AFTER save ?
You set a function afterSaveFct like in the example, it will be trigger after
you submit the FORM
a function named afterSaveFct(r) where r is the row in HTML to display, with
a attribute ctl_pk_id which is the primary key and id of the row
- Example :
- @code
+
+ @example
document_attach_obj.afterSaveFct=function(e) {
var ctl_pk_id=e.getAttribute("ctl_pk_id");
var formData = new FormData();
@@ -76,12 +47,8 @@
xhr.open("POST", "ajax.php?p_id="+ctl_pk_id+"&do=upload_document", true);
xhr.send(formData);
}
- </script>
- @endcode
As a hidden parameter the Manage_Table:object_name must be set
- Example :
- @code
// the object_name is tbl6030ee4ee519e , in the table each row (TR) has an
attribute ctl_pk_id which is the id (primary key)
// <tr ctl_pk_id="" ...> </tr>
tbl6030ee4ee519e.afterSaveFct=function(p_param) {
@@ -89,9 +56,35 @@
console.log(this)
console.log(p_param.getAttribute(ctl_pk_id))
}
- @endcode
-
*/
+
+/**
+ * @constructor
+ * @param {string} p_table_name the data table on which we're working
+ in javascript , to create an object to manipulate the table
+ version.
+@example
+// Version will manage the table "version"
+ var version=new ManageTable("version");
+
+ // the file ajax_my.php will be called
+ version.set_callback("ajax_my.php");
+
+ // Add supplemental parameter to this file
+ version.param_add ({"plugin_code":"OIC"};
+
+ // Set the id of dialog box , table and tr prefix
+ version.set_control("dialbox1");
+
+ //The answer from ajax must be like this template
+
+ <xml>
+ <ctl> id of the control to update for diag.box, row </ctl>
+ <status> OK , FAIL ...</status>
+ <html> Html to display</html>
+ </xml>
+
+*/
var ManageTable = function (p_table_name)
{
this.callback = "ajax.php"; //!< File to call
diff --git a/html/js/noalyss_script.js b/html/js/noalyss_script.js
index b448b4b64..9e3f6a978 100644
--- a/html/js/noalyss_script.js
+++ b/html/js/noalyss_script.js
@@ -19,8 +19,9 @@
// Copyright Author Dany De Bontridder danydb@aevalys.eu
-/*!\file
- * \brief javascript script, always added to every page
+/**
+ *
+ * javascript script, always added to every page
*
*/
var ask_reload = 0;
@@ -56,6 +57,7 @@ function in_child(p_element, name_child) {
/**
* callback function when we just need to update a hidden div with an info
* message
+ * @see removeOperation , reverseOperation
*/
function infodiv(req, json) {
try {
diff --git a/html/js/taggroup.js b/html/js/taggroup.js
index b159a0f6c..b4cda684d 100644
--- a/html/js/taggroup.js
+++ b/html/js/taggroup.js
@@ -17,7 +17,10 @@
*/
// Copyright (2002-2020) Author Dany De Bontridder <danydb@noalyss.eu>
-
+/**
+ * @class
+ *
+ */
var TagGroup = function ()
{
this.callback = "ajax_misc.php";
@@ -67,4 +70,4 @@ var TagGroup = function ()
}
});
};
-};
\ No newline at end of file
+};
- [Noalyss-commit] [noalyss] branch unstable updated (65dd4e31c -> 451b9cb7c), dwm, 2024/08/08
- [Noalyss-commit] [noalyss] 03/11: GESTION : operation add receipt number, dwm, 2024/08/08
- [Noalyss-commit] [noalyss] 11/11: documentation, dwm, 2024/08/08
- [Noalyss-commit] [noalyss] 01/11: Documentation, dwm, 2024/08/08
- [Noalyss-commit] [noalyss] 07/11: CCARD : rewrite, dwm, 2024/08/08
- [Noalyss-commit] [noalyss] 04/11: CCARD : rewriting interface, code cleanup, dwm, 2024/08/08
- [Noalyss-commit] [noalyss] 08/11: new function alternate_row_color_list, dwm, 2024/08/08
- [Noalyss-commit] [noalyss] 09/11: CCARD : remove category card with confirm, remove dead code, dwm, 2024/08/08
- [Noalyss-commit] [noalyss] 05/11: Javascript : documentation avec JSDOC,
dwm <=
- [Noalyss-commit] [noalyss] 06/11: Cosmetic h1.legend, legend & fieldset, dwm, 2024/08/08
- [Noalyss-commit] [noalyss] 10/11: Fix : retrieve label from tva_code, dwm, 2024/08/08
- [Noalyss-commit] [noalyss] 02/11: Bug : fix create event from AGENDA, dwm, 2024/08/08