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
7ea49c85
Commit
7ea49c85
authored
Jul 13, 2016
by
alexey.musinov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
color schemas event to global
parent
f32cc085
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
163 additions
and
2 deletions
+163
-2
common/Native/Wrappers/Overlay.js
common/Native/Wrappers/Overlay.js
+0
-0
common/Native/Wrappers/api.js
common/Native/Wrappers/api.js
+150
-1
common/Native/native.js
common/Native/native.js
+13
-1
No files found.
common/Native/Wrappers/Overlay.js
100644 → 100755
View file @
7ea49c85
File mode changed from 100644 to 100755
common/Native/Wrappers/api.js
View file @
7ea49c85
...
...
@@ -2300,6 +2300,15 @@ Asc['asc_docs_api'].prototype["Call_Menu_Event"] = function(type, _params)
break
;
}
case
2415
:
// ASC_MENU_EVENT_TYPE_CHANGE_COLOR_SCHEME
{
if
(
undefined
!==
_params
)
{
var
indexScheme
=
parseInt
(
_params
);
this
.
ChangeColorScheme
(
indexScheme
);
}
break
;
}
default
:
break
;
}
...
...
@@ -4322,6 +4331,22 @@ function asc_menu_WriteHyperPr(_hyperPr, _stream)
_stream
[
"
WriteByte
"
](
255
);
};
function
asc_WriteColorSchemes
(
schemas
,
s
)
{
s
[
"
WriteLong
"
](
schemas
.
length
);
for
(
var
i
=
0
;
i
<
schemas
.
length
;
++
i
)
{
s
[
"
WriteString2
"
](
schemas
[
i
].
get_name
());
var
colors
=
schemas
[
i
].
get_colors
();
s
[
"
WriteLong
"
](
colors
.
length
);
for
(
var
j
=
0
;
j
<
colors
.
length
;
++
j
)
{
asc_menu_WriteColor
(
0
,
colors
[
j
],
s
);
}
}
}
///////////////////////////////////////////////////////////////////////
...
...
@@ -5692,4 +5717,128 @@ AscCommon.ChartPreviewManager.prototype.getChartPreviews = function(chartType)
_api
.
WordControl
.
m_oDrawingDocument
.
Native
[
"
DD_EndNativeDraw
"
](
_stream
);
}
}
};
\ No newline at end of file
};
// additional
Asc
[
'
asc_docs_api
'
].
prototype
.
__SendThemeColorScheme
=
function
()
{
var
infos
=
[];
var
_index
=
0
;
var
_c
=
null
;
// user scheme
var
oColorScheme
=
AscCommon
.
g_oUserColorScheme
;
var
_count_defaults
=
oColorScheme
.
length
;
for
(
var
i
=
0
;
i
<
_count_defaults
;
++
i
)
{
var
_obj
=
oColorScheme
[
i
];
infos
[
_index
]
=
new
AscCommon
.
CAscColorScheme
();
infos
[
_index
].
Name
=
_obj
.
name
;
_c
=
_obj
.
dk1
;
infos
[
_index
].
Colors
[
0
]
=
new
CColor
(
_c
.
R
,
_c
.
G
,
_c
.
B
);
_c
=
_obj
.
lt1
;
infos
[
_index
].
Colors
[
1
]
=
new
CColor
(
_c
.
R
,
_c
.
G
,
_c
.
B
);
_c
=
_obj
.
dk2
;
infos
[
_index
].
Colors
[
2
]
=
new
CColor
(
_c
.
R
,
_c
.
G
,
_c
.
B
);
_c
=
_obj
.
lt2
;
infos
[
_index
].
Colors
[
3
]
=
new
CColor
(
_c
.
R
,
_c
.
G
,
_c
.
B
);
_c
=
_obj
.
accent1
;
infos
[
_index
].
Colors
[
4
]
=
new
CColor
(
_c
.
R
,
_c
.
G
,
_c
.
B
);
_c
=
_obj
.
accent2
;
infos
[
_index
].
Colors
[
5
]
=
new
CColor
(
_c
.
R
,
_c
.
G
,
_c
.
B
);
_c
=
_obj
.
accent3
;
infos
[
_index
].
Colors
[
6
]
=
new
CColor
(
_c
.
R
,
_c
.
G
,
_c
.
B
);
_c
=
_obj
.
accent4
;
infos
[
_index
].
Colors
[
7
]
=
new
CColor
(
_c
.
R
,
_c
.
G
,
_c
.
B
);
_c
=
_obj
.
accent5
;
infos
[
_index
].
Colors
[
8
]
=
new
CColor
(
_c
.
R
,
_c
.
G
,
_c
.
B
);
_c
=
_obj
.
accent6
;
infos
[
_index
].
Colors
[
9
]
=
new
CColor
(
_c
.
R
,
_c
.
G
,
_c
.
B
);
_c
=
_obj
.
hlink
;
infos
[
_index
].
Colors
[
10
]
=
new
CColor
(
_c
.
R
,
_c
.
G
,
_c
.
B
);
_c
=
_obj
.
folHlink
;
infos
[
_index
].
Colors
[
11
]
=
new
CColor
(
_c
.
R
,
_c
.
G
,
_c
.
B
);
++
_index
;
}
// theme colors
var
_theme
=
this
.
WordControl
.
m_oLogicDocument
.
theme
;
var
_extra
=
_theme
.
extraClrSchemeLst
;
var
_count
=
_extra
.
length
;
var
_rgba
=
{
R
:
0
,
G
:
0
,
B
:
0
,
A
:
255
};
for
(
var
i
=
0
;
i
<
_count
;
++
i
)
{
var
_scheme
=
_extra
[
i
].
clrScheme
;
infos
[
_index
]
=
new
AscCommon
.
CAscColorScheme
();
infos
[
_index
].
Name
=
_scheme
.
name
;
_scheme
.
colors
[
8
].
Calculate
(
_theme
,
null
,
null
,
null
,
_rgba
);
_c
=
_scheme
.
colors
[
8
].
RGBA
;
infos
[
_index
].
Colors
[
0
]
=
new
CColor
(
_c
.
R
,
_c
.
G
,
_c
.
B
);
_scheme
.
colors
[
12
].
Calculate
(
_theme
,
null
,
null
,
null
,
_rgba
);
_c
=
_scheme
.
colors
[
12
].
RGBA
;
infos
[
_index
].
Colors
[
1
]
=
new
CColor
(
_c
.
R
,
_c
.
G
,
_c
.
B
);
_scheme
.
colors
[
9
].
Calculate
(
_theme
,
null
,
null
,
null
,
_rgba
);
_c
=
_scheme
.
colors
[
9
].
RGBA
;
infos
[
_index
].
Colors
[
2
]
=
new
CColor
(
_c
.
R
,
_c
.
G
,
_c
.
B
);
_scheme
.
colors
[
13
].
Calculate
(
_theme
,
null
,
null
,
null
,
_rgba
);
_c
=
_scheme
.
colors
[
13
].
RGBA
;
infos
[
_index
].
Colors
[
3
]
=
new
CColor
(
_c
.
R
,
_c
.
G
,
_c
.
B
);
_scheme
.
colors
[
0
].
Calculate
(
_theme
,
null
,
null
,
null
,
_rgba
);
_c
=
_scheme
.
colors
[
0
].
RGBA
;
infos
[
_index
].
Colors
[
4
]
=
new
CColor
(
_c
.
R
,
_c
.
G
,
_c
.
B
);
_scheme
.
colors
[
1
].
Calculate
(
_theme
,
null
,
null
,
null
,
_rgba
);
_c
=
_scheme
.
colors
[
1
].
RGBA
;
infos
[
_index
].
Colors
[
5
]
=
new
CColor
(
_c
.
R
,
_c
.
G
,
_c
.
B
);
_scheme
.
colors
[
2
].
Calculate
(
_theme
,
null
,
null
,
null
,
_rgba
);
_c
=
_scheme
.
colors
[
2
].
RGBA
;
infos
[
_index
].
Colors
[
6
]
=
new
CColor
(
_c
.
R
,
_c
.
G
,
_c
.
B
);
_scheme
.
colors
[
3
].
Calculate
(
_theme
,
null
,
null
,
null
,
_rgba
);
_c
=
_scheme
.
colors
[
3
].
RGBA
;
infos
[
_index
].
Colors
[
7
]
=
new
CColor
(
_c
.
R
,
_c
.
G
,
_c
.
B
);
_scheme
.
colors
[
4
].
Calculate
(
_theme
,
null
,
null
,
null
,
_rgba
);
_c
=
_scheme
.
colors
[
4
].
RGBA
;
infos
[
_index
].
Colors
[
8
]
=
new
CColor
(
_c
.
R
,
_c
.
G
,
_c
.
B
);
_scheme
.
colors
[
5
].
Calculate
(
_theme
,
null
,
null
,
null
,
_rgba
);
_c
=
_scheme
.
colors
[
5
].
RGBA
;
infos
[
_index
].
Colors
[
9
]
=
new
CColor
(
_c
.
R
,
_c
.
G
,
_c
.
B
);
_scheme
.
colors
[
11
].
Calculate
(
_theme
,
null
,
null
,
null
,
_rgba
);
_c
=
_scheme
.
colors
[
11
].
RGBA
;
infos
[
_index
].
Colors
[
10
]
=
new
CColor
(
_c
.
R
,
_c
.
G
,
_c
.
B
);
_scheme
.
colors
[
10
].
Calculate
(
_theme
,
null
,
null
,
null
,
_rgba
);
_c
=
_scheme
.
colors
[
10
].
RGBA
;
infos
[
_index
].
Colors
[
11
]
=
new
CColor
(
_c
.
R
,
_c
.
G
,
_c
.
B
);
_index
++
;
}
this
.
WordControl
.
m_oApi
.
sync_SendThemeColorSchemes
(
infos
);
};
common/Native/native.js
View file @
7ea49c85
...
...
@@ -339,6 +339,7 @@ function NativeOpenFile()
if
(
window
.
NATIVE_DOCUMENT_TYPE
==
"
presentation
"
||
window
.
NATIVE_DOCUMENT_TYPE
==
"
document
"
)
{
_api
=
new
window
[
"
Asc
"
][
"
asc_docs_api
"
](
""
);
_api
.
asc_nativeOpenFile
(
doc_bin
);
}
else
...
...
@@ -369,6 +370,16 @@ function NativeOpenFile2(_params)
if
(
_api
.
NativeAfterLoad
)
_api
.
NativeAfterLoad
();
_api
.
__SendThemeColorScheme
();
var
schemes
=
_api
.
get_PropertyThemeColorSchemes
();
if
(
schemes
)
{
var
st
=
global_memory_stream_menu
;
st
[
"
ClearNoAttack
"
]();
asc_WriteColorSchemes
(
schemes
,
st
);
window
[
"
native
"
][
"
OnCallMenuEvent
"
](
2404
,
st
);
// ASC_MENU_EVENT_TYPE_COLOR_SCHEMES
}
}
else
{
...
...
@@ -806,4 +817,5 @@ window.native.Call_VR_Table = function(_params, _cols, _margins, _rows)
window
.
native
.
Call_Menu_Event
=
function
(
type
,
_params
)
{
return
_api
.
Call_Menu_Event
(
type
,
_params
);
};
\ No newline at end of file
};
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