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
2e1ad852
Commit
2e1ad852
authored
Jul 02, 2018
by
Георгий Попов
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix typo correction server to work with new database structure
parent
11c1bf61
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
3 deletions
+6
-3
.gitignore
.gitignore
+2
-2
Typo.php
cp/application/models/Typo.php
+3
-1
index.jsx
cp/javascript/src/components/Typo/index.jsx
+1
-0
No files found.
.gitignore
View file @
2e1ad852
...
@@ -5,4 +5,5 @@ configuration.php
...
@@ -5,4 +5,5 @@ configuration.php
# IDE Files
# IDE Files
#-------------------------
#-------------------------
/nbproject/
/nbproject/
.idea/*
.idea/*
\ No newline at end of file
.vscode/
cp/application/models/Typo.php
View file @
2e1ad852
...
@@ -193,7 +193,7 @@ class Typo extends CI_Model {
...
@@ -193,7 +193,7 @@ class Typo extends CI_Model {
* @return array Список опечаток
* @return array Список опечаток
*/
*/
function
getSiteTypos
(
$siteId
)
{
function
getSiteTypos
(
$siteId
)
{
$this
->
db
->
select
(
"id, link, text as originalText, context, co
mment as correctedTex
t, date, status as isCorrected"
);
$this
->
db
->
select
(
"id, link, text as originalText, context, co
rrected as correctedText, commen
t, date, status as isCorrected"
);
$this
->
db
->
from
(
"messages"
);
$this
->
db
->
from
(
"messages"
);
$this
->
db
->
where
(
"site_id"
,
$siteId
);
$this
->
db
->
where
(
"site_id"
,
$siteId
);
$this
->
db
->
where
(
"status"
,
0
);
$this
->
db
->
where
(
"status"
,
0
);
...
@@ -339,6 +339,8 @@ class Typo extends CI_Model {
...
@@ -339,6 +339,8 @@ class Typo extends CI_Model {
// Адрес на который шлем запрос исправления
// Адрес на который шлем запрос исправления
$url
=
$parsed_url
[
"scheme"
]
.
"://"
.
$parsed_url
[
"host"
]
.
"/"
.
$correctPath
;
$url
=
$parsed_url
[
"scheme"
]
.
"://"
.
$parsed_url
[
"host"
]
.
"/"
.
$correctPath
;
$url
=
"http://ambulance.pubsandbox.eterhost.ru/typosClientTest/index.php"
;
try
{
try
{
$client
=
new
\JsonRPC\Client
(
$url
);
$client
=
new
\JsonRPC\Client
(
$url
);
$client
->
getHttpClient
()
->
withDebug
();
$client
->
getHttpClient
()
->
withDebug
();
...
...
cp/javascript/src/components/Typo/index.jsx
View file @
2e1ad852
...
@@ -64,6 +64,7 @@ export default class Typo extends Component {
...
@@ -64,6 +64,7 @@ export default class Typo extends Component {
_highlightTypoInContext
()
{
_highlightTypoInContext
()
{
const
original
=
this
.
_escapeHtml
(
this
.
typo
.
originalText
);
const
original
=
this
.
_escapeHtml
(
this
.
typo
.
originalText
);
const
corrected
=
this
.
_escapeHtml
(
this
.
typo
.
correctedText
);
const
corrected
=
this
.
_escapeHtml
(
this
.
typo
.
correctedText
);
const
comment
=
this
.
_escapeHtml
(
this
.
typo
.
comment
);
const
context
=
this
.
_escapeHtml
(
this
.
typo
.
context
);
const
context
=
this
.
_escapeHtml
(
this
.
typo
.
context
);
// Экранируем символы, которые мешают использовать регулярные выражения
// Экранируем символы, которые мешают использовать регулярные выражения
...
...
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