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
7201d6d9
Commit
7201d6d9
authored
Mar 14, 2017
by
Oleg Korshul
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
check idle
parent
c19772ec
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
82 additions
and
0 deletions
+82
-0
common/apiBase.js
common/apiBase.js
+23
-0
slide/Drawing/DrawingDocument.js
slide/Drawing/DrawingDocument.js
+20
-0
slide/Drawing/HtmlPage.js
slide/Drawing/HtmlPage.js
+10
-0
word/Drawing/DrawingDocument.js
word/Drawing/DrawingDocument.js
+12
-0
word/Drawing/HtmlPage.js
word/Drawing/HtmlPage.js
+17
-0
No files found.
common/apiBase.js
View file @
7201d6d9
...
...
@@ -169,6 +169,8 @@
this
.
isLockTargetUpdate
=
false
;
this
.
lastWorkTime
=
0
;
return
this
;
}
...
...
@@ -1306,6 +1308,27 @@
{
};
baseEditorsApi
.
prototype
.
isIdle
=
function
(
time
)
{
// пока не стартовали - считаем работаем
if
(
0
==
this
.
lastWorkTime
)
return
false
;
// если плагин работает - то и мы тоже
if
(
this
.
pluginsManager
&&
this
.
pluginsManager
.
current
!=
null
)
return
false
;
var
_currentTime
=
new
Date
().
getTime
();
return
((
_currentTime
-
this
.
lastWorkTime
)
>
time
)
?
true
:
false
;
};
baseEditorsApi
.
prototype
.
checkLastWork
=
function
()
{
this
.
lastWorkTime
=
new
Date
().
getTime
();
console
.
log
(
this
.
lastWorkTime
);
};
//----------------------------------------------------------export----------------------------------------------------
window
[
'
AscCommon
'
]
=
window
[
'
AscCommon
'
]
||
{};
window
[
'
AscCommon
'
].
baseEditorsApi
=
baseEditorsApi
;
...
...
slide/Drawing/DrawingDocument.js
View file @
7201d6d9
...
...
@@ -1007,6 +1007,8 @@ function CDrawingDocument()
this
.
OnStartRecalculate
=
function
(
pageCount
)
{
if
(
this
.
m_oWordControl
)
this
.
m_oWordControl
.
m_oApi
.
checkLastWork
();
}
this
.
SetTargetColor
=
function
(
r
,
g
,
b
)
...
...
@@ -1083,6 +1085,9 @@ function CDrawingDocument()
this
.
OnEndRecalculate
=
function
()
{
if
(
this
.
m_oWordControl
)
this
.
m_oWordControl
.
m_oApi
.
checkLastWork
();
this
.
m_oWordControl
.
Thumbnails
.
LockMainObjType
=
true
;
this
.
SlidesCount
=
this
.
m_oLogicDocument
.
Slides
.
length
;
this
.
m_oWordControl
.
CalculateDocumentSize
();
...
...
@@ -1870,6 +1875,9 @@ function CDrawingDocument()
this
.
UpdateTarget
=
function
(
x
,
y
,
pageIndex
)
{
if
(
this
.
m_oWordControl
)
this
.
m_oWordControl
.
m_oApi
.
checkLastWork
();
this
.
m_oWordControl
.
m_oLogicDocument
.
Set_TargetPos
(
x
,
y
,
pageIndex
);
if
(
pageIndex
!=
this
.
SlideCurrent
)
{
...
...
@@ -3378,6 +3386,9 @@ function CThumbnailsManager()
this
.
onMouseDown
=
function
(
e
)
{
if
(
oThis
.
m_oWordControl
)
oThis
.
m_oWordControl
.
m_oApi
.
checkLastWork
();
if
(
e
.
preventDefault
)
e
.
preventDefault
();
else
...
...
@@ -3619,6 +3630,9 @@ function CThumbnailsManager()
this
.
onMouseMove
=
function
(
e
)
{
if
(
oThis
.
m_oWordControl
)
oThis
.
m_oWordControl
.
m_oApi
.
checkLastWork
();
var
control
=
oThis
.
m_oWordControl
.
m_oThumbnails
.
HtmlElement
;
if
(
global_mouseEvent
.
IsLocked
==
true
&&
global_mouseEvent
.
Sender
!=
control
)
{
...
...
@@ -3773,6 +3787,9 @@ function CThumbnailsManager()
this
.
onMouseUp
=
function
(
e
)
{
if
(
oThis
.
m_oWordControl
)
oThis
.
m_oWordControl
.
m_oApi
.
checkLastWork
();
AscCommon
.
check_MouseUpEvent
(
e
);
global_mouseEvent
.
UnLockMouse
();
...
...
@@ -4278,6 +4295,9 @@ function CThumbnailsManager()
if
(
null
==
canvas
)
return
;
if
(
this
.
m_oWordControl
)
this
.
m_oWordControl
.
m_oApi
.
checkLastWork
();
var
context
=
canvas
.
getContext
(
"
2d
"
);
var
_width
=
canvas
.
width
;
var
_height
=
canvas
.
height
;
...
...
slide/Drawing/HtmlPage.js
View file @
7201d6d9
...
...
@@ -1633,6 +1633,8 @@ function CEditorPage(api)
this
.
onMouseDown
=
function
(
e
)
{
oThis
.
m_oApi
.
checkLastWork
();
if
(
false
===
oThis
.
m_oApi
.
bInit_word_control
)
return
;
...
...
@@ -1713,6 +1715,8 @@ function CEditorPage(api)
this
.
onMouseMove
=
function
(
e
)
{
oThis
.
m_oApi
.
checkLastWork
();
if
(
false
===
oThis
.
m_oApi
.
bInit_word_control
)
return
;
...
...
@@ -1760,6 +1764,8 @@ function CEditorPage(api)
};
this
.
onMouseUp
=
function
(
e
,
bIsWindow
)
{
oThis
.
m_oApi
.
checkLastWork
();
if
(
false
===
oThis
.
m_oApi
.
bInit_word_control
)
return
;
//if (true == global_mouseEvent.IsLocked)
...
...
@@ -1975,6 +1981,8 @@ function CEditorPage(api)
this
.
onKeyDown
=
function
(
e
)
{
oThis
.
m_oApi
.
checkLastWork
();
if
(
oThis
.
m_oApi
.
isLongAction
())
{
e
.
preventDefault
();
...
...
@@ -2630,6 +2638,8 @@ function CEditorPage(api)
return
false
;
}
this
.
m_oApi
.
checkLastWork
();
var
overlay
=
this
.
m_oOverlayApi
;
overlay
.
SetBaseTransform
();
...
...
word/Drawing/DrawingDocument.js
View file @
7201d6d9
...
...
@@ -2177,6 +2177,9 @@ function CDrawingDocument()
this
.
OnStartRecalculate
=
function
(
pageCount
)
{
if
(
this
.
m_oWordControl
)
this
.
m_oWordControl
.
m_oApi
.
checkLastWork
();
this
.
m_lCountCalculatePages
=
pageCount
;
//console.log("start " + this.m_lCountCalculatePages);
...
...
@@ -2186,6 +2189,9 @@ function CDrawingDocument()
this
.
OnRepaintPage
=
function
(
index
)
{
if
(
this
.
m_oWordControl
)
this
.
m_oWordControl
.
m_oApi
.
checkLastWork
();
var
page
=
this
.
m_arrPages
[
index
];
if
(
!
page
)
return
;
...
...
@@ -2256,6 +2262,9 @@ function CDrawingDocument()
this
.
OnEndRecalculate
=
function
(
isFull
,
isBreak
)
{
if
(
this
.
m_oWordControl
)
this
.
m_oWordControl
.
m_oApi
.
checkLastWork
();
if
(
undefined
!=
isBreak
)
{
this
.
m_lCountCalculatePages
=
this
.
m_lPagesCount
;
...
...
@@ -3219,6 +3228,9 @@ function CDrawingDocument()
this
.
UpdateTarget
=
function
(
x
,
y
,
pageIndex
)
{
if
(
this
.
m_oWordControl
)
this
.
m_oWordControl
.
m_oApi
.
checkLastWork
();
this
.
m_oWordControl
.
m_oLogicDocument
.
Set_TargetPos
(
x
,
y
,
pageIndex
);
if
(
this
.
UpdateTargetFromPaint
===
false
)
...
...
word/Drawing/HtmlPage.js
View file @
7201d6d9
...
...
@@ -1514,6 +1514,8 @@ function CEditorPage(api)
this
.
onMouseDown
=
function
(
e
,
isTouch
)
{
oThis
.
m_oApi
.
checkLastWork
();
//console.log("down: " + isTouch + ", " + AscCommon.isTouch);
if
(
false
===
oThis
.
m_oApi
.
bInit_word_control
||
(
AscCommon
.
isTouch
&&
undefined
===
isTouch
))
return
;
...
...
@@ -1617,6 +1619,8 @@ function CEditorPage(api)
this
.
onMouseMove
=
function
(
e
,
isTouch
)
{
oThis
.
m_oApi
.
checkLastWork
();
if
(
false
===
oThis
.
m_oApi
.
bInit_word_control
||
(
AscCommon
.
isTouch
&&
undefined
===
isTouch
))
return
;
...
...
@@ -1703,6 +1707,8 @@ function CEditorPage(api)
};
this
.
onMouseUp
=
function
(
e
,
bIsWindow
,
isTouch
)
{
oThis
.
m_oApi
.
checkLastWork
();
//console.log("up: " + isTouch + ", " + AscCommon.isTouch);
if
(
false
===
oThis
.
m_oApi
.
bInit_word_control
||
(
AscCommon
.
isTouch
&&
undefined
===
isTouch
))
return
;
...
...
@@ -2277,6 +2283,8 @@ function CEditorPage(api)
this
.
onKeyDown
=
function
(
e
)
{
oThis
.
m_oApi
.
checkLastWork
();
if
(
oThis
.
m_oApi
.
isLongAction
())
{
e
.
preventDefault
();
...
...
@@ -2825,6 +2833,9 @@ function CEditorPage(api)
this
.
IsUpdateOverlayOnEndCheck
=
true
;
return
false
;
}
this
.
m_oApi
.
checkLastWork
();
//console.log("update_overlay");
var
overlay
=
this
.
m_oOverlayApi
;
//if (!overlay.m_bIsShow)
...
...
@@ -3151,12 +3162,18 @@ function CEditorPage(api)
this
.
OnPaint
=
function
()
{
if
(
this
.
DrawingFreeze
||
true
===
window
[
"
DisableVisibleComponents
"
])
{
this
.
m_oApi
.
checkLastWork
();
return
;
}
//console.log("paint");
var
canvas
=
this
.
m_oEditor
.
HtmlElement
;
if
(
null
==
canvas
)
{
this
.
m_oApi
.
checkLastWork
();
return
;
}
var
context
=
canvas
.
getContext
(
"
2d
"
);
context
.
fillStyle
=
GlobalSkin
.
BackgroundColor
;
...
...
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