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
325f34f6
Commit
325f34f6
authored
Jul 17, 2017
by
George Popoff
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add context field to message panel
parent
75d330c7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
49 additions
and
2 deletions
+49
-2
Typo.php
cp/application/models/Typo.php
+7
-2
typos.php
cp/application/views/users/typos.php
+0
-0
typos.js
cp/javascript/typos.js
+37
-0
stylesheet.css
cp/stylesheet/stylesheet.css
+5
-0
No files found.
cp/application/models/Typo.php
View file @
325f34f6
...
...
@@ -82,7 +82,7 @@ class Typo extends CI_Model {
if
(
$table
==
"messages"
)
{
$this
->
db
->
select
(
"m.id as message_id, m.link as link, m.text as text, "
.
"m.comment as comment, m.date as message_date, m.status as message_status, u.*"
);
.
"m.comment as comment, m.
context as context, m.
date as message_date, m.status as message_status, u.*"
);
$this
->
db
->
from
(
"messages as m, users as u"
);
$this
->
db
->
join
(
"responsible as r"
,
"r.id_user = u.id AND"
.
" r.id_site = m.site_id AND r.id_user = u.id"
);
...
...
@@ -141,9 +141,14 @@ class Typo extends CI_Model {
$data
[
'rows'
][
$id
][
'id'
]
=
$row
->
message_id
;
$data
[
'rows'
][
$id
][
'cell'
][]
=
$row
->
message_id
;
$data
[
'rows'
][
$id
][
'cell'
][]
=
$row
->
message_status
;
$data
[
'rows'
][
$id
][
'cell'
][]
=
anchor
(
$row
->
link
,
'ссылка'
,
array
(
'class'
=>
'typos_link'
,
'target'
=>
'_blank'
));
;
$data
[
'rows'
][
$id
][
'cell'
][]
=
anchor
(
$row
->
link
,
'ссылка'
,
array
(
'class'
=>
'typos_link'
,
'target'
=>
'_blank'
));
$data
[
'rows'
][
$id
][
'cell'
][]
=
$row
->
text
;
$data
[
'rows'
][
$id
][
'cell'
][]
=
$row
->
comment
;
$data
[
'rows'
][
$id
][
'cell'
][]
=
anchor
(
"#"
,
'показать'
,
array
(
'class'
=>
'typos_context'
,
'onclick'
=>
'return Typos.handleLink(this);'
,
'typo'
=>
$row
->
text
,
'context'
=>
$row
->
context
,
'correct'
=>
$row
->
comment
));
$data
[
'rows'
][
$id
][
'cell'
][]
=
$row
->
message_date
;
}
}
...
...
cp/application/views/users/typos.php
View file @
325f34f6
This diff is collapsed.
Click to expand it.
cp/javascript/typos.js
0 → 100644
View file @
325f34f6
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
document
.
addEventListener
(
"DOMContentLoaded"
,
function
()
{
Typos
.
_init
();
});
var
Typos
=
{
_init
:
function
()
{
this
.
contextBlock
=
$
(
"#context-block"
);
this
.
contextBlockText
=
this
.
contextBlock
.
children
().
first
();
},
/**
* Показывает окно, содержащее информацию о контексте.
* @param {type} link Элемент a.typos_context
* @returns {Boolean}
*/
handleLink
:
function
(
link
)
{
var
text
=
link
.
getAttribute
(
"context"
);
var
typo
=
link
.
getAttribute
(
"typo"
);
var
correct
=
link
.
getAttribute
(
"correct"
);
var
self
=
this
;
text
=
text
.
replace
(
typo
,
"<span class='typo'>"
+
typo
+
" -> "
+
correct
+
"</span>"
);
self
.
contextBlockText
.
html
(
text
);
self
.
contextBlock
.
dialog
();
return
false
;
}
};
cp/stylesheet/stylesheet.css
View file @
325f34f6
...
...
@@ -30,4 +30,8 @@
padding-top
:
50px
;
clear
:
both
;
text-align
:
center
;
}
.typo
{
background-color
:
rgba
(
200
,
200
,
10
,
0.2
);
}
\ No newline at end of file
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