Alyssa Rosenzweig 7cea452997 Move everything up one 7 jaren geleden
..
account_course_user_search 7cea452997 Move everything up one 7 jaren geleden
actAs 7cea452997 Move everything up one 7 jaren geleden
add_people 7cea452997 Move everything up one 7 jaren geleden
announcements 7cea452997 Move everything up one 7 jaren geleden
assignments 7cea452997 Move everything up one 7 jaren geleden
authentication_providers 7cea452997 Move everything up one 7 jaren geleden
blueprint_courses 7cea452997 Move everything up one 7 jaren geleden
bundles 7cea452997 Move everything up one 7 jaren geleden
calendar 7cea452997 Move everything up one 7 jaren geleden
canvas_cropper 7cea452997 Move everything up one 7 jaren geleden
choose_mastery_path 7cea452997 Move everything up one 7 jaren geleden
collaborations 7cea452997 Move everything up one 7 jaren geleden
conditional_release_stats 7cea452997 Move everything up one 7 jaren geleden
context_cards 7cea452997 Move everything up one 7 jaren geleden
context_modules 7cea452997 Move everything up one 7 jaren geleden
course_link_validator 7cea452997 Move everything up one 7 jaren geleden
course_settings 7cea452997 Move everything up one 7 jaren geleden
course_wizard 7cea452997 Move everything up one 7 jaren geleden
courses 7cea452997 Move everything up one 7 jaren geleden
custom_help_link_settings 7cea452997 Move everything up one 7 jaren geleden
dashboard 7cea452997 Move everything up one 7 jaren geleden
dashboard_card 7cea452997 Move everything up one 7 jaren geleden
discussion_topics 7cea452997 Move everything up one 7 jaren geleden
due_dates 7cea452997 Move everything up one 7 jaren geleden
editor 7cea452997 Move everything up one 7 jaren geleden
eportfolios 7cea452997 Move everything up one 7 jaren geleden
epub_exports 7cea452997 Move everything up one 7 jaren geleden
external_apps 7cea452997 Move everything up one 7 jaren geleden
files 7cea452997 Move everything up one 7 jaren geleden
gradebook 7cea452997 Move everything up one 7 jaren geleden
gradebook-history 7cea452997 Move everything up one 7 jaren geleden
gradezilla 7cea452997 Move everything up one 7 jaren geleden
grading 7cea452997 Move everything up one 7 jaren geleden
groups 7cea452997 Move everything up one 7 jaren geleden
help_dialog 7cea452997 Move everything up one 7 jaren geleden
mediaelement 7cea452997 Move everything up one 7 jaren geleden
move_item 7cea452997 Move everything up one 7 jaren geleden
navigation_header 7cea452997 Move everything up one 7 jaren geleden
new_user_tutorial 7cea452997 Move everything up one 7 jaren geleden
notification_preferences 7cea452997 Move everything up one 7 jaren geleden
outcomes 7cea452997 Move everything up one 7 jaren geleden
quizzes 7cea452997 Move everything up one 7 jaren geleden
rubrics 7cea452997 Move everything up one 7 jaren geleden
shared 7cea452997 Move everything up one 7 jaren geleden
speed_grader 7cea452997 Move everything up one 7 jaren geleden
styleguide 7cea452997 Move everything up one 7 jaren geleden
theme_editor 7cea452997 Move everything up one 7 jaren geleden
webzip_export 7cea452997 Move everything up one 7 jaren geleden
README.md 7cea452997 Move everything up one 7 jaren geleden
appBootstrap.js 7cea452997 Move everything up one 7 jaren geleden
canvasCssVariablesPolyfill.js 7cea452997 Move everything up one 7 jaren geleden
railsFlashNotificationsHelper.js 7cea452997 Move everything up one 7 jaren geleden

README.md

This directory is temporary until we rework the front-end build This is where we are headed.

Stuff you can do in Canvas JSX files

BUT WAIT!

Your file needs to:

  1. Have a file name with the .jsx extension.

JSX

function foo(paths) {
  return <svg>{paths}</svg>;
}

Arrow Functions

Arrow Function Reference

var arr = ['hydrogen', 'helium', 'lithium'];

// es5
var a = arr.map(function(s){ return s.length });

// es6
var b = arr.map( s => s.length );

// with curlies requires normal return
var b = arr.map( (s) => {
  return s.length
});

// lexical `this`
var obj = {
  multiplier: 3,

  multiplyStuff (stuff) {
    return stuff.map((x) =>
      // no bind!
      return this.multiplier * x;
    )
  }
};

Classes

Class Reference

class EventEmitter {
  constructor() {
    // called when created
  }
  emit() {
    // ...
  }
  on() {
    // ...
  }
  once() {
    // ...
  }
  removeListener() {
    // ...
  }
  removeAllListeners() {
    // ...
  }
}

Extending and calling super.

class Domain extends EventEmitter {
  constructor() {
    super();
    this.members = [];
  }
}

Creating instances

var domain = new Domain();

Destructuring

// es5
var map = _.map;
var each = _.each;

// es6
var {map, each} = _;

Concise Object Methods

// es5
var obj = {
  foo: function() {}
  bar: function() {}
};

// es6
var obj = {
  foo() {}
  bar() {}
};

Object Short Notation

// es5
function() {
  // ...
  return {foo: foo, bar: bar, x: 10};
}

// es6
function() {
  // ...
  return {foo, bar, x: 10};
}

Rest Parameters

Rest Parameters Reference

// es5
function multiply(multiplier) {
  var numbers = Array.prototype.slice.call(arguments, 0);
  return number.map(function(n) { return multiplier * n; });
}

// es6
function multiply(multiplier, ...numbers) {
  return numbers.map( n => multiplier * n);
}

String Templates

String Template Reference

Multiline strings:

// es5
console.log("string text line 1" +
"string text line 2");

// es6
console.log(`string text line 1
string text line 2`);

Interpolated strings

var a = 5;
var b = 10;

// es5
console.log("Fifteen is " + (a + b) + " and not " + (2 * a + b) + ".");

// es6
console.log(`Fifteen is ${a + b} and not ${2 * a + b}.`);