cra16/cake-core

View on GitHub
blockly/apps/turtle/template.soy

Summary

Maintainability
Test Coverage
{namespace turtlepage}

/**
 * This is a Closure Template.
 *
 * To regenerate just en.js, run this command:
 * java -jar ../_soy/SoyToJsSrcCompiler.jar --outputPathFormat generated/en.js --srcs ../common.soy,template.soy
 *
 * To regenerate all files, see: trunk/apps/common.soy
 */

/**
 * Translated messages for use in JavaScript.
 */
{template .messages}
  {call apps.messages /}
  <div style="display: none">
    // Block text and their associated tooltips and URLs (interleaved to
    // assist with translation).
    <span id="Turtle_moveTooltip">{msg meaning="Turtle.moveTooltip" desc="tooltip - In this and subsequent messages, 'turtle' refers to a stylized turtle on the screen to represent a position and direction.  This imaginary turtle is carrying a pen in its tail, so moving the turtle draws a line (or curve, etc.).  You are encouraged to play with the [https://blockly-demo.appspot.com/static/apps/turtle/index.html Turtle application] before doing this translation."}Moves the turtle forward or backward by the specified amount.{/msg}</span>
    <span id="Turtle_moveForward">{msg meaning="Turtle.moveForward" desc="[[Translating:Blockly#Drop-Down_Menus dropdown]] - Infinitive or imperative of a verb telling a turtle to move (walk) in the direction he/she is facing.  This is followed by a number indicating how far (how many pixels) to go.  Prefer a translation that has text in common with the translation of 'move backward'.  See [[Translating:Blockly#Drop-Down_Menus]]."}move forward by{/msg}</span>
    <span id="Turtle_moveBackward">{msg meaning="Turtle.moveBackward" desc="[[Translating:Blockly#Drop-Down_Menus dropdown]] - Infinitive or imperative of a verb telling a turtle to move (walk) in the direction opposite to where he/she is facing.  This is followed by a number indicating how far (how many pixels) to go.  Prefer a translation that has text in common with the translation of 'move forward'."}move backward by{/msg}</span>

    <span id="Turtle_turnTooltip">{msg meaning="Turtle.turnTooltip" desc="'Left' means counter-clockwise/anti-clockwise, and 'right' means clockwise."}Turns the turtle left or right by the specified number of degrees.{/msg}</span>
    <span id="Turtle_turnRight">{msg meaning="Turtle.turnRight" desc="[[Translating:Blockly#Drop-Down_Menus dropdown]] - Infinitive or imperative of verb telling a turtle to rotate clockwise.  This is followed by a number indicating how far (how many degrees) to turn.  Prefer a translation that has text in common with the translation of 'turn left by'."}turn right by{/msg}</span>
    <span id="Turtle_turnLeft">{msg meaning="Turtle.turnLeft" desc="[[Translating:Blockly#Drop-Down_Menus dropdown]] - Infinitive or imperative of verb telling a turtle to rotate counter-clockwise (anti-clockwise).  This is followed by a number indicating how far (how many degrees) to turn.  Prefer a translation that has text in common with the translation of 'turn right by'."}turn left by{/msg}</span>

    <span id="Turtle_widthTooltip">{msg meaning="Turtle.widthTooltip" desc="tooltip"}Changes the width of the pen.{/msg}</span>
    <span id="Turtle_setWidth">{msg meaning="Turtle.setWidth" desc="block text - Infinitive or imperative of a verb to set the width of the lines that should be drawn in the future by an imaginary pen.  This is followed by a number indicating the width in pixels (1 or greater)."}set width to{/msg}</span>

    <span id="Turtle_colourTooltip">{msg meaning="Turtle.colourTooltip" desc="tooltip - Changes the colour of ink in the pen carried by the turtle."}Changes the colour of the pen.{/msg}</span>
    <span id="Turtle_setColour">{msg meaning="Turtle.setColour" desc="block text - Infinitive or imperative of a verb to specify the colour of the lines that should be drawn in the future by an imaginary pen.  This is followed by a block showing the colour"}set colour to{/msg}</span>

    <span id="Turtle_penTooltip">{msg meaning="Turtle.penTooltip" desc="tooltip - Lifting the pen off the writing surface prevents anything from being drawn.  Lowering it (after it has been lifted) enables it to draw again."}Lifts or lowers the pen, to stop or start drawing.{/msg}</span>
    <span id="Turtle_penUp">{msg meaning="Turtle.penUp" desc="block text - Infinitive or imperative of a verb to lift up a pen so that moving it leaves no mark on the writing surface."}pen up{/msg}</span>
    <span id="Turtle_penDown">{msg meaning="Turtle.penDown" desc="block text - Infinitive or imperative of a verb to lower a raised pen so that moving it leaves a mark on the writing surface."}pen down{/msg}</span>

    <span id="Turtle_turtleVisibilityTooltip">{msg meaning="Turtle.turtleVisibilityTooltip" desc="tooltip"}Makes the turtle (circle and arrow) visible or invisible.{/msg}</span>
    <span id="Turtle_hideTurtle">{msg meaning="Turtle.hideTurtle" desc="block text - Infinitive or imperative of a verb telling a turtle to hide itself (become invisible)."}hide turtle{/msg}</span>
    <span id="Turtle_showTurtle">{msg meaning="Turtle.showTurtle" desc="block text - Infinitive or imperative of a verb telling a turtle to show itself (become visible after having been invisible)."}show turtle{/msg}</span>

    <span id="Turtle_printHelpUrl">{msg meaning="Turtle.printHelpUrl" desc="URL - Information about printing or typography."}https://en.wikipedia.org/wiki/Printing{/msg}</span>
    <span id="Turtle_printTooltip">{msg meaning="Turtle.printTooltip" desc="tooltip - Note that 'print' refers to displaying text on the screen, not on an external printer."}Draws text in the turtle's direction at its location.{/msg}</span>
    <span id="Turtle_print">{msg meaning="Turtle.print" desc="block text - Infinitive or imperative of a verb telling a turtle to display text on the screen.  This is always followed by a block indicating what should be printed."}print{/msg}</span>

    <span id="Turtle_fontHelpUrl">{msg meaning="Turtle.fontHelpUrl" desc="URL - Information about typographic fonts."}https://en.wikipedia.org/wiki/Font{/msg}</span>
    <span id="Turtle_fontTooltip">{msg meaning="Turtle.fontTooltip" desc="tooltip - This is shown on the block that lets the user specify the font [family], size, and style that should be used for subsequent displays of text."}Sets the font used by the print block.{/msg}</span>
    <span id="Turtle_font">{msg meaning="Turtle.font" desc="block text - This precedes a dropdown menu specifying the typographic font [family] that should be used when displaying text."}font{/msg}</span>
    <span id="Turtle_fontSize">{msg meaning="Turtle.fontSize" desc="block text - This precedes a number specifying the size of the typographic font that should be used when displaying text.  This appears in the same block as 'font', so that word should not be repeated."}font size{/msg}</span>
    <span id="Turtle_fontNormal">{msg meaning="Turtle.fontNormal" desc="[[Translating:Blockly#Drop-Down_Menus dropdown]] - Specifies that a typographic font should be normal (neither in italics or bold)."}normal{/msg}</span>
    <span id="Turtle_fontBold">{msg meaning="Turtle.fontBold" desc="[[Translating:Blockly#Drop-Down_Menus dropdown]] - Specifies that a typographic font should be [https://en.wikipedia.org/wiki/Emphasis_(typography) bold]."}bold{/msg}</span>
    <span id="Turtle_fontItalic">{msg meaning="Turtle.fontItalic" desc="[[Translating:Blockly#Drop-Down_Menus dropdown]] - Specifies that a typographic font should be [https://en.wikipedia.org/wiki/Italics italic]."}italic{/msg}</span>

    // Misc text.
    <span id="Turtle_unloadWarning">{msg meaning="Turtle.unloadWarning" desc="alert - This is shown if the user attempts to close the browser tab containing the page or navigate to a different page to prevent them from accidentally losing their program in progress."}Leaving this page will result in the loss of your work.{/msg}</span>
  </div>
{/template}

/**
 * Web page structure.
 */
{template .start}
  {call .messages /}
  <table width="100%">
    <tr>
      <td>
        <h1>
          <span id="title">
            <a href="../index.html?lang={$ij.lang}">{msg meaning="Apps.blocklyMessage" desc="IBID"}Blockly{/msg}</a>
            {sp}:{sp}
            {msg meaning="Turtle.title" desc="title - Specifies that this is Blockly's '''Turtle Graphics''' application.  Should you wish to, you can read more about [https://en.wikipedia.org/wiki/Turtle_graphics turtle graphics]."}
              Turtle Graphics
            {/msg}
          </span>
        </h1>
      </td>
      <td class="farSide">
        <select id="languageMenu"></select>
      </td>
    </tr>
  </table>
  <div id="visualization">
    <canvas id="scratch" width="400" height="400" style="display: none"></canvas>
    <canvas id="display" width="400" height="400"></canvas>
  </div>
  <table style="padding-top: 1em;">
    <tr>
      <td style="width: 190px; text-align: center; vertical-align: top;">
        <script type="text/javascript" src="../slider.js"></script>
        <svg
           id="slider"
           xmlns="http://www.w3.org/2000/svg"
           xmlns:svg="http://www.w3.org/2000/svg"
           xmlns:xlink="http://www.w3.org/1999/xlink"
           version="1.1"
           width="150"
           height="50">
          <!-- Slow icon. -->
          <!-- Extra SVG is temporary hack to fix bug #349701 in Chrome 34. -->
          <!-- Harmless for other browsers. -->
          <svg xmlns="http://www.w3.org/2000/svg" version="1.1">
            <clipPath id="slowClipPath">
              <rect width=26 height=12 x=5 y=14 />
            </clipPath>
            <image xlink:href="icons.png" height=42 width=84 x=-21 y=-10
                clip-path="url(#slowClipPath)" />
          </svg>
          <!-- Fast icon. -->
          <!-- Extra SVG is temporary hack to fix bug #349701 in Chrome 34. -->
          <!-- Harmless for other browsers. -->
          <svg xmlns="http://www.w3.org/2000/svg" version="1.1">
            <clipPath id="fastClipPath">
              <rect width=26 height=16 x=120 y=10 />
            </clipPath>
            <image xlink:href="icons.png" height=42 width=84 x=120 y=-11
                clip-path="url(#fastClipPath)" />
          </svg>
        </svg>
      </td>
      <td style="width: 15px;">
        <img id="spinner" style="visibility: hidden;" src="loading.gif" height=15 width=15>
      </td>
      <td style="width: 190px; text-align: center">
        <button id="runButton" class="primary" title="{msg meaning="Turtle.runTooltip" desc="tooltip - Pressing this button runs the computer program the user has written to move the turtle on the canvas."}Makes the turtle do what the blocks say.{/msg}">
          <img src="../../media/1x1.gif" class="run icon21">{msg meaning="Apps.runProgram" desc="TODO"}Run Program{/msg}
        </button>
        <button id="resetButton" class="primary" style="display: none">
          <img src="../../media/1x1.gif" class="stop icon21"> {msg meaning="Apps.resetProgram" desc="IBID"}Reset{/msg}
        </button>
      </td>
    </tr>
  </table>

  <div id="toolbarDiv">
    <button id="codeButton" class="notext" title="{msg meaning="Apps.codeTooltip" desc="IBID"}See generated JavaScript code.{/msg}">
      <img src='../../media/1x1.gif' class="code icon21">
    </button>
    <button id="linkButton" class="notext" title="{msg meaning="Apps.linkTooltip" desc="IBID"}Save and link to blocks.{/msg}">
      <img src='../../media/1x1.gif' class="link icon21">
    </button>
    <button class="notext" id="captureButton" title="{msg meaning="Turtle.captureTooltip" desc="tooltip - Pressing this button causes the drawing created by the user's program to be saved as an image on the user's computer.  The button icon looks like a camera."}Save the drawing.{/msg}">
      <img src='../../media/1x1.gif' class="img icon21">
    </button>
    <a id="downloadImageLink" download="{msg meaning="Turtle.imgFilename" desc="filename - The name of the image file containing the user's drawing.  It must end with '.png'."}drawing.png{/msg}"></a>
  </div>

  <script type="text/javascript" src="../../blockly_compressed.js"></script>
  <script type="text/javascript" src="../../blocks_compressed.js"></script>
  <script type="text/javascript" src="../../javascript_compressed.js"></script>
  <script type="text/javascript" src="../../{$ij.langSrc}"></script>
  <script type="text/javascript" src="blocks.js"></script>
  {call .toolbox /}
  <div id="blockly"></div>

  {call apps.dialog /}
  {call apps.codeDialog /}
  {call apps.storageDialog /}
{/template}

/**
 * Toolbox.
 */
{template .toolbox}
  <xml id="toolbox" style="display: none">
    <category name="{msg meaning="Turtle.catTurtle" desc="category - Blocks related to Turtle commands."}Turtle{/msg}">
      <block type="draw_move">
        <value name="VALUE">
          <block type="math_number">
            <field name="NUM">10</field>
          </block>
        </value>
      </block>
      <block type="draw_turn">
        <value name="VALUE">
          <block type="math_number">
            <field name="NUM">90</field>
          </block>
        </value>
      </block>
      <block type="draw_width">
        <value name="WIDTH">
          <block type="math_number">
            <field name="NUM">1</field>
          </block>
        </value>
      </block>
      <block type="draw_pen"></block>
      <block type="turtle_visibility"></block>
      <block type="draw_print">
        <value name="TEXT">
          <block type="text"></block>
        </value>
      </block>
      <block type="draw_font"></block>
    </category>
    <category name="{msg meaning="Apps.catColour" desc="IBID"}Colour{/msg}">
      <block type="draw_colour">
        <value name="COLOUR">
          <block type="colour_picker"></block>
        </value>
      </block>
      <block type="colour_picker"></block>
      <block type="colour_random"></block>
      <block type="colour_rgb"></block>
      <block type="colour_blend"></block>
    </category>
    <category name="{msg meaning="Apps.catLogic" desc="IBID"}Logic{/msg}">
      <block type="controls_if"></block>
      <block type="logic_compare"></block>
      <block type="logic_operation"></block>
      <block type="logic_negate"></block>
      <block type="logic_boolean"></block>
      <block type="logic_ternary"></block>
    </category>
    <category name="{msg meaning="Apps.catLoops" desc="IBID"}Loops{/msg}">
      <block type="controls_repeat_ext">
        <value name="TIMES">
          <block type="math_number">
            <field name="NUM">10</field>
          </block>
        </value>
      </block>
      <block type="controls_whileUntil"></block>
      <block type="controls_for">
        <value name="FROM">
          <block type="math_number">
            <field name="NUM">1</field>
          </block>
        </value>
        <value name="TO">
          <block type="math_number">
            <field name="NUM">10</field>
          </block>
        </value>
        <value name="BY">
          <block type="math_number">
            <field name="NUM">1</field>
          </block>
        </value>
      </block>
      <block type="controls_forEach"></block>
      <block type="controls_flow_statements"></block>
    </category>
    <category name="{msg meaning="Apps.catMath" desc="IBID"}Math{/msg}">
      <block type="math_number"></block>
      <block type="math_arithmetic"></block>
      <block type="math_single"></block>
      <block type="math_trig"></block>
      <block type="math_constant"></block>
      <block type="math_number_property"></block>
      <block type="math_change">
        <value name="DELTA">
          <block type="math_number">
            <field name="NUM">1</field>
          </block>
        </value>
      </block>
      <block type="math_round"></block>
      <block type="math_on_list"></block>
      <block type="math_modulo"></block>
      <block type="math_constrain">
        <value name="LOW">
          <block type="math_number">
            <field name="NUM">1</field>
          </block>
        </value>
        <value name="HIGH">
          <block type="math_number">
            <field name="NUM">100</field>
          </block>
        </value>
      </block>
      <block type="math_random_int">
        <value name="FROM">
          <block type="math_number">
            <field name="NUM">1</field>
          </block>
        </value>
        <value name="TO">
          <block type="math_number">
            <field name="NUM">100</field>
          </block>
        </value>
      </block>
      <block type="math_random_float"></block>
    </category>
    <category name="{msg meaning="Apps.catLists" desc="IBID"}Lists{/msg}">
      <block type="lists_create_empty"></block>
      <block type="lists_create_with"></block>
      <block type="lists_repeat">
        <value name="NUM">
          <block type="math_number">
            <field name="NUM">5</field>
          </block>
        </value>
      </block>
      <block type="lists_length"></block>
      <block type="lists_isEmpty"></block>
      <block type="lists_indexOf">
        <value name="VALUE">
          <block type="variables_get">
            <field name="VAR">{msg meaning="Apps.listVariable" desc="IBID"}list{/msg}</field>
          </block>
        </value>
      </block>
      <block type="lists_getIndex">
        <value name="VALUE">
          <block type="variables_get">
            <field name="VAR">{msg meaning="Apps.listVariable" desc="IBID"}list{/msg}</field>
          </block>
        </value>
      </block>
      <block type="lists_setIndex">
        <value name="LIST">
          <block type="variables_get">
            <field name="VAR">{msg meaning="Apps.listVariable" desc="IBID"}list{/msg}</field>
          </block>
        </value>
      </block>
      <block type="lists_getSublist">
        <value name="LIST">
          <block type="variables_get">
            <field name="VAR">{msg meaning="Apps.listVariable" desc="IBID"}list{/msg}</field>
          </block>
        </value>
      </block>
    </category>
    <category name="{msg meaning="Apps.catVariables" desc="IBID"}Variables{/msg}" custom="VARIABLE"></category>
    <category name="{msg meaning="Apps.catProcedures" desc="IBID"}Functions{/msg}" custom="PROCEDURE"></category>
  </xml>
{/template}