Commit c33dc207 authored by Sergey.Konovalov's avatar Sergey.Konovalov Committed by Alexander.Trofimov

Ускорение открытия, для нового документа не отправляем запрос на конвертацию,...

Ускорение открытия, для нового документа не отправляем запрос на конвертацию, а открываем бинарник из скриптов.

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@50862 954022d7-b5bf-4e40-9824-e11837661b57
parent 44cc431b
...@@ -133,6 +133,7 @@ ...@@ -133,6 +133,7 @@
"../Word/api-all.js", "../Word/api-all.js",
"../Word/merge/api_merge.js", "../Word/merge/api_merge.js",
"../Word/Build/Log/apiExport.js", "../Word/Build/Log/apiExport.js",
"../Word/document/empty.js",
"../Excel/graphics/DrawingContextWord.js" "../Excel/graphics/DrawingContextWord.js"
], ],
"dst": "../Word/sdk-all.js", "dst": "../Word/sdk-all.js",
......
...@@ -428,6 +428,7 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS"; ...@@ -428,6 +428,7 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
this.documentOrigin = this.DocInfo["Origin"]; this.documentOrigin = this.DocInfo["Origin"];
this.chartEditor = this.DocInfo["ChartEditor"]; this.chartEditor = this.DocInfo["ChartEditor"];
this.documentOpenOptions = this.DocInfo["Options"]; this.documentOpenOptions = this.DocInfo["Options"];
this.documentIsNew = this.DocInfo["IsNew"];
var nIndex = -1; var nIndex = -1;
if(this.documentTitle) if(this.documentTitle)
...@@ -471,16 +472,22 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS"; ...@@ -471,16 +472,22 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
var emptyWorkbook = getEmptyWorkbook() + ""; var emptyWorkbook = getEmptyWorkbook() + "";
if ( emptyWorkbook.length && (c_oSerFormat.Signature === emptyWorkbook.substring(0, c_oSerFormat.Signature.length)) ) { if ( emptyWorkbook.length && (c_oSerFormat.Signature === emptyWorkbook.substring(0, c_oSerFormat.Signature.length)) ) {
this.isChartEditor = true; this.isChartEditor = true;
var wb = new Workbook("", this.handlers, this); var wb = this.asc_OpenDocument("", emptyWorkbook);
wb.initGlobalObjects();
this.wbModel = wb;
var oBinaryFileReader = new BinaryFileReader("");
oBinaryFileReader.Read(emptyWorkbook, wb);
this._startOpenDocument({returnCode: 0, val:wb}); this._startOpenDocument({returnCode: 0, val:wb});
} }
}, },
asc_OpenDocument: function(url, data)
{
var wb = new Workbook(url, this.handlers, this);
wb.initGlobalObjects();
this.wbModel = wb;
var oBinaryFileReader = new BinaryFileReader(url);
oBinaryFileReader.Read(data, wb);
return wb;
},
asc_getEditorPermissions : function(){ asc_getEditorPermissions : function(){
if (this.DocInfo && if (this.DocInfo &&
this.DocInfo["Id"] && this.DocInfo["Id"] &&
...@@ -760,11 +767,7 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS"; ...@@ -760,11 +767,7 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
url = sJsonUrl; url = sJsonUrl;
if( c_oSerFormat.Signature === result.substring(0, c_oSerFormat.Signature.length)) if( c_oSerFormat.Signature === result.substring(0, c_oSerFormat.Signature.length))
{ {
var wb = new Workbook(url, oThis.handlers, oThis); var wb = oThis.asc_OpenDocument(url, result);
wb.initGlobalObjects();
oThis.wbModel = wb;
var oBinaryFileReader = new BinaryFileReader(url);
oBinaryFileReader.Read(result, wb);
if (callback) if (callback)
callback({returnCode: 0, val:wb}); callback({returnCode: 0, val:wb});
} }
...@@ -904,20 +907,27 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS"; ...@@ -904,20 +907,27 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
if( c_oSerFormat.Signature === sData.substring(0, c_oSerFormat.Signature.length)) if( c_oSerFormat.Signature === sData.substring(0, c_oSerFormat.Signature.length))
{ {
var sUrlPath = "offlinedocs/test-workbook9/"; var sUrlPath = "offlinedocs/test-workbook9/";
var wb = new Workbook(sUrlPath, this.handlers, this); var wb = this.asc_OpenDocument(sUrlPath, sData);
wb.initGlobalObjects();
this.wbModel = wb;
var oBinaryFileReader = new BinaryFileReader(sUrlPath);
oBinaryFileReader.Read(sData, wb);
fCallback({returnCode: 0, val:wb}); fCallback({returnCode: 0, val:wb});
} }
} }
else { else {
if(this.documentIsNew)
{
var sEmptyWorkbook = getEmptyWorkbook();
var v = {"id":this.documentId, "format": this.documentFormat, "vkey": this.documentVKey, "editorid": c_oEditorId.Speadsheet, "c":"create", "url": this.documentUrl, "title": this.documentTitle, "embeddedfonts": this.isUseEmbeddedCutFonts, "data": sEmptyWorkbook};
this._asc_sendCommand (fCallback, JSON.stringify(v));
var wb = this.asc_OpenDocument(g_sResourceServiceLocalUrl + this.documentId + "/", sEmptyWorkbook);
fCallback({returnCode: 0, val:wb});
}
else
{
// Меняем тип состояния (на открытие) // Меняем тип состояния (на открытие)
this.advancedOptionsAction = c_oAscAdvancedOptionsAction.Open; this.advancedOptionsAction = c_oAscAdvancedOptionsAction.Open;
var v = {"id":this.documentId, "format": this.documentFormat, "vkey": this.documentVKey, "editorid": c_oEditorId.Speadsheet, "c":"open", "url": this.documentUrl, "title": this.documentTitle, "embeddedfonts": this.isUseEmbeddedCutFonts}; var v = {"id":this.documentId, "format": this.documentFormat, "vkey": this.documentVKey, "editorid": c_oEditorId.Speadsheet, "c":"open", "url": this.documentUrl, "title": this.documentTitle, "embeddedfonts": this.isUseEmbeddedCutFonts};
this._asc_sendCommand (fCallback, JSON.stringify(v)); this._asc_sendCommand (fCallback, JSON.stringify(v));
} }
}
}, },
_asc_save: function () { _asc_save: function () {
...@@ -3047,12 +3057,7 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS"; ...@@ -3047,12 +3057,7 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
if (!window['scriptBridge']['loadDocumentFromString']) { if (!window['scriptBridge']['loadDocumentFromString']) {
window['scriptBridge']['loadDocumentFromString'] = function(workbook) { window['scriptBridge']['loadDocumentFromString'] = function(workbook) {
var wb = new Workbook("", t.handlers, t); var wb = t.asc_OpenDocument("", workbook);
wb.initGlobalObjects();
t.wbModel = wb;
var oBinaryFileReader = new BinaryFileReader("");
oBinaryFileReader.Read(workbook, wb);
t._startOpenDocument({returnCode: 0, val:wb}); t._startOpenDocument({returnCode: 0, val:wb});
} }
} }
...@@ -3069,13 +3074,7 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS"; ...@@ -3069,13 +3074,7 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
if (!data || c_oSerFormat.Signature !== data.substring(0, c_oSerFormat.Signature.length)) { if (!data || c_oSerFormat.Signature !== data.substring(0, c_oSerFormat.Signature.length)) {
workbook = "XLSY;v1;1001;BAKAAgAAAwwDAAAEHwMAAADgAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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AAAAAOgAAAAEYAAAAAAYMAAAAUwBoAGUAZQB0ADEAAQQBAAAABAQAAABBADEACwoAAAABBQAAAAAAAC5ACQAAAAAAOgAAAAEYAAAAAAYMAAAAUwBoAGUAZQB0ADIAAQQCAAAABAQAAABBADEACwoAAAABBQAAAAAAAC5ACQAAAAAAOgAAAAEYAAAAAAYMAAAAUwBoAGUAZQB0ADMAAQQDAAAABAQAAABBADEACwoAAAABBQAAAAAAAC5ACQAAAAAFAAAAAAAAAAA=";
} }
var wb = t.asc_OpenDocument("", workbook);
var wb = new Workbook("", t.handlers, t);
wb.initGlobalObjects();
t.wbModel = wb;
var oBinaryFileReader = new BinaryFileReader("");
oBinaryFileReader.Read(workbook, wb);
t._startOpenDocument({returnCode: 0, val:wb}); t._startOpenDocument({returnCode: 0, val:wb});
} }
......
...@@ -37,6 +37,9 @@ function CDocInfo (obj){ ...@@ -37,6 +37,9 @@ function CDocInfo (obj){
} }
if (typeof obj.UserName != 'undefined'){ if (typeof obj.UserName != 'undefined'){
this.UserName = obj.UserName; this.UserName = obj.UserName;
}
if (typeof obj.IsNew != 'undefined'){
this.IsNew = obj.IsNew;
} }
if (obj.OfflineApp === true) if (obj.OfflineApp === true)
this.OfflineApp = true; this.OfflineApp = true;
...@@ -49,6 +52,7 @@ function CDocInfo (obj){ ...@@ -49,6 +52,7 @@ function CDocInfo (obj){
this.VKey = null; this.VKey = null;
this.UserId = null; this.UserId = null;
this.UserName = null; this.UserName = null;
this.IsNew = null;
} }
} }
CDocInfo.prototype.get_Id = function(){return this.Id} CDocInfo.prototype.get_Id = function(){return this.Id}
...@@ -67,6 +71,8 @@ CDocInfo.prototype.get_UserId = function(){return this.UserId;} ...@@ -67,6 +71,8 @@ CDocInfo.prototype.get_UserId = function(){return this.UserId;}
CDocInfo.prototype.put_UserId = function(v){this.UserId = v;} CDocInfo.prototype.put_UserId = function(v){this.UserId = v;}
CDocInfo.prototype.get_UserName = function(){return this.UserName;} CDocInfo.prototype.get_UserName = function(){return this.UserName;}
CDocInfo.prototype.put_UserName = function(v){this.UserName = v;} CDocInfo.prototype.put_UserName = function(v){this.UserName = v;}
CDocInfo.prototype.get_IsNew = function(){return this.IsNew;}
CDocInfo.prototype.put_IsNew = function(v){this.IsNew = v;}
// --------------------------------------------------------------- // ---------------------------------------------------------------
function CAscColorScheme() function CAscColorScheme()
......
...@@ -122,6 +122,7 @@ ...@@ -122,6 +122,7 @@
<script type="text/javascript" src="apiDefines.js"></script> <script type="text/javascript" src="apiDefines.js"></script>
<script type="text/javascript" src="apiCommon.js"></script> <script type="text/javascript" src="apiCommon.js"></script>
<script type="text/javascript" src="api.js"></script> <script type="text/javascript" src="api.js"></script>
<script type="text/javascript" src="document/empty.js"></script>
<script type="text/javascript" src="merge/api_merge.js"></script> <script type="text/javascript" src="merge/api_merge.js"></script>
<script type="text/javascript" src="../Common/scroll.js"></script> <script type="text/javascript" src="../Common/scroll.js"></script>
......
...@@ -158,6 +158,7 @@ ...@@ -158,6 +158,7 @@
<script type="text/javascript" src="apiDefines.js"></script> <script type="text/javascript" src="apiDefines.js"></script>
<script type="text/javascript" src="apiCommon.js"></script> <script type="text/javascript" src="apiCommon.js"></script>
<script type="text/javascript" src="api.js"></script> <script type="text/javascript" src="api.js"></script>
<script type="text/javascript" src="document/empty.js"></script>
<script type="text/javascript" src="../Common/scroll.js"></script> <script type="text/javascript" src="../Common/scroll.js"></script>
<script type="text/javascript" src="Editor/CollaborativeEditing.js"></script> <script type="text/javascript" src="Editor/CollaborativeEditing.js"></script>
......
...@@ -51,6 +51,9 @@ function CDocInfo (obj){ ...@@ -51,6 +51,9 @@ function CDocInfo (obj){
if (typeof obj.UserName != 'undefined'){ if (typeof obj.UserName != 'undefined'){
this.UserName = obj.UserName; this.UserName = obj.UserName;
} }
if (typeof obj.IsNew != 'undefined'){
this.IsNew = obj.IsNew;
}
if (obj.OfflineApp === true) if (obj.OfflineApp === true)
this.OfflineApp = true; this.OfflineApp = true;
} }
...@@ -62,6 +65,7 @@ function CDocInfo (obj){ ...@@ -62,6 +65,7 @@ function CDocInfo (obj){
this.VKey = null; this.VKey = null;
this.UserId = null; this.UserId = null;
this.UserName = null; this.UserName = null;
this.IsNew = null;
} }
} }
CDocInfo.prototype.get_Id = function(){return this.Id} CDocInfo.prototype.get_Id = function(){return this.Id}
...@@ -80,6 +84,8 @@ CDocInfo.prototype.get_UserId = function(){return this.UserId;} ...@@ -80,6 +84,8 @@ CDocInfo.prototype.get_UserId = function(){return this.UserId;}
CDocInfo.prototype.put_UserId = function(v){this.UserId = v;} CDocInfo.prototype.put_UserId = function(v){this.UserId = v;}
CDocInfo.prototype.get_UserName = function(){return this.UserName;} CDocInfo.prototype.get_UserName = function(){return this.UserName;}
CDocInfo.prototype.put_UserName = function(v){this.UserName = v;} CDocInfo.prototype.put_UserName = function(v){this.UserName = v;}
CDocInfo.prototype.get_IsNew = function(){return this.IsNew;}
CDocInfo.prototype.put_IsNew = function(v){this.IsNew = v;}
function CListType(obj) function CListType(obj)
{ {
...@@ -910,10 +916,18 @@ asc_docs_api.prototype.LoadDocument = function(c_DocInfo) ...@@ -910,10 +916,18 @@ asc_docs_api.prototype.LoadDocument = function(c_DocInfo)
} }
if(documentId){ if(documentId){
if(this.DocInfo.get_IsNew())
{
var rData = {"id":documentId, "format": documentFormat, "vkey": documentVKey, "editorid": c_oEditorId.Word, "c":"create", "url": documentUrl, "title": documentTitle, "embeddedfonts": this.isUseEmbeddedCutFonts, "data": g_sEmpty_bin};
sendCommand( oThis, function(){}, JSON.stringify(rData) );
editor.OpenDocument2(g_sResourceServiceLocalUrl + documentId + "/", g_sEmpty_bin);
}
else
{
this.sync_StartAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.Open); this.sync_StartAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.Open);
var rData = {"id":documentId, "format": documentFormat, "vkey": documentVKey, "editorid": c_oEditorId.Word, "c":"open", "url": documentUrl, "title": documentTitle, "embeddedfonts": this.isUseEmbeddedCutFonts}; var rData = {"id":documentId, "format": documentFormat, "vkey": documentVKey, "editorid": c_oEditorId.Word, "c":"open", "url": documentUrl, "title": documentTitle, "embeddedfonts": this.isUseEmbeddedCutFonts};
sendCommand( oThis, function(){}, JSON.stringify(rData) ); sendCommand( oThis, function(){}, JSON.stringify(rData) );
}
this.sync_zoomChangeCallback(this.WordControl.m_nZoomValue, 0); this.sync_zoomChangeCallback(this.WordControl.m_nZoomValue, 0);
} }
else else
...@@ -1160,6 +1174,16 @@ asc_docs_api.prototype.OpenDocument2 = function(url, gObject) ...@@ -1160,6 +1174,16 @@ asc_docs_api.prototype.OpenDocument2 = function(url, gObject)
else else
editor.asc_fireCallback("asc_onError",c_oAscError.ID.MobileUnexpectedCharCount,c_oAscError.Level.Critical); editor.asc_fireCallback("asc_onError",c_oAscError.ID.MobileUnexpectedCharCount,c_oAscError.Level.Critical);
//callback
editor.DocumentOrientation = (null == editor.WordControl.m_oLogicDocument) ? true : !editor.WordControl.m_oLogicDocument.Orientation;
var sizeMM;
if(editor.DocumentOrientation)
sizeMM = DocumentPageSize.getSize(Page_Width, Page_Height);
else
sizeMM = DocumentPageSize.getSize(Page_Height, Page_Width);
editor.sync_DocSizeCallback(sizeMM.w_mm, sizeMM.h_mm);
editor.sync_PageOrientCallback(editor.get_DocumentOrientation());
this.ParcedDocument = true; this.ParcedDocument = true;
if (this.isStartCoAuthoringOnEndLoad) { if (this.isStartCoAuthoringOnEndLoad) {
this.CoAuthoringApi.onStartCoAuthoring(true); this.CoAuthoringApi.onStartCoAuthoring(true);
...@@ -6640,15 +6664,6 @@ asc_docs_api.prototype.OfflineAppDocumentEndLoad = function() ...@@ -6640,15 +6664,6 @@ asc_docs_api.prototype.OfflineAppDocumentEndLoad = function()
editor.OpenDocument(documentUrl, window["editor_bin"]); editor.OpenDocument(documentUrl, window["editor_bin"]);
else else
editor.OpenDocument2(documentUrl, window["editor_bin"]); editor.OpenDocument2(documentUrl, window["editor_bin"]);
//callback
editor.DocumentOrientation = (null == editor.WordControl.m_oLogicDocument) ? true : !editor.WordControl.m_oLogicDocument.Orientation;
var sizeMM;
if(editor.DocumentOrientation)
sizeMM = DocumentPageSize.getSize(Page_Width, Page_Height);
else
sizeMM = DocumentPageSize.getSize(Page_Height, Page_Width);
editor.sync_DocSizeCallback(sizeMM.w_mm, sizeMM.h_mm);
editor.sync_PageOrientCallback(editor.get_DocumentOrientation());
} }
asc_docs_api.prototype.SetDrawImagePlaceParagraph = function(element_id, props) asc_docs_api.prototype.SetDrawImagePlaceParagraph = function(element_id, props)
...@@ -6782,15 +6797,6 @@ function sendCommand(editor, fCallback, rdata){ ...@@ -6782,15 +6797,6 @@ function sendCommand(editor, fCallback, rdata){
editor.OpenDocument(url, result); editor.OpenDocument(url, result);
else else
editor.OpenDocument2(url, result); editor.OpenDocument2(url, result);
//callback
editor.DocumentOrientation = (null == editor.WordControl.m_oLogicDocument) ? true : !editor.WordControl.m_oLogicDocument.Orientation;
var sizeMM;
if(editor.DocumentOrientation)
sizeMM = DocumentPageSize.getSize(Page_Width, Page_Height);
else
sizeMM = DocumentPageSize.getSize(Page_Height, Page_Width);
editor.sync_DocSizeCallback(sizeMM.w_mm, sizeMM.h_mm);
editor.sync_PageOrientCallback(editor.get_DocumentOrientation());
if(fCallback) if(fCallback)
fCallback(incomeObject); fCallback(incomeObject);
}, },
......
This diff is collapsed.
...@@ -208,6 +208,7 @@ ...@@ -208,6 +208,7 @@
<script type="text/javascript" src="../../../../OfficeWeb/Word/apiDefines.js"></script> <script type="text/javascript" src="../../../../OfficeWeb/Word/apiDefines.js"></script>
<script type="text/javascript" src="../../../../OfficeWeb/Word/apiCommon.js"></script> <script type="text/javascript" src="../../../../OfficeWeb/Word/apiCommon.js"></script>
<script type="text/javascript" src="../../../../OfficeWeb/Word/api.js"></script> <script type="text/javascript" src="../../../../OfficeWeb/Word/api.js"></script>
<script type="text/javascript" src="../../../../OfficeWeb/Word/document/empty.js"></script>
<script type="text/javascript" src="../../../../OfficeWeb/Common/scroll.js"></script> <script type="text/javascript" src="../../../../OfficeWeb/Common/scroll.js"></script>
<script type="text/javascript" src="../../../../OfficeWeb/Word/Editor/CollaborativeEditing.js"></script> <script type="text/javascript" src="../../../../OfficeWeb/Word/Editor/CollaborativeEditing.js"></script>
......
...@@ -181,6 +181,7 @@ ...@@ -181,6 +181,7 @@
<script type="text/javascript" src="../../../../OfficeWeb/Word/apiDefines.js"></script> <script type="text/javascript" src="../../../../OfficeWeb/Word/apiDefines.js"></script>
<script type="text/javascript" src="../../../../OfficeWeb/Word/apiCommon.js"></script> <script type="text/javascript" src="../../../../OfficeWeb/Word/apiCommon.js"></script>
<script type="text/javascript" src="../../../../OfficeWeb/Word/api.js"></script> <script type="text/javascript" src="../../../../OfficeWeb/Word/api.js"></script>
<script type="text/javascript" src="../../../../OfficeWeb/Word/document/empty.js"></script>
<script type="text/javascript" src="../../../../OfficeWeb/Common/scroll.js"></script> <script type="text/javascript" src="../../../../OfficeWeb/Common/scroll.js"></script>
<script type="text/javascript" src="../../../../OfficeWeb/Common/Shapes/EditorSettings.js"></script> <script type="text/javascript" src="../../../../OfficeWeb/Common/Shapes/EditorSettings.js"></script>
......
...@@ -128,6 +128,7 @@ ...@@ -128,6 +128,7 @@
<script type="text/javascript" src="../../OfficeWeb/Word/apiDefines.js"></script> <script type="text/javascript" src="../../OfficeWeb/Word/apiDefines.js"></script>
<script type="text/javascript" src="../../OfficeWeb/Word/apiCommon.js"></script> <script type="text/javascript" src="../../OfficeWeb/Word/apiCommon.js"></script>
<script type="text/javascript" src="../../OfficeWeb/Word/api.js"></script> <script type="text/javascript" src="../../OfficeWeb/Word/api.js"></script>
<script type="text/javascript" src="../../OfficeWeb/Word/document/empty.js"></script>
<script type="text/javascript" src="../../OfficeWeb/Common/scroll.js"></script> <script type="text/javascript" src="../../OfficeWeb/Common/scroll.js"></script>
<script type="text/javascript" src="../../OfficeWeb/Word/Editor/CollaborativeEditing.js"></script> <script type="text/javascript" src="../../OfficeWeb/Word/Editor/CollaborativeEditing.js"></script>
......
...@@ -160,6 +160,7 @@ ...@@ -160,6 +160,7 @@
<script type="text/javascript" src="apiDefines.js"></script> <script type="text/javascript" src="apiDefines.js"></script>
<script type="text/javascript" src="apiCommon.js"></script> <script type="text/javascript" src="apiCommon.js"></script>
<script type="text/javascript" src="document/empty.js"></script>
<!--<script type="text/javascript" src="api.js"></script>--> <!--<script type="text/javascript" src="api.js"></script>-->
<script type="text/javascript" src="../Common/scroll.js"></script> <script type="text/javascript" src="../Common/scroll.js"></script>
......
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