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
bc48a1bc
Commit
bc48a1bc
authored
Jun 28, 2016
by
GoshaZotov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add function getText for copy/paste
parent
0f7f72d9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
89 additions
and
3 deletions
+89
-3
cell/model/clipboard.js
cell/model/clipboard.js
+89
-3
No files found.
cell/model/clipboard.js
View file @
bc48a1bc
...
@@ -90,8 +90,9 @@
...
@@ -90,8 +90,9 @@
//TEXT
//TEXT
if
(
AscCommon
.
c_oAscClipboardDataFormat
.
Text
&
_formats
)
if
(
AscCommon
.
c_oAscClipboardDataFormat
.
Text
&
_formats
)
{
{
//_data = ;
_data
=
this
.
copyProcessor
.
getText
(
activeRange
,
ws
);
//_clipboard.pushData(AscCommon.c_oAscClipboardDataFormat.Text, _data)
_clipboard
.
pushData
(
AscCommon
.
c_oAscClipboardDataFormat
.
Text
,
_data
)
}
}
//HTML
//HTML
if
(
AscCommon
.
c_oAscClipboardDataFormat
.
Html
&
_formats
)
if
(
AscCommon
.
c_oAscClipboardDataFormat
.
Html
&
_formats
)
...
@@ -242,6 +243,26 @@
...
@@ -242,6 +243,26 @@
return
"
xslData;
"
+
sBase64
;
return
"
xslData;
"
+
sBase64
;
},
},
getText
:
function
(
range
,
worksheet
)
{
var
t
=
this
;
var
res
=
null
;
var
objectRender
=
worksheet
.
objectRender
;
var
isIntoShape
=
objectRender
.
controller
.
getTargetDocContent
();
if
(
isIntoShape
)
{
res
=
t
.
_getTextFromShape
(
isIntoShape
);
}
else
{
res
=
t
.
_getTextFromSheet
(
range
,
worksheet
);
}
return
res
;
},
getBinaryForMobile
:
function
()
getBinaryForMobile
:
function
()
{
{
var
api
=
window
[
"
Asc
"
][
"
editor
"
];
var
api
=
window
[
"
Asc
"
][
"
editor
"
];
...
@@ -282,7 +303,7 @@
...
@@ -282,7 +303,7 @@
}
}
}
}
return
{
sBase64
:
sBase64
,
text
:
this
.
lStorageText
,
drawingUrls
:
drawingUrls
};
return
{
sBase64
:
sBase64
,
drawingUrls
:
drawingUrls
};
},
},
//TODO пересмотреть функцию
//TODO пересмотреть функцию
...
@@ -569,6 +590,71 @@
...
@@ -569,6 +590,71 @@
span
.
innerHTML
=
span
.
innerHTML
.
replace
(
/
\n
/g
,
'
<br>
'
);
span
.
innerHTML
=
span
.
innerHTML
.
replace
(
/
\n
/g
,
'
<br>
'
);
res
.
push
(
span
);
res
.
push
(
span
);
}
}
return
res
;
},
_getTextFromShape
:
function
(
documentContent
)
{
var
res
=
""
;
if
(
documentContent
&&
documentContent
.
Content
&&
documentContent
.
Content
.
length
)
{
for
(
var
i
=
0
;
i
<
documentContent
.
Content
.
length
;
i
++
)
{
if
(
documentContent
.
Content
[
i
])
{
var
paraText
=
documentContent
.
Content
[
i
].
Get_SelectedText
();
if
(
paraText
)
{
if
(
i
!==
0
)
{
res
+=
'
\n
'
;
}
res
+=
paraText
;
}
}
}
}
return
res
;
},
_getTextFromSheet
:
function
(
range
,
worksheet
)
{
var
res
=
null
;
var
t
=
this
;
if
(
range
)
{
var
bbox
=
range
.
bbox
;
var
res
=
''
;
for
(
var
row
=
bbox
.
r1
;
row
<=
bbox
.
r2
;
++
row
)
{
if
(
row
!=
bbox
.
r1
)
res
+=
'
\n
'
;
for
(
var
col
=
bbox
.
c1
;
col
<=
bbox
.
c2
;
++
col
)
{
if
(
col
!=
bbox
.
c1
)
{
res
+=
'
\t
'
;
}
var
currentRange
=
worksheet
.
model
.
getCell3
(
row
,
col
);
var
textRange
=
currentRange
.
getValue
();
if
(
textRange
==
''
)
{
res
+=
'
\t
'
;
}
else
{
res
+=
textRange
;
}
}
}
}
return
res
;
return
res
;
}
}
};
};
...
...
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