[DE][SSE] Open protected files.
This commit is contained in:
parent
be7c3de41d
commit
9f20d9d4d4
|
@ -61,18 +61,24 @@ define([
|
||||||
header : true,
|
header : true,
|
||||||
cls : 'open-dlg',
|
cls : 'open-dlg',
|
||||||
contentTemplate : '',
|
contentTemplate : '',
|
||||||
title : t.txtTitle.replace('%1', (options.type == Asc.c_oAscAdvancedOptionsID.CSV) ? 'CSV' : 'TXT')
|
title : (options.type == Asc.c_oAscAdvancedOptionsID.DRM) ? t.txtTitleProtected : t.txtTitle.replace('%1', (options.type == Asc.c_oAscAdvancedOptionsID.CSV) ? 'CSV' : 'TXT')
|
||||||
|
|
||||||
}, options);
|
}, options);
|
||||||
|
|
||||||
this.template = options.template || [
|
this.template = options.template || [
|
||||||
'<div class="box" style="height:' + (_options.height - 85) + 'px;">',
|
'<div class="box" style="height:' + (_options.height - 85) + 'px;">',
|
||||||
'<div class="content-panel" >',
|
'<div class="content-panel" >',
|
||||||
|
'<% if (type == Asc.c_oAscAdvancedOptionsID.DRM) { %>',
|
||||||
|
'<label class="header">' + t.txtPassword + '</label>',
|
||||||
|
'<div id="id-password-txt" style="margin-bottom:15px;"></div>',
|
||||||
|
'<% } else { %>',
|
||||||
'<label class="header">' + t.txtEncoding + '</label>',
|
'<label class="header">' + t.txtEncoding + '</label>',
|
||||||
'<div id="id-codepages-combo" class="input-group-nr" style="margin-bottom:15px;"></div>',
|
'<div id="id-codepages-combo" class="input-group-nr" style="margin-bottom:15px;"></div>',
|
||||||
'<% if (type == Asc.c_oAscAdvancedOptionsID.CSV) { %>',
|
'<% if (type == Asc.c_oAscAdvancedOptionsID.CSV) { %>',
|
||||||
'<label class="header">' + t.txtDelimiter + '</label>',
|
'<label class="header">' + t.txtDelimiter + '</label>',
|
||||||
'<div id="id-delimiters-combo" class="input-group-nr" style="max-width: 110px;"></div>',
|
'<div id="id-delimiters-combo" class="input-group-nr" style="max-width: 110px;"></div>',
|
||||||
'<% } %>',
|
'<% } %>',
|
||||||
|
'<% } %>',
|
||||||
'</div>',
|
'</div>',
|
||||||
'</div>',
|
'</div>',
|
||||||
|
|
||||||
|
@ -97,13 +103,36 @@ define([
|
||||||
if (this.$window) {
|
if (this.$window) {
|
||||||
this.$window.find('.tool').hide();
|
this.$window.find('.tool').hide();
|
||||||
this.$window.find('.dlg-btn').on('click', _.bind(this.onBtnClick, this));
|
this.$window.find('.dlg-btn').on('click', _.bind(this.onBtnClick, this));
|
||||||
this.initCodePages();
|
if (this.type == Asc.c_oAscAdvancedOptionsID.DRM) {
|
||||||
|
var me = this;
|
||||||
|
me.inputPwd = new Common.UI.InputField({
|
||||||
|
el: $('#id-password-txt'),
|
||||||
|
type: 'password',
|
||||||
|
allowBlank: false,
|
||||||
|
validateOnBlur: false
|
||||||
|
});
|
||||||
|
} else
|
||||||
|
this.initCodePages();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
show: function() {
|
||||||
|
Common.UI.Window.prototype.show.apply(this, arguments);
|
||||||
|
|
||||||
|
if (this.type == Asc.c_oAscAdvancedOptionsID.DRM) {
|
||||||
|
var me = this;
|
||||||
|
setTimeout(function(){
|
||||||
|
me.inputPwd.cmpEl.find('input').focus();
|
||||||
|
}, 500);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
onBtnClick: function (event) {
|
onBtnClick: function (event) {
|
||||||
if (this.handler && this.cmbEncoding) {
|
if (this.handler) {
|
||||||
this.handler.call(this, this.cmbEncoding.getValue(), this.cmbDelimiter ? this.cmbDelimiter.getValue() : null);
|
if (this.cmbEncoding)
|
||||||
|
this.handler.call(this, this.cmbEncoding.getValue(), this.cmbDelimiter ? this.cmbDelimiter.getValue() : null);
|
||||||
|
else
|
||||||
|
this.handler.call(this, this.inputPwd.getValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
this.close();
|
this.close();
|
||||||
|
@ -311,7 +340,9 @@ define([
|
||||||
txtEncoding : "Encoding ",
|
txtEncoding : "Encoding ",
|
||||||
txtSpace : "Space",
|
txtSpace : "Space",
|
||||||
txtTab : "Tab",
|
txtTab : "Tab",
|
||||||
txtTitle : "Choose %1 options"
|
txtTitle : "Choose %1 options",
|
||||||
|
txtPassword : "Password",
|
||||||
|
txtTitleProtected : "Protected File"
|
||||||
|
|
||||||
}, Common.Views.OpenDialog || {}));
|
}, Common.Views.OpenDialog || {}));
|
||||||
});
|
});
|
|
@ -1592,14 +1592,14 @@ define([
|
||||||
},
|
},
|
||||||
|
|
||||||
onAdvancedOptions: function(advOptions) {
|
onAdvancedOptions: function(advOptions) {
|
||||||
var type = advOptions.asc_getOptionId();
|
var type = advOptions.asc_getOptionId(),
|
||||||
|
me = this, dlg;
|
||||||
if (type == Asc.c_oAscAdvancedOptionsID.TXT) {
|
if (type == Asc.c_oAscAdvancedOptionsID.TXT) {
|
||||||
var me = this;
|
dlg = new Common.Views.OpenDialog({
|
||||||
var dlg = new Common.Views.OpenDialog({
|
|
||||||
type: type,
|
type: type,
|
||||||
codepages: advOptions.asc_getOptions().asc_getCodePages(),
|
codepages: advOptions.asc_getOptions().asc_getCodePages(),
|
||||||
settings: advOptions.asc_getOptions().asc_getRecommendedSettings(),
|
settings: advOptions.asc_getOptions().asc_getRecommendedSettings(),
|
||||||
handler: function (encoding, delimiter) {
|
handler: function (encoding) {
|
||||||
me.isShowOpenDialog = false;
|
me.isShowOpenDialog = false;
|
||||||
if (me && me.api) {
|
if (me && me.api) {
|
||||||
me.api.asc_setAdvancedOptions(type, new Asc.asc_CTXTAdvancedOptions(encoding));
|
me.api.asc_setAdvancedOptions(type, new Asc.asc_CTXTAdvancedOptions(encoding));
|
||||||
|
@ -1607,11 +1607,22 @@ define([
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
} else if (type == Asc.c_oAscAdvancedOptionsID.DRM) {
|
||||||
|
dlg = new Common.Views.OpenDialog({
|
||||||
|
type: type,
|
||||||
|
handler: function (value) {
|
||||||
|
me.isShowOpenDialog = false;
|
||||||
|
if (me && me.api) {
|
||||||
|
me.api.asc_setAdvancedOptions(type, new Asc.asc_CDRMAdvancedOptions(value));
|
||||||
|
me.loadMask && me.loadMask.show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (dlg) {
|
||||||
this.isShowOpenDialog = true;
|
this.isShowOpenDialog = true;
|
||||||
this.loadMask && this.loadMask.hide();
|
this.loadMask && this.loadMask.hide();
|
||||||
this.onLongActionEnd(Asc.c_oAscAsyncActionType.BlockInteraction, LoadingDocument);
|
this.onLongActionEnd(Asc.c_oAscAsyncActionType.BlockInteraction, LoadingDocument);
|
||||||
|
|
||||||
dlg.show();
|
dlg.show();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -159,6 +159,8 @@
|
||||||
"Common.Views.OpenDialog.okButtonText": "OK",
|
"Common.Views.OpenDialog.okButtonText": "OK",
|
||||||
"Common.Views.OpenDialog.txtEncoding": "Encoding ",
|
"Common.Views.OpenDialog.txtEncoding": "Encoding ",
|
||||||
"Common.Views.OpenDialog.txtTitle": "Choose %1 options",
|
"Common.Views.OpenDialog.txtTitle": "Choose %1 options",
|
||||||
|
"Common.Views.OpenDialog.txtPassword": "Password",
|
||||||
|
"Common.Views.OpenDialog.txtTitleProtected": "Protected File",
|
||||||
"Common.Views.Plugins.strPlugins": "Add-ons",
|
"Common.Views.Plugins.strPlugins": "Add-ons",
|
||||||
"Common.Views.Plugins.textLoading": "Loading",
|
"Common.Views.Plugins.textLoading": "Loading",
|
||||||
"Common.Views.Plugins.textStart": "Start",
|
"Common.Views.Plugins.textStart": "Start",
|
||||||
|
|
|
@ -1304,10 +1304,10 @@ define([
|
||||||
},
|
},
|
||||||
|
|
||||||
onAdvancedOptions: function(advOptions) {
|
onAdvancedOptions: function(advOptions) {
|
||||||
var type = advOptions.asc_getOptionId();
|
var type = advOptions.asc_getOptionId(),
|
||||||
|
me = this, dlg;
|
||||||
if (type == Asc.c_oAscAdvancedOptionsID.CSV) {
|
if (type == Asc.c_oAscAdvancedOptionsID.CSV) {
|
||||||
var me = this;
|
dlg = new Common.Views.OpenDialog({
|
||||||
var dlg = new Common.Views.OpenDialog({
|
|
||||||
type: type,
|
type: type,
|
||||||
codepages: advOptions.asc_getOptions().asc_getCodePages(),
|
codepages: advOptions.asc_getOptions().asc_getCodePages(),
|
||||||
settings: advOptions.asc_getOptions().asc_getRecommendedSettings(),
|
settings: advOptions.asc_getOptions().asc_getRecommendedSettings(),
|
||||||
|
@ -1319,11 +1319,22 @@ define([
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
} else if (type == Asc.c_oAscAdvancedOptionsID.DRM) {
|
||||||
|
dlg = new Common.Views.OpenDialog({
|
||||||
|
type: type,
|
||||||
|
handler: function (value) {
|
||||||
|
me.isShowOpenDialog = false;
|
||||||
|
if (me && me.api) {
|
||||||
|
me.api.asc_setAdvancedOptions(type, new Asc.asc_CDRMAdvancedOptions(value));
|
||||||
|
me.loadMask && me.loadMask.show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (dlg) {
|
||||||
this.isShowOpenDialog = true;
|
this.isShowOpenDialog = true;
|
||||||
this.loadMask && this.loadMask.hide();
|
this.loadMask && this.loadMask.hide();
|
||||||
this.onLongActionEnd(Asc.c_oAscAsyncActionType.BlockInteraction, LoadingDocument);
|
this.onLongActionEnd(Asc.c_oAscAsyncActionType.BlockInteraction, LoadingDocument);
|
||||||
|
|
||||||
dlg.show();
|
dlg.show();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -86,6 +86,8 @@
|
||||||
"Common.Views.OpenDialog.txtSpace": "Space",
|
"Common.Views.OpenDialog.txtSpace": "Space",
|
||||||
"Common.Views.OpenDialog.txtTab": "Tab",
|
"Common.Views.OpenDialog.txtTab": "Tab",
|
||||||
"Common.Views.OpenDialog.txtTitle": "Choose %1 options",
|
"Common.Views.OpenDialog.txtTitle": "Choose %1 options",
|
||||||
|
"Common.Views.OpenDialog.txtPassword": "Password",
|
||||||
|
"Common.Views.OpenDialog.txtTitleProtected": "Protected File",
|
||||||
"Common.Views.Plugins.strPlugins": "Add-ons",
|
"Common.Views.Plugins.strPlugins": "Add-ons",
|
||||||
"Common.Views.Plugins.textLoading": "Loading",
|
"Common.Views.Plugins.textLoading": "Loading",
|
||||||
"Common.Views.Plugins.textStart": "Start",
|
"Common.Views.Plugins.textStart": "Start",
|
||||||
|
|
Loading…
Reference in a new issue