");
- let newlines = $('
Newlines');
- let append = $('
Append');
- let replace = $('
Replace');
+ let newlines = $("
Newlines");
+ let append = $("
Append");
+ let replace = $("
Replace");
newlines.appendTo(div);
append.appendTo(div);
@@ -253,14 +253,14 @@ plugin_handler.add('goldenlayout', (function () {
//
// Handle the updateDropdown
var updateDropdown = function (evnt) {
- let updatelist = document.getElementById('updatelist');
+ let updatelist = document.getElementById("updatelist");
// check that no other dropdown is open
- if( document.getElementById('renamebox') ) {
+ if( document.getElementById("renamebox") ) {
closeRenameDropdown();
}
- if( document.getElementById('typelist') ) {
+ if( document.getElementById("typelist") ) {
closeTypelistDropdown();
}
@@ -275,9 +275,9 @@ plugin_handler.add('goldenlayout', (function () {
//
//
var onActiveTabChange = function (tab) {
- let renamebox = document.getElementById('renamebox');
- let typelist = document.getElementById('typelist');
- let updatelist = document.getElementById('updatelist');
+ let renamebox = document.getElementById("renamebox");
+ let typelist = document.getElementById("typelist");
+ let updatelist = document.getElementById("updatelist");
if( renamebox ) {
closeRenameDropdown();
@@ -296,18 +296,18 @@ plugin_handler.add('goldenlayout', (function () {
//
// Save the GoldenLayout state to localstorage whenever it changes.
var onStateChanged = function () {
- let components = myLayout.root.getItemsByType('component');
+ let components = myLayout.root.getItemsByType("component");
components.forEach( function (component) {
- if( component.hasId('inputComponent') ) { return; } // ignore input components
+ if( component.hasId("inputComponent") ) { return; } // ignore input components
- let text_div = component.container.getElement().children('.content');
- let types = text_div.attr('types');
- let update_method = text_div.attr('update_method');
- component.container.extendState({ 'types': types, 'update_method': update_method });
+ let text_div = component.container.getElement().children(".content");
+ let types = text_div.attr("types");
+ let update_method = text_div.attr("update_method");
+ component.container.extendState({ "types": types, "update_method": update_method });
});
var state = JSON.stringify( myLayout.toConfig() );
- localStorage.setItem( 'evenniaGoldenLayoutSavedState', state );
+ localStorage.setItem( "evenniaGoldenLayoutSavedState", state );
}
@@ -315,10 +315,10 @@ plugin_handler.add('goldenlayout', (function () {
//
var onTabCreate = function (tab) {
//HTML for the typeDropdown
- let renameDropdownControl = $('
\u2B57 ');
- let typeDropdownControl = $('
⮛ ');
- let updateDropdownControl = $('
⮛ ');
- let splitControl = $('
+ ');
+ let renameDropdownControl = $("
\u2B57 ");
+ let typeDropdownControl = $("
⮛ ");
+ let updateDropdownControl = $("
⮛ ");
+ let splitControl = $("
+ ");
// track dropdowns when the associated control is clicked
renameDropdownControl.click( tab, renameDropdown );
@@ -339,10 +339,10 @@ plugin_handler.add('goldenlayout', (function () {
tab.element.append( splitControl );
if( tab.contentItem.config.componentName == "Main" ) {
- tab.element.prepend( $('#optionsbutton').clone(true).addClass('lm_title') );
+ tab.element.prepend( $("#optionsbutton").clone(true).addClass("lm_title") );
}
- tab.header.parent.on( 'activeContentItemChanged', onActiveTabChange );
+ tab.header.parent.on( "activeContentItemChanged", onActiveTabChange );
}
@@ -350,7 +350,7 @@ plugin_handler.add('goldenlayout', (function () {
//
var onInputCreate = function (tab) {
//HTML for the typeDropdown
- let splitControl = $('
+ ');
+ let splitControl = $("
+ ");
// track adding a new tab
splitControl.click( tab, function (evnt) {
@@ -360,19 +360,19 @@ plugin_handler.add('goldenlayout', (function () {
// Add the typeDropdown to the header
tab.element.append( splitControl );
- tab.header.parent.on( 'activeContentItemChanged', onActiveTabChange );
+ tab.header.parent.on( "activeContentItemChanged", onActiveTabChange );
}
//
//
var scrollAll = function () {
- let components = myLayout.root.getItemsByType('component');
+ let components = myLayout.root.getItemsByType("component");
components.forEach( function (component) {
- if( component.hasId('inputComponent') ) { return; } // ignore input components
+ if( component.hasId("inputComponent") ) { return; } // ignore input components
- let text_div = component.container.getElement().children('.content');
- let scrollHeight = text_div.prop('scrollHeight');
- let clientHeight = text_div.prop('clientHeight');
+ let text_div = component.container.getElement().children(".content");
+ let scrollHeight = text_div.prop("scrollHeight");
+ let clientHeight = text_div.prop("clientHeight");
text_div.scrollTop( scrollHeight - clientHeight );
});
myLayout.updateSize();
@@ -382,15 +382,15 @@ plugin_handler.add('goldenlayout', (function () {
//
//
var routeMsg = function (text_div, txt, update_method) {
- if ( update_method == 'replace' ) {
+ if ( update_method == "replace" ) {
text_div.html(txt)
- } else if ( update_method == 'append' ) {
+ } else if ( update_method == "append" ) {
text_div.append(txt);
} else { // line feed
- text_div.append('
' + txt + '
');
+ text_div.append("
" + txt + "
");
}
- let scrollHeight = text_div.prop('scrollHeight');
- let clientHeight = text_div.prop('clientHeight');
+ let scrollHeight = text_div.prop("scrollHeight");
+ let clientHeight = text_div.prop("clientHeight");
text_div.scrollTop( scrollHeight - clientHeight );
}
@@ -398,16 +398,16 @@ plugin_handler.add('goldenlayout', (function () {
//
//
var initComponent = function (div, container, state, default_types, update_method) {
- // set this container's content div types attribute
+ // set this container"s content div types attribute
if( state ) {
- div.attr('types', state.types);
- div.attr('update_method', state.update_method);
+ div.attr("types", state.types);
+ div.attr("update_method", state.update_method);
} else {
- div.attr('types', default_types);
- div.attr('update_method', update_method);
+ div.attr("types", default_types);
+ div.attr("update_method", update_method);
}
div.appendTo( container.getElement() );
- container.on('tab', onTabCreate);
+ container.on("tab", onTabCreate);
}
@@ -419,7 +419,7 @@ plugin_handler.add('goldenlayout', (function () {
//
//
var onKeydown = function(evnt) {
- var renamebox = document.getElementById('renamebox');
+ var renamebox = document.getElementById("renamebox");
if( renamebox ) {
return true;
}
@@ -430,39 +430,39 @@ plugin_handler.add('goldenlayout', (function () {
//
//
var onText = function (args, kwargs) {
- // If the message is not itself tagged, we'll assume it
- // should go into any panes with 'all' and 'untagged' set
- var msgtype = 'untagged';
+ // If the message is not itself tagged, we"ll assume it
+ // should go into any panes with "all" and "untagged" set
+ var msgtype = "untagged";
- if ( kwargs && 'type' in kwargs ) {
- msgtype = kwargs['type'];
+ if ( kwargs && "type" in kwargs ) {
+ msgtype = kwargs["type"];
if ( ! known_types.includes(msgtype) ) {
// this is a new output type that can be mapped to panes
- console.log('detected new output type: ' + msgtype)
+ console.log("detected new output type: " + msgtype)
known_types.push(msgtype);
untagged.push(msgtype);
}
}
let message_delivered = false;
- let components = myLayout.root.getItemsByType('component');
+ let components = myLayout.root.getItemsByType("component");
components.forEach( function (component) {
- if( component.hasId('inputComponent') ) { return; } // ignore the input component
+ if( component.hasId("inputComponent") ) { return; } // ignore the input component
- let text_div = component.container.getElement().children('.content');
- let attr_types = text_div.attr('types');
- let pane_types = attr_types ? attr_types.split(' ') : [];
- let update_method = text_div.attr('update_method');
+ let text_div = component.container.getElement().children(".content");
+ let attr_types = text_div.attr("types");
+ let pane_types = attr_types ? attr_types.split(" ") : [];
+ let update_method = text_div.attr("update_method");
let txt = args[0];
- // is this message type listed in this pane's types (or is this pane catching 'all')
- if( pane_types.includes(msgtype) || pane_types.includes('all') ) {
+ // is this message type listed in this pane"s types (or is this pane catching "all")
+ if( pane_types.includes(msgtype) || pane_types.includes("all") ) {
routeMsg( text_div, txt, update_method );
message_delivered = true;
}
- // is this pane catching 'upmapped' messages?
+ // is this pane catching "upmapped" messages?
// And is this message type listed in the untagged types array?
if( pane_types.includes("untagged") && untagged.includes(msgtype) ) {
routeMsg( text_div, txt, update_method );
@@ -488,9 +488,9 @@ plugin_handler.add('goldenlayout', (function () {
$(window).bind("resize", scrollAll);
// Set Save State callback
- myLayout.on( 'stateChanged', onStateChanged );
+ myLayout.on( "stateChanged", onStateChanged );
- console.log('Golden Layout Plugin Initialized.');
+ console.log("Golden Layout Plugin Initialized.");
}
@@ -498,8 +498,8 @@ plugin_handler.add('goldenlayout', (function () {
// required Init me
var init = function (options) {
// Set up our GoldenLayout instance built off of the default main-sub div
- var savedState = localStorage.getItem( 'evenniaGoldenLayoutSavedState' );
- var mainsub = document.getElementById('main-sub');
+ var savedState = localStorage.getItem( "evenniaGoldenLayoutSavedState" );
+ var mainsub = document.getElementById("main-sub");
if( savedState !== null ) {
config = JSON.parse( savedState );
@@ -507,40 +507,40 @@ plugin_handler.add('goldenlayout', (function () {
myLayout = new GoldenLayout( config, mainsub );
- $('#inputcontrol').remove(); // remove the cluttered, HTML-defined input divs
+ $("#inputcontrol").remove(); // remove the cluttered, HTML-defined input divs
// register our component and replace the default messagewindow with the Main component
- myLayout.registerComponent( 'Main', function (container, componentState) {
- let main = $('#messagewindow').addClass('content');
- initComponent(main, container, componentState, 'untagged', 'newlines' );
+ myLayout.registerComponent( "Main", function (container, componentState) {
+ let main = $("#messagewindow").addClass("content");
+ initComponent(main, container, componentState, "untagged", "newlines" );
});
// register our new input component
- myLayout.registerComponent( 'input', function (container, componentState) {
- var inputfield = $('
');
- var button = $('
> ');
+ myLayout.registerComponent( "input", function (container, componentState) {
+ var inputfield = $("
");
+ var button = $("
> ");
- $('
')
+ $("
")
.append( button )
.append( inputfield )
.appendTo( container.getElement() );
- button.bind('click', function (evnt) {
+ button.bind("click", function (evnt) {
// focus our textarea
- $( $(evnt.target).siblings('.inputfield')[0] ).focus();
+ $( $(evnt.target).siblings(".inputfield")[0] ).focus();
// fake a carriage return event
- var e = $.Event('keydown');
+ var e = $.Event("keydown");
e.which = 13;
- $( $(evnt.target).siblings('.inputfield')[0] ).trigger(e);
+ $( $(evnt.target).siblings(".inputfield")[0] ).trigger(e);
});
- container.on('tab', onInputCreate);
+ container.on("tab", onInputCreate);
});
- myLayout.registerComponent( 'evennia', function (container, componentState) {
- let div = $('
');
- initComponent(div, container, componentState, 'all', 'newlines');
- container.on('destroy', calculateUntaggedTypes);
+ myLayout.registerComponent( "evennia", function (container, componentState) {
+ let div = $("
");
+ initComponent(div, container, componentState, "all", "newlines");
+ container.on("destroy", calculateUntaggedTypes);
});
}
@@ -555,4 +555,5 @@ plugin_handler.add('goldenlayout', (function () {
setConfig: function (newconfig) { config = newconfig },
addKnownType: function (newtype) { known_types.push(newtype) },
}
-})());
+})();
+window.plugin_handler.add("goldenlayout", goldenlayout);
diff --git a/evennia/web/webclient/static/webclient/js/plugins/history.js b/evennia/web/webclient/static/webclient/js/plugins/history.js
index 8afcec44f3..0b02b947a9 100644
--- a/evennia/web/webclient/static/webclient/js/plugins/history.js
+++ b/evennia/web/webclient/static/webclient/js/plugins/history.js
@@ -10,7 +10,7 @@ let history_plugin = (function () {
var history = new Array();
var history_pos = 0;
- history[0] = ''; // the very latest input is empty for new entry.
+ history[0] = ""; // the very latest input is empty for new entry.
//
// move back in the history
@@ -37,7 +37,7 @@ let history_plugin = (function () {
history.shift(); // kill oldest entry
}
history[history.length-1] = input;
- history[history.length] = '';
+ history[history.length] = "";
}
history_pos = 0;
}
@@ -62,11 +62,11 @@ let history_plugin = (function () {
if (history_entry !== null) {
// Doing a history navigation; replace the text in the input and
// move the cursor to the end of the new value
- var inputfield = $('.inputfield:focus');
+ var inputfield = $(".inputfield:focus");
if( inputfield.length < 1 ) { // pre-goldenlayout backwards compatibility
- inputfield = $('#inputfield');
+ inputfield = $("#inputfield");
}
- inputfield.val('');
+ inputfield.val("");
inputfield.blur().focus().val(history_entry);
event.preventDefault();
return true;
@@ -85,7 +85,7 @@ let history_plugin = (function () {
//
// Init function
var init = function () {
- console.log('History Plugin Initialized.');
+ console.log("History Plugin Initialized.");
}
return {
@@ -94,4 +94,4 @@ let history_plugin = (function () {
onSend: onSend,
}
})()
-plugin_handler.add('history', history_plugin);
+plugin_handler.add("history", history_plugin);
diff --git a/evennia/web/webclient/static/webclient/js/plugins/hotbuttons.js b/evennia/web/webclient/static/webclient/js/plugins/hotbuttons.js
index 50cbcbbdc0..383f6d0055 100644
--- a/evennia/web/webclient/static/webclient/js/plugins/hotbuttons.js
+++ b/evennia/web/webclient/static/webclient/js/plugins/hotbuttons.js
@@ -1,6 +1,6 @@
/*
*
- * Assignable 'hot-buttons' Plugin
+ * Assignable "hot-buttons" Plugin
*
* This adds a bar of 9 buttons that can be shift-click assigned whatever is in the textinput buffer, so you can simply
* click the button again and have it execute those commands, instead of having to type it all out again and again.
@@ -18,10 +18,10 @@
*
* after the other plugin tags.
*
- * Run: evennia collectstatic (say 'yes' to the overwrite prompt)
+ * Run: evennia collectstatic (say "yes" to the overwrite prompt)
* Start Evennia
*/
-plugin_handler.add('hotbuttons', (function () {
+let hotbuttons = (function () {
var dependencies_met = true; // To start, assume either splithandler or goldenlayout plugin is enabled.
var num_buttons = 9;
@@ -29,41 +29,41 @@ plugin_handler.add('hotbuttons', (function () {
var hotButtonConfig = {
content: [{
- type: 'column',
+ type: "column",
content: [{
- type: 'row',
+ type: "row",
content: [{
- type: 'column',
+ type: "column",
content: [{
- type: 'component',
- componentName: 'Main',
+ type: "component",
+ componentName: "Main",
isClosable: false,
- tooltip: 'Main - drag to desird position.',
+ tooltip: "Main - drag to desird position.",
componentState: {
- types: 'untagged',
- update_method: 'newlines',
+ types: "untagged",
+ update_method: "newlines",
},
}]
}],
}, {
- type: 'component',
- componentName: 'hotbuttons',
- id: 'inputComponent',
+ type: "component",
+ componentName: "hotbuttons",
+ id: "inputComponent",
height: 12,
- tooltip: 'Input - The last input in the layout is always the default.',
+ tooltip: "Input - The last input in the layout is always the default.",
}, {
- type: 'component',
- componentName: 'input',
- id: 'inputComponent',
+ type: "component",
+ componentName: "input",
+ id: "inputComponent",
height: 12,
- tooltip: 'Input - The last input in the layout is always the default.',
+ tooltip: "Input - The last input in the layout is always the default.",
}, {
- type: 'component',
- componentName: 'input',
- id: 'inputComponent',
+ type: "component",
+ componentName: "input",
+ id: "inputComponent",
height: 12,
isClosable: false,
- tooltip: 'Input - The last input in the layout is always the default.',
+ tooltip: "Input - The last input in the layout is always the default.",
}]
}]
};
@@ -72,29 +72,29 @@ plugin_handler.add('hotbuttons', (function () {
// Add Buttons UI for SplitHandler
var addButtonsUI = function () {
var buttons = $( [
- '
',
+ "
",
].join("\n") );
// Add buttons in front of the existing #inputform
- $('#input').prev().replaceWith(buttons);
+ $("#input").prev().replaceWith(buttons);
- Split(['#main','#buttons','#input'], {
+ Split(["#main","#buttons","#input"], {
sizes: [85,5,10],
- direction: 'vertical',
+ direction: "vertical",
gutterSize: 4,
minSize: [150,20,50],
});
@@ -150,9 +150,9 @@ plugin_handler.add('hotbuttons', (function () {
console.log("button " + e.data + " clicked");
if( button.text() == "unassigned" ) {
// Assign the button and send the full button state to the server using a Webclient_Options event
- var input = $('.inputfield:last');
+ var input = $(".inputfield:last");
if( input.length < 1 ) {
- input = $('#inputfield');
+ input = $("#inputfield");
}
assignButton( e.data, input.val() );
Evennia.msg("webclient_options", [], { "HotButtons": command_cache });
@@ -171,20 +171,20 @@ plugin_handler.add('hotbuttons', (function () {
//
// Create and register the hotbuttons golden-layout component
var buildComponent = function () {
- var myLayout = plugins['goldenlayout'].getGL();
+ var myLayout = plugins["goldenlayout"].getGL();
- myLayout.registerComponent( 'hotbuttons', function (container, componentState) {
- console.log('hotbuttons');
+ myLayout.registerComponent( "hotbuttons", function (container, componentState) {
+ console.log("hotbuttons");
// build the buttons
- var div = $('