Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
Goit Filmoteka
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mariia Moroz
Goit Filmoteka
Commits
9344b0fc
Commit
9344b0fc
authored
2 years ago
by
Valdesrep
Browse files
Options
Downloads
Patches
Plain Diff
Notifix
parent
039951e4
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
package-lock.json
+15
-9561
15 additions, 9561 deletions
package-lock.json
package.json
+2
-1
2 additions, 1 deletion
package.json
src/js/fetch-by-name.js
+7
-1
7 additions, 1 deletion
src/js/fetch-by-name.js
src/js/notiflix.js
+36
-0
36 additions, 0 deletions
src/js/notiflix.js
with
60 additions
and
9563 deletions
package-lock.json
+
15
−
9561
View file @
9344b0fc
This diff is collapsed.
Click to expand it.
package.json
+
2
−
1
View file @
9344b0fc
...
...
@@ -26,6 +26,7 @@
"
sass
"
:
"
^1.32.8
"
},
"dependencies"
:
{
"
axios
"
:
"
^0.27.2
"
"
axios
"
:
"
^0.27.2
"
,
"
notiflix
"
:
"
^3.2.5
"
}
}
This diff is collapsed.
Click to expand it.
src/js/fetch-by-name.js
+
7
−
1
View file @
9344b0fc
import
axios
from
'
axios
'
;
import
notiflix
from
'
./notiflix
'
;
let
filmToFind
;
const
refs
=
{
...
...
@@ -16,7 +16,10 @@ function onInput(event) {
async
function
onBtn
(
event
)
{
event
.
preventDefault
();
MovieClear
()
notiflix
.
onLoadingleAdd
()
const
movies
=
await
fetchSearch
(
filmToFind
);
notiflix
.
onLoadingRemove
()
}
async
function
fetchSearch
(
filmToFind
)
{
...
...
@@ -30,3 +33,6 @@ async function fetchSearch(filmToFind) {
const
movies
=
response
.
data
;
return
movies
;
}
function
MovieClear
()
{
refs
.
container
.
innerHTML
=
''
;
}
This diff is collapsed.
Click to expand it.
src/js/notiflix.js
0 → 100644
+
36
−
0
View file @
9344b0fc
import
Notiflix
from
'
notiflix
'
;
const
notiflixParams
=
{
position
:
'
center-top
'
,
timeout
:
1500
,
};
class
Notification
{
constructor
(
notiflixParams
)
{
this
.
options
=
notiflixParams
;
}
onAddToWatched
()
{
Notiflix
.
Notify
.
success
(
'
Added to Watched
'
,
this
.
options
);
}
onDeleteWatched
()
{
Notiflix
.
Notify
.
warning
(
'
Deleted from Watched
'
,
this
.
options
);
}
onAddToQueue
()
{
Notiflix
.
Notify
.
success
(
'
Added to Queue
'
,
this
.
options
);
}
onDeleteQueue
()
{
Notiflix
.
Notify
.
warning
(
'
Deleted from Queue
'
,
this
.
options
);
}
onLoadingleAdd
()
{
Notiflix
.
Loading
.
arrows
(
'
Please wait ...
'
,
this
.
options
);
}
onLoadingRemove
()
{
Notiflix
.
Loading
.
remove
();
}
}
export
default
new
Notification
(
notiflixParams
);
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment