diff --git a/evennia/web/webclient/static/webclient/js/plugins/clienthelp.js b/evennia/web/webclient/static/webclient/js/plugins/clienthelp.js index 7cab3457f2..f5f5545ab0 100644 --- a/evennia/web/webclient/static/webclient/js/plugins/clienthelp.js +++ b/evennia/web/webclient/static/webclient/js/plugins/clienthelp.js @@ -9,10 +9,10 @@ let clienthelp_plugin = (function () { // var onOptionsUI = function (parentdiv) { var help_text = $( [ - "

Welcome to Evennia.

", - "
This client supports a bunch of features, including
", - "
drag-and-drop window placement, multiple input windows, and per-window message routing.
", - "
To get the full details, go to: Evennia.com

", + "
", + "Evennia", + " Webclient Settings:", + "
" ].join("")); parentdiv.append(help_text); } diff --git a/evennia/web/webclient/static/webclient/js/plugins/font.js b/evennia/web/webclient/static/webclient/js/plugins/font.js index 7512d931f4..cf940fab40 100644 --- a/evennia/web/webclient/static/webclient/js/plugins/font.js +++ b/evennia/web/webclient/static/webclient/js/plugins/font.js @@ -37,7 +37,7 @@ let font_plugin = (function () { } fontselect.val('DejaVu Sans Mono'); // default value - sizeselect.val('9'); // default value + sizeselect.val('0.9'); // default scaling factor // font-family change callback fontselect.on('change', function () { @@ -50,7 +50,7 @@ let font_plugin = (function () { }); // add the font selection dialog control to our parentdiv - parentdiv.append('

Font Selection:

'); + parentdiv.append('
Font Selection:
'); parentdiv.append(fontselect); parentdiv.append(sizeselect); } diff --git a/evennia/web/webclient/static/webclient/js/plugins/iframe.js b/evennia/web/webclient/static/webclient/js/plugins/iframe.js index d6df1b02dc..01d19a7993 100644 --- a/evennia/web/webclient/static/webclient/js/plugins/iframe.js +++ b/evennia/web/webclient/static/webclient/js/plugins/iframe.js @@ -40,10 +40,10 @@ let iframe = (function () { // Public var onOptionsUI = function (parentdiv) { - var iframebutton = $(''); + var iframebutton = $(''); iframebutton.on('click', onOpenIframe); - parentdiv.append( '

Browser iFrame:

' ); + parentdiv.append( '
Restricted Browser-in-Browser:
' ); parentdiv.append( iframebutton ); } diff --git a/evennia/web/webclient/static/webclient/js/plugins/message_routing.js b/evennia/web/webclient/static/webclient/js/plugins/message_routing.js index f6964588f2..04bb88cf67 100644 --- a/evennia/web/webclient/static/webclient/js/plugins/message_routing.js +++ b/evennia/web/webclient/static/webclient/js/plugins/message_routing.js @@ -63,7 +63,7 @@ let spawns = (function () { onNewRegexRow(div, regex, spawnmap[regex] ); } - parentdiv.append('

Message Routing:

'); + parentdiv.append('
Message Routing:
'); parentdiv.append(div); } diff --git a/evennia/web/webclient/static/webclient/js/plugins/options2.js b/evennia/web/webclient/static/webclient/js/plugins/options2.js index 7c87b46e69..565ef26333 100644 --- a/evennia/web/webclient/static/webclient/js/plugins/options2.js +++ b/evennia/web/webclient/static/webclient/js/plugins/options2.js @@ -4,6 +4,8 @@ */ let options2 = (function () { + var options_container = null ; + var onGagPrompt = function () { console.log('gagprompt') } var onNotifyPopup = function () { console.log('notifypopup') } var onNotifySound = function () { console.log('notifysound') } @@ -30,6 +32,7 @@ let options2 = (function () { myLayout.registerComponent( "options", function (container, componentState) { var plugins = window.plugins; + options_container = container.getElement(); // build the buttons var div = $("
"); @@ -46,13 +49,13 @@ let options2 = (function () { } } - div.appendTo( container.getElement() ); + div.appendTo( options_container ); }); } // handler for the "Options" button - var onOpenOptions = function () { + var onOpenCloseOptions = function () { var optionsComponent = { title: "Options", type: "component", @@ -63,8 +66,27 @@ let options2 = (function () { // Create a new GoldenLayout tab filled with the optionsComponent above var myLayout = window.plugins["goldenlayout"].getGL(); - var main = myLayout.root.getItemsByType("stack")[0].getActiveContentItem(); - main.parent.addChild( optionsComponent ); + if( ! options_container ) { + // open new optionsComponent + var main = myLayout.root.getItemsByType("stack")[0].getActiveContentItem(); + + myLayout.on( 'tabCreated', function( tab ) { + if( tab.contentItem.componentName == "options" ) { + tab + .closeElement + .off('click') + .click( function () { + options_container = null; + tab.contentItem.remove(); + }); + options_container = tab.contentItem; + } + }); + main.parent.addChild( optionsComponent ); + } else { + options_container.remove(); + options_container = null; + } } // Public @@ -88,7 +110,7 @@ let options2 = (function () { if( window.plugins["goldenlayout"] ) { createOptionsComponent(); - $("#optionsbutton").bind("click", onOpenOptions); + $("#optionsbutton").bind("click", onOpenCloseOptions); } console.log('Options2 Loaded'); }