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

cell/model/clipboard to function-closure

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