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

(1.0.0.128): FileConverterUtils2

Убрал urlchanges из данных.
Поправил открытие zip с изменениями (теперь он напрямую открывается, без скачивания к нам на сервер).

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@62842 954022d7-b5bf-4e40-9824-e11837661b57
parent 60ec04bc
......@@ -48,14 +48,13 @@ function g_fSaveWithParts(fSendCommand, fCallback, oAdditionalData, aParts) {
}, oAdditionalData);
}
function g_fOpenFileCommand (data, Signature, callback) {
function g_fOpenFileCommand (binUrl, changesUrl, Signature, callback) {
var bError = false, oResult = new OpenFileResult(), bEndLoadFile = false, bEndLoadChanges = false;
var onEndOpen = function () {
if (bEndLoadFile && bEndLoadChanges)
if (callback) callback(bError, oResult);
};
var openData = JSON.parse(data);
var sFileUrl = g_sResourceServiceLocalUrl + openData['urlfile'];
var sFileUrl = g_sResourceServiceLocalUrl + binUrl;
sFileUrl = sFileUrl.replace( /\\/g, "/" );
asc_ajax({
url: sFileUrl,
......@@ -80,8 +79,8 @@ function g_fOpenFileCommand (data, Signature, callback) {
onEndOpen();
}
});
if (null != openData['urlchanges']) {
require('jsziputils').getBinaryContent(g_sResourceServiceLocalUrl + openData['urlchanges'], function(err, data) {
if (null != changesUrl) {
require('jsziputils').getBinaryContent(changesUrl, function(err, data) {
bEndLoadChanges = true;
if(err) {
bError = true;
......
......@@ -1015,7 +1015,7 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
spreadsheet_api.prototype._onOpenCommand = function (callback, data) {
var t = this;
g_fOpenFileCommand(data, Asc.c_oSerFormat.Signature, function (error, result) {
g_fOpenFileCommand(data, this.documentUrlChanges, Asc.c_oSerFormat.Signature, function (error, result) {
if (error || !result.bSerFormat) {
var oError = {returnCode: c_oAscError.Level.Critical, val: c_oAscError.ID.Unknown};
t.handlers.trigger("asc_onError", oError.val, oError.returnCode);
......@@ -1067,8 +1067,7 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
"url" : this.documentUrl,
"title" : this.documentTitle,
"embeddedfonts" : this.isUseEmbeddedCutFonts,
"viewmode" : this.asc_getViewerMode(),
"urlchanges" : this.documentUrlChanges
"viewmode" : this.asc_getViewerMode()
};
if (false && this.documentOpenOptions && this.documentOpenOptions["isEmpty"]) {
var sEmptyWorkbook = getEmptyWorkbook();
......
......@@ -861,8 +861,7 @@ asc_docs_api.prototype.LoadDocument = function(c_DocInfo)
"url" : documentUrl,
"title" : documentTitle,
"embeddedfonts" : this.isUseEmbeddedCutFonts,
"viewmode" : this.isViewMode,
"urlchanges" : documentUrlChanges
"viewmode" : this.isViewMode
};
sendCommand( oThis, function(){}, rData );
......@@ -5213,7 +5212,7 @@ function sendTrack(fCallback, url, rdata){
})
}
function _onOpenCommand(fCallback, incomeObject) {
g_fOpenFileCommand(incomeObject["data"], c_oSerFormat.Signature, function (error, result) {
g_fOpenFileCommand(incomeObject["data"], documentUrlChanges, c_oSerFormat.Signature, function (error, result) {
if (error || !result.bSerFormat) {
editor.asc_fireCallback("asc_onError",c_oAscError.ID.Unknown,c_oAscError.Level.Critical);
if(fCallback) fCallback();
......
......@@ -889,8 +889,7 @@ asc_docs_api.prototype.LoadDocument = function(c_DocInfo)
"url" : documentUrl,
"title" : documentTitle,
"embeddedfonts" : this.isUseEmbeddedCutFonts,
"viewmode" : this.isViewMode,
"urlchanges" : documentUrlChanges
"viewmode" : this.isViewMode
};
if(false && oOpenOptions && oOpenOptions["isEmpty"])
......@@ -7125,7 +7124,7 @@ function sendTrack(fCallback, url, rdata){
})
}
function _onOpenCommand(fCallback, incomeObject) {
g_fOpenFileCommand(incomeObject["data"], c_oSerFormat.Signature, function (error, result) {
g_fOpenFileCommand(incomeObject["data"], documentUrlChanges, c_oSerFormat.Signature, function (error, result) {
if (error) {
editor.asc_fireCallback("asc_onError",c_oAscError.ID.Unknown,c_oAscError.Level.Critical);
if(fCallback) fCallback();
......
......@@ -18,10 +18,12 @@ require.config({
backbone : '../vendor/backbone/backbone',
bootstrap : '../vendor/bootstrap/dist/js/bootstrap',
text : '../vendor/requirejs-text/text',
perfectscrollbar: 'common/main/lib/mods/perfect-scrollbar',
perfectscrollbar: 'common/main/lib/mods/perfect-scrollbar',
jmousewheel : '../vendor/perfect-scrollbar/src/jquery.mousewheel',
xregexp : '../vendor/xregexp/xregexp-all-min',
sockjs : '../vendor/sockjs/sockjs.min',
jszip : '../vendor/jszip/jszip.min',
jsziputils : '../vendor/jszip-utils/jszip-utils.min',
api : 'api/documents/api',
core : 'common/main/lib/core/application',
notification : 'common/main/lib/core/NotificationCenter',
......@@ -66,6 +68,17 @@ require.config({
'irregularstack'
]
},
sdk: {
deps: [
'jquery',
'underscore',
'allfonts',
'xregexp',
'sockjs',
'jszip',
'jsziputils'
]
},
gateway: {
deps: [
'jquery'
......@@ -86,7 +99,9 @@ require([
'api',
'analytics',
'gateway',
'locale'
'locale',
'jszip',
'jsziputils'
], function (Backbone, Bootstrap, Core) {
Backbone.history.start();
......@@ -113,6 +128,7 @@ require([
/** proprietary begin **/
,'Common.Controllers.ExternalDiagramEditor'
/** proprietary end **/
,'Common.Controllers.ExternalMergeEditor'
]
});
......@@ -142,6 +158,7 @@ require([
,'documenteditor/main/app/view/ChartSettings'
,'common/main/lib/controller/ExternalDiagramEditor'
/** proprietary end **/
,'common/main/lib/controller/ExternalMergeEditor'
], function() {
app.start();
});
......
......@@ -238,8 +238,6 @@
<script type="text/javascript" src="../../../../OfficeWeb/Common/3rdparty/sockjs/sockjs-0.3.min.js"></script>
<script type="text/javascript" src="../../../../OfficeWeb/Common/3rdparty/xregexp/xregexp-all-min.js"></script>
<script type="text/javascript" src="../../../../OfficeWeb/Common/3rdparty/underscore/underscore-min.js"></script>
<script type="text/javascript" src="../../../../OfficeWeb/Common/3rdparty/jszip/jszip.min.js"></script>
<script type="text/javascript" src="../../../../OfficeWeb/Common/3rdparty/jszip-utils/jszip-utils.min.js"></script>
<!-- sdk -->
<script type="text/javascript" src="../../../../OfficeWeb/Common/docscoapisettings.js"></script>
......@@ -429,6 +427,8 @@
<!-- application -->
<script type="text/javascript" src="../../../sdk/Common/docscoapisettings.js"></script>
<!--<script data-main="app" src="../../../vendor/jszip/jszip.min.js"></script>-->
<!--<script data-main="app" src="../../../vendor/jszip-utils/jszip-utils.min.js"></script>-->
<script data-main="app" src="../../../vendor/requirejs/require.js"></script>
</body>
</html>
\ No newline at end of file
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