Add source code link to custom dialog demo.

Fix typos.
This commit is contained in:
Neil Fraser
2018-03-16 17:46:24 -07:00
committed by Neil Fraser
parent 701b187640
commit a3b26c4ea7
3 changed files with 12 additions and 9 deletions

View File

@@ -40,11 +40,11 @@ Blockly.confirm = function(message, callback) {
CustomDialog.show('Confirm', message, {
showOkay: true,
onOkay: function() {
callback(true)
callback(true);
},
showCancel: true,
onCancel: function() {
callback(false)
callback(false);
}
});
};
@@ -56,11 +56,11 @@ Blockly.prompt = function(message, defaultValue, callback) {
showInput: true,
showOkay: true,
onOkay: function() {
callback(CustomDialog.inputField.value)
callback(CustomDialog.inputField.value);
},
showCancel: true,
onCancel: function() {
callback(null)
callback(null);
}
});
CustomDialog.inputField.value = defaultValue;
@@ -69,8 +69,8 @@ Blockly.prompt = function(message, defaultValue, callback) {
/** Hides any currently visible dialog. */
CustomDialog.hide = function() {
if (CustomDialog.backdropDiv_) {
CustomDialog.backdropDiv_.style.display = 'none'
CustomDialog.dialogDiv_.style.display = 'none'
CustomDialog.backdropDiv_.style.display = 'none';
CustomDialog.dialogDiv_.style.display = 'none';
}
};

View File

@@ -21,7 +21,10 @@
<h1><a href="https://developers.google.com/blockly/">Blockly</a> &gt;
<a href="../index.html">Demos</a> &gt; Custom Dialog</h1>
<p>This is a simple demo of replacing modal browser dialogs with HTML.</p>
<p>This is a simple demo of replacing modal browser dialogs with HTML.
To see how it works, see the source code in
<a href="custom-dialog.js">custom-dialog.js</a>
</p>
<p>Try creating new variables, creating variables with names already in
use, or deleting multiple blocks on the workspace.

View File

@@ -18,9 +18,9 @@ Finally, generate all the language versions wih this command:
java -jar soy/SoyToJsSrcCompiler.jar --locales ar,be-tarask,br,ca,da,de,el,en,es,fa,fr,he,hrx,hu,ia,is,it,ja,ko,ms,nb,nl,pl,pms,pt-br,ro,ru,sc,sv,th,tr,uk,vi,zh-hans,zh-hant --messageFilePathFormat xlf/translated_msgs_{LOCALE}.xlf --outputPathFormat "generated/{LOCALE}.js" template.soy
This is the process that Google uses for maintaining Blockly Games in 40+
languages. The XLIFF fromat is simple enough that it is trival to write a
languages. The XLIFF format is simple enough that it is trivial to write a
Python script to reformat it into some other format (such as JSON) for
compatability with other translation consoles.
compatibility with other translation consoles.
For more information, see message translation for Closure Templates:
https://developers.google.com/closure/templates/docs/translation