Skip to content

Commit

Permalink
linting
Browse files Browse the repository at this point in the history
  • Loading branch information
Rich-Harris committed May 6, 2014
1 parent b718307 commit c22ce99
Show file tree
Hide file tree
Showing 173 changed files with 317 additions and 321 deletions.
3 changes: 1 addition & 2 deletions src/Ractive/initialise.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import initOptions from 'config/initOptions';
import warn from 'utils/warn';
import create from 'utils/create';
import extend from 'utils/extend';
import defineProperties from 'utils/defineProperties';
import getElement from 'utils/getElement';
import isArray from 'utils/isArray';
Expand Down Expand Up @@ -30,7 +29,7 @@ export default function initialiseRactiveInstance ( ractive, options ) {

// end init sequence
ractive._initing = false;
};
}

function setOptionsAndFlags ( ractive, defaults, options ) {

Expand Down
2 changes: 1 addition & 1 deletion src/Ractive/initialise/computations/createComputations.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ export default function createComputations ( ractive, computed ) {
signature = getComputationSignature( computed[ key ] );
ractive._computations[ key ] = new Computation( ractive, key, signature );
}
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default function ( signature ) {
}

return signature;
};
}

function createFunctionFromString ( signature ) {
var functionBody = 'var __ractive=this;return(' + signature.replace( pattern, function ( match, keypath ) {
Expand Down
7 changes: 3 additions & 4 deletions src/Ractive/initialise/initialiseTemplate.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import isClient from 'config/isClient';
import extend from 'utils/extend';
import fillGaps from 'utils/fillGaps';
import isObject from 'utils/isObject';
Expand All @@ -15,8 +14,8 @@ export default function ( ractive, defaults, options ) {
// Assume this is an ID of a <script type='text/ractive'> tag
if ( template.charAt( 0 ) === '#' ) {
template = templateParser.fromId( template );
}
}

parsedTemplate = templateParser.parse( template );

} else {
Expand All @@ -41,4 +40,4 @@ export default function ( ractive, defaults, options ) {
extend( ractive.partials, options.partials );


};
}
2 changes: 1 addition & 1 deletion src/Ractive/initialise/renderInstance.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ export default function renderInstance ( ractive, options ) {
ractive.transitionsEnabled = options.transitionsEnabled;

return promise;
};
}
10 changes: 5 additions & 5 deletions src/Ractive/initialise/templateParser.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import isClient from 'config/isClient';
import parse from 'parse/_parse';

export default function ( options ) {

return {
fromId: function ( id ) {
var template;
Expand All @@ -17,9 +17,9 @@ export default function ( options ) {

if ( !( template = document.getElementById( id ) )) {
throw new Error( 'Could not find template element with id #' + id );
}
}

return template.innerHTML;
return template.innerHTML;

},
parse: function ( template, parseOptions ) {
Expand All @@ -30,6 +30,6 @@ export default function ( options ) {
},
isParsed: function ( template) {
return !( typeof template === 'string' );
}
}
};
};
}
2 changes: 1 addition & 1 deletion src/Ractive/prototype/add.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ import add from 'Ractive/prototype/shared/add';

export default function ( keypath, d ) {
return add( this, keypath, ( d === undefined ? 1 : +d ) );
};
}
2 changes: 1 addition & 1 deletion src/Ractive/prototype/animate/_animate.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ export default function ( keypath, to, options ) {
animation.stop();
};
return promise;
};
}

function animate ( root, keypath, to, options ) {
var easing, duration, animation, from;
Expand Down
2 changes: 1 addition & 1 deletion src/Ractive/prototype/detach.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export default function () {
return this.fragment.detach();
};
}
2 changes: 1 addition & 1 deletion src/Ractive/prototype/find.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ export default function ( selector ) {
}

return this.fragment.find( selector );
};
}
2 changes: 1 addition & 1 deletion src/Ractive/prototype/findAll.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ export default function ( selector, options ) {

this.fragment.findAll( selector, query );
return query;
};
}
2 changes: 1 addition & 1 deletion src/Ractive/prototype/findAllComponents.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ export default function ( selector, options ) {

this.fragment.findAllComponents( selector, query );
return query;
};
}
2 changes: 1 addition & 1 deletion src/Ractive/prototype/findComponent.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export default function ( selector ) {
return this.fragment.findComponent( selector );
};
}
2 changes: 1 addition & 1 deletion src/Ractive/prototype/fire.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ export default function ( eventName ) {
for ( i=0, len=subscribers.length; i<len; i+=1 ) {
subscribers[i].apply( this, args );
}
};
}
2 changes: 1 addition & 1 deletion src/Ractive/prototype/get.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ export default function Ractive_prototype_get ( keypath ) {
}

return value;
};
}
2 changes: 1 addition & 1 deletion src/Ractive/prototype/insert.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ export default function ( target, anchor ) {

target.insertBefore( this.detach(), anchor );
this.fragment.pNode = this.el = target;
};
}
2 changes: 1 addition & 1 deletion src/Ractive/prototype/merge/_merge.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export default function merge ( keypath, array, options ) {
}

return promise;
};
}

function stringify ( item ) {
return JSON.stringify( item );
Expand Down
2 changes: 1 addition & 1 deletion src/Ractive/prototype/merge/mapOldToNewIndex.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ export default function ( oldArray, newArray ) {

newIndices.unchanged = !changed;
return newIndices;
};
}
2 changes: 1 addition & 1 deletion src/Ractive/prototype/merge/propagateChanges.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ export default function ( ractive, keypath, newIndices, lengthUnchanged ) {
if ( !lengthUnchanged ) {
notifyDependants( ractive, keypath + '.length', true );
}
};
}
2 changes: 1 addition & 1 deletion src/Ractive/prototype/observe/_observe.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,4 @@ export default function observe ( keypath, callback, options ) {
}
}
};
};
}
2 changes: 1 addition & 1 deletion src/Ractive/prototype/observe/getObserverFacade.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@ export default function getObserverFacade ( ractive, keypath, callback, options
unregisterDependant( observer );
}
};
};
}
2 changes: 1 addition & 1 deletion src/Ractive/prototype/observe/getPattern.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ export default function ( ractive, pattern ) {
});

return values;
};
}
2 changes: 1 addition & 1 deletion src/Ractive/prototype/off.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ export default function ( eventName, callback ) {
subscribers.splice( index, 1 );
}
}
};
}
2 changes: 1 addition & 1 deletion src/Ractive/prototype/on.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ export default function ( eventName, callback ) {
self.off( eventName, callback );
}
};
};
}
2 changes: 1 addition & 1 deletion src/Ractive/prototype/render.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export default function Ractive_prototype_render ( target, anchor, callback ) {

delete this._rendering;
runloop.end();
};
}

function initChildren ( instance ) {
var child;
Expand Down
2 changes: 1 addition & 1 deletion src/Ractive/prototype/renderHTML.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ export default function () {
// TODO remove this method in a future version!
warn( 'renderHTML() has been deprecated and will be removed in a future version. Please use toHTML() instead' );
return this.toHTML();
};
}
16 changes: 8 additions & 8 deletions src/Ractive/prototype/reset.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import renderInstance from 'Ractive/initialise/renderInstance';
var shouldRerender = [ 'template', 'partials', 'components', 'decorators', 'events' ].join();

export default function ( data, callback ) {
var promise, fulfilPromise, wrapper,
var promise, fulfilPromise, wrapper,
changes, rerender, i;

if ( typeof data === 'function' && !callback ) {
Expand All @@ -34,9 +34,9 @@ export default function ( data, callback ) {

this.initOptions.data = this.data;

changes = initialiseRegistries ( this, this.constructor.defaults,
changes = initialiseRegistries ( this, this.constructor.defaults,
this.initOptions, { updatesOnly: true } );

i = changes.length;
while(i--) {
if ( shouldRerender.indexOf( changes[i] > -1 ) ) {
Expand All @@ -50,17 +50,17 @@ export default function ( data, callback ) {
this.teardown();

this._initing = true;

promise = renderInstance ( this, this.initOptions );

//same as initialise, but should this be in then()?
this._initing = false;

// should this fire and when?
// this.fire( 'reset', data );

} else {

promise = new Promise( function ( fulfil ) { fulfilPromise = fulfil; });

runloop.start( this, fulfilPromise );
Expand All @@ -69,7 +69,7 @@ export default function ( data, callback ) {
notifyDependants( this, '' );

runloop.end();

this.fire( 'reset', data );
}

Expand All @@ -78,4 +78,4 @@ export default function ( data, callback ) {
}

return promise;
};
}
14 changes: 7 additions & 7 deletions src/Ractive/prototype/resetTemplate.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,20 @@ export default function ( template, callback ) {
template: template
};
}
changes = initialiseRegistries ( this,
this.constructor.defaults,
this.initOptions,

changes = initialiseRegistries ( this,
this.constructor.defaults,
this.initOptions,
options);

if ( changes.length ) {

this.teardown();

this._initing = true;

promise = renderInstance ( this, this.initOptions );

//same as initialise, but should this be in then()?
this._initing = false;

Expand All @@ -44,4 +44,4 @@ export default function ( template, callback ) {
}

return promise;
};
}
2 changes: 1 addition & 1 deletion src/Ractive/prototype/set.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ export default function Ractive_prototype_set ( keypath, value, callback ) {
}

return promise;
};
}
2 changes: 1 addition & 1 deletion src/Ractive/prototype/shared/add.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ export default function ( root, keypath, d ) {
}

return root.set( keypath, value + d );
};
}
2 changes: 1 addition & 1 deletion src/Ractive/prototype/shared/makeQuery/_makeQuery.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ export default function ( ractive, selector, live, isComponentQuery ) {
});

return query;
};
}
2 changes: 1 addition & 1 deletion src/Ractive/prototype/shared/makeQuery/cancel.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ export default function () {
liveQueries.splice( index, 1 );
liveQueries[ selector ] = null;
}
};
}
2 changes: 1 addition & 1 deletion src/Ractive/prototype/shared/makeQuery/dirty.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ export default function () {
runloop.addLiveQuery( this );
this._dirty = true;
}
};
}
2 changes: 1 addition & 1 deletion src/Ractive/prototype/shared/makeQuery/remove.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ export default function ( nodeOrComponent ) {
if ( index !== -1 ) {
this.splice( index, 1 );
}
};
}
2 changes: 1 addition & 1 deletion src/Ractive/prototype/shared/makeQuery/sort.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ import sortByItemPosition from 'Ractive/prototype/shared/makeQuery/sortByItemPos
export default function () {
this.sort( this._isComponentQuery ? sortByItemPosition : sortByDocumentPosition );
this._dirty = false;
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ export default function ( node, otherNode ) {
// In old IE, we can piggy back on the mechanism for
// comparing component positions
return sortByItemPosition( node, otherNode );
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export default function ( a, b ) {
}

throw new Error( 'An unexpected condition was met while comparing the position of two components. Please file an issue at https://github.com/RactiveJS/Ractive/issues - thanks!' );
};
}

function getParent ( item ) {
var parentFragment;
Expand Down
2 changes: 1 addition & 1 deletion src/Ractive/prototype/shared/makeQuery/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ export default function ( item, noDirty ) {

return true;
}
};
}
2 changes: 1 addition & 1 deletion src/Ractive/prototype/subtract.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ import add from 'Ractive/prototype/shared/add';

export default function ( keypath, d ) {
return add( this, keypath, ( d === undefined ? -1 : -d ) );
};
}
2 changes: 1 addition & 1 deletion src/Ractive/prototype/teardown.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,4 @@ export default function ( callback ) {
}

return promise;
};
}
2 changes: 1 addition & 1 deletion src/Ractive/prototype/toHTML.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export default function () {
return this.fragment.toString();
};
}
2 changes: 1 addition & 1 deletion src/Ractive/prototype/toggle.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ export default function ( keypath, callback ) {

value = this.get( keypath );
return this.set( keypath, !value, callback );
};
}
2 changes: 1 addition & 1 deletion src/Ractive/prototype/update.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ export default function ( keypath, callback ) {
}

return promise;
};
}
Loading

0 comments on commit c22ce99

Please sign in to comment.