[PE][SSE] Show specified help page

This commit is contained in:
Julia Radzhabova 2020-08-25 19:38:52 +03:00
parent 1a1e6c6f04
commit d3ef5bd61c
6 changed files with 68 additions and 22 deletions

View file

@ -231,7 +231,7 @@ define([
return this;
},
show: function(panel) {
show: function(panel, opts) {
if (this.isVisible() && panel===undefined || !this.mode) return;
if ( !this.rendered )
@ -241,7 +241,7 @@ define([
if (!panel)
panel = this.active || defPanel;
this.$el.show();
this.selectMenu(panel, defPanel);
this.selectMenu(panel, opts, defPanel);
this.api && this.api.asc_enableKeyEvents(false);
@ -364,7 +364,7 @@ define([
this.document = data.doc;
},
selectMenu: function(menu, defMenu) {
selectMenu: function(menu, opts, defMenu) {
if ( menu ) {
var item = this._getMenuItem(menu),
panel = this.panels[menu];
@ -377,7 +377,7 @@ define([
item.$el.addClass('active');
this.$el.find('.content-box:visible').hide();
panel.show();
panel.show(opts);
this.active = menu;
}

View file

@ -1252,6 +1252,7 @@ define([
this.menu = options.menu;
this.urlPref = 'resources/help/en/';
this.openUrl = null;
this.en_data = [
{"src": "ProgramInterface/ProgramInterface.htm", "name": "Introducing Presentation Editor user interface", "headername": "Program Interface"},
@ -1315,7 +1316,7 @@ define([
});
this.viewHelpPicker.on('item:select', function(dataview, itemview, record) {
me.iFrame.src = me.urlPref + record.get('src');
me.onSelectItem(record.get('src'));
});
this.iFrame = document.createElement('iframe');
@ -1361,9 +1362,14 @@ define([
}
},
success: function () {
var rec = store.at(0);
me.viewHelpPicker.selectRecord(rec);
me.iFrame.src = me.urlPref + rec.get('src');
var rec = me.openUrl ? store.find(function(record){
return (me.openUrl.indexOf(record.get('src'))>=0);
}) : store.at(0);
if (rec) {
me.viewHelpPicker.selectRecord(rec, true);
me.viewHelpPicker.scrollToRecord(rec);
}
me.onSelectItem(me.openUrl ? me.openUrl : rec.get('src'));
}
};
store.url = 'resources/help/' + lang + '/Contents.json';
@ -1372,12 +1378,29 @@ define([
}
},
show: function () {
show: function (url) {
Common.UI.BaseView.prototype.show.call(this);
if (!this._scrollerInited) {
this.viewHelpPicker.scroller.update();
this._scrollerInited = true;
}
if (url) {
if (this.viewHelpPicker.store.length>0) {
var rec = this.viewHelpPicker.store.find(function(record){
return (url.indexOf(record.get('src'))>=0);
});
if (rec) {
this.viewHelpPicker.selectRecord(rec, true);
this.viewHelpPicker.scrollToRecord(rec);
}
this.onSelectItem(url);
} else
this.openUrl = url;
}
},
onSelectItem: function(src) {
this.iFrame.src = this.urlPref + src;
}
});

View file

@ -318,10 +318,10 @@ define([
this.btnPlugins.setDisabled(disable);
},
showMenu: function(menu) {
showMenu: function(menu, opts) {
var re = /^(\w+):?(\w*)$/.exec(menu);
if ( re[1] == 'file' ) {
this.menuFile.show(re[2].length ? re[2] : undefined);
this.menuFile.show(re[2].length ? re[2] : undefined, opts);
} else {
/** coauthoring begin **/
if (menu == 'chat') {

View file

@ -221,7 +221,7 @@ define([
return this;
},
show: function(panel) {
show: function(panel, opts) {
if (this.isVisible() && panel===undefined || !this.mode) return;
if ( !this.rendered )
@ -231,7 +231,7 @@ define([
if (!panel)
panel = this.active || defPanel;
this.$el.show();
this.selectMenu(panel, defPanel);
this.selectMenu(panel, opts, defPanel);
this.api.asc_enableKeyEvents(false);
@ -352,7 +352,7 @@ define([
this.document = data.doc;
},
selectMenu: function(menu, defMenu) {
selectMenu: function(menu, opts, defMenu) {
if ( menu ) {
var item = this._getMenuItem(menu),
panel = this.panels[menu];
@ -365,7 +365,7 @@ define([
item.$el.addClass('active');
this.$el.find('.content-box:visible').hide();
panel.show();
panel.show(opts);
this.active = menu;
}

View file

@ -2056,6 +2056,7 @@ define([
this.menu = options.menu;
this.urlPref = 'resources/help/en/';
this.openUrl = null;
this.en_data = [
{"src": "ProgramInterface/ProgramInterface.htm", "name": "Introducing Spreadsheet Editor user interface", "headername": "Program Interface"},
@ -2121,7 +2122,7 @@ define([
});
this.viewHelpPicker.on('item:select', function(dataview, itemview, record) {
me.iFrame.src = me.urlPref + record.get('src');
me.onSelectItem(record.get('src'));
});
this.iFrame = document.createElement('iframe');
@ -2167,9 +2168,14 @@ define([
}
},
success: function () {
var rec = store.at(0);
me.viewHelpPicker.selectRecord(rec);
me.iFrame.src = me.urlPref + rec.get('src');
var rec = me.openUrl ? store.find(function(record){
return (me.openUrl.indexOf(record.get('src'))>=0);
}) : store.at(0);
if (rec) {
me.viewHelpPicker.selectRecord(rec, true);
me.viewHelpPicker.scrollToRecord(rec);
}
me.onSelectItem(me.openUrl ? me.openUrl : rec.get('src'));
}
};
store.url = 'resources/help/' + lang + '/Contents.json';
@ -2178,12 +2184,29 @@ define([
}
},
show: function () {
show: function (url) {
Common.UI.BaseView.prototype.show.call(this);
if (!this._scrollerInited) {
this.viewHelpPicker.scroller.update();
this._scrollerInited = true;
}
if (url) {
if (this.viewHelpPicker.store.length>0) {
var rec = this.viewHelpPicker.store.find(function(record){
return (url.indexOf(record.get('src'))>=0);
});
if (rec) {
this.viewHelpPicker.selectRecord(rec, true);
this.viewHelpPicker.scrollToRecord(rec);
}
this.onSelectItem(url);
} else
this.openUrl = url;
}
},
onSelectItem: function(src) {
this.iFrame.src = this.urlPref + src;
}
});

View file

@ -307,10 +307,10 @@ define([
this.btnSpellcheck.setDisabled(false);
},
showMenu: function(menu) {
showMenu: function(menu, opts) {
var re = /^(\w+):?(\w*)$/.exec(menu);
if ( re[1] == 'file' ) {
this.menuFile.show(re[2].length ? re[2] : undefined);
this.menuFile.show(re[2].length ? re[2] : undefined, opts);
} else {
/** coauthoring begin **/
if (menu == 'chat') {