@@ -171,54 +171,60 @@ var RED = (function() {
171171 }
172172
173173 function loadEditor ( ) {
174- RED . menu . init ( { id :"btn-sidemenu" ,
175- options : [
176- { id :"menu-item-view-menu" , label :RED . _ ( "menu.label.view.view" ) , options :[
177- { id :"menu-item-view-show-grid" , label :RED . _ ( "menu.label.view.showGrid" ) , toggle :true , onselect :RED . view . toggleShowGrid } ,
178- { id :"menu-item-view-snap-grid" , label :RED . _ ( "menu.label.view.snapGrid" ) , toggle :true , onselect :RED . view . toggleSnapGrid } ,
179- { id :"menu-item-status" , label :RED . _ ( "menu.label.displayStatus" ) , toggle :true , onselect :toggleStatus , selected : true } ,
180- null ,
181- { id :"menu-item-bidi" , label :RED . _ ( "menu.label.view.textDir" ) , options :[
182- { id :"menu-item-bidi-default" , toggle :"text-direction" , label :RED . _ ( "menu.label.view.defaultDir" ) , selected : true , onselect :function ( s ) { if ( s ) { RED . text . bidi . setTextDirection ( "" ) } } } ,
183- { id :"menu-item-bidi-ltr" , toggle :"text-direction" , label :RED . _ ( "menu.label.view.ltr" ) , onselect :function ( s ) { if ( s ) { RED . text . bidi . setTextDirection ( "ltr" ) } } } ,
184- { id :"menu-item-bidi-rtl" , toggle :"text-direction" , label :RED . _ ( "menu.label.view.rtl" ) , onselect :function ( s ) { if ( s ) { RED . text . bidi . setTextDirection ( "rtl" ) } } } ,
185- { id :"menu-item-bidi-auto" , toggle :"text-direction" , label :RED . _ ( "menu.label.view.auto" ) , onselect :function ( s ) { if ( s ) { RED . text . bidi . setTextDirection ( "auto" ) } } }
186- ] } ,
187- null ,
188- { id :"menu-item-sidebar" , label :RED . _ ( "menu.label.sidebar.show" ) , toggle :true , onselect :RED . sidebar . toggleSidebar , selected : true }
189- ] } ,
190- null ,
191- { id :"menu-item-import" , label :RED . _ ( "menu.label.import" ) , options :[
192- { id :"menu-item-import-clipboard" , label :RED . _ ( "menu.label.clipboard" ) , onselect :RED . clipboard . import } ,
193- { id :"menu-item-import-library" , label :RED . _ ( "menu.label.library" ) , options :[ ] }
194- ] } ,
195- { id :"menu-item-export" , label :RED . _ ( "menu.label.export" ) , disabled :true , options :[
196- { id :"menu-item-export-clipboard" , label :RED . _ ( "menu.label.clipboard" ) , disabled :true , onselect :RED . clipboard . export } ,
197- { id :"menu-item-export-library" , label :RED . _ ( "menu.label.library" ) , disabled :true , onselect :RED . library . export }
198- ] } ,
199- null ,
200- { id :"menu-item-search" , label :RED . _ ( "menu.label.search" ) , onselect :RED . search . show } ,
201- null ,
202- { id :"menu-item-config-nodes" , label :RED . _ ( "menu.label.displayConfig" ) , onselect :function ( ) { } } ,
203- { id :"menu-item-workspace" , label :RED . _ ( "menu.label.flows" ) , options :[
204- { id :"menu-item-workspace-add" , label :RED . _ ( "menu.label.add" ) , onselect :RED . workspaces . add } ,
205- { id :"menu-item-workspace-edit" , label :RED . _ ( "menu.label.rename" ) , onselect :RED . workspaces . edit } ,
206- { id :"menu-item-workspace-delete" , label :RED . _ ( "menu.label.delete" ) , onselect :RED . workspaces . remove } ,
207- null
208- ] } ,
209- { id :"menu-item-subflow" , label :RED . _ ( "menu.label.subflows" ) , options : [
210- { id :"menu-item-subflow-create" , label :RED . _ ( "menu.label.createSubflow" ) , onselect :RED . subflow . createSubflow } ,
211- { id :"menu-item-subflow-convert" , label :RED . _ ( "menu.label.selectionToSubflow" ) , disabled :true , onselect :RED . subflow . convertToSubflow } ,
212- ] } ,
213- null ,
214- { id :"menu-item-keyboard-shortcuts" , label :RED . _ ( "menu.label.keyboardShortcuts" ) , onselect :RED . keyboard . showHelp } ,
215- { id :"menu-item-help" ,
216- label : RED . settings . theme ( "menu.menu-item-help.label" , "Node-RED Website" ) ,
217- href : RED . settings . theme ( "menu.menu-item-help.url" , "http://nodered.org/docs" )
218- } ,
219- { id :"menu-item-node-red-version" , label :"v" + RED . settings . version , onselect : showAbout }
220- ]
174+
175+ var menuOptions = [ ] ;
176+ menuOptions . push ( { id :"menu-item-view-menu" , label :RED . _ ( "menu.label.view.view" ) , options :[
177+ { id :"menu-item-view-show-grid" , label :RED . _ ( "menu.label.view.showGrid" ) , toggle :true , onselect :RED . view . toggleShowGrid } ,
178+ { id :"menu-item-view-snap-grid" , label :RED . _ ( "menu.label.view.snapGrid" ) , toggle :true , onselect :RED . view . toggleSnapGrid } ,
179+ { id :"menu-item-status" , label :RED . _ ( "menu.label.displayStatus" ) , toggle :true , onselect :toggleStatus , selected : true } ,
180+ null ,
181+ { id :"menu-item-bidi" , label :RED . _ ( "menu.label.view.textDir" ) , options :[
182+ { id :"menu-item-bidi-default" , toggle :"text-direction" , label :RED . _ ( "menu.label.view.defaultDir" ) , selected : true , onselect :function ( s ) { if ( s ) { RED . text . bidi . setTextDirection ( "" ) } } } ,
183+ { id :"menu-item-bidi-ltr" , toggle :"text-direction" , label :RED . _ ( "menu.label.view.ltr" ) , onselect :function ( s ) { if ( s ) { RED . text . bidi . setTextDirection ( "ltr" ) } } } ,
184+ { id :"menu-item-bidi-rtl" , toggle :"text-direction" , label :RED . _ ( "menu.label.view.rtl" ) , onselect :function ( s ) { if ( s ) { RED . text . bidi . setTextDirection ( "rtl" ) } } } ,
185+ { id :"menu-item-bidi-auto" , toggle :"text-direction" , label :RED . _ ( "menu.label.view.auto" ) , onselect :function ( s ) { if ( s ) { RED . text . bidi . setTextDirection ( "auto" ) } } }
186+ ] } ,
187+ null ,
188+ { id :"menu-item-sidebar" , label :RED . _ ( "menu.label.sidebar.show" ) , toggle :true , onselect :RED . sidebar . toggleSidebar , selected : true }
189+ ] } ) ;
190+ menuOptions . push ( null ) ;
191+ menuOptions . push ( { id :"menu-item-import" , label :RED . _ ( "menu.label.import" ) , options :[
192+ { id :"menu-item-import-clipboard" , label :RED . _ ( "menu.label.clipboard" ) , onselect :RED . clipboard . import } ,
193+ { id :"menu-item-import-library" , label :RED . _ ( "menu.label.library" ) , options :[ ] }
194+ ] } ) ;
195+ menuOptions . push ( { id :"menu-item-export" , label :RED . _ ( "menu.label.export" ) , disabled :true , options :[
196+ { id :"menu-item-export-clipboard" , label :RED . _ ( "menu.label.clipboard" ) , disabled :true , onselect :RED . clipboard . export } ,
197+ { id :"menu-item-export-library" , label :RED . _ ( "menu.label.library" ) , disabled :true , onselect :RED . library . export }
198+ ] } ) ;
199+ menuOptions . push ( null ) ;
200+ menuOptions . push ( { id :"menu-item-search" , label :RED . _ ( "menu.label.search" ) , onselect :RED . search . show } ) ;
201+ menuOptions . push ( null ) ;
202+ menuOptions . push ( { id :"menu-item-config-nodes" , label :RED . _ ( "menu.label.displayConfig" ) , onselect :function ( ) { } } ) ;
203+ menuOptions . push ( { id :"menu-item-workspace" , label :RED . _ ( "menu.label.flows" ) , options :[
204+ { id :"menu-item-workspace-add" , label :RED . _ ( "menu.label.add" ) , onselect :RED . workspaces . add } ,
205+ { id :"menu-item-workspace-edit" , label :RED . _ ( "menu.label.rename" ) , onselect :RED . workspaces . edit } ,
206+ { id :"menu-item-workspace-delete" , label :RED . _ ( "menu.label.delete" ) , onselect :RED . workspaces . remove } ,
207+ null
208+ ] } ) ;
209+ menuOptions . push ( { id :"menu-item-subflow" , label :RED . _ ( "menu.label.subflows" ) , options : [
210+ { id :"menu-item-subflow-create" , label :RED . _ ( "menu.label.createSubflow" ) , onselect :RED . subflow . createSubflow } ,
211+ { id :"menu-item-subflow-convert" , label :RED . _ ( "menu.label.selectionToSubflow" ) , disabled :true , onselect :RED . subflow . convertToSubflow } ,
212+ ] } ) ;
213+ menuOptions . push ( null ) ;
214+ if ( RED . settings . theme ( 'palette.editable' ) !== false ) {
215+ RED . palette . editor . init ( ) ;
216+ menuOptions . push ( { id :"menu-item-edit-palette" , label :RED . _ ( "menu.label.editPalette" ) , onselect :RED . palette . editor . show } ) ;
217+ menuOptions . push ( null ) ;
218+ }
219+
220+ menuOptions . push ( { id :"menu-item-keyboard-shortcuts" , label :RED . _ ( "menu.label.keyboardShortcuts" ) , onselect :RED . keyboard . showHelp } ) ;
221+ menuOptions . push ( { id :"menu-item-help" ,
222+ label : RED . settings . theme ( "menu.menu-item-help.label" , "Node-RED website" ) ,
223+ href : RED . settings . theme ( "menu.menu-item-help.url" , "http://nodered.org/docs" )
221224 } ) ;
225+ menuOptions . push ( { id :"menu-item-node-red-version" , label :"v" + RED . settings . version , onselect : showAbout } ) ;
226+
227+ RED . menu . init ( { id :"btn-sidemenu" , options : menuOptions } ) ;
222228
223229 RED . user . init ( ) ;
224230
0 commit comments