Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
todomvc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Eugene Shen
todomvc
Commits
64445b01
Commit
64445b01
authored
Feb 08, 2014
by
Sindre Sorhus
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #838 from passy/jscs
Add initial jscs configuration
parents
f341c101
9bb99d58
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
126 additions
and
12 deletions
+126
-12
.jscs.json
.jscs.json
+109
-0
architecture-examples/angularjs/js/directives/todoEscape.js
architecture-examples/angularjs/js/directives/todoEscape.js
+0
-1
architecture-examples/angularjs/js/directives/todoFocus.js
architecture-examples/angularjs/js/directives/todoFocus.js
+2
-1
architecture-examples/backbone/js/views/app-view.js
architecture-examples/backbone/js/views/app-view.js
+1
-1
architecture-examples/backbone/js/views/todo-view.js
architecture-examples/backbone/js/views/todo-view.js
+14
-9
No files found.
.jscs.json
0 → 100644
View file @
64445b01
{
"requireCurlyBraces"
:
[
"if"
,
"else"
,
"for"
,
"while"
,
"do"
,
"try"
,
"catch"
],
"requireSpaceAfterKeywords"
:
[
"if"
,
"else"
,
"for"
,
"while"
,
"do"
,
"switch"
,
"return"
,
"try"
,
"catch"
],
"requireLeftStickedOperators"
:
[
","
],
"requireParenthesesAroundIIFE"
:
true
,
"requireSpacesInFunctionExpression"
:
{
"beforeOpeningCurlyBrace"
:
true
},
"disallowSpaceAfterPrefixUnaryOperators"
:
[
"++"
,
"--"
,
"+"
,
"-"
,
"~"
,
"!"
],
"disallowSpaceBeforePostfixUnaryOperators"
:
[
"++"
,
"--"
],
"disallowEmptyBlocks"
:
true
,
"disallowSpacesInsideArrayBrackets"
:
true
,
"disallowSpacesInsideParentheses"
:
true
,
"disallowQuotedKeysInObjects"
:
true
,
"disallowSpaceAfterObjectKeys"
:
true
,
"requireCommaBeforeLineBreak"
:
true
,
"requireSpaceBeforeBinaryOperators"
:
[
"+"
,
"-"
,
"/"
,
"*"
,
"="
,
"=="
,
"==="
,
"!="
,
"!=="
],
"requireSpaceAfterBinaryOperators"
:
[
"+"
,
"-"
,
"/"
,
"*"
,
"="
,
"=="
,
"==="
,
"!="
,
"!=="
],
"requireCamelCaseOrUpperCaseIdentifiers"
:
true
,
"requireOperatorBeforeLineBreak"
:
[
"?"
,
"+"
,
"-"
,
"/"
,
"*"
,
"="
,
"=="
,
"==="
,
"!="
,
"!=="
,
">"
,
">="
,
"<"
,
"<="
],
"disallowLeftStickedOperators"
:
[
"?"
,
"+"
,
"-"
,
"/"
,
"*"
,
"="
,
"=="
,
"==="
,
"!="
,
"!=="
,
">"
,
">="
,
"<"
,
"<="
],
"disallowRightStickedOperators"
:
[
"?"
,
"+"
,
"/"
,
"*"
,
":"
,
"="
,
"=="
,
"==="
,
"!="
,
"!=="
,
">"
,
">="
,
"<"
,
"<="
],
"requireRightStickedOperators"
:
[
"!"
],
"disallowImplicitTypeConversion"
:
[
"string"
],
"disallowKeywords"
:
[
"with"
],
"disallowMultipleLineStrings"
:
true
,
"disallowMultipleLineBreaks"
:
true
,
"validateLineBreaks"
:
"LF"
,
"validateQuoteMarks"
:
true
,
"disallowMixedSpacesAndTabs"
:
true
,
"requireMultipleVarDecl"
:
true
,
"disallowTrailingWhitespace"
:
true
,
"disallowKeywordsOnNewLine"
:
[
"else"
],
"maximumLineLength"
:
100
,
"requireCapitalizedConstructors"
:
true
,
"safeContextKeyword"
:
"self"
,
"requireDotNotation"
:
true
,
"requireLineFeedAtFileEnd"
:
true
,
"excludeFiles"
:
[],
"validateJSDoc"
:
{
"checkParamNames"
:
true
,
"requireParamTypes"
:
true
}
}
architecture-examples/angularjs/js/directives/todoEscape.js
View file @
64445b01
...
...
@@ -15,4 +15,3 @@ todomvc.directive('todoEscape', function () {
});
};
});
architecture-examples/angularjs/js/directives/todoFocus.js
View file @
64445b01
...
...
@@ -2,7 +2,8 @@
'
use strict
'
;
/**
* Directive that places focus on the element it is applied to when the expression it binds to evaluates to true
* Directive that places focus on the element it is applied to when the
* expression it binds to evaluates to true
*/
todomvc
.
directive
(
'
todoFocus
'
,
function
todoFocus
(
$timeout
)
{
return
function
(
scope
,
elem
,
attrs
)
{
...
...
architecture-examples/backbone/js/views/app-view.js
View file @
64445b01
...
...
@@ -123,7 +123,7 @@ var app = app || {};
app
.
todos
.
each
(
function
(
todo
)
{
todo
.
save
({
'
completed
'
:
completed
completed
:
completed
});
});
}
...
...
architecture-examples/backbone/js/views/todo-view.js
View file @
64445b01
...
...
@@ -25,9 +25,10 @@ var app = app || {};
'
blur .edit
'
:
'
close
'
},
// The TodoView listens for changes to its model, re-rendering. Since there's
// a one-to-one correspondence between a **Todo** and a **TodoView** in this
// app, we set a direct reference on the model for convenience.
// The TodoView listens for changes to its model, re-rendering. Since
// there's a one-to-one correspondence between a **Todo** and a
// **TodoView** in this app, we set a direct reference on the model for
// convenience.
initialize
:
function
()
{
this
.
listenTo
(
this
.
model
,
'
change
'
,
this
.
render
);
this
.
listenTo
(
this
.
model
,
'
destroy
'
,
this
.
remove
);
...
...
@@ -36,10 +37,12 @@ var app = app || {};
// Re-render the titles of the todo item.
render
:
function
()
{
// Backbone LocalStorage is adding `id` attribute instantly after creating a model.
// This causes our TodoView to render twice. Once after creating a model and once on `id` change.
// We want to filter out the second redundant render, which is caused by this `id` change.
// It's known Backbone LocalStorage bug, therefore we've to create a workaround.
// Backbone LocalStorage is adding `id` attribute instantly after
// creating a model. This causes our TodoView to render twice. Once
// after creating a model and once on `id` change. We want to
// filter out the second redundant render, which is caused by this
// `id` change. It's known Backbone LocalStorage bug, therefore
// we've to create a workaround.
// https://github.com/tastejs/todomvc/issues/469
if
(
this
.
model
.
changed
.
id
!==
undefined
)
{
return
;
...
...
@@ -92,8 +95,10 @@ var app = app || {};
this
.
model
.
save
({
title
:
trimmedValue
});
if
(
value
!==
trimmedValue
)
{
// Model values changes consisting of whitespaces only are not causing change to be triggered
// Therefore we've to compare untrimmed version with a trimmed one to chech whether anything changed
// Model values changes consisting of whitespaces only are
// not causing change to be triggered Therefore we've to
// compare untrimmed version with a trimmed one to chech
// whether anything changed
// And if yes, we've to trigger change event ourselves
this
.
model
.
trigger
(
'
change
'
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment