Skip to content

Commit 054f429

Browse files
Support for customization of the component and bower file.
1 parent 27c0f19 commit 054f429

File tree

7 files changed

+155
-76
lines changed

7 files changed

+155
-76
lines changed

README.md

Lines changed: 51 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,70 @@
1-
##Bootstrap-Iconpicker v1.0.1
1+
# [Bootstrap-Iconpicker v1.4.0](http://victor-valencia.github.io/bootstrap-iconpicker)
22
![Iconpicker](bootstrap-iconpicker.png)
33

4-
A simple iconpicker.
5-
6-
See live examples here: <a href="http://victor-valencia.github.io/bootstrap-iconpicker">http://victor-valencia.github.io/bootstrap-iconpicker</a>
4+
A simple iconpicker for Bootstrap 3.
75

86
Please note that this project is for <a href="http://getbootstrap.com/"><strong>Bootstrap 3.2</strong></a>, including Glyphicons or <a href="http://fontawesome.io/"><strong>Font Awesome Icons</strong></a> .
97

10-
##1.- Configuration (Glyphicon):
11-
1.1.- Add the style file bootstrap-iconpicker.min.css
8+
## Table of contents
9+
- [Quick start](#quick-start)
10+
- [Documentation and live examples](#documentation-and-live-examples)
11+
- [Changelog](#changelog)
12+
- [Versioning](#versioning)
13+
- [Author](#author)
14+
- [Contributors](#contributors)
15+
- [License](#license)
1216

13-
```
14-
<link rel="stylesheet" href="bootstrap-iconpicker/css/bootstrap-iconpicker.min.css"/>
15-
```
17+
## Quick start
1618

17-
1.2.- Add the javascript file bootstrap-iconpicker.min.js
19+
Three quick start options are available:
1820

19-
```
20-
<script type="text/javascript" src="bootstrap-iconpicker/js/bootstrap-iconpicker.min.js"></script>
21-
```
21+
- [Download the latest release](https://github.com/victor-valencia/bootstrap-iconpicker/archive/master.zip).
22+
- Clone the repo: `git clone https://github.com/victor-valencia/bootstrap-iconpicker.git`.
23+
- Install with [Bower](http://bower.io): `bower install bootstrap-iconpicker`.
2224

23-
##2.- Configuration (Font Awesome 4.2.0):
24-
2.1.- Add the style file bootstrap-iconpicker.min.css and Font Awesome style file font-awesome.min.css
25+
### What's included
26+
Within the download you'll find the following directories and files, logically grouping common assets and providing both compiled and minified variations. You'll see something like this:
2527

2628
```
27-
<link rel="stylesheet" href="bootstrap-iconpicker/css/bootstrap-iconpicker.min.css"/>
28-
<link rel="stylesheet" href="font-awesome-4.2.0/css/font-awesome.min.css"/>
29+
bootstrap-iconpicker/
30+
├── css/
31+
│ ├── bootstrap-iconpicker.css
32+
│ ├── bootstrap-iconpicker.min.css
33+
├── js/
34+
│ ├── font-awesome/
35+
│ ├── fa-icon-names-4.0.0.js
36+
│ ├── fa-icon-names-4.0.0.min.js
37+
│ ├── fa-icon-names-4.1.0.js
38+
│ ├── fa-icon-names-4.1.0.min.js
39+
│ ├── fa-icon-names-4.2.0.js
40+
│ ├── fa-icon-names-4.2.0.min.js
41+
│ ├── bootstrap-iconpicker.js
42+
│ └── bootstrap-iconpicker.min.js
2943
```
3044

31-
2.2.- Add the Font Awesome icon names file fa-icon-names-4.2.0.min.js and javascript file bootstrap-iconpicker.min.js
45+
We provide compiled CSS and JS (`bootstrap-iconpicker.*`), as well as compiled and minified CSS and JS (`bootstrap-iconpicker.min.*`).
3246

33-
```
34-
<script type="text/javascript" src="bootstrap-iconpicker/js/font-awesome/fa-icon-names-4.2.0.min.js"></script>
35-
<script type="text/javascript" src="bootstrap-iconpicker/js/bootstrap-iconpicker.min.js"></script>
36-
```
47+
## Documentation and live examples
48+
See documentation and live examples here: <a href="http://victor-valencia.github.io/bootstrap-iconpicker">http://victor-valencia.github.io/bootstrap-iconpicker</a>
49+
50+
## Changelog
51+
- v1.0.0 - Version initial. @[victor-valencia](https://github.com/victor-valencia)
52+
- v1.0.1 - Reducing the size of the source file. @[victor-valencia](https://github.com/victor-valencia)
53+
- v1.1.0 - Dispatch 'change' event when an iconpicker is changed. @[promatik](https://github.com/promatik)
54+
- v1.2.0 - Add the method 'setIcon'. @[victor-valencia](https://github.com/victor-valencia)
55+
- v1.2.1 - Add '.iconpicker-popover' class. @[jwhitfieldseed](https://github.com/jwhitfieldseed)
56+
- v1.3.0 - Support multiple versions of FontAwesome. @[victor-valencia](https://github.com/victor-valencia)
57+
- v1.3.1 - Bind body 'click' to solve issues for ajax loaded pages. @[crlcu](https://github.com/crlcu)
58+
- v1.4.0 - Support for customization of the component. @[victor-valencia](https://github.com/victor-valencia)
3759

38-
##Changelog
39-
- v1.0.0 - Version initial.
40-
- v1.0.1 - Is added to support multiple versions of FontAwesome
60+
## Versioning
61+
For transparency into our release cycle and in striving to maintain backward compatibility, Bootstrap is maintained under [the Semantic Versioning guidelines](http://semver.org/). Sometimes we screw up, but we'll adhere to those rules whenever possible.
4162

42-
##Author
63+
## Author
4364
@[victor-valencia](https://github.com/victor-valencia)
4465

45-
##Contributors
46-
@[victor-valencia](https://github.com/victor-valencia), @[promatik](https://github.com/promatik), @[jwhitfieldseed](https://github.com/jwhitfieldseed)
66+
## Contributors
67+
@[victor-valencia](https://github.com/victor-valencia), @[promatik](https://github.com/promatik), @[jwhitfieldseed](https://github.com/jwhitfieldseed), @[crlcu](https://github.com/crlcu)
4768

48-
##License
49-
Licensed under The MIT License.
69+
## License
70+
Licensed under [the MIT license](LICENSE).

bootstrap-iconpicker/css/bootstrap-iconpicker.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*!
2-
* Bootstrap-iconpicker v1.0.1
2+
* Bootstrap-iconpicker v1.4.0
33
*
4-
* Copyright 2014 Victor Valencia Rico.
4+
* Copyright 2013-2014 Victor Valencia Rico.
55
* Licensed under the Apache License v2.0
66
* http://www.apache.org/licenses/LICENSE-2.0
77
*

bootstrap-iconpicker/css/bootstrap-iconpicker.min.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*!
2-
* Bootstrap-iconpicker v1.0.1
2+
* Bootstrap-iconpicker v1.4.0
33
*
4-
* Copyright 2014 Victor Valencia Rico.
4+
* Copyright 2013-2014 Victor Valencia Rico.
55
* Licensed under the Apache License v2.0
66
* http://www.apache.org/licenses/LICENSE-2.0
77
*

bootstrap-iconpicker/js/bootstrap-iconpicker.js

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/* ========================================================================
2-
* Bootstrap: bootstrap-iconpicker.js v1.0.1 by @recktoner
2+
* Bootstrap: bootstrap-iconpicker.js v1.4.0 by @recktoner
33
* https://victor-valencia.github.com/bootstrap-iconpicker
44
* ========================================================================
5-
* Copyright 2014 Victor Valencia Rico.
5+
* Copyright 2013-2014 Victor Valencia Rico.
66
*
77
* Licensed under the Apache License, Version 2.0 (the "License");
88
* you may not use this file except in compliance with the License.
@@ -240,14 +240,17 @@
240240
icon: '',
241241
rows: 4,
242242
cols: 4,
243-
placement: 'right',
243+
placement: 'bottom',
244+
arrowClass: 'btn-primary',
245+
selectedClass: 'btn-warning',
246+
unselectedClass: 'btn-default'
244247
};
245248

246249
Iconpicker.prototype.createButtonBar = function(){
247250
var op = this.options;
248251
var tr = $('<tr></tr>');
249252
for(var i = 0; i < op.cols; i++){
250-
var btn = $('<button class="btn btn-primary"><span class="glyphicon"></span></button>');
253+
var btn = $('<button class="btn ' + op.arrowClass + '"><span class="glyphicon"></span></button>');
251254
var td = $('<td class="text-center"></td>');
252255
if(i == 0 || i == op.cols - 1){
253256
btn.val((i==0) ? -1: 1);
@@ -300,7 +303,7 @@
300303
el.find('input').val(icon);
301304
el.find('i').attr('class', '').addClass(op.iconClass).addClass(icon);
302305
el.trigger({ type: "change", icon: icon });
303-
op.table.find('button.btn-warning').removeClass('btn-warning');
306+
op.table.find('button.' + op.selectedClass).removeClass(op.selectedClass);
304307
}
305308
};
306309

@@ -310,8 +313,8 @@
310313
if(icon != '' && op.selected >= 0){
311314
var page = Math.ceil( (op.selected + 1) / (op.cols * op.rows) );
312315
this.changeList(page);
313-
}
314-
op.table.find('.'+icon).parent().addClass('btn-warning');
316+
}
317+
op.table.find('i.'+icon).parent().addClass(op.selectedClass);
315318
};
316319

317320
Iconpicker.prototype.changeList = function(page){
@@ -323,10 +326,10 @@
323326
var tr = $('<tr></tr>');
324327
for(var j = 0; j < op.cols; j++){
325328
var pos = offset + (i * op.cols) + j;
326-
var btn = $('<button class="btn btn-default btn-icon"></button>').hide();
329+
var btn = $('<button class="btn ' + op.unselectedClass + ' btn-icon"></button>').hide();
327330
if(pos < op.icons.length){
328331
var v = op.iconClassFix + op.icons[pos];
329-
btn = $('<button class="btn btn-default btn-icon" value="' + v + '" title="' + v + '"><i class="' + op.iconClass + ' ' + v + '"></i></button>');
332+
btn = $('<button class="btn ' + ( (op.icon == v) ? op.selectedClass : op.unselectedClass ) + ' btn-icon" value="' + v + '" title="' + v + '"><i class="' + op.iconClass + ' ' + v + '"></i></button>');
330333
}
331334
var td = $('<td></td>').append(btn);
332335
tr.append(td);

0 commit comments

Comments
 (0)