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
c1a08a35
Commit
c1a08a35
authored
Apr 14, 2016
by
Alexander.Trofimov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change eof error
parent
7257509d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
98 additions
and
2 deletions
+98
-2
common/docscoapi.js
common/docscoapi.js
+1
-1
common/docscoapicommon.js
common/docscoapicommon.js
+97
-1
No files found.
common/docscoapi.js
View file @
c1a08a35
...
...
@@ -1114,7 +1114,7 @@
if
(
this
.
_isReSaveAfterAuth
)
{
var
callbackAskSaveChanges
=
function
(
e
)
{
if
(
false
==
e
[
"
saveLock
"
])
{
if
(
false
==
=
e
[
"
saveLock
"
])
{
t
.
_reSaveChanges
();
}
else
{
setTimeout
(
function
()
{
...
...
common/docscoapicommon.js
View file @
c1a08a35
...
...
@@ -22,4 +22,100 @@
* Pursuant to Section 7 3(e) we decline to grant you any rights under trademark law for use of our trademarks.
*
*/
"
use strict
"
;
/* docscoapicommon.js * * Author: Alexander.Trofimov * Date: 09.11.12 */
(
/** * @param {Window} window * @param {undefined} undefined */
function
(
window
,
undefined
)
{
/* * Import * ----------------------------------------------------------------------------- */
var
asc
=
window
[
"
Asc
"
]
?
window
[
"
Asc
"
]
:
(
window
[
"
Asc
"
]
=
{});
var
prot
;
/** * Класс user для совместного редактирования/просмотра документа * ----------------------------------------------------------------------------- * * @constructor * @memberOf Asc */
function
asc_CUser
(
val
)
{
this
.
id
=
null
;
// уникальный id - пользователя this.idOriginal = null; // уникальный id - пользователя this.userName = null; // имя пользователя this.state = undefined; // состояние (true - подключен, false - отключился) this.indexUser = -1; // Индекс пользователя (фактически равно числу заходов в документ на сервере) this.color = null; // цвет пользователя this.view = false; // просмотр(true), редактор(false) this._setUser(val); return this; } asc_CUser.prototype._setUser = function(val) { if (val) { this.id = val['id']; this.idOriginal = val['idOriginal']; this.userName = val['username']; this.indexUser = val['indexUser']; this.color = getUserColorById(this.idOriginal, this.userName, false, true); this.view = val['view']; } }; asc_CUser.prototype.asc_getId = function() { return this.id; }; asc_CUser.prototype.asc_getUserName = function() { return this.userName; }; asc_CUser.prototype.asc_getState = function() { return this.state; }; asc_CUser.prototype.asc_getColor = function() { return '#' + ('000000' + this.color.toString(16)).substr(-6); }; asc_CUser.prototype.asc_getView = function() { return this.view; }; asc_CUser.prototype.setId = function(val) { this.id = val; }; asc_CUser.prototype.setUserName = function(val) { this.userName = val; }; asc_CUser.prototype.setState = function(val) { this.state = val; }; /* * Export * ----------------------------------------------------------------------------- */ window["Asc"].asc_CUser = asc_CUser; prot = asc_CUser.prototype; prot["asc_getId"] = prot.asc_getId; prot["asc_getUserName"] = prot.asc_getUserName; prot["asc_getState"] = prot.asc_getState; prot["asc_getColor"] = prot.asc_getColor; prot["asc_getView"] = prot.asc_getView; })(window); var ConnectionState = { Reconnect: -1, // reconnect state None: 0, // not initialized WaitAuth: 1, // waiting session id Authorized: 2, // authorized ClosedCoAuth: 3, // closed coauthoring ClosedAll: 4, // closed all SaveChanges: 10 // save };
\ No newline at end of file
"
use strict
"
;
/* docscoapicommon.js
*
* Author: Alexander.Trofimov
* Date: 09.11.12
*/
(
/**
* @param {Window} window
* @param {undefined} undefined
*/
function
(
window
,
undefined
)
{
/*
* Import
* -----------------------------------------------------------------------------
*/
var
asc
=
window
[
"
Asc
"
]
?
window
[
"
Asc
"
]
:
(
window
[
"
Asc
"
]
=
{});
var
prot
;
/**
* Класс user для совместного редактирования/просмотра документа
* -----------------------------------------------------------------------------
*
* @constructor
* @memberOf Asc
*/
function
asc_CUser
(
val
)
{
this
.
id
=
null
;
// уникальный id - пользователя
this
.
idOriginal
=
null
;
// уникальный id - пользователя
this
.
userName
=
null
;
// имя пользователя
this
.
state
=
undefined
;
// состояние (true - подключен, false - отключился)
this
.
indexUser
=
-
1
;
// Индекс пользователя (фактически равно числу заходов в документ на сервере)
this
.
color
=
null
;
// цвет пользователя
this
.
view
=
false
;
// просмотр(true), редактор(false)
this
.
_setUser
(
val
);
return
this
;
}
asc_CUser
.
prototype
.
_setUser
=
function
(
val
)
{
if
(
val
)
{
this
.
id
=
val
[
'
id
'
];
this
.
idOriginal
=
val
[
'
idOriginal
'
];
this
.
userName
=
val
[
'
username
'
];
this
.
indexUser
=
val
[
'
indexUser
'
];
this
.
color
=
getUserColorById
(
this
.
idOriginal
,
this
.
userName
,
false
,
true
);
this
.
view
=
val
[
'
view
'
];
}
};
asc_CUser
.
prototype
.
asc_getId
=
function
()
{
return
this
.
id
;
};
asc_CUser
.
prototype
.
asc_getUserName
=
function
()
{
return
this
.
userName
;
};
asc_CUser
.
prototype
.
asc_getState
=
function
()
{
return
this
.
state
;
};
asc_CUser
.
prototype
.
asc_getColor
=
function
()
{
return
'
#
'
+
(
'
000000
'
+
this
.
color
.
toString
(
16
)).
substr
(
-
6
);
};
asc_CUser
.
prototype
.
asc_getView
=
function
()
{
return
this
.
view
;
};
asc_CUser
.
prototype
.
setId
=
function
(
val
)
{
this
.
id
=
val
;
};
asc_CUser
.
prototype
.
setUserName
=
function
(
val
)
{
this
.
userName
=
val
;
};
asc_CUser
.
prototype
.
setState
=
function
(
val
)
{
this
.
state
=
val
;
};
/*
* Export
* -----------------------------------------------------------------------------
*/
window
[
"
Asc
"
].
asc_CUser
=
asc_CUser
;
prot
=
asc_CUser
.
prototype
;
prot
[
"
asc_getId
"
]
=
prot
.
asc_getId
;
prot
[
"
asc_getUserName
"
]
=
prot
.
asc_getUserName
;
prot
[
"
asc_getState
"
]
=
prot
.
asc_getState
;
prot
[
"
asc_getColor
"
]
=
prot
.
asc_getColor
;
prot
[
"
asc_getView
"
]
=
prot
.
asc_getView
;
})(
window
);
var
ConnectionState
=
{
Reconnect
:
-
1
,
// reconnect state
None
:
0
,
// not initialized
WaitAuth
:
1
,
// waiting session id
Authorized
:
2
,
// authorized
ClosedCoAuth
:
3
,
// closed coauthoring
ClosedAll
:
4
,
// closed all
SaveChanges
:
10
// save
};
\ 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