Few fixes.

This commit is contained in:
Antoine Nguyen
2014-10-29 11:45:30 +01:00
parent 57642f1397
commit 70cc5ac2bc
89 changed files with 3660 additions and 1848 deletions
+9 -8
View File
@@ -1,10 +1,11 @@
{
"name": "bootstrap-select",
"main": [
"bootstrap-select.css",
"bootstrap-select.js"
"less/bootstrap-select.less",
"dist/css/bootstrap-select.css",
"dist/js/bootstrap-select.js"
],
"version": "1.5.4",
"version": "1.6.0",
"homepage": "https://github.com/silviomoreto/bootstrap-select",
"authors": [
"silviomoreto"
@@ -16,7 +17,7 @@
"replacement"
],
"dependencies": {
"jquery": ">=1.7"
"jquery": ">=1.8"
},
"license": "MIT",
"ignore": [
@@ -26,14 +27,14 @@
"test",
"tests"
],
"_release": "1.5.4",
"_release": "1.6.0",
"_resolution": {
"type": "version",
"tag": "1.5.4",
"commit": "1e01fb7355face50b199780d3d60baa5d799bfce"
"tag": "v1.6.0",
"commit": "32032e001d1ac735ed0a8c00c00c50ddaacefbdd"
},
"_source": "git://github.com/silviomoreto/bootstrap-select.git",
"_target": "1.5.4",
"_target": "1.6.0",
"_originalSource": "bootstrap-select",
"_direct": true
}
+38 -11
View File
@@ -11,9 +11,9 @@ patches and features.
## Using the issue tracker
The issue tracker is the preferred channel for [bug reports](#bugs),
[features requests](#features) and submitting pull
requests, but please respect the following restrictions:
The issue tracker is the preferred channel for [bug reports](#bug-reports),
[features requests](#feature-requests) and submitting pull requests, but please
respect the following restrictions:
* Please **do not** use the issue tracker for personal support requests (use
[Stack Overflow](http://stackoverflow.com) or IRC).
@@ -22,7 +22,6 @@ requests, but please respect the following restrictions:
respect the opinions of others.
<a name="bugs"></a>
## Bug reports
A bug is a _demonstrable problem_ that is caused by the code in the repository.
@@ -36,12 +35,14 @@ Guidelines for bug reports:
2. **Check if the issue has been fixed.** Try to reproduce it using the
latest `master` or development branch in the repository.
3. **Provide environment details.** Provide your operating system, browser(s), jQuery version, Bootstrap version, and bootstrap-select version.
3. **Provide environment details.** Provide your operating system, browser(s),
jQuery version, Bootstrap version, and bootstrap-select version.
4. **Create an isolated and reproducible test case.** Create a [reduced test
case](http://css-tricks.com/6263-reduced-test-cases/).
5. **Include a live example.** Make use of jsFiddle or jsBin to share your isolated test cases.
5. **Include a live example.** Make use of jsFiddle or jsBin to share your
isolated test cases.
A good bug report shouldn't leave others needing to chase you up for more
information. Please try to be as detailed as possible in your report. What is
@@ -68,7 +69,6 @@ Example:
> merits).
<a name="features"></a>
## Feature requests
Feature requests are welcome. But take a moment to find out whether your idea
@@ -78,10 +78,37 @@ provide as much detail and context as possible.
## Pull Request Guidelines
* To instantiate a context or use it, use the variable **that** instead of **_this**.
* Submit your CLA, if you haven't.
* Please check to make sure that there aren't existing pull requests attempting to address the issue mentioned. We also recommend checking for issues related to the issue on the tracker, as a team member may be working on the issue in a branch or fork.
You must understand that by contributing code to this project, you are granting
the authors (and/or leaders) of the project a non-exclusive license to
re-distribute your code under the current license and possibly re-license the
code as deemed necessary.
* To instantiate a context or use it, use the variable **that** instead of
**_this**.
* Please check to make sure that there aren't existing pull requests attempting
to address the issue mentioned. We also recommend checking for issues related
to the issue on the tracker, as a team member may be working on the issue in
a branch or fork.
* Non-trivial changes should be discussed in an issue first
* If possible, use JSlint or JSHint to validate it
* If your change affects the distributed files, re-generate them using the
[grunt procedure](#using-grunt)
* If possible, add relevant tests to cover the change
* Write a convincing description of your PR and why we should land it
## Using Grunt
We are using node and grunt to build and (in the future) test this project.
This means that you must setup a local development environment:
1. Install `node` and `npm` using your preferred method
2. Install the grunt CLI: `npm install -g grunt-cli`
3. Install the project's development dependencies: `npm install`
4. Run the various grunt tasks as needed:
- `grunt`: clean the distribution files and re-build them
- `grunt dist`: build the distribution files
- `grunt clean`: clean the distribution files
- `grunt dist-css`: build the css distribution files
- `grunt dist-js`: build the javascript distribution files
- `grunt watch`: watch for changes in the source files and build the
distribution files as needed
+212
View File
@@ -0,0 +1,212 @@
/*jshint node:true*/
module.exports = function (grunt) {
// From TWBS
RegExp.quote = function (string) {
return string.replace(/[-\\^$*+?.()|[\]{}]/g, '\\$&');
};
// Project configuration.
grunt.initConfig({
// Metadata.
pkg: grunt.file.readJSON('package.json'),
banner: '/*!\n' +
' * Bootstrap-select v<%= pkg.version %> (<%= pkg.homepage %>)\n' +
' *\n' +
' * Copyright 2013-<%= grunt.template.today("yyyy") %> bootstrap-select\n' +
' * Licensed under <%= pkg.license.type %> (<%= pkg.license.url %>)\n' +
' */\n',
// Task configuration.
clean: {
css: 'dist/css',
js: 'dist/js'
},
jshint: {
options: {
jshintrc: 'js/.jshintrc'
},
gruntfile: {
options: {
"node": true
},
src: 'Gruntfile.js'
},
main: {
src: 'js/*.js'
},
i18n: {
src: 'js/i18n/*.js'
}
},
concat: {
options: {
banner: '<%= banner %>',
stripBanners: true
},
main: {
src: '<%= jshint.main.src %>',
dest: 'dist/js/<%= pkg.name %>.js'
},
i18n: {
files: [
{
expand: true,
src: '<%= jshint.i18n.src %>',
dest: 'dist/'
}
]
}
},
uglify: {
options: {
preserveComments: 'some'
},
main: {
src: '<%= concat.main.dest %>',
dest: 'dist/js/<%= pkg.name %>.min.js',
options: {
sourceMap: true,
sourceMapName: 'dist/js/<%= pkg.name %>.js.map'
}
},
i18n: {
files: [
{
expand: true,
cwd: 'dist/',
src: '<%= jshint.i18n.src %>',
dest: 'dist/',
ext: '.min.js'
}
]
}
},
//qunit: {
// files: ['test/**/*.html']
//},
less: {
options: {
strictMath: true,
sourceMap: true,
outputSourceFiles: true,
sourceMapURL: '<%= pkg.name %>.css.map',
sourceMapFilename: 'dist/css/<%= pkg.name %>.css.map'
},
css: {
src: 'less/bootstrap-select.less',
dest: 'dist/css/<%= pkg.name %>.css'
}
},
usebanner: {
css: {
options: {
position: 'top',
banner: '<%= banner %>'
},
src: '<%= less.css.dest %>'
}
},
cssmin: {
options: {
compatibility: 'ie8',
keepSpecialComments: '*',
noAdvanced: true
},
css: {
src: '<%= less.css.dest %>',
dest: 'dist/css/<%= pkg.name %>.min.css'
}
},
csslint: {
options: {
"adjoining-classes": false,
"box-sizing": false,
"box-model": false,
"compatible-vendor-prefixes": false,
"floats": false,
"font-sizes": false,
"gradients": false,
"important": false,
"known-properties": false,
"outline-none": false,
"qualified-headings": false,
"regex-selectors": false,
"shorthand": false,
"text-indent": false,
"unique-headings": false,
"universal-selector": false,
"unqualified-attributes": false,
"overqualified-elements": false
},
css: {
src: '<%= less.css.dest %>'
}
},
sed: {
versionNumber: {
path: [
"less",
"js",
"bootstrap-select.jquery.json",
"bower.json",
"composer.json",
"package.json"
],
pattern: (function () {
var old = grunt.option('old');
return old ? RegExp.quote(old) : old;
})(),
replacement: grunt.option('new'),
recursive: true
}
},
watch: {
gruntfile: {
files: '<%= jshint.gruntfile.src %>',
tasks: 'jshint:gruntfile'
},
js: {
files: ['<%= jshint.main.src %>', '<%= jshint.i18n.src %>'],
tasks: 'dist-js'
},
less: {
files: 'less/*.less',
tasks: 'dist-css'
}
}
});
// These plugins provide necessary tasks.
require('load-grunt-tasks')(grunt);
// Version numbering task.
// grunt change-version-number --old=A.B.C --new=X.Y.Z
// This can be overzealous, so its changes should always be manually reviewed!
grunt.registerTask('change-version-number', 'sed');
// CSS distribution
grunt.registerTask('dist-css', ['less', 'usebanner', 'cssmin']);
// JS distribution
grunt.registerTask('dist-js', ['concat', 'uglify']);
// Full distribution
grunt.registerTask('dist', ['dist-css', 'dist-js']);
// Default task.
grunt.registerTask('default', ['clean', 'dist']);
};
+21
View File
@@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2013-2014 bootstrap-select
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
+19 -18
View File
@@ -6,39 +6,40 @@ A custom select / multiselect for Bootstrap using button dropdown, designed to b
## Demo and Documentation
See a Bootstrap 2.3.2 example [here](http://silviomoreto.github.com/bootstrap-select/). <br/>
See a Bootstrap 3.0.2 example [here](http://silviomoreto.github.com/bootstrap-select/3) (work-in-progress).
See a Bootstrap 3.0.3 example [here](http://silviomoreto.github.com/bootstrap-select/3) (work-in-progress).
## Authors
[Silvio Moreto](http://github.com/silviomoreto),
[Ana Carolina](http://github.com/anacarolinats),
[caseyjhol](https://github.com/caseyjhol), and
[Matt Bryson](https://github.com/mattbryson).
[caseyjhol](https://github.com/caseyjhol),
[Matt Bryson](https://github.com/mattbryson), and
[t0xicCode](https://github.com/t0xicCode).
## Usage
Create your `<select>` with the `.selectpicker` class.
<select class="selectpicker">
<option>Mustard</option>
<option>Ketchup</option>
<option>Barbecue</option>
</select>
```html
<select class="selectpicker">
<option>Mustard</option>
<option>Ketchup</option>
<option>Barbecue</option>
</select>
```
Enable Bootstrap-Select via JavaScript:
$('.selectpicker').selectpicker();
```js
$('.selectpicker').selectpicker();
```
Or just
$('select').selectpicker();
```js
$('select').selectpicker();
```
Checkout the [documentation](http://silviomoreto.github.com/bootstrap-select/) for further information.
## CDN
* https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.3.5/bootstrap-select.min.js
* https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.3.5/bootstrap-select.min.css
* https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.5.4/bootstrap-select.min.js
* https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.5.4/bootstrap-select.min.css
## Bugs and feature requests
@@ -1,309 +0,0 @@
/*!
* bootstrap-select v1.5.4
* http://silviomoreto.github.io/bootstrap-select/
*
* Copyright 2013 bootstrap-select
* Licensed under the MIT license
*/
.bootstrap-select.btn-group:not(.input-group-btn),
.bootstrap-select.btn-group[class*="span"] {
float: none;
display: inline-block;
margin-bottom: 10px;
margin-left: 0;
}
.form-search .bootstrap-select.btn-group,
.form-inline .bootstrap-select.btn-group,
.form-horizontal .bootstrap-select.btn-group {
margin-bottom: 0;
}
.bootstrap-select.form-control {
margin-bottom: 0;
padding: 0;
border: none;
}
.bootstrap-select.btn-group.pull-right,
.bootstrap-select.btn-group[class*="span"].pull-right,
.row-fluid .bootstrap-select.btn-group[class*="span"].pull-right {
float: right;
}
.input-append .bootstrap-select.btn-group {
margin-left: -1px;
}
.input-prepend .bootstrap-select.btn-group {
margin-right: -1px;
}
.bootstrap-select:not([class*="span"]):not([class*="col-"]):not([class*="form-control"]):not(.input-group-btn) {
width: 220px;
}
.bootstrap-select {
/*width: 220px\9; IE8 and below*/
width: 220px\0; /*IE9 and below*/
}
.bootstrap-select.form-control:not([class*="span"]) {
width: 100%;
}
.bootstrap-select > .btn {
width: 100%;
padding-right: 25px;
}
.error .bootstrap-select .btn {
border: 1px solid #b94a48;
}
.bootstrap-select.show-menu-arrow.open > .btn {
z-index: 2051;
}
.bootstrap-select .btn:focus {
outline: thin dotted #333333 !important;
outline: 5px auto -webkit-focus-ring-color !important;
outline-offset: -2px;
}
.bootstrap-select.btn-group .btn .filter-option {
display: inline-block;
overflow: hidden;
width: 100%;
float: left;
text-align: left;
}
.bootstrap-select.btn-group .btn .caret {
position: absolute;
top: 50%;
right: 12px;
margin-top: -2px;
vertical-align: middle;
}
.bootstrap-select.btn-group > .disabled,
.bootstrap-select.btn-group .dropdown-menu li.disabled > a {
cursor: not-allowed;
}
.bootstrap-select.btn-group > .disabled:focus {
outline: none !important;
}
.bootstrap-select.btn-group[class*="span"] .btn {
width: 100%;
}
.bootstrap-select.btn-group .dropdown-menu {
min-width: 100%;
z-index: 2000;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.bootstrap-select.btn-group .dropdown-menu.inner {
position: static;
border: 0;
padding: 0;
margin: 0;
-webkit-border-radius: 0;
-moz-border-radius: 0;
border-radius: 0;
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
}
.bootstrap-select.btn-group .dropdown-menu dt {
display: block;
padding: 3px 20px;
cursor: default;
}
.bootstrap-select.btn-group .div-contain {
overflow: hidden;
}
.bootstrap-select.btn-group .dropdown-menu li {
position: relative;
}
.bootstrap-select.btn-group .dropdown-menu li > a.opt {
position: relative;
padding-left: 35px;
}
.bootstrap-select.btn-group .dropdown-menu li > a {
cursor: pointer;
}
.bootstrap-select.btn-group .dropdown-menu li > dt small {
font-weight: normal;
}
.bootstrap-select.btn-group.show-tick .dropdown-menu li.selected a i.check-mark {
position: absolute;
display: inline-block;
right: 15px;
margin-top: 2.5px;
}
.bootstrap-select.btn-group .dropdown-menu li a i.check-mark {
display: none;
}
.bootstrap-select.btn-group.show-tick .dropdown-menu li a span.text {
margin-right: 34px;
}
.bootstrap-select.btn-group .dropdown-menu li small {
padding-left: 0.5em;
}
.bootstrap-select.btn-group .dropdown-menu li:not(.disabled) > a:hover small,
.bootstrap-select.btn-group .dropdown-menu li:not(.disabled) > a:focus small,
.bootstrap-select.btn-group .dropdown-menu li.active:not(.disabled) > a small {
color: #64b1d8;
color: rgba(255,255,255,0.4);
}
.bootstrap-select.btn-group .dropdown-menu li > dt small {
font-weight: normal;
}
.bootstrap-select.show-menu-arrow .dropdown-toggle:before {
content: '';
display: inline-block;
border-left: 7px solid transparent;
border-right: 7px solid transparent;
border-bottom: 7px solid #CCC;
border-bottom-color: rgba(0, 0, 0, 0.2);
position: absolute;
bottom: -4px;
left: 9px;
display: none;
}
.bootstrap-select.show-menu-arrow .dropdown-toggle:after {
content: '';
display: inline-block;
border-left: 6px solid transparent;
border-right: 6px solid transparent;
border-bottom: 6px solid white;
position: absolute;
bottom: -4px;
left: 10px;
display: none;
}
.bootstrap-select.show-menu-arrow.dropup .dropdown-toggle:before {
bottom: auto;
top: -3px;
border-top: 7px solid #ccc;
border-bottom: 0;
border-top-color: rgba(0, 0, 0, 0.2);
}
.bootstrap-select.show-menu-arrow.dropup .dropdown-toggle:after {
bottom: auto;
top: -3px;
border-top: 6px solid #ffffff;
border-bottom: 0;
}
.bootstrap-select.show-menu-arrow.pull-right .dropdown-toggle:before {
right: 12px;
left: auto;
}
.bootstrap-select.show-menu-arrow.pull-right .dropdown-toggle:after {
right: 13px;
left: auto;
}
.bootstrap-select.show-menu-arrow.open > .dropdown-toggle:before,
.bootstrap-select.show-menu-arrow.open > .dropdown-toggle:after {
display: block;
}
.bootstrap-select.btn-group .no-results {
padding: 3px;
background: #f5f5f5;
margin: 0 5px;
}
.bootstrap-select.btn-group .dropdown-menu .notify {
position: absolute;
bottom: 5px;
width: 96%;
margin: 0 2%;
min-height: 26px;
padding: 3px 5px;
background: #f5f5f5;
border: 1px solid #e3e3e3;
box-shadow: inset 0 1px 1px rgba(0,0,0,0.05);
pointer-events: none;
opacity: 0.9;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.mobile-device {
position: absolute;
top: 0;
left: 0;
display: block !important;
width: 100%;
height: 100% !important;
opacity: 0;
}
.bootstrap-select.fit-width {
width: auto !important;
}
.bootstrap-select.btn-group.fit-width .btn .filter-option {
position: static;
}
.bootstrap-select.btn-group.fit-width .btn .caret {
position: static;
top: auto;
margin-top: -1px;
}
.control-group.error .bootstrap-select .dropdown-toggle{
border-color: #b94a48;
}
.bootstrap-select-searchbox,
.bootstrap-select .bs-actionsbox {
padding: 4px 8px;
}
.bootstrap-select .bs-actionsbox {
float: left;
width: 100%;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.bootstrap-select-searchbox + .bs-actionsbox {
padding: 0 8px 4px;
}
.bootstrap-select-searchbox input {
margin-bottom: 0;
}
.bootstrap-select .bs-actionsbox .btn-group button {
width: 50%;
}
@@ -1,29 +1,29 @@
{
"name": "bootstrap-select",
"title": "Bootstrap Select",
"description": "A custom select / multiselect for Bootstrap using button dropdown, designed to behave like regular Bootstrap selects",
"keywords": [
"form",
"bootstrap",
"select",
"replacement"
],
"version": "1.5.4",
"author": {
"name": "Silvio Moreto",
"url": "https://github.com/silviomoreto/"
},
"licenses": [
{
"type": "MIT",
"url": "https://github.com/silviomoreto/bootstrap-select#copyright-and-license"
}
],
"bugs": "https://github.com/silviomoreto/bootstrap-select/issues",
"homepage": "https://github.com/silviomoreto/bootstrap-select",
"docs": "https://github.com/silviomoreto/bootstrap-select",
"download": "https://github.com/silviomoreto/bootstrap-select/releases",
"dependencies": {
"jquery": ">=1.7"
"name": "bootstrap-select",
"title": "Bootstrap Select",
"description": "A custom select / multiselect for Bootstrap using button dropdown, designed to behave like regular Bootstrap selects",
"keywords": [
"form",
"bootstrap",
"select",
"replacement"
],
"version": "1.6.0",
"author": {
"name": "Silvio Moreto",
"url": "https://github.com/silviomoreto/"
},
"licenses": [
{
"type": "MIT",
"url": "https://github.com/silviomoreto/bootstrap-select/blob/master/LICENSE"
}
}
],
"bugs": "https://github.com/silviomoreto/bootstrap-select/issues",
"homepage": "https://github.com/silviomoreto/bootstrap-select",
"docs": "https://github.com/silviomoreto/bootstrap-select",
"download": "https://github.com/silviomoreto/bootstrap-select/releases",
"dependencies": {
"jquery": ">=1.8"
}
}
@@ -1,972 +0,0 @@
/*!
* bootstrap-select v1.5.4
* http://silviomoreto.github.io/bootstrap-select/
*
* Copyright 2013 bootstrap-select
* Licensed under the MIT license
*/
!function($) {
'use strict';
$.expr[':'].icontains = function(obj, index, meta) {
return $(obj).text().toUpperCase().indexOf(meta[3].toUpperCase()) >= 0;
};
var Selectpicker = function(element, options, e) {
if (e) {
e.stopPropagation();
e.preventDefault();
}
this.$element = $(element);
this.$newElement = null;
this.$button = null;
this.$menu = null;
this.$lis = null;
//Merge defaults, options and data-attributes to make our options
this.options = $.extend({}, $.fn.selectpicker.defaults, this.$element.data(), typeof options == 'object' && options);
//If we have no title yet, check the attribute 'title' (this is missed by jq as its not a data-attribute
if (this.options.title === null) {
this.options.title = this.$element.attr('title');
}
//Expose public methods
this.val = Selectpicker.prototype.val;
this.render = Selectpicker.prototype.render;
this.refresh = Selectpicker.prototype.refresh;
this.setStyle = Selectpicker.prototype.setStyle;
this.selectAll = Selectpicker.prototype.selectAll;
this.deselectAll = Selectpicker.prototype.deselectAll;
this.init();
};
Selectpicker.prototype = {
constructor: Selectpicker,
init: function() {
var that = this,
id = this.$element.attr('id');
this.$element.hide();
this.multiple = this.$element.prop('multiple');
this.autofocus = this.$element.prop('autofocus');
this.$newElement = this.createView();
this.$element.after(this.$newElement);
this.$menu = this.$newElement.find('> .dropdown-menu');
this.$button = this.$newElement.find('> button');
this.$searchbox = this.$newElement.find('input');
if (id !== undefined) {
this.$button.attr('data-id', id);
$('label[for="' + id + '"]').click(function(e) {
e.preventDefault();
that.$button.focus();
});
}
this.checkDisabled();
this.clickListener();
if (this.options.liveSearch) this.liveSearchListener();
this.render();
this.liHeight();
this.setStyle();
this.setWidth();
if (this.options.container) this.selectPosition();
this.$menu.data('this', this);
this.$newElement.data('this', this);
},
createDropdown: function() {
//If we are multiple, then add the show-tick class by default
var multiple = this.multiple ? ' show-tick' : '';
var inputGroup = this.$element.parent().hasClass('input-group') ? ' input-group-btn' : '';
var autofocus = this.autofocus ? ' autofocus' : '';
var header = this.options.header ? '<div class="popover-title"><button type="button" class="close" aria-hidden="true">&times;</button>' + this.options.header + '</div>' : '';
var searchbox = this.options.liveSearch ? '<div class="bootstrap-select-searchbox"><input type="text" class="input-block-level form-control" autocomplete="off" /></div>' : '';
var actionsbox = this.options.actionsBox ? '<div class="bs-actionsbox">' +
'<div class="btn-group btn-block">' +
'<button class="actions-btn bs-select-all btn btn-sm btn-default">' +
'Select All' +
'</button>' +
'<button class="actions-btn bs-deselect-all btn btn-sm btn-default">' +
'Deselect All' +
'</button>' +
'</div>' +
'</div>' : '';
var drop =
'<div class="btn-group bootstrap-select' + multiple + inputGroup + '">' +
'<button type="button" class="btn dropdown-toggle selectpicker" data-toggle="dropdown"'+ autofocus +'>' +
'<span class="filter-option pull-left"></span>&nbsp;' +
'<span class="caret"></span>' +
'</button>' +
'<div class="dropdown-menu open">' +
header +
searchbox +
actionsbox +
'<ul class="dropdown-menu inner selectpicker" role="menu">' +
'</ul>' +
'</div>' +
'</div>';
return $(drop);
},
createView: function() {
var $drop = this.createDropdown();
var $li = this.createLi();
$drop.find('ul').append($li);
return $drop;
},
reloadLi: function() {
//Remove all children.
this.destroyLi();
//Re build
var $li = this.createLi();
this.$menu.find('ul').append( $li );
},
destroyLi: function() {
this.$menu.find('li').remove();
},
createLi: function() {
var that = this,
_liA = [],
_liHtml = '';
this.$element.find('option').each(function() {
var $this = $(this);
//Get the class and text for the option
var optionClass = $this.attr('class') || '';
var inline = $this.attr('style') || '';
var text = $this.data('content') ? $this.data('content') : $this.html();
var subtext = $this.data('subtext') !== undefined ? '<small class="muted text-muted">' + $this.data('subtext') + '</small>' : '';
var icon = $this.data('icon') !== undefined ? '<i class="' + that.options.iconBase + ' ' + $this.data('icon') + '"></i> ' : '';
if (icon !== '' && ($this.is(':disabled') || $this.parent().is(':disabled'))) {
icon = '<span>'+icon+'</span>';
}
if (!$this.data('content')) {
//Prepend any icon and append any subtext to the main text.
text = icon + '<span class="text">' + text + subtext + '</span>';
}
if (that.options.hideDisabled && ($this.is(':disabled') || $this.parent().is(':disabled'))) {
_liA.push('<a style="min-height: 0; padding: 0"></a>');
} else if ($this.parent().is('optgroup') && $this.data('divider') !== true) {
if ($this.index() === 0) {
//Get the opt group label
var label = $this.parent().attr('label');
var labelSubtext = $this.parent().data('subtext') !== undefined ? '<small class="muted text-muted">'+$this.parent().data('subtext')+'</small>' : '';
var labelIcon = $this.parent().data('icon') ? '<i class="'+$this.parent().data('icon')+'"></i> ' : '';
label = labelIcon + '<span class="text">' + label + labelSubtext + '</span>';
if ($this[0].index !== 0) {
_liA.push(
'<div class="div-contain"><div class="divider"></div></div>'+
'<dt>'+label+'</dt>'+
that.createA(text, 'opt ' + optionClass, inline )
);
} else {
_liA.push(
'<dt>'+label+'</dt>'+
that.createA(text, 'opt ' + optionClass, inline ));
}
} else {
_liA.push(that.createA(text, 'opt ' + optionClass, inline ));
}
} else if ($this.data('divider') === true) {
_liA.push('<div class="div-contain"><div class="divider"></div></div>');
} else if ($(this).data('hidden') === true) {
_liA.push('<a></a>');
} else {
_liA.push(that.createA(text, optionClass, inline ));
}
});
$.each(_liA, function(i, item) {
var hide = item === '<a></a>' ? 'class="hide is-hidden"' : '';
_liHtml += '<li rel="' + i + '"' + hide + '>' + item + '</li>';
});
//If we are not multiple, and we dont have a selected item, and we dont have a title, select the first element so something is set in the button
if (!this.multiple && this.$element.find('option:selected').length===0 && !this.options.title) {
this.$element.find('option').eq(0).prop('selected', true).attr('selected', 'selected');
}
return $(_liHtml);
},
createA: function(text, classes, inline) {
return '<a tabindex="0" class="'+classes+'" style="'+inline+'">' +
text +
'<i class="' + this.options.iconBase + ' ' + this.options.tickIcon + ' icon-ok check-mark"></i>' +
'</a>';
},
render: function(updateLi) {
var that = this;
//Update the LI to match the SELECT
if (updateLi !== false) {
this.$element.find('option').each(function(index) {
that.setDisabled(index, $(this).is(':disabled') || $(this).parent().is(':disabled') );
that.setSelected(index, $(this).is(':selected') );
});
}
this.tabIndex();
var selectedItems = this.$element.find('option:selected').map(function() {
var $this = $(this);
var icon = $this.data('icon') && that.options.showIcon ? '<i class="' + that.options.iconBase + ' ' + $this.data('icon') + '"></i> ' : '';
var subtext;
if (that.options.showSubtext && $this.attr('data-subtext') && !that.multiple) {
subtext = ' <small class="muted text-muted">'+$this.data('subtext') +'</small>';
} else {
subtext = '';
}
if ($this.data('content') && that.options.showContent) {
return $this.data('content');
} else if ($this.attr('title') !== undefined) {
return $this.attr('title');
} else {
return icon + $this.html() + subtext;
}
}).toArray();
//Fixes issue in IE10 occurring when no default option is selected and at least one option is disabled
//Convert all the values into a comma delimited string
var title = !this.multiple ? selectedItems[0] : selectedItems.join(this.options.multipleSeparator);
//If this is multi select, and the selectText type is count, the show 1 of 2 selected etc..
if (this.multiple && this.options.selectedTextFormat.indexOf('count') > -1) {
var max = this.options.selectedTextFormat.split('>');
var notDisabled = this.options.hideDisabled ? ':not([disabled])' : '';
if ( (max.length>1 && selectedItems.length > max[1]) || (max.length==1 && selectedItems.length>=2)) {
title = this.options.countSelectedText.replace('{0}', selectedItems.length).replace('{1}', this.$element.find('option:not([data-divider="true"]):not([data-hidden="true"])'+notDisabled).length);
}
}
this.options.title = this.$element.attr('title');
//If we dont have a title, then use the default, or if nothing is set at all, use the not selected text
if (!title) {
title = this.options.title !== undefined ? this.options.title : this.options.noneSelectedText;
}
this.$button.attr('title', $.trim(title));
this.$newElement.find('.filter-option').html(title);
},
setStyle: function(style, status) {
if (this.$element.attr('class')) {
this.$newElement.addClass(this.$element.attr('class').replace(/selectpicker|mobile-device|validate\[.*\]/gi, ''));
}
var buttonClass = style ? style : this.options.style;
if (status == 'add') {
this.$button.addClass(buttonClass);
} else if (status == 'remove') {
this.$button.removeClass(buttonClass);
} else {
this.$button.removeClass(this.options.style);
this.$button.addClass(buttonClass);
}
},
liHeight: function() {
if (this.options.size === false) return;
var $selectClone = this.$menu.parent().clone().find('> .dropdown-toggle').prop('autofocus', false).end().appendTo('body'),
$menuClone = $selectClone.addClass('open').find('> .dropdown-menu'),
liHeight = $menuClone.find('li > a').outerHeight(),
headerHeight = this.options.header ? $menuClone.find('.popover-title').outerHeight() : 0,
searchHeight = this.options.liveSearch ? $menuClone.find('.bootstrap-select-searchbox').outerHeight() : 0,
actionsHeight = this.options.actionsBox ? $menuClone.find('.bs-actionsbox').outerHeight() : 0;
$selectClone.remove();
this.$newElement
.data('liHeight', liHeight)
.data('headerHeight', headerHeight)
.data('searchHeight', searchHeight)
.data('actionsHeight', actionsHeight);
},
setSize: function() {
var that = this,
menu = this.$menu,
menuInner = menu.find('.inner'),
selectHeight = this.$newElement.outerHeight(),
liHeight = this.$newElement.data('liHeight'),
headerHeight = this.$newElement.data('headerHeight'),
searchHeight = this.$newElement.data('searchHeight'),
actionsHeight = this.$newElement.data('actionsHeight'),
divHeight = menu.find('li .divider').outerHeight(true),
menuPadding = parseInt(menu.css('padding-top')) +
parseInt(menu.css('padding-bottom')) +
parseInt(menu.css('border-top-width')) +
parseInt(menu.css('border-bottom-width')),
notDisabled = this.options.hideDisabled ? ':not(.disabled)' : '',
$window = $(window),
menuExtras = menuPadding + parseInt(menu.css('margin-top')) + parseInt(menu.css('margin-bottom')) + 2,
menuHeight,
selectOffsetTop,
selectOffsetBot,
posVert = function() {
selectOffsetTop = that.$newElement.offset().top - $window.scrollTop();
selectOffsetBot = $window.height() - selectOffsetTop - selectHeight;
};
posVert();
if (this.options.header) menu.css('padding-top', 0);
if (this.options.size == 'auto') {
var getSize = function() {
var minHeight,
lisVis = that.$lis.not('.hide');
posVert();
menuHeight = selectOffsetBot - menuExtras;
if (that.options.dropupAuto) {
that.$newElement.toggleClass('dropup', (selectOffsetTop > selectOffsetBot) && ((menuHeight - menuExtras) < menu.height()));
}
if (that.$newElement.hasClass('dropup')) {
menuHeight = selectOffsetTop - menuExtras;
}
if ((lisVis.length + lisVis.find('dt').length) > 3) {
minHeight = liHeight*3 + menuExtras - 2;
} else {
minHeight = 0;
}
menu.css({'max-height' : menuHeight + 'px', 'overflow' : 'hidden', 'min-height' : minHeight + headerHeight + searchHeight + actionsHeight + 'px'});
menuInner.css({'max-height' : menuHeight - headerHeight - searchHeight - actionsHeight - menuPadding + 'px', 'overflow-y' : 'auto', 'min-height' : Math.max(minHeight - menuPadding, 0) + 'px'});
};
getSize();
this.$searchbox.off('input.getSize propertychange.getSize').on('input.getSize propertychange.getSize', getSize);
$(window).off('resize.getSize').on('resize.getSize', getSize);
$(window).off('scroll.getSize').on('scroll.getSize', getSize);
} else if (this.options.size && this.options.size != 'auto' && menu.find('li'+notDisabled).length > this.options.size) {
var optIndex = menu.find('li'+notDisabled+' > *').filter(':not(.div-contain)').slice(0,this.options.size).last().parent().index();
var divLength = menu.find('li').slice(0,optIndex + 1).find('.div-contain').length;
menuHeight = liHeight*this.options.size + divLength*divHeight + menuPadding;
if (that.options.dropupAuto) {
this.$newElement.toggleClass('dropup', (selectOffsetTop > selectOffsetBot) && (menuHeight < menu.height()));
}
menu.css({'max-height' : menuHeight + headerHeight + searchHeight + actionsHeight + 'px', 'overflow' : 'hidden'});
menuInner.css({'max-height' : menuHeight - menuPadding + 'px', 'overflow-y' : 'auto'});
}
},
setWidth: function() {
if (this.options.width == 'auto') {
this.$menu.css('min-width', '0');
// Get correct width if element hidden
var selectClone = this.$newElement.clone().appendTo('body');
var ulWidth = selectClone.find('> .dropdown-menu').css('width');
var btnWidth = selectClone.css('width', 'auto').find('> button').css('width');
selectClone.remove();
// Set width to whatever's larger, button title or longest option
this.$newElement.css('width', Math.max(parseInt(ulWidth), parseInt(btnWidth)) + 'px');
} else if (this.options.width == 'fit') {
// Remove inline min-width so width can be changed from 'auto'
this.$menu.css('min-width', '');
this.$newElement.css('width', '').addClass('fit-width');
} else if (this.options.width) {
// Remove inline min-width so width can be changed from 'auto'
this.$menu.css('min-width', '');
this.$newElement.css('width', this.options.width);
} else {
// Remove inline min-width/width so width can be changed
this.$menu.css('min-width', '');
this.$newElement.css('width', '');
}
// Remove fit-width class if width is changed programmatically
if (this.$newElement.hasClass('fit-width') && this.options.width !== 'fit') {
this.$newElement.removeClass('fit-width');
}
},
selectPosition: function() {
var that = this,
drop = '<div />',
$drop = $(drop),
pos,
actualHeight,
getPlacement = function($element) {
$drop.addClass($element.attr('class').replace(/form-control/gi, '')).toggleClass('dropup', $element.hasClass('dropup'));
pos = $element.offset();
actualHeight = $element.hasClass('dropup') ? 0 : $element[0].offsetHeight;
$drop.css({'top' : pos.top + actualHeight, 'left' : pos.left, 'width' : $element[0].offsetWidth, 'position' : 'absolute'});
};
this.$newElement.on('click', function() {
if (that.isDisabled()) {
return;
}
getPlacement($(this));
$drop.appendTo(that.options.container);
$drop.toggleClass('open', !$(this).hasClass('open'));
$drop.append(that.$menu);
});
$(window).resize(function() {
getPlacement(that.$newElement);
});
$(window).on('scroll', function() {
getPlacement(that.$newElement);
});
$('html').on('click', function(e) {
if ($(e.target).closest(that.$newElement).length < 1) {
$drop.removeClass('open');
}
});
},
mobile: function() {
this.$element.addClass('mobile-device').appendTo(this.$newElement);
if (this.options.container) this.$menu.hide();
},
refresh: function() {
this.$lis = null;
this.reloadLi();
this.render();
this.setWidth();
this.setStyle();
this.checkDisabled();
this.liHeight();
},
update: function() {
this.reloadLi();
this.setWidth();
this.setStyle();
this.checkDisabled();
this.liHeight();
},
setSelected: function(index, selected) {
if (this.$lis == null) this.$lis = this.$menu.find('li');
$(this.$lis[index]).toggleClass('selected', selected);
},
setDisabled: function(index, disabled) {
if (this.$lis == null) this.$lis = this.$menu.find('li');
if (disabled) {
$(this.$lis[index]).addClass('disabled').find('a').attr('href', '#').attr('tabindex', -1);
} else {
$(this.$lis[index]).removeClass('disabled').find('a').removeAttr('href').attr('tabindex', 0);
}
},
isDisabled: function() {
return this.$element.is(':disabled');
},
checkDisabled: function() {
var that = this;
if (this.isDisabled()) {
this.$button.addClass('disabled').attr('tabindex', -1);
} else {
if (this.$button.hasClass('disabled')) {
this.$button.removeClass('disabled');
}
if (this.$button.attr('tabindex') == -1) {
if (!this.$element.data('tabindex')) this.$button.removeAttr('tabindex');
}
}
this.$button.click(function() {
return !that.isDisabled();
});
},
tabIndex: function() {
if (this.$element.is('[tabindex]')) {
this.$element.data('tabindex', this.$element.attr('tabindex'));
this.$button.attr('tabindex', this.$element.data('tabindex'));
}
},
clickListener: function() {
var that = this;
$('body').on('touchstart.dropdown', '.dropdown-menu', function(e) {
e.stopPropagation();
});
this.$newElement.on('click', function() {
that.setSize();
if (!that.options.liveSearch && !that.multiple) {
setTimeout(function() {
that.$menu.find('.selected a').focus();
}, 10);
}
});
this.$menu.on('click', 'li a', function(e) {
var clickedIndex = $(this).parent().index(),
prevValue = that.$element.val(),
prevIndex = that.$element.prop('selectedIndex');
//Dont close on multi choice menu
if (that.multiple) {
e.stopPropagation();
}
e.preventDefault();
//Dont run if we have been disabled
if (!that.isDisabled() && !$(this).parent().hasClass('disabled')) {
var $options = that.$element.find('option'),
$option = $options.eq(clickedIndex),
state = $option.prop('selected'),
$optgroup = $option.parent('optgroup'),
maxOptions = that.options.maxOptions,
maxOptionsGrp = $optgroup.data('maxOptions') || false;
//Deselect all others if not multi select box
if (!that.multiple) {
$options.prop('selected', false);
$option.prop('selected', true);
that.$menu.find('.selected').removeClass('selected');
that.setSelected(clickedIndex, true);
}
//Else toggle the one we have chosen if we are multi select.
else {
$option.prop('selected', !state);
that.setSelected(clickedIndex, !state);
if ((maxOptions !== false) || (maxOptionsGrp !== false)) {
var maxReached = maxOptions < $options.filter(':selected').length,
maxReachedGrp = maxOptionsGrp < $optgroup.find('option:selected').length,
maxOptionsArr = that.options.maxOptionsText,
maxTxt = maxOptionsArr[0].replace('{n}', maxOptions),
maxTxtGrp = maxOptionsArr[1].replace('{n}', maxOptionsGrp),
$notify = $('<div class="notify"></div>');
if ((maxOptions && maxReached) || (maxOptionsGrp && maxReachedGrp)) {
// If {var} is set in array, replace it
if (maxOptionsArr[2]) {
maxTxt = maxTxt.replace('{var}', maxOptionsArr[2][maxOptions > 1 ? 0 : 1]);
maxTxtGrp = maxTxtGrp.replace('{var}', maxOptionsArr[2][maxOptionsGrp > 1 ? 0 : 1]);
}
$option.prop('selected', false);
that.$menu.append($notify);
if (maxOptions && maxReached) {
$notify.append($('<div>' + maxTxt + '</div>'));
that.$element.trigger('maxReached.bs.select');
}
if (maxOptionsGrp && maxReachedGrp) {
$notify.append($('<div>' + maxTxtGrp + '</div>'));
that.$element.trigger('maxReachedGrp.bs.select');
}
setTimeout(function() {
that.setSelected(clickedIndex, false);
}, 10);
$notify.delay(750).fadeOut(300, function() { $(this).remove(); });
}
}
}
if (!that.multiple) {
that.$button.focus();
} else if (that.options.liveSearch) {
that.$searchbox.focus();
}
// Trigger select 'change'
if ((prevValue != that.$element.val() && that.multiple) || (prevIndex != that.$element.prop('selectedIndex') && !that.multiple)) {
that.$element.change();
}
}
});
this.$menu.on('click', 'li.disabled a, li dt, li .div-contain, .popover-title, .popover-title :not(.close)', function(e) {
if (e.target == this) {
e.preventDefault();
e.stopPropagation();
if (!that.options.liveSearch) {
that.$button.focus();
} else {
that.$searchbox.focus();
}
}
});
this.$menu.on('click', '.popover-title .close', function() {
that.$button.focus();
});
this.$searchbox.on('click', function(e) {
e.stopPropagation();
});
this.$menu.on('click', '.actions-btn', function(e) {
if (that.options.liveSearch) {
that.$searchbox.focus();
} else {
that.$button.focus();
}
e.preventDefault();
e.stopPropagation();
if ($(this).is('.bs-select-all')) {
that.selectAll();
} else {
that.deselectAll();
}
that.$element.change();
});
this.$element.change(function() {
that.render(false);
});
},
liveSearchListener: function() {
var that = this,
no_results = $('<li class="no-results"></li>');
this.$newElement.on('click.dropdown.data-api', function() {
that.$menu.find('.active').removeClass('active');
if (!!that.$searchbox.val()) {
that.$searchbox.val('');
that.$lis.not('.is-hidden').removeClass('hide');
if (!!no_results.parent().length) no_results.remove();
}
if (!that.multiple) that.$menu.find('.selected').addClass('active');
setTimeout(function() {
that.$searchbox.focus();
}, 10);
});
this.$searchbox.on('input propertychange', function() {
if (that.$searchbox.val()) {
that.$lis.not('.is-hidden').removeClass('hide').find('a').not(':icontains(' + that.$searchbox.val() + ')').parent().addClass('hide');
if (!that.$menu.find('li').filter(':visible:not(.no-results)').length) {
if (!!no_results.parent().length) no_results.remove();
no_results.html(that.options.noneResultsText + ' "'+ that.$searchbox.val() + '"').show();
that.$menu.find('li').last().after(no_results);
} else if (!!no_results.parent().length) {
no_results.remove();
}
} else {
that.$lis.not('.is-hidden').removeClass('hide');
if (!!no_results.parent().length) no_results.remove();
}
that.$menu.find('li.active').removeClass('active');
that.$menu.find('li').filter(':visible:not(.divider)').eq(0).addClass('active').find('a').focus();
$(this).focus();
});
this.$menu.on('mouseenter', 'a', function(e) {
that.$menu.find('.active').removeClass('active');
$(e.currentTarget).parent().not('.disabled').addClass('active');
});
this.$menu.on('mouseleave', 'a', function() {
that.$menu.find('.active').removeClass('active');
});
},
val: function(value) {
if (value !== undefined) {
this.$element.val( value );
this.$element.change();
return this.$element;
} else {
return this.$element.val();
}
},
selectAll: function() {
if (this.$lis == null) this.$lis = this.$menu.find('li');
this.$element.find('option:enabled').prop('selected', true);
$(this.$lis).filter(':not(.disabled)').addClass('selected');
this.render(false);
},
deselectAll: function() {
if (this.$lis == null) this.$lis = this.$menu.find('li');
this.$element.find('option:enabled').prop('selected', false);
$(this.$lis).filter(':not(.disabled)').removeClass('selected');
this.render(false);
},
keydown: function(e) {
var $this,
$items,
$parent,
index,
next,
first,
last,
prev,
nextPrev,
that,
prevIndex,
isActive,
keyCodeMap = {
32:' ', 48:'0', 49:'1', 50:'2', 51:'3', 52:'4', 53:'5', 54:'6', 55:'7', 56:'8', 57:'9', 59:';',
65:'a', 66:'b', 67:'c', 68:'d', 69:'e', 70:'f', 71:'g', 72:'h', 73:'i', 74:'j', 75:'k', 76:'l',
77:'m', 78:'n', 79:'o', 80:'p', 81:'q', 82:'r', 83:'s', 84:'t', 85:'u', 86:'v', 87:'w', 88:'x',
89:'y', 90:'z', 96:'0', 97:'1', 98:'2', 99:'3', 100:'4', 101:'5', 102:'6', 103:'7', 104:'8', 105:'9'
};
$this = $(this);
$parent = $this.parent();
if ($this.is('input')) $parent = $this.parent().parent();
that = $parent.data('this');
if (that.options.liveSearch) $parent = $this.parent().parent();
if (that.options.container) $parent = that.$menu;
$items = $('[role=menu] li:not(.divider) a', $parent);
isActive = that.$menu.parent().hasClass('open');
if (!isActive && /([0-9]|[A-z])/.test(String.fromCharCode(e.keyCode))) {
if (!that.options.container) {
that.setSize();
that.$menu.parent().addClass('open');
isActive = that.$menu.parent().hasClass('open');
} else {
that.$newElement.trigger('click');
}
that.$searchbox.focus();
}
if (that.options.liveSearch) {
if (/(^9$|27)/.test(e.keyCode) && isActive && that.$menu.find('.active').length === 0) {
e.preventDefault();
that.$menu.parent().removeClass('open');
that.$button.focus();
}
$items = $('[role=menu] li:not(.divider):visible', $parent);
if (!$this.val() && !/(38|40)/.test(e.keyCode)) {
if ($items.filter('.active').length === 0) {
$items = that.$newElement.find('li').filter(':icontains(' + keyCodeMap[e.keyCode] + ')');
}
}
}
if (!$items.length) return;
if (/(38|40)/.test(e.keyCode)) {
index = $items.index($items.filter(':focus'));
first = $items.parent(':not(.disabled):visible').first().index();
last = $items.parent(':not(.disabled):visible').last().index();
next = $items.eq(index).parent().nextAll(':not(.disabled):visible').eq(0).index();
prev = $items.eq(index).parent().prevAll(':not(.disabled):visible').eq(0).index();
nextPrev = $items.eq(next).parent().prevAll(':not(.disabled):visible').eq(0).index();
if (that.options.liveSearch) {
$items.each(function(i) {
if ($(this).is(':not(.disabled)')) {
$(this).data('index', i);
}
});
index = $items.index($items.filter('.active'));
first = $items.filter(':not(.disabled):visible').first().data('index');
last = $items.filter(':not(.disabled):visible').last().data('index');
next = $items.eq(index).nextAll(':not(.disabled):visible').eq(0).data('index');
prev = $items.eq(index).prevAll(':not(.disabled):visible').eq(0).data('index');
nextPrev = $items.eq(next).prevAll(':not(.disabled):visible').eq(0).data('index');
}
prevIndex = $this.data('prevIndex');
if (e.keyCode == 38) {
if (that.options.liveSearch) index -= 1;
if (index != nextPrev && index > prev) index = prev;
if (index < first) index = first;
if (index == prevIndex) index = last;
}
if (e.keyCode == 40) {
if (that.options.liveSearch) index += 1;
if (index == -1) index = 0;
if (index != nextPrev && index < next) index = next;
if (index > last) index = last;
if (index == prevIndex) index = first;
}
$this.data('prevIndex', index);
if (!that.options.liveSearch) {
$items.eq(index).focus();
} else {
e.preventDefault();
if (!$this.is('.dropdown-toggle')) {
$items.removeClass('active');
$items.eq(index).addClass('active').find('a').focus();
$this.focus();
}
}
} else if (!$this.is('input')) {
var keyIndex = [],
count,
prevKey;
$items.each(function() {
if ($(this).parent().is(':not(.disabled)')) {
if ($.trim($(this).text().toLowerCase()).substring(0,1) == keyCodeMap[e.keyCode]) {
keyIndex.push($(this).parent().index());
}
}
});
count = $(document).data('keycount');
count++;
$(document).data('keycount',count);
prevKey = $.trim($(':focus').text().toLowerCase()).substring(0,1);
if (prevKey != keyCodeMap[e.keyCode]) {
count = 1;
$(document).data('keycount', count);
} else if (count >= keyIndex.length) {
$(document).data('keycount', 0);
if (count > keyIndex.length) count = 1;
}
$items.eq(keyIndex[count - 1]).focus();
}
// Select focused option if "Enter", "Spacebar", "Tab" are pressed inside the menu.
if (/(13|32|^9$)/.test(e.keyCode) && isActive) {
if (!/(32)/.test(e.keyCode)) e.preventDefault();
if (!that.options.liveSearch) {
$(':focus').click();
} else if (!/(32)/.test(e.keyCode)) {
that.$menu.find('.active a').click();
$this.focus();
}
$(document).data('keycount',0);
}
if ((/(^9$|27)/.test(e.keyCode) && isActive && (that.multiple || that.options.liveSearch)) || (/(27)/.test(e.keyCode) && !isActive)) {
that.$menu.parent().removeClass('open');
that.$button.focus();
}
},
hide: function() {
this.$newElement.hide();
},
show: function() {
this.$newElement.show();
},
destroy: function() {
this.$newElement.remove();
this.$element.remove();
}
};
$.fn.selectpicker = function(option, event) {
//get the args of the outer function..
var args = arguments;
var value;
var chain = this.each(function() {
if ($(this).is('select')) {
var $this = $(this),
data = $this.data('selectpicker'),
options = typeof option == 'object' && option;
if (!data) {
$this.data('selectpicker', (data = new Selectpicker(this, options, event)));
} else if (options) {
for(var i in options) {
data.options[i] = options[i];
}
}
if (typeof option == 'string') {
//Copy the value of option, as once we shift the arguments
//it also shifts the value of option.
var property = option;
if (data[property] instanceof Function) {
[].shift.apply(args);
value = data[property].apply(data, args);
} else {
value = data.options[property];
}
}
}
});
if (value !== undefined) {
return value;
} else {
return chain;
}
};
$.fn.selectpicker.defaults = {
style: 'btn-default',
size: 'auto',
title: null,
selectedTextFormat : 'values',
noneSelectedText : 'Nothing selected',
noneResultsText : 'No results match',
countSelectedText: '{0} of {1} selected',
maxOptionsText: ['Limit reached ({n} {var} max)', 'Group limit reached ({n} {var} max)', ['items','item']],
width: false,
container: false,
hideDisabled: false,
showSubtext: false,
showIcon: true,
showContent: true,
dropupAuto: true,
header: false,
liveSearch: false,
actionsBox: false,
multipleSeparator: ', ',
iconBase: 'glyphicon',
tickIcon: 'glyphicon-ok',
maxOptions: false
};
$(document)
.data('keycount', 0)
.on('keydown', '.bootstrap-select [data-toggle=dropdown], .bootstrap-select [role=menu], .bootstrap-select-searchbox input', Selectpicker.prototype.keydown)
.on('focusin.modal', '.bootstrap-select [data-toggle=dropdown], .bootstrap-select [role=menu], .bootstrap-select-searchbox input', function (e) { e.stopPropagation(); });
}(window.jQuery);
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+5 -4
View File
@@ -1,10 +1,11 @@
{
"name": "bootstrap-select",
"main": [
"bootstrap-select.css",
"bootstrap-select.js"
"less/bootstrap-select.less",
"dist/css/bootstrap-select.css",
"dist/js/bootstrap-select.js"
],
"version": "1.5.4",
"version": "1.6.0",
"homepage": "https://github.com/silviomoreto/bootstrap-select",
"authors": [
"silviomoreto"
@@ -16,7 +17,7 @@
"replacement"
],
"dependencies": {
"jquery": ">=1.7"
"jquery": ">=1.8"
},
"license": "MIT",
"ignore": [
+14 -14
View File
@@ -1,17 +1,17 @@
{
"name": "bootstrap-select/bootstrap-select",
"description": "A custom <select> for Bootstrap using button dropdown as replacement",
"keywords": ["form", "bootstrap", "select", "replacement"],
"homepage": "https://github.com/silviomoreto/bootstrap-select",
"version": "1.5.4",
"authors": [
{
"name": "Silvio Moreto",
"homepage": "https://github.com/silviomoreto/"
}
],
"license": "MIT",
"suggest": {
"components/jquery": "1.8.*"
"name": "bootstrap-select/bootstrap-select",
"description": "A custom <select> for Bootstrap using button dropdown as replacement",
"keywords": ["form", "bootstrap", "select", "replacement"],
"homepage": "https://github.com/silviomoreto/bootstrap-select",
"version": "1.6.0",
"authors": [
{
"name": "Silvio Moreto",
"homepage": "https://github.com/silviomoreto/"
}
],
"license": "MIT",
"suggest": {
"components/jquery": "1.8.*"
}
}
@@ -0,0 +1,269 @@
/*!
* Bootstrap-select v1.6.0 (http://silviomoreto.github.io/bootstrap-select/)
*
* Copyright 2013-2014 bootstrap-select
* Licensed under MIT (https://github.com/silviomoreto/bootstrap-select/blob/master/LICENSE)
*/
.bootstrap-select {
/*width: 220px\9; IE8 and below*/
width: 220px \0;
/*IE9 and below*/
}
.bootstrap-select > .btn {
width: 100%;
padding-right: 25px;
}
.error .bootstrap-select .btn {
border: 1px solid #b94a48;
}
.bootstrap-select.fit-width {
width: auto !important;
}
.bootstrap-select.btn-group:not(.input-group-btn),
.bootstrap-select.btn-group[class*="span"] {
float: none;
display: inline-block;
margin-bottom: 10px;
margin-left: 0;
}
.bootstrap-select.form-control {
margin-bottom: 0;
padding: 0;
border: none;
}
.bootstrap-select.btn-group.pull-right,
.bootstrap-select.btn-group[class*="span"].pull-right,
.row-fluid .bootstrap-select.btn-group[class*="span"].pull-right {
float: right;
}
.form-search .bootstrap-select.btn-group,
.form-inline .bootstrap-select.btn-group,
.form-horizontal .bootstrap-select.btn-group,
.form-group .bootstrap-select.btn-group {
margin-bottom: 0;
}
.input-append .bootstrap-select.btn-group {
margin-left: -1px;
}
.input-prepend .bootstrap-select.btn-group {
margin-right: -1px;
}
.bootstrap-select:not([class*="span"]):not([class*="col-"]):not([class*="form-control"]):not(.input-group-btn) {
width: 220px;
}
.bootstrap-select.form-control:not([class*="span"]) {
width: 100%;
}
.bootstrap-select.show-menu-arrow.open > .btn {
z-index: 2051;
}
.bootstrap-select .btn:focus {
outline: thin dotted #333333 !important;
outline: 5px auto -webkit-focus-ring-color !important;
outline-offset: -2px;
}
.bootstrap-select.btn-group .btn .filter-option {
display: inline-block;
overflow: hidden;
width: 100%;
text-align: left;
}
.bootstrap-select.btn-group .btn .caret {
position: absolute;
top: 50%;
right: 12px;
margin-top: -2px;
vertical-align: middle;
}
.bootstrap-select.btn-group > .disabled,
.bootstrap-select.btn-group .dropdown-menu li.disabled > a {
cursor: not-allowed;
}
.bootstrap-select.btn-group > .disabled:focus {
outline: none !important;
}
.bootstrap-select.btn-group[class*="span"] .btn {
width: 100%;
}
.bootstrap-select.btn-group .dropdown-menu {
min-width: 100%;
z-index: 2000;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.bootstrap-select.btn-group .dropdown-menu.inner {
position: static;
border: 0;
padding: 0;
margin: 0;
-webkit-border-radius: 0;
-moz-border-radius: 0;
border-radius: 0;
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
}
.bootstrap-select.btn-group .dropdown-menu dt {
display: block;
padding: 3px 20px;
cursor: default;
}
.bootstrap-select.btn-group .div-contain {
overflow: hidden;
}
.bootstrap-select.btn-group .dropdown-menu li {
position: relative;
}
.bootstrap-select.btn-group .dropdown-menu li > a.opt {
position: relative;
padding-left: 35px;
}
.bootstrap-select.btn-group .dropdown-menu li > a {
cursor: pointer;
}
.bootstrap-select.btn-group .dropdown-menu li > dt small {
font-weight: normal;
}
.bootstrap-select.btn-group.show-tick .dropdown-menu li.selected a i.check-mark {
position: absolute;
display: inline-block;
right: 15px;
margin-top: 2.5px;
}
.bootstrap-select.btn-group .dropdown-menu li a i.check-mark {
display: none;
}
.bootstrap-select.btn-group .dropdown-menu li a span.text {
display: inline-block;
}
.bootstrap-select.btn-group.show-tick .dropdown-menu li a span.text {
margin-right: 34px;
}
.bootstrap-select.btn-group .dropdown-menu li small {
padding-left: 0.5em;
}
.bootstrap-select.btn-group .dropdown-menu li:not(.disabled) > a:hover small,
.bootstrap-select.btn-group .dropdown-menu li:not(.disabled) > a:focus small,
.bootstrap-select.btn-group .dropdown-menu li.active:not(.disabled) > a small {
color: #64b1d8;
color: rgba(100, 177, 216, 0.4);
}
.bootstrap-select.btn-group .dropdown-menu li > dt small {
font-weight: normal;
}
.bootstrap-select.show-menu-arrow .dropdown-toggle:before {
content: '';
border-left: 7px solid transparent;
border-right: 7px solid transparent;
border-bottom-width: 7px;
border-bottom-style: solid;
border-bottom-color: #cccccc;
border-bottom-color: rgba(204, 204, 204, 0.2);
position: absolute;
bottom: -4px;
left: 9px;
display: none;
}
.bootstrap-select.show-menu-arrow .dropdown-toggle:after {
content: '';
border-left: 6px solid transparent;
border-right: 6px solid transparent;
border-bottom: 6px solid white;
position: absolute;
bottom: -4px;
left: 10px;
display: none;
}
.bootstrap-select.show-menu-arrow.dropup .dropdown-toggle:before {
bottom: auto;
top: -3px;
border-bottom: 0;
border-top-width: 7px;
border-top-style: solid;
border-top-color: #cccccc;
border-top-color: rgba(204, 204, 204, 0.2);
}
.bootstrap-select.show-menu-arrow.dropup .dropdown-toggle:after {
bottom: auto;
top: -3px;
border-top: 6px solid #FFFFFF;
border-bottom: 0;
}
.bootstrap-select.show-menu-arrow.pull-right .dropdown-toggle:before {
right: 12px;
left: auto;
}
.bootstrap-select.show-menu-arrow.pull-right .dropdown-toggle:after {
right: 13px;
left: auto;
}
.bootstrap-select.show-menu-arrow.open > .dropdown-toggle:before,
.bootstrap-select.show-menu-arrow.open > .dropdown-toggle:after {
display: block;
}
.bootstrap-select.btn-group .no-results {
padding: 3px;
background: #f5f5f5;
margin: 0 5px;
}
.bootstrap-select.btn-group .dropdown-menu .notify {
position: absolute;
bottom: 5px;
width: 96%;
margin: 0 2%;
min-height: 26px;
padding: 3px 5px;
background: #f5f5f5;
border: 1px solid #e3e3e3;
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
pointer-events: none;
opacity: 0.9;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.bootstrap-select.btn-group.fit-width .btn .filter-option {
position: static;
}
.bootstrap-select.btn-group.fit-width .btn .caret {
position: static;
top: auto;
margin-top: -1px;
}
.control-group.error .bootstrap-select .dropdown-toggle {
border-color: #b94a48;
}
.bootstrap-select-searchbox,
.bootstrap-select .bs-actionsbox {
padding: 4px 8px;
}
.bootstrap-select .bs-actionsbox {
float: left;
width: 100%;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.bootstrap-select .bs-actionsbox .btn-group button {
width: 50%;
}
.bootstrap-select-searchbox + .bs-actionsbox {
padding: 0 8px 4px;
}
.bootstrap-select-searchbox input,
.bootstrap-select-searchbox .form-control {
margin-bottom: 0;
width: 100%;
}
.mobile-device {
position: absolute;
top: 0;
left: 0;
display: block !important;
width: 100%;
height: 100% !important;
opacity: 0;
}
/*# sourceMappingURL=bootstrap-select.css.map */
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,15 @@
/*!
* Bootstrap-select v1.6.0 (http://silviomoreto.github.io/bootstrap-select/)
*
* Copyright 2013-2014 bootstrap-select
* Licensed under MIT (https://github.com/silviomoreto/bootstrap-select/blob/master/LICENSE)
*/
(function ($) {
$.fn.selectpicker.defaults = {
noneSelectedText: 'Nic není vybráno',
noneResultsText: 'Žádné výsledky',
countSelectedText: 'Označeno {0} z {1}',
maxOptionsText: ['Limit překročen ({n} {var} max)', 'Limit skupiny překročen ({n} {var} max)', ['položek', 'položka']],
multipleSeparator: ', '
};
}(jQuery));
@@ -0,0 +1,7 @@
/*!
* Bootstrap-select v1.6.0 (http://silviomoreto.github.io/bootstrap-select/)
*
* Copyright 2013-2014 bootstrap-select
* Licensed under MIT (https://github.com/silviomoreto/bootstrap-select/blob/master/LICENSE)
*/
!function(a){a.fn.selectpicker.defaults={noneSelectedText:"Nic není vybráno",noneResultsText:"Žádné výsledky",countSelectedText:"Označeno {0} z {1}",maxOptionsText:["Limit překročen ({n} {var} max)","Limit skupiny překročen ({n} {var} max)",["položek","položka"]],multipleSeparator:", "}}(jQuery);
@@ -0,0 +1,15 @@
/*!
* Bootstrap-select v1.6.0 (http://silviomoreto.github.io/bootstrap-select/)
*
* Copyright 2013-2014 bootstrap-select
* Licensed under MIT (https://github.com/silviomoreto/bootstrap-select/blob/master/LICENSE)
*/
(function ($) {
$.fn.selectpicker.defaults = {
noneSelectedText: 'Bitte wählen...',
noneResultsText: 'Keine Ergebnisse für',
countSelectedText: '{0} von {1} ausgewählt',
maxOptionsText: ['Limit erreicht ({n} {var} max.)', 'Gruppen-Limit erreicht ({n} {var} max.)', ['Eintrag', 'Einträge']],
multipleSeparator: ', '
};
}(jQuery));
@@ -0,0 +1,7 @@
/*!
* Bootstrap-select v1.6.0 (http://silviomoreto.github.io/bootstrap-select/)
*
* Copyright 2013-2014 bootstrap-select
* Licensed under MIT (https://github.com/silviomoreto/bootstrap-select/blob/master/LICENSE)
*/
!function(a){a.fn.selectpicker.defaults={noneSelectedText:"Bitte wählen...",noneResultsText:"Keine Ergebnisse für",countSelectedText:"{0} von {1} ausgewählt",maxOptionsText:["Limit erreicht ({n} {var} max.)","Gruppen-Limit erreicht ({n} {var} max.)",["Eintrag","Einträge"]],multipleSeparator:", "}}(jQuery);
@@ -0,0 +1,15 @@
/*!
* Bootstrap-select v1.6.0 (http://silviomoreto.github.io/bootstrap-select/)
*
* Copyright 2013-2014 bootstrap-select
* Licensed under MIT (https://github.com/silviomoreto/bootstrap-select/blob/master/LICENSE)
*/
(function ($) {
$.fn.selectpicker.defaults = {
noneSelectedText: 'Nothing selected',
noneResultsText: 'No results match',
countSelectedText: '{0} of {1} selected',
maxOptionsText: ['Limit reached ({n} {var} max)', 'Group limit reached ({n} {var} max)', ['items', 'item']],
multipleSeparator: ', '
};
}(jQuery));
@@ -0,0 +1,7 @@
/*!
* Bootstrap-select v1.6.0 (http://silviomoreto.github.io/bootstrap-select/)
*
* Copyright 2013-2014 bootstrap-select
* Licensed under MIT (https://github.com/silviomoreto/bootstrap-select/blob/master/LICENSE)
*/
!function(a){a.fn.selectpicker.defaults={noneSelectedText:"Nothing selected",noneResultsText:"No results match",countSelectedText:"{0} of {1} selected",maxOptionsText:["Limit reached ({n} {var} max)","Group limit reached ({n} {var} max)",["items","item"]],multipleSeparator:", "}}(jQuery);
@@ -0,0 +1,15 @@
/*!
* Bootstrap-select v1.6.0 (http://silviomoreto.github.io/bootstrap-select/)
*
* Copyright 2013-2014 bootstrap-select
* Licensed under MIT (https://github.com/silviomoreto/bootstrap-select/blob/master/LICENSE)
*/
(function ($) {
$.fn.selectpicker.defaults = {
noneSelectedText: 'No hay selección',
noneResultsText: 'No hay resultados',
countSelectedText: 'Seleccionados {0} de {1}',
maxOptionsText: ['Límite alcanzado ({n} {var} max)', 'Límite del grupo alcanzado({n} {var} max)', ['elementos', 'element']],
multipleSeparator: ', '
};
}(jQuery));
@@ -0,0 +1,7 @@
/*!
* Bootstrap-select v1.6.0 (http://silviomoreto.github.io/bootstrap-select/)
*
* Copyright 2013-2014 bootstrap-select
* Licensed under MIT (https://github.com/silviomoreto/bootstrap-select/blob/master/LICENSE)
*/
!function(a){a.fn.selectpicker.defaults={noneSelectedText:"No hay selección",noneResultsText:"No hay resultados",countSelectedText:"Seleccionados {0} de {1}",maxOptionsText:["Límite alcanzado ({n} {var} max)","Límite del grupo alcanzado({n} {var} max)",["elementos","element"]],multipleSeparator:", "}}(jQuery);
@@ -0,0 +1,15 @@
/*!
* Bootstrap-select v1.6.0 (http://silviomoreto.github.io/bootstrap-select/)
*
* Copyright 2013-2014 bootstrap-select
* Licensed under MIT (https://github.com/silviomoreto/bootstrap-select/blob/master/LICENSE)
*/
(function ($) {
$.fn.selectpicker.defaults = {
noneSelectedText: 'Hautapenik ez',
noneResultsText: 'Emaitzarik ez',
countSelectedText: '{1}(e)tik {0} hautatuta',
maxOptionsText: ['Mugara iritsita ({n} {var} gehienez)', 'Taldearen mugara iritsita ({n} {var} gehienez)', ['elementu', 'elementu']],
multipleSeparator: ', '
};
}(jQuery));
@@ -0,0 +1,7 @@
/*!
* Bootstrap-select v1.6.0 (http://silviomoreto.github.io/bootstrap-select/)
*
* Copyright 2013-2014 bootstrap-select
* Licensed under MIT (https://github.com/silviomoreto/bootstrap-select/blob/master/LICENSE)
*/
!function(a){a.fn.selectpicker.defaults={noneSelectedText:"Hautapenik ez",noneResultsText:"Emaitzarik ez",countSelectedText:"{1}(e)tik {0} hautatuta",maxOptionsText:["Mugara iritsita ({n} {var} gehienez)","Taldearen mugara iritsita ({n} {var} gehienez)",["elementu","elementu"]],multipleSeparator:", "}}(jQuery);
@@ -0,0 +1,15 @@
/*!
* Bootstrap-select v1.6.0 (http://silviomoreto.github.io/bootstrap-select/)
*
* Copyright 2013-2014 bootstrap-select
* Licensed under MIT (https://github.com/silviomoreto/bootstrap-select/blob/master/LICENSE)
*/
(function ($) {
$.fn.selectpicker.defaults = {
noneSelectedText: 'Aucune s&eacute;lection',
noneResultsText: 'Aucun r&eacute;sultat',
countSelectedText: '{0} sur {1} s&eacute;lection(s)',
maxOptionsText: ['Limite atteinte ({n} {var} max)', 'Limite du groupe atteinte ({n} {var} max)', ['&eacute;l&eacute;ments', '&eacute;l&eacute;ment']],
multipleSeparator: ', '
};
}(jQuery));
@@ -0,0 +1,7 @@
/*!
* Bootstrap-select v1.6.0 (http://silviomoreto.github.io/bootstrap-select/)
*
* Copyright 2013-2014 bootstrap-select
* Licensed under MIT (https://github.com/silviomoreto/bootstrap-select/blob/master/LICENSE)
*/
!function(a){a.fn.selectpicker.defaults={noneSelectedText:"Aucune s&eacute;lection",noneResultsText:"Aucun r&eacute;sultat",countSelectedText:"{0} sur {1} s&eacute;lection(s)",maxOptionsText:["Limite atteinte ({n} {var} max)","Limite du groupe atteinte ({n} {var} max)",["&eacute;l&eacute;ments","&eacute;l&eacute;ment"]],multipleSeparator:", "}}(jQuery);
@@ -0,0 +1,15 @@
/*!
* Bootstrap-select v1.6.0 (http://silviomoreto.github.io/bootstrap-select/)
*
* Copyright 2013-2014 bootstrap-select
* Licensed under MIT (https://github.com/silviomoreto/bootstrap-select/blob/master/LICENSE)
*/
(function ($) {
$.fn.selectpicker.defaults = {
noneSelectedText: 'Nessuna selezione',
noneResultsText: 'Nessun risultato',
countSelectedText: 'Selezionati {0} di {1}',
maxOptionsText: ['Limite raggiunto ({n} {var} max)', 'Limite del gruppo raggiunto ({n} {var} max)', ['elementi', 'elemento']],
multipleSeparator: ', '
};
}(jQuery));
@@ -0,0 +1,7 @@
/*!
* Bootstrap-select v1.6.0 (http://silviomoreto.github.io/bootstrap-select/)
*
* Copyright 2013-2014 bootstrap-select
* Licensed under MIT (https://github.com/silviomoreto/bootstrap-select/blob/master/LICENSE)
*/
!function(a){a.fn.selectpicker.defaults={noneSelectedText:"Nessuna selezione",noneResultsText:"Nessun risultato",countSelectedText:"Selezionati {0} di {1}",maxOptionsText:["Limite raggiunto ({n} {var} max)","Limite del gruppo raggiunto ({n} {var} max)",["elementi","elemento"]],multipleSeparator:", "}}(jQuery);
@@ -0,0 +1,15 @@
/*!
* Bootstrap-select v1.6.0 (http://silviomoreto.github.io/bootstrap-select/)
*
* Copyright 2013-2014 bootstrap-select
* Licensed under MIT (https://github.com/silviomoreto/bootstrap-select/blob/master/LICENSE)
*/
(function ($) {
$.fn.selectpicker.defaults = {
noneSelectedText: 'Niets geselecteerd',
noneResultsText: 'Geen resultaten gevonden voor',
countSelectedText: '{0} van {1} geselecteerd',
maxOptionsText: ['Limiet bereikt ({n} {var} max)', 'Groep limiet bereikt ({n} {var} max)', ['items', 'item']],
multipleSeparator: ', '
};
}(jQuery));
@@ -0,0 +1,7 @@
/*!
* Bootstrap-select v1.6.0 (http://silviomoreto.github.io/bootstrap-select/)
*
* Copyright 2013-2014 bootstrap-select
* Licensed under MIT (https://github.com/silviomoreto/bootstrap-select/blob/master/LICENSE)
*/
!function(a){a.fn.selectpicker.defaults={noneSelectedText:"Niets geselecteerd",noneResultsText:"Geen resultaten gevonden voor",countSelectedText:"{0} van {1} geselecteerd",maxOptionsText:["Limiet bereikt ({n} {var} max)","Groep limiet bereikt ({n} {var} max)",["items","item"]],multipleSeparator:", "}}(jQuery);
@@ -0,0 +1,15 @@
/*!
* Bootstrap-select v1.6.0 (http://silviomoreto.github.io/bootstrap-select/)
*
* Copyright 2013-2014 bootstrap-select
* Licensed under MIT (https://github.com/silviomoreto/bootstrap-select/blob/master/LICENSE)
*/
(function ($) {
$.fn.selectpicker.defaults = {
noneSelectedText: 'Nic nie zaznaczono',
noneResultsText: 'Brak wyników wyszukiwania',
countSelectedText: 'Zaznaczono {0} z {1}',
maxOptionsText: ['Osiągnięto limit ({n} {var} max)', 'Limit grupy osiągnięty ({n} {var} max)', ['elementy', 'element']],
multipleSeparator: ', '
};
}(jQuery));
@@ -0,0 +1,7 @@
/*!
* Bootstrap-select v1.6.0 (http://silviomoreto.github.io/bootstrap-select/)
*
* Copyright 2013-2014 bootstrap-select
* Licensed under MIT (https://github.com/silviomoreto/bootstrap-select/blob/master/LICENSE)
*/
!function(a){a.fn.selectpicker.defaults={noneSelectedText:"Nic nie zaznaczono",noneResultsText:"Brak wyników wyszukiwania",countSelectedText:"Zaznaczono {0} z {1}",maxOptionsText:["Osiągnięto limit ({n} {var} max)","Limit grupy osiągnięty ({n} {var} max)",["elementy","element"]],multipleSeparator:", "}}(jQuery);
@@ -0,0 +1,15 @@
/*!
* Bootstrap-select v1.6.0 (http://silviomoreto.github.io/bootstrap-select/)
*
* Copyright 2013-2014 bootstrap-select
* Licensed under MIT (https://github.com/silviomoreto/bootstrap-select/blob/master/LICENSE)
*/
(function ($) {
$.fn.selectpicker.defaults = {
noneSelectedText: 'Nada selecionado',
noneResultsText: 'Nada encontrado contendo',
countSelectedText: 'Selecionado {0} de {1}',
maxOptionsText: ['Limite excedido (máx. {n} {var})', 'Limite do grupo excedido (máx. {n} {var})', ['itens', 'item']],
multipleSeparator: ', '
};
}(jQuery));
@@ -0,0 +1,7 @@
/*!
* Bootstrap-select v1.6.0 (http://silviomoreto.github.io/bootstrap-select/)
*
* Copyright 2013-2014 bootstrap-select
* Licensed under MIT (https://github.com/silviomoreto/bootstrap-select/blob/master/LICENSE)
*/
!function(a){a.fn.selectpicker.defaults={noneSelectedText:"Nada selecionado",noneResultsText:"Nada encontrado contendo",countSelectedText:"Selecionado {0} de {1}",maxOptionsText:["Limite excedido (máx. {n} {var})","Limite do grupo excedido (máx. {n} {var})",["itens","item"]],multipleSeparator:", "}}(jQuery);
@@ -0,0 +1,15 @@
/*!
* Bootstrap-select v1.6.0 (http://silviomoreto.github.io/bootstrap-select/)
*
* Copyright 2013-2014 bootstrap-select
* Licensed under MIT (https://github.com/silviomoreto/bootstrap-select/blob/master/LICENSE)
*/
(function ($) {
$.fn.selectpicker.defaults = {
noneSelectedText: 'Ничего не выбрано',
noneResultsText: 'Не найдено совпадений',
countSelectedText: 'Выбрано {0} из {1}',
maxOptionsText: ['Достигнут предел ({n} {var} максимум)', 'Достигнут предел в группе ({n} {var} максимум)', ['items', 'item']],
multipleSeparator: ', '
};
}(jQuery));
@@ -0,0 +1,7 @@
/*!
* Bootstrap-select v1.6.0 (http://silviomoreto.github.io/bootstrap-select/)
*
* Copyright 2013-2014 bootstrap-select
* Licensed under MIT (https://github.com/silviomoreto/bootstrap-select/blob/master/LICENSE)
*/
!function(a){a.fn.selectpicker.defaults={noneSelectedText:"Ничего не выбрано",noneResultsText:"Не найдено совпадений",countSelectedText:"Выбрано {0} из {1}",maxOptionsText:["Достигнут предел ({n} {var} максимум)","Достигнут предел в группе ({n} {var} максимум)",["items","item"]],multipleSeparator:", "}}(jQuery);
@@ -0,0 +1,15 @@
/*!
* Bootstrap-select v1.6.0 (http://silviomoreto.github.io/bootstrap-select/)
*
* Copyright 2013-2014 bootstrap-select
* Licensed under MIT (https://github.com/silviomoreto/bootstrap-select/blob/master/LICENSE)
*/
(function ($) {
$.fn.selectpicker.defaults = {
noneSelectedText: '没有选中任何项',
noneResultsText: '没有找到匹配项',
countSelectedText: '选中{1}中的{0}项',
maxOptionsText: ['超出限制 (最多选择{n}项)', '组选择超出限制(最多选择{n}组)'],
multipleSeparator: ', '
};
}(jQuery));
@@ -0,0 +1,7 @@
/*!
* Bootstrap-select v1.6.0 (http://silviomoreto.github.io/bootstrap-select/)
*
* Copyright 2013-2014 bootstrap-select
* Licensed under MIT (https://github.com/silviomoreto/bootstrap-select/blob/master/LICENSE)
*/
!function(a){a.fn.selectpicker.defaults={noneSelectedText:"没有选中任何项",noneResultsText:"没有找到匹配项",countSelectedText:"选中{1}中的{0}项",maxOptionsText:["超出限制 (最多选择{n}项)","组选择超出限制(最多选择{n}组)"],multipleSeparator:", "}}(jQuery);
@@ -1,29 +0,0 @@
/*
* Translated default messages for bootstrap-select.
* Locale: CZ (Czech Republic)
* Region: EU
*/
(function($) {
$.fn.selectpicker.defaults = {
style: 'btn-default',
size: 'auto',
title: null,
selectedTextFormat : 'values',
noneSelectedText : 'Nic není výbráno',
noneResultsText : 'Žádné výsledky',
countSelectedText : 'Označeno {0} z {1}',
maxOptionsText: ['Limit překročen ({n} {var} max)', 'Limit skupiny překročen ({n} {var} max)', ['položek','položka']],
width: false,
container: false,
hideDisabled: false,
showSubtext: false,
showIcon: true,
showContent: true,
dropupAuto: true,
header: false,
liveSearch: false,
multipleSeparator: ', ',
iconBase: 'glyphicon',
tickIcon: 'glyphicon-ok'
};
}(jQuery));
@@ -1,6 +0,0 @@
/*
* Translated default messages for bootstrap-select.
* Locale: CZ (Czech Republic)
* Region: EU
*/
(function(e){e.fn.selectpicker.defaults={style:"btn-default",size:"auto",title:null,selectedTextFormat:"values",noneSelectedText:"Nic není výbráno",noneResultsText:"Žádné výsledky",countSelectedText:"Označeno {0} z {1}",maxOptionsText:["Limit překročen ({n} {var} max)","Limit skupiny překročen ({n} {var} max)",["položek","položka"]],width:false,container:false,hideDisabled:false,showSubtext:false,showIcon:true,showContent:true,dropupAuto:true,header:false,liveSearch:false,multipleSeparator:", ",iconBase:"glyphicon",tickIcon:"glyphicon-ok"}})(jQuery)
@@ -1,29 +0,0 @@
/*
* Translated default messages for bootstrap-select.
* Locale: DE (German, deutsch)
* Region: DE (Germany, Deutschland)
*/
(function($) {
$.fn.selectpicker.defaults = {
style: 'btn-default',
size: 'auto',
title: null,
selectedTextFormat : 'ausgewählt',
noneSelectedText : 'Bitte wählen...',
noneResultsText : 'Keine Ergebnisse für',
countSelectedText : '{0} von {1} ausgewählt',
maxOptionsText: ['Limit erreicht ({n} {var} max.)', 'Gruppen-Limit erreicht ({n} {var} max.)', ['Eintrag','Einträge']],
width: false,
container: false,
hideDisabled: false,
showSubtext: false,
showIcon: true,
showContent: true,
dropupAuto: true,
header: false,
liveSearch: false,
multipleSeparator: ', ',
iconBase: 'glyphicon',
tickIcon: 'glyphicon-ok'
};
}(jQuery));
@@ -1,6 +0,0 @@
/*
* Translated default messages for bootstrap-select.
* Locale: DE (German, deutsch)
* Region: DE (Germany, Deutschland)
*/
(function(e){e.fn.selectpicker.defaults={style:"btn-default",size:"auto",title:null,selectedTextFormat:"ausgewählt",noneSelectedText:"Bitte wählen...",noneResultsText:"Keine Ergebnisse für",countSelectedText:"{0} von {1} ausgewählt",maxOptionsText:["Limit erreicht ({n} {var} max.)","Gruppen-Limit erreicht ({n} {var} max.)",["Eintrag","Einträge"]],width:false,container:false,hideDisabled:false,showSubtext:false,showIcon:true,showContent:true,dropupAuto:true,header:false,liveSearch:false,multipleSeparator:", ",iconBase:"glyphicon",tickIcon:"glyphicon-ok"}})(jQuery)
@@ -1,29 +0,0 @@
/*
* Translated default messages for bootstrap-select.
* Locale: ES (Spanish)
* Region: CL (Chile)
*/
(function($) {
$.fn.selectpicker.defaults = {
style: 'btn-default',
size: 'auto',
title: null,
selectedTextFormat : 'values',
noneSelectedText : 'No hay selección',
noneResultsText : 'No hay resultados',
countSelectedText : 'Seleccionados {0} de {1}',
maxOptionsText: ['Límite alcanzado ({n} {var} max)', 'Límite del grupo alcanzado({n} {var} max)', ['elementos','element']],
width: false,
container: false,
hideDisabled: false,
showSubtext: false,
showIcon: true,
showContent: true,
dropupAuto: true,
header: false,
liveSearch: false,
multipleSeparator: ', ',
iconBase: 'glyphicon',
tickIcon: 'glyphicon-ok'
};
}(jQuery));
@@ -1,6 +0,0 @@
/*
* Translated default messages for bootstrap-select.
* Locale: ES (Spanish)
* Region: CL (Chile)
*/
(function(e){e.fn.selectpicker.defaults={style:"btn-default",size:"auto",title:null,selectedTextFormat:"values",noneSelectedText:"No hay selección",noneResultsText:"No hay resultados",countSelectedText:"Seleccionados {0} de {1}",maxOptionsText:["Límite alcanzado ({n} {var} max)","Límite del grupo alcanzado({n} {var} max)",["elementos","element"]],width:false,container:false,hideDisabled:false,showSubtext:false,showIcon:true,showContent:true,dropupAuto:true,header:false,liveSearch:false,multipleSeparator:", ",iconBase:"glyphicon",tickIcon:"glyphicon-ok"}})(jQuery)
@@ -1,30 +0,0 @@
/*
* Translated default messages for bootstrap-select.
* Locale: EU (Basque)
* Region:
*/
(function($) {
$.fn.selectpicker.defaults = {
style: 'btn-default',
size: 'auto',
title: null,
selectedTextFormat : 'values',
noneSelectedText : 'Hautapenik ez',
noneResultsText : 'Emaitzarik ez',
countSelectedText : '{1}(e)tik {0} hautatuta',
maxOptionsText: ['Mugara iritsita ({n} {var} gehienez)', 'Taldearen mugara iritsita ({n} {var} gehienez)', ['elementu','elementu']],
width: false,
container: false,
hideDisabled: false,
showSubtext: false,
showIcon: true,
showContent: true,
dropupAuto: true,
header: false,
liveSearch: false,
multipleSeparator: ', ',
iconBase: 'glyphicon',
tickIcon: 'glyphicon-ok'
};
}(jQuery));
@@ -1,6 +0,0 @@
/*
* Translated default messages for bootstrap-select.
* Locale: EU (Basque)
* Region:
*/
(function(e){e.fn.selectpicker.defaults={style:"btn-default",size:"auto",title:null,selectedTextFormat:"values",noneSelectedText:"Hautapenik ez",noneResultsText:"Emaitzarik ez",countSelectedText:"{1}(e)tik {0} hautatuta",maxOptionsText:["Mugara iritsita ({n} {var} gehienez)","Taldearen mugara iritsita ({n} {var} gehienez)",["elementu","elementu"]],width:false,container:false,hideDisabled:false,showSubtext:false,showIcon:true,showContent:true,dropupAuto:true,header:false,liveSearch:false,multipleSeparator:", ",iconBase:"glyphicon",tickIcon:"glyphicon-ok"}})(jQuery)
@@ -1,32 +0,0 @@
/*
* Translated default messages for bootstrap-select.
* Locale: IT (Italian; italiano)
* Region: IT (Italy; Italia)
* Author: Michele Beltrame <mb@cattlegrid.info>
*/
(function($) {
$.fn.selectpicker.defaults = {
style: 'btn-default',
size: 'auto',
title: null,
selectedTextFormat : 'values',
noneSelectedText : 'Nessuna selezione',
noneResultsText : 'Nessun risultato',
countSelectedText : 'Selezionati {0} di {1}',
maxOptionsText: ['Limite raggiunto ({n} {var} max)', 'Limite del gruppo raggiunto ({n} {var} max)', ['elementi','elemento']],
width: false,
container: false,
hideDisabled: false,
showSubtext: false,
showIcon: true,
showContent: true,
dropupAuto: true,
header: false,
liveSearch: false,
actionsBox: false,
multipleSeparator: ', ',
iconBase: 'glyphicon',
tickIcon: 'glyphicon-ok',
maxOptions: false
};
}(jQuery));
@@ -1 +0,0 @@
(function($){$.fn.selectpicker.defaults={style:'btn-default',size:'auto',title:null,selectedTextFormat:'values',noneSelectedText:'Nessuna selezione',noneResultsText:'Nessun risultato',countSelectedText:'Selezionati {0} di {1}',maxOptionsText:['Limite raggiunto ({n} {var} max)','Limite del gruppo raggiunto ({n} {var} max)',['elementi','elemento']],width:false,container:false,hideDisabled:false,showSubtext:false,showIcon:true,showContent:true,dropupAuto:true,header:false,liveSearch:false,actionsBox:false,multipleSeparator:', ',iconBase:'glyphicon',tickIcon:'glyphicon-ok',maxOptions:false}}(jQuery));
@@ -1,32 +0,0 @@
/*
* Translated default messages for bootstrap-select.
* Locale: NL (Dutch; Nederlands)
* Region: EU (Europe)
* Author: Daan Rosbergen (Badmuts)
*/
(function($) {
$.fn.selectpicker.defaults = {
style: 'btn-default',
size: 'auto',
title: null,
selectedTextFormat : 'values',
noneSelectedText : 'Niets geselecteerd',
noneResultsText : 'Geen resultaten gevonden voor',
countSelectedText: '{0} van {1} geselecteerd',
maxOptionsText: ['Limiet bereikt ({n} {var} max)', 'Groep limiet bereikt ({n} {var} max)', ['items','item']],
width: false,
container: false,
hideDisabled: false,
showSubtext: false,
showIcon: true,
showContent: true,
dropupAuto: true,
header: false,
liveSearch: false,
actionsBox: false,
multipleSeparator: ', ',
iconBase: 'glyphicon',
tickIcon: 'glyphicon-ok',
maxOptions: false
};
}(jQuery));
@@ -1,7 +0,0 @@
/*
* Translated default messages for bootstrap-select.
* Locale: NL (Dutch; Nederlands)
* Region: EU (Europe)
* Author: Daan Rosbergen (Badmuts)
*/
(function(a){a.fn.selectpicker.defaults={style:"btn-default",size:"auto",title:null,selectedTextFormat:"values",noneSelectedText:"Niets geselecteerd",noneResultsText:"Geen resultaten gevonden voor",countSelectedText:"{0} van {1} geselecteerd",maxOptionsText:["Limiet bereikt ({n} {var} max)","Groep limiet bereikt ({n} {var} max)",["items","item"]],width:false,container:false,hideDisabled:false,showSubtext:false,showIcon:true,showContent:true,dropupAuto:true,header:false,liveSearch:false,actionsBox:false,multipleSeparator:", ",iconBase:"glyphicon",tickIcon:"glyphicon-ok",maxOptions:false}}(jQuery));
@@ -1,29 +0,0 @@
/*
* Translated default messages for bootstrap-select.
* Locale: PL (Polish)
* Region: EU (Europe)
*/
(function($) {
$.fn.selectpicker.defaults = {
style: 'btn-default',
size: 'auto',
title: null,
selectedTextFormat : 'values',
noneSelectedText : 'Nic nie zaznaczono',
noneResultsText : 'Brak wyników wyszukiwania',
countSelectedText : 'Zaznaczono {0} z {1}',
maxOptionsText: ['Osiągnięto limit ({n} {var} max)', 'Limit grupy osiągnięty ({n} {var} max)', ['elementy','element']],
width: false,
container: false,
hideDisabled: false,
showSubtext: false,
showIcon: true,
showContent: true,
dropupAuto: true,
header: false,
liveSearch: false,
multipleSeparator: ', ',
iconBase: 'glyphicon',
tickIcon: 'glyphicon-ok'
};
}(jQuery));
@@ -1,6 +0,0 @@
/*
* Translated default messages for bootstrap-select.
* Locale: PL (Polish)
* Region: EU (Europe)
*/
(function(e){e.fn.selectpicker.defaults={style:"btn-default",size:"auto",title:null,selectedTextFormat:"values",noneSelectedText:"Nic nie zaznaczono",noneResultsText:"Brak wyników wyszukiwania",countSelectedText:"Zaznaczono {0} z {1}",maxOptionsText:["Osiągnięto limit ({n} {var} max)","Limit grupy osiągnięty ({n} {var} max)",["elementy","element"]],width:false,container:false,hideDisabled:false,showSubtext:false,showIcon:true,showContent:true,dropupAuto:true,header:false,liveSearch:false,multipleSeparator:", ",iconBase:"glyphicon",tickIcon:"glyphicon-ok"}})(jQuery)
@@ -1,33 +0,0 @@
/*
* Translated default messages for bootstrap-select.
* Locale: PT (Portuguese; português)
* Region: BR (Brazil; Brasil)
* Author: Rodrigo de Avila <rodrigo@avila.net.br>
*/
(function($) {
$.fn.selectpicker.defaults = {
style: 'btn-default',
size: 'auto',
title: null,
selectedTextFormat : 'values',
noneSelectedText : 'Nada selecionado',
noneResultsText : 'Nada encontrado contendo',
countSelectedText : 'Selecionado {0} de {1}',
maxOptionsText: ['Limite excedido (máx. {n} {var})', 'Limite do grupo excedido (máx. {n} {var})', ['itens','item']],
width: false,
container: false,
hideDisabled: false,
showSubtext: false,
showIcon: true,
showContent: true,
dropupAuto: true,
header: false,
liveSearch: false,
actionsBox: false,
multipleSeparator: ', ',
iconBase: 'glyphicon',
tickIcon: 'glyphicon-ok',
maxOptions: false
};
}(jQuery));
@@ -1,7 +0,0 @@
/*
* Translated default messages for bootstrap-select.
* Locale: PT (Portuguese; português)
* Region: BR (Brazil; Brasil)
* Author: Rodrigo de Avila <rodrigo@avila.net.br>
*/
!function(a){a.fn.selectpicker.defaults={style:"btn-default",size:"auto",title:null,selectedTextFormat:"values",noneSelectedText:"Nada selecionado",noneResultsText:"Nada encontrado contendo",countSelectedText:"Selecionado {0} de {1}",maxOptionsText:["Limite excedido (m\xe1x. {n} {var})","Limite do grupo excedido (m\xe1x. {n} {var})",["itens","item"]],width:!1,container:!1,hideDisabled:!1,showSubtext:!1,showIcon:!0,showContent:!0,dropupAuto:!0,header:!1,liveSearch:!1,actionsBox:!1,multipleSeparator:", ",iconBase:"glyphicon",tickIcon:"glyphicon-ok",maxOptions:!1}}(jQuery);
@@ -1,31 +0,0 @@
/*
* Translated default messages for bootstrap-select.
* Locale: RU (Russian; Русский)
* Region: RU (Russian Federation)
*/
(function($) {
$.fn.selectpicker.defaults = {
style: 'btn-default',
size: 'auto',
title: null,
selectedTextFormat : 'values',
noneSelectedText : 'Ничего не выбрано',
noneResultsText : 'Не найдено совпадений',
countSelectedText : 'Выбрано {0} из {1}',
maxOptionsText: ['Достигнут предел ({n} {var} максимум)', 'Достигнут предел в группе ({n} {var} максимум)', ['items','item']],
width: false,
container: false,
hideDisabled: false,
showSubtext: false,
showIcon: true,
showContent: true,
dropupAuto: true,
header: false,
liveSearch: false,
actionsBox: false,
multipleSeparator: ', ',
iconBase: 'glyphicon',
tickIcon: 'glyphicon-ok',
maxOptions: false
};
}(jQuery));
@@ -1,6 +0,0 @@
/*
* Translated default messages for bootstrap-select.
* Locale: RU (Russian; Русский)
* Region: RU (Russian Federation)
*/
(function(e){e.fn.selectpicker.defaults={style:"btn-default",size:"auto",title:null,selectedTextFormat:"values",noneSelectedText:"Ничего не выбрано",noneResultsText:"Не нейдено Совпадений",countSelectedText:"Выбрано {0} из {1}",maxOptionsText:["Достигнут предел ({n} {var} максимум)","Достигнут предел в группе ({n} {var} максимум)",["items","item"]],width:false,container:false,hideDisabled:false,showSubtext:false,showIcon:true,showContent:true,dropupAuto:true,header:false,liveSearch:false,actionsBox:false,multipleSeparator:", ",iconBase:"glyphicon",tickIcon:"glyphicon-ok",maxOptions:false}})(jQuery)
@@ -1,30 +0,0 @@
/*
* Translated default messages for bootstrap-select.
* Locale: zh_CN (Chinese)
* Region:
*/
(function($) {
$.fn.selectpicker.defaults = {
style: 'btn-default',
size: 'auto',
title: null,
selectedTextFormat : 'values',
noneSelectedText : '没有选中任何项',
noneResultsText : '没有找到匹配项',
countSelectedText : '选中{1}中的{0}项',
maxOptionsText: ['超出限制 (最多选择{n}项)', '组选择超出限制(最多选择{n}组)'],
width: false,
container: false,
hideDisabled: false,
showSubtext: false,
showIcon: true,
showContent: true,
dropupAuto: true,
header: false,
liveSearch: false,
multipleSeparator: ', ',
iconBase: 'glyphicon',
tickIcon: 'glyphicon-ok'
};
}(jQuery));
@@ -1,6 +0,0 @@
/*
* Translated default messages for bootstrap-select.
* Locale: zh_CN (Chinese)
* Region:
*/
(function(a){a.fn.selectpicker.defaults={style:"btn-default",size:"auto",title:null,selectedTextFormat:"values",noneSelectedText:"没有选中任何项",noneResultsText:"没有找到匹配项",countSelectedText:"选中{1}中的{0}项",maxOptionsText:["超出限制 (最多选择{n}项)","组选择超出限制(最多选择{n}组)"],width:false,container:false,hideDisabled:false,showSubtext:false,showIcon:true,showContent:true,dropupAuto:true,header:false,liveSearch:false,multipleSeparator:", ",iconBase:"glyphicon",tickIcon:"glyphicon-ok"}}(jQuery));
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,14 @@
/*
* Translated default messages for bootstrap-select.
* Locale: CS
* Region: CZ (Czech Republic)
*/
(function ($) {
$.fn.selectpicker.defaults = {
noneSelectedText: 'Nic není vybráno',
noneResultsText: 'Žádné výsledky',
countSelectedText: 'Označeno {0} z {1}',
maxOptionsText: ['Limit překročen ({n} {var} max)', 'Limit skupiny překročen ({n} {var} max)', ['položek', 'položka']],
multipleSeparator: ', '
};
}(jQuery));
@@ -0,0 +1,14 @@
/*
* Translated default messages for bootstrap-select.
* Locale: DE (German, deutsch)
* Region: DE (Germany, Deutschland)
*/
(function ($) {
$.fn.selectpicker.defaults = {
noneSelectedText: 'Bitte wählen...',
noneResultsText: 'Keine Ergebnisse für',
countSelectedText: '{0} von {1} ausgewählt',
maxOptionsText: ['Limit erreicht ({n} {var} max.)', 'Gruppen-Limit erreicht ({n} {var} max.)', ['Eintrag', 'Einträge']],
multipleSeparator: ', '
};
}(jQuery));
@@ -0,0 +1,14 @@
/*
* Translated default messages for bootstrap-select.
* Locale: EN (English)
* Region: US (United States)
*/
(function ($) {
$.fn.selectpicker.defaults = {
noneSelectedText: 'Nothing selected',
noneResultsText: 'No results match',
countSelectedText: '{0} of {1} selected',
maxOptionsText: ['Limit reached ({n} {var} max)', 'Group limit reached ({n} {var} max)', ['items', 'item']],
multipleSeparator: ', '
};
}(jQuery));
@@ -0,0 +1,14 @@
/*
* Translated default messages for bootstrap-select.
* Locale: ES (Spanish)
* Region: CL (Chile)
*/
(function ($) {
$.fn.selectpicker.defaults = {
noneSelectedText: 'No hay selección',
noneResultsText: 'No hay resultados',
countSelectedText: 'Seleccionados {0} de {1}',
maxOptionsText: ['Límite alcanzado ({n} {var} max)', 'Límite del grupo alcanzado({n} {var} max)', ['elementos', 'element']],
multipleSeparator: ', '
};
}(jQuery));
@@ -0,0 +1,14 @@
/*
* Translated default messages for bootstrap-select.
* Locale: EU (Basque)
* Region:
*/
(function ($) {
$.fn.selectpicker.defaults = {
noneSelectedText: 'Hautapenik ez',
noneResultsText: 'Emaitzarik ez',
countSelectedText: '{1}(e)tik {0} hautatuta',
maxOptionsText: ['Mugara iritsita ({n} {var} gehienez)', 'Taldearen mugara iritsita ({n} {var} gehienez)', ['elementu', 'elementu']],
multipleSeparator: ', '
};
}(jQuery));
@@ -0,0 +1,14 @@
/*
* Translated default messages for bootstrap-select.
* Locale: FR (French; Français)
* Region: FR (France)
*/
(function ($) {
$.fn.selectpicker.defaults = {
noneSelectedText: 'Aucune s&eacute;lection',
noneResultsText: 'Aucun r&eacute;sultat',
countSelectedText: '{0} sur {1} s&eacute;lection(s)',
maxOptionsText: ['Limite atteinte ({n} {var} max)', 'Limite du groupe atteinte ({n} {var} max)', ['&eacute;l&eacute;ments', '&eacute;l&eacute;ment']],
multipleSeparator: ', '
};
}(jQuery));
@@ -0,0 +1,15 @@
/*
* Translated default messages for bootstrap-select.
* Locale: IT (Italian; italiano)
* Region: IT (Italy; Italia)
* Author: Michele Beltrame <mb@cattlegrid.info>
*/
(function ($) {
$.fn.selectpicker.defaults = {
noneSelectedText: 'Nessuna selezione',
noneResultsText: 'Nessun risultato',
countSelectedText: 'Selezionati {0} di {1}',
maxOptionsText: ['Limite raggiunto ({n} {var} max)', 'Limite del gruppo raggiunto ({n} {var} max)', ['elementi', 'elemento']],
multipleSeparator: ', '
};
}(jQuery));
@@ -0,0 +1,15 @@
/*
* Translated default messages for bootstrap-select.
* Locale: NL (Dutch; Nederlands)
* Region: NL (Europe)
* Author: Daan Rosbergen (Badmuts)
*/
(function ($) {
$.fn.selectpicker.defaults = {
noneSelectedText: 'Niets geselecteerd',
noneResultsText: 'Geen resultaten gevonden voor',
countSelectedText: '{0} van {1} geselecteerd',
maxOptionsText: ['Limiet bereikt ({n} {var} max)', 'Groep limiet bereikt ({n} {var} max)', ['items', 'item']],
multipleSeparator: ', '
};
}(jQuery));
@@ -0,0 +1,14 @@
/*
* Translated default messages for bootstrap-select.
* Locale: PL (Polish)
* Region: EU (Europe)
*/
(function ($) {
$.fn.selectpicker.defaults = {
noneSelectedText: 'Nic nie zaznaczono',
noneResultsText: 'Brak wyników wyszukiwania',
countSelectedText: 'Zaznaczono {0} z {1}',
maxOptionsText: ['Osiągnięto limit ({n} {var} max)', 'Limit grupy osiągnięty ({n} {var} max)', ['elementy', 'element']],
multipleSeparator: ', '
};
}(jQuery));
@@ -0,0 +1,15 @@
/*
* Translated default messages for bootstrap-select.
* Locale: PT (Portuguese; português)
* Region: BR (Brazil; Brasil)
* Author: Rodrigo de Avila <rodrigo@avila.net.br>
*/
(function ($) {
$.fn.selectpicker.defaults = {
noneSelectedText: 'Nada selecionado',
noneResultsText: 'Nada encontrado contendo',
countSelectedText: 'Selecionado {0} de {1}',
maxOptionsText: ['Limite excedido (máx. {n} {var})', 'Limite do grupo excedido (máx. {n} {var})', ['itens', 'item']],
multipleSeparator: ', '
};
}(jQuery));
@@ -0,0 +1,14 @@
/*
* Translated default messages for bootstrap-select.
* Locale: RU (Russian; Русский)
* Region: RU (Russian Federation)
*/
(function ($) {
$.fn.selectpicker.defaults = {
noneSelectedText: 'Ничего не выбрано',
noneResultsText: 'Не найдено совпадений',
countSelectedText: 'Выбрано {0} из {1}',
maxOptionsText: ['Достигнут предел ({n} {var} максимум)', 'Достигнут предел в группе ({n} {var} максимум)', ['items', 'item']],
multipleSeparator: ', '
};
}(jQuery));
@@ -0,0 +1,14 @@
/*
* Translated default messages for bootstrap-select.
* Locale: ZH (Chinese)
* Region: CN (China)
*/
(function ($) {
$.fn.selectpicker.defaults = {
noneSelectedText: '没有选中任何项',
noneResultsText: '没有找到匹配项',
countSelectedText: '选中{1}中的{0}项',
maxOptionsText: ['超出限制 (最多选择{n}项)', '组选择超出限制(最多选择{n}组)'],
multipleSeparator: ', '
};
}(jQuery));
@@ -0,0 +1,331 @@
.bootstrap-select {
/*width: 220px\9; IE8 and below*/
//noinspection CssShorthandPropertyValue
width: 220px \0; /*IE9 and below*/
& > .btn {
width: 100%;
padding-right: 25px;
}
.error & .btn {
border: 1px solid #b94a48;
}
&.fit-width {
width: auto !important;
}
}
.bootstrap-select.btn-group:not(.input-group-btn),
.bootstrap-select.btn-group[class*="span"] {
float: none;
display: inline-block;
margin-bottom: 10px;
margin-left: 0;
}
.bootstrap-select.form-control {
margin-bottom: 0;
padding: 0;
border: none;
}
.bootstrap-select.btn-group.pull-right,
.bootstrap-select.btn-group[class*="span"].pull-right,
.row-fluid .bootstrap-select.btn-group[class*="span"].pull-right {
float: right;
}
.bootstrap-select.btn-group {
.form-search &,
.form-inline &,
.form-horizontal &,
.form-group & {
margin-bottom: 0;
}
.input-append & {
margin-left: -1px;
}
.input-prepend & {
margin-right: -1px;
}
}
.bootstrap-select:not([class*="span"]):not([class*="col-"]):not([class*="form-control"]):not(.input-group-btn) {
width: 220px;
}
.bootstrap-select.form-control:not([class*="span"]) {
width: 100%;
}
.bootstrap-select.show-menu-arrow.open > .btn {
z-index: 2051;
}
.bootstrap-select .btn:focus {
outline: thin dotted #333333 !important;
outline: 5px auto -webkit-focus-ring-color !important;
outline-offset: -2px;
}
.bootstrap-select.btn-group .btn .filter-option {
display: inline-block;
overflow: hidden;
width: 100%;
text-align: left;
}
.bootstrap-select.btn-group .btn .caret {
position: absolute;
top: 50%;
right: 12px;
margin-top: -2px;
vertical-align: middle;
}
.bootstrap-select.btn-group > .disabled,
.bootstrap-select.btn-group .dropdown-menu li.disabled > a {
cursor: not-allowed;
}
.bootstrap-select.btn-group > .disabled:focus {
outline: none !important;
}
.bootstrap-select.btn-group[class*="span"] .btn {
width: 100%;
}
.bootstrap-select.btn-group .dropdown-menu {
min-width: 100%;
z-index: 2000;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.bootstrap-select.btn-group .dropdown-menu.inner {
position: static;
border: 0;
padding: 0;
margin: 0;
-webkit-border-radius: 0;
-moz-border-radius: 0;
border-radius: 0;
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
}
.bootstrap-select.btn-group .dropdown-menu dt {
display: block;
padding: 3px 20px;
cursor: default;
}
.bootstrap-select.btn-group .div-contain {
overflow: hidden;
}
.bootstrap-select.btn-group .dropdown-menu li {
position: relative;
}
.bootstrap-select.btn-group .dropdown-menu li > a.opt {
position: relative;
padding-left: 35px;
}
.bootstrap-select.btn-group .dropdown-menu li > a {
cursor: pointer;
}
.bootstrap-select.btn-group .dropdown-menu li > dt small {
font-weight: normal;
}
.bootstrap-select.btn-group.show-tick .dropdown-menu li.selected a i.check-mark {
position: absolute;
display: inline-block;
right: 15px;
margin-top: 2.5px;
}
.bootstrap-select.btn-group .dropdown-menu li a i.check-mark {
display: none;
}
.bootstrap-select.btn-group .dropdown-menu li a span.text {
display: inline-block;
}
.bootstrap-select.btn-group.show-tick .dropdown-menu li a span.text {
margin-right: 34px;
}
.bootstrap-select.btn-group .dropdown-menu li small {
padding-left: 0.5em;
}
.bootstrap-select.btn-group .dropdown-menu {
& li:not(.disabled) > a:hover small,
& li:not(.disabled) > a:focus small,
& li.active:not(.disabled) > a small {
color: rgb(100, 177, 216);
color: rgba(100, 177, 216, 0.4);
}
& li > dt small {
font-weight: normal;
}
}
.bootstrap-select.show-menu-arrow {
.dropdown-toggle {
&:before {
content: '';
border-left: 7px solid transparent;
border-right: 7px solid transparent;
border-bottom-width: 7px;
border-bottom-style: solid;
border-bottom-color: rgb(204, 204, 204);
border-bottom-color: rgba(204, 204, 204, 0.2);
position: absolute;
bottom: -4px;
left: 9px;
display: none;
}
&:after {
content: '';
border-left: 6px solid transparent;
border-right: 6px solid transparent;
border-bottom: 6px solid white;
position: absolute;
bottom: -4px;
left: 10px;
display: none;
}
}
&.dropup {
.dropdown-toggle {
&:before {
bottom: auto;
top: -3px;
border-bottom: 0;
border-top-width: 7px;
border-top-style: solid;
border-top-color: rgb(204, 204, 204);
border-top-color: rgba(204, 204, 204, 0.2);
}
&:after {
bottom: auto;
top: -3px;
border-top: 6px solid #FFFFFF;
border-bottom: 0;
}
}
}
&.pull-right {
.dropdown-toggle {
&:before {
right: 12px;
left: auto;
}
&:after {
right: 13px;
left: auto;
}
}
}
&.open > .dropdown-toggle {
&:before,
&:after {
display: block;
}
}
}
.bootstrap-select.btn-group .no-results {
padding: 3px;
background: #f5f5f5;
margin: 0 5px;
}
.bootstrap-select.btn-group .dropdown-menu .notify {
position: absolute;
bottom: 5px;
width: 96%;
margin: 0 2%;
min-height: 26px;
padding: 3px 5px;
background: #f5f5f5;
border: 1px solid #e3e3e3;
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
pointer-events: none;
opacity: 0.9;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.bootstrap-select.btn-group.fit-width .btn .filter-option {
position: static;
}
.bootstrap-select.btn-group.fit-width .btn .caret {
position: static;
top: auto;
margin-top: -1px;
}
.control-group.error .bootstrap-select .dropdown-toggle {
border-color: #b94a48;
}
.bootstrap-select-searchbox,
.bootstrap-select .bs-actionsbox {
padding: 4px 8px;
}
.bootstrap-select .bs-actionsbox {
float: left;
width: 100%;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
& .btn-group button {
width: 50%;
}
}
.bootstrap-select-searchbox {
& + .bs-actionsbox {
padding: 0 8px 4px;
}
& input, & .form-control {
margin-bottom: 0;
width: 100%;
}
}
.mobile-device {
position: absolute;
top: 0;
left: 0;
display: block !important;
width: 100%;
height: 100% !important;
opacity: 0;
}
+66 -28
View File
@@ -1,31 +1,69 @@
{
"name": "bootstrap-select",
"title": "bootstrap-select",
"filename": "bootstrap-select.js",
"description": "A custom <select> for Bootstrap using button dropdown as replacement",
"version": "1.5.4",
"homepage": "http://silviomoreto.github.io/bootstrap-select/",
"author": {
"name": "Silvio Moreto",
"url": "https://github.com/silviomoreto/"
},
"repository": {
"type": "git",
"url": "git://github.com/antonellopasella/bootstrap-select.git"
},
"licenses": [
{
"type": "MIT",
"url": "https://github.com/silviomoreto/bootstrap-select/blob/master/README.md#copyright-and-license"
}
],
"dependencies": {
"jquery": "1.8"
},
"keywords": [
"form",
"bootstrap",
"select",
"replacement"
]
"title": "bootstrap-select",
"filename": "bootstrap-select.js",
"description": "A custom <select> for Bootstrap using button dropdown as replacement",
"version": "1.6.0",
"homepage": "http://silviomoreto.github.io/bootstrap-select/",
"author": {
"name": "Silvio Moreto",
"url": "https://github.com/silviomoreto/"
},
"contributors": [
{
"name": "Silvio Moreto",
"url": "http://github.com/silviomoreto"
},
{
"name": "Ana Carolina",
"url": "http://github.com/anacarolinats"
},
{
"name": "caseyjhol",
"url": "https://github.com/caseyjhol"
},
{
"name": "Matt Bryson",
"url": "https://github.com/mattbryson"
},
{
"name": "t0xicCode",
"url": "https://github.com/t0xicCode"
}
],
"repository": {
"type": "git",
"url": "git://github.com/silviomoreto/bootstrap-select.git"
},
"bugs": {
"url": "https://github.com/silviomoreto/bootstrap-select/issues"
},
"license": {
"type": "MIT",
"url": "https://github.com/silviomoreto/bootstrap-select/blob/master/LICENSE"
},
"dependencies": {
"jquery": "1.8"
},
"devDependencies": {
"grunt": "~0.4.5",
"grunt-contrib-jshint": "~0.10.0",
"grunt-contrib-watch": "~0.6.1",
"grunt-contrib-qunit": "~0.5.2",
"grunt-contrib-concat": "~0.4.0",
"grunt-contrib-uglify": "~0.5.0",
"grunt-contrib-less": "~0.11.3",
"grunt-contrib-csslint": "~0.2.0",
"grunt-contrib-clean": "~0.5.0",
"load-grunt-tasks": "~0.6.0",
"grunt-banner": "~0.2.3",
"grunt-contrib-cssmin": "~0.10.0",
"grunt-sed": "~0.1.1"
},
"keywords": [
"form",
"bootstrap",
"select",
"replacement"
]
}
+56 -46
View File
@@ -1,62 +1,72 @@
<!DOCTYPE html>
<html>
<head>
<title></title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
<script type="text/javascript" src="bootstrap-select.js"></script>
<link rel="stylesheet" type="text/css" href="bootstrap-select.css">
<title>Bootstrap-select test page</title>
<!-- 3.0 -->
<link href="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet">
<script src="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>
<meta charset="utf-8">
<!-- 2.3.2
<link href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css" rel="stylesheet">
<script src="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/js/bootstrap.js"></script>
-->
<script type="text/javascript">
$(window).on('load', function () {
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
<script type="text/javascript" src="dist/js/bootstrap-select.js"></script>
<link rel="stylesheet" type="text/css" href="dist/css/bootstrap-select.css">
$('.selectpicker').selectpicker({
'selectedText': 'cat'
});
<!-- 3.2 -->
<link href="//netdna.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet">
<script src="//netdna.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
// $('.selectpicker').selectpicker('hide');
});
</script>
<!-- 2.3.2
<link href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css" rel="stylesheet">
<script src="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/js/bootstrap.js"></script>
-->
<script type="text/javascript">
$(window).on('load', function () {
$('.selectpicker').selectpicker({
'selectedText': 'cat'
});
// $('.selectpicker').selectpicker('hide');
});
</script>
</head>
<body>
<label for="id_select">Test label YEag</label>
<select id="id_select" class="selectpicker bla bla bli" multiple data-live-search="true">
<option>cow</option>
<option>bull</option>
<option class="get-class" disabled>ox</option>
<optgroup label="test" data-subtext="another test" data-icon="icon-ok">
<div class="container">
<form class="form-horizontal" role="form">
<div class="form-group">
<label for="basic" class="col-lg-2 control-label">Test bootstrap 3 form</label>
<div class="col-lg-10">
<select id="basic" class="selectpicker show-tick form-control" multiple data-live-search="true">
<option>cow</option>
<option>bull</option>
<option class="get-class" disabled>ox</option>
<optgroup label="test" data-subtext="another test" data-icon="icon-ok">
<option>ASD</option>
<option selected>Bla</option>
<option>Ble</option>
</optgroup>
</select>
<div class="container">
<form class="form-horizontal" role="form">
<div class="form-group">
<label for="bs3Select" class="col-lg-2 control-label">Test bootstrap 3 form</label>
<div class="col-lg-10">
<select id="bs3Select" class="selectpicker show-tick form-control" multiple data-live-search="true">
<option>cow</option>
<option>bull</option>
<option class="get-class" disabled>ox</option>
<optgroup label="test" data-subtext="another test" data-icon="icon-ok">
<option>ASD</option>
<option selected>Bla</option>
<option>Ble</option>
</optgroup>
</select>
</div>
</div>
<form>
</optgroup>
</select>
</div>
</div>
</form>
<form class="form-horizontal" role="form">
<div class="form-group">
<label for="maxOption2" class="col-lg-2 control-label">multiple & max-option = 2</label>
<div class="col-lg-10">
<select id="maxOption2" class="selectpicker show-tick form-control" multiple data-max-options="2">
<option>cow</option>
<option>bull</option>
<option class="get-class" disabled>ox</option>
<optgroup label="test" data-subtext="another test" data-icon="icon-ok">
<option>ASD</option>
<option selected>Bla</option>
<option>Ble</option>
</optgroup>
</select>
</div>
</div>
</form>
</div>
</body>
</html>
+1 -1
View File
@@ -9,7 +9,7 @@ BOWER_INSTALLED_APPS = (
"jquery#1.9",
"jquery-ui#1.11",
"bootstrap#3.2.0",
"bootstrap-select#1.5.4",
"bootstrap-select#1.6",
"d3#3.3.13",
"eonasdan-bootstrap-datetimepicker#3.1.3",
"font-awesome#4.2.0",
@@ -0,0 +1,10 @@
{% extends "common/generic_modal.html" %}
{% load i18n %}
{% block modalbody %}
<p>{% trans "To access this calendar, use the following address:" %}
<div class="alert alert-info" role="alert">
<p><strong>{{ calendar.url }}</strong></p>
</div>
{% endblock %}
@@ -48,7 +48,6 @@ $(document).ready(function() {
<th id="name" class="sortable" data-sort_order="name" width="">{% trans "Name" %}</th>
{% if with_owner %}<th id="owner" class="sortable" data-sort_order="owner">{% trans "Owner" %}</th>{% endif %}
<th id="tags">{% trans "Tags" %}</th>
<th id="url">{% trans "Address" %}</th>
<th id="actions" width="">{% trans "Actions" %}</th>
</tr>
</thead>
@@ -1,10 +1,9 @@
{% load i18n lib_tags radicale_tags %}
{% for cal in calendars %}
<tr id="{{ cal.id }}">
<td name="name">{% calendar_modify_link cal %}</td>
<td name="name">{% calendar_view_link cal %}</td>
{% if with_owner %}<td name="owner">{{ cal.owner }}</td>{% endif %}
<td name="tags">{% render_tags cal.tags %}</td>
<td name="url">{{ cal.url }}</td>
<td name="actions">{% calendar_actions cal %}</td>
</tr>
{% endfor %}
@@ -43,37 +43,46 @@ def radicale_left_menu(user):
@register.simple_tag
def calendar_modify_link(calendar):
"""
"""
linkdef = {"label": calendar.name, "modal": True}
def calendar_view_link(calendar):
"""Render a link to view calendar detail."""
linkdef = {
"label": calendar.name, "modal": True,
"title": _("View calendar detail")
}
if calendar.__class__.__name__ == "UserCalendar":
linkdef["url"] = reverse(
"radicale:user_calendar", args=[calendar.pk]
"radicale:user_calendar_detail", args=[calendar.pk]
)
linkdef["modalcb"] = "radicale.edit_calendar_cb"
else:
linkdef["url"] = reverse(
"radicale:shared_calendar", args=[calendar.pk]
"radicale:shared_calendar_detail", args=[calendar.pk]
)
linkdef["modalcb"] = "radicale.shared_calendar_cb"
return render_link(linkdef)
@register.simple_tag
def calendar_actions(calendar):
"""
"""
actions = [{
"name": "delcalendar",
"title": _("Delete %s?" % calendar),
"img": "fa fa-trash"
}]
"""Render per-calendar actions."""
actions = [
{"name": "editcalendar",
"title": _("Edit %s" % calendar),
"modal": True,
"img": "fa fa-edit"},
{"name": "delcalendar",
"title": _("Delete %s?" % calendar),
"img": "fa fa-trash"}
]
if calendar.__class__.__name__ == 'UserCalendar':
actions[0]["url"] = reverse(
"radicale:user_calendar", args=[calendar.pk])
actions[0]["modalcb"] = "radicale.edit_calendar_cb"
actions[1]["url"] = reverse(
"radicale:user_calendar", args=[calendar.id])
else:
actions[0]["url"] = reverse(
"radicale:shared_calendar", args=[calendar.pk])
actions[0]["modalcb"] = "radicale.shared_calendar_cb"
actions[1]["url"] = reverse(
"radicale:shared_calendar", args=[calendar.id])
return render_actions(actions)
+4
View File
@@ -8,9 +8,13 @@ urlpatterns = patterns(
url(r'^user/$', 'new_user_calendar', name='user_calendar_add'),
url(r'^user/(?P<pk>\d+)/$', 'user_calendar',
name='user_calendar'),
url(r'^user/(?P<pk>\d+)/detail/$', 'user_calendar_detail',
name='user_calendar_detail'),
url(r'^shared/$', 'new_shared_calendar',
name='shared_calendar_add'),
url(r'^shared/(?P<pk>\d+)/$', 'shared_calendar',
name='shared_calendar'),
url(r'^shared/(?P<pk>\d+)/detail/$', 'shared_calendar_detail',
name='shared_calendar_detail'),
url(r'^usernames/$', 'username_list', name='username_list'),
)
+36 -7
View File
@@ -90,8 +90,7 @@ def new_user_calendar(request):
@login_required
def user_calendar(request, pk):
"""Edit or remove a calendar.
"""
"""Edit or remove a calendar."""
try:
ucal = UserCalendar.objects.select_related().get(pk=pk)
except UserCalendar.DoesNotExist:
@@ -106,11 +105,25 @@ def user_calendar(request, pk):
return UserCalendarEditionForm(request, instances=instances).process()
@login_required
def user_calendar_detail(request, pk):
"""Display user calendar's detail."""
try:
ucal = UserCalendar.objects.select_related().get(pk=pk)
except UserCalendar.DoesNotExist:
raise NotFound
if request.user != ucal.mailbox.user and \
not request.user.can_access(ucal.mailbox.domain):
raise PermDeniedException
return render(request, "radicale/calendar_detail.html", {
"title": ucal.name, "calendar": ucal
})
@login_required
@permission_required("radicale.add_sharedcalendar")
def new_shared_calendar(request):
"""Shared calendar creation view.
"""
"""Shared calendar creation view."""
if request.method == "POST":
form = SharedCalendarForm(request.user, request.POST)
if form.is_valid():
@@ -133,11 +146,10 @@ def new_shared_calendar(request):
@login_required
@user_passes_test(
lambda u: u.has_perm("radicale.change_sharedcalendar")
or u.has_perm("radicale.delete_sharedcalendar")
or u.has_perm("radicale.delete_sharedcalendar")
)
def shared_calendar(request, pk):
"""Edit or remove a shared calendar.
"""
"""Edit or remove a shared calendar."""
try:
scal = SharedCalendar.objects.select_related().get(pk=pk)
except SharedCalendar.DoesNotExist:
@@ -168,6 +180,23 @@ def shared_calendar(request, pk):
})
@login_required
@user_passes_test(
lambda u: u.has_perm("radicale.change_sharedcalendar")
)
def shared_calendar_detail(request, pk):
"""Display shared calendar's detail."""
try:
scal = SharedCalendar.objects.select_related().get(pk=pk)
except SharedCalendar.DoesNotExist:
raise NotFound
if not request.user.can_access(scal.domain):
raise PermDeniedException
return render(request, "radicale/calendar_detail.html", {
"title": scal.name, "calendar": scal
})
@login_required
def username_list(request):
"""Get the list of username the current user can see.
+3 -1
View File
@@ -253,12 +253,13 @@ class IMAPconnector(object):
"""
if self.m is not None:
try:
self._cmd("CHECK")
self._cmd("NOOP")
except ImapError:
if hasattr(self, "current_mailbox"):
del self.current_mailbox
else:
return
self.login(user, password)
def login(self, user, passwd):
@@ -272,6 +273,7 @@ class IMAPconnector(object):
:param passwd: password
"""
import socket
if type(user) is unicode:
user = user.encode("utf-8")
if type(passwd) is unicode:
@@ -361,10 +361,11 @@ Webmail.prototype = {
}
},
/*
* Set the *unseen messages* counter for a particular mailbox in
* the list. If the mailbox is currently selected, we update the
* listing.
/**
* Set the *unseen messages* counter for a particular mailbox in
* the list. If the mailbox is currently selected, we force a
* listing update.
*
*/
set_unseen_messages: function(mailbox, value) {
if (this.poller.running_request) {
@@ -378,7 +379,7 @@ Webmail.prototype = {
if (this.navobject.params.action == "listmailbox") {
var curmb = this.get_current_mailbox();
if (curmb == mailbox) {
this.navobject.update(true);
this.navobject.setparam("reset_page", "true").update(true);
}
}
+1 -1
View File
@@ -175,7 +175,7 @@ function simple_ajax_form_post(e, options) {
if (opts.modal) {
$("#modalbox").modal('hide');
}
if (opts.success_cb != undefined) {
if (opts.success_cb !== undefined) {
opts.success_cb(data);
return;
}
+2 -2
View File
@@ -11,7 +11,7 @@
<link rel="stylesheet" href="{% static 'font-awesome/css/font-awesome.min.css' %}">
<link rel="stylesheet" href="{% static 'bootstrap/dist/css/bootstrap.min.css' %}" />
<link rel="stylesheet" href="{% static 'eonasdan-bootstrap-datetimepicker/build/css/bootstrap-datetimepicker.min.css' %}" />
<link rel="stylesheet" href="{% static 'bootstrap-select/bootstrap-select.min.css' %}" />
<link rel="stylesheet" href="{% static 'bootstrap-select/dist/css/bootstrap-select.min.css' %}" />
<link rel="stylesheet" type="text/css" href="{% static 'css/custom.css' %}" />
{% block extra_css %}{% endblock %}
</head>
@@ -60,7 +60,7 @@
<script src="{% static 'bootstrap/dist/js/bootstrap.min.js' %}" type="text/javascript"></script>
<script type="text/javascript" src="{% static 'moment/min/moment.min.js' %}"></script>
<script src="{% static 'eonasdan-bootstrap-datetimepicker/build/js/bootstrap-datetimepicker.min.js' %}" type="text/javascript"></script>
<script src="{% static 'bootstrap-select/bootstrap-select.min.js' %}" type="text/javascript"></script>
<script src="{% static 'bootstrap-select/dist/js/bootstrap-select.min.js' %}" type="text/javascript"></script>
{% if LANGUAGE_CODE != "en" %}<script src="{% static 'moment/locale/{{ LANGUAGE_CODE }}.js' %}" type="text/javascript"></script>{% endif %}
{% if TEMPLATE_DEBUG %}
<script src="//maxcdn.bootstrapcdn.com/bootlint/0.4.0/bootlint.min.js"></script>