Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
retypos-webclient
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
0
Merge Requests
0
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-webclient
Commits
0232a693
Commit
0232a693
authored
May 29, 2017
by
Георгий Попов
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix html and css
parent
d348ccf7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
76 additions
and
53 deletions
+76
-53
etersoft_typos.js
etersoft_typos.js
+17
-11
stylesheet.css
stylesheet.css
+59
-42
No files found.
etersoft_typos.js
View file @
0232a693
...
...
@@ -5,7 +5,7 @@
*/
function
ETYPOS
(
options
)
{
this
.
init
(
options
);
this
.
_
init
(
options
);
this
.
_createControlPanel
();
this
.
_handleEvents
();
}
...
...
@@ -26,6 +26,8 @@ ETYPOS.prototype = {
//язык по умочланияю
default_language
:
'ru'
,
selection
:
''
,
//данные для отправки (сайт страницы, текст с ошибкой, комментарий, язык, броузер)
userdata
:
{
'url'
:
''
,
...
...
@@ -63,13 +65,13 @@ ETYPOS.prototype = {
/* Title */
var
title
=
document
.
createElement
(
"div"
);
title
.
className
=
"e_typos_title"
;
title
.
innerH
tml
=
"<span>Сервис Опечаток</span>
\
n
\
title
.
innerH
TML
=
"<span>Сервис Опечаток</span>
\
n
\
<span title='Закрыть окно' class='e_typos_close'><b>x</b></span>"
;
/* Description */
var
desc
=
document
.
createElement
(
"p"
);
desc
.
className
=
"e_typos_desc"
;
desc
.
innerH
tml
=
"Выделите текст и нажмите кнопку
\"
Отправить
\"
"
;
desc
.
innerH
TML
=
"Выделите текст и нажмите кнопку
\"
Отправить
\"
"
;
/* Comment */
...
...
@@ -90,7 +92,7 @@ ETYPOS.prototype = {
p
.
appendChild
(
nobr
);
/* Message */
var
message
=
document
.
createElement
(
"
input
"
);
var
message
=
document
.
createElement
(
"
p
"
);
message
.
className
=
"e_typos_message"
;
/* Controls */
...
...
@@ -109,12 +111,12 @@ ETYPOS.prototype = {
closeButton
.
title
=
"Закрыть окно"
;
closeButton
.
value
=
"Закрыть"
;
controls
.
a
ddChildNode
(
postButton
);
controls
.
a
ddChildNode
(
closeButton
);
controls
.
a
ppendChild
(
postButton
);
controls
.
a
ppendChild
(
closeButton
);
/* Construct div */
div
.
appendChild
(
title
);
div
.
appendChild
(
desc
ription
);
div
.
appendChild
(
desc
);
div
.
appendChild
(
p
);
div
.
appendChild
(
message
);
div
.
appendChild
(
controls
);
...
...
@@ -125,16 +127,20 @@ ETYPOS.prototype = {
_handleEvents
:
function
()
{
var
self
=
this
;
document
.
querySelectorAll
(
'.e_typos_div .e_typos_close'
)[
0
].
addEventListener
(
'click'
,
function
()
{
document
.
querySelector
(
'.e_typos_div .e_typos_close'
).
addEventListener
(
'click'
,
function
()
{
self
.
closeWindow
();
},
false
);
document
.
querySelector
(
'.e_typos_button.e_typos_close'
).
addEventListener
(
'click'
,
function
()
{
self
.
closeWindow
();
},
false
);
document
.
querySelector
(
'.e_typos_
div
.e_typos_post'
).
addEventListener
(
'click'
,
function
()
{
document
.
querySelector
(
'.e_typos_
button
.e_typos_post'
).
addEventListener
(
'click'
,
function
()
{
self
.
postData
();
},
false
);
window
.
document
.
onkeydown
=
function
(
e
)
{
if
(
e
.
ctrlKey
==
1
&&
e
.
keyCode
==
13
)
{
typos
.
controlPanel
();
self
.
selection
=
self
.
getSelectText
();
self
.
controlPanel
();
}
};
},
...
...
@@ -162,7 +168,7 @@ ETYPOS.prototype = {
/*Получаем выделенный текст*/
getSelectText
:
function
()
{
return
(
window
.
getSelection
())
?
String
(
window
.
getSelection
())
:
''
;
return
(
window
.
getSelection
())
?
String
(
window
.
getSelection
())
:
this
.
selection
;
},
/*Скрытие/показ окна*/
...
...
stylesheet.css
View file @
0232a693
.e_typos_div
{
display
:
none
;
z-index
:
10000
;
position
:
absolute
;
font-family
:
Arial
,
Sans-Serif
;
font-size
:
15px
;
background-color
:
white
;
padding
:
1px
3px
3px
3px
;
width
:
350px
;
box-shadow
:
0px
0px
10px
rgba
(
0
,
0
,
0
,
0.5
);
text-align
:
center
;
-moz-user-select
:
none
;
-webkit-user-select
:
none
;
border
:
1px
solid
#4169e1
;
display
:
none
;
z-index
:
10000
;
position
:
absolute
;
font-family
:
Arial
,
Sans-Serif
;
font-size
:
15px
;
background-color
:
white
;
padding
:
1px
3px
3px
3px
;
width
:
350px
;
box-shadow
:
0px
0px
10px
rgba
(
0
,
0
,
0
,
0.5
);
text-align
:
center
;
-moz-user-select
:
none
;
-webkit-user-select
:
none
;
border
:
1px
solid
#4169e1
;
}
.e_typos_div
.e_typos_title
{
text-align
:
left
;
padding
:
0.5em
0.5em
0.5em
1em
;
background
:
#4169e1
;
color
:
white
;
margin-top
:
2px
;
position
:
relative
;
text-align
:
left
;
padding
:
0.5em
0.5em
0.5em
1em
;
background
:
#4169e1
;
color
:
white
;
margin-top
:
2px
;
}
.e_typos_div
.e_typos_title
.e_typos_close
{
cursor
:
pointer
;
opacity
:
0.5
;
margin-left
:
190px
;
position
:
absolute
;
right
:
10px
;
top
:
5px
;
cursor
:
pointer
;
opacity
:
0.5
;
}
.e_typos_div
.e_typos_title
.e_typos_close
:hover
{
opacity
:
1
;
opacity
:
1
;
}
.e_typos_div
.e_typos_desc
{
font-size
:
13px
;
font-size
:
13px
;
}
.e_typos_div
input
{
font-family
:
Arial
,
Sans-Serif
;
font-size
:
13px
;
margin-bottom
:
5px
;
padding
:
3px
;
}
font-family
:
Arial
,
Sans-Serif
;
font-size
:
13px
;
margin-bottom
:
5px
;
padding
:
3px
;
}
.e_typos_div
.e_typos_message
.error
{
color
:
red
;
color
:
red
;
}
.e_typos_div
.e_typos_message
.success
{
color
:
green
;
color
:
green
;
}
.e_typos_div
.e_typos_message
.attention
{
color
:
blue
;
color
:
blue
;
}
.e_typos_div
.e_typos_controll_buttons
.e_typos_button
{
border-radius
:
10px
;
border
:
1px
solid
#d0d0d0
;
background-image
:
-webkit-linear-gradient
(
top
,
rgba
(
255
,
255
,
255
,
0
),
rgba
(
0
,
0
,
0
,
0.2
));
background-image
:
-moz-linear-gradient
(
top
,
rgba
(
255
,
255
,
255
,
0
),
rgba
(
0
,
0
,
0
,
0.2
));
background-image
:
-o-linear-gradient
(
top
,
rgba
(
255
,
255
,
255
,
0
),
rgba
(
0
,
0
,
0
,
0.2
));
background-image
:
-ms-linear-gradient
(
top
,
rgba
(
255
,
255
,
255
,
0
),
rgba
(
0
,
0
,
0
,
0.2
));
background-image
:
linear-gradient
(
top
,
rgba
(
255
,
255
,
255
,
0
),
rgba
(
0
,
0
,
0
,
0.2
));
background-color
:
#FFFFFF
!important
;
width
:
85px
;
border-radius
:
10px
;
border
:
1px
solid
#d0d0d0
;
background-image
:
-webkit-linear-gradient
(
top
,
rgba
(
255
,
255
,
255
,
0
),
rgba
(
0
,
0
,
0
,
0.2
));
background-image
:
-moz-linear-gradient
(
top
,
rgba
(
255
,
255
,
255
,
0
),
rgba
(
0
,
0
,
0
,
0.2
));
background-image
:
-o-linear-gradient
(
top
,
rgba
(
255
,
255
,
255
,
0
),
rgba
(
0
,
0
,
0
,
0.2
));
background-image
:
-ms-linear-gradient
(
top
,
rgba
(
255
,
255
,
255
,
0
),
rgba
(
0
,
0
,
0
,
0.2
));
background-image
:
linear-gradient
(
top
,
rgba
(
255
,
255
,
255
,
0
),
rgba
(
0
,
0
,
0
,
0.2
));
background-color
:
#FFFFFF
!important
;
}
.e_typos_div
.e_typos_controll_buttons
.e_typos_button
:hover
{
border
:
1px
solid
#d0d0d0
;
background-color
:
#DDDDDD
!important
;
border-radius
:
10px
;
border
:
1px
solid
#d0d0d0
;
background-color
:
#DDDDDD
!important
;
border-radius
:
10px
;
}
.e_typos_div
.e_typos_controll_buttons
{
position
:
relative
;
}
.e_typos_div
.e_typos_controll_buttons
.e_typos_post
{
}
.e_typos_div
.e_typos_controll_buttons
.e_typos_post
{
margin-right
:
40px
;
}
\ 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