[[Programing]] > [[Blockly2017>Programing/Blockly2017]] > ġܥåȥڡꤹ

#title("Blockly1.0ġܥåȥڡˡ")

Blockly Developer ToolsWorkspace FactoryǤϡToolboxڡΥɥ֥å뤳ȤǤޤ

#contents

* Workspace Factoryδ [#m3d5e356]

+ [[Blockly Developer Tools:https://blockly-demo.appspot.com/static/demos/blockfactory/index.html]]ƤӽФ
+Workspace Factoryץ֤򥯥å
+ToolboxפȡWorkspaceפڤؤ

#ref("bdt_workspace_factory.png")

* Toolboxκ [#hc6a4ace]

** Toolboxǥ󤹤 [#j91f84a6]

Toolboxǥ󤹤ˤϡBlockly Developer ToolsWorkspace FactoryǡToolboxפ򤷤ޤ

¦Υڡ˥֥å¤٤ȡ¦Υڡ˥ץӥ塼ɽޤ

Blockly Developer ToolsBlock FactoryǺä֥å饤֥¸ƤСưŪWorkspace Factoryɤ߹ޤޤ

+Toolboxץ֤
+֡ܡץܥǥƥ꡼ɲ
+ ֥åɲäƥΡYour categoliesפ򤹤
+ ɲä֥å򡢺¦ΥڡToolboxɥåɥåפ

[[Code Editor:https://blockly-demo.appspot.com/static/demos/code/index.html]]Τ褦ʴ¸Υɥ֥åϡ֡ܡץܥ > Standard categolyפǥݡȤǤޤ


** ToolboxExport [#m437c351]

+Export>Toolbox
+  ****.xmlȤ¸


** ToolboxȤ߹ [#o80861ff]

index.html<xml id="toolbox" style="display: none"></xml>****.xml֤ޤ



* ڡΥޥ [#w54dcf90]

** ڡꤹ [#sbf502f9]

+Workspaceץ֤
+ ΥڡΥץꤹ

** 򥨥ݡȤ [#d29da7cc]

+Export>Starter Code
+  workspace.jsȤ¸

** ڡȤ߹ [#abd1c93a]

index.htmlΥץȤǡworkspaceѿꤹ륪ץworkspace.jsεҤ˽񤭴롣

ʲϡǥ˴ޤޤGenerating JavaScriptindex.htmlξ硣

 // before
 var workspace = Blockly.inject('blocklyDiv',
        {media: '../../media/',
         toolbox: document.getElementById('toolbox')});
    Blockly.Xml.domToWorkspace(document.getElementById('startBlocks'), workspace);

 // after
 var workspace = Blockly.inject('blocklyDiv',
       {media: '../../media/',
        toolbox: document.getElementById('toolbox')
	collapse : true, 
	comments : true, 
	disable : false, 
	maxBlocks : Infinity, 
	trashcan : true, 
	horizontalLayout : false, 
	toolboxPosition : 'start', 
	css : true, 
	media : 'https://blockly-demo.appspot.com/static/media/', 
	rtl : false, 
	scrollbars : false, 
	sounds : true, 
	oneBasedIndex : true, 
	grid : {
		spacing : 20, 
		length : 1, 
		colour : '#888', 
		snap : true
	}, 
	zoom : {
		controls : true, 
		wheel : true, 
		startScale : 1, 
		maxScale : 3, 
		minScale : 0.3, 
		scaleSpeed : 1.2
	}});
    Blockly.Xml.domToWorkspace(document.getElementById('startBlocks'), workspace);


* Υɥ֥å [#j98a111f]

** ɥ֥å¤٤ [#y85df6b1]

+Workspaceפ
+ Υɥ֥åڡ֤

** ɥ֥å򥨥ݡȤ [#n45bd50a]

+Export>Workspace Block
+  workspace.xmlȤ¸

**  ɥ֥åȤ߹ [#i0a73ca2]

index.html<xml id="startBlocks" style="display: none"></xml>workspace.xml֤ޤ

λݡȤxmlϡid="workspaceBlocks"פˤʤäƤΤǡʲǻꤷid˹碌ޤ

 Blockly.Xml.domToWorkspace(document.getElementById('startBlocks'),workspace);

ޤworkspace.xmlidϺۤɤߤ

* ¾ [#g76a495c]

- [[Blockly2017>Programing/Blockly2017]] 
- [[Blockly1.0֥åκ>Blockly/CustomBlock]]
- [[Blockly1.0ġܥåȥڡˡ>Blockly/Toolbox_WorkSpace]]



ȥå   ʬ Хåå   ñ측 ǽ   إ   ǽRSS