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
50c031ae
Commit
50c031ae
authored
Aug 24, 2016
by
Oleg Korshul
Committed by
GitHub
Aug 24, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #40 from ONLYOFFICE/release/v4.1.0
Release/v4.1.0
parents
b407881f
ebd9a87d
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
86 additions
and
22 deletions
+86
-22
cell/model/WorkbookElems.js
cell/model/WorkbookElems.js
+23
-19
cell/view/CellEditorView.js
cell/view/CellEditorView.js
+3
-3
common/clipboard_base.js
common/clipboard_base.js
+60
-0
No files found.
cell/model/WorkbookElems.js
View file @
50c031ae
...
...
@@ -425,8 +425,8 @@ ColorManager.prototype =
};
g_oColorManager
=
new
ColorManager
();
/** @constructor */
function
Fragment
(
val
)
{
/** @constructor */
function
Fragment
(
val
)
{
this
.
text
=
null
;
this
.
format
=
null
;
this
.
sFormula
=
null
;
...
...
@@ -434,22 +434,26 @@ function Fragment(val) {
if
(
null
!=
val
)
{
this
.
set
(
val
);
}
}
Fragment
.
prototype
=
{
clone
:
function
()
{
}
Fragment
.
prototype
.
clone
=
function
()
{
return
new
Fragment
(
this
);
}
,
set
:
function
(
oVal
)
{
if
(
null
!=
oVal
.
text
)
}
;
Fragment
.
prototype
.
set
=
function
(
oVal
)
{
if
(
null
!=
oVal
.
text
)
{
this
.
text
=
oVal
.
text
;
if
(
null
!=
oVal
.
format
)
}
if
(
null
!=
oVal
.
format
)
{
this
.
format
=
oVal
.
format
;
if
(
null
!=
oVal
.
sFormula
)
}
if
(
null
!=
oVal
.
sFormula
)
{
this
.
sFormula
=
oVal
.
sFormula
;
if
(
null
!=
oVal
.
sId
)
}
if
(
null
!=
oVal
.
sId
)
{
this
.
sId
=
oVal
.
sId
;
}
};
};
var
g_oFontProperties
=
{
fn
:
0
,
scheme
:
1
,
...
...
cell/view/CellEditorView.js
View file @
50c031ae
...
...
@@ -145,7 +145,7 @@
this
.
isSelectMode
=
c_oAscCellEditorSelectState
.
no
;
this
.
hasCursor
=
false
;
this
.
hasFocus
=
false
;
this
.
newTextFormat
=
undefined
;
this
.
newTextFormat
=
null
;
this
.
selectionTimer
=
undefined
;
this
.
enableKeyEvents
=
true
;
this
.
isTopLineActive
=
false
;
...
...
@@ -769,7 +769,7 @@
this
.
_cleanFragments
(
opt
.
fragments
);
this
.
textRender
.
setString
(
opt
.
fragments
,
this
.
textFlags
);
delete
this
.
newTextFormat
;
this
.
newTextFormat
=
null
;
if
(
opt
.
zoom
>
0
)
{
this
.
overlayCtx
.
setFont
(
this
.
drawingCtx
.
getFont
()
);
...
...
@@ -1725,7 +1725,7 @@
if
(
this
.
newTextFormat
)
{
var
oNewObj
=
new
Fragment
({
format
:
this
.
newTextFormat
,
text
:
str
});
this
.
_addFragments
([
oNewObj
],
pos
);
delete
this
.
newTextFormat
;
this
.
newTextFormat
=
null
;
}
else
{
f
=
this
.
_findFragmentToInsertInto
(
pos
);
if
(
f
)
{
...
...
common/clipboard_base.js
View file @
50c031ae
...
...
@@ -88,6 +88,11 @@
this
.
inputContext
=
null
;
this
.
LastCopyBinary
=
null
;
// для вставки по кнопке, еогда браузер не позволяет
// images counter
this
.
PasteImagesCount
=
0
;
this
.
PasteImagesCounter
=
0
;
this
.
PasteImagesBody
=
""
;
}
CClipboardBase
.
prototype
=
...
...
@@ -271,8 +276,63 @@
this
.
CommonIframe_PasteStart
(
sHtml
);
return
false
;
}
var
items
=
_clipboard
.
items
;
if
(
null
!=
items
&&
0
!=
items
.
length
)
{
g_clipboardBase
.
PasteImagesBody
=
""
;
g_clipboardBase
.
PasteImagesCount
=
items
.
length
;
g_clipboardBase
.
PasteImagesCounter
=
0
;
for
(
var
i
=
0
;
i
<
items
.
length
;
++
i
)
{
if
(
items
[
i
].
kind
==
'
file
'
&&
items
[
i
].
type
.
indexOf
(
'
image/
'
)
!==
-
1
)
{
var
blob
=
items
[
i
].
getAsFile
();
var
reader
=
new
FileReader
();
reader
.
onload
=
function
(
e
)
{
g_clipboardBase
.
PasteImagesCounter
++
;
g_clipboardBase
.
PasteImagesBody
+=
(
"
<img src=
\"
"
+
e
.
target
.
result
+
"
\"
/>
"
);
if
(
g_clipboardBase
.
PasteImagesCounter
==
g_clipboardBase
.
PasteImagesCount
)
{
g_clipboardBase
.
CommonIframe_PasteStart
(
"
<html><body>
"
+
g_clipboardBase
.
PasteImagesBody
+
"
</body></html>
"
);
g_clipboardBase
.
PasteImagesBody
=
""
;
g_clipboardBase
.
PasteImagesCounter
=
0
;
g_clipboardBase
.
PasteImagesCount
=
0
;
}
};
reader
.
onabort
=
reader
.
onerror
=
function
(
e
)
{
g_clipboardBase
.
PasteImagesCounter
++
;
if
(
g_clipboardBase
.
PasteImagesCounter
==
g_clipboardBase
.
PasteImagesCount
)
{
g_clipboardBase
.
CommonIframe_PasteStart
(
"
<html><body>
"
+
g_clipboardBase
.
PasteImagesBody
+
"
</body></html>
"
);
g_clipboardBase
.
PasteImagesBody
=
""
;
g_clipboardBase
.
PasteImagesCounter
=
0
;
g_clipboardBase
.
PasteImagesCount
=
0
;
}
};
reader
.
readAsDataURL
(
blob
);
}
else
{
g_clipboardBase
.
PasteImagesCounter
++
;
}
}
if
(
g_clipboardBase
.
PasteImagesCounter
==
g_clipboardBase
.
PasteImagesCount
)
g_clipboardBase
.
Paste_End
();
return
false
;
}
}
g_clipboardBase
.
Paste_End
();
return
false
;
},
...
...
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