Commit e10a15fe authored by Alexander.Trofimov's avatar Alexander.Trofimov Committed by Alexander.Trofimov

Добавил ошибку UserDrop (для потери прав у пользователя)

Delete CGlobalScriptLoader, g_script_loader, g_script_loader2, ScriptLoader, ScriptSpellCheckLoader

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@60160 954022d7-b5bf-4e40-9824-e11837661b57
parent 9089d553
......@@ -796,7 +796,7 @@
DocsCoApi.prototype._onDrop = function (data) {
this.disconnect();
this.onDisconnect(data ? data['description'] : '', true, false);
this.onDisconnect(data ? data['description'] : '', true, this.isCloseCoAuthoring);
};
DocsCoApi.prototype._onAuth = function (data) {
......@@ -937,11 +937,10 @@
var bIsDisconnectAtAll = t.attemptCount >= t.maxAttemptCount || t.isCloseCoAuthoring;
if (bIsDisconnectAtAll)
t._state = 3; // Closed state
if (t.onDisconnect) {
t.onDisconnect(evt.reason, bIsDisconnectAtAll, t.isCloseCoAuthoring);
}
if (t.isCloseCoAuthoring)
return;
if (t.onDisconnect)
t.onDisconnect(evt.reason, bIsDisconnectAtAll, t.isCloseCoAuthoring);
//Try reconect
if (t.attemptCount < t.maxAttemptCount) {
t._tryReconnect();
......
......@@ -1693,9 +1693,8 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
t.handlers.trigger("asc_onСoAuthoringDisconnect");
// И переходим в режим просмотра т.к. мы не можем сохранить таблицу
t.asc_setViewerMode(true);
if (!isCloseCoAuthoring) {
t.handlers.trigger("asc_onError", c_oAscError.ID.CoAuthoringDisconnect, c_oAscError.Level.NoCritical);
}
t.handlers.trigger("asc_onError", isCloseCoAuthoring ? c_oAscError.ID.UserDrop :
c_oAscError.ID.CoAuthoringDisconnect, c_oAscError.Level.NoCritical);
}
};
......
......@@ -31,9 +31,6 @@ var c_oAscError = {
UplImageUrl: -17,
CoAuthoringDisconnect: -18,
ConvertationPassword: -19,
MaxDataSeriesError: -80,
CannotFillRange: -81,
VKeyEncrypt: -20,
KeyExpire: -21,
......@@ -48,11 +45,16 @@ var c_oAscError = {
FrmlAnotherParsingError: -35,
FrmlWrongArgumentRange: -36,
FrmlOperandExpected: -37,
FrmlParenthesesCorrectCount: -38,
FrmlParenthesesCorrectCount: -38,
AutoFilterDataRangeError: -50,
AutoFilterChangeFormatTableError: -51,
AutoFilterChangeError: -52
AutoFilterChangeError: -52,
MaxDataSeriesError: -80,
CannotFillRange: -81,
UserDrop: -100
}
};
var c_oAscConfirm = {
......
......@@ -323,7 +323,7 @@
{
this.Api = _api;
this.embedded_cut_manager.Api = _api;
}
};
this.LoadEmbeddedFonts = function(url, _fonts)
{
......@@ -368,7 +368,7 @@
this.map_font_index[_fonts[i].name] = i + _count_infos_;
this.fontInfos[i + _count_infos_] = this.embeddedFontInfos[i];
}
}
};
this.SetStandartFonts = function()
{
......@@ -392,7 +392,7 @@
{
_infos[_map[standarts[i]]].Type = FONT_TYPE_STANDART;
}
}
};
this.CheckFontsPaste = function(_fonts)
{
......@@ -407,13 +407,13 @@
this.Api.asyncFontsDocumentStartLoaded();
this._LoadFonts();
}
};
this.AddLoadFonts = function(info, need_styles)
{
this.fonts_loading[this.fonts_loading.length] = info;
this.fonts_loading[this.fonts_loading.length - 1].NeedStyles = (need_styles == undefined) ? 0x0F : need_styles;
}
};
this.LoadDocumentFonts = function(_fonts, is_default)
{
......@@ -485,7 +485,7 @@
this.bIsLoadDocumentFirst = true;
this._LoadFonts();
}
};
this.LoadDocumentFonts2 = function(_fonts)
{
......@@ -502,7 +502,7 @@
this.ThemeLoader.asyncFontsStartLoaded();
this._LoadFonts();
}
};
var oThis = this;
this._LoadFonts = function()
......@@ -550,7 +550,7 @@
this.fonts_loading.shift();
this._LoadFonts();
}
}
};
this._check_loaded = function()
{
......@@ -581,7 +581,7 @@
oThis.fonts_loading.shift();
oThis._LoadFonts();
}
}
};
this.LoadFont = function(fontinfo)
{
......@@ -603,7 +603,7 @@
this.currentInfoLoaded = null;
return false;
}
}
};
this.check_loaded = function()
{
var current = oThis.currentInfoLoaded;
......@@ -621,7 +621,7 @@
oThis.Api.asyncFontEndLoaded(oThis.currentInfoLoaded);
oThis.currentInfoLoaded = null;
}
}
};
this.LoadFontsFromServer = function(_fonts)
{
......@@ -639,66 +639,11 @@
}
CGlobalFontLoader.prototype.SetStreamIndexEmb = function(font_index, stream_index) {
this.embeddedFontFiles[font_index].SetStreamIndex(stream_index);
}
function CGlobalScriptLoader() {
this.Status = -1; // -1 - notloaded, 0 - loaded, 1 - error, 2 - loading, 3 - imageloading
this.callback = null;
this.oCallBackThis = null;
var oThis = this;
this.CheckLoaded = function()
{
return (0 == oThis.Status || 1 == oThis.Status);
}
this.LoadScriptAsync = function(url, _callback, _callback_this)
{
this.callback = _callback;
this.oCallBackThis = _callback_this;
if (-1 != this.Status)
return true;
this.Status = 2;
var scriptElem = document.createElement('script');
if (scriptElem.readyState && false)
{
scriptElem.onreadystatechange = function () {
if (this.readyState == 'complete' || this.readyState == 'loaded')
{
scriptElem.onreadystatechange = null;
setTimeout(oThis._callback_script_load, 0);
}
}
}
scriptElem.onload = scriptElem.onerror = oThis._callback_script_load;
scriptElem.setAttribute('src', url);
scriptElem.setAttribute('type','text/javascript');
document.getElementsByTagName('head')[0].appendChild(scriptElem);
return false;
}
this._callback_script_load = function()
{
if (oThis.Status != 3)
oThis.Status = 1;
if (null != oThis.callback)
{
oThis.callback(oThis.oCallBackThis);
oThis.callback = null;
}
}
}
};
// exports
window.g_font_loader = new CGlobalFontLoader();
window.g_image_loader = new CGlobalImageLoader();
window.g_script_loader = new CGlobalScriptLoader();
window.g_script_loader2 = new CGlobalScriptLoader();
window.g_flow_anchor = new Image();
window.g_flow_anchor.asc_complete = false;
......
......@@ -46,7 +46,6 @@ function asc_docs_api(name)
this.FontLoader = window.g_font_loader;
this.ImageLoader = window.g_image_loader;
this.ScriptLoader = window.g_script_loader;
this.FontLoader.put_Api(this);
this.ImageLoader.put_Api(this);
......@@ -510,9 +509,8 @@ asc_docs_api.prototype._coAuthoringInit = function () {
// Посылаем наверх эвент об отключении от сервера
t.asc_fireCallback("asc_onСoAuthoringDisconnect");
t.SetViewMode(true, true);
if (!isCloseCoAuthoring){
t.sync_ErrorCallback(c_oAscError.ID.CoAuthoringDisconnect, c_oAscError.Level.NoCritical);
}
t.sync_ErrorCallback(isCloseCoAuthoring ? c_oAscError.ID.UserDrop : c_oAscError.ID.CoAuthoringDisconnect,
c_oAscError.Level.NoCritical);
}
};
......
......@@ -121,7 +121,9 @@ var c_oAscError = {
UserCountExceed: -22,
SplitCellMaxRows: -23,
SplitCellMaxCols: -24,
SplitCellRowsDivider: -25
SplitCellRowsDivider: -25,
UserDrop: -100
}
};
......
......@@ -147,7 +147,7 @@
{
this.Api = _api;
this.embedded_cut_manager.Api = _api;
}
};
this.LoadEmbeddedFonts = function(url, _fonts)
{
......@@ -192,7 +192,7 @@
this.map_font_index[_fonts[i].name] = i + _count_infos_;
this.fontInfos[i + _count_infos_] = this.embeddedFontInfos[i];
}
}
};
this.SetStandartFonts = function()
{
......@@ -216,13 +216,13 @@
{
_infos[_map[standarts[i]]].Type = FONT_TYPE_STANDART;
}
}
};
this.AddLoadFonts = function(info, need_styles)
{
this.fonts_loading[this.fonts_loading.length] = info;
this.fonts_loading[this.fonts_loading.length - 1].NeedStyles = (need_styles == undefined) ? 0x0F : need_styles;
}
};
this.LoadDocumentFonts = function(_fonts, is_default)
{
......@@ -296,7 +296,7 @@
this.CheckFontsNeedLoadingLoad();
this._LoadFonts();
}
};
this.CheckFontsNeedLoadingLoad = function()
{
......@@ -310,7 +310,7 @@
_need = true;
}
return _need;
}
};
this.CheckFontsNeedLoading = function(_fonts)
{
......@@ -322,7 +322,7 @@
return true;
}
return false;
}
};
this.LoadDocumentFonts2 = function(_fonts)
{
......@@ -340,7 +340,7 @@
this.CheckFontsNeedLoadingLoad();
this._LoadFonts();
}
};
var oThis = this;
this._LoadFonts = function()
......@@ -388,7 +388,7 @@
this.fonts_loading.shift();
this._LoadFonts();
}
}
};
this._check_loaded = function()
{
......@@ -419,7 +419,7 @@
oThis.fonts_loading.shift();
oThis._LoadFonts();
}
}
};
this.LoadFont = function(fontinfo, loadFontCallBack, loadFontCallBackArgs)
{
......@@ -452,7 +452,7 @@
this.currentInfoLoaded = null;
return false;
}
}
};
this.check_loaded = function()
{
var current = oThis.currentInfoLoaded;
......@@ -470,7 +470,7 @@
oThis.loadFontCallBack.call( oThis.Api, oThis.loadFontCallBackArgs );
oThis.currentInfoLoaded = null;
}
}
};
this.LoadFontsFromServer = function(_fonts)
{
......@@ -489,7 +489,7 @@
CGlobalFontLoader.prototype.SetStreamIndexEmb = function(font_index, stream_index)
{
this.embeddedFontFiles[font_index].SetStreamIndex(stream_index);
}
};
function CGlobalImageLoader()
{
......@@ -518,7 +518,7 @@
this.bIsAsyncLoadDocumentImages = false;
}
}
}
};
this.LoadDocumentImages = function(_images, isUrl)
{
......@@ -560,7 +560,7 @@
else
this.ThemeLoader.asyncImagesEndLoaded();
}
}
};
var oThis = this;
this._LoadImages = function()
......@@ -591,7 +591,7 @@
oThis.images_loading.shift();
oThis._LoadImages();
}
};
oImage.Image.onerror = function(){
oImage.Status = ImageLoadStatus.Complete;
oImage.Image = null;
......@@ -604,10 +604,10 @@
oThis.images_loading.shift();
oThis._LoadImages();
}
};
//oImage.Image.crossOrigin = 'anonymous';
oImage.Image.src = oImage.src;
}
};
this.LoadImage = function(src, Type)
{
......@@ -626,16 +626,16 @@
oImage.Image.onload = function(){
oImage.Status = ImageLoadStatus.Complete;
oThis.Api.asyncImageEndLoaded(oImage);
}
};
oImage.Image.onerror = function(){
oImage.Image = null;
oImage.Status = ImageLoadStatus.Complete;
oThis.Api.asyncImageEndLoaded(oImage);
}
};
//oImage.Image.crossOrigin = 'anonymous';
oImage.Image.src = oImage.src;
return null;
}
};
this.LoadImageAsync = function(i)
{
......@@ -647,76 +647,20 @@
oImage.Image.onload = function(){
oImage.Status = ImageLoadStatus.Complete;
oThis.Api.asyncImageEndLoadedBackground(oImage);
}
};
oImage.Image.onerror = function(){
oImage.Status = ImageLoadStatus.Complete;
oImage.Image = null;
oThis.Api.asyncImageEndLoadedBackground(oImage);
}
};
//oImage.Image.crossOrigin = 'anonymous';
oImage.Image.src = oImage.src;
}
}
function CGlobalScriptLoader()
{
this.Status = -1; // -1 - notloaded, 0 - loaded, 1 - error, 2 - loading, 3 - imageloading
this.callback = null;
this.oCallBackThis = null;
var oThis = this;
this.CheckLoaded = function()
{
return (0 == oThis.Status || 1 == oThis.Status);
}
this.LoadScriptAsync = function(url, _callback, _callback_this)
{
this.callback = _callback;
this.oCallBackThis = _callback_this;
if (-1 != this.Status)
return true;
this.Status = 2;
var scriptElem = document.createElement('script');
if (scriptElem.readyState && false)
{
scriptElem.onreadystatechange = function () {
if (this.readyState == 'complete' || this.readyState == 'loaded')
{
scriptElem.onreadystatechange = null;
setTimeout(oThis._callback_script_load, 0);
}
}
}
scriptElem.onload = scriptElem.onerror = oThis._callback_script_load;
scriptElem.setAttribute('src', url);
scriptElem.setAttribute('type','text/javascript');
document.getElementsByTagName('head')[0].appendChild(scriptElem);
return false;
}
this._callback_script_load = function()
{
if (oThis.Status != 3)
oThis.Status = 1;
if (null != oThis.callback)
{
oThis.callback(oThis.oCallBackThis);
oThis.callback = null;
}
}
}
// exports
window.g_font_loader = new CGlobalFontLoader();
window.g_image_loader = new CGlobalImageLoader();
window.g_script_loader = new CGlobalScriptLoader();
window.g_script_loader2 = new CGlobalScriptLoader();
window.g_flow_anchor = new Image();
window.g_flow_anchor.asc_complete = false;
......
......@@ -529,8 +529,6 @@ function asc_docs_api(name)
this.FontLoader = window.g_font_loader;
this.ImageLoader = window.g_image_loader;
this.ScriptLoader = window.g_script_loader;
this.ScriptSpellCheckLoader = window.g_script_loader2;
this.FontLoader.put_Api(this);
this.ImageLoader.put_Api(this);
......@@ -1646,9 +1644,8 @@ asc_docs_api.prototype._coAuthoringInit = function()
// Посылаем наверх эвент об отключении от сервера
t.asc_fireCallback("asc_onСoAuthoringDisconnect");
t.SetViewMode(true);
if (!isCloseCoAuthoring){
t.sync_ErrorCallback(c_oAscError.ID.CoAuthoringDisconnect, c_oAscError.Level.NoCritical);
}
t.sync_ErrorCallback(isCloseCoAuthoring ? c_oAscError.ID.UserDrop : c_oAscError.ID.CoAuthoringDisconnect,
c_oAscError.Level.NoCritical);
}
};
......
......@@ -95,7 +95,9 @@ var c_oAscError = {
VKeyEncrypt: -20,
KeyExpire: -21,
UserCountExceed: -22,
MobileUnexpectedCharCount: -23
MobileUnexpectedCharCount: -23,
UserDrop: -100
}
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment