[DE] Replace MailMergeSaveDlg by SaveAsDlg from common
This commit is contained in:
parent
29dfa2b83d
commit
8dc82501ef
|
@ -31,9 +31,8 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
/**
|
/**
|
||||||
* User: Julia.Radzhabova
|
* Created by Julia.Radzhabova on 9/27/18
|
||||||
* Date: 15.04.15
|
* Copyright (c) 2018 Ascensio System SIA. All rights reserved.
|
||||||
* Time: 13:56
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
define([
|
define([
|
||||||
|
@ -41,7 +40,7 @@ define([
|
||||||
'common/main/lib/component/LoadMask'
|
'common/main/lib/component/LoadMask'
|
||||||
], function () { 'use strict';
|
], function () { 'use strict';
|
||||||
|
|
||||||
DE.Views.MailMergeSaveDlg = Common.UI.Window.extend(_.extend({
|
Common.Views.SaveAsDlg = Common.UI.Window.extend(_.extend({
|
||||||
initialize : function(options) {
|
initialize : function(options) {
|
||||||
var _options = {};
|
var _options = {};
|
||||||
_.extend(_options, {
|
_.extend(_options, {
|
||||||
|
@ -52,15 +51,15 @@ define([
|
||||||
}, options);
|
}, options);
|
||||||
|
|
||||||
this.template = [
|
this.template = [
|
||||||
'<div id="id-mail-merge-folder-placeholder"></div>'
|
'<div id="id-saveas-folder-placeholder"></div>'
|
||||||
].join('');
|
].join('');
|
||||||
|
|
||||||
_options.tpl = _.template(this.template)(_options);
|
_options.tpl = _.template(this.template)(_options);
|
||||||
|
|
||||||
this.mergeFolderUrl = options.mergeFolderUrl || '';
|
this.saveFolderUrl = options.saveFolderUrl || '';
|
||||||
this.mergedFileUrl = options.mergedFileUrl || '';
|
this.saveFileUrl = options.saveFileUrl || '';
|
||||||
this.defFileName = options.defFileName || '';
|
this.defFileName = options.defFileName || '';
|
||||||
this.mergeFolderUrl = this.mergeFolderUrl.replace("{title}", encodeURIComponent(this.defFileName)).replace("{fileuri}", encodeURIComponent(this.mergedFileUrl));
|
this.saveFolderUrl = this.saveFolderUrl.replace("{title}", encodeURIComponent(this.defFileName)).replace("{fileuri}", encodeURIComponent(this.saveFileUrl));
|
||||||
Common.UI.Window.prototype.initialize.call(this, _options);
|
Common.UI.Window.prototype.initialize.call(this, _options);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -75,13 +74,13 @@ define([
|
||||||
iframe.frameBorder = 0;
|
iframe.frameBorder = 0;
|
||||||
iframe.scrolling = "no";
|
iframe.scrolling = "no";
|
||||||
iframe.onload = _.bind(this._onLoad,this);
|
iframe.onload = _.bind(this._onLoad,this);
|
||||||
$('#id-mail-merge-folder-placeholder').append(iframe);
|
$('#id-saveas-folder-placeholder').append(iframe);
|
||||||
|
|
||||||
this.loadMask = new Common.UI.LoadMask({owner: $('#id-mail-merge-folder-placeholder')});
|
this.loadMask = new Common.UI.LoadMask({owner: $('#id-saveas-folder-placeholder')});
|
||||||
this.loadMask.setTitle(this.textLoading);
|
this.loadMask.setTitle(this.textLoading);
|
||||||
this.loadMask.show();
|
this.loadMask.show();
|
||||||
|
|
||||||
iframe.src = this.mergeFolderUrl;
|
iframe.src = this.saveFolderUrl;
|
||||||
|
|
||||||
var me = this;
|
var me = this;
|
||||||
this._eventfunc = function(msg) {
|
this._eventfunc = function(msg) {
|
||||||
|
@ -122,10 +121,10 @@ define([
|
||||||
_onMessage: function(msg) {
|
_onMessage: function(msg) {
|
||||||
if (msg && msg.Referer == "onlyoffice") {
|
if (msg && msg.Referer == "onlyoffice") {
|
||||||
if ( !_.isEmpty(msg.error) ) {
|
if ( !_.isEmpty(msg.error) ) {
|
||||||
this.trigger('mailmergeerror', this, msg.error);
|
this.trigger('saveaserror', this, msg.error);
|
||||||
}
|
}
|
||||||
// if ( !_.isEmpty(msg.folder) ) {
|
// if ( !_.isEmpty(msg.folder) ) {
|
||||||
// this.trigger('mailmergefolder', this, msg.folder); // save last folder url
|
// this.trigger('saveasfolder', this, msg.folder); // save last folder url
|
||||||
// }
|
// }
|
||||||
Common.NotificationCenter.trigger('window:close', this);
|
Common.NotificationCenter.trigger('window:close', this);
|
||||||
}
|
}
|
||||||
|
@ -138,6 +137,6 @@ define([
|
||||||
|
|
||||||
textTitle : 'Folder for save',
|
textTitle : 'Folder for save',
|
||||||
textLoading : 'Loading'
|
textLoading : 'Loading'
|
||||||
}, DE.Views.MailMergeSaveDlg || {}));
|
}, Common.Views.SaveAsDlg || {}));
|
||||||
});
|
});
|
||||||
|
|
|
@ -43,9 +43,9 @@
|
||||||
define([
|
define([
|
||||||
'core',
|
'core',
|
||||||
'common/main/lib/util/Shortcuts',
|
'common/main/lib/util/Shortcuts',
|
||||||
|
'common/main/lib/view/SaveAsDlg',
|
||||||
'documenteditor/main/app/view/LeftMenu',
|
'documenteditor/main/app/view/LeftMenu',
|
||||||
'documenteditor/main/app/view/FileMenu',
|
'documenteditor/main/app/view/FileMenu'
|
||||||
'documenteditor/main/app/view/MailMergeSaveDlg'
|
|
||||||
], function () {
|
], function () {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
@ -353,12 +353,12 @@ define([
|
||||||
defFileName = defFileName.substring(0, idx) + this.isFromFileDownloadAs;
|
defFileName = defFileName.substring(0, idx) + this.isFromFileDownloadAs;
|
||||||
}
|
}
|
||||||
|
|
||||||
me._saveCopyDlg = new DE.Views.MailMergeSaveDlg({
|
me._saveCopyDlg = new Common.Views.SaveAsDlg({
|
||||||
mergeFolderUrl: me.mode.saveAsUrl,
|
saveFolderUrl: me.mode.saveAsUrl,
|
||||||
mergedFileUrl: url,
|
saveFileUrl: url,
|
||||||
defFileName: defFileName
|
defFileName: defFileName
|
||||||
});
|
});
|
||||||
me._saveCopyDlg.on('mailmergeerror', function(obj, err){
|
me._saveCopyDlg.on('saveaserror', function(obj, err){
|
||||||
var config = {
|
var config = {
|
||||||
closable: false,
|
closable: false,
|
||||||
title: this.notcriticalErrorTitle,
|
title: this.notcriticalErrorTitle,
|
||||||
|
|
|
@ -171,7 +171,7 @@ define([ 'text!documenteditor/main/app/template/MailMergeEmailDlg.template',
|
||||||
_onMessage: function(msg) {
|
_onMessage: function(msg) {
|
||||||
if (msg && msg.Referer == "onlyoffice") {
|
if (msg && msg.Referer == "onlyoffice") {
|
||||||
// if ( !_.isEmpty(msg.folder) ) {
|
// if ( !_.isEmpty(msg.folder) ) {
|
||||||
// this.trigger('mailmergefolder', this, msg.folder); // save last folder url
|
// this.trigger('saveasfolder', this, msg.folder); // save last folder url
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -42,8 +42,8 @@ define([
|
||||||
'backbone',
|
'backbone',
|
||||||
'common/main/lib/component/Button',
|
'common/main/lib/component/Button',
|
||||||
'common/main/lib/component/Switcher',
|
'common/main/lib/component/Switcher',
|
||||||
|
'common/main/lib/view/SaveAsDlg',
|
||||||
'documenteditor/main/app/view/MailMergeRecepients',
|
'documenteditor/main/app/view/MailMergeRecepients',
|
||||||
'documenteditor/main/app/view/MailMergeSaveDlg',
|
|
||||||
'documenteditor/main/app/view/MailMergeEmailDlg'
|
'documenteditor/main/app/view/MailMergeEmailDlg'
|
||||||
], function (menuTemplate, $, _, Backbone) {
|
], function (menuTemplate, $, _, Backbone) {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
@ -544,13 +544,13 @@ define([
|
||||||
if (this._mailMergeDlg) return;
|
if (this._mailMergeDlg) return;
|
||||||
var me = this;
|
var me = this;
|
||||||
if (this.cmbMergeTo.getValue() != Asc.c_oAscFileType.HTML) {
|
if (this.cmbMergeTo.getValue() != Asc.c_oAscFileType.HTML) {
|
||||||
me._mailMergeDlg = new DE.Views.MailMergeSaveDlg({
|
me._mailMergeDlg = new Common.Views.SaveAsDlg({
|
||||||
mergeFolderUrl: me.mode.mergeFolderUrl,
|
saveFolderUrl: me.mode.mergeFolderUrl,
|
||||||
mergedFileUrl: url,
|
savedFileUrl: url,
|
||||||
defFileName: me.defFileName + ((this.cmbMergeTo.getValue() == Asc.c_oAscFileType.PDF) ? '.pdf' : '.docx')
|
defFileName: me.defFileName + ((this.cmbMergeTo.getValue() == Asc.c_oAscFileType.PDF) ? '.pdf' : '.docx')
|
||||||
});
|
});
|
||||||
me._mailMergeDlg.on('mailmergefolder', function(obj, folder){ // save last folder
|
me._mailMergeDlg.on('saveasfolder', function(obj, folder){ // save last folder
|
||||||
}).on('mailmergeerror', function(obj, err){ // save last folder
|
}).on('saveaserror', function(obj, err){ // save last folder
|
||||||
var config = {
|
var config = {
|
||||||
closable: false,
|
closable: false,
|
||||||
title: this.notcriticalErrorTitle,
|
title: this.notcriticalErrorTitle,
|
||||||
|
|
|
@ -279,6 +279,8 @@
|
||||||
"Common.Views.ReviewPopover.textOpenAgain": "Open Again",
|
"Common.Views.ReviewPopover.textOpenAgain": "Open Again",
|
||||||
"Common.Views.ReviewPopover.textReply": "Reply",
|
"Common.Views.ReviewPopover.textReply": "Reply",
|
||||||
"Common.Views.ReviewPopover.textResolve": "Resolve",
|
"Common.Views.ReviewPopover.textResolve": "Resolve",
|
||||||
|
"Common.Views.SaveAsDlg.textLoading": "Loading",
|
||||||
|
"Common.Views.SaveAsDlg.textTitle": "Folder for save",
|
||||||
"Common.Views.SignDialog.cancelButtonText": "Cancel",
|
"Common.Views.SignDialog.cancelButtonText": "Cancel",
|
||||||
"Common.Views.SignDialog.okButtonText": "Ok",
|
"Common.Views.SignDialog.okButtonText": "Ok",
|
||||||
"Common.Views.SignDialog.textBold": "Bold",
|
"Common.Views.SignDialog.textBold": "Bold",
|
||||||
|
@ -1361,8 +1363,8 @@
|
||||||
"DE.Views.MailMergeEmailDlg.textWarningMsg": "Please note that mailing cannot be stopped once your click the 'Send' button.",
|
"DE.Views.MailMergeEmailDlg.textWarningMsg": "Please note that mailing cannot be stopped once your click the 'Send' button.",
|
||||||
"DE.Views.MailMergeRecepients.textLoading": "Loading",
|
"DE.Views.MailMergeRecepients.textLoading": "Loading",
|
||||||
"DE.Views.MailMergeRecepients.textTitle": "Select Data Source",
|
"DE.Views.MailMergeRecepients.textTitle": "Select Data Source",
|
||||||
"DE.Views.MailMergeSaveDlg.textLoading": "Loading",
|
"del_DE.Views.MailMergeSaveDlg.textLoading": "Loading",
|
||||||
"DE.Views.MailMergeSaveDlg.textTitle": "Folder for save",
|
"del_DE.Views.MailMergeSaveDlg.textTitle": "Folder for save",
|
||||||
"DE.Views.MailMergeSettings.downloadMergeTitle": "Merging",
|
"DE.Views.MailMergeSettings.downloadMergeTitle": "Merging",
|
||||||
"DE.Views.MailMergeSettings.errorMailMergeSaveFile": "Merge failed.",
|
"DE.Views.MailMergeSettings.errorMailMergeSaveFile": "Merge failed.",
|
||||||
"DE.Views.MailMergeSettings.notcriticalErrorTitle": "Warning",
|
"DE.Views.MailMergeSettings.notcriticalErrorTitle": "Warning",
|
||||||
|
|
Loading…
Reference in a new issue