Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
sdkjs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boris Kocherov
sdkjs
Commits
04304c6a
Commit
04304c6a
authored
8 years ago
by
Alexander.Trofimov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cell/model/clipboard to function-closure
parent
7ab18ea3
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
195 additions
and
193 deletions
+195
-193
cell/api.js
cell/api.js
+1
-1
cell/model/clipboard.js
cell/model/clipboard.js
+193
-191
cell/view/EventsController.js
cell/view/EventsController.js
+1
-1
No files found.
cell/api.js
View file @
04304c6a
...
@@ -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
);
}
}
};
};
...
...
This diff is collapsed.
Click to expand it.
cell/model/clipboard.js
View file @
04304c6a
...
@@ -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
);
This diff is collapsed.
Click to expand it.
cell/view/EventsController.js
View file @
04304c6a
...
@@ -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
"
);
}
}
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment