Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
John McEleney
/
casperjs
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit
d433cf8c
...
d433cf8ca19443b3cc0da33afd9ba73721f72603
authored
2012-01-09 16:42:33 +0100
by
Nicolas Perriault
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fixed sorting issue in googlematch sample
1 parent
324be9d1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
samples/googlematch.coffee
samples/googlematch.js
samples/googlematch.coffee
View file @
d433cf8
...
...
@@ -39,7 +39,7 @@ casper.each terms, (self, term) ->
self
.
echo
"
#{
term
}
:
#{
score
}
"
casper
.
run
->
scores
.
sort
->
(
a
,
b
)
->
b
.
score
>
a
.
score
scores
.
sort
->
(
a
,
b
)
->
b
.
score
-
a
.
score
;
winner
=
scores
[
0
]
@
echo
"Winner is
#{
winner
.
term
}
with
#{
winner
.
score
}
results"
@
exit
()
...
...
samples/googlematch.js
View file @
d433cf8
...
...
@@ -47,7 +47,7 @@ casper.each(terms, function(self, term, i) {
casper
.
run
(
function
(
self
)
{
scores
.
sort
(
function
(
a
,
b
)
{
return
b
.
score
>
a
.
score
;
return
b
.
score
-
a
.
score
;
});
var
winner
=
scores
[
0
];
self
.
echo
(
'winner is "'
+
winner
.
term
+
'" with '
+
winner
.
score
+
' results'
);
...
...
Please
register
or
sign in
to post a comment