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
71448c46
Commit
71448c46
authored
Apr 12, 2013
by
Sindre Sorhus
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #533 from stephenplusplus/quote-links
homepage: fix quote links.
parents
4f76731f
cc5ca742
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
16 deletions
+16
-16
site/js/main.js
site/js/main.js
+16
-16
No files found.
site/js/main.js
View file @
71448c46
...
...
@@ -43,16 +43,16 @@
var
Quotes
=
{};
Quotes
.
build
=
function
(
quotes
,
template
)
{
var
quoteContainer
=
document
.
createElement
(
'
q
'
)
,
quoteElemCount
=
0
,
quoteCount
=
quotes
.
length
;
var
quoteContainer
=
document
.
createElement
(
'
q
'
)
;
var
quoteElemCount
=
0
;
var
quoteCount
=
quotes
.
length
;
var
createQuoteElems
=
function
()
{
var
quote
=
quotes
[
quoteElemCount
]
,
el
=
$
(
template
).
hide
();
var
quote
=
quotes
[
quoteElemCount
]
;
var
el
=
$
(
template
).
hide
();
el
.
children
(
'
p
'
).
text
(
quote
.
quote
);
el
.
find
(
'
a
'
).
text
(
quote
.
person
.
name
).
attr
(
'
href
'
,
quote
.
link
);
el
.
find
(
'
a
'
).
text
(
quote
.
person
.
name
).
attr
(
'
href
'
,
quote
.
person
.
link
);
el
.
find
(
'
img
'
).
attr
(
'
src
'
,
quote
.
person
.
gravatar
);
quoteContainer
.
appendChild
(
el
[
0
]);
...
...
@@ -67,8 +67,8 @@
};
Quotes
.
random
=
function
(
quotes
)
{
var
quoteCount
=
quotes
.
length
,
randomQuotes
=
[];
var
quoteCount
=
quotes
.
length
;
var
randomQuotes
=
[];
var
randomQuote
=
function
()
{
var
randomQuoteIndex
=
Math
.
floor
(
Math
.
random
()
*
quoteCount
);
...
...
@@ -101,11 +101,11 @@
fadeOut
.
fadeOut
(
500
,
fadeOutCallback
);
};
var
quotes
=
container
.
children
()
,
selectRandomQuoteIndex
=
Quotes
.
random
(
quotes
),
quoteElems
=
{},
activeQuoteIndex
=
selectRandomQuoteIndex
(),
prevQuoteElem
=
$
(
quotes
[
activeQuoteIndex
]);
var
quotes
=
container
.
children
()
;
var
selectRandomQuoteIndex
=
Quotes
.
random
(
quotes
);
var
quoteElems
=
{};
var
activeQuoteIndex
=
selectRandomQuoteIndex
();
var
prevQuoteElem
=
$
(
quotes
[
activeQuoteIndex
]);
var
swap
=
function
()
{
if
(
!
quoteElems
[
activeQuoteIndex
])
{
...
...
@@ -123,9 +123,9 @@
};
Quotes
.
init
=
function
(
quotes
)
{
var
container
=
$
(
this
)
,
template
=
$
(
this
).
html
(),
quotesHTML
=
Quotes
.
build
(
quotes
,
template
);
var
container
=
$
(
this
)
;
var
template
=
$
(
this
).
html
();
var
quotesHTML
=
Quotes
.
build
(
quotes
,
template
);
container
.
html
(
quotesHTML
);
...
...
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