diff --git a/evennia/web/webclient/static/webclient/js/plugins/hotbuttons.js b/evennia/web/webclient/static/webclient/js/plugins/hotbuttons.js index ed00fcc636..50cbcbbdc0 100644 --- a/evennia/web/webclient/static/webclient/js/plugins/hotbuttons.js +++ b/evennia/web/webclient/static/webclient/js/plugins/hotbuttons.js @@ -24,6 +24,9 @@ plugin_handler.add('hotbuttons', (function () { var dependencies_met = true; // To start, assume either splithandler or goldenlayout plugin is enabled. + var num_buttons = 9; + var command_cache = new Array; + var hotButtonConfig = { content: [{ type: 'column', @@ -65,14 +68,10 @@ plugin_handler.add('hotbuttons', (function () { }] }; - var num_buttons = 9; - var command_cache = new Array(num_buttons); - var buttons = null; - // - // Add Buttons + // Add Buttons UI for SplitHandler var addButtonsUI = function () { - buttons = $( [ + var buttons = $( [ '
', '
', '
', @@ -90,32 +89,20 @@ plugin_handler.add('hotbuttons', (function () { '
', ].join("\n") ); - // Are we using splithandler? - if( plugins['splithandler'] ) { - // Add buttons in front of the existing #inputform - $('#input').prev().replaceWith(buttons); + // Add buttons in front of the existing #inputform + $('#input').prev().replaceWith(buttons); - Split(['#main','#buttons','#input'], { - sizes: [85,5,10], - direction: 'vertical', - gutterSize: 4, - minSize: [150,20,50], - }); + Split(['#main','#buttons','#input'], { + sizes: [85,5,10], + direction: 'vertical', + gutterSize: 4, + minSize: [150,20,50], + }); - return true; + for( var n=0; n'); + + var len = command_cache.length; + for( var x=len; x < len + num_buttons; x++ ) { + command_cache.push("unassigned"); + + // initialize button command cache and onClick handler + button = $('