-
-
Notifications
You must be signed in to change notification settings - Fork 31
/
Copy path1_gui.js
59 lines (54 loc) · 2.02 KB
/
1_gui.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/**
*
* Configuration of simple EQWC plugin which consists of new button in top menu with own icon, tooltip and action.
* It is independend from other buttons.
*
* To use this plugin:
* 1. Copy /plugins/_template directory to /plugins/simpleaction and make following changes in simpleaction/js/1_gui.js
* 2. Make sure you are running latest database version (18 or higher)
* 3. Adjust icon in /img/icon.png
* 4. Adjust tooltip below
* 5. Adjust url in newWindow function below
*
* You can have more such plugins, each with own icon and action
* To create new plugin from this template
* 1. Copy /plugins/_template directory to /plugins/yourpluginname and make following changes in yourpluginname/js/1_gui.js
* 2. Insert plugin to database with: INSERT INTO plugins(name) VALUES ('yourpluginname');
* 3. Change Eqwc.plugins["simpleaction"] lines to Eqwc.plugins["yourpluginname"]
* 4. Change plugin id from id: 'simpleActionBtn' to something unique and reference it in customToolbarLoad
* 5. Also look at steps 2-5 above
*
*/
// new button for the toolbar
customButtons.push(
// Add a separator and a button
{
xtype: 'tbseparator'
}, {
xtype: 'button',
scale: 'medium',
icon: 'plugins/simpleaction/img/icon.png',
tooltipType: 'qtip',
tooltip: 'Write own tooltip here',
id: 'simpleActionBtn' //must be unique ID
}
);
Eqwc.plugins["simpleaction"] = {};
Eqwc.plugins["simpleaction"].customToolbarLoad = function() {
var btn = Ext.getCmp('simpleActionBtn');
btn.setHandler(newWindow);
function newWindow() {
var url = "https://level2.si";
window.open(url);
}
//This is just example. It should be developed further to open content in panel.
//Problem are external URLs
//function rightPanel() {
// var panel = Ext.getCmp('RightPanel');
// panel.setVisible(true);
// panel.removeAll();
//
// panel.load({url: "docs/index.html"});
// panel.expand();
//}
};