')
- });
- if (equationGroup.get('groupHeight').length) {
-
- me.equationPickers.push(equationPicker);
- me.toolbar.btnInsertEquation.menu.on('show:after', function () {
-
- if (me.equationPickers.length) {
- var element = $(this.el).find('.over').find('.menu-shape');
- if (element.length) {
- for (var i = 0; i < me.equationPickers.length; ++i) {
- if (element[0].id == me.equationPickers[i].el.id) {
- me.equationPickers[i].scroller.update({alwaysVisibleY: true});
- me.equationPickers.splice(i, 1);
- return;
- }
- }
- }
- }
- });
- }
-
- equationPicker.on('item:click', function(picker, item, record, e) {
- if (me.api) {
- if (record)
- me.api.asc_AddMath(record.get('data').equationType);
-
- if (me.toolbar.btnInsertText.pressed) {
- me.toolbar.btnInsertText.toggle(false, true);
- }
- if (me.toolbar.btnInsertShape.pressed) {
- me.toolbar.btnInsertShape.toggle(false, true);
- }
-
- if (e.type !== 'click')
- me.toolbar.btnInsertEquation.menu.hide();
- Common.NotificationCenter.trigger('edit:complete', me.toolbar, me.toolbar.btnInsertEquation);
- Common.component.Analytics.trackEvent('ToolBar', 'Add Equation');
- }
- });
}
},
@@ -2453,6 +2460,16 @@ define([
Common.NotificationCenter.trigger('edit:complete', this.toolbar, this.toolbar.btnInsertEquation);
},
+ onApiMathTypes: function(equation) {
+ this._equationTemp = equation;
+ var me = this;
+ var onShowBefore = function(menu) {
+ me.onMathTypes(me._equationTemp);
+ me.toolbar.btnInsertEquation.menu.off('show:before', onShowBefore);
+ };
+ me.toolbar.btnInsertEquation.menu.on('show:before', onShowBefore);
+ },
+
onMathTypes: function(equation) {
var equationgrouparray = [],
equationsStore = this.getCollection('EquationGroups');
@@ -2493,35 +2510,29 @@ define([
translationTable[Common.define.c_oAscMathType[name]] = this[translate];
}
}
-
- var i,id = 0, count = 0, length = 0, width = 0, height = 0, store = null, list = null, eqStore = null, eq = null;
+ var i,id = 0, count = 0, length = 0, width = 0, height = 0, store = null, list = null, eqStore = null, eq = null, data;
if (equation) {
-
- count = equation.get_Data().length;
-
+ data = equation.get_Data();
+ count = data.length;
if (count) {
for (var j = 0; j < count; ++j) {
- id = equation.get_Data()[j].get_Id();
- width = equation.get_Data()[j].get_W();
- height = equation.get_Data()[j].get_H();
+ var group = data[j];
+ id = group.get_Id();
+ width = group.get_W();
+ height = group.get_H();
store = new Backbone.Collection([], {
model: DE.Models.EquationModel
});
if (store) {
-
- var allItemsCount = 0, itemsCount = 0, ids = 0;
-
- length = equation.get_Data()[j].get_Data().length;
-
+ var allItemsCount = 0, itemsCount = 0, ids = 0, arr = [];
+ length = group.get_Data().length;
for (i = 0; i < length; ++i) {
- eqStore = equation.get_Data()[j].get_Data()[i];
-
+ eqStore = group.get_Data()[i];
itemsCount = eqStore.get_Data().length;
for (var p = 0; p < itemsCount; ++p) {
-
eq = eqStore.get_Data()[p];
ids = eq.get_Id();
@@ -2530,8 +2541,7 @@ define([
if (translationTable.hasOwnProperty(ids)) {
translate = translationTable[ids];
}
-
- store.add({
+ arr.push({
data : {equationType: ids},
tip : translate,
allowSelected : true,
@@ -2545,7 +2555,7 @@ define([
allItemsCount += itemsCount;
}
-
+ store.add(arr);
width = c_oAscMathMainTypeStrings[id][1] * (width + 10); // 4px margin + 4px margin + 1px border + 1px border
var normHeight = parseInt(370 / (height + 10)) * (height + 10);
@@ -2557,57 +2567,12 @@ define([
});
}
}
-
equationsStore.add(equationgrouparray);
-
this.fillEquations();
}
}
},
- fillTextArt: function() {
- if (!this.toolbar.btnInsertTextArt.rendered) return;
-
- var me = this;
- if (this.toolbar.mnuTextArtPicker) {
- var models = this.getApplication().getCollection('Common.Collections.TextArt').models,
- count = this.toolbar.mnuTextArtPicker.store.length;
- 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.btnInsertTextArt.menu,
- showLast: false,
- itemTemplate: _.template('
')
- });
-
- this.toolbar.mnuTextArtPicker.on('item:click', function(picker, item, record, e) {
- if (me.api) {
- if (record) {
- 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.btnInsertTextArt.menu.hide();
- Common.NotificationCenter.trigger('edit:complete', me.toolbar, me.toolbar.btnInsertTextArt);
- Common.component.Analytics.trackEvent('ToolBar', 'Add Text Art');
- }
- });
- }
- },
-
activateControls: function() {
_.each(this.toolbar.toolbarControls, function(item){
item.setDisabled(false);
diff --git a/apps/documenteditor/main/app/controller/Viewport.js b/apps/documenteditor/main/app/controller/Viewport.js
index eef6af3e7..54ad031fd 100644
--- a/apps/documenteditor/main/app/controller/Viewport.js
+++ b/apps/documenteditor/main/app/controller/Viewport.js
@@ -116,11 +116,20 @@ define([
Common.NotificationCenter.on('api:disconnect', this.onApiCoAuthoringDisconnect.bind(this));
},
+ getApi: function() {
+ return this.api;
+ },
// When our application is ready, lets get started
onLaunch: function() {
// Create and render main view
this.viewport = this.createView('Viewport').render();
+
+ this.api = new Asc.asc_docs_api({
+ 'id-view' : 'editor_sdk',
+ 'translate': this.getApplication().getController('Main').translationTable
+ });
+
this.header = this.createView('Common.Views.Header', {
headerCaption: 'Document Editor',
storeUsers: DE.getCollection('Common.Collections.Users')
diff --git a/apps/documenteditor/main/app/view/ChartSettings.js b/apps/documenteditor/main/app/view/ChartSettings.js
index c0eedc91d..64eb011be 100644
--- a/apps/documenteditor/main/app/view/ChartSettings.js
+++ b/apps/documenteditor/main/app/view/ChartSettings.js
@@ -84,16 +84,16 @@ define([
this._originalProps = null;
this.render();
-
- this.labelWidth = $(this.el).find('#chart-label-width');
- this.labelHeight = $(this.el).find('#chart-label-height');
},
render: function () {
- var el = $(this.el);
+ var el = this.$el || $(this.el);
el.html(this.template({
scope: this
}));
+
+ this.labelWidth = el.find('#chart-label-width');
+ this.labelHeight = el.find('#chart-label-height');
},
setApi: function(api) {
diff --git a/apps/documenteditor/main/app/view/DocumentHolder.js b/apps/documenteditor/main/app/view/DocumentHolder.js
index a9344feff..6d3301d82 100644
--- a/apps/documenteditor/main/app/view/DocumentHolder.js
+++ b/apps/documenteditor/main/app/view/DocumentHolder.js
@@ -743,21 +743,11 @@ define([
};
this.changeLanguageMenu = function(menu) {
- var i;
if (me._currLang.id===null || me._currLang.id===undefined) {
- for (i=0; i
-1) && !menu.items[index].checked && menu.setChecked(index, true);
}
};
@@ -1850,11 +1840,6 @@ define([
}
},
- updateThemeColors: function() {
- this.effectcolors = Common.Utils.ThemeColor.getEffectColors();
- this.standartcolors = Common.Utils.ThemeColor.getStandartColors();
- },
-
onCutCopyPaste: function(item, e) {
var me = this;
if (me.api) {
@@ -2773,13 +2758,21 @@ define([
})
});
+ var langTemplate = _.template([
+ '',
+ '',
+ '<%= caption %>',
+ ''
+ ].join(''));
+
me.langTableMenu = new Common.UI.MenuItem({
caption : me.langText,
- menu : new Common.UI.Menu({
+ menu : new Common.UI.MenuSimple({
cls: 'lang-menu',
menuAlign: 'tl-tr',
restoreHeight: 285,
items : [],
+ itemTemplate: langTemplate,
search: true
})
});
@@ -3426,11 +3419,12 @@ define([
me.langParaMenu = new Common.UI.MenuItem({
caption : me.langText,
- menu : new Common.UI.Menu({
+ menu : new Common.UI.MenuSimple({
cls: 'lang-menu',
menuAlign: 'tl-tr',
restoreHeight: 285,
items : [],
+ itemTemplate: langTemplate,
search: true
})
});
@@ -3828,58 +3822,39 @@ define([
var me = this;
if (langs && langs.length > 0 && me.langParaMenu && me.langTableMenu) {
- me.langParaMenu.menu.removeAll();
- me.langTableMenu.menu.removeAll();
- _.each(langs, function(lang, index){
- me.langParaMenu.menu.addItem(new Common.UI.MenuItem({
+ var arrPara = [], arrTable = [];
+ _.each(langs, function(lang) {
+ var item = {
caption : lang.displayValue,
value : lang.value,
checkable : true,
- toggleGroup : 'popupparalang',
langid : lang.code,
- spellcheck : lang.spellcheck,
- template: _.template([
- '',
- '',
- '<%= caption %>',
- ''
- ].join(''))
- }).on('click', function(item, e){
- if (me.api){
- if (!_.isUndefined(item.options.langid))
- me.api.put_TextPrLang(item.options.langid);
+ spellcheck : lang.spellcheck
+ };
+ arrPara.push(item);
+ arrTable.push(_.clone(item));
+ });
+ me.langParaMenu.menu.resetItems(arrPara);
+ me.langTableMenu.menu.resetItems(arrTable);
- me._currLang.paraid = item.options.langid;
- me.langParaMenu.menu.currentCheckedItem = item;
+ me.langParaMenu.menu.on('item:click', function(menu, item){
+ if (me.api){
+ if (!_.isUndefined(item.langid))
+ me.api.put_TextPrLang(item.langid);
- me.fireEvent('editcomplete', me);
- }
- }));
+ me._currLang.paraid = item.langid;
+ me.fireEvent('editcomplete', me);
+ }
+ });
- me.langTableMenu.menu.addItem(new Common.UI.MenuItem({
- caption : lang.displayValue,
- value : lang.value,
- checkable : true,
- toggleGroup : 'popuptablelang',
- langid : lang.code,
- spellcheck : lang.spellcheck,
- template: _.template([
- '',
- '',
- '<%= caption %>',
- ''
- ].join(''))
- }).on('click', function(item, e){
- if (me.api){
- if (!_.isUndefined(item.options.langid))
- me.api.put_TextPrLang(item.options.langid);
+ me.langTableMenu.menu.on('item:click', function(menu, item, e){
+ if (me.api){
+ if (!_.isUndefined(item.langid))
+ me.api.put_TextPrLang(item.langid);
- me._currLang.tableid = item.options.langid;
- me.langTableMenu.menu.currentCheckedItem = item;
-
- me.fireEvent('editcomplete', me);
- }
- }));
+ me._currLang.tableid = item.langid;
+ me.fireEvent('editcomplete', me);
+ }
});
}
},
diff --git a/apps/documenteditor/main/app/view/FileMenu.js b/apps/documenteditor/main/app/view/FileMenu.js
index bbf120cf3..5fcf1c1d4 100644
--- a/apps/documenteditor/main/app/view/FileMenu.js
+++ b/apps/documenteditor/main/app/view/FileMenu.js
@@ -49,6 +49,7 @@ define([
DE.Views.FileMenu = Common.UI.BaseView.extend(_.extend({
el: '#file-menu-panel',
+ rendered: false,
options: {alias:'FileMenu'},
template: _.template(tpl),
@@ -81,95 +82,109 @@ define([
},
render: function () {
- this.$el = $(this.el);
- this.$el.html(this.template());
+ var $markup = $(this.template());
this.miSave = new Common.UI.MenuItem({
- el : $('#fm-btn-save',this.el),
+ el : $markup.elementById('#fm-btn-save'),
action : 'save',
caption : this.btnSaveCaption,
canFocused: false
});
+ if ( !!this.options.miSave ) {
+ this.miSave.setDisabled(this.options.miSave.isDisabled());
+ delete this.options.miSave;
+ }
+
this.miEdit = new Common.UI.MenuItem({
- el : $('#fm-btn-edit',this.el),
+ el : $markup.elementById('#fm-btn-edit'),
action : 'edit',
caption : this.btnToEditCaption,
canFocused: false
});
this.miDownload = new Common.UI.MenuItem({
- el : $('#fm-btn-download',this.el),
+ el : $markup.elementById('#fm-btn-download'),
action : 'saveas',
caption : this.btnDownloadCaption,
canFocused: false
});
this.miSaveCopyAs = new Common.UI.MenuItem({
- el : $('#fm-btn-save-copy',this.el),
+ el : $markup.elementById('#fm-btn-save-copy'),
action : 'save-copy',
caption : this.btnSaveCopyAsCaption,
canFocused: false
});
this.miSaveAs = new Common.UI.MenuItem({
- el : $('#fm-btn-save-desktop',this.el),
+ el : $markup.elementById('#fm-btn-save-desktop'),
action : 'save-desktop',
caption : this.btnSaveAsCaption,
canFocused: false
});
this.miPrint = new Common.UI.MenuItem({
- el : $('#fm-btn-print',this.el),
+ el : $markup.elementById('#fm-btn-print'),
action : 'print',
caption : this.btnPrintCaption,
canFocused: false
});
this.miRename = new Common.UI.MenuItem({
- el : $('#fm-btn-rename',this.el),
+ el : $markup.elementById('#fm-btn-rename'),
action : 'rename',
caption : this.btnRenameCaption,
canFocused: false
});
+ if ( !!this.options.miRename ) {
+ this.miRename.setDisabled(this.options.miRename.isDisabled());
+ delete this.options.miRename;
+ }
+
this.miProtect = new Common.UI.MenuItem({
- el : $('#fm-btn-protect',this.el),
+ el : $markup.elementById('#fm-btn-protect'),
action : 'protect',
caption : this.btnProtectCaption,
canFocused: false
});
+ if ( !!this.options.miProtect ) {
+ this.miProtect.setDisabled(this.options.miProtect.isDisabled());
+ delete this.options.miProtect;
+ }
+
this.miRecent = new Common.UI.MenuItem({
- el : $('#fm-btn-recent',this.el),
+ el : $markup.elementById('#fm-btn-recent'),
action : 'recent',
caption : this.btnRecentFilesCaption,
canFocused: false
});
this.miNew = new Common.UI.MenuItem({
- el : $('#fm-btn-create',this.el),
+ el : $markup.elementById('#fm-btn-create'),
action : 'new',
caption : this.btnCreateNewCaption,
canFocused: false
});
this.miAccess = new Common.UI.MenuItem({
- el : $('#fm-btn-rights',this.el),
+ el : $markup.elementById('#fm-btn-rights'),
action : 'rights',
caption : this.btnRightsCaption,
canFocused: false
});
this.miHistory = new Common.UI.MenuItem({
- el : $('#fm-btn-history',this.el),
+ el : $markup.elementById('#fm-btn-history'),
action : 'history',
caption : this.btnHistoryCaption,
canFocused: false
});
this.miHelp = new Common.UI.MenuItem({
- el : $('#fm-btn-help',this.el),
+ el : $markup.elementById('#fm-btn-help'),
action : 'help',
caption : this.btnHelpCaption,
canFocused: false
@@ -178,7 +193,7 @@ define([
this.items = [];
this.items.push(
new Common.UI.MenuItem({
- el : $('#fm-btn-return',this.el),
+ el : $markup.elementById('#fm-btn-return'),
action : 'back',
caption : this.btnCloseMenuCaption,
canFocused: false
@@ -194,7 +209,7 @@ define([
this.miRecent,
this.miNew,
new Common.UI.MenuItem({
- el : $('#fm-btn-info',this.el),
+ el : $markup.elementById('#fm-btn-info'),
action : 'info',
caption : this.btnInfoCaption,
canFocused: false
@@ -202,29 +217,31 @@ define([
this.miAccess,
this.miHistory,
new Common.UI.MenuItem({
- el : $('#fm-btn-settings',this.el),
+ el : $markup.elementById('#fm-btn-settings'),
action : 'opts',
caption : this.btnSettingsCaption,
canFocused: false
}),
this.miHelp,
new Common.UI.MenuItem({
- el : $('#fm-btn-back',this.el),
+ el : $markup.elementById('#fm-btn-back'),
+ // el : _get_el('fm-btn-back'),
action : 'exit',
caption : this.btnBackCaption,
canFocused: false
})
);
- var me = this;
- me.panels = {
-// 'saveas' : (new DE.Views.FileMenuPanels.ViewSaveAs({menu:me})).render(),
- 'opts' : (new DE.Views.FileMenuPanels.Settings({menu:me})).render(),
- 'info' : (new DE.Views.FileMenuPanels.DocumentInfo({menu:me})).render(),
- 'rights' : (new DE.Views.FileMenuPanels.DocumentRights({menu:me})).render()
- };
+ this.rendered = true;
+ this.$el.html($markup);
+ this.$el.find('.content-box').hide();
+ this.applyMode();
- me.$el.find('.content-box').hide();
+ if ( !!this.api ) {
+ this.panels['info'].setApi(this.api);
+ if ( this.panels['protect'] )
+ this.panels['protect'].setApi(this.api);
+ }
return this;
},
@@ -232,6 +249,9 @@ define([
show: function(panel, opts) {
if (this.isVisible() && panel===undefined || !this.mode) return;
+ if ( !this.rendered )
+ this.render();
+
var defPanel = (this.mode.canDownload && (!this.mode.isDesktopApp || !this.mode.isOffline)) ? 'saveas' : 'info';
if (!panel)
panel = this.active || defPanel;
@@ -250,6 +270,16 @@ define([
},
applyMode: function() {
+ if (!this.panels) {
+ this.panels = {
+ 'opts' : (new DE.Views.FileMenuPanels.Settings({menu:this})).render(this.$el.find('#panel-settings')),
+ 'info' : (new DE.Views.FileMenuPanels.DocumentInfo({menu:this})).render(this.$el.find('#panel-info')),
+ 'rights' : (new DE.Views.FileMenuPanels.DocumentRights({menu:this})).render(this.$el.find('#panel-rights'))
+ };
+ }
+
+ if (!this.mode) return;
+
this.miDownload[((this.mode.canDownload || this.mode.canDownloadOrigin) && (!this.mode.isDesktopApp || !this.mode.isOffline))?'show':'hide']();
this.miSaveCopyAs[((this.mode.canDownload || this.mode.canDownloadOrigin) && (!this.mode.isDesktopApp || !this.mode.isOffline)) && (this.mode.canRequestSaveAs || this.mode.saveAsUrl) ?'show':'hide']();
this.miSaveAs[((this.mode.canDownload || this.mode.canDownloadOrigin) && this.mode.isDesktopApp && this.mode.isOffline)?'show':'hide']();
@@ -284,32 +314,29 @@ define([
if ( this.mode.canCreateNew ) {
if (this.mode.templates && this.mode.templates.length) {
$('a',this.miNew.$el).text(this.btnCreateNewCaption + '...');
- this.panels['new'] = ((new DE.Views.FileMenuPanels.CreateNew({menu: this, docs: this.mode.templates})).render());
+ !this.panels['new'] && (this.panels['new'] = ((new DE.Views.FileMenuPanels.CreateNew({menu: this, docs: this.mode.templates})).render()));
}
}
- if ( this.mode.canOpenRecent ) {
- if (this.mode.recent){
- this.panels['recent'] = (new DE.Views.FileMenuPanels.RecentFiles({menu:this, recent: this.mode.recent})).render();
- }
+ if ( this.mode.canOpenRecent && this.mode.recent ) {
+ !this.panels['recent'] && (this.panels['recent'] = (new DE.Views.FileMenuPanels.RecentFiles({menu:this, recent: this.mode.recent})).render());
}
if (this.mode.canProtect) {
-// this.$el.find('#fm-btn-back').hide();
- this.panels['protect'] = (new DE.Views.FileMenuPanels.ProtectDoc({menu:this})).render();
+ !this.panels['protect'] && (this.panels['protect'] = (new DE.Views.FileMenuPanels.ProtectDoc({menu:this})).render());
this.panels['protect'].setMode(this.mode);
}
if (this.mode.canDownload) {
- this.panels['saveas'] = ((new DE.Views.FileMenuPanels.ViewSaveAs({menu: this})).render());
+ !this.panels['saveas'] && (this.panels['saveas'] = ((new DE.Views.FileMenuPanels.ViewSaveAs({menu: this})).render()));
} else if (this.mode.canDownloadOrigin)
$('a',this.miDownload.$el).text(this.textDownload);
if (this.mode.canDownload && (this.mode.canRequestSaveAs || this.mode.saveAsUrl)) {
- this.panels['save-copy'] = ((new DE.Views.FileMenuPanels.ViewSaveCopy({menu: this})).render());
+ !this.panels['save-copy'] && (this.panels['save-copy'] = ((new DE.Views.FileMenuPanels.ViewSaveCopy({menu: this})).render()));
}
- if (this.mode.canHelp) {
+ if (this.mode.canHelp && !this.panels['help']) {
this.panels['help'] = ((new DE.Views.FileMenuPanels.Help({menu: this})).render());
this.panels['help'].setLangConfig(this.mode.lang);
}
@@ -329,13 +356,22 @@ define([
this.mode = mode;
}
- if (!delay) this.applyMode();
+ if (!delay) {
+ if ( this.rendered )
+ this.applyMode();
+ }
+ return this;
},
setApi: function(api) {
this.api = api;
- this.panels['info'].setApi(api);
- if (this.panels['protect']) this.panels['protect'].setApi(api);
+
+ if ( this.rendered ) {
+ this.panels['info'].setApi(api);
+ if (this.panels['protect']) this.panels['protect'].setApi(api);
+ }
+
+ return this;
},
loadDocument: function(data) {
@@ -369,8 +405,11 @@ define([
},
SetDisabled: function(disable) {
- this.miSave[(disable || !this.mode.isEdit)?'hide':'show']();
- this.miRename[(disable || !this.mode.canRename || this.mode.isDesktopApp) ?'hide':'show']();
+ var _btn_save = this.getButton('save'),
+ _btn_rename = this.getButton('rename');
+
+ _btn_save[(disable || !this.mode.isEdit)?'hide':'show']();
+ _btn_rename[(disable || !this.mode.canRename || this.mode.isDesktopApp) ?'hide':'show']();
},
isVisible: function () {
@@ -378,8 +417,27 @@ define([
},
getButton: function(type) {
- if (type == 'save')
- return this.miSave;
+ if ( !this.rendered ) {
+ if (type == 'save') {
+ return this.options.miSave ? this.options.miSave : (this.options.miSave = new Common.UI.MenuItem({}));
+ } else
+ if (type == 'rename') {
+ return this.options.miRename ? this.options.miRename : (this.options.miRename = new Common.UI.MenuItem({}));
+ } else
+ if (type == 'protect') {
+ return this.options.miProtect ? this.options.miProtect : (this.options.miProtect = new Common.UI.MenuItem({}));
+ }
+ } else {
+ if (type == 'save') {
+ return this.miSave;
+ } else
+ if (type == 'rename') {
+ return this.miRename;
+ }else
+ if (type == 'protect') {
+ return this.miProtect;
+ }
+ }
},
btnSaveCaption : 'Save',
diff --git a/apps/documenteditor/main/app/view/FileMenuPanels.js b/apps/documenteditor/main/app/view/FileMenuPanels.js
index c36eb3b0c..8496d4599 100644
--- a/apps/documenteditor/main/app/view/FileMenuPanels.js
+++ b/apps/documenteditor/main/app/view/FileMenuPanels.js
@@ -87,12 +87,12 @@ define([
},
render: function() {
- $(this.el).html(this.template({rows:this.formats}));
+ this.$el.html(this.template({rows:this.formats}));
$('.btn-doc-format',this.el).on('click', _.bind(this.onFormatClick,this));
if (_.isUndefined(this.scroller)) {
this.scroller = new Common.UI.Scroller({
- el: $(this.el),
+ el: this.$el,
suppressScrollX: true
});
}
@@ -148,12 +148,12 @@ define([
},
render: function() {
- $(this.el).html(this.template({rows:this.formats}));
+ this.$el.html(this.template({rows:this.formats}));
$('.btn-doc-format',this.el).on('click', _.bind(this.onFormatClick,this));
if (_.isUndefined(this.scroller)) {
this.scroller = new Common.UI.Scroller({
- el: $(this.el),
+ el: this.$el,
suppressScrollX: true
});
}
@@ -247,30 +247,31 @@ define([
this.menu = options.menu;
},
- render: function() {
- $(this.el).html(this.template({scope: this}));
+ render: function(node) {
+ var me = this;
+ var $markup = $(this.template({scope: this}));
this.chInputMode = new Common.UI.CheckBox({
- el: $('#fms-chb-input-mode'),
+ el: $markup.findById('#fms-chb-input-mode'),
labelText: this.strInputMode
});
/** coauthoring begin **/
this.chLiveComment = new Common.UI.CheckBox({
- el: $('#fms-chb-live-comment'),
+ el: $markup.findById('#fms-chb-live-comment'),
labelText: this.strLiveComment
- }).on('change', _.bind(function(field, newValue, oldValue, eOpts){
- this.chResolvedComment.setDisabled(field.getValue()!=='checked');
- }, this));
+ }).on('change', function(field, newValue, oldValue, eOpts){
+ me.chResolvedComment.setDisabled(field.getValue()!=='checked');
+ });
this.chResolvedComment = new Common.UI.CheckBox({
- el: $('#fms-chb-resolved-comment'),
+ el: $markup.findById('#fms-chb-resolved-comment'),
labelText: this.strResolvedComment
});
/** coauthoring end **/
this.chSpell = new Common.UI.CheckBox({
- el: $('#fms-chb-spell-check'),
+ el: $markup.findById('#fms-chb-spell-check'),
labelText: this.strSpellCheckMode
});
@@ -280,28 +281,28 @@ define([
});
this.chAutosave = new Common.UI.CheckBox({
- el: $('#fms-chb-autosave'),
+ el: $markup.findById('#fms-chb-autosave'),
labelText: this.strAutosave
- }).on('change', _.bind(function(field, newValue, oldValue, eOpts){
- if (field.getValue()!=='checked' && this.cmbCoAuthMode.getValue()) {
- this.cmbCoAuthMode.setValue(0);
- this.onSelectCoAuthMode(this.cmbCoAuthMode.getSelectedRecord());
+ }).on('change', function(field, newValue, oldValue, eOpts){
+ if (field.getValue()!=='checked' && me.cmbCoAuthMode.getValue()) {
+ me.cmbCoAuthMode.setValue(0);
+ me.onSelectCoAuthMode(me.cmbCoAuthMode.getSelectedRecord());
}
- }, this));
- this.lblAutosave = $('#fms-lbl-autosave');
+ });
+ this.lblAutosave = $markup.findById('#fms-lbl-autosave');
this.chForcesave = new Common.UI.CheckBox({
- el: $('#fms-chb-forcesave'),
+ el: $markup.findById('#fms-chb-forcesave'),
labelText: this.strForcesave
});
this.chAlignGuides = new Common.UI.CheckBox({
- el: $('#fms-chb-align-guides'),
+ el: $markup.findById('#fms-chb-align-guides'),
labelText: this.strAlignGuides
});
this.cmbZoom = new Common.UI.ComboBox({
- el : $('#fms-cmb-zoom'),
+ el : $markup.findById('#fms-cmb-zoom'),
style : 'width: 160px;',
editable : false,
cls : 'input-group-nr',
@@ -325,7 +326,7 @@ define([
/** coauthoring begin **/
this.cmbShowChanges = new Common.UI.ComboBox({
- el : $('#fms-cmb-show-changes'),
+ el : $markup.findById('#fms-cmb-show-changes'),
style : 'width: 160px;',
editable : false,
cls : 'input-group-nr',
@@ -337,7 +338,7 @@ define([
});
this.cmbCoAuthMode = new Common.UI.ComboBox({
- el : $('#fms-cmb-coauth-mode'),
+ el : $markup.findById('#fms-cmb-coauth-mode'),
style : 'width: 160px;',
editable : false,
cls : 'input-group-nr',
@@ -345,17 +346,17 @@ define([
{ value: 1, displayValue: this.strFast, descValue: this.strCoAuthModeDescFast},
{ value: 0, displayValue: this.strStrict, descValue: this.strCoAuthModeDescStrict }
]
- }).on('selected', _.bind( function(combo, record) {
- if (record.value == 1 && (this.chAutosave.getValue()!=='checked'))
- this.chAutosave.setValue(1);
- this.onSelectCoAuthMode(record);
- }, this));
+ }).on('selected', function(combo, record) {
+ if (record.value == 1 && (me.chAutosave.getValue()!=='checked'))
+ me.chAutosave.setValue(1);
+ me.onSelectCoAuthMode(record);
+ });
- this.lblCoAuthMode = $('#fms-lbl-coauth-mode');
+ this.lblCoAuthMode = $markup.findById('#fms-lbl-coauth-mode');
/** coauthoring end **/
this.cmbFontRender = new Common.UI.ComboBox({
- el : $('#fms-cmb-font-render'),
+ el : $markup.find('#fms-cmb-font-render'),
style : 'width: 160px;',
editable : false,
cls : 'input-group-nr',
@@ -367,7 +368,7 @@ define([
});
this.cmbUnit = new Common.UI.ComboBox({
- el : $('#fms-cmb-unit'),
+ el : $markup.findById('#fms-cmb-unit'),
style : 'width: 160px;',
editable : false,
cls : 'input-group-nr',
@@ -379,18 +380,19 @@ define([
});
this.btnApply = new Common.UI.Button({
- el: '#fms-btn-apply'
+ el: $markup.findById('#fms-btn-apply')
});
- this.btnApply.on('click', _.bind(this.applySettings, this));
+ this.btnApply.on('click', this.applySettings.bind(this));
+
+ this.$el = $(node).html($markup);
if (_.isUndefined(this.scroller)) {
this.scroller = new Common.UI.Scroller({
- el: $(this.el),
+ el: this.$el,
suppressScrollX: true
});
}
-
return this;
},
@@ -564,7 +566,7 @@ define([
},
render: function() {
- $(this.el).html(this.template());
+ this.$el.html(this.template());
this.viewRecentPicker = new Common.UI.DataView({
el: $('#id-recent-view'),
@@ -582,7 +584,7 @@ define([
if (_.isUndefined(this.scroller)) {
this.scroller = new Common.UI.Scroller({
- el: $(this.el),
+ el: this.$el,
suppressScrollX: true
});
}
@@ -644,14 +646,14 @@ define([
},
render: function() {
- $(this.el).html(this.template({
+ this.$el.html(this.template({
scope: this,
docs: this.options[0].docs
}));
if (_.isUndefined(this.scroller)) {
this.scroller = new Common.UI.Scroller({
- el: $(this.el),
+ el: this.$el,
suppressScrollX: true
});
}
@@ -784,23 +786,22 @@ define([
this._locked = false;
},
- render: function() {
- $(this.el).html(this.template({scope: this}));
-
+ render: function(node) {
var me = this;
+ var $markup = $(me.template());
// server info
- this.lblPlacement = $('#id-info-placement');
- this.lblOwner = $('#id-info-owner');
- this.lblUploaded = $('#id-info-uploaded');
+ this.lblPlacement = $markup.findById('#id-info-placement');
+ this.lblOwner = $markup.findById('#id-info-owner');
+ this.lblUploaded = $markup.findById('#id-info-uploaded');
// statistic info
- this.lblStatPages = $('#id-info-pages');
- this.lblStatWords = $('#id-info-words');
- this.lblStatParagraphs = $('#id-info-paragraphs');
- this.lblStatSymbols = $('#id-info-symbols');
- this.lblStatSpaces = $('#id-info-spaces');
- // this.lblEditTime = $('#id-info-edittime');
+ this.lblStatPages = $markup.findById('#id-info-pages');
+ this.lblStatWords = $markup.findById('#id-info-words');
+ this.lblStatParagraphs = $markup.findById('#id-info-paragraphs');
+ this.lblStatSymbols = $markup.findById('#id-info-symbols');
+ this.lblStatSpaces = $markup.findById('#id-info-spaces');
+ // this.lblEditTime = $markup.find('#id-info-edittime');
// edited info
var keyDownBefore = function(input, e){
@@ -815,37 +816,37 @@ define([
};
this.inputTitle = new Common.UI.InputField({
- el : $('#id-info-title'),
+ el : $markup.findById('#id-info-title'),
style : 'width: 200px;',
placeHolder : this.txtAddText,
validateOnBlur: false
}).on('keydown:before', keyDownBefore);
this.inputSubject = new Common.UI.InputField({
- el : $('#id-info-subject'),
+ el : $markup.findById('#id-info-subject'),
style : 'width: 200px;',
placeHolder : this.txtAddText,
validateOnBlur: false
}).on('keydown:before', keyDownBefore);
this.inputComment = new Common.UI.InputField({
- el : $('#id-info-comment'),
+ el : $markup.findById('#id-info-comment'),
style : 'width: 200px;',
placeHolder : this.txtAddText,
validateOnBlur: false
}).on('keydown:before', keyDownBefore);
// modify info
- this.lblModifyDate = $('#id-info-modify-date');
- this.lblModifyBy = $('#id-info-modify-by');
+ this.lblModifyDate = $markup.findById('#id-info-modify-date');
+ this.lblModifyBy = $markup.findById('#id-info-modify-by');
// creation info
- this.lblDate = $('#id-info-date');
- this.lblApplication = $('#id-info-appname');
- this.tblAuthor = $('#id-info-author table');
- this.trAuthor = $('#id-info-add-author').closest('tr');
+ this.lblDate = $markup.findById('#id-info-date');
+ this.lblApplication = $markup.findById('#id-info-appname');
+ this.tblAuthor = $markup.findById('#id-info-author table');
+ this.trAuthor = $markup.findById('#id-info-add-author').closest('tr');
this.authorTpl = ' |
';
this.tblAuthor.on('click', function(e) {
- var btn = $(e.target);
+ var btn = $markup.find(e.target);
if (btn.hasClass('close') && !btn.hasClass('disabled')) {
var el = btn.closest('tr'),
idx = me.tblAuthor.find('tr').index(el);
@@ -855,7 +856,7 @@ define([
});
this.inputAuthor = new Common.UI.InputField({
- el : $('#id-info-add-author'),
+ el : $markup.findById('#id-info-add-author'),
style : 'width: 200px;',
validateOnBlur: false,
placeHolder: this.txtAddAuthor
@@ -888,13 +889,13 @@ define([
this.updateInfo(this.doc);
+ this.$el = $(node).html($markup);
if (_.isUndefined(this.scroller)) {
this.scroller = new Common.UI.Scroller({
- el: $(this.el),
+ el: this.$el,
suppressScrollX: true
});
}
-
return this;
},
@@ -1178,12 +1179,12 @@ define([
this.menu = options.menu;
},
- render: function() {
- $(this.el).html(this.template());
+ render: function(node) {
+ var $markup = $(this.template());
- this.cntRights = $('#id-info-rights');
+ this.cntRights = $markup.findById('#id-info-rights');
this.btnEditRights = new Common.UI.Button({
- el: '#id-info-btn-edit'
+ el: $markup.elementById('#id-info-btn-edit')
});
this.btnEditRights.on('click', _.bind(this.changeAccessRights, this));
@@ -1191,16 +1192,17 @@ define([
this.updateInfo(this.doc);
+ Common.NotificationCenter.on('collaboration:sharing', this.changeAccessRights.bind(this));
+ Common.NotificationCenter.on('collaboration:sharingdeny', this.onLostEditRights.bind(this));
+
+ this.$el = $(node).html($markup);
+
if (_.isUndefined(this.scroller)) {
this.scroller = new Common.UI.Scroller({
- el: $(this.el),
+ el: this.$el,
suppressScrollX: true
});
}
-
- Common.NotificationCenter.on('collaboration:sharing', _.bind(this.changeAccessRights, this));
- Common.NotificationCenter.on('collaboration:sharingdeny', _.bind(this.onLostEditRights, this));
-
return this;
},
@@ -1364,7 +1366,7 @@ define([
render: function() {
var me = this;
- $(this.el).html(this.template());
+ this.$el.html(this.template());
this.viewHelpPicker = new Common.UI.DataView({
el: $('#id-help-contents'),
@@ -1504,7 +1506,7 @@ define([
},
render: function() {
- $(this.el).html(this.template({scope: this}));
+ this.$el.html(this.template({scope: this}));
var protection = DE.getController('Common.Controllers.Protection').getView();
@@ -1531,7 +1533,7 @@ define([
this.cntSignatureView = $('#id-fms-signature-view');
if (_.isUndefined(this.scroller)) {
this.scroller = new Common.UI.Scroller({
- el: $(this.el),
+ el: this.$el,
suppressScrollX: true
});
}
diff --git a/apps/documenteditor/main/app/view/HeaderFooterSettings.js b/apps/documenteditor/main/app/view/HeaderFooterSettings.js
index 5b7028254..ae792ce79 100644
--- a/apps/documenteditor/main/app/view/HeaderFooterSettings.js
+++ b/apps/documenteditor/main/app/view/HeaderFooterSettings.js
@@ -84,7 +84,7 @@ define([
},
render: function () {
- var el = $(this.el);
+ var el = this.$el || $(this.el);
el.html(this.template({
scope: this
}));
diff --git a/apps/documenteditor/main/app/view/ImageSettings.js b/apps/documenteditor/main/app/view/ImageSettings.js
index 22ac089b2..84b2e50fd 100644
--- a/apps/documenteditor/main/app/view/ImageSettings.js
+++ b/apps/documenteditor/main/app/view/ImageSettings.js
@@ -82,16 +82,16 @@ define([
this._originalProps = null;
this.render();
-
- this.labelWidth = $(this.el).find('#image-label-width');
- this.labelHeight = $(this.el).find('#image-label-height');
},
render: function () {
- var el = $(this.el);
+ var el = this.$el || $(this.el);
el.html(this.template({
scope: this
}));
+
+ this.labelWidth = el.find('#image-label-width');
+ this.labelHeight = el.find('#image-label-height');
},
setApi: function(api) {
diff --git a/apps/documenteditor/main/app/view/LeftMenu.js b/apps/documenteditor/main/app/view/LeftMenu.js
index 767fd4613..b8e9742e7 100644
--- a/apps/documenteditor/main/app/view/LeftMenu.js
+++ b/apps/documenteditor/main/app/view/LeftMenu.js
@@ -90,13 +90,11 @@ define([
},
render: function () {
- var el = $(this.el);
- el.html(this.template({
- }));
+ var $markup = $(this.template({}));
this.btnSearch = new Common.UI.Button({
action: 'search',
- el: $('#left-btn-search'),
+ el: $markup.elementById('#left-btn-search'),
hint: this.tipSearch + Common.Utils.String.platformKey('Ctrl+F'),
disabled: true,
enableToggle: true
@@ -104,7 +102,7 @@ define([
this.btnAbout = new Common.UI.Button({
action: 'about',
- el: $('#left-btn-about'),
+ el: $markup.elementById('#left-btn-about'),
hint: this.tipAbout,
enableToggle: true,
disabled: true,
@@ -113,14 +111,14 @@ define([
this.btnSupport = new Common.UI.Button({
action: 'support',
- el: $('#left-btn-support'),
+ el: $markup.elementById('#left-btn-support'),
hint: this.tipSupport,
disabled: true
});
/** coauthoring begin **/
this.btnComments = new Common.UI.Button({
- el: $('#left-btn-comments'),
+ el: $markup.elementById('#left-btn-comments'),
hint: this.tipComments + Common.Utils.String.platformKey('Ctrl+Shift+H'),
enableToggle: true,
disabled: true,
@@ -128,7 +126,7 @@ define([
});
this.btnChat = new Common.UI.Button({
- el: $('#left-btn-chat'),
+ el: $markup.elementById('#left-btn-chat'),
hint: this.tipChat + Common.Utils.String.platformKey('Alt+Q'),
enableToggle: true,
disabled: true,
@@ -138,36 +136,37 @@ define([
this.btnComments.hide();
this.btnChat.hide();
- this.btnComments.on('click', _.bind(this.onBtnMenuClick, this));
- this.btnComments.on('toggle', _.bind(this.onBtnCommentsToggle, this));
- this.btnChat.on('click', _.bind(this.onBtnMenuClick, this));
+ this.btnComments.on('click', this.onBtnMenuClick.bind(this));
+ this.btnComments.on('toggle', this.onBtnCommentsToggle.bind(this));
+ this.btnChat.on('click', this.onBtnMenuClick.bind(this));
/** coauthoring end **/
this.btnPlugins = new Common.UI.Button({
- el: $('#left-btn-plugins'),
+ el: $markup.elementById('#left-btn-plugins'),
hint: this.tipPlugins,
enableToggle: true,
disabled: true,
toggleGroup: 'leftMenuGroup'
});
this.btnPlugins.hide();
- this.btnPlugins.on('click', _.bind(this.onBtnMenuClick, this));
+ this.btnPlugins.on('click', this.onBtnMenuClick.bind(this));
this.btnNavigation = new Common.UI.Button({
- el: $('#left-btn-navigation'),
+ el: $markup.elementById('#left-btn-navigation'),
hint: this.tipNavigation,
enableToggle: true,
disabled: true,
toggleGroup: 'leftMenuGroup'
});
- this.btnNavigation.on('click', _.bind(this.onBtnMenuClick, this));
+ this.btnNavigation.on('click', this.onBtnMenuClick.bind(this));
- this.btnSearch.on('click', _.bind(this.onBtnMenuClick, this));
- this.btnAbout.on('toggle', _.bind(this.onBtnMenuToggle, this));
+ this.btnSearch.on('click', this.onBtnMenuClick.bind(this));
+ this.btnAbout.on('toggle', this.onBtnMenuToggle.bind(this));
this.menuFile = new DE.Views.FileMenu();
- this.menuFile.render();
- this.btnAbout.panel = (new Common.Views.About({el: $('#about-menu-panel'), appName: 'Document Editor'})).render();
+ this.btnAbout.panel = new Common.Views.About({el: '#about-menu-panel', appName: 'Document Editor'});
+
+ this.$el.html($markup);
return this;
},
diff --git a/apps/documenteditor/main/app/view/MailMergeSettings.js b/apps/documenteditor/main/app/view/MailMergeSettings.js
index fa32bd838..ad24da6ef 100644
--- a/apps/documenteditor/main/app/view/MailMergeSettings.js
+++ b/apps/documenteditor/main/app/view/MailMergeSettings.js
@@ -91,6 +91,31 @@ define([
this.mergeMailData = undefined;
this.render();
+ },
+
+ render: function () {
+ this.$el.html(this.template({
+ scope: this
+ }));
+ },
+
+ setApi: function(api) {
+ this.api = api;
+ if (this.api) {
+ this.api.asc_registerCallback('asc_onPreviewMailMergeResult', _.bind(this.onPreviewMailMergeResult, this));
+ this.api.asc_registerCallback('asc_onEndPreviewMailMergeResult', _.bind(this.onEndPreviewMailMergeResult, this));
+ this.api.asc_registerCallback('asc_onStartMailMerge', _.bind(this.onStartMailMerge, this));
+ this.api.asc_registerCallback('asc_onSaveMailMerge', _.bind(this.onSaveMailMerge, this));
+ this.api.asc_registerCallback('asc_onEndAction', _.bind(this.onLongActionEnd, this));
+ Common.Gateway.on('setemailaddresses', _.bind(this.onSetEmailAddresses, this));
+ Common.Gateway.on('processmailmerge', _.bind(this.onProcessMailMerge, this));
+ }
+ return this;
+ },
+
+ createDelayedControls: function() {
+ var me = this,
+ _set = DE.enumLockMM;
this.btnInsField = new Common.UI.Button({
cls: 'btn-text-menu-default',
@@ -133,32 +158,7 @@ define([
}
});
this.emptyDBControls.push(this.txtFieldNum);
- },
- render: function () {
- this.$el.html(this.template({
- scope: this
- }));
- },
-
- setApi: function(api) {
- this.api = api;
- if (this.api) {
- this.api.asc_registerCallback('asc_onPreviewMailMergeResult', _.bind(this.onPreviewMailMergeResult, this));
- this.api.asc_registerCallback('asc_onEndPreviewMailMergeResult', _.bind(this.onEndPreviewMailMergeResult, this));
- this.api.asc_registerCallback('asc_onStartMailMerge', _.bind(this.onStartMailMerge, this));
- this.api.asc_registerCallback('asc_onSaveMailMerge', _.bind(this.onSaveMailMerge, this));
- this.api.asc_registerCallback('asc_onEndAction', _.bind(this.onLongActionEnd, this));
- Common.Gateway.on('setemailaddresses', _.bind(this.onSetEmailAddresses, this));
- Common.Gateway.on('processmailmerge', _.bind(this.onProcessMailMerge, this));
- }
- return this;
- },
-
- createDelayedControls: function() {
- var me = this,
- _set = DE.enumLockMM;
-
this.btnEditData = new Common.UI.Button({
el: me.$el.find('#mmerge-button-edit-data'),
lock: [_set.preview, _set.lostConnect]
@@ -760,8 +760,8 @@ define([
},
onStartMailMerge: function() {
- this.btnInsField.menu.removeAll();
- this.txtFieldNum.setValue(1);
+ this.btnInsField && this.btnInsField.menu.removeAll();
+ this.txtFieldNum && this.txtFieldNum.setValue(1);
this.ChangeSettings({
recipientsCount: this.api.asc_GetReceptionsCount(),
fieldsList: this.api.asc_GetMailMergeFieldsNameList()
diff --git a/apps/documenteditor/main/app/view/ParagraphSettings.js b/apps/documenteditor/main/app/view/ParagraphSettings.js
index 1814951ca..04bee00dd 100644
--- a/apps/documenteditor/main/app/view/ParagraphSettings.js
+++ b/apps/documenteditor/main/app/view/ParagraphSettings.js
@@ -91,10 +91,16 @@ define([
{displayValue: this.textAuto, defaultValue: 1, value: c_paragraphLinerule.LINERULE_AUTO, minValue: 0.5, step: 0.01, defaultUnit: ''},
{displayValue: this.textExact, defaultValue: 5, value: c_paragraphLinerule.LINERULE_EXACT, minValue: 0.03, step: 0.01, defaultUnit: 'cm'}
];
+ },
+
+ render: function () {
+ var $markup = $(this.template({
+ scope: this
+ }));
// Short Size
this.cmbLineRule = new Common.UI.ComboBox({
- el: $('#paragraph-combo-line-rule'),
+ el: $markup.findById('#paragraph-combo-line-rule'),
cls: 'input-group-nr',
menuStyle: 'min-width: 85px;',
editable: false,
@@ -105,7 +111,7 @@ define([
this.lockedControls.push(this.cmbLineRule);
this.numLineHeight = new Common.UI.MetricSpinner({
- el: $('#paragraph-spin-line-height'),
+ el: $markup.findById('#paragraph-spin-line-height'),
step: .01,
width: 85,
value: '',
@@ -117,7 +123,7 @@ define([
this.lockedControls.push(this.numLineHeight);
this.numSpacingBefore = new Common.UI.MetricSpinner({
- el: $('#paragraph-spin-spacing-before'),
+ el: $markup.findById('#paragraph-spin-spacing-before'),
step: .1,
width: 85,
value: '',
@@ -132,7 +138,7 @@ define([
this.lockedControls.push(this.numSpacingBefore);
this.numSpacingAfter = new Common.UI.MetricSpinner({
- el: $('#paragraph-spin-spacing-after'),
+ el: $markup.findById('#paragraph-spin-spacing-after'),
step: .1,
width: 85,
value: '',
@@ -147,7 +153,7 @@ define([
this.lockedControls.push(this.numSpacingAfter);
this.chAddInterval = new Common.UI.CheckBox({
- el: $('#paragraph-checkbox-add-interval'),
+ el: $markup.findById('#paragraph-checkbox-add-interval'),
labelText: this.strSomeParagraphSpace,
disabled: this._locked
});
@@ -158,27 +164,25 @@ define([
disabled: this._locked,
menu : true
});
- this.btnColor.render( $('#paragraph-color-btn'));
+ this.btnColor.render($markup.findById('#paragraph-color-btn'));
this.lockedControls.push(this.btnColor);
- this.numLineHeight.on('change', _.bind(this.onNumLineHeightChange, this));
- this.numSpacingBefore.on('change', _.bind(this.onNumSpacingBeforeChange, this));
- this.numSpacingAfter.on('change', _.bind(this.onNumSpacingAfterChange, this));
- this.chAddInterval.on('change', _.bind(this.onAddIntervalChange, this));
- this.cmbLineRule.on('selected', _.bind(this.onLineRuleSelect, this));
- this.cmbLineRule.on('hide:after', _.bind(this.onHideMenus, this));
- $(this.el).on('click', '#paragraph-advanced-link', _.bind(this.openAdvancedSettings, this));
- this.TextOnlySettings = $('.text-only');
- },
+ this.numLineHeight.on('change', this.onNumLineHeightChange.bind(this));
+ this.numSpacingBefore.on('change', this.onNumSpacingBeforeChange.bind(this));
+ this.numSpacingAfter.on('change', this.onNumSpacingAfterChange.bind(this));
+ this.chAddInterval.on('change', this.onAddIntervalChange.bind(this));
+ this.cmbLineRule.on('selected', this.onLineRuleSelect.bind(this));
+ this.cmbLineRule.on('hide:after', this.onHideMenus.bind(this));
- render: function () {
- var el = $(this.el);
- el.html(this.template({
- scope: this
- }));
-
- this.linkAdvanced = $('#paragraph-advanced-link');
+ this.linkAdvanced = $markup.findById('#paragraph-advanced-link');
this.linkAdvanced.toggleClass('disabled', this._locked);
+
+ this.$el.on('click', '#paragraph-advanced-link', this.openAdvancedSettings.bind(this));
+ this.$el.html($markup);
+
+ this.TextOnlySettings = $('.text-only', this.$el);
+
+ this.rendered = true;
},
setApi: function(api) {
@@ -393,9 +397,9 @@ define([
},
createDelayedElements: function() {
+ this._initSettings = false;
this.UpdateThemeColors();
this.updateMetricUnit();
- this._initSettings = false;
},
openAdvancedSettings: function(e) {
diff --git a/apps/documenteditor/main/app/view/RightMenu.js b/apps/documenteditor/main/app/view/RightMenu.js
index e33266c43..f1b95cc70 100644
--- a/apps/documenteditor/main/app/view/RightMenu.js
+++ b/apps/documenteditor/main/app/view/RightMenu.js
@@ -146,32 +146,31 @@ define([
},
render: function (mode) {
- var el = $(this.el);
-
this.trigger('render:before', this);
this.defaultHideRightMenu = mode.customization && !!mode.customization.hideRightMenu;
var open = !Common.localStorage.getBool("de-hide-right-settings", this.defaultHideRightMenu);
- el.css('width', ((open) ? MENU_SCALE_PART : SCALE_MIN) + 'px');
- el.show();
+ this.$el.css('width', ((open) ? MENU_SCALE_PART : SCALE_MIN) + 'px');
+ this.$el.show();
- el.html(this.template({}));
+ var $markup = $(this.template({}));
+ this.$el.html($markup);
- this.btnText.setElement($('#id-right-menu-text'), false); this.btnText.render();
- this.btnTable.setElement($('#id-right-menu-table'), false); this.btnTable.render();
- this.btnImage.setElement($('#id-right-menu-image'), false); this.btnImage.render();
- this.btnHeaderFooter.setElement($('#id-right-menu-header'), false); this.btnHeaderFooter.render();
- this.btnChart.setElement($('#id-right-menu-chart'), false); this.btnChart.render();
- this.btnShape.setElement($('#id-right-menu-shape'), false); this.btnShape.render();
- this.btnTextArt.setElement($('#id-right-menu-textart'), false); this.btnTextArt.render();
+ this.btnText.setElement($markup.findById('#id-right-menu-text'), false); this.btnText.render();
+ this.btnTable.setElement($markup.findById('#id-right-menu-table'), false); this.btnTable.render();
+ this.btnImage.setElement($markup.findById('#id-right-menu-image'), false); this.btnImage.render();
+ this.btnHeaderFooter.setElement($markup.findById('#id-right-menu-header'), false); this.btnHeaderFooter.render();
+ this.btnChart.setElement($markup.findById('#id-right-menu-chart'), false); this.btnChart.render();
+ this.btnShape.setElement($markup.findById('#id-right-menu-shape'), false); this.btnShape.render();
+ this.btnTextArt.setElement($markup.findById('#id-right-menu-textart'), false); this.btnTextArt.render();
- this.btnText.on('click', _.bind(this.onBtnMenuClick, this));
- this.btnTable.on('click', _.bind(this.onBtnMenuClick, this));
- this.btnImage.on('click', _.bind(this.onBtnMenuClick, this));
- this.btnHeaderFooter.on('click', _.bind(this.onBtnMenuClick, this));
- this.btnChart.on('click', _.bind(this.onBtnMenuClick, this));
- this.btnShape.on('click', _.bind(this.onBtnMenuClick, this));
- this.btnTextArt.on('click', _.bind(this.onBtnMenuClick, this));
+ this.btnText.on('click', this.onBtnMenuClick.bind(this));
+ this.btnTable.on('click', this.onBtnMenuClick.bind(this));
+ this.btnImage.on('click', this.onBtnMenuClick.bind(this));
+ this.btnHeaderFooter.on('click', this.onBtnMenuClick.bind(this));
+ this.btnChart.on('click', this.onBtnMenuClick.bind(this));
+ this.btnShape.on('click', this.onBtnMenuClick.bind(this));
+ this.btnTextArt.on('click', this.onBtnMenuClick.bind(this));
this.paragraphSettings = new DE.Views.ParagraphSettings();
this.headerSettings = new DE.Views.HeaderFooterSettings();
@@ -192,8 +191,8 @@ define([
});
this._settings[Common.Utils.documentSettingsType.MailMerge] = {panel: "id-mail-merge-settings", btn: this.btnMailMerge};
- this.btnMailMerge.el = $('#id-right-menu-mail-merge'); this.btnMailMerge.render().setVisible(true);
- this.btnMailMerge.on('click', _.bind(this.onBtnMenuClick, this));
+ this.btnMailMerge.el = $markup.findById('#id-right-menu-mail-merge'); this.btnMailMerge.render().setVisible(true);
+ this.btnMailMerge.on('click', this.onBtnMenuClick.bind(this));
this.mergeSettings = new DE.Views.MailMergeSettings();
}
@@ -208,8 +207,8 @@ define([
});
this._settings[Common.Utils.documentSettingsType.Signature] = {panel: "id-signature-settings", btn: this.btnSignature};
- this.btnSignature.el = $('#id-right-menu-signature'); this.btnSignature.render().setVisible(true);
- this.btnSignature.on('click', _.bind(this.onBtnMenuClick, this));
+ this.btnSignature.el = $markup.findById('#id-right-menu-signature'); this.btnSignature.render().setVisible(true);
+ this.btnSignature.on('click', this.onBtnMenuClick.bind(this));
this.signatureSettings = new DE.Views.SignatureSettings();
}
@@ -222,27 +221,29 @@ define([
}
if (open) {
- $('#id-paragraph-settings').parent().css("display", "inline-block" );
- $('#id-paragraph-settings').addClass("active");
+ $markup.findById('#id-paragraph-settings').parent().css("display", "inline-block" );
+ $markup.findById('#id-paragraph-settings').addClass("active");
}
+ // this.$el.html($markup);
this.trigger('render:after', this);
return this;
},
setApi: function(api) {
- this.api = api;
- var fire = function() { this.fireEvent('editcomplete', this); };
- this.paragraphSettings.setApi(api).on('editcomplete', _.bind( fire, this));
- this.headerSettings.setApi(api).on('editcomplete', _.bind( fire, this));
- this.imageSettings.setApi(api).on('editcomplete', _.bind( fire, this));
- this.chartSettings.setApi(api).on('editcomplete', _.bind( fire, this));
- this.tableSettings.setApi(api).on('editcomplete', _.bind( fire, this));
- this.shapeSettings.setApi(api).on('editcomplete', _.bind( fire, this));
- this.textartSettings.setApi(api).on('editcomplete', _.bind( fire, this));
- if (this.mergeSettings) this.mergeSettings.setApi(api).on('editcomplete', _.bind( fire, this));
- if (this.signatureSettings) this.signatureSettings.setApi(api).on('editcomplete', _.bind( fire, this));
+ var me = this;
+ me.api = api;
+ var _fire_editcomplete = function() {me.fireEvent('editcomplete', me);};
+ this.paragraphSettings.setApi(api).on('editcomplete', _fire_editcomplete);
+ this.headerSettings.setApi(api).on('editcomplete', _fire_editcomplete);
+ this.imageSettings.setApi(api).on('editcomplete', _fire_editcomplete);
+ this.chartSettings.setApi(api).on('editcomplete', _fire_editcomplete);
+ this.tableSettings.setApi(api).on('editcomplete', _fire_editcomplete);
+ this.shapeSettings.setApi(api).on('editcomplete', _fire_editcomplete);
+ this.textartSettings.setApi(api).on('editcomplete', _fire_editcomplete);
+ if (this.mergeSettings) this.mergeSettings.setApi(api).on('editcomplete', _fire_editcomplete);
+ if (this.signatureSettings) this.signatureSettings.setApi(api).on('editcomplete', _fire_editcomplete);
},
setMode: function(mode) {
diff --git a/apps/documenteditor/main/app/view/ShapeSettings.js b/apps/documenteditor/main/app/view/ShapeSettings.js
index b856e4a8c..1d227611a 100644
--- a/apps/documenteditor/main/app/view/ShapeSettings.js
+++ b/apps/documenteditor/main/app/view/ShapeSettings.js
@@ -78,6 +78,7 @@ define([
this.imgprops = null;
this._sendUndoPoint = true;
this._sliderChanged = false;
+ this._texturearray = null;
this.txtPt = Common.Utils.Metric.getMetricName(Common.Utils.Metric.c_MetricUnits.pt);
@@ -100,7 +101,8 @@ define([
DisabledFillPanels: false,
DisabledControls: false,
HideShapeOnlySettings: false,
- HideChangeTypeSettings: false
+ HideChangeTypeSettings: false,
+ isFromImage: false
};
this.lockedControls = [];
this._locked = false;
@@ -126,6 +128,13 @@ define([
this.fillControls = [];
this.render();
+ },
+
+ render: function () {
+ var el = this.$el || $(this.el);
+ el.html(this.template({
+ scope: this
+ }));
this.FillColorContainer = $('#shape-panel-color-fill');
this.FillImageContainer = $('#shape-panel-image-fill');
@@ -136,13 +145,6 @@ define([
this.CanChangeType = $('.change-type');
},
- render: function () {
- var el = $(this.el);
- el.html(this.template({
- scope: this
- }));
- },
-
setApi: function(api) {
this.api = api;
if (this.api) {
@@ -785,7 +787,8 @@ define([
|| shapetype=='curvedConnector3' || shapetype=='curvedConnector4' || shapetype=='curvedConnector5'
|| shapetype=='straightConnector1';
this.hideChangeTypeSettings(hidechangetype);
- if (!hidechangetype) {
+ this._state.isFromImage = !!shapeprops.get_FromImage();
+ if (!hidechangetype && this.btnChangeShape.menu.items.length) {
this.btnChangeShape.menu.items[0].setVisible(shapeprops.get_FromImage());
this.btnChangeShape.menu.items[1].setVisible(!shapeprops.get_FromImage());
}
@@ -1480,6 +1483,7 @@ define([
},
createDelayedElements: function() {
+ this._initSettings = false;
this.createDelayedControls();
var global_hatch_menu_map = [
@@ -1513,37 +1517,17 @@ define([
this.PatternFillType = this.patternViewData[0].type;
}
- this.fillAutoShapes();
+ this.onInitStandartTextures();
+ this.onApiAutoShapes();
this.UpdateThemeColors();
- this._initSettings = false;
},
onInitStandartTextures: function(texture) {
var me = this;
if (texture && texture.length>0){
- if (!this.btnTexture) {
- this.btnTexture = new Common.UI.ComboBox({
- el: $('#shape-combo-fill-texture'),
- template: _.template([
- ''
- ].join(''))
- });
- this.textureMenu = new Common.UI.Menu({
- items: [
- { template: _.template('') }
- ]
- });
- this.textureMenu.render($('#shape-combo-fill-texture'));
- this.fillControls.push(this.btnTexture);
- }
-
- var texturearray = [];
+ me._texturearray = [];
_.each(texture, function(item){
- texturearray.push({
+ me._texturearray.push({
imageUrl: item.get_image(),
name : me.textureNames[item.get_id()],
type : item.get_id(),
@@ -1551,15 +1535,41 @@ define([
selected: false
});
});
- var mnuTexturePicker = new Common.UI.DataView({
- el: $('#id-shape-menu-texture'),
- restoreHeight: 174,
- parentMenu: me.textureMenu,
- showLast: false,
- store: new Common.UI.DataViewStore(texturearray),
- itemTemplate: _.template('')
+ }
+
+ if (!me._texturearray || me._texturearray.length<1) return;
+ if (!this._initSettings && !this.btnTexture) {
+ this.btnTexture = new Common.UI.ComboBox({
+ el: $('#shape-combo-fill-texture'),
+ template: _.template([
+ ''
+ ].join(''))
});
- mnuTexturePicker.on('item:click', _.bind(this.onSelectTexture, this));
+ this.textureMenu = new Common.UI.Menu({
+ items: [
+ { template: _.template('') }
+ ]
+ });
+ this.textureMenu.render($('#shape-combo-fill-texture'));
+ this.fillControls.push(this.btnTexture);
+
+ var onShowBefore = function(menu) {
+ var mnuTexturePicker = new Common.UI.DataView({
+ el: $('#id-shape-menu-texture'),
+ restoreHeight: 174,
+ parentMenu: menu,
+ showLast: false,
+ store: new Common.UI.DataViewStore(me._texturearray || []),
+ itemTemplate: _.template('')
+ });
+ mnuTexturePicker.on('item:click', _.bind(me.onSelectTexture, me));
+ menu.off('show:before', onShowBefore);
+ };
+ this.textureMenu.on('show:before', onShowBefore);
}
},
@@ -1610,49 +1620,66 @@ define([
this.fireEvent('editcomplete', this);
},
+ onApiAutoShapes: function() {
+ var me = this;
+ var onShowBefore = function(menu) {
+ me.fillAutoShapes();
+ menu.off('show:before', onShowBefore);
+ };
+ me.btnChangeShape.menu.on('show:before', onShowBefore);
+ },
+
fillAutoShapes: function() {
var me = this,
- shapesStore = this.application.getCollection('ShapeGroups');
+ shapesStore = this.application.getCollection('ShapeGroups'),
+ count = shapesStore.length;
+
+ var onShowAfter = function(menu) {
+ for (var i=-1; i0; i++) {
+ var store = shapesStore.at(i > -1 ? i : 0).get('groupStore');
+ if (i<0) {
+ store = store.clone();
+ store.shift();
+ }
+ var shapePicker = new Common.UI.DataViewSimple({
+ el: $('#id-shape-menu-shapegroup' + (i+1), menu.items[i+1].$el),
+ store: store,
+ parentMenu: menu.items[i+1].menu,
+ itemTemplate: _.template('')
+ });
+ shapePicker.on('item:click', function(picker, item, record, e) {
+ if (me.api) {
+ me.api.ChangeShapeType(record.get('data').shapeType);
+ me.fireEvent('editcomplete', me);
+ }
+ if (e.type !== 'click')
+ me.btnChangeShape.menu.hide();
+ });
+ }
+ menu.off('show:after', onShowAfter);
+ };
+ me.btnChangeShape.menu.on('show:after', onShowAfter);
- var count = shapesStore.length;
for (var i=-1; i0; i++) {
- var shapeGroup = shapesStore.at(i>-1 ? i : i+1);
+ var shapeGroup = shapesStore.at(i > -1 ? i : i + 1);
var menuItem = new Common.UI.MenuItem({
caption: shapeGroup.get('groupName'),
menu: new Common.UI.Menu({
menuAlign: 'tr-tl',
items: [
- { template: _.template('') }
+ {template: _.template('')}
]
})
});
me.btnChangeShape.menu.addItem(menuItem);
-
- var store = shapeGroup.get('groupStore');
- if (i<0) {
- store = store.clone();
- store.shift();
- }
- var shapePicker = new Common.UI.DataView({
- el: $('#id-shape-menu-shapegroup' + (i+1)),
- store: store,
- parentMenu: menuItem.menu,
- showLast: false,
- itemTemplate: _.template('')
- });
-
- shapePicker.on('item:click', function(picker, item, record, e) {
- if (me.api) {
- me.api.ChangeShapeType(record.get('data').shapeType);
- me.fireEvent('editcomplete', me);
- }
- if (e.type !== 'click')
- me.btnChangeShape.menu.hide();
- });
}
+ me.btnChangeShape.menu.items[0].setVisible(me._state.isFromImage);
+ me.btnChangeShape.menu.items[1].setVisible(!me._state.isFromImage);
},
UpdateThemeColors: function() {
+ if (this._initSettings) return;
+
if (!this.btnBackColor) {
// create color buttons
this.btnBackColor = new Common.UI.ColorButton({
@@ -1674,7 +1701,6 @@ define([
});
this.colorsBack.on('select', _.bind(this.onColorsBackSelect, this));
this.btnBackColor.menu.items[1].on('click', _.bind(this.addNewColor, this, this.colorsBack, this.btnBackColor));
-
this.btnFGColor = new Common.UI.ColorButton({
style: "width:45px;",
menu : new Common.UI.Menu({
@@ -1751,7 +1777,6 @@ define([
this.colorsBorder.on('select', _.bind(this.onColorsBorderSelect, this));
this.btnBorderColor.menu.items[1].on('click', _.bind(this.addNewColor, this, this.colorsBorder, this.btnBorderColor));
}
-
this.colorsBorder.updateColors(Common.Utils.ThemeColor.getEffectColors(), Common.Utils.ThemeColor.getStandartColors());
this.colorsBack.updateColors(Common.Utils.ThemeColor.getEffectColors(), Common.Utils.ThemeColor.getStandartColors());
this.colorsFG.updateColors(Common.Utils.ThemeColor.getEffectColors(), Common.Utils.ThemeColor.getStandartColors());
diff --git a/apps/documenteditor/main/app/view/Statusbar.js b/apps/documenteditor/main/app/view/Statusbar.js
index f8131e80d..c8b9cc613 100644
--- a/apps/documenteditor/main/app/view/Statusbar.js
+++ b/apps/documenteditor/main/app/view/Statusbar.js
@@ -66,7 +66,7 @@ define([
Common.Utils.String.format(this.pageIndexText, model.get('current'), model.get('count')) );
}
- function _clickLanguage(menu, item, state) {
+ function _clickLanguage(menu, item) {
var $parent = menu.$el.parent();
$parent.find('#status-label-lang').text(item.caption);
this.langMenu.prevTip = item.value.value;
@@ -228,13 +228,13 @@ define([
disabled: true
});
- this.langMenu = new Common.UI.Menu({
+ this.langMenu = new Common.UI.MenuSimple({
cls: 'lang-menu',
style: 'margin-top:-5px;',
restoreHeight: 285,
itemTemplate: _.template([
- '',
- '',
+ '',
+ '',
'<%= caption %>',
''
].join('')),
@@ -340,18 +340,18 @@ define([
},
reloadLanguages: function(array) {
- this.langMenu.removeAll();
+ var arr = [],
+ saved = this.langMenu.saved;
_.each(array, function(item) {
- this.langMenu.addItem({
+ arr.push({
caption : item['displayValue'],
value : {value: item['value'], code: item['code']},
checkable : true,
- checked : this.langMenu.saved == item['displayValue'],
- spellcheck : item['spellcheck'],
- toggleGroup : 'language'
+ checked : saved == item['displayValue'],
+ spellcheck : item['spellcheck']
});
- }, this);
-
+ });
+ this.langMenu.resetItems(arr);
if (this.langMenu.items.length>0) {
this.btnLanguage.setDisabled(!!this.mode.isDisconnected);
}
@@ -365,9 +365,9 @@ define([
this.langMenu.prevTip = info.value;
var lang = _.find(this.langMenu.items, function(item) { return item.caption == info.displayValue; });
- if (lang)
- lang.setChecked(true);
- else {
+ if (lang) {
+ this.langMenu.setChecked(this.langMenu.items.indexOf(lang), true);
+ } else {
this.langMenu.saved = info.displayValue;
this.langMenu.clearAll();
}
diff --git a/apps/documenteditor/main/app/view/TableSettings.js b/apps/documenteditor/main/app/view/TableSettings.js
index ad1d1f911..9e7bdda98 100644
--- a/apps/documenteditor/main/app/view/TableSettings.js
+++ b/apps/documenteditor/main/app/view/TableSettings.js
@@ -231,7 +231,7 @@ define([
},
render: function () {
- var el = $(this.el);
+ var el = this.$el || $(this.el);
el.html(this.template({
scope: this
}));
@@ -431,10 +431,10 @@ define([
},
createDelayedElements: function() {
+ this._initSettings = false;
this.createDelayedControls();
this.UpdateThemeColors();
this.updateMetricUnit();
- this._initSettings = false;
},
ChangeSettings: function(props) {
@@ -641,6 +641,7 @@ define([
},
UpdateThemeColors: function() {
+ if (this._initSettings) return;
if (!this.btnBackColor) {
// create color buttons
this.btnBorderColor = new Common.UI.ColorButton({
@@ -715,7 +716,6 @@ define([
data[index].set('imageUrl', template.asc_getImage());
});
} else {
- self.cmbTableTemplate.menuPicker.store.reset([]);
var arr = [];
_.each(Templates, function(template){
arr.push({
@@ -725,7 +725,7 @@ define([
tip : template.asc_getDisplayName()
});
});
- self.cmbTableTemplate.menuPicker.store.add(arr);
+ self.cmbTableTemplate.menuPicker.store.reset(arr);
}
},
diff --git a/apps/documenteditor/main/app/view/TextArtSettings.js b/apps/documenteditor/main/app/view/TextArtSettings.js
index 663bd9537..4613bf022 100644
--- a/apps/documenteditor/main/app/view/TextArtSettings.js
+++ b/apps/documenteditor/main/app/view/TextArtSettings.js
@@ -105,20 +105,24 @@ define([
this.BorderSize = 0;
this.BorderType = Asc.c_oDashType.solid;
+ DE.getCollection('Common.Collections.TextArt').bind({
+ reset: this.fillTextArt.bind(this)
+ });
+
this.render();
+ },
+
+ render: function () {
+ var el = this.$el || $(this.el);
+ el.html(this.template({
+ scope: this
+ }));
this.FillColorContainer = $('#textart-panel-color-fill');
this.FillGradientContainer = $('#textart-panel-gradient-fill');
this.TransparencyContainer = $('#textart-panel-transparent-fill');
},
- render: function () {
- var el = $(this.el);
- el.html(this.template({
- scope: this
- }));
- },
-
setApi: function(api) {
this.api = api;
return this;
@@ -985,15 +989,17 @@ define([
},
createDelayedElements: function() {
+ this._initSettings = false;
this.createDelayedControls();
this.UpdateThemeColors();
this.fillTransform(this.api.asc_getPropertyEditorTextArts());
- this._initSettings = false;
+ this.fillTextArt();
},
fillTextArt: function() {
+ if (this._initSettings) return;
+
var me = this;
-
if (!this.cmbTextArt) {
this.cmbTextArt = new Common.UI.ComboDataView({
itemWidth: 50,
@@ -1017,6 +1023,10 @@ define([
var models = this.application.getCollection('Common.Collections.TextArt').models,
count = this.cmbTextArt.menuPicker.store.length;
+ if (models.length<1) {
+ DE.getController('Main').fillTextArt(this.api.asc_getTextArtPreviews());
+ return;
+ }
if (count>0 && count==models.length) {
var data = this.cmbTextArt.menuPicker.store.models;
_.each(models, function(template, index){
@@ -1073,6 +1083,7 @@ define([
},
UpdateThemeColors: function() {
+ if (this._initSettings) return;
if (!this.btnBackColor) {
this.btnBorderColor = new Common.UI.ColorButton({
style: "width:45px;",
@@ -1132,7 +1143,6 @@ define([
this.colorsBack.on('select', _.bind(this.onColorsBackSelect, this));
this.btnBackColor.menu.items[1].on('click', _.bind(this.addNewColor, this, this.colorsBack, this.btnBackColor));
}
-
this.colorsBorder.updateColors(Common.Utils.ThemeColor.getEffectColors(), Common.Utils.ThemeColor.getStandartColors());
this.colorsBack.updateColors(Common.Utils.ThemeColor.getEffectColors(), Common.Utils.ThemeColor.getStandartColors());
this.colorsGrad.updateColors(Common.Utils.ThemeColor.getEffectColors(), Common.Utils.ThemeColor.getStandartColors());
diff --git a/apps/documenteditor/main/app/view/Toolbar.js b/apps/documenteditor/main/app/view/Toolbar.js
index 60c729e5b..ade6b68a7 100644
--- a/apps/documenteditor/main/app/view/Toolbar.js
+++ b/apps/documenteditor/main/app/view/Toolbar.js
@@ -506,12 +506,7 @@ define([
cls: 'btn-toolbar x-huge icon-top',
caption: me.capBtnInsChart,
iconCls: 'btn-insertchart',
- menu: new Common.UI.Menu({
- style: 'width: 435px;',
- items: [
- {template: _.template('')}
- ]
- })
+ menu: true
});
this.paragraphControls.push(this.btnInsertChart);
@@ -1270,7 +1265,7 @@ define([
rendererComponents: function (html) {
var $host = $(html);
var _injectComponent = function (id, cmp) {
- Common.Utils.injectComponent($host.find(id), cmp);
+ Common.Utils.injectComponent($host.findById(id), cmp);
};
_injectComponent('#slot-field-fontname', this.cmbFontName);
@@ -1656,6 +1651,91 @@ define([
this.paragraphControls.push(this.mnuPageNumCurrentPos);
this.paragraphControls.push(this.mnuInsertPageCount);
+ this.btnInsertChart.setMenu( new Common.UI.Menu({
+ style: 'width: 435px;',
+ items: [
+ {template: _.template('')}
+ ]
+ }));
+
+ var onShowBefore = function(menu) {
+ var picker = new Common.UI.DataView({
+ el: $('#id-toolbar-menu-insertchart'),
+ parentMenu: menu,
+ showLast: false,
+ restoreHeight: 421,
+ groups: new Common.UI.DataViewGroupStore([
+ {id: 'menu-chart-group-bar', caption: me.textColumn, headername: me.textCharts},
+ {id: 'menu-chart-group-line', caption: me.textLine},
+ {id: 'menu-chart-group-pie', caption: me.textPie},
+ {id: 'menu-chart-group-hbar', caption: me.textBar},
+ {id: 'menu-chart-group-area', caption: me.textArea, inline: true},
+ {id: 'menu-chart-group-scatter', caption: me.textPoint, inline: true},
+ {id: 'menu-chart-group-stock', caption: me.textStock, inline: true}
+ // {id: 'menu-chart-group-surface', caption: me.textSurface}
+ ]),
+ store: new Common.UI.DataViewStore([
+ { group: 'menu-chart-group-bar', type: Asc.c_oAscChartTypeSettings.barNormal, iconCls: 'column-normal'},
+ { group: 'menu-chart-group-bar', type: Asc.c_oAscChartTypeSettings.barStacked, iconCls: 'column-stack'},
+ { group: 'menu-chart-group-bar', type: Asc.c_oAscChartTypeSettings.barStackedPer, iconCls: 'column-pstack'},
+ { group: 'menu-chart-group-bar', type: Asc.c_oAscChartTypeSettings.barNormal3d, iconCls: 'column-3d-normal'},
+ { group: 'menu-chart-group-bar', type: Asc.c_oAscChartTypeSettings.barStacked3d, iconCls: 'column-3d-stack'},
+ { group: 'menu-chart-group-bar', type: Asc.c_oAscChartTypeSettings.barStackedPer3d, iconCls: 'column-3d-pstack'},
+ { group: 'menu-chart-group-bar', type: Asc.c_oAscChartTypeSettings.barNormal3dPerspective, iconCls: 'column-3d-normal-per'},
+ { group: 'menu-chart-group-line', type: Asc.c_oAscChartTypeSettings.lineNormal, iconCls: 'line-normal'},
+ { group: 'menu-chart-group-line', type: Asc.c_oAscChartTypeSettings.lineStacked, iconCls: 'line-stack'},
+ { group: 'menu-chart-group-line', type: Asc.c_oAscChartTypeSettings.lineStackedPer, iconCls: 'line-pstack'},
+ { group: 'menu-chart-group-line', type: Asc.c_oAscChartTypeSettings.line3d, iconCls: 'line-3d'},
+ { group: 'menu-chart-group-pie', type: Asc.c_oAscChartTypeSettings.pie, iconCls: 'pie-normal'},
+ { group: 'menu-chart-group-pie', type: Asc.c_oAscChartTypeSettings.doughnut, iconCls: 'pie-doughnut'},
+ { group: 'menu-chart-group-pie', type: Asc.c_oAscChartTypeSettings.pie3d, iconCls: 'pie-3d-normal'},
+ { group: 'menu-chart-group-hbar', type: Asc.c_oAscChartTypeSettings.hBarNormal, iconCls: 'bar-normal'},
+ { group: 'menu-chart-group-hbar', type: Asc.c_oAscChartTypeSettings.hBarStacked, iconCls: 'bar-stack'},
+ { group: 'menu-chart-group-hbar', type: Asc.c_oAscChartTypeSettings.hBarStackedPer, iconCls: 'bar-pstack'},
+ { group: 'menu-chart-group-hbar', type: Asc.c_oAscChartTypeSettings.hBarNormal3d, iconCls: 'bar-3d-normal'},
+ { group: 'menu-chart-group-hbar', type: Asc.c_oAscChartTypeSettings.hBarStacked3d, iconCls: 'bar-3d-stack'},
+ { group: 'menu-chart-group-hbar', type: Asc.c_oAscChartTypeSettings.hBarStackedPer3d, iconCls: 'bar-3d-pstack'},
+ { group: 'menu-chart-group-area', type: Asc.c_oAscChartTypeSettings.areaNormal, iconCls: 'area-normal'},
+ { group: 'menu-chart-group-area', type: Asc.c_oAscChartTypeSettings.areaStacked, iconCls: 'area-stack'},
+ { group: 'menu-chart-group-area', type: Asc.c_oAscChartTypeSettings.areaStackedPer, iconCls: 'area-pstack'},
+ { group: 'menu-chart-group-scatter', type: Asc.c_oAscChartTypeSettings.scatter, iconCls: 'point-normal'},
+ { group: 'menu-chart-group-stock', type: Asc.c_oAscChartTypeSettings.stock, iconCls: 'stock-normal'}
+ // { group: 'menu-chart-group-surface', type: Asc.c_oAscChartTypeSettings.surfaceNormal, iconCls: 'surface-normal'},
+ // { group: 'menu-chart-group-surface', type: Asc.c_oAscChartTypeSettings.surfaceWireframe, iconCls: 'surface-wireframe'},
+ // { group: 'menu-chart-group-surface', type: Asc.c_oAscChartTypeSettings.contourNormal, iconCls: 'contour-normal'},
+ // { group: 'menu-chart-group-surface', type: Asc.c_oAscChartTypeSettings.contourWireframe, iconCls: 'contour-wireframe'}
+
+ ]),
+ itemTemplate: _.template('')
+ });
+ picker.on('item:click', function (picker, item, record, e) {
+ if (record)
+ me.fireEvent('add:chart', [record.get('type')]);
+ });
+ menu.off('show:before', onShowBefore);
+ };
+ this.btnInsertChart.menu.on('show:before', onShowBefore);
+
+ var onShowBeforeTextArt = function (menu) {
+ var collection = DE.getCollection('Common.Collections.TextArt');
+ if (collection.length<1)
+ DE.getController('Main').fillTextArt(me.api.asc_getTextArtPreviews());
+ var picker = new Common.UI.DataView({
+ el: $('#id-toolbar-menu-insart'),
+ store: collection,
+ parentMenu: menu,
+ showLast: false,
+ itemTemplate: _.template('')
+ });
+ picker.on('item:click', function (picker, item, record, e) {
+ if (record)
+ me.fireEvent('insert:textart', [record.get('data')]);
+ if (e.type !== 'click') menu.hide();
+ });
+ menu.off('show:before', onShowBeforeTextArt);
+ };
+ this.btnInsertTextArt.menu.on('show:before', onShowBeforeTextArt);
+
// set dataviews
var _conf = this.mnuMarkersPicker.conf;
@@ -1773,181 +1853,6 @@ define([
});
_conf && this.mnuPageNumberPosPicker.setDisabled(_conf.disabled);
- this.mnuInsertChartPicker = new Common.UI.DataView({
- el: $('#id-toolbar-menu-insertchart'),
- parentMenu: this.btnInsertChart.menu,
- showLast: false,
- restoreHeight: 421,
- groups: new Common.UI.DataViewGroupStore([
- {id: 'menu-chart-group-bar', caption: me.textColumn, headername: me.textCharts},
- {id: 'menu-chart-group-line', caption: me.textLine},
- {id: 'menu-chart-group-pie', caption: me.textPie},
- {id: 'menu-chart-group-hbar', caption: me.textBar},
- {id: 'menu-chart-group-area', caption: me.textArea, inline: true},
- {id: 'menu-chart-group-scatter', caption: me.textPoint, inline: true},
- {id: 'menu-chart-group-stock', caption: me.textStock, inline: true}
- // {id: 'menu-chart-group-surface', caption: me.textSurface}
- ]),
- store: new Common.UI.DataViewStore([
- {
- group: 'menu-chart-group-bar',
- type: Asc.c_oAscChartTypeSettings.barNormal,
- allowSelected: true,
- iconCls: 'column-normal',
- selected: true
- },
- {
- group: 'menu-chart-group-bar',
- type: Asc.c_oAscChartTypeSettings.barStacked,
- allowSelected: true,
- iconCls: 'column-stack'
- },
- {
- group: 'menu-chart-group-bar',
- type: Asc.c_oAscChartTypeSettings.barStackedPer,
- allowSelected: true,
- iconCls: 'column-pstack'
- },
- {
- group: 'menu-chart-group-bar',
- type: Asc.c_oAscChartTypeSettings.barNormal3d,
- allowSelected: true,
- iconCls: 'column-3d-normal'
- },
- {
- group: 'menu-chart-group-bar',
- type: Asc.c_oAscChartTypeSettings.barStacked3d,
- allowSelected: true,
- iconCls: 'column-3d-stack'
- },
- {
- group: 'menu-chart-group-bar',
- type: Asc.c_oAscChartTypeSettings.barStackedPer3d,
- allowSelected: true,
- iconCls: 'column-3d-pstack'
- },
- {
- group: 'menu-chart-group-bar',
- type: Asc.c_oAscChartTypeSettings.barNormal3dPerspective,
- allowSelected: true,
- iconCls: 'column-3d-normal-per'
- },
- {
- group: 'menu-chart-group-line',
- type: Asc.c_oAscChartTypeSettings.lineNormal,
- allowSelected: true,
- iconCls: 'line-normal'
- },
- {
- group: 'menu-chart-group-line',
- type: Asc.c_oAscChartTypeSettings.lineStacked,
- allowSelected: true,
- iconCls: 'line-stack'
- },
- {
- group: 'menu-chart-group-line',
- type: Asc.c_oAscChartTypeSettings.lineStackedPer,
- allowSelected: true,
- iconCls: 'line-pstack'
- },
- {
- group: 'menu-chart-group-line',
- type: Asc.c_oAscChartTypeSettings.line3d,
- allowSelected: true,
- iconCls: 'line-3d'
- },
- {
- group: 'menu-chart-group-pie',
- type: Asc.c_oAscChartTypeSettings.pie,
- allowSelected: true,
- iconCls: 'pie-normal'
- },
- {
- group: 'menu-chart-group-pie',
- type: Asc.c_oAscChartTypeSettings.doughnut,
- allowSelected: true,
- iconCls: 'pie-doughnut'
- },
- {
- group: 'menu-chart-group-pie',
- type: Asc.c_oAscChartTypeSettings.pie3d,
- allowSelected: true,
- iconCls: 'pie-3d-normal'
- },
- {
- group: 'menu-chart-group-hbar',
- type: Asc.c_oAscChartTypeSettings.hBarNormal,
- allowSelected: true,
- iconCls: 'bar-normal'
- },
- {
- group: 'menu-chart-group-hbar',
- type: Asc.c_oAscChartTypeSettings.hBarStacked,
- allowSelected: true,
- iconCls: 'bar-stack'
- },
- {
- group: 'menu-chart-group-hbar',
- type: Asc.c_oAscChartTypeSettings.hBarStackedPer,
- allowSelected: true,
- iconCls: 'bar-pstack'
- },
- {
- group: 'menu-chart-group-hbar',
- type: Asc.c_oAscChartTypeSettings.hBarNormal3d,
- allowSelected: true,
- iconCls: 'bar-3d-normal'
- },
- {
- group: 'menu-chart-group-hbar',
- type: Asc.c_oAscChartTypeSettings.hBarStacked3d,
- allowSelected: true,
- iconCls: 'bar-3d-stack'
- },
- {
- group: 'menu-chart-group-hbar',
- type: Asc.c_oAscChartTypeSettings.hBarStackedPer3d,
- allowSelected: true,
- iconCls: 'bar-3d-pstack'
- },
- {
- group: 'menu-chart-group-area',
- type: Asc.c_oAscChartTypeSettings.areaNormal,
- allowSelected: true,
- iconCls: 'area-normal'
- },
- {
- group: 'menu-chart-group-area',
- type: Asc.c_oAscChartTypeSettings.areaStacked,
- allowSelected: true,
- iconCls: 'area-stack'
- },
- {
- group: 'menu-chart-group-area',
- type: Asc.c_oAscChartTypeSettings.areaStackedPer,
- allowSelected: true,
- iconCls: 'area-pstack'
- },
- {
- group: 'menu-chart-group-scatter',
- type: Asc.c_oAscChartTypeSettings.scatter,
- allowSelected: true,
- iconCls: 'point-normal'
- },
- {
- group: 'menu-chart-group-stock',
- type: Asc.c_oAscChartTypeSettings.stock,
- allowSelected: true,
- iconCls: 'stock-normal'
- }
- // { group: 'menu-chart-group-surface', type: Asc.c_oAscChartTypeSettings.surfaceNormal, allowSelected: true, iconCls: 'surface-normal'},
- // { group: 'menu-chart-group-surface', type: Asc.c_oAscChartTypeSettings.surfaceWireframe, allowSelected: true, iconCls: 'surface-wireframe'},
- // { group: 'menu-chart-group-surface', type: Asc.c_oAscChartTypeSettings.contourNormal, allowSelected: true, iconCls: 'contour-normal'},
- // { group: 'menu-chart-group-surface', type: Asc.c_oAscChartTypeSettings.contourWireframe, allowSelected: true, iconCls: 'contour-wireframe'}
- ]),
- itemTemplate: _.template('')
- });
-
this.mnuTablePicker = new Common.UI.DimensionPicker({
el: $('#id-toolbar-menu-tablepicker'),
minRows: 8,
diff --git a/apps/documenteditor/main/index.html b/apps/documenteditor/main/index.html
index 145a0b453..d407512fc 100644
--- a/apps/documenteditor/main/index.html
+++ b/apps/documenteditor/main/index.html
@@ -22,157 +22,93 @@
z-index: 1001;
}
- .loader-page {
+ .loadmask > .brendpanel {
width: 100%;
- height: 170px;
- bottom: 42%;
- position: absolute;
- text-align: center;
- line-height: 10px;
+ height: 56px;
+ background: #446995;
}
- .loader-logo {
- max-height: 160px;
- margin-bottom: 10px;
+ .loadmask > .brendpanel > div {
+ display: flex;
+ align-items: center;
}
- .loader-page-romb {
- width: 40px;
+ .loadmask > .brendpanel .spacer {
+ margin-left: auto;
+ }
+
+ .loadmask > .brendpanel .loading-logo {
+ padding: 0 24px 0 12px;
+ max-width: 200px;
+ height: 20px;
+ }
+
+ .loadmask > .brendpanel .loading-logo > img {
display: inline-block;
+ max-width: 100px;
+ max-height: 20px;
+ opacity: 0;
}
- .loader-page-text {
- width: 100%;
- bottom: 42%;
- position: absolute;
- text-align: center;
- color: #888;
- font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
- line-height: 20px;
+ .loadmask > .brendpanel .circle {
+ vertical-align: middle;
+ width: 20px;
+ height: 20px;
+ border-radius: 12px;
+ margin: 4px 10px;
+ background: rgba(255, 255, 255, 0.2);
}
- .loader-page-text-loading {
- font-size: 14px;
+ .loadmask > .brendpanel .rect {
+ vertical-align: middle;
+ width: 50px;
+ height: 12px;
+ border-radius: 3px;
+ margin: 0 10px;
+ background: rgba(255, 255, 255, 0.2);
}
- .loader-page-text-customer {
- font-size: 16px;
- margin-bottom: 5px;
+ .loadmask > .placeholder {
+ background: #fbfbfb;
+ width: 796px;
+ margin: 112px auto;
+ height: 100%;
+ border: 1px solid #dfdfdf;
+ padding-top: 50px;
}
- .romb {
- width: 40px;
- height: 40px;
- -webkit-transform: rotate(135deg) skew(20deg, 20deg);
- -moz-transform: rotate(135deg) skew(20deg, 20deg);
- -ms-transform: rotate(135deg) skew(20deg, 20deg);
- -o-transform: rotate(135deg) skew(20deg, 20deg);
- position: absolute;
- background: red;
- border-radius: 6px;
- -webkit-animation: movedown 3s infinite ease;
- -moz-animation: movedown 3s infinite ease;
- -ms-animation: movedown 3s infinite ease;
- -o-animation: movedown 3s infinite ease;
- animation: movedown 3s infinite ease;
+ .loadmask > .placeholder > .line {
+ height: 15px;
+ margin: 30px 80px;
+ background: #e2e2e2;
+ overflow: hidden;
+ position: relative;
+
+ -webkit-animation: flickerAnimation 2s infinite ease-in-out;
+ -moz-animation: flickerAnimation 2s infinite ease-in-out;
+ -o-animation: flickerAnimation 2s infinite ease-in-out;
+ animation: flickerAnimation 2s infinite ease-in-out;
}
- #blue {
- z-index: 3;
- background: #55bce6;
- -webkit-animation-name: blue;
- -moz-animation-name: blue;
- -ms-animation-name: blue;
- -o-animation-name: blue;
- animation-name: blue;
+ @keyframes flickerAnimation {
+ 0% { opacity:0.1; }
+ 50% { opacity:1; }
+ 100% { opacity:0.1; }
}
-
- #red {
- z-index:1;
- background: #de7a59;
- -webkit-animation-name: red;
- -moz-animation-name: red;
- -ms-animation-name: red;
- -o-animation-name: red;
- animation-name: red;
+ @-o-keyframes flickerAnimation{
+ 0% { opacity:0.1; }
+ 50% { opacity:1; }
+ 100% { opacity:0.1; }
}
-
- #green {
- z-index: 2;
- background: #a1cb5c;
- -webkit-animation-name: green;
- -moz-animation-name: green;
- -ms-animation-name: green;
- -o-animation-name: green;
- animation-name: green;
+ @-moz-keyframes flickerAnimation{
+ 0% { opacity:0.1; }
+ 50% { opacity:1; }
+ 100% { opacity:0.1; }
}
-
- @-webkit-keyframes red {
- 0% { top:120px; background: #de7a59; }
- 10% { top:120px; background: #F2CBBF; }
- 14% { background: #f4f4f4; top:120px; }
- 15% { background: #f4f4f4; top:0;}
- 20% { background: #E6E4E4; }
- 30% { background: #D2D2D2; }
- 40% { top:120px; }
- 100% { top:120px; background: #de7a59; }
- }
-
- @keyframes red {
- 0% { top:120px; background: #de7a59; }
- 10% { top:120px; background: #F2CBBF; }
- 14% { background: #f4f4f4; top:120px; }
- 15% { background: #f4f4f4; top:0; }
- 20% { background: #E6E4E4; }
- 30% { background: #D2D2D2; }
- 40% { top:120px; }
- 100% { top:120px; background: #de7a59; }
- }
-
- @-webkit-keyframes green {
- 0% { top:110px; background: #a1cb5c; opacity:1; }
- 10% { top:110px; background: #CBE0AC; opacity:1; }
- 14% { background: #f4f4f4; top:110px; opacity:1; }
- 15% { background: #f4f4f4; top:0; opacity:1; }
- 20% { background: #f4f4f4; top:0; opacity:0; }
- 25% { background: #EFEFEF; top:0; opacity:1; }
- 30% { background:#E6E4E4; }
- 70% { top:110px; }
- 100% { top:110px; background: #a1cb5c; }
- }
-
- @keyframes green {
- 0% { top:110px; background: #a1cb5c; opacity:1; }
- 10% { top:110px; background: #CBE0AC; opacity:1; }
- 14% { background: #f4f4f4; top:110px; opacity:1; }
- 15% { background: #f4f4f4; top:0; opacity:1; }
- 20% { background: #f4f4f4; top:0; opacity:0; }
- 25% { background: #EFEFEF; top:0; opacity:1; }
- 30% { background:#E6E4E4; }
- 70% { top:110px; }
- 100% { top:110px; background: #a1cb5c; }
- }
-
- @-webkit-keyframes blue {
- 0% { top:100px; background: #55bce6; opacity:1; }
- 10% { top:100px; background: #BFE8F8; opacity:1; }
- 14% { background: #f4f4f4; top:100px; opacity:1; }
- 15% { background: #f4f4f4; top:0; opacity:1; }
- 20% { background: #f4f4f4; top:0; opacity:0; }
- 25% { background: #f4f4f4; top:0; opacity:0; }
- 45% { background: #EFEFEF; top:0; opacity:0.2; }
- 100% { top:100px; background: #55bce6; }
- }
-
- @keyframes blue {
- 0% { top:100px; background: #55bce6; opacity:1; }
- 10% { top:100px; background: #BFE8F8; opacity:1; }
- 14% { background: #f4f4f4; top:100px; opacity:1; }
- 15% { background: #f4f4f4; top:0; opacity:1; }
- 20% { background: #f4f4f4; top:0; opacity:0; }
- 25% { background: #fff; top:0; opacity:0; }
- 45% { background: #EFEFEF; top:0; opacity:0.2; }
- 100% { top:100px; background: #55bce6; }
+ @-webkit-keyframes flickerAnimation{
+ 0% { opacity:0.1; }
+ 50% { opacity:1; }
+ 100% { opacity:0.1; }
}
@@ -228,49 +164,9 @@
var params = getUrlParams(),
lang = (params["lang"] || 'en').split(/[\-\_]/)[0],
- customer = params["customer"] ? ('' + encodeUrlParam(params["customer"]) + '
') : '',
- margin = (customer !== '') ? 50 : 20,
- loading = 'Loading...',
- logo = params["logo"] ? ((params["logo"] !== 'none') ? ('') : '') : null;
+ logo = params["headerlogo"] ? encodeUrlParam(params["headerlogo"]) : null;
window.frameEditorId = params["frameEditorId"];
-
- if ( lang == 'de') loading = 'Ladevorgang...';
- else if ( lang == 'es') loading = 'Cargando...';
- else if ( lang == 'fr') loading = 'Chargement en cours...';
- else if ( lang == 'it') loading = 'Caricamento in corso...';
- else if ( lang == 'pt') loading = 'Carregando...';
- else if ( lang == 'ru') loading = 'Загрузка...';
- else if ( lang == 'sl') loading = 'Nalaganje...';
- else if ( lang == 'tr') loading = 'Yükleniyor...';
- else if ( lang == 'bg') loading = 'Зареждане...';
- else if ( lang == 'cs') loading = 'Nahrávám...';
- else if ( lang == 'hu') loading = 'Betöltés...';
- else if ( lang == 'ja') loading = '読み込み中...';
- else if ( lang == 'ko') loading = '로드 중...';
- else if ( lang == 'lv') loading = 'Ieladēšana ...';
- else if ( lang == 'nl') loading = 'Laden...';
- else if ( lang == 'pl') loading = 'Ładowanie...';
- else if ( lang == 'sk') loading = 'Nahrávam...';
- else if ( lang == 'uk') loading = 'Завантаження...';
- else if ( lang == 'vi') loading = 'Đang tải...';
- else if ( lang == 'zh') loading = '加载中...';
-
- if ( !stopLoading )
- document.write(
- '' +
- '
' +
- ((logo!==null) ? logo :
- '
' +
- '
' +
- '
' +
- '
' +
- '
') +
- '
' +
- '
' + customer +
- '
' + loading + '
' +
- '
' +
- '
');
@@ -278,8 +174,21 @@
+
+
+
@@ -299,7 +208,7 @@
-
+
diff --git a/apps/documenteditor/main/index.html.deploy b/apps/documenteditor/main/index.html.deploy
index 45faf2f30..675be6f5b 100644
--- a/apps/documenteditor/main/index.html.deploy
+++ b/apps/documenteditor/main/index.html.deploy
@@ -23,157 +23,93 @@
z-index: 1001;
}
- .loader-page {
+ .loadmask > .brendpanel {
width: 100%;
- height: 170px;
- bottom: 42%;
- position: absolute;
- text-align: center;
- line-height: 10px;
+ height: 56px;
+ background: #446995;
}
- .loader-logo {
- max-height: 160px;
- margin-bottom: 10px;
+ .loadmask > .brendpanel > div {
+ display: flex;
+ align-items: center;
}
- .loader-page-romb {
- width: 40px;
+ .loadmask > .brendpanel .spacer {
+ margin-left: auto;
+ }
+
+ .loadmask > .brendpanel .loading-logo {
+ padding: 0 24px 0 12px;
+ max-width: 200px;
+ height: 20px;
+ }
+
+ .loadmask > .brendpanel .loading-logo > img {
display: inline-block;
+ max-width: 100px;
+ max-height: 20px;
+ opacity: 0;
}
- .loader-page-text {
- width: 100%;
- bottom: 42%;
- position: absolute;
- text-align: center;
- color: #888;
- font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
- line-height: 20px;
+ .loadmask > .brendpanel .circle {
+ vertical-align: middle;
+ width: 20px;
+ height: 20px;
+ border-radius: 12px;
+ margin: 4px 10px;
+ background: rgba(255, 255, 255, 0.2);
}
- .loader-page-text-loading {
- font-size: 14px;
+ .loadmask > .brendpanel .rect {
+ vertical-align: middle;
+ width: 50px;
+ height: 12px;
+ border-radius: 3px;
+ margin: 0 10px;
+ background: rgba(255, 255, 255, 0.2);
}
- .loader-page-text-customer {
- font-size: 16px;
- margin-bottom: 5px;
+ .loadmask > .placeholder {
+ background: #fbfbfb;
+ width: 796px;
+ margin: 112px auto;
+ height: 100%;
+ border: 1px solid #dfdfdf;
+ padding-top: 50px;
}
- .romb {
- width: 40px;
- height: 40px;
- -webkit-transform: rotate(135deg) skew(20deg, 20deg);
- -moz-transform: rotate(135deg) skew(20deg, 20deg);
- -ms-transform: rotate(135deg) skew(20deg, 20deg);
- -o-transform: rotate(135deg) skew(20deg, 20deg);
- position: absolute;
- background: red;
- border-radius: 6px;
- -webkit-animation: movedown 3s infinite ease;
- -moz-animation: movedown 3s infinite ease;
- -ms-animation: movedown 3s infinite ease;
- -o-animation: movedown 3s infinite ease;
- animation: movedown 3s infinite ease;
+ .loadmask > .placeholder > .line {
+ height: 15px;
+ margin: 30px 80px;
+ background: #e2e2e2;
+ overflow: hidden;
+ position: relative;
+
+ -webkit-animation: flickerAnimation 2s infinite ease-in-out;
+ -moz-animation: flickerAnimation 2s infinite ease-in-out;
+ -o-animation: flickerAnimation 2s infinite ease-in-out;
+ animation: flickerAnimation 2s infinite ease-in-out;
}
- #blue {
- z-index: 3;
- background: #55bce6;
- -webkit-animation-name: blue;
- -moz-animation-name: blue;
- -ms-animation-name: blue;
- -o-animation-name: blue;
- animation-name: blue;
+ @keyframes flickerAnimation {
+ 0% { opacity:0.1; }
+ 50% { opacity:1; }
+ 100% { opacity:0.1; }
}
-
- #red {
- z-index:1;
- background: #de7a59;
- -webkit-animation-name: red;
- -moz-animation-name: red;
- -ms-animation-name: red;
- -o-animation-name: red;
- animation-name: red;
+ @-o-keyframes flickerAnimation{
+ 0% { opacity:0.1; }
+ 50% { opacity:1; }
+ 100% { opacity:0.1; }
}
-
- #green {
- z-index: 2;
- background: #a1cb5c;
- -webkit-animation-name: green;
- -moz-animation-name: green;
- -ms-animation-name: green;
- -o-animation-name: green;
- animation-name: green;
+ @-moz-keyframes flickerAnimation{
+ 0% { opacity:0.1; }
+ 50% { opacity:1; }
+ 100% { opacity:0.1; }
}
-
- @-webkit-keyframes red {
- 0% { top:120px; background: #de7a59; }
- 10% { top:120px; background: #F2CBBF; }
- 14% { background: #f4f4f4; top:120px; }
- 15% { background: #f4f4f4; top:0;}
- 20% { background: #E6E4E4; }
- 30% { background: #D2D2D2; }
- 40% { top:120px; }
- 100% { top:120px; background: #de7a59; }
- }
-
- @keyframes red {
- 0% { top:120px; background: #de7a59; }
- 10% { top:120px; background: #F2CBBF; }
- 14% { background: #f4f4f4; top:120px; }
- 15% { background: #f4f4f4; top:0; }
- 20% { background: #E6E4E4; }
- 30% { background: #D2D2D2; }
- 40% { top:120px; }
- 100% { top:120px; background: #de7a59; }
- }
-
- @-webkit-keyframes green {
- 0% { top:110px; background: #a1cb5c; opacity:1; }
- 10% { top:110px; background: #CBE0AC; opacity:1; }
- 14% { background: #f4f4f4; top:110px; opacity:1; }
- 15% { background: #f4f4f4; top:0; opacity:1; }
- 20% { background: #f4f4f4; top:0; opacity:0; }
- 25% { background: #EFEFEF; top:0; opacity:1; }
- 30% { background:#E6E4E4; }
- 70% { top:110px; }
- 100% { top:110px; background: #a1cb5c; }
- }
-
- @keyframes green {
- 0% { top:110px; background: #a1cb5c; opacity:1; }
- 10% { top:110px; background: #CBE0AC; opacity:1; }
- 14% { background: #f4f4f4; top:110px; opacity:1; }
- 15% { background: #f4f4f4; top:0; opacity:1; }
- 20% { background: #f4f4f4; top:0; opacity:0; }
- 25% { background: #EFEFEF; top:0; opacity:1; }
- 30% { background:#E6E4E4; }
- 70% { top:110px; }
- 100% { top:110px; background: #a1cb5c; }
- }
-
- @-webkit-keyframes blue {
- 0% { top:100px; background: #55bce6; opacity:1; }
- 10% { top:100px; background: #BFE8F8; opacity:1; }
- 14% { background: #f4f4f4; top:100px; opacity:1; }
- 15% { background: #f4f4f4; top:0; opacity:1; }
- 20% { background: #f4f4f4; top:0; opacity:0; }
- 25% { background: #f4f4f4; top:0; opacity:0; }
- 45% { background: #EFEFEF; top:0; opacity:0.2; }
- 100% { top:100px; background: #55bce6; }
- }
-
- @keyframes blue {
- 0% { top:100px; background: #55bce6; opacity:1; }
- 10% { top:100px; background: #BFE8F8; opacity:1; }
- 14% { background: #f4f4f4; top:100px; opacity:1; }
- 15% { background: #f4f4f4; top:0; opacity:1; }
- 20% { background: #f4f4f4; top:0; opacity:0; }
- 25% { background: #f4f4f4; top:0; opacity:0; }
- 45% { background: #EFEFEF; top:0; opacity:0.2; }
- 100% { top:100px; background: #55bce6; }
+ @-webkit-keyframes flickerAnimation{
+ 0% { opacity:0.1; }
+ 50% { opacity:1; }
+ 100% { opacity:0.1; }
}
@@ -227,54 +163,28 @@
var params = getUrlParams(),
lang = (params["lang"] || 'en').split(/[\-\_]/)[0],
- customer = params["customer"] ? ('' + encodeUrlParam(params["customer"]) + '
') : '',
- margin = (customer !== '') ? 50 : 20,
- loading = 'Loading...',
- logo = params["logo"] ? ((params["logo"] !== 'none') ? ('') : '') : null;
+ logo = params["headerlogo"] ? encodeUrlParam(params["headerlogo"]) : null;
window.frameEditorId = params["frameEditorId"];
-
- if ( lang == 'de') loading = 'Ladevorgang...';
- else if ( lang == 'es') loading = 'Cargando...';
- else if ( lang == 'fr') loading = 'Chargement en cours...';
- else if ( lang == 'it') loading = 'Caricamento in corso...';
- else if ( lang == 'pt') loading = 'Carregando...';
- else if ( lang == 'ru') loading = 'Загрузка...';
- else if ( lang == 'sl') loading = 'Nalaganje...';
- else if ( lang == 'tr') loading = 'Yükleniyor...';
- else if ( lang == 'bg') loading = 'Зареждане...';
- else if ( lang == 'cs') loading = 'Nahrávám...';
- else if ( lang == 'hu') loading = 'Betöltés...';
- else if ( lang == 'ja') loading = '読み込み中...';
- else if ( lang == 'ko') loading = '로드 중...';
- else if ( lang == 'lv') loading = 'Ieladēšana ...';
- else if ( lang == 'nl') loading = 'Laden...';
- else if ( lang == 'pl') loading = 'Ładowanie...';
- else if ( lang == 'sk') loading = 'Nahrávam...';
- else if ( lang == 'uk') loading = 'Завантаження...';
- else if ( lang == 'vi') loading = 'Đang tải...';
- else if ( lang == 'zh') loading = '加载中...';
-
- if ( !stopLoading )
- document.write(
- '' +
- '
' +
- ((logo!==null) ? logo :
- '
' +
- '
' +
- '
' +
- '
' +
- '
') +
- '
' +
- '
' + customer +
- '
' + loading + '
' +
- '
' +
- '
');
+
+
+
+
diff --git a/apps/documenteditor/main/index_loader.html b/apps/documenteditor/main/index_loader.html
new file mode 100644
index 000000000..3d0f4b30e
--- /dev/null
+++ b/apps/documenteditor/main/index_loader.html
@@ -0,0 +1,303 @@
+
+
+
+ ONLYOFFICE Documents
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/apps/documenteditor/main/index_loader.html.deploy b/apps/documenteditor/main/index_loader.html.deploy
new file mode 100644
index 000000000..0d2c66fa9
--- /dev/null
+++ b/apps/documenteditor/main/index_loader.html.deploy
@@ -0,0 +1,322 @@
+
+
+
+ ONLYOFFICE Document Editor
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/apps/documenteditor/main/resources/less/app.less b/apps/documenteditor/main/resources/less/app.less
index a16802d19..4f7c8b1cc 100644
--- a/apps/documenteditor/main/resources/less/app.less
+++ b/apps/documenteditor/main/resources/less/app.less
@@ -144,4 +144,29 @@
}
@huge-icon-size: 37px;
-@x-huge-icon-size: 45px;
\ No newline at end of file
+@x-huge-icon-size: 45px;
+
+// Skeleton of document
+
+.doc-placeholder {
+ background: #fbfbfb;
+ width: 100%;
+ max-width: 796px;
+ margin: 40px auto;
+ height: 100%;
+ border: 1px solid #dfdfdf;
+ padding-top: 50px;
+
+ -webkit-animation: flickerAnimation 2s infinite ease-in-out;
+ -moz-animation: flickerAnimation 2s infinite ease-in-out;
+ -o-animation: flickerAnimation 2s infinite ease-in-out;
+ animation: flickerAnimation 2s infinite ease-in-out;
+
+ > .line {
+ height: 15px;
+ margin: 30px 80px;
+ background: #e2e2e2;
+ overflow: hidden;
+ position: relative;
+ }
+}
\ No newline at end of file
diff --git a/apps/documenteditor/mobile/app/controller/Main.js b/apps/documenteditor/mobile/app/controller/Main.js
index 176d92429..199a5a109 100644
--- a/apps/documenteditor/mobile/app/controller/Main.js
+++ b/apps/documenteditor/mobile/app/controller/Main.js
@@ -220,6 +220,9 @@ define([
if (me.editorConfig.lang)
me.api.asc_setLocale(me.editorConfig.lang);
+ if (!me.editorConfig.customization || !(me.editorConfig.customization.loaderName || me.editorConfig.customization.loaderLogo))
+ $('#editor_sdk').append('');
+
// if (this.appOptions.location == 'us' || this.appOptions.location == 'ca')
// Common.Utils.Metric.setDefaultMetric(Common.Utils.Metric.c_MetricUnits.inch);
},
@@ -619,6 +622,8 @@ define([
}
Common.Gateway.documentReady();
+
+ $('.doc-placeholder').remove();
},
onLicenseChanged: function(params) {
diff --git a/apps/documenteditor/mobile/index.html b/apps/documenteditor/mobile/index.html
index 5f3b6495a..0a15273f4 100644
--- a/apps/documenteditor/mobile/index.html
+++ b/apps/documenteditor/mobile/index.html
@@ -16,172 +16,107 @@
+
+
diff --git a/apps/documenteditor/mobile/index.html.deploy b/apps/documenteditor/mobile/index.html.deploy
index dc911efec..6eb804dc5 100644
--- a/apps/documenteditor/mobile/index.html.deploy
+++ b/apps/documenteditor/mobile/index.html.deploy
@@ -15,172 +15,107 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+