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
6254fe3d
Commit
6254fe3d
authored
Jun 14, 2016
by
Oleg Korshul
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
copy/paste новая схема, новый ввод
parent
59006b72
Changes
6
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
780 additions
and
824 deletions
+780
-824
common/clipboard_base.js
common/clipboard_base.js
+757
-674
common/text_input.js
common/text_input.js
+8
-1
word/Drawing/DrawingDocument.js
word/Drawing/DrawingDocument.js
+3
-0
word/Drawing/HtmlPage.js
word/Drawing/HtmlPage.js
+8
-3
word/Editor/Document.js
word/Editor/Document.js
+0
-105
word/api.js
word/api.js
+4
-41
No files found.
common/clipboard_base.js
View file @
6254fe3d
This diff is collapsed.
Click to expand it.
common/text_input.js
View file @
6254fe3d
...
@@ -85,7 +85,7 @@
...
@@ -85,7 +85,7 @@
// TODO:
// TODO:
setInterval
(
function
(){
setInterval
(
function
(){
if
(
oThis
.
Api
.
asc_IsFocus
())
if
(
oThis
.
Api
.
asc_IsFocus
()
&&
!
AscCommon
.
g_clipboardBase
.
IsFocus
()
&&
!
AscCommon
.
g_clipboardBase
.
IsWorking
()
)
oThis
.
HtmlArea
.
focus
();
oThis
.
HtmlArea
.
focus
();
},
10
);
},
10
);
},
},
...
@@ -318,4 +318,11 @@
...
@@ -318,4 +318,11 @@
window
[
'
AscCommon
'
]
=
window
[
'
AscCommon
'
]
||
{};
window
[
'
AscCommon
'
]
=
window
[
'
AscCommon
'
]
||
{};
window
[
'
AscCommon
'
].
CTextInput
=
CTextInput
;
window
[
'
AscCommon
'
].
CTextInput
=
CTextInput
;
window
[
'
AscCommon
'
].
InitBrowserInputContext
=
function
(
api
,
target_id
)
{
window
[
'
AscCommon
'
].
g_inputContext
=
new
CTextInput
(
api
);
window
[
'
AscCommon
'
].
g_inputContext
.
init
(
target_id
);
window
[
'
AscCommon
'
].
g_clipboardBase
.
Init
(
api
);
};
})(
window
);
})(
window
);
word/Drawing/DrawingDocument.js
View file @
6254fe3d
...
@@ -3064,6 +3064,9 @@ function CDrawingDocument()
...
@@ -3064,6 +3064,9 @@ function CDrawingDocument()
this
.
m_oWordControl
.
CheckTextBoxInputPos
();
this
.
m_oWordControl
.
CheckTextBoxInputPos
();
}
}
if
(
AscCommon
.
g_inputContext
)
AscCommon
.
g_inputContext
.
move
(
this
.
TargetHtmlElementLeft
,
this
.
TargetHtmlElementTop
);
}
}
this
.
UpdateTargetTransform
=
function
(
matrix
)
this
.
UpdateTargetTransform
=
function
(
matrix
)
...
...
word/Drawing/HtmlPage.js
View file @
6254fe3d
...
@@ -549,9 +549,12 @@ function CEditorPage(api)
...
@@ -549,9 +549,12 @@ function CEditorPage(api)
this
.
m_oLeftRuler_vertRuler
.
HtmlElement
.
onmouseup
=
this
.
verRulerMouseUp
;
//new Function("event", "verRulerMouseUp(event);");
this
.
m_oLeftRuler_vertRuler
.
HtmlElement
.
onmouseup
=
this
.
verRulerMouseUp
;
//new Function("event", "verRulerMouseUp(event);");
this
.
m_oLeftRuler_vertRuler
.
HtmlElement
.
onmousemove
=
this
.
verRulerMouseMove
;
//new Function("event", "verRulerMouseMove(event);");
this
.
m_oLeftRuler_vertRuler
.
HtmlElement
.
onmousemove
=
this
.
verRulerMouseMove
;
//new Function("event", "verRulerMouseMove(event);");
/*
// теперь все делает AscCommon.InitBrowserSystemContext
window.onkeydown = this.onKeyDown;//Editor_OnKeyDown;
window.onkeydown = this.onKeyDown;//Editor_OnKeyDown;
window.onkeypress = this.onKeyPress;//Editor_OnKeyPress;
window.onkeypress = this.onKeyPress;//Editor_OnKeyPress;
window.onkeyup = this.onKeyUp;
window.onkeyup = this.onKeyUp;
*/
this
.
m_oBody
.
HtmlElement
.
oncontextmenu
=
function
()
{
return
false
;
};
this
.
m_oBody
.
HtmlElement
.
oncontextmenu
=
function
()
{
return
false
;
};
//window.oncontextmenu = function() { return false; };
//window.oncontextmenu = function() { return false; };
...
@@ -2559,7 +2562,7 @@ function CEditorPage(api)
...
@@ -2559,7 +2562,7 @@ function CEditorPage(api)
}
}
this
.
onKeyPress
=
function
(
e
)
this
.
onKeyPress
=
function
(
e
)
{
{
if
(
window
.
GlobalPasteFlag
||
window
.
GlobalCopyFlag
)
if
(
AscCommon
.
g_clipboardBase
.
IsWorking
()
)
return
;
return
;
if
(
oThis
.
m_oApi
.
isLongAction
())
if
(
oThis
.
m_oApi
.
isLongAction
())
...
@@ -3688,6 +3691,8 @@ function CEditorPage(api)
...
@@ -3688,6 +3691,8 @@ function CEditorPage(api)
window
[
"
AutoTester
"
][
"
RunTest
"
]();
window
[
"
AutoTester
"
][
"
RunTest
"
]();
}
}
AscCommon
.
InitBrowserInputContext
(
this
.
m_oApi
,
"
id_target_cursor
"
);
//this.m_oDrawingDocument.CheckFontCache();
//this.m_oDrawingDocument.CheckFontCache();
}
}
...
@@ -3761,7 +3766,7 @@ function CEditorPage(api)
...
@@ -3761,7 +3766,7 @@ function CEditorPage(api)
if
(
oWordControl
.
IsFocus
&&
oWordControl
.
TextBoxInputMode
&&
oWordControl
.
TextBoxInput
&&
!
AscCommon
.
AscBrowser
.
isSafariMacOs
)
if
(
oWordControl
.
IsFocus
&&
oWordControl
.
TextBoxInputMode
&&
oWordControl
.
TextBoxInput
&&
!
AscCommon
.
AscBrowser
.
isSafariMacOs
)
{
{
if
(
!
oWordControl
.
m_oApi
.
isLongAction
()
&&
!
window
.
GlobalCopyFlag
)
if
(
!
oWordControl
.
m_oApi
.
isLongAction
()
&&
!
AscCommon
.
g_clipboardBase
.
IsWorking
()
)
oWordControl
.
TextBoxInput
.
focus
();
oWordControl
.
TextBoxInput
.
focus
();
}
}
...
@@ -3775,7 +3780,7 @@ function CEditorPage(api)
...
@@ -3775,7 +3780,7 @@ function CEditorPage(api)
if
(
null
!=
oWordControl
.
m_oLogicDocument
&&
oWordControl
.
m_oApi
.
bInit_word_control
)
if
(
null
!=
oWordControl
.
m_oLogicDocument
&&
oWordControl
.
m_oApi
.
bInit_word_control
)
oWordControl
.
m_oLogicDocument
.
Viewer_OnChangePosition
();
oWordControl
.
m_oLogicDocument
.
Viewer_OnChangePosition
();
}
}
if
(
null
!=
oWordControl
.
m_oLogicDocument
)
if
(
null
!=
oWordControl
.
m_oLogicDocument
&&
!
oWordControl
.
m_oApi
.
isLockTargetUpdate
)
{
{
oWordControl
.
m_oDrawingDocument
.
UpdateTargetFromPaint
=
true
;
oWordControl
.
m_oDrawingDocument
.
UpdateTargetFromPaint
=
true
;
oWordControl
.
m_oLogicDocument
.
CheckTargetUpdate
();
oWordControl
.
m_oLogicDocument
.
CheckTargetUpdate
();
...
...
word/Editor/Document.js
View file @
6254fe3d
...
@@ -11179,45 +11179,6 @@ CDocument.prototype.OnKeyDown = function(e)
...
@@ -11179,45 +11179,6 @@ CDocument.prototype.OnKeyDown = function(e)
this
.
Cursor_MoveDown
(
true
===
e
.
ShiftKey
);
this
.
Cursor_MoveDown
(
true
===
e
.
ShiftKey
);
bRetValue
=
keydownresult_PreventAll
;
bRetValue
=
keydownresult_PreventAll
;
}
}
else
if
(
e
.
KeyCode
==
45
)
// Insert
{
if
(
true
===
e
.
CtrlKey
)
// Ctrl + Insert (аналогично Ctrl + C)
{
Editor_Copy
(
this
.
Api
);
bRetValue
=
keydownresult_PreventKeyPress
;
}
else
if
(
true
===
e
.
ShiftKey
&&
false
===
editor
.
isViewMode
)
// Shift + Insert (аналогично Ctrl + V)
{
if
(
false
===
this
.
Document_Is_SelectionLocked
(
changestype_Paragraph_Content
))
{
if
(
!
window
.
GlobalPasteFlag
)
{
if
(
!
AscCommon
.
AscBrowser
.
isSafariMacOs
)
{
this
.
Create_NewHistoryPoint
(
AscDFH
.
historydescription_Document_ShiftInsert
);
window
.
GlobalPasteFlag
=
true
;
editor
.
incrementCounterLongAction
();
Editor_Paste
(
this
.
DrawingDocument
.
m_oWordControl
.
m_oApi
,
true
);
bRetValue
=
keydownresult_PreventKeyPress
;
}
else
{
if
(
0
===
window
.
GlobalPasteFlagCounter
)
{
this
.
Create_NewHistoryPoint
(
AscDFH
.
historydescription_Document_ShiftInsertSafari
);
AscCommon
.
SafariIntervalFocus
();
window
.
GlobalPasteFlag
=
true
;
editor
.
incrementCounterLongAction
();
Editor_Paste
(
this
.
DrawingDocument
.
m_oWordControl
.
m_oApi
,
true
);
bRetValue
=
keydownresult_PreventKeyPress
;
}
}
}
}
}
}
else
if
(
e
.
KeyCode
==
46
&&
false
===
editor
.
isViewMode
)
// Delete
else
if
(
e
.
KeyCode
==
46
&&
false
===
editor
.
isViewMode
)
// Delete
{
{
if
(
true
!=
e
.
ShiftKey
)
if
(
true
!=
e
.
ShiftKey
)
...
@@ -11229,14 +11190,6 @@ CDocument.prototype.OnKeyDown = function(e)
...
@@ -11229,14 +11190,6 @@ CDocument.prototype.OnKeyDown = function(e)
}
}
bRetValue
=
keydownresult_PreventAll
;
bRetValue
=
keydownresult_PreventAll
;
}
}
else
// Shift + Delete (аналогично Ctrl + X)
{
if
(
false
===
this
.
Document_Is_SelectionLocked
(
changestype_Paragraph_Content
))
{
Editor_Copy
(
this
.
Api
,
true
);
}
bRetValue
=
keydownresult_PreventKeyPress
;
}
}
}
else
if
(
e
.
KeyCode
==
49
&&
false
===
editor
.
isViewMode
&&
true
===
e
.
AltKey
&&
!
e
.
AltGr
)
// Alt + Ctrl + Num1 - применяем стиль Heading1
else
if
(
e
.
KeyCode
==
49
&&
false
===
editor
.
isViewMode
&&
true
===
e
.
AltKey
&&
!
e
.
AltGr
)
// Alt + Ctrl + Num1 - применяем стиль Heading1
{
{
...
@@ -11309,11 +11262,6 @@ CDocument.prototype.OnKeyDown = function(e)
...
@@ -11309,11 +11262,6 @@ CDocument.prototype.OnKeyDown = function(e)
this
.
Document_Format_Copy
();
this
.
Document_Format_Copy
();
bRetValue
=
keydownresult_PreventAll
;
bRetValue
=
keydownresult_PreventAll
;
}
}
else
// Ctrl + C - copy
{
Editor_Copy
(
this
.
Api
);
bRetValue
=
keydownresult_PreventKeyPress
;
}
}
}
else
if
(
e
.
KeyCode
==
69
&&
false
===
editor
.
isViewMode
&&
true
===
e
.
CtrlKey
)
// Ctrl + E + ...
else
if
(
e
.
KeyCode
==
69
&&
false
===
editor
.
isViewMode
&&
true
===
e
.
CtrlKey
)
// Ctrl + E + ...
{
{
...
@@ -11432,59 +11380,6 @@ CDocument.prototype.OnKeyDown = function(e)
...
@@ -11432,59 +11380,6 @@ CDocument.prototype.OnKeyDown = function(e)
bRetValue
=
keydownresult_PreventAll
;
bRetValue
=
keydownresult_PreventAll
;
}
}
}
}
else
if
(
e
.
KeyCode
==
86
&&
false
===
editor
.
isViewMode
&&
true
===
e
.
CtrlKey
)
// Ctrl + V - paste
{
if
(
false
===
this
.
Document_Is_SelectionLocked
(
changestype_Paragraph_Content
))
{
if
(
true
===
e
.
ShiftKey
)
// Ctrl + Shift + V - вставляем по образцу
{
this
.
Create_NewHistoryPoint
(
AscDFH
.
historydescription_Document_FormatPasteHotKey
);
this
.
Document_Format_Paste
();
bRetValue
=
keydownresult_PreventAll
;
}
else
// Ctrl + V - paste
{
if
(
!
window
.
GlobalPasteFlag
)
{
if
(
!
AscCommon
.
AscBrowser
.
isSafariMacOs
)
{
this
.
Create_NewHistoryPoint
(
AscDFH
.
historydescription_Document_PasteHotKey
);
window
.
GlobalPasteFlag
=
true
;
editor
.
incrementCounterLongAction
();
Editor_Paste
(
this
.
DrawingDocument
.
m_oWordControl
.
m_oApi
,
true
);
bRetValue
=
keydownresult_PreventKeyPress
;
}
else
{
if
(
0
===
window
.
GlobalPasteFlagCounter
)
{
this
.
Create_NewHistoryPoint
(
AscDFH
.
historydescription_Document_PasteSafariHotKey
);
AscCommon
.
SafariIntervalFocus
();
window
.
GlobalPasteFlag
=
true
;
editor
.
incrementCounterLongAction
();
Editor_Paste
(
this
.
DrawingDocument
.
m_oWordControl
.
m_oApi
,
true
);
bRetValue
=
keydownresult_PreventKeyPress
;
}
}
}
else
{
if
(
!
AscCommon
.
AscBrowser
.
isSafariMacOs
)
bRetValue
=
keydownresult_PreventAll
;
}
}
}
}
else
if
(
e
.
KeyCode
==
88
&&
false
===
editor
.
isViewMode
&&
true
===
e
.
CtrlKey
)
// Ctrl + X - cut
{
if
(
false
===
this
.
Document_Is_SelectionLocked
(
changestype_Paragraph_Content
))
{
Editor_Copy
(
this
.
Api
,
true
);
}
bRetValue
=
keydownresult_PreventKeyPress
;
}
else
if
(
e
.
KeyCode
==
89
&&
false
===
editor
.
isViewMode
&&
true
===
e
.
CtrlKey
)
// Ctrl + Y - Redo
else
if
(
e
.
KeyCode
==
89
&&
false
===
editor
.
isViewMode
&&
true
===
e
.
CtrlKey
)
// Ctrl + Y - Redo
{
{
this
.
Document_Redo
();
this
.
Document_Redo
();
...
...
word/api.js
View file @
6254fe3d
...
@@ -814,9 +814,6 @@ background-repeat: no-repeat;\
...
@@ -814,9 +814,6 @@ background-repeat: no-repeat;\
PasteElementsId
.
PASTE_ELEMENT_ID
=
"
wrd_pastebin
"
;
PasteElementsId
.
PASTE_ELEMENT_ID
=
"
wrd_pastebin
"
;
PasteElementsId
.
ELEMENT_DISPAY_STYLE
=
"
none
"
;
PasteElementsId
.
ELEMENT_DISPAY_STYLE
=
"
none
"
;
}
}
if
(
AscCommon
.
AscBrowser
.
isSafariMacOs
)
setInterval
(
AscCommon
.
SafariIntervalFocus
,
10
);
};
};
// Callbacks
// Callbacks
/* все имена callback'оф начинаются с On. Пока сделаны:
/* все имена callback'оф начинаются с On. Пока сделаны:
...
@@ -1882,23 +1879,10 @@ background-repeat: no-repeat;\
...
@@ -1882,23 +1879,10 @@ background-repeat: no-repeat;\
if
(
false
===
this
.
WordControl
.
m_oLogicDocument
.
Document_Is_SelectionLocked
(
changestype_Paragraph_Content
))
if
(
false
===
this
.
WordControl
.
m_oLogicDocument
.
Document_Is_SelectionLocked
(
changestype_Paragraph_Content
))
{
{
if
(
!
window
.
GlobalPasteFlag
)
if
(
AscCommon
.
g_clipboardBase
.
IsWorking
())
{
return
false
;
if
(
!
AscCommon
.
AscBrowser
.
isSafariMacOs
)
{
return
AscCommon
.
g_clipboardBase
.
Button_Paste
();
window
.
GlobalPasteFlag
=
true
;
return
AscCommon
.
Editor_Paste_Button
(
this
);
}
else
{
if
(
0
===
window
.
GlobalPasteFlagCounter
)
{
AscCommon
.
SafariIntervalFocus
();
window
.
GlobalPasteFlag
=
true
;
return
AscCommon
.
Editor_Paste_Button
(
this
);
}
}
}
}
}
};
};
...
@@ -6864,29 +6848,8 @@ background-repeat: no-repeat;\
...
@@ -6864,29 +6848,8 @@ background-repeat: no-repeat;\
// там при LongActions теряется фокус и вставляются пробелы
// там при LongActions теряется фокус и вставляются пробелы
this
.
decrementCounterLongAction
();
this
.
decrementCounterLongAction
();
this
.
pasteCallback
();
this
.
pasteCallback
();
window
.
GlobalPasteFlag
=
false
;
window
.
GlobalPasteFlagCounter
=
0
;
this
.
pasteCallback
=
null
;
this
.
pasteCallback
=
null
;
if
(
-
1
!=
window
.
PasteEndTimerId
)
{
clearTimeout
(
window
.
PasteEndTimerId
);
window
.
PasteEndTimerId
=
-
1
;
document
.
body
.
style
.
MozUserSelect
=
"
none
"
;
document
.
body
.
style
[
"
-khtml-user-select
"
]
=
"
none
"
;
document
.
body
.
style
[
"
-o-user-select
"
]
=
"
none
"
;
document
.
body
.
style
[
"
user-select
"
]
=
"
none
"
;
document
.
body
.
style
[
"
-webkit-user-select
"
]
=
"
none
"
;
var
pastebin
=
AscCommon
.
Editor_Paste_GetElem
(
this
,
true
);
if
(
!
AscCommon
.
AscBrowser
.
isSafariMacOs
)
pastebin
.
onpaste
=
null
;
pastebin
.
style
.
display
=
PasteElementsId
.
ELEMENT_DISPAY_STYLE
;
}
return
;
return
;
}
}
...
...
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