github.com/brownsys/tracing-framework-go@v0.0.0-20161210174012-0542a62412fe/go/darwin_amd64/misc/tour/static/js/values.js (about)

     1  /* Copyright 2012 The Go Authors.   All rights reserved.
     2   * Use of this source code is governed by a BSD-style
     3   * license that can be found in the LICENSE file.
     4   */
     5  'use strict';
     6  
     7  angular.module('tour.values', []).
     8  
     9  // List of modules with description and lessons in it.
    10  value('tableOfContents', [{
    11      'id': 'mechanics',
    12      'title': 'Using the tour',
    13      'description': '<p>Welcome to a tour of the <a href="http://golang.org">Go programming language</a>. The tour covers the most important features of the language, mainly:</p>',
    14      'lessons': ['welcome']
    15  }, {
    16      'id': 'basics',
    17      'title': 'Basics',
    18      'description': '<p>The starting point, learn all the basics of the language.</p><p>Declaring variables, calling functions, and all the things you need to know before moving to the next lessons.</p>',
    19      'lessons': ['basics', 'flowcontrol', 'moretypes']
    20  }, {
    21      'id': 'methods',
    22      'title': 'Methods and interfaces',
    23      'description': '<p>Learn how to define methods on types, how to declare interfaces, and how to put everything together.</p>',
    24      'lessons': ['methods']
    25  }, {
    26      'id': 'concurrency',
    27      'title': 'Concurrency',
    28      'description': '<p>Go provides concurrency features as part of the core language.</p><p>This module goes over goroutines and channels, and how they are used to implement different concurrency patterns.</p>',
    29      'lessons': ['concurrency']
    30  }]).
    31  
    32  // translation
    33  value('translation', {
    34      'off': 'off',
    35      'on': 'on',
    36      'syntax': 'Syntax-Highlighting',
    37      'lineno': 'Line-Numbers',
    38      'reset': 'Reset Slide',
    39      'format': 'Format Source Code',
    40      'kill': 'Kill Program',
    41      'run': 'Run',
    42      'compile': 'Compile and Run',
    43      'more': 'Options',
    44      'toc': 'Table of Contents',
    45      'prev': 'Previous',
    46      'next': 'Next',
    47      'waiting': 'Waiting for remote server...',
    48      'errcomm': 'Error communicating with remote server.',
    49      'submit-feedback': 'Send feedback about this page',
    50  
    51      // GitHub issue template: update repo and messaging when translating.
    52      'github-repo': 'github.com/golang/tour',
    53      'issue-title': 'tour: [REPLACE WITH SHORT DESCRIPTION]',
    54      'issue-message': 'Change the title above to describe your issue and add your feedback here, including code if necessary',
    55      'context': 'Context',
    56  }).
    57  
    58  // Config for codemirror plugin
    59  value('ui.config', {
    60      codemirror: {
    61          mode: 'text/x-go',
    62          matchBrackets: true,
    63          lineNumbers: true,
    64          autofocus: true,
    65          indentWithTabs: true,
    66          indentUnit: 4,
    67          tabSize: 4,
    68          lineWrapping: true,
    69          extraKeys: {
    70              'Shift-Enter': function() {
    71                  $('#run').click();
    72              },
    73              'Ctrl-Enter': function() {
    74                  $('#format').click();
    75              },
    76              'PageDown': function() {
    77                  return false;
    78              },
    79              'PageUp': function() {
    80                  return false;
    81              },
    82          },
    83          // TODO: is there a better way to do this?
    84          // AngularJS values can't depend on factories.
    85          onChange: function() {
    86              if (window.codeChanged !== null) window.codeChanged();
    87          }
    88      }
    89  }).
    90  
    91  // mapping from the old paths (#42) to the new organization.
    92  // The values have been generated with the map.sh script in the tools directory.
    93  value('mapping', {
    94      '#1': '/welcome/1', // Hello, 世界
    95      '#2': '/welcome/2', // Go local
    96      '#3': '/basics/1', // Packages
    97      '#4': '/basics/2', // Imports
    98      '#5': '/basics/3', // Exported names
    99      '#6': '/basics/4', // Functions
   100      '#7': '/basics/5', // Functions continued
   101      '#8': '/basics/6', // Multiple results
   102      '#9': undefined, // Named results
   103      '#10': '/basics/8', // Variables
   104      '#11': '/basics/9', // Variables with initializers
   105      '#12': '/basics/10', // Short variable declarations
   106      '#13': '/basics/11', // Basic types
   107      '#14': '/basics/13', // Type conversions
   108      '#15': '/basics/15', // Constants
   109      '#16': '/basics/16', // Numeric Constants
   110      '#17': '/flowcontrol/1', // For
   111      '#18': '/flowcontrol/2', // For continued
   112      '#19': '/flowcontrol/3', // For is Go's "while"
   113      '#20': '/flowcontrol/4', // Forever
   114      '#21': '/flowcontrol/5', // If
   115      '#22': '/flowcontrol/6', // If with a short statement
   116      '#23': '/flowcontrol/7', // If and else
   117      '#24': '/flowcontrol/8', // Exercise: Loops and Functions
   118      '#25': '/moretypes/2', // Structs
   119      '#26': '/moretypes/3', // Struct Fields
   120      '#27': '/moretypes/1', // Pointers
   121      '#28': '/moretypes/5', // Struct Literals
   122      '#29': undefined, // The new function
   123      '#30': '/moretypes/6', // Arrays
   124      '#31': '/moretypes/7', // Slices
   125      '#32': '/moretypes/8', // Slicing slices
   126      '#33': '/moretypes/9', // Making slices
   127      '#34': '/moretypes/10', // Nil slices
   128      '#35': '/moretypes/12', // Range
   129      '#36': '/moretypes/13', // Range continued
   130      '#37': '/moretypes/14', // Exercise: Slices
   131      '#38': '/moretypes/15', // Maps
   132      '#39': '/moretypes/16', // Map literals
   133      '#40': '/moretypes/17', // Map literals continued
   134      '#41': '/moretypes/18', // Mutating Maps
   135      '#42': '/moretypes/19', // Exercise: Maps
   136      '#43': '/moretypes/20', // Function values
   137      '#44': '/moretypes/21', // Function closures
   138      '#45': '/moretypes/22', // Exercise: Fibonacci closure
   139      '#46': '/flowcontrol/9', // Switch
   140      '#47': '/flowcontrol/10', // Switch evaluation order
   141      '#48': '/flowcontrol/11', // Switch with no condition
   142      '#49': undefined, // Advanced Exercise: Complex cube roots
   143      '#50': undefined, // Methods and Interfaces
   144      '#51': '/methods/1', // Methods
   145      '#52': '/methods/2', // Methods continued
   146      '#53': '/methods/3', // Methods with pointer receivers
   147      '#54': '/methods/4', // Interfaces
   148      '#55': '/methods/5', // Interfaces are satisfied implicitly
   149      '#56': '/methods/8', // Errors
   150      '#57': '/methods/9', // Exercise: Errors
   151      '#58': '/methods/13', // Web servers
   152      '#59': '/methods/14', // Exercise: HTTP Handlers
   153      '#60': '/methods/15', // Images
   154      '#61': '/methods/16', // Exercise: Images
   155      '#62': undefined, // Exercise: Rot13 Reader
   156      '#63': undefined, // Concurrency
   157      '#64': '/concurrency/1', // Goroutines
   158      '#65': '/concurrency/2', // Channels
   159      '#66': '/concurrency/3', // Buffered Channels
   160      '#67': '/concurrency/4', // Range and Close
   161      '#68': '/concurrency/5', // Select
   162      '#69': '/concurrency/6', // Default Selection
   163      '#70': '/concurrency/7', // Exercise: Equivalent Binary Trees
   164      '#71': '/concurrency/8', // Exercise: Equivalent Binary Trees
   165      '#72': '/concurrency/9', // Exercise: Web Crawler
   166      '#73': '/concurrency/10', // Where to Go from here...
   167  });