File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11( function ( cloudStack ) {
22 cloudStack . plugins . testPlugin = function ( plugin ) {
3- //
4- // Plugin code goes here
5- //
3+ plugin . ui . addSection ( {
4+ id : 'testPlugin' ,
5+ title : 'TestPlugin' ,
6+ preFilter : function ( args ) {
7+ return isAdmin ( ) ;
8+ } ,
9+ show : function ( ) {
10+ return $ ( '<div>' ) . html ( 'Test plugin section' ) ;
11+ }
12+ } ) ;
613 } ;
714} ( cloudStack ) ) ;
Original file line number Diff line number Diff line change 11( function ( $ , cloudStack , require ) {
2+ var pluginAPI = {
3+ addSection : function ( section ) {
4+ cloudStack . sections [ section . id ] = section ;
5+ } ,
6+ extend : function ( obj ) {
7+ $ . extend ( true , cloudStack , obj ) ;
8+ }
9+ } ;
10+
211 cloudStack . sections . plugins = {
312 title : 'Plugins' ,
413 show : cloudStack . uiCustom . plugins
1524
1625 // Execute plugin
1726 cloudStack . plugins [ pluginID ] ( {
18- ui : {
19- extend : function ( obj ) {
20- $ . extend ( true , cloudStack , obj ) ;
21- }
22- }
27+ ui : pluginAPI
2328 } ) ;
2429 } ) ;
2530 } ) ;
You can’t perform that action at this time.
0 commit comments