mirror of
https://github.com/scratchfoundation/scratch-blocks.git
synced 2025-08-28 22:10:31 -04:00
Remove core-unsupported languages from Code demo. Fix resize in Graph.
This commit is contained in:
parent
ab133cb539
commit
a2ddb04f21
9 changed files with 22 additions and 148 deletions
|
@ -32,7 +32,6 @@ var Code = {};
|
|||
* Lookup for names of supported languages. Keys should be in ISO 639 format.
|
||||
*/
|
||||
Code.LANGUAGE_NAME = {
|
||||
'ace': 'بهسا اچيه',
|
||||
'ar': 'العربية',
|
||||
'be-tarask': 'Taraškievica',
|
||||
'br': 'Brezhoneg',
|
||||
|
@ -45,7 +44,6 @@ Code.LANGUAGE_NAME = {
|
|||
'es': 'Español',
|
||||
'fa': 'فارسی',
|
||||
'fr': 'Français',
|
||||
'gl': 'Galego',
|
||||
'he': 'עברית',
|
||||
'hrx': 'Hunsrik',
|
||||
'hu': 'Magyar',
|
||||
|
@ -54,8 +52,6 @@ Code.LANGUAGE_NAME = {
|
|||
'it': 'Italiano',
|
||||
'ja': '日本語',
|
||||
'ko': '한국어',
|
||||
'lv': 'Latviešu',
|
||||
'mg': 'Malagasy',
|
||||
'mk': 'Македонски',
|
||||
'ms': 'Bahasa Melayu',
|
||||
'nb': 'Norsk Bokmål',
|
||||
|
@ -67,7 +63,6 @@ Code.LANGUAGE_NAME = {
|
|||
'ro': 'Română',
|
||||
'ru': 'Русский',
|
||||
'sc': 'Sardu',
|
||||
'sco': 'Scots',
|
||||
'sk': 'Slovenčina',
|
||||
'sr': 'Српски',
|
||||
'sv': 'Svenska',
|
||||
|
@ -83,7 +78,7 @@ Code.LANGUAGE_NAME = {
|
|||
/**
|
||||
* List of RTL languages.
|
||||
*/
|
||||
Code.LANGUAGE_RTL = ['ace', 'ar', 'fa', 'he'];
|
||||
Code.LANGUAGE_RTL = ['ar', 'fa', 'he'];
|
||||
|
||||
/**
|
||||
* Extracts a parameter from the URL.
|
||||
|
|
|
@ -1,25 +0,0 @@
|
|||
var MSG = {
|
||||
title: "Kode",
|
||||
blocks: "Seuneutheun",
|
||||
linkTooltip: "Keubah ngon neupawôt keu theun",
|
||||
runTooltip: "Neupeujak program nyang geupeuteutap le seuneutheun lam ruweuëng keurija",
|
||||
badCode: "Ralat program\n%1",
|
||||
timeout: "Eksekusi maksimum ka leupah",
|
||||
discard: "Sampôh mandum %1 seuneutheun",
|
||||
trashTooltip: "Boh mandum seuneutheun",
|
||||
catLogic: "Logis",
|
||||
catLoops: "Kuwien",
|
||||
catMath: "Matematik",
|
||||
catText: "Haraih",
|
||||
catLists: "Dapeuta",
|
||||
catColour: "Wareuna",
|
||||
catVariables: "Meumacam",
|
||||
catFunctions: "Prosedur",
|
||||
listVariable: "dapeuta",
|
||||
textVariable: "haraih",
|
||||
httpRequestError: "Na masalah lam neumeulakèe",
|
||||
linkAlert: "Neubagi seuneutheun droëneuh ngon peunawôt nyoë: %1",
|
||||
hashError: "Meu'ah, '%1' hana saban sakri ngon peuë mantong program nyang meukeubah",
|
||||
xmlError: "Beureukaih keuneubah droëneuh han jeuët geupasoë. Kadang na neupeugot ngon versi seuneutheun yang la'én",
|
||||
badXml: "Ralat 'oh geuploh XML\n%1\n\nNeupileh 'OK' keu peulucôt meuandam droëneuh atawa 'Peubateuë' keu neusambông meuandam XML-jih"
|
||||
};
|
|
@ -1,25 +0,0 @@
|
|||
var MSG = {
|
||||
title: "Código",
|
||||
blocks: "Bloques",
|
||||
linkTooltip: "Gardar e crear unha ligazón aos bloques.",
|
||||
runTooltip: "Executar o programa definido polos bloques no espazo de traballo.",
|
||||
badCode: "Erro do programa:\n%1",
|
||||
timeout: "Superouse o número máximo de iteracións durante a execución.",
|
||||
discard: "Queres borrar os %1 bloques?",
|
||||
trashTooltip: "Descartar todos os bloques.",
|
||||
catLogic: "Lóxica",
|
||||
catLoops: "Bucles",
|
||||
catMath: "Matemáticas",
|
||||
catText: "Texto",
|
||||
catLists: "Listas",
|
||||
catColour: "Cor",
|
||||
catVariables: "Variables",
|
||||
catFunctions: "Funcións",
|
||||
listVariable: "lista",
|
||||
textVariable: "texto",
|
||||
httpRequestError: "Houbo un problema coa solicitude.",
|
||||
linkAlert: "Comparte os teus bloques con esta ligazón:\n\n%1",
|
||||
hashError: "Sentímolo, \"%1\" non se corresponde con ningún programa gardado.",
|
||||
xmlError: "Non se puido cargar o ficheiro gardado. Se cadra, foi creado cunha versión diferente de Blockly.",
|
||||
badXml: "Erro de análise do XML:\n%1\n\nSelecciona \"Aceptar\" se queres anular os cambios ou \"Cancelar\" para seguir editando o XML."
|
||||
};
|
|
@ -1,25 +0,0 @@
|
|||
var MSG = {
|
||||
title: "Pirmkods",
|
||||
blocks: "Bloki",
|
||||
linkTooltip: "Saglabāt un piesaistīt blokiem.",
|
||||
runTooltip: "Palaidiet programmu, ko definē bloki darbvietā.",
|
||||
badCode: "Programmas kļūda:\n %1",
|
||||
timeout: "Pārsniegts maksimālais iterāciju skaits.",
|
||||
discard: "Vai izdzēst visus %1 blokus?",
|
||||
trashTooltip: "Izmest visus blokus.",
|
||||
catLogic: "Loģika",
|
||||
catLoops: "Cikli",
|
||||
catMath: "Matemātika",
|
||||
catText: "Teksts",
|
||||
catLists: "Saraksti",
|
||||
catColour: "Krāsa",
|
||||
catVariables: "Mainīgie",
|
||||
catFunctions: "Procedūras",
|
||||
listVariable: "saraksts",
|
||||
textVariable: "teksts",
|
||||
httpRequestError: "Pieprasījuma kļūda.",
|
||||
linkAlert: "Dalies ar saviem blokiem ar šo saiti:\n\n%1",
|
||||
hashError: "Atvainojiet, bet '%1' neatbilst nevienai no saglabātajām programmām.",
|
||||
xmlError: "Nevaru ielādēt tavu saglabāto failu. Iespējams, tas tika izveidots ar citu Blockly versiju?",
|
||||
badXml: "XML parsēšanas kļūda:\n %1\n\nIzvēlieties 'Labi', lai zaudētu savas izmaiņas vai 'Atcelt', lai rediģētu XML."
|
||||
};
|
|
@ -1,25 +0,0 @@
|
|||
var MSG = {
|
||||
title: "Kaody",
|
||||
blocks: "Bolongana",
|
||||
linkTooltip: "Hitahiry ary hampirohy amin'ny bolongana.",
|
||||
runTooltip: "Handefa ny fandaharana voafaritry ny bolongana ao amin'ny erana iasana.",
|
||||
badCode: "Hadisoam-pandaharana:\n%1",
|
||||
timeout: "Tafahoatra ny isa ambony indrindra ny isan'ny fiverimberenana.",
|
||||
discard: "Hamafa ny bolongana %1?",
|
||||
trashTooltip: "Hanary ny bolongana rehetra.",
|
||||
catLogic: "Lôjika",
|
||||
catLoops: "Tondro mifolaka",
|
||||
catMath: "Matematika",
|
||||
catText: "Soratra",
|
||||
catLists: "Lisitra",
|
||||
catColour: "Loko",
|
||||
catVariables: "Ova",
|
||||
catFunctions: "Paika",
|
||||
listVariable: "lisitra",
|
||||
textVariable: "soratra",
|
||||
httpRequestError: "Nisy olana tamin'ilay hataka.",
|
||||
linkAlert: "Zarao amin'ity rohy ity ny bolonganao: \n\n%1",
|
||||
hashError: "Miala tsiny, tsy miady amin'ny fandaharana notehirizina '%1'.",
|
||||
xmlError: "Tsy nahasokatra ny rakitra voatahirinao. Mety namboarina tamin'ny versionan'i Blockly hafa angamba ilay izy?",
|
||||
badXml: "Hadisoana tam-pamakiana ny XML:\n%1\n\nSafidio 'OK' raha hamoy ny fiovana, na 'Aoka ihany' raha mbola hitoy hanova ny XML."
|
||||
};
|
|
@ -1,25 +0,0 @@
|
|||
var MSG = {
|
||||
title: "Code",
|
||||
blocks: "Blocks",
|
||||
linkTooltip: "Hain n airt til blocks.",
|
||||
runTooltip: "Rin the program defined bi the blocks in the wairkspace.",
|
||||
badCode: "Program mistak:\n%1",
|
||||
timeout: "Mucklest execution iterations exceedit.",
|
||||
discard: "Delyte aw %1 blocks?",
|
||||
trashTooltip: "Hiff aw blocks.",
|
||||
catLogic: "Logeec",
|
||||
catLoops: "Luips",
|
||||
catMath: "Maths",
|
||||
catText: "Tex",
|
||||
catLists: "Leets",
|
||||
catColour: "Colour",
|
||||
catVariables: "Variables",
|
||||
catFunctions: "Functions",
|
||||
listVariable: "leet",
|
||||
textVariable: "tex",
|
||||
httpRequestError: "Thaur wis ae problem wi the request.",
|
||||
linkAlert: "Shair yer blocks wi this airtin:\n\n%1",
|
||||
hashError: "Sairrie, '%1' disna correspond wi onie hained program.",
|
||||
xmlError: "Coudnae laid yer hained file. Perhaps it wis makit wi ae deefferent version o Blockly?",
|
||||
badXml: "Mistak parsin XML:\n%1\n\nSelect 'OK' tae hiff yer chynges or 'Cancel' tae further eedit the XML."
|
||||
};
|
|
@ -9,26 +9,14 @@
|
|||
<script type="text/javascript" src="../../javascript_compressed.js"></script>
|
||||
<script type="text/javascript" src="../../msg/js/en.js"></script>
|
||||
<style>
|
||||
html, body {
|
||||
height: 100%;
|
||||
}
|
||||
body {
|
||||
background-color: #fff;
|
||||
font-family: sans-serif;
|
||||
overflow: hidden;
|
||||
}
|
||||
h1 {
|
||||
font-weight: normal;
|
||||
font-size: 140%;
|
||||
}
|
||||
#blocklyDiv {
|
||||
float: right;
|
||||
height: 95%;
|
||||
width: 70%;
|
||||
}
|
||||
#visualization {
|
||||
width: 400px;
|
||||
}
|
||||
#funcText {
|
||||
margin-top: 1em;
|
||||
margin-left: 1.5em;
|
||||
|
@ -46,8 +34,6 @@
|
|||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="blocklyDiv"></div>
|
||||
|
||||
<h1><a href="https://developers.google.com/blockly/">Blockly</a> >
|
||||
<a href="../index.html">Demos</a> > Graph</h1>
|
||||
|
||||
|
@ -55,7 +41,16 @@
|
|||
|
||||
<p>→ More info on <a href="https://developers.google.com/blockly/installation/code-generators#realtime_generation">Realtime generation</a>...</p>
|
||||
|
||||
<div id="visualization"></div>
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<div id="visualization" style="width: 400px"></div>
|
||||
</td>
|
||||
<td>
|
||||
<div id="blocklyDiv" style="height: 400px"></div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<div id="funcText">
|
||||
<img id="y1" src="../../media/1x1.gif">
|
||||
|
@ -256,6 +251,14 @@ Graph.plot = function(code) {
|
|||
return table;
|
||||
};
|
||||
|
||||
/**
|
||||
* Force Blockly to resize into the available width.
|
||||
*/
|
||||
Graph.resize = function() {
|
||||
var width = Math.max(window.innerWidth - 440, 250);
|
||||
document.getElementById('blocklyDiv').style.width = width + 'px';
|
||||
};
|
||||
|
||||
/**
|
||||
* Initialize Blockly and the graph. Called on page load.
|
||||
*/
|
||||
|
@ -270,6 +273,7 @@ Graph.init = function() {
|
|||
}
|
||||
|
||||
window.addEventListener('load', Graph.init);
|
||||
window.addEventListener('resize', Graph.resize);
|
||||
</script>
|
||||
|
||||
</body>
|
||||
|
|
|
@ -47,7 +47,7 @@ d+" = 0; "+d+" < "+e+"; "+d+"++) {\n"+c+"}\n")};Blockly.JavaScript.controls_whil
|
|||
Blockly.JavaScript.controls_for=function(a){var b=Blockly.JavaScript.variableDB_.getName(a.getFieldValue("VAR"),Blockly.Variables.NAME_TYPE),c=Blockly.JavaScript.valueToCode(a,"FROM",Blockly.JavaScript.ORDER_ASSIGNMENT)||"0",d=Blockly.JavaScript.valueToCode(a,"TO",Blockly.JavaScript.ORDER_ASSIGNMENT)||"0",e=Blockly.JavaScript.valueToCode(a,"BY",Blockly.JavaScript.ORDER_ASSIGNMENT)||"1",f=Blockly.JavaScript.statementToCode(a,"DO"),f=Blockly.JavaScript.addLoopTrap(f,a.id);if(Blockly.isNumber(c)&&Blockly.isNumber(d)&&
|
||||
Blockly.isNumber(e)){var g=parseFloat(c)<=parseFloat(d);a="for ("+b+" = "+c+"; "+b+(g?" <= ":" >= ")+d+"; "+b;b=Math.abs(parseFloat(e));a=(1==b?a+(g?"++":"--"):a+((g?" += ":" -= ")+b))+(") {\n"+f+"}\n")}else a="",g=c,c.match(/^\w+$/)||Blockly.isNumber(c)||(g=Blockly.JavaScript.variableDB_.getDistinctName(b+"_start",Blockly.Variables.NAME_TYPE),a+="var "+g+" = "+c+";\n"),c=d,d.match(/^\w+$/)||Blockly.isNumber(d)||(c=Blockly.JavaScript.variableDB_.getDistinctName(b+"_end",Blockly.Variables.NAME_TYPE),
|
||||
a+="var "+c+" = "+d+";\n"),d=Blockly.JavaScript.variableDB_.getDistinctName(b+"_inc",Blockly.Variables.NAME_TYPE),a+="var "+d+" = ",a=Blockly.isNumber(e)?a+(Math.abs(e)+";\n"):a+("Math.abs("+e+");\n"),a+="if ("+g+" > "+c+") {\n",a+=Blockly.JavaScript.INDENT+d+" = -"+d+";\n",a+="}\n",a+="for ("+b+" = "+g+";\n "+d+" >= 0 ? "+b+" <= "+c+" : "+b+" >= "+c+";\n "+b+" += "+d+") {\n"+f+"}\n";return a};
|
||||
Blockly.JavaScript.controls_forEach=function(a){var b=Blockly.JavaScript.variableDB_.getName(a.getFieldValue("VAR"),Blockly.Variables.NAME_TYPE),c=Blockly.JavaScript.valueToCode(a,"LIST",Blockly.JavaScript.ORDER_ASSIGNMENT)||"[]",d=Blockly.JavaScript.statementToCode(a,"DO"),d=Blockly.JavaScript.addLoopTrap(d,a.id);a=Blockly.JavaScript.variableDB_.getDistinctName(b+"_index",Blockly.Variables.NAME_TYPE);d=Blockly.JavaScript.INDENT+b+" = "+c+"["+a+"];\n"+d;return"for (var "+a+" in "+c+") {\n"+d+"}\n"};
|
||||
Blockly.JavaScript.controls_forEach=function(a){var b=Blockly.JavaScript.variableDB_.getName(a.getFieldValue("VAR"),Blockly.Variables.NAME_TYPE),c=Blockly.JavaScript.valueToCode(a,"LIST",Blockly.JavaScript.ORDER_ASSIGNMENT)||"[]",d=Blockly.JavaScript.statementToCode(a,"DO"),d=Blockly.JavaScript.addLoopTrap(d,a.id);a=Blockly.JavaScript.variableDB_.getDistinctName(b+"_index",Blockly.Variables.NAME_TYPE);d=Blockly.JavaScript.INDENT+b+" = "+c+"["+a+"];\n"+d;return"for (var "+a+" in "+c+") {\n"+d+"}\n"};
|
||||
Blockly.JavaScript.controls_flow_statements=function(a){switch(a.getFieldValue("FLOW")){case "BREAK":return"break;\n";case "CONTINUE":return"continue;\n"}throw"Unknown flow statement.";};
|
||||
// Copyright 2012 Google Inc. Apache License 2.0
|
||||
Blockly.JavaScript.math={};Blockly.JavaScript.math_number=function(a){return[parseFloat(a.getFieldValue("NUM")),Blockly.JavaScript.ORDER_ATOMIC]};
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"@metadata": {
|
||||
"author": "Ellen Spertus <ellen.spertus@gmail.com>",
|
||||
"lastupdated": "2014-10-29 22:38:54.997396",
|
||||
"lastupdated": "2014-11-20 15:37:54.063549",
|
||||
"locale": "en",
|
||||
"messagedocumentation" : "qqq"
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue