Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
coopwire-hypothesis
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
孙灵跃 Leon Sun
coopwire-hypothesis
Commits
d451b587
Commit
d451b587
authored
Jun 23, 2017
by
Sean Hammond
Committed by
GitHub
Jun 23, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #459 from hypothesis/flash-decaf
Convert "flash" service to JS
parents
2bf9e9c3
acb0a67a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
6 deletions
+40
-6
flash.coffee
src/sidebar/flash.coffee
+0
-6
flash.js
src/sidebar/flash.js
+17
-0
flash-test.js
src/sidebar/test/flash-test.js
+23
-0
No files found.
src/sidebar/flash.coffee
deleted
100644 → 0
View file @
2bf9e9c3
module
.
exports
=
[
'toastr'
,
(
toastr
)
->
info
:
angular
.
bind
(
toastr
,
toastr
.
info
)
success
:
angular
.
bind
(
toastr
,
toastr
.
success
)
warning
:
angular
.
bind
(
toastr
,
toastr
.
warning
)
error
:
angular
.
bind
(
toastr
,
toastr
.
error
)
]
src/sidebar/flash.js
0 → 100644
View file @
d451b587
'use strict'
;
/**
* A service for displaying "flash" notification messages.
*/
// @ngInject
function
flash
(
toastr
)
{
return
{
info
:
toastr
.
info
.
bind
(
toastr
),
success
:
toastr
.
success
.
bind
(
toastr
),
warning
:
toastr
.
warning
.
bind
(
toastr
),
error
:
toastr
.
error
.
bind
(
toastr
),
};
}
module
.
exports
=
flash
;
src/sidebar/test/flash-test.js
0 → 100644
View file @
d451b587
'use strict'
;
var
flash
=
require
(
'../flash'
);
describe
(
'sidebar.flash'
,
()
=>
{
[
'info'
,
'success'
,
'warning'
,
'error'
].
forEach
(
method
=>
{
describe
(
`#
${
method
}
`
,
()
=>
{
it
(
`calls toastr's "
${
method
}
" method`
,
()
=>
{
var
fakeToastr
=
{
info
:
sinon
.
stub
(),
success
:
sinon
.
stub
(),
warning
:
sinon
.
stub
(),
error
:
sinon
.
stub
(),
};
var
svc
=
flash
(
fakeToastr
);
svc
[
method
](
'message'
,
'title'
);
assert
.
calledWith
(
fakeToastr
[
method
],
'message'
,
'title'
);
});
});
});
});
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