if (window.Canvas) { Canvas.enableAccelerometer = false; } $(document).ready(function() { if (window.WinMediaAssets) { window.WinMediaAssets.showTynker = true; } if (window.WinMediaLib) { window.WinMediaLib.showTynker = true; } if (window.WinCode) { WinCode.setCodeReadOnly(false); WinCode._enableInspector = true; WinCode._enableHideInSandbox = true; WinCode._enableLockInSandbox = true; } if (window.WinMediaAssets) { WinMediaAssets._ignoreHidden = true; } if (window.WinAssets) { WinAssets.enableAddByURL(true); WinAssets._enableHideInSandbox = true; WinAssets._enableLockInSandbox = true; } if (window.WinAnnotation) { WinAnnotation.allowAdvanced = true; } }); // Camera if (g_steps['registerExternalTrigger']) { g_steps['registerExternalTrigger'].hidden = false; } if (g_steps['blockLooksSetBubbleDock']) { g_steps['blockLooksSetBubbleDock'].hidden = false; } if (g_steps['blockLooksViewportCamera']) { g_steps['blockLooksViewportCamera'].hidden = false; } if (g_steps['valueSensingSoundLevel']) { g_steps['valueSensingSoundLevel'].hidden = false; } if (g_steps['valueSensingIsLoud']) { g_steps['valueSensingIsLoud'].hidden = false; } if (g_steps['valueSensingPlatformProperty']) { g_steps['valueSensingPlatformProperty'].hidden = false; } if (g_steps['blockControlJS']) { g_steps['blockControlJS'].hidden = false; } if (g_steps['valueControlJS']) { g_steps['valueControlJS'].hidden = false; } if (g_steps['registerExternalTrigger']) { g_palette[1].items.push({ label:'Advanced', items:[ g_steps['registerExternalTrigger'] ] }); } if (g_steps['blockControlRequestBlocking']) { g_palette[2].items.push({ label:'Beta', items:[ g_steps['blockControlRequestBlocking'], g_steps['blockControlPrint'], g_steps['blockControlJS'] ] }); } if (g_steps['valueSensingIsLoud']) { g_palette[6].items.push({ label:'Beta', items:[ g_steps['valueSensingPlatformProperty'], g_steps['valueSensingIsLoud'], g_steps['blockSensingSetTag'], g_steps['valueSensingGetTag'] ] }); } // Tiles if (g_steps['blockLooksSetZoom']) { g_steps['blockLooksSetZoom'].hidden = false; } if (g_steps['valueLooksGetZoom']) { g_steps['valueLooksGetZoom'].hidden = false; } if (g_steps['valueLooksGetTileAt']) { g_steps['valueLooksGetTileAt'].hidden = false; } if (g_steps['valueLooksGetTileAtPoint']) { g_steps['valueLooksGetTileAtPoint'].hidden = false; } if (g_steps['blockLooksSetTileAt']) { g_steps['blockLooksSetTileAtPoint'].hidden = false; } if (g_steps['blockLooksSetBubbleWidth']) { g_palette[5].items.push({ label:'Beta', items:[ g_steps['blockLooksSetBubbleWidth'], g_steps['blockLooksSetBubbleDock'], g_steps['blockLooksSetZoom'], g_steps['valueLooksGetZoom'], g_steps['valueLooksGetTileAt'], g_steps['valueLooksGetTileAtPoint'], g_steps['blockLooksSetTileAt'], g_steps['blockLooksSetTileAtPoint'] ] }); } // Drawing //if (g_steps['registerDraw']) { g_steps['registerDraw'].hidden = false; } if (g_steps['blockPenRedraw']) { g_steps['blockPenRedraw'].hidden = false; } if (g_steps['blockPenClearRect']) { g_palette[9].items.push(g_steps['blockPenClearRect']); } if (g_steps['registerDraw']) { g_steps['registerDraw'].hidden = false; g_palette[9].items.push(g_steps['registerDraw']); } if (g_steps['blockPenRedraw']) { g_palette[9].items.push(g_steps['blockPenRedraw']); } if (g_steps['blockPenClearRect']) { g_palette[9].items.push(g_steps['blockPenClearRect']); } if (g_steps['valueSensingSoundLevel']) { g_palette[5].items.push(g_steps['valueSensingSoundLevel']); } // Networking if (g_steps['blockNetworkSaveValue']) { g_steps['blockNetworkSaveValue'].hidden = false; } if (g_steps['blockNetworkLoadValue']) { g_steps['blockNetworkLoadValue'].hidden = false; } if (g_steps['valueNetworkParse']) { g_steps['valueNetworkParse'].hidden = false; } if (g_steps['blockNetworkAPI']) { g_steps['blockNetworkAPI'].hidden = false; } if (g_steps['valueNetworkResult']) { g_steps['valueNetworkResult'].hidden = false; } if (g_steps['blockNetworkSaveValue']) { var networkBlocks = { label:'Network', cat:'network', items:[ g_steps['blockNetworkSaveValue'], g_steps['blockNetworkLoadValue'], g_steps['valueNetworkParse'], g_steps['blockNetworkAPI'], g_steps['valueNetworkResult'] ] }; g_palette.push(networkBlocks); } if (g_steps['blockParticleEmitStart']) { g_steps['blockParticleEmitStart'].hidden = false; g_steps['blockParticleEmitStop'].hidden = false; g_steps['blockParticleSetRate'].hidden = false; g_steps['blockParticleSetVectorVelocity'].hidden = false; g_steps['blockParticleSetRadialVelocity'].hidden = false; g_steps['blockParticleSetLifetime'].hidden = false; g_steps['blockParticleSetMass'].hidden = false; g_steps['blockParticleSetGravity'].hidden = false; g_steps['blockParticleSetAttraction'].hidden = false; g_steps['blockParticleSetRadius'].hidden = false; g_steps['blockParticleSetScale'].hidden = false; g_steps['blockParticleSetAlpha'].hidden = false; g_steps['blockParticleSetColor'].hidden = false; g_steps['blockParticleSetImage'].hidden = false; g_palette.push({ label:'Particles', cat:'particles', items:[ g_steps['blockParticleEmitStart'], g_steps['blockParticleEmitStop'], g_steps['blockParticleSetRate'], g_steps['blockParticleSetVectorVelocity'], g_steps['blockParticleSetRadialVelocity'], g_steps['blockParticleSetLifetime'], g_steps['blockParticleSetMass'], g_steps['blockParticleSetGravity'], g_steps['blockParticleSetAttraction'], g_steps['blockParticleSetRadius'], g_steps['blockParticleSetScale'], g_steps['blockParticleSetAlpha'], g_steps['blockParticleSetColor'], g_steps['blockParticleSetImage'] ] }); } /* // Test for hardware function testHardware() { $.ajax({ dataType:'json', timeout:1000, url:'http://localhost:8888/ping?callback=?', jsonpCallback : 'jsonCallback', success : function(data) { if (data.status != 'OK' || data.version != '1.0' || data.plugins.indexOf('wedo') < 0) { window.setTimeout(testHardware, 3000); } else { g_palette.push({ label:'Hardware', cat:'hardware', items:[ g_steps['blockHardwareMotor'], g_steps['valueHardwareDistance'], g_steps['valueHardwareTilt'], ] }); WinTools.reset(); WinTools.adjustWindow(); } // No polling for now // }, // error : function(data) { // window.setTimeout(testHardware, 3000); } }); } window.setTimeout(testHardware, 3000); */ // IDE commands if (g_steps['valueControlSerializeActor']) { g_steps['valueControlSerializeActor'].hidden = false; g_steps['blockControlDeserializeActor'].hidden = false; g_steps['blockControlRemoveActor'].hidden = false; g_steps['valueControlSerializeScripts'].hidden = false; g_steps['blockControlDeserializeScripts'].hidden = false; g_steps['blockControlRemoveScriptsWithTag'].hidden = false; g_steps['blockLooksDialog'].hidden = false; g_steps['blockLooksPromptChoices'].hidden = false; var systemBlocks = { label:'IDE', cat:'system', items:[ { label:'Runtime', items:[ {cat:'events', label:'send message {events:loadProject} to {actor:TynkerRuntime} with {string}', func:'blockControlPostMessage'}, {cat:'events', label:'send message {events:visitUrl} to {actor:TynkerRuntime} with {string}', func:'blockControlPostMessage'}, {cat:'events', label:'send message {events:turboMode} to {actor:TynkerRuntime} with {string:true}', func:'blockControlPostMessage'}, {cat:'events', label:'send message {events:hideRunIndicator} to {actor:TynkerRuntime} with {string:true}', func:'blockControlPostMessage'}, {cat:'events', label:'send message {events:aabbCollision} to {actor:TynkerRuntime} with {string:true}', func:'blockControlPostMessage'}, {cat:'events', label:'send message {events:physicsDebug} to {actor:TynkerRuntime} with {string:true}', func:'blockControlPostMessage'}, {cat:'events', label:'send message {events:replaceCostume} to {actor:TynkerRuntime} with {string:.mp3}', func:'blockControlPostMessage'}, {cat:'events', label:'send message {events:playSound} to {actor:TynkerRuntime} with {string:.mp3}', func:'blockControlPostMessage'}, {cat:'events', label:'send message {events:loadRig} to {actor:TynkerRuntime} with {string}', func:'blockControlPostMessage'}, {cat:'events', label:'send message {events:staticPlacement} to {actor:TynkerRuntime} with {string:true}', func:'blockControlPostMessage'}, {cat:'events', label:'send message {events:penLayerStaticPlacement} to {actor:TynkerRuntime} with {string:true}', func:'blockControlPostMessage'} ] }, { label:'Localization', items:[ g_steps['valueControlLanguage'], g_steps['valueControlLanguageWithDefault'] ] }, { label:'Serialization', items:[ g_steps['valueControlSerializeActor'], g_steps['blockControlDeserializeActor'], g_steps['blockControlRemoveActor'], g_steps['valueControlSerializeScripts'], g_steps['blockControlDeserializeScripts'], g_steps['blockControlRemoveScriptsWithTag'] ] }, { label:'User Interface', items:[ g_steps['blockLooksDialog'], g_steps['blockLooksPromptChoices'] ] } ] }; g_palette.push(systemBlocks); }