Commit b9650cc4 authored by George Popoff's avatar George Popoff

add context to message

parent 20ac46e3
......@@ -26,6 +26,7 @@ ETYPOS.prototype = {
//язык по умочланияю
default_language: 'ru',
// Фраза или слово для исправления
selection: '',
needConstructPanel: true,
......@@ -47,6 +48,7 @@ ETYPOS.prototype = {
'url': '',
'text': '',
'comment': '',
'context': '',
'language': this.default_language,
'old_browser': 0,
},
......@@ -185,6 +187,9 @@ ETYPOS.prototype = {
text.innerHTML = selection;
self.userdata['text'] = selection;
self.userdata['context'] = self.getSelectionContext();
console.log("context: ", self.userdata['context']);
if ( !self.validateTextData() ) {
self.printMessage('error', self.error);
......@@ -275,6 +280,10 @@ ETYPOS.prototype = {
return (window.getSelection()) ? String(window.getSelection()) : this.selection;
},
getSelectionContext: function() {
return (window.getSelection()) ? window.getSelection().anchorNode : this.selection;
},
/*Скрытие/показ окна*/
controlPanel: function () {
(this.element.style.display === "block") ? this.closeWindow() : this.openWindow();
......
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