Giter Club home page Giter Club logo

html_file_explorer's Introduction

HTML File Explorer

html_file_explorer.js is a small library to display a filestructure inside a HTML page.

In this state it is limited to the things i need: Show my music on a webpage so i can choose what to play.

The usage is simple:

Inside your HTML page you need this:

  1. Include the library:

    <script src="html_file_explorer.js"></script>
  2. Fill the content in your Javascript section:

    $(document).ready(function(){ // anywhere inside your doc ready function add fd_add("/dir/file.mp3"); // repeat for every file with path and leading slash }

    function fd_play_dir(dirname) { // program the action for play dir alert("Play Dir: "+dirname); }

    function fd_play_file(filename) { // program the action for play file alert("Play File: "+filename); }

  3. Add a docking point for the output in the HTML section:

Limitations: Thre is no sorting inside the library. The input via "fd_add()" should come like this:

/dir1/file1.mp3
/dir1/file2.mp3
/dir1/file3.mp3
/dir2/file1.mp3
/dir2/file2.mp3
/dir2/file3.mp3
/dir3/file1.mp3
/dir3/file2.mp3

The library just looks: If the dirname changes its a new dir!

Every file will be shown as a mp3 file: You have to filter it before delivery.

Result:

When all the folders are closed it looks like this:

When you press play "function fd_play_dir(dirname)" will be executed.

When you click on the folder this folder will be opened:

When you press play near a file "function fd_play_file(filename)" will be executed.

Settings:

Here you can change the size of the icons:

var fd_dims = "height='60px' width='60px'";

To change the files of the icons use this lines:

var fd_do = "dir_open.png";
var fd_dc = "dir_close.png";
var fd_pl = "play.png";
var fd_fi = "mp3file.png";
var fd_le = "leer.png";

External Elements:

The Icons are taken from https://www.iconarchive.com/

html_file_explorer's People

Contributors

wilmsn avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.