Skip to content

Commit

Permalink
Add changelog, fix bower file, fix css issues and add usage to readme
Browse files Browse the repository at this point in the history
  • Loading branch information
jcubic committed Dec 8, 2016
1 parent cc21e45 commit 97d20e8
Show file tree
Hide file tree
Showing 13 changed files with 180 additions and 18 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -4,3 +4,4 @@
.\#* .\#*
bower_components bower_components
node_modules node_modules
www
1 change: 1 addition & 0 deletions CHANGELOG
@@ -0,0 +1 @@
0.1.0 Base code
48 changes: 48 additions & 0 deletions README.in
Expand Up @@ -2,6 +2,54 @@


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


#installation

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

## bower

```
browser install jquery.filebrowser --save
```

## npm

```
npm install jquery.filebrowser --save
```

include the files:

```html
<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:

```javascript
$(function() {
var browse = $('#browser').browse({
root: '/',
separator: '/',
dir: function(path, callback) {
if (path == '/') {
callback({dirs: ['foo', 'bar'], files: []});
} else if (path == '/foo/') {
callback({dirs: [], files: ['baz', 'quux']});
} else if (path == '/bar/') {
callback({dirs: [], files: ['lorem', 'ipsum']});
} else {
callback({files: [], dirs: []});
}
},
open: function(filename) {
console.log('opening ' + filename);
}
});
});
```

# License # License


Licensed under [MIT](http://opensource.org/licenses/MIT) license Licensed under [MIT](http://opensource.org/licenses/MIT) license
Expand Down
48 changes: 48 additions & 0 deletions README.md
Expand Up @@ -2,6 +2,54 @@


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


#installation

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

## bower

```
browser install jquery.filebrowser --save
```

## npm

```
npm install jquery.filebrowser --save
```

include the files:

```html
<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:

```javascript
$(function() {
var browse = $('#browser').browse({
root: '/',
separator: '/',
dir: function(path, callback) {
if (path == '/') {
callback({dirs: ['foo', 'bar'], files: []});
} else if (path == '/foo/') {
callback({dirs: [], files: ['baz', 'quux']});
} else if (path == '/bar/') {
callback({dirs: [], files: ['lorem', 'ipsum']});
} else {
callback({files: [], dirs: []});
}
},
open: function(filename) {
console.log('opening ' + filename);
}
});
});
```

# License # License


Licensed under [MIT](http://opensource.org/licenses/MIT) license Licensed under [MIT](http://opensource.org/licenses/MIT) license
Expand Down
13 changes: 9 additions & 4 deletions bower.in
Expand Up @@ -2,17 +2,22 @@
"name": "jquery.filebrowser", "name": "jquery.filebrowser",
"version": "{{VER}}", "version": "{{VER}}",
"main": [ "main": [
"js/jquery.filebrowser.min.js", "js/jquery.filebrowser.js",
"css/jquery.filebrowser.min.css" "css/jquery.filebrowser.css"
], ],
"description": "jQuery File Browser is a plugin for creating OS like file browsers.", "description": "jQuery File Browser is a plugin for creating OS like file browsers.",
"license": "MIT", "license": "MIT",
"ignore": [ "ignore": [
"examples", "examples",
"CHANGELOG",
"README.in", "README.in",
"bower.in", "bower.in",
"Makefile" "Makefile",
".gitignore",
".npmignore",
"package.in",
"package.json",
"bin"

], ],
"dependencies": { "dependencies": {
"jquery": "~2" "jquery": "~2"
Expand Down
13 changes: 9 additions & 4 deletions bower.json
Expand Up @@ -2,17 +2,22 @@
"name": "jquery.filebrowser", "name": "jquery.filebrowser",
"version": "0.1.0", "version": "0.1.0",
"main": [ "main": [
"js/jquery.filebrowser.min.js", "js/jquery.filebrowser.js",
"css/jquery.filebrowser.min.css" "css/jquery.filebrowser.css"
], ],
"description": "jQuery File Browser is a plugin for creating OS like file browsers.", "description": "jQuery File Browser is a plugin for creating OS like file browsers.",
"license": "MIT", "license": "MIT",
"ignore": [ "ignore": [
"examples", "examples",
"CHANGELOG",
"README.in", "README.in",
"bower.in", "bower.in",
"Makefile" "Makefile",
".gitignore",
".npmignore",
"package.in",
"package.json",
"bin"

], ],
"dependencies": { "dependencies": {
"jquery": "~2" "jquery": "~2"
Expand Down
10 changes: 7 additions & 3 deletions css/jquery.filebrowser-0.1.0.css
Expand Up @@ -5,7 +5,7 @@
* Copyright (c) 2016 Jakub Jankiewicz <http://jcubic.pl> * Copyright (c) 2016 Jakub Jankiewicz <http://jcubic.pl>
* Released under the MIT license * Released under the MIT license
* *
* Date: Tue, 06 Dec 2016 20:55:45 +0000 * Date: Thu, 08 Dec 2016 17:51:08 +0000
*/ */
.browse.hidden, .browse .hidden { .browse.hidden, .browse .hidden {
visibility: hidden; visibility: hidden;
Expand All @@ -29,15 +29,19 @@
-ms-user-select: none; /* IE 10+ */ -ms-user-select: none; /* IE 10+ */
user-select: none; /* Likely future */ user-select: none; /* Likely future */
} }
.browse {
font-family: sans-serif;
font-size: 12px;
}
.browse .toolbar { .browse .toolbar {
background: #6b6b6b; background: #6b6b6b;
background: -moz-linear-gradient(top, #6b6b6b 0%, #262626 100%); background: -moz-linear-gradient(top, #6b6b6b 0%, #262626 100%);
background: -webkit-linear-gradient(top, #6b6b6b 0%,#262626 100%); background: -webkit-linear-gradient(top, #6b6b6b 0%,#262626 100%);
background: linear-gradient(to bottom, #6b6b6b 0%,#262626 100%); background: linear-gradient(to bottom, #6b6b6b 0%,#262626 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6b6b6b', endColorstr='#262626',GradientType=0 ); filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6b6b6b', endColorstr='#262626',GradientType=0 );
copy color: white;
} }
.browse .toolbar li { .browse li {
width: 40px; width: 40px;
} }
.browse .toolbar:not(.labels) li{ .browse .toolbar:not(.labels) li{
Expand Down
2 changes: 1 addition & 1 deletion css/jquery.filebrowser-0.1.0.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions css/jquery.filebrowser-src.css
Expand Up @@ -29,15 +29,19 @@
-ms-user-select: none; /* IE 10+ */ -ms-user-select: none; /* IE 10+ */
user-select: none; /* Likely future */ user-select: none; /* Likely future */
} }
.browse {
font-family: sans-serif;
font-size: 12px;
}
.browse .toolbar { .browse .toolbar {
background: #6b6b6b; background: #6b6b6b;
background: -moz-linear-gradient(top, #6b6b6b 0%, #262626 100%); background: -moz-linear-gradient(top, #6b6b6b 0%, #262626 100%);
background: -webkit-linear-gradient(top, #6b6b6b 0%,#262626 100%); background: -webkit-linear-gradient(top, #6b6b6b 0%,#262626 100%);
background: linear-gradient(to bottom, #6b6b6b 0%,#262626 100%); background: linear-gradient(to bottom, #6b6b6b 0%,#262626 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6b6b6b', endColorstr='#262626',GradientType=0 ); filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6b6b6b', endColorstr='#262626',GradientType=0 );
copy color: white;
} }
.browse .toolbar li { .browse li {
width: 40px; width: 40px;
} }
.browse .toolbar:not(.labels) li{ .browse .toolbar:not(.labels) li{
Expand Down
10 changes: 7 additions & 3 deletions css/jquery.filebrowser.css
Expand Up @@ -5,7 +5,7 @@
* Copyright (c) 2016 Jakub Jankiewicz <http://jcubic.pl> * Copyright (c) 2016 Jakub Jankiewicz <http://jcubic.pl>
* Released under the MIT license * Released under the MIT license
* *
* Date: Tue, 06 Dec 2016 20:55:45 +0000 * Date: Thu, 08 Dec 2016 17:51:08 +0000
*/ */
.browse.hidden, .browse .hidden { .browse.hidden, .browse .hidden {
visibility: hidden; visibility: hidden;
Expand All @@ -29,15 +29,19 @@
-ms-user-select: none; /* IE 10+ */ -ms-user-select: none; /* IE 10+ */
user-select: none; /* Likely future */ user-select: none; /* Likely future */
} }
.browse {
font-family: sans-serif;
font-size: 12px;
}
.browse .toolbar { .browse .toolbar {
background: #6b6b6b; background: #6b6b6b;
background: -moz-linear-gradient(top, #6b6b6b 0%, #262626 100%); background: -moz-linear-gradient(top, #6b6b6b 0%, #262626 100%);
background: -webkit-linear-gradient(top, #6b6b6b 0%,#262626 100%); background: -webkit-linear-gradient(top, #6b6b6b 0%,#262626 100%);
background: linear-gradient(to bottom, #6b6b6b 0%,#262626 100%); background: linear-gradient(to bottom, #6b6b6b 0%,#262626 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6b6b6b', endColorstr='#262626',GradientType=0 ); filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6b6b6b', endColorstr='#262626',GradientType=0 );
copy color: white;
} }
.browse .toolbar li { .browse li {
width: 40px; width: 40px;
} }
.browse .toolbar:not(.labels) li{ .browse .toolbar:not(.labels) li{
Expand Down
2 changes: 1 addition & 1 deletion css/jquery.filebrowser.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

42 changes: 42 additions & 0 deletions examples/basic.html
@@ -0,0 +1,42 @@
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Example of jQuery Browse</title>
<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
<script src="../js/jquery.filebrowser-src.js"></script>
<script src="http://code.jquery.com/ui/1.12.0/jquery-ui.js"></script>
<link href="http://code.jquery.com/ui/1.12.1/themes/dark-hive/jquery-ui.css" rel="stylesheet"/>
<link href="../css/jquery.filebrowser-src.css" rel="stylesheet"/>
<style>
#browser {
width: 600px;
height: 400px;
border: 1px solid gray;
}
</style>
<script>
$(function() {
var browse = $('#browser').browse({
root: '/',
separator: '/',
dir: function(path, callback) {
if (path == '/') {
callback({dirs: ['foo', 'bar'], files: []});
} else if (path == '/foo/') {
callback({dirs: [], files: ['baz','quux']});
} else {
callback({files: [], dirs: []});
}
},
open: function(filename) {
alert('opening ' + filename);
}
});
});
</script>
</head>
<div id="browser"></div>
<body>
</body>
</html>
File renamed without changes.

0 comments on commit 97d20e8

Please sign in to comment.