aotrautils 0.0.1022 → 0.0.1024

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
 
2
2
 
3
- /*utils COMMONS library associated with aotra version : «1_29072022-2359 (23/06/2024-01:36:32)»*/
3
+ /*utils COMMONS library associated with aotra version : «1_29072022-2359 (23/06/2024-01:46:10)»*/
4
4
  /*-----------------------------------------------------------------------------*/
5
5
 
6
6
 
@@ -5359,7 +5359,7 @@ AOTRAUTILS_LIB_IS_LOADED=true;
5359
5359
 
5360
5360
 
5361
5361
 
5362
- /*utils CLIENT library associated with aotra version : «1_29072022-2359 (23/06/2024-01:36:32)»*/
5362
+ /*utils CLIENT library associated with aotra version : «1_29072022-2359 (23/06/2024-01:46:10)»*/
5363
5363
  /*-----------------------------------------------------------------------------*/
5364
5364
  /* ## Utility global methods in a browser (htmljs) client environment.
5365
5365
  *
@@ -11199,6 +11199,8 @@ function promptWindow(label,type=null,defaultValue=null,
11199
11199
  doOnOK=null,doOnCancel=null,
11200
11200
  config={displayMode:"popup",backgroundColor1:"#B3DCED",font:"helvetica",width:"80%",height:"80%"}){
11201
11201
 
11202
+ // NO TYPE = simple alert
11203
+
11202
11204
  const LABEL_AND_DEFAULT_VALUE_SEPARATOR=":";
11203
11205
  const MAX_Z_INDEX_OVERLAY_LOCAL=9999;// (Repeated because must be stand-alone constant...)
11204
11206
  const promptWindowWidth=(config && config.width?config.width:"80%");
@@ -11568,7 +11570,7 @@ function promptWindow(label,type=null,defaultValue=null,
11568
11570
  }
11569
11571
 
11570
11572
 
11571
- } else if(type==="yesno"){ // Case yes/no
11573
+ } else if(!type || type==="yesno"){ // Case no type or yes/no
11572
11574
 
11573
11575
  // We redefine the global function used to retrieve entered value :
11574
11576
  getGlobalResultValue=function(){
@@ -11595,21 +11597,23 @@ function promptWindow(label,type=null,defaultValue=null,
11595
11597
  // inputElements[inputElements.length - 1].focus();
11596
11598
 
11597
11599
  // This button is displayed in all cases :
11598
- let buttonCancel=document.createElement("button");
11599
- buttonCancel.innerHTML="Cancel";
11600
- buttonCancel.style="display:block;float:right;";
11601
- resultPromiseCancel=new Promise((resolve, reject)=>{
11602
- buttonCancel.onclick=function(){
11603
- let promptedValue=getGlobalResultValue();
11604
- if(doOnCancel){
11605
- const doOnCancelResult=doOnCancel(promptedValue);
11606
- resolve({value:promptedValue,result:doOnCancelResult});
11607
- }
11608
- closeWindow();
11609
- };
11610
- });
11611
- divWindow.appendChild(buttonCancel);
11612
-
11600
+ // except if we have no type meaning simple alert :
11601
+ if(type){
11602
+ let buttonCancel=document.createElement("button");
11603
+ buttonCancel.innerHTML="Cancel";
11604
+ buttonCancel.style="display:block;float:right;";
11605
+ resultPromiseCancel=new Promise((resolve, reject)=>{
11606
+ buttonCancel.onclick=function(){
11607
+ let promptedValue=getGlobalResultValue();
11608
+ if(doOnCancel){
11609
+ const doOnCancelResult=doOnCancel(promptedValue);
11610
+ resolve({value:promptedValue,result:doOnCancelResult});
11611
+ }
11612
+ closeWindow();
11613
+ };
11614
+ });
11615
+ divWindow.appendChild(buttonCancel);
11616
+ }
11613
11617
 
11614
11618
 
11615
11619
  // We hide this OK button, when we are in a "radio-image" unique selection case,
@@ -13570,7 +13574,7 @@ createOritaMicroClient=function(url, port, isNode=false, staticMicroClientIdPara
13570
13574
 
13571
13575
 
13572
13576
 
13573
- /*utils GEOMETRY library associated with aotra version : «1_29072022-2359 (23/06/2024-01:36:32)»*/
13577
+ /*utils GEOMETRY library associated with aotra version : «1_29072022-2359 (23/06/2024-01:46:10)»*/
13574
13578
  /*-----------------------------------------------------------------------------*/
13575
13579
 
13576
13580
 
@@ -14809,7 +14813,7 @@ function rayVsUnitSphereClosestPoint(p, r) {
14809
14813
  // MUST REMAIN AT THE END OF THIS LIBRARY FILE !
14810
14814
 
14811
14815
  AOTRAUTILS_GEOMETRY_LIB_IS_LOADED=true;
14812
- /*utils SERVER library associated with aotra version : «1_29072022-2359 (23/06/2024-01:36:32)»*/
14816
+ /*utils SERVER library associated with aotra version : «1_29072022-2359 (23/06/2024-01:46:10)»*/
14813
14817
  /*-----------------------------------------------------------------------------*/
14814
14818
 
14815
14819
 
aotrautils/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aotrautils",
3
- "version": "0.0.1022",
3
+ "version": "0.0.1024",
4
4
  "main": "aotrautils.build.js",
5
5
  "description": "A library for vanilla javascript utils (client-side) used in aotra javascript CMS",
6
6
  "author": "Jeremie Ratomposon <info@alqemia.com> (https://alqemia.com)",