[PE] toolbar's new view

This commit is contained in:
Maxim Kadushkin 2017-04-20 16:34:39 +03:00
parent c618f0978f
commit a578e3c31e
16 changed files with 2301 additions and 2186 deletions

View file

@ -61,7 +61,7 @@ define([
'Common.Views.Chat': { 'Common.Views.Chat': {
'hide': _.bind(this.onHideChat, this) 'hide': _.bind(this.onHideChat, this)
}, },
'Statusbar': { 'Common.Views.Header': {
'click:users': _.bind(this.clickStatusbarUsers, this) 'click:users': _.bind(this.clickStatusbarUsers, this)
}, },
'LeftMenu': { 'LeftMenu': {
@ -83,7 +83,9 @@ define([
'recent:open': _.bind(this.onOpenRecent, this) 'recent:open': _.bind(this.onOpenRecent, this)
}, },
'Toolbar': { 'Toolbar': {
'file:settings': _.bind(this.clickToolbarSettings,this) 'file:settings': _.bind(this.clickToolbarSettings,this),
'file:open': this.clickToolbarTab.bind(this, 'file'),
'file:close': this.clickToolbarTab.bind(this, 'other')
}, },
'SearchDialog': { 'SearchDialog': {
'hide': _.bind(this.onSearchDlgHide, this), 'hide': _.bind(this.onSearchDlgHide, this),
@ -216,16 +218,12 @@ define([
if (close_menu) { if (close_menu) {
menu.hide(); menu.hide();
this.leftMenu.btnFile.toggle(false, true);
this.menuExpand(this.leftMenu.btnFile, 'files', false);
} }
}, },
clickSaveAsFormat: function(menu, format) { clickSaveAsFormat: function(menu, format) {
this.api.asc_DownloadAs(format); this.api.asc_DownloadAs(format);
menu.hide(); menu.hide();
this.leftMenu.btnFile.toggle(false, true);
this.menuExpand(this.leftMenu.btnFile, 'files', false);
}, },
applySettings: function(menu) { applySettings: function(menu) {
@ -242,12 +240,9 @@ define([
value = Common.localStorage.getItem("pe-settings-autosave"); value = Common.localStorage.getItem("pe-settings-autosave");
this.api.asc_setAutoSaveGap(parseInt(value)); this.api.asc_setAutoSaveGap(parseInt(value));
value = Common.localStorage.getItem("pe-settings-showsnaplines"); this.api.put_ShowSnapLines( Common.localStorage.getBool("pe-settings-showsnaplines") );
this.api.put_ShowSnapLines(value===null || parseInt(value) == 1);
menu.hide(); menu.hide();
this.leftMenu.btnFile.toggle(false, true);
this.menuExpand(this.leftMenu.btnFile, 'files', false);
}, },
onCreateNew: function(menu, type) { onCreateNew: function(menu, type) {
@ -260,16 +255,12 @@ define([
if (menu) { if (menu) {
menu.hide(); menu.hide();
this.leftMenu.btnFile.toggle(false, true);
this.menuExpand(this.leftMenu.btnFile, 'files', false);
} }
}, },
onOpenRecent: function(menu, url) { onOpenRecent: function(menu, url) {
if (menu) { if (menu) {
menu.hide(); menu.hide();
this.leftMenu.btnFile.toggle(false, true);
this.menuExpand(this.leftMenu.btnFile, 'files', false);
} }
var recentDocPage = window.open(url); var recentDocPage = window.open(url);
@ -280,15 +271,18 @@ define([
}, },
clickToolbarSettings: function(obj) { clickToolbarSettings: function(obj) {
if (this.leftMenu.btnFile.pressed && this.leftMenu.btnFile.panel.active == 'opts') this.leftMenu.showMenu('file:opts');
this.leftMenu.close(); },
else
this.leftMenu.showMenu('file:opts'); clickToolbarTab: function (tab, e) {
if (tab == 'file')
this.leftMenu.menuFile.show(); else
this.leftMenu.menuFile.hide();
}, },
/** coauthoring begin **/ /** coauthoring begin **/
clickStatusbarUsers: function() { clickStatusbarUsers: function() {
this.leftMenu.btnFile.panel.panels['rights'].changeAccessRights(); this.leftMenu.menuFile.panels['rights'].changeAccessRights();
}, },
onHideChat: function() { onHideChat: function() {
@ -384,7 +378,7 @@ define([
}, },
menuFilesHide: function(obj) { menuFilesHide: function(obj) {
$(this.leftMenu.btnFile.el).blur(); // $(this.leftMenu.btnFile.el).blur();
}, },
/** coauthoring begin **/ /** coauthoring begin **/
@ -431,12 +425,11 @@ define([
case 'search': case 'search':
if ((!previewPanel || !previewPanel.isVisible()) && !this._state.no_slides) { if ((!previewPanel || !previewPanel.isVisible()) && !this._state.no_slides) {
Common.UI.Menu.Manager.hideAll(); Common.UI.Menu.Manager.hideAll();
var full_menu_pressed = (this.leftMenu.btnFile.pressed || this.leftMenu.btnAbout.pressed); var full_menu_pressed = this.leftMenu.btnAbout.pressed;
this.showSearchDlg(true); this.showSearchDlg(true);
this.leftMenu.btnSearch.toggle(true,true); this.leftMenu.btnSearch.toggle(true,true);
this.leftMenu.btnFile.toggle(false);
this.leftMenu.btnAbout.toggle(false); this.leftMenu.btnAbout.toggle(false);
full_menu_pressed && this.menuExpand(this.leftMenu.btnFile, 'files', false); full_menu_pressed && this.menuExpand(this.leftMenu.btnAbout, 'files', false);
} }
return false; return false;
case 'save': case 'save':
@ -463,6 +456,12 @@ define([
return false; return false;
case 'escape': case 'escape':
// if (!this.leftMenu.isOpened()) return true; // if (!this.leftMenu.isOpened()) return true;
// TODO:
if ( this.leftMenu.menuFile.isVisible() ) {
this.leftMenu.menuFile.hide();
return false;
}
var statusbar = PE.getController('Statusbar'); var statusbar = PE.getController('Statusbar');
var menu_opened = statusbar.statusbar.$el.find('.open > [data-toggle="dropdown"]'); var menu_opened = statusbar.statusbar.$el.find('.open > [data-toggle="dropdown"]');
if (menu_opened.length) { if (menu_opened.length) {
@ -476,7 +475,8 @@ define([
return false; return false;
} }
} }
if (this.leftMenu.btnFile.pressed || this.leftMenu.btnAbout.pressed || this.leftMenu.btnPlugins.pressed ||
if ( this.leftMenu.btnAbout.pressed || this.leftMenu.btnPlugins.pressed ||
$(e.target).parents('#left-menu').length ) { $(e.target).parents('#left-menu').length ) {
this.leftMenu.close(); this.leftMenu.close();
Common.NotificationCenter.trigger('layout:changed', 'leftmenu'); Common.NotificationCenter.trigger('layout:changed', 'leftmenu');

View file

@ -427,8 +427,8 @@ define([
case Asc.c_oAscAsyncAction['ForceSaveButton']: case Asc.c_oAscAsyncAction['ForceSaveButton']:
clearTimeout(this._state.timerSave); clearTimeout(this._state.timerSave);
force = true; force = true;
title = this.saveTitleText; // title = this.saveTitleText;
text = this.saveTextText; // text = this.saveTextText;
break; break;
case Asc.c_oAscAsyncAction['ForceSaveTimeout']: case Asc.c_oAscAsyncAction['ForceSaveTimeout']:
@ -503,8 +503,10 @@ define([
if (!this.isShowOpenDialog) if (!this.isShowOpenDialog)
this.loadMask.show(); this.loadMask.show();
} } else
else { if ( action.id == Asc.c_oAscAsyncAction.Save ) {
appHeader.setSaveStatus('begin');
} else {
this.getApplication().getController('Statusbar').setStatusCaption(text, force); this.getApplication().getController('Statusbar').setStatusCaption(text, force);
} }
}, },
@ -529,6 +531,8 @@ define([
me._isDocReady = true; me._isDocReady = true;
Common.NotificationCenter.trigger('app:ready', me.appOptions);
me.api.SetDrawingFreeze(false); me.api.SetDrawingFreeze(false);
me.hidePreloader(); me.hidePreloader();
me.onLongActionEnd(Asc.c_oAscAsyncActionType['BlockInteraction'], LoadingDocument); me.onLongActionEnd(Asc.c_oAscAsyncActionType['BlockInteraction'], LoadingDocument);
@ -577,6 +581,7 @@ define([
Common.localStorage.setItem("pe-settings-showsnaplines", me.api.get_ShowSnapLines() ? 1 : 0); Common.localStorage.setItem("pe-settings-showsnaplines", me.api.get_ShowSnapLines() ? 1 : 0);
var application = me.getApplication();
var toolbarController = application.getController('Toolbar'), var toolbarController = application.getController('Toolbar'),
statusbarController = application.getController('Statusbar'), statusbarController = application.getController('Statusbar'),
documentHolderController = application.getController('DocumentHolder'), documentHolderController = application.getController('DocumentHolder'),
@ -753,16 +758,18 @@ define([
this.updatePlugins(this.plugins, true); this.updatePlugins(this.plugins, true);
this.applyModeCommonElements(); this.applyModeCommonElements();
this.applyModeEditorElements();
this.api.asc_setViewMode(!this.appOptions.isEdit); if ( this.appOptions.isEdit ) {
this.applyModeEditorElements();
} else {
Common.NotificationCenter.trigger('app:face', this.appOptions);
this.api.asc_LoadDocument();
if (!this.appOptions.isEdit) {
this.hidePreloader(); this.hidePreloader();
this.onLongActionBegin(Asc.c_oAscAsyncActionType['BlockInteraction'], LoadingDocument); this.onLongActionBegin(Asc.c_oAscAsyncActionType['BlockInteraction'], LoadingDocument);
} }
this.api.asc_setViewMode(!this.appOptions.isEdit);
this.api.asc_LoadDocument();
}, },
applyModeCommonElements: function() { applyModeCommonElements: function() {
@ -868,6 +875,8 @@ define([
if (me.stackLongActions.exist({id: ApplyEditRights, type: Asc.c_oAscAsyncActionType['BlockInteraction']})) { if (me.stackLongActions.exist({id: ApplyEditRights, type: Asc.c_oAscAsyncActionType['BlockInteraction']})) {
me.onLongActionEnd(Asc.c_oAscAsyncActionType['BlockInteraction'], ApplyEditRights); me.onLongActionEnd(Asc.c_oAscAsyncActionType['BlockInteraction'], ApplyEditRights);
} else if (!this._isDocReady) { } else if (!this._isDocReady) {
Common.NotificationCenter.trigger('app:face', me.appOptions);
me.hidePreloader(); me.hidePreloader();
me.onLongActionBegin(Asc.c_oAscAsyncActionType['BlockInteraction'], LoadingDocument); me.onLongActionBegin(Asc.c_oAscAsyncActionType['BlockInteraction'], LoadingDocument);
} }
@ -1128,6 +1137,8 @@ define([
this.updateWindowTitle(); this.updateWindowTitle();
this.api.isDocumentModified() && appHeader.setSaveStatus('changed');
var toolbarView = this.getApplication().getController('Toolbar').getView('Toolbar'); var toolbarView = this.getApplication().getController('Toolbar').getView('Toolbar');
if (toolbarView) { if (toolbarView) {
var isSyncButton = $('.btn-icon', toolbarView.btnSave.cmpEl).hasClass('btn-synch'), var isSyncButton = $('.btn-icon', toolbarView.btnSave.cmpEl).hasClass('btn-synch'),
@ -1358,12 +1369,8 @@ define([
return; return;
var me = this, var me = this,
shapegrouparray = [], shapegrouparray = [];
shapeStore = this.getCollection('ShapeGroups');
shapeStore.reset();
var groupscount = groupNames.length;
_.each(groupNames, function(groupName, index){ _.each(groupNames, function(groupName, index){
var store = new Backbone.Collection([], { var store = new Backbone.Collection([], {
model: PE.Models.ShapeModel model: PE.Models.ShapeModel
@ -1391,11 +1398,7 @@ define([
}); });
}); });
shapeStore.add(shapegrouparray); this.getCollection('ShapeGroups').reset(shapegrouparray);
setTimeout(function(){
me.getApplication().getController('Toolbar').fillAutoShapes();
}, 50);
}, },
fillLayoutsStore: function(layouts){ fillLayoutsStore: function(layouts){
@ -1440,10 +1443,6 @@ define([
}); });
artStore.reset(arr); artStore.reset(arr);
setTimeout(function(){
me.getApplication().getController('Toolbar').fillTextArt();
}, 50);
setTimeout(function(){ setTimeout(function(){
me.getApplication().getController('RightMenu').fillTextArt(); me.getApplication().getController('RightMenu').fillTextArt();
}, 50); }, 50);
@ -1503,11 +1502,11 @@ define([
}, },
onMeta: function(meta) { onMeta: function(meta) {
var app = this.getApplication(),
filemenu = app.getController('LeftMenu').getView('LeftMenu').getMenu('file');
appHeader.setDocumentCaption(meta.title); appHeader.setDocumentCaption(meta.title);
this.updateWindowTitle(true); this.updateWindowTitle(true);
this.document.title = meta.title; this.document.title = meta.title;
var filemenu = this.getApplication().getController('LeftMenu').getView('LeftMenu').getMenu('file');
filemenu.loadDocument({doc:this.document}); filemenu.loadDocument({doc:this.document});
filemenu.panels['info'].updateInfo(this.document); filemenu.panels['info'].updateInfo(this.document);
Common.Gateway.metaChange(meta); Common.Gateway.metaChange(meta);
@ -1760,8 +1759,6 @@ define([
criticalErrorExtText: 'Press "Ok" to to back to document list.', criticalErrorExtText: 'Press "Ok" to to back to document list.',
openTitleText: 'Opening Document', openTitleText: 'Opening Document',
openTextText: 'Opening document...', openTextText: 'Opening document...',
saveTitleText: 'Saving Document',
saveTextText: 'Saving document...',
loadFontsTitleText: 'Loading Data', loadFontsTitleText: 'Loading Data',
loadFontsTextText: 'Loading data...', loadFontsTextText: 'Loading data...',
loadImagesTitleText: 'Loading Images', loadImagesTitleText: 'Loading Images',
@ -1888,7 +1885,6 @@ define([
errorAccessDeny: 'You are trying to perform an action you do not have rights for.<br>Please contact your Document Server administrator.', errorAccessDeny: 'You are trying to perform an action you do not have rights for.<br>Please contact your Document Server administrator.',
titleServerVersion: 'Editor updated', titleServerVersion: 'Editor updated',
errorServerVersion: 'The editor version has been updated. The page will be reloaded to apply the changes.', errorServerVersion: 'The editor version has been updated. The page will be reloaded to apply the changes.',
textChangesSaved: 'All changes saved',
errorBadImageUrl: 'Image url is incorrect' errorBadImageUrl: 'Image url is incorrect'
} }
})(), PE.Controllers.Main || {})) })(), PE.Controllers.Main || {}))

View file

@ -72,9 +72,7 @@ define([
}, },
onLaunch: function() { onLaunch: function() {
this.statusbar = this.createView('Statusbar', { this.statusbar = this.createView('Statusbar', {}).render();
storeUsers: this.getApplication().getCollection('Common.Collections.Users')
}).render();
this.statusbar.$el.css('z-index', 1); this.statusbar.$el.css('z-index', 1);
this.bindViewEvents(this.statusbar, this.events); this.bindViewEvents(this.statusbar, this.events);

View file

@ -114,7 +114,16 @@ define([
this.addListeners({ this.addListeners({
'Toolbar': { 'Toolbar': {
'changecompact' : this.onChangeCompactView 'view:compact' : this.onChangeCompactView,
'insert:image' : this.onInsertImageClick.bind(this),
'insert:text' : this.onInsertText.bind(this),
'insert:textart' : this.onInsertTextart.bind(this),
'insert:shape' : this.onInsertShape.bind(this)
},
'FileMenu': {
'filemenu:hide': function () {
this.toolbar.setTab('');
}.bind(this)
} }
}); });
@ -128,15 +137,17 @@ define([
btn_id = cmp.closest('.btn-group').attr('id'); btn_id = cmp.closest('.btn-group').attr('id');
if (cmp.attr('id') != 'editor_sdk' && cmp_sdk.length<=0) { if (cmp.attr('id') != 'editor_sdk' && cmp_sdk.length<=0) {
if ( me.toolbar.btnInsertText.pressed && btn_id != me.toolbar.btnInsertText.id || if ( me.toolbar.btnsInsertText.pressed && !me.toolbar.btnsInsertText.contains(btn_id) ||
me.toolbar.btnInsertShape.pressed && btn_id != me.toolbar.btnInsertShape.id ) { me.toolbar.btnsInsertShape.pressed && !me.toolbar.btnsInsertShape.contains(btn_id) )
{
me._isAddingShape = false; me._isAddingShape = false;
me._addAutoshape(false); me._addAutoshape(false);
me.toolbar.btnInsertShape.toggle(false, true); me.toolbar.btnsInsertShape.toggle(false, true);
me.toolbar.btnInsertText.toggle(false, true); me.toolbar.btnsInsertText.toggle(false, true);
Common.NotificationCenter.trigger('edit:complete', me.toolbar); Common.NotificationCenter.trigger('edit:complete', me.toolbar);
} else if ( me.toolbar.btnInsertShape.pressed && btn_id == me.toolbar.btnInsertShape.id) { } else
if ( me.toolbar.btnsInsertShape.pressed && me.toolbar.btnsInsertShape.contains(btn_id) ) {
_.defer(function(){ _.defer(function(){
me.api.StartAddShape('', false); me.api.StartAddShape('', false);
Common.NotificationCenter.trigger('edit:complete', me.toolbar); Common.NotificationCenter.trigger('edit:complete', me.toolbar);
@ -148,11 +159,11 @@ define([
this.onApiEndAddShape = function() { this.onApiEndAddShape = function() {
this.toolbar.fireEvent('insertshape', this.toolbar); this.toolbar.fireEvent('insertshape', this.toolbar);
if (this.toolbar.btnInsertShape.pressed) if ( this.toolbar.btnsInsertShape.pressed )
this.toolbar.btnInsertShape.toggle(false, true); this.toolbar.btnsInsertShape.toggle(false, true);
if (this.toolbar.btnInsertText.pressed) if ( this.toolbar.btnsInsertText.pressed )
this.toolbar.btnInsertText.toggle(false, true); this.toolbar.btnsInsertText.toggle(false, true);
$(document.body).off('mouseup', checkInsertAutoshape); $(document.body).off('mouseup', checkInsertAutoshape);
}; };
@ -175,6 +186,18 @@ define([
this.toolbar = this.createView('Toolbar'); this.toolbar = this.createView('Toolbar');
// this.toolbar.on('render:after', _.bind(this.onToolbarAfterRender, this)); // this.toolbar.on('render:after', _.bind(this.onToolbarAfterRender, this));
var me = this;
Common.NotificationCenter.on('app:ready', me.onAppReady.bind(me));
Common.NotificationCenter.on('app:face', me.onAppShowed.bind(me));
PE.getCollection('Common.Collections.TextArt').bind({
reset: me.onResetTextArt.bind(this)
});
PE.getCollection('ShapeGroups').bind({
reset: me.onResetAutoshapes.bind(this)
});
}, },
onToolbarAfterRender: function(toolbar) { onToolbarAfterRender: function(toolbar) {
@ -182,8 +205,6 @@ define([
* UI Events * UI Events
*/ */
toolbar.btnNewDocument.on('click', _.bind(this.onNewDocument, this));
toolbar.btnOpenDocument.on('click', _.bind(this.onOpenDocument, this));
toolbar.btnAddSlide.on('click', _.bind(this.onBtnAddSlide, this)); toolbar.btnAddSlide.on('click', _.bind(this.onBtnAddSlide, this));
toolbar.mnuAddSlidePicker.on('item:click', _.bind(this.onAddSlide, this)); toolbar.mnuAddSlidePicker.on('item:click', _.bind(this.onAddSlide, this));
if (toolbar.mnuChangeSlidePicker) if (toolbar.mnuChangeSlidePicker)
@ -231,10 +252,6 @@ define([
toolbar.btnInsertHyperlink.on('click', _.bind(this.onHyperlinkClick, this)); toolbar.btnInsertHyperlink.on('click', _.bind(this.onHyperlinkClick, this));
toolbar.mnuTablePicker.on('select', _.bind(this.onTablePickerSelect, this)); toolbar.mnuTablePicker.on('select', _.bind(this.onTablePickerSelect, this));
toolbar.btnInsertTable.menu.on('item:click', _.bind(this.onInsertTableClick, this)); toolbar.btnInsertTable.menu.on('item:click', _.bind(this.onInsertTableClick, this));
toolbar.btnInsertImage.menu.on('item:click', _.bind(this.onInsertImageClick, this));
toolbar.btnInsertText.on('click', _.bind(this.onBtnInsertTextClick, this));
toolbar.btnInsertText.menu.on('item:click', _.bind(this.onInsertTextClick, this));
toolbar.btnInsertShape.menu.on('hide:after', _.bind(this.onInsertShapeHide, this));
toolbar.btnClearStyle.on('click', _.bind(this.onClearStyleClick, this)); toolbar.btnClearStyle.on('click', _.bind(this.onClearStyleClick, this));
toolbar.btnCopyStyle.on('toggle', _.bind(this.onCopyStyleToggle, this)); toolbar.btnCopyStyle.on('toggle', _.bind(this.onCopyStyleToggle, this));
toolbar.btnAdvSettings.on('click', _.bind(this.onAdvSettingsClick, this)); toolbar.btnAdvSettings.on('click', _.bind(this.onAdvSettingsClick, this));
@ -299,13 +316,9 @@ define([
}, },
onChangeCompactView: function(view, compact) { onChangeCompactView: function(view, compact) {
Common.localStorage.setItem('pe-compact-toolbar', compact ? 1 : 0); this.toolbar.setFolded(compact);
if (!compact && !this._state.changeslide_inited) {
this.toolbar.mnuChangeSlidePicker.on('item:click', _.bind(this.onChangeSlide, this));
}
this._state.changeslide_inited = true;
Common.localStorage.setBool('pe-compact-toolbar', compact);
Common.NotificationCenter.trigger('layout:changed', 'toolbar'); Common.NotificationCenter.trigger('layout:changed', 'toolbar');
Common.NotificationCenter.trigger('edit:complete', this.toolbar); Common.NotificationCenter.trigger('edit:complete', this.toolbar);
}, },
@ -552,10 +565,12 @@ define([
this.toolbar.lockToolbar(PE.enumLock.noSlides, this._state.no_slides, {array: this.toolbar.paragraphControls}); this.toolbar.lockToolbar(PE.enumLock.noSlides, this._state.no_slides, {array: this.toolbar.paragraphControls});
this.toolbar.lockToolbar(PE.enumLock.noSlides, this._state.no_slides, {array: [ this.toolbar.lockToolbar(PE.enumLock.noSlides, this._state.no_slides, {array: [
this.toolbar.btnChangeSlide, this.toolbar.btnPreview, this.toolbar.btnCopy, this.toolbar.btnPaste, this.toolbar.btnChangeSlide, this.toolbar.btnPreview, this.toolbar.btnCopy, this.toolbar.btnPaste,
this.toolbar.btnCopyStyle, this.toolbar.btnInsertTable, this.toolbar.btnInsertImage, this.toolbar.btnInsertChart, this.toolbar.btnCopyStyle, this.toolbar.btnInsertTable, this.toolbar.btnInsertChart,
this.toolbar.btnInsertText, this.toolbar.btnInsertShape, this.toolbar.btnColorSchemas, this.toolbar.btnShapeAlign, this.toolbar.btnColorSchemas, this.toolbar.btnShapeAlign,
this.toolbar.btnShapeArrange, this.toolbar.btnSlideSize, this.toolbar.listTheme this.toolbar.btnShapeArrange, this.toolbar.btnSlideSize, this.toolbar.listTheme
]}); ]});
this.toolbar.lockToolbar(PE.enumLock.noSlides, this._state.no_slides,
{ array: this.toolbar.btnsInsertImage.concat(this.toolbar.btnsInsertText, this.toolbar.btnsInsertShape) });
} }
}, },
@ -1312,19 +1327,16 @@ define([
} }
}, },
onInsertImageClick: function(menu, item, e) { onInsertImageClick: function(opts, e) {
if (item.value === 'file') { var me = this;
this.toolbar.fireEvent('insertimage', this.toolbar); if (opts === 'file') {
me.toolbar.fireEvent('insertimage', this.toolbar);
if (this.api) me.api.asc_addImage();
this.api.asc_addImage();
Common.NotificationCenter.trigger('edit:complete', this.toolbar); Common.NotificationCenter.trigger('edit:complete', this.toolbar);
Common.component.Analytics.trackEvent('ToolBar', 'Image'); Common.component.Analytics.trackEvent('ToolBar', 'Image');
} else { } else {
var me = this;
(new Common.Views.ImageFromUrlDialog({ (new Common.Views.ImageFromUrlDialog({
handler: function(result, value) { handler: function(result, value) {
if (result == 'ok') { if (result == 'ok') {
@ -1349,38 +1361,54 @@ define([
} }
}, },
onBtnInsertTextClick: function(btn, e) { onInsertText: function(status) {
if (this.api) if ( status == 'begin' ) {
this._addAutoshape(btn.pressed, 'textRect'); this._addAutoshape(true, 'textRect');
if (this.toolbar.btnInsertShape.pressed) if ( !this.toolbar.btnsInsertText.pressed )
this.toolbar.btnInsertShape.toggle(false, true); this.toolbar.btnsInsertText.toggle(true, true);
} else
this._addAutoshape(false, 'textRect');
Common.NotificationCenter.trigger('edit:complete', this.toolbar, this.toolbar.btnInsertShape); if ( this.toolbar.btnsInsertShape.pressed )
this.toolbar.btnsInsertShape.toggle(false, true);
Common.NotificationCenter.trigger('edit:complete', this.toolbar);
Common.component.Analytics.trackEvent('ToolBar', 'Add Text'); Common.component.Analytics.trackEvent('ToolBar', 'Add Text');
}, },
onInsertTextClick: function(menu, item, e) { onInsertShape: function (type) {
if (item.value === 'text') { var me = this;
if (this.api) if ( type == 'menu:hide' ) {
this._addAutoshape(true, 'textRect'); if ( me.toolbar.btnsInsertShape.pressed && !me._isAddingShape ) {
this.toolbar.btnInsertText.toggle(true, true); me.toolbar.btnsInsertShape.toggle(false, true);
}
me._isAddingShape = false;
if (this.toolbar.btnInsertShape.pressed) Common.NotificationCenter.trigger('edit:complete', me.toolbar);
this.toolbar.btnInsertShape.toggle(false, true); } else {
me._addAutoshape(true, type);
me._isAddingShape = true;
Common.NotificationCenter.trigger('edit:complete', this.toolbar, this.toolbar.btnInsertShape); if ( me.toolbar.btnsInsertText.pressed )
Common.component.Analytics.trackEvent('ToolBar', 'Add Text'); me.toolbar.btnsInsertText.toggle(false, true);
Common.NotificationCenter.trigger('edit:complete', me.toolbar);
Common.component.Analytics.trackEvent('ToolBar', 'Add Shape');
} }
}, },
onInsertShapeHide: function(btn, e) {
if (this.toolbar.btnInsertShape.pressed && !this._isAddingShape) {
this.toolbar.btnInsertShape.toggle(false, true);
}
this._isAddingShape = false;
Common.NotificationCenter.trigger('edit:complete', this.toolbar, this.toolbar.btnInsertShape); onInsertTextart: function (data) {
var me = this;
me.toolbar.fireEvent('inserttextart', me.toolbar);
me.api.AddTextArt(data);
if ( me.toolbar.btnsInsertShape.pressed )
me.toolbar.btnsInsertShape.toggle(false, true);
Common.NotificationCenter.trigger('edit:complete', me.toolbar);
Common.component.Analytics.trackEvent('ToolBar', 'Add Text Art');
}, },
onClearStyleClick: function(btn, e) { onClearStyleClick: function(btn, e) {
@ -1654,88 +1682,18 @@ define([
this._state.clrtext_asccolor = color; this._state.clrtext_asccolor = color;
}, },
fillAutoShapes: function() { onResetAutoshapes: function () {
var me = this, setTimeout(function () {
shapesStore = this.getApplication().getCollection('ShapeGroups'); this.toolbar.updateAutoshapeMenu(PE.getCollection('ShapeGroups'));
}.bind(this), 0);
for (var i = 0; i < shapesStore.length; i++) {
var shapeGroup = shapesStore.at(i);
var menuItem = new Common.UI.MenuItem({
caption: shapeGroup.get('groupName'),
menu: new Common.UI.Menu({
menuAlign: 'tl-tr',
items: [
{ template: _.template('<div id="id-toolbar-menu-shapegroup' + i + '" class="menu-shape" style="width: ' + (shapeGroup.get('groupWidth') - 8) + 'px; margin-left: 5px;"></div>') }
]
})
});
me.toolbar.btnInsertShape.menu.addItem(menuItem);
var shapePicker = new Common.UI.DataView({
el: $('#id-toolbar-menu-shapegroup' + i),
store: shapeGroup.get('groupStore'),
parentMenu: menuItem.menu,
showLast: false,
itemTemplate: _.template('<div class="item-shape"><img src="<%= imageUrl %>" id="<%= id %>"></div>')
});
shapePicker.on('item:click', function(picker, item, record, e) {
if (me.api) {
me._addAutoshape(true, record.get('data').shapeType);
me._isAddingShape = true;
if (me.toolbar.btnInsertText.pressed) {
me.toolbar.btnInsertText.toggle(false, true);
}
if (e.type !== 'click')
me.toolbar.btnInsertShape.menu.hide();
Common.NotificationCenter.trigger('edit:complete', me.toolbar, me.toolbar.btnInsertShape);
Common.component.Analytics.trackEvent('ToolBar', 'Add Shape');
}
});
}
}, },
fillTextArt: function() { onResetTextArt: function (collection, opts) {
var me = this; (new Promise(function (resolve, reject) {
resolve();
if (this.toolbar.mnuTextArtPicker) { })).then(function () {
var models = this.getApplication().getCollection('Common.Collections.TextArt').models, this.toolbar.updateTextartMenu(collection);
count = this.toolbar.mnuTextArtPicker.store.length; }.bind(this));
if (count>0 && count==models.length) {
var data = this.toolbar.mnuTextArtPicker.store.models;
_.each(models, function(template, index){
data[index].set('imageUrl', template.get('imageUrl'));
});
} else {
this.toolbar.mnuTextArtPicker.store.reset(models);
}
} else {
this.toolbar.mnuTextArtPicker = new Common.UI.DataView({
el: $('#id-toolbar-menu-insart'),
store: this.getApplication().getCollection('Common.Collections.TextArt'),
parentMenu: this.toolbar.mnuInsertTextArt.menu,
showLast: false,
itemTemplate: _.template('<div class="item-art"><img src="<%= imageUrl %>" id="<%= id %>" style="width:50px;height:50px;"></div>')
});
this.toolbar.mnuTextArtPicker.on('item:click', function(picker, item, record, e) {
if (me.api) {
me.toolbar.fireEvent('inserttextart', me.toolbar);
me.api.AddTextArt(record.get('data'));
if (me.toolbar.btnInsertShape.pressed)
me.toolbar.btnInsertShape.toggle(false, true);
if (e.type !== 'click')
me.toolbar.btnInsertText.menu.hide();
Common.NotificationCenter.trigger('edit:complete', me.toolbar, me.toolbar.btnInsertText);
Common.component.Analytics.trackEvent('ToolBar', 'Add Text Art');
}
});
}
}, },
fillEquations: function() { fillEquations: function() {
@ -1796,11 +1754,11 @@ define([
if (me.api) { if (me.api) {
me.api.asc_AddMath(record.get('data').equationType); me.api.asc_AddMath(record.get('data').equationType);
if (me.toolbar.btnInsertText.pressed) { if (me.toolbar.btnsInsertText.pressed) {
me.toolbar.btnInsertText.toggle(false, true); me.toolbar.btnsInsertText.toggle(false, true);
} }
if (me.toolbar.btnInsertShape.pressed) { if (me.toolbar.btnsInsertShape.pressed) {
me.toolbar.btnInsertShape.toggle(false, true); me.toolbar.btnsInsertShape.toggle(false, true);
} }
if (e.type !== 'click') if (e.type !== 'click')
@ -2074,6 +2032,61 @@ define([
this.onToolbarAfterRender(this.toolbar); this.onToolbarAfterRender(this.toolbar);
}, },
onAppShowed: function (config) {
var me = this;
var compactview = !config.isEdit;
if ( config.isEdit ) {
if ( Common.localStorage.itemExists("pe-compact-toolbar") ) {
compactview = Common.localStorage.getBool("pe-compact-toolbar");
} else
if ( config.customization && config.customization.compactToolbar )
compactview = true;
}
me.toolbar.render(_.extend({compactview: compactview}, config));
},
onAppReady: function (config) {
var me = this;
if ( config.canComments ) {
var _btnsComment = [];
var slots = me.toolbar.$el.find('.slot-comment');
slots.each(function(index, el) {
var _cls = 'btn-toolbar';
/x-huge/.test(el.className) && (_cls += ' x-huge icon-top');
var button = new Common.UI.Button({
cls: _cls,
iconCls: 'btn-menu-comments',
caption: 'Comment'
}).render( slots.eq(index) );
_btnsComment.push(button);
});
if ( _btnsComment.length ) {
var _comments = PE.getController('Common.Controllers.Comments').getView();
// Array.prototype.push.apply(me.toolbar.toolbarControls, _btnsComment);
_btnsComment.forEach(function (btn) {
btn.updateHint( _comments.textAddComment );
btn.on('click', function (btn, e) {
Common.NotificationCenter.trigger('app:comment:add', 'toolbar');
});
}, this);
}
}
(new Promise(function(accept) {
accept();
})).then(function () {
if ( config.isEdit ) {
me.toolbar.onAppReady(config);
}
});
},
textEmptyImgUrl : 'You need to specify image URL.', textEmptyImgUrl : 'You need to specify image URL.',
textWarning : 'Warning', textWarning : 'Warning',
textFontSizeErr : 'The entered value must be more than 0', textFontSizeErr : 'The entered value must be more than 0',

View file

@ -65,8 +65,25 @@ define([
// When controller is created let's setup view event listeners // When controller is created let's setup view event listeners
initialize: function() { initialize: function() {
var me = this;
// This most important part when we will tell our controller what events should be handled // This most important part when we will tell our controller what events should be handled
this.addListeners({ this.addListeners({
'Toolbar': {
'render:before' : function (toolbar) {
toolbar.setExtra('right', me.header.getPanel('right'));
toolbar.setExtra('left', me.header.getPanel('left'));
},
'view:compact' : function (toolbar, state) {
me.viewport.vlayout.panels[0].height = state ? 40 : 40+67;
}
},
'Common.Views.Header': {
'go:back': function (opts) {
Common.NotificationCenter.trigger('goback', /new/.test(opts));
// Common.component.Analytics.trackEvent('Back to Folder');
}
},
// Events generated by main view // Events generated by main view
'Viewport': { 'Viewport': {
@ -84,8 +101,9 @@ define([
// Create and render main view // Create and render main view
this.viewport = this.createView('Viewport').render(); this.viewport = this.createView('Viewport').render();
this.header = this.createView('Common.Views.Header', { this.header = this.createView('Common.Views.Header', {
headerCaption: 'Presentation Editor' headerCaption: 'Presentation Editor',
}).render(); storeUsers: PE.getCollection('Common.Collections.Users')
});
this.docPreview = this.createView('DocumentPreview', {}).render(); this.docPreview = this.createView('DocumentPreview', {}).render();
Common.NotificationCenter.on('layout:changed', _.bind(this.onLayoutChanged, this)); Common.NotificationCenter.on('layout:changed', _.bind(this.onLayoutChanged, this));
@ -96,8 +114,22 @@ define([
this.api.Resize(); this.api.Resize();
Common.localStorage.setItem('pe-mainmenu-width',leftPanel.width()); Common.localStorage.setItem('pe-mainmenu-width',leftPanel.width());
}, this); }, this);
Common.NotificationCenter.on('app:face', this.onAppShowed.bind(this));
}, },
onAppShowed: function (config) {
var me = this;
if ( !config.isEdit ||
( !Common.localStorage.itemExists("pe-compact-toolbar") &&
config.customization && config.customization.compactToolbar ))
{
me.viewport.vlayout.panels[0].height = 40;
}
},
onLayoutChanged: function(area) { onLayoutChanged: function(area) {
switch (area) { switch (area) {
default: default:

View file

@ -1,6 +1,5 @@
<div id="view-left-menu" class="tool-menu left"> <div id="view-left-menu" class="tool-menu left">
<div class="tool-menu-btns"> <div class="tool-menu-btns">
<button id="left-btn-file" class="btn btn-category" content-target="left-panel-file"><span class="btn-icon img-toolbarmenu btn-menu-file">&nbsp;</span></button>
<button id="left-btn-search" class="btn btn-category" content-target=""><i class="icon img-toolbarmenu btn-menu-search">&nbsp;</i></button> <button id="left-btn-search" class="btn btn-category" content-target=""><i class="icon img-toolbarmenu btn-menu-search">&nbsp;</i></button>
<button id="left-btn-thumbs" class="btn btn-category" content-target=""><i class="icon img-toolbarmenu btn-menu-thumbs">&nbsp;</i></button> <button id="left-btn-thumbs" class="btn btn-category" content-target=""><i class="icon img-toolbarmenu btn-menu-thumbs">&nbsp;</i></button>
<!-- /** coauthoring begin **/ --> <!-- /** coauthoring begin **/ -->

View file

@ -1,211 +1,155 @@
<div class="toolbar" style="<%= isCompactView ? 'height: 41px;' : 'height: 67px;' %>"> <div class="toolbar">
<!----------------------> <section class="box-tabs">
<!--Short view toolbar--> <div class="extra left"></div>
<!----------------------> <section class="tabs">
<div id="id-toolbar-short" style="<%= isCompactView ? 'display: table;' : 'display: none;' %> width: 100%;" > <a href="#" class="scroll left">
<div class="toolbar-group"> <i class="icon">&lt;</i>
<div class="toolbar-row"> </a>
<span class="btn-placeholder split" id="id-toolbar-short-placeholder-btn-addslide"></span> <ul>
<span class="btn-placeholder split" id="id-toolbar-short-placeholder-btn-preview"></span> <% for(var i in tabs) { %>
</div> <li class="ribtab<% if (tabs[i].extcls) print(' ' + tabs[i].extcls) %>">
</div> <a data-tab="<%= tabs[i].action %>" data-title="<%= tabs[i].caption %>"><%= tabs[i].caption %></a>
<div class="separator short"></div> </li>
<div class="toolbar-group no-mask"> <% } %>
<div class="toolbar-row"> <div class="marker"></div>
<span class="btn-placeholder split" id="id-toolbar-short-placeholder-btn-print"></span> </ul>
<span class="btn-placeholder" id="id-toolbar-short-placeholder-btn-save"></span> <a href="#" class="scroll right">
</div> <i class="icon">&gt;</i>
</div> </a>
<div class="separator short"></div> </section>
<div class="toolbar-group"> <div class="extra right"></div>
<div class="toolbar-row"> </section>
<span class="btn-placeholder split" id="id-toolbar-short-placeholder-btn-undo"></span> <section class="box-controls">
<span class="btn-placeholder" id="id-toolbar-short-placeholder-btn-redo"></span> <section class="panel static">
</div> <div class="group no-mask">
</div> <div class="elset">
<div class="separator short"></div> <span class="btn-slot" id="slot-btn-print"></span>
<div class="toolbar-group"> </div>
<div class="toolbar-row" style="width: 140px; margin-top: -1px;"> <div class="elset">
<span class="btn-placeholder" style="float: left; width: 90px;" id="id-toolbar-short-placeholder-field-fontname"></span> <span class="btn-slot" id="slot-btn-save"></span>
<span class="btn-placeholder" style="float: left; width: 45px; margin-left: 2px;" id="id-toolbar-short-placeholder-field-fontsize"></span> </div>
</div>
</div>
<div class="toolbar-group">
<div class="toolbar-row">
<span class="btn-placeholder split" id="id-toolbar-short-placeholder-btn-bold"></span>
<span class="btn-placeholder split" id="id-toolbar-short-placeholder-btn-italic"></span>
<span class="btn-placeholder split" id="id-toolbar-short-placeholder-btn-underline"></span>
<span class="btn-placeholder split" id="id-toolbar-short-placeholder-btn-fontcolor"></span>
</div>
</div>
<div class="separator short"></div>
<div class="toolbar-group">
<div class="toolbar-row">
<span class="btn-placeholder split" id="id-toolbar-short-placeholder-btn-halign"></span>
<span class="btn-placeholder split" id="id-toolbar-short-placeholder-btn-valign"></span>
<span class="btn-placeholder split" id="id-toolbar-short-placeholder-btn-markers"></span>
<span class="btn-placeholder split" id="id-toolbar-short-placeholder-btn-numbering"></span>
<span class="btn-placeholder split" id="id-toolbar-short-placeholder-btn-linespace"></span>
</div>
</div>
<div class="separator short" style="margin-left: 5px;"></div>
<div class="toolbar-group">
<div class="toolbar-row">
<span class="btn-placeholder split" id="id-toolbar-short-placeholder-btn-arrange-shape"></span>
<span class="btn-placeholder split" id="id-toolbar-short-placeholder-btn-align-shape"></span>
</div>
</div>
<div class="separator short" style="margin-left: 5px;"></div>
<div class="toolbar-group">
<div class="toolbar-row">
<span class="btn-placeholder split" id="id-toolbar-short-placeholder-btn-insertimage"></span>
<span class="btn-placeholder split" id="id-toolbar-short-placeholder-btn-inserttable"></span>
<span class="btn-placeholder split" id="id-toolbar-short-placeholder-btn-insertchart"></span>
<span class="btn-placeholder split" id="id-toolbar-short-placeholder-btn-inserthyperlink"></span>
<span class="btn-placeholder split" id="id-toolbar-short-placeholder-btn-insertshape"></span>
<span class="btn-placeholder split" id="id-toolbar-short-placeholder-btn-inserttext"></span>
</div>
</div>
<div class="separator short" style="margin-left: 5px;"></div>
<div class="toolbar-group">
<div class="toolbar-row">
<span class="btn-placeholder" id="id-toolbar-short-placeholder-btn-copystyle"></span>
</div>
</div>
<div class="toolbar-group" style="width: 100%;"></div>
<div class="toolbar-group no-mask" style="padding-left:0;">
<div class="toolbar-row">
<div class="toolbar-row">
<span class="btn-placeholder split" id="id-toolbar-short-placeholder-btn-hidebars"></span>
</div> </div>
</div> <div class="separator long"></div>
</div> <div class="group">
</div> <div class="elset">
<!----------------------> <span class="btn-slot split" id="slot-btn-copy"></span>
<!--Fully view toolbar--> <span class="btn-slot" id="slot-btn-paste"></span>
<!----------------------> </div>
<div id="id-toolbar-full" style="<%= isCompactView ? 'display: none;' : 'display: table;' %> width: 100%;" > <div class="elset">
<div class="toolbar-group toolbar-group-native"> <span class="btn-slot split" id="slot-btn-undo"></span>
<div class="toolbar-row"> <span class="btn-slot" id="slot-btn-redo"></span>
<span class="btn-placeholder" id="id-toolbar-full-placeholder-btn-newdocument"></span> </div>
</div> </div>
<div class="toolbar-row"> <div class="separator long"></div>
<span class="btn-placeholder" id="id-toolbar-full-placeholder-btn-opendocument"></span> <div class="group">
</div> <span class="btn-slot text x-huge" id="slot-btn-addslide"></span>
</div> </div>
<div class="separator long toolbar-group-native"></div> <div class="group" style="display:none;"></div>
<div class="toolbar-group"> </section>
<div class="toolbar-row"> <section class="box-panels">
<span class="btn-placeholder large split" id="id-toolbar-full-placeholder-btn-addslide"></span> <section class="panel" data-tab="home">
</div> <div class="group">
</div> <div class="elset">
<div class="toolbar-group"> <span class="btn-slot split" id="slot-btn-changeslide"></span>
<div class="toolbar-row"> </div>
<span class="btn-placeholder split" id="id-toolbar-full-placeholder-btn-changeslide"></span> <div class="elset">
</div> <span class="btn-slot" id="slot-btn-preview"></span>
<div class="toolbar-row"> </div>
<span class="btn-placeholder" id="id-toolbar-full-placeholder-btn-preview"></span> </div>
</div> <div class="separator long"></div>
</div> <div class="group">
<div class="separator long" style="margin-left: 5px;"></div> <span class="btn-slot text x-huge slot-inserttext"></span>
<div class="toolbar-group no-mask"> <span class="btn-slot text x-huge slot-insertimg"></span>
<div class="toolbar-row"> <span class="btn-slot text x-huge slot-insertshape"></span>
<span class="btn-placeholder" id="id-toolbar-full-placeholder-btn-print"></span> </div>
</div> <div class="group">
<div class="toolbar-row"> <div class="elset">
<span class="btn-placeholder" id="id-toolbar-full-placeholder-btn-save"></span> <span class="btn-slot split" id="slot-btn-arrange-shape"></span>
</div> </div>
</div> <div class="elset">
<div class="separator long"></div> <span class="btn-slot split" id="slot-btn-align-shape"></span>
<div class="toolbar-group"> </div>
<div class="toolbar-row"> </div>
<span class="btn-placeholder split" id="id-toolbar-full-placeholder-btn-copy"></span> <div class="separator long"></div>
<span class="btn-placeholder" id="id-toolbar-full-placeholder-btn-paste"></span> <div class="group">
</div> <div class="elset" style="width:202px;">
<div class="toolbar-row"> <span class="btn-slot" style="float: left; width: 148px;" id="slot-field-fontname"></span>
<span class="btn-placeholder split" id="id-toolbar-full-placeholder-btn-undo"></span> <span class="btn-slot" style="float: left; width: 45px; margin-left: 2px;" id="slot-field-fontsize"></span>
<span class="btn-placeholder" id="id-toolbar-full-placeholder-btn-redo"></span> </div>
</div> <div class="elset">
</div> <span class="btn-slot split" id="slot-btn-bold"></span>
<div class="separator long"></div> <span class="btn-slot split" id="slot-btn-italic"></span>
<div class="toolbar-group"> <span class="btn-slot split" id="slot-btn-underline"></span>
<div class="toolbar-row" style="width:202px;"> <span class="btn-slot split" id="slot-btn-strikeout"></span>
<span class="btn-placeholder" style="float: left; width: 148px;" id="id-toolbar-full-placeholder-field-fontname"></span> <span class="btn-slot split" id="slot-btn-fontcolor"></span>
<span class="btn-placeholder" style="float: left; width: 45px; margin-left: 2px;" id="id-toolbar-full-placeholder-field-fontsize"></span> <span class="btn-slot split" id="slot-btn-superscript"></span>
</div> <span class="btn-slot" id="slot-btn-subscript"></span>
<div class="toolbar-row"> </div>
<span class="btn-placeholder split" id="id-toolbar-full-placeholder-btn-bold"></span> </div>
<span class="btn-placeholder split" id="id-toolbar-full-placeholder-btn-italic"></span> <div class="separator long"></div>
<span class="btn-placeholder split" id="id-toolbar-full-placeholder-btn-underline"></span> <div class="group">
<span class="btn-placeholder split" id="id-toolbar-full-placeholder-btn-strikeout"></span> <div class="elset">
<span class="btn-placeholder split" id="id-toolbar-full-placeholder-btn-fontcolor"></span> <span class="btn-slot split" id="slot-btn-markers"></span>
<span class="btn-placeholder split" id="id-toolbar-full-placeholder-btn-superscript"></span> <span class="btn-slot split" id="slot-btn-numbering"></span>
<span class="btn-placeholder" id="id-toolbar-full-placeholder-btn-subscript"></span> <span class="btn-slot split" id="slot-btn-decoffset"></span>
</div> <span class="btn-slot split" id="slot-btn-incoffset"></span>
</div> </div>
<div class="separator long" style="margin-left: 5px;"></div> <div class="elset">
<div class="toolbar-group"> <span class="btn-slot split" id="slot-btn-halign"></span>
<div class="toolbar-row"> <span class="btn-slot split" id="slot-btn-valign"></span>
<span class="btn-placeholder split" id="id-toolbar-full-placeholder-btn-markers"></span> <span class="btn-slot split" id="slot-btn-linespace"></span>
<span class="btn-placeholder split" id="id-toolbar-full-placeholder-btn-numbering"></span> </div>
<span class="btn-placeholder split" id="id-toolbar-full-placeholder-btn-decoffset"></span> </div>
<span class="btn-placeholder split" id="id-toolbar-full-placeholder-btn-incoffset"></span> <div class="separator long"></div>
</div> <div class="group">
<div class="toolbar-row"> <div class="elset">
<span class="btn-placeholder split" id="id-toolbar-full-placeholder-btn-halign"></span> <span class="btn-slot" id="slot-btn-clearstyle"></span>
<span class="btn-placeholder split" id="id-toolbar-full-placeholder-btn-valign"></span> </div>
<span class="btn-placeholder split" id="id-toolbar-full-placeholder-btn-linespace"></span> <div class="elset">
</div> <span class="btn-slot" id="slot-btn-copystyle"></span>
</div> </div>
<div class="separator long" style="margin-left: 5px;"></div> </div>
<div class="toolbar-group"> <div class="group">
<div class="toolbar-row"> <div class="elset">
<span class="btn-placeholder split" id="id-toolbar-full-placeholder-btn-insertimage"></span> <span class="btn-slot split" id="slot-btn-colorschemas"></span>
<span class="btn-placeholder split" id="id-toolbar-full-placeholder-btn-insertchart"></span> </div>
<span class="btn-placeholder split" id="id-toolbar-full-placeholder-btn-inserttext"></span> <div class="elset">
<span class="btn-placeholder split" id="id-toolbar-full-placeholder-btn-insertequation"></span> <span class="btn-slot split" id="slot-btn-slidesize"></span>
</div> </div>
<div class="toolbar-row"> </div>
<span class="btn-placeholder split" id="id-toolbar-full-placeholder-btn-inserttable"></span> <div class="group" id="slot-field-styles" style="width: 100%; min-width: 140px;">
<span class="btn-placeholder split" id="id-toolbar-full-placeholder-btn-inserthyperlink"></span> </div>
<span class="btn-placeholder split" id="id-toolbar-full-placeholder-btn-insertshape"></span> <div class="group no-mask">
</div> <div class="elset">
</div> <span class="btn-slot split" id="slot-btn-hidebars"></span>
<div class="separator long" style="margin-left: 5px;"></div> </div>
<div class="toolbar-group"> <div class="elset">
<div class="toolbar-row"> <span class="btn-slot" id="slot-btn-settings"></span>
<span class="btn-placeholder split" id="id-toolbar-full-placeholder-btn-arrange-shape"></span> </div>
</div> </div>
<div class="toolbar-row"> </section>
<span class="btn-placeholder split" id="id-toolbar-full-placeholder-btn-align-shape"></span> <section class="panel" data-tab="ins">
</div> <div class="separator long"></div>
</div> <div class="group">
<div class="separator long" style="margin-left: 5px;"></div> <span class="btn-slot text x-huge" id="slot-btn-inserttable"></span>
<div class="toolbar-group"> </div>
<div class="toolbar-row"> <div class="separator long"></div>
<span class="btn-placeholder" id="id-toolbar-full-placeholder-btn-clearstyle"></span> <div class="group">
</div> <span class="btn-slot text x-huge slot-inserttext"></span>
<div class="toolbar-row"> <span class="btn-slot text x-huge slot-insertimg"></span>
<span class="btn-placeholder" id="id-toolbar-full-placeholder-btn-copystyle"></span> <span class="btn-slot text x-huge slot-insertshape"></span>
</div> <span class="btn-slot text x-huge" id="slot-btn-insertchart"></span>
</div> </div>
<div class="toolbar-group"> <div class="separator long"></div>
<div class="toolbar-row"> <div class="group">
<span class="btn-placeholder split" id="id-toolbar-full-placeholder-btn-colorschemas"></span> <span class="btn-slot text x-huge slot-comment"></span>
</div> <span class="btn-slot text x-huge" id="slot-btn-insertlink"></span>
<div class="toolbar-row"> </div>
<span class="btn-placeholder split" id="id-toolbar-full-placeholder-btn-slidesize"></span> <div class="separator long"></div>
</div> <div class="group">
</div> <span class="btn-slot text x-huge" id="slot-btn-insertequation"></span>
<div class="toolbar-group" id="id-toolbar-full-placeholder-field-styles" style="width: 100%; min-width: 140px;"> </div>
</div> </section>
<div class="toolbar-group no-mask"> </section>
<div class="toolbar-row"> </section>
<span class="btn-placeholder split" id="id-toolbar-full-placeholder-btn-hidebars"></span>
</div>
<div class="toolbar-row">
<span class="btn-placeholder" id="id-toolbar-full-placeholder-btn-settings"></span>
</div>
</div>
</div>
</div> </div>

View file

@ -1,12 +1,13 @@
<div class="layout-region"> <div class="layout-region">
<div id="pe-preview" style="position:absolute; left: 0; top: 0; display:none; width:100%; height:100%; z-index: 1;"></div> <div id="pe-preview" style="position:absolute; left: 0; top: 0; display:none; width:100%; height:100%; z-index: 1;"></div>
<section class="layout-ct">
<div id="file-menu-panel" class="toolbar-fullview-panel" style="display:none;"></div>
</section>
<div id="viewport-vbox-layout" class="layout-ct vbox"> <div id="viewport-vbox-layout" class="layout-ct vbox">
<div id="header" class="layout-item"></div>
<div id="toolbar" class="layout-item"></div> <div id="toolbar" class="layout-item"></div>
<div class="layout-item"> <div class="layout-item middle">
<div id="viewport-hbox-layout" class="layout-ct hbox"> <div id="viewport-hbox-layout" class="layout-ct hbox">
<div id="left-menu" class="layout-item" style="width: 40px;"></div> <div id="left-menu" class="layout-item" style="width: 40px;"></div>
<div id="file-menu-panel" class="left-menu-full-ct" style="display:none;"></div>
<div id="about-menu-panel" class="left-menu-full-ct" style="display:none;"></div> <div id="about-menu-panel" class="left-menu-full-ct" style="display:none;"></div>
<div id="editor_sdk" class="layout-item"></div> <div id="editor_sdk" class="layout-item"></div>
<div id="right-menu" class="layout-item"></div> <div id="right-menu" class="layout-item"></div>

View file

@ -49,6 +49,7 @@ define([
PE.Views.FileMenu = Common.UI.BaseView.extend(_.extend({ PE.Views.FileMenu = Common.UI.BaseView.extend(_.extend({
el: '#file-menu-panel', el: '#file-menu-panel',
options: {alias:'FileMenu'},
template: _.template(tpl), template: _.template(tpl),
@ -195,13 +196,11 @@ define([
panel = this.active || ((this.mode.canDownload && (!this.mode.isDesktopApp || !this.mode.isOffline)) ? 'saveas' : 'info'); panel = this.active || ((this.mode.canDownload && (!this.mode.isDesktopApp || !this.mode.isOffline)) ? 'saveas' : 'info');
this.$el.show(); this.$el.show();
this.selectMenu(panel); this.selectMenu(panel);
if (this.mode.isEdit) PE.getController('Toolbar').DisableToolbar(true);
this.api.asc_enableKeyEvents(false); this.api.asc_enableKeyEvents(false);
}, },
hide: function() { hide: function() {
this.$el.hide(); this.$el.hide();
if (this.mode.isEdit) PE.getController('Toolbar').DisableToolbar(false);
this.fireEvent('filemenu:hide', [this]); this.fireEvent('filemenu:hide', [this]);
this.api.asc_enableKeyEvents(true); this.api.asc_enableKeyEvents(true);
}, },
@ -312,6 +311,10 @@ define([
this.panels['info'].updateInfo(this.document); this.panels['info'].updateInfo(this.document);
}, },
isVisible: function () {
return !this.$el.is(':hidden');
},
btnSaveCaption : 'Save', btnSaveCaption : 'Save',
btnDownloadCaption : 'Download as...', btnDownloadCaption : 'Download as...',
btnInfoCaption : 'Document Info...', btnInfoCaption : 'Document Info...',

View file

@ -90,15 +90,6 @@ define([
el.html(this.template({ el.html(this.template({
})); }));
this.btnFile = new Common.UI.Button({
action: 'file',
el: $('#left-btn-file'),
hint: this.tipFile + Common.Utils.String.platformKey('Alt+F'),
enableToggle: true,
disabled: true,
toggleGroup: 'leftMenuGroup'
});
this.btnSearch = new Common.UI.Button({ this.btnSearch = new Common.UI.Button({
action: 'search', action: 'search',
el: $('#left-btn-search'), el: $('#left-btn-search'),
@ -169,13 +160,10 @@ define([
this.btnSearch.on('click', _.bind(this.onBtnMenuClick, this)); this.btnSearch.on('click', _.bind(this.onBtnMenuClick, this));
this.btnThumbs.on('click', _.bind(this.onBtnMenuClick, this)); this.btnThumbs.on('click', _.bind(this.onBtnMenuClick, this));
this.btnAbout.on('toggle', _.bind(this.onBtnMenuToggle, this)); this.btnAbout.on('toggle', _.bind(this.onBtnMenuToggle, this));
this.btnFile.on('toggle', _.bind(this.onBtnMenuToggle, this));
this.btnAbout.on('click', _.bind(this.onFullMenuClick, this)); this.btnAbout.on('click', _.bind(this.onFullMenuClick, this));
this.btnFile.on('click', _.bind(this.onFullMenuClick, this));
var menuFile = new PE.Views.FileMenu({}); this.menuFile = new PE.Views.FileMenu({});
menuFile.options = {alias:'FileMenu'}; this.menuFile.render();
this.btnFile.panel = menuFile.render();
this.btnAbout.panel = (new Common.Views.About({el: $('#about-menu-panel'), appName: 'Presentation Editor'})).render(); this.btnAbout.panel = (new Common.Views.About({el: $('#about-menu-panel'), appName: 'Presentation Editor'})).render();
return this; return this;
@ -196,12 +184,11 @@ define([
}, },
onBtnMenuClick: function(btn, e) { onBtnMenuClick: function(btn, e) {
var full_menu_pressed = (this.btnFile.pressed || this.btnAbout.pressed); var full_menu_pressed = this.btnAbout.pressed;
if (this.btnFile.pressed) this.btnFile.toggle(false);
if (this.btnAbout.pressed) this.btnAbout.toggle(false); if (this.btnAbout.pressed) this.btnAbout.toggle(false);
if (btn.options.action == 'search') { if (btn.options.action == 'search') {
full_menu_pressed && this.fireEvent('panel:show', [this.btnFile, 'files', false]); full_menu_pressed && this.fireEvent('panel:show', [this.btnAbout, 'files', false]);
return; return;
} else } else
if (btn.options.action == 'thumbs') { if (btn.options.action == 'thumbs') {
@ -282,7 +269,6 @@ define([
/** coauthoring end **/ /** coauthoring end **/
close: function(menu) { close: function(menu) {
this.btnFile.toggle(false);
this.btnAbout.toggle(false); this.btnAbout.toggle(false);
this.btnThumbs.toggle(false); this.btnThumbs.toggle(false);
this.$el.width(SCALE_MIN); this.$el.width(SCALE_MIN);
@ -308,7 +294,7 @@ define([
}, },
isOpened: function() { isOpened: function() {
var isopened = this.btnFile.pressed || this.btnSearch.pressed; var isopened = this.btnSearch.pressed;
/** coauthoring begin **/ /** coauthoring begin **/
!isopened && (isopened = this.btnComments.pressed || this.btnChat.pressed); !isopened && (isopened = this.btnComments.pressed || this.btnChat.pressed);
/** coauthoring end **/ /** coauthoring end **/
@ -316,7 +302,6 @@ define([
}, },
disableMenu: function(menu, disable) { disableMenu: function(menu, disable) {
this.btnFile.setDisabled(disable);
this.btnSearch.setDisabled(disable); this.btnSearch.setDisabled(disable);
this.btnThumbs.setDisabled(disable); this.btnThumbs.setDisabled(disable);
this.btnAbout.setDisabled(disable); this.btnAbout.setDisabled(disable);
@ -330,12 +315,8 @@ define([
showMenu: function(menu) { showMenu: function(menu) {
var re = /^(\w+):?(\w*)$/.exec(menu); var re = /^(\w+):?(\w*)$/.exec(menu);
if (re[1] == 'file' && this.btnFile.isVisible()) { if ( re[1] == 'file' ) {
if (!this.btnFile.pressed) { this.menuFile.show(re[2].length ? re[2] : undefined);
this.btnFile.toggle(true);
// this.onBtnMenuClick(this.btnFile);
}
this.btnFile.panel.show(re[2].length ? re[2] : undefined);
} else { } else {
/** coauthoring begin **/ /** coauthoring begin **/
if (menu == 'chat') { if (menu == 'chat') {
@ -362,7 +343,7 @@ define([
getMenu: function(type) { getMenu: function(type) {
switch (type) { switch (type) {
default: return null; default: return null;
case 'file': return this.btnFile.panel; case 'file': return this.menuFile;
case 'about': return this.btnAbout.panel; case 'about': return this.btnAbout.panel;
} }
}, },
@ -398,7 +379,6 @@ define([
/** coauthoring end **/ /** coauthoring end **/
tipAbout : 'About', tipAbout : 'About',
tipSupport : 'Feedback & Support', tipSupport : 'Feedback & Support',
tipFile : 'File',
tipSearch : 'Search', tipSearch : 'Search',
tipSlides: 'Slides', tipSlides: 'Slides',
tipPlugins : 'Plugins', tipPlugins : 'Plugins',

View file

@ -70,22 +70,7 @@ define([
el: '#statusbar', el: '#statusbar',
template: _.template(template), template: _.template(template),
storeUsers: undefined, events: {},
tplUser: ['<li id="status-chat-user-<%= user.get("id") %>" class="<% if (!user.get("online")) { %> offline <% } if (user.get("view")) {%> viewmode <% } %>">',
'<div class="color" style="background-color: <%= user.get("color") %>;" >',
'<label class="name"><%= scope.getUserName(user.get("username")) %></label>',
'</div>',
'</li>'].join(''),
templateUserList: _.template('<ul>' +
'<% _.each(users, function(item) { %>' +
'<%= _.template(usertpl, {user: item, scope: scope}) %>' +
'<% }); %>' +
'</ul>'),
events: {
},
api: undefined, api: undefined,
pages: undefined, pages: undefined,
@ -164,39 +149,6 @@ define([
this.zoomMenu.render($('.cnt-zoom',this.el)); this.zoomMenu.render($('.cnt-zoom',this.el));
this.zoomMenu.cmpEl.attr({tabindex: -1}); this.zoomMenu.cmpEl.attr({tabindex: -1});
/** coauthoring begin **/
this.panelUsersList = $('#status-users-list', this.el);
this.storeUsers.bind({
add : _.bind(this._onAddUser, this),
change : _.bind(this._onUsersChanged, this),
reset : _.bind(this._onResetUsers, this)
});
this.panelUsers = $('#status-users-ct', this.el);
this.panelUsers.on('shown.bs.dropdown', function () {
me.panelUsersList.scroller.update({minScrollbarLength : 40, alwaysVisibleY: true});
var tip = me.panelUsersBlock.data('bs.tooltip');
if (tip) tip.hide();
});
this.panelUsersBlock = this.panelUsers.find('#status-users-block');
this.panelUsersBlock.tooltip({
title: this.tipAccessRights,
html: true,
placement: 'top'
});
this.panelUsersBlock.on('click', _.bind(this.onUsersClick, this));
this.lblUserCount = this.panelUsers.find('#status-users-count');
this.lblChangeRights = this.panelUsers.find('#status-change-rights');
this.lblChangeRights.on('click', _.bind(this.onUsersClick, this));
this.$el.find('#status-users-menu').on('click', function() {
return false;
});
/** coauthoring end **/
this.txtGoToPage = new Common.UI.InputField({ this.txtGoToPage = new Common.UI.InputField({
el : $('#status-goto-page'), el : $('#status-goto-page'),
allowBlank : true, allowBlank : true,
@ -280,11 +232,6 @@ define([
if (this.api) { if (this.api) {
this.api.asc_registerCallback('asc_onCountPages', _.bind(_onCountPages, this)); this.api.asc_registerCallback('asc_onCountPages', _.bind(_onCountPages, this));
this.api.asc_registerCallback('asc_onCurrentPage', _.bind(_onCurrentPage, this)); this.api.asc_registerCallback('asc_onCurrentPage', _.bind(_onCurrentPage, this));
/** coauthoring begin **/
this.api.asc_registerCallback('asc_onAuthParticipantsChanged', _.bind(this.onApiUsersChanged, this));
this.api.asc_registerCallback('asc_onParticipantsChanged', _.bind(this.onApiUsersChanged, this));
/** coauthoring end **/
} }
return this; return this;
@ -294,8 +241,6 @@ define([
setMode: function(mode) { setMode: function(mode) {
this.mode = mode; this.mode = mode;
this.$el.find('.el-edit')[this.mode.isEdit?'show':'hide'](); this.$el.find('.el-edit')[this.mode.isEdit?'show':'hide']();
this.lblChangeRights[(!this.mode.isOffline && this.mode.sharingSettingsUrl&&this.mode.sharingSettingsUrl.length)?'show':'hide']();
this.panelUsers[(!this.mode.isOffline && this.mode.sharingSettingsUrl&&this.mode.sharingSettingsUrl.length)?'show':'hide']();
}, },
setVisible: function(visible) { setVisible: function(visible) {
@ -304,69 +249,6 @@ define([
: this.hide(); : this.hide();
}, },
/** coauthoring begin **/
onUsersClick: function() {
this.panelUsers.removeClass('open');
this.fireEvent('click:users', this);
},
onApiUsersChanged: function(users) {
var length = 0;
_.each(users, function(item){
if (!item.asc_getView())
length++;
});
this.panelUsers[(length>1 || this.mode.sharingSettingsUrl&&this.mode.sharingSettingsUrl.length)?'show':'hide']();
this.lblUserCount.css({
'font-size': (length > 1 ? '11px' : '14px'),
'font-weight': (length > 1 ? 'bold' : 'normal'),
'margin-top': (length > 1 ? '0' : '-1px')
});
this.lblUserCount.text(length > 1 ? length : '+');
$('#status-users-icon').css('margin-bottom', length > 1 ? '0' : '2px');
var usertip = this.panelUsersBlock.data('bs.tooltip');
if (usertip) {
usertip.options.title = (length > 1) ? this.tipViewUsers : this.tipAccessRights;
usertip.setContent();
}
(length > 1) ? this.panelUsersBlock.attr('data-toggle', 'dropdown') : this.panelUsersBlock.removeAttr('data-toggle');
this.panelUsersBlock.toggleClass('dropdown-toggle', length > 1);
(length > 1) ? this.panelUsersBlock.off('click') : this.panelUsersBlock.on('click', _.bind(this.onUsersClick, this));
},
_onAddUser: function(m, c, opts) {
if (this.panelUsersList) {
this.panelUsersList.find('ul').append(_.template(this.tplUser, {user: m, scope: this}));
this.panelUsersList.scroller.update({minScrollbarLength : 40, alwaysVisibleY: true});
}
},
_onUsersChanged: function(m) {
if (m.changed.online != undefined && this.panelUsersList) {
this.panelUsersList.find('#status-chat-user-'+ m.get('id'))[m.changed.online?'removeClass':'addClass']('offline');
this.panelUsersList.scroller.update({minScrollbarLength : 40, alwaysVisibleY: true});
}
},
_onResetUsers: function(c, opts) {
if (this.panelUsersList) {
this.panelUsersList.html(this.templateUserList({users: c.models, usertpl: this.tplUser, scope: this}));
this.panelUsersList.scroller = new Common.UI.Scroller({
el : $('#status-users-list ul'),
useKeyboard : true,
minScrollbarLength : 40,
alwaysVisibleY: true
});
}
},
getUserName: function (username) {
return Common.Utils.String.htmlEncode(username);
},
/** coauthoring end **/
showStatusMessage: function(message) { showStatusMessage: function(message) {
$('#status-label-action').text(message); $('#status-label-action').text(message);
}, },
@ -377,9 +259,6 @@ define([
pageIndexText : 'Slide {0} of {1}', pageIndexText : 'Slide {0} of {1}',
goToPageText : 'Go to Slide', goToPageText : 'Go to Slide',
tipUsers : 'Document is currently being edited by several users.',
tipMoreUsers : 'and %1 users.',
tipShowUsers : 'To see all users click the icon below.',
tipFitPage : 'Fit to Slide', tipFitPage : 'Fit to Slide',
tipFitWidth : 'Fit to Width', tipFitWidth : 'Fit to Width',
tipZoomIn : 'Zoom In', tipZoomIn : 'Zoom In',
@ -387,9 +266,7 @@ define([
tipZoomFactor : 'Magnification', tipZoomFactor : 'Magnification',
txtPageNumInvalid: 'Slide number invalid', txtPageNumInvalid: 'Slide number invalid',
tipPreview : 'Start Slideshow', tipPreview : 'Start Slideshow',
tipAccessRights : 'Manage document access rights', tipAccessRights : 'Manage document access rights'
tipViewUsers : 'View users and manage document access rights',
txAccessRights : 'Change access rights'
}, PE.Views.Statusbar || {})); }, PE.Views.Statusbar || {}));
} }
); );

File diff suppressed because it is too large Load diff

View file

@ -87,15 +87,12 @@ define([
box: $container, box: $container,
items: [{ items: [{
el: items[0], el: items[0],
rely: true height: Common.localStorage.getBool('pe-compact-toolbar') ? 40 : 40+67
}, { }, {
el: items[1], el: items[1],
rely: true
}, {
el: items[2],
stretch: true stretch: true
}, { }, {
el: items[3], el: items[2],
height: 25 height: 25
}] }]
}); });
@ -126,17 +123,10 @@ define([
}, },
applyEditorMode: function() { applyEditorMode: function() {
var me = this, PE.getController('RightMenu').getView('RightMenu').render();
toolbarView = PE.getController('Toolbar').getView('Toolbar'),
rightMenuView = PE.getController('RightMenu').getView('RightMenu'),
statusBarView = PE.getController('Statusbar').getView('Statusbar');
me._toolbar = toolbarView.render(this.mode); if ( Common.localStorage.getBool('pe-hidden-status') )
me._rightMenu = rightMenuView.render(); PE.getController('Statusbar').getView('Statusbar').setVisible(false);
var value = Common.localStorage.getItem('pe-hidden-status');
if (value !== null && parseInt(value) == 1)
statusBarView.setVisible(false);
}, },
setMode: function(mode, delay) { setMode: function(mode, delay) {

View file

@ -78,10 +78,22 @@
"Common.Views.ExternalDiagramEditor.textClose": "Close", "Common.Views.ExternalDiagramEditor.textClose": "Close",
"Common.Views.ExternalDiagramEditor.textSave": "Save & Exit", "Common.Views.ExternalDiagramEditor.textSave": "Save & Exit",
"Common.Views.ExternalDiagramEditor.textTitle": "Chart Editor", "Common.Views.ExternalDiagramEditor.textTitle": "Chart Editor",
"Common.Views.Header.openNewTabText": "Open in New Tab", "del_Common.Views.Header.openNewTabText": "Open in New Tab",
"Common.Views.Header.textBack": "Go to Documents", "del_Common.Views.Header.textBack": "Go to Documents",
"del_Common.Views.Header.txtHeaderDeveloper": "DEVELOPER MODE", "del_Common.Views.Header.txtHeaderDeveloper": "DEVELOPER MODE",
"del_Common.Views.Header.txtRename": "Rename",
"Common.Views.Header.itemBackNewTab": "Open in New Tab",
"Common.Views.Header.itemBackCurrTab": "Open in Current Tab",
"Common.Views.Header.textSaveBegin": "Saving...",
"Common.Views.Header.textSaveEnd": "All changes saved",
"Common.Views.Header.textSaveChanged": "Modified",
"Common.Views.Header.textSaveExpander": "All changes saved",
"Common.Views.Header.textBack": "Go to Documents",
"Common.Views.Header.txtHeaderDeveloper": "DEVELOPER MODE",
"Common.Views.Header.txtRename": "Rename", "Common.Views.Header.txtRename": "Rename",
"Common.Views.Header.txtAccessRights": "Change access rights",
"Common.Views.Header.tipAccessRights": "Manage document access rights",
"Common.Views.Header.labelCoUsersDescr": "Document is currently being edited by several users.",
"Common.Views.ImageFromUrlDialog.cancelButtonText": "Cancel", "Common.Views.ImageFromUrlDialog.cancelButtonText": "Cancel",
"Common.Views.ImageFromUrlDialog.okButtonText": "OK", "Common.Views.ImageFromUrlDialog.okButtonText": "OK",
"Common.Views.ImageFromUrlDialog.textUrl": "Paste an image URL:", "Common.Views.ImageFromUrlDialog.textUrl": "Paste an image URL:",
@ -166,8 +178,8 @@
"PE.Controllers.Main.saveErrorText": "An error has occurred while saving the file", "PE.Controllers.Main.saveErrorText": "An error has occurred while saving the file",
"PE.Controllers.Main.savePreparingText": "Preparing to save", "PE.Controllers.Main.savePreparingText": "Preparing to save",
"PE.Controllers.Main.savePreparingTitle": "Preparing to save. Please wait...", "PE.Controllers.Main.savePreparingTitle": "Preparing to save. Please wait...",
"PE.Controllers.Main.saveTextText": "Saving presentation...", "del_PE.Controllers.Main.saveTextText": "Saving presentation...",
"PE.Controllers.Main.saveTitleText": "Saving Presentation", "del_PE.Controllers.Main.saveTitleText": "Saving Presentation",
"PE.Controllers.Main.splitDividerErrorText": "The number of rows must be a divisor of %1.", "PE.Controllers.Main.splitDividerErrorText": "The number of rows must be a divisor of %1.",
"PE.Controllers.Main.splitMaxColsErrorText": "The number of columns must be less than %1.", "PE.Controllers.Main.splitMaxColsErrorText": "The number of columns must be less than %1.",
"PE.Controllers.Main.splitMaxRowsErrorText": "The number of rows must be less than %1.", "PE.Controllers.Main.splitMaxRowsErrorText": "The number of rows must be less than %1.",
@ -247,7 +259,7 @@
"PE.Controllers.Main.warnProcessRightsChange": "You have been denied the right to edit the file.", "PE.Controllers.Main.warnProcessRightsChange": "You have been denied the right to edit the file.",
"PE.Controllers.Main.titleServerVersion": "Editor updated", "PE.Controllers.Main.titleServerVersion": "Editor updated",
"PE.Controllers.Main.errorServerVersion": "The editor version has been updated. The page will be reloaded to apply the changes.", "PE.Controllers.Main.errorServerVersion": "The editor version has been updated. The page will be reloaded to apply the changes.",
"PE.Controllers.Main.textChangesSaved": "All changes saved", "del_PE.Controllers.Main.textChangesSaved": "All changes saved",
"PE.Controllers.Main.errorBadImageUrl": "Image URL is incorrect", "PE.Controllers.Main.errorBadImageUrl": "Image URL is incorrect",
"PE.Controllers.Statusbar.zoomText": "Zoom {0}%", "PE.Controllers.Statusbar.zoomText": "Zoom {0}%",
"PE.Controllers.Toolbar.confirmAddFontName": "The font you are going to save is not available on the current device.<br>The text style will be displayed using one of the system fonts, the saved font will be used when it is available.<br>Do you want to continue?", "PE.Controllers.Toolbar.confirmAddFontName": "The font you are going to save is not available on the current device.<br>The text style will be displayed using one of the system fonts, the saved font will be used when it is available.<br>Do you want to continue?",
@ -870,7 +882,7 @@
"PE.Views.LeftMenu.tipAbout": "About", "PE.Views.LeftMenu.tipAbout": "About",
"PE.Views.LeftMenu.tipChat": "Chat", "PE.Views.LeftMenu.tipChat": "Chat",
"PE.Views.LeftMenu.tipComments": "Comments", "PE.Views.LeftMenu.tipComments": "Comments",
"PE.Views.LeftMenu.tipFile": "File", "del_PE.Views.LeftMenu.tipFile": "File",
"PE.Views.LeftMenu.tipPlugins": "Plugins", "PE.Views.LeftMenu.tipPlugins": "Plugins",
"PE.Views.LeftMenu.tipSearch": "Search", "PE.Views.LeftMenu.tipSearch": "Search",
"PE.Views.LeftMenu.tipSlides": "Slides", "PE.Views.LeftMenu.tipSlides": "Slides",
@ -1097,15 +1109,15 @@
"PE.Views.Statusbar.tipAccessRights": "Manage document access rights", "PE.Views.Statusbar.tipAccessRights": "Manage document access rights",
"PE.Views.Statusbar.tipFitPage": "Fit to Slide", "PE.Views.Statusbar.tipFitPage": "Fit to Slide",
"PE.Views.Statusbar.tipFitWidth": "Fit to Width", "PE.Views.Statusbar.tipFitWidth": "Fit to Width",
"PE.Views.Statusbar.tipMoreUsers": "and %1 users.", "del_PE.Views.Statusbar.tipMoreUsers": "and %1 users.",
"PE.Views.Statusbar.tipPreview": "Start Slideshow", "PE.Views.Statusbar.tipPreview": "Start Slideshow",
"PE.Views.Statusbar.tipShowUsers": "To see all users click the icon below.", "del_PE.Views.Statusbar.tipShowUsers": "To see all users click the icon below.",
"PE.Views.Statusbar.tipUsers": "Document is currently being edited by several users.", "del_PE.Views.Statusbar.tipUsers": "Document is currently being edited by several users.",
"PE.Views.Statusbar.tipViewUsers": "View users and manage document access rights", "del_PE.Views.Statusbar.tipViewUsers": "View users and manage document access rights",
"PE.Views.Statusbar.tipZoomFactor": "Magnification", "PE.Views.Statusbar.tipZoomFactor": "Magnification",
"PE.Views.Statusbar.tipZoomIn": "Zoom In", "PE.Views.Statusbar.tipZoomIn": "Zoom In",
"PE.Views.Statusbar.tipZoomOut": "Zoom Out", "PE.Views.Statusbar.tipZoomOut": "Zoom Out",
"PE.Views.Statusbar.txAccessRights": "Change access rights", "del_PE.Views.Statusbar.txAccessRights": "Change access rights",
"PE.Views.Statusbar.txtPageNumInvalid": "Invalid slide number", "PE.Views.Statusbar.txtPageNumInvalid": "Invalid slide number",
"PE.Views.TableSettings.deleteColumnText": "Delete Column", "PE.Views.TableSettings.deleteColumnText": "Delete Column",
"PE.Views.TableSettings.deleteRowText": "Delete Row", "PE.Views.TableSettings.deleteRowText": "Delete Row",
@ -1258,6 +1270,17 @@
"PE.Views.Toolbar.textTitleError": "Error", "PE.Views.Toolbar.textTitleError": "Error",
"PE.Views.Toolbar.textUnderline": "Underline", "PE.Views.Toolbar.textUnderline": "Underline",
"PE.Views.Toolbar.textZoom": "Zoom", "PE.Views.Toolbar.textZoom": "Zoom",
"PE.Views.Toolbar.capInsertText": "Text Box",
"PE.Views.Toolbar.capInsertImage": "Picture",
"PE.Views.Toolbar.capInsertShape": "Shape",
"PE.Views.Toolbar.capInsertTable": "Table",
"PE.Views.Toolbar.capInsertChart": "Chart",
"PE.Views.Toolbar.capInsertHyperlink": "Hyperlink",
"PE.Views.Toolbar.capInsertEquation": "Equation",
"PE.Views.Toolbar.capAddSlide": "Add Slide",
"PE.Views.Toolbar.capTabFile": "File",
"PE.Views.Toolbar.capTabHome": "Home",
"PE.Views.Toolbar.capTabInsert": "Insert",
"PE.Views.Toolbar.tipAddSlide": "Add Slide", "PE.Views.Toolbar.tipAddSlide": "Add Slide",
"PE.Views.Toolbar.tipAdvSettings": "Advanced Settings", "PE.Views.Toolbar.tipAdvSettings": "Advanced Settings",
"PE.Views.Toolbar.tipBack": "Back", "PE.Views.Toolbar.tipBack": "Back",
@ -1283,9 +1306,9 @@
"PE.Views.Toolbar.tipInsertText": "Insert Text", "PE.Views.Toolbar.tipInsertText": "Insert Text",
"PE.Views.Toolbar.tipLineSpace": "Line Spacing", "PE.Views.Toolbar.tipLineSpace": "Line Spacing",
"PE.Views.Toolbar.tipMarkers": "Bullets", "PE.Views.Toolbar.tipMarkers": "Bullets",
"PE.Views.Toolbar.tipNewDocument": "New Presentation", "del_PE.Views.Toolbar.tipNewDocument": "New Presentation",
"PE.Views.Toolbar.tipNumbers": "Numbering", "PE.Views.Toolbar.tipNumbers": "Numbering",
"PE.Views.Toolbar.tipOpenDocument": "Open Presentation", "del_PE.Views.Toolbar.tipOpenDocument": "Open Presentation",
"PE.Views.Toolbar.tipPaste": "Paste", "PE.Views.Toolbar.tipPaste": "Paste",
"PE.Views.Toolbar.tipPreview": "Start Slideshow", "PE.Views.Toolbar.tipPreview": "Start Slideshow",
"PE.Views.Toolbar.tipPrint": "Print", "PE.Views.Toolbar.tipPrint": "Print",

View file

@ -111,6 +111,7 @@
@import "../../../../common/main/resources/less/common.less"; @import "../../../../common/main/resources/less/common.less";
@import "../../../../common/main/resources/less/opendialog.less"; @import "../../../../common/main/resources/less/opendialog.less";
@import "../../../../common/main/resources/less/plugins.less"; @import "../../../../common/main/resources/less/plugins.less";
@import "../../../../common/main/resources/less/toolbar.less";
// App // App
// -------------------------------------------------- // --------------------------------------------------

View file

@ -1,72 +1,6 @@
.toolbar { .toolbar {
padding: 10px 0; z-index: 101;
background-color: @gray-light;
.box-inner-shadow(0 -1px 0 @gray-dark);
.toolbar-group {
display: table-cell;
vertical-align: top;
white-space: nowrap;
padding-left: 12px;
&:last-child {
padding-right: 12px;
}
}
.toolbar-row {
height: 20px;
font-size: 0;
&:not(:first-child) {
margin-top: 6px;
}
}
.separator {
margin-left: 12px;
&.long {
height: 46px;
}
&.short {
height: 20px;
}
}
.btn-placeholder {
// background-color: red;
display: inline-block;
width: 20px;
height: 20px;
&:not(:first-child) {
margin-left: 1px;
}
&.large {
width: 31px;
height: 31px;
margin: 8px 0;
&.split {
width: 40px;
}
}
&.split {
width: 28px;
}
&.border {
border: 1px solid @gray;
.border-radius(1px);
width: 22px;
height: 22px;
}
}
&.masked { &.masked {
.btn-toolbar.disabled .btn-icon:not(.btn-print):not(.btn-save):not(.btn-save-coauth):not(.btn-settings):not(.btn-hidebars) { .btn-toolbar.disabled .btn-icon:not(.btn-print):not(.btn-save):not(.btn-save-coauth):not(.btn-settings):not(.btn-hidebars) {
@ -323,7 +257,10 @@
.toolbar-btn-icon(btn-linespace, 36, @toolbar-icon-size); .toolbar-btn-icon(btn-linespace, 36, @toolbar-icon-size);
.toolbar-btn-icon(btn-arrange-shape, 37, @toolbar-icon-size); .toolbar-btn-icon(btn-arrange-shape, 37, @toolbar-icon-size);
.toolbar-btn-icon(btn-align-shape, 38, @toolbar-icon-size); .toolbar-btn-icon(btn-align-shape, 38, @toolbar-icon-size);
.toolbar-btn-icon(btn-insertshape, 39, @toolbar-icon-size);
//.toolbar-btn-icon(btn-insertshape, 39, @toolbar-icon-size);
.button-normal-icon(btn-insertshape, 39, @toolbar-icon-size);
.toolbar-btn-icon(btn-inserttext, 40, @toolbar-icon-size); .toolbar-btn-icon(btn-inserttext, 40, @toolbar-icon-size);
.toolbar-btn-icon(btn-inserthyperlink, 41, @toolbar-icon-size); .toolbar-btn-icon(btn-inserthyperlink, 41, @toolbar-icon-size);
.toolbar-btn-icon(btn-inserttable, 42, @toolbar-icon-size); .toolbar-btn-icon(btn-inserttable, 42, @toolbar-icon-size);
@ -338,6 +275,8 @@
.toolbar-btn-icon(btn-save-coauth, 69, @toolbar-icon-size); .toolbar-btn-icon(btn-save-coauth, 69, @toolbar-icon-size);
.toolbar-btn-icon(btn-insertequation, 74, @toolbar-icon-size); .toolbar-btn-icon(btn-insertequation, 74, @toolbar-icon-size);
.button-otherstates-icon2(btn-toolbar, @toolbar-icon-size);
// add slide // add slide
.btn-toolbar .btn-addslide {background-position: 0 -120px;} .btn-toolbar .btn-addslide {background-position: 0 -120px;}
.btn-toolbar.active > .btn-addslide, .btn-toolbar.active > .btn-addslide,
@ -383,7 +322,7 @@
border: none; border: none;
border-radius: 0; border-radius: 0;
padding: 3px 10px; padding: 3px 10px;
color: #ffffff; color: #fff;
font: 11px arial; font: 11px arial;
white-space: nowrap; white-space: nowrap;
letter-spacing: 1px; letter-spacing: 1px;
@ -392,4 +331,4 @@
.item-equation { .item-equation {
border: 1px solid @gray; border: 1px solid @gray;
.background-ximage('@{app-image-path}/toolbar/math.png', '@{app-image-path}/toolbar/math@2x.png', 1500px); .background-ximage('@{app-image-path}/toolbar/math.png', '@{app-image-path}/toolbar/math@2x.png', 1500px);
} }