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
c26e1c3d
Commit
c26e1c3d
authored
Dec 21, 2016
by
Alexander.Trofimov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
move getColorThemeByIndex to editorscommon
parent
c55304c4
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
50 additions
and
48 deletions
+50
-48
cell/api.js
cell/api.js
+1
-1
common/apiBase.js
common/apiBase.js
+0
-38
common/editorscommon.js
common/editorscommon.js
+47
-7
slide/api.js
slide/api.js
+1
-1
word/api.js
word/api.js
+1
-1
No files found.
cell/api.js
View file @
c26e1c3d
...
@@ -2888,7 +2888,7 @@ var editor;
...
@@ -2888,7 +2888,7 @@ var editor;
var
onChangeColorScheme
=
function
(
res
)
{
var
onChangeColorScheme
=
function
(
res
)
{
if
(
res
)
{
if
(
res
)
{
var
theme
=
t
.
wbModel
.
theme
;
var
theme
=
t
.
wbModel
.
theme
;
var
scheme
=
t
.
getColorThemeByIndex
(
index
);
var
scheme
=
AscCommon
.
getColorThemeByIndex
(
index
);
if
(
!
scheme
)
{
if
(
!
scheme
)
{
index
-=
AscCommon
.
g_oUserColorScheme
.
length
;
index
-=
AscCommon
.
g_oUserColorScheme
.
length
;
if
(
index
<
0
||
index
>=
theme
.
extraClrSchemeLst
.
length
)
{
if
(
index
<
0
||
index
>=
theme
.
extraClrSchemeLst
.
length
)
{
...
...
common/apiBase.js
View file @
c26e1c3d
...
@@ -1092,44 +1092,6 @@
...
@@ -1092,44 +1092,6 @@
this
.
sendEvent
(
"
asc_onSendThemeColorSchemes
"
,
result
);
this
.
sendEvent
(
"
asc_onSendThemeColorSchemes
"
,
result
);
return
result
;
return
result
;
};
};
baseEditorsApi
.
prototype
.
getColorThemeByIndex
=
function
(
index
)
{
var
_c
,
scheme
=
null
;
var
oColorScheme
=
AscCommon
.
g_oUserColorScheme
;
if
(
index
>=
oColorScheme
.
length
)
{
return
scheme
;
}
scheme
=
new
AscFormat
.
ClrScheme
();
var
tmp
=
oColorScheme
[
index
];
scheme
.
name
=
tmp
.
name
;
_c
=
tmp
.
get_dk1
();
scheme
.
colors
[
8
]
=
AscFormat
.
CreateUniColorRGB
(
_c
.
r
,
_c
.
g
,
_c
.
b
);
_c
=
tmp
.
get_lt1
();
scheme
.
colors
[
12
]
=
AscFormat
.
CreateUniColorRGB
(
_c
.
r
,
_c
.
g
,
_c
.
b
);
_c
=
tmp
.
get_dk2
();
scheme
.
colors
[
9
]
=
AscFormat
.
CreateUniColorRGB
(
_c
.
r
,
_c
.
g
,
_c
.
b
);
_c
=
tmp
.
get_lt2
();
scheme
.
colors
[
13
]
=
AscFormat
.
CreateUniColorRGB
(
_c
.
r
,
_c
.
g
,
_c
.
b
);
_c
=
tmp
.
get_accent1
();
scheme
.
colors
[
0
]
=
AscFormat
.
CreateUniColorRGB
(
_c
.
r
,
_c
.
g
,
_c
.
b
);
_c
=
tmp
.
get_accent2
();
scheme
.
colors
[
1
]
=
AscFormat
.
CreateUniColorRGB
(
_c
.
r
,
_c
.
g
,
_c
.
b
);
_c
=
tmp
.
get_accent3
();
scheme
.
colors
[
2
]
=
AscFormat
.
CreateUniColorRGB
(
_c
.
r
,
_c
.
g
,
_c
.
b
);
_c
=
tmp
.
get_accent4
();
scheme
.
colors
[
3
]
=
AscFormat
.
CreateUniColorRGB
(
_c
.
r
,
_c
.
g
,
_c
.
b
);
_c
=
tmp
.
get_accent5
();
scheme
.
colors
[
4
]
=
AscFormat
.
CreateUniColorRGB
(
_c
.
r
,
_c
.
g
,
_c
.
b
);
_c
=
tmp
.
get_accent6
();
scheme
.
colors
[
5
]
=
AscFormat
.
CreateUniColorRGB
(
_c
.
r
,
_c
.
g
,
_c
.
b
);
_c
=
tmp
.
get_hlink
();
scheme
.
colors
[
11
]
=
AscFormat
.
CreateUniColorRGB
(
_c
.
r
,
_c
.
g
,
_c
.
b
);
_c
=
tmp
.
get_folHlink
();
scheme
.
colors
[
10
]
=
AscFormat
.
CreateUniColorRGB
(
_c
.
r
,
_c
.
g
,
_c
.
b
);
return
scheme
;
};
// plugins
// plugins
baseEditorsApi
.
prototype
.
asc_pluginsRegister
=
function
(
basePath
,
plugins
)
baseEditorsApi
.
prototype
.
asc_pluginsRegister
=
function
(
basePath
,
plugins
)
...
...
common/editorscommon.js
View file @
c26e1c3d
...
@@ -2285,7 +2285,46 @@ CUserCacheColor.prototype.init = function(nColor) {
...
@@ -2285,7 +2285,46 @@ CUserCacheColor.prototype.init = function(nColor) {
}
}
}
}
var
g_oIdCounter
=
new
CIdCounter
();
function
getColorThemeByIndex
(
index
)
{
var
_c
,
scheme
=
null
;
var
oColorScheme
=
AscCommon
.
g_oUserColorScheme
;
if
(
index
>=
oColorScheme
.
length
)
{
return
scheme
;
}
scheme
=
new
AscFormat
.
ClrScheme
();
var
tmp
=
oColorScheme
[
index
];
scheme
.
name
=
tmp
.
name
;
_c
=
tmp
.
get_dk1
();
scheme
.
colors
[
8
]
=
AscFormat
.
CreateUniColorRGB
(
_c
.
r
,
_c
.
g
,
_c
.
b
);
_c
=
tmp
.
get_lt1
();
scheme
.
colors
[
12
]
=
AscFormat
.
CreateUniColorRGB
(
_c
.
r
,
_c
.
g
,
_c
.
b
);
_c
=
tmp
.
get_dk2
();
scheme
.
colors
[
9
]
=
AscFormat
.
CreateUniColorRGB
(
_c
.
r
,
_c
.
g
,
_c
.
b
);
_c
=
tmp
.
get_lt2
();
scheme
.
colors
[
13
]
=
AscFormat
.
CreateUniColorRGB
(
_c
.
r
,
_c
.
g
,
_c
.
b
);
_c
=
tmp
.
get_accent1
();
scheme
.
colors
[
0
]
=
AscFormat
.
CreateUniColorRGB
(
_c
.
r
,
_c
.
g
,
_c
.
b
);
_c
=
tmp
.
get_accent2
();
scheme
.
colors
[
1
]
=
AscFormat
.
CreateUniColorRGB
(
_c
.
r
,
_c
.
g
,
_c
.
b
);
_c
=
tmp
.
get_accent3
();
scheme
.
colors
[
2
]
=
AscFormat
.
CreateUniColorRGB
(
_c
.
r
,
_c
.
g
,
_c
.
b
);
_c
=
tmp
.
get_accent4
();
scheme
.
colors
[
3
]
=
AscFormat
.
CreateUniColorRGB
(
_c
.
r
,
_c
.
g
,
_c
.
b
);
_c
=
tmp
.
get_accent5
();
scheme
.
colors
[
4
]
=
AscFormat
.
CreateUniColorRGB
(
_c
.
r
,
_c
.
g
,
_c
.
b
);
_c
=
tmp
.
get_accent6
();
scheme
.
colors
[
5
]
=
AscFormat
.
CreateUniColorRGB
(
_c
.
r
,
_c
.
g
,
_c
.
b
);
_c
=
tmp
.
get_hlink
();
scheme
.
colors
[
11
]
=
AscFormat
.
CreateUniColorRGB
(
_c
.
r
,
_c
.
g
,
_c
.
b
);
_c
=
tmp
.
get_folHlink
();
scheme
.
colors
[
10
]
=
AscFormat
.
CreateUniColorRGB
(
_c
.
r
,
_c
.
g
,
_c
.
b
);
return
scheme
;
}
var
g_oIdCounter
=
new
CIdCounter
();
window
[
"
SetDoctRendererParams
"
]
=
function
(
_params
)
window
[
"
SetDoctRendererParams
"
]
=
function
(
_params
)
{
{
...
@@ -2332,6 +2371,7 @@ window["SetDoctRendererParams"] = function(_params)
...
@@ -2332,6 +2371,7 @@ window["SetDoctRendererParams"] = function(_params)
window
[
"
AscCommon
"
].
CContentChangesElement
=
CContentChangesElement
;
window
[
"
AscCommon
"
].
CContentChangesElement
=
CContentChangesElement
;
window
[
"
AscCommon
"
].
loadSdk
=
loadSdk
;
window
[
"
AscCommon
"
].
loadSdk
=
loadSdk
;
window
[
"
AscCommon
"
].
getColorThemeByIndex
=
getColorThemeByIndex
;
window
[
"
AscCommon
"
].
g_oDocumentUrls
=
g_oDocumentUrls
;
window
[
"
AscCommon
"
].
g_oDocumentUrls
=
g_oDocumentUrls
;
window
[
"
AscCommon
"
].
FormulaTablePartInfo
=
FormulaTablePartInfo
;
window
[
"
AscCommon
"
].
FormulaTablePartInfo
=
FormulaTablePartInfo
;
...
...
slide/api.js
View file @
c26e1c3d
...
@@ -4204,7 +4204,7 @@ background-repeat: no-repeat;\
...
@@ -4204,7 +4204,7 @@ background-repeat: no-repeat;\
asc_docs_api
.
prototype
.
ChangeColorScheme
=
function
(
index_scheme
)
asc_docs_api
.
prototype
.
ChangeColorScheme
=
function
(
index_scheme
)
{
{
var
scheme
=
this
.
getColorThemeByIndex
(
index_scheme
);
var
scheme
=
AscCommon
.
getColorThemeByIndex
(
index_scheme
);
if
(
!
scheme
)
if
(
!
scheme
)
{
{
index_scheme
-=
AscCommon
.
g_oUserColorScheme
.
length
;
index_scheme
-=
AscCommon
.
g_oUserColorScheme
.
length
;
...
...
word/api.js
View file @
c26e1c3d
...
@@ -6548,7 +6548,7 @@ background-repeat: no-repeat;\
...
@@ -6548,7 +6548,7 @@ background-repeat: no-repeat;\
if
(
this
.
WordControl
.
m_oLogicDocument
.
Document_Is_SelectionLocked
(
AscCommon
.
changestype_ColorScheme
)
===
false
)
if
(
this
.
WordControl
.
m_oLogicDocument
.
Document_Is_SelectionLocked
(
AscCommon
.
changestype_ColorScheme
)
===
false
)
{
{
var
scheme
=
this
.
getColorThemeByIndex
(
index_scheme
);
var
scheme
=
AscCommon
.
getColorThemeByIndex
(
index_scheme
);
if
(
!
scheme
)
if
(
!
scheme
)
{
{
index_scheme
-=
AscCommon
.
g_oUserColorScheme
.
length
;
index_scheme
-=
AscCommon
.
g_oUserColorScheme
.
length
;
...
...
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