All Projects → jcubic → jquery.filebrowser

jcubic / jquery.filebrowser

Licence: MIT license
File browser jQuery plugin

Programming Languages

javascript
184084 projects - #8 most used programming language
CSS
56736 projects
Makefile
30231 projects
shell
77523 projects

Projects that are alternatives of or similar to jquery.filebrowser

Zeus
🔭 A modern cross platform `ls` with powerful searching and querying capabilities to scale your productivity to the moon 🚀 (and yeah it has file explorer like capabilities too 🤫)
Stars: ✭ 75 (+158.62%)
Mutual labels:  files, filesystem, explorer
files
Useful methods to manage files and directories
Stars: ✭ 27 (-6.9%)
Mutual labels:  files, filesystem, directories
react-file-manager
A file manager built in ReactJs
Stars: ✭ 40 (+37.93%)
Mutual labels:  manager, filesystem, explorer
FireFiles
Powerful Android File Manager for everything that runs on Android OS (Android TV, Android Watch, Mobile, etc)
Stars: ✭ 37 (+27.59%)
Mutual labels:  manager, filesystem, explorer
Python Atomicwrites
Powerful Python library for atomic file writes.
Stars: ✭ 253 (+772.41%)
Mutual labels:  files, filesystem
replace-in-files
Replace text in one or more files or globs.
Stars: ✭ 21 (-27.59%)
Mutual labels:  files, filesystem
Filegator
Powerful Multi-User File Manager
Stars: ✭ 587 (+1924.14%)
Mutual labels:  files, filesystem
Tagstore
a research software; a fun way of storing files & folders on your local disk drive; tagging
Stars: ✭ 18 (-37.93%)
Mutual labels:  files, filesystem
Open Shell Book
开源书籍:《Shell 编程范例》,面向操作对象学 Shell!本书作者发布了《360°剖析 Linux ELF》视频课程,欢迎订阅:https://www.cctalk.com/m/group/88089283
Stars: ✭ 666 (+2196.55%)
Mutual labels:  files, filesystem
Fcfilemanager
iOS File Manager on top of NSFileManager for simplifying files management. 📂
Stars: ✭ 862 (+2872.41%)
Mutual labels:  files, manager
Globby
User-friendly glob matching
Stars: ✭ 1,864 (+6327.59%)
Mutual labels:  files, directories
delete-empty
Recursively delete all empty folders in a directory and child directories.
Stars: ✭ 38 (+31.03%)
Mutual labels:  files, directories
File Storage
File storage abstraction for Yii2
Stars: ✭ 116 (+300%)
Mutual labels:  files, filesystem
Xcv
✂️ Cut, Copy and Paste files with Bash
Stars: ✭ 144 (+396.55%)
Mutual labels:  files, filesystem
Chonky
😸 A File Browser component for React.
Stars: ✭ 313 (+979.31%)
Mutual labels:  files, filesystem
diskusage
FANTASTIC SPEED utility to find out top largest folders/files on the disk.
Stars: ✭ 64 (+120.69%)
Mutual labels:  files, directories
Memacs
What did I do on February 14th 2007? Visualize your (digital) life in Org-mode
Stars: ✭ 711 (+2351.72%)
Mutual labels:  files, filesystem
Copy Webpack Plugin
Copy files and directories with webpack
Stars: ✭ 2,679 (+9137.93%)
Mutual labels:  files, filesystem
txr
Send files super easily to other computers/servers using WebSockets.
Stars: ✭ 20 (-31.03%)
Mutual labels:  files, directories
Voila
Voila is a domain-specific language launched through CLI tool for operating with files and directories in massive amounts in a fast & reliable way.
Stars: ✭ 78 (+168.97%)
Mutual labels:  files, directories

jQuery File Browser version 0.8.4

jQuery File Browser is a plugin for creating OS like file browsers.

Demo

installation

to install you can grab the files from the repo or install from

bower

bower install jquery.filebrowser --save

npm

npm install jquery.filebrowser --save

include the files:

<script src="js/jquery.filebrowser.min.js"></script>
<link href="css/jquery.filebrowser.min.css" rel="stylesheet"/>

and you can use this code to initialize the plugin:

$(function() {
    var browse = $('#browser').browse({
        root: '/',
        separator: '/',
        contextmenu: true,
        dir: function(path) {
            return new Promise(function(resolve, reject) {
                 if (path == '/') {
                     resolve({dirs: ['foo', 'bar'], files: []});
                 } else if (path == '/foo/') {
                     resolve({dirs: [], files: ['baz', 'quux']});
                 } else if (path == '/bar/') {
                     resolve({dirs: [], files: ['lorem', 'ipsum']});
                 } else {
                     reject(); // for cases when you type wrong path in address bar
                 }
             });
        },
        open: function(filename) {
            console.log('opening ' + filename);
        }
    });
});

All user functions that modify the Directory like create, remove, copy, rename can return a promise, and the plugin will refresh the view (call dir function) when it's resolved.

more examples and usage in examples directory.

Requirement

If you want context menu (enabled using contextmenu option) you'll need jQuery UI and of course you need jQuery itself.

Options

  • name - used to distinguish different filesystem for copying nad moving files (rename)
  • dir - function that should return a promise that resolve to object {files: <ARRAY>, dirs: <ARRAY>} or return that object
  • exists - function that will return true/false or a promise that resolve to true/false that indicate if file or directory exists (used when create new file/directory)
  • separator - path separator (a string) usualy / or \ (to use \ you need to put '\\') default /
  • root - root of the filesystem, it can be any path like /home/<user>, default /
  • change - callback function that's called on refresh of the directory
  • init - callack executed on initalization of the plugin
  • item_class - function that should return addiional classes for the element (directory or file) you can use this to have different icons for C or D drive that's in root directory, see windows example
  • dbclick_delay - if the time of the second click is lower then this but hight then rename_delay it's consider as action for rename a file or directory
  • open - callback function executed with path of the file when you double click on the file
  • rename - callback function called with old path nad new path when you rename a file or directory
  • remove - callback function called with path when you delete file or directory
  • create - callback called with path of the new file or directory and string 'directory' or 'file' as second argument
  • copy - callback executed when you copy a file using CTRL+C and CTRL+V
  • upload - callback called with file object and the path when you drag and drop a file or directory to browser container, you can also drag into visible directory
  • error - called when error accured like when you try to enter invalid path in address bar
  • refresh_timer - timeout after fetch of the content of the file in miliseconds, used to see visible refresh when you change direcotry (you can set it to 0), default 100
  • menu - should return object which keys are names of the context menu and values are other object (they will create submenus) or a function that will be executed when menu item is click it acceppt single argument string 'li' or 'content' depend if you click on file/directory or on empty browser space. example:
    menu: function(type) {
        if (type == 'li') {
            return {
                'alert': function($li) {
                    alert('alert for item ' + $li.text());
                }
            }
        }  else {
            return {
                'Create File': function() {
                    var name = prompt('name: ');
                    var path;
                    if (name) {
                        path = this.join(this.path(), name);
                    }
                    this.create('file', path);
                }
            };
        }
    },

API methods

  • path - return current path
  • name - return settings name
  • back - go back one directory
  • destroy - remove all events and DOM nodes
  • create - function(type, [path]) - create new directory of file (depend of first argument which is string 'file' or 'directory') if there is second argument it will create new file/directory of it's undefined it will create placeholder for file/directory with textarea to enter name
  • copy - selected files/directories for later paste
  • cut - like copy but when call paste it will remove old items
  • paste - if cut was executed it will call settings.rename and if copy was called it will call settings.copy and then refresh all views with the same directory
  • up - go up one directory
  • show - call settings.dir and rerender the directory view
  • join - return new path based on settings.separator and settings.root, accept any number of arguments
  • split - split the path using settings.separator and settings.root
  • walk - function(filename, fn) - call function for each file/directory the signature for callaback function: function(path_part, last, return_value) the function return value from last call to callback function, 3rd argument is a value from previous call to callback function.

License

Licensed under MIT license

Copyright (c) 2016-2021 Jakub T. Jankiewicz

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].