From a3b26c4ea7c1036e2ed93b36ee60eacf9cf408a9 Mon Sep 17 00:00:00 2001 From: Neil Fraser Date: Fri, 16 Mar 2018 17:46:24 -0700 Subject: [PATCH] Add source code link to custom dialog demo. Fix typos. --- demos/custom-dialogs/custom-dialog.js | 12 ++++++------ demos/custom-dialogs/index.html | 5 ++++- demos/plane/README.txt | 4 ++-- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/demos/custom-dialogs/custom-dialog.js b/demos/custom-dialogs/custom-dialog.js index ea8c86567..e49a25051 100644 --- a/demos/custom-dialogs/custom-dialog.js +++ b/demos/custom-dialogs/custom-dialog.js @@ -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'; } }; diff --git a/demos/custom-dialogs/index.html b/demos/custom-dialogs/index.html index ee1bc840e..8c3c0aa4b 100644 --- a/demos/custom-dialogs/index.html +++ b/demos/custom-dialogs/index.html @@ -21,7 +21,10 @@

Blockly > Demos > Custom Dialog

-

This is a simple demo of replacing modal browser dialogs with HTML.

+

This is a simple demo of replacing modal browser dialogs with HTML. + To see how it works, see the source code in + custom-dialog.js +

Try creating new variables, creating variables with names already in use, or deleting multiple blocks on the workspace. diff --git a/demos/plane/README.txt b/demos/plane/README.txt index 6da3fa65d..38bbc0313 100644 --- a/demos/plane/README.txt +++ b/demos/plane/README.txt @@ -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