canvas-lms/app/jsx
Spencer Olson 4699895c9d add jquery selector cache
Adds the JQuerySelectorCache. This will be used in speed_grader.js
for caching jQuery selectors.

closes GRADE-678

Test Plan:
1. Verify specs pass. Since the JQuerySelectorCache is not consumed
   by anything yet, no other steps are needed in this test plan.

Change-Id: Id62e89d66b99a6a43cd05ce02b487777b2b277d2
Reviewed-on: https://gerrit.instructure.com/133502
Reviewed-by: Shahbaz Javeed <sjaveed@instructure.com>
Tested-by: Keith T. Garner <kgarner@instructure.com>
Reviewed-by: Keith T. Garner <kgarner@instructure.com>
Product-Review: Keith T. Garner <kgarner@instructure.com>
QA-Review: Keith T. Garner <kgarner@instructure.com>
2017-11-22 16:00:46 +00:00
..
account_course_user_search Fix ordering on the “total_students” column 2017-11-14 18:30:45 +00:00
actAs fix broken close focus for Act as User 2017-11-15 18:25:39 +00:00
add_people use new addPeople dialog to fix a bunch of bugs 2017-11-09 00:28:03 +00:00
announcements Introduce HTML into Recent Announcements in a Friendly Way 2017-11-01 23:01:10 +00:00
assignments Add originality report visibility settings 2017-08-30 20:18:23 +00:00
authentication_providers Upgrade React, instructure-ui and instructure-icons 2017-05-16 21:15:44 +00:00
blueprint_courses Show error when opening modal from blueprint sidebar fails 2017-09-25 12:38:47 +00:00
bundles pagination works in outcomes list 2017-11-16 17:11:55 +00:00
calendar Upgrade to Inst-UI 3.2 2017-09-07 17:14:42 +00:00
canvas_cropper fix flaky javascript spec by using callback prop 2017-11-06 21:10:30 +00:00
choose_mastery_path Upgrade React, instructure-ui and instructure-icons 2017-05-16 21:15:44 +00:00
collaborations Make it more clear when entering external content 2017-08-21 15:55:07 +00:00
conditional_release_stats fix mastery paths js error when student has teacher roles 2017-09-28 19:44:36 +00:00
context_cards Adds centering to mouse-over tip for gradebook's sidebar bar graphs 2017-09-21 22:16:35 +00:00
context_modules Upgrade React, instructure-ui and instructure-icons 2017-05-16 21:15:44 +00:00
course_link_validator da licença part 42 2017-04-28 21:21:27 +00:00
course_settings upload module files direct to s3 2017-11-13 23:16:46 +00:00
course_wizard replace all "publish" icons with the "solid" version app-wide 2017-09-25 22:06:31 +00:00
courses Upgrade to Inst-UI 3.2 2017-09-07 17:14:42 +00:00
custom_help_link_settings Add Observers and Unenrolled options for help link availability 2017-11-06 22:05:31 +00:00
dashboard Paginate and student_enabled check 2017-08-23 21:02:05 +00:00
dashboard_card Add move options to a TabList within current ColorPicker 2017-09-19 20:01:38 +00:00
discussion_topics da licença part 42 2017-04-28 21:21:27 +00:00
due_dates allow a comma-separated user_ids list to course users 2017-11-13 13:17:13 +00:00
editor Upgrade React, instructure-ui and instructure-icons 2017-05-16 21:15:44 +00:00
eportfolios Upgrade to Inst-UI 3.2 2017-09-07 17:14:42 +00:00
epub_exports Upgrade React, instructure-ui and instructure-icons 2017-05-16 21:15:44 +00:00
external_apps Don't send null in jquery ajax request 2017-11-09 22:00:45 +00:00
files fix folder access check in right pane of files ui 2017-09-27 20:06:45 +00:00
gradebook add grade input to grade detail tray 2017-10-20 17:50:34 +00:00
gradebook-history rename grade history to gradebook history 2017-10-18 22:38:14 +00:00
gradezilla save or reorder columns with api only when changed 2017-11-07 23:06:54 +00:00
grading show totals as percentage for weighted grading periods 2017-11-06 14:31:32 +00:00
groups allow course admins without group manage rights to visit 2017-09-11 12:28:56 +00:00
help_dialog fix help links for unauthenticated user 2017-09-13 16:18:26 +00:00
login da licença part 42 2017-04-28 21:21:27 +00:00
mediaelement mediaelement accessibility 2017-09-07 20:36:07 +00:00
modules/utils da licença part 42 2017-04-28 21:21:27 +00:00
move_item Add ability to Move Content in Bulk to Other Groups 2017-11-16 16:27:54 +00:00
navigation_header Upgrade to Inst-UI 3.2 2017-09-07 17:14:42 +00:00
new_user_tutorial Close new user tutorial in IE11 and Edge 2017-10-25 20:30:17 +00:00
notification_preferences Upgrade React, instructure-ui and instructure-icons 2017-05-16 21:15:44 +00:00
outcomes Upgrade to Inst-UI 3.2 2017-09-07 17:14:42 +00:00
quizzes da licença part 42 2017-04-28 21:21:27 +00:00
rubrics add criterion copy feature to rubrics 2017-10-19 16:40:12 +00:00
shared add jquery selector cache 2017-11-22 16:00:46 +00:00
speed_grader da licença part 42 2017-04-28 21:21:27 +00:00
styleguide da licença part 42 2017-04-28 21:21:27 +00:00
subnav_menu da licença part 42 2017-04-28 21:21:27 +00:00
theme_editor Add msg to clear confusion about “Current Theme” 2017-11-02 14:07:25 +00:00
webzip_export Upgrade React, instructure-ui and instructure-icons 2017-05-16 21:15:44 +00:00
.eslintrc.js da licença part 42 2017-04-28 21:21:27 +00:00
README.md Start using Babel to compile files in the JSX folder 2015-10-23 20:54:35 +00:00
appBootstrap.js Upgrade React, instructure-ui and instructure-icons 2017-05-16 21:15:44 +00:00
canvasCssVariablesPolyfill.js Fix CORS issue for cssVarsPolyfill in Edge 2017-09-27 14:55:07 +00:00
dashboardPlannerHelper.js Pass down card view function for Canvas Planner 2017-06-21 00:05:53 +00:00
fakeRequireJSFallback.js [webpack] load scripts ASAP, but still execute after dom parsed 2017-05-16 23:42:38 +00:00
railsFlashNotificationsHelper.js fix a11y grading period filter polite announcement 2017-06-26 16:12:56 +00:00

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}.`);