Merge branch 'fix_prompt' of https://github.com/friarzen/evennia into friarzen-fix_prompt
This commit is contained in:
commit
9d98bb35ee
3 changed files with 28 additions and 10 deletions
|
|
@ -116,11 +116,16 @@ label {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.inputfieldwrapper {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
.inputsend {
|
.inputsend {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
right: 0;
|
right: 0;
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
height: inherit;
|
height: 100%;
|
||||||
width: 30px;
|
width: 30px;
|
||||||
color: white;
|
color: white;
|
||||||
background-color: black;
|
background-color: black;
|
||||||
|
|
@ -128,9 +133,7 @@ label {
|
||||||
}
|
}
|
||||||
|
|
||||||
.inputfield {
|
.inputfield {
|
||||||
position: absolute;
|
height: 100%;
|
||||||
top: 0;
|
|
||||||
height: inherit;
|
|
||||||
width: calc(100% - 30px);
|
width: calc(100% - 30px);
|
||||||
background-color: black;
|
background-color: black;
|
||||||
color: white;
|
color: white;
|
||||||
|
|
|
||||||
|
|
@ -21,10 +21,19 @@ let defaultout_plugin = (function () {
|
||||||
//
|
//
|
||||||
// By default just show the prompt.
|
// By default just show the prompt.
|
||||||
var onPrompt = function (args, kwargs) {
|
var onPrompt = function (args, kwargs) {
|
||||||
// show prompt
|
// show prompt on every input pane
|
||||||
$('#prompt')
|
var prompts = $('.prompt');
|
||||||
.addClass("out")
|
|
||||||
.html(args[0]);
|
for( var x=0; x < prompts.length; x++ ) {
|
||||||
|
var prmpt = $( prompts[x] );
|
||||||
|
var sibling = prmpt.siblings().first();
|
||||||
|
|
||||||
|
prmpt.addClass("out")
|
||||||
|
.html(args[0])
|
||||||
|
.css({'height':'1.5em'});
|
||||||
|
|
||||||
|
sibling.css({'height':'calc(100% - 1.5em)'});
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -476,6 +476,7 @@ let goldenlayout = (function () {
|
||||||
|
|
||||||
myLayout = new GoldenLayout( window.goldenlayout_config, mainsub );
|
myLayout = new GoldenLayout( window.goldenlayout_config, mainsub );
|
||||||
|
|
||||||
|
$("#prompt").remove(); // remove the HTML-defined prompt div
|
||||||
$("#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
|
// register our component and replace the default messagewindow with the Main component
|
||||||
|
|
@ -486,11 +487,16 @@ let goldenlayout = (function () {
|
||||||
|
|
||||||
// register our new input component
|
// register our new input component
|
||||||
myLayout.registerComponent( "input", function (container, componentState) {
|
myLayout.registerComponent( "input", function (container, componentState) {
|
||||||
var inputfield = $("<textarea type='text' class='inputfield form-control'></textarea>");
|
var promptfield = $("<div class='prompt'></div>");
|
||||||
|
var formcontrol = $("<textarea type='text' class='inputfield form-control'></textarea>");
|
||||||
var button = $("<button type='button' class='inputsend'>></button>");
|
var button = $("<button type='button' class='inputsend'>></button>");
|
||||||
|
|
||||||
|
var inputfield = $("<div class='inputfieldwrapper'>")
|
||||||
|
.append( button )
|
||||||
|
.append( formcontrol );
|
||||||
|
|
||||||
$("<div class='inputwrap'>")
|
$("<div class='inputwrap'>")
|
||||||
.append( button )
|
.append( promptfield )
|
||||||
.append( inputfield )
|
.append( inputfield )
|
||||||
.appendTo( container.getElement() );
|
.appendTo( container.getElement() );
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue