moved JIT to npm. tests pass. whoop whoop

This commit is contained in:
Devin Howard 2016-09-23 11:47:40 +08:00
parent 700119cc9e
commit bda740491c
7 changed files with 23 additions and 16 deletions

View file

@ -14,7 +14,6 @@
//= require jquery-ui //= require jquery-ui
//= require jquery_ujs //= require jquery_ujs
//= require_directory ./lib //= require_directory ./lib
//= require ./src/JIT
//= require ./src/Metamaps.Erb //= require ./src/Metamaps.Erb
//= require ./webpacked/metamaps.bundle //= require ./webpacked/metamaps.bundle
//= require ./src/check-canvas-support //= require ./src/check-canvas-support

View file

@ -1,9 +1,9 @@
/* global Metamaps, $jit */ /* global Metamaps, $jit */
const $jit = $jit || {}
import _ from 'lodash' import _ from 'lodash'
import $jit from '../patched/JIT'
import Active from './Active' import Active from './Active'
import Control from './Control' import Control from './Control'
import Create from './Create' import Create from './Create'
@ -21,6 +21,7 @@ import TopicCard from './TopicCard'
import Util from './Util' import Util from './Util'
import Visualize from './Visualize' import Visualize from './Visualize'
/* /*
* Metamaps.Erb * Metamaps.Erb
* Metamaps.Mappings * Metamaps.Mappings
@ -284,7 +285,8 @@ const JIT = {
ForceDirected: { ForceDirected: {
animateSavedLayout: { animateSavedLayout: {
modes: ['linear'], modes: ['linear'],
transition: $jit.Trans.Quad.easeInOut, // TODO fix tests so we don't need _.get
transition: _.get($jit, 'Trans.Quad.easeInOut'),
duration: 800, duration: 800,
onComplete: function () { onComplete: function () {
Visualize.mGraph.busy = false Visualize.mGraph.busy = false
@ -293,7 +295,8 @@ const JIT = {
}, },
animateFDLayout: { animateFDLayout: {
modes: ['linear'], modes: ['linear'],
transition: $jit.Trans.Elastic.easeOut, // TODO fix tests so we don't need _.get
transition: _.get($jit, 'Trans.Elastic.easeOut'),
duration: 800, duration: 800,
onComplete: function () { onComplete: function () {
Visualize.mGraph.busy = false Visualize.mGraph.busy = false
@ -554,7 +557,8 @@ const JIT = {
ForceDirected3D: { ForceDirected3D: {
animate: { animate: {
modes: ['linear'], modes: ['linear'],
transition: $jit.Trans.Elastic.easeOut, // TODO fix tests so we don't need _.get
transition: _.get($jit, 'Trans.Elastic.easeOut'),
duration: 2500, duration: 2500,
onComplete: function () { onComplete: function () {
Visualize.mGraph.busy = false Visualize.mGraph.busy = false

View file

@ -2,6 +2,8 @@
import _ from 'lodash' import _ from 'lodash'
import $jit from '../patched/JIT'
import Visualize from './Visualize' import Visualize from './Visualize'
import JIT from './JIT' import JIT from './JIT'

View file

@ -1,5 +1,7 @@
/* global Metamaps, $ */ /* global Metamaps, $ */
import $jit from '../patched/JIT'
import Active from './Active' import Active from './Active'
import AutoLayout from './AutoLayout' import AutoLayout from './AutoLayout'
import Create from './Create' import Create from './Create'
@ -15,6 +17,7 @@ import TopicCard from './TopicCard'
import Util from './Util' import Util from './Util'
import Visualize from './Visualize' import Visualize from './Visualize'
/* /*
* Metamaps.Topic.js.erb * Metamaps.Topic.js.erb
* *

View file

@ -2,6 +2,8 @@
import _ from 'lodash' import _ from 'lodash'
import $jit from '../patched/JIT'
import Active from './Active' import Active from './Active'
import JIT from './JIT' import JIT from './JIT'
import Router from './Router' import Router from './Router'

View file

@ -20,7 +20,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE. THE SOFTWARE.
*/ */
(function () {
/* /*
File: Core.js File: Core.js
@ -34,7 +33,11 @@ THE SOFTWARE.
This variable is the *only* global variable defined in the Toolkit. This variable is the *only* global variable defined in the Toolkit.
There are also other interesting properties attached to this variable described below. There are also other interesting properties attached to this variable described below.
*/ */
window.$jit = function(w) { // START METAMAPS CODE
const $jit = function(w) {
// ORIGINAL:
// window.$jit = function(w) {
// END METAMAPS CODE
w = w || window; w = w || window;
for(var k in $jit) { for(var k in $jit) {
if($jit[k].$extend) { if($jit[k].$extend) {
@ -11312,7 +11315,4 @@ $jit.ForceDirected3D.$extend = true;
})($jit.ForceDirected3D); })($jit.ForceDirected3D);
export default $jit
})();

View file

@ -2,10 +2,7 @@
import chai from 'chai' import chai from 'chai'
// JIT needs window.$jit import Import from '../src/Metamaps/Import'
require('../../app/assets/javascripts/src/JIT.js')
const Import = require('../src/Metamaps/Import')
const { expect } = chai const { expect } = chai