diff --git a/apps/documenteditor/main/app/template/FileMenu.template b/apps/documenteditor/main/app/template/FileMenu.template index d1ed92b31..8ec3a1927 100644 --- a/apps/documenteditor/main/app/template/FileMenu.template +++ b/apps/documenteditor/main/app/template/FileMenu.template @@ -8,6 +8,7 @@
  • +
  • @@ -30,4 +31,5 @@
    +
    \ No newline at end of file diff --git a/apps/documenteditor/main/app/view/FileMenu.js b/apps/documenteditor/main/app/view/FileMenu.js index 542e822a5..9e3deabe8 100644 --- a/apps/documenteditor/main/app/view/FileMenu.js +++ b/apps/documenteditor/main/app/view/FileMenu.js @@ -168,6 +168,12 @@ define([ this.miSaveAs, this.miPrint, this.miRename, + new Common.UI.MenuItem({ + el : $('#fm-btn-protect',this.el), + action : 'protect', + caption : this.btnProtectCaption, + canFocused: false + }), this.miRecent, this.miNew, new Common.UI.MenuItem({ @@ -235,6 +241,8 @@ define([ this.miPrint[this.mode.canPrint?'show':'hide'](); this.miRename[(this.mode.canRename && !this.mode.isDesktopApp) ?'show':'hide'](); this.miRename.$el.find('+.devider')[!this.mode.isDisconnected?'show':'hide'](); + this.items[7][(this.mode.isDesktopApp) ?'show':'hide'](); + this.items[7].$el.find('+.devider')[!this.mode.isDisconnected?'show':'hide'](); this.miRecent[this.mode.canOpenRecent?'show':'hide'](); this.miNew[this.mode.canCreateNew?'show':'hide'](); this.miNew.$el.find('+.devider')[this.mode.canCreateNew?'show':'hide'](); @@ -272,6 +280,7 @@ define([ if (this.mode.isDesktopApp) { // this.$el.find('#fm-btn-back').hide(); + this.panels['protect'] = (new DE.Views.FileMenuPanels.ProtectDoc({menu:this})).render(); } if (this.mode.canDownload) { @@ -360,6 +369,7 @@ define([ btnSaveAsCaption : 'Save as', textDownload : 'Download', btnRenameCaption : 'Rename...', - btnCloseMenuCaption : 'Close Menu' + btnCloseMenuCaption : 'Close Menu', + btnProtectCaption: 'Protect\\Sign' }, DE.Views.FileMenu || {})); }); diff --git a/apps/documenteditor/main/app/view/FileMenuPanels.js b/apps/documenteditor/main/app/view/FileMenuPanels.js index a2953db42..774bdd903 100644 --- a/apps/documenteditor/main/app/view/FileMenuPanels.js +++ b/apps/documenteditor/main/app/view/FileMenuPanels.js @@ -1083,4 +1083,83 @@ define([ } } }); + + DE.Views.FileMenuPanels.ProtectDoc = Common.UI.BaseView.extend(_.extend({ + el: '#panel-protect', + menu: undefined, + + template: _.template([ + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '
    ' + ].join('')), + + initialize: function(options) { + Common.UI.BaseView.prototype.initialize.call(this,arguments); + + this.menu = options.menu; + }, + + render: function() { + $(this.el).html(this.template({scope: this})); + + this.btnFinal = new Common.UI.Button({ + el: '#fms-btn-final' + }); + this.btnFinal.on('click', _.bind(this.markAsFinal, this)); + + this.btnAddInvisibleSign = new Common.UI.Button({ + el: '#fms-btn-invisible-sign' + }); + this.btnAddInvisibleSign.on('click', _.bind(this.addInvisibleSign, this)); + + this.btnAddVisibleSign = new Common.UI.Button({ + el: '#fms-btn-visible-sign' + }); + this.btnAddVisibleSign.on('click', _.bind(this.addVisibleSign, this)); + + if (_.isUndefined(this.scroller)) { + this.scroller = new Common.UI.Scroller({ + el: $(this.el), + suppressScrollX: true + }); + } + + return this; + }, + + show: function() { + Common.UI.BaseView.prototype.show.call(this,arguments); + }, + + setMode: function(mode) { + this.mode = mode; + }, + + markAsFinal: function() { + }, + + addInvisibleSign: function() { + }, + + addVisibleSign: function() { + }, + + strProtect: 'Protect Document', + strMarkAsFinal: 'Mark as final', + strInvisibleSign: 'Add invisible digital signature', + strVisibleSign: 'Add visible signature' + + + }, DE.Views.FileMenuPanels.ProtectDoc || {})); + }); diff --git a/apps/documenteditor/main/resources/less/leftmenu.less b/apps/documenteditor/main/resources/less/leftmenu.less index f838d62b9..a3562b491 100644 --- a/apps/documenteditor/main/resources/less/leftmenu.less +++ b/apps/documenteditor/main/resources/less/leftmenu.less @@ -77,4 +77,19 @@ button.notify .btn-menu-comments {background-position: -0*@toolbar-icon-size -60 -webkit-transform: rotate(180deg); -o-transform: rotate(180deg); transform: rotate(180deg); +} + +#panel-protect { + #file-menu-panel & { + padding: 30px 30px; + } + + table { + margin: 20px 0; + width: 100%; + + td { + padding: 10px 0; + } + } } \ No newline at end of file