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
Hide 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
...
@@ -153,7 +153,7 @@ DocumentUrls.prototype = {
...
@@ -153,7 +153,7 @@ DocumentUrls.prototype = {
this
.
urlsReverse
[
url
]
=
i
;
this
.
urlsReverse
[
url
]
=
i
;
this
.
imageCount
++
;
this
.
imageCount
++
;
}
}
if
(
window
[
"
IS_NATIVE_EDITOR
"
])
{
if
(
window
[
"
IS_NATIVE_EDITOR
"
])
{
window
[
"
native
"
][
"
setUrlsCount
"
](
this
.
imageCount
);
window
[
"
native
"
][
"
setUrlsCount
"
](
this
.
imageCount
);
}
}
...
@@ -299,7 +299,7 @@ function openFileCommand(binUrl, changesUrl, Signature, callback) {
...
@@ -299,7 +299,7 @@ function openFileCommand(binUrl, changesUrl, Signature, callback) {
}
}
});
});
}
}
if
(
null
!=
changesUrl
)
{
if
(
null
!=
changesUrl
)
{
getJSZipUtils
().
getBinaryContent
(
changesUrl
,
function
(
err
,
data
)
{
getJSZipUtils
().
getBinaryContent
(
changesUrl
,
function
(
err
,
data
)
{
bEndLoadChanges
=
true
;
bEndLoadChanges
=
true
;
...
@@ -695,7 +695,7 @@ function test_defName(){
...
@@ -695,7 +695,7 @@ function test_defName(){
thisRow
:
5
,
thisRow
:
5
,
columns
:
6
columns
:
6
};
};
var
cStrucTableLocalColumns
=
null
,
var
cStrucTableLocalColumns
=
null
,
cBoolLocal
=
{},
cBoolLocal
=
{},
cErrorOrigin
=
{
"
nil
"
:
"
#NULL!
"
,
"
div
"
:
"
#DIV
\
/0!
"
,
"
value
"
:
"
#VALUE!
"
,
"
ref
"
:
"
#REF!
"
,
"
name
"
:
"
#NAME?
"
,
"
num
"
:
"
#NUM!
"
,
"
na
"
:
"
#N
\
/A
"
,
"
getdata
"
:
"
#GETTING_DATA
"
,
"
uf
"
:
"
#UNSUPPORTED_FUNCTION!
"
},
cErrorOrigin
=
{
"
nil
"
:
"
#NULL!
"
,
"
div
"
:
"
#DIV
\
/0!
"
,
"
value
"
:
"
#VALUE!
"
,
"
ref
"
:
"
#REF!
"
,
"
name
"
:
"
#NAME?
"
,
"
num
"
:
"
#NUM!
"
,
"
na
"
:
"
#N
\
/A
"
,
"
getdata
"
:
"
#GETTING_DATA
"
,
"
uf
"
:
"
#UNSUPPORTED_FUNCTION!
"
},
...
@@ -2208,11 +2208,11 @@ function getUserColorById(userId, userName, isDark, isNumericValue)
...
@@ -2208,11 +2208,11 @@ function getUserColorById(userId, userName, isDark, isNumericValue)
var
oColor
=
true
===
isDark
?
res
.
Dark
:
res
.
Light
;
var
oColor
=
true
===
isDark
?
res
.
Dark
:
res
.
Light
;
return
true
===
isNumericValue
?
((
oColor
.
r
<<
16
)
&
0xFF0000
)
|
((
oColor
.
g
<<
8
)
&
0xFF00
)
|
(
oColor
.
b
&
0xFF
)
:
oColor
;
return
true
===
isNumericValue
?
((
oColor
.
r
<<
16
)
&
0xFF0000
)
|
((
oColor
.
g
<<
8
)
&
0xFF00
)
|
(
oColor
.
b
&
0xFF
)
:
oColor
;
}
}
function
isNullOrEmptyString
(
str
)
{
function
isNullOrEmptyString
(
str
)
{
return
(
str
==
undefined
)
||
(
str
==
null
)
||
(
str
==
""
);
return
(
str
==
undefined
)
||
(
str
==
null
)
||
(
str
==
""
);
}
}
function
CUserCacheColor
(
nColor
)
function
CUserCacheColor
(
nColor
)
{
{
this
.
Light
=
null
;
this
.
Light
=
null
;
...
@@ -2285,14 +2285,53 @@ CUserCacheColor.prototype.init = function(nColor) {
...
@@ -2285,14 +2285,53 @@ 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
)
{
{
if
(
_params
[
"
retina
"
]
===
true
)
if
(
_params
[
"
retina
"
]
===
true
)
AscBrowser
.
isRetina
=
true
;
AscBrowser
.
isRetina
=
true
;
};
};
//------------------------------------------------------------export---------------------------------------------------
//------------------------------------------------------------export---------------------------------------------------
window
[
'
AscCommon
'
]
=
window
[
'
AscCommon
'
]
||
{};
window
[
'
AscCommon
'
]
=
window
[
'
AscCommon
'
]
||
{};
window
[
"
AscCommon
"
].
getEncodingParams
=
getEncodingParams
;
window
[
"
AscCommon
"
].
getEncodingParams
=
getEncodingParams
;
...
@@ -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