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
9e070140
Commit
9e070140
authored
Mar 18, 2016
by
Alexey.Musinov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[mobile] исправления для сборки скриптов
parent
f5e5d6e1
Changes
4
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
281 additions
and
32 deletions
+281
-32
Common/Drawings/CommonController.js
Common/Drawings/CommonController.js
+9
-2
Excel/native/native.js
Excel/native/native.js
+261
-30
Excel/native/underscore-min.js
Excel/native/underscore-min.js
+6
-0
Excel/native/xregexp-all-min.js
Excel/native/xregexp-all-min.js
+5
-0
No files found.
Common/Drawings/CommonController.js
View file @
9e070140
...
...
@@ -841,6 +841,9 @@ DrawingObjectsController.prototype =
drawSelect
:
function
(
pageIndex
,
drawingDocument
)
{
if
(
undefined
!==
drawingDocument
.
BeginDrawTracking
)
drawingDocument
.
BeginDrawTracking
();
var
i
;
if
(
this
.
selection
.
textSelection
)
{
...
...
@@ -1004,6 +1007,10 @@ DrawingObjectsController.prototype =
{
drawingDocument
.
DrawTrackSelectShapes
(
this
.
selectionRect
.
x
,
this
.
selectionRect
.
y
,
this
.
selectionRect
.
w
,
this
.
selectionRect
.
h
);
}
if
(
undefined
!==
drawingDocument
.
EndDrawTracking
)
drawingDocument
.
EndDrawTracking
();
return
;
},
...
...
Excel/native/native.js
View file @
9e070140
...
...
@@ -22,13 +22,6 @@
* Pursuant to Section 7 3(e) we decline to grant you any rights under trademark law for use of our trademarks.
*
*/
/**
* native.js
*
* Created by Alexey Musinov on 14 April 2015
* Copyright (c) 2015 Ascensio System SIA. All rights reserved.
*
*/
var
editor
=
undefined
;
var
window
=
{};
...
...
@@ -2873,7 +2866,244 @@ function OfflineEditor () {
// main
this
.
beforeOpen
=
function
()
{
DrawingArea
.
prototype
.
drawSelection
=
function
(
drawingDocument
)
{
var
canvas
=
this
.
worksheet
.
objectRender
.
getDrawingCanvas
();
var
shapeCtx
=
canvas
.
shapeCtx
;
var
shapeOverlayCtx
=
canvas
.
shapeOverlayCtx
;
var
autoShapeTrack
=
canvas
.
autoShapeTrack
;
var
trackOverlay
=
canvas
.
trackOverlay
;
var
ctx
=
trackOverlay
.
m_oContext
;
trackOverlay
.
Clear
();
drawingDocument
.
Overlay
=
trackOverlay
;
this
.
worksheet
.
overlayCtx
.
clear
();
this
.
worksheet
.
overlayGraphicCtx
.
clear
();
this
.
worksheet
.
_drawCollaborativeElements
();
if
(
!
this
.
worksheet
.
objectRender
.
controller
.
selectedObjects
.
length
&&
!
this
.
api
.
isStartAddShape
)
this
.
worksheet
.
_drawSelection
();
var
chart
;
var
controller
=
this
.
worksheet
.
objectRender
.
controller
;
var
selected_objects
=
controller
.
selection
.
groupSelection
?
controller
.
selection
.
groupSelection
.
selectedObjects
:
controller
.
selectedObjects
;
if
(
selected_objects
.
length
===
1
&&
selected_objects
[
0
].
getObjectType
()
===
historyitem_type_ChartSpace
)
{
chart
=
selected_objects
[
0
];
this
.
worksheet
.
objectRender
.
selectDrawingObjectRange
(
chart
);
//shapeOverlayCtx.ClearMode = true;
////selected_objects[0].draw(shapeOverlayCtx);
//shapeOverlayCtx.ClearMode = false;
}
for
(
var
i
=
0
;
i
<
this
.
frozenPlaces
.
length
;
i
++
)
{
this
.
frozenPlaces
[
i
].
setTransform
(
shapeCtx
,
shapeOverlayCtx
,
autoShapeTrack
);
// Clip
this
.
frozenPlaces
[
i
].
clip
(
shapeOverlayCtx
);
if
(
null
==
drawingDocument
.
m_oDocumentRenderer
)
{
if
(
drawingDocument
.
m_bIsSelection
)
{
if
(
drawingDocument
.
m_bIsSelection
)
{
trackOverlay
.
m_oControl
.
HtmlElement
.
style
.
display
=
"
block
"
;
if
(
null
==
trackOverlay
.
m_oContext
)
trackOverlay
.
m_oContext
=
trackOverlay
.
m_oControl
.
HtmlElement
.
getContext
(
'
2d
'
);
}
drawingDocument
.
private_StartDrawSelection
(
trackOverlay
);
this
.
worksheet
.
objectRender
.
controller
.
drawTextSelection
();
drawingDocument
.
private_EndDrawSelection
();
}
ctx
.
globalAlpha
=
1.0
;
this
.
worksheet
.
objectRender
.
controller
.
drawSelection
(
drawingDocument
);
if
(
this
.
worksheet
.
objectRender
.
controller
.
needUpdateOverlay
()
)
{
trackOverlay
.
Show
();
shapeOverlayCtx
.
put_GlobalAlpha
(
true
,
0.5
);
this
.
worksheet
.
objectRender
.
controller
.
drawTracks
(
shapeOverlayCtx
);
shapeOverlayCtx
.
put_GlobalAlpha
(
true
,
1
);
}
}
else
{
ctx
.
fillStyle
=
"
rgba(51,102,204,255)
"
;
ctx
.
beginPath
();
for
(
var
j
=
drawingDocument
.
m_lDrawingFirst
;
j
<=
drawingDocument
.
m_lDrawingEnd
;
j
++
)
{
var
drawPage
=
drawingDocument
.
m_arrPages
[
j
].
drawingPage
;
drawingDocument
.
m_oDocumentRenderer
.
DrawSelection
(
j
,
trackOverlay
,
drawPage
.
left
,
drawPage
.
top
,
drawPage
.
right
-
drawPage
.
left
,
drawPage
.
bottom
-
drawPage
.
top
);
}
ctx
.
globalAlpha
=
0.2
;
ctx
.
fill
();
ctx
.
beginPath
();
ctx
.
globalAlpha
=
1.0
;
}
// Restore
this
.
frozenPlaces
[
i
].
restore
(
shapeOverlayCtx
);
}
};
DrawingObjectsController
.
prototype
.
onMouseDown
=
function
(
e
,
x
,
y
)
{
var
ret
=
this
.
curState
.
onMouseDown
(
e
,
x
,
y
,
0
);
if
(
e
.
ClickCount
<
2
)
{
//this.updateOverlay();
//this.updateSelectionState();
}
return
ret
;
};
Path
.
prototype
.
drawSmart
=
function
(
shape_drawer
)
{
var
_graphics
=
shape_drawer
.
Graphics
;
var
_full_trans
=
_graphics
.
m_oFullTransform
;
if
(
!
_graphics
||
!
_full_trans
||
undefined
==
_graphics
.
m_bIntegerGrid
||
true
===
shape_drawer
.
bIsNoSmartAttack
)
return
this
.
draw
(
shape_drawer
);
var
bIsTransformed
=
(
_full_trans
.
shx
==
0
&&
_full_trans
.
shy
==
0
)
?
false
:
true
;
if
(
bIsTransformed
)
return
this
.
draw
(
shape_drawer
);
var
isLine
=
this
.
isSmartLine
();
var
isRect
=
false
;
if
(
!
isLine
)
isRect
=
this
.
isSmartRect
();
//if (!isLine && !isRect) // IOS убрать
return
this
.
draw
(
shape_drawer
);
var
_old_int
=
_graphics
.
m_bIntegerGrid
;
if
(
false
==
_old_int
)
_graphics
.
SetIntegerGrid
(
true
);
var
dKoefMMToPx
=
Math
.
max
(
_graphics
.
m_oCoordTransform
.
sx
,
0.001
);
var
_ctx
=
_graphics
.
m_oContext
;
var
bIsStroke
=
(
shape_drawer
.
bIsNoStrokeAttack
||
(
this
.
stroke
!==
true
))
?
false
:
true
;
var
bIsEven
=
false
;
if
(
bIsStroke
)
{
var
_lineWidth
=
Math
.
max
((
shape_drawer
.
StrokeWidth
*
dKoefMMToPx
+
0.5
)
>>
0
,
1
);
_ctx
.
lineWidth
=
_lineWidth
;
if
(
_lineWidth
&
0x01
==
0x01
)
bIsEven
=
true
;
}
var
bIsDrawLast
=
false
;
var
path
=
this
.
ArrPathCommand
;
shape_drawer
.
_s
();
if
(
!
isRect
)
{
for
(
var
j
=
0
,
l
=
path
.
length
;
j
<
l
;
++
j
)
{
var
cmd
=
path
[
j
];
switch
(
cmd
.
id
)
{
case
moveTo
:
{
bIsDrawLast
=
true
;
var
_x
=
(
_full_trans
.
TransformPointX
(
cmd
.
X
,
cmd
.
Y
))
>>
0
;
var
_y
=
(
_full_trans
.
TransformPointY
(
cmd
.
X
,
cmd
.
Y
))
>>
0
;
if
(
bIsEven
)
{
_x
-=
0.5
;
_y
-=
0.5
;
}
_ctx
.
moveTo
(
_x
,
_y
);
break
;
}
case
lineTo
:
{
bIsDrawLast
=
true
;
var
_x
=
(
_full_trans
.
TransformPointX
(
cmd
.
X
,
cmd
.
Y
))
>>
0
;
var
_y
=
(
_full_trans
.
TransformPointY
(
cmd
.
X
,
cmd
.
Y
))
>>
0
;
if
(
bIsEven
)
{
_x
-=
0.5
;
_y
-=
0.5
;
}
_ctx
.
lineTo
(
_x
,
_y
);
break
;
}
case
close
:
{
_ctx
.
closePath
();
break
;
}
}
}
}
else
{
var
minX
=
100000
;
var
minY
=
100000
;
var
maxX
=
-
100000
;
var
maxY
=
-
100000
;
bIsDrawLast
=
true
;
for
(
var
j
=
0
,
l
=
path
.
length
;
j
<
l
;
++
j
)
{
var
cmd
=
path
[
j
];
switch
(
cmd
.
id
)
{
case
moveTo
:
case
lineTo
:
{
if
(
minX
>
cmd
.
X
)
minX
=
cmd
.
X
;
if
(
minY
>
cmd
.
Y
)
minY
=
cmd
.
Y
;
if
(
maxX
<
cmd
.
X
)
maxX
=
cmd
.
X
;
if
(
maxY
<
cmd
.
Y
)
maxY
=
cmd
.
Y
;
break
;
}
default
:
break
;
}
}
var
_x1
=
(
_full_trans
.
TransformPointX
(
minX
,
minY
))
>>
0
;
var
_y1
=
(
_full_trans
.
TransformPointY
(
minX
,
minY
))
>>
0
;
var
_x2
=
(
_full_trans
.
TransformPointX
(
maxX
,
maxY
))
>>
0
;
var
_y2
=
(
_full_trans
.
TransformPointY
(
maxX
,
maxY
))
>>
0
;
if
(
bIsEven
)
_ctx
.
rect
(
_x1
+
0.5
,
_y1
+
0.5
,
_x2
-
_x1
,
_y2
-
_y1
);
else
_ctx
.
rect
(
_x1
,
_y1
,
_x2
-
_x1
,
_y2
-
_y1
);
}
if
(
bIsDrawLast
)
{
shape_drawer
.
drawFillStroke
(
true
,
this
.
fill
,
bIsStroke
);
}
shape_drawer
.
_e
();
if
(
false
==
_old_int
)
_graphics
.
SetIntegerGrid
(
false
);
};
};
this
.
openFile
=
function
(
isViewer
)
{
this
.
beforeOpen
();
window
[
"
CreateMainTextMeasurerWrapper
"
]();
deviceScale
=
window
.
native
[
"
GetDeviceScale
"
]();
...
...
@@ -4560,7 +4790,8 @@ function offline_get_selection(x, y, width, height, autocorrection) {
return
_s
.
getSelection
(
x
,
y
,
width
,
height
,
autocorrection
);
}
function
offline_get_charts_ranges
()
{
return
_api
.
wb
.
getWorksheet
().
__chartsRanges
();
return
{
'
ranges
'
:
_api
.
wb
.
getWorksheet
().
__chartsRanges
()};
}
function
offline_get_worksheet_bounds
()
{
return
_s
.
getMaxBounds
();
...
...
Excel/native/underscore-min.js
0 → 100644
View file @
9e070140
This diff is collapsed.
Click to expand it.
Excel/native/xregexp-all-min.js
0 → 100644
View file @
9e070140
This source diff could not be displayed because it is too large. You can
view the blob
instead.
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