Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
retypos-server
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
eterfund
retypos-server
Commits
da7fdc40
Commit
da7fdc40
authored
May 21, 2018
by
Георгий Попов
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Задача 12794] Добавил вывод сообщений пользователю с помощью библиотеки alertify.js.
parent
7d669ad3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
3 deletions
+8
-3
index.jsx
cp/javascript/src/components/Typo/index.jsx
+1
-1
TypoList.jsx
cp/javascript/src/components/TypoList.jsx
+6
-2
package.json
cp/package.json
+1
-0
No files found.
cp/javascript/src/components/Typo/index.jsx
View file @
da7fdc40
...
...
@@ -35,7 +35,7 @@ export default class Typo extends Component {
<
CardBody
>
<
CardTitle
><
del
>
{
typo
.
originalText
}
</
del
>
-
>
{
typo
.
correctedText
}
</
CardTitle
>
<
CardText
>
<
div
>
{
typo
.
context
}
</
div
>
</
CardText
>
<
CardText
>
{
typo
.
context
}
</
CardText
>
<
div
className=
"card-buttons"
>
<
div
className=
"buttons-wrapper"
>
...
...
cp/javascript/src/components/TypoList.jsx
View file @
da7fdc40
import
React
,
{
Component
}
from
'react'
;
import
Typo
from
"./Typo/index"
;
const
alertify
=
require
(
"alertify.js"
);
export
default
class
TypoList
extends
Component
{
state
=
{
currentTypo
:
0
,
...
...
@@ -15,6 +17,8 @@ export default class TypoList extends Component {
*/
acceptCorrection
(
typoId
)
{
this
.
_setTypoStatus
(
1
,
typoId
,
this
.
state
.
siteId
,
()
=>
{
alertify
.
success
(
`<p>Опечатка
${
typoId
}
была подтверждена.</p>
<p>Исправления применены к тексту, содержащему опечатку.</p>`
);
this
.
state
.
currentTypo
++
;
this
.
forceUpdate
();
});
...
...
@@ -28,6 +32,7 @@ export default class TypoList extends Component {
*/
declineCorrection
(
typoId
)
{
this
.
_setTypoStatus
(
0
,
typoId
,
this
.
state
.
siteId
,
()
=>
{
alertify
.
success
(
`Опечатка
${
typoId
}
была отклонена`
);
this
.
state
.
currentTypo
++
;
this
.
forceUpdate
();
});
...
...
@@ -48,10 +53,9 @@ export default class TypoList extends Component {
$
.
ajax
({
url
:
`
${
window
.
baseUrl
}
users/typos/setTypoStatus/
${
typoId
}
/
${
siteId
}
/
${
status
}
`
,
}).
done
(()
=>
{
alert
(
"Status changed"
);
then
();
}).
fail
((
error
)
=>
{
alert
(
"Status change error
"
);
alert
ify
.
fail
(
"Ошибка исправления опечатки, попробуйте позже
"
);
console
.
error
(
error
.
message
);
});
}
...
...
cp/package.json
View file @
da7fdc40
...
...
@@ -5,6 +5,7 @@
"version"
:
"0.0.1"
,
"private"
:
true
,
"dependencies"
:
{
"alertify.js"
:
"^1.0.12"
,
"bootstrap"
:
"^4.0.0"
,
"free-jqgrid"
:
"^4.15.3"
,
"jquery"
:
"^3.3.1"
,
...
...
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