Permalink
Browse files

Add changelog, fix bower file, fix css issues and add usage to readme

  • Loading branch information...
jcubic committed Dec 8, 2016
1 parent cc21e45 commit 97d20e8be2f42e5d3ec8a4114730da5c52b12a29
View
@@ -4,3 +4,4 @@
.\#*
bower_components
node_modules
www
View
@@ -0,0 +1 @@
0.1.0 Base code
View
@@ -2,6 +2,54 @@
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
Licensed under [MIT](http://opensource.org/licenses/MIT) license
View
@@ -2,6 +2,54 @@
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
Licensed under [MIT](http://opensource.org/licenses/MIT) license
View
@@ -2,17 +2,22 @@
"name": "jquery.filebrowser",
"version": "{{VER}}",
"main": [
"js/jquery.filebrowser.min.js",
"css/jquery.filebrowser.min.css"
"js/jquery.filebrowser.js",
"css/jquery.filebrowser.css"
],
"description": "jQuery File Browser is a plugin for creating OS like file browsers.",
"license": "MIT",
"ignore": [
"examples",
"CHANGELOG",
"README.in",
"bower.in",
"Makefile"
"Makefile",
".gitignore",
".npmignore",
"package.in",
"package.json",
"bin"
],
"dependencies": {
"jquery": "~2"
View
@@ -2,17 +2,22 @@
"name": "jquery.filebrowser",
"version": "0.1.0",
"main": [
"js/jquery.filebrowser.min.js",
"css/jquery.filebrowser.min.css"
"js/jquery.filebrowser.js",
"css/jquery.filebrowser.css"
],
"description": "jQuery File Browser is a plugin for creating OS like file browsers.",
"license": "MIT",
"ignore": [
"examples",
"CHANGELOG",
"README.in",
"bower.in",
"Makefile"
"Makefile",
".gitignore",
".npmignore",
"package.in",
"package.json",
"bin"
],
"dependencies": {
"jquery": "~2"
@@ -5,7 +5,7 @@
* Copyright (c) 2016 Jakub Jankiewicz <http://jcubic.pl>
* 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 {
visibility: hidden;
@@ -29,15 +29,19 @@
-ms-user-select: none; /* IE 10+ */
user-select: none; /* Likely future */
}
.browse {
font-family: sans-serif;
font-size: 12px;
}
.browse .toolbar {
background: #6b6b6b;
background: -moz-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%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6b6b6b', endColorstr='#262626',GradientType=0 );
copy
color: white;
}
.browse .toolbar li {
.browse li {
width: 40px;
}
.browse .toolbar:not(.labels) li{

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
@@ -29,15 +29,19 @@
-ms-user-select: none; /* IE 10+ */
user-select: none; /* Likely future */
}
.browse {
font-family: sans-serif;
font-size: 12px;
}
.browse .toolbar {
background: #6b6b6b;
background: -moz-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%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6b6b6b', endColorstr='#262626',GradientType=0 );
copy
color: white;
}
.browse .toolbar li {
.browse li {
width: 40px;
}
.browse .toolbar:not(.labels) li{
View
@@ -5,7 +5,7 @@
* Copyright (c) 2016 Jakub Jankiewicz <http://jcubic.pl>
* 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 {
visibility: hidden;
@@ -29,15 +29,19 @@
-ms-user-select: none; /* IE 10+ */
user-select: none; /* Likely future */
}
.browse {
font-family: sans-serif;
font-size: 12px;
}
.browse .toolbar {
background: #6b6b6b;
background: -moz-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%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6b6b6b', endColorstr='#262626',GradientType=0 );
copy
color: white;
}
.browse .toolbar li {
.browse li {
width: 40px;
}
.browse .toolbar:not(.labels) li{

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View
@@ -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.