Merge pull request #101 from daarond/master

PHP Generator Support
This commit is contained in:
Neil Fraser
2015-06-04 15:06:26 -07:00
21 changed files with 2066 additions and 8 deletions

View File

@@ -243,7 +243,7 @@ Code.LANG = Code.getLang();
* List of tab names.
* @private
*/
Code.TABS_ = ['blocks', 'javascript', 'python', 'dart', 'xml'];
Code.TABS_ = ['blocks', 'javascript', 'php', 'python', 'dart', 'xml'];
Code.selected = 'blocks';
@@ -324,6 +324,14 @@ Code.renderContent = function() {
code = prettyPrintOne(code, 'py');
content.innerHTML = code;
}
} else if (content.id == 'content_php') {
code = Blockly.PHP.workspaceToCode(Code.workspace);
content.textContent = code;
if (typeof prettyPrintOne == 'function') {
code = content.innerHTML;
code = prettyPrintOne(code, 'php');
content.innerHTML = code;
}
} else if (content.id == 'content_dart') {
code = Blockly.Dart.workspaceToCode(Code.workspace);
content.textContent = code;