diff --git a/blockly_compressed_horizontal.js b/blockly_compressed_horizontal.js index 22bde3b5e5..a9fc6b59c4 100644 --- a/blockly_compressed_horizontal.js +++ b/blockly_compressed_horizontal.js @@ -2187,7 +2187,7 @@ Blockly.Toolbox.Category=function(a,b,c){this.parent_=a;this.parentHtml_=b;this. Blockly.Toolbox.Category.prototype.dispose=function(){this.item_&&(goog.dom.removeNode(this.item_),this.item=null);this.contents_=this.parentHtml_=this.parent_=null};Blockly.Toolbox.Category.prototype.getMenuItemClassName_=function(a){var b=["scratchCategoryMenuItem","scratchCategoryId-"+this.id_];a&&b.push("categorySelected");return b.join(" ")}; Blockly.Toolbox.Category.prototype.createDom=function(){var a=this.parent_.parent_;this.item_=goog.dom.createDom("div",{"class":this.getMenuItemClassName_()});this.label_=goog.dom.createDom("div",{"class":"scratchCategoryMenuItemLabel"},Blockly.utils.replaceMessageReferences(this.name_));this.iconURI_?(this.bubble_=goog.dom.createDom("div",{"class":"scratchCategoryItemIcon"}),this.bubble_.style.backgroundImage="url("+this.iconURI_+")"):(this.bubble_=goog.dom.createDom("div",{"class":"scratchCategoryItemBubble"}), this.bubble_.style.backgroundColor=this.colour_,this.bubble_.style.borderColor=this.secondaryColour_);this.item_.appendChild(this.bubble_);this.item_.appendChild(this.label_);this.parentHtml_.appendChild(this.item_);Blockly.bindEvent_(this.item_,"mouseup",a,a.setSelectedItemFactory(this))};Blockly.Toolbox.Category.prototype.setSelected=function(a){this.item_.className=this.getMenuItemClassName_(a)};Blockly.Toolbox.Category.prototype.parseContents_=function(a){for(var b=0,c;c=a.childNodes[b];b++)if(c.tagName)switch(c.tagName.toUpperCase()){case "BLOCK":case "SHADOW":case "LABEL":case "BUTTON":case "SEP":case "TEXT":this.contents_.push(c)}}; -Blockly.Toolbox.Category.prototype.getContents=function(){return this.custom_?this.custom_:this.contents_};Blockly.Toolbox.Category.prototype.setColour=function(a){var b=a.getAttribute("colour");a=a.getAttribute("secondaryColour");goog.isString(b)?(b.match(/^#[0-9a-fA-F]{6}$/)?this.colour_=b:this.colour_=Blockly.hueToRgb(b),a.match(/^#[0-9a-fA-F]{6}$/)?this.secondaryColour_=a:this.secondaryColour_=Blockly.hueToRgb(a),this.hasColours_=!0):this.secondaryColour_=this.colour_="#000000"};Blockly.Css={};Blockly.Css.Cursor={OPEN:"handopen",CLOSED:"handclosed",DELETE:"handdelete"};Blockly.Css.currentCursor_="";Blockly.Css.styleSheet_=null;Blockly.Css.mediaPath_=""; +Blockly.Toolbox.Category.prototype.getContents=function(){return this.custom_?this.custom_:this.contents_};Blockly.Toolbox.Category.prototype.setColour=function(a){var b=a.getAttribute("colour");a=a.getAttribute("secondaryColour");goog.isString(b)?(b.match(/^#[0-9a-fA-F]{6,8}$/)?this.colour_=b:this.colour_=Blockly.hueToRgb(b),a.match(/^#[0-9a-fA-F]{6,8}$/)?this.secondaryColour_=a:this.secondaryColour_=Blockly.hueToRgb(a),this.hasColours_=!0):this.secondaryColour_=this.colour_="#000000"};Blockly.Css={};Blockly.Css.Cursor={OPEN:"handopen",CLOSED:"handclosed",DELETE:"handdelete"};Blockly.Css.currentCursor_="";Blockly.Css.styleSheet_=null;Blockly.Css.mediaPath_=""; Blockly.Css.inject=function(a,b){Blockly.Css.styleSheet_&&document.head.removeChild(Blockly.Css.styleSheet_.ownerNode);var c=".blocklyDraggable {}\n";a&&(c+=Blockly.Css.CONTENT.join("\n"),Blockly.FieldDate&&(c+=Blockly.FieldDate.CSS.join("\n")));Blockly.Css.mediaPath_=b.replace(/[\\\/]$/,"");c=c.replace(/<<>>/g,Blockly.Css.mediaPath_);a=Object.keys(Blockly.Colours).sort(function(a,b){return b.length-a.length});b=0;for(var d;d=a[b];b++)c=c.replace(new RegExp("\\$colour\\_"+d,"g"),Blockly.Colours[d]); a=document.createElement("style");document.head.insertBefore(a,document.head.firstChild);c=document.createTextNode(c);a.appendChild(c);Blockly.Css.styleSheet_=a.sheet};Blockly.Css.setCursor=function(a){console.warn("Deprecated call to Blockly.Css.setCursor.See https://github.com/google/blockly/issues/981 for context")}; Blockly.Css.CONTENT=[".blocklySvg {","background-color: $colour_workspace;","outline: none;","overflow: hidden;","position: absolute;","display: block;","}",".blocklyRelativeWrapper {","position: relative;","width: 100%;","height: 100%;","}",".blocklyWidgetDiv {","display: none;","position: absolute;","z-index: 99999;","}",".injectionDiv {","height: 100%;","position: relative;","overflow: hidden;","touch-action: none","}",".blocklyNonSelectable {","user-select: none;","-moz-user-select: none;","-webkit-user-select: none;", diff --git a/blockly_compressed_vertical.js b/blockly_compressed_vertical.js index 4884f33341..abe9dd0626 100644 --- a/blockly_compressed_vertical.js +++ b/blockly_compressed_vertical.js @@ -2215,7 +2215,7 @@ Blockly.Toolbox.Category=function(a,b,c){this.parent_=a;this.parentHtml_=b;this. Blockly.Toolbox.Category.prototype.dispose=function(){this.item_&&(goog.dom.removeNode(this.item_),this.item=null);this.contents_=this.parentHtml_=this.parent_=null};Blockly.Toolbox.Category.prototype.getMenuItemClassName_=function(a){var b=["scratchCategoryMenuItem","scratchCategoryId-"+this.id_];a&&b.push("categorySelected");return b.join(" ")}; Blockly.Toolbox.Category.prototype.createDom=function(){var a=this.parent_.parent_;this.item_=goog.dom.createDom("div",{"class":this.getMenuItemClassName_()});this.label_=goog.dom.createDom("div",{"class":"scratchCategoryMenuItemLabel"},Blockly.utils.replaceMessageReferences(this.name_));this.iconURI_?(this.bubble_=goog.dom.createDom("div",{"class":"scratchCategoryItemIcon"}),this.bubble_.style.backgroundImage="url("+this.iconURI_+")"):(this.bubble_=goog.dom.createDom("div",{"class":"scratchCategoryItemBubble"}), this.bubble_.style.backgroundColor=this.colour_,this.bubble_.style.borderColor=this.secondaryColour_);this.item_.appendChild(this.bubble_);this.item_.appendChild(this.label_);this.parentHtml_.appendChild(this.item_);Blockly.bindEvent_(this.item_,"mouseup",a,a.setSelectedItemFactory(this))};Blockly.Toolbox.Category.prototype.setSelected=function(a){this.item_.className=this.getMenuItemClassName_(a)};Blockly.Toolbox.Category.prototype.parseContents_=function(a){for(var b=0,c;c=a.childNodes[b];b++)if(c.tagName)switch(c.tagName.toUpperCase()){case "BLOCK":case "SHADOW":case "LABEL":case "BUTTON":case "SEP":case "TEXT":this.contents_.push(c)}}; -Blockly.Toolbox.Category.prototype.getContents=function(){return this.custom_?this.custom_:this.contents_};Blockly.Toolbox.Category.prototype.setColour=function(a){var b=a.getAttribute("colour");a=a.getAttribute("secondaryColour");goog.isString(b)?(b.match(/^#[0-9a-fA-F]{6}$/)?this.colour_=b:this.colour_=Blockly.hueToRgb(b),a.match(/^#[0-9a-fA-F]{6}$/)?this.secondaryColour_=a:this.secondaryColour_=Blockly.hueToRgb(a),this.hasColours_=!0):this.secondaryColour_=this.colour_="#000000"};Blockly.Css={};Blockly.Css.Cursor={OPEN:"handopen",CLOSED:"handclosed",DELETE:"handdelete"};Blockly.Css.currentCursor_="";Blockly.Css.styleSheet_=null;Blockly.Css.mediaPath_=""; +Blockly.Toolbox.Category.prototype.getContents=function(){return this.custom_?this.custom_:this.contents_};Blockly.Toolbox.Category.prototype.setColour=function(a){var b=a.getAttribute("colour");a=a.getAttribute("secondaryColour");goog.isString(b)?(b.match(/^#[0-9a-fA-F]{6,8}$/)?this.colour_=b:this.colour_=Blockly.hueToRgb(b),a.match(/^#[0-9a-fA-F]{6,8}$/)?this.secondaryColour_=a:this.secondaryColour_=Blockly.hueToRgb(a),this.hasColours_=!0):this.secondaryColour_=this.colour_="#000000"};Blockly.Css={};Blockly.Css.Cursor={OPEN:"handopen",CLOSED:"handclosed",DELETE:"handdelete"};Blockly.Css.currentCursor_="";Blockly.Css.styleSheet_=null;Blockly.Css.mediaPath_=""; Blockly.Css.inject=function(a,b){Blockly.Css.styleSheet_&&document.head.removeChild(Blockly.Css.styleSheet_.ownerNode);var c=".blocklyDraggable {}\n";a&&(c+=Blockly.Css.CONTENT.join("\n"),Blockly.FieldDate&&(c+=Blockly.FieldDate.CSS.join("\n")));Blockly.Css.mediaPath_=b.replace(/[\\\/]$/,"");c=c.replace(/<<>>/g,Blockly.Css.mediaPath_);a=Object.keys(Blockly.Colours).sort(function(a,b){return b.length-a.length});b=0;for(var d;d=a[b];b++)c=c.replace(new RegExp("\\$colour\\_"+d,"g"),Blockly.Colours[d]); a=document.createElement("style");document.head.insertBefore(a,document.head.firstChild);c=document.createTextNode(c);a.appendChild(c);Blockly.Css.styleSheet_=a.sheet};Blockly.Css.setCursor=function(a){console.warn("Deprecated call to Blockly.Css.setCursor.See https://github.com/google/blockly/issues/981 for context")}; Blockly.Css.CONTENT=[".blocklySvg {","background-color: $colour_workspace;","outline: none;","overflow: hidden;","position: absolute;","display: block;","}",".blocklyRelativeWrapper {","position: relative;","width: 100%;","height: 100%;","}",".blocklyWidgetDiv {","display: none;","position: absolute;","z-index: 99999;","}",".injectionDiv {","height: 100%;","position: relative;","overflow: hidden;","touch-action: none","}",".blocklyNonSelectable {","user-select: none;","-moz-user-select: none;","-webkit-user-select: none;",