From 4afc368bddedf81f7a18af6d353f95eac2d25106 Mon Sep 17 00:00:00 2001 From: Xuan Sang LE Date: Thu, 8 Mar 2018 19:33:50 +0100 Subject: [PATCH] code block --- src/packages/CodeBlock/Makefile | 11 + .../CodeBlock/blockly/blockly_compressed.js | 1633 +++++++++++++++++ .../CodeBlock/blockly/blocks_compressed.js | 164 ++ src/packages/CodeBlock/blockly/en.js | 430 +++++ .../blockly/javascript_compressed.js | 95 + src/packages/CodeBlock/main.coffee | 81 + src/packages/CodeBlock/package.json | 13 + src/packages/CodeBlock/scheme.html | 302 +++ 8 files changed, 2729 insertions(+) create mode 100644 src/packages/CodeBlock/Makefile create mode 100644 src/packages/CodeBlock/blockly/blockly_compressed.js create mode 100644 src/packages/CodeBlock/blockly/blocks_compressed.js create mode 100644 src/packages/CodeBlock/blockly/en.js create mode 100644 src/packages/CodeBlock/blockly/javascript_compressed.js create mode 100644 src/packages/CodeBlock/main.coffee create mode 100644 src/packages/CodeBlock/package.json create mode 100644 src/packages/CodeBlock/scheme.html diff --git a/src/packages/CodeBlock/Makefile b/src/packages/CodeBlock/Makefile new file mode 100644 index 0000000..92852f7 --- /dev/null +++ b/src/packages/CodeBlock/Makefile @@ -0,0 +1,11 @@ +coffee_files = main.coffee + +jsfiles = blockly/blockly_compressed.js blockly/en.js blockly/blocks_compressed.js blockly/javascript_compressed.js + +cssfiles = + +copyfiles = scheme.html package.json + + +PKG_NAME=CodeBlock +include ../pkg.mk \ No newline at end of file diff --git a/src/packages/CodeBlock/blockly/blockly_compressed.js b/src/packages/CodeBlock/blockly/blockly_compressed.js new file mode 100644 index 0000000..d8878a0 --- /dev/null +++ b/src/packages/CodeBlock/blockly/blockly_compressed.js @@ -0,0 +1,1633 @@ +// Do not edit this file; automatically generated by build.py. +'use strict'; + +var $jscomp=$jscomp||{};$jscomp.scope={};var COMPILED=!0,goog=goog||{};goog.global=this;goog.isDef=function(a){return void 0!==a};goog.isString=function(a){return"string"==typeof a};goog.isBoolean=function(a){return"boolean"==typeof a};goog.isNumber=function(a){return"number"==typeof a}; +goog.exportPath_=function(a,b,c){a=a.split(".");c=c||goog.global;a[0]in c||!c.execScript||c.execScript("var "+a[0]);for(var d;a.length&&(d=a.shift());)!a.length&&goog.isDef(b)?c[d]=b:c=c[d]&&c[d]!==Object.prototype[d]?c[d]:c[d]={}}; +goog.define=function(a,b){var c=b;if(!COMPILED){var d=goog.global.CLOSURE_UNCOMPILED_DEFINES,e=goog.global.CLOSURE_DEFINES;d&&void 0===d.nodeType&&Object.prototype.hasOwnProperty.call(d,a)?c=d[a]:e&&void 0===e.nodeType&&Object.prototype.hasOwnProperty.call(e,a)&&(c=e[a])}goog.exportPath_(a,c)};goog.DEBUG=!1;goog.LOCALE="en";goog.TRUSTED_SITE=!0;goog.STRICT_MODE_COMPATIBLE=!1;goog.DISALLOW_TEST_ONLY_CODE=COMPILED&&!goog.DEBUG;goog.ENABLE_CHROME_APP_SAFE_SCRIPT_LOADING=!1; +goog.provide=function(a){if(goog.isInModuleLoader_())throw Error("goog.provide can not be used within a goog.module.");if(!COMPILED&&goog.isProvided_(a))throw Error('Namespace "'+a+'" already declared.');goog.constructNamespace_(a)};goog.constructNamespace_=function(a,b){if(!COMPILED){delete goog.implicitNamespaces_[a];for(var c=a;(c=c.substring(0,c.lastIndexOf(".")))&&!goog.getObjectByName(c);)goog.implicitNamespaces_[c]=!0}goog.exportPath_(a,b)};goog.VALID_MODULE_RE_=/^[a-zA-Z_$][a-zA-Z0-9._$]*$/; +goog.module=function(a){if(!goog.isString(a)||!a||-1==a.search(goog.VALID_MODULE_RE_))throw Error("Invalid module identifier");if(!goog.isInModuleLoader_())throw Error("Module "+a+" has been loaded incorrectly. Note, modules cannot be loaded as normal scripts. They require some kind of pre-processing step. You're likely trying to load a module via a script tag or as a part of a concatenated bundle without rewriting the module. For more info see: https://github.com/google/closure-library/wiki/goog.module:-an-ES6-module-like-alternative-to-goog.provide."); +if(goog.moduleLoaderState_.moduleName)throw Error("goog.module may only be called once per module.");goog.moduleLoaderState_.moduleName=a;if(!COMPILED){if(goog.isProvided_(a))throw Error('Namespace "'+a+'" already declared.');delete goog.implicitNamespaces_[a]}};goog.module.get=function(a){return goog.module.getInternal_(a)}; +goog.module.getInternal_=function(a){if(!COMPILED){if(a in goog.loadedModules_)return goog.loadedModules_[a];if(!goog.implicitNamespaces_[a])return a=goog.getObjectByName(a),null!=a?a:null}return null};goog.moduleLoaderState_=null;goog.isInModuleLoader_=function(){return null!=goog.moduleLoaderState_}; +goog.module.declareLegacyNamespace=function(){if(!COMPILED&&!goog.isInModuleLoader_())throw Error("goog.module.declareLegacyNamespace must be called from within a goog.module");if(!COMPILED&&!goog.moduleLoaderState_.moduleName)throw Error("goog.module must be called prior to goog.module.declareLegacyNamespace.");goog.moduleLoaderState_.declareLegacyNamespace=!0}; +goog.setTestOnly=function(a){if(goog.DISALLOW_TEST_ONLY_CODE)throw a=a||"",Error("Importing test-only code into non-debug environment"+(a?": "+a:"."));};goog.forwardDeclare=function(a){};COMPILED||(goog.isProvided_=function(a){return a in goog.loadedModules_||!goog.implicitNamespaces_[a]&&goog.isDefAndNotNull(goog.getObjectByName(a))},goog.implicitNamespaces_={"goog.module":!0}); +goog.getObjectByName=function(a,b){for(var c=a.split("."),d=b||goog.global,e=0;e>>0);goog.uidCounter_=0;goog.getHashCode=goog.getUid; +goog.removeHashCode=goog.removeUid;goog.cloneObject=function(a){var b=goog.typeOf(a);if("object"==b||"array"==b){if(a.clone)return a.clone();b="array"==b?[]:{};for(var c in a)b[c]=goog.cloneObject(a[c]);return b}return a};goog.bindNative_=function(a,b,c){return a.call.apply(a.bind,arguments)}; +goog.bindJs_=function(a,b,c){if(!a)throw Error();if(2Number(a[1])?!1:b('(()=>{"use strict";class X{constructor(){if(new.target!=String)throw 1;this.x=42}}let q=Reflect.construct(X,[],String);if(q.x!=42||!(q instanceof String))throw 1;for(const a of[2,3]){if(a==2)continue;function f(z={a}){let a=0;return z.a}{function f(){return 0;}}return f()==3}})()')});a("es6-impl",function(){return!0});a("es7",function(){return b("2 ** 2 == 4")});a("es8",function(){return b("async () => 1, true")});a("es_next",function(){return b("({...rest} = {}), true")}); +return c},goog.Transpiler.prototype.needsTranspile=function(a){if("always"==goog.TRANSPILE)return!0;if("never"==goog.TRANSPILE)return!1;this.requiresTranspilation_||(this.requiresTranspilation_=this.createRequiresTranspilation_());if(a in this.requiresTranspilation_)return this.requiresTranspilation_[a];throw Error("Unknown language mode: "+a);},goog.Transpiler.prototype.transpile=function(a,b){return goog.transpile_(a,b)},goog.transpiler_=new goog.Transpiler,goog.DebugLoader=function(){this.dependencies_= +{loadFlags:{},nameToPath:{},requires:{},visited:{},written:{},deferred:{}};this.oldIeWaiting_=!1;this.queuedModules_=[];this.lastNonModuleScriptIndex_=0},goog.DebugLoader.IS_OLD_IE_=!(goog.global.atob||!goog.global.document||!goog.global.document.all),goog.DebugLoader.prototype.earlyProcessLoad=function(a){goog.DebugLoader.IS_OLD_IE_&&this.maybeProcessDeferredDep_(a)},goog.DebugLoader.prototype.load=function(a){var b=this.getPathFromDeps_(a);if(b){var c=[],d={},e=this.dependencies_,f=this,g=function(a){if(!(a in +e.written||a in e.visited)){e.visited[a]=!0;if(a in e.requires)for(var b in e.requires[a])if(!f.isProvided(b))if(b in e.nameToPath)g(e.nameToPath[b]);else throw Error("Undefined nameToPath for "+b);a in d||(d[a]=!0,c.push(a))}};g(b);for(a=0;a\x3c/script>')},goog.DebugLoader.prototype.appendScriptSrcNode_=function(a){var b=goog.global.document,c=b.createElement("script");c.type="text/javascript";c.src=a;c.defer=!1;c.async=!1;b.head.appendChild(c)},goog.DebugLoader.prototype.writeScriptTag_=function(a,b){if(this.inHtmlDocument()){var c=goog.global.document; +if(!goog.ENABLE_CHROME_APP_SAFE_SCRIPT_LOADING&&"complete"==c.readyState){if(/\bdeps.js$/.test(a))return!1;throw Error('Cannot write "'+a+'" after document load');}if(void 0===b)if(goog.DebugLoader.IS_OLD_IE_){this.oldIeWaiting_=!0;var d=" onreadystatechange='goog.debugLoader_.onScriptLoad_(this, "+ ++this.lastNonModuleScriptIndex_+")' ";c.write('