barbass: забираем текст при вызове

parent cf376127
......@@ -18,10 +18,11 @@ var ETY = {
select_text: "",
//Выделенный текст
get_select_text: function() {
ETY.select_text = String(window.getSelection()).trim().substr(0, 50);
if (typeof(ETY.select_text) == 'undefined') {
ETY.select_text = "";
var text = String(window.getSelection()).trim().substr(0, 50);
if (typeof(text) == 'undefined') {
text = "";
}
return text;
},
control_panel: function() {
......@@ -29,11 +30,7 @@ var ETY = {
this.close();
} else {
this.div();
/*ETY.get_select_text();
if (ETY.select_text != "") {
ETY.text(ETY.select_text);
}*/
ETY.select_text = ETY.get_select_text();
}
},
......@@ -57,12 +54,18 @@ var ETY = {
post_data: function() {
var this_url = window.location.href; //Текущая страница
ETY.get_select_text();
post_text = ETY.select_text;
/*if (post_text.length == 0) {
ETY.get_select_text();
var post_text;
if (ETY.select_text == "") {
post_text = ETY.get_select_text();
} else {
post_text = ETY.select_text;
}*/
}
var new_text = ETY.get_select_text();
if (new_text != ETY.select_text && new_text.length != 0) {
post_text = new_text;
}
//Выделенный текст
var user_comment = document.getElementById("e_typos_comment").value.trim().substr(0, 50);
......
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