From c3fc27031f503e2021699d0ba3347efb8dadd4fa Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Fri, 2 Apr 2021 23:04:37 +0300 Subject: [PATCH] [PE] [DE] Draw list preview in sdk --- .../main/app/controller/Main.js | 6 ++- .../main/app/controller/Toolbar.js | 13 ++++++ .../main/app/view/Toolbar.js | 40 +++++++++---------- apps/presentationeditor/main/locale/en.json | 1 + .../main/resources/less/toolbar.less | 6 ++- 5 files changed, 43 insertions(+), 23 deletions(-) diff --git a/apps/presentationeditor/main/app/controller/Main.js b/apps/presentationeditor/main/app/controller/Main.js index f3468f5cd7..297207e660 100644 --- a/apps/presentationeditor/main/app/controller/Main.js +++ b/apps/presentationeditor/main/app/controller/Main.js @@ -123,7 +123,8 @@ define([ 'Slide title': this.txtSlideTitle, 'Loading': this.txtLoading, 'Click to add notes': this.txtAddNotes, - 'Click to add first slide': this.txtAddFirstSlide + 'Click to add first slide': this.txtAddFirstSlide, + 'None': this.txtNone }; themeNames.forEach(function(item){ @@ -2675,7 +2676,8 @@ define([ textLongName: 'Enter a name that is less than 128 characters.', textGuest: 'Guest', txtErrorLoadHistory: 'Loading history failed', - leavePageTextOnClose: 'All unsaved changes in this document will be lost.
Click \'Cancel\' then \'Save\' to save them. Click \'OK\' to discard all the unsaved changes.' + leavePageTextOnClose: 'All unsaved changes in this document will be lost.
Click \'Cancel\' then \'Save\' to save them. Click \'OK\' to discard all the unsaved changes.', + txtNone: 'None' } })(), PE.Controllers.Main || {})) }); diff --git a/apps/presentationeditor/main/app/controller/Toolbar.js b/apps/presentationeditor/main/app/controller/Toolbar.js index 675e42688e..836fabc56f 100644 --- a/apps/presentationeditor/main/app/controller/Toolbar.js +++ b/apps/presentationeditor/main/app/controller/Toolbar.js @@ -298,6 +298,8 @@ define([ toolbar.cmbFontSize.on('combo:focusin', _.bind(this.onComboOpen, this, false)); toolbar.mnuMarkersPicker.on('item:click', _.bind(this.onSelectBullets, this, toolbar.btnMarkers)); toolbar.mnuNumbersPicker.on('item:click', _.bind(this.onSelectBullets, this, toolbar.btnNumbers)); + toolbar.btnMarkers.menu.on('show:after', _.bind(this.onListShowAfter, this, 0, toolbar.mnuMarkersPicker)); + toolbar.btnNumbers.menu.on('show:after', _.bind(this.onListShowAfter, this, 1, toolbar.mnuNumbersPicker)); toolbar.btnFontColor.on('click', _.bind(this.onBtnFontColor, this)); toolbar.mnuFontColorPicker.on('select', _.bind(this.onSelectFontColor, this)); $('#id-toolbar-menu-new-fontcolor').on('click', _.bind(this.onNewFontColor, this)); @@ -1301,6 +1303,17 @@ define([ } }, + onListShowAfter: function(type, picker) { + var store = picker.store; + var arr = []; + store.each(function(item){ + arr.push(item.get('id')); + }); + if (this.api && this.api.SetDrawImagePreviewBulletForMenu) { + this.api.SetDrawImagePreviewBulletForMenu(arr, type); + } + }, + onSelectBullets: function(btn, picker, itemView, record) { var rawData = {}, isPickerSelect = _.isFunction(record.toJSON); diff --git a/apps/presentationeditor/main/app/view/Toolbar.js b/apps/presentationeditor/main/app/view/Toolbar.js index a4aec78b0b..813ccc2186 100644 --- a/apps/presentationeditor/main/app/view/Toolbar.js +++ b/apps/presentationeditor/main/app/view/Toolbar.js @@ -1232,7 +1232,7 @@ define([ new Common.UI.Menu({ cls: 'shifted-left', items: [ - {template: _.template('')}, + {template: _.template('')}, this.mnuNumberSettings = new Common.UI.MenuItem({ caption: this.textListSettings, value: 'settings' @@ -1303,17 +1303,17 @@ define([ restoreHeight: 138, allowScrollbar: false, store: new Common.UI.DataViewStore([ - {offsety: 0, data: {type: 0, subtype: -1}}, - {offsety: 38, data: {type: 0, subtype: 1}}, - {offsety: 76, data: {type: 0, subtype: 2}}, - {offsety: 114, data: {type: 0, subtype: 3}}, - {offsety: 152, data: {type: 0, subtype: 4}}, - {offsety: 190, data: {type: 0, subtype: 5}}, - {offsety: 228, data: {type: 0, subtype: 6}}, - {offsety: 266, data: {type: 0, subtype: 7}}, - {offsety: 684, data: {type: 0, subtype: 8}} + {id: 'id-markers-' + Common.UI.getId(), data: {type: 0, subtype: -1}}, + {id: 'id-markers-' + Common.UI.getId(), data: {type: 0, subtype: 1}}, + {id: 'id-markers-' + Common.UI.getId(), data: {type: 0, subtype: 2}}, + {id: 'id-markers-' + Common.UI.getId(), data: {type: 0, subtype: 3}}, + {id: 'id-markers-' + Common.UI.getId(), data: {type: 0, subtype: 4}}, + {id: 'id-markers-' + Common.UI.getId(), data: {type: 0, subtype: 5}}, + {id: 'id-markers-' + Common.UI.getId(), data: {type: 0, subtype: 6}}, + {id: 'id-markers-' + Common.UI.getId(), data: {type: 0, subtype: 7}}, + {id: 'id-markers-' + Common.UI.getId(), data: {type: 0, subtype: 8}} ]), - itemTemplate: _.template('
') + itemTemplate: _.template('
') }); _conf && this.mnuMarkersPicker.selectByIndex(_conf.index, true); @@ -1324,16 +1324,16 @@ define([ restoreHeight: 92, allowScrollbar: false, store: new Common.UI.DataViewStore([ - {offsety: 0, data: {type: 1, subtype: -1}}, - {offsety: 570, data: {type: 1, subtype: 4}}, - {offsety: 532, data: {type: 1, subtype: 5}}, - {offsety: 608, data: {type: 1, subtype: 6}}, - {offsety: 418, data: {type: 1, subtype: 1}}, - {offsety: 456, data: {type: 1, subtype: 2}}, - {offsety: 494, data: {type: 1, subtype: 3}}, - {offsety: 646, data: {type: 1, subtype: 7}} + {id: 'id-numbers-' + Common.UI.getId(), data: {type: 1, subtype: -1}}, + {id: 'id-numbers-' + Common.UI.getId(), data: {type: 1, subtype: 4}}, + {id: 'id-numbers-' + Common.UI.getId(), data: {type: 1, subtype: 5}}, + {id: 'id-numbers-' + Common.UI.getId(), data: {type: 1, subtype: 6}}, + {id: 'id-numbers-' + Common.UI.getId(), data: {type: 1, subtype: 1}}, + {id: 'id-numbers-' + Common.UI.getId(), data: {type: 1, subtype: 2}}, + {id: 'id-numbers-' + Common.UI.getId(), data: {type: 1, subtype: 3}}, + {id: 'id-numbers-' + Common.UI.getId(), data: {type: 1, subtype: 7}} ]), - itemTemplate: _.template('
') + itemTemplate: _.template('
') }); _conf && this.mnuNumbersPicker.selectByIndex(_conf.index, true); diff --git a/apps/presentationeditor/main/locale/en.json b/apps/presentationeditor/main/locale/en.json index c9e2481d13..e9e664ac11 100644 --- a/apps/presentationeditor/main/locale/en.json +++ b/apps/presentationeditor/main/locale/en.json @@ -713,6 +713,7 @@ "PE.Controllers.Main.warnProcessRightsChange": "You have been denied the right to edit the file.", "PE.Controllers.Main.txtErrorLoadHistory": "History loading failed", "PE.Controllers.Main.leavePageTextOnClose": "All unsaved changes in this presentation will be lost.
Click \"Cancel\" then \"Save\" to save them. Click \"OK\" to discard all the unsaved changes.", + "PE.Controllers.Main.txtNone": "None", "PE.Controllers.Statusbar.zoomText": "Zoom {0}%", "PE.Controllers.Toolbar.confirmAddFontName": "The font you are going to save is not available on the current device.
The text style will be displayed using one of the system fonts, the saved font will be used when it is available.
Do you want to continue?", "PE.Controllers.Toolbar.textAccent": "Accents", diff --git a/apps/presentationeditor/main/resources/less/toolbar.less b/apps/presentationeditor/main/resources/less/toolbar.less index 5f5516b95a..103f3132f9 100644 --- a/apps/presentationeditor/main/resources/less/toolbar.less +++ b/apps/presentationeditor/main/resources/less/toolbar.less @@ -51,11 +51,15 @@ } .item-markerlist { - .background-ximage-v2('toolbar/bullets-and-numbering.png', 38px); width: 38px; height: 38px; } +.item-multilevellist { + width: 80px; + height: 80px; +} + // menu zoom .menu-zoom { line-height: @line-height-base;