x_ite 4.7.9 → 4.7.10

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.
@@ -13,13 +13,5 @@ function ()
13
13
  };
14
14
  });
15
15
 
16
- for (const key in x_iteNoConfict)
17
- {
18
- if (x_iteNoConfict [key] === undefined)
19
- delete window [key];
20
- else
21
- window [key] = x_iteNoConfict [key];
22
- }
23
-
24
16
  })
25
17
  (typeof module === "object" ? module : undefined, typeof require === "function" ? require : undefined);
@@ -9,8 +9,3 @@ if (typeof __filename === "undefined")
9
9
 
10
10
  // Undefine global variables.
11
11
  var module, exports, process;
12
-
13
- const x_iteNoConfict = {
14
- sprintf: window .sprintf,
15
- vsprintf: window .vsprintf,
16
- };
package/dist/example.html CHANGED
@@ -2,8 +2,8 @@
2
2
  <html>
3
3
  <head>
4
4
  <meta charset="utf-8"/>
5
- <link rel="stylesheet" type="text/css" href="https://create3000.github.io/code/x_ite/4.7.9/dist/x_ite.css"/>
6
- <script type="text/javascript" src="https://create3000.github.io/code/x_ite/4.7.9/dist/x_ite.min.js"></script>
5
+ <link rel="stylesheet" type="text/css" href="https://create3000.github.io/code/x_ite/4.7.10/dist/x_ite.css"/>
6
+ <script type="text/javascript" src="https://create3000.github.io/code/x_ite/4.7.10/dist/x_ite.min.js"></script>
7
7
  <style>
8
8
  X3DCanvas {
9
9
  width: 1000px;
package/dist/x_ite.css CHANGED
@@ -1,4 +1,4 @@
1
- /* X_ITE v4.7.9-1135 */
1
+ /* X_ITE v4.7.10-1136 */
2
2
  @charset "utf-8";
3
3
  @import url(https://fonts.googleapis.com/css?family=PT+Sans:400,400italic,700,700italic);
4
4
  X3DCanvas .x_ite-private-splash-screen {
@@ -315,7 +315,7 @@ X3DCanvas #context-menu-layer {
315
315
  z-index: 0 !important;
316
316
  }
317
317
  .x_ite-private-menu.x_ite-private-menu-title:before {
318
- content: "X_ITE Browser v4.7.9";
318
+ content: "X_ITE Browser v4.7.10";
319
319
  display: block;
320
320
  padding: 4px 32px 4px 8px;
321
321
  font-weight: bold;
@@ -358,11 +358,6 @@ X3DCanvas #context-menu-layer {
358
358
  line-height: 1;
359
359
  letter-spacing: unset;
360
360
  }
361
- .x_ite-private-menu .context-menu-separator {
362
- padding-top: 0;
363
- padding-bottom: 0;
364
- border-bottom: 1px solid #111;
365
- }
366
361
  .x_ite-private-menu .context-menu-item > label > input,
367
362
  .x_ite-private-menu .context-menu-item > label > textarea {
368
363
  all: revert;
@@ -379,12 +374,21 @@ X3DCanvas #context-menu-layer {
379
374
  -webkit-appearance: radio;
380
375
  -moz-appearance: radio;
381
376
  }
382
- .x_ite-private-menu .context-menu-hover {
377
+ .x_ite-private-menu .context-menu-item:hover {
383
378
  cursor: pointer;
384
379
  background-color: #444;
385
380
  border-top: 1px solid #eee;
386
381
  border-bottom: 1px solid #eee;
387
382
  }
383
+ .x_ite-private-menu .context-menu-item.context-menu-separator {
384
+ padding-top: 0;
385
+ padding-bottom: 0;
386
+ border-top: 0;
387
+ border-bottom: 1px solid #111;
388
+ }
389
+ .x_ite-private-menu .context-menu-separator + .context-menu-separator {
390
+ display: none !important;
391
+ }
388
392
  .x_ite-private-menu .context-menu-disabled {
389
393
  color: #666;
390
394
  }
@@ -445,7 +449,7 @@ X3DCanvas #context-menu-layer {
445
449
  height: 100px;
446
450
  }
447
451
  .x_ite-private-menu .context-menu-item > .context-menu-list {
448
- top: 5px;
452
+ top: -9px;
449
453
 
450
454
  right: -5px;
451
455
  display: none;
package/dist/x_ite.js CHANGED
@@ -1,4 +1,4 @@
1
- /* X_ITE v4.7.9-1135 */
1
+ /* X_ITE v4.7.10-1136 */
2
2
 
3
3
  (function (globalModule, globalRequire)
4
4
  {
@@ -11,11 +11,6 @@ if (typeof __filename === "undefined")
11
11
 
12
12
  // Undefine global variables.
13
13
  var module, exports, process;
14
-
15
- const x_iteNoConfict = {
16
- sprintf: window .sprintf,
17
- vsprintf: window .vsprintf,
18
- };
19
14
  /** vim: et:ts=4:sw=4:sts=4
20
15
  * @license RequireJS 2.3.6 Copyright jQuery Foundation and other contributors.
21
16
  * Released under MIT license, https://github.com/requirejs/requirejs/blob/master/LICENSE
@@ -13527,7 +13522,7 @@ function (X3DConstants)
13527
13522
  this .indentChar = " ";
13528
13523
  this .precision = 6;
13529
13524
  this .doublePrecision = 14;
13530
- this .removeTrailingZeros = /\.?0*$|\.?0*(?=e|E)/;
13525
+ this .removeTrailingZeros = /\.?0*(?=$|[eE])/;
13531
13526
 
13532
13527
  this .executionContextStack = [ null ];
13533
13528
  this .importedNodesIndex = new Map ();
@@ -24919,7 +24914,7 @@ function (SFBool,
24919
24914
 
24920
24915
  define ('x_ite/Browser/VERSION',[],function ()
24921
24916
  {
24922
- return "4.7.9";
24917
+ return "4.7.10";
24923
24918
  });
24924
24919
 
24925
24920
  /* -*- Mode: JavaScript; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-
@@ -30361,7 +30356,8 @@ function ($,
30361
30356
  {
30362
30357
  X3DBaseNode .call (this, executionContext);
30363
30358
 
30364
- this .active = false;
30359
+ this .userMenu = null;
30360
+ this .active = false;
30365
30361
  }
30366
30362
 
30367
30363
  ContextMenu .prototype = Object .assign (Object .create (X3DBaseNode .prototype),
@@ -30413,15 +30409,57 @@ function ($,
30413
30409
  },
30414
30410
  1);
30415
30411
  }
30416
-
30412
+ },
30413
+ activated: function (options)
30414
+ {
30417
30415
  // Display submenus on left side if there is no space on right side.
30418
30416
 
30419
30417
  if (options .$menu .hasClass ("x_ite-private-menu-submenus-left"))
30420
30418
  {
30421
- options .$menu .find (".context-menu-item > .context-menu-list") .css ({
30422
- "right": options .$menu .width () + "px",
30419
+ options .$menu .find (".context-menu-list") .each (function (i, e)
30420
+ {
30421
+ $(e) .css ("right", $(e) .parent () .parent () .css ("width"));
30422
+ });
30423
+ }
30424
+ else
30425
+ {
30426
+ options .$menu .find (".context-menu-list") .each (function (i, e)
30427
+ {
30428
+ $(e) .css ("left", (parseInt ($(e) .parent () .parent () .css ("width")) - 2) + "px");
30423
30429
  });
30424
30430
  }
30431
+
30432
+ // If the submenu is higher than vh, add scrollbars.
30433
+ options .$menu .find (".context-menu-list") .each (function (i, e)
30434
+ {
30435
+ if ($(e) .height () > $(window) .height ())
30436
+ {
30437
+ $(e) .css ({
30438
+ "overflow-y": "scroll",
30439
+ "max-height": "100vh",
30440
+ });
30441
+ }
30442
+ });
30443
+
30444
+ // If the submenu is higher than vh, reposition it.
30445
+ options .$menu .find (".context-menu-item") .on ("mouseenter", function (event)
30446
+ {
30447
+ event .stopImmediatePropagation ();
30448
+
30449
+ const
30450
+ t = $(event .target),
30451
+ e = t .children (".context-menu-list");
30452
+
30453
+ if (!e .length)
30454
+ return;
30455
+
30456
+ e .css ("top", "");
30457
+
30458
+ const bottom = e .offset () .top + e .height () - $(window) .scrollTop () - $(window) .height ();
30459
+
30460
+ if (bottom > 0)
30461
+ e .offset ({ "top": e .offset () .top - bottom });
30462
+ });
30425
30463
  }
30426
30464
  .bind (this),
30427
30465
  hide: function (options)
@@ -30432,6 +30470,14 @@ function ($,
30432
30470
  },
30433
30471
  });
30434
30472
  },
30473
+ getUserMenu: function ()
30474
+ {
30475
+ return this .userMenu;
30476
+ },
30477
+ setUserMenu: function (userMenu)
30478
+ {
30479
+ this .userMenu = userMenu;
30480
+ },
30435
30481
  getActive: function ()
30436
30482
  {
30437
30483
  return this .active;
@@ -30711,9 +30757,22 @@ function ($,
30711
30757
  window .open (browser .getProviderUrl ());
30712
30758
  },
30713
30759
  },
30714
- }
30760
+ },
30715
30761
  };
30716
30762
 
30763
+ if ($.isFunction (this .userMenu))
30764
+ {
30765
+ const userMenu = this .userMenu ();
30766
+
30767
+ if ($.isPlainObject (userMenu))
30768
+ {
30769
+ Object .assign (menu .items, { "separator4": "--------" });
30770
+
30771
+ for (const key in userMenu)
30772
+ menu .items ["user-" + key] = userMenu [key];
30773
+ }
30774
+ }
30775
+
30717
30776
  if (leftSubMenus)
30718
30777
  menu .className += " x_ite-private-menu-submenus-left";
30719
30778
 
@@ -34176,7 +34235,7 @@ define ('x_ite/Parser/X3DParser',[],function ()
34176
34235
  if (typeof globalRequire === "function" && typeof __filename === "string")
34177
34236
  {
34178
34237
  for (const url of providerUrls)
34179
- globalRequire (url);
34238
+ globalRequire (globalRequire ("url") .fileURLToPath (url));
34180
34239
  }
34181
34240
 
34182
34241
  return Array .from (providerUrls);
@@ -35273,7 +35332,7 @@ function ($,
35273
35332
  this .setInternalScene (value);
35274
35333
 
35275
35334
  else
35276
- this .setError ();
35335
+ this .setError (new Error ("File could not be loaded."));
35277
35336
 
35278
35337
  this .getScene () .removeInitLoadCount (this);
35279
35338
  },
@@ -38825,7 +38884,8 @@ define ('standard/Utility/DataStorage',[],function ()
38825
38884
 
38826
38885
  const
38827
38886
  storages = new WeakMap (),
38828
- namespaces = new WeakMap ();
38887
+ namespaces = new WeakMap (),
38888
+ defaults = new WeakMap ();
38829
38889
 
38830
38890
  const handler =
38831
38891
  {
@@ -38839,7 +38899,7 @@ define ('standard/Utility/DataStorage',[],function ()
38839
38899
  var value = target .getStorage () [target .getNameSpace () + key];
38840
38900
 
38841
38901
  if (value === undefined || value === "undefined" || value === null)
38842
- return undefined;
38902
+ return target .getDefaultValue (key);
38843
38903
 
38844
38904
  return JSON .parse (value);
38845
38905
  },
@@ -38861,6 +38921,7 @@ define ('standard/Utility/DataStorage',[],function ()
38861
38921
 
38862
38922
  storages .set (this, storage);
38863
38923
  namespaces .set (this, namespace);
38924
+ defaults .set (this, { });
38864
38925
 
38865
38926
  return new Proxy (this, handler);
38866
38927
  }
@@ -38875,6 +38936,18 @@ define ('standard/Utility/DataStorage',[],function ()
38875
38936
  {
38876
38937
  return namespaces .get (this .target);
38877
38938
  },
38939
+ addNameSpace: function (namespace)
38940
+ {
38941
+ return new DataStorage (this .getStorage (), this .getNameSpace () + namespace);
38942
+ },
38943
+ addDefaultValues: function (defaults)
38944
+ {
38945
+ Object .assign (defaults .get (this .target), object);
38946
+ },
38947
+ getDefaultValue (key)
38948
+ {
38949
+ return defaults .get (this .target) [key];
38950
+ },
38878
38951
  clear: function ()
38879
38952
  {
38880
38953
  const
@@ -39945,9 +40018,6 @@ define ('x_ite/Browser/Networking/urls',[],function ()
39945
40018
  if (getScriptURL () .match (/\.min\.js$/))
39946
40019
  file += ".min";
39947
40020
 
39948
- if (typeof globalRequire === "function" && typeof __filename === "string")
39949
- return this .getPath ("assets", "components", file + ".js");
39950
-
39951
40021
  return new URL ("assets/components/" + file + ".js", getScriptURL ()) .href;
39952
40022
  }
39953
40023
 
@@ -39955,42 +40025,20 @@ define ('x_ite/Browser/Networking/urls',[],function ()
39955
40025
  },
39956
40026
  getShaderUrl: function (file)
39957
40027
  {
39958
- if (typeof globalRequire === "function" && typeof __filename === "string")
39959
- return this .getPath ("assets", "shaders", file);
39960
-
39961
40028
  return new URL ("assets/shaders/" + file, getScriptURL ()) .href;
39962
40029
  },
39963
40030
  getFontsUrl: function (file)
39964
40031
  {
39965
- if (typeof globalRequire === "function" && typeof __filename === "string")
39966
- return this .getPath ("assets", "fonts", file);
39967
-
39968
40032
  return new URL ("assets/fonts/" + file, getScriptURL ()) .href;
39969
40033
  },
39970
40034
  getLinetypeUrl: function (index)
39971
40035
  {
39972
- if (typeof globalRequire === "function" && typeof __filename === "string")
39973
- return this .getPath ("assets", "linetype", index + ".png");
39974
-
39975
40036
  return new URL ("assets/linetype/" + index + ".png", getScriptURL ()) .href;
39976
40037
  },
39977
40038
  getHatchingUrl: function (index)
39978
40039
  {
39979
- if (typeof globalRequire === "function" && typeof __filename === "string")
39980
- return this .getPath ("assets", "hatching", index + ".png");
39981
-
39982
40040
  return new URL ("assets/hatching/" + index + ".png", getScriptURL ()) .href;
39983
40041
  },
39984
- getPath: function ()
39985
- {
39986
- const
39987
- path = globalRequire ("path"),
39988
- args = Array .prototype .slice .call (arguments);
39989
-
39990
- args .unshift (path .dirname (getScriptURL ()));
39991
-
39992
- return path .join .apply (path, args);
39993
- },
39994
40042
  };
39995
40043
 
39996
40044
  return new URLs ();
@@ -118218,7 +118266,7 @@ function ($,
118218
118266
  const url = urls .getProviderUrl (name);
118219
118267
 
118220
118268
  if (typeof globalRequire === "function" && typeof __filename === "string")
118221
- globalRequire (url);
118269
+ globalRequire (globalRequire ("url") .fileURLToPath (url));
118222
118270
 
118223
118271
  return url;
118224
118272
  }
@@ -118442,8 +118490,8 @@ const getScriptURL = (function ()
118442
118490
  {
118443
118491
  if (document .currentScript)
118444
118492
  var src = document .currentScript .src;
118445
- else if (typeof __filename === "string")
118446
- var src = __filename;
118493
+ else if (typeof globalRequire === "function" && typeof __filename === "string")
118494
+ var src = globalRequire ("url") .pathToFileURL (__filename) .href;
118447
118495
 
118448
118496
  return function ()
118449
118497
  {
@@ -118588,13 +118636,5 @@ function ()
118588
118636
  };
118589
118637
  });
118590
118638
 
118591
- for (const key in x_iteNoConfict)
118592
- {
118593
- if (x_iteNoConfict [key] === undefined)
118594
- delete window [key];
118595
- else
118596
- window [key] = x_iteNoConfict [key];
118597
- }
118598
-
118599
118639
  })
118600
118640
  (typeof module === "object" ? module : undefined, typeof require === "function" ? require : undefined);