Commit 04304c6a authored by Alexander.Trofimov's avatar Alexander.Trofimov

cell/model/clipboard to function-closure

parent 7ab18ea3
......@@ -1080,7 +1080,7 @@ var editor;
}
if (window.USER_AGENT_SAFARI_MACOS) {
setInterval(SafariIntervalFocus2, 10);
setInterval(AscCommonExcel.SafariIntervalFocus2, 10);
}
};
......
......@@ -44,6 +44,15 @@
var copyPasteUseBinary = true;
var copyPasteFromWordUseBinary = true;
var COPY_ELEMENT_ID2 = "clipboard-helper";
var kElementTextId = "clipboard-helper-text";
var isNeedEmptyAfterCut = false;
if (window.USER_AGENT_SAFARI_MACOS)
{
PASTE_ELEMENT_ID = COPY_ELEMENT_ID2;
}
function number2color(n) {
if( typeof(n)=="string" && n.indexOf("rgb")>-1)
return n;
......@@ -5147,29 +5156,8 @@
};
/*
* Export
* -----------------------------------------------------------------------------
*/
window["Asc"].CopyProcessor = CopyProcessor;
window["Asc"].Clipboard = Clipboard;
window["Asc"].pasteFromBinaryWord = pasteFromBinaryWord;
window["Asc"].DocumentContentBounds = DocumentContentBounds;
}
)(jQuery, window);
var COPY_ELEMENT_ID2 = "clipboard-helper";
var kElementTextId = "clipboard-helper-text";
var isNeedEmptyAfterCut = false;
if (window.USER_AGENT_SAFARI_MACOS)
{
PASTE_ELEMENT_ID = COPY_ELEMENT_ID2;
}
function SafariIntervalFocus2()
{
function SafariIntervalFocus2()
{
var api = window["Asc"]["editor"];
if (api)
{
......@@ -5189,10 +5177,10 @@ function SafariIntervalFocus2()
Editor_CopyPaste_Create2(api);
}
}
}
}
function Editor_Copy_Event_Excel(e, ElemToSelect, isCut, isAlreadyReadyHtml)
{
function Editor_Copy_Event_Excel(e, ElemToSelect, isCut, isAlreadyReadyHtml)
{
var api = window["Asc"]["editor"];
var wb = api.wb;
var ws = wb.getWorksheet();
......@@ -5215,10 +5203,10 @@ function Editor_Copy_Event_Excel(e, ElemToSelect, isCut, isAlreadyReadyHtml)
e.clipboardData.setData("text/html", ElemToSelect.innerHTML);
//TODO для вставки в ячейку(пересмотреть!!!)
e.clipboardData.setData("text/plain", ElemToSelect.innerText);
}
}
function Editor_CopyPaste_Create2(api)
{
function Editor_CopyPaste_Create2(api)
{
var ElemToSelect = document.createElement("div");
ElemToSelect.id = COPY_ELEMENT_ID2;
ElemToSelect.setAttribute("class", COPYPASTE_ELEMENT_CLASS);
......@@ -5349,4 +5337,18 @@ function Editor_CopyPaste_Create2(api)
};
document.body.appendChild(elementText);
}
\ No newline at end of file
}
/*
* Export
* -----------------------------------------------------------------------------
*/
window["Asc"].CopyProcessor = CopyProcessor;
window["Asc"].Clipboard = Clipboard;
window["Asc"].pasteFromBinaryWord = pasteFromBinaryWord;
window["Asc"].DocumentContentBounds = DocumentContentBounds;
window['AscCommonExcel'] = window['AscCommonExcel'] || {};
window["AscCommonExcel"].SafariIntervalFocus2 = SafariIntervalFocus2;
}
)(jQuery, window);
......@@ -928,7 +928,7 @@
{
if (0 === window.GlobalPasteFlagCounter)
{
SafariIntervalFocus2();
AscCommonExcel.SafariIntervalFocus2();
window.GlobalPasteFlag = true;
t.handlers.trigger("paste");
}
......
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