Implemented folder management.

This commit is contained in:
2018-10-05 22:53:27 +03:00
parent 784d4deec8
commit c26732d101
19 changed files with 994 additions and 90 deletions

View File

@ -1,9 +1,31 @@
/* Some material font helpers */
.material-folder::before {
content: "\e2c7";
}
content: "\e2c7"; }
.material-person::before {
content: "\e7fd";
}
content: "\e7fd"; }
/* Loading animation */
.loading-dual-ring {
display: inline-block;
width: 64px;
height: 64px; }
.loading-dual-ring:after {
content: " ";
display: block;
width: 46px;
height: 46px;
margin: 1px;
border-radius: 50%;
border: 5px solid #007bff;
border-color: #007bff transparent #007bff transparent;
animation: loading-dual-ring 1.2s linear infinite; }
@keyframes loading-dual-ring {
0% {
transform: rotate(0deg); }
100% {
transform: rotate(360deg); } }
/*# sourceMappingURL=style.css.map */

View File

@ -0,0 +1,7 @@
{
"version": 3,
"mappings": "AAEA,gCAAgC;AAChC,wBAAyB;EACrB,OAAO,EAAE,OAAO;;AAGpB,wBAAyB;EACrB,OAAO,EAAE,OAAO;;AAGpB,uBAAuB;AACvB,kBAAmB;EACf,OAAO,EAAE,YAAY;EACrB,KAAK,EAAE,IAAI;EACX,MAAM,EAAE,IAAI;;AAGhB,wBAAyB;EACrB,OAAO,EAAE,GAAG;EACZ,OAAO,EAAE,KAAK;EACd,KAAK,EAAE,IAAI;EACX,MAAM,EAAE,IAAI;EACZ,MAAM,EAAE,GAAG;EACX,aAAa,EAAE,GAAG;EAClB,MAAM,EAAE,iBAAuB;EAC/B,YAAY,EAAE,uCAAmD;EACjE,SAAS,EAAE,sCAAsC;;AAGrD,4BAOC;EANG,EAAG;IACC,SAAS,EAAE,YAAY;EAE3B,IAAK;IACD,SAAS,EAAE,cAAc",
"sources": ["style.scss"],
"names": [],
"file": "style.css"
}

View File

@ -0,0 +1,38 @@
$accent-color: #007bff;
/* Some material font helpers */
.material-folder::before {
content: "\e2c7";
}
.material-person::before {
content: "\e7fd";
}
/* Loading animation */
.loading-dual-ring {
display: inline-block;
width: 64px;
height: 64px;
}
.loading-dual-ring:after {
content: " ";
display: block;
width: 46px;
height: 46px;
margin: 1px;
border-radius: 50%;
border: 5px solid $accent-color;
border-color: $accent-color transparent $accent-color transparent;
animation: loading-dual-ring 1.2s linear infinite;
}
@keyframes loading-dual-ring {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}

View File

@ -4592,7 +4592,7 @@
if(theme_url === true) {
var dir = this.settings.core.themes.dir;
if(!dir) { dir = $.jstree.path + '/themes'; }
theme_url = dir + '/' + theme_name + '/style.css';
theme_url = dir + '/' + theme_name + '/_style.css';
}
if(theme_url && $.inArray(theme_url, themes_loaded) === -1) {
$('head').append('<'+'link rel="stylesheet" href="' + theme_url + '" type="text/css" />');

View File

@ -1,50 +0,0 @@
function onSelectionChanged(e, data)
{
node = data.instance.get_selected(true)[0];
}
function validateChange(operation, node, parent, position, more)
{
if (more.dnd)
{
// create_node, rename_node, delete_node, move_node and copy_node
if (operation === "copy_node" || operation === "move_node")
{
if (more.ref.type === "sub")
return false;
}
}
return true;
}
function setupTree(dataIn)
{
$("#tree-wrapper").jstree({
core : {
data : {
url : 'ajax/get_children'
},
check_callback : validateChange,
themes : {
dots : false
},
},
types : {
folder : {
icon : "material-icons material-folder"
},
sub : {
icon : "material-icons material-person",
max_depth : 0
}
},
plugins : [ "types", "wholerow", "dnd" ]
});
$("#tree-wrapper").on("changed.jstree", onSelectionChanged);
}
$(document).ready(function ()
{
setupTree();
})