fix html and css

parent d348ccf7
......@@ -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.innerHtml = "<span>Сервис Опечаток</span>\n\
title.innerHTML = "<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.innerHtml = "Выделите текст и нажмите кнопку \"Отправить\"";
desc.innerHTML = "Выделите текст и нажмите кнопку \"Отправить\"";
/* 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.addChildNode(postButton);
controls.addChildNode(closeButton);
controls.appendChild(postButton);
controls.appendChild(closeButton);
/* Construct div */
div.appendChild(title);
div.appendChild(description);
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;
},
/*Скрытие/показ окна*/
......
......@@ -15,6 +15,7 @@
}
.e_typos_div .e_typos_title {
position: relative;
text-align: left;
padding: 0.5em 0.5em 0.5em 1em;
background: #4169e1;
......@@ -23,9 +24,11 @@
}
.e_typos_div .e_typos_title .e_typos_close {
position: absolute;
right: 10px;
top: 5px;
cursor: pointer;
opacity: 0.5;
margin-left: 190px;
}
.e_typos_div .e_typos_title .e_typos_close:hover {
......@@ -41,7 +44,7 @@
font-size: 13px;
margin-bottom: 5px;
padding: 3px;
}
}
.e_typos_div .e_typos_message .error {
color: red;
......@@ -56,6 +59,7 @@
}
.e_typos_div .e_typos_controll_buttons .e_typos_button {
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));
......@@ -71,3 +75,15 @@
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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment