x_ite 4.7.9 → 4.7.14

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
- };
@@ -409,7 +409,7 @@ function ($,
409
409
 
410
410
  if (rootNodes .length && rootNodes [0])
411
411
  {
412
- return SFNodeCache .add (rootNodes [0] .getValue (), this);
412
+ return rootNodes [0];
413
413
  }
414
414
 
415
415
  throw new Error ("SFNode.new: invalid argument, must be 'string' is 'undefined'.");
@@ -1 +1 @@
1
- !function(){var module={},exports,process;const define=X3D.define,require=X3D.require;define("x_ite/Browser/Scripting/evaluate",[],function(){return function(){with(arguments[0])return eval(arguments[1])}}),define("x_ite/Components/Scripting/X3DScriptNode",["x_ite/Components/Core/X3DChildNode","x_ite/Components/Networking/X3DUrlObject","x_ite/Bits/X3DConstants"],function(t,e,i){"use strict";function n(n){t.call(this,n),e.call(this,n),this.addType(i.X3DScriptNode)}return n.prototype=Object.assign(Object.create(t.prototype),e.prototype,{constructor:n}),n}),define("x_ite/Components/Scripting/Script",["jquery","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Basic/X3DField","x_ite/Basic/X3DArrayField","x_ite/Fields","x_ite/Browser/X3DBrowser","x_ite/Configuration/ComponentInfo","x_ite/Configuration/ComponentInfoArray","x_ite/Configuration/ProfileInfo","x_ite/Configuration/ProfileInfoArray","x_ite/Configuration/UnitInfo","x_ite/Configuration/UnitInfoArray","x_ite/Execution/X3DExecutionContext","x_ite/Execution/X3DScene","x_ite/Prototype/ExternProtoDeclarationArray","x_ite/Prototype/ProtoDeclarationArray","x_ite/Prototype/X3DExternProtoDeclaration","x_ite/Prototype/X3DProtoDeclaration","x_ite/Routing/RouteArray","x_ite/Routing/X3DRoute","x_ite/Browser/Scripting/evaluate","x_ite/Components/Scripting/X3DScriptNode","x_ite/InputOutput/FileLoader","x_ite/Bits/X3DConstants","x_ite/Fields/SFNodeCache"],function(t,e,i,n,o,r,s,a,c,u,l,p,d,h,f,_,F,v,g,S,x,M,m,E,y,D){function w(t){m.call(this,t),this.addChildObjects("buffer",new r.MFString),this.addType(y.Script),this.pauseTime=0}return w.prototype=Object.assign(Object.create(m.prototype),{constructor:w,fieldDefinitions:new i([new e(y.inputOutput,"metadata",new r.SFNode),new e(y.inputOutput,"url",new r.MFString),new e(y.inputOutput,"autoRefresh",new r.SFTime),new e(y.inputOutput,"autoRefreshTimeLimit",new r.SFTime(3600)),new e(y.initializeOnly,"directOutput",new r.SFBool),new e(y.initializeOnly,"mustEvaluate",new r.SFBool)]),getTypeName:function(){return"Script"},getComponentName:function(){return"Scripting"},getContainerField:function(){return"children"},initialize:function(){m.prototype.initialize.call(this),this.url_.addInterest("set_url__",this),this.buffer_.addInterest("set_buffer__",this),this.getUserDefinedFields().forEach(function(t){t.setModificationTime(0)}),this.set_url__()},set_url__:function(){this.setLoadState(y.NOT_STARTED_STATE),this.requestImmediateLoad()},getExtendedEventHandling:function(){return!1},hasUserDefinedFields:function(){return!0},getSourceText:function(){return this.url_},requestImmediateLoad:function(t=!0){this.checkLoadState()!==y.COMPLETE_STATE&&this.checkLoadState()!==y.IN_PROGRESS_STATE&&0!==this.url_.length&&(this.setCache(t),this.setLoadState(y.IN_PROGRESS_STATE),this.buffer_=this.url_)},set_buffer__:function(){new E(this).loadScript(this.buffer_,function(t){null===t?this.setLoadState(y.FAILED_STATE):(this.setLoadState(y.COMPLETE_STATE),this.initialize__(t))}.bind(this))},getContext:function(t){try{const e=["initialize","prepareEvents","eventsProcessed","shutdown"];this.getUserDefinedFields().forEach(function(t){switch(t.getAccessType()){case y.inputOnly:e.push(t.getName());break;case y.inputOutput:e.push("set_"+t.getName())}}),t+="\n;var "+e.join(",")+";",t+="\n["+e.join(",")+"];",this.global=this.getGlobal();const i=this.evaluate(t),n={};for(let t=0;t<e.length;++t)n[e[t]]=i[t];return n}catch(t){return this.setError("while evaluating script source",t),{}}},evaluate:function(t){return M(this.global,t)},getGlobal:function(){function t(t){const e=M.createX3DFromString(String(t)),i=e.getRootNodes();if(E.addFieldInterest(e.isLive()),e.setLive(E.getValue()),e.setPrivate(m.getPrivate()),e.setExecutionContext(m),i.length&&i[0])return D.add(i[0].getValue(),this);throw new Error("SFNode.new: invalid argument, must be 'string' is 'undefined'.")}const M=this.getBrowser(),m=this.getExecutionContext(),E=this.isLive();t.prototype=r.SFNode.prototype;const w={NULL:{value:null},FALSE:{value:!1},TRUE:{value:!0},print:{value:function(){M.println.apply(M,arguments)}},trace:{value:function(){M.println.apply(M,arguments)}},Browser:{value:M},X3DConstants:{value:y},X3DBrowser:{value:s},X3DExecutionContext:{value:h},X3DScene:{value:f},ComponentInfo:{value:a},ComponentInfoArray:{value:c},ProfileInfo:{value:u},ProfileInfoArray:{value:l},UnitInfo:{value:p},UnitInfoArray:{value:d},ExternProtoDeclarationArray:{value:_},ProtoDeclarationArray:{value:F},X3DExternProtoDeclaration:{value:v},X3DProtoDeclaration:{value:g},RouteArray:{value:S},X3DRoute:{value:x},X3DFieldDefinition:{value:e},FieldDefinitionArray:{value:i},X3DField:{value:n},X3DArrayField:{value:o},SFColor:{value:r.SFColor},SFColorRGBA:{value:r.SFColorRGBA},SFImage:{value:r.SFImage},SFMatrix3d:{value:r.SFMatrix3d},SFMatrix3f:{value:r.SFMatrix3f},SFMatrix4d:{value:r.SFMatrix4d},SFMatrix4f:{value:r.SFMatrix4f},SFNode:{value:t},SFRotation:{value:r.SFRotation},SFVec2d:{value:r.SFVec2d},SFVec2f:{value:r.SFVec2f},SFVec3d:{value:r.SFVec3d},SFVec3f:{value:r.SFVec3f},SFVec4d:{value:r.SFVec4d},SFVec4f:{value:r.SFVec4f},VrmlMatrix:{value:r.VrmlMatrix},MFBool:{value:r.MFBool},MFColor:{value:r.MFColor},MFColorRGBA:{value:r.MFColorRGBA},MFDouble:{value:r.MFDouble},MFFloat:{value:r.MFFloat},MFImage:{value:r.MFImage},MFInt32:{value:r.MFInt32},MFMatrix3d:{value:r.MFMatrix3d},MFMatrix3f:{value:r.MFMatrix3f},MFMatrix4d:{value:r.MFMatrix4d},MFMatrix4f:{value:r.MFMatrix4f},MFNode:{value:r.MFNode},MFRotation:{value:r.MFRotation},MFString:{value:r.MFString},MFTime:{value:r.MFTime},MFVec2d:{value:r.MFVec2d},MFVec2f:{value:r.MFVec2f},MFVec3d:{value:r.MFVec3d},MFVec3f:{value:r.MFVec3f},MFVec4d:{value:r.MFVec4d},MFVec4f:{value:r.MFVec4f}};return this.getUserDefinedFields().forEach(function(t){const e=t.getName();t.getAccessType()!==y.inputOnly&&(e in w||(w[e]={get:t.valueOf.bind(t),set:t.setValue.bind(t)}),t.getAccessType()===y.inputOutput&&(w[e+"_changed"]={get:t.valueOf.bind(t),set:t.setValue.bind(t)}))}),Object.create(Object.prototype,w)},processOutstandingEvents:function(){this.getUserDefinedFields().forEach(function(e){if(!(e.getModificationTime()<=this.pauseTime))switch(e.getAccessType()){case y.inputOnly:{const i=this.context[e.getName()];t.isFunction(i)&&this.set_field__(e,i);break}case y.inputOutput:{const i=this.context["set_"+e.getName()];t.isFunction(i)&&this.set_field__(e,i);break}}},this)},initialize__:function(t){this.context=this.getContext(t),this.isLive().addInterest("set_live__",this),this.set_live__()},set_live__:function(){if(this.context)if(this.isLive().getValue()){if(!this.initialized){if(this.initialized=!0,t.isFunction(this.context.initialize)){const t=this.getBrowser();t.getScriptStack().push(this);try{this.context.initialize()}catch(t){this.setError("in function 'initialize'",t)}t.getScriptStack().pop()}t.isFunction(this.context.shutdown)&&t(window).on("unload",this.shutdown__.bind(this))}t.isFunction(this.context.prepareEvents)&&this.getBrowser().prepareEvents().addInterest("prepareEvents__",this),t.isFunction(this.context.eventsProcessed)&&this.addInterest("eventsProcessed__",this),this.getUserDefinedFields().forEach(function(e){switch(e.getAccessType()){case y.inputOnly:{const i=this.context[e.getName()];t.isFunction(i)&&e.addInterest("set_field__",this,i);break}case y.inputOutput:{const i=this.context["set_"+e.getName()];t.isFunction(i)&&e.addInterest("set_field__",this,i);break}}},this),this.processOutstandingEvents()}else this.context.prepareEvents&&this.getBrowser().prepareEvents().removeInterest("prepareEvents__",this),this.context.eventsProcessed&&this.removeInterest("eventsProcessed__",this),this.getUserDefinedFields().forEach(function(t){switch(t.getAccessType()){case y.inputOnly:case y.inputOutput:t.removeInterest("set_field__",this)}},this),this.initialized&&(this.pauseTime=performance.now())},prepareEvents__:function(){const t=this.getBrowser();t.getScriptStack().push(this);try{this.context.prepareEvents(t.getCurrentTime()),t.addBrowserEvent()}catch(t){this.setError("in function 'prepareEvents'",t)}t.getScriptStack().pop()},set_field__:function(t,e){const i=this.getBrowser();t.setTainted(!0),i.getScriptStack().push(this);try{e(t.valueOf(),i.getCurrentTime())}catch(e){this.setError("in function '"+t.getName()+"'",e)}i.getScriptStack().pop(),t.setTainted(!1)},eventsProcessed__:function(){const t=this.getBrowser();t.getScriptStack().push(this);try{this.context.eventsProcessed()}catch(t){this.setError("in function 'eventsProcessed'",t)}t.getScriptStack().pop()},shutdown__:function(){const t=this.getBrowser();t.getScriptStack().push(this);try{this.context.shutdown()}catch(t){this.setError("in function 'shutdown'",t)}t.getScriptStack().pop()},setError:function(t,e){console.error("JavaScript Error in Script '"+this.getName()+"', "+t+"\nworld url is '"+this.getExecutionContext().getWorldURL()+"':"),console.error(e)}}),w}),define(require.getComponentUrl("scripting"),["x_ite/Components","x_ite/Components/Scripting/Script","x_ite/Components/Scripting/X3DScriptNode"],function(t,e,i){"use strict";t.addComponent({name:"Scripting",types:{Script:e},abstractTypes:{X3DScriptNode:i}})})}();
1
+ !function(){var module={},exports,process;const define=X3D.define,require=X3D.require;define("x_ite/Browser/Scripting/evaluate",[],function(){return function(){with(arguments[0])return eval(arguments[1])}}),define("x_ite/Components/Scripting/X3DScriptNode",["x_ite/Components/Core/X3DChildNode","x_ite/Components/Networking/X3DUrlObject","x_ite/Bits/X3DConstants"],function(t,e,i){"use strict";function n(n){t.call(this,n),e.call(this,n),this.addType(i.X3DScriptNode)}return n.prototype=Object.assign(Object.create(t.prototype),e.prototype,{constructor:n}),n}),define("x_ite/Components/Scripting/Script",["jquery","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Basic/X3DField","x_ite/Basic/X3DArrayField","x_ite/Fields","x_ite/Browser/X3DBrowser","x_ite/Configuration/ComponentInfo","x_ite/Configuration/ComponentInfoArray","x_ite/Configuration/ProfileInfo","x_ite/Configuration/ProfileInfoArray","x_ite/Configuration/UnitInfo","x_ite/Configuration/UnitInfoArray","x_ite/Execution/X3DExecutionContext","x_ite/Execution/X3DScene","x_ite/Prototype/ExternProtoDeclarationArray","x_ite/Prototype/ProtoDeclarationArray","x_ite/Prototype/X3DExternProtoDeclaration","x_ite/Prototype/X3DProtoDeclaration","x_ite/Routing/RouteArray","x_ite/Routing/X3DRoute","x_ite/Browser/Scripting/evaluate","x_ite/Components/Scripting/X3DScriptNode","x_ite/InputOutput/FileLoader","x_ite/Bits/X3DConstants","x_ite/Fields/SFNodeCache"],function(t,e,i,n,o,r,s,a,c,u,l,p,d,h,f,_,F,v,g,S,x,M,m,E,y,D){function w(t){m.call(this,t),this.addChildObjects("buffer",new r.MFString),this.addType(y.Script),this.pauseTime=0}return w.prototype=Object.assign(Object.create(m.prototype),{constructor:w,fieldDefinitions:new i([new e(y.inputOutput,"metadata",new r.SFNode),new e(y.inputOutput,"url",new r.MFString),new e(y.inputOutput,"autoRefresh",new r.SFTime),new e(y.inputOutput,"autoRefreshTimeLimit",new r.SFTime(3600)),new e(y.initializeOnly,"directOutput",new r.SFBool),new e(y.initializeOnly,"mustEvaluate",new r.SFBool)]),getTypeName:function(){return"Script"},getComponentName:function(){return"Scripting"},getContainerField:function(){return"children"},initialize:function(){m.prototype.initialize.call(this),this.url_.addInterest("set_url__",this),this.buffer_.addInterest("set_buffer__",this),this.getUserDefinedFields().forEach(function(t){t.setModificationTime(0)}),this.set_url__()},set_url__:function(){this.setLoadState(y.NOT_STARTED_STATE),this.requestImmediateLoad()},getExtendedEventHandling:function(){return!1},hasUserDefinedFields:function(){return!0},getSourceText:function(){return this.url_},requestImmediateLoad:function(t=!0){this.checkLoadState()!==y.COMPLETE_STATE&&this.checkLoadState()!==y.IN_PROGRESS_STATE&&0!==this.url_.length&&(this.setCache(t),this.setLoadState(y.IN_PROGRESS_STATE),this.buffer_=this.url_)},set_buffer__:function(){new E(this).loadScript(this.buffer_,function(t){null===t?this.setLoadState(y.FAILED_STATE):(this.setLoadState(y.COMPLETE_STATE),this.initialize__(t))}.bind(this))},getContext:function(t){try{const e=["initialize","prepareEvents","eventsProcessed","shutdown"];this.getUserDefinedFields().forEach(function(t){switch(t.getAccessType()){case y.inputOnly:e.push(t.getName());break;case y.inputOutput:e.push("set_"+t.getName())}}),t+="\n;var "+e.join(",")+";",t+="\n["+e.join(",")+"];",this.global=this.getGlobal();const i=this.evaluate(t),n={};for(let t=0;t<e.length;++t)n[e[t]]=i[t];return n}catch(t){return this.setError("while evaluating script source",t),{}}},evaluate:function(t){return M(this.global,t)},getGlobal:function(){function t(t){const e=M.createX3DFromString(String(t)),i=e.getRootNodes();if(E.addFieldInterest(e.isLive()),e.setLive(E.getValue()),e.setPrivate(m.getPrivate()),e.setExecutionContext(m),i.length&&i[0])return i[0];throw new Error("SFNode.new: invalid argument, must be 'string' is 'undefined'.")}const M=this.getBrowser(),m=this.getExecutionContext(),E=this.isLive();t.prototype=r.SFNode.prototype;const D={NULL:{value:null},FALSE:{value:!1},TRUE:{value:!0},print:{value:function(){M.println.apply(M,arguments)}},trace:{value:function(){M.println.apply(M,arguments)}},Browser:{value:M},X3DConstants:{value:y},X3DBrowser:{value:s},X3DExecutionContext:{value:h},X3DScene:{value:f},ComponentInfo:{value:a},ComponentInfoArray:{value:c},ProfileInfo:{value:u},ProfileInfoArray:{value:l},UnitInfo:{value:p},UnitInfoArray:{value:d},ExternProtoDeclarationArray:{value:_},ProtoDeclarationArray:{value:F},X3DExternProtoDeclaration:{value:v},X3DProtoDeclaration:{value:g},RouteArray:{value:S},X3DRoute:{value:x},X3DFieldDefinition:{value:e},FieldDefinitionArray:{value:i},X3DField:{value:n},X3DArrayField:{value:o},SFColor:{value:r.SFColor},SFColorRGBA:{value:r.SFColorRGBA},SFImage:{value:r.SFImage},SFMatrix3d:{value:r.SFMatrix3d},SFMatrix3f:{value:r.SFMatrix3f},SFMatrix4d:{value:r.SFMatrix4d},SFMatrix4f:{value:r.SFMatrix4f},SFNode:{value:t},SFRotation:{value:r.SFRotation},SFVec2d:{value:r.SFVec2d},SFVec2f:{value:r.SFVec2f},SFVec3d:{value:r.SFVec3d},SFVec3f:{value:r.SFVec3f},SFVec4d:{value:r.SFVec4d},SFVec4f:{value:r.SFVec4f},VrmlMatrix:{value:r.VrmlMatrix},MFBool:{value:r.MFBool},MFColor:{value:r.MFColor},MFColorRGBA:{value:r.MFColorRGBA},MFDouble:{value:r.MFDouble},MFFloat:{value:r.MFFloat},MFImage:{value:r.MFImage},MFInt32:{value:r.MFInt32},MFMatrix3d:{value:r.MFMatrix3d},MFMatrix3f:{value:r.MFMatrix3f},MFMatrix4d:{value:r.MFMatrix4d},MFMatrix4f:{value:r.MFMatrix4f},MFNode:{value:r.MFNode},MFRotation:{value:r.MFRotation},MFString:{value:r.MFString},MFTime:{value:r.MFTime},MFVec2d:{value:r.MFVec2d},MFVec2f:{value:r.MFVec2f},MFVec3d:{value:r.MFVec3d},MFVec3f:{value:r.MFVec3f},MFVec4d:{value:r.MFVec4d},MFVec4f:{value:r.MFVec4f}};return this.getUserDefinedFields().forEach(function(t){const e=t.getName();t.getAccessType()!==y.inputOnly&&(e in D||(D[e]={get:t.valueOf.bind(t),set:t.setValue.bind(t)}),t.getAccessType()===y.inputOutput&&(D[e+"_changed"]={get:t.valueOf.bind(t),set:t.setValue.bind(t)}))}),Object.create(Object.prototype,D)},processOutstandingEvents:function(){this.getUserDefinedFields().forEach(function(e){if(!(e.getModificationTime()<=this.pauseTime))switch(e.getAccessType()){case y.inputOnly:{const i=this.context[e.getName()];t.isFunction(i)&&this.set_field__(e,i);break}case y.inputOutput:{const i=this.context["set_"+e.getName()];t.isFunction(i)&&this.set_field__(e,i);break}}},this)},initialize__:function(t){this.context=this.getContext(t),this.isLive().addInterest("set_live__",this),this.set_live__()},set_live__:function(){if(this.context)if(this.isLive().getValue()){if(!this.initialized){if(this.initialized=!0,t.isFunction(this.context.initialize)){const t=this.getBrowser();t.getScriptStack().push(this);try{this.context.initialize()}catch(t){this.setError("in function 'initialize'",t)}t.getScriptStack().pop()}t.isFunction(this.context.shutdown)&&t(window).on("unload",this.shutdown__.bind(this))}t.isFunction(this.context.prepareEvents)&&this.getBrowser().prepareEvents().addInterest("prepareEvents__",this),t.isFunction(this.context.eventsProcessed)&&this.addInterest("eventsProcessed__",this),this.getUserDefinedFields().forEach(function(e){switch(e.getAccessType()){case y.inputOnly:{const i=this.context[e.getName()];t.isFunction(i)&&e.addInterest("set_field__",this,i);break}case y.inputOutput:{const i=this.context["set_"+e.getName()];t.isFunction(i)&&e.addInterest("set_field__",this,i);break}}},this),this.processOutstandingEvents()}else this.context.prepareEvents&&this.getBrowser().prepareEvents().removeInterest("prepareEvents__",this),this.context.eventsProcessed&&this.removeInterest("eventsProcessed__",this),this.getUserDefinedFields().forEach(function(t){switch(t.getAccessType()){case y.inputOnly:case y.inputOutput:t.removeInterest("set_field__",this)}},this),this.initialized&&(this.pauseTime=performance.now())},prepareEvents__:function(){const t=this.getBrowser();t.getScriptStack().push(this);try{this.context.prepareEvents(t.getCurrentTime()),t.addBrowserEvent()}catch(t){this.setError("in function 'prepareEvents'",t)}t.getScriptStack().pop()},set_field__:function(t,e){const i=this.getBrowser();t.setTainted(!0),i.getScriptStack().push(this);try{e(t.valueOf(),i.getCurrentTime())}catch(e){this.setError("in function '"+t.getName()+"'",e)}i.getScriptStack().pop(),t.setTainted(!1)},eventsProcessed__:function(){const t=this.getBrowser();t.getScriptStack().push(this);try{this.context.eventsProcessed()}catch(t){this.setError("in function 'eventsProcessed'",t)}t.getScriptStack().pop()},shutdown__:function(){const t=this.getBrowser();t.getScriptStack().push(this);try{this.context.shutdown()}catch(t){this.setError("in function 'shutdown'",t)}t.getScriptStack().pop()},setError:function(t,e){console.error("JavaScript Error in Script '"+this.getName()+"', "+t+"\nworld url is '"+this.getExecutionContext().getWorldURL()+"':"),console.error(e)}}),w}),define(require.getComponentUrl("scripting"),["x_ite/Components","x_ite/Components/Scripting/Script","x_ite/Components/Scripting/X3DScriptNode"],function(t,e,i){"use strict";t.addComponent({name:"Scripting",types:{Script:e},abstractTypes:{X3DScriptNode:i}})})}();
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.14/dist/x_ite.css"/>
6
+ <script type="text/javascript" src="https://create3000.github.io/code/x_ite/4.7.14/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.14-1139 */
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.14";
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.14-1139 */
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 ();
@@ -14635,31 +14630,38 @@ function ($,
14635
14630
  {
14636
14631
  return this ._outputRoutes;
14637
14632
  },
14638
- addRouteCallback: function (string, object)
14633
+ addRouteCallback: function (id, object)
14639
14634
  {
14640
14635
  if (! this .hasOwnProperty ("_routeCallbacks"))
14641
14636
  this ._routeCallbacks = new Map ();
14642
14637
 
14643
- this ._routeCallbacks .set (string, object);
14638
+ this ._routeCallbacks .set (id, object);
14644
14639
  },
14645
- removeRouteCallback: function (string)
14640
+ removeRouteCallback: function (id)
14646
14641
  {
14647
- this ._routeCallbacks .delete (string);
14642
+ this ._routeCallbacks .delete (id);
14648
14643
  },
14649
14644
  getRouteCallbacks: function ()
14650
14645
  {
14651
14646
  return this ._routeCallbacks;
14652
14647
  },
14653
- processRouteCallbacks: function ()
14648
+ processRouteCallbacks: (function ()
14654
14649
  {
14655
- if (this ._routeCallbacks .size)
14650
+ const routeCallbacks = new Map ();
14651
+
14652
+ function processRouteCallback (routeCallback)
14656
14653
  {
14657
- this ._routeCallbacks .forEach (function (routeCallback)
14658
- {
14659
- routeCallback ();
14660
- });
14654
+ routeCallback ();
14661
14655
  }
14662
- },
14656
+
14657
+ return function ()
14658
+ {
14659
+ if (this ._routeCallbacks .size)
14660
+ {
14661
+ MapUtilities .assign (routeCallbacks, this ._routeCallbacks) .forEach (processRouteCallback);
14662
+ }
14663
+ };
14664
+ })(),
14663
14665
  processEvent: (function ()
14664
14666
  {
14665
14667
  const fieldCallbacks = new Map ();
@@ -21792,11 +21794,11 @@ define ('x_ite/Fields/SFNodeCache',['x_ite/Fields/SFNode','x_ite/Fields/SFNode']
21792
21794
 
21793
21795
  SFNodeCache .prototype =
21794
21796
  {
21795
- add: function (baseNode, node)
21797
+ add: function (baseNode)
21796
21798
  {
21797
- const SFNode = require ("x_ite/Fields/SFNode");
21798
-
21799
- node = node ? SFNode .call (node, baseNode) : new SFNode (baseNode);
21799
+ const
21800
+ SFNode = require ("x_ite/Fields/SFNode"),
21801
+ node = new SFNode (baseNode);
21800
21802
 
21801
21803
  cache .set (baseNode, node);
21802
21804
 
@@ -21812,10 +21814,9 @@ define ('x_ite/Fields/SFNodeCache',['x_ite/Fields/SFNode','x_ite/Fields/SFNode']
21812
21814
  }
21813
21815
  else
21814
21816
  {
21815
- const SFNode = require ("x_ite/Fields/SFNode");
21816
-
21817
- // Always create new instance!
21818
- const node = new SFNode (baseNode);
21817
+ const
21818
+ SFNode = require ("x_ite/Fields/SFNode"),
21819
+ node = new SFNode (baseNode);
21819
21820
 
21820
21821
  cache .set (baseNode, node);
21821
21822
 
@@ -21958,9 +21959,11 @@ function (X3DField,
21958
21959
  {
21959
21960
  // Node need to test for X3DBaseNode, because there is a special version of SFNode in Script.
21960
21961
 
21962
+ const proxy = new Proxy (this, handler);
21963
+
21961
21964
  if (value)
21962
21965
  {
21963
- value .addParent (this);
21966
+ value .addParent (proxy);
21964
21967
 
21965
21968
  X3DField .call (this, value);
21966
21969
  }
@@ -21969,7 +21972,7 @@ function (X3DField,
21969
21972
  X3DField .call (this, null);
21970
21973
  }
21971
21974
 
21972
- return new Proxy (this, handler);
21975
+ return proxy;
21973
21976
  }
21974
21977
 
21975
21978
  SFNode .prototype = Object .assign (Object .create (X3DField .prototype),
@@ -22018,7 +22021,7 @@ function (X3DField,
22018
22021
  current .removeParent (this);
22019
22022
  }
22020
22023
 
22021
- // Node need to test for X3DBaseNode, because there is a special version of SFNode in Script.
22024
+ // No need to test for X3DBaseNode, because there is a special version of SFNode in Script.
22022
22025
 
22023
22026
  if (value)
22024
22027
  {
@@ -22925,10 +22928,16 @@ function ($,
22925
22928
  }
22926
22929
  }
22927
22930
 
22928
- const array = target .getValue ();
22929
-
22930
22931
  if (key === Symbol .iterator)
22931
- return array [key];
22932
+ {
22933
+ return function* ()
22934
+ {
22935
+ const array = target .getValue ();
22936
+
22937
+ for (const value of array)
22938
+ yield value .valueOf ();
22939
+ };
22940
+ }
22932
22941
  },
22933
22942
  set: function (target, key, value)
22934
22943
  {
@@ -24389,7 +24398,7 @@ function (SFBool,
24389
24398
  },
24390
24399
  removeCloneCount: function (count)
24391
24400
  {
24392
- this ._cloneCount += count;
24401
+ this ._cloneCount -= count;
24393
24402
 
24394
24403
  for (const element of this .getValue ())
24395
24404
  element .removeCloneCount (count);
@@ -24919,7 +24928,7 @@ function (SFBool,
24919
24928
 
24920
24929
  define ('x_ite/Browser/VERSION',[],function ()
24921
24930
  {
24922
- return "4.7.9";
24931
+ return "4.7.14";
24923
24932
  });
24924
24933
 
24925
24934
  /* -*- Mode: JavaScript; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-
@@ -26061,7 +26070,7 @@ function (X3DEventObject,
26061
26070
  references = [ ],
26062
26071
  childNodes = [ ];
26063
26072
 
26064
- const cdata = this .getSourceText ();
26073
+ let cdata = this .getSourceText ();
26065
26074
 
26066
26075
  if (cdata && cdata .length === 0)
26067
26076
  cdata = null;
@@ -30361,7 +30370,8 @@ function ($,
30361
30370
  {
30362
30371
  X3DBaseNode .call (this, executionContext);
30363
30372
 
30364
- this .active = false;
30373
+ this .userMenu = null;
30374
+ this .active = false;
30365
30375
  }
30366
30376
 
30367
30377
  ContextMenu .prototype = Object .assign (Object .create (X3DBaseNode .prototype),
@@ -30413,15 +30423,57 @@ function ($,
30413
30423
  },
30414
30424
  1);
30415
30425
  }
30416
-
30426
+ },
30427
+ activated: function (options)
30428
+ {
30417
30429
  // Display submenus on left side if there is no space on right side.
30418
30430
 
30419
30431
  if (options .$menu .hasClass ("x_ite-private-menu-submenus-left"))
30420
30432
  {
30421
- options .$menu .find (".context-menu-item > .context-menu-list") .css ({
30422
- "right": options .$menu .width () + "px",
30433
+ options .$menu .find (".context-menu-list") .each (function (i, e)
30434
+ {
30435
+ $(e) .css ("right", $(e) .parent () .parent () .css ("width"));
30436
+ });
30437
+ }
30438
+ else
30439
+ {
30440
+ options .$menu .find (".context-menu-list") .each (function (i, e)
30441
+ {
30442
+ $(e) .css ("left", (parseInt ($(e) .parent () .parent () .css ("width")) - 2) + "px");
30423
30443
  });
30424
30444
  }
30445
+
30446
+ // If the submenu is higher than vh, add scrollbars.
30447
+ options .$menu .find (".context-menu-list") .each (function (i, e)
30448
+ {
30449
+ if ($(e) .height () > $(window) .height ())
30450
+ {
30451
+ $(e) .css ({
30452
+ "overflow-y": "scroll",
30453
+ "max-height": "100vh",
30454
+ });
30455
+ }
30456
+ });
30457
+
30458
+ // If the submenu is higher than vh, reposition it.
30459
+ options .$menu .find (".context-menu-item") .on ("mouseenter", function (event)
30460
+ {
30461
+ event .stopImmediatePropagation ();
30462
+
30463
+ const
30464
+ t = $(event .target),
30465
+ e = t .children (".context-menu-list");
30466
+
30467
+ if (!e .length)
30468
+ return;
30469
+
30470
+ e .css ("top", "");
30471
+
30472
+ const bottom = e .offset () .top + e .height () - $(window) .scrollTop () - $(window) .height ();
30473
+
30474
+ if (bottom > 0)
30475
+ e .offset ({ "top": e .offset () .top - bottom });
30476
+ });
30425
30477
  }
30426
30478
  .bind (this),
30427
30479
  hide: function (options)
@@ -30432,6 +30484,14 @@ function ($,
30432
30484
  },
30433
30485
  });
30434
30486
  },
30487
+ getUserMenu: function ()
30488
+ {
30489
+ return this .userMenu;
30490
+ },
30491
+ setUserMenu: function (userMenu)
30492
+ {
30493
+ this .userMenu = userMenu;
30494
+ },
30435
30495
  getActive: function ()
30436
30496
  {
30437
30497
  return this .active;
@@ -30711,9 +30771,22 @@ function ($,
30711
30771
  window .open (browser .getProviderUrl ());
30712
30772
  },
30713
30773
  },
30714
- }
30774
+ },
30715
30775
  };
30716
30776
 
30777
+ if ($.isFunction (this .userMenu))
30778
+ {
30779
+ const userMenu = this .userMenu ();
30780
+
30781
+ if ($.isPlainObject (userMenu))
30782
+ {
30783
+ Object .assign (menu .items, { "separator4": "--------" });
30784
+
30785
+ for (const key in userMenu)
30786
+ menu .items ["user-" + key] = userMenu [key];
30787
+ }
30788
+ }
30789
+
30717
30790
  if (leftSubMenus)
30718
30791
  menu .className += " x_ite-private-menu-submenus-left";
30719
30792
 
@@ -34176,7 +34249,7 @@ define ('x_ite/Parser/X3DParser',[],function ()
34176
34249
  if (typeof globalRequire === "function" && typeof __filename === "string")
34177
34250
  {
34178
34251
  for (const url of providerUrls)
34179
- globalRequire (url);
34252
+ globalRequire (globalRequire ("url") .fileURLToPath (url));
34180
34253
  }
34181
34254
 
34182
34255
  return Array .from (providerUrls);
@@ -35273,7 +35346,7 @@ function ($,
35273
35346
  this .setInternalScene (value);
35274
35347
 
35275
35348
  else
35276
- this .setError ();
35349
+ this .setError (new Error ("File could not be loaded."));
35277
35350
 
35278
35351
  this .getScene () .removeInitLoadCount (this);
35279
35352
  },
@@ -35785,7 +35858,7 @@ function (Fields,
35785
35858
 
35786
35859
  generator .IncIndent ();
35787
35860
 
35788
- this .body .toXMLStream .call (stream);
35861
+ this .body .toXMLStream (stream);
35789
35862
 
35790
35863
  generator .DecIndent ();
35791
35864
 
@@ -38825,7 +38898,8 @@ define ('standard/Utility/DataStorage',[],function ()
38825
38898
 
38826
38899
  const
38827
38900
  storages = new WeakMap (),
38828
- namespaces = new WeakMap ();
38901
+ namespaces = new WeakMap (),
38902
+ defaults = new WeakMap ();
38829
38903
 
38830
38904
  const handler =
38831
38905
  {
@@ -38839,7 +38913,7 @@ define ('standard/Utility/DataStorage',[],function ()
38839
38913
  var value = target .getStorage () [target .getNameSpace () + key];
38840
38914
 
38841
38915
  if (value === undefined || value === "undefined" || value === null)
38842
- return undefined;
38916
+ return target .getDefaultValue (key);
38843
38917
 
38844
38918
  return JSON .parse (value);
38845
38919
  },
@@ -38861,6 +38935,7 @@ define ('standard/Utility/DataStorage',[],function ()
38861
38935
 
38862
38936
  storages .set (this, storage);
38863
38937
  namespaces .set (this, namespace);
38938
+ defaults .set (this, { });
38864
38939
 
38865
38940
  return new Proxy (this, handler);
38866
38941
  }
@@ -38875,6 +38950,18 @@ define ('standard/Utility/DataStorage',[],function ()
38875
38950
  {
38876
38951
  return namespaces .get (this .target);
38877
38952
  },
38953
+ addNameSpace: function (namespace)
38954
+ {
38955
+ return new DataStorage (this .getStorage (), this .getNameSpace () + namespace);
38956
+ },
38957
+ addDefaultValues: function (defaults)
38958
+ {
38959
+ Object .assign (defaults .get (this .target), object);
38960
+ },
38961
+ getDefaultValue (key)
38962
+ {
38963
+ return defaults .get (this .target) [key];
38964
+ },
38878
38965
  clear: function ()
38879
38966
  {
38880
38967
  const
@@ -39945,9 +40032,6 @@ define ('x_ite/Browser/Networking/urls',[],function ()
39945
40032
  if (getScriptURL () .match (/\.min\.js$/))
39946
40033
  file += ".min";
39947
40034
 
39948
- if (typeof globalRequire === "function" && typeof __filename === "string")
39949
- return this .getPath ("assets", "components", file + ".js");
39950
-
39951
40035
  return new URL ("assets/components/" + file + ".js", getScriptURL ()) .href;
39952
40036
  }
39953
40037
 
@@ -39955,42 +40039,20 @@ define ('x_ite/Browser/Networking/urls',[],function ()
39955
40039
  },
39956
40040
  getShaderUrl: function (file)
39957
40041
  {
39958
- if (typeof globalRequire === "function" && typeof __filename === "string")
39959
- return this .getPath ("assets", "shaders", file);
39960
-
39961
40042
  return new URL ("assets/shaders/" + file, getScriptURL ()) .href;
39962
40043
  },
39963
40044
  getFontsUrl: function (file)
39964
40045
  {
39965
- if (typeof globalRequire === "function" && typeof __filename === "string")
39966
- return this .getPath ("assets", "fonts", file);
39967
-
39968
40046
  return new URL ("assets/fonts/" + file, getScriptURL ()) .href;
39969
40047
  },
39970
40048
  getLinetypeUrl: function (index)
39971
40049
  {
39972
- if (typeof globalRequire === "function" && typeof __filename === "string")
39973
- return this .getPath ("assets", "linetype", index + ".png");
39974
-
39975
40050
  return new URL ("assets/linetype/" + index + ".png", getScriptURL ()) .href;
39976
40051
  },
39977
40052
  getHatchingUrl: function (index)
39978
40053
  {
39979
- if (typeof globalRequire === "function" && typeof __filename === "string")
39980
- return this .getPath ("assets", "hatching", index + ".png");
39981
-
39982
40054
  return new URL ("assets/hatching/" + index + ".png", getScriptURL ()) .href;
39983
40055
  },
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
40056
  };
39995
40057
 
39996
40058
  return new URLs ();
@@ -59906,7 +59968,7 @@ function (Fields,
59906
59968
  }
59907
59969
  else
59908
59970
  {
59909
- var index = this .activeLayer_ - 1;
59971
+ const index = this .activeLayer_ - 1;
59910
59972
 
59911
59973
  if (index >= 0 && index < this .layers_ .length)
59912
59974
  {
@@ -59922,24 +59984,23 @@ function (Fields,
59922
59984
  },
59923
59985
  set_layers: function ()
59924
59986
  {
59925
- var layers = this .layers_ .getValue ();
59987
+ const layers = this .layers_ .getValue ();
59926
59988
 
59927
59989
  this .layerNodes .length = 0;
59928
59990
 
59929
- for (var i = 0; i < this .order_ .length; ++ i)
59991
+ for (let index of this .order_)
59930
59992
  {
59931
- var index = this .order_ [i];
59932
-
59933
59993
  if (index === 0)
59994
+ {
59934
59995
  this .layerNodes .push (this .layerNode0);
59935
-
59996
+ }
59936
59997
  else
59937
59998
  {
59938
59999
  -- index;
59939
60000
 
59940
60001
  if (index >= 0 && index < layers .length)
59941
60002
  {
59942
- var layerNode = X3DCast (X3DConstants .X3DLayerNode, layers [index]);
60003
+ const layerNode = X3DCast (X3DConstants .X3DLayerNode, layers [index]);
59943
60004
 
59944
60005
  if (layerNode)
59945
60006
  this .layerNodes .push (layerNode);
@@ -59965,11 +60026,11 @@ function (Fields,
59965
60026
  },
59966
60027
  traverse: function (type, renderObject)
59967
60028
  {
59968
- var layerNodes = this .layerNodes;
60029
+ const layerNodes = this .layerNodes;
59969
60030
 
59970
60031
  if (type === TraverseType .POINTER)
59971
60032
  {
59972
- for (var i = 0, length = layerNodes .length; i < length; ++ i)
60033
+ for (let i = 0, length = layerNodes .length; i < length; ++ i)
59973
60034
  {
59974
60035
  this .getBrowser () .setLayerNumber (i);
59975
60036
  layerNodes [i] .traverse (type, renderObject);
@@ -59977,9 +60038,9 @@ function (Fields,
59977
60038
  }
59978
60039
  else
59979
60040
  {
59980
- for (var i = 0, length = layerNodes .length; i < length; ++ i)
60041
+ for (const layerNode of layerNodes)
59981
60042
  {
59982
- layerNodes [i] .traverse (type, renderObject);
60043
+ layerNode .traverse (type, renderObject);
59983
60044
  }
59984
60045
  }
59985
60046
  },
@@ -60114,10 +60175,10 @@ function (SFNode,
60114
60175
 
60115
60176
  for (const rootNode of rootNodes)
60116
60177
  {
60117
- const rootLayerSet = X3DCast (X3DConstants .LayerSet, rootNode);
60178
+ const layerSet = X3DCast (X3DConstants .LayerSet, rootNode);
60118
60179
 
60119
- if (rootLayerSet)
60120
- this .layerSet = rootLayerSet;
60180
+ if (layerSet)
60181
+ this .layerSet = layerSet;
60121
60182
  }
60122
60183
 
60123
60184
  this .layerSet .setLayer0 (this .layer0);
@@ -118218,7 +118279,7 @@ function ($,
118218
118279
  const url = urls .getProviderUrl (name);
118219
118280
 
118220
118281
  if (typeof globalRequire === "function" && typeof __filename === "string")
118221
- globalRequire (url);
118282
+ globalRequire (globalRequire ("url") .fileURLToPath (url));
118222
118283
 
118223
118284
  return url;
118224
118285
  }
@@ -118442,8 +118503,8 @@ const getScriptURL = (function ()
118442
118503
  {
118443
118504
  if (document .currentScript)
118444
118505
  var src = document .currentScript .src;
118445
- else if (typeof __filename === "string")
118446
- var src = __filename;
118506
+ else if (typeof globalRequire === "function" && typeof __filename === "string")
118507
+ var src = globalRequire ("url") .pathToFileURL (__filename) .href;
118447
118508
 
118448
118509
  return function ()
118449
118510
  {
@@ -118588,13 +118649,5 @@ function ()
118588
118649
  };
118589
118650
  });
118590
118651
 
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
118652
  })
118600
118653
  (typeof module === "object" ? module : undefined, typeof require === "function" ? require : undefined);