Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
web-apps
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
web-apps
Commits
f3e88e18
Commit
f3e88e18
authored
May 12, 2017
by
Julia Radzhabova
Committed by
GitHub
May 12, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #75 from ONLYOFFICE/feature/special_paste_word
Feature/special paste word
parents
b1b6eab2
880e46bd
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
72 additions
and
1 deletion
+72
-1
apps/documenteditor/main/app/view/DocumentHolder.js
apps/documenteditor/main/app/view/DocumentHolder.js
+64
-1
apps/documenteditor/main/locale/en.json
apps/documenteditor/main/locale/en.json
+1
-0
apps/documenteditor/main/resources/less/toolbar.less
apps/documenteditor/main/resources/less/toolbar.less
+7
-0
No files found.
apps/documenteditor/main/app/view/DocumentHolder.js
View file @
f3e88e18
...
...
@@ -574,6 +574,65 @@ define([
/** coauthoring end **/
};
var
onShowSpecialPasteOptions
=
function
(
specialPasteShowOptions
)
{
var
coord
=
specialPasteShowOptions
.
asc_getCellCoord
(),
pasteContainer
=
me
.
cmpEl
.
find
(
'
#special-paste-container
'
),
pasteItems
=
specialPasteShowOptions
.
asc_getOptions
();
// Prepare menu container
if
(
pasteContainer
.
length
<
1
)
{
me
.
_arrSpecialPaste
=
[];
me
.
_arrSpecialPaste
[
Asc
.
c_oSpecialPasteProps
.
paste
]
=
me
.
textPaste
;
me
.
_arrSpecialPaste
[
Asc
.
c_oSpecialPasteProps
.
keepTextOnly
]
=
me
.
txtKeepTextOnly
;
pasteContainer
=
$
(
'
<div id="special-paste-container" style="position: absolute;"><div id="id-document-holder-btn-special-paste"></div></div>
'
);
me
.
cmpEl
.
append
(
pasteContainer
);
me
.
btnSpecialPaste
=
new
Common
.
UI
.
Button
({
cls
:
'
btn-toolbar
'
,
iconCls
:
'
btn-paste
'
,
menu
:
new
Common
.
UI
.
Menu
({
items
:
[]})
});
me
.
btnSpecialPaste
.
render
(
$
(
'
#id-document-holder-btn-special-paste
'
))
;
}
if
(
pasteItems
.
length
>
0
)
{
var
menu
=
me
.
btnSpecialPaste
.
menu
;
for
(
var
i
=
0
;
i
<
menu
.
items
.
length
;
i
++
)
{
menu
.
removeItem
(
menu
.
items
[
i
]);
i
--
;
}
var
group_prev
=
-
1
;
_
.
each
(
pasteItems
,
function
(
menuItem
,
index
)
{
var
mnu
=
new
Common
.
UI
.
MenuItem
({
caption
:
me
.
_arrSpecialPaste
[
menuItem
],
value
:
menuItem
,
checkable
:
true
,
toggleGroup
:
'
specialPasteGroup
'
}).
on
(
'
click
'
,
function
(
item
,
e
)
{
me
.
api
.
asc_SpecialPaste
(
item
.
value
);
setTimeout
(
function
(){
menu
.
hide
();},
100
);
});
menu
.
addItem
(
mnu
);
});
(
menu
.
items
.
length
>
0
)
&&
menu
.
items
[
0
].
setChecked
(
true
,
true
);
}
if
(
coord
.
asc_getX
()
<
0
||
coord
.
asc_getY
()
<
0
)
{
if
(
pasteContainer
.
is
(
'
:visible
'
))
pasteContainer
.
hide
();
}
else
{
var
showPoint
=
[
coord
.
asc_getX
()
+
coord
.
asc_getWidth
()
+
3
,
coord
.
asc_getY
()
+
coord
.
asc_getHeight
()
+
3
];
pasteContainer
.
css
({
left
:
showPoint
[
0
],
top
:
showPoint
[
1
]});
pasteContainer
.
show
();
}
};
var
onHideSpecialPasteOptions
=
function
()
{
var
pasteContainer
=
me
.
cmpEl
.
find
(
'
#special-paste-container
'
);
if
(
pasteContainer
.
is
(
'
:visible
'
))
pasteContainer
.
hide
();
};
var
onDialogAddHyperlink
=
function
()
{
var
win
,
props
,
text
;
if
(
me
.
api
&&
me
.
mode
.
isEdit
){
...
...
@@ -1438,6 +1497,9 @@ define([
this
.
api
.
asc_registerCallback
(
'
asc_onShowForeignCursorLabel
'
,
_
.
bind
(
onShowForeignCursorLabel
,
this
));
this
.
api
.
asc_registerCallback
(
'
asc_onHideForeignCursorLabel
'
,
_
.
bind
(
onHideForeignCursorLabel
,
this
));
this
.
api
.
asc_registerCallback
(
'
asc_onFocusObject
'
,
_
.
bind
(
onFocusObject
,
this
));
this
.
api
.
asc_registerCallback
(
'
asc_onShowSpecialPasteOptions
'
,
_
.
bind
(
onShowSpecialPasteOptions
,
this
));
this
.
api
.
asc_registerCallback
(
'
asc_onHideSpecialPasteOptions
'
,
_
.
bind
(
onHideSpecialPasteOptions
,
this
));
}
return
this
;
...
...
@@ -3338,7 +3400,8 @@ define([
txtAlignToChar
:
'
Align to character
'
,
txtDeleteRadical
:
'
Delete radical
'
,
txtDeleteChars
:
'
Delete enclosing characters
'
,
txtDeleteCharsAndSeparators
:
'
Delete enclosing characters and separators
'
txtDeleteCharsAndSeparators
:
'
Delete enclosing characters and separators
'
,
txtKeepTextOnly
:
'
Keep text only
'
},
DE
.
Views
.
DocumentHolder
||
{}));
});
\ No newline at end of file
apps/documenteditor/main/locale/en.json
View file @
f3e88e18
...
...
@@ -835,6 +835,7 @@
"DE.Views.DocumentHolder.txtUngroup"
:
"Ungroup"
,
"DE.Views.DocumentHolder.updateStyleText"
:
"Update %1 style"
,
"DE.Views.DocumentHolder.vertAlignText"
:
"Vertical Alignment"
,
"DE.Views.DocumentHolder.txtKeepTextOnly"
:
"Keep text only"
,
"DE.Views.DropcapSettingsAdvanced.cancelButtonText"
:
"Cancel"
,
"DE.Views.DropcapSettingsAdvanced.okButtonText"
:
"Ok"
,
"DE.Views.DropcapSettingsAdvanced.strBorders"
:
"Borders & Fill"
,
...
...
apps/documenteditor/main/resources/less/toolbar.less
View file @
f3e88e18
...
...
@@ -438,3 +438,10 @@
background-position: @plus-offset-x @plus-offset-y - 16;
}
}
#special-paste-container {
position: absolute;
z-index: @zindex-dropdown - 20;
background-color: @gray-light;
border: 1px solid @gray;
}
\ No newline at end of file
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