diff --git a/apps/common/main/lib/component/Window.js b/apps/common/main/lib/component/Window.js index 76432c6f2..606e98736 100644 --- a/apps/common/main/lib/component/Window.js +++ b/apps/common/main/lib/component/Window.js @@ -63,6 +63,12 @@ * @cfg {Boolean} animate * Makes the window to animate while showing or hiding * + * @cfg {Object} buttons + * Use an array for predefined buttons (ok, cancel, yes, no): @example ['yes', 'no'] + * Use a named array for the custom buttons: {value: caption, ...} + * @param {String} value will be returned in callback function + * @param {String} caption + * * Methods * * @method show @@ -106,12 +112,6 @@ * @window Common.UI.warning * Shows warning message. * @cfg {String} msg - * @cfg {Object} buttons - * Use an array for predefined buttons (ok, cancel, yes, no): @example ['yes', 'no'] - * Use a named array for the custom buttons: {value: caption, ...} - * @param {String} value will be returned in callback function - * @param {String} caption - * * @cfg {Function} callback * @param {String} button * If the window is closed via shortcut or header's close tool, the 'button' will be 'close' @@ -167,7 +167,15 @@ define([ '
<%= title %>
' + '' + '<% } %>' + - '
<%= tpl %>
' + + '
<%= tpl %>' + + '<% if (typeof (buttons) !== "undefined" && _.size(buttons) > 0) { %>' + + '' + + '<% } %>' + + '
' + ''; function _getMask() { @@ -399,31 +407,9 @@ define([ Common.UI.alert = function(options) { var me = this.Window.prototype; - var arrBtns = {ok: me.okButtonText, cancel: me.cancelButtonText, - yes: me.yesButtonText, no: me.noButtonText, - close: me.closeButtonText}; if (!options.buttons) { - options.buttons = {}; - options.buttons['ok'] = {text: arrBtns['ok'], cls: 'primary'}; - } else { - if (_.isArray(options.buttons)) { - if (options.primary==undefined) - options.primary = 'ok'; - var newBtns = {}; - _.each(options.buttons, function(b){ - if (typeof(b) == 'object') { - if (b.value !== undefined) - newBtns[b.value] = {text: b.caption, cls: 'custom' + ((b.primary || options.primary==b.value) ? ' primary' : '')}; - } else { - newBtns[b] = {text: (b=='custom') ? options.customButtonText : arrBtns[b], cls: (options.primary==b) ? 'primary' : ''}; - if (b=='custom') - newBtns[b].cls += ' custom'; - } - }); - - options.buttons = newBtns; - } + options.buttons = ['ok']; } options.dontshow = options.dontshow || false; @@ -435,14 +421,7 @@ define([ '<% if (dontshow) { %>
<% } %>' + '' + '' + - '<% if (dontshow) { %>
<% } %>' + - '<% if (_.size(buttons) > 0) { %>' + - '' + - '<% } %>'; + '<% if (dontshow) { %>
<% } %>'; _.extend(options, { cls: 'alert', @@ -500,7 +479,9 @@ define([ win.on({ 'render:after': function(obj){ - obj.getChild('.footer .dlg-btn').on('click', onBtnClick); + var footer = obj.getChild('.footer'); + options.dontshow && footer.addClass('dontshow'); + footer.find('.dlg-btn').on('click', onBtnClick); chDontShow = new Common.UI.CheckBox({ el: win.$window.find('.dont-show-checkbox'), labelText: win.textDontShow @@ -572,6 +553,29 @@ define([ this.initConfig = {}; this.binding = {}; + var arrBtns = {ok: this.okButtonText, cancel: this.cancelButtonText, + yes: this.yesButtonText, no: this.noButtonText, + close: this.closeButtonText}; + + if (options.buttons && _.isArray(options.buttons)) { + if (options.primary==undefined) + options.primary = 'ok'; + var newBtns = {}; + _.each(options.buttons, function(b){ + if (typeof(b) == 'object') { + if (b.value !== undefined) + newBtns[b.value] = {text: b.caption, cls: 'custom' + ((b.primary || options.primary==b.value) ? ' primary' : '')}; + } else { + newBtns[b] = {text: (b=='custom') ? options.customButtonText : arrBtns[b], cls: (options.primary==b) ? 'primary' : ''}; + if (b=='custom') + newBtns[b].cls += ' custom'; + } + }); + + options.buttons = newBtns; + options.footerCls = options.footerCls || 'center'; + } + _.extend(this.initConfig, config, options || {}); !this.initConfig.id && (this.initConfig.id = 'window-' + this.cid); @@ -632,6 +636,8 @@ define([ }; Common.NotificationCenter.on('window:close', this.binding.winclose); + this.initConfig.footerCls && this.$window.find('.footer').addClass(this.initConfig.footerCls); + this.fireEvent('render:after',this); return this; }, diff --git a/apps/common/main/lib/view/AdvancedSettingsWindow.js b/apps/common/main/lib/view/AdvancedSettingsWindow.js index 7f1ea7609..153bf86b2 100644 --- a/apps/common/main/lib/view/AdvancedSettingsWindow.js +++ b/apps/common/main/lib/view/AdvancedSettingsWindow.js @@ -51,7 +51,8 @@ define([ cls: 'advanced-settings-dlg', toggleGroup: 'advanced-settings-group', contentTemplate: '', - items: [] + items: [], + buttons: ['ok', 'cancel'] }, options); this.template = options.template || [ @@ -64,11 +65,7 @@ define([ '
', '
' + _options.contentTemplate + '
', '
', - '
', - '' + '
' ].join(''); _options.tpl = _.template(this.template)(_options); diff --git a/apps/common/main/lib/view/CopyWarningDialog.js b/apps/common/main/lib/view/CopyWarningDialog.js index 1b5d6009c..95b1150b0 100644 --- a/apps/common/main/lib/view/CopyWarningDialog.js +++ b/apps/common/main/lib/view/CopyWarningDialog.js @@ -50,12 +50,14 @@ define([ options: { width : 500, height : 325, - cls : 'modal-dlg copy-warning' + cls : 'modal-dlg copy-warning', + buttons: ['ok'] }, initialize : function(options) { _.extend(this.options, { - title: this.textTitle + title: this.textTitle, + buttons: ['ok'] }, options || {}); this.template = [ @@ -77,10 +79,7 @@ define([ '
', '
', '
', - '
', - '' + '
' ].join(''); this.options.tpl = _.template(this.template)(this.options); diff --git a/apps/common/main/lib/view/ExternalDiagramEditor.js b/apps/common/main/lib/view/ExternalDiagramEditor.js index 6ad1e7317..c5f26a44c 100644 --- a/apps/common/main/lib/view/ExternalDiagramEditor.js +++ b/apps/common/main/lib/view/ExternalDiagramEditor.js @@ -61,7 +61,7 @@ define([ '
', '
', '' ].join(''); diff --git a/apps/common/main/lib/view/ExternalMergeEditor.js b/apps/common/main/lib/view/ExternalMergeEditor.js index 795956662..3fd1e79f1 100644 --- a/apps/common/main/lib/view/ExternalMergeEditor.js +++ b/apps/common/main/lib/view/ExternalMergeEditor.js @@ -61,7 +61,7 @@ define([ '
', '
', '' ].join(''); diff --git a/apps/common/main/lib/view/ImageFromUrlDialog.js b/apps/common/main/lib/view/ImageFromUrlDialog.js index 38d77645b..0f8cfff5e 100644 --- a/apps/common/main/lib/view/ImageFromUrlDialog.js +++ b/apps/common/main/lib/view/ImageFromUrlDialog.js @@ -46,7 +46,9 @@ define([ options: { width: 330, header: false, - cls: 'modal-dlg' + cls: 'modal-dlg', + buttons: ['ok', 'cancel'], + footerCls: 'right' }, initialize : function(options) { @@ -58,10 +60,6 @@ define([ '', '
', '
', - '
', - '' ].join(''); diff --git a/apps/common/main/lib/view/InsertTableDialog.js b/apps/common/main/lib/view/InsertTableDialog.js index b7fed9ba8..b4b65d017 100644 --- a/apps/common/main/lib/view/InsertTableDialog.js +++ b/apps/common/main/lib/view/InsertTableDialog.js @@ -51,7 +51,8 @@ define([ height: 156, style: 'min-width: 230px;', cls: 'modal-dlg', - split: false + split: false, + buttons: ['ok', 'cancel'] }, initialize : function(options) { @@ -67,10 +68,6 @@ define([ '
', '
', '
', - '
', - '' ].join(''); diff --git a/apps/common/main/lib/view/LanguageDialog.js b/apps/common/main/lib/view/LanguageDialog.js index a2ed576e9..ad4216a15 100644 --- a/apps/common/main/lib/view/LanguageDialog.js +++ b/apps/common/main/lib/view/LanguageDialog.js @@ -51,25 +51,22 @@ define([ options: { header: false, width: 350, - cls: 'modal-dlg' + cls: 'modal-dlg', + buttons: ['ok', 'cancel'], + footerCls: 'right' }, template: '
' + - '
' + - '' + - '
' + - '
' + - '
' + - '
' + - '', + '
' + + '' + + '
' + + '
' + + '
' + + '
', initialize : function(options) { _.extend(this.options, options || {}, { - label: this.labelSelect, - btns: {ok: this.okButtonText, cancel: this.cancelButtonText} + label: this.labelSelect }); this.options.tpl = _.template(this.template)(this.options); diff --git a/apps/common/main/lib/view/PasswordDialog.js b/apps/common/main/lib/view/PasswordDialog.js index 2c7c92be1..09ed9007c 100644 --- a/apps/common/main/lib/view/PasswordDialog.js +++ b/apps/common/main/lib/view/PasswordDialog.js @@ -59,7 +59,8 @@ define([ header : true, cls : 'modal-dlg', contentTemplate : '', - title : t.txtTitle + title : t.txtTitle, + buttons: ['ok', 'cancel'] }, options); @@ -77,11 +78,7 @@ define([ '', '
', '', - '
', - '' + '
' ].join(''); this.handler = options.handler; diff --git a/apps/common/main/lib/view/Plugins.js b/apps/common/main/lib/view/Plugins.js index 36c163b9b..aa9e4a96e 100644 --- a/apps/common/main/lib/view/Plugins.js +++ b/apps/common/main/lib/view/Plugins.js @@ -368,7 +368,7 @@ define([ '
', '', '<% } %>' diff --git a/apps/common/main/lib/view/RenameDialog.js b/apps/common/main/lib/view/RenameDialog.js index 7c6df91e7..023cff6ba 100644 --- a/apps/common/main/lib/view/RenameDialog.js +++ b/apps/common/main/lib/view/RenameDialog.js @@ -47,7 +47,9 @@ define([ width: 330, header: false, cls: 'modal-dlg', - filename: '' + filename: '', + buttons: ['ok', 'cancel'], + footerCls: 'right' }, initialize : function(options) { @@ -59,10 +61,6 @@ define([ '', '
', '
', - '
', - '' ].join(''); diff --git a/apps/common/main/lib/view/SearchDialog.js b/apps/common/main/lib/view/SearchDialog.js index dbad485c9..683a89eb1 100644 --- a/apps/common/main/lib/view/SearchDialog.js +++ b/apps/common/main/lib/view/SearchDialog.js @@ -98,10 +98,10 @@ '
', '
', '' ].join(''); diff --git a/apps/common/main/lib/view/SignDialog.js b/apps/common/main/lib/view/SignDialog.js index 9905af9c6..73e64e658 100644 --- a/apps/common/main/lib/view/SignDialog.js +++ b/apps/common/main/lib/view/SignDialog.js @@ -53,7 +53,8 @@ define([ options: { width: 370, style: 'min-width: 350px;', - cls: 'modal-dlg' + cls: 'modal-dlg', + buttons: ['ok', 'cancel'] }, initialize : function(options) { @@ -106,10 +107,6 @@ define([ '', '', - '' ].join(''); diff --git a/apps/common/main/lib/view/SignSettingsDialog.js b/apps/common/main/lib/view/SignSettingsDialog.js index bb761ece4..d402926ac 100644 --- a/apps/common/main/lib/view/SignSettingsDialog.js +++ b/apps/common/main/lib/view/SignSettingsDialog.js @@ -86,7 +86,7 @@ define([ '
', '
', '', '', - '', - '' ].join('') }, options); diff --git a/apps/documenteditor/main/app/view/CustomColumnsDialog.js b/apps/documenteditor/main/app/view/CustomColumnsDialog.js index 2a8a9521a..57b1e02df 100644 --- a/apps/documenteditor/main/app/view/CustomColumnsDialog.js +++ b/apps/documenteditor/main/app/view/CustomColumnsDialog.js @@ -49,7 +49,8 @@ define([ width: 300, header: true, style: 'min-width: 216px;', - cls: 'modal-dlg' + cls: 'modal-dlg', + buttons: ['ok', 'cancel'] }, initialize : function(options) { @@ -69,11 +70,7 @@ define([ '
', '', '', - '
', - '' + '
' ].join(''); this.options.tpl = _.template(this.template)(this.options); diff --git a/apps/documenteditor/main/app/view/HyperlinkSettingsDialog.js b/apps/documenteditor/main/app/view/HyperlinkSettingsDialog.js index 48a7bdfb3..a51640df5 100644 --- a/apps/documenteditor/main/app/view/HyperlinkSettingsDialog.js +++ b/apps/documenteditor/main/app/view/HyperlinkSettingsDialog.js @@ -57,7 +57,9 @@ define([ options: { width: 350, style: 'min-width: 230px;', - cls: 'modal-dlg' + cls: 'modal-dlg', + buttons: ['ok', 'cancel'], + footerCls: 'right' }, initialize : function(options) { @@ -88,10 +90,6 @@ define([ '', '
', '', - '
', - '' ].join(''); diff --git a/apps/documenteditor/main/app/view/MailMergeEmailDlg.js b/apps/documenteditor/main/app/view/MailMergeEmailDlg.js index 7cd7d5212..279b2afe5 100644 --- a/apps/documenteditor/main/app/view/MailMergeEmailDlg.js +++ b/apps/documenteditor/main/app/view/MailMergeEmailDlg.js @@ -57,11 +57,7 @@ define([ 'text!documenteditor/main/app/template/MailMergeEmailDlg.template', '
', '
' + _.template(contentTemplate)({scope: this}) + '
', '
', - '
', - '' + '
' ].join('') }, options); Common.Views.AdvancedSettingsWindow.prototype.initialize.call(this, this.options); diff --git a/apps/documenteditor/main/app/view/NoteSettingsDialog.js b/apps/documenteditor/main/app/view/NoteSettingsDialog.js index 80b6ca468..2c4bfc099 100644 --- a/apps/documenteditor/main/app/view/NoteSettingsDialog.js +++ b/apps/documenteditor/main/app/view/NoteSettingsDialog.js @@ -49,7 +49,8 @@ define([ DE.Views.NoteSettingsDialog = Common.Views.AdvancedSettingsWindow.extend(_.extend({ options: { contentWidth: 300, - height: 380 + height: 380, + buttons: null }, initialize : function(options) { @@ -122,8 +123,8 @@ define([ '
', '
', '' ].join('') diff --git a/apps/documenteditor/main/app/view/NumberingValueDialog.js b/apps/documenteditor/main/app/view/NumberingValueDialog.js index 8edf75123..c7c31cc22 100644 --- a/apps/documenteditor/main/app/view/NumberingValueDialog.js +++ b/apps/documenteditor/main/app/view/NumberingValueDialog.js @@ -48,7 +48,8 @@ define([ width: 214, header: true, style: 'min-width: 214px;', - cls: 'modal-dlg' + cls: 'modal-dlg', + buttons: ['ok', 'cancel'] }, initialize : function(options) { @@ -61,9 +62,6 @@ define([ '
', '
', '
', - '' ].join(''); diff --git a/apps/documenteditor/main/app/view/PageMarginsDialog.js b/apps/documenteditor/main/app/view/PageMarginsDialog.js index ce293b263..b1c6f83cb 100644 --- a/apps/documenteditor/main/app/view/PageMarginsDialog.js +++ b/apps/documenteditor/main/app/view/PageMarginsDialog.js @@ -49,7 +49,8 @@ define([ header: true, style: 'min-width: 216px;', cls: 'modal-dlg', - id: 'window-page-margins' + id: 'window-page-margins', + buttons: ['ok', 'cancel'] }, initialize : function(options) { @@ -82,11 +83,7 @@ define([ '', '', '', - '
', - '' + '
' ].join(''); this.options.tpl = _.template(this.template)(this.options); diff --git a/apps/documenteditor/main/app/view/PageSizeDialog.js b/apps/documenteditor/main/app/view/PageSizeDialog.js index 193b2330a..ff026d3c8 100644 --- a/apps/documenteditor/main/app/view/PageSizeDialog.js +++ b/apps/documenteditor/main/app/view/PageSizeDialog.js @@ -49,7 +49,8 @@ define([ header: true, style: 'min-width: 216px;', cls: 'modal-dlg', - id: 'window-page-size' + id: 'window-page-size', + buttons: ['ok', 'cancel'] }, initialize : function(options) { @@ -78,11 +79,7 @@ define([ '', '', '
', - '
', - '' + '
' ].join(''); this.options.tpl = _.template(this.template)(this.options); diff --git a/apps/documenteditor/main/app/view/StyleTitleDialog.js b/apps/documenteditor/main/app/view/StyleTitleDialog.js index 238efe689..31b846a3f 100644 --- a/apps/documenteditor/main/app/view/StyleTitleDialog.js +++ b/apps/documenteditor/main/app/view/StyleTitleDialog.js @@ -47,7 +47,9 @@ define([ width: 350, height: 200, style: 'min-width: 230px;', - cls: 'modal-dlg' + cls: 'modal-dlg', + buttons: ['ok', 'cancel'], + footerCls: 'right' }, initialize : function(options) { @@ -62,11 +64,6 @@ define([ '', '
', - '
', - - '' ].join(''); diff --git a/apps/documenteditor/main/app/view/TableFormulaDialog.js b/apps/documenteditor/main/app/view/TableFormulaDialog.js index 2f658e31a..ec6900ab3 100644 --- a/apps/documenteditor/main/app/view/TableFormulaDialog.js +++ b/apps/documenteditor/main/app/view/TableFormulaDialog.js @@ -47,7 +47,9 @@ define([ options: { width: 300, style: 'min-width: 230px;', - cls: 'modal-dlg' + cls: 'modal-dlg', + buttons: ['ok', 'cancel'], + footerCls: 'right' }, initialize : function(options) { @@ -69,11 +71,7 @@ define([ '
', '
', '
', - '
', - '' + '' ].join(''); this.options.tpl = _.template(this.template)(this.options); diff --git a/apps/documenteditor/main/app/view/TableOfContentsSettings.js b/apps/documenteditor/main/app/view/TableOfContentsSettings.js index d71c3a12f..ea5f9d04c 100644 --- a/apps/documenteditor/main/app/view/TableOfContentsSettings.js +++ b/apps/documenteditor/main/app/view/TableOfContentsSettings.js @@ -120,11 +120,7 @@ define([ '', '', '', - '
', - '' + '
' ].join('') }, options); diff --git a/apps/documenteditor/main/app/view/WatermarkSettingsDialog.js b/apps/documenteditor/main/app/view/WatermarkSettingsDialog.js index 1bf607bdb..d6aaaab40 100644 --- a/apps/documenteditor/main/app/view/WatermarkSettingsDialog.js +++ b/apps/documenteditor/main/app/view/WatermarkSettingsDialog.js @@ -93,10 +93,6 @@ define(['text!documenteditor/main/app/template/WatermarkSettings.template', template, '
', '', - '', - '' ].join('') )({ diff --git a/apps/presentationeditor/main/app/view/DateTimeDialog.js b/apps/presentationeditor/main/app/view/DateTimeDialog.js index 99ff9ba66..2f3d9a3f6 100644 --- a/apps/presentationeditor/main/app/view/DateTimeDialog.js +++ b/apps/presentationeditor/main/app/view/DateTimeDialog.js @@ -49,7 +49,8 @@ define([ options: { width: 350, style: 'min-width: 230px;', - cls: 'modal-dlg' + cls: 'modal-dlg', + buttons: ['ok', 'cancel'] }, initialize : function (options) { @@ -74,10 +75,6 @@ define([ '
', '', '', - '', - '' ].join(''); diff --git a/apps/presentationeditor/main/app/view/HeaderFooterDialog.js b/apps/presentationeditor/main/app/view/HeaderFooterDialog.js index 591583d06..779e270d5 100644 --- a/apps/presentationeditor/main/app/view/HeaderFooterDialog.js +++ b/apps/presentationeditor/main/app/view/HeaderFooterDialog.js @@ -48,7 +48,8 @@ define(['text!presentationeditor/main/app/template/HeaderFooterDialog.template', PE.Views.HeaderFooterDialog = Common.Views.AdvancedSettingsWindow.extend(_.extend({ options: { contentWidth: 360, - height: 380 + height: 380, + buttons: null }, initialize : function(options) { @@ -74,8 +75,8 @@ define(['text!presentationeditor/main/app/template/HeaderFooterDialog.template', '', '
', '' ].join('') diff --git a/apps/presentationeditor/main/app/view/HyperlinkSettingsDialog.js b/apps/presentationeditor/main/app/view/HyperlinkSettingsDialog.js index 28e280c48..deba6cf74 100644 --- a/apps/presentationeditor/main/app/view/HyperlinkSettingsDialog.js +++ b/apps/presentationeditor/main/app/view/HyperlinkSettingsDialog.js @@ -60,7 +60,9 @@ define([ width: 350, style: 'min-width: 230px;', cls: 'modal-dlg', - id: 'window-hyperlink-settings' + id: 'window-hyperlink-settings', + buttons: ['ok', 'cancel'], + footerCls: 'right' }, initialize : function(options) { @@ -95,11 +97,7 @@ define([ '
', '', '
', - '', - '
', - '' ].join(''); diff --git a/apps/presentationeditor/main/app/view/SlideSizeSettings.js b/apps/presentationeditor/main/app/view/SlideSizeSettings.js index 3016605b8..19ec636ca 100644 --- a/apps/presentationeditor/main/app/view/SlideSizeSettings.js +++ b/apps/presentationeditor/main/app/view/SlideSizeSettings.js @@ -49,7 +49,8 @@ define([ header: true, style: 'min-width: 250px;', cls: 'modal-dlg', - id: 'window-slide-size-settings' + id: 'window-slide-size-settings', + buttons: ['ok', 'cancel'] }, initialize : function(options) { @@ -80,11 +81,7 @@ define([ '', '
', '', - '
', - '' + '
' ].join(''); this.options.tpl = _.template(this.template)(this.options); diff --git a/apps/presentationeditor/main/app/view/SlideshowSettings.js b/apps/presentationeditor/main/app/view/SlideshowSettings.js index fe5b31ef6..c4e595dba 100644 --- a/apps/presentationeditor/main/app/view/SlideshowSettings.js +++ b/apps/presentationeditor/main/app/view/SlideshowSettings.js @@ -49,7 +49,8 @@ define([ header: true, style: 'min-width: 315px;', cls: 'modal-dlg', - id: 'window-slideshow-settings' + id: 'window-slideshow-settings', + buttons: ['ok', 'cancel'] }, initialize : function(options) { @@ -61,11 +62,7 @@ define([ '
', '
', '
', - '
', - '' + '
' ].join(''); this.options.tpl = _.template(this.template)(this.options); diff --git a/apps/spreadsheeteditor/main/app/view/AutoFilterDialog.js b/apps/spreadsheeteditor/main/app/view/AutoFilterDialog.js index 2e5d99884..2364b6e71 100644 --- a/apps/spreadsheeteditor/main/app/view/AutoFilterDialog.js +++ b/apps/spreadsheeteditor/main/app/view/AutoFilterDialog.js @@ -84,7 +84,7 @@ define([ '
', '
', '' ].join(''); @@ -311,7 +311,8 @@ define([ cls : 'filter-dlg', contentTemplate : '', title : t.txtTitle, - items : [] + items : [], + buttons: ['ok', 'cancel'] }, options); this.template = options.template || [ @@ -331,11 +332,7 @@ define([ '
', '
', '
', - '
', - '' + '
' ].join(''); this.api = options.api; @@ -545,7 +542,6 @@ define([ this.btnOk = new Common.UI.Button({ cls: 'btn normal dlg-btn primary', caption : this.okButtonText, - style: 'margin-right:10px;', enableToggle: false, allowDepress: false }); diff --git a/apps/spreadsheeteditor/main/app/view/CellRangeDialog.js b/apps/spreadsheeteditor/main/app/view/CellRangeDialog.js index 31991991d..196322ba3 100644 --- a/apps/spreadsheeteditor/main/app/view/CellRangeDialog.js +++ b/apps/spreadsheeteditor/main/app/view/CellRangeDialog.js @@ -51,7 +51,9 @@ define([ options: { width : 350, cls : 'modal-dlg', - modal : false + modal : false, + buttons: ['ok', 'cancel'], + footerCls: 'right' }, initialize : function(options) { @@ -62,10 +64,6 @@ define([ this.template = [ '
', '
', - '
', - '' ].join(''); diff --git a/apps/spreadsheeteditor/main/app/view/FormatSettingsDialog.js b/apps/spreadsheeteditor/main/app/view/FormatSettingsDialog.js index d3f6b5e31..aed3bc881 100644 --- a/apps/spreadsheeteditor/main/app/view/FormatSettingsDialog.js +++ b/apps/spreadsheeteditor/main/app/view/FormatSettingsDialog.js @@ -146,11 +146,7 @@ define([ '', '', '', - '
', - '' + '
' ].join('') }, options); diff --git a/apps/spreadsheeteditor/main/app/view/FormulaDialog.js b/apps/spreadsheeteditor/main/app/view/FormulaDialog.js index 415948aef..8bcd07192 100644 --- a/apps/spreadsheeteditor/main/app/view/FormulaDialog.js +++ b/apps/spreadsheeteditor/main/app/view/FormulaDialog.js @@ -62,7 +62,8 @@ define([ cls : 'formula-dlg', contentTemplate : '', title : t.txtTitle, - items : [] + items : [], + buttons: ['ok', 'cancel'] }, options); this.template = options.template || [ @@ -78,12 +79,7 @@ define([ '
', '
', - - '
', - '' + '
' ].join(''); this.api = options.api; diff --git a/apps/spreadsheeteditor/main/app/view/GroupDialog.js b/apps/spreadsheeteditor/main/app/view/GroupDialog.js index 61b01e86b..09c745004 100644 --- a/apps/spreadsheeteditor/main/app/view/GroupDialog.js +++ b/apps/spreadsheeteditor/main/app/view/GroupDialog.js @@ -47,7 +47,8 @@ define([ width: 214, header: true, style: 'min-width: 214px;', - cls: 'modal-dlg' + cls: 'modal-dlg', + buttons: ['ok', 'cancel'] }, initialize : function(options) { @@ -55,11 +56,8 @@ define([ this.template = [ '
', - '
', - '
', - '' ].join(''); diff --git a/apps/spreadsheeteditor/main/app/view/HeaderFooterDialog.js b/apps/spreadsheeteditor/main/app/view/HeaderFooterDialog.js index e9fe2b9dc..bca9495d4 100644 --- a/apps/spreadsheeteditor/main/app/view/HeaderFooterDialog.js +++ b/apps/spreadsheeteditor/main/app/view/HeaderFooterDialog.js @@ -51,7 +51,8 @@ define([ width: 647, style: 'min-width: 350px;', cls: 'modal-dlg enable-key-events', - animate: {mask: false} + animate: {mask: false}, + buttons: ['ok', 'cancel'] }, initialize : function(options) { @@ -156,10 +157,6 @@ define([ '
', '
', '
', - '', - '' ].join(''); diff --git a/apps/spreadsheeteditor/main/app/view/HyperlinkSettingsDialog.js b/apps/spreadsheeteditor/main/app/view/HyperlinkSettingsDialog.js index fdfb9bdaf..bfe086a30 100644 --- a/apps/spreadsheeteditor/main/app/view/HyperlinkSettingsDialog.js +++ b/apps/spreadsheeteditor/main/app/view/HyperlinkSettingsDialog.js @@ -53,7 +53,9 @@ define([ options: { width : 350, style : 'min-width: 230px;', - cls : 'modal-dlg' + cls : 'modal-dlg', + buttons: ['ok', 'cancel'], + footerCls: 'right' }, initialize : function(options) { @@ -91,10 +93,6 @@ define([ '', '', '', - '', - '' ].join(''); diff --git a/apps/spreadsheeteditor/main/app/view/NameManagerDlg.js b/apps/spreadsheeteditor/main/app/view/NameManagerDlg.js index bb7193210..16c0588e3 100644 --- a/apps/spreadsheeteditor/main/app/view/NameManagerDlg.js +++ b/apps/spreadsheeteditor/main/app/view/NameManagerDlg.js @@ -53,7 +53,8 @@ define([ 'text!spreadsheeteditor/main/app/template/NameManagerDlg.template', options: { alias: 'NameManagerDlg', contentWidth: 510, - height: 353 + height: 353, + buttons: null }, initialize: function (options) { diff --git a/apps/spreadsheeteditor/main/app/view/NamedRangeEditDlg.js b/apps/spreadsheeteditor/main/app/view/NamedRangeEditDlg.js index 3f8aae36f..88adbf56d 100644 --- a/apps/spreadsheeteditor/main/app/view/NamedRangeEditDlg.js +++ b/apps/spreadsheeteditor/main/app/view/NamedRangeEditDlg.js @@ -93,11 +93,7 @@ define([ '', '', '', - '
', - '' + '
' ].join('') }, options); diff --git a/apps/spreadsheeteditor/main/app/view/NamedRangePasteDlg.js b/apps/spreadsheeteditor/main/app/view/NamedRangePasteDlg.js index 298e7af56..e78ce8c08 100644 --- a/apps/spreadsheeteditor/main/app/view/NamedRangePasteDlg.js +++ b/apps/spreadsheeteditor/main/app/view/NamedRangePasteDlg.js @@ -74,11 +74,7 @@ define([ '', '', '', - '
', - '' + '
' ].join('') }, options); diff --git a/apps/spreadsheeteditor/main/app/view/PageMarginsDialog.js b/apps/spreadsheeteditor/main/app/view/PageMarginsDialog.js index 456825e6c..e1b2d95d0 100644 --- a/apps/spreadsheeteditor/main/app/view/PageMarginsDialog.js +++ b/apps/spreadsheeteditor/main/app/view/PageMarginsDialog.js @@ -49,7 +49,8 @@ define([ header: true, style: 'min-width: 216px;', cls: 'modal-dlg', - id: 'window-page-margins' + id: 'window-page-margins', + buttons: ['ok', 'cancel'] }, initialize : function(options) { @@ -82,11 +83,7 @@ define([ '', '', '', - '
', - '' + '
' ].join(''); this.options.tpl = _.template(this.template)(this.options); diff --git a/apps/spreadsheeteditor/main/app/view/PrintSettings.js b/apps/spreadsheeteditor/main/app/view/PrintSettings.js index e86b1de44..370f15983 100644 --- a/apps/spreadsheeteditor/main/app/view/PrintSettings.js +++ b/apps/spreadsheeteditor/main/app/view/PrintSettings.js @@ -51,7 +51,8 @@ define([ 'text!spreadsheeteditor/main/app/template/PrintSettings.template', options: { alias: 'PrintSettings', contentWidth: 280, - height: 475 + height: 475, + buttons: null }, initialize : function(options) { @@ -73,8 +74,8 @@ define([ 'text!spreadsheeteditor/main/app/template/PrintSettings.template', '
', '
', '' ].join('') diff --git a/apps/spreadsheeteditor/main/app/view/SetValueDialog.js b/apps/spreadsheeteditor/main/app/view/SetValueDialog.js index 6068c2dbd..d9db131d4 100644 --- a/apps/spreadsheeteditor/main/app/view/SetValueDialog.js +++ b/apps/spreadsheeteditor/main/app/view/SetValueDialog.js @@ -48,7 +48,8 @@ define([ width: 214, header: true, style: 'min-width: 214px;', - cls: 'modal-dlg' + cls: 'modal-dlg', + buttons: ['ok', 'cancel'] }, initialize : function(options) { @@ -61,9 +62,6 @@ define([ '
', '
', '
', - '' ].join(''); diff --git a/apps/spreadsheeteditor/main/app/view/Statusbar.js b/apps/spreadsheeteditor/main/app/view/Statusbar.js index 247da69e5..a3037896b 100644 --- a/apps/spreadsheeteditor/main/app/view/Statusbar.js +++ b/apps/spreadsheeteditor/main/app/view/Statusbar.js @@ -551,7 +551,9 @@ define([ options: { header: false, width: 280, - cls: 'modal-dlg' + cls: 'modal-dlg', + buttons: ['ok', 'cancel'], + footerCls: 'right' }, template: '
' + @@ -559,16 +561,11 @@ define([ '' + '
' + '
' + - '
' + - '', initialize : function(options) { _.extend(this.options, options || {}, { - label: this.labelSheetName, - btns: {ok: this.okButtonText, cancel: this.cancelButtonText} + label: this.labelSheetName }); this.options.tpl = _.template(this.template)(this.options); @@ -663,7 +660,9 @@ define([ options: { width: 270, height: 300, - cls: 'modal-dlg' + cls: 'modal-dlg', + buttons: ['ok', 'cancel'], + footerCls: 'right' }, template: '
' + @@ -671,16 +670,11 @@ define([ '' + '
' + '
' + - '
' + - '', initialize : function(options) { _.extend(this.options, options || {}, { - label: options.ismove ? this.textMoveBefore : this.textCopyBefore, - btns: {ok: this.okButtonText, cancel: this.cancelButtonText} + label: options.ismove ? this.textMoveBefore : this.textCopyBefore }); this.options.tpl = _.template(this.template)(this.options); diff --git a/apps/spreadsheeteditor/main/app/view/TableOptionsDialog.js b/apps/spreadsheeteditor/main/app/view/TableOptionsDialog.js index 5137a8005..d01cb33e3 100644 --- a/apps/spreadsheeteditor/main/app/view/TableOptionsDialog.js +++ b/apps/spreadsheeteditor/main/app/view/TableOptionsDialog.js @@ -53,7 +53,9 @@ define([ options: { width : 350, cls : 'modal-dlg', - modal : false + modal : false, + buttons: ['ok', 'cancel'], + footerCls: 'right' }, initialize : function(options) { @@ -65,10 +67,6 @@ define([ '
', '
', '
', - '
', - '' ].join(''); diff --git a/apps/spreadsheeteditor/main/app/view/ValueFieldSettingsDialog.js b/apps/spreadsheeteditor/main/app/view/ValueFieldSettingsDialog.js index 9d37d08cc..04dcae94a 100644 --- a/apps/spreadsheeteditor/main/app/view/ValueFieldSettingsDialog.js +++ b/apps/spreadsheeteditor/main/app/view/ValueFieldSettingsDialog.js @@ -108,11 +108,7 @@ define([ '
', '', '', - '
', - '' + '
' ].join('') }, options);