revert(format): Revert "chore(format): update to latest formatter"

This reverts commit 03627aa84d.
This commit is contained in:
Alex Rickabaugh
2016-04-12 09:40:37 -07:00
parent 03627aa84d
commit 60727c4d2b
527 changed files with 19247 additions and 13970 deletions

View File

@ -24,71 +24,66 @@ function loadTemplate(templateId, repeatCount) {
}
angular.module('app', [])
.directive(
'dir0',
[
'$parse',
function($parse) {
return {
compile: function($element, $attrs) {
var expr = $parse($attrs.attr0);
return function($scope) { $scope.$watch(expr, angular.noop); }
}
};
}
])
.directive(
'dir1',
[
'$parse',
function($parse) {
return {
compile: function($element, $attrs) {
var expr = $parse($attrs.attr1);
return function($scope) { $scope.$watch(expr, angular.noop); }
}
};
}
])
.directive(
'dir2',
[
'$parse',
function($parse) {
return {
compile: function($element, $attrs) {
var expr = $parse($attrs.attr2);
return function($scope) { $scope.$watch(expr, angular.noop); }
}
};
}
])
.directive(
'dir3',
[
'$parse',
function($parse) {
return {
compile: function($element, $attrs) {
var expr = $parse($attrs.attr3);
return function($scope) { $scope.$watch(expr, angular.noop); }
}
};
}
])
.directive(
'dir4',
[
'$parse',
function($parse) {
return {
compile: function($element, $attrs) {
var expr = $parse($attrs.attr4);
return function($scope) { $scope.$watch(expr, angular.noop); }
}
};
}
])
.directive('dir0',
[
'$parse',
function($parse) {
return {
compile: function($element, $attrs) {
var expr = $parse($attrs.attr0);
return function($scope) { $scope.$watch(expr, angular.noop); }
}
};
}
])
.directive('dir1',
[
'$parse',
function($parse) {
return {
compile: function($element, $attrs) {
var expr = $parse($attrs.attr1);
return function($scope) { $scope.$watch(expr, angular.noop); }
}
};
}
])
.directive('dir2',
[
'$parse',
function($parse) {
return {
compile: function($element, $attrs) {
var expr = $parse($attrs.attr2);
return function($scope) { $scope.$watch(expr, angular.noop); }
}
};
}
])
.directive('dir3',
[
'$parse',
function($parse) {
return {
compile: function($element, $attrs) {
var expr = $parse($attrs.attr3);
return function($scope) { $scope.$watch(expr, angular.noop); }
}
};
}
])
.directive('dir4',
[
'$parse',
function($parse) {
return {
compile: function($element, $attrs) {
var expr = $parse($attrs.attr4);
return function($scope) { $scope.$watch(expr, angular.noop); }
}
};
}
])
.run([
'$compile',
function($compile) {

View File

@ -16,75 +16,72 @@ angular.module('app', [])
}
})
.filter('noop', function() { return function(input) { return input; }; })
.directive(
'largetable',
function() {
return {
restrict: 'E',
templateUrl: 'largetable-js-template.html',
controller: 'DataController'
};
})
.controller(
'DataController',
function($scope) {
bindAction('#destroyDom', destroyDom);
bindAction('#createDom', createDom);
.directive('largetable',
function() {
return {
restrict: 'E',
templateUrl: 'largetable-js-template.html',
controller: 'DataController'
};
})
.controller('DataController',
function($scope) {
bindAction('#destroyDom', destroyDom);
bindAction('#createDom', createDom);
function destroyDom() {
$scope.$apply(function() { $scope.benchmarkType = 'none'; });
}
function destroyDom() {
$scope.$apply(function() { $scope.benchmarkType = 'none'; });
}
function createDom() {
$scope.$apply(function() { $scope.benchmarkType = benchmarkType; });
}
function createDom() {
$scope.$apply(function() { $scope.benchmarkType = benchmarkType; });
}
var data = $scope.data = [];
var data = $scope.data = [];
function iGetter() { return this.i; }
function jGetter() { return this.j; }
function iGetter() { return this.i; }
function jGetter() { return this.j; }
for (var i = 0; i < totalRows; i++) {
data[i] = [];
for (var j = 0; j < totalColumns; j++) {
data[i][j] = {i: i, j: j, iFn: iGetter, jFn: jGetter};
}
}
})
.directive(
'baselineBindingTable',
function() {
return {
restrict: 'E',
link: function($scope, $element) {
var i, j, row, cell, comment;
var template = document.createElement('span');
template.setAttribute('ng-repeat', 'foo in foos');
template.classList.add('ng-scope');
template.appendChild(document.createElement('span'));
template.appendChild(document.createTextNode(':'));
template.appendChild(document.createElement('span'));
template.appendChild(document.createTextNode('|'));
for (var i = 0; i < totalRows; i++) {
data[i] = [];
for (var j = 0; j < totalColumns; j++) {
data[i][j] = {i: i, j: j, iFn: iGetter, jFn: jGetter};
}
}
})
.directive('baselineBindingTable',
function() {
return {
restrict: 'E',
link: function($scope, $element) {
var i, j, row, cell, comment;
var template = document.createElement('span');
template.setAttribute('ng-repeat', 'foo in foos');
template.classList.add('ng-scope');
template.appendChild(document.createElement('span'));
template.appendChild(document.createTextNode(':'));
template.appendChild(document.createElement('span'));
template.appendChild(document.createTextNode('|'));
for (i = 0; i < totalRows; i++) {
row = document.createElement('div');
$element[0].appendChild(row);
for (j = 0; j < totalColumns; j++) {
cell = template.cloneNode(true);
row.appendChild(cell);
cell.childNodes[0].textContent = i;
cell.childNodes[2].textContent = j;
cell.ng3992 = 'xxx';
comment = document.createComment('ngRepeat end: bar in foo');
row.appendChild(comment);
}
for (i = 0; i < totalRows; i++) {
row = document.createElement('div');
$element[0].appendChild(row);
for (j = 0; j < totalColumns; j++) {
cell = template.cloneNode(true);
row.appendChild(cell);
cell.childNodes[0].textContent = i;
cell.childNodes[2].textContent = j;
cell.ng3992 = 'xxx';
comment = document.createComment('ngRepeat end: bar in foo');
row.appendChild(comment);
}
comment = document.createComment('ngRepeat end: foo in foos');
$element[0].appendChild(comment);
}
}
};
})
comment = document.createComment('ngRepeat end: foo in foos');
$element[0].appendChild(comment);
}
}
};
})
.directive('baselineInterpolationTable', function() {
return {
restrict: 'E',

View File

@ -22,10 +22,10 @@ var module = angular.module('app', []);
for (var depth = 0; depth < MAX_DEPTH; depth++) {
addTreeDirective(module, depth);
}
module
.config([
'$compileProvider', function($compileProvider) { $compileProvider.debugInfoEnabled(false); }
])
module.config([
'$compileProvider',
function($compileProvider) { $compileProvider.debugInfoEnabled(false); }
])
.run([
'$rootScope',
function($rootScope) {
@ -64,7 +64,6 @@ class TreeNode {
function buildTree(maxDepth, values, curDepth) {
if (maxDepth === curDepth) return new TreeNode('', null, null);
return new TreeNode(
values[curDepth], buildTree(maxDepth, values, curDepth + 1),
buildTree(maxDepth, values, curDepth + 1));
return new TreeNode(values[curDepth], buildTree(maxDepth, values, curDepth + 1),
buildTree(maxDepth, values, curDepth + 1));
}

View File

@ -11,18 +11,18 @@ var TreeComponent = React.createClass({
var left = null;
if (treeNode.left) {
left = React.createElement(
'span', {}, [React.createElement(TreeComponent, {treeNode: treeNode.left}, '')])
"span", {}, [React.createElement(TreeComponent, {treeNode: treeNode.left}, "")])
}
var right = null;
if (treeNode.right) {
right = React.createElement(
'span', {}, [React.createElement(TreeComponent, {treeNode: treeNode.right}, '')])
"span", {}, [React.createElement(TreeComponent, {treeNode: treeNode.right}, "")])
}
var span = React.createElement('span', {}, [' ' + treeNode.value, left, right]);
var span = React.createElement("span", {}, [" " + treeNode.value, left, right]);
return (React.createElement('tree', {}, [span]));
return (React.createElement("tree", {}, [span]));
}
});
@ -34,9 +34,8 @@ export function main() {
bindAction('#createDom', createDom);
var empty = new TreeNode(0, null, null);
var rootComponent = React.render(
React.createElement(TreeComponent, {treeNode: empty}, ''),
document.getElementById('rootTree'));
var rootComponent = React.render(React.createElement(TreeComponent, {treeNode: empty}, ""),
document.getElementById('rootTree'));
function destroyDom() { rootComponent.setProps({treeNode: empty}); }
@ -61,7 +60,6 @@ class TreeNode {
function buildTree(maxDepth, values, curDepth) {
if (maxDepth === curDepth) return new TreeNode('', null, null);
return new TreeNode(
values[curDepth], buildTree(maxDepth, values, curDepth + 1),
buildTree(maxDepth, values, curDepth + 1));
return new TreeNode(values[curDepth], buildTree(maxDepth, values, curDepth + 1),
buildTree(maxDepth, values, curDepth + 1));
}

View File

@ -7,57 +7,57 @@ export function main() {
}
angular.module('app', [])
.directive(
'tree',
function() {
return {
scope: {data: '='},
template: '<span> {{data.value}}' +
' <span tree-if="data.left"></span>' +
' <span tree-if="data.right"></span>' +
'</span>'
};
})
.directive('tree',
function() {
return {
scope: {data: '='},
template: '<span> {{data.value}}' +
' <span tree-if="data.left"></span>' +
' <span tree-if="data.right"></span>' +
'</span>'
};
})
// special directive for "if" as angular 1.3 does not support
// recursive components.
.directive(
'treeIf',
[
'$compile', '$parse',
function($compile, $parse) {
var transcludeFn;
return {
compile: function(element, attrs) {
var expr = $parse('!!' + attrs.treeIf);
var template = '<tree data="' + attrs.treeIf + '"></tree>';
var transclude;
return function($scope, $element, $attrs) {
if (!transclude) {
transclude = $compile(template);
}
var childScope;
var childElement;
$scope.$watch(expr, function(newValue) {
if (childScope) {
childScope.$destroy();
childElement.remove();
childScope = null;
childElement = null;
}
if (newValue) {
childScope = $scope.$new();
childElement =
transclude(childScope, function(clone) { $element.append(clone); });
}
});
}
.directive('treeIf',
[
'$compile',
'$parse',
function($compile, $parse) {
var transcludeFn;
return {
compile: function(element, attrs) {
var expr = $parse('!!' + attrs.treeIf);
var template = '<tree data="' + attrs.treeIf + '"></tree>';
var transclude;
return function($scope, $element, $attrs) {
if (!transclude) {
transclude = $compile(template);
}
var childScope;
var childElement;
$scope.$watch(expr, function(newValue) {
if (childScope) {
childScope.$destroy();
childElement.remove();
childScope = null;
childElement = null;
}
if (newValue) {
childScope = $scope.$new();
childElement = transclude(childScope,
function(clone) { $element.append(clone); });
}
});
}
}
}
}
])
}
}
}
])
.config([
'$compileProvider', function($compileProvider) { $compileProvider.debugInfoEnabled(false); }
'$compileProvider',
function($compileProvider) { $compileProvider.debugInfoEnabled(false); }
])
.run([
'$rootScope',
@ -94,7 +94,6 @@ class TreeNode {
function buildTree(maxDepth, values, curDepth) {
if (maxDepth === curDepth) return new TreeNode('', null, null);
return new TreeNode(
values[curDepth], buildTree(maxDepth, values, curDepth + 1),
buildTree(maxDepth, values, curDepth + 1));
return new TreeNode(values[curDepth], buildTree(maxDepth, values, curDepth + 1),
buildTree(maxDepth, values, curDepth + 1));
}