Ross Mountjoy 62191b21b8 ##### Updated to version 0.6!
> Version 0.6 brings DashMachine one big step forward to being a finished product by adding a gui to edit the various settings in the config.ini.

**Changelog**
- improvements to /home including 'pinned' cards, multi-select tag filtering, 'action providers' allowing you to do web searches from the searchbar
- rebuilt sidenav with list view, mirroring filter/search/collapse state of the homepage
- /settings and /home now on same route
- dynamic reloading of settings (no more page reloads)
- dedicated config.ini editor slide-out
- settings editor slide-out
- card editor slide-out
- better access group control
- dedicated documentation pages
- improved documentation
- new system for automatically generating documentation for platforms
- ability to load custom platforms
- added an 'on_starup' method for platforms allowing for registering api routes. (example coming soon)
2020-05-07 09:27:18 -04:00

92 lines
3.0 KiB
JavaScript

// CARD EDITOR
$("#card-editor-open-btn").on('click', function(e) {
$('#main-sidenav').sidenav('close');
});
$(".show-card-editor-data-sources-table").on('click', function(e) {
$("#card-editor-cards-table").addClass('hide');
$("#card-editor-data-sources-table").removeClass('hide');
});
$(".show-card-editor-cards-table").on('click', function(e) {
$("#card-editor-cards-table").removeClass('hide');
$("#card-editor-data-sources-table").addClass('hide');
});
$("#card-editor-add-btn").dropdown({
container: '#card-editor-sidenav',
constrainWidth: false,
onOpenStart: function () {
$(".card-editor-add-dropdown-overlay").removeClass('hide');
},
onCloseStart: function () {
$(".card-editor-add-dropdown-overlay").addClass('hide');
}
});
$("#card-editor-data-source-add-btn").dropdown({
container: '#card-editor-sidenav',
constrainWidth: false,
onOpenStart: function () {
$(".card-editor-add-dropdown-overlay").removeClass('hide');
},
onCloseStart: function () {
$(".card-editor-add-dropdown-overlay").addClass('hide');
}
});
$(".card-editor-add-from-home-btn").on('click', function(e) {
$("#card-editor-data-sources-form-container").addClass('hide');
$("#card-editor-data-sources-table").addClass('hide');
$("#card-editor-form-container").removeClass('hide');
$("#card-editor-cards-table").removeClass('hide');
sleep(250).then(() => {
$("#card-editor-add-btn").dropdown('open');
});
});
$(".card-editor-app-row").on('click', function(e) {
var form = $("#card-editor-form-container")
var table = $("#card-editor-cards-table")
$.ajax({
url: $(this).attr('data-url'),
type: 'GET',
data: {app_id: $(this).attr('data-id')},
success: function(data){
after_ini_form_ajax_load(form, table, data);
}
});
});
$(".card-editor-data-source-row").on('click', function(e) {
var form = $("#card-editor-data-sources-form-container")
var table = $("#card-editor-data-sources-table")
$.ajax({
url: $(this).attr('data-url'),
type: 'GET',
data: {ds_id: $(this).attr('data-id')},
success: function(data){
after_ini_form_ajax_load(form, table, data);
}
});
});
$(".card-editor-add-dropdown-a").on('click', function(e) {
var form = $("#card-editor-form-container")
var table = $("#card-editor-cards-table")
$.ajax({
url: $("#card-editor-add-dropdown").attr('data-url'),
type: 'GET',
data: {type: $(this).attr('data-type')},
success: function(data){
after_ini_form_ajax_load(form, table, data);
}
});
});
$("#card-editor-add-new-ds-btn").on('click', function(e) {
var form = $("#card-editor-data-sources-form-container")
var table = $("#card-editor-data-sources-table")
$.ajax({
url: $(this).attr('data-url'),
type: 'GET',
success: function(data){
after_ini_form_ajax_load(form, table, data);
}
});
});