diff --git a/emhttp/plugins/dynamix/javascript/jquery.filetree.js b/emhttp/plugins/dynamix/javascript/jquery.filetree.js index 744e5982a..d59f986b1 100644 --- a/emhttp/plugins/dynamix/javascript/jquery.filetree.js +++ b/emhttp/plugins/dynamix/javascript/jquery.filetree.js @@ -1,122 +1,2 @@ /* jQuery File Tree. Authors - Cory S.N. LaViska & Dave Rogers. Copyright 2008 A Beautiful Site, LLC. - Adapted by Bergware for use in Unraid */ -jQuery && function($) { - $.extend($.fn, { - fileTree: function(options, callback, onCancel) { - void 0 === options.root && (options.root = "/mnt/"), - void 0 === options.top && (options.top = "/mnt/"), - void 0 === options.filter && (options.filter = ""), - void 0 === options.match && (options.match = ".*"), - void 0 === options.script && (options.script = "/webGui/include/FileTree.php"), - void 0 === options.folderEvent && (options.folderEvent = "click"), - void 0 === options.expandSpeed && (options.expandSpeed = 300), - void 0 === options.collapseSpeed && (options.collapseSpeed = 300), - void 0 === options.expandEasing && (options.expandEasing = null), - void 0 === options.collapseEasing && (options.collapseEasing = null), - void 0 === options.multiFolder && (options.multiFolder = !1), - void 0 === options.loadMessage && (options.loadMessage = "Loading..."), - void 0 === options.multiSelect && (options.multiSelect = !1), - void 0 === options.allowBrowsing && (options.allowBrowsing = !1), - void 0 === options.pickexclude && (options.pickexclude = ""); - $(this).each(function() { - function showTree($this, dir, showParent) { - $this.addClass("wait"), - $(".jqueryFileTree.start").remove(), - /* Modify the post data to include pickexclude. */ - $.post(options.script, { - dir: dir, - root: options.top, - multiSelect: options.multiSelect, - filter: options.filter, - match: options.match, - show_parent: showParent, - /* Add pickexclude parameter. */ - pickexclude: options.pickexclude - }).done(function(data) { - var $parent; - $this.find(".start").html(""), - $this.removeClass("wait").append(data), - options.root == dir ? $this.find("UL:hidden").show() : $this.find("UL:hidden").slideDown({ - duration: options.expandSpeed, - easing: options.expandEasing - }), - $($parent = $this).find("LI A").on(options.folderEvent, function(event) { - event.preventDefault(); - var node = {}; - return node.li = $(this).closest("li"), - node.type = node.li.hasClass("directory") ? "directory" : "file", - node.value = $(this).text(), - node.rel = $(this).prop("rel"), - ".." == $(this).text() ? (options.root = node.rel, callback && callback($(this).attr("rel")), triggerEvent($(this), "filetreefolderclicked", node), root = $(this).closest("ul.jqueryFileTree"), root.html('
Loading...'),
- $fileTree.fileTree({
- root: config.pickroot,
- top: config.picktop,
- filter: (config.pickfilter || "").split(","),
- match: config.pickmatch || ".*",
- /* Include pickexclude parameter in fileTreeAttach. */
- pickexclude: config.pickexclude
- }, $.isFunction(callback) ? callback : function(data) {
- $this.val(data).change(),
- config.hasOwnProperty("pickcloseonfile") && $fileTree.slideUp("fast")
- }, $.isFunction(onCancel) ? onCancel : function(data) {
- config.hasOwnProperty("pickfolders") && $this.val(data).change()
- })),
- $fileTree.offset({
- left: $this.position().left
- }),
- $fileTree.slideDown("fast"))
- })
- })
- }
- })
-}(jQuery);
+jQuery&&function(e){e.extend(e.fn,{fileTree:function(i,t,l){void 0===i.root&&(i.root="/mnt/"),void 0===i.top&&(i.top="/mnt/"),void 0===i.filter&&(i.filter=""),void 0===i.match&&(i.match=".*"),void 0===i.script&&(i.script="/webGui/include/FileTree.php"),void 0===i.folderEvent&&(i.folderEvent="click"),void 0===i.expandSpeed&&(i.expandSpeed=300),void 0===i.collapseSpeed&&(i.collapseSpeed=300),void 0===i.expandEasing&&(i.expandEasing=null),void 0===i.collapseEasing&&(i.collapseEasing=null),void 0===i.multiFolder&&(i.multiFolder=!1),void 0===i.loadMessage&&(i.loadMessage="Loading..."),void 0===i.multiSelect&&(i.multiSelect=!1),void 0===i.allowBrowsing&&(i.allowBrowsing=!1),e(this).each(function(){function s(r,n,o){e(r).addClass("wait"),e(".jqueryFileTree.start").remove(),e.post(i.script,{dir:n,root:i.top,multiSelect:i.multiSelect,filter:i.filter,match:i.match,show_parent:o}).done(function(o){var d;e(r).find(".start").html(""),e(r).removeClass("wait").append(o),i.root==n?e(r).find("UL:hidden").show():e(r).find("UL:hidden").slideDown({duration:i.expandSpeed,easing:i.expandEasing}),e(d=r).find("LI A").on(i.folderEvent,function(r){r.preventDefault();var n={};return n.li=e(this).closest("li"),n.type=n.li.hasClass("directory")?"directory":"file",n.value=e(this).text(),n.rel=e(this).prop("rel"),".."==e(this).text()?(i.root=n.rel,l&&l(e(this).attr("rel")),a(e(this),"filetreefolderclicked",n),root=e(this).closest("ul.jqueryFileTree"),root.html('
Loading...'),r.fileTree({root:a.pickroot,top:a.picktop,filter:(a.pickfilter||"").split(","),match:a.pickmatch||".*"},e.isFunction(t)?t:function(e){i.val(e).change(),a.hasOwnProperty("pickcloseonfile")&&r.slideUp("fast")},e.isFunction(l)?l:function(e){a.hasOwnProperty("pickfolders")&&i.val(e).change()})),r.offset({left:i.position().left}),r.slideDown("fast"))})})}})}(jQuery);
\ No newline at end of file