From 23b086fbc25d8979ca556ef40228130ea8e1e00a Mon Sep 17 00:00:00 2001 From: FrancescoUK Date: Fri, 12 Feb 2016 09:32:21 +0000 Subject: [PATCH] added jasny-bootstrap-3.1.3, removed bootstrap.file-input and changed image upload in general config (#116) For jasny-bootstrap-3.1.3 see: http://www.jasny.net/bootstrap/ --- application/views/configs/general_config.php | 15 +- application/views/partial/header.php | 5 +- css/jasny-bootstrap.css | 621 ++++++++++ dist/opensourcepos.js | 1155 ++++++++++++++++-- dist/opensourcepos.min.js | 7 +- js/bootstrap.file-input.js | 129 -- js/jasny-bootstrap.js | 1024 ++++++++++++++++ opensourcepos.zip | Bin 0 -> 6619029 bytes templates/spacelab/views/partial/header.php | 2 +- 9 files changed, 2690 insertions(+), 268 deletions(-) create mode 100644 css/jasny-bootstrap.css delete mode 100644 js/bootstrap.file-input.js create mode 100644 js/jasny-bootstrap.js create mode 100644 opensourcepos.zip diff --git a/application/views/configs/general_config.php b/application/views/configs/general_config.php index 1b1a83c51..832e55b4f 100644 --- a/application/views/configs/general_config.php +++ b/application/views/configs/general_config.php @@ -20,7 +20,18 @@
lang->line('config_company_logo').':', 'company_logo', array('class'=>'wide')); ?>
- +
+
+ 100%x100% > +
+
+
+ + lang->line("config_company_choose_file"); ?> + Change + Remove +
+
@@ -315,8 +326,6 @@ $(document).ready(function() window.location=''; }); - $('input[type=file]').bootstrapFileInput(); - $('#config_form').validate({ submitHandler:function(form) { diff --git a/application/views/partial/header.php b/application/views/partial/header.php index 7c3686dba..839b12503 100644 --- a/application/views/partial/header.php +++ b/application/views/partial/header.php @@ -9,6 +9,7 @@ + input->cookie('debug') == "true" || $this->input->get("debug") == "true") : ?> @@ -27,10 +28,10 @@ - + @@ -39,7 +40,7 @@ - + diff --git a/css/jasny-bootstrap.css b/css/jasny-bootstrap.css new file mode 100644 index 000000000..c36c3b1e6 --- /dev/null +++ b/css/jasny-bootstrap.css @@ -0,0 +1,621 @@ +/*! + * Jasny Bootstrap v3.1.3 (http://jasny.github.io/bootstrap) + * Copyright 2012-2014 Arnold Daniels + * Licensed under Apache-2.0 (https://github.com/jasny/bootstrap/blob/master/LICENSE) + */ + +.container-smooth { + max-width: 1170px; +} +@media (min-width: 1px) { + .container-smooth { + width: auto; + } +} +.btn-labeled { + padding-top: 0; + padding-bottom: 0; +} +.btn-label { + position: relative; + left: -12px; + display: inline-block; + padding: 6px 12px; + background: transparent; + background: rgba(0, 0, 0, .15); + border-radius: 3px 0 0 3px; +} +.btn-label.btn-label-right { + right: -12px; + left: auto; + border-radius: 0 3px 3px 0; +} +.btn-lg .btn-label { + left: -16px; + padding: 10px 16px; + border-radius: 5px 0 0 5px; +} +.btn-lg .btn-label.btn-label-right { + right: -16px; + left: auto; + border-radius: 0 5px 5px 0; +} +.btn-sm .btn-label { + left: -10px; + padding: 5px 10px; + border-radius: 2px 0 0 2px; +} +.btn-sm .btn-label.btn-label-right { + right: -10px; + left: auto; + border-radius: 0 2px 2px 0; +} +.btn-xs .btn-label { + left: -5px; + padding: 1px 5px; + border-radius: 2px 0 0 2px; +} +.btn-xs .btn-label.btn-label-right { + right: -5px; + left: auto; + border-radius: 0 2px 2px 0; +} +.nav-tabs-bottom { + border-top: 1px solid #ddd; + border-bottom: 0; +} +.nav-tabs-bottom > li { + margin-top: -1px; + margin-bottom: 0; +} +.nav-tabs-bottom > li > a { + border-radius: 0 0 4px 4px; +} +.nav-tabs-bottom > li > a:hover, +.nav-tabs-bottom > li > a:focus, +.nav-tabs-bottom > li.active > a, +.nav-tabs-bottom > li.active > a:hover, +.nav-tabs-bottom > li.active > a:focus { + border: 1px solid #ddd; + border-top-color: transparent; +} +.nav-tabs-left { + border-right: 1px solid #ddd; + border-bottom: 0; +} +.nav-tabs-left > li { + float: none; + margin-right: -1px; + margin-bottom: 0; +} +.nav-tabs-left > li > a { + margin-right: 0; + margin-bottom: 2px; + border-radius: 4px 0 0 4px; +} +.nav-tabs-left > li > a:hover, +.nav-tabs-left > li > a:focus, +.nav-tabs-left > li.active > a, +.nav-tabs-left > li.active > a:hover, +.nav-tabs-left > li.active > a:focus { + border: 1px solid #ddd; + border-right-color: transparent; +} +.row > .nav-tabs-left { + position: relative; + z-index: 1; + padding-right: 0; + padding-left: 15px; + margin-right: -1px; +} +.row > .nav-tabs-left + .tab-content { + border-left: 1px solid #ddd; +} +.nav-tabs-right { + border-bottom: 0; + border-left: 1px solid #ddd; +} +.nav-tabs-right > li { + float: none; + margin-bottom: 0; + margin-left: -1px; +} +.nav-tabs-right > li > a { + margin-bottom: 2px; + margin-left: 0; + border-radius: 0 4px 4px 0; +} +.nav-tabs-right > li > a:hover, +.nav-tabs-right > li > a:focus, +.nav-tabs-right > li.active > a, +.nav-tabs-right > li.active > a:hover, +.nav-tabs-right > li.active > a:focus { + border: 1px solid #ddd; + border-left-color: transparent; +} +.row > .nav-tabs-right { + padding-right: 15px; + padding-left: 0; +} +.navmenu, +.navbar-offcanvas { + width: 300px; + height: auto; + border-style: solid; + border-width: 1px; + border-radius: 4px; +} +.navmenu-fixed-left, +.navmenu-fixed-right, +.navbar-offcanvas { + position: fixed; + top: 0; + bottom: 0; + z-index: 1030; + overflow-y: auto; + border-radius: 0; +} +.navmenu-fixed-left, +.navbar-offcanvas.navmenu-fixed-left { + right: auto; + left: 0; + border-width: 0 1px 0 0; +} +.navmenu-fixed-right, +.navbar-offcanvas { + right: 0; + left: auto; + border-width: 0 0 0 1px; +} +.navmenu-nav { + margin-bottom: 10px; +} +.navmenu-nav.dropdown-menu { + position: static; + float: none; + padding-top: 0; + margin: 0; + border: none; + border-radius: 0; + -webkit-box-shadow: none; + box-shadow: none; +} +.navbar-offcanvas .navbar-nav { + margin: 0; +} +@media (min-width: 768px) { + .navbar-offcanvas { + width: auto; + border-top: 0; + box-shadow: none; + } + .navbar-offcanvas.offcanvas { + position: static; + display: block !important; + height: auto !important; + padding-bottom: 0; + overflow: visible !important; + } + .navbar-offcanvas .navbar-nav.navbar-left:first-child { + margin-left: -15px; + } + .navbar-offcanvas .navbar-nav.navbar-right:last-child { + margin-right: -15px; + } + .navbar-offcanvas .navmenu-brand { + display: none; + } +} +.navmenu-brand { + display: block; + padding: 10px 15px; + margin: 10px 0; + font-size: 18px; + line-height: 20px; +} +.navmenu-brand:hover, +.navmenu-brand:focus { + text-decoration: none; +} +.navmenu-default, +.navbar-default .navbar-offcanvas { + background-color: #f8f8f8; + border-color: #e7e7e7; +} +.navmenu-default .navmenu-brand, +.navbar-default .navbar-offcanvas .navmenu-brand { + color: #777; +} +.navmenu-default .navmenu-brand:hover, +.navbar-default .navbar-offcanvas .navmenu-brand:hover, +.navmenu-default .navmenu-brand:focus, +.navbar-default .navbar-offcanvas .navmenu-brand:focus { + color: #5e5e5e; + background-color: transparent; +} +.navmenu-default .navmenu-text, +.navbar-default .navbar-offcanvas .navmenu-text { + color: #777; +} +.navmenu-default .navmenu-nav > .dropdown > a:hover .caret, +.navbar-default .navbar-offcanvas .navmenu-nav > .dropdown > a:hover .caret, +.navmenu-default .navmenu-nav > .dropdown > a:focus .caret, +.navbar-default .navbar-offcanvas .navmenu-nav > .dropdown > a:focus .caret { + border-top-color: #333; + border-bottom-color: #333; +} +.navmenu-default .navmenu-nav > .open > a, +.navbar-default .navbar-offcanvas .navmenu-nav > .open > a, +.navmenu-default .navmenu-nav > .open > a:hover, +.navbar-default .navbar-offcanvas .navmenu-nav > .open > a:hover, +.navmenu-default .navmenu-nav > .open > a:focus, +.navbar-default .navbar-offcanvas .navmenu-nav > .open > a:focus { + color: #555; + background-color: #e7e7e7; +} +.navmenu-default .navmenu-nav > .open > a .caret, +.navbar-default .navbar-offcanvas .navmenu-nav > .open > a .caret, +.navmenu-default .navmenu-nav > .open > a:hover .caret, +.navbar-default .navbar-offcanvas .navmenu-nav > .open > a:hover .caret, +.navmenu-default .navmenu-nav > .open > a:focus .caret, +.navbar-default .navbar-offcanvas .navmenu-nav > .open > a:focus .caret { + border-top-color: #555; + border-bottom-color: #555; +} +.navmenu-default .navmenu-nav > .dropdown > a .caret, +.navbar-default .navbar-offcanvas .navmenu-nav > .dropdown > a .caret { + border-top-color: #777; + border-bottom-color: #777; +} +.navmenu-default .navmenu-nav.dropdown-menu, +.navbar-default .navbar-offcanvas .navmenu-nav.dropdown-menu { + background-color: #e7e7e7; +} +.navmenu-default .navmenu-nav.dropdown-menu > .divider, +.navbar-default .navbar-offcanvas .navmenu-nav.dropdown-menu > .divider { + background-color: #f8f8f8; +} +.navmenu-default .navmenu-nav.dropdown-menu > .active > a, +.navbar-default .navbar-offcanvas .navmenu-nav.dropdown-menu > .active > a, +.navmenu-default .navmenu-nav.dropdown-menu > .active > a:hover, +.navbar-default .navbar-offcanvas .navmenu-nav.dropdown-menu > .active > a:hover, +.navmenu-default .navmenu-nav.dropdown-menu > .active > a:focus, +.navbar-default .navbar-offcanvas .navmenu-nav.dropdown-menu > .active > a:focus { + background-color: #d7d7d7; +} +.navmenu-default .navmenu-nav > li > a, +.navbar-default .navbar-offcanvas .navmenu-nav > li > a { + color: #777; +} +.navmenu-default .navmenu-nav > li > a:hover, +.navbar-default .navbar-offcanvas .navmenu-nav > li > a:hover, +.navmenu-default .navmenu-nav > li > a:focus, +.navbar-default .navbar-offcanvas .navmenu-nav > li > a:focus { + color: #333; + background-color: transparent; +} +.navmenu-default .navmenu-nav > .active > a, +.navbar-default .navbar-offcanvas .navmenu-nav > .active > a, +.navmenu-default .navmenu-nav > .active > a:hover, +.navbar-default .navbar-offcanvas .navmenu-nav > .active > a:hover, +.navmenu-default .navmenu-nav > .active > a:focus, +.navbar-default .navbar-offcanvas .navmenu-nav > .active > a:focus { + color: #555; + background-color: #e7e7e7; +} +.navmenu-default .navmenu-nav > .disabled > a, +.navbar-default .navbar-offcanvas .navmenu-nav > .disabled > a, +.navmenu-default .navmenu-nav > .disabled > a:hover, +.navbar-default .navbar-offcanvas .navmenu-nav > .disabled > a:hover, +.navmenu-default .navmenu-nav > .disabled > a:focus, +.navbar-default .navbar-offcanvas .navmenu-nav > .disabled > a:focus { + color: #ccc; + background-color: transparent; +} +.navmenu-inverse, +.navbar-inverse .navbar-offcanvas { + background-color: #222; + border-color: #080808; +} +.navmenu-inverse .navmenu-brand, +.navbar-inverse .navbar-offcanvas .navmenu-brand { + color: #999; +} +.navmenu-inverse .navmenu-brand:hover, +.navbar-inverse .navbar-offcanvas .navmenu-brand:hover, +.navmenu-inverse .navmenu-brand:focus, +.navbar-inverse .navbar-offcanvas .navmenu-brand:focus { + color: #fff; + background-color: transparent; +} +.navmenu-inverse .navmenu-text, +.navbar-inverse .navbar-offcanvas .navmenu-text { + color: #999; +} +.navmenu-inverse .navmenu-nav > .dropdown > a:hover .caret, +.navbar-inverse .navbar-offcanvas .navmenu-nav > .dropdown > a:hover .caret, +.navmenu-inverse .navmenu-nav > .dropdown > a:focus .caret, +.navbar-inverse .navbar-offcanvas .navmenu-nav > .dropdown > a:focus .caret { + border-top-color: #fff; + border-bottom-color: #fff; +} +.navmenu-inverse .navmenu-nav > .open > a, +.navbar-inverse .navbar-offcanvas .navmenu-nav > .open > a, +.navmenu-inverse .navmenu-nav > .open > a:hover, +.navbar-inverse .navbar-offcanvas .navmenu-nav > .open > a:hover, +.navmenu-inverse .navmenu-nav > .open > a:focus, +.navbar-inverse .navbar-offcanvas .navmenu-nav > .open > a:focus { + color: #fff; + background-color: #080808; +} +.navmenu-inverse .navmenu-nav > .open > a .caret, +.navbar-inverse .navbar-offcanvas .navmenu-nav > .open > a .caret, +.navmenu-inverse .navmenu-nav > .open > a:hover .caret, +.navbar-inverse .navbar-offcanvas .navmenu-nav > .open > a:hover .caret, +.navmenu-inverse .navmenu-nav > .open > a:focus .caret, +.navbar-inverse .navbar-offcanvas .navmenu-nav > .open > a:focus .caret { + border-top-color: #fff; + border-bottom-color: #fff; +} +.navmenu-inverse .navmenu-nav > .dropdown > a .caret, +.navbar-inverse .navbar-offcanvas .navmenu-nav > .dropdown > a .caret { + border-top-color: #999; + border-bottom-color: #999; +} +.navmenu-inverse .navmenu-nav.dropdown-menu, +.navbar-inverse .navbar-offcanvas .navmenu-nav.dropdown-menu { + background-color: #080808; +} +.navmenu-inverse .navmenu-nav.dropdown-menu > .divider, +.navbar-inverse .navbar-offcanvas .navmenu-nav.dropdown-menu > .divider { + background-color: #222; +} +.navmenu-inverse .navmenu-nav.dropdown-menu > .active > a, +.navbar-inverse .navbar-offcanvas .navmenu-nav.dropdown-menu > .active > a, +.navmenu-inverse .navmenu-nav.dropdown-menu > .active > a:hover, +.navbar-inverse .navbar-offcanvas .navmenu-nav.dropdown-menu > .active > a:hover, +.navmenu-inverse .navmenu-nav.dropdown-menu > .active > a:focus, +.navbar-inverse .navbar-offcanvas .navmenu-nav.dropdown-menu > .active > a:focus { + background-color: #000; +} +.navmenu-inverse .navmenu-nav > li > a, +.navbar-inverse .navbar-offcanvas .navmenu-nav > li > a { + color: #999; +} +.navmenu-inverse .navmenu-nav > li > a:hover, +.navbar-inverse .navbar-offcanvas .navmenu-nav > li > a:hover, +.navmenu-inverse .navmenu-nav > li > a:focus, +.navbar-inverse .navbar-offcanvas .navmenu-nav > li > a:focus { + color: #fff; + background-color: transparent; +} +.navmenu-inverse .navmenu-nav > .active > a, +.navbar-inverse .navbar-offcanvas .navmenu-nav > .active > a, +.navmenu-inverse .navmenu-nav > .active > a:hover, +.navbar-inverse .navbar-offcanvas .navmenu-nav > .active > a:hover, +.navmenu-inverse .navmenu-nav > .active > a:focus, +.navbar-inverse .navbar-offcanvas .navmenu-nav > .active > a:focus { + color: #fff; + background-color: #080808; +} +.navmenu-inverse .navmenu-nav > .disabled > a, +.navbar-inverse .navbar-offcanvas .navmenu-nav > .disabled > a, +.navmenu-inverse .navmenu-nav > .disabled > a:hover, +.navbar-inverse .navbar-offcanvas .navmenu-nav > .disabled > a:hover, +.navmenu-inverse .navmenu-nav > .disabled > a:focus, +.navbar-inverse .navbar-offcanvas .navmenu-nav > .disabled > a:focus { + color: #444; + background-color: transparent; +} +.alert-fixed-top, +.alert-fixed-bottom { + position: fixed; + left: 0; + z-index: 1035; + width: 100%; + margin: 0; + border-radius: 0; +} +@media (min-width: 992px) { + .alert-fixed-top, + .alert-fixed-bottom { + left: 50%; + width: 992px; + margin-left: -496px; + } +} +.alert-fixed-top { + top: 0; + border-width: 0 0 1px 0; +} +@media (min-width: 992px) { + .alert-fixed-top { + border-width: 0 1px 1px 1px; + border-bottom-right-radius: 4px; + border-bottom-left-radius: 4px; + } +} +.alert-fixed-bottom { + bottom: 0; + border-width: 1px 0 0 0; +} +@media (min-width: 992px) { + .alert-fixed-bottom { + border-width: 1px 1px 0 1px; + border-top-left-radius: 4px; + border-top-right-radius: 4px; + } +} +.offcanvas { + display: none; +} +.offcanvas.in { + display: block; +} +@media (max-width: 767px) { + .offcanvas-xs { + display: none; + } + .offcanvas-xs.in { + display: block; + } +} +@media (max-width: 991px) { + .offcanvas-sm { + display: none; + } + .offcanvas-sm.in { + display: block; + } +} +@media (max-width: 1199px) { + .offcanvas-md { + display: none; + } + .offcanvas-md.in { + display: block; + } +} +.offcanvas-lg { + display: none; +} +.offcanvas-lg.in { + display: block; +} +.canvas-sliding { + -webkit-transition: top .35s, left .35s, bottom .35s, right .35s; + transition: top .35s, left .35s, bottom .35s, right .35s; +} +.offcanvas-clone { + position: absolute !important; + top: auto !important; + right: 0 !important; + bottom: 0 !important; + left: auto !important; + width: 0 !important; + height: 0 !important; + padding: 0 !important; + margin: 0 !important; + overflow: hidden !important; + border: none !important; + opacity: 0 !important; +} +.table.rowlink td:not(.rowlink-skip), +.table .rowlink td:not(.rowlink-skip) { + cursor: pointer; +} +.table.rowlink td:not(.rowlink-skip) a, +.table .rowlink td:not(.rowlink-skip) a { + font: inherit; + color: inherit; + text-decoration: inherit; +} +.table-hover.rowlink tr:hover td, +.table-hover .rowlink tr:hover td { + background-color: #cfcfcf; +} +.btn-file { + position: relative; + overflow: hidden; + vertical-align: middle; +} +.btn-file > input { + position: absolute; + top: 0; + right: 0; + width: 100%; + height: 100%; + margin: 0; + font-size: 23px; + cursor: pointer; + filter: alpha(opacity=0); + opacity: 0; + + direction: ltr; +} +.fileinput { + display: inline-block; + margin-bottom: 9px; +} +.fileinput .form-control { + display: inline-block; + padding-top: 7px; + padding-bottom: 5px; + margin-bottom: 0; + vertical-align: middle; + cursor: text; +} +.fileinput .thumbnail { + display: inline-block; + margin-bottom: 5px; + overflow: hidden; + text-align: center; + vertical-align: middle; +} +.fileinput .thumbnail > img { + max-height: 100%; +} +.fileinput .btn { + vertical-align: middle; +} +.fileinput-exists .fileinput-new, +.fileinput-new .fileinput-exists { + display: none; +} +.fileinput-inline .fileinput-controls { + display: inline; +} +.fileinput-filename { + display: inline-block; + overflow: hidden; + vertical-align: middle; +} +.form-control .fileinput-filename { + vertical-align: bottom; +} +.fileinput.input-group { + display: table; +} +.fileinput.input-group > * { + position: relative; + z-index: 2; +} +.fileinput.input-group > .btn-file { + z-index: 1; +} +.fileinput-new.input-group .btn-file, +.fileinput-new .input-group .btn-file { + border-radius: 0 4px 4px 0; +} +.fileinput-new.input-group .btn-file.btn-xs, +.fileinput-new .input-group .btn-file.btn-xs, +.fileinput-new.input-group .btn-file.btn-sm, +.fileinput-new .input-group .btn-file.btn-sm { + border-radius: 0 3px 3px 0; +} +.fileinput-new.input-group .btn-file.btn-lg, +.fileinput-new .input-group .btn-file.btn-lg { + border-radius: 0 6px 6px 0; +} +.form-group.has-warning .fileinput .fileinput-preview { + color: #8a6d3b; +} +.form-group.has-warning .fileinput .thumbnail { + border-color: #faebcc; +} +.form-group.has-error .fileinput .fileinput-preview { + color: #a94442; +} +.form-group.has-error .fileinput .thumbnail { + border-color: #ebccd1; +} +.form-group.has-success .fileinput .fileinput-preview { + color: #3c763d; +} +.form-group.has-success .fileinput .thumbnail { + border-color: #d6e9c6; +} +.input-group-addon:not(:first-child) { + border-left: 0; +} +/*# sourceMappingURL=jasny-bootstrap.css.map */ diff --git a/dist/opensourcepos.js b/dist/opensourcepos.js index 115b526f3..b1125509e 100644 --- a/dist/opensourcepos.js +++ b/dist/opensourcepos.js @@ -26444,135 +26444,6 @@ if (typeof jQuery === 'undefined') { }) }(jQuery); -;/* - Bootstrap - File Input - ====================== - - This is meant to convert all file input tags into a set of elements that displays consistently in all browsers. - - Converts all - - into Bootstrap buttons - Browse - -*/ -(function($) { - -$.fn.bootstrapFileInput = function() { - - this.each(function(i,elem){ - - var $elem = $(elem); - - // Maybe some fields don't need to be standardized. - if (typeof $elem.attr('data-bfi-disabled') != 'undefined') { - return; - } - - // Set the word to be displayed on the button - var buttonWord = 'Browse'; - - if (typeof $elem.attr('title') != 'undefined') { - buttonWord = $elem.attr('title'); - } - - var className = ''; - - if (!!$elem.attr('class')) { - className = ' ' + $elem.attr('class'); - } - - // Now we're going to wrap that input field with a Bootstrap button. - // The input will actually still be there, it will just be float above and transparent (done with the CSS). - $elem.wrap('').parent().prepend($('').html(buttonWord)); - }) - - // After we have found all of the file inputs let's apply a listener for tracking the mouse movement. - // This is important because the in order to give the illusion that this is a button in FF we actually need to move the button from the file input under the cursor. Ugh. - .promise().done( function(){ - - // As the cursor moves over our new Bootstrap button we need to adjust the position of the invisible file input Browse button to be under the cursor. - // This gives us the pointer cursor that FF denies us - $('.file-input-wrapper').mousemove(function(cursor) { - - var input, wrapper, - wrapperX, wrapperY, - inputWidth, inputHeight, - cursorX, cursorY; - - // This wrapper element (the button surround this file input) - wrapper = $(this); - // The invisible file input element - input = wrapper.find("input"); - // The left-most position of the wrapper - wrapperX = wrapper.offset().left; - // The top-most position of the wrapper - wrapperY = wrapper.offset().top; - // The with of the browsers input field - inputWidth= input.width(); - // The height of the browsers input field - inputHeight= input.height(); - //The position of the cursor in the wrapper - cursorX = cursor.pageX; - cursorY = cursor.pageY; - - //The positions we are to move the invisible file input - // The 20 at the end is an arbitrary number of pixels that we can shift the input such that cursor is not pointing at the end of the Browse button but somewhere nearer the middle - moveInputX = cursorX - wrapperX - inputWidth + 20; - // Slides the invisible input Browse button to be positioned middle under the cursor - moveInputY = cursorY- wrapperY - (inputHeight/2); - - // Apply the positioning styles to actually move the invisible file input - input.css({ - left:moveInputX, - top:moveInputY - }); - }); - - $('body').on('change', '.file-input-wrapper input[type=file]', function(){ - - var fileName; - fileName = $(this).val(); - - // Remove any previous file names - $(this).parent().next('.file-input-name').remove(); - if (!!$(this).prop('files') && $(this).prop('files').length > 1) { - fileName = $(this)[0].files.length+' files'; - } - else { - fileName = fileName.substring(fileName.lastIndexOf('\\') + 1, fileName.length); - } - - // Don't try to show the name if there is none - if (!fileName) { - return; - } - - var selectedFileNamePlacement = $(this).data('filename-placement'); - if (selectedFileNamePlacement === 'inside') { - // Print the fileName inside - $(this).siblings('span').html(fileName); - $(this).attr('title', fileName); - } else { - // Print the fileName aside (right after the the button) - $(this).parent().after(''+fileName+''); - } - }); - - }); - -}; - -// Add the styles before the first stylesheet -// This ensures they can be easily overridden with developer styles -var cssHtml = ''; -$('link[rel=stylesheet]').eq(0).before(cssHtml); - -})(jQuery); ;function get_dimensions() { var dims = {width:0,height:0}; @@ -27232,7 +27103,1031 @@ Date.fullYearStart = '20'; }; -})(jQuery);;function checkbox_click(event) +})(jQuery);;/*! + * Jasny Bootstrap v3.1.3 (http://jasny.github.io/bootstrap) + * Copyright 2012-2014 Arnold Daniels + * Licensed under Apache-2.0 (https://github.com/jasny/bootstrap/blob/master/LICENSE) + */ + +if (typeof jQuery === 'undefined') { throw new Error('Jasny Bootstrap\'s JavaScript requires jQuery') } + +/* ======================================================================== + * Bootstrap: transition.js v3.1.3 + * http://getbootstrap.com/javascript/#transitions + * ======================================================================== + * Copyright 2011-2014 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * ======================================================================== */ + + ++function ($) { + 'use strict'; + + // CSS TRANSITION SUPPORT (Shoutout: http://www.modernizr.com/) + // ============================================================ + + function transitionEnd() { + var el = document.createElement('bootstrap') + + var transEndEventNames = { + WebkitTransition : 'webkitTransitionEnd', + MozTransition : 'transitionend', + OTransition : 'oTransitionEnd otransitionend', + transition : 'transitionend' + } + + for (var name in transEndEventNames) { + if (el.style[name] !== undefined) { + return { end: transEndEventNames[name] } + } + } + + return false // explicit for ie8 ( ._.) + } + + if ($.support.transition !== undefined) return // Prevent conflict with Twitter Bootstrap + + // http://blog.alexmaccaw.com/css-transitions + $.fn.emulateTransitionEnd = function (duration) { + var called = false, $el = this + $(this).one($.support.transition.end, function () { called = true }) + var callback = function () { if (!called) $($el).trigger($.support.transition.end) } + setTimeout(callback, duration) + return this + } + + $(function () { + $.support.transition = transitionEnd() + }) + +}(window.jQuery); + +/* ======================================================================== + * Bootstrap: offcanvas.js v3.1.3 + * http://jasny.github.io/bootstrap/javascript/#offcanvas + * ======================================================================== + * Copyright 2013-2014 Arnold Daniels + * + * Licensed under the Apache License, Version 2.0 (the "License") + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ======================================================================== */ + ++function ($) { "use strict"; + + // OFFCANVAS PUBLIC CLASS DEFINITION + // ================================= + + var OffCanvas = function (element, options) { + this.$element = $(element) + this.options = $.extend({}, OffCanvas.DEFAULTS, options) + this.state = null + this.placement = null + + if (this.options.recalc) { + this.calcClone() + $(window).on('resize', $.proxy(this.recalc, this)) + } + + if (this.options.autohide) + $(document).on('click', $.proxy(this.autohide, this)) + + if (this.options.toggle) this.toggle() + + if (this.options.disablescrolling) { + this.options.disableScrolling = this.options.disablescrolling + delete this.options.disablescrolling + } + } + + OffCanvas.DEFAULTS = { + toggle: true, + placement: 'auto', + autohide: true, + recalc: true, + disableScrolling: true + } + + OffCanvas.prototype.offset = function () { + switch (this.placement) { + case 'left': + case 'right': return this.$element.outerWidth() + case 'top': + case 'bottom': return this.$element.outerHeight() + } + } + + OffCanvas.prototype.calcPlacement = function () { + if (this.options.placement !== 'auto') { + this.placement = this.options.placement + return + } + + if (!this.$element.hasClass('in')) { + this.$element.css('visiblity', 'hidden !important').addClass('in') + } + + var horizontal = $(window).width() / this.$element.width() + var vertical = $(window).height() / this.$element.height() + + var element = this.$element + function ab(a, b) { + if (element.css(b) === 'auto') return a + if (element.css(a) === 'auto') return b + + var size_a = parseInt(element.css(a), 10) + var size_b = parseInt(element.css(b), 10) + + return size_a > size_b ? b : a + } + + this.placement = horizontal >= vertical ? ab('left', 'right') : ab('top', 'bottom') + + if (this.$element.css('visibility') === 'hidden !important') { + this.$element.removeClass('in').css('visiblity', '') + } + } + + OffCanvas.prototype.opposite = function (placement) { + switch (placement) { + case 'top': return 'bottom' + case 'left': return 'right' + case 'bottom': return 'top' + case 'right': return 'left' + } + } + + OffCanvas.prototype.getCanvasElements = function() { + // Return a set containing the canvas plus all fixed elements + var canvas = this.options.canvas ? $(this.options.canvas) : this.$element + + var fixed_elements = canvas.find('*').filter(function() { + return $(this).css('position') === 'fixed' + }).not(this.options.exclude) + + return canvas.add(fixed_elements) + } + + OffCanvas.prototype.slide = function (elements, offset, callback) { + // Use jQuery animation if CSS transitions aren't supported + if (!$.support.transition) { + var anim = {} + anim[this.placement] = "+=" + offset + return elements.animate(anim, 350, callback) + } + + var placement = this.placement + var opposite = this.opposite(placement) + + elements.each(function() { + if ($(this).css(placement) !== 'auto') + $(this).css(placement, (parseInt($(this).css(placement), 10) || 0) + offset) + + if ($(this).css(opposite) !== 'auto') + $(this).css(opposite, (parseInt($(this).css(opposite), 10) || 0) - offset) + }) + + this.$element + .one($.support.transition.end, callback) + .emulateTransitionEnd(350) + } + + OffCanvas.prototype.disableScrolling = function() { + var bodyWidth = $('body').width() + var prop = 'padding-' + this.opposite(this.placement) + + if ($('body').data('offcanvas-style') === undefined) { + $('body').data('offcanvas-style', $('body').attr('style') || '') + } + + $('body').css('overflow', 'hidden') + + if ($('body').width() > bodyWidth) { + var padding = parseInt($('body').css(prop), 10) + $('body').width() - bodyWidth + + setTimeout(function() { + $('body').css(prop, padding) + }, 1) + } + } + + OffCanvas.prototype.show = function () { + if (this.state) return + + var startEvent = $.Event('show.bs.offcanvas') + this.$element.trigger(startEvent) + if (startEvent.isDefaultPrevented()) return + + this.state = 'slide-in' + this.calcPlacement(); + + var elements = this.getCanvasElements() + var placement = this.placement + var opposite = this.opposite(placement) + var offset = this.offset() + + if (elements.index(this.$element) !== -1) { + $(this.$element).data('offcanvas-style', $(this.$element).attr('style') || '') + this.$element.css(placement, -1 * offset) + this.$element.css(placement); // Workaround: Need to get the CSS property for it to be applied before the next line of code + } + + elements.addClass('canvas-sliding').each(function() { + if ($(this).data('offcanvas-style') === undefined) $(this).data('offcanvas-style', $(this).attr('style') || '') + if ($(this).css('position') === 'static') $(this).css('position', 'relative') + if (($(this).css(placement) === 'auto' || $(this).css(placement) === '0px') && + ($(this).css(opposite) === 'auto' || $(this).css(opposite) === '0px')) { + $(this).css(placement, 0) + } + }) + + if (this.options.disableScrolling) this.disableScrolling() + + var complete = function () { + if (this.state != 'slide-in') return + + this.state = 'slid' + + elements.removeClass('canvas-sliding').addClass('canvas-slid') + this.$element.trigger('shown.bs.offcanvas') + } + + setTimeout($.proxy(function() { + this.$element.addClass('in') + this.slide(elements, offset, $.proxy(complete, this)) + }, this), 1) + } + + OffCanvas.prototype.hide = function (fast) { + if (this.state !== 'slid') return + + var startEvent = $.Event('hide.bs.offcanvas') + this.$element.trigger(startEvent) + if (startEvent.isDefaultPrevented()) return + + this.state = 'slide-out' + + var elements = $('.canvas-slid') + var placement = this.placement + var offset = -1 * this.offset() + + var complete = function () { + if (this.state != 'slide-out') return + + this.state = null + this.placement = null + + this.$element.removeClass('in') + + elements.removeClass('canvas-sliding') + elements.add(this.$element).add('body').each(function() { + $(this).attr('style', $(this).data('offcanvas-style')).removeData('offcanvas-style') + }) + + this.$element.trigger('hidden.bs.offcanvas') + } + + elements.removeClass('canvas-slid').addClass('canvas-sliding') + + setTimeout($.proxy(function() { + this.slide(elements, offset, $.proxy(complete, this)) + }, this), 1) + } + + OffCanvas.prototype.toggle = function () { + if (this.state === 'slide-in' || this.state === 'slide-out') return + this[this.state === 'slid' ? 'hide' : 'show']() + } + + OffCanvas.prototype.calcClone = function() { + this.$calcClone = this.$element.clone() + .html('') + .addClass('offcanvas-clone').removeClass('in') + .appendTo($('body')) + } + + OffCanvas.prototype.recalc = function () { + if (this.$calcClone.css('display') === 'none' || (this.state !== 'slid' && this.state !== 'slide-in')) return + + this.state = null + this.placement = null + var elements = this.getCanvasElements() + + this.$element.removeClass('in') + + elements.removeClass('canvas-slid') + elements.add(this.$element).add('body').each(function() { + $(this).attr('style', $(this).data('offcanvas-style')).removeData('offcanvas-style') + }) + } + + OffCanvas.prototype.autohide = function (e) { + if ($(e.target).closest(this.$element).length === 0) this.hide() + } + + // OFFCANVAS PLUGIN DEFINITION + // ========================== + + var old = $.fn.offcanvas + + $.fn.offcanvas = function (option) { + return this.each(function () { + var $this = $(this) + var data = $this.data('bs.offcanvas') + var options = $.extend({}, OffCanvas.DEFAULTS, $this.data(), typeof option === 'object' && option) + + if (!data) $this.data('bs.offcanvas', (data = new OffCanvas(this, options))) + if (typeof option === 'string') data[option]() + }) + } + + $.fn.offcanvas.Constructor = OffCanvas + + + // OFFCANVAS NO CONFLICT + // ==================== + + $.fn.offcanvas.noConflict = function () { + $.fn.offcanvas = old + return this + } + + + // OFFCANVAS DATA-API + // ================= + + $(document).on('click.bs.offcanvas.data-api', '[data-toggle=offcanvas]', function (e) { + var $this = $(this), href + var target = $this.attr('data-target') + || e.preventDefault() + || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7 + var $canvas = $(target) + var data = $canvas.data('bs.offcanvas') + var option = data ? 'toggle' : $this.data() + + e.stopPropagation() + + if (data) data.toggle() + else $canvas.offcanvas(option) + }) + +}(window.jQuery); + +/* ============================================================ + * Bootstrap: rowlink.js v3.1.3 + * http://jasny.github.io/bootstrap/javascript/#rowlink + * ============================================================ + * Copyright 2012-2014 Arnold Daniels + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================ */ + ++function ($) { "use strict"; + + var Rowlink = function (element, options) { + this.$element = $(element) + this.options = $.extend({}, Rowlink.DEFAULTS, options) + + this.$element.on('click.bs.rowlink', 'td:not(.rowlink-skip)', $.proxy(this.click, this)) + } + + Rowlink.DEFAULTS = { + target: "a" + } + + Rowlink.prototype.click = function(e) { + var target = $(e.currentTarget).closest('tr').find(this.options.target)[0] + if ($(e.target)[0] === target) return + + e.preventDefault(); + + if (target.click) { + target.click() + } else if (document.createEvent) { + var evt = document.createEvent("MouseEvents"); + evt.initMouseEvent("click", true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null); + target.dispatchEvent(evt); + } + } + + + // ROWLINK PLUGIN DEFINITION + // =========================== + + var old = $.fn.rowlink + + $.fn.rowlink = function (options) { + return this.each(function () { + var $this = $(this) + var data = $this.data('bs.rowlink') + if (!data) $this.data('bs.rowlink', (data = new Rowlink(this, options))) + }) + } + + $.fn.rowlink.Constructor = Rowlink + + + // ROWLINK NO CONFLICT + // ==================== + + $.fn.rowlink.noConflict = function () { + $.fn.rowlink = old + return this + } + + + // ROWLINK DATA-API + // ================== + + $(document).on('click.bs.rowlink.data-api', '[data-link="row"]', function (e) { + if ($(e.target).closest('.rowlink-skip').length !== 0) return + + var $this = $(this) + if ($this.data('bs.rowlink')) return + $this.rowlink($this.data()) + $(e.target).trigger('click.bs.rowlink') + }) + +}(window.jQuery); + +/* =========================================================== + * Bootstrap: inputmask.js v3.1.0 + * http://jasny.github.io/bootstrap/javascript/#inputmask + * + * Based on Masked Input plugin by Josh Bush (digitalbush.com) + * =========================================================== + * Copyright 2012-2014 Arnold Daniels + * + * Licensed under the Apache License, Version 2.0 (the "License") + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ========================================================== */ + ++function ($) { "use strict"; + + var isIphone = (window.orientation !== undefined) + var isAndroid = navigator.userAgent.toLowerCase().indexOf("android") > -1 + var isIE = window.navigator.appName == 'Microsoft Internet Explorer' + + // INPUTMASK PUBLIC CLASS DEFINITION + // ================================= + + var Inputmask = function (element, options) { + if (isAndroid) return // No support because caret positioning doesn't work on Android + + this.$element = $(element) + this.options = $.extend({}, Inputmask.DEFAULTS, options) + this.mask = String(this.options.mask) + + this.init() + this.listen() + + this.checkVal() //Perform initial check for existing values + } + + Inputmask.DEFAULTS = { + mask: "", + placeholder: "_", + definitions: { + '9': "[0-9]", + 'a': "[A-Za-z]", + 'w': "[A-Za-z0-9]", + '*': "." + } + } + + Inputmask.prototype.init = function() { + var defs = this.options.definitions + var len = this.mask.length + + this.tests = [] + this.partialPosition = this.mask.length + this.firstNonMaskPos = null + + $.each(this.mask.split(""), $.proxy(function(i, c) { + if (c == '?') { + len-- + this.partialPosition = i + } else if (defs[c]) { + this.tests.push(new RegExp(defs[c])) + if (this.firstNonMaskPos === null) + this.firstNonMaskPos = this.tests.length - 1 + } else { + this.tests.push(null) + } + }, this)) + + this.buffer = $.map(this.mask.split(""), $.proxy(function(c, i) { + if (c != '?') return defs[c] ? this.options.placeholder : c + }, this)) + + this.focusText = this.$element.val() + + this.$element.data("rawMaskFn", $.proxy(function() { + return $.map(this.buffer, function(c, i) { + return this.tests[i] && c != this.options.placeholder ? c : null + }).join('') + }, this)) + } + + Inputmask.prototype.listen = function() { + if (this.$element.attr("readonly")) return + + var pasteEventName = (isIE ? 'paste' : 'input') + ".mask" + + this.$element + .on("unmask.bs.inputmask", $.proxy(this.unmask, this)) + + .on("focus.bs.inputmask", $.proxy(this.focusEvent, this)) + .on("blur.bs.inputmask", $.proxy(this.blurEvent, this)) + + .on("keydown.bs.inputmask", $.proxy(this.keydownEvent, this)) + .on("keypress.bs.inputmask", $.proxy(this.keypressEvent, this)) + + .on(pasteEventName, $.proxy(this.pasteEvent, this)) + } + + //Helper Function for Caret positioning + Inputmask.prototype.caret = function(begin, end) { + if (this.$element.length === 0) return + if (typeof begin == 'number') { + end = (typeof end == 'number') ? end : begin + return this.$element.each(function() { + if (this.setSelectionRange) { + this.setSelectionRange(begin, end) + } else if (this.createTextRange) { + var range = this.createTextRange() + range.collapse(true) + range.moveEnd('character', end) + range.moveStart('character', begin) + range.select() + } + }) + } else { + if (this.$element[0].setSelectionRange) { + begin = this.$element[0].selectionStart + end = this.$element[0].selectionEnd + } else if (document.selection && document.selection.createRange) { + var range = document.selection.createRange() + begin = 0 - range.duplicate().moveStart('character', -100000) + end = begin + range.text.length + } + return { + begin: begin, + end: end + } + } + } + + Inputmask.prototype.seekNext = function(pos) { + var len = this.mask.length + while (++pos <= len && !this.tests[pos]); + + return pos + } + + Inputmask.prototype.seekPrev = function(pos) { + while (--pos >= 0 && !this.tests[pos]); + + return pos + } + + Inputmask.prototype.shiftL = function(begin,end) { + var len = this.mask.length + + if (begin < 0) return + + for (var i = begin, j = this.seekNext(end); i < len; i++) { + if (this.tests[i]) { + if (j < len && this.tests[i].test(this.buffer[j])) { + this.buffer[i] = this.buffer[j] + this.buffer[j] = this.options.placeholder + } else + break + j = this.seekNext(j) + } + } + this.writeBuffer() + this.caret(Math.max(this.firstNonMaskPos, begin)) + } + + Inputmask.prototype.shiftR = function(pos) { + var len = this.mask.length + + for (var i = pos, c = this.options.placeholder; i < len; i++) { + if (this.tests[i]) { + var j = this.seekNext(i) + var t = this.buffer[i] + this.buffer[i] = c + if (j < len && this.tests[j].test(t)) + c = t + else + break + } + } + }, + + Inputmask.prototype.unmask = function() { + this.$element + .unbind(".mask") + .removeData("inputmask") + } + + Inputmask.prototype.focusEvent = function() { + this.focusText = this.$element.val() + var len = this.mask.length + var pos = this.checkVal() + this.writeBuffer() + + var that = this + var moveCaret = function() { + if (pos == len) + that.caret(0, pos) + else + that.caret(pos) + } + + moveCaret() + setTimeout(moveCaret, 50) + } + + Inputmask.prototype.blurEvent = function() { + this.checkVal() + if (this.$element.val() !== this.focusText) + this.$element.trigger('change') + } + + Inputmask.prototype.keydownEvent = function(e) { + var k = e.which + + //backspace, delete, and escape get special treatment + if (k == 8 || k == 46 || (isIphone && k == 127)) { + var pos = this.caret(), + begin = pos.begin, + end = pos.end + + if (end - begin === 0) { + begin = k != 46 ? this.seekPrev(begin) : (end = this.seekNext(begin - 1)) + end = k == 46 ? this.seekNext(end) : end + } + this.clearBuffer(begin, end) + this.shiftL(begin, end - 1) + + return false + } else if (k == 27) {//escape + this.$element.val(this.focusText) + this.caret(0, this.checkVal()) + return false + } + } + + Inputmask.prototype.keypressEvent = function(e) { + var len = this.mask.length + + var k = e.which, + pos = this.caret() + + if (e.ctrlKey || e.altKey || e.metaKey || k < 32) {//Ignore + return true + } else if (k) { + if (pos.end - pos.begin !== 0) { + this.clearBuffer(pos.begin, pos.end) + this.shiftL(pos.begin, pos.end - 1) + } + + var p = this.seekNext(pos.begin - 1) + if (p < len) { + var c = String.fromCharCode(k) + if (this.tests[p].test(c)) { + this.shiftR(p) + this.buffer[p] = c + this.writeBuffer() + var next = this.seekNext(p) + this.caret(next) + } + } + return false + } + } + + Inputmask.prototype.pasteEvent = function() { + var that = this + + setTimeout(function() { + that.caret(that.checkVal(true)) + }, 0) + } + + Inputmask.prototype.clearBuffer = function(start, end) { + var len = this.mask.length + + for (var i = start; i < end && i < len; i++) { + if (this.tests[i]) + this.buffer[i] = this.options.placeholder + } + } + + Inputmask.prototype.writeBuffer = function() { + return this.$element.val(this.buffer.join('')).val() + } + + Inputmask.prototype.checkVal = function(allow) { + var len = this.mask.length + //try to place characters where they belong + var test = this.$element.val() + var lastMatch = -1 + + for (var i = 0, pos = 0; i < len; i++) { + if (this.tests[i]) { + this.buffer[i] = this.options.placeholder + while (pos++ < test.length) { + var c = test.charAt(pos - 1) + if (this.tests[i].test(c)) { + this.buffer[i] = c + lastMatch = i + break + } + } + if (pos > test.length) + break + } else if (this.buffer[i] == test.charAt(pos) && i != this.partialPosition) { + pos++ + lastMatch = i + } + } + if (!allow && lastMatch + 1 < this.partialPosition) { + this.$element.val("") + this.clearBuffer(0, len) + } else if (allow || lastMatch + 1 >= this.partialPosition) { + this.writeBuffer() + if (!allow) this.$element.val(this.$element.val().substring(0, lastMatch + 1)) + } + return (this.partialPosition ? i : this.firstNonMaskPos) + } + + + // INPUTMASK PLUGIN DEFINITION + // =========================== + + var old = $.fn.inputmask + + $.fn.inputmask = function (options) { + return this.each(function () { + var $this = $(this) + var data = $this.data('bs.inputmask') + + if (!data) $this.data('bs.inputmask', (data = new Inputmask(this, options))) + }) + } + + $.fn.inputmask.Constructor = Inputmask + + + // INPUTMASK NO CONFLICT + // ==================== + + $.fn.inputmask.noConflict = function () { + $.fn.inputmask = old + return this + } + + + // INPUTMASK DATA-API + // ================== + + $(document).on('focus.bs.inputmask.data-api', '[data-mask]', function (e) { + var $this = $(this) + if ($this.data('bs.inputmask')) return + $this.inputmask($this.data()) + }) + +}(window.jQuery); + +/* =========================================================== + * Bootstrap: fileinput.js v3.1.3 + * http://jasny.github.com/bootstrap/javascript/#fileinput + * =========================================================== + * Copyright 2012-2014 Arnold Daniels + * + * Licensed under the Apache License, Version 2.0 (the "License") + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ========================================================== */ + ++function ($) { "use strict"; + + var isIE = window.navigator.appName == 'Microsoft Internet Explorer' + + // FILEUPLOAD PUBLIC CLASS DEFINITION + // ================================= + + var Fileinput = function (element, options) { + this.$element = $(element) + + this.$input = this.$element.find(':file') + if (this.$input.length === 0) return + + this.name = this.$input.attr('name') || options.name + + this.$hidden = this.$element.find('input[type=hidden][name="' + this.name + '"]') + if (this.$hidden.length === 0) { + this.$hidden = $('').insertBefore(this.$input) + } + + this.$preview = this.$element.find('.fileinput-preview') + var height = this.$preview.css('height') + if (this.$preview.css('display') !== 'inline' && height !== '0px' && height !== 'none') { + this.$preview.css('line-height', height) + } + + this.original = { + exists: this.$element.hasClass('fileinput-exists'), + preview: this.$preview.html(), + hiddenVal: this.$hidden.val() + } + + this.listen() + } + + Fileinput.prototype.listen = function() { + this.$input.on('change.bs.fileinput', $.proxy(this.change, this)) + $(this.$input[0].form).on('reset.bs.fileinput', $.proxy(this.reset, this)) + + this.$element.find('[data-trigger="fileinput"]').on('click.bs.fileinput', $.proxy(this.trigger, this)) + this.$element.find('[data-dismiss="fileinput"]').on('click.bs.fileinput', $.proxy(this.clear, this)) + }, + + Fileinput.prototype.change = function(e) { + var files = e.target.files === undefined ? (e.target && e.target.value ? [{ name: e.target.value.replace(/^.+\\/, '')}] : []) : e.target.files + + e.stopPropagation() + + if (files.length === 0) { + this.clear() + return + } + + this.$hidden.val('') + this.$hidden.attr('name', '') + this.$input.attr('name', this.name) + + var file = files[0] + + if (this.$preview.length > 0 && (typeof file.type !== "undefined" ? file.type.match(/^image\/(gif|png|jpeg)$/) : file.name.match(/\.(gif|png|jpe?g)$/i)) && typeof FileReader !== "undefined") { + var reader = new FileReader() + var preview = this.$preview + var element = this.$element + + reader.onload = function(re) { + var $img = $('') + $img[0].src = re.target.result + files[0].result = re.target.result + + element.find('.fileinput-filename').text(file.name) + + // if parent has max-height, using `(max-)height: 100%` on child doesn't take padding and border into account + if (preview.css('max-height') != 'none') $img.css('max-height', parseInt(preview.css('max-height'), 10) - parseInt(preview.css('padding-top'), 10) - parseInt(preview.css('padding-bottom'), 10) - parseInt(preview.css('border-top'), 10) - parseInt(preview.css('border-bottom'), 10)) + + preview.html($img) + element.addClass('fileinput-exists').removeClass('fileinput-new') + + element.trigger('change.bs.fileinput', files) + } + + reader.readAsDataURL(file) + } else { + this.$element.find('.fileinput-filename').text(file.name) + this.$preview.text(file.name) + + this.$element.addClass('fileinput-exists').removeClass('fileinput-new') + + this.$element.trigger('change.bs.fileinput') + } + }, + + Fileinput.prototype.clear = function(e) { + if (e) e.preventDefault() + + this.$hidden.val('') + this.$hidden.attr('name', this.name) + this.$input.attr('name', '') + + //ie8+ doesn't support changing the value of input with type=file so clone instead + if (isIE) { + var inputClone = this.$input.clone(true); + this.$input.after(inputClone); + this.$input.remove(); + this.$input = inputClone; + } else { + this.$input.val('') + } + + this.$preview.html('') + this.$element.find('.fileinput-filename').text('') + this.$element.addClass('fileinput-new').removeClass('fileinput-exists') + + if (e !== undefined) { + this.$input.trigger('change') + this.$element.trigger('clear.bs.fileinput') + } + }, + + Fileinput.prototype.reset = function() { + this.clear() + + this.$hidden.val(this.original.hiddenVal) + this.$preview.html(this.original.preview) + this.$element.find('.fileinput-filename').text('') + + if (this.original.exists) this.$element.addClass('fileinput-exists').removeClass('fileinput-new') + else this.$element.addClass('fileinput-new').removeClass('fileinput-exists') + + this.$element.trigger('reset.bs.fileinput') + }, + + Fileinput.prototype.trigger = function(e) { + this.$input.trigger('click') + e.preventDefault() + } + + + // FILEUPLOAD PLUGIN DEFINITION + // =========================== + + var old = $.fn.fileinput + + $.fn.fileinput = function (options) { + return this.each(function () { + var $this = $(this), + data = $this.data('bs.fileinput') + if (!data) $this.data('bs.fileinput', (data = new Fileinput(this, options))) + if (typeof options == 'string') data[options]() + }) + } + + $.fn.fileinput.Constructor = Fileinput + + + // FILEINPUT NO CONFLICT + // ==================== + + $.fn.fileinput.noConflict = function () { + $.fn.fileinput = old + return this + } + + + // FILEUPLOAD DATA-API + // ================== + + $(document).on('click.fileinput.data-api', '[data-provides="fileinput"]', function (e) { + var $this = $(this) + if ($this.data('bs.fileinput')) return + $this.fileinput($this.data()) + + var $target = $(e.target).closest('[data-dismiss="fileinput"],[data-trigger="fileinput"]'); + if ($target.length > 0) { + e.preventDefault() + $target.trigger('click.bs.fileinput') + } + }) + +}(window.jQuery); +;function checkbox_click(event) { event.stopPropagation(); do_email(enable_email.url); diff --git a/dist/opensourcepos.min.js b/dist/opensourcepos.min.js index 7a3c356ea..97b93d3ae 100644 --- a/dist/opensourcepos.min.js +++ b/dist/opensourcepos.min.js @@ -1,4 +1,4 @@ -/*! opensourcepos 11-02-2016 */ +/*! opensourcepos 12-02-2016 */ function get_dimensions(){var a={width:0,height:0};return"number"==typeof window.innerWidth?(a.width=window.innerWidth,a.height=window.innerHeight):document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)?(a.width=document.documentElement.clientWidth,a.height=document.documentElement.clientHeight):document.body&&(document.body.clientWidth||document.body.clientHeight)&&(a.width=document.body.clientWidth,a.height=document.body.clientHeight),a}function set_feedback(a,b,c){a?($("#feedback_bar").removeClass().addClass(b).html(a).css("opacity","1"),c||$("#feedback_bar").fadeTo(5e3,1).fadeTo("fast",0)):$("#feedback_bar").css("opacity","0")}function checkbox_click(a){a.stopPropagation(),do_email(enable_email.url),$(a.target).attr("checked")?$(a.target).parent().parent().find("td").addClass("selected").css("backgroundColor",""):$(a.target).parent().parent().find("td").removeClass()}function enable_search(a){a.format_item||(format_item=function(a){return a[0]}),enable_search.enabled||(enable_search.enabled=!0),$("#search").click(function(){$(this).attr("value","")});var b=$("#search").autocomplete(a.suggest_url,{max:100,delay:10,selectFirst:!1,formatItem:a.format_item,extraParams:a.extra_params});return $("#search").result(function(){do_search(!0,a.on_complete)}),attach_search_listener(),$("#search_form").submit(function(b){b.preventDefault(),$("#limit_from").val(0),get_selected_values().length>0&&!confirm(a.confirm_search_message)||do_search(!0,a.on_complete)}),b}function attach_search_listener(){$("#pagination a").click(function(a){if($("#search").val()||$("#search_form input:checked")){a.preventDefault();var b=a.currentTarget.href.split("/"),c=b.pop();$("#limit_from").val(c),do_search(!0)}})}function do_search(a,b){enable_search.enabled&&(a&&$("#search").addClass("ac_loading"),$.post($("#search_form").attr("action"),$("#search_form").serialize(),function(a){$("#sortable_table tbody").html(a.rows),"function"==typeof b&&b(a),$("#search").removeClass("ac_loading"),tb_init("#sortable_table a.thickbox"),$("#pagination").html(a.pagination),$("#sortable_table tbody :checkbox").click(checkbox_click),$("#select_all").attr("checked",!1),a.total_rows>0&&(update_sortable_table(),enable_row_selection()),attach_search_listener()},"json"))}function enable_email(a){enable_email.enabled||(enable_email.enabled=!0),enable_email.url||(enable_email.url=a),$("#select_all, #sortable_table tbody :checkbox").click(checkbox_click)}function do_email(a){enable_email.enabled&&$.post(a,{"ids[]":get_selected_values()},function(a){$("#email").attr("href",a)})}function enable_checkboxes(){$("#sortable_table tbody :checkbox").click(checkbox_click)}function enable_delete(a,b){enable_delete.enabled||(enable_delete.enabled=!0),$("#delete").click(function(c){if(c.preventDefault(),$("#sortable_table tbody :checkbox:checked").length>0){if(!confirm(a))return!1;do_delete($(this).attr("href"))}else alert(b)})}function do_delete(a){if(enable_delete.enabled){var b=get_selected_values(),c=get_selected_rows();$.post(a,{"ids[]":b},function(a){a.success?($(c).each(function(){$(this).find("td").animate({backgroundColor:"green"},1200,"linear").end().animate({opacity:0},1200,"linear",function(){$(this).remove(),$("#sortable_table tbody tr").length>0&&update_sortable_table()})}),set_feedback(a.message,"alert alert-dismissible alert-success",!1)):set_feedback(a.message,"alert alert-dismissible alert-danger",!0)},"json")}}function enable_bulk_edit(a){enable_bulk_edit.enabled||(enable_bulk_edit.enabled=!0),$("#bulk_edit").click(function(b){b.preventDefault(),$("#sortable_table tbody :checkbox:checked").length>0?(tb_show($(this).attr("title"),$(this).attr("href"),!1),$(this).blur()):alert(a)})}function enable_select_all(){enable_select_all.enabled||(enable_select_all.enabled=!0),$("#select_all").click(function(){$("#sortable_table tbody :checkbox").each($(this).attr("checked")?function(){$(this).attr("checked",!0),$(this).parent().parent().find("td").addClass("selected").css("backgroundColor","")}:function(){$(this).attr("checked",!1),$(this).parent().parent().find("td").removeClass()})})}function enable_row_selection(a){enable_row_selection.enabled||(enable_row_selection.enabled=!0),"undefined"==typeof a&&(a=$("#sortable_table tbody tr")),a.hover(function(){$(this).find("td").addClass("over").css("backgroundColor",""),$(this).css("cursor","pointer")},function(){$(this).find("td").hasClass("selected")||$(this).find("td").removeClass()}),a.click(function(){var a=$(this).find(":checkbox");a.attr("checked",!a.attr("checked")),do_email(enable_email.url),a.attr("checked")?$(this).find("td").addClass("selected").css("backgroundColor",""):$(this).find("td").removeClass()})}function update_sortable_table(){if($("#sortable_table").trigger("update"),"undefined"!=typeof $("#sortable_table")[0].config){var a=$("#sortable_table")[0].config.sortList;$("#sortable_table").trigger("sorton",[a])}else window.init_table_sorting&&init_table_sorting()}function get_table_row(a){a=a||$("input[name='sale_id']").val();var b=$("#sortable_table tbody :checkbox[value='"+a+"']");return 0===b.length&&(b=$("#sortable_table tbody a[href*='/"+a+"/']")),b}function update_row(a,b,c){$.post(b,{row_id:a},function(b){var d=get_table_row(a).parent().parent();d.replaceWith(b),reinit_row(a),hightlight_row(a),c&&"function"==typeof c&&c()},"html")}function reinit_row(a){var b=$("#sortable_table tbody tr :checkbox[value="+a+"]"),c=b.parent().parent();enable_row_selection(c),update_sortable_table(),tb_init(c.find("a.thickbox")),b.click(checkbox_click)}function animate_row(a,b){b=b||"#e1ffdd",a.find("td").css("backgroundColor","#ffffff").animate({backgroundColor:b},"slow","linear").animate({backgroundColor:b},5e3).animate({backgroundColor:"#ffffff"},"slow","linear")}function hightlight_row(a){var b=$("#sortable_table tbody tr :checkbox[value="+a+"]"),c=b.parent().parent();animate_row(c)}function get_selected_values(){var a=new Array;return $("#sortable_table tbody :checkbox:checked").each(function(){a.push($(this).val())}),a}function get_selected_rows(){var a=new Array;return $("#sortable_table tbody :checkbox:checked").each(function(){a.push($(this).parent().parent())}),a}function get_visible_checkbox_ids(){var a=new Array;return $("#sortable_table tbody :checkbox").each(function(){a.push($(this).val())}),a}function phpjsDate(a,b){var c,d,e=this,f=["Sun","Mon","Tues","Wednes","Thurs","Fri","Satur","January","February","March","April","May","June","July","August","September","October","November","December"],g=/\\?(.?)/gi,h=function(a,b){return d[a]?d[a]():b},i=function(a,b){for(a=String(a);a.length=b&&1==parseInt(a%100/10,10)&&(b=0),["st","nd","rd"][b-1]||"th"},w:function(){return c.getDay()},z:function(){var a=new Date(d.Y(),d.n()-1,d.j()),b=new Date(d.Y(),0,1);return Math.round((a-b)/864e5)},W:function(){var a=new Date(d.Y(),d.n()-1,d.j()-d.N()+3),b=new Date(a.getFullYear(),0,4);return i(1+Math.round((a-b)/864e5/7),2)},F:function(){return f[6+d.n()]},m:function(){return i(d.n(),2)},M:function(){return d.F().slice(0,3)},n:function(){return c.getMonth()+1},t:function(){return new Date(d.Y(),d.n(),0).getDate()},L:function(){var a=d.Y();return a%4===0&a%100!==0|a%400===0},o:function(){var a=d.n(),b=d.W(),c=d.Y();return c+(12===a&&9>b?1:1===a&&b>9?-1:0)},Y:function(){return c.getFullYear()},y:function(){return d.Y().toString().slice(-2)},a:function(){return c.getHours()>11?"pm":"am"},A:function(){return d.a().toUpperCase()},B:function(){var a=3600*c.getUTCHours(),b=60*c.getUTCMinutes(),d=c.getUTCSeconds();return i(Math.floor((a+b+d+3600)/86.4)%1e3,3)},g:function(){return d.G()%12||12},G:function(){return c.getHours()},h:function(){return i(d.g(),2)},H:function(){return i(d.G(),2)},i:function(){return i(c.getMinutes(),2)},s:function(){return i(c.getSeconds(),2)},u:function(){return i(1e3*c.getMilliseconds(),6)},e:function(){throw"Not supported (see source code of date() for timezone on how to add support)"},I:function(){var a=new Date(d.Y(),0),b=Date.UTC(d.Y(),0),c=new Date(d.Y(),6),e=Date.UTC(d.Y(),6);return a-b!==c-e?1:0},O:function(){var a=c.getTimezoneOffset(),b=Math.abs(a);return(a>0?"-":"+")+i(100*Math.floor(b/60)+b%60,4)},P:function(){var a=d.O();return a.substr(0,3)+":"+a.substr(3,2)},T:function(){return"UTC"},Z:function(){return 60*-c.getTimezoneOffset()},c:function(){return"Y-m-d\\TH:i:sP".replace(g,h)},r:function(){return"D, d M Y H:i:s O".replace(g,h)},U:function(){return c/1e3|0}},this.date=function(a,b){return e=this,c=void 0===b?new Date:new Date(b instanceof Date?b:1e3*b),a.replace(g,h)},this.date(a,b)}function tb_init(a){$(a).click(function(){var a=this.title||this.name||null,b=this.href||this.alt,c=this.rel||!1;return tb_show(a,b,c),this.blur(),!1})}function tb_show(a,b,c){try{"undefined"==typeof document.body.style.maxHeight?($("body","html").css({height:"100%",width:"100%"}),$("html").css("overflow","hidden"),null===document.getElementById("TB_HideSelect")&&($("body").append("
"),$("#TB_overlay").click(tb_remove))):null===document.getElementById("TB_overlay")&&($("body").append("
"),$("#TB_overlay").click(tb_remove)),$("#TB_overlay").addClass(tb_detectMacXFF()?"TB_overlayMacFFBGHack":"TB_overlayBG"),null===a&&(a=""),$("body").append("
"),$("#TB_load").show();var d;d=-1!==b.indexOf("?")?b.substr(0,b.indexOf("?")):b;var e=/\.jpg$|\.jpeg$|\.png$|\.gif$|\.bmp$/,f=d.toLowerCase().match(e);if(".jpg"==f||".jpeg"==f||".png"==f||".gif"==f||".bmp"==f){if(TB_PrevCaption="",TB_PrevURL="",TB_PrevHTML="",TB_NextCaption="",TB_NextURL="",TB_NextHTML="",TB_imageCount="",TB_FoundURL=!1,c)for(TB_TempArray=$("a[@rel="+c+"]").get(),TB_Counter=0;TB_Counter  Next >"):(TB_PrevCaption=TB_TempArray[TB_Counter].title,TB_PrevURL=TB_TempArray[TB_Counter].href,TB_PrevHTML="  < Prev"):(TB_FoundURL=!0,TB_imageCount="Image "+(TB_Counter+1)+" of "+TB_TempArray.length)}imgPreloader=new Image,imgPreloader.onload=function(){function d(){return $(document).unbind("click",d)&&$(document).unbind("click",d),$("#TB_window").remove(),$("body").append("
"),tb_show(TB_PrevCaption,TB_PrevURL,c),!1}function e(){return $("#TB_window").remove(),$("body").append("
"),tb_show(TB_NextCaption,TB_NextURL,c),!1}imgPreloader.onload=null;var f=tb_getPageSize(),g=f[0]-150,h=f[1]-150,i=imgPreloader.width,j=imgPreloader.height;i>g?(j*=g/i,i=g,j>h&&(i*=h/j,j=h)):j>h&&(i*=h/j,j=h,i>g&&(j*=g/i,i=g)),TB_WIDTH=i+30,TB_HEIGHT=j+60,$("#TB_window").append(""+a+"
"+a+"
"+TB_imageCount+TB_PrevHTML+TB_NextHTML+"
"),$("#TB_closeWindowButton").click(tb_remove),""!==TB_PrevHTML&&$("#TB_prev").click(d),""!==TB_NextHTML&&$("#TB_next").click(e),document.onkeydown=function(a){keycode=null==a?event.keyCode:a.which,27==keycode?tb_remove():190==keycode?""!=TB_NextHTML&&(document.onkeydown="",e()):188==keycode&&""!=TB_PrevHTML&&(document.onkeydown="",d())},tb_position(),$("#TB_load").remove(),$("#TB_ImageOff").click(tb_remove),$("#TB_window").css({display:"block"})},imgPreloader.src=b}else{var g=tb_parseUrl(b),h=get_dimensions();TB_WIDTH=1*g.width+30||.6*h.width,TB_HEIGHT=1*g.height+40||.85*h.height,ajaxContentW=TB_WIDTH-30,ajaxContentH=TB_HEIGHT-45,-1!=b.indexOf("TB_iframe")?(urlNoQuery=b.split("TB_"),$("#TB_iframeContent").remove(),"true"!=g.modal?$("#TB_window").append("
"+a+"
"):($("#TB_overlay").unbind(),$("#TB_window").append(""))):"block"!=$("#TB_window").css("display")?"true"!=g.modal?$("#TB_window").append("
"+a+"
"):($("#TB_overlay").unbind(),$("#TB_window").append("
")):($("#TB_ajaxContent")[0].style.width=ajaxContentW+"px",$("#TB_ajaxContent")[0].style.height=ajaxContentH+"px",$("#TB_ajaxContent")[0].scrollTop=0,$("#TB_ajaxWindowTitle").html(a)),$("#TB_closeWindowButton").click(tb_remove),-1!=b.indexOf("TB_inline")?($("#TB_ajaxContent").append($("#"+g.inlineId).children()),$("#TB_window").unload(function(){$("#"+g.inlineId).append($("#TB_ajaxContent").children())}),tb_position(),$("#TB_load").remove(),$("#TB_window").css({display:"block"})):-1!=b.indexOf("TB_iframe")?(tb_position(),$.browser.safari&&($("#TB_load").remove(),$("#TB_window").css({display:"block"}))):$("#TB_ajaxContent").load(b+="/random:"+(new Date).getTime(),function(){tb_position(),$("#TB_load").remove(),tb_init("#TB_ajaxContent a.thickbox"),$("#TB_window").css({display:"block"})})}g.modal||(document.onkeyup=function(a){keycode=null==a?event.keyCode:a.which,27==keycode&&tb_remove()})}catch(i){}}function tb_showIframe(){$("#TB_load").remove(),$("#TB_window").css({display:"block"})}function tb_remove(){return $("#TB_imageOff").unbind("click"),$("#TB_closeWindowButton").unbind("click"),$("#TB_window").fadeOut("fast",function(){$("#TB_window,#TB_overlay,#TB_HideSelect").trigger("unload").unbind().remove()}),$("#TB_load").remove(),"undefined"==typeof document.body.style.maxHeight&&($("body","html").css({height:"auto",width:"auto"}),$("html").css("overflow","")),document.onkeydown="",document.onkeyup="",!1}function tb_position(){$("#TB_window").css({marginLeft:"-"+parseInt(TB_WIDTH/2,10)+"px",width:TB_WIDTH+"px"}),jQuery.browser.msie&&jQuery.browser.version<7||$("#TB_window").css({marginTop:"-"+parseInt(TB_HEIGHT/2,10)+"px"})}function tb_parseQuery(a){var b={};if(!a)return b;for(var c=a.split(/[;&]/),d=0;d0&&b-1 in a}function d(a,b,c){if(na.isFunction(b))return na.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return na.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(xa.test(b))return na.filter(b,a,c);b=na.filter(b,a)}return na.grep(a,function(a){return na.inArray(a,b)>-1!==c})}function e(a,b){do a=a[b];while(a&&1!==a.nodeType);return a}function f(a){var b={};return na.each(a.match(Da)||[],function(a,c){b[c]=!0}),b}function g(){da.addEventListener?(da.removeEventListener("DOMContentLoaded",h),a.removeEventListener("load",h)):(da.detachEvent("onreadystatechange",h),a.detachEvent("onload",h))}function h(){(da.addEventListener||"load"===a.event.type||"complete"===da.readyState)&&(g(),na.ready())}function i(a,b,c){if(void 0===c&&1===a.nodeType){var d="data-"+b.replace(Ia,"-$1").toLowerCase();if(c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:Ha.test(c)?na.parseJSON(c):c}catch(e){}na.data(a,b,c)}else c=void 0}return c}function j(a){var b;for(b in a)if(("data"!==b||!na.isEmptyObject(a[b]))&&"toJSON"!==b)return!1;return!0}function k(a,b,c,d){if(Ga(a)){var e,f,g=na.expando,h=a.nodeType,i=h?na.cache:a,j=h?a[g]:a[g]&&g;if(j&&i[j]&&(d||i[j].data)||void 0!==c||"string"!=typeof b)return j||(j=h?a[g]=ca.pop()||na.guid++:g),i[j]||(i[j]=h?{}:{toJSON:na.noop}),("object"==typeof b||"function"==typeof b)&&(d?i[j]=na.extend(i[j],b):i[j].data=na.extend(i[j].data,b)),f=i[j],d||(f.data||(f.data={}),f=f.data),void 0!==c&&(f[na.camelCase(b)]=c),"string"==typeof b?(e=f[b],null==e&&(e=f[na.camelCase(b)])):e=f,e}}function l(a,b,c){if(Ga(a)){var d,e,f=a.nodeType,g=f?na.cache:a,h=f?a[na.expando]:na.expando;if(g[h]){if(b&&(d=c?g[h]:g[h].data)){na.isArray(b)?b=b.concat(na.map(b,na.camelCase)):b in d?b=[b]:(b=na.camelCase(b),b=b in d?[b]:b.split(" ")),e=b.length;for(;e--;)delete d[b[e]];if(c?!j(d):!na.isEmptyObject(d))return}(c||(delete g[h].data,j(g[h])))&&(f?na.cleanData([a],!0):la.deleteExpando||g!=g.window?delete g[h]:g[h]=void 0)}}}function m(a,b,c,d){var e,f=1,g=20,h=d?function(){return d.cur()}:function(){return na.css(a,b,"")},i=h(),j=c&&c[3]||(na.cssNumber[b]?"":"px"),k=(na.cssNumber[b]||"px"!==j&&+i)&&Ka.exec(na.css(a,b));if(k&&k[3]!==j){j=j||k[3],c=c||[],k=+i||1;do f=f||".5",k/=f,na.style(a,b,k+j);while(f!==(f=h()/i)&&1!==f&&--g)}return c&&(k=+k||+i||0,e=c[1]?k+(c[1]+1)*c[2]:+c[2],d&&(d.unit=j,d.start=k,d.end=e)),e}function n(a){var b=Sa.split("|"),c=a.createDocumentFragment();if(c.createElement)for(;b.length;)c.createElement(b.pop());return c}function o(a,b){var c,d,e=0,f="undefined"!=typeof a.getElementsByTagName?a.getElementsByTagName(b||"*"):"undefined"!=typeof a.querySelectorAll?a.querySelectorAll(b||"*"):void 0;if(!f)for(f=[],c=a.childNodes||a;null!=(d=c[e]);e++)!b||na.nodeName(d,b)?f.push(d):na.merge(f,o(d,b));return void 0===b||b&&na.nodeName(a,b)?na.merge([a],f):f}function p(a,b){for(var c,d=0;null!=(c=a[d]);d++)na._data(c,"globalEval",!b||na._data(b[d],"globalEval"))}function q(a){Oa.test(a.type)&&(a.defaultChecked=a.checked)}function r(a,b,c,d,e){for(var f,g,h,i,j,k,l,m=a.length,r=n(b),s=[],t=0;m>t;t++)if(g=a[t],g||0===g)if("object"===na.type(g))na.merge(s,g.nodeType?[g]:g);else if(Ua.test(g)){for(i=i||r.appendChild(b.createElement("div")),j=(Pa.exec(g)||["",""])[1].toLowerCase(),l=Ta[j]||Ta._default,i.innerHTML=l[1]+na.htmlPrefilter(g)+l[2],f=l[0];f--;)i=i.lastChild;if(!la.leadingWhitespace&&Ra.test(g)&&s.push(b.createTextNode(Ra.exec(g)[0])),!la.tbody)for(g="table"!==j||Va.test(g)?""!==l[1]||Va.test(g)?0:i:i.firstChild,f=g&&g.childNodes.length;f--;)na.nodeName(k=g.childNodes[f],"tbody")&&!k.childNodes.length&&g.removeChild(k);for(na.merge(s,i.childNodes),i.textContent="";i.firstChild;)i.removeChild(i.firstChild);i=r.lastChild}else s.push(b.createTextNode(g));for(i&&r.removeChild(i),la.appendChecked||na.grep(o(s,"input"),q),t=0;g=s[t++];)if(d&&na.inArray(g,d)>-1)e&&e.push(g);else if(h=na.contains(g.ownerDocument,g),i=o(r.appendChild(g),"script"),h&&p(i),c)for(f=0;g=i[f++];)Qa.test(g.type||"")&&c.push(g);return i=null,r}function s(){return!0}function t(){return!1}function u(){try{return da.activeElement}catch(a){}}function v(a,b,c,d,e,f){var g,h;if("object"==typeof b){"string"!=typeof c&&(d=d||c,c=void 0);for(h in b)v(a,h,c,d,b[h],f);return a}if(null==d&&null==e?(e=c,d=c=void 0):null==e&&("string"==typeof c?(e=d,d=void 0):(e=d,d=c,c=void 0)),e===!1)e=t;else if(!e)return a;return 1===f&&(g=e,e=function(a){return na().off(a),g.apply(this,arguments)},e.guid=g.guid||(g.guid=na.guid++)),a.each(function(){na.event.add(this,b,e,d,c)})}function w(a,b){return na.nodeName(a,"table")&&na.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function x(a){return a.type=(null!==na.find.attr(a,"type"))+"/"+a.type,a}function y(a){var b=eb.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function z(a,b){if(1===b.nodeType&&na.hasData(a)){var c,d,e,f=na._data(a),g=na._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;e>d;d++)na.event.add(b,c,h[c][d])}g.data&&(g.data=na.extend({},g.data))}}function A(a,b){var c,d,e;if(1===b.nodeType){if(c=b.nodeName.toLowerCase(),!la.noCloneEvent&&b[na.expando]){e=na._data(b);for(d in e.events)na.removeEvent(b,d,e.handle);b.removeAttribute(na.expando)}"script"===c&&b.text!==a.text?(x(b).text=a.text,y(b)):"object"===c?(b.parentNode&&(b.outerHTML=a.outerHTML),la.html5Clone&&a.innerHTML&&!na.trim(b.innerHTML)&&(b.innerHTML=a.innerHTML)):"input"===c&&Oa.test(a.type)?(b.defaultChecked=b.checked=a.checked,b.value!==a.value&&(b.value=a.value)):"option"===c?b.defaultSelected=b.selected=a.defaultSelected:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}}function B(a,b,c,d){b=fa.apply([],b);var e,f,g,h,i,j,k=0,l=a.length,m=l-1,n=b[0],p=na.isFunction(n);if(p||l>1&&"string"==typeof n&&!la.checkClone&&db.test(n))return a.each(function(e){var f=a.eq(e);p&&(b[0]=n.call(this,e,f.html())),B(f,b,c,d)});if(l&&(j=r(b,a[0].ownerDocument,!1,a,d),e=j.firstChild,1===j.childNodes.length&&(j=e),e||d)){for(h=na.map(o(j,"script"),x),g=h.length;l>k;k++)f=j,k!==m&&(f=na.clone(f,!0,!0),g&&na.merge(h,o(f,"script"))),c.call(a[k],f,k);if(g)for(i=h[h.length-1].ownerDocument,na.map(h,y),k=0;g>k;k++)f=h[k],Qa.test(f.type||"")&&!na._data(f,"globalEval")&&na.contains(i,f)&&(f.src?na._evalUrl&&na._evalUrl(f.src):na.globalEval((f.text||f.textContent||f.innerHTML||"").replace(fb,"")));j=e=null}return a}function C(a,b,c){for(var d,e=b?na.filter(b,a):a,f=0;null!=(d=e[f]);f++)c||1!==d.nodeType||na.cleanData(o(d)),d.parentNode&&(c&&na.contains(d.ownerDocument,d)&&p(o(d,"script")),d.parentNode.removeChild(d));return a}function D(a,b){var c=na(b.createElement(a)).appendTo(b.body),d=na.css(c[0],"display");return c.detach(),d}function E(a){var b=da,c=jb[a];return c||(c=D(a,b),"none"!==c&&c||(ib=(ib||na("