first commit

This commit is contained in:
2024-10-28 22:14:22 +01:00
commit b65352c452
40581 changed files with 5712079 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
drwxr-xr-x 2 30094 users 5 Oct 6 10:16 .
drwxr-xr-x 4 30094 users 4 Oct 6 10:16 ..
-rw-r--r-- 1 30094 users 2337 Oct 21 2021 tree.css
-rw-r--r-- 1 30094 users 6743 Oct 21 2021 tree.js
-rw-r--r-- 1 30094 users 21804 Oct 21 2021 typeahead.min.js

View File

@@ -0,0 +1,113 @@
.tree-panel-heading-controls {
font-size: 13px;
background-color: #DDE0E9;
width: 70%;
margin: 0 0 20px;
padding: 5px;
border-bottom: solid 1px #DFDFDF;
}
.tree-panel-heading-controls .pull-right {
float: right;
}
.tree-panel-heading-controls a {
display: inline-block;
padding: 0 8px;
margin-top: 3px;
border-right: solid 1px #888;
}
.tree-panel-heading-controls .twitter-typeahead {
margin-left: 20px;
}
.tree {
padding: 0 0 0 20px;
list-style: none;
}
.tree * {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.tree input {
vertical-align: baseline;
position: relative;
top: 2px;
margin-right: 4px;
line-height: normal;
}
.tree i {
font-size: 14px;
}
.tree .tree-item-name,
.tree .tree-folder-name {
padding: 4px;
-webkit-border-radius: 4px;
border-radius: 4px;
}
.tree .tree-item-name label,
.tree .tree-folder-name label {
font-size: 13px;
float: none;
text-shadow: none;
font-weight: 400;
}
.tree .tree-item-name:hover,
.tree .tree-folder-name:hover {
background-color: #ddd;
cursor: pointer;
}
.tree .tree-selected {
background-color: #CCCED7;
}
.tree .tree-selected:hover {
background-color: #a1a5b5;
}
.tree .tree-selected i.tree-dot {
background-color: #eee;
}
.tree .tree-item,
.tree .tree-folder {
margin: 6px 0;
}
.tree i.tree-dot {
display: inline-block;
position: relative;
width: 6px;
height: 6px;
margin: 0 4px;
background-color: #ccc;
-webkit-border-radius: 6px;
border-radius: 6px;
}
.tree .tree-item-disable,
.tree .tree-folder-name-disable {
color: #ccc;
}
.tree .tree-item-disable:hover,
.tree .tree-folder-name-disable:hover {
color: #ccc;
background-color: transparent;
}
.tt-query {
border-bottom-right-radius: 3px !important;
border-top-right-radius: 3px !important
}
.tt-dropdown-menu {
background-color: #fff;
border: solid 1px #ccc;
font-size: .9em;
text-transform: none
}
.tt-suggestions {
padding: 0 6px;
-webkit-box-shadow: rgba(0, 0, 0, 0.25) 0 1px 4px;
box-shadow: rgba(0, 0, 0, 0.25) 0 1px 4px
}
.tt-suggestion p {
border-bottom: solid 1px #ccc;
margin: 0;
padding: 4px 2px;
}
.tt-suggestion:last-child p {
border-bottom: none
}

View File

@@ -0,0 +1,235 @@
var Tree = function (element, options)
{
this.$element = $(element);
this.options = $.extend({}, $.fn.tree.defaults, options);
this.init();
};
Tree.prototype =
{
constructor: Tree,
init: function ()
{
var that = $(this);
var name = this.$element.parent().find('ul.tree input').first().attr('name');
var idTree = this.$element.parent().find('.cattree.tree').first().attr('id');
this.$element.find("label.tree-toggler, .icon-folder-close, .icon-folder-open").unbind('click');
this.$element.find("label.tree-toggler, .icon-folder-close, .icon-folder-open").click(
function ()
{
if ($(this).parent().parent().children("ul.tree").is(":visible"))
{
$(this).parent().children(".icon-folder-open")
.removeClass("icon-folder-open")
.addClass("icon-folder-close");
that.tree('collapse', $(this).closest('.tree-folder').children("ul.tree"));
$(this).parent().parent().children("ul.tree").toggle(300);
}
else
{
$(this).parent().children(".icon-folder-close")
.removeClass("icon-folder-close")
.addClass("icon-folder-open");
var load_tree = (typeof(idTree) != 'undefined'
&& $(this).parent().closest('.tree-folder').find('ul.tree .tree-toggler').first().html() == '');
if (load_tree)
{
var category = $(this).parent().children('ul.tree input').first().val();
var inputType = $(this).parent().children('ul.tree input').first().attr('type');
var useCheckBox = 0;
if (inputType == 'checkbox')
{
useCheckBox = 1;
}
var thatOne = $(this);
$.get(
currentIndex + '&configure=x13categoryassign&token=' + x13massupdate_token,
{
getCategoryTree: true,
ajax: true,
type: idTree,
category: category,
inputName: name,
useCheckBox: useCheckBox
},
function(content)
{
thatOne.parent().closest('.tree-folder').find('ul.tree').html(content);
$('#'+idTree).tree('collapse', thatOne.closest('.tree-folder').children("ul.tree"));
that.trigger('expand');
thatOne.parent().parent().children("ul.tree").toggle(300);
$('#'+idTree).tree('init');
}
);
}
else
{
that.trigger('expand');
$(this).parent().parent().children("ul.tree").toggle(300);
}
}
}
);
this.$element.find("li").unbind('click');
this.$element.find("li").click(
function ()
{
$('.tree-selected').removeClass("tree-selected");
$('li input:checked').parent().addClass("tree-selected");
}
);
if (typeof(idTree) != 'undefined')
{
if ($('select#id_category_default').length)
{
this.$element.find(':input[type=checkbox]').unbind('click');
this.$element.find(':input[type=checkbox]').click(function()
{
if ($(this).prop('checked'))
addDefaultCategory($(this));
else
{
$('select#id_category_default option[value=' + $(this).val() + ']').remove();
if ($('select#id_category_default option').length == 0)
{
$('select#id_category_default').closest('.form-group').hide();
$('#no_default_category').show();
}
}
});
}
if (typeof(treeClickFunc) != 'undefined')
{
this.$element.find(":input[type=radio]").unbind('click');
this.$element.find(":input[type=radio]").click(treeClickFunc);
}
}
return $(this);
},
collapse : function(elem, $speed)
{
console.log(elem);
elem.find("label.tree-toggler").each(
function()
{
$(this).parent().children(".icon-folder-open")
.removeClass("icon-folder-open")
.addClass("icon-folder-close");
$(this).parent().parent().children("ul.tree").hide($speed);
}
);
return $(this);
},
collapseAll : function($speed)
{
this.$element.find("label.tree-toggler").each(
function()
{
$(this).parent().children(".icon-folder-open")
.removeClass("icon-folder-open")
.addClass("icon-folder-close");
$(this).parent().parent().children("ul.tree").hide($speed);
}
);
return $(this);
},
expandAll : function($speed)
{
var idTree = this.$element.parent().find('.cattree.tree').first().attr('id');
if (typeof(idTree) != 'undefined' && !$('#'+idTree).hasClass('full_loaded'))
{
var selected = [];
that = this;
$('#'+idTree).find('.tree-selected input').each(
function()
{
selected.push($(this).val());
}
);
var name = $('#'+idTree).find('ul.tree input').first().attr('name');
var inputType = $('#'+idTree).find('ul.tree input').first().attr('type');
var useCheckBox = 0;
if (inputType == 'checkbox')
{
useCheckBox = 1;
}
$.get(
currentIndex + '&configure=x13categoryassign&token=' + x13massupdate_token,
{
getCategoryTree: true,
ajax: true,
type: idTree,
inputName: name,
useCheckBox: useCheckBox,
fullTree: 1,
selected: selected
},
function(content)
{
$('#'+idTree).html(content);
$('#'+idTree).tree('init');
that.$element.find("label.tree-toggler").each(
function()
{
$(this).parent().children(".icon-folder-close")
.removeClass("icon-folder-close")
.addClass("icon-folder-open");
$(this).parent().parent().children("ul.tree").show($speed);
$('#'+idTree).addClass('full_loaded');
}
);
}
);
}
else
{
this.$element.find("label.tree-toggler").each(
function()
{
$(this).parent().children(".icon-folder-close")
.removeClass("icon-folder-close")
.addClass("icon-folder-open");
$(this).parent().parent().children("ul.tree").show($speed);
}
);
}
return $(this);
}
};
$.fn.tree = function (option, value)
{
var methodReturn;
var $set = this.each(
function ()
{
var $this = $(this);
var data = $this.data('tree');
var options = typeof option === 'object' && option;
if (!data){
$this.data('tree', (data = new Tree(this, options)));
}
if (typeof option === 'string') {
methodReturn = data[option](value);
}
}
);
return (methodReturn === undefined) ? $set : methodReturn;
};
$.fn.tree.Constructor = Tree;

File diff suppressed because one or more lines are too long