aotrautils 0.0.69 → 0.0.72

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 CLIENT library associated with aotra version : «1.0.0.000 (13/07/2022-02:14:34)»*/
3
+ /*utils CLIENT library associated with aotra version : «1.0.0.000 (13/07/2022-02:25:54)»*/
4
4
  /*-----------------------------------------------------------------------------*/
5
5
  /* ## Utility global methods in a browser (htmljs) client environment.
6
6
  *
@@ -6850,7 +6850,7 @@ createFusrodaClient=function(doOnClientReady, doOnDataReception, urlParam=null,
6850
6850
 
6851
6851
 
6852
6852
 
6853
- /*utils GEOMETRY library associated with aotra version : «1.0.0.000 (13/07/2022-02:14:34)»*/
6853
+ /*utils GEOMETRY library associated with aotra version : «1.0.0.000 (13/07/2022-02:25:54)»*/
6854
6854
  /*-----------------------------------------------------------------------------*/
6855
6855
 
6856
6856
 
@@ -8056,7 +8056,7 @@ function rayVsUnitSphereClosestPoint(p, r) {
8056
8056
  // MUST REMAIN AT THE END OF THIS LIBRARY FILE !
8057
8057
 
8058
8058
  AOTRAUTILS_GEOMETRY_LIB_IS_LOADED=true;
8059
- /*utils SERVER library associated with aotra version : «1.0.0.000 (13/07/2022-02:14:34)»*/
8059
+ /*utils SERVER library associated with aotra version : «1.0.0.000 (13/07/2022-02:25:54)»*/
8060
8060
  /*-----------------------------------------------------------------------------*/
8061
8061
 
8062
8062
 
@@ -8285,15 +8285,16 @@ WebsocketImplementation={
8285
8285
  // https://stackoverflow.com/questions/6599470/node-js-socket-io-with-ssl
8286
8286
  // https://nodejs.org/api/https.html#https_https_createserver_options_requestlistener
8287
8287
 
8288
- if(typeof(socketIO)==="undefined"){
8288
+ const globalContext=(WebsocketImplementation.isNodeContext?global:window);
8289
+ if(typeof(globalContext.socketIO)==="undefined"){
8289
8290
  // TRACE
8290
8291
  lognow("«socket.io» SERVER library not called yet, calling it now.");
8291
- socketIO=require("socket.io");
8292
+ globalContext.socketIO=require("socket.io");
8292
8293
  // TRACE
8293
- lognow("«socket.io» SERVER library called.");
8294
+ lognow("«socket.io» SERVER library called:",globalContext.socketIO);
8294
8295
 
8295
8296
  }
8296
- if(typeof(socketIO)==="undefined"){
8297
+ if(typeof(globalContext.socketIO)==="undefined"){
8297
8298
  // Exception
8298
8299
  throw "ERROR : «socket.io» SERVER library not found. Cannot launch nodejs server. Aborting.";
8299
8300
  }
@@ -8341,13 +8342,14 @@ WebsocketImplementation={
8341
8342
  serverSocket=new WebSocket.Server({ "server":listenableServer });
8342
8343
  }else{
8343
8344
 
8344
-
8345
+ const globalContext=(WebsocketImplementation.isNodeContext?global:window);
8346
+
8345
8347
  // DBG
8346
- console.log(">>>>>>>socketIO:",JSON.stringify(socketIO));
8348
+ console.log(">>>>>>>socketIO:",JSON.stringify(globalContext.socketIO));
8347
8349
 
8348
8350
  // NOW : socket.io :
8349
8351
  // Loading socket.io
8350
- serverSocket=socketIO.listen(listenableServer);
8352
+ serverSocket=globalContext.socketIO.listen(listenableServer);
8351
8353
 
8352
8354
  // Setting up the disctonnect event :
8353
8355
  serverSocket.on("endConnection",()=>{
@@ -8649,12 +8651,15 @@ WebsocketImplementation={
8649
8651
  }else{
8650
8652
  // NOW : socket.io :
8651
8653
  //client on server-side:
8652
- if(WebsocketImplementation.isNodeContext && typeof(socketIO)!=="undefined"){
8654
+
8655
+ const globalContext=(WebsocketImplementation.isNodeContext?global:window);
8656
+
8657
+ if(WebsocketImplementation.isNodeContext && typeof(globalContext.socketIO)!=="undefined"){
8653
8658
  // // Node client :
8654
8659
  // connectToServer=function (serverURL, port, isSecure, timeout=10000){
8655
8660
  // return socketIO.connect(serverURL + ":" + port,{timeout: timeout});
8656
8661
  // }
8657
- clientSocket=socketIO.connect(serverURL + ":" + port,{timeout: timeout, secure: isSecure});
8662
+ clientSocket=globalContext.socketIO.connect(serverURL + ":" + port,{timeout: timeout, secure: isSecure});
8658
8663
  }
8659
8664
  }
8660
8665
 
@@ -9373,7 +9378,7 @@ function getListManager(config){
9373
9378
 
9374
9379
 
9375
9380
 
9376
- /*utils COMMONS library associated with aotra version : «1.0.0.000 (13/07/2022-02:14:34)»*/
9381
+ /*utils COMMONS library associated with aotra version : «1.0.0.000 (13/07/2022-02:25:54)»*/
9377
9382
  /*-----------------------------------------------------------------------------*/
9378
9383
 
9379
9384
 
aotrautils/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aotrautils",
3
- "version": "0.0.69",
3
+ "version": "0.0.72",
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)",