commit
47bda92a97
4 changed files with 135 additions and 94 deletions
|
|
@ -31,7 +31,7 @@ plugin_handler.add('hotbuttons', (function () {
|
||||||
var addButtonsUI = function () {
|
var addButtonsUI = function () {
|
||||||
var buttons = $( [
|
var buttons = $( [
|
||||||
'<div id="buttons" class="split split-vertical">',
|
'<div id="buttons" class="split split-vertical">',
|
||||||
' <div id="buttonsform" class="wrapper">',
|
' <div id="buttonsform">',
|
||||||
' <div id="buttonscontrol" class="input-group">',
|
' <div id="buttonscontrol" class="input-group">',
|
||||||
' <button class="btn" id="assign_button0" type="button" value="button0">unassigned</button>',
|
' <button class="btn" id="assign_button0" type="button" value="button0">unassigned</button>',
|
||||||
' <button class="btn" id="assign_button1" type="button" value="button1">unassigned</button>',
|
' <button class="btn" id="assign_button1" type="button" value="button1">unassigned</button>',
|
||||||
|
|
@ -48,14 +48,13 @@ plugin_handler.add('hotbuttons', (function () {
|
||||||
].join("\n") );
|
].join("\n") );
|
||||||
|
|
||||||
// Add buttons in front of the existing #inputform
|
// Add buttons in front of the existing #inputform
|
||||||
buttons.insertBefore('#inputform');
|
$('#input').prev().replaceWith(buttons);
|
||||||
$('#inputform').addClass('split split-vertical');
|
|
||||||
|
|
||||||
Split(['#buttons','#inputform'], {
|
Split(['#main','#buttons','#input'], {
|
||||||
|
sizes: [85,5,10],
|
||||||
direction: 'vertical',
|
direction: 'vertical',
|
||||||
sizes: [50,50],
|
|
||||||
gutterSize: 4,
|
gutterSize: 4,
|
||||||
minSize: 150,
|
minSize: [150,20,50],
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -77,11 +77,13 @@ let options_plugin = (function () {
|
||||||
if (code === 27) { // Escape key
|
if (code === 27) { // Escape key
|
||||||
if ($('#helpdialog').is(':visible')) {
|
if ($('#helpdialog').is(':visible')) {
|
||||||
plugins['popups'].closePopup("#helpdialog");
|
plugins['popups'].closePopup("#helpdialog");
|
||||||
} else {
|
|
||||||
plugins['popups'].closePopup("#optionsdialog");
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
if ($('#optionsdialog').is(':visible')) {
|
||||||
|
plugins['popups'].closePopup("#optionsdialog");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -129,6 +131,21 @@ let options_plugin = (function () {
|
||||||
plugins['popups'].closePopup("#helpdialog");
|
plugins['popups'].closePopup("#helpdialog");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Make sure to close any dialogs on connection lost
|
||||||
|
var onText = function (args, kwargs) {
|
||||||
|
// is helppopup set? and if so, does this Text have type 'help'?
|
||||||
|
if ('helppopup' in options && options['helppopup'] ) {
|
||||||
|
if (kwargs && ('type' in kwargs) && (kwargs['type'] == 'help') ) {
|
||||||
|
$('#helpdialogcontent').append('<div>'+ args + '</div>');
|
||||||
|
plugins['popups'].togglePopup("#helpdialog");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Register and init plugin
|
// Register and init plugin
|
||||||
var init = function () {
|
var init = function () {
|
||||||
|
|
@ -155,6 +172,7 @@ let options_plugin = (function () {
|
||||||
onGotOptions: onGotOptions,
|
onGotOptions: onGotOptions,
|
||||||
onPrompt: onPrompt,
|
onPrompt: onPrompt,
|
||||||
onConnectionClose: onConnectionClose,
|
onConnectionClose: onConnectionClose,
|
||||||
|
onText: onText,
|
||||||
}
|
}
|
||||||
})()
|
})()
|
||||||
plugin_handler.add('options', options_plugin);
|
plugin_handler.add('options', options_plugin);
|
||||||
|
|
|
||||||
|
|
@ -287,6 +287,7 @@ let splithandler_plugin = (function () {
|
||||||
|
|
||||||
plugins['popups'].closePopup("#panedialog");
|
plugins['popups'].closePopup("#panedialog");
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// helper function sending text to a pane
|
// helper function sending text to a pane
|
||||||
var txtToPane = function (panekey, txt) {
|
var txtToPane = function (panekey, txt) {
|
||||||
|
|
@ -304,7 +305,6 @@ let splithandler_plugin = (function () {
|
||||||
var scrollHeight = text_div.parent().prop("scrollHeight");
|
var scrollHeight = text_div.parent().prop("scrollHeight");
|
||||||
text_div.parent().animate({ scrollTop: scrollHeight }, 0);
|
text_div.parent().animate({ scrollTop: scrollHeight }, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -316,7 +316,6 @@ let splithandler_plugin = (function () {
|
||||||
//
|
//
|
||||||
// Accept plugin onText events
|
// Accept plugin onText events
|
||||||
var onText = function (args, kwargs) {
|
var onText = function (args, kwargs) {
|
||||||
|
|
||||||
// If the message is not itself tagged, we'll assume it
|
// If the message is not itself tagged, we'll assume it
|
||||||
// should go into any panes with 'all' or 'rest' set
|
// should go into any panes with 'all' or 'rest' set
|
||||||
var msgtype = "rest";
|
var msgtype = "rest";
|
||||||
|
|
@ -366,6 +365,30 @@ let splithandler_plugin = (function () {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// onKeydown check for 'ESC' key.
|
||||||
|
var onKeydown = function (event) {
|
||||||
|
var code = event.which;
|
||||||
|
|
||||||
|
if (code === 27) { // Escape key
|
||||||
|
if ($('#splitdialog').is(':visible')) {
|
||||||
|
plugins['popups'].closePopup("#splitdialog");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if ($('#panedialog').is(':visible')) {
|
||||||
|
plugins['popups'].closePopup("#panedialog");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// capture all keys while one of our "modal" dialogs is open
|
||||||
|
if ($('#splitdialogcontent').is(':visible') || $('#panedialogcontent').is(':visible')) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Required plugin "init" function
|
// Required plugin "init" function
|
||||||
var init = function(settings) {
|
var init = function(settings) {
|
||||||
|
|
@ -409,6 +432,7 @@ let splithandler_plugin = (function () {
|
||||||
dynamic_split: dynamic_split,
|
dynamic_split: dynamic_split,
|
||||||
undo_split: undo_split,
|
undo_split: undo_split,
|
||||||
set_pane_types: set_pane_types,
|
set_pane_types: set_pane_types,
|
||||||
|
onKeydown: onKeydown,
|
||||||
}
|
}
|
||||||
})()
|
})()
|
||||||
plugin_handler.add('splithandler', splithandler_plugin);
|
plugin_handler.add('splithandler', splithandler_plugin);
|
||||||
|
|
|
||||||
|
|
@ -73,10 +73,10 @@ JQuery available.
|
||||||
<script src={% static "webclient/js/plugins/popups.js" %} language="javascript" type="text/javascript"></script>
|
<script src={% static "webclient/js/plugins/popups.js" %} language="javascript" type="text/javascript"></script>
|
||||||
<script src={% static "webclient/js/plugins/options.js" %} language="javascript" type="text/javascript"></script>
|
<script src={% static "webclient/js/plugins/options.js" %} language="javascript" type="text/javascript"></script>
|
||||||
<script src={% static "webclient/js/plugins/history.js" %} language="javascript" type="text/javascript"></script>
|
<script src={% static "webclient/js/plugins/history.js" %} language="javascript" type="text/javascript"></script>
|
||||||
|
<script src={% static "webclient/js/plugins/splithandler.js" %} language="javascript" type="text/javascript"></script>
|
||||||
<script src={% static "webclient/js/plugins/default_in.js" %} language="javascript" type="text/javascript"></script>
|
<script src={% static "webclient/js/plugins/default_in.js" %} language="javascript" type="text/javascript"></script>
|
||||||
<script src={% static "webclient/js/plugins/oob.js" %} language="javascript" type="text/javascript"></script>
|
<script src={% static "webclient/js/plugins/oob.js" %} language="javascript" type="text/javascript"></script>
|
||||||
<script src={% static "webclient/js/plugins/notifications.js" %} language="javascript" type="text/javascript"></script>
|
<script src={% static "webclient/js/plugins/notifications.js" %} language="javascript" type="text/javascript"></script>
|
||||||
<script src={% static "webclient/js/plugins/splithandler.js" %} language="javascript" type="text/javascript"></script>
|
|
||||||
<script src={% static "webclient/js/plugins/default_out.js" %} language="javascript" type="text/javascript"></script>
|
<script src={% static "webclient/js/plugins/default_out.js" %} language="javascript" type="text/javascript"></script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue