[SSE] Unprotect workbook
This commit is contained in:
parent
7617a9681e
commit
72378721fd
|
@ -91,6 +91,8 @@ define([
|
||||||
|
|
||||||
}, options);
|
}, options);
|
||||||
|
|
||||||
|
this.txtOpenFile = options.txtOpenFile || this.txtOpenFile;
|
||||||
|
|
||||||
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" >',
|
||||||
|
|
|
@ -105,10 +105,11 @@ define([
|
||||||
},
|
},
|
||||||
|
|
||||||
onWorkbookClick: function(state) {
|
onWorkbookClick: function(state) {
|
||||||
|
if (state) {
|
||||||
var me = this,
|
var me = this,
|
||||||
win = new Common.Views.PasswordDialog({
|
win = new Common.Views.PasswordDialog({
|
||||||
api: me.api,
|
api: me.api,
|
||||||
txtTitle: me.view.txtWBTitle,
|
title: me.view.txtWBTitle,
|
||||||
txtDescription: me.view.txtWBDescription,
|
txtDescription: me.view.txtWBDescription,
|
||||||
passwordOptional: true,
|
passwordOptional: true,
|
||||||
height: 291,
|
height: 291,
|
||||||
|
@ -126,9 +127,50 @@ define([
|
||||||
});
|
});
|
||||||
|
|
||||||
win.show();
|
win.show();
|
||||||
|
} else {
|
||||||
|
var me = this,
|
||||||
|
win = new Common.Views.OpenDialog({
|
||||||
|
title: me.view.txtWBUnlockTitle,
|
||||||
|
closable: true,
|
||||||
|
type: Common.Utils.importTextType.DRM,
|
||||||
|
txtOpenFile: me.view.txtWBUnlockDescription,
|
||||||
|
validatePwd: false,
|
||||||
|
handler: function (result, value) {
|
||||||
|
if (result == 'ok') {
|
||||||
|
if (me.api) {
|
||||||
|
me.api.asc_setProtectedWorkbook(me.api.asc_getProtectedWorkbook());
|
||||||
|
}
|
||||||
|
Common.NotificationCenter.trigger('edit:complete');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
win.show();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
onSheetClick: function(state) {
|
onSheetClick: function(state) {
|
||||||
|
if (state) {
|
||||||
|
|
||||||
|
} else {
|
||||||
|
var me = this,
|
||||||
|
win = new Common.Views.OpenDialog({
|
||||||
|
title: me.view.txtSheetUnlockTitle,
|
||||||
|
closable: true,
|
||||||
|
type: Common.Utils.importTextType.DRM,
|
||||||
|
txtOpenFile: me.view.txtSheetUnlockDescription,
|
||||||
|
validatePwd: false,
|
||||||
|
handler: function (result, value) {
|
||||||
|
if (result == 'ok') {
|
||||||
|
if (me.api) {
|
||||||
|
}
|
||||||
|
Common.NotificationCenter.trigger('edit:complete');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
win.show();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
onRangesClick: function() {
|
onRangesClick: function() {
|
||||||
|
|
|
@ -212,7 +212,11 @@ define([
|
||||||
txtHiddenFormula: 'Hidden Formulas',
|
txtHiddenFormula: 'Hidden Formulas',
|
||||||
txtProtect: 'Protect',
|
txtProtect: 'Protect',
|
||||||
txtWBDescription: 'To prevent other users from viewing hidden worksheets, adding, moving, deleting, or hiding worksheets and renaming worksheets, you can protect the structure of your workbook with a password.',
|
txtWBDescription: 'To prevent other users from viewing hidden worksheets, adding, moving, deleting, or hiding worksheets and renaming worksheets, you can protect the structure of your workbook with a password.',
|
||||||
txtWBTitle: 'Protect Workbook structure'
|
txtWBTitle: 'Protect Workbook structure',
|
||||||
|
txtWBUnlockTitle: 'Unprotect Workbook',
|
||||||
|
txtWBUnlockDescription: 'Enter a password to unprotect workbook',
|
||||||
|
txtSheetUnlockTitle: 'Unprotect Sheet',
|
||||||
|
txtSheetUnlockDescription: 'Enter a password to unprotect sheet'
|
||||||
}
|
}
|
||||||
}()), SSE.Views.WBProtection || {}));
|
}()), SSE.Views.WBProtection || {}));
|
||||||
});
|
});
|
Loading…
Reference in a new issue