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
baafd59e
Commit
baafd59e
authored
Nov 18, 2016
by
Alexander.Trofimov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save/load changes for sparklines
parent
558d476d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
176 additions
and
39 deletions
+176
-39
cell/model/History.js
cell/model/History.js
+17
-17
cell/model/WorkbookElems.js
cell/model/WorkbookElems.js
+159
-22
No files found.
cell/model/History.js
View file @
baafd59e
...
...
@@ -144,23 +144,23 @@ function (window, undefined) {
window
[
'
AscCH
'
].
historyitem_AutoFilter_ChangeTableName
=
14
;
window
[
'
AscCH
'
].
historyitem_AutoFilter_ClearFilterColumn
=
15
;
window
[
'
AscCH
'
].
historyitem_Sparkline_
LineWeight
=
1
;
window
[
'
AscCH
'
].
historyitem_Sparkline_
Type
=
2
;
window
[
'
AscCH
'
].
historyitem_Sparkline_D
ateAxi
s
=
3
;
window
[
'
AscCH
'
].
historyitem_Sparkline_
DisplayEmptyCellsA
s
=
4
;
window
[
'
AscCH
'
].
historyitem_Sparkline_
Markers
=
5
;
window
[
'
AscCH
'
].
historyitem_Sparkline_
High
=
6
;
window
[
'
AscCH
'
].
historyitem_Sparkline_
Low
=
7
;
window
[
'
AscCH
'
].
historyitem_Sparkline_
Fir
st
=
8
;
window
[
'
AscCH
'
].
historyitem_Sparkline_
Last
=
9
;
window
[
'
AscCH
'
].
historyitem_Sparkline_
Negative
=
10
;
window
[
'
AscCH
'
].
historyitem_Sparkline_Display
XAxis
=
11
;
window
[
'
AscCH
'
].
historyitem_Sparkline_
DisplayHidden
=
12
;
window
[
'
AscCH
'
].
historyitem_Sparkline_M
in
AxisType
=
13
;
window
[
'
AscCH
'
].
historyitem_Sparkline_
MaxAxisType
=
14
;
window
[
'
AscCH
'
].
historyitem_Sparkline_
RightToLeft
=
15
;
window
[
'
AscCH
'
].
historyitem_Sparkline_ManualM
ax
=
16
;
window
[
'
AscCH
'
].
historyitem_Sparkline_
ManualMin
=
17
;
window
[
'
AscCH
'
].
historyitem_Sparkline_
Type
=
1
;
window
[
'
AscCH
'
].
historyitem_Sparkline_
LineWeight
=
2
;
window
[
'
AscCH
'
].
historyitem_Sparkline_D
isplayEmptyCellsA
s
=
3
;
window
[
'
AscCH
'
].
historyitem_Sparkline_
Marker
s
=
4
;
window
[
'
AscCH
'
].
historyitem_Sparkline_
High
=
5
;
window
[
'
AscCH
'
].
historyitem_Sparkline_
Low
=
6
;
window
[
'
AscCH
'
].
historyitem_Sparkline_
First
=
7
;
window
[
'
AscCH
'
].
historyitem_Sparkline_
La
st
=
8
;
window
[
'
AscCH
'
].
historyitem_Sparkline_
Negative
=
9
;
window
[
'
AscCH
'
].
historyitem_Sparkline_
DisplayXAxis
=
10
;
window
[
'
AscCH
'
].
historyitem_Sparkline_Display
Hidden
=
11
;
window
[
'
AscCH
'
].
historyitem_Sparkline_
MinAxisType
=
12
;
window
[
'
AscCH
'
].
historyitem_Sparkline_M
ax
AxisType
=
13
;
window
[
'
AscCH
'
].
historyitem_Sparkline_
RightToLeft
=
14
;
window
[
'
AscCH
'
].
historyitem_Sparkline_
ManualMax
=
15
;
window
[
'
AscCH
'
].
historyitem_Sparkline_ManualM
in
=
16
;
window
[
'
AscCH
'
].
historyitem_Sparkline_
DateAxis
=
17
;
window
[
'
AscCH
'
].
historyitem_Sparkline_ColorSeries
=
18
;
window
[
'
AscCH
'
].
historyitem_Sparkline_ColorNegative
=
19
;
window
[
'
AscCH
'
].
historyitem_Sparkline_ColorAxis
=
20
;
...
...
cell/model/WorkbookElems.js
View file @
baafd59e
...
...
@@ -4731,21 +4731,155 @@ CellArea.prototype = {
return
this
.
Id
;
};
sparklineGroup
.
prototype
.
Save_Changes
=
function
(
data
,
w
)
{
w
.
WriteLong
(
data
.
Type
);
switch
(
data
.
Type
)
{
case
AscCH
.
historyitem_Sparkline_Type
:
case
AscCH
.
historyitem_Sparkline_LineWeight
:
case
AscCH
.
historyitem_Sparkline_DisplayEmptyCellsAs
:
case
AscCH
.
historyitem_Sparkline_MinAxisType
:
case
AscCH
.
historyitem_Sparkline_MaxAxisType
:
w
.
WriteLong
(
data
.
newPr
);
break
;
case
AscCH
.
historyitem_Sparkline_Markers
:
case
AscCH
.
historyitem_Sparkline_High
:
case
AscCH
.
historyitem_Sparkline_Low
:
case
AscCH
.
historyitem_Sparkline_First
:
case
AscCH
.
historyitem_Sparkline_Last
:
case
AscCH
.
historyitem_Sparkline_Negative
:
case
AscCH
.
historyitem_Sparkline_DisplayXAxis
:
case
AscCH
.
historyitem_Sparkline_DisplayHidden
:
case
AscCH
.
historyitem_Sparkline_RightToLeft
:
case
AscCH
.
historyitem_Sparkline_DateAxis
:
w
.
WriteBool
(
data
.
newPr
);
break
;
case
AscCH
.
historyitem_Sparkline_ManualMax
:
case
AscCH
.
historyitem_Sparkline_ManualMin
:
w
.
WriteBool
(
null
!==
data
.
newPr
);
if
(
null
!==
data
.
newPr
)
{
w
.
WriteLong
(
data
.
newPr
);
}
break
;
case
AscCH
.
historyitem_Sparkline_ColorSeries
:
case
AscCH
.
historyitem_Sparkline_ColorNegative
:
case
AscCH
.
historyitem_Sparkline_ColorAxis
:
case
AscCH
.
historyitem_Sparkline_ColorMarkers
:
case
AscCH
.
historyitem_Sparkline_ColorFirst
:
case
AscCH
.
historyitem_Sparkline_colorLast
:
case
AscCH
.
historyitem_Sparkline_ColorHigh
:
case
AscCH
.
historyitem_Sparkline_ColorLow
:
w
.
WriteBool
(
null
!==
data
.
newPr
);
if
(
null
!==
data
.
newPr
)
{
w
.
WriteLong
(
data
.
newPr
.
getType
());
data
.
newPr
.
Write_ToBinary2
(
w
);
}
break
;
}
};
sparklineGroup
.
prototype
.
Load_Changes
=
function
(
r
)
{
var
readColor
=
function
(
r
)
{
var
color
=
null
;
if
(
r
.
GetBool
())
{
switch
(
r
.
GetLong
())
{
case
UndoRedoDataTypes
.
RgbColor
:
color
=
new
RgbColor
();
color
.
Read_FromBinary2
(
r
);
break
;
case
UndoRedoDataTypes
.
ThemeColor
:
color
=
new
ThemeColor
();
color
=
color
.
Read_FromBinary2AndReplace
(
r
);
break
;
}
}
return
color
;
};
};
sparklineGroup
.
prototype
.
Undo
=
function
(
type
,
data
)
{
var
type
=
r
.
GetLong
();
switch
(
type
)
{
case
AscCH
.
historyitem_Sparkline_Type
:
this
.
type
=
r
.
GetLong
();
break
;
case
AscCH
.
historyitem_Sparkline_LineWeight
:
this
.
lineWeight
=
data
.
oldPr
;
this
.
lineWeight
=
r
.
GetLong
();
break
;
case
AscCH
.
historyitem_Sparkline_DisplayEmptyCellsAs
:
this
.
displayEmptyCellsAs
=
r
.
GetLong
();
break
;
case
AscCH
.
historyitem_Sparkline_MinAxisType
:
this
.
minAxisType
=
r
.
GetLong
();
break
;
case
AscCH
.
historyitem_Sparkline_MaxAxisType
:
this
.
lineWeight
=
r
.
GetLong
();
break
;
case
AscCH
.
historyitem_Sparkline_Markers
:
this
.
markers
=
r
.
GetBool
();
break
;
case
AscCH
.
historyitem_Sparkline_High
:
this
.
high
=
r
.
GetBool
();
break
;
case
AscCH
.
historyitem_Sparkline_Low
:
this
.
low
=
r
.
GetBool
();
break
;
case
AscCH
.
historyitem_Sparkline_First
:
this
.
first
=
r
.
GetBool
();
break
;
case
AscCH
.
historyitem_Sparkline_Last
:
this
.
last
=
r
.
GetBool
();
break
;
case
AscCH
.
historyitem_Sparkline_Negative
:
this
.
negative
=
r
.
GetBool
();
break
;
case
AscCH
.
historyitem_Sparkline_DisplayXAxis
:
this
.
displayXAxis
=
r
.
GetBool
();
break
;
case
AscCH
.
historyitem_Sparkline_DisplayHidden
:
this
.
displayHidden
=
r
.
GetBool
();
break
;
case
AscCH
.
historyitem_Sparkline_RightToLeft
:
this
.
rightToLeft
=
r
.
GetBool
();
break
;
case
AscCH
.
historyitem_Sparkline_DateAxis
:
this
.
dateAxis
=
r
.
GetBool
();
break
;
case
AscCH
.
historyitem_Sparkline_ManualMax
:
this
.
manualMax
=
r
.
GetBool
()
?
r
.
GetLong
()
:
null
;
break
;
case
AscCH
.
historyitem_Sparkline_ManualMin
:
this
.
manualMin
=
r
.
GetBool
()
?
r
.
GetLong
()
:
null
;
break
;
case
AscCH
.
historyitem_Sparkline_ColorSeries
:
this
.
colorSeries
=
readColor
(
r
);
break
;
case
AscCH
.
historyitem_Sparkline_ColorNegative
:
this
.
colorNegative
=
readColor
(
r
);
break
;
case
AscCH
.
historyitem_Sparkline_ColorAxis
:
this
.
colorAxis
=
readColor
(
r
);
break
;
case
AscCH
.
historyitem_Sparkline_ColorMarkers
:
this
.
colorMarkers
=
readColor
(
r
);
break
;
case
AscCH
.
historyitem_Sparkline_ColorFirst
:
this
.
colorFirst
=
readColor
(
r
);
break
;
case
AscCH
.
historyitem_Sparkline_colorLast
:
this
.
colorLast
=
readColor
(
r
);
break
;
case
AscCH
.
historyitem_Sparkline_ColorHigh
:
this
.
colorHigh
=
readColor
(
r
);
break
;
case
AscCH
.
historyitem_Sparkline_ColorLow
:
this
.
colorLow
=
readColor
(
r
);
break
;
}
this
.
cleanCache
();
};
sparklineGroup
.
prototype
.
Undo
=
function
(
type
,
data
)
{
switch
(
type
)
{
case
AscCH
.
historyitem_Sparkline_Type
:
this
.
type
=
data
.
oldPr
;
break
;
case
AscCH
.
historyitem_Sparkline_
DateAxis
:
this
.
dateAxis
=
data
.
oldPr
;
case
AscCH
.
historyitem_Sparkline_
LineWeight
:
this
.
lineWeight
=
data
.
oldPr
;
break
;
case
AscCH
.
historyitem_Sparkline_DisplayEmptyCellsAs
:
this
.
displayEmptyCellsAs
=
data
.
oldPr
;
...
...
@@ -4789,6 +4923,9 @@ CellArea.prototype = {
case
AscCH
.
historyitem_Sparkline_ManualMin
:
this
.
manualMin
=
data
.
oldPr
;
break
;
case
AscCH
.
historyitem_Sparkline_DateAxis
:
this
.
dateAxis
=
data
.
oldPr
;
break
;
case
AscCH
.
historyitem_Sparkline_ColorSeries
:
this
.
colorSeries
=
data
.
oldPr
;
break
;
...
...
@@ -4819,14 +4956,11 @@ CellArea.prototype = {
};
sparklineGroup
.
prototype
.
Redo
=
function
(
data
)
{
switch
(
data
.
Type
)
{
case
AscCH
.
historyitem_Sparkline_LineWeight
:
this
.
lineWeight
=
data
.
newPr
;
break
;
case
AscCH
.
historyitem_Sparkline_Type
:
this
.
type
=
data
.
newPr
;
break
;
case
AscCH
.
historyitem_Sparkline_
DateAxis
:
this
.
dateAxis
=
data
.
newPr
;
case
AscCH
.
historyitem_Sparkline_
LineWeight
:
this
.
lineWeight
=
data
.
newPr
;
break
;
case
AscCH
.
historyitem_Sparkline_DisplayEmptyCellsAs
:
this
.
displayEmptyCellsAs
=
data
.
newPr
;
...
...
@@ -4870,6 +5004,9 @@ CellArea.prototype = {
case
AscCH
.
historyitem_Sparkline_ManualMin
:
this
.
manualMin
=
data
.
newPr
;
break
;
case
AscCH
.
historyitem_Sparkline_DateAxis
:
this
.
dateAxis
=
data
.
newPr
;
break
;
case
AscCH
.
historyitem_Sparkline_ColorSeries
:
this
.
colorSeries
=
data
.
newPr
;
break
;
...
...
@@ -4919,14 +5056,14 @@ CellArea.prototype = {
var
defaultSeriesColor
=
3629202
;
var
defaultOtherColor
=
13631488
;
this
.
colorSeries
=
new
AscCommonExcel
.
RgbColor
(
defaultSeriesColor
);
this
.
colorNegative
=
new
AscCommonExcel
.
RgbColor
(
defaultOtherColor
);
this
.
colorAxis
=
new
AscCommonExcel
.
RgbColor
(
defaultOtherColor
);
this
.
colorMarkers
=
new
AscCommonExcel
.
RgbColor
(
defaultOtherColor
);
this
.
colorFirst
=
new
AscCommonExcel
.
RgbColor
(
defaultOtherColor
);
this
.
colorLast
=
new
AscCommonExcel
.
RgbColor
(
defaultOtherColor
);
this
.
colorHigh
=
new
AscCommonExcel
.
RgbColor
(
defaultOtherColor
);
this
.
colorLow
=
new
AscCommonExcel
.
RgbColor
(
defaultOtherColor
);
this
.
colorSeries
=
new
RgbColor
(
defaultSeriesColor
);
this
.
colorNegative
=
new
RgbColor
(
defaultOtherColor
);
this
.
colorAxis
=
new
RgbColor
(
defaultOtherColor
);
this
.
colorMarkers
=
new
RgbColor
(
defaultOtherColor
);
this
.
colorFirst
=
new
RgbColor
(
defaultOtherColor
);
this
.
colorLast
=
new
RgbColor
(
defaultOtherColor
);
this
.
colorHigh
=
new
RgbColor
(
defaultOtherColor
);
this
.
colorLow
=
new
RgbColor
(
defaultOtherColor
);
};
sparklineGroup
.
prototype
.
set
=
function
(
val
)
{
var
t
=
this
;
...
...
@@ -4938,15 +5075,14 @@ CellArea.prototype = {
return
propOld
;
};
var
getColor
=
function
(
color
)
{
return
color
instanceof
Asc
.
asc_CColor
?
AscCommonExcel
.
CorrectAscColor
(
color
)
:
color
;
return
color
instanceof
Asc
.
asc_CColor
?
CorrectAscColor
(
color
)
:
color
;
};
History
.
Create_NewPoint
();
History
.
StartTransaction
();
this
.
lineWeight
=
checkProperty
(
this
.
lineWeight
,
val
.
lineWeight
,
AscCH
.
historyitem_Sparkline_LineWeight
);
this
.
type
=
checkProperty
(
this
.
type
,
val
.
type
,
AscCH
.
historyitem_Sparkline_Type
);
this
.
dateAxis
=
checkProperty
(
this
.
dateAxis
,
val
.
dateAxis
,
AscCH
.
historyitem_Sparkline_DateAxis
);
this
.
lineWeight
=
checkProperty
(
this
.
lineWeight
,
val
.
lineWeight
,
AscCH
.
historyitem_Sparkline_LineWeight
);
this
.
displayEmptyCellsAs
=
checkProperty
(
this
.
displayEmptyCellsAs
,
val
.
displayEmptyCellsAs
,
AscCH
.
historyitem_Sparkline_DisplayEmptyCellsAs
);
this
.
markers
=
checkProperty
(
this
.
markers
,
val
.
markers
,
AscCH
.
historyitem_Sparkline_Markers
);
this
.
high
=
checkProperty
(
this
.
high
,
val
.
high
,
AscCH
.
historyitem_Sparkline_High
);
...
...
@@ -4961,6 +5097,7 @@ CellArea.prototype = {
this
.
rightToLeft
=
checkProperty
(
this
.
rightToLeft
,
val
.
rightToLeft
,
AscCH
.
historyitem_Sparkline_RightToLeft
);
this
.
manualMax
=
checkProperty
(
this
.
manualMax
,
val
.
manualMax
,
AscCH
.
historyitem_Sparkline_ManualMax
);
this
.
manualMin
=
checkProperty
(
this
.
manualMin
,
val
.
manualMin
,
AscCH
.
historyitem_Sparkline_ManualMin
);
this
.
dateAxis
=
checkProperty
(
this
.
dateAxis
,
val
.
dateAxis
,
AscCH
.
historyitem_Sparkline_DateAxis
);
this
.
colorSeries
=
checkProperty
(
this
.
colorSeries
,
getColor
(
val
.
colorSeries
),
AscCH
.
historyitem_Sparkline_ColorSeries
);
this
.
colorNegative
=
checkProperty
(
this
.
colorNegative
,
getColor
(
val
.
colorNegative
),
AscCH
.
historyitem_Sparkline_ColorNegative
);
...
...
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