From 15147968083b5ae48f6d4efc3d34502bf5a80d8f Mon Sep 17 00:00:00 2001 From: Paul M-W Date: Wed, 21 Mar 2018 13:58:26 -0700 Subject: [PATCH 1/9] demo of where to change the block colors --- blocks/colour.js | 2 +- blocks/lists.js | 2 +- blocks/logic.js | 2 +- blocks/loops.js | 2 +- blocks/math.js | 2 +- blocks/procedures.js | 2 +- blocks/text.js | 2 +- blocks/variables.js | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/blocks/colour.js b/blocks/colour.js index 99e5aacdcaf..18616b0db50 100644 --- a/blocks/colour.js +++ b/blocks/colour.js @@ -40,7 +40,7 @@ goog.require('Blockly.Blocks'); * This should be the same as Blockly.Msg.COLOUR_HUE. * @readonly */ -Blockly.Constants.Colour.HUE = 20; +Blockly.Constants.Colour.HUE = "#7D7D7D"; /** @deprecated Use Blockly.Constants.Colour.HUE */ Blockly.Blocks.colour.HUE = Blockly.Constants.Colour.HUE; diff --git a/blocks/lists.js b/blocks/lists.js index 3c7ef341dc4..452d02b6465 100644 --- a/blocks/lists.js +++ b/blocks/lists.js @@ -40,7 +40,7 @@ goog.require('Blockly.Blocks'); * This should be the same as Blockly.Msg.LISTS_HUE. * @readonly */ -Blockly.Constants.Lists.HUE = 260; +Blockly.Constants.Lists.HUE = "#49A6D4"; /** @deprecated Use Blockly.Constants.Lists.HUE */ Blockly.Blocks.lists.HUE = Blockly.Constants.Lists.HUE; diff --git a/blocks/logic.js b/blocks/logic.js index f27c4e76928..c656a5e3d10 100644 --- a/blocks/logic.js +++ b/blocks/logic.js @@ -40,7 +40,7 @@ goog.require('Blockly.Blocks'); * Should be the same as Blockly.Msg.LOGIC_HUE. * @readonly */ -Blockly.Constants.Logic.HUE = 210; +Blockly.Constants.Logic.HUE = "#77AB41"; /** @deprecated Use Blockly.Constants.Logic.HUE */ Blockly.Blocks.logic.HUE = Blockly.Constants.Logic.HUE; diff --git a/blocks/loops.js b/blocks/loops.js index f0d2a98b986..d8a460ec90a 100644 --- a/blocks/loops.js +++ b/blocks/loops.js @@ -40,7 +40,7 @@ goog.require('Blockly.Blocks'); * Should be the same as Blockly.Msg.LOOPS_HUE * @readonly */ -Blockly.Constants.Loops.HUE = 120; +Blockly.Constants.Loops.HUE = "#B18E35"; /** @deprecated Use Blockly.Constants.Loops.HUE */ Blockly.Blocks.loops.HUE = Blockly.Constants.Loops.HUE; diff --git a/blocks/math.js b/blocks/math.js index 0aff2ab3d46..3e6f83aaf0d 100644 --- a/blocks/math.js +++ b/blocks/math.js @@ -40,7 +40,7 @@ goog.require('Blockly.Blocks'); * Should be the same as Blockly.Msg.MATH_HUE * @readonly */ -Blockly.Constants.Math.HUE = 230; +Blockly.Constants.Math.HUE = "#3F71B5"; /** @deprecated Use Blockly.Constants.Math.HUE */ Blockly.Blocks.math.HUE = Blockly.Constants.Math.HUE; diff --git a/blocks/procedures.js b/blocks/procedures.js index 223a655cd19..35f8e6a13ce 100644 --- a/blocks/procedures.js +++ b/blocks/procedures.js @@ -32,7 +32,7 @@ goog.require('Blockly.Blocks'); /** * Common HSV hue for all blocks in this category. */ -Blockly.Blocks.procedures.HUE = 290; +Blockly.Blocks.procedures.HUE = "#7C5385"; Blockly.Blocks['procedures_defnoreturn'] = { /** diff --git a/blocks/text.js b/blocks/text.js index 348f9957924..cc41df9cbeb 100644 --- a/blocks/text.js +++ b/blocks/text.js @@ -35,7 +35,7 @@ goog.require('Blockly.Blocks'); * Should be the same as Blockly.Msg.TEXTS_HUE * @readonly */ -Blockly.Constants.Text.HUE = 160; +Blockly.Constants.Text.HUE = "#B32D5E"; /** @deprecated Use Blockly.Constants.Text.HUE */ Blockly.Blocks.texts.HUE = Blockly.Constants.Text.HUE; diff --git a/blocks/variables.js b/blocks/variables.js index 07ae8e6e50e..36f22c92809 100644 --- a/blocks/variables.js +++ b/blocks/variables.js @@ -40,7 +40,7 @@ goog.require('Blockly.Blocks'); * Should be the same as Blockly.Msg.VARIABLES_HUE. * @readonly */ -Blockly.Constants.Variables.HUE = 330; +Blockly.Constants.Variables.HUE = "#D05F2D"; /** @deprecated Use Blockly.Constants.Variables.HUE */ Blockly.Blocks.variables.HUE = Blockly.Constants.Variables.HUE; From 30d249df719f94dc6960fbd1b7ed4d8a7577330e Mon Sep 17 00:00:00 2001 From: Paul M-W Date: Wed, 21 Mar 2018 14:00:53 -0700 Subject: [PATCH 2/9] change build to access https closure compiler endpoint --- build.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.py b/build.py index 58789869082..067503ffda0 100755 --- a/build.py +++ b/build.py @@ -354,7 +354,7 @@ def gen_generator(self, language): def do_compile(self, params, target_filename, filenames, remove): # Send the request to Google. headers = {"Content-type": "application/x-www-form-urlencoded"} - conn = httplib.HTTPConnection("closure-compiler.appspot.com") + conn = httplib.HTTPSConnection("closure-compiler.appspot.com") conn.request("POST", "/compile", urllib.urlencode(params), headers) response = conn.getresponse() json_str = response.read() From cbcbd0009ecd95ba47c2814445a3b3e5746340ad Mon Sep 17 00:00:00 2001 From: yuexi Date: Wed, 28 Mar 2018 15:05:53 -0700 Subject: [PATCH 3/9] update blockly color in blockly --- blockly_compressed.js | 3152 ++++++++++++++++------------------------- blocks/colour.js | 2 +- blocks/lists.js | 2 +- blocks/logic.js | 2 +- blocks/loops.js | 2 +- blocks/math.js | 2 +- blocks/procedures.js | 2 +- blocks/text.js | 2 +- blocks/variables.js | 2 +- blocks_compressed.js | 28 +- 10 files changed, 1227 insertions(+), 1969 deletions(-) diff --git a/blockly_compressed.js b/blockly_compressed.js index c9fc4aada73..0207472392f 100644 --- a/blockly_compressed.js +++ b/blockly_compressed.js @@ -1,22 +1,16 @@ -var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.checkStringArgs=function(a,b,c){if(null==a)throw new TypeError("The 'this' value for String.prototype."+c+" must not be null or undefined");if(b instanceof RegExp)throw new TypeError("First argument to String.prototype."+c+" must not be a regular expression");return a+""};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1; -$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){a!=Array.prototype&&a!=Object.prototype&&(a[b]=c.value)};$jscomp.getGlobal=function(a){return"undefined"!=typeof window&&window===a?a:"undefined"!=typeof global&&null!=global?global:a};$jscomp.global=$jscomp.getGlobal(this); -$jscomp.polyfill=function(a,b,c,d){if(b){c=$jscomp.global;a=a.split(".");for(d=0;da||1342177279>>=1)b+=b;return d}},"es6","es3");$jscomp.findInternal=function(a,b,c){a instanceof String&&(a=String(a));for(var d=a.length,e=0;e=e}},"es6","es3"); -$jscomp.polyfill("Array.prototype.find",function(a){return a?a:function(a,c){return $jscomp.findInternal(this,a,c).v}},"es6","es3");$jscomp.polyfill("String.prototype.startsWith",function(a){return a?a:function(a,c){var b=$jscomp.checkStringArgs(this,a,"startsWith");a+="";var e=b.length,f=a.length;c=Math.max(0,Math.min(c|0,b.length));for(var g=0;g=f}},"es6","es3");$jscomp.SYMBOL_PREFIX="jscomp_symbol_"; -$jscomp.initSymbol=function(){$jscomp.initSymbol=function(){};$jscomp.global.Symbol||($jscomp.global.Symbol=$jscomp.Symbol)};$jscomp.Symbol=function(){var a=0;return function(b){return $jscomp.SYMBOL_PREFIX+(b||"")+a++}}(); -$jscomp.initSymbolIterator=function(){$jscomp.initSymbol();var a=$jscomp.global.Symbol.iterator;a||(a=$jscomp.global.Symbol.iterator=$jscomp.global.Symbol("iterator"));"function"!=typeof Array.prototype[a]&&$jscomp.defineProperty(Array.prototype,a,{configurable:!0,writable:!0,value:function(){return $jscomp.arrayIterator(this)}});$jscomp.initSymbolIterator=function(){}};$jscomp.arrayIterator=function(a){var b=0;return $jscomp.iteratorPrototype(function(){return b>>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("function"===typeof 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.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(2\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');}void 0===b?goog.DebugLoader.IS_OLD_IE_?(this.oldIeWaiting_=!0,b=" onreadystatechange='goog.debugLoader_.onScriptLoad_(this, "+ ++this.lastNonModuleScriptIndex_+")' ",c.write('