]>
git.proxmox.com Git - proxmox-widget-toolkit.git/blob - button/HelpButton.js
1 /* help button pointing to an online documentation
2 for components contained in a modal window
7 Ext
.define('Proxmox.button.Help', {
8 extend
: 'Ext.button.Button',
9 xtype
: 'proxmoxHelpButton',
11 text
: gettext('Help'),
13 // make help button less flashy by styling it like toolbar buttons
14 iconCls
: ' x-btn-icon-el-default-toolbar-small fa fa-question-circle',
15 cls
: 'x-btn-default-toolbar-small proxmox-inline-button',
19 listenToGlobalEvent
: true,
22 xclass
: 'Ext.app.ViewController',
25 proxmoxShowHelp
: 'onProxmoxShowHelp',
26 proxmoxHideHelp
: 'onProxmoxHideHelp',
29 onProxmoxShowHelp: function(helpLink
) {
30 var me
= this.getView();
31 if (me
.listenToGlobalEvent
=== true) {
32 me
.setOnlineHelp(helpLink
);
36 onProxmoxHideHelp: function() {
37 var me
= this.getView();
38 if (me
.listenToGlobalEvent
=== true) {
44 // this sets the link and the tooltip text
45 setOnlineHelp: function(blockid
) {
48 var info
= Proxmox
.Utils
.get_help_info(blockid
);
50 me
.onlineHelp
= blockid
;
51 var title
= info
.title
;
53 title
+= ' - ' + info
.subtitle
;
59 // helper to set the onlineHelp via a config object
60 setHelpConfig: function(config
) {
62 me
.setOnlineHelp(config
.onlineHelp
);
70 docsURI
= Proxmox
.Utils
.get_help_link(me
.onlineHelp
);
76 Ext
.Msg
.alert(gettext('Help'), gettext('No Help available'));
80 initComponent: function() {
81 /*jslint confusion: true */
87 me
.setOnlineHelp(me
.onlineHelp
); // set tooltip