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
fa5a3462
Commit
fa5a3462
authored
Aug 29, 2016
by
Sergey Luzyanin
Committed by
GitHub
Aug 29, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #49 from ONLYOFFICE/release/v4.1.0
Release/v4.1.0
parents
326d50b3
9b563181
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
3315 additions
and
3046 deletions
+3315
-3046
cell/view/WorkbookView.js
cell/view/WorkbookView.js
+1
-0
common/Drawings/Format/Shape.js
common/Drawings/Format/Shape.js
+2
-2
common/Local/license.js
common/Local/license.js
+2
-2
common/Private/license.js
common/Private/license.js
+4
-85
common/apiCommon.js
common/apiCommon.js
+3304
-2955
word/Editor/GraphicObjects/Format/ShapePrototype.js
word/Editor/GraphicObjects/Format/ShapePrototype.js
+2
-2
No files found.
cell/view/WorkbookView.js
View file @
fa5a3462
...
...
@@ -882,6 +882,7 @@
}
}
this
.
handlers
.
trigger
(
"
asc_onSelectionChanged
"
,
info
);
this
.
handlers
.
trigger
(
"
asc_onSelectionEnd
"
);
};
...
...
common/Drawings/Format/Shape.js
View file @
fa5a3462
...
...
@@ -3689,7 +3689,7 @@ CShape.prototype.hitInTextRectWord = function(x, y)
{
var
content
=
this
.
getDocContent
&&
this
.
getDocContent
();
if
(
content
)
if
(
content
&&
this
.
invertTransform
)
{
var
t_x
,
t_y
;
t_x
=
this
.
invertTransform
.
TransformPointX
(
x
,
y
);
...
...
@@ -4806,7 +4806,7 @@ CShape.prototype.hitToAdjustment = function (x, y) {
return
ret
;
}
}
if
(
this
.
recalcInfo
.
warpGeometry
)
if
(
this
.
recalcInfo
.
warpGeometry
&&
this
.
invertTransformTextWordArt
)
{
invert_transform
=
this
.
invertTransformTextWordArt
;
t_x
=
invert_transform
.
TransformPointX
(
x
,
y
);
...
...
common/Local/license.js
View file @
fa5a3462
...
...
@@ -37,8 +37,8 @@ AscCommon.baseEditorsApi.prototype._onEndPermissions = function()
if
(
this
.
isOnFirstConnectEnd
&&
this
.
isOnLoadLicense
)
{
var
oResult
=
new
AscCommon
.
asc_CAscEditorPermissions
();
oResult
.
asc_
setCanLicense
(
true
);
oResult
.
asc_
setCanBranding
(
true
);
oResult
.
setCanLicense
(
true
);
oResult
.
setCanBranding
(
true
);
this
.
sendEvent
(
'
asc_onGetEditorPermissions
'
,
oResult
);
}
};
\ No newline at end of file
common/Private/license.js
View file @
fa5a3462
...
...
@@ -32,96 +32,15 @@
"
use strict
"
;
var
g_oLicenseResult
=
{
Error
:
1
,
Expired
:
2
,
Success
:
3
,
UnknownUser
:
4
,
Connections
:
5
};
var
g_sLicenseDefaultUrl
=
"
/license
"
;
var
g_sPublicRSAKey
=
'
-----BEGIN CERTIFICATE-----MIIBvTCCASYCCQD55fNzc0WF7TANBgkqhkiG9w0BAQUFADAjMQswCQYDVQQGEwJKUDEUMBIGA1UEChMLMDAtVEVTVC1SU0EwHhcNMTAwNTI4MDIwODUxWhcNMjAwNTI1MDIwODUxWjAjMQswCQYDVQQGEwJKUDEUMBIGA1UEChMLMDAtVEVTVC1SU0EwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBANGEYXtfgDRlWUSDn3haY4NVVQiKI9CzThoua9+DxJuiseyzmBBe7Roh1RPqdvmtOHmEPbJ+kXZYhbozzPRbFGHCJyBfCLzQfVos9/qUQ88u83b0SFA2MGmQWQAlRtLy66EkR4rDRwTj2DzR4EEXgEKpIvo8VBs/3+sHLF3ESgAhAgMBAAEwDQYJKoZIhvcNAQEFBQADgYEAEZ6mXFFq3AzfaqWHmCy1ARjlauYAa8ZmUFnLm0emg9dkVBJ63aEqARhtok6bDQDzSJxiLpCEF6G4b/Nv/M/MLyhP+OoOTmETMegAVQMq71choVJyOFE5BtQa6M/lCHEOya5QUfoRF2HF9EjRF44K3OK+u3ivTSj3zwjtpudY5Xo=-----END CERTIFICATE-----
'
;
function
CheckLicense
(
licenseUrl
,
customerId
,
userId
,
userFirstName
,
userLastName
,
callback
)
{
callback
(
true
,
g_oLicenseResult
.
Success
);
return
;
licenseUrl
=
licenseUrl
?
licenseUrl
:
g_sLicenseDefaultUrl
;
g_fGetJSZipUtils
().
getBinaryContent
(
licenseUrl
,
function
(
err
,
data
)
{
if
(
err
)
{
callback
(
true
,
g_oLicenseResult
.
Error
);
return
;
}
try
{
var
tmpSize
;
var
maxSize
=
0x4000
;
var
sTextData
=
''
;
for
(
var
i
=
0
;
i
<
data
.
byteLength
;
i
+=
maxSize
)
{
tmpSize
=
data
.
byteLength
-
i
;
sTextData
+=
String
.
fromCharCode
.
apply
(
null
,
new
Uint8Array
(
data
,
i
,
(
tmpSize
<
maxSize
)
?
tmpSize
:
maxSize
));
}
var
oLicense
=
JSON
.
parse
(
sTextData
);
var
hSig
=
oLicense
[
'
signature
'
];
delete
oLicense
[
'
signature
'
];
var
x509
=
new
X509
();
x509
.
readCertPEM
(
g_sPublicRSAKey
);
var
isValid
=
x509
.
subjectPublicKeyRSA
.
verifyString
(
JSON
.
stringify
(
oLicense
),
hSig
);
callback
(
false
,
isValid
?
CheckUserInLicense
(
customerId
,
userId
,
userFirstName
,
userLastName
,
oLicense
)
:
g_oLicenseResult
.
Error
);
}
catch
(
e
)
{
callback
(
true
,
g_oLicenseResult
.
Error
);
}
});
}
/**
*
* @param customerId
* @param userId
* @param userFirstName
* @param userLastName
* @param oLicense
* @returns {boolean}
*/
function
CheckUserInLicense
(
customerId
,
userId
,
userFirstName
,
userLastName
,
oLicense
)
{
var
res
=
g_oLicenseResult
.
Error
;
var
superuser
=
'
onlyoffice
'
;
try
{
if
(
oLicense
[
'
users
'
])
{
var
userName
=
(
null
==
userFirstName
?
''
:
userFirstName
)
+
(
null
==
userLastName
?
''
:
userLastName
);
var
sUserHash
=
CryptoJS
.
SHA256
(
userId
+
userName
).
toString
(
CryptoJS
.
enc
.
Hex
).
toLowerCase
();
var
checkUserHash
=
false
;
if
(
customerId
===
oLicense
[
'
customer_id
'
]
||
oLicense
[
'
customer_id
'
]
===
(
sUserHash
=
superuser
))
{
// users для новой версии - массив
checkUserHash
=
(
-
1
!==
oLicense
[
'
users
'
].
indexOf
(
sUserHash
));
res
=
g_oLicenseResult
.
UnknownUser
;
}
if
(
checkUserHash
)
{
var
endDate
=
new
Date
(
oLicense
[
'
end_date
'
]);
res
=
(
endDate
>=
new
Date
())
?
g_oLicenseResult
.
Success
:
g_oLicenseResult
.
Expired
;
}
}
}
catch
(
e
)
{
res
=
g_oLicenseResult
.
Error
;
}
return
res
;
}
AscCommon
.
baseEditorsApi
.
prototype
.
_onCheckLicenseEnd
=
function
(
err
,
res
)
{
this
.
licenseResult
=
{
err
:
err
,
res
:
res
};
this
.
_onEndPermissions
();
};
AscCommon
.
baseEditorsApi
.
prototype
.
_onEndPermissions
=
function
()
{
if
(
this
.
isOnFirstConnectEnd
&&
this
.
isOnLoadLicense
)
{
var
oResult
=
new
AscCommon
.
asc_CAscEditorPermissions
();
if
(
null
!==
this
.
licenseResult
)
{
var
type
=
this
.
licenseResult
[
'
type
'
];
oResult
.
asc_setCanLicense
(
g_oLicenseResult
.
Success
===
type
);
oResult
.
asc_setCanBranding
(
g_oLicenseResult
.
Error
!==
type
);
// Для тех, у кого есть лицензия, branding доступен
oResult
.
asc_setCanBranding
(
g
_oLicenseResult
.
Error
!==
type
);
// Для тех, у кого есть лицензия, branding доступен
oResult
.
asc_
setIsLight
(
this
.
licenseResult
[
'
light
'
]);
oResult
.
setLicenseType
(
type
);
oResult
.
setCanLicense
(
Asc
.
c_oLicenseResult
.
Success
===
type
);
oResult
.
setCanBranding
(
Asc
.
c
_oLicenseResult
.
Error
!==
type
);
// Для тех, у кого есть лицензия, branding доступен
oResult
.
setIsLight
(
this
.
licenseResult
[
'
light
'
]);
}
this
.
sendEvent
(
'
asc_onGetEditorPermissions
'
,
oResult
);
}
...
...
common/apiCommon.js
View file @
fa5a3462
This diff is collapsed.
Click to expand it.
word/Editor/GraphicObjects/Format/ShapePrototype.js
View file @
fa5a3462
...
...
@@ -854,7 +854,7 @@ CShape.prototype.checkPosTransformText = function()
};
CShape
.
prototype
.
getNearestPos
=
function
(
x
,
y
,
pageIndex
)
{
if
(
isRealObject
(
this
.
textBoxContent
))
if
(
isRealObject
(
this
.
textBoxContent
)
&&
this
.
invertTransformText
)
{
var
t_x
=
this
.
invertTransformText
.
TransformPointX
(
x
,
y
);
var
t_y
=
this
.
invertTransformText
.
TransformPointY
(
x
,
y
);
...
...
@@ -883,7 +883,7 @@ CShape.prototype.cursorGetPos = function()
CShape
.
prototype
.
cursorMoveAt
=
function
(
X
,
Y
,
AddToSelect
)
{
var
content
=
this
.
getDocContent
();
if
(
isRealObject
(
content
))
if
(
isRealObject
(
content
)
&&
this
.
invertTransformText
)
{
var
t_x
=
this
.
invertTransformText
.
TransformPointX
(
X
,
Y
);
var
t_y
=
this
.
invertTransformText
.
TransformPointY
(
X
,
Y
);
...
...
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