Commit f8365e9e authored by Neil Fraser's avatar Neil Fraser

Inject CSS rule for cursors regardless of CSS flag.

parent 6e45f933
......@@ -1240,28 +1240,27 @@ Blockly.Toolbox.TreeNode=function(a,b,c,d){goog.ui.tree.TreeNode.call(this,b,c,d
Blockly.Toolbox.TreeNode.prototype.onMouseDown=function(a){this.hasChildren()&&this.isUserCollapsible_?(this.toggle(),this.select()):this.isSelected()?this.getTree().setSelectedItem(null):this.select();this.updateRow()};Blockly.Toolbox.TreeNode.prototype.onDoubleClick_=function(a){};Blockly.Toolbox.TreeSeparator=function(){Blockly.Toolbox.TreeNode.call(this,null,"",Blockly.Toolbox.TreeSeparator.CONFIG_)};goog.inherits(Blockly.Toolbox.TreeSeparator,Blockly.Toolbox.TreeNode);
Blockly.Toolbox.TreeSeparator.CONFIG_={cssTreeRow:"blocklyTreeSeparator"};
// Copyright 2013 Google Inc. Apache License 2.0
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(){var a=Blockly.Css.CONTENT.join("\n");Blockly.Css.mediaPath_=Blockly.pathToMedia.replace(/[\\\/]$/,"");a=a.replace(/<<<PATH>>>/g,Blockly.Css.mediaPath_);Blockly.Css.styleSheet_=goog.cssom.addCssText(a).sheet;Blockly.Css.setCursor(Blockly.Css.Cursor.OPEN)};
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(){var a=".blocklyDraggable {}\n";Blockly.hasCss&&(a+=Blockly.Css.CONTENT.join("\n"));Blockly.Css.mediaPath_=Blockly.pathToMedia.replace(/[\\\/]$/,"");a=a.replace(/<<<PATH>>>/g,Blockly.Css.mediaPath_);Blockly.Css.styleSheet_=goog.cssom.addCssText(a).sheet;Blockly.Css.setCursor(Blockly.Css.Cursor.OPEN)};
Blockly.Css.setCursor=function(a){if(!Blockly.readOnly&&Blockly.Css.currentCursor_!=a){Blockly.Css.currentCursor_=a;var b="url("+Blockly.Css.mediaPath_+"/"+a+".cur) "+(a==Blockly.Css.Cursor.OPEN?"8 5":"7 3")+", auto";goog.cssom.replaceCssRule("",".blocklyDraggable {\n cursor: "+b+";\n}\n",Blockly.Css.styleSheet_,0);for(var c=document.getElementsByClassName("blocklyToolboxDiv"),d=0,e;e=c[d];d++)e.style.cursor=a==Blockly.Css.Cursor.OPEN?"":b;Blockly.svg&&(Blockly.svg.style.cursor=a==Blockly.Css.Cursor.OPEN?
"":b)}};
Blockly.Css.CONTENT=[".blocklyDraggable {","}",".blocklySvg {"," background-color: #fff;"," border: 1px solid #ddd;"," overflow: hidden;","}",".blocklyWidgetDiv {"," position: absolute;"," display: none;"," z-index: 999;","}",".blocklyResizeSE {"," fill: #aaa;"," cursor: se-resize;","}",".blocklyResizeSW {"," fill: #aaa;"," cursor: sw-resize;","}",".blocklyResizeLine {"," stroke-width: 1;"," stroke: #888;","}",".blocklyHighlightedConnectionPath {"," stroke-width: 4px;"," stroke: #fc3;"," fill: none;",
"}",".blocklyPathLight {"," fill: none;"," stroke-width: 2;"," stroke-linecap: round;","}",".blocklySelected>.blocklyPath {"," stroke-width: 3px;"," stroke: #fc3;","}",".blocklySelected>.blocklyPathLight {"," display: none;","}",".blocklyDragging>.blocklyPath,",".blocklyDragging>.blocklyPathLight {"," fill-opacity: .8;"," stroke-opacity: .8;","}",".blocklyDragging>.blocklyPathDark {"," display: none;","}",".blocklyDisabled>.blocklyPath {"," fill-opacity: .5;"," stroke-opacity: .5;","}",
".blocklyDisabled>.blocklyPathLight,",".blocklyDisabled>.blocklyPathDark {"," display: none;","}",".blocklyText {"," cursor: default;"," font-family: sans-serif;"," font-size: 11pt;"," fill: #fff;","}",".blocklyNonEditableText>text {"," pointer-events: none;","}",".blocklyNonEditableText>rect,",".blocklyEditableText>rect {"," fill: #fff;"," fill-opacity: .6;","}",".blocklyNonEditableText>text,",".blocklyEditableText>text {"," fill: #000;","}",".blocklyEditableText:hover>rect {"," stroke-width: 2;",
" stroke: #fff;","}",".blocklyBubbleText {"," fill: #000;","}",".blocklySvg text {"," -moz-user-select: none;"," -webkit-user-select: none;"," user-select: none;"," cursor: inherit;","}",".blocklyHidden {"," display: none;","}",".blocklyFieldDropdown:not(.blocklyHidden) {"," display: block;","}",".blocklyTooltipBackground {"," fill: #ffffc7;"," stroke-width: 1px;"," stroke: #d8d8d8;","}",".blocklyTooltipShadow,",".blocklyDropdownMenuShadow {"," fill: #bbb;"," filter: url(#blocklyShadowFilter);",
"}",".blocklyTooltipText {"," font-family: sans-serif;"," font-size: 9pt;"," fill: #000;","}",".blocklyIconShield {"," cursor: default;"," fill: #00c;"," stroke-width: 1px;"," stroke: #ccc;","}",".blocklyIconGroup:hover>.blocklyIconShield {"," fill: #00f;"," stroke: #fff;","}",".blocklyIconGroup:hover>.blocklyIconMark {"," fill: #fff;","}",".blocklyIconMark {"," cursor: default !important;"," font-family: sans-serif;"," font-size: 9pt;"," font-weight: bold;"," fill: #ccc;"," text-anchor: middle;",
"}",".blocklyWarningBody {","}",".blocklyMinimalBody {"," margin: 0;"," padding: 0;","}",".blocklyCommentTextarea {"," margin: 0;"," padding: 2px;"," border: 0;"," resize: none;"," background-color: #ffc;","}",".blocklyHtmlInput {"," font-family: sans-serif;"," font-size: 11pt;"," border: none;"," outline: none;"," width: 100%","}",".blocklyMutatorBackground {"," fill: #fff;"," stroke-width: 1;"," stroke: #ddd;","}",".blocklyFlyoutBackground {"," fill: #ddd;"," fill-opacity: .8;",
"}",".blocklyColourBackground {"," fill: #666;","}",".blocklyScrollbarBackground {"," fill: #fff;"," stroke-width: 1;"," stroke: #e4e4e4;","}",".blocklyScrollbarKnob {"," fill: #ccc;","}",".blocklyScrollbarBackground:hover+.blocklyScrollbarKnob,",".blocklyScrollbarKnob:hover {"," fill: #bbb;","}",".blocklyInvalidInput {"," background: #faa;","}",".blocklyAngleCircle {"," stroke: #444;"," stroke-width: 1;"," fill: #ddd;"," fill-opacity: .8;","}",".blocklyAngleMarks {"," stroke: #444;",
" stroke-width: 1;","}",".blocklyAngleGauge {"," fill: #f88;"," fill-opacity: .8; ","}",".blocklyAngleLine {"," stroke: #f00;"," stroke-width: 2;"," stroke-linecap: round;","}",".blocklyContextMenu {"," border-radius: 4px;","}",".blocklyDropdownMenu {"," padding: 0 !important;","}",".blocklyWidgetDiv .goog-option-selected .goog-menuitem-checkbox,",".blocklyWidgetDiv .goog-option-selected .goog-menuitem-icon {"," background: url(<<<PATH>>>/sprites.png) no-repeat -48px -16px !important;",
"}",".blocklyToolboxDiv {"," background-color: #ddd;"," display: none;"," overflow-x: visible;"," overflow-y: auto;"," position: absolute;","}",".blocklyTreeRoot {"," padding: 4px 0;","}",".blocklyTreeRoot:focus {"," outline: none;","}",".blocklyTreeRow {"," line-height: 22px;"," height: 22px;"," padding-right: 1em;"," white-space: nowrap;","}",'.blocklyToolboxDiv[dir="RTL"] .blocklyTreeRow {'," padding-right: 0;"," padding-left: 1em !important;","}",".blocklyTreeRow:hover {"," background-color: #e4e4e4;",
"}",".blocklyTreeSeparator {"," height: 0px;"," border-bottom: solid #e5e5e5 1px;"," margin: 5px 0;","}",".blocklyTreeIcon {"," height: 16px;"," width: 16px;"," vertical-align: middle;"," background-image: url(<<<PATH>>>/sprites.png);","}",".blocklyTreeIconClosedLtr {"," background-position: -32px -1px;","}",".blocklyTreeIconClosedRtl {"," background-position: 0px -1px;","}",".blocklyTreeIconOpen {"," background-position: -16px -1px;","}",".blocklyTreeSelected>.blocklyTreeIconClosedLtr {",
" background-position: -32px -17px;","}",".blocklyTreeSelected>.blocklyTreeIconClosedRtl {"," background-position: 0px -17px;","}",".blocklyTreeSelected>.blocklyTreeIconOpen {"," background-position: -16px -17px;","}",".blocklyTreeIconNone,",".blocklyTreeSelected>.blocklyTreeIconNone {"," background-position: -48px -1px;","}",".blocklyTreeLabel {"," cursor: default;"," font-family: sans-serif;"," font-size: 16px;"," padding: 0 3px;"," vertical-align: middle;","}",".blocklyTreeSelected {",
" background-color: #57e !important;","}",".blocklyTreeSelected .blocklyTreeLabel {"," color: #fff;","}",".blocklyWidgetDiv .goog-palette {"," outline: none;"," cursor: default;","}",".blocklyWidgetDiv .goog-palette-table {"," border: 1px solid #666;"," border-collapse: collapse;","}",".blocklyWidgetDiv .goog-palette-cell {"," height: 13px;"," width: 15px;"," margin: 0;"," border: 0;"," text-align: center;"," vertical-align: middle;"," border-right: 1px solid #666;"," font-size: 1px;",
"}",".blocklyWidgetDiv .goog-palette-colorswatch {"," position: relative;"," height: 13px;"," width: 15px;"," border: 1px solid #666;","}",".blocklyWidgetDiv .goog-palette-cell-hover .goog-palette-colorswatch {"," border: 1px solid #FFF;","}",".blocklyWidgetDiv .goog-palette-cell-selected .goog-palette-colorswatch {"," border: 1px solid #000;"," color: #fff;","}",".blocklyWidgetDiv .goog-menu {"," background: #fff;"," border-color: #ccc #666 #666 #ccc;"," border-style: solid;"," border-width: 1px;",
" cursor: default;"," font: normal 13px Arial, sans-serif;"," margin: 0;"," outline: none;"," padding: 4px 0;"," position: absolute;"," z-index: 20000;","}",".blocklyWidgetDiv .goog-menuitem {"," color: #000;"," font: normal 13px Arial, sans-serif;"," list-style: none;"," margin: 0;"," padding: 4px 7em 4px 28px;"," white-space: nowrap;","}",".blocklyWidgetDiv .goog-menuitem.goog-menuitem-rtl {"," padding-left: 7em;"," padding-right: 28px;","}",".blocklyWidgetDiv .goog-menu-nocheckbox .goog-menuitem,",
".blocklyWidgetDiv .goog-menu-noicon .goog-menuitem {"," padding-left: 12px;","}",".blocklyWidgetDiv .goog-menu-noaccel .goog-menuitem {"," padding-right: 20px;","}",".blocklyWidgetDiv .goog-menuitem-content {"," color: #000;"," font: normal 13px Arial, sans-serif;","}",".blocklyWidgetDiv .goog-menuitem-disabled .goog-menuitem-accel,",".blocklyWidgetDiv .goog-menuitem-disabled .goog-menuitem-content {"," color: #ccc !important;","}",".blocklyWidgetDiv .goog-menuitem-disabled .goog-menuitem-icon {",
" opacity: 0.3;"," -moz-opacity: 0.3;"," filter: alpha(opacity=30);","}",".blocklyWidgetDiv .goog-menuitem-highlight,",".blocklyWidgetDiv .goog-menuitem-hover {"," background-color: #d6e9f8;"," border-color: #d6e9f8;"," border-style: dotted;"," border-width: 1px 0;"," padding-bottom: 3px;"," padding-top: 3px;","}",".blocklyWidgetDiv .goog-menuitem-checkbox,",".blocklyWidgetDiv .goog-menuitem-icon {"," background-repeat: no-repeat;"," height: 16px;"," left: 6px;"," position: absolute;",
" right: auto;"," vertical-align: middle;"," width: 16px;","}",".blocklyWidgetDiv .goog-menuitem-rtl .goog-menuitem-checkbox,",".blocklyWidgetDiv .goog-menuitem-rtl .goog-menuitem-icon {"," left: auto;"," right: 6px;","}",".blocklyWidgetDiv .goog-option-selected .goog-menuitem-checkbox,",".blocklyWidgetDiv .goog-option-selected .goog-menuitem-icon {"," background: url(//ssl.gstatic.com/editor/editortoolbar.png) no-repeat -512px 0;","}",".blocklyWidgetDiv .goog-menuitem-accel {"," color: #999;",
" direction: ltr;"," left: auto;"," padding: 0 6px;"," position: absolute;"," right: 0;"," text-align: right;","}",".blocklyWidgetDiv .goog-menuitem-rtl .goog-menuitem-accel {"," left: 0;"," right: auto;"," text-align: left;","}",".blocklyWidgetDiv .goog-menuitem-mnemonic-hint {"," text-decoration: underline;","}",".blocklyWidgetDiv .goog-menuitem-mnemonic-separator {"," color: #999;"," font-size: 12px;"," padding-left: 4px;","}",".blocklyWidgetDiv .goog-menuseparator {"," border-top: 1px solid #ccc;",
" margin: 4px 0;"," padding: 0;","}",""];
Blockly.Css.CONTENT=[".blocklySvg {"," background-color: #fff;"," border: 1px solid #ddd;"," overflow: hidden;","}",".blocklyWidgetDiv {"," position: absolute;"," display: none;"," z-index: 999;","}",".blocklyResizeSE {"," fill: #aaa;"," cursor: se-resize;","}",".blocklyResizeSW {"," fill: #aaa;"," cursor: sw-resize;","}",".blocklyResizeLine {"," stroke-width: 1;"," stroke: #888;","}",".blocklyHighlightedConnectionPath {"," stroke-width: 4px;"," stroke: #fc3;"," fill: none;","}",".blocklyPathLight {",
" fill: none;"," stroke-width: 2;"," stroke-linecap: round;","}",".blocklySelected>.blocklyPath {"," stroke-width: 3px;"," stroke: #fc3;","}",".blocklySelected>.blocklyPathLight {"," display: none;","}",".blocklyDragging>.blocklyPath,",".blocklyDragging>.blocklyPathLight {"," fill-opacity: .8;"," stroke-opacity: .8;","}",".blocklyDragging>.blocklyPathDark {"," display: none;","}",".blocklyDisabled>.blocklyPath {"," fill-opacity: .5;"," stroke-opacity: .5;","}",".blocklyDisabled>.blocklyPathLight,",
".blocklyDisabled>.blocklyPathDark {"," display: none;","}",".blocklyText {"," cursor: default;"," font-family: sans-serif;"," font-size: 11pt;"," fill: #fff;","}",".blocklyNonEditableText>text {"," pointer-events: none;","}",".blocklyNonEditableText>rect,",".blocklyEditableText>rect {"," fill: #fff;"," fill-opacity: .6;","}",".blocklyNonEditableText>text,",".blocklyEditableText>text {"," fill: #000;","}",".blocklyEditableText:hover>rect {"," stroke-width: 2;"," stroke: #fff;","}",".blocklyBubbleText {",
" fill: #000;","}",".blocklySvg text {"," -moz-user-select: none;"," -webkit-user-select: none;"," user-select: none;"," cursor: inherit;","}",".blocklyHidden {"," display: none;","}",".blocklyFieldDropdown:not(.blocklyHidden) {"," display: block;","}",".blocklyTooltipBackground {"," fill: #ffffc7;"," stroke-width: 1px;"," stroke: #d8d8d8;","}",".blocklyTooltipShadow,",".blocklyDropdownMenuShadow {"," fill: #bbb;"," filter: url(#blocklyShadowFilter);","}",".blocklyTooltipText {"," font-family: sans-serif;",
" font-size: 9pt;"," fill: #000;","}",".blocklyIconShield {"," cursor: default;"," fill: #00c;"," stroke-width: 1px;"," stroke: #ccc;","}",".blocklyIconGroup:hover>.blocklyIconShield {"," fill: #00f;"," stroke: #fff;","}",".blocklyIconGroup:hover>.blocklyIconMark {"," fill: #fff;","}",".blocklyIconMark {"," cursor: default !important;"," font-family: sans-serif;"," font-size: 9pt;"," font-weight: bold;"," fill: #ccc;"," text-anchor: middle;","}",".blocklyWarningBody {","}",".blocklyMinimalBody {",
" margin: 0;"," padding: 0;","}",".blocklyCommentTextarea {"," margin: 0;"," padding: 2px;"," border: 0;"," resize: none;"," background-color: #ffc;","}",".blocklyHtmlInput {"," font-family: sans-serif;"," font-size: 11pt;"," border: none;"," outline: none;"," width: 100%","}",".blocklyMutatorBackground {"," fill: #fff;"," stroke-width: 1;"," stroke: #ddd;","}",".blocklyFlyoutBackground {"," fill: #ddd;"," fill-opacity: .8;","}",".blocklyColourBackground {"," fill: #666;","}",".blocklyScrollbarBackground {",
" fill: #fff;"," stroke-width: 1;"," stroke: #e4e4e4;","}",".blocklyScrollbarKnob {"," fill: #ccc;","}",".blocklyScrollbarBackground:hover+.blocklyScrollbarKnob,",".blocklyScrollbarKnob:hover {"," fill: #bbb;","}",".blocklyInvalidInput {"," background: #faa;","}",".blocklyAngleCircle {"," stroke: #444;"," stroke-width: 1;"," fill: #ddd;"," fill-opacity: .8;","}",".blocklyAngleMarks {"," stroke: #444;"," stroke-width: 1;","}",".blocklyAngleGauge {"," fill: #f88;"," fill-opacity: .8; ",
"}",".blocklyAngleLine {"," stroke: #f00;"," stroke-width: 2;"," stroke-linecap: round;","}",".blocklyContextMenu {"," border-radius: 4px;","}",".blocklyDropdownMenu {"," padding: 0 !important;","}",".blocklyWidgetDiv .goog-option-selected .goog-menuitem-checkbox,",".blocklyWidgetDiv .goog-option-selected .goog-menuitem-icon {"," background: url(<<<PATH>>>/sprites.png) no-repeat -48px -16px !important;","}",".blocklyToolboxDiv {"," background-color: #ddd;"," display: none;"," overflow-x: visible;",
" overflow-y: auto;"," position: absolute;","}",".blocklyTreeRoot {"," padding: 4px 0;","}",".blocklyTreeRoot:focus {"," outline: none;","}",".blocklyTreeRow {"," line-height: 22px;"," height: 22px;"," padding-right: 1em;"," white-space: nowrap;","}",'.blocklyToolboxDiv[dir="RTL"] .blocklyTreeRow {'," padding-right: 0;"," padding-left: 1em !important;","}",".blocklyTreeRow:hover {"," background-color: #e4e4e4;","}",".blocklyTreeSeparator {"," height: 0px;"," border-bottom: solid #e5e5e5 1px;",
" margin: 5px 0;","}",".blocklyTreeIcon {"," height: 16px;"," width: 16px;"," vertical-align: middle;"," background-image: url(<<<PATH>>>/sprites.png);","}",".blocklyTreeIconClosedLtr {"," background-position: -32px -1px;","}",".blocklyTreeIconClosedRtl {"," background-position: 0px -1px;","}",".blocklyTreeIconOpen {"," background-position: -16px -1px;","}",".blocklyTreeSelected>.blocklyTreeIconClosedLtr {"," background-position: -32px -17px;","}",".blocklyTreeSelected>.blocklyTreeIconClosedRtl {",
" background-position: 0px -17px;","}",".blocklyTreeSelected>.blocklyTreeIconOpen {"," background-position: -16px -17px;","}",".blocklyTreeIconNone,",".blocklyTreeSelected>.blocklyTreeIconNone {"," background-position: -48px -1px;","}",".blocklyTreeLabel {"," cursor: default;"," font-family: sans-serif;"," font-size: 16px;"," padding: 0 3px;"," vertical-align: middle;","}",".blocklyTreeSelected {"," background-color: #57e !important;","}",".blocklyTreeSelected .blocklyTreeLabel {"," color: #fff;",
"}",".blocklyWidgetDiv .goog-palette {"," outline: none;"," cursor: default;","}",".blocklyWidgetDiv .goog-palette-table {"," border: 1px solid #666;"," border-collapse: collapse;","}",".blocklyWidgetDiv .goog-palette-cell {"," height: 13px;"," width: 15px;"," margin: 0;"," border: 0;"," text-align: center;"," vertical-align: middle;"," border-right: 1px solid #666;"," font-size: 1px;","}",".blocklyWidgetDiv .goog-palette-colorswatch {"," position: relative;"," height: 13px;"," width: 15px;",
" border: 1px solid #666;","}",".blocklyWidgetDiv .goog-palette-cell-hover .goog-palette-colorswatch {"," border: 1px solid #FFF;","}",".blocklyWidgetDiv .goog-palette-cell-selected .goog-palette-colorswatch {"," border: 1px solid #000;"," color: #fff;","}",".blocklyWidgetDiv .goog-menu {"," background: #fff;"," border-color: #ccc #666 #666 #ccc;"," border-style: solid;"," border-width: 1px;"," cursor: default;"," font: normal 13px Arial, sans-serif;"," margin: 0;"," outline: none;"," padding: 4px 0;",
" position: absolute;"," z-index: 20000;","}",".blocklyWidgetDiv .goog-menuitem {"," color: #000;"," font: normal 13px Arial, sans-serif;"," list-style: none;"," margin: 0;"," padding: 4px 7em 4px 28px;"," white-space: nowrap;","}",".blocklyWidgetDiv .goog-menuitem.goog-menuitem-rtl {"," padding-left: 7em;"," padding-right: 28px;","}",".blocklyWidgetDiv .goog-menu-nocheckbox .goog-menuitem,",".blocklyWidgetDiv .goog-menu-noicon .goog-menuitem {"," padding-left: 12px;","}",".blocklyWidgetDiv .goog-menu-noaccel .goog-menuitem {",
" padding-right: 20px;","}",".blocklyWidgetDiv .goog-menuitem-content {"," color: #000;"," font: normal 13px Arial, sans-serif;","}",".blocklyWidgetDiv .goog-menuitem-disabled .goog-menuitem-accel,",".blocklyWidgetDiv .goog-menuitem-disabled .goog-menuitem-content {"," color: #ccc !important;","}",".blocklyWidgetDiv .goog-menuitem-disabled .goog-menuitem-icon {"," opacity: 0.3;"," -moz-opacity: 0.3;"," filter: alpha(opacity=30);","}",".blocklyWidgetDiv .goog-menuitem-highlight,",".blocklyWidgetDiv .goog-menuitem-hover {",
" background-color: #d6e9f8;"," border-color: #d6e9f8;"," border-style: dotted;"," border-width: 1px 0;"," padding-bottom: 3px;"," padding-top: 3px;","}",".blocklyWidgetDiv .goog-menuitem-checkbox,",".blocklyWidgetDiv .goog-menuitem-icon {"," background-repeat: no-repeat;"," height: 16px;"," left: 6px;"," position: absolute;"," right: auto;"," vertical-align: middle;"," width: 16px;","}",".blocklyWidgetDiv .goog-menuitem-rtl .goog-menuitem-checkbox,",".blocklyWidgetDiv .goog-menuitem-rtl .goog-menuitem-icon {",
" left: auto;"," right: 6px;","}",".blocklyWidgetDiv .goog-option-selected .goog-menuitem-checkbox,",".blocklyWidgetDiv .goog-option-selected .goog-menuitem-icon {"," background: url(//ssl.gstatic.com/editor/editortoolbar.png) no-repeat -512px 0;","}",".blocklyWidgetDiv .goog-menuitem-accel {"," color: #999;"," direction: ltr;"," left: auto;"," padding: 0 6px;"," position: absolute;"," right: 0;"," text-align: right;","}",".blocklyWidgetDiv .goog-menuitem-rtl .goog-menuitem-accel {"," left: 0;",
" right: auto;"," text-align: left;","}",".blocklyWidgetDiv .goog-menuitem-mnemonic-hint {"," text-decoration: underline;","}",".blocklyWidgetDiv .goog-menuitem-mnemonic-separator {"," color: #999;"," font-size: 12px;"," padding-left: 4px;","}",".blocklyWidgetDiv .goog-menuseparator {"," border-top: 1px solid #ccc;"," margin: 4px 0;"," padding: 0;","}",""];
// Copyright 2013 Google Inc. Apache License 2.0
Blockly.WidgetDiv={};Blockly.WidgetDiv.DIV=null;Blockly.WidgetDiv.owner_=null;Blockly.WidgetDiv.dispose_=null;Blockly.WidgetDiv.show=function(a,b){Blockly.WidgetDiv.hide();Blockly.WidgetDiv.owner_=a;Blockly.WidgetDiv.dispose_=b;Blockly.WidgetDiv.DIV.style.display="block"};Blockly.WidgetDiv.hide=function(){Blockly.WidgetDiv.owner_&&(Blockly.WidgetDiv.DIV.style.display="none",Blockly.WidgetDiv.dispose_&&Blockly.WidgetDiv.dispose_(),Blockly.WidgetDiv.owner_=null,Blockly.WidgetDiv.dispose_=null,goog.dom.removeChildren(Blockly.WidgetDiv.DIV))};
Blockly.WidgetDiv.isVisible=function(){return!!Blockly.WidgetDiv.owner_};Blockly.WidgetDiv.hideIfOwner=function(a){Blockly.WidgetDiv.owner_==a&&Blockly.WidgetDiv.hide()};Blockly.WidgetDiv.position=function(a,b,c,d){b<d.y&&(b=d.y);Blockly.RTL?a>c.width+d.x&&(a=c.width+d.x):a<d.x&&(a=d.x);Blockly.WidgetDiv.DIV.style.left=a+"px";Blockly.WidgetDiv.DIV.style.top=b+"px"};
......@@ -1270,7 +1269,7 @@ Blockly.inject=function(a,b){if(!goog.dom.contains(document,a))throw"Error: cont
Blockly.parseToolboxTree_=function(a){a?("string"!=typeof a&&"undefined"==typeof XSLTProcessor&&(a=a.outerHTML),"string"==typeof a&&(a=Blockly.Xml.textToDom(a))):a=null;return a};
Blockly.parseOptions_=function(a){var b=!!a.readOnly;if(b)var c=!1,d=!1,e=!1,f=!1,g=!1,h=null;else h=Blockly.parseToolboxTree_(a.toolbox),c=Boolean(h&&h.getElementsByTagName("category").length),d=a.trashcan,void 0===d&&(d=c),e=a.collapse,void 0===e&&(e=c),f=a.comments,void 0===f&&(f=c),g=a.disable,void 0===g&&(g=c);var k=a.scrollbars;void 0===k&&(k=c);var l=a.sounds;void 0===l&&(l=!0);var p=a.css;void 0===p&&(p=!0);var n=!!a.realtime,q=n?a.realtimeOptions:void 0;Blockly.RTL=!!a.rtl;Blockly.collapse=
e;Blockly.comments=f;Blockly.disable=g;Blockly.readOnly=b;Blockly.maxBlocks=a.maxBlocks||Infinity;a.media?Blockly.pathToMedia=a.media:a.path&&(Blockly.pathToMedia=a.path+"media/");Blockly.hasCategories=c;Blockly.hasScrollbars=k;Blockly.hasTrashcan=d;Blockly.hasSounds=l;Blockly.hasCss=p;Blockly.languageTree=h;Blockly.enableRealtime=n;Blockly.realtimeOptions=q};
Blockly.createDom_=function(a){a.setAttribute("dir","LTR");goog.ui.Component.setDefaultRightToLeft(Blockly.RTL);Blockly.hasCss&&Blockly.Css.inject();var b=Blockly.createSvgElement("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:html":"http://www.w3.org/1999/xhtml","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1","class":"blocklySvg"},null),c=Blockly.createSvgElement("defs",{},b),d,e;d=Blockly.createSvgElement("filter",{id:"blocklyEmboss"},c);Blockly.createSvgElement("feGaussianBlur",{"in":"SourceAlpha",
Blockly.createDom_=function(a){a.setAttribute("dir","LTR");goog.ui.Component.setDefaultRightToLeft(Blockly.RTL);Blockly.Css.inject();var b=Blockly.createSvgElement("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:html":"http://www.w3.org/1999/xhtml","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1","class":"blocklySvg"},null),c=Blockly.createSvgElement("defs",{},b),d,e;d=Blockly.createSvgElement("filter",{id:"blocklyEmboss"},c);Blockly.createSvgElement("feGaussianBlur",{"in":"SourceAlpha",
stdDeviation:1,result:"blur"},d);e=Blockly.createSvgElement("feSpecularLighting",{"in":"blur",surfaceScale:1,specularConstant:.5,specularExponent:10,"lighting-color":"white",result:"specOut"},d);Blockly.createSvgElement("fePointLight",{x:-5E3,y:-1E4,z:2E4},e);Blockly.createSvgElement("feComposite",{"in":"specOut",in2:"SourceAlpha",operator:"in",result:"specOut"},d);Blockly.createSvgElement("feComposite",{"in":"SourceGraphic",in2:"specOut",operator:"arithmetic",k1:0,k2:1,k3:1,k4:0},d);d=Blockly.createSvgElement("filter",
{id:"blocklyTrashcanShadowFilter"},c);Blockly.createSvgElement("feGaussianBlur",{"in":"SourceAlpha",stdDeviation:2,result:"blur"},d);Blockly.createSvgElement("feOffset",{"in":"blur",dx:1,dy:1,result:"offsetBlur"},d);d=Blockly.createSvgElement("feMerge",{},d);Blockly.createSvgElement("feMergeNode",{"in":"offsetBlur"},d);Blockly.createSvgElement("feMergeNode",{"in":"SourceGraphic"},d);d=Blockly.createSvgElement("filter",{id:"blocklyShadowFilter"},c);Blockly.createSvgElement("feGaussianBlur",{stdDeviation:2},
d);c=Blockly.createSvgElement("pattern",{id:"blocklyDisabledPattern",patternUnits:"userSpaceOnUse",width:10,height:10},c);Blockly.createSvgElement("rect",{width:10,height:10,fill:"#aaa"},c);Blockly.createSvgElement("path",{d:"M 0 0 L 10 10 M 10 0 L 0 10",stroke:"#cc0"},c);Blockly.mainWorkspace=new Blockly.WorkspaceSvg(Blockly.getMainWorkspaceMetrics_,Blockly.setMainWorkspaceMetrics_);b.appendChild(Blockly.mainWorkspace.createDom());Blockly.mainWorkspace.maxBlocks=Blockly.maxBlocks;Blockly.readOnly||
......
......@@ -67,7 +67,11 @@ Blockly.Css.mediaPath_ = '';
* c) The CSS content may be made dynamic depending on init options.
*/
Blockly.Css.inject = function() {
var text = Blockly.Css.CONTENT.join('\n');
// Placeholder for cursor rule. Must be first rule (index 0).
var text = '.blocklyDraggable {}\n';
if (Blockly.hasCss) {
text += Blockly.Css.CONTENT.join('\n');
}
// Strip off any trailing slash (either Unix or Windows).
Blockly.Css.mediaPath_ = Blockly.pathToMedia.replace(/[\\\/]$/, '');
text = text.replace(/<<<PATH>>>/g, Blockly.Css.mediaPath_);
......@@ -124,10 +128,6 @@ Blockly.Css.setCursor = function(cursor) {
* Array making up the CSS content for Blockly.
*/
Blockly.Css.CONTENT = [
'.blocklyDraggable {',
// Placeholder for cursor rule. Must be first rule (index 0).
'}',
'.blocklySvg {',
' background-color: #fff;',
' border: 1px solid #ddd;',
......
......@@ -169,9 +169,7 @@ Blockly.createDom_ = function(container) {
goog.ui.Component.setDefaultRightToLeft(Blockly.RTL);
// Load CSS.
if (Blockly.hasCss) {
Blockly.Css.inject();
}
// Build the SVG DOM.
/*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment