Commit ce30a9fc authored by Igor.Zotov's avatar Igor.Zotov Committed by Alexander.Trofimov

fix #24853

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@56853 954022d7-b5bf-4e40-9824-e11837661b57
parent 3c1c6758
......@@ -64,7 +64,12 @@ function Editor_Copy_GetElem(api)
//style.left = 0px, ���� ������� ���������� ������ ������� ������� ����, �� ����� ������� ������ �������� �����, �� � ����������� ����(� iframe) ������� ������������� � ����� ������ ��� ����� ������� ������ ����������.
ElemToSelect.style.left = '0px';
ElemToSelect.style.top = '-100px';
ElemToSelect.style.width = '10000px';
if(window.USER_AGENT_MACOS)
ElemToSelect.style.width = '100px';
else
ElemToSelect.style.width = '10000px';
ElemToSelect.style.height = '100px';
ElemToSelect.style.overflow = 'hidden';
ElemToSelect.style.zIndex = -1000;
......@@ -200,6 +205,9 @@ function Editor_Copy(api, bCut)
//������� ������� ����� ����������� ����������
var ElemToSelect = Editor_Copy_GetElem(api);
ElemToSelect.style.display = "block";
if(window.USER_AGENT_MACOS)
ElemToSelect.style.width = "10000px";
while ( ElemToSelect.hasChildNodes() )
ElemToSelect.removeChild( ElemToSelect.lastChild );
......@@ -211,6 +219,9 @@ function Editor_Copy(api, bCut)
delete document.body.style["user-select"];
document.body.style["-webkit-user-select"] = "text";
var overflowBody = document.body.style.overflow;
document.body.style.overflow = 'hidden';
ElemToSelect.style.MozUserSelect = "all";
if (null != api.WordControl.m_oLogicDocument)
......@@ -286,6 +297,8 @@ function Editor_Copy(api, bCut)
document.body.style["user-select"] = "none";
document.body.style["-webkit-user-select"] = "none";
document.body.style.overflow = overflowBody;
ElemToSelect.style.MozUserSelect = "none";
if(true == bCut)
......@@ -295,6 +308,10 @@ function Editor_Copy(api, bCut)
api.WordControl.m_oLogicDocument.Document_UpdateSelectionState();
}
}, time_interval);
if(window.USER_AGENT_MACOS)
ElemToSelect.style.width = "100px";
/*
if (e.dataTransfer)
{
......@@ -2138,7 +2155,12 @@ function Editor_Paste_GetElem(api, bClean)
pastebin.style.top = '-100px';
pastebin.style.left = '0px';
pastebin.style.width = '10000px';
if(window.USER_AGENT_MACOS)
ElemToSelect.style.width = "10000px";
else
ElemToSelect.style.width = "100px";
pastebin.style.height = '100px';
pastebin.style.overflow = 'hidden';
pastebin.style.zIndex = -1000;
......@@ -2292,11 +2314,19 @@ function Editor_Paste(api, bClean)
delete document.body.style["-o-user-select"];
delete document.body.style["user-select"];
document.body.style["-webkit-user-select"] = "text";
var overflowBody = document.body.style.overflow;
document.body.style.overflow = 'hidden';
var Text;
var pastebin = Editor_Paste_GetElem(api, bClean);
pastebin.style.display = "block";
pastebin.focus();
if(window.USER_AGENT_MACOS)
pastebin.style.width = "10000px";
pastebin.focus();
// Safari requires a filler node inside the div to have the content pasted into it. (#4882)
pastebin.appendChild( document.createTextNode( '\xa0' ) );
......@@ -2349,6 +2379,8 @@ function Editor_Paste(api, bClean)
document.body.style["-o-user-select"] = "none";
document.body.style["user-select"] = "none";
document.body.style["-webkit-user-select"] = "none";
document.body.style.overflow = overflowBody;
if (!window.USER_AGENT_SAFARI_MACOS)
pastebin.onpaste = null;
......@@ -2361,6 +2393,9 @@ function Editor_Paste(api, bClean)
pastebin.style.display = ELEMENT_DISPAY_STYLE;
window.PasteEndTimerId = -1;
if(window.USER_AGENT_MACOS)
pastebin.style.width = "100px";
};
var _interval_time = window.USER_AGENT_MACOS ? 200 : 0;
......@@ -2404,7 +2439,12 @@ function Body_Paste(api, e)
ifr.style.position = 'absolute';
ifr.style.top = '-100px';
ifr.style.left = '0px';
ifr.style.width = '10000px';
if(window.USER_AGENT_MACOS)
ifr.style.width = '100px';
else
ifr.style.width = '10000px';
ifr.style.height = '100px';
ifr.style.overflow = 'hidden';
ifr.style.zIndex = -1000;
......@@ -6820,7 +6860,12 @@ function Editor_CopyPaste_Create(api)
ElemToSelect.style.left = '0px';
ElemToSelect.style.top = '-100px';
ElemToSelect.style.width = '10000px';
if(window.USER_AGENT_MACOS)
ElemToSelect.style.width = '100px';
else
ElemToSelect.style.width = '10000px';
ElemToSelect.style.height = '100px';
ElemToSelect.style.overflow = 'hidden';
ElemToSelect.style.zIndex = -1000;
......
......@@ -198,7 +198,12 @@
// И например в таком случае пропадает пробел <span>1</span><span> </span><span>2</span>
t.element.style.top = '-100px';
t.element.style.left = '0px';
t.element.style.width = '10000px';
if(window.USER_AGENT_MACOS)
t.element.style.width = '100px';
else
t.element.style.width = '10000px';
t.element.style.height = '100px';
t.element.style.overflow = 'hidden';
t.element.style.zIndex = -1000;
......@@ -221,7 +226,11 @@
t.elementText.style.position = "absolute";
// Если сделать width маленьким, то параграф будет постоянно переноситься по span
// И например в таком случае пропадает пробел <span>1</span><span> </span><span>2</span>
t.elementText.style.width = '10000px';
if(window.USER_AGENT_MACOS)
t.element.style.width = '100px';
else
t.element.style.width = '10000px';
t.elementText.style.height = '100px';
t.elementText.style.left = '0px';
t.elementText.style.top = '-100px';
......@@ -265,6 +274,8 @@
if(text == false)
return;
this._startCopyOrPaste();
//исключения для opera в случае копирования пустой html
if($(text).find('td')[0] && $(text).find('td')[0].innerText == '' && AscBrowser.isOpera)
$(text).find('td')[0].innerHTML = '&nbsp;';
......@@ -333,15 +344,16 @@
window.global_pptx_content_writer.End_UseFullUrl()
}
}
};
History.TurnOn();
if(AscBrowser.isMozilla)
t._selectElement(t._getStylesSelect);
else
t._selectElement();
this._endCopyOrPaste();
},
......@@ -462,6 +474,9 @@
//****paste cells ****
pasteRange: function (worksheet) {
var t = this;
this._startCopyOrPaste();
if(AscBrowser.isMozilla)
t._editorPaste(worksheet,t._getStylesSelect);
else
......@@ -519,6 +534,9 @@
//****copy cell value****
copyCellValue: function (value) {
var t = this;
t._startCopyOrPaste();
if(activateLocalStorage || copyPasteUseBinary)
t._addValueToLocalStrg(value);
var nodes = t._makeNodesFromCellValue(value);
......@@ -541,6 +559,8 @@
t._selectElement(t._getStylesSelect);
else
t._selectElement();
this._endCopyOrPaste();
},
copyCellValueButton: function (value) {
......@@ -616,6 +636,9 @@
pasteAsText: function (callback) {
var t = this;
t.elementText.style.display = "block";
t._startCopyOrPaste();
t.elementText.value = '\xa0';
t.elementText.focus();
t.elementText.select();
......@@ -652,6 +675,8 @@
callback(textInsert, []);
if(AscBrowser.isMozilla)
t._getStylesSelect();
t._endCopyOrPaste();
},
_interval_time);
},
......@@ -830,6 +855,8 @@
if(!isTruePaste)
t._editorPasteExec(worksheet, pastebin);
t._endCopyOrPaste();
pastebin.style.display = ELEMENT_DISPAY_STYLE2;
if(AscBrowser.isIE)
......@@ -856,7 +883,12 @@
pastebin.style.position = 'absolute';
pastebin.style.top = '100px';
pastebin.style.left = '0px';
pastebin.style.width = '10000px';
if(window.USER_AGENT_MACOS)
t.element.style.width = '100px';
else
t.element.style.width = '10000px';
pastebin.style.height = '100px';
pastebin.style.overflow = 'hidden';
pastebin.style.zIndex = -1000;
......@@ -1077,12 +1109,20 @@
ifr.style.position = 'absolute';
ifr.style.top = '-100px';
ifr.style.left = '0px';
ifr.style.width = '10000px';
if(window.USER_AGENT_MACOS)
ifr.style.width = '100px';
else
ifr.style.width = '10000px';
ifr.style.height = '100px';
ifr.style.overflow = 'hidden';
ifr.style.zIndex = -1000;
document.body.appendChild(ifr);
}
};
this._startCopyOrPaste();
ifr.style.display = "block";
var frameWindow = window.frames["pasteFrame"];
if(frameWindow)
......@@ -1110,6 +1150,9 @@
e.stopPropagation();
e.preventDefault();
}
this._endCopyOrPaste();
return false;
}
},
......@@ -2389,6 +2432,8 @@
overflowBody = document.body.style.overflow;
document.body.style.overflow = 'hidden';
this._startCopyOrPaste();
if (window.getSelection) {// all browsers, except IE before version 9
selection = window.getSelection();
rangeToSelect = doc.createRange();
......@@ -2428,6 +2473,7 @@
doc.body.style["user-select"] = "none";
doc.body.style["-webkit-user-select"] = "none";
this._endCopyOrPaste();
t.element.style.MozUserSelect = "none";
document.body.style.overflow = overflowBody;
......@@ -3411,6 +3457,30 @@
}
return bin;
},
_startCopyOrPaste: function()
{
if(window.USER_AGENT_MACOS)
{
this.element.style.width = "10000px";
this.elementText.style.width = "10000px";
var ifr = document.getElementById("pasteFrame");
if(ifr)
ifr.style.width = "10000px";
};
},
_endCopyOrPaste: function()
{
if(window.USER_AGENT_MACOS)
{
this.element.style.width = "100px";
this.elementText.style.width = "100px";
var ifr = document.getElementById("pasteFrame");
if(ifr)
ifr.style.width = "100px";
};
}
};
......@@ -5286,7 +5356,12 @@ function Editor_CopyPaste_Create2(api)
ElemToSelect.style.left = '0px';
ElemToSelect.style.top = '100px';
ElemToSelect.style.width = '1000px';
if(window.USER_AGENT_MACOS)
ElemToSelect.style.width = '1000px';
else
ElemToSelect.style.width = '10000px';
ElemToSelect.style.height = '100px';
ElemToSelect.style.overflow = 'hidden';
ElemToSelect.style.zIndex = -1000;
......@@ -5341,7 +5416,11 @@ function Editor_CopyPaste_Create2(api)
elementText.id = kElementTextId;
elementText.style.position = "absolute";
elementText.style.width = '10000px';
if(window.USER_AGENT_MACOS)
ElemToSelect.style.width = '100px';
else
ElemToSelect.style.width = '10000px';
elementText.style.height = '100px';
elementText.style.left = '0px';
elementText.style.top = '100px';
......
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