├── LICENSE-MIT ├── README.md ├── bootstrap-filestyle.jquery.json ├── bower.json ├── composer.json ├── package.json ├── src ├── bootstrap-filestyle.js └── bootstrap-filestyle.min.js └── test ├── css └── bootstrap.min.css ├── fonts ├── glyphicons-halflings-regular.eot ├── glyphicons-halflings-regular.svg ├── glyphicons-halflings-regular.ttf └── glyphicons-halflings-regular.woff ├── index.html ├── js └── bootstrap.min.js ├── open-iconic └── font │ ├── css │ └── open-iconic-bootstrap.css │ └── fonts │ ├── open-iconic.eot │ ├── open-iconic.otf │ ├── open-iconic.svg │ ├── open-iconic.ttf │ └── open-iconic.woff ├── upload.php └── upload └── .folder /LICENSE-MIT: -------------------------------------------------------------------------------- 1 | Copyright (c) 2017 Markus Lima 2 | 3 | Permission is hereby granted, free of charge, to any person 4 | obtaining a copy of this software and associated documentation 5 | files (the "Software"), to deal in the Software without 6 | restriction, including without limitation the rights to use, 7 | copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the 9 | Software is furnished to do so, subject to the following 10 | conditions: 11 | 12 | The above copyright notice and this permission notice shall be 13 | included in all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 17 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 19 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 20 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 21 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | # [Bootstrap FileStyle v2.1.0](http://markusslima.github.io/bootstrap-filestyle/) 3 | 4 | Bootstrap FileStyle is a quick and simple and beaultiful plugin to help style your form's file upload inputs using Bootstrap 4. 5 | 6 | ------------------------------------------------------------------------------------ 7 | # Alert 8 | 9 | ### **Please send to (issues) problems with the plugin, also send more details as:** 10 | * Browser 11 | * Version 12 | * Examples using [jsfiddle.net](https://jsfiddle.net/) 13 | * Other plugins involved 14 | * Etc. 15 | 16 | **Detail the most of your problem to speed up the correction process.** 17 | 18 | Thank you! 19 | 20 | ------------------------------------------------------------------------------------- 21 | 22 | Maintained by [Markus Lima](https://github.com/markusslima) [@markusslima](https://twitter.com/markusslima) 23 | 24 | ### Getting Started, Documentation and Examples 25 | http://markusslima.github.io/bootstrap-filestyle/ 26 | 27 | ### Bug tracker 28 | 29 | Have a bug or a feature request? [Please open a new issue](https://github.com/markusslima/bootstrap-filestyle/issues). 30 | 31 | ### Copyright and license 32 | 33 | MIT Licence. -------------------------------------------------------------------------------- /bootstrap-filestyle.jquery.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "bootstrap-filestyle", 3 | "title": "Bootstrap styling input file", 4 | "version": "v2.1.0", 5 | "description": "jQuery FileStyle for Bootstrap - Customization of input html file for Bootstrap 4", 6 | "keywords": ["jquery", "file", "upload", "boostrap", "multiple", "input", "style"], 7 | "homepage": "http://markusslima.github.io/bootstrap-filestyle/", 8 | "demo": "http://markusslima.github.io/bootstrap-filestyle/", 9 | "bugs": "https://github.com/markusslima/bootstrap-filestyle/issues", 10 | "author": { 11 | "name": "Markus Lima", 12 | "url": "https://github.com/markusslima" 13 | }, 14 | "maintainers": [ 15 | { 16 | "name": "Markus Lima", 17 | "url": "https://github.com/markusslima" 18 | } 19 | ], 20 | "repository": { 21 | "type": "git", 22 | "url": "https://github.com/markusslima/bootstrap-filestyle" 23 | }, 24 | "licenses": [ 25 | { 26 | "type": "MIT", 27 | "url": "http://www.opensource.org/licenses/MIT" 28 | } 29 | ], 30 | "devDependencies": { 31 | "jquery": ">=3" 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "bootstrap-filestyle", 3 | "version": "2.1.0", 4 | "homepage": "https://github.com/markusslima/bootstrap-filestyle", 5 | "authors": [ 6 | "Markus Lima @markusslima" 7 | ], 8 | "description": "Bootstrap FileStyle is a quick and simple plugin to help style your form's file upload inputs using Bootstrap 4.", 9 | "main": "src/bootstrap-filestyle.js", 10 | "keywords": [ 11 | "bootstrap", 12 | "fileupload", 13 | "filestyle" 14 | ], 15 | "license": "MIT", 16 | "ignore": [ 17 | "**/.*", 18 | "node_modules", 19 | "bower_components", 20 | "test", 21 | "tests" 22 | ] 23 | } 24 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "markusslima/bootstrap-filestyle", 3 | "description": "jQuery customization of input html file for Bootstrap Twitter http://markusslima.github.io/bootstrap-filestyle/", 4 | "type": "component", 5 | "homepage": "http://markusslima.github.io/bootstrap-filestyle/", 6 | "license": "MIT", 7 | "authors": [ 8 | { 9 | "name": "Markus Lima Luthier", 10 | "email": "markusslima@gmail.com" 11 | } 12 | ], 13 | "require": { 14 | "robloach/component-installer": "*", 15 | "components/bootstrap": "*" 16 | }, 17 | "extra": { 18 | "component": { 19 | "scripts": [ 20 | "src/bootstrap-filestyle.js" 21 | ], 22 | "files": [ 23 | "src/bootstrap-filestyle.min.js" 24 | ] 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "bootstrap-filestyle", 3 | "version": "2.1.0", 4 | "description": "Bootstrap FileStyle is a quick and simple plugin to help style your form's file upload inputs using Bootstrap 4.", 5 | "main": "src/bootstrap-filestyle.js", 6 | "directories": { 7 | "test": "test" 8 | }, 9 | "repository": { 10 | "type": "git", 11 | "url": "git+https://github.com/markusslima/bootstrap-filestyle.git" 12 | }, 13 | "keywords": [ 14 | "bootstrap", 15 | "fileupload", 16 | "filestyle" 17 | ], 18 | "author": "Markus Lima @markusslima", 19 | "license": "MIT", 20 | "bugs": { 21 | "url": "https://github.com/markusslima/bootstrap-filestyle/issues" 22 | }, 23 | "homepage": "https://github.com/markusslima/bootstrap-filestyle#readme" 24 | } 25 | -------------------------------------------------------------------------------- /src/bootstrap-filestyle.js: -------------------------------------------------------------------------------- 1 | /* 2 | * bootstrap-filestyle 3 | * doc: http://markusslima.github.io/bootstrap-filestyle/ 4 | * github: https://github.com/markusslima/bootstrap-filestyle 5 | * 6 | * Copyright (c) 2017 Markus Vinicius da Silva Lima 7 | * Version 2.1.0 8 | * Licensed under the MIT license. 9 | */ 10 | (function($) { 11 | "use strict"; 12 | 13 | var nextId = 0; 14 | 15 | var Filestyle = function(element, options) { 16 | this.options = options; 17 | this.$elementFilestyle = []; 18 | this.$element = $(element); 19 | }; 20 | 21 | Filestyle.prototype = { 22 | clear : function() { 23 | this.$element.val(''); 24 | this.$elementFilestyle.find(':text').val(''); 25 | this.$elementFilestyle.find('.badge').remove(); 26 | }, 27 | 28 | destroy : function() { 29 | this.$element.removeAttr('style').removeData('filestyle'); 30 | this.$elementFilestyle.remove(); 31 | }, 32 | 33 | disabled : function(value) { 34 | if (value === true || value === false) { 35 | this.options.disabled = value; 36 | this.$element.prop('disabled', this.options.disabled); 37 | this.$elementFilestyle.find('label').prop('disabled', this.options.disabled); 38 | 39 | if (this.options.disabled) 40 | this.$elementFilestyle.find('label').css('opacity', '0.65'); 41 | else 42 | this.$elementFilestyle.find('label').css('opacity', '1'); 43 | } else { 44 | return this.options.disabled; 45 | } 46 | }, 47 | 48 | dragdrop : function(value) { 49 | if (value === true || value === false) { 50 | this.options.dragdrop = value; 51 | } else { 52 | return this.options.dragdrop; 53 | } 54 | }, 55 | 56 | buttonBefore : function(value) { 57 | if (value === true) { 58 | if (!this.options.buttonBefore) { 59 | this.options.buttonBefore = value; 60 | if (this.options.input) { 61 | this.$elementFilestyle.remove(); 62 | this.constructor(); 63 | this.pushNameFiles(); 64 | } 65 | } 66 | } else if (value === false) { 67 | if (this.options.buttonBefore) { 68 | this.options.buttonBefore = value; 69 | if (this.options.input) { 70 | this.$elementFilestyle.remove(); 71 | this.constructor(); 72 | this.pushNameFiles(); 73 | } 74 | } 75 | } else { 76 | return this.options.buttonBefore; 77 | } 78 | }, 79 | 80 | input : function(value) { 81 | if (value === true) { 82 | if (!this.options.input) { 83 | this.options.input = value; 84 | 85 | if (this.options.buttonBefore) { 86 | this.$elementFilestyle.append(this.htmlInput()); 87 | } else { 88 | this.$elementFilestyle.prepend(this.htmlInput()); 89 | } 90 | 91 | this.pushNameFiles(); 92 | this.$elementFilestyle.find('.group-span-filestyle').addClass('input-group-btn'); 93 | } 94 | } else if (value === false) { 95 | if (this.options.input) { 96 | this.options.input = value; 97 | this.$elementFilestyle.find(':text').remove(); 98 | this.$elementFilestyle.find('.group-span-filestyle').removeClass('input-group-btn'); 99 | } 100 | } else { 101 | return this.options.input; 102 | } 103 | }, 104 | 105 | size : function(value) { 106 | if (value !== undefined) { 107 | this.options.size = value; 108 | var btn = this.$elementFilestyle.find('label'), input = this.$elementFilestyle.find('input'); 109 | 110 | btn.removeClass('btn-lg btn-sm'); 111 | input.removeClass('form-control-lg form-control-sm'); 112 | if (this.options.size != 'nr') { 113 | btn.addClass('btn-' + this.options.size); 114 | input.addClass('form-control-' + this.options.size); 115 | } 116 | } else { 117 | return this.options.size; 118 | } 119 | }, 120 | 121 | placeholder : function(value) { 122 | if (value !== undefined) { 123 | this.options.placeholder = value; 124 | this.$elementFilestyle.find('input').attr('placeholder', value); 125 | } else { 126 | return this.options.placeholder; 127 | } 128 | }, 129 | 130 | text : function(value) { 131 | if (value !== undefined) { 132 | this.options.text = value; 133 | this.$elementFilestyle.find('label .text').html(this.options.text); 134 | } else { 135 | return this.options.text; 136 | } 137 | }, 138 | 139 | btnClass : function(value) { 140 | if (value !== undefined) { 141 | this.options.btnClass = value; 142 | this.$elementFilestyle.find('label').attr({ 143 | 'class' : 'btn ' + this.options.btnClass + ' btn-' + this.options.size 144 | }); 145 | } else { 146 | return this.options.btnClass; 147 | } 148 | }, 149 | 150 | badge : function(value) { 151 | if (value === true) { 152 | this.options.badge = value; 153 | var files = this.pushNameFiles(); 154 | this.$elementFilestyle.find('label').append(' ' + files.length + ''); 155 | } else if (value === false) { 156 | this.options.badge = value; 157 | this.$elementFilestyle.find('.badge').remove(); 158 | } else { 159 | return this.options.badge; 160 | } 161 | }, 162 | 163 | badgeName : function(value) { 164 | if (value !== undefined) { 165 | this.options.badgeName = value; 166 | this.$elementFilestyle.find('.badge').attr({ 167 | 'class' : 'badge ' + this.options.badgeName 168 | }); 169 | } else { 170 | return this.options.badgeName; 171 | } 172 | }, 173 | 174 | htmlIcon : function(value) { 175 | if (value !== undefined) { 176 | this.options.htmlIcon = value; 177 | } 178 | 179 | return this.options.htmlIcon; 180 | }, 181 | 182 | htmlInput : function() { 183 | if (this.options.input) { 184 | return ' '; 185 | } else { 186 | return ''; 187 | } 188 | }, 189 | 190 | // puts the name of the input files 191 | // return files 192 | pushNameFiles : function() { 193 | var content = '', files = []; 194 | if (this.$element[0].files === undefined) { 195 | files[0] = { 196 | 'name' : this.$element[0] && this.$element[0].value 197 | }; 198 | } else { 199 | files = this.$element[0].files; 200 | } 201 | 202 | for (var i = 0; i < files.length; i++) { 203 | content += files[i].name.split("\\").pop() + ', '; 204 | } 205 | 206 | if (content !== '') { 207 | this.$elementFilestyle.find(':text').val(content.replace(/\, $/g, '')); 208 | } else { 209 | this.$elementFilestyle.find(':text').val(''); 210 | } 211 | 212 | return files; 213 | }, 214 | 215 | constructor : function() { 216 | var _self = this, 217 | html = '', 218 | id = _self.$element.attr('id'), 219 | files = [], 220 | btn = '', 221 | $label; 222 | 223 | if (id === '' || !id) { 224 | id = 'filestyle-' + nextId; 225 | _self.$element.attr({ 226 | 'id' : id 227 | }); 228 | nextId++; 229 | } 230 | 231 | btn = '' + 232 | '' + 237 | ''; 238 | 239 | html = _self.options.buttonBefore ? btn + _self.htmlInput() : _self.htmlInput() + btn; 240 | _self.$elementFilestyle = $('
' + html + '
'); 241 | _self.$elementFilestyle.find('.group-span-filestyle').attr('tabindex', "0").keypress(function(e) { 242 | if (e.keyCode === 13 || e.charCode === 32) { 243 | _self.$elementFilestyle.find('label').click(); 244 | return false; 245 | } 246 | }); 247 | 248 | // hidding input file and add filestyle 249 | _self.$element.css({ 250 | 'position' : 'absolute', 251 | 'clip' : 'rect(0px 0px 0px 0px)' // using 0px for work in IE8 252 | }).attr('tabindex', "-1").after(_self.$elementFilestyle); 253 | 254 | _self.$elementFilestyle.find(_self.options.buttonBefore ? 'label' : ':input').css({ 255 | 'border-top-left-radius': '.25rem', 256 | 'border-bottom-left-radius': '.25rem' 257 | }); 258 | 259 | _self.$elementFilestyle.find('[name="filedrag"]').css({ 260 | position: 'absolute', 261 | width: '100%', 262 | height: _self.$elementFilestyle.height()+'px', 263 | 'z-index': -1 264 | }); 265 | 266 | if (_self.options.disabled || _self.$element.attr('disabled')) { 267 | _self.$element.attr('disabled', 'true'); 268 | if (_self.options.disabled) 269 | _self.$elementFilestyle.find('label').css('opacity', '0.65'); 270 | else 271 | _self.$elementFilestyle.find('label').css('opacity', '1'); 272 | } 273 | 274 | // Getting input file value 275 | _self.$element.change(function () { 276 | var files = _self.pushNameFiles(); 277 | if (_self.options.badge) { 278 | if (_self.$elementFilestyle.find('.badge').length == 0) { 279 | _self.$elementFilestyle.find('label').append(' ' + files.length + ''); 280 | } else if (files.length == 0) { 281 | _self.$elementFilestyle.find('.badge').remove(); 282 | } else { 283 | _self.$elementFilestyle.find('.badge').html(files.length); 284 | } 285 | } else { 286 | _self.$elementFilestyle.find('.badge').remove(); 287 | } 288 | 289 | _self.options.onChange(files); 290 | }); 291 | 292 | // Check if browser is Firefox 293 | if (window.navigator.userAgent.search(/firefox/i) > -1) { 294 | // Simulating choose file for firefox 295 | _self.$elementFilestyle.find('label').click(function() { 296 | _self.$element.click(); 297 | return false; 298 | }); 299 | } 300 | 301 | /** DRAG AND DROP EVENTS **/ 302 | $(document) 303 | .on('dragover', function (e) { 304 | e.preventDefault(); 305 | e.stopPropagation(); 306 | if (_self.options.dragdrop) { 307 | $('[name="filedrag"]').css('z-index', '9'); 308 | } 309 | }) 310 | .on('drop', function (e) { 311 | e.preventDefault(); 312 | e.stopPropagation(); 313 | if (_self.options.dragdrop) { 314 | $('[name="filedrag"]').css('z-index', '-1'); 315 | } 316 | }); 317 | 318 | _self.$elementFilestyle.find('[name="filedrag"]') 319 | .on('dragover', 320 | function (e) { 321 | e.preventDefault(); 322 | e.stopPropagation(); 323 | } 324 | ) 325 | .on('dragenter', 326 | function (e) { 327 | e.preventDefault(); 328 | e.stopPropagation(); 329 | } 330 | ) 331 | .on('drop', 332 | function (e) { 333 | if (e.originalEvent.dataTransfer && !_self.options.disabled && _self.options.dragdrop) { 334 | if (e.originalEvent.dataTransfer.files.length) { 335 | e.preventDefault(); 336 | e.stopPropagation(); 337 | _self.$element[0].files = e.originalEvent.dataTransfer.files; 338 | var files = _self.pushNameFiles(); 339 | if (_self.options.badge) { 340 | if (_self.$elementFilestyle.find('.badge').length == 0) { 341 | _self.$elementFilestyle.find('label').append(' ' + files.length + ''); 342 | } else if (files.length == 0) { 343 | _self.$elementFilestyle.find('.badge').remove(); 344 | } else { 345 | _self.$elementFilestyle.find('.badge').html(files.length); 346 | } 347 | } else { 348 | _self.$elementFilestyle.find('.badge').remove(); 349 | } 350 | 351 | $('[name="filedrag"]').css('z-index', '-1'); 352 | } 353 | } 354 | } 355 | ); 356 | } 357 | }; 358 | 359 | var old = $.fn.filestyle; 360 | 361 | $.fn.filestyle = function(option, value) { 362 | var get = '', element = this.each(function() { 363 | if ($(this).attr('type') === 'file') { 364 | var $this = $(this), data = $this.data('filestyle'), options = $.extend({}, $.fn.filestyle.defaults, option, typeof option === 'object' && option); 365 | 366 | if (!data) { 367 | $this.data('filestyle', ( data = new Filestyle(this, options))); 368 | data.constructor(); 369 | } 370 | 371 | if ( typeof option === 'string') { 372 | get = data[option](value); 373 | } 374 | } 375 | }); 376 | 377 | if ( typeof get !== undefined) { 378 | return get; 379 | } else { 380 | return element; 381 | } 382 | }; 383 | 384 | $.fn.filestyle.defaults = { 385 | 'text' : 'Choose file', 386 | 'htmlIcon' : '', 387 | 'btnClass' : 'btn-secondary', 388 | 'size' : 'nr', 389 | 'input' : true, 390 | 'badge' : false, 391 | 'badgeName': 'badge-light', 392 | 'buttonBefore' : false, 393 | 'dragdrop' : true, 394 | 'disabled' : false, 395 | 'placeholder': '', 396 | 'onChange': function () {} 397 | }; 398 | 399 | $.fn.filestyle.noConflict = function() { 400 | $.fn.filestyle = old; 401 | return this; 402 | }; 403 | 404 | $(function() { 405 | $('.filestyle').each(function() { 406 | var $this = $(this), options = { 407 | 'input' : $this.attr('data-input') !== 'false', 408 | 'htmlIcon' : $this.attr('data-icon'), 409 | 'buttonBefore' : $this.attr('data-buttonBefore') === 'true', 410 | 'disabled' : $this.attr('data-disabled') === 'true', 411 | 'size' : $this.attr('data-size'), 412 | 'text' : $this.attr('data-text'), 413 | 'btnClass' : $this.attr('data-btnClass'), 414 | 'badge' : $this.attr('data-badge') === 'true', 415 | 'dragdrop' : $this.attr('data-dragdrop') !== 'false', 416 | 'badgeName' : $this.attr('data-badgeName'), 417 | 'placeholder': $this.attr('data-placeholder') 418 | }; 419 | 420 | $this.filestyle(options); 421 | }); 422 | }); 423 | })(window.jQuery); -------------------------------------------------------------------------------- /src/bootstrap-filestyle.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | * bootstrap-filestyle 3 | * doc: http://markusslima.github.io/bootstrap-filestyle/ 4 | * github: https://github.com/markusslima/bootstrap-filestyle 5 | * 6 | * Copyright (c) 2017 Markus Vinicius da Silva Lima 7 | * Version 2.1.0 8 | * Licensed under the MIT license. 9 | */ 10 | !function(e){"use strict";var t=0,i=function(t,i){this.options=i,this.$elementFilestyle=[],this.$element=e(t)};i.prototype={clear:function(){this.$element.val(""),this.$elementFilestyle.find(":text").val(""),this.$elementFilestyle.find(".badge").remove()},destroy:function(){this.$element.removeAttr("style").removeData("filestyle"),this.$elementFilestyle.remove()},disabled:function(e){return e!==!0&&e!==!1?this.options.disabled:(this.options.disabled=e,this.$element.prop("disabled",this.options.disabled),this.$elementFilestyle.find("label").prop("disabled",this.options.disabled),this.options.disabled?this.$elementFilestyle.find("label").css("opacity","0.65"):this.$elementFilestyle.find("label").css("opacity","1"),void 0)},dragdrop:function(e){return e!==!0&&e!==!1?this.options.dragdrop:void(this.options.dragdrop=e)},buttonBefore:function(e){if(e===!0)this.options.buttonBefore||(this.options.buttonBefore=e,this.options.input&&(this.$elementFilestyle.remove(),this.constructor(),this.pushNameFiles()));else{if(e!==!1)return this.options.buttonBefore;this.options.buttonBefore&&(this.options.buttonBefore=e,this.options.input&&(this.$elementFilestyle.remove(),this.constructor(),this.pushNameFiles()))}},input:function(e){if(e===!0)this.options.input||(this.options.input=e,this.options.buttonBefore?this.$elementFilestyle.append(this.htmlInput()):this.$elementFilestyle.prepend(this.htmlInput()),this.pushNameFiles(),this.$elementFilestyle.find(".group-span-filestyle").addClass("input-group-btn"));else{if(e!==!1)return this.options.input;this.options.input&&(this.options.input=e,this.$elementFilestyle.find(":text").remove(),this.$elementFilestyle.find(".group-span-filestyle").removeClass("input-group-btn"))}},size:function(e){if(void 0===e)return this.options.size;this.options.size=e;var t=this.$elementFilestyle.find("label"),i=this.$elementFilestyle.find("input");t.removeClass("btn-lg btn-sm"),i.removeClass("form-control-lg form-control-sm"),"nr"!=this.options.size&&(t.addClass("btn-"+this.options.size),i.addClass("form-control-"+this.options.size))},placeholder:function(e){return void 0===e?this.options.placeholder:(this.options.placeholder=e,void this.$elementFilestyle.find("input").attr("placeholder",e))},text:function(e){return void 0===e?this.options.text:(this.options.text=e,void this.$elementFilestyle.find("label .text").html(this.options.text))},btnClass:function(e){return void 0===e?this.options.btnClass:(this.options.btnClass=e,void this.$elementFilestyle.find("label").attr({"class":"btn "+this.options.btnClass+" btn-"+this.options.size}))},badge:function(e){if(e===!0){this.options.badge=e;var t=this.pushNameFiles();this.$elementFilestyle.find("label").append(' '+t.length+"")}else{if(e!==!1)return this.options.badge;this.options.badge=e,this.$elementFilestyle.find(".badge").remove()}},badgeName:function(e){return void 0===e?this.options.badgeName:(this.options.badgeName=e,void this.$elementFilestyle.find(".badge").attr({"class":"badge "+this.options.badgeName}))},htmlIcon:function(e){return void 0!==e&&(this.options.htmlIcon=e),this.options.htmlIcon},htmlInput:function(){return this.options.input?' ':""},pushNameFiles:function(){var e="",t=[];void 0===this.$element[0].files?t[0]={name:this.$element[0]&&this.$element[0].value}:t=this.$element[0].files;for(var i=0;i",n=i.options.buttonBefore?l+i.htmlInput():i.htmlInput()+l,i.$elementFilestyle=e('
'+n+"
"),i.$elementFilestyle.find(".group-span-filestyle").attr("tabindex","0").keypress(function(e){return 13===e.keyCode||32===e.charCode?(i.$elementFilestyle.find("label").click(),!1):void 0}),i.$element.css({position:"absolute",clip:"rect(0px 0px 0px 0px)"}).attr("tabindex","-1").after(i.$elementFilestyle),i.$elementFilestyle.find(i.options.buttonBefore?"label":":input").css({"border-top-left-radius":".25rem","border-bottom-left-radius":".25rem"}),i.$elementFilestyle.find('[name="filedrag"]').css({position:"absolute",width:"100%",height:i.$elementFilestyle.height()+"px","z-index":-1}),(i.options.disabled||i.$element.attr("disabled"))&&(i.$element.attr("disabled","true"),i.options.disabled?i.$elementFilestyle.find("label").css("opacity","0.65"):i.$elementFilestyle.find("label").css("opacity","1")),i.$element.change(function(){var e=i.pushNameFiles();i.options.badge?0==i.$elementFilestyle.find(".badge").length?i.$elementFilestyle.find("label").append(' '+e.length+""):0==e.length?i.$elementFilestyle.find(".badge").remove():i.$elementFilestyle.find(".badge").html(e.length):i.$elementFilestyle.find(".badge").remove(),i.options.onChange(e)}),window.navigator.userAgent.search(/firefox/i)>-1&&i.$elementFilestyle.find("label").click(function(){return i.$element.click(),!1}),e(document).on("dragover",function(t){t.preventDefault(),t.stopPropagation(),i.options.dragdrop&&e('[name="filedrag"]').css("z-index","9")}).on("drop",function(t){t.preventDefault(),t.stopPropagation(),i.options.dragdrop&&e('[name="filedrag"]').css("z-index","-1")}),i.$elementFilestyle.find('[name="filedrag"]').on("dragover",function(e){e.preventDefault(),e.stopPropagation()}).on("dragenter",function(e){e.preventDefault(),e.stopPropagation()}).on("drop",function(t){if(t.originalEvent.dataTransfer&&!i.options.disabled&&i.options.dragdrop&&t.originalEvent.dataTransfer.files.length){t.preventDefault(),t.stopPropagation(),i.$element[0].files=t.originalEvent.dataTransfer.files;var n=i.pushNameFiles();i.options.badge?0==i.$elementFilestyle.find(".badge").length?i.$elementFilestyle.find("label").append(' '+n.length+""):0==n.length?i.$elementFilestyle.find(".badge").remove():i.$elementFilestyle.find(".badge").html(n.length):i.$elementFilestyle.find(".badge").remove(),e('[name="filedrag"]').css("z-index","-1")}})}};var n=e.fn.filestyle;e.fn.filestyle=function(t,n){var s="",l=this.each(function(){if("file"===e(this).attr("type")){var l=e(this),o=l.data("filestyle"),a=e.extend({},e.fn.filestyle.defaults,t,"object"==typeof t&&t);o||(l.data("filestyle",o=new i(this,a)),o.constructor()),"string"==typeof t&&(s=o[t](n))}});return void 0!==typeof s?s:l},e.fn.filestyle.defaults={text:"Choose file",htmlIcon:"",btnClass:"btn-secondary",size:"nr",input:!0,badge:!1,badgeName:"badge-light",buttonBefore:!1,dragdrop:!0,disabled:!1,placeholder:"",onChange:function(){}},e.fn.filestyle.noConflict=function(){return e.fn.filestyle=n,this},e(function(){e(".filestyle").each(function(){var t=e(this),i={input:"false"!==t.attr("data-input"),htmlIcon:t.attr("data-icon"),buttonBefore:"true"===t.attr("data-buttonBefore"),disabled:"true"===t.attr("data-disabled"),size:t.attr("data-size"),text:t.attr("data-text"),btnClass:t.attr("data-btnClass"),badge:"true"===t.attr("data-badge"),dragdrop:"false"!==t.attr("data-dragdrop"),badgeName:t.attr("data-badgeName"),placeholder:t.attr("data-placeholder")};t.filestyle(i)})})}(window.jQuery); -------------------------------------------------------------------------------- /test/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markusslima/bootstrap-filestyle/071ae6f3ff9a49a04346848b05d165e86c50f3b7/test/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /test/fonts/glyphicons-halflings-regular.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | -------------------------------------------------------------------------------- /test/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markusslima/bootstrap-filestyle/071ae6f3ff9a49a04346848b05d165e86c50f3b7/test/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /test/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markusslima/bootstrap-filestyle/071ae6f3ff9a49a04346848b05d165e86c50f3b7/test/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /test/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Testing - Bootstrap FileStyle 8 | 9 | 10 | 11 | 12 | 15 | 16 | 17 | 18 | 22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 |
30 |
31 |
32 |
33 |

Testing - Bootstrap FileStyle

34 |

View documentation: Doc bootstrap filestyle

35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 | 46 |

Testing Upload

47 |
48 |
49 | 50 |
51 |
52 | 53 |
54 | 55 |
56 | 57 |
58 |
59 |
60 |
61 |
62 |
63 |

Testing Options JavaScript

64 |
65 |
66 | 67 | 68 |
69 |
70 | 71 | 72 |
73 |
74 | 78 | 79 |
80 |
81 | 82 | 83 |
84 |
85 | 86 | 87 |
88 |
89 | 90 | 91 |
92 |
93 | 99 | 100 |
101 |
102 | 108 | 109 |
110 |
111 | 112 | 113 |
114 |
115 | 116 | 117 |
118 |
119 | 120 | 121 |
122 |
123 | 124 | 125 |
126 |
127 | 128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |

Testing multiple initialize

138 |
139 |
140 | 141 | 142 |
143 |
144 | 145 | 146 |
147 |
148 | 149 | 150 |
151 |
152 | 153 | 154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |

Testing initialize via data attributes

164 |
165 |
166 | 167 | 168 |
169 |
170 | 171 | 172 |
173 |
174 |
175 |
176 |
177 | 178 | 179 | 269 | 270 | 271 | -------------------------------------------------------------------------------- /test/js/bootstrap.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap v4.0.0-beta (https://getbootstrap.com) 3 | * Copyright 2011-2017 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) 4 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 5 | */ 6 | if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery. jQuery must be included before Bootstrap's JavaScript.");!function(t){var e=jQuery.fn.jquery.split(" ")[0].split(".");if(e[0]<2&&e[1]<9||1==e[0]&&9==e[1]&&e[2]<1||e[0]>=4)throw new Error("Bootstrap's JavaScript requires at least jQuery v1.9.1 but less than v4.0.0")}(),function(){function t(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function e(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o=function(){function t(t,e){for(var n=0;n0?n:null}catch(t){return null}},reflow:function(t){return t.offsetHeight},triggerTransitionEnd:function(e){t(e).trigger(s.end)},supportsTransitionEnd:function(){return Boolean(s)},typeCheckConfig:function(t,i,o){for(var r in o)if(o.hasOwnProperty(r)){var s=o[r],a=i[r],l=a&&n(a)?"element":e(a);if(!new RegExp(s).test(l))throw new Error(t.toUpperCase()+': Option "'+r+'" provided type "'+l+'" but expected type "'+s+'".')}}};return s=o(),t.fn.emulateTransitionEnd=r,l.supportsTransitionEnd()&&(t.event.special[l.TRANSITION_END]=i()),l}(jQuery),s=(function(t){var e="alert",i=t.fn[e],s={DISMISS:'[data-dismiss="alert"]'},a={CLOSE:"close.bs.alert",CLOSED:"closed.bs.alert",CLICK_DATA_API:"click.bs.alert.data-api"},l={ALERT:"alert",FADE:"fade",SHOW:"show"},h=function(){function e(t){n(this,e),this._element=t}return e.prototype.close=function(t){t=t||this._element;var e=this._getRootElement(t);this._triggerCloseEvent(e).isDefaultPrevented()||this._removeElement(e)},e.prototype.dispose=function(){t.removeData(this._element,"bs.alert"),this._element=null},e.prototype._getRootElement=function(e){var n=r.getSelectorFromElement(e),i=!1;return n&&(i=t(n)[0]),i||(i=t(e).closest("."+l.ALERT)[0]),i},e.prototype._triggerCloseEvent=function(e){var n=t.Event(a.CLOSE);return t(e).trigger(n),n},e.prototype._removeElement=function(e){var n=this;t(e).removeClass(l.SHOW),r.supportsTransitionEnd()&&t(e).hasClass(l.FADE)?t(e).one(r.TRANSITION_END,function(t){return n._destroyElement(e,t)}).emulateTransitionEnd(150):this._destroyElement(e)},e.prototype._destroyElement=function(e){t(e).detach().trigger(a.CLOSED).remove()},e._jQueryInterface=function(n){return this.each(function(){var i=t(this),o=i.data("bs.alert");o||(o=new e(this),i.data("bs.alert",o)),"close"===n&&o[n](this)})},e._handleDismiss=function(t){return function(e){e&&e.preventDefault(),t.close(this)}},o(e,null,[{key:"VERSION",get:function(){return"4.0.0-beta"}}]),e}();t(document).on(a.CLICK_DATA_API,s.DISMISS,h._handleDismiss(new h)),t.fn[e]=h._jQueryInterface,t.fn[e].Constructor=h,t.fn[e].noConflict=function(){return t.fn[e]=i,h._jQueryInterface}}(jQuery),function(t){var e="button",i=t.fn[e],r={ACTIVE:"active",BUTTON:"btn",FOCUS:"focus"},s={DATA_TOGGLE_CARROT:'[data-toggle^="button"]',DATA_TOGGLE:'[data-toggle="buttons"]',INPUT:"input",ACTIVE:".active",BUTTON:".btn"},a={CLICK_DATA_API:"click.bs.button.data-api",FOCUS_BLUR_DATA_API:"focus.bs.button.data-api blur.bs.button.data-api"},l=function(){function e(t){n(this,e),this._element=t}return e.prototype.toggle=function(){var e=!0,n=!0,i=t(this._element).closest(s.DATA_TOGGLE)[0];if(i){var o=t(this._element).find(s.INPUT)[0];if(o){if("radio"===o.type)if(o.checked&&t(this._element).hasClass(r.ACTIVE))e=!1;else{var a=t(i).find(s.ACTIVE)[0];a&&t(a).removeClass(r.ACTIVE)}if(e){if(o.hasAttribute("disabled")||i.hasAttribute("disabled")||o.classList.contains("disabled")||i.classList.contains("disabled"))return;o.checked=!t(this._element).hasClass(r.ACTIVE),t(o).trigger("change")}o.focus(),n=!1}}n&&this._element.setAttribute("aria-pressed",!t(this._element).hasClass(r.ACTIVE)),e&&t(this._element).toggleClass(r.ACTIVE)},e.prototype.dispose=function(){t.removeData(this._element,"bs.button"),this._element=null},e._jQueryInterface=function(n){return this.each(function(){var i=t(this).data("bs.button");i||(i=new e(this),t(this).data("bs.button",i)),"toggle"===n&&i[n]()})},o(e,null,[{key:"VERSION",get:function(){return"4.0.0-beta"}}]),e}();t(document).on(a.CLICK_DATA_API,s.DATA_TOGGLE_CARROT,function(e){e.preventDefault();var n=e.target;t(n).hasClass(r.BUTTON)||(n=t(n).closest(s.BUTTON)),l._jQueryInterface.call(t(n),"toggle")}).on(a.FOCUS_BLUR_DATA_API,s.DATA_TOGGLE_CARROT,function(e){var n=t(e.target).closest(s.BUTTON)[0];t(n).toggleClass(r.FOCUS,/^focus(in)?$/.test(e.type))}),t.fn[e]=l._jQueryInterface,t.fn[e].Constructor=l,t.fn[e].noConflict=function(){return t.fn[e]=i,l._jQueryInterface}}(jQuery),function(t){var e="carousel",s="bs.carousel",a="."+s,l=t.fn[e],h={interval:5e3,keyboard:!0,slide:!1,pause:"hover",wrap:!0},c={interval:"(number|boolean)",keyboard:"boolean",slide:"(boolean|string)",pause:"(string|boolean)",wrap:"boolean"},u={NEXT:"next",PREV:"prev",LEFT:"left",RIGHT:"right"},d={SLIDE:"slide"+a,SLID:"slid"+a,KEYDOWN:"keydown"+a,MOUSEENTER:"mouseenter"+a,MOUSELEAVE:"mouseleave"+a,TOUCHEND:"touchend"+a,LOAD_DATA_API:"load.bs.carousel.data-api",CLICK_DATA_API:"click.bs.carousel.data-api"},f={CAROUSEL:"carousel",ACTIVE:"active",SLIDE:"slide",RIGHT:"carousel-item-right",LEFT:"carousel-item-left",NEXT:"carousel-item-next",PREV:"carousel-item-prev",ITEM:"carousel-item"},p={ACTIVE:".active",ACTIVE_ITEM:".active.carousel-item",ITEM:".carousel-item",NEXT_PREV:".carousel-item-next, .carousel-item-prev",INDICATORS:".carousel-indicators",DATA_SLIDE:"[data-slide], [data-slide-to]",DATA_RIDE:'[data-ride="carousel"]'},_=function(){function l(e,i){n(this,l),this._items=null,this._interval=null,this._activeElement=null,this._isPaused=!1,this._isSliding=!1,this.touchTimeout=null,this._config=this._getConfig(i),this._element=t(e)[0],this._indicatorsElement=t(this._element).find(p.INDICATORS)[0],this._addEventListeners()}return l.prototype.next=function(){this._isSliding||this._slide(u.NEXT)},l.prototype.nextWhenVisible=function(){document.hidden||this.next()},l.prototype.prev=function(){this._isSliding||this._slide(u.PREV)},l.prototype.pause=function(e){e||(this._isPaused=!0),t(this._element).find(p.NEXT_PREV)[0]&&r.supportsTransitionEnd()&&(r.triggerTransitionEnd(this._element),this.cycle(!0)),clearInterval(this._interval),this._interval=null},l.prototype.cycle=function(t){t||(this._isPaused=!1),this._interval&&(clearInterval(this._interval),this._interval=null),this._config.interval&&!this._isPaused&&(this._interval=setInterval((document.visibilityState?this.nextWhenVisible:this.next).bind(this),this._config.interval))},l.prototype.to=function(e){var n=this;this._activeElement=t(this._element).find(p.ACTIVE_ITEM)[0];var i=this._getItemIndex(this._activeElement);if(!(e>this._items.length-1||e<0))if(this._isSliding)t(this._element).one(d.SLID,function(){return n.to(e)});else{if(i===e)return this.pause(),void this.cycle();var o=e>i?u.NEXT:u.PREV;this._slide(o,this._items[e])}},l.prototype.dispose=function(){t(this._element).off(a),t.removeData(this._element,s),this._items=null,this._config=null,this._element=null,this._interval=null,this._isPaused=null,this._isSliding=null,this._activeElement=null,this._indicatorsElement=null},l.prototype._getConfig=function(n){return n=t.extend({},h,n),r.typeCheckConfig(e,n,c),n},l.prototype._addEventListeners=function(){var e=this;this._config.keyboard&&t(this._element).on(d.KEYDOWN,function(t){return e._keydown(t)}),"hover"===this._config.pause&&(t(this._element).on(d.MOUSEENTER,function(t){return e.pause(t)}).on(d.MOUSELEAVE,function(t){return e.cycle(t)}),"ontouchstart"in document.documentElement&&t(this._element).on(d.TOUCHEND,function(){e.pause(),e.touchTimeout&&clearTimeout(e.touchTimeout),e.touchTimeout=setTimeout(function(t){return e.cycle(t)},500+e._config.interval)}))},l.prototype._keydown=function(t){if(!/input|textarea/i.test(t.target.tagName))switch(t.which){case 37:t.preventDefault(),this.prev();break;case 39:t.preventDefault(),this.next();break;default:return}},l.prototype._getItemIndex=function(e){return this._items=t.makeArray(t(e).parent().find(p.ITEM)),this._items.indexOf(e)},l.prototype._getItemByDirection=function(t,e){var n=t===u.NEXT,i=t===u.PREV,o=this._getItemIndex(e),r=this._items.length-1;if((i&&0===o||n&&o===r)&&!this._config.wrap)return e;var s=(o+(t===u.PREV?-1:1))%this._items.length;return-1===s?this._items[this._items.length-1]:this._items[s]},l.prototype._triggerSlideEvent=function(e,n){var i=this._getItemIndex(e),o=this._getItemIndex(t(this._element).find(p.ACTIVE_ITEM)[0]),r=t.Event(d.SLIDE,{relatedTarget:e,direction:n,from:o,to:i});return t(this._element).trigger(r),r},l.prototype._setActiveIndicatorElement=function(e){if(this._indicatorsElement){t(this._indicatorsElement).find(p.ACTIVE).removeClass(f.ACTIVE);var n=this._indicatorsElement.children[this._getItemIndex(e)];n&&t(n).addClass(f.ACTIVE)}},l.prototype._slide=function(e,n){var i=this,o=t(this._element).find(p.ACTIVE_ITEM)[0],s=this._getItemIndex(o),a=n||o&&this._getItemByDirection(e,o),l=this._getItemIndex(a),h=Boolean(this._interval),c=void 0,_=void 0,g=void 0;if(e===u.NEXT?(c=f.LEFT,_=f.NEXT,g=u.LEFT):(c=f.RIGHT,_=f.PREV,g=u.RIGHT),a&&t(a).hasClass(f.ACTIVE))this._isSliding=!1;else if(!this._triggerSlideEvent(a,g).isDefaultPrevented()&&o&&a){this._isSliding=!0,h&&this.pause(),this._setActiveIndicatorElement(a);var m=t.Event(d.SLID,{relatedTarget:a,direction:g,from:s,to:l});r.supportsTransitionEnd()&&t(this._element).hasClass(f.SLIDE)?(t(a).addClass(_),r.reflow(a),t(o).addClass(c),t(a).addClass(c),t(o).one(r.TRANSITION_END,function(){t(a).removeClass(c+" "+_).addClass(f.ACTIVE),t(o).removeClass(f.ACTIVE+" "+_+" "+c),i._isSliding=!1,setTimeout(function(){return t(i._element).trigger(m)},0)}).emulateTransitionEnd(600)):(t(o).removeClass(f.ACTIVE),t(a).addClass(f.ACTIVE),this._isSliding=!1,t(this._element).trigger(m)),h&&this.cycle()}},l._jQueryInterface=function(e){return this.each(function(){var n=t(this).data(s),o=t.extend({},h,t(this).data());"object"===(void 0===e?"undefined":i(e))&&t.extend(o,e);var r="string"==typeof e?e:o.slide;if(n||(n=new l(this,o),t(this).data(s,n)),"number"==typeof e)n.to(e);else if("string"==typeof r){if(void 0===n[r])throw new Error('No method named "'+r+'"');n[r]()}else o.interval&&(n.pause(),n.cycle())})},l._dataApiClickHandler=function(e){var n=r.getSelectorFromElement(this);if(n){var i=t(n)[0];if(i&&t(i).hasClass(f.CAROUSEL)){var o=t.extend({},t(i).data(),t(this).data()),a=this.getAttribute("data-slide-to");a&&(o.interval=!1),l._jQueryInterface.call(t(i),o),a&&t(i).data(s).to(a),e.preventDefault()}}},o(l,null,[{key:"VERSION",get:function(){return"4.0.0-beta"}},{key:"Default",get:function(){return h}}]),l}();t(document).on(d.CLICK_DATA_API,p.DATA_SLIDE,_._dataApiClickHandler),t(window).on(d.LOAD_DATA_API,function(){t(p.DATA_RIDE).each(function(){var e=t(this);_._jQueryInterface.call(e,e.data())})}),t.fn[e]=_._jQueryInterface,t.fn[e].Constructor=_,t.fn[e].noConflict=function(){return t.fn[e]=l,_._jQueryInterface}}(jQuery),function(t){var e="collapse",s="bs.collapse",a=t.fn[e],l={toggle:!0,parent:""},h={toggle:"boolean",parent:"string"},c={SHOW:"show.bs.collapse",SHOWN:"shown.bs.collapse",HIDE:"hide.bs.collapse",HIDDEN:"hidden.bs.collapse",CLICK_DATA_API:"click.bs.collapse.data-api"},u={SHOW:"show",COLLAPSE:"collapse",COLLAPSING:"collapsing",COLLAPSED:"collapsed"},d={WIDTH:"width",HEIGHT:"height"},f={ACTIVES:".show, .collapsing",DATA_TOGGLE:'[data-toggle="collapse"]'},p=function(){function a(e,i){n(this,a),this._isTransitioning=!1,this._element=e,this._config=this._getConfig(i),this._triggerArray=t.makeArray(t('[data-toggle="collapse"][href="#'+e.id+'"],[data-toggle="collapse"][data-target="#'+e.id+'"]'));for(var o=t(f.DATA_TOGGLE),s=0;s0&&this._triggerArray.push(l)}this._parent=this._config.parent?this._getParent():null,this._config.parent||this._addAriaAndCollapsedClass(this._element,this._triggerArray),this._config.toggle&&this.toggle()}return a.prototype.toggle=function(){t(this._element).hasClass(u.SHOW)?this.hide():this.show()},a.prototype.show=function(){var e=this;if(!this._isTransitioning&&!t(this._element).hasClass(u.SHOW)){var n=void 0,i=void 0;if(this._parent&&((n=t.makeArray(t(this._parent).children().children(f.ACTIVES))).length||(n=null)),!(n&&(i=t(n).data(s))&&i._isTransitioning)){var o=t.Event(c.SHOW);if(t(this._element).trigger(o),!o.isDefaultPrevented()){n&&(a._jQueryInterface.call(t(n),"hide"),i||t(n).data(s,null));var l=this._getDimension();t(this._element).removeClass(u.COLLAPSE).addClass(u.COLLAPSING),this._element.style[l]=0,this._triggerArray.length&&t(this._triggerArray).removeClass(u.COLLAPSED).attr("aria-expanded",!0),this.setTransitioning(!0);var h=function(){t(e._element).removeClass(u.COLLAPSING).addClass(u.COLLAPSE).addClass(u.SHOW),e._element.style[l]="",e.setTransitioning(!1),t(e._element).trigger(c.SHOWN)};if(r.supportsTransitionEnd()){var d="scroll"+(l[0].toUpperCase()+l.slice(1));t(this._element).one(r.TRANSITION_END,h).emulateTransitionEnd(600),this._element.style[l]=this._element[d]+"px"}else h()}}}},a.prototype.hide=function(){var e=this;if(!this._isTransitioning&&t(this._element).hasClass(u.SHOW)){var n=t.Event(c.HIDE);if(t(this._element).trigger(n),!n.isDefaultPrevented()){var i=this._getDimension();if(this._element.style[i]=this._element.getBoundingClientRect()[i]+"px",r.reflow(this._element),t(this._element).addClass(u.COLLAPSING).removeClass(u.COLLAPSE).removeClass(u.SHOW),this._triggerArray.length)for(var o=0;o0},l.prototype._getPopperConfig=function(){var t={placement:this._getPlacement(),modifiers:{offset:{offset:this._config.offset},flip:{enabled:this._config.flip}}};return this._inNavbar&&(t.modifiers.applyStyle={enabled:!this._inNavbar}),t},l._jQueryInterface=function(e){return this.each(function(){var n=t(this).data(s),o="object"===(void 0===e?"undefined":i(e))?e:null;if(n||(n=new l(this,o),t(this).data(s,n)),"string"==typeof e){if(void 0===n[e])throw new Error('No method named "'+e+'"');n[e]()}})},l._clearMenus=function(e){if(!e||3!==e.which&&("keyup"!==e.type||9===e.which))for(var n=t.makeArray(t(d.DATA_TOGGLE)),i=0;i0&&r--,40===e.which&&rdocument.documentElement.clientHeight;!this._isBodyOverflowing&&t&&(this._element.style.paddingLeft=this._scrollbarWidth+"px"),this._isBodyOverflowing&&!t&&(this._element.style.paddingRight=this._scrollbarWidth+"px")},a.prototype._resetAdjustments=function(){this._element.style.paddingLeft="",this._element.style.paddingRight=""},a.prototype._checkScrollbar=function(){this._isBodyOverflowing=document.body.clientWidth=n){var i=this._targets[this._targets.length-1];this._activeTarget!==i&&this._activate(i)}else{if(this._activeTarget&&t0)return this._activeTarget=null,void this._clear();for(var o=this._offsets.length;o--;)this._activeTarget!==this._targets[o]&&t>=this._offsets[o]&&(void 0===this._offsets[o+1]||t .dropdown-menu .active"},l=function(){function e(t){n(this,e),this._element=t}return e.prototype.show=function(){var e=this;if(!(this._element.parentNode&&this._element.parentNode.nodeType===Node.ELEMENT_NODE&&t(this._element).hasClass(s.ACTIVE)||t(this._element).hasClass(s.DISABLED))){var n=void 0,o=void 0,l=t(this._element).closest(a.NAV_LIST_GROUP)[0],h=r.getSelectorFromElement(this._element);l&&(o=t.makeArray(t(l).find(a.ACTIVE)),o=o[o.length-1]);var c=t.Event(i.HIDE,{relatedTarget:this._element}),u=t.Event(i.SHOW,{relatedTarget:o});if(o&&t(o).trigger(c),t(this._element).trigger(u),!u.isDefaultPrevented()&&!c.isDefaultPrevented()){h&&(n=t(h)[0]),this._activate(this._element,l);var d=function(){var n=t.Event(i.HIDDEN,{relatedTarget:e._element}),r=t.Event(i.SHOWN,{relatedTarget:o});t(o).trigger(n),t(e._element).trigger(r)};n?this._activate(n,n.parentNode,d):d()}}},e.prototype.dispose=function(){t.removeData(this._element,"bs.tab"),this._element=null},e.prototype._activate=function(e,n,i){var o=this,l=t(n).find(a.ACTIVE)[0],h=i&&r.supportsTransitionEnd()&&l&&t(l).hasClass(s.FADE),c=function(){return o._transitionComplete(e,l,h,i)};l&&h?t(l).one(r.TRANSITION_END,c).emulateTransitionEnd(150):c(),l&&t(l).removeClass(s.SHOW)},e.prototype._transitionComplete=function(e,n,i,o){if(n){t(n).removeClass(s.ACTIVE);var l=t(n.parentNode).find(a.DROPDOWN_ACTIVE_CHILD)[0];l&&t(l).removeClass(s.ACTIVE),n.setAttribute("aria-expanded",!1)}if(t(e).addClass(s.ACTIVE),e.setAttribute("aria-expanded",!0),i?(r.reflow(e),t(e).addClass(s.SHOW)):t(e).removeClass(s.FADE),e.parentNode&&t(e.parentNode).hasClass(s.DROPDOWN_MENU)){var h=t(e).closest(a.DROPDOWN)[0];h&&t(h).find(a.DROPDOWN_TOGGLE).addClass(s.ACTIVE),e.setAttribute("aria-expanded",!0)}o&&o()},e._jQueryInterface=function(n){return this.each(function(){var i=t(this),o=i.data("bs.tab");if(o||(o=new e(this),i.data("bs.tab",o)),"string"==typeof n){if(void 0===o[n])throw new Error('No method named "'+n+'"');o[n]()}})},o(e,null,[{key:"VERSION",get:function(){return"4.0.0-beta"}}]),e}();t(document).on(i.CLICK_DATA_API,a.DATA_TOGGLE,function(e){e.preventDefault(),l._jQueryInterface.call(t(this),"show")}),t.fn.tab=l._jQueryInterface,t.fn.tab.Constructor=l,t.fn.tab.noConflict=function(){return t.fn.tab=e,l._jQueryInterface}}(jQuery),function(t){if("undefined"==typeof Popper)throw new Error("Bootstrap tooltips require Popper.js (https://popper.js.org)");var e="tooltip",s=".bs.tooltip",a=t.fn[e],l=new RegExp("(^|\\s)bs-tooltip\\S+","g"),h={animation:"boolean",template:"string",title:"(string|element|function)",trigger:"string",delay:"(number|object)",html:"boolean",selector:"(string|boolean)",placement:"(string|function)",offset:"(number|string)",container:"(string|element|boolean)",fallbackPlacement:"(string|array)"},c={AUTO:"auto",TOP:"top",RIGHT:"right",BOTTOM:"bottom",LEFT:"left"},u={animation:!0,template:'',trigger:"hover focus",title:"",delay:0,html:!1,selector:!1,placement:"top",offset:0,container:!1,fallbackPlacement:"flip"},d={SHOW:"show",OUT:"out"},f={HIDE:"hide"+s,HIDDEN:"hidden"+s,SHOW:"show"+s,SHOWN:"shown"+s,INSERTED:"inserted"+s,CLICK:"click"+s,FOCUSIN:"focusin"+s,FOCUSOUT:"focusout"+s,MOUSEENTER:"mouseenter"+s,MOUSELEAVE:"mouseleave"+s},p={FADE:"fade",SHOW:"show"},_={TOOLTIP:".tooltip",TOOLTIP_INNER:".tooltip-inner",ARROW:".arrow"},g={HOVER:"hover",FOCUS:"focus",CLICK:"click",MANUAL:"manual"},m=function(){function a(t,e){n(this,a),this._isEnabled=!0,this._timeout=0,this._hoverState="",this._activeTrigger={},this._popper=null,this.element=t,this.config=this._getConfig(e),this.tip=null,this._setListeners()}return a.prototype.enable=function(){this._isEnabled=!0},a.prototype.disable=function(){this._isEnabled=!1},a.prototype.toggleEnabled=function(){this._isEnabled=!this._isEnabled},a.prototype.toggle=function(e){if(e){var n=this.constructor.DATA_KEY,i=t(e.currentTarget).data(n);i||(i=new this.constructor(e.currentTarget,this._getDelegateConfig()),t(e.currentTarget).data(n,i)),i._activeTrigger.click=!i._activeTrigger.click,i._isWithActiveTrigger()?i._enter(null,i):i._leave(null,i)}else{if(t(this.getTipElement()).hasClass(p.SHOW))return void this._leave(null,this);this._enter(null,this)}},a.prototype.dispose=function(){clearTimeout(this._timeout),t.removeData(this.element,this.constructor.DATA_KEY),t(this.element).off(this.constructor.EVENT_KEY),t(this.element).closest(".modal").off("hide.bs.modal"),this.tip&&t(this.tip).remove(),this._isEnabled=null,this._timeout=null,this._hoverState=null,this._activeTrigger=null,null!==this._popper&&this._popper.destroy(),this._popper=null,this.element=null,this.config=null,this.tip=null},a.prototype.show=function(){var e=this;if("none"===t(this.element).css("display"))throw new Error("Please use show on visible elements");var n=t.Event(this.constructor.Event.SHOW);if(this.isWithContent()&&this._isEnabled){t(this.element).trigger(n);var i=t.contains(this.element.ownerDocument.documentElement,this.element);if(n.isDefaultPrevented()||!i)return;var o=this.getTipElement(),s=r.getUID(this.constructor.NAME);o.setAttribute("id",s),this.element.setAttribute("aria-describedby",s),this.setContent(),this.config.animation&&t(o).addClass(p.FADE);var l="function"==typeof this.config.placement?this.config.placement.call(this,o,this.element):this.config.placement,h=this._getAttachment(l);this.addAttachmentClass(h);var c=!1===this.config.container?document.body:t(this.config.container);t(o).data(this.constructor.DATA_KEY,this),t.contains(this.element.ownerDocument.documentElement,this.tip)||t(o).appendTo(c),t(this.element).trigger(this.constructor.Event.INSERTED),this._popper=new Popper(this.element,o,{placement:h,modifiers:{offset:{offset:this.config.offset},flip:{behavior:this.config.fallbackPlacement},arrow:{element:_.ARROW}},onCreate:function(t){t.originalPlacement!==t.placement&&e._handlePopperPlacementChange(t)},onUpdate:function(t){e._handlePopperPlacementChange(t)}}),t(o).addClass(p.SHOW),"ontouchstart"in document.documentElement&&t("body").children().on("mouseover",null,t.noop);var u=function(){e.config.animation&&e._fixTransition();var n=e._hoverState;e._hoverState=null,t(e.element).trigger(e.constructor.Event.SHOWN),n===d.OUT&&e._leave(null,e)};r.supportsTransitionEnd()&&t(this.tip).hasClass(p.FADE)?t(this.tip).one(r.TRANSITION_END,u).emulateTransitionEnd(a._TRANSITION_DURATION):u()}},a.prototype.hide=function(e){var n=this,i=this.getTipElement(),o=t.Event(this.constructor.Event.HIDE),s=function(){n._hoverState!==d.SHOW&&i.parentNode&&i.parentNode.removeChild(i),n._cleanTipClass(),n.element.removeAttribute("aria-describedby"),t(n.element).trigger(n.constructor.Event.HIDDEN),null!==n._popper&&n._popper.destroy(),e&&e()};t(this.element).trigger(o),o.isDefaultPrevented()||(t(i).removeClass(p.SHOW),"ontouchstart"in document.documentElement&&t("body").children().off("mouseover",null,t.noop),this._activeTrigger[g.CLICK]=!1,this._activeTrigger[g.FOCUS]=!1,this._activeTrigger[g.HOVER]=!1,r.supportsTransitionEnd()&&t(this.tip).hasClass(p.FADE)?t(i).one(r.TRANSITION_END,s).emulateTransitionEnd(150):s(),this._hoverState="")},a.prototype.update=function(){null!==this._popper&&this._popper.scheduleUpdate()},a.prototype.isWithContent=function(){return Boolean(this.getTitle())},a.prototype.addAttachmentClass=function(e){t(this.getTipElement()).addClass("bs-tooltip-"+e)},a.prototype.getTipElement=function(){return this.tip=this.tip||t(this.config.template)[0]},a.prototype.setContent=function(){var e=t(this.getTipElement());this.setElementContent(e.find(_.TOOLTIP_INNER),this.getTitle()),e.removeClass(p.FADE+" "+p.SHOW)},a.prototype.setElementContent=function(e,n){var o=this.config.html;"object"===(void 0===n?"undefined":i(n))&&(n.nodeType||n.jquery)?o?t(n).parent().is(e)||e.empty().append(n):e.text(t(n).text()):e[o?"html":"text"](n)},a.prototype.getTitle=function(){var t=this.element.getAttribute("data-original-title");return t||(t="function"==typeof this.config.title?this.config.title.call(this.element):this.config.title),t},a.prototype._getAttachment=function(t){return c[t.toUpperCase()]},a.prototype._setListeners=function(){var e=this;this.config.trigger.split(" ").forEach(function(n){if("click"===n)t(e.element).on(e.constructor.Event.CLICK,e.config.selector,function(t){return e.toggle(t)});else if(n!==g.MANUAL){var i=n===g.HOVER?e.constructor.Event.MOUSEENTER:e.constructor.Event.FOCUSIN,o=n===g.HOVER?e.constructor.Event.MOUSELEAVE:e.constructor.Event.FOCUSOUT;t(e.element).on(i,e.config.selector,function(t){return e._enter(t)}).on(o,e.config.selector,function(t){return e._leave(t)})}t(e.element).closest(".modal").on("hide.bs.modal",function(){return e.hide()})}),this.config.selector?this.config=t.extend({},this.config,{trigger:"manual",selector:""}):this._fixTitle()},a.prototype._fixTitle=function(){var t=i(this.element.getAttribute("data-original-title"));(this.element.getAttribute("title")||"string"!==t)&&(this.element.setAttribute("data-original-title",this.element.getAttribute("title")||""),this.element.setAttribute("title",""))},a.prototype._enter=function(e,n){var i=this.constructor.DATA_KEY;(n=n||t(e.currentTarget).data(i))||(n=new this.constructor(e.currentTarget,this._getDelegateConfig()),t(e.currentTarget).data(i,n)),e&&(n._activeTrigger["focusin"===e.type?g.FOCUS:g.HOVER]=!0),t(n.getTipElement()).hasClass(p.SHOW)||n._hoverState===d.SHOW?n._hoverState=d.SHOW:(clearTimeout(n._timeout),n._hoverState=d.SHOW,n.config.delay&&n.config.delay.show?n._timeout=setTimeout(function(){n._hoverState===d.SHOW&&n.show()},n.config.delay.show):n.show())},a.prototype._leave=function(e,n){var i=this.constructor.DATA_KEY;(n=n||t(e.currentTarget).data(i))||(n=new this.constructor(e.currentTarget,this._getDelegateConfig()),t(e.currentTarget).data(i,n)),e&&(n._activeTrigger["focusout"===e.type?g.FOCUS:g.HOVER]=!1),n._isWithActiveTrigger()||(clearTimeout(n._timeout),n._hoverState=d.OUT,n.config.delay&&n.config.delay.hide?n._timeout=setTimeout(function(){n._hoverState===d.OUT&&n.hide()},n.config.delay.hide):n.hide())},a.prototype._isWithActiveTrigger=function(){for(var t in this._activeTrigger)if(this._activeTrigger[t])return!0;return!1},a.prototype._getConfig=function(n){return(n=t.extend({},this.constructor.Default,t(this.element).data(),n)).delay&&"number"==typeof n.delay&&(n.delay={show:n.delay,hide:n.delay}),n.title&&"number"==typeof n.title&&(n.title=n.title.toString()),n.content&&"number"==typeof n.content&&(n.content=n.content.toString()),r.typeCheckConfig(e,n,this.constructor.DefaultType),n},a.prototype._getDelegateConfig=function(){var t={};if(this.config)for(var e in this.config)this.constructor.Default[e]!==this.config[e]&&(t[e]=this.config[e]);return t},a.prototype._cleanTipClass=function(){var e=t(this.getTipElement()),n=e.attr("class").match(l);null!==n&&n.length>0&&e.removeClass(n.join(""))},a.prototype._handlePopperPlacementChange=function(t){this._cleanTipClass(),this.addAttachmentClass(this._getAttachment(t.placement))},a.prototype._fixTransition=function(){var e=this.getTipElement(),n=this.config.animation;null===e.getAttribute("x-placement")&&(t(e).removeClass(p.FADE),this.config.animation=!1,this.hide(),this.show(),this.config.animation=n)},a._jQueryInterface=function(e){return this.each(function(){var n=t(this).data("bs.tooltip"),o="object"===(void 0===e?"undefined":i(e))&&e;if((n||!/dispose|hide/.test(e))&&(n||(n=new a(this,o),t(this).data("bs.tooltip",n)),"string"==typeof e)){if(void 0===n[e])throw new Error('No method named "'+e+'"');n[e]()}})},o(a,null,[{key:"VERSION",get:function(){return"4.0.0-beta"}},{key:"Default",get:function(){return u}},{key:"NAME",get:function(){return e}},{key:"DATA_KEY",get:function(){return"bs.tooltip"}},{key:"Event",get:function(){return f}},{key:"EVENT_KEY",get:function(){return s}},{key:"DefaultType",get:function(){return h}}]),a}();return t.fn[e]=m._jQueryInterface,t.fn[e].Constructor=m,t.fn[e].noConflict=function(){return t.fn[e]=a,m._jQueryInterface},m}(jQuery));!function(r){var a="popover",l=".bs.popover",h=r.fn[a],c=new RegExp("(^|\\s)bs-popover\\S+","g"),u=r.extend({},s.Default,{placement:"right",trigger:"click",content:"",template:''}),d=r.extend({},s.DefaultType,{content:"(string|element|function)"}),f={FADE:"fade",SHOW:"show"},p={TITLE:".popover-header",CONTENT:".popover-body"},_={HIDE:"hide"+l,HIDDEN:"hidden"+l,SHOW:"show"+l,SHOWN:"shown"+l,INSERTED:"inserted"+l,CLICK:"click"+l,FOCUSIN:"focusin"+l,FOCUSOUT:"focusout"+l,MOUSEENTER:"mouseenter"+l,MOUSELEAVE:"mouseleave"+l},g=function(s){function h(){return n(this,h),t(this,s.apply(this,arguments))}return e(h,s),h.prototype.isWithContent=function(){return this.getTitle()||this._getContent()},h.prototype.addAttachmentClass=function(t){r(this.getTipElement()).addClass("bs-popover-"+t)},h.prototype.getTipElement=function(){return this.tip=this.tip||r(this.config.template)[0]},h.prototype.setContent=function(){var t=r(this.getTipElement());this.setElementContent(t.find(p.TITLE),this.getTitle()),this.setElementContent(t.find(p.CONTENT),this._getContent()),t.removeClass(f.FADE+" "+f.SHOW)},h.prototype._getContent=function(){return this.element.getAttribute("data-content")||("function"==typeof this.config.content?this.config.content.call(this.element):this.config.content)},h.prototype._cleanTipClass=function(){var t=r(this.getTipElement()),e=t.attr("class").match(c);null!==e&&e.length>0&&t.removeClass(e.join(""))},h._jQueryInterface=function(t){return this.each(function(){var e=r(this).data("bs.popover"),n="object"===(void 0===t?"undefined":i(t))?t:null;if((e||!/destroy|hide/.test(t))&&(e||(e=new h(this,n),r(this).data("bs.popover",e)),"string"==typeof t)){if(void 0===e[t])throw new Error('No method named "'+t+'"');e[t]()}})},o(h,null,[{key:"VERSION",get:function(){return"4.0.0-beta"}},{key:"Default",get:function(){return u}},{key:"NAME",get:function(){return a}},{key:"DATA_KEY",get:function(){return"bs.popover"}},{key:"Event",get:function(){return _}},{key:"EVENT_KEY",get:function(){return l}},{key:"DefaultType",get:function(){return d}}]),h}(s);r.fn[a]=g._jQueryInterface,r.fn[a].Constructor=g,r.fn[a].noConflict=function(){return r.fn[a]=h,g._jQueryInterface}}(jQuery)}(); -------------------------------------------------------------------------------- /test/open-iconic/font/css/open-iconic-bootstrap.css: -------------------------------------------------------------------------------- 1 | /* Bootstrap */ 2 | 3 | @font-face { 4 | font-family: 'Icons'; 5 | src: url('../fonts/open-iconic.eot'); 6 | src: url('../fonts/open-iconic.eot?#iconic-sm') format('embedded-opentype'), url('../fonts/open-iconic.woff') format('woff'), url('../fonts/open-iconic.ttf') format('truetype'), url('../fonts/open-iconic.otf') format('opentype'), url('../fonts/open-iconic.svg#iconic-sm') format('svg'); 7 | font-weight: normal; 8 | font-style: normal; 9 | } 10 | 11 | .oi { 12 | position: relative; 13 | top: 1px; 14 | display: inline-block; 15 | speak:none; 16 | font-family: 'Icons'; 17 | font-style: normal; 18 | font-weight: normal; 19 | line-height: 1; 20 | -webkit-font-smoothing: antialiased; 21 | -moz-osx-font-smoothing: grayscale; 22 | } 23 | 24 | .oi:empty:before { 25 | width: 1em; 26 | text-align: center; 27 | box-sizing: content-box; 28 | } 29 | 30 | .oi.oi-align-center:before { 31 | text-align: center; 32 | } 33 | 34 | .oi.oi-align-left:before { 35 | text-align: left; 36 | } 37 | 38 | .oi.oi-align-right:before { 39 | text-align: right; 40 | } 41 | 42 | 43 | .oi.oi-flip-horizontal:before { 44 | -webkit-transform: scale(-1, 1); 45 | -ms-transform: scale(-1, 1); 46 | transform: scale(-1, 1); 47 | } 48 | 49 | .oi.oi-flip-vertical:before { 50 | -webkit-transform: scale(1, -1); 51 | -ms-transform: scale(-1, 1); 52 | transform: scale(1, -1); 53 | } 54 | 55 | .oi.oi-flip-horizontal-vertical:before { 56 | -webkit-transform: scale(-1, -1); 57 | -ms-transform: scale(-1, 1); 58 | transform: scale(-1, -1); 59 | } 60 | 61 | 62 | .oi-account-login:before { 63 | content:'\e000'; 64 | } 65 | 66 | .oi-account-logout:before { 67 | content:'\e001'; 68 | } 69 | 70 | .oi-action-redo:before { 71 | content:'\e002'; 72 | } 73 | 74 | .oi-action-undo:before { 75 | content:'\e003'; 76 | } 77 | 78 | .oi-align-center:before { 79 | content:'\e004'; 80 | } 81 | 82 | .oi-align-left:before { 83 | content:'\e005'; 84 | } 85 | 86 | .oi-align-right:before { 87 | content:'\e006'; 88 | } 89 | 90 | .oi-aperture:before { 91 | content:'\e007'; 92 | } 93 | 94 | .oi-arrow-bottom:before { 95 | content:'\e008'; 96 | } 97 | 98 | .oi-arrow-circle-bottom:before { 99 | content:'\e009'; 100 | } 101 | 102 | .oi-arrow-circle-left:before { 103 | content:'\e00a'; 104 | } 105 | 106 | .oi-arrow-circle-right:before { 107 | content:'\e00b'; 108 | } 109 | 110 | .oi-arrow-circle-top:before { 111 | content:'\e00c'; 112 | } 113 | 114 | .oi-arrow-left:before { 115 | content:'\e00d'; 116 | } 117 | 118 | .oi-arrow-right:before { 119 | content:'\e00e'; 120 | } 121 | 122 | .oi-arrow-thick-bottom:before { 123 | content:'\e00f'; 124 | } 125 | 126 | .oi-arrow-thick-left:before { 127 | content:'\e010'; 128 | } 129 | 130 | .oi-arrow-thick-right:before { 131 | content:'\e011'; 132 | } 133 | 134 | .oi-arrow-thick-top:before { 135 | content:'\e012'; 136 | } 137 | 138 | .oi-arrow-top:before { 139 | content:'\e013'; 140 | } 141 | 142 | .oi-audio-spectrum:before { 143 | content:'\e014'; 144 | } 145 | 146 | .oi-audio:before { 147 | content:'\e015'; 148 | } 149 | 150 | .oi-badge:before { 151 | content:'\e016'; 152 | } 153 | 154 | .oi-ban:before { 155 | content:'\e017'; 156 | } 157 | 158 | .oi-bar-chart:before { 159 | content:'\e018'; 160 | } 161 | 162 | .oi-basket:before { 163 | content:'\e019'; 164 | } 165 | 166 | .oi-battery-empty:before { 167 | content:'\e01a'; 168 | } 169 | 170 | .oi-battery-full:before { 171 | content:'\e01b'; 172 | } 173 | 174 | .oi-beaker:before { 175 | content:'\e01c'; 176 | } 177 | 178 | .oi-bell:before { 179 | content:'\e01d'; 180 | } 181 | 182 | .oi-bluetooth:before { 183 | content:'\e01e'; 184 | } 185 | 186 | .oi-bold:before { 187 | content:'\e01f'; 188 | } 189 | 190 | .oi-bolt:before { 191 | content:'\e020'; 192 | } 193 | 194 | .oi-book:before { 195 | content:'\e021'; 196 | } 197 | 198 | .oi-bookmark:before { 199 | content:'\e022'; 200 | } 201 | 202 | .oi-box:before { 203 | content:'\e023'; 204 | } 205 | 206 | .oi-briefcase:before { 207 | content:'\e024'; 208 | } 209 | 210 | .oi-british-pound:before { 211 | content:'\e025'; 212 | } 213 | 214 | .oi-browser:before { 215 | content:'\e026'; 216 | } 217 | 218 | .oi-brush:before { 219 | content:'\e027'; 220 | } 221 | 222 | .oi-bug:before { 223 | content:'\e028'; 224 | } 225 | 226 | .oi-bullhorn:before { 227 | content:'\e029'; 228 | } 229 | 230 | .oi-calculator:before { 231 | content:'\e02a'; 232 | } 233 | 234 | .oi-calendar:before { 235 | content:'\e02b'; 236 | } 237 | 238 | .oi-camera-slr:before { 239 | content:'\e02c'; 240 | } 241 | 242 | .oi-caret-bottom:before { 243 | content:'\e02d'; 244 | } 245 | 246 | .oi-caret-left:before { 247 | content:'\e02e'; 248 | } 249 | 250 | .oi-caret-right:before { 251 | content:'\e02f'; 252 | } 253 | 254 | .oi-caret-top:before { 255 | content:'\e030'; 256 | } 257 | 258 | .oi-cart:before { 259 | content:'\e031'; 260 | } 261 | 262 | .oi-chat:before { 263 | content:'\e032'; 264 | } 265 | 266 | .oi-check:before { 267 | content:'\e033'; 268 | } 269 | 270 | .oi-chevron-bottom:before { 271 | content:'\e034'; 272 | } 273 | 274 | .oi-chevron-left:before { 275 | content:'\e035'; 276 | } 277 | 278 | .oi-chevron-right:before { 279 | content:'\e036'; 280 | } 281 | 282 | .oi-chevron-top:before { 283 | content:'\e037'; 284 | } 285 | 286 | .oi-circle-check:before { 287 | content:'\e038'; 288 | } 289 | 290 | .oi-circle-x:before { 291 | content:'\e039'; 292 | } 293 | 294 | .oi-clipboard:before { 295 | content:'\e03a'; 296 | } 297 | 298 | .oi-clock:before { 299 | content:'\e03b'; 300 | } 301 | 302 | .oi-cloud-download:before { 303 | content:'\e03c'; 304 | } 305 | 306 | .oi-cloud-upload:before { 307 | content:'\e03d'; 308 | } 309 | 310 | .oi-cloud:before { 311 | content:'\e03e'; 312 | } 313 | 314 | .oi-cloudy:before { 315 | content:'\e03f'; 316 | } 317 | 318 | .oi-code:before { 319 | content:'\e040'; 320 | } 321 | 322 | .oi-cog:before { 323 | content:'\e041'; 324 | } 325 | 326 | .oi-collapse-down:before { 327 | content:'\e042'; 328 | } 329 | 330 | .oi-collapse-left:before { 331 | content:'\e043'; 332 | } 333 | 334 | .oi-collapse-right:before { 335 | content:'\e044'; 336 | } 337 | 338 | .oi-collapse-up:before { 339 | content:'\e045'; 340 | } 341 | 342 | .oi-command:before { 343 | content:'\e046'; 344 | } 345 | 346 | .oi-comment-square:before { 347 | content:'\e047'; 348 | } 349 | 350 | .oi-compass:before { 351 | content:'\e048'; 352 | } 353 | 354 | .oi-contrast:before { 355 | content:'\e049'; 356 | } 357 | 358 | .oi-copywriting:before { 359 | content:'\e04a'; 360 | } 361 | 362 | .oi-credit-card:before { 363 | content:'\e04b'; 364 | } 365 | 366 | .oi-crop:before { 367 | content:'\e04c'; 368 | } 369 | 370 | .oi-dashboard:before { 371 | content:'\e04d'; 372 | } 373 | 374 | .oi-data-transfer-download:before { 375 | content:'\e04e'; 376 | } 377 | 378 | .oi-data-transfer-upload:before { 379 | content:'\e04f'; 380 | } 381 | 382 | .oi-delete:before { 383 | content:'\e050'; 384 | } 385 | 386 | .oi-dial:before { 387 | content:'\e051'; 388 | } 389 | 390 | .oi-document:before { 391 | content:'\e052'; 392 | } 393 | 394 | .oi-dollar:before { 395 | content:'\e053'; 396 | } 397 | 398 | .oi-double-quote-sans-left:before { 399 | content:'\e054'; 400 | } 401 | 402 | .oi-double-quote-sans-right:before { 403 | content:'\e055'; 404 | } 405 | 406 | .oi-double-quote-serif-left:before { 407 | content:'\e056'; 408 | } 409 | 410 | .oi-double-quote-serif-right:before { 411 | content:'\e057'; 412 | } 413 | 414 | .oi-droplet:before { 415 | content:'\e058'; 416 | } 417 | 418 | .oi-eject:before { 419 | content:'\e059'; 420 | } 421 | 422 | .oi-elevator:before { 423 | content:'\e05a'; 424 | } 425 | 426 | .oi-ellipses:before { 427 | content:'\e05b'; 428 | } 429 | 430 | .oi-envelope-closed:before { 431 | content:'\e05c'; 432 | } 433 | 434 | .oi-envelope-open:before { 435 | content:'\e05d'; 436 | } 437 | 438 | .oi-euro:before { 439 | content:'\e05e'; 440 | } 441 | 442 | .oi-excerpt:before { 443 | content:'\e05f'; 444 | } 445 | 446 | .oi-expand-down:before { 447 | content:'\e060'; 448 | } 449 | 450 | .oi-expand-left:before { 451 | content:'\e061'; 452 | } 453 | 454 | .oi-expand-right:before { 455 | content:'\e062'; 456 | } 457 | 458 | .oi-expand-up:before { 459 | content:'\e063'; 460 | } 461 | 462 | .oi-external-link:before { 463 | content:'\e064'; 464 | } 465 | 466 | .oi-eye:before { 467 | content:'\e065'; 468 | } 469 | 470 | .oi-eyedropper:before { 471 | content:'\e066'; 472 | } 473 | 474 | .oi-file:before { 475 | content:'\e067'; 476 | } 477 | 478 | .oi-fire:before { 479 | content:'\e068'; 480 | } 481 | 482 | .oi-flag:before { 483 | content:'\e069'; 484 | } 485 | 486 | .oi-flash:before { 487 | content:'\e06a'; 488 | } 489 | 490 | .oi-folder:before { 491 | content:'\e06b'; 492 | } 493 | 494 | .oi-fork:before { 495 | content:'\e06c'; 496 | } 497 | 498 | .oi-fullscreen-enter:before { 499 | content:'\e06d'; 500 | } 501 | 502 | .oi-fullscreen-exit:before { 503 | content:'\e06e'; 504 | } 505 | 506 | .oi-globe:before { 507 | content:'\e06f'; 508 | } 509 | 510 | .oi-graph:before { 511 | content:'\e070'; 512 | } 513 | 514 | .oi-grid-four-up:before { 515 | content:'\e071'; 516 | } 517 | 518 | .oi-grid-three-up:before { 519 | content:'\e072'; 520 | } 521 | 522 | .oi-grid-two-up:before { 523 | content:'\e073'; 524 | } 525 | 526 | .oi-hard-drive:before { 527 | content:'\e074'; 528 | } 529 | 530 | .oi-header:before { 531 | content:'\e075'; 532 | } 533 | 534 | .oi-headphones:before { 535 | content:'\e076'; 536 | } 537 | 538 | .oi-heart:before { 539 | content:'\e077'; 540 | } 541 | 542 | .oi-home:before { 543 | content:'\e078'; 544 | } 545 | 546 | .oi-image:before { 547 | content:'\e079'; 548 | } 549 | 550 | .oi-inbox:before { 551 | content:'\e07a'; 552 | } 553 | 554 | .oi-infinity:before { 555 | content:'\e07b'; 556 | } 557 | 558 | .oi-info:before { 559 | content:'\e07c'; 560 | } 561 | 562 | .oi-italic:before { 563 | content:'\e07d'; 564 | } 565 | 566 | .oi-justify-center:before { 567 | content:'\e07e'; 568 | } 569 | 570 | .oi-justify-left:before { 571 | content:'\e07f'; 572 | } 573 | 574 | .oi-justify-right:before { 575 | content:'\e080'; 576 | } 577 | 578 | .oi-key:before { 579 | content:'\e081'; 580 | } 581 | 582 | .oi-laptop:before { 583 | content:'\e082'; 584 | } 585 | 586 | .oi-layers:before { 587 | content:'\e083'; 588 | } 589 | 590 | .oi-lightbulb:before { 591 | content:'\e084'; 592 | } 593 | 594 | .oi-link-broken:before { 595 | content:'\e085'; 596 | } 597 | 598 | .oi-link-intact:before { 599 | content:'\e086'; 600 | } 601 | 602 | .oi-list-rich:before { 603 | content:'\e087'; 604 | } 605 | 606 | .oi-list:before { 607 | content:'\e088'; 608 | } 609 | 610 | .oi-location:before { 611 | content:'\e089'; 612 | } 613 | 614 | .oi-lock-locked:before { 615 | content:'\e08a'; 616 | } 617 | 618 | .oi-lock-unlocked:before { 619 | content:'\e08b'; 620 | } 621 | 622 | .oi-loop-circular:before { 623 | content:'\e08c'; 624 | } 625 | 626 | .oi-loop-square:before { 627 | content:'\e08d'; 628 | } 629 | 630 | .oi-loop:before { 631 | content:'\e08e'; 632 | } 633 | 634 | .oi-magnifying-glass:before { 635 | content:'\e08f'; 636 | } 637 | 638 | .oi-map-marker:before { 639 | content:'\e090'; 640 | } 641 | 642 | .oi-map:before { 643 | content:'\e091'; 644 | } 645 | 646 | .oi-media-pause:before { 647 | content:'\e092'; 648 | } 649 | 650 | .oi-media-play:before { 651 | content:'\e093'; 652 | } 653 | 654 | .oi-media-record:before { 655 | content:'\e094'; 656 | } 657 | 658 | .oi-media-skip-backward:before { 659 | content:'\e095'; 660 | } 661 | 662 | .oi-media-skip-forward:before { 663 | content:'\e096'; 664 | } 665 | 666 | .oi-media-step-backward:before { 667 | content:'\e097'; 668 | } 669 | 670 | .oi-media-step-forward:before { 671 | content:'\e098'; 672 | } 673 | 674 | .oi-media-stop:before { 675 | content:'\e099'; 676 | } 677 | 678 | .oi-medical-cross:before { 679 | content:'\e09a'; 680 | } 681 | 682 | .oi-menu:before { 683 | content:'\e09b'; 684 | } 685 | 686 | .oi-microphone:before { 687 | content:'\e09c'; 688 | } 689 | 690 | .oi-minus:before { 691 | content:'\e09d'; 692 | } 693 | 694 | .oi-monitor:before { 695 | content:'\e09e'; 696 | } 697 | 698 | .oi-moon:before { 699 | content:'\e09f'; 700 | } 701 | 702 | .oi-move:before { 703 | content:'\e0a0'; 704 | } 705 | 706 | .oi-musical-note:before { 707 | content:'\e0a1'; 708 | } 709 | 710 | .oi-paperclip:before { 711 | content:'\e0a2'; 712 | } 713 | 714 | .oi-pencil:before { 715 | content:'\e0a3'; 716 | } 717 | 718 | .oi-people:before { 719 | content:'\e0a4'; 720 | } 721 | 722 | .oi-person:before { 723 | content:'\e0a5'; 724 | } 725 | 726 | .oi-phone:before { 727 | content:'\e0a6'; 728 | } 729 | 730 | .oi-pie-chart:before { 731 | content:'\e0a7'; 732 | } 733 | 734 | .oi-pin:before { 735 | content:'\e0a8'; 736 | } 737 | 738 | .oi-play-circle:before { 739 | content:'\e0a9'; 740 | } 741 | 742 | .oi-plus:before { 743 | content:'\e0aa'; 744 | } 745 | 746 | .oi-power-standby:before { 747 | content:'\e0ab'; 748 | } 749 | 750 | .oi-print:before { 751 | content:'\e0ac'; 752 | } 753 | 754 | .oi-project:before { 755 | content:'\e0ad'; 756 | } 757 | 758 | .oi-pulse:before { 759 | content:'\e0ae'; 760 | } 761 | 762 | .oi-puzzle-piece:before { 763 | content:'\e0af'; 764 | } 765 | 766 | .oi-question-mark:before { 767 | content:'\e0b0'; 768 | } 769 | 770 | .oi-rain:before { 771 | content:'\e0b1'; 772 | } 773 | 774 | .oi-random:before { 775 | content:'\e0b2'; 776 | } 777 | 778 | .oi-reload:before { 779 | content:'\e0b3'; 780 | } 781 | 782 | .oi-resize-both:before { 783 | content:'\e0b4'; 784 | } 785 | 786 | .oi-resize-height:before { 787 | content:'\e0b5'; 788 | } 789 | 790 | .oi-resize-width:before { 791 | content:'\e0b6'; 792 | } 793 | 794 | .oi-rss-alt:before { 795 | content:'\e0b7'; 796 | } 797 | 798 | .oi-rss:before { 799 | content:'\e0b8'; 800 | } 801 | 802 | .oi-script:before { 803 | content:'\e0b9'; 804 | } 805 | 806 | .oi-share-boxed:before { 807 | content:'\e0ba'; 808 | } 809 | 810 | .oi-share:before { 811 | content:'\e0bb'; 812 | } 813 | 814 | .oi-shield:before { 815 | content:'\e0bc'; 816 | } 817 | 818 | .oi-signal:before { 819 | content:'\e0bd'; 820 | } 821 | 822 | .oi-signpost:before { 823 | content:'\e0be'; 824 | } 825 | 826 | .oi-sort-ascending:before { 827 | content:'\e0bf'; 828 | } 829 | 830 | .oi-sort-descending:before { 831 | content:'\e0c0'; 832 | } 833 | 834 | .oi-spreadsheet:before { 835 | content:'\e0c1'; 836 | } 837 | 838 | .oi-star:before { 839 | content:'\e0c2'; 840 | } 841 | 842 | .oi-sun:before { 843 | content:'\e0c3'; 844 | } 845 | 846 | .oi-tablet:before { 847 | content:'\e0c4'; 848 | } 849 | 850 | .oi-tag:before { 851 | content:'\e0c5'; 852 | } 853 | 854 | .oi-tags:before { 855 | content:'\e0c6'; 856 | } 857 | 858 | .oi-target:before { 859 | content:'\e0c7'; 860 | } 861 | 862 | .oi-task:before { 863 | content:'\e0c8'; 864 | } 865 | 866 | .oi-terminal:before { 867 | content:'\e0c9'; 868 | } 869 | 870 | .oi-text:before { 871 | content:'\e0ca'; 872 | } 873 | 874 | .oi-thumb-down:before { 875 | content:'\e0cb'; 876 | } 877 | 878 | .oi-thumb-up:before { 879 | content:'\e0cc'; 880 | } 881 | 882 | .oi-timer:before { 883 | content:'\e0cd'; 884 | } 885 | 886 | .oi-transfer:before { 887 | content:'\e0ce'; 888 | } 889 | 890 | .oi-trash:before { 891 | content:'\e0cf'; 892 | } 893 | 894 | .oi-underline:before { 895 | content:'\e0d0'; 896 | } 897 | 898 | .oi-vertical-align-bottom:before { 899 | content:'\e0d1'; 900 | } 901 | 902 | .oi-vertical-align-center:before { 903 | content:'\e0d2'; 904 | } 905 | 906 | .oi-vertical-align-top:before { 907 | content:'\e0d3'; 908 | } 909 | 910 | .oi-video:before { 911 | content:'\e0d4'; 912 | } 913 | 914 | .oi-volume-high:before { 915 | content:'\e0d5'; 916 | } 917 | 918 | .oi-volume-low:before { 919 | content:'\e0d6'; 920 | } 921 | 922 | .oi-volume-off:before { 923 | content:'\e0d7'; 924 | } 925 | 926 | .oi-warning:before { 927 | content:'\e0d8'; 928 | } 929 | 930 | .oi-wifi:before { 931 | content:'\e0d9'; 932 | } 933 | 934 | .oi-wrench:before { 935 | content:'\e0da'; 936 | } 937 | 938 | .oi-x:before { 939 | content:'\e0db'; 940 | } 941 | 942 | .oi-yen:before { 943 | content:'\e0dc'; 944 | } 945 | 946 | .oi-zoom-in:before { 947 | content:'\e0dd'; 948 | } 949 | 950 | .oi-zoom-out:before { 951 | content:'\e0de'; 952 | } 953 | -------------------------------------------------------------------------------- /test/open-iconic/font/fonts/open-iconic.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markusslima/bootstrap-filestyle/071ae6f3ff9a49a04346848b05d165e86c50f3b7/test/open-iconic/font/fonts/open-iconic.eot -------------------------------------------------------------------------------- /test/open-iconic/font/fonts/open-iconic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markusslima/bootstrap-filestyle/071ae6f3ff9a49a04346848b05d165e86c50f3b7/test/open-iconic/font/fonts/open-iconic.otf -------------------------------------------------------------------------------- /test/open-iconic/font/fonts/open-iconic.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | Created by FontForge 20120731 at Tue Jul 1 20:39:22 2014 9 | By P.J. Onori 10 | Created by P.J. Onori with FontForge 2.0 (http://fontforge.sf.net) 11 | 12 | 13 | 14 | 27 | 28 | 30 | 32 | 34 | 36 | 38 | 40 | 42 | 45 | 47 | 49 | 51 | 53 | 55 | 57 | 59 | 61 | 63 | 65 | 67 | 69 | 71 | 74 | 76 | 79 | 81 | 84 | 86 | 88 | 91 | 93 | 95 | 98 | 100 | 102 | 104 | 106 | 109 | 112 | 115 | 117 | 121 | 123 | 125 | 127 | 130 | 132 | 134 | 136 | 138 | 141 | 143 | 145 | 147 | 149 | 151 | 153 | 155 | 157 | 159 | 162 | 165 | 167 | 169 | 172 | 174 | 177 | 179 | 181 | 183 | 185 | 189 | 191 | 194 | 196 | 198 | 200 | 202 | 205 | 207 | 209 | 211 | 213 | 215 | 218 | 220 | 222 | 224 | 226 | 228 | 230 | 232 | 234 | 236 | 238 | 241 | 243 | 245 | 247 | 249 | 251 | 253 | 256 | 259 | 261 | 263 | 265 | 267 | 269 | 272 | 274 | 276 | 280 | 282 | 285 | 287 | 289 | 292 | 295 | 298 | 300 | 302 | 304 | 306 | 309 | 312 | 314 | 316 | 318 | 320 | 322 | 324 | 326 | 330 | 334 | 338 | 340 | 343 | 345 | 347 | 349 | 351 | 353 | 355 | 358 | 360 | 363 | 365 | 367 | 369 | 371 | 373 | 375 | 377 | 379 | 381 | 383 | 386 | 388 | 390 | 392 | 394 | 396 | 399 | 401 | 404 | 406 | 408 | 410 | 412 | 414 | 416 | 419 | 421 | 423 | 425 | 428 | 431 | 435 | 438 | 440 | 442 | 444 | 446 | 448 | 451 | 453 | 455 | 457 | 460 | 462 | 464 | 466 | 468 | 471 | 473 | 477 | 479 | 481 | 483 | 486 | 488 | 490 | 492 | 494 | 496 | 499 | 501 | 504 | 506 | 509 | 512 | 515 | 517 | 520 | 522 | 524 | 526 | 529 | 532 | 534 | 536 | 539 | 542 | 543 | 544 | -------------------------------------------------------------------------------- /test/open-iconic/font/fonts/open-iconic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markusslima/bootstrap-filestyle/071ae6f3ff9a49a04346848b05d165e86c50f3b7/test/open-iconic/font/fonts/open-iconic.ttf -------------------------------------------------------------------------------- /test/open-iconic/font/fonts/open-iconic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markusslima/bootstrap-filestyle/071ae6f3ff9a49a04346848b05d165e86c50f3b7/test/open-iconic/font/fonts/open-iconic.woff -------------------------------------------------------------------------------- /test/upload.php: -------------------------------------------------------------------------------- 1 | 0) { 10 | $new_name = time() . '-' . $file['name']; 11 | $copied = copy($file['tmp_name'], $dir_upload . $new_name); 12 | 13 | if ($copied) { 14 | $message = 'Ok!'; 15 | } else { 16 | $message = 'Erro!'; 17 | } 18 | } else { 19 | $message = 'Max file size 2mb!'; 20 | } 21 | 22 | echo json_encode(array("message" => $message)); 23 | 24 | ?> 25 | -------------------------------------------------------------------------------- /test/upload/.folder: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markusslima/bootstrap-filestyle/071ae6f3ff9a49a04346848b05d165e86c50f3b7/test/upload/.folder --------------------------------------------------------------------------------