mirror of
https://github.com/google/blockly.git
synced 2026-06-01 08:50:07 +02:00
Merge pull request #1439 from rachel-fenichel/rc/nov_2017
November 2017 merge to master
This commit is contained in:
+5
-1
@@ -2,9 +2,13 @@
|
||||
*_uncompressed*.js
|
||||
/msg/*
|
||||
/core/css.js
|
||||
/tests/blocks/*
|
||||
/tests/compile/*
|
||||
/tests/jsunit/*
|
||||
/tests/generators/*
|
||||
/tests/workspace_svg/*
|
||||
/generators/*
|
||||
/demos/*
|
||||
/accessible/*
|
||||
/appengine/*
|
||||
/appengine/*
|
||||
/externs/svg-externs.js
|
||||
|
||||
+48
-32
@@ -1,57 +1,73 @@
|
||||
Thanks for opening an issue for us! Before you open an issue, please check if a similar issue exists or has been closed before.
|
||||
|
||||
If you're asking a question about how to use Blockly in your application, please ask questions on the [mailing list](https://groups.google.com/forum/#!forum/blockly) instead of filing issues.
|
||||
|
||||
_Please delete the above section and the instructions in the sections below before submitting. If a section is not applicable, type "N/A" in that section._
|
||||
<!--
|
||||
- Thanks for opening an issue for us! Before you open an issue,
|
||||
- please check if a similar issue exists or has been closed before.
|
||||
-
|
||||
- If you're asking a question about how to use Blockly in your application,
|
||||
- please ask questions on the mailing list, instead of filing issues:
|
||||
- https://groups.google.com/forum/#!forum/blockly
|
||||
-->
|
||||
|
||||
### Problem statement
|
||||
|
||||
_Remove this hint: these checkboxes can be checked like this: [x]_
|
||||
|
||||
- [ ] Bug report
|
||||
- [ ] Feature request
|
||||
|
||||
_What were you trying to do when you hit this bug? Or, what do you want to do with Blockly that your proposed feature would enable?_
|
||||
<!-- TODO: Please describe the problem.
|
||||
- Is it a bug report (something didn't work the way you expected),
|
||||
- or a feature request (something new you think would improve Blockly)?
|
||||
-->
|
||||
|
||||
### Expected Behavior
|
||||
|
||||
_Please describe what should happen. Include screenshots if applicable._
|
||||
<!-- TODO: Please describe what should happen.
|
||||
- Include screenshots if applicable.
|
||||
-->
|
||||
|
||||
### Actual Behavior
|
||||
|
||||
_Describe what actually happens. Include screenshots if applicable._
|
||||
<!-- TODO: Describe what actually happens.
|
||||
- Include screenshots if applicable.
|
||||
-->
|
||||
|
||||
### Steps to Reproduce
|
||||
|
||||
_Explain what someone needs to do in order to see what's described in *Actual behavior* above_
|
||||
<!-- TODO: Explain what someone needs to do in order to see
|
||||
- what's described in *Actual behavior* above
|
||||
-->
|
||||
|
||||
1. Start by..
|
||||
2. Next, do..
|
||||
|
||||
### Stack Traces
|
||||
|
||||
```
|
||||
Please open up the console. If you see any Blockly-related errors, paste them here.
|
||||
<!-- TODO: Please open up the console. If you see any Blockly-related errors,
|
||||
- paste them between the quotes below.
|
||||
-
|
||||
- Ignore any instances of...
|
||||
- "Uncaught (in promise) DOMException: The play() request was interrupted by a call to pause()."
|
||||
-->
|
||||
|
||||
Ignore any instances of "Uncaught (in promise) DOMException: The play() request was interrupted by a call to pause()."
|
||||
```
|
||||
Replace with error stack trace.
|
||||
```
|
||||
|
||||
### Operating System and Browser
|
||||
|
||||
_Remove this hint: these checkboxes can be checked like this: [x]_
|
||||
<!-- TODO: If this issue is browser specific, uncomment the systems you have tested. -->
|
||||
|
||||
- [ ] Desktop:
|
||||
- [ ] Chrome
|
||||
- [ ] Firefox
|
||||
- [ ] Safari
|
||||
- [ ] Opera
|
||||
- [ ] IE 10+
|
||||
- [ ] IE 11
|
||||
- [ ] EDGE
|
||||
<!-- * Desktop Chrome -->
|
||||
<!-- * Desktop Firefox -->
|
||||
<!-- * Desktop Safari -->
|
||||
<!-- * Desktop Opera -->
|
||||
<!-- * Windows Internet Explorer 10 -->
|
||||
<!-- * Windows Internet Explorer 11 -->
|
||||
<!-- * Windows Edge -->
|
||||
|
||||
- [ ] Smartphone/Tablet/Chromebook (please complete the following information):
|
||||
- Device: [e.g. iPhone6]
|
||||
- OS: [e.g. iOS8.1]
|
||||
- Browser [e.g. stock browser, safari]
|
||||
- Version [e.g. 22]
|
||||
<!--
|
||||
* Smartphone/Tablet/Chromebook (please complete the following information):
|
||||
* Device: [e.g. iPhone6]
|
||||
* OS: [e.g. iOS8.1]
|
||||
* Browser [e.g. stock browser, safari]
|
||||
* Version [e.g. 22]
|
||||
-->
|
||||
|
||||
### Additional Information
|
||||
|
||||
_Anything else we should know?_
|
||||
<!-- Anything else we should know? -->
|
||||
|
||||
@@ -1,7 +1,12 @@
|
||||
Thanks for submitting code to Blockly! Please fill out the following as part of your pull request so we can review your code more easily.
|
||||
<!--
|
||||
- Thanks for submitting code to Blockly! Please fill out the following as part of
|
||||
- your pull request so we can review your code more easily.
|
||||
-->
|
||||
|
||||
## The basics
|
||||
|
||||
<!-- TODO: Verify the following, checking each box with an 'x' between the brackets: [x] -->
|
||||
|
||||
- [ ] I branched from develop
|
||||
- [ ] My pull request is against develop
|
||||
- [ ] My code follows the [style guide](https://developers.google.com/blockly/guides/modify/web/style-guide)
|
||||
@@ -9,37 +14,40 @@ Thanks for submitting code to Blockly! Please fill out the following as part of
|
||||
## The details
|
||||
### Resolves
|
||||
|
||||
_What Github issue does this resolve (please include link)?_
|
||||
<!-- TODO: What Github issue does this resolve? Please include a link. -->
|
||||
|
||||
### Proposed Changes
|
||||
|
||||
_Describe what this Pull Request does. Include screenshots if applicable._
|
||||
<!-- TODO: Describe what this Pull Request does. Include screenshots if applicable. -->
|
||||
|
||||
### Reason for Changes
|
||||
|
||||
_Explain why these changes should be made. Include screenshots if applicable._
|
||||
<!--TODO: Explain why these changes should be made. Include screenshots if applicable. -->
|
||||
|
||||
### Test Coverage
|
||||
|
||||
_Please show how you have added tests to cover your changes, or tell us how you tested it and on which platforms. If it's plaform-agnostic you can delete these checkboxes._
|
||||
<!-- TODO: Please show how you have added tests to cover your changes,
|
||||
- or tell us how you tested it. For each systems you tested,
|
||||
- uncomment the systems in the list below.
|
||||
-->
|
||||
|
||||
Tested on:
|
||||
_Remove this hint: these checkboxes can be checked like this: [x]_
|
||||
- [ ] Desktop:
|
||||
- [ ] Chrome
|
||||
- [ ] Firefox
|
||||
- [ ] Safari
|
||||
- [ ] Opera
|
||||
- [ ] IE 10+
|
||||
- [ ] IE 11
|
||||
- [ ] EDGE
|
||||
<!-- * Desktop Chrome -->
|
||||
<!-- * Desktop Firefox -->
|
||||
<!-- * Desktop Safari -->
|
||||
<!-- * Desktop Opera -->
|
||||
<!-- * Windows Internet Explorer 10 -->
|
||||
<!-- * Windows Internet Explorer 11 -->
|
||||
<!-- * Windows Edge -->
|
||||
|
||||
<!--
|
||||
* Smartphone/Tablet/Chromebook (please complete the following information):
|
||||
* Device: [e.g. iPhone6]
|
||||
* OS: [e.g. iOS8.1]
|
||||
* Browser [e.g. stock browser, safari]
|
||||
* Version [e.g. 22]
|
||||
-->
|
||||
|
||||
- [ ] Smartphone/Tablet/Chromebook (please complete the following information):
|
||||
- Device: [e.g. iPhone6]
|
||||
- OS: [e.g. iOS8.1]
|
||||
- Browser [e.g. stock browser, safari]
|
||||
- Version [e.g. 22]
|
||||
|
||||
### Additional Information
|
||||
|
||||
_Anything else we should know?_
|
||||
<!-- Anything else we should know? -->
|
||||
|
||||
@@ -6,3 +6,6 @@ npm-debug.log
|
||||
*.pyc
|
||||
*.komodoproject
|
||||
/nbproject/private/
|
||||
|
||||
tests/compile/main_compressed.js
|
||||
tests/compile/*compiler*.jar
|
||||
|
||||
+5
-2
@@ -15,16 +15,19 @@ matrix:
|
||||
|
||||
before_install:
|
||||
- npm install google-closure-library
|
||||
- npm install google-closure-compiler
|
||||
- npm install webdriverio
|
||||
# Symlink closure library
|
||||
- ln -s $(npm root)/google-closure-library ../closure-library
|
||||
|
||||
before_script:
|
||||
- export DISPLAY=:99.0
|
||||
- if [ "${TRAVIS_OS_NAME}" == "linux" ]; then ( scripts/setup_linux_env.sh ) fi
|
||||
- if [ "${TRAVIS_OS_NAME}" == "osx" ]; then ( scripts/setup_osx_env.sh ) fi
|
||||
- if [ "${TRAVIS_OS_NAME}" == "linux" ]; then ( tests/scripts/setup_linux_env.sh ) fi
|
||||
- if [ "${TRAVIS_OS_NAME}" == "osx" ]; then ( tests/scripts/setup_osx_env.sh ) fi
|
||||
- sleep 2
|
||||
|
||||
script:
|
||||
- set -x
|
||||
- npm run lint
|
||||
- npm test
|
||||
- cd tests/compile; compile.sh; cd ..
|
||||
|
||||
+120
-118
@@ -10,36 +10,39 @@ goog.module=function(a){if(!goog.isString(a)||!a||-1==a.search(goog.VALID_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){a=a.split(".");b=b||goog.global;for(var c=0;c<a.length;c++)if(b=b[a[c]],!goog.isDefAndNotNull(b))return null;return b};goog.globalize=function(a,b){b=b||goog.global;for(var c in a)b[c]=a[c]};
|
||||
goog.addDependency=function(a,b,c,d){if(goog.DEPENDENCIES_ENABLED){var e;a=a.replace(/\\/g,"/");var f=goog.dependencies_;d&&"boolean"!==typeof d||(d=d?{module:"goog"}:{});for(var g=0;e=b[g];g++)f.nameToPath[e]=a,f.loadFlags[a]=d;for(d=0;b=c[d];d++)a in f.requires||(f.requires[a]={}),f.requires[a][b]=!0}};goog.ENABLE_DEBUG_LOADER=!0;goog.logToConsole_=function(a){goog.global.console&&goog.global.console.error(a)};
|
||||
goog.require=function(a){if(!COMPILED){goog.ENABLE_DEBUG_LOADER&&goog.IS_OLD_IE_&&goog.maybeProcessDeferredDep_(a);if(goog.isProvided_(a)){if(goog.isInModuleLoader_())return goog.module.getInternal_(a)}else if(goog.ENABLE_DEBUG_LOADER){var b=goog.getPathFromDeps_(a);if(b)goog.writeScripts_(b);else throw a="goog.require could not find: "+a,goog.logToConsole_(a),Error(a);}return null}};goog.basePath="";goog.nullFunction=function(){};
|
||||
goog.abstractMethod=function(){throw Error("unimplemented abstract method");};goog.addSingletonGetter=function(a){a.instance_=void 0;a.getInstance=function(){if(a.instance_)return a.instance_;goog.DEBUG&&(goog.instantiatedSingletons_[goog.instantiatedSingletons_.length]=a);return a.instance_=new a}};goog.instantiatedSingletons_=[];goog.LOAD_MODULE_USING_EVAL=!0;goog.SEAL_MODULE_EXPORTS=goog.DEBUG;goog.loadedModules_={};goog.DEPENDENCIES_ENABLED=!COMPILED&&goog.ENABLE_DEBUG_LOADER;goog.TRANSPILE="detect";
|
||||
goog.TRANSPILER="transpile.js";
|
||||
goog.DEPENDENCIES_ENABLED&&(goog.dependencies_={loadFlags:{},nameToPath:{},requires:{},visited:{},written:{},deferred:{}},goog.inHtmlDocument_=function(){var a=goog.global.document;return null!=a&&"write"in a},goog.findBasePath_=function(){if(goog.isDef(goog.global.CLOSURE_BASE_PATH)&&goog.isString(goog.global.CLOSURE_BASE_PATH))goog.basePath=goog.global.CLOSURE_BASE_PATH;else if(goog.inHtmlDocument_()){var a=goog.global.document,b=a.currentScript;a=b?[b]:a.getElementsByTagName("SCRIPT");for(b=a.length-
|
||||
1;0<=b;--b){var c=a[b].src,d=c.lastIndexOf("?");d=-1==d?c.length:d;if("base.js"==c.substr(d-7,7)){goog.basePath=c.substr(0,d-7);break}}}},goog.importScript_=function(a,b){(goog.global.CLOSURE_IMPORT_SCRIPT||goog.writeScriptTag_)(a,b)&&(goog.dependencies_.written[a]=!0)},goog.IS_OLD_IE_=!(goog.global.atob||!goog.global.document||!goog.global.document.all),goog.oldIeWaiting_=!1,goog.importProcessedScript_=function(a,b,c){goog.importScript_("",'goog.retrieveAndExec_("'+a+'", '+b+", "+c+");")},goog.queuedModules_=
|
||||
[],goog.wrapModule_=function(a,b){return goog.LOAD_MODULE_USING_EVAL&&goog.isDef(goog.global.JSON)?"goog.loadModule("+goog.global.JSON.stringify(b+"\n//# sourceURL="+a+"\n")+");":'goog.loadModule(function(exports) {"use strict";'+b+"\n;return exports});\n//# sourceURL="+a+"\n"},goog.loadQueuedModules_=function(){var a=goog.queuedModules_.length;if(0<a){var b=goog.queuedModules_;goog.queuedModules_=[];for(var c=0;c<a;c++)goog.maybeProcessDeferredPath_(b[c])}goog.oldIeWaiting_=!1},goog.maybeProcessDeferredDep_=
|
||||
function(a){goog.isDeferredModule_(a)&&goog.allDepsAreAvailable_(a)&&(a=goog.getPathFromDeps_(a),goog.maybeProcessDeferredPath_(goog.basePath+a))},goog.isDeferredModule_=function(a){var b=(a=goog.getPathFromDeps_(a))&&goog.dependencies_.loadFlags[a]||{},c=b.lang||"es3";return a&&("goog"==b.module||goog.needsTranspile_(c))?goog.basePath+a in goog.dependencies_.deferred:!1},goog.allDepsAreAvailable_=function(a){if((a=goog.getPathFromDeps_(a))&&a in goog.dependencies_.requires)for(var b in goog.dependencies_.requires[a])if(!goog.isProvided_(b)&&
|
||||
!goog.isDeferredModule_(b))return!1;return!0},goog.maybeProcessDeferredPath_=function(a){if(a in goog.dependencies_.deferred){var b=goog.dependencies_.deferred[a];delete goog.dependencies_.deferred[a];goog.globalEval(b)}},goog.loadModuleFromUrl=function(a){goog.retrieveAndExec_(a,!0,!1)},goog.writeScriptSrcNode_=function(a){goog.global.document.write('<script type="text/javascript" src="'+a+'">\x3c/script>')},goog.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.writeScriptTag_=function(a,b){if(goog.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.IS_OLD_IE_?(goog.oldIeWaiting_=!0,b=" onreadystatechange='goog.onScriptLoad_(this, "+ ++goog.lastNonModuleScriptIndex_+")' ",c.write('<script type="text/javascript" src="'+
|
||||
a+'"'+b+">\x3c/script>")):goog.ENABLE_CHROME_APP_SAFE_SCRIPT_LOADING?goog.appendScriptSrcNode_(a):goog.writeScriptSrcNode_(a):c.write('<script type="text/javascript">'+goog.protectScriptTag_(b)+"\x3c/script>");return!0}return!1},goog.protectScriptTag_=function(a){return a.replace(/<\/(SCRIPT)/ig,"\\x3c/$1")},goog.needsTranspile_=function(a){if("always"==goog.TRANSPILE)return!0;if("never"==goog.TRANSPILE)return!1;goog.requiresTranspilation_||(goog.requiresTranspilation_=goog.createRequiresTranspilation_());
|
||||
if(a in goog.requiresTranspilation_)return goog.requiresTranspilation_[a];throw Error("Unknown language mode: "+a);},goog.requiresTranspilation_=null,goog.lastNonModuleScriptIndex_=0,goog.onScriptLoad_=function(a,b){"complete"==a.readyState&&goog.lastNonModuleScriptIndex_==b&&goog.loadQueuedModules_();return!0},goog.writeScripts_=function(a){function b(a){if(!(a in e.written||a in e.visited)){e.visited[a]=!0;if(a in e.requires)for(var f in e.requires[a])if(!goog.isProvided_(f))if(f in e.nameToPath)b(e.nameToPath[f]);
|
||||
else throw Error("Undefined nameToPath for "+f);a in d||(d[a]=!0,c.push(a))}}var c=[],d={},e=goog.dependencies_;b(a);for(a=0;a<c.length;a++){var f=c[a];goog.dependencies_.written[f]=!0}var g=goog.moduleLoaderState_;goog.moduleLoaderState_=null;for(a=0;a<c.length;a++)if(f=c[a]){var h=e.loadFlags[f]||{},k=goog.needsTranspile_(h.lang||"es3");"goog"==h.module||k?goog.importProcessedScript_(goog.basePath+f,"goog"==h.module,k):goog.importScript_(goog.basePath+f)}else throw goog.moduleLoaderState_=g,Error("Undefined script input");
|
||||
goog.moduleLoaderState_=g},goog.getPathFromDeps_=function(a){return a in goog.dependencies_.nameToPath?goog.dependencies_.nameToPath[a]:null},goog.findBasePath_(),goog.global.CLOSURE_NO_DEPS||goog.importScript_(goog.basePath+"deps.js"));goog.hasBadLetScoping=null;goog.useSafari10Workaround=function(){if(null==goog.hasBadLetScoping){try{var a=!eval('"use strict";let x = 1; function f() { return typeof x; };f() == "number";')}catch(b){a=!1}goog.hasBadLetScoping=a}return goog.hasBadLetScoping};
|
||||
goog.workaroundSafari10EvalBug=function(a){return"(function(){"+a+"\n;})();\n"};
|
||||
goog.getObjectByName=function(a,b){a=a.split(".");b=b||goog.global;for(var c=0;c<a.length;c++)if(b=b[a[c]],!goog.isDefAndNotNull(b))return null;return b};goog.globalize=function(a,b){b=b||goog.global;for(var c in a)b[c]=a[c]};goog.addDependency=function(a,b,c,d){if(goog.DEPENDENCIES_ENABLED){var e=goog.getLoader_();e&&e.addDependency(a,b,c,d)}};goog.ENABLE_DEBUG_LOADER=!0;goog.logToConsole_=function(a){goog.global.console&&goog.global.console.error(a)};
|
||||
goog.require=function(a){goog.ENABLE_DEBUG_LOADER&&goog.debugLoader_&&goog.getLoader_().earlyProcessLoad(a);if(!COMPILED){if(goog.isProvided_(a)){if(goog.isInModuleLoader_())return goog.module.getInternal_(a)}else if(goog.ENABLE_DEBUG_LOADER){var b=goog.moduleLoaderState_;goog.moduleLoaderState_=null;try{var c=goog.getLoader_();c?c.load(a):goog.logToConsole_("Could not load "+a+" because there is no debug loader.")}finally{goog.moduleLoaderState_=b}}return null}};goog.basePath="";
|
||||
goog.nullFunction=function(){};goog.abstractMethod=function(){throw Error("unimplemented abstract method");};goog.addSingletonGetter=function(a){a.instance_=void 0;a.getInstance=function(){if(a.instance_)return a.instance_;goog.DEBUG&&(goog.instantiatedSingletons_[goog.instantiatedSingletons_.length]=a);return a.instance_=new a}};goog.instantiatedSingletons_=[];goog.LOAD_MODULE_USING_EVAL=!0;goog.SEAL_MODULE_EXPORTS=goog.DEBUG;goog.loadedModules_={};goog.DEPENDENCIES_ENABLED=!COMPILED&&goog.ENABLE_DEBUG_LOADER;
|
||||
goog.TRANSPILE="detect";goog.TRANSPILER="transpile.js";goog.DEBUG_LOADER="";
|
||||
goog.DEPENDENCIES_ENABLED&&(goog.inHtmlDocument_=function(){var a=goog.global.document;return null!=a&&"write"in a},goog.findBasePath_=function(){if(goog.isDef(goog.global.CLOSURE_BASE_PATH)&&goog.isString(goog.global.CLOSURE_BASE_PATH))goog.basePath=goog.global.CLOSURE_BASE_PATH;else if(goog.inHtmlDocument_()){var a=goog.global.document,b=a.currentScript;a=b?[b]:a.getElementsByTagName("SCRIPT");for(b=a.length-1;0<=b;--b){var c=a[b].src,d=c.lastIndexOf("?");d=-1==d?c.length:d;if("base.js"==c.substr(d-
|
||||
7,7)){goog.basePath=c.substr(0,d-7);break}}}},goog.findBasePath_(),goog.retrieveAndEval_=function(a){var b=goog.loadFileSync_(a);if(b)goog.globalEval(b+("\n//# sourceURL="+a));else throw Error("Could not retrieve file "+a);},goog.Transpiler=function(){this.requiresTranspilation_=null},goog.Transpiler.prototype.createRequiresTranspilation_=function(){function a(a,b){d?c[a]=!0:b()?c[a]=!1:d=c[a]=!0}function b(a){try{return!!eval(a)}catch(g){return!1}}var c={es3:!1},d=!1,e=goog.global.navigator&&goog.global.navigator.userAgent?
|
||||
goog.global.navigator.userAgent:"";a("es5",function(){return b("[1,].length==1")});a("es6",function(){var a=e.match(/Edge\/(\d+)(\.\d)*/i);return a&&15>Number(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")});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){var c=goog.global.$jscomp;c||(goog.global.$jscomp=
|
||||
c={});var d=c.transpile;if(!d){var e=goog.basePath+goog.TRANSPILER,f=goog.loadFileSync_(e);if(f){(function(){eval(f+"\n//# sourceURL="+e)}).call(goog.global);if(goog.global.$gwtExport&&goog.global.$gwtExport.$jscomp&&!goog.global.$gwtExport.$jscomp.transpile)throw Error('The transpiler did not properly export the "transpile" method. $gwtExport: '+JSON.stringify(goog.global.$gwtExport));goog.global.$jscomp.transpile=goog.global.$gwtExport.$jscomp.transpile;c=goog.global.$jscomp;d=c.transpile}}d||(d=
|
||||
c.transpile=goog.bind(function(a,b){goog.logToConsole_(b+" requires transpilation but no transpiler was found.");return a},this));return d(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=function(a){if(!(a in f.written||a in f.visited)){f.visited[a]=!0;if(a in f.requires)for(var b in f.requires[a])if(!g.isProvided(b))if(b in f.nameToPath)c(f.nameToPath[b]);else throw Error("Undefined nameToPath for "+b);a in e||(e[a]=!0,d.push(a))}},d=[],e={},f=this.dependencies_,g=this;c(b);for(a=0;a<d.length;a++)b=d[a],this.dependencies_.written[b]=
|
||||
!0;for(a=0;a<d.length;a++)if(b=d[a]){var h=f.loadFlags[b]||{},k=h.lang||"es3";k=this.getTranspiler().needsTranspile(k);"goog"==h.module||k?this.importProcessedScript_(goog.basePath+b,"goog"==h.module,k):this.importScript_(goog.basePath+b)}else throw Error("Undefined script input");}else throw a="goog.require could not find: "+a,this.logToConsole(a),Error(a);},goog.DebugLoader.prototype.addDependency=function(a,b,c,d){var e;a=a.replace(/\\/g,"/");var f=this.dependencies_;d&&"boolean"!==typeof d||(d=
|
||||
d?{module:"goog"}:{});for(var g=0;e=b[g];g++)f.nameToPath[e]=a,f.loadFlags[a]=d;for(d=0;b=c[d];d++)a in f.requires||(f.requires[a]={}),f.requires[a][b]=!0},goog.DebugLoader.prototype.importScript_=function(a,b){(goog.global.CLOSURE_IMPORT_SCRIPT||goog.bind(this.writeScriptTag_,this))(a,b)&&(this.dependencies_.written[a]=!0)},goog.DebugLoader.prototype.importProcessedScript_=function(a,b,c){this.importScript_("",'goog.debugLoader_.retrieveAndExec_("'+a+'", '+b+", "+c+");")},goog.DebugLoader.prototype.retrieveAndExec_=
|
||||
function(a,b,c){if(!COMPILED){var d=a;a=this.normalizePath(a);var e=goog.global.CLOSURE_IMPORT_SCRIPT||goog.bind(this.writeScriptTag_,this),f=this.loadFileSync(a);if(null==f)throw Error('Load of "'+a+'" failed');c&&(f=this.getTranspiler().transpile(f,a));f=b?this.wrapModule_(a,f):f+("\n//# sourceURL="+a);goog.DebugLoader.IS_OLD_IE_&&this.oldIeWaiting_?(this.dependencies_.deferred[d]=f,this.queuedModules_.push(d)):e(a,f)}},goog.DebugLoader.prototype.wrapModule_=function(a,b){return goog.LOAD_MODULE_USING_EVAL&&
|
||||
goog.isDef(goog.global.JSON)?"goog.loadModule("+goog.global.JSON.stringify(b+"\n//# sourceURL="+a+"\n")+");":'goog.loadModule(function(exports) {"use strict";'+b+"\n;return exports});\n//# sourceURL="+a+"\n"},goog.DebugLoader.prototype.loadQueuedModules_=function(){var a=this.queuedModules_.length;if(0<a){var b=this.queuedModules_;this.queuedModules_=[];for(var c=0;c<a;c++)this.maybeProcessDeferredPath_(b[c])}this.oldIeWaiting_=!1},goog.DebugLoader.prototype.maybeProcessDeferredDep_=function(a){this.isDeferredModule_(a)&&
|
||||
this.allDepsAreAvailable_(a)&&(a=this.getPathFromDeps_(a),this.maybeProcessDeferredPath_(goog.basePath+a))},goog.DebugLoader.prototype.isDeferredModule_=function(a){var b=(a=this.getPathFromDeps_(a))&&this.dependencies_.loadFlags[a]||{},c=b.lang||"es3";return a&&("goog"==b.module||this.getTranspiler().needsTranspile(c))?goog.basePath+a in this.dependencies_.deferred:!1},goog.DebugLoader.prototype.allDepsAreAvailable_=function(a){if((a=this.getPathFromDeps_(a))&&a in this.dependencies_.requires)for(var b in this.dependencies_.requires[a])if(!this.isProvided(b)&&
|
||||
!this.isDeferredModule_(b))return!1;return!0},goog.DebugLoader.prototype.maybeProcessDeferredPath_=function(a){if(a in this.dependencies_.deferred){var b=this.dependencies_.deferred[a];delete this.dependencies_.deferred[a];goog.globalEval(b)}},goog.DebugLoader.prototype.writeScriptSrcNode_=function(a){goog.global.document.write('<script type="text/javascript" src="'+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');}void 0===b?goog.DebugLoader.IS_OLD_IE_?(this.oldIeWaiting_=!0,b=" onreadystatechange='goog.debugLoader_.onScriptLoad_(this, "+ ++this.lastNonModuleScriptIndex_+
|
||||
")' ",c.write('<script type="text/javascript" src="'+a+'"'+b+">\x3c/script>")):goog.ENABLE_CHROME_APP_SAFE_SCRIPT_LOADING?this.appendScriptSrcNode_(a):this.writeScriptSrcNode_(a):c.write('<script type="text/javascript">'+this.protectScriptTag_(b)+"\x3c/script>");return!0}return!1},goog.DebugLoader.prototype.protectScriptTag_=function(a){return a.replace(/<\/(SCRIPT)/ig,"\\x3c/$1")},goog.DebugLoader.prototype.onScriptLoad_=function(a,b){"complete"==a.readyState&&this.lastNonModuleScriptIndex_==b&&
|
||||
this.loadQueuedModules_();return!0},goog.DebugLoader.prototype.getPathFromDeps_=function(a){return a in this.dependencies_.nameToPath?this.dependencies_.nameToPath[a]:null},goog.DebugLoader.prototype.getTranspiler=function(){return goog.transpiler_},goog.DebugLoader.prototype.isProvided=function(a){return goog.isProvided_(a)},goog.DebugLoader.prototype.inHtmlDocument=function(){return goog.inHtmlDocument_()},goog.DebugLoader.prototype.logToConsole=function(a){goog.logToConsole_(a)},goog.DebugLoader.prototype.loadFileSync=
|
||||
function(a){return goog.loadFileSync_(a)},goog.DebugLoader.prototype.normalizePath=function(a){return goog.normalizePath_(a)},goog.debugLoader_=null,goog.registerDebugLoader=function(a){if(goog.debugLoader_)throw Error("Debug loader already registered!");if(!(a instanceof goog.DebugLoader))throw Error("Not a goog.DebugLoader.");goog.debugLoader_=a},goog.getLoader_=function(){if(!goog.debugLoader_){if(goog.DEBUG_LOADER){if(goog.retrieveAndEval_(goog.basePath+goog.DEBUG_LOADER),!goog.debugLoader_)throw Error("Loaded debug loader file but no loader was registered!");
|
||||
}else goog.debugLoader_=new goog.DebugLoader;goog.global.CLOSURE_NO_DEPS||goog.retrieveAndEval_(goog.basePath+"deps.js")}return goog.debugLoader_});goog.hasBadLetScoping=null;goog.useSafari10Workaround=function(){if(null==goog.hasBadLetScoping){try{var a=!eval('"use strict";let x = 1; function f() { return typeof x; };f() == "number";')}catch(b){a=!1}goog.hasBadLetScoping=a}return goog.hasBadLetScoping};goog.workaroundSafari10EvalBug=function(a){return"(function(){"+a+"\n;})();\n"};
|
||||
goog.loadModule=function(a){var b=goog.moduleLoaderState_;try{goog.moduleLoaderState_={moduleName:void 0,declareLegacyNamespace:!1};if(goog.isFunction(a))var c=a.call(void 0,{});else if(goog.isString(a))goog.useSafari10Workaround()&&(a=goog.workaroundSafari10EvalBug(a)),c=goog.loadModuleFromSource_.call(void 0,a);else throw Error("Invalid module definition");var d=goog.moduleLoaderState_.moduleName;if(!goog.isString(d)||!d)throw Error('Invalid module name "'+d+'"');goog.moduleLoaderState_.declareLegacyNamespace?
|
||||
goog.constructNamespace_(d,c):goog.SEAL_MODULE_EXPORTS&&Object.seal&&"object"==typeof c&&null!=c&&Object.seal(c);goog.loadedModules_[d]=c}finally{goog.moduleLoaderState_=b}};goog.loadModuleFromSource_=function(a){eval(a);return{}};goog.normalizePath_=function(a){a=a.split("/");for(var b=0;b<a.length;)"."==a[b]?a.splice(b,1):b&&".."==a[b]&&a[b-1]&&".."!=a[b-1]?a.splice(--b,2):b++;return a.join("/")};
|
||||
goog.loadFileSync_=function(a){if(goog.global.CLOSURE_LOAD_FILE_SYNC)return goog.global.CLOSURE_LOAD_FILE_SYNC(a);try{var b=new goog.global.XMLHttpRequest;b.open("get",a,!1);b.send();return 0==b.status||200==b.status?b.responseText:null}catch(c){return null}};
|
||||
goog.retrieveAndExec_=function(a,b,c){if(!COMPILED){var d=a;a=goog.normalizePath_(a);var e=goog.global.CLOSURE_IMPORT_SCRIPT||goog.writeScriptTag_,f=goog.loadFileSync_(a);if(null==f)throw Error('Load of "'+a+'" failed');c&&(f=goog.transpile_.call(goog.global,f,a));f=b?goog.wrapModule_(a,f):f+("\n//# sourceURL="+a);goog.IS_OLD_IE_&&goog.oldIeWaiting_?(goog.dependencies_.deferred[d]=f,goog.queuedModules_.push(d)):e(a,f)}};
|
||||
goog.transpile_=function(a,b){var c=goog.global.$jscomp;c||(goog.global.$jscomp=c={});var d=c.transpile;if(!d){var e=goog.basePath+goog.TRANSPILER,f=goog.loadFileSync_(e);if(f){eval(f+"\n//# sourceURL="+e);if(goog.global.$gwtExport&&goog.global.$gwtExport.$jscomp&&!goog.global.$gwtExport.$jscomp.transpile)throw Error('The transpiler did not properly export the "transpile" method. $gwtExport: '+JSON.stringify(goog.global.$gwtExport));goog.global.$jscomp.transpile=goog.global.$gwtExport.$jscomp.transpile;
|
||||
c=goog.global.$jscomp;d=c.transpile}}d||(d=c.transpile=function(a,b){goog.logToConsole_(b+" requires transpilation but no transpiler was found.");return a});return d(a,b)};
|
||||
goog.typeOf=function(a){var b=typeof a;if("object"==b)if(a){if(a instanceof Array)return"array";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if("[object Window]"==c)return"object";if("[object Array]"==c||"number"==typeof a.length&&"undefined"!=typeof a.splice&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("splice"))return"array";if("[object Function]"==c||"undefined"!=typeof a.call&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("call"))return"function"}else return"null";
|
||||
else if("function"==b&&"undefined"==typeof a.call)return"object";return b};goog.isNull=function(a){return null===a};goog.isDefAndNotNull=function(a){return null!=a};goog.isArray=function(a){return"array"==goog.typeOf(a)};goog.isArrayLike=function(a){var b=goog.typeOf(a);return"array"==b||"object"==b&&"number"==typeof a.length};goog.isDateLike=function(a){return goog.isObject(a)&&"function"==typeof a.getFullYear};goog.isFunction=function(a){return"function"==goog.typeOf(a)};
|
||||
goog.isObject=function(a){var b=typeof a;return"object"==b&&null!=a||"function"==b};goog.getUid=function(a){return a[goog.UID_PROPERTY_]||(a[goog.UID_PROPERTY_]=++goog.uidCounter_)};goog.hasUid=function(a){return!!a[goog.UID_PROPERTY_]};goog.removeUid=function(a){null!==a&&"removeAttribute"in a&&a.removeAttribute(goog.UID_PROPERTY_);try{delete a[goog.UID_PROPERTY_]}catch(b){}};goog.UID_PROPERTY_="closure_uid_"+(1E9*Math.random()>>>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(2<arguments.length){var d=Array.prototype.slice.call(arguments,2);return function(){var c=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(c,d);return a.apply(b,c)}}return function(){return a.apply(b,arguments)}};goog.bind=function(a,b,c){Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?goog.bind=goog.bindNative_:goog.bind=goog.bindJs_;return goog.bind.apply(null,arguments)};
|
||||
goog.partial=function(a,b){var c=Array.prototype.slice.call(arguments,1);return function(){var b=c.slice();b.push.apply(b,arguments);return a.apply(this,b)}};goog.mixin=function(a,b){for(var c in b)a[c]=b[c]};goog.now=goog.TRUSTED_SITE&&Date.now||function(){return+new Date};
|
||||
goog.globalEval=function(a){if(goog.global.execScript)goog.global.execScript(a,"JavaScript");else if(goog.global.eval){if(null==goog.evalWorksForGlobals_)if(goog.global.eval("var _evalTest_ = 1;"),"undefined"!=typeof goog.global._evalTest_){try{delete goog.global._evalTest_}catch(d){}goog.evalWorksForGlobals_=!0}else goog.evalWorksForGlobals_=!1;if(goog.evalWorksForGlobals_)goog.global.eval(a);else{var b=goog.global.document,c=b.createElement("SCRIPT");c.type="text/javascript";c.defer=!1;c.appendChild(b.createTextNode(a));
|
||||
b.body.appendChild(c);b.body.removeChild(c)}}else throw Error("goog.globalEval not available");};goog.evalWorksForGlobals_=null;
|
||||
goog.globalEval=function(a){if(goog.global.execScript)goog.global.execScript(a,"JavaScript");else if(goog.global.eval){if(null==goog.evalWorksForGlobals_){try{goog.global.eval("var _evalTest_ = 1;")}catch(d){}if("undefined"!=typeof goog.global._evalTest_){try{delete goog.global._evalTest_}catch(d){}goog.evalWorksForGlobals_=!0}else goog.evalWorksForGlobals_=!1}if(goog.evalWorksForGlobals_)goog.global.eval(a);else{var b=goog.global.document,c=b.createElement("SCRIPT");c.type="text/javascript";c.defer=
|
||||
!1;c.appendChild(b.createTextNode(a));b.head.appendChild(c);b.head.removeChild(c)}}else throw Error("goog.globalEval not available");};goog.evalWorksForGlobals_=null;
|
||||
goog.getCssName=function(a,b){if("."==String(a).charAt(0))throw Error('className passed in goog.getCssName must not start with ".". You passed: '+a);var c=function(a){return goog.cssNameMapping_[a]||a},d=function(a){a=a.split("-");for(var b=[],d=0;d<a.length;d++)b.push(c(a[d]));return b.join("-")};d=goog.cssNameMapping_?"BY_WHOLE"==goog.cssNameMappingStyle_?c:d:function(a){return a};a=b?a+"-"+d(b):d(a);return goog.global.CLOSURE_CSS_NAME_MAP_FN?goog.global.CLOSURE_CSS_NAME_MAP_FN(a):a};
|
||||
goog.setCssNameMapping=function(a,b){goog.cssNameMapping_=a;goog.cssNameMappingStyle_=b};!COMPILED&&goog.global.CLOSURE_CSS_NAME_MAPPING&&(goog.cssNameMapping_=goog.global.CLOSURE_CSS_NAME_MAPPING);goog.getMsg=function(a,b){b&&(a=a.replace(/\{\$([^}]+)}/g,function(a,d){return null!=b&&d in b?b[d]:a}));return a};goog.getMsgWithFallback=function(a,b){return a};goog.exportSymbol=function(a,b,c){goog.exportPath_(a,b,c)};goog.exportProperty=function(a,b,c){a[b]=c};
|
||||
goog.inherits=function(a,b){function c(){}c.prototype=b.prototype;a.superClass_=b.prototype;a.prototype=new c;a.prototype.constructor=a;a.base=function(a,c,f){for(var d=Array(arguments.length-2),e=2;e<arguments.length;e++)d[e-2]=arguments[e];return b.prototype[c].apply(a,d)}};
|
||||
@@ -47,9 +50,7 @@ goog.base=function(a,b,c){var d=arguments.callee.caller;if(goog.STRICT_MODE_COMP
|
||||
g.superClass_&&g.superClass_.constructor)if(g.prototype[b]===d)f=!0;else if(f)return g.prototype[b].apply(a,e);if(a[b]===d)return a.constructor.prototype[b].apply(a,e);throw Error("goog.base called from a method of one name to a method of a different name");};goog.scope=function(a){if(goog.isInModuleLoader_())throw Error("goog.scope is not supported within a goog.module.");a.call(goog.global)};COMPILED||(goog.global.COMPILED=COMPILED);
|
||||
goog.defineClass=function(a,b){var c=b.constructor,d=b.statics;c&&c!=Object.prototype.constructor||(c=function(){throw Error("cannot instantiate an interface (no constructor defined).");});c=goog.defineClass.createSealingConstructor_(c,a);a&&goog.inherits(c,a);delete b.constructor;delete b.statics;goog.defineClass.applyProperties_(c.prototype,b);null!=d&&(d instanceof Function?d(c):goog.defineClass.applyProperties_(c,d));return c};goog.defineClass.SEAL_CLASS_INSTANCES=goog.DEBUG;
|
||||
goog.defineClass.createSealingConstructor_=function(a,b){if(!goog.defineClass.SEAL_CLASS_INSTANCES)return a;var c=!goog.defineClass.isUnsealable_(b),d=function(){var b=a.apply(this,arguments)||this;b[goog.UID_PROPERTY_]=b[goog.UID_PROPERTY_];this.constructor===d&&c&&Object.seal instanceof Function&&Object.seal(b);return b};return d};goog.defineClass.isUnsealable_=function(a){return a&&a.prototype&&a.prototype[goog.UNSEALABLE_CONSTRUCTOR_PROPERTY_]};goog.defineClass.OBJECT_PROTOTYPE_FIELDS_="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");
|
||||
goog.defineClass.applyProperties_=function(a,b){for(var c in b)Object.prototype.hasOwnProperty.call(b,c)&&(a[c]=b[c]);for(var d=0;d<goog.defineClass.OBJECT_PROTOTYPE_FIELDS_.length;d++)c=goog.defineClass.OBJECT_PROTOTYPE_FIELDS_[d],Object.prototype.hasOwnProperty.call(b,c)&&(a[c]=b[c])};goog.tagUnsealableClass=function(a){!COMPILED&&goog.defineClass.SEAL_CLASS_INSTANCES&&(a.prototype[goog.UNSEALABLE_CONSTRUCTOR_PROPERTY_]=!0)};goog.UNSEALABLE_CONSTRUCTOR_PROPERTY_="goog_defineClass_legacy_unsealable";
|
||||
goog.createRequiresTranspilation_=function(){function a(a,b){d?c[a]=!0:b()?c[a]=!1:d=c[a]=!0}function b(a){try{return!!eval(a)}catch(g){return!1}}var c={es3:!1},d=!1,e=goog.global.navigator&&goog.global.navigator.userAgent?goog.global.navigator.userAgent:"";a("es5",function(){return b("[1,].length==1")});a("es6",function(){var a=e.match(/Edge\/(\d+)(\.\d)*/i);return a&&15>Number(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")});return c};goog.debug={};goog.debug.Error=function(a){if(Error.captureStackTrace)Error.captureStackTrace(this,goog.debug.Error);else{var b=Error().stack;b&&(this.stack=b)}a&&(this.message=String(a));this.reportErrorToServer=!0};goog.inherits(goog.debug.Error,Error);goog.debug.Error.prototype.name="CustomError";goog.dom={};goog.dom.NodeType={ELEMENT:1,ATTRIBUTE:2,TEXT:3,CDATA_SECTION:4,ENTITY_REFERENCE:5,ENTITY:6,PROCESSING_INSTRUCTION:7,COMMENT:8,DOCUMENT:9,DOCUMENT_TYPE:10,DOCUMENT_FRAGMENT:11,NOTATION:12};goog.string={};goog.string.DETECT_DOUBLE_ESCAPING=!1;goog.string.FORCE_NON_DOM_HTML_UNESCAPING=!1;goog.string.Unicode={NBSP:"\u00a0"};goog.string.startsWith=function(a,b){return 0==a.lastIndexOf(b,0)};goog.string.endsWith=function(a,b){var c=a.length-b.length;return 0<=c&&a.indexOf(b,c)==c};goog.string.caseInsensitiveStartsWith=function(a,b){return 0==goog.string.caseInsensitiveCompare(b,a.substr(0,b.length))};
|
||||
goog.defineClass.applyProperties_=function(a,b){for(var c in b)Object.prototype.hasOwnProperty.call(b,c)&&(a[c]=b[c]);for(var d=0;d<goog.defineClass.OBJECT_PROTOTYPE_FIELDS_.length;d++)c=goog.defineClass.OBJECT_PROTOTYPE_FIELDS_[d],Object.prototype.hasOwnProperty.call(b,c)&&(a[c]=b[c])};goog.tagUnsealableClass=function(a){!COMPILED&&goog.defineClass.SEAL_CLASS_INSTANCES&&(a.prototype[goog.UNSEALABLE_CONSTRUCTOR_PROPERTY_]=!0)};goog.UNSEALABLE_CONSTRUCTOR_PROPERTY_="goog_defineClass_legacy_unsealable";goog.debug={};goog.debug.Error=function(a){if(Error.captureStackTrace)Error.captureStackTrace(this,goog.debug.Error);else{var b=Error().stack;b&&(this.stack=b)}a&&(this.message=String(a));this.reportErrorToServer=!0};goog.inherits(goog.debug.Error,Error);goog.debug.Error.prototype.name="CustomError";goog.dom={};goog.dom.NodeType={ELEMENT:1,ATTRIBUTE:2,TEXT:3,CDATA_SECTION:4,ENTITY_REFERENCE:5,ENTITY:6,PROCESSING_INSTRUCTION:7,COMMENT:8,DOCUMENT:9,DOCUMENT_TYPE:10,DOCUMENT_FRAGMENT:11,NOTATION:12};goog.string={};goog.string.DETECT_DOUBLE_ESCAPING=!1;goog.string.FORCE_NON_DOM_HTML_UNESCAPING=!1;goog.string.Unicode={NBSP:"\u00a0"};goog.string.startsWith=function(a,b){return 0==a.lastIndexOf(b,0)};goog.string.endsWith=function(a,b){var c=a.length-b.length;return 0<=c&&a.indexOf(b,c)==c};goog.string.caseInsensitiveStartsWith=function(a,b){return 0==goog.string.caseInsensitiveCompare(b,a.substr(0,b.length))};
|
||||
goog.string.caseInsensitiveEndsWith=function(a,b){return 0==goog.string.caseInsensitiveCompare(b,a.substr(a.length-b.length,b.length))};goog.string.caseInsensitiveEquals=function(a,b){return a.toLowerCase()==b.toLowerCase()};goog.string.subs=function(a,b){for(var c=a.split("%s"),d="",e=Array.prototype.slice.call(arguments,1);e.length&&1<c.length;)d+=c.shift()+e.shift();return d+c.join("%s")};goog.string.collapseWhitespace=function(a){return a.replace(/[\s\xa0]+/g," ").replace(/^\s+|\s+$/g,"")};
|
||||
goog.string.isEmptyOrWhitespace=function(a){return/^[\s\xa0]*$/.test(a)};goog.string.isEmptyString=function(a){return 0==a.length};goog.string.isEmpty=goog.string.isEmptyOrWhitespace;goog.string.isEmptyOrWhitespaceSafe=function(a){return goog.string.isEmptyOrWhitespace(goog.string.makeSafe(a))};goog.string.isEmptySafe=goog.string.isEmptyOrWhitespaceSafe;goog.string.isBreakingWhitespace=function(a){return!/[^\t\n\r ]/.test(a)};goog.string.isAlpha=function(a){return!/[^a-zA-Z]/.test(a)};
|
||||
goog.string.isNumeric=function(a){return!/[^0-9]/.test(a)};goog.string.isAlphaNumeric=function(a){return!/[^a-zA-Z0-9]/.test(a)};goog.string.isSpace=function(a){return" "==a};goog.string.isUnicodeChar=function(a){return 1==a.length&&" "<=a&&"~">=a||"\u0080"<=a&&"\ufffd">=a};goog.string.stripNewlines=function(a){return a.replace(/(\r\n|\r|\n)+/g," ")};goog.string.canonicalizeNewlines=function(a){return a.replace(/(\r\n|\r|\n)/g,"\n")};
|
||||
@@ -81,8 +82,8 @@ goog.asserts.fail=function(a,b){goog.asserts.ENABLE_ASSERTS&&goog.asserts.errorH
|
||||
goog.asserts.assertString=function(a,b,c){goog.asserts.ENABLE_ASSERTS&&!goog.isString(a)&&goog.asserts.doAssertFailure_("Expected string but got %s: %s.",[goog.typeOf(a),a],b,Array.prototype.slice.call(arguments,2));return a};goog.asserts.assertFunction=function(a,b,c){goog.asserts.ENABLE_ASSERTS&&!goog.isFunction(a)&&goog.asserts.doAssertFailure_("Expected function but got %s: %s.",[goog.typeOf(a),a],b,Array.prototype.slice.call(arguments,2));return a};
|
||||
goog.asserts.assertObject=function(a,b,c){goog.asserts.ENABLE_ASSERTS&&!goog.isObject(a)&&goog.asserts.doAssertFailure_("Expected object but got %s: %s.",[goog.typeOf(a),a],b,Array.prototype.slice.call(arguments,2));return a};goog.asserts.assertArray=function(a,b,c){goog.asserts.ENABLE_ASSERTS&&!goog.isArray(a)&&goog.asserts.doAssertFailure_("Expected array but got %s: %s.",[goog.typeOf(a),a],b,Array.prototype.slice.call(arguments,2));return a};
|
||||
goog.asserts.assertBoolean=function(a,b,c){goog.asserts.ENABLE_ASSERTS&&!goog.isBoolean(a)&&goog.asserts.doAssertFailure_("Expected boolean but got %s: %s.",[goog.typeOf(a),a],b,Array.prototype.slice.call(arguments,2));return a};goog.asserts.assertElement=function(a,b,c){!goog.asserts.ENABLE_ASSERTS||goog.isObject(a)&&a.nodeType==goog.dom.NodeType.ELEMENT||goog.asserts.doAssertFailure_("Expected Element but got %s: %s.",[goog.typeOf(a),a],b,Array.prototype.slice.call(arguments,2));return a};
|
||||
goog.asserts.assertInstanceof=function(a,b,c,d){!goog.asserts.ENABLE_ASSERTS||a instanceof b||goog.asserts.doAssertFailure_("Expected instanceof %s but got %s.",[goog.asserts.getType_(b),goog.asserts.getType_(a)],c,Array.prototype.slice.call(arguments,3));return a};goog.asserts.assertObjectPrototypeIsIntact=function(){for(var a in Object.prototype)goog.asserts.fail(a+" should not be enumerable in Object.prototype.")};
|
||||
goog.asserts.getType_=function(a){return a instanceof Function?a.displayName||a.name||"unknown type name":a instanceof Object?a.constructor.displayName||a.constructor.name||Object.prototype.toString.call(a):null===a?"null":typeof a};goog.debug.entryPointRegistry={};goog.debug.EntryPointMonitor=function(){};goog.debug.entryPointRegistry.refList_=[];goog.debug.entryPointRegistry.monitors_=[];goog.debug.entryPointRegistry.monitorsMayExist_=!1;goog.debug.entryPointRegistry.register=function(a){goog.debug.entryPointRegistry.refList_[goog.debug.entryPointRegistry.refList_.length]=a;if(goog.debug.entryPointRegistry.monitorsMayExist_)for(var b=goog.debug.entryPointRegistry.monitors_,c=0;c<b.length;c++)a(goog.bind(b[c].wrap,b[c]))};
|
||||
goog.asserts.assertInstanceof=function(a,b,c,d){!goog.asserts.ENABLE_ASSERTS||a instanceof b||goog.asserts.doAssertFailure_("Expected instanceof %s but got %s.",[goog.asserts.getType_(b),goog.asserts.getType_(a)],c,Array.prototype.slice.call(arguments,3));return a};goog.asserts.assertFinite=function(a,b,c){!goog.asserts.ENABLE_ASSERTS||"number"==typeof a&&isFinite(a)||goog.asserts.doAssertFailure_("Expected %s to be a finite number but it is not.",[a],b,Array.prototype.slice.call(arguments,2));return a};
|
||||
goog.asserts.assertObjectPrototypeIsIntact=function(){for(var a in Object.prototype)goog.asserts.fail(a+" should not be enumerable in Object.prototype.")};goog.asserts.getType_=function(a){return a instanceof Function?a.displayName||a.name||"unknown type name":a instanceof Object?a.constructor.displayName||a.constructor.name||Object.prototype.toString.call(a):null===a?"null":typeof a};goog.debug.entryPointRegistry={};goog.debug.EntryPointMonitor=function(){};goog.debug.entryPointRegistry.refList_=[];goog.debug.entryPointRegistry.monitors_=[];goog.debug.entryPointRegistry.monitorsMayExist_=!1;goog.debug.entryPointRegistry.register=function(a){goog.debug.entryPointRegistry.refList_[goog.debug.entryPointRegistry.refList_.length]=a;if(goog.debug.entryPointRegistry.monitorsMayExist_)for(var b=goog.debug.entryPointRegistry.monitors_,c=0;c<b.length;c++)a(goog.bind(b[c].wrap,b[c]))};
|
||||
goog.debug.entryPointRegistry.monitorAll=function(a){goog.debug.entryPointRegistry.monitorsMayExist_=!0;for(var b=goog.bind(a.wrap,a),c=0;c<goog.debug.entryPointRegistry.refList_.length;c++)goog.debug.entryPointRegistry.refList_[c](b);goog.debug.entryPointRegistry.monitors_.push(a)};
|
||||
goog.debug.entryPointRegistry.unmonitorAllIfPossible=function(a){var b=goog.debug.entryPointRegistry.monitors_;goog.asserts.assert(a==b[b.length-1],"Only the most recent monitor can be unwrapped.");a=goog.bind(a.unwrap,a);for(var c=0;c<goog.debug.entryPointRegistry.refList_.length;c++)goog.debug.entryPointRegistry.refList_[c](a);b.length--};goog.array={};goog.NATIVE_ARRAY_PROTOTYPES=goog.TRUSTED_SITE;goog.array.ASSUME_NATIVE_FUNCTIONS=!1;goog.array.peek=function(a){return a[a.length-1]};goog.array.last=goog.array.peek;
|
||||
goog.array.indexOf=goog.NATIVE_ARRAY_PROTOTYPES&&(goog.array.ASSUME_NATIVE_FUNCTIONS||Array.prototype.indexOf)?function(a,b,c){goog.asserts.assert(null!=a.length);return Array.prototype.indexOf.call(a,b,c)}:function(a,b,c){c=null==c?0:0>c?Math.max(0,a.length+c):c;if(goog.isString(a))return goog.isString(b)&&1==b.length?a.indexOf(b,c):-1;for(;c<a.length;c++)if(c in a&&a[c]===b)return c;return-1};
|
||||
@@ -143,9 +144,9 @@ goog.userAgent.PLATFORM_KNOWN_=goog.userAgent.ASSUME_MAC||goog.userAgent.ASSUME_
|
||||
goog.userAgent.isLegacyLinux_=function(){return goog.labs.userAgent.platform.isLinux()||goog.labs.userAgent.platform.isChromeOS()};goog.userAgent.LINUX=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_LINUX:goog.userAgent.isLegacyLinux_();goog.userAgent.isX11_=function(){var a=goog.userAgent.getNavigator();return!!a&&goog.string.contains(a.appVersion||"","X11")};goog.userAgent.X11=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_X11:goog.userAgent.isX11_();
|
||||
goog.userAgent.ANDROID=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_ANDROID:goog.labs.userAgent.platform.isAndroid();goog.userAgent.IPHONE=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_IPHONE:goog.labs.userAgent.platform.isIphone();goog.userAgent.IPAD=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_IPAD:goog.labs.userAgent.platform.isIpad();goog.userAgent.IPOD=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_IPOD:goog.labs.userAgent.platform.isIpod();
|
||||
goog.userAgent.IOS=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_IPHONE||goog.userAgent.ASSUME_IPAD||goog.userAgent.ASSUME_IPOD:goog.labs.userAgent.platform.isIos();goog.userAgent.determineVersion_=function(){var a="",b=goog.userAgent.getVersionRegexResult_();b&&(a=b?b[1]:"");return goog.userAgent.IE&&(b=goog.userAgent.getDocumentMode_(),null!=b&&b>parseFloat(a))?String(b):a};
|
||||
goog.userAgent.getVersionRegexResult_=function(){var a=goog.userAgent.getUserAgentString();if(goog.userAgent.GECKO)return/rv\:([^\);]+)(\)|;)/.exec(a);if(goog.userAgent.EDGE)return/Edge\/([\d\.]+)/.exec(a);if(goog.userAgent.IE)return/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(a);if(goog.userAgent.WEBKIT)return/WebKit\/(\S+)/.exec(a);if(goog.userAgent.OPERA)return/(?:Version)[ \/]?(\S+)/.exec(a)};goog.userAgent.getDocumentMode_=function(){var a=goog.global.document;return a?a.documentMode:void 0};
|
||||
goog.userAgent.getVersionRegexResult_=function(){var a=goog.userAgent.getUserAgentString();if(goog.userAgent.GECKO)return/rv:([^\);]+)(\)|;)/.exec(a);if(goog.userAgent.EDGE)return/Edge\/([\d\.]+)/.exec(a);if(goog.userAgent.IE)return/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(a);if(goog.userAgent.WEBKIT)return/WebKit\/(\S+)/.exec(a);if(goog.userAgent.OPERA)return/(?:Version)[ \/]?(\S+)/.exec(a)};goog.userAgent.getDocumentMode_=function(){var a=goog.global.document;return a?a.documentMode:void 0};
|
||||
goog.userAgent.VERSION=goog.userAgent.determineVersion_();goog.userAgent.compare=function(a,b){return goog.string.compareVersions(a,b)};goog.userAgent.isVersionOrHigherCache_={};goog.userAgent.isVersionOrHigher=function(a){return goog.userAgent.ASSUME_ANY_VERSION||goog.reflect.cache(goog.userAgent.isVersionOrHigherCache_,a,function(){return 0<=goog.string.compareVersions(goog.userAgent.VERSION,a)})};goog.userAgent.isVersion=goog.userAgent.isVersionOrHigher;
|
||||
goog.userAgent.isDocumentModeOrHigher=function(a){return Number(goog.userAgent.DOCUMENT_MODE)>=a};goog.userAgent.isDocumentMode=goog.userAgent.isDocumentModeOrHigher;goog.userAgent.DOCUMENT_MODE=function(){var a=goog.global.document,b=goog.userAgent.getDocumentMode_();if(a&&goog.userAgent.IE)return b||("CSS1Compat"==a.compatMode?parseInt(goog.userAgent.VERSION,10):5)}();goog.debug.LOGGING_ENABLED=goog.DEBUG;goog.debug.FORCE_SLOPPY_STACKS=!1;goog.debug.catchErrors=function(a,b,c){c=c||goog.global;var d=c.onerror,e=!!b;goog.userAgent.WEBKIT&&!goog.userAgent.isVersionOrHigher("535.3")&&(e=!e);c.onerror=function(b,c,h,k,n){d&&d(b,c,h,k,n);a({message:b,fileName:c,line:h,col:k,error:n});return e}};
|
||||
goog.userAgent.isDocumentModeOrHigher=function(a){return Number(goog.userAgent.DOCUMENT_MODE)>=a};goog.userAgent.isDocumentMode=goog.userAgent.isDocumentModeOrHigher;goog.userAgent.DOCUMENT_MODE=function(){var a=goog.global.document,b=goog.userAgent.getDocumentMode_();if(a&&goog.userAgent.IE)return b||("CSS1Compat"==a.compatMode?parseInt(goog.userAgent.VERSION,10):5)}();goog.debug.LOGGING_ENABLED=goog.DEBUG;goog.debug.FORCE_SLOPPY_STACKS=!1;goog.debug.catchErrors=function(a,b,c){c=c||goog.global;var d=c.onerror,e=!!b;goog.userAgent.WEBKIT&&!goog.userAgent.isVersionOrHigher("535.3")&&(e=!e);c.onerror=function(b,c,h,k,n){d&&d(b,c,h,k,n);a({message:b,fileName:c,line:h,lineNumber:h,col:k,error:n});return e}};
|
||||
goog.debug.expose=function(a,b){if("undefined"==typeof a)return"undefined";if(null==a)return"NULL";var c=[],d;for(d in a)if(b||!goog.isFunction(a[d])){var e=d+" = ";try{e+=a[d]}catch(f){e+="*** "+f+" ***"}c.push(e)}return c.join("\n")};
|
||||
goog.debug.deepExpose=function(a,b){var c=[],d=[],e={},f=function(a,h){var g=h+" ";try{if(goog.isDef(a))if(goog.isNull(a))c.push("NULL");else if(goog.isString(a))c.push('"'+a.replace(/\n/g,"\n"+h)+'"');else if(goog.isFunction(a))c.push(String(a).replace(/\n/g,"\n"+h));else if(goog.isObject(a)){goog.hasUid(a)||d.push(a);var n=goog.getUid(a);if(e[n])c.push("*** reference loop detected (id="+n+") ***");else{e[n]=!0;c.push("{");for(var p in a)if(b||!goog.isFunction(a[p]))c.push("\n"),c.push(g),c.push(p+
|
||||
" = "),f(a[p],g);c.push("\n"+h+"}");delete e[n]}}else c.push(a);else c.push("undefined")}catch(m){c.push("*** "+m+" ***")}};f(a,"");for(a=0;a<d.length;a++)goog.removeUid(d[a]);return c.join("")};goog.debug.exposeArray=function(a){for(var b=[],c=0;c<a.length;c++)goog.isArray(a[c])?b.push(goog.debug.exposeArray(a[c])):b.push(a[c]);return"[ "+b.join(", ")+" ]"};
|
||||
@@ -228,14 +229,10 @@ goog.dom.TagName.SCRIPT=new goog.dom.TagName("SCRIPT");goog.dom.TagName.SECTION=
|
||||
goog.dom.TagName.SUB=new goog.dom.TagName("SUB");goog.dom.TagName.SUMMARY=new goog.dom.TagName("SUMMARY");goog.dom.TagName.SUP=new goog.dom.TagName("SUP");goog.dom.TagName.SVG=new goog.dom.TagName("SVG");goog.dom.TagName.TABLE=new goog.dom.TagName("TABLE");goog.dom.TagName.TBODY=new goog.dom.TagName("TBODY");goog.dom.TagName.TD=new goog.dom.TagName("TD");goog.dom.TagName.TEMPLATE=new goog.dom.TagName("TEMPLATE");goog.dom.TagName.TEXTAREA=new goog.dom.TagName("TEXTAREA");goog.dom.TagName.TFOOT=new goog.dom.TagName("TFOOT");
|
||||
goog.dom.TagName.TH=new goog.dom.TagName("TH");goog.dom.TagName.THEAD=new goog.dom.TagName("THEAD");goog.dom.TagName.TIME=new goog.dom.TagName("TIME");goog.dom.TagName.TITLE=new goog.dom.TagName("TITLE");goog.dom.TagName.TR=new goog.dom.TagName("TR");goog.dom.TagName.TRACK=new goog.dom.TagName("TRACK");goog.dom.TagName.TT=new goog.dom.TagName("TT");goog.dom.TagName.U=new goog.dom.TagName("U");goog.dom.TagName.UL=new goog.dom.TagName("UL");goog.dom.TagName.VAR=new goog.dom.TagName("VAR");
|
||||
goog.dom.TagName.VIDEO=new goog.dom.TagName("VIDEO");goog.dom.TagName.WBR=new goog.dom.TagName("WBR");goog.dom.asserts={};goog.dom.asserts.assertIsLocation=function(a){if(goog.asserts.ENABLE_ASSERTS){var b=goog.dom.asserts.getWindow_(a);"undefined"!=typeof b.Location&&"undefined"!=typeof b.Element&&goog.asserts.assert(a&&(a instanceof b.Location||!(a instanceof b.Element)),"Argument is not a Location (or a non-Element mock); got: %s",goog.dom.asserts.debugStringForType_(a))}return a};
|
||||
goog.dom.asserts.assertIsHTMLAnchorElement=function(a){if(goog.asserts.ENABLE_ASSERTS){var b=goog.dom.asserts.getWindow_(a);"undefined"!=typeof b.HTMLAnchorElement&&"undefined"!=typeof b.Location&&"undefined"!=typeof b.Element&&goog.asserts.assert(a&&(a instanceof b.HTMLAnchorElement||!(a instanceof b.Location||a instanceof b.Element)),"Argument is not a HTMLAnchorElement (or a non-Element mock); got: %s",goog.dom.asserts.debugStringForType_(a))}return a};
|
||||
goog.dom.asserts.assertIsHTMLLinkElement=function(a){if(goog.asserts.ENABLE_ASSERTS){var b=goog.dom.asserts.getWindow_(a);"undefined"!=typeof b.HTMLLinkElement&&"undefined"!=typeof b.Location&&"undefined"!=typeof b.Element&&goog.asserts.assert(a&&(a instanceof b.HTMLLinkElement||!(a instanceof b.Location||a instanceof b.Element)),"Argument is not a HTMLLinkElement (or a non-Element mock); got: %s",goog.dom.asserts.debugStringForType_(a))}return a};
|
||||
goog.dom.asserts.assertIsHTMLImageElement=function(a){if(goog.asserts.ENABLE_ASSERTS){var b=goog.dom.asserts.getWindow_(a);"undefined"!=typeof b.HTMLImageElement&&"undefined"!=typeof b.Element&&goog.asserts.assert(a&&(a instanceof b.HTMLImageElement||!(a instanceof b.Element)),"Argument is not a HTMLImageElement (or a non-Element mock); got: %s",goog.dom.asserts.debugStringForType_(a))}return a};
|
||||
goog.dom.asserts.assertIsHTMLEmbedElement=function(a){if(goog.asserts.ENABLE_ASSERTS){var b=goog.dom.asserts.getWindow_(a);"undefined"!=typeof b.HTMLEmbedElement&&"undefined"!=typeof b.Element&&goog.asserts.assert(a&&(a instanceof b.HTMLEmbedElement||!(a instanceof b.Element)),"Argument is not a HTMLEmbedElement (or a non-Element mock); got: %s",goog.dom.asserts.debugStringForType_(a))}return a};
|
||||
goog.dom.asserts.assertIsHTMLFrameElement=function(a){if(goog.asserts.ENABLE_ASSERTS){var b=goog.dom.asserts.getWindow_(a);"undefined"!=typeof b.HTMLFrameElement&&"undefined"!=typeof b.Element&&goog.asserts.assert(a&&(a instanceof b.HTMLFrameElement||!(a instanceof b.Element)),"Argument is not a HTMLFrameElement (or a non-Element mock); got: %s",goog.dom.asserts.debugStringForType_(a))}return a};
|
||||
goog.dom.asserts.assertIsHTMLIFrameElement=function(a){if(goog.asserts.ENABLE_ASSERTS){var b=goog.dom.asserts.getWindow_(a);"undefined"!=typeof b.HTMLIFrameElement&&"undefined"!=typeof b.Element&&goog.asserts.assert(a&&(a instanceof b.HTMLIFrameElement||!(a instanceof b.Element)),"Argument is not a HTMLIFrameElement (or a non-Element mock); got: %s",goog.dom.asserts.debugStringForType_(a))}return a};
|
||||
goog.dom.asserts.assertIsHTMLObjectElement=function(a){if(goog.asserts.ENABLE_ASSERTS){var b=goog.dom.asserts.getWindow_(a);"undefined"!=typeof b.HTMLObjectElement&&"undefined"!=typeof b.Element&&goog.asserts.assert(a&&(a instanceof b.HTMLObjectElement||!(a instanceof b.Element)),"Argument is not a HTMLObjectElement (or a non-Element mock); got: %s",goog.dom.asserts.debugStringForType_(a))}return a};
|
||||
goog.dom.asserts.assertIsHTMLScriptElement=function(a){if(goog.asserts.ENABLE_ASSERTS){var b=goog.dom.asserts.getWindow_(a);"undefined"!=typeof b.HTMLScriptElement&&"undefined"!=typeof b.Element&&goog.asserts.assert(a&&(a instanceof b.HTMLScriptElement||!(a instanceof b.Element)),"Argument is not a HTMLScriptElement (or a non-Element mock); got: %s",goog.dom.asserts.debugStringForType_(a))}return a};
|
||||
goog.dom.asserts.assertIsElementType_=function(a,b){if(goog.asserts.ENABLE_ASSERTS){var c=goog.dom.asserts.getWindow_(a);"undefined"!=typeof c[b]&&"undefined"!=typeof c.Location&&"undefined"!=typeof c.Element&&goog.asserts.assert(a&&(a instanceof c[b]||!(a instanceof c.Location||a instanceof c.Element)),"Argument is not a %s (or a non-Element, non-Location mock); got: %s",b,goog.dom.asserts.debugStringForType_(a))}return a};
|
||||
goog.dom.asserts.assertIsHTMLAnchorElement=function(a){return goog.dom.asserts.assertIsElementType_(a,"HTMLAnchorElement")};goog.dom.asserts.assertIsHTMLButtonElement=function(a){return goog.dom.asserts.assertIsElementType_(a,"HTMLButtonElement")};goog.dom.asserts.assertIsHTMLLinkElement=function(a){return goog.dom.asserts.assertIsElementType_(a,"HTMLLinkElement")};goog.dom.asserts.assertIsHTMLImageElement=function(a){return goog.dom.asserts.assertIsElementType_(a,"HTMLImageElement")};
|
||||
goog.dom.asserts.assertIsHTMLInputElement=function(a){return goog.dom.asserts.assertIsElementType_(a,"HTMLInputElement")};goog.dom.asserts.assertIsHTMLEmbedElement=function(a){return goog.dom.asserts.assertIsElementType_(a,"HTMLEmbedElement")};goog.dom.asserts.assertIsHTMLFormElement=function(a){return goog.dom.asserts.assertIsElementType_(a,"HTMLFormElement")};goog.dom.asserts.assertIsHTMLFrameElement=function(a){return goog.dom.asserts.assertIsElementType_(a,"HTMLFrameElement")};
|
||||
goog.dom.asserts.assertIsHTMLIFrameElement=function(a){return goog.dom.asserts.assertIsElementType_(a,"HTMLIFrameElement")};goog.dom.asserts.assertIsHTMLObjectElement=function(a){return goog.dom.asserts.assertIsElementType_(a,"HTMLObjectElement")};goog.dom.asserts.assertIsHTMLScriptElement=function(a){return goog.dom.asserts.assertIsElementType_(a,"HTMLScriptElement")};
|
||||
goog.dom.asserts.debugStringForType_=function(a){return goog.isObject(a)?a.constructor.displayName||a.constructor.name||Object.prototype.toString.call(a):void 0===a?"undefined":null===a?"null":typeof a};goog.dom.asserts.getWindow_=function(a){return(a=a&&a.ownerDocument)&&(a.defaultView||a.parentWindow)||goog.global};goog.dom.tags={};goog.dom.tags.VOID_TAGS_={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0};goog.dom.tags.isVoidTag=function(a){return!0===goog.dom.tags.VOID_TAGS_[a]};goog.string.TypedString=function(){};goog.string.Const=function(){this.stringConstValueWithSecurityContract__googStringSecurityPrivate_="";this.STRING_CONST_TYPE_MARKER__GOOG_STRING_SECURITY_PRIVATE_=goog.string.Const.TYPE_MARKER_};goog.string.Const.prototype.implementsGoogStringTypedString=!0;goog.string.Const.prototype.getTypedStringValue=function(){return this.stringConstValueWithSecurityContract__googStringSecurityPrivate_};
|
||||
goog.string.Const.prototype.toString=function(){return"Const{"+this.stringConstValueWithSecurityContract__googStringSecurityPrivate_+"}"};goog.string.Const.unwrap=function(a){if(a instanceof goog.string.Const&&a.constructor===goog.string.Const&&a.STRING_CONST_TYPE_MARKER__GOOG_STRING_SECURITY_PRIVATE_===goog.string.Const.TYPE_MARKER_)return a.stringConstValueWithSecurityContract__googStringSecurityPrivate_;goog.asserts.fail("expected object of type Const, got '"+a+"'");return"type_error:Const"};
|
||||
goog.string.Const.from=function(a){return goog.string.Const.create__googStringSecurityPrivate_(a)};goog.string.Const.TYPE_MARKER_={};goog.string.Const.create__googStringSecurityPrivate_=function(a){var b=new goog.string.Const;b.stringConstValueWithSecurityContract__googStringSecurityPrivate_=a;return b};goog.string.Const.EMPTY=goog.string.Const.from("");goog.html={};goog.html.SafeScript=function(){this.privateDoNotAccessOrElseSafeScriptWrappedValue_="";this.SAFE_SCRIPT_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_=goog.html.SafeScript.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_};goog.html.SafeScript.prototype.implementsGoogStringTypedString=!0;goog.html.SafeScript.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_={};goog.html.SafeScript.fromConstant=function(a){a=goog.string.Const.unwrap(a);return 0===a.length?goog.html.SafeScript.EMPTY:goog.html.SafeScript.createSafeScriptSecurityPrivateDoNotAccessOrElse(a)};
|
||||
@@ -259,13 +256,12 @@ goog.i18n.bidi.normalizeHebrewQuote=function(a){return a.replace(goog.i18n.bidi.
|
||||
goog.i18n.bidi.estimateDirection=function(a,b){var c=0,d=0,e=!1;a=goog.i18n.bidi.stripHtmlIfNeeded_(a,b).split(goog.i18n.bidi.wordSeparatorRe_);for(b=0;b<a.length;b++){var f=a[b];goog.i18n.bidi.startsWithRtl(f)?(c++,d++):goog.i18n.bidi.isRequiredLtrRe_.test(f)?e=!0:goog.i18n.bidi.hasAnyLtr(f)?d++:goog.i18n.bidi.hasNumeralsRe_.test(f)&&(e=!0)}return 0==d?e?goog.i18n.bidi.Dir.LTR:goog.i18n.bidi.Dir.NEUTRAL:c/d>goog.i18n.bidi.rtlDetectionThreshold_?goog.i18n.bidi.Dir.RTL:goog.i18n.bidi.Dir.LTR};
|
||||
goog.i18n.bidi.detectRtlDirectionality=function(a,b){return goog.i18n.bidi.estimateDirection(a,b)==goog.i18n.bidi.Dir.RTL};goog.i18n.bidi.setElementDirAndAlign=function(a,b){a&&(b=goog.i18n.bidi.toDir(b))&&(a.style.textAlign=b==goog.i18n.bidi.Dir.RTL?goog.i18n.bidi.RIGHT:goog.i18n.bidi.LEFT,a.dir=b==goog.i18n.bidi.Dir.RTL?"rtl":"ltr")};
|
||||
goog.i18n.bidi.setElementDirByTextDirectionality=function(a,b){switch(goog.i18n.bidi.estimateDirection(b)){case goog.i18n.bidi.Dir.LTR:a.dir="ltr";break;case goog.i18n.bidi.Dir.RTL:a.dir="rtl";break;default:a.removeAttribute("dir")}};goog.i18n.bidi.DirectionalString=function(){};goog.html.TrustedResourceUrl=function(){this.privateDoNotAccessOrElseTrustedResourceUrlWrappedValue_="";this.TRUSTED_RESOURCE_URL_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_=goog.html.TrustedResourceUrl.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_};goog.html.TrustedResourceUrl.prototype.implementsGoogStringTypedString=!0;goog.html.TrustedResourceUrl.prototype.getTypedStringValue=function(){return this.privateDoNotAccessOrElseTrustedResourceUrlWrappedValue_};
|
||||
goog.html.TrustedResourceUrl.prototype.implementsGoogI18nBidiDirectionalString=!0;goog.html.TrustedResourceUrl.prototype.getDirection=function(){return goog.i18n.bidi.Dir.LTR};goog.DEBUG&&(goog.html.TrustedResourceUrl.prototype.toString=function(){return"TrustedResourceUrl{"+this.privateDoNotAccessOrElseTrustedResourceUrlWrappedValue_+"}"});
|
||||
goog.html.TrustedResourceUrl.prototype.implementsGoogI18nBidiDirectionalString=!0;goog.html.TrustedResourceUrl.prototype.getDirection=function(){return goog.i18n.bidi.Dir.LTR};goog.html.TrustedResourceUrl.prototype.cloneWithParams=function(a){var b=goog.html.TrustedResourceUrl.unwrap(this),c=/\?/.test(b)?"&":"?",d;for(d in a)for(var e=goog.isArray(a[d])?a[d]:[a[d]],f=0;f<e.length;f++)null!=e[f]&&(b+=c+encodeURIComponent(d)+"="+encodeURIComponent(String(e[f])),c="&");return goog.html.TrustedResourceUrl.createTrustedResourceUrlSecurityPrivateDoNotAccessOrElse(b)};
|
||||
goog.DEBUG&&(goog.html.TrustedResourceUrl.prototype.toString=function(){return"TrustedResourceUrl{"+this.privateDoNotAccessOrElseTrustedResourceUrlWrappedValue_+"}"});
|
||||
goog.html.TrustedResourceUrl.unwrap=function(a){if(a instanceof goog.html.TrustedResourceUrl&&a.constructor===goog.html.TrustedResourceUrl&&a.TRUSTED_RESOURCE_URL_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_===goog.html.TrustedResourceUrl.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_)return a.privateDoNotAccessOrElseTrustedResourceUrlWrappedValue_;goog.asserts.fail("expected object of type TrustedResourceUrl, got '"+a+"' of type "+goog.typeOf(a));return"type_error:TrustedResourceUrl"};
|
||||
goog.html.TrustedResourceUrl.format=function(a,b){a=goog.html.TrustedResourceUrl.format_(a,b);return goog.html.TrustedResourceUrl.createTrustedResourceUrlSecurityPrivateDoNotAccessOrElse(a)};
|
||||
goog.html.TrustedResourceUrl.format_=function(a,b){var c=goog.string.Const.unwrap(a);if(!goog.html.TrustedResourceUrl.BASE_URL_.test(c))throw Error("Invalid TrustedResourceUrl format: "+c);return c.replace(goog.html.TrustedResourceUrl.FORMAT_MARKER_,function(a,e){if(!Object.prototype.hasOwnProperty.call(b,e))throw Error('Found marker, "'+e+'", in format string, "'+c+'", but no valid label mapping found in args: '+JSON.stringify(b));a=b[e];return a instanceof goog.string.Const?goog.string.Const.unwrap(a):
|
||||
encodeURIComponent(String(a))})};goog.html.TrustedResourceUrl.FORMAT_MARKER_=/%{(\w+)}/g;goog.html.TrustedResourceUrl.BASE_URL_=/^(?:https:)?\/\/[0-9a-z.:[\]-]+\/|^\/[^\/\\]|^about:blank(#|$)/i;goog.html.TrustedResourceUrl.formatWithParams=function(a,b,c){a=goog.html.TrustedResourceUrl.format_(a,b);b=/\?/.test(a)?"&":"?";for(var d in c)for(var e=goog.isArray(c[d])?c[d]:[c[d]],f=0;f<e.length;f++)null!=e[f]&&(a+=b+encodeURIComponent(d)+"="+encodeURIComponent(String(e[f])),b="&");return goog.html.TrustedResourceUrl.createTrustedResourceUrlSecurityPrivateDoNotAccessOrElse(a)};
|
||||
goog.html.TrustedResourceUrl.fromConstant=function(a){return goog.html.TrustedResourceUrl.createTrustedResourceUrlSecurityPrivateDoNotAccessOrElse(goog.string.Const.unwrap(a))};goog.html.TrustedResourceUrl.fromConstants=function(a){for(var b="",c=0;c<a.length;c++)b+=goog.string.Const.unwrap(a[c]);return goog.html.TrustedResourceUrl.createTrustedResourceUrlSecurityPrivateDoNotAccessOrElse(b)};goog.html.TrustedResourceUrl.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_={};
|
||||
goog.html.TrustedResourceUrl.createTrustedResourceUrlSecurityPrivateDoNotAccessOrElse=function(a){var b=new goog.html.TrustedResourceUrl;b.privateDoNotAccessOrElseTrustedResourceUrlWrappedValue_=a;return b};goog.html.SafeUrl=function(){this.privateDoNotAccessOrElseSafeHtmlWrappedValue_="";this.SAFE_URL_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_=goog.html.SafeUrl.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_};goog.html.SafeUrl.INNOCUOUS_STRING="about:invalid#zClosurez";goog.html.SafeUrl.prototype.implementsGoogStringTypedString=!0;goog.html.SafeUrl.prototype.getTypedStringValue=function(){return this.privateDoNotAccessOrElseSafeHtmlWrappedValue_};
|
||||
goog.html.TrustedResourceUrl.format=function(a,b){var c=goog.string.Const.unwrap(a);if(!goog.html.TrustedResourceUrl.BASE_URL_.test(c))throw Error("Invalid TrustedResourceUrl format: "+c);a=c.replace(goog.html.TrustedResourceUrl.FORMAT_MARKER_,function(a,e){if(!Object.prototype.hasOwnProperty.call(b,e))throw Error('Found marker, "'+e+'", in format string, "'+c+'", but no valid label mapping found in args: '+JSON.stringify(b));a=b[e];return a instanceof goog.string.Const?goog.string.Const.unwrap(a):
|
||||
encodeURIComponent(String(a))});return goog.html.TrustedResourceUrl.createTrustedResourceUrlSecurityPrivateDoNotAccessOrElse(a)};goog.html.TrustedResourceUrl.FORMAT_MARKER_=/%{(\w+)}/g;goog.html.TrustedResourceUrl.BASE_URL_=/^(?:https:)?\/\/[0-9a-z.:[\]-]+\/|^\/[^\/\\]|^about:blank(#|$)/i;goog.html.TrustedResourceUrl.formatWithParams=function(a,b,c){return goog.html.TrustedResourceUrl.format(a,b).cloneWithParams(c)};goog.html.TrustedResourceUrl.fromConstant=function(a){return goog.html.TrustedResourceUrl.createTrustedResourceUrlSecurityPrivateDoNotAccessOrElse(goog.string.Const.unwrap(a))};
|
||||
goog.html.TrustedResourceUrl.fromConstants=function(a){for(var b="",c=0;c<a.length;c++)b+=goog.string.Const.unwrap(a[c]);return goog.html.TrustedResourceUrl.createTrustedResourceUrlSecurityPrivateDoNotAccessOrElse(b)};goog.html.TrustedResourceUrl.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_={};goog.html.TrustedResourceUrl.createTrustedResourceUrlSecurityPrivateDoNotAccessOrElse=function(a){var b=new goog.html.TrustedResourceUrl;b.privateDoNotAccessOrElseTrustedResourceUrlWrappedValue_=a;return b};goog.html.SafeUrl=function(){this.privateDoNotAccessOrElseSafeHtmlWrappedValue_="";this.SAFE_URL_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_=goog.html.SafeUrl.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_};goog.html.SafeUrl.INNOCUOUS_STRING="about:invalid#zClosurez";goog.html.SafeUrl.prototype.implementsGoogStringTypedString=!0;goog.html.SafeUrl.prototype.getTypedStringValue=function(){return this.privateDoNotAccessOrElseSafeHtmlWrappedValue_};
|
||||
goog.html.SafeUrl.prototype.implementsGoogI18nBidiDirectionalString=!0;goog.html.SafeUrl.prototype.getDirection=function(){return goog.i18n.bidi.Dir.LTR};goog.DEBUG&&(goog.html.SafeUrl.prototype.toString=function(){return"SafeUrl{"+this.privateDoNotAccessOrElseSafeHtmlWrappedValue_+"}"});
|
||||
goog.html.SafeUrl.unwrap=function(a){if(a instanceof goog.html.SafeUrl&&a.constructor===goog.html.SafeUrl&&a.SAFE_URL_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_===goog.html.SafeUrl.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_)return a.privateDoNotAccessOrElseSafeHtmlWrappedValue_;goog.asserts.fail("expected object of type SafeUrl, got '"+a+"' of type "+goog.typeOf(a));return"type_error:SafeUrl"};goog.html.SafeUrl.fromConstant=function(a){return goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(goog.string.Const.unwrap(a))};
|
||||
goog.html.SAFE_MIME_TYPE_PATTERN_=/^(?:audio\/(?:3gpp|3gpp2|aac|midi|mp4|mpeg|ogg|x-m4a|x-wav|webm)|image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|text\/csv|video\/(?:mpeg|mp4|ogg|webm))$/i;goog.html.SafeUrl.fromBlob=function(a){a=goog.html.SAFE_MIME_TYPE_PATTERN_.test(a.type)?goog.fs.url.createObjectUrl(a):goog.html.SafeUrl.INNOCUOUS_STRING;return goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(a)};goog.html.DATA_URL_PATTERN_=/^data:([^;,]*);base64,[a-z0-9+\/]+=*$/i;
|
||||
@@ -311,12 +307,15 @@ goog.html.SafeHtml.createSafeHtmlTagSecurityPrivateDoNotAccessOrElse=function(a,
|
||||
null);return goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse(e,d)};goog.html.SafeHtml.stringifyAttributes=function(a,b){var c="";if(b)for(var d in b){if(!goog.html.SafeHtml.VALID_NAMES_IN_TAG_.test(d))throw Error('Invalid attribute name "'+d+'".');var e=b[d];goog.isDefAndNotNull(e)&&(c+=" "+goog.html.SafeHtml.getAttrNameAndValue_(a,d,e))}return c};
|
||||
goog.html.SafeHtml.combineAttributes=function(a,b,c){var d={},e;for(e in a)goog.asserts.assert(e.toLowerCase()==e,"Must be lower case"),d[e]=a[e];for(e in b)goog.asserts.assert(e.toLowerCase()==e,"Must be lower case"),d[e]=b[e];for(e in c){var f=e.toLowerCase();if(f in a)throw Error('Cannot override "'+f+'" attribute, got "'+e+'" with value "'+c[e]+'"');f in b&&delete d[f];d[e]=c[e]}return d};
|
||||
goog.html.SafeHtml.DOCTYPE_HTML=goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse("<!DOCTYPE html>",goog.i18n.bidi.Dir.NEUTRAL);goog.html.SafeHtml.EMPTY=goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse("",goog.i18n.bidi.Dir.NEUTRAL);goog.html.SafeHtml.BR=goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse("<br>",goog.i18n.bidi.Dir.NEUTRAL);goog.dom.safe={};goog.dom.safe.InsertAdjacentHtmlPosition={AFTERBEGIN:"afterbegin",AFTEREND:"afterend",BEFOREBEGIN:"beforebegin",BEFOREEND:"beforeend"};goog.dom.safe.insertAdjacentHtml=function(a,b,c){a.insertAdjacentHTML(b,goog.html.SafeHtml.unwrap(c))};goog.dom.safe.SET_INNER_HTML_DISALLOWED_TAGS_={MATH:!0,SCRIPT:!0,STYLE:!0,SVG:!0,TEMPLATE:!0};
|
||||
goog.dom.safe.setInnerHtml=function(a,b){if(goog.asserts.ENABLE_ASSERTS){var c=a.tagName.toUpperCase();if(goog.dom.safe.SET_INNER_HTML_DISALLOWED_TAGS_[c])throw Error("goog.dom.safe.setInnerHtml cannot be used to set content of "+a.tagName+".");}a.innerHTML=goog.html.SafeHtml.unwrap(b)};goog.dom.safe.setOuterHtml=function(a,b){a.outerHTML=goog.html.SafeHtml.unwrap(b)};goog.dom.safe.setStyle=function(a,b){a.style.cssText=goog.html.SafeStyle.unwrap(b)};goog.dom.safe.documentWrite=function(a,b){a.write(goog.html.SafeHtml.unwrap(b))};
|
||||
goog.dom.safe.setInnerHtml=function(a,b){if(goog.asserts.ENABLE_ASSERTS){var c=a.tagName.toUpperCase();if(goog.dom.safe.SET_INNER_HTML_DISALLOWED_TAGS_[c])throw Error("goog.dom.safe.setInnerHtml cannot be used to set content of "+a.tagName+".");}a.innerHTML=goog.html.SafeHtml.unwrap(b)};goog.dom.safe.setOuterHtml=function(a,b){a.outerHTML=goog.html.SafeHtml.unwrap(b)};
|
||||
goog.dom.safe.setFormElementAction=function(a,b){b=b instanceof goog.html.SafeUrl?b:goog.html.SafeUrl.sanitizeAssertUnchanged(b);goog.dom.asserts.assertIsHTMLFormElement(a).action=goog.html.SafeUrl.unwrap(b)};goog.dom.safe.setButtonFormAction=function(a,b){b=b instanceof goog.html.SafeUrl?b:goog.html.SafeUrl.sanitizeAssertUnchanged(b);goog.dom.asserts.assertIsHTMLButtonElement(a).formaction=goog.html.SafeUrl.unwrap(b)};
|
||||
goog.dom.safe.setInputFormAction=function(a,b){b=b instanceof goog.html.SafeUrl?b:goog.html.SafeUrl.sanitizeAssertUnchanged(b);goog.dom.asserts.assertIsHTMLInputElement(a).formaction=goog.html.SafeUrl.unwrap(b)};goog.dom.safe.setStyle=function(a,b){a.style.cssText=goog.html.SafeStyle.unwrap(b)};goog.dom.safe.documentWrite=function(a,b){a.write(goog.html.SafeHtml.unwrap(b))};
|
||||
goog.dom.safe.setAnchorHref=function(a,b){goog.dom.asserts.assertIsHTMLAnchorElement(a);b=b instanceof goog.html.SafeUrl?b:goog.html.SafeUrl.sanitizeAssertUnchanged(b);a.href=goog.html.SafeUrl.unwrap(b)};goog.dom.safe.setImageSrc=function(a,b){goog.dom.asserts.assertIsHTMLImageElement(a);b=b instanceof goog.html.SafeUrl?b:goog.html.SafeUrl.sanitizeAssertUnchanged(b);a.src=goog.html.SafeUrl.unwrap(b)};goog.dom.safe.setEmbedSrc=function(a,b){goog.dom.asserts.assertIsHTMLEmbedElement(a);a.src=goog.html.TrustedResourceUrl.unwrap(b)};
|
||||
goog.dom.safe.setFrameSrc=function(a,b){goog.dom.asserts.assertIsHTMLFrameElement(a);a.src=goog.html.TrustedResourceUrl.unwrap(b)};goog.dom.safe.setIframeSrc=function(a,b){goog.dom.asserts.assertIsHTMLIFrameElement(a);a.src=goog.html.TrustedResourceUrl.unwrap(b)};goog.dom.safe.setIframeSrcdoc=function(a,b){goog.dom.asserts.assertIsHTMLIFrameElement(a);a.srcdoc=goog.html.SafeHtml.unwrap(b)};
|
||||
goog.dom.safe.setLinkHrefAndRel=function(a,b,c){goog.dom.asserts.assertIsHTMLLinkElement(a);a.rel=c;goog.string.caseInsensitiveContains(c,"stylesheet")?(goog.asserts.assert(b instanceof goog.html.TrustedResourceUrl,'URL must be TrustedResourceUrl because "rel" contains "stylesheet"'),a.href=goog.html.TrustedResourceUrl.unwrap(b)):a.href=b instanceof goog.html.TrustedResourceUrl?goog.html.TrustedResourceUrl.unwrap(b):b instanceof goog.html.SafeUrl?goog.html.SafeUrl.unwrap(b):goog.html.SafeUrl.sanitizeAssertUnchanged(b).getTypedStringValue()};
|
||||
goog.dom.safe.setObjectData=function(a,b){goog.dom.asserts.assertIsHTMLObjectElement(a);a.data=goog.html.TrustedResourceUrl.unwrap(b)};goog.dom.safe.setScriptSrc=function(a,b){goog.dom.asserts.assertIsHTMLScriptElement(a);a.src=goog.html.TrustedResourceUrl.unwrap(b)};goog.dom.safe.setScriptContent=function(a,b){goog.dom.asserts.assertIsHTMLScriptElement(a);a.text=goog.html.SafeScript.unwrap(b)};
|
||||
goog.dom.safe.setLocationHref=function(a,b){goog.dom.asserts.assertIsLocation(a);b=b instanceof goog.html.SafeUrl?b:goog.html.SafeUrl.sanitizeAssertUnchanged(b);a.href=goog.html.SafeUrl.unwrap(b)};goog.dom.safe.openInWindow=function(a,b,c,d,e){a=a instanceof goog.html.SafeUrl?a:goog.html.SafeUrl.sanitizeAssertUnchanged(a);return(b||window).open(goog.html.SafeUrl.unwrap(a),c?goog.string.Const.unwrap(c):"",d,e)};goog.html.uncheckedconversions={};goog.html.uncheckedconversions.safeHtmlFromStringKnownToSatisfyTypeContract=function(a,b,c){goog.asserts.assertString(goog.string.Const.unwrap(a),"must provide justification");goog.asserts.assert(!goog.string.isEmptyOrWhitespace(goog.string.Const.unwrap(a)),"must provide non-empty justification");return goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse(b,c||null)};
|
||||
goog.dom.safe.setLocationHref=function(a,b){goog.dom.asserts.assertIsLocation(a);b=b instanceof goog.html.SafeUrl?b:goog.html.SafeUrl.sanitizeAssertUnchanged(b);a.href=goog.html.SafeUrl.unwrap(b)};goog.dom.safe.replaceLocation=function(a,b){goog.dom.asserts.assertIsLocation(a);b=b instanceof goog.html.SafeUrl?b:goog.html.SafeUrl.sanitizeAssertUnchanged(b);a.replace(goog.html.SafeUrl.unwrap(b))};
|
||||
goog.dom.safe.openInWindow=function(a,b,c,d,e){a=a instanceof goog.html.SafeUrl?a:goog.html.SafeUrl.sanitizeAssertUnchanged(a);return(b||window).open(goog.html.SafeUrl.unwrap(a),c?goog.string.Const.unwrap(c):"",d,e)};goog.html.uncheckedconversions={};goog.html.uncheckedconversions.safeHtmlFromStringKnownToSatisfyTypeContract=function(a,b,c){goog.asserts.assertString(goog.string.Const.unwrap(a),"must provide justification");goog.asserts.assert(!goog.string.isEmptyOrWhitespace(goog.string.Const.unwrap(a)),"must provide non-empty justification");return goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse(b,c||null)};
|
||||
goog.html.uncheckedconversions.safeScriptFromStringKnownToSatisfyTypeContract=function(a,b){goog.asserts.assertString(goog.string.Const.unwrap(a),"must provide justification");goog.asserts.assert(!goog.string.isEmptyOrWhitespace(goog.string.Const.unwrap(a)),"must provide non-empty justification");return goog.html.SafeScript.createSafeScriptSecurityPrivateDoNotAccessOrElse(b)};
|
||||
goog.html.uncheckedconversions.safeStyleFromStringKnownToSatisfyTypeContract=function(a,b){goog.asserts.assertString(goog.string.Const.unwrap(a),"must provide justification");goog.asserts.assert(!goog.string.isEmptyOrWhitespace(goog.string.Const.unwrap(a)),"must provide non-empty justification");return goog.html.SafeStyle.createSafeStyleSecurityPrivateDoNotAccessOrElse(b)};
|
||||
goog.html.uncheckedconversions.safeStyleSheetFromStringKnownToSatisfyTypeContract=function(a,b){goog.asserts.assertString(goog.string.Const.unwrap(a),"must provide justification");goog.asserts.assert(!goog.string.isEmptyOrWhitespace(goog.string.Const.unwrap(a)),"must provide non-empty justification");return goog.html.SafeStyleSheet.createSafeStyleSheetSecurityPrivateDoNotAccessOrElse(b)};
|
||||
@@ -428,7 +427,7 @@ goog.style.getBounds=function(a){var b=goog.style.getPageOffset(a);a=goog.style.
|
||||
goog.style.getOpacity=function(a){goog.asserts.assert(a);var b=a.style;a="";"opacity"in b?a=b.opacity:"MozOpacity"in b?a=b.MozOpacity:"filter"in b&&(b=b.filter.match(/alpha\(opacity=([\d.]+)\)/))&&(a=String(b[1]/100));return""==a?a:Number(a)};goog.style.setOpacity=function(a,b){goog.asserts.assert(a);a=a.style;"opacity"in a?a.opacity=b:"MozOpacity"in a?a.MozOpacity=b:"filter"in a&&(a.filter=""===b?"":"alpha(opacity="+100*Number(b)+")")};
|
||||
goog.style.setTransparentBackgroundImage=function(a,b){a=a.style;goog.userAgent.IE&&!goog.userAgent.isVersionOrHigher("8")?a.filter='progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'+b+'", sizingMethod="crop")':(a.backgroundImage="url("+b+")",a.backgroundPosition="top left",a.backgroundRepeat="no-repeat")};goog.style.clearTransparentBackgroundImage=function(a){a=a.style;"filter"in a?a.filter="":a.backgroundImage="none"};goog.style.showElement=function(a,b){goog.style.setElementShown(a,b)};
|
||||
goog.style.setElementShown=function(a,b){a.style.display=b?"":"none"};goog.style.isElementShown=function(a){return"none"!=a.style.display};
|
||||
goog.style.installSafeStyleSheet=function(a,b){b=goog.dom.getDomHelper(b);var c=b.getDocument();if(goog.userAgent.IE&&c.createStyleSheet){var d=c.createStyleSheet();goog.style.setSafeStyleSheet(d,a)}else c=b.getElementsByTagNameAndClass("HEAD")[0],c||(d=b.getElementsByTagNameAndClass("BODY")[0],c=b.createDom("HEAD"),d.parentNode.insertBefore(c,d)),d=b.createDom("STYLE"),goog.style.setSafeStyleSheet(d,a),b.appendChild(c,d);return d};
|
||||
goog.style.installSafeStyleSheet=function(a,b){b=goog.dom.getDomHelper(b);var c=b.getDocument();if(goog.userAgent.IE&&c.createStyleSheet)return b=c.createStyleSheet(),goog.style.setSafeStyleSheet(b,a),b;c=b.getElementsByTagNameAndClass("HEAD")[0];if(!c){var d=b.getElementsByTagNameAndClass("BODY")[0];c=b.createDom("HEAD");d.parentNode.insertBefore(c,d)}d=b.createDom("STYLE");goog.style.setSafeStyleSheet(d,a);b.appendChild(c,d);return d};
|
||||
goog.style.uninstallStyles=function(a){goog.dom.removeNode(a.ownerNode||a.owningElement||a)};goog.style.setSafeStyleSheet=function(a,b){b=goog.html.SafeStyleSheet.unwrap(b);goog.userAgent.IE&&goog.isDef(a.cssText)?a.cssText=b:a.innerHTML=b};goog.style.setPreWrap=function(a){a=a.style;goog.userAgent.IE&&!goog.userAgent.isVersionOrHigher("8")?(a.whiteSpace="pre",a.wordWrap="break-word"):a.whiteSpace=goog.userAgent.GECKO?"-moz-pre-wrap":"pre-wrap"};
|
||||
goog.style.setInlineBlock=function(a){a=a.style;a.position="relative";goog.userAgent.IE&&!goog.userAgent.isVersionOrHigher("8")?(a.zoom="1",a.display="inline"):a.display="inline-block"};goog.style.isRightToLeft=function(a){return"rtl"==goog.style.getStyle_(a,"direction")};goog.style.unselectableStyle_=goog.userAgent.GECKO?"MozUserSelect":goog.userAgent.WEBKIT||goog.userAgent.EDGE?"WebkitUserSelect":null;
|
||||
goog.style.isUnselectable=function(a){return goog.style.unselectableStyle_?"none"==a.style[goog.style.unselectableStyle_].toLowerCase():goog.userAgent.IE||goog.userAgent.OPERA?"on"==a.getAttribute("unselectable"):!1};
|
||||
@@ -445,7 +444,7 @@ goog.style.getBorderBox=function(a){if(goog.userAgent.IE&&!goog.userAgent.isDocu
|
||||
"borderBottomWidth");return new goog.math.Box(parseFloat(d),parseFloat(c),parseFloat(a),parseFloat(b))};goog.style.getFontFamily=function(a){var b=goog.dom.getOwnerDocument(a),c="";if(b.body.createTextRange&&goog.dom.contains(b,a)){b=b.body.createTextRange();b.moveToElementText(a);try{c=b.queryCommandValue("FontName")}catch(d){c=""}}c||(c=goog.style.getStyle_(a,"fontFamily"));a=c.split(",");1<a.length&&(c=a[0]);return goog.string.stripQuotes(c,"\"'")};goog.style.lengthUnitRegex_=/[^\d]+$/;
|
||||
goog.style.getLengthUnits=function(a){return(a=a.match(goog.style.lengthUnitRegex_))&&a[0]||null};goog.style.ABSOLUTE_CSS_LENGTH_UNITS_={cm:1,"in":1,mm:1,pc:1,pt:1};goog.style.CONVERTIBLE_RELATIVE_CSS_UNITS_={em:1,ex:1};
|
||||
goog.style.getFontSize=function(a){var b=goog.style.getStyle_(a,"fontSize"),c=goog.style.getLengthUnits(b);if(b&&"px"==c)return parseInt(b,10);if(goog.userAgent.IE){if(String(c)in goog.style.ABSOLUTE_CSS_LENGTH_UNITS_)return goog.style.getIePixelValue_(a,b,"left","pixelLeft");if(a.parentNode&&a.parentNode.nodeType==goog.dom.NodeType.ELEMENT&&String(c)in goog.style.CONVERTIBLE_RELATIVE_CSS_UNITS_)return a=a.parentNode,c=goog.style.getStyle_(a,"fontSize"),goog.style.getIePixelValue_(a,b==c?"1em":b,
|
||||
"left","pixelLeft")}c=goog.dom.createDom("SPAN",{style:"visibility:hidden;position:absolute;line-height:0;padding:0;margin:0;border:0;height:1em;"});goog.dom.appendChild(a,c);b=c.offsetHeight;goog.dom.removeNode(c);return b};goog.style.parseStyleAttribute=function(a){var b={};goog.array.forEach(a.split(/\s*;\s*/),function(a){var c=a.match(/\s*([\w-]+)\s*\:(.+)/);c&&(a=c[1],c=goog.string.trim(c[2]),b[goog.string.toCamelCase(a.toLowerCase())]=c)});return b};
|
||||
"left","pixelLeft")}c=goog.dom.createDom("SPAN",{style:"visibility:hidden;position:absolute;line-height:0;padding:0;margin:0;border:0;height:1em;"});goog.dom.appendChild(a,c);b=c.offsetHeight;goog.dom.removeNode(c);return b};goog.style.parseStyleAttribute=function(a){var b={};goog.array.forEach(a.split(/\s*;\s*/),function(a){var c=a.match(/\s*([\w-]+)\s*:(.+)/);c&&(a=c[1],c=goog.string.trim(c[2]),b[goog.string.toCamelCase(a.toLowerCase())]=c)});return b};
|
||||
goog.style.toStyleAttribute=function(a){var b=[];goog.object.forEach(a,function(a,d){b.push(goog.string.toSelectorCase(d),":",a,";")});return b.join("")};goog.style.setFloat=function(a,b){a.style[goog.userAgent.IE?"styleFloat":"cssFloat"]=b};goog.style.getFloat=function(a){return a.style[goog.userAgent.IE?"styleFloat":"cssFloat"]||""};
|
||||
goog.style.getScrollbarWidth=function(a){var b=goog.dom.createElement("DIV");a&&(b.className=a);b.style.cssText="overflow:auto;position:absolute;top:0;width:100px;height:100px";a=goog.dom.createElement("DIV");goog.style.setSize(a,"200px","200px");b.appendChild(a);goog.dom.appendChild(goog.dom.getDocument().body,b);a=b.offsetWidth-b.clientWidth;goog.dom.removeNode(b);return a};goog.style.MATRIX_TRANSLATION_REGEX_=/matrix\([0-9\.\-]+, [0-9\.\-]+, [0-9\.\-]+, [0-9\.\-]+, ([0-9\.\-]+)p?x?, ([0-9\.\-]+)p?x?\)/;
|
||||
goog.style.getCssTranslation=function(a){a=goog.style.getComputedTransform(a);return a?(a=a.match(goog.style.MATRIX_TRANSLATION_REGEX_))?new goog.math.Coordinate(parseFloat(a[1]),parseFloat(a[2])):new goog.math.Coordinate(0,0):new goog.math.Coordinate(0,0)};goog.Thenable=function(){};goog.Thenable.prototype.then=function(a,b,c){};goog.Thenable.IMPLEMENTED_BY_PROP="$goog_Thenable";goog.Thenable.addImplementation=function(a){a.prototype.then=a.prototype.then;COMPILED?a.prototype[goog.Thenable.IMPLEMENTED_BY_PROP]=!0:a.prototype.$goog_Thenable=!0};goog.Thenable.isImplementedBy=function(a){if(!a)return!1;try{return COMPILED?!!a[goog.Thenable.IMPLEMENTED_BY_PROP]:!!a.$goog_Thenable}catch(b){return!1}};goog.async={};goog.async.FreeList=function(a,b,c){this.limit_=c;this.create_=a;this.reset_=b;this.occupants_=0;this.head_=null};goog.async.FreeList.prototype.get=function(){if(0<this.occupants_){this.occupants_--;var a=this.head_;this.head_=a.next;a.next=null}else a=this.create_();return a};goog.async.FreeList.prototype.put=function(a){this.reset_(a);this.occupants_<this.limit_&&(this.occupants_++,a.next=this.head_,this.head_=a)};goog.async.FreeList.prototype.occupants=function(){return this.occupants_};goog.async.WorkQueue=function(){this.workTail_=this.workHead_=null};goog.async.WorkQueue.DEFAULT_MAX_UNUSED=100;goog.async.WorkQueue.freelist_=new goog.async.FreeList(function(){return new goog.async.WorkItem},function(a){a.reset()},goog.async.WorkQueue.DEFAULT_MAX_UNUSED);goog.async.WorkQueue.prototype.add=function(a,b){var c=this.getUnusedItem_();c.set(a,b);this.workTail_?this.workTail_.next=c:(goog.asserts.assert(!this.workHead_),this.workHead_=c);this.workTail_=c};
|
||||
@@ -790,13 +789,13 @@ goog.debug.LogRecord.prototype.reset=function(a,b,c,d,e){goog.debug.LogRecord.EN
|
||||
goog.debug.LogRecord.prototype.setException=function(a){this.exception_=a};goog.debug.LogRecord.prototype.setLoggerName=function(a){this.loggerName_=a};goog.debug.LogRecord.prototype.getLevel=function(){return this.level_};goog.debug.LogRecord.prototype.setLevel=function(a){this.level_=a};goog.debug.LogRecord.prototype.getMessage=function(){return this.msg_};goog.debug.LogRecord.prototype.setMessage=function(a){this.msg_=a};goog.debug.LogRecord.prototype.getMillis=function(){return this.time_};
|
||||
goog.debug.LogRecord.prototype.setMillis=function(a){this.time_=a};goog.debug.LogRecord.prototype.getSequenceNumber=function(){return this.sequenceNumber_};goog.debug.LogBuffer=function(){goog.asserts.assert(goog.debug.LogBuffer.isBufferingEnabled(),"Cannot use goog.debug.LogBuffer without defining goog.debug.LogBuffer.CAPACITY.");this.clear()};goog.debug.LogBuffer.getInstance=function(){goog.debug.LogBuffer.instance_||(goog.debug.LogBuffer.instance_=new goog.debug.LogBuffer);return goog.debug.LogBuffer.instance_};goog.debug.LogBuffer.CAPACITY=0;
|
||||
goog.debug.LogBuffer.prototype.addRecord=function(a,b,c){var d=(this.curIndex_+1)%goog.debug.LogBuffer.CAPACITY;this.curIndex_=d;if(this.isFull_)return d=this.buffer_[d],d.reset(a,b,c),d;this.isFull_=d==goog.debug.LogBuffer.CAPACITY-1;return this.buffer_[d]=new goog.debug.LogRecord(a,b,c)};goog.debug.LogBuffer.isBufferingEnabled=function(){return 0<goog.debug.LogBuffer.CAPACITY};
|
||||
goog.debug.LogBuffer.prototype.clear=function(){this.buffer_=Array(goog.debug.LogBuffer.CAPACITY);this.curIndex_=-1;this.isFull_=!1};goog.debug.LogBuffer.prototype.forEachRecord=function(a){var b=this.buffer_;if(b[0]){var c=this.curIndex_,d=this.isFull_?c:-1;do d=(d+1)%goog.debug.LogBuffer.CAPACITY,a(b[d]);while(d!=c)}};goog.debug.Logger=function(a){this.name_=a;this.handlers_=this.children_=this.level_=this.parent_=null};goog.debug.Logger.ROOT_LOGGER_NAME="";goog.debug.Logger.ENABLE_HIERARCHY=!0;goog.debug.Logger.ENABLE_HIERARCHY||(goog.debug.Logger.rootHandlers_=[]);goog.debug.Logger.Level=function(a,b){this.name=a;this.value=b};goog.debug.Logger.Level.prototype.toString=function(){return this.name};goog.debug.Logger.Level.OFF=new goog.debug.Logger.Level("OFF",Infinity);
|
||||
goog.debug.LogBuffer.prototype.clear=function(){this.buffer_=Array(goog.debug.LogBuffer.CAPACITY);this.curIndex_=-1;this.isFull_=!1};goog.debug.LogBuffer.prototype.forEachRecord=function(a){var b=this.buffer_;if(b[0]){var c=this.curIndex_,d=this.isFull_?c:-1;do d=(d+1)%goog.debug.LogBuffer.CAPACITY,a(b[d]);while(d!=c)}};goog.debug.Logger=function(a){this.name_=a;this.handlers_=this.children_=this.level_=this.parent_=null};goog.debug.Logger.ROOT_LOGGER_NAME="";goog.debug.Logger.ENABLE_HIERARCHY=!0;goog.debug.Logger.ENABLE_PROFILER_LOGGING=!1;goog.debug.Logger.ENABLE_HIERARCHY||(goog.debug.Logger.rootHandlers_=[]);goog.debug.Logger.Level=function(a,b){this.name=a;this.value=b};goog.debug.Logger.Level.prototype.toString=function(){return this.name};goog.debug.Logger.Level.OFF=new goog.debug.Logger.Level("OFF",Infinity);
|
||||
goog.debug.Logger.Level.SHOUT=new goog.debug.Logger.Level("SHOUT",1200);goog.debug.Logger.Level.SEVERE=new goog.debug.Logger.Level("SEVERE",1E3);goog.debug.Logger.Level.WARNING=new goog.debug.Logger.Level("WARNING",900);goog.debug.Logger.Level.INFO=new goog.debug.Logger.Level("INFO",800);goog.debug.Logger.Level.CONFIG=new goog.debug.Logger.Level("CONFIG",700);goog.debug.Logger.Level.FINE=new goog.debug.Logger.Level("FINE",500);goog.debug.Logger.Level.FINER=new goog.debug.Logger.Level("FINER",400);
|
||||
goog.debug.Logger.Level.FINEST=new goog.debug.Logger.Level("FINEST",300);goog.debug.Logger.Level.ALL=new goog.debug.Logger.Level("ALL",0);goog.debug.Logger.Level.PREDEFINED_LEVELS=[goog.debug.Logger.Level.OFF,goog.debug.Logger.Level.SHOUT,goog.debug.Logger.Level.SEVERE,goog.debug.Logger.Level.WARNING,goog.debug.Logger.Level.INFO,goog.debug.Logger.Level.CONFIG,goog.debug.Logger.Level.FINE,goog.debug.Logger.Level.FINER,goog.debug.Logger.Level.FINEST,goog.debug.Logger.Level.ALL];
|
||||
goog.debug.Logger.Level.predefinedLevelsCache_=null;goog.debug.Logger.Level.createPredefinedLevelsCache_=function(){goog.debug.Logger.Level.predefinedLevelsCache_={};for(var a=0,b;b=goog.debug.Logger.Level.PREDEFINED_LEVELS[a];a++)goog.debug.Logger.Level.predefinedLevelsCache_[b.value]=b,goog.debug.Logger.Level.predefinedLevelsCache_[b.name]=b};
|
||||
goog.debug.Logger.Level.getPredefinedLevel=function(a){goog.debug.Logger.Level.predefinedLevelsCache_||goog.debug.Logger.Level.createPredefinedLevelsCache_();return goog.debug.Logger.Level.predefinedLevelsCache_[a]||null};
|
||||
goog.debug.Logger.Level.getPredefinedLevelByValue=function(a){goog.debug.Logger.Level.predefinedLevelsCache_||goog.debug.Logger.Level.createPredefinedLevelsCache_();if(a in goog.debug.Logger.Level.predefinedLevelsCache_)return goog.debug.Logger.Level.predefinedLevelsCache_[a];for(var b=0;b<goog.debug.Logger.Level.PREDEFINED_LEVELS.length;++b){var c=goog.debug.Logger.Level.PREDEFINED_LEVELS[b];if(c.value<=a)return c}return null};goog.debug.Logger.getLogger=function(a){return goog.debug.LogManager.getLogger(a)};
|
||||
goog.debug.Logger.logToProfilers=function(a){var b=goog.global.console;b&&b.timeStamp&&b.timeStamp(a);(b=goog.global.msWriteProfilerMark)&&b(a)};goog.debug.Logger.prototype.getName=function(){return this.name_};
|
||||
goog.debug.Logger.logToProfilers=function(a){if(goog.debug.Logger.ENABLE_PROFILER_LOGGING){var b=goog.global.msWriteProfilerMark;b?b(a):(b=goog.global.console)&&b.timeStamp&&b.timeStamp(a)}};goog.debug.Logger.prototype.getName=function(){return this.name_};
|
||||
goog.debug.Logger.prototype.addHandler=function(a){goog.debug.LOGGING_ENABLED&&(goog.debug.Logger.ENABLE_HIERARCHY?(this.handlers_||(this.handlers_=[]),this.handlers_.push(a)):(goog.asserts.assert(!this.name_,"Cannot call addHandler on a non-root logger when goog.debug.Logger.ENABLE_HIERARCHY is false."),goog.debug.Logger.rootHandlers_.push(a)))};
|
||||
goog.debug.Logger.prototype.removeHandler=function(a){if(goog.debug.LOGGING_ENABLED){var b=goog.debug.Logger.ENABLE_HIERARCHY?this.handlers_:goog.debug.Logger.rootHandlers_;return!!b&&goog.array.remove(b,a)}return!1};goog.debug.Logger.prototype.getParent=function(){return this.parent_};goog.debug.Logger.prototype.getChildren=function(){this.children_||(this.children_={});return this.children_};
|
||||
goog.debug.Logger.prototype.setLevel=function(a){goog.debug.LOGGING_ENABLED&&(goog.debug.Logger.ENABLE_HIERARCHY?this.level_=a:(goog.asserts.assert(!this.name_,"Cannot call setLevel() on a non-root logger when goog.debug.Logger.ENABLE_HIERARCHY is false."),goog.debug.Logger.rootLevel_=a))};goog.debug.Logger.prototype.getLevel=function(){return goog.debug.LOGGING_ENABLED?this.level_:goog.debug.Logger.Level.OFF};
|
||||
@@ -804,8 +803,8 @@ goog.debug.Logger.prototype.getEffectiveLevel=function(){if(!goog.debug.LOGGING_
|
||||
goog.debug.Logger.prototype.log=function(a,b,c){goog.debug.LOGGING_ENABLED&&this.isLoggable(a)&&(goog.isFunction(b)&&(b=b()),this.doLogRecord_(this.getLogRecord(a,b,c)))};goog.debug.Logger.prototype.getLogRecord=function(a,b,c){a=goog.debug.LogBuffer.isBufferingEnabled()?goog.debug.LogBuffer.getInstance().addRecord(a,b,this.name_):new goog.debug.LogRecord(a,String(b),this.name_);c&&a.setException(c);return a};
|
||||
goog.debug.Logger.prototype.shout=function(a,b){goog.debug.LOGGING_ENABLED&&this.log(goog.debug.Logger.Level.SHOUT,a,b)};goog.debug.Logger.prototype.severe=function(a,b){goog.debug.LOGGING_ENABLED&&this.log(goog.debug.Logger.Level.SEVERE,a,b)};goog.debug.Logger.prototype.warning=function(a,b){goog.debug.LOGGING_ENABLED&&this.log(goog.debug.Logger.Level.WARNING,a,b)};goog.debug.Logger.prototype.info=function(a,b){goog.debug.LOGGING_ENABLED&&this.log(goog.debug.Logger.Level.INFO,a,b)};
|
||||
goog.debug.Logger.prototype.config=function(a,b){goog.debug.LOGGING_ENABLED&&this.log(goog.debug.Logger.Level.CONFIG,a,b)};goog.debug.Logger.prototype.fine=function(a,b){goog.debug.LOGGING_ENABLED&&this.log(goog.debug.Logger.Level.FINE,a,b)};goog.debug.Logger.prototype.finer=function(a,b){goog.debug.LOGGING_ENABLED&&this.log(goog.debug.Logger.Level.FINER,a,b)};goog.debug.Logger.prototype.finest=function(a,b){goog.debug.LOGGING_ENABLED&&this.log(goog.debug.Logger.Level.FINEST,a,b)};
|
||||
goog.debug.Logger.prototype.logRecord=function(a){goog.debug.LOGGING_ENABLED&&this.isLoggable(a.getLevel())&&this.doLogRecord_(a)};goog.debug.Logger.prototype.doLogRecord_=function(a){goog.debug.Logger.logToProfilers("log:"+a.getMessage());if(goog.debug.Logger.ENABLE_HIERARCHY)for(var b=this;b;)b.callPublish_(a),b=b.getParent();else{b=0;for(var c;c=goog.debug.Logger.rootHandlers_[b++];)c(a)}};goog.debug.Logger.prototype.callPublish_=function(a){if(this.handlers_)for(var b=0,c;c=this.handlers_[b];b++)c(a)};
|
||||
goog.debug.Logger.prototype.setParent_=function(a){this.parent_=a};goog.debug.Logger.prototype.addChild_=function(a,b){this.getChildren()[a]=b};goog.debug.LogManager={};goog.debug.LogManager.loggers_={};goog.debug.LogManager.rootLogger_=null;
|
||||
goog.debug.Logger.prototype.logRecord=function(a){goog.debug.LOGGING_ENABLED&&this.isLoggable(a.getLevel())&&this.doLogRecord_(a)};goog.debug.Logger.prototype.doLogRecord_=function(a){goog.debug.Logger.ENABLE_PROFILER_LOGGING&&goog.debug.Logger.logToProfilers("log:"+a.getMessage());if(goog.debug.Logger.ENABLE_HIERARCHY)for(var b=this;b;)b.callPublish_(a),b=b.getParent();else{b=0;for(var c;c=goog.debug.Logger.rootHandlers_[b++];)c(a)}};
|
||||
goog.debug.Logger.prototype.callPublish_=function(a){if(this.handlers_)for(var b=0,c;c=this.handlers_[b];b++)c(a)};goog.debug.Logger.prototype.setParent_=function(a){this.parent_=a};goog.debug.Logger.prototype.addChild_=function(a,b){this.getChildren()[a]=b};goog.debug.LogManager={};goog.debug.LogManager.loggers_={};goog.debug.LogManager.rootLogger_=null;
|
||||
goog.debug.LogManager.initialize=function(){goog.debug.LogManager.rootLogger_||(goog.debug.LogManager.rootLogger_=new goog.debug.Logger(goog.debug.Logger.ROOT_LOGGER_NAME),goog.debug.LogManager.loggers_[goog.debug.Logger.ROOT_LOGGER_NAME]=goog.debug.LogManager.rootLogger_,goog.debug.LogManager.rootLogger_.setLevel(goog.debug.Logger.Level.CONFIG))};goog.debug.LogManager.getLoggers=function(){return goog.debug.LogManager.loggers_};
|
||||
goog.debug.LogManager.getRoot=function(){goog.debug.LogManager.initialize();return goog.debug.LogManager.rootLogger_};goog.debug.LogManager.getLogger=function(a){goog.debug.LogManager.initialize();return goog.debug.LogManager.loggers_[a]||goog.debug.LogManager.createLogger_(a)};goog.debug.LogManager.createFunctionForCatchErrors=function(a){return function(b){(a||goog.debug.LogManager.getRoot()).severe("Error: "+b.message+" ("+b.fileName+" @ Line: "+b.line+")")}};
|
||||
goog.debug.LogManager.createLogger_=function(a){var b=new goog.debug.Logger(a);if(goog.debug.Logger.ENABLE_HIERARCHY){var c=a.lastIndexOf("."),d=a.substr(0,c);c=a.substr(c+1);d=goog.debug.LogManager.getLogger(d);d.addChild_(c,b);b.setParent_(d)}return goog.debug.LogManager.loggers_[a]=b};goog.log={};goog.log.ENABLED=goog.debug.LOGGING_ENABLED;goog.log.ROOT_LOGGER_NAME=goog.debug.Logger.ROOT_LOGGER_NAME;goog.log.Logger=goog.debug.Logger;goog.log.Level=goog.debug.Logger.Level;goog.log.LogRecord=goog.debug.LogRecord;goog.log.getLogger=function(a,b){return goog.log.ENABLED?(a=goog.debug.LogManager.getLogger(a),b&&a&&a.setLevel(b),a):null};goog.log.addHandler=function(a,b){goog.log.ENABLED&&a&&a.addHandler(b)};
|
||||
@@ -912,8 +911,8 @@ Blockly.Workspace.prototype.updateVariableStore=function(a){if(!this.isFlyout){f
|
||||
Blockly.Workspace.prototype.renameVariableInternal_=function(a,b){var c=this.getVariable(b);if(a&&c&&a.type!=c.type)throw Error('Variable "'+a.name+'" is type "'+a.type+'" and variable "'+b+'" is type "'+c.type+'". Both must be the same type.');if(c&&c.name!=b)var d=c.name;Blockly.Events.setGroup(!0);c=this.getAllBlocks();for(var e=0;e<c.length;e++)c[e].renameVar(a.name,b),d&&c[e].renameVar(d,b);this.variableMap_.renameVariable(a,b);Blockly.Events.setGroup(!1)};
|
||||
Blockly.Workspace.prototype.renameVariable=function(a,b){a=this.getVariable(a);this.renameVariableInternal_(a,b)};Blockly.Workspace.prototype.renameVariableById=function(a,b){a=this.getVariableById(a);this.renameVariableInternal_(a,b)};Blockly.Workspace.prototype.createVariable=function(a,b,c){return this.variableMap_.createVariable(a,b,c)};
|
||||
Blockly.Workspace.prototype.getVariableUses=function(a){for(var b=[],c=this.getAllBlocks(),d=0;d<c.length;d++){var e=c[d].getVars();if(e)for(var f=0;f<e.length;f++){var g=e[f];g&&a&&Blockly.Names.equals(g,a)&&b.push(c[d])}}return b};
|
||||
Blockly.Workspace.prototype.deleteVariable=function(a){for(var b=this.getVariableUses(a),c=0,d;d=b[c];c++)if("procedures_defnoreturn"==d.type||"procedures_defreturn"==d.type){b=d.getFieldValue("NAME");Blockly.alert(Blockly.Msg.CANNOT_DELETE_VARIABLE_PROCEDURE.replace("%1",a).replace("%2",b));return}var e=this,f=e.getVariable(a);1<b.length?Blockly.confirm(Blockly.Msg.DELETE_VARIABLE_CONFIRMATION.replace("%1",b.length).replace("%2",a),function(a){a&&e.deleteVariableInternal_(f)}):this.deleteVariableInternal_(f)};
|
||||
Blockly.Workspace.prototype.deleteVariableById=function(a){var b=this.getVariableById(a);b?this.deleteVariableInternal_(b):console.warn("Can't delete non-existant variable: "+a)};Blockly.Workspace.prototype.deleteVariableInternal_=function(a){var b=this.getVariableUses(a.name);Blockly.Events.setGroup(!0);for(var c=0;c<b.length;c++)b[c].dispose(!0,!1);this.variableMap_.deleteVariable(a);Blockly.Events.setGroup(!1)};
|
||||
Blockly.Workspace.prototype.deleteVariable=function(a){for(var b=this.getVariableUses(a),c=0,d;d=b[c];c++)if("procedures_defnoreturn"==d.type||"procedures_defreturn"==d.type){b=d.getFieldValue("NAME");Blockly.alert(Blockly.Msg.CANNOT_DELETE_VARIABLE_PROCEDURE.replace("%1",a).replace("%2",b));return}var e=this,f=e.getVariable(a);1<b.length?Blockly.confirm(Blockly.Msg.DELETE_VARIABLE_CONFIRMATION.replace("%1",String(b.length)).replace("%2",a),function(a){a&&e.deleteVariableInternal_(f)}):this.deleteVariableInternal_(f)};
|
||||
Blockly.Workspace.prototype.deleteVariableById=function(a){var b=this.getVariableById(a);b?this.deleteVariableInternal_(b):console.warn("Can't delete non-existent variable: "+a)};Blockly.Workspace.prototype.deleteVariableInternal_=function(a){var b=this.getVariableUses(a.name);Blockly.Events.setGroup(!0);for(var c=0;c<b.length;c++)b[c].dispose(!0,!1);this.variableMap_.deleteVariable(a);Blockly.Events.setGroup(!1)};
|
||||
Blockly.Workspace.prototype.variableIndexOf=function(a){console.warn("Deprecated call to Blockly.Workspace.prototype.variableIndexOf");return-1};Blockly.Workspace.prototype.getVariable=function(a){return this.variableMap_.getVariable(a)};Blockly.Workspace.prototype.getVariableById=function(a){return this.variableMap_.getVariableById(a)};Blockly.Workspace.prototype.getWidth=function(){return 0};Blockly.Workspace.prototype.newBlock=function(a,b){return new Blockly.Block(this,a,b)};
|
||||
Blockly.Workspace.prototype.remainingCapacity=function(){return isNaN(this.options.maxBlocks)?Infinity:this.options.maxBlocks-this.getAllBlocks().length};
|
||||
Blockly.Workspace.prototype.undo=function(a){var b=a?this.redoStack_:this.undoStack_,c=a?this.undoStack_:this.redoStack_,d=b.pop();if(d){for(var e=[d];b.length&&d.group&&d.group==b[b.length-1].group;)e.push(b.pop());for(b=0;d=e[b];b++)c.push(d);e=Blockly.Events.filter(e,a);Blockly.Events.recordUndo=!1;try{for(b=0;d=e[b];b++)d.run(a)}finally{Blockly.Events.recordUndo=!0}}};Blockly.Workspace.prototype.clearUndo=function(){this.undoStack_.length=0;this.redoStack_.length=0;Blockly.Events.clearPendingUndo()};
|
||||
@@ -943,7 +942,7 @@ Blockly.Icon.prototype.dispose=function(){goog.dom.removeNode(this.iconGroup_);t
|
||||
Blockly.Icon.prototype.renderIcon=function(a){if(this.collapseHidden&&this.block_.isCollapsed())return this.iconGroup_.setAttribute("display","none"),a;this.iconGroup_.setAttribute("display","block");var b=this.SIZE;this.block_.RTL&&(a-=b);this.iconGroup_.setAttribute("transform","translate("+a+",5)");this.computeIconLocation();return a=this.block_.RTL?a-Blockly.BlockSvg.SEP_SPACE_X:a+(b+Blockly.BlockSvg.SEP_SPACE_X)};
|
||||
Blockly.Icon.prototype.setIconLocation=function(a){this.iconXY_=a;this.isVisible()&&this.bubble_.setAnchorLocation(a)};Blockly.Icon.prototype.computeIconLocation=function(){var a=this.block_.getRelativeToSurfaceXY(),b=Blockly.utils.getRelativeXY(this.iconGroup_);a=new goog.math.Coordinate(a.x+b.x+this.SIZE/2,a.y+b.y+this.SIZE/2);goog.math.Coordinate.equals(this.getIconLocation(),a)||this.setIconLocation(a)};Blockly.Icon.prototype.getIconLocation=function(){return this.iconXY_};
|
||||
Blockly.Comment=function(a){Blockly.Comment.superClass_.constructor.call(this,a);this.createIcon()};goog.inherits(Blockly.Comment,Blockly.Icon);Blockly.Comment.prototype.text_="";Blockly.Comment.prototype.width_=160;Blockly.Comment.prototype.height_=80;
|
||||
Blockly.Comment.prototype.drawIcon_=function(a){Blockly.utils.createSvgElement("circle",{"class":"blocklyIconShape",r:"8",cx:"8",cy:"8"},a);Blockly.utils.createSvgElement("path",{"class":"blocklyIconSymbol",d:"m6.8,10h2c0.003,-0.617 0.271,-0.962 0.633,-1.266 2.875,-2.405 0.607,-5.534 -3.765,-3.874v1.7c3.12,-1.657 3.698,0.118 2.336,1.25 -1.201,0.998 -1.201,1.528 -1.204,2.19z"},a);Blockly.utils.createSvgElement("rect",{"class":"blocklyIconSymbol",x:"6.8",y:"10.78",height:"2",width:"2"},a)};
|
||||
Blockly.Comment.prototype.drawIcon_=function(a){Blockly.utils.createSvgElement("circle",{"class":"blocklyIconShape",r:"8",cx:"8",cy:"8"},a);Blockly.utils.createSvgElement("path",{"class":"blocklyIconSymbol",d:"m6.8,10h2c0.003,-0.617 0.271,-0.962 0.633,-1.266 2.875,-2.4050.607,-5.534 -3.765,-3.874v1.7c3.12,-1.657 3.698,0.118 2.336,1.25-1.201,0.998 -1.201,1.528 -1.204,2.19z"},a);Blockly.utils.createSvgElement("rect",{"class":"blocklyIconSymbol",x:"6.8",y:"10.78",height:"2",width:"2"},a)};
|
||||
Blockly.Comment.prototype.createEditor_=function(){this.foreignObject_=Blockly.utils.createSvgElement("foreignObject",{x:Blockly.Bubble.BORDER_WIDTH,y:Blockly.Bubble.BORDER_WIDTH},null);var a=document.createElementNS(Blockly.HTML_NS,"body");a.setAttribute("xmlns",Blockly.HTML_NS);a.className="blocklyMinimalBody";var b=document.createElementNS(Blockly.HTML_NS,"textarea");b.className="blocklyCommentTextarea";b.setAttribute("dir",this.block_.RTL?"RTL":"LTR");a.appendChild(b);this.textarea_=b;this.foreignObject_.appendChild(a);
|
||||
Blockly.bindEventWithChecks_(b,"mouseup",this,this.textareaFocus_);Blockly.bindEventWithChecks_(b,"wheel",this,function(a){a.stopPropagation()});Blockly.bindEventWithChecks_(b,"change",this,function(a){this.text_!=b.value&&(Blockly.Events.fire(new Blockly.Events.BlockChange(this.block_,"comment",null,this.text_,b.value)),this.text_=b.value)});setTimeout(function(){b.focus()},0);return this.foreignObject_};
|
||||
Blockly.Comment.prototype.updateEditable=function(){this.isVisible()&&(this.setVisible(!1),this.setVisible(!0));Blockly.Icon.prototype.updateEditable.call(this)};Blockly.Comment.prototype.resizeBubble_=function(){if(this.isVisible()){var a=this.bubble_.getBubbleSize(),b=2*Blockly.Bubble.BORDER_WIDTH;this.foreignObject_.setAttribute("width",a.width-b);this.foreignObject_.setAttribute("height",a.height-b);this.textarea_.style.width=a.width-b-4+"px";this.textarea_.style.height=a.height-b-4+"px"}};
|
||||
@@ -973,9 +972,9 @@ return b+a.toDevString()};Blockly.Extensions={};Blockly.Extensions.ALL_={};Block
|
||||
Blockly.Extensions.registerMutator=function(a,b,c,d){var e='Error when registering mutator "'+a+'": ';Blockly.Extensions.checkHasFunction_(e,b.domToMutation,"domToMutation");Blockly.Extensions.checkHasFunction_(e,b.mutationToDom,"mutationToDom");var f=Blockly.Extensions.checkMutatorDialog_(b,e);if(c&&!goog.isFunction(c))throw Error('Extension "'+a+'" is not a function');Blockly.Extensions.register(a,function(){f&&this.setMutator(new Blockly.Mutator(d));this.mixin(b);c&&c.apply(this)})};
|
||||
Blockly.Extensions.apply=function(a,b,c){var d=Blockly.Extensions.ALL_[a];if(!goog.isFunction(d))throw Error('Error: Extension "'+a+'" not found.');if(c)Blockly.Extensions.checkNoMutatorProperties_(a,b);else var e=Blockly.Extensions.getMutatorProperties_(b);d.apply(b);if(c)Blockly.Extensions.checkBlockHasMutatorProperties_('Error after applying mutator "'+a+'": ',b);else if(!Blockly.Extensions.mutatorPropertiesMatch_(e,b))throw Error('Error when applying extension "'+a+'": mutation properties changed when applying a non-mutator extension.');
|
||||
};Blockly.Extensions.checkHasFunction_=function(a,b,c){if(!b)throw Error(a+'missing required property "'+c+'"');if("function"!=typeof b)throw Error(a+'" required property "'+c+'" must be a function');};Blockly.Extensions.checkNoMutatorProperties_=function(a,b){if(Blockly.Extensions.getMutatorProperties_(b).length)throw Error('Error: tried to apply mutation "'+a+'" to a block that already has mutator functions. Block id: '+b.id);};
|
||||
Blockly.Extensions.checkMutatorDialog_=function(a,b){var c=void 0!==a.compose,d=void 0!==a.decompose;if(c&&d){if("function"!==typeof a.compose)throw Error(b+"compose must be a function.");if("function"!==typeof a.decompose)throw Error(b+"decompose must be a function.");return!0}if(c||d)throw Error(b+'Must have both or neither of "compose" and "decompose"');return!1};
|
||||
Blockly.Extensions.checkBlockHasMutatorProperties_=function(a,b){if("function"!==typeof b.domToMutation)throw Error(a+'Applying a mutator didn\'t add "domToMutation"');if("function"!==typeof b.mutationToDom)throw Error(a+'Applying a mutator didn\'t add "mutationToDom"');Blockly.Extensions.checkMutatorDialog_(b,a)};
|
||||
Blockly.Extensions.getMutatorProperties_=function(a){var b=[];void 0!==a.domToMutation&&b.push(a.domToMutation);void 0!==a.mutationToDom&&b.push(a.mutationToDom);void 0!==a.compose&&b.push(a.compose);void 0!==a.decompose&&b.push(a.decompose);return b};Blockly.Extensions.mutatorPropertiesMatch_=function(a,b){var c=!0;b=Blockly.Extensions.getMutatorProperties_(b);if(b.length!=a.length)c=!1;else for(var d=0;d<b.length;d++)a[d]!=b[d]&&(c=!1);return c};
|
||||
Blockly.Extensions.checkMutatorDialog_=function(a,b){var c=void 0!==a.compose,d=void 0!==a.decompose;if(c&&d){if("function"!=typeof a.compose)throw Error(b+"compose must be a function.");if("function"!=typeof a.decompose)throw Error(b+"decompose must be a function.");return!0}if(c||d)throw Error(b+'Must have both or neither of "compose" and "decompose"');return!1};
|
||||
Blockly.Extensions.checkBlockHasMutatorProperties_=function(a,b){if("function"!=typeof b.domToMutation)throw Error(a+'Applying a mutator didn\'t add "domToMutation"');if("function"!=typeof b.mutationToDom)throw Error(a+'Applying a mutator didn\'t add "mutationToDom"');Blockly.Extensions.checkMutatorDialog_(b,a)};
|
||||
Blockly.Extensions.getMutatorProperties_=function(a){var b=[];void 0!==a.domToMutation&&b.push(a.domToMutation);void 0!==a.mutationToDom&&b.push(a.mutationToDom);void 0!==a.compose&&b.push(a.compose);void 0!==a.decompose&&b.push(a.decompose);return b};Blockly.Extensions.mutatorPropertiesMatch_=function(a,b){b=Blockly.Extensions.getMutatorProperties_(b);if(b.length!=a.length)return!1;for(var c=0;c<b.length;c++)if(a[c]!=b[c])return!1;return!0};
|
||||
Blockly.Extensions.buildTooltipForDropdown=function(a,b){var c=[];document&&Blockly.utils.runAfterPageLoad(function(){for(var a in b)Blockly.utils.checkMessageReferences(b[a])});return function(){this.type&&-1===c.indexOf(this.type)&&(Blockly.Extensions.checkDropdownOptionsInTable_(this,a,b),c.push(this.type));this.setTooltip(function(){var d=this.getFieldValue(a),e=b[d];null==e?-1===c.indexOf(this.type)&&(d="No tooltip mapping for value "+d+" of field "+a,null!=this.type&&(d+=" of block type "+this.type),
|
||||
console.warn(d+".")):e=Blockly.utils.replaceMessageReferences(e);return e}.bind(this))}};Blockly.Extensions.checkDropdownOptionsInTable_=function(a,b,c){var d=a.getField(b);if(!d.isOptionListDynamic()){d=d.getOptions();for(var e=0;e<d.length;++e){var f=d[e][1];null==c[f]&&console.warn("No tooltip mapping for value "+f+" of field "+b+" of block type "+a.type)}}};
|
||||
Blockly.Extensions.buildTooltipWithFieldValue=function(a,b){document&&Blockly.utils.runAfterPageLoad(function(){Blockly.utils.checkMessageReferences(a)});return function(){this.setTooltip(function(){return Blockly.utils.replaceMessageReferences(a).replace("%1",this.getFieldValue(b))}.bind(this))}};Blockly.Extensions.extensionParentTooltip_=function(){this.tooltipWhenNotConnected_=this.tooltip;this.setTooltip(function(){var a=this.getParent();return a&&a.getInputsInline()&&a.tooltip||this.tooltipWhenNotConnected_}.bind(this))};
|
||||
@@ -994,8 +993,8 @@ Blockly.RenderedConnection.prototype.respawnShadow_=function(){var a=this.getSou
|
||||
Blockly.RenderedConnection.prototype.connect_=function(a){Blockly.RenderedConnection.superClass_.connect_.call(this,a);var b=this.getSourceBlock();a=a.getSourceBlock();b.rendered&&b.updateDisabled();a.rendered&&a.updateDisabled();b.rendered&&a.rendered&&(this.type==Blockly.NEXT_STATEMENT||this.type==Blockly.PREVIOUS_STATEMENT?a.render():b.render())};
|
||||
Blockly.RenderedConnection.prototype.onCheckChanged_=function(){this.isConnected()&&!this.checkType_(this.targetConnection)&&((this.isSuperior()?this.targetBlock():this.sourceBlock_).unplug(),this.sourceBlock_.bumpNeighbours_())};Blockly.DraggedConnectionManager=function(a){this.topBlock_=Blockly.selected=a;this.workspace_=a.workspace;this.availableConnections_=this.initAvailableConnections_();this.localConnection_=this.closestConnection_=null;this.radiusConnection_=0;this.wouldDeleteBlock_=!1};Blockly.DraggedConnectionManager.prototype.dispose=function(){this.workspace_=this.topBlock_=null;this.availableConnections_.length=0;this.localConnection_=this.closestConnection_=null};
|
||||
Blockly.DraggedConnectionManager.prototype.wouldDeleteBlock=function(){return this.wouldDeleteBlock_};Blockly.DraggedConnectionManager.prototype.applyConnections=function(){this.closestConnection_&&(this.localConnection_.connect(this.closestConnection_),this.topBlock_.rendered&&((this.localConnection_.isSuperior()?this.closestConnection_:this.localConnection_).getSourceBlock().connectionUiEffect(),this.topBlock_.getRootBlock().bringToFront()),this.removeHighlighting_())};
|
||||
Blockly.DraggedConnectionManager.prototype.update=function(a,b){var c=this.closestConnection_;(a=this.updateClosest_(a))&&c&&c.unhighlight();c=!!this.closestConnection_&&b!=Blockly.DELETE_AREA_TOOLBOX;this.wouldDeleteBlock_=!!b&&!this.topBlock_.getParent()&&this.topBlock_.isDeletable()&&!c;!this.wouldDeleteBlock_&&a&&this.closestConnection_&&this.addHighlighting_()};Blockly.DraggedConnectionManager.prototype.removeHighlighting_=function(){this.closestConnection_&&this.closestConnection_.unhighlight()};
|
||||
Blockly.DraggedConnectionManager.prototype.addHighlighting_=function(){this.closestConnection_&&this.closestConnection_.highlight()};Blockly.DraggedConnectionManager.prototype.initAvailableConnections_=function(){var a=this.topBlock_.getConnections_(!1),b=this.topBlock_.lastConnectionInStack_();b&&b!=this.topBlock_.nextConnection&&a.push(b);return a};
|
||||
Blockly.DraggedConnectionManager.prototype.update=function(a,b){var c=this.closestConnection_;(a=this.updateClosest_(a))&&c&&c.unhighlight();c=!!this.closestConnection_&&b!=Blockly.DELETE_AREA_TOOLBOX;this.wouldDeleteBlock_=(b=!!b&&!this.topBlock_.getParent()&&this.topBlock_.isDeletable())&&!c;b&&this.closestConnection_&&(this.closestConnection_.unhighlight(),this.closestConnection_=null);!this.wouldDeleteBlock_&&a&&this.closestConnection_&&this.addHighlighting_()};
|
||||
Blockly.DraggedConnectionManager.prototype.removeHighlighting_=function(){this.closestConnection_&&this.closestConnection_.unhighlight()};Blockly.DraggedConnectionManager.prototype.addHighlighting_=function(){this.closestConnection_&&this.closestConnection_.highlight()};Blockly.DraggedConnectionManager.prototype.initAvailableConnections_=function(){var a=this.topBlock_.getConnections_(!1),b=this.topBlock_.lastConnectionInStack_();b&&b!=this.topBlock_.nextConnection&&a.push(b);return a};
|
||||
Blockly.DraggedConnectionManager.prototype.updateClosest_=function(a){var b=this.closestConnection_;this.localConnection_=this.closestConnection_=null;this.radiusConnection_=Blockly.SNAP_RADIUS;for(var c=0;c<this.availableConnections_.length;c++){var d=this.availableConnections_[c],e=d.closest(this.radiusConnection_,a);e.connection&&(this.closestConnection_=e.connection,this.localConnection_=d,this.radiusConnection_=e.radius)}return b!=this.closestConnection_};Blockly.BlockDragger=function(a,b){this.draggingBlock_=a;this.workspace_=b;this.draggedConnectionManager_=new Blockly.DraggedConnectionManager(this.draggingBlock_);this.deleteArea_=null;this.wouldDeleteBlock_=!1;this.startXY_=this.draggingBlock_.getRelativeToSurfaceXY();this.dragIconData_=Blockly.BlockDragger.initIconData_(a)};
|
||||
Blockly.BlockDragger.prototype.dispose=function(){this.startWorkspace_=this.workspace_=this.draggingBlock_=null;this.dragIconData_.length=0;this.draggedConnectionManager_&&(this.draggedConnectionManager_.dispose(),this.draggedConnectionManager_=null)};Blockly.BlockDragger.initIconData_=function(a){var b=[];a=a.getDescendants();for(var c=0,d;d=a[c];c++){d=d.getIcons();for(var e=0;e<d.length;e++){var f={location:d[e].getIconLocation(),icon:d[e]};b.push(f)}}return b};
|
||||
Blockly.BlockDragger.prototype.startBlockDrag=function(a){Blockly.Events.getGroup()||Blockly.Events.setGroup(!0);this.workspace_.setResizesEnabled(!1);Blockly.BlockSvg.disconnectUiStop_();this.draggingBlock_.getParent()&&(this.draggingBlock_.unplug(),a=this.pixelsToWorkspaceUnits_(a),a=goog.math.Coordinate.sum(this.startXY_,a),this.draggingBlock_.translate(a.x,a.y),this.draggingBlock_.disconnectUiEffect());this.draggingBlock_.setDragging(!0);this.draggingBlock_.moveToDragSurface_();this.workspace_.toolbox_&&
|
||||
@@ -1012,7 +1011,7 @@ Blockly.Tooltip.createDom=function(){Blockly.Tooltip.DIV||(Blockly.Tooltip.DIV=g
|
||||
Blockly.Tooltip.onMouseOver_=function(a){if(!Blockly.Tooltip.blocked_){for(a=a.target;!goog.isString(a.tooltip)&&!goog.isFunction(a.tooltip);)a=a.tooltip;Blockly.Tooltip.element_!=a&&(Blockly.Tooltip.hide(),Blockly.Tooltip.poisonedElement_=null,Blockly.Tooltip.element_=a);clearTimeout(Blockly.Tooltip.mouseOutPid_)}};
|
||||
Blockly.Tooltip.onMouseOut_=function(a){Blockly.Tooltip.blocked_||(Blockly.Tooltip.mouseOutPid_=setTimeout(function(){Blockly.Tooltip.element_=null;Blockly.Tooltip.poisonedElement_=null;Blockly.Tooltip.hide()},1),clearTimeout(Blockly.Tooltip.showPid_))};
|
||||
Blockly.Tooltip.onMouseMove_=function(a){if(Blockly.Tooltip.element_&&Blockly.Tooltip.element_.tooltip&&!Blockly.WidgetDiv.isVisible()&&!Blockly.Tooltip.blocked_)if(Blockly.Tooltip.visible){var b=Blockly.Tooltip.lastX_-a.pageX;a=Blockly.Tooltip.lastY_-a.pageY;Math.sqrt(b*b+a*a)>Blockly.Tooltip.RADIUS_OK&&Blockly.Tooltip.hide()}else Blockly.Tooltip.poisonedElement_!=Blockly.Tooltip.element_&&(clearTimeout(Blockly.Tooltip.showPid_),Blockly.Tooltip.lastX_=a.pageX,Blockly.Tooltip.lastY_=a.pageY,Blockly.Tooltip.showPid_=
|
||||
setTimeout(Blockly.Tooltip.show_,Blockly.Tooltip.HOVER_MS))};Blockly.Tooltip.hide=function(){Blockly.Tooltip.visible&&(Blockly.Tooltip.visible=!1,Blockly.Tooltip.DIV&&(Blockly.Tooltip.DIV.style.display="none"));clearTimeout(Blockly.Tooltip.showPid_)};Blockly.Tooltip.block=function(){Blockly.Tooltip.hide();Blockly.Tooltip.blocked_=!0};Blockly.Tooltip.unblock=function(){Blockly.Tooltip.blocked_=!1};
|
||||
setTimeout(Blockly.Tooltip.show_,Blockly.Tooltip.HOVER_MS))};Blockly.Tooltip.hide=function(){Blockly.Tooltip.visible&&(Blockly.Tooltip.visible=!1,Blockly.Tooltip.DIV&&(Blockly.Tooltip.DIV.style.display="none"));Blockly.Tooltip.showPid_&&clearTimeout(Blockly.Tooltip.showPid_)};Blockly.Tooltip.block=function(){Blockly.Tooltip.hide();Blockly.Tooltip.blocked_=!0};Blockly.Tooltip.unblock=function(){Blockly.Tooltip.blocked_=!1};
|
||||
Blockly.Tooltip.show_=function(){if(!Blockly.Tooltip.blocked_&&(Blockly.Tooltip.poisonedElement_=Blockly.Tooltip.element_,Blockly.Tooltip.DIV)){goog.dom.removeChildren(Blockly.Tooltip.DIV);for(var a=Blockly.Tooltip.element_.tooltip;goog.isFunction(a);)a=a();a=Blockly.utils.wrap(a,Blockly.Tooltip.LIMIT);a=a.split("\n");for(var b=0;b<a.length;b++){var c=document.createElement("div");c.appendChild(document.createTextNode(a[b]));Blockly.Tooltip.DIV.appendChild(c)}a=Blockly.Tooltip.element_.RTL;b=goog.dom.getViewportSize();
|
||||
Blockly.Tooltip.DIV.style.direction=a?"rtl":"ltr";Blockly.Tooltip.DIV.style.display="block";Blockly.Tooltip.visible=!0;c=Blockly.Tooltip.lastX_;c=a?c-(Blockly.Tooltip.OFFSET_X+Blockly.Tooltip.DIV.offsetWidth):c+Blockly.Tooltip.OFFSET_X;var d=Blockly.Tooltip.lastY_+Blockly.Tooltip.OFFSET_Y;d+Blockly.Tooltip.DIV.offsetHeight>b.height+window.scrollY&&(d-=Blockly.Tooltip.DIV.offsetHeight+2*Blockly.Tooltip.OFFSET_Y);a?c=Math.max(Blockly.Tooltip.MARGINS-window.scrollX,c):c+Blockly.Tooltip.DIV.offsetWidth>
|
||||
b.width+window.scrollX-2*Blockly.Tooltip.MARGINS&&(c=b.width-Blockly.Tooltip.DIV.offsetWidth-2*Blockly.Tooltip.MARGINS);Blockly.Tooltip.DIV.style.top=d+"px";Blockly.Tooltip.DIV.style.left=c+"px"}};Blockly.Gesture=function(a,b){this.mouseDownXY_=null;this.currentDragDeltaXY_=0;this.startWorkspace_=this.targetBlock_=this.startBlock_=this.startField_=null;this.creatorWorkspace_=b;this.isDraggingBlock_=this.isDraggingWorkspace_=this.hasExceededDragRadius_=!1;this.mostRecentEvent_=a;this.flyout_=this.workspaceDragger_=this.blockDragger_=this.onUpWrapper_=this.onMoveWrapper_=null;this.isEnding_=this.hasStarted_=this.calledUpdateIsDragging_=!1};
|
||||
@@ -1037,7 +1036,7 @@ Blockly.Gesture.prototype.bringBlockToFront_=function(){this.targetBlock_&&!this
|
||||
Blockly.Gesture.prototype.setTargetBlock_=function(a){a.isShadow()?this.setTargetBlock_(a.getParent()):this.targetBlock_=a};Blockly.Gesture.prototype.setStartWorkspace_=function(a){this.startWorkspace_||(this.startWorkspace_=a)};Blockly.Gesture.prototype.setStartFlyout_=function(a){this.flyout_||(this.flyout_=a)};Blockly.Gesture.prototype.isBlockClick_=function(){return!!this.startBlock_&&!this.hasExceededDragRadius_&&!this.isFieldClick_()};
|
||||
Blockly.Gesture.prototype.isFieldClick_=function(){return(this.startField_?this.startField_.isCurrentlyEditable():!1)&&!this.hasExceededDragRadius_&&(!this.flyout_||!this.flyout_.autoClose)};Blockly.Gesture.prototype.isWorkspaceClick_=function(){return!this.startBlock_&&!this.startField_&&!this.hasExceededDragRadius_};Blockly.Gesture.prototype.isDragging=function(){return this.isDraggingWorkspace_||this.isDraggingBlock_};Blockly.Gesture.prototype.hasStarted=function(){return this.hasStarted_};Blockly.Field=function(a,b){this.size_=new goog.math.Size(0,Blockly.BlockSvg.MIN_BLOCK_Y);this.setValue(a);this.setValidator(b)};Blockly.Field.cacheWidths_=null;Blockly.Field.cacheReference_=0;Blockly.Field.prototype.name=void 0;Blockly.Field.prototype.maxDisplayLength=50;Blockly.Field.prototype.text_="";Blockly.Field.prototype.sourceBlock_=null;Blockly.Field.prototype.visible_=!0;Blockly.Field.prototype.validator_=null;Blockly.Field.NBSP="\u00a0";Blockly.Field.prototype.EDITABLE=!0;
|
||||
Blockly.Field.prototype.setSourceBlock=function(a){goog.asserts.assert(!this.sourceBlock_,"Field already bound to a block.");this.sourceBlock_=a};
|
||||
Blockly.Field.prototype.init=function(){this.fieldGroup_||(this.fieldGroup_=Blockly.utils.createSvgElement("g",{},null),this.visible_||(this.fieldGroup_.style.display="none"),this.borderRect_=Blockly.utils.createSvgElement("rect",{rx:4,ry:4,x:-Blockly.BlockSvg.SEP_SPACE_X/2,y:0,height:16},this.fieldGroup_,this.sourceBlock_.workspace),this.textElement_=Blockly.utils.createSvgElement("text",{"class":"blocklyText",y:this.size_.height-12.5},this.fieldGroup_),this.updateEditable(),this.sourceBlock_.getSvgRoot().appendChild(this.fieldGroup_),
|
||||
Blockly.Field.prototype.init=function(){this.fieldGroup_||(this.fieldGroup_=Blockly.utils.createSvgElement("g",{},null),this.visible_||(this.fieldGroup_.style.display="none"),this.borderRect_=Blockly.utils.createSvgElement("rect",{rx:4,ry:4,x:-Blockly.BlockSvg.SEP_SPACE_X/2,y:0,height:16},this.fieldGroup_),this.textElement_=Blockly.utils.createSvgElement("text",{"class":"blocklyText",y:this.size_.height-12.5},this.fieldGroup_),this.updateEditable(),this.sourceBlock_.getSvgRoot().appendChild(this.fieldGroup_),
|
||||
this.mouseDownWrapper_=Blockly.bindEventWithChecks_(this.fieldGroup_,"mousedown",this,this.onMouseDown_),this.render_())};Blockly.Field.prototype.initModel=function(){};Blockly.Field.prototype.dispose=function(){this.mouseDownWrapper_&&(Blockly.unbindEvent_(this.mouseDownWrapper_),this.mouseDownWrapper_=null);this.sourceBlock_=null;goog.dom.removeNode(this.fieldGroup_);this.validator_=this.borderRect_=this.textElement_=this.fieldGroup_=null};
|
||||
Blockly.Field.prototype.updateEditable=function(){var a=this.fieldGroup_;this.EDITABLE&&a&&(this.sourceBlock_.isEditable()?(Blockly.utils.addClass(a,"blocklyEditableText"),Blockly.utils.removeClass(a,"blocklyNonEditableText"),this.fieldGroup_.style.cursor=this.CURSOR):(Blockly.utils.addClass(a,"blocklyNonEditableText"),Blockly.utils.removeClass(a,"blocklyEditableText"),this.fieldGroup_.style.cursor=""))};
|
||||
Blockly.Field.prototype.isCurrentlyEditable=function(){return this.EDITABLE&&!!this.sourceBlock_&&this.sourceBlock_.isEditable()};Blockly.Field.prototype.isVisible=function(){return this.visible_};Blockly.Field.prototype.setVisible=function(a){if(this.visible_!=a){this.visible_=a;var b=this.getSvgRoot();b&&(b.style.display=a?"block":"none",this.render_())}};Blockly.Field.prototype.setValidator=function(a){this.validator_=a};Blockly.Field.prototype.getValidator=function(){return this.validator_};
|
||||
@@ -1050,7 +1049,7 @@ Blockly.Field.prototype.forceRerender=function(){this.size_.width=0;this.sourceB
|
||||
Blockly.Field.prototype.onMouseDown_=function(a){this.sourceBlock_&&this.sourceBlock_.workspace&&(a=this.sourceBlock_.workspace.getGesture(a))&&a.setStartField(this)};Blockly.Field.prototype.setTooltip=function(a){};Blockly.Field.prototype.getAbsoluteXY_=function(){return goog.style.getPageOffset(this.borderRect_)};Blockly.FieldLabel=function(a,b){this.size_=new goog.math.Size(0,17.5);this.class_=b;this.setValue(a)};goog.inherits(Blockly.FieldLabel,Blockly.Field);Blockly.FieldLabel.prototype.EDITABLE=!1;
|
||||
Blockly.FieldLabel.prototype.init=function(){this.textElement_||(this.textElement_=Blockly.utils.createSvgElement("text",{"class":"blocklyText",y:this.size_.height-5},null),this.class_&&Blockly.utils.addClass(this.textElement_,this.class_),this.visible_||(this.textElement_.style.display="none"),this.sourceBlock_.getSvgRoot().appendChild(this.textElement_),this.textElement_.tooltip=this.sourceBlock_,Blockly.Tooltip.bindMouseEvents(this.textElement_),this.render_())};
|
||||
Blockly.FieldLabel.prototype.dispose=function(){goog.dom.removeNode(this.textElement_);this.textElement_=null};Blockly.FieldLabel.prototype.getSvgRoot=function(){return this.textElement_};Blockly.FieldLabel.prototype.setTooltip=function(a){this.textElement_.tooltip=a};Blockly.Input=function(a,b,c,d){if(a!=Blockly.DUMMY_INPUT&&!b)throw"Value inputs and statement inputs must have non-empty name.";this.type=a;this.name=b;this.sourceBlock_=c;this.connection=d;this.fieldRow=[]};Blockly.Input.prototype.align=Blockly.ALIGN_LEFT;Blockly.Input.prototype.visible_=!0;Blockly.Input.prototype.appendField=function(a,b){this.insertFieldAt(this.fieldRow.length,a,b);return this};
|
||||
Blockly.Input.prototype.insertFieldAt=function(a,b,c){if(0>a||a>this.fieldRow.length)throw Error("index "+a+" out of bounds.");if(!b&&!c)return this;goog.isString(b)&&(b=new Blockly.FieldLabel(b));b.setSourceBlock(this.sourceBlock_);this.sourceBlock_.rendered&&b.init();b.name=c;b.prefixField&&(a=this.insertFieldAt(a,b.prefixField));this.fieldRow.splice(a,0,b);++a;b.suffixField&&(a=this.insertFieldAt(a,b.suffixField));this.sourceBlock_.rendered&&(this.sourceBlock_.render(),this.sourceBlock_.bumpNeighbours_());
|
||||
Blockly.Input.prototype.insertFieldAt=function(a,b,c){if(0>a||a>this.fieldRow.length)throw Error("index "+a+" out of bounds.");if(!b&&!c)return a;goog.isString(b)&&(b=new Blockly.FieldLabel(b));b.setSourceBlock(this.sourceBlock_);this.sourceBlock_.rendered&&b.init();b.name=c;b.prefixField&&(a=this.insertFieldAt(a,b.prefixField));this.fieldRow.splice(a,0,b);++a;b.suffixField&&(a=this.insertFieldAt(a,b.suffixField));this.sourceBlock_.rendered&&(this.sourceBlock_.render(),this.sourceBlock_.bumpNeighbours_());
|
||||
return a};Blockly.Input.prototype.removeField=function(a){for(var b=0,c;c=this.fieldRow[b];b++)if(c.name===a){c.dispose();this.fieldRow.splice(b,1);this.sourceBlock_.rendered&&(this.sourceBlock_.render(),this.sourceBlock_.bumpNeighbours_());return}goog.asserts.fail('Field "%s" not found.',a)};Blockly.Input.prototype.isVisible=function(){return this.visible_};
|
||||
Blockly.Input.prototype.setVisible=function(a){var b=[];if(this.visible_==a)return b;for(var c=(this.visible_=a)?"block":"none",d=0,e;e=this.fieldRow[d];d++)e.setVisible(a);this.connection&&(a?b=this.connection.unhideAll():this.connection.hideAll(),d=this.connection.targetBlock())&&(d.getSvgRoot().style.display=c,a||(d.rendered=!1));return b};Blockly.Input.prototype.setCheck=function(a){if(!this.connection)throw"This input does not have a connection.";this.connection.setCheck(a);return this};
|
||||
Blockly.Input.prototype.setAlign=function(a){this.align=a;this.sourceBlock_.rendered&&this.sourceBlock_.render();return this};Blockly.Input.prototype.init=function(){if(this.sourceBlock_.workspace.rendered)for(var a=0;a<this.fieldRow.length;a++)this.fieldRow[a].init()};Blockly.Input.prototype.dispose=function(){for(var a=0,b;b=this.fieldRow[a];a++)b.dispose();this.connection&&this.connection.dispose();this.sourceBlock_=null};Blockly.ConnectionDB=function(){};Blockly.ConnectionDB.prototype=[];Blockly.ConnectionDB.constructor=Blockly.ConnectionDB;Blockly.ConnectionDB.prototype.addConnection=function(a){if(a.inDB_)throw"Connection already in database.";if(!a.getSourceBlock().isInFlyout){var b=this.findPositionForConnection_(a);this.splice(b,0,a);a.inDB_=!0}};
|
||||
@@ -1062,14 +1061,15 @@ Blockly.ConnectionDB.init=function(a){var b=[];b[Blockly.INPUT_VALUE]=new Blockl
|
||||
Blockly.utils.removeClass=function(a,b){var c=a.getAttribute("class");if(-1==(" "+c+" ").indexOf(" "+b+" "))return!1;c=c.split(/\s+/);for(var d=0;d<c.length;d++)c[d]&&c[d]!=b||(c.splice(d,1),d--);c.length?a.setAttribute("class",c.join(" ")):Blockly.utils.removeAttribute(a,"class");return!0};Blockly.utils.hasClass=function(a,b){return-1!=(" "+a.getAttribute("class")+" ").indexOf(" "+b+" ")};Blockly.utils.noEvent=function(a){a.preventDefault();a.stopPropagation()};
|
||||
Blockly.utils.isTargetInput=function(a){return"textarea"==a.target.type||"text"==a.target.type||"number"==a.target.type||"email"==a.target.type||"password"==a.target.type||"search"==a.target.type||"tel"==a.target.type||"url"==a.target.type||a.target.isContentEditable};
|
||||
Blockly.utils.getRelativeXY=function(a){var b=new goog.math.Coordinate(0,0),c=a.getAttribute("x");c&&(b.x=parseInt(c,10));if(c=a.getAttribute("y"))b.y=parseInt(c,10);if(c=(c=a.getAttribute("transform"))&&c.match(Blockly.utils.getRelativeXY.XY_REGEX_))b.x+=parseFloat(c[1]),c[3]&&(b.y+=parseFloat(c[3]));(a=a.getAttribute("style"))&&-1<a.indexOf("translate")&&((c=a.match(Blockly.utils.getRelativeXY.XY_2D_REGEX_))||(c=a.match(Blockly.utils.getRelativeXY.XY_3D_REGEX_)),c&&(b.x+=parseFloat(c[1]),c[3]&&
|
||||
(b.y+=parseFloat(c[3]))));return b};Blockly.utils.getInjectionDivXY_=function(a){for(var b=0,c=0,d;a;){var e=Blockly.utils.getRelativeXY(a);d=Blockly.utils.getScale_(a);b=b*d+e.x;c=c*d+e.y;if(-1!=(" "+(a.getAttribute("class")||"")+" ").indexOf(" injectionDiv "))break;a=a.parentNode}return new goog.math.Coordinate(b,c)};Blockly.utils.getScale_=function(a){var b=1;(a=a.getAttribute("transform"))&&(a=a.match(Blockly.utils.getScale_.REGEXP_))&&a[0]&&(b=parseFloat(a[0]));return b};
|
||||
(b.y+=parseFloat(c[3]))));return b};Blockly.utils.getInjectionDivXY_=function(a){for(var b=0,c=0;a;){var d=Blockly.utils.getRelativeXY(a),e=Blockly.utils.getScale_(a);b=b*e+d.x;c=c*e+d.y;if(-1!=(" "+(a.getAttribute("class")||"")+" ").indexOf(" injectionDiv "))break;a=a.parentNode}return new goog.math.Coordinate(b,c)};Blockly.utils.getScale_=function(a){var b=1;(a=a.getAttribute("transform"))&&(a=a.match(Blockly.utils.getScale_.REGEXP_))&&a[0]&&(b=parseFloat(a[0]));return b};
|
||||
Blockly.utils.getRelativeXY.XY_REGEX_=/translate\(\s*([-+\d.e]+)([ ,]\s*([-+\d.e]+)\s*\))?/;Blockly.utils.getScale_REGEXP_=/scale\(\s*([-+\d.e]+)\s*\)/;Blockly.utils.getRelativeXY.XY_3D_REGEX_=/transform:\s*translate3d\(\s*([-+\d.e]+)px([ ,]\s*([-+\d.e]+)\s*)px([ ,]\s*([-+\d.e]+)\s*)px\)?/;Blockly.utils.getRelativeXY.XY_2D_REGEX_=/transform:\s*translate\(\s*([-+\d.e]+)px([ ,]\s*([-+\d.e]+)\s*)px\)?/;
|
||||
Blockly.utils.createSvgElement=function(a,b,c){a=document.createElementNS(Blockly.SVG_NS,a);for(var d in b)a.setAttribute(d,b[d]);document.body.runtimeStyle&&(a.runtimeStyle=a.currentStyle=a.style);c&&c.appendChild(a);return a};Blockly.utils.isRightButton=function(a){return a.ctrlKey&&goog.userAgent.MAC?!0:2==a.button};Blockly.utils.mouseToSvg=function(a,b,c){var d=b.createSVGPoint();d.x=a.clientX;d.y=a.clientY;c||(c=b.getScreenCTM().inverse());return d.matrixTransform(c)};
|
||||
Blockly.utils.shortestStringLength=function(a){return a.length?a.reduce(function(a,c){return a.length<c.length?a:c}).length:0};Blockly.utils.commonWordPrefix=function(a,b){if(!a.length)return 0;if(1==a.length)return a[0].length;var c=0;b=b||Blockly.utils.shortestStringLength(a);for(var d=0;d<b;d++){for(var e=a[0][d],f=1;f<a.length;f++)if(e!=a[f][d])return c;" "==e&&(c=d+1)}for(f=1;f<a.length;f++)if((e=a[f][d])&&" "!=e)return c;return b};
|
||||
Blockly.utils.commonWordSuffix=function(a,b){if(!a.length)return 0;if(1==a.length)return a[0].length;var c=0;b=b||Blockly.utils.shortestStringLength(a);for(var d=0;d<b;d++){for(var e=a[0].substr(-d-1,1),f=1;f<a.length;f++)if(e!=a[f].substr(-d-1,1))return c;" "==e&&(c=d+1)}for(f=1;f<a.length;f++)if((e=a[f].charAt(a[f].length-d-1))&&" "!=e)return c;return b};Blockly.utils.tokenizeInterpolation=function(a){return Blockly.utils.tokenizeInterpolation_(a,!0)};
|
||||
Blockly.utils.replaceMessageReferences=function(a){if(!goog.isString(a))return a;a=Blockly.utils.tokenizeInterpolation_(a,!1);return a.length?a[0]:""};Blockly.utils.checkMessageReferences=function(a){for(var b=!0,c=/%{BKY_([a-zA-Z][a-zA-Z0-9_]*)}/g,d=c.exec(a);null!=d;){var e=d[1];null==Blockly.utils.getMessageArray_()[e]&&(console.log("WARNING: No message string for %{BKY_"+e+"}."),b=!1);a=a.substring(d.index+e.length+1);d=c.exec(a)}return b};
|
||||
Blockly.utils.replaceMessageReferences=function(a){if(!goog.isString(a))return a;a=Blockly.utils.tokenizeInterpolation_(a,!1);return a.length?a[0]:""};
|
||||
Blockly.utils.checkMessageReferences=function(a){for(var b=!0,c=Blockly.utils.getMessageArray_(),d=/%{(BKY_[A-Z][A-Z0-9_]*)}/gi,e=d.exec(a);e;){var f=e[1];f=f.toUpperCase();"BKY_"!=f.substr(0,4)?(console.log("WARNING: Unsupported message table prefix in %{"+e[1]+"}."),b=!1):void 0==c[f.substr(4)]&&(console.log("WARNING: No message string for %{"+e[1]+"}."),b=!1);a=a.substring(e.index+f.length+1);e=d.exec(a)}return b};
|
||||
Blockly.utils.tokenizeInterpolation_=function(a,b){var c=[],d=a.split("");d.push("");var e=0;a=[];for(var f=null,g=0;g<d.length;g++){var h=d[g];0==e?"%"==h?((h=a.join(""))&&c.push(h),a.length=0,e=1):a.push(h):1==e?"%"==h?(a.push(h),e=0):b&&"0"<=h&&"9">=h?(e=2,f=h,(h=a.join(""))&&c.push(h),a.length=0):"{"==h?e=3:(a.push("%",h),e=0):2==e?"0"<=h&&"9">=h?f+=h:(c.push(parseInt(f,10)),g--,e=0):3==e&&(""==h?(a.splice(0,0,"%{"),g--,e=0):"}"!=h?a.push(h):(e=a.join(""),/[a-zA-Z][a-zA-Z0-9_]*/.test(e)?(h=e.toUpperCase(),
|
||||
(h=goog.string.startsWith(h,"BKY_")?h.substring(4):null)&&h in Blockly.utils.getMessageArray_()?(e=Blockly.utils.getMessageArray_()[h],goog.isString(e)?Array.prototype.push.apply(c,Blockly.utils.tokenizeInterpolation(e)):b?c.push(String(e)):c.push(e)):c.push("%{"+e+"}")):c.push("%{"+e+"}"),e=a.length=0))}(h=a.join(""))&&c.push(h);b=[];for(g=a.length=0;g<c.length;++g)"string"==typeof c[g]?a.push(c[g]):((h=a.join(""))&&b.push(h),a.length=0,b.push(c[g]));(h=a.join(""))&&b.push(h);a.length=0;return b};
|
||||
(h=goog.string.startsWith(h,"BKY_")?h.substring(4):null)&&h in Blockly.utils.getMessageArray_()?(e=Blockly.utils.getMessageArray_()[h],goog.isString(e)?Array.prototype.push.apply(c,Blockly.utils.tokenizeInterpolation_(e,b)):b?c.push(String(e)):c.push(e)):c.push("%{"+e+"}")):c.push("%{"+e+"}"),e=a.length=0))}(h=a.join(""))&&c.push(h);b=[];for(g=a.length=0;g<c.length;++g)"string"==typeof c[g]?a.push(c[g]):((h=a.join(""))&&b.push(h),a.length=0,b.push(c[g]));(h=a.join(""))&&b.push(h);a.length=0;return b};
|
||||
Blockly.utils.genUid=function(){for(var a=Blockly.utils.genUid.soup_.length,b=[],c=0;20>c;c++)b[c]=Blockly.utils.genUid.soup_.charAt(Math.random()*a);return b.join("")};Blockly.utils.genUid.soup_="!#$%()*+,-./:;=?@[]^_`{|}~ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";Blockly.utils.wrap=function(a,b){a=a.split("\n");for(var c=0;c<a.length;c++)a[c]=Blockly.utils.wrapLine_(a[c],b);return a.join("\n")};
|
||||
Blockly.utils.wrapLine_=function(a,b){if(a.length<=b)return a;for(var c=a.trim().split(/\s+/),d=0;d<c.length;d++)c[d].length>b&&(b=c[d].length);d=-Infinity;var e=1;do{var f=d;var g=a;a=[];var h=c.length/e,k=1;for(d=0;d<c.length-1;d++)k<(d+1.5)/h?(k++,a[d]=!0):a[d]=!1;a=Blockly.utils.wrapMutate_(c,a,b);d=Blockly.utils.wrapScore_(c,a,b);a=Blockly.utils.wrapToText_(c,a);e++}while(d>f);return g};
|
||||
Blockly.utils.wrapScore_=function(a,b,c){for(var d=[0],e=[],f=0;f<a.length;f++)d[d.length-1]+=a[f].length,!0===b[f]?(d.push(0),e.push(a[f].charAt(a[f].length-1))):!1===b[f]&&d[d.length-1]++;a=Math.max.apply(Math,d);for(f=b=0;f<d.length;f++)b-=2*Math.pow(Math.abs(c-d[f]),1.5),b-=Math.pow(a-d[f],1.5),-1!=".?!".indexOf(e[f])?b+=c/3:-1!=",;)]}".indexOf(e[f])&&(b+=c/4);1<d.length&&d[d.length-1]<=d[d.length-2]&&(b+=.5);return b};
|
||||
@@ -1129,7 +1129,7 @@ Blockly.WorkspaceDragSurfaceSvg.prototype.clearAndHide=function(a){var b=this.SV
|
||||
Blockly.WorkspaceDragSurfaceSvg.prototype.setContentsAndShow=function(a,b,c,d,e,f){goog.asserts.assert(0==this.SVG_.childNodes.length,"Already dragging a block.");this.previousSibling_=c;a.setAttribute("transform","translate(0, 0) scale("+f+")");b.setAttribute("transform","translate(0, 0) scale("+f+")");this.SVG_.setAttribute("width",d);this.SVG_.setAttribute("height",e);this.SVG_.appendChild(a);this.SVG_.appendChild(b);this.SVG_.style.display="block"};Blockly.Xml={};Blockly.Xml.workspaceToDom=function(a,b){var c=goog.dom.createDom("xml");c.appendChild(Blockly.Xml.variablesToDom(a.getAllVariables()));a=a.getTopBlocks(!0);for(var d=0,e;e=a[d];d++)c.appendChild(Blockly.Xml.blockToDomWithXY(e,b));return c};Blockly.Xml.variablesToDom=function(a){for(var b=goog.dom.createDom("variables"),c=0,d;d=a[c];c++){var e=goog.dom.createDom("variable",null,d.name);e.setAttribute("type",d.type);e.setAttribute("id",d.getId());b.appendChild(e)}return b};
|
||||
Blockly.Xml.blockToDomWithXY=function(a,b){var c;a.workspace.RTL&&(c=a.workspace.getWidth());b=Blockly.Xml.blockToDom(a,b);var d=a.getRelativeToSurfaceXY();b.setAttribute("x",Math.round(a.workspace.RTL?c-d.x:d.x));b.setAttribute("y",Math.round(d.y));return b};
|
||||
Blockly.Xml.blockToDom=function(a,b){var c=goog.dom.createDom(a.isShadow()?"shadow":"block");c.setAttribute("type",a.type);b||c.setAttribute("id",a.id);if(a.mutationToDom){var d=a.mutationToDom();d&&(d.hasChildNodes()||d.hasAttributes())&&c.appendChild(d)}d=0;for(var e;e=a.inputList[d];d++)for(var f=0,g;g=e.fieldRow[f];f++){var h=g;h.name&&h.EDITABLE&&(g=goog.dom.createDom("field",null,h.getValue()),g.setAttribute("name",h.name),h instanceof Blockly.FieldVariable&&(h=a.workspace.getVariable(h.getValue()))&&
|
||||
(g.setAttribute("id",h.getId()),g.setAttribute("variableType",h.type)),c.appendChild(g))}if(d=a.getCommentText())d=goog.dom.createDom("comment",null,d),"object"==typeof a.comment&&(d.setAttribute("pinned",a.comment.isVisible()),e=a.comment.getBubbleSize(),d.setAttribute("h",e.height),d.setAttribute("w",e.width)),c.appendChild(d);a.data&&(d=goog.dom.createDom("data",null,a.data),c.appendChild(d));for(d=0;e=a.inputList[d];d++){var k;g=!0;e.type!=Blockly.DUMMY_INPUT&&(h=e.connection.targetBlock(),e.type==
|
||||
(g.setAttribute("id",h.getId()),g.setAttribute("variabletype",h.type)),c.appendChild(g))}if(d=a.getCommentText())d=goog.dom.createDom("comment",null,d),"object"==typeof a.comment&&(d.setAttribute("pinned",a.comment.isVisible()),e=a.comment.getBubbleSize(),d.setAttribute("h",e.height),d.setAttribute("w",e.width)),c.appendChild(d);a.data&&(d=goog.dom.createDom("data",null,a.data),c.appendChild(d));for(d=0;e=a.inputList[d];d++){var k;g=!0;e.type!=Blockly.DUMMY_INPUT&&(h=e.connection.targetBlock(),e.type==
|
||||
Blockly.INPUT_VALUE?k=goog.dom.createDom("value"):e.type==Blockly.NEXT_STATEMENT&&(k=goog.dom.createDom("statement")),f=e.connection.getShadowDom(),!f||h&&h.isShadow()||k.appendChild(Blockly.Xml.cloneShadow_(f)),h&&(k.appendChild(Blockly.Xml.blockToDom(h,b)),g=!1),k.setAttribute("name",e.name),g||c.appendChild(k))}a.inputsInlineDefault!=a.inputsInline&&c.setAttribute("inline",a.inputsInline);a.isCollapsed()&&c.setAttribute("collapsed",!0);a.disabled&&c.setAttribute("disabled",!0);a.isDeletable()||
|
||||
a.isShadow()||c.setAttribute("deletable",!1);a.isMovable()||a.isShadow()||c.setAttribute("movable",!1);a.isEditable()||c.setAttribute("editable",!1);if(d=a.getNextBlock())k=goog.dom.createDom("next",null,Blockly.Xml.blockToDom(d,b)),c.appendChild(k);f=a.nextConnection&&a.nextConnection.getShadowDom();!f||d&&d.isShadow()||k.appendChild(Blockly.Xml.cloneShadow_(f));return c};
|
||||
Blockly.Xml.cloneShadow_=function(a){for(var b=a=a.cloneNode(!0),c;b;)if(b.firstChild)b=b.firstChild;else{for(;b&&!b.nextSibling;)c=b,b=b.parentNode,3==c.nodeType&&""==c.data.trim()&&b.firstChild!=c&&goog.dom.removeNode(c);b&&(c=b,b=b.nextSibling,3==c.nodeType&&""==c.data.trim()&&goog.dom.removeNode(c))}return a};Blockly.Xml.domToText=function(a){return(new XMLSerializer).serializeToString(a)};
|
||||
@@ -1141,10 +1141,10 @@ Blockly.Field.stopCache()}b.updateVariableStore(!1);b.setResizesEnabled&&b.setRe
|
||||
Blockly.Xml.appendDomToWorkspace=function(a,b){if(b.hasOwnProperty("scale")){var c=Blockly.BlockSvg.TAB_WIDTH;try{Blockly.BlockSvg.TAB_WIDTH=0;var d=b.getBlocksBoundingBox()}finally{Blockly.BlockSvg.TAB_WIDTH=c}}a=Blockly.Xml.domToWorkspace(a,b);if(d&&d.height){c=d.y+d.height;var e=d.x;var f=Infinity,g=Infinity;for(d=0;d<a.length;d++){var h=b.getBlockById(a[d]).getRelativeToSurfaceXY();h.y<g&&(g=h.y);h.x<f&&(f=h.x)}c=c-g+Blockly.BlockSvg.SEP_SPACE_Y;e-=f;var k;b.RTL&&(k=b.getWidth());for(d=0;d<a.length;d++)b.getBlockById(a[d]).moveBy(b.RTL?
|
||||
k-e:e,c)}return a};
|
||||
Blockly.Xml.domToBlock=function(a,b){if(a instanceof Blockly.Workspace){var c=a;a=b;b=c;console.warn("Deprecated call to Blockly.Xml.domToBlock, swap the arguments.")}Blockly.Events.disable();try{var d=Blockly.Xml.domToBlockHeadless_(a,b);if(b.rendered){d.setConnectionsHidden(!0);for(var e=d.getDescendants(),f=e.length-1;0<=f;f--)e[f].initSvg();for(f=e.length-1;0<=f;f--)e[f].render(!1);setTimeout(function(){d.workspace&&d.setConnectionsHidden(!1)},1);d.updateDisabled();b.resizeContents()}}finally{Blockly.Events.enable()}Blockly.Events.isEnabled()&&Blockly.Events.fire(new Blockly.Events.BlockCreate(d));
|
||||
return d};Blockly.Xml.domToVariables=function(a,b){for(var c=0,d;d=a.children[c];c++){var e=d.getAttribute("type"),f=d.getAttribute("id");d=d.textContent;if(null===e)throw Error("Variable with id, "+f+" is without a type");b.createVariable(d,e,f)}};
|
||||
return d};Blockly.Xml.domToVariables=function(a,b){for(var c=0,d;d=a.children[c];c++){var e=d.getAttribute("type"),f=d.getAttribute("id");d=d.textContent;if(null==e)throw Error("Variable with id, "+f+" is without a type");b.createVariable(d,e,f)}};
|
||||
Blockly.Xml.domToBlockHeadless_=function(a,b){var c=null,d=a.getAttribute("type");goog.asserts.assert(d,"Block type unspecified: %s",a.outerHTML);var e=a.getAttribute("id");c=b.newBlock(d,e);for(var f=null,g=0,h;h=a.childNodes[g];g++)if(3!=h.nodeType){var k=null,n=null;f=0;for(var p;p=h.childNodes[f];f++)1==p.nodeType&&("block"==p.nodeName.toLowerCase()?k=p:"shadow"==p.nodeName.toLowerCase()&&(n=p));!k&&n&&(k=n);f=h.getAttribute("name");switch(h.nodeName.toLowerCase()){case "mutation":c.domToMutation&&
|
||||
(c.domToMutation(h),c.initSvg&&c.initSvg());break;case "comment":c.setCommentText(h.textContent);var m=h.getAttribute("pinned");m&&!c.isInFlyout&&setTimeout(function(){c.comment&&c.comment.setVisible&&c.comment.setVisible("true"==m)},1);f=parseInt(h.getAttribute("w"),10);h=parseInt(h.getAttribute("h"),10);!isNaN(f)&&!isNaN(h)&&c.comment&&c.comment.setVisible&&c.comment.setBubbleSize(f,h);break;case "data":c.data=h.textContent;break;case "title":case "field":k=c.getField(f);n=h.textContent;if(k instanceof
|
||||
Blockly.FieldVariable){p=h.getAttribute("variableType")||"";var l=b.getVariable(n);l||(l=b.createVariable(n,p,h.getAttribute(e)));if(null!==p&&p!==l.type)throw Error("Serialized variable type with id '"+l.getId()+"' had type "+l.type+", and does not match variable field that references it: "+Blockly.Xml.domToText(h)+".");}if(!k){console.warn("Ignoring non-existent field "+f+" in block "+d);break}k.setValue(n);break;case "value":case "statement":h=c.getInput(f);if(!h){console.warn("Ignoring non-existent input "+
|
||||
Blockly.FieldVariable){p=h.getAttribute("variabletype")||"";var l=b.getVariable(n);l||(l=b.createVariable(n,p,h.getAttribute(e)));if(null!=p&&p!==l.type)throw Error("Serialized variable type with id '"+l.getId()+"' had type "+l.type+", and does not match variable field that references it: "+Blockly.Xml.domToText(h)+".");}if(!k){console.warn("Ignoring non-existent field "+f+" in block "+d);break}k.setValue(n);break;case "value":case "statement":h=c.getInput(f);if(!h){console.warn("Ignoring non-existent input "+
|
||||
f+" in block "+d);break}n&&h.connection.setShadowDom(n);k&&(f=Blockly.Xml.domToBlockHeadless_(k,b),f.outputConnection?h.connection.connect(f.outputConnection):f.previousConnection?h.connection.connect(f.previousConnection):goog.asserts.fail("Child block does not have output or previous statement."));break;case "next":n&&c.nextConnection&&c.nextConnection.setShadowDom(n);k&&(goog.asserts.assert(c.nextConnection,"Next statement does not exist."),goog.asserts.assert(!c.nextConnection.isConnected(),"Next statement is already connected."),
|
||||
f=Blockly.Xml.domToBlockHeadless_(k,b),goog.asserts.assert(f.previousConnection,"Next block does not have previous statement."),c.nextConnection.connect(f.previousConnection));break;default:console.warn("Ignoring unknown tag: "+h.nodeName)}}(g=a.getAttribute("inline"))&&c.setInputsInline("true"==g);(g=a.getAttribute("disabled"))&&c.setDisabled("true"==g);(g=a.getAttribute("deletable"))&&c.setDeletable("true"==g);(g=a.getAttribute("movable"))&&c.setMovable("true"==g);(g=a.getAttribute("editable"))&&
|
||||
c.setEditable("true"==g);(g=a.getAttribute("collapsed"))&&c.setCollapsed("true"==g);if("shadow"==a.nodeName.toLowerCase()){a=c.getChildren();for(g=0;b=a[g];g++)goog.asserts.assert(b.isShadow(),"Shadow block not allowed non-shadow child.");goog.asserts.assert(0==c.getVars().length,"Shadow blocks cannot have variable fields.");c.setShadow(!0)}return c};Blockly.Xml.deleteNext=function(a){for(var b=0,c;c=a.childNodes[b];b++)if("next"==c.nodeName.toLowerCase()){a.removeChild(c);break}};
|
||||
@@ -1164,9 +1164,9 @@ Blockly.WorkspaceSvg.prototype.blockDragSurface_=null;Blockly.WorkspaceSvg.proto
|
||||
Blockly.WorkspaceSvg.prototype.getInverseScreenCTM=function(){return this.inverseScreenCTM_};Blockly.WorkspaceSvg.prototype.updateInverseScreenCTM=function(){var a=this.getParentSvg().getScreenCTM();a&&(this.inverseScreenCTM_=a.inverse())};
|
||||
Blockly.WorkspaceSvg.prototype.getSvgXY=function(a){var b=0,c=0,d=1;if(goog.dom.contains(this.getCanvas(),a)||goog.dom.contains(this.getBubbleCanvas(),a))d=this.scale;do{var e=Blockly.utils.getRelativeXY(a);if(a==this.getCanvas()||a==this.getBubbleCanvas())d=1;b+=e.x*d;c+=e.y*d;a=a.parentNode}while(a&&a!=this.getParentSvg());return new goog.math.Coordinate(b,c)};Blockly.WorkspaceSvg.prototype.getOriginOffsetInPixels=function(){return Blockly.utils.getInjectionDivXY_(this.svgBlockCanvas_)};
|
||||
Blockly.WorkspaceSvg.prototype.setResizeHandlerWrapper=function(a){this.resizeHandlerWrapper_=a};
|
||||
Blockly.WorkspaceSvg.prototype.createDom=function(a){this.svgGroup_=Blockly.utils.createSvgElement("g",{"class":"blocklyWorkspace"},null);a&&(this.svgBackground_=Blockly.utils.createSvgElement("rect",{height:"100%",width:"100%","class":a},this.svgGroup_),"blocklyMainBackground"==a&&this.grid_&&(this.svgBackground_.style.fill="url(#"+this.grid_.getPatternId()+")"));this.svgBlockCanvas_=Blockly.utils.createSvgElement("g",{"class":"blocklyBlockCanvas"},this.svgGroup_,this);this.svgBubbleCanvas_=Blockly.utils.createSvgElement("g",
|
||||
{"class":"blocklyBubbleCanvas"},this.svgGroup_,this);a=Blockly.Scrollbar.scrollbarThickness;this.options.hasTrashcan&&(a=this.addTrashcan_(a));this.options.zoomOptions&&this.options.zoomOptions.controls&&this.addZoomControls_(a);this.isFlyout||(Blockly.bindEventWithChecks_(this.svgGroup_,"mousedown",this,this.onMouseDown_),this.options.zoomOptions&&this.options.zoomOptions.wheel&&Blockly.bindEventWithChecks_(this.svgGroup_,"wheel",this,this.onMouseWheel_));this.options.hasCategories&&(this.toolbox_=
|
||||
new Blockly.Toolbox(this));this.grid_&&this.grid_.update(this.scale);this.recordDeleteAreas();return this.svgGroup_};
|
||||
Blockly.WorkspaceSvg.prototype.createDom=function(a){this.svgGroup_=Blockly.utils.createSvgElement("g",{"class":"blocklyWorkspace"},null);a&&(this.svgBackground_=Blockly.utils.createSvgElement("rect",{height:"100%",width:"100%","class":a},this.svgGroup_),"blocklyMainBackground"==a&&this.grid_&&(this.svgBackground_.style.fill="url(#"+this.grid_.getPatternId()+")"));this.svgBlockCanvas_=Blockly.utils.createSvgElement("g",{"class":"blocklyBlockCanvas"},this.svgGroup_);this.svgBubbleCanvas_=Blockly.utils.createSvgElement("g",
|
||||
{"class":"blocklyBubbleCanvas"},this.svgGroup_);a=Blockly.Scrollbar.scrollbarThickness;this.options.hasTrashcan&&(a=this.addTrashcan_(a));this.options.zoomOptions&&this.options.zoomOptions.controls&&this.addZoomControls_(a);this.isFlyout||(Blockly.bindEventWithChecks_(this.svgGroup_,"mousedown",this,this.onMouseDown_),this.options.zoomOptions&&this.options.zoomOptions.wheel&&Blockly.bindEventWithChecks_(this.svgGroup_,"wheel",this,this.onMouseWheel_));this.options.hasCategories&&(this.toolbox_=new Blockly.Toolbox(this));
|
||||
this.grid_&&this.grid_.update(this.scale);this.recordDeleteAreas();return this.svgGroup_};
|
||||
Blockly.WorkspaceSvg.prototype.dispose=function(){this.rendered=!1;this.currentGesture_&&this.currentGesture_.cancel();Blockly.WorkspaceSvg.superClass_.dispose.call(this);this.svgGroup_&&(goog.dom.removeNode(this.svgGroup_),this.svgGroup_=null);this.svgBubbleCanvas_=this.svgBlockCanvas_=null;this.toolbox_&&(this.toolbox_.dispose(),this.toolbox_=null);this.flyout_&&(this.flyout_.dispose(),this.flyout_=null);this.trashcan&&(this.trashcan.dispose(),this.trashcan=null);this.scrollbar&&(this.scrollbar.dispose(),
|
||||
this.scrollbar=null);this.zoomControls_&&(this.zoomControls_.dispose(),this.zoomControls_=null);this.audioManager_&&(this.audioManager_.dispose(),this.audioManager_=null);this.grid_&&(this.grid_.dispose(),this.grid_=null);this.toolboxCategoryCallbacks_&&(this.toolboxCategoryCallbacks_=null);this.flyoutButtonCallbacks_&&(this.flyoutButtonCallbacks_=null);this.options.parentWorkspace||goog.dom.removeNode(this.getParentSvg().parentNode);this.resizeHandlerWrapper_&&(Blockly.unbindEvent_(this.resizeHandlerWrapper_),
|
||||
this.resizeHandlerWrapper_=null)};Blockly.WorkspaceSvg.prototype.newBlock=function(a,b){return new Blockly.BlockSvg(this,a,b)};Blockly.WorkspaceSvg.prototype.addTrashcan_=function(a){this.trashcan=new Blockly.Trashcan(this);var b=this.trashcan.createDom();this.svgGroup_.insertBefore(b,this.svgBlockCanvas_);return this.trashcan.init(a)};
|
||||
@@ -1174,7 +1174,7 @@ Blockly.WorkspaceSvg.prototype.addZoomControls_=function(a){this.zoomControls_=n
|
||||
Blockly.WorkspaceSvg.prototype.addFlyout_=function(a){var b={disabledPatternId:this.options.disabledPatternId,parentWorkspace:this,RTL:this.RTL,oneBasedIndex:this.options.oneBasedIndex,horizontalLayout:this.horizontalLayout,toolboxPosition:this.options.toolboxPosition};this.flyout_=null;this.flyout_=this.horizontalLayout?new Blockly.HorizontalFlyout(b):new Blockly.VerticalFlyout(b);this.flyout_.autoClose=!1;return this.flyout_.createDom(a)};
|
||||
Blockly.WorkspaceSvg.prototype.getFlyout_=function(){return this.flyout_?this.flyout_:this.toolbox_?this.toolbox_.flyout_:null};Blockly.WorkspaceSvg.prototype.updateScreenCalculations_=function(){this.updateInverseScreenCTM();this.recordDeleteAreas()};Blockly.WorkspaceSvg.prototype.resizeContents=function(){this.resizesEnabled_&&this.rendered&&(this.scrollbar&&this.scrollbar.resize(),this.updateInverseScreenCTM())};
|
||||
Blockly.WorkspaceSvg.prototype.resize=function(){this.toolbox_&&this.toolbox_.position();this.flyout_&&this.flyout_.position();this.trashcan&&this.trashcan.position();this.zoomControls_&&this.zoomControls_.position();this.scrollbar&&this.scrollbar.resize();this.updateScreenCalculations_()};Blockly.WorkspaceSvg.prototype.updateScreenCalculationsIfScrolled=function(){var a=goog.dom.getDocumentScroll();goog.math.Coordinate.equals(this.lastRecordedPageScroll_,a)||(this.lastRecordedPageScroll_=a,this.updateScreenCalculations_())};
|
||||
Blockly.WorkspaceSvg.prototype.getCanvas=function(){return this.svgBlockCanvas_};Blockly.WorkspaceSvg.prototype.getBubbleCanvas=function(){return this.svgBubbleCanvas_};Blockly.WorkspaceSvg.prototype.getParentSvg=function(){if(this.cachedParentSvg_)return this.cachedParentSvg_;for(var a=this.svgGroup_;a;){if("svg"==a.tagName)return this.cachedParentSvg_=a;a=a.parentNode}return null};
|
||||
Blockly.WorkspaceSvg.prototype.getCanvas=function(){return this.svgBlockCanvas_};Blockly.WorkspaceSvg.prototype.getBubbleCanvas=function(){return this.svgBubbleCanvas_};Blockly.WorkspaceSvg.prototype.getParentSvg=function(){if(this.cachedParentSvg_)return this.cachedParentSvg_;for(var a=this.svgGroup_;a;){if("svg"==a.tagName)return this.cachedParentSvg_=a;a=a.parentElement}return null};
|
||||
Blockly.WorkspaceSvg.prototype.translate=function(a,b){if(this.useWorkspaceDragSurface_&&this.isDragSurfaceActive_)this.workspaceDragSurface_.translateSurface(a,b);else{var c="translate("+a+","+b+") scale("+this.scale+")";this.svgBlockCanvas_.setAttribute("transform",c);this.svgBubbleCanvas_.setAttribute("transform",c)}this.blockDragSurface_&&this.blockDragSurface_.translateAndScaleGroup(a,b,this.scale)};
|
||||
Blockly.WorkspaceSvg.prototype.resetDragSurface=function(){if(this.useWorkspaceDragSurface_){this.isDragSurfaceActive_=!1;var a=this.workspaceDragSurface_.getSurfaceTranslation();this.workspaceDragSurface_.clearAndHide(this.svgGroup_);a="translate("+a.x+","+a.y+") scale("+this.scale+")";this.svgBlockCanvas_.setAttribute("transform",a);this.svgBubbleCanvas_.setAttribute("transform",a)}};
|
||||
Blockly.WorkspaceSvg.prototype.setupDragSurface=function(){if(this.useWorkspaceDragSurface_&&!this.isDragSurfaceActive_){this.isDragSurfaceActive_=!0;var a=this.svgBlockCanvas_.previousSibling,b=this.getParentSvg().getAttribute("width"),c=this.getParentSvg().getAttribute("height"),d=Blockly.utils.getRelativeXY(this.svgBlockCanvas_);this.workspaceDragSurface_.setContentsAndShow(this.svgBlockCanvas_,this.svgBubbleCanvas_,a,b,c,this.scale);this.workspaceDragSurface_.translateSurface(d.x,d.y)}};
|
||||
@@ -1188,7 +1188,7 @@ Blockly.WorkspaceSvg.prototype.deleteVariable=function(a){Blockly.WorkspaceSvg.s
|
||||
Blockly.WorkspaceSvg.prototype.recordDeleteAreas=function(){this.deleteAreaTrash_=this.trashcan?this.trashcan.getClientRect():null;this.deleteAreaToolbox_=this.flyout_?this.flyout_.getClientRect():this.toolbox_?this.toolbox_.getClientRect():null};
|
||||
Blockly.WorkspaceSvg.prototype.isDeleteArea=function(a){a=new goog.math.Coordinate(a.clientX,a.clientY);return this.deleteAreaTrash_&&this.deleteAreaTrash_.contains(a)?Blockly.DELETE_AREA_TRASH:this.deleteAreaToolbox_&&this.deleteAreaToolbox_.contains(a)?Blockly.DELETE_AREA_TOOLBOX:Blockly.DELETE_AREA_NONE};Blockly.WorkspaceSvg.prototype.onMouseDown_=function(a){var b=this.getGesture(a);b&&b.handleWsStart(a,this)};
|
||||
Blockly.WorkspaceSvg.prototype.startDrag=function(a,b){a=Blockly.utils.mouseToSvg(a,this.getParentSvg(),this.getInverseScreenCTM());a.x/=this.scale;a.y/=this.scale;this.dragDeltaXY_=goog.math.Coordinate.difference(b,a)};Blockly.WorkspaceSvg.prototype.moveDrag=function(a){a=Blockly.utils.mouseToSvg(a,this.getParentSvg(),this.getInverseScreenCTM());a.x/=this.scale;a.y/=this.scale;return goog.math.Coordinate.sum(this.dragDeltaXY_,a)};
|
||||
Blockly.WorkspaceSvg.prototype.isDragging=function(){return this.currentGesture_&&this.currentGesture_.isDragging()};Blockly.WorkspaceSvg.prototype.isDraggable=function(){return!!this.scrollbar};Blockly.WorkspaceSvg.prototype.onMouseWheel_=function(a){this.currentGesture_&&this.currentGesture_.cancel();var b=-a.deltaY/50,c=Blockly.utils.mouseToSvg(a,this.getParentSvg(),this.getInverseScreenCTM());this.zoom(c.x,c.y,b);a.preventDefault()};
|
||||
Blockly.WorkspaceSvg.prototype.isDragging=function(){return null!=this.currentGesture_&&this.currentGesture_.isDragging()};Blockly.WorkspaceSvg.prototype.isDraggable=function(){return!!this.scrollbar};Blockly.WorkspaceSvg.prototype.onMouseWheel_=function(a){this.currentGesture_&&this.currentGesture_.cancel();var b=-a.deltaY/50,c=Blockly.utils.mouseToSvg(a,this.getParentSvg(),this.getInverseScreenCTM());this.zoom(c.x,c.y,b);a.preventDefault()};
|
||||
Blockly.WorkspaceSvg.prototype.getBlocksBoundingBox=function(){var a=this.getTopBlocks(!1);if(!a.length)return{x:0,y:0,width:0,height:0};for(var b=a[0].getBoundingRectangle(),c=1;c<a.length;c++){var d=a[c].getBoundingRectangle();d.topLeft.x<b.topLeft.x&&(b.topLeft.x=d.topLeft.x);d.bottomRight.x>b.bottomRight.x&&(b.bottomRight.x=d.bottomRight.x);d.topLeft.y<b.topLeft.y&&(b.topLeft.y=d.topLeft.y);d.bottomRight.y>b.bottomRight.y&&(b.bottomRight.y=d.bottomRight.y)}return{x:b.topLeft.x,y:b.topLeft.y,width:b.bottomRight.x-
|
||||
b.topLeft.x,height:b.bottomRight.y-b.topLeft.y}};Blockly.WorkspaceSvg.prototype.cleanUp=function(){this.setResizesEnabled(!1);Blockly.Events.setGroup(!0);for(var a=this.getTopBlocks(!0),b=0,c=0,d;d=a[c];c++){var e=d.getRelativeToSurfaceXY();d.moveBy(-e.x,b-e.y);d.snapToGrid();b=d.getRelativeToSurfaceXY().y+d.getHeightWidth().height+Blockly.BlockSvg.MIN_BLOCK_Y}Blockly.Events.setGroup(!1);this.setResizesEnabled(!0)};
|
||||
Blockly.WorkspaceSvg.prototype.showContextMenu_=function(a){function b(a){if(a.isDeletable())l=l.concat(a.getDescendants());else{a=a.getChildren();for(var c=0;c<a.length;c++)b(a[c])}}function c(){Blockly.Events.setGroup(f);var a=l.shift();a&&(a.workspace?(a.dispose(!1,!0),setTimeout(c,10)):c());Blockly.Events.setGroup(!1)}if(!this.options.readOnly&&!this.isFlyout){var d=[],e=this.getTopBlocks(!0),f=Blockly.utils.genUid(),g=this,h={};h.text=Blockly.Msg.UNDO;h.enabled=0<this.undoStack_.length;h.callback=
|
||||
@@ -1236,15 +1236,15 @@ Blockly.Block.obtain=function(a,b){console.warn("Deprecated call to Blockly.Bloc
|
||||
Blockly.Block.prototype.dispose=function(a){if(this.workspace){this.onchangeWrapper_&&this.workspace.removeChangeListener(this.onchangeWrapper_);this.unplug(a);Blockly.Events.isEnabled()&&Blockly.Events.fire(new Blockly.Events.BlockDelete(this));Blockly.Events.disable();try{this.workspace&&(this.workspace.removeTopBlock(this),delete this.workspace.blockDB_[this.id],this.workspace=null);for(var b=this.childBlocks_.length-1;0<=b;b--)this.childBlocks_[b].dispose(!1);b=0;for(var c;c=this.inputList[b];b++)c.dispose();
|
||||
this.inputList.length=0;var d=this.getConnections_(!0);for(b=0;b<d.length;b++){var e=d[b];e.isConnected()&&e.disconnect();d[b].dispose()}}finally{Blockly.Events.enable()}}};
|
||||
Blockly.Block.prototype.unplug=function(a){if(this.outputConnection)this.outputConnection.isConnected()&&this.outputConnection.disconnect();else if(this.previousConnection){var b=null;this.previousConnection.isConnected()&&(b=this.previousConnection.targetConnection,this.previousConnection.disconnect());var c=this.getNextBlock();a&&c&&(a=this.nextConnection.targetConnection,a.disconnect(),b&&b.checkType_(a)&&b.connect(a))}};
|
||||
Blockly.Block.prototype.getConnections_=function(){var a=[];this.outputConnection&&a.push(this.outputConnection);this.previousConnection&&a.push(this.previousConnection);this.nextConnection&&a.push(this.nextConnection);for(var b=0,c;c=this.inputList[b];b++)c.connection&&a.push(c.connection);return a};Blockly.Block.prototype.lastConnectionInStack_=function(){for(var a=this.nextConnection;a;){var b=a.targetBlock();if(!b)return a;a=b.nextConnection}return null};
|
||||
Blockly.Block.prototype.bumpNeighbours_=function(){console.warn("Not expected to reach this bumpNeighbours_ function. The BlockSvg function for bumpNeighbours_ was expected to be called instead.")};Blockly.Block.prototype.getParent=function(){return this.parentBlock_};Blockly.Block.prototype.getInputWithBlock=function(a){for(var b=0,c;c=this.inputList[b];b++)if(c.connection&&c.connection.targetBlock()==a)return c;return null};
|
||||
Blockly.Block.prototype.getSurroundParent=function(){var a=this;do{var b=a;a=a.getParent();if(!a)return null}while(a.getNextBlock()==b);return a};Blockly.Block.prototype.getNextBlock=function(){return this.nextConnection&&this.nextConnection.targetBlock()};Blockly.Block.prototype.getRootBlock=function(){var a=this;do{var b=a;a=b.parentBlock_}while(a);return b};Blockly.Block.prototype.getChildren=function(){return this.childBlocks_};
|
||||
Blockly.Block.prototype.getConnections_=function(a){a=[];this.outputConnection&&a.push(this.outputConnection);this.previousConnection&&a.push(this.previousConnection);this.nextConnection&&a.push(this.nextConnection);for(var b=0,c;c=this.inputList[b];b++)c.connection&&a.push(c.connection);return a};Blockly.Block.prototype.lastConnectionInStack_=function(){for(var a=this.nextConnection;a;){var b=a.targetBlock();if(!b)return a;a=b.nextConnection}return null};Blockly.Block.prototype.bumpNeighbours_=function(){console.warn("Not expected to reach this bumpNeighbours_ function. The BlockSvg function for bumpNeighbours_ was expected to be called instead.")};
|
||||
Blockly.Block.prototype.getParent=function(){return this.parentBlock_};Blockly.Block.prototype.getInputWithBlock=function(a){for(var b=0,c;c=this.inputList[b];b++)if(c.connection&&c.connection.targetBlock()==a)return c;return null};Blockly.Block.prototype.getSurroundParent=function(){var a=this;do{var b=a;a=a.getParent();if(!a)return null}while(a.getNextBlock()==b);return a};Blockly.Block.prototype.getNextBlock=function(){return this.nextConnection&&this.nextConnection.targetBlock()};
|
||||
Blockly.Block.prototype.getRootBlock=function(){var a=this;do{var b=a;a=b.parentBlock_}while(a);return b};Blockly.Block.prototype.getChildren=function(){return this.childBlocks_};
|
||||
Blockly.Block.prototype.setParent=function(a){if(a!=this.parentBlock_){if(this.parentBlock_){goog.array.remove(this.parentBlock_.childBlocks_,this);if(this.previousConnection&&this.previousConnection.isConnected())throw"Still connected to previous block.";if(this.outputConnection&&this.outputConnection.isConnected())throw"Still connected to parent block.";this.parentBlock_=null}else this.workspace.removeTopBlock(this);(this.parentBlock_=a)?a.childBlocks_.push(this):this.workspace.addTopBlock(this)}};
|
||||
Blockly.Block.prototype.getDescendants=function(){for(var a=[this],b,c=0;b=this.childBlocks_[c];c++)a.push.apply(a,b.getDescendants());return a};Blockly.Block.prototype.isDeletable=function(){return this.deletable_&&!this.isShadow_&&!(this.workspace&&this.workspace.options.readOnly)};Blockly.Block.prototype.setDeletable=function(a){this.deletable_=a};Blockly.Block.prototype.isMovable=function(){return this.movable_&&!this.isShadow_&&!(this.workspace&&this.workspace.options.readOnly)};
|
||||
Blockly.Block.prototype.setMovable=function(a){this.movable_=a};Blockly.Block.prototype.isShadow=function(){return this.isShadow_};Blockly.Block.prototype.setShadow=function(a){this.isShadow_=a};Blockly.Block.prototype.isEditable=function(){return this.editable_&&!(this.workspace&&this.workspace.options.readOnly)};Blockly.Block.prototype.setEditable=function(a){this.editable_=a;a=0;for(var b;b=this.inputList[a];a++)for(var c=0,d;d=b.fieldRow[c];c++)d.updateEditable()};
|
||||
Blockly.Block.prototype.setConnectionsHidden=function(a){if(!a&&this.isCollapsed()){if(this.outputConnection&&this.outputConnection.setHidden(a),this.previousConnection&&this.previousConnection.setHidden(a),this.nextConnection){this.nextConnection.setHidden(a);var b=this.nextConnection.targetBlock();b&&b.setConnectionsHidden(a)}}else for(var c=this.getConnections_(!0),d=0;b=c[d];d++)b.setHidden(a),b.isSuperior()&&(b=b.targetBlock())&&b.setConnectionsHidden(a)};
|
||||
Blockly.Block.prototype.setHelpUrl=function(a){this.helpUrl=a};Blockly.Block.prototype.setTooltip=function(a){this.tooltip=a};Blockly.Block.prototype.getColour=function(){return this.colour_};Blockly.Block.prototype.getHue=function(){return this.hue_};
|
||||
Blockly.Block.prototype.setColour=function(a){var b=Number(a);if(!isNaN(b)&&0<=b&&360>=b)this.hue_=b,this.colour_=Blockly.hueToRgb(b);else if(goog.isString(a)&&a.match(/^#[0-9a-fA-F]{6}$/))this.colour_=a,this.hue_=null;else throw"Invalid colour: "+a;};
|
||||
Blockly.Block.prototype.setColour=function(a){var b=Number(a);if(!isNaN(b)&&0<=b&&360>=b)this.hue_=b,this.colour_=Blockly.hueToRgb(b);else if(goog.isString(a)&&/^#[0-9a-fA-F]{6}$/.test(a))this.colour_=a,this.hue_=null;else throw"Invalid colour: "+a;};
|
||||
Blockly.Block.prototype.setOnChange=function(a){if(a&&!goog.isFunction(a))throw Error("onchange must be a function.");this.onchangeWrapper_&&this.workspace.removeChangeListener(this.onchangeWrapper_);if(this.onchange=a)this.onchangeWrapper_=a.bind(this),this.workspace.addChangeListener(this.onchangeWrapper_)};Blockly.Block.prototype.getField=function(a){for(var b=0,c;c=this.inputList[b];b++)for(var d=0,e;e=c.fieldRow[d];d++)if(e.name===a)return e;return null};
|
||||
Blockly.Block.prototype.getVars=function(){for(var a=[],b=0,c;c=this.inputList[b];b++)for(var d=0,e;e=c.fieldRow[d];d++)e instanceof Blockly.FieldVariable&&a.push(e.getValue());return a};Blockly.Block.prototype.renameVar=function(a,b){for(var c=0,d;d=this.inputList[c];c++)for(var e=0,f;f=d.fieldRow[e];e++)f instanceof Blockly.FieldVariable&&Blockly.Names.equals(a,f.getValue())&&f.setValue(b)};Blockly.Block.prototype.getFieldValue=function(a){return(a=this.getField(a))?a.getValue():null};
|
||||
Blockly.Block.prototype.setFieldValue=function(a,b){var c=this.getField(b);goog.asserts.assertObject(c,'Field "%s" not found.',b);c.setValue(a)};
|
||||
@@ -1271,14 +1271,16 @@ Blockly.Block.prototype.appendInput_=function(a,b){var c=null;if(a==Blockly.INPU
|
||||
Blockly.Block.prototype.moveInputBefore=function(a,b){if(a!=b){for(var c=-1,d=b?-1:this.inputList.length,e=0,f;f=this.inputList[e];e++)if(f.name==a){if(c=e,-1!=d)break}else if(b&&f.name==b&&(d=e,-1!=c))break;goog.asserts.assert(-1!=c,'Named input "%s" not found.',a);goog.asserts.assert(-1!=d,'Reference input "%s" not found.',b);this.moveNumberedInputBefore(c,d)}};
|
||||
Blockly.Block.prototype.moveNumberedInputBefore=function(a,b){goog.asserts.assert(a!=b,"Can't move input to itself.");goog.asserts.assert(a<this.inputList.length,"Input index "+a+" out of bounds.");goog.asserts.assert(b<=this.inputList.length,"Reference input "+b+" out of bounds.");var c=this.inputList[a];this.inputList.splice(a,1);a<b&&b--;this.inputList.splice(b,0,c)};
|
||||
Blockly.Block.prototype.removeInput=function(a,b){for(var c=0,d;d=this.inputList[c];c++)if(d.name==a){d.connection&&d.connection.isConnected()&&(d.connection.setShadowDom(null),a=d.connection.targetBlock(),a.isShadow()?a.dispose():a.unplug());d.dispose();this.inputList.splice(c,1);return}b||goog.asserts.fail('Input "%s" not found.',a)};Blockly.Block.prototype.getInput=function(a){for(var b=0,c;c=this.inputList[b];b++)if(c.name==a)return c;return null};
|
||||
Blockly.Block.prototype.getInputTargetBlock=function(a){return(a=this.getInput(a))&&a.connection&&a.connection.targetBlock()};Blockly.Block.prototype.getCommentText=function(){return this.comment||""};Blockly.Block.prototype.setCommentText=function(a){this.comment!=a&&(Blockly.Events.fire(new Blockly.Events.BlockChange(this,"comment",null,this.comment,a||"")),this.comment=a)};Blockly.Block.prototype.setWarningText=function(){};Blockly.Block.prototype.setMutator=function(){};
|
||||
Blockly.Block.prototype.getInputTargetBlock=function(a){return(a=this.getInput(a))&&a.connection&&a.connection.targetBlock()};Blockly.Block.prototype.getCommentText=function(){return this.comment||""};Blockly.Block.prototype.setCommentText=function(a){this.comment!=a&&(Blockly.Events.fire(new Blockly.Events.BlockChange(this,"comment",null,this.comment,a||"")),this.comment=a)};Blockly.Block.prototype.setWarningText=function(a,b){};Blockly.Block.prototype.setMutator=function(a){};
|
||||
Blockly.Block.prototype.getRelativeToSurfaceXY=function(){return this.xy_};Blockly.Block.prototype.moveBy=function(a,b){goog.asserts.assert(!this.parentBlock_,"Block has parent.");var c=new Blockly.Events.BlockMove(this);this.xy_.translate(a,b);c.recordNew();Blockly.Events.fire(c)};Blockly.Block.prototype.makeConnection_=function(a){return new Blockly.Connection(this,a)};
|
||||
Blockly.Block.prototype.allInputsFilled=function(a){void 0===a&&(a=!0);if(!a&&this.isShadow())return!1;for(var b=0,c;c=this.inputList[b];b++)if(c.connection&&(c=c.connection.targetBlock(),!c||!c.allInputsFilled(a)))return!1;return(b=this.getNextBlock())?b.allInputsFilled(a):!0};Blockly.Block.prototype.toDevString=function(){var a=this.type?'"'+this.type+'" block':"Block";this.id&&(a+=' (id="'+this.id+'")');return a};Blockly.utils.uiMenu={};Blockly.utils.uiMenu.getSize=function(a){a=a.getElement();var b=goog.style.getSize(a);b.height=a.scrollHeight;return b};Blockly.utils.uiMenu.adjustBBoxesForRTL=function(a,b,c){b.left+=c.width;b.right+=c.width;a.left+=c.width;a.right+=c.width};Blockly.ContextMenu={};Blockly.ContextMenu.currentBlock=null;Blockly.ContextMenu.eventWrapper_=null;Blockly.ContextMenu.show=function(a,b,c){Blockly.WidgetDiv.show(Blockly.ContextMenu,c,null);if(b.length){var d=Blockly.ContextMenu.populate_(b,c);goog.events.listen(d,goog.ui.Component.EventType.ACTION,Blockly.ContextMenu.hide);Blockly.ContextMenu.position_(d,a,c);setTimeout(function(){d.getElement().focus()},1);Blockly.ContextMenu.currentBlock=null}else Blockly.ContextMenu.hide()};
|
||||
Blockly.ContextMenu.populate_=function(a,b){var c=new goog.ui.Menu;c.setRightToLeft(b);for(var d=0,e;e=a[d];d++){var f=new goog.ui.MenuItem(e.text);f.setRightToLeft(b);c.addChild(f,!0);f.setEnabled(e.enabled);e.enabled&&(goog.events.listen(f,goog.ui.Component.EventType.ACTION,e.callback),f.handleContextMenu=function(){goog.events.dispatchEvent(this,goog.ui.Component.EventType.ACTION)})}return c};
|
||||
Blockly.ContextMenu.position_=function(a,b,c){var d=Blockly.utils.getViewportBBox();b={top:b.clientY+d.top,bottom:b.clientY+d.top,left:b.clientX+d.left,right:b.clientX+d.left};Blockly.ContextMenu.createWidget_(a);var e=Blockly.utils.uiMenu.getSize(a);c&&Blockly.utils.uiMenu.adjustBBoxesForRTL(d,b,e);Blockly.WidgetDiv.positionWithAnchor(d,b,e,c);a.getElement().focus()};
|
||||
Blockly.ContextMenu.createWidget_=function(a){a.render(Blockly.WidgetDiv.DIV);var b=a.getElement();Blockly.utils.addClass(b,"blocklyContextMenu");Blockly.bindEventWithChecks_(b,"contextmenu",null,Blockly.utils.noEvent);a.setAllowAutoFocus(!0)};Blockly.ContextMenu.hide=function(){Blockly.WidgetDiv.hideIfOwner(Blockly.ContextMenu);Blockly.ContextMenu.currentBlock=null;Blockly.ContextMenu.eventWrapper_&&Blockly.unbindEvent_(Blockly.ContextMenu.eventWrapper_)};
|
||||
Blockly.ContextMenu.callbackFactory=function(a,b){return function(){Blockly.Events.disable();try{var c=Blockly.Xml.domToBlock(b,a.workspace),d=a.getRelativeToSurfaceXY();d.x=a.RTL?d.x-Blockly.SNAP_RADIUS:d.x+Blockly.SNAP_RADIUS;d.y+=2*Blockly.SNAP_RADIUS;c.moveBy(d.x,d.y)}finally{Blockly.Events.enable()}Blockly.Events.isEnabled()&&!c.isShadow()&&Blockly.Events.fire(new Blockly.Events.BlockCreate(c));c.select()}};Blockly.BlockSvg=function(a,b,c){this.svgGroup_=Blockly.utils.createSvgElement("g",{},null);this.svgGroup_.translate_="";this.svgPathDark_=Blockly.utils.createSvgElement("path",{"class":"blocklyPathDark",transform:"translate(1,1)"},this.svgGroup_);this.svgPath_=Blockly.utils.createSvgElement("path",{"class":"blocklyPath"},this.svgGroup_);this.svgPathLight_=Blockly.utils.createSvgElement("path",{"class":"blocklyPathLight"},this.svgGroup_);this.svgPath_.tooltip=this;this.rendered=!1;this.useDragSurface_=
|
||||
Blockly.utils.is3dSupported()&&!!a.blockDragSurface_;Blockly.Tooltip.bindMouseEvents(this.svgPath_);Blockly.BlockSvg.superClass_.constructor.call(this,a,b,c)};goog.inherits(Blockly.BlockSvg,Blockly.Block);Blockly.BlockSvg.prototype.height=0;Blockly.BlockSvg.prototype.width=0;Blockly.BlockSvg.prototype.dragStartXY_=null;Blockly.BlockSvg.INLINE=-1;
|
||||
Blockly.ContextMenu.callbackFactory=function(a,b){return function(){Blockly.Events.disable();try{var c=Blockly.Xml.domToBlock(b,a.workspace),d=a.getRelativeToSurfaceXY();d.x=a.RTL?d.x-Blockly.SNAP_RADIUS:d.x+Blockly.SNAP_RADIUS;d.y+=2*Blockly.SNAP_RADIUS;c.moveBy(d.x,d.y)}finally{Blockly.Events.enable()}Blockly.Events.isEnabled()&&!c.isShadow()&&Blockly.Events.fire(new Blockly.Events.BlockCreate(c));c.select()}};
|
||||
Blockly.ContextMenu.blockDeleteOption=function(a){var b=a.getDescendants(!0).length,c=a.getNextBlock();c&&(b-=c.getDescendants(!0).length);return{text:1==b?Blockly.Msg.DELETE_BLOCK:Blockly.Msg.DELETE_X_BLOCKS.replace("%1",String(b)),enabled:!0,callback:function(){Blockly.Events.setGroup(!0);a.dispose(!0,!0);Blockly.Events.setGroup(!1)}}};Blockly.ContextMenu.blockHelpOption=function(a){return{enabled:!(goog.isFunction(a.helpUrl)?!a.helpUrl():!a.helpUrl),text:Blockly.Msg.HELP,callback:function(){a.showHelp_()}}};
|
||||
Blockly.ContextMenu.blockDuplicateOption=function(a){var b=!0;a.getDescendants().length>a.workspace.remainingCapacity()&&(b=!1);return{text:Blockly.Msg.DUPLICATE_BLOCK,enabled:b,callback:function(){Blockly.duplicate_(a)}}};Blockly.ContextMenu.blockCommentOption=function(a){var b={enabled:!goog.userAgent.IE};a.comment?(b.text=Blockly.Msg.REMOVE_COMMENT,b.callback=function(){a.setCommentText(null)}):(b.text=Blockly.Msg.ADD_COMMENT,b.callback=function(){a.setCommentText("")});return b};Blockly.BlockSvg=function(a,b,c){this.svgGroup_=Blockly.utils.createSvgElement("g",{},null);this.svgGroup_.translate_="";this.svgPathDark_=Blockly.utils.createSvgElement("path",{"class":"blocklyPathDark",transform:"translate(1,1)"},this.svgGroup_);this.svgPath_=Blockly.utils.createSvgElement("path",{"class":"blocklyPath"},this.svgGroup_);this.svgPathLight_=Blockly.utils.createSvgElement("path",{"class":"blocklyPathLight"},this.svgGroup_);this.svgPath_.tooltip=this;this.rendered=!1;this.useDragSurface_=
|
||||
Blockly.utils.is3dSupported()&&!!a.blockDragSurface_;Blockly.Tooltip.bindMouseEvents(this.svgPath_);Blockly.BlockSvg.superClass_.constructor.call(this,a,b,c)};goog.inherits(Blockly.BlockSvg,Blockly.Block);Blockly.BlockSvg.prototype.height=0;Blockly.BlockSvg.prototype.width=0;Blockly.BlockSvg.prototype.dragStartXY_=null;Blockly.BlockSvg.prototype.warningTextDb_=null;Blockly.BlockSvg.INLINE=-1;
|
||||
Blockly.BlockSvg.prototype.initSvg=function(){goog.asserts.assert(this.workspace.rendered,"Workspace is headless.");for(var a=0,b;b=this.inputList[a];a++)b.init();b=this.getIcons();for(a=0;a<b.length;a++)b[a].createIcon();this.updateColour();this.updateMovable();this.workspace.options.readOnly||this.eventsInit_||Blockly.bindEventWithChecks_(this.getSvgRoot(),"mousedown",this,this.onMouseDown_);this.eventsInit_=!0;this.getSvgRoot().parentNode||this.workspace.getCanvas().appendChild(this.getSvgRoot())};
|
||||
Blockly.BlockSvg.prototype.select=function(){if(this.isShadow()&&this.getParent())this.getParent().select();else if(Blockly.selected!=this){var a=null;if(Blockly.selected){a=Blockly.selected.id;Blockly.Events.disable();try{Blockly.selected.unselect()}finally{Blockly.Events.enable()}}a=new Blockly.Events.Ui(null,"selected",a,this.id);a.workspaceId=this.workspace.id;Blockly.Events.fire(a);Blockly.selected=this;this.addSelect()}};
|
||||
Blockly.BlockSvg.prototype.unselect=function(){if(Blockly.selected==this){var a=new Blockly.Events.Ui(null,"selected",this.id,null);a.workspaceId=this.workspace.id;Blockly.Events.fire(a);Blockly.selected=null;this.removeSelect()}};Blockly.BlockSvg.prototype.mutator=null;Blockly.BlockSvg.prototype.comment=null;Blockly.BlockSvg.prototype.warning=null;
|
||||
@@ -1293,16 +1295,15 @@ Blockly.BlockSvg.prototype.getBoundingRectangle=function(){var a=this.getRelativ
|
||||
Blockly.BlockSvg.prototype.setCollapsed=function(a){if(this.collapsed_!=a){for(var b=[],c=0,d;d=this.inputList[c];c++)b.push.apply(b,d.setVisible(!a));if(a){d=this.getIcons();for(c=0;c<d.length;c++)d[c].setVisible(!1);c=this.toString(Blockly.COLLAPSE_CHARS);this.appendDummyInput("_TEMP_COLLAPSED_INPUT").appendField(c).init()}else this.removeInput("_TEMP_COLLAPSED_INPUT"),this.setWarningText(null);Blockly.BlockSvg.superClass_.setCollapsed.call(this,a);b.length||(b[0]=this);if(this.rendered)for(c=0;a=
|
||||
b[c];c++)a.render()}};Blockly.BlockSvg.prototype.tab=function(a,b){var c=this.createTabList_();a=c.indexOf(a);-1==a&&(a=b?-1:c.length);(c=c[b?a+1:a-1])?c instanceof Blockly.Field?c.showEditor_():c.tab(null,b):(c=this.getParent())&&c.tab(this,b)};Blockly.BlockSvg.prototype.createTabList_=function(){for(var a=[],b=0,c;c=this.inputList[b];b++){for(var d=0,e;e=c.fieldRow[d];d++)e instanceof Blockly.FieldTextInput&&a.push(e);c.connection&&(c=c.connection.targetBlock())&&a.push(c)}return a};
|
||||
Blockly.BlockSvg.prototype.onMouseDown_=function(a){var b=this.workspace.getGesture(a);b&&b.handleBlockStart(a,this)};Blockly.BlockSvg.prototype.showHelp_=function(){var a=goog.isFunction(this.helpUrl)?this.helpUrl():this.helpUrl;a&&window.open(a)};
|
||||
Blockly.BlockSvg.prototype.showContextMenu_=function(a){if(!this.workspace.options.readOnly&&this.contextMenu){var b=this,c=[];if(this.isDeletable()&&this.isMovable()&&!b.isInFlyout){var d={text:Blockly.Msg.DUPLICATE_BLOCK,enabled:!0,callback:function(){Blockly.duplicate_(b)}};this.getDescendants().length>this.workspace.remainingCapacity()&&(d.enabled=!1);c.push(d);this.isEditable()&&!this.collapsed_&&this.workspace.options.comments&&(d={enabled:!goog.userAgent.IE},this.comment?(d.text=Blockly.Msg.REMOVE_COMMENT,
|
||||
d.callback=function(){b.setCommentText(null)}):(d.text=Blockly.Msg.ADD_COMMENT,d.callback=function(){b.setCommentText("")}),c.push(d));if(!this.collapsed_)for(d=1;d<this.inputList.length;d++)if(this.inputList[d-1].type!=Blockly.NEXT_STATEMENT&&this.inputList[d].type!=Blockly.NEXT_STATEMENT){d={enabled:!0};var e=this.getInputsInline();d.text=e?Blockly.Msg.EXTERNAL_INPUTS:Blockly.Msg.INLINE_INPUTS;d.callback=function(){b.setInputsInline(!e)};c.push(d);break}this.workspace.options.collapse&&(this.collapsed_?
|
||||
(d={enabled:!0},d.text=Blockly.Msg.EXPAND_BLOCK,d.callback=function(){b.setCollapsed(!1)}):(d={enabled:!0},d.text=Blockly.Msg.COLLAPSE_BLOCK,d.callback=function(){b.setCollapsed(!0)}),c.push(d));this.workspace.options.disable&&(d={text:this.disabled?Blockly.Msg.ENABLE_BLOCK:Blockly.Msg.DISABLE_BLOCK,enabled:!this.getInheritedDisabled(),callback:function(){b.setDisabled(!b.disabled)}},c.push(d));d=this.getDescendants().length;var f=this.getNextBlock();f&&(d-=f.getDescendants().length);d={text:1==d?
|
||||
Blockly.Msg.DELETE_BLOCK:Blockly.Msg.DELETE_X_BLOCKS.replace("%1",String(d)),enabled:!0,callback:function(){Blockly.Events.setGroup(!0);b.dispose(!0,!0);Blockly.Events.setGroup(!1)}};c.push(d)}d={enabled:!(goog.isFunction(this.helpUrl)?!this.helpUrl():!this.helpUrl)};d.text=Blockly.Msg.HELP;d.callback=function(){b.showHelp_()};c.push(d);this.customContextMenu&&this.customContextMenu(c);Blockly.ContextMenu.show(a,c,this.RTL);Blockly.ContextMenu.currentBlock=this}};
|
||||
Blockly.BlockSvg.prototype.showContextMenu_=function(a){if(!this.workspace.options.readOnly&&this.contextMenu){var b=this,c=[];if(this.isDeletable()&&this.isMovable()&&!b.isInFlyout){c.push(Blockly.ContextMenu.blockDuplicateOption(b));this.isEditable()&&!this.collapsed_&&this.workspace.options.comments&&c.push(Blockly.ContextMenu.blockCommentOption(b));if(!this.collapsed_)for(var d=1;d<this.inputList.length;d++)if(this.inputList[d-1].type!=Blockly.NEXT_STATEMENT&&this.inputList[d].type!=Blockly.NEXT_STATEMENT){d=
|
||||
{enabled:!0};var e=this.getInputsInline();d.text=e?Blockly.Msg.EXTERNAL_INPUTS:Blockly.Msg.INLINE_INPUTS;d.callback=function(){b.setInputsInline(!e)};c.push(d);break}this.workspace.options.collapse&&(this.collapsed_?(d={enabled:!0},d.text=Blockly.Msg.EXPAND_BLOCK,d.callback=function(){b.setCollapsed(!1)}):(d={enabled:!0},d.text=Blockly.Msg.COLLAPSE_BLOCK,d.callback=function(){b.setCollapsed(!0)}),c.push(d));this.workspace.options.disable&&(d={text:this.disabled?Blockly.Msg.ENABLE_BLOCK:Blockly.Msg.DISABLE_BLOCK,
|
||||
enabled:!this.getInheritedDisabled(),callback:function(){b.setDisabled(!b.disabled)}},c.push(d));c.push(Blockly.ContextMenu.blockDeleteOption(b))}c.push(Blockly.ContextMenu.blockHelpOption(b));this.customContextMenu&&this.customContextMenu(c);Blockly.ContextMenu.show(a,c,this.RTL);Blockly.ContextMenu.currentBlock=this}};
|
||||
Blockly.BlockSvg.prototype.moveConnections_=function(a,b){if(this.rendered){for(var c=this.getConnections_(!1),d=0;d<c.length;d++)c[d].moveBy(a,b);c=this.getIcons();for(d=0;d<c.length;d++)c[d].computeIconLocation();for(d=0;d<this.childBlocks_.length;d++)this.childBlocks_[d].moveConnections_(a,b)}};
|
||||
Blockly.BlockSvg.prototype.setDragging=function(a){if(a){var b=this.getSvgRoot();b.translate_="";b.skew_="";Blockly.draggingConnections_=Blockly.draggingConnections_.concat(this.getConnections_(!0));Blockly.utils.addClass(this.svgGroup_,"blocklyDragging")}else Blockly.draggingConnections_=[],Blockly.utils.removeClass(this.svgGroup_,"blocklyDragging");for(b=0;b<this.childBlocks_.length;b++)this.childBlocks_[b].setDragging(a)};
|
||||
Blockly.BlockSvg.prototype.updateMovable=function(){this.isMovable()?Blockly.utils.addClass(this.svgGroup_,"blocklyDraggable"):Blockly.utils.removeClass(this.svgGroup_,"blocklyDraggable")};Blockly.BlockSvg.prototype.setMovable=function(a){Blockly.BlockSvg.superClass_.setMovable.call(this,a);this.updateMovable()};Blockly.BlockSvg.prototype.setEditable=function(a){Blockly.BlockSvg.superClass_.setEditable.call(this,a);a=this.getIcons();for(var b=0;b<a.length;b++)a[b].updateEditable()};
|
||||
Blockly.BlockSvg.prototype.setShadow=function(a){Blockly.BlockSvg.superClass_.setShadow.call(this,a);this.updateColour()};Blockly.BlockSvg.prototype.getSvgRoot=function(){return this.svgGroup_};
|
||||
Blockly.BlockSvg.prototype.dispose=function(a,b){if(this.workspace){Blockly.Tooltip.hide();Blockly.Field.startCache();var c=this.workspace;Blockly.selected==this&&(this.unselect(),this.workspace.cancelCurrentGesture());Blockly.ContextMenu.currentBlock==this&&Blockly.ContextMenu.hide();b&&this.rendered&&(this.unplug(a),this.disposeUiEffect());this.rendered=!1;Blockly.Events.disable();try{var d=this.getIcons();for(b=0;b<d.length;b++)d[b].dispose()}finally{Blockly.Events.enable()}Blockly.BlockSvg.superClass_.dispose.call(this,
|
||||
a);goog.dom.removeNode(this.svgGroup_);c.resizeContents();this.svgPathDark_=this.svgPathLight_=this.svgPath_=this.svgGroup_=null;Blockly.Field.stopCache()}};
|
||||
Blockly.BlockSvg.prototype.dispose=function(a,b){if(this.workspace){Blockly.Tooltip.hide();Blockly.Field.startCache();var c=this.workspace;Blockly.selected==this&&(this.unselect(),this.workspace.cancelCurrentGesture());Blockly.ContextMenu.currentBlock==this&&Blockly.ContextMenu.hide();b&&this.rendered&&(this.unplug(a),this.disposeUiEffect());this.rendered=!1;if(this.warningTextDb_){for(var d in this.warningTextDb_)clearTimeout(this.warningTextDb_[d]);this.warningTextDb_=null}Blockly.Events.disable();
|
||||
try{var e=this.getIcons();for(b=0;b<e.length;b++)e[b].dispose()}finally{Blockly.Events.enable()}Blockly.BlockSvg.superClass_.dispose.call(this,a);goog.dom.removeNode(this.svgGroup_);c.resizeContents();this.svgPathDark_=this.svgPathLight_=this.svgPath_=this.svgGroup_=null;Blockly.Field.stopCache()}};
|
||||
Blockly.BlockSvg.prototype.disposeUiEffect=function(){this.workspace.getAudioManager().play("delete");var a=this.workspace.getSvgXY(this.svgGroup_),b=this.svgGroup_.cloneNode(!0);b.translateX_=a.x;b.translateY_=a.y;b.setAttribute("transform","translate("+b.translateX_+","+b.translateY_+")");this.workspace.getParentSvg().appendChild(b);b.bBox_=b.getBBox();Blockly.BlockSvg.disposeUiStep_(b,this.RTL,new Date,this.workspace.scale)};
|
||||
Blockly.BlockSvg.disposeUiStep_=function(a,b,c,d){var e=(new Date-c)/150;1<e?goog.dom.removeNode(a):(a.setAttribute("transform","translate("+(a.translateX_+(b?-1:1)*a.bBox_.width*d/2*e)+","+(a.translateY_+a.bBox_.height*d*e)+") scale("+(1-e)*d+")"),setTimeout(Blockly.BlockSvg.disposeUiStep_,10,a,b,c,d))};
|
||||
Blockly.BlockSvg.prototype.connectionUiEffect=function(){this.workspace.getAudioManager().play("click");if(!(1>this.workspace.scale)){var a=this.workspace.getSvgXY(this.svgGroup_);this.outputConnection?(a.x+=(this.RTL?3:-3)*this.workspace.scale,a.y+=13*this.workspace.scale):this.previousConnection&&(a.x+=(this.RTL?-23:23)*this.workspace.scale,a.y+=3*this.workspace.scale);a=Blockly.utils.createSvgElement("circle",{cx:a.x,cy:a.y,r:0,fill:"none",stroke:"#888","stroke-width":10},this.workspace.getParentSvg());
|
||||
@@ -1314,16 +1315,16 @@ Blockly.BlockSvg.prototype.updateColour=function(){if(!this.disabled){var a=this
|
||||
b)}this.svgPath_.setAttribute("fill",a);a=this.getIcons();for(c=0;c<a.length;c++)a[c].updateColour();for(a=0;c=this.inputList[a];a++){b=0;for(var d;d=c.fieldRow[b];b++)d.setText(null)}}};
|
||||
Blockly.BlockSvg.prototype.updateDisabled=function(){this.disabled||this.getInheritedDisabled()?Blockly.utils.addClass(this.svgGroup_,"blocklyDisabled")&&this.svgPath_.setAttribute("fill","url(#"+this.workspace.options.disabledPatternId+")"):Blockly.utils.removeClass(this.svgGroup_,"blocklyDisabled")&&this.updateColour();for(var a=this.getChildren(),b=0,c;c=a[b];b++)c.updateDisabled()};
|
||||
Blockly.BlockSvg.prototype.getCommentText=function(){return this.comment?this.comment.getText().replace(/\s+$/,"").replace(/ +\n/g,"\n"):""};Blockly.BlockSvg.prototype.setCommentText=function(a){var b=!1;goog.isString(a)?(this.comment||(this.comment=new Blockly.Comment(this),b=!0),this.comment.setText(a)):this.comment&&(this.comment.dispose(),b=!0);b&&this.rendered&&(this.render(),this.bumpNeighbours_())};
|
||||
Blockly.BlockSvg.prototype.setWarningText=function(a,b){this.setWarningText.pid_||(this.setWarningText.pid_=Object.create(null));var c=b||"";if(c)this.setWarningText.pid_[c]&&(clearTimeout(this.setWarningText.pid_[c]),delete this.setWarningText.pid_[c]);else for(var d in this.setWarningText.pid_)clearTimeout(this.setWarningText.pid_[d]),delete this.setWarningText.pid_[d];if(this.workspace.isDragging()){var e=this;this.setWarningText.pid_[c]=setTimeout(function(){e.workspace&&(delete e.setWarningText.pid_[c],
|
||||
e.setWarningText(a,c))},100)}else{this.isInFlyout&&(a=null);b=this.getSurroundParent();for(d=null;b;)b.isCollapsed()&&(d=b),b=b.getSurroundParent();d&&d.setWarningText(a,"collapsed "+this.id+" "+c);b=!1;goog.isString(a)?(this.warning||(this.warning=new Blockly.Warning(this),b=!0),this.warning.setText(a,c)):this.warning&&!c?(this.warning.dispose(),b=!0):this.warning&&(b=this.warning.getText(),this.warning.setText("",c),(d=this.warning.getText())||this.warning.dispose(),b=b!=d);b&&this.rendered&&(this.render(),
|
||||
this.bumpNeighbours_())}};Blockly.BlockSvg.prototype.setMutator=function(a){this.mutator&&this.mutator!==a&&this.mutator.dispose();a&&(a.block_=this,this.mutator=a,a.createIcon())};Blockly.BlockSvg.prototype.setDisabled=function(a){this.disabled!=a&&(Blockly.BlockSvg.superClass_.setDisabled.call(this,a),this.rendered&&this.updateDisabled())};
|
||||
Blockly.BlockSvg.prototype.setWarningText=function(a,b){this.warningTextDb_||(this.warningTextDb_=Object.create(null));var c=b||"";if(c)this.warningTextDb_[c]&&(clearTimeout(this.warningTextDb_[c]),delete this.warningTextDb_[c]);else for(var d in this.warningTextDb_)clearTimeout(this.warningTextDb_[d]),delete this.warningTextDb_[d];if(this.workspace.isDragging()){var e=this;this.warningTextDb_[c]=setTimeout(function(){e.workspace&&(delete e.warningTextDb_[c],e.setWarningText(a,c))},100)}else{this.isInFlyout&&
|
||||
(a=null);b=this.getSurroundParent();for(d=null;b;)b.isCollapsed()&&(d=b),b=b.getSurroundParent();d&&d.setWarningText(a,"collapsed "+this.id+" "+c);b=!1;goog.isString(a)?(this.warning||(this.warning=new Blockly.Warning(this),b=!0),this.warning.setText(a,c)):this.warning&&!c?(this.warning.dispose(),b=!0):this.warning&&(b=this.warning.getText(),this.warning.setText("",c),(d=this.warning.getText())||this.warning.dispose(),b=b!=d);b&&this.rendered&&(this.render(),this.bumpNeighbours_())}};
|
||||
Blockly.BlockSvg.prototype.setMutator=function(a){this.mutator&&this.mutator!==a&&this.mutator.dispose();a&&(a.block_=this,this.mutator=a,a.createIcon())};Blockly.BlockSvg.prototype.setDisabled=function(a){this.disabled!=a&&(Blockly.BlockSvg.superClass_.setDisabled.call(this,a),this.rendered&&this.updateDisabled())};
|
||||
Blockly.BlockSvg.prototype.setHighlighted=function(a){this.rendered&&(a?(this.svgPath_.setAttribute("filter","url(#"+this.workspace.options.embossFilterId+")"),this.svgPathLight_.style.display="none"):(Blockly.utils.removeAttribute(this.svgPath_,"filter"),delete this.svgPathLight_.style.display))};Blockly.BlockSvg.prototype.addSelect=function(){Blockly.utils.addClass(this.svgGroup_,"blocklySelected")};Blockly.BlockSvg.prototype.removeSelect=function(){Blockly.utils.removeClass(this.svgGroup_,"blocklySelected")};
|
||||
Blockly.BlockSvg.prototype.setDeleteStyle=function(a){a?Blockly.utils.addClass(this.svgGroup_,"blocklyDraggingDelete"):Blockly.utils.removeClass(this.svgGroup_,"blocklyDraggingDelete")};Blockly.BlockSvg.prototype.setColour=function(a){Blockly.BlockSvg.superClass_.setColour.call(this,a);this.rendered&&this.updateColour()};Blockly.BlockSvg.prototype.bringToFront=function(){var a=this;do{var b=a.getSvgRoot();b.parentNode.appendChild(b);a=a.getParent()}while(a)};
|
||||
Blockly.BlockSvg.prototype.setPreviousStatement=function(a,b){Blockly.BlockSvg.superClass_.setPreviousStatement.call(this,a,b);this.rendered&&(this.render(),this.bumpNeighbours_())};Blockly.BlockSvg.prototype.setNextStatement=function(a,b){Blockly.BlockSvg.superClass_.setNextStatement.call(this,a,b);this.rendered&&(this.render(),this.bumpNeighbours_())};Blockly.BlockSvg.prototype.setOutput=function(a,b){Blockly.BlockSvg.superClass_.setOutput.call(this,a,b);this.rendered&&(this.render(),this.bumpNeighbours_())};
|
||||
Blockly.BlockSvg.prototype.setInputsInline=function(a){Blockly.BlockSvg.superClass_.setInputsInline.call(this,a);this.rendered&&(this.render(),this.bumpNeighbours_())};Blockly.BlockSvg.prototype.removeInput=function(a,b){Blockly.BlockSvg.superClass_.removeInput.call(this,a,b);this.rendered&&(this.render(),this.bumpNeighbours_())};Blockly.BlockSvg.prototype.moveNumberedInputBefore=function(a,b){Blockly.BlockSvg.superClass_.moveNumberedInputBefore.call(this,a,b);this.rendered&&(this.render(),this.bumpNeighbours_())};
|
||||
Blockly.BlockSvg.prototype.appendInput_=function(a,b){a=Blockly.BlockSvg.superClass_.appendInput_.call(this,a,b);this.rendered&&(this.render(),this.bumpNeighbours_());return a};Blockly.BlockSvg.prototype.getConnections_=function(a){var b=[];if(a||this.rendered)if(this.outputConnection&&b.push(this.outputConnection),this.previousConnection&&b.push(this.previousConnection),this.nextConnection&&b.push(this.nextConnection),a||!this.collapsed_){a=0;for(var c;c=this.inputList[a];a++)c.connection&&b.push(c.connection)}return b};
|
||||
Blockly.BlockSvg.prototype.makeConnection_=function(a){return new Blockly.RenderedConnection(this,a)};
|
||||
Blockly.BlockSvg.prototype.bumpNeighbours_=function(){if(this.workspace&&Blockly.dragMode_==Blockly.DRAG_NONE){var a=this.getRootBlock();if(!a.isInFlyout)for(var b=this.getConnections_(!1),c=0,d;d=b[c];c++){d.isConnected()&&d.isSuperior()&&d.targetBlock().bumpNeighbours_();for(var e=d.neighbours_(Blockly.SNAP_RADIUS),f=0,g;g=e[f];f++)d.isConnected()&&g.isConnected()||g.getSourceBlock().getRootBlock()!=a&&(d.isSuperior()?g.bumpAwayFrom_(d):d.bumpAwayFrom_(g))}}};
|
||||
Blockly.BlockSvg.prototype.bumpNeighbours_=function(){if(this.workspace&&!this.workspace.isDragging()){var a=this.getRootBlock();if(!a.isInFlyout)for(var b=this.getConnections_(!1),c=0,d;d=b[c];c++){d.isConnected()&&d.isSuperior()&&d.targetBlock().bumpNeighbours_();for(var e=d.neighbours_(Blockly.SNAP_RADIUS),f=0,g;g=e[f];f++)d.isConnected()&&g.isConnected()||g.getSourceBlock().getRootBlock()!=a&&(d.isSuperior()?g.bumpAwayFrom_(d):d.bumpAwayFrom_(g))}}};
|
||||
Blockly.BlockSvg.prototype.scheduleSnapAndBump=function(){var a=this,b=Blockly.Events.getGroup();setTimeout(function(){Blockly.Events.setGroup(b);a.snapToGrid();Blockly.Events.setGroup(!1)},Blockly.BUMP_DELAY/2);setTimeout(function(){Blockly.Events.setGroup(b);a.bumpNeighbours_();Blockly.Events.setGroup(!1)},Blockly.BUMP_DELAY)};Blockly.BlockSvg.render={};Blockly.BlockSvg.SEP_SPACE_X=10;Blockly.BlockSvg.SEP_SPACE_Y=10;Blockly.BlockSvg.INLINE_PADDING_Y=5;Blockly.BlockSvg.MIN_BLOCK_Y=25;Blockly.BlockSvg.TAB_HEIGHT=20;Blockly.BlockSvg.TAB_WIDTH=8;Blockly.BlockSvg.NOTCH_WIDTH=30;Blockly.BlockSvg.CORNER_RADIUS=8;Blockly.BlockSvg.START_HAT=!1;Blockly.BlockSvg.START_HAT_HEIGHT=15;Blockly.BlockSvg.START_HAT_PATH="c 30,-"+Blockly.BlockSvg.START_HAT_HEIGHT+" 70,-"+Blockly.BlockSvg.START_HAT_HEIGHT+" 100,0";
|
||||
Blockly.BlockSvg.START_HAT_HIGHLIGHT_LTR="c 17.8,-9.2 45.3,-14.9 75,-8.7 M 100.5,0.5";Blockly.BlockSvg.START_HAT_HIGHLIGHT_RTL="m 25,-8.7 c 29.7,-6.2 57.2,-0.5 75,8.7";Blockly.BlockSvg.DISTANCE_45_INSIDE=(1-Math.SQRT1_2)*(Blockly.BlockSvg.CORNER_RADIUS-.5)+.5;Blockly.BlockSvg.DISTANCE_45_OUTSIDE=(1-Math.SQRT1_2)*(Blockly.BlockSvg.CORNER_RADIUS+.5)-.5;Blockly.BlockSvg.NOTCH_PATH_LEFT="l 6,4 3,0 6,-4";Blockly.BlockSvg.NOTCH_PATH_LEFT_HIGHLIGHT="l 6,4 3,0 6,-4";Blockly.BlockSvg.NOTCH_PATH_RIGHT="l -6,4 -3,0 -6,-4";
|
||||
Blockly.BlockSvg.JAGGED_TEETH="l 8,0 0,4 8,4 -16,8 8,4";Blockly.BlockSvg.JAGGED_TEETH_HEIGHT=20;Blockly.BlockSvg.JAGGED_TEETH_WIDTH=15;Blockly.BlockSvg.TAB_PATH_DOWN="v 5 c 0,10 -"+Blockly.BlockSvg.TAB_WIDTH+",-8 -"+Blockly.BlockSvg.TAB_WIDTH+",7.5 s "+Blockly.BlockSvg.TAB_WIDTH+",-2.5 "+Blockly.BlockSvg.TAB_WIDTH+",7.5";
|
||||
@@ -1361,27 +1362,28 @@ Blockly.BlockSvg.prototype.renderDrawLeft_=function(a,b){this.outputConnection?(
|
||||
Blockly.BlockSvg.TAB_WIDTH+",-0.5 q "+-.19*Blockly.BlockSvg.TAB_WIDTH+",-5.5 0,-11"),b.push("m",.92*Blockly.BlockSvg.TAB_WIDTH+",1 V 0.5 H 1")),this.width+=Blockly.BlockSvg.TAB_WIDTH):this.RTL||(this.squareTopLeftCorner_?b.push("V",.5):b.push("V",Blockly.BlockSvg.CORNER_RADIUS));a.push("z")};Blockly.Events={};Blockly.Events.group_="";Blockly.Events.recordUndo=!0;Blockly.Events.disabled_=0;Blockly.Events.CREATE="create";Blockly.Events.BLOCK_CREATE=Blockly.Events.CREATE;Blockly.Events.DELETE="delete";Blockly.Events.BLOCK_DELETE=Blockly.Events.DELETE;Blockly.Events.CHANGE="change";Blockly.Events.BLOCK_CHANGE=Blockly.Events.CHANGE;Blockly.Events.MOVE="move";Blockly.Events.BLOCK_MOVE=Blockly.Events.MOVE;Blockly.Events.VAR_CREATE="var_create";Blockly.Events.VAR_DELETE="var_delete";
|
||||
Blockly.Events.VAR_RENAME="var_rename";Blockly.Events.UI="ui";Blockly.Events.FIRE_QUEUE_=[];Blockly.Events.fire=function(a){Blockly.Events.isEnabled()&&(Blockly.Events.FIRE_QUEUE_.length||setTimeout(Blockly.Events.fireNow_,0),Blockly.Events.FIRE_QUEUE_.push(a))};Blockly.Events.fireNow_=function(){for(var a=Blockly.Events.filter(Blockly.Events.FIRE_QUEUE_,!0),b=Blockly.Events.FIRE_QUEUE_.length=0,c;c=a[b];b++){var d=Blockly.Workspace.getById(c.workspaceId);d&&d.fireChangeListener(c)}};
|
||||
Blockly.Events.filter=function(a,b){a=goog.array.clone(a);b||a.reverse();for(var c=[],d=Object.create(null),e=0,f;f=a[e];e++)if(!f.isNull()){var g=[f.type,f.blockId,f.workspaceId].join(" "),h=d[g];h?f.type==Blockly.Events.MOVE?(h.newParentId=f.newParentId,h.newInputName=f.newInputName,h.newCoordinate=f.newCoordinate):f.type==Blockly.Events.CHANGE&&f.element==h.element&&f.name==h.name?h.newValue=f.newValue:f.type!=Blockly.Events.UI||"click"!=f.element||"commentOpen"!=h.element&&"mutatorOpen"!=h.element&&
|
||||
"warningOpen"!=h.element||(h.newValue=f.newValue):(d[g]=f,c.push(f))}a=c;b||a.reverse();for(e=1;f=a[e];e++)f.type==Blockly.Events.CHANGE&&"mutation"==f.element&&a.unshift(a.splice(e,1)[0]);return a};Blockly.Events.clearPendingUndo=function(){for(var a=0,b;b=Blockly.Events.FIRE_QUEUE_[a];a++)b.recordUndo=!1};Blockly.Events.disable=function(){Blockly.Events.disabled_++};Blockly.Events.enable=function(){Blockly.Events.disabled_--};Blockly.Events.isEnabled=function(){return 0==Blockly.Events.disabled_};
|
||||
Blockly.Events.getGroup=function(){return Blockly.Events.group_};Blockly.Events.setGroup=function(a){Blockly.Events.group_="boolean"==typeof a?a?Blockly.utils.genUid():"":a};Blockly.Events.getDescendantIds_=function(a){var b=[];a=a.getDescendants();for(var c=0,d;d=a[c];c++)b[c]=d.id;return b};
|
||||
Blockly.Events.fromJson=function(a,b){switch(a.type){case Blockly.Events.CREATE:var c=new Blockly.Events.Create(null);break;case Blockly.Events.DELETE:c=new Blockly.Events.Delete(null);break;case Blockly.Events.CHANGE:c=new Blockly.Events.Change(null);break;case Blockly.Events.MOVE:c=new Blockly.Events.Move(null);break;case Blockly.Events.VAR_CREATE:c=new Blockly.Events.VarCreate(null);break;case Blockly.Events.VAR_DELETE:c=new Blockly.Events.VarDelete(null);break;case Blockly.Events.VAR_RENAME:c=
|
||||
new Blockly.Events.VarRename(null);break;case Blockly.Events.UI:c=new Blockly.Events.Ui(null);break;default:throw"Unknown event type.";}c.fromJson(a);c.workspaceId=b.id;return c};Blockly.Events.Abstract=function(a){a instanceof Blockly.Block?(this.blockId=a.id,this.workspaceId=a.workspace.id):a instanceof Blockly.VariableModel&&(this.workspaceId=a.workspace.id,this.varId=a.getId());this.group=Blockly.Events.group_;this.recordUndo=Blockly.Events.recordUndo};
|
||||
"warningOpen"!=h.element?(d[g]=f,c.push(f)):h.newValue=f.newValue:(d[g]=f,c.push(f))}a=c.filter(function(a){return!a.isNull()});b||a.reverse();for(e=1;f=a[e];e++)f.type==Blockly.Events.CHANGE&&"mutation"==f.element&&a.unshift(a.splice(e,1)[0]);return a};Blockly.Events.clearPendingUndo=function(){for(var a=0,b;b=Blockly.Events.FIRE_QUEUE_[a];a++)b.recordUndo=!1};Blockly.Events.disable=function(){Blockly.Events.disabled_++};Blockly.Events.enable=function(){Blockly.Events.disabled_--};
|
||||
Blockly.Events.isEnabled=function(){return 0==Blockly.Events.disabled_};Blockly.Events.getGroup=function(){return Blockly.Events.group_};Blockly.Events.setGroup=function(a){Blockly.Events.group_="boolean"==typeof a?a?Blockly.utils.genUid():"":a};Blockly.Events.getDescendantIds_=function(a){var b=[];a=a.getDescendants();for(var c=0,d;d=a[c];c++)b[c]=d.id;return b};
|
||||
Blockly.Events.fromJson=function(a,b){switch(a.type){case Blockly.Events.CREATE:var c=new Blockly.Events.Create(null);break;case Blockly.Events.DELETE:c=new Blockly.Events.Delete(null);break;case Blockly.Events.CHANGE:c=new Blockly.Events.Change(null,"","","","");break;case Blockly.Events.MOVE:c=new Blockly.Events.Move(null);break;case Blockly.Events.VAR_CREATE:c=new Blockly.Events.VarCreate(null);break;case Blockly.Events.VAR_DELETE:c=new Blockly.Events.VarDelete(null);break;case Blockly.Events.VAR_RENAME:c=
|
||||
new Blockly.Events.VarRename(null,"");break;case Blockly.Events.UI:c=new Blockly.Events.Ui(null);break;default:throw"Unknown event type.";}c.fromJson(a);c.workspaceId=b.id;return c};
|
||||
Blockly.Events.Abstract=function(a){this.recordUndo=this.group=this.workspaceId=this.varId=this.blockId=void 0;a instanceof Blockly.Block?(this.blockId=a.id,this.workspaceId=a.workspace.id):a instanceof Blockly.VariableModel&&(this.workspaceId=a.workspace.id,this.varId=a.getId());this.group=Blockly.Events.group_;this.recordUndo=Blockly.Events.recordUndo};
|
||||
Blockly.Events.Abstract.prototype.toJson=function(){var a={type:this.type};this.blockId&&(a.blockId=this.blockId);this.varId&&(a.varId=this.varId);this.group&&(a.group=this.group);return a};Blockly.Events.Abstract.prototype.fromJson=function(a){this.blockId=a.blockId;this.varId=a.varId;this.group=a.group};Blockly.Events.Abstract.prototype.isNull=function(){return!1};Blockly.Events.Abstract.prototype.run=function(a){};
|
||||
Blockly.Events.Abstract.prototype.getEventWorkspace_=function(){var a=Blockly.Workspace.getById(this.workspaceId);if(!a)throw Error("Workspace is null. Event must have been generated from real Blockly events.");return a};Blockly.Events.Create=function(a){a&&(Blockly.Events.Create.superClass_.constructor.call(this,a),this.xml=a.workspace.rendered?Blockly.Xml.blockToDomWithXY(a):Blockly.Xml.blockToDom(a),this.ids=Blockly.Events.getDescendantIds_(a))};goog.inherits(Blockly.Events.Create,Blockly.Events.Abstract);
|
||||
Blockly.Events.BlockCreate=Blockly.Events.Create;Blockly.Events.Create.prototype.type=Blockly.Events.CREATE;Blockly.Events.Create.prototype.toJson=function(){var a=Blockly.Events.Create.superClass_.toJson.call(this);a.xml=Blockly.Xml.domToText(this.xml);a.ids=this.ids;return a};Blockly.Events.Create.prototype.fromJson=function(a){Blockly.Events.Create.superClass_.fromJson.call(this,a);this.xml=Blockly.Xml.textToDom("<xml>"+a.xml+"</xml>").firstChild;this.ids=a.ids};
|
||||
Blockly.Events.Create.prototype.run=function(a){var b=this.getEventWorkspace_();if(a)a=goog.dom.createDom("xml"),a.appendChild(this.xml),Blockly.Xml.domToWorkspace(a,b);else{a=0;for(var c;c=this.ids[a];a++){var d=b.getBlockById(c);d?d.dispose(!1,!1):c==this.blockId&&console.warn("Can't uncreate non-existant block: "+c)}}};
|
||||
Blockly.Events.Create.prototype.run=function(a){var b=this.getEventWorkspace_();if(a)a=goog.dom.createDom("xml"),a.appendChild(this.xml),Blockly.Xml.domToWorkspace(a,b);else{a=0;for(var c;c=this.ids[a];a++){var d=b.getBlockById(c);d?d.dispose(!1,!1):c==this.blockId&&console.warn("Can't uncreate non-existent block: "+c)}}};
|
||||
Blockly.Events.Delete=function(a){if(a){if(a.getParent())throw"Connected blocks cannot be deleted.";Blockly.Events.Delete.superClass_.constructor.call(this,a);this.oldXml=a.workspace.rendered?Blockly.Xml.blockToDomWithXY(a):Blockly.Xml.blockToDom(a);this.ids=Blockly.Events.getDescendantIds_(a)}};goog.inherits(Blockly.Events.Delete,Blockly.Events.Abstract);Blockly.Events.BlockDelete=Blockly.Events.Delete;Blockly.Events.Delete.prototype.type=Blockly.Events.DELETE;
|
||||
Blockly.Events.Delete.prototype.toJson=function(){var a=Blockly.Events.Delete.superClass_.toJson.call(this);a.ids=this.ids;return a};Blockly.Events.Delete.prototype.fromJson=function(a){Blockly.Events.Delete.superClass_.fromJson.call(this,a);this.ids=a.ids};
|
||||
Blockly.Events.Delete.prototype.run=function(a){var b=this.getEventWorkspace_();if(a){a=0;for(var c;c=this.ids[a];a++){var d=b.getBlockById(c);d?d.dispose(!1,!1):c==this.blockId&&console.warn("Can't delete non-existant block: "+c)}}else a=goog.dom.createDom("xml"),a.appendChild(this.oldXml),Blockly.Xml.domToWorkspace(a,b)};Blockly.Events.Change=function(a,b,c,d,e){a&&(Blockly.Events.Change.superClass_.constructor.call(this,a),this.element=b,this.name=c,this.oldValue=d,this.newValue=e)};
|
||||
Blockly.Events.Delete.prototype.run=function(a){var b=this.getEventWorkspace_();if(a){a=0;for(var c;c=this.ids[a];a++){var d=b.getBlockById(c);d?d.dispose(!1,!1):c==this.blockId&&console.warn("Can't delete non-existent block: "+c)}}else a=goog.dom.createDom("xml"),a.appendChild(this.oldXml),Blockly.Xml.domToWorkspace(a,b)};Blockly.Events.Change=function(a,b,c,d,e){a&&(Blockly.Events.Change.superClass_.constructor.call(this,a),this.element=b,this.name=c,this.oldValue=d,this.newValue=e)};
|
||||
goog.inherits(Blockly.Events.Change,Blockly.Events.Abstract);Blockly.Events.BlockChange=Blockly.Events.Change;Blockly.Events.Change.prototype.type=Blockly.Events.CHANGE;Blockly.Events.Change.prototype.toJson=function(){var a=Blockly.Events.Change.superClass_.toJson.call(this);a.element=this.element;this.name&&(a.name=this.name);a.newValue=this.newValue;return a};
|
||||
Blockly.Events.Change.prototype.fromJson=function(a){Blockly.Events.Change.superClass_.fromJson.call(this,a);this.element=a.element;this.name=a.name;this.newValue=a.newValue};Blockly.Events.Change.prototype.isNull=function(){return this.oldValue==this.newValue};
|
||||
Blockly.Events.Change.prototype.run=function(a){var b=this.getEventWorkspace_().getBlockById(this.blockId);if(b)switch(b.mutator&&b.mutator.setVisible(!1),a=a?this.newValue:this.oldValue,this.element){case "field":(b=b.getField(this.name))?(b.callValidator(a),b.setValue(a)):console.warn("Can't set non-existant field: "+this.name);break;case "comment":b.setCommentText(a||null);break;case "collapsed":b.setCollapsed(a);break;case "disabled":b.setDisabled(a);break;case "inline":b.setInputsInline(a);break;
|
||||
case "mutation":var c="";b.mutationToDom&&(c=(c=b.mutationToDom())&&Blockly.Xml.domToText(c));if(b.domToMutation){a=a||"<mutation></mutation>";var d=Blockly.Xml.textToDom("<xml>"+a+"</xml>");b.domToMutation(d.firstChild)}Blockly.Events.fire(new Blockly.Events.Change(b,"mutation",null,c,a));break;default:console.warn("Unknown change type: "+this.element)}else console.warn("Can't change non-existant block: "+this.blockId)};
|
||||
Blockly.Events.Change.prototype.run=function(a){var b=this.getEventWorkspace_().getBlockById(this.blockId);if(b)switch(b.mutator&&b.mutator.setVisible(!1),a=a?this.newValue:this.oldValue,this.element){case "field":(b=b.getField(this.name))?(b.callValidator(a),b.setValue(a)):console.warn("Can't set non-existent field: "+this.name);break;case "comment":b.setCommentText(a||null);break;case "collapsed":b.setCollapsed(a);break;case "disabled":b.setDisabled(a);break;case "inline":b.setInputsInline(a);break;
|
||||
case "mutation":var c="";b.mutationToDom&&(c=(c=b.mutationToDom())&&Blockly.Xml.domToText(c));if(b.domToMutation){a=a||"<mutation></mutation>";var d=Blockly.Xml.textToDom("<xml>"+a+"</xml>");b.domToMutation(d.firstChild)}Blockly.Events.fire(new Blockly.Events.Change(b,"mutation",null,c,a));break;default:console.warn("Unknown change type: "+this.element)}else console.warn("Can't change non-existent block: "+this.blockId)};
|
||||
Blockly.Events.Move=function(a){a&&(Blockly.Events.Move.superClass_.constructor.call(this,a),a=this.currentLocation_(),this.oldParentId=a.parentId,this.oldInputName=a.inputName,this.oldCoordinate=a.coordinate)};goog.inherits(Blockly.Events.Move,Blockly.Events.Abstract);Blockly.Events.BlockMove=Blockly.Events.Move;Blockly.Events.Move.prototype.type=Blockly.Events.MOVE;
|
||||
Blockly.Events.Move.prototype.toJson=function(){var a=Blockly.Events.Move.superClass_.toJson.call(this);this.newParentId&&(a.newParentId=this.newParentId);this.newInputName&&(a.newInputName=this.newInputName);this.newCoordinate&&(a.newCoordinate=Math.round(this.newCoordinate.x)+","+Math.round(this.newCoordinate.y));return a};
|
||||
Blockly.Events.Move.prototype.fromJson=function(a){Blockly.Events.Move.superClass_.fromJson.call(this,a);this.newParentId=a.newParentId;this.newInputName=a.newInputName;a.newCoordinate&&(a=a.newCoordinate.split(","),this.newCoordinate=new goog.math.Coordinate(parseFloat(a[0]),parseFloat(a[1])))};Blockly.Events.Move.prototype.recordNew=function(){var a=this.currentLocation_();this.newParentId=a.parentId;this.newInputName=a.inputName;this.newCoordinate=a.coordinate};
|
||||
Blockly.Events.Move.prototype.currentLocation_=function(){var a=Blockly.Workspace.getById(this.workspaceId).getBlockById(this.blockId),b={},c=a.getParent();if(c){if(b.parentId=c.id,a=c.getInputWithBlock(a))b.inputName=a.name}else b.coordinate=a.getRelativeToSurfaceXY();return b};Blockly.Events.Move.prototype.isNull=function(){return this.oldParentId==this.newParentId&&this.oldInputName==this.newInputName&&goog.math.Coordinate.equals(this.oldCoordinate,this.newCoordinate)};
|
||||
Blockly.Events.Move.prototype.run=function(a){var b=this.getEventWorkspace_(),c=b.getBlockById(this.blockId);if(c){var d=a?this.newParentId:this.oldParentId,e=a?this.newInputName:this.oldInputName;a=a?this.newCoordinate:this.oldCoordinate;var f=null;if(d&&(f=b.getBlockById(d),!f)){console.warn("Can't connect to non-existant block: "+d);return}c.getParent()&&c.unplug();if(a)e=c.getRelativeToSurfaceXY(),c.moveBy(a.x-e.x,a.y-e.y);else{c=c.outputConnection||c.previousConnection;if(e){if(b=f.getInput(e))var g=
|
||||
b.connection}else c.type==Blockly.PREVIOUS_STATEMENT&&(g=f.nextConnection);g?c.connect(g):console.warn("Can't connect to non-existant input: "+e)}}else console.warn("Can't move non-existant block: "+this.blockId)};Blockly.Events.Ui=function(a,b,c,d){Blockly.Events.Ui.superClass_.constructor.call(this,a);this.element=b;this.oldValue=c;this.newValue=d;this.recordUndo=!1};goog.inherits(Blockly.Events.Ui,Blockly.Events.Abstract);Blockly.Events.Ui.prototype.type=Blockly.Events.UI;
|
||||
Blockly.Events.Move.prototype.run=function(a){var b=this.getEventWorkspace_(),c=b.getBlockById(this.blockId);if(c){var d=a?this.newParentId:this.oldParentId,e=a?this.newInputName:this.oldInputName;a=a?this.newCoordinate:this.oldCoordinate;var f=null;if(d&&(f=b.getBlockById(d),!f)){console.warn("Can't connect to non-existent block: "+d);return}c.getParent()&&c.unplug();if(a)e=c.getRelativeToSurfaceXY(),c.moveBy(a.x-e.x,a.y-e.y);else{c=c.outputConnection||c.previousConnection;if(e){if(b=f.getInput(e))var g=
|
||||
b.connection}else c.type==Blockly.PREVIOUS_STATEMENT&&(g=f.nextConnection);g?c.connect(g):console.warn("Can't connect to non-existent input: "+e)}}else console.warn("Can't move non-existent block: "+this.blockId)};Blockly.Events.Ui=function(a,b,c,d){Blockly.Events.Ui.superClass_.constructor.call(this,a);this.element=b;this.oldValue=c;this.newValue=d;this.recordUndo=!1};goog.inherits(Blockly.Events.Ui,Blockly.Events.Abstract);Blockly.Events.Ui.prototype.type=Blockly.Events.UI;
|
||||
Blockly.Events.Ui.prototype.toJson=function(){var a=Blockly.Events.Ui.superClass_.toJson.call(this);a.element=this.element;void 0!==this.newValue&&(a.newValue=this.newValue);return a};Blockly.Events.Ui.prototype.fromJson=function(a){Blockly.Events.Ui.superClass_.fromJson.call(this,a);this.element=a.element;this.newValue=a.newValue};Blockly.Events.VarCreate=function(a){a&&(Blockly.Events.VarCreate.superClass_.constructor.call(this,a),this.varType=a.type,this.varName=a.name)};
|
||||
goog.inherits(Blockly.Events.VarCreate,Blockly.Events.Abstract);Blockly.Events.VarCreate.prototype.type=Blockly.Events.VAR_CREATE;Blockly.Events.VarCreate.prototype.toJson=function(){var a=Blockly.Events.VarCreate.superClass_.toJson.call(this);a.varType=this.varType;a.varName=this.varName;return a};Blockly.Events.VarCreate.prototype.fromJson=function(a){Blockly.Events.VarCreate.superClass_.fromJson.call(this,a);this.varType=a.varType;this.varName=a.varName};
|
||||
Blockly.Events.VarCreate.prototype.run=function(a){var b=this.getEventWorkspace_();a?b.createVariable(this.varName,this.varType,this.varId):b.deleteVariableById(this.varId)};Blockly.Events.VarDelete=function(a){a&&(Blockly.Events.VarDelete.superClass_.constructor.call(this,a),this.varType=a.type,this.varName=a.name)};goog.inherits(Blockly.Events.VarDelete,Blockly.Events.Abstract);Blockly.Events.VarDelete.prototype.type=Blockly.Events.VAR_DELETE;
|
||||
@@ -1397,7 +1399,7 @@ Blockly.FieldTextInput.prototype.unbindEvents_=function(a){Blockly.unbindEvent_(
|
||||
Blockly.FieldTextInput.prototype.onHtmlInputKeyDown_=function(a){var b=Blockly.FieldTextInput.htmlInput_;13==a.keyCode?Blockly.WidgetDiv.hide():27==a.keyCode?(b.value=b.defaultValue,Blockly.WidgetDiv.hide()):9==a.keyCode&&(Blockly.WidgetDiv.hide(),this.sourceBlock_.tab(this,!a.shiftKey),a.preventDefault())};
|
||||
Blockly.FieldTextInput.prototype.onHtmlInputChange_=function(a){a=Blockly.FieldTextInput.htmlInput_;var b=a.value;b!==a.oldValue_?(a.oldValue_=b,this.setValue(b),this.validate_()):goog.userAgent.WEBKIT&&this.sourceBlock_.render();this.resizeEditor_();Blockly.svgResize(this.sourceBlock_.workspace)};
|
||||
Blockly.FieldTextInput.prototype.validate_=function(){var a=!0;goog.asserts.assertObject(Blockly.FieldTextInput.htmlInput_);var b=Blockly.FieldTextInput.htmlInput_;this.sourceBlock_&&(a=this.callValidator(b.value));null===a?Blockly.utils.addClass(b,"blocklyInvalidInput"):Blockly.utils.removeClass(b,"blocklyInvalidInput")};
|
||||
Blockly.FieldTextInput.prototype.resizeEditor_=function(){var a=Blockly.WidgetDiv.DIV,b=this.fieldGroup_.getBBox();a.style.width=b.width*this.workspace_.scale+"px";a.style.height=b.height*this.workspace_.scale+"px";b=this.getAbsoluteXY_();if(this.sourceBlock_.RTL){var c=this.getScaledBBox_();b.x+=c.width;b.x-=a.offsetWidth}b.y+=1;goog.userAgent.GECKO&&Blockly.WidgetDiv.DIV.style.top&&(--b.x,--b.y);goog.userAgent.WEBKIT&&(b.y-=3);a.style.left=b.x+"px";a.style.top=b.y+"px"};
|
||||
Blockly.FieldTextInput.prototype.resizeEditor_=function(){var a=Blockly.WidgetDiv.DIV,b=this.getScaledBBox_();a.style.width=b.right-b.left+"px";a.style.height=b.bottom-b.top+"px";b=new goog.math.Coordinate(this.sourceBlock_.RTL?b.right-a.offsetWidth:b.left,b.top);b.y+=1;goog.userAgent.GECKO&&Blockly.WidgetDiv.DIV.style.top&&(--b.x,--b.y);goog.userAgent.WEBKIT&&(b.y-=3);a.style.left=b.x+"px";a.style.top=b.y+"px"};
|
||||
Blockly.FieldTextInput.prototype.widgetDispose_=function(){var a=this;return function(){var b=Blockly.FieldTextInput.htmlInput_;a.maybeSaveEdit_();a.unbindEvents_(b);Blockly.FieldTextInput.htmlInput_=null;Blockly.Events.setGroup(!1);b=Blockly.WidgetDiv.DIV.style;b.width="auto";b.height="auto";b.fontSize=""}};
|
||||
Blockly.FieldTextInput.prototype.maybeSaveEdit_=function(){var a=Blockly.FieldTextInput.htmlInput_,b=a.value;if(this.sourceBlock_)if(b=this.callValidator(b),null===b)b=a.defaultValue;else if(this.onFinishEditing_)this.onFinishEditing_(b);this.setText(b);this.sourceBlock_.rendered&&this.sourceBlock_.render()};
|
||||
Blockly.FieldTextInput.numberValidator=function(a){console.warn("Blockly.FieldTextInput.numberValidator is deprecated. Use Blockly.FieldNumber instead.");if(null===a)return null;a=String(a);a=a.replace(/O/ig,"0");a=a.replace(/,/g,"");a=parseFloat(a||0);return isNaN(a)?null:String(a)};Blockly.FieldTextInput.nonnegativeIntegerValidator=function(a){(a=Blockly.FieldTextInput.numberValidator(a))&&(a=String(Math.max(0,Math.floor(a))));return a};Blockly.FieldAngle=function(a,b){this.symbol_=Blockly.utils.createSvgElement("tspan",{},null);this.symbol_.appendChild(document.createTextNode("\u00b0"));a=a&&!isNaN(a)?String(a):"0";Blockly.FieldAngle.superClass_.constructor.call(this,a,b)};goog.inherits(Blockly.FieldAngle,Blockly.FieldTextInput);Blockly.FieldAngle.ROUND=15;Blockly.FieldAngle.HALF=50;Blockly.FieldAngle.CLOCKWISE=!1;Blockly.FieldAngle.OFFSET=0;Blockly.FieldAngle.WRAP=360;Blockly.FieldAngle.RADIUS=Blockly.FieldAngle.HALF-1;
|
||||
@@ -1432,7 +1434,7 @@ Blockly.FieldDropdown.prototype.render_=function(){this.visible_?(this.sourceBlo
|
||||
Blockly.FieldDropdown.prototype.renderSelectedImage_=function(){this.imageElement_=Blockly.utils.createSvgElement("image",{y:5,height:this.imageJson_.height+"px",width:this.imageJson_.width+"px"},this.fieldGroup_);this.imageElement_.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",this.imageJson_.src);this.textElement_.appendChild(this.arrow_);var a=Blockly.Field.getCachedWidth(this.arrow_);this.size_.height=Number(this.imageJson_.height)+19;this.size_.width=Number(this.imageJson_.width)+
|
||||
a;this.sourceBlock_.RTL?(this.imageElement_.setAttribute("x",a),this.textElement_.setAttribute("x",-1)):(this.textElement_.setAttribute("text-anchor","end"),this.textElement_.setAttribute("x",this.size_.width+1))};
|
||||
Blockly.FieldDropdown.prototype.renderSelectedText_=function(){var a=document.createTextNode(this.getDisplayText_());this.textElement_.appendChild(a);this.sourceBlock_.RTL?this.textElement_.insertBefore(this.arrow_,this.textElement_.firstChild):this.textElement_.appendChild(this.arrow_);this.textElement_.setAttribute("text-anchor","start");this.textElement_.setAttribute("x",0);this.size_.height=Blockly.BlockSvg.MIN_BLOCK_Y;this.size_.width=Blockly.Field.getCachedWidth(this.textElement_)};
|
||||
Blockly.FieldDropdown.prototype.updateWidth=function(){if(this.imageJson_&&(goog.userAgent.IE||goog.userAgent.EDGE)){var a=Blockly.Field.getCachedWidth(this.arrow_);a=Number(this.imageJson_.width)+a+Blockly.BlockSvg.SEP_SPACE_X;this.borderRect_&&this.borderRect_.setAttribute("width",a);this.size_.width=a}else Blockly.Field.prototype.updateWidth.call(this)};Blockly.FieldDropdown.prototype.dispose=function(){Blockly.WidgetDiv.hideIfOwner(this);Blockly.FieldDropdown.superClass_.dispose.call(this)};Blockly.FieldImage=function(a,b,c,d,e){this.sourceBlock_=null;this.height_=Number(c);this.width_=Number(b);this.size_=new goog.math.Size(this.width_,this.height_+2*Blockly.BlockSvg.INLINE_PADDING_Y);this.text_=d||"";this.setValue(a);"function"===typeof e&&(this.clickHandler_=e)};goog.inherits(Blockly.FieldImage,Blockly.Field);Blockly.FieldImage.prototype.EDITABLE=!1;
|
||||
Blockly.FieldDropdown.prototype.updateWidth=function(){if(this.imageJson_&&(goog.userAgent.IE||goog.userAgent.EDGE)){var a=Blockly.Field.getCachedWidth(this.arrow_);a=Number(this.imageJson_.width)+a+Blockly.BlockSvg.SEP_SPACE_X;this.borderRect_&&this.borderRect_.setAttribute("width",a);this.size_.width=a}else Blockly.Field.prototype.updateWidth.call(this)};Blockly.FieldDropdown.prototype.dispose=function(){Blockly.WidgetDiv.hideIfOwner(this);Blockly.FieldDropdown.superClass_.dispose.call(this)};Blockly.FieldImage=function(a,b,c,d,e){this.sourceBlock_=null;this.height_=Number(c);this.width_=Number(b);this.size_=new goog.math.Size(this.width_,this.height_+2*Blockly.BlockSvg.INLINE_PADDING_Y);this.text_=d||"";this.setValue(a);"function"==typeof e&&(this.clickHandler_=e)};goog.inherits(Blockly.FieldImage,Blockly.Field);Blockly.FieldImage.prototype.EDITABLE=!1;
|
||||
Blockly.FieldImage.prototype.init=function(){this.fieldGroup_||(this.fieldGroup_=Blockly.utils.createSvgElement("g",{},null),this.visible_||(this.fieldGroup_.style.display="none"),this.imageElement_=Blockly.utils.createSvgElement("image",{height:this.height_+"px",width:this.width_+"px"},this.fieldGroup_),this.setValue(this.src_),this.sourceBlock_.getSvgRoot().appendChild(this.fieldGroup_),this.setTooltip(this.sourceBlock_),Blockly.Tooltip.bindMouseEvents(this.imageElement_),this.maybeAddClickHandler_())};
|
||||
Blockly.FieldImage.prototype.dispose=function(){goog.dom.removeNode(this.fieldGroup_);this.imageElement_=this.fieldGroup_=null};Blockly.FieldImage.prototype.maybeAddClickHandler_=function(){this.clickHandler_&&(this.mouseDownWrapper_=Blockly.bindEventWithChecks_(this.fieldGroup_,"mousedown",this,this.onMouseDown_))};Blockly.FieldImage.prototype.setTooltip=function(a){this.imageElement_.tooltip=a};Blockly.FieldImage.prototype.getValue=function(){return this.src_};
|
||||
Blockly.FieldImage.prototype.setValue=function(a){null!==a&&(this.src_=a,this.imageElement_&&this.imageElement_.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a||""))};Blockly.FieldImage.prototype.setText=function(a){null!==a&&(this.text_=a)};Blockly.FieldImage.prototype.render_=function(){};Blockly.FieldImage.prototype.updateWidth=function(){};Blockly.FieldImage.prototype.showEditor_=function(){this.clickHandler_&&this.clickHandler_(this)};Blockly.FieldNumber=function(a,b,c,d,e){a=a&&!isNaN(a)?String(a):"0";Blockly.FieldNumber.superClass_.constructor.call(this,a,e);this.setConstraints(b,c,d)};goog.inherits(Blockly.FieldNumber,Blockly.FieldTextInput);Blockly.FieldNumber.prototype.setConstraints=function(a,b,c){c=parseFloat(c);this.precision_=isNaN(c)?0:c;a=parseFloat(a);this.min_=isNaN(a)?-Infinity:a;b=parseFloat(b);this.max_=isNaN(b)?Infinity:b;this.setValue(this.callValidator(this.getValue()))};
|
||||
@@ -1442,9 +1444,9 @@ Blockly.Variables.flyoutCategory=function(a){var b=[],c=goog.dom.createDom("butt
|
||||
Blockly.Variables.flyoutCategoryBlocks=function(a){a=a.getVariablesOfType("");a.sort(Blockly.VariableModel.compareByName);var b=[];if(0<a.length){var c=a[0];if(Blockly.Blocks.variables_set){var d=Blockly.Blocks.math_change?8:24;d='<xml><block type="variables_set" gap="'+d+'">'+Blockly.Variables.generateVariableFieldXml_(c)+"</block></xml>";d=Blockly.Xml.textToDom(d).firstChild;b.push(d)}Blockly.Blocks.math_change&&(d=Blockly.Blocks.variables_get?20:8,d='<xml><block type="math_change" gap="'+d+'">'+
|
||||
Blockly.Variables.generateVariableFieldXml_(c)+'<value name="DELTA"><shadow type="math_number"><field name="NUM">1</field></shadow></value></block></xml>',d=Blockly.Xml.textToDom(d).firstChild,b.push(d));for(c=0;d=a[c];c++)Blockly.Blocks.variables_get&&(d='<xml><block type="variables_get" gap="8">'+Blockly.Variables.generateVariableFieldXml_(d)+"</block></xml>",d=Blockly.Xml.textToDom(d).firstChild,b.push(d))}return b};
|
||||
Blockly.Variables.generateUniqueName=function(a){a=a.getAllVariables();var b="";if(a.length)for(var c=1,d=0,e="ijkmnopqrstuvwxyzabcdefgh".charAt(d);!b;){for(var f=!1,g=0;g<a.length;g++)if(a[g].name.toLowerCase()==e){f=!0;break}f?(d++,25==d&&(d=0,c++),e="ijkmnopqrstuvwxyzabcdefgh".charAt(d),1<c&&(e+=c)):b=e}else b="i";return b};
|
||||
Blockly.Variables.createVariable=function(a,b,c){var d=function(e){Blockly.Variables.promptName(Blockly.Msg.NEW_VARIABLE_TITLE,e,function(e){e?a.getVariable(e)?Blockly.alert(Blockly.Msg.VARIABLE_ALREADY_EXISTS.replace("%1",e.toLowerCase()),function(){d(e)}):Blockly.Procedures.isNameUsed(e,a)?Blockly.alert(Blockly.Msg.PROCEDURE_ALREADY_EXISTS.replace("%1",e.toLowerCase()),function(){d(e)}):(a.createVariable(e,c),b&&b(e)):b&&b(null)})};d("")};
|
||||
Blockly.Variables.renameVariable=function(a,b,c){var d=function(e){Blockly.Variables.promptName(Blockly.Msg.RENAME_VARIABLE_TITLE.replace("%1",b.name),e,function(e){if(e){var f=a.getVariable(e);f&&f.type!=b.type?Blockly.alert(Blockly.Msg.VARIABLE_ALREADY_EXISTS_FOR_ANOTHER_TYPE.replace("%1",e.toLowerCase()).replace("%2",f.type),function(){d(e)}):Blockly.Procedures.isNameUsed(e,a)?Blockly.alert(Blockly.Msg.PROCEDURE_ALREADY_EXISTS.replace("%1",e.toLowerCase()),function(){d(e)}):(a.renameVariable(b.name,
|
||||
e),c&&c(e))}else c&&c(null)})};d("")};Blockly.Variables.promptName=function(a,b,c){Blockly.prompt(a,b,function(a){a&&(a=a.replace(/[\s\xa0]+/g," ").replace(/^ | $/g,""),a==Blockly.Msg.RENAME_VARIABLE||a==Blockly.Msg.NEW_VARIABLE)&&(a=null);c(a)})};Blockly.Variables.generateVariableFieldXml_=function(a){var b=goog.dom.createDom("field");b.setAttribute("name","VAR");b.setAttribute("variableType",a.type);b.setAttribute("id",a.getId());b.textContent=a.name;return Blockly.Xml.domToText(b)};Blockly.FieldVariable=function(a,b,c){Blockly.FieldVariable.superClass_.constructor.call(this,Blockly.FieldVariable.dropdownCreate,b);this.setValue(a||"");this.variableTypes=c};goog.inherits(Blockly.FieldVariable,Blockly.FieldDropdown);Blockly.FieldVariable.prototype.init=function(){this.fieldGroup_||(Blockly.FieldVariable.superClass_.init.call(this),this.initModel())};
|
||||
Blockly.Variables.createVariable=function(a,b,c){var d=function(e){Blockly.Variables.promptName(Blockly.Msg.NEW_VARIABLE_TITLE,e,function(e){e?a.getVariable(e)?Blockly.alert(Blockly.Msg.VARIABLE_ALREADY_EXISTS.replace("%1",e.toLowerCase()),function(){d(e)}):(a.createVariable(e,c),b&&b(e)):b&&b(null)})};d("")};
|
||||
Blockly.Variables.renameVariable=function(a,b,c){var d=function(e){Blockly.Variables.promptName(Blockly.Msg.RENAME_VARIABLE_TITLE.replace("%1",b.name),e,function(e){if(e){var f=a.getVariable(e);f&&f.type!=b.type?Blockly.alert(Blockly.Msg.VARIABLE_ALREADY_EXISTS_FOR_ANOTHER_TYPE.replace("%1",e.toLowerCase()).replace("%2",f.type),function(){d(e)}):(a.renameVariable(b.name,e),c&&c(e))}else c&&c(null)})};d("")};
|
||||
Blockly.Variables.promptName=function(a,b,c){Blockly.prompt(a,b,function(a){a&&(a=a.replace(/[\s\xa0]+/g," ").replace(/^ | $/g,""),a==Blockly.Msg.RENAME_VARIABLE||a==Blockly.Msg.NEW_VARIABLE)&&(a=null);c(a)})};Blockly.Variables.generateVariableFieldXml_=function(a){var b=goog.dom.createDom("field");b.setAttribute("name","VAR");b.setAttribute("variabletype",a.type);b.setAttribute("id",a.getId());b.textContent=a.name;return Blockly.Xml.domToText(b)};Blockly.FieldVariable=function(a,b,c){Blockly.FieldVariable.superClass_.constructor.call(this,Blockly.FieldVariable.dropdownCreate,b);this.setValue(a||"");this.variableTypes=c};goog.inherits(Blockly.FieldVariable,Blockly.FieldDropdown);Blockly.FieldVariable.prototype.init=function(){this.fieldGroup_||(Blockly.FieldVariable.superClass_.init.call(this),this.initModel())};
|
||||
Blockly.FieldVariable.prototype.initModel=function(){this.getValue()||this.setValue(Blockly.Variables.generateUniqueName(this.sourceBlock_.isInFlyout?this.sourceBlock_.workspace.targetWorkspace:this.sourceBlock_.workspace));this.sourceBlock_.isInFlyout||this.sourceBlock_.workspace.createVariable(this.getValue())};
|
||||
Blockly.FieldVariable.prototype.setSourceBlock=function(a){goog.asserts.assert(!a.isShadow(),"Variable fields are not allowed to exist on shadow blocks.");Blockly.FieldVariable.superClass_.setSourceBlock.call(this,a)};Blockly.FieldVariable.prototype.getValue=function(){return this.getText()};
|
||||
Blockly.FieldVariable.prototype.setValue=function(a){var b=a,c=a;if(this.sourceBlock_){var d=this.sourceBlock_.workspace.getVariableById(a);if(d)c=d.name;else if(d=this.sourceBlock_.workspace.getVariable(a))b=d.getId();Blockly.Events.isEnabled()&&Blockly.Events.fire(new Blockly.Events.BlockChange(this.sourceBlock_,"field",this.name,this.value_,b))}this.value_=b;this.setText(c)};
|
||||
@@ -1459,7 +1461,7 @@ this.STATEMENT_PREFIX.replace(/%1/g,"'"+c+"'")+b);return this.scrub_(a,b)}if(nul
|
||||
Blockly.Generator.prototype.valueToCode=function(a,b,c){isNaN(c)&&goog.asserts.fail('Expecting valid order from block "%s".',a.type);var d=a.getInputTargetBlock(b);if(!d)return"";b=this.blockToCode(d);if(""===b)return"";goog.asserts.assertArray(b,'Expecting tuple from value block "%s".',d.type);a=b[0];b=b[1];isNaN(b)&&goog.asserts.fail('Expecting valid order from value block "%s".',d.type);if(!a)return"";d=!1;var e=Math.floor(c),f=Math.floor(b);if(e<=f&&(e!=f||0!=e&&99!=e))for(d=!0,e=0;e<this.ORDER_OVERRIDES.length;e++)if(this.ORDER_OVERRIDES[e][0]==
|
||||
c&&this.ORDER_OVERRIDES[e][1]==b){d=!1;break}d&&(a="("+a+")");return a};Blockly.Generator.prototype.statementToCode=function(a,b){a=a.getInputTargetBlock(b);b=this.blockToCode(a);goog.asserts.assertString(b,'Expecting code from statement block "%s".',a&&a.type);b&&(b=this.prefixLines(b,this.INDENT));return b};
|
||||
Blockly.Generator.prototype.addLoopTrap=function(a,b){b=b.replace(/\$/g,"$$$$");this.INFINITE_LOOP_TRAP&&(a=this.INFINITE_LOOP_TRAP.replace(/%1/g,"'"+b+"'")+a);this.STATEMENT_PREFIX&&(a+=this.prefixLines(this.STATEMENT_PREFIX.replace(/%1/g,"'"+b+"'"),this.INDENT));return a};Blockly.Generator.prototype.RESERVED_WORDS_="";Blockly.Generator.prototype.addReservedWords=function(a){this.RESERVED_WORDS_+=a+","};Blockly.Generator.prototype.FUNCTION_NAME_PLACEHOLDER_="{leCUI8hutHZI4480Dc}";
|
||||
Blockly.Generator.prototype.provideFunction_=function(a,b){if(!this.definitions_[a]){var c=this.variableDB_.getDistinctName(a,Blockly.Procedures.NAME_TYPE);this.functionNames_[a]=c;b=b.join("\n").replace(this.FUNCTION_NAME_PLACEHOLDER_REGEXP_,c);for(var d;d!=b;)d=b,b=b.replace(/^(( )*) /gm,"$1\x00");b=b.replace(/\0/g,this.INDENT);this.definitions_[a]=b}return this.functionNames_[a]};Blockly.Generator.prototype.init=void 0;Blockly.Generator.prototype.scrub_=void 0;
|
||||
Blockly.Generator.prototype.provideFunction_=function(a,b){if(!this.definitions_[a]){var c=this.variableDB_.getDistinctName(a,Blockly.Procedures.NAME_TYPE);this.functionNames_[a]=c;b=b.join("\n").replace(this.FUNCTION_NAME_PLACEHOLDER_REGEXP_,c);for(var d;d!=b;)d=b,b=b.replace(/^(( {2})*) {2}/gm,"$1\x00");b=b.replace(/\0/g,this.INDENT);this.definitions_[a]=b}return this.functionNames_[a]};Blockly.Generator.prototype.init=void 0;Blockly.Generator.prototype.scrub_=void 0;
|
||||
Blockly.Generator.prototype.finish=void 0;Blockly.Generator.prototype.scrubNakedValue=void 0;Blockly.Names=function(a,b){this.variablePrefix_=b||"";this.reservedDict_=Object.create(null);if(a)for(a=a.split(","),b=0;b<a.length;b++)this.reservedDict_[a[b]]=!0;this.reset()};Blockly.Names.prototype.reset=function(){this.db_=Object.create(null);this.dbReverse_=Object.create(null)};
|
||||
Blockly.Names.prototype.getName=function(a,b){var c=a.toLowerCase()+"_"+b,d=b==Blockly.Variables.NAME_TYPE?this.variablePrefix_:"";if(c in this.db_)return d+this.db_[c];a=this.getDistinctName(a,b);this.db_[c]=a.substr(d.length);return a};Blockly.Names.prototype.getDistinctName=function(a,b){a=this.safeName_(a);for(var c="";this.dbReverse_[a+c]||a+c in this.reservedDict_;)c=c?c+1:2;a+=c;this.dbReverse_[a]=!0;return(b==Blockly.Variables.NAME_TYPE?this.variablePrefix_:"")+a};
|
||||
Blockly.Names.prototype.safeName_=function(a){a?(a=encodeURI(a.replace(/ /g,"_")).replace(/[^\w]/g,"_"),-1!="0123456789".indexOf(a[0])&&(a="my_"+a)):a="unnamed";return a};Blockly.Names.equals=function(a,b){return a.toLowerCase()==b.toLowerCase()};Blockly.Procedures={};Blockly.Procedures.NAME_TYPE=Blockly.PROCEDURE_CATEGORY_NAME;Blockly.Procedures.allProcedures=function(a){a=a.getAllBlocks();for(var b=[],c=[],d=0;d<a.length;d++)if(a[d].getProcedureDef){var e=a[d].getProcedureDef();e&&(e[2]?b.push(e):c.push(e))}c.sort(Blockly.Procedures.procTupleComparator_);b.sort(Blockly.Procedures.procTupleComparator_);return[c,b]};Blockly.Procedures.procTupleComparator_=function(a,b){return a[0].toLowerCase().localeCompare(b[0].toLowerCase())};
|
||||
@@ -1472,10 +1474,10 @@ Blockly.Procedures.mutateCallers=function(a){var b=Blockly.Events.recordUndo,c=a
|
||||
Blockly.Procedures.getDefinition=function(a,b){b=b.getTopBlocks(!1);for(var c=0;c<b.length;c++)if(b[c].getProcedureDef){var d=b[c].getProcedureDef();if(d&&Blockly.Names.equals(d[0],a))return b[c]}return null};Blockly.FlyoutButton=function(a,b,c,d){this.workspace_=a;this.targetWorkspace_=b;this.text_=c.getAttribute("text");this.position_=new goog.math.Coordinate(0,0);this.isLabel_=d;this.callback_=null;a=c.getAttribute("callbackKey");this.isLabel_&&a?console.warn("Labels should not have callbacks. Label text: "+this.text_):this.isLabel_||a&&b.getButtonCallback(a)?this.callback_=b.getButtonCallback(a):console.warn("Buttons should have callbacks. Button text: "+this.text_);this.cssClass_=c.getAttribute("web-class")||
|
||||
null};Blockly.FlyoutButton.MARGIN=5;Blockly.FlyoutButton.prototype.width=0;Blockly.FlyoutButton.prototype.height=0;Blockly.FlyoutButton.prototype.onMouseUpWrapper_=null;
|
||||
Blockly.FlyoutButton.prototype.createDom=function(){var a=this.isLabel_?"blocklyFlyoutLabel":"blocklyFlyoutButton";this.cssClass_&&(a+=" "+this.cssClass_);this.svgGroup_=Blockly.utils.createSvgElement("g",{"class":a},this.workspace_.getCanvas());if(!this.isLabel_)var b=Blockly.utils.createSvgElement("rect",{"class":"blocklyFlyoutButtonShadow",rx:4,ry:4,x:1,y:1},this.svgGroup_);a=Blockly.utils.createSvgElement("rect",{"class":this.isLabel_?"blocklyFlyoutLabelBackground":"blocklyFlyoutButtonBackground",
|
||||
rx:4,ry:4},this.svgGroup_);var c=Blockly.utils.createSvgElement("text",{"class":this.isLabel_?"blocklyFlyoutLabelText":"blocklyText",x:0,y:0,"text-anchor":"middle"},this.svgGroup_);c.textContent=this.text_;this.width=c.getComputedTextLength();this.height=20;this.isLabel_||(this.width+=2*Blockly.FlyoutButton.MARGIN,b.setAttribute("width",this.width),b.setAttribute("height",this.height));a.setAttribute("width",this.width);a.setAttribute("height",this.height);c.setAttribute("x",this.width/2);c.setAttribute("y",
|
||||
rx:4,ry:4},this.svgGroup_);var c=Blockly.utils.createSvgElement("text",{"class":this.isLabel_?"blocklyFlyoutLabelText":"blocklyText",x:0,y:0,"text-anchor":"middle"},this.svgGroup_);c.textContent=this.text_;this.width=Blockly.Field.getCachedWidth(c);this.height=20;this.isLabel_||(this.width+=2*Blockly.FlyoutButton.MARGIN,b.setAttribute("width",this.width),b.setAttribute("height",this.height));a.setAttribute("width",this.width);a.setAttribute("height",this.height);c.setAttribute("x",this.width/2);c.setAttribute("y",
|
||||
this.height-Blockly.FlyoutButton.MARGIN);this.updateTransform_();this.mouseUpWrapper_=Blockly.bindEventWithChecks_(this.svgGroup_,"mouseup",this,this.onMouseUp_);return this.svgGroup_};Blockly.FlyoutButton.prototype.show=function(){this.updateTransform_();this.svgGroup_.setAttribute("display","block")};Blockly.FlyoutButton.prototype.updateTransform_=function(){this.svgGroup_.setAttribute("transform","translate("+this.position_.x+","+this.position_.y+")")};
|
||||
Blockly.FlyoutButton.prototype.moveTo=function(a,b){this.position_.x=a;this.position_.y=b;this.updateTransform_()};Blockly.FlyoutButton.prototype.getTargetWorkspace=function(){return this.targetWorkspace_};Blockly.FlyoutButton.prototype.dispose=function(){this.onMouseUpWrapper_&&Blockly.unbindEvent_(this.onMouseUpWrapper_);this.svgGroup_&&(goog.dom.removeNode(this.svgGroup_),this.svgGroup_=null);this.targetWorkspace_=this.workspace_=null};
|
||||
Blockly.FlyoutButton.prototype.onMouseUp_=function(a){(a=this.targetWorkspace_.getGesture(a))&&a.cancel();this.callback_&&this.callback_(this)};Blockly.Flyout=function(a){a.getMetrics=this.getMetrics_.bind(this);a.setMetrics=this.setMetrics_.bind(this);this.workspace_=new Blockly.WorkspaceSvg(a);this.workspace_.isFlyout=!0;this.RTL=!!a.RTL;this.toolboxPosition_=a.toolboxPosition;this.eventWrappers_=[];this.backgroundButtons_=[];this.buttons_=[];this.listeners_=[];this.permanentlyDisabled_=[]};Blockly.Flyout.prototype.autoClose=!0;Blockly.Flyout.prototype.isVisible_=!1;Blockly.Flyout.prototype.containerVisible_=!0;
|
||||
Blockly.FlyoutButton.prototype.moveTo=function(a,b){this.position_.x=a;this.position_.y=b;this.updateTransform_()};Blockly.FlyoutButton.prototype.getPosition=function(){return this.position_};Blockly.FlyoutButton.prototype.getTargetWorkspace=function(){return this.targetWorkspace_};
|
||||
Blockly.FlyoutButton.prototype.dispose=function(){this.onMouseUpWrapper_&&Blockly.unbindEvent_(this.onMouseUpWrapper_);this.svgGroup_&&(goog.dom.removeNode(this.svgGroup_),this.svgGroup_=null);this.targetWorkspace_=this.workspace_=null};Blockly.FlyoutButton.prototype.onMouseUp_=function(a){(a=this.targetWorkspace_.getGesture(a))&&a.cancel();this.callback_&&this.callback_(this)};Blockly.Flyout=function(a){a.getMetrics=this.getMetrics_.bind(this);a.setMetrics=this.setMetrics_.bind(this);this.workspace_=new Blockly.WorkspaceSvg(a);this.workspace_.isFlyout=!0;this.RTL=!!a.RTL;this.toolboxPosition_=a.toolboxPosition;this.eventWrappers_=[];this.mats_=[];this.buttons_=[];this.listeners_=[];this.permanentlyDisabled_=[]};Blockly.Flyout.prototype.autoClose=!0;Blockly.Flyout.prototype.isVisible_=!1;Blockly.Flyout.prototype.containerVisible_=!0;
|
||||
Blockly.Flyout.prototype.CORNER_RADIUS=8;Blockly.Flyout.prototype.MARGIN=Blockly.Flyout.prototype.CORNER_RADIUS;Blockly.Flyout.prototype.GAP_X=3*Blockly.Flyout.prototype.MARGIN;Blockly.Flyout.prototype.GAP_Y=3*Blockly.Flyout.prototype.MARGIN;Blockly.Flyout.prototype.SCROLLBAR_PADDING=2;Blockly.Flyout.prototype.width_=0;Blockly.Flyout.prototype.height_=0;Blockly.Flyout.prototype.dragAngleRange_=70;
|
||||
Blockly.Flyout.prototype.createDom=function(a){this.svgGroup_=Blockly.utils.createSvgElement(a,{"class":"blocklyFlyout",style:"display: none"},null);this.svgBackground_=Blockly.utils.createSvgElement("path",{"class":"blocklyFlyoutBackground"},this.svgGroup_);this.svgGroup_.appendChild(this.workspace_.createDom());return this.svgGroup_};
|
||||
Blockly.Flyout.prototype.init=function(a){this.targetWorkspace_=a;this.workspace_.targetWorkspace=a;this.scrollbar_=new Blockly.Scrollbar(this.workspace_,this.horizontalLayout_,!1,"blocklyFlyoutScrollbar");this.hide();Array.prototype.push.apply(this.eventWrappers_,Blockly.bindEventWithChecks_(this.svgGroup_,"wheel",this,this.wheel_));this.autoClose||(this.filterWrapper_=this.filterForCapacity_.bind(this),this.targetWorkspace_.addChangeListener(this.filterWrapper_));Array.prototype.push.apply(this.eventWrappers_,
|
||||
@@ -1489,14 +1491,14 @@ Blockly.Flyout.prototype.hide=function(){if(this.isVisible()){this.setVisible(!1
|
||||
Blockly.Flyout.prototype.show=function(a){this.workspace_.setResizesEnabled(!1);this.hide();this.clearOldBlocks_();"string"==typeof a&&(a=this.workspace_.targetWorkspace.getToolboxCategoryCallback(a),goog.asserts.assert(goog.isFunction(a),"Couldn't find a callback function when opening a toolbox category."),a=a(this.workspace_.targetWorkspace),goog.asserts.assert(goog.isArray(a),"The result of a toolbox category callback must be an array."));this.setVisible(!0);for(var b=[],c=[],d=this.permanentlyDisabled_.length=
|
||||
0,e;e=a[d];d++)if(e.tagName){var f=e.tagName.toUpperCase(),g=this.horizontalLayout_?this.GAP_X:this.GAP_Y;if("BLOCK"==f)f=Blockly.Xml.domToBlock(e,this.workspace_),f.disabled&&this.permanentlyDisabled_.push(f),b.push({type:"block",block:f}),e=parseInt(e.getAttribute("gap"),10),c.push(isNaN(e)?g:e);else if("SEP"==e.tagName.toUpperCase())e=parseInt(e.getAttribute("gap"),10),!isNaN(e)&&0<c.length?c[c.length-1]=e:c.push(g);else if("BUTTON"==f||"LABEL"==f)e=new Blockly.FlyoutButton(this.workspace_,this.targetWorkspace_,
|
||||
e,"LABEL"==f),b.push({type:"button",button:e}),c.push(g)}this.layout_(b,c);this.listeners_.push(Blockly.bindEventWithChecks_(this.svgBackground_,"mouseover",this,function(){for(var a=this.workspace_.getTopBlocks(!1),b=0,c;c=a[b];b++)c.removeSelect()}));this.horizontalLayout_?this.height_=0:this.width_=0;this.workspace_.setResizesEnabled(!0);this.reflow();this.filterForCapacity_();this.position();this.reflowWrapper_=this.reflow.bind(this);this.workspace_.addChangeListener(this.reflowWrapper_)};
|
||||
Blockly.Flyout.prototype.clearOldBlocks_=function(){for(var a=this.workspace_.getTopBlocks(!1),b=0,c;c=a[b];b++)c.workspace==this.workspace_&&c.dispose(!1,!1);for(b=0;b<this.backgroundButtons_.length;b++)(a=this.backgroundButtons_[b])&&goog.dom.removeNode(a);for(b=this.backgroundButtons_.length=0;a=this.buttons_[b];b++)a.dispose();this.buttons_.length=0};
|
||||
Blockly.Flyout.prototype.clearOldBlocks_=function(){for(var a=this.workspace_.getTopBlocks(!1),b=0,c;c=a[b];b++)c.workspace==this.workspace_&&c.dispose(!1,!1);for(b=0;b<this.mats_.length;b++)(a=this.mats_[b])&&goog.dom.removeNode(a);for(b=this.mats_.length=0;a=this.buttons_[b];b++)a.dispose();this.buttons_.length=0};
|
||||
Blockly.Flyout.prototype.addBlockListeners_=function(a,b,c){this.listeners_.push(Blockly.bindEventWithChecks_(a,"mousedown",null,this.blockMouseDown_(b)));this.listeners_.push(Blockly.bindEventWithChecks_(c,"mousedown",null,this.blockMouseDown_(b)));this.listeners_.push(Blockly.bindEvent_(a,"mouseover",b,b.addSelect));this.listeners_.push(Blockly.bindEvent_(a,"mouseout",b,b.removeSelect));this.listeners_.push(Blockly.bindEvent_(c,"mouseover",b,b.addSelect));this.listeners_.push(Blockly.bindEvent_(c,
|
||||
"mouseout",b,b.removeSelect))};Blockly.Flyout.prototype.blockMouseDown_=function(a){var b=this;return function(c){var d=b.targetWorkspace_.getGesture(c);d&&(d.setStartBlock(a),d.handleFlyoutStart(c,b))}};Blockly.Flyout.prototype.onMouseDown_=function(a){var b=this.targetWorkspace_.getGesture(a);b&&b.handleFlyoutStart(a,this)};
|
||||
Blockly.Flyout.prototype.createBlock=function(a){var b=null;Blockly.Events.disable();this.targetWorkspace_.setResizesEnabled(!1);try{b=this.placeNewBlock_(a),Blockly.hideChaff()}finally{Blockly.Events.enable()}Blockly.Events.isEnabled()&&(Blockly.Events.setGroup(!0),Blockly.Events.fire(new Blockly.Events.Create(b)));this.autoClose?this.hide():this.filterForCapacity_();return b};
|
||||
Blockly.Flyout.prototype.initFlyoutButton_=function(a,b,c){var d=a.createDom();a.moveTo(b,c);a.show();this.listeners_.push(Blockly.bindEventWithChecks_(d,"mousedown",this,this.onMouseDown_));this.buttons_.push(a)};
|
||||
Blockly.Flyout.prototype.createRect_=function(a,b,c,d,e){b=Blockly.utils.createSvgElement("rect",{"fill-opacity":0,x:b,y:c,height:d.height,width:d.width},null);b.tooltip=a;Blockly.Tooltip.bindMouseEvents(b);this.workspace_.getCanvas().insertBefore(b,a.getSvgRoot());a.flyoutRect_=b;return this.backgroundButtons_[e]=b};
|
||||
Blockly.Flyout.prototype.createRect_=function(a,b,c,d,e){b=Blockly.utils.createSvgElement("rect",{"fill-opacity":0,x:b,y:c,height:d.height,width:d.width},null);b.tooltip=a;Blockly.Tooltip.bindMouseEvents(b);this.workspace_.getCanvas().insertBefore(b,a.getSvgRoot());a.flyoutRect_=b;return this.mats_[e]=b};
|
||||
Blockly.Flyout.prototype.moveRectToBlock_=function(a,b){var c=b.getHeightWidth();a.setAttribute("width",c.width);a.setAttribute("height",c.height);var d=b.startHat_?Blockly.BlockSvg.START_HAT_HEIGHT:0;d&&b.moveBy(0,d);d=b.outputConnection?Blockly.BlockSvg.TAB_WIDTH:0;b=b.getRelativeToSurfaceXY();a.setAttribute("y",b.y);a.setAttribute("x",this.RTL?b.x-c.width+d:b.x-d)};
|
||||
Blockly.Flyout.prototype.filterForCapacity_=function(){for(var a=this.targetWorkspace_.remainingCapacity(),b=this.workspace_.getTopBlocks(!1),c=0,d;d=b[c];c++)if(-1==this.permanentlyDisabled_.indexOf(d)){var e=d.getDescendants();d.setDisabled(e.length>a)}};Blockly.Flyout.prototype.reflow=function(){this.reflowWrapper_&&this.workspace_.removeChangeListener(this.reflowWrapper_);var a=this.workspace_.getTopBlocks(!1);this.reflowInternal_(a);this.reflowWrapper_&&this.workspace_.addChangeListener(this.reflowWrapper_)};
|
||||
Blockly.Flyout.prototype.filterForCapacity_=function(){for(var a=this.targetWorkspace_.remainingCapacity(),b=this.workspace_.getTopBlocks(!1),c=0,d;d=b[c];c++)if(-1==this.permanentlyDisabled_.indexOf(d)){var e=d.getDescendants();d.setDisabled(e.length>a)}};Blockly.Flyout.prototype.reflow=function(){this.reflowWrapper_&&this.workspace_.removeChangeListener(this.reflowWrapper_);this.reflowInternal_();this.reflowWrapper_&&this.workspace_.addChangeListener(this.reflowWrapper_)};
|
||||
Blockly.Flyout.prototype.isScrollable=function(){return this.scrollbar_?this.scrollbar_.isVisible():!1};
|
||||
Blockly.Flyout.prototype.placeNewBlock_=function(a){var b=this.targetWorkspace_;if(!a.getSvgRoot())throw"oldBlock is not rendered.";var c=Blockly.Xml.blockToDom(a);b.setResizesEnabled(!1);c=Blockly.Xml.domToBlock(c,b);if(!c.getSvgRoot())throw"block is not rendered.";var d=b.getOriginOffsetInPixels(),e=this.workspace_.getOriginOffsetInPixels();a=a.getRelativeToSurfaceXY().scale(this.workspace_.scale);a=goog.math.Coordinate.sum(e,a);b=goog.math.Coordinate.difference(a,d).scale(1/b.scale);c.moveBy(b.x,
|
||||
b.y);return c};Blockly.HorizontalFlyout=function(a){a.getMetrics=this.getMetrics_.bind(this);a.setMetrics=this.setMetrics_.bind(this);Blockly.HorizontalFlyout.superClass_.constructor.call(this,a);this.horizontalLayout_=!0};goog.inherits(Blockly.HorizontalFlyout,Blockly.Flyout);
|
||||
@@ -1509,7 +1511,7 @@ Blockly.HorizontalFlyout.prototype.wheel_=function(a){var b=a.deltaX;if(b){goog.
|
||||
Blockly.HorizontalFlyout.prototype.layout_=function(a,b){this.workspace_.scale=this.targetWorkspace_.scale;var c=this.MARGIN,d=this.RTL?c:c+Blockly.BlockSvg.TAB_WIDTH;this.RTL&&(a=a.reverse());for(var e=0,f;f=a[e];e++)if("block"==f.type){f=f.block;for(var g=f.getDescendants(),h=0,k;k=g[h];h++)k.isInFlyout=!0;f.render();g=f.getSvgRoot();h=f.getHeightWidth();k=f.outputConnection?Blockly.BlockSvg.TAB_WIDTH:0;k=this.RTL?d+h.width:d+k;f.moveBy(k,c);k=this.createRect_(f,k,c,h,e);d+=h.width+b[e];this.addBlockListeners_(g,
|
||||
f,k)}else"button"==f.type&&(this.initFlyoutButton_(f.button,d,c),d+=f.button.width+b[e])};Blockly.HorizontalFlyout.prototype.isDragTowardWorkspace=function(a){a=Math.atan2(a.y,a.x)/Math.PI*180;var b=this.dragAngleRange_;if(this.toolboxPosition_==Blockly.TOOLBOX_AT_TOP){if(a<90+b&&a>90-b)return!0}else if(a>-90-b&&a<-90+b)return!0;return!1};
|
||||
Blockly.HorizontalFlyout.prototype.getClientRect=function(){if(!this.svgGroup_)return null;var a=this.svgGroup_.getBoundingClientRect(),b=a.top;a=a.height;if(this.toolboxPosition_==Blockly.TOOLBOX_AT_TOP)return new goog.math.Rect(-1E9,b-1E9,2E9,1E9+a);if(this.toolboxPosition_==Blockly.TOOLBOX_AT_BOTTOM)return new goog.math.Rect(-1E9,b,2E9,1E9+a)};
|
||||
Blockly.HorizontalFlyout.prototype.reflowInternal_=function(a){this.workspace_.scale=this.targetWorkspace_.scale;for(var b=0,c=0,d;d=a[c];c++)b=Math.max(b,d.getHeightWidth().height);b+=1.5*this.MARGIN;b*=this.workspace_.scale;b+=Blockly.Scrollbar.scrollbarThickness;if(this.height_!=b){for(c=0;d=a[c];c++)d.flyoutRect_&&this.moveRectToBlock_(d.flyoutRect_,d);this.height_=b;this.targetWorkspace_.resize()}};Blockly.VerticalFlyout=function(a){a.getMetrics=this.getMetrics_.bind(this);a.setMetrics=this.setMetrics_.bind(this);Blockly.VerticalFlyout.superClass_.constructor.call(this,a);this.horizontalLayout_=!1};goog.inherits(Blockly.VerticalFlyout,Blockly.Flyout);
|
||||
Blockly.HorizontalFlyout.prototype.reflowInternal_=function(){this.workspace_.scale=this.targetWorkspace_.scale;for(var a=0,b=this.workspace_.getTopBlocks(!1),c=0,d;d=b[c];c++)a=Math.max(a,d.getHeightWidth().height);a+=1.5*this.MARGIN;a*=this.workspace_.scale;a+=Blockly.Scrollbar.scrollbarThickness;if(this.height_!=a){for(c=0;d=b[c];c++)d.flyoutRect_&&this.moveRectToBlock_(d.flyoutRect_,d);this.height_=a;this.targetWorkspace_.resize()}};Blockly.VerticalFlyout=function(a){a.getMetrics=this.getMetrics_.bind(this);a.setMetrics=this.setMetrics_.bind(this);Blockly.VerticalFlyout.superClass_.constructor.call(this,a);this.horizontalLayout_=!1};goog.inherits(Blockly.VerticalFlyout,Blockly.Flyout);
|
||||
Blockly.VerticalFlyout.prototype.getMetrics_=function(){if(!this.isVisible())return null;try{var a=this.workspace_.getCanvas().getBBox()}catch(e){a={height:0,y:0,width:0,x:0}}var b=this.SCROLLBAR_PADDING,c=this.height_-2*this.SCROLLBAR_PADDING,d=this.width_;this.RTL||(d-=this.SCROLLBAR_PADDING);return{viewHeight:c,viewWidth:d,contentHeight:a.height*this.workspace_.scale+2*this.MARGIN,contentWidth:a.width*this.workspace_.scale+2*this.MARGIN,viewTop:-this.workspace_.scrollY+a.y,viewLeft:-this.workspace_.scrollX,
|
||||
contentTop:a.y,contentLeft:a.x,absoluteTop:b,absoluteLeft:0}};Blockly.VerticalFlyout.prototype.setMetrics_=function(a){var b=this.getMetrics_();b&&(goog.isNumber(a.y)&&(this.workspace_.scrollY=-b.contentHeight*a.y),this.workspace_.translate(this.workspace_.scrollX+b.absoluteLeft,this.workspace_.scrollY+b.absoluteTop))};
|
||||
Blockly.VerticalFlyout.prototype.position=function(){if(this.isVisible()){var a=this.targetWorkspace_.getMetrics();if(a){this.height_=a.viewHeight;this.setBackgroundPath_(this.width_-this.CORNER_RADIUS,a.viewHeight-2*this.CORNER_RADIUS);var b=a.absoluteTop,c=a.absoluteLeft;this.toolboxPosition_==Blockly.TOOLBOX_AT_RIGHT&&(c+=a.viewWidth-this.width_);this.positionAt_(this.width_,this.height_,c,b)}}};
|
||||
@@ -1518,8 +1520,8 @@ d.join(" "))};Blockly.VerticalFlyout.prototype.scrollToStart=function(){this.scr
|
||||
Blockly.VerticalFlyout.prototype.layout_=function(a,b){this.workspace_.scale=this.targetWorkspace_.scale;for(var c=this.MARGIN,d=this.RTL?c:c+Blockly.BlockSvg.TAB_WIDTH,e=0,f;f=a[e];e++)if("block"==f.type){f=f.block;for(var g=f.getDescendants(),h=0,k;k=g[h];h++)k.isInFlyout=!0;f.render();g=f.getSvgRoot();h=f.getHeightWidth();f.moveBy(d,c);k=this.createRect_(f,this.RTL?d-h.width:d,c,h,e);this.addBlockListeners_(g,f,k);c+=h.height+b[e]}else"button"==f.type&&(this.initFlyoutButton_(f.button,d,c),c+=
|
||||
f.button.height+b[e])};Blockly.VerticalFlyout.prototype.isDragTowardWorkspace=function(a){a=Math.atan2(a.y,a.x)/Math.PI*180;var b=this.dragAngleRange_;if(this.toolboxPosition_==Blockly.TOOLBOX_AT_LEFT){if(a<b&&a>-b)return!0}else if(a<-180+b||a>180-b)return!0;return!1};
|
||||
Blockly.VerticalFlyout.prototype.getClientRect=function(){if(!this.svgGroup_)return null;var a=this.svgGroup_.getBoundingClientRect(),b=a.left;a=a.width;return this.toolboxPosition_==Blockly.TOOLBOX_AT_LEFT?new goog.math.Rect(b-1E9,-1E9,1E9+a,2E9):new goog.math.Rect(b,-1E9,1E9+a,2E9)};
|
||||
Blockly.VerticalFlyout.prototype.reflowInternal_=function(a){this.workspace_.scale=this.targetWorkspace_.scale;for(var b=0,c=0,d;d=a[c];c++){var e=d.getHeightWidth().width;d.outputConnection&&(e-=Blockly.BlockSvg.TAB_WIDTH);b=Math.max(b,e)}for(c=0;d=this.buttons_[c];c++)b=Math.max(b,d.width);b+=1.5*this.MARGIN+Blockly.BlockSvg.TAB_WIDTH;b*=this.workspace_.scale;b+=Blockly.Scrollbar.scrollbarThickness;if(this.width_!=b){for(c=0;d=a[c];c++){if(this.RTL){e=d.getRelativeToSurfaceXY().x;var f=b/this.workspace_.scale-
|
||||
this.MARGIN;f-=Blockly.BlockSvg.TAB_WIDTH;d.moveBy(f-e,0)}d.flyoutRect_&&this.moveRectToBlock_(d.flyoutRect_,d)}this.width_=b;this.targetWorkspace_.resize()}};Blockly.Toolbox=function(a){this.workspace_=a;this.RTL=a.options.RTL;this.horizontalLayout_=a.options.horizontalLayout;this.toolboxPosition=a.options.toolboxPosition;this.config_={indentWidth:19,cssRoot:"blocklyTreeRoot",cssHideRoot:"blocklyHidden",cssItem:"",cssTreeRow:"blocklyTreeRow",cssItemLabel:"blocklyTreeLabel",cssTreeIcon:"blocklyTreeIcon",cssExpandedFolderIcon:"blocklyTreeIconOpen",cssFileIcon:"blocklyTreeIconNone",cssSelectedRow:"blocklyTreeSelected"};this.treeSeparatorConfig_={cssTreeRow:"blocklyTreeSeparator"};
|
||||
Blockly.VerticalFlyout.prototype.reflowInternal_=function(){this.workspace_.scale=this.targetWorkspace_.scale;for(var a=0,b=this.workspace_.getTopBlocks(!1),c=0,d;d=b[c];c++){var e=d.getHeightWidth().width;d.outputConnection&&(e-=Blockly.BlockSvg.TAB_WIDTH);a=Math.max(a,e)}for(c=0;d=this.buttons_[c];c++)a=Math.max(a,d.width);a+=1.5*this.MARGIN+Blockly.BlockSvg.TAB_WIDTH;a*=this.workspace_.scale;a+=Blockly.Scrollbar.scrollbarThickness;if(this.width_!=a){for(c=0;d=b[c];c++)this.RTL&&(e=d.getRelativeToSurfaceXY().x,
|
||||
d.moveBy(a/this.workspace_.scale-this.MARGIN-Blockly.BlockSvg.TAB_WIDTH-e,0)),d.flyoutRect_&&this.moveRectToBlock_(d.flyoutRect_,d);if(this.RTL)for(c=0;d=this.buttons_[c];c++)b=d.getPosition().y,d.moveTo(a-d.width-this.MARGIN-Blockly.BlockSvg.TAB_WIDTH,b);this.width_=a;this.targetWorkspace_.resize()}};Blockly.Toolbox=function(a){this.workspace_=a;this.RTL=a.options.RTL;this.horizontalLayout_=a.options.horizontalLayout;this.toolboxPosition=a.options.toolboxPosition;this.config_={indentWidth:19,cssRoot:"blocklyTreeRoot",cssHideRoot:"blocklyHidden",cssItem:"",cssTreeRow:"blocklyTreeRow",cssItemLabel:"blocklyTreeLabel",cssTreeIcon:"blocklyTreeIcon",cssExpandedFolderIcon:"blocklyTreeIconOpen",cssFileIcon:"blocklyTreeIconNone",cssSelectedRow:"blocklyTreeSelected"};this.treeSeparatorConfig_={cssTreeRow:"blocklyTreeSeparator"};
|
||||
this.horizontalLayout_&&(this.config_.cssTreeRow+=a.RTL?" blocklyHorizontalTreeRtl":" blocklyHorizontalTree",this.treeSeparatorConfig_.cssTreeRow="blocklyTreeSeparatorHorizontal "+(a.RTL?"blocklyHorizontalTreeRtl":"blocklyHorizontalTree"),this.config_.cssTreeIcon="")};Blockly.Toolbox.prototype.width=0;Blockly.Toolbox.prototype.height=0;Blockly.Toolbox.prototype.selectedOption_=null;Blockly.Toolbox.prototype.lastCategory_=null;
|
||||
Blockly.Toolbox.prototype.init=function(){var a=this.workspace_,b=this.workspace_.getParentSvg();this.HtmlDiv=goog.dom.createDom("DIV","blocklyToolboxDiv");this.HtmlDiv.setAttribute("dir",a.RTL?"RTL":"LTR");b.parentNode.insertBefore(this.HtmlDiv,b);Blockly.bindEventWithChecks_(this.HtmlDiv,"mousedown",this,function(a){Blockly.utils.isRightButton(a)||a.target==this.HtmlDiv?Blockly.hideChaff(!1):Blockly.hideChaff(!0);Blockly.Touch.clearTouchIdentifier()},!1,!0);b={disabledPatternId:a.options.disabledPatternId,
|
||||
parentWorkspace:a,RTL:a.RTL,oneBasedIndex:a.options.oneBasedIndex,horizontalLayout:a.horizontalLayout,toolboxPosition:a.options.toolboxPosition};this.flyout_=null;this.flyout_=a.horizontalLayout?new Blockly.HorizontalFlyout(b):new Blockly.VerticalFlyout(b);goog.dom.insertSiblingAfter(this.flyout_.createDom("svg"),this.workspace_.getParentSvg());this.flyout_.init(a);this.config_.cleardotPath=a.options.pathToMedia+"1x1.gif";this.config_.cssCollapsedFolderIcon="blocklyTreeIconClosed"+(a.RTL?"Rtl":"Ltr");
|
||||
@@ -1527,7 +1529,7 @@ this.tree_=b=new Blockly.Toolbox.TreeControl(this,this.config_);b.setShowRootNod
|
||||
Blockly.Toolbox.prototype.getHeight=function(){return this.height};
|
||||
Blockly.Toolbox.prototype.position=function(){var a=this.HtmlDiv;if(a){var b=this.workspace_.getParentSvg();b=Blockly.svgSize(b);this.horizontalLayout_?(a.style.left="0",a.style.height="auto",a.style.width=b.width+"px",this.height=a.offsetHeight,this.toolboxPosition==Blockly.TOOLBOX_AT_TOP?a.style.top="0":a.style.bottom="0"):(this.toolboxPosition==Blockly.TOOLBOX_AT_RIGHT?a.style.right="0":a.style.left="0",a.style.height=b.height+"px",this.width=a.offsetWidth);this.flyout_.position()}};
|
||||
Blockly.Toolbox.prototype.populate_=function(a){this.tree_.removeChildren();this.tree_.blocks=[];this.hasColours_=!1;a=this.syncTrees_(a,this.tree_,this.workspace_.options.pathToMedia);if(this.tree_.blocks.length)throw"Toolbox cannot have both blocks and categories in the root level.";this.workspace_.resizeContents();return a};
|
||||
Blockly.Toolbox.prototype.syncTrees_=function(a,b,c){for(var d=null,e=null,f=0,g;g=a.childNodes[f];f++)if(g.tagName)switch(g.tagName.toUpperCase()){case "CATEGORY":e=Blockly.utils.replaceMessageReferences(g.getAttribute("name"));e=this.tree_.createNode(e);e.blocks=[];b.add(e);var h=g.getAttribute("custom");h?e.blocks=h:(h=this.syncTrees_(g,e,c))&&(d=h);h=Blockly.utils.replaceMessageReferences(g.getAttribute("colour"));goog.isString(h)?(h.match(/^#[0-9a-fA-F]{6}$/)?e.hexColour=h:e.hexColour=Blockly.hueToRgb(h),
|
||||
Blockly.Toolbox.prototype.syncTrees_=function(a,b,c){for(var d=null,e=null,f=0,g;g=a.childNodes[f];f++)if(g.tagName)switch(g.tagName.toUpperCase()){case "CATEGORY":e=Blockly.utils.replaceMessageReferences(g.getAttribute("name"));e=this.tree_.createNode(e);e.blocks=[];b.add(e);var h=g.getAttribute("custom");h?e.blocks=h:(h=this.syncTrees_(g,e,c))&&(d=h);h=Blockly.utils.replaceMessageReferences(g.getAttribute("colour"));goog.isString(h)?(/^#[0-9a-fA-F]{6}$/.test(h)?e.hexColour=h:e.hexColour=Blockly.hueToRgb(Number(h)),
|
||||
this.hasColours_=!0):e.hexColour="";"true"==g.getAttribute("expanded")?(e.blocks.length&&(d=e),e.setExpanded(!0)):e.setExpanded(!1);e=g;break;case "SEP":e&&("CATEGORY"==e.tagName.toUpperCase()?b.add(new Blockly.Toolbox.TreeSeparator(this.treeSeparatorConfig_)):(g=parseFloat(g.getAttribute("gap")),!isNaN(g)&&e&&e.setAttribute("gap",g)));break;case "BLOCK":case "SHADOW":case "LABEL":case "BUTTON":b.blocks.push(g),e=g}return d};
|
||||
Blockly.Toolbox.prototype.addColour_=function(a){a=(a||this.tree_).getChildren();for(var b=0,c;c=a[b];b++){var d=c.getRowElement();if(d){var e=this.hasColours_?"8px solid "+(c.hexColour||"#ddd"):"none";this.workspace_.RTL?d.style.borderRight=e:d.style.borderLeft=e}this.addColour_(c)}};Blockly.Toolbox.prototype.clearSelection=function(){this.tree_.setSelectedItem(null)};Blockly.Toolbox.prototype.addDeleteStyle=function(){Blockly.utils.addClass(this.HtmlDiv,"blocklyToolboxDelete")};
|
||||
Blockly.Toolbox.prototype.removeDeleteStyle=function(){Blockly.utils.removeClass(this.HtmlDiv,"blocklyToolboxDelete")};
|
||||
@@ -1539,7 +1541,7 @@ Blockly.Toolbox.TreeControl.prototype.setSelectedItem=function(a){var b=this.too
|
||||
a&&c!=this&&(c=new Blockly.Events.Ui(null,"category",c&&c.getHtml(),a&&a.getHtml()),c.workspaceId=b.workspace_.id,Blockly.Events.fire(c));a&&(b.lastCategory_=a)}};Blockly.Toolbox.TreeNode=function(a,b,c,d){goog.ui.tree.TreeNode.call(this,b,c,d);a&&(b=function(){Blockly.svgResize(a.workspace_)},goog.events.listen(a.tree_,goog.ui.tree.BaseNode.EventType.EXPAND,b),goog.events.listen(a.tree_,goog.ui.tree.BaseNode.EventType.COLLAPSE,b))};goog.inherits(Blockly.Toolbox.TreeNode,goog.ui.tree.TreeNode);
|
||||
Blockly.Toolbox.TreeNode.prototype.getExpandIconSafeHtml=function(){return goog.html.SafeHtml.create("span")};Blockly.Toolbox.TreeNode.prototype.onClick_=function(a){this.hasChildren()&&this.isUserCollapsible_?(this.toggle(),this.select()):this.isSelected()?this.getTree().setSelectedItem(null):this.select();this.updateRow()};Blockly.Toolbox.TreeNode.prototype.onMouseDown=function(a){};Blockly.Toolbox.TreeNode.prototype.onDoubleClick_=function(a){};
|
||||
Blockly.Toolbox.TreeNode.prototype.onKeyDown=function(a){if(this.tree.toolbox_.horizontalLayout_){var b={},c=goog.events.KeyCodes.DOWN,d=goog.events.KeyCodes.UP;b[goog.events.KeyCodes.RIGHT]=this.rightToLeft_?d:c;b[goog.events.KeyCodes.LEFT]=this.rightToLeft_?c:d;b[goog.events.KeyCodes.UP]=goog.events.KeyCodes.LEFT;b[goog.events.KeyCodes.DOWN]=goog.events.KeyCodes.RIGHT;a.keyCode=b[a.keyCode]||a.keyCode}return Blockly.Toolbox.TreeNode.superClass_.onKeyDown.call(this,a)};
|
||||
Blockly.Toolbox.TreeSeparator=function(a){Blockly.Toolbox.TreeNode.call(this,null,"",a)};goog.inherits(Blockly.Toolbox.TreeSeparator,Blockly.Toolbox.TreeNode);Blockly.Css={};Blockly.Css.Cursor={OPEN:"handopen",CLOSED:"handclosed",DELETE:"handdelete"};Blockly.Css.currentCursor_="";Blockly.Css.styleSheet_=null;Blockly.Css.mediaPath_="";
|
||||
Blockly.Toolbox.TreeSeparator=function(a){Blockly.Toolbox.TreeNode.call(this,null,goog.html.SafeHtml.EMPTY,a)};goog.inherits(Blockly.Toolbox.TreeSeparator,Blockly.Toolbox.TreeNode);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){if(!Blockly.Css.styleSheet_){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(/<<<PATH>>>/g,Blockly.Css.mediaPath_);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: #fff;","outline: none;","overflow: hidden;","position: absolute;","display: block;","}",".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;","-ms-user-select: none;","}",".blocklyWsDragSurface {","display: none;",
|
||||
"position: absolute;","top: 0;","left: 0;","}",".blocklyWsDragSurface.blocklyOverflowVisible {","overflow: visible;","}",".blocklyBlockDragSurface {","display: none;","position: absolute;","top: 0;","left: 0;","right: 0;","bottom: 0;","overflow: visible !important;","z-index: 50;","}",".blocklyTooltipDiv {","background-color: #ffffc7;","border: 1px solid #ddc;","box-shadow: 4px 4px 20px 1px rgba(0,0,0,.15);","color: #000;","display: none;","font-family: sans-serif;","font-size: 9pt;","opacity: 0.9;",
|
||||
@@ -1572,7 +1574,7 @@ Blockly.BlockDragSurfaceSvg.prototype.createDom=function(){this.SVG_||(this.SVG_
|
||||
Blockly.BlockDragSurfaceSvg.prototype.setBlocksAndShow=function(a){goog.asserts.assert(0==this.dragGroup_.childNodes.length,"Already dragging a block.");this.dragGroup_.appendChild(a);this.SVG_.style.display="block";this.surfaceXY_=new goog.math.Coordinate(0,0)};Blockly.BlockDragSurfaceSvg.prototype.translateAndScaleGroup=function(a,b,c){this.scale_=c;a=a.toFixed(0);b=b.toFixed(0);this.dragGroup_.setAttribute("transform","translate("+a+","+b+") scale("+c+")")};
|
||||
Blockly.BlockDragSurfaceSvg.prototype.translateSurfaceInternal_=function(){var a=this.surfaceXY_.x,b=this.surfaceXY_.y;a=a.toFixed(0);b=b.toFixed(0);this.SVG_.style.display="block";Blockly.utils.setCssTransform(this.SVG_,"translate3d("+a+"px, "+b+"px, 0px)")};Blockly.BlockDragSurfaceSvg.prototype.translateSurface=function(a,b){this.surfaceXY_=new goog.math.Coordinate(a*this.scale_,b*this.scale_);this.translateSurfaceInternal_()};
|
||||
Blockly.BlockDragSurfaceSvg.prototype.getSurfaceTranslation=function(){var a=Blockly.utils.getRelativeXY(this.SVG_);return new goog.math.Coordinate(a.x/this.scale_,a.y/this.scale_)};Blockly.BlockDragSurfaceSvg.prototype.getGroup=function(){return this.dragGroup_};Blockly.BlockDragSurfaceSvg.prototype.getCurrentBlock=function(){return this.dragGroup_.firstChild};
|
||||
Blockly.BlockDragSurfaceSvg.prototype.clearAndHide=function(a){a?a.appendChild(this.getCurrentBlock()):this.dragGroup_.removeChild(this.getCurrentBlock());this.SVG_.style.display="none";goog.asserts.assert(0==this.dragGroup_.childNodes.length,"Drag group was not cleared.");this.surfaceXY_=null};Blockly.inject=function(a,b){goog.isString(a)&&(a=document.getElementById(a)||document.querySelector(a));if(!goog.dom.contains(document,a))throw"Error: container is not in current document.";b=new Blockly.Options(b||{});var c=goog.dom.createDom("div","injectionDiv");a.appendChild(c);a=Blockly.createDom_(c,b);var d=new Blockly.BlockDragSurfaceSvg(c);c=new Blockly.WorkspaceDragSurfaceSvg(c);b=Blockly.createMainWorkspace_(a,b,d,c);Blockly.init_(b);Blockly.mainWorkspace=b;Blockly.svgResize(b);return b};
|
||||
Blockly.BlockDragSurfaceSvg.prototype.clearAndHide=function(a){a?a.appendChild(this.getCurrentBlock()):this.dragGroup_.removeChild(this.getCurrentBlock());this.SVG_.style.display="none";goog.asserts.assert(0==this.dragGroup_.childNodes.length,"Drag group was not cleared.");this.surfaceXY_=null};Blockly.inject=function(a,b){goog.isString(a)&&(a=document.getElementById(a)||document.querySelector(a));if(!goog.dom.contains(document,a))throw"Error: container is not in current document.";b=new Blockly.Options(b||{});var c=goog.dom.createDom("DIV","injectionDiv");a.appendChild(c);a=Blockly.createDom_(c,b);var d=new Blockly.BlockDragSurfaceSvg(c);c=new Blockly.WorkspaceDragSurfaceSvg(c);b=Blockly.createMainWorkspace_(a,b,d,c);Blockly.init_(b);Blockly.mainWorkspace=b;Blockly.svgResize(b);return b};
|
||||
Blockly.createDom_=function(a,b){a.setAttribute("dir","LTR");goog.ui.Component.setDefaultRightToLeft(b.RTL);Blockly.Css.inject(b.hasCss,b.pathToMedia);a=Blockly.utils.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"},a);var c=Blockly.utils.createSvgElement("defs",{},a),d=String(Math.random()).substring(2),e=Blockly.utils.createSvgElement("filter",{id:"blocklyEmbossFilter"+
|
||||
d},c);Blockly.utils.createSvgElement("feGaussianBlur",{"in":"SourceAlpha",stdDeviation:1,result:"blur"},e);var f=Blockly.utils.createSvgElement("feSpecularLighting",{"in":"blur",surfaceScale:1,specularConstant:.5,specularExponent:10,"lighting-color":"white",result:"specOut"},e);Blockly.utils.createSvgElement("fePointLight",{x:-5E3,y:-1E4,z:2E4},f);Blockly.utils.createSvgElement("feComposite",{"in":"specOut",in2:"SourceAlpha",operator:"in",result:"specOut"},e);Blockly.utils.createSvgElement("feComposite",
|
||||
{"in":"SourceGraphic",in2:"specOut",operator:"arithmetic",k1:0,k2:1,k3:1,k4:0},e);b.embossFilterId=e.id;e=Blockly.utils.createSvgElement("pattern",{id:"blocklyDisabledPattern"+d,patternUnits:"userSpaceOnUse",width:10,height:10},c);Blockly.utils.createSvgElement("rect",{width:10,height:10,fill:"#aaa"},e);Blockly.utils.createSvgElement("path",{d:"M 0 0 L 10 10 M 10 0 L 0 10",stroke:"#cc0"},e);b.disabledPatternId=e.id;b.gridPattern=Blockly.Grid.createDom(d,b.gridOptions,c);return a};
|
||||
@@ -1593,7 +1595,7 @@ Blockly.getMainWorkspace=function(){return Blockly.mainWorkspace};Blockly.alert=
|
||||
Blockly.defineBlocksWithJsonArray=function(a){for(var b=0,c;c=a[b];b++){var d=c.type;null==d||""===d?console.warn("Block definition #"+b+" in JSON array is missing a type attribute. Skipping."):(Blockly.Blocks[d]&&console.warn("Block definition #"+b+' in JSON array overwrites prior definition of "'+d+'".'),Blockly.Blocks[d]={init:Blockly.jsonInitFactory_(c)})}};
|
||||
Blockly.bindEventWithChecks_=function(a,b,c,d,e,f){var g=!1,h=function(a){var b=!e;a=Blockly.Touch.splitEventByTouches(a);for(var f=0,h;h=a[f];f++)if(!b||Blockly.Touch.shouldHandleEvent(h))Blockly.Touch.setClientFromTouch(h),c?d.call(c,h):d(h),g=!0};a.addEventListener(b,h,!1);var k=[[a,b,h]];if(b in Blockly.Touch.TOUCH_MAP)for(var n=function(a){h(a);var b=!f;g&&b&&a.preventDefault()},p=0,m;m=Blockly.Touch.TOUCH_MAP[b][p];p++)a.addEventListener(m,n,!1),k.push([a,m,n]);return k};
|
||||
Blockly.bindEvent_=function(a,b,c,d){var e=function(a){c?d.call(c,a):d(a)};a.addEventListener(b,e,!1);var f=[[a,b,e]];if(b in Blockly.Touch.TOUCH_MAP)for(var g=function(a){if(1==a.changedTouches.length){var b=a.changedTouches[0];a.clientX=b.clientX;a.clientY=b.clientY}e(a);a.preventDefault()},h=0,k;k=Blockly.Touch.TOUCH_MAP[b][h];h++)a.addEventListener(k,g,!1),f.push([a,k,g]);return f};Blockly.unbindEvent_=function(a){for(;a.length;){var b=a.pop(),c=b[2];b[0].removeEventListener(b[1],c,!1)}return c};
|
||||
Blockly.isNumber=function(a){return!!a.match(/^\s*-?\d+(\.\d+)?\s*$/)};goog.global.console||(goog.global.console={log:function(){},warn:function(){}});goog.global.Blockly||(goog.global.Blockly={});goog.global.Blockly.getMainWorkspace=Blockly.getMainWorkspace;goog.global.Blockly.addChangeListener=Blockly.addChangeListener;var blocklyApp={};
|
||||
Blockly.isNumber=function(a){return/^\s*-?\d+(\.\d+)?\s*$/.test(a)};goog.global.console||(goog.global.console={log:function(){},warn:function(){}});goog.global.Blockly||(goog.global.Blockly={});goog.global.Blockly.getMainWorkspace=Blockly.getMainWorkspace;goog.global.Blockly.addChangeListener=Blockly.addChangeListener;var blocklyApp={};
|
||||
blocklyApp.NotificationsService=ng.core.Class({constructor:[function(){this.currentMessage="";this.timeouts=[]}],setDisplayedMessage_:function(a){this.currentMessage=a},getDisplayedMessage:function(){return this.currentMessage},speak:function(a){this.timeouts.forEach(function(a){clearTimeout(a)});this.timeouts.length=0;this.setDisplayedMessage_("");var b=this;this.timeouts.push(setTimeout(function(){b.setDisplayedMessage_(a)},20));this.timeouts.push(setTimeout(function(){b.setDisplayedMessage_("")},5E3))}});blocklyApp.AudioService=ng.core.Class({constructor:[blocklyApp.NotificationsService,function(a){this.notificationsService=a;this.canPlayAudio=!1;ACCESSIBLE_GLOBALS.hasOwnProperty("mediaPathPrefix")&&(this.canPlayAudio=!0,a=ACCESSIBLE_GLOBALS.mediaPathPrefix,this.AUDIO_PATHS_={connect:a+"click.mp3","delete":a+"delete.mp3",oops:a+"oops.mp3"});this.cachedAudioFiles_={};this.onEndedCallbacks_={connect:[],"delete":[],oops:[]}}],play_:function(a,b){if(this.canPlayAudio){this.cachedAudioFiles_.hasOwnProperty(a)||
|
||||
(this.cachedAudioFiles_[a]=new Audio(this.AUDIO_PATHS_[a]));if(b)this.onEndedCallbacks_[a].push(b),this.cachedAudioFiles_[a].addEventListener("ended",b);else{var c=this;this.onEndedCallbacks_[a].forEach(function(b){c.cachedAudioFiles_[a].removeEventListener("ended",b)});this.onEndedCallbacks_[a].length=0}this.cachedAudioFiles_[a].play()}},playConnectSound:function(){this.play_("connect")},playDeleteSound:function(){this.play_("delete")},playOopsSound:function(a){if(a){var b=this;this.play_("oops",
|
||||
function(){b.notificationsService.speak(a)})}else this.play_("oops")}});blocklyApp.BlockConnectionService=ng.core.Class({constructor:[blocklyApp.NotificationsService,blocklyApp.AudioService,function(a,b){this.notificationsService=a;this.audioService=b;this.markedConnection_=null}],findCompatibleConnection_:function(a,b){if(!b||!b.getSourceBlock().workspace)return null;var c=Blockly.OPPOSITE_TYPE[b.type];return(a=c==Blockly.OUTPUT_VALUE?a.outputConnection:c==Blockly.PREVIOUS_STATEMENT?a.previousConnection:c==Blockly.NEXT_STATEMENT?a.nextConnection:null)&&a.checkType_(b)?
|
||||
|
||||
@@ -252,10 +252,9 @@ goog.addDependency("date/daterange_test.js", ['goog.date.DateRangeTest'], ['goog
|
||||
goog.addDependency("date/duration.js", ['goog.date.duration'], ['goog.i18n.DateTimeFormat', 'goog.i18n.MessageFormat']);
|
||||
goog.addDependency("date/duration_test.js", ['goog.date.durationTest'], ['goog.date.duration', 'goog.i18n.DateTimeFormat', 'goog.i18n.DateTimeSymbols', 'goog.i18n.DateTimeSymbols_bn', 'goog.i18n.DateTimeSymbols_en', 'goog.i18n.DateTimeSymbols_fa', 'goog.testing.jsunit']);
|
||||
goog.addDependency("date/relative.js", ['goog.date.relative', 'goog.date.relative.TimeDeltaFormatter', 'goog.date.relative.Unit'], ['goog.i18n.DateTimeFormat', 'goog.i18n.DateTimePatterns']);
|
||||
goog.addDependency("date/relative_test.js", ['goog.date.relativeTest'], ['goog.date.relativeCommonTests']);
|
||||
goog.addDependency("date/relativecommontests.js", ['goog.date.relativeCommonTests'], ['goog.date.DateTime', 'goog.date.relative', 'goog.i18n.DateTimeFormat', 'goog.testing.jsunit']);
|
||||
goog.addDependency("date/relative_test.js", ['goog.date.relativeTest'], ['goog.date.DateTime', 'goog.date.relative', 'goog.i18n.DateTimeFormat', 'goog.testing.jsunit']);
|
||||
goog.addDependency("date/relativewithplurals.js", ['goog.date.relativeWithPlurals'], ['goog.date.relative', 'goog.date.relative.Unit', 'goog.i18n.MessageFormat']);
|
||||
goog.addDependency("date/relativewithplurals_test.js", ['goog.date.relativeWithPluralsTest'], ['goog.date.relative', 'goog.date.relativeCommonTests', 'goog.date.relativeWithPlurals', 'goog.i18n.DateTimeFormat', 'goog.i18n.DateTimeSymbols', 'goog.i18n.DateTimeSymbols_bn', 'goog.i18n.DateTimeSymbols_en', 'goog.i18n.DateTimeSymbols_fa', 'goog.i18n.NumberFormatSymbols', 'goog.i18n.NumberFormatSymbols_bn', 'goog.i18n.NumberFormatSymbols_en', 'goog.i18n.NumberFormatSymbols_fa']);
|
||||
goog.addDependency("date/relativewithplurals_test.js", ['goog.date.relativeWithPluralsTest'], ['goog.date.relative', 'goog.date.relativeTest', 'goog.date.relativeWithPlurals', 'goog.i18n.DateTimeFormat', 'goog.i18n.DateTimeSymbols', 'goog.i18n.DateTimeSymbols_bn', 'goog.i18n.DateTimeSymbols_en', 'goog.i18n.DateTimeSymbols_fa', 'goog.i18n.NumberFormatSymbols', 'goog.i18n.NumberFormatSymbols_bn', 'goog.i18n.NumberFormatSymbols_en', 'goog.i18n.NumberFormatSymbols_fa']);
|
||||
goog.addDependency("date/utcdatetime.js", ['goog.date.UtcDateTime'], ['goog.date', 'goog.date.Date', 'goog.date.DateTime', 'goog.date.Interval']);
|
||||
goog.addDependency("date/utcdatetime_test.js", ['goog.date.UtcDateTimeTest'], ['goog.date.Interval', 'goog.date.UtcDateTime', 'goog.date.month', 'goog.date.weekDay', 'goog.testing.jsunit']);
|
||||
goog.addDependency("db/cursor.js", ['goog.db.Cursor'], ['goog.async.Deferred', 'goog.db.Error', 'goog.db.KeyRange', 'goog.debug', 'goog.events.EventTarget']);
|
||||
@@ -774,8 +773,8 @@ goog.addDependency("labs/net/webchannel/channel.js", ['goog.labs.net.webChannel.
|
||||
goog.addDependency("labs/net/webchannel/channelrequest.js", ['goog.labs.net.webChannel.ChannelRequest'], ['goog.Timer', 'goog.async.Throttle', 'goog.events.EventHandler', 'goog.labs.net.webChannel.Channel', 'goog.labs.net.webChannel.WebChannelDebug', 'goog.labs.net.webChannel.requestStats', 'goog.net.ErrorCode', 'goog.net.EventType', 'goog.net.XmlHttp', 'goog.object', 'goog.userAgent']);
|
||||
goog.addDependency("labs/net/webchannel/channelrequest_test.js", ['goog.labs.net.webChannel.channelRequestTest'], ['goog.Uri', 'goog.functions', 'goog.labs.net.webChannel.ChannelRequest', 'goog.labs.net.webChannel.WebChannelDebug', 'goog.labs.net.webChannel.requestStats', 'goog.labs.net.webChannel.requestStats.ServerReachability', 'goog.testing.MockClock', 'goog.testing.PropertyReplacer', 'goog.testing.jsunit', 'goog.testing.net.XhrIo', 'goog.testing.recordFunction']);
|
||||
goog.addDependency("labs/net/webchannel/connectionstate.js", ['goog.labs.net.webChannel.ConnectionState'], []);
|
||||
goog.addDependency("labs/net/webchannel/forwardchannelrequestpool.js", [], []);
|
||||
goog.addDependency("labs/net/webchannel/forwardchannelrequestpool_test.js", [], []);
|
||||
goog.addDependency("labs/net/webchannel/forwardchannelrequestpool.js", ['goog.labs.net.webChannel.ForwardChannelRequestPool'], ['goog.array', 'goog.string', 'goog.structs.Set']);
|
||||
goog.addDependency("labs/net/webchannel/forwardchannelrequestpool_test.js", ['goog.labs.net.webChannel.forwardChannelRequestPoolTest'], ['goog.labs.net.webChannel.ChannelRequest', 'goog.labs.net.webChannel.ForwardChannelRequestPool', 'goog.testing.PropertyReplacer', 'goog.testing.asserts', 'goog.testing.jsunit']);
|
||||
goog.addDependency("labs/net/webchannel/netutils.js", ['goog.labs.net.webChannel.netUtils'], ['goog.Uri', 'goog.labs.net.webChannel.WebChannelDebug']);
|
||||
goog.addDependency("labs/net/webchannel/requeststats.js", ['goog.labs.net.webChannel.requestStats', 'goog.labs.net.webChannel.requestStats.Event', 'goog.labs.net.webChannel.requestStats.ServerReachability', 'goog.labs.net.webChannel.requestStats.ServerReachabilityEvent', 'goog.labs.net.webChannel.requestStats.Stat', 'goog.labs.net.webChannel.requestStats.StatEvent', 'goog.labs.net.webChannel.requestStats.TimingEvent'], ['goog.events.Event', 'goog.events.EventTarget']);
|
||||
goog.addDependency("labs/net/webchannel/webchannelbase.js", ['goog.labs.net.webChannel.WebChannelBase'], ['goog.Uri', 'goog.array', 'goog.asserts', 'goog.async.run', 'goog.debug.TextFormatter', 'goog.json', 'goog.labs.net.webChannel.BaseTestChannel', 'goog.labs.net.webChannel.Channel', 'goog.labs.net.webChannel.ChannelRequest', 'goog.labs.net.webChannel.ConnectionState', 'goog.labs.net.webChannel.ForwardChannelRequestPool', 'goog.labs.net.webChannel.WebChannelDebug', 'goog.labs.net.webChannel.Wire', 'goog.labs.net.webChannel.WireV8', 'goog.labs.net.webChannel.netUtils', 'goog.labs.net.webChannel.requestStats', 'goog.log', 'goog.net.WebChannel', 'goog.net.XhrIo', 'goog.net.rpc.HttpCors', 'goog.object', 'goog.string', 'goog.structs', 'goog.structs.CircularBuffer']);
|
||||
|
||||
+120
-118
@@ -10,36 +10,39 @@ goog.module=function(a){if(!goog.isString(a)||!a||-1==a.search(goog.VALID_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<c.length;e++)if(d=d[c[e]],!goog.isDefAndNotNull(d))return null;return d};goog.globalize=function(a,b){var c=b||goog.global,d;for(d in a)c[d]=a[d]};
|
||||
goog.addDependency=function(a,b,c,d){if(goog.DEPENDENCIES_ENABLED){var e;a=a.replace(/\\/g,"/");var f=goog.dependencies_;d&&"boolean"!==typeof d||(d=d?{module:"goog"}:{});for(var g=0;e=b[g];g++)f.nameToPath[e]=a,f.loadFlags[a]=d;for(d=0;b=c[d];d++)a in f.requires||(f.requires[a]={}),f.requires[a][b]=!0}};goog.ENABLE_DEBUG_LOADER=!0;goog.logToConsole_=function(a){goog.global.console&&goog.global.console.error(a)};
|
||||
goog.require=function(a){if(!COMPILED){goog.ENABLE_DEBUG_LOADER&&goog.IS_OLD_IE_&&goog.maybeProcessDeferredDep_(a);if(goog.isProvided_(a)){if(goog.isInModuleLoader_())return goog.module.getInternal_(a)}else if(goog.ENABLE_DEBUG_LOADER){var b=goog.getPathFromDeps_(a);if(b)goog.writeScripts_(b);else throw a="goog.require could not find: "+a,goog.logToConsole_(a),Error(a);}return null}};goog.basePath="";goog.nullFunction=function(){};
|
||||
goog.abstractMethod=function(){throw Error("unimplemented abstract method");};goog.addSingletonGetter=function(a){a.instance_=void 0;a.getInstance=function(){if(a.instance_)return a.instance_;goog.DEBUG&&(goog.instantiatedSingletons_[goog.instantiatedSingletons_.length]=a);return a.instance_=new a}};goog.instantiatedSingletons_=[];goog.LOAD_MODULE_USING_EVAL=!0;goog.SEAL_MODULE_EXPORTS=goog.DEBUG;goog.loadedModules_={};goog.DEPENDENCIES_ENABLED=!COMPILED&&goog.ENABLE_DEBUG_LOADER;goog.TRANSPILE="detect";
|
||||
goog.TRANSPILER="transpile.js";
|
||||
goog.DEPENDENCIES_ENABLED&&(goog.dependencies_={loadFlags:{},nameToPath:{},requires:{},visited:{},written:{},deferred:{}},goog.inHtmlDocument_=function(){var a=goog.global.document;return null!=a&&"write"in a},goog.findBasePath_=function(){if(goog.isDef(goog.global.CLOSURE_BASE_PATH)&&goog.isString(goog.global.CLOSURE_BASE_PATH))goog.basePath=goog.global.CLOSURE_BASE_PATH;else if(goog.inHtmlDocument_()){var a=goog.global.document,b=a.currentScript;a=b?[b]:a.getElementsByTagName("SCRIPT");for(b=a.length-
|
||||
1;0<=b;--b){var c=a[b].src,d=c.lastIndexOf("?");d=-1==d?c.length:d;if("base.js"==c.substr(d-7,7)){goog.basePath=c.substr(0,d-7);break}}}},goog.importScript_=function(a,b){(goog.global.CLOSURE_IMPORT_SCRIPT||goog.writeScriptTag_)(a,b)&&(goog.dependencies_.written[a]=!0)},goog.IS_OLD_IE_=!(goog.global.atob||!goog.global.document||!goog.global.document.all),goog.oldIeWaiting_=!1,goog.importProcessedScript_=function(a,b,c){goog.importScript_("",'goog.retrieveAndExec_("'+a+'", '+b+", "+c+");")},goog.queuedModules_=
|
||||
[],goog.wrapModule_=function(a,b){return goog.LOAD_MODULE_USING_EVAL&&goog.isDef(goog.global.JSON)?"goog.loadModule("+goog.global.JSON.stringify(b+"\n//# sourceURL="+a+"\n")+");":'goog.loadModule(function(exports) {"use strict";'+b+"\n;return exports});\n//# sourceURL="+a+"\n"},goog.loadQueuedModules_=function(){var a=goog.queuedModules_.length;if(0<a){var b=goog.queuedModules_;goog.queuedModules_=[];for(var c=0;c<a;c++)goog.maybeProcessDeferredPath_(b[c])}goog.oldIeWaiting_=!1},goog.maybeProcessDeferredDep_=
|
||||
function(a){goog.isDeferredModule_(a)&&goog.allDepsAreAvailable_(a)&&(a=goog.getPathFromDeps_(a),goog.maybeProcessDeferredPath_(goog.basePath+a))},goog.isDeferredModule_=function(a){var b=(a=goog.getPathFromDeps_(a))&&goog.dependencies_.loadFlags[a]||{},c=b.lang||"es3";return a&&("goog"==b.module||goog.needsTranspile_(c))?goog.basePath+a in goog.dependencies_.deferred:!1},goog.allDepsAreAvailable_=function(a){if((a=goog.getPathFromDeps_(a))&&a in goog.dependencies_.requires)for(var b in goog.dependencies_.requires[a])if(!goog.isProvided_(b)&&
|
||||
!goog.isDeferredModule_(b))return!1;return!0},goog.maybeProcessDeferredPath_=function(a){if(a in goog.dependencies_.deferred){var b=goog.dependencies_.deferred[a];delete goog.dependencies_.deferred[a];goog.globalEval(b)}},goog.loadModuleFromUrl=function(a){goog.retrieveAndExec_(a,!0,!1)},goog.writeScriptSrcNode_=function(a){goog.global.document.write('<script type="text/javascript" src="'+a+'">\x3c/script>')},goog.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.writeScriptTag_=function(a,b){if(goog.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.IS_OLD_IE_){goog.oldIeWaiting_=!0;var d=" onreadystatechange='goog.onScriptLoad_(this, "+ ++goog.lastNonModuleScriptIndex_+")' ";c.write('<script type="text/javascript" src="'+
|
||||
a+'"'+d+">\x3c/script>")}else goog.ENABLE_CHROME_APP_SAFE_SCRIPT_LOADING?goog.appendScriptSrcNode_(a):goog.writeScriptSrcNode_(a);else c.write('<script type="text/javascript">'+goog.protectScriptTag_(b)+"\x3c/script>");return!0}return!1},goog.protectScriptTag_=function(a){return a.replace(/<\/(SCRIPT)/ig,"\\x3c/$1")},goog.needsTranspile_=function(a){if("always"==goog.TRANSPILE)return!0;if("never"==goog.TRANSPILE)return!1;goog.requiresTranspilation_||(goog.requiresTranspilation_=goog.createRequiresTranspilation_());
|
||||
if(a in goog.requiresTranspilation_)return goog.requiresTranspilation_[a];throw Error("Unknown language mode: "+a);},goog.requiresTranspilation_=null,goog.lastNonModuleScriptIndex_=0,goog.onScriptLoad_=function(a,b){"complete"==a.readyState&&goog.lastNonModuleScriptIndex_==b&&goog.loadQueuedModules_();return!0},goog.writeScripts_=function(a){function b(a){if(!(a in e.written||a in e.visited)){e.visited[a]=!0;if(a in e.requires)for(var f in e.requires[a])if(!goog.isProvided_(f))if(f in e.nameToPath)b(e.nameToPath[f]);
|
||||
else throw Error("Undefined nameToPath for "+f);a in d||(d[a]=!0,c.push(a))}}var c=[],d={},e=goog.dependencies_;b(a);for(a=0;a<c.length;a++){var f=c[a];goog.dependencies_.written[f]=!0}var g=goog.moduleLoaderState_;goog.moduleLoaderState_=null;for(a=0;a<c.length;a++)if(f=c[a]){var h=e.loadFlags[f]||{},k=goog.needsTranspile_(h.lang||"es3");"goog"==h.module||k?goog.importProcessedScript_(goog.basePath+f,"goog"==h.module,k):goog.importScript_(goog.basePath+f)}else throw goog.moduleLoaderState_=g,Error("Undefined script input");
|
||||
goog.moduleLoaderState_=g},goog.getPathFromDeps_=function(a){return a in goog.dependencies_.nameToPath?goog.dependencies_.nameToPath[a]:null},goog.findBasePath_(),goog.global.CLOSURE_NO_DEPS||goog.importScript_(goog.basePath+"deps.js"));goog.hasBadLetScoping=null;goog.useSafari10Workaround=function(){if(null==goog.hasBadLetScoping){try{var a=!eval('"use strict";let x = 1; function f() { return typeof x; };f() == "number";')}catch(b){a=!1}goog.hasBadLetScoping=a}return goog.hasBadLetScoping};
|
||||
goog.workaroundSafari10EvalBug=function(a){return"(function(){"+a+"\n;})();\n"};
|
||||
goog.getObjectByName=function(a,b){for(var c=a.split("."),d=b||goog.global,e=0;e<c.length;e++)if(d=d[c[e]],!goog.isDefAndNotNull(d))return null;return d};goog.globalize=function(a,b){var c=b||goog.global,d;for(d in a)c[d]=a[d]};goog.addDependency=function(a,b,c,d){if(goog.DEPENDENCIES_ENABLED){var e=goog.getLoader_();e&&e.addDependency(a,b,c,d)}};goog.ENABLE_DEBUG_LOADER=!0;goog.logToConsole_=function(a){goog.global.console&&goog.global.console.error(a)};
|
||||
goog.require=function(a){goog.ENABLE_DEBUG_LOADER&&goog.debugLoader_&&goog.getLoader_().earlyProcessLoad(a);if(!COMPILED){if(goog.isProvided_(a)){if(goog.isInModuleLoader_())return goog.module.getInternal_(a)}else if(goog.ENABLE_DEBUG_LOADER){var b=goog.moduleLoaderState_;goog.moduleLoaderState_=null;try{var c=goog.getLoader_();c?c.load(a):goog.logToConsole_("Could not load "+a+" because there is no debug loader.")}finally{goog.moduleLoaderState_=b}}return null}};goog.basePath="";
|
||||
goog.nullFunction=function(){};goog.abstractMethod=function(){throw Error("unimplemented abstract method");};goog.addSingletonGetter=function(a){a.instance_=void 0;a.getInstance=function(){if(a.instance_)return a.instance_;goog.DEBUG&&(goog.instantiatedSingletons_[goog.instantiatedSingletons_.length]=a);return a.instance_=new a}};goog.instantiatedSingletons_=[];goog.LOAD_MODULE_USING_EVAL=!0;goog.SEAL_MODULE_EXPORTS=goog.DEBUG;goog.loadedModules_={};goog.DEPENDENCIES_ENABLED=!COMPILED&&goog.ENABLE_DEBUG_LOADER;
|
||||
goog.TRANSPILE="detect";goog.TRANSPILER="transpile.js";goog.DEBUG_LOADER="";
|
||||
goog.DEPENDENCIES_ENABLED&&(goog.inHtmlDocument_=function(){var a=goog.global.document;return null!=a&&"write"in a},goog.findBasePath_=function(){if(goog.isDef(goog.global.CLOSURE_BASE_PATH)&&goog.isString(goog.global.CLOSURE_BASE_PATH))goog.basePath=goog.global.CLOSURE_BASE_PATH;else if(goog.inHtmlDocument_()){var a=goog.global.document,b=a.currentScript;a=b?[b]:a.getElementsByTagName("SCRIPT");for(b=a.length-1;0<=b;--b){var c=a[b].src,d=c.lastIndexOf("?");d=-1==d?c.length:d;if("base.js"==c.substr(d-
|
||||
7,7)){goog.basePath=c.substr(0,d-7);break}}}},goog.findBasePath_(),goog.retrieveAndEval_=function(a){var b=goog.loadFileSync_(a);if(b)goog.globalEval(b+("\n//# sourceURL="+a));else throw Error("Could not retrieve file "+a);},goog.Transpiler=function(){this.requiresTranspilation_=null},goog.Transpiler.prototype.createRequiresTranspilation_=function(){function a(a,b){d?c[a]=!0:b()?c[a]=!1:d=c[a]=!0}function b(a){try{return!!eval(a)}catch(g){return!1}}var c={es3:!1},d=!1,e=goog.global.navigator&&goog.global.navigator.userAgent?
|
||||
goog.global.navigator.userAgent:"";a("es5",function(){return b("[1,].length==1")});a("es6",function(){var a=e.match(/Edge\/(\d+)(\.\d)*/i);return a&&15>Number(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")});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){var c=goog.global.$jscomp;c||(goog.global.$jscomp=
|
||||
c={});var d=c.transpile;if(!d){var e=goog.basePath+goog.TRANSPILER,f=goog.loadFileSync_(e);if(f){(function(){eval(f+"\n//# sourceURL="+e)}).call(goog.global);if(goog.global.$gwtExport&&goog.global.$gwtExport.$jscomp&&!goog.global.$gwtExport.$jscomp.transpile)throw Error('The transpiler did not properly export the "transpile" method. $gwtExport: '+JSON.stringify(goog.global.$gwtExport));goog.global.$jscomp.transpile=goog.global.$gwtExport.$jscomp.transpile;c=goog.global.$jscomp;d=c.transpile}}d||(d=
|
||||
c.transpile=goog.bind(function(a,b){goog.logToConsole_(b+" requires transpilation but no transpiler was found.");return a},this));return d(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=function(a){if(!(a in f.written||a in f.visited)){f.visited[a]=!0;if(a in f.requires)for(var b in f.requires[a])if(!g.isProvided(b))if(b in f.nameToPath)c(f.nameToPath[b]);else throw Error("Undefined nameToPath for "+b);a in e||(e[a]=!0,d.push(a))}},d=[],e={},f=this.dependencies_,g=this;c(b);for(a=0;a<d.length;a++)b=d[a],this.dependencies_.written[b]=
|
||||
!0;for(a=0;a<d.length;a++)if(b=d[a]){var h=f.loadFlags[b]||{},k=h.lang||"es3";k=this.getTranspiler().needsTranspile(k);"goog"==h.module||k?this.importProcessedScript_(goog.basePath+b,"goog"==h.module,k):this.importScript_(goog.basePath+b)}else throw Error("Undefined script input");}else throw a="goog.require could not find: "+a,this.logToConsole(a),Error(a);},goog.DebugLoader.prototype.addDependency=function(a,b,c,d){var e;a=a.replace(/\\/g,"/");var f=this.dependencies_;d&&"boolean"!==typeof d||(d=
|
||||
d?{module:"goog"}:{});for(var g=0;e=b[g];g++)f.nameToPath[e]=a,f.loadFlags[a]=d;for(d=0;b=c[d];d++)a in f.requires||(f.requires[a]={}),f.requires[a][b]=!0},goog.DebugLoader.prototype.importScript_=function(a,b){(goog.global.CLOSURE_IMPORT_SCRIPT||goog.bind(this.writeScriptTag_,this))(a,b)&&(this.dependencies_.written[a]=!0)},goog.DebugLoader.prototype.importProcessedScript_=function(a,b,c){this.importScript_("",'goog.debugLoader_.retrieveAndExec_("'+a+'", '+b+", "+c+");")},goog.DebugLoader.prototype.retrieveAndExec_=
|
||||
function(a,b,c){if(!COMPILED){var d=a;a=this.normalizePath(a);var e=goog.global.CLOSURE_IMPORT_SCRIPT||goog.bind(this.writeScriptTag_,this),f=this.loadFileSync(a);if(null==f)throw Error('Load of "'+a+'" failed');c&&(f=this.getTranspiler().transpile(f,a));f=b?this.wrapModule_(a,f):f+("\n//# sourceURL="+a);goog.DebugLoader.IS_OLD_IE_&&this.oldIeWaiting_?(this.dependencies_.deferred[d]=f,this.queuedModules_.push(d)):e(a,f)}},goog.DebugLoader.prototype.wrapModule_=function(a,b){return goog.LOAD_MODULE_USING_EVAL&&
|
||||
goog.isDef(goog.global.JSON)?"goog.loadModule("+goog.global.JSON.stringify(b+"\n//# sourceURL="+a+"\n")+");":'goog.loadModule(function(exports) {"use strict";'+b+"\n;return exports});\n//# sourceURL="+a+"\n"},goog.DebugLoader.prototype.loadQueuedModules_=function(){var a=this.queuedModules_.length;if(0<a){var b=this.queuedModules_;this.queuedModules_=[];for(var c=0;c<a;c++)this.maybeProcessDeferredPath_(b[c])}this.oldIeWaiting_=!1},goog.DebugLoader.prototype.maybeProcessDeferredDep_=function(a){this.isDeferredModule_(a)&&
|
||||
this.allDepsAreAvailable_(a)&&(a=this.getPathFromDeps_(a),this.maybeProcessDeferredPath_(goog.basePath+a))},goog.DebugLoader.prototype.isDeferredModule_=function(a){var b=(a=this.getPathFromDeps_(a))&&this.dependencies_.loadFlags[a]||{},c=b.lang||"es3";return a&&("goog"==b.module||this.getTranspiler().needsTranspile(c))?goog.basePath+a in this.dependencies_.deferred:!1},goog.DebugLoader.prototype.allDepsAreAvailable_=function(a){if((a=this.getPathFromDeps_(a))&&a in this.dependencies_.requires)for(var b in this.dependencies_.requires[a])if(!this.isProvided(b)&&
|
||||
!this.isDeferredModule_(b))return!1;return!0},goog.DebugLoader.prototype.maybeProcessDeferredPath_=function(a){if(a in this.dependencies_.deferred){var b=this.dependencies_.deferred[a];delete this.dependencies_.deferred[a];goog.globalEval(b)}},goog.DebugLoader.prototype.writeScriptSrcNode_=function(a){goog.global.document.write('<script type="text/javascript" src="'+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('<script type="text/javascript" src="'+a+'"'+d+">\x3c/script>")}else goog.ENABLE_CHROME_APP_SAFE_SCRIPT_LOADING?this.appendScriptSrcNode_(a):this.writeScriptSrcNode_(a);else c.write('<script type="text/javascript">'+this.protectScriptTag_(b)+"\x3c/script>");return!0}return!1},goog.DebugLoader.prototype.protectScriptTag_=function(a){return a.replace(/<\/(SCRIPT)/ig,"\\x3c/$1")},goog.DebugLoader.prototype.onScriptLoad_=function(a,b){"complete"==a.readyState&&this.lastNonModuleScriptIndex_==
|
||||
b&&this.loadQueuedModules_();return!0},goog.DebugLoader.prototype.getPathFromDeps_=function(a){return a in this.dependencies_.nameToPath?this.dependencies_.nameToPath[a]:null},goog.DebugLoader.prototype.getTranspiler=function(){return goog.transpiler_},goog.DebugLoader.prototype.isProvided=function(a){return goog.isProvided_(a)},goog.DebugLoader.prototype.inHtmlDocument=function(){return goog.inHtmlDocument_()},goog.DebugLoader.prototype.logToConsole=function(a){goog.logToConsole_(a)},goog.DebugLoader.prototype.loadFileSync=
|
||||
function(a){return goog.loadFileSync_(a)},goog.DebugLoader.prototype.normalizePath=function(a){return goog.normalizePath_(a)},goog.debugLoader_=null,goog.registerDebugLoader=function(a){if(goog.debugLoader_)throw Error("Debug loader already registered!");if(!(a instanceof goog.DebugLoader))throw Error("Not a goog.DebugLoader.");goog.debugLoader_=a},goog.getLoader_=function(){if(!goog.debugLoader_){if(goog.DEBUG_LOADER){if(goog.retrieveAndEval_(goog.basePath+goog.DEBUG_LOADER),!goog.debugLoader_)throw Error("Loaded debug loader file but no loader was registered!");
|
||||
}else goog.debugLoader_=new goog.DebugLoader;goog.global.CLOSURE_NO_DEPS||goog.retrieveAndEval_(goog.basePath+"deps.js")}return goog.debugLoader_});goog.hasBadLetScoping=null;goog.useSafari10Workaround=function(){if(null==goog.hasBadLetScoping){try{var a=!eval('"use strict";let x = 1; function f() { return typeof x; };f() == "number";')}catch(b){a=!1}goog.hasBadLetScoping=a}return goog.hasBadLetScoping};goog.workaroundSafari10EvalBug=function(a){return"(function(){"+a+"\n;})();\n"};
|
||||
goog.loadModule=function(a){var b=goog.moduleLoaderState_;try{goog.moduleLoaderState_={moduleName:void 0,declareLegacyNamespace:!1};if(goog.isFunction(a))var c=a.call(void 0,{});else if(goog.isString(a))goog.useSafari10Workaround()&&(a=goog.workaroundSafari10EvalBug(a)),c=goog.loadModuleFromSource_.call(void 0,a);else throw Error("Invalid module definition");var d=goog.moduleLoaderState_.moduleName;if(!goog.isString(d)||!d)throw Error('Invalid module name "'+d+'"');goog.moduleLoaderState_.declareLegacyNamespace?
|
||||
goog.constructNamespace_(d,c):goog.SEAL_MODULE_EXPORTS&&Object.seal&&"object"==typeof c&&null!=c&&Object.seal(c);goog.loadedModules_[d]=c}finally{goog.moduleLoaderState_=b}};goog.loadModuleFromSource_=function(a){eval(a);return{}};goog.normalizePath_=function(a){a=a.split("/");for(var b=0;b<a.length;)"."==a[b]?a.splice(b,1):b&&".."==a[b]&&a[b-1]&&".."!=a[b-1]?a.splice(--b,2):b++;return a.join("/")};
|
||||
goog.loadFileSync_=function(a){if(goog.global.CLOSURE_LOAD_FILE_SYNC)return goog.global.CLOSURE_LOAD_FILE_SYNC(a);try{var b=new goog.global.XMLHttpRequest;b.open("get",a,!1);b.send();return 0==b.status||200==b.status?b.responseText:null}catch(c){return null}};
|
||||
goog.retrieveAndExec_=function(a,b,c){if(!COMPILED){var d=a;a=goog.normalizePath_(a);var e=goog.global.CLOSURE_IMPORT_SCRIPT||goog.writeScriptTag_,f=goog.loadFileSync_(a);if(null==f)throw Error('Load of "'+a+'" failed');c&&(f=goog.transpile_.call(goog.global,f,a));f=b?goog.wrapModule_(a,f):f+("\n//# sourceURL="+a);goog.IS_OLD_IE_&&goog.oldIeWaiting_?(goog.dependencies_.deferred[d]=f,goog.queuedModules_.push(d)):e(a,f)}};
|
||||
goog.transpile_=function(a,b){var c=goog.global.$jscomp;c||(goog.global.$jscomp=c={});var d=c.transpile;if(!d){var e=goog.basePath+goog.TRANSPILER,f=goog.loadFileSync_(e);if(f){eval(f+"\n//# sourceURL="+e);if(goog.global.$gwtExport&&goog.global.$gwtExport.$jscomp&&!goog.global.$gwtExport.$jscomp.transpile)throw Error('The transpiler did not properly export the "transpile" method. $gwtExport: '+JSON.stringify(goog.global.$gwtExport));goog.global.$jscomp.transpile=goog.global.$gwtExport.$jscomp.transpile;
|
||||
c=goog.global.$jscomp;d=c.transpile}}d||(d=c.transpile=function(a,b){goog.logToConsole_(b+" requires transpilation but no transpiler was found.");return a});return d(a,b)};
|
||||
goog.typeOf=function(a){var b=typeof a;if("object"==b)if(a){if(a instanceof Array)return"array";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if("[object Window]"==c)return"object";if("[object Array]"==c||"number"==typeof a.length&&"undefined"!=typeof a.splice&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("splice"))return"array";if("[object Function]"==c||"undefined"!=typeof a.call&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("call"))return"function"}else return"null";
|
||||
else if("function"==b&&"undefined"==typeof a.call)return"object";return b};goog.isNull=function(a){return null===a};goog.isDefAndNotNull=function(a){return null!=a};goog.isArray=function(a){return"array"==goog.typeOf(a)};goog.isArrayLike=function(a){var b=goog.typeOf(a);return"array"==b||"object"==b&&"number"==typeof a.length};goog.isDateLike=function(a){return goog.isObject(a)&&"function"==typeof a.getFullYear};goog.isFunction=function(a){return"function"==goog.typeOf(a)};
|
||||
goog.isObject=function(a){var b=typeof a;return"object"==b&&null!=a||"function"==b};goog.getUid=function(a){return a[goog.UID_PROPERTY_]||(a[goog.UID_PROPERTY_]=++goog.uidCounter_)};goog.hasUid=function(a){return!!a[goog.UID_PROPERTY_]};goog.removeUid=function(a){null!==a&&"removeAttribute"in a&&a.removeAttribute(goog.UID_PROPERTY_);try{delete a[goog.UID_PROPERTY_]}catch(b){}};goog.UID_PROPERTY_="closure_uid_"+(1E9*Math.random()>>>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(2<arguments.length){var d=Array.prototype.slice.call(arguments,2);return function(){var c=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(c,d);return a.apply(b,c)}}return function(){return a.apply(b,arguments)}};goog.bind=function(a,b,c){Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?goog.bind=goog.bindNative_:goog.bind=goog.bindJs_;return goog.bind.apply(null,arguments)};
|
||||
goog.partial=function(a,b){var c=Array.prototype.slice.call(arguments,1);return function(){var b=c.slice();b.push.apply(b,arguments);return a.apply(this,b)}};goog.mixin=function(a,b){for(var c in b)a[c]=b[c]};goog.now=goog.TRUSTED_SITE&&Date.now||function(){return+new Date};
|
||||
goog.globalEval=function(a){if(goog.global.execScript)goog.global.execScript(a,"JavaScript");else if(goog.global.eval){if(null==goog.evalWorksForGlobals_)if(goog.global.eval("var _evalTest_ = 1;"),"undefined"!=typeof goog.global._evalTest_){try{delete goog.global._evalTest_}catch(d){}goog.evalWorksForGlobals_=!0}else goog.evalWorksForGlobals_=!1;if(goog.evalWorksForGlobals_)goog.global.eval(a);else{var b=goog.global.document,c=b.createElement("SCRIPT");c.type="text/javascript";c.defer=!1;c.appendChild(b.createTextNode(a));
|
||||
b.body.appendChild(c);b.body.removeChild(c)}}else throw Error("goog.globalEval not available");};goog.evalWorksForGlobals_=null;
|
||||
goog.globalEval=function(a){if(goog.global.execScript)goog.global.execScript(a,"JavaScript");else if(goog.global.eval){if(null==goog.evalWorksForGlobals_){try{goog.global.eval("var _evalTest_ = 1;")}catch(d){}if("undefined"!=typeof goog.global._evalTest_){try{delete goog.global._evalTest_}catch(d){}goog.evalWorksForGlobals_=!0}else goog.evalWorksForGlobals_=!1}if(goog.evalWorksForGlobals_)goog.global.eval(a);else{var b=goog.global.document,c=b.createElement("SCRIPT");c.type="text/javascript";c.defer=
|
||||
!1;c.appendChild(b.createTextNode(a));b.head.appendChild(c);b.head.removeChild(c)}}else throw Error("goog.globalEval not available");};goog.evalWorksForGlobals_=null;
|
||||
goog.getCssName=function(a,b){if("."==String(a).charAt(0))throw Error('className passed in goog.getCssName must not start with ".". You passed: '+a);var c=function(a){return goog.cssNameMapping_[a]||a},d=function(a){a=a.split("-");for(var b=[],d=0;d<a.length;d++)b.push(c(a[d]));return b.join("-")};d=goog.cssNameMapping_?"BY_WHOLE"==goog.cssNameMappingStyle_?c:d:function(a){return a};d=b?a+"-"+d(b):d(a);return goog.global.CLOSURE_CSS_NAME_MAP_FN?goog.global.CLOSURE_CSS_NAME_MAP_FN(d):d};
|
||||
goog.setCssNameMapping=function(a,b){goog.cssNameMapping_=a;goog.cssNameMappingStyle_=b};!COMPILED&&goog.global.CLOSURE_CSS_NAME_MAPPING&&(goog.cssNameMapping_=goog.global.CLOSURE_CSS_NAME_MAPPING);goog.getMsg=function(a,b){b&&(a=a.replace(/\{\$([^}]+)}/g,function(a,d){return null!=b&&d in b?b[d]:a}));return a};goog.getMsgWithFallback=function(a,b){return a};goog.exportSymbol=function(a,b,c){goog.exportPath_(a,b,c)};goog.exportProperty=function(a,b,c){a[b]=c};
|
||||
goog.inherits=function(a,b){function c(){}c.prototype=b.prototype;a.superClass_=b.prototype;a.prototype=new c;a.prototype.constructor=a;a.base=function(a,c,f){for(var d=Array(arguments.length-2),e=2;e<arguments.length;e++)d[e-2]=arguments[e];return b.prototype[c].apply(a,d)}};
|
||||
@@ -47,9 +50,7 @@ goog.base=function(a,b,c){var d=arguments.callee.caller;if(goog.STRICT_MODE_COMP
|
||||
g.superClass_&&g.superClass_.constructor)if(g.prototype[b]===d)f=!0;else if(f)return g.prototype[b].apply(a,e);if(a[b]===d)return a.constructor.prototype[b].apply(a,e);throw Error("goog.base called from a method of one name to a method of a different name");};goog.scope=function(a){if(goog.isInModuleLoader_())throw Error("goog.scope is not supported within a goog.module.");a.call(goog.global)};COMPILED||(goog.global.COMPILED=COMPILED);
|
||||
goog.defineClass=function(a,b){var c=b.constructor,d=b.statics;c&&c!=Object.prototype.constructor||(c=function(){throw Error("cannot instantiate an interface (no constructor defined).");});c=goog.defineClass.createSealingConstructor_(c,a);a&&goog.inherits(c,a);delete b.constructor;delete b.statics;goog.defineClass.applyProperties_(c.prototype,b);null!=d&&(d instanceof Function?d(c):goog.defineClass.applyProperties_(c,d));return c};goog.defineClass.SEAL_CLASS_INSTANCES=goog.DEBUG;
|
||||
goog.defineClass.createSealingConstructor_=function(a,b){if(!goog.defineClass.SEAL_CLASS_INSTANCES)return a;var c=!goog.defineClass.isUnsealable_(b),d=function(){var b=a.apply(this,arguments)||this;b[goog.UID_PROPERTY_]=b[goog.UID_PROPERTY_];this.constructor===d&&c&&Object.seal instanceof Function&&Object.seal(b);return b};return d};goog.defineClass.isUnsealable_=function(a){return a&&a.prototype&&a.prototype[goog.UNSEALABLE_CONSTRUCTOR_PROPERTY_]};goog.defineClass.OBJECT_PROTOTYPE_FIELDS_="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");
|
||||
goog.defineClass.applyProperties_=function(a,b){for(var c in b)Object.prototype.hasOwnProperty.call(b,c)&&(a[c]=b[c]);for(var d=0;d<goog.defineClass.OBJECT_PROTOTYPE_FIELDS_.length;d++)c=goog.defineClass.OBJECT_PROTOTYPE_FIELDS_[d],Object.prototype.hasOwnProperty.call(b,c)&&(a[c]=b[c])};goog.tagUnsealableClass=function(a){!COMPILED&&goog.defineClass.SEAL_CLASS_INSTANCES&&(a.prototype[goog.UNSEALABLE_CONSTRUCTOR_PROPERTY_]=!0)};goog.UNSEALABLE_CONSTRUCTOR_PROPERTY_="goog_defineClass_legacy_unsealable";
|
||||
goog.createRequiresTranspilation_=function(){function a(a,b){d?c[a]=!0:b()?c[a]=!1:d=c[a]=!0}function b(a){try{return!!eval(a)}catch(g){return!1}}var c={es3:!1},d=!1,e=goog.global.navigator&&goog.global.navigator.userAgent?goog.global.navigator.userAgent:"";a("es5",function(){return b("[1,].length==1")});a("es6",function(){var a=e.match(/Edge\/(\d+)(\.\d)*/i);return a&&15>Number(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")});return c};goog.debug={};goog.debug.Error=function(a){if(Error.captureStackTrace)Error.captureStackTrace(this,goog.debug.Error);else{var b=Error().stack;b&&(this.stack=b)}a&&(this.message=String(a));this.reportErrorToServer=!0};goog.inherits(goog.debug.Error,Error);goog.debug.Error.prototype.name="CustomError";goog.dom={};goog.dom.NodeType={ELEMENT:1,ATTRIBUTE:2,TEXT:3,CDATA_SECTION:4,ENTITY_REFERENCE:5,ENTITY:6,PROCESSING_INSTRUCTION:7,COMMENT:8,DOCUMENT:9,DOCUMENT_TYPE:10,DOCUMENT_FRAGMENT:11,NOTATION:12};goog.string={};goog.string.DETECT_DOUBLE_ESCAPING=!1;goog.string.FORCE_NON_DOM_HTML_UNESCAPING=!1;goog.string.Unicode={NBSP:"\u00a0"};goog.string.startsWith=function(a,b){return 0==a.lastIndexOf(b,0)};goog.string.endsWith=function(a,b){var c=a.length-b.length;return 0<=c&&a.indexOf(b,c)==c};goog.string.caseInsensitiveStartsWith=function(a,b){return 0==goog.string.caseInsensitiveCompare(b,a.substr(0,b.length))};
|
||||
goog.defineClass.applyProperties_=function(a,b){for(var c in b)Object.prototype.hasOwnProperty.call(b,c)&&(a[c]=b[c]);for(var d=0;d<goog.defineClass.OBJECT_PROTOTYPE_FIELDS_.length;d++)c=goog.defineClass.OBJECT_PROTOTYPE_FIELDS_[d],Object.prototype.hasOwnProperty.call(b,c)&&(a[c]=b[c])};goog.tagUnsealableClass=function(a){!COMPILED&&goog.defineClass.SEAL_CLASS_INSTANCES&&(a.prototype[goog.UNSEALABLE_CONSTRUCTOR_PROPERTY_]=!0)};goog.UNSEALABLE_CONSTRUCTOR_PROPERTY_="goog_defineClass_legacy_unsealable";goog.debug={};goog.debug.Error=function(a){if(Error.captureStackTrace)Error.captureStackTrace(this,goog.debug.Error);else{var b=Error().stack;b&&(this.stack=b)}a&&(this.message=String(a));this.reportErrorToServer=!0};goog.inherits(goog.debug.Error,Error);goog.debug.Error.prototype.name="CustomError";goog.dom={};goog.dom.NodeType={ELEMENT:1,ATTRIBUTE:2,TEXT:3,CDATA_SECTION:4,ENTITY_REFERENCE:5,ENTITY:6,PROCESSING_INSTRUCTION:7,COMMENT:8,DOCUMENT:9,DOCUMENT_TYPE:10,DOCUMENT_FRAGMENT:11,NOTATION:12};goog.string={};goog.string.DETECT_DOUBLE_ESCAPING=!1;goog.string.FORCE_NON_DOM_HTML_UNESCAPING=!1;goog.string.Unicode={NBSP:"\u00a0"};goog.string.startsWith=function(a,b){return 0==a.lastIndexOf(b,0)};goog.string.endsWith=function(a,b){var c=a.length-b.length;return 0<=c&&a.indexOf(b,c)==c};goog.string.caseInsensitiveStartsWith=function(a,b){return 0==goog.string.caseInsensitiveCompare(b,a.substr(0,b.length))};
|
||||
goog.string.caseInsensitiveEndsWith=function(a,b){return 0==goog.string.caseInsensitiveCompare(b,a.substr(a.length-b.length,b.length))};goog.string.caseInsensitiveEquals=function(a,b){return a.toLowerCase()==b.toLowerCase()};goog.string.subs=function(a,b){for(var c=a.split("%s"),d="",e=Array.prototype.slice.call(arguments,1);e.length&&1<c.length;)d+=c.shift()+e.shift();return d+c.join("%s")};goog.string.collapseWhitespace=function(a){return a.replace(/[\s\xa0]+/g," ").replace(/^\s+|\s+$/g,"")};
|
||||
goog.string.isEmptyOrWhitespace=function(a){return/^[\s\xa0]*$/.test(a)};goog.string.isEmptyString=function(a){return 0==a.length};goog.string.isEmpty=goog.string.isEmptyOrWhitespace;goog.string.isEmptyOrWhitespaceSafe=function(a){return goog.string.isEmptyOrWhitespace(goog.string.makeSafe(a))};goog.string.isEmptySafe=goog.string.isEmptyOrWhitespaceSafe;goog.string.isBreakingWhitespace=function(a){return!/[^\t\n\r ]/.test(a)};goog.string.isAlpha=function(a){return!/[^a-zA-Z]/.test(a)};
|
||||
goog.string.isNumeric=function(a){return!/[^0-9]/.test(a)};goog.string.isAlphaNumeric=function(a){return!/[^a-zA-Z0-9]/.test(a)};goog.string.isSpace=function(a){return" "==a};goog.string.isUnicodeChar=function(a){return 1==a.length&&" "<=a&&"~">=a||"\u0080"<=a&&"\ufffd">=a};goog.string.stripNewlines=function(a){return a.replace(/(\r\n|\r|\n)+/g," ")};goog.string.canonicalizeNewlines=function(a){return a.replace(/(\r\n|\r|\n)/g,"\n")};
|
||||
@@ -81,8 +82,8 @@ goog.asserts.fail=function(a,b){goog.asserts.ENABLE_ASSERTS&&goog.asserts.errorH
|
||||
goog.asserts.assertString=function(a,b,c){goog.asserts.ENABLE_ASSERTS&&!goog.isString(a)&&goog.asserts.doAssertFailure_("Expected string but got %s: %s.",[goog.typeOf(a),a],b,Array.prototype.slice.call(arguments,2));return a};goog.asserts.assertFunction=function(a,b,c){goog.asserts.ENABLE_ASSERTS&&!goog.isFunction(a)&&goog.asserts.doAssertFailure_("Expected function but got %s: %s.",[goog.typeOf(a),a],b,Array.prototype.slice.call(arguments,2));return a};
|
||||
goog.asserts.assertObject=function(a,b,c){goog.asserts.ENABLE_ASSERTS&&!goog.isObject(a)&&goog.asserts.doAssertFailure_("Expected object but got %s: %s.",[goog.typeOf(a),a],b,Array.prototype.slice.call(arguments,2));return a};goog.asserts.assertArray=function(a,b,c){goog.asserts.ENABLE_ASSERTS&&!goog.isArray(a)&&goog.asserts.doAssertFailure_("Expected array but got %s: %s.",[goog.typeOf(a),a],b,Array.prototype.slice.call(arguments,2));return a};
|
||||
goog.asserts.assertBoolean=function(a,b,c){goog.asserts.ENABLE_ASSERTS&&!goog.isBoolean(a)&&goog.asserts.doAssertFailure_("Expected boolean but got %s: %s.",[goog.typeOf(a),a],b,Array.prototype.slice.call(arguments,2));return a};goog.asserts.assertElement=function(a,b,c){!goog.asserts.ENABLE_ASSERTS||goog.isObject(a)&&a.nodeType==goog.dom.NodeType.ELEMENT||goog.asserts.doAssertFailure_("Expected Element but got %s: %s.",[goog.typeOf(a),a],b,Array.prototype.slice.call(arguments,2));return a};
|
||||
goog.asserts.assertInstanceof=function(a,b,c,d){!goog.asserts.ENABLE_ASSERTS||a instanceof b||goog.asserts.doAssertFailure_("Expected instanceof %s but got %s.",[goog.asserts.getType_(b),goog.asserts.getType_(a)],c,Array.prototype.slice.call(arguments,3));return a};goog.asserts.assertObjectPrototypeIsIntact=function(){for(var a in Object.prototype)goog.asserts.fail(a+" should not be enumerable in Object.prototype.")};
|
||||
goog.asserts.getType_=function(a){return a instanceof Function?a.displayName||a.name||"unknown type name":a instanceof Object?a.constructor.displayName||a.constructor.name||Object.prototype.toString.call(a):null===a?"null":typeof a};goog.array={};goog.NATIVE_ARRAY_PROTOTYPES=goog.TRUSTED_SITE;goog.array.ASSUME_NATIVE_FUNCTIONS=!1;goog.array.peek=function(a){return a[a.length-1]};goog.array.last=goog.array.peek;
|
||||
goog.asserts.assertInstanceof=function(a,b,c,d){!goog.asserts.ENABLE_ASSERTS||a instanceof b||goog.asserts.doAssertFailure_("Expected instanceof %s but got %s.",[goog.asserts.getType_(b),goog.asserts.getType_(a)],c,Array.prototype.slice.call(arguments,3));return a};goog.asserts.assertFinite=function(a,b,c){!goog.asserts.ENABLE_ASSERTS||"number"==typeof a&&isFinite(a)||goog.asserts.doAssertFailure_("Expected %s to be a finite number but it is not.",[a],b,Array.prototype.slice.call(arguments,2));return a};
|
||||
goog.asserts.assertObjectPrototypeIsIntact=function(){for(var a in Object.prototype)goog.asserts.fail(a+" should not be enumerable in Object.prototype.")};goog.asserts.getType_=function(a){return a instanceof Function?a.displayName||a.name||"unknown type name":a instanceof Object?a.constructor.displayName||a.constructor.name||Object.prototype.toString.call(a):null===a?"null":typeof a};goog.array={};goog.NATIVE_ARRAY_PROTOTYPES=goog.TRUSTED_SITE;goog.array.ASSUME_NATIVE_FUNCTIONS=!1;goog.array.peek=function(a){return a[a.length-1]};goog.array.last=goog.array.peek;
|
||||
goog.array.indexOf=goog.NATIVE_ARRAY_PROTOTYPES&&(goog.array.ASSUME_NATIVE_FUNCTIONS||Array.prototype.indexOf)?function(a,b,c){goog.asserts.assert(null!=a.length);return Array.prototype.indexOf.call(a,b,c)}:function(a,b,c){c=null==c?0:0>c?Math.max(0,a.length+c):c;if(goog.isString(a))return goog.isString(b)&&1==b.length?a.indexOf(b,c):-1;for(;c<a.length;c++)if(c in a&&a[c]===b)return c;return-1};
|
||||
goog.array.lastIndexOf=goog.NATIVE_ARRAY_PROTOTYPES&&(goog.array.ASSUME_NATIVE_FUNCTIONS||Array.prototype.lastIndexOf)?function(a,b,c){goog.asserts.assert(null!=a.length);return Array.prototype.lastIndexOf.call(a,b,null==c?a.length-1:c)}:function(a,b,c){c=null==c?a.length-1:c;0>c&&(c=Math.max(0,a.length+c));if(goog.isString(a))return goog.isString(b)&&1==b.length?a.lastIndexOf(b,c):-1;for(;0<=c;c--)if(c in a&&a[c]===b)return c;return-1};
|
||||
goog.array.forEach=goog.NATIVE_ARRAY_PROTOTYPES&&(goog.array.ASSUME_NATIVE_FUNCTIONS||Array.prototype.forEach)?function(a,b,c){goog.asserts.assert(null!=a.length);Array.prototype.forEach.call(a,b,c)}:function(a,b,c){for(var d=a.length,e=goog.isString(a)?a.split(""):a,f=0;f<d;f++)f in e&&b.call(c,e[f],f,a)};goog.array.forEachRight=function(a,b,c){var d=a.length,e=goog.isString(a)?a.split(""):a;for(--d;0<=d;--d)d in e&&b.call(c,e[d],d,a)};
|
||||
@@ -151,7 +152,7 @@ goog.userAgent.PLATFORM_KNOWN_=goog.userAgent.ASSUME_MAC||goog.userAgent.ASSUME_
|
||||
goog.userAgent.isLegacyLinux_=function(){return goog.labs.userAgent.platform.isLinux()||goog.labs.userAgent.platform.isChromeOS()};goog.userAgent.LINUX=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_LINUX:goog.userAgent.isLegacyLinux_();goog.userAgent.isX11_=function(){var a=goog.userAgent.getNavigator();return!!a&&goog.string.contains(a.appVersion||"","X11")};goog.userAgent.X11=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_X11:goog.userAgent.isX11_();
|
||||
goog.userAgent.ANDROID=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_ANDROID:goog.labs.userAgent.platform.isAndroid();goog.userAgent.IPHONE=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_IPHONE:goog.labs.userAgent.platform.isIphone();goog.userAgent.IPAD=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_IPAD:goog.labs.userAgent.platform.isIpad();goog.userAgent.IPOD=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_IPOD:goog.labs.userAgent.platform.isIpod();
|
||||
goog.userAgent.IOS=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_IPHONE||goog.userAgent.ASSUME_IPAD||goog.userAgent.ASSUME_IPOD:goog.labs.userAgent.platform.isIos();goog.userAgent.determineVersion_=function(){var a="",b=goog.userAgent.getVersionRegexResult_();b&&(a=b?b[1]:"");return goog.userAgent.IE&&(b=goog.userAgent.getDocumentMode_(),null!=b&&b>parseFloat(a))?String(b):a};
|
||||
goog.userAgent.getVersionRegexResult_=function(){var a=goog.userAgent.getUserAgentString();if(goog.userAgent.GECKO)return/rv\:([^\);]+)(\)|;)/.exec(a);if(goog.userAgent.EDGE)return/Edge\/([\d\.]+)/.exec(a);if(goog.userAgent.IE)return/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(a);if(goog.userAgent.WEBKIT)return/WebKit\/(\S+)/.exec(a);if(goog.userAgent.OPERA)return/(?:Version)[ \/]?(\S+)/.exec(a)};goog.userAgent.getDocumentMode_=function(){var a=goog.global.document;return a?a.documentMode:void 0};
|
||||
goog.userAgent.getVersionRegexResult_=function(){var a=goog.userAgent.getUserAgentString();if(goog.userAgent.GECKO)return/rv:([^\);]+)(\)|;)/.exec(a);if(goog.userAgent.EDGE)return/Edge\/([\d\.]+)/.exec(a);if(goog.userAgent.IE)return/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(a);if(goog.userAgent.WEBKIT)return/WebKit\/(\S+)/.exec(a);if(goog.userAgent.OPERA)return/(?:Version)[ \/]?(\S+)/.exec(a)};goog.userAgent.getDocumentMode_=function(){var a=goog.global.document;return a?a.documentMode:void 0};
|
||||
goog.userAgent.VERSION=goog.userAgent.determineVersion_();goog.userAgent.compare=function(a,b){return goog.string.compareVersions(a,b)};goog.userAgent.isVersionOrHigherCache_={};goog.userAgent.isVersionOrHigher=function(a){return goog.userAgent.ASSUME_ANY_VERSION||goog.reflect.cache(goog.userAgent.isVersionOrHigherCache_,a,function(){return 0<=goog.string.compareVersions(goog.userAgent.VERSION,a)})};goog.userAgent.isVersion=goog.userAgent.isVersionOrHigher;
|
||||
goog.userAgent.isDocumentModeOrHigher=function(a){return Number(goog.userAgent.DOCUMENT_MODE)>=a};goog.userAgent.isDocumentMode=goog.userAgent.isDocumentModeOrHigher;goog.userAgent.DOCUMENT_MODE=function(){var a=goog.global.document,b=goog.userAgent.getDocumentMode_();if(a&&goog.userAgent.IE)return b||("CSS1Compat"==a.compatMode?parseInt(goog.userAgent.VERSION,10):5)}();goog.Thenable=function(){};goog.Thenable.prototype.then=function(a,b,c){};goog.Thenable.IMPLEMENTED_BY_PROP="$goog_Thenable";goog.Thenable.addImplementation=function(a){a.prototype.then=a.prototype.then;COMPILED?a.prototype[goog.Thenable.IMPLEMENTED_BY_PROP]=!0:a.prototype.$goog_Thenable=!0};goog.Thenable.isImplementedBy=function(a){if(!a)return!1;try{return COMPILED?!!a[goog.Thenable.IMPLEMENTED_BY_PROP]:!!a.$goog_Thenable}catch(b){return!1}};goog.async={};goog.async.FreeList=function(a,b,c){this.limit_=c;this.create_=a;this.reset_=b;this.occupants_=0;this.head_=null};goog.async.FreeList.prototype.get=function(){if(0<this.occupants_){this.occupants_--;var a=this.head_;this.head_=a.next;a.next=null}else a=this.create_();return a};goog.async.FreeList.prototype.put=function(a){this.reset_(a);this.occupants_<this.limit_&&(this.occupants_++,a.next=this.head_,this.head_=a)};goog.async.FreeList.prototype.occupants=function(){return this.occupants_};goog.async.WorkQueue=function(){this.workTail_=this.workHead_=null};goog.async.WorkQueue.DEFAULT_MAX_UNUSED=100;goog.async.WorkQueue.freelist_=new goog.async.FreeList(function(){return new goog.async.WorkItem},function(a){a.reset()},goog.async.WorkQueue.DEFAULT_MAX_UNUSED);goog.async.WorkQueue.prototype.add=function(a,b){var c=this.getUnusedItem_();c.set(a,b);this.workTail_?this.workTail_.next=c:(goog.asserts.assert(!this.workHead_),this.workHead_=c);this.workTail_=c};
|
||||
goog.async.WorkQueue.prototype.remove=function(){var a=null;this.workHead_&&(a=this.workHead_,this.workHead_=this.workHead_.next,this.workHead_||(this.workTail_=null),a.next=null);return a};goog.async.WorkQueue.prototype.returnUnused=function(a){goog.async.WorkQueue.freelist_.put(a)};goog.async.WorkQueue.prototype.getUnusedItem_=function(){return goog.async.WorkQueue.freelist_.get()};goog.async.WorkItem=function(){this.next=this.scope=this.fn=null};
|
||||
@@ -211,7 +212,7 @@ goog.Promise.setUnhandledRejectionHandler=function(a){goog.Promise.handleRejecti
|
||||
goog.Disposable.getUndisposedObjects=function(){var a=[],b;for(b in goog.Disposable.instances_)goog.Disposable.instances_.hasOwnProperty(b)&&a.push(goog.Disposable.instances_[Number(b)]);return a};goog.Disposable.clearUndisposedObjects=function(){goog.Disposable.instances_={}};goog.Disposable.prototype.disposed_=!1;goog.Disposable.prototype.isDisposed=function(){return this.disposed_};goog.Disposable.prototype.getDisposed=goog.Disposable.prototype.isDisposed;
|
||||
goog.Disposable.prototype.dispose=function(){if(!this.disposed_&&(this.disposed_=!0,this.disposeInternal(),goog.Disposable.MONITORING_MODE!=goog.Disposable.MonitoringMode.OFF)){var a=goog.getUid(this);if(goog.Disposable.MONITORING_MODE==goog.Disposable.MonitoringMode.PERMANENT&&!goog.Disposable.instances_.hasOwnProperty(a))throw Error(this+" did not call the goog.Disposable base constructor or was disposed of after a clearUndisposedObjects call");delete goog.Disposable.instances_[a]}};
|
||||
goog.Disposable.prototype.registerDisposable=function(a){this.addOnDisposeCallback(goog.partial(goog.dispose,a))};goog.Disposable.prototype.addOnDisposeCallback=function(a,b){this.disposed_?goog.isDef(b)?a.call(b):a():(this.onDisposeCallbacks_||(this.onDisposeCallbacks_=[]),this.onDisposeCallbacks_.push(goog.isDef(b)?goog.bind(a,b):a))};goog.Disposable.prototype.disposeInternal=function(){if(this.onDisposeCallbacks_)for(;this.onDisposeCallbacks_.length;)this.onDisposeCallbacks_.shift()()};
|
||||
goog.Disposable.isDisposed=function(a){return a&&"function"==typeof a.isDisposed?a.isDisposed():!1};goog.dispose=function(a){a&&"function"==typeof a.dispose&&a.dispose()};goog.disposeAll=function(a){for(var b=0,c=arguments.length;b<c;++b){var d=arguments[b];goog.isArrayLike(d)?goog.disposeAll.apply(null,d):goog.dispose(d)}};goog.debug.errorcontext={};goog.debug.errorcontext.addErrorContext=function(a,b,c){a[goog.debug.errorcontext.CONTEXT_KEY_]||(a[goog.debug.errorcontext.CONTEXT_KEY_]={});a[goog.debug.errorcontext.CONTEXT_KEY_][b]=c};goog.debug.errorcontext.getErrorContext=function(a){return a[goog.debug.errorcontext.CONTEXT_KEY_]||{}};goog.debug.errorcontext.CONTEXT_KEY_="__closure__error__context__984382";goog.debug.LOGGING_ENABLED=goog.DEBUG;goog.debug.FORCE_SLOPPY_STACKS=!1;goog.debug.catchErrors=function(a,b,c){c=c||goog.global;var d=c.onerror,e=!!b;goog.userAgent.WEBKIT&&!goog.userAgent.isVersionOrHigher("535.3")&&(e=!e);c.onerror=function(b,c,h,k,n){d&&d(b,c,h,k,n);a({message:b,fileName:c,line:h,col:k,error:n});return e}};
|
||||
goog.Disposable.isDisposed=function(a){return a&&"function"==typeof a.isDisposed?a.isDisposed():!1};goog.dispose=function(a){a&&"function"==typeof a.dispose&&a.dispose()};goog.disposeAll=function(a){for(var b=0,c=arguments.length;b<c;++b){var d=arguments[b];goog.isArrayLike(d)?goog.disposeAll.apply(null,d):goog.dispose(d)}};goog.debug.errorcontext={};goog.debug.errorcontext.addErrorContext=function(a,b,c){a[goog.debug.errorcontext.CONTEXT_KEY_]||(a[goog.debug.errorcontext.CONTEXT_KEY_]={});a[goog.debug.errorcontext.CONTEXT_KEY_][b]=c};goog.debug.errorcontext.getErrorContext=function(a){return a[goog.debug.errorcontext.CONTEXT_KEY_]||{}};goog.debug.errorcontext.CONTEXT_KEY_="__closure__error__context__984382";goog.debug.LOGGING_ENABLED=goog.DEBUG;goog.debug.FORCE_SLOPPY_STACKS=!1;goog.debug.catchErrors=function(a,b,c){c=c||goog.global;var d=c.onerror,e=!!b;goog.userAgent.WEBKIT&&!goog.userAgent.isVersionOrHigher("535.3")&&(e=!e);c.onerror=function(b,c,h,k,n){d&&d(b,c,h,k,n);a({message:b,fileName:c,line:h,lineNumber:h,col:k,error:n});return e}};
|
||||
goog.debug.expose=function(a,b){if("undefined"==typeof a)return"undefined";if(null==a)return"NULL";var c=[],d;for(d in a)if(b||!goog.isFunction(a[d])){var e=d+" = ";try{e+=a[d]}catch(f){e+="*** "+f+" ***"}c.push(e)}return c.join("\n")};
|
||||
goog.debug.deepExpose=function(a,b){var c=[],d=[],e={},f=function(a,g){var h=g+" ";try{if(goog.isDef(a))if(goog.isNull(a))c.push("NULL");else if(goog.isString(a))c.push('"'+a.replace(/\n/g,"\n"+g)+'"');else if(goog.isFunction(a))c.push(String(a).replace(/\n/g,"\n"+g));else if(goog.isObject(a)){goog.hasUid(a)||d.push(a);var k=goog.getUid(a);if(e[k])c.push("*** reference loop detected (id="+k+") ***");else{e[k]=!0;c.push("{");for(var l in a)if(b||!goog.isFunction(a[l]))c.push("\n"),c.push(h),c.push(l+
|
||||
" = "),f(a[l],h);c.push("\n"+g+"}");delete e[k]}}else c.push(a);else c.push("undefined")}catch(m){c.push("*** "+m+" ***")}};f(a,"");for(var g=0;g<d.length;g++)goog.removeUid(d[g]);return c.join("")};goog.debug.exposeArray=function(a){for(var b=[],c=0;c<a.length;c++)goog.isArray(a[c])?b.push(goog.debug.exposeArray(a[c])):b.push(a[c]);return"[ "+b.join(", ")+" ]"};
|
||||
@@ -284,14 +285,10 @@ goog.Timer.prototype.start=function(){this.enabled=!0;this.timer_||(this.timer_=
|
||||
goog.Timer.callOnce=function(a,b,c){if(goog.isFunction(a))c&&(a=goog.bind(a,c));else if(a&&"function"==typeof a.handleEvent)a=goog.bind(a.handleEvent,a);else throw Error("Invalid listener argument");return Number(b)>goog.Timer.MAX_TIMEOUT_?goog.Timer.INVALID_TIMEOUT_ID_:goog.Timer.defaultTimerObject.setTimeout(a,b||0)};goog.Timer.clear=function(a){goog.Timer.defaultTimerObject.clearTimeout(a)};
|
||||
goog.Timer.promise=function(a,b){var c=null;return(new goog.Promise(function(d,e){c=goog.Timer.callOnce(function(){d(b)},a);c==goog.Timer.INVALID_TIMEOUT_ID_&&e(Error("Failed to schedule timer."))})).thenCatch(function(a){goog.Timer.clear(c);throw a;})};goog.dom.BrowserFeature={CAN_ADD_NAME_OR_TYPE_ATTRIBUTES:!goog.userAgent.IE||goog.userAgent.isDocumentModeOrHigher(9),CAN_USE_CHILDREN_ATTRIBUTE:!goog.userAgent.GECKO&&!goog.userAgent.IE||goog.userAgent.IE&&goog.userAgent.isDocumentModeOrHigher(9)||goog.userAgent.GECKO&&goog.userAgent.isVersionOrHigher("1.9.1"),CAN_USE_INNER_TEXT:goog.userAgent.IE&&!goog.userAgent.isVersionOrHigher("9"),CAN_USE_PARENT_ELEMENT_PROPERTY:goog.userAgent.IE||goog.userAgent.OPERA||goog.userAgent.WEBKIT,INNER_HTML_NEEDS_SCOPED_ELEMENT:goog.userAgent.IE,
|
||||
LEGACY_IE_RANGES:goog.userAgent.IE&&!goog.userAgent.isDocumentModeOrHigher(9)};goog.dom.asserts={};goog.dom.asserts.assertIsLocation=function(a){if(goog.asserts.ENABLE_ASSERTS){var b=goog.dom.asserts.getWindow_(a);"undefined"!=typeof b.Location&&"undefined"!=typeof b.Element&&goog.asserts.assert(a&&(a instanceof b.Location||!(a instanceof b.Element)),"Argument is not a Location (or a non-Element mock); got: %s",goog.dom.asserts.debugStringForType_(a))}return a};
|
||||
goog.dom.asserts.assertIsHTMLAnchorElement=function(a){if(goog.asserts.ENABLE_ASSERTS){var b=goog.dom.asserts.getWindow_(a);"undefined"!=typeof b.HTMLAnchorElement&&"undefined"!=typeof b.Location&&"undefined"!=typeof b.Element&&goog.asserts.assert(a&&(a instanceof b.HTMLAnchorElement||!(a instanceof b.Location||a instanceof b.Element)),"Argument is not a HTMLAnchorElement (or a non-Element mock); got: %s",goog.dom.asserts.debugStringForType_(a))}return a};
|
||||
goog.dom.asserts.assertIsHTMLLinkElement=function(a){if(goog.asserts.ENABLE_ASSERTS){var b=goog.dom.asserts.getWindow_(a);"undefined"!=typeof b.HTMLLinkElement&&"undefined"!=typeof b.Location&&"undefined"!=typeof b.Element&&goog.asserts.assert(a&&(a instanceof b.HTMLLinkElement||!(a instanceof b.Location||a instanceof b.Element)),"Argument is not a HTMLLinkElement (or a non-Element mock); got: %s",goog.dom.asserts.debugStringForType_(a))}return a};
|
||||
goog.dom.asserts.assertIsHTMLImageElement=function(a){if(goog.asserts.ENABLE_ASSERTS){var b=goog.dom.asserts.getWindow_(a);"undefined"!=typeof b.HTMLImageElement&&"undefined"!=typeof b.Element&&goog.asserts.assert(a&&(a instanceof b.HTMLImageElement||!(a instanceof b.Element)),"Argument is not a HTMLImageElement (or a non-Element mock); got: %s",goog.dom.asserts.debugStringForType_(a))}return a};
|
||||
goog.dom.asserts.assertIsHTMLEmbedElement=function(a){if(goog.asserts.ENABLE_ASSERTS){var b=goog.dom.asserts.getWindow_(a);"undefined"!=typeof b.HTMLEmbedElement&&"undefined"!=typeof b.Element&&goog.asserts.assert(a&&(a instanceof b.HTMLEmbedElement||!(a instanceof b.Element)),"Argument is not a HTMLEmbedElement (or a non-Element mock); got: %s",goog.dom.asserts.debugStringForType_(a))}return a};
|
||||
goog.dom.asserts.assertIsHTMLFrameElement=function(a){if(goog.asserts.ENABLE_ASSERTS){var b=goog.dom.asserts.getWindow_(a);"undefined"!=typeof b.HTMLFrameElement&&"undefined"!=typeof b.Element&&goog.asserts.assert(a&&(a instanceof b.HTMLFrameElement||!(a instanceof b.Element)),"Argument is not a HTMLFrameElement (or a non-Element mock); got: %s",goog.dom.asserts.debugStringForType_(a))}return a};
|
||||
goog.dom.asserts.assertIsHTMLIFrameElement=function(a){if(goog.asserts.ENABLE_ASSERTS){var b=goog.dom.asserts.getWindow_(a);"undefined"!=typeof b.HTMLIFrameElement&&"undefined"!=typeof b.Element&&goog.asserts.assert(a&&(a instanceof b.HTMLIFrameElement||!(a instanceof b.Element)),"Argument is not a HTMLIFrameElement (or a non-Element mock); got: %s",goog.dom.asserts.debugStringForType_(a))}return a};
|
||||
goog.dom.asserts.assertIsHTMLObjectElement=function(a){if(goog.asserts.ENABLE_ASSERTS){var b=goog.dom.asserts.getWindow_(a);"undefined"!=typeof b.HTMLObjectElement&&"undefined"!=typeof b.Element&&goog.asserts.assert(a&&(a instanceof b.HTMLObjectElement||!(a instanceof b.Element)),"Argument is not a HTMLObjectElement (or a non-Element mock); got: %s",goog.dom.asserts.debugStringForType_(a))}return a};
|
||||
goog.dom.asserts.assertIsHTMLScriptElement=function(a){if(goog.asserts.ENABLE_ASSERTS){var b=goog.dom.asserts.getWindow_(a);"undefined"!=typeof b.HTMLScriptElement&&"undefined"!=typeof b.Element&&goog.asserts.assert(a&&(a instanceof b.HTMLScriptElement||!(a instanceof b.Element)),"Argument is not a HTMLScriptElement (or a non-Element mock); got: %s",goog.dom.asserts.debugStringForType_(a))}return a};
|
||||
goog.dom.asserts.assertIsElementType_=function(a,b){if(goog.asserts.ENABLE_ASSERTS){var c=goog.dom.asserts.getWindow_(a);"undefined"!=typeof c[b]&&"undefined"!=typeof c.Location&&"undefined"!=typeof c.Element&&goog.asserts.assert(a&&(a instanceof c[b]||!(a instanceof c.Location||a instanceof c.Element)),"Argument is not a %s (or a non-Element, non-Location mock); got: %s",b,goog.dom.asserts.debugStringForType_(a))}return a};
|
||||
goog.dom.asserts.assertIsHTMLAnchorElement=function(a){return goog.dom.asserts.assertIsElementType_(a,"HTMLAnchorElement")};goog.dom.asserts.assertIsHTMLButtonElement=function(a){return goog.dom.asserts.assertIsElementType_(a,"HTMLButtonElement")};goog.dom.asserts.assertIsHTMLLinkElement=function(a){return goog.dom.asserts.assertIsElementType_(a,"HTMLLinkElement")};goog.dom.asserts.assertIsHTMLImageElement=function(a){return goog.dom.asserts.assertIsElementType_(a,"HTMLImageElement")};
|
||||
goog.dom.asserts.assertIsHTMLInputElement=function(a){return goog.dom.asserts.assertIsElementType_(a,"HTMLInputElement")};goog.dom.asserts.assertIsHTMLEmbedElement=function(a){return goog.dom.asserts.assertIsElementType_(a,"HTMLEmbedElement")};goog.dom.asserts.assertIsHTMLFormElement=function(a){return goog.dom.asserts.assertIsElementType_(a,"HTMLFormElement")};goog.dom.asserts.assertIsHTMLFrameElement=function(a){return goog.dom.asserts.assertIsElementType_(a,"HTMLFrameElement")};
|
||||
goog.dom.asserts.assertIsHTMLIFrameElement=function(a){return goog.dom.asserts.assertIsElementType_(a,"HTMLIFrameElement")};goog.dom.asserts.assertIsHTMLObjectElement=function(a){return goog.dom.asserts.assertIsElementType_(a,"HTMLObjectElement")};goog.dom.asserts.assertIsHTMLScriptElement=function(a){return goog.dom.asserts.assertIsElementType_(a,"HTMLScriptElement")};
|
||||
goog.dom.asserts.debugStringForType_=function(a){return goog.isObject(a)?a.constructor.displayName||a.constructor.name||Object.prototype.toString.call(a):void 0===a?"undefined":null===a?"null":typeof a};goog.dom.asserts.getWindow_=function(a){return(a=a&&a.ownerDocument)&&(a.defaultView||a.parentWindow)||goog.global};goog.dom.tags={};goog.dom.tags.VOID_TAGS_={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0};goog.dom.tags.isVoidTag=function(a){return!0===goog.dom.tags.VOID_TAGS_[a]};goog.string.TypedString=function(){};goog.string.Const=function(){this.stringConstValueWithSecurityContract__googStringSecurityPrivate_="";this.STRING_CONST_TYPE_MARKER__GOOG_STRING_SECURITY_PRIVATE_=goog.string.Const.TYPE_MARKER_};goog.string.Const.prototype.implementsGoogStringTypedString=!0;goog.string.Const.prototype.getTypedStringValue=function(){return this.stringConstValueWithSecurityContract__googStringSecurityPrivate_};
|
||||
goog.string.Const.prototype.toString=function(){return"Const{"+this.stringConstValueWithSecurityContract__googStringSecurityPrivate_+"}"};goog.string.Const.unwrap=function(a){if(a instanceof goog.string.Const&&a.constructor===goog.string.Const&&a.STRING_CONST_TYPE_MARKER__GOOG_STRING_SECURITY_PRIVATE_===goog.string.Const.TYPE_MARKER_)return a.stringConstValueWithSecurityContract__googStringSecurityPrivate_;goog.asserts.fail("expected object of type Const, got '"+a+"'");return"type_error:Const"};
|
||||
goog.string.Const.from=function(a){return goog.string.Const.create__googStringSecurityPrivate_(a)};goog.string.Const.TYPE_MARKER_={};goog.string.Const.create__googStringSecurityPrivate_=function(a){var b=new goog.string.Const;b.stringConstValueWithSecurityContract__googStringSecurityPrivate_=a;return b};goog.string.Const.EMPTY=goog.string.Const.from("");goog.html={};goog.html.SafeScript=function(){this.privateDoNotAccessOrElseSafeScriptWrappedValue_="";this.SAFE_SCRIPT_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_=goog.html.SafeScript.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_};goog.html.SafeScript.prototype.implementsGoogStringTypedString=!0;goog.html.SafeScript.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_={};goog.html.SafeScript.fromConstant=function(a){a=goog.string.Const.unwrap(a);return 0===a.length?goog.html.SafeScript.EMPTY:goog.html.SafeScript.createSafeScriptSecurityPrivateDoNotAccessOrElse(a)};
|
||||
@@ -315,13 +312,12 @@ goog.i18n.bidi.normalizeHebrewQuote=function(a){return a.replace(goog.i18n.bidi.
|
||||
goog.i18n.bidi.estimateDirection=function(a,b){for(var c=0,d=0,e=!1,f=goog.i18n.bidi.stripHtmlIfNeeded_(a,b).split(goog.i18n.bidi.wordSeparatorRe_),g=0;g<f.length;g++){var h=f[g];goog.i18n.bidi.startsWithRtl(h)?(c++,d++):goog.i18n.bidi.isRequiredLtrRe_.test(h)?e=!0:goog.i18n.bidi.hasAnyLtr(h)?d++:goog.i18n.bidi.hasNumeralsRe_.test(h)&&(e=!0)}return 0==d?e?goog.i18n.bidi.Dir.LTR:goog.i18n.bidi.Dir.NEUTRAL:c/d>goog.i18n.bidi.rtlDetectionThreshold_?goog.i18n.bidi.Dir.RTL:goog.i18n.bidi.Dir.LTR};
|
||||
goog.i18n.bidi.detectRtlDirectionality=function(a,b){return goog.i18n.bidi.estimateDirection(a,b)==goog.i18n.bidi.Dir.RTL};goog.i18n.bidi.setElementDirAndAlign=function(a,b){a&&(b=goog.i18n.bidi.toDir(b))&&(a.style.textAlign=b==goog.i18n.bidi.Dir.RTL?goog.i18n.bidi.RIGHT:goog.i18n.bidi.LEFT,a.dir=b==goog.i18n.bidi.Dir.RTL?"rtl":"ltr")};
|
||||
goog.i18n.bidi.setElementDirByTextDirectionality=function(a,b){switch(goog.i18n.bidi.estimateDirection(b)){case goog.i18n.bidi.Dir.LTR:a.dir="ltr";break;case goog.i18n.bidi.Dir.RTL:a.dir="rtl";break;default:a.removeAttribute("dir")}};goog.i18n.bidi.DirectionalString=function(){};goog.html.TrustedResourceUrl=function(){this.privateDoNotAccessOrElseTrustedResourceUrlWrappedValue_="";this.TRUSTED_RESOURCE_URL_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_=goog.html.TrustedResourceUrl.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_};goog.html.TrustedResourceUrl.prototype.implementsGoogStringTypedString=!0;goog.html.TrustedResourceUrl.prototype.getTypedStringValue=function(){return this.privateDoNotAccessOrElseTrustedResourceUrlWrappedValue_};
|
||||
goog.html.TrustedResourceUrl.prototype.implementsGoogI18nBidiDirectionalString=!0;goog.html.TrustedResourceUrl.prototype.getDirection=function(){return goog.i18n.bidi.Dir.LTR};goog.DEBUG&&(goog.html.TrustedResourceUrl.prototype.toString=function(){return"TrustedResourceUrl{"+this.privateDoNotAccessOrElseTrustedResourceUrlWrappedValue_+"}"});
|
||||
goog.html.TrustedResourceUrl.prototype.implementsGoogI18nBidiDirectionalString=!0;goog.html.TrustedResourceUrl.prototype.getDirection=function(){return goog.i18n.bidi.Dir.LTR};goog.html.TrustedResourceUrl.prototype.cloneWithParams=function(a){var b=goog.html.TrustedResourceUrl.unwrap(this),c=/\?/.test(b)?"&":"?",d;for(d in a)for(var e=goog.isArray(a[d])?a[d]:[a[d]],f=0;f<e.length;f++)null!=e[f]&&(b+=c+encodeURIComponent(d)+"="+encodeURIComponent(String(e[f])),c="&");return goog.html.TrustedResourceUrl.createTrustedResourceUrlSecurityPrivateDoNotAccessOrElse(b)};
|
||||
goog.DEBUG&&(goog.html.TrustedResourceUrl.prototype.toString=function(){return"TrustedResourceUrl{"+this.privateDoNotAccessOrElseTrustedResourceUrlWrappedValue_+"}"});
|
||||
goog.html.TrustedResourceUrl.unwrap=function(a){if(a instanceof goog.html.TrustedResourceUrl&&a.constructor===goog.html.TrustedResourceUrl&&a.TRUSTED_RESOURCE_URL_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_===goog.html.TrustedResourceUrl.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_)return a.privateDoNotAccessOrElseTrustedResourceUrlWrappedValue_;goog.asserts.fail("expected object of type TrustedResourceUrl, got '"+a+"' of type "+goog.typeOf(a));return"type_error:TrustedResourceUrl"};
|
||||
goog.html.TrustedResourceUrl.format=function(a,b){var c=goog.html.TrustedResourceUrl.format_(a,b);return goog.html.TrustedResourceUrl.createTrustedResourceUrlSecurityPrivateDoNotAccessOrElse(c)};
|
||||
goog.html.TrustedResourceUrl.format_=function(a,b){var c=goog.string.Const.unwrap(a);if(!goog.html.TrustedResourceUrl.BASE_URL_.test(c))throw Error("Invalid TrustedResourceUrl format: "+c);return c.replace(goog.html.TrustedResourceUrl.FORMAT_MARKER_,function(a,e){if(!Object.prototype.hasOwnProperty.call(b,e))throw Error('Found marker, "'+e+'", in format string, "'+c+'", but no valid label mapping found in args: '+JSON.stringify(b));var d=b[e];return d instanceof goog.string.Const?goog.string.Const.unwrap(d):
|
||||
encodeURIComponent(String(d))})};goog.html.TrustedResourceUrl.FORMAT_MARKER_=/%{(\w+)}/g;goog.html.TrustedResourceUrl.BASE_URL_=/^(?:https:)?\/\/[0-9a-z.:[\]-]+\/|^\/[^\/\\]|^about:blank(#|$)/i;goog.html.TrustedResourceUrl.formatWithParams=function(a,b,c){a=goog.html.TrustedResourceUrl.format_(a,b);b=/\?/.test(a)?"&":"?";for(var d in c)for(var e=goog.isArray(c[d])?c[d]:[c[d]],f=0;f<e.length;f++)null!=e[f]&&(a+=b+encodeURIComponent(d)+"="+encodeURIComponent(String(e[f])),b="&");return goog.html.TrustedResourceUrl.createTrustedResourceUrlSecurityPrivateDoNotAccessOrElse(a)};
|
||||
goog.html.TrustedResourceUrl.fromConstant=function(a){return goog.html.TrustedResourceUrl.createTrustedResourceUrlSecurityPrivateDoNotAccessOrElse(goog.string.Const.unwrap(a))};goog.html.TrustedResourceUrl.fromConstants=function(a){for(var b="",c=0;c<a.length;c++)b+=goog.string.Const.unwrap(a[c]);return goog.html.TrustedResourceUrl.createTrustedResourceUrlSecurityPrivateDoNotAccessOrElse(b)};goog.html.TrustedResourceUrl.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_={};
|
||||
goog.html.TrustedResourceUrl.createTrustedResourceUrlSecurityPrivateDoNotAccessOrElse=function(a){var b=new goog.html.TrustedResourceUrl;b.privateDoNotAccessOrElseTrustedResourceUrlWrappedValue_=a;return b};goog.html.SafeUrl=function(){this.privateDoNotAccessOrElseSafeHtmlWrappedValue_="";this.SAFE_URL_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_=goog.html.SafeUrl.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_};goog.html.SafeUrl.INNOCUOUS_STRING="about:invalid#zClosurez";goog.html.SafeUrl.prototype.implementsGoogStringTypedString=!0;goog.html.SafeUrl.prototype.getTypedStringValue=function(){return this.privateDoNotAccessOrElseSafeHtmlWrappedValue_};
|
||||
goog.html.TrustedResourceUrl.format=function(a,b){var c=goog.string.Const.unwrap(a);if(!goog.html.TrustedResourceUrl.BASE_URL_.test(c))throw Error("Invalid TrustedResourceUrl format: "+c);var d=c.replace(goog.html.TrustedResourceUrl.FORMAT_MARKER_,function(a,d){if(!Object.prototype.hasOwnProperty.call(b,d))throw Error('Found marker, "'+d+'", in format string, "'+c+'", but no valid label mapping found in args: '+JSON.stringify(b));var e=b[d];return e instanceof goog.string.Const?goog.string.Const.unwrap(e):
|
||||
encodeURIComponent(String(e))});return goog.html.TrustedResourceUrl.createTrustedResourceUrlSecurityPrivateDoNotAccessOrElse(d)};goog.html.TrustedResourceUrl.FORMAT_MARKER_=/%{(\w+)}/g;goog.html.TrustedResourceUrl.BASE_URL_=/^(?:https:)?\/\/[0-9a-z.:[\]-]+\/|^\/[^\/\\]|^about:blank(#|$)/i;goog.html.TrustedResourceUrl.formatWithParams=function(a,b,c){return goog.html.TrustedResourceUrl.format(a,b).cloneWithParams(c)};goog.html.TrustedResourceUrl.fromConstant=function(a){return goog.html.TrustedResourceUrl.createTrustedResourceUrlSecurityPrivateDoNotAccessOrElse(goog.string.Const.unwrap(a))};
|
||||
goog.html.TrustedResourceUrl.fromConstants=function(a){for(var b="",c=0;c<a.length;c++)b+=goog.string.Const.unwrap(a[c]);return goog.html.TrustedResourceUrl.createTrustedResourceUrlSecurityPrivateDoNotAccessOrElse(b)};goog.html.TrustedResourceUrl.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_={};goog.html.TrustedResourceUrl.createTrustedResourceUrlSecurityPrivateDoNotAccessOrElse=function(a){var b=new goog.html.TrustedResourceUrl;b.privateDoNotAccessOrElseTrustedResourceUrlWrappedValue_=a;return b};goog.html.SafeUrl=function(){this.privateDoNotAccessOrElseSafeHtmlWrappedValue_="";this.SAFE_URL_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_=goog.html.SafeUrl.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_};goog.html.SafeUrl.INNOCUOUS_STRING="about:invalid#zClosurez";goog.html.SafeUrl.prototype.implementsGoogStringTypedString=!0;goog.html.SafeUrl.prototype.getTypedStringValue=function(){return this.privateDoNotAccessOrElseSafeHtmlWrappedValue_};
|
||||
goog.html.SafeUrl.prototype.implementsGoogI18nBidiDirectionalString=!0;goog.html.SafeUrl.prototype.getDirection=function(){return goog.i18n.bidi.Dir.LTR};goog.DEBUG&&(goog.html.SafeUrl.prototype.toString=function(){return"SafeUrl{"+this.privateDoNotAccessOrElseSafeHtmlWrappedValue_+"}"});
|
||||
goog.html.SafeUrl.unwrap=function(a){if(a instanceof goog.html.SafeUrl&&a.constructor===goog.html.SafeUrl&&a.SAFE_URL_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_===goog.html.SafeUrl.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_)return a.privateDoNotAccessOrElseSafeHtmlWrappedValue_;goog.asserts.fail("expected object of type SafeUrl, got '"+a+"' of type "+goog.typeOf(a));return"type_error:SafeUrl"};goog.html.SafeUrl.fromConstant=function(a){return goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(goog.string.Const.unwrap(a))};
|
||||
goog.html.SAFE_MIME_TYPE_PATTERN_=/^(?:audio\/(?:3gpp|3gpp2|aac|midi|mp4|mpeg|ogg|x-m4a|x-wav|webm)|image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|text\/csv|video\/(?:mpeg|mp4|ogg|webm))$/i;goog.html.SafeUrl.fromBlob=function(a){a=goog.html.SAFE_MIME_TYPE_PATTERN_.test(a.type)?goog.fs.url.createObjectUrl(a):goog.html.SafeUrl.INNOCUOUS_STRING;return goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(a)};goog.html.DATA_URL_PATTERN_=/^data:([^;,]*);base64,[a-z0-9+\/]+=*$/i;
|
||||
@@ -368,12 +364,15 @@ goog.html.SafeHtml.createSafeHtmlTagSecurityPrivateDoNotAccessOrElse=function(a,
|
||||
null);return goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse(e,d)};goog.html.SafeHtml.stringifyAttributes=function(a,b){var c="";if(b)for(var d in b){if(!goog.html.SafeHtml.VALID_NAMES_IN_TAG_.test(d))throw Error('Invalid attribute name "'+d+'".');var e=b[d];goog.isDefAndNotNull(e)&&(c+=" "+goog.html.SafeHtml.getAttrNameAndValue_(a,d,e))}return c};
|
||||
goog.html.SafeHtml.combineAttributes=function(a,b,c){var d={},e;for(e in a)goog.asserts.assert(e.toLowerCase()==e,"Must be lower case"),d[e]=a[e];for(e in b)goog.asserts.assert(e.toLowerCase()==e,"Must be lower case"),d[e]=b[e];for(e in c){var f=e.toLowerCase();if(f in a)throw Error('Cannot override "'+f+'" attribute, got "'+e+'" with value "'+c[e]+'"');f in b&&delete d[f];d[e]=c[e]}return d};
|
||||
goog.html.SafeHtml.DOCTYPE_HTML=goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse("<!DOCTYPE html>",goog.i18n.bidi.Dir.NEUTRAL);goog.html.SafeHtml.EMPTY=goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse("",goog.i18n.bidi.Dir.NEUTRAL);goog.html.SafeHtml.BR=goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse("<br>",goog.i18n.bidi.Dir.NEUTRAL);goog.dom.safe={};goog.dom.safe.InsertAdjacentHtmlPosition={AFTERBEGIN:"afterbegin",AFTEREND:"afterend",BEFOREBEGIN:"beforebegin",BEFOREEND:"beforeend"};goog.dom.safe.insertAdjacentHtml=function(a,b,c){a.insertAdjacentHTML(b,goog.html.SafeHtml.unwrap(c))};goog.dom.safe.SET_INNER_HTML_DISALLOWED_TAGS_={MATH:!0,SCRIPT:!0,STYLE:!0,SVG:!0,TEMPLATE:!0};
|
||||
goog.dom.safe.setInnerHtml=function(a,b){if(goog.asserts.ENABLE_ASSERTS){var c=a.tagName.toUpperCase();if(goog.dom.safe.SET_INNER_HTML_DISALLOWED_TAGS_[c])throw Error("goog.dom.safe.setInnerHtml cannot be used to set content of "+a.tagName+".");}a.innerHTML=goog.html.SafeHtml.unwrap(b)};goog.dom.safe.setOuterHtml=function(a,b){a.outerHTML=goog.html.SafeHtml.unwrap(b)};goog.dom.safe.setStyle=function(a,b){a.style.cssText=goog.html.SafeStyle.unwrap(b)};goog.dom.safe.documentWrite=function(a,b){a.write(goog.html.SafeHtml.unwrap(b))};
|
||||
goog.dom.safe.setInnerHtml=function(a,b){if(goog.asserts.ENABLE_ASSERTS){var c=a.tagName.toUpperCase();if(goog.dom.safe.SET_INNER_HTML_DISALLOWED_TAGS_[c])throw Error("goog.dom.safe.setInnerHtml cannot be used to set content of "+a.tagName+".");}a.innerHTML=goog.html.SafeHtml.unwrap(b)};goog.dom.safe.setOuterHtml=function(a,b){a.outerHTML=goog.html.SafeHtml.unwrap(b)};
|
||||
goog.dom.safe.setFormElementAction=function(a,b){var c=b instanceof goog.html.SafeUrl?b:goog.html.SafeUrl.sanitizeAssertUnchanged(b);goog.dom.asserts.assertIsHTMLFormElement(a).action=goog.html.SafeUrl.unwrap(c)};goog.dom.safe.setButtonFormAction=function(a,b){var c=b instanceof goog.html.SafeUrl?b:goog.html.SafeUrl.sanitizeAssertUnchanged(b);goog.dom.asserts.assertIsHTMLButtonElement(a).formaction=goog.html.SafeUrl.unwrap(c)};
|
||||
goog.dom.safe.setInputFormAction=function(a,b){var c=b instanceof goog.html.SafeUrl?b:goog.html.SafeUrl.sanitizeAssertUnchanged(b);goog.dom.asserts.assertIsHTMLInputElement(a).formaction=goog.html.SafeUrl.unwrap(c)};goog.dom.safe.setStyle=function(a,b){a.style.cssText=goog.html.SafeStyle.unwrap(b)};goog.dom.safe.documentWrite=function(a,b){a.write(goog.html.SafeHtml.unwrap(b))};
|
||||
goog.dom.safe.setAnchorHref=function(a,b){goog.dom.asserts.assertIsHTMLAnchorElement(a);var c=b instanceof goog.html.SafeUrl?b:goog.html.SafeUrl.sanitizeAssertUnchanged(b);a.href=goog.html.SafeUrl.unwrap(c)};goog.dom.safe.setImageSrc=function(a,b){goog.dom.asserts.assertIsHTMLImageElement(a);var c=b instanceof goog.html.SafeUrl?b:goog.html.SafeUrl.sanitizeAssertUnchanged(b);a.src=goog.html.SafeUrl.unwrap(c)};
|
||||
goog.dom.safe.setEmbedSrc=function(a,b){goog.dom.asserts.assertIsHTMLEmbedElement(a);a.src=goog.html.TrustedResourceUrl.unwrap(b)};goog.dom.safe.setFrameSrc=function(a,b){goog.dom.asserts.assertIsHTMLFrameElement(a);a.src=goog.html.TrustedResourceUrl.unwrap(b)};goog.dom.safe.setIframeSrc=function(a,b){goog.dom.asserts.assertIsHTMLIFrameElement(a);a.src=goog.html.TrustedResourceUrl.unwrap(b)};goog.dom.safe.setIframeSrcdoc=function(a,b){goog.dom.asserts.assertIsHTMLIFrameElement(a);a.srcdoc=goog.html.SafeHtml.unwrap(b)};
|
||||
goog.dom.safe.setLinkHrefAndRel=function(a,b,c){goog.dom.asserts.assertIsHTMLLinkElement(a);a.rel=c;goog.string.caseInsensitiveContains(c,"stylesheet")?(goog.asserts.assert(b instanceof goog.html.TrustedResourceUrl,'URL must be TrustedResourceUrl because "rel" contains "stylesheet"'),a.href=goog.html.TrustedResourceUrl.unwrap(b)):a.href=b instanceof goog.html.TrustedResourceUrl?goog.html.TrustedResourceUrl.unwrap(b):b instanceof goog.html.SafeUrl?goog.html.SafeUrl.unwrap(b):goog.html.SafeUrl.sanitizeAssertUnchanged(b).getTypedStringValue()};
|
||||
goog.dom.safe.setObjectData=function(a,b){goog.dom.asserts.assertIsHTMLObjectElement(a);a.data=goog.html.TrustedResourceUrl.unwrap(b)};goog.dom.safe.setScriptSrc=function(a,b){goog.dom.asserts.assertIsHTMLScriptElement(a);a.src=goog.html.TrustedResourceUrl.unwrap(b)};goog.dom.safe.setScriptContent=function(a,b){goog.dom.asserts.assertIsHTMLScriptElement(a);a.text=goog.html.SafeScript.unwrap(b)};
|
||||
goog.dom.safe.setLocationHref=function(a,b){goog.dom.asserts.assertIsLocation(a);var c=b instanceof goog.html.SafeUrl?b:goog.html.SafeUrl.sanitizeAssertUnchanged(b);a.href=goog.html.SafeUrl.unwrap(c)};goog.dom.safe.openInWindow=function(a,b,c,d,e){a=a instanceof goog.html.SafeUrl?a:goog.html.SafeUrl.sanitizeAssertUnchanged(a);return(b||window).open(goog.html.SafeUrl.unwrap(a),c?goog.string.Const.unwrap(c):"",d,e)};goog.html.uncheckedconversions={};goog.html.uncheckedconversions.safeHtmlFromStringKnownToSatisfyTypeContract=function(a,b,c){goog.asserts.assertString(goog.string.Const.unwrap(a),"must provide justification");goog.asserts.assert(!goog.string.isEmptyOrWhitespace(goog.string.Const.unwrap(a)),"must provide non-empty justification");return goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse(b,c||null)};
|
||||
goog.dom.safe.setLocationHref=function(a,b){goog.dom.asserts.assertIsLocation(a);var c=b instanceof goog.html.SafeUrl?b:goog.html.SafeUrl.sanitizeAssertUnchanged(b);a.href=goog.html.SafeUrl.unwrap(c)};goog.dom.safe.replaceLocation=function(a,b){goog.dom.asserts.assertIsLocation(a);var c=b instanceof goog.html.SafeUrl?b:goog.html.SafeUrl.sanitizeAssertUnchanged(b);a.replace(goog.html.SafeUrl.unwrap(c))};
|
||||
goog.dom.safe.openInWindow=function(a,b,c,d,e){a=a instanceof goog.html.SafeUrl?a:goog.html.SafeUrl.sanitizeAssertUnchanged(a);return(b||window).open(goog.html.SafeUrl.unwrap(a),c?goog.string.Const.unwrap(c):"",d,e)};goog.html.uncheckedconversions={};goog.html.uncheckedconversions.safeHtmlFromStringKnownToSatisfyTypeContract=function(a,b,c){goog.asserts.assertString(goog.string.Const.unwrap(a),"must provide justification");goog.asserts.assert(!goog.string.isEmptyOrWhitespace(goog.string.Const.unwrap(a)),"must provide non-empty justification");return goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse(b,c||null)};
|
||||
goog.html.uncheckedconversions.safeScriptFromStringKnownToSatisfyTypeContract=function(a,b){goog.asserts.assertString(goog.string.Const.unwrap(a),"must provide justification");goog.asserts.assert(!goog.string.isEmptyOrWhitespace(goog.string.Const.unwrap(a)),"must provide non-empty justification");return goog.html.SafeScript.createSafeScriptSecurityPrivateDoNotAccessOrElse(b)};
|
||||
goog.html.uncheckedconversions.safeStyleFromStringKnownToSatisfyTypeContract=function(a,b){goog.asserts.assertString(goog.string.Const.unwrap(a),"must provide justification");goog.asserts.assert(!goog.string.isEmptyOrWhitespace(goog.string.Const.unwrap(a)),"must provide non-empty justification");return goog.html.SafeStyle.createSafeStyleSecurityPrivateDoNotAccessOrElse(b)};
|
||||
goog.html.uncheckedconversions.safeStyleSheetFromStringKnownToSatisfyTypeContract=function(a,b){goog.asserts.assertString(goog.string.Const.unwrap(a),"must provide justification");goog.asserts.assert(!goog.string.isEmptyOrWhitespace(goog.string.Const.unwrap(a)),"must provide non-empty justification");return goog.html.SafeStyleSheet.createSafeStyleSheetSecurityPrivateDoNotAccessOrElse(b)};
|
||||
@@ -500,7 +499,7 @@ goog.style.getBounds=function(a){var b=goog.style.getPageOffset(a);a=goog.style.
|
||||
goog.style.getOpacity=function(a){goog.asserts.assert(a);var b=a.style;a="";"opacity"in b?a=b.opacity:"MozOpacity"in b?a=b.MozOpacity:"filter"in b&&(b=b.filter.match(/alpha\(opacity=([\d.]+)\)/))&&(a=String(b[1]/100));return""==a?a:Number(a)};goog.style.setOpacity=function(a,b){goog.asserts.assert(a);var c=a.style;"opacity"in c?c.opacity=b:"MozOpacity"in c?c.MozOpacity=b:"filter"in c&&(c.filter=""===b?"":"alpha(opacity="+100*Number(b)+")")};
|
||||
goog.style.setTransparentBackgroundImage=function(a,b){var c=a.style;goog.userAgent.IE&&!goog.userAgent.isVersionOrHigher("8")?c.filter='progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'+b+'", sizingMethod="crop")':(c.backgroundImage="url("+b+")",c.backgroundPosition="top left",c.backgroundRepeat="no-repeat")};goog.style.clearTransparentBackgroundImage=function(a){a=a.style;"filter"in a?a.filter="":a.backgroundImage="none"};
|
||||
goog.style.showElement=function(a,b){goog.style.setElementShown(a,b)};goog.style.setElementShown=function(a,b){a.style.display=b?"":"none"};goog.style.isElementShown=function(a){return"none"!=a.style.display};
|
||||
goog.style.installSafeStyleSheet=function(a,b){var c=goog.dom.getDomHelper(b),d=c.getDocument();if(goog.userAgent.IE&&d.createStyleSheet){var e=d.createStyleSheet();goog.style.setSafeStyleSheet(e,a)}else d=c.getElementsByTagNameAndClass("HEAD")[0],d||(e=c.getElementsByTagNameAndClass("BODY")[0],d=c.createDom("HEAD"),e.parentNode.insertBefore(d,e)),e=c.createDom("STYLE"),goog.style.setSafeStyleSheet(e,a),c.appendChild(d,e);return e};
|
||||
goog.style.installSafeStyleSheet=function(a,b){var c=goog.dom.getDomHelper(b),d=c.getDocument();if(goog.userAgent.IE&&d.createStyleSheet)return c=d.createStyleSheet(),goog.style.setSafeStyleSheet(c,a),c;d=c.getElementsByTagNameAndClass("HEAD")[0];if(!d){var e=c.getElementsByTagNameAndClass("BODY")[0];d=c.createDom("HEAD");e.parentNode.insertBefore(d,e)}e=c.createDom("STYLE");goog.style.setSafeStyleSheet(e,a);c.appendChild(d,e);return e};
|
||||
goog.style.uninstallStyles=function(a){goog.dom.removeNode(a.ownerNode||a.owningElement||a)};goog.style.setSafeStyleSheet=function(a,b){var c=goog.html.SafeStyleSheet.unwrap(b);goog.userAgent.IE&&goog.isDef(a.cssText)?a.cssText=c:a.innerHTML=c};goog.style.setPreWrap=function(a){a=a.style;goog.userAgent.IE&&!goog.userAgent.isVersionOrHigher("8")?(a.whiteSpace="pre",a.wordWrap="break-word"):a.whiteSpace=goog.userAgent.GECKO?"-moz-pre-wrap":"pre-wrap"};
|
||||
goog.style.setInlineBlock=function(a){a=a.style;a.position="relative";goog.userAgent.IE&&!goog.userAgent.isVersionOrHigher("8")?(a.zoom="1",a.display="inline"):a.display="inline-block"};goog.style.isRightToLeft=function(a){return"rtl"==goog.style.getStyle_(a,"direction")};goog.style.unselectableStyle_=goog.userAgent.GECKO?"MozUserSelect":goog.userAgent.WEBKIT||goog.userAgent.EDGE?"WebkitUserSelect":null;
|
||||
goog.style.isUnselectable=function(a){return goog.style.unselectableStyle_?"none"==a.style[goog.style.unselectableStyle_].toLowerCase():goog.userAgent.IE||goog.userAgent.OPERA?"on"==a.getAttribute("unselectable"):!1};
|
||||
@@ -519,7 +518,7 @@ goog.style.getBorderBox=function(a){if(goog.userAgent.IE&&!goog.userAgent.isDocu
|
||||
"borderBottomWidth");return new goog.math.Box(parseFloat(d),parseFloat(c),parseFloat(a),parseFloat(b))};goog.style.getFontFamily=function(a){var b=goog.dom.getOwnerDocument(a),c="";if(b.body.createTextRange&&goog.dom.contains(b,a)){b=b.body.createTextRange();b.moveToElementText(a);try{c=b.queryCommandValue("FontName")}catch(d){c=""}}c||(c=goog.style.getStyle_(a,"fontFamily"));a=c.split(",");1<a.length&&(c=a[0]);return goog.string.stripQuotes(c,"\"'")};goog.style.lengthUnitRegex_=/[^\d]+$/;
|
||||
goog.style.getLengthUnits=function(a){return(a=a.match(goog.style.lengthUnitRegex_))&&a[0]||null};goog.style.ABSOLUTE_CSS_LENGTH_UNITS_={cm:1,"in":1,mm:1,pc:1,pt:1};goog.style.CONVERTIBLE_RELATIVE_CSS_UNITS_={em:1,ex:1};
|
||||
goog.style.getFontSize=function(a){var b=goog.style.getStyle_(a,"fontSize"),c=goog.style.getLengthUnits(b);if(b&&"px"==c)return parseInt(b,10);if(goog.userAgent.IE){if(String(c)in goog.style.ABSOLUTE_CSS_LENGTH_UNITS_)return goog.style.getIePixelValue_(a,b,"left","pixelLeft");if(a.parentNode&&a.parentNode.nodeType==goog.dom.NodeType.ELEMENT&&String(c)in goog.style.CONVERTIBLE_RELATIVE_CSS_UNITS_)return a=a.parentNode,c=goog.style.getStyle_(a,"fontSize"),goog.style.getIePixelValue_(a,b==c?"1em":b,
|
||||
"left","pixelLeft")}c=goog.dom.createDom("SPAN",{style:"visibility:hidden;position:absolute;line-height:0;padding:0;margin:0;border:0;height:1em;"});goog.dom.appendChild(a,c);b=c.offsetHeight;goog.dom.removeNode(c);return b};goog.style.parseStyleAttribute=function(a){var b={};goog.array.forEach(a.split(/\s*;\s*/),function(a){var c=a.match(/\s*([\w-]+)\s*\:(.+)/);c&&(a=c[1],c=goog.string.trim(c[2]),b[goog.string.toCamelCase(a.toLowerCase())]=c)});return b};
|
||||
"left","pixelLeft")}c=goog.dom.createDom("SPAN",{style:"visibility:hidden;position:absolute;line-height:0;padding:0;margin:0;border:0;height:1em;"});goog.dom.appendChild(a,c);b=c.offsetHeight;goog.dom.removeNode(c);return b};goog.style.parseStyleAttribute=function(a){var b={};goog.array.forEach(a.split(/\s*;\s*/),function(a){var c=a.match(/\s*([\w-]+)\s*:(.+)/);c&&(a=c[1],c=goog.string.trim(c[2]),b[goog.string.toCamelCase(a.toLowerCase())]=c)});return b};
|
||||
goog.style.toStyleAttribute=function(a){var b=[];goog.object.forEach(a,function(a,d){b.push(goog.string.toSelectorCase(d),":",a,";")});return b.join("")};goog.style.setFloat=function(a,b){a.style[goog.userAgent.IE?"styleFloat":"cssFloat"]=b};goog.style.getFloat=function(a){return a.style[goog.userAgent.IE?"styleFloat":"cssFloat"]||""};
|
||||
goog.style.getScrollbarWidth=function(a){var b=goog.dom.createElement("DIV");a&&(b.className=a);b.style.cssText="overflow:auto;position:absolute;top:0;width:100px;height:100px";a=goog.dom.createElement("DIV");goog.style.setSize(a,"200px","200px");b.appendChild(a);goog.dom.appendChild(goog.dom.getDocument().body,b);a=b.offsetWidth-b.clientWidth;goog.dom.removeNode(b);return a};goog.style.MATRIX_TRANSLATION_REGEX_=/matrix\([0-9\.\-]+, [0-9\.\-]+, [0-9\.\-]+, [0-9\.\-]+, ([0-9\.\-]+)p?x?, ([0-9\.\-]+)p?x?\)/;
|
||||
goog.style.getCssTranslation=function(a){a=goog.style.getComputedTransform(a);return a?(a=a.match(goog.style.MATRIX_TRANSLATION_REGEX_))?new goog.math.Coordinate(parseFloat(a[1]),parseFloat(a[2])):new goog.math.Coordinate(0,0):new goog.math.Coordinate(0,0)};goog.events.EventHandler=function(a){goog.Disposable.call(this);this.handler_=a;this.keys_={}};goog.inherits(goog.events.EventHandler,goog.Disposable);goog.events.EventHandler.typeArray_=[];goog.events.EventHandler.prototype.listen=function(a,b,c,d){return this.listen_(a,b,c,d)};goog.events.EventHandler.prototype.listenWithScope=function(a,b,c,d,e){return this.listen_(a,b,c,d,e)};
|
||||
@@ -794,13 +793,13 @@ goog.debug.LogRecord.prototype.reset=function(a,b,c,d,e){goog.debug.LogRecord.EN
|
||||
goog.debug.LogRecord.prototype.setException=function(a){this.exception_=a};goog.debug.LogRecord.prototype.setLoggerName=function(a){this.loggerName_=a};goog.debug.LogRecord.prototype.getLevel=function(){return this.level_};goog.debug.LogRecord.prototype.setLevel=function(a){this.level_=a};goog.debug.LogRecord.prototype.getMessage=function(){return this.msg_};goog.debug.LogRecord.prototype.setMessage=function(a){this.msg_=a};goog.debug.LogRecord.prototype.getMillis=function(){return this.time_};
|
||||
goog.debug.LogRecord.prototype.setMillis=function(a){this.time_=a};goog.debug.LogRecord.prototype.getSequenceNumber=function(){return this.sequenceNumber_};goog.debug.LogBuffer=function(){goog.asserts.assert(goog.debug.LogBuffer.isBufferingEnabled(),"Cannot use goog.debug.LogBuffer without defining goog.debug.LogBuffer.CAPACITY.");this.clear()};goog.debug.LogBuffer.getInstance=function(){goog.debug.LogBuffer.instance_||(goog.debug.LogBuffer.instance_=new goog.debug.LogBuffer);return goog.debug.LogBuffer.instance_};goog.debug.LogBuffer.CAPACITY=0;
|
||||
goog.debug.LogBuffer.prototype.addRecord=function(a,b,c){var d=(this.curIndex_+1)%goog.debug.LogBuffer.CAPACITY;this.curIndex_=d;if(this.isFull_)return d=this.buffer_[d],d.reset(a,b,c),d;this.isFull_=d==goog.debug.LogBuffer.CAPACITY-1;return this.buffer_[d]=new goog.debug.LogRecord(a,b,c)};goog.debug.LogBuffer.isBufferingEnabled=function(){return 0<goog.debug.LogBuffer.CAPACITY};
|
||||
goog.debug.LogBuffer.prototype.clear=function(){this.buffer_=Array(goog.debug.LogBuffer.CAPACITY);this.curIndex_=-1;this.isFull_=!1};goog.debug.LogBuffer.prototype.forEachRecord=function(a){var b=this.buffer_;if(b[0]){var c=this.curIndex_,d=this.isFull_?c:-1;do d=(d+1)%goog.debug.LogBuffer.CAPACITY,a(b[d]);while(d!=c)}};goog.debug.Logger=function(a){this.name_=a;this.handlers_=this.children_=this.level_=this.parent_=null};goog.debug.Logger.ROOT_LOGGER_NAME="";goog.debug.Logger.ENABLE_HIERARCHY=!0;goog.debug.Logger.ENABLE_HIERARCHY||(goog.debug.Logger.rootHandlers_=[]);goog.debug.Logger.Level=function(a,b){this.name=a;this.value=b};goog.debug.Logger.Level.prototype.toString=function(){return this.name};goog.debug.Logger.Level.OFF=new goog.debug.Logger.Level("OFF",Infinity);
|
||||
goog.debug.LogBuffer.prototype.clear=function(){this.buffer_=Array(goog.debug.LogBuffer.CAPACITY);this.curIndex_=-1;this.isFull_=!1};goog.debug.LogBuffer.prototype.forEachRecord=function(a){var b=this.buffer_;if(b[0]){var c=this.curIndex_,d=this.isFull_?c:-1;do d=(d+1)%goog.debug.LogBuffer.CAPACITY,a(b[d]);while(d!=c)}};goog.debug.Logger=function(a){this.name_=a;this.handlers_=this.children_=this.level_=this.parent_=null};goog.debug.Logger.ROOT_LOGGER_NAME="";goog.debug.Logger.ENABLE_HIERARCHY=!0;goog.debug.Logger.ENABLE_PROFILER_LOGGING=!1;goog.debug.Logger.ENABLE_HIERARCHY||(goog.debug.Logger.rootHandlers_=[]);goog.debug.Logger.Level=function(a,b){this.name=a;this.value=b};goog.debug.Logger.Level.prototype.toString=function(){return this.name};goog.debug.Logger.Level.OFF=new goog.debug.Logger.Level("OFF",Infinity);
|
||||
goog.debug.Logger.Level.SHOUT=new goog.debug.Logger.Level("SHOUT",1200);goog.debug.Logger.Level.SEVERE=new goog.debug.Logger.Level("SEVERE",1E3);goog.debug.Logger.Level.WARNING=new goog.debug.Logger.Level("WARNING",900);goog.debug.Logger.Level.INFO=new goog.debug.Logger.Level("INFO",800);goog.debug.Logger.Level.CONFIG=new goog.debug.Logger.Level("CONFIG",700);goog.debug.Logger.Level.FINE=new goog.debug.Logger.Level("FINE",500);goog.debug.Logger.Level.FINER=new goog.debug.Logger.Level("FINER",400);
|
||||
goog.debug.Logger.Level.FINEST=new goog.debug.Logger.Level("FINEST",300);goog.debug.Logger.Level.ALL=new goog.debug.Logger.Level("ALL",0);goog.debug.Logger.Level.PREDEFINED_LEVELS=[goog.debug.Logger.Level.OFF,goog.debug.Logger.Level.SHOUT,goog.debug.Logger.Level.SEVERE,goog.debug.Logger.Level.WARNING,goog.debug.Logger.Level.INFO,goog.debug.Logger.Level.CONFIG,goog.debug.Logger.Level.FINE,goog.debug.Logger.Level.FINER,goog.debug.Logger.Level.FINEST,goog.debug.Logger.Level.ALL];
|
||||
goog.debug.Logger.Level.predefinedLevelsCache_=null;goog.debug.Logger.Level.createPredefinedLevelsCache_=function(){goog.debug.Logger.Level.predefinedLevelsCache_={};for(var a=0,b;b=goog.debug.Logger.Level.PREDEFINED_LEVELS[a];a++)goog.debug.Logger.Level.predefinedLevelsCache_[b.value]=b,goog.debug.Logger.Level.predefinedLevelsCache_[b.name]=b};
|
||||
goog.debug.Logger.Level.getPredefinedLevel=function(a){goog.debug.Logger.Level.predefinedLevelsCache_||goog.debug.Logger.Level.createPredefinedLevelsCache_();return goog.debug.Logger.Level.predefinedLevelsCache_[a]||null};
|
||||
goog.debug.Logger.Level.getPredefinedLevelByValue=function(a){goog.debug.Logger.Level.predefinedLevelsCache_||goog.debug.Logger.Level.createPredefinedLevelsCache_();if(a in goog.debug.Logger.Level.predefinedLevelsCache_)return goog.debug.Logger.Level.predefinedLevelsCache_[a];for(var b=0;b<goog.debug.Logger.Level.PREDEFINED_LEVELS.length;++b){var c=goog.debug.Logger.Level.PREDEFINED_LEVELS[b];if(c.value<=a)return c}return null};goog.debug.Logger.getLogger=function(a){return goog.debug.LogManager.getLogger(a)};
|
||||
goog.debug.Logger.logToProfilers=function(a){var b=goog.global.console;b&&b.timeStamp&&b.timeStamp(a);(b=goog.global.msWriteProfilerMark)&&b(a)};goog.debug.Logger.prototype.getName=function(){return this.name_};
|
||||
goog.debug.Logger.logToProfilers=function(a){if(goog.debug.Logger.ENABLE_PROFILER_LOGGING){var b=goog.global.msWriteProfilerMark;b?b(a):(b=goog.global.console)&&b.timeStamp&&b.timeStamp(a)}};goog.debug.Logger.prototype.getName=function(){return this.name_};
|
||||
goog.debug.Logger.prototype.addHandler=function(a){goog.debug.LOGGING_ENABLED&&(goog.debug.Logger.ENABLE_HIERARCHY?(this.handlers_||(this.handlers_=[]),this.handlers_.push(a)):(goog.asserts.assert(!this.name_,"Cannot call addHandler on a non-root logger when goog.debug.Logger.ENABLE_HIERARCHY is false."),goog.debug.Logger.rootHandlers_.push(a)))};
|
||||
goog.debug.Logger.prototype.removeHandler=function(a){if(goog.debug.LOGGING_ENABLED){var b=goog.debug.Logger.ENABLE_HIERARCHY?this.handlers_:goog.debug.Logger.rootHandlers_;return!!b&&goog.array.remove(b,a)}return!1};goog.debug.Logger.prototype.getParent=function(){return this.parent_};goog.debug.Logger.prototype.getChildren=function(){this.children_||(this.children_={});return this.children_};
|
||||
goog.debug.Logger.prototype.setLevel=function(a){goog.debug.LOGGING_ENABLED&&(goog.debug.Logger.ENABLE_HIERARCHY?this.level_=a:(goog.asserts.assert(!this.name_,"Cannot call setLevel() on a non-root logger when goog.debug.Logger.ENABLE_HIERARCHY is false."),goog.debug.Logger.rootLevel_=a))};goog.debug.Logger.prototype.getLevel=function(){return goog.debug.LOGGING_ENABLED?this.level_:goog.debug.Logger.Level.OFF};
|
||||
@@ -808,8 +807,8 @@ goog.debug.Logger.prototype.getEffectiveLevel=function(){if(!goog.debug.LOGGING_
|
||||
goog.debug.Logger.prototype.log=function(a,b,c){goog.debug.LOGGING_ENABLED&&this.isLoggable(a)&&(goog.isFunction(b)&&(b=b()),this.doLogRecord_(this.getLogRecord(a,b,c)))};goog.debug.Logger.prototype.getLogRecord=function(a,b,c){a=goog.debug.LogBuffer.isBufferingEnabled()?goog.debug.LogBuffer.getInstance().addRecord(a,b,this.name_):new goog.debug.LogRecord(a,String(b),this.name_);c&&a.setException(c);return a};
|
||||
goog.debug.Logger.prototype.shout=function(a,b){goog.debug.LOGGING_ENABLED&&this.log(goog.debug.Logger.Level.SHOUT,a,b)};goog.debug.Logger.prototype.severe=function(a,b){goog.debug.LOGGING_ENABLED&&this.log(goog.debug.Logger.Level.SEVERE,a,b)};goog.debug.Logger.prototype.warning=function(a,b){goog.debug.LOGGING_ENABLED&&this.log(goog.debug.Logger.Level.WARNING,a,b)};goog.debug.Logger.prototype.info=function(a,b){goog.debug.LOGGING_ENABLED&&this.log(goog.debug.Logger.Level.INFO,a,b)};
|
||||
goog.debug.Logger.prototype.config=function(a,b){goog.debug.LOGGING_ENABLED&&this.log(goog.debug.Logger.Level.CONFIG,a,b)};goog.debug.Logger.prototype.fine=function(a,b){goog.debug.LOGGING_ENABLED&&this.log(goog.debug.Logger.Level.FINE,a,b)};goog.debug.Logger.prototype.finer=function(a,b){goog.debug.LOGGING_ENABLED&&this.log(goog.debug.Logger.Level.FINER,a,b)};goog.debug.Logger.prototype.finest=function(a,b){goog.debug.LOGGING_ENABLED&&this.log(goog.debug.Logger.Level.FINEST,a,b)};
|
||||
goog.debug.Logger.prototype.logRecord=function(a){goog.debug.LOGGING_ENABLED&&this.isLoggable(a.getLevel())&&this.doLogRecord_(a)};goog.debug.Logger.prototype.doLogRecord_=function(a){goog.debug.Logger.logToProfilers("log:"+a.getMessage());if(goog.debug.Logger.ENABLE_HIERARCHY)for(var b=this;b;)b.callPublish_(a),b=b.getParent();else{b=0;for(var c;c=goog.debug.Logger.rootHandlers_[b++];)c(a)}};goog.debug.Logger.prototype.callPublish_=function(a){if(this.handlers_)for(var b=0,c;c=this.handlers_[b];b++)c(a)};
|
||||
goog.debug.Logger.prototype.setParent_=function(a){this.parent_=a};goog.debug.Logger.prototype.addChild_=function(a,b){this.getChildren()[a]=b};goog.debug.LogManager={};goog.debug.LogManager.loggers_={};goog.debug.LogManager.rootLogger_=null;
|
||||
goog.debug.Logger.prototype.logRecord=function(a){goog.debug.LOGGING_ENABLED&&this.isLoggable(a.getLevel())&&this.doLogRecord_(a)};goog.debug.Logger.prototype.doLogRecord_=function(a){goog.debug.Logger.ENABLE_PROFILER_LOGGING&&goog.debug.Logger.logToProfilers("log:"+a.getMessage());if(goog.debug.Logger.ENABLE_HIERARCHY)for(var b=this;b;)b.callPublish_(a),b=b.getParent();else{b=0;for(var c;c=goog.debug.Logger.rootHandlers_[b++];)c(a)}};
|
||||
goog.debug.Logger.prototype.callPublish_=function(a){if(this.handlers_)for(var b=0,c;c=this.handlers_[b];b++)c(a)};goog.debug.Logger.prototype.setParent_=function(a){this.parent_=a};goog.debug.Logger.prototype.addChild_=function(a,b){this.getChildren()[a]=b};goog.debug.LogManager={};goog.debug.LogManager.loggers_={};goog.debug.LogManager.rootLogger_=null;
|
||||
goog.debug.LogManager.initialize=function(){goog.debug.LogManager.rootLogger_||(goog.debug.LogManager.rootLogger_=new goog.debug.Logger(goog.debug.Logger.ROOT_LOGGER_NAME),goog.debug.LogManager.loggers_[goog.debug.Logger.ROOT_LOGGER_NAME]=goog.debug.LogManager.rootLogger_,goog.debug.LogManager.rootLogger_.setLevel(goog.debug.Logger.Level.CONFIG))};goog.debug.LogManager.getLoggers=function(){return goog.debug.LogManager.loggers_};
|
||||
goog.debug.LogManager.getRoot=function(){goog.debug.LogManager.initialize();return goog.debug.LogManager.rootLogger_};goog.debug.LogManager.getLogger=function(a){goog.debug.LogManager.initialize();return goog.debug.LogManager.loggers_[a]||goog.debug.LogManager.createLogger_(a)};goog.debug.LogManager.createFunctionForCatchErrors=function(a){return function(b){(a||goog.debug.LogManager.getRoot()).severe("Error: "+b.message+" ("+b.fileName+" @ Line: "+b.line+")")}};
|
||||
goog.debug.LogManager.createLogger_=function(a){var b=new goog.debug.Logger(a);if(goog.debug.Logger.ENABLE_HIERARCHY){var c=a.lastIndexOf("."),d=a.substr(0,c);c=a.substr(c+1);d=goog.debug.LogManager.getLogger(d);d.addChild_(c,b);b.setParent_(d)}return goog.debug.LogManager.loggers_[a]=b};goog.log={};goog.log.ENABLED=goog.debug.LOGGING_ENABLED;goog.log.ROOT_LOGGER_NAME=goog.debug.Logger.ROOT_LOGGER_NAME;goog.log.Logger=goog.debug.Logger;goog.log.Level=goog.debug.Logger.Level;goog.log.LogRecord=goog.debug.LogRecord;goog.log.getLogger=function(a,b){if(goog.log.ENABLED){var c=goog.debug.LogManager.getLogger(a);b&&c&&c.setLevel(b);return c}return null};goog.log.addHandler=function(a,b){goog.log.ENABLED&&a&&a.addHandler(b)};
|
||||
@@ -916,8 +915,8 @@ Blockly.Workspace.prototype.updateVariableStore=function(a){if(!this.isFlyout){f
|
||||
Blockly.Workspace.prototype.renameVariableInternal_=function(a,b){var c=this.getVariable(b);if(a&&c&&a.type!=c.type)throw Error('Variable "'+a.name+'" is type "'+a.type+'" and variable "'+b+'" is type "'+c.type+'". Both must be the same type.');if(c&&c.name!=b)var d=c.name;Blockly.Events.setGroup(!0);c=this.getAllBlocks();for(var e=0;e<c.length;e++)c[e].renameVar(a.name,b),d&&c[e].renameVar(d,b);this.variableMap_.renameVariable(a,b);Blockly.Events.setGroup(!1)};
|
||||
Blockly.Workspace.prototype.renameVariable=function(a,b){var c=this.getVariable(a);this.renameVariableInternal_(c,b)};Blockly.Workspace.prototype.renameVariableById=function(a,b){var c=this.getVariableById(a);this.renameVariableInternal_(c,b)};Blockly.Workspace.prototype.createVariable=function(a,b,c){return this.variableMap_.createVariable(a,b,c)};
|
||||
Blockly.Workspace.prototype.getVariableUses=function(a){for(var b=[],c=this.getAllBlocks(),d=0;d<c.length;d++){var e=c[d].getVars();if(e)for(var f=0;f<e.length;f++){var g=e[f];g&&a&&Blockly.Names.equals(g,a)&&b.push(c[d])}}return b};
|
||||
Blockly.Workspace.prototype.deleteVariable=function(a){for(var b=this.getVariableUses(a),c=0,d;d=b[c];c++)if("procedures_defnoreturn"==d.type||"procedures_defreturn"==d.type){b=d.getFieldValue("NAME");Blockly.alert(Blockly.Msg.CANNOT_DELETE_VARIABLE_PROCEDURE.replace("%1",a).replace("%2",b));return}var e=this,f=e.getVariable(a);1<b.length?Blockly.confirm(Blockly.Msg.DELETE_VARIABLE_CONFIRMATION.replace("%1",b.length).replace("%2",a),function(a){a&&e.deleteVariableInternal_(f)}):this.deleteVariableInternal_(f)};
|
||||
Blockly.Workspace.prototype.deleteVariableById=function(a){var b=this.getVariableById(a);b?this.deleteVariableInternal_(b):console.warn("Can't delete non-existant variable: "+a)};Blockly.Workspace.prototype.deleteVariableInternal_=function(a){var b=this.getVariableUses(a.name);Blockly.Events.setGroup(!0);for(var c=0;c<b.length;c++)b[c].dispose(!0,!1);this.variableMap_.deleteVariable(a);Blockly.Events.setGroup(!1)};
|
||||
Blockly.Workspace.prototype.deleteVariable=function(a){for(var b=this.getVariableUses(a),c=0,d;d=b[c];c++)if("procedures_defnoreturn"==d.type||"procedures_defreturn"==d.type){b=d.getFieldValue("NAME");Blockly.alert(Blockly.Msg.CANNOT_DELETE_VARIABLE_PROCEDURE.replace("%1",a).replace("%2",b));return}var e=this,f=e.getVariable(a);1<b.length?Blockly.confirm(Blockly.Msg.DELETE_VARIABLE_CONFIRMATION.replace("%1",String(b.length)).replace("%2",a),function(a){a&&e.deleteVariableInternal_(f)}):this.deleteVariableInternal_(f)};
|
||||
Blockly.Workspace.prototype.deleteVariableById=function(a){var b=this.getVariableById(a);b?this.deleteVariableInternal_(b):console.warn("Can't delete non-existent variable: "+a)};Blockly.Workspace.prototype.deleteVariableInternal_=function(a){var b=this.getVariableUses(a.name);Blockly.Events.setGroup(!0);for(var c=0;c<b.length;c++)b[c].dispose(!0,!1);this.variableMap_.deleteVariable(a);Blockly.Events.setGroup(!1)};
|
||||
Blockly.Workspace.prototype.variableIndexOf=function(a){console.warn("Deprecated call to Blockly.Workspace.prototype.variableIndexOf");return-1};Blockly.Workspace.prototype.getVariable=function(a){return this.variableMap_.getVariable(a)};Blockly.Workspace.prototype.getVariableById=function(a){return this.variableMap_.getVariableById(a)};Blockly.Workspace.prototype.getWidth=function(){return 0};Blockly.Workspace.prototype.newBlock=function(a,b){return new Blockly.Block(this,a,b)};
|
||||
Blockly.Workspace.prototype.remainingCapacity=function(){return isNaN(this.options.maxBlocks)?Infinity:this.options.maxBlocks-this.getAllBlocks().length};
|
||||
Blockly.Workspace.prototype.undo=function(a){var b=a?this.redoStack_:this.undoStack_,c=a?this.undoStack_:this.redoStack_,d=b.pop();if(d){for(var e=[d];b.length&&d.group&&d.group==b[b.length-1].group;)e.push(b.pop());for(b=0;d=e[b];b++)c.push(d);e=Blockly.Events.filter(e,a);Blockly.Events.recordUndo=!1;try{for(b=0;d=e[b];b++)d.run(a)}finally{Blockly.Events.recordUndo=!0}}};Blockly.Workspace.prototype.clearUndo=function(){this.undoStack_.length=0;this.redoStack_.length=0;Blockly.Events.clearPendingUndo()};
|
||||
@@ -947,7 +946,7 @@ Blockly.Icon.prototype.dispose=function(){goog.dom.removeNode(this.iconGroup_);t
|
||||
Blockly.Icon.prototype.renderIcon=function(a){if(this.collapseHidden&&this.block_.isCollapsed())return this.iconGroup_.setAttribute("display","none"),a;this.iconGroup_.setAttribute("display","block");var b=this.SIZE;this.block_.RTL&&(a-=b);this.iconGroup_.setAttribute("transform","translate("+a+",5)");this.computeIconLocation();return a=this.block_.RTL?a-Blockly.BlockSvg.SEP_SPACE_X:a+(b+Blockly.BlockSvg.SEP_SPACE_X)};
|
||||
Blockly.Icon.prototype.setIconLocation=function(a){this.iconXY_=a;this.isVisible()&&this.bubble_.setAnchorLocation(a)};Blockly.Icon.prototype.computeIconLocation=function(){var a=this.block_.getRelativeToSurfaceXY(),b=Blockly.utils.getRelativeXY(this.iconGroup_);a=new goog.math.Coordinate(a.x+b.x+this.SIZE/2,a.y+b.y+this.SIZE/2);goog.math.Coordinate.equals(this.getIconLocation(),a)||this.setIconLocation(a)};Blockly.Icon.prototype.getIconLocation=function(){return this.iconXY_};
|
||||
Blockly.Comment=function(a){Blockly.Comment.superClass_.constructor.call(this,a);this.createIcon()};goog.inherits(Blockly.Comment,Blockly.Icon);Blockly.Comment.prototype.text_="";Blockly.Comment.prototype.width_=160;Blockly.Comment.prototype.height_=80;
|
||||
Blockly.Comment.prototype.drawIcon_=function(a){Blockly.utils.createSvgElement("circle",{"class":"blocklyIconShape",r:"8",cx:"8",cy:"8"},a);Blockly.utils.createSvgElement("path",{"class":"blocklyIconSymbol",d:"m6.8,10h2c0.003,-0.617 0.271,-0.962 0.633,-1.266 2.875,-2.405 0.607,-5.534 -3.765,-3.874v1.7c3.12,-1.657 3.698,0.118 2.336,1.25 -1.201,0.998 -1.201,1.528 -1.204,2.19z"},a);Blockly.utils.createSvgElement("rect",{"class":"blocklyIconSymbol",x:"6.8",y:"10.78",height:"2",width:"2"},a)};
|
||||
Blockly.Comment.prototype.drawIcon_=function(a){Blockly.utils.createSvgElement("circle",{"class":"blocklyIconShape",r:"8",cx:"8",cy:"8"},a);Blockly.utils.createSvgElement("path",{"class":"blocklyIconSymbol",d:"m6.8,10h2c0.003,-0.617 0.271,-0.962 0.633,-1.266 2.875,-2.4050.607,-5.534 -3.765,-3.874v1.7c3.12,-1.657 3.698,0.118 2.336,1.25-1.201,0.998 -1.201,1.528 -1.204,2.19z"},a);Blockly.utils.createSvgElement("rect",{"class":"blocklyIconSymbol",x:"6.8",y:"10.78",height:"2",width:"2"},a)};
|
||||
Blockly.Comment.prototype.createEditor_=function(){this.foreignObject_=Blockly.utils.createSvgElement("foreignObject",{x:Blockly.Bubble.BORDER_WIDTH,y:Blockly.Bubble.BORDER_WIDTH},null);var a=document.createElementNS(Blockly.HTML_NS,"body");a.setAttribute("xmlns",Blockly.HTML_NS);a.className="blocklyMinimalBody";var b=document.createElementNS(Blockly.HTML_NS,"textarea");b.className="blocklyCommentTextarea";b.setAttribute("dir",this.block_.RTL?"RTL":"LTR");a.appendChild(b);this.textarea_=b;this.foreignObject_.appendChild(a);
|
||||
Blockly.bindEventWithChecks_(b,"mouseup",this,this.textareaFocus_);Blockly.bindEventWithChecks_(b,"wheel",this,function(a){a.stopPropagation()});Blockly.bindEventWithChecks_(b,"change",this,function(a){this.text_!=b.value&&(Blockly.Events.fire(new Blockly.Events.BlockChange(this.block_,"comment",null,this.text_,b.value)),this.text_=b.value)});setTimeout(function(){b.focus()},0);return this.foreignObject_};
|
||||
Blockly.Comment.prototype.updateEditable=function(){this.isVisible()&&(this.setVisible(!1),this.setVisible(!0));Blockly.Icon.prototype.updateEditable.call(this)};Blockly.Comment.prototype.resizeBubble_=function(){if(this.isVisible()){var a=this.bubble_.getBubbleSize(),b=2*Blockly.Bubble.BORDER_WIDTH;this.foreignObject_.setAttribute("width",a.width-b);this.foreignObject_.setAttribute("height",a.height-b);this.textarea_.style.width=a.width-b-4+"px";this.textarea_.style.height=a.height-b-4+"px"}};
|
||||
@@ -977,9 +976,9 @@ return b+a.toDevString()};Blockly.Extensions={};Blockly.Extensions.ALL_={};Block
|
||||
Blockly.Extensions.registerMutator=function(a,b,c,d){var e='Error when registering mutator "'+a+'": ';Blockly.Extensions.checkHasFunction_(e,b.domToMutation,"domToMutation");Blockly.Extensions.checkHasFunction_(e,b.mutationToDom,"mutationToDom");var f=Blockly.Extensions.checkMutatorDialog_(b,e);if(c&&!goog.isFunction(c))throw Error('Extension "'+a+'" is not a function');Blockly.Extensions.register(a,function(){f&&this.setMutator(new Blockly.Mutator(d));this.mixin(b);c&&c.apply(this)})};
|
||||
Blockly.Extensions.apply=function(a,b,c){var d=Blockly.Extensions.ALL_[a];if(!goog.isFunction(d))throw Error('Error: Extension "'+a+'" not found.');if(c)Blockly.Extensions.checkNoMutatorProperties_(a,b);else var e=Blockly.Extensions.getMutatorProperties_(b);d.apply(b);if(c)Blockly.Extensions.checkBlockHasMutatorProperties_('Error after applying mutator "'+a+'": ',b);else if(!Blockly.Extensions.mutatorPropertiesMatch_(e,b))throw Error('Error when applying extension "'+a+'": mutation properties changed when applying a non-mutator extension.');
|
||||
};Blockly.Extensions.checkHasFunction_=function(a,b,c){if(!b)throw Error(a+'missing required property "'+c+'"');if("function"!=typeof b)throw Error(a+'" required property "'+c+'" must be a function');};Blockly.Extensions.checkNoMutatorProperties_=function(a,b){if(Blockly.Extensions.getMutatorProperties_(b).length)throw Error('Error: tried to apply mutation "'+a+'" to a block that already has mutator functions. Block id: '+b.id);};
|
||||
Blockly.Extensions.checkMutatorDialog_=function(a,b){var c=void 0!==a.compose,d=void 0!==a.decompose;if(c&&d){if("function"!==typeof a.compose)throw Error(b+"compose must be a function.");if("function"!==typeof a.decompose)throw Error(b+"decompose must be a function.");return!0}if(c||d)throw Error(b+'Must have both or neither of "compose" and "decompose"');return!1};
|
||||
Blockly.Extensions.checkBlockHasMutatorProperties_=function(a,b){if("function"!==typeof b.domToMutation)throw Error(a+'Applying a mutator didn\'t add "domToMutation"');if("function"!==typeof b.mutationToDom)throw Error(a+'Applying a mutator didn\'t add "mutationToDom"');Blockly.Extensions.checkMutatorDialog_(b,a)};
|
||||
Blockly.Extensions.getMutatorProperties_=function(a){var b=[];void 0!==a.domToMutation&&b.push(a.domToMutation);void 0!==a.mutationToDom&&b.push(a.mutationToDom);void 0!==a.compose&&b.push(a.compose);void 0!==a.decompose&&b.push(a.decompose);return b};Blockly.Extensions.mutatorPropertiesMatch_=function(a,b){var c=!0,d=Blockly.Extensions.getMutatorProperties_(b);if(d.length!=a.length)c=!1;else for(var e=0;e<d.length;e++)a[e]!=d[e]&&(c=!1);return c};
|
||||
Blockly.Extensions.checkMutatorDialog_=function(a,b){var c=void 0!==a.compose,d=void 0!==a.decompose;if(c&&d){if("function"!=typeof a.compose)throw Error(b+"compose must be a function.");if("function"!=typeof a.decompose)throw Error(b+"decompose must be a function.");return!0}if(c||d)throw Error(b+'Must have both or neither of "compose" and "decompose"');return!1};
|
||||
Blockly.Extensions.checkBlockHasMutatorProperties_=function(a,b){if("function"!=typeof b.domToMutation)throw Error(a+'Applying a mutator didn\'t add "domToMutation"');if("function"!=typeof b.mutationToDom)throw Error(a+'Applying a mutator didn\'t add "mutationToDom"');Blockly.Extensions.checkMutatorDialog_(b,a)};
|
||||
Blockly.Extensions.getMutatorProperties_=function(a){var b=[];void 0!==a.domToMutation&&b.push(a.domToMutation);void 0!==a.mutationToDom&&b.push(a.mutationToDom);void 0!==a.compose&&b.push(a.compose);void 0!==a.decompose&&b.push(a.decompose);return b};Blockly.Extensions.mutatorPropertiesMatch_=function(a,b){var c=Blockly.Extensions.getMutatorProperties_(b);if(c.length!=a.length)return!1;for(var d=0;d<c.length;d++)if(a[d]!=c[d])return!1;return!0};
|
||||
Blockly.Extensions.buildTooltipForDropdown=function(a,b){var c=[];document&&Blockly.utils.runAfterPageLoad(function(){for(var a in b)Blockly.utils.checkMessageReferences(b[a])});return function(){this.type&&-1===c.indexOf(this.type)&&(Blockly.Extensions.checkDropdownOptionsInTable_(this,a,b),c.push(this.type));this.setTooltip(function(){var d=this.getFieldValue(a),e=b[d];null==e?-1===c.indexOf(this.type)&&(d="No tooltip mapping for value "+d+" of field "+a,null!=this.type&&(d+=" of block type "+this.type),
|
||||
console.warn(d+".")):e=Blockly.utils.replaceMessageReferences(e);return e}.bind(this))}};Blockly.Extensions.checkDropdownOptionsInTable_=function(a,b,c){var d=a.getField(b);if(!d.isOptionListDynamic()){d=d.getOptions();for(var e=0;e<d.length;++e){var f=d[e][1];null==c[f]&&console.warn("No tooltip mapping for value "+f+" of field "+b+" of block type "+a.type)}}};
|
||||
Blockly.Extensions.buildTooltipWithFieldValue=function(a,b){document&&Blockly.utils.runAfterPageLoad(function(){Blockly.utils.checkMessageReferences(a)});return function(){this.setTooltip(function(){return Blockly.utils.replaceMessageReferences(a).replace("%1",this.getFieldValue(b))}.bind(this))}};Blockly.Extensions.extensionParentTooltip_=function(){this.tooltipWhenNotConnected_=this.tooltip;this.setTooltip(function(){var a=this.getParent();return a&&a.getInputsInline()&&a.tooltip||this.tooltipWhenNotConnected_}.bind(this))};
|
||||
@@ -998,8 +997,8 @@ Blockly.RenderedConnection.prototype.respawnShadow_=function(){var a=this.getSou
|
||||
Blockly.RenderedConnection.prototype.connect_=function(a){Blockly.RenderedConnection.superClass_.connect_.call(this,a);var b=this.getSourceBlock();a=a.getSourceBlock();b.rendered&&b.updateDisabled();a.rendered&&a.updateDisabled();b.rendered&&a.rendered&&(this.type==Blockly.NEXT_STATEMENT||this.type==Blockly.PREVIOUS_STATEMENT?a.render():b.render())};
|
||||
Blockly.RenderedConnection.prototype.onCheckChanged_=function(){this.isConnected()&&!this.checkType_(this.targetConnection)&&((this.isSuperior()?this.targetBlock():this.sourceBlock_).unplug(),this.sourceBlock_.bumpNeighbours_())};Blockly.DraggedConnectionManager=function(a){this.topBlock_=Blockly.selected=a;this.workspace_=a.workspace;this.availableConnections_=this.initAvailableConnections_();this.localConnection_=this.closestConnection_=null;this.radiusConnection_=0;this.wouldDeleteBlock_=!1};Blockly.DraggedConnectionManager.prototype.dispose=function(){this.workspace_=this.topBlock_=null;this.availableConnections_.length=0;this.localConnection_=this.closestConnection_=null};
|
||||
Blockly.DraggedConnectionManager.prototype.wouldDeleteBlock=function(){return this.wouldDeleteBlock_};Blockly.DraggedConnectionManager.prototype.applyConnections=function(){this.closestConnection_&&(this.localConnection_.connect(this.closestConnection_),this.topBlock_.rendered&&((this.localConnection_.isSuperior()?this.closestConnection_:this.localConnection_).getSourceBlock().connectionUiEffect(),this.topBlock_.getRootBlock().bringToFront()),this.removeHighlighting_())};
|
||||
Blockly.DraggedConnectionManager.prototype.update=function(a,b){var c=this.closestConnection_,d=this.updateClosest_(a);d&&c&&c.unhighlight();c=!!this.closestConnection_&&b!=Blockly.DELETE_AREA_TOOLBOX;this.wouldDeleteBlock_=!!b&&!this.topBlock_.getParent()&&this.topBlock_.isDeletable()&&!c;!this.wouldDeleteBlock_&&d&&this.closestConnection_&&this.addHighlighting_()};Blockly.DraggedConnectionManager.prototype.removeHighlighting_=function(){this.closestConnection_&&this.closestConnection_.unhighlight()};
|
||||
Blockly.DraggedConnectionManager.prototype.addHighlighting_=function(){this.closestConnection_&&this.closestConnection_.highlight()};Blockly.DraggedConnectionManager.prototype.initAvailableConnections_=function(){var a=this.topBlock_.getConnections_(!1),b=this.topBlock_.lastConnectionInStack_();b&&b!=this.topBlock_.nextConnection&&a.push(b);return a};
|
||||
Blockly.DraggedConnectionManager.prototype.update=function(a,b){var c=this.closestConnection_,d=this.updateClosest_(a);d&&c&&c.unhighlight();c=!!this.closestConnection_&&b!=Blockly.DELETE_AREA_TOOLBOX;var e=!!b&&!this.topBlock_.getParent()&&this.topBlock_.isDeletable();this.wouldDeleteBlock_=e&&!c;e&&this.closestConnection_&&(this.closestConnection_.unhighlight(),this.closestConnection_=null);!this.wouldDeleteBlock_&&d&&this.closestConnection_&&this.addHighlighting_()};
|
||||
Blockly.DraggedConnectionManager.prototype.removeHighlighting_=function(){this.closestConnection_&&this.closestConnection_.unhighlight()};Blockly.DraggedConnectionManager.prototype.addHighlighting_=function(){this.closestConnection_&&this.closestConnection_.highlight()};Blockly.DraggedConnectionManager.prototype.initAvailableConnections_=function(){var a=this.topBlock_.getConnections_(!1),b=this.topBlock_.lastConnectionInStack_();b&&b!=this.topBlock_.nextConnection&&a.push(b);return a};
|
||||
Blockly.DraggedConnectionManager.prototype.updateClosest_=function(a){var b=this.closestConnection_;this.localConnection_=this.closestConnection_=null;this.radiusConnection_=Blockly.SNAP_RADIUS;for(var c=0;c<this.availableConnections_.length;c++){var d=this.availableConnections_[c],e=d.closest(this.radiusConnection_,a);e.connection&&(this.closestConnection_=e.connection,this.localConnection_=d,this.radiusConnection_=e.radius)}return b!=this.closestConnection_};Blockly.BlockDragger=function(a,b){this.draggingBlock_=a;this.workspace_=b;this.draggedConnectionManager_=new Blockly.DraggedConnectionManager(this.draggingBlock_);this.deleteArea_=null;this.wouldDeleteBlock_=!1;this.startXY_=this.draggingBlock_.getRelativeToSurfaceXY();this.dragIconData_=Blockly.BlockDragger.initIconData_(a)};
|
||||
Blockly.BlockDragger.prototype.dispose=function(){this.startWorkspace_=this.workspace_=this.draggingBlock_=null;this.dragIconData_.length=0;this.draggedConnectionManager_&&(this.draggedConnectionManager_.dispose(),this.draggedConnectionManager_=null)};Blockly.BlockDragger.initIconData_=function(a){var b=[];a=a.getDescendants();for(var c=0,d;d=a[c];c++){d=d.getIcons();for(var e=0;e<d.length;e++){var f={location:d[e].getIconLocation(),icon:d[e]};b.push(f)}}return b};
|
||||
Blockly.BlockDragger.prototype.startBlockDrag=function(a){Blockly.Events.getGroup()||Blockly.Events.setGroup(!0);this.workspace_.setResizesEnabled(!1);Blockly.BlockSvg.disconnectUiStop_();this.draggingBlock_.getParent()&&(this.draggingBlock_.unplug(),a=this.pixelsToWorkspaceUnits_(a),a=goog.math.Coordinate.sum(this.startXY_,a),this.draggingBlock_.translate(a.x,a.y),this.draggingBlock_.disconnectUiEffect());this.draggingBlock_.setDragging(!0);this.draggingBlock_.moveToDragSurface_();this.workspace_.toolbox_&&
|
||||
@@ -1016,7 +1015,7 @@ Blockly.Tooltip.createDom=function(){Blockly.Tooltip.DIV||(Blockly.Tooltip.DIV=g
|
||||
Blockly.Tooltip.onMouseOver_=function(a){if(!Blockly.Tooltip.blocked_){for(a=a.target;!goog.isString(a.tooltip)&&!goog.isFunction(a.tooltip);)a=a.tooltip;Blockly.Tooltip.element_!=a&&(Blockly.Tooltip.hide(),Blockly.Tooltip.poisonedElement_=null,Blockly.Tooltip.element_=a);clearTimeout(Blockly.Tooltip.mouseOutPid_)}};
|
||||
Blockly.Tooltip.onMouseOut_=function(a){Blockly.Tooltip.blocked_||(Blockly.Tooltip.mouseOutPid_=setTimeout(function(){Blockly.Tooltip.element_=null;Blockly.Tooltip.poisonedElement_=null;Blockly.Tooltip.hide()},1),clearTimeout(Blockly.Tooltip.showPid_))};
|
||||
Blockly.Tooltip.onMouseMove_=function(a){if(Blockly.Tooltip.element_&&Blockly.Tooltip.element_.tooltip&&!Blockly.WidgetDiv.isVisible()&&!Blockly.Tooltip.blocked_)if(Blockly.Tooltip.visible){var b=Blockly.Tooltip.lastX_-a.pageX;a=Blockly.Tooltip.lastY_-a.pageY;Math.sqrt(b*b+a*a)>Blockly.Tooltip.RADIUS_OK&&Blockly.Tooltip.hide()}else Blockly.Tooltip.poisonedElement_!=Blockly.Tooltip.element_&&(clearTimeout(Blockly.Tooltip.showPid_),Blockly.Tooltip.lastX_=a.pageX,Blockly.Tooltip.lastY_=a.pageY,Blockly.Tooltip.showPid_=
|
||||
setTimeout(Blockly.Tooltip.show_,Blockly.Tooltip.HOVER_MS))};Blockly.Tooltip.hide=function(){Blockly.Tooltip.visible&&(Blockly.Tooltip.visible=!1,Blockly.Tooltip.DIV&&(Blockly.Tooltip.DIV.style.display="none"));clearTimeout(Blockly.Tooltip.showPid_)};Blockly.Tooltip.block=function(){Blockly.Tooltip.hide();Blockly.Tooltip.blocked_=!0};Blockly.Tooltip.unblock=function(){Blockly.Tooltip.blocked_=!1};
|
||||
setTimeout(Blockly.Tooltip.show_,Blockly.Tooltip.HOVER_MS))};Blockly.Tooltip.hide=function(){Blockly.Tooltip.visible&&(Blockly.Tooltip.visible=!1,Blockly.Tooltip.DIV&&(Blockly.Tooltip.DIV.style.display="none"));Blockly.Tooltip.showPid_&&clearTimeout(Blockly.Tooltip.showPid_)};Blockly.Tooltip.block=function(){Blockly.Tooltip.hide();Blockly.Tooltip.blocked_=!0};Blockly.Tooltip.unblock=function(){Blockly.Tooltip.blocked_=!1};
|
||||
Blockly.Tooltip.show_=function(){if(!Blockly.Tooltip.blocked_&&(Blockly.Tooltip.poisonedElement_=Blockly.Tooltip.element_,Blockly.Tooltip.DIV)){goog.dom.removeChildren(Blockly.Tooltip.DIV);for(var a=Blockly.Tooltip.element_.tooltip;goog.isFunction(a);)a=a();a=Blockly.utils.wrap(a,Blockly.Tooltip.LIMIT);a=a.split("\n");for(var b=0;b<a.length;b++){var c=document.createElement("div");c.appendChild(document.createTextNode(a[b]));Blockly.Tooltip.DIV.appendChild(c)}a=Blockly.Tooltip.element_.RTL;b=goog.dom.getViewportSize();
|
||||
Blockly.Tooltip.DIV.style.direction=a?"rtl":"ltr";Blockly.Tooltip.DIV.style.display="block";Blockly.Tooltip.visible=!0;c=Blockly.Tooltip.lastX_;c=a?c-(Blockly.Tooltip.OFFSET_X+Blockly.Tooltip.DIV.offsetWidth):c+Blockly.Tooltip.OFFSET_X;var d=Blockly.Tooltip.lastY_+Blockly.Tooltip.OFFSET_Y;d+Blockly.Tooltip.DIV.offsetHeight>b.height+window.scrollY&&(d-=Blockly.Tooltip.DIV.offsetHeight+2*Blockly.Tooltip.OFFSET_Y);a?c=Math.max(Blockly.Tooltip.MARGINS-window.scrollX,c):c+Blockly.Tooltip.DIV.offsetWidth>
|
||||
b.width+window.scrollX-2*Blockly.Tooltip.MARGINS&&(c=b.width-Blockly.Tooltip.DIV.offsetWidth-2*Blockly.Tooltip.MARGINS);Blockly.Tooltip.DIV.style.top=d+"px";Blockly.Tooltip.DIV.style.left=c+"px"}};Blockly.Gesture=function(a,b){this.mouseDownXY_=null;this.currentDragDeltaXY_=0;this.startWorkspace_=this.targetBlock_=this.startBlock_=this.startField_=null;this.creatorWorkspace_=b;this.isDraggingBlock_=this.isDraggingWorkspace_=this.hasExceededDragRadius_=!1;this.mostRecentEvent_=a;this.flyout_=this.workspaceDragger_=this.blockDragger_=this.onUpWrapper_=this.onMoveWrapper_=null;this.isEnding_=this.hasStarted_=this.calledUpdateIsDragging_=!1};
|
||||
@@ -1041,7 +1040,7 @@ Blockly.Gesture.prototype.bringBlockToFront_=function(){this.targetBlock_&&!this
|
||||
Blockly.Gesture.prototype.setTargetBlock_=function(a){a.isShadow()?this.setTargetBlock_(a.getParent()):this.targetBlock_=a};Blockly.Gesture.prototype.setStartWorkspace_=function(a){this.startWorkspace_||(this.startWorkspace_=a)};Blockly.Gesture.prototype.setStartFlyout_=function(a){this.flyout_||(this.flyout_=a)};Blockly.Gesture.prototype.isBlockClick_=function(){return!!this.startBlock_&&!this.hasExceededDragRadius_&&!this.isFieldClick_()};
|
||||
Blockly.Gesture.prototype.isFieldClick_=function(){return(this.startField_?this.startField_.isCurrentlyEditable():!1)&&!this.hasExceededDragRadius_&&(!this.flyout_||!this.flyout_.autoClose)};Blockly.Gesture.prototype.isWorkspaceClick_=function(){return!this.startBlock_&&!this.startField_&&!this.hasExceededDragRadius_};Blockly.Gesture.prototype.isDragging=function(){return this.isDraggingWorkspace_||this.isDraggingBlock_};Blockly.Gesture.prototype.hasStarted=function(){return this.hasStarted_};Blockly.Field=function(a,b){this.size_=new goog.math.Size(0,Blockly.BlockSvg.MIN_BLOCK_Y);this.setValue(a);this.setValidator(b)};Blockly.Field.cacheWidths_=null;Blockly.Field.cacheReference_=0;Blockly.Field.prototype.name=void 0;Blockly.Field.prototype.maxDisplayLength=50;Blockly.Field.prototype.text_="";Blockly.Field.prototype.sourceBlock_=null;Blockly.Field.prototype.visible_=!0;Blockly.Field.prototype.validator_=null;Blockly.Field.NBSP="\u00a0";Blockly.Field.prototype.EDITABLE=!0;
|
||||
Blockly.Field.prototype.setSourceBlock=function(a){goog.asserts.assert(!this.sourceBlock_,"Field already bound to a block.");this.sourceBlock_=a};
|
||||
Blockly.Field.prototype.init=function(){this.fieldGroup_||(this.fieldGroup_=Blockly.utils.createSvgElement("g",{},null),this.visible_||(this.fieldGroup_.style.display="none"),this.borderRect_=Blockly.utils.createSvgElement("rect",{rx:4,ry:4,x:-Blockly.BlockSvg.SEP_SPACE_X/2,y:0,height:16},this.fieldGroup_,this.sourceBlock_.workspace),this.textElement_=Blockly.utils.createSvgElement("text",{"class":"blocklyText",y:this.size_.height-12.5},this.fieldGroup_),this.updateEditable(),this.sourceBlock_.getSvgRoot().appendChild(this.fieldGroup_),
|
||||
Blockly.Field.prototype.init=function(){this.fieldGroup_||(this.fieldGroup_=Blockly.utils.createSvgElement("g",{},null),this.visible_||(this.fieldGroup_.style.display="none"),this.borderRect_=Blockly.utils.createSvgElement("rect",{rx:4,ry:4,x:-Blockly.BlockSvg.SEP_SPACE_X/2,y:0,height:16},this.fieldGroup_),this.textElement_=Blockly.utils.createSvgElement("text",{"class":"blocklyText",y:this.size_.height-12.5},this.fieldGroup_),this.updateEditable(),this.sourceBlock_.getSvgRoot().appendChild(this.fieldGroup_),
|
||||
this.mouseDownWrapper_=Blockly.bindEventWithChecks_(this.fieldGroup_,"mousedown",this,this.onMouseDown_),this.render_())};Blockly.Field.prototype.initModel=function(){};Blockly.Field.prototype.dispose=function(){this.mouseDownWrapper_&&(Blockly.unbindEvent_(this.mouseDownWrapper_),this.mouseDownWrapper_=null);this.sourceBlock_=null;goog.dom.removeNode(this.fieldGroup_);this.validator_=this.borderRect_=this.textElement_=this.fieldGroup_=null};
|
||||
Blockly.Field.prototype.updateEditable=function(){var a=this.fieldGroup_;this.EDITABLE&&a&&(this.sourceBlock_.isEditable()?(Blockly.utils.addClass(a,"blocklyEditableText"),Blockly.utils.removeClass(a,"blocklyNonEditableText"),this.fieldGroup_.style.cursor=this.CURSOR):(Blockly.utils.addClass(a,"blocklyNonEditableText"),Blockly.utils.removeClass(a,"blocklyEditableText"),this.fieldGroup_.style.cursor=""))};
|
||||
Blockly.Field.prototype.isCurrentlyEditable=function(){return this.EDITABLE&&!!this.sourceBlock_&&this.sourceBlock_.isEditable()};Blockly.Field.prototype.isVisible=function(){return this.visible_};Blockly.Field.prototype.setVisible=function(a){if(this.visible_!=a){this.visible_=a;var b=this.getSvgRoot();b&&(b.style.display=a?"block":"none",this.render_())}};Blockly.Field.prototype.setValidator=function(a){this.validator_=a};Blockly.Field.prototype.getValidator=function(){return this.validator_};
|
||||
@@ -1054,7 +1053,7 @@ Blockly.Field.prototype.forceRerender=function(){this.size_.width=0;this.sourceB
|
||||
Blockly.Field.prototype.onMouseDown_=function(a){this.sourceBlock_&&this.sourceBlock_.workspace&&(a=this.sourceBlock_.workspace.getGesture(a))&&a.setStartField(this)};Blockly.Field.prototype.setTooltip=function(a){};Blockly.Field.prototype.getAbsoluteXY_=function(){return goog.style.getPageOffset(this.borderRect_)};Blockly.FieldLabel=function(a,b){this.size_=new goog.math.Size(0,17.5);this.class_=b;this.setValue(a)};goog.inherits(Blockly.FieldLabel,Blockly.Field);Blockly.FieldLabel.prototype.EDITABLE=!1;
|
||||
Blockly.FieldLabel.prototype.init=function(){this.textElement_||(this.textElement_=Blockly.utils.createSvgElement("text",{"class":"blocklyText",y:this.size_.height-5},null),this.class_&&Blockly.utils.addClass(this.textElement_,this.class_),this.visible_||(this.textElement_.style.display="none"),this.sourceBlock_.getSvgRoot().appendChild(this.textElement_),this.textElement_.tooltip=this.sourceBlock_,Blockly.Tooltip.bindMouseEvents(this.textElement_),this.render_())};
|
||||
Blockly.FieldLabel.prototype.dispose=function(){goog.dom.removeNode(this.textElement_);this.textElement_=null};Blockly.FieldLabel.prototype.getSvgRoot=function(){return this.textElement_};Blockly.FieldLabel.prototype.setTooltip=function(a){this.textElement_.tooltip=a};Blockly.Input=function(a,b,c,d){if(a!=Blockly.DUMMY_INPUT&&!b)throw"Value inputs and statement inputs must have non-empty name.";this.type=a;this.name=b;this.sourceBlock_=c;this.connection=d;this.fieldRow=[]};Blockly.Input.prototype.align=Blockly.ALIGN_LEFT;Blockly.Input.prototype.visible_=!0;Blockly.Input.prototype.appendField=function(a,b){this.insertFieldAt(this.fieldRow.length,a,b);return this};
|
||||
Blockly.Input.prototype.insertFieldAt=function(a,b,c){if(0>a||a>this.fieldRow.length)throw Error("index "+a+" out of bounds.");if(!b&&!c)return this;goog.isString(b)&&(b=new Blockly.FieldLabel(b));b.setSourceBlock(this.sourceBlock_);this.sourceBlock_.rendered&&b.init();b.name=c;b.prefixField&&(a=this.insertFieldAt(a,b.prefixField));this.fieldRow.splice(a,0,b);++a;b.suffixField&&(a=this.insertFieldAt(a,b.suffixField));this.sourceBlock_.rendered&&(this.sourceBlock_.render(),this.sourceBlock_.bumpNeighbours_());
|
||||
Blockly.Input.prototype.insertFieldAt=function(a,b,c){if(0>a||a>this.fieldRow.length)throw Error("index "+a+" out of bounds.");if(!b&&!c)return a;goog.isString(b)&&(b=new Blockly.FieldLabel(b));b.setSourceBlock(this.sourceBlock_);this.sourceBlock_.rendered&&b.init();b.name=c;b.prefixField&&(a=this.insertFieldAt(a,b.prefixField));this.fieldRow.splice(a,0,b);++a;b.suffixField&&(a=this.insertFieldAt(a,b.suffixField));this.sourceBlock_.rendered&&(this.sourceBlock_.render(),this.sourceBlock_.bumpNeighbours_());
|
||||
return a};Blockly.Input.prototype.removeField=function(a){for(var b=0,c;c=this.fieldRow[b];b++)if(c.name===a){c.dispose();this.fieldRow.splice(b,1);this.sourceBlock_.rendered&&(this.sourceBlock_.render(),this.sourceBlock_.bumpNeighbours_());return}goog.asserts.fail('Field "%s" not found.',a)};Blockly.Input.prototype.isVisible=function(){return this.visible_};
|
||||
Blockly.Input.prototype.setVisible=function(a){var b=[];if(this.visible_==a)return b;for(var c=(this.visible_=a)?"block":"none",d=0,e;e=this.fieldRow[d];d++)e.setVisible(a);this.connection&&(a?b=this.connection.unhideAll():this.connection.hideAll(),d=this.connection.targetBlock())&&(d.getSvgRoot().style.display=c,a||(d.rendered=!1));return b};Blockly.Input.prototype.setCheck=function(a){if(!this.connection)throw"This input does not have a connection.";this.connection.setCheck(a);return this};
|
||||
Blockly.Input.prototype.setAlign=function(a){this.align=a;this.sourceBlock_.rendered&&this.sourceBlock_.render();return this};Blockly.Input.prototype.init=function(){if(this.sourceBlock_.workspace.rendered)for(var a=0;a<this.fieldRow.length;a++)this.fieldRow[a].init()};Blockly.Input.prototype.dispose=function(){for(var a=0,b;b=this.fieldRow[a];a++)b.dispose();this.connection&&this.connection.dispose();this.sourceBlock_=null};Blockly.ConnectionDB=function(){};Blockly.ConnectionDB.prototype=[];Blockly.ConnectionDB.constructor=Blockly.ConnectionDB;Blockly.ConnectionDB.prototype.addConnection=function(a){if(a.inDB_)throw"Connection already in database.";if(!a.getSourceBlock().isInFlyout){var b=this.findPositionForConnection_(a);this.splice(b,0,a);a.inDB_=!0}};
|
||||
@@ -1066,14 +1065,15 @@ Blockly.ConnectionDB.init=function(a){var b=[];b[Blockly.INPUT_VALUE]=new Blockl
|
||||
Blockly.utils.removeClass=function(a,b){var c=a.getAttribute("class");if(-1==(" "+c+" ").indexOf(" "+b+" "))return!1;c=c.split(/\s+/);for(var d=0;d<c.length;d++)c[d]&&c[d]!=b||(c.splice(d,1),d--);c.length?a.setAttribute("class",c.join(" ")):Blockly.utils.removeAttribute(a,"class");return!0};Blockly.utils.hasClass=function(a,b){return-1!=(" "+a.getAttribute("class")+" ").indexOf(" "+b+" ")};Blockly.utils.noEvent=function(a){a.preventDefault();a.stopPropagation()};
|
||||
Blockly.utils.isTargetInput=function(a){return"textarea"==a.target.type||"text"==a.target.type||"number"==a.target.type||"email"==a.target.type||"password"==a.target.type||"search"==a.target.type||"tel"==a.target.type||"url"==a.target.type||a.target.isContentEditable};
|
||||
Blockly.utils.getRelativeXY=function(a){var b=new goog.math.Coordinate(0,0),c=a.getAttribute("x");c&&(b.x=parseInt(c,10));if(c=a.getAttribute("y"))b.y=parseInt(c,10);if(c=(c=a.getAttribute("transform"))&&c.match(Blockly.utils.getRelativeXY.XY_REGEX_))b.x+=parseFloat(c[1]),c[3]&&(b.y+=parseFloat(c[3]));(a=a.getAttribute("style"))&&-1<a.indexOf("translate")&&((c=a.match(Blockly.utils.getRelativeXY.XY_2D_REGEX_))||(c=a.match(Blockly.utils.getRelativeXY.XY_3D_REGEX_)),c&&(b.x+=parseFloat(c[1]),c[3]&&
|
||||
(b.y+=parseFloat(c[3]))));return b};Blockly.utils.getInjectionDivXY_=function(a){for(var b=0,c=0,d;a;){var e=Blockly.utils.getRelativeXY(a);d=Blockly.utils.getScale_(a);b=b*d+e.x;c=c*d+e.y;if(-1!=(" "+(a.getAttribute("class")||"")+" ").indexOf(" injectionDiv "))break;a=a.parentNode}return new goog.math.Coordinate(b,c)};Blockly.utils.getScale_=function(a){var b=1;(a=a.getAttribute("transform"))&&(a=a.match(Blockly.utils.getScale_.REGEXP_))&&a[0]&&(b=parseFloat(a[0]));return b};
|
||||
(b.y+=parseFloat(c[3]))));return b};Blockly.utils.getInjectionDivXY_=function(a){for(var b=0,c=0;a;){var d=Blockly.utils.getRelativeXY(a),e=Blockly.utils.getScale_(a);b=b*e+d.x;c=c*e+d.y;if(-1!=(" "+(a.getAttribute("class")||"")+" ").indexOf(" injectionDiv "))break;a=a.parentNode}return new goog.math.Coordinate(b,c)};Blockly.utils.getScale_=function(a){var b=1;(a=a.getAttribute("transform"))&&(a=a.match(Blockly.utils.getScale_.REGEXP_))&&a[0]&&(b=parseFloat(a[0]));return b};
|
||||
Blockly.utils.getRelativeXY.XY_REGEX_=/translate\(\s*([-+\d.e]+)([ ,]\s*([-+\d.e]+)\s*\))?/;Blockly.utils.getScale_REGEXP_=/scale\(\s*([-+\d.e]+)\s*\)/;Blockly.utils.getRelativeXY.XY_3D_REGEX_=/transform:\s*translate3d\(\s*([-+\d.e]+)px([ ,]\s*([-+\d.e]+)\s*)px([ ,]\s*([-+\d.e]+)\s*)px\)?/;Blockly.utils.getRelativeXY.XY_2D_REGEX_=/transform:\s*translate\(\s*([-+\d.e]+)px([ ,]\s*([-+\d.e]+)\s*)px\)?/;
|
||||
Blockly.utils.createSvgElement=function(a,b,c){a=document.createElementNS(Blockly.SVG_NS,a);for(var d in b)a.setAttribute(d,b[d]);document.body.runtimeStyle&&(a.runtimeStyle=a.currentStyle=a.style);c&&c.appendChild(a);return a};Blockly.utils.isRightButton=function(a){return a.ctrlKey&&goog.userAgent.MAC?!0:2==a.button};Blockly.utils.mouseToSvg=function(a,b,c){var d=b.createSVGPoint();d.x=a.clientX;d.y=a.clientY;c||(c=b.getScreenCTM().inverse());return d.matrixTransform(c)};
|
||||
Blockly.utils.shortestStringLength=function(a){return a.length?a.reduce(function(a,c){return a.length<c.length?a:c}).length:0};Blockly.utils.commonWordPrefix=function(a,b){if(!a.length)return 0;if(1==a.length)return a[0].length;for(var c=0,d=b||Blockly.utils.shortestStringLength(a),e=0;e<d;e++){for(var f=a[0][e],g=1;g<a.length;g++)if(f!=a[g][e])return c;" "==f&&(c=e+1)}for(g=1;g<a.length;g++)if((f=a[g][e])&&" "!=f)return c;return d};
|
||||
Blockly.utils.commonWordSuffix=function(a,b){if(!a.length)return 0;if(1==a.length)return a[0].length;for(var c=0,d=b||Blockly.utils.shortestStringLength(a),e=0;e<d;e++){for(var f=a[0].substr(-e-1,1),g=1;g<a.length;g++)if(f!=a[g].substr(-e-1,1))return c;" "==f&&(c=e+1)}for(g=1;g<a.length;g++)if((f=a[g].charAt(a[g].length-e-1))&&" "!=f)return c;return d};Blockly.utils.tokenizeInterpolation=function(a){return Blockly.utils.tokenizeInterpolation_(a,!0)};
|
||||
Blockly.utils.replaceMessageReferences=function(a){if(!goog.isString(a))return a;a=Blockly.utils.tokenizeInterpolation_(a,!1);return a.length?a[0]:""};Blockly.utils.checkMessageReferences=function(a){for(var b=!0,c=/%{BKY_([a-zA-Z][a-zA-Z0-9_]*)}/g,d=c.exec(a);null!=d;){var e=d[1];null==Blockly.utils.getMessageArray_()[e]&&(console.log("WARNING: No message string for %{BKY_"+e+"}."),b=!1);a=a.substring(d.index+e.length+1);d=c.exec(a)}return b};
|
||||
Blockly.utils.replaceMessageReferences=function(a){if(!goog.isString(a))return a;a=Blockly.utils.tokenizeInterpolation_(a,!1);return a.length?a[0]:""};
|
||||
Blockly.utils.checkMessageReferences=function(a){for(var b=!0,c=Blockly.utils.getMessageArray_(),d=/%{(BKY_[A-Z][A-Z0-9_]*)}/gi,e=d.exec(a);e;){var f=e[1];f=f.toUpperCase();"BKY_"!=f.substr(0,4)?(console.log("WARNING: Unsupported message table prefix in %{"+e[1]+"}."),b=!1):void 0==c[f.substr(4)]&&(console.log("WARNING: No message string for %{"+e[1]+"}."),b=!1);a=a.substring(e.index+f.length+1);e=d.exec(a)}return b};
|
||||
Blockly.utils.tokenizeInterpolation_=function(a,b){var c=[],d=a.split("");d.push("");for(var e=0,f=[],g=null,h=0;h<d.length;h++){var k=d[h];0==e?"%"==k?((k=f.join(""))&&c.push(k),f.length=0,e=1):f.push(k):1==e?"%"==k?(f.push(k),e=0):b&&"0"<=k&&"9">=k?(e=2,g=k,(k=f.join(""))&&c.push(k),f.length=0):"{"==k?e=3:(f.push("%",k),e=0):2==e?"0"<=k&&"9">=k?g+=k:(c.push(parseInt(g,10)),h--,e=0):3==e&&(""==k?(f.splice(0,0,"%{"),h--,e=0):"}"!=k?f.push(k):(e=f.join(""),/[a-zA-Z][a-zA-Z0-9_]*/.test(e)?(k=e.toUpperCase(),
|
||||
(k=goog.string.startsWith(k,"BKY_")?k.substring(4):null)&&k in Blockly.utils.getMessageArray_()?(e=Blockly.utils.getMessageArray_()[k],goog.isString(e)?Array.prototype.push.apply(c,Blockly.utils.tokenizeInterpolation(e)):b?c.push(String(e)):c.push(e)):c.push("%{"+e+"}")):c.push("%{"+e+"}"),e=f.length=0))}(k=f.join(""))&&c.push(k);d=[];for(h=f.length=0;h<c.length;++h)"string"==typeof c[h]?f.push(c[h]):((k=f.join(""))&&d.push(k),f.length=0,d.push(c[h]));(k=f.join(""))&&d.push(k);f.length=0;return d};
|
||||
(k=goog.string.startsWith(k,"BKY_")?k.substring(4):null)&&k in Blockly.utils.getMessageArray_()?(e=Blockly.utils.getMessageArray_()[k],goog.isString(e)?Array.prototype.push.apply(c,Blockly.utils.tokenizeInterpolation_(e,b)):b?c.push(String(e)):c.push(e)):c.push("%{"+e+"}")):c.push("%{"+e+"}"),e=f.length=0))}(k=f.join(""))&&c.push(k);d=[];for(h=f.length=0;h<c.length;++h)"string"==typeof c[h]?f.push(c[h]):((k=f.join(""))&&d.push(k),f.length=0,d.push(c[h]));(k=f.join(""))&&d.push(k);f.length=0;return d};
|
||||
Blockly.utils.genUid=function(){for(var a=Blockly.utils.genUid.soup_.length,b=[],c=0;20>c;c++)b[c]=Blockly.utils.genUid.soup_.charAt(Math.random()*a);return b.join("")};Blockly.utils.genUid.soup_="!#$%()*+,-./:;=?@[]^_`{|}~ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";Blockly.utils.wrap=function(a,b){for(var c=a.split("\n"),d=0;d<c.length;d++)c[d]=Blockly.utils.wrapLine_(c[d],b);return c.join("\n")};
|
||||
Blockly.utils.wrapLine_=function(a,b){if(a.length<=b)return a;for(var c=a.trim().split(/\s+/),d=0;d<c.length;d++)c[d].length>b&&(b=c[d].length);d=-Infinity;var e=1;do{var f=d;var g=a;var h=[],k=c.length/e,n=1;for(d=0;d<c.length-1;d++)n<(d+1.5)/k?(n++,h[d]=!0):h[d]=!1;h=Blockly.utils.wrapMutate_(c,h,b);d=Blockly.utils.wrapScore_(c,h,b);a=Blockly.utils.wrapToText_(c,h);e++}while(d>f);return g};
|
||||
Blockly.utils.wrapScore_=function(a,b,c){for(var d=[0],e=[],f=0;f<a.length;f++)d[d.length-1]+=a[f].length,!0===b[f]?(d.push(0),e.push(a[f].charAt(a[f].length-1))):!1===b[f]&&d[d.length-1]++;a=Math.max.apply(Math,d);for(f=b=0;f<d.length;f++)b-=2*Math.pow(Math.abs(c-d[f]),1.5),b-=Math.pow(a-d[f],1.5),-1!=".?!".indexOf(e[f])?b+=c/3:-1!=",;)]}".indexOf(e[f])&&(b+=c/4);1<d.length&&d[d.length-1]<=d[d.length-2]&&(b+=.5);return b};
|
||||
@@ -1133,7 +1133,7 @@ Blockly.WorkspaceDragSurfaceSvg.prototype.clearAndHide=function(a){var b=this.SV
|
||||
Blockly.WorkspaceDragSurfaceSvg.prototype.setContentsAndShow=function(a,b,c,d,e,f){goog.asserts.assert(0==this.SVG_.childNodes.length,"Already dragging a block.");this.previousSibling_=c;a.setAttribute("transform","translate(0, 0) scale("+f+")");b.setAttribute("transform","translate(0, 0) scale("+f+")");this.SVG_.setAttribute("width",d);this.SVG_.setAttribute("height",e);this.SVG_.appendChild(a);this.SVG_.appendChild(b);this.SVG_.style.display="block"};Blockly.Xml={};Blockly.Xml.workspaceToDom=function(a,b){var c=goog.dom.createDom("xml");c.appendChild(Blockly.Xml.variablesToDom(a.getAllVariables()));for(var d=a.getTopBlocks(!0),e=0,f;f=d[e];e++)c.appendChild(Blockly.Xml.blockToDomWithXY(f,b));return c};Blockly.Xml.variablesToDom=function(a){for(var b=goog.dom.createDom("variables"),c=0,d;d=a[c];c++){var e=goog.dom.createDom("variable",null,d.name);e.setAttribute("type",d.type);e.setAttribute("id",d.getId());b.appendChild(e)}return b};
|
||||
Blockly.Xml.blockToDomWithXY=function(a,b){var c;a.workspace.RTL&&(c=a.workspace.getWidth());var d=Blockly.Xml.blockToDom(a,b),e=a.getRelativeToSurfaceXY();d.setAttribute("x",Math.round(a.workspace.RTL?c-e.x:e.x));d.setAttribute("y",Math.round(e.y));return d};
|
||||
Blockly.Xml.blockToDom=function(a,b){var c=goog.dom.createDom(a.isShadow()?"shadow":"block");c.setAttribute("type",a.type);b||c.setAttribute("id",a.id);if(a.mutationToDom){var d=a.mutationToDom();d&&(d.hasChildNodes()||d.hasAttributes())&&c.appendChild(d)}d=0;for(var e;e=a.inputList[d];d++)for(var f=0,g;g=e.fieldRow[f];f++){var h=g;h.name&&h.EDITABLE&&(g=goog.dom.createDom("field",null,h.getValue()),g.setAttribute("name",h.name),h instanceof Blockly.FieldVariable&&(h=a.workspace.getVariable(h.getValue()))&&
|
||||
(g.setAttribute("id",h.getId()),g.setAttribute("variableType",h.type)),c.appendChild(g))}if(d=a.getCommentText())d=goog.dom.createDom("comment",null,d),"object"==typeof a.comment&&(d.setAttribute("pinned",a.comment.isVisible()),e=a.comment.getBubbleSize(),d.setAttribute("h",e.height),d.setAttribute("w",e.width)),c.appendChild(d);a.data&&(d=goog.dom.createDom("data",null,a.data),c.appendChild(d));for(d=0;e=a.inputList[d];d++){var k;g=!0;e.type!=Blockly.DUMMY_INPUT&&(h=e.connection.targetBlock(),e.type==
|
||||
(g.setAttribute("id",h.getId()),g.setAttribute("variabletype",h.type)),c.appendChild(g))}if(d=a.getCommentText())d=goog.dom.createDom("comment",null,d),"object"==typeof a.comment&&(d.setAttribute("pinned",a.comment.isVisible()),e=a.comment.getBubbleSize(),d.setAttribute("h",e.height),d.setAttribute("w",e.width)),c.appendChild(d);a.data&&(d=goog.dom.createDom("data",null,a.data),c.appendChild(d));for(d=0;e=a.inputList[d];d++){var k;g=!0;e.type!=Blockly.DUMMY_INPUT&&(h=e.connection.targetBlock(),e.type==
|
||||
Blockly.INPUT_VALUE?k=goog.dom.createDom("value"):e.type==Blockly.NEXT_STATEMENT&&(k=goog.dom.createDom("statement")),f=e.connection.getShadowDom(),!f||h&&h.isShadow()||k.appendChild(Blockly.Xml.cloneShadow_(f)),h&&(k.appendChild(Blockly.Xml.blockToDom(h,b)),g=!1),k.setAttribute("name",e.name),g||c.appendChild(k))}a.inputsInlineDefault!=a.inputsInline&&c.setAttribute("inline",a.inputsInline);a.isCollapsed()&&c.setAttribute("collapsed",!0);a.disabled&&c.setAttribute("disabled",!0);a.isDeletable()||
|
||||
a.isShadow()||c.setAttribute("deletable",!1);a.isMovable()||a.isShadow()||c.setAttribute("movable",!1);a.isEditable()||c.setAttribute("editable",!1);if(d=a.getNextBlock())k=goog.dom.createDom("next",null,Blockly.Xml.blockToDom(d,b)),c.appendChild(k);f=a.nextConnection&&a.nextConnection.getShadowDom();!f||d&&d.isShadow()||k.appendChild(Blockly.Xml.cloneShadow_(f));return c};
|
||||
Blockly.Xml.cloneShadow_=function(a){for(var b=a=a.cloneNode(!0),c;b;)if(b.firstChild)b=b.firstChild;else{for(;b&&!b.nextSibling;)c=b,b=b.parentNode,3==c.nodeType&&""==c.data.trim()&&b.firstChild!=c&&goog.dom.removeNode(c);b&&(c=b,b=b.nextSibling,3==c.nodeType&&""==c.data.trim()&&goog.dom.removeNode(c))}return a};Blockly.Xml.domToText=function(a){return(new XMLSerializer).serializeToString(a)};
|
||||
@@ -1145,10 +1145,10 @@ Blockly.Field.stopCache()}b.updateVariableStore(!1);b.setResizesEnabled&&b.setRe
|
||||
Blockly.Xml.appendDomToWorkspace=function(a,b){if(b.hasOwnProperty("scale")){var c=Blockly.BlockSvg.TAB_WIDTH;try{Blockly.BlockSvg.TAB_WIDTH=0;var d=b.getBlocksBoundingBox()}finally{Blockly.BlockSvg.TAB_WIDTH=c}}c=Blockly.Xml.domToWorkspace(a,b);if(d&&d.height){var e=d.y+d.height;var f=d.x;var g=Infinity,h=Infinity;for(d=0;d<c.length;d++){var k=b.getBlockById(c[d]).getRelativeToSurfaceXY();k.y<h&&(h=k.y);k.x<g&&(g=k.x)}e=e-h+Blockly.BlockSvg.SEP_SPACE_Y;f-=g;var n;b.RTL&&(n=b.getWidth());for(d=0;d<
|
||||
c.length;d++)b.getBlockById(c[d]).moveBy(b.RTL?n-f:f,e)}return c};
|
||||
Blockly.Xml.domToBlock=function(a,b){if(a instanceof Blockly.Workspace){var c=a;a=b;b=c;console.warn("Deprecated call to Blockly.Xml.domToBlock, swap the arguments.")}Blockly.Events.disable();try{var d=Blockly.Xml.domToBlockHeadless_(a,b);if(b.rendered){d.setConnectionsHidden(!0);for(var e=d.getDescendants(),f=e.length-1;0<=f;f--)e[f].initSvg();for(f=e.length-1;0<=f;f--)e[f].render(!1);setTimeout(function(){d.workspace&&d.setConnectionsHidden(!1)},1);d.updateDisabled();b.resizeContents()}}finally{Blockly.Events.enable()}Blockly.Events.isEnabled()&&
|
||||
Blockly.Events.fire(new Blockly.Events.BlockCreate(d));return d};Blockly.Xml.domToVariables=function(a,b){for(var c=0,d;d=a.children[c];c++){var e=d.getAttribute("type"),f=d.getAttribute("id");d=d.textContent;if(null===e)throw Error("Variable with id, "+f+" is without a type");b.createVariable(d,e,f)}};
|
||||
Blockly.Events.fire(new Blockly.Events.BlockCreate(d));return d};Blockly.Xml.domToVariables=function(a,b){for(var c=0,d;d=a.children[c];c++){var e=d.getAttribute("type"),f=d.getAttribute("id");d=d.textContent;if(null==e)throw Error("Variable with id, "+f+" is without a type");b.createVariable(d,e,f)}};
|
||||
Blockly.Xml.domToBlockHeadless_=function(a,b){var c=null,d=a.getAttribute("type");goog.asserts.assert(d,"Block type unspecified: %s",a.outerHTML);var e=a.getAttribute("id");c=b.newBlock(d,e);for(var f=null,g=0,h;h=a.childNodes[g];g++)if(3!=h.nodeType){var k=null,n=null;f=0;for(var p;p=h.childNodes[f];f++)1==p.nodeType&&("block"==p.nodeName.toLowerCase()?k=p:"shadow"==p.nodeName.toLowerCase()&&(n=p));!k&&n&&(k=n);f=h.getAttribute("name");switch(h.nodeName.toLowerCase()){case "mutation":c.domToMutation&&
|
||||
(c.domToMutation(h),c.initSvg&&c.initSvg());break;case "comment":c.setCommentText(h.textContent);var l=h.getAttribute("pinned");l&&!c.isInFlyout&&setTimeout(function(){c.comment&&c.comment.setVisible&&c.comment.setVisible("true"==l)},1);f=parseInt(h.getAttribute("w"),10);h=parseInt(h.getAttribute("h"),10);!isNaN(f)&&!isNaN(h)&&c.comment&&c.comment.setVisible&&c.comment.setBubbleSize(f,h);break;case "data":c.data=h.textContent;break;case "title":case "field":k=c.getField(f);n=h.textContent;if(k instanceof
|
||||
Blockly.FieldVariable){p=h.getAttribute("variableType")||"";var m=b.getVariable(n);m||(m=b.createVariable(n,p,h.getAttribute(e)));if(null!==p&&p!==m.type)throw Error("Serialized variable type with id '"+m.getId()+"' had type "+m.type+", and does not match variable field that references it: "+Blockly.Xml.domToText(h)+".");}if(!k){console.warn("Ignoring non-existent field "+f+" in block "+d);break}k.setValue(n);break;case "value":case "statement":h=c.getInput(f);if(!h){console.warn("Ignoring non-existent input "+
|
||||
Blockly.FieldVariable){p=h.getAttribute("variabletype")||"";var m=b.getVariable(n);m||(m=b.createVariable(n,p,h.getAttribute(e)));if(null!=p&&p!==m.type)throw Error("Serialized variable type with id '"+m.getId()+"' had type "+m.type+", and does not match variable field that references it: "+Blockly.Xml.domToText(h)+".");}if(!k){console.warn("Ignoring non-existent field "+f+" in block "+d);break}k.setValue(n);break;case "value":case "statement":h=c.getInput(f);if(!h){console.warn("Ignoring non-existent input "+
|
||||
f+" in block "+d);break}n&&h.connection.setShadowDom(n);k&&(f=Blockly.Xml.domToBlockHeadless_(k,b),f.outputConnection?h.connection.connect(f.outputConnection):f.previousConnection?h.connection.connect(f.previousConnection):goog.asserts.fail("Child block does not have output or previous statement."));break;case "next":n&&c.nextConnection&&c.nextConnection.setShadowDom(n);k&&(goog.asserts.assert(c.nextConnection,"Next statement does not exist."),goog.asserts.assert(!c.nextConnection.isConnected(),"Next statement is already connected."),
|
||||
f=Blockly.Xml.domToBlockHeadless_(k,b),goog.asserts.assert(f.previousConnection,"Next block does not have previous statement."),c.nextConnection.connect(f.previousConnection));break;default:console.warn("Ignoring unknown tag: "+h.nodeName)}}(g=a.getAttribute("inline"))&&c.setInputsInline("true"==g);(g=a.getAttribute("disabled"))&&c.setDisabled("true"==g);(g=a.getAttribute("deletable"))&&c.setDeletable("true"==g);(g=a.getAttribute("movable"))&&c.setMovable("true"==g);(g=a.getAttribute("editable"))&&
|
||||
c.setEditable("true"==g);(g=a.getAttribute("collapsed"))&&c.setCollapsed("true"==g);if("shadow"==a.nodeName.toLowerCase()){d=c.getChildren();for(g=0;e=d[g];g++)goog.asserts.assert(e.isShadow(),"Shadow block not allowed non-shadow child.");goog.asserts.assert(0==c.getVars().length,"Shadow blocks cannot have variable fields.");c.setShadow(!0)}return c};Blockly.Xml.deleteNext=function(a){for(var b=0,c;c=a.childNodes[b];b++)if("next"==c.nodeName.toLowerCase()){a.removeChild(c);break}};
|
||||
@@ -1168,9 +1168,9 @@ Blockly.WorkspaceSvg.prototype.blockDragSurface_=null;Blockly.WorkspaceSvg.proto
|
||||
Blockly.WorkspaceSvg.prototype.getInverseScreenCTM=function(){return this.inverseScreenCTM_};Blockly.WorkspaceSvg.prototype.updateInverseScreenCTM=function(){var a=this.getParentSvg().getScreenCTM();a&&(this.inverseScreenCTM_=a.inverse())};
|
||||
Blockly.WorkspaceSvg.prototype.getSvgXY=function(a){var b=0,c=0,d=1;if(goog.dom.contains(this.getCanvas(),a)||goog.dom.contains(this.getBubbleCanvas(),a))d=this.scale;do{var e=Blockly.utils.getRelativeXY(a);if(a==this.getCanvas()||a==this.getBubbleCanvas())d=1;b+=e.x*d;c+=e.y*d;a=a.parentNode}while(a&&a!=this.getParentSvg());return new goog.math.Coordinate(b,c)};Blockly.WorkspaceSvg.prototype.getOriginOffsetInPixels=function(){return Blockly.utils.getInjectionDivXY_(this.svgBlockCanvas_)};
|
||||
Blockly.WorkspaceSvg.prototype.setResizeHandlerWrapper=function(a){this.resizeHandlerWrapper_=a};
|
||||
Blockly.WorkspaceSvg.prototype.createDom=function(a){this.svgGroup_=Blockly.utils.createSvgElement("g",{"class":"blocklyWorkspace"},null);a&&(this.svgBackground_=Blockly.utils.createSvgElement("rect",{height:"100%",width:"100%","class":a},this.svgGroup_),"blocklyMainBackground"==a&&this.grid_&&(this.svgBackground_.style.fill="url(#"+this.grid_.getPatternId()+")"));this.svgBlockCanvas_=Blockly.utils.createSvgElement("g",{"class":"blocklyBlockCanvas"},this.svgGroup_,this);this.svgBubbleCanvas_=Blockly.utils.createSvgElement("g",
|
||||
{"class":"blocklyBubbleCanvas"},this.svgGroup_,this);a=Blockly.Scrollbar.scrollbarThickness;this.options.hasTrashcan&&(a=this.addTrashcan_(a));this.options.zoomOptions&&this.options.zoomOptions.controls&&this.addZoomControls_(a);this.isFlyout||(Blockly.bindEventWithChecks_(this.svgGroup_,"mousedown",this,this.onMouseDown_),this.options.zoomOptions&&this.options.zoomOptions.wheel&&Blockly.bindEventWithChecks_(this.svgGroup_,"wheel",this,this.onMouseWheel_));this.options.hasCategories&&(this.toolbox_=
|
||||
new Blockly.Toolbox(this));this.grid_&&this.grid_.update(this.scale);this.recordDeleteAreas();return this.svgGroup_};
|
||||
Blockly.WorkspaceSvg.prototype.createDom=function(a){this.svgGroup_=Blockly.utils.createSvgElement("g",{"class":"blocklyWorkspace"},null);a&&(this.svgBackground_=Blockly.utils.createSvgElement("rect",{height:"100%",width:"100%","class":a},this.svgGroup_),"blocklyMainBackground"==a&&this.grid_&&(this.svgBackground_.style.fill="url(#"+this.grid_.getPatternId()+")"));this.svgBlockCanvas_=Blockly.utils.createSvgElement("g",{"class":"blocklyBlockCanvas"},this.svgGroup_);this.svgBubbleCanvas_=Blockly.utils.createSvgElement("g",
|
||||
{"class":"blocklyBubbleCanvas"},this.svgGroup_);a=Blockly.Scrollbar.scrollbarThickness;this.options.hasTrashcan&&(a=this.addTrashcan_(a));this.options.zoomOptions&&this.options.zoomOptions.controls&&this.addZoomControls_(a);this.isFlyout||(Blockly.bindEventWithChecks_(this.svgGroup_,"mousedown",this,this.onMouseDown_),this.options.zoomOptions&&this.options.zoomOptions.wheel&&Blockly.bindEventWithChecks_(this.svgGroup_,"wheel",this,this.onMouseWheel_));this.options.hasCategories&&(this.toolbox_=new Blockly.Toolbox(this));
|
||||
this.grid_&&this.grid_.update(this.scale);this.recordDeleteAreas();return this.svgGroup_};
|
||||
Blockly.WorkspaceSvg.prototype.dispose=function(){this.rendered=!1;this.currentGesture_&&this.currentGesture_.cancel();Blockly.WorkspaceSvg.superClass_.dispose.call(this);this.svgGroup_&&(goog.dom.removeNode(this.svgGroup_),this.svgGroup_=null);this.svgBubbleCanvas_=this.svgBlockCanvas_=null;this.toolbox_&&(this.toolbox_.dispose(),this.toolbox_=null);this.flyout_&&(this.flyout_.dispose(),this.flyout_=null);this.trashcan&&(this.trashcan.dispose(),this.trashcan=null);this.scrollbar&&(this.scrollbar.dispose(),
|
||||
this.scrollbar=null);this.zoomControls_&&(this.zoomControls_.dispose(),this.zoomControls_=null);this.audioManager_&&(this.audioManager_.dispose(),this.audioManager_=null);this.grid_&&(this.grid_.dispose(),this.grid_=null);this.toolboxCategoryCallbacks_&&(this.toolboxCategoryCallbacks_=null);this.flyoutButtonCallbacks_&&(this.flyoutButtonCallbacks_=null);this.options.parentWorkspace||goog.dom.removeNode(this.getParentSvg().parentNode);this.resizeHandlerWrapper_&&(Blockly.unbindEvent_(this.resizeHandlerWrapper_),
|
||||
this.resizeHandlerWrapper_=null)};Blockly.WorkspaceSvg.prototype.newBlock=function(a,b){return new Blockly.BlockSvg(this,a,b)};Blockly.WorkspaceSvg.prototype.addTrashcan_=function(a){this.trashcan=new Blockly.Trashcan(this);var b=this.trashcan.createDom();this.svgGroup_.insertBefore(b,this.svgBlockCanvas_);return this.trashcan.init(a)};
|
||||
@@ -1178,7 +1178,7 @@ Blockly.WorkspaceSvg.prototype.addZoomControls_=function(a){this.zoomControls_=n
|
||||
Blockly.WorkspaceSvg.prototype.addFlyout_=function(a){var b={disabledPatternId:this.options.disabledPatternId,parentWorkspace:this,RTL:this.RTL,oneBasedIndex:this.options.oneBasedIndex,horizontalLayout:this.horizontalLayout,toolboxPosition:this.options.toolboxPosition};this.flyout_=null;this.flyout_=this.horizontalLayout?new Blockly.HorizontalFlyout(b):new Blockly.VerticalFlyout(b);this.flyout_.autoClose=!1;return this.flyout_.createDom(a)};
|
||||
Blockly.WorkspaceSvg.prototype.getFlyout_=function(){return this.flyout_?this.flyout_:this.toolbox_?this.toolbox_.flyout_:null};Blockly.WorkspaceSvg.prototype.updateScreenCalculations_=function(){this.updateInverseScreenCTM();this.recordDeleteAreas()};Blockly.WorkspaceSvg.prototype.resizeContents=function(){this.resizesEnabled_&&this.rendered&&(this.scrollbar&&this.scrollbar.resize(),this.updateInverseScreenCTM())};
|
||||
Blockly.WorkspaceSvg.prototype.resize=function(){this.toolbox_&&this.toolbox_.position();this.flyout_&&this.flyout_.position();this.trashcan&&this.trashcan.position();this.zoomControls_&&this.zoomControls_.position();this.scrollbar&&this.scrollbar.resize();this.updateScreenCalculations_()};Blockly.WorkspaceSvg.prototype.updateScreenCalculationsIfScrolled=function(){var a=goog.dom.getDocumentScroll();goog.math.Coordinate.equals(this.lastRecordedPageScroll_,a)||(this.lastRecordedPageScroll_=a,this.updateScreenCalculations_())};
|
||||
Blockly.WorkspaceSvg.prototype.getCanvas=function(){return this.svgBlockCanvas_};Blockly.WorkspaceSvg.prototype.getBubbleCanvas=function(){return this.svgBubbleCanvas_};Blockly.WorkspaceSvg.prototype.getParentSvg=function(){if(this.cachedParentSvg_)return this.cachedParentSvg_;for(var a=this.svgGroup_;a;){if("svg"==a.tagName)return this.cachedParentSvg_=a;a=a.parentNode}return null};
|
||||
Blockly.WorkspaceSvg.prototype.getCanvas=function(){return this.svgBlockCanvas_};Blockly.WorkspaceSvg.prototype.getBubbleCanvas=function(){return this.svgBubbleCanvas_};Blockly.WorkspaceSvg.prototype.getParentSvg=function(){if(this.cachedParentSvg_)return this.cachedParentSvg_;for(var a=this.svgGroup_;a;){if("svg"==a.tagName)return this.cachedParentSvg_=a;a=a.parentElement}return null};
|
||||
Blockly.WorkspaceSvg.prototype.translate=function(a,b){if(this.useWorkspaceDragSurface_&&this.isDragSurfaceActive_)this.workspaceDragSurface_.translateSurface(a,b);else{var c="translate("+a+","+b+") scale("+this.scale+")";this.svgBlockCanvas_.setAttribute("transform",c);this.svgBubbleCanvas_.setAttribute("transform",c)}this.blockDragSurface_&&this.blockDragSurface_.translateAndScaleGroup(a,b,this.scale)};
|
||||
Blockly.WorkspaceSvg.prototype.resetDragSurface=function(){if(this.useWorkspaceDragSurface_){this.isDragSurfaceActive_=!1;var a=this.workspaceDragSurface_.getSurfaceTranslation();this.workspaceDragSurface_.clearAndHide(this.svgGroup_);a="translate("+a.x+","+a.y+") scale("+this.scale+")";this.svgBlockCanvas_.setAttribute("transform",a);this.svgBubbleCanvas_.setAttribute("transform",a)}};
|
||||
Blockly.WorkspaceSvg.prototype.setupDragSurface=function(){if(this.useWorkspaceDragSurface_&&!this.isDragSurfaceActive_){this.isDragSurfaceActive_=!0;var a=this.svgBlockCanvas_.previousSibling,b=this.getParentSvg().getAttribute("width"),c=this.getParentSvg().getAttribute("height"),d=Blockly.utils.getRelativeXY(this.svgBlockCanvas_);this.workspaceDragSurface_.setContentsAndShow(this.svgBlockCanvas_,this.svgBubbleCanvas_,a,b,c,this.scale);this.workspaceDragSurface_.translateSurface(d.x,d.y)}};
|
||||
@@ -1192,7 +1192,7 @@ Blockly.WorkspaceSvg.prototype.deleteVariable=function(a){Blockly.WorkspaceSvg.s
|
||||
Blockly.WorkspaceSvg.prototype.recordDeleteAreas=function(){this.deleteAreaTrash_=this.trashcan?this.trashcan.getClientRect():null;this.deleteAreaToolbox_=this.flyout_?this.flyout_.getClientRect():this.toolbox_?this.toolbox_.getClientRect():null};
|
||||
Blockly.WorkspaceSvg.prototype.isDeleteArea=function(a){a=new goog.math.Coordinate(a.clientX,a.clientY);return this.deleteAreaTrash_&&this.deleteAreaTrash_.contains(a)?Blockly.DELETE_AREA_TRASH:this.deleteAreaToolbox_&&this.deleteAreaToolbox_.contains(a)?Blockly.DELETE_AREA_TOOLBOX:Blockly.DELETE_AREA_NONE};Blockly.WorkspaceSvg.prototype.onMouseDown_=function(a){var b=this.getGesture(a);b&&b.handleWsStart(a,this)};
|
||||
Blockly.WorkspaceSvg.prototype.startDrag=function(a,b){var c=Blockly.utils.mouseToSvg(a,this.getParentSvg(),this.getInverseScreenCTM());c.x/=this.scale;c.y/=this.scale;this.dragDeltaXY_=goog.math.Coordinate.difference(b,c)};Blockly.WorkspaceSvg.prototype.moveDrag=function(a){a=Blockly.utils.mouseToSvg(a,this.getParentSvg(),this.getInverseScreenCTM());a.x/=this.scale;a.y/=this.scale;return goog.math.Coordinate.sum(this.dragDeltaXY_,a)};
|
||||
Blockly.WorkspaceSvg.prototype.isDragging=function(){return this.currentGesture_&&this.currentGesture_.isDragging()};Blockly.WorkspaceSvg.prototype.isDraggable=function(){return!!this.scrollbar};Blockly.WorkspaceSvg.prototype.onMouseWheel_=function(a){this.currentGesture_&&this.currentGesture_.cancel();var b=-a.deltaY/50,c=Blockly.utils.mouseToSvg(a,this.getParentSvg(),this.getInverseScreenCTM());this.zoom(c.x,c.y,b);a.preventDefault()};
|
||||
Blockly.WorkspaceSvg.prototype.isDragging=function(){return null!=this.currentGesture_&&this.currentGesture_.isDragging()};Blockly.WorkspaceSvg.prototype.isDraggable=function(){return!!this.scrollbar};Blockly.WorkspaceSvg.prototype.onMouseWheel_=function(a){this.currentGesture_&&this.currentGesture_.cancel();var b=-a.deltaY/50,c=Blockly.utils.mouseToSvg(a,this.getParentSvg(),this.getInverseScreenCTM());this.zoom(c.x,c.y,b);a.preventDefault()};
|
||||
Blockly.WorkspaceSvg.prototype.getBlocksBoundingBox=function(){var a=this.getTopBlocks(!1);if(!a.length)return{x:0,y:0,width:0,height:0};for(var b=a[0].getBoundingRectangle(),c=1;c<a.length;c++){var d=a[c].getBoundingRectangle();d.topLeft.x<b.topLeft.x&&(b.topLeft.x=d.topLeft.x);d.bottomRight.x>b.bottomRight.x&&(b.bottomRight.x=d.bottomRight.x);d.topLeft.y<b.topLeft.y&&(b.topLeft.y=d.topLeft.y);d.bottomRight.y>b.bottomRight.y&&(b.bottomRight.y=d.bottomRight.y)}return{x:b.topLeft.x,y:b.topLeft.y,width:b.bottomRight.x-
|
||||
b.topLeft.x,height:b.bottomRight.y-b.topLeft.y}};Blockly.WorkspaceSvg.prototype.cleanUp=function(){this.setResizesEnabled(!1);Blockly.Events.setGroup(!0);for(var a=this.getTopBlocks(!0),b=0,c=0,d;d=a[c];c++){var e=d.getRelativeToSurfaceXY();d.moveBy(-e.x,b-e.y);d.snapToGrid();b=d.getRelativeToSurfaceXY().y+d.getHeightWidth().height+Blockly.BlockSvg.MIN_BLOCK_Y}Blockly.Events.setGroup(!1);this.setResizesEnabled(!0)};
|
||||
Blockly.WorkspaceSvg.prototype.showContextMenu_=function(a){function b(a){if(a.isDeletable())m=m.concat(a.getDescendants());else{a=a.getChildren();for(var c=0;c<a.length;c++)b(a[c])}}function c(){Blockly.Events.setGroup(f);var a=m.shift();a&&(a.workspace?(a.dispose(!1,!0),setTimeout(c,10)):c());Blockly.Events.setGroup(!1)}if(!this.options.readOnly&&!this.isFlyout){var d=[],e=this.getTopBlocks(!0),f=Blockly.utils.genUid(),g=this,h={};h.text=Blockly.Msg.UNDO;h.enabled=0<this.undoStack_.length;h.callback=
|
||||
@@ -1240,15 +1240,15 @@ Blockly.Block.obtain=function(a,b){console.warn("Deprecated call to Blockly.Bloc
|
||||
Blockly.Block.prototype.dispose=function(a){if(this.workspace){this.onchangeWrapper_&&this.workspace.removeChangeListener(this.onchangeWrapper_);this.unplug(a);Blockly.Events.isEnabled()&&Blockly.Events.fire(new Blockly.Events.BlockDelete(this));Blockly.Events.disable();try{this.workspace&&(this.workspace.removeTopBlock(this),delete this.workspace.blockDB_[this.id],this.workspace=null);for(var b=this.childBlocks_.length-1;0<=b;b--)this.childBlocks_[b].dispose(!1);b=0;for(var c;c=this.inputList[b];b++)c.dispose();
|
||||
this.inputList.length=0;var d=this.getConnections_(!0);for(b=0;b<d.length;b++){var e=d[b];e.isConnected()&&e.disconnect();d[b].dispose()}}finally{Blockly.Events.enable()}}};
|
||||
Blockly.Block.prototype.unplug=function(a){if(this.outputConnection)this.outputConnection.isConnected()&&this.outputConnection.disconnect();else if(this.previousConnection){var b=null;this.previousConnection.isConnected()&&(b=this.previousConnection.targetConnection,this.previousConnection.disconnect());var c=this.getNextBlock();a&&c&&(a=this.nextConnection.targetConnection,a.disconnect(),b&&b.checkType_(a)&&b.connect(a))}};
|
||||
Blockly.Block.prototype.getConnections_=function(){var a=[];this.outputConnection&&a.push(this.outputConnection);this.previousConnection&&a.push(this.previousConnection);this.nextConnection&&a.push(this.nextConnection);for(var b=0,c;c=this.inputList[b];b++)c.connection&&a.push(c.connection);return a};Blockly.Block.prototype.lastConnectionInStack_=function(){for(var a=this.nextConnection;a;){var b=a.targetBlock();if(!b)return a;a=b.nextConnection}return null};
|
||||
Blockly.Block.prototype.bumpNeighbours_=function(){console.warn("Not expected to reach this bumpNeighbours_ function. The BlockSvg function for bumpNeighbours_ was expected to be called instead.")};Blockly.Block.prototype.getParent=function(){return this.parentBlock_};Blockly.Block.prototype.getInputWithBlock=function(a){for(var b=0,c;c=this.inputList[b];b++)if(c.connection&&c.connection.targetBlock()==a)return c;return null};
|
||||
Blockly.Block.prototype.getSurroundParent=function(){var a=this;do{var b=a;a=a.getParent();if(!a)return null}while(a.getNextBlock()==b);return a};Blockly.Block.prototype.getNextBlock=function(){return this.nextConnection&&this.nextConnection.targetBlock()};Blockly.Block.prototype.getRootBlock=function(){var a=this;do{var b=a;a=b.parentBlock_}while(a);return b};Blockly.Block.prototype.getChildren=function(){return this.childBlocks_};
|
||||
Blockly.Block.prototype.getConnections_=function(a){a=[];this.outputConnection&&a.push(this.outputConnection);this.previousConnection&&a.push(this.previousConnection);this.nextConnection&&a.push(this.nextConnection);for(var b=0,c;c=this.inputList[b];b++)c.connection&&a.push(c.connection);return a};Blockly.Block.prototype.lastConnectionInStack_=function(){for(var a=this.nextConnection;a;){var b=a.targetBlock();if(!b)return a;a=b.nextConnection}return null};Blockly.Block.prototype.bumpNeighbours_=function(){console.warn("Not expected to reach this bumpNeighbours_ function. The BlockSvg function for bumpNeighbours_ was expected to be called instead.")};
|
||||
Blockly.Block.prototype.getParent=function(){return this.parentBlock_};Blockly.Block.prototype.getInputWithBlock=function(a){for(var b=0,c;c=this.inputList[b];b++)if(c.connection&&c.connection.targetBlock()==a)return c;return null};Blockly.Block.prototype.getSurroundParent=function(){var a=this;do{var b=a;a=a.getParent();if(!a)return null}while(a.getNextBlock()==b);return a};Blockly.Block.prototype.getNextBlock=function(){return this.nextConnection&&this.nextConnection.targetBlock()};
|
||||
Blockly.Block.prototype.getRootBlock=function(){var a=this;do{var b=a;a=b.parentBlock_}while(a);return b};Blockly.Block.prototype.getChildren=function(){return this.childBlocks_};
|
||||
Blockly.Block.prototype.setParent=function(a){if(a!=this.parentBlock_){if(this.parentBlock_){goog.array.remove(this.parentBlock_.childBlocks_,this);if(this.previousConnection&&this.previousConnection.isConnected())throw"Still connected to previous block.";if(this.outputConnection&&this.outputConnection.isConnected())throw"Still connected to parent block.";this.parentBlock_=null}else this.workspace.removeTopBlock(this);(this.parentBlock_=a)?a.childBlocks_.push(this):this.workspace.addTopBlock(this)}};
|
||||
Blockly.Block.prototype.getDescendants=function(){for(var a=[this],b,c=0;b=this.childBlocks_[c];c++)a.push.apply(a,b.getDescendants());return a};Blockly.Block.prototype.isDeletable=function(){return this.deletable_&&!this.isShadow_&&!(this.workspace&&this.workspace.options.readOnly)};Blockly.Block.prototype.setDeletable=function(a){this.deletable_=a};Blockly.Block.prototype.isMovable=function(){return this.movable_&&!this.isShadow_&&!(this.workspace&&this.workspace.options.readOnly)};
|
||||
Blockly.Block.prototype.setMovable=function(a){this.movable_=a};Blockly.Block.prototype.isShadow=function(){return this.isShadow_};Blockly.Block.prototype.setShadow=function(a){this.isShadow_=a};Blockly.Block.prototype.isEditable=function(){return this.editable_&&!(this.workspace&&this.workspace.options.readOnly)};Blockly.Block.prototype.setEditable=function(a){this.editable_=a;a=0;for(var b;b=this.inputList[a];a++)for(var c=0,d;d=b.fieldRow[c];c++)d.updateEditable()};
|
||||
Blockly.Block.prototype.setConnectionsHidden=function(a){if(!a&&this.isCollapsed()){if(this.outputConnection&&this.outputConnection.setHidden(a),this.previousConnection&&this.previousConnection.setHidden(a),this.nextConnection){this.nextConnection.setHidden(a);var b=this.nextConnection.targetBlock();b&&b.setConnectionsHidden(a)}}else for(var c=this.getConnections_(!0),d=0;b=c[d];d++)b.setHidden(a),b.isSuperior()&&(b=b.targetBlock())&&b.setConnectionsHidden(a)};
|
||||
Blockly.Block.prototype.setHelpUrl=function(a){this.helpUrl=a};Blockly.Block.prototype.setTooltip=function(a){this.tooltip=a};Blockly.Block.prototype.getColour=function(){return this.colour_};Blockly.Block.prototype.getHue=function(){return this.hue_};
|
||||
Blockly.Block.prototype.setColour=function(a){var b=Number(a);if(!isNaN(b)&&0<=b&&360>=b)this.hue_=b,this.colour_=Blockly.hueToRgb(b);else if(goog.isString(a)&&a.match(/^#[0-9a-fA-F]{6}$/))this.colour_=a,this.hue_=null;else throw"Invalid colour: "+a;};
|
||||
Blockly.Block.prototype.setColour=function(a){var b=Number(a);if(!isNaN(b)&&0<=b&&360>=b)this.hue_=b,this.colour_=Blockly.hueToRgb(b);else if(goog.isString(a)&&/^#[0-9a-fA-F]{6}$/.test(a))this.colour_=a,this.hue_=null;else throw"Invalid colour: "+a;};
|
||||
Blockly.Block.prototype.setOnChange=function(a){if(a&&!goog.isFunction(a))throw Error("onchange must be a function.");this.onchangeWrapper_&&this.workspace.removeChangeListener(this.onchangeWrapper_);if(this.onchange=a)this.onchangeWrapper_=a.bind(this),this.workspace.addChangeListener(this.onchangeWrapper_)};Blockly.Block.prototype.getField=function(a){for(var b=0,c;c=this.inputList[b];b++)for(var d=0,e;e=c.fieldRow[d];d++)if(e.name===a)return e;return null};
|
||||
Blockly.Block.prototype.getVars=function(){for(var a=[],b=0,c;c=this.inputList[b];b++)for(var d=0,e;e=c.fieldRow[d];d++)e instanceof Blockly.FieldVariable&&a.push(e.getValue());return a};Blockly.Block.prototype.renameVar=function(a,b){for(var c=0,d;d=this.inputList[c];c++)for(var e=0,f;f=d.fieldRow[e];e++)f instanceof Blockly.FieldVariable&&Blockly.Names.equals(a,f.getValue())&&f.setValue(b)};Blockly.Block.prototype.getFieldValue=function(a){return(a=this.getField(a))?a.getValue():null};
|
||||
Blockly.Block.prototype.setFieldValue=function(a,b){var c=this.getField(b);goog.asserts.assertObject(c,'Field "%s" not found.',b);c.setValue(a)};
|
||||
@@ -1275,7 +1275,7 @@ Blockly.Block.prototype.appendInput_=function(a,b){var c=null;if(a==Blockly.INPU
|
||||
Blockly.Block.prototype.moveInputBefore=function(a,b){if(a!=b){for(var c=-1,d=b?-1:this.inputList.length,e=0,f;f=this.inputList[e];e++)if(f.name==a){if(c=e,-1!=d)break}else if(b&&f.name==b&&(d=e,-1!=c))break;goog.asserts.assert(-1!=c,'Named input "%s" not found.',a);goog.asserts.assert(-1!=d,'Reference input "%s" not found.',b);this.moveNumberedInputBefore(c,d)}};
|
||||
Blockly.Block.prototype.moveNumberedInputBefore=function(a,b){goog.asserts.assert(a!=b,"Can't move input to itself.");goog.asserts.assert(a<this.inputList.length,"Input index "+a+" out of bounds.");goog.asserts.assert(b<=this.inputList.length,"Reference input "+b+" out of bounds.");var c=this.inputList[a];this.inputList.splice(a,1);a<b&&b--;this.inputList.splice(b,0,c)};
|
||||
Blockly.Block.prototype.removeInput=function(a,b){for(var c=0,d;d=this.inputList[c];c++)if(d.name==a){if(d.connection&&d.connection.isConnected()){d.connection.setShadowDom(null);var e=d.connection.targetBlock();e.isShadow()?e.dispose():e.unplug()}d.dispose();this.inputList.splice(c,1);return}b||goog.asserts.fail('Input "%s" not found.',a)};Blockly.Block.prototype.getInput=function(a){for(var b=0,c;c=this.inputList[b];b++)if(c.name==a)return c;return null};
|
||||
Blockly.Block.prototype.getInputTargetBlock=function(a){return(a=this.getInput(a))&&a.connection&&a.connection.targetBlock()};Blockly.Block.prototype.getCommentText=function(){return this.comment||""};Blockly.Block.prototype.setCommentText=function(a){this.comment!=a&&(Blockly.Events.fire(new Blockly.Events.BlockChange(this,"comment",null,this.comment,a||"")),this.comment=a)};Blockly.Block.prototype.setWarningText=function(){};Blockly.Block.prototype.setMutator=function(){};
|
||||
Blockly.Block.prototype.getInputTargetBlock=function(a){return(a=this.getInput(a))&&a.connection&&a.connection.targetBlock()};Blockly.Block.prototype.getCommentText=function(){return this.comment||""};Blockly.Block.prototype.setCommentText=function(a){this.comment!=a&&(Blockly.Events.fire(new Blockly.Events.BlockChange(this,"comment",null,this.comment,a||"")),this.comment=a)};Blockly.Block.prototype.setWarningText=function(a,b){};Blockly.Block.prototype.setMutator=function(a){};
|
||||
Blockly.Block.prototype.getRelativeToSurfaceXY=function(){return this.xy_};Blockly.Block.prototype.moveBy=function(a,b){goog.asserts.assert(!this.parentBlock_,"Block has parent.");var c=new Blockly.Events.BlockMove(this);this.xy_.translate(a,b);c.recordNew();Blockly.Events.fire(c)};Blockly.Block.prototype.makeConnection_=function(a){return new Blockly.Connection(this,a)};
|
||||
Blockly.Block.prototype.allInputsFilled=function(a){void 0===a&&(a=!0);if(!a&&this.isShadow())return!1;for(var b=0,c;c=this.inputList[b];b++)if(c.connection&&(c=c.connection.targetBlock(),!c||!c.allInputsFilled(a)))return!1;return(b=this.getNextBlock())?b.allInputsFilled(a):!0};Blockly.Block.prototype.toDevString=function(){var a=this.type?'"'+this.type+'" block':"Block";this.id&&(a+=' (id="'+this.id+'")');return a};Blockly.BlockDragSurfaceSvg=function(a){this.container_=a;this.createDom()};Blockly.BlockDragSurfaceSvg.prototype.SVG_=null;Blockly.BlockDragSurfaceSvg.prototype.dragGroup_=null;Blockly.BlockDragSurfaceSvg.prototype.container_=null;Blockly.BlockDragSurfaceSvg.prototype.scale_=1;Blockly.BlockDragSurfaceSvg.prototype.surfaceXY_=null;
|
||||
Blockly.BlockDragSurfaceSvg.prototype.createDom=function(){this.SVG_||(this.SVG_=Blockly.utils.createSvgElement("svg",{xmlns:Blockly.SVG_NS,"xmlns:html":Blockly.HTML_NS,"xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1","class":"blocklyBlockDragSurface"},this.container_),this.dragGroup_=Blockly.utils.createSvgElement("g",{},this.SVG_))};
|
||||
@@ -1286,8 +1286,10 @@ Blockly.BlockDragSurfaceSvg.prototype.clearAndHide=function(a){a?a.appendChild(t
|
||||
Blockly.ContextMenu.populate_=function(a,b){var c=new goog.ui.Menu;c.setRightToLeft(b);for(var d=0,e;e=a[d];d++){var f=new goog.ui.MenuItem(e.text);f.setRightToLeft(b);c.addChild(f,!0);f.setEnabled(e.enabled);e.enabled&&(goog.events.listen(f,goog.ui.Component.EventType.ACTION,e.callback),f.handleContextMenu=function(){goog.events.dispatchEvent(this,goog.ui.Component.EventType.ACTION)})}return c};
|
||||
Blockly.ContextMenu.position_=function(a,b,c){var d=Blockly.utils.getViewportBBox();b={top:b.clientY+d.top,bottom:b.clientY+d.top,left:b.clientX+d.left,right:b.clientX+d.left};Blockly.ContextMenu.createWidget_(a);var e=Blockly.utils.uiMenu.getSize(a);c&&Blockly.utils.uiMenu.adjustBBoxesForRTL(d,b,e);Blockly.WidgetDiv.positionWithAnchor(d,b,e,c);a.getElement().focus()};
|
||||
Blockly.ContextMenu.createWidget_=function(a){a.render(Blockly.WidgetDiv.DIV);var b=a.getElement();Blockly.utils.addClass(b,"blocklyContextMenu");Blockly.bindEventWithChecks_(b,"contextmenu",null,Blockly.utils.noEvent);a.setAllowAutoFocus(!0)};Blockly.ContextMenu.hide=function(){Blockly.WidgetDiv.hideIfOwner(Blockly.ContextMenu);Blockly.ContextMenu.currentBlock=null;Blockly.ContextMenu.eventWrapper_&&Blockly.unbindEvent_(Blockly.ContextMenu.eventWrapper_)};
|
||||
Blockly.ContextMenu.callbackFactory=function(a,b){return function(){Blockly.Events.disable();try{var c=Blockly.Xml.domToBlock(b,a.workspace),d=a.getRelativeToSurfaceXY();d.x=a.RTL?d.x-Blockly.SNAP_RADIUS:d.x+Blockly.SNAP_RADIUS;d.y+=2*Blockly.SNAP_RADIUS;c.moveBy(d.x,d.y)}finally{Blockly.Events.enable()}Blockly.Events.isEnabled()&&!c.isShadow()&&Blockly.Events.fire(new Blockly.Events.BlockCreate(c));c.select()}};Blockly.BlockSvg=function(a,b,c){this.svgGroup_=Blockly.utils.createSvgElement("g",{},null);this.svgGroup_.translate_="";this.svgPathDark_=Blockly.utils.createSvgElement("path",{"class":"blocklyPathDark",transform:"translate(1,1)"},this.svgGroup_);this.svgPath_=Blockly.utils.createSvgElement("path",{"class":"blocklyPath"},this.svgGroup_);this.svgPathLight_=Blockly.utils.createSvgElement("path",{"class":"blocklyPathLight"},this.svgGroup_);this.svgPath_.tooltip=this;this.rendered=!1;this.useDragSurface_=
|
||||
Blockly.utils.is3dSupported()&&!!a.blockDragSurface_;Blockly.Tooltip.bindMouseEvents(this.svgPath_);Blockly.BlockSvg.superClass_.constructor.call(this,a,b,c)};goog.inherits(Blockly.BlockSvg,Blockly.Block);Blockly.BlockSvg.prototype.height=0;Blockly.BlockSvg.prototype.width=0;Blockly.BlockSvg.prototype.dragStartXY_=null;Blockly.BlockSvg.INLINE=-1;
|
||||
Blockly.ContextMenu.callbackFactory=function(a,b){return function(){Blockly.Events.disable();try{var c=Blockly.Xml.domToBlock(b,a.workspace),d=a.getRelativeToSurfaceXY();d.x=a.RTL?d.x-Blockly.SNAP_RADIUS:d.x+Blockly.SNAP_RADIUS;d.y+=2*Blockly.SNAP_RADIUS;c.moveBy(d.x,d.y)}finally{Blockly.Events.enable()}Blockly.Events.isEnabled()&&!c.isShadow()&&Blockly.Events.fire(new Blockly.Events.BlockCreate(c));c.select()}};
|
||||
Blockly.ContextMenu.blockDeleteOption=function(a){var b=a.getDescendants(!0).length,c=a.getNextBlock();c&&(b-=c.getDescendants(!0).length);return{text:1==b?Blockly.Msg.DELETE_BLOCK:Blockly.Msg.DELETE_X_BLOCKS.replace("%1",String(b)),enabled:!0,callback:function(){Blockly.Events.setGroup(!0);a.dispose(!0,!0);Blockly.Events.setGroup(!1)}}};Blockly.ContextMenu.blockHelpOption=function(a){return{enabled:!(goog.isFunction(a.helpUrl)?!a.helpUrl():!a.helpUrl),text:Blockly.Msg.HELP,callback:function(){a.showHelp_()}}};
|
||||
Blockly.ContextMenu.blockDuplicateOption=function(a){var b=!0;a.getDescendants().length>a.workspace.remainingCapacity()&&(b=!1);return{text:Blockly.Msg.DUPLICATE_BLOCK,enabled:b,callback:function(){Blockly.duplicate_(a)}}};Blockly.ContextMenu.blockCommentOption=function(a){var b={enabled:!goog.userAgent.IE};a.comment?(b.text=Blockly.Msg.REMOVE_COMMENT,b.callback=function(){a.setCommentText(null)}):(b.text=Blockly.Msg.ADD_COMMENT,b.callback=function(){a.setCommentText("")});return b};Blockly.BlockSvg=function(a,b,c){this.svgGroup_=Blockly.utils.createSvgElement("g",{},null);this.svgGroup_.translate_="";this.svgPathDark_=Blockly.utils.createSvgElement("path",{"class":"blocklyPathDark",transform:"translate(1,1)"},this.svgGroup_);this.svgPath_=Blockly.utils.createSvgElement("path",{"class":"blocklyPath"},this.svgGroup_);this.svgPathLight_=Blockly.utils.createSvgElement("path",{"class":"blocklyPathLight"},this.svgGroup_);this.svgPath_.tooltip=this;this.rendered=!1;this.useDragSurface_=
|
||||
Blockly.utils.is3dSupported()&&!!a.blockDragSurface_;Blockly.Tooltip.bindMouseEvents(this.svgPath_);Blockly.BlockSvg.superClass_.constructor.call(this,a,b,c)};goog.inherits(Blockly.BlockSvg,Blockly.Block);Blockly.BlockSvg.prototype.height=0;Blockly.BlockSvg.prototype.width=0;Blockly.BlockSvg.prototype.dragStartXY_=null;Blockly.BlockSvg.prototype.warningTextDb_=null;Blockly.BlockSvg.INLINE=-1;
|
||||
Blockly.BlockSvg.prototype.initSvg=function(){goog.asserts.assert(this.workspace.rendered,"Workspace is headless.");for(var a=0,b;b=this.inputList[a];a++)b.init();b=this.getIcons();for(a=0;a<b.length;a++)b[a].createIcon();this.updateColour();this.updateMovable();this.workspace.options.readOnly||this.eventsInit_||Blockly.bindEventWithChecks_(this.getSvgRoot(),"mousedown",this,this.onMouseDown_);this.eventsInit_=!0;this.getSvgRoot().parentNode||this.workspace.getCanvas().appendChild(this.getSvgRoot())};
|
||||
Blockly.BlockSvg.prototype.select=function(){if(this.isShadow()&&this.getParent())this.getParent().select();else if(Blockly.selected!=this){var a=null;if(Blockly.selected){a=Blockly.selected.id;Blockly.Events.disable();try{Blockly.selected.unselect()}finally{Blockly.Events.enable()}}a=new Blockly.Events.Ui(null,"selected",a,this.id);a.workspaceId=this.workspace.id;Blockly.Events.fire(a);Blockly.selected=this;this.addSelect()}};
|
||||
Blockly.BlockSvg.prototype.unselect=function(){if(Blockly.selected==this){var a=new Blockly.Events.Ui(null,"selected",this.id,null);a.workspaceId=this.workspace.id;Blockly.Events.fire(a);Blockly.selected=null;this.removeSelect()}};Blockly.BlockSvg.prototype.mutator=null;Blockly.BlockSvg.prototype.comment=null;Blockly.BlockSvg.prototype.warning=null;
|
||||
@@ -1302,16 +1304,15 @@ Blockly.BlockSvg.prototype.getBoundingRectangle=function(){var a=this.getRelativ
|
||||
Blockly.BlockSvg.prototype.setCollapsed=function(a){if(this.collapsed_!=a){for(var b=[],c=0,d;d=this.inputList[c];c++)b.push.apply(b,d.setVisible(!a));if(a){d=this.getIcons();for(c=0;c<d.length;c++)d[c].setVisible(!1);c=this.toString(Blockly.COLLAPSE_CHARS);this.appendDummyInput("_TEMP_COLLAPSED_INPUT").appendField(c).init()}else this.removeInput("_TEMP_COLLAPSED_INPUT"),this.setWarningText(null);Blockly.BlockSvg.superClass_.setCollapsed.call(this,a);b.length||(b[0]=this);if(this.rendered)for(c=0;a=
|
||||
b[c];c++)a.render()}};Blockly.BlockSvg.prototype.tab=function(a,b){var c=this.createTabList_(),d=c.indexOf(a);-1==d&&(d=b?-1:c.length);(c=c[b?d+1:d-1])?c instanceof Blockly.Field?c.showEditor_():c.tab(null,b):(c=this.getParent())&&c.tab(this,b)};Blockly.BlockSvg.prototype.createTabList_=function(){for(var a=[],b=0,c;c=this.inputList[b];b++){for(var d=0,e;e=c.fieldRow[d];d++)e instanceof Blockly.FieldTextInput&&a.push(e);c.connection&&(c=c.connection.targetBlock())&&a.push(c)}return a};
|
||||
Blockly.BlockSvg.prototype.onMouseDown_=function(a){var b=this.workspace.getGesture(a);b&&b.handleBlockStart(a,this)};Blockly.BlockSvg.prototype.showHelp_=function(){var a=goog.isFunction(this.helpUrl)?this.helpUrl():this.helpUrl;a&&window.open(a)};
|
||||
Blockly.BlockSvg.prototype.showContextMenu_=function(a){if(!this.workspace.options.readOnly&&this.contextMenu){var b=this,c=[];if(this.isDeletable()&&this.isMovable()&&!b.isInFlyout){var d={text:Blockly.Msg.DUPLICATE_BLOCK,enabled:!0,callback:function(){Blockly.duplicate_(b)}};this.getDescendants().length>this.workspace.remainingCapacity()&&(d.enabled=!1);c.push(d);this.isEditable()&&!this.collapsed_&&this.workspace.options.comments&&(d={enabled:!goog.userAgent.IE},this.comment?(d.text=Blockly.Msg.REMOVE_COMMENT,
|
||||
d.callback=function(){b.setCommentText(null)}):(d.text=Blockly.Msg.ADD_COMMENT,d.callback=function(){b.setCommentText("")}),c.push(d));if(!this.collapsed_)for(d=1;d<this.inputList.length;d++)if(this.inputList[d-1].type!=Blockly.NEXT_STATEMENT&&this.inputList[d].type!=Blockly.NEXT_STATEMENT){d={enabled:!0};var e=this.getInputsInline();d.text=e?Blockly.Msg.EXTERNAL_INPUTS:Blockly.Msg.INLINE_INPUTS;d.callback=function(){b.setInputsInline(!e)};c.push(d);break}this.workspace.options.collapse&&(this.collapsed_?
|
||||
(d={enabled:!0},d.text=Blockly.Msg.EXPAND_BLOCK,d.callback=function(){b.setCollapsed(!1)}):(d={enabled:!0},d.text=Blockly.Msg.COLLAPSE_BLOCK,d.callback=function(){b.setCollapsed(!0)}),c.push(d));this.workspace.options.disable&&(d={text:this.disabled?Blockly.Msg.ENABLE_BLOCK:Blockly.Msg.DISABLE_BLOCK,enabled:!this.getInheritedDisabled(),callback:function(){b.setDisabled(!b.disabled)}},c.push(d));d=this.getDescendants().length;var f=this.getNextBlock();f&&(d-=f.getDescendants().length);d={text:1==d?
|
||||
Blockly.Msg.DELETE_BLOCK:Blockly.Msg.DELETE_X_BLOCKS.replace("%1",String(d)),enabled:!0,callback:function(){Blockly.Events.setGroup(!0);b.dispose(!0,!0);Blockly.Events.setGroup(!1)}};c.push(d)}d={enabled:!(goog.isFunction(this.helpUrl)?!this.helpUrl():!this.helpUrl)};d.text=Blockly.Msg.HELP;d.callback=function(){b.showHelp_()};c.push(d);this.customContextMenu&&this.customContextMenu(c);Blockly.ContextMenu.show(a,c,this.RTL);Blockly.ContextMenu.currentBlock=this}};
|
||||
Blockly.BlockSvg.prototype.showContextMenu_=function(a){if(!this.workspace.options.readOnly&&this.contextMenu){var b=this,c=[];if(this.isDeletable()&&this.isMovable()&&!b.isInFlyout){c.push(Blockly.ContextMenu.blockDuplicateOption(b));this.isEditable()&&!this.collapsed_&&this.workspace.options.comments&&c.push(Blockly.ContextMenu.blockCommentOption(b));if(!this.collapsed_)for(var d=1;d<this.inputList.length;d++)if(this.inputList[d-1].type!=Blockly.NEXT_STATEMENT&&this.inputList[d].type!=Blockly.NEXT_STATEMENT){d=
|
||||
{enabled:!0};var e=this.getInputsInline();d.text=e?Blockly.Msg.EXTERNAL_INPUTS:Blockly.Msg.INLINE_INPUTS;d.callback=function(){b.setInputsInline(!e)};c.push(d);break}this.workspace.options.collapse&&(this.collapsed_?(d={enabled:!0},d.text=Blockly.Msg.EXPAND_BLOCK,d.callback=function(){b.setCollapsed(!1)}):(d={enabled:!0},d.text=Blockly.Msg.COLLAPSE_BLOCK,d.callback=function(){b.setCollapsed(!0)}),c.push(d));this.workspace.options.disable&&(d={text:this.disabled?Blockly.Msg.ENABLE_BLOCK:Blockly.Msg.DISABLE_BLOCK,
|
||||
enabled:!this.getInheritedDisabled(),callback:function(){b.setDisabled(!b.disabled)}},c.push(d));c.push(Blockly.ContextMenu.blockDeleteOption(b))}c.push(Blockly.ContextMenu.blockHelpOption(b));this.customContextMenu&&this.customContextMenu(c);Blockly.ContextMenu.show(a,c,this.RTL);Blockly.ContextMenu.currentBlock=this}};
|
||||
Blockly.BlockSvg.prototype.moveConnections_=function(a,b){if(this.rendered){for(var c=this.getConnections_(!1),d=0;d<c.length;d++)c[d].moveBy(a,b);c=this.getIcons();for(d=0;d<c.length;d++)c[d].computeIconLocation();for(d=0;d<this.childBlocks_.length;d++)this.childBlocks_[d].moveConnections_(a,b)}};
|
||||
Blockly.BlockSvg.prototype.setDragging=function(a){if(a){var b=this.getSvgRoot();b.translate_="";b.skew_="";Blockly.draggingConnections_=Blockly.draggingConnections_.concat(this.getConnections_(!0));Blockly.utils.addClass(this.svgGroup_,"blocklyDragging")}else Blockly.draggingConnections_=[],Blockly.utils.removeClass(this.svgGroup_,"blocklyDragging");for(b=0;b<this.childBlocks_.length;b++)this.childBlocks_[b].setDragging(a)};
|
||||
Blockly.BlockSvg.prototype.updateMovable=function(){this.isMovable()?Blockly.utils.addClass(this.svgGroup_,"blocklyDraggable"):Blockly.utils.removeClass(this.svgGroup_,"blocklyDraggable")};Blockly.BlockSvg.prototype.setMovable=function(a){Blockly.BlockSvg.superClass_.setMovable.call(this,a);this.updateMovable()};Blockly.BlockSvg.prototype.setEditable=function(a){Blockly.BlockSvg.superClass_.setEditable.call(this,a);a=this.getIcons();for(var b=0;b<a.length;b++)a[b].updateEditable()};
|
||||
Blockly.BlockSvg.prototype.setShadow=function(a){Blockly.BlockSvg.superClass_.setShadow.call(this,a);this.updateColour()};Blockly.BlockSvg.prototype.getSvgRoot=function(){return this.svgGroup_};
|
||||
Blockly.BlockSvg.prototype.dispose=function(a,b){if(this.workspace){Blockly.Tooltip.hide();Blockly.Field.startCache();var c=this.workspace;Blockly.selected==this&&(this.unselect(),this.workspace.cancelCurrentGesture());Blockly.ContextMenu.currentBlock==this&&Blockly.ContextMenu.hide();b&&this.rendered&&(this.unplug(a),this.disposeUiEffect());this.rendered=!1;Blockly.Events.disable();try{for(var d=this.getIcons(),e=0;e<d.length;e++)d[e].dispose()}finally{Blockly.Events.enable()}Blockly.BlockSvg.superClass_.dispose.call(this,
|
||||
a);goog.dom.removeNode(this.svgGroup_);c.resizeContents();this.svgPathDark_=this.svgPathLight_=this.svgPath_=this.svgGroup_=null;Blockly.Field.stopCache()}};
|
||||
Blockly.BlockSvg.prototype.dispose=function(a,b){if(this.workspace){Blockly.Tooltip.hide();Blockly.Field.startCache();var c=this.workspace;Blockly.selected==this&&(this.unselect(),this.workspace.cancelCurrentGesture());Blockly.ContextMenu.currentBlock==this&&Blockly.ContextMenu.hide();b&&this.rendered&&(this.unplug(a),this.disposeUiEffect());this.rendered=!1;if(this.warningTextDb_){for(var d in this.warningTextDb_)clearTimeout(this.warningTextDb_[d]);this.warningTextDb_=null}Blockly.Events.disable();
|
||||
try{var e=this.getIcons();for(d=0;d<e.length;d++)e[d].dispose()}finally{Blockly.Events.enable()}Blockly.BlockSvg.superClass_.dispose.call(this,a);goog.dom.removeNode(this.svgGroup_);c.resizeContents();this.svgPathDark_=this.svgPathLight_=this.svgPath_=this.svgGroup_=null;Blockly.Field.stopCache()}};
|
||||
Blockly.BlockSvg.prototype.disposeUiEffect=function(){this.workspace.getAudioManager().play("delete");var a=this.workspace.getSvgXY(this.svgGroup_),b=this.svgGroup_.cloneNode(!0);b.translateX_=a.x;b.translateY_=a.y;b.setAttribute("transform","translate("+b.translateX_+","+b.translateY_+")");this.workspace.getParentSvg().appendChild(b);b.bBox_=b.getBBox();Blockly.BlockSvg.disposeUiStep_(b,this.RTL,new Date,this.workspace.scale)};
|
||||
Blockly.BlockSvg.disposeUiStep_=function(a,b,c,d){var e=(new Date-c)/150;1<e?goog.dom.removeNode(a):(a.setAttribute("transform","translate("+(a.translateX_+(b?-1:1)*a.bBox_.width*d/2*e)+","+(a.translateY_+a.bBox_.height*d*e)+") scale("+(1-e)*d+")"),setTimeout(Blockly.BlockSvg.disposeUiStep_,10,a,b,c,d))};
|
||||
Blockly.BlockSvg.prototype.connectionUiEffect=function(){this.workspace.getAudioManager().play("click");if(!(1>this.workspace.scale)){var a=this.workspace.getSvgXY(this.svgGroup_);this.outputConnection?(a.x+=(this.RTL?3:-3)*this.workspace.scale,a.y+=13*this.workspace.scale):this.previousConnection&&(a.x+=(this.RTL?-23:23)*this.workspace.scale,a.y+=3*this.workspace.scale);a=Blockly.utils.createSvgElement("circle",{cx:a.x,cy:a.y,r:0,fill:"none",stroke:"#888","stroke-width":10},this.workspace.getParentSvg());
|
||||
@@ -1323,16 +1324,16 @@ Blockly.BlockSvg.prototype.updateColour=function(){if(!this.disabled){var a=this
|
||||
b)}this.svgPath_.setAttribute("fill",a);a=this.getIcons();for(c=0;c<a.length;c++)a[c].updateColour();for(a=0;c=this.inputList[a];a++){b=0;for(var d;d=c.fieldRow[b];b++)d.setText(null)}}};
|
||||
Blockly.BlockSvg.prototype.updateDisabled=function(){this.disabled||this.getInheritedDisabled()?Blockly.utils.addClass(this.svgGroup_,"blocklyDisabled")&&this.svgPath_.setAttribute("fill","url(#"+this.workspace.options.disabledPatternId+")"):Blockly.utils.removeClass(this.svgGroup_,"blocklyDisabled")&&this.updateColour();for(var a=this.getChildren(),b=0,c;c=a[b];b++)c.updateDisabled()};
|
||||
Blockly.BlockSvg.prototype.getCommentText=function(){return this.comment?this.comment.getText().replace(/\s+$/,"").replace(/ +\n/g,"\n"):""};Blockly.BlockSvg.prototype.setCommentText=function(a){var b=!1;goog.isString(a)?(this.comment||(this.comment=new Blockly.Comment(this),b=!0),this.comment.setText(a)):this.comment&&(this.comment.dispose(),b=!0);b&&this.rendered&&(this.render(),this.bumpNeighbours_())};
|
||||
Blockly.BlockSvg.prototype.setWarningText=function(a,b){this.setWarningText.pid_||(this.setWarningText.pid_=Object.create(null));var c=b||"";if(c)this.setWarningText.pid_[c]&&(clearTimeout(this.setWarningText.pid_[c]),delete this.setWarningText.pid_[c]);else for(var d in this.setWarningText.pid_)clearTimeout(this.setWarningText.pid_[d]),delete this.setWarningText.pid_[d];if(this.workspace.isDragging()){var e=this;this.setWarningText.pid_[c]=setTimeout(function(){e.workspace&&(delete e.setWarningText.pid_[c],
|
||||
e.setWarningText(a,c))},100)}else{this.isInFlyout&&(a=null);d=this.getSurroundParent();for(var f=null;d;)d.isCollapsed()&&(f=d),d=d.getSurroundParent();f&&f.setWarningText(a,"collapsed "+this.id+" "+c);d=!1;goog.isString(a)?(this.warning||(this.warning=new Blockly.Warning(this),d=!0),this.warning.setText(a,c)):this.warning&&!c?(this.warning.dispose(),d=!0):this.warning&&(d=this.warning.getText(),this.warning.setText("",c),(f=this.warning.getText())||this.warning.dispose(),d=d!=f);d&&this.rendered&&
|
||||
(this.render(),this.bumpNeighbours_())}};Blockly.BlockSvg.prototype.setMutator=function(a){this.mutator&&this.mutator!==a&&this.mutator.dispose();a&&(a.block_=this,this.mutator=a,a.createIcon())};Blockly.BlockSvg.prototype.setDisabled=function(a){this.disabled!=a&&(Blockly.BlockSvg.superClass_.setDisabled.call(this,a),this.rendered&&this.updateDisabled())};
|
||||
Blockly.BlockSvg.prototype.setWarningText=function(a,b){this.warningTextDb_||(this.warningTextDb_=Object.create(null));var c=b||"";if(c)this.warningTextDb_[c]&&(clearTimeout(this.warningTextDb_[c]),delete this.warningTextDb_[c]);else for(var d in this.warningTextDb_)clearTimeout(this.warningTextDb_[d]),delete this.warningTextDb_[d];if(this.workspace.isDragging()){var e=this;this.warningTextDb_[c]=setTimeout(function(){e.workspace&&(delete e.warningTextDb_[c],e.setWarningText(a,c))},100)}else{this.isInFlyout&&
|
||||
(a=null);d=this.getSurroundParent();for(var f=null;d;)d.isCollapsed()&&(f=d),d=d.getSurroundParent();f&&f.setWarningText(a,"collapsed "+this.id+" "+c);d=!1;goog.isString(a)?(this.warning||(this.warning=new Blockly.Warning(this),d=!0),this.warning.setText(a,c)):this.warning&&!c?(this.warning.dispose(),d=!0):this.warning&&(d=this.warning.getText(),this.warning.setText("",c),(f=this.warning.getText())||this.warning.dispose(),d=d!=f);d&&this.rendered&&(this.render(),this.bumpNeighbours_())}};
|
||||
Blockly.BlockSvg.prototype.setMutator=function(a){this.mutator&&this.mutator!==a&&this.mutator.dispose();a&&(a.block_=this,this.mutator=a,a.createIcon())};Blockly.BlockSvg.prototype.setDisabled=function(a){this.disabled!=a&&(Blockly.BlockSvg.superClass_.setDisabled.call(this,a),this.rendered&&this.updateDisabled())};
|
||||
Blockly.BlockSvg.prototype.setHighlighted=function(a){this.rendered&&(a?(this.svgPath_.setAttribute("filter","url(#"+this.workspace.options.embossFilterId+")"),this.svgPathLight_.style.display="none"):(Blockly.utils.removeAttribute(this.svgPath_,"filter"),delete this.svgPathLight_.style.display))};Blockly.BlockSvg.prototype.addSelect=function(){Blockly.utils.addClass(this.svgGroup_,"blocklySelected")};Blockly.BlockSvg.prototype.removeSelect=function(){Blockly.utils.removeClass(this.svgGroup_,"blocklySelected")};
|
||||
Blockly.BlockSvg.prototype.setDeleteStyle=function(a){a?Blockly.utils.addClass(this.svgGroup_,"blocklyDraggingDelete"):Blockly.utils.removeClass(this.svgGroup_,"blocklyDraggingDelete")};Blockly.BlockSvg.prototype.setColour=function(a){Blockly.BlockSvg.superClass_.setColour.call(this,a);this.rendered&&this.updateColour()};Blockly.BlockSvg.prototype.bringToFront=function(){var a=this;do{var b=a.getSvgRoot();b.parentNode.appendChild(b);a=a.getParent()}while(a)};
|
||||
Blockly.BlockSvg.prototype.setPreviousStatement=function(a,b){Blockly.BlockSvg.superClass_.setPreviousStatement.call(this,a,b);this.rendered&&(this.render(),this.bumpNeighbours_())};Blockly.BlockSvg.prototype.setNextStatement=function(a,b){Blockly.BlockSvg.superClass_.setNextStatement.call(this,a,b);this.rendered&&(this.render(),this.bumpNeighbours_())};Blockly.BlockSvg.prototype.setOutput=function(a,b){Blockly.BlockSvg.superClass_.setOutput.call(this,a,b);this.rendered&&(this.render(),this.bumpNeighbours_())};
|
||||
Blockly.BlockSvg.prototype.setInputsInline=function(a){Blockly.BlockSvg.superClass_.setInputsInline.call(this,a);this.rendered&&(this.render(),this.bumpNeighbours_())};Blockly.BlockSvg.prototype.removeInput=function(a,b){Blockly.BlockSvg.superClass_.removeInput.call(this,a,b);this.rendered&&(this.render(),this.bumpNeighbours_())};Blockly.BlockSvg.prototype.moveNumberedInputBefore=function(a,b){Blockly.BlockSvg.superClass_.moveNumberedInputBefore.call(this,a,b);this.rendered&&(this.render(),this.bumpNeighbours_())};
|
||||
Blockly.BlockSvg.prototype.appendInput_=function(a,b){var c=Blockly.BlockSvg.superClass_.appendInput_.call(this,a,b);this.rendered&&(this.render(),this.bumpNeighbours_());return c};Blockly.BlockSvg.prototype.getConnections_=function(a){var b=[];if(a||this.rendered)if(this.outputConnection&&b.push(this.outputConnection),this.previousConnection&&b.push(this.previousConnection),this.nextConnection&&b.push(this.nextConnection),a||!this.collapsed_){a=0;for(var c;c=this.inputList[a];a++)c.connection&&b.push(c.connection)}return b};
|
||||
Blockly.BlockSvg.prototype.makeConnection_=function(a){return new Blockly.RenderedConnection(this,a)};
|
||||
Blockly.BlockSvg.prototype.bumpNeighbours_=function(){if(this.workspace&&Blockly.dragMode_==Blockly.DRAG_NONE){var a=this.getRootBlock();if(!a.isInFlyout)for(var b=this.getConnections_(!1),c=0,d;d=b[c];c++){d.isConnected()&&d.isSuperior()&&d.targetBlock().bumpNeighbours_();for(var e=d.neighbours_(Blockly.SNAP_RADIUS),f=0,g;g=e[f];f++)d.isConnected()&&g.isConnected()||g.getSourceBlock().getRootBlock()!=a&&(d.isSuperior()?g.bumpAwayFrom_(d):d.bumpAwayFrom_(g))}}};
|
||||
Blockly.BlockSvg.prototype.bumpNeighbours_=function(){if(this.workspace&&!this.workspace.isDragging()){var a=this.getRootBlock();if(!a.isInFlyout)for(var b=this.getConnections_(!1),c=0,d;d=b[c];c++){d.isConnected()&&d.isSuperior()&&d.targetBlock().bumpNeighbours_();for(var e=d.neighbours_(Blockly.SNAP_RADIUS),f=0,g;g=e[f];f++)d.isConnected()&&g.isConnected()||g.getSourceBlock().getRootBlock()!=a&&(d.isSuperior()?g.bumpAwayFrom_(d):d.bumpAwayFrom_(g))}}};
|
||||
Blockly.BlockSvg.prototype.scheduleSnapAndBump=function(){var a=this,b=Blockly.Events.getGroup();setTimeout(function(){Blockly.Events.setGroup(b);a.snapToGrid();Blockly.Events.setGroup(!1)},Blockly.BUMP_DELAY/2);setTimeout(function(){Blockly.Events.setGroup(b);a.bumpNeighbours_();Blockly.Events.setGroup(!1)},Blockly.BUMP_DELAY)};Blockly.BlockSvg.render={};Blockly.BlockSvg.SEP_SPACE_X=10;Blockly.BlockSvg.SEP_SPACE_Y=10;Blockly.BlockSvg.INLINE_PADDING_Y=5;Blockly.BlockSvg.MIN_BLOCK_Y=25;Blockly.BlockSvg.TAB_HEIGHT=20;Blockly.BlockSvg.TAB_WIDTH=8;Blockly.BlockSvg.NOTCH_WIDTH=30;Blockly.BlockSvg.CORNER_RADIUS=8;Blockly.BlockSvg.START_HAT=!1;Blockly.BlockSvg.START_HAT_HEIGHT=15;Blockly.BlockSvg.START_HAT_PATH="c 30,-"+Blockly.BlockSvg.START_HAT_HEIGHT+" 70,-"+Blockly.BlockSvg.START_HAT_HEIGHT+" 100,0";
|
||||
Blockly.BlockSvg.START_HAT_HIGHLIGHT_LTR="c 17.8,-9.2 45.3,-14.9 75,-8.7 M 100.5,0.5";Blockly.BlockSvg.START_HAT_HIGHLIGHT_RTL="m 25,-8.7 c 29.7,-6.2 57.2,-0.5 75,8.7";Blockly.BlockSvg.DISTANCE_45_INSIDE=(1-Math.SQRT1_2)*(Blockly.BlockSvg.CORNER_RADIUS-.5)+.5;Blockly.BlockSvg.DISTANCE_45_OUTSIDE=(1-Math.SQRT1_2)*(Blockly.BlockSvg.CORNER_RADIUS+.5)-.5;Blockly.BlockSvg.NOTCH_PATH_LEFT="l 6,4 3,0 6,-4";Blockly.BlockSvg.NOTCH_PATH_LEFT_HIGHLIGHT="l 6,4 3,0 6,-4";Blockly.BlockSvg.NOTCH_PATH_RIGHT="l -6,4 -3,0 -6,-4";
|
||||
Blockly.BlockSvg.JAGGED_TEETH="l 8,0 0,4 8,4 -16,8 8,4";Blockly.BlockSvg.JAGGED_TEETH_HEIGHT=20;Blockly.BlockSvg.JAGGED_TEETH_WIDTH=15;Blockly.BlockSvg.TAB_PATH_DOWN="v 5 c 0,10 -"+Blockly.BlockSvg.TAB_WIDTH+",-8 -"+Blockly.BlockSvg.TAB_WIDTH+",7.5 s "+Blockly.BlockSvg.TAB_WIDTH+",-2.5 "+Blockly.BlockSvg.TAB_WIDTH+",7.5";
|
||||
@@ -1370,27 +1371,28 @@ Blockly.BlockSvg.prototype.renderDrawLeft_=function(a,b){this.outputConnection?(
|
||||
Blockly.BlockSvg.TAB_WIDTH+",-0.5 q "+-.19*Blockly.BlockSvg.TAB_WIDTH+",-5.5 0,-11"),b.push("m",.92*Blockly.BlockSvg.TAB_WIDTH+",1 V 0.5 H 1")),this.width+=Blockly.BlockSvg.TAB_WIDTH):this.RTL||(this.squareTopLeftCorner_?b.push("V",.5):b.push("V",Blockly.BlockSvg.CORNER_RADIUS));a.push("z")};Blockly.Events={};Blockly.Events.group_="";Blockly.Events.recordUndo=!0;Blockly.Events.disabled_=0;Blockly.Events.CREATE="create";Blockly.Events.BLOCK_CREATE=Blockly.Events.CREATE;Blockly.Events.DELETE="delete";Blockly.Events.BLOCK_DELETE=Blockly.Events.DELETE;Blockly.Events.CHANGE="change";Blockly.Events.BLOCK_CHANGE=Blockly.Events.CHANGE;Blockly.Events.MOVE="move";Blockly.Events.BLOCK_MOVE=Blockly.Events.MOVE;Blockly.Events.VAR_CREATE="var_create";Blockly.Events.VAR_DELETE="var_delete";
|
||||
Blockly.Events.VAR_RENAME="var_rename";Blockly.Events.UI="ui";Blockly.Events.FIRE_QUEUE_=[];Blockly.Events.fire=function(a){Blockly.Events.isEnabled()&&(Blockly.Events.FIRE_QUEUE_.length||setTimeout(Blockly.Events.fireNow_,0),Blockly.Events.FIRE_QUEUE_.push(a))};Blockly.Events.fireNow_=function(){for(var a=Blockly.Events.filter(Blockly.Events.FIRE_QUEUE_,!0),b=Blockly.Events.FIRE_QUEUE_.length=0,c;c=a[b];b++){var d=Blockly.Workspace.getById(c.workspaceId);d&&d.fireChangeListener(c)}};
|
||||
Blockly.Events.filter=function(a,b){var c=goog.array.clone(a);b||c.reverse();for(var d=[],e=Object.create(null),f=0,g;g=c[f];f++)if(!g.isNull()){var h=[g.type,g.blockId,g.workspaceId].join(" "),k=e[h];k?g.type==Blockly.Events.MOVE?(k.newParentId=g.newParentId,k.newInputName=g.newInputName,k.newCoordinate=g.newCoordinate):g.type==Blockly.Events.CHANGE&&g.element==k.element&&g.name==k.name?k.newValue=g.newValue:g.type!=Blockly.Events.UI||"click"!=g.element||"commentOpen"!=k.element&&"mutatorOpen"!=
|
||||
k.element&&"warningOpen"!=k.element||(k.newValue=g.newValue):(e[h]=g,d.push(g))}c=d;b||c.reverse();for(f=1;g=c[f];f++)g.type==Blockly.Events.CHANGE&&"mutation"==g.element&&c.unshift(c.splice(f,1)[0]);return c};Blockly.Events.clearPendingUndo=function(){for(var a=0,b;b=Blockly.Events.FIRE_QUEUE_[a];a++)b.recordUndo=!1};Blockly.Events.disable=function(){Blockly.Events.disabled_++};Blockly.Events.enable=function(){Blockly.Events.disabled_--};Blockly.Events.isEnabled=function(){return 0==Blockly.Events.disabled_};
|
||||
Blockly.Events.getGroup=function(){return Blockly.Events.group_};Blockly.Events.setGroup=function(a){Blockly.Events.group_="boolean"==typeof a?a?Blockly.utils.genUid():"":a};Blockly.Events.getDescendantIds_=function(a){var b=[];a=a.getDescendants();for(var c=0,d;d=a[c];c++)b[c]=d.id;return b};
|
||||
Blockly.Events.fromJson=function(a,b){switch(a.type){case Blockly.Events.CREATE:var c=new Blockly.Events.Create(null);break;case Blockly.Events.DELETE:c=new Blockly.Events.Delete(null);break;case Blockly.Events.CHANGE:c=new Blockly.Events.Change(null);break;case Blockly.Events.MOVE:c=new Blockly.Events.Move(null);break;case Blockly.Events.VAR_CREATE:c=new Blockly.Events.VarCreate(null);break;case Blockly.Events.VAR_DELETE:c=new Blockly.Events.VarDelete(null);break;case Blockly.Events.VAR_RENAME:c=
|
||||
new Blockly.Events.VarRename(null);break;case Blockly.Events.UI:c=new Blockly.Events.Ui(null);break;default:throw"Unknown event type.";}c.fromJson(a);c.workspaceId=b.id;return c};Blockly.Events.Abstract=function(a){a instanceof Blockly.Block?(this.blockId=a.id,this.workspaceId=a.workspace.id):a instanceof Blockly.VariableModel&&(this.workspaceId=a.workspace.id,this.varId=a.getId());this.group=Blockly.Events.group_;this.recordUndo=Blockly.Events.recordUndo};
|
||||
k.element&&"warningOpen"!=k.element?(e[h]=g,d.push(g)):k.newValue=g.newValue:(e[h]=g,d.push(g))}c=d.filter(function(a){return!a.isNull()});b||c.reverse();for(f=1;g=c[f];f++)g.type==Blockly.Events.CHANGE&&"mutation"==g.element&&c.unshift(c.splice(f,1)[0]);return c};Blockly.Events.clearPendingUndo=function(){for(var a=0,b;b=Blockly.Events.FIRE_QUEUE_[a];a++)b.recordUndo=!1};Blockly.Events.disable=function(){Blockly.Events.disabled_++};Blockly.Events.enable=function(){Blockly.Events.disabled_--};
|
||||
Blockly.Events.isEnabled=function(){return 0==Blockly.Events.disabled_};Blockly.Events.getGroup=function(){return Blockly.Events.group_};Blockly.Events.setGroup=function(a){Blockly.Events.group_="boolean"==typeof a?a?Blockly.utils.genUid():"":a};Blockly.Events.getDescendantIds_=function(a){var b=[];a=a.getDescendants();for(var c=0,d;d=a[c];c++)b[c]=d.id;return b};
|
||||
Blockly.Events.fromJson=function(a,b){switch(a.type){case Blockly.Events.CREATE:var c=new Blockly.Events.Create(null);break;case Blockly.Events.DELETE:c=new Blockly.Events.Delete(null);break;case Blockly.Events.CHANGE:c=new Blockly.Events.Change(null,"","","","");break;case Blockly.Events.MOVE:c=new Blockly.Events.Move(null);break;case Blockly.Events.VAR_CREATE:c=new Blockly.Events.VarCreate(null);break;case Blockly.Events.VAR_DELETE:c=new Blockly.Events.VarDelete(null);break;case Blockly.Events.VAR_RENAME:c=
|
||||
new Blockly.Events.VarRename(null,"");break;case Blockly.Events.UI:c=new Blockly.Events.Ui(null);break;default:throw"Unknown event type.";}c.fromJson(a);c.workspaceId=b.id;return c};
|
||||
Blockly.Events.Abstract=function(a){this.recordUndo=this.group=this.workspaceId=this.varId=this.blockId=void 0;a instanceof Blockly.Block?(this.blockId=a.id,this.workspaceId=a.workspace.id):a instanceof Blockly.VariableModel&&(this.workspaceId=a.workspace.id,this.varId=a.getId());this.group=Blockly.Events.group_;this.recordUndo=Blockly.Events.recordUndo};
|
||||
Blockly.Events.Abstract.prototype.toJson=function(){var a={type:this.type};this.blockId&&(a.blockId=this.blockId);this.varId&&(a.varId=this.varId);this.group&&(a.group=this.group);return a};Blockly.Events.Abstract.prototype.fromJson=function(a){this.blockId=a.blockId;this.varId=a.varId;this.group=a.group};Blockly.Events.Abstract.prototype.isNull=function(){return!1};Blockly.Events.Abstract.prototype.run=function(a){};
|
||||
Blockly.Events.Abstract.prototype.getEventWorkspace_=function(){var a=Blockly.Workspace.getById(this.workspaceId);if(!a)throw Error("Workspace is null. Event must have been generated from real Blockly events.");return a};Blockly.Events.Create=function(a){a&&(Blockly.Events.Create.superClass_.constructor.call(this,a),this.xml=a.workspace.rendered?Blockly.Xml.blockToDomWithXY(a):Blockly.Xml.blockToDom(a),this.ids=Blockly.Events.getDescendantIds_(a))};goog.inherits(Blockly.Events.Create,Blockly.Events.Abstract);
|
||||
Blockly.Events.BlockCreate=Blockly.Events.Create;Blockly.Events.Create.prototype.type=Blockly.Events.CREATE;Blockly.Events.Create.prototype.toJson=function(){var a=Blockly.Events.Create.superClass_.toJson.call(this);a.xml=Blockly.Xml.domToText(this.xml);a.ids=this.ids;return a};Blockly.Events.Create.prototype.fromJson=function(a){Blockly.Events.Create.superClass_.fromJson.call(this,a);this.xml=Blockly.Xml.textToDom("<xml>"+a.xml+"</xml>").firstChild;this.ids=a.ids};
|
||||
Blockly.Events.Create.prototype.run=function(a){var b=this.getEventWorkspace_();if(a)a=goog.dom.createDom("xml"),a.appendChild(this.xml),Blockly.Xml.domToWorkspace(a,b);else{a=0;for(var c;c=this.ids[a];a++){var d=b.getBlockById(c);d?d.dispose(!1,!1):c==this.blockId&&console.warn("Can't uncreate non-existant block: "+c)}}};
|
||||
Blockly.Events.Create.prototype.run=function(a){var b=this.getEventWorkspace_();if(a)a=goog.dom.createDom("xml"),a.appendChild(this.xml),Blockly.Xml.domToWorkspace(a,b);else{a=0;for(var c;c=this.ids[a];a++){var d=b.getBlockById(c);d?d.dispose(!1,!1):c==this.blockId&&console.warn("Can't uncreate non-existent block: "+c)}}};
|
||||
Blockly.Events.Delete=function(a){if(a){if(a.getParent())throw"Connected blocks cannot be deleted.";Blockly.Events.Delete.superClass_.constructor.call(this,a);this.oldXml=a.workspace.rendered?Blockly.Xml.blockToDomWithXY(a):Blockly.Xml.blockToDom(a);this.ids=Blockly.Events.getDescendantIds_(a)}};goog.inherits(Blockly.Events.Delete,Blockly.Events.Abstract);Blockly.Events.BlockDelete=Blockly.Events.Delete;Blockly.Events.Delete.prototype.type=Blockly.Events.DELETE;
|
||||
Blockly.Events.Delete.prototype.toJson=function(){var a=Blockly.Events.Delete.superClass_.toJson.call(this);a.ids=this.ids;return a};Blockly.Events.Delete.prototype.fromJson=function(a){Blockly.Events.Delete.superClass_.fromJson.call(this,a);this.ids=a.ids};
|
||||
Blockly.Events.Delete.prototype.run=function(a){var b=this.getEventWorkspace_();if(a){a=0;for(var c;c=this.ids[a];a++){var d=b.getBlockById(c);d?d.dispose(!1,!1):c==this.blockId&&console.warn("Can't delete non-existant block: "+c)}}else a=goog.dom.createDom("xml"),a.appendChild(this.oldXml),Blockly.Xml.domToWorkspace(a,b)};Blockly.Events.Change=function(a,b,c,d,e){a&&(Blockly.Events.Change.superClass_.constructor.call(this,a),this.element=b,this.name=c,this.oldValue=d,this.newValue=e)};
|
||||
Blockly.Events.Delete.prototype.run=function(a){var b=this.getEventWorkspace_();if(a){a=0;for(var c;c=this.ids[a];a++){var d=b.getBlockById(c);d?d.dispose(!1,!1):c==this.blockId&&console.warn("Can't delete non-existent block: "+c)}}else a=goog.dom.createDom("xml"),a.appendChild(this.oldXml),Blockly.Xml.domToWorkspace(a,b)};Blockly.Events.Change=function(a,b,c,d,e){a&&(Blockly.Events.Change.superClass_.constructor.call(this,a),this.element=b,this.name=c,this.oldValue=d,this.newValue=e)};
|
||||
goog.inherits(Blockly.Events.Change,Blockly.Events.Abstract);Blockly.Events.BlockChange=Blockly.Events.Change;Blockly.Events.Change.prototype.type=Blockly.Events.CHANGE;Blockly.Events.Change.prototype.toJson=function(){var a=Blockly.Events.Change.superClass_.toJson.call(this);a.element=this.element;this.name&&(a.name=this.name);a.newValue=this.newValue;return a};
|
||||
Blockly.Events.Change.prototype.fromJson=function(a){Blockly.Events.Change.superClass_.fromJson.call(this,a);this.element=a.element;this.name=a.name;this.newValue=a.newValue};Blockly.Events.Change.prototype.isNull=function(){return this.oldValue==this.newValue};
|
||||
Blockly.Events.Change.prototype.run=function(a){var b=this.getEventWorkspace_().getBlockById(this.blockId);if(b)switch(b.mutator&&b.mutator.setVisible(!1),a=a?this.newValue:this.oldValue,this.element){case "field":(b=b.getField(this.name))?(b.callValidator(a),b.setValue(a)):console.warn("Can't set non-existant field: "+this.name);break;case "comment":b.setCommentText(a||null);break;case "collapsed":b.setCollapsed(a);break;case "disabled":b.setDisabled(a);break;case "inline":b.setInputsInline(a);break;
|
||||
case "mutation":var c="";b.mutationToDom&&(c=(c=b.mutationToDom())&&Blockly.Xml.domToText(c));if(b.domToMutation){a=a||"<mutation></mutation>";var d=Blockly.Xml.textToDom("<xml>"+a+"</xml>");b.domToMutation(d.firstChild)}Blockly.Events.fire(new Blockly.Events.Change(b,"mutation",null,c,a));break;default:console.warn("Unknown change type: "+this.element)}else console.warn("Can't change non-existant block: "+this.blockId)};
|
||||
Blockly.Events.Change.prototype.run=function(a){var b=this.getEventWorkspace_().getBlockById(this.blockId);if(b)switch(b.mutator&&b.mutator.setVisible(!1),a=a?this.newValue:this.oldValue,this.element){case "field":(b=b.getField(this.name))?(b.callValidator(a),b.setValue(a)):console.warn("Can't set non-existent field: "+this.name);break;case "comment":b.setCommentText(a||null);break;case "collapsed":b.setCollapsed(a);break;case "disabled":b.setDisabled(a);break;case "inline":b.setInputsInline(a);break;
|
||||
case "mutation":var c="";b.mutationToDom&&(c=(c=b.mutationToDom())&&Blockly.Xml.domToText(c));if(b.domToMutation){a=a||"<mutation></mutation>";var d=Blockly.Xml.textToDom("<xml>"+a+"</xml>");b.domToMutation(d.firstChild)}Blockly.Events.fire(new Blockly.Events.Change(b,"mutation",null,c,a));break;default:console.warn("Unknown change type: "+this.element)}else console.warn("Can't change non-existent block: "+this.blockId)};
|
||||
Blockly.Events.Move=function(a){a&&(Blockly.Events.Move.superClass_.constructor.call(this,a),a=this.currentLocation_(),this.oldParentId=a.parentId,this.oldInputName=a.inputName,this.oldCoordinate=a.coordinate)};goog.inherits(Blockly.Events.Move,Blockly.Events.Abstract);Blockly.Events.BlockMove=Blockly.Events.Move;Blockly.Events.Move.prototype.type=Blockly.Events.MOVE;
|
||||
Blockly.Events.Move.prototype.toJson=function(){var a=Blockly.Events.Move.superClass_.toJson.call(this);this.newParentId&&(a.newParentId=this.newParentId);this.newInputName&&(a.newInputName=this.newInputName);this.newCoordinate&&(a.newCoordinate=Math.round(this.newCoordinate.x)+","+Math.round(this.newCoordinate.y));return a};
|
||||
Blockly.Events.Move.prototype.fromJson=function(a){Blockly.Events.Move.superClass_.fromJson.call(this,a);this.newParentId=a.newParentId;this.newInputName=a.newInputName;a.newCoordinate&&(a=a.newCoordinate.split(","),this.newCoordinate=new goog.math.Coordinate(parseFloat(a[0]),parseFloat(a[1])))};Blockly.Events.Move.prototype.recordNew=function(){var a=this.currentLocation_();this.newParentId=a.parentId;this.newInputName=a.inputName;this.newCoordinate=a.coordinate};
|
||||
Blockly.Events.Move.prototype.currentLocation_=function(){var a=Blockly.Workspace.getById(this.workspaceId).getBlockById(this.blockId),b={},c=a.getParent();if(c){if(b.parentId=c.id,a=c.getInputWithBlock(a))b.inputName=a.name}else b.coordinate=a.getRelativeToSurfaceXY();return b};Blockly.Events.Move.prototype.isNull=function(){return this.oldParentId==this.newParentId&&this.oldInputName==this.newInputName&&goog.math.Coordinate.equals(this.oldCoordinate,this.newCoordinate)};
|
||||
Blockly.Events.Move.prototype.run=function(a){var b=this.getEventWorkspace_(),c=b.getBlockById(this.blockId);if(c){var d=a?this.newParentId:this.oldParentId,e=a?this.newInputName:this.oldInputName;a=a?this.newCoordinate:this.oldCoordinate;var f=null;if(d&&(f=b.getBlockById(d),!f)){console.warn("Can't connect to non-existant block: "+d);return}c.getParent()&&c.unplug();if(a)e=c.getRelativeToSurfaceXY(),c.moveBy(a.x-e.x,a.y-e.y);else{c=c.outputConnection||c.previousConnection;if(e){if(b=f.getInput(e))var g=
|
||||
b.connection}else c.type==Blockly.PREVIOUS_STATEMENT&&(g=f.nextConnection);g?c.connect(g):console.warn("Can't connect to non-existant input: "+e)}}else console.warn("Can't move non-existant block: "+this.blockId)};Blockly.Events.Ui=function(a,b,c,d){Blockly.Events.Ui.superClass_.constructor.call(this,a);this.element=b;this.oldValue=c;this.newValue=d;this.recordUndo=!1};goog.inherits(Blockly.Events.Ui,Blockly.Events.Abstract);Blockly.Events.Ui.prototype.type=Blockly.Events.UI;
|
||||
Blockly.Events.Move.prototype.run=function(a){var b=this.getEventWorkspace_(),c=b.getBlockById(this.blockId);if(c){var d=a?this.newParentId:this.oldParentId,e=a?this.newInputName:this.oldInputName;a=a?this.newCoordinate:this.oldCoordinate;var f=null;if(d&&(f=b.getBlockById(d),!f)){console.warn("Can't connect to non-existent block: "+d);return}c.getParent()&&c.unplug();if(a)e=c.getRelativeToSurfaceXY(),c.moveBy(a.x-e.x,a.y-e.y);else{c=c.outputConnection||c.previousConnection;if(e){if(b=f.getInput(e))var g=
|
||||
b.connection}else c.type==Blockly.PREVIOUS_STATEMENT&&(g=f.nextConnection);g?c.connect(g):console.warn("Can't connect to non-existent input: "+e)}}else console.warn("Can't move non-existent block: "+this.blockId)};Blockly.Events.Ui=function(a,b,c,d){Blockly.Events.Ui.superClass_.constructor.call(this,a);this.element=b;this.oldValue=c;this.newValue=d;this.recordUndo=!1};goog.inherits(Blockly.Events.Ui,Blockly.Events.Abstract);Blockly.Events.Ui.prototype.type=Blockly.Events.UI;
|
||||
Blockly.Events.Ui.prototype.toJson=function(){var a=Blockly.Events.Ui.superClass_.toJson.call(this);a.element=this.element;void 0!==this.newValue&&(a.newValue=this.newValue);return a};Blockly.Events.Ui.prototype.fromJson=function(a){Blockly.Events.Ui.superClass_.fromJson.call(this,a);this.element=a.element;this.newValue=a.newValue};Blockly.Events.VarCreate=function(a){a&&(Blockly.Events.VarCreate.superClass_.constructor.call(this,a),this.varType=a.type,this.varName=a.name)};
|
||||
goog.inherits(Blockly.Events.VarCreate,Blockly.Events.Abstract);Blockly.Events.VarCreate.prototype.type=Blockly.Events.VAR_CREATE;Blockly.Events.VarCreate.prototype.toJson=function(){var a=Blockly.Events.VarCreate.superClass_.toJson.call(this);a.varType=this.varType;a.varName=this.varName;return a};Blockly.Events.VarCreate.prototype.fromJson=function(a){Blockly.Events.VarCreate.superClass_.fromJson.call(this,a);this.varType=a.varType;this.varName=a.varName};
|
||||
Blockly.Events.VarCreate.prototype.run=function(a){var b=this.getEventWorkspace_();a?b.createVariable(this.varName,this.varType,this.varId):b.deleteVariableById(this.varId)};Blockly.Events.VarDelete=function(a){a&&(Blockly.Events.VarDelete.superClass_.constructor.call(this,a),this.varType=a.type,this.varName=a.name)};goog.inherits(Blockly.Events.VarDelete,Blockly.Events.Abstract);Blockly.Events.VarDelete.prototype.type=Blockly.Events.VAR_DELETE;
|
||||
@@ -1406,7 +1408,7 @@ Blockly.FieldTextInput.prototype.unbindEvents_=function(a){Blockly.unbindEvent_(
|
||||
Blockly.FieldTextInput.prototype.onHtmlInputKeyDown_=function(a){var b=Blockly.FieldTextInput.htmlInput_;13==a.keyCode?Blockly.WidgetDiv.hide():27==a.keyCode?(b.value=b.defaultValue,Blockly.WidgetDiv.hide()):9==a.keyCode&&(Blockly.WidgetDiv.hide(),this.sourceBlock_.tab(this,!a.shiftKey),a.preventDefault())};
|
||||
Blockly.FieldTextInput.prototype.onHtmlInputChange_=function(a){a=Blockly.FieldTextInput.htmlInput_;var b=a.value;b!==a.oldValue_?(a.oldValue_=b,this.setValue(b),this.validate_()):goog.userAgent.WEBKIT&&this.sourceBlock_.render();this.resizeEditor_();Blockly.svgResize(this.sourceBlock_.workspace)};
|
||||
Blockly.FieldTextInput.prototype.validate_=function(){var a=!0;goog.asserts.assertObject(Blockly.FieldTextInput.htmlInput_);var b=Blockly.FieldTextInput.htmlInput_;this.sourceBlock_&&(a=this.callValidator(b.value));null===a?Blockly.utils.addClass(b,"blocklyInvalidInput"):Blockly.utils.removeClass(b,"blocklyInvalidInput")};
|
||||
Blockly.FieldTextInput.prototype.resizeEditor_=function(){var a=Blockly.WidgetDiv.DIV,b=this.fieldGroup_.getBBox();a.style.width=b.width*this.workspace_.scale+"px";a.style.height=b.height*this.workspace_.scale+"px";b=this.getAbsoluteXY_();if(this.sourceBlock_.RTL){var c=this.getScaledBBox_();b.x+=c.width;b.x-=a.offsetWidth}b.y+=1;goog.userAgent.GECKO&&Blockly.WidgetDiv.DIV.style.top&&(--b.x,--b.y);goog.userAgent.WEBKIT&&(b.y-=3);a.style.left=b.x+"px";a.style.top=b.y+"px"};
|
||||
Blockly.FieldTextInput.prototype.resizeEditor_=function(){var a=Blockly.WidgetDiv.DIV,b=this.getScaledBBox_();a.style.width=b.right-b.left+"px";a.style.height=b.bottom-b.top+"px";b=new goog.math.Coordinate(this.sourceBlock_.RTL?b.right-a.offsetWidth:b.left,b.top);b.y+=1;goog.userAgent.GECKO&&Blockly.WidgetDiv.DIV.style.top&&(--b.x,--b.y);goog.userAgent.WEBKIT&&(b.y-=3);a.style.left=b.x+"px";a.style.top=b.y+"px"};
|
||||
Blockly.FieldTextInput.prototype.widgetDispose_=function(){var a=this;return function(){var b=Blockly.FieldTextInput.htmlInput_;a.maybeSaveEdit_();a.unbindEvents_(b);Blockly.FieldTextInput.htmlInput_=null;Blockly.Events.setGroup(!1);b=Blockly.WidgetDiv.DIV.style;b.width="auto";b.height="auto";b.fontSize=""}};
|
||||
Blockly.FieldTextInput.prototype.maybeSaveEdit_=function(){var a=Blockly.FieldTextInput.htmlInput_,b=a.value;if(this.sourceBlock_)if(b=this.callValidator(b),null===b)b=a.defaultValue;else if(this.onFinishEditing_)this.onFinishEditing_(b);this.setText(b);this.sourceBlock_.rendered&&this.sourceBlock_.render()};
|
||||
Blockly.FieldTextInput.numberValidator=function(a){console.warn("Blockly.FieldTextInput.numberValidator is deprecated. Use Blockly.FieldNumber instead.");if(null===a)return null;a=String(a);a=a.replace(/O/ig,"0");a=a.replace(/,/g,"");a=parseFloat(a||0);return isNaN(a)?null:String(a)};Blockly.FieldTextInput.nonnegativeIntegerValidator=function(a){(a=Blockly.FieldTextInput.numberValidator(a))&&(a=String(Math.max(0,Math.floor(a))));return a};Blockly.FieldAngle=function(a,b){this.symbol_=Blockly.utils.createSvgElement("tspan",{},null);this.symbol_.appendChild(document.createTextNode("\u00b0"));a=a&&!isNaN(a)?String(a):"0";Blockly.FieldAngle.superClass_.constructor.call(this,a,b)};goog.inherits(Blockly.FieldAngle,Blockly.FieldTextInput);Blockly.FieldAngle.ROUND=15;Blockly.FieldAngle.HALF=50;Blockly.FieldAngle.CLOCKWISE=!1;Blockly.FieldAngle.OFFSET=0;Blockly.FieldAngle.WRAP=360;Blockly.FieldAngle.RADIUS=Blockly.FieldAngle.HALF-1;
|
||||
@@ -1441,7 +1443,7 @@ Blockly.FieldDropdown.prototype.render_=function(){this.visible_?(this.sourceBlo
|
||||
Blockly.FieldDropdown.prototype.renderSelectedImage_=function(){this.imageElement_=Blockly.utils.createSvgElement("image",{y:5,height:this.imageJson_.height+"px",width:this.imageJson_.width+"px"},this.fieldGroup_);this.imageElement_.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",this.imageJson_.src);this.textElement_.appendChild(this.arrow_);var a=Blockly.Field.getCachedWidth(this.arrow_);this.size_.height=Number(this.imageJson_.height)+19;this.size_.width=Number(this.imageJson_.width)+
|
||||
a;this.sourceBlock_.RTL?(this.imageElement_.setAttribute("x",a),this.textElement_.setAttribute("x",-1)):(this.textElement_.setAttribute("text-anchor","end"),this.textElement_.setAttribute("x",this.size_.width+1))};
|
||||
Blockly.FieldDropdown.prototype.renderSelectedText_=function(){var a=document.createTextNode(this.getDisplayText_());this.textElement_.appendChild(a);this.sourceBlock_.RTL?this.textElement_.insertBefore(this.arrow_,this.textElement_.firstChild):this.textElement_.appendChild(this.arrow_);this.textElement_.setAttribute("text-anchor","start");this.textElement_.setAttribute("x",0);this.size_.height=Blockly.BlockSvg.MIN_BLOCK_Y;this.size_.width=Blockly.Field.getCachedWidth(this.textElement_)};
|
||||
Blockly.FieldDropdown.prototype.updateWidth=function(){if(this.imageJson_&&(goog.userAgent.IE||goog.userAgent.EDGE)){var a=Blockly.Field.getCachedWidth(this.arrow_);a=Number(this.imageJson_.width)+a+Blockly.BlockSvg.SEP_SPACE_X;this.borderRect_&&this.borderRect_.setAttribute("width",a);this.size_.width=a}else Blockly.Field.prototype.updateWidth.call(this)};Blockly.FieldDropdown.prototype.dispose=function(){Blockly.WidgetDiv.hideIfOwner(this);Blockly.FieldDropdown.superClass_.dispose.call(this)};Blockly.FieldImage=function(a,b,c,d,e){this.sourceBlock_=null;this.height_=Number(c);this.width_=Number(b);this.size_=new goog.math.Size(this.width_,this.height_+2*Blockly.BlockSvg.INLINE_PADDING_Y);this.text_=d||"";this.setValue(a);"function"===typeof e&&(this.clickHandler_=e)};goog.inherits(Blockly.FieldImage,Blockly.Field);Blockly.FieldImage.prototype.EDITABLE=!1;
|
||||
Blockly.FieldDropdown.prototype.updateWidth=function(){if(this.imageJson_&&(goog.userAgent.IE||goog.userAgent.EDGE)){var a=Blockly.Field.getCachedWidth(this.arrow_);a=Number(this.imageJson_.width)+a+Blockly.BlockSvg.SEP_SPACE_X;this.borderRect_&&this.borderRect_.setAttribute("width",a);this.size_.width=a}else Blockly.Field.prototype.updateWidth.call(this)};Blockly.FieldDropdown.prototype.dispose=function(){Blockly.WidgetDiv.hideIfOwner(this);Blockly.FieldDropdown.superClass_.dispose.call(this)};Blockly.FieldImage=function(a,b,c,d,e){this.sourceBlock_=null;this.height_=Number(c);this.width_=Number(b);this.size_=new goog.math.Size(this.width_,this.height_+2*Blockly.BlockSvg.INLINE_PADDING_Y);this.text_=d||"";this.setValue(a);"function"==typeof e&&(this.clickHandler_=e)};goog.inherits(Blockly.FieldImage,Blockly.Field);Blockly.FieldImage.prototype.EDITABLE=!1;
|
||||
Blockly.FieldImage.prototype.init=function(){this.fieldGroup_||(this.fieldGroup_=Blockly.utils.createSvgElement("g",{},null),this.visible_||(this.fieldGroup_.style.display="none"),this.imageElement_=Blockly.utils.createSvgElement("image",{height:this.height_+"px",width:this.width_+"px"},this.fieldGroup_),this.setValue(this.src_),this.sourceBlock_.getSvgRoot().appendChild(this.fieldGroup_),this.setTooltip(this.sourceBlock_),Blockly.Tooltip.bindMouseEvents(this.imageElement_),this.maybeAddClickHandler_())};
|
||||
Blockly.FieldImage.prototype.dispose=function(){goog.dom.removeNode(this.fieldGroup_);this.imageElement_=this.fieldGroup_=null};Blockly.FieldImage.prototype.maybeAddClickHandler_=function(){this.clickHandler_&&(this.mouseDownWrapper_=Blockly.bindEventWithChecks_(this.fieldGroup_,"mousedown",this,this.onMouseDown_))};Blockly.FieldImage.prototype.setTooltip=function(a){this.imageElement_.tooltip=a};Blockly.FieldImage.prototype.getValue=function(){return this.src_};
|
||||
Blockly.FieldImage.prototype.setValue=function(a){null!==a&&(this.src_=a,this.imageElement_&&this.imageElement_.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a||""))};Blockly.FieldImage.prototype.setText=function(a){null!==a&&(this.text_=a)};Blockly.FieldImage.prototype.render_=function(){};Blockly.FieldImage.prototype.updateWidth=function(){};Blockly.FieldImage.prototype.showEditor_=function(){this.clickHandler_&&this.clickHandler_(this)};Blockly.FieldNumber=function(a,b,c,d,e){a=a&&!isNaN(a)?String(a):"0";Blockly.FieldNumber.superClass_.constructor.call(this,a,e);this.setConstraints(b,c,d)};goog.inherits(Blockly.FieldNumber,Blockly.FieldTextInput);Blockly.FieldNumber.prototype.setConstraints=function(a,b,c){c=parseFloat(c);this.precision_=isNaN(c)?0:c;a=parseFloat(a);this.min_=isNaN(a)?-Infinity:a;b=parseFloat(b);this.max_=isNaN(b)?Infinity:b;this.setValue(this.callValidator(this.getValue()))};
|
||||
@@ -1451,9 +1453,9 @@ Blockly.Variables.flyoutCategory=function(a){var b=[],c=goog.dom.createDom("butt
|
||||
Blockly.Variables.flyoutCategoryBlocks=function(a){a=a.getVariablesOfType("");a.sort(Blockly.VariableModel.compareByName);var b=[];if(0<a.length){var c=a[0];if(Blockly.Blocks.variables_set){var d=Blockly.Blocks.math_change?8:24;d='<xml><block type="variables_set" gap="'+d+'">'+Blockly.Variables.generateVariableFieldXml_(c)+"</block></xml>";d=Blockly.Xml.textToDom(d).firstChild;b.push(d)}Blockly.Blocks.math_change&&(d=Blockly.Blocks.variables_get?20:8,d='<xml><block type="math_change" gap="'+d+'">'+
|
||||
Blockly.Variables.generateVariableFieldXml_(c)+'<value name="DELTA"><shadow type="math_number"><field name="NUM">1</field></shadow></value></block></xml>',d=Blockly.Xml.textToDom(d).firstChild,b.push(d));for(c=0;d=a[c];c++)Blockly.Blocks.variables_get&&(d='<xml><block type="variables_get" gap="8">'+Blockly.Variables.generateVariableFieldXml_(d)+"</block></xml>",d=Blockly.Xml.textToDom(d).firstChild,b.push(d))}return b};
|
||||
Blockly.Variables.generateUniqueName=function(a){a=a.getAllVariables();var b="";if(a.length)for(var c=1,d=0,e="ijkmnopqrstuvwxyzabcdefgh".charAt(d);!b;){for(var f=!1,g=0;g<a.length;g++)if(a[g].name.toLowerCase()==e){f=!0;break}f?(d++,25==d&&(d=0,c++),e="ijkmnopqrstuvwxyzabcdefgh".charAt(d),1<c&&(e+=c)):b=e}else b="i";return b};
|
||||
Blockly.Variables.createVariable=function(a,b,c){var d=function(e){Blockly.Variables.promptName(Blockly.Msg.NEW_VARIABLE_TITLE,e,function(e){e?a.getVariable(e)?Blockly.alert(Blockly.Msg.VARIABLE_ALREADY_EXISTS.replace("%1",e.toLowerCase()),function(){d(e)}):Blockly.Procedures.isNameUsed(e,a)?Blockly.alert(Blockly.Msg.PROCEDURE_ALREADY_EXISTS.replace("%1",e.toLowerCase()),function(){d(e)}):(a.createVariable(e,c),b&&b(e)):b&&b(null)})};d("")};
|
||||
Blockly.Variables.renameVariable=function(a,b,c){var d=function(e){Blockly.Variables.promptName(Blockly.Msg.RENAME_VARIABLE_TITLE.replace("%1",b.name),e,function(e){if(e){var f=a.getVariable(e);f&&f.type!=b.type?Blockly.alert(Blockly.Msg.VARIABLE_ALREADY_EXISTS_FOR_ANOTHER_TYPE.replace("%1",e.toLowerCase()).replace("%2",f.type),function(){d(e)}):Blockly.Procedures.isNameUsed(e,a)?Blockly.alert(Blockly.Msg.PROCEDURE_ALREADY_EXISTS.replace("%1",e.toLowerCase()),function(){d(e)}):(a.renameVariable(b.name,
|
||||
e),c&&c(e))}else c&&c(null)})};d("")};Blockly.Variables.promptName=function(a,b,c){Blockly.prompt(a,b,function(a){a&&(a=a.replace(/[\s\xa0]+/g," ").replace(/^ | $/g,""),a==Blockly.Msg.RENAME_VARIABLE||a==Blockly.Msg.NEW_VARIABLE)&&(a=null);c(a)})};Blockly.Variables.generateVariableFieldXml_=function(a){var b=goog.dom.createDom("field");b.setAttribute("name","VAR");b.setAttribute("variableType",a.type);b.setAttribute("id",a.getId());b.textContent=a.name;return Blockly.Xml.domToText(b)};Blockly.FieldVariable=function(a,b,c){Blockly.FieldVariable.superClass_.constructor.call(this,Blockly.FieldVariable.dropdownCreate,b);this.setValue(a||"");this.variableTypes=c};goog.inherits(Blockly.FieldVariable,Blockly.FieldDropdown);Blockly.FieldVariable.prototype.init=function(){this.fieldGroup_||(Blockly.FieldVariable.superClass_.init.call(this),this.initModel())};
|
||||
Blockly.Variables.createVariable=function(a,b,c){var d=function(e){Blockly.Variables.promptName(Blockly.Msg.NEW_VARIABLE_TITLE,e,function(e){e?a.getVariable(e)?Blockly.alert(Blockly.Msg.VARIABLE_ALREADY_EXISTS.replace("%1",e.toLowerCase()),function(){d(e)}):(a.createVariable(e,c),b&&b(e)):b&&b(null)})};d("")};
|
||||
Blockly.Variables.renameVariable=function(a,b,c){var d=function(e){Blockly.Variables.promptName(Blockly.Msg.RENAME_VARIABLE_TITLE.replace("%1",b.name),e,function(e){if(e){var f=a.getVariable(e);f&&f.type!=b.type?Blockly.alert(Blockly.Msg.VARIABLE_ALREADY_EXISTS_FOR_ANOTHER_TYPE.replace("%1",e.toLowerCase()).replace("%2",f.type),function(){d(e)}):(a.renameVariable(b.name,e),c&&c(e))}else c&&c(null)})};d("")};
|
||||
Blockly.Variables.promptName=function(a,b,c){Blockly.prompt(a,b,function(a){a&&(a=a.replace(/[\s\xa0]+/g," ").replace(/^ | $/g,""),a==Blockly.Msg.RENAME_VARIABLE||a==Blockly.Msg.NEW_VARIABLE)&&(a=null);c(a)})};Blockly.Variables.generateVariableFieldXml_=function(a){var b=goog.dom.createDom("field");b.setAttribute("name","VAR");b.setAttribute("variabletype",a.type);b.setAttribute("id",a.getId());b.textContent=a.name;return Blockly.Xml.domToText(b)};Blockly.FieldVariable=function(a,b,c){Blockly.FieldVariable.superClass_.constructor.call(this,Blockly.FieldVariable.dropdownCreate,b);this.setValue(a||"");this.variableTypes=c};goog.inherits(Blockly.FieldVariable,Blockly.FieldDropdown);Blockly.FieldVariable.prototype.init=function(){this.fieldGroup_||(Blockly.FieldVariable.superClass_.init.call(this),this.initModel())};
|
||||
Blockly.FieldVariable.prototype.initModel=function(){this.getValue()||this.setValue(Blockly.Variables.generateUniqueName(this.sourceBlock_.isInFlyout?this.sourceBlock_.workspace.targetWorkspace:this.sourceBlock_.workspace));this.sourceBlock_.isInFlyout||this.sourceBlock_.workspace.createVariable(this.getValue())};
|
||||
Blockly.FieldVariable.prototype.setSourceBlock=function(a){goog.asserts.assert(!a.isShadow(),"Variable fields are not allowed to exist on shadow blocks.");Blockly.FieldVariable.superClass_.setSourceBlock.call(this,a)};Blockly.FieldVariable.prototype.getValue=function(){return this.getText()};
|
||||
Blockly.FieldVariable.prototype.setValue=function(a){var b=a,c=a;if(this.sourceBlock_){var d=this.sourceBlock_.workspace.getVariableById(a);if(d)c=d.name;else if(d=this.sourceBlock_.workspace.getVariable(a))b=d.getId();Blockly.Events.isEnabled()&&Blockly.Events.fire(new Blockly.Events.BlockChange(this.sourceBlock_,"field",this.name,this.value_,b))}this.value_=b;this.setText(c)};
|
||||
@@ -1468,7 +1470,7 @@ this.STATEMENT_PREFIX.replace(/%1/g,"'"+c+"'")+b);return this.scrub_(a,b)}if(nul
|
||||
Blockly.Generator.prototype.valueToCode=function(a,b,c){isNaN(c)&&goog.asserts.fail('Expecting valid order from block "%s".',a.type);var d=a.getInputTargetBlock(b);if(!d)return"";b=this.blockToCode(d);if(""===b)return"";goog.asserts.assertArray(b,'Expecting tuple from value block "%s".',d.type);a=b[0];b=b[1];isNaN(b)&&goog.asserts.fail('Expecting valid order from value block "%s".',d.type);if(!a)return"";d=!1;var e=Math.floor(c),f=Math.floor(b);if(e<=f&&(e!=f||0!=e&&99!=e))for(d=!0,e=0;e<this.ORDER_OVERRIDES.length;e++)if(this.ORDER_OVERRIDES[e][0]==
|
||||
c&&this.ORDER_OVERRIDES[e][1]==b){d=!1;break}d&&(a="("+a+")");return a};Blockly.Generator.prototype.statementToCode=function(a,b){var c=a.getInputTargetBlock(b),d=this.blockToCode(c);goog.asserts.assertString(d,'Expecting code from statement block "%s".',c&&c.type);d&&(d=this.prefixLines(d,this.INDENT));return d};
|
||||
Blockly.Generator.prototype.addLoopTrap=function(a,b){b=b.replace(/\$/g,"$$$$");this.INFINITE_LOOP_TRAP&&(a=this.INFINITE_LOOP_TRAP.replace(/%1/g,"'"+b+"'")+a);this.STATEMENT_PREFIX&&(a+=this.prefixLines(this.STATEMENT_PREFIX.replace(/%1/g,"'"+b+"'"),this.INDENT));return a};Blockly.Generator.prototype.RESERVED_WORDS_="";Blockly.Generator.prototype.addReservedWords=function(a){this.RESERVED_WORDS_+=a+","};Blockly.Generator.prototype.FUNCTION_NAME_PLACEHOLDER_="{leCUI8hutHZI4480Dc}";
|
||||
Blockly.Generator.prototype.provideFunction_=function(a,b){if(!this.definitions_[a]){var c=this.variableDB_.getDistinctName(a,Blockly.Procedures.NAME_TYPE);this.functionNames_[a]=c;c=b.join("\n").replace(this.FUNCTION_NAME_PLACEHOLDER_REGEXP_,c);for(var d;d!=c;)d=c,c=c.replace(/^(( )*) /gm,"$1\x00");c=c.replace(/\0/g,this.INDENT);this.definitions_[a]=c}return this.functionNames_[a]};Blockly.Generator.prototype.init=void 0;Blockly.Generator.prototype.scrub_=void 0;
|
||||
Blockly.Generator.prototype.provideFunction_=function(a,b){if(!this.definitions_[a]){var c=this.variableDB_.getDistinctName(a,Blockly.Procedures.NAME_TYPE);this.functionNames_[a]=c;c=b.join("\n").replace(this.FUNCTION_NAME_PLACEHOLDER_REGEXP_,c);for(var d;d!=c;)d=c,c=c.replace(/^(( {2})*) {2}/gm,"$1\x00");c=c.replace(/\0/g,this.INDENT);this.definitions_[a]=c}return this.functionNames_[a]};Blockly.Generator.prototype.init=void 0;Blockly.Generator.prototype.scrub_=void 0;
|
||||
Blockly.Generator.prototype.finish=void 0;Blockly.Generator.prototype.scrubNakedValue=void 0;Blockly.Names=function(a,b){this.variablePrefix_=b||"";this.reservedDict_=Object.create(null);if(a)for(var c=a.split(","),d=0;d<c.length;d++)this.reservedDict_[c[d]]=!0;this.reset()};Blockly.Names.prototype.reset=function(){this.db_=Object.create(null);this.dbReverse_=Object.create(null)};
|
||||
Blockly.Names.prototype.getName=function(a,b){var c=a.toLowerCase()+"_"+b,d=b==Blockly.Variables.NAME_TYPE?this.variablePrefix_:"";if(c in this.db_)return d+this.db_[c];var e=this.getDistinctName(a,b);this.db_[c]=e.substr(d.length);return e};Blockly.Names.prototype.getDistinctName=function(a,b){for(var c=this.safeName_(a),d="";this.dbReverse_[c+d]||c+d in this.reservedDict_;)d=d?d+1:2;c+=d;this.dbReverse_[c]=!0;return(b==Blockly.Variables.NAME_TYPE?this.variablePrefix_:"")+c};
|
||||
Blockly.Names.prototype.safeName_=function(a){a?(a=encodeURI(a.replace(/ /g,"_")).replace(/[^\w]/g,"_"),-1!="0123456789".indexOf(a[0])&&(a="my_"+a)):a="unnamed";return a};Blockly.Names.equals=function(a,b){return a.toLowerCase()==b.toLowerCase()};Blockly.Procedures={};Blockly.Procedures.NAME_TYPE=Blockly.PROCEDURE_CATEGORY_NAME;Blockly.Procedures.allProcedures=function(a){a=a.getAllBlocks();for(var b=[],c=[],d=0;d<a.length;d++)if(a[d].getProcedureDef){var e=a[d].getProcedureDef();e&&(e[2]?b.push(e):c.push(e))}c.sort(Blockly.Procedures.procTupleComparator_);b.sort(Blockly.Procedures.procTupleComparator_);return[c,b]};Blockly.Procedures.procTupleComparator_=function(a,b){return a[0].toLowerCase().localeCompare(b[0].toLowerCase())};
|
||||
@@ -1481,10 +1483,10 @@ Blockly.Procedures.mutateCallers=function(a){var b=Blockly.Events.recordUndo,c=a
|
||||
Blockly.Procedures.getDefinition=function(a,b){for(var c=b.getTopBlocks(!1),d=0;d<c.length;d++)if(c[d].getProcedureDef){var e=c[d].getProcedureDef();if(e&&Blockly.Names.equals(e[0],a))return c[d]}return null};Blockly.FlyoutButton=function(a,b,c,d){this.workspace_=a;this.targetWorkspace_=b;this.text_=c.getAttribute("text");this.position_=new goog.math.Coordinate(0,0);this.isLabel_=d;this.callback_=null;a=c.getAttribute("callbackKey");this.isLabel_&&a?console.warn("Labels should not have callbacks. Label text: "+this.text_):this.isLabel_||a&&b.getButtonCallback(a)?this.callback_=b.getButtonCallback(a):console.warn("Buttons should have callbacks. Button text: "+this.text_);this.cssClass_=c.getAttribute("web-class")||
|
||||
null};Blockly.FlyoutButton.MARGIN=5;Blockly.FlyoutButton.prototype.width=0;Blockly.FlyoutButton.prototype.height=0;Blockly.FlyoutButton.prototype.onMouseUpWrapper_=null;
|
||||
Blockly.FlyoutButton.prototype.createDom=function(){var a=this.isLabel_?"blocklyFlyoutLabel":"blocklyFlyoutButton";this.cssClass_&&(a+=" "+this.cssClass_);this.svgGroup_=Blockly.utils.createSvgElement("g",{"class":a},this.workspace_.getCanvas());if(!this.isLabel_)var b=Blockly.utils.createSvgElement("rect",{"class":"blocklyFlyoutButtonShadow",rx:4,ry:4,x:1,y:1},this.svgGroup_);a=Blockly.utils.createSvgElement("rect",{"class":this.isLabel_?"blocklyFlyoutLabelBackground":"blocklyFlyoutButtonBackground",
|
||||
rx:4,ry:4},this.svgGroup_);var c=Blockly.utils.createSvgElement("text",{"class":this.isLabel_?"blocklyFlyoutLabelText":"blocklyText",x:0,y:0,"text-anchor":"middle"},this.svgGroup_);c.textContent=this.text_;this.width=c.getComputedTextLength();this.height=20;this.isLabel_||(this.width+=2*Blockly.FlyoutButton.MARGIN,b.setAttribute("width",this.width),b.setAttribute("height",this.height));a.setAttribute("width",this.width);a.setAttribute("height",this.height);c.setAttribute("x",this.width/2);c.setAttribute("y",
|
||||
rx:4,ry:4},this.svgGroup_);var c=Blockly.utils.createSvgElement("text",{"class":this.isLabel_?"blocklyFlyoutLabelText":"blocklyText",x:0,y:0,"text-anchor":"middle"},this.svgGroup_);c.textContent=this.text_;this.width=Blockly.Field.getCachedWidth(c);this.height=20;this.isLabel_||(this.width+=2*Blockly.FlyoutButton.MARGIN,b.setAttribute("width",this.width),b.setAttribute("height",this.height));a.setAttribute("width",this.width);a.setAttribute("height",this.height);c.setAttribute("x",this.width/2);c.setAttribute("y",
|
||||
this.height-Blockly.FlyoutButton.MARGIN);this.updateTransform_();this.mouseUpWrapper_=Blockly.bindEventWithChecks_(this.svgGroup_,"mouseup",this,this.onMouseUp_);return this.svgGroup_};Blockly.FlyoutButton.prototype.show=function(){this.updateTransform_();this.svgGroup_.setAttribute("display","block")};Blockly.FlyoutButton.prototype.updateTransform_=function(){this.svgGroup_.setAttribute("transform","translate("+this.position_.x+","+this.position_.y+")")};
|
||||
Blockly.FlyoutButton.prototype.moveTo=function(a,b){this.position_.x=a;this.position_.y=b;this.updateTransform_()};Blockly.FlyoutButton.prototype.getTargetWorkspace=function(){return this.targetWorkspace_};Blockly.FlyoutButton.prototype.dispose=function(){this.onMouseUpWrapper_&&Blockly.unbindEvent_(this.onMouseUpWrapper_);this.svgGroup_&&(goog.dom.removeNode(this.svgGroup_),this.svgGroup_=null);this.targetWorkspace_=this.workspace_=null};
|
||||
Blockly.FlyoutButton.prototype.onMouseUp_=function(a){(a=this.targetWorkspace_.getGesture(a))&&a.cancel();this.callback_&&this.callback_(this)};Blockly.Flyout=function(a){a.getMetrics=this.getMetrics_.bind(this);a.setMetrics=this.setMetrics_.bind(this);this.workspace_=new Blockly.WorkspaceSvg(a);this.workspace_.isFlyout=!0;this.RTL=!!a.RTL;this.toolboxPosition_=a.toolboxPosition;this.eventWrappers_=[];this.backgroundButtons_=[];this.buttons_=[];this.listeners_=[];this.permanentlyDisabled_=[]};Blockly.Flyout.prototype.autoClose=!0;Blockly.Flyout.prototype.isVisible_=!1;Blockly.Flyout.prototype.containerVisible_=!0;
|
||||
Blockly.FlyoutButton.prototype.moveTo=function(a,b){this.position_.x=a;this.position_.y=b;this.updateTransform_()};Blockly.FlyoutButton.prototype.getPosition=function(){return this.position_};Blockly.FlyoutButton.prototype.getTargetWorkspace=function(){return this.targetWorkspace_};
|
||||
Blockly.FlyoutButton.prototype.dispose=function(){this.onMouseUpWrapper_&&Blockly.unbindEvent_(this.onMouseUpWrapper_);this.svgGroup_&&(goog.dom.removeNode(this.svgGroup_),this.svgGroup_=null);this.targetWorkspace_=this.workspace_=null};Blockly.FlyoutButton.prototype.onMouseUp_=function(a){(a=this.targetWorkspace_.getGesture(a))&&a.cancel();this.callback_&&this.callback_(this)};Blockly.Flyout=function(a){a.getMetrics=this.getMetrics_.bind(this);a.setMetrics=this.setMetrics_.bind(this);this.workspace_=new Blockly.WorkspaceSvg(a);this.workspace_.isFlyout=!0;this.RTL=!!a.RTL;this.toolboxPosition_=a.toolboxPosition;this.eventWrappers_=[];this.mats_=[];this.buttons_=[];this.listeners_=[];this.permanentlyDisabled_=[]};Blockly.Flyout.prototype.autoClose=!0;Blockly.Flyout.prototype.isVisible_=!1;Blockly.Flyout.prototype.containerVisible_=!0;
|
||||
Blockly.Flyout.prototype.CORNER_RADIUS=8;Blockly.Flyout.prototype.MARGIN=Blockly.Flyout.prototype.CORNER_RADIUS;Blockly.Flyout.prototype.GAP_X=3*Blockly.Flyout.prototype.MARGIN;Blockly.Flyout.prototype.GAP_Y=3*Blockly.Flyout.prototype.MARGIN;Blockly.Flyout.prototype.SCROLLBAR_PADDING=2;Blockly.Flyout.prototype.width_=0;Blockly.Flyout.prototype.height_=0;Blockly.Flyout.prototype.dragAngleRange_=70;
|
||||
Blockly.Flyout.prototype.createDom=function(a){this.svgGroup_=Blockly.utils.createSvgElement(a,{"class":"blocklyFlyout",style:"display: none"},null);this.svgBackground_=Blockly.utils.createSvgElement("path",{"class":"blocklyFlyoutBackground"},this.svgGroup_);this.svgGroup_.appendChild(this.workspace_.createDom());return this.svgGroup_};
|
||||
Blockly.Flyout.prototype.init=function(a){this.targetWorkspace_=a;this.workspace_.targetWorkspace=a;this.scrollbar_=new Blockly.Scrollbar(this.workspace_,this.horizontalLayout_,!1,"blocklyFlyoutScrollbar");this.hide();Array.prototype.push.apply(this.eventWrappers_,Blockly.bindEventWithChecks_(this.svgGroup_,"wheel",this,this.wheel_));this.autoClose||(this.filterWrapper_=this.filterForCapacity_.bind(this),this.targetWorkspace_.addChangeListener(this.filterWrapper_));Array.prototype.push.apply(this.eventWrappers_,
|
||||
@@ -1498,14 +1500,14 @@ Blockly.Flyout.prototype.hide=function(){if(this.isVisible()){this.setVisible(!1
|
||||
Blockly.Flyout.prototype.show=function(a){this.workspace_.setResizesEnabled(!1);this.hide();this.clearOldBlocks_();"string"==typeof a&&(a=this.workspace_.targetWorkspace.getToolboxCategoryCallback(a),goog.asserts.assert(goog.isFunction(a),"Couldn't find a callback function when opening a toolbox category."),a=a(this.workspace_.targetWorkspace),goog.asserts.assert(goog.isArray(a),"The result of a toolbox category callback must be an array."));this.setVisible(!0);for(var b=[],c=[],d=this.permanentlyDisabled_.length=
|
||||
0,e;e=a[d];d++)if(e.tagName){var f=e.tagName.toUpperCase(),g=this.horizontalLayout_?this.GAP_X:this.GAP_Y;if("BLOCK"==f)f=Blockly.Xml.domToBlock(e,this.workspace_),f.disabled&&this.permanentlyDisabled_.push(f),b.push({type:"block",block:f}),e=parseInt(e.getAttribute("gap"),10),c.push(isNaN(e)?g:e);else if("SEP"==e.tagName.toUpperCase())e=parseInt(e.getAttribute("gap"),10),!isNaN(e)&&0<c.length?c[c.length-1]=e:c.push(g);else if("BUTTON"==f||"LABEL"==f)e=new Blockly.FlyoutButton(this.workspace_,this.targetWorkspace_,
|
||||
e,"LABEL"==f),b.push({type:"button",button:e}),c.push(g)}this.layout_(b,c);this.listeners_.push(Blockly.bindEventWithChecks_(this.svgBackground_,"mouseover",this,function(){for(var a=this.workspace_.getTopBlocks(!1),b=0,c;c=a[b];b++)c.removeSelect()}));this.horizontalLayout_?this.height_=0:this.width_=0;this.workspace_.setResizesEnabled(!0);this.reflow();this.filterForCapacity_();this.position();this.reflowWrapper_=this.reflow.bind(this);this.workspace_.addChangeListener(this.reflowWrapper_)};
|
||||
Blockly.Flyout.prototype.clearOldBlocks_=function(){for(var a=this.workspace_.getTopBlocks(!1),b=0,c;c=a[b];b++)c.workspace==this.workspace_&&c.dispose(!1,!1);for(b=0;b<this.backgroundButtons_.length;b++)(a=this.backgroundButtons_[b])&&goog.dom.removeNode(a);for(b=this.backgroundButtons_.length=0;a=this.buttons_[b];b++)a.dispose();this.buttons_.length=0};
|
||||
Blockly.Flyout.prototype.clearOldBlocks_=function(){for(var a=this.workspace_.getTopBlocks(!1),b=0,c;c=a[b];b++)c.workspace==this.workspace_&&c.dispose(!1,!1);for(b=0;b<this.mats_.length;b++)(a=this.mats_[b])&&goog.dom.removeNode(a);for(b=this.mats_.length=0;a=this.buttons_[b];b++)a.dispose();this.buttons_.length=0};
|
||||
Blockly.Flyout.prototype.addBlockListeners_=function(a,b,c){this.listeners_.push(Blockly.bindEventWithChecks_(a,"mousedown",null,this.blockMouseDown_(b)));this.listeners_.push(Blockly.bindEventWithChecks_(c,"mousedown",null,this.blockMouseDown_(b)));this.listeners_.push(Blockly.bindEvent_(a,"mouseover",b,b.addSelect));this.listeners_.push(Blockly.bindEvent_(a,"mouseout",b,b.removeSelect));this.listeners_.push(Blockly.bindEvent_(c,"mouseover",b,b.addSelect));this.listeners_.push(Blockly.bindEvent_(c,
|
||||
"mouseout",b,b.removeSelect))};Blockly.Flyout.prototype.blockMouseDown_=function(a){var b=this;return function(c){var d=b.targetWorkspace_.getGesture(c);d&&(d.setStartBlock(a),d.handleFlyoutStart(c,b))}};Blockly.Flyout.prototype.onMouseDown_=function(a){var b=this.targetWorkspace_.getGesture(a);b&&b.handleFlyoutStart(a,this)};
|
||||
Blockly.Flyout.prototype.createBlock=function(a){var b=null;Blockly.Events.disable();this.targetWorkspace_.setResizesEnabled(!1);try{b=this.placeNewBlock_(a),Blockly.hideChaff()}finally{Blockly.Events.enable()}Blockly.Events.isEnabled()&&(Blockly.Events.setGroup(!0),Blockly.Events.fire(new Blockly.Events.Create(b)));this.autoClose?this.hide():this.filterForCapacity_();return b};
|
||||
Blockly.Flyout.prototype.initFlyoutButton_=function(a,b,c){var d=a.createDom();a.moveTo(b,c);a.show();this.listeners_.push(Blockly.bindEventWithChecks_(d,"mousedown",this,this.onMouseDown_));this.buttons_.push(a)};
|
||||
Blockly.Flyout.prototype.createRect_=function(a,b,c,d,e){b=Blockly.utils.createSvgElement("rect",{"fill-opacity":0,x:b,y:c,height:d.height,width:d.width},null);b.tooltip=a;Blockly.Tooltip.bindMouseEvents(b);this.workspace_.getCanvas().insertBefore(b,a.getSvgRoot());a.flyoutRect_=b;return this.backgroundButtons_[e]=b};
|
||||
Blockly.Flyout.prototype.createRect_=function(a,b,c,d,e){b=Blockly.utils.createSvgElement("rect",{"fill-opacity":0,x:b,y:c,height:d.height,width:d.width},null);b.tooltip=a;Blockly.Tooltip.bindMouseEvents(b);this.workspace_.getCanvas().insertBefore(b,a.getSvgRoot());a.flyoutRect_=b;return this.mats_[e]=b};
|
||||
Blockly.Flyout.prototype.moveRectToBlock_=function(a,b){var c=b.getHeightWidth();a.setAttribute("width",c.width);a.setAttribute("height",c.height);var d=b.startHat_?Blockly.BlockSvg.START_HAT_HEIGHT:0;d&&b.moveBy(0,d);d=b.outputConnection?Blockly.BlockSvg.TAB_WIDTH:0;var e=b.getRelativeToSurfaceXY();a.setAttribute("y",e.y);a.setAttribute("x",this.RTL?e.x-c.width+d:e.x-d)};
|
||||
Blockly.Flyout.prototype.filterForCapacity_=function(){for(var a=this.targetWorkspace_.remainingCapacity(),b=this.workspace_.getTopBlocks(!1),c=0,d;d=b[c];c++)if(-1==this.permanentlyDisabled_.indexOf(d)){var e=d.getDescendants();d.setDisabled(e.length>a)}};Blockly.Flyout.prototype.reflow=function(){this.reflowWrapper_&&this.workspace_.removeChangeListener(this.reflowWrapper_);var a=this.workspace_.getTopBlocks(!1);this.reflowInternal_(a);this.reflowWrapper_&&this.workspace_.addChangeListener(this.reflowWrapper_)};
|
||||
Blockly.Flyout.prototype.filterForCapacity_=function(){for(var a=this.targetWorkspace_.remainingCapacity(),b=this.workspace_.getTopBlocks(!1),c=0,d;d=b[c];c++)if(-1==this.permanentlyDisabled_.indexOf(d)){var e=d.getDescendants();d.setDisabled(e.length>a)}};Blockly.Flyout.prototype.reflow=function(){this.reflowWrapper_&&this.workspace_.removeChangeListener(this.reflowWrapper_);this.reflowInternal_();this.reflowWrapper_&&this.workspace_.addChangeListener(this.reflowWrapper_)};
|
||||
Blockly.Flyout.prototype.isScrollable=function(){return this.scrollbar_?this.scrollbar_.isVisible():!1};
|
||||
Blockly.Flyout.prototype.placeNewBlock_=function(a){var b=this.targetWorkspace_;if(!a.getSvgRoot())throw"oldBlock is not rendered.";var c=Blockly.Xml.blockToDom(a);b.setResizesEnabled(!1);c=Blockly.Xml.domToBlock(c,b);if(!c.getSvgRoot())throw"block is not rendered.";var d=b.getOriginOffsetInPixels(),e=this.workspace_.getOriginOffsetInPixels();a=a.getRelativeToSurfaceXY().scale(this.workspace_.scale);a=goog.math.Coordinate.sum(e,a);b=goog.math.Coordinate.difference(a,d).scale(1/b.scale);c.moveBy(b.x,
|
||||
b.y);return c};Blockly.HorizontalFlyout=function(a){a.getMetrics=this.getMetrics_.bind(this);a.setMetrics=this.setMetrics_.bind(this);Blockly.HorizontalFlyout.superClass_.constructor.call(this,a);this.horizontalLayout_=!0};goog.inherits(Blockly.HorizontalFlyout,Blockly.Flyout);
|
||||
@@ -1518,7 +1520,7 @@ Blockly.HorizontalFlyout.prototype.wheel_=function(a){var b=a.deltaX;if(b){goog.
|
||||
Blockly.HorizontalFlyout.prototype.layout_=function(a,b){this.workspace_.scale=this.targetWorkspace_.scale;var c=this.MARGIN,d=this.RTL?c:c+Blockly.BlockSvg.TAB_WIDTH;this.RTL&&(a=a.reverse());for(var e=0,f;f=a[e];e++)if("block"==f.type){f=f.block;for(var g=f.getDescendants(),h=0,k;k=g[h];h++)k.isInFlyout=!0;f.render();g=f.getSvgRoot();h=f.getHeightWidth();k=f.outputConnection?Blockly.BlockSvg.TAB_WIDTH:0;k=this.RTL?d+h.width:d+k;f.moveBy(k,c);k=this.createRect_(f,k,c,h,e);d+=h.width+b[e];this.addBlockListeners_(g,
|
||||
f,k)}else"button"==f.type&&(this.initFlyoutButton_(f.button,d,c),d+=f.button.width+b[e])};Blockly.HorizontalFlyout.prototype.isDragTowardWorkspace=function(a){a=Math.atan2(a.y,a.x)/Math.PI*180;var b=this.dragAngleRange_;if(this.toolboxPosition_==Blockly.TOOLBOX_AT_TOP){if(a<90+b&&a>90-b)return!0}else if(a>-90-b&&a<-90+b)return!0;return!1};
|
||||
Blockly.HorizontalFlyout.prototype.getClientRect=function(){if(!this.svgGroup_)return null;var a=this.svgGroup_.getBoundingClientRect(),b=a.top;a=a.height;if(this.toolboxPosition_==Blockly.TOOLBOX_AT_TOP)return new goog.math.Rect(-1E9,b-1E9,2E9,1E9+a);if(this.toolboxPosition_==Blockly.TOOLBOX_AT_BOTTOM)return new goog.math.Rect(-1E9,b,2E9,1E9+a)};
|
||||
Blockly.HorizontalFlyout.prototype.reflowInternal_=function(a){this.workspace_.scale=this.targetWorkspace_.scale;for(var b=0,c=0,d;d=a[c];c++)b=Math.max(b,d.getHeightWidth().height);b+=1.5*this.MARGIN;b*=this.workspace_.scale;b+=Blockly.Scrollbar.scrollbarThickness;if(this.height_!=b){for(c=0;d=a[c];c++)d.flyoutRect_&&this.moveRectToBlock_(d.flyoutRect_,d);this.height_=b;this.targetWorkspace_.resize()}};Blockly.VerticalFlyout=function(a){a.getMetrics=this.getMetrics_.bind(this);a.setMetrics=this.setMetrics_.bind(this);Blockly.VerticalFlyout.superClass_.constructor.call(this,a);this.horizontalLayout_=!1};goog.inherits(Blockly.VerticalFlyout,Blockly.Flyout);
|
||||
Blockly.HorizontalFlyout.prototype.reflowInternal_=function(){this.workspace_.scale=this.targetWorkspace_.scale;for(var a=0,b=this.workspace_.getTopBlocks(!1),c=0,d;d=b[c];c++)a=Math.max(a,d.getHeightWidth().height);a+=1.5*this.MARGIN;a*=this.workspace_.scale;a+=Blockly.Scrollbar.scrollbarThickness;if(this.height_!=a){for(c=0;d=b[c];c++)d.flyoutRect_&&this.moveRectToBlock_(d.flyoutRect_,d);this.height_=a;this.targetWorkspace_.resize()}};Blockly.VerticalFlyout=function(a){a.getMetrics=this.getMetrics_.bind(this);a.setMetrics=this.setMetrics_.bind(this);Blockly.VerticalFlyout.superClass_.constructor.call(this,a);this.horizontalLayout_=!1};goog.inherits(Blockly.VerticalFlyout,Blockly.Flyout);
|
||||
Blockly.VerticalFlyout.prototype.getMetrics_=function(){if(!this.isVisible())return null;try{var a=this.workspace_.getCanvas().getBBox()}catch(e){a={height:0,y:0,width:0,x:0}}var b=this.SCROLLBAR_PADDING,c=this.height_-2*this.SCROLLBAR_PADDING,d=this.width_;this.RTL||(d-=this.SCROLLBAR_PADDING);return{viewHeight:c,viewWidth:d,contentHeight:a.height*this.workspace_.scale+2*this.MARGIN,contentWidth:a.width*this.workspace_.scale+2*this.MARGIN,viewTop:-this.workspace_.scrollY+a.y,viewLeft:-this.workspace_.scrollX,
|
||||
contentTop:a.y,contentLeft:a.x,absoluteTop:b,absoluteLeft:0}};Blockly.VerticalFlyout.prototype.setMetrics_=function(a){var b=this.getMetrics_();b&&(goog.isNumber(a.y)&&(this.workspace_.scrollY=-b.contentHeight*a.y),this.workspace_.translate(this.workspace_.scrollX+b.absoluteLeft,this.workspace_.scrollY+b.absoluteTop))};
|
||||
Blockly.VerticalFlyout.prototype.position=function(){if(this.isVisible()){var a=this.targetWorkspace_.getMetrics();if(a){this.height_=a.viewHeight;this.setBackgroundPath_(this.width_-this.CORNER_RADIUS,a.viewHeight-2*this.CORNER_RADIUS);var b=a.absoluteTop,c=a.absoluteLeft;this.toolboxPosition_==Blockly.TOOLBOX_AT_RIGHT&&(c+=a.viewWidth-this.width_);this.positionAt_(this.width_,this.height_,c,b)}}};
|
||||
@@ -1527,8 +1529,8 @@ d.join(" "))};Blockly.VerticalFlyout.prototype.scrollToStart=function(){this.scr
|
||||
Blockly.VerticalFlyout.prototype.layout_=function(a,b){this.workspace_.scale=this.targetWorkspace_.scale;for(var c=this.MARGIN,d=this.RTL?c:c+Blockly.BlockSvg.TAB_WIDTH,e=0,f;f=a[e];e++)if("block"==f.type){f=f.block;for(var g=f.getDescendants(),h=0,k;k=g[h];h++)k.isInFlyout=!0;f.render();g=f.getSvgRoot();h=f.getHeightWidth();f.moveBy(d,c);k=this.createRect_(f,this.RTL?d-h.width:d,c,h,e);this.addBlockListeners_(g,f,k);c+=h.height+b[e]}else"button"==f.type&&(this.initFlyoutButton_(f.button,d,c),c+=
|
||||
f.button.height+b[e])};Blockly.VerticalFlyout.prototype.isDragTowardWorkspace=function(a){a=Math.atan2(a.y,a.x)/Math.PI*180;var b=this.dragAngleRange_;if(this.toolboxPosition_==Blockly.TOOLBOX_AT_LEFT){if(a<b&&a>-b)return!0}else if(a<-180+b||a>180-b)return!0;return!1};
|
||||
Blockly.VerticalFlyout.prototype.getClientRect=function(){if(!this.svgGroup_)return null;var a=this.svgGroup_.getBoundingClientRect(),b=a.left;a=a.width;return this.toolboxPosition_==Blockly.TOOLBOX_AT_LEFT?new goog.math.Rect(b-1E9,-1E9,1E9+a,2E9):new goog.math.Rect(b,-1E9,1E9+a,2E9)};
|
||||
Blockly.VerticalFlyout.prototype.reflowInternal_=function(a){this.workspace_.scale=this.targetWorkspace_.scale;for(var b=0,c=0,d;d=a[c];c++){var e=d.getHeightWidth().width;d.outputConnection&&(e-=Blockly.BlockSvg.TAB_WIDTH);b=Math.max(b,e)}for(c=0;d=this.buttons_[c];c++)b=Math.max(b,d.width);b+=1.5*this.MARGIN+Blockly.BlockSvg.TAB_WIDTH;b*=this.workspace_.scale;b+=Blockly.Scrollbar.scrollbarThickness;if(this.width_!=b){for(c=0;d=a[c];c++){if(this.RTL){e=d.getRelativeToSurfaceXY().x;var f=b/this.workspace_.scale-
|
||||
this.MARGIN;f-=Blockly.BlockSvg.TAB_WIDTH;d.moveBy(f-e,0)}d.flyoutRect_&&this.moveRectToBlock_(d.flyoutRect_,d)}this.width_=b;this.targetWorkspace_.resize()}};Blockly.Toolbox=function(a){this.workspace_=a;this.RTL=a.options.RTL;this.horizontalLayout_=a.options.horizontalLayout;this.toolboxPosition=a.options.toolboxPosition;this.config_={indentWidth:19,cssRoot:"blocklyTreeRoot",cssHideRoot:"blocklyHidden",cssItem:"",cssTreeRow:"blocklyTreeRow",cssItemLabel:"blocklyTreeLabel",cssTreeIcon:"blocklyTreeIcon",cssExpandedFolderIcon:"blocklyTreeIconOpen",cssFileIcon:"blocklyTreeIconNone",cssSelectedRow:"blocklyTreeSelected"};this.treeSeparatorConfig_={cssTreeRow:"blocklyTreeSeparator"};
|
||||
Blockly.VerticalFlyout.prototype.reflowInternal_=function(){this.workspace_.scale=this.targetWorkspace_.scale;for(var a=0,b=this.workspace_.getTopBlocks(!1),c=0,d;d=b[c];c++){var e=d.getHeightWidth().width;d.outputConnection&&(e-=Blockly.BlockSvg.TAB_WIDTH);a=Math.max(a,e)}for(c=0;d=this.buttons_[c];c++)a=Math.max(a,d.width);a+=1.5*this.MARGIN+Blockly.BlockSvg.TAB_WIDTH;a*=this.workspace_.scale;a+=Blockly.Scrollbar.scrollbarThickness;if(this.width_!=a){for(c=0;d=b[c];c++)this.RTL&&(e=d.getRelativeToSurfaceXY().x,
|
||||
d.moveBy(a/this.workspace_.scale-this.MARGIN-Blockly.BlockSvg.TAB_WIDTH-e,0)),d.flyoutRect_&&this.moveRectToBlock_(d.flyoutRect_,d);if(this.RTL)for(c=0;d=this.buttons_[c];c++)b=d.getPosition().y,d.moveTo(a-d.width-this.MARGIN-Blockly.BlockSvg.TAB_WIDTH,b);this.width_=a;this.targetWorkspace_.resize()}};Blockly.Toolbox=function(a){this.workspace_=a;this.RTL=a.options.RTL;this.horizontalLayout_=a.options.horizontalLayout;this.toolboxPosition=a.options.toolboxPosition;this.config_={indentWidth:19,cssRoot:"blocklyTreeRoot",cssHideRoot:"blocklyHidden",cssItem:"",cssTreeRow:"blocklyTreeRow",cssItemLabel:"blocklyTreeLabel",cssTreeIcon:"blocklyTreeIcon",cssExpandedFolderIcon:"blocklyTreeIconOpen",cssFileIcon:"blocklyTreeIconNone",cssSelectedRow:"blocklyTreeSelected"};this.treeSeparatorConfig_={cssTreeRow:"blocklyTreeSeparator"};
|
||||
this.horizontalLayout_&&(this.config_.cssTreeRow+=a.RTL?" blocklyHorizontalTreeRtl":" blocklyHorizontalTree",this.treeSeparatorConfig_.cssTreeRow="blocklyTreeSeparatorHorizontal "+(a.RTL?"blocklyHorizontalTreeRtl":"blocklyHorizontalTree"),this.config_.cssTreeIcon="")};Blockly.Toolbox.prototype.width=0;Blockly.Toolbox.prototype.height=0;Blockly.Toolbox.prototype.selectedOption_=null;Blockly.Toolbox.prototype.lastCategory_=null;
|
||||
Blockly.Toolbox.prototype.init=function(){var a=this.workspace_,b=this.workspace_.getParentSvg();this.HtmlDiv=goog.dom.createDom("DIV","blocklyToolboxDiv");this.HtmlDiv.setAttribute("dir",a.RTL?"RTL":"LTR");b.parentNode.insertBefore(this.HtmlDiv,b);Blockly.bindEventWithChecks_(this.HtmlDiv,"mousedown",this,function(a){Blockly.utils.isRightButton(a)||a.target==this.HtmlDiv?Blockly.hideChaff(!1):Blockly.hideChaff(!0);Blockly.Touch.clearTouchIdentifier()},!1,!0);b={disabledPatternId:a.options.disabledPatternId,
|
||||
parentWorkspace:a,RTL:a.RTL,oneBasedIndex:a.options.oneBasedIndex,horizontalLayout:a.horizontalLayout,toolboxPosition:a.options.toolboxPosition};this.flyout_=null;this.flyout_=a.horizontalLayout?new Blockly.HorizontalFlyout(b):new Blockly.VerticalFlyout(b);goog.dom.insertSiblingAfter(this.flyout_.createDom("svg"),this.workspace_.getParentSvg());this.flyout_.init(a);this.config_.cleardotPath=a.options.pathToMedia+"1x1.gif";this.config_.cssCollapsedFolderIcon="blocklyTreeIconClosed"+(a.RTL?"Rtl":"Ltr");
|
||||
@@ -1536,7 +1538,7 @@ this.tree_=b=new Blockly.Toolbox.TreeControl(this,this.config_);b.setShowRootNod
|
||||
Blockly.Toolbox.prototype.getHeight=function(){return this.height};
|
||||
Blockly.Toolbox.prototype.position=function(){var a=this.HtmlDiv;if(a){var b=this.workspace_.getParentSvg();b=Blockly.svgSize(b);this.horizontalLayout_?(a.style.left="0",a.style.height="auto",a.style.width=b.width+"px",this.height=a.offsetHeight,this.toolboxPosition==Blockly.TOOLBOX_AT_TOP?a.style.top="0":a.style.bottom="0"):(this.toolboxPosition==Blockly.TOOLBOX_AT_RIGHT?a.style.right="0":a.style.left="0",a.style.height=b.height+"px",this.width=a.offsetWidth);this.flyout_.position()}};
|
||||
Blockly.Toolbox.prototype.populate_=function(a){this.tree_.removeChildren();this.tree_.blocks=[];this.hasColours_=!1;a=this.syncTrees_(a,this.tree_,this.workspace_.options.pathToMedia);if(this.tree_.blocks.length)throw"Toolbox cannot have both blocks and categories in the root level.";this.workspace_.resizeContents();return a};
|
||||
Blockly.Toolbox.prototype.syncTrees_=function(a,b,c){for(var d=null,e=null,f=0,g;g=a.childNodes[f];f++)if(g.tagName)switch(g.tagName.toUpperCase()){case "CATEGORY":e=Blockly.utils.replaceMessageReferences(g.getAttribute("name"));e=this.tree_.createNode(e);e.blocks=[];b.add(e);var h=g.getAttribute("custom");h?e.blocks=h:(h=this.syncTrees_(g,e,c))&&(d=h);h=Blockly.utils.replaceMessageReferences(g.getAttribute("colour"));goog.isString(h)?(h.match(/^#[0-9a-fA-F]{6}$/)?e.hexColour=h:e.hexColour=Blockly.hueToRgb(h),
|
||||
Blockly.Toolbox.prototype.syncTrees_=function(a,b,c){for(var d=null,e=null,f=0,g;g=a.childNodes[f];f++)if(g.tagName)switch(g.tagName.toUpperCase()){case "CATEGORY":e=Blockly.utils.replaceMessageReferences(g.getAttribute("name"));e=this.tree_.createNode(e);e.blocks=[];b.add(e);var h=g.getAttribute("custom");h?e.blocks=h:(h=this.syncTrees_(g,e,c))&&(d=h);h=Blockly.utils.replaceMessageReferences(g.getAttribute("colour"));goog.isString(h)?(/^#[0-9a-fA-F]{6}$/.test(h)?e.hexColour=h:e.hexColour=Blockly.hueToRgb(Number(h)),
|
||||
this.hasColours_=!0):e.hexColour="";"true"==g.getAttribute("expanded")?(e.blocks.length&&(d=e),e.setExpanded(!0)):e.setExpanded(!1);e=g;break;case "SEP":e&&("CATEGORY"==e.tagName.toUpperCase()?b.add(new Blockly.Toolbox.TreeSeparator(this.treeSeparatorConfig_)):(g=parseFloat(g.getAttribute("gap")),!isNaN(g)&&e&&e.setAttribute("gap",g)));break;case "BLOCK":case "SHADOW":case "LABEL":case "BUTTON":b.blocks.push(g),e=g}return d};
|
||||
Blockly.Toolbox.prototype.addColour_=function(a){a=(a||this.tree_).getChildren();for(var b=0,c;c=a[b];b++){var d=c.getRowElement();if(d){var e=this.hasColours_?"8px solid "+(c.hexColour||"#ddd"):"none";this.workspace_.RTL?d.style.borderRight=e:d.style.borderLeft=e}this.addColour_(c)}};Blockly.Toolbox.prototype.clearSelection=function(){this.tree_.setSelectedItem(null)};Blockly.Toolbox.prototype.addDeleteStyle=function(){Blockly.utils.addClass(this.HtmlDiv,"blocklyToolboxDelete")};
|
||||
Blockly.Toolbox.prototype.removeDeleteStyle=function(){Blockly.utils.removeClass(this.HtmlDiv,"blocklyToolboxDelete")};
|
||||
@@ -1548,7 +1550,7 @@ Blockly.Toolbox.TreeControl.prototype.setSelectedItem=function(a){var b=this.too
|
||||
a&&c!=this&&(c=new Blockly.Events.Ui(null,"category",c&&c.getHtml(),a&&a.getHtml()),c.workspaceId=b.workspace_.id,Blockly.Events.fire(c));a&&(b.lastCategory_=a)}};Blockly.Toolbox.TreeNode=function(a,b,c,d){goog.ui.tree.TreeNode.call(this,b,c,d);a&&(b=function(){Blockly.svgResize(a.workspace_)},goog.events.listen(a.tree_,goog.ui.tree.BaseNode.EventType.EXPAND,b),goog.events.listen(a.tree_,goog.ui.tree.BaseNode.EventType.COLLAPSE,b))};goog.inherits(Blockly.Toolbox.TreeNode,goog.ui.tree.TreeNode);
|
||||
Blockly.Toolbox.TreeNode.prototype.getExpandIconSafeHtml=function(){return goog.html.SafeHtml.create("span")};Blockly.Toolbox.TreeNode.prototype.onClick_=function(a){this.hasChildren()&&this.isUserCollapsible_?(this.toggle(),this.select()):this.isSelected()?this.getTree().setSelectedItem(null):this.select();this.updateRow()};Blockly.Toolbox.TreeNode.prototype.onMouseDown=function(a){};Blockly.Toolbox.TreeNode.prototype.onDoubleClick_=function(a){};
|
||||
Blockly.Toolbox.TreeNode.prototype.onKeyDown=function(a){if(this.tree.toolbox_.horizontalLayout_){var b={},c=goog.events.KeyCodes.DOWN,d=goog.events.KeyCodes.UP;b[goog.events.KeyCodes.RIGHT]=this.rightToLeft_?d:c;b[goog.events.KeyCodes.LEFT]=this.rightToLeft_?c:d;b[goog.events.KeyCodes.UP]=goog.events.KeyCodes.LEFT;b[goog.events.KeyCodes.DOWN]=goog.events.KeyCodes.RIGHT;a.keyCode=b[a.keyCode]||a.keyCode}return Blockly.Toolbox.TreeNode.superClass_.onKeyDown.call(this,a)};
|
||||
Blockly.Toolbox.TreeSeparator=function(a){Blockly.Toolbox.TreeNode.call(this,null,"",a)};goog.inherits(Blockly.Toolbox.TreeSeparator,Blockly.Toolbox.TreeNode);Blockly.Css={};Blockly.Css.Cursor={OPEN:"handopen",CLOSED:"handclosed",DELETE:"handdelete"};Blockly.Css.currentCursor_="";Blockly.Css.styleSheet_=null;Blockly.Css.mediaPath_="";
|
||||
Blockly.Toolbox.TreeSeparator=function(a){Blockly.Toolbox.TreeNode.call(this,null,goog.html.SafeHtml.EMPTY,a)};goog.inherits(Blockly.Toolbox.TreeSeparator,Blockly.Toolbox.TreeNode);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){if(!Blockly.Css.styleSheet_){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(/<<<PATH>>>/g,Blockly.Css.mediaPath_);var d=document.createElement("style");document.head.insertBefore(d,document.head.firstChild);c=document.createTextNode(c);d.appendChild(c);Blockly.Css.styleSheet_=d.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: #fff;","outline: none;","overflow: hidden;","position: absolute;","display: block;","}",".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;","-ms-user-select: none;","}",".blocklyWsDragSurface {","display: none;",
|
||||
"position: absolute;","top: 0;","left: 0;","}",".blocklyWsDragSurface.blocklyOverflowVisible {","overflow: visible;","}",".blocklyBlockDragSurface {","display: none;","position: absolute;","top: 0;","left: 0;","right: 0;","bottom: 0;","overflow: visible !important;","z-index: 50;","}",".blocklyTooltipDiv {","background-color: #ffffc7;","border: 1px solid #ddc;","box-shadow: 4px 4px 20px 1px rgba(0,0,0,.15);","color: #000;","display: none;","font-family: sans-serif;","font-size: 9pt;","opacity: 0.9;",
|
||||
@@ -1576,7 +1578,7 @@ Blockly.Css.CONTENT=[".blocklySvg {","background-color: #fff;","outline: none;",
|
||||
Blockly.WidgetDiv.show=function(a,b,c){Blockly.WidgetDiv.hide();Blockly.WidgetDiv.owner_=a;Blockly.WidgetDiv.dispose_=c;a=goog.style.getViewportPageOffset(document);Blockly.WidgetDiv.DIV.style.top=a.y+"px";Blockly.WidgetDiv.DIV.style.direction=b?"rtl":"ltr";Blockly.WidgetDiv.DIV.style.display="block"};
|
||||
Blockly.WidgetDiv.hide=function(){Blockly.WidgetDiv.owner_&&(Blockly.WidgetDiv.owner_=null,Blockly.WidgetDiv.DIV.style.display="none",Blockly.WidgetDiv.DIV.style.left="",Blockly.WidgetDiv.DIV.style.top="",Blockly.WidgetDiv.dispose_&&Blockly.WidgetDiv.dispose_(),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,e){b<d.y&&(b=d.y);e?a>c.width+d.x&&(a=c.width+d.x):a<d.x&&(a=d.x);Blockly.WidgetDiv.positionInternal_(a,b,c.height)};Blockly.WidgetDiv.positionInternal_=function(a,b,c){Blockly.WidgetDiv.DIV.style.left=a+"px";Blockly.WidgetDiv.DIV.style.top=b+"px";Blockly.WidgetDiv.DIV.style.height=c+"px"};
|
||||
Blockly.WidgetDiv.positionWithAnchor=function(a,b,c,d){var e=Blockly.WidgetDiv.calculateY_(a,b,c);a=Blockly.WidgetDiv.calculateX_(a,b,c,d);Blockly.WidgetDiv.positionInternal_(a,e,c.height)};Blockly.WidgetDiv.calculateX_=function(a,b,c,d){if(d)return b=Math.max(b.right-c.width,a.left),Math.min(b,a.right-c.width);b=Math.min(b.left,a.right-c.width);return Math.max(b,a.left)};Blockly.WidgetDiv.calculateY_=function(a,b,c){return b.bottom+c.height>=a.bottom?b.top-c.height:b.bottom};Blockly.inject=function(a,b){goog.isString(a)&&(a=document.getElementById(a)||document.querySelector(a));if(!goog.dom.contains(document,a))throw"Error: container is not in current document.";var c=new Blockly.Options(b||{}),d=goog.dom.createDom("div","injectionDiv");a.appendChild(d);var e=Blockly.createDom_(d,c),f=new Blockly.BlockDragSurfaceSvg(d);d=new Blockly.WorkspaceDragSurfaceSvg(d);c=Blockly.createMainWorkspace_(e,c,f,d);Blockly.init_(c);Blockly.mainWorkspace=c;Blockly.svgResize(c);return c};
|
||||
Blockly.WidgetDiv.positionWithAnchor=function(a,b,c,d){var e=Blockly.WidgetDiv.calculateY_(a,b,c);a=Blockly.WidgetDiv.calculateX_(a,b,c,d);Blockly.WidgetDiv.positionInternal_(a,e,c.height)};Blockly.WidgetDiv.calculateX_=function(a,b,c,d){if(d)return b=Math.max(b.right-c.width,a.left),Math.min(b,a.right-c.width);b=Math.min(b.left,a.right-c.width);return Math.max(b,a.left)};Blockly.WidgetDiv.calculateY_=function(a,b,c){return b.bottom+c.height>=a.bottom?b.top-c.height:b.bottom};Blockly.inject=function(a,b){goog.isString(a)&&(a=document.getElementById(a)||document.querySelector(a));if(!goog.dom.contains(document,a))throw"Error: container is not in current document.";var c=new Blockly.Options(b||{}),d=goog.dom.createDom("DIV","injectionDiv");a.appendChild(d);var e=Blockly.createDom_(d,c),f=new Blockly.BlockDragSurfaceSvg(d);d=new Blockly.WorkspaceDragSurfaceSvg(d);c=Blockly.createMainWorkspace_(e,c,f,d);Blockly.init_(c);Blockly.mainWorkspace=c;Blockly.svgResize(c);return c};
|
||||
Blockly.createDom_=function(a,b){a.setAttribute("dir","LTR");goog.ui.Component.setDefaultRightToLeft(b.RTL);Blockly.Css.inject(b.hasCss,b.pathToMedia);var c=Blockly.utils.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"},a),d=Blockly.utils.createSvgElement("defs",{},c),e=String(Math.random()).substring(2),f=Blockly.utils.createSvgElement("filter",{id:"blocklyEmbossFilter"+
|
||||
e},d);Blockly.utils.createSvgElement("feGaussianBlur",{"in":"SourceAlpha",stdDeviation:1,result:"blur"},f);var g=Blockly.utils.createSvgElement("feSpecularLighting",{"in":"blur",surfaceScale:1,specularConstant:.5,specularExponent:10,"lighting-color":"white",result:"specOut"},f);Blockly.utils.createSvgElement("fePointLight",{x:-5E3,y:-1E4,z:2E4},g);Blockly.utils.createSvgElement("feComposite",{"in":"specOut",in2:"SourceAlpha",operator:"in",result:"specOut"},f);Blockly.utils.createSvgElement("feComposite",
|
||||
{"in":"SourceGraphic",in2:"specOut",operator:"arithmetic",k1:0,k2:1,k3:1,k4:0},f);b.embossFilterId=f.id;f=Blockly.utils.createSvgElement("pattern",{id:"blocklyDisabledPattern"+e,patternUnits:"userSpaceOnUse",width:10,height:10},d);Blockly.utils.createSvgElement("rect",{width:10,height:10,fill:"#aaa"},f);Blockly.utils.createSvgElement("path",{d:"M 0 0 L 10 10 M 10 0 L 0 10",stroke:"#cc0"},f);b.disabledPatternId=f.id;b.gridPattern=Blockly.Grid.createDom(e,b.gridOptions,d);return c};
|
||||
@@ -1597,4 +1599,4 @@ Blockly.getMainWorkspace=function(){return Blockly.mainWorkspace};Blockly.alert=
|
||||
Blockly.defineBlocksWithJsonArray=function(a){for(var b=0,c;c=a[b];b++){var d=c.type;null==d||""===d?console.warn("Block definition #"+b+" in JSON array is missing a type attribute. Skipping."):(Blockly.Blocks[d]&&console.warn("Block definition #"+b+' in JSON array overwrites prior definition of "'+d+'".'),Blockly.Blocks[d]={init:Blockly.jsonInitFactory_(c)})}};
|
||||
Blockly.bindEventWithChecks_=function(a,b,c,d,e,f){var g=!1,h=function(a){var b=!e;a=Blockly.Touch.splitEventByTouches(a);for(var f=0,h;h=a[f];f++)if(!b||Blockly.Touch.shouldHandleEvent(h))Blockly.Touch.setClientFromTouch(h),c?d.call(c,h):d(h),g=!0};a.addEventListener(b,h,!1);var k=[[a,b,h]];if(b in Blockly.Touch.TOUCH_MAP)for(var n=function(a){h(a);var b=!f;g&&b&&a.preventDefault()},p=0,l;l=Blockly.Touch.TOUCH_MAP[b][p];p++)a.addEventListener(l,n,!1),k.push([a,l,n]);return k};
|
||||
Blockly.bindEvent_=function(a,b,c,d){var e=function(a){c?d.call(c,a):d(a)};a.addEventListener(b,e,!1);var f=[[a,b,e]];if(b in Blockly.Touch.TOUCH_MAP)for(var g=function(a){if(1==a.changedTouches.length){var b=a.changedTouches[0];a.clientX=b.clientX;a.clientY=b.clientY}e(a);a.preventDefault()},h=0,k;k=Blockly.Touch.TOUCH_MAP[b][h];h++)a.addEventListener(k,g,!1),f.push([a,k,g]);return f};Blockly.unbindEvent_=function(a){for(;a.length;){var b=a.pop(),c=b[2];b[0].removeEventListener(b[1],c,!1)}return c};
|
||||
Blockly.isNumber=function(a){return!!a.match(/^\s*-?\d+(\.\d+)?\s*$/)};goog.global.console||(goog.global.console={log:function(){},warn:function(){}});goog.global.Blockly||(goog.global.Blockly={});goog.global.Blockly.getMainWorkspace=Blockly.getMainWorkspace;goog.global.Blockly.addChangeListener=Blockly.addChangeListener;
|
||||
Blockly.isNumber=function(a){return/^\s*-?\d+(\.\d+)?\s*$/.test(a)};goog.global.console||(goog.global.console={log:function(){},warn:function(){}});goog.global.Blockly||(goog.global.Blockly={});goog.global.Blockly.getMainWorkspace=Blockly.getMainWorkspace;goog.global.Blockly.addChangeListener=Blockly.addChangeListener;
|
||||
@@ -226,10 +226,9 @@ goog.addDependency("date/daterange_test.js", ['goog.date.DateRangeTest'], ['goog
|
||||
goog.addDependency("date/duration.js", ['goog.date.duration'], ['goog.i18n.DateTimeFormat', 'goog.i18n.MessageFormat']);
|
||||
goog.addDependency("date/duration_test.js", ['goog.date.durationTest'], ['goog.date.duration', 'goog.i18n.DateTimeFormat', 'goog.i18n.DateTimeSymbols', 'goog.i18n.DateTimeSymbols_bn', 'goog.i18n.DateTimeSymbols_en', 'goog.i18n.DateTimeSymbols_fa', 'goog.testing.jsunit']);
|
||||
goog.addDependency("date/relative.js", ['goog.date.relative', 'goog.date.relative.TimeDeltaFormatter', 'goog.date.relative.Unit'], ['goog.i18n.DateTimeFormat', 'goog.i18n.DateTimePatterns']);
|
||||
goog.addDependency("date/relative_test.js", ['goog.date.relativeTest'], ['goog.date.relativeCommonTests']);
|
||||
goog.addDependency("date/relativecommontests.js", ['goog.date.relativeCommonTests'], ['goog.date.DateTime', 'goog.date.relative', 'goog.i18n.DateTimeFormat', 'goog.testing.jsunit']);
|
||||
goog.addDependency("date/relative_test.js", ['goog.date.relativeTest'], ['goog.date.DateTime', 'goog.date.relative', 'goog.i18n.DateTimeFormat', 'goog.testing.jsunit']);
|
||||
goog.addDependency("date/relativewithplurals.js", ['goog.date.relativeWithPlurals'], ['goog.date.relative', 'goog.date.relative.Unit', 'goog.i18n.MessageFormat']);
|
||||
goog.addDependency("date/relativewithplurals_test.js", ['goog.date.relativeWithPluralsTest'], ['goog.date.relative', 'goog.date.relativeCommonTests', 'goog.date.relativeWithPlurals', 'goog.i18n.DateTimeFormat', 'goog.i18n.DateTimeSymbols', 'goog.i18n.DateTimeSymbols_bn', 'goog.i18n.DateTimeSymbols_en', 'goog.i18n.DateTimeSymbols_fa', 'goog.i18n.NumberFormatSymbols', 'goog.i18n.NumberFormatSymbols_bn', 'goog.i18n.NumberFormatSymbols_en', 'goog.i18n.NumberFormatSymbols_fa']);
|
||||
goog.addDependency("date/relativewithplurals_test.js", ['goog.date.relativeWithPluralsTest'], ['goog.date.relative', 'goog.date.relativeTest', 'goog.date.relativeWithPlurals', 'goog.i18n.DateTimeFormat', 'goog.i18n.DateTimeSymbols', 'goog.i18n.DateTimeSymbols_bn', 'goog.i18n.DateTimeSymbols_en', 'goog.i18n.DateTimeSymbols_fa', 'goog.i18n.NumberFormatSymbols', 'goog.i18n.NumberFormatSymbols_bn', 'goog.i18n.NumberFormatSymbols_en', 'goog.i18n.NumberFormatSymbols_fa']);
|
||||
goog.addDependency("date/utcdatetime.js", ['goog.date.UtcDateTime'], ['goog.date', 'goog.date.Date', 'goog.date.DateTime', 'goog.date.Interval']);
|
||||
goog.addDependency("date/utcdatetime_test.js", ['goog.date.UtcDateTimeTest'], ['goog.date.Interval', 'goog.date.UtcDateTime', 'goog.date.month', 'goog.date.weekDay', 'goog.testing.jsunit']);
|
||||
goog.addDependency("db/cursor.js", ['goog.db.Cursor'], ['goog.async.Deferred', 'goog.db.Error', 'goog.db.KeyRange', 'goog.debug', 'goog.events.EventTarget']);
|
||||
@@ -748,8 +747,8 @@ goog.addDependency("labs/net/webchannel/channel.js", ['goog.labs.net.webChannel.
|
||||
goog.addDependency("labs/net/webchannel/channelrequest.js", ['goog.labs.net.webChannel.ChannelRequest'], ['goog.Timer', 'goog.async.Throttle', 'goog.events.EventHandler', 'goog.labs.net.webChannel.Channel', 'goog.labs.net.webChannel.WebChannelDebug', 'goog.labs.net.webChannel.requestStats', 'goog.net.ErrorCode', 'goog.net.EventType', 'goog.net.XmlHttp', 'goog.object', 'goog.userAgent']);
|
||||
goog.addDependency("labs/net/webchannel/channelrequest_test.js", ['goog.labs.net.webChannel.channelRequestTest'], ['goog.Uri', 'goog.functions', 'goog.labs.net.webChannel.ChannelRequest', 'goog.labs.net.webChannel.WebChannelDebug', 'goog.labs.net.webChannel.requestStats', 'goog.labs.net.webChannel.requestStats.ServerReachability', 'goog.testing.MockClock', 'goog.testing.PropertyReplacer', 'goog.testing.jsunit', 'goog.testing.net.XhrIo', 'goog.testing.recordFunction']);
|
||||
goog.addDependency("labs/net/webchannel/connectionstate.js", ['goog.labs.net.webChannel.ConnectionState'], []);
|
||||
goog.addDependency("labs/net/webchannel/forwardchannelrequestpool.js", [], []);
|
||||
goog.addDependency("labs/net/webchannel/forwardchannelrequestpool_test.js", [], []);
|
||||
goog.addDependency("labs/net/webchannel/forwardchannelrequestpool.js", ['goog.labs.net.webChannel.ForwardChannelRequestPool'], ['goog.array', 'goog.string', 'goog.structs.Set']);
|
||||
goog.addDependency("labs/net/webchannel/forwardchannelrequestpool_test.js", ['goog.labs.net.webChannel.forwardChannelRequestPoolTest'], ['goog.labs.net.webChannel.ChannelRequest', 'goog.labs.net.webChannel.ForwardChannelRequestPool', 'goog.testing.PropertyReplacer', 'goog.testing.asserts', 'goog.testing.jsunit']);
|
||||
goog.addDependency("labs/net/webchannel/netutils.js", ['goog.labs.net.webChannel.netUtils'], ['goog.Uri', 'goog.labs.net.webChannel.WebChannelDebug']);
|
||||
goog.addDependency("labs/net/webchannel/requeststats.js", ['goog.labs.net.webChannel.requestStats', 'goog.labs.net.webChannel.requestStats.Event', 'goog.labs.net.webChannel.requestStats.ServerReachability', 'goog.labs.net.webChannel.requestStats.ServerReachabilityEvent', 'goog.labs.net.webChannel.requestStats.Stat', 'goog.labs.net.webChannel.requestStats.StatEvent', 'goog.labs.net.webChannel.requestStats.TimingEvent'], ['goog.events.Event', 'goog.events.EventTarget']);
|
||||
goog.addDependency("labs/net/webchannel/webchannelbase.js", ['goog.labs.net.webChannel.WebChannelBase'], ['goog.Uri', 'goog.array', 'goog.asserts', 'goog.async.run', 'goog.debug.TextFormatter', 'goog.json', 'goog.labs.net.webChannel.BaseTestChannel', 'goog.labs.net.webChannel.Channel', 'goog.labs.net.webChannel.ChannelRequest', 'goog.labs.net.webChannel.ConnectionState', 'goog.labs.net.webChannel.ForwardChannelRequestPool', 'goog.labs.net.webChannel.WebChannelDebug', 'goog.labs.net.webChannel.Wire', 'goog.labs.net.webChannel.WireV8', 'goog.labs.net.webChannel.netUtils', 'goog.labs.net.webChannel.requestStats', 'goog.log', 'goog.net.WebChannel', 'goog.net.XhrIo', 'goog.net.rpc.HttpCors', 'goog.object', 'goog.string', 'goog.structs', 'goog.structs.CircularBuffer']);
|
||||
|
||||
+2
-1
@@ -107,7 +107,8 @@ Blockly.defineBlocksWithJsonArray([ // BEGIN JSON EXTRACT
|
||||
// Block for blending two colours together.
|
||||
{
|
||||
"type": "colour_blend",
|
||||
"message0": "%{BKY_COLOUR_BLEND_TITLE} %{BKY_COLOUR_BLEND_COLOUR1} %1 %{BKY_COLOUR_BLEND_COLOUR2} %2 %{BKY_COLOUR_BLEND_RATIO} %3",
|
||||
"message0": "%{BKY_COLOUR_BLEND_TITLE} %{BKY_COLOUR_BLEND_COLOUR1} " +
|
||||
"%1 %{BKY_COLOUR_BLEND_COLOUR2} %2 %{BKY_COLOUR_BLEND_RATIO} %3",
|
||||
"args0": [
|
||||
{
|
||||
"type": "input_value",
|
||||
|
||||
+5
-5
@@ -295,8 +295,8 @@ Blockly.Constants.Logic.TOOLTIPS_BY_OP = {
|
||||
};
|
||||
|
||||
Blockly.Extensions.register('logic_op_tooltip',
|
||||
Blockly.Extensions.buildTooltipForDropdown(
|
||||
'OP', Blockly.Constants.Logic.TOOLTIPS_BY_OP));
|
||||
Blockly.Extensions.buildTooltipForDropdown(
|
||||
'OP', Blockly.Constants.Logic.TOOLTIPS_BY_OP));
|
||||
|
||||
/**
|
||||
* Mutator methods added to controls_if blocks.
|
||||
@@ -486,7 +486,7 @@ Blockly.Constants.Logic.CONTROLS_IF_TOOLTIP_EXTENSION = function() {
|
||||
};
|
||||
|
||||
Blockly.Extensions.register('controls_if_tooltip',
|
||||
Blockly.Constants.Logic.CONTROLS_IF_TOOLTIP_EXTENSION);
|
||||
Blockly.Constants.Logic.CONTROLS_IF_TOOLTIP_EXTENSION);
|
||||
|
||||
/**
|
||||
* Corrects the logic_compare dropdown label with respect to language direction.
|
||||
@@ -574,7 +574,7 @@ Blockly.Constants.Logic.LOGIC_COMPARE_EXTENSION = function() {
|
||||
};
|
||||
|
||||
Blockly.Extensions.register('logic_compare',
|
||||
Blockly.Constants.Logic.LOGIC_COMPARE_EXTENSION);
|
||||
Blockly.Constants.Logic.LOGIC_COMPARE_EXTENSION);
|
||||
|
||||
/**
|
||||
* Adds type coordination between inputs and output.
|
||||
@@ -619,4 +619,4 @@ Blockly.Constants.Logic.LOGIC_TERNARY_ONCHANGE_MIXIN = {
|
||||
};
|
||||
|
||||
Blockly.Extensions.registerMixin('logic_ternary',
|
||||
Blockly.Constants.Logic.LOGIC_TERNARY_ONCHANGE_MIXIN);
|
||||
Blockly.Constants.Logic.LOGIC_TERNARY_ONCHANGE_MIXIN);
|
||||
|
||||
+11
-11
@@ -227,8 +227,8 @@ Blockly.Constants.Loops.WHILE_UNTIL_TOOLTIPS = {
|
||||
};
|
||||
|
||||
Blockly.Extensions.register('controls_whileUntil_tooltip',
|
||||
Blockly.Extensions.buildTooltipForDropdown(
|
||||
'MODE', Blockly.Constants.Loops.WHILE_UNTIL_TOOLTIPS));
|
||||
Blockly.Extensions.buildTooltipForDropdown(
|
||||
'MODE', Blockly.Constants.Loops.WHILE_UNTIL_TOOLTIPS));
|
||||
|
||||
/**
|
||||
* Tooltips for the 'controls_flow_statements' block, keyed by FLOW value.
|
||||
@@ -242,8 +242,8 @@ Blockly.Constants.Loops.BREAK_CONTINUE_TOOLTIPS = {
|
||||
};
|
||||
|
||||
Blockly.Extensions.register('controls_flow_tooltip',
|
||||
Blockly.Extensions.buildTooltipForDropdown(
|
||||
'FLOW', Blockly.Constants.Loops.BREAK_CONTINUE_TOOLTIPS));
|
||||
Blockly.Extensions.buildTooltipForDropdown(
|
||||
'FLOW', Blockly.Constants.Loops.BREAK_CONTINUE_TOOLTIPS));
|
||||
|
||||
/**
|
||||
* Mixin to add a context menu item to create a 'variables_get' block.
|
||||
@@ -277,15 +277,15 @@ Blockly.Constants.Loops.CUSTOM_CONTEXT_MENU_CREATE_VARIABLES_GET_MIXIN = {
|
||||
};
|
||||
|
||||
Blockly.Extensions.registerMixin('contextMenu_newGetVariableBlock',
|
||||
Blockly.Constants.Loops.CUSTOM_CONTEXT_MENU_CREATE_VARIABLES_GET_MIXIN);
|
||||
Blockly.Constants.Loops.CUSTOM_CONTEXT_MENU_CREATE_VARIABLES_GET_MIXIN);
|
||||
|
||||
Blockly.Extensions.register('controls_for_tooltip',
|
||||
Blockly.Extensions.buildTooltipWithFieldValue(
|
||||
Blockly.Msg.CONTROLS_FOR_TOOLTIP, 'VAR'));
|
||||
Blockly.Extensions.buildTooltipWithFieldValue(
|
||||
'%{BKY_CONTROLS_FOR_TOOLTIP}', 'VAR'));
|
||||
|
||||
Blockly.Extensions.register('controls_forEach_tooltip',
|
||||
Blockly.Extensions.buildTooltipWithFieldValue(
|
||||
Blockly.Msg.CONTROLS_FOREACH_TOOLTIP, 'VAR'));
|
||||
Blockly.Extensions.buildTooltipWithFieldValue(
|
||||
'%{BKY_CONTROLS_FOREACH_TOOLTIP}', 'VAR'));
|
||||
|
||||
/**
|
||||
* This mixin adds a check to make sure the 'controls_flow_statements' block
|
||||
@@ -295,7 +295,7 @@ Blockly.Extensions.register('controls_forEach_tooltip',
|
||||
* @package
|
||||
* @readonly
|
||||
*/
|
||||
Blockly.Constants.Loops.CONTROL_FLOW_CHECK_IN_LOOP_MIXIN = {
|
||||
Blockly.Constants.Loops.CONTROL_FLOW_IN_LOOP_CHECK_MIXIN = {
|
||||
/**
|
||||
* List of block types that are loops and thus do not need warnings.
|
||||
* To add a new loop type add this to your code:
|
||||
@@ -339,4 +339,4 @@ Blockly.Constants.Loops.CONTROL_FLOW_CHECK_IN_LOOP_MIXIN = {
|
||||
};
|
||||
|
||||
Blockly.Extensions.registerMixin('controls_flow_in_loop_check',
|
||||
Blockly.Constants.Loops.CONTROL_FLOW_IN_LOOP_CHECK_MIXIN);
|
||||
Blockly.Constants.Loops.CONTROL_FLOW_IN_LOOP_CHECK_MIXIN);
|
||||
|
||||
+8
-8
@@ -422,8 +422,8 @@ Blockly.Constants.Math.TOOLTIPS_BY_OP = {
|
||||
};
|
||||
|
||||
Blockly.Extensions.register('math_op_tooltip',
|
||||
Blockly.Extensions.buildTooltipForDropdown(
|
||||
'OP', Blockly.Constants.Math.TOOLTIPS_BY_OP));
|
||||
Blockly.Extensions.buildTooltipForDropdown(
|
||||
'OP', Blockly.Constants.Math.TOOLTIPS_BY_OP));
|
||||
|
||||
|
||||
/**
|
||||
@@ -489,8 +489,8 @@ Blockly.Constants.Math.IS_DIVISIBLE_MUTATOR_EXTENSION = function() {
|
||||
};
|
||||
|
||||
Blockly.Extensions.registerMutator('math_is_divisibleby_mutator',
|
||||
Blockly.Constants.Math.IS_DIVISIBLEBY_MUTATOR_MIXIN,
|
||||
Blockly.Constants.Math.IS_DIVISIBLE_MUTATOR_EXTENSION);
|
||||
Blockly.Constants.Math.IS_DIVISIBLEBY_MUTATOR_MIXIN,
|
||||
Blockly.Constants.Math.IS_DIVISIBLE_MUTATOR_EXTENSION);
|
||||
|
||||
/**
|
||||
* Update the tooltip of 'math_change' block to reference the variable.
|
||||
@@ -505,8 +505,8 @@ Blockly.Constants.Math.CHANGE_TOOLTIP_EXTENSION = function() {
|
||||
};
|
||||
|
||||
Blockly.Extensions.register('math_change_tooltip',
|
||||
Blockly.Extensions.buildTooltipWithFieldValue(
|
||||
Blockly.Msg.MATH_CHANGE_TOOLTIP, 'VAR'));
|
||||
Blockly.Extensions.buildTooltipWithFieldValue(
|
||||
'%{BKY_MATH_CHANGE_TOOLTIP}', 'VAR'));
|
||||
|
||||
/**
|
||||
* Mixin with mutator methods to support alternate output based if the
|
||||
@@ -563,5 +563,5 @@ Blockly.Constants.Math.LIST_MODES_MUTATOR_EXTENSION = function() {
|
||||
};
|
||||
|
||||
Blockly.Extensions.registerMutator('math_modes_of_list_mutator',
|
||||
Blockly.Constants.Math.LIST_MODES_MUTATOR_MIXIN,
|
||||
Blockly.Constants.Math.LIST_MODES_MUTATOR_EXTENSION);
|
||||
Blockly.Constants.Math.LIST_MODES_MUTATOR_MIXIN,
|
||||
Blockly.Constants.Math.LIST_MODES_MUTATOR_EXTENSION);
|
||||
|
||||
+62
-56
@@ -188,8 +188,13 @@ Blockly.defineBlocksWithJsonArray([ // BEGIN JSON EXTRACT
|
||||
"check": "String"
|
||||
},
|
||||
{
|
||||
"type": "input_dummy",
|
||||
"name": "AT"
|
||||
"type": "field_dropdown",
|
||||
"name": "WHERE",
|
||||
"options": [["%{BKY_TEXT_CHARAT_FROM_START}", "FROM_START"],
|
||||
["%{BKY_TEXT_CHARAT_FROM_END}", "FROM_END"],
|
||||
["%{BKY_TEXT_CHARAT_FIRST}", "FIRST"],
|
||||
["%{BKY_TEXT_CHARAT_LAST}", "LAST"],
|
||||
["%{BKY_TEXT_CHARAT_RANDOM}", "RANDOM"]]
|
||||
}
|
||||
],
|
||||
"output": "String",
|
||||
@@ -562,17 +567,25 @@ Blockly.Blocks['text_reverse'] = {
|
||||
*/
|
||||
Blockly.Constants.Text.QUOTE_IMAGE_MIXIN = {
|
||||
/**
|
||||
* Image data URI of an LTR opening double quote (same as RTL closing couble quote).
|
||||
* Image data URI of an LTR opening double quote (same as RTL closing double quote).
|
||||
* @readonly
|
||||
*/
|
||||
QUOTE_IMAGE_LEFT_DATAURI:
|
||||
'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAn0lEQVQI1z3OMa5BURSF4f/cQhAKjUQhuQmFNwGJEUi0RKN5rU7FHKhpjEH3TEMtkdBSCY1EIv8r7nFX9e29V7EBAOvu7RPjwmWGH/VuF8CyN9/OAdvqIXYLvtRaNjx9mMTDyo+NjAN1HNcl9ZQ5oQMM3dgDUqDo1l8DzvwmtZN7mnD+PkmLa+4mhrxVA9fRowBWmVBhFy5gYEjKMfz9AylsaRRgGzvZAAAAAElFTkSuQmCC',
|
||||
'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAA' +
|
||||
'n0lEQVQI1z3OMa5BURSF4f/cQhAKjUQhuQmFNwGJEUi0RKN5rU7FHKhpjEH3TEMtkdBSCY' +
|
||||
'1EIv8r7nFX9e29V7EBAOvu7RPjwmWGH/VuF8CyN9/OAdvqIXYLvtRaNjx9mMTDyo+NjAN1' +
|
||||
'HNcl9ZQ5oQMM3dgDUqDo1l8DzvwmtZN7mnD+PkmLa+4mhrxVA9fRowBWmVBhFy5gYEjKMf' +
|
||||
'z9AylsaRRgGzvZAAAAAElFTkSuQmCC',
|
||||
/**
|
||||
* Image data URI of an LTR closing double quote (same as RTL opening couble quote).
|
||||
* Image data URI of an LTR closing double quote (same as RTL opening double quote).
|
||||
* @readonly
|
||||
*/
|
||||
QUOTE_IMAGE_RIGHT_DATAURI:
|
||||
'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAqUlEQVQI1z3KvUpCcRiA8ef9E4JNHhI0aFEacm1o0BsI0Slx8wa8gLauoDnoBhq7DcfWhggONDmJJgqCPA7neJ7p934EOOKOnM8Q7PDElo/4x4lFb2DmuUjcUzS3URnGib9qaPNbuXvBO3sGPHJDRG6fGVdMSeWDP2q99FQdFrz26Gu5Tq7dFMzUvbXy8KXeAj57cOklgA+u1B5AoslLtGIHQMaCVnwDnADZIFIrXsoXrgAAAABJRU5ErkJggg==',
|
||||
'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAA' +
|
||||
'qUlEQVQI1z3KvUpCcRiA8ef9E4JNHhI0aFEacm1o0BsI0Slx8wa8gLauoDnoBhq7DcfWhg' +
|
||||
'gONDmJJgqCPA7neJ7p934EOOKOnM8Q7PDElo/4x4lFb2DmuUjcUzS3URnGib9qaPNbuXvB' +
|
||||
'O3sGPHJDRG6fGVdMSeWDP2q99FQdFrz26Gu5Tq7dFMzUvbXy8KXeAj57cOklgA+u1B5Aos' +
|
||||
'lLtGIHQMaCVnwDnADZIFIrXsoXrgAAAABJRU5ErkJggg==',
|
||||
/**
|
||||
* Pixel width of QUOTE_IMAGE_LEFT_DATAURI and QUOTE_IMAGE_RIGHT_DATAURI.
|
||||
* @readonly
|
||||
@@ -587,6 +600,7 @@ Blockly.Constants.Text.QUOTE_IMAGE_MIXIN = {
|
||||
/**
|
||||
* Inserts appropriate quote images before and after the named field.
|
||||
* @param {string} fieldName The name of the field to wrap with quotes.
|
||||
* @this Blockly.Block
|
||||
*/
|
||||
quoteField_: function(fieldName) {
|
||||
for (var i = 0, input; input = this.inputList[i]; i++) {
|
||||
@@ -607,6 +621,7 @@ Blockly.Constants.Text.QUOTE_IMAGE_MIXIN = {
|
||||
* @param {boolean} open If the image should be open quote (“ in LTR).
|
||||
* Otherwise, a closing quote is used (” in LTR).
|
||||
* @returns {!Blockly.FieldImage} The new field.
|
||||
* @this Blockly.Block
|
||||
*/
|
||||
newQuote_: function(open) {
|
||||
var isLeft = this.RTL? !open : open;
|
||||
@@ -749,10 +764,10 @@ Blockly.Constants.Text.TEXT_JOIN_MUTATOR_MIXIN = {
|
||||
Blockly.Constants.Text.TEXT_JOIN_EXTENSION = function() {
|
||||
// Add the quote mixin for the itemCount_ = 0 case.
|
||||
this.mixin(Blockly.Constants.Text.QUOTE_IMAGE_MIXIN);
|
||||
// initialize the mutator values
|
||||
// Initialize the mutator values.
|
||||
this.itemCount_ = 2;
|
||||
this.updateShape_();
|
||||
// Configure the mutator ui
|
||||
// Configure the mutator UI.
|
||||
this.setMutator(new Blockly.Mutator(['text_create_join_item']));
|
||||
};
|
||||
|
||||
@@ -791,8 +806,7 @@ Blockly.Constants.Text.TEXT_CHARAT_MUTATOR_MIXIN = {
|
||||
*/
|
||||
mutationToDom: function() {
|
||||
var container = document.createElement('mutation');
|
||||
var isAt = this.getInput('AT').type == Blockly.INPUT_VALUE;
|
||||
container.setAttribute('at', isAt);
|
||||
container.setAttribute('at', !!this.isAt_);
|
||||
return container;
|
||||
},
|
||||
/**
|
||||
@@ -814,7 +828,7 @@ Blockly.Constants.Text.TEXT_CHARAT_MUTATOR_MIXIN = {
|
||||
*/
|
||||
updateAt_: function(isAt) {
|
||||
// Destroy old 'AT' and 'ORDINAL' inputs.
|
||||
this.removeInput('AT');
|
||||
this.removeInput('AT', true);
|
||||
this.removeInput('ORDINAL', true);
|
||||
// Create either a value 'AT' input or a dummy input.
|
||||
if (isAt) {
|
||||
@@ -823,71 +837,63 @@ Blockly.Constants.Text.TEXT_CHARAT_MUTATOR_MIXIN = {
|
||||
this.appendDummyInput('ORDINAL')
|
||||
.appendField(Blockly.Msg.ORDINAL_NUMBER_SUFFIX);
|
||||
}
|
||||
} else {
|
||||
this.appendDummyInput('AT');
|
||||
}
|
||||
if (Blockly.Msg.TEXT_CHARAT_TAIL) {
|
||||
this.removeInput('TAIL', true);
|
||||
this.appendDummyInput('TAIL')
|
||||
.appendField(Blockly.Msg.TEXT_CHARAT_TAIL);
|
||||
}
|
||||
var menu = new Blockly.FieldDropdown(this.WHERE_OPTIONS, function(value) {
|
||||
var newAt = (value == 'FROM_START') || (value == 'FROM_END');
|
||||
// The 'isAt' variable is available due to this function being a closure.
|
||||
if (newAt != isAt) {
|
||||
var block = this.sourceBlock_;
|
||||
block.updateAt_(newAt);
|
||||
// This menu has been destroyed and replaced. Update the replacement.
|
||||
block.setFieldValue(value, 'WHERE');
|
||||
return null;
|
||||
}
|
||||
return undefined;
|
||||
});
|
||||
this.getInput('AT').appendField(menu, 'WHERE');
|
||||
|
||||
this.isAt_ = isAt;
|
||||
}
|
||||
};
|
||||
|
||||
// Does the initial mutator update of text_charAt and adds the tooltip
|
||||
Blockly.Constants.Text.TEXT_CHARAT_EXTENSION = function() {
|
||||
this.WHERE_OPTIONS = [
|
||||
[Blockly.Msg.TEXT_CHARAT_FROM_START, 'FROM_START'],
|
||||
[Blockly.Msg.TEXT_CHARAT_FROM_END, 'FROM_END'],
|
||||
[Blockly.Msg.TEXT_CHARAT_FIRST, 'FIRST'],
|
||||
[Blockly.Msg.TEXT_CHARAT_LAST, 'LAST'],
|
||||
[Blockly.Msg.TEXT_CHARAT_RANDOM, 'RANDOM']
|
||||
];
|
||||
this.updateAt_(true);
|
||||
// Assign 'this' to a variable for use in the tooltip closure below.
|
||||
var thisBlock = this;
|
||||
this.setTooltip(function() {
|
||||
var where = thisBlock.getFieldValue('WHERE');
|
||||
var tooltip = Blockly.Msg.TEXT_CHARAT_TOOLTIP;
|
||||
if (where == 'FROM_START' || where == 'FROM_END') {
|
||||
var msg = (where == 'FROM_START') ?
|
||||
Blockly.Msg.LISTS_INDEX_FROM_START_TOOLTIP :
|
||||
Blockly.Msg.LISTS_INDEX_FROM_END_TOOLTIP;
|
||||
if (msg) {
|
||||
tooltip += ' ' + msg.replace('%1',
|
||||
thisBlock.workspace.options.oneBasedIndex ? '#1' : '#0');
|
||||
}
|
||||
var dropdown = this.getField('WHERE');
|
||||
dropdown.setValidator(function(value) {
|
||||
var newAt = (value == 'FROM_START') || (value == 'FROM_END');
|
||||
if (newAt != this.isAt_) {
|
||||
var block = this.sourceBlock_;
|
||||
block.updateAt_(newAt);
|
||||
// This menu has been destroyed and replaced. Update the replacement.
|
||||
block.setFieldValue(value, 'WHERE');
|
||||
return null;
|
||||
}
|
||||
return undefined;
|
||||
});
|
||||
this.updateAt_(true);
|
||||
// Assign 'this' to a variable for use in the tooltip closure below.
|
||||
var thisBlock = this;
|
||||
this.setTooltip(function() {
|
||||
var where = thisBlock.getFieldValue('WHERE');
|
||||
var tooltip = Blockly.Msg.TEXT_CHARAT_TOOLTIP;
|
||||
if (where == 'FROM_START' || where == 'FROM_END') {
|
||||
var msg = (where == 'FROM_START') ?
|
||||
Blockly.Msg.LISTS_INDEX_FROM_START_TOOLTIP :
|
||||
Blockly.Msg.LISTS_INDEX_FROM_END_TOOLTIP;
|
||||
if (msg) {
|
||||
tooltip += ' ' + msg.replace('%1',
|
||||
thisBlock.workspace.options.oneBasedIndex ? '#1' : '#0');
|
||||
}
|
||||
return tooltip;
|
||||
});
|
||||
}
|
||||
return tooltip;
|
||||
});
|
||||
};
|
||||
|
||||
Blockly.Extensions.register('text_indexOf_tooltip',
|
||||
Blockly.Constants.Text.TEXT_INDEXOF_TOOLTIP_EXTENSION);
|
||||
Blockly.Constants.Text.TEXT_INDEXOF_TOOLTIP_EXTENSION);
|
||||
|
||||
Blockly.Extensions.register('text_quotes',
|
||||
Blockly.Constants.Text.TEXT_QUOTES_EXTENSION);
|
||||
Blockly.Constants.Text.TEXT_QUOTES_EXTENSION);
|
||||
|
||||
Blockly.Extensions.register('text_append_tooltip',
|
||||
Blockly.Constants.Text.TEXT_APPEND_TOOLTIP_EXTENSION);
|
||||
Blockly.Constants.Text.TEXT_APPEND_TOOLTIP_EXTENSION);
|
||||
|
||||
Blockly.Extensions.registerMutator('text_join_mutator',
|
||||
Blockly.Constants.Text.TEXT_JOIN_MUTATOR_MIXIN,
|
||||
Blockly.Constants.Text.TEXT_JOIN_EXTENSION);
|
||||
Blockly.Constants.Text.TEXT_JOIN_MUTATOR_MIXIN,
|
||||
Blockly.Constants.Text.TEXT_JOIN_EXTENSION);
|
||||
|
||||
Blockly.Extensions.registerMutator('text_charAt_mutator',
|
||||
Blockly.Constants.Text.TEXT_CHARAT_MUTATOR_MIXIN,
|
||||
Blockly.Constants.Text.TEXT_CHARAT_EXTENSION);
|
||||
Blockly.Constants.Text.TEXT_CHARAT_MUTATOR_MIXIN,
|
||||
Blockly.Constants.Text.TEXT_CHARAT_EXTENSION);
|
||||
|
||||
+10
-10
@@ -33,7 +33,7 @@ this.removeInput("ORDINAL",!0);a?(this.appendValueInput("AT").setCheck("Number")
|
||||
Blockly.Blocks.lists_getSublist={init:function(){this.WHERE_OPTIONS_1=[[Blockly.Msg.LISTS_GET_SUBLIST_START_FROM_START,"FROM_START"],[Blockly.Msg.LISTS_GET_SUBLIST_START_FROM_END,"FROM_END"],[Blockly.Msg.LISTS_GET_SUBLIST_START_FIRST,"FIRST"]];this.WHERE_OPTIONS_2=[[Blockly.Msg.LISTS_GET_SUBLIST_END_FROM_START,"FROM_START"],[Blockly.Msg.LISTS_GET_SUBLIST_END_FROM_END,"FROM_END"],[Blockly.Msg.LISTS_GET_SUBLIST_END_LAST,"LAST"]];this.setHelpUrl(Blockly.Msg.LISTS_GET_SUBLIST_HELPURL);this.setColour(Blockly.Blocks.lists.HUE);
|
||||
this.appendValueInput("LIST").setCheck("Array").appendField(Blockly.Msg.LISTS_GET_SUBLIST_INPUT_IN_LIST);this.appendDummyInput("AT1");this.appendDummyInput("AT2");Blockly.Msg.LISTS_GET_SUBLIST_TAIL&&this.appendDummyInput("TAIL").appendField(Blockly.Msg.LISTS_GET_SUBLIST_TAIL);this.setInputsInline(!0);this.setOutput(!0,"Array");this.updateAt_(1,!0);this.updateAt_(2,!0);this.setTooltip(Blockly.Msg.LISTS_GET_SUBLIST_TOOLTIP)},mutationToDom:function(){var a=document.createElement("mutation"),b=this.getInput("AT1").type==
|
||||
Blockly.INPUT_VALUE;a.setAttribute("at1",b);b=this.getInput("AT2").type==Blockly.INPUT_VALUE;a.setAttribute("at2",b);return a},domToMutation:function(a){var b="true"==a.getAttribute("at1");a="true"==a.getAttribute("at2");this.updateAt_(1,b);this.updateAt_(2,a)},updateAt_:function(a,b){this.removeInput("AT"+a);this.removeInput("ORDINAL"+a,!0);b?(this.appendValueInput("AT"+a).setCheck("Number"),Blockly.Msg.ORDINAL_NUMBER_SUFFIX&&this.appendDummyInput("ORDINAL"+a).appendField(Blockly.Msg.ORDINAL_NUMBER_SUFFIX)):
|
||||
this.appendDummyInput("AT"+a);var c=new Blockly.FieldDropdown(this["WHERE_OPTIONS_"+a],function(c){var e="FROM_START"==c||"FROM_END"==c;if(e!=b){var d=this.sourceBlock_;d.updateAt_(a,e);d.setFieldValue(c,"WHERE"+a);return null}});this.getInput("AT"+a).appendField(c,"WHERE"+a);1==a&&(this.moveInputBefore("AT1","AT2"),this.getInput("ORDINAL1")&&this.moveInputBefore("ORDINAL1","AT2"));Blockly.Msg.LISTS_GET_SUBLIST_TAIL&&this.moveInputBefore("TAIL",null)}};
|
||||
this.appendDummyInput("AT"+a);var c=new Blockly.FieldDropdown(this["WHERE_OPTIONS_"+a],function(c){var d="FROM_START"==c||"FROM_END"==c;if(d!=b){var f=this.sourceBlock_;f.updateAt_(a,d);f.setFieldValue(c,"WHERE"+a);return null}});this.getInput("AT"+a).appendField(c,"WHERE"+a);1==a&&(this.moveInputBefore("AT1","AT2"),this.getInput("ORDINAL1")&&this.moveInputBefore("ORDINAL1","AT2"));Blockly.Msg.LISTS_GET_SUBLIST_TAIL&&this.moveInputBefore("TAIL",null)}};
|
||||
Blockly.Blocks.lists_sort={init:function(){this.jsonInit({message0:Blockly.Msg.LISTS_SORT_TITLE,args0:[{type:"field_dropdown",name:"TYPE",options:[[Blockly.Msg.LISTS_SORT_TYPE_NUMERIC,"NUMERIC"],[Blockly.Msg.LISTS_SORT_TYPE_TEXT,"TEXT"],[Blockly.Msg.LISTS_SORT_TYPE_IGNORECASE,"IGNORE_CASE"]]},{type:"field_dropdown",name:"DIRECTION",options:[[Blockly.Msg.LISTS_SORT_ORDER_ASCENDING,"1"],[Blockly.Msg.LISTS_SORT_ORDER_DESCENDING,"-1"]]},{type:"input_value",name:"LIST",check:"Array"}],output:"Array",colour:Blockly.Blocks.lists.HUE,
|
||||
tooltip:Blockly.Msg.LISTS_SORT_TOOLTIP,helpUrl:Blockly.Msg.LISTS_SORT_HELPURL})}};
|
||||
Blockly.Blocks.lists_split={init:function(){var a=this,b=new Blockly.FieldDropdown([[Blockly.Msg.LISTS_SPLIT_LIST_FROM_TEXT,"SPLIT"],[Blockly.Msg.LISTS_SPLIT_TEXT_FROM_LIST,"JOIN"]],function(b){a.updateType_(b)});this.setHelpUrl(Blockly.Msg.LISTS_SPLIT_HELPURL);this.setColour(Blockly.Blocks.lists.HUE);this.appendValueInput("INPUT").setCheck("String").appendField(b,"MODE");this.appendValueInput("DELIM").setCheck("String").appendField(Blockly.Msg.LISTS_SPLIT_WITH_DELIMITER);this.setInputsInline(!0);
|
||||
@@ -67,8 +67,8 @@ args1:[{type:"input_statement",name:"DO"}],previousStatement:null,nextStatement:
|
||||
helpUrl:"%{BKY_CONTROLS_FLOW_STATEMENTS_HELPURL}",extensions:["controls_flow_tooltip","controls_flow_in_loop_check"]}]);Blockly.Constants.Loops.WHILE_UNTIL_TOOLTIPS={WHILE:"%{BKY_CONTROLS_WHILEUNTIL_TOOLTIP_WHILE}",UNTIL:"%{BKY_CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL}"};Blockly.Extensions.register("controls_whileUntil_tooltip",Blockly.Extensions.buildTooltipForDropdown("MODE",Blockly.Constants.Loops.WHILE_UNTIL_TOOLTIPS));
|
||||
Blockly.Constants.Loops.BREAK_CONTINUE_TOOLTIPS={BREAK:"%{BKY_CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK}",CONTINUE:"%{BKY_CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE}"};Blockly.Extensions.register("controls_flow_tooltip",Blockly.Extensions.buildTooltipForDropdown("FLOW",Blockly.Constants.Loops.BREAK_CONTINUE_TOOLTIPS));
|
||||
Blockly.Constants.Loops.CUSTOM_CONTEXT_MENU_CREATE_VARIABLES_GET_MIXIN={customContextMenu:function(a){var b=this.getFieldValue("VAR");if(!this.isCollapsed()&&null!=b){var c={enabled:!0};c.text=Blockly.Msg.VARIABLES_SET_CREATE_GET.replace("%1",b);b=goog.dom.createDom("field",null,b);b.setAttribute("name","VAR");b=goog.dom.createDom("block",null,b);b.setAttribute("type","variables_get");c.callback=Blockly.ContextMenu.callbackFactory(this,b);a.push(c)}}};
|
||||
Blockly.Extensions.registerMixin("contextMenu_newGetVariableBlock",Blockly.Constants.Loops.CUSTOM_CONTEXT_MENU_CREATE_VARIABLES_GET_MIXIN);Blockly.Extensions.register("controls_for_tooltip",Blockly.Extensions.buildTooltipWithFieldValue(Blockly.Msg.CONTROLS_FOR_TOOLTIP,"VAR"));Blockly.Extensions.register("controls_forEach_tooltip",Blockly.Extensions.buildTooltipWithFieldValue(Blockly.Msg.CONTROLS_FOREACH_TOOLTIP,"VAR"));
|
||||
Blockly.Constants.Loops.CONTROL_FLOW_CHECK_IN_LOOP_MIXIN={LOOP_TYPES:["controls_repeat","controls_repeat_ext","controls_forEach","controls_for","controls_whileUntil"],onchange:function(){if(this.workspace.isDragging&&!this.workspace.isDragging()){var a=!1,b=this;do{if(-1!=this.LOOP_TYPES.indexOf(b.type)){a=!0;break}b=b.getSurroundParent()}while(b);a?(this.setWarningText(null),this.isInFlyout||this.setDisabled(!1)):(this.setWarningText(Blockly.Msg.CONTROLS_FLOW_STATEMENTS_WARNING),this.isInFlyout||
|
||||
Blockly.Extensions.registerMixin("contextMenu_newGetVariableBlock",Blockly.Constants.Loops.CUSTOM_CONTEXT_MENU_CREATE_VARIABLES_GET_MIXIN);Blockly.Extensions.register("controls_for_tooltip",Blockly.Extensions.buildTooltipWithFieldValue("%{BKY_CONTROLS_FOR_TOOLTIP}","VAR"));Blockly.Extensions.register("controls_forEach_tooltip",Blockly.Extensions.buildTooltipWithFieldValue("%{BKY_CONTROLS_FOREACH_TOOLTIP}","VAR"));
|
||||
Blockly.Constants.Loops.CONTROL_FLOW_IN_LOOP_CHECK_MIXIN={LOOP_TYPES:["controls_repeat","controls_repeat_ext","controls_forEach","controls_for","controls_whileUntil"],onchange:function(){if(this.workspace.isDragging&&!this.workspace.isDragging()){var a=!1,b=this;do{if(-1!=this.LOOP_TYPES.indexOf(b.type)){a=!0;break}b=b.getSurroundParent()}while(b);a?(this.setWarningText(null),this.isInFlyout||this.setDisabled(!1)):(this.setWarningText(Blockly.Msg.CONTROLS_FLOW_STATEMENTS_WARNING),this.isInFlyout||
|
||||
this.getInheritedDisabled()||this.setDisabled(!0))}}};Blockly.Extensions.registerMixin("controls_flow_in_loop_check",Blockly.Constants.Loops.CONTROL_FLOW_IN_LOOP_CHECK_MIXIN);Blockly.Blocks.math={};Blockly.Constants.Math={};Blockly.Constants.Math.HUE=230;Blockly.Blocks.math.HUE=Blockly.Constants.Math.HUE;
|
||||
Blockly.defineBlocksWithJsonArray([{type:"math_number",message0:"%1",args0:[{type:"field_number",name:"NUM",value:0}],output:"Number",colour:"%{BKY_MATH_HUE}",helpUrl:"%{BKY_MATH_NUMBER_HELPURL}",tooltip:"%{BKY_MATH_NUMBER_TOOLTIP}",extensions:["parent_tooltip_when_inline"]},{type:"math_arithmetic",message0:"%1 %2 %3",args0:[{type:"input_value",name:"A",check:"Number"},{type:"field_dropdown",name:"OP",options:[["%{BKY_MATH_ADDITION_SYMBOL}","ADD"],["%{BKY_MATH_SUBTRACTION_SYMBOL}","MINUS"],["%{BKY_MATH_MULTIPLICATION_SYMBOL}",
|
||||
"MULTIPLY"],["%{BKY_MATH_DIVISION_SYMBOL}","DIVIDE"],["%{BKY_MATH_POWER_SYMBOL}","POWER"]]},{type:"input_value",name:"B",check:"Number"}],inputsInline:!0,output:"Number",colour:"%{BKY_MATH_HUE}",helpUrl:"%{BKY_MATH_ARITHMETIC_HELPURL}",extensions:["math_op_tooltip"]},{type:"math_single",message0:"%1 %2",args0:[{type:"field_dropdown",name:"OP",options:[["%{BKY_MATH_SINGLE_OP_ROOT}","ROOT"],["%{BKY_MATH_SINGLE_OP_ABSOLUTE}","ABS"],["-","NEG"],["ln","LN"],["log10","LOG10"],["e^","EXP"],["10^","POW10"]]},
|
||||
@@ -85,7 +85,7 @@ SIN:"%{BKY_MATH_TRIG_TOOLTIP_SIN}",COS:"%{BKY_MATH_TRIG_TOOLTIP_COS}",TAN:"%{BKY
|
||||
Blockly.Extensions.register("math_op_tooltip",Blockly.Extensions.buildTooltipForDropdown("OP",Blockly.Constants.Math.TOOLTIPS_BY_OP));
|
||||
Blockly.Constants.Math.IS_DIVISIBLEBY_MUTATOR_MIXIN={mutationToDom:function(){var a=document.createElement("mutation"),b="DIVISIBLE_BY"==this.getFieldValue("PROPERTY");a.setAttribute("divisor_input",b);return a},domToMutation:function(a){a="true"==a.getAttribute("divisor_input");this.updateShape_(a)},updateShape_:function(a){var b=this.getInput("DIVISOR");a?b||this.appendValueInput("DIVISOR").setCheck("Number"):b&&this.removeInput("DIVISOR")}};
|
||||
Blockly.Constants.Math.IS_DIVISIBLE_MUTATOR_EXTENSION=function(){this.getField("PROPERTY").setValidator(function(a){this.sourceBlock_.updateShape_("DIVISIBLE_BY"==a)})};Blockly.Extensions.registerMutator("math_is_divisibleby_mutator",Blockly.Constants.Math.IS_DIVISIBLEBY_MUTATOR_MIXIN,Blockly.Constants.Math.IS_DIVISIBLE_MUTATOR_EXTENSION);Blockly.Constants.Math.CHANGE_TOOLTIP_EXTENSION=function(){this.setTooltip(function(){return Blockly.Msg.MATH_CHANGE_TOOLTIP.replace("%1",this.getFieldValue("VAR"))}.bind(this))};
|
||||
Blockly.Extensions.register("math_change_tooltip",Blockly.Extensions.buildTooltipWithFieldValue(Blockly.Msg.MATH_CHANGE_TOOLTIP,"VAR"));Blockly.Constants.Math.LIST_MODES_MUTATOR_MIXIN={updateType_:function(a){"MODE"==a?this.outputConnection.setCheck("Array"):this.outputConnection.setCheck("Number")},mutationToDom:function(){var a=document.createElement("mutation");a.setAttribute("op",this.getFieldValue("OP"));return a},domToMutation:function(a){this.updateType_(a.getAttribute("op"))}};
|
||||
Blockly.Extensions.register("math_change_tooltip",Blockly.Extensions.buildTooltipWithFieldValue("%{BKY_MATH_CHANGE_TOOLTIP}","VAR"));Blockly.Constants.Math.LIST_MODES_MUTATOR_MIXIN={updateType_:function(a){"MODE"==a?this.outputConnection.setCheck("Array"):this.outputConnection.setCheck("Number")},mutationToDom:function(){var a=document.createElement("mutation");a.setAttribute("op",this.getFieldValue("OP"));return a},domToMutation:function(a){this.updateType_(a.getAttribute("op"))}};
|
||||
Blockly.Constants.Math.LIST_MODES_MUTATOR_EXTENSION=function(){this.getField("OP").setValidator(function(a){this.updateType_(a)}.bind(this))};Blockly.Extensions.registerMutator("math_modes_of_list_mutator",Blockly.Constants.Math.LIST_MODES_MUTATOR_MIXIN,Blockly.Constants.Math.LIST_MODES_MUTATOR_EXTENSION);Blockly.Blocks.procedures={};Blockly.Blocks.procedures.HUE=290;
|
||||
Blockly.Blocks.procedures_defnoreturn={init:function(){var a=new Blockly.FieldTextInput("",Blockly.Procedures.rename);a.setSpellcheck(!1);this.appendDummyInput().appendField(Blockly.Msg.PROCEDURES_DEFNORETURN_TITLE).appendField(a,"NAME").appendField("","PARAMS");this.setMutator(new Blockly.Mutator(["procedures_mutatorarg"]));(this.workspace.options.comments||this.workspace.options.parentWorkspace&&this.workspace.options.parentWorkspace.options.comments)&&Blockly.Msg.PROCEDURES_DEFNORETURN_COMMENT&&
|
||||
this.setCommentText(Blockly.Msg.PROCEDURES_DEFNORETURN_COMMENT);this.setColour(Blockly.Blocks.procedures.HUE);this.setTooltip(Blockly.Msg.PROCEDURES_DEFNORETURN_TOOLTIP);this.setHelpUrl(Blockly.Msg.PROCEDURES_DEFNORETURN_HELPURL);this.arguments_=[];this.setStatements_(!0);this.statementConnection_=null},setStatements_:function(a){this.hasStatements_!==a&&(a?(this.appendStatementInput("STACK").appendField(Blockly.Msg.PROCEDURES_DEFNORETURN_DO),this.getInput("RETURN")&&this.moveInputBefore("STACK",
|
||||
@@ -122,7 +122,7 @@ Blockly.defineBlocksWithJsonArray([{type:"text",message0:"%1",args0:[{type:"fiel
|
||||
args0:[{type:"input_dummy"},{type:"input_statement",name:"STACK"}],colour:"%{BKY_TEXTS_HUE}",tooltip:"%{BKY_TEXT_CREATE_JOIN_TOOLTIP}",enableContextMenu:!1},{type:"text_create_join_item",message0:"%{BKY_TEXT_CREATE_JOIN_ITEM_TITLE_ITEM}",previousStatement:null,nextStatement:null,colour:"%{BKY_TEXTS_HUE}",tooltip:"{%BKY_TEXT_CREATE_JOIN_ITEM_TOOLTIP}",enableContextMenu:!1},{type:"text_append",message0:"%{BKY_TEXT_APPEND_TITLE}",args0:[{type:"field_variable",name:"VAR",variable:"%{BKY_TEXT_APPEND_VARIABLE}"},
|
||||
{type:"input_value",name:"TEXT"}],previousStatement:null,nextStatement:null,colour:"%{BKY_TEXTS_HUE}",extensions:["text_append_tooltip"]},{type:"text_length",message0:"%{BKY_TEXT_LENGTH_TITLE}",args0:[{type:"input_value",name:"VALUE",check:["String","Array"]}],output:"Number",colour:"%{BKY_TEXTS_HUE}",tooltip:"%{BKY_TEXT_LENGTH_TOOLTIP}",helpUrl:"%{BKY_TEXT_LENGTH_HELPURL}"},{type:"text_isEmpty",message0:"%{BKY_TEXT_ISEMPTY_TITLE}",args0:[{type:"input_value",name:"VALUE",check:["String","Array"]}],
|
||||
output:"Boolean",colour:"%{BKY_TEXTS_HUE}",tooltip:"%{BKY_TEXT_ISEMPTY_TOOLTIP}",helpUrl:"%{BKY_TEXT_ISEMPTY_HELPURL}"},{type:"text_indexOf",message0:"%{BKY_TEXT_INDEXOF_TITLE}",args0:[{type:"input_value",name:"VALUE",check:"String"},{type:"field_dropdown",name:"END",options:[["%{BKY_TEXT_INDEXOF_OPERATOR_FIRST}","FIRST"],["%{BKY_TEXT_INDEXOF_OPERATOR_LAST}","LAST"]]},{type:"input_value",name:"FIND",check:"String"}],output:"Number",colour:"%{BKY_TEXTS_HUE}",helpUrl:"%{BKY_TEXT_INDEXOF_HELPURL}",inputsInline:!0,
|
||||
extensions:["text_indexOf_tooltip"]},{type:"text_charAt",message0:"%{BKY_TEXT_CHARAT_TITLE}",args0:[{type:"input_value",name:"VALUE",check:"String"},{type:"input_dummy",name:"AT"}],output:"String",colour:"%{BKY_TEXTS_HUE}",helpUrl:"%{BKY_TEXT_CHARAT_HELPURL}",inputsInline:!0,mutator:"text_charAt_mutator"}]);
|
||||
extensions:["text_indexOf_tooltip"]},{type:"text_charAt",message0:"%{BKY_TEXT_CHARAT_TITLE}",args0:[{type:"input_value",name:"VALUE",check:"String"},{type:"field_dropdown",name:"WHERE",options:[["%{BKY_TEXT_CHARAT_FROM_START}","FROM_START"],["%{BKY_TEXT_CHARAT_FROM_END}","FROM_END"],["%{BKY_TEXT_CHARAT_FIRST}","FIRST"],["%{BKY_TEXT_CHARAT_LAST}","LAST"],["%{BKY_TEXT_CHARAT_RANDOM}","RANDOM"]]}],output:"String",colour:"%{BKY_TEXTS_HUE}",helpUrl:"%{BKY_TEXT_CHARAT_HELPURL}",inputsInline:!0,mutator:"text_charAt_mutator"}]);
|
||||
Blockly.Blocks.text_getSubstring={init:function(){this.WHERE_OPTIONS_1=[[Blockly.Msg.TEXT_GET_SUBSTRING_START_FROM_START,"FROM_START"],[Blockly.Msg.TEXT_GET_SUBSTRING_START_FROM_END,"FROM_END"],[Blockly.Msg.TEXT_GET_SUBSTRING_START_FIRST,"FIRST"]];this.WHERE_OPTIONS_2=[[Blockly.Msg.TEXT_GET_SUBSTRING_END_FROM_START,"FROM_START"],[Blockly.Msg.TEXT_GET_SUBSTRING_END_FROM_END,"FROM_END"],[Blockly.Msg.TEXT_GET_SUBSTRING_END_LAST,"LAST"]];this.setHelpUrl(Blockly.Msg.TEXT_GET_SUBSTRING_HELPURL);this.setColour(Blockly.Blocks.texts.HUE);
|
||||
this.appendValueInput("STRING").setCheck("String").appendField(Blockly.Msg.TEXT_GET_SUBSTRING_INPUT_IN_TEXT);this.appendDummyInput("AT1");this.appendDummyInput("AT2");Blockly.Msg.TEXT_GET_SUBSTRING_TAIL&&this.appendDummyInput("TAIL").appendField(Blockly.Msg.TEXT_GET_SUBSTRING_TAIL);this.setInputsInline(!0);this.setOutput(!0,"String");this.updateAt_(1,!0);this.updateAt_(2,!0);this.setTooltip(Blockly.Msg.TEXT_GET_SUBSTRING_TOOLTIP)},mutationToDom:function(){var a=document.createElement("mutation"),
|
||||
b=this.getInput("AT1").type==Blockly.INPUT_VALUE;a.setAttribute("at1",b);b=this.getInput("AT2").type==Blockly.INPUT_VALUE;a.setAttribute("at2",b);return a},domToMutation:function(a){var b="true"==a.getAttribute("at1");a="true"==a.getAttribute("at2");this.updateAt_(1,b);this.updateAt_(2,a)},updateAt_:function(a,b){this.removeInput("AT"+a);this.removeInput("ORDINAL"+a,!0);b?(this.appendValueInput("AT"+a).setCheck("Number"),Blockly.Msg.ORDINAL_NUMBER_SUFFIX&&this.appendDummyInput("ORDINAL"+a).appendField(Blockly.Msg.ORDINAL_NUMBER_SUFFIX)):
|
||||
@@ -145,11 +145,11 @@ e.nextConnection}return b},compose:function(a){var b=a.getInputTargetBlock("STAC
|
||||
this.getInput("ADD"+b);a.valueConnection_=c&&c.connection.targetConnection;b++;a=a.nextConnection&&a.nextConnection.targetBlock()}},updateShape_:function(){this.itemCount_&&this.getInput("EMPTY")?this.removeInput("EMPTY"):this.itemCount_||this.getInput("EMPTY")||this.appendDummyInput("EMPTY").appendField(this.newQuote_(!0)).appendField(this.newQuote_(!1));for(var a=0;a<this.itemCount_;a++)if(!this.getInput("ADD"+a)){var b=this.appendValueInput("ADD"+a);0==a&&b.appendField(Blockly.Msg.TEXT_JOIN_TITLE_CREATEWITH)}for(;this.getInput("ADD"+
|
||||
a);)this.removeInput("ADD"+a),a++}};Blockly.Constants.Text.TEXT_JOIN_EXTENSION=function(){this.mixin(Blockly.Constants.Text.QUOTE_IMAGE_MIXIN);this.itemCount_=2;this.updateShape_();this.setMutator(new Blockly.Mutator(["text_create_join_item"]))};Blockly.Constants.Text.TEXT_APPEND_TOOLTIP_EXTENSION=function(){var a=this;this.setTooltip(function(){return Blockly.Msg.TEXT_APPEND_TOOLTIP?Blockly.Msg.TEXT_APPEND_TOOLTIP.replace("%1",a.getFieldValue("VAR")):""})};
|
||||
Blockly.Constants.Text.TEXT_INDEXOF_TOOLTIP_EXTENSION=function(){var a=this;this.setTooltip(function(){return Blockly.Msg.TEXT_INDEXOF_TOOLTIP.replace("%1",a.workspace.options.oneBasedIndex?"0":"-1")})};
|
||||
Blockly.Constants.Text.TEXT_CHARAT_MUTATOR_MIXIN={mutationToDom:function(){var a=document.createElement("mutation"),b=this.getInput("AT").type==Blockly.INPUT_VALUE;a.setAttribute("at",b);return a},domToMutation:function(a){a="false"!=a.getAttribute("at");this.updateAt_(a)},updateAt_:function(a){this.removeInput("AT");this.removeInput("ORDINAL",!0);a?(this.appendValueInput("AT").setCheck("Number"),Blockly.Msg.ORDINAL_NUMBER_SUFFIX&&this.appendDummyInput("ORDINAL").appendField(Blockly.Msg.ORDINAL_NUMBER_SUFFIX)):
|
||||
this.appendDummyInput("AT");Blockly.Msg.TEXT_CHARAT_TAIL&&(this.removeInput("TAIL",!0),this.appendDummyInput("TAIL").appendField(Blockly.Msg.TEXT_CHARAT_TAIL));var b=new Blockly.FieldDropdown(this.WHERE_OPTIONS,function(b){var c="FROM_START"==b||"FROM_END"==b;if(c!=a){var e=this.sourceBlock_;e.updateAt_(c);e.setFieldValue(b,"WHERE");return null}});this.getInput("AT").appendField(b,"WHERE")}};
|
||||
Blockly.Constants.Text.TEXT_CHARAT_EXTENSION=function(){this.WHERE_OPTIONS=[[Blockly.Msg.TEXT_CHARAT_FROM_START,"FROM_START"],[Blockly.Msg.TEXT_CHARAT_FROM_END,"FROM_END"],[Blockly.Msg.TEXT_CHARAT_FIRST,"FIRST"],[Blockly.Msg.TEXT_CHARAT_LAST,"LAST"],[Blockly.Msg.TEXT_CHARAT_RANDOM,"RANDOM"]];this.updateAt_(!0);var a=this;this.setTooltip(function(){var b=a.getFieldValue("WHERE"),c=Blockly.Msg.TEXT_CHARAT_TOOLTIP;("FROM_START"==b||"FROM_END"==b)&&(b="FROM_START"==b?Blockly.Msg.LISTS_INDEX_FROM_START_TOOLTIP:
|
||||
Blockly.Msg.LISTS_INDEX_FROM_END_TOOLTIP)&&(c+=" "+b.replace("%1",a.workspace.options.oneBasedIndex?"#1":"#0"));return c})};Blockly.Extensions.register("text_indexOf_tooltip",Blockly.Constants.Text.TEXT_INDEXOF_TOOLTIP_EXTENSION);Blockly.Extensions.register("text_quotes",Blockly.Constants.Text.TEXT_QUOTES_EXTENSION);Blockly.Extensions.register("text_append_tooltip",Blockly.Constants.Text.TEXT_APPEND_TOOLTIP_EXTENSION);
|
||||
Blockly.Extensions.registerMutator("text_join_mutator",Blockly.Constants.Text.TEXT_JOIN_MUTATOR_MIXIN,Blockly.Constants.Text.TEXT_JOIN_EXTENSION);Blockly.Extensions.registerMutator("text_charAt_mutator",Blockly.Constants.Text.TEXT_CHARAT_MUTATOR_MIXIN,Blockly.Constants.Text.TEXT_CHARAT_EXTENSION);Blockly.Blocks.variables={};Blockly.Constants.Variables={};Blockly.Constants.Variables.HUE=330;Blockly.Blocks.variables.HUE=Blockly.Constants.Variables.HUE;
|
||||
Blockly.Constants.Text.TEXT_CHARAT_MUTATOR_MIXIN={mutationToDom:function(){var a=document.createElement("mutation");a.setAttribute("at",!!this.isAt_);return a},domToMutation:function(a){a="false"!=a.getAttribute("at");this.updateAt_(a)},updateAt_:function(a){this.removeInput("AT",!0);this.removeInput("ORDINAL",!0);a&&(this.appendValueInput("AT").setCheck("Number"),Blockly.Msg.ORDINAL_NUMBER_SUFFIX&&this.appendDummyInput("ORDINAL").appendField(Blockly.Msg.ORDINAL_NUMBER_SUFFIX));Blockly.Msg.TEXT_CHARAT_TAIL&&
|
||||
(this.removeInput("TAIL",!0),this.appendDummyInput("TAIL").appendField(Blockly.Msg.TEXT_CHARAT_TAIL));this.isAt_=a}};
|
||||
Blockly.Constants.Text.TEXT_CHARAT_EXTENSION=function(){this.getField("WHERE").setValidator(function(a){var b="FROM_START"==a||"FROM_END"==a;if(b!=this.isAt_){var d=this.sourceBlock_;d.updateAt_(b);d.setFieldValue(a,"WHERE");return null}});this.updateAt_(!0);var a=this;this.setTooltip(function(){var b=a.getFieldValue("WHERE"),c=Blockly.Msg.TEXT_CHARAT_TOOLTIP;("FROM_START"==b||"FROM_END"==b)&&(b="FROM_START"==b?Blockly.Msg.LISTS_INDEX_FROM_START_TOOLTIP:Blockly.Msg.LISTS_INDEX_FROM_END_TOOLTIP)&&
|
||||
(c+=" "+b.replace("%1",a.workspace.options.oneBasedIndex?"#1":"#0"));return c})};Blockly.Extensions.register("text_indexOf_tooltip",Blockly.Constants.Text.TEXT_INDEXOF_TOOLTIP_EXTENSION);Blockly.Extensions.register("text_quotes",Blockly.Constants.Text.TEXT_QUOTES_EXTENSION);Blockly.Extensions.register("text_append_tooltip",Blockly.Constants.Text.TEXT_APPEND_TOOLTIP_EXTENSION);Blockly.Extensions.registerMutator("text_join_mutator",Blockly.Constants.Text.TEXT_JOIN_MUTATOR_MIXIN,Blockly.Constants.Text.TEXT_JOIN_EXTENSION);
|
||||
Blockly.Extensions.registerMutator("text_charAt_mutator",Blockly.Constants.Text.TEXT_CHARAT_MUTATOR_MIXIN,Blockly.Constants.Text.TEXT_CHARAT_EXTENSION);Blockly.Blocks.variables={};Blockly.Constants.Variables={};Blockly.Constants.Variables.HUE=330;Blockly.Blocks.variables.HUE=Blockly.Constants.Variables.HUE;
|
||||
Blockly.defineBlocksWithJsonArray([{type:"variables_get",message0:"%1",args0:[{type:"field_variable",name:"VAR",variable:"%{BKY_VARIABLES_DEFAULT_NAME}"}],output:null,colour:"%{BKY_VARIABLES_HUE}",helpUrl:"%{BKY_VARIABLES_GET_HELPURL}",tooltip:"%{BKY_VARIABLES_GET_TOOLTIP}",extensions:["contextMenu_variableSetterGetter"]},{type:"variables_set",message0:"%{BKY_VARIABLES_SET}",args0:[{type:"field_variable",name:"VAR",variable:"%{BKY_VARIABLES_DEFAULT_NAME}"},{type:"input_value",name:"VALUE"}],previousStatement:null,
|
||||
nextStatement:null,colour:"%{BKY_VARIABLES_HUE}",tooltip:"%{BKY_VARIABLES_SET_TOOLTIP}",helpUrl:"%{BKY_VARIABLES_SET_HELPURL}",extensions:["contextMenu_variableSetterGetter"]}]);
|
||||
Blockly.Constants.Variables.CUSTOM_CONTEXT_MENU_VARIABLE_GETTER_SETTER_MIXIN={customContextMenu:function(a){if("variables_get"==this.type)var b="variables_set",c=Blockly.Msg.VARIABLES_GET_CREATE_SET;else b="variables_get",c=Blockly.Msg.VARIABLES_SET_CREATE_GET;var d={enabled:0<this.workspace.remainingCapacity()},e=this.getFieldValue("VAR");d.text=c.replace("%1",e);c=goog.dom.createDom("field",null,e);c.setAttribute("name","VAR");c=goog.dom.createDom("block",null,c);c.setAttribute("type",b);d.callback=
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
# The uncompressed file is a script that loads in each of Blockly's core files
|
||||
# one by one. This takes much longer for a browser to load, but is useful
|
||||
# when debugging code since line numbers are meaningful and variables haven't
|
||||
# been renamed. The uncompressed file also allows for a faster developement
|
||||
# been renamed. The uncompressed file also allows for a faster development
|
||||
# cycle since there is no need to rebuild or recompile, just reload.
|
||||
#
|
||||
# The second pair are:
|
||||
@@ -45,10 +45,11 @@
|
||||
#
|
||||
# This script also generates:
|
||||
# blocks_compressed.js: The compressed Blockly language blocks.
|
||||
# javascript_compressed.js: The compressed Javascript generator.
|
||||
# javascript_compressed.js: The compressed JavaScript generator.
|
||||
# python_compressed.js: The compressed Python generator.
|
||||
# dart_compressed.js: The compressed Dart generator.
|
||||
# php_compressed.js: The compressed PHP generator.
|
||||
# lua_compressed.js: The compressed Lua generator.
|
||||
# dart_compressed.js: The compressed Dart generator.
|
||||
# msg/js/<LANG>.js for every language <LANG> defined in msg/js/<LANG>.json.
|
||||
|
||||
import sys
|
||||
@@ -60,10 +61,9 @@ for arg in sys.argv[1:len(sys.argv)]:
|
||||
if (arg != 'core' and
|
||||
arg != 'accessible' and
|
||||
arg != 'generators' and
|
||||
arg != 'langfiles' and
|
||||
arg != 'demo'):
|
||||
raise Exception("Invalid argument: \"" + arg + "\". Usage: build.py <0 or more of accessible," +
|
||||
" core, generators, langfiles, demo>")
|
||||
arg != 'langfiles'):
|
||||
raise Exception("Invalid argument: \"" + arg + "\". Usage: build.py "
|
||||
"<0 or more of accessible, core, generators, langfiles>")
|
||||
|
||||
import errno, glob, httplib, json, os, re, subprocess, threading, urllib
|
||||
|
||||
@@ -212,49 +212,8 @@ class Gen_compressed(threading.Thread):
|
||||
self.gen_generator("javascript")
|
||||
self.gen_generator("python")
|
||||
self.gen_generator("php")
|
||||
self.gen_generator("dart")
|
||||
self.gen_generator("lua")
|
||||
|
||||
if ('demo' in self.bundles):
|
||||
self.gen_together()
|
||||
|
||||
def gen_together(self):
|
||||
target_filename = os.path.join("demos", "fixed-advanced", "main_compressed.js")
|
||||
# Define the parameters for the POST request.
|
||||
params = [
|
||||
("compilation_level", "ADVANCED_OPTIMIZATIONS"),
|
||||
("use_closure_library", "true"),
|
||||
("generate_exports", "true"),
|
||||
("output_format", "json"),
|
||||
("output_info", "compiled_code"),
|
||||
("output_info", "warnings"),
|
||||
("output_info", "errors"),
|
||||
("output_info", "statistics"),
|
||||
# debug options (to make the uglified code readable)
|
||||
# ("formatting", "pretty_print"),
|
||||
# ("formatting", "print_input_delimiter"),
|
||||
# ("debug", "true"),
|
||||
]
|
||||
|
||||
# Read in all the source files.
|
||||
filenames = calcdeps.CalculateDependencies(self.search_paths,
|
||||
[os.path.join("demos", "fixed-advanced", "main.js")])
|
||||
filenames.sort() # Deterministic build.
|
||||
for filename in filenames:
|
||||
# Filter out the Closure files (the compiler will add them).
|
||||
if filename.startswith(os.pardir + os.sep): # '../'
|
||||
continue
|
||||
f = open(filename)
|
||||
params.append(("js_code", "".join(f.readlines())))
|
||||
f.close()
|
||||
|
||||
externs = [os.path.join("externs", "svg-externs.js")]
|
||||
for filename in externs:
|
||||
f = open(filename)
|
||||
params.append(("js_externs", "".join(f.readlines())))
|
||||
f.close()
|
||||
|
||||
self.do_compile(params, target_filename, filenames, "")
|
||||
self.gen_generator("dart")
|
||||
|
||||
def gen_core(self):
|
||||
target_filename = "blockly_compressed.js"
|
||||
@@ -403,7 +362,12 @@ class Gen_compressed(threading.Thread):
|
||||
conn.close()
|
||||
|
||||
# Parse the JSON response.
|
||||
json_data = json.loads(json_str)
|
||||
try:
|
||||
json_data = json.loads(json_str)
|
||||
except ValueError:
|
||||
print("ERROR: Could not parse JSON for %s. Raw data:" % target_filename)
|
||||
print(json_str)
|
||||
return
|
||||
|
||||
def file_lookup(name):
|
||||
if not name.startswith("Input_"):
|
||||
@@ -610,16 +574,8 @@ developers.google.com/blockly/guides/modify/web/closure""")
|
||||
if ('accessible' in args):
|
||||
Gen_uncompressed(full_search_paths, 'blockly_accessible_uncompressed.js').start()
|
||||
|
||||
if ('demo' in args):
|
||||
all_search_paths = calcdeps.ExpandDirectories(
|
||||
["accessible", "core", "blocks", os.path.join("demos", "fixed-advanced"), os.path.join("msg", "js"), os.path.join(os.path.pardir, "closure-library")])
|
||||
all_search_paths.sort() # Deterministic build.
|
||||
print("Compressing " + str(len(all_search_paths)) + " files...")
|
||||
Gen_compressed(all_search_paths, args).start()
|
||||
|
||||
else:
|
||||
# Compressed is limited by network and server speed.
|
||||
Gen_compressed(full_search_paths, args).start()
|
||||
# Compressed is limited by network and server speed.
|
||||
Gen_compressed(full_search_paths, args).start()
|
||||
|
||||
# This is run locally in a separate thread
|
||||
# defaultlangfiles checks for changes in the msg files, while manually asking
|
||||
|
||||
+20
-11
@@ -48,7 +48,7 @@ goog.require('goog.string');
|
||||
* @param {?string} prototypeName Name of the language object containing
|
||||
* type-specific functions for this block.
|
||||
* @param {string=} opt_id Optional ID. Use this ID if provided, otherwise
|
||||
* create a new id.
|
||||
* create a new ID.
|
||||
* @constructor
|
||||
*/
|
||||
Blockly.Block = function(workspace, prototypeName, opt_id) {
|
||||
@@ -261,7 +261,7 @@ Blockly.Block.prototype.dispose = function(healStack) {
|
||||
/**
|
||||
* Unplug this block from its superior block. If this block is a statement,
|
||||
* optionally reconnect the block underneath with the block on top.
|
||||
* @param {boolean} opt_healStack Disconnect child statement and reconnect
|
||||
* @param {boolean=} opt_healStack Disconnect child statement and reconnect
|
||||
* stack. Defaults to false.
|
||||
*/
|
||||
Blockly.Block.prototype.unplug = function(opt_healStack) {
|
||||
@@ -293,10 +293,13 @@ Blockly.Block.prototype.unplug = function(opt_healStack) {
|
||||
|
||||
/**
|
||||
* Returns all connections originating from this block.
|
||||
* @param {boolean} all If true, return all connections even hidden ones.
|
||||
* @return {!Array.<!Blockly.Connection>} Array of connections.
|
||||
* @private
|
||||
*/
|
||||
Blockly.Block.prototype.getConnections_ = function() {
|
||||
Blockly.Block.prototype.getConnections_ = function(
|
||||
/* eslint-disable no-unused-vars */ all
|
||||
/* eslint-enable no-unused-vars */) {
|
||||
var myConnections = [];
|
||||
if (this.outputConnection) {
|
||||
myConnections.push(this.outputConnection);
|
||||
@@ -608,7 +611,7 @@ Blockly.Block.prototype.getColour = function() {
|
||||
*/
|
||||
Blockly.Block.prototype.getHue = function() {
|
||||
return this.hue_;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Change the colour of a block.
|
||||
@@ -619,9 +622,9 @@ Blockly.Block.prototype.setColour = function(colour) {
|
||||
if (!isNaN(hue) && 0 <= hue && hue <= 360) {
|
||||
this.hue_ = hue;
|
||||
this.colour_ = Blockly.hueToRgb(hue);
|
||||
} else if (goog.isString(colour) && colour.match(/^#[0-9a-fA-F]{6}$/)) {
|
||||
} else if (goog.isString(colour) && /^#[0-9a-fA-F]{6}$/.test(colour)) {
|
||||
this.colour_ = colour;
|
||||
// Only store hue if colour is set as a hue
|
||||
// Only store hue if colour is set as a hue.
|
||||
this.hue_ = null;
|
||||
} else {
|
||||
throw 'Invalid colour: ' + colour;
|
||||
@@ -727,7 +730,7 @@ Blockly.Block.prototype.setFieldValue = function(newValue, name) {
|
||||
/**
|
||||
* Set whether this block can chain onto the bottom of another block.
|
||||
* @param {boolean} newBoolean True if there can be a previous statement.
|
||||
* @param {string|Array.<string>|null|undefined} opt_check Statement type or
|
||||
* @param {(string|Array.<string>|null)=} opt_check Statement type or
|
||||
* list of statement types. Null/undefined if any type could be connected.
|
||||
*/
|
||||
Blockly.Block.prototype.setPreviousStatement = function(newBoolean, opt_check) {
|
||||
@@ -755,7 +758,7 @@ Blockly.Block.prototype.setPreviousStatement = function(newBoolean, opt_check) {
|
||||
/**
|
||||
* Set whether another block can chain onto the bottom of this block.
|
||||
* @param {boolean} newBoolean True if there can be a next statement.
|
||||
* @param {string|Array.<string>|null|undefined} opt_check Statement type or
|
||||
* @param {(string|Array.<string>|null)=} opt_check Statement type or
|
||||
* list of statement types. Null/undefined if any type could be connected.
|
||||
*/
|
||||
Blockly.Block.prototype.setNextStatement = function(newBoolean, opt_check) {
|
||||
@@ -780,7 +783,7 @@ Blockly.Block.prototype.setNextStatement = function(newBoolean, opt_check) {
|
||||
/**
|
||||
* Set whether this block returns a value.
|
||||
* @param {boolean} newBoolean True if there is an output.
|
||||
* @param {string|Array.<string>|null|undefined} opt_check Returned type or list
|
||||
* @param {(string|Array.<string>|null)=} opt_check Returned type or list
|
||||
* of returned types. Null or undefined if any type could be returned
|
||||
* (e.g. variable get).
|
||||
*/
|
||||
@@ -1423,8 +1426,12 @@ Blockly.Block.prototype.setCommentText = function(text) {
|
||||
/**
|
||||
* Set this block's warning text.
|
||||
* @param {?string} text The text, or null to delete.
|
||||
* @param {string=} opt_id An optional ID for the warning text to be able to
|
||||
* maintain multiple warnings.
|
||||
*/
|
||||
Blockly.Block.prototype.setWarningText = function(/* text */) {
|
||||
Blockly.Block.prototype.setWarningText = function(text,
|
||||
/* eslint-disable no-unused-vars */ opt_id
|
||||
/* eslint-enable no-unused-vars */) {
|
||||
// NOP.
|
||||
};
|
||||
|
||||
@@ -1432,7 +1439,9 @@ Blockly.Block.prototype.setWarningText = function(/* text */) {
|
||||
* Give this block a mutator dialog.
|
||||
* @param {Blockly.Mutator} mutator A mutator dialog instance or null to remove.
|
||||
*/
|
||||
Blockly.Block.prototype.setMutator = function(/* mutator */) {
|
||||
Blockly.Block.prototype.setMutator = function(
|
||||
/* eslint-disable no-unused-vars */ mutator
|
||||
/* eslint-enable no-unused-vars */) {
|
||||
// NOP.
|
||||
};
|
||||
|
||||
|
||||
@@ -20,10 +20,10 @@
|
||||
|
||||
/**
|
||||
* @fileoverview A class that manages a surface for dragging blocks. When a
|
||||
* block drag is started, we move the block (and children) to a separate dom
|
||||
* block drag is started, we move the block (and children) to a separate DOM
|
||||
* element that we move around using translate3d. At the end of the drag, the
|
||||
* blocks are put back in into the svg they came from. This helps performance by
|
||||
* avoiding repainting the entire svg on every mouse move while dragging blocks.
|
||||
* blocks are put back in into the SVG they came from. This helps performance by
|
||||
* avoiding repainting the entire SVG on every mouse move while dragging blocks.
|
||||
* @author picklesrus
|
||||
*/
|
||||
|
||||
@@ -202,7 +202,7 @@ Blockly.BlockDragSurfaceSvg.prototype.getCurrentBlock = function() {
|
||||
* element.
|
||||
* If the block is being deleted it doesn't need to go back to the original
|
||||
* surface, since it would be removed immediately during dispose.
|
||||
* @param {Element} opt_newSurface Surface the dragging blocks should be moved
|
||||
* @param {Element=} opt_newSurface Surface the dragging blocks should be moved
|
||||
* to, or null if the blocks should be removed from this surface without
|
||||
* being moved to a different surface.
|
||||
*/
|
||||
|
||||
@@ -326,9 +326,8 @@ Blockly.BlockSvg.prototype.render = function(opt_bubble) {
|
||||
* @return {number} X-coordinate of the end of the field row (plus a gap).
|
||||
* @private
|
||||
*/
|
||||
Blockly.BlockSvg.prototype.renderFields_ =
|
||||
function(fieldList, cursorX, cursorY) {
|
||||
/* eslint-disable indent */
|
||||
Blockly.BlockSvg.prototype.renderFields_ = function(fieldList,
|
||||
cursorX, cursorY) {
|
||||
cursorY += Blockly.BlockSvg.INLINE_PADDING_Y;
|
||||
if (this.RTL) {
|
||||
cursorX = -cursorX;
|
||||
@@ -356,7 +355,7 @@ Blockly.BlockSvg.prototype.renderFields_ =
|
||||
}
|
||||
}
|
||||
return this.RTL ? -cursorX : cursorX;
|
||||
}; /* eslint-enable indent */
|
||||
};
|
||||
|
||||
/**
|
||||
* Computes the height and widths for each row and field.
|
||||
@@ -614,9 +613,8 @@ Blockly.BlockSvg.prototype.renderMoveConnections_ = function() {
|
||||
* @param {number} rightEdge Minimum width of block.
|
||||
* @private
|
||||
*/
|
||||
Blockly.BlockSvg.prototype.renderDrawTop_ =
|
||||
function(steps, highlightSteps, rightEdge) {
|
||||
/* eslint-disable indent */
|
||||
Blockly.BlockSvg.prototype.renderDrawTop_ = function(steps,
|
||||
highlightSteps, rightEdge) {
|
||||
// Position the cursor at the top-left starting point.
|
||||
if (this.squareTopLeftCorner_) {
|
||||
steps.push('m 0,0');
|
||||
@@ -651,7 +649,7 @@ Blockly.BlockSvg.prototype.renderDrawTop_ =
|
||||
steps.push('H', rightEdge);
|
||||
highlightSteps.push('H', rightEdge - 0.5);
|
||||
this.width = rightEdge;
|
||||
}; /* eslint-enable indent */
|
||||
};
|
||||
|
||||
/**
|
||||
* Render the right edge of the block.
|
||||
@@ -916,9 +914,8 @@ Blockly.BlockSvg.prototype.renderDrawRight_ = function(steps, highlightSteps,
|
||||
* @param {number} cursorY Height of block.
|
||||
* @private
|
||||
*/
|
||||
Blockly.BlockSvg.prototype.renderDrawBottom_ =
|
||||
function(steps, highlightSteps, cursorY) {
|
||||
/* eslint-disable indent */
|
||||
Blockly.BlockSvg.prototype.renderDrawBottom_ = function(steps,
|
||||
highlightSteps, cursorY) {
|
||||
this.height += cursorY + 1; // Add one for the shadow.
|
||||
if (this.nextConnection) {
|
||||
steps.push('H', (Blockly.BlockSvg.NOTCH_WIDTH + (this.RTL ? 0.5 : - 0.5)) +
|
||||
@@ -954,7 +951,7 @@ Blockly.BlockSvg.prototype.renderDrawBottom_ =
|
||||
'0.5,' + (cursorY - Blockly.BlockSvg.CORNER_RADIUS));
|
||||
}
|
||||
}
|
||||
}; /* eslint-enable indent */
|
||||
};
|
||||
|
||||
/**
|
||||
* Render the left edge of the block.
|
||||
|
||||
+42
-77
@@ -47,7 +47,7 @@ goog.require('goog.userAgent');
|
||||
* @param {?string} prototypeName Name of the language object containing
|
||||
* type-specific functions for this block.
|
||||
* @param {string=} opt_id Optional ID. Use this ID if provided, otherwise
|
||||
* create a new id.
|
||||
* create a new ID.
|
||||
* @extends {Blockly.Block}
|
||||
* @constructor
|
||||
*/
|
||||
@@ -118,6 +118,14 @@ Blockly.BlockSvg.prototype.width = 0;
|
||||
*/
|
||||
Blockly.BlockSvg.prototype.dragStartXY_ = null;
|
||||
|
||||
/**
|
||||
* Map from IDs for warnings text to PIDs of functions to apply them.
|
||||
* Used to be able to maintain multiple warnings.
|
||||
* @type {Object.<string, number>}
|
||||
* @private
|
||||
*/
|
||||
Blockly.BlockSvg.prototype.warningTextDb_ = null;
|
||||
|
||||
/**
|
||||
* Constant for identifying rows that are to be rendered inline.
|
||||
* Don't collide with Blockly.INPUT_VALUE and friends.
|
||||
@@ -526,7 +534,7 @@ Blockly.BlockSvg.prototype.tab = function(start, forward) {
|
||||
|
||||
/**
|
||||
* Create an ordered list of all text fields and connected inputs.
|
||||
* @return {!Array<!Blockly.FieldTextInput|!Blockly.Input>} The ordered list.
|
||||
* @return {!Array.<!Blockly.FieldTextInput|!Blockly.Input>} The ordered list.
|
||||
* @private
|
||||
*/
|
||||
Blockly.BlockSvg.prototype.createTabList_ = function() {
|
||||
@@ -586,35 +594,10 @@ Blockly.BlockSvg.prototype.showContextMenu_ = function(e) {
|
||||
var menuOptions = [];
|
||||
|
||||
if (this.isDeletable() && this.isMovable() && !block.isInFlyout) {
|
||||
// Option to duplicate this block.
|
||||
var duplicateOption = {
|
||||
text: Blockly.Msg.DUPLICATE_BLOCK,
|
||||
enabled: true,
|
||||
callback: function() {
|
||||
Blockly.duplicate_(block);
|
||||
}
|
||||
};
|
||||
if (this.getDescendants().length > this.workspace.remainingCapacity()) {
|
||||
duplicateOption.enabled = false;
|
||||
}
|
||||
menuOptions.push(duplicateOption);
|
||||
|
||||
menuOptions.push(Blockly.ContextMenu.blockDuplicateOption(block));
|
||||
if (this.isEditable() && !this.collapsed_ &&
|
||||
this.workspace.options.comments) {
|
||||
// Option to add/remove a comment.
|
||||
var commentOption = {enabled: !goog.userAgent.IE};
|
||||
if (this.comment) {
|
||||
commentOption.text = Blockly.Msg.REMOVE_COMMENT;
|
||||
commentOption.callback = function() {
|
||||
block.setCommentText(null);
|
||||
};
|
||||
} else {
|
||||
commentOption.text = Blockly.Msg.ADD_COMMENT;
|
||||
commentOption.callback = function() {
|
||||
block.setCommentText('');
|
||||
};
|
||||
}
|
||||
menuOptions.push(commentOption);
|
||||
menuOptions.push(Blockly.ContextMenu.blockCommentOption(block));
|
||||
}
|
||||
|
||||
// Option to make block inline.
|
||||
@@ -669,35 +652,10 @@ Blockly.BlockSvg.prototype.showContextMenu_ = function(e) {
|
||||
menuOptions.push(disableOption);
|
||||
}
|
||||
|
||||
// Option to delete this block.
|
||||
// Count the number of blocks that are nested in this block.
|
||||
var descendantCount = this.getDescendants().length;
|
||||
var nextBlock = this.getNextBlock();
|
||||
if (nextBlock) {
|
||||
// Blocks in the current stack would survive this block's deletion.
|
||||
descendantCount -= nextBlock.getDescendants().length;
|
||||
}
|
||||
var deleteOption = {
|
||||
text: descendantCount == 1 ? Blockly.Msg.DELETE_BLOCK :
|
||||
Blockly.Msg.DELETE_X_BLOCKS.replace('%1', String(descendantCount)),
|
||||
enabled: true,
|
||||
callback: function() {
|
||||
Blockly.Events.setGroup(true);
|
||||
block.dispose(true, true);
|
||||
Blockly.Events.setGroup(false);
|
||||
}
|
||||
};
|
||||
menuOptions.push(deleteOption);
|
||||
menuOptions.push(Blockly.ContextMenu.blockDeleteOption(block));
|
||||
}
|
||||
|
||||
// Option to get help.
|
||||
var url = goog.isFunction(this.helpUrl) ? this.helpUrl() : this.helpUrl;
|
||||
var helpOption = {enabled: !!url};
|
||||
helpOption.text = Blockly.Msg.HELP;
|
||||
helpOption.callback = function() {
|
||||
block.showHelp_();
|
||||
};
|
||||
menuOptions.push(helpOption);
|
||||
menuOptions.push(Blockly.ContextMenu.blockHelpOption(block));
|
||||
|
||||
// Allow the block to add or modify menuOptions.
|
||||
if (this.customContextMenu) {
|
||||
@@ -848,6 +806,14 @@ Blockly.BlockSvg.prototype.dispose = function(healStack, animate) {
|
||||
// Stop rerendering.
|
||||
this.rendered = false;
|
||||
|
||||
// Clear pending warnings.
|
||||
if (this.warningTextDb_) {
|
||||
for (var n in this.warningTextDb_) {
|
||||
clearTimeout(this.warningTextDb_[n]);
|
||||
}
|
||||
this.warningTextDb_ = null;
|
||||
}
|
||||
|
||||
Blockly.Events.disable();
|
||||
try {
|
||||
var icons = this.getIcons();
|
||||
@@ -1140,30 +1106,30 @@ Blockly.BlockSvg.prototype.setCommentText = function(text) {
|
||||
* maintain multiple warnings.
|
||||
*/
|
||||
Blockly.BlockSvg.prototype.setWarningText = function(text, opt_id) {
|
||||
if (!this.setWarningText.pid_) {
|
||||
if (!this.warningTextDb_) {
|
||||
// Create a database of warning PIDs.
|
||||
// Only runs once per block (and only those with warnings).
|
||||
this.setWarningText.pid_ = Object.create(null);
|
||||
this.warningTextDb_ = Object.create(null);
|
||||
}
|
||||
var id = opt_id || '';
|
||||
if (!id) {
|
||||
// Kill all previous pending processes, this edit supersedes them all.
|
||||
for (var n in this.setWarningText.pid_) {
|
||||
clearTimeout(this.setWarningText.pid_[n]);
|
||||
delete this.setWarningText.pid_[n];
|
||||
for (var n in this.warningTextDb_) {
|
||||
clearTimeout(this.warningTextDb_[n]);
|
||||
delete this.warningTextDb_[n];
|
||||
}
|
||||
} else if (this.setWarningText.pid_[id]) {
|
||||
} else if (this.warningTextDb_[id]) {
|
||||
// Only queue up the latest change. Kill any earlier pending process.
|
||||
clearTimeout(this.setWarningText.pid_[id]);
|
||||
delete this.setWarningText.pid_[id];
|
||||
clearTimeout(this.warningTextDb_[id]);
|
||||
delete this.warningTextDb_[id];
|
||||
}
|
||||
if (this.workspace.isDragging()) {
|
||||
// Don't change the warning text during a drag.
|
||||
// Wait until the drag finishes.
|
||||
var thisBlock = this;
|
||||
this.setWarningText.pid_[id] = setTimeout(function() {
|
||||
this.warningTextDb_[id] = setTimeout(function() {
|
||||
if (thisBlock.workspace) { // Check block wasn't deleted.
|
||||
delete thisBlock.setWarningText.pid_[id];
|
||||
delete thisBlock.warningTextDb_[id];
|
||||
thisBlock.setWarningText(text, id);
|
||||
}
|
||||
}, 100);
|
||||
@@ -1194,7 +1160,7 @@ Blockly.BlockSvg.prototype.setWarningText = function(text, opt_id) {
|
||||
}
|
||||
this.warning.setText(/** @type {string} */ (text), id);
|
||||
} else {
|
||||
// Dispose all warnings if no id is given.
|
||||
// Dispose all warnings if no ID is given.
|
||||
if (this.warning && !id) {
|
||||
this.warning.dispose();
|
||||
changedState = true;
|
||||
@@ -1311,8 +1277,8 @@ Blockly.BlockSvg.prototype.setColour = function(colour) {
|
||||
|
||||
/**
|
||||
* Move this block to the front of the visible workspace.
|
||||
* <g> tags do not respect z-index so svg renders them in the
|
||||
* order that they are in the dom. By placing this block first within the
|
||||
* <g> tags do not respect z-index so SVG renders them in the
|
||||
* order that they are in the DOM. By placing this block first within the
|
||||
* block group's <g>, it will render on top of any other blocks.
|
||||
* @package
|
||||
*/
|
||||
@@ -1328,12 +1294,11 @@ Blockly.BlockSvg.prototype.bringToFront = function() {
|
||||
/**
|
||||
* Set whether this block can chain onto the bottom of another block.
|
||||
* @param {boolean} newBoolean True if there can be a previous statement.
|
||||
* @param {string|Array.<string>|null|undefined} opt_check Statement type or
|
||||
* @param {(string|Array.<string>|null)=} opt_check Statement type or
|
||||
* list of statement types. Null/undefined if any type could be connected.
|
||||
*/
|
||||
Blockly.BlockSvg.prototype.setPreviousStatement =
|
||||
function(newBoolean, opt_check) {
|
||||
/* eslint-disable indent */
|
||||
Blockly.BlockSvg.prototype.setPreviousStatement = function(newBoolean,
|
||||
opt_check) {
|
||||
Blockly.BlockSvg.superClass_.setPreviousStatement.call(this, newBoolean,
|
||||
opt_check);
|
||||
|
||||
@@ -1341,12 +1306,12 @@ Blockly.BlockSvg.prototype.setPreviousStatement =
|
||||
this.render();
|
||||
this.bumpNeighbours_();
|
||||
}
|
||||
}; /* eslint-enable indent */
|
||||
};
|
||||
|
||||
/**
|
||||
* Set whether another block can chain onto the bottom of this block.
|
||||
* @param {boolean} newBoolean True if there can be a next statement.
|
||||
* @param {string|Array.<string>|null|undefined} opt_check Statement type or
|
||||
* @param {(string|Array.<string>|null)=} opt_check Statement type or
|
||||
* list of statement types. Null/undefined if any type could be connected.
|
||||
*/
|
||||
Blockly.BlockSvg.prototype.setNextStatement = function(newBoolean, opt_check) {
|
||||
@@ -1362,7 +1327,7 @@ Blockly.BlockSvg.prototype.setNextStatement = function(newBoolean, opt_check) {
|
||||
/**
|
||||
* Set whether this block returns a value.
|
||||
* @param {boolean} newBoolean True if there is an output.
|
||||
* @param {string|Array.<string>|null|undefined} opt_check Returned type or list
|
||||
* @param {(string|Array.<string>|null)=} opt_check Returned type or list
|
||||
* of returned types. Null or undefined if any type could be returned
|
||||
* (e.g. variable get).
|
||||
*/
|
||||
@@ -1492,7 +1457,7 @@ Blockly.BlockSvg.prototype.bumpNeighbours_ = function() {
|
||||
if (!this.workspace) {
|
||||
return; // Deleted block.
|
||||
}
|
||||
if (Blockly.dragMode_ != Blockly.DRAG_NONE) {
|
||||
if (this.workspace.isDragging()) {
|
||||
return; // Don't bump blocks during a drag.
|
||||
}
|
||||
var rootBlock = this.getRootBlock();
|
||||
|
||||
+8
-5
@@ -58,7 +58,10 @@ goog.require('goog.userAgent');
|
||||
|
||||
|
||||
// Turn off debugging when compiled.
|
||||
// Unused within the Blockly library, but used in Closure.
|
||||
/* eslint-disable no-unused-vars */
|
||||
var CLOSURE_DEFINES = {'goog.DEBUG': false};
|
||||
/* eslint-enable no-unused-vars */
|
||||
|
||||
/**
|
||||
* The main workspace most recently used.
|
||||
@@ -395,14 +398,14 @@ Blockly.defineBlocksWithJsonArray = function(jsonArray) {
|
||||
* Bind an event to a function call. When calling the function, verifies that
|
||||
* it belongs to the touch stream that is currently being processed, and splits
|
||||
* multitouch events into multiple events as needed.
|
||||
* @param {!Node} node Node upon which to listen.
|
||||
* @param {!EventTarget} node Node upon which to listen.
|
||||
* @param {string} name Event name to listen to (e.g. 'mousedown').
|
||||
* @param {Object} thisObject The value of 'this' in the function.
|
||||
* @param {!Function} func Function to call when event is triggered.
|
||||
* @param {boolean} opt_noCaptureIdentifier True if triggering on this event
|
||||
* @param {boolean=} opt_noCaptureIdentifier True if triggering on this event
|
||||
* should not block execution of other event handlers on this touch or other
|
||||
* simultaneous touches.
|
||||
* @param {boolean} opt_noPreventDefault True if triggering on this event
|
||||
* @param {boolean=} opt_noPreventDefault True if triggering on this event
|
||||
* should prevent the default handler. False by default. If
|
||||
* opt_noPreventDefault is provided, opt_noCaptureIdentifier must also be
|
||||
* provided.
|
||||
@@ -461,7 +464,7 @@ Blockly.bindEventWithChecks_ = function(node, name, thisObject, func,
|
||||
* simultaneous event processing.
|
||||
* @deprecated in favor of bindEventWithChecks_, but preserved for external
|
||||
* users.
|
||||
* @param {!Node} node Node upon which to listen.
|
||||
* @param {!EventTarget} node Node upon which to listen.
|
||||
* @param {string} name Event name to listen to (e.g. 'mousedown').
|
||||
* @param {Object} thisObject The value of 'this' in the function.
|
||||
* @param {!Function} func Function to call when event is triggered.
|
||||
@@ -528,7 +531,7 @@ Blockly.unbindEvent_ = function(bindData) {
|
||||
* @return {boolean} True if number, false otherwise.
|
||||
*/
|
||||
Blockly.isNumber = function(str) {
|
||||
return !!str.match(/^\s*-?\d+(\.\d+)?\s*$/);
|
||||
return /^\s*-?\d+(\.\d+)?\s*$/.test(str);
|
||||
};
|
||||
|
||||
// IE9 does not have a console. Create a stub to stop errors.
|
||||
|
||||
+1
-1
@@ -32,6 +32,6 @@ goog.provide('Blockly.Blocks');
|
||||
|
||||
/*
|
||||
* A mapping of block type names to block prototype objects.
|
||||
* @type {!Object<string,Object>}
|
||||
* @type {!Object.<string,Object>}
|
||||
*/
|
||||
Blockly.Blocks = new Object(null);
|
||||
|
||||
+12
-7
@@ -70,19 +70,21 @@ Blockly.Comment.prototype.drawIcon_ = function(group) {
|
||||
// Circle.
|
||||
Blockly.utils.createSvgElement('circle',
|
||||
{'class': 'blocklyIconShape', 'r': '8', 'cx': '8', 'cy': '8'},
|
||||
group);
|
||||
group);
|
||||
// Can't use a real '?' text character since different browsers and operating
|
||||
// systems render it differently.
|
||||
// Body of question mark.
|
||||
Blockly.utils.createSvgElement('path',
|
||||
{'class': 'blocklyIconSymbol',
|
||||
'd': 'm6.8,10h2c0.003,-0.617 0.271,-0.962 0.633,-1.266 2.875,-2.405 0.607,-5.534 -3.765,-3.874v1.7c3.12,-1.657 3.698,0.118 2.336,1.25 -1.201,0.998 -1.201,1.528 -1.204,2.19z'},
|
||||
group);
|
||||
'd': 'm6.8,10h2c0.003,-0.617 0.271,-0.962 0.633,-1.266 2.875,-2.405' +
|
||||
'0.607,-5.534 -3.765,-3.874v1.7c3.12,-1.657 3.698,0.118 2.336,1.25' +
|
||||
'-1.201,0.998 -1.201,1.528 -1.204,2.19z'},
|
||||
group);
|
||||
// Dot of question mark.
|
||||
Blockly.utils.createSvgElement('rect',
|
||||
{'class': 'blocklyIconSymbol',
|
||||
'x': '6.8', 'y': '10.78', 'height': '2', 'width': '2'},
|
||||
group);
|
||||
'x': '6.8', 'y': '10.78', 'height': '2', 'width': '2'},
|
||||
group);
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -117,7 +119,9 @@ Blockly.Comment.prototype.createEditor_ = function() {
|
||||
Blockly.bindEventWithChecks_(textarea, 'wheel', this, function(e) {
|
||||
e.stopPropagation();
|
||||
});
|
||||
Blockly.bindEventWithChecks_(textarea, 'change', this, function(e) {
|
||||
Blockly.bindEventWithChecks_(textarea, 'change', this, function(
|
||||
/* eslint-disable no-unused-vars */ e
|
||||
/* eslint-enable no-unused-vars */) {
|
||||
if (this.text_ != textarea.value) {
|
||||
Blockly.Events.fire(new Blockly.Events.BlockChange(
|
||||
this.block_, 'comment', null, this.text_, textarea.value));
|
||||
@@ -207,7 +211,8 @@ Blockly.Comment.prototype.setVisible = function(visible) {
|
||||
* @param {!Event} e Mouse up event.
|
||||
* @private
|
||||
*/
|
||||
Blockly.Comment.prototype.textareaFocus_ = function(e) {
|
||||
Blockly.Comment.prototype.textareaFocus_ = function(
|
||||
/* eslint-disable no-unused-vars */ e /* eslint-enable no-unused-vars */) {
|
||||
// Ideally this would be hooked to the focus event for the comment.
|
||||
// However doing so in Firefox swallows the cursor for unknown reasons.
|
||||
// So this is hooked to mouseup instead. No big deal.
|
||||
|
||||
@@ -201,3 +201,99 @@ Blockly.ContextMenu.callbackFactory = function(block, xml) {
|
||||
newBlock.select();
|
||||
};
|
||||
};
|
||||
|
||||
// Helper functions for creating context menu options.
|
||||
|
||||
/**
|
||||
* Make a context menu option for deleting the current block.
|
||||
* @param {!Blockly.BlockSvg} block The block where the right-click originated.
|
||||
* @return {!Object} A menu option, containing text, enabled, and a callback.
|
||||
* @package
|
||||
*/
|
||||
Blockly.ContextMenu.blockDeleteOption = function(block) {
|
||||
// Option to delete this block but not blocks lower in the stack.
|
||||
// Count the number of blocks that are nested in this block.
|
||||
var descendantCount = block.getDescendants(true).length;
|
||||
var nextBlock = block.getNextBlock();
|
||||
if (nextBlock) {
|
||||
// Blocks in the current stack would survive this block's deletion.
|
||||
descendantCount -= nextBlock.getDescendants(true).length;
|
||||
}
|
||||
var deleteOption = {
|
||||
text: descendantCount == 1 ? Blockly.Msg.DELETE_BLOCK :
|
||||
Blockly.Msg.DELETE_X_BLOCKS.replace('%1', String(descendantCount)),
|
||||
enabled: true,
|
||||
callback: function() {
|
||||
Blockly.Events.setGroup(true);
|
||||
block.dispose(true, true);
|
||||
Blockly.Events.setGroup(false);
|
||||
}
|
||||
};
|
||||
return deleteOption;
|
||||
};
|
||||
|
||||
/**
|
||||
* Make a context menu option for showing help for the current block.
|
||||
* @param {!Blockly.BlockSvg} block The block where the right-click originated.
|
||||
* @return {!Object} A menu option, containing text, enabled, and a callback.
|
||||
* @package
|
||||
*/
|
||||
Blockly.ContextMenu.blockHelpOption = function(block) {
|
||||
var url = goog.isFunction(block.helpUrl) ? block.helpUrl() : block.helpUrl;
|
||||
var helpOption = {
|
||||
enabled: !!url,
|
||||
text: Blockly.Msg.HELP,
|
||||
callback: function() {
|
||||
block.showHelp_();
|
||||
}
|
||||
};
|
||||
return helpOption;
|
||||
};
|
||||
|
||||
/**
|
||||
* Make a context menu option for duplicating the current block.
|
||||
* @param {!Blockly.BlockSvg} block The block where the right-click originated.
|
||||
* @return {!Object} A menu option, containing text, enabled, and a callback.
|
||||
* @package
|
||||
*/
|
||||
Blockly.ContextMenu.blockDuplicateOption = function(block) {
|
||||
var enabled = true;
|
||||
if (block.getDescendants().length > block.workspace.remainingCapacity()) {
|
||||
enabled = false;
|
||||
}
|
||||
var duplicateOption = {
|
||||
text: Blockly.Msg.DUPLICATE_BLOCK,
|
||||
enabled: enabled,
|
||||
callback: function() {
|
||||
Blockly.duplicate_(block);
|
||||
}
|
||||
};
|
||||
return duplicateOption;
|
||||
};
|
||||
|
||||
/**
|
||||
* Make a context menu option for adding or removing comments on the current
|
||||
* block.
|
||||
* @param {!Blockly.BlockSvg} block The block where the right-click originated.
|
||||
* @return {!Object} A menu option, containing text, enabled, and a callback.
|
||||
* @package
|
||||
*/
|
||||
Blockly.ContextMenu.blockCommentOption = function(block) {
|
||||
var commentOption = {
|
||||
enabled: !goog.userAgent.IE
|
||||
};
|
||||
// If there's already a comment, add an option to delete it.
|
||||
if (block.comment) {
|
||||
commentOption.text = Blockly.Msg.REMOVE_COMMENT;
|
||||
commentOption.callback = function() {
|
||||
block.setCommentText(null);
|
||||
};
|
||||
} else {
|
||||
// If there's no comment, add an option to create a comment.
|
||||
commentOption.text = Blockly.Msg.ADD_COMMENT;
|
||||
commentOption.callback = function() {
|
||||
block.setCommentText('');
|
||||
};
|
||||
}
|
||||
return commentOption;
|
||||
};
|
||||
|
||||
@@ -171,6 +171,12 @@ Blockly.DraggedConnectionManager.prototype.update = function(dxy, deleteArea) {
|
||||
this.topBlock_.isDeletable();
|
||||
this.wouldDeleteBlock_ = wouldDelete && !wouldConnect;
|
||||
|
||||
// Get rid of highlighting so we don't sent mixed messages.
|
||||
if (wouldDelete && this.closestConnection_) {
|
||||
this.closestConnection_.unhighlight();
|
||||
this.closestConnection_ = null;
|
||||
}
|
||||
|
||||
if (!this.wouldDeleteBlock_ && closestConnectionChanged &&
|
||||
this.closestConnection_) {
|
||||
this.addHighlighting_();
|
||||
|
||||
+60
-20
@@ -42,7 +42,7 @@ goog.require('goog.math.Coordinate');
|
||||
Blockly.Events.group_ = '';
|
||||
|
||||
/**
|
||||
* Sets whether events should be added to the undo stack.
|
||||
* Sets whether the next event should be added to the undo stack.
|
||||
* @type {boolean}
|
||||
*/
|
||||
Blockly.Events.recordUndo = true;
|
||||
@@ -201,10 +201,15 @@ Blockly.Events.filter = function(queueIn, forward) {
|
||||
lastEvent.element == 'warningOpen')) {
|
||||
// Merge click events.
|
||||
lastEvent.newValue = event.newValue;
|
||||
} else {
|
||||
// Collision: newer events should merge into this event to maintain order
|
||||
hash[key] = event;
|
||||
mergedQueue.push(event);
|
||||
}
|
||||
}
|
||||
}
|
||||
queue = mergedQueue;
|
||||
// Filter out any events that have become null due to merging.
|
||||
queue = mergedQueue.filter(function(e) { return !e.isNull(); });
|
||||
if (!forward) {
|
||||
// Restore undo order.
|
||||
queue.reverse();
|
||||
@@ -305,7 +310,7 @@ Blockly.Events.fromJson = function(json, workspace) {
|
||||
event = new Blockly.Events.Delete(null);
|
||||
break;
|
||||
case Blockly.Events.CHANGE:
|
||||
event = new Blockly.Events.Change(null);
|
||||
event = new Blockly.Events.Change(null, '', '', '', '');
|
||||
break;
|
||||
case Blockly.Events.MOVE:
|
||||
event = new Blockly.Events.Move(null);
|
||||
@@ -317,7 +322,7 @@ Blockly.Events.fromJson = function(json, workspace) {
|
||||
event = new Blockly.Events.VarDelete(null);
|
||||
break;
|
||||
case Blockly.Events.VAR_RENAME:
|
||||
event = new Blockly.Events.VarRename(null);
|
||||
event = new Blockly.Events.VarRename(null, '');
|
||||
break;
|
||||
case Blockly.Events.UI:
|
||||
event = new Blockly.Events.Ui(null);
|
||||
@@ -336,11 +341,44 @@ Blockly.Events.fromJson = function(json, workspace) {
|
||||
* @constructor
|
||||
*/
|
||||
Blockly.Events.Abstract = function(elem) {
|
||||
/**
|
||||
* The block id for the block this event pertains to, if appropriate for the
|
||||
* event type.
|
||||
* @type {string|undefined}
|
||||
*/
|
||||
this.blockId = undefined;
|
||||
|
||||
/**
|
||||
* The variable id for the variable this event pertains to. Only set in
|
||||
* VarCreate, VarDelete, and VarRename events.
|
||||
* @type {string|undefined}
|
||||
*/
|
||||
this.varId = undefined;
|
||||
|
||||
/**
|
||||
* The workspace identifier for this event.
|
||||
* @type {string|undefined}
|
||||
*/
|
||||
this.workspaceId = undefined;
|
||||
|
||||
/**
|
||||
* The event group id for the group this event belongs to. Groups define
|
||||
* events that should be treated as an single action from the user's
|
||||
* perspective, and should be undone together.
|
||||
* @type {string}
|
||||
*/
|
||||
this.group = undefined;
|
||||
|
||||
/**
|
||||
* Sets whether the event should be added to the undo stack.
|
||||
* @type {boolean}
|
||||
*/
|
||||
this.recordUndo = undefined;
|
||||
|
||||
if (elem instanceof Blockly.Block) {
|
||||
this.blockId = elem.id;
|
||||
this.workspaceId = elem.workspace.id;
|
||||
}
|
||||
else if (elem instanceof Blockly.VariableModel){
|
||||
} else if (elem instanceof Blockly.VariableModel) {
|
||||
this.workspaceId = elem.workspace.id;
|
||||
this.varId = elem.getId();
|
||||
}
|
||||
@@ -390,7 +428,9 @@ Blockly.Events.Abstract.prototype.isNull = function() {
|
||||
* Run an event.
|
||||
* @param {boolean} forward True if run forward, false if run backward (undo).
|
||||
*/
|
||||
Blockly.Events.Abstract.prototype.run = function(forward) {
|
||||
Blockly.Events.Abstract.prototype.run = function(
|
||||
/* eslint-disable no-unused-vars */ forward
|
||||
/* eslint-enable no-unused-vars */) {
|
||||
// Defined by subclasses.
|
||||
};
|
||||
|
||||
@@ -482,7 +522,7 @@ Blockly.Events.Create.prototype.run = function(forward) {
|
||||
block.dispose(false, false);
|
||||
} else if (id == this.blockId) {
|
||||
// Only complain about root-level block.
|
||||
console.warn("Can't uncreate non-existant block: " + id);
|
||||
console.warn("Can't uncreate non-existent block: " + id);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -558,7 +598,7 @@ Blockly.Events.Delete.prototype.run = function(forward) {
|
||||
block.dispose(false, false);
|
||||
} else if (id == this.blockId) {
|
||||
// Only complain about root-level block.
|
||||
console.warn("Can't delete non-existant block: " + id);
|
||||
console.warn("Can't delete non-existent block: " + id);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -573,8 +613,8 @@ Blockly.Events.Delete.prototype.run = function(forward) {
|
||||
* @param {Blockly.Block} block The changed block. Null for a blank event.
|
||||
* @param {string} element One of 'field', 'comment', 'disabled', etc.
|
||||
* @param {?string} name Name of input or field affected, or null.
|
||||
* @param {string} oldValue Previous value of element.
|
||||
* @param {string} newValue New value of element.
|
||||
* @param {*} oldValue Previous value of element.
|
||||
* @param {*} newValue New value of element.
|
||||
* @extends {Blockly.Events.Abstract}
|
||||
* @constructor
|
||||
*/
|
||||
@@ -595,8 +635,8 @@ goog.inherits(Blockly.Events.Change, Blockly.Events.Abstract);
|
||||
* @param {Blockly.Block} block The changed block. Null for a blank event.
|
||||
* @param {string} element One of 'field', 'comment', 'disabled', etc.
|
||||
* @param {?string} name Name of input or field affected, or null.
|
||||
* @param {string} oldValue Previous value of element.
|
||||
* @param {string} newValue New value of element.
|
||||
* @param {*} oldValue Previous value of element.
|
||||
* @param {*} newValue New value of element.
|
||||
* @extends {Blockly.Events.Abstract}
|
||||
* @constructor
|
||||
*/
|
||||
@@ -649,7 +689,7 @@ Blockly.Events.Change.prototype.run = function(forward) {
|
||||
var workspace = this.getEventWorkspace_();
|
||||
var block = workspace.getBlockById(this.blockId);
|
||||
if (!block) {
|
||||
console.warn("Can't change non-existant block: " + this.blockId);
|
||||
console.warn("Can't change non-existent block: " + this.blockId);
|
||||
return;
|
||||
}
|
||||
if (block.mutator) {
|
||||
@@ -666,7 +706,7 @@ Blockly.Events.Change.prototype.run = function(forward) {
|
||||
field.callValidator(value);
|
||||
field.setValue(value);
|
||||
} else {
|
||||
console.warn("Can't set non-existant field: " + this.name);
|
||||
console.warn("Can't set non-existent field: " + this.name);
|
||||
}
|
||||
break;
|
||||
case 'comment':
|
||||
@@ -818,7 +858,7 @@ Blockly.Events.Move.prototype.run = function(forward) {
|
||||
var workspace = this.getEventWorkspace_();
|
||||
var block = workspace.getBlockById(this.blockId);
|
||||
if (!block) {
|
||||
console.warn("Can't move non-existant block: " + this.blockId);
|
||||
console.warn("Can't move non-existent block: " + this.blockId);
|
||||
return;
|
||||
}
|
||||
var parentId = forward ? this.newParentId : this.oldParentId;
|
||||
@@ -828,7 +868,7 @@ Blockly.Events.Move.prototype.run = function(forward) {
|
||||
if (parentId) {
|
||||
parentBlock = workspace.getBlockById(parentId);
|
||||
if (!parentBlock) {
|
||||
console.warn("Can't connect to non-existant block: " + parentId);
|
||||
console.warn("Can't connect to non-existent block: " + parentId);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -852,7 +892,7 @@ Blockly.Events.Move.prototype.run = function(forward) {
|
||||
if (parentConnection) {
|
||||
blockConnection.connect(parentConnection);
|
||||
} else {
|
||||
console.warn("Can't connect to non-existant input: " + inputName);
|
||||
console.warn("Can't connect to non-existent input: " + inputName);
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -861,8 +901,8 @@ Blockly.Events.Move.prototype.run = function(forward) {
|
||||
* Class for a UI event.
|
||||
* @param {Blockly.Block} block The affected block.
|
||||
* @param {string} element One of 'selected', 'comment', 'mutator', etc.
|
||||
* @param {string} oldValue Previous value of element.
|
||||
* @param {string} newValue New value of element.
|
||||
* @param {*} oldValue Previous value of element.
|
||||
* @param {*} newValue New value of element.
|
||||
* @extends {Blockly.Events.Abstract}
|
||||
* @constructor
|
||||
*/
|
||||
|
||||
+67
-69
@@ -83,8 +83,8 @@ Blockly.Extensions.registerMixin = function(name, mixinObj) {
|
||||
* decompose are defined on the mixin.
|
||||
* @param {string} name The name of this mutator extension.
|
||||
* @param {!Object} mixinObj The values to mix in.
|
||||
* @param {(function())=} opt_helperFn An optional function to apply after mixing
|
||||
* in the object.
|
||||
* @param {(function())=} opt_helperFn An optional function to apply after
|
||||
* mixing in the object.
|
||||
* @param {Array.<string>=} opt_blockList A list of blocks to appear in the
|
||||
* flyout of the mutator dialog.
|
||||
* @throws {Error} if the mutation is invalid or can't be applied to the block.
|
||||
@@ -99,8 +99,8 @@ Blockly.Extensions.registerMutator = function(name, mixinObj, opt_helperFn,
|
||||
Blockly.Extensions.checkHasFunction_(errorPrefix, mixinObj.mutationToDom,
|
||||
'mutationToDom');
|
||||
|
||||
var hasMutatorDialog = Blockly.Extensions.checkMutatorDialog_(mixinObj,
|
||||
errorPrefix);
|
||||
var hasMutatorDialog =
|
||||
Blockly.Extensions.checkMutatorDialog_(mixinObj, errorPrefix);
|
||||
|
||||
if (opt_helperFn && !goog.isFunction(opt_helperFn)) {
|
||||
throw new Error('Extension "' + name + '" is not a function');
|
||||
@@ -148,8 +148,8 @@ Blockly.Extensions.apply = function(name, block, isMutator) {
|
||||
Blockly.Extensions.checkBlockHasMutatorProperties_(errorPrefix, block);
|
||||
} else {
|
||||
if (!Blockly.Extensions.mutatorPropertiesMatch_(mutatorProperties, block)) {
|
||||
throw new Error('Error when applying extension "' + name +
|
||||
'": mutation properties changed when applying a non-mutator extension.');
|
||||
throw new Error('Error when applying extension "' + name + '": ' +
|
||||
'mutation properties changed when applying a non-mutator extension.');
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -169,7 +169,7 @@ Blockly.Extensions.checkHasFunction_ = function(errorPrefix, func,
|
||||
'missing required property "' + propertyName + '"');
|
||||
} else if (typeof func != 'function') {
|
||||
throw new Error(errorPrefix +
|
||||
'" required property "' + propertyName + '" must be a function');
|
||||
'" required property "' + propertyName + '" must be a function');
|
||||
}
|
||||
};
|
||||
|
||||
@@ -209,9 +209,9 @@ Blockly.Extensions.checkMutatorDialog_ = function(object, errorPrefix) {
|
||||
var hasDecompose = object.decompose !== undefined;
|
||||
|
||||
if (hasCompose && hasDecompose) {
|
||||
if (typeof object.compose !== 'function') {
|
||||
if (typeof object.compose != 'function') {
|
||||
throw new Error(errorPrefix + 'compose must be a function.');
|
||||
} else if (typeof object.decompose !== 'function') {
|
||||
} else if (typeof object.decompose != 'function') {
|
||||
throw new Error(errorPrefix + 'decompose must be a function.');
|
||||
}
|
||||
return true;
|
||||
@@ -232,11 +232,13 @@ Blockly.Extensions.checkMutatorDialog_ = function(object, errorPrefix) {
|
||||
*/
|
||||
Blockly.Extensions.checkBlockHasMutatorProperties_ = function(errorPrefix,
|
||||
block) {
|
||||
if (typeof block.domToMutation !== 'function') {
|
||||
throw new Error(errorPrefix + 'Applying a mutator didn\'t add "domToMutation"');
|
||||
if (typeof block.domToMutation != 'function') {
|
||||
throw new Error(errorPrefix +
|
||||
'Applying a mutator didn\'t add "domToMutation"');
|
||||
}
|
||||
if (typeof block.mutationToDom !== 'function') {
|
||||
throw new Error(errorPrefix + 'Applying a mutator didn\'t add "mutationToDom"');
|
||||
if (typeof block.mutationToDom != 'function') {
|
||||
throw new Error(errorPrefix +
|
||||
'Applying a mutator didn\'t add "mutationToDom"');
|
||||
}
|
||||
|
||||
// A block with a mutator isn't required to have a mutation dialog, but
|
||||
@@ -280,19 +282,16 @@ Blockly.Extensions.getMutatorProperties_ = function(block) {
|
||||
* @private
|
||||
*/
|
||||
Blockly.Extensions.mutatorPropertiesMatch_ = function(oldProperties, block) {
|
||||
var match = true;
|
||||
var newProperties = Blockly.Extensions.getMutatorProperties_(block);
|
||||
if (newProperties.length != oldProperties.length) {
|
||||
match = false;
|
||||
} else {
|
||||
for (var i = 0; i < newProperties.length; i++) {
|
||||
if (oldProperties[i] != newProperties[i]) {
|
||||
match = false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
for (var i = 0; i < newProperties.length; i++) {
|
||||
if (oldProperties[i] != newProperties[i]) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return match;
|
||||
return true;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -310,11 +309,12 @@ Blockly.Extensions.mutatorPropertiesMatch_ = function(oldProperties, block) {
|
||||
* reported as warnings in the console, and are never fatal.
|
||||
* @param {string} dropdownName The name of the field whose value is the key
|
||||
* to the lookup table.
|
||||
* @param {!Object<string, string>} lookupTable The table of field values to
|
||||
* @param {!Object.<string, string>} lookupTable The table of field values to
|
||||
* tooltip text.
|
||||
* @return {Function} The extension function.
|
||||
*/
|
||||
Blockly.Extensions.buildTooltipForDropdown = function(dropdownName, lookupTable) {
|
||||
Blockly.Extensions.buildTooltipForDropdown = function(dropdownName,
|
||||
lookupTable) {
|
||||
// List of block types already validated, to minimize duplicate warnings.
|
||||
var blockTypesChecked = [];
|
||||
|
||||
@@ -322,10 +322,10 @@ Blockly.Extensions.buildTooltipForDropdown = function(dropdownName, lookupTable)
|
||||
// Wait for load, in case Blockly.Msg is not yet populated.
|
||||
// runAfterPageLoad() does not run in a Node.js environment due to lack of
|
||||
// document object, in which case skip the validation.
|
||||
if (document) { // Relies on document.readyState
|
||||
if (document) { // Relies on document.readyState
|
||||
Blockly.utils.runAfterPageLoad(function() {
|
||||
for (var key in lookupTable) {
|
||||
// Will print warnings is reference is missing.
|
||||
// Will print warnings if reference is missing.
|
||||
Blockly.utils.checkMessageReferences(lookupTable[key]);
|
||||
}
|
||||
});
|
||||
@@ -338,7 +338,7 @@ Blockly.Extensions.buildTooltipForDropdown = function(dropdownName, lookupTable)
|
||||
var extensionFn = function() {
|
||||
if (this.type && blockTypesChecked.indexOf(this.type) === -1) {
|
||||
Blockly.Extensions.checkDropdownOptionsInTable_(
|
||||
this, dropdownName, lookupTable);
|
||||
this, dropdownName, lookupTable);
|
||||
blockTypesChecked.push(this.type);
|
||||
}
|
||||
|
||||
@@ -347,7 +347,7 @@ Blockly.Extensions.buildTooltipForDropdown = function(dropdownName, lookupTable)
|
||||
var tooltip = lookupTable[value];
|
||||
if (tooltip == null) {
|
||||
if (blockTypesChecked.indexOf(this.type) === -1) {
|
||||
// Warn for missing values on generated tooltips
|
||||
// Warn for missing values on generated tooltips.
|
||||
var warning = 'No tooltip mapping for value ' + value +
|
||||
' of field ' + dropdownName;
|
||||
if (this.type != null) {
|
||||
@@ -369,24 +369,24 @@ Blockly.Extensions.buildTooltipForDropdown = function(dropdownName, lookupTable)
|
||||
* Emits console warnings when they are not.
|
||||
* @param {!Blockly.Block} block The block containing the dropdown
|
||||
* @param {string} dropdownName The name of the dropdown
|
||||
* @param {!Object<string, string>} lookupTable The string lookup table
|
||||
* @param {!Object.<string, string>} lookupTable The string lookup table
|
||||
* @private
|
||||
*/
|
||||
Blockly.Extensions.checkDropdownOptionsInTable_ =
|
||||
function(block, dropdownName, lookupTable) {
|
||||
// Validate all dropdown options have values.
|
||||
var dropdown = block.getField(dropdownName);
|
||||
if (!dropdown.isOptionListDynamic()) {
|
||||
var options = dropdown.getOptions();
|
||||
for (var i = 0; i < options.length; ++i) {
|
||||
var optionKey = options[i][1]; // label, then value
|
||||
if (lookupTable[optionKey] == null) {
|
||||
console.warn('No tooltip mapping for value ' + optionKey +
|
||||
' of field ' + dropdownName + ' of block type ' + block.type);
|
||||
}
|
||||
Blockly.Extensions.checkDropdownOptionsInTable_ = function(block, dropdownName,
|
||||
lookupTable) {
|
||||
// Validate all dropdown options have values.
|
||||
var dropdown = block.getField(dropdownName);
|
||||
if (!dropdown.isOptionListDynamic()) {
|
||||
var options = dropdown.getOptions();
|
||||
for (var i = 0; i < options.length; ++i) {
|
||||
var optionKey = options[i][1]; // label, then value
|
||||
if (lookupTable[optionKey] == null) {
|
||||
console.warn('No tooltip mapping for value ' + optionKey +
|
||||
' of field ' + dropdownName + ' of block type ' + block.type);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Builds an extension function that will install a dynamic tooltip. The
|
||||
@@ -397,31 +397,31 @@ Blockly.Extensions.checkDropdownOptionsInTable_ =
|
||||
* @param {string} fieldName The field with the replacement value.
|
||||
* @returns {Function} The extension function.
|
||||
*/
|
||||
Blockly.Extensions.buildTooltipWithFieldValue =
|
||||
function(msgTemplate, fieldName) {
|
||||
// Check the tooltip string messages for invalid references.
|
||||
// Wait for load, in case Blockly.Msg is not yet populated.
|
||||
// runAfterPageLoad() does not run in a Node.js environment due to lack of
|
||||
// document object, in which case skip the validation.
|
||||
if (document) { // Relies on document.readyState
|
||||
Blockly.utils.runAfterPageLoad(function() {
|
||||
// Will print warnings is reference is missing.
|
||||
Blockly.utils.checkMessageReferences(msgTemplate);
|
||||
});
|
||||
}
|
||||
Blockly.Extensions.buildTooltipWithFieldValue = function(msgTemplate,
|
||||
fieldName) {
|
||||
// Check the tooltip string messages for invalid references.
|
||||
// Wait for load, in case Blockly.Msg is not yet populated.
|
||||
// runAfterPageLoad() does not run in a Node.js environment due to lack of
|
||||
// document object, in which case skip the validation.
|
||||
if (document) { // Relies on document.readyState
|
||||
Blockly.utils.runAfterPageLoad(function() {
|
||||
// Will print warnings if reference is missing.
|
||||
Blockly.utils.checkMessageReferences(msgTemplate);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* The actual extension.
|
||||
* @this {Blockly.Block}
|
||||
*/
|
||||
var extensionFn = function() {
|
||||
this.setTooltip(function() {
|
||||
return Blockly.utils.replaceMessageReferences(msgTemplate)
|
||||
.replace('%1', this.getFieldValue(fieldName));
|
||||
}.bind(this));
|
||||
};
|
||||
return extensionFn;
|
||||
/**
|
||||
* The actual extension.
|
||||
* @this {Blockly.Block}
|
||||
*/
|
||||
var extensionFn = function() {
|
||||
this.setTooltip(function() {
|
||||
return Blockly.utils.replaceMessageReferences(msgTemplate)
|
||||
.replace('%1', this.getFieldValue(fieldName));
|
||||
}.bind(this));
|
||||
};
|
||||
return extensionFn;
|
||||
};
|
||||
|
||||
/**
|
||||
* Configures the tooltip to mimic the parent block when connected. Otherwise,
|
||||
@@ -435,10 +435,8 @@ Blockly.Extensions.extensionParentTooltip_ = function() {
|
||||
this.tooltipWhenNotConnected_ = this.tooltip;
|
||||
this.setTooltip(function() {
|
||||
var parent = this.getParent();
|
||||
return (parent &&
|
||||
parent.getInputsInline() &&
|
||||
parent.tooltip) ||
|
||||
this.tooltipWhenNotConnected_;
|
||||
return (parent && parent.getInputsInline() && parent.tooltip) ||
|
||||
this.tooltipWhenNotConnected_;
|
||||
}.bind(this));
|
||||
};
|
||||
Blockly.Extensions.register('parent_tooltip_when_inline',
|
||||
|
||||
+6
-4
@@ -146,7 +146,7 @@ Blockly.Field.prototype.init = function() {
|
||||
'ry': 4,
|
||||
'x': -Blockly.BlockSvg.SEP_SPACE_X / 2,
|
||||
'y': 0,
|
||||
'height': 16}, this.fieldGroup_, this.sourceBlock_.workspace);
|
||||
'height': 16}, this.fieldGroup_);
|
||||
/** @type {!Element} */
|
||||
this.textElement_ = Blockly.utils.createSvgElement('text',
|
||||
{'class': 'blocklyText', 'y': this.size_.height - 12.5},
|
||||
@@ -527,7 +527,8 @@ Blockly.Field.prototype.setValue = function(newValue) {
|
||||
* @param {!Event} e Mouse down event.
|
||||
* @private
|
||||
*/
|
||||
Blockly.Field.prototype.onMouseDown_ = function(e) {
|
||||
Blockly.Field.prototype.onMouseDown_ = function(
|
||||
/* eslint-disable no-unused-vars */ e /* eslint-enable no-unused-vars */) {
|
||||
if (!this.sourceBlock_ || !this.sourceBlock_.workspace) {
|
||||
return;
|
||||
}
|
||||
@@ -537,13 +538,14 @@ Blockly.Field.prototype.onMouseDown_ = function(e) {
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Change the tooltip text for this field.
|
||||
* @param {string|!Element} newTip Text for tooltip or a parent element to
|
||||
* link to for its tooltip.
|
||||
*/
|
||||
Blockly.Field.prototype.setTooltip = function(newTip) {
|
||||
Blockly.Field.prototype.setTooltip = function(
|
||||
/* eslint-disable no-unused-vars */ newTip
|
||||
/* eslint-enable no-unused-vars */) {
|
||||
// Non-abstract sub-classes may wish to implement this. See FieldLabel.
|
||||
};
|
||||
|
||||
|
||||
+11
-11
@@ -112,13 +112,13 @@ Blockly.FieldAngle.prototype.render_ = function() {
|
||||
|
||||
// Update textElement.
|
||||
this.textElement_.textContent = this.getDisplayText_();
|
||||
|
||||
|
||||
// Insert degree symbol.
|
||||
if (this.sourceBlock_.RTL) {
|
||||
this.textElement_.insertBefore(this.symbol_, this.textElement_.firstChild);
|
||||
} else {
|
||||
this.textElement_.appendChild(this.symbol_);
|
||||
}
|
||||
this.textElement_.insertBefore(this.symbol_, this.textElement_.firstChild);
|
||||
} else {
|
||||
this.textElement_.appendChild(this.symbol_);
|
||||
}
|
||||
this.updateWidth();
|
||||
};
|
||||
|
||||
@@ -174,11 +174,11 @@ Blockly.FieldAngle.prototype.showEditor_ = function() {
|
||||
}, svg);
|
||||
this.gauge_ = Blockly.utils.createSvgElement('path',
|
||||
{'class': 'blocklyAngleGauge'}, svg);
|
||||
this.line_ = Blockly.utils.createSvgElement('line',{
|
||||
'x1': Blockly.FieldAngle.HALF,
|
||||
'y1': Blockly.FieldAngle.HALF,
|
||||
'class': 'blocklyAngleLine',
|
||||
}, svg);
|
||||
this.line_ = Blockly.utils.createSvgElement('line', {
|
||||
'x1': Blockly.FieldAngle.HALF,
|
||||
'y1': Blockly.FieldAngle.HALF,
|
||||
'class': 'blocklyAngleLine'
|
||||
}, svg);
|
||||
// Draw markers around the edge.
|
||||
for (var angle = 0; angle < 360; angle += 15) {
|
||||
Blockly.utils.createSvgElement('line', {
|
||||
@@ -317,4 +317,4 @@ Blockly.FieldAngle.prototype.classValidator = function(text) {
|
||||
n -= 360;
|
||||
}
|
||||
return String(n);
|
||||
};
|
||||
};
|
||||
|
||||
+2
-2
@@ -54,7 +54,7 @@ Blockly.FieldImage = function(src, width, height, opt_alt, opt_onClick) {
|
||||
this.text_ = opt_alt || '';
|
||||
this.setValue(src);
|
||||
|
||||
if (typeof opt_onClick === "function") {
|
||||
if (typeof opt_onClick == 'function') {
|
||||
this.clickHandler_ = opt_onClick;
|
||||
}
|
||||
};
|
||||
@@ -188,7 +188,7 @@ Blockly.FieldImage.prototype.updateWidth = function() {
|
||||
* call the handler.
|
||||
*/
|
||||
Blockly.FieldImage.prototype.showEditor_ = function() {
|
||||
if (this.clickHandler_){
|
||||
if (this.clickHandler_) {
|
||||
this.clickHandler_(this);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -29,6 +29,7 @@ goog.provide('Blockly.FieldNumber');
|
||||
goog.require('Blockly.FieldTextInput');
|
||||
goog.require('goog.math');
|
||||
|
||||
|
||||
/**
|
||||
* Class for an editable number field.
|
||||
* @param {(string|number)=} opt_value The initial content of the field. The value
|
||||
|
||||
+9
-10
@@ -258,7 +258,8 @@ Blockly.FieldTextInput.prototype.onHtmlInputKeyDown_ = function(e) {
|
||||
* @param {!Event} e Keyboard event.
|
||||
* @private
|
||||
*/
|
||||
Blockly.FieldTextInput.prototype.onHtmlInputChange_ = function(e) {
|
||||
Blockly.FieldTextInput.prototype.onHtmlInputChange_ = function(
|
||||
/* eslint-disable no-unused-vars */ e /* eslint-enable no-unused-vars */) {
|
||||
var htmlInput = Blockly.FieldTextInput.htmlInput_;
|
||||
// Update source block.
|
||||
var text = htmlInput.value;
|
||||
@@ -300,17 +301,15 @@ Blockly.FieldTextInput.prototype.validate_ = function() {
|
||||
*/
|
||||
Blockly.FieldTextInput.prototype.resizeEditor_ = function() {
|
||||
var div = Blockly.WidgetDiv.DIV;
|
||||
var bBox = this.fieldGroup_.getBBox();
|
||||
div.style.width = bBox.width * this.workspace_.scale + 'px';
|
||||
div.style.height = bBox.height * this.workspace_.scale + 'px';
|
||||
var xy = this.getAbsoluteXY_();
|
||||
var bBox = this.getScaledBBox_();
|
||||
div.style.width = bBox.right - bBox.left + 'px';
|
||||
div.style.height = bBox.bottom - bBox.top + 'px';
|
||||
|
||||
// In RTL mode block fields and LTR input fields the left edge moves,
|
||||
// whereas the right edge is fixed. Reposition the editor.
|
||||
if (this.sourceBlock_.RTL) {
|
||||
var borderBBox = this.getScaledBBox_();
|
||||
xy.x += borderBBox.width;
|
||||
xy.x -= div.offsetWidth;
|
||||
}
|
||||
var x = this.sourceBlock_.RTL ? bBox.right - div.offsetWidth : bBox.left;
|
||||
var xy = new goog.math.Coordinate(x, bBox.top);
|
||||
|
||||
// Shift by a few pixels to line up exactly.
|
||||
xy.y += 1;
|
||||
if (goog.userAgent.GECKO && Blockly.WidgetDiv.DIV.style.top) {
|
||||
|
||||
@@ -41,8 +41,8 @@ goog.require('goog.string');
|
||||
* a unique variable name will be generated.
|
||||
* @param {Function=} opt_validator A function that is executed when a new
|
||||
* option is selected. Its sole argument is the new option value.
|
||||
* @param {Array.<string>} opt_variableTypes A list of the types of variables to
|
||||
* include in the dropdown.
|
||||
* @param {Array.<string>=} opt_variableTypes A list of the types of variables
|
||||
* to include in the dropdown.
|
||||
* @extends {Blockly.FieldDropdown}
|
||||
* @constructor
|
||||
*/
|
||||
@@ -118,7 +118,7 @@ Blockly.FieldVariable.prototype.setValue = function(value) {
|
||||
newText = variable.name;
|
||||
}
|
||||
// TODO(marisaleung): Remove name lookup after converting all Field Variable
|
||||
// instances to use id instead of name.
|
||||
// instances to use ID instead of name.
|
||||
else if (variable = this.sourceBlock_.workspace.getVariable(value)) {
|
||||
newValue = variable.getId();
|
||||
}
|
||||
@@ -181,7 +181,7 @@ Blockly.FieldVariable.dropdownCreate = function() {
|
||||
var variables = workspace.getVariablesOfType(variableType);
|
||||
variableModelList = variableModelList.concat(variables);
|
||||
}
|
||||
for (var i = 0; i < variableModelList.length; i++){
|
||||
for (var i = 0; i < variableModelList.length; i++) {
|
||||
if (createSelectedVariable &&
|
||||
goog.string.caseInsensitiveEquals(variableModelList[i].name, name)) {
|
||||
createSelectedVariable = false;
|
||||
@@ -197,13 +197,13 @@ Blockly.FieldVariable.dropdownCreate = function() {
|
||||
variableModelList.sort(Blockly.VariableModel.compareByName);
|
||||
var options = [];
|
||||
for (var i = 0; i < variableModelList.length; i++) {
|
||||
// Set the uuid as the internal representation of the variable.
|
||||
// Set the UUID as the internal representation of the variable.
|
||||
options[i] = [variableModelList[i].name, variableModelList[i].getId()];
|
||||
}
|
||||
options.push([Blockly.Msg.RENAME_VARIABLE, Blockly.RENAME_VARIABLE_ID]);
|
||||
if (Blockly.Msg.DELETE_VARIABLE) {
|
||||
options.push([Blockly.Msg.DELETE_VARIABLE.replace('%1', name),
|
||||
Blockly.DELETE_VARIABLE_ID]);
|
||||
Blockly.DELETE_VARIABLE_ID]);
|
||||
}
|
||||
return options;
|
||||
};
|
||||
@@ -217,7 +217,7 @@ Blockly.FieldVariable.dropdownCreate = function() {
|
||||
*/
|
||||
Blockly.FieldVariable.prototype.onItemSelected = function(menu, menuItem) {
|
||||
var id = menuItem.getValue();
|
||||
// TODO(marisaleung): change setValue() to take in an id as the parameter.
|
||||
// TODO(marisaleung): change setValue() to take in an ID as the parameter.
|
||||
// Then remove itemText.
|
||||
var itemText;
|
||||
if (this.sourceBlock_ && this.sourceBlock_.workspace) {
|
||||
@@ -226,8 +226,7 @@ Blockly.FieldVariable.prototype.onItemSelected = function(menu, menuItem) {
|
||||
// If the item selected is a variable, set itemText to the variable name.
|
||||
if (variable) {
|
||||
itemText = variable.name;
|
||||
}
|
||||
else if (id == Blockly.RENAME_VARIABLE_ID) {
|
||||
} else if (id == Blockly.RENAME_VARIABLE_ID) {
|
||||
// Rename variable.
|
||||
var currentName = this.getText();
|
||||
variable = workspace.getVariable(currentName);
|
||||
|
||||
+17
-16
@@ -75,12 +75,12 @@ Blockly.Flyout = function(workspaceOptions) {
|
||||
this.eventWrappers_ = [];
|
||||
|
||||
/**
|
||||
* List of background buttons that lurk behind each block to catch clicks
|
||||
* List of background mats that lurk behind each block to catch clicks
|
||||
* landing in the blocks' lakes and bays.
|
||||
* @type {!Array.<!Element>}
|
||||
* @private
|
||||
*/
|
||||
this.backgroundButtons_ = [];
|
||||
this.mats_ = [];
|
||||
|
||||
/**
|
||||
* List of visible buttons.
|
||||
@@ -518,7 +518,7 @@ Blockly.Flyout.prototype.show = function(xmlList) {
|
||||
};
|
||||
|
||||
/**
|
||||
* Delete blocks and background buttons from a previous showing of the flyout.
|
||||
* Delete blocks, mats and buttons from a previous showing of the flyout.
|
||||
* @private
|
||||
*/
|
||||
Blockly.Flyout.prototype.clearOldBlocks_ = function() {
|
||||
@@ -529,13 +529,15 @@ Blockly.Flyout.prototype.clearOldBlocks_ = function() {
|
||||
block.dispose(false, false);
|
||||
}
|
||||
}
|
||||
// Delete any background buttons from a previous showing.
|
||||
for (var j = 0; j < this.backgroundButtons_.length; j++) {
|
||||
var rect = this.backgroundButtons_[j];
|
||||
if (rect) goog.dom.removeNode(rect);
|
||||
// Delete any mats from a previous showing.
|
||||
for (var j = 0; j < this.mats_.length; j++) {
|
||||
var rect = this.mats_[j];
|
||||
if (rect) {
|
||||
goog.dom.removeNode(rect);
|
||||
}
|
||||
}
|
||||
this.backgroundButtons_.length = 0;
|
||||
|
||||
this.mats_.length = 0;
|
||||
// Delete any buttons from a previous showing.
|
||||
for (var i = 0, button; button = this.buttons_[i]; i++) {
|
||||
button.dispose();
|
||||
}
|
||||
@@ -547,7 +549,7 @@ Blockly.Flyout.prototype.clearOldBlocks_ = function() {
|
||||
* @param {!Element} root The root node of the SVG group the block is in.
|
||||
* @param {!Blockly.Block} block The block to add listeners for.
|
||||
* @param {!Element} rect The invisible rectangle under the block that acts as
|
||||
* a button for that block.
|
||||
* a mat for that block.
|
||||
* @private
|
||||
*/
|
||||
Blockly.Flyout.prototype.addBlockListeners_ = function(root, block, rect) {
|
||||
@@ -652,8 +654,8 @@ Blockly.Flyout.prototype.initFlyoutButton_ = function(button, x, y) {
|
||||
* @param {number} y The y position of the cursor during this layout pass.
|
||||
* @param {!{height: number, width: number}} blockHW The height and width of the
|
||||
* block.
|
||||
* @param {number} index The index into the background buttons list where this
|
||||
* rect should be placed.
|
||||
* @param {number} index The index into the mats list where this rect should be
|
||||
* placed.
|
||||
* @return {!SVGElement} Newly created SVG element for the rectangle behind the
|
||||
* block.
|
||||
* @private
|
||||
@@ -675,7 +677,7 @@ Blockly.Flyout.prototype.createRect_ = function(block, x, y, blockHW, index) {
|
||||
this.workspace_.getCanvas().insertBefore(rect, block.getSvgRoot());
|
||||
|
||||
block.flyoutRect_ = rect;
|
||||
this.backgroundButtons_[index] = rect;
|
||||
this.mats_[index] = rect;
|
||||
return rect;
|
||||
};
|
||||
|
||||
@@ -725,14 +727,13 @@ Blockly.Flyout.prototype.filterForCapacity_ = function() {
|
||||
};
|
||||
|
||||
/**
|
||||
* Reflow blocks and their buttons.
|
||||
* Reflow blocks and their mats.
|
||||
*/
|
||||
Blockly.Flyout.prototype.reflow = function() {
|
||||
if (this.reflowWrapper_) {
|
||||
this.workspace_.removeChangeListener(this.reflowWrapper_);
|
||||
}
|
||||
var blocks = this.workspace_.getTopBlocks(false);
|
||||
this.reflowInternal_(blocks);
|
||||
this.reflowInternal_();
|
||||
if (this.reflowWrapper_) {
|
||||
this.workspace_.addChangeListener(this.reflowWrapper_);
|
||||
}
|
||||
|
||||
+14
-5
@@ -145,17 +145,17 @@ Blockly.FlyoutButton.prototype.createDom = function() {
|
||||
// Background rectangle.
|
||||
var rect = Blockly.utils.createSvgElement('rect',
|
||||
{'class': this.isLabel_ ?
|
||||
'blocklyFlyoutLabelBackground' : 'blocklyFlyoutButtonBackground',
|
||||
'rx': 4, 'ry': 4},
|
||||
'blocklyFlyoutLabelBackground' : 'blocklyFlyoutButtonBackground',
|
||||
'rx': 4, 'ry': 4},
|
||||
this.svgGroup_);
|
||||
|
||||
var svgText = Blockly.utils.createSvgElement('text',
|
||||
{'class': this.isLabel_ ? 'blocklyFlyoutLabelText' : 'blocklyText',
|
||||
'x': 0, 'y': 0, 'text-anchor': 'middle'},
|
||||
'x': 0, 'y': 0, 'text-anchor': 'middle'},
|
||||
this.svgGroup_);
|
||||
svgText.textContent = this.text_;
|
||||
|
||||
this.width = svgText.getComputedTextLength();
|
||||
this.width = Blockly.Field.getCachedWidth(svgText);
|
||||
this.height = 20; // Can't compute it :(
|
||||
|
||||
if (!this.isLabel_) {
|
||||
@@ -185,7 +185,7 @@ Blockly.FlyoutButton.prototype.show = function() {
|
||||
};
|
||||
|
||||
/**
|
||||
* Update svg attributes to match internal state.
|
||||
* Update SVG attributes to match internal state.
|
||||
* @private
|
||||
*/
|
||||
Blockly.FlyoutButton.prototype.updateTransform_ = function() {
|
||||
@@ -204,6 +204,15 @@ Blockly.FlyoutButton.prototype.moveTo = function(x, y) {
|
||||
this.updateTransform_();
|
||||
};
|
||||
|
||||
/**
|
||||
* Location of the button.
|
||||
* @return {!goog.math.Coordinate} x, y coordinates.
|
||||
* @package
|
||||
*/
|
||||
Blockly.FlyoutButton.prototype.getPosition = function() {
|
||||
return this.position_;
|
||||
};
|
||||
|
||||
/**
|
||||
* Get the button's target workspace.
|
||||
* @return {!Blockly.WorkspaceSvg} The target workspace of the flyout where this
|
||||
|
||||
@@ -351,14 +351,14 @@ Blockly.HorizontalFlyout.prototype.getClientRect = function() {
|
||||
};
|
||||
|
||||
/**
|
||||
* Compute height of flyout. Position button under each block.
|
||||
* Compute height of flyout. Position mat under each block.
|
||||
* For RTL: Lay out the blocks right-aligned.
|
||||
* @param {!Array<!Blockly.Block>} blocks The blocks to reflow.
|
||||
* @private
|
||||
*/
|
||||
Blockly.HorizontalFlyout.prototype.reflowInternal_ = function(blocks) {
|
||||
Blockly.HorizontalFlyout.prototype.reflowInternal_ = function() {
|
||||
this.workspace_.scale = this.targetWorkspace_.scale;
|
||||
var flyoutHeight = 0;
|
||||
var blocks = this.workspace_.getTopBlocks(false);
|
||||
for (var i = 0, block; block = blocks[i]; i++) {
|
||||
flyoutHeight = Math.max(flyoutHeight, block.getHeightWidth().height);
|
||||
}
|
||||
|
||||
+16
-7
@@ -188,7 +188,7 @@ Blockly.VerticalFlyout.prototype.setBackgroundPath_ = function(width, height) {
|
||||
atRight ? this.CORNER_RADIUS : -this.CORNER_RADIUS,
|
||||
this.CORNER_RADIUS);
|
||||
// Bottom.
|
||||
path.push('h', atRight ? width : -width);
|
||||
path.push('h', atRight ? width : -width);
|
||||
path.push('z');
|
||||
this.svgBackground_.setAttribute('d', path.join(' '));
|
||||
};
|
||||
@@ -326,14 +326,14 @@ Blockly.VerticalFlyout.prototype.getClientRect = function() {
|
||||
};
|
||||
|
||||
/**
|
||||
* Compute width of flyout. Position button under each block.
|
||||
* For RTL: Lay out the blocks right-aligned.
|
||||
* @param {!Array<!Blockly.Block>} blocks The blocks to reflow.
|
||||
* Compute width of flyout. Position mat under each block.
|
||||
* For RTL: Lay out the blocks and buttons to be right-aligned.
|
||||
* @private
|
||||
*/
|
||||
Blockly.VerticalFlyout.prototype.reflowInternal_ = function(blocks) {
|
||||
Blockly.VerticalFlyout.prototype.reflowInternal_ = function() {
|
||||
this.workspace_.scale = this.targetWorkspace_.scale;
|
||||
var flyoutWidth = 0;
|
||||
var blocks = this.workspace_.getTopBlocks(false);
|
||||
for (var i = 0, block; block = blocks[i]; i++) {
|
||||
var width = block.getHeightWidth().width;
|
||||
if (block.outputConnection) {
|
||||
@@ -353,14 +353,23 @@ Blockly.VerticalFlyout.prototype.reflowInternal_ = function(blocks) {
|
||||
if (this.RTL) {
|
||||
// With the flyoutWidth known, right-align the blocks.
|
||||
var oldX = block.getRelativeToSurfaceXY().x;
|
||||
var newX = flyoutWidth / this.workspace_.scale - this.MARGIN;
|
||||
newX -= Blockly.BlockSvg.TAB_WIDTH;
|
||||
var newX = flyoutWidth / this.workspace_.scale - this.MARGIN -
|
||||
Blockly.BlockSvg.TAB_WIDTH;
|
||||
block.moveBy(newX - oldX, 0);
|
||||
}
|
||||
if (block.flyoutRect_) {
|
||||
this.moveRectToBlock_(block.flyoutRect_, block);
|
||||
}
|
||||
}
|
||||
if (this.RTL) {
|
||||
// With the flyoutWidth known, right-align the buttons.
|
||||
for (var i = 0, button; button = this.buttons_[i]; i++) {
|
||||
var y = button.getPosition().y;
|
||||
var x = flyoutWidth - button.width - this.MARGIN -
|
||||
Blockly.BlockSvg.TAB_WIDTH;
|
||||
button.moveTo(x, y);
|
||||
}
|
||||
}
|
||||
// Record the width for .getMetrics_ and .position.
|
||||
this.width_ = flyoutWidth;
|
||||
// Call this since it is possible the trash and zoom buttons need
|
||||
|
||||
+1
-1
@@ -366,7 +366,7 @@ Blockly.Generator.prototype.provideFunction_ = function(desiredName, code) {
|
||||
var oldCodeText;
|
||||
while (oldCodeText != codeText) {
|
||||
oldCodeText = codeText;
|
||||
codeText = codeText.replace(/^(( )*) /gm, '$1\0');
|
||||
codeText = codeText.replace(/^(( {2})*) {2}/gm, '$1\0');
|
||||
}
|
||||
codeText = codeText.replace(/\0/g, this.INDENT);
|
||||
this.definitions_[desiredName] = codeText;
|
||||
|
||||
+2
-2
@@ -246,7 +246,7 @@ Blockly.Gesture.prototype.updateFromEvent_ = function(e) {
|
||||
var currentXY = new goog.math.Coordinate(e.clientX, e.clientY);
|
||||
var changed = this.updateDragDelta_(currentXY);
|
||||
// Exceeded the drag radius for the first time.
|
||||
if (changed){
|
||||
if (changed) {
|
||||
this.updateIsDragging_();
|
||||
Blockly.longStop_();
|
||||
}
|
||||
@@ -328,7 +328,7 @@ Blockly.Gesture.prototype.updateIsDraggingBlock_ = function() {
|
||||
|
||||
if (this.flyout_) {
|
||||
this.isDraggingBlock_ = this.updateIsDraggingFromFlyout_();
|
||||
} else if (this.targetBlock_.isMovable()){
|
||||
} else if (this.targetBlock_.isMovable()) {
|
||||
this.isDraggingBlock_ = true;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -121,7 +121,7 @@ Blockly.Grid.prototype.getSpacing = function() {
|
||||
/**
|
||||
* Get the id of the pattern element, which should be randomized to avoid
|
||||
* conflicts with other Blockly instances on the page.
|
||||
* @return {string} The pattern id.
|
||||
* @return {string} The pattern ID.
|
||||
* @package
|
||||
*/
|
||||
Blockly.Grid.prototype.getPatternId = function() {
|
||||
|
||||
+1
-1
@@ -54,7 +54,7 @@ Blockly.inject = function(container, opt_options) {
|
||||
throw 'Error: container is not in current document.';
|
||||
}
|
||||
var options = new Blockly.Options(opt_options || {});
|
||||
var subContainer = goog.dom.createDom('div', 'injectionDiv');
|
||||
var subContainer = goog.dom.createDom(goog.dom.TagName.DIV, 'injectionDiv');
|
||||
container.appendChild(subContainer);
|
||||
var svg = Blockly.createDom_(subContainer, options);
|
||||
|
||||
|
||||
+1
-1
@@ -101,7 +101,7 @@ Blockly.Input.prototype.insertFieldAt = function(index, field, opt_name) {
|
||||
|
||||
// Empty string, Null or undefined generates no field, unless field is named.
|
||||
if (!field && !opt_name) {
|
||||
return this;
|
||||
return index;
|
||||
}
|
||||
// Generate a FieldLabel when given a plain text field.
|
||||
if (goog.isString(field)) {
|
||||
|
||||
+1
-1
@@ -42,7 +42,7 @@ goog.getMsgOrig = goog.getMsg;
|
||||
* Overrides the default Closure function to check for a Blockly.Msg first.
|
||||
* Used infrequently, only known case is TODAY button in date picker.
|
||||
* @param {string} str Translatable string, places holders in the form {$foo}.
|
||||
* @param {Object<string, string>=} opt_values Maps place holder name to value.
|
||||
* @param {Object.<string, string>=} opt_values Maps place holder name to value.
|
||||
* @return {string} message with placeholders filled.
|
||||
* @suppress {duplicate}
|
||||
*/
|
||||
|
||||
+7
-1
@@ -73,7 +73,13 @@ Blockly.Mutator.prototype.drawIcon_ = function(group) {
|
||||
// Gear teeth.
|
||||
Blockly.utils.createSvgElement('path',
|
||||
{'class': 'blocklyIconSymbol',
|
||||
'd': 'm4.203,7.296 0,1.368 -0.92,0.677 -0.11,0.41 0.9,1.559 0.41,0.11 1.043,-0.457 1.187,0.683 0.127,1.134 0.3,0.3 1.8,0 0.3,-0.299 0.127,-1.138 1.185,-0.682 1.046,0.458 0.409,-0.11 0.9,-1.559 -0.11,-0.41 -0.92,-0.677 0,-1.366 0.92,-0.677 0.11,-0.41 -0.9,-1.559 -0.409,-0.109 -1.046,0.458 -1.185,-0.682 -0.127,-1.138 -0.3,-0.299 -1.8,0 -0.3,0.3 -0.126,1.135 -1.187,0.682 -1.043,-0.457 -0.41,0.11 -0.899,1.559 0.108,0.409z'},
|
||||
'd': 'm4.203,7.296 0,1.368 -0.92,0.677 -0.11,0.41 0.9,1.559 0.41,' +
|
||||
'0.11 1.043,-0.457 1.187,0.683 0.127,1.134 0.3,0.3 1.8,0 0.3,' +
|
||||
'-0.299 0.127,-1.138 1.185,-0.682 1.046,0.458 0.409,-0.11 0.9,' +
|
||||
'-1.559 -0.11,-0.41 -0.92,-0.677 0,-1.366 0.92,-0.677 0.11,' +
|
||||
'-0.41 -0.9,-1.559 -0.409,-0.109 -1.046,0.458 -1.185,-0.682 ' +
|
||||
'-0.127,-1.138 -0.3,-0.299 -1.8,0 -0.3,0.3 -0.126,1.135 -1.187,' +
|
||||
'0.682 -1.043,-0.457 -0.41,0.11 -0.899,1.559 0.108,0.409z'},
|
||||
group);
|
||||
// Axle hole.
|
||||
Blockly.utils.createSvgElement('circle',
|
||||
|
||||
+6
-5
@@ -30,6 +30,7 @@ goog.provide('Blockly.ScrollbarPair');
|
||||
goog.require('goog.dom');
|
||||
goog.require('goog.events');
|
||||
|
||||
|
||||
/**
|
||||
* A note on units: most of the numbers that are in CSS pixels are scaled if the
|
||||
* scrollbar is in a mutator.
|
||||
@@ -189,7 +190,7 @@ Blockly.ScrollbarPair.prototype.getRatio_ = function(handlePosition, viewSize) {
|
||||
* @param {!Blockly.Workspace} workspace Workspace to bind the scrollbar to.
|
||||
* @param {boolean} horizontal True if horizontal, false if vertical.
|
||||
* @param {boolean=} opt_pair True if scrollbar is part of a horiz/vert pair.
|
||||
* @param {string} opt_class A class to be applied to this scrollbar.
|
||||
* @param {string=} opt_class A class to be applied to this scrollbar.
|
||||
* @constructor
|
||||
*/
|
||||
Blockly.Scrollbar = function(workspace, horizontal, opt_pair, opt_class) {
|
||||
@@ -201,7 +202,7 @@ Blockly.Scrollbar = function(workspace, horizontal, opt_pair, opt_class) {
|
||||
this.createDom_(opt_class);
|
||||
|
||||
/**
|
||||
* The upper left corner of the scrollbar's svg group in CSS pixels relative
|
||||
* The upper left corner of the scrollbar's SVG group in CSS pixels relative
|
||||
* to the scrollbar's origin. This is usually relative to the injection div
|
||||
* origin.
|
||||
* @type {goog.math.Coordinate}
|
||||
@@ -394,7 +395,7 @@ Blockly.ScrollbarPair.prototype.setContainerVisible = function(visible) {
|
||||
};
|
||||
|
||||
/**
|
||||
* Set the position of the scrollbar's svg group in CSS pixels relative to the
|
||||
* Set the position of the scrollbar's SVG group in CSS pixels relative to the
|
||||
* scrollbar's origin. This sets the scrollbar's location within the workspace.
|
||||
* @param {number} x The new x coordinate.
|
||||
* @param {number} y The new y coordinate.
|
||||
@@ -591,7 +592,7 @@ Blockly.Scrollbar.prototype.resizeContentVertical = function(hostMetrics) {
|
||||
/**
|
||||
* Create all the DOM elements required for a scrollbar.
|
||||
* The resulting widget is not sized.
|
||||
* @param {string} opt_class A class to be applied to this scrollbar.
|
||||
* @param {string=} opt_class A class to be applied to this scrollbar.
|
||||
* @private
|
||||
*/
|
||||
Blockly.Scrollbar.prototype.createDom_ = function(opt_class) {
|
||||
@@ -667,7 +668,7 @@ Blockly.Scrollbar.prototype.setVisible = function(visible) {
|
||||
* Update visibility of scrollbar based on whether it thinks it should
|
||||
* be visible and whether its containing workspace is visible.
|
||||
* We cannot rely on the containing workspace being hidden to hide us
|
||||
* because it is not necessarily our parent in the dom.
|
||||
* because it is not necessarily our parent in the DOM.
|
||||
*/
|
||||
Blockly.Scrollbar.prototype.updateDisplay_ = function() {
|
||||
var show = true;
|
||||
|
||||
+14
-10
@@ -296,8 +296,9 @@ Blockly.Toolbox.prototype.populate_ = function(newTree) {
|
||||
/**
|
||||
* Sync trees of the toolbox.
|
||||
* @param {!Node} treeIn DOM tree of blocks.
|
||||
* @param {!Blockly.Toolbox.TreeControl} treeOut
|
||||
* @param {string} pathToMedia
|
||||
* @param {!Blockly.Toolbox.TreeControl} treeOut The TreeContorol object built
|
||||
* from treeIn.
|
||||
* @param {string} pathToMedia The path to the Blockly media directory.
|
||||
* @return {Node} Tree node to open at startup (or null).
|
||||
* @private
|
||||
*/
|
||||
@@ -331,12 +332,12 @@ Blockly.Toolbox.prototype.syncTrees_ = function(treeIn, treeOut, pathToMedia) {
|
||||
// Decode the colour for any potential message references
|
||||
// (eg. `%{BKY_MATH_HUE}`).
|
||||
var colour = Blockly.utils.replaceMessageReferences(
|
||||
childIn.getAttribute('colour'));
|
||||
childIn.getAttribute('colour'));
|
||||
if (goog.isString(colour)) {
|
||||
if (colour.match(/^#[0-9a-fA-F]{6}$/)) {
|
||||
if (/^#[0-9a-fA-F]{6}$/.test(colour)) {
|
||||
childOut.hexColour = colour;
|
||||
} else {
|
||||
childOut.hexColour = Blockly.hueToRgb(colour);
|
||||
childOut.hexColour = Blockly.hueToRgb(Number(colour));
|
||||
}
|
||||
this.hasColours_ = true;
|
||||
} else {
|
||||
@@ -388,7 +389,7 @@ Blockly.Toolbox.prototype.syncTrees_ = function(treeIn, treeOut, pathToMedia) {
|
||||
|
||||
/**
|
||||
* Recursively add colours to this toolbox.
|
||||
* @param {Blockly.Toolbox.TreeNode} opt_tree Starting point of tree.
|
||||
* @param {Blockly.Toolbox.TreeNode=} opt_tree Starting point of tree.
|
||||
* Defaults to the root node.
|
||||
* @private
|
||||
*/
|
||||
@@ -629,7 +630,8 @@ Blockly.Toolbox.TreeNode.prototype.getExpandIconSafeHtml = function() {
|
||||
* @param {!goog.events.BrowserEvent} e The browser event.
|
||||
* @override
|
||||
*/
|
||||
Blockly.Toolbox.TreeNode.prototype.onClick_ = function(e) {
|
||||
Blockly.Toolbox.TreeNode.prototype.onClick_ = function(
|
||||
/* eslint-disable no-unused-vars */ e /* eslint-disable no-unused-vars */) {
|
||||
// Expand icon.
|
||||
if (this.hasChildren() && this.isUserCollapsible_) {
|
||||
this.toggle();
|
||||
@@ -648,7 +650,8 @@ Blockly.Toolbox.TreeNode.prototype.onClick_ = function(e) {
|
||||
* @override
|
||||
* @private
|
||||
*/
|
||||
Blockly.Toolbox.TreeNode.prototype.onMouseDown = function(e) {
|
||||
Blockly.Toolbox.TreeNode.prototype.onMouseDown = function(
|
||||
/* eslint-disable no-unused-vars */ e /* eslint-disable no-unused-vars */) {
|
||||
// NOPE.
|
||||
};
|
||||
|
||||
@@ -658,7 +661,8 @@ Blockly.Toolbox.TreeNode.prototype.onMouseDown = function(e) {
|
||||
* @override
|
||||
* @private
|
||||
*/
|
||||
Blockly.Toolbox.TreeNode.prototype.onDoubleClick_ = function(e) {
|
||||
Blockly.Toolbox.TreeNode.prototype.onDoubleClick_ = function(
|
||||
/* eslint-disable no-unused-vars */ e /* eslint-disable no-unused-vars */) {
|
||||
// NOP.
|
||||
};
|
||||
|
||||
@@ -695,6 +699,6 @@ Blockly.Toolbox.TreeNode.prototype.onKeyDown = function(e) {
|
||||
* @extends {Blockly.Toolbox.TreeNode}
|
||||
*/
|
||||
Blockly.Toolbox.TreeSeparator = function(config) {
|
||||
Blockly.Toolbox.TreeNode.call(this, null, '', config);
|
||||
Blockly.Toolbox.TreeNode.call(this, null, goog.html.SafeHtml.EMPTY, config);
|
||||
};
|
||||
goog.inherits(Blockly.Toolbox.TreeSeparator, Blockly.Toolbox.TreeNode);
|
||||
|
||||
+5
-2
@@ -184,7 +184,8 @@ Blockly.Tooltip.onMouseOver_ = function(e) {
|
||||
* @param {!Event} e Mouse event.
|
||||
* @private
|
||||
*/
|
||||
Blockly.Tooltip.onMouseOut_ = function(e) {
|
||||
Blockly.Tooltip.onMouseOut_ = function(/* eslint-disable no-unused-vars */e
|
||||
/* eslint-enable no-unused-vars */) {
|
||||
if (Blockly.Tooltip.blocked_) {
|
||||
// Someone doesn't want us to show tooltips.
|
||||
return;
|
||||
@@ -248,7 +249,9 @@ Blockly.Tooltip.hide = function() {
|
||||
Blockly.Tooltip.DIV.style.display = 'none';
|
||||
}
|
||||
}
|
||||
clearTimeout(Blockly.Tooltip.showPid_);
|
||||
if (Blockly.Tooltip.showPid_) {
|
||||
clearTimeout(Blockly.Tooltip.showPid_);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
+4
-3
@@ -34,9 +34,10 @@ goog.require('goog.events');
|
||||
goog.require('goog.events.BrowserFeature');
|
||||
goog.require('goog.string');
|
||||
|
||||
|
||||
/**
|
||||
* Which touch events are we currently paying attention to?
|
||||
* @type {DOMString}
|
||||
* @type {?string}
|
||||
* @private
|
||||
*/
|
||||
Blockly.Touch.touchIdentifier_ = null;
|
||||
@@ -63,7 +64,7 @@ Blockly.longPid_ = 0;
|
||||
|
||||
/**
|
||||
* Context menus on touch devices are activated using a long-press.
|
||||
* Unfortunately the contextmenu touch event is currently (2015) only suported
|
||||
* Unfortunately the contextmenu touch event is currently (2015) only supported
|
||||
* by Chrome. This function is fired on any touchstart event, queues a task,
|
||||
* which after about a second opens the context menu. The tasks is killed
|
||||
* if the touch event terminates early.
|
||||
@@ -154,7 +155,7 @@ Blockly.Touch.getTouchIdentifierFromEvent = function(e) {
|
||||
Blockly.Touch.checkTouchIdentifier = function(e) {
|
||||
var identifier = Blockly.Touch.getTouchIdentifierFromEvent(e);
|
||||
|
||||
// if (Blockly.touchIdentifier_ )is insufficient because android touch
|
||||
// if (Blockly.touchIdentifier_ )is insufficient because Android touch
|
||||
// identifiers may be zero.
|
||||
if (Blockly.Touch.touchIdentifier_ != undefined &&
|
||||
Blockly.Touch.touchIdentifier_ != null) {
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
**/
|
||||
goog.provide('Blockly.utils.uiMenu');
|
||||
|
||||
|
||||
/**
|
||||
* Get the size of a rendered goog.ui.Menu.
|
||||
* @param {!goog.ui.Menu} menu The menu to measure.
|
||||
|
||||
+29
-24
@@ -44,8 +44,8 @@ goog.require('goog.userAgent');
|
||||
* is not possible. To access the exported Blockly.Msg.Something it needs to be
|
||||
* accessed through the exact name that was exported. Note, that all the exports
|
||||
* are happening as the last thing in the generated js files, so they won't be
|
||||
* accessible before javascript loads!
|
||||
* @return {!Object<string, string>}
|
||||
* accessible before JavaScript loads!
|
||||
* @return {!Object.<string, string>} The message array.
|
||||
* @private
|
||||
*/
|
||||
Blockly.utils.getMessageArray_ = function() {
|
||||
@@ -208,10 +208,9 @@ Blockly.utils.getRelativeXY = function(element) {
|
||||
Blockly.utils.getInjectionDivXY_ = function(element) {
|
||||
var x = 0;
|
||||
var y = 0;
|
||||
var scale = 1;
|
||||
while (element) {
|
||||
var xy = Blockly.utils.getRelativeXY(element);
|
||||
scale = Blockly.utils.getScale_(element);
|
||||
var scale = Blockly.utils.getScale_(element);
|
||||
x = (x * scale) + xy.x;
|
||||
y = (y * scale) + xy.y;
|
||||
var classes = element.getAttribute('class') || '';
|
||||
@@ -286,11 +285,9 @@ Blockly.utils.getRelativeXY.XY_2D_REGEX_ =
|
||||
* @param {string} name Element's tag name.
|
||||
* @param {!Object} attrs Dictionary of attribute names and values.
|
||||
* @param {Element} parent Optional parent on which to append the element.
|
||||
* @param {Blockly.Workspace=} opt_workspace Optional workspace for access to
|
||||
* context (scale...).
|
||||
* @return {!SVGElement} Newly created SVG element.
|
||||
*/
|
||||
Blockly.utils.createSvgElement = function(name, attrs, parent /*, opt_workspace */) {
|
||||
Blockly.utils.createSvgElement = function(name, attrs, parent) {
|
||||
var e = /** @type {!SVGElement} */ (
|
||||
document.createElementNS(Blockly.SVG_NS, name));
|
||||
for (var key in attrs) {
|
||||
@@ -328,7 +325,7 @@ Blockly.utils.isRightButton = function(e) {
|
||||
* @param {!Event} e Mouse event.
|
||||
* @param {!Element} svg SVG element.
|
||||
* @param {SVGMatrix} matrix Inverted screen CTM to use.
|
||||
* @return {!Object} Object with .x and .y properties.
|
||||
* @return {!SVGPoint} Object with .x and .y properties.
|
||||
*/
|
||||
Blockly.utils.mouseToSvg = function(e, svg, matrix) {
|
||||
var svgPoint = svg.createSVGPoint();
|
||||
@@ -454,38 +451,45 @@ Blockly.utils.replaceMessageReferences = function(message) {
|
||||
var interpolatedResult = Blockly.utils.tokenizeInterpolation_(message, false);
|
||||
// When parseInterpolationTokens == false, interpolatedResult should be at
|
||||
// most length 1.
|
||||
return interpolatedResult.length ? interpolatedResult[0] : "";
|
||||
return interpolatedResult.length ? interpolatedResult[0] : '';
|
||||
};
|
||||
|
||||
/**
|
||||
* Validates that any %{BKY_...} references in the message refer to keys of
|
||||
* Validates that any %{MSG_KEY} references in the message refer to keys of
|
||||
* the Blockly.Msg string table.
|
||||
* @param {string} message Text which might contain string table references.
|
||||
* @return {boolean} True if all message references have matching values.
|
||||
* Otherwise, false.
|
||||
*/
|
||||
Blockly.utils.checkMessageReferences = function(message) {
|
||||
var isValid = true; // True until a bad reference is found
|
||||
var validSoFar = true;
|
||||
|
||||
var regex = /%{BKY_([a-zA-Z][a-zA-Z0-9_]*)}/g;
|
||||
var msgTable = Blockly.utils.getMessageArray_();
|
||||
|
||||
// TODO(#1169): Implement support for other string tables, prefixes other than BKY_.
|
||||
var regex = /%{(BKY_[A-Z][A-Z0-9_]*)}/gi;
|
||||
var match = regex.exec(message);
|
||||
while (match != null) {
|
||||
while (match) {
|
||||
var msgKey = match[1];
|
||||
if (Blockly.utils.getMessageArray_()[msgKey] == null) {
|
||||
console.log('WARNING: No message string for %{BKY_' + msgKey + '}.');
|
||||
isValid = false;
|
||||
msgKey = msgKey.toUpperCase();
|
||||
if (msgKey.substr(0, 4) != 'BKY_') {
|
||||
console.log('WARNING: Unsupported message table prefix in %{' + match[1] + '}.');
|
||||
validSoFar = false; // Continue to report other errors.
|
||||
} else if (msgTable[msgKey.substr(4)] == undefined) {
|
||||
console.log('WARNING: No message string for %{' + match[1] + '}.');
|
||||
validSoFar = false; // Continue to report other errors.
|
||||
}
|
||||
|
||||
// Re-run on remainder of sting.
|
||||
// Re-run on remainder of string.
|
||||
message = message.substring(match.index + msgKey.length + 1);
|
||||
match = regex.exec(message);
|
||||
}
|
||||
|
||||
return isValid;
|
||||
return validSoFar;
|
||||
};
|
||||
|
||||
/**
|
||||
* Internal implemention of the message reference and interpolation token
|
||||
* Internal implementation of the message reference and interpolation token
|
||||
* parsing used by tokenizeInterpolation() and replaceMessageReferences().
|
||||
* @param {string} message Text which might contain string table references and
|
||||
* interpolation tokens.
|
||||
@@ -494,7 +498,8 @@ Blockly.utils.checkMessageReferences = function(message) {
|
||||
* @return {!Array.<string|number>} Array of strings and numbers.
|
||||
* @private
|
||||
*/
|
||||
Blockly.utils.tokenizeInterpolation_ = function(message, parseInterpolationTokens) {
|
||||
Blockly.utils.tokenizeInterpolation_ = function(message,
|
||||
parseInterpolationTokens) {
|
||||
var tokens = [];
|
||||
var chars = message.split('');
|
||||
chars.push(''); // End marker.
|
||||
@@ -502,7 +507,7 @@ Blockly.utils.tokenizeInterpolation_ = function(message, parseInterpolationToken
|
||||
// 0 - Base case.
|
||||
// 1 - % found.
|
||||
// 2 - Digit found.
|
||||
// 3 - Message ref found
|
||||
// 3 - Message ref found.
|
||||
var state = 0;
|
||||
var buffer = [];
|
||||
var number = null;
|
||||
@@ -569,7 +574,8 @@ Blockly.utils.tokenizeInterpolation_ = function(message, parseInterpolationToken
|
||||
if (goog.isString(rawValue)) {
|
||||
// Attempt to dereference substrings, too, appending to the end.
|
||||
Array.prototype.push.apply(tokens,
|
||||
Blockly.utils.tokenizeInterpolation(rawValue));
|
||||
Blockly.utils.tokenizeInterpolation_(
|
||||
rawValue, parseInterpolationTokens));
|
||||
} else if (parseInterpolationTokens) {
|
||||
// When parsing interpolation tokens, numbers are special
|
||||
// placeholders (%1, %2, etc). Make sure all other values are
|
||||
@@ -640,7 +646,7 @@ Blockly.utils.genUid = function() {
|
||||
* Legal characters for the unique ID. Should be all on a US keyboard.
|
||||
* No characters that conflict with XML or JSON. Requests to remove additional
|
||||
* 'problematic' characters from this soup will be denied. That's your failure
|
||||
* to properly escape in your own environment. Issues #251, #625, #682.
|
||||
* to properly escape in your own environment. Issues #251, #625, #682, #1304.
|
||||
* @private
|
||||
*/
|
||||
Blockly.utils.genUid.soup_ = '!#$%()*+,-./:;=?@[]^_`{|}~' +
|
||||
@@ -937,4 +943,3 @@ Blockly.utils.getViewportBBox = function() {
|
||||
left: scrollOffset.x
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
+23
-21
@@ -26,6 +26,7 @@
|
||||
|
||||
goog.provide('Blockly.VariableMap');
|
||||
|
||||
|
||||
/**
|
||||
* Class for a variable map. This contains a dictionary data structure with
|
||||
* variable types as keys and lists of variables as values. The list of
|
||||
@@ -33,12 +34,12 @@ goog.provide('Blockly.VariableMap');
|
||||
* @param {!Blockly.Workspace} workspace The workspace this map belongs to.
|
||||
* @constructor
|
||||
*/
|
||||
Blockly.VariableMap = function(workspace) {
|
||||
Blockly.VariableMap = function(workspace) {
|
||||
/**
|
||||
* A map from variable type to list of variable names. The lists contain all
|
||||
* of the named variables in the workspace, including variables
|
||||
* that are not currently in use.
|
||||
* @type {!Object<string, !Array.<Blockly.VariableModel>>}
|
||||
* @type {!Object.<string, !Array.<Blockly.VariableModel>>}
|
||||
* @private
|
||||
*/
|
||||
this.variableMap_ = {};
|
||||
@@ -59,7 +60,7 @@ Blockly.VariableMap.prototype.clear = function() {
|
||||
|
||||
/**
|
||||
* Rename the given variable by updating its name in the variable map.
|
||||
* @param {?Blockly.VariableModel} variable Variable to rename.
|
||||
* @param {Blockly.VariableModel} variable Variable to rename.
|
||||
* @param {string} newName New variable name.
|
||||
*/
|
||||
Blockly.VariableMap.prototype.renameVariable = function(variable, newName) {
|
||||
@@ -75,7 +76,7 @@ Blockly.VariableMap.prototype.renameVariable = function(variable, newName) {
|
||||
if (variable) {
|
||||
variableIndex = variableList.indexOf(variable);
|
||||
}
|
||||
if (newVariable){ // see if I can get rid of newVariable dependency
|
||||
if (newVariable) { // see if I can get rid of newVariable dependency
|
||||
newVariableIndex = variableList.indexOf(newVariable);
|
||||
}
|
||||
|
||||
@@ -103,17 +104,18 @@ Blockly.VariableMap.prototype.renameVariable = function(variable, newName) {
|
||||
};
|
||||
|
||||
/**
|
||||
* Create a variable with a given name, optional type, and optional id.
|
||||
* @param {!string} name The name of the variable. This must be unique across
|
||||
* Create a variable with a given name, optional type, and optional ID.
|
||||
* @param {string} name The name of the variable. This must be unique across
|
||||
* variables and procedures.
|
||||
* @param {?string} opt_type The type of the variable like 'int' or 'string'.
|
||||
* @param {string=} opt_type The type of the variable like 'int' or 'string'.
|
||||
* Does not need to be unique. Field_variable can filter variables based on
|
||||
* their type. This will default to '' which is a specific type.
|
||||
* @param {?string} opt_id The unique id of the variable. This will default to
|
||||
* @param {string=} opt_id The unique ID of the variable. This will default to
|
||||
* a UUID.
|
||||
* @return {?Blockly.VariableModel} The newly created variable.
|
||||
* @return {Blockly.VariableModel} The newly created variable.
|
||||
*/
|
||||
Blockly.VariableMap.prototype.createVariable = function(name, opt_type, opt_id) {
|
||||
Blockly.VariableMap.prototype.createVariable = function(name,
|
||||
opt_type, opt_id) {
|
||||
var variable = this.getVariable(name);
|
||||
if (variable) {
|
||||
if (opt_type && variable.type != opt_type) {
|
||||
@@ -122,11 +124,11 @@ Blockly.VariableMap.prototype.createVariable = function(name, opt_type, opt_id)
|
||||
'type, "' + opt_type + '".');
|
||||
}
|
||||
if (opt_id && variable.getId() != opt_id) {
|
||||
throw Error('Variable "' + name + '" is already in use and its id is "'
|
||||
+ variable.getId() + '" which conflicts with the passed in ' +
|
||||
throw Error('Variable "' + name + '" is already in use and its id is "' +
|
||||
variable.getId() + '" which conflicts with the passed in ' +
|
||||
'id, "' + opt_id + '".');
|
||||
}
|
||||
// The variable already exists and has the same id and type.
|
||||
// The variable already exists and has the same ID and type.
|
||||
return variable;
|
||||
}
|
||||
if (opt_id && this.getVariableById(opt_id)) {
|
||||
@@ -148,7 +150,7 @@ Blockly.VariableMap.prototype.createVariable = function(name, opt_type, opt_id)
|
||||
|
||||
/**
|
||||
* Delete a variable.
|
||||
* @param {Blockly.VariableModel} variable Variable to delete.
|
||||
* @param {!Blockly.VariableModel} variable Variable to delete.
|
||||
*/
|
||||
Blockly.VariableMap.prototype.deleteVariable = function(variable) {
|
||||
var variableList = this.variableMap_[variable.type];
|
||||
@@ -164,8 +166,8 @@ Blockly.VariableMap.prototype.deleteVariable = function(variable) {
|
||||
/**
|
||||
* Find the variable by the given name and return it. Return null if it is not
|
||||
* found.
|
||||
* @param {!string} name The name to check for.
|
||||
* @return {?Blockly.VariableModel} The variable with the given name, or null if
|
||||
* @param {string} name The name to check for.
|
||||
* @return {Blockly.VariableModel} The variable with the given name, or null if
|
||||
* it was not found.
|
||||
*/
|
||||
Blockly.VariableMap.prototype.getVariable = function(name) {
|
||||
@@ -182,10 +184,10 @@ Blockly.VariableMap.prototype.getVariable = function(name) {
|
||||
};
|
||||
|
||||
/**
|
||||
* Find the variable by the given id and return it. Return null if it is not
|
||||
* Find the variable by the given ID and return it. Return null if it is not
|
||||
* found.
|
||||
* @param {!string} id The id to check for.
|
||||
* @return {?Blockly.VariableModel} The variable with the given id.
|
||||
* @param {string} id The ID to check for.
|
||||
* @return {Blockly.VariableModel} The variable with the given ID.
|
||||
*/
|
||||
Blockly.VariableMap.prototype.getVariableById = function(id) {
|
||||
var keys = Object.keys(this.variableMap_);
|
||||
@@ -204,7 +206,7 @@ Blockly.VariableMap.prototype.getVariableById = function(id) {
|
||||
* Get a list containing all of the variables of a specified type. If type is
|
||||
* null, return list of variables with empty string type.
|
||||
* @param {?string} type Type of the variables to find.
|
||||
* @return {Array.<Blockly.VariableModel>} The sought after variables of the
|
||||
* @return {!Array.<!Blockly.VariableModel>} The sought after variables of the
|
||||
* passed in type. An empty array if none are found.
|
||||
*/
|
||||
Blockly.VariableMap.prototype.getVariablesOfType = function(type) {
|
||||
@@ -226,7 +228,7 @@ Blockly.VariableMap.prototype.getVariableTypes = function() {
|
||||
|
||||
/**
|
||||
* Return all variables of all types.
|
||||
* @return {!Array.<Blockly.VariableModel>} List of variable models.
|
||||
* @return {!Array.<!Blockly.VariableModel>} List of variable models.
|
||||
*/
|
||||
Blockly.VariableMap.prototype.getAllVariables = function() {
|
||||
var all_variables = [];
|
||||
|
||||
@@ -31,14 +31,14 @@ goog.require('goog.string');
|
||||
|
||||
/**
|
||||
* Class for a variable model.
|
||||
* Holds information for the variable including name, id, and type.
|
||||
* Holds information for the variable including name, ID, and type.
|
||||
* @param {!Blockly.Workspace} workspace The variable's workspace.
|
||||
* @param {!string} name The name of the variable. This must be unique across
|
||||
* variables and procedures.
|
||||
* @param {?string} opt_type The type of the variable like 'int' or 'string'.
|
||||
* @param {string=} opt_type The type of the variable like 'int' or 'string'.
|
||||
* Does not need to be unique. Field_variable can filter variables based on
|
||||
* their type. This will default to '' which is a specific type.
|
||||
* @param {?string} opt_id The unique id of the variable. This will default to
|
||||
* @param {string=} opt_id The unique ID of the variable. This will default to
|
||||
* a UUID.
|
||||
* @see {Blockly.FieldVariable}
|
||||
* @constructor
|
||||
@@ -80,7 +80,7 @@ Blockly.VariableModel = function(workspace, name, opt_type, opt_id) {
|
||||
};
|
||||
|
||||
/**
|
||||
* @return {!string} The id for the variable.
|
||||
* @return {!string} The ID for the variable.
|
||||
*/
|
||||
Blockly.VariableModel.prototype.getId = function() {
|
||||
return this.id_;
|
||||
|
||||
+8
-8
@@ -177,13 +177,13 @@ Blockly.Variables.flyoutCategoryBlocks = function(workspace) {
|
||||
};
|
||||
|
||||
/**
|
||||
* Return a new variable name that is not yet being used. This will try to
|
||||
* generate single letter variable names in the range 'i' to 'z' to start with.
|
||||
* If no unique name is located it will try 'i' to 'z', 'a' to 'h',
|
||||
* then 'i2' to 'z2' etc. Skip 'l'.
|
||||
* Return a new variable name that is not yet being used. This will try to
|
||||
* generate single letter variable names in the range 'i' to 'z' to start with.
|
||||
* If no unique name is located it will try 'i' to 'z', 'a' to 'h',
|
||||
* then 'i2' to 'z2' etc. Skip 'l'.
|
||||
* @param {!Blockly.Workspace} workspace The workspace to be unique in.
|
||||
* @return {string} New variable name.
|
||||
*/
|
||||
* @return {string} New variable name.
|
||||
*/
|
||||
Blockly.Variables.generateUniqueName = function(workspace) {
|
||||
var variableList = workspace.getAllVariables();
|
||||
var newName = '';
|
||||
@@ -232,7 +232,7 @@ Blockly.Variables.generateUniqueName = function(workspace) {
|
||||
* @param {function(?string=)=} opt_callback A callback. It will
|
||||
* be passed an acceptable new variable name, or null if change is to be
|
||||
* aborted (cancel button), or undefined if an existing variable was chosen.
|
||||
* @param {?string} opt_type The type of the variable like 'int', 'string', or
|
||||
* @param {string=} opt_type The type of the variable like 'int', 'string', or
|
||||
* ''. This will default to '', which is a specific type.
|
||||
*/
|
||||
Blockly.Variables.createVariable = function(workspace, opt_callback, opt_type) {
|
||||
@@ -340,7 +340,7 @@ Blockly.Variables.generateVariableFieldXml_ = function(variableModel) {
|
||||
// to be escaped to create valid XML.
|
||||
var element = goog.dom.createDom('field');
|
||||
element.setAttribute('name', 'VAR');
|
||||
element.setAttribute('variableType', variableModel.type);
|
||||
element.setAttribute('variabletype', variableModel.type);
|
||||
element.setAttribute('id', variableModel.getId());
|
||||
element.textContent = variableModel.name;
|
||||
|
||||
|
||||
+3
-1
@@ -139,7 +139,9 @@ Blockly.Warning.prototype.setVisible = function(visible) {
|
||||
* @param {!Event} e Mouse up event.
|
||||
* @private
|
||||
*/
|
||||
Blockly.Warning.prototype.bodyFocus_ = function(e) {
|
||||
|
||||
Blockly.Warning.prototype.bodyFocus_ = function(
|
||||
/* eslint-disable no-unused-vars */ e /* eslint-enable no-unused-vars */) {
|
||||
this.bubble_.promote_();
|
||||
};
|
||||
|
||||
|
||||
+24
-21
@@ -34,7 +34,7 @@ goog.require('goog.math');
|
||||
/**
|
||||
* Class for a workspace. This is a data structure that contains blocks.
|
||||
* There is no UI, and can be created headlessly.
|
||||
* @param {Blockly.Options} opt_options Dictionary of options.
|
||||
* @param {!Blockly.Options=} opt_options Dictionary of options.
|
||||
* @constructor
|
||||
*/
|
||||
Blockly.Workspace = function(opt_options) {
|
||||
@@ -217,8 +217,7 @@ Blockly.Workspace.prototype.updateVariableStore = function(clear) {
|
||||
if (tempVar) {
|
||||
varList.push({'name': tempVar.name, 'type': tempVar.type,
|
||||
'id': tempVar.getId()});
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
varList.push({'name': name, 'type': null, 'id': null});
|
||||
// TODO(marisaleung): Use variable.type and variable.getId() once variable
|
||||
// instances are storing more than just name.
|
||||
@@ -241,7 +240,8 @@ Blockly.Workspace.prototype.updateVariableStore = function(clear) {
|
||||
* @param {?Blockly.VariableModel} variable Variable to rename.
|
||||
* @param {string} newName New variable name.
|
||||
*/
|
||||
Blockly.Workspace.prototype.renameVariableInternal_ = function(variable, newName) {
|
||||
Blockly.Workspace.prototype.renameVariableInternal_ = function(
|
||||
variable, newName) {
|
||||
var newVariable = this.getVariable(newName);
|
||||
var oldCase;
|
||||
|
||||
@@ -285,8 +285,8 @@ Blockly.Workspace.prototype.renameVariable = function(oldName, newName) {
|
||||
|
||||
/**
|
||||
* Rename a variable by updating its name in the variable map. Identify the
|
||||
* variable to rename with the given id.
|
||||
* @param {string} id Id of the variable to rename.
|
||||
* variable to rename with the given ID.
|
||||
* @param {string} id ID of the variable to rename.
|
||||
* @param {string} newName New variable name.
|
||||
*/
|
||||
Blockly.Workspace.prototype.renameVariableById = function(id, newName) {
|
||||
@@ -295,13 +295,13 @@ Blockly.Workspace.prototype.renameVariableById = function(id, newName) {
|
||||
};
|
||||
|
||||
/**
|
||||
* Create a variable with a given name, optional type, and optional id.
|
||||
* Create a variable with a given name, optional type, and optional ID.
|
||||
* @param {!string} name The name of the variable. This must be unique across
|
||||
* variables and procedures.
|
||||
* @param {?string} opt_type The type of the variable like 'int' or 'string'.
|
||||
* @param {string=} opt_type The type of the variable like 'int' or 'string'.
|
||||
* Does not need to be unique. Field_variable can filter variables based on
|
||||
* their type. This will default to '' which is a specific type.
|
||||
* @param {?string} opt_id The unique id of the variable. This will default to
|
||||
* @param {string=} opt_id The unique ID of the variable. This will default to
|
||||
* a UUID.
|
||||
* @return {?Blockly.VariableModel} The newly created variable.
|
||||
*/
|
||||
@@ -358,7 +358,8 @@ Blockly.Workspace.prototype.deleteVariable = function(name) {
|
||||
if (uses.length > 1) {
|
||||
// Confirm before deleting multiple blocks.
|
||||
Blockly.confirm(
|
||||
Blockly.Msg.DELETE_VARIABLE_CONFIRMATION.replace('%1', uses.length).
|
||||
Blockly.Msg.DELETE_VARIABLE_CONFIRMATION.replace('%1',
|
||||
String(uses.length)).
|
||||
replace('%2', name),
|
||||
function(ok) {
|
||||
if (ok) {
|
||||
@@ -372,23 +373,23 @@ Blockly.Workspace.prototype.deleteVariable = function(name) {
|
||||
};
|
||||
|
||||
/**
|
||||
* Delete a variables by the passed in id and all of its uses from this
|
||||
* Delete a variables by the passed in ID and all of its uses from this
|
||||
* workspace. May prompt the user for confirmation.
|
||||
* @param {string} id Id of variable to delete.
|
||||
* @param {string} id ID of variable to delete.
|
||||
*/
|
||||
Blockly.Workspace.prototype.deleteVariableById = function(id) {
|
||||
var variable = this.getVariableById(id);
|
||||
if (variable) {
|
||||
this.deleteVariableInternal_(variable);
|
||||
} else {
|
||||
console.warn("Can't delete non-existant variable: " + id);
|
||||
console.warn("Can't delete non-existent variable: " + id);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Deletes a variable and all of its uses from this workspace without asking the
|
||||
* user for confirmation.
|
||||
* @param {Blockly.VariableModel} variable Variable to delete.
|
||||
* @param {!Blockly.VariableModel} variable Variable to delete.
|
||||
* @private
|
||||
*/
|
||||
Blockly.Workspace.prototype.deleteVariableInternal_ = function(variable) {
|
||||
@@ -409,7 +410,10 @@ Blockly.Workspace.prototype.deleteVariableInternal_ = function(variable) {
|
||||
* not present.
|
||||
* @deprecated April 2017
|
||||
*/
|
||||
Blockly.Workspace.prototype.variableIndexOf = function(name) {
|
||||
|
||||
Blockly.Workspace.prototype.variableIndexOf = function(
|
||||
/* eslint-disable no-unused-vars */ name
|
||||
/* eslint-enable no-unused-vars */) {
|
||||
console.warn(
|
||||
'Deprecated call to Blockly.Workspace.prototype.variableIndexOf');
|
||||
return -1;
|
||||
@@ -426,10 +430,10 @@ Blockly.Workspace.prototype.getVariable = function(name) {
|
||||
};
|
||||
|
||||
/**
|
||||
* Find the variable by the given id and return it. Return null if it is not
|
||||
* Find the variable by the given ID and return it. Return null if it is not
|
||||
* found.
|
||||
* @param {!string} id The id to check for.
|
||||
* @return {?Blockly.VariableModel} The variable with the given id.
|
||||
* @param {!string} id The ID to check for.
|
||||
* @return {?Blockly.VariableModel} The variable with the given ID.
|
||||
*/
|
||||
Blockly.Workspace.prototype.getVariableById = function(id) {
|
||||
return this.variableMap_.getVariableById(id);
|
||||
@@ -450,7 +454,7 @@ Blockly.Workspace.prototype.getWidth = function() {
|
||||
* @param {?string} prototypeName Name of the language object containing
|
||||
* type-specific functions for this block.
|
||||
* @param {string=} opt_id Optional ID. Use this ID if provided, otherwise
|
||||
* create a new id.
|
||||
* create a new ID.
|
||||
* @return {!Blockly.Block} The created block.
|
||||
*/
|
||||
Blockly.Workspace.prototype.newBlock = function(prototypeName, opt_id) {
|
||||
@@ -496,8 +500,7 @@ Blockly.Workspace.prototype.undo = function(redo) {
|
||||
for (var i = 0, event; event = events[i]; i++) {
|
||||
event.run(redo);
|
||||
}
|
||||
}
|
||||
finally {
|
||||
} finally {
|
||||
Blockly.Events.recordUndo = true;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -27,10 +27,12 @@
|
||||
|
||||
goog.provide('Blockly.WorkspaceAudio');
|
||||
|
||||
|
||||
/**
|
||||
* Class for loading, storing, and playing audio for a workspace.
|
||||
* @param {Blockly.WorkspaceSvg} parentWorkspace The parent of the workspace
|
||||
* this audio object belongs to, or null.
|
||||
* @constructor
|
||||
*/
|
||||
Blockly.WorkspaceAudio = function(parentWorkspace) {
|
||||
|
||||
@@ -72,7 +74,6 @@ Blockly.WorkspaceAudio.prototype.dispose = function() {
|
||||
* preference (i.e. increasing size). E.g. ['media/go.mp3', 'media/go.wav']
|
||||
* Filenames include path from Blockly's root. File extensions matter.
|
||||
* @param {string} name Name of sound.
|
||||
* @package
|
||||
*/
|
||||
Blockly.WorkspaceAudio.prototype.load = function(filenames, name) {
|
||||
if (!filenames.length) {
|
||||
@@ -107,7 +108,7 @@ Blockly.WorkspaceAudio.prototype.load = function(filenames, name) {
|
||||
Blockly.WorkspaceAudio.prototype.preload = function() {
|
||||
for (var name in this.SOUNDS_) {
|
||||
var sound = this.SOUNDS_[name];
|
||||
sound.volume = .01;
|
||||
sound.volume = 0.01;
|
||||
sound.play();
|
||||
sound.pause();
|
||||
// iOS can only process one sound at a time. Trying to load more than one
|
||||
|
||||
@@ -93,7 +93,7 @@ Blockly.WorkspaceDragSurfaceSvg.prototype.createDom = function() {
|
||||
'xmlns:html': Blockly.HTML_NS,
|
||||
'xmlns:xlink': 'http://www.w3.org/1999/xlink',
|
||||
'version': '1.1',
|
||||
'class': 'blocklyWsDragSurface blocklyOverflowVisible',
|
||||
'class': 'blocklyWsDragSurface blocklyOverflowVisible'
|
||||
}, null);
|
||||
this.container_.appendChild(this.SVG_);
|
||||
};
|
||||
@@ -168,9 +168,9 @@ Blockly.WorkspaceDragSurfaceSvg.prototype.clearAndHide = function(newSurface) {
|
||||
* @param {!Element} blockCanvas The block canvas <g> element from the workspace.
|
||||
* @param {!Element} bubbleCanvas The <g> element that contains the bubbles.
|
||||
* @param {?Element} previousSibling The element to insert the block canvas &
|
||||
bubble canvas after when it goes back in the dom at the end of a drag.
|
||||
* @param {number} width The width of the workspace svg element.
|
||||
* @param {number} height The height of the workspace svg element.
|
||||
bubble canvas after when it goes back in the DOM at the end of a drag.
|
||||
* @param {number} width The width of the workspace SVG element.
|
||||
* @param {number} height The height of the workspace SVG element.
|
||||
* @param {number} scale The scale of the workspace being dragged.
|
||||
* @package
|
||||
*/
|
||||
|
||||
+20
-20
@@ -245,7 +245,7 @@ Blockly.WorkspaceSvg.prototype.lastRecordedPageScroll_ = null;
|
||||
/**
|
||||
* Map from function names to callbacks, for deciding what to do when a button
|
||||
* is clicked.
|
||||
* @type {!Object<string, function(!Blockly.FlyoutButton)>}
|
||||
* @type {!Object.<string, function(!Blockly.FlyoutButton)>}
|
||||
* @private
|
||||
*/
|
||||
Blockly.WorkspaceSvg.prototype.flyoutButtonCallbacks_ = {};
|
||||
@@ -253,7 +253,7 @@ Blockly.WorkspaceSvg.prototype.flyoutButtonCallbacks_ = {};
|
||||
/**
|
||||
* Map from function names to callbacks, for deciding what to do when a custom
|
||||
* toolbox category is opened.
|
||||
* @type {!Object<string, function(!Blockly.Workspace):!Array<!Element>>}
|
||||
* @type {!Object.<string, function(!Blockly.Workspace):!Array.<!Element>>}
|
||||
* @private
|
||||
*/
|
||||
Blockly.WorkspaceSvg.prototype.toolboxCategoryCallbacks_ = {};
|
||||
@@ -370,10 +370,10 @@ Blockly.WorkspaceSvg.prototype.createDom = function(opt_backgroundClass) {
|
||||
}
|
||||
/** @type {SVGElement} */
|
||||
this.svgBlockCanvas_ = Blockly.utils.createSvgElement('g',
|
||||
{'class': 'blocklyBlockCanvas'}, this.svgGroup_, this);
|
||||
{'class': 'blocklyBlockCanvas'}, this.svgGroup_);
|
||||
/** @type {SVGElement} */
|
||||
this.svgBubbleCanvas_ = Blockly.utils.createSvgElement('g',
|
||||
{'class': 'blocklyBubbleCanvas'}, this.svgGroup_, this);
|
||||
{'class': 'blocklyBubbleCanvas'}, this.svgGroup_);
|
||||
var bottom = Blockly.Scrollbar.scrollbarThickness;
|
||||
if (this.options.hasTrashcan) {
|
||||
bottom = this.addTrashcan_(bottom);
|
||||
@@ -516,7 +516,7 @@ Blockly.WorkspaceSvg.prototype.addZoomControls_ = function(bottom) {
|
||||
/**
|
||||
* Add a flyout element in an element with the given tag name.
|
||||
* @param {string} tagName What type of tag the flyout belongs in.
|
||||
* @return {!Element} The element containing the flyout dom.
|
||||
* @return {!Element} The element containing the flyout DOM.
|
||||
* @private
|
||||
*/
|
||||
Blockly.WorkspaceSvg.prototype.addFlyout_ = function(tagName) {
|
||||
@@ -623,8 +623,8 @@ Blockly.WorkspaceSvg.prototype.resize = function() {
|
||||
* scroll position.
|
||||
* @package
|
||||
*/
|
||||
Blockly.WorkspaceSvg.prototype.updateScreenCalculationsIfScrolled
|
||||
= function() {
|
||||
Blockly.WorkspaceSvg.prototype.updateScreenCalculationsIfScrolled =
|
||||
function() {
|
||||
/* eslint-disable indent */
|
||||
var currScroll = goog.dom.getDocumentScroll();
|
||||
if (!goog.math.Coordinate.equals(this.lastRecordedPageScroll_,
|
||||
@@ -652,7 +652,7 @@ Blockly.WorkspaceSvg.prototype.getBubbleCanvas = function() {
|
||||
|
||||
/**
|
||||
* Get the SVG element that contains this workspace.
|
||||
* @return {!Element} SVG element.
|
||||
* @return {Element} SVG element.
|
||||
*/
|
||||
Blockly.WorkspaceSvg.prototype.getParentSvg = function() {
|
||||
if (this.cachedParentSvg_) {
|
||||
@@ -691,7 +691,7 @@ Blockly.WorkspaceSvg.prototype.translate = function(x, y) {
|
||||
|
||||
/**
|
||||
* Called at the end of a workspace drag to take the contents
|
||||
* out of the drag surface and put them back into the workspace svg.
|
||||
* out of the drag surface and put them back into the workspace SVG.
|
||||
* Does nothing if the workspace drag surface is not enabled.
|
||||
* @package
|
||||
*/
|
||||
@@ -706,7 +706,7 @@ Blockly.WorkspaceSvg.prototype.resetDragSurface = function() {
|
||||
var trans = this.workspaceDragSurface_.getSurfaceTranslation();
|
||||
this.workspaceDragSurface_.clearAndHide(this.svgGroup_);
|
||||
var translation = 'translate(' + trans.x + ',' + trans.y + ') ' +
|
||||
'scale(' + this.scale + ')';
|
||||
'scale(' + this.scale + ')';
|
||||
this.svgBlockCanvas_.setAttribute('transform', translation);
|
||||
this.svgBubbleCanvas_.setAttribute('transform', translation);
|
||||
};
|
||||
@@ -737,8 +737,8 @@ Blockly.WorkspaceSvg.prototype.setupDragSurface = function() {
|
||||
// Figure out where we want to put the canvas back. The order
|
||||
// in the is important because things are layered.
|
||||
var previousElement = this.svgBlockCanvas_.previousSibling;
|
||||
var width = this.getParentSvg().getAttribute("width");
|
||||
var height = this.getParentSvg().getAttribute("height");
|
||||
var width = this.getParentSvg().getAttribute('width');
|
||||
var height = this.getParentSvg().getAttribute('height');
|
||||
var coord = Blockly.utils.getRelativeXY(this.svgBlockCanvas_);
|
||||
this.workspaceDragSurface_.setContentsAndShow(this.svgBlockCanvas_,
|
||||
this.svgBubbleCanvas_, previousElement, width, height, this.scale);
|
||||
@@ -933,7 +933,7 @@ Blockly.WorkspaceSvg.prototype.renameVariable = function(oldName, newName) {
|
||||
/**
|
||||
* Rename a variable by updating its name in the variable map. Update the
|
||||
* flyout to show the renamed variable immediately.
|
||||
* @param {string} id Id of the variable to rename.
|
||||
* @param {string} id ID of the variable to rename.
|
||||
* @param {string} newName New variable name.
|
||||
* @package
|
||||
*/
|
||||
@@ -954,9 +954,9 @@ Blockly.WorkspaceSvg.prototype.deleteVariable = function(name) {
|
||||
};
|
||||
|
||||
/**
|
||||
* Delete a variable by the passed in id. Update the flyout to show
|
||||
* Delete a variable by the passed in ID. Update the flyout to show
|
||||
* immediately that the variable is deleted.
|
||||
* @param {string} id Id of variable to delete.
|
||||
* @param {string} id ID of variable to delete.
|
||||
* @package
|
||||
*/
|
||||
Blockly.WorkspaceSvg.prototype.deleteVariableById = function(id) {
|
||||
@@ -971,7 +971,7 @@ Blockly.WorkspaceSvg.prototype.deleteVariableById = function(id) {
|
||||
* @param {string=} opt_type The type of the variable like 'int' or 'string'.
|
||||
* Does not need to be unique. Field_variable can filter variables based on
|
||||
* their type. This will default to '' which is a specific type.
|
||||
* @param {string=} opt_id The unique id of the variable. This will default to
|
||||
* @param {string=} opt_id The unique ID of the variable. This will default to
|
||||
* a UUID.
|
||||
* @return {?Blockly.VariableModel} The newly created variable.
|
||||
* @package
|
||||
@@ -1064,7 +1064,7 @@ Blockly.WorkspaceSvg.prototype.moveDrag = function(e) {
|
||||
* @return {boolean} True if currently dragging or scrolling.
|
||||
*/
|
||||
Blockly.WorkspaceSvg.prototype.isDragging = function() {
|
||||
return this.currentGesture_ && this.currentGesture_.isDragging();
|
||||
return this.currentGesture_ != null && this.currentGesture_.isDragging();
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -1357,7 +1357,7 @@ Blockly.WorkspaceSvg.prototype.setBrowserFocus = function() {
|
||||
try {
|
||||
// Focus the workspace SVG - this is for Chrome and Firefox.
|
||||
this.getParentSvg().focus();
|
||||
} catch (e) {
|
||||
} catch (e) {
|
||||
// IE and Edge do not support focus on SVG elements. When that fails
|
||||
// above, get the injectionDiv (the workspace's parent) and focus that
|
||||
// instead. This doesn't work in Chrome.
|
||||
@@ -1785,7 +1785,7 @@ Blockly.WorkspaceSvg.prototype.removeButtonCallback = function(key) {
|
||||
* custom toolbox categories in this workspace. See the variable and procedure
|
||||
* categories as an example.
|
||||
* @param {string} key The name to use to look up this function.
|
||||
* @param {function(!Blockly.Workspace):!Array<!Element>} func The function to
|
||||
* @param {function(!Blockly.Workspace):!Array.<!Element>} func The function to
|
||||
* call when the given toolbox category is opened.
|
||||
*/
|
||||
Blockly.WorkspaceSvg.prototype.registerToolboxCategoryCallback = function(key,
|
||||
@@ -1799,7 +1799,7 @@ Blockly.WorkspaceSvg.prototype.registerToolboxCategoryCallback = function(key,
|
||||
* Get the callback function associated with a given key, for populating
|
||||
* custom toolbox categories in this workspace.
|
||||
* @param {string} key The name to use to look up the function.
|
||||
* @return {?function(!Blockly.Workspace):!Array<!Element>} The function
|
||||
* @return {?function(!Blockly.Workspace):!Array.<!Element>} The function
|
||||
* corresponding to the given key for this workspace, or null if no function
|
||||
* is registered.
|
||||
*/
|
||||
|
||||
+45
-49
@@ -37,7 +37,7 @@ goog.require('goog.dom');
|
||||
/**
|
||||
* Encode a block tree as XML.
|
||||
* @param {!Blockly.Workspace} workspace The workspace containing blocks.
|
||||
* @param {boolean} opt_noId True if the encoder should skip the block ids.
|
||||
* @param {boolean=} opt_noId True if the encoder should skip the block IDs.
|
||||
* @return {!Element} XML document.
|
||||
*/
|
||||
Blockly.Xml.workspaceToDom = function(workspace, opt_noId) {
|
||||
@@ -70,7 +70,7 @@ Blockly.Xml.variablesToDom = function(variableList) {
|
||||
/**
|
||||
* Encode a block subtree as XML with XY coordinates.
|
||||
* @param {!Blockly.Block} block The root block to encode.
|
||||
* @param {boolean} opt_noId True if the encoder should skip the block id.
|
||||
* @param {boolean=} opt_noId True if the encoder should skip the block ID.
|
||||
* @return {!Element} Tree of XML elements.
|
||||
*/
|
||||
Blockly.Xml.blockToDomWithXY = function(block, opt_noId) {
|
||||
@@ -89,7 +89,7 @@ Blockly.Xml.blockToDomWithXY = function(block, opt_noId) {
|
||||
/**
|
||||
* Encode a block subtree as XML.
|
||||
* @param {!Blockly.Block} block The root block to encode.
|
||||
* @param {boolean} opt_noId True if the encoder should skip the block id.
|
||||
* @param {boolean=} opt_noId True if the encoder should skip the block ID.
|
||||
* @return {!Element} Tree of XML elements.
|
||||
*/
|
||||
Blockly.Xml.blockToDom = function(block, opt_noId) {
|
||||
@@ -113,7 +113,7 @@ Blockly.Xml.blockToDom = function(block, opt_noId) {
|
||||
var variable = block.workspace.getVariable(field.getValue());
|
||||
if (variable) {
|
||||
container.setAttribute('id', variable.getId());
|
||||
container.setAttribute('variableType', variable.type);
|
||||
container.setAttribute('variabletype', variable.type);
|
||||
}
|
||||
}
|
||||
element.appendChild(container);
|
||||
@@ -303,7 +303,7 @@ Blockly.Xml.textToDom = function(text) {
|
||||
* Decode an XML DOM and create blocks on the workspace.
|
||||
* @param {!Element} xml XML DOM.
|
||||
* @param {!Blockly.Workspace} workspace The workspace.
|
||||
* @return {Array.<string>} An array containing new block ids.
|
||||
* @return {Array.<string>} An array containing new block IDs.
|
||||
*/
|
||||
Blockly.Xml.domToWorkspace = function(xml, workspace) {
|
||||
if (xml instanceof Blockly.Workspace) {
|
||||
@@ -317,7 +317,7 @@ Blockly.Xml.domToWorkspace = function(xml, workspace) {
|
||||
if (workspace.RTL) {
|
||||
width = workspace.getWidth();
|
||||
}
|
||||
var newBlockIds = []; // A list of block ids added by this call.
|
||||
var newBlockIds = []; // A list of block IDs added by this call.
|
||||
Blockly.Field.startCache();
|
||||
// Safari 7.1.3 is known to provide node lists with extra references to
|
||||
// children beyond the lists' length. Trust the length, do not use the
|
||||
@@ -353,11 +353,10 @@ Blockly.Xml.domToWorkspace = function(xml, workspace) {
|
||||
} else if (name == 'shadow') {
|
||||
goog.asserts.fail('Shadow block cannot be a top-level block.');
|
||||
variablesFirst = false;
|
||||
} else if (name == 'variables') {
|
||||
} else if (name == 'variables') {
|
||||
if (variablesFirst) {
|
||||
Blockly.Xml.domToVariables(xmlChild, workspace);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
throw Error('\'variables\' tag must exist once before block and ' +
|
||||
'shadow tag elements in the workspace XML, but it was found in ' +
|
||||
'another location.');
|
||||
@@ -365,8 +364,7 @@ Blockly.Xml.domToWorkspace = function(xml, workspace) {
|
||||
variablesFirst = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
finally {
|
||||
} finally {
|
||||
if (!existingGroup) {
|
||||
Blockly.Events.setGroup(false);
|
||||
}
|
||||
@@ -385,12 +383,12 @@ Blockly.Xml.domToWorkspace = function(xml, workspace) {
|
||||
* blocks immediately below prior blocks, aligned by their starting edge.
|
||||
* @param {!Element} xml The XML DOM.
|
||||
* @param {!Blockly.Workspace} workspace The workspace to add to.
|
||||
* @return {Array.<string>} An array containing new block ids.
|
||||
* @return {Array.<string>} An array containing new block IDs.
|
||||
*/
|
||||
Blockly.Xml.appendDomToWorkspace = function(xml, workspace) {
|
||||
var bbox; //bounding box of the current blocks
|
||||
// first check if we have a workspaceSvg otherwise the block have no shape
|
||||
// and the position does not matter
|
||||
var bbox; // Bounding box of the current blocks.
|
||||
// First check if we have a workspaceSvg, otherwise the blocks have no shape
|
||||
// and the position does not matter.
|
||||
if (workspace.hasOwnProperty('scale')) {
|
||||
var savetab = Blockly.BlockSvg.TAB_WIDTH;
|
||||
try {
|
||||
@@ -400,22 +398,22 @@ Blockly.Xml.appendDomToWorkspace = function(xml, workspace) {
|
||||
Blockly.BlockSvg.TAB_WIDTH = savetab;
|
||||
}
|
||||
}
|
||||
// load the new blocks into the workspace and get the ids of the new blocks
|
||||
// Load the new blocks into the workspace and get the IDs of the new blocks.
|
||||
var newBlockIds = Blockly.Xml.domToWorkspace(xml,workspace);
|
||||
if (bbox && bbox.height) { // check if any previous block
|
||||
var offsetY = 0; // offset to add to y of the new block
|
||||
if (bbox && bbox.height) { // check if any previous block
|
||||
var offsetY = 0; // offset to add to y of the new block
|
||||
var offsetX = 0;
|
||||
var farY = bbox.y + bbox.height; //bottom position
|
||||
var topX = bbox.x; // x of bounding box
|
||||
// check position of the new blocks
|
||||
var newX = Infinity; // x of top corner
|
||||
var newY = Infinity; // y of top corner
|
||||
var farY = bbox.y + bbox.height; // bottom position
|
||||
var topX = bbox.x; // x of bounding box
|
||||
// Check position of the new blocks.
|
||||
var newX = Infinity; // x of top corner
|
||||
var newY = Infinity; // y of top corner
|
||||
for (var i = 0; i < newBlockIds.length; i++) {
|
||||
var blockXY = workspace.getBlockById(newBlockIds[i]).getRelativeToSurfaceXY();
|
||||
if (blockXY.y < newY) {
|
||||
newY = blockXY.y;
|
||||
}
|
||||
if (blockXY.x < newX) { //if we align also on x
|
||||
if (blockXY.x < newX) { // if we align also on x
|
||||
newX = blockXY.x;
|
||||
}
|
||||
}
|
||||
@@ -498,7 +496,7 @@ Blockly.Xml.domToVariables = function(xmlVariables, workspace) {
|
||||
var id = xmlChild.getAttribute('id');
|
||||
var name = xmlChild.textContent;
|
||||
|
||||
if (typeof(type) === undefined || type === null) {
|
||||
if (type == null) {
|
||||
throw Error('Variable with id, ' + id + ' is without a type');
|
||||
}
|
||||
workspace.createVariable(name, type, id);
|
||||
@@ -530,21 +528,21 @@ Blockly.Xml.domToBlockHeadless_ = function(xmlBlock, workspace) {
|
||||
var input;
|
||||
|
||||
// Find any enclosed blocks or shadows in this tag.
|
||||
var childBlockNode = null;
|
||||
var childShadowNode = null;
|
||||
var childBlockElement = null;
|
||||
var childShadowElement = null;
|
||||
for (var j = 0, grandchildNode; grandchildNode = xmlChild.childNodes[j];
|
||||
j++) {
|
||||
if (grandchildNode.nodeType == 1) {
|
||||
if (grandchildNode.nodeName.toLowerCase() == 'block') {
|
||||
childBlockNode = grandchildNode;
|
||||
childBlockElement = /** @type {!Element} */ (grandchildNode);
|
||||
} else if (grandchildNode.nodeName.toLowerCase() == 'shadow') {
|
||||
childShadowNode = grandchildNode;
|
||||
childShadowElement = /** @type {!Element} */ (grandchildNode);
|
||||
}
|
||||
}
|
||||
}
|
||||
// Use the shadow block if there is no child block.
|
||||
if (!childBlockNode && childShadowNode) {
|
||||
childBlockNode = childShadowNode;
|
||||
if (!childBlockElement && childShadowElement) {
|
||||
childBlockElement = childShadowElement;
|
||||
}
|
||||
|
||||
var name = xmlChild.getAttribute('name');
|
||||
@@ -589,21 +587,19 @@ Blockly.Xml.domToBlockHeadless_ = function(xmlBlock, workspace) {
|
||||
var text = xmlChild.textContent;
|
||||
if (field instanceof Blockly.FieldVariable) {
|
||||
// TODO (marisaleung): When we change setValue and getValue to
|
||||
// interact with id's instead of names, update this so that we get
|
||||
// the variable based on id instead of textContent.
|
||||
var type = xmlChild.getAttribute('variableType') || '';
|
||||
// interact with IDs instead of names, update this so that we get
|
||||
// the variable based on ID instead of textContent.
|
||||
var type = xmlChild.getAttribute('variabletype') || '';
|
||||
var variable = workspace.getVariable(text);
|
||||
if (!variable) {
|
||||
variable = workspace.createVariable(text, type,
|
||||
xmlChild.getAttribute(id));
|
||||
}
|
||||
if (typeof(type) !== undefined && type !== null) {
|
||||
if (type !== variable.type) {
|
||||
throw Error('Serialized variable type with id \'' +
|
||||
variable.getId() + '\' had type ' + variable.type + ', and ' +
|
||||
'does not match variable field that references it: ' +
|
||||
Blockly.Xml.domToText(xmlChild) + '.');
|
||||
}
|
||||
if (type != null && type !== variable.type) {
|
||||
throw Error('Serialized variable type with id \'' +
|
||||
variable.getId() + '\' had type ' + variable.type + ', and ' +
|
||||
'does not match variable field that references it: ' +
|
||||
Blockly.Xml.domToText(xmlChild) + '.');
|
||||
}
|
||||
}
|
||||
if (!field) {
|
||||
@@ -621,11 +617,11 @@ Blockly.Xml.domToBlockHeadless_ = function(xmlBlock, workspace) {
|
||||
prototypeName);
|
||||
break;
|
||||
}
|
||||
if (childShadowNode) {
|
||||
input.connection.setShadowDom(childShadowNode);
|
||||
if (childShadowElement) {
|
||||
input.connection.setShadowDom(childShadowElement);
|
||||
}
|
||||
if (childBlockNode) {
|
||||
blockChild = Blockly.Xml.domToBlockHeadless_(childBlockNode,
|
||||
if (childBlockElement) {
|
||||
blockChild = Blockly.Xml.domToBlockHeadless_(childBlockElement,
|
||||
workspace);
|
||||
if (blockChild.outputConnection) {
|
||||
input.connection.connect(blockChild.outputConnection);
|
||||
@@ -638,16 +634,16 @@ Blockly.Xml.domToBlockHeadless_ = function(xmlBlock, workspace) {
|
||||
}
|
||||
break;
|
||||
case 'next':
|
||||
if (childShadowNode && block.nextConnection) {
|
||||
block.nextConnection.setShadowDom(childShadowNode);
|
||||
if (childShadowElement && block.nextConnection) {
|
||||
block.nextConnection.setShadowDom(childShadowElement);
|
||||
}
|
||||
if (childBlockNode) {
|
||||
if (childBlockElement) {
|
||||
goog.asserts.assert(block.nextConnection,
|
||||
'Next statement does not exist.');
|
||||
// If there is more than one XML 'next' tag.
|
||||
goog.asserts.assert(!block.nextConnection.isConnected(),
|
||||
'Next statement is already connected.');
|
||||
blockChild = Blockly.Xml.domToBlockHeadless_(childBlockNode,
|
||||
blockChild = Blockly.Xml.domToBlockHeadless_(childBlockElement,
|
||||
workspace);
|
||||
goog.asserts.assert(blockChild.previousConnection,
|
||||
'Next block does not have previous statement.');
|
||||
|
||||
+2
-2
@@ -72,10 +72,10 @@ Blockly.Dart.math_constrain=function(a){Blockly.Dart.definitions_.import_dart_ma
|
||||
Blockly.Dart.math_random_int=function(a){Blockly.Dart.definitions_.import_dart_math="import 'dart:math' as Math;";var b=Blockly.Dart.valueToCode(a,"FROM",Blockly.Dart.ORDER_NONE)||"0";a=Blockly.Dart.valueToCode(a,"TO",Blockly.Dart.ORDER_NONE)||"0";return[Blockly.Dart.provideFunction_("math_random_int",["int "+Blockly.Dart.FUNCTION_NAME_PLACEHOLDER_+"(num a, num b) {"," if (a > b) {"," // Swap a and b to ensure a is smaller."," num c = a;"," a = b;"," b = c;"," }"," return new Math.Random().nextInt(b - a + 1) + a;",
|
||||
"}"])+"("+b+", "+a+")",Blockly.Dart.ORDER_UNARY_POSTFIX]};Blockly.Dart.math_random_float=function(a){Blockly.Dart.definitions_.import_dart_math="import 'dart:math' as Math;";return["new Math.Random().nextDouble()",Blockly.Dart.ORDER_UNARY_POSTFIX]};Blockly.Dart.procedures={};
|
||||
Blockly.Dart.procedures_defreturn=function(a){var b=Blockly.Dart.variableDB_.getName(a.getFieldValue("NAME"),Blockly.Procedures.NAME_TYPE),c=Blockly.Dart.statementToCode(a,"STACK");if(Blockly.Dart.STATEMENT_PREFIX){var d=a.id.replace(/\$/g,"$$$$");c=Blockly.Dart.prefixLines(Blockly.Dart.STATEMENT_PREFIX.replace(/%1/g,"'"+d+"'"),Blockly.Dart.INDENT)+c}Blockly.Dart.INFINITE_LOOP_TRAP&&(c=Blockly.Dart.INFINITE_LOOP_TRAP.replace(/%1/g,"'"+a.id+"'")+c);(d=Blockly.Dart.valueToCode(a,"RETURN",Blockly.Dart.ORDER_NONE)||
|
||||
"")&&(d=" return "+d+";\n");for(var e=d?"dynamic":"void",f=[],g=0;g<a.arguments_.length;g++)f[g]=Blockly.Dart.variableDB_.getName(a.arguments_[g],Blockly.Variables.NAME_TYPE);c=e+" "+b+"("+f.join(", ")+") {\n"+c+d+"}";c=Blockly.Dart.scrub_(a,c);Blockly.Dart.definitions_["%"+b]=c;return null};Blockly.Dart.procedures_defnoreturn=Blockly.Dart.procedures_defreturn;
|
||||
"")&&(d=Blockly.Dart.INDENT+"return "+d+";\n");for(var e=d?"dynamic":"void",f=[],g=0;g<a.arguments_.length;g++)f[g]=Blockly.Dart.variableDB_.getName(a.arguments_[g],Blockly.Variables.NAME_TYPE);c=e+" "+b+"("+f.join(", ")+") {\n"+c+d+"}";c=Blockly.Dart.scrub_(a,c);Blockly.Dart.definitions_["%"+b]=c;return null};Blockly.Dart.procedures_defnoreturn=Blockly.Dart.procedures_defreturn;
|
||||
Blockly.Dart.procedures_callreturn=function(a){for(var b=Blockly.Dart.variableDB_.getName(a.getFieldValue("NAME"),Blockly.Procedures.NAME_TYPE),c=[],d=0;d<a.arguments_.length;d++)c[d]=Blockly.Dart.valueToCode(a,"ARG"+d,Blockly.Dart.ORDER_NONE)||"null";return[b+"("+c.join(", ")+")",Blockly.Dart.ORDER_UNARY_POSTFIX]};
|
||||
Blockly.Dart.procedures_callnoreturn=function(a){for(var b=Blockly.Dart.variableDB_.getName(a.getFieldValue("NAME"),Blockly.Procedures.NAME_TYPE),c=[],d=0;d<a.arguments_.length;d++)c[d]=Blockly.Dart.valueToCode(a,"ARG"+d,Blockly.Dart.ORDER_NONE)||"null";return b+"("+c.join(", ")+");\n"};
|
||||
Blockly.Dart.procedures_ifreturn=function(a){var b="if ("+(Blockly.Dart.valueToCode(a,"CONDITION",Blockly.Dart.ORDER_NONE)||"false")+") {\n";a.hasReturnValue_?(a=Blockly.Dart.valueToCode(a,"VALUE",Blockly.Dart.ORDER_NONE)||"null",b+=" return "+a+";\n"):b+=" return;\n";return b+"}\n"};Blockly.Dart.texts={};Blockly.Dart.addReservedWords("Html,Math");Blockly.Dart.text=function(a){return[Blockly.Dart.quote_(a.getFieldValue("TEXT")),Blockly.Dart.ORDER_ATOMIC]};
|
||||
Blockly.Dart.procedures_ifreturn=function(a){var b="if ("+(Blockly.Dart.valueToCode(a,"CONDITION",Blockly.Dart.ORDER_NONE)||"false")+") {\n";a.hasReturnValue_?(a=Blockly.Dart.valueToCode(a,"VALUE",Blockly.Dart.ORDER_NONE)||"null",b+=Blockly.Dart.INDENT+"return "+a+";\n"):b+=Blockly.Dart.INDENT+"return;\n";return b+"}\n"};Blockly.Dart.texts={};Blockly.Dart.addReservedWords("Html,Math");Blockly.Dart.text=function(a){return[Blockly.Dart.quote_(a.getFieldValue("TEXT")),Blockly.Dart.ORDER_ATOMIC]};
|
||||
Blockly.Dart.text_join=function(a){switch(a.itemCount_){case 0:return["''",Blockly.Dart.ORDER_ATOMIC];case 1:return[(Blockly.Dart.valueToCode(a,"ADD0",Blockly.Dart.ORDER_UNARY_POSTFIX)||"''")+".toString()",Blockly.Dart.ORDER_UNARY_POSTFIX];default:for(var b=Array(a.itemCount_),c=0;c<a.itemCount_;c++)b[c]=Blockly.Dart.valueToCode(a,"ADD"+c,Blockly.Dart.ORDER_NONE)||"''";a="["+b.join(",")+"].join()";return[a,Blockly.Dart.ORDER_UNARY_POSTFIX]}};
|
||||
Blockly.Dart.text_append=function(a){var b=Blockly.Dart.variableDB_.getName(a.getFieldValue("VAR"),Blockly.Variables.NAME_TYPE);a=Blockly.Dart.valueToCode(a,"TEXT",Blockly.Dart.ORDER_NONE)||"''";return b+" = ["+b+", "+a+"].join();\n"};Blockly.Dart.text_length=function(a){return[(Blockly.Dart.valueToCode(a,"VALUE",Blockly.Dart.ORDER_UNARY_POSTFIX)||"''")+".length",Blockly.Dart.ORDER_UNARY_POSTFIX]};
|
||||
Blockly.Dart.text_isEmpty=function(a){return[(Blockly.Dart.valueToCode(a,"VALUE",Blockly.Dart.ORDER_UNARY_POSTFIX)||"''")+".isEmpty",Blockly.Dart.ORDER_UNARY_POSTFIX]};
|
||||
|
||||
@@ -37,9 +37,9 @@ goog.require('goog.dom.xml');
|
||||
|
||||
|
||||
/**
|
||||
* Block Exporter Tools Class
|
||||
* @constructor
|
||||
*/
|
||||
* Block Exporter Tools Class
|
||||
* @constructor
|
||||
*/
|
||||
BlockExporterTools = function() {
|
||||
// Create container for hidden workspace.
|
||||
this.container = goog.dom.createDom('div', {
|
||||
|
||||
+4
-2
@@ -387,13 +387,15 @@ Code.init = function() {
|
||||
// TODO: Clean up the message files so this is done explicitly instead of
|
||||
// through this for-loop.
|
||||
for (var messageKey in MSG) {
|
||||
if (goog.string.startsWith(messageKey, 'cat')) {
|
||||
if (messageKey.indexOf('cat') == 0) {
|
||||
Blockly.Msg[messageKey.toUpperCase()] = MSG[messageKey];
|
||||
}
|
||||
}
|
||||
|
||||
// Construct the toolbox XML.
|
||||
// Construct the toolbox XML, replacing translated variable names.
|
||||
var toolboxText = document.getElementById('toolbox').outerHTML;
|
||||
toolboxText = toolboxText.replace(/(^|[^%]){(\w+)}/g,
|
||||
function(m, p1, p2) {return p1 + MSG[p2];});
|
||||
var toolboxXml = Blockly.Xml.textToDom(toolboxText);
|
||||
|
||||
Code.workspace = Blockly.inject('content_blocks',
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
/**
|
||||
* @fileoverview Main file (entry point) for the advanced compilation demo.
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
goog.provide('Demo');
|
||||
|
||||
// messages (in some language)
|
||||
goog.require('Blockly.Msg.en');
|
||||
// core
|
||||
goog.require('Blockly');
|
||||
// blocks
|
||||
goog.require('Blockly.Constants.Colour');
|
||||
goog.require('Blockly.Constants.Lists');
|
||||
goog.require('Blockly.Constants.Logic');
|
||||
goog.require('Blockly.Constants.Loops');
|
||||
goog.require('Blockly.Constants.Math');
|
||||
goog.require('Blockly.Blocks.procedures');
|
||||
goog.require('Blockly.Constants.Text');
|
||||
goog.require('Blockly.Constants.Variables');
|
||||
|
||||
|
||||
Demo.init = function() {
|
||||
Blockly.inject('blocklyDiv', {
|
||||
'media': '../../media/',
|
||||
'toolbox': document.getElementById('toolbox')
|
||||
});
|
||||
}
|
||||
|
||||
window.addEventListener('load', Demo.init);
|
||||
|
||||
+27
-28
@@ -2,7 +2,7 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Blockly Demo: Minimap </title>
|
||||
<title>Blockly Demo: Minimap</title>
|
||||
<script src="../../blockly_compressed.js"></script>
|
||||
<script src="../../blocks_compressed.js"></script>
|
||||
<script src="../../msg/js/en.js"></script>
|
||||
@@ -49,41 +49,40 @@
|
||||
</xml>
|
||||
|
||||
<script>
|
||||
// Inject master workspace.
|
||||
var masterWorkspace = Blockly.inject('masterDiv', {
|
||||
media: '../../media/',
|
||||
scrollbars: true,
|
||||
toolbox: document.getElementById('toolbox')
|
||||
});
|
||||
|
||||
// Inject master workspace.
|
||||
var masterWorkspace = Blockly.inject('masterDiv',{
|
||||
media: '../../media/',
|
||||
scrollbars: true,
|
||||
toolbox: document.getElementById('toolbox')
|
||||
});
|
||||
|
||||
// Inject workspace for minimap.
|
||||
var minimapWorkspace = Blockly.inject('mapDiv',
|
||||
{media: '../../media/',
|
||||
readOnly: true,
|
||||
zoom:
|
||||
{controls: false,
|
||||
wheel: true,
|
||||
startScale: 0.1, //you can change this accorting to your needs.
|
||||
maxScale: 0.1,
|
||||
minScale: 0.01
|
||||
}});
|
||||
|
||||
// Initilizing the minimap.
|
||||
Minimap.init(masterWorkspace,minimapWorkspace);
|
||||
// Inject workspace for minimap.
|
||||
var minimapWorkspace = Blockly.inject('mapDiv', {
|
||||
media: '../../media/',
|
||||
readOnly: true,
|
||||
zoom: {
|
||||
controls: false,
|
||||
wheel: true,
|
||||
startScale: 0.1, // Change this according to your needs.
|
||||
maxScale: 0.1,
|
||||
minScale: 0.01
|
||||
}
|
||||
});
|
||||
|
||||
// Initialize the minimap.
|
||||
Minimap.init(masterWorkspace,minimapWorkspace);
|
||||
</script>
|
||||
<style>
|
||||
.minimap{
|
||||
position:absolute;
|
||||
position: absolute;
|
||||
}
|
||||
.mapDragger{
|
||||
cursor: move;
|
||||
fill:rgb(0,0,255);
|
||||
stroke-width:0.5;
|
||||
stroke:rgb(0,0,0);
|
||||
fill-opacity:0.1;
|
||||
}
|
||||
fill: rgb(0,0,255);
|
||||
stroke-width: .5;
|
||||
stroke: rgb(0,0,0);
|
||||
fill-opacity: .1;
|
||||
}
|
||||
</style>
|
||||
|
||||
</body>
|
||||
|
||||
+135
-127
@@ -1,46 +1,46 @@
|
||||
/**
|
||||
* Blockly Demos: Code
|
||||
*
|
||||
* Copyright 2017 Google Inc.
|
||||
* https://developers.google.com/blockly/
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
* Blockly Demos: Minimap
|
||||
*
|
||||
* Copyright 2017 Google Inc.
|
||||
* https://developers.google.com/blockly/
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @fileoverview JavaScript for Blockly's Minimap demo.
|
||||
* @author karnpurohit@gmail.com (Karan Purohit)
|
||||
*/
|
||||
* @fileoverview JavaScript for Blockly's Minimap demo.
|
||||
* @author karnpurohit@gmail.com (Karan Purohit)
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* Creating a seperate namespace for minimap.
|
||||
*/
|
||||
* Creating a separate namespace for minimap.
|
||||
*/
|
||||
var Minimap = {};
|
||||
|
||||
/**
|
||||
* Initilize the workspace and minimap.
|
||||
* @param {Workspace} workspace The main workspace of the user.
|
||||
* @param {Workspace} minimap The workspace that will be used as a minimap.
|
||||
*/
|
||||
Minimap.init = function(workspace, minimap){
|
||||
* Initialize the workspace and minimap.
|
||||
* @param {!Workspace} workspace The main workspace of the user.
|
||||
* @param {!Workspace} minimap The workspace that will be used as a minimap.
|
||||
*/
|
||||
Minimap.init = function(workspace, minimap) {
|
||||
this.workspace = workspace;
|
||||
this.minimap = minimap;
|
||||
|
||||
//Adding scroll callback functionlity to vScroll and hScroll just for this demo.
|
||||
//IMPORTANT: This should be changed when there is proper UI event handling
|
||||
// api available and should be handled by workspace's event listeners.
|
||||
this.workspace.scrollbar.vScroll.setHandlePosition = function(newPosition){
|
||||
// Adding scroll callback functionality to vScroll and hScroll just for this demo.
|
||||
// IMPORTANT: This should be changed when there is proper UI event handling
|
||||
// API available and should be handled by workspace's event listeners.
|
||||
this.workspace.scrollbar.vScroll.setHandlePosition = function(newPosition) {
|
||||
this.handlePosition_ = newPosition;
|
||||
this.svgHandle_.setAttribute(this.positionAttribute_, this.handlePosition_);
|
||||
|
||||
@@ -55,7 +55,7 @@ Minimap.init = function(workspace, minimap){
|
||||
};
|
||||
|
||||
// Adding call back for horizontal scroll.
|
||||
this.workspace.scrollbar.hScroll.setHandlePosition = function(newPosition){
|
||||
this.workspace.scrollbar.hScroll.setHandlePosition = function(newPosition) {
|
||||
this.handlePosition_ = newPosition;
|
||||
this.svgHandle_.setAttribute(this.positionAttribute_, this.handlePosition_);
|
||||
|
||||
@@ -71,7 +71,7 @@ Minimap.init = function(workspace, minimap){
|
||||
|
||||
|
||||
// Required to stop a positive feedback loop when user clicks minimap
|
||||
// and the scroll changes, which inturn may change minimap.
|
||||
// and the scroll changes, which in turn may change minimap.
|
||||
this.disableScrollChange = false;
|
||||
|
||||
// Listen to events on the main workspace.
|
||||
@@ -95,9 +95,9 @@ Minimap.init = function(workspace, minimap){
|
||||
|
||||
// Creating a rectangle in the minimap that represents current view.
|
||||
Blockly.utils.createSvgElement('rect', {
|
||||
'width':100,
|
||||
'height':100,
|
||||
'class':'mapDragger'
|
||||
'width': 100,
|
||||
'height': 100,
|
||||
'class': 'mapDragger'
|
||||
}, this.svg);
|
||||
|
||||
// Rectangle in the minimap that represents current view.
|
||||
@@ -105,7 +105,7 @@ Minimap.init = function(workspace, minimap){
|
||||
|
||||
// Adding mouse events to the rectangle, to make it Draggable.
|
||||
// Using Blockly.bindEvent_ to attach mouse/touch listeners.
|
||||
Blockly.bindEvent_(this.mapDragger, "mousedown", null, Minimap.mousedown);
|
||||
Blockly.bindEvent_(this.mapDragger, 'mousedown', null, Minimap.mousedown);
|
||||
|
||||
//When the window change, we need to resize the minimap window.
|
||||
window.addEventListener('resize', Minimap.repositionMinimap);
|
||||
@@ -113,20 +113,22 @@ Minimap.init = function(workspace, minimap){
|
||||
// Mouse up event for the minimap.
|
||||
this.svg.addEventListener('mouseup', Minimap.updateMapDragger);
|
||||
|
||||
//Boolen to check whether I am dragging the surface or not.
|
||||
//Boolean to check whether I am dragging the surface or not.
|
||||
this.isDragging = false;
|
||||
};
|
||||
|
||||
Minimap.mousedown = function(e){
|
||||
Minimap.mousedown = function(e) {
|
||||
// Using Blockly.bindEvent_ to attach mouse/touch listeners.
|
||||
Minimap.mouseMoveBindData = Blockly.bindEvent_(document,"mousemove", null, Minimap.mousemove);
|
||||
Minimap.mouseUpBindData = Blockly.bindEvent_(document,"mouseup", null, Minimap.mouseup);
|
||||
Minimap.mouseMoveBindData =
|
||||
Blockly.bindEvent_(document, 'mousemove', null, Minimap.mousemove);
|
||||
Minimap.mouseUpBindData =
|
||||
Blockly.bindEvent_(document, 'mouseup', null, Minimap.mouseup);
|
||||
|
||||
Minimap.isDragging=true;
|
||||
Minimap.isDragging = true;
|
||||
e.stopPropagation();
|
||||
};
|
||||
|
||||
Minimap.mouseup = function(e){
|
||||
Minimap.mouseup = function(e) {
|
||||
Minimap.isDragging = false;
|
||||
// Removing listeners.
|
||||
Blockly.unbindEvent_(Minimap.mouseUpBindData);
|
||||
@@ -135,18 +137,18 @@ Minimap.mouseup = function(e){
|
||||
e.stopPropagation();
|
||||
};
|
||||
|
||||
Minimap.mousemove = function(e){
|
||||
if(Minimap.isDragging){
|
||||
Minimap.mousemove = function(e) {
|
||||
if (Minimap.isDragging) {
|
||||
Minimap.updateMapDragger(e);
|
||||
e.stopPropagation();
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Initilize the workspace and minimap.
|
||||
* @param {Event} event Event that triggered in the main workspace.
|
||||
*/
|
||||
Minimap.mirrorEvent = function(event){
|
||||
* Run non-UI events from the main workspace on the minimap.
|
||||
* @param {!Event} event Event that triggered in the main workspace.
|
||||
*/
|
||||
Minimap.mirrorEvent = function(event) {
|
||||
if (event.type == Blockly.Events.UI) {
|
||||
return; // Don't mirror UI events.
|
||||
}
|
||||
@@ -161,146 +163,152 @@ Minimap.mirrorEvent = function(event){
|
||||
};
|
||||
|
||||
/**
|
||||
* Called when window is resized. Repositions the minimap overlay.
|
||||
*/
|
||||
Minimap.repositionMinimap = function(){
|
||||
* Called when window is resized. Repositions the minimap overlay.
|
||||
*/
|
||||
Minimap.repositionMinimap = function() {
|
||||
Minimap.rect = document.getElementById('mapDiv').getBoundingClientRect();
|
||||
Minimap.svg.style.top = Minimap.rect.top + 'px';
|
||||
Minimap.svg.style.left = Minimap.rect.left + 'px';
|
||||
};
|
||||
|
||||
/**
|
||||
* Updates the rectangle's height .
|
||||
*/
|
||||
Minimap.setDraggerHeight = function(){
|
||||
* Updates the rectangle's height.
|
||||
*/
|
||||
Minimap.setDraggerHeight = function() {
|
||||
var workspaceMetrics = Minimap.workspace.getMetrics();
|
||||
var draggerHeight = (workspaceMetrics.viewHeight / Minimap.workspace.scale) * Minimap.minimap.scale;
|
||||
var draggerHeight = (workspaceMetrics.viewHeight / Minimap.workspace.scale) *
|
||||
Minimap.minimap.scale;
|
||||
// It's zero when first block is placed.
|
||||
if(draggerHeight == 0){
|
||||
if (draggerHeight == 0) {
|
||||
return;
|
||||
}
|
||||
Minimap.mapDragger.setAttribute("height", draggerHeight);
|
||||
Minimap.mapDragger.setAttribute('height', draggerHeight);
|
||||
};
|
||||
|
||||
/**
|
||||
* Updates the rectangle's width.
|
||||
*/
|
||||
Minimap.setDraggerWidth = function(){
|
||||
* Updates the rectangle's width.
|
||||
*/
|
||||
Minimap.setDraggerWidth = function() {
|
||||
var workspaceMetrics = Minimap.workspace.getMetrics();
|
||||
var draggerWidth = (workspaceMetrics.viewWidth / Minimap.workspace.scale) * Minimap.minimap.scale;
|
||||
var draggerWidth = (workspaceMetrics.viewWidth / Minimap.workspace.scale) *
|
||||
Minimap.minimap.scale;
|
||||
// It's zero when first block is placed.
|
||||
if(draggerWidth == 0){
|
||||
if (draggerWidth == 0) {
|
||||
return;
|
||||
}
|
||||
Minimap.mapDragger.setAttribute("width", draggerWidth);
|
||||
Minimap.mapDragger.setAttribute('width', draggerWidth);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Updates the overall position of the viewport of the minimap by appropriately
|
||||
* using translate functions.
|
||||
*/
|
||||
Minimap.scaleMinimap = function(){
|
||||
* Updates the overall position of the viewport of the minimap by appropriately
|
||||
* using translate functions.
|
||||
*/
|
||||
Minimap.scaleMinimap = function() {
|
||||
var minimapBoundingBox = Minimap.minimap.getBlocksBoundingBox();
|
||||
var workspaceBoundingBox = Minimap.workspace.getBlocksBoundingBox();
|
||||
var workspaceMetrics = Minimap.workspace.getMetrics();
|
||||
var minimapMetrics = Minimap.minimap.getMetrics();
|
||||
|
||||
//Scaling the mimimap such that all the blocks can be seen in the viewport.
|
||||
//This padding is default because this is how to scrollbar(in main workspace) is implemented.
|
||||
var topPadding = (workspaceMetrics.viewHeight) * Minimap.minimap.scale / (2 * Minimap.workspace.scale);
|
||||
var sidePadding = (workspaceMetrics.viewWidth) * Minimap.minimap.scale / (2 * Minimap.workspace.scale);
|
||||
// Scaling the mimimap such that all the blocks can be seen in the viewport.
|
||||
// This padding is default because this is how to scrollbar(in main workspace)
|
||||
// is implemented.
|
||||
var topPadding = (workspaceMetrics.viewHeight) * Minimap.minimap.scale /
|
||||
(2 * Minimap.workspace.scale);
|
||||
var sidePadding = (workspaceMetrics.viewWidth) * Minimap.minimap.scale /
|
||||
(2 * Minimap.workspace.scale);
|
||||
|
||||
// If actual padding is more than half view ports height, change it to actual padding.
|
||||
if((workspaceBoundingBox.y * Minimap.workspace.scale - workspaceMetrics.contentTop)
|
||||
* Minimap.minimap.scale / Minimap.workspace.scale > topPadding){
|
||||
topPadding = (workspaceBoundingBox.y * Minimap.workspace.scale - workspaceMetrics.contentTop)
|
||||
* Minimap.minimap.scale / Minimap.workspace.scale;
|
||||
// If actual padding is more than half view ports height,
|
||||
// change it to actual padding.
|
||||
if ((workspaceBoundingBox.y * Minimap.workspace.scale -
|
||||
workspaceMetrics.contentTop) *
|
||||
Minimap.minimap.scale / Minimap.workspace.scale > topPadding) {
|
||||
topPadding = (workspaceBoundingBox.y * Minimap.workspace.scale -
|
||||
workspaceMetrics.contentTop) *
|
||||
Minimap.minimap.scale / Minimap.workspace.scale;
|
||||
}
|
||||
|
||||
// If actual padding is more than half view ports height, change it to actual padding.
|
||||
if((workspaceBoundingBox.x * Minimap.workspace.scale - workspaceMetrics.contentLeft)
|
||||
* Minimap.minimap.scale / Minimap.workspace.scale > sidePadding){
|
||||
sidePadding = (workspaceBoundingBox.x * Minimap.workspace.scale - workspaceMetrics.contentLeft)
|
||||
* Minimap.minimap.scale / Minimap.workspace.scale;
|
||||
// If actual padding is more than half view ports height,
|
||||
// change it to actual padding.
|
||||
if ((workspaceBoundingBox.x * Minimap.workspace.scale -
|
||||
workspaceMetrics.contentLeft) *
|
||||
Minimap.minimap.scale / Minimap.workspace.scale > sidePadding) {
|
||||
sidePadding = (workspaceBoundingBox.x * Minimap.workspace.scale -
|
||||
workspaceMetrics.contentLeft) *
|
||||
Minimap.minimap.scale / Minimap.workspace.scale;
|
||||
}
|
||||
|
||||
var scalex = (minimapMetrics.viewWidth - 2 * sidePadding) / minimapBoundingBox.width;
|
||||
var scaley = (minimapMetrics.viewHeight - 2 * topPadding) / minimapBoundingBox.height;
|
||||
var scalex = (minimapMetrics.viewWidth - 2 * sidePadding) /
|
||||
minimapBoundingBox.width;
|
||||
var scaley = (minimapMetrics.viewHeight - 2 * topPadding) /
|
||||
minimapBoundingBox.height;
|
||||
Minimap.minimap.setScale(Math.min(scalex, scaley));
|
||||
|
||||
// Translating the minimap.
|
||||
Minimap.minimap.translate( - minimapMetrics.contentLeft * Minimap.minimap.scale + sidePadding,
|
||||
- minimapMetrics.contentTop * Minimap.minimap.scale + topPadding);
|
||||
Minimap.minimap.translate(
|
||||
-minimapMetrics.contentLeft * Minimap.minimap.scale + sidePadding,
|
||||
-minimapMetrics.contentTop * Minimap.minimap.scale + topPadding);
|
||||
};
|
||||
|
||||
/**
|
||||
* Handles the onclick event on the minimapBoundingBox. Changes mapDraggers position.
|
||||
* @param {Event} e Event from the mouse click.
|
||||
*/
|
||||
Minimap.updateMapDragger = function(e){
|
||||
* Handles the onclick event on the minimapBoundingBox.
|
||||
* Changes mapDraggers position.
|
||||
* @param {!Event} e Event from the mouse click.
|
||||
*/
|
||||
Minimap.updateMapDragger = function(e) {
|
||||
var y = e.clientY;
|
||||
var x = e.clientX;
|
||||
var draggerHeight = Minimap.mapDragger.getAttribute("height");
|
||||
var draggerWidth = Minimap.mapDragger.getAttribute("width");
|
||||
var draggerHeight = Minimap.mapDragger.getAttribute('height');
|
||||
var draggerWidth = Minimap.mapDragger.getAttribute('width');
|
||||
|
||||
var finalY = y - Minimap.rect.top - draggerHeight / 2;
|
||||
var finalX = x - Minimap.rect.left - draggerWidth / 2;
|
||||
|
||||
var maxValidY = (Minimap.workspace.getMetrics().contentHeight - Minimap.workspace.getMetrics().viewHeight)
|
||||
* Minimap.minimap.scale;
|
||||
var maxValidX = (Minimap.workspace.getMetrics().contentWidth - Minimap.workspace.getMetrics().viewWidth)
|
||||
* Minimap.minimap.scale;
|
||||
var maxValidY = (Minimap.workspace.getMetrics().contentHeight -
|
||||
Minimap.workspace.getMetrics().viewHeight) * Minimap.minimap.scale;
|
||||
var maxValidX = (Minimap.workspace.getMetrics().contentWidth -
|
||||
Minimap.workspace.getMetrics().viewWidth) * Minimap.minimap.scale;
|
||||
|
||||
if(y + draggerHeight / 2 > Minimap.rect.bottom){
|
||||
if (y + draggerHeight / 2 > Minimap.rect.bottom) {
|
||||
finalY = Minimap.rect.bottom - Minimap.rect.top - draggerHeight;
|
||||
}else if(y < Minimap.rect.top + draggerHeight / 2){
|
||||
} else if (y < Minimap.rect.top + draggerHeight / 2) {
|
||||
finalY = 0;
|
||||
}
|
||||
|
||||
if(x + draggerWidth / 2 > Minimap.rect.right){
|
||||
if (x + draggerWidth / 2 > Minimap.rect.right) {
|
||||
finalX = Minimap.rect.right - Minimap.rect.left - draggerWidth;
|
||||
}else if(x < Minimap.rect.left + draggerWidth / 2){
|
||||
} else if (x < Minimap.rect.left + draggerWidth / 2) {
|
||||
finalX = 0;
|
||||
}
|
||||
|
||||
// Do not go below lower bound of scrollbar.
|
||||
if(finalY > maxValidY){
|
||||
if (finalY > maxValidY) {
|
||||
finalY = maxValidY;
|
||||
}
|
||||
|
||||
if(finalX > maxValidX){
|
||||
if (finalX > maxValidX) {
|
||||
finalX = maxValidX;
|
||||
}
|
||||
Minimap.mapDragger.setAttribute("y", finalY);
|
||||
Minimap.mapDragger.setAttribute("x", finalX);
|
||||
Minimap.mapDragger.setAttribute('y', finalY);
|
||||
Minimap.mapDragger.setAttribute('x', finalX);
|
||||
// Required, otherwise creates a feedback loop.
|
||||
Minimap.disableScrollChange = true;
|
||||
Minimap.workspace.scrollbar.vScroll.set((finalY * Minimap.workspace.scale) / Minimap.minimap.scale);
|
||||
Minimap.workspace.scrollbar.hScroll.set((finalX * Minimap.workspace.scale) / Minimap.minimap.scale);
|
||||
Minimap.workspace.scrollbar.vScroll.set((finalY * Minimap.workspace.scale) /
|
||||
Minimap.minimap.scale);
|
||||
Minimap.workspace.scrollbar.hScroll.set((finalX * Minimap.workspace.scale) /
|
||||
Minimap.minimap.scale);
|
||||
Minimap.disableScrollChange = false;
|
||||
};
|
||||
|
||||
/**
|
||||
* Handles the onclick event on the minimapBoundingBox, paramaters are passed by
|
||||
* the event handler.
|
||||
* @param {Float} position This is the absolute postion of the scrollbar.
|
||||
* @param {boolean} horizontal Informs if the change event if for horizontal(true)
|
||||
* scrollbar or vertical(false) scrollbar.
|
||||
*/
|
||||
Minimap.onScrollChange = function(position, horizontal){
|
||||
|
||||
if(Minimap.disableScrollChange){
|
||||
return;
|
||||
}
|
||||
|
||||
var newDraggerPosition = (position * Minimap.minimap.scale / Minimap.workspace.scale);
|
||||
if(horizontal){
|
||||
// Change the horizontal position of dragger.
|
||||
Minimap.mapDragger.setAttribute("x", newDraggerPosition);
|
||||
}
|
||||
else{
|
||||
// Change the vertical position of dragger.
|
||||
Minimap.mapDragger.setAttribute("y", newDraggerPosition);
|
||||
* Handles the onclick event on the minimapBoundingBox, parameters are passed by
|
||||
* the event handler.
|
||||
* @param {number} position This is the absolute position of the scrollbar.
|
||||
* @param {boolean} horizontal Informs if the change event if for
|
||||
* horizontal (true) or vertical (false) scrollbar.
|
||||
*/
|
||||
Minimap.onScrollChange = function(position, horizontal) {
|
||||
if (!Minimap.disableScrollChange) {
|
||||
Minimap.mapDragger.setAttribute(horizontal ? 'x' : 'y',
|
||||
position * Minimap.minimap.scale / Minimap.workspace.scale);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -47,7 +47,7 @@ Blockly.Dart['procedures_defreturn'] = function(block) {
|
||||
var returnValue = Blockly.Dart.valueToCode(block, 'RETURN',
|
||||
Blockly.Dart.ORDER_NONE) || '';
|
||||
if (returnValue) {
|
||||
returnValue = ' return ' + returnValue + ';\n';
|
||||
returnValue = Blockly.Dart.INDENT + 'return ' + returnValue + ';\n';
|
||||
}
|
||||
var returnType = returnValue ? 'dynamic' : 'void';
|
||||
var args = [];
|
||||
@@ -101,9 +101,9 @@ Blockly.Dart['procedures_ifreturn'] = function(block) {
|
||||
if (block.hasReturnValue_) {
|
||||
var value = Blockly.Dart.valueToCode(block, 'VALUE',
|
||||
Blockly.Dart.ORDER_NONE) || 'null';
|
||||
code += ' return ' + value + ';\n';
|
||||
code += Blockly.Dart.INDENT + 'return ' + value + ';\n';
|
||||
} else {
|
||||
code += ' return;\n';
|
||||
code += Blockly.Dart.INDENT + 'return;\n';
|
||||
}
|
||||
code += '}\n';
|
||||
return code;
|
||||
|
||||
@@ -47,7 +47,7 @@ Blockly.JavaScript['procedures_defreturn'] = function(block) {
|
||||
var returnValue = Blockly.JavaScript.valueToCode(block, 'RETURN',
|
||||
Blockly.JavaScript.ORDER_NONE) || '';
|
||||
if (returnValue) {
|
||||
returnValue = ' return ' + returnValue + ';\n';
|
||||
returnValue = Blockly.JavaScript.INDENT + 'return ' + returnValue + ';\n';
|
||||
}
|
||||
var args = [];
|
||||
for (var i = 0; i < block.arguments_.length; i++) {
|
||||
@@ -101,9 +101,9 @@ Blockly.JavaScript['procedures_ifreturn'] = function(block) {
|
||||
if (block.hasReturnValue_) {
|
||||
var value = Blockly.JavaScript.valueToCode(block, 'VALUE',
|
||||
Blockly.JavaScript.ORDER_NONE) || 'null';
|
||||
code += ' return ' + value + ';\n';
|
||||
code += Blockly.JavaScript.INDENT + 'return ' + value + ';\n';
|
||||
} else {
|
||||
code += ' return;\n';
|
||||
code += Blockly.JavaScript.INDENT + 'return;\n';
|
||||
}
|
||||
code += '}\n';
|
||||
return code;
|
||||
|
||||
@@ -47,7 +47,7 @@ Blockly.Lua['procedures_defreturn'] = function(block) {
|
||||
var returnValue = Blockly.Lua.valueToCode(block, 'RETURN',
|
||||
Blockly.Lua.ORDER_NONE) || '';
|
||||
if (returnValue) {
|
||||
returnValue = ' return ' + returnValue + '\n';
|
||||
returnValue = Blockly.Lua.INDENT + 'return ' + returnValue + '\n';
|
||||
} else if (!branch) {
|
||||
branch = '';
|
||||
}
|
||||
@@ -103,9 +103,9 @@ Blockly.Lua['procedures_ifreturn'] = function(block) {
|
||||
if (block.hasReturnValue_) {
|
||||
var value = Blockly.Lua.valueToCode(block, 'VALUE',
|
||||
Blockly.Lua.ORDER_NONE) || 'nil';
|
||||
code += ' return ' + value + '\n';
|
||||
code += Blockly.Lua.INDENT + 'return ' + value + '\n';
|
||||
} else {
|
||||
code += ' return\n';
|
||||
code += Blockly.Lua.INDENT + 'return\n';
|
||||
}
|
||||
code += 'end\n';
|
||||
return code;
|
||||
|
||||
@@ -43,7 +43,7 @@ Blockly.PHP['procedures_defreturn'] = function(block) {
|
||||
Blockly.Variables.NAME_TYPE));
|
||||
}
|
||||
}
|
||||
globals = globals.length ? ' global ' + globals.join(', ') + ';\n' : '';
|
||||
globals = globals.length ? Blockly.PHP.INDENT + 'global ' + globals.join(', ') + ';\n' : '';
|
||||
|
||||
var funcName = Blockly.PHP.variableDB_.getName(
|
||||
block.getFieldValue('NAME'), Blockly.Procedures.NAME_TYPE);
|
||||
@@ -61,7 +61,7 @@ Blockly.PHP['procedures_defreturn'] = function(block) {
|
||||
var returnValue = Blockly.PHP.valueToCode(block, 'RETURN',
|
||||
Blockly.PHP.ORDER_NONE) || '';
|
||||
if (returnValue) {
|
||||
returnValue = ' return ' + returnValue + ';\n';
|
||||
returnValue = Blockly.PHP.INDENT + 'return ' + returnValue + ';\n';
|
||||
}
|
||||
var args = [];
|
||||
for (var i = 0; i < block.arguments_.length; i++) {
|
||||
@@ -115,9 +115,9 @@ Blockly.PHP['procedures_ifreturn'] = function(block) {
|
||||
if (block.hasReturnValue_) {
|
||||
var value = Blockly.PHP.valueToCode(block, 'VALUE',
|
||||
Blockly.PHP.ORDER_NONE) || 'null';
|
||||
code += ' return ' + value + ';\n';
|
||||
code += Blockly.PHP.INDENT + 'return ' + value + ';\n';
|
||||
} else {
|
||||
code += ' return;\n';
|
||||
code += Blockly.PHP.INDENT + 'return;\n';
|
||||
}
|
||||
code += '}\n';
|
||||
return code;
|
||||
|
||||
@@ -44,7 +44,7 @@ Blockly.Python['procedures_defreturn'] = function(block) {
|
||||
Blockly.Variables.NAME_TYPE));
|
||||
}
|
||||
}
|
||||
globals = globals.length ? ' global ' + globals.join(', ') + '\n' : '';
|
||||
globals = globals.length ? Blockly.Python.INDENT + 'global ' + globals.join(', ') + '\n' : '';
|
||||
var funcName = Blockly.Python.variableDB_.getName(block.getFieldValue('NAME'),
|
||||
Blockly.Procedures.NAME_TYPE);
|
||||
var branch = Blockly.Python.statementToCode(block, 'STACK');
|
||||
@@ -61,7 +61,7 @@ Blockly.Python['procedures_defreturn'] = function(block) {
|
||||
var returnValue = Blockly.Python.valueToCode(block, 'RETURN',
|
||||
Blockly.Python.ORDER_NONE) || '';
|
||||
if (returnValue) {
|
||||
returnValue = ' return ' + returnValue + '\n';
|
||||
returnValue = Blockly.Python.INDENT + 'return ' + returnValue + '\n';
|
||||
} else if (!branch) {
|
||||
branch = Blockly.Python.PASS;
|
||||
}
|
||||
@@ -117,9 +117,9 @@ Blockly.Python['procedures_ifreturn'] = function(block) {
|
||||
if (block.hasReturnValue_) {
|
||||
var value = Blockly.Python.valueToCode(block, 'VALUE',
|
||||
Blockly.Python.ORDER_NONE) || 'None';
|
||||
code += ' return ' + value + '\n';
|
||||
code += Blockly.Python.INDENT + 'return ' + value + '\n';
|
||||
} else {
|
||||
code += ' return\n';
|
||||
code += Blockly.Python.INDENT + 'return\n';
|
||||
}
|
||||
return code;
|
||||
};
|
||||
|
||||
@@ -70,10 +70,10 @@ Blockly.JavaScript.math_constrain=function(a){var b=Blockly.JavaScript.valueToCo
|
||||
Blockly.JavaScript.math_random_int=function(a){var b=Blockly.JavaScript.valueToCode(a,"FROM",Blockly.JavaScript.ORDER_COMMA)||"0";a=Blockly.JavaScript.valueToCode(a,"TO",Blockly.JavaScript.ORDER_COMMA)||"0";return[Blockly.JavaScript.provideFunction_("mathRandomInt",["function "+Blockly.JavaScript.FUNCTION_NAME_PLACEHOLDER_+"(a, b) {"," if (a > b) {"," // Swap a and b to ensure a is smaller."," var c = a;"," a = b;"," b = c;"," }"," return Math.floor(Math.random() * (b - a + 1) + a);",
|
||||
"}"])+"("+b+", "+a+")",Blockly.JavaScript.ORDER_FUNCTION_CALL]};Blockly.JavaScript.math_random_float=function(a){return["Math.random()",Blockly.JavaScript.ORDER_FUNCTION_CALL]};Blockly.JavaScript.procedures={};
|
||||
Blockly.JavaScript.procedures_defreturn=function(a){var b=Blockly.JavaScript.variableDB_.getName(a.getFieldValue("NAME"),Blockly.Procedures.NAME_TYPE),c=Blockly.JavaScript.statementToCode(a,"STACK");if(Blockly.JavaScript.STATEMENT_PREFIX){var d=a.id.replace(/\$/g,"$$$$");c=Blockly.JavaScript.prefixLines(Blockly.JavaScript.STATEMENT_PREFIX.replace(/%1/g,"'"+d+"'"),Blockly.JavaScript.INDENT)+c}Blockly.JavaScript.INFINITE_LOOP_TRAP&&(c=Blockly.JavaScript.INFINITE_LOOP_TRAP.replace(/%1/g,"'"+a.id+"'")+
|
||||
c);(d=Blockly.JavaScript.valueToCode(a,"RETURN",Blockly.JavaScript.ORDER_NONE)||"")&&(d=" return "+d+";\n");for(var e=[],f=0;f<a.arguments_.length;f++)e[f]=Blockly.JavaScript.variableDB_.getName(a.arguments_[f],Blockly.Variables.NAME_TYPE);c="function "+b+"("+e.join(", ")+") {\n"+c+d+"}";c=Blockly.JavaScript.scrub_(a,c);Blockly.JavaScript.definitions_["%"+b]=c;return null};Blockly.JavaScript.procedures_defnoreturn=Blockly.JavaScript.procedures_defreturn;
|
||||
c);(d=Blockly.JavaScript.valueToCode(a,"RETURN",Blockly.JavaScript.ORDER_NONE)||"")&&(d=Blockly.JavaScript.INDENT+"return "+d+";\n");for(var e=[],f=0;f<a.arguments_.length;f++)e[f]=Blockly.JavaScript.variableDB_.getName(a.arguments_[f],Blockly.Variables.NAME_TYPE);c="function "+b+"("+e.join(", ")+") {\n"+c+d+"}";c=Blockly.JavaScript.scrub_(a,c);Blockly.JavaScript.definitions_["%"+b]=c;return null};Blockly.JavaScript.procedures_defnoreturn=Blockly.JavaScript.procedures_defreturn;
|
||||
Blockly.JavaScript.procedures_callreturn=function(a){for(var b=Blockly.JavaScript.variableDB_.getName(a.getFieldValue("NAME"),Blockly.Procedures.NAME_TYPE),c=[],d=0;d<a.arguments_.length;d++)c[d]=Blockly.JavaScript.valueToCode(a,"ARG"+d,Blockly.JavaScript.ORDER_COMMA)||"null";return[b+"("+c.join(", ")+")",Blockly.JavaScript.ORDER_FUNCTION_CALL]};
|
||||
Blockly.JavaScript.procedures_callnoreturn=function(a){for(var b=Blockly.JavaScript.variableDB_.getName(a.getFieldValue("NAME"),Blockly.Procedures.NAME_TYPE),c=[],d=0;d<a.arguments_.length;d++)c[d]=Blockly.JavaScript.valueToCode(a,"ARG"+d,Blockly.JavaScript.ORDER_COMMA)||"null";return b+"("+c.join(", ")+");\n"};
|
||||
Blockly.JavaScript.procedures_ifreturn=function(a){var b="if ("+(Blockly.JavaScript.valueToCode(a,"CONDITION",Blockly.JavaScript.ORDER_NONE)||"false")+") {\n";a.hasReturnValue_?(a=Blockly.JavaScript.valueToCode(a,"VALUE",Blockly.JavaScript.ORDER_NONE)||"null",b+=" return "+a+";\n"):b+=" return;\n";return b+"}\n"};Blockly.JavaScript.texts={};Blockly.JavaScript.text=function(a){return[Blockly.JavaScript.quote_(a.getFieldValue("TEXT")),Blockly.JavaScript.ORDER_ATOMIC]};
|
||||
Blockly.JavaScript.procedures_ifreturn=function(a){var b="if ("+(Blockly.JavaScript.valueToCode(a,"CONDITION",Blockly.JavaScript.ORDER_NONE)||"false")+") {\n";a.hasReturnValue_?(a=Blockly.JavaScript.valueToCode(a,"VALUE",Blockly.JavaScript.ORDER_NONE)||"null",b+=Blockly.JavaScript.INDENT+"return "+a+";\n"):b+=Blockly.JavaScript.INDENT+"return;\n";return b+"}\n"};Blockly.JavaScript.texts={};Blockly.JavaScript.text=function(a){return[Blockly.JavaScript.quote_(a.getFieldValue("TEXT")),Blockly.JavaScript.ORDER_ATOMIC]};
|
||||
Blockly.JavaScript.text_join=function(a){switch(a.itemCount_){case 0:return["''",Blockly.JavaScript.ORDER_ATOMIC];case 1:return["String("+(Blockly.JavaScript.valueToCode(a,"ADD0",Blockly.JavaScript.ORDER_NONE)||"''")+")",Blockly.JavaScript.ORDER_FUNCTION_CALL];case 2:var b=Blockly.JavaScript.valueToCode(a,"ADD0",Blockly.JavaScript.ORDER_NONE)||"''";a=Blockly.JavaScript.valueToCode(a,"ADD1",Blockly.JavaScript.ORDER_NONE)||"''";return["String("+b+") + String("+a+")",Blockly.JavaScript.ORDER_ADDITION];
|
||||
default:b=Array(a.itemCount_);for(var c=0;c<a.itemCount_;c++)b[c]=Blockly.JavaScript.valueToCode(a,"ADD"+c,Blockly.JavaScript.ORDER_COMMA)||"''";a="["+b.join(",")+"].join('')";return[a,Blockly.JavaScript.ORDER_FUNCTION_CALL]}};Blockly.JavaScript.text_append=function(a){var b=Blockly.JavaScript.variableDB_.getName(a.getFieldValue("VAR"),Blockly.Variables.NAME_TYPE);a=Blockly.JavaScript.valueToCode(a,"TEXT",Blockly.JavaScript.ORDER_NONE)||"''";return b+" = String("+b+") + String("+a+");\n"};
|
||||
Blockly.JavaScript.text_length=function(a){return[(Blockly.JavaScript.valueToCode(a,"VALUE",Blockly.JavaScript.ORDER_FUNCTION_CALL)||"''")+".length",Blockly.JavaScript.ORDER_MEMBER]};Blockly.JavaScript.text_isEmpty=function(a){return["!"+(Blockly.JavaScript.valueToCode(a,"VALUE",Blockly.JavaScript.ORDER_MEMBER)||"''")+".length",Blockly.JavaScript.ORDER_LOGICAL_NOT]};
|
||||
|
||||
+2
-2
@@ -55,10 +55,10 @@ default:throw"Unknown operator: "+c;}return[c+"("+a+")",Blockly.Lua.ORDER_HIGH]}
|
||||
Blockly.Lua.math_constrain=function(a){var b=Blockly.Lua.valueToCode(a,"VALUE",Blockly.Lua.ORDER_NONE)||"0",c=Blockly.Lua.valueToCode(a,"LOW",Blockly.Lua.ORDER_NONE)||"-math.huge";a=Blockly.Lua.valueToCode(a,"HIGH",Blockly.Lua.ORDER_NONE)||"math.huge";return["math.min(math.max("+b+", "+c+"), "+a+")",Blockly.Lua.ORDER_HIGH]};
|
||||
Blockly.Lua.math_random_int=function(a){var b=Blockly.Lua.valueToCode(a,"FROM",Blockly.Lua.ORDER_NONE)||"0";a=Blockly.Lua.valueToCode(a,"TO",Blockly.Lua.ORDER_NONE)||"0";return["math.random("+b+", "+a+")",Blockly.Lua.ORDER_HIGH]};Blockly.Lua.math_random_float=function(a){return["math.random()",Blockly.Lua.ORDER_HIGH]};Blockly.Lua.procedures={};
|
||||
Blockly.Lua.procedures_defreturn=function(a){var b=Blockly.Lua.variableDB_.getName(a.getFieldValue("NAME"),Blockly.Procedures.NAME_TYPE),c=Blockly.Lua.statementToCode(a,"STACK");if(Blockly.Lua.STATEMENT_PREFIX){var d=a.id.replace(/\$/g,"$$$$");c=Blockly.Lua.prefixLines(Blockly.Lua.STATEMENT_PREFIX.replace(/%1/g,"'"+d+"'"),Blockly.Lua.INDENT)+c}Blockly.Lua.INFINITE_LOOP_TRAP&&(c=Blockly.Lua.INFINITE_LOOP_TRAP.replace(/%1/g,"'"+a.id+"'")+c);(d=Blockly.Lua.valueToCode(a,"RETURN",Blockly.Lua.ORDER_NONE)||
|
||||
"")?d=" return "+d+"\n":c||(c="");for(var e=[],f=0;f<a.arguments_.length;f++)e[f]=Blockly.Lua.variableDB_.getName(a.arguments_[f],Blockly.Variables.NAME_TYPE);c="function "+b+"("+e.join(", ")+")\n"+c+d+"end\n";c=Blockly.Lua.scrub_(a,c);Blockly.Lua.definitions_["%"+b]=c;return null};Blockly.Lua.procedures_defnoreturn=Blockly.Lua.procedures_defreturn;
|
||||
"")?d=Blockly.Lua.INDENT+"return "+d+"\n":c||(c="");for(var e=[],f=0;f<a.arguments_.length;f++)e[f]=Blockly.Lua.variableDB_.getName(a.arguments_[f],Blockly.Variables.NAME_TYPE);c="function "+b+"("+e.join(", ")+")\n"+c+d+"end\n";c=Blockly.Lua.scrub_(a,c);Blockly.Lua.definitions_["%"+b]=c;return null};Blockly.Lua.procedures_defnoreturn=Blockly.Lua.procedures_defreturn;
|
||||
Blockly.Lua.procedures_callreturn=function(a){for(var b=Blockly.Lua.variableDB_.getName(a.getFieldValue("NAME"),Blockly.Procedures.NAME_TYPE),c=[],d=0;d<a.arguments_.length;d++)c[d]=Blockly.Lua.valueToCode(a,"ARG"+d,Blockly.Lua.ORDER_NONE)||"nil";return[b+"("+c.join(", ")+")",Blockly.Lua.ORDER_HIGH]};
|
||||
Blockly.Lua.procedures_callnoreturn=function(a){for(var b=Blockly.Lua.variableDB_.getName(a.getFieldValue("NAME"),Blockly.Procedures.NAME_TYPE),c=[],d=0;d<a.arguments_.length;d++)c[d]=Blockly.Lua.valueToCode(a,"ARG"+d,Blockly.Lua.ORDER_NONE)||"nil";return b+"("+c.join(", ")+")\n"};
|
||||
Blockly.Lua.procedures_ifreturn=function(a){var b="if "+(Blockly.Lua.valueToCode(a,"CONDITION",Blockly.Lua.ORDER_NONE)||"false")+" then\n";a.hasReturnValue_?(a=Blockly.Lua.valueToCode(a,"VALUE",Blockly.Lua.ORDER_NONE)||"nil",b+=" return "+a+"\n"):b+=" return\n";return b+"end\n"};Blockly.Lua.texts={};Blockly.Lua.text=function(a){return[Blockly.Lua.quote_(a.getFieldValue("TEXT")),Blockly.Lua.ORDER_ATOMIC]};
|
||||
Blockly.Lua.procedures_ifreturn=function(a){var b="if "+(Blockly.Lua.valueToCode(a,"CONDITION",Blockly.Lua.ORDER_NONE)||"false")+" then\n";a.hasReturnValue_?(a=Blockly.Lua.valueToCode(a,"VALUE",Blockly.Lua.ORDER_NONE)||"nil",b+=Blockly.Lua.INDENT+"return "+a+"\n"):b+=Blockly.Lua.INDENT+"return\n";return b+"end\n"};Blockly.Lua.texts={};Blockly.Lua.text=function(a){return[Blockly.Lua.quote_(a.getFieldValue("TEXT")),Blockly.Lua.ORDER_ATOMIC]};
|
||||
Blockly.Lua.text_join=function(a){if(0==a.itemCount_)return["''",Blockly.Lua.ORDER_ATOMIC];if(1==a.itemCount_)return["tostring("+(Blockly.Lua.valueToCode(a,"ADD0",Blockly.Lua.ORDER_NONE)||"''")+")",Blockly.Lua.ORDER_HIGH];if(2==a.itemCount_){var b=Blockly.Lua.valueToCode(a,"ADD0",Blockly.Lua.ORDER_CONCATENATION)||"''";a=Blockly.Lua.valueToCode(a,"ADD1",Blockly.Lua.ORDER_CONCATENATION)||"''";return[b+" .. "+a,Blockly.Lua.ORDER_CONCATENATION]}b=[];for(var c=0;c<a.itemCount_;c++)b[c]=Blockly.Lua.valueToCode(a,
|
||||
"ADD"+c,Blockly.Lua.ORDER_NONE)||"''";a="table.concat({"+b.join(", ")+"})";return[a,Blockly.Lua.ORDER_HIGH]};Blockly.Lua.text_append=function(a){var b=Blockly.Lua.variableDB_.getName(a.getFieldValue("VAR"),Blockly.Variables.NAME_TYPE);a=Blockly.Lua.valueToCode(a,"TEXT",Blockly.Lua.ORDER_CONCATENATION)||"''";return b+" = "+b+" .. "+a+"\n"};Blockly.Lua.text_length=function(a){return["#"+(Blockly.Lua.valueToCode(a,"VALUE",Blockly.Lua.ORDER_UNARY)||"''"),Blockly.Lua.ORDER_UNARY]};
|
||||
Blockly.Lua.text_isEmpty=function(a){return["#"+(Blockly.Lua.valueToCode(a,"VALUE",Blockly.Lua.ORDER_UNARY)||"''")+" == 0",Blockly.Lua.ORDER_RELATIONAL]};
|
||||
|
||||
@@ -310,7 +310,6 @@ goog.require('Blockly.Msg');
|
||||
/** @export */ Blockly.Msg.PROCEDURES_MUTATORARG_TOOLTIP = "Add an input to the function."; // untranslated
|
||||
/** @export */ Blockly.Msg.PROCEDURES_MUTATORCONTAINER_TITLE = "апараметрқәа";
|
||||
/** @export */ Blockly.Msg.PROCEDURES_MUTATORCONTAINER_TOOLTIP = "Add, remove, or reorder inputs to this function."; // untranslated
|
||||
/** @export */ Blockly.Msg.PROCEDURE_ALREADY_EXISTS = "A procedure named '%1' already exists."; // untranslated
|
||||
/** @export */ Blockly.Msg.REDO = "Аиҭаҟаҵара";
|
||||
/** @export */ Blockly.Msg.REMOVE_COMMENT = "Ианыхтәуп ахцәажәара";
|
||||
/** @export */ Blockly.Msg.RENAME_VARIABLE = "Аҽеиҭак ахьӡ ҧсахтәуп";
|
||||
|
||||
+2
-3
@@ -310,13 +310,12 @@ goog.require('Blockly.Msg');
|
||||
/** @export */ Blockly.Msg.PROCEDURES_MUTATORARG_TOOLTIP = "أضف مدخلا إلى الوظيفة.";
|
||||
/** @export */ Blockly.Msg.PROCEDURES_MUTATORCONTAINER_TITLE = "المدخلات";
|
||||
/** @export */ Blockly.Msg.PROCEDURES_MUTATORCONTAINER_TOOLTIP = "إضافة أو إزالة أو إعادة ترتيب المدخلات لهذه المهمة.";
|
||||
/** @export */ Blockly.Msg.PROCEDURE_ALREADY_EXISTS = "A procedure named '%1' already exists."; // untranslated
|
||||
/** @export */ Blockly.Msg.REDO = "إعادة";
|
||||
/** @export */ Blockly.Msg.REMOVE_COMMENT = "أزل التعليق";
|
||||
/** @export */ Blockly.Msg.RENAME_VARIABLE = "إعادة تسمية المتغير...";
|
||||
/** @export */ Blockly.Msg.RENAME_VARIABLE_TITLE = "إعادة تسمية كافة المتغيرات '%1' إلى:";
|
||||
/** @export */ Blockly.Msg.TEXT_APPEND_HELPURL = "https://github.com/google/blockly/wiki/Text#text-modification"; // untranslated
|
||||
/** @export */ Blockly.Msg.TEXT_APPEND_TITLE = "to %1 append text %2"; // untranslated
|
||||
/** @export */ Blockly.Msg.TEXT_APPEND_TITLE = "إلى %1 إلصق نص %2";
|
||||
/** @export */ Blockly.Msg.TEXT_APPEND_TOOLTIP = "إلصق جزءا من النص إلى متغير '%1'.";
|
||||
/** @export */ Blockly.Msg.TEXT_CHANGECASE_HELPURL = "https://github.com/google/blockly/wiki/Text#adjusting-text-case"; // untranslated
|
||||
/** @export */ Blockly.Msg.TEXT_CHANGECASE_OPERATOR_LOWERCASE = "الى حروف صغيرة";
|
||||
@@ -351,7 +350,7 @@ goog.require('Blockly.Msg');
|
||||
/** @export */ Blockly.Msg.TEXT_INDEXOF_HELPURL = "https://github.com/google/blockly/wiki/Text#finding-text"; // untranslated
|
||||
/** @export */ Blockly.Msg.TEXT_INDEXOF_OPERATOR_FIRST = "ابحث عن التواجد الأول للنص";
|
||||
/** @export */ Blockly.Msg.TEXT_INDEXOF_OPERATOR_LAST = "ابحث عن التواجد الأخير للنص";
|
||||
/** @export */ Blockly.Msg.TEXT_INDEXOF_TITLE = "in text %1 %2 %3"; // untranslated
|
||||
/** @export */ Blockly.Msg.TEXT_INDEXOF_TITLE = "في النص %1 %2 %3";
|
||||
/** @export */ Blockly.Msg.TEXT_INDEXOF_TOOLTIP = "تقوم بإرجاع مؤشر التواجد الأول/الأخير للنص الأول في النص الثاني. تقوم بإرجاع %1 إذا لم يتم العثور على النص.";
|
||||
/** @export */ Blockly.Msg.TEXT_ISEMPTY_HELPURL = "https://github.com/google/blockly/wiki/Text#checking-for-empty-text"; // untranslated
|
||||
/** @export */ Blockly.Msg.TEXT_ISEMPTY_TITLE = "%1 فارغ";
|
||||
|
||||
+4
-5
@@ -75,7 +75,7 @@ goog.require('Blockly.Msg');
|
||||
/** @export */ Blockly.Msg.HELP = "Kömək";
|
||||
/** @export */ Blockly.Msg.INLINE_INPUTS = "Sətiriçi girişlər";
|
||||
/** @export */ Blockly.Msg.IOS_CANCEL = "Cancel"; // untranslated
|
||||
/** @export */ Blockly.Msg.IOS_ERROR = "Error"; // untranslated
|
||||
/** @export */ Blockly.Msg.IOS_ERROR = "Xəta";
|
||||
/** @export */ Blockly.Msg.IOS_OK = "OK"; // untranslated
|
||||
/** @export */ Blockly.Msg.IOS_PROCEDURES_ADD_INPUT = "+ Add Input"; // untranslated
|
||||
/** @export */ Blockly.Msg.IOS_PROCEDURES_ALLOW_STATEMENTS = "Allow statements"; // untranslated
|
||||
@@ -85,7 +85,7 @@ goog.require('Blockly.Msg');
|
||||
/** @export */ Blockly.Msg.IOS_VARIABLES_ADD_VARIABLE = "+ Add Variable"; // untranslated
|
||||
/** @export */ Blockly.Msg.IOS_VARIABLES_DELETE_BUTTON = "Delete"; // untranslated
|
||||
/** @export */ Blockly.Msg.IOS_VARIABLES_EMPTY_NAME_ERROR = "You can't use an empty variable name."; // untranslated
|
||||
/** @export */ Blockly.Msg.IOS_VARIABLES_RENAME_BUTTON = "Rename"; // untranslated
|
||||
/** @export */ Blockly.Msg.IOS_VARIABLES_RENAME_BUTTON = "Adını dəyiş";
|
||||
/** @export */ Blockly.Msg.IOS_VARIABLES_VARIABLE_NAME = "Variable name"; // untranslated
|
||||
/** @export */ Blockly.Msg.LISTS_CREATE_EMPTY_HELPURL = "https://github.com/google/blockly/wiki/Lists#create-empty-list"; // untranslated
|
||||
/** @export */ Blockly.Msg.LISTS_CREATE_EMPTY_TITLE = "boş siyahı düzəlt";
|
||||
@@ -310,13 +310,12 @@ goog.require('Blockly.Msg');
|
||||
/** @export */ Blockly.Msg.PROCEDURES_MUTATORARG_TOOLTIP = "Add an input to the function."; // untranslated
|
||||
/** @export */ Blockly.Msg.PROCEDURES_MUTATORCONTAINER_TITLE = "girişlər";
|
||||
/** @export */ Blockly.Msg.PROCEDURES_MUTATORCONTAINER_TOOLTIP = "Add, remove, or reorder inputs to this function."; // untranslated
|
||||
/** @export */ Blockly.Msg.PROCEDURE_ALREADY_EXISTS = "A procedure named '%1' already exists."; // untranslated
|
||||
/** @export */ Blockly.Msg.REDO = "Redo"; // untranslated
|
||||
/** @export */ Blockly.Msg.REMOVE_COMMENT = "Şərhi sil";
|
||||
/** @export */ Blockly.Msg.RENAME_VARIABLE = "Dəyişənin adını dəyiş...";
|
||||
/** @export */ Blockly.Msg.RENAME_VARIABLE_TITLE = "Bütün '%1' dəyişənlərinin adını buna dəyiş:";
|
||||
/** @export */ Blockly.Msg.TEXT_APPEND_HELPURL = "https://github.com/google/blockly/wiki/Text#text-modification"; // untranslated
|
||||
/** @export */ Blockly.Msg.TEXT_APPEND_TITLE = "to %1 append text %2"; // untranslated
|
||||
/** @export */ Blockly.Msg.TEXT_APPEND_TITLE = "bu mətnin sonuna: %1 bu mətni əlavə et: %2";
|
||||
/** @export */ Blockly.Msg.TEXT_APPEND_TOOLTIP = "'%1' dəyişəninin sonuna nəsə əlavə et.";
|
||||
/** @export */ Blockly.Msg.TEXT_CHANGECASE_HELPURL = "https://github.com/google/blockly/wiki/Text#adjusting-text-case"; // untranslated
|
||||
/** @export */ Blockly.Msg.TEXT_CHANGECASE_OPERATOR_LOWERCASE = "kiçik hərflərlə";
|
||||
@@ -351,7 +350,7 @@ goog.require('Blockly.Msg');
|
||||
/** @export */ Blockly.Msg.TEXT_INDEXOF_HELPURL = "https://github.com/google/blockly/wiki/Text#finding-text"; // untranslated
|
||||
/** @export */ Blockly.Msg.TEXT_INDEXOF_OPERATOR_FIRST = "Bu mətn ilə ilk rastlaşmanı tap:";
|
||||
/** @export */ Blockly.Msg.TEXT_INDEXOF_OPERATOR_LAST = "Bu mətn ilə son rastlaşmanı tap:";
|
||||
/** @export */ Blockly.Msg.TEXT_INDEXOF_TITLE = "in text %1 %2 %3"; // untranslated
|
||||
/** @export */ Blockly.Msg.TEXT_INDEXOF_TITLE = "mətndə %1 %2 %3";
|
||||
/** @export */ Blockly.Msg.TEXT_INDEXOF_TOOLTIP = "Birinci mətnin ikinci mətndə ilk/son rastlaşma indeksini qaytarır. Əgər rastlaşma baş verməzsə, %1 qaytarır.";
|
||||
/** @export */ Blockly.Msg.TEXT_ISEMPTY_HELPURL = "https://github.com/google/blockly/wiki/Text#checking-for-empty-text"; // untranslated
|
||||
/** @export */ Blockly.Msg.TEXT_ISEMPTY_TITLE = "%1 boşdur";
|
||||
|
||||
+1
-2
@@ -310,7 +310,6 @@ goog.require('Blockly.Msg');
|
||||
/** @export */ Blockly.Msg.PROCEDURES_MUTATORARG_TOOLTIP = "Add an input to the function."; // untranslated
|
||||
/** @export */ Blockly.Msg.PROCEDURES_MUTATORCONTAINER_TITLE = "инеү";
|
||||
/** @export */ Blockly.Msg.PROCEDURES_MUTATORCONTAINER_TOOLTIP = "Add, remove, or reorder inputs to this function."; // untranslated
|
||||
/** @export */ Blockly.Msg.PROCEDURE_ALREADY_EXISTS = "A procedure named '%1' already exists."; // untranslated
|
||||
/** @export */ Blockly.Msg.REDO = "документтарҙы үҙгәртергә";
|
||||
/** @export */ Blockly.Msg.REMOVE_COMMENT = "Аңлатмаларҙы юйырға";
|
||||
/** @export */ Blockly.Msg.RENAME_VARIABLE = "Үҙгәреүсәндең исемен алмаштырырға...";
|
||||
@@ -351,7 +350,7 @@ goog.require('Blockly.Msg');
|
||||
/** @export */ Blockly.Msg.TEXT_INDEXOF_HELPURL = "https://github.com/google/blockly/wiki/Text#finding-text"; // untranslated
|
||||
/** @export */ Blockly.Msg.TEXT_INDEXOF_OPERATOR_FIRST = "текстың тәүге инеүен табырға";
|
||||
/** @export */ Blockly.Msg.TEXT_INDEXOF_OPERATOR_LAST = "Текстың һуңғы инеүен табырға";
|
||||
/** @export */ Blockly.Msg.TEXT_INDEXOF_TITLE = "in text %1 %2 %3"; // untranslated
|
||||
/** @export */ Blockly.Msg.TEXT_INDEXOF_TITLE = "текстҡа %1 %2 %3";
|
||||
/** @export */ Blockly.Msg.TEXT_INDEXOF_TOOLTIP = "Returns the index of the first/last occurrence of the first text in the second text. Returns %1 if text is not found."; // untranslated
|
||||
/** @export */ Blockly.Msg.TEXT_ISEMPTY_HELPURL = "https://github.com/google/blockly/wiki/Text#checking-for-empty-text"; // untranslated
|
||||
/** @export */ Blockly.Msg.TEXT_ISEMPTY_TITLE = "%1 буш";
|
||||
|
||||
+2
-3
@@ -310,13 +310,12 @@ goog.require('Blockly.Msg');
|
||||
/** @export */ Blockly.Msg.PROCEDURES_MUTATORARG_TOOLTIP = "اضافه کردن ورودی به تابع.";
|
||||
/** @export */ Blockly.Msg.PROCEDURES_MUTATORCONTAINER_TITLE = "ورودیها";
|
||||
/** @export */ Blockly.Msg.PROCEDURES_MUTATORCONTAINER_TOOLTIP = "افزودن، حذف یا دوباره مرتبکردن ورودی این تابع.";
|
||||
/** @export */ Blockly.Msg.PROCEDURE_ALREADY_EXISTS = "A procedure named '%1' already exists."; // untranslated
|
||||
/** @export */ Blockly.Msg.REDO = "Redo"; // untranslated
|
||||
/** @export */ Blockly.Msg.REMOVE_COMMENT = "حذف نظر";
|
||||
/** @export */ Blockly.Msg.RENAME_VARIABLE = "تغییر نام متغیر...";
|
||||
/** @export */ Blockly.Msg.RENAME_VARIABLE_TITLE = "تغییر نام همهٔ متغیرهای «%1» به:";
|
||||
/** @export */ Blockly.Msg.TEXT_APPEND_HELPURL = "https://github.com/google/blockly/wiki/Text#text-modification"; // untranslated
|
||||
/** @export */ Blockly.Msg.TEXT_APPEND_TITLE = "to %1 append text %2"; // untranslated
|
||||
/** @export */ Blockly.Msg.TEXT_APPEND_TITLE = "به %1 الحاق متن %2";
|
||||
/** @export */ Blockly.Msg.TEXT_APPEND_TOOLTIP = "الحاق متنی به متغیر «%1».";
|
||||
/** @export */ Blockly.Msg.TEXT_CHANGECASE_HELPURL = "https://github.com/google/blockly/wiki/Text#adjusting-text-case"; // untranslated
|
||||
/** @export */ Blockly.Msg.TEXT_CHANGECASE_OPERATOR_LOWERCASE = "به حروف کوچک";
|
||||
@@ -351,7 +350,7 @@ goog.require('Blockly.Msg');
|
||||
/** @export */ Blockly.Msg.TEXT_INDEXOF_HELPURL = "https://github.com/google/blockly/wiki/Text#finding-text"; // untranslated
|
||||
/** @export */ Blockly.Msg.TEXT_INDEXOF_OPERATOR_FIRST = "اولین رخداد متن را بیاب";
|
||||
/** @export */ Blockly.Msg.TEXT_INDEXOF_OPERATOR_LAST = "آخرین رخداد متن را بیاب";
|
||||
/** @export */ Blockly.Msg.TEXT_INDEXOF_TITLE = "in text %1 %2 %3"; // untranslated
|
||||
/** @export */ Blockly.Msg.TEXT_INDEXOF_TITLE = "در متن %1 %2 %3";
|
||||
/** @export */ Blockly.Msg.TEXT_INDEXOF_TOOLTIP = "شاخصی از اولین آخرین رخداد متن اول در متن دوم بر میگرداند. اگر متن یافت نشد %1 باز میگرداند.";
|
||||
/** @export */ Blockly.Msg.TEXT_ISEMPTY_HELPURL = "https://github.com/google/blockly/wiki/Text#checking-for-empty-text"; // untranslated
|
||||
/** @export */ Blockly.Msg.TEXT_ISEMPTY_TITLE = "%1 خالی است";
|
||||
|
||||
@@ -310,7 +310,6 @@ goog.require('Blockly.Msg');
|
||||
/** @export */ Blockly.Msg.PROCEDURES_MUTATORARG_TOOLTIP = "Дадаць уваходныя парамэтры ў функцыю.";
|
||||
/** @export */ Blockly.Msg.PROCEDURES_MUTATORCONTAINER_TITLE = "парамэтры";
|
||||
/** @export */ Blockly.Msg.PROCEDURES_MUTATORCONTAINER_TOOLTIP = "Дадаць, выдаліць ці запісаць чаргу ўваходных парамэтраў для гэтай функцыі.";
|
||||
/** @export */ Blockly.Msg.PROCEDURE_ALREADY_EXISTS = "Працэдура з назвай «%1» ужо існуе.";
|
||||
/** @export */ Blockly.Msg.REDO = "Паўтарыць";
|
||||
/** @export */ Blockly.Msg.REMOVE_COMMENT = "Выдаліць камэнтар";
|
||||
/** @export */ Blockly.Msg.RENAME_VARIABLE = "Перайменаваць зьменную…";
|
||||
|
||||
+425
@@ -0,0 +1,425 @@
|
||||
// This file was automatically generated. Do not modify.
|
||||
|
||||
'use strict';
|
||||
|
||||
goog.provide('Blockly.Msg.be');
|
||||
|
||||
goog.require('Blockly.Msg');
|
||||
|
||||
/** @export */ Blockly.Msg.ADD_COMMENT = "Дадаць каментарый";
|
||||
/** @export */ Blockly.Msg.CANNOT_DELETE_VARIABLE_PROCEDURE = "Немагчыма выдаліць пераменную '%1', паколькі яна з'яўляецца часткай вызначэння функцыі '%2'";
|
||||
/** @export */ Blockly.Msg.CHANGE_VALUE_TITLE = "Змяніць значэння:";
|
||||
/** @export */ Blockly.Msg.CLEAN_UP = "Выраўнаваць блокі";
|
||||
/** @export */ Blockly.Msg.COLLAPSE_ALL = "Згарнуць блокі";
|
||||
/** @export */ Blockly.Msg.COLLAPSE_BLOCK = "Згарнуць блок";
|
||||
/** @export */ Blockly.Msg.COLOUR_BLEND_COLOUR1 = "колер 1";
|
||||
/** @export */ Blockly.Msg.COLOUR_BLEND_COLOUR2 = "колер 2";
|
||||
/** @export */ Blockly.Msg.COLOUR_BLEND_HELPURL = "http://meyerweb.com/eric/tools/color-blend/"; // untranslated
|
||||
/** @export */ Blockly.Msg.COLOUR_BLEND_RATIO = "суадносіны";
|
||||
/** @export */ Blockly.Msg.COLOUR_BLEND_TITLE = "змяшаць";
|
||||
/** @export */ Blockly.Msg.COLOUR_BLEND_TOOLTIP = "Змешвае два колеры разам у паказаных суадносінах (0.0 - 1.0).";
|
||||
/** @export */ Blockly.Msg.COLOUR_PICKER_HELPURL = "https://be.wikipedia.org/wiki/Колер";
|
||||
/** @export */ Blockly.Msg.COLOUR_PICKER_TOOLTIP = "Выбраць колер з палітры.";
|
||||
/** @export */ Blockly.Msg.COLOUR_RANDOM_HELPURL = "http://randomcolour.com"; // untranslated
|
||||
/** @export */ Blockly.Msg.COLOUR_RANDOM_TITLE = "выпадковы колер";
|
||||
/** @export */ Blockly.Msg.COLOUR_RANDOM_TOOLTIP = "Выбраць колер наўздагад.";
|
||||
/** @export */ Blockly.Msg.COLOUR_RGB_BLUE = "сіні";
|
||||
/** @export */ Blockly.Msg.COLOUR_RGB_GREEN = "зялёны";
|
||||
/** @export */ Blockly.Msg.COLOUR_RGB_HELPURL = "http://www.december.com/html/spec/colorper.html"; // untranslated
|
||||
/** @export */ Blockly.Msg.COLOUR_RGB_RED = "чырвоны";
|
||||
/** @export */ Blockly.Msg.COLOUR_RGB_TITLE = "колер з";
|
||||
/** @export */ Blockly.Msg.COLOUR_RGB_TOOLTIP = "Стварыць колер з названымі ўзроўнямі чырвонага, зялёнага і сіняга. Усе значэння павінны быць ад 0 да 100.";
|
||||
/** @export */ Blockly.Msg.CONTROLS_FLOW_STATEMENTS_HELPURL = "https://github.com/google/blockly/wiki/Loops#loop-termination-blocks"; // untranslated
|
||||
/** @export */ Blockly.Msg.CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK = "перарваць цыкл";
|
||||
/** @export */ Blockly.Msg.CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE = "прадоўжыць з наступнай ітэрацыі цыклу";
|
||||
/** @export */ Blockly.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK = "Перарваць выкананне цыкла.";
|
||||
/** @export */ Blockly.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE = "Прапусціць рэшту гэтага цыкла і перайсці да выканання наступнай ітэрацыі.";
|
||||
/** @export */ Blockly.Msg.CONTROLS_FLOW_STATEMENTS_WARNING = "Папярэджанне: гэты блок можа быць выкарыстаны толькі ў межах цыклу.";
|
||||
/** @export */ Blockly.Msg.CONTROLS_FOREACH_HELPURL = "https://github.com/google/blockly/wiki/Loops#for-each"; // untranslated
|
||||
/** @export */ Blockly.Msg.CONTROLS_FOREACH_TITLE = "для кожнага элемента %1 у спісе %2";
|
||||
/** @export */ Blockly.Msg.CONTROLS_FOREACH_TOOLTIP = "Для кожнага элемента ў спісе пераменная '%1' атрымлівае значэнне элемента, а затым выконваюцца пэўныя дзеянні.";
|
||||
/** @export */ Blockly.Msg.CONTROLS_FOR_HELPURL = "https://github.com/google/blockly/wiki/Loops#count-with"; // untranslated
|
||||
/** @export */ Blockly.Msg.CONTROLS_FOR_TITLE = "лічыць з %1 ад %2 да %3 праз %4";
|
||||
/** @export */ Blockly.Msg.CONTROLS_FOR_TOOLTIP = "Наяўная пераменная '%1' прымае значэнні ад пачатковага да канчатковага, улічваючы зададзены інтэрвал, і выконваюцца названыя блокі.";
|
||||
/** @export */ Blockly.Msg.CONTROLS_IF_ELSEIF_TOOLTIP = "Дадайце ўмову да блоку 'калі'";
|
||||
/** @export */ Blockly.Msg.CONTROLS_IF_ELSE_TOOLTIP = "Дадаць канчатковую, ўсёабдымную ўмову ў блок 'калі'.";
|
||||
/** @export */ Blockly.Msg.CONTROLS_IF_HELPURL = "https://github.com/google/blockly/wiki/IfElse"; // untranslated
|
||||
/** @export */ Blockly.Msg.CONTROLS_IF_IF_TOOLTIP = "Дадайце, выдаліце або змяніце парадак секцыяў, каб пераналадзіць гэты блок 'калі'.";
|
||||
/** @export */ Blockly.Msg.CONTROLS_IF_MSG_ELSE = "інакш";
|
||||
/** @export */ Blockly.Msg.CONTROLS_IF_MSG_ELSEIF = "інакш калі";
|
||||
/** @export */ Blockly.Msg.CONTROLS_IF_MSG_IF = "калі";
|
||||
/** @export */ Blockly.Msg.CONTROLS_IF_TOOLTIP_1 = "Калі значэнне ісцінае, то выканаць пэўныя дзеянні.";
|
||||
/** @export */ Blockly.Msg.CONTROLS_IF_TOOLTIP_2 = "Калі значэнне ісцінае, то выконваецца першы блок аператараў. У адваротным выпадку выконваецца другі блок аператараў.";
|
||||
/** @export */ Blockly.Msg.CONTROLS_IF_TOOLTIP_3 = "Калі першае значэнне ісцінае, то выконваецца першы блок аператараў. У адваротным выпадку, калі другое значэнне ісцінае, то выконваецца другі блок аператараў.";
|
||||
/** @export */ Blockly.Msg.CONTROLS_IF_TOOLTIP_4 = "Калі першае значэнне ісцінае, то выконваецца першы блок аператараў. У адваротным выпадку, калі другое значэнне ісцінае, то выконваецца другі блок аператараў. Калі ні адно з значэнняў не з'яўляецца ісціным, то выконваецца апошні блок аператараў.";
|
||||
/** @export */ Blockly.Msg.CONTROLS_REPEAT_HELPURL = "https://be.wikipedia.org/wiki/Цыкл_(праграмаванне)";
|
||||
/** @export */ Blockly.Msg.CONTROLS_REPEAT_INPUT_DO = "выканаць";
|
||||
/** @export */ Blockly.Msg.CONTROLS_REPEAT_TITLE = "паўтарыць %1 разоў";
|
||||
/** @export */ Blockly.Msg.CONTROLS_REPEAT_TOOLTIP = "Выканаць пэўныя дзеянні некалькі разоў.";
|
||||
/** @export */ Blockly.Msg.CONTROLS_WHILEUNTIL_HELPURL = "https://github.com/google/blockly/wiki/Loops#repeat"; // untranslated
|
||||
/** @export */ Blockly.Msg.CONTROLS_WHILEUNTIL_OPERATOR_UNTIL = "паўтараць, пакуль не";
|
||||
/** @export */ Blockly.Msg.CONTROLS_WHILEUNTIL_OPERATOR_WHILE = "паўтараць, пакуль";
|
||||
/** @export */ Blockly.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL = "Пакуль значэнне ілжывае, выконваць пэўныя дзеянні.";
|
||||
/** @export */ Blockly.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_WHILE = "Пакуль значэнне ісцінае, выконваць пэўныя дзеянні.";
|
||||
/** @export */ Blockly.Msg.DELETE_ALL_BLOCKS = "Выдаліць усе блокі %1?";
|
||||
/** @export */ Blockly.Msg.DELETE_BLOCK = "Выдаліць блок";
|
||||
/** @export */ Blockly.Msg.DELETE_VARIABLE = "Выдаліць пераменную '%1'";
|
||||
/** @export */ Blockly.Msg.DELETE_VARIABLE_CONFIRMATION = "Выдаліць %1 выкарыстання пераменнай '%2'?";
|
||||
/** @export */ Blockly.Msg.DELETE_X_BLOCKS = "Выдаліць %1 блокаў";
|
||||
/** @export */ Blockly.Msg.DISABLE_BLOCK = "Адключыць блок";
|
||||
/** @export */ Blockly.Msg.DUPLICATE_BLOCK = "Дубляваць";
|
||||
/** @export */ Blockly.Msg.ENABLE_BLOCK = "Уключыць блок";
|
||||
/** @export */ Blockly.Msg.EXPAND_ALL = "Разгарнуць блокі";
|
||||
/** @export */ Blockly.Msg.EXPAND_BLOCK = "Разгарнуць блок";
|
||||
/** @export */ Blockly.Msg.EXTERNAL_INPUTS = "Знешнія ўваходы";
|
||||
/** @export */ Blockly.Msg.HELP = "Даведка";
|
||||
/** @export */ Blockly.Msg.INLINE_INPUTS = "Убудаваныя ўваходы";
|
||||
/** @export */ Blockly.Msg.IOS_CANCEL = "Адмяніць";
|
||||
/** @export */ Blockly.Msg.IOS_ERROR = "Памылка";
|
||||
/** @export */ Blockly.Msg.IOS_OK = "Добра";
|
||||
/** @export */ Blockly.Msg.IOS_PROCEDURES_ADD_INPUT = "+ Дадаць уваходную пераменную";
|
||||
/** @export */ Blockly.Msg.IOS_PROCEDURES_ALLOW_STATEMENTS = "Дазволіць аператары";
|
||||
/** @export */ Blockly.Msg.IOS_PROCEDURES_DUPLICATE_INPUTS_ERROR = "У гэтай функцыі ёсць уваходныя пераменныя, якія дубліруюцца.";
|
||||
/** @export */ Blockly.Msg.IOS_PROCEDURES_INPUTS = "УВАХОД";
|
||||
/** @export */ Blockly.Msg.IOS_VARIABLES_ADD_BUTTON = "Дадаць";
|
||||
/** @export */ Blockly.Msg.IOS_VARIABLES_ADD_VARIABLE = "+ Дадаць пераменную";
|
||||
/** @export */ Blockly.Msg.IOS_VARIABLES_DELETE_BUTTON = "Выдаліць";
|
||||
/** @export */ Blockly.Msg.IOS_VARIABLES_EMPTY_NAME_ERROR = "Вы не можаце выкарыстоўваць пустое імя пераменнай.";
|
||||
/** @export */ Blockly.Msg.IOS_VARIABLES_RENAME_BUTTON = "Перайменаваць";
|
||||
/** @export */ Blockly.Msg.IOS_VARIABLES_VARIABLE_NAME = "Назва пераменнай";
|
||||
/** @export */ Blockly.Msg.LISTS_CREATE_EMPTY_HELPURL = "https://github.com/google/blockly/wiki/Lists#create-empty-list"; // untranslated
|
||||
/** @export */ Blockly.Msg.LISTS_CREATE_EMPTY_TITLE = "стварыць пусты спіс";
|
||||
/** @export */ Blockly.Msg.LISTS_CREATE_EMPTY_TOOLTIP = "Вяртае спіс даўжыні 0, які не ўтрымлівае дадзеных";
|
||||
/** @export */ Blockly.Msg.LISTS_CREATE_WITH_CONTAINER_TITLE_ADD = "спіс";
|
||||
/** @export */ Blockly.Msg.LISTS_CREATE_WITH_CONTAINER_TOOLTIP = "Дадайце, выдаліце, перастаўце элементы для пераробкі блока спісу.";
|
||||
/** @export */ Blockly.Msg.LISTS_CREATE_WITH_HELPURL = "https://github.com/google/blockly/wiki/Lists#create-list-with"; // untranslated
|
||||
/** @export */ Blockly.Msg.LISTS_CREATE_WITH_INPUT_WITH = "стварыць спіс з";
|
||||
/** @export */ Blockly.Msg.LISTS_CREATE_WITH_ITEM_TOOLTIP = "Дадае элемент да спісу.";
|
||||
/** @export */ Blockly.Msg.LISTS_CREATE_WITH_TOOLTIP = "Стварае спіс з любым лікам элементаў.";
|
||||
/** @export */ Blockly.Msg.LISTS_GET_INDEX_FIRST = "першы";
|
||||
/** @export */ Blockly.Msg.LISTS_GET_INDEX_FROM_END = "# з канца";
|
||||
/** @export */ Blockly.Msg.LISTS_GET_INDEX_FROM_START = "#"; // untranslated
|
||||
/** @export */ Blockly.Msg.LISTS_GET_INDEX_GET = "узяць";
|
||||
/** @export */ Blockly.Msg.LISTS_GET_INDEX_GET_REMOVE = "узяць і выдаліць";
|
||||
/** @export */ Blockly.Msg.LISTS_GET_INDEX_LAST = "апошні";
|
||||
/** @export */ Blockly.Msg.LISTS_GET_INDEX_RANDOM = "адвольны";
|
||||
/** @export */ Blockly.Msg.LISTS_GET_INDEX_REMOVE = "выдаліць";
|
||||
/** @export */ Blockly.Msg.LISTS_GET_INDEX_TAIL = ""; // untranslated
|
||||
/** @export */ Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_GET_FIRST = "Вяртае першы элемент спіса.";
|
||||
/** @export */ Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_GET_FROM = "Вяртае элемент ва ўказанай пазіцыі спіса.";
|
||||
/** @export */ Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_GET_LAST = "Вяртае апошні элемент спіса.";
|
||||
/** @export */ Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_GET_RANDOM = "Вяртае выпадковы элемент спіса.";
|
||||
/** @export */ Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FIRST = "Видаляє і повертає перший елемент списку.";
|
||||
/** @export */ Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM = "Выдаляе і вяртае элемент ва ўказанай пазіцыі спіса.";
|
||||
/** @export */ Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_LAST = "Видаляє і повертає апошні элемент спіса.";
|
||||
/** @export */ Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_RANDOM = "Видаляє і повертає выпадковы элемент спіса.";
|
||||
/** @export */ Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_FIRST = "Видаляє першы элемент спіса.";
|
||||
/** @export */ Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_FROM = "Видаляє элемент ва ўказанай пазіцыі спіса.";
|
||||
/** @export */ Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_LAST = "Видаляє апошні элемент спіса.";
|
||||
/** @export */ Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_RANDOM = "Видаляє выпадковы элемент спіса.";
|
||||
/** @export */ Blockly.Msg.LISTS_GET_SUBLIST_END_FROM_END = "па # з канца";
|
||||
/** @export */ Blockly.Msg.LISTS_GET_SUBLIST_END_FROM_START = "па #";
|
||||
/** @export */ Blockly.Msg.LISTS_GET_SUBLIST_END_LAST = "па апошні";
|
||||
/** @export */ Blockly.Msg.LISTS_GET_SUBLIST_HELPURL = "https://github.com/google/blockly/wiki/Lists#getting-a-sublist"; // untranslated
|
||||
/** @export */ Blockly.Msg.LISTS_GET_SUBLIST_START_FIRST = "узяць падспіс з першага";
|
||||
/** @export */ Blockly.Msg.LISTS_GET_SUBLIST_START_FROM_END = "узяць падспіс з # з канца";
|
||||
/** @export */ Blockly.Msg.LISTS_GET_SUBLIST_START_FROM_START = "узяць падспіс з #";
|
||||
/** @export */ Blockly.Msg.LISTS_GET_SUBLIST_TAIL = ""; // untranslated
|
||||
/** @export */ Blockly.Msg.LISTS_GET_SUBLIST_TOOLTIP = "Стварае копію ўказанай частцы спісу.";
|
||||
/** @export */ Blockly.Msg.LISTS_INDEX_FROM_END_TOOLTIP = "%1 - апошні элемент.";
|
||||
/** @export */ Blockly.Msg.LISTS_INDEX_FROM_START_TOOLTIP = "%1 - першы элемент.";
|
||||
/** @export */ Blockly.Msg.LISTS_INDEX_OF_FIRST = "знайсці першае ўваходжанне элемента";
|
||||
/** @export */ Blockly.Msg.LISTS_INDEX_OF_HELPURL = "https://github.com/google/blockly/wiki/Lists#getting-items-from-a-list"; // untranslated
|
||||
/** @export */ Blockly.Msg.LISTS_INDEX_OF_LAST = "знайсці апошняе ўваходжанне элемента";
|
||||
/** @export */ Blockly.Msg.LISTS_INDEX_OF_TOOLTIP = "Вяртае нумар пазіцыі першага/апошняга ўваходжання элемента ў спісе. Вяртае %1, калі элемент не знойдзены.";
|
||||
/** @export */ Blockly.Msg.LISTS_INLIST = "у спісе";
|
||||
/** @export */ Blockly.Msg.LISTS_ISEMPTY_HELPURL = "https://github.com/google/blockly/wiki/Lists#is-empty"; // untranslated
|
||||
/** @export */ Blockly.Msg.LISTS_ISEMPTY_TITLE = "%1 пусты";
|
||||
/** @export */ Blockly.Msg.LISTS_ISEMPTY_TOOLTIP = "Вяртае значэнне ісціна, калі спіс пусты.";
|
||||
/** @export */ Blockly.Msg.LISTS_LENGTH_HELPURL = "https://github.com/google/blockly/wiki/Lists#length-of"; // untranslated
|
||||
/** @export */ Blockly.Msg.LISTS_LENGTH_TITLE = "даўжыня %1";
|
||||
/** @export */ Blockly.Msg.LISTS_LENGTH_TOOLTIP = "Вяртае даўжыню спісу.";
|
||||
/** @export */ Blockly.Msg.LISTS_REPEAT_HELPURL = "https://github.com/google/blockly/wiki/Lists#create-list-with"; // untranslated
|
||||
/** @export */ Blockly.Msg.LISTS_REPEAT_TITLE = "стварыць спіс з элемента %1, паўтаральнага %2 разоў";
|
||||
/** @export */ Blockly.Msg.LISTS_REPEAT_TOOLTIP = "Стварае спіс, які складаецца з зададзенага ліку копій элемента.";
|
||||
/** @export */ Blockly.Msg.LISTS_REVERSE_HELPURL = "https://github.com/google/blockly/wiki/Lists#reversing-a-list"; // untranslated
|
||||
/** @export */ Blockly.Msg.LISTS_REVERSE_MESSAGE0 = "змяніць парадак на зваротны %1";
|
||||
/** @export */ Blockly.Msg.LISTS_REVERSE_TOOLTIP = "Змяніць парадак спісу на адваротны.";
|
||||
/** @export */ Blockly.Msg.LISTS_SET_INDEX_HELPURL = "https://github.com/google/blockly/wiki/Lists#in-list--set"; // untranslated
|
||||
/** @export */ Blockly.Msg.LISTS_SET_INDEX_INPUT_TO = "=";
|
||||
/** @export */ Blockly.Msg.LISTS_SET_INDEX_INSERT = "уставіць у";
|
||||
/** @export */ Blockly.Msg.LISTS_SET_INDEX_SET = "прысабечыць";
|
||||
/** @export */ Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_FIRST = "Устаўляе элемент у пачатак спіса.";
|
||||
/** @export */ Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_FROM = "Устаўляе элемент ва ўказанай пазіцыі спіса.";
|
||||
/** @export */ Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_LAST = "Дадае элемент у канец спісу.";
|
||||
/** @export */ Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_RANDOM = "Устаўляе элемент у выпадковае месца ў спісе.";
|
||||
/** @export */ Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FIRST = "Прысабечвае значэнне элемента спісу.";
|
||||
/** @export */ Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM = "Прысабечвае значэнне элемента ва ўказанай пазіцыі спіса.";
|
||||
/** @export */ Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_LAST = "Прысабечвае значэнне элемента спісу.";
|
||||
/** @export */ Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_RANDOM = "Прысабечвае значэнне элемента спісу.";
|
||||
/** @export */ Blockly.Msg.LISTS_SORT_HELPURL = "https://github.com/google/blockly/wiki/Lists#sorting-a-list";
|
||||
/** @export */ Blockly.Msg.LISTS_SORT_ORDER_ASCENDING = "па ўзрастанню";
|
||||
/** @export */ Blockly.Msg.LISTS_SORT_ORDER_DESCENDING = "па спаданню";
|
||||
/** @export */ Blockly.Msg.LISTS_SORT_TITLE = "сартаваць %1 %2 %3";
|
||||
/** @export */ Blockly.Msg.LISTS_SORT_TOOLTIP = "Сартаваць копію спісу.";
|
||||
/** @export */ Blockly.Msg.LISTS_SORT_TYPE_IGNORECASE = "па алфавіце, без уліку рэгістра";
|
||||
/** @export */ Blockly.Msg.LISTS_SORT_TYPE_NUMERIC = "лікавая";
|
||||
/** @export */ Blockly.Msg.LISTS_SORT_TYPE_TEXT = "па алфавіце";
|
||||
/** @export */ Blockly.Msg.LISTS_SPLIT_HELPURL = "https://github.com/google/blockly/wiki/Lists#splitting-strings-and-joining-lists"; // untranslated
|
||||
/** @export */ Blockly.Msg.LISTS_SPLIT_LIST_FROM_TEXT = "зрабіць спіс з тэксту";
|
||||
/** @export */ Blockly.Msg.LISTS_SPLIT_TEXT_FROM_LIST = "сабраць тэкст са спісу";
|
||||
/** @export */ Blockly.Msg.LISTS_SPLIT_TOOLTIP_JOIN = "Злучае спіс тэкстаў у адзін тэкст з падзельнікамі.";
|
||||
/** @export */ Blockly.Msg.LISTS_SPLIT_TOOLTIP_SPLIT = "Разбівае тэкст у спіс тэкстаў па падзельнікам.";
|
||||
/** @export */ Blockly.Msg.LISTS_SPLIT_WITH_DELIMITER = "з падзельнікам";
|
||||
/** @export */ Blockly.Msg.LOGIC_BOOLEAN_FALSE = "хлусня";
|
||||
/** @export */ Blockly.Msg.LOGIC_BOOLEAN_HELPURL = "https://github.com/google/blockly/wiki/Logic#values"; // untranslated
|
||||
/** @export */ Blockly.Msg.LOGIC_BOOLEAN_TOOLTIP = "Вяртае значэнне ісціна або хлусня.";
|
||||
/** @export */ Blockly.Msg.LOGIC_BOOLEAN_TRUE = "ісціна";
|
||||
/** @export */ Blockly.Msg.LOGIC_COMPARE_HELPURL = "https://be.wikipedia.org/wiki/Няроўнасць";
|
||||
/** @export */ Blockly.Msg.LOGIC_COMPARE_TOOLTIP_EQ = "Вяртае станоўчае значэнне, калі абодва ўводы роўныя адзін аднаму.";
|
||||
/** @export */ Blockly.Msg.LOGIC_COMPARE_TOOLTIP_GT = "Вяртае значэнне ісціна, калі першая ўстаўка больш другой.";
|
||||
/** @export */ Blockly.Msg.LOGIC_COMPARE_TOOLTIP_GTE = "Вяртае значэнне ісціна, калі першая ўстаўка больш або роўная другой.";
|
||||
/** @export */ Blockly.Msg.LOGIC_COMPARE_TOOLTIP_LT = "Вяртае станоўчае значэнне, калі першы ўвод менш другога.";
|
||||
/** @export */ Blockly.Msg.LOGIC_COMPARE_TOOLTIP_LTE = "Вяртае значэнне ісціна, калі першая ўстаўка менш або роўная другі.";
|
||||
/** @export */ Blockly.Msg.LOGIC_COMPARE_TOOLTIP_NEQ = "Вяртае станоўчае значэнне, калі ўводы не роўныя.";
|
||||
/** @export */ Blockly.Msg.LOGIC_NEGATE_HELPURL = "https://github.com/google/blockly/wiki/Logic#not"; // untranslated
|
||||
/** @export */ Blockly.Msg.LOGIC_NEGATE_TITLE = "не %1";
|
||||
/** @export */ Blockly.Msg.LOGIC_NEGATE_TOOLTIP = "Вяртае значэнне ісціна, калі устаўка ілжывая. Вяртае значэнне хлусня, калі устаўка ісцінная.";
|
||||
/** @export */ Blockly.Msg.LOGIC_NULL = "нішто";
|
||||
/** @export */ Blockly.Msg.LOGIC_NULL_HELPURL = "https://en.wikipedia.org/wiki/Nullable_type"; // untranslated
|
||||
/** @export */ Blockly.Msg.LOGIC_NULL_TOOLTIP = "Вяртае нішто.";
|
||||
/** @export */ Blockly.Msg.LOGIC_OPERATION_AND = "і";
|
||||
/** @export */ Blockly.Msg.LOGIC_OPERATION_HELPURL = "https://github.com/google/blockly/wiki/Logic#logical-operations"; // untranslated
|
||||
/** @export */ Blockly.Msg.LOGIC_OPERATION_OR = "ці";
|
||||
/** @export */ Blockly.Msg.LOGIC_OPERATION_TOOLTIP_AND = "Вяртае значэнне ісціна, калі абедзве ўстаўкі ісцінныя.";
|
||||
/** @export */ Blockly.Msg.LOGIC_OPERATION_TOOLTIP_OR = "Вяртае значэнне ісціна, калі хаця б адна з уставак ісцінная.";
|
||||
/** @export */ Blockly.Msg.LOGIC_TERNARY_CONDITION = "абраць па";
|
||||
/** @export */ Blockly.Msg.LOGIC_TERNARY_HELPURL = "https://en.wikipedia.org/wiki/%3F:"; // untranslated
|
||||
/** @export */ Blockly.Msg.LOGIC_TERNARY_IF_FALSE = "калі хлусня";
|
||||
/** @export */ Blockly.Msg.LOGIC_TERNARY_IF_TRUE = "калі ісціна";
|
||||
/** @export */ Blockly.Msg.LOGIC_TERNARY_TOOLTIP = "Правярае ўмову выбару. Калі ўмова ісцінная, вяртае першае значэнне, у адваротным выпадку вяртае другое значэнне.";
|
||||
/** @export */ Blockly.Msg.MATH_ADDITION_SYMBOL = "+"; // untranslated
|
||||
/** @export */ Blockly.Msg.MATH_ARITHMETIC_HELPURL = "https://be.wikipedia.org/wiki/Арыфметыка";
|
||||
/** @export */ Blockly.Msg.MATH_ARITHMETIC_TOOLTIP_ADD = "Вяртае суму двух лікаў.";
|
||||
/** @export */ Blockly.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE = "Вяртае дзель ад дзялення першага ліку на другое.";
|
||||
/** @export */ Blockly.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS = "Вяртае рознасць двух лікаў.";
|
||||
/** @export */ Blockly.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY = "Вяртае твор двух лікаў.";
|
||||
/** @export */ Blockly.Msg.MATH_ARITHMETIC_TOOLTIP_POWER = "Вяртае першы лік, узведзены ў ступень другога ліку.";
|
||||
/** @export */ Blockly.Msg.MATH_CHANGE_HELPURL = "https://be.wikipedia.org/wiki/Ідыёма (праграмаванне)";
|
||||
/** @export */ Blockly.Msg.MATH_CHANGE_TITLE = "павялічыць %1 на %2";
|
||||
/** @export */ Blockly.Msg.MATH_CHANGE_TOOLTIP = "Дадае лік да пераменнай '%1'.";
|
||||
/** @export */ Blockly.Msg.MATH_CONSTANT_HELPURL = "https://be.wikipedia.org/wiki/Матэматычная_канстанта";
|
||||
/** @export */ Blockly.Msg.MATH_CONSTANT_TOOLTIP = "Вяртае адну з распаўсюджаных канстант: π (3.141…), e (2.718…), φ (1.618…), sqrt(2) (1.414…), sqrt(½) (0.707…), або ∞ (бясконцасць).";
|
||||
/** @export */ Blockly.Msg.MATH_CONSTRAIN_HELPURL = "https://en.wikipedia.org/wiki/Clamping_(graphics)"; // untranslated
|
||||
/** @export */ Blockly.Msg.MATH_CONSTRAIN_TITLE = "абмежаваць %1 знізу %2 зверху %3";
|
||||
/** @export */ Blockly.Msg.MATH_CONSTRAIN_TOOLTIP = "Абмяжоўвае лік ніжняй і верхняй межамі (уключна).";
|
||||
/** @export */ Blockly.Msg.MATH_DIVISION_SYMBOL = "÷"; // untranslated
|
||||
/** @export */ Blockly.Msg.MATH_IS_DIVISIBLE_BY = "дзеліцца на";
|
||||
/** @export */ Blockly.Msg.MATH_IS_EVEN = "цотнае";
|
||||
/** @export */ Blockly.Msg.MATH_IS_NEGATIVE = "адмоўнае";
|
||||
/** @export */ Blockly.Msg.MATH_IS_ODD = "няцотнае";
|
||||
/** @export */ Blockly.Msg.MATH_IS_POSITIVE = "станоўчае";
|
||||
/** @export */ Blockly.Msg.MATH_IS_PRIME = "простае";
|
||||
/** @export */ Blockly.Msg.MATH_IS_TOOLTIP = "Правярае, ці з'яўляецца лік цотным, няцотным, простым, цэлым, станоўчым, адмоўным ці яно кратнае пэўнаму ліку. Вяртае значэнне ісціна або хлусня.";
|
||||
/** @export */ Blockly.Msg.MATH_IS_WHOLE = "цэлае";
|
||||
/** @export */ Blockly.Msg.MATH_MODULO_HELPURL = "https://be.wikipedia.org/wiki/Дзяленне_з_астаткам";
|
||||
/** @export */ Blockly.Msg.MATH_MODULO_TITLE = "астатак ад %1 ÷ %2";
|
||||
/** @export */ Blockly.Msg.MATH_MODULO_TOOLTIP = "Вяртае астатак ад дзялення двух лікаў.";
|
||||
/** @export */ Blockly.Msg.MATH_MULTIPLICATION_SYMBOL = "×"; // untranslated
|
||||
/** @export */ Blockly.Msg.MATH_NUMBER_HELPURL = "https://be.wikipedia.org/wiki/Лік";
|
||||
/** @export */ Blockly.Msg.MATH_NUMBER_TOOLTIP = "Лік.";
|
||||
/** @export */ Blockly.Msg.MATH_ONLIST_HELPURL = ""; // untranslated
|
||||
/** @export */ Blockly.Msg.MATH_ONLIST_OPERATOR_AVERAGE = "сярэдняе арыфметычнае спісу";
|
||||
/** @export */ Blockly.Msg.MATH_ONLIST_OPERATOR_MAX = "найбольшы ў спісе";
|
||||
/** @export */ Blockly.Msg.MATH_ONLIST_OPERATOR_MEDIAN = "медыяна спіса";
|
||||
/** @export */ Blockly.Msg.MATH_ONLIST_OPERATOR_MIN = "найменшы ў спісе";
|
||||
/** @export */ Blockly.Msg.MATH_ONLIST_OPERATOR_MODE = "моды спіса";
|
||||
/** @export */ Blockly.Msg.MATH_ONLIST_OPERATOR_RANDOM = "выпадковы элемент спіса";
|
||||
/** @export */ Blockly.Msg.MATH_ONLIST_OPERATOR_STD_DEV = "стандартнае адхіленне спіса";
|
||||
/** @export */ Blockly.Msg.MATH_ONLIST_OPERATOR_SUM = "сума спіса";
|
||||
/** @export */ Blockly.Msg.MATH_ONLIST_TOOLTIP_AVERAGE = "Вяртае сярэдняе арыфметычнае спісу.";
|
||||
/** @export */ Blockly.Msg.MATH_ONLIST_TOOLTIP_MAX = "Вяртае найбольшы лік спісу.";
|
||||
/** @export */ Blockly.Msg.MATH_ONLIST_TOOLTIP_MEDIAN = "Вяртае медыяну спісуа.";
|
||||
/** @export */ Blockly.Msg.MATH_ONLIST_TOOLTIP_MIN = "Вяртае найменшы лік спісу.";
|
||||
/** @export */ Blockly.Msg.MATH_ONLIST_TOOLTIP_MODE = "Вяртае спіс найбольш часта сустракаемых элементаў спісу.";
|
||||
/** @export */ Blockly.Msg.MATH_ONLIST_TOOLTIP_RANDOM = "Вяртае выпадковы элемент спіса.";
|
||||
/** @export */ Blockly.Msg.MATH_ONLIST_TOOLTIP_STD_DEV = "Вяртае стандартнае адхіленне спісу.";
|
||||
/** @export */ Blockly.Msg.MATH_ONLIST_TOOLTIP_SUM = "Вяртае суму ўсіх лікаў у спісе.";
|
||||
/** @export */ Blockly.Msg.MATH_POWER_SYMBOL = "^"; // untranslated
|
||||
/** @export */ Blockly.Msg.MATH_RANDOM_FLOAT_HELPURL = "https://be.wikipedia.org/wiki/Генератар_псевдослучайных_лікаў";
|
||||
/** @export */ Blockly.Msg.MATH_RANDOM_FLOAT_TITLE_RANDOM = "выпадковы лік ад 0 (уключна) да 1";
|
||||
/** @export */ Blockly.Msg.MATH_RANDOM_FLOAT_TOOLTIP = "Вяртае выпадковы лік ад 0.0 (уключна) да 1.0.";
|
||||
/** @export */ Blockly.Msg.MATH_RANDOM_INT_HELPURL = "https://be.wikipedia.org/wiki/Генератар_псевдослучайных_лікаў";
|
||||
/** @export */ Blockly.Msg.MATH_RANDOM_INT_TITLE = "выпадковы цэлы лік ад %1 для %2";
|
||||
/** @export */ Blockly.Msg.MATH_RANDOM_INT_TOOLTIP = "Вяртае выпадковы лік паміж двума зададзенымі межамі (уключаючы і іх).";
|
||||
/** @export */ Blockly.Msg.MATH_ROUND_HELPURL = "https://be.wikipedia.org/wiki/Акругленне";
|
||||
/** @export */ Blockly.Msg.MATH_ROUND_OPERATOR_ROUND = "акругліць";
|
||||
/** @export */ Blockly.Msg.MATH_ROUND_OPERATOR_ROUNDDOWN = "акругліць да меншага";
|
||||
/** @export */ Blockly.Msg.MATH_ROUND_OPERATOR_ROUNDUP = "акругліць да большага";
|
||||
/** @export */ Blockly.Msg.MATH_ROUND_TOOLTIP = "Акругляе лік да большага ці меншага.";
|
||||
/** @export */ Blockly.Msg.MATH_SINGLE_HELPURL = "https://be.wikipedia.org/wiki/Квадратны_корань";
|
||||
/** @export */ Blockly.Msg.MATH_SINGLE_OP_ABSOLUTE = "модуль";
|
||||
/** @export */ Blockly.Msg.MATH_SINGLE_OP_ROOT = "квадратны корань";
|
||||
/** @export */ Blockly.Msg.MATH_SINGLE_TOOLTIP_ABS = "Вяртае модуль ліку.";
|
||||
/** @export */ Blockly.Msg.MATH_SINGLE_TOOLTIP_EXP = "Вяртае е ва ўказанай ступені.";
|
||||
/** @export */ Blockly.Msg.MATH_SINGLE_TOOLTIP_LN = "Вяртае натуральны лагарыфм ліку.";
|
||||
/** @export */ Blockly.Msg.MATH_SINGLE_TOOLTIP_LOG10 = "Вяртае дзесятковы лагарыфм ліку.";
|
||||
/** @export */ Blockly.Msg.MATH_SINGLE_TOOLTIP_NEG = "Вяртае супрацьлеглы лік.";
|
||||
/** @export */ Blockly.Msg.MATH_SINGLE_TOOLTIP_POW10 = "Вяртае 10 ва ўказанай ступені.";
|
||||
/** @export */ Blockly.Msg.MATH_SINGLE_TOOLTIP_ROOT = "Вяртае квадратны корань ліку.";
|
||||
/** @export */ Blockly.Msg.MATH_SUBTRACTION_SYMBOL = "-"; // untranslated
|
||||
/** @export */ Blockly.Msg.MATH_TRIG_ACOS = "acos"; // untranslated
|
||||
/** @export */ Blockly.Msg.MATH_TRIG_ASIN = "asin"; // untranslated
|
||||
/** @export */ Blockly.Msg.MATH_TRIG_ATAN = "atan"; // untranslated
|
||||
/** @export */ Blockly.Msg.MATH_TRIG_COS = "cos"; // untranslated
|
||||
/** @export */ Blockly.Msg.MATH_TRIG_HELPURL = "https://be.wikipedia.org/wiki/Трыганаметрычныя_функцыі";
|
||||
/** @export */ Blockly.Msg.MATH_TRIG_SIN = "sin"; // untranslated
|
||||
/** @export */ Blockly.Msg.MATH_TRIG_TAN = "tan"; // untranslated
|
||||
/** @export */ Blockly.Msg.MATH_TRIG_TOOLTIP_ACOS = "Вяртае арккосінус у градусах.";
|
||||
/** @export */ Blockly.Msg.MATH_TRIG_TOOLTIP_ASIN = "Вяртае арксінус у градусах.";
|
||||
/** @export */ Blockly.Msg.MATH_TRIG_TOOLTIP_ATAN = "Вяртае арктангенс у градусах.";
|
||||
/** @export */ Blockly.Msg.MATH_TRIG_TOOLTIP_COS = "Вяртае косінус рага ў градусах.";
|
||||
/** @export */ Blockly.Msg.MATH_TRIG_TOOLTIP_SIN = "Вяртае сінус рага ў градусах.";
|
||||
/** @export */ Blockly.Msg.MATH_TRIG_TOOLTIP_TAN = "Вяртае тангенс рага ў градусах.";
|
||||
/** @export */ Blockly.Msg.NEW_VARIABLE = "Стварыць пераменную...";
|
||||
/** @export */ Blockly.Msg.NEW_VARIABLE_TITLE = "Новая назва пераменнай:";
|
||||
/** @export */ Blockly.Msg.ORDINAL_NUMBER_SUFFIX = ""; // untranslated
|
||||
/** @export */ Blockly.Msg.PROCEDURES_ALLOW_STATEMENTS = "дазволіць аператары";
|
||||
/** @export */ Blockly.Msg.PROCEDURES_BEFORE_PARAMS = "з:";
|
||||
/** @export */ Blockly.Msg.PROCEDURES_CALLNORETURN_HELPURL = "https://be.wikipedia.org/wiki/Падпраграма";
|
||||
/** @export */ Blockly.Msg.PROCEDURES_CALLNORETURN_TOOLTIP = "Выконвае вызначаную карыстальнікам працэдуру '%1'.";
|
||||
/** @export */ Blockly.Msg.PROCEDURES_CALLRETURN_HELPURL = "https://be.wikipedia.org/wiki/Падпраграма";
|
||||
/** @export */ Blockly.Msg.PROCEDURES_CALLRETURN_TOOLTIP = "Выконвае вызначаную карыстальнікам працэдуру '%1' і вяртае вылічанае значэнне.";
|
||||
/** @export */ Blockly.Msg.PROCEDURES_CALL_BEFORE_PARAMS = "з:";
|
||||
/** @export */ Blockly.Msg.PROCEDURES_CREATE_DO = "Стварыць выклік '%1'";
|
||||
/** @export */ Blockly.Msg.PROCEDURES_DEFNORETURN_COMMENT = "Апішыце гэтую функцыю...";
|
||||
/** @export */ Blockly.Msg.PROCEDURES_DEFNORETURN_DO = ""; // untranslated
|
||||
/** @export */ Blockly.Msg.PROCEDURES_DEFNORETURN_HELPURL = "https://en.wikipedia.org/wiki/Subroutine"; // untranslated
|
||||
/** @export */ Blockly.Msg.PROCEDURES_DEFNORETURN_PROCEDURE = "выканаць нешта";
|
||||
/** @export */ Blockly.Msg.PROCEDURES_DEFNORETURN_TITLE = "каб";
|
||||
/** @export */ Blockly.Msg.PROCEDURES_DEFNORETURN_TOOLTIP = "Стварыць працэдуру, якая ня вяртае значэнне.";
|
||||
/** @export */ Blockly.Msg.PROCEDURES_DEFRETURN_HELPURL = "https://en.wikipedia.org/wiki/Subroutine"; // untranslated
|
||||
/** @export */ Blockly.Msg.PROCEDURES_DEFRETURN_RETURN = "вярнуць";
|
||||
/** @export */ Blockly.Msg.PROCEDURES_DEFRETURN_TOOLTIP = "Стварыць працэдуру, якая вяртае значэнне.";
|
||||
/** @export */ Blockly.Msg.PROCEDURES_DEF_DUPLICATE_WARNING = "Папярэджанне: гэтая функцыя мае паўтаральныя параметры.";
|
||||
/** @export */ Blockly.Msg.PROCEDURES_HIGHLIGHT_DEF = "Вылучыць вызначэнне працэдуры";
|
||||
/** @export */ Blockly.Msg.PROCEDURES_IFRETURN_HELPURL = "http://c2.com/cgi/wiki?GuardClause"; // untranslated
|
||||
/** @export */ Blockly.Msg.PROCEDURES_IFRETURN_TOOLTIP = "Калі першае значэнне ісцінае, вяртае другое значэнне.";
|
||||
/** @export */ Blockly.Msg.PROCEDURES_IFRETURN_WARNING = "Папярэджанне: гэты блок можа выкарыстоўвацца толькі ўнутры вызначэння функцыі.";
|
||||
/** @export */ Blockly.Msg.PROCEDURES_MUTATORARG_TITLE = "імя параметра:";
|
||||
/** @export */ Blockly.Msg.PROCEDURES_MUTATORARG_TOOLTIP = "Дадаць уваходны параметр ў функцыю.";
|
||||
/** @export */ Blockly.Msg.PROCEDURES_MUTATORCONTAINER_TITLE = "параметры";
|
||||
/** @export */ Blockly.Msg.PROCEDURES_MUTATORCONTAINER_TOOLTIP = "Дадаць, выдаліць або змяніць парадак уваходных параметраў для гэтай функцыі.";
|
||||
/** @export */ Blockly.Msg.REDO = "Паўтарыць";
|
||||
/** @export */ Blockly.Msg.REMOVE_COMMENT = "Выдаліць каментар";
|
||||
/** @export */ Blockly.Msg.RENAME_VARIABLE = "Перайменаваць пераменную...";
|
||||
/** @export */ Blockly.Msg.RENAME_VARIABLE_TITLE = "Перайменаваць усе пераменныя '%1' да:";
|
||||
/** @export */ Blockly.Msg.TEXT_APPEND_HELPURL = "https://github.com/google/blockly/wiki/Text#text-modification"; // untranslated
|
||||
/** @export */ Blockly.Msg.TEXT_APPEND_TITLE = "да %1 дадаць тэкст %2";
|
||||
/** @export */ Blockly.Msg.TEXT_APPEND_TOOLTIP = "Дадаць тэкст да пераменнай '%1'.";
|
||||
/** @export */ Blockly.Msg.TEXT_CHANGECASE_HELPURL = "https://github.com/google/blockly/wiki/Text#adjusting-text-case"; // untranslated
|
||||
/** @export */ Blockly.Msg.TEXT_CHANGECASE_OPERATOR_LOWERCASE = "у малыя літары";
|
||||
/** @export */ Blockly.Msg.TEXT_CHANGECASE_OPERATOR_TITLECASE = "у Загалоўныя Пачатковыя Літары";
|
||||
/** @export */ Blockly.Msg.TEXT_CHANGECASE_OPERATOR_UPPERCASE = "у ВЯЛІКІХ ЛІТАРАЎ";
|
||||
/** @export */ Blockly.Msg.TEXT_CHANGECASE_TOOLTIP = "Вяртае копію тэксту з ВЯЛІКІМІ або малымі літарамі.";
|
||||
/** @export */ Blockly.Msg.TEXT_CHARAT_FIRST = "узяць першую літару";
|
||||
/** @export */ Blockly.Msg.TEXT_CHARAT_FROM_END = "узяць літару # з канца";
|
||||
/** @export */ Blockly.Msg.TEXT_CHARAT_FROM_START = "узяць літару #";
|
||||
/** @export */ Blockly.Msg.TEXT_CHARAT_HELPURL = "https://github.com/google/blockly/wiki/Text#extracting-text"; // untranslated
|
||||
/** @export */ Blockly.Msg.TEXT_CHARAT_LAST = "узяць апошнюю літару";
|
||||
/** @export */ Blockly.Msg.TEXT_CHARAT_RANDOM = "узяць выпадковую літару";
|
||||
/** @export */ Blockly.Msg.TEXT_CHARAT_TAIL = ""; // untranslated
|
||||
/** @export */ Blockly.Msg.TEXT_CHARAT_TITLE = "у тэксце %1 %2";
|
||||
/** @export */ Blockly.Msg.TEXT_CHARAT_TOOLTIP = "Вяртае літару ў названай пазіцыі.";
|
||||
/** @export */ Blockly.Msg.TEXT_COUNT_HELPURL = "https://github.com/google/blockly/wiki/Text#counting-substrings"; // untranslated
|
||||
/** @export */ Blockly.Msg.TEXT_COUNT_MESSAGE0 = "падлічыць колькасць %1 у %2";
|
||||
/** @export */ Blockly.Msg.TEXT_COUNT_TOOLTIP = "Падлічыць колькі разоў урывак тэксту з'яўляецца ў іншым тэксце.";
|
||||
/** @export */ Blockly.Msg.TEXT_CREATE_JOIN_ITEM_TOOLTIP = "Дадаць элемент да тэксту.";
|
||||
/** @export */ Blockly.Msg.TEXT_CREATE_JOIN_TITLE_JOIN = "спалучыць";
|
||||
/** @export */ Blockly.Msg.TEXT_CREATE_JOIN_TOOLTIP = "Дадайце, выдаліце, перастаўце фрагменты для пераробкі тэкставага блока.";
|
||||
/** @export */ Blockly.Msg.TEXT_GET_SUBSTRING_END_FROM_END = "па літару # з канца";
|
||||
/** @export */ Blockly.Msg.TEXT_GET_SUBSTRING_END_FROM_START = "па літару #";
|
||||
/** @export */ Blockly.Msg.TEXT_GET_SUBSTRING_END_LAST = "па апошнюю літару";
|
||||
/** @export */ Blockly.Msg.TEXT_GET_SUBSTRING_HELPURL = "https://github.com/google/blockly/wiki/Text#extracting-a-region-of-text"; // untranslated
|
||||
/** @export */ Blockly.Msg.TEXT_GET_SUBSTRING_INPUT_IN_TEXT = "у тэксце";
|
||||
/** @export */ Blockly.Msg.TEXT_GET_SUBSTRING_START_FIRST = "узяць падрадок з першай літары";
|
||||
/** @export */ Blockly.Msg.TEXT_GET_SUBSTRING_START_FROM_END = "узяць падрадок з літары # з канца";
|
||||
/** @export */ Blockly.Msg.TEXT_GET_SUBSTRING_START_FROM_START = "узяць падрадок з літары #";
|
||||
/** @export */ Blockly.Msg.TEXT_GET_SUBSTRING_TAIL = ""; // untranslated
|
||||
/** @export */ Blockly.Msg.TEXT_GET_SUBSTRING_TOOLTIP = "Вяртае указаную частку тэксту.";
|
||||
/** @export */ Blockly.Msg.TEXT_INDEXOF_HELPURL = "https://github.com/google/blockly/wiki/Text#finding-text"; // untranslated
|
||||
/** @export */ Blockly.Msg.TEXT_INDEXOF_OPERATOR_FIRST = "знайсці першае ўваходжанне тэксту";
|
||||
/** @export */ Blockly.Msg.TEXT_INDEXOF_OPERATOR_LAST = "знайсці апошняе ўваходжанне тэксту";
|
||||
/** @export */ Blockly.Msg.TEXT_INDEXOF_TITLE = "у тэксце %1 %2 %3";
|
||||
/** @export */ Blockly.Msg.TEXT_INDEXOF_TOOLTIP = "Вяртае нумар пазіцыі першага/апошняга ўваходжання першага тэксту ў другім. Вяртае %1, калі тэкст не знойдзены.";
|
||||
/** @export */ Blockly.Msg.TEXT_ISEMPTY_HELPURL = "https://github.com/google/blockly/wiki/Text#checking-for-empty-text"; // untranslated
|
||||
/** @export */ Blockly.Msg.TEXT_ISEMPTY_TITLE = "%1 пусты";
|
||||
/** @export */ Blockly.Msg.TEXT_ISEMPTY_TOOLTIP = "Вяртае значэнне ісціна, калі пададзены тэкст пусты.";
|
||||
/** @export */ Blockly.Msg.TEXT_JOIN_HELPURL = "https://github.com/google/blockly/wiki/Text#text-creation"; // untranslated
|
||||
/** @export */ Blockly.Msg.TEXT_JOIN_TITLE_CREATEWITH = "стварыць тэкст з";
|
||||
/** @export */ Blockly.Msg.TEXT_JOIN_TOOLTIP = "Стварае фрагмент тэксту, аб'ядноўваючы любы лік элементаў.";
|
||||
/** @export */ Blockly.Msg.TEXT_LENGTH_HELPURL = "https://github.com/google/blockly/wiki/Text#text-modification"; // untranslated
|
||||
/** @export */ Blockly.Msg.TEXT_LENGTH_TITLE = "даўжыня %1";
|
||||
/** @export */ Blockly.Msg.TEXT_LENGTH_TOOLTIP = "Вяртае колькасць сімвалаў (уключаючы прабелы) у зададзеным тэксце.";
|
||||
/** @export */ Blockly.Msg.TEXT_PRINT_HELPURL = "https://github.com/google/blockly/wiki/Text#printing-text"; // untranslated
|
||||
/** @export */ Blockly.Msg.TEXT_PRINT_TITLE = "надрукаваць %1";
|
||||
/** @export */ Blockly.Msg.TEXT_PRINT_TOOLTIP = "Друкуе тэкст, лік або іншы аб'ект.";
|
||||
/** @export */ Blockly.Msg.TEXT_PROMPT_HELPURL = "https://github.com/google/blockly/wiki/Text#getting-input-from-the-user"; // untranslated
|
||||
/** @export */ Blockly.Msg.TEXT_PROMPT_TOOLTIP_NUMBER = "Запытаць у карыстальніка лік.";
|
||||
/** @export */ Blockly.Msg.TEXT_PROMPT_TOOLTIP_TEXT = "Запытаць у карыстальніка тэкст.";
|
||||
/** @export */ Blockly.Msg.TEXT_PROMPT_TYPE_NUMBER = "запытаць лік з падказкай";
|
||||
/** @export */ Blockly.Msg.TEXT_PROMPT_TYPE_TEXT = "запытаць тэкст з падказкай";
|
||||
/** @export */ Blockly.Msg.TEXT_REPLACE_HELPURL = "https://github.com/google/blockly/wiki/Text#replacing-substrings"; // untranslated
|
||||
/** @export */ Blockly.Msg.TEXT_REPLACE_MESSAGE0 = "замяніць %1 на %2 у %3";
|
||||
/** @export */ Blockly.Msg.TEXT_REPLACE_TOOLTIP = "Замяніць усе ўваходжанні некаторага тэксту іншым тэкстам.";
|
||||
/** @export */ Blockly.Msg.TEXT_REVERSE_HELPURL = "https://github.com/google/blockly/wiki/Text#reversing-text"; // untranslated
|
||||
/** @export */ Blockly.Msg.TEXT_REVERSE_MESSAGE0 = "змяніць парадак на зваротны %1";
|
||||
/** @export */ Blockly.Msg.TEXT_REVERSE_TOOLTIP = "Мяняе парадак знакаў у тэксце на адваротны.";
|
||||
/** @export */ Blockly.Msg.TEXT_TEXT_HELPURL = "https://be.wikipedia.org/wiki/Радковы_тып";
|
||||
/** @export */ Blockly.Msg.TEXT_TEXT_TOOLTIP = "Літара, слова або радок тэксту.";
|
||||
/** @export */ Blockly.Msg.TEXT_TRIM_HELPURL = "https://github.com/google/blockly/wiki/Text#trimming-removing-spaces"; // untranslated
|
||||
/** @export */ Blockly.Msg.TEXT_TRIM_OPERATOR_BOTH = "абрэзаць прагалы з двух бакоў";
|
||||
/** @export */ Blockly.Msg.TEXT_TRIM_OPERATOR_LEFT = "абрэзаць прагалы злева";
|
||||
/** @export */ Blockly.Msg.TEXT_TRIM_OPERATOR_RIGHT = "абрэзаць прагалы справа";
|
||||
/** @export */ Blockly.Msg.TEXT_TRIM_TOOLTIP = "Вяртае копію тэксту з прагаламі, выдаленымі з аднаго або абодвух канцоў.";
|
||||
/** @export */ Blockly.Msg.TODAY = "Сёння";
|
||||
/** @export */ Blockly.Msg.UNDO = "Адкаціць";
|
||||
/** @export */ Blockly.Msg.VARIABLES_DEFAULT_NAME = "элемент";
|
||||
/** @export */ Blockly.Msg.VARIABLES_GET_CREATE_SET = "Стварыць блок \"прысабечыць\" для %1";
|
||||
/** @export */ Blockly.Msg.VARIABLES_GET_HELPURL = "https://github.com/google/blockly/wiki/Variables#get"; // untranslated
|
||||
/** @export */ Blockly.Msg.VARIABLES_GET_TOOLTIP = "Вяртае значэнне гэтай пераменнай.";
|
||||
/** @export */ Blockly.Msg.VARIABLES_SET = "прысабечыць %1 = %2";
|
||||
/** @export */ Blockly.Msg.VARIABLES_SET_CREATE_GET = "Стварыць устаўку %1";
|
||||
/** @export */ Blockly.Msg.VARIABLES_SET_HELPURL = "https://github.com/google/blockly/wiki/Variables#set"; // untranslated
|
||||
/** @export */ Blockly.Msg.VARIABLES_SET_TOOLTIP = "Прысабечвае пераменнай значэнне ўстаўкі.";
|
||||
/** @export */ Blockly.Msg.VARIABLE_ALREADY_EXISTS = "Пераменная з назвай '%1' ужо існуе.";
|
||||
/** @export */ Blockly.Msg.VARIABLE_ALREADY_EXISTS_FOR_ANOTHER_TYPE = "Назва пераменнай '%1' ужо выкарыстоўваецца іншай пераменнай тыпу '%2'.";
|
||||
/** @export */ Blockly.Msg.PROCEDURES_DEFRETURN_TITLE = Blockly.Msg.PROCEDURES_DEFNORETURN_TITLE;
|
||||
/** @export */ Blockly.Msg.CONTROLS_IF_IF_TITLE_IF = Blockly.Msg.CONTROLS_IF_MSG_IF;
|
||||
/** @export */ Blockly.Msg.CONTROLS_WHILEUNTIL_INPUT_DO = Blockly.Msg.CONTROLS_REPEAT_INPUT_DO;
|
||||
/** @export */ Blockly.Msg.CONTROLS_IF_MSG_THEN = Blockly.Msg.CONTROLS_REPEAT_INPUT_DO;
|
||||
/** @export */ Blockly.Msg.CONTROLS_IF_ELSE_TITLE_ELSE = Blockly.Msg.CONTROLS_IF_MSG_ELSE;
|
||||
/** @export */ Blockly.Msg.PROCEDURES_DEFRETURN_PROCEDURE = Blockly.Msg.PROCEDURES_DEFNORETURN_PROCEDURE;
|
||||
/** @export */ Blockly.Msg.LISTS_GET_SUBLIST_INPUT_IN_LIST = Blockly.Msg.LISTS_INLIST;
|
||||
/** @export */ Blockly.Msg.LISTS_GET_INDEX_INPUT_IN_LIST = Blockly.Msg.LISTS_INLIST;
|
||||
/** @export */ Blockly.Msg.MATH_CHANGE_TITLE_ITEM = Blockly.Msg.VARIABLES_DEFAULT_NAME;
|
||||
/** @export */ Blockly.Msg.PROCEDURES_DEFRETURN_DO = Blockly.Msg.PROCEDURES_DEFNORETURN_DO;
|
||||
/** @export */ Blockly.Msg.CONTROLS_IF_ELSEIF_TITLE_ELSEIF = Blockly.Msg.CONTROLS_IF_MSG_ELSEIF;
|
||||
/** @export */ Blockly.Msg.LISTS_GET_INDEX_HELPURL = Blockly.Msg.LISTS_INDEX_OF_HELPURL;
|
||||
/** @export */ Blockly.Msg.CONTROLS_FOREACH_INPUT_DO = Blockly.Msg.CONTROLS_REPEAT_INPUT_DO;
|
||||
/** @export */ Blockly.Msg.LISTS_SET_INDEX_INPUT_IN_LIST = Blockly.Msg.LISTS_INLIST;
|
||||
/** @export */ Blockly.Msg.CONTROLS_FOR_INPUT_DO = Blockly.Msg.CONTROLS_REPEAT_INPUT_DO;
|
||||
/** @export */ Blockly.Msg.LISTS_CREATE_WITH_ITEM_TITLE = Blockly.Msg.VARIABLES_DEFAULT_NAME;
|
||||
/** @export */ Blockly.Msg.TEXT_APPEND_VARIABLE = Blockly.Msg.VARIABLES_DEFAULT_NAME;
|
||||
/** @export */ Blockly.Msg.TEXT_CREATE_JOIN_ITEM_TITLE_ITEM = Blockly.Msg.VARIABLES_DEFAULT_NAME;
|
||||
/** @export */ Blockly.Msg.LISTS_INDEX_OF_INPUT_IN_LIST = Blockly.Msg.LISTS_INLIST;
|
||||
/** @export */ Blockly.Msg.PROCEDURES_DEFRETURN_COMMENT = Blockly.Msg.PROCEDURES_DEFNORETURN_COMMENT;
|
||||
|
||||
/** @export */ Blockly.Msg.MATH_HUE = "230";
|
||||
/** @export */ Blockly.Msg.LOOPS_HUE = "120";
|
||||
/** @export */ Blockly.Msg.LISTS_HUE = "260";
|
||||
/** @export */ Blockly.Msg.LOGIC_HUE = "210";
|
||||
/** @export */ Blockly.Msg.VARIABLES_HUE = "330";
|
||||
/** @export */ Blockly.Msg.TEXTS_HUE = "160";
|
||||
/** @export */ Blockly.Msg.PROCEDURES_HUE = "290";
|
||||
/** @export */ Blockly.Msg.COLOUR_HUE = "20";
|
||||
+1
-2
@@ -310,7 +310,6 @@ goog.require('Blockly.Msg');
|
||||
/** @export */ Blockly.Msg.PROCEDURES_MUTATORARG_TOOLTIP = "Добавяне на параметър към функцията.";
|
||||
/** @export */ Blockly.Msg.PROCEDURES_MUTATORCONTAINER_TITLE = "вход";
|
||||
/** @export */ Blockly.Msg.PROCEDURES_MUTATORCONTAINER_TOOLTIP = "Добави, премахни или пренареди входните параметри за тази функция.";
|
||||
/** @export */ Blockly.Msg.PROCEDURE_ALREADY_EXISTS = "Процедура с име '%1' вече съществува.";
|
||||
/** @export */ Blockly.Msg.REDO = "Повторение";
|
||||
/** @export */ Blockly.Msg.REMOVE_COMMENT = "Премахни коментар";
|
||||
/** @export */ Blockly.Msg.RENAME_VARIABLE = "Преименувай променливата...";
|
||||
@@ -394,7 +393,7 @@ goog.require('Blockly.Msg');
|
||||
/** @export */ Blockly.Msg.VARIABLES_SET_HELPURL = "https://github.com/google/blockly/wiki/Variables#set"; // untranslated
|
||||
/** @export */ Blockly.Msg.VARIABLES_SET_TOOLTIP = "Установява променливата със стойността на входа.";
|
||||
/** @export */ Blockly.Msg.VARIABLE_ALREADY_EXISTS = "Променлива с име '%1' вече съществува.";
|
||||
/** @export */ Blockly.Msg.VARIABLE_ALREADY_EXISTS_FOR_ANOTHER_TYPE = "A variable named '%1' already exists for another variable of type '%2'."; // untranslated
|
||||
/** @export */ Blockly.Msg.VARIABLE_ALREADY_EXISTS_FOR_ANOTHER_TYPE = "Променлива с име '%1' вече съществува за друга променлива от типа '%2'.";
|
||||
/** @export */ Blockly.Msg.PROCEDURES_DEFRETURN_TITLE = Blockly.Msg.PROCEDURES_DEFNORETURN_TITLE;
|
||||
/** @export */ Blockly.Msg.CONTROLS_IF_IF_TITLE_IF = Blockly.Msg.CONTROLS_IF_MSG_IF;
|
||||
/** @export */ Blockly.Msg.CONTROLS_WHILEUNTIL_INPUT_DO = Blockly.Msg.CONTROLS_REPEAT_INPUT_DO;
|
||||
|
||||
@@ -310,7 +310,6 @@ goog.require('Blockly.Msg');
|
||||
/** @export */ Blockly.Msg.PROCEDURES_MUTATORARG_TOOLTIP = "ক্রিয়াতে একটি ইনপুট যোগ করুন।";
|
||||
/** @export */ Blockly.Msg.PROCEDURES_MUTATORCONTAINER_TITLE = "inputs"; // untranslated
|
||||
/** @export */ Blockly.Msg.PROCEDURES_MUTATORCONTAINER_TOOLTIP = "Add, remove, or reorder inputs to this function."; // untranslated
|
||||
/** @export */ Blockly.Msg.PROCEDURE_ALREADY_EXISTS = "A procedure named '%1' already exists."; // untranslated
|
||||
/** @export */ Blockly.Msg.REDO = "পুনরায় করুন";
|
||||
/** @export */ Blockly.Msg.REMOVE_COMMENT = "মন্তব্য সরাও";
|
||||
/** @export */ Blockly.Msg.RENAME_VARIABLE = "চলকের নাম পরিবর্তন...";
|
||||
|
||||
+1
-2
@@ -140,7 +140,7 @@ goog.require('Blockly.Msg');
|
||||
/** @export */ Blockly.Msg.LISTS_LENGTH_TITLE = "hirder %1";
|
||||
/** @export */ Blockly.Msg.LISTS_LENGTH_TOOLTIP = "Distreiñ hirder ul listenn.";
|
||||
/** @export */ Blockly.Msg.LISTS_REPEAT_HELPURL = "https://github.com/google/blockly/wiki/Lists#create-list-with"; // untranslated
|
||||
/** @export */ Blockly.Msg.LISTS_REPEAT_TITLE = "Krouiñ ul listenn gant an elfenn %1 arreet div wech";
|
||||
/** @export */ Blockly.Msg.LISTS_REPEAT_TITLE = "Krouiñ ul listenn gant an elfenn %1 arreet %2 div wech";
|
||||
/** @export */ Blockly.Msg.LISTS_REPEAT_TOOLTIP = "Krouiñ ul listenn a c'hoarvez eus an dalvoudenn roet arreet an niver a wech meneget";
|
||||
/** @export */ Blockly.Msg.LISTS_REVERSE_HELPURL = "https://github.com/google/blockly/wiki/Lists#reversing-a-list";
|
||||
/** @export */ Blockly.Msg.LISTS_REVERSE_MESSAGE0 = "eilpennañ %1";
|
||||
@@ -310,7 +310,6 @@ goog.require('Blockly.Msg');
|
||||
/** @export */ Blockly.Msg.PROCEDURES_MUTATORARG_TOOLTIP = "Ouzhpennañ ur moned d'an arc'hwel.";
|
||||
/** @export */ Blockly.Msg.PROCEDURES_MUTATORCONTAINER_TITLE = "Monedoù";
|
||||
/** @export */ Blockly.Msg.PROCEDURES_MUTATORCONTAINER_TOOLTIP = "Ouzhpennañ, lemel, pe adkempenn monedoù an arc'hwel-mañ.";
|
||||
/** @export */ Blockly.Msg.PROCEDURE_ALREADY_EXISTS = "Un argerzhadur anvet '%1' zo anezhañ dija.";
|
||||
/** @export */ Blockly.Msg.REDO = "Adober";
|
||||
/** @export */ Blockly.Msg.REMOVE_COMMENT = "Lemel an evezhiadenn kuit";
|
||||
/** @export */ Blockly.Msg.RENAME_VARIABLE = "Adenvel an argemmenn...";
|
||||
|
||||
+2
-3
@@ -310,13 +310,12 @@ goog.require('Blockly.Msg');
|
||||
/** @export */ Blockly.Msg.PROCEDURES_MUTATORARG_TOOLTIP = "Afegir una entrada per la funció.";
|
||||
/** @export */ Blockly.Msg.PROCEDURES_MUTATORCONTAINER_TITLE = "entrades";
|
||||
/** @export */ Blockly.Msg.PROCEDURES_MUTATORCONTAINER_TOOLTIP = "Afegir, eliminar o canviar l'ordre de les entrades per aquesta funció.";
|
||||
/** @export */ Blockly.Msg.PROCEDURE_ALREADY_EXISTS = "A procedure named '%1' already exists."; // untranslated
|
||||
/** @export */ Blockly.Msg.REDO = "Redo"; // untranslated
|
||||
/** @export */ Blockly.Msg.REMOVE_COMMENT = "Elimina el comentari";
|
||||
/** @export */ Blockly.Msg.RENAME_VARIABLE = "Reanomena variable...";
|
||||
/** @export */ Blockly.Msg.RENAME_VARIABLE_TITLE = "Reanomena totes les variables '%1' a:";
|
||||
/** @export */ Blockly.Msg.TEXT_APPEND_HELPURL = "https://github.com/google/blockly/wiki/Text#text-modification"; // untranslated
|
||||
/** @export */ Blockly.Msg.TEXT_APPEND_TITLE = "to %1 append text %2"; // untranslated
|
||||
/** @export */ Blockly.Msg.TEXT_APPEND_TITLE = "a %1 afegir text %2";
|
||||
/** @export */ Blockly.Msg.TEXT_APPEND_TOOLTIP = "Afegir un text a la variable '%1'.";
|
||||
/** @export */ Blockly.Msg.TEXT_CHANGECASE_HELPURL = "https://github.com/google/blockly/wiki/Text#adjusting-text-case"; // untranslated
|
||||
/** @export */ Blockly.Msg.TEXT_CHANGECASE_OPERATOR_LOWERCASE = "a minúscules";
|
||||
@@ -351,7 +350,7 @@ goog.require('Blockly.Msg');
|
||||
/** @export */ Blockly.Msg.TEXT_INDEXOF_HELPURL = "https://github.com/google/blockly/wiki/Text#finding-text"; // untranslated
|
||||
/** @export */ Blockly.Msg.TEXT_INDEXOF_OPERATOR_FIRST = "trobar la primera aparició del text";
|
||||
/** @export */ Blockly.Msg.TEXT_INDEXOF_OPERATOR_LAST = "trobar l'última aparició del text";
|
||||
/** @export */ Blockly.Msg.TEXT_INDEXOF_TITLE = "in text %1 %2 %3"; // untranslated
|
||||
/** @export */ Blockly.Msg.TEXT_INDEXOF_TITLE = "en el text %1 %2 %3";
|
||||
/** @export */ Blockly.Msg.TEXT_INDEXOF_TOOLTIP = "Retorna l'índex de la primera/última aparició del primer text dins el segon. Retorna %1 si no es troba el text.";
|
||||
/** @export */ Blockly.Msg.TEXT_ISEMPTY_HELPURL = "https://github.com/google/blockly/wiki/Text#checking-for-empty-text"; // untranslated
|
||||
/** @export */ Blockly.Msg.TEXT_ISEMPTY_TITLE = "%1 està buit";
|
||||
|
||||
+2
-3
@@ -310,13 +310,12 @@ goog.require('Blockly.Msg');
|
||||
/** @export */ Blockly.Msg.PROCEDURES_MUTATORARG_TOOLTIP = "Přidat vstupy do funkce.";
|
||||
/** @export */ Blockly.Msg.PROCEDURES_MUTATORCONTAINER_TITLE = "vstupy";
|
||||
/** @export */ Blockly.Msg.PROCEDURES_MUTATORCONTAINER_TOOLTIP = "Přidat, odebrat nebo změnit pořadí vstupů této funkce.";
|
||||
/** @export */ Blockly.Msg.PROCEDURE_ALREADY_EXISTS = "A procedure named '%1' already exists."; // untranslated
|
||||
/** @export */ Blockly.Msg.REDO = "Znovu";
|
||||
/** @export */ Blockly.Msg.REMOVE_COMMENT = "Odstranit komentář";
|
||||
/** @export */ Blockly.Msg.RENAME_VARIABLE = "Přejmenovat proměnnou...";
|
||||
/** @export */ Blockly.Msg.RENAME_VARIABLE_TITLE = "Přejmenuj všech '%1' proměnných na:";
|
||||
/** @export */ Blockly.Msg.TEXT_APPEND_HELPURL = "https://github.com/google/blockly/wiki/Text#text-modification"; // untranslated
|
||||
/** @export */ Blockly.Msg.TEXT_APPEND_TITLE = "to %1 append text %2"; // untranslated
|
||||
/** @export */ Blockly.Msg.TEXT_APPEND_TITLE = "do %1 přidat text %2";
|
||||
/** @export */ Blockly.Msg.TEXT_APPEND_TOOLTIP = "Přidá určitý text k proměnné '%1'.";
|
||||
/** @export */ Blockly.Msg.TEXT_CHANGECASE_HELPURL = "https://github.com/google/blockly/wiki/Text#adjusting-text-case"; // untranslated
|
||||
/** @export */ Blockly.Msg.TEXT_CHANGECASE_OPERATOR_LOWERCASE = "na malá písmena";
|
||||
@@ -351,7 +350,7 @@ goog.require('Blockly.Msg');
|
||||
/** @export */ Blockly.Msg.TEXT_INDEXOF_HELPURL = "https://github.com/google/blockly/wiki/Text#finding-text"; // untranslated
|
||||
/** @export */ Blockly.Msg.TEXT_INDEXOF_OPERATOR_FIRST = "najít první výskyt textu";
|
||||
/** @export */ Blockly.Msg.TEXT_INDEXOF_OPERATOR_LAST = "najít poslední výskyt textu";
|
||||
/** @export */ Blockly.Msg.TEXT_INDEXOF_TITLE = "in text %1 %2 %3"; // untranslated
|
||||
/** @export */ Blockly.Msg.TEXT_INDEXOF_TITLE = "v textu %1 %2 %3";
|
||||
/** @export */ Blockly.Msg.TEXT_INDEXOF_TOOLTIP = "Vrátí index prvního/posledního výskytu prvního textu v druhém textu. Pokud text není nalezen, vypíše %1.";
|
||||
/** @export */ Blockly.Msg.TEXT_ISEMPTY_HELPURL = "https://github.com/google/blockly/wiki/Text#checking-for-empty-text"; // untranslated
|
||||
/** @export */ Blockly.Msg.TEXT_ISEMPTY_TITLE = "%1 je prázdný";
|
||||
|
||||
@@ -310,7 +310,6 @@ goog.require('Blockly.Msg');
|
||||
/** @export */ Blockly.Msg.PROCEDURES_MUTATORARG_TOOLTIP = "Tilføj en parameter til funktionen.";
|
||||
/** @export */ Blockly.Msg.PROCEDURES_MUTATORCONTAINER_TITLE = "parametre";
|
||||
/** @export */ Blockly.Msg.PROCEDURES_MUTATORCONTAINER_TOOLTIP = "Tilføje, fjerne eller ændre rækkefølgen af parametre til denne funktion.";
|
||||
/** @export */ Blockly.Msg.PROCEDURE_ALREADY_EXISTS = "En procedure navngivet »%1« findes allerede.";
|
||||
/** @export */ Blockly.Msg.REDO = "Omgør";
|
||||
/** @export */ Blockly.Msg.REMOVE_COMMENT = "Fjern kommentar";
|
||||
/** @export */ Blockly.Msg.RENAME_VARIABLE = "Omdøb variabel...";
|
||||
|
||||
@@ -310,7 +310,6 @@ goog.require('Blockly.Msg');
|
||||
/** @export */ Blockly.Msg.PROCEDURES_MUTATORARG_TOOLTIP = "Eine Eingabe zur Funktion hinzufügen.";
|
||||
/** @export */ Blockly.Msg.PROCEDURES_MUTATORCONTAINER_TITLE = "Parameter";
|
||||
/** @export */ Blockly.Msg.PROCEDURES_MUTATORCONTAINER_TOOLTIP = "Die Eingaben zu dieser Funktion hinzufügen, entfernen oder neu anordnen.";
|
||||
/** @export */ Blockly.Msg.PROCEDURE_ALREADY_EXISTS = "Eine Prozedur namens „%1“ ist bereits vorhanden.";
|
||||
/** @export */ Blockly.Msg.REDO = "Wiederholen";
|
||||
/** @export */ Blockly.Msg.REMOVE_COMMENT = "Kommentar entfernen";
|
||||
/** @export */ Blockly.Msg.RENAME_VARIABLE = "Variable umbenennen …";
|
||||
|
||||
+2
-3
@@ -310,13 +310,12 @@ goog.require('Blockly.Msg');
|
||||
/** @export */ Blockly.Msg.PROCEDURES_MUTATORARG_TOOLTIP = "Add an input to the function."; // untranslated
|
||||
/** @export */ Blockly.Msg.PROCEDURES_MUTATORCONTAINER_TITLE = "cıkewtışi";
|
||||
/** @export */ Blockly.Msg.PROCEDURES_MUTATORCONTAINER_TOOLTIP = "Add, remove, or reorder inputs to this function."; // untranslated
|
||||
/** @export */ Blockly.Msg.PROCEDURE_ALREADY_EXISTS = "A procedure named '%1' already exists."; // untranslated
|
||||
/** @export */ Blockly.Msg.REDO = "Newe ke";
|
||||
/** @export */ Blockly.Msg.REMOVE_COMMENT = "Tefsiri Wedare";
|
||||
/** @export */ Blockly.Msg.RENAME_VARIABLE = "Vuriyayey fına name ke...";
|
||||
/** @export */ Blockly.Msg.RENAME_VARIABLE_TITLE = "Pêro vırnayışê '%1' reyna name ke:";
|
||||
/** @export */ Blockly.Msg.TEXT_APPEND_HELPURL = "https://github.com/google/blockly/wiki/Text#text-modification"; // untranslated
|
||||
/** @export */ Blockly.Msg.TEXT_APPEND_TITLE = "to %1 append text %2"; // untranslated
|
||||
/** @export */ Blockly.Msg.TEXT_APPEND_TITLE = "rê %1 Metin dek %2";
|
||||
/** @export */ Blockly.Msg.TEXT_APPEND_TOOLTIP = "Append some text to variable '%1'."; // untranslated
|
||||
/** @export */ Blockly.Msg.TEXT_CHANGECASE_HELPURL = "https://github.com/google/blockly/wiki/Text#adjusting-text-case"; // untranslated
|
||||
/** @export */ Blockly.Msg.TEXT_CHANGECASE_OPERATOR_LOWERCASE = "Herfanê werdiyana";
|
||||
@@ -351,7 +350,7 @@ goog.require('Blockly.Msg');
|
||||
/** @export */ Blockly.Msg.TEXT_INDEXOF_HELPURL = "https://github.com/google/blockly/wiki/Text#finding-text"; // untranslated
|
||||
/** @export */ Blockly.Msg.TEXT_INDEXOF_OPERATOR_FIRST = "find first occurrence of text"; // untranslated
|
||||
/** @export */ Blockly.Msg.TEXT_INDEXOF_OPERATOR_LAST = "find last occurrence of text"; // untranslated
|
||||
/** @export */ Blockly.Msg.TEXT_INDEXOF_TITLE = "in text %1 %2 %3"; // untranslated
|
||||
/** @export */ Blockly.Msg.TEXT_INDEXOF_TITLE = "metın de %1 %2 %3";
|
||||
/** @export */ Blockly.Msg.TEXT_INDEXOF_TOOLTIP = "Returns the index of the first/last occurrence of the first text in the second text. Returns %1 if text is not found."; // untranslated
|
||||
/** @export */ Blockly.Msg.TEXT_ISEMPTY_HELPURL = "https://github.com/google/blockly/wiki/Text#checking-for-empty-text"; // untranslated
|
||||
/** @export */ Blockly.Msg.TEXT_ISEMPTY_TITLE = "%1 vengo";
|
||||
|
||||
+29
-30
@@ -7,9 +7,9 @@ goog.provide('Blockly.Msg.el');
|
||||
goog.require('Blockly.Msg');
|
||||
|
||||
/** @export */ Blockly.Msg.ADD_COMMENT = "Πρόσθεσε Το Σχόλιο";
|
||||
/** @export */ Blockly.Msg.CANNOT_DELETE_VARIABLE_PROCEDURE = "Can't delete the variable '%1' because it's part of the definition of the function '%2'"; // untranslated
|
||||
/** @export */ Blockly.Msg.CANNOT_DELETE_VARIABLE_PROCEDURE = "Δεν μπορώ να διαγράψω την μεταβλητή '%1' διότι είναι μέρος του ορισμού της λειτουργίας '%2'";
|
||||
/** @export */ Blockly.Msg.CHANGE_VALUE_TITLE = "Άλλαξε την τιμή:";
|
||||
/** @export */ Blockly.Msg.CLEAN_UP = "Clean up Blocks"; // untranslated
|
||||
/** @export */ Blockly.Msg.CLEAN_UP = "Ταξινομείστε τα Μπλοκ";
|
||||
/** @export */ Blockly.Msg.COLLAPSE_ALL = "Σύμπτυξε Όλα Τα Μπλοκ";
|
||||
/** @export */ Blockly.Msg.COLLAPSE_BLOCK = "Σύμπτυξε Το Μπλοκ";
|
||||
/** @export */ Blockly.Msg.COLOUR_BLEND_COLOUR1 = "χρώμα 1";
|
||||
@@ -63,8 +63,8 @@ goog.require('Blockly.Msg');
|
||||
/** @export */ Blockly.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_WHILE = "Ενόσω μια τιμή είναι αληθής, τότε εκτελεί κάποιες εντολές.";
|
||||
/** @export */ Blockly.Msg.DELETE_ALL_BLOCKS = "Να διαγραφούν και τα %1 μπλοκ;";
|
||||
/** @export */ Blockly.Msg.DELETE_BLOCK = "Διάγραψε Το Μπλοκ";
|
||||
/** @export */ Blockly.Msg.DELETE_VARIABLE = "Delete the '%1' variable"; // untranslated
|
||||
/** @export */ Blockly.Msg.DELETE_VARIABLE_CONFIRMATION = "Delete %1 uses of the '%2' variable?"; // untranslated
|
||||
/** @export */ Blockly.Msg.DELETE_VARIABLE = "Διαγράψετε την μεταβλητή '%1'";
|
||||
/** @export */ Blockly.Msg.DELETE_VARIABLE_CONFIRMATION = "Θέλετε να διαγράψετε το %1 που χρησιμοποιείτε της μεταβλητής '%2'?";
|
||||
/** @export */ Blockly.Msg.DELETE_X_BLOCKS = "Διάγραψε %1 Μπλοκ";
|
||||
/** @export */ Blockly.Msg.DISABLE_BLOCK = "Απενεργοποίησε Το Μπλοκ";
|
||||
/** @export */ Blockly.Msg.DUPLICATE_BLOCK = "Διπλότυπο";
|
||||
@@ -74,19 +74,19 @@ goog.require('Blockly.Msg');
|
||||
/** @export */ Blockly.Msg.EXTERNAL_INPUTS = "Εξωτερικές Είσοδοι";
|
||||
/** @export */ Blockly.Msg.HELP = "Βοήθεια";
|
||||
/** @export */ Blockly.Msg.INLINE_INPUTS = "Εσωτερικές Είσοδοι";
|
||||
/** @export */ Blockly.Msg.IOS_CANCEL = "Cancel"; // untranslated
|
||||
/** @export */ Blockly.Msg.IOS_CANCEL = "Ακυρώστε";
|
||||
/** @export */ Blockly.Msg.IOS_ERROR = "Σφάλμα";
|
||||
/** @export */ Blockly.Msg.IOS_OK = "ΟΚ";
|
||||
/** @export */ Blockly.Msg.IOS_PROCEDURES_ADD_INPUT = "+ Add Input"; // untranslated
|
||||
/** @export */ Blockly.Msg.IOS_PROCEDURES_ALLOW_STATEMENTS = "Allow statements"; // untranslated
|
||||
/** @export */ Blockly.Msg.IOS_PROCEDURES_DUPLICATE_INPUTS_ERROR = "This function has duplicate inputs."; // untranslated
|
||||
/** @export */ Blockly.Msg.IOS_PROCEDURES_INPUTS = "INPUTS"; // untranslated
|
||||
/** @export */ Blockly.Msg.IOS_PROCEDURES_ADD_INPUT = "Εισάγετε στοιχείο";
|
||||
/** @export */ Blockly.Msg.IOS_PROCEDURES_ALLOW_STATEMENTS = "Να επιτρέπονται οι δηλώσεις";
|
||||
/** @export */ Blockly.Msg.IOS_PROCEDURES_DUPLICATE_INPUTS_ERROR = "Αυτή η παράμετρος απαιτεί διπλή εισαγωγή στοιχείων";
|
||||
/** @export */ Blockly.Msg.IOS_PROCEDURES_INPUTS = "ΕΙΣΑΓΟΜΕΝΑ ΣΤΟΙΧΕΙΑ";
|
||||
/** @export */ Blockly.Msg.IOS_VARIABLES_ADD_BUTTON = "Προσθήκη";
|
||||
/** @export */ Blockly.Msg.IOS_VARIABLES_ADD_VARIABLE = "+ Add Variable"; // untranslated
|
||||
/** @export */ Blockly.Msg.IOS_VARIABLES_ADD_VARIABLE = "Προσθέσατε Μεταβλητή";
|
||||
/** @export */ Blockly.Msg.IOS_VARIABLES_DELETE_BUTTON = "Διαγραφή";
|
||||
/** @export */ Blockly.Msg.IOS_VARIABLES_EMPTY_NAME_ERROR = "You can't use an empty variable name."; // untranslated
|
||||
/** @export */ Blockly.Msg.IOS_VARIABLES_RENAME_BUTTON = "Rename"; // untranslated
|
||||
/** @export */ Blockly.Msg.IOS_VARIABLES_VARIABLE_NAME = "Variable name"; // untranslated
|
||||
/** @export */ Blockly.Msg.IOS_VARIABLES_EMPTY_NAME_ERROR = "Δεν μπορείτε να χρησιμοποιήσετε μια μεταβλητή δίχως όνομα";
|
||||
/** @export */ Blockly.Msg.IOS_VARIABLES_RENAME_BUTTON = "Αλλάξετε το όνομα του αρχείου";
|
||||
/** @export */ Blockly.Msg.IOS_VARIABLES_VARIABLE_NAME = "Όνομα μεταβλητής";
|
||||
/** @export */ Blockly.Msg.LISTS_CREATE_EMPTY_HELPURL = "https://github.com/google/blockly/wiki/Lists#create-empty-list";
|
||||
/** @export */ Blockly.Msg.LISTS_CREATE_EMPTY_TITLE = "δημιούργησε κενή λίστα";
|
||||
/** @export */ Blockly.Msg.LISTS_CREATE_EMPTY_TOOLTIP = "Επιστρέφει μια λίστα, με μήκος 0, η οποία δεν περιέχει εγγραφές δεδομένων";
|
||||
@@ -143,8 +143,8 @@ goog.require('Blockly.Msg');
|
||||
/** @export */ Blockly.Msg.LISTS_REPEAT_TITLE = "δημιούργησε λίστα με το στοιχείο %1 να επαναλαμβάνεται %2 φορές";
|
||||
/** @export */ Blockly.Msg.LISTS_REPEAT_TOOLTIP = "Δημιουργεί μια λίστα που αποτελείται από την δεδομένη τιμή που επαναλαμβάνεται για συγκεκριμένο αριθμό επαναλήψεων.";
|
||||
/** @export */ Blockly.Msg.LISTS_REVERSE_HELPURL = "https://github.com/google/blockly/wiki/Lists#reversing-a-list"; // untranslated
|
||||
/** @export */ Blockly.Msg.LISTS_REVERSE_MESSAGE0 = "reverse %1"; // untranslated
|
||||
/** @export */ Blockly.Msg.LISTS_REVERSE_TOOLTIP = "Reverse a copy of a list."; // untranslated
|
||||
/** @export */ Blockly.Msg.LISTS_REVERSE_MESSAGE0 = "ανάκληση %1";
|
||||
/** @export */ Blockly.Msg.LISTS_REVERSE_TOOLTIP = "Α";
|
||||
/** @export */ Blockly.Msg.LISTS_SET_INDEX_HELPURL = "https://github.com/google/blockly/wiki/Lists#in-list--set"; // untranslated
|
||||
/** @export */ Blockly.Msg.LISTS_SET_INDEX_INPUT_TO = "σε";
|
||||
/** @export */ Blockly.Msg.LISTS_SET_INDEX_INSERT = "είσαγε στο";
|
||||
@@ -160,9 +160,9 @@ goog.require('Blockly.Msg');
|
||||
/** @export */ Blockly.Msg.LISTS_SORT_HELPURL = "https://github.com/google/blockly/wiki/Lists#sorting-a-list";
|
||||
/** @export */ Blockly.Msg.LISTS_SORT_ORDER_ASCENDING = "Αύξουσα";
|
||||
/** @export */ Blockly.Msg.LISTS_SORT_ORDER_DESCENDING = "Φθίνουσα";
|
||||
/** @export */ Blockly.Msg.LISTS_SORT_TITLE = "sort %1 %2 %3"; // untranslated
|
||||
/** @export */ Blockly.Msg.LISTS_SORT_TOOLTIP = "Sort a copy of a list."; // untranslated
|
||||
/** @export */ Blockly.Msg.LISTS_SORT_TYPE_IGNORECASE = "alphabetic, ignore case"; // untranslated
|
||||
/** @export */ Blockly.Msg.LISTS_SORT_TITLE = "επιλογή %1 %2 % 3";
|
||||
/** @export */ Blockly.Msg.LISTS_SORT_TOOLTIP = "Επιλέξετε ένα αντίγραφο της λίστας.";
|
||||
/** @export */ Blockly.Msg.LISTS_SORT_TYPE_IGNORECASE = "αλφαβητικά, αγνοήστε το στοιχείο";
|
||||
/** @export */ Blockly.Msg.LISTS_SORT_TYPE_NUMERIC = "αριθμητικό";
|
||||
/** @export */ Blockly.Msg.LISTS_SORT_TYPE_TEXT = "Αλφαβητικά";
|
||||
/** @export */ Blockly.Msg.LISTS_SPLIT_HELPURL = "https://github.com/google/blockly/wiki/Lists#splitting-strings-and-joining-lists"; // untranslated
|
||||
@@ -281,7 +281,7 @@ goog.require('Blockly.Msg');
|
||||
/** @export */ Blockly.Msg.MATH_TRIG_TOOLTIP_COS = "Επιστρέφει το συνημίτονο ενός βαθμού (όχι ακτινίου).";
|
||||
/** @export */ Blockly.Msg.MATH_TRIG_TOOLTIP_SIN = "Επιστρέφει το ημίτονο ενός βαθμού (όχι ακτινίου).";
|
||||
/** @export */ Blockly.Msg.MATH_TRIG_TOOLTIP_TAN = "Επιστρέφει την εφαπτομένη ενός βαθμού (όχι ακτινίου).";
|
||||
/** @export */ Blockly.Msg.NEW_VARIABLE = "Νέα μεταβλητή...";
|
||||
/** @export */ Blockly.Msg.NEW_VARIABLE = "Δημιουργείστε μεταβλητή";
|
||||
/** @export */ Blockly.Msg.NEW_VARIABLE_TITLE = "Νέο όνομα μεταβλητής:";
|
||||
/** @export */ Blockly.Msg.ORDINAL_NUMBER_SUFFIX = ""; // untranslated
|
||||
/** @export */ Blockly.Msg.PROCEDURES_ALLOW_STATEMENTS = "να επιτρέπονται οι δηλώσεις";
|
||||
@@ -292,7 +292,7 @@ goog.require('Blockly.Msg');
|
||||
/** @export */ Blockly.Msg.PROCEDURES_CALLRETURN_TOOLTIP = "Εκτελεί την ορισμένη από τον χρήστη συνάρτηση «%1» και χρησιμοποίησε την έξοδό της.";
|
||||
/** @export */ Blockly.Msg.PROCEDURES_CALL_BEFORE_PARAMS = "με:";
|
||||
/** @export */ Blockly.Msg.PROCEDURES_CREATE_DO = "Δημιούργησε «%1»";
|
||||
/** @export */ Blockly.Msg.PROCEDURES_DEFNORETURN_COMMENT = "Describe this function..."; // untranslated
|
||||
/** @export */ Blockly.Msg.PROCEDURES_DEFNORETURN_COMMENT = "Περιγράψετε αυτήν την ιδιότητα..";
|
||||
/** @export */ Blockly.Msg.PROCEDURES_DEFNORETURN_DO = ""; // untranslated
|
||||
/** @export */ Blockly.Msg.PROCEDURES_DEFNORETURN_HELPURL = "https://en.wikipedia.org/wiki/Procedure_%28computer_science%29";
|
||||
/** @export */ Blockly.Msg.PROCEDURES_DEFNORETURN_PROCEDURE = "κάνε κάτι";
|
||||
@@ -310,13 +310,12 @@ goog.require('Blockly.Msg');
|
||||
/** @export */ Blockly.Msg.PROCEDURES_MUTATORARG_TOOLTIP = "Πρόσθεσε μια είσοδος στη συνάρτηση";
|
||||
/** @export */ Blockly.Msg.PROCEDURES_MUTATORCONTAINER_TITLE = "είσοδοι";
|
||||
/** @export */ Blockly.Msg.PROCEDURES_MUTATORCONTAINER_TOOLTIP = "Προσθέτει, αφαιρεί ή αναδιατάσσει εισόδους σε αυτήν τη λειτουργία";
|
||||
/** @export */ Blockly.Msg.PROCEDURE_ALREADY_EXISTS = "A procedure named '%1' already exists."; // untranslated
|
||||
/** @export */ Blockly.Msg.REDO = "Ακύρωση αναίρεσης";
|
||||
/** @export */ Blockly.Msg.REMOVE_COMMENT = "Αφαίρεσε Το Σχόλιο";
|
||||
/** @export */ Blockly.Msg.RENAME_VARIABLE = "Μετονόμασε τη μεταβλητή...";
|
||||
/** @export */ Blockly.Msg.RENAME_VARIABLE_TITLE = "Μετονόμασε όλες τις μεταβλητές «%1» σε:";
|
||||
/** @export */ Blockly.Msg.TEXT_APPEND_HELPURL = "https://github.com/google/blockly/wiki/Text#text-modification"; // untranslated
|
||||
/** @export */ Blockly.Msg.TEXT_APPEND_TITLE = "to %1 append text %2"; // untranslated
|
||||
/** @export */ Blockly.Msg.TEXT_APPEND_TITLE = "έως %1 ανάθεσε κείμενο %2";
|
||||
/** @export */ Blockly.Msg.TEXT_APPEND_TOOLTIP = "Αναθέτει κείμενο στη μεταβλητή «%1».";
|
||||
/** @export */ Blockly.Msg.TEXT_CHANGECASE_HELPURL = "https://github.com/google/blockly/wiki/Text#adjusting-text-case"; // untranslated
|
||||
/** @export */ Blockly.Msg.TEXT_CHANGECASE_OPERATOR_LOWERCASE = "σε πεζά";
|
||||
@@ -330,10 +329,10 @@ goog.require('Blockly.Msg');
|
||||
/** @export */ Blockly.Msg.TEXT_CHARAT_LAST = "πάρε το τελευταίο γράμμα";
|
||||
/** @export */ Blockly.Msg.TEXT_CHARAT_RANDOM = "πάρε τυχαίο γράμμα";
|
||||
/** @export */ Blockly.Msg.TEXT_CHARAT_TAIL = ""; // untranslated
|
||||
/** @export */ Blockly.Msg.TEXT_CHARAT_TITLE = "in text %1 %2"; // untranslated
|
||||
/** @export */ Blockly.Msg.TEXT_CHARAT_TITLE = "στο κείμενο %1 %2";
|
||||
/** @export */ Blockly.Msg.TEXT_CHARAT_TOOLTIP = "Επιστρέφει το γράμμα στην καθορισμένη θέση.";
|
||||
/** @export */ Blockly.Msg.TEXT_COUNT_HELPURL = "https://github.com/google/blockly/wiki/Text#counting-substrings"; // untranslated
|
||||
/** @export */ Blockly.Msg.TEXT_COUNT_MESSAGE0 = "count %1 in %2"; // untranslated
|
||||
/** @export */ Blockly.Msg.TEXT_COUNT_MESSAGE0 = "αριθμός %1 σε %2";
|
||||
/** @export */ Blockly.Msg.TEXT_COUNT_TOOLTIP = "Μετρά πόσες φορές κάποιο κείμενο εμφανίζεται μέσα σε ένα άλλο κείμενο.";
|
||||
/** @export */ Blockly.Msg.TEXT_CREATE_JOIN_ITEM_TOOLTIP = "Προσθέτει ένα στοιχείο στο κείμενο.";
|
||||
/** @export */ Blockly.Msg.TEXT_CREATE_JOIN_TITLE_JOIN = "ένωσε";
|
||||
@@ -351,7 +350,7 @@ goog.require('Blockly.Msg');
|
||||
/** @export */ Blockly.Msg.TEXT_INDEXOF_HELPURL = "https://github.com/google/blockly/wiki/Text#finding-text"; // untranslated
|
||||
/** @export */ Blockly.Msg.TEXT_INDEXOF_OPERATOR_FIRST = "βρες την πρώτη εμφάνιση του κειμένου";
|
||||
/** @export */ Blockly.Msg.TEXT_INDEXOF_OPERATOR_LAST = "βρες την τελευταία εμφάνιση του κειμένου";
|
||||
/** @export */ Blockly.Msg.TEXT_INDEXOF_TITLE = "in text %1 %2 %3"; // untranslated
|
||||
/** @export */ Blockly.Msg.TEXT_INDEXOF_TITLE = "στο κείμενο %1 %2 %3";
|
||||
/** @export */ Blockly.Msg.TEXT_INDEXOF_TOOLTIP = "Επιστρέφει τον δείκτη της πρώτης/τελευταίας εμφάνισης του πρώτου κειμένου στο δεύτερο κείμενο. Επιστρέφει τιμή %1, αν δε βρει το κείμενο.";
|
||||
/** @export */ Blockly.Msg.TEXT_ISEMPTY_HELPURL = "https://github.com/google/blockly/wiki/Text#checking-for-empty-text"; // untranslated
|
||||
/** @export */ Blockly.Msg.TEXT_ISEMPTY_TITLE = "το %1 είναι κενό";
|
||||
@@ -371,11 +370,11 @@ goog.require('Blockly.Msg');
|
||||
/** @export */ Blockly.Msg.TEXT_PROMPT_TYPE_NUMBER = "πρότρεψε με μήνυμα για να δοθεί αριθμός";
|
||||
/** @export */ Blockly.Msg.TEXT_PROMPT_TYPE_TEXT = "πρότρεψε με μήνυμα για να δοθεί κείμενο";
|
||||
/** @export */ Blockly.Msg.TEXT_REPLACE_HELPURL = "https://github.com/google/blockly/wiki/Text#replacing-substrings"; // untranslated
|
||||
/** @export */ Blockly.Msg.TEXT_REPLACE_MESSAGE0 = "replace %1 with %2 in %3"; // untranslated
|
||||
/** @export */ Blockly.Msg.TEXT_REPLACE_TOOLTIP = "Replace all occurances of some text within some other text."; // untranslated
|
||||
/** @export */ Blockly.Msg.TEXT_REPLACE_MESSAGE0 = "αντικαταστήσετε το %1 με %2 σε %3";
|
||||
/** @export */ Blockly.Msg.TEXT_REPLACE_TOOLTIP = "Αντικαταστήστε όλα τα ήδη υπάρχοντα στοιχεία μέρους του κειμένου με κάποιο άλλο κείμενο";
|
||||
/** @export */ Blockly.Msg.TEXT_REVERSE_HELPURL = "https://github.com/google/blockly/wiki/Text#reversing-text"; // untranslated
|
||||
/** @export */ Blockly.Msg.TEXT_REVERSE_MESSAGE0 = "reverse %1"; // untranslated
|
||||
/** @export */ Blockly.Msg.TEXT_REVERSE_TOOLTIP = "Reverses the order of the characters in the text."; // untranslated
|
||||
/** @export */ Blockly.Msg.TEXT_REVERSE_MESSAGE0 = "ανάκληση %1";
|
||||
/** @export */ Blockly.Msg.TEXT_REVERSE_TOOLTIP = "Αναγραμματισμός των χαρακτήρων του κειμένου";
|
||||
/** @export */ Blockly.Msg.TEXT_TEXT_HELPURL = "https://el.wikipedia.org/wiki/%CE%A3%CF%85%CE%BC%CE%B2%CE%BF%CE%BB%CE%BF%CF%83%CE%B5%CE%B9%CF%81%CE%AC";
|
||||
/** @export */ Blockly.Msg.TEXT_TEXT_TOOLTIP = "Ένα γράμμα, μια λέξη ή μια γραμμή κειμένου.";
|
||||
/** @export */ Blockly.Msg.TEXT_TRIM_HELPURL = "https://github.com/google/blockly/wiki/Text#trimming-removing-spaces"; // untranslated
|
||||
@@ -394,7 +393,7 @@ goog.require('Blockly.Msg');
|
||||
/** @export */ Blockly.Msg.VARIABLES_SET_HELPURL = "https://github.com/google/blockly/wiki/Variables#set"; // untranslated
|
||||
/** @export */ Blockly.Msg.VARIABLES_SET_TOOLTIP = "Ορίζει αυτή τη μεταβλητή να είναι ίση με την είσοδο.";
|
||||
/** @export */ Blockly.Msg.VARIABLE_ALREADY_EXISTS = "Η μεταβλητή με το όνομα \"%1\" υπάρχει ήδη";
|
||||
/** @export */ Blockly.Msg.VARIABLE_ALREADY_EXISTS_FOR_ANOTHER_TYPE = "A variable named '%1' already exists for another variable of type '%2'."; // untranslated
|
||||
/** @export */ Blockly.Msg.VARIABLE_ALREADY_EXISTS_FOR_ANOTHER_TYPE = "Μια μεταβλητή με όνομα '%1' υπάρχει πάντα για μια άλλη μεταβλητή τύπου '%2'.";
|
||||
/** @export */ Blockly.Msg.PROCEDURES_DEFRETURN_TITLE = Blockly.Msg.PROCEDURES_DEFNORETURN_TITLE;
|
||||
/** @export */ Blockly.Msg.CONTROLS_IF_IF_TITLE_IF = Blockly.Msg.CONTROLS_IF_MSG_IF;
|
||||
/** @export */ Blockly.Msg.CONTROLS_WHILEUNTIL_INPUT_DO = Blockly.Msg.CONTROLS_REPEAT_INPUT_DO;
|
||||
|
||||
@@ -310,7 +310,6 @@ goog.require('Blockly.Msg');
|
||||
/** @export */ Blockly.Msg.PROCEDURES_MUTATORARG_TOOLTIP = "Add an input to the function."; // untranslated
|
||||
/** @export */ Blockly.Msg.PROCEDURES_MUTATORCONTAINER_TITLE = "inputs"; // untranslated
|
||||
/** @export */ Blockly.Msg.PROCEDURES_MUTATORCONTAINER_TOOLTIP = "Add, remove, or reorder inputs to this function."; // untranslated
|
||||
/** @export */ Blockly.Msg.PROCEDURE_ALREADY_EXISTS = "A procedure named '%1' already exists."; // untranslated
|
||||
/** @export */ Blockly.Msg.REDO = "Redo";
|
||||
/** @export */ Blockly.Msg.REMOVE_COMMENT = "Remove Comment";
|
||||
/** @export */ Blockly.Msg.RENAME_VARIABLE = "Rename variable...";
|
||||
|
||||
@@ -310,7 +310,6 @@ goog.require('Blockly.Msg');
|
||||
/** @export */ Blockly.Msg.PROCEDURES_MUTATORARG_TOOLTIP = "Add an input to the function.";
|
||||
/** @export */ Blockly.Msg.PROCEDURES_MUTATORCONTAINER_TITLE = "inputs";
|
||||
/** @export */ Blockly.Msg.PROCEDURES_MUTATORCONTAINER_TOOLTIP = "Add, remove, or reorder inputs to this function.";
|
||||
/** @export */ Blockly.Msg.PROCEDURE_ALREADY_EXISTS = "A procedure named '%1' already exists.";
|
||||
/** @export */ Blockly.Msg.REDO = "Redo";
|
||||
/** @export */ Blockly.Msg.REMOVE_COMMENT = "Remove Comment";
|
||||
/** @export */ Blockly.Msg.RENAME_VARIABLE = "Rename variable...";
|
||||
|
||||
+1
-2
@@ -310,7 +310,6 @@ goog.require('Blockly.Msg');
|
||||
/** @export */ Blockly.Msg.PROCEDURES_MUTATORARG_TOOLTIP = "Add an input to the function."; // untranslated
|
||||
/** @export */ Blockly.Msg.PROCEDURES_MUTATORCONTAINER_TITLE = "inputs"; // untranslated
|
||||
/** @export */ Blockly.Msg.PROCEDURES_MUTATORCONTAINER_TOOLTIP = "Add, remove, or reorder inputs to this function."; // untranslated
|
||||
/** @export */ Blockly.Msg.PROCEDURE_ALREADY_EXISTS = "A procedure named '%1' already exists."; // untranslated
|
||||
/** @export */ Blockly.Msg.REDO = "Refari";
|
||||
/** @export */ Blockly.Msg.REMOVE_COMMENT = "Forigi komenton";
|
||||
/** @export */ Blockly.Msg.RENAME_VARIABLE = "Renomi varianton...";
|
||||
@@ -351,7 +350,7 @@ goog.require('Blockly.Msg');
|
||||
/** @export */ Blockly.Msg.TEXT_INDEXOF_HELPURL = "https://github.com/google/blockly/wiki/Text#finding-text"; // untranslated
|
||||
/** @export */ Blockly.Msg.TEXT_INDEXOF_OPERATOR_FIRST = "find first occurrence of text"; // untranslated
|
||||
/** @export */ Blockly.Msg.TEXT_INDEXOF_OPERATOR_LAST = "find last occurrence of text"; // untranslated
|
||||
/** @export */ Blockly.Msg.TEXT_INDEXOF_TITLE = "in text %1 %2 %3"; // untranslated
|
||||
/** @export */ Blockly.Msg.TEXT_INDEXOF_TITLE = "en la teksto %1 %2 %3";
|
||||
/** @export */ Blockly.Msg.TEXT_INDEXOF_TOOLTIP = "Returns the index of the first/last occurrence of the first text in the second text. Returns %1 if text is not found."; // untranslated
|
||||
/** @export */ Blockly.Msg.TEXT_ISEMPTY_HELPURL = "https://github.com/google/blockly/wiki/Text#checking-for-empty-text"; // untranslated
|
||||
/** @export */ Blockly.Msg.TEXT_ISEMPTY_TITLE = "%1 malplenas";
|
||||
|
||||
@@ -310,7 +310,6 @@ goog.require('Blockly.Msg');
|
||||
/** @export */ Blockly.Msg.PROCEDURES_MUTATORARG_TOOLTIP = "Añadir una entrada a la función.";
|
||||
/** @export */ Blockly.Msg.PROCEDURES_MUTATORCONTAINER_TITLE = "entradas";
|
||||
/** @export */ Blockly.Msg.PROCEDURES_MUTATORCONTAINER_TOOLTIP = "Añadir, eliminar o reordenar entradas para esta función.";
|
||||
/** @export */ Blockly.Msg.PROCEDURE_ALREADY_EXISTS = "Ya existe un procedimiento llamado \"%1\".";
|
||||
/** @export */ Blockly.Msg.REDO = "Rehacer";
|
||||
/** @export */ Blockly.Msg.REMOVE_COMMENT = "Eliminar comentario";
|
||||
/** @export */ Blockly.Msg.RENAME_VARIABLE = "Renombrar la variable…";
|
||||
|
||||
+2
-3
@@ -310,13 +310,12 @@ goog.require('Blockly.Msg');
|
||||
/** @export */ Blockly.Msg.PROCEDURES_MUTATORARG_TOOLTIP = "Lisab funktsioonile sisendi.";
|
||||
/** @export */ Blockly.Msg.PROCEDURES_MUTATORCONTAINER_TITLE = "sisendid";
|
||||
/** @export */ Blockly.Msg.PROCEDURES_MUTATORCONTAINER_TOOLTIP = "Funktsiooni sisendite lisamine, eemaldamine või järjestuse muutmine.";
|
||||
/** @export */ Blockly.Msg.PROCEDURE_ALREADY_EXISTS = "A procedure named '%1' already exists."; // untranslated
|
||||
/** @export */ Blockly.Msg.REDO = "Tee uuesti";
|
||||
/** @export */ Blockly.Msg.REMOVE_COMMENT = "Eemalda kommentaar";
|
||||
/** @export */ Blockly.Msg.RENAME_VARIABLE = "Nimeta muutuja ümber ...";
|
||||
/** @export */ Blockly.Msg.RENAME_VARIABLE_TITLE = "Muutuja „%1“ uus nimi:";
|
||||
/** @export */ Blockly.Msg.TEXT_APPEND_HELPURL = "https://github.com/google/blockly/wiki/Text#text-modification"; // untranslated
|
||||
/** @export */ Blockly.Msg.TEXT_APPEND_TITLE = "to %1 append text %2"; // untranslated
|
||||
/** @export */ Blockly.Msg.TEXT_APPEND_TITLE = "lisa muutuja %1 lõppu tekst %2";
|
||||
/** @export */ Blockly.Msg.TEXT_APPEND_TOOLTIP = "Lisab teksti muutuja „%1“ väärtuse lõppu.";
|
||||
/** @export */ Blockly.Msg.TEXT_CHANGECASE_HELPURL = "https://github.com/google/blockly/wiki/Text#adjusting-text-case"; // untranslated
|
||||
/** @export */ Blockly.Msg.TEXT_CHANGECASE_OPERATOR_LOWERCASE = "väikeste tähtedega";
|
||||
@@ -351,7 +350,7 @@ goog.require('Blockly.Msg');
|
||||
/** @export */ Blockly.Msg.TEXT_INDEXOF_HELPURL = "https://github.com/google/blockly/wiki/Text#finding-text"; // untranslated
|
||||
/** @export */ Blockly.Msg.TEXT_INDEXOF_OPERATOR_FIRST = "esimese leitud tekstitüki";
|
||||
/** @export */ Blockly.Msg.TEXT_INDEXOF_OPERATOR_LAST = "viimase leitud tekstitüki";
|
||||
/** @export */ Blockly.Msg.TEXT_INDEXOF_TITLE = "in text %1 %2 %3"; // untranslated
|
||||
/** @export */ Blockly.Msg.TEXT_INDEXOF_TITLE = "tekstist %1 %2 %3 asukoht";
|
||||
/** @export */ Blockly.Msg.TEXT_INDEXOF_TOOLTIP = "Tagastab esimesest tekstist esimese/viimase leitud teise teksti asukoha (indeksi). Kui teksti ei leita, tagastab %1.";
|
||||
/** @export */ Blockly.Msg.TEXT_ISEMPTY_HELPURL = "https://github.com/google/blockly/wiki/Text#checking-for-empty-text"; // untranslated
|
||||
/** @export */ Blockly.Msg.TEXT_ISEMPTY_TITLE = "%1 on tühi";
|
||||
|
||||
+6
-7
@@ -78,8 +78,8 @@ goog.require('Blockly.Msg');
|
||||
/** @export */ Blockly.Msg.IOS_ERROR = "خطا";
|
||||
/** @export */ Blockly.Msg.IOS_OK = "تأیید";
|
||||
/** @export */ Blockly.Msg.IOS_PROCEDURES_ADD_INPUT = "+ افزودن ورودی";
|
||||
/** @export */ Blockly.Msg.IOS_PROCEDURES_ALLOW_STATEMENTS = "Allow statements"; // untranslated
|
||||
/** @export */ Blockly.Msg.IOS_PROCEDURES_DUPLICATE_INPUTS_ERROR = "This function has duplicate inputs."; // untranslated
|
||||
/** @export */ Blockly.Msg.IOS_PROCEDURES_ALLOW_STATEMENTS = "اجازه اظهارات";
|
||||
/** @export */ Blockly.Msg.IOS_PROCEDURES_DUPLICATE_INPUTS_ERROR = "این تابع دارای ورودیهای تکراری است.";
|
||||
/** @export */ Blockly.Msg.IOS_PROCEDURES_INPUTS = "ورودیها";
|
||||
/** @export */ Blockly.Msg.IOS_VARIABLES_ADD_BUTTON = "افزودن";
|
||||
/** @export */ Blockly.Msg.IOS_VARIABLES_ADD_VARIABLE = "+ افزودن متغیر";
|
||||
@@ -144,7 +144,7 @@ goog.require('Blockly.Msg');
|
||||
/** @export */ Blockly.Msg.LISTS_REPEAT_TOOLTIP = "فهرستی شامل مقادیر دادهشدهٔ تکرار شده عدد مشخصشده میسازد.";
|
||||
/** @export */ Blockly.Msg.LISTS_REVERSE_HELPURL = "https://github.com/google/blockly/wiki/Lists#reversing-a-list"; // untranslated
|
||||
/** @export */ Blockly.Msg.LISTS_REVERSE_MESSAGE0 = "معکوس %1";
|
||||
/** @export */ Blockly.Msg.LISTS_REVERSE_TOOLTIP = "Reverse a copy of a list."; // untranslated
|
||||
/** @export */ Blockly.Msg.LISTS_REVERSE_TOOLTIP = "یک کپی از لیست را معکوس کنید.";
|
||||
/** @export */ Blockly.Msg.LISTS_SET_INDEX_HELPURL = "https://github.com/google/blockly/wiki/Lists#in-list--set"; // untranslated
|
||||
/** @export */ Blockly.Msg.LISTS_SET_INDEX_INPUT_TO = "به عنوان";
|
||||
/** @export */ Blockly.Msg.LISTS_SET_INDEX_INSERT = "درج در";
|
||||
@@ -161,7 +161,7 @@ goog.require('Blockly.Msg');
|
||||
/** @export */ Blockly.Msg.LISTS_SORT_ORDER_ASCENDING = "صعودی";
|
||||
/** @export */ Blockly.Msg.LISTS_SORT_ORDER_DESCENDING = "نزولی";
|
||||
/** @export */ Blockly.Msg.LISTS_SORT_TITLE = "sort %1 %2 %3"; // untranslated
|
||||
/** @export */ Blockly.Msg.LISTS_SORT_TOOLTIP = "Sort a copy of a list."; // untranslated
|
||||
/** @export */ Blockly.Msg.LISTS_SORT_TOOLTIP = "یک کپی از لیست را مرتب کنید.";
|
||||
/** @export */ Blockly.Msg.LISTS_SORT_TYPE_IGNORECASE = "حروفی ، رد کردن مورد";
|
||||
/** @export */ Blockly.Msg.LISTS_SORT_TYPE_NUMERIC = "عددی";
|
||||
/** @export */ Blockly.Msg.LISTS_SORT_TYPE_TEXT = "حروفی ، الفبایی";
|
||||
@@ -310,13 +310,12 @@ goog.require('Blockly.Msg');
|
||||
/** @export */ Blockly.Msg.PROCEDURES_MUTATORARG_TOOLTIP = "اضافه کردن ورودی به تابع.";
|
||||
/** @export */ Blockly.Msg.PROCEDURES_MUTATORCONTAINER_TITLE = "ورودیها";
|
||||
/** @export */ Blockly.Msg.PROCEDURES_MUTATORCONTAINER_TOOLTIP = "افزودن، حذف یا دوباره مرتبکردن ورودی این تابع.";
|
||||
/** @export */ Blockly.Msg.PROCEDURE_ALREADY_EXISTS = "A procedure named '%1' already exists."; // untranslated
|
||||
/** @export */ Blockly.Msg.REDO = "انجام دوباره";
|
||||
/** @export */ Blockly.Msg.REMOVE_COMMENT = "حذف نظر";
|
||||
/** @export */ Blockly.Msg.RENAME_VARIABLE = "تغییر نام متغیر...";
|
||||
/** @export */ Blockly.Msg.RENAME_VARIABLE_TITLE = "تغییر نام همهٔ متغیرهای «%1» به:";
|
||||
/** @export */ Blockly.Msg.TEXT_APPEND_HELPURL = "https://github.com/google/blockly/wiki/Text#text-modification"; // untranslated
|
||||
/** @export */ Blockly.Msg.TEXT_APPEND_TITLE = "to %1 append text %2"; // untranslated
|
||||
/** @export */ Blockly.Msg.TEXT_APPEND_TITLE = "به %1 الحاق متن %2";
|
||||
/** @export */ Blockly.Msg.TEXT_APPEND_TOOLTIP = "الحاق متنی به متغیر «%1».";
|
||||
/** @export */ Blockly.Msg.TEXT_CHANGECASE_HELPURL = "https://github.com/google/blockly/wiki/Text#adjusting-text-case"; // untranslated
|
||||
/** @export */ Blockly.Msg.TEXT_CHANGECASE_OPERATOR_LOWERCASE = "به حروف کوچک";
|
||||
@@ -351,7 +350,7 @@ goog.require('Blockly.Msg');
|
||||
/** @export */ Blockly.Msg.TEXT_INDEXOF_HELPURL = "https://github.com/google/blockly/wiki/Text#finding-text"; // untranslated
|
||||
/** @export */ Blockly.Msg.TEXT_INDEXOF_OPERATOR_FIRST = "اولین رخداد متن را بیاب";
|
||||
/** @export */ Blockly.Msg.TEXT_INDEXOF_OPERATOR_LAST = "آخرین رخداد متن را بیاب";
|
||||
/** @export */ Blockly.Msg.TEXT_INDEXOF_TITLE = "in text %1 %2 %3"; // untranslated
|
||||
/** @export */ Blockly.Msg.TEXT_INDEXOF_TITLE = "در متن %1 %2 %3";
|
||||
/** @export */ Blockly.Msg.TEXT_INDEXOF_TOOLTIP = "شاخصی از اولین آخرین رخداد متن اول در متن دوم بر میگرداند. اگر متن یافت نشد %1 باز میگرداند.";
|
||||
/** @export */ Blockly.Msg.TEXT_ISEMPTY_HELPURL = "https://github.com/google/blockly/wiki/Text#checking-for-empty-text"; // untranslated
|
||||
/** @export */ Blockly.Msg.TEXT_ISEMPTY_TITLE = "%1 خالی است";
|
||||
|
||||
+1
-2
@@ -310,13 +310,12 @@ goog.require('Blockly.Msg');
|
||||
/** @export */ Blockly.Msg.PROCEDURES_MUTATORARG_TOOLTIP = "Lisää sisääntulon funktioon.";
|
||||
/** @export */ Blockly.Msg.PROCEDURES_MUTATORCONTAINER_TITLE = "syötteet";
|
||||
/** @export */ Blockly.Msg.PROCEDURES_MUTATORCONTAINER_TOOLTIP = "Lisää, poista tai järjestele uudelleen tämän toiminnon tulot.";
|
||||
/** @export */ Blockly.Msg.PROCEDURE_ALREADY_EXISTS = "Toiminto nimeltään '%1' on jo olemassa.";
|
||||
/** @export */ Blockly.Msg.REDO = "Tee uudelleen";
|
||||
/** @export */ Blockly.Msg.REMOVE_COMMENT = "Poista kommentti";
|
||||
/** @export */ Blockly.Msg.RENAME_VARIABLE = "Nimeä uudelleen muuttuja...";
|
||||
/** @export */ Blockly.Msg.RENAME_VARIABLE_TITLE = "Nimeä uudelleen kaikki '%1' muuttujaa:";
|
||||
/** @export */ Blockly.Msg.TEXT_APPEND_HELPURL = "https://github.com/google/blockly/wiki/Text#text-modification"; // untranslated
|
||||
/** @export */ Blockly.Msg.TEXT_APPEND_TITLE = "to %1 append text %2"; // untranslated
|
||||
/** @export */ Blockly.Msg.TEXT_APPEND_TITLE = "muuttujaan %1 lisää teksti %2";
|
||||
/** @export */ Blockly.Msg.TEXT_APPEND_TOOLTIP = "Lisää tekstiä muuttujaan '%1'.";
|
||||
/** @export */ Blockly.Msg.TEXT_CHANGECASE_HELPURL = "https://github.com/google/blockly/wiki/Text#adjusting-text-case"; // untranslated
|
||||
/** @export */ Blockly.Msg.TEXT_CHANGECASE_OPERATOR_LOWERCASE = "pienet kirjaimet";
|
||||
|
||||
+1
-2
@@ -304,13 +304,12 @@ goog.require('Blockly.Msg');
|
||||
/** @export */ Blockly.Msg.PROCEDURES_DEF_DUPLICATE_WARNING = "Attention : Cette fonction a des paramètres en double.";
|
||||
/** @export */ Blockly.Msg.PROCEDURES_HIGHLIGHT_DEF = "Surligner la définition de la fonction";
|
||||
/** @export */ Blockly.Msg.PROCEDURES_IFRETURN_HELPURL = "http://c2.com/cgi/wiki?GuardClause";
|
||||
/** @export */ Blockly.Msg.PROCEDURES_IFRETURN_TOOLTIP = "Si une valeur est vraie, alors renvoyer une seconde valeur.";
|
||||
/** @export */ Blockly.Msg.PROCEDURES_IFRETURN_TOOLTIP = "Si une valeur est vrai, alors renvoyer une seconde valeur.";
|
||||
/** @export */ Blockly.Msg.PROCEDURES_IFRETURN_WARNING = "Attention : Ce bloc pourrait n’être utilisé que dans une définition de fonction.";
|
||||
/** @export */ Blockly.Msg.PROCEDURES_MUTATORARG_TITLE = "nom de l’entrée :";
|
||||
/** @export */ Blockly.Msg.PROCEDURES_MUTATORARG_TOOLTIP = "Ajouter une entrée à la fonction.";
|
||||
/** @export */ Blockly.Msg.PROCEDURES_MUTATORCONTAINER_TITLE = "entrées";
|
||||
/** @export */ Blockly.Msg.PROCEDURES_MUTATORCONTAINER_TOOLTIP = "Ajouter, supprimer, ou réarranger les entrées de cette fonction.";
|
||||
/** @export */ Blockly.Msg.PROCEDURE_ALREADY_EXISTS = "Une procédure appelée '%1' existe déjà.";
|
||||
/** @export */ Blockly.Msg.REDO = "Refaire";
|
||||
/** @export */ Blockly.Msg.REMOVE_COMMENT = "Supprimer un commentaire";
|
||||
/** @export */ Blockly.Msg.RENAME_VARIABLE = "Renommer la variable…";
|
||||
|
||||
+1
-2
@@ -310,13 +310,12 @@ goog.require('Blockly.Msg');
|
||||
/** @export */ Blockly.Msg.PROCEDURES_MUTATORARG_TOOLTIP = "הוסף קלט לפונקציה";
|
||||
/** @export */ Blockly.Msg.PROCEDURES_MUTATORCONTAINER_TITLE = "מקורות קלט";
|
||||
/** @export */ Blockly.Msg.PROCEDURES_MUTATORCONTAINER_TOOLTIP = "הוסף, הסר או סדר מחדש קלטים לפונקציה זו";
|
||||
/** @export */ Blockly.Msg.PROCEDURE_ALREADY_EXISTS = "A procedure named '%1' already exists."; // untranslated
|
||||
/** @export */ Blockly.Msg.REDO = "ביצוע חוזר";
|
||||
/** @export */ Blockly.Msg.REMOVE_COMMENT = "הסר תגובה";
|
||||
/** @export */ Blockly.Msg.RENAME_VARIABLE = "שנה את שם המשתנה...";
|
||||
/** @export */ Blockly.Msg.RENAME_VARIABLE_TITLE = "שנה את שם כל '%1' המשתנים ל:";
|
||||
/** @export */ Blockly.Msg.TEXT_APPEND_HELPURL = "https://github.com/google/blockly/wiki/Text#text-modification"; // untranslated
|
||||
/** @export */ Blockly.Msg.TEXT_APPEND_TITLE = "to %1 append text %2"; // untranslated
|
||||
/** @export */ Blockly.Msg.TEXT_APPEND_TITLE = "אל %1 הוספת טקסט %2";
|
||||
/** @export */ Blockly.Msg.TEXT_APPEND_TOOLTIP = "Append some text to variable '%1'."; // untranslated
|
||||
/** @export */ Blockly.Msg.TEXT_CHANGECASE_HELPURL = "https://github.com/google/blockly/wiki/Text#adjusting-text-case"; // untranslated
|
||||
/** @export */ Blockly.Msg.TEXT_CHANGECASE_OPERATOR_LOWERCASE = "לאותיות קטנות (עבור טקסט באנגלית)";
|
||||
|
||||
@@ -310,7 +310,6 @@ goog.require('Blockly.Msg');
|
||||
/** @export */ Blockly.Msg.PROCEDURES_MUTATORARG_TOOLTIP = "फंगक्शन को इनपुट प्रदान करें।";
|
||||
/** @export */ Blockly.Msg.PROCEDURES_MUTATORCONTAINER_TITLE = "इनपुट";
|
||||
/** @export */ Blockly.Msg.PROCEDURES_MUTATORCONTAINER_TOOLTIP = "इस फ़ंक्शन में इनपुट जोड़ें, निकालें, या पुन: क्रमित करें।";
|
||||
/** @export */ Blockly.Msg.PROCEDURE_ALREADY_EXISTS = "'%1' नाम की एक प्रक्रिया पहले से मौजूद है।";
|
||||
/** @export */ Blockly.Msg.REDO = "फिर से करें";
|
||||
/** @export */ Blockly.Msg.REMOVE_COMMENT = "टिप्पणी हटायें";
|
||||
/** @export */ Blockly.Msg.RENAME_VARIABLE = "चर का नाम बदलें...";
|
||||
|
||||
+2
-3
@@ -310,13 +310,12 @@ goog.require('Blockly.Msg');
|
||||
/** @export */ Blockly.Msg.PROCEDURES_MUTATORARG_TOOLTIP = "Generier/erzeich \"Uffruf %1\"";
|
||||
/** @export */ Blockly.Msg.PROCEDURES_MUTATORCONTAINER_TITLE = "Parameter";
|
||||
/** @export */ Blockly.Msg.PROCEDURES_MUTATORCONTAINER_TOOLTIP = "Variable:";
|
||||
/** @export */ Blockly.Msg.PROCEDURE_ALREADY_EXISTS = "A procedure named '%1' already exists."; // untranslated
|
||||
/** @export */ Blockly.Msg.REDO = "Redo"; // untranslated
|
||||
/** @export */ Blockly.Msg.REMOVE_COMMENT = "Kommentar entferne";
|
||||
/** @export */ Blockly.Msg.RENAME_VARIABLE = "Die neie Variable sei Noome:";
|
||||
/** @export */ Blockly.Msg.RENAME_VARIABLE_TITLE = "All \"%1\" Variable umbenenne in:";
|
||||
/** @export */ Blockly.Msg.TEXT_APPEND_HELPURL = "https://github.com/google/blockly/wiki/Text#text-modification"; // untranslated
|
||||
/** @export */ Blockly.Msg.TEXT_APPEND_TITLE = "to %1 append text %2"; // untranslated
|
||||
/** @export */ Blockly.Msg.TEXT_APPEND_TITLE = "An %1 Text oonhänge %2";
|
||||
/** @export */ Blockly.Msg.TEXT_APPEND_TOOLTIP = "Text an die Variable \"%1\" oonhänge.";
|
||||
/** @export */ Blockly.Msg.TEXT_CHANGECASE_HELPURL = "https://github.com/google/blockly/wiki/Text#adjusting-text-case"; // untranslated
|
||||
/** @export */ Blockly.Msg.TEXT_CHANGECASE_OPERATOR_LOWERCASE = "umwandle in klenbuchstoobe";
|
||||
@@ -351,7 +350,7 @@ goog.require('Blockly.Msg');
|
||||
/** @export */ Blockly.Msg.TEXT_INDEXOF_HELPURL = "https://github.com/google/blockly/wiki/Text#finding-text"; // untranslated
|
||||
/** @export */ Blockly.Msg.TEXT_INDEXOF_OPERATOR_FIRST = "Such der Begriff sein earstes Voarkommniss";
|
||||
/** @export */ Blockly.Msg.TEXT_INDEXOF_OPERATOR_LAST = "Suche der Begriff sein letztes Vorkommniss.";
|
||||
/** @export */ Blockly.Msg.TEXT_INDEXOF_TITLE = "in text %1 %2 %3"; // untranslated
|
||||
/** @export */ Blockly.Msg.TEXT_INDEXOF_TITLE = "im Text %1 %2 %3";
|
||||
/** @export */ Blockly.Msg.TEXT_INDEXOF_TOOLTIP = "Findt das earste / letzte Voarkommniss von en Suchbegriffes in enem Text. Gebt die Position von dem Begriff orrer %1 zurück.";
|
||||
/** @export */ Blockly.Msg.TEXT_ISEMPTY_HELPURL = "https://github.com/google/blockly/wiki/Text#checking-for-empty-text"; // untranslated
|
||||
/** @export */ Blockly.Msg.TEXT_ISEMPTY_TITLE = "%1 ist leer?";
|
||||
|
||||
+2
-3
@@ -310,13 +310,12 @@ goog.require('Blockly.Msg');
|
||||
/** @export */ Blockly.Msg.PROCEDURES_MUTATORARG_TOOLTIP = "Bemenet hozzáadása a függvényhez.";
|
||||
/** @export */ Blockly.Msg.PROCEDURES_MUTATORCONTAINER_TITLE = "paraméterek";
|
||||
/** @export */ Blockly.Msg.PROCEDURES_MUTATORCONTAINER_TOOLTIP = "Bemenetek hozzáadása, eltávolítása vagy átrendezése ehhez a függvényhez.";
|
||||
/** @export */ Blockly.Msg.PROCEDURE_ALREADY_EXISTS = "A procedure named '%1' already exists."; // untranslated
|
||||
/** @export */ Blockly.Msg.REDO = "Újra";
|
||||
/** @export */ Blockly.Msg.REMOVE_COMMENT = "Megjegyzés eltávolítása";
|
||||
/** @export */ Blockly.Msg.RENAME_VARIABLE = "Változó átnevezése…";
|
||||
/** @export */ Blockly.Msg.RENAME_VARIABLE_TITLE = "Minden „%1” változó átnevezése erre:";
|
||||
/** @export */ Blockly.Msg.TEXT_APPEND_HELPURL = "https://github.com/google/blockly/wiki/Text#text-modification"; // untranslated
|
||||
/** @export */ Blockly.Msg.TEXT_APPEND_TITLE = "to %1 append text %2"; // untranslated
|
||||
/** @export */ Blockly.Msg.TEXT_APPEND_TITLE = "A %1 szövegéhez fűzd hozzá %2";
|
||||
/** @export */ Blockly.Msg.TEXT_APPEND_TOOLTIP = "Szöveget fűz a \"%1\" változó értékéhez.";
|
||||
/** @export */ Blockly.Msg.TEXT_CHANGECASE_HELPURL = "https://github.com/google/blockly/wiki/Text#adjusting-text-case"; // untranslated
|
||||
/** @export */ Blockly.Msg.TEXT_CHANGECASE_OPERATOR_LOWERCASE = "kisbetűs";
|
||||
@@ -351,7 +350,7 @@ goog.require('Blockly.Msg');
|
||||
/** @export */ Blockly.Msg.TEXT_INDEXOF_HELPURL = "https://github.com/google/blockly/wiki/Text#finding-text"; // untranslated
|
||||
/** @export */ Blockly.Msg.TEXT_INDEXOF_OPERATOR_FIRST = "szövegben az első előfordulásának helye";
|
||||
/** @export */ Blockly.Msg.TEXT_INDEXOF_OPERATOR_LAST = "szövegben az utolsó előfordulásának helye";
|
||||
/** @export */ Blockly.Msg.TEXT_INDEXOF_TITLE = "in text %1 %2 %3"; // untranslated
|
||||
/** @export */ Blockly.Msg.TEXT_INDEXOF_TITLE = "A(z) %1 %2 %3 szövegnek";
|
||||
/** @export */ Blockly.Msg.TEXT_INDEXOF_TOOLTIP = "A keresett szöveg első vagy utolsó előfordulásával tér vissza. %1 esetén a szövegrészlet nem található.";
|
||||
/** @export */ Blockly.Msg.TEXT_ISEMPTY_HELPURL = "https://github.com/google/blockly/wiki/Text#checking-for-empty-text"; // untranslated
|
||||
/** @export */ Blockly.Msg.TEXT_ISEMPTY_TITLE = "%1 üres";
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user