Plugin settings modal

This commit is contained in:
Jiiks 2015-12-22 10:44:14 +02:00
parent 9bfafc7866
commit 15276acda5
4 changed files with 39 additions and 4 deletions

File diff suppressed because one or more lines are too long

2
css/main.min.css vendored

File diff suppressed because one or more lines are too long

View File

@ -1150,7 +1150,7 @@ SettingsPanel.prototype.construct = function() {
'' +
' <div class="bd-pane control-group" id="bd-plugins-pane" style="display:none;">' +
' <table class="bd-g-table">' +
' <thead><tr><th>Name</th><th>Description</th><th>Author</th><th>Version</th><th></th></tr></thead><tbody>';
' <thead><tr><th>Name</th><th>Description</th><th>Author</th><th>Version</th><th></th><th></th></tr></thead><tbody>';
$.each(bdplugins, function() {
var plugin = this["plugin"];
@ -1160,6 +1160,7 @@ SettingsPanel.prototype.construct = function() {
' <td width="99%"><textarea>'+plugin.getDescription()+'</textarea></td>' +
' <td>'+plugin.getAuthor()+'</td>' +
' <td>'+plugin.getVersion()+'</td>' +
' <td><button class="bd-psb" onclick="pluginModule.showSettings(\''+plugin.getName()+'\'); return false;"></button></td>' +
' <td>' +
' <div class="checkbox" onclick="pluginModule.handlePlugin(this);">' +
' <div class="checkbox-inner">' +
@ -1415,6 +1416,16 @@ PluginModule.prototype.handlePlugin = function(checkbox) {
this.savePluginData();
};
PluginModule.prototype.showSettings = function(plugin) {
if(bdplugins[plugin] != null) {
if(typeof bdplugins[plugin].plugin.getSettingsPanel === "function") {
var panel = bdplugins[plugin].plugin.getSettingsPanel();
$(".modal").append('<div class="bd-psm"><div class="scroller-wrap" style="height:100%"><div id="bd-psm-s" class="scroller" style="padding:10px;"></div></div></div>');
$("#bd-psm-s").append(panel);
}
}
};
PluginModule.prototype.loadPluginData = function() {
var cookie = $.cookie("bd-plugins");
if(cookie != undefined) {

2
js/main.min.js vendored

File diff suppressed because one or more lines are too long