diff --git a/.bowerrc b/.bowerrc new file mode 100644 index 000000000..1e77ab58c --- /dev/null +++ b/.bowerrc @@ -0,0 +1,5 @@ +{ + "scripts": { + "postinstall": "grunt" + } +} diff --git a/.gitignore b/.gitignore index 5e3dcbaff..59c3fb532 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ node_modules bower_components +dist/*_bower.* application/config/email.php application/config/database.php *.patch @@ -17,5 +18,4 @@ git-svn-diff.py *~ *.~ *.log -dist/*_bower.* application/sessions/* diff --git a/Dockerfile b/Dockerfile index 7fc1af1af..d401c2022 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,7 +14,7 @@ RUN apt-get install -y python git # Get latest Ospos source from Git RUN git clone https://github.com/jekkos/opensourcepos.git /app -# RUN cd app && git checkout develop/2.4 +RUN cd app && git checkout feature/bootstrapUI RUN ln -s /usr/bin/nodejs /usr/bin/node RUN cd app && npm install RUN npm install -g grunt-cli diff --git a/Gruntfile.js b/Gruntfile.js index 666b97797..e3ba25848 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -1,116 +1,178 @@ module.exports = function(grunt) { - grunt.initConfig({ - pkg: grunt.file.readJSON('package.json'), - concat: { - js: { + grunt.initConfig({ + pkg: grunt.file.readJSON('package.json'), + wiredep: { + task: { + ignorePath: '../../../', + src: ['**/header.php'] + } + }, + bower_concat: { + all: { + mainFiles: { + 'bootswatch-dist': ['bootstrap/dist/js/bootstrap.js'] + }, + dest: { + 'js': 'dist/opensourcepos_bower.js', + 'css': 'dist/opensourcepos_bower.css' + } + } + }, + bowercopy: { + options: { + // Bower components folder will be removed afterwards + // clean: true + }, + bootstrap: { + options: { + destPrefix: 'dist' + }, + files: { + 'jquery-ui.css': 'jquery-ui/themes/base/jquery-ui.css', + 'bootstrap.min.css': 'bootswatch-dist/css/bootstrap.min.css' + } + } + }, + cssmin: { + target: { + files: { + 'dist/<%= pkg.name %>.min.css': ['dist/opensourcepos_bower.css', 'css/*.css', '!css/login.css', '!css/invoice_email.css'] + } + } + }, + concat: { + js: { + options: { + separator: ';' + }, + files: { + 'dist/<%= pkg.name %>.js': ['dist/opensourcepos_bower.js', 'js/jquery*', 'js/*.js'] + } + }, + sql: { + options: { + banner: '-- >> This file is autogenerated from tables.sql and constraints.sql. Do not modify directly << --' + }, + files: { + 'database/database.sql': ['database/tables.sql', 'database/constraints.sql'], + 'database/migrate_phppos_dist.sql': ['database/tables.sql', 'database/phppos_migrate.sql', 'database/constraints.sql'] + } + } + }, + uglify: { options: { - separator: ';' + banner: '/*! <%= pkg.name %> <%= grunt.template.today("dd-mm-yyyy") %> */\n' }, dist: { - src: ['js/jquery*', 'js/*.js'], - dest: 'dist/<%= pkg.name %>.js' + files: { + 'dist/<%= pkg.name %>.min.js': ['dist/<%= pkg.name %>.js'] + } } }, - sql: { + jshint: { + files: ['Gruntfile.js', 'js/*.js'], options: { - banner: '-- >> This file is autogenerated from tables.sql and constraints.sql. Do not modify directly << --' - }, - files: { - 'database/database.sql': ['database/tables.sql', 'database/constraints.sql'], - 'database/migrate_phppos_dist.sql': ['database/tables.sql', 'database/phppos_migrate.sql', 'database/constraints.sql'] + // options here to override JSHint defaults + globals: { + jQuery: true, + console: true, + module: true, + document: true + } } - } - }, - - uglify: { - options: { - banner: '/*! <%= pkg.name %> <%= grunt.template.today("dd-mm-yyyy") %> */\n' - }, - dist: { - files: { - 'dist/<%= pkg.name %>.min.js': ['<%= concat.js.dist.dest %>'] - } - } - }, - jshint: { - files: ['Gruntfile.js', 'js/*.js'], - options: { - // options here to override JSHint defaults - globals: { - jQuery: true, - console: true, - module: true, - document: true - } - } - }, - tags: { - js : { - options: { - scriptTemplate: '', - openTag: '', - closeTag: '', - absolutePath: true - }, - src: [ - 'js/jquery*.js', 'js/*.js', - ], - dest: 'application/views/partial/header.php' - }, - minjs : { - options: { - scriptTemplate: '', - openTag: '', - closeTag: '', - absolutePath: true - }, - src: [ - 'dist/*min.js', - ], - dest: 'application/views/partial/header.php' - } - }, - mochaWebdriver: { - options: { - timeout: 1000 * 60 * 3 }, - test : { - options: { - usePhantom: true, - usePromises: true - }, - src: ['test/**/*.js'] - } - }, - watch: { - files: ['<%= jshint.files %>'], - tasks: ['jshint'] - }, - cachebreaker: { - dev: { - options: { - match: ['opensourcepos.min.js'], - src: { - path: 'dist/opensourcepos.min.js' + tags: { + css_header: { + options: { + scriptTemplate: '', + openTag: '', + closeTag: '', + absolutePath: true }, - replacement: 'md5' + src: [ 'css/*.css', '!css/login.css', '!css/invoice_email.css' ], + dest: 'application/views/partial/header.php' }, - files: { - src: ['application/views/partial/header.php'] + mincss_header: { + options: { + scriptTemplate: '', + openTag: '', + closeTag: '', + absolutePath: true + }, + src: [ 'dist/*.css' ], + dest: 'application/views/partial/header.php' + }, + css_login: { + options: { + scriptTemplate: '', + openTag: '', + closeTag: '', + absolutePath: true + }, + src: [ 'dist/jquery-ui.min.css', 'dist/bootstrap.min.css', 'css/login.css' ], + dest: 'application/views/login.php' + }, + js: { + options: { + scriptTemplate: '', + openTag: '', + closeTag: '', + absolutePath: true + }, + src: [ 'js/jquery*', 'js/*.js' ], + dest: 'application/views/partial/header.php' + }, + minjs: { + options: { + scriptTemplate: '', + openTag: '', + closeTag: '', + absolutePath: true + }, + src: [ + 'dist/*min.js' + ], + dest: 'application/views/partial/header.php' + } + }, + mochaWebdriver: { + options: { + timeout: 1000 * 60 * 3 + }, + test : { + options: { + usePhantom: true, + usePromises: true + }, + src: ['test/**/*.js'] + } + }, + watch: { + files: ['<%= jshint.files %>'], + tasks: ['jshint'] + }, + cachebreaker: { + dev: { + options: { + match: [ + { + 'opensourcepos.min.js': 'dist/opensourcepos.min.js', + 'opensourcepos.min.css': 'dist/opensourcepos.min.css', + 'bootstrap.min.css': 'dist/bootstrap.min.css' + } + ], + replacement: 'md5' + }, + files: { + src: ['**/header.php', '**/login.php'] + } } } - } - }); + }); - grunt.loadNpmTasks('grunt-contrib-uglify'); - grunt.loadNpmTasks('grunt-contrib-jshint'); - grunt.loadNpmTasks('grunt-contrib-watch'); - grunt.loadNpmTasks('grunt-contrib-concat'); - grunt.loadNpmTasks('grunt-script-link-tags'); - grunt.loadNpmTasks('grunt-mocha-webdriver'); - grunt.loadNpmTasks('grunt-cache-breaker'); + require('load-grunt-tasks')(grunt); - grunt.registerTask('default', ['tags:js', 'concat', 'uglify', 'tags:minjs', 'cachebreaker']); + grunt.registerTask('default', ['wiredep', 'bower_concat', 'bowercopy', 'concat', 'uglify', 'cssmin', 'tags', 'cachebreaker']); }; diff --git a/README.md b/README.md index f27671899..08de02626 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,11 @@ Introduction Open Source Point of Sale is a web based point of sale system written in the PHP language. It uses MySQL as the data storage back-end and has a simple user interface. +This is the experimental vs 3.0.0 based on Bootstrap 3 using Bootswatch theme Flatly as default. +This version is currently under development and an evolution of vs 2.4 with CI3. + +This version requires at least PHP 5.5. + Badges ------ diff --git a/application/config/autoload.php b/application/config/autoload.php index 605631609..114114780 100644 --- a/application/config/autoload.php +++ b/application/config/autoload.php @@ -83,7 +83,7 @@ $autoload['drivers'] = array(); | | $autoload['helper'] = array('url', 'file'); */ -$autoload['helper'] = array('form', 'url', 'table', 'text', 'currency', 'html', 'download', 'directory', 'dateformat_helper'); +$autoload['helper'] = array('form', 'url', 'table', 'text', 'locale', 'html', 'download', 'directory'); /* | ------------------------------------------------------------------- diff --git a/application/config/config.php b/application/config/config.php index a4bcf66e9..c82190a6c 100644 --- a/application/config/config.php +++ b/application/config/config.php @@ -10,7 +10,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); | | */ -$config['application_version'] = '2.4.0'; +$config['application_version'] = '3.0.0'; /* |-------------------------------------------------------------------------- @@ -452,8 +452,8 @@ $config['global_xss_filtering'] = FALSE; | 'csrf_exclude_uris' = Array of URIs which ignore CSRF checks */ $config['csrf_protection'] = FALSE; -$config['csrf_token_name'] = 'csrf_ospos_v24'; -$config['csrf_cookie_name'] = 'csrf_cookie_ospos_v24'; +$config['csrf_token_name'] = 'csrf_ospos_v3'; +$config['csrf_cookie_name'] = 'csrf_cookie_ospos_v3'; $config['csrf_expire'] = 7200; $config['csrf_regenerate'] = TRUE; $config['csrf_exclude_uris'] = array(); diff --git a/application/config/pagination.php b/application/config/pagination.php new file mode 100644 index 000000000..f89d195db --- /dev/null +++ b/application/config/pagination.php @@ -0,0 +1,24 @@ +"; +$config['full_tag_close'] =""; +$config['num_tag_open'] = '
  • '; +$config['num_tag_close'] = '
  • '; +$config['cur_tag_open'] = "
  • "; +$config['cur_tag_close'] = "
  • "; +$config['next_tag_open'] = "
  • "; +$config['next_tagl_close'] = "
  • "; +$config['prev_tag_open'] = "
  • "; +$config['prev_tagl_close'] = "
  • "; +$config['first_tag_open'] = "
  • "; +$config['first_tagl_close'] = "
  • "; +$config['last_tag_open'] = "
  • "; +$config['last_tagl_close'] = "
  • "; \ No newline at end of file diff --git a/application/config/theme.php b/application/config/theme.php new file mode 100644 index 000000000..807e85503 --- /dev/null +++ b/application/config/theme.php @@ -0,0 +1,15 @@ +Stock_location->get_all()->result_array(); $data['support_barcode'] = $this->barcode_lib->get_list_barcodes(); + $data['logo_exists'] = $this->Appconfig->get('company_logo') != ''; + $this->load->view("configs/manage", $data); } @@ -60,12 +62,13 @@ class Config extends Secure_area $success = $upload_success && $result ? true : false; $message = $this->lang->line('config_saved_' . ($success ? '' : 'un') . 'successfully'); $message = $upload_success ? $message : $this->upload->display_errors(); - echo json_encode(array('success'=>$success,'message'=>$message)); + + echo json_encode(array('success'=>$success, 'message'=>$message)); } function save_locale() { - $batch_save_data=array( + $batch_save_data = array( 'currency_symbol'=>$this->input->post('currency_symbol'), 'currency_side'=>$this->input->post('currency_side') != null, 'language'=>$this->input->post('language'), @@ -73,17 +76,22 @@ class Config extends Secure_area 'dateformat'=>$this->input->post('dateformat'), 'timeformat'=>$this->input->post('timeformat'), 'thousands_separator'=>$this->input->post('thousands_separator'), - 'decimal_point'=>$this->input->post('decimal_point') + 'decimal_point'=>$this->input->post('decimal_point'), + 'currency_decimals'=>$this->input->post('currency_decimals'), + 'tax_decimals'=>$this->input->post('tax_decimals'), + 'quantity_decimals'=>$this->input->post('quantity_decimals') ); - $result = $this->Appconfig->batch_save( $batch_save_data ); + $result = $this->Appconfig->batch_save($batch_save_data); $success = $result ? true : false; + echo json_encode(array('success'=>$success, 'message'=>$this->lang->line('config_saved_' . ($success ? '' : 'un') . 'successfully'))); } function stock_locations() { $stock_locations = $this->Stock_location->get_all()->result_array(); + $this->load->view('partial/stock_locations', array('stock_locations' => $stock_locations)); } @@ -122,8 +130,10 @@ class Config extends Secure_area { $this->Stock_location->delete($location_id); } + $success = $this->db->trans_complete(); - echo json_encode(array('success'=>$success,'message'=>$this->lang->line('config_saved_' . ($success ? '' : 'un') . 'successfully'))); + + echo json_encode(array('success'=>$success, 'message'=>$this->lang->line('config_saved_' . ($success ? '' : 'un') . 'successfully'))); } function save_barcode() @@ -147,6 +157,7 @@ class Config extends Secure_area $result = $this->Appconfig->batch_save( $batch_save_data ); $success = $result ? true : false; + echo json_encode(array('success'=>$success, 'message'=>$this->lang->line('config_saved_' . ($success ? '' : 'un') . 'successfully'))); } @@ -168,12 +179,21 @@ class Config extends Secure_area ); $result = $this->Appconfig->batch_save( $batch_save_data ); $success = $result ? true : false; + echo json_encode(array('success'=>$success, 'message'=>$this->lang->line('config_saved_' . ($success ? '' : 'un') . 'successfully'))); } + + public function remove_logo() + { + $result = $this->Appconfig->batch_save(array('company_logo' => '')); + + echo json_encode(array('success'=>$result)); + } - function _handle_logo_upload() + private function _handle_logo_upload() { $this->load->helper('directory'); + // load upload library $config = array('upload_path' => './uploads/', 'allowed_types' => 'gif|jpg|png', @@ -183,6 +203,7 @@ class Config extends Secure_area 'file_name' => 'company_logo'); $this->load->library('upload', $config); $this->upload->do_upload('company_logo'); + return strlen($this->upload->display_errors()) == 0 || !strcmp($this->upload->display_errors(), '

    '.$this->lang->line('upload_no_file_selected').'

    '); } @@ -202,7 +223,8 @@ class Config extends Secure_area $file_name = 'ospos-' . date("Y-m-d-H-i-s") .'.zip'; $save = 'uploads/'.$file_name; $this->load->helper('download'); - while (ob_get_level()) { + while (ob_get_level()) + { ob_end_clean(); } force_download($file_name, $backup); diff --git a/application/controllers/Customers.php b/application/controllers/Customers.php index df2a955a6..a27026e66 100644 --- a/application/controllers/Customers.php +++ b/application/controllers/Customers.php @@ -11,7 +11,6 @@ class Customers extends Person_controller function index($limit_from=0) { $data['controller_name'] = $this->get_controller_name(); - $data['form_width'] = $this->get_form_width(); $lines_per_page = $this->Appconfig->get('lines_per_page'); $customers = $this->Customer->get_all($lines_per_page, $limit_from); $data['links'] = $this->_initialize_pagination($this->Customer, $lines_per_page, $limit_from); @@ -41,8 +40,14 @@ class Customers extends Person_controller */ function suggest() { - $suggestions = $this->Customer->get_search_suggestions($this->input->post('q'),$this->input->post('limit')); - echo implode("\n",$suggestions); + $suggestions = $this->Customer->get_search_suggestions($this->input->get('term'), TRUE); + echo json_encode($suggestions); + } + + function suggest_search() + { + $suggestions = $this->Customer->get_search_suggestions($this->input->post('term'), FALSE); + echo json_encode($suggestions); } /* @@ -143,6 +148,7 @@ class Customers extends Person_controller { $msg = $this->lang->line('items_excel_import_failed'); echo json_encode( array('success'=>false,'message'=>$msg) ); + return; } else @@ -156,22 +162,22 @@ class Customers extends Person_controller while (($data = fgetcsv($handle)) !== FALSE) { $person_data = array( - 'first_name'=>$data[0], - 'last_name'=>$data[1], - 'gender'=>$data[2], - 'email'=>$data[3], - 'phone_number'=>$data[4], - 'address_1'=>$data[5], - 'address_2'=>$data[6], - 'city'=>$data[7], - 'state'=>$data[8], - 'zip'=>$data[9], - 'country'=>$data[10], - 'comments'=>$data[11] + 'first_name'=>$data[0], + 'last_name'=>$data[1], + 'gender'=>$data[2], + 'email'=>$data[3], + 'phone_number'=>$data[4], + 'address_1'=>$data[5], + 'address_2'=>$data[6], + 'city'=>$data[7], + 'state'=>$data[8], + 'zip'=>$data[9], + 'country'=>$data[10], + 'comments'=>$data[11] ); $customer_data=array( - 'taxable'=>$data[13]=='' ? 0:1 + 'taxable'=>$data[13]=='' ? 0:1 ); $account_number = $data[12]; @@ -192,7 +198,8 @@ class Customers extends Person_controller } else { - echo json_encode( array('success'=>false,'message'=>'Your upload file has no data or not in supported format.') ); + echo json_encode( array('success'=>false, 'message'=>'Your upload file has no data or not in supported format.') ); + return; } } @@ -208,15 +215,7 @@ class Customers extends Person_controller $msg = "Import Customers successful"; } - echo json_encode( array('success'=>$success,'message'=>$msg) ); - } - - /* - get the width for the add/edit form - */ - function get_form_width() - { - return 400; + echo json_encode( array('success'=>$success, 'message'=>$msg) ); } } ?> \ No newline at end of file diff --git a/application/controllers/Employees.php b/application/controllers/Employees.php index 1473c4588..130dc629d 100644 --- a/application/controllers/Employees.php +++ b/application/controllers/Employees.php @@ -11,12 +11,11 @@ class Employees extends Person_controller function index($limit_from=0) { $data['controller_name'] = $this->get_controller_name(); - $data['form_width'] = $this->get_form_width(); $lines_per_page = $this->Appconfig->get('lines_per_page'); - $suppliers = $this->Employee->get_all($lines_per_page, $limit_from); + $employees = $this->Employee->get_all($lines_per_page, $limit_from); $data['links'] = $this->_initialize_pagination($this->Employee, $lines_per_page, $limit_from); - $data['manage_table'] = get_people_manage_table($suppliers, $this); - $this->load->view('suppliers/manage',$data); + $data['manage_table'] = get_people_manage_table($employees, $this); + $this->load->view('people/manage',$data); } /* @@ -39,10 +38,10 @@ class Employees extends Person_controller /* Gives search suggestions based on what is being searched for */ - function suggest() + function suggest_search() { - $suggestions = $this->Employee->get_search_suggestions($this->input->post('q'),$this->input->post('limit')); - echo implode("\n",$suggestions); + $suggestions = $this->Employee->get_search_suggestions($this->input->post('term')); + echo json_encode($suggestions); } /* @@ -128,12 +127,5 @@ class Employees extends Person_controller echo json_encode(array('success'=>false,'message'=>$this->lang->line('employees_cannot_be_deleted'))); } } - /* - get the width for the add/edit form - */ - function get_form_width() - { - return 750; - } } ?> \ No newline at end of file diff --git a/application/controllers/Giftcards.php b/application/controllers/Giftcards.php index ab5f85545..6f6b406d4 100644 --- a/application/controllers/Giftcards.php +++ b/application/controllers/Giftcards.php @@ -12,7 +12,6 @@ class Giftcards extends Secure_area implements iData_controller function index($limit_from=0) { $data['controller_name'] = $this->get_controller_name(); - $data['form_width'] = $this->get_form_width(); $lines_per_page = $this->Appconfig->get('lines_per_page'); $giftcards = $this->Giftcard->get_all($lines_per_page, $limit_from); $data['links'] = $this->_initialize_pagination($this->Giftcard, $lines_per_page, $limit_from); @@ -40,19 +39,10 @@ class Giftcards extends Secure_area implements iData_controller /* Gives search suggestions based on what is being searched for */ - function suggest() + function suggest_search() { - $suggestions = $this->Giftcard->get_search_suggestions($this->input->post('q'), $this->input->post('limit')); - echo implode("\n",$suggestions); - } - - /* - Gives search suggestions for person_id based on what is being searched for - */ - function person_search() - { - $suggestions = $this->Customer->get_customer_search_suggestions($this->input->post('q'), $this->input->post('limit')); - echo implode("\n",$suggestions); + $suggestions = $this->Giftcard->get_search_suggestions($this->input->post('term')); + echo json_encode($suggestions); } function get_row() @@ -66,7 +56,8 @@ class Giftcards extends Secure_area implements iData_controller { $giftcard_info = $this->Giftcard->get_info($giftcard_id); $person_name=$giftcard_id > 0? $giftcard_info->first_name . ' ' . $giftcard_info->last_name : ''; - $data['selected_person'] = $giftcard_id > 0 && isset($giftcard_info->person_id) ? $giftcard_info->person_id . "|" . $person_name : ""; + $data['selected_person_name'] = $giftcard_id > 0 && isset($giftcard_info->person_id) ? $person_name : ''; + $data['selected_person_id'] = $giftcard_info->person_id; $data['giftcard_number'] = $giftcard_id > 0 ? $giftcard_info->giftcard_number : $this->Giftcard->get_max_number()->giftcard_number + 1; $data['giftcard_info'] = $giftcard_info; $this->load->view("giftcards/form",$data); @@ -117,13 +108,5 @@ class Giftcards extends Secure_area implements iData_controller echo json_encode(array('success'=>false, 'message'=>$this->lang->line('giftcards_cannot_be_deleted'))); } } - - /* - get the width for the add/edit form - */ - function get_form_width() - { - return 360; - } } ?> diff --git a/application/controllers/Item_kits.php b/application/controllers/Item_kits.php index 53dd1c7d3..ca1ac78b3 100644 --- a/application/controllers/Item_kits.php +++ b/application/controllers/Item_kits.php @@ -29,7 +29,6 @@ class Item_kits extends Secure_area implements iData_controller function index($limit_from=0) { $data['controller_name'] = $this->get_controller_name(); - $data['form_width'] = $this->get_form_width(); $lines_per_page = $this->Appconfig->get('lines_per_page'); $item_kits = $this->Item_kit->get_all($lines_per_page, $limit_from); @@ -69,14 +68,10 @@ class Item_kits extends Secure_area implements iData_controller echo json_encode(array('total_rows' => $total_rows, 'rows' => $data_rows, 'pagination' => $links)); } - /* - Gives search suggestions based on what is being searched for - */ - function suggest() + function suggest_search() { - $suggestions = $this->Item_kit->get_search_suggestions($this->input->post('q'), $this->input->post('limit')); - - echo implode("\n", $suggestions); + $suggestions = $this->Item_kit->get_search_suggestions($this->input->post('term')); + echo json_encode($suggestions); } function get_row() @@ -181,15 +176,9 @@ class Item_kits extends Secure_area implements iData_controller $barcode_config['barcode_type'] = 'Code128'; } $data['barcode_config'] = $barcode_config; - $this->load->view("barcode_sheet", $data); - } - - /* - get the width for the add/edit form - */ - function get_form_width() - { - return 400; + + // display barcodes + $this->load->view("barcodes/barcode_sheet", $data); } } ?> \ No newline at end of file diff --git a/application/controllers/Items.php b/application/controllers/Items.php index ff08ac816..6a2d1f70c 100644 --- a/application/controllers/Items.php +++ b/application/controllers/Items.php @@ -16,23 +16,18 @@ class Items extends Secure_area implements iData_controller $stock_locations = $this->Stock_location->get_allowed_locations(); $data['controller_name'] = $this->get_controller_name(); - $data['form_width'] = $this->get_form_width(); $lines_per_page = $this->Appconfig->get('lines_per_page'); $items = $this->Item->get_all($stock_location, $lines_per_page, $limit_from); - $data['links'] = $this->_initialize_pagination($this->Item, $lines_per_page, $limit_from); - - // set 01/01/2010 as starting date for OSPOS - $start_of_time = date($this->config->item('dateformat'), mktime(0,0,0,1,1,2010)); - $today = date($this->config->item('dateformat')); + $data['links'] = $this->_initialize_pagination($this->Item, $lines_per_page, $limit_from); + + // filters that will be loaded in the multiselect dropdown + $data['filters'] = array('empty_upc' => $this->lang->line('items_empty_upc_items'), + 'low_inventory' => $this->lang->line('items_low_inventory_items'), + 'is_serialized' => $this->lang->line('items_serialized_items'), + 'no_description' => $this->lang->line('items_no_description_items'), + 'search_custom' => $this->lang->line('items_search_custom_items'), + 'is_deleted' => $this->lang->line('items_is_deleted')); - $start_date = $this->input->post('start_date') != null ? $this->input->post('start_date') : $start_of_time; - $start_date_formatter = date_create_from_format($this->config->item('dateformat'), $start_date); - $end_date = $this->input->post('end_date') != null ? $this->input->post('end_date') : $today; - $end_date_formatter = date_create_from_format($this->config->item('dateformat'), $end_date); - - $data['start_date'] = $start_date_formatter->format($this->config->item('dateformat')); - $data['end_date'] = $end_date_formatter->format($this->config->item('dateformat')); - $data['stock_location'] = $stock_location; $data['stock_locations'] = $stock_locations; $data['manage_table'] = get_items_manage_table( $this->Item->get_all($stock_location, $lines_per_page, $limit_from), $this ); @@ -40,12 +35,6 @@ class Items extends Secure_area implements iData_controller $this->load->view('items/manage', $data); } - function find_item_info() - { - $item_number = $this->input->post('scan_item_number'); - echo json_encode($this->Item->find_item_info($item_number)); - } - /* Returns Items table data rows. This will be called with AJAX. */ @@ -56,33 +45,31 @@ class Items extends Secure_area implements iData_controller $lines_per_page = $this->Appconfig->get('lines_per_page'); $this->item_lib->set_item_location($this->input->post('stock_location')); - // set 01/01/2010 as starting date for OSPOS - $start_of_time = date($this->config->item('dateformat'), mktime(0,0,0,1,1,2010)); - $today = date($this->config->item('dateformat')); - - $start_date = $this->input->post('start_date') != null ? $this->input->post('start_date') : $start_of_time; - $start_date_formatter = date_create_from_format($this->config->item('dateformat'), $start_date); - $end_date = $this->input->post('end_date') != null ? $this->input->post('end_date') : $today; - $end_date_formatter = date_create_from_format($this->config->item('dateformat'), $end_date); - - $filters = array('start_date' => $start_date_formatter->format('Y-m-d'), - 'end_date' => $end_date_formatter->format('Y-m-d'), + $filters = array('start_date' => $this->input->post('start_date'), + 'end_date' => $this->input->post('end_date'), 'stock_location_id' => $this->item_lib->get_item_location(), - 'empty_upc' => $this->input->post('empty_upc') != null, - 'low_inventory' => $this->input->post('low_inventory') != null, - 'is_serialized' => $this->input->post('is_serialized') != null, - 'no_description' => $this->input->post('no_description') != null, - 'search_custom' => $this->input->post('search_custom') != null, - 'is_deleted' => $this->input->post('is_deleted') != null); + 'empty_upc' => FALSE, + 'low_inventory' => FALSE, + 'is_serialized' => FALSE, + 'no_description' => FALSE, + 'search_custom' => FALSE, + 'is_deleted' => FALSE); + // check if any filter is set in the multiselect dropdown + if( $this->input->post('filters') != null ) + { + foreach($this->input->post('filters') as $key) + { + $filters[$key] = TRUE; + } + } + $items = $this->Item->search($search, $filters, $lines_per_page, $limit_from); $data_rows = get_items_manage_table_data_rows($items, $this); $total_rows = $this->Item->get_found_rows($search, $filters); $links = $this->_initialize_pagination($this->Item, $lines_per_page, $limit_from, $total_rows, 'search'); $data_rows = get_items_manage_table_data_rows($items, $this); - // do not move this line to be after the json_encode otherwise the searhc function won't work!! - echo json_encode(array('total_rows' => $total_rows, 'rows' => $data_rows, 'pagination' => $links)); } @@ -117,19 +104,28 @@ class Items extends Secure_area implements iData_controller /* Gives search suggestions based on what is being searched for */ + function suggest_search() + { + $suggestions = $this->Item->get_search_suggestions($this->input->post_get('term'), + array( + 'search_custom' => $this->input->post('search_custom'), + 'is_deleted' => !empty($this->input->post('is_deleted')) + ), + FALSE); + + echo json_encode($suggestions); + } + function suggest() { - $suggestions = $this->Item->get_search_suggestions($this->input->post('q'), $this->input->post('limit'), - $this->input->post('search_custom'), !empty($this->input->post('is_deleted'))); + $suggestions = $this->Item->get_search_suggestions($this->input->post_get('term'), + array( + 'search_custom' => FALSE, + 'is_deleted' => FALSE + ), + TRUE); - echo implode("\n",$suggestions); - } - - function item_search() - { - $suggestions = $this->Item->get_item_search_suggestions($this->input->post('q'), $this->input->post('limit')); - - echo implode("\n",$suggestions); + echo json_encode($suggestions); } /* @@ -137,9 +133,9 @@ class Items extends Secure_area implements iData_controller */ function suggest_category() { - $suggestions = $this->Item->get_category_suggestions($this->input->post('q')); + $suggestions = $this->Item->get_category_suggestions($this->input->get('term')); - echo implode("\n",$suggestions); + echo json_encode($suggestions); } /* @@ -147,111 +143,21 @@ class Items extends Secure_area implements iData_controller */ function suggest_location() { - $suggestions = $this->Item->get_location_suggestions($this->input->post('q')); + $suggestions = $this->Item->get_location_suggestions($this->input->get('term')); - echo implode("\n",$suggestions); + echo json_encode($suggestions); } /* Gives search suggestions based on what is being searched for */ - function suggest_custom1() + function suggest_custom() { - $suggestions = $this->Item->get_custom1_suggestions($this->input->post('q')); + $suggestions = $this->Item->get_custom_suggestions($this->input->post('term'), $this->input->post('field_no')); - echo implode("\n",$suggestions); + echo json_encode($suggestions); } - - /* - Gives search suggestions based on what is being searched for - */ - function suggest_custom2() - { - $suggestions = $this->Item->get_custom2_suggestions($this->input->post('q')); - echo implode("\n",$suggestions); - } - - /* - Gives search suggestions based on what is being searched for - */ - function suggest_custom3() - { - $suggestions = $this->Item->get_custom3_suggestions($this->input->post('q')); - - echo implode("\n",$suggestions); - } - - /* - Gives search suggestions based on what is being searched for - */ - function suggest_custom4() - { - $suggestions = $this->Item->get_custom4_suggestions($this->input->post('q')); - - echo implode("\n",$suggestions); - } - - /* - Gives search suggestions based on what is being searched for - */ - function suggest_custom5() - { - $suggestions = $this->Item->get_custom5_suggestions($this->input->post('q')); - - echo implode("\n",$suggestions); - } - - /* - Gives search suggestions based on what is being searched for - */ - function suggest_custom6() - { - $suggestions = $this->Item->get_custom6_suggestions($this->input->post('q')); - - echo implode("\n",$suggestions); - } - - /* - Gives search suggestions based on what is being searched for - */ - function suggest_custom7() - { - $suggestions = $this->Item->get_custom7_suggestions($this->input->post('q')); - - echo implode("\n",$suggestions); - } - - /* - Gives search suggestions based on what is being searched for - */ - function suggest_custom8() - { - $suggestions = $this->Item->get_custom8_suggestions($this->input->post('q')); - - echo implode("\n",$suggestions); - } - - /* - Gives search suggestions based on what is being searched for - */ - function suggest_custom9() - { - $suggestions = $this->Item->get_custom9_suggestions($this->input->post('q')); - - echo implode("\n",$suggestions); - } - - /* - Gives search suggestions based on what is being searched for - */ - function suggest_custom10() - { - $suggestions = $this->Item->get_custom10_suggestions($this->input->post('q')); - - echo implode("\n",$suggestions); - } - function get_row() { $item_id = $this->input->post('row_id'); @@ -262,31 +168,46 @@ class Items extends Secure_area implements iData_controller $data_row = get_item_data_row($item_info,$this); echo $data_row; - } function view($item_id=-1) { - $data['item_info']=$this->Item->get_info($item_id); - $data['item_tax_info']=$this->Item_taxes->get_info($item_id); - $suppliers = array('' => $this->lang->line('items_none')); + $item_info = $this->Item->get_info($item_id); + + $data['item_tax_info'] = $this->Item_taxes->get_info($item_id); + $data['default_tax_1_rate'] = ''; + $data['default_tax_2_rate'] = ''; + + if($item_id==-1) + { + $data['default_tax_1_rate'] = $this->Appconfig->get('default_tax_1_rate'); + $data['default_tax_2_rate'] = $this->Appconfig->get('default_tax_2_rate'); + + $item_info->receiving_quantity = 0; + $item_info->reorder_level = 0; + } + + $data['item_info'] = $item_info; + + $suppliers = array(''=>$this->lang->line('items_none')); foreach($this->Supplier->get_all()->result_array() as $row) { $suppliers[$row['person_id']] = $row['company_name']; } + $data['suppliers'] = $suppliers; + $data['selected_supplier'] = $item_info->supplier_id; - $data['suppliers']=$suppliers; - $data['selected_supplier'] = $this->Item->get_info($item_id)->supplier_id; - $data['default_tax_1_rate']=($item_id==-1) ? $this->Appconfig->get('default_tax_1_rate') : ''; - $data['default_tax_2_rate']=($item_id==-1) ? $this->Appconfig->get('default_tax_2_rate') : ''; - - $locations_data = $this->Stock_location->get_undeleted_all()->result_array(); + $data['logo_exists'] = $item_info->pic_id != ''; + $images = glob("uploads/item_pics/" . $item_info->pic_id . ".*"); + $data['image_path'] = sizeof($images) > 0 ? base_url($images[0]) : ''; + + $locations_data = $this->Stock_location->get_undeleted_all()->result_array(); foreach($locations_data as $location) { - $quantity = $this->Item_quantity->get_item_quantity($item_id,$location['location_id'])->quantity; - $quantity = ($item_id == -1) ? null: $quantity; - $location_array[$location['location_id']] = array('location_name'=>$location['location_name'], 'quantity'=>$quantity); - $data['stock_locations'] = $location_array; + $quantity = $this->Item_quantity->get_item_quantity($item_id,$location['location_id'])->quantity; + $quantity = ($item_id == -1) ? 0 : $quantity; + $location_array[$location['location_id']] = array('location_name'=>$location['location_name'], 'quantity'=>$quantity); + $data['stock_locations'] = $location_array; } $this->load->view("items/form", $data); @@ -294,7 +215,7 @@ class Items extends Secure_area implements iData_controller function inventory($item_id=-1) { - $data['item_info']=$this->Item->get_info($item_id); + $data['item_info'] = $this->Item->get_info($item_id); $data['stock_locations'] = array(); $stock_locations = $this->Stock_location->get_undeleted_all()->result_array(); @@ -309,7 +230,7 @@ class Items extends Secure_area implements iData_controller function count_details($item_id=-1) { - $data['item_info']=$this->Item->get_info($item_id); + $data['item_info'] = $this->Item->get_info($item_id); $data['stock_locations'] = array(); $stock_locations = $this->Stock_location->get_undeleted_all()->result_array(); @@ -354,9 +275,9 @@ class Items extends Secure_area implements iData_controller } } $data['items'] = $result; - // display barcodes - $this->load->view("barcode_sheet", $data); + // display barcodes + $this->load->view("barcodes/barcode_sheet", $data); } function bulk_edit() @@ -385,6 +306,7 @@ class Items extends Secure_area implements iData_controller { $upload_success = $this->_handle_image_upload(); $upload_data = $this->upload->data(); + //Save item data $item_data = array( 'name'=>$this->input->post('name'), @@ -433,7 +355,7 @@ class Items extends Secure_area implements iData_controller $items_taxes_data = array(); $tax_names = $this->input->post('tax_names'); $tax_percents = $this->input->post('tax_percents'); - for($k=0;$kStock_location->get_undeleted_all()->result_array(); foreach($stock_locations as $location_data) { - $updated_quantity = $this->input->post($location_data['location_id'].'_quantity'); + $updated_quantity = $this->input->post('quantity_' . $location_data['location_id']); $location_detail = array('item_id'=>$item_id, 'location_id'=>$location_data['location_id'], 'quantity'=>$updated_quantity); @@ -467,7 +389,7 @@ class Items extends Secure_area implements iData_controller $success &= $this->Inventory->insert($inv_data); } } - if ($success && $upload_success) + if($success && $upload_success) { $success_message = $this->lang->line('items_successful_' . ($new_item ? 'adding' : 'updating')) .' '. $item_data['name']; @@ -481,7 +403,6 @@ class Items extends Secure_area implements iData_controller echo json_encode(array('success'=>false, 'message'=>$error_message, 'item_id'=>$item_id)); } - } else//failure { @@ -495,25 +416,33 @@ class Items extends Secure_area implements iData_controller echo !$exists ? 'true' : 'false'; } - function _handle_image_upload() + private function _handle_image_upload() { $this->load->helper('directory'); + $map = directory_map('./uploads/item_pics/', 1); + // load upload library $config = array('upload_path' => './uploads/item_pics/', 'allowed_types' => 'gif|jpg|png', 'max_size' => '100', 'max_width' => '640', 'max_height' => '480', - 'file_name' => sizeof($map)); + 'file_name' => sizeof($map) + 1); $this->load->library('upload', $config); $this->upload->do_upload('item_image'); - return strlen($this->upload->display_errors()) == 0 || - !strcmp($this->upload->display_errors(), - '

    '.$this->lang->line('upload_no_file_selected').'

    '); + return strlen($this->upload->display_errors()) == 0 || !strcmp($this->upload->display_errors(), '

    '.$this->lang->line('upload_no_file_selected').'

    '); } - + + public function remove_logo($item_id) + { + $item_data = array('pic_id' => null); + $result = $this->Item->save($item_data, $item_id); + + echo json_encode(array('success' => $result)); + } + function save_inventory($item_id=-1) { $employee_id=$this->Employee->get_logged_in_employee_info()->person_id; @@ -556,32 +485,33 @@ class Items extends Secure_area implements iData_controller $item_data = array(); foreach($_POST as $key=>$value) - { + { //This field is nullable, so treat it differently if($key == 'supplier_id' && $value != '') { $item_data["$key"] = $value; } - elseif($value != '' && !(in_array($key, array('submit', 'item_ids', 'tax_names', 'tax_percents')))) + elseif($value != '' && !(in_array($key, array('item_ids', 'tax_names', 'tax_percents')))) { - $item_data["$key"]=$value; + $item_data["$key"] = $value; } } //Item data could be empty if tax information is being updated - if(empty($item_data) || $this->Item->update_multiple($item_data,$items_to_update)) + if(empty($item_data) || $this->Item->update_multiple($item_data, $items_to_update)) { $items_taxes_data = array(); $tax_names = $this->input->post('tax_names'); $tax_percents = $this->input->post('tax_percents'); $tax_updated = false; - for($k=0;$k$tax_names[$k], 'percent'=>$tax_percents[$k] ); + $items_taxes_data[] = array('name'=>$tax_names[$k], 'percent'=>$tax_percents[$k]); } } @@ -600,7 +530,7 @@ class Items extends Secure_area implements iData_controller function delete() { - $items_to_delete=$this->input->post('ids'); + $items_to_delete = $this->input->post('ids'); if($this->Item->delete_list($items_to_delete)) { @@ -764,8 +694,9 @@ class Items extends Secure_area implements iData_controller { $failCodes[] = $i; } + + $i++; } - $i++; } else { @@ -788,13 +719,5 @@ class Items extends Secure_area implements iData_controller echo json_encode( array('success'=>$success, 'message'=>$msg) ); } - - /* - get the width for the add/edit form - */ - function get_form_width() - { - return 450; - } } ?> diff --git a/application/controllers/Receivings.php b/application/controllers/Receivings.php index 2e4876523..2d067a6aa 100644 --- a/application/controllers/Receivings.php +++ b/application/controllers/Receivings.php @@ -16,15 +16,9 @@ class Receivings extends Secure_area function item_search() { - $suggestions = $this->Item->get_item_search_suggestions($this->input->post('q'),$this->input->post('limit')); - $suggestions = array_merge($suggestions, $this->Item_kit->get_item_kit_search_suggestions($this->input->post('q'),$this->input->post('limit'))); - echo implode("\n",$suggestions); - } - - function supplier_search() - { - $suggestions = $this->Supplier->get_suppliers_search_suggestions($this->input->post('q'),$this->input->post('limit')); - echo implode("\n",$suggestions); + $suggestions = $this->Item->get_search_suggestions($this->input->get('term')); + $suggestions = array_merge($suggestions, $this->Item_kit->get_search_suggestions($this->input->get('term'))); + echo json_encode($suggestions); } function select_supplier() @@ -81,7 +75,7 @@ class Receivings extends Secure_area $data=array(); $mode = $this->receiving_lib->get_mode(); $item_id_or_number_or_item_kit_or_receipt = $this->input->post('item'); - $quantity = ($mode=="receive" or $mode=="requisition") ? 1:-1; + $quantity = ($mode=="receive" or $mode=="requisition") ? 1 : -1; $item_location = $this->receiving_lib->get_stock_source(); if($mode=='return' && $this->receiving_lib->is_valid_receipt($item_id_or_number_or_item_kit_or_receipt)) { @@ -116,7 +110,7 @@ class Receivings extends Secure_area if ($this->form_validation->run() != FALSE) { - $this->receiving_lib->edit_item($item_id,$description,$serialnumber,$quantity,$discount,$price); + $this->receiving_lib->edit_item($item_id, $description, $serialnumber, $quantity, $discount, $price); } else { @@ -144,7 +138,8 @@ class Receivings extends Secure_area $receiving_info = $this->Receiving->get_info($receiving_id)->row_array(); $person_name = $receiving_info['first_name'] . " " . $receiving_info['last_name']; - $data['selected_supplier'] = !empty($receiving_info['supplier_id']) ? $receiving_info['supplier_id'] . "|" . $person_name : ""; + $data['selected_supplier_name'] = !empty($receiving_info['supplier_id']) ? $person_name : ""; + $data['selected_supplier_id'] = $receiving_info['supplier_id']; $data['receiving_info'] = $receiving_info; $this->load->view('receivings/form', $data); @@ -196,7 +191,7 @@ class Receivings extends Secure_area if ( $this->input->post('amount_tendered') != null ) { $data['amount_tendered'] = $this->input->post('amount_tendered'); - $data['amount_change'] = to_currency($data['amount_tendered'] - round($data['total'], 2)); + $data['amount_change'] = to_currency($data['amount_tendered'] - $data['total']); } $data['employee']=$emp_info->first_name.' '.$emp_info->last_name; $suppl_info =''; @@ -249,7 +244,6 @@ class Receivings extends Secure_area $text=$this->_substitute_supplier($text, $supplier_info); return $text; } - private function _substitute_supplier($text,$supplier_info) { @@ -370,7 +364,7 @@ class Receivings extends Secure_area $receiving_data = array( 'receiving_time' => $date_formatter->format('Y-m-d H:i:s'), - 'supplier_id' => empty($this->input->post('supplier_id')) ? NULL : $this->input->post('supplier_id'), + 'supplier_id' => $this->input->post('supplier_id', TRUE) ? $this->input->post('supplier_id') : null, 'employee_id' => $this->input->post('employee_id'), 'comment' => $this->input->post('comment'), 'invoice_number' => $this->input->post('invoice_number') @@ -404,7 +398,7 @@ class Receivings extends Secure_area { $receiving_id=$this->input->post('receiving_id'); $invoice_number=$this->input->post('invoice_number'); - $exists=!empty($invoice_number) && $this->Receiving->invoice_number_exists($invoice_number,$receiving_id); + $exists=!empty($invoice_number) && $this->Receiving->invoice_number_exists($invoice_number, $receiving_id); echo !$exists ? 'true' : 'false'; } } diff --git a/application/controllers/Reports.php b/application/controllers/Reports.php index 1778e6ece..c9caeefb1 100644 --- a/application/controllers/Reports.php +++ b/application/controllers/Reports.php @@ -2,8 +2,6 @@ require_once ("Secure_area.php"); require_once (APPPATH."libraries/ofc-library/Open-flash-chart.php"); -define("FORM_WIDTH", "400"); - class Reports extends Secure_area { @@ -31,25 +29,11 @@ class Reports extends Secure_area $this->load->view("reports/listing",$data); } - function _get_common_report_data() - { - $data = array(); - $data['report_date_range_simple'] = get_simple_date_ranges(); - $data['months'] = get_months(); - $data['days'] = get_days(); - $data['years'] = get_years(); - $data['selected_month']=date('n'); - $data['selected_day']=date('d'); - $data['selected_year']=date('Y'); - - return $data; - } - //Input for reports that require only a date range and an export to excel. (see routes.php to see that all summary reports route here) function date_input_excel_export() { - $data = $this->_get_common_report_data(); - $this->load->view("reports/date_input_excel_export",$data); + $data = array(); + $this->load->view("reports/date_input_excel_export", $data); } function get_detailed_sales_row($sale_id) @@ -59,9 +43,9 @@ class Reports extends Secure_area $report_data = $model->getDataBySaleId($sale_id); - $summary_data = array(anchor('sales/edit/'.$report_data['sale_id'] . '/width:'.FORM_WIDTH, + $summary_data = array(anchor('sales/edit/'.$report_data['sale_id'], 'POS '.$report_data['sale_id'], - array('class' => 'thickbox')), + array('class' => 'modal-dlg modal-btn-submit')), $report_data['sale_date'], $report_data['items_purchased'], $report_data['employee_name'], @@ -83,9 +67,9 @@ class Reports extends Secure_area $report_data = $model->getDataByReceivingId($receiving_id); - $summary_data = array(anchor('receivings/edit/'.$report_data['receiving_id'] . '/width:'.FORM_WIDTH, + $summary_data = array(anchor('receivings/edit/'.$report_data['receiving_id'], 'RECV '.$report_data['receiving_id'], - array('class' => 'thickbox')), + array('class' => 'modal-dlg modal-btn-submit')), $report_data['receiving_date'], $report_data['items_purchased'], $report_data['employee_name'], @@ -119,7 +103,7 @@ class Reports extends Secure_area foreach($report_data as $row) { - $tabular_data[] = array($row['sale_date'], $row['quantity_purchased'], to_currency($row['subtotal']), to_currency($row['total']), to_currency($row['tax']), to_currency($row['cost']), to_currency($row['profit'])); + $tabular_data[] = array($row['sale_date'], to_quantity_decimals($row['quantity_purchased']), to_currency($row['subtotal']), to_currency($row['total']), to_currency($row['tax']), to_currency($row['cost']), to_currency($row['profit'])); } $data = array( @@ -144,7 +128,7 @@ class Reports extends Secure_area foreach($report_data as $row) { - $tabular_data[] = array($row['category'], $row['quantity_purchased'], to_currency($row['subtotal']), to_currency($row['total']), to_currency($row['tax']), to_currency($row['cost']), to_currency($row['profit'])); + $tabular_data[] = array($row['category'], to_quantity_decimals($row['quantity_purchased']), to_currency($row['subtotal']), to_currency($row['total']), to_currency($row['tax']), to_currency($row['cost']), to_currency($row['profit'])); } $data = array( @@ -169,7 +153,7 @@ class Reports extends Secure_area foreach($report_data as $row) { - $tabular_data[] = array($row['customer'], $row['quantity_purchased'], to_currency($row['subtotal']), to_currency($row['total']), to_currency($row['tax']), to_currency($row['cost']), to_currency($row['profit'])); + $tabular_data[] = array($row['customer'], to_quantity_decimals($row['quantity_purchased']), to_currency($row['subtotal']), to_currency($row['total']), to_currency($row['tax']), to_currency($row['cost']), to_currency($row['profit'])); } $data = array( @@ -194,7 +178,7 @@ class Reports extends Secure_area foreach($report_data as $row) { - $tabular_data[] = array($row['supplier'], $row['quantity_purchased'], to_currency($row['subtotal']), to_currency($row['total']), to_currency($row['tax']), to_currency($row['cost']), to_currency($row['profit'])); + $tabular_data[] = array($row['supplier'], to_quantity_decimals($row['quantity_purchased']), to_currency($row['subtotal']), to_currency($row['total']), to_currency($row['tax']), to_currency($row['cost']), to_currency($row['profit'])); } $data = array( @@ -219,7 +203,7 @@ class Reports extends Secure_area foreach($report_data as $row) { - $tabular_data[] = array(character_limiter($row['name'], 40), $row['quantity_purchased'], to_currency($row['subtotal']), to_currency($row['total']), to_currency($row['tax']), to_currency($row['cost']), to_currency($row['profit'])); + $tabular_data[] = array(character_limiter($row['name'], 40), to_quantity_decimals($row['quantity_purchased']), to_currency($row['subtotal']), to_currency($row['total']), to_currency($row['tax']), to_currency($row['cost']), to_currency($row['profit'])); } $data = array( @@ -244,7 +228,7 @@ class Reports extends Secure_area foreach($report_data as $row) { - $tabular_data[] = array($row['employee'], $row['quantity_purchased'], to_currency($row['subtotal']), to_currency($row['total']), to_currency($row['tax']), to_currency($row['cost']), to_currency($row['profit'])); + $tabular_data[] = array($row['employee'], to_quantity_decimals($row['quantity_purchased']), to_currency($row['subtotal']), to_currency($row['total']), to_currency($row['tax']), to_currency($row['cost']), to_currency($row['profit'])); } $data = array( @@ -337,7 +321,7 @@ class Reports extends Secure_area //Input for reports that require only a date range. (see routes.php to see that all graphical summary reports route here) function date_input() { - $data = $this->_get_common_report_data(); + $data = array(); $data['mode'] = 'sale'; $this->load->view("reports/date_input",$data); } @@ -345,7 +329,7 @@ class Reports extends Secure_area //Input for reports that require only a date range. (see routes.php to see that all graphical summary reports route here) function date_input_sales() { - $data = $this->_get_common_report_data(); + $data = array(); $stock_locations = $this->Stock_location->get_allowed_locations('sales'); $stock_locations['all'] = $this->lang->line('reports_all'); $data['stock_locations'] = array_reverse($stock_locations, TRUE); @@ -355,7 +339,7 @@ class Reports extends Secure_area function date_input_recv() { - $data = $this->_get_common_report_data(); + $data = array(); $stock_locations = $this->Stock_location->get_allowed_locations('receivings'); $stock_locations['all'] = $this->lang->line('reports_all'); $data['stock_locations'] = array_reverse($stock_locations, TRUE); @@ -709,7 +693,7 @@ class Reports extends Secure_area function specific_customer_input() { - $data = $this->_get_common_report_data(); + $data = array(); $data['specific_input_name'] = $this->lang->line('reports_customer'); $customers = array(); @@ -734,11 +718,11 @@ class Reports extends Secure_area foreach($report_data['summary'] as $key=>$row) { - $summary_data[] = array(anchor('sales/receipt/'.$row['sale_id'], 'POS '.$row['sale_id'], array('target' => '_blank')), $row['sale_date'], $row['items_purchased'], $row['employee_name'], to_currency($row['subtotal']), to_currency($row['total']), to_currency($row['tax']), to_currency($row['cost']), to_currency($row['profit']), $row['payment_type'], $row['comment']); + $summary_data[] = array(anchor('sales/receipt/'.$row['sale_id'], 'POS '.$row['sale_id'], array('target' => '_blank')), $row['sale_date'], to_quantity_decimals($row['items_purchased']), $row['employee_name'], to_currency($row['subtotal']), to_currency($row['total']), to_currency($row['tax']), to_currency($row['cost']), to_currency($row['profit']), $row['payment_type'], $row['comment']); foreach($report_data['details'][$key] as $drow) { - $details_data[$key][] = array($drow['name'], $drow['category'], $drow['serialnumber'], $drow['description'], $drow['quantity_purchased'], to_currency($drow['subtotal']), to_currency($drow['total']), to_currency($drow['tax']), to_currency($drow['cost']), to_currency($drow['profit']), $drow['discount_percent'].'%'); + $details_data[$key][] = array($drow['name'], $drow['category'], $drow['serialnumber'], $drow['description'], to_quantity_decimals($drow['quantity_purchased']), to_currency($drow['subtotal']), to_currency($drow['total']), to_currency($drow['tax']), to_currency($drow['cost']), to_currency($drow['profit']), $drow['discount_percent'].'%'); } } @@ -759,7 +743,7 @@ class Reports extends Secure_area function specific_employee_input() { - $data = $this->_get_common_report_data(); + $data = array(); $data['specific_input_name'] = $this->lang->line('reports_employee'); $employees = array(); @@ -784,11 +768,11 @@ class Reports extends Secure_area foreach($report_data['summary'] as $key=>$row) { - $summary_data[] = array(anchor('sales/receipt/'.$row['sale_id'], 'POS '.$row['sale_id'], array('target' => '_blank')), $row['sale_date'], $row['items_purchased'], $row['customer_name'], to_currency($row['subtotal']), to_currency($row['total']), to_currency($row['tax']), to_currency($row['cost']), to_currency($row['profit']), $row['payment_type'], $row['comment']); + $summary_data[] = array(anchor('sales/receipt/'.$row['sale_id'], 'POS '.$row['sale_id'], array('target' => '_blank')), $row['sale_date'], to_quantity_decimals($row['items_purchased']), $row['customer_name'], to_currency($row['subtotal']), to_currency($row['total']), to_currency($row['tax']), to_currency($row['cost']), to_currency($row['profit']), $row['payment_type'], $row['comment']); foreach($report_data['details'][$key] as $drow) { - $details_data[$key][] = array($drow['name'], $drow['category'], $drow['serialnumber'], $drow['description'], $drow['quantity_purchased'], to_currency($drow['subtotal']), to_currency($drow['total']), to_currency($drow['tax']), to_currency($drow['cost']), to_currency($drow['profit']), $drow['discount_percent'].'%'); + $details_data[$key][] = array($drow['name'], $drow['category'], $drow['serialnumber'], $drow['description'], to_quantity_decimals($drow['quantity_purchased']), to_currency($drow['subtotal']), to_currency($drow['total']), to_currency($drow['tax']), to_currency($drow['cost']), to_currency($drow['profit']), $drow['discount_percent'].'%'); } } @@ -809,7 +793,7 @@ class Reports extends Secure_area function specific_discount_input() { - $data = $this->_get_common_report_data(); + $data = array(); $data['specific_input_name'] = $this->lang->line('reports_discount'); $discounts = array(); @@ -834,11 +818,11 @@ class Reports extends Secure_area foreach($report_data['summary'] as $key=>$row) { - $summary_data[] = array(anchor('sales/receipt/'.$row['sale_id'], 'POS '.$row['sale_id'], array('target' => '_blank')), $row['sale_date'], $row['items_purchased'], $row['customer_name'], to_currency($row['subtotal']), to_currency($row['total']), to_currency($row['tax']),/*to_currency($row['profit']),*/ $row['payment_type'], $row['comment']); + $summary_data[] = array(anchor('sales/receipt/'.$row['sale_id'], 'POS '.$row['sale_id'], array('target' => '_blank')), $row['sale_date'], to_quantity_decimals($row['items_purchased']), $row['customer_name'], to_currency($row['subtotal']), to_currency($row['total']), to_currency($row['tax']),/*to_currency($row['profit']),*/ $row['payment_type'], $row['comment']); foreach($report_data['details'][$key] as $drow) { - $details_data[$key][] = array($drow['name'], $drow['category'], $drow['serialnumber'], $drow['description'], $drow['quantity_purchased'], to_currency($drow['subtotal']), to_currency($drow['total']), to_currency($drow['tax']),/*to_currency($drow['profit']),*/ $drow['discount_percent'].'%'); + $details_data[$key][] = array($drow['name'], $drow['category'], $drow['serialnumber'], $drow['description'], to_quantity_decimals($drow['quantity_purchased']), to_currency($drow['subtotal']), to_currency($drow['total']), to_currency($drow['tax']),/*to_currency($drow['profit']),*/ $drow['discount_percent'].'%'); } } @@ -872,11 +856,11 @@ class Reports extends Secure_area foreach($report_data['summary'] as $key=>$row) { - $summary_data[] = array(anchor('sales/edit/'.$row['sale_id'] . '/width:'.FORM_WIDTH, 'POS '.$row['sale_id'], array('class' => 'thickbox')), $row['sale_date'], $row['items_purchased'], $row['employee_name'], $row['customer_name'], to_currency($row['subtotal']), to_currency($row['total']), to_currency($row['tax']), to_currency($row['cost']), to_currency($row['profit']), $row['payment_type'], $row['comment']); + $summary_data[] = array(anchor('sales/edit/'.$row['sale_id'], 'POS '.$row['sale_id'], array('class' => 'modal-dlg modal-btn-submit')), $row['sale_date'], to_quantity_decimals($row['items_purchased']), $row['employee_name'], $row['customer_name'], to_currency($row['subtotal']), to_currency($row['total']), to_currency($row['tax']), to_currency($row['cost']), to_currency($row['profit']), $row['payment_type'], $row['comment']); foreach($report_data['details'][$key] as $drow) { - $quantity_purchased = $drow['quantity_purchased']; + $quantity_purchased = to_quantity_decimals($drow['quantity_purchased']); if ($show_locations) { $quantity_purchased .= ' [' . $this->Stock_location->get_location_name($drow['item_location']) . ']'; @@ -915,11 +899,11 @@ class Reports extends Secure_area foreach($report_data['summary'] as $key=>$row) { - $summary_data[] = array(anchor('receivings/edit/'.$row['receiving_id'].'/width:'.FORM_WIDTH, 'RECV '.$row['receiving_id'], array('class' => 'thickbox')), $row['receiving_date'], $row['items_purchased'], $row['employee_name'], $row['supplier_name'], to_currency($row['total']), $row['payment_type'], $row['invoice_number'], $row['comment']); + $summary_data[] = array(anchor('receivings/edit/'.$row['receiving_id'], 'RECV '.$row['receiving_id'], array('class' => 'modal-dlg modal-btn-delete modal-btn-submit')), $row['receiving_date'], to_quantity_decimals($row['items_purchased']), $row['employee_name'], $row['supplier_name'], to_currency($row['total']), $row['payment_type'], $row['invoice_number'], $row['comment']); foreach($report_data['details'][$key] as $drow) { - $quantity_purchased = $drow['receiving_quantity'] > 1 ? $drow['quantity_purchased'] . ' x ' . $drow['receiving_quantity'] : $drow['quantity_purchased']; + $quantity_purchased = $drow['receiving_quantity'] > 1 ? to_quantity_decimals($drow['quantity_purchased']) . ' x ' . to_quantity_decimals($drow['receiving_quantity']) : to_quantity_decimals($drow['quantity_purchased']); if ($show_locations) { $quantity_purchased .= ' [' . $this->Stock_location->get_location_name($drow['item_location']) . ']'; diff --git a/application/controllers/Sales.php b/application/controllers/Sales.php index b53f09d0b..f3dfebf06 100644 --- a/application/controllers/Sales.php +++ b/application/controllers/Sales.php @@ -30,12 +30,13 @@ class Sales extends Secure_area $data['controller_name'] = $this->get_controller_name(); $lines_per_page = $this->Appconfig->get('lines_per_page'); - $today = date($this->config->item('dateformat')); - - $start_date = $this->input->post('start_date') != null ? $this->input->post('start_date') : $today; - $start_date_formatter = date_create_from_format($this->config->item('dateformat'), $start_date); - $end_date = $this->input->post('end_date') != null ? $this->input->post('end_date') : $today; - $end_date_formatter = date_create_from_format($this->config->item('dateformat'), $end_date); + $today_start = date($this->config->item('dateformat') . ' ' . $this->config->item('timeformat'), mktime(0, 0, 0)); + $today_end = date($this->config->item('dateformat') . ' ' . $this->config->item('timeformat'), mktime(23, 59, 59)); + + $start_date = $this->input->post('start_date') != null ? $this->input->post('start_date') : $today_start; + $start_date_formatter = date_create_from_format($this->config->item('dateformat') . ' ' . $this->config->item('timeformat'), $start_date); + $end_date = $this->input->post('end_date') != null ? $this->input->post('end_date') : $today_end; + $end_date_formatter = date_create_from_format($this->config->item('dateformat') . ' ' . $this->config->item('timeformat'), $end_date); $sale_type = 'all'; $location_id = 'all'; @@ -44,26 +45,29 @@ class Sales extends Secure_area $filters = array('sale_type' => $sale_type, 'location_id' => $location_id, - 'start_date' => $start_date_formatter->format('Y-m-d'), - 'end_date' => $end_date_formatter->format('Y-m-d'), - 'only_invoices' => $only_invoices, + 'start_date' => $start_date_formatter->format('Y-m-d H:i:s'), + 'end_date' => $end_date_formatter->format('Y-m-d H:i:s'), 'only_cash' => $only_cash, + 'only_invoices' => $only_invoices, 'is_valid_receipt' => $is_valid_receipt); $sales = $this->Sale->search($search, $filters, $lines_per_page, $limit_from)->result_array(); $payments = $this->Sale->get_payments_summary($search, $filters); $total_rows = $this->Sale->get_found_rows($search, $filters); - $data['only_invoices'] = $only_invoices; - $data['only_cash '] = $only_cash; - $data['start_date'] = $start_date_formatter->format($this->config->item('dateformat')); - $data['end_date'] = $end_date_formatter->format($this->config->item('dateformat')); + + // filters that will be loaded in the multiselect dropdown + $data['filters'] = array('only_cash' => $this->lang->line('sales_cash_filter'), + 'only_invoices' => $this->lang->line('sales_invoice_filter')); + $data['selected'] = array( ($only_cash ? 'only_cash' : ''), ($only_invoices ? 'only_invoices' : '') ); + + $data['start_date'] = $start_date; + $data['end_date'] = $end_date; $data['links'] = $this->_initialize_pagination($this->Sale, $lines_per_page, $limit_from, $total_rows, 'manage', $only_invoices); $data['manage_table'] = get_sales_manage_table($sales, $this); $data['payments_summary'] = get_sales_manage_payments_summary($payments, $sales, $this); $this->load->view($data['controller_name'] . '/manage', $data); } - } function get_row() @@ -77,16 +81,6 @@ class Sales extends Secure_area echo $data_row; } - /** - * - * Get the width for the add/edit form. - * @return number The form width - */ - function get_form_width() - { - return 400; - } - /* Returns Sales table data rows. This will be called with AJAX. */ @@ -98,12 +92,12 @@ class Sales extends Secure_area $limit_from = $this->input->post('limit_from'); $lines_per_page = $this->Appconfig->get('lines_per_page'); - $today = date($this->config->item('dateformat')); + $today = date($this->config->item('dateformat') . ' ' . $this->config->item('timeformat')); $start_date = $this->input->post('start_date') != null ? $this->input->post('start_date') : $today; - $start_date_formatter = date_create_from_format($this->config->item('dateformat'), $start_date); + $start_date_formatter = date_create_from_format($this->config->item('dateformat') . ' ' . $this->config->item('timeformat'), $start_date); $end_date = $this->input->post('end_date') != null ? $this->input->post('end_date') : $today; - $end_date_formatter = date_create_from_format($this->config->item('dateformat'), $end_date); + $end_date_formatter = date_create_from_format($this->config->item('dateformat') . ' ' . $this->config->item('timeformat'), $end_date); $is_valid_receipt = isset($search) ? $this->sale_lib->is_valid_receipt($search) : FALSE; @@ -114,11 +108,20 @@ class Sales extends Secure_area $filters = array('sale_type' => $sale_type, 'location_id' => $location_id, - 'start_date' => $start_date_formatter->format('Y-m-d'), - 'end_date' => $end_date_formatter->format('Y-m-d'), - 'only_invoices' => $only_invoices, - 'only_cash' => $only_cash, + 'start_date' => $start_date_formatter->format('Y-m-d H:i:s'), + 'end_date' => $end_date_formatter->format('Y-m-d H:i:s'), + 'only_cash' => FALSE, + 'only_invoices' => FALSE, 'is_valid_receipt' => $is_valid_receipt); + + // check if any filter is set in the multiselect dropdown + if( $this->input->post('filters') != null ) + { + foreach($this->input->post('filters') as $key) + { + $filters[$key] = TRUE; + } + } $sales = $this->Sale->search($search, $filters, $lines_per_page, $limit_from)->result_array(); $payments = $this->Sale->get_payments_summary($search, $filters); @@ -133,36 +136,25 @@ class Sales extends Secure_area function item_search() { $suggestions = array(); - $search = $this->input->post('q'); - $limit = $this->input->post('limit'); + $search = $this->input->get('term') != '' ? $this->input->get('term') : null; if ($this->sale_lib->get_mode() == 'return' && $this->sale_lib->is_valid_receipt($search) ) { $suggestions[] = $search; } - $suggestions = array_merge($suggestions, $this->Item->get_item_search_suggestions($search , $limit)); - $suggestions = array_merge($suggestions, $this->Item_kit->get_item_kit_search_suggestions($search, $limit)); + $suggestions = array_merge($suggestions, $this->Item->get_search_suggestions($search)); + $suggestions = array_merge($suggestions, $this->Item_kit->get_search_suggestions($search)); - echo implode("\n", $suggestions); + echo json_encode($suggestions); } - function customer_search() + function suggest_search() { - $search = $this->input->post('q'); - $limit = $this->input->post('limit'); + $search = $this->input->post('term') != '' ? $this->input->post('term') : null; - $suggestions = $this->Customer->get_customer_search_suggestions($search, $limit); - - echo implode("\n", $suggestions); - } - - function suggest() - { - $search = $this->input->post('q'); - $limit = $this->input->post('limit'); - $suggestions = $this->Sale->get_search_suggestions($search, $limit); - - echo implode("\n", $suggestions); + $suggestions = $this->Sale->get_search_suggestions($search); + + echo json_encode($suggestions); } function select_customer() @@ -187,6 +179,7 @@ class Sales extends Secure_area { $this->sale_lib->set_sale_location($stock_location); } + $this->_reload(); } @@ -255,7 +248,7 @@ class Sales extends Secure_area $new_giftcard_value = ( $new_giftcard_value >= 0 ) ? $new_giftcard_value : 0; $this->sale_lib->set_giftcard_remainder($new_giftcard_value); $data['warning'] = $this->lang->line('giftcards_remaining_balance', $this->input->post('amount_tendered'), to_currency( $new_giftcard_value, TRUE )); - $payment_amount = min( $this->sale_lib->get_amount_due( ), $this->Giftcard->get_giftcard_value( $this->input->post('amount_tendered') ) ); + $payment_amount = min( $this->sale_lib->get_amount_due(), $this->Giftcard->get_giftcard_value( $this->input->post('amount_tendered') ) ); } else { @@ -274,12 +267,14 @@ class Sales extends Secure_area function delete_payment( $payment_id ) { $this->sale_lib->delete_payment( $payment_id ); + $this->_reload(); } function add() { $data = array(); + $mode = $this->sale_lib->get_mode(); $item_id_or_number_or_item_kit_or_receipt = $this->input->post('item'); $quantity = ($mode == "return") ? -1 : 1; @@ -334,6 +329,7 @@ class Sales extends Secure_area function delete_item($item_number) { $this->sale_lib->delete_item($item_number); + $this->_reload(); } @@ -342,6 +338,7 @@ class Sales extends Secure_area $this->sale_lib->clear_giftcard_remainder(); $this->sale_lib->clear_invoice_number(); $this->sale_lib->remove_customer(); + $this->_reload(); } @@ -452,7 +449,6 @@ class Sales extends Secure_area $this->sale_lib->clear_all(); } - } private function _invoice_email_pdf($data) @@ -554,6 +550,7 @@ class Sales extends Secure_area $invoice_number = $this->config->config['sales_invoice_format']; $invoice_number = $this->_substitute_variables($invoice_number, $cust_info); $this->sale_lib->set_invoice_number($invoice_number, TRUE); + return $this->sale_lib->get_invoice_number(); } @@ -607,7 +604,7 @@ class Sales extends Secure_area $data['account_number'] )); } - $data['sale_id'] = 'POS '.$sale_id; + $data['sale_id'] = 'POS ' . $sale_id; $data['comments'] = $sale_info['comment']; $data['invoice_number'] = $sale_info['invoice_number']; $data['company_info'] = implode("\n", array( @@ -630,10 +627,12 @@ class Sales extends Secure_area function invoice($sale_id, $sale_info='') { - if ($sale_info == '') { + if ($sale_info == '') + { $sale_info = $this->_load_sale_data($sale_id); } - $this->load->view("sales/invoice",$sale_info); + + $this->load->view("sales/invoice", $sale_info); $this->sale_lib->clear_all(); } @@ -650,7 +649,8 @@ class Sales extends Secure_area $sale_info = $this->Sale->get_info($sale_id)->row_array(); $person_name = $sale_info['first_name'] . " " . $sale_info['last_name']; - $data['selected_customer'] = !empty($sale_info['customer_id']) ? $sale_info['customer_id'] . "|" . $person_name : ""; + $data['selected_customer_name'] = !empty($sale_info['customer_id']) ? $person_name : ''; + $data['selected_customer_id'] = $sale_info['customer_id']; $data['sale_info'] = $sale_info; $this->load->view('sales/form', $data); @@ -674,7 +674,9 @@ class Sales extends Secure_area function save($sale_id) { - $start_date_formatter = date_create_from_format($this->config->item('dateformat') . ' ' . $this->config->item('timeformat'), $this->input->post('date')); + $newdate = $this->input->post('date'); + + $start_date_formatter = date_create_from_format($this->config->item('dateformat') . ' ' . $this->config->item('timeformat'), $newdate); $sale_data = array( 'sale_time' => $start_date_formatter->format('Y-m-d H:i:s'), @@ -696,16 +698,16 @@ class Sales extends Secure_area private function _payments_cover_total() { - $total_payments = 0; - - foreach($this->sale_lib->get_payments() as $payment) + // Changed the conditional to account for floating point rounding + + // "sale" amount due needs to be <=0 to state it's fine + if( ($this->sale_lib->get_mode() == 'sale') && $this->sale_lib->get_amount_due() > 1e-6 ) { - $total_payments += $payment['payment_amount']; + return false; } - /* Changed the conditional to account for floating point rounding */ - if ( ($this->sale_lib->get_mode() == 'sale') && - ( ( to_currency_no_money( $this->sale_lib->get_total() ) - $total_payments ) > 1e-6 ) ) + // "return" amount due needs to be >=0 to state it's fine + if( ($this->sale_lib->get_mode() == 'return') && $this->sale_lib->get_amount_due() < -(1e-6) ) { return false; } @@ -735,11 +737,11 @@ class Sales extends Secure_area $data['amount_due'] = $this->sale_lib->get_amount_due(); $data['payments'] = $this->sale_lib->get_payments(); $data['payment_options'] = array( - $this->lang->line('sales_cash') => $this->lang->line('sales_cash'), - $this->lang->line('sales_check') => $this->lang->line('sales_check'), - $this->lang->line('sales_giftcard') => $this->lang->line('sales_giftcard'), $this->lang->line('sales_debit') => $this->lang->line('sales_debit'), - $this->lang->line('sales_credit') => $this->lang->line('sales_credit') + $this->lang->line('sales_credit') => $this->lang->line('sales_credit'), + $this->lang->line('sales_cash') => $this->lang->line('sales_cash'), + $this->lang->line('sales_giftcard') => $this->lang->line('sales_giftcard'), + $this->lang->line('sales_check') => $this->lang->line('sales_check') ); $customer_id = $this->sale_lib->get_customer(); @@ -747,21 +749,47 @@ class Sales extends Secure_area if($customer_id != -1) { $cust_info = $this->Customer->get_info($customer_id); - $data['customer'] = $cust_info->first_name . ' ' . $cust_info->last_name; + if (isset($cust_info->company_name)) + { + $data['customer'] = $cust_info->company_name; + } + else + { + $data['customer'] = $cust_info->first_name . ' ' . $cust_info->last_name; + } + $data['first_name'] = $cust_info->first_name; + $data['last_name'] = $cust_info->last_name; + $data['customer_address'] = $cust_info->address_1; + if (!empty($cust_info->zip) or !empty($cust_info->city)) + { + $data['customer_location'] = $cust_info->zip . ' ' . $cust_info->city; + } + else + { + $data['customer_location'] = ''; + } $data['customer_email'] = $cust_info->email; + $data['account_number'] = $cust_info->account_number; + $data['customer_info'] = implode("\n", array( + $data['customer'], + $data['customer_address'], + $data['customer_location'], + $data['account_number'] + )); } + $data['invoice_number'] = $this->_substitute_invoice_number($cust_info); $data['invoice_number_enabled'] = $this->sale_lib->is_invoice_number_enabled(); $data['print_after_sale'] = $this->sale_lib->is_print_after_sale(); $data['payments_cover_total'] = $this->_payments_cover_total(); $this->load->view("sales/register", $data); - } - function cancel_sale() + function cancel() { $this->sale_lib->clear_all(); + $this->_reload(); } @@ -825,6 +853,7 @@ class Sales extends Secure_area { $data = array(); $data['suspended_sales'] = $this->Sale_suspended->get_all()->result_array(); + $this->load->view('sales/suspended', $data); } @@ -834,6 +863,7 @@ class Sales extends Secure_area $this->sale_lib->clear_all(); $this->sale_lib->copy_entire_suspended_sale($sale_id); $this->Sale_suspended->delete($sale_id); + $this->_reload(); } diff --git a/application/controllers/Suppliers.php b/application/controllers/Suppliers.php index 7be159a62..58d3c492d 100644 --- a/application/controllers/Suppliers.php +++ b/application/controllers/Suppliers.php @@ -11,7 +11,6 @@ class Suppliers extends Person_controller function index($limit_from=0) { $data['controller_name'] = $this->get_controller_name(); - $data['form_width'] = $this->get_form_width(); $lines_per_page = $this->Appconfig->get('lines_per_page'); $suppliers = $this->Supplier->get_all($lines_per_page); @@ -42,8 +41,14 @@ class Suppliers extends Person_controller */ function suggest() { - $suggestions = $this->Supplier->get_search_suggestions($this->input->post('q'),$this->input->post('limit')); - echo implode("\n",$suggestions); + $suggestions = $this->Supplier->get_search_suggestions($this->input->get('term'), TRUE); + echo json_encode($suggestions); + } + + function suggest_search() + { + $suggestions = $this->Supplier->get_search_suggestions($this->input->post('term'), FALSE); + echo json_encode($suggestions); } /* @@ -127,13 +132,5 @@ class Suppliers extends Person_controller $data_row=get_supplier_data_row($this->Supplier->get_info($person_id),$this); echo $data_row; } - - /* - get the width for the add/edit form - */ - function get_form_width() - { - return 360; - } } ?> \ No newline at end of file diff --git a/application/controllers/interfaces/Idata_controller.php b/application/controllers/interfaces/Idata_controller.php index e05d493d0..8721e6ed4 100644 --- a/application/controllers/interfaces/Idata_controller.php +++ b/application/controllers/interfaces/Idata_controller.php @@ -7,11 +7,10 @@ interface iData_controller { public function index(); public function search(); - public function suggest(); + public function suggest_search(); public function get_row(); public function view($data_item_id=-1); public function save($data_item_id=-1); public function delete(); - public function get_form_width(); } ?> \ No newline at end of file diff --git a/application/core/MY_Loader.php b/application/core/MY_Loader.php new file mode 100644 index 000000000..5fbf21da4 --- /dev/null +++ b/application/core/MY_Loader.php @@ -0,0 +1,25 @@ +_ci_view_paths = array_merge(array('templates/'.$config['theme_name'].'/views'.DIRECTORY_SEPARATOR => 1), $this->_ci_view_paths); + } + + return $this->_ci_load(array('_ci_view' => $view, '_ci_vars' => $this->_ci_object_to_array($vars), '_ci_return' => $return)); + } + +} \ No newline at end of file diff --git a/application/helpers/currency_helper.php b/application/helpers/currency_helper.php deleted file mode 100644 index 6ecdeae12..000000000 --- a/application/helpers/currency_helper.php +++ /dev/null @@ -1,29 +0,0 @@ -config->item('currency_symbol') ? $CI->config->item('currency_symbol') : '$'; - $currency_symbol = $currency_symbol == '$' && $escape ? '\$' : $currency_symbol; - $thousands_separator = $CI->config->item('thousands_separator') ? $CI->config->item('thousands_separator') : ''; - $decimal_point = $CI->config->item('decimal_point') ? $CI->config->item('decimal_point') : '.'; - if($number >= 0) - { - if($CI->config->item('currency_side') !== 'currency_side') - return $currency_symbol.number_format($number, 2, $decimal_point, $thousands_separator); - else - return number_format($number, 2, $decimal_point, $thousands_separator).$currency_symbol; - } - else - { - if($CI->config->item('currency_side') !== 'currency_side') - return '-'.$currency_symbol.number_format(abs($number), 2, $decimal_point, $thousands_separator); - else - return '-'.number_format(abs($number), 2, $decimal_point, $thousands_separator).$currency_symbol; - } -} - -function to_currency_no_money($number) -{ - return number_format($number, 2, '.', ''); -} -?> diff --git a/application/helpers/dateformat_helper.php b/application/helpers/dateformat_helper.php deleted file mode 100644 index b403cb4c0..000000000 --- a/application/helpers/dateformat_helper.php +++ /dev/null @@ -1,69 +0,0 @@ - 'dd', - 'D' => 'D', - 'j' => 'd', - 'l' => 'DD', - 'N' => '', - 'S' => '', - 'w' => '', - 'z' => 'o', - // Week - 'W' => '', - // Month - 'F' => 'MM', - 'm' => 'mm', - 'M' => 'M', - 'n' => 'm', - 't' => '', - // Year - 'L' => '', - 'o' => '', - 'Y' => 'yy', - 'y' => 'y', - // Time - 'a' => 'tt', - 'A' => 'TT', - 'B' => '', - 'g' => 'h', - 'G' => 'H', - 'h' => 'hh', - 'H' => 'HH', - 'i' => 'mm', - 's' => 'ss', - 'u' => '' - ); - $jqueryui_format = ""; - $escaping = false; - for($i = 0; $i < strlen($php_format); $i++) - { - $char = $php_format[$i]; - if($char === '\\') // PHP date format escaping character - { - $i++; - if($escaping) $jqueryui_format .= $php_format[$i]; - else $jqueryui_format .= '\'' . $php_format[$i]; - $escaping = true; - } - else - { - if($escaping) { $jqueryui_format .= "'"; $escaping = false; } - if(isset($SYMBOLS_MATCHING[$char])) - $jqueryui_format .= $SYMBOLS_MATCHING[$char]; - else - $jqueryui_format .= $char; - } - } - return $jqueryui_format; -} - -?> \ No newline at end of file diff --git a/application/helpers/locale_helper.php b/application/helpers/locale_helper.php new file mode 100644 index 000000000..c13044b73 --- /dev/null +++ b/application/helpers/locale_helper.php @@ -0,0 +1,294 @@ +config->item('currency_symbol') ? $CI->config->item('currency_symbol') : '$'; + $currency_symbol = $currency_symbol == '$' && $escape ? '\$' : $currency_symbol; + $thousands_separator = $CI->config->item('thousands_separator') ? $CI->config->item('thousands_separator') : ''; + $decimal_point = $CI->config->item('decimal_point') ? $CI->config->item('decimal_point') : '.'; + $decimals = $CI->config->item('currency_decimals') ? $CI->config->item('currency_decimals') : 0; + + // in case of taxation with 3 decimals, force the currency decimal to be 3 and not max 2 as per db table (this is only used at UI level) + if( $CI->config->item('tax_decimals') > $CI->config->item('currency_decimals') ) + { + $decimals = $CI->config->item('tax_decimals'); + } + + if($number >= 0) + { + if($CI->config->item('currency_side') !== 'currency_side') + return $currency_symbol.number_format($number, $decimals, $decimal_point, $thousands_separator); + else + return number_format($number, $decimals, $decimal_point, $thousands_separator).$currency_symbol; + } + else + { + if($CI->config->item('currency_side') !== 'currency_side') + return '-'.$currency_symbol.number_format(abs($number), $decimals, $decimal_point, $thousands_separator); + else + return '-'.number_format(abs($number), $decimals, $decimal_point, $thousands_separator).$currency_symbol; + } +} + +function to_currency_no_money($number) +{ + // ignore empty strings as they are just for empty input + if( empty($number) ) + { + return $number; + } + + $CI =& get_instance(); + + $decimals = $CI->config->item('currency_decimals') ? $CI->config->item('currency_decimals') : 0; + + // in case of taxation with 3 decimals, force the currency decimal to be 3 and not max 2 as per db table (this is only used at UI level) + if( $CI->config->item('tax_decimals') > $CI->config->item('currency_decimals') ) + { + $decimals = $CI->config->item('tax_decimals'); + } + + return number_format($number, $decimals, '.', ''); +} + +function totals_decimals() +{ + $CI =& get_instance(); + + $decimals = $CI->config->item('currency_decimals') ? $CI->config->item('currency_decimals') : 0; + + // in case of taxation with 3 decimals, force the tatals decimal to be 3 so roundings are correct + if( $CI->config->item('tax_decimals') > $CI->config->item('currency_decimals') ) + { + $decimals = $CI->config->item('tax_decimals'); + } + + return $decimals; +} + + +/* + * Tax locale + */ + +function to_tax_decimals($number) +{ + // ignore empty strings as they are just for empty input + if( empty($number) ) + { + return $number; + } + + $CI =& get_instance(); + + $decimal_point = $CI->config->item('decimal_point') ? $CI->config->item('decimal_point') : '.'; + $decimals = $CI->config->item('tax_decimals') ? $CI->config->item('tax_decimals') : 0; + + return number_format($number, $decimals, $decimal_point, ''); +} + + +/* + * Quantity decimals + */ + +function to_quantity_decimals($number) +{ + $CI =& get_instance(); + + $decimal_point = $CI->config->item('decimal_point') ? $CI->config->item('decimal_point') : '.'; + $decimals = $CI->config->item('quantity_decimals') ? $CI->config->item('quantity_decimals') : 0; + + return number_format($number, $decimals, $decimal_point, ''); +} + +function quantity_decimals() +{ + $CI =& get_instance(); + + return $CI->config->item('quantity_decimals') ? $CI->config->item('quantity_decimals') : 0; +} + + +/* + * Matches each symbol of PHP date format standard + * with jQuery equivalent codeword + * @author Tristan Jahier + */ +function dateformat_jquery($php_format) +{ + $SYMBOLS_MATCHING = array( + // Day + 'd' => 'dd', + 'D' => 'D', + 'j' => 'd', + 'l' => 'DD', + 'N' => '', + 'S' => '', + 'w' => '', + 'z' => 'o', + // Week + 'W' => '', + // Month + 'F' => 'MM', + 'm' => 'mm', + 'M' => 'M', + 'n' => 'm', + 't' => '', + // Year + 'L' => '', + 'o' => '', + 'Y' => 'yy', + 'y' => 'y', + // Time + 'a' => 'tt', + 'A' => 'TT', + 'B' => '', + 'g' => 'h', + 'G' => 'H', + 'h' => 'hh', + 'H' => 'HH', + 'i' => 'mm', + 's' => 'ss', + 'u' => '' + ); + + $jqueryui_format = ""; + $escaping = false; + for($i = 0; $i < strlen($php_format); $i++) + { + $char = $php_format[$i]; + if($char === '\\') // PHP date format escaping character + { + $i++; + if($escaping) $jqueryui_format .= $php_format[$i]; + else $jqueryui_format .= '\'' . $php_format[$i]; + $escaping = true; + } + else + { + if($escaping) { $jqueryui_format .= "'"; $escaping = false; } + if(isset($SYMBOLS_MATCHING[$char])) + $jqueryui_format .= $SYMBOLS_MATCHING[$char]; + else + $jqueryui_format .= $char; + } + } + return $jqueryui_format; +} + +function dateformat_momentjs($php_format) +{ + $SYMBOLS_MATCHING = array( + 'd' => 'DD', + 'D' => 'ddd', + 'j' => 'D', + 'l' => 'dddd', + 'N' => 'E', + 'S' => 'o', + 'w' => 'e', + 'z' => 'DDD', + 'W' => 'W', + 'F' => 'MMMM', + 'm' => 'MM', + 'M' => 'MMM', + 'n' => 'M', + 't' => '', // no equivalent + 'L' => '', // no equivalent + 'o' => 'YYYY', + 'Y' => 'YYYY', + 'y' => 'YY', + 'a' => 'a', + 'A' => 'A', + 'B' => '', // no equivalent + 'g' => 'h', + 'G' => 'H', + 'h' => 'hh', + 'H' => 'HH', + 'i' => 'mm', + 's' => 'ss', + 'u' => 'SSS', + 'e' => 'zz', // deprecated since version $1.6.0 of moment.js + 'I' => '', // no equivalent + 'O' => '', // no equivalent + 'P' => '', // no equivalent + 'T' => '', // no equivalent + 'Z' => '', // no equivalent + 'c' => '', // no equivalent + 'r' => '', // no equivalent + 'U' => 'X' + ); + + return strtr($php_format, $SYMBOLS_MATCHING); +} + +function dateformat_bootstrap($php_format) +{ + $SYMBOLS_MATCHING = array( + // Day + 'd' => 'dd', + 'D' => 'd', + 'j' => 'd', + 'l' => 'dd', + 'N' => '', + 'S' => '', + 'w' => '', + 'z' => '', + // Week + 'W' => '', + // Month + 'F' => 'MM', + 'm' => 'mm', + 'M' => 'M', + 'n' => 'm', + 't' => '', + // Year + 'L' => '', + 'o' => '', + 'Y' => 'yyyy', + 'y' => 'yy', + // Time + 'a' => 'p', + 'A' => 'P', + 'B' => '', + 'g' => 'H', + 'G' => 'h', + 'h' => 'HH', + 'H' => 'hh', + 'i' => 'ii', + 's' => 'ss', + 'u' => '' + ); + + $bootstrap_format = ""; + $escaping = false; + for($i = 0; $i < strlen($php_format); $i++) + { + $char = $php_format[$i]; + if($char === '\\') // PHP date format escaping character + { + $i++; + if($escaping) $bootstrap_format .= $php_format[$i]; + else $bootstrap_format .= '\'' . $php_format[$i]; + $escaping = true; + } + else + { + if($escaping) { $bootstrap_format .= "'"; $escaping = false; } + if(isset($SYMBOLS_MATCHING[$char])) + $bootstrap_format .= $SYMBOLS_MATCHING[$char]; + else + $bootstrap_format .= $char; + } + } + + return $bootstrap_format; +} + +?> diff --git a/application/helpers/report_helper.php b/application/helpers/report_helper.php index dc6ecf872..1136d553e 100644 --- a/application/helpers/report_helper.php +++ b/application/helpers/report_helper.php @@ -1,78 +1,4 @@ load->language('reports'); - - $today = date('Y-m-d'); - $today_last_year = date('Y-m-d', mktime(0,0,0,date("m"),date("d"),date("Y")-1)); - $yesterday = date('Y-m-d', mktime(0,0,0,date("m"),date("d")-1,date("Y"))); - $six_days_ago = date('Y-m-d', mktime(0,0,0,date("m"),date("d")-6,date("Y"))); - $start_of_this_month = date('Y-m-d', mktime(0,0,0,date("m"),1,date("Y"))); - $end_of_this_month = date('Y-m-d',strtotime('-1 second',strtotime('+1 month',strtotime(date('m').'/01/'.date('Y').' 00:00:00')))); - $start_of_this_month_last_year = date('Y-m-d', mktime(0,0,0,date("m"),1,date("Y")-1)); - $end_of_this_month_last_year = date('Y-m-d',strtotime('-1 second',strtotime('+1 month',strtotime(date('m').'/01/'.(date('Y')-1).' 00:00:00')))); - $start_of_last_month = date('Y-m-d', mktime(0,0,0,date("m")-1,1,date("Y"))); - $end_of_last_month = date('Y-m-d',strtotime('-1 second',strtotime('+1 month',strtotime((date('m') - 1).'/01/'.date('Y').' 00:00:00')))); - $start_of_this_year = date('Y-m-d', mktime(0,0,0,1,1,date("Y"))); - $end_of_this_year = date('Y-m-d', mktime(0,0,0,12,31,date("Y"))); - $start_of_last_year = date('Y-m-d', mktime(0,0,0,1,1,date("Y")-1)); - $end_of_last_year = date('Y-m-d', mktime(0,0,0,12,31,date("Y")-1)); - $start_of_time = date('Y-m-d', 0); - - return array( - $today . '/' . $today => $CI->lang->line('reports_today'), - $today_last_year . '/' . $today_last_year => $CI->lang->line('reports_today_last_year'), - $yesterday . '/' . $yesterday => $CI->lang->line('reports_yesterday'), - $six_days_ago . '/' . $today => $CI->lang->line('reports_last_7'), - $start_of_this_month . '/' . $today => $CI->lang->line('reports_this_month_to_today'), - $start_of_this_month . '/' . $end_of_this_month => $CI->lang->line('reports_this_month'), - $start_of_this_month_last_year . '/' . $today_last_year => $CI->lang->line('reports_this_month_to_today_last_year'), - $start_of_this_month_last_year . '/' . $end_of_this_month_last_year => $CI->lang->line('reports_this_month_last_year'), - $start_of_last_month . '/' . $end_of_last_month => $CI->lang->line('reports_last_month'), - $start_of_this_year . '/' . $end_of_this_year => $CI->lang->line('reports_this_year'), - $start_of_last_year . '/' . $end_of_last_year => $CI->lang->line('reports_last_year'), - $start_of_time . '/' . $today => $CI->lang->line('reports_all_time') - ); -} - -function get_months() -{ - $months = array(); - - for($k=1;$k<=12;$k++) - { - $cur_month = mktime(0, 0, 0, $k, 1, 2000); - $months[date("m", $cur_month)] = date("M",$cur_month); - } - - return $months; -} - -function get_days() -{ - $days = array(); - - for($k=1;$k<=31;$k++) - { - $cur_day = mktime(0, 0, 0, 1, $k, 2000); - $days[date('d',$cur_day)] = date('j',$cur_day); - } - - return $days; -} - -function get_years() -{ - $years = array(); - - for($k=0;$k<10;$k++) - { - $years[date("Y")-$k] = date("Y")-$k; - } - - return $years; -} function get_random_colors($how_many) { @@ -120,4 +46,6 @@ function show_report($report_prefix, $report_name, $lang_key='')
  • \ No newline at end of file diff --git a/application/helpers/table_helper.php b/application/helpers/table_helper.php index 23b128211..5f74365ca 100644 --- a/application/helpers/table_helper.php +++ b/application/helpers/table_helper.php @@ -3,7 +3,7 @@ function get_sales_manage_table($sales, $controller) { $CI =& get_instance(); - $table=''; + $table='
    '; $headers = array(' ', $CI->lang->line('sales_receipt_number'), @@ -14,6 +14,8 @@ function get_sales_manage_table($sales, $controller) $CI->lang->line('sales_change_due'), $CI->lang->line('sales_payment'), $CI->lang->line('sales_invoice_number'), + ' ', + ' ', ' '); $table.=''; @@ -50,11 +52,11 @@ function get_sales_manage_table_data_rows($sales, $controller) if($table_data_rows == '') { - $table_data_rows .= ""; + $table_data_rows .= ""; } else { - $table_data_rows .= ""; + $table_data_rows .= ""; } return $table_data_rows; @@ -64,7 +66,6 @@ function get_sales_manage_sale_data_row($sale, $controller) { $CI =& get_instance(); $controller_name = $CI->uri->segment(1); - $width = $controller->get_form_width(); $table_data_row=''; $table_data_row.=''; @@ -76,13 +77,9 @@ function get_sales_manage_sale_data_row($sale, $controller) $table_data_row.=''; $table_data_row.=''; $table_data_row.=''; - $table_data_row.=''; + $table_data_row.=''; + $table_data_row.=''; + $table_data_row.=''; $table_data_row.=''; return $table_data_row; @@ -121,7 +118,7 @@ Gets the html table to manage people. function get_people_manage_table($people,$controller) { $CI =& get_instance(); - $table='
    ".$CI->lang->line('sales_no_sales_to_display')."
    ".$CI->lang->line('sales_no_sales_to_display')."
     ".$CI->lang->line('sales_total')."  ".to_currency($sum_amount_tendered)."".to_currency($sum_amount_due)."".to_currency($sum_change_due)."
     ".$CI->lang->line('sales_total')."  ".to_currency($sum_amount_tendered)."".to_currency($sum_amount_due)."".to_currency($sum_change_due)."
    '.to_currency( $sale['change_due'] ).''.$sale['payment_type'].''.$sale['invoice_number'].'
    '; + $table='
    '; $headers = array('', $CI->lang->line('common_last_name'), @@ -157,7 +154,7 @@ function get_people_manage_table_data_rows($people,$controller) if($people->num_rows()==0) { - $table_data_rows.=""; + $table_data_rows.=""; } return $table_data_rows; @@ -167,15 +164,14 @@ function get_person_data_row($person,$controller) { $CI =& get_instance(); $controller_name=strtolower(get_class($CI)); - $width = $controller->get_form_width(); $table_data_row=''; $table_data_row.=""; $table_data_row.=''; $table_data_row.=''; $table_data_row.=''; - $table_data_row.=''; - $table_data_row.=''; + $table_data_row.=''; + $table_data_row.=''; $table_data_row.=''; return $table_data_row; @@ -202,7 +198,7 @@ Gets the html table to manage suppliers. function get_supplier_manage_table($suppliers,$controller) { $CI =& get_instance(); - $table='
    ".$CI->lang->line('common_no_persons_to_display')."
    ".$CI->lang->line('common_no_persons_to_display')."
    '.character_limiter($person->last_name,13).''.character_limiter($person->first_name,13).''.mailto($person->email,character_limiter($person->email,22)).''.character_limiter($person->phone_number,13).''.anchor($controller_name."/view/$person->person_id/width:$width", $CI->lang->line('common_edit'),array('class'=>'thickbox','title'=>$CI->lang->line($controller_name.'_update'))).''.character_limiter($person->phone_number,13).''.anchor($controller_name."/view/$person->person_id", '', array('class'=>"modal-dlg modal-btn-submit", 'title'=>$CI->lang->line($controller_name.'_update'))).'
    '; + $table='
    '; $headers = array('', $CI->lang->line('suppliers_company_name'), @@ -241,7 +237,7 @@ function get_supplier_manage_table_data_rows($suppliers,$controller) if($suppliers->num_rows()==0) { - $table_data_rows.=""; + $table_data_rows.=""; } return $table_data_rows; @@ -251,18 +247,17 @@ function get_supplier_data_row($supplier,$controller) { $CI =& get_instance(); $controller_name=strtolower(get_class($CI)); - $width = $controller->get_form_width(); $table_data_row=''; - $table_data_row.=""; - $table_data_row.=''; - $table_data_row.=''; - $table_data_row.=''; - $table_data_row.=''; - $table_data_row.=''; - $table_data_row.=''; + $table_data_row.=""; + $table_data_row.=''; + $table_data_row.=''; + $table_data_row.=''; + $table_data_row.=''; + $table_data_row.=''; + $table_data_row.=''; $table_data_row.=''; - $table_data_row.=''; + $table_data_row.=''; $table_data_row.=''; return $table_data_row; @@ -274,7 +269,7 @@ Gets the html table to manage items. function get_items_manage_table($items,$controller) { $CI =& get_instance(); - $table='
    ".$CI->lang->line('common_no_persons_to_display')."
    ".$CI->lang->line('common_no_persons_to_display')."
    '.character_limiter($supplier->company_name,13).''.character_limiter($supplier->agency_name,13).''.character_limiter($supplier->last_name,13).''.character_limiter($supplier->first_name,13).''.mailto($supplier->email,character_limiter($supplier->email,22)).''.character_limiter($supplier->phone_number,13).''.character_limiter($supplier->company_name,13).''.character_limiter($supplier->agency_name,13).''.character_limiter($supplier->last_name,13).''.character_limiter($supplier->first_name,13).''.mailto($supplier->email,character_limiter($supplier->email,22)).''.character_limiter($supplier->phone_number,13).''.character_limiter($supplier->person_id,5).''.anchor($controller_name."/view/$supplier->person_id/width:$width", $CI->lang->line('common_edit'),array('class'=>'thickbox','title'=>$CI->lang->line($controller_name.'_update'))).''.anchor($controller_name."/view/$supplier->person_id", '', array('class'=>"modal-dlg modal-btn-submit",'title'=>$CI->lang->line($controller_name.'_update'))).'
    '; + $table='
    '; $headers = array('', $CI->lang->line('items_item_number'), @@ -285,6 +280,7 @@ function get_items_manage_table($items,$controller) $CI->lang->line('items_unit_price'), $CI->lang->line('items_quantity'), $CI->lang->line('items_tax_percents'), + $CI->lang->line('items_image'), ' ', ' ', ' ' @@ -317,7 +313,7 @@ function get_items_manage_table_data_rows($items,$controller) if($items->num_rows()==0) { - $table_data_rows.=""; + $table_data_rows.=""; } return $table_data_rows; @@ -330,39 +326,37 @@ function get_item_data_row($item,$controller) $tax_percents = ''; foreach($item_tax_info as $tax_info) { - $tax_percents.=$tax_info['percent']. '%, '; + $tax_percents.=to_tax_decimals($tax_info['percent']) . '%, '; } + // remove ', ' from last item $tax_percents=substr($tax_percents, 0, -2); $controller_name=strtolower(get_class($CI)); - $width = $controller->get_form_width(); $item_quantity=''; $table_data_row=''; - $table_data_row.=""; - $table_data_row.=''; - $table_data_row.=''; - $table_data_row.=''; - $table_data_row.=''; - $table_data_row.=''; - $table_data_row.=''; - $table_data_row.=''; - $table_data_row.=''; + $table_data_row.=""; + $table_data_row.=''; + $table_data_row.=''; + $table_data_row.=''; + $table_data_row.=''; + $table_data_row.=''; + $table_data_row.=''; + $table_data_row.=''; + $table_data_row.=''; $image = ''; if (!empty($item->pic_id)) { - $images = glob ("uploads/item_pics/" . $item->pic_id . ".*"); + $images = glob("uploads/item_pics/" . $item->pic_id . ".*"); if (sizeof($images) > 0) { $image.=''; } } - $table_data_row.=''; - $table_data_row.=''; - - $table_data_row.='';//inventory count - $table_data_row.='';//inventory details - + $table_data_row.=''; + $table_data_row.=''; + $table_data_row.='';//inventory count + $table_data_row.='';//inventory details $table_data_row.=''; return $table_data_row; @@ -374,15 +368,14 @@ Gets the html table to manage giftcards. function get_giftcards_manage_table( $giftcards, $controller ) { $CI =& get_instance(); - $table='
    ".$CI->lang->line('items_no_items_to_display')."
    ".$CI->lang->line('items_no_items_to_display')."
    '.$item->item_number.''.$item->name.''.$item->category.''.$item->company_name.''.to_currency($item->cost_price).''.to_currency($item->unit_price).''.$item->quantity.''.$tax_percents.''.$item->item_number.''.$item->name.''.$item->category.''.$item->company_name.''.to_currency($item->cost_price).''.to_currency($item->unit_price).''.to_quantity_decimals($item->quantity).''.$tax_percents.'' . $image . ''.anchor($controller_name."/view/$item->item_id/width:$width", $CI->lang->line('common_edit'),array('class'=>'thickbox','title'=>$CI->lang->line($controller_name.'_update'))).''.anchor($controller_name."/inventory/$item->item_id/width:$width", $CI->lang->line('common_inv'),array('class'=>'thickbox','title'=>$CI->lang->line($controller_name.'_count')))./*''*/'    '.anchor($controller_name."/count_details/$item->item_id/width:$width", $CI->lang->line('common_det'),array('class'=>'thickbox','title'=>$CI->lang->line($controller_name.'_details_count'))).'' . $image . ''.anchor($controller_name."/view/$item->item_id", '', array('class'=>"modal-dlg modal-btn-new modal-btn-submit",'title'=>$CI->lang->line($controller_name.'_update'))).''.anchor($controller_name."/inventory/$item->item_id", '', array('class'=>"modal-dlg modal-btn-submit",'title'=>$CI->lang->line($controller_name.'_count'))).''.anchor($controller_name."/count_details/$item->item_id", '', array('class'=>"modal-dlg",'title'=>$CI->lang->line($controller_name.'_details_count'))).'
    '; + $table='
    '; $headers = array('', $CI->lang->line('common_last_name'), $CI->lang->line('common_first_name'), $CI->lang->line('giftcards_giftcard_number'), $CI->lang->line('giftcards_card_value'), - ' ', - ); + ' '); $table.=''; foreach($headers as $header) @@ -411,7 +404,7 @@ function get_giftcards_manage_table_data_rows( $giftcards, $controller ) if($giftcards->num_rows()==0) { - $table_data_rows.=""; + $table_data_rows.=""; } return $table_data_rows; @@ -421,7 +414,6 @@ function get_giftcard_data_row($giftcard,$controller) { $CI =& get_instance(); $controller_name=strtolower(get_class($CI)); - $width = $controller->get_form_width(); $table_data_row=''; $table_data_row.=""; @@ -429,7 +421,7 @@ function get_giftcard_data_row($giftcard,$controller) $table_data_row.=''; $table_data_row.=''; $table_data_row.=''; - $table_data_row.=''; + $table_data_row.=''; $table_data_row.=''; return $table_data_row; @@ -441,7 +433,7 @@ Gets the html table to manage item kits. function get_item_kits_manage_table( $item_kits, $controller ) { $CI =& get_instance(); - $table='
    ".$CI->lang->line('giftcards_no_giftcards_to_display')."
    ".$CI->lang->line('giftcards_no_giftcards_to_display')."
    '.$giftcard->first_name.''.$giftcard->giftcard_number.''.to_currency($giftcard->value).''.anchor($controller_name."/view/$giftcard->giftcard_id/width:$width", $CI->lang->line('common_edit'),array('class'=>'thickbox','title'=>$CI->lang->line($controller_name.'_update'))).''.anchor($controller_name."/view/$giftcard->giftcard_id", '', array('class'=>"modal-dlg modal-btn-submit",'title'=>$CI->lang->line($controller_name.'_update'))).'
    '; + $table='
    '; $headers = array('', $CI->lang->line('item_kits_kit'), @@ -449,8 +441,7 @@ function get_item_kits_manage_table( $item_kits, $controller ) $CI->lang->line('item_kits_description'), $CI->lang->line('items_cost_price'), $CI->lang->line('items_unit_price'), - ' ', - ); + ' '); $table.=''; foreach($headers as $header) @@ -479,7 +470,7 @@ function get_item_kits_manage_table_data_rows($item_kits, $controller) if($item_kits->num_rows()==0) { - $table_data_rows .= ""; + $table_data_rows .= ""; } return $table_data_rows; @@ -489,7 +480,6 @@ function get_item_kit_data_row($item_kit, $controller) { $CI =& get_instance(); $controller_name=strtolower(get_class($CI)); - $width = $controller->get_form_width(); $table_data_row=''; $table_data_row.=""; @@ -498,7 +488,7 @@ function get_item_kit_data_row($item_kit, $controller) $table_data_row.=''; $table_data_row.=''; $table_data_row.=''; - $table_data_row.=''; + $table_data_row.=''; $table_data_row.=''; return $table_data_row; diff --git a/application/language/de-CH/common_lang.php b/application/language/de-CH/common_lang.php index 70a06401d..9c92e2d6f 100644 --- a/application/language/de-CH/common_lang.php +++ b/application/language/de-CH/common_lang.php @@ -51,7 +51,12 @@ $lang["common_you_are_using_ospos"] = "Sie verwenden Open Source Point Of Sales $lang["common_zip"] = "PLZ"; $lang["common_import"] = "Import"; $lang["common_download_import_template"] = "Download Import Excel Voralge (CSV)"; -$lang["common_import_file_path"] = "Dateipfad"; $lang["common_import_excel"] = "Excel Import"; $lang["common_import_full_path"] = "Voller Dateipfad zum Excel File notwendig"; +$lang["common_import_select_file"] = ""; +$lang["common_import_change_file"] = ""; +$lang["common_import_remove_file"] = ""; +$lang["common_export_excel"] = "Excel Export"; +$lang["common_export_excel_yes"] = "Yes"; +$lang["common_export_excel_no"] = "No"; $lang["common_required"] = "Erforderlich"; diff --git a/application/language/de-CH/config_lang.php b/application/language/de-CH/config_lang.php index 39242e9e9..aa87f8965 100644 --- a/application/language/de-CH/config_lang.php +++ b/application/language/de-CH/config_lang.php @@ -27,10 +27,14 @@ $lang["config_barcode_width"] = "Breite (px)"; $lang["config_barcode_generate_if_empty"] = "Generiere Barcode wenn leer"; $lang["config_company"] = "Firmenname"; $lang["config_company_logo"] = "Logo"; +$lang["config_company_select_image"] = "Select Image"; +$lang["config_company_change_image"] = "Change Image"; +$lang["config_company_remove_image"] = "Remove Image"; $lang["config_company_required"] = "Firmenname ist erforderlich"; $lang["config_company_website_url"] = "Webseite ist nicht in korrektem Format"; $lang["config_currency_side"] = "Pos. rechts"; $lang["config_currency_symbol"] = "Währungssymbol"; +$lang["config_currency_decimals"] = "Currency Decimals"; $lang["config_custom1"] = "Zusatzfeld 1"; $lang["config_custom10"] = "Zusatzfeld 10"; $lang["config_custom2"] = "Zusatzfeld 2"; @@ -64,6 +68,7 @@ $lang["config_default_tax_rate_1"] = "MWSt 1"; $lang["config_default_tax_rate_2"] = "MWSt 2"; $lang["config_default_tax_rate_number"] = "MWSt Rate"; $lang["config_default_tax_rate_required"] = "MWSt ist erforderlich"; +$lang["config_default_tax_name_required"] = "The default tax name is a required field"; $lang["config_fax"] = "Fax"; $lang["config_general_configuration"] = "Einstellungen"; $lang["config_info"] = "Systemeinstellungen"; @@ -96,6 +101,7 @@ $lang["config_print_silently"] = "Zeige Druckdialog"; $lang["config_print_top_margin"] = "Rand oben"; $lang["config_print_top_margin_number"] = "Rand oben muss eine Zahl sein"; $lang["config_print_top_margin_required"] = "Rand oben ist erforderlich"; +$lang["config_quantity_decimals"] = "Quantity Decimals"; $lang["config_receipt_configuration"] = "Druckereinstellungen"; $lang["config_receipt_info"] = "Quittungsinformation"; $lang["config_receipt_printer"] = "Quittungsdrucker"; @@ -112,6 +118,7 @@ $lang["config_stock_location_duplicate"] = "Bitte verwenden Sie einen eindeutige $lang["config_stock_location_invalid_chars"] = "Der Lagerort kann keine Unterstriche enthalten"; $lang["config_stock_location_required"] = "Lagerort Nummer ist erforderlich"; $lang["config_takings_printer"] = "Takings Printer"; +$lang["config_tax_decimals"] = "Tax Decimals"; $lang["config_tax_included"] = "MWSt inbegriffen"; $lang["config_thousands_separator"] = "Tausendertrennzeichen"; $lang["config_timezone"] = "Zeitzone"; diff --git a/application/language/de-CH/customers_lang.php b/application/language/de-CH/customers_lang.php index 2a0d1213d..9e9dd9cb5 100644 --- a/application/language/de-CH/customers_lang.php +++ b/application/language/de-CH/customers_lang.php @@ -2,7 +2,6 @@ $lang["customers_account_number"] = "Konto-Nr."; $lang["customers_account_number_duplicate"] = "Diese Konto-Nr. existiert bereits"; -$lang["customers_basic_information"] = "Kundeninformation"; $lang["customers_cannot_be_deleted"] = "Kunde kann nicht gelöscht werden, ein oder mehrere Kunden weisen Verkäufe auf"; $lang["customers_company_name"] = "Firmenname"; $lang["customers_confirm_delete"] = "Wollen Sie die gewählten Kunden wirklich löschen?"; diff --git a/application/language/de-CH/datepicker_lang.php b/application/language/de-CH/datepicker_lang.php new file mode 100644 index 000000000..734db28d5 --- /dev/null +++ b/application/language/de-CH/datepicker_lang.php @@ -0,0 +1,66 @@ + + + + 403 Forbidden + + + +

    Directory access is forbidden.

    + + + diff --git a/application/language/de-CH/items_lang.php b/application/language/de-CH/items_lang.php index 38f977196..114f1b5f3 100644 --- a/application/language/de-CH/items_lang.php +++ b/application/language/de-CH/items_lang.php @@ -4,7 +4,6 @@ $lang["items_add_minus"] = "Bestandsänderung"; $lang["items_allow_alt_desciption"] = "Erlaube Alt. Bez."; $lang["items_allow_alt_description"] = "Erlaube Alt. Bez."; $lang["items_amazon"] = "Amazon"; -$lang["items_basic_information"] = "Artikelinformation"; $lang["items_bulk_edit"] = "Sammeländerung"; $lang["items_buy_price_required"] = "Einkaufspreis ist erforderlich"; $lang["items_cannot_be_deleted"] = "Gewählte Artikel können nicht gelöscht werden, einer odere mehrere weisen Verkäufe auf"; @@ -86,3 +85,6 @@ $lang["items_upc_database"] = "UPC Datenbank"; $lang["items_update"] = "Ändere Artikel"; $lang["items_use_inventory_menu"] = "Verwende Bestandesmenu"; $lang["items_import_items_excel"] = "Importiere Artikel mit Excel Datei"; +$lang["items_select_image"] = "Select Image"; +$lang["items_change_image"] = "Change Image"; +$lang["items_remove_image"] = "Remove Image"; diff --git a/application/language/de-CH/receivings_lang.php b/application/language/de-CH/receivings_lang.php index d8add0f47..088ae674e 100644 --- a/application/language/de-CH/receivings_lang.php +++ b/application/language/de-CH/receivings_lang.php @@ -1,7 +1,6 @@ set_cart($items); - return true; + return true; } function edit_item($line,$description,$serialnumber,$quantity,$discount,$price) diff --git a/application/libraries/Sale_lib.php b/application/libraries/Sale_lib.php index e6ba00a18..e0c6af192 100644 --- a/application/libraries/Sale_lib.php +++ b/application/libraries/Sale_lib.php @@ -66,7 +66,6 @@ class Sale_lib { $this->CI->session->set_userdata('sales_invoice_number', $invoice_number); } - } function clear_invoice_number() @@ -111,7 +110,7 @@ class Sale_lib $this->CI->session->unset_userdata('email_receipt'); } - function add_payment( $payment_id, $payment_amount ) + function add_payment($payment_id, $payment_amount) { $payments = $this->get_payments(); if( isset( $payments[$payment_id] ) ) @@ -123,22 +122,22 @@ class Sale_lib { //add to existing array $payment = array( $payment_id=> - array( - 'payment_type' => $payment_id, - 'payment_amount' => $payment_amount - ) + array( + 'payment_type' => $payment_id, + 'payment_amount' => $payment_amount + ) ); $payments += $payment; } - $this->set_payments( $payments ); + $this->set_payments($payments); + return true; - } // Multiple Payments - function edit_payment($payment_id,$payment_amount) + function edit_payment($payment_id, $payment_amount) { $payments = $this->get_payments(); if(isset($payments[$payment_id])) @@ -152,7 +151,7 @@ class Sale_lib } // Multiple Payments - function delete_payment( $payment_id ) + function delete_payment($payment_id) { $payments = $this->get_payments(); unset( $payments[urldecode( $payment_id )] ); @@ -173,17 +172,17 @@ class Sale_lib { $subtotal = bcadd($payments['payment_amount'], $subtotal, PRECISION); } + return to_currency_no_money($subtotal); } // Multiple Payments function get_amount_due() { - $amount_due=0; $payment_total = $this->get_payments_total(); - $sales_total=$this->get_total(); - $amount_due=to_currency_no_money(bcsub($sales_total, $payment_total, PRECISION)); - return $amount_due; + $sales_total = $this->get_total(); + + return to_currency_no_money(bcsub($sales_total, $payment_total, PRECISION)); } function get_customer() @@ -219,6 +218,7 @@ class Sale_lib $location_id = $this->CI->Stock_location->get_default_location_id(); $this->set_sale_location($location_id); } + return $this->CI->session->userdata('sale_location'); } @@ -247,7 +247,7 @@ class Sale_lib $this->CI->session->unset_userdata('giftcard_remainder'); } - function add_item($item_id,$quantity=1,$item_location,$discount=0,$price=null,$description=null,$serialnumber=null) + function add_item($item_id, $quantity=1, $item_location, $discount=0, $price=null, $description=null, $serialnumber=null) { //make sure item exists if($this->validate_item($item_id) == false) @@ -331,11 +331,11 @@ class Sale_lib } $this->set_cart($items); + return true; - } - function out_of_stock($item_id,$item_location) + function out_of_stock($item_id, $item_location) { //make sure item exists if($this->validate_item($item_id) == false) @@ -356,10 +356,11 @@ class Sale_lib { return $this->CI->lang->line('sales_quantity_less_than_reorder_level'); } + return false; } - function get_quantity_already_added($item_id,$item_location) + function get_quantity_already_added($item_id, $item_location) { $items = $this->get_cart(); $quanity_already_added = 0; @@ -389,7 +390,7 @@ class Sale_lib return -1; } - function edit_item($line,$description,$serialnumber,$quantity,$discount,$price) + function edit_item($line, $description, $serialnumber, $quantity, $discount, $price) { $items = $this->get_cart(); if(isset($items[$line])) @@ -426,6 +427,7 @@ class Sale_lib return true; } } + return false; } @@ -563,14 +565,14 @@ class Sale_lib foreach($tax_info as $tax) { - $name = $tax['percent'].'% ' . $tax['name']; - $tax_percentage = $tax['percent']; - $tax_amount = $this->get_item_tax($item['quantity'], $item['price'], $item['discount'], $tax_percentage); + $name = to_tax_decimals($tax['percent']) . '% ' . $tax['name']; + $tax_amount = $this->get_item_tax($item['quantity'], $item['price'], $item['discount'], $tax['percent']); if (!isset($taxes[$name])) { $taxes[$name] = 0; } + $taxes[$name] = bcadd($taxes[$name], $tax_amount, PRECISION); } } @@ -589,6 +591,7 @@ class Sale_lib $discount = bcadd($discount, $item_discount, PRECISION); } } + return $discount; } @@ -618,8 +621,10 @@ class Sale_lib if ($include_discount) { $discount_amount = $this->get_item_discount($quantity, $price, $discount_percentage); + return bcsub($total, $discount_amount, PRECISION); } + return $total; } @@ -627,6 +632,7 @@ class Sale_lib { $total = bcmul($quantity, $price, PRECISION); $discount_fraction = bcdiv($discount_percentage, 100, PRECISION); + return bcmul($total, $discount_fraction, PRECISION); } @@ -642,6 +648,7 @@ class Sale_lib return bcsub($price, $price_tax_excl, PRECISION); } $tax_fraction = bcdiv($tax_percentage, 100, PRECISION); + return bcmul($price, $tax_fraction, PRECISION); } @@ -659,6 +666,7 @@ class Sale_lib $subtotal = bcadd($subtotal, $this->get_item_total($item['quantity'], $item['price'], $item['discount'], $include_discount), PRECISION); } } + return $subtotal; } @@ -688,6 +696,7 @@ class Sale_lib if(!$item_id) return false; } + return true; } } diff --git a/application/models/Customer.php b/application/models/Customer.php index 2c6b2e9ef..edbf2619e 100644 --- a/application/models/Customer.php +++ b/application/models/Customer.php @@ -141,7 +141,7 @@ class Customer extends Person /* Get search suggestions to find customers */ - function get_search_suggestions($search,$limit=25) + function get_search_suggestions($search, $unique=TRUE, $limit=25) { $suggestions = array(); @@ -154,41 +154,45 @@ class Customer extends Person $by_name = $this->db->get(); foreach($by_name->result() as $row) { - $suggestions[]=$row->first_name.' '.$row->last_name; - } - - $this->db->from('customers'); - $this->db->join('people','customers.person_id=people.person_id'); - $this->db->where('deleted',0); - $this->db->like("email",$search); - $this->db->order_by("email", "asc"); - $by_email = $this->db->get(); - foreach($by_email->result() as $row) - { - $suggestions[]=$row->email; + $suggestions[]=array('value' => $row->person_id, 'label' => $row->first_name.' '.$row->last_name); } - $this->db->from('customers'); - $this->db->join('people','customers.person_id=people.person_id'); - $this->db->where('deleted',0); - $this->db->like("phone_number",$search); - $this->db->order_by("phone_number", "asc"); - $by_phone = $this->db->get(); - foreach($by_phone->result() as $row) + if (!$unique) { - $suggestions[]=$row->phone_number; - } - - $this->db->from('customers'); - $this->db->join('people','customers.person_id=people.person_id'); - $this->db->where('deleted',0); - $this->db->like("account_number",$search); - $this->db->order_by("account_number", "asc"); - $by_account_number = $this->db->get(); - foreach($by_account_number->result() as $row) - { - $suggestions[]=$row->account_number; + $this->db->from('customers'); + $this->db->join('people','customers.person_id=people.person_id'); + $this->db->where('deleted',0); + $this->db->like("email",$search); + $this->db->order_by("email", "asc"); + $by_email = $this->db->get(); + foreach($by_email->result() as $row) + { + $suggestions[]=array('value' => $row->person_id, 'label' => $row->email); + } + + $this->db->from('customers'); + $this->db->join('people','customers.person_id=people.person_id'); + $this->db->where('deleted',0); + $this->db->like("phone_number",$search); + $this->db->order_by("phone_number", "asc"); + $by_phone = $this->db->get(); + foreach($by_phone->result() as $row) + { + $suggestions[]=array('value' => $row->person_id, 'label' => $row->phone_number); + } + + $this->db->from('customers'); + $this->db->join('people','customers.person_id=people.person_id'); + $this->db->where('deleted',0); + $this->db->like("account_number",$search); + $this->db->order_by("account_number", "asc"); + $by_account_number = $this->db->get(); + foreach($by_account_number->result() as $row) + { + $suggestions[]= array('value' => $row->person_id, 'label' => $row->account_number); + } } + //only return $limit suggestions if(count($suggestions > $limit)) @@ -197,46 +201,7 @@ class Customer extends Person } return $suggestions; } - - /* - Get search suggestions to find customers - */ - function get_customer_search_suggestions($search,$limit=25) - { - $suggestions = array(); - - $this->db->from('customers'); - $this->db->join('people','customers.person_id=people.person_id'); - $this->db->where("(first_name LIKE '%".$this->db->escape_like_str($search)."%' or - last_name LIKE '%".$this->db->escape_like_str($search)."%' or - CONCAT(`first_name`,' ',`last_name`) LIKE '%".$this->db->escape_like_str($search)."%') and deleted=0"); - $this->db->order_by("last_name", "asc"); - $by_name = $this->db->get(); - foreach($by_name->result() as $row) - { - $suggestions[]=$row->person_id.'|'.$row->first_name.' '.$row->last_name; - } - - $this->db->from('customers'); - $this->db->join('people','customers.person_id=people.person_id'); - $this->db->where('deleted',0); - $this->db->like("account_number",$search); - $this->db->order_by("account_number", "asc"); - $by_account_number = $this->db->get(); - foreach($by_account_number->result() as $row) - { - $suggestions[]=$row->person_id.'|'.$row->account_number; - } - //only return $limit suggestions - if(count($suggestions > $limit)) - { - $suggestions = array_slice($suggestions, 0,$limit); - } - return $suggestions; - - } - function get_found_rows($search) { $this->db->from('customers'); diff --git a/application/models/Employee.php b/application/models/Employee.php index 6b49c0ac4..fcd914452 100644 --- a/application/models/Employee.php +++ b/application/models/Employee.php @@ -192,7 +192,7 @@ class Employee extends Person $by_name = $this->db->get(); foreach($by_name->result() as $row) { - $suggestions[]=$row->first_name.' '.$row->last_name; + $suggestions[]=array('value' => $row->person_id, 'label' => $row->first_name.' '.$row->last_name); } $this->db->from('employees'); @@ -203,7 +203,7 @@ class Employee extends Person $by_email = $this->db->get(); foreach($by_email->result() as $row) { - $suggestions[]=$row->email; + $suggestions[]=array('value' => $row->person_id, 'label' => $row->email); } $this->db->from('employees'); @@ -214,7 +214,7 @@ class Employee extends Person $by_username = $this->db->get(); foreach($by_username->result() as $row) { - $suggestions[]=$row->username; + $suggestions[]=array('value' => $row->person_id, 'label' => $row->username); } @@ -226,7 +226,7 @@ class Employee extends Person $by_phone = $this->db->get(); foreach($by_phone->result() as $row) { - $suggestions[]=$row->phone_number; + $suggestions[]=array('value' => $row->person_id, 'label' => $row->phone_number); } diff --git a/application/models/Giftcard.php b/application/models/Giftcard.php index 3d6697047..2706bf41a 100644 --- a/application/models/Giftcard.php +++ b/application/models/Giftcard.php @@ -184,7 +184,7 @@ class Giftcard extends CI_Model foreach($by_number->result() as $row) { - $suggestions[]=$row->giftcard_number; + $suggestions[]=array('label' => $row->giftcard_number); } $this->db->from('customers'); @@ -198,7 +198,7 @@ class Giftcard extends CI_Model foreach($by_name->result() as $row) { - $suggestions[]=$row->first_name.' '.$row->last_name; + $suggestions[]=array('label' => $row->first_name.' '.$row->last_name); } //only return $limit suggestions @@ -210,38 +210,6 @@ class Giftcard extends CI_Model return $suggestions; } - /* - Get search suggestions to find customers - */ - function get_person_search_suggestions($search,$limit=25) - { - $suggestions = array(); - - $this->db->select('person_id'); - $this->db->from('people'); - $this->db->like('person_id', $this->db->escape_like_str($search)); - $this->db->or_like('first_name', $this->db->escape_like_str($search)); - $this->db->or_like('last_name', $this->db->escape_like_str($search)); - $this->db->or_like('CONCAT(first_name, " ", last_name)', $this->db->escape_like_str($search)); - $this->db->or_like('email', $this->db->escape_like_str($search)); - $this->db->or_like('phone_number', $this->db->escape_like_str($search)); - $this->db->order_by('person_id', 'asc'); - $by_person_id = $this->db->get(); - - foreach($by_person_id->result() as $row) - { - $suggestions[]=$row->person_id; - } - - //only return $limit suggestions - if(count($suggestions > $limit)) - { - $suggestions = array_slice($suggestions, 0,$limit); - } - - return $suggestions; - } - /* Preform a search on giftcards */ diff --git a/application/models/Item.php b/application/models/Item.php index 6ae9600ba..c231a62a2 100644 --- a/application/models/Item.php +++ b/application/models/Item.php @@ -263,170 +263,96 @@ class Item extends CI_Model return $this->db->update('items', array('deleted' => 1)); } - /* - Get search suggestions to find items - */ - public function get_search_suggestions($search, $limit=25, $search_custom=0, $is_deleted=0) - { - $suggestions = array(); - - $this->db->select('category'); - $this->db->from('items'); - $this->db->where('deleted', $is_deleted); - $this->db->distinct(); - $this->db->like('category', $search); - $this->db->order_by('category', 'asc'); - $by_category = $this->db->get(); - foreach($by_category->result() as $row) - { - $suggestions[] = $row->category; - } - - $this->db->select('company_name'); - $this->db->from('suppliers'); - $this->db->like('company_name', $search); - // restrict to non deleted companies only if is_deleted if false - if( $is_deleted == 0 ) - { - $this->db->where('deleted', $is_deleted); - } - $this->db->distinct(); - $this->db->order_by('company_name', 'asc'); - $by_company_name = $this->db->get(); - foreach($by_company_name->result() as $row) - { - $suggestions[] = $row->company_name; - } - - $this->db->select('name'); - $this->db->from('items'); - $this->db->like('name', $search); - $this->db->where('deleted', $is_deleted); - $this->db->order_by('name', 'asc'); - $by_name = $this->db->get(); - foreach($by_name->result() as $row) - { - $suggestions[] = $row->name; - } - - $this->db->select('item_number'); - $this->db->from('items'); - $this->db->like('item_number', $search); - $this->db->where('deleted', $is_deleted); - $this->db->order_by('item_number', 'asc'); - $by_item_number = $this->db->get(); - foreach($by_item_number->result() as $row) - { - $suggestions[] = $row->item_number; - } - - //Search by description - $this->db->select('name, description'); - $this->db->from('items'); - $this->db->like('description', $search); - $this->db->where('deleted', $is_deleted); - $this->db->order_by('description', 'asc'); - $by_name = $this->db->get(); - foreach($by_name->result() as $row) - { - if (!in_array($row->name, $suggestions)) - { - $suggestions[] = $row->name; - } - } - - //Search by custom fields - if ($search_custom != 0) - { - $this->db->from('items'); - $this->db->like('custom1', $search); - $this->db->or_like('custom2', $search); - $this->db->or_like('custom3', $search); - $this->db->or_like('custom4', $search); - $this->db->or_like('custom5', $search); - $this->db->or_like('custom6', $search); - $this->db->or_like('custom7', $search); - $this->db->or_like('custom8', $search); - $this->db->or_like('custom9', $search); - $this->db->or_like('custom10', $search); - $this->db->where('deleted', $is_deleted); - $by_name = $this->db->get(); - foreach($by_name->result() as $row) - { - $suggestions[] = $row->name; - } - } - - //only return $limit suggestions - if(count($suggestions > $limit)) - { - $suggestions = array_slice($suggestions, 0, $limit); - } - - return $suggestions; - } - - public function get_item_search_suggestions($search, $limit=25, $search_custom=0, $is_deleted=0) + public function get_search_suggestions($search, $filters = array('is_deleted'=>FALSE, 'search_custom'=>FALSE), $unique = FALSE, $limit=25) { $suggestions = array(); $this->db->select('item_id, name'); $this->db->from('items'); - $this->db->where('deleted', $is_deleted); + $this->db->where('deleted', $filters['is_deleted']); $this->db->like('name', $search); $this->db->order_by('name', 'asc'); $by_name = $this->db->get(); foreach($by_name->result() as $row) { - $suggestions[] = $row->item_id.'|'.$row->name; + $suggestions[] = array('value' => $row->item_id, 'label' => $row->name); } $this->db->select('item_id, item_number'); $this->db->from('items'); - $this->db->where('deleted', $is_deleted); + $this->db->where('deleted', $filters['is_deleted']); $this->db->like('item_number', $search); $this->db->order_by('item_number', 'asc'); $by_item_number = $this->db->get(); foreach($by_item_number->result() as $row) { - $suggestions[] = $row->item_id.'|'.$row->item_number; + $suggestions[] = array('value' => $row->item_id, 'label' => $row->item_number); } - //Search by description - $this->db->select('item_id, name, description'); - $this->db->from('items'); - $this->db->where('deleted', $is_deleted); - $this->db->like('description', $search); - $this->db->order_by('description', 'asc'); - $by_description = $this->db->get(); - foreach($by_description->result() as $row) - { - $entry = $row->item_id.'|'.$row->name; - if (!in_array($entry, $suggestions)) - { - $suggestions[] = $entry; - } - } - - //Search by custom fields - if ($search_custom != 0) + if (!$unique) { + $this->db->select('category'); $this->db->from('items'); - $this->db->where('deleted', $is_deleted); - $this->db->like('custom1', $search); - $this->db->or_like('custom2', $search); - $this->db->or_like('custom3', $search); - $this->db->or_like('custom4', $search); - $this->db->or_like('custom5', $search); - $this->db->or_like('custom6', $search); - $this->db->or_like('custom7', $search); - $this->db->or_like('custom8', $search); - $this->db->or_like('custom9', $search); - $this->db->or_like('custom10', $search); + $this->db->where('deleted', $filters['is_deleted']); + $this->db->distinct(); + $this->db->like('category', $search); + $this->db->order_by('category', 'asc'); + $by_category = $this->db->get(); + foreach($by_category->result() as $row) + { + $suggestions[] = array('label' => $row->category); + } + + $this->db->select('company_name'); + $this->db->from('suppliers'); + $this->db->like('company_name', $search); + // restrict to non deleted companies only if is_deleted if false + $this->db->where('deleted', $filters['is_deleted']); + $this->db->distinct(); + $this->db->order_by('company_name', 'asc'); + $by_company_name = $this->db->get(); + foreach($by_company_name->result() as $row) + { + $suggestions[] = array('label' => $row->company_name); + } + + //Search by description + $this->db->select('item_id, name, description'); + $this->db->from('items'); + $this->db->where('deleted', $filters['is_deleted']); + $this->db->like('description', $search); + $this->db->order_by('description', 'asc'); $by_description = $this->db->get(); foreach($by_description->result() as $row) { - $suggestions[] = $row->item_id.'|'.$row->name; + $entry = array('value' => $row->item_id, 'label' => $row->name); + if (!array_walk($suggestions, function($value, $label) use ($entry) { + return $entry['label'] != $label; + })) { + $suggestions[] = $entry; + } + } + + //Search by custom fields + if ($filters['search_custom'] != FALSE) + { + $this->db->from('items'); + $this->db->where('deleted', $filters['is_deleted']); + $this->db->like('custom1', $search); + $this->db->or_like('custom2', $search); + $this->db->or_like('custom3', $search); + $this->db->or_like('custom4', $search); + $this->db->or_like('custom5', $search); + $this->db->or_like('custom6', $search); + $this->db->or_like('custom7', $search); + $this->db->or_like('custom8', $search); + $this->db->or_like('custom9', $search); + $this->db->or_like('custom10', $search); + $by_description = $this->db->get(); + foreach($by_description->result() as $row) + { + $suggestions[] = array('value' => $row->item_id, 'label' => $row->name); + } } } @@ -451,7 +377,7 @@ class Item extends CI_Model $by_category = $this->db->get(); foreach($by_category->result() as $row) { - $suggestions[] = $row->category; + $suggestions[] = array('label' => $row->category); } return $suggestions; @@ -469,187 +395,26 @@ class Item extends CI_Model $by_category = $this->db->get(); foreach($by_category->result() as $row) { - $suggestions[] = $row->location; + $suggestions[] = array('label' => $row->location); } return $suggestions; } - public function get_custom1_suggestions($search) + public function get_custom_suggestions($search, $field_no) { $suggestions = array(); $this->db->distinct(); - $this->db->select('custom1'); + $this->db->select('custom'.$field_no); $this->db->from('items'); - $this->db->like('custom1', $search); + $this->db->like('custom'.$field_no, $search); $this->db->where('deleted', 0); - $this->db->order_by('custom1', 'asc'); + $this->db->order_by('custom'.$field_no, 'asc'); $by_category = $this->db->get(); foreach($by_category->result() as $row) { - $suggestions[] = $row->custom1; - } - - return $suggestions; - } - - public function get_custom2_suggestions($search) - { - $suggestions = array(); - $this->db->distinct(); - $this->db->select('custom2'); - $this->db->from('items'); - $this->db->like('custom2', $search); - $this->db->where('deleted', 0); - $this->db->order_by('custom2', 'asc'); - $by_category = $this->db->get(); - foreach($by_category->result() as $row) - { - $suggestions[] = $row->custom2; - } - - return $suggestions; - } - - public function get_custom3_suggestions($search) - { - $suggestions = array(); - $this->db->distinct(); - $this->db->select('custom3'); - $this->db->from('items'); - $this->db->like('custom3', $search); - $this->db->where('deleted', 0); - $this->db->order_by('custom3', 'asc'); - $by_category = $this->db->get(); - foreach($by_category->result() as $row) - { - $suggestions[] = $row->custom3; - } - - return $suggestions; - } - - public function get_custom4_suggestions($search) - { - $suggestions = array(); - $this->db->distinct(); - $this->db->select('custom4'); - $this->db->from('items'); - $this->db->like('custom4', $search); - $this->db->where('deleted', 0); - $this->db->order_by('custom4', 'asc'); - $by_category = $this->db->get(); - foreach($by_category->result() as $row) - { - $suggestions[] = $row->custom4; - } - - return $suggestions; - } - - public function get_custom5_suggestions($search) - { - $suggestions = array(); - $this->db->distinct(); - $this->db->select('custom5'); - $this->db->from('items'); - $this->db->like('custom5', $search); - $this->db->where('deleted', 0); - $this->db->order_by('custom5', 'asc'); - $by_category = $this->db->get(); - foreach($by_category->result() as $row) - { - $suggestions[] = $row->custom5; - } - - return $suggestions; - } - - public function get_custom6_suggestions($search) - { - $suggestions = array(); - $this->db->distinct(); - $this->db->select('custom6'); - $this->db->from('items'); - $this->db->like('custom6', $search); - $this->db->where('deleted', 0); - $this->db->order_by('custom6', 'asc'); - $by_category = $this->db->get(); - foreach($by_category->result() as $row) - { - $suggestions[] = $row->custom6; - } - - return $suggestions; - } - - public function get_custom7_suggestions($search) - { - $suggestions = array(); - $this->db->distinct(); - $this->db->select('custom7'); - $this->db->from('items'); - $this->db->like('custom7', $search); - $this->db->where('deleted', 0); - $this->db->order_by('custom7', 'asc'); - $by_category = $this->db->get(); - foreach($by_category->result() as $row) - { - $suggestions[] = $row->custom7; - } - - return $suggestions; - } - - public function get_custom8_suggestions($search) - { - $suggestions = array(); - $this->db->distinct(); - $this->db->select('custom8'); - $this->db->from('items'); - $this->db->like('custom8', $search); - $this->db->where('deleted', 0); - $this->db->order_by('custom8', 'asc'); - $by_category = $this->db->get(); - foreach($by_category->result() as $row) - { - $suggestions[] = $row->custom8; - } - - return $suggestions; - } - - public function get_custom9_suggestions($search) - { - $suggestions = array(); - $this->db->distinct(); - $this->db->select('custom9'); - $this->db->from('items'); - $this->db->like('custom9', $search); - $this->db->where('deleted', 0); - $this->db->order_by('custom9', 'asc'); - $by_category = $this->db->get(); - foreach($by_category->result() as $row) - { - $suggestions[] = $row->custom9; - } - - return $suggestions; - } - - public function get_custom10_suggestions($search) - { - $suggestions = array(); - $this->db->distinct(); - $this->db->select('custom10'); - $this->db->from('items'); - $this->db->like('custom10', $search); - $this->db->where('deleted', 0); - $this->db->order_by('custom10', 'asc'); - $by_category = $this->db->get(); - foreach($by_category->result() as $row) - { - $suggestions[] = $row->custom10; + $row_array = (array) $row; + $suggestions[] = array('label' => $row_array['custom'.$field_no]); } return $suggestions; @@ -665,7 +430,7 @@ class Item extends CI_Model return $this->db->get(); } - + /* * changes the cost price of a given item * calculates the average price between received items and items on stock @@ -673,16 +438,16 @@ class Item extends CI_Model * $items_received : the amount of new items received * $new_price : the cost-price for the newly received items * $old_price (optional) : the current-cost-price - * + * * used in receiving-process to update cost-price if changed * caution: must be used there before item_quantities gets updated, otherwise average price is wrong! - * + * */ public function change_cost_price($item_id, $items_received, $new_price, $old_price = null) { if($old_price === null) { - $item_info = $this->get_info($item['item_id']); + $item_info = $this->get_info($item_id); $old_price = $item_info->cost_price; } @@ -697,7 +462,7 @@ class Item extends CI_Model $average_price = bcdiv(bcadd(bcmul($items_received, $new_price), bcmul($old_total_quantity, $old_price)), $total_quantity); $data = array('cost_price' => $average_price); - + return $this->save($data, $item_id); } } diff --git a/application/models/Item_kit.php b/application/models/Item_kit.php index 04b64e00e..bb11ad8af 100644 --- a/application/models/Item_kit.php +++ b/application/models/Item_kit.php @@ -118,9 +118,6 @@ class Item_kit extends CI_Model return $this->db->delete('item_kits'); } - /* - Get search suggestions to find kits - */ function get_search_suggestions($search, $limit=25) { $suggestions = array(); @@ -131,25 +128,25 @@ class Item_kit extends CI_Model if (stripos($search, 'KIT ') !== false) { $this->db->like('item_kit_id', str_ireplace('KIT ', '', $search)); - + $this->db->order_by('item_kit_id', 'asc'); $by_name = $this->db->get(); - + foreach($by_name->result() as $row) { - $suggestions[] = 'KIT ' . $row->item_kit_id; - } + $suggestions[] = array('value' => 'KIT '. $row->item_kit_id, 'label' => 'KIT ' . $row->item_kit_id); + } } else { $this->db->like('name', $search); - + $this->db->order_by('name', 'asc'); $by_name = $this->db->get(); - + foreach($by_name->result() as $row) { - $suggestions[] = $row->name; + $suggestions[] = array('value' => 'KIT ' . $row->item_kit_id, 'label' => $row->name); } } @@ -161,30 +158,6 @@ class Item_kit extends CI_Model return $suggestions; } - - function get_item_kit_search_suggestions($search, $limit=25) - { - $suggestions = array(); - - $this->db->from('item_kits'); - $this->db->like('name', $search); - $this->db->order_by('name', 'asc'); - $by_name = $this->db->get(); - - foreach($by_name->result() as $row) - { - // do not touch the '|' otherwise the sale search will not fetch the kit - $suggestions[] = 'KIT ' . $row->item_kit_id . '|' . $row->name; - } - - //only return $limit suggestions - if(count($suggestions > $limit)) - { - $suggestions = array_slice($suggestions, 0, $limit); - } - - return $suggestions; - } /* Perform a search on items diff --git a/application/models/Person.php b/application/models/Person.php index 787bc6106..20f39e73c 100644 --- a/application/models/Person.php +++ b/application/models/Person.php @@ -85,15 +85,15 @@ class Person extends CI_Model return $this->db->update('people',$person_data); } - /* - Get search suggestions to find customers - */ - function get_search_suggestions($search,$limit=25) - { - $suggestions = array(); - + /* + Get search suggestions to find customers + */ + function get_search_suggestions($search,$limit=25) + { + $suggestions = array(); + // $this->db->select("person_id"); -// $this->db->from('people'); +// $this->db->from('people'); // $this->db->where('deleted',0); // $this->db->where('person_id',$this->db->escape($search)); // $this->db->like('first_name',$this->db->escape_like_str($search)); @@ -101,20 +101,20 @@ class Person extends CI_Model // $this->db->or_like("CONCAT(`first_name`,' ',`last_name`)",$this->db->escape_like_str($search)); // $this->db->or_like('email',$search); // $this->db->or_like('phone_number',$search); -// $this->db->order_by('last_name', "asc"); - $by_person_id = $this->db->get(); +// $this->db->order_by('last_name', "asc"); + $by_person_id = $this->db->get(); - foreach($by_person_id->result() as $row) - { - $suggestions[]=$row->person_id; - } - - //only return $limit suggestions - if(count($suggestions > $limit)) - { - $suggestions = array_slice($suggestions, 0,$limit); + foreach($by_person_id->result() as $row) + { + $suggestions[]=array('label' => $row->person_id); } - + + //only return $limit suggestions + if(count($suggestions > $limit)) + { + $suggestions = array_slice($suggestions, 0,$limit); + } + return $suggestions; } diff --git a/application/models/Receiving.php b/application/models/Receiving.php index 2de3f5230..a05e530ad 100644 --- a/application/models/Receiving.php +++ b/application/models/Receiving.php @@ -51,17 +51,17 @@ class Receiving extends CI_Model return $success; } - function save ($items,$supplier_id,$employee_id,$comment,$invoice_number,$payment_type,$receiving_id=false) + function save($items, $supplier_id, $employee_id, $comment, $invoice_number, $payment_type, $receiving_id=false) { if(count($items)==0) return -1; $receivings_data = array( - 'supplier_id'=> $this->Supplier->exists($supplier_id) ? $supplier_id : null, - 'employee_id'=>$employee_id, - 'payment_type'=>$payment_type, - 'comment'=>$comment, - 'invoice_number'=>$invoice_number + 'supplier_id'=>$this->Supplier->exists($supplier_id) ? $supplier_id : null, + 'employee_id'=>$employee_id, + 'payment_type'=>$payment_type, + 'comment'=>$comment, + 'invoice_number'=>$invoice_number ); //Run these queries as a transaction, we want to make sure we do all or nothing @@ -70,11 +70,9 @@ class Receiving extends CI_Model $this->db->insert('receivings',$receivings_data); $receiving_id = $this->db->insert_id(); - foreach($items as $line=>$item) { $cur_item_info = $this->Item->get_info($item['item_id']); - $receivings_items_data = array( 'receiving_id'=>$receiving_id, @@ -90,7 +88,7 @@ class Receiving extends CI_Model 'item_location'=>$item['item_location'] ); - $this->db->insert('receivings_items',$receivings_items_data); + $this->db->insert('receivings_items', $receivings_items_data); $items_received = $item['receiving_quantity'] != 0 ? $item['quantity'] * $item['receiving_quantity'] : $item['quantity']; diff --git a/application/models/Sale.php b/application/models/Sale.php index 56a6a1e00..5f5d2eb92 100644 --- a/application/models/Sale.php +++ b/application/models/Sale.php @@ -5,8 +5,8 @@ class Sale extends CI_Model { $this->db->select('first_name, last_name, email, comment, sale_payment_amount AS amount_tendered, payment_type, invoice_number, sale_time, employee_id, customer_id, comments, sale_id, (sale_payment_amount - total) AS change_due', FALSE); - $this->db->select('DATE_FORMAT( sale_time, "%d-%m-%Y" ) AS sale_date', FALSE); - $this->db->select('CONCAT(first_name," ", last_name) AS customer_name', FALSE); + $this->db->select('DATE_FORMAT(sale_time, "%d-%m-%Y") AS sale_date', FALSE); + $this->db->select('CONCAT(first_name, " ", last_name) AS customer_name', FALSE); $this->db->select('SUM(item_unit_price * quantity_purchased * (1 - discount_percent / 100)) AS amount_due'); $this->db->from('sales_items_temp'); $this->db->join('people', 'people.person_id = sales_items_temp.customer_id', 'left'); @@ -32,7 +32,7 @@ class Sale extends CI_Model public function search($search, $filters, $rows=0, $limit_from=0) { $this->db->select('sale_id, sale_date, sale_time, SUM(quantity_purchased) AS items_purchased, - CONCAT(customer.first_name," ",customer.last_name) AS customer_name, + CONCAT(customer.first_name, " ", customer.last_name) AS customer_name, SUM(subtotal) AS subtotal, SUM(total) AS total, SUM(tax) AS tax, SUM(cost) AS cost, SUM(profit) AS profit, sale_payment_amount AS amount_tendered, SUM(total) AS amount_due, (sale_payment_amount - SUM(total)) AS change_due, payment_type, invoice_number', FALSE); @@ -41,7 +41,7 @@ class Sale extends CI_Model if (empty($search)) { - $this->db->where('sale_date BETWEEN '. $this->db->escape($filters['start_date']). ' AND '. $this->db->escape($filters['end_date'])); + $this->db->where('sale_time BETWEEN ' . $this->db->escape($filters['start_date']) . ' AND ' . $this->db->escape($filters['end_date'])); } else { @@ -107,11 +107,11 @@ class Sale extends CI_Model if (empty($search)) { - $this->db->where('DATE(sale_time) BETWEEN '. $this->db->escape($filters['start_date']). ' AND '. $this->db->escape($filters['end_date'])); + $this->db->where('sale_time BETWEEN '. $this->db->escape($filters['start_date']). ' AND '. $this->db->escape($filters['end_date'])); } else { - if ($filters['is_valid_receipt']) + if ($filters['is_valid_receipt'] != FALSE) { $pieces = explode(' ',$search); $this->db->where('sales.sale_id', $pieces[1]); @@ -194,12 +194,12 @@ class Sale extends CI_Model foreach($this->db->get()->result_array() as $result) { - $suggestions[] = $result[ 'first_name' ].' '.$result[ 'last_name' ]; + $suggestions[] = array('label' => $result[ 'first_name' ].' '.$result[ 'last_name' ]); } } else { - $suggestions[] = $search; + $suggestions[] = array('label' => $search); } return $suggestions; @@ -264,7 +264,7 @@ class Sale extends CI_Model 'invoice_number'=>$invoice_number ); - //Run these queries as a transaction, we want to make sure we do all or nothing + // Run these queries as a transaction, we want to make sure we do all or nothing $this->db->trans_start(); $this->db->insert('sales',$sales_data); @@ -274,7 +274,7 @@ class Sale extends CI_Model { if ( substr( $payment['payment_type'], 0, strlen( $this->lang->line('sales_giftcard') ) ) == $this->lang->line('sales_giftcard') ) { - /* We have a gift card and we have to deduct the used value from the total value of the card. */ + // We have a gift card and we have to deduct the used value from the total value of the card. $splitpayment = explode( ':', $payment['payment_type'] ); $cur_giftcard_value = $this->Giftcard->get_giftcard_value( $splitpayment[1] ); $this->Giftcard->update_giftcard_value( $splitpayment[1], $cur_giftcard_value - $payment['payment_amount'] ); @@ -389,7 +389,6 @@ class Sale extends CI_Model 'trans_comment'=>'Deleting sale ' . $sale_id, 'trans_location'=>$item['item_location'], 'trans_inventory'=>$item['quantity_purchased'] - ); // update inventory $this->Inventory->insert($inv_data); @@ -448,7 +447,7 @@ class Sale extends CI_Model public function get_giftcard_value( $giftcardNumber ) { - if ( !$this->Giftcard->exists( $this->Giftcard->get_giftcard_id($giftcardNumber) ) ) + if ( !$this->Giftcard->exists($this->Giftcard->get_giftcard_id($giftcardNumber)) ) { return 0; } @@ -474,20 +473,22 @@ class Sale extends CI_Model $total = "(1+(SUM(percent/100)))"; $subtotal = "1"; } + + $decimals = totals_decimals(); $this->db->query("CREATE TEMPORARY TABLE IF NOT EXISTS ".$this->db->dbprefix('sales_items_temp')." (SELECT date(sale_time) as sale_date, sale_time, ".$this->db->dbprefix('sales_items').".sale_id, comment, payments.payment_type, payments.sale_payment_amount, item_location, customer_id, employee_id, ".$this->db->dbprefix('items').".item_id, supplier_id, quantity_purchased, item_cost_price, item_unit_price, SUM(percent) as item_tax_percent, - discount_percent, ROUND((item_unit_price*quantity_purchased-item_unit_price*quantity_purchased*discount_percent/100)*$subtotal,2) as subtotal, + discount_percent, ROUND((item_unit_price * quantity_purchased-item_unit_price * quantity_purchased * discount_percent / 100) * $subtotal, $decimals) as subtotal, ".$this->db->dbprefix('sales_items').".line as line, serialnumber, ".$this->db->dbprefix('sales_items').".description as description, - ROUND((item_unit_price*quantity_purchased-item_unit_price*quantity_purchased*discount_percent/100)*$total, 2) as total, - ROUND((item_unit_price*quantity_purchased-item_unit_price*quantity_purchased*discount_percent/100)*$tax, 2) as tax, - ROUND((item_unit_price*quantity_purchased-item_unit_price*quantity_purchased*discount_percent/100)- (item_cost_price*quantity_purchased), 2) as profit, - (item_cost_price*quantity_purchased) as cost, + ROUND((item_unit_price * quantity_purchased-item_unit_price * quantity_purchased * discount_percent / 100) * $total, $decimals) as total, + ROUND((item_unit_price * quantity_purchased-item_unit_price * quantity_purchased * discount_percent / 100) * $tax, $decimals) as tax, + ROUND((item_unit_price * quantity_purchased-item_unit_price * quantity_purchased * discount_percent / 100)- (item_cost_price*quantity_purchased), $decimals) as profit, + (item_cost_price * quantity_purchased) as cost, invoice_number FROM ".$this->db->dbprefix('sales_items')." - INNER JOIN ".$this->db->dbprefix('sales')." ON ".$this->db->dbprefix('sales_items').'.sale_id='.$this->db->dbprefix('sales').'.sale_id'." - INNER JOIN ".$this->db->dbprefix('items')." ON ".$this->db->dbprefix('sales_items').'.item_id='.$this->db->dbprefix('items').'.item_id'." + INNER JOIN ".$this->db->dbprefix('sales')." ON ".$this->db->dbprefix('sales_items').'.sale_id='.$this->db->dbprefix('sales').'.sale_id'." + INNER JOIN ".$this->db->dbprefix('items')." ON ".$this->db->dbprefix('sales_items').'.item_id='.$this->db->dbprefix('items').'.item_id'." INNER JOIN (SELECT sale_id, SUM(payment_amount) AS sale_payment_amount, GROUP_CONCAT(CONCAT(payment_type,' ',payment_amount) SEPARATOR ', ') AS payment_type FROM " . $this->db->dbprefix('sales_payments') . " GROUP BY sale_id) AS payments ON " . $this->db->dbprefix('sales_items') . '.sale_id'. "=" . "payments.sale_id diff --git a/application/models/Supplier.php b/application/models/Supplier.php index aaefeb416..562d49db1 100644 --- a/application/models/Supplier.php +++ b/application/models/Supplier.php @@ -136,78 +136,79 @@ class Supplier extends Person /* Get search suggestions to find suppliers */ - function get_search_suggestions($search,$limit=25) + function get_search_suggestions($search, $unique = FALSE, $limit = 25) { $suggestions = array(); - + $this->db->from('suppliers'); - $this->db->join('people','suppliers.person_id=people.person_id'); + $this->db->join('people', 'suppliers.person_id=people.person_id'); $this->db->where('deleted', 0); - $this->db->like("company_name",$search); - $this->db->order_by("company_name", "asc"); + $this->db->like("company_name", $search); + $this->db->order_by("company_name", "asc"); $by_company_name = $this->db->get(); - foreach($by_company_name->result() as $row) - { - $suggestions[]=$row->company_name; + foreach ($by_company_name->result() as $row) { + $suggestions[] = array('value' => $row->person_id, 'label' => $row->company_name); } $this->db->from('suppliers'); - $this->db->join('people','suppliers.person_id=people.person_id'); + $this->db->join('people', 'suppliers.person_id=people.person_id'); $this->db->where('deleted', 0); $this->db->distinct(); - $this->db->like("agency_name",$search); - $this->db->order_by("agency_name", "asc"); + $this->db->like("agency_name", $search); + $this->db->where("agency_name", "<> null"); + $this->db->order_by("agency_name", "asc"); $by_agency_name = $this->db->get(); - foreach($by_agency_name->result() as $row) - { - $suggestions[]=$row->agency_name; - } - - $this->db->from('suppliers'); - $this->db->join('people','suppliers.person_id=people.person_id'); - $this->db->where("(first_name LIKE '%".$this->db->escape_like_str($search)."%' or - last_name LIKE '%".$this->db->escape_like_str($search)."%' or - CONCAT(`first_name`,' ',`last_name`) LIKE '%".$this->db->escape_like_str($search)."%') and deleted=0"); - $this->db->order_by("last_name", "asc"); - $by_name = $this->db->get(); - foreach($by_name->result() as $row) - { - $suggestions[]=$row->first_name.' '.$row->last_name; - } - - $this->db->from('suppliers'); - $this->db->join('people','suppliers.person_id=people.person_id'); - $this->db->where('deleted', 0); - $this->db->like("email",$search); - $this->db->order_by("email", "asc"); - $by_email = $this->db->get(); - foreach($by_email->result() as $row) - { - $suggestions[]=$row->email; + foreach ($by_agency_name->result() as $row) { + $suggestions[] = array('value' => $row->person_id, 'label' => $row->agency_name); } $this->db->from('suppliers'); - $this->db->join('people','suppliers.person_id=people.person_id'); - $this->db->where('deleted', 0); - $this->db->like("phone_number",$search); - $this->db->order_by("phone_number", "asc"); - $by_phone = $this->db->get(); - foreach($by_phone->result() as $row) - { - $suggestions[]=$row->phone_number; + $this->db->join('people', 'suppliers.person_id=people.person_id'); + $this->db->where("(first_name LIKE '%" . $this->db->escape_like_str($search) . "%' or + last_name LIKE '%" . $this->db->escape_like_str($search) . "%' or + CONCAT(`first_name`,' ',`last_name`) LIKE '%" . $this->db->escape_like_str($search) . "%') and deleted=0"); + $this->db->order_by("last_name", "asc"); + $by_name = $this->db->get(); + foreach ($by_name->result() as $row) { + $suggestions[] = array('value' => $row->person_id, 'label' => $row->first_name . ' ' . $row->last_name); } - - $this->db->from('suppliers'); - $this->db->join('people','suppliers.person_id=people.person_id'); - $this->db->where('deleted', 0); - $this->db->like("account_number",$search); - $this->db->order_by("account_number", "asc"); - $by_account_number = $this->db->get(); - foreach($by_account_number->result() as $row) + + if (!$unique) { - $suggestions[]=$row->account_number; + $this->db->from('suppliers'); + $this->db->join('people','suppliers.person_id=people.person_id'); + $this->db->where('deleted', 0); + $this->db->like("email",$search); + $this->db->order_by("email", "asc"); + $by_email = $this->db->get(); + foreach($by_email->result() as $row) + { + $suggestions[]=array('value' => $row->person_id, 'label' => $row->email); + } + + $this->db->from('suppliers'); + $this->db->join('people','suppliers.person_id=people.person_id'); + $this->db->where('deleted', 0); + $this->db->like("phone_number",$search); + $this->db->order_by("phone_number", "asc"); + $by_phone = $this->db->get(); + foreach($by_phone->result() as $row) + { + $suggestions[]=array('value' => $row->person_id, 'label' => $row->phone_number); + } + + $this->db->from('suppliers'); + $this->db->join('people','suppliers.person_id=people.person_id'); + $this->db->where('deleted', 0); + $this->db->like("account_number",$search); + $this->db->order_by("account_number", "asc"); + $by_account_number = $this->db->get(); + foreach($by_account_number->result() as $row) + { + $suggestions[]=array('value' => $row->person_id, 'label' => $row->account_number); + } } - + //only return $limit suggestions if(count($suggestions > $limit)) { @@ -216,60 +217,7 @@ class Supplier extends Person return $suggestions; } - - /* - Get search suggestions to find suppliers - */ - function get_suppliers_search_suggestions($search,$limit=25) - { - $suggestions = array(); - - $this->db->from('suppliers'); - $this->db->join('people','suppliers.person_id=people.person_id'); - $this->db->where('deleted', 0); - $this->db->like("company_name",$search); - $this->db->order_by("company_name", "asc"); - $by_company_name = $this->db->get(); - foreach($by_company_name->result() as $row) - { - $suggestions[]=$row->person_id.'|'.$row->company_name; - } - - $this->db->from('suppliers'); - $this->db->join('people','suppliers.person_id=people.person_id'); - $this->db->where('deleted', 0); - $this->db->distinct(); - $this->db->like("agency_name",$search); - $this->db->order_by("agency_name", "asc"); - $by_agency_name = $this->db->get(); - foreach($by_agency_name->result() as $row) - { - $suggestions[]=$row->person_id.'|'.$row->agency_name; - } - - - $this->db->from('suppliers'); - $this->db->join('people','suppliers.person_id=people.person_id'); - $this->db->where("(first_name LIKE '%".$this->db->escape_like_str($search)."%' or - last_name LIKE '%".$this->db->escape_like_str($search)."%' or - CONCAT(`first_name`,' ',`last_name`) LIKE '%".$this->db->escape_like_str($search)."%') and deleted=0"); - $this->db->order_by("last_name", "asc"); - $by_name = $this->db->get(); - foreach($by_name->result() as $row) - { - $suggestions[]=$row->person_id.'|'.$row->first_name.' '.$row->last_name; - } - - //only return $limit suggestions - if(count($suggestions > $limit)) - { - $suggestions = array_slice($suggestions, 0,$limit); - } - return $suggestions; - - } - function get_found_rows($search) { $this->db->from('suppliers'); diff --git a/application/models/reports/Summary_taxes.php b/application/models/reports/Summary_taxes.php index 7322e6ea2..3ab456747 100644 --- a/application/models/reports/Summary_taxes.php +++ b/application/models/reports/Summary_taxes.php @@ -36,12 +36,14 @@ class Summary_taxes extends Report $total = "(1+(percent/100))"; $subtotal = "1"; } + + $decimals = totals_decimals(); $query = $this->db->query("SELECT percent, count(*) as count, sum(subtotal) as subtotal, sum(total) as total, sum(tax) as tax - FROM (SELECT name, CONCAT( percent, '%' ) AS percent, - ROUND((item_unit_price * quantity_purchased - item_unit_price * quantity_purchased * discount_percent /100) * $subtotal, 2) AS subtotal, - ROUND((item_unit_price * quantity_purchased - item_unit_price * quantity_purchased * discount_percent /100) * $total, 2) AS total, - ROUND((item_unit_price * quantity_purchased - item_unit_price * quantity_purchased * discount_percent /100) * $tax, 2) AS tax + FROM (SELECT name, CONCAT(ROUND(percent, $decimals), '%') AS percent, + ROUND((item_unit_price * quantity_purchased - item_unit_price * quantity_purchased * discount_percent /100) * $subtotal, $decimals) AS subtotal, + ROUND((item_unit_price * quantity_purchased - item_unit_price * quantity_purchased * discount_percent /100) * $total, $decimals) AS total, + ROUND((item_unit_price * quantity_purchased - item_unit_price * quantity_purchased * discount_percent /100) * $tax, $decimals) AS tax FROM ".$this->db->dbprefix('sales_items_taxes')." JOIN ".$this->db->dbprefix('sales_items')." ON " .$this->db->dbprefix('sales_items').'.sale_id='.$this->db->dbprefix('sales_items_taxes').'.sale_id'." and " diff --git a/application/views/barcode_sheet.php b/application/views/barcodes/barcode_sheet.php similarity index 62% rename from application/views/barcode_sheet.php rename to application/views/barcodes/barcode_sheet.php index 6f4cb4cbc..a3c349c93 100644 --- a/application/views/barcode_sheet.php +++ b/application/views/barcodes/barcode_sheet.php @@ -1,21 +1,15 @@ - + + <?php echo $this->lang->line('items_generate_barcodes'); ?> - -barcode_lib->get_font_name($barcode_config['barcode_font']); ?> - style="font-size:px"> +barcode_lib->get_font_name($barcode_config['barcode_font']); ?> + style="font-size:px">
    ".$CI->lang->line('item_kits_no_item_kits_to_display')."
    ".$CI->lang->line('item_kits_no_item_kits_to_display')."
    '.character_limiter($item_kit->description, 25).''.to_currency($item_kit->total_cost_price).''.to_currency($item_kit->total_unit_price).''.anchor($controller_name."/view/$item_kit->item_kit_id/width:$width", $CI->lang->line('common_edit'),array('class'=>'thickbox','title'=>$CI->lang->line($controller_name.'_update'))).''.anchor($controller_name."/view/$item_kit->item_kit_id", '', array('class'=>"modal-dlg modal-btn-submit",'title'=>$CI->lang->line($controller_name.'_update'))).'
    width='' > '; } - echo ""; + echo ''; $count++; } ?> diff --git a/application/views/configs/barcode_config.php b/application/views/configs/barcode_config.php index a6337b8d6..2a18efbc7 100644 --- a/application/views/configs/barcode_config.php +++ b/application/views/configs/barcode_config.php @@ -1,36 +1,33 @@ -
    lang->line('config_barcode_configuration'); ?>
    -'barcode_config_form')); -?> +'barcode_config_form', 'class'=>'form-horizontal')); ?>
    lang->line('common_fields_required_message'); ?>
      - lang->line("config_barcode_info"); ?> - -
      - lang->line('config_barcode_type').':', 'barcode_type',array('class'=>'wide')); ?> -
      - config->item('barcode_type'));?> + +
      + lang->line('config_barcode_type'), 'barcode_type', array('class'=>'control-label col-xs-2')); ?> +
      + config->item('barcode_type'), array('class'=>'form-control input-sm'));?>
      -
      - lang->line('config_barcode_quality').':', 'barcode_quality',array('class'=>'wide required')); ?> -
      +
      + lang->line('config_barcode_quality'), 'barcode_quality', array('class'=>'control-label col-xs-2 required')); ?> +
      '100', 'min'=>'10', 'type'=>'number', 'name'=>'barcode_quality', 'id'=>'barcode_quality', + 'class'=>'form-control input-sm required', 'value'=>$this->config->item('barcode_quality')));?>
      -
      - lang->line('config_barcode_width').':', 'barcode_width',array('class'=>'wide required')); ?> -
      +
      + lang->line('config_barcode_width'), 'barcode_width', array('class'=>'control-label col-xs-2 required')); ?> +
      '5', 'max'=>'350', @@ -38,132 +35,157 @@ echo form_open('config/save_barcode/',array('id'=>'barcode_config_form')); 'type'=>'number', 'name'=>'barcode_width', 'id'=>'barcode_width', + 'class'=>'form-control input-sm required', 'value'=>$this->config->item('barcode_width')));?>
      -
      - lang->line('config_barcode_height').':', 'barcode_height',array('class'=>'wide required')); ?> -
      +
      + lang->line('config_barcode_height'), 'barcode_height', array('class'=>'control-label col-xs-2 required')); ?> +
      'number', 'min' => 10, 'max' => 120, 'name'=>'barcode_height', 'id'=>'barcode_height', + 'class'=>'form-control input-sm required', 'value'=>$this->config->item('barcode_height')));?>
      -
      - lang->line('config_barcode_font').':', 'barcode_font',array('class'=>'wide required')); ?> -
      +
      + lang->line('config_barcode_font'), 'barcode_font', array('class'=>'control-label col-xs-2 required')); ?> +
      barcode_lib->listfonts("font"), - $this->config->item('barcode_font')); + $this->barcode_lib->listfonts("fonts"), + $this->config->item('barcode_font'), array('class'=>'form-control input-sm required')); ?> - - 'number', - 'min' => '1', - 'max' => '30', - 'name'=>'barcode_font_size', - 'id'=>'barcode_font_size', - 'value'=>$this->config->item('barcode_font_size')));?> +
      +
      + 'number', + 'min' => '1', + 'max' => '30', + 'name'=>'barcode_font_size', + 'id'=>'barcode_font_size', + 'class'=>'form-control input-sm required', + 'value'=>$this->config->item('barcode_font_size')));?>
      -
      - lang->line('config_barcode_content').':', 'barcode_content',array('class'=>'wide')); ?> -
      - 'barcode_content', - 'value'=>'id', - 'checked'=>$this->config->item('barcode_content') === "id")); ?> - lang->line('config_barcode_id'); ?> - 'barcode_content', - 'value'=>'number', - 'checked'=>$this->config->item('barcode_content') === "number")); ?> - lang->line('config_barcode_number'); ?> - 'barcode_generate_if_empty', - 'value'=>'barcode_generate_if_empty', - 'checked'=>$this->config->item('barcode_generate_if_empty'))); ?> - lang->line('config_barcode_generate_if_empty'); ?> +
      + lang->line('config_barcode_content'), 'barcode_content', array('class'=>'control-label col-xs-2')); ?> +
      + + +
      -
      - lang->line('config_barcode_layout').':', 'barcode_layout',array('class'=>'wide')); ?> -
      - lang->line('config_barcode_first_row').' '; ?> - 'Not show', - 'name' => 'Name', - 'category' => 'Category', - 'cost_price' => 'Cost price', - 'unit_price' => 'Unit price', - 'company_name' => 'Company Name' - ), - $this->config->item('barcode_first_row')); - ?> - lang->line('config_barcode_second_row').' '; ?> - 'Not show', - 'name' => 'Name', - 'category' => 'Category', - 'cost_price' => 'Cost price', - 'unit_price' => 'Unit price', - 'item_code' => 'Item code', - 'company_name' => 'Company Name' - ), - $this->config->item('barcode_second_row')); - ?> - lang->line('config_barcode_third_row').' '; ?> - 'Not show', - 'name' => 'Name', - 'category' => 'Category', - 'cost_price' => 'Cost price', - 'unit_price' => 'Unit price', - 'item_code' => 'Item code', - 'company_name' => 'Company Name' - ), - $this->config->item('barcode_third_row')); - ?> +
      + lang->line('config_barcode_layout'), 'barcode_layout', array('class'=>'control-label col-xs-2')); ?> +
      +
      + +
      + 'Not show', + 'name' => 'Name', + 'category' => 'Category', + 'cost_price' => 'Cost price', + 'unit_price' => 'Unit price', + 'company_name' => 'Company Name' + ), + $this->config->item('barcode_first_row'), array('class'=>'form-control input-sm')); + ?> +
      + +
      + 'Not show', + 'name' => 'Name', + 'category' => 'Category', + 'cost_price' => 'Cost price', + 'unit_price' => 'Unit price', + 'item_code' => 'Item code', + 'company_name' => 'Company Name' + ), + $this->config->item('barcode_second_row'), array('class'=>'form-control input-sm')); + ?> +
      + +
      + 'Not show', + 'name' => 'Name', + 'category' => 'Category', + 'cost_price' => 'Cost price', + 'unit_price' => 'Unit price', + 'item_code' => 'Item code', + 'company_name' => 'Company Name' + ), + $this->config->item('barcode_third_row'), array('class'=>'form-control input-sm')); + ?> +
      +
      -
      - lang->line('config_barcode_number_in_row').':', 'barcode_num_in_row',array('class'=>'wide required')); ?> -
      +
      + lang->line('config_barcode_number_in_row'), 'barcode_num_in_row', array('class'=>'control-label col-xs-2 required')); ?> +
      'barcode_num_in_row', 'id'=>'barcode_num_in_row', + 'class'=>'form-control input-sm required', 'value'=>$this->config->item('barcode_num_in_row')));?>
      -
      - lang->line('config_barcode_page_width').':', 'barcode_page_width',array('class'=>'wide required')); ?> -
      - 'barcode_page_width', - 'id'=>'barcode_page_width', - 'value'=>$this->config->item('barcode_page_width')));?> - % +
      + lang->line('config_barcode_page_width'), 'barcode_page_width', array('class'=>'control-label col-xs-2 required')); ?> +
      +
      + 'barcode_page_width', + 'id'=>'barcode_page_width', + 'class'=>'form-control input-sm required', + 'value'=>$this->config->item('barcode_page_width')));?> + % +
      -
      - lang->line('config_barcode_page_cellspacing').':', 'barcode_page_cellspacing',array('class'=>'wide required')); ?> -
      - 'barcode_page_cellspacing', - 'id'=>'barcode_page_cellspacing', - 'value'=>$this->config->item('barcode_page_cellspacing')));?> - px +
      + lang->line('config_barcode_page_cellspacing'), 'barcode_page_cellspacing', array('class'=>'control-label col-xs-2 required')); ?> +
      +
      + 'barcode_page_cellspacing', + 'id'=>'barcode_page_cellspacing', + 'class'=>'form-control input-sm required', + 'value'=>$this->config->item('barcode_page_cellspacing')));?> + px +
      @@ -172,42 +194,44 @@ echo form_open('config/save_barcode/',array('id'=>'barcode_config_form')); 'name'=>'submit', 'id'=>'submit', 'value'=>$this->lang->line('common_submit'), - 'class'=>'submit_button float_right') + 'class'=>'btn btn-primary btn-sm pull-right') ); ?>
      - - + -
      -
      lang->line('module_config'); ?>
      -
      - + + + +
      - +
      -
      + load->view("partial/footer"); ?> \ No newline at end of file diff --git a/application/views/home.php b/application/views/home.php index 004c70001..da43e6629 100644 --- a/application/views/home.php +++ b/application/views/home.php @@ -1,19 +1,19 @@ load->view("partial/header"); ?> -
      -

      lang->line('common_welcome_message'); ?>

      + +

      lang->line('common_welcome_message'); ?>

      +
      result() as $module) { ?> -
      - module_id");?>"> - Menubar Image
      +
      + module_id");?>">Menubar Image module_id");?>">lang->line("module_".$module->module_id) ?> - - lang->line('module_'.$module->module_id.'_desc');?>
      + load->view("partial/footer"); ?> \ No newline at end of file diff --git a/application/views/item_kits/form.php b/application/views/item_kits/form.php index 2acd0ad56..56cb26620 100644 --- a/application/views/item_kits/form.php +++ b/application/views/item_kits/form.php @@ -1,122 +1,109 @@
      lang->line('common_fields_required_message'); ?>
      +
        -item_kit_id,array('id'=>'item_kit_form')); -?> -
        -lang->line("item_kits_info"); ?> -
        -lang->line('item_kits_name').':', 'name',array('class'=>'wide required')); ?> -
        - 'name', - 'id'=>'name', - 'value'=>$item_kit_info->name) - );?> -
        -
        +item_kit_id, array('id'=>'item_kit_form', 'class'=>'form-horizontal')); ?> +
        +
        + lang->line('item_kits_name'), 'name', array('class'=>'control-label col-xs-3 required')); ?> +
        + 'name', + 'id'=>'name', + 'class'=>'form-control input-sm', + 'value'=>$item_kit_info->name) + );?> +
        +
        -
        -lang->line('item_kits_description').':', 'description',array('class'=>'wide')); ?> -
        - 'description', - 'id'=>'description', - 'value'=>$item_kit_info->description, - 'rows'=>'5', - 'cols'=>'17') - );?> -
        -
        +
        + lang->line('item_kits_description'), 'description', array('class'=>'control-label col-xs-3')); ?> +
        + 'description', + 'id'=>'description', + 'class'=>'form-control input-sm', + 'value'=>$item_kit_info->description) + );?> +
        +
        +
        + lang->line('item_kits_add_item'), 'item', array('class'=>'control-label col-xs-3')); ?> +
        + 'item', + 'id'=>'item', + 'class'=>'form-control input-sm') + );?> +
        +
        -
        -lang->line('item_kits_add_item').':', 'item',array('class'=>'wide')); ?> -
        - 'item', - 'id'=>'item' - ));?> -
        -
        +
        " . $this->barcode_lib->display_barcode($item, $barcode_config) . "' . $this->barcode_lib->display_barcode($item, $barcode_config) . '
        + + + + + + + + + Item_kit_items->get_info($item_kit_info->item_kit_id) as $item_kit_item) + { + ?> + + Item->get_info($item_kit_item['item_id']); ?> + + + + + + +
        lang->line('common_delete'); ?>lang->line('item_kits_item'); ?>lang->line('item_kits_quantity'); ?>
        name; ?>' name=item_kit_item[] value='' size='5'/>
        + + - - - - - - - - Item_kit_items->get_info($item_kit_info->item_kit_id) as $item_kit_item) {?> - - Item->get_info($item_kit_item['item_id']); - ?> - - - - - -
        lang->line('common_delete');?>lang->line('item_kits_item');?>lang->line('item_kits_quantity');?>
        Xname; ?>' type='text' size='3' name=item_kit_item[] value=''/>
        -'submit', - 'id'=>'submit', - 'value'=>$this->lang->line('common_submit'), - 'class'=>'submit_button float_right') -); -?> - - \ No newline at end of file diff --git a/application/views/item_kits/manage.php b/application/views/item_kits/manage.php index 9bb59e7d4..bd96fa50c 100644 --- a/application/views/item_kits/manage.php +++ b/application/views/item_kits/manage.php @@ -7,8 +7,8 @@ $(document).ready(function() enable_select_all(); enable_checkboxes(); enable_row_selection(); - enable_search({suggest_url : '', - confirm_message : 'lang->line("common_confirm_search")?>'}); + enable_search({suggest_url: '', + confirm_message: 'lang->line("common_confirm_search")?>'}); enable_delete('lang->line($controller_name."_confirm_delete")?>','lang->line($controller_name."_none_selected")?>'); $('#generate_barcodes').click(function() @@ -34,8 +34,8 @@ function init_table_sorting() sortList: [[1,0]], headers: { - 0: { sorter: false}, - 6: { sorter: false} + 0: { sorter: 'false'}, + 6: { sorter: 'false'} } }); } @@ -45,7 +45,7 @@ function post_item_kit_form_submit(response) { if(!response.success) { - set_feedback(response.message,'error_message',true); + set_feedback(response.message, 'alert alert-dismissible alert-danger', true); } else { @@ -53,7 +53,7 @@ function post_item_kit_form_submit(response) if(jQuery.inArray(response.item_kit_id,get_visible_checkbox_ids()) != -1) { update_row(response.item_kit_id,''); - set_feedback(response.message,'success_message',false); + set_feedback(response.message, 'alert alert-dismissible alert-success', false); } else //refresh entire table @@ -62,7 +62,7 @@ function post_item_kit_form_submit(response) { //highlight new row hightlight_row(response.item_kit_id); - set_feedback(response.message,'success_message',false); + set_feedback(response.message, 'alert alert-dismissible alert-success', false); }); } } @@ -70,35 +70,31 @@ function post_item_kit_form_submit(response)
        -
        lang->line('common_list_of').' '.$this->lang->line('module_'.$controller_name); ?>
        -
        - ".$this->lang->line($controller_name.'_new')."
        ", - array('class'=>'thickbox none','title'=>$this->lang->line($controller_name.'_new'))); - ?> -
        + + + " . $this->lang->line($controller_name . '_new') . "", + array('class'=>'modal-dlg modal-btn-submit none', 'title'=>$this->lang->line($controller_name . '_new'))); ?> - -'search_form')); ?> -
        -
          -
        • lang->line("common_delete"),array('id'=>'delete')); ?>
        • -
        • lang->line("items_generate_barcodes"),array('id'=>'generate_barcodes', 'target' =>'_blank','title'=>$this->lang->line('items_generate_barcodes'))); ?>
        • -
        • - spinner - - -
        • -
        -
        +'search_form', 'class'=>'form-horizontal')); ?> +
        +
        +
          +
        • ' . $this->lang->line("common_delete") . '
        ', array('id'=>'delete')); ?> +
      • ' . $this->lang->line("items_generate_barcodes") . '', array('id'=>'generate_barcodes', 'target' =>'_blank', 'title'=>$this->lang->line('items_generate_barcodes'))); ?>
      • +
      • + 'search', 'class'=>'form-control input-sm', 'id'=>'search')); ?> + 'limit_from', 'type'=>'hidden', 'id'=>'limit_from')); ?> +
      • + + +
        -
        - load->view("partial/footer"); ?> \ No newline at end of file diff --git a/application/views/items/count_details.php b/application/views/items/count_details.php index 276f4e08b..d1f5a313e 100644 --- a/application/views/items/count_details.php +++ b/application/views/items/count_details.php @@ -1,117 +1,100 @@ -item_id,array('id'=>'item_form')); -?> -
        -lang->line("items_basic_information"); ?> +item_id, array('id'=>'item_form', 'class'=>'form-horizontal')); ?> +
        +
        + lang->line('items_item_number'), 'name', array('class'=>'control-label col-xs-3')); ?> +
        +
        + + 'item_number', + 'id'=>'item_number', + 'class'=>'form-control input-sm', + 'disabled'=>'', + 'value'=>$item_info->item_number) + );?> +
        +
        +
        - -
        -
        - - - - - - - - - - + + + + + + + + + + + + 'category', - 'id'=>'category', - 'value'=>$item_info->category, - 'style' => 'border:none', - 'readonly' => 'readonly' - ); - - echo form_input($cat); + $inventory_array = $this->Inventory->get_inventory_data_for_item($item_info->item_id)->result_array(); + $employee_name = array(); + + foreach($inventory_array as $row) + { + $employee = $this->Employee->get_info($row['trans_user']); + array_push($employee_name, $employee->first_name . ' ' . $employee->last_name); + } ?> - - - - - - - - - - - -
        -lang->line('items_item_number').':', 'name',array('class'=>'wide')); ?> - - 'item_number', - 'id'=>'item_number', - 'value'=>$item_info->item_number, - 'style' => 'border:none', - 'readonly' => 'readonly' - ); +
        + lang->line('items_name'), 'name', array('class'=>'control-label col-xs-3')); ?> +
        + 'name', + 'id'=>'name', + 'class'=>'form-control input-sm', + 'disabled'=>'', + 'value'=>$item_info->name) + ); ?> +
        +
        + +
        + lang->line('items_category'), 'category', array('class'=>'control-label col-xs-3')); ?> +
        +
        + + 'category', + 'id'=>'category', + 'class'=>'form-control input-sm', + 'disabled'=>'', + 'value'=>$item_info->category) + );?> +
        +
        +
        + +
        + lang->line('items_stock_location'), 'stock_location', array('class'=>'control-label col-xs-3')); ?> +
        + 'display_stock(this.value);', 'class'=>'form-control')); ?> +
        +
        + +
        + lang->line('items_current_quantity'), 'quantity', array('class'=>'control-label col-xs-3')); ?> +
        + 'quantity', + 'id'=>'quantity', + 'class'=>'form-control input-sm', + 'disabled'=>'', + 'value'=>to_quantity_decimals(current($item_quantities))) + ); ?> +
        +
        + + - echo form_input($inumber) - ?> -
        -lang->line('items_name').':', 'name',array('class'=>'wide')); ?> - - 'name', - 'id'=>'name', - 'value'=>$item_info->name, - 'style' => 'border:none', - 'readonly' => 'readonly' - ); - echo form_input($iname); - ?> -
        -lang->line('items_category').':', 'category',array('class'=>'wide')); ?> - - +
        Inventory Data Tracking
        DateEmployeeIn/Out QtyRemarks
        -lang->line('items_stock_location').':', 'stock_location',array('class'=>'wide')); ?> - - -
        -lang->line('items_current_quantity').':', 'quantity',array('class'=>'wide')); ?> - - 'quantity', - 'id'=>'quantity', - 'value'=>current($item_quantities), - 'style' => 'border:none', - 'readonly' => 'readonly' - ); - - echo form_input($qty); - ?> -
        - -
        -
        -
        - -
        -
        -
        -
        - -Inventory->get_inventory_data_for_item($item_info->item_id)->result_array(); -$employee_name = array(); -foreach( $inventory_array as $row) -{ - $person_id = $row['trans_user']; - $employee = $this->Employee->get_info($person_id); - array_push($employee_name, $employee->first_name." ".$employee->last_name); -} -?> - - - +
        Inventory Data Tracking
        DateEmployeeIn/Out QtyRemarks
        \ No newline at end of file diff --git a/application/views/items/excel_import.php b/application/views/items/excel_import.php index db29d331a..cbf3bc5f7 100644 --- a/application/views/items/excel_import.php +++ b/application/views/items/excel_import.php @@ -1,47 +1,36 @@ -'item_form')); -?> -
        lang->line('items_import_items_excel'); ?>
          -lang->line('common_download_import_template'); ?> -
          -lang->line('common_import'); ?> -
          -lang->line('common_import_file_path').':', 'name',array('class'=>'wide')); ?> -
          - 'file_path', - 'id'=>'file_path', - 'value'=>'') - );?> -
          -
          +'item_form', 'class'=>'form-horizontal')); ?> +
          + + +
          +
          +
          +
          + lang->line("common_import_select_file"); ?>lang->line("common_import_change_file"); ?> + lang->line("common_import_remove_file"); ?> +
          +
          +
          +
          + -'submitf', - 'id'=>'submitf', - 'value'=>$this->lang->line('common_submit'), - 'class'=>'submit_button float_right') -); -?> -
          - diff --git a/application/views/items/form.php b/application/views/items/form.php index 7fffa1cce..6d57c189f 100644 --- a/application/views/items/form.php +++ b/application/views/items/form.php @@ -1,386 +1,451 @@
          lang->line('common_fields_required_message'); ?>
          +
            -item_id,array('id'=>'item_form', 'enctype'=>'multipart/form-data')); -?> -
            - lang->line("items_basic_information"); ?> -
            -lang->line('items_item_number').':', 'item_number',array('class'=>'wide')); ?> -
            - 'item_number', - 'class'=>'item_number', - 'id'=>'item_number', - 'value'=>$item_info->item_number) - );?> -
            -
            - -
            -lang->line('items_name').':', 'name',array('class'=>'required wide')); ?> -
            - 'name', - 'id'=>'name', - 'value'=>$item_info->name) - );?> -
            -
            - -
            -lang->line('items_category').':', 'category',array('class'=>'required wide')); ?> -
            - 'category', - 'id'=>'category', - 'value'=>$item_info->category) - );?> -
            -
            - -
            -lang->line('items_supplier').':', 'supplier',array('class'=>'required wide')); ?> -
            - -
            -
            - -
            -lang->line('items_cost_price').':', 'cost_price',array('class'=>'required wide')); ?> -
            - 'cost_price', - 'size'=>'8', - 'id'=>'cost_price', - 'value'=>$item_info->cost_price) - );?> -
            -
            - -
            -lang->line('items_unit_price').':', 'unit_price',array('class'=>'required wide')); ?> -
            - 'unit_price', - 'size'=>'8', - 'id'=>'unit_price', - 'value'=>$item_info->unit_price) - );?> -
            -
            - -
            -lang->line('items_tax_1').':', 'tax_percent_1',array('class'=>'wide')); ?> -
            - 'tax_names[]', - 'id'=>'tax_name_1', - 'size'=>'8', - 'value'=> isset($item_tax_info[0]['name']) ? $item_tax_info[0]['name'] : $this->config->item('default_tax_1_name')) - );?> -
            -
            - 'tax_percents[]', - 'id'=>'tax_percent_name_1', - 'size'=>'3', - 'value'=> isset($item_tax_info[0]['percent']) ? $item_tax_info[0]['percent'] : $default_tax_1_rate) - );?> - % -
            -
            - -
            -lang->line('items_tax_2').':', 'tax_percent_2',array('class'=>'wide')); ?> -
            - 'tax_names[]', - 'id'=>'tax_name_2', - 'size'=>'8', - 'value'=> isset($item_tax_info[1]['name']) ? $item_tax_info[1]['name'] : $this->config->item('default_tax_2_name')) - );?> -
            -
            - 'tax_percents[]', - 'id'=>'tax_percent_name_2', - 'size'=>'3', - 'value'=> isset($item_tax_info[1]['percent']) ? $item_tax_info[1]['percent'] : $default_tax_2_rate) - );?> - % -
            -
            - -$location_detail) -{ -?> -
            - lang->line('items_quantity').' '.$location_detail['location_name'] .':', - $key.'_quantity', - array('class'=>'required wide')); ?> -
            - $key.'_quantity', - 'id'=>$key.'_quantity', - 'class'=>'quantity', - 'size'=>'8', - 'value'=>isset($item_info->item_id)?$location_detail['quantity']:0) - );?> -
            -
            - - -
            -lang->line('items_receiving_quantity').':', 'receiving_quantity',array('class'=>'wide')); ?> -
            - 'receiving_quantity', - 'id'=>'receiving_quantity', - 'size'=>'8', - 'value'=>$item_info->receiving_quantity) - );?> -
            -
            - -
            -lang->line('items_reorder_level').':', 'reorder_level',array('class'=>'required wide')); ?> -
            - 'reorder_level', - 'id'=>'reorder_level', - 'size'=>'8', - 'value'=>!isset($item_info->item_id)?0:$item_info->reorder_level) - );?> -
            -
            - -
            -lang->line('items_description').':', 'description',array('class'=>'wide')); ?> -
            - 'description', - 'id'=>'description', - 'value'=>$item_info->description, - 'rows'=>'5', - 'cols'=>'17') - );?> -
            -
            - -
            -lang->line('items_image').':', 'item_image',array('class'=>'wide')); ?> -
            - -
            -
            - -
            -lang->line('items_allow_alt_description').':', 'allow_alt_description',array('class'=>'wide')); ?> -
            - 'allow_alt_description', - 'id'=>'allow_alt_description', - 'value'=>1, - 'checked'=>($item_info->allow_alt_description)? 1 :0) - );?> -
            -
            - -
            -lang->line('items_is_serialized').':', 'is_serialized',array('class'=>'wide')); ?> -
            - 'is_serialized', - 'id'=>'is_serialized', - 'value'=>1, - 'checked'=>($item_info->is_serialized)? 1 : 0) - );?> -
            -
            - -
            -lang->line('items_is_deleted').':', 'is_deleted',array('class'=>'wide')); ?> -
            - 'is_deleted', - 'id'=>'is_deleted', - 'value'=>1, - 'checked'=>($item_info->deleted)? 1 : 0) - );?> -
            -
            - - - config->item('custom'.$i.'_name') != null) - { - $item_arr = (array)$item_info; - ?> -
            - config->item('custom'.$i.'_name').':', 'custom'.$i,array('class'=>'wide')); ?> -
            - 'custom'.$i, - 'id'=>'custom'.$i, - 'value'=>$item_arr['custom'.$i]) - );?> +item_id, array('id'=>'item_form', 'enctype'=>'multipart/form-data', 'class'=>'form-horizontal')); ?> +
            +
            + lang->line('items_item_number'), 'item_number', array('class'=>'control-label col-xs-3')); ?> +
            +
            + + 'item_number', + 'id'=>'item_number', + 'class'=>'form-control input-sm', + 'value'=>$item_info->item_number) + );?> +
            - -'submit', - 'id'=>'submit', - 'value'=>$this->lang->line('common_submit'), - 'class'=>'submit_button float_right') -); -echo form_submit(array( - 'name'=>'continue', - 'id'=>'continue', - 'value'=>$this->lang->line('common_new'), - 'class'=>'submit_button float_right') -); -?> -
            - - + diff --git a/application/views/items/form_bulk.php b/application/views/items/form_bulk.php index 586ddcf72..677b08832 100644 --- a/application/views/items/form_bulk.php +++ b/application/views/items/form_bulk.php @@ -1,181 +1,171 @@
            lang->line('items_edit_fields_you_want_to_update'); ?>
            +
              -'item_form')); -?> -
              -lang->line("items_basic_information"); ?> -
              -lang->line('items_name').':', 'name',array('class'=>'wide')); ?> -
              - 'name', - 'id'=>'name') - );?> -
              -
              +'item_form', 'class'=>'form-horizontal')); ?> +
              +
              + lang->line('items_name'), 'name', array('class'=>'control-label col-xs-3')); ?> +
              + 'name', + 'id'=>'name', + 'class'=>'form-control input-sm') + );?> +
              +
              -
              -lang->line('items_category').':', 'category',array('class'=>'wide')); ?> -
              - 'category', - 'id'=>'category') - );?> -
              -
              +
              + lang->line('items_category'), 'category', array('class'=>'control-label col-xs-3')); ?> +
              +
              + + 'category', + 'id'=>'category', + 'class'=>'form-control input-sm') + );?> +
              +
              +
              -
              -lang->line('items_supplier').':', 'supplier',array('class'=>'wide')); ?> -
              - -
              -
              +
              + lang->line('items_supplier'), 'supplier', array('class'=>'control-label col-xs-3')); ?> +
              + 'form-control'));?> +
              +
              +
              + lang->line('items_cost_price'), 'cost_price', array('class'=>'control-label col-xs-3')); ?> +
              +
              + config->item('currency_symbol'); ?> + 'cost_price', + 'id'=>'cost_price', + 'class'=>'form-control input-sm') + );?> +
              +
              +
              -
              -lang->line('items_cost_price').':', 'cost_price',array('class'=>'wide')); ?> -
              - 'cost_price', - 'size'=>'8', - 'id'=>'cost_price') - );?> -
              -
              +
              + lang->line('items_unit_price'), 'unit_price', array('class'=>'control-label col-xs-3')); ?> +
              +
              + config->item('currency_symbol'); ?> + 'unit_price', + 'id'=>'unit_price', + 'class'=>'form-control input-sm') + );?> +
              +
              +
              -
              -lang->line('items_unit_price').':', 'unit_price',array('class'=>'wide')); ?> -
              - 'unit_price', - 'size'=>'8', - 'id'=>'unit_price') - );?> -
              -
              +
              + lang->line('items_tax_1'), 'tax_percent_1', array('class'=>'control-label col-xs-3')); ?> +
              + 'tax_names[]', + 'id'=>'tax_name_1', + 'class'=>'form-control input-sm', + 'value'=>$this->config->item('default_tax_1_name')) + );?> +
              +
              +
              + 'tax_percents[]', + 'id'=>'tax_percent_name_1', + 'class'=>'form-control input-sm', + 'value'=>to_tax_decimals($this->config->item('default_tax_1_rate'))) + );?> + % +
              +
              +
              -
              -lang->line('items_tax_1').':', 'tax_percent_1',array('class'=>'wide')); ?> -
              - 'tax_names[]', - 'id'=>'tax_name_1', - 'size'=>'8', - 'value'=> isset($item_tax_info[0]['name']) ? $item_tax_info[0]['name'] : $this->lang->line('items_sales_tax_1')) - );?> -
              -
              - 'tax_percents[]', - 'id'=>'tax_percent_name_1', - 'size'=>'3', - 'value'=> isset($item_tax_info[0]['percent']) ? $item_tax_info[0]['percent'] : '') - );?> - % -
              -
              +
              + lang->line('items_tax_2'), 'tax_percent_2', array('class'=>'control-label col-xs-3')); ?> +
              + 'tax_names[]', + 'id'=>'tax_name_2', + 'class'=>'form-control input-sm', + 'value'=>$this->config->item('default_tax_2_name')) + );?> +
              +
              +
              + 'tax_percents[]', + 'id'=>'tax_percent_name_2', + 'class'=>'form-control input-sm', + 'value'=>to_tax_decimals($this->config->item('default_tax_2_rate'))) + );?> + % +
              +
              +
              -
              -lang->line('items_tax_2').':', 'tax_percent_2',array('class'=>'wide')); ?> -
              - 'tax_names[]', - 'id'=>'tax_name_2', - 'size'=>'8', - 'value'=> isset($item_tax_info[1]['name']) ? $item_tax_info[1]['name'] : $this->lang->line('items_sales_tax_2'),) - );?> -
              -
              - 'tax_percents[]', - 'id'=>'tax_percent_name_2', - 'size'=>'3', - 'value'=> isset($item_tax_info[1]['percent']) ? $item_tax_info[1]['percent'] : '') - );?> - % -
              -
              -
              -lang->line('items_reorder_level').':', 'reorder_level',array('class'=>'wide')); ?> -
              - 'reorder_level', - 'id'=>'reorder_level') - );?> -
              -
              +
              + lang->line('items_reorder_level'), 'reorder_level', array('class'=>'control-label col-xs-3')); ?> +
              + 'reorder_level', + 'id'=>'reorder_level', + 'class'=>'form-control input-sm') + );?> +
              +
              -
              -lang->line('items_description').':', 'description',array('class'=>'wide')); ?> -
              - 'description', - 'id'=>'description', - 'rows'=>'5', - 'cols'=>'17') - );?> -
              -
              +
              + lang->line('items_description'), 'description', array('class'=>'control-label col-xs-3')); ?> +
              + 'description', + 'id'=>'description', + 'class'=>'form-control input-sm') + );?> +
              +
              -
              +
              + lang->line('items_allow_alt_description'), 'allow_alt_description', array('class'=>'control-label col-xs-3')); ?> +
              + 'form-control'));?> +
              +
              -lang->line('items_allow_alt_description').':', 'allow_alt_description',array('class'=>'wide')); ?> -
              - -
              +
              + lang->line('items_is_serialized'), 'is_serialized', array('class'=>'control-label col-xs-3')); ?> +
              + 'form-control'));?> +
              +
              +
              + -
              - - - -
              - -lang->line('items_is_serialized').':', 'is_serialized',array('class'=>'wide')); ?> -
              - - -
              - -
              - -'submit', - 'id'=>'submit', - 'value'=>$this->lang->line('common_submit'), - 'class'=>'submit_button float_right') -); -?> -
              - \ No newline at end of file + diff --git a/application/views/items/inventory.php b/application/views/items/inventory.php index 54635b434..908676f3b 100644 --- a/application/views/items/inventory.php +++ b/application/views/items/inventory.php @@ -1,132 +1,99 @@
              lang->line('common_fields_required_message'); ?>
              +
                -item_id,array('id'=>'item_form')); -?> -
                -lang->line("items_basic_information"); ?> - -
                -
                - - - - - - - - - - - - - - - - - - - - -
                -lang->line('items_item_number').':', 'name',array('class'=>'wide')); ?> - - 'item_number', - 'id'=>'item_number', - 'value'=>$item_info->item_number, - 'style' => 'border:none', - 'readonly' => 'readonly' - ); - - echo form_input($inumber) - ?> -
                -lang->line('items_name').':', 'name',array('class'=>'wide')); ?> - - 'name', - 'id'=>'name', - 'value'=>$item_info->name, - 'style' => 'border:none', - 'readonly' => 'readonly' - ); - echo form_input($iname); - ?> -
                -lang->line('items_category').':', 'category',array('class'=>'wide')); ?> - - 'category', - 'id'=>'category', - 'value'=>$item_info->category, - 'style' => 'border:none', - 'readonly' => 'readonly' - ); - - echo form_input($cat); - ?> -
                -lang->line('items_stock_location').':', 'stock_location',array('class'=>'wide')); ?> - - -
                -lang->line('items_current_quantity').':', 'quantity',array('class'=>'wide')); ?> - - 'quantity', - 'id'=>'quantity', - 'value'=>current($item_quantities), - 'style' => 'border:none', - 'readonly' => 'readonly' - ); - - echo form_input($qty); - ?> -
                +item_id, array('id'=>'item_form', 'class'=>'form-horizontal')); ?> +
                +
                + lang->line('items_item_number'), 'name', array('class'=>'control-label col-xs-3')); ?> +
                +
                + + 'item_number', + 'id'=>'item_number', + 'class'=>'form-control input-sm', + 'disabled'=>'', + 'value'=>$item_info->item_number) + );?> +
                +
                +
                -
                -lang->line('items_add_minus').':', 'quantity',array('class'=>'required wide')); ?> -
                - 'newquantity', - 'id'=>'newquantity' - ) - );?> -
                -
                +
                + lang->line('items_name'), 'name', array('class'=>'control-label col-xs-3')); ?> +
                + 'name', + 'id'=>'name', + 'class'=>'form-control input-sm', + 'disabled'=>'', + 'value'=>$item_info->name) + ); ?> +
                +
                + +
                + lang->line('items_category'), 'category', array('class'=>'control-label col-xs-3')); ?> +
                +
                + + 'category', + 'id'=>'category', + 'class'=>'form-control input-sm', + 'disabled'=>'', + 'value'=>$item_info->category) + );?> +
                +
                +
                + +
                + lang->line('items_stock_location'), 'stock_location', array('class'=>'control-label col-xs-3')); ?> +
                + 'fill_quantity(this.value)', 'class'=>'form-control')); ?> +
                +
                + +
                + lang->line('items_current_quantity'), 'quantity', array('class'=>'control-label col-xs-3')); ?> +
                + 'quantity', + 'id'=>'quantity', + 'class'=>'form-control input-sm', + 'disabled'=>'', + 'value'=>to_quantity_decimals(current($item_quantities))) + ); ?> +
                +
                + +
                + lang->line('items_add_minus'), 'quantity', array('class'=>'required control-label col-xs-3')); ?> +
                + 'newquantity', + 'id'=>'newquantity', + 'class'=>'form-control input-sm') + ); ?> +
                +
                + +
                + lang->line('items_inventory_comments'), 'description', array('class'=>'control-label col-xs-3')); ?> +
                + 'trans_comment', + 'id'=>'trans_comment', + 'class'=>'form-control input-sm') + );?> +
                +
                +
                + -
                -lang->line('items_inventory_comments').':', 'description',array('class'=>'wide')); ?> -
                - 'trans_comment', - 'id'=>'trans_comment', - 'rows'=>'3', - 'cols'=>'17') - );?> -
                -
                -'submit', - 'id'=>'submit', - 'value'=>$this->lang->line('common_submit'), - 'class'=>'submit_button float_right') -); -?> -
                - \ No newline at end of file diff --git a/application/views/items/manage.php b/application/views/items/manage.php index 7c08ab770..bbf3c7d17 100644 --- a/application/views/items/manage.php +++ b/application/views/items/manage.php @@ -7,17 +7,17 @@ $(document).ready(function() enable_select_all(); enable_checkboxes(); enable_row_selection(); - var widget = enable_search({suggest_url : '', - confirm_message : 'lang->line("common_confirm_search")?>', - extra_params : { + + enable_search({suggest_url: '', + confirm_search_message: 'lang->line("common_confirm_search")?>', + extra_params: { 'is_deleted' : function () { - return $("#is_deleted").is(":checked") ? 1 : 0; + // the comparison is split in two parts: find the index of the selected and check the index against the index in the listed strings of the multiselect menu + return $("#multi_filter li.selected").attr("data-original-index") == $("#filters option[value='is_deleted']").index() ? 1 : 0; + } } - }}); - // clear suggestion cache when toggling filter - $("#is_deleted").change(function() { - widget.flushCache(); - }); + }); + enable_delete('lang->line($controller_name."_confirm_delete")?>','lang->line($controller_name."_none_selected")?>'); enable_bulk_edit('lang->line($controller_name."_none_selected")?>'); @@ -32,32 +32,43 @@ $(document).ready(function() $(this).attr('href','index.php/items/generate_barcodes/'+selected.join(':')); }); - - $("#search_filter_section input").click(function() - { + + // when any filter is clicked and the dropdown window is closed + $('#filters').on('hidden.bs.select', function(e) + { // reset page number when selecting a specific page number $('#limit_from').val("0"); do_search(true); - }); + }); + // accept partial suggestion to trigger a search on enter press $('#search').keypress(function (e) { if (e.which == 13) { $('#search_form').submit(); } }); - $(".date_filter").datepicker({onSelect: function(d,i) - { - if(d !== i.lastVal){ - $(this).change(); - } - }, dateFormat: 'config->item("dateformat"));?>', - timeFormat: 'config->item("timeformat"));?>' - }).change(function() { + // load the preset datarange picker + load->view('partial/daterangepicker'); ?> + + // set the beginning of time as starting date + $('#daterangepicker').data('daterangepicker').setStartDate("config->item('dateformat'), mktime(0,0,0,01,01,2010));?>"); + start_date = ""; + + // set default dates in the hidden inputs + $("#start_date").val(start_date); + $("#end_date").val(end_date); + + // update the hidden inputs with the selected dates before submitting the search data + $("#daterangepicker").on('apply.daterangepicker', function(ev, picker) { + $("#start_date").val(start_date); + $("#end_date").val(end_date); + + // reset page number when selecting a specific page number + $('#limit_from').val("0"); do_search(true); - return false; }); - + resize_thumbs(); }); @@ -76,10 +87,12 @@ function init_table_sorting() sortList: [[1,0]], headers: { - 0: { sorter: false}, - 8: { sorter: false}, - 9: { sorter: false}, - 10: { sorter: false} + 0: { sorter: 'false'}, + 8: { sorter: 'false'}, + 9: { sorter: 'false'}, + 10: { sorter: 'false'}, + 11: { sorter: 'false'}, + 12: { sorter: 'false'} } }); } @@ -89,7 +102,7 @@ function post_item_form_submit(response) { if(!response.success) { - set_feedback(response.message,'error_message',true); + set_feedback(response.message, 'alert alert-dismissible alert-danger', true); } else { @@ -97,15 +110,15 @@ function post_item_form_submit(response) if(jQuery.inArray(response.item_id,get_visible_checkbox_ids()) != -1) { update_row(response.item_id,'',resize_thumbs); - set_feedback(response.message,'success_message',false); + set_feedback(response.message, 'alert alert-dismissible alert-success', false); } else //refresh entire table { - do_search(true,function() + do_search(true, function() { //highlight new row hightlight_row(response.item_id); - set_feedback(response.message,'success_message',false); + set_feedback(response.message, 'alert alert-dismissible alert-success', false); }); } } @@ -115,7 +128,7 @@ function post_bulk_form_submit(response) { if(!response.success) { - set_feedback(response.message,'error_message',true); + set_feedback(response.message, 'alert alert-dismissible alert-danger', true); } else { @@ -124,96 +137,56 @@ function post_bulk_form_submit(response) { update_row(selected_item_ids[k],'',resize_thumbs); } - set_feedback(response.message,'success_message',false); - } -} - -function show_hide_search_filter(search_filter_section, switchImgTag) -{ - var ele = document.getElementById(search_filter_section); - var imageEle = document.getElementById(switchImgTag); - var elesearchstate = document.getElementById('search_section_state'); - - if(ele.style.display == "block") - { - ele.style.display = "none"; - imageEle.innerHTML = ''; - elesearchstate.value="none"; - } - else - { - ele.style.display = "block"; - imageEle.innerHTML = ''; - elesearchstate.value="block"; + set_feedback(response.message, 'alert alert-dismissible alert-success', false); } }
                -
                lang->line('common_list_of').' '.$this->lang->line('module_'.$controller_name); ?>
                -
                - ".$this->lang->line($controller_name.'_new')."
                ", - array('class'=>'thickbox none','title'=>$this->lang->line($controller_name.'_new'))); - ?> - " . $this->lang->line('common_import_excel') . "
                ", - array('class'=>'thickbox none','title'=>'Import Items from Excel')); - ?> - + + + " . $this->lang->line('common_import_excel') . "", + array('class'=>'modal-dlg modal-btn-submit none', 'title'=>$this->lang->line('items_import_items_excel'))); ?> + + " . $this->lang->line($controller_name . '_new') . "", + array('class'=>'modal-dlg modal-btn-new modal-btn-submit', 'title'=>$this->lang->line($controller_name . '_new'))); ?> - -
                -
                lang->line('common_search_options'); ?> :
                - - -
                -'search_form')); ?> -
                - lang->line('items_empty_upc_items').' '.':', 'empty_upc');?> - 'empty_upc','id'=>'empty_upc','value'=>1,'checked'=> isset($empty_upc)? ( ($empty_upc)? 1 : 0) : 0)).' | ';?> - lang->line('items_low_inventory_items').' '.':', 'low_inventory');?> - 'low_inventory','id'=>'low_inventory','value'=>1,'checked'=> isset($low_inventory)? ( ($low_inventory)? 1 : 0) : 0)).' | ';?> - lang->line('items_serialized_items').' '.':', 'is_serialized');?> - 'is_serialized','id'=>'is_serialized','value'=>1,'checked'=> isset($is_serialized)? ( ($is_serialized)? 1 : 0) : 0)).' | ';?> - lang->line('items_no_description_items').' '.':', 'no_description');?> - 'no_description','id'=>'no_description','value'=>1,'checked'=> isset($no_description)? ( ($no_description)? 1 : 0) : 0)).' | ';?> - lang->line('items_search_custom_items').' '.':', 'search_custom');?> - 'search_custom','id'=>'search_custom','value'=>1,'checked'=> isset($search_custom)? ( ($search_custom)? 1 : 0) : 0)).' | ';?> - lang->line('items_is_deleted').' '.':', 'is_deleted');?> - 'is_deleted','id'=>'is_deleted','value'=>1,'checked'=> isset($is_deleted)? ( ($is_deleted)? 1 : 0) : 0));?> - - lang->line('sales_date_range').' :', 'start_date');?> - 'start_date','value'=>$start_date, 'class'=>'date_filter', 'size' => '15'));?> - - 'end_date','value'=>$end_date, 'class'=>'date_filter', 'size' => '15'));?> - - -
                -
                -
                  -
                • lang->line("common_delete"),array('id'=>'delete')); ?>
                • -
                • lang->line("items_bulk_edit"),array('id'=>'bulk_edit','title'=>$this->lang->line('items_edit_multiple_items'))); ?>
                • -
                • lang->line("items_generate_barcodes"),array('id'=>'generate_barcodes', 'target' =>'_blank','title'=>$this->lang->line('items_generate_barcodes'))); ?>
                • - 1): ?> -
                • - -
                • - spinner - - -
                • -
                -
                +'search_form', 'class'=>'form-horizontal')); ?> +
                +
                +
                  +
                • ' . $this->lang->line("common_delete") . '
                ', array('id'=>'delete')); ?> +
              • ' . $this->lang->line("items_bulk_edit") . '', array('id'=>'bulk_edit', 'class'=>'modal-dlg modal-btn-submit', 'title'=>$this->lang->line('items_edit_multiple_items'))); ?>
              • +
              • ' . $this->lang->line("items_generate_barcodes") . '', array('id'=>'generate_barcodes', 'target' =>'_blank', 'title'=>$this->lang->line('items_generate_barcodes'))); ?>
              • +
              • + 'search', 'class'=>'form-control input-sm', 'id'=>'search')); ?> + 'limit_from', 'type'=>'hidden', 'id'=>'limit_from')); ?> +
              • +
              • + 'daterangepicker', 'class'=>'form-control input-sm pull-right', 'id'=>'daterangepicker')); ?> + 'start_date', 'type'=>'hidden', 'id'=>'start_date')); ?> + 'end_date', 'type'=>'hidden', 'id'=>'end_date')); ?> +
              • +
              • 'filters', 'class'=>'selectpicker show-menu-arrow', 'data-selected-text-format'=>'count > 1', 'data-style'=>'btn-default btn-sm', 'data-width'=>'fit')); ?>
              • + 1) + { + ?> +
              • 'stock_location', 'onchange'=>"$('#search_form').submit();", 'class'=>'selectpicker show-menu-arrow', 'data-style'=>'btn-default btn-sm', 'data-width'=>'fit')); ?>
              • + + + +
                -
                - load->view("partial/footer"); ?> diff --git a/application/views/login.php b/application/views/login.php index 1e153dbc6..308485557 100644 --- a/application/views/login.php +++ b/application/views/login.php @@ -2,48 +2,43 @@ - - + Open Source Point Of Sale <?php echo $this->lang->line('login_login'); ?> - - + + + + + + -
                /images/logo.gif>
                +
                + +
                +
                + +
                + lang->line('login_username') . ':'; ?> + 'username', 'id'=>'username', 'class'=>'form-control', 'size'=>'20')); ?> - -
                - + lang->line('login_password') . ':'; ?> + 'password', 'id' => 'password', 'class'=>'form-control', 'size'=>'20')); ?> + + +
                +
                + -
                -
                lang->line('login_username'); ?>:
                -
                - 'username', - 'id'=>'username', - 'size'=>'20')); ?> -
                - -
                lang->line('login_password'); ?>:
                -
                - 'password', - 'id' => 'password', - 'size'=>'20')); ?> -
                - -
                -
                +

                Open Source Point Of Sale config->item('application_version'); ?>

                -

                Open Source Point Of Sale config->item('application_version'); ?>

                diff --git a/application/views/partial/datepicker_locale.php b/application/views/partial/datepicker_locale.php new file mode 100644 index 000000000..7cfbafa4e --- /dev/null +++ b/application/views/partial/datepicker_locale.php @@ -0,0 +1,73 @@ +$.fn.datetimepicker.dates['config->item("language"); ?>'] = { + days: ["lang->line("datepicker_days_sunday"); ?>", + "lang->line("datepicker_days_monday"); ?>", + "lang->line("datepicker_days_tueday"); ?>", + "lang->line("datepicker_days_wednesday"); ?>", + "lang->line("datepicker_days_thursday"); ?>", + "lang->line("datepicker_days_friday"); ?>", + "lang->line("datepicker_days_saturday"); ?>", + "lang->line("datepicker_days_sunday"); ?>"], + daysShort: ["lang->line("datepicker_daysshort_sunday"); ?>", + "lang->line("datepicker_daysshort_monday"); ?>", + "lang->line("datepicker_daysshort_tueday"); ?>", + "lang->line("datepicker_daysshort_wednesday"); ?>", + "lang->line("datepicker_daysshort_thursday"); ?>", + "lang->line("datepicker_daysshort_friday"); ?>", + "lang->line("datepicker_daysshort_saturday"); ?>", + "lang->line("datepicker_daysshort_sunday"); ?>"], + daysMin: ["lang->line("datepicker_daysmin_sunday"); ?>", + "lang->line("datepicker_daysmin_monday"); ?>", + "lang->line("datepicker_daysmin_tueday"); ?>", + "lang->line("datepicker_daysmin_wednesday"); ?>", + "lang->line("datepicker_daysmin_thursday"); ?>", + "lang->line("datepicker_daysmin_friday"); ?>", + "lang->line("datepicker_daysmin_saturday"); ?>", + "lang->line("datepicker_daysmin_sunday"); ?>"], + months: ["lang->line("datepicker_months_january"); ?>", + "lang->line("datepicker_months_february"); ?>", + "lang->line("datepicker_months_march"); ?>", + "lang->line("datepicker_months_april"); ?>", + "lang->line("datepicker_months_may"); ?>", + "lang->line("datepicker_months_june"); ?>", + "lang->line("datepicker_months_july"); ?>", + "lang->line("datepicker_months_august"); ?>", + "lang->line("datepicker_months_september"); ?>", + "lang->line("datepicker_months_october"); ?>", + "lang->line("datepicker_months_november"); ?>", + "lang->line("datepicker_months_december"); ?>"], + monthsShort: ["lang->line("datepicker_monthsshort_january"); ?>", + "lang->line("datepicker_monthsshort_february"); ?>", + "lang->line("datepicker_monthsshort_march"); ?>", + "lang->line("datepicker_monthsshort_april"); ?>", + "lang->line("datepicker_monthsshort_may"); ?>", + "lang->line("datepicker_monthsshort_june"); ?>", + "lang->line("datepicker_monthsshort_july"); ?>", + "lang->line("datepicker_monthsshort_august"); ?>", + "lang->line("datepicker_monthsshort_september"); ?>", + "lang->line("datepicker_monthsshort_october"); ?>", + "lang->line("datepicker_monthsshort_november"); ?>", + "lang->line("datepicker_monthsshort_december"); ?>" + ], + today: "lang->line("datepicker_today"); ?>", + config->item('timeformat'), 'a') !== false ) + { + ?> + meridiem: ["am", "pm"], + config->item('timeformat'), 'A') !== false ) + { + ?> + meridiem: ["AM", "PM"], + + meridiem: [], + + weekStart: lang->line("datepicker_weekstart"); ?> +}; \ No newline at end of file diff --git a/application/views/partial/daterangepicker.php b/application/views/partial/daterangepicker.php new file mode 100644 index 000000000..2bdac0c86 --- /dev/null +++ b/application/views/partial/daterangepicker.php @@ -0,0 +1,97 @@ +var start_date = ""; +var end_date = ""; + +$('#daterangepicker').daterangepicker({ + "ranges": { + "lang->line("datepicker_today"); ?>": [ + "config->item('dateformat'), mktime(0,0,0,date("m"),date("d"),date("Y")));?>", + "config->item('dateformat'), mktime(0,0,0,date("m"),date("d")+1,date("Y"))-1);?>" + ], + "lang->line("datepicker_today_last_year"); ?>": [ + "config->item('dateformat'), mktime(0,0,0,date("m"),date("d"),date("Y")-1));?>", + "config->item('dateformat'), mktime(0,0,0,date("m"),date("d")+1,date("Y")-1)-1);?>" + ], + "lang->line("datepicker_yesterday"); ?>": [ + "config->item('dateformat'), mktime(0,0,0,date("m"),date("d")-1,date("Y")));?>", + "config->item('dateformat'), mktime(0,0,0,date("m"),date("d"),date("Y"))-1);?>" + ], + "lang->line("datepicker_last_7"); ?>": [ + "config->item('dateformat'), mktime(0,0,0,date("m"),date("d")-6,date("Y")));?>", + "config->item('dateformat'), mktime(0,0,0,date("m"),date("d")+1,date("Y"))-1);?>" + ], + "lang->line("datepicker_last_30"); ?>": [ + "config->item('dateformat'), mktime(0,0,0,date("m"),date("d")-29,date("Y")));?>", + "config->item('dateformat'), mktime(0,0,0,date("m"),date("d")+1,date("Y"))-1);?>" + ], + "lang->line("datepicker_this_month"); ?>": [ + "config->item('dateformat'), mktime(0,0,0,date("m"),1,date("Y")));?>", + "config->item('dateformat'), mktime(0,0,0,date("m")+1,1,date("Y"))-1);?>" + ], + "lang->line("datepicker_this_month_to_today_last_year"); ?>": [ + "config->item('dateformat'), mktime(0,0,0,date("m"),1,date("Y")-1));?>", + "config->item('dateformat'), mktime(0,0,0,date("m"),date("d")+1,date("Y")-1)-1);?>" + ], + "lang->line("datepicker_this_month_last_year"); ?>": [ + "config->item('dateformat'), mktime(0,0,0,date("m"),1,date("Y")-1));?>", + "config->item('dateformat'), mktime(0,0,0,date("m")+1,1,date("Y")-1)-1);?>" + ], + "lang->line("datepicker_last_month"); ?>": [ + "config->item('dateformat'), mktime(0,0,0,date("m")-1,1,date("Y")));?>", + "config->item('dateformat'), mktime(0,0,0,date("m"),1,date("Y"))-1);?>" + ], + "lang->line("datepicker_this_year"); ?>": [ + "config->item('dateformat'), mktime(0,0,0,1,1,date("Y")));?>", + "config->item('dateformat'), mktime(0,0,0,date("m"),1,date("Y")+1)-1);?>" + ], + "lang->line("datepicker_last_year"); ?>": [ + "config->item('dateformat'), mktime(0,0,0,1,1,date("Y")-1));?>", + "config->item('dateformat'), mktime(0,0,0,1,1,date("Y"))-1);?>" + ], + "lang->line("datepicker_all_time"); ?>": [ + "config->item('dateformat'), mktime(0,0,0,01,01,2010));?>", + "config->item('dateformat'), mktime(0,0,0,date("m"),date("d")+1,date("Y"))-1);?>" + ], + }, + "locale": { + "format": 'config->item("dateformat"))?>', + "separator": " - ", + "applyLabel": "lang->line("datepicker_apply"); ?>", + "cancelLabel": "lang->line("datepicker_cancel"); ?>", + "fromLabel": "lang->line("datepicker_from"); ?>", + "toLabel": "lang->line("datepicker_to"); ?>", + "customRangeLabel": "lang->line("datepicker_custom"); ?>", + "daysOfWeek": [ + "lang->line("datepicker_daysmin_sunday"); ?>", + "lang->line("datepicker_daysmin_monday"); ?>", + "lang->line("datepicker_daysmin_tueday"); ?>", + "lang->line("datepicker_daysmin_wednesday"); ?>", + "lang->line("datepicker_daysmin_thursday"); ?>", + "lang->line("datepicker_daysmin_friday"); ?>", + "lang->line("datepicker_daysmin_saturday"); ?>", + "lang->line("datepicker_daysmin_sunday"); ?>" + ], + "monthNames": [ + "lang->line("datepicker_months_january"); ?>", + "lang->line("datepicker_months_february"); ?>", + "lang->line("datepicker_months_march"); ?>", + "lang->line("datepicker_months_april"); ?>", + "lang->line("datepicker_months_may"); ?>", + "lang->line("datepicker_months_june"); ?>", + "lang->line("datepicker_months_july"); ?>", + "lang->line("datepicker_months_august"); ?>", + "lang->line("datepicker_months_september"); ?>", + "lang->line("datepicker_months_october"); ?>", + "lang->line("datepicker_months_november"); ?>", + "lang->line("datepicker_months_december"); ?>" + ], + "firstDay": lang->line("datepicker_weekstart"); ?> + }, + "alwaysShowCalendars": true, + "startDate": "config->item('dateformat'), mktime(0,0,0,date("m"),date("d")+1,date("Y"))-1);?>", + "endDate": "config->item('dateformat'), mktime(0,0,0,date("m"),date("d")+1,date("Y"))-1);?>", + "minDate": "config->item('dateformat'), mktime(0,0,0,01,01,2010));?>", + "maxDate": "config->item('dateformat'), mktime(0,0,0,date("m"),date("d")+1,date("Y"))-1);?>" +}, function(start, end, label) { + start_date = start.format('YYYY-MM-DD'); + end_date = end.format('YYYY-MM-DD'); +}); \ No newline at end of file diff --git a/application/views/partial/footer.php b/application/views/partial/footer.php index 7f0f9922e..b2cdfd0d5 100644 --- a/application/views/partial/footer.php +++ b/application/views/partial/footer.php @@ -1,12 +1,15 @@ +
                - \ No newline at end of file + diff --git a/application/views/partial/header.php b/application/views/partial/header.php index 356840560..73ee7bf7e 100644 --- a/application/views/partial/header.php +++ b/application/views/partial/header.php @@ -4,37 +4,69 @@ <?php echo $this->config->item('company').' -- '.$this->lang->line('common_powered_by').' OS Point Of Sale' ?> - - - - + input->cookie('debug') == "true" || $this->input->get("debug") == "true") : ?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - + + + + + + + - - + + \ No newline at end of file diff --git a/application/views/people/manage.php b/application/views/people/manage.php index bd69b5434..cce9c0e26 100644 --- a/application/views/people/manage.php +++ b/application/views/people/manage.php @@ -1,12 +1,13 @@ load->view("partial/header"); ?> +
                -
                lang->line('common_list_of').' '.$this->lang->line('module_'.$controller_name); ?>
                -
                - ".$this->lang->line($controller_name.'_new')."
                ", - array('class'=>'thickbox none','title'=>$this->lang->line($controller_name.'_new'))); - ?> - - " . $this->lang->line('common_import_excel') . "
                ", - array('class'=>'thickbox none','title'=>'Import Items from Excel')); - ?> - - - - -
                - + + + + " . $this->lang->line('common_import_excel') . "
                ", + array('class'=>'modal-dlg modal-btn-submit', 'title'=>$this->lang->line('customers_import_items_excel'))); ?> + + " . $this->lang->line('customers_new') . "", + array('class'=>'modal-dlg modal-btn-submit', 'title'=>$this->lang->line('customers_new'))); ?> + + " . $this->lang->line($controller_name . '_new') . "", + array('class'=>'modal-dlg modal-btn-submit', 'title'=>$this->lang->line($controller_name . '_new'))); ?> + + +'search_form', 'class'=>'form-horizontal')); ?> +
                +
                +
                  +
                • ' . $this->lang->line("common_delete") . '
                ', array('id'=>'delete')); ?> +
              • lang->line("common_email");?>
              • + +
              • + 'search', 'class'=>'form-control input-sm', 'id'=>'search')); ?> + 'limit_from', 'type'=>'hidden', 'id'=>'limit_from')); ?> +
              • + + +
                + +
                - +
                -
                + load->view("partial/footer"); ?> diff --git a/application/views/receivings/form.php b/application/views/receivings/form.php index c468270d7..ac8ce3f17 100755 --- a/application/views/receivings/form.php +++ b/application/views/receivings/form.php @@ -1,129 +1,133 @@ +
                lang->line('common_fields_required_message'); ?>
                + +
                  +
                  -
                  lang->line('common_fields_required_message'); ?>
                  -
                    -
                    - 'recvs_edit_form')); ?> - lang->line("recvs_basic_information"); ?> - -
                    - lang->line('recvs_receipt_number').':', 'supplier'); ?> -
                    - lang->line('recvs_receipt_number') .$receiving_info['receiving_id'], array('target' => '_blank'));?> + 'recvs_edit_form', 'class'=>'form-horizontal')); ?> +
                    + lang->line('recvs_receipt_number'), 'supplier', array('class'=>'control-label col-xs-3')); ?> +
                    + lang->line('recvs_receipt_number') .$receiving_info['receiving_id'], array('target' => '_blank'));?> +
                    -
                    - -
                    - lang->line('recvs_date').':', 'date'); ?> -
                    - 'date','value'=>date($this->config->item('dateformat') . ' ' . $this->config->item('timeformat'), strtotime($receiving_info['receiving_time'])), 'id'=>'datetime', 'readonly'=>'true'));?> + +
                    + lang->line('recvs_date'), 'date', array('class'=>'control-label col-xs-3')); ?> +
                    + 'date','value'=>date($this->config->item('dateformat') . ' ' . $this->config->item('timeformat'), strtotime($receiving_info['receiving_time'])), 'id'=>'datetime', 'class'=>'form-control input-sm', 'readonly'=>'true'));?> +
                    -
                    - -
                    - lang->line('recvs_supplier').':', 'supplier'); ?> -
                    - 'supplier_id', 'value' => $selected_supplier, 'id' => 'supplier_id'));?> + +
                    + lang->line('recvs_supplier'), 'supplier', array('class'=>'control-label col-xs-3')); ?> +
                    + 'supplier_id', 'value' => $selected_supplier_name, 'id' => 'supplier_id', 'class'=>'form-control input-sm'));?> + +
                    -
                    - -
                    - lang->line('recvs_invoice_number').':', 'invoice_number'); ?> -
                    - 'invoice_number', 'value' => $receiving_info['invoice_number'], 'id' => 'invoice_number'));?> + +
                    + lang->line('recvs_invoice_number'), 'invoice_number', array('class'=>'control-label col-xs-3')); ?> +
                    + 'invoice_number', 'value' => $receiving_info['invoice_number'], 'id' => 'invoice_number', 'class'=>'form-control input-sm'));?> +
                    -
                    - -
                    - lang->line('recvs_employee').':', 'employee'); ?> -
                    - + +
                    + lang->line('recvs_employee'), 'employee', array('class'=>'control-label col-xs-3')); ?> +
                    + +
                    -
                    - -
                    - lang->line('recvs_comments').':', 'comment'); ?> -
                    - 'comment','value'=>$receiving_info['comment'],'rows'=>'4','cols'=>'23', 'id'=>'comment'));?> + +
                    + lang->line('recvs_comments'), 'comment', array('class'=>'control-label col-xs-3')); ?> +
                    + 'comment','value'=>$receiving_info['comment'], 'id'=>'comment', 'class'=>'form-control input-sm'));?> +
                    -
                    + - 'submit', - 'value'=>$this->lang->line('common_submit'), - 'class'=> 'submit_button float_right') - ); - ?> - - - 'recvs_delete_form')); ?> + 'recvs_delete_form')); ?> - 'submit', - 'value'=>$this->lang->line('recvs_delete_entire_sale'), - 'class'=>'delete_button float_right') - ); - ?> - +
                    \ No newline at end of file + diff --git a/application/views/receivings/receipt.php b/application/views/receivings/receipt.php index 5e11b0308..668c4264d 100644 --- a/application/views/receivings/receipt.php +++ b/application/views/receivings/receipt.php @@ -1,27 +1,33 @@ load->view("partial/header"); ?> -load->view('partial/print_receipt', array('print_after_sale', $print_after_sale, - 'selected_printer' => 'receipt_printer')); ?> - '.$error_message.''; + echo "
                    ".$error_message."
                    "; exit; } ?> + +load->view('partial/print_receipt', array('print_after_sale', $print_after_sale, 'selected_printer'=>'receipt_printer')); ?> + + +
                    - Appconfig->get('company_logo') == '') + Appconfig->get('company_logo') == '') { ?> -
                    config->item('company'); ?>
                    +
                    config->item('company'); ?>
                    -
                    company_logo
                    +
                    company_logo
                    @@ -30,19 +36,22 @@ if (isset($error_message))
                    +
                    - -
                    lang->line('suppliers_supplier').": ".$supplier; ?>
                    +
                    lang->line('suppliers_supplier').": ".$supplier; ?>
                    lang->line('recvs_id').": ".$receiving_id; ?>
                    - -
                    lang->line('recvs_invoice_number').": ".$invoice_number; ?>
                    +
                    lang->line('recvs_invoice_number').": ".$invoice_number; ?>
                    @@ -50,75 +59,81 @@ if (isset($error_message))
                    - - - - - - - $item) - { - ?> - - - - - - - - - 0 ) : ?> - - - - - - - - - - - - - - - - - - - - + + + + + $item) + { + ?> + + + + + + + + + + 0 ) + { + ?> + + + + + - - + + - - + + + + + + + + + + + + + + + + + +
                    lang->line('items_item'); ?>lang->line('common_price'); ?>lang->line('sales_quantity'); ?>lang->line('sales_total'); ?>
                       x
                    lang->line("sales_discount_included")?>
                    lang->line('sales_total'); ?>
                    lang->line('sales_payment'); ?>
                    lang->line('sales_amount_tendered'); ?>
                    lang->line('items_item'); ?>lang->line('common_price'); ?>lang->line('sales_quantity'); ?>lang->line('sales_total'); ?>
                       x
                    lang->line("sales_discount_included")?>
                    lang->line('sales_change_due'); ?>
                    lang->line('sales_total'); ?>
                    lang->line('sales_payment'); ?>
                    lang->line('sales_amount_tendered'); ?>
                    lang->line('sales_change_due'); ?>
                    config->item('return_policy')); ?>
                    +

                    + load->view("partial/footer"); ?> diff --git a/application/views/receivings/receiving.php b/application/views/receivings/receiving.php index 6f7ef3154..f7b517ee2 100644 --- a/application/views/receivings/receiving.php +++ b/application/views/receivings/receiving.php @@ -1,374 +1,369 @@ load->view("partial/header"); ?> -
                    lang->line('recvs_register'); ?>
                    - ".$error.""; + echo "
                    ".$error."
                    "; } ?> - -
                    - 'mode_form')); ?> - lang->line('recvs_mode') ?> - + + + + 'mode_form', 'class'=>'form-horizontal panel panel-default')); ?> +
                    +
                      +
                    • + +
                    • +
                    • + "$('#mode_form').submit();", 'class'=>'selectpicker show-menu-arrow', 'data-style'=>'btn-default btn-sm', 'data-width'=>'fit')); ?> +
                    • + + +
                    • + +
                    • +
                    • + "$('#mode_form').submit();", 'class'=>'selectpicker show-menu-arrow', 'data-style'=>'btn-default btn-sm', 'data-width'=>'fit')); ?> +
                    • + + +
                    • + +
                    • +
                    • + "$('#mode_form').submit();", 'class'=>'selectpicker show-menu-arrow', 'data-style'=>'btn-default btn-sm', 'data-width'=>'fit')); ?> +
                    • + +
                    +
                    + + + 'add_item_form', 'class'=>'form-horizontal panel panel-default')); ?> +
                    +
                      +
                    • + +
                    • +
                    • + 'item', 'id'=>'item', 'class'=>'form-control input-sm', 'size'=>'50', 'tabindex'=>'1')); ?> +
                    • +
                    • + lang->line('sales_new_item'), + array('class'=>'btn btn-info btn-sm modal-dlg modal-btn-new modal-btn-submit', 'id'=>'new_item_button', 'title'=>$this->lang->line('sales_new_item'))); ?> +
                    • +
                    +
                    + - - lang->line('recvs_stock_source') ?> - - - lang->line('recvs_stock_destination') ?> - - - 'add_item_form')); ?> - -'item','id'=>'item','size'=>'40'));?> -
                    - ".$this->lang->line('sales_new_item')."
                    ", - array('class'=>'thickbox none','title'=>$this->lang->line('sales_new_item'))); - ?> -
                    - - - - - - - - - - - - - - - - - - - -$item) - { - echo form_open("receivings/edit_item/$line"); - -?> - - - +
                    lang->line('common_delete'); ?>lang->line('recvs_item_name'); ?>lang->line('recvs_cost'); ?>lang->line('recvs_quantity'); ?>lang->line('recvs_discount'); ?>lang->line('recvs_total'); ?>lang->line('recvs_edit'); ?>
                    -
                    lang->line('sales_no_items_in_cart'); ?>
                    -
                    lang->line('common_delete').']');?>
                    [ in ] -
                    + + + + + + + + + + + + - - - - - - - - + - - - + + + + - - - - - - - - - - - - - - $item) + { ?> - - - + + + + + + + + + + + 1) + { + ?> + + + + + + + + + + + + + + + + + + + + + + 'description','value'=>$item['description'],'size'=>'20')); - } - else - { - if ($item['description']!='') - { - echo $item['description']; - echo form_hidden('description',$item['description']); - } - else - { - echo $this->lang->line('sales_no_description'); - echo form_hidden('description',''); - } - } + } + } ?> - - - - - - -
                    lang->line('common_delete'); ?>lang->line('recvs_item_name'); ?>lang->line('recvs_cost'); ?>lang->line('recvs_quantity'); ?>lang->line('recvs_discount'); ?>lang->line('recvs_total'); ?>lang->line('recvs_update'); ?>
                    'price','value'=>$item['price'],'size'=>'6'));?> - 'quantity','value'=>$item['quantity'],'size'=>'2')); - if ($item['receiving_quantity'] > 1) +
                    x
                    +
                    lang->line('sales_no_items_in_cart'); ?>
                    +
                    'discount','value'=>$item['discount'],'size'=>'3'));?>lang->line('sales_edit_item'));?>
                    lang->line('sales_description_abbrv').':';?> - + 'form-horizontal', 'id'=>'cart_'.$line)); ?> +
                    ');?> +
                    + +
                    'price', 'class'=>'form-control input-sm', 'value'=>to_currency_no_money($item['price'])));?> + + + 'quantity', 'class'=>'form-control input-sm', 'value'=>to_quantity_decimals($item['quantity']))); ?>'discount', 'class'=>'form-control input-sm', 'value'=>$item['discount']));?>lang->line('recvs_update')?> >
                    lang->line('sales_description_abbrv').':';?> + 'description', 'class'=>'form-control input-sm', 'value'=>$item['description'])); + } + else + { + if ($item['description']!='') + { + echo $item['description']; + echo form_hidden('description',$item['description']); + } + else + { + echo $this->lang->line('sales_no_description'); + echo form_hidden('description',''); + } + } + ?> +
                    + + -
                    - lang->line("recvs_supplier").': '.$supplier. '
                    '; - echo anchor("receivings/delete_supplier",'['.$this->lang->line('common_delete').' '.$this->lang->line('suppliers_supplier').']'); - } - else - { - echo form_open("receivings/select_supplier",array('id'=>'select_supplier_form')); ?> - - 'supplier','id'=>'supplier','size'=>'30','value'=>$this->lang->line('recvs_start_typing_supplier_name')));?> - -
                    -

                    lang->line('common_or'); ?>

                    - ".$this->lang->line('recvs_new_supplier')."
                    ", - array('class'=>'thickbox none','title'=>$this->lang->line('recvs_new_supplier'))); - ?> -
                    -
                     
                    +
                    +
                    - - -
                    -
                    lang->line('sales_total'); ?>:
                    -
                    -
                    - - 0) - { - if($mode == 'requisition') + if(isset($supplier)) { - ?> - -
                    -
                    - 'finish_receiving_form')); ?> -
                    - - 'comment','id'=>'comment','value'=>$comment,'rows'=>'4','cols'=>'23'));?> -

                    - -
                    - lang->line('recvs_complete_receiving') ?> -
                    - - 'cancel_receiving_form')); ?> -
                    - lang->line('recvs_cancel_receiving')?> -
                    - -
                    - -
                    - 'finish_receiving_form')); ?> -
                    - - 'comment','id'=>'comment','value'=>$comment,'rows'=>'4','cols'=>'23'));?> -

                    - - - - - - - - - - - - - - - - - - - - - - - -
                    - lang->line('recvs_print_after_sale'); ?> - - 'recv_print_after_sale','id'=>'recv_print_after_sale','checked'=>'checked')); - } - else - { - echo form_checkbox(array('name'=>'recv_print_after_sale','id'=>'recv_print_after_sale')); - } - ?> -
                    - lang->line('recvs_invoice_enable'); ?> - - 'recv_invoice_enable','id'=>'recv_invoice_enable','size'=>10,'checked'=>'checked')); + echo $this->lang->line("recvs_supplier").': '.$supplier. '
                    '; + echo anchor("receivings/delete_supplier",'['.$this->lang->line('common_delete').' '.$this->lang->line('suppliers_supplier').']'); } else { - echo form_checkbox(array('name'=>'recv_invoice_enable','id'=>'recv_invoice_enable','size'=>10)); - } ?> -
                    - lang->line('recvs_invoice_number').': ';?> - - 'recv_invoice_number','id'=>'recv_invoice_number','value'=>$invoice_number,'size'=>10));?> -
                    - lang->line('sales_payment').': ';?> - - -
                    - lang->line('sales_amount_tendered').': ';?> - - 'amount_tendered','value'=>'','size'=>'10')); - ?> -
                    -
                    -
                    - lang->line('recvs_complete_receiving') ?> -
                    - - - - 'cancel_receiving_form')); ?> -
                    - lang->line('recvs_cancel_receiving')?> + 'select_supplier_form', 'class'=>'form-horizontal')); ?> +
                    + + 'supplier', 'id'=>'supplier', 'class'=>'form-control input-sm', 'value'=>$this->lang->line('recvs_start_typing_supplier_name'))); ?> + + lang->line('recvs_new_supplier'), + array('class'=>'btn btn-info btn-sm modal-dlg modal-btn-submit none', 'id'=>'new_supplier_button', 'title'=>$this->lang->line('recvs_new_supplier'))); ?>
                    - -
                    - + + + + + + + + + + + + +
                    lang->line('sales_total'); ?>
                    + + 0) + { + ?> +
                    + + 'finish_receiving_form', 'class'=>'form-horizontal')); ?> +
                    + + 'comment', 'id'=>'comment', 'class'=>'form-control input-sm', 'value'=>$comment, 'rows'=>'4')); ?> + +
                    lang->line('recvs_cancel_receiving'); ?>
                    + +
                    lang->line('recvs_complete_receiving'); ?>
                    +
                    + + + 'finish_receiving_form', 'class'=>'form-horizontal')); ?> +
                    + + 'comment', 'id'=>'comment', 'class'=>'form-control input-sm', 'value'=>$comment, 'rows'=>'4'));?> + + + + + + + + + + + + + + + + + + + + + + + + + + +
                    lang->line('recvs_print_after_sale'); ?> + 'recv_print_after_sale', 'id'=>'recv_print_after_sale', 'class'=>'checkbox', 'value'=>1, 'checked'=>$print_after_sale)); ?> +
                    lang->line('recvs_invoice_enable'); ?> + 'recv_invoice_enable', 'id'=>'recv_invoice_enable', 'class'=>'checkbox', 'value'=>1, 'checked'=>$invoice_number_enabled)); ?> +
                    lang->line('recvs_invoice_number');?> + 'recv_invoice_number', 'id'=>'recv_invoice_number', 'class'=>'form-control input-sm', 'value'=>$invoice_number, 'size'=>5));?> +
                    lang->line('sales_payment'); ?> + 'payment_types', 'class'=>'selectpicker show-menu-arrow', 'data-style'=>'btn-default btn-sm', 'data-width'=>'auto')); ?> +
                    lang->line('sales_amount_tendered'); ?> + 'amount_tendered', 'value'=>'', 'class'=>'form-control input-sm', 'size'=>'5')); ?> +
                    + +
                    lang->line('recvs_cancel_receiving') ?>
                    + +
                    lang->line('recvs_complete_receiving') ?>
                    +
                    + + +
                    + +
                    -
                     
                    -load->view("partial/footer"); ?> \ No newline at end of file + +load->view("partial/footer"); ?> diff --git a/application/views/reports/date_input.php b/application/views/reports/date_input.php index 520df7bfc..8fede009a 100644 --- a/application/views/reports/date_input.php +++ b/application/views/reports/date_input.php @@ -1,131 +1,98 @@ load->view("partial/header"); ?> -
                    lang->line('reports_report_input'); ?>
                    + +
                    lang->line('reports_report_input'); ?>
                    + ".$error."
                    "; + echo "
                    ".$error."
                    "; } ?> - lang->line('reports_date_range'), 'report_date_range_label', array('class'=>'required')); ?> -
                    - - + +'item_form', 'enctype'=>'multipart/form-data', 'class'=>'form-horizontal')); ?> +
                    + lang->line('reports_date_range'), 'report_date_range_label', array('class'=>'control-label col-xs-2 required')); ?> +
                    + 'daterangepicker', 'class'=>'form-control input-sm', 'id'=>'daterangepicker')); ?> +
                    - -
                    - - - - - - - - - - - - -
                    - - lang->line('reports_discount_prefix') .' ' .form_input(array( - 'name'=>'selected_discount', - 'id'=>'selected_discount', - 'value'=>'0')). ' '. $this->lang->line('reports_discount_suffix') - ?> - + +
                    + + lang->line('reports_sale_type'), 'reports_sale_type_label', array('class'=>'required control-label col-xs-2')); ?> +
                    + $this->lang->line('reports_all'), + 'sales' => $this->lang->line('reports_sales'), + 'returns' => $this->lang->line('reports_returns')), 'all', array('id'=>'input_type', 'class'=>'form-control')); ?>
                    - + lang->line('reports_receiving_type'), 'reports_receiving_type_label', array('class'=>'required control-label col-xs-2')); ?> +
                    + $this->lang->line('reports_all'), + 'receiving' => $this->lang->line('reports_receivings'), + 'returns' => $this->lang->line('reports_returns'), + 'requisitions' => $this->lang->line('reports_requisitions')), 'all', array('id'=>'input_type', 'class'=>'form-control')); ?> +
                    +
                    - - - lang->line('reports_sale_type'), 'reports_sale_type_label', array('class'=>'required')); ?> -
                    - $this->lang->line('reports_all'), - 'sales' => $this->lang->line('reports_sales'), - 'returns' => $this->lang->line('reports_returns')), 'all', 'id="input_type"'); ?> -
                    - - lang->line('reports_receiving_type'), 'reports_receiving_type_label', array('class'=>'required')); ?> -
                    - $this->lang->line('reports_all'), - 'receiving' => $this->lang->line('reports_receivings'), - 'returns' => $this->lang->line('reports_returns'), - 'requisitions' => $this->lang->line('reports_requisitions')), 'all', 'id="input_type"'); ?> -
                    - 1) { - ?> - lang->line('reports_stock_location'), 'reports_stock_location_label', array('class'=>'required')); ?> -
                    - + ?> +
                    + lang->line('reports_stock_location'), 'reports_stock_location_label', array('class'=>'required control-label col-xs-2')); ?> +
                    + 'location_id', 'class'=>'form-control')); ?> +
                    - -'generate_report', - 'id'=>'generate_report', - 'content'=>$this->lang->line('common_submit'), - 'class'=>'submit_button') -); -?> + ?> + + 'generate_report', + 'id'=>'generate_report', + 'content'=>$this->lang->line('common_submit'), + 'class'=>'btn btn-primary btn-sm') + ); + ?> + load->view("partial/footer"); ?> \ No newline at end of file diff --git a/application/views/reports/date_input_excel_export.php b/application/views/reports/date_input_excel_export.php index 951258a52..18aa4d17a 100644 --- a/application/views/reports/date_input_excel_export.php +++ b/application/views/reports/date_input_excel_export.php @@ -1,85 +1,75 @@ load->view("partial/header"); ?> -
                    lang->line('reports_report_input'); ?>
                    + +
                    lang->line('reports_report_input'); ?>
                    + ".$error."
                    "; + echo "
                    ".$error."
                    "; } ?> - lang->line('reports_date_range'), 'report_date_range_label', array('class'=>'required')); ?> -
                    - - -
                    - -
                    - - - - - - - - - -
                    - - lang->line('reports_sale_type'), 'reports_sale_type_label', array('class'=>'required')); ?> -
                    - $this->lang->line('reports_all'), - 'sales' => $this->lang->line('reports_sales'), - 'returns' => $this->lang->line('reports_returns')), 'all', 'id="sale_type"'); ?> -
                    - -
                    - Export to Excel: Yes - No + +'item_form', 'enctype'=>'multipart/form-data', 'class'=>'form-horizontal')); ?> +
                    + lang->line('reports_date_range'), 'report_date_range_label', array('class'=>'control-label col-xs-2 required')); ?> +
                    + 'daterangepicker', 'class'=>'form-control input-sm', 'id'=>'daterangepicker')); ?> +
                    -'generate_report', - 'id'=>'generate_report', - 'content'=>$this->lang->line('common_submit'), - 'class'=>'submit_button') -); -?> +
                    + lang->line('reports_sale_type'), 'reports_sale_type_label', array('class'=>'required control-label col-xs-2')); ?> +
                    + $this->lang->line('reports_all'), + 'sales' => $this->lang->line('reports_sales'), + 'returns' => $this->lang->line('reports_returns')), 'all', array('id'=>'input_type', 'class'=>'form-control')); ?> +
                    +
                    + +
                    + lang->line('common_export_excel'), 'export_excel', !empty($basic_version) ? array('class'=>'control-label required col-xs-3') : array('class'=>'control-label col-xs-2')); ?> +
                    + + +
                    +
                    + + 'generate_report', + 'id'=>'generate_report', + 'content'=>$this->lang->line('common_submit'), + 'class'=>'btn btn-primary btn-sm') + ); + ?> + load->view("partial/footer"); ?> \ No newline at end of file diff --git a/application/views/reports/excel_export.php b/application/views/reports/excel_export.php index ab628c26a..101fd55f8 100644 --- a/application/views/reports/excel_export.php +++ b/application/views/reports/excel_export.php @@ -1,24 +1,36 @@ load->view("partial/header"); ?> -
                    lang->line('reports_report_input'); ?>
                    + +
                    lang->line('reports_report_input'); ?>
                    + ".$error."
                    "; + echo "
                    ".$error."
                    "; } ?> -
                    - Export to Excel: Yes - No + +'item_form', 'enctype'=>'multipart/form-data', 'class'=>'form-horizontal')); ?> +
                    + lang->line('common_export_excel'), 'export_excel', !empty($basic_version) ? array('class'=>'control-label required col-xs-3') : array('class'=>'control-label col-xs-2')); ?> +
                    + + +
                    'generate_report', - 'id'=>'generate_report', - 'content'=>$this->lang->line('common_submit'), - 'class'=>'submit_button') -); + echo form_button(array( + 'name'=>'generate_report', + 'id'=>'generate_report', + 'content'=>$this->lang->line('common_submit'), + 'class'=>'btn btn-primary btn-sm') + ); ?> + load->view("partial/footer"); ?> diff --git a/application/views/reports/graphical.php b/application/views/reports/graphical.php index 847f70505..46d66d336 100644 --- a/application/views/reports/graphical.php +++ b/application/views/reports/graphical.php @@ -1,26 +1,28 @@ -load->view("partial/header"); -?> -
                    -
                    +load->view("partial/header"); ?> + +
                    + +
                    +
                    - - +
                    +
                    +
                    -$value) { ?> -
                    lang->line('reports_'.$name). ': '.to_currency($value); ?>
                    - + $value) + { + ?> +
                    lang->line('reports_'.$name). ': ' . to_currency($value); ?>
                    +
                    -load->view("partial/footer"); -?> \ No newline at end of file + +load->view("partial/footer"); ?> \ No newline at end of file diff --git a/application/views/reports/inventory_summary_input.php b/application/views/reports/inventory_summary_input.php index 7fc1db563..3588574ee 100644 --- a/application/views/reports/inventory_summary_input.php +++ b/application/views/reports/inventory_summary_input.php @@ -1,34 +1,50 @@ load->view("partial/header"); ?> -
                    lang->line('reports_report_input'); ?>
                    + +
                    lang->line('reports_report_input'); ?>
                    + ".$error."
                    "; + echo "
                    ".$error."
                    "; } ?> -
                    - Export to Excel: Yes - No -
                    - - lang->line('reports_stock_location'), 'reports_stock_location_label', array('class'=>'required')); ?> -
                    - + +'item_form', 'enctype'=>'multipart/form-data', 'class'=>'form-horizontal')); ?> +
                    + lang->line('common_export_excel'), 'export_excel', !empty($basic_version) ? array('class'=>'control-label required col-xs-3') : array('class'=>'control-label col-xs-2')); ?> +
                    + + +
                    - lang->line('reports_item_count'), 'reports_item_count_label', array('class'=>'required')); ?> -
                    - +
                    + lang->line('reports_stock_location'), 'reports_stock_location_label', array('class'=>'required control-label col-xs-2')); ?> +
                    + +
                    -'generate_report', - 'id'=>'generate_report', - 'content'=>$this->lang->line('common_submit'), - 'class'=>'submit_button') -); -?> +
                    + lang->line('reports_item_count'), 'reports_item_count_label', array('class'=>'required control-label col-xs-2')); ?> +
                    + +
                    +
                    + + 'generate_report', + 'id'=>'generate_report', + 'content'=>$this->lang->line('common_submit'), + 'class'=>'btn btn-primary btn-sm') + ); + ?> + load->view("partial/footer"); ?> diff --git a/application/views/reports/listing.php b/application/views/reports/listing.php index a1376123a..e6e5167bb 100644 --- a/application/views/reports/listing.php +++ b/application/views/reports/listing.php @@ -1,8 +1,14 @@ load->view("partial/header"); ?> -
                    lang->line('reports_reports'); ?>
                    -
                    lang->line('reports_welcome_message'); ?> + +".$error."
                    "; +} +?> +
                      -
                    • lang->line('reports_graphical_reports'); ?>

                      +
                    • lang->line('reports_graphical_reports'); ?>

                        -
                      • lang->line('reports_summary_reports'); ?>

                        +
                      • lang->line('reports_summary_reports'); ?>

                          -
                        • lang->line('reports_detailed_reports'); ?>

                          +
                        • lang->line('reports_detailed_reports'); ?>

                            session->userdata('person_id'); @@ -46,7 +52,7 @@ if ($this->Employee->has_grant('reports_inventory', $this->session->userdata('person_id'))) { ?> -
                          • lang->line('reports_inventory_reports'); ?>

                            +
                          • lang->line('reports_inventory_reports'); ?>

                            -".$error."
                    "; -} -?> + load->view("partial/footer"); ?> \ No newline at end of file diff --git a/application/views/reports/specific_input.php b/application/views/reports/specific_input.php index 3e65bb2cb..3d4e10913 100644 --- a/application/views/reports/specific_input.php +++ b/application/views/reports/specific_input.php @@ -1,92 +1,82 @@ load->view("partial/header"); ?> -
                    lang->line('reports_report_input'); ?>
                    + +
                    lang->line('reports_report_input'); ?>
                    + ".$error."
                    "; + echo "
                    ".$error."
                    "; } ?> - lang->line('reports_date_range'), 'report_date_range_label', array('class'=>'required')); ?> -
                    - - -
                    - -
                    - - - - - - - - - -
                    - - 'required')); ?> - -
                    - -
                    - - lang->line('reports_sale_type'), 'reports_sale_type_label', array('class'=>'required')); ?> -
                    - $this->lang->line('reports_all'), - 'sales' => $this->lang->line('reports_sales'), - 'returns' => $this->lang->line('reports_returns')) , 'all', 'id="sale_type"'); ?> -
                    - -
                    - Export to Excel: Yes - No + +'item_form', 'enctype'=>'multipart/form-data', 'class'=>'form-horizontal')); ?> +
                    + lang->line('reports_date_range'), 'report_date_range_label', array('class'=>'control-label col-xs-2 required')); ?> +
                    + 'daterangepicker', 'class'=>'form-control input-sm', 'id'=>'daterangepicker')); ?> +
                    -'generate_report', - 'id'=>'generate_report', - 'content'=>$this->lang->line('common_submit'), - 'class'=>'submit_button') -); -?> +
                    + 'required control-label col-xs-2')); ?> +
                    + +
                    +
                    + +
                    + lang->line('reports_sale_type'), 'reports_sale_type_label', array('class'=>'required control-label col-xs-2')); ?> +
                    + $this->lang->line('reports_all'), + 'sales' => $this->lang->line('reports_sales'), + 'returns' => $this->lang->line('reports_returns')), 'all', 'id="input_type" class="form-control"'); ?> +
                    +
                    + +
                    + lang->line('common_export_excel'), 'export_excel', !empty($basic_version) ? array('class'=>'control-label required col-xs-3') : array('class'=>'control-label col-xs-2')); ?> +
                    + + +
                    +
                    + + 'generate_report', + 'id'=>'generate_report', + 'content'=>$this->lang->line('common_submit'), + 'class'=>'btn btn-primary btn-sm') + ); + ?> + load->view("partial/footer"); ?> \ No newline at end of file diff --git a/application/views/reports/tabular.php b/application/views/reports/tabular.php index 41643227b..305c0576d 100644 --- a/application/views/reports/tabular.php +++ b/application/views/reports/tabular.php @@ -1,41 +1,70 @@ load->view("partial/header_excel"); -}else{ - $this->load->view("partial/header"); -} + //OJB: Check if for excel export process + if($export_excel == 1) + { + ob_start(); + $this->load->view("partial/header_excel"); + } + else + { + $this->load->view("partial/header"); + } ?> -
                    -
                    + +
                    + +
                    +
                    - - - + + + - - - - - - - + + + + + + +
                    +
                    -$value) { ?> -
                    lang->line('reports_'.$name). ': '.to_currency($value); ?>
                    - + $value) + { + ?> +
                    lang->line('reports_'.$name). ': '.to_currency($value); ?>
                    +
                    + load->view("partial/footer_excel"); $content = ob_end_flush(); @@ -45,26 +74,27 @@ if($export_excel == 1){ header('Content-type: application/ms-excel'); header('Content-Disposition: attachment; filename='.$filename); echo $content; + die(); - -}else{ +} +else +{ $this->load->view("partial/footer"); ?> - - + $(document).ready(function() + { + init_table_sorting(); + }); + \ No newline at end of file diff --git a/application/views/reports/tabular_details.php b/application/views/reports/tabular_details.php index 4d8aef4df..1d57668d0 100644 --- a/application/views/reports/tabular_details.php +++ b/application/views/reports/tabular_details.php @@ -1,71 +1,110 @@ load->view("partial/header_excel"); -}else{ - $this->load->view("partial/header"); -} + // Check if for excel export process + if($export_excel == 1) + { + ob_start(); + $this->load->view("partial/header_excel"); + } + else + { + $this->load->view("partial/header"); + } ?> -
                    -
                    + +
                    + +
                    +
                    - - - + + + - $row) { ?> - - - - - - - - + +
                    +
                    +
                    - - - - - - - - - - - + $row) + { + ?> + + + + + + + + - - + + + + + + + + + + + +
                    +
                    + + - - - + + + - - -
                    -
                    +
                    +
                    -$value) { ?> -
                    lang->line('reports_'.$name). ': '.to_currency($value); ?>
                    - + $value) + { + ?> +
                    lang->line('reports_'.$name). ': '.to_currency($value); ?>
                    +
                    - -
                    - - load->view("partial/footer_excel"); $content = ob_end_flush(); @@ -76,79 +115,80 @@ if($export_excel == 1){ header('Content-Disposition: attachment; filename='.$filename); echo $content; die(); - -}else{ +} +else +{ $this->load->view("partial/footer"); ?> - + \ No newline at end of file diff --git a/application/views/sales/form.php b/application/views/sales/form.php index 0113bfb49..cbfe35975 100755 --- a/application/views/sales/form.php +++ b/application/views/sales/form.php @@ -1,76 +1,63 @@ +
                    lang->line('common_fields_required_message'); ?>
                    + +
                      +
                      -
                      lang->line('common_fields_required_message'); ?>
                      -
                        -
                        - 'sales_edit_form')); ?> - lang->line("sales_basic_information"); ?> - -
                        - lang->line('sales_receipt_number').':', 'customer'); ?> -
                        - lang->line('sales_receipt_number') .$sale_info['sale_id'], array('target' => '_blank'));?> + 'sales_edit_form', 'class'=>'form-horizontal')); ?> +
                        + lang->line('sales_receipt_number'), 'receipt_number', array('class'=>'control-label col-xs-3')); ?> +
                        + lang->line('sales_receipt_number') .$sale_info['sale_id'], array('target' => '_blank'));?> +
                        -
                        - -
                        - lang->line('sales_date').':', 'date'); ?> -
                        - 'date','value'=>date($this->config->item('dateformat') . ' ' . $this->config->item('timeformat'), strtotime($sale_info['sale_time'])), 'id'=>'datetime', 'readonly'=>'true'));?> + +
                        + lang->line('sales_date'), 'date', array('class'=>'control-label col-xs-3')); ?> +
                        + 'date','value'=>date($this->config->item('dateformat') . ' ' . $this->config->item('timeformat'), strtotime($sale_info['sale_time'])), 'id'=>'datetime', 'class'=>'form-control input-sm', 'readonly'=>'true'));?> +
                        -
                        - -
                        - lang->line('sales_invoice_number').':', 'invoice_number'); ?> -
                        - - 'invoice_number', 'size'=>10, 'value'=>$sale_info['invoice_number'], 'id'=>'invoice_number'));?> - lang->line('sales_send_invoice')?> - - 'invoice_number', 'value'=>$sale_info['invoice_number'], 'id'=>'invoice_number'));?> - + +
                        + lang->line('sales_invoice_number'), 'invoice_number', array('class'=>'control-label col-xs-3')); ?> +
                        + + 'invoice_number', 'size'=>10, 'value'=>$sale_info['invoice_number'], 'id'=>'invoice_number', 'class'=>'form-control input-sm'));?> + lang->line('sales_send_invoice');?> + + 'invoice_number', 'value'=>$sale_info['invoice_number'], 'id'=>'invoice_number', 'class'=>'form-control input-sm'));?> + +
                        -
                        - -
                        - lang->line('sales_customer').':', 'customer'); ?> -
                        - 'customer_id', 'value' => $selected_customer, 'id' => 'customer_id'));?> + +
                        + lang->line('sales_customer'), 'customer', array('class'=>'control-label col-xs-3')); ?> +
                        + 'customer_name', 'value' => $selected_customer_name, 'id' => 'customer_name', 'class'=>'form-control input-sm'));?> + +
                        -
                        - -
                        - lang->line('sales_employee').':', 'employee'); ?> -
                        - + +
                        + lang->line('sales_employee'), 'employee', array('class'=>'control-label col-xs-3')); ?> +
                        + +
                        -
                        - -
                        - lang->line('sales_comment').':', 'comment'); ?> -
                        - 'comment', 'value'=>$sale_info['comment'], 'rows'=>'4','cols'=>'23', 'id'=>'comment'));?> + +
                        + lang->line('sales_comment'), 'comment', array('class'=>'control-label col-xs-3')); ?> +
                        + 'comment', 'value'=>$sale_info['comment'], 'id'=>'comment', 'class'=>'form-control input-sm'));?> +
                        -
                        + - 'submit', - 'value'=>$this->lang->line('common_submit'), - 'class'=> 'submit_button float_right') - ); - ?> - - - 'sales_delete_form')); ?> + 'sales_delete_form')); ?> - 'submit', - 'value'=>$this->lang->line('sales_delete_entire_sale'), - 'class'=>'delete_button float_right') - ); - ?> - +
                        @@ -80,9 +67,9 @@ $(document).ready(function() $("#send_invoice").click(function(event) { if (confirm("lang->line('sales_invoice_confirm') . ' ' . $sale_info['email'] ?>")) { - $.get('', + $.get('', function(response) { - tb_remove(); + dialog_support.hide(); post_form_submit(response); }, "json" ); @@ -90,63 +77,76 @@ $(document).ready(function() }); + load->view('partial/datepicker_locale'); ?> + $('#datetime').datetimepicker({ - dateFormat: 'config->item("dateformat"));?>', - timeFormat: 'config->item("timeformat"));?>' + format: "config->item("dateformat")) . ' ' . dateformat_bootstrap($this->config->item("timeformat"));?>", + startDate: "config->item('dateformat') . ' ' . $this->config->item('timeformat'), mktime(0, 0, 0, 1, 1, 2010));?>", + config->item('timeformat'); + $m = $t[strlen($t)-1]; + if( strpos($this->config->item('timeformat'), 'a') !== false || strpos($this->config->item('timeformat'), 'A') !== false ) + { + ?> + showMeridian: true, + + showMeridian: false, + + minuteStep: 1, + autoclose: true, + todayBtn: true, + todayHighlight: true, + bootcssVer: 3, + language: "config->item('language'); ?>" }); - var format_item = function(row) - { - var result = [row[0], "|", row[1]].join(""); - // if more than one occurence - if (row[2] > 1 && row[3] && row[3].toString().trim()) { - // display zip code - result += ' - ' + row[3]; - } - return result; + var fill_value = function(event, ui) { + event.preventDefault(); + $("input[name='customer_id']").val(ui.item.value); + $("input[name='customer_name']").val(ui.item.label); }; - var autocompleter = $("#customer_id").autocomplete('', + var autocompleter = $("#customer_id").autocomplete( { + source: '', minChars: 0, delay: 15, - max: 100, cacheLength: 1, - formatItem: format_item, - formatResult : format_item + appendTo: '.modal-content', + select: fill_value, + focus: fill_value }); - // declare submitHandler as an object.. will be reused - var submit_form = function(selected_customer) + var submit_form = function() { $(this).ajaxSubmit( { success: function(response) { - tb_remove(); + dialog_support.hide(); post_form_submit(response); }, error: function(jqXHR, textStatus, errorThrown) { - selected_customer && autocompleter.val(selected_customer); post_form_submit({message: errorThrown}); }, dataType: 'json' }); }; - $('#sales_edit_form').validate( + $('#sales_edit_form').validate($.extend( { submitHandler : function(form) { - var selected_customer = autocompleter.val(); - var selected_customer_id = selected_customer.replace(/(\w)\|.*/, "$1"); - selected_customer_id && autocompleter.val(selected_customer_id); - submit_form.call(form, selected_customer); + submit_form.call(form); }, - errorLabelContainer: "#error_message_box", - wrapper: "li", - rules: + rules: { invoice_number: { @@ -169,7 +169,7 @@ $(document).ready(function() { invoice_number: 'lang->line("sales_invoice_number_duplicate"); ?>' } - }); + }, dialog_support.error)); $('#sales_delete_form').submit(function() { @@ -179,8 +179,8 @@ $(document).ready(function() $(this).ajaxSubmit({ success: function(response) { - tb_remove(); - set_feedback(response.message,'success_message',false); + dialog_support.hide(); + set_feedback(response.message, 'alert alert-dismissible alert-success', false); var $element = get_table_row(id).parent().parent(); $element.find("td").animate({backgroundColor:"green"},1200,"linear") .end().animate({opacity:0},1200,"linear",function() @@ -192,7 +192,7 @@ $(document).ready(function() }); }, error: function(jqXHR, textStatus, errorThrown) { - set_feedback(textStatus,'error_message',true); + set_feedback(textStatus, 'alert alert-dismissible alert-danger', true); }, dataType:'json' }); @@ -200,4 +200,4 @@ $(document).ready(function() return false; }); }); - \ No newline at end of file + diff --git a/application/views/sales/invoice.php b/application/views/sales/invoice.php index 5704a2268..9c3b0333d 100755 --- a/application/views/sales/invoice.php +++ b/application/views/sales/invoice.php @@ -1,4 +1,5 @@ load->view("partial/header"); ?> + load->view('partial/print_receipt', array('print_after_sale'=>$print_after_sale, 'selected_printer'=>'invoice_printer')); ?> -", - array('id'=>'show_sales_button')); ?> - ".$this->lang->line('sales_takings')."
                        ", - array('id'=>'show_takings_button')); ?> +
                        @@ -48,8 +47,6 @@ if (isset($error_message)) ?>
                        - -
                        @@ -85,7 +82,7 @@ if (isset($error_message)) - + @@ -141,7 +138,7 @@ if (isset($error_message))
                        -load->view("partial/footer"); ?> \ No newline at end of file + +load->view("partial/footer"); ?> diff --git a/application/views/sales/suspended.php b/application/views/sales/suspended.php index 8fecd9c43..2d43c9ca7 100644 --- a/application/views/sales/suspended.php +++ b/application/views/sales/suspended.php @@ -1,46 +1,47 @@ - - - - - - - - - - - - - - - - - +
                        lang->line('sales_suspended_sale_id'); ?>lang->line('sales_date'); ?>lang->line('sales_customer'); ?>lang->line('sales_comments'); ?>lang->line('sales_unsuspend_and_delete'); ?>
                        config->item('dateformat'),strtotime($suspended_sale['sale_time']));?> - Customer->get_info($suspended_sale['customer_id']); - echo $customer->first_name. ' '. $customer->last_name; - } - else - { - ?> -   - - - -
                        + + + + + + + - - + + + + + + + + + + + +
                        lang->line('sales_suspended_sale_id'); ?>lang->line('sales_date'); ?>lang->line('sales_customer'); ?>lang->line('sales_comments'); ?>lang->line('sales_unsuspend_and_delete'); ?>
                        config->item('dateformat'), strtotime($suspended_sale['sale_time']));?> + Customer->get_info($suspended_sale['customer_id']); + echo $customer->first_name. ' '. $customer->last_name; + } + else + { + ?> +   + + + + + +
                        \ No newline at end of file diff --git a/application/views/suppliers/form.php b/application/views/suppliers/form.php index 4b7b52fc4..45a2760cf 100644 --- a/application/views/suppliers/form.php +++ b/application/views/suppliers/form.php @@ -1,77 +1,67 @@ -person_id,array('id'=>'supplier_form')); -?>
                        lang->line('common_fields_required_message'); ?>
                        +
                          -
                          -lang->line("suppliers_basic_information"); ?> -
                          -lang->line('suppliers_company_name').':', 'company_name', array('class'=>'required')); ?> -
                          - 'company_name', - 'id'=>'company_name_input', - 'value'=>$person_info->company_name) - );?> -
                          -
                          +person_id, array('id'=>'supplier_form', 'class'=>'form-horizontal')); ?> +
                          +
                          + lang->line('suppliers_company_name'), 'company_name', array('class'=>'required control-label col-xs-3')); ?> +
                          + 'company_name', + 'id'=>'company_name_input', + 'class'=>'form-control input-sm', + 'value'=>$person_info->company_name) + );?> +
                          +
                          -
                          -lang->line('suppliers_agency_name').':', 'agency_name'); ?> -
                          - 'agency_name', - 'id'=>'agency_name_input', - 'value'=>$person_info->agency_name) - );?> -
                          -
                          +
                          + lang->line('suppliers_agency_name'), 'agency_name', array('class'=>'control-label col-xs-3')); ?> +
                          + 'agency_name', + 'id'=>'agency_name_input', + 'class'=>'form-control input-sm', + 'value'=>$person_info->agency_name) + );?> +
                          +
                          + + load->view("people/form_basic_info"); ?> + +
                          + lang->line('suppliers_account_number'), 'account_number', array('class'=>'control-label col-xs-3')); ?> +
                          + 'account_number', + 'id'=>'account_number', + 'class'=>'form-control input-sm', + 'value'=>$person_info->account_number) + );?> +
                          +
                          +
                          + -load->view("people/form_basic_info"); ?> -
                          -lang->line('suppliers_account_number').':', 'account_number'); ?> -
                          - 'account_number', - 'id'=>'account_number', - 'value'=>$person_info->account_number) - );?> -
                          -
                          -'submit', - 'id'=>'submit', - 'value'=>$this->lang->line('common_submit'), - 'class'=>'submit_button float_right') -); -?> -
                          - \ No newline at end of file diff --git a/application/views/suppliers/manage.php b/application/views/suppliers/manage.php index 052c7cd58..ff669041f 100644 --- a/application/views/suppliers/manage.php +++ b/application/views/suppliers/manage.php @@ -1,11 +1,13 @@ load->view("partial/header"); ?> +
                          -
                          lang->line('common_list_of').' '.$this->lang->line('module_'.$controller_name); ?>
                          -
                          - ".$this->lang->line($controller_name.'_new')."
                          ", - array('class'=>'thickbox none','title'=>$this->lang->line($controller_name.'_new'))); - ?> -
                          -
                          - -
                          - + + + " . $this->lang->line($controller_name . '_new') . "
                          ", + array('class'=>'modal-dlg modal-btn-submit none', 'title'=>$this->lang->line($controller_name . '_new'))); ?>
                          + +'search_form', 'class'=>'form-horizontal')); ?> +
                          +
                          +
                            +
                          • ' . $this->lang->line("common_delete") . '
                          ', array('id'=>'delete')); ?> +
                        • lang->line("common_email");?>
                        • + +
                        • + 'search', 'class'=>'form-control input-sm', 'id'=>'search')); ?> + 'limit_from', 'type'=>'hidden', 'id'=>'limit_from')); ?> +
                        • + +
                          +
                          + +
                          - +
                          -
                          + load->view("partial/footer"); ?> \ No newline at end of file diff --git a/bower.json b/bower.json index bc57591f2..62cbce03d 100644 --- a/bower.json +++ b/bower.json @@ -1,12 +1,12 @@ { "name": "opensourcepos", - "version": "2.4.0", + "version": "3.0.0", "authors": [ - "jekkos " + "jekkos ", "FrancescoUK " ], "description": "Open Source Point of Sale is a web based point of sale system written in the PHP language. It uses MySQL as the data storage back-end and has a simple user interface", - "main": "dist/ospos.js", + "main": "dist/opensourcepos.js", "keywords": [ "point-of-sale" ], @@ -24,13 +24,33 @@ "tests" ], "dependencies": { - "jKey": "https://github.com/OscarGodson/jKey", "jquery-color": "~2.1.2", "jquery-form": "~3.46.0", "jquery-validate": "~1.13.1", - "jquery": "1.8.3", + "jquery": "~1.12.2", "jquery-ui": "1.11.4", - "swfobject": "*", - "thickbox": "~3.1.2" + "swfobject-bower": "2.3.0", + "tablesorter": "jquery.tablesorter#^2.25.6", + "bootstrap3-dialog": "bootstrap-dialog#^1.35.1", + "jasny-bootstrap": "^3.1.3", + "bootswatch-dist": "3.3.6-flatly", + "smalot-bootstrap-datetimepicker": "^2.3.8", + "bootstrap-select": "^1.10.0", + "bootstrap-table": "^1.10.1", + "bootstrap-daterangepicker": "^2.1.19" + }, + "overrides": { + "bootswatch-dist": { + "main": [ + "js/bootstrap.js", + "css/bootstrap.css" + ] + }, + "jquery-ui": { + "main": [ + "themes/base/jquery-ui.css", + "jquery-ui.js" + ] + } } } diff --git a/css/autocomplete.css b/css/autocomplete.css deleted file mode 100644 index a062d0410..000000000 --- a/css/autocomplete.css +++ /dev/null @@ -1,54 +0,0 @@ -.ac_results -{ - padding: 0px; - border: 1px solid black; - background-color: white; - overflow: hidden; - z-index: 99999; -} - -.ac_results ul -{ - width: 100%; - list-style-position: outside; - list-style: none; - padding: 0; - margin: 0; -} - -.ac_results li -{ - margin: 0px; - padding: 2px 5px; - cursor: default; - display: block; - /* - if width will be 100% horizontal scrollbar will apear - when scroll mode will be used - */ - /*width: 100%;*/ - font: menu; - font-size: 12px; - /* - it is very important, if line-height not setted or setted - in relative units scroll will be broken in firefox - */ - line-height: 16px; - overflow: hidden; -} - -.ac_loading -{ - background: white url('../images/spinner_small.gif') right center no-repeat; -} - -.ac_odd -{ - background-color: #eee; -} - -.ac_over -{ - background-color: #0A246A; - color: white; -} diff --git a/css/barcode_font.css b/css/barcode_font.css index dd6007319..6c7fffe0b 100644 --- a/css/barcode_font.css +++ b/css/barcode_font.css @@ -1,44 +1,47 @@ @font-face { - font-family:'SansationLight'; - src: url('../font/SansationLight.eot'); - src: local('SansationLight'), url('../font/SansationLight.woff') format('woff'), url('../font/SansationLight.ttf') format('truetype'); + font-family: 'SansationLight'; + src: url('../fonts/SansationLight.eot'); + src: local('SansationLight'), url('../fonts/SansationLight.woff') format('woff'), url('../fonts/SansationLight.ttf') format('truetype'); } -.font_SansationLight { +.font_SansationLight +{ font-family: 'SansationLight' !important; } @font-face { font-family:'Arial'; - src: url('../font/Arial.eot'); - src: local('Arial'), url('../font/Arial.woff') format('woff'), url('../font/Arial.ttf') format('truetype'); + src: url('../fonts/Arial.eot'); + src: local('Arial'), url('../fonts/Arial.woff') format('woff'), url('../fonts/Arial.ttf') format('truetype'); } -.font_Arial { +.font_Arial +{ font-family: 'Arial' !important; } @font-face { - font-family:'JUNEBUG'; - src: url('../font/JUNEBUG.eot'); - src: local('JUNEBUG'), url('../font/JUNEBUG.woff') format('woff'), url('../font/JUNEBUG.ttf') format('truetype'); + font-family: 'JUNEBUG'; + src: url('../fonts/JUNEBUG.eot'); + src: local('JUNEBUG'), url('../fonts/JUNEBUG.woff') format('woff'), url('../fonts/JUNEBUG.ttf') format('truetype'); } -.font_JUNEBUG { +.font_JUNEBUG +{ font-family: 'JUNEBUG' !important; } @font-face { - font-family:'b-de-bonita-shadow'; - src: url('../font/b-de-bonita-shadow.eot'); - src: local('JUNEBUG'), url('../font/b-de-bonita-shadow.woff') format('woff'), url('../font/b-de-bonita-shadow.ttf') format('truetype'); + font-family: 'b-de-bonita-shadow'; + src: url('../fonts/b-de-bonita-shadow.eot'); + src: local('JUNEBUG'), url('../fonts/b-de-bonita-shadow.woff') format('woff'), url('../fonts/b-de-bonita-shadow.ttf') format('truetype'); } -.font_b-de-bonita-shadow { +.font_b-de-bonita-shadow +{ font-family: 'b-de-bonita-shadow' !important; -} - +} \ No newline at end of file diff --git a/css/bootstrap.autocomplete.css b/css/bootstrap.autocomplete.css new file mode 100644 index 000000000..02ce097c3 --- /dev/null +++ b/css/bootstrap.autocomplete.css @@ -0,0 +1,53 @@ +.ui-autocomplete +{ + position: absolute; + top: 100%; + left: 0; + z-index: 1000; + float: left; + display: none; + min-width: 160px; + _width: 160px; + padding: 5px 0; + margin: 2px 0 0 0; + list-style: none; + font-size: 13px; + background-color: #ffffff; + border-color: #cccccc; + border-color: rgba(0, 0, 0, 0.15); + border-style: solid; + border-width: 1px; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; + -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.175); + -moz-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.175); + box-shadow: 0 5px 10px rgba(0, 0, 0, 0.175); + -webkit-background-clip: padding-box; + -moz-background-clip: padding; + background-clip: padding-box; + *border-right-width: 2px; + *border-bottom-width: 2px; +} + +.ui-autocomplete .ui-menu-item > a.ui-corner-all +{ + display: block; + padding: 3px 15px; + clear: both; + font-weight: normal; + line-height: 18px; + color: #7b8a8b; + white-space: nowrap; +} + +.ui-autocomplete .ui-menu-item > a.ui-corner-all.ui-state-hover, .ui-autocomplete .ui-menu-item > a.ui-corner-all.ui-state-active +{ + color: #ffffff; + text-decoration: none; + background-color: #f5f5f5; + border-radius: 0px; + -webkit-border-radius: 0px; + -moz-border-radius: 0px; + background-image: none; +} \ No newline at end of file diff --git a/css/datepicker.css b/css/datepicker.css deleted file mode 100644 index 2b2a12805..000000000 --- a/css/datepicker.css +++ /dev/null @@ -1,153 +0,0 @@ -table.jCalendar { - border: 1px solid #000; - background: #aaa; - border-collapse: separate; - border-spacing: 2px; -} -table.jCalendar th { - background: #333; - color: #fff; - font-weight: bold; - padding: 3px 5px; -} - -table.jCalendar td { - background: #ccc; - color: #000; - padding: 3px 5px; - text-align: center; -} -table.jCalendar td.other-month { - background: #ddd; - color: #aaa; -} -table.jCalendar td.today { - background: #666; - color: #fff; -} -table.jCalendar td.selected { - background: #f66; - color: #fff; -} -table.jCalendar td.selected.dp-hover { - background: #f33; - color: #fff; -} -table.jCalendar td.dp-hover, -table.jCalendar tr.activeWeekHover td { - background: #fff; - color: #000; -} -table.jCalendar tr.selectedWeek td { - background: #f66; - color: #fff; -} -table.jCalendar td.disabled, table.jCalendar td.disabled.dp-hover { - background: #bbb; - color: #888; -} -table.jCalendar td.unselectable, -table.jCalendar td.unselectable:hover, -table.jCalendar td.unselectable.dp-hover { - background: #bbb; - color: #888; -} - -/* For the popup */ - -/* NOTE - you will probably want to style a.dp-choose-date - see how I did it in demo.css */ - -div.dp-popup { - position: relative; - background: #ccc; - font-size: 10px; - font-family: arial, sans-serif; - padding: 2px; - width: 171px; - line-height: 1.2em; -} -div#dp-popup { - position: absolute; - z-index: 199; -} -div.dp-popup h2 { - font-size: 12px; - text-align: center; - margin: 2px 0; - padding: 0; -} -a#dp-close { - font-size: 11px; - padding: 4px 0; - text-align: center; - display: block; -} -a#dp-close:hover { - text-decoration: underline; -} -div.dp-popup a { - color: #000; - text-decoration: none; - padding: 3px 2px 0; -} -div.dp-popup div.dp-nav-prev { - position: absolute; - top: 2px; - left: 4px; - width: 100px; -} -div.dp-popup div.dp-nav-prev a { - float: left; -} -/* Opera needs the rules to be this specific otherwise it doesn't change the cursor back to pointer after you have disabled and re-enabled a link */ -div.dp-popup div.dp-nav-prev a, div.dp-popup div.dp-nav-next a { - cursor: pointer; -} -div.dp-popup div.dp-nav-prev a.disabled, div.dp-popup div.dp-nav-next a.disabled { - cursor: default; -} -div.dp-popup div.dp-nav-next { - position: absolute; - top: 2px; - right: 4px; - width: 100px; -} -div.dp-popup div.dp-nav-next a { - float: right; -} -div.dp-popup a.disabled { - cursor: default; - color: #aaa; -} -div.dp-popup td { - cursor: pointer; -} -div.dp-popup td.disabled { - cursor: default; -} - -/* located in demo.css and creates a little calendar icon - * instead of a text link for "Choose date" - */ -a.dp-choose-date { - float: left; - width: 16px; - height: 16px; - padding: 0; - margin: 0px 3px 0; - display: block; - text-indent: -2000px; - overflow: hidden; - background: url(../images/calendar.png) no-repeat; -} -a.dp-choose-date.dp-disabled { - background-position: 0 -20px; - cursor: default; -} -/* makes the input field shorter once the date picker code - * has run (to allow space for the calendar icon - */ -input.dp-applied { - width: 100px; - float: left; -} \ No newline at end of file diff --git a/css/general.css b/css/general.css deleted file mode 100644 index 333915b6b..000000000 --- a/css/general.css +++ /dev/null @@ -1,154 +0,0 @@ -.field_row -{ - margin: 0 0 10px 0; -} - -.field_row label -{ - float:left; - width:100px; - text-align:left; - line-height:2.3; -} - -.field_row label.wide -{ - width:150px; -} - -label.required -{ - color:red; -} - -.form_field -{ - float:left; - padding: 3px; - background-color: #f2f2f2; -} - -.form_field input, .form_field textarea -{ - border: 1px solid #ccc; - padding: 4px; -} - -.submit_button -{ - padding: 5px; - color: #fff; - background-color: #0a6184; - border: 2px solid #ddd; -} - -.delete_button -{ - padding: 5px; - color: #fff; - background-color: #ea4729; - border: 2px solid #ddd; -} -.small_button -{ - position:relative; - width:95px; - height:30px; - background-image: url(../images/small_action_button.jpg); - background-repeat:no-repeat; - cursor:pointer; -} -.small_button span -{ - position:absolute; - width:100%; - top:30%; - left:0%; - color:#FFF; - font-size:0.9em; - font-weight:bold; - text-align:center; -} - -.float_left -{ - float:left; -} - -.float_right -{ - float:right; -} - -.big_button -{ - position:relative; - width:119px; - height:45px; - background-image: url(../images/big_action_button.jpg); - background-repeat:no-repeat; - cursor:pointer; -} - -.big_button span -{ - position:absolute; - width:100%; - top:35%; - color:#FFF; - font-size:0.9em; - font-weight:bold; - text-align:center; -} - - -.warning_message -{ - text-align:center; - background-color:#fffcdd; - border:1px solid #fff4aa; - font-weight:bold; -} - -.error_message -{ - text-align:center; - background-color:#f68383; - border:1px solid #da3232; - font-weight:bold; -} - -.warning_mesage -{ - text-align:center; - background-color:#FBEC5D; - border:1px solid #da3232; - font-weight:bold; -} - -.success_message -{ - text-align:center; - background-color:#e1ffdd; - border:1px solid #2ca71c; - font-weight:bold; -} - -input -{ - font-family: Arial; - padding: 3px; -} - -.clearfix:after -{ - content: "."; - display: block; - clear: both; - visibility: hidden; - line-height: 0; - height: 0; -} -.clearfix { display: inline-block; } -html[xmlns] .clearfix { display: block; } -* html .clearfix { height: 1%; } diff --git a/css/invoice.css b/css/invoice.css old mode 100755 new mode 100644 diff --git a/css/invoice_email.css b/css/invoice_email.css old mode 100755 new mode 100644 diff --git a/css/jquery-ui-timepicker-addon.css b/css/jquery-ui-timepicker-addon.css deleted file mode 100644 index 2d9e03143..000000000 --- a/css/jquery-ui-timepicker-addon.css +++ /dev/null @@ -1,27 +0,0 @@ -.ui-timepicker-div .ui-widget-header { margin-bottom: 8px; } -.ui-timepicker-div dl { text-align: left; } -.ui-timepicker-div dl dt { float: left; clear:left; padding: 0 0 0 5px; } -.ui-timepicker-div dl dd { margin: 0 10px 10px 40%; } -.ui-timepicker-div td { font-size: 90%; } -.ui-tpicker-grid-label { background: none; border: none; margin: 0; padding: 0; } -.ui-timepicker-div .ui_tpicker_unit_hide{ display: none; } - -.ui-timepicker-rtl{ direction: rtl; } -.ui-timepicker-rtl dl { text-align: right; padding: 0 5px 0 0; } -.ui-timepicker-rtl dl dt{ float: right; clear: right; } -.ui-timepicker-rtl dl dd { margin: 0 40% 10px 10px; } - -/* Shortened version style */ -.ui-timepicker-div.ui-timepicker-oneLine { padding-right: 2px; } -.ui-timepicker-div.ui-timepicker-oneLine .ui_tpicker_time, -.ui-timepicker-div.ui-timepicker-oneLine dt { display: none; } -.ui-timepicker-div.ui-timepicker-oneLine .ui_tpicker_time_label { display: block; padding-top: 2px; } -.ui-timepicker-div.ui-timepicker-oneLine dl { text-align: right; } -.ui-timepicker-div.ui-timepicker-oneLine dl dd, -.ui-timepicker-div.ui-timepicker-oneLine dl dd > div { display:inline-block; margin:0; } -.ui-timepicker-div.ui-timepicker-oneLine dl dd.ui_tpicker_minute:before, -.ui-timepicker-div.ui-timepicker-oneLine dl dd.ui_tpicker_second:before { content:':'; display:inline-block; } -.ui-timepicker-div.ui-timepicker-oneLine dl dd.ui_tpicker_millisec:before, -.ui-timepicker-div.ui-timepicker-oneLine dl dd.ui_tpicker_microsec:before { content:'.'; display:inline-block; } -.ui-timepicker-div.ui-timepicker-oneLine .ui_tpicker_unit_hide, -.ui-timepicker-div.ui-timepicker-oneLine .ui_tpicker_unit_hide:before{ display: none; } \ No newline at end of file diff --git a/css/jquery-ui.structure.css b/css/jquery-ui.structure.css deleted file mode 100644 index 152835d24..000000000 --- a/css/jquery-ui.structure.css +++ /dev/null @@ -1,258 +0,0 @@ -/*! - * jQuery UI CSS Framework 1.11.4 - * http://jqueryui.com - * - * Copyright jQuery Foundation and other contributors - * Released under the MIT license. - * http://jquery.org/license - * - * http://api.jqueryui.com/category/theming/ - */ - -/* Layout helpers -----------------------------------*/ -.ui-helper-hidden { - display: none; -} -.ui-helper-hidden-accessible { - border: 0; - clip: rect(0 0 0 0); - height: 1px; - margin: -1px; - overflow: hidden; - padding: 0; - position: absolute; - width: 1px; -} -.ui-helper-reset { - margin: 0; - padding: 0; - border: 0; - outline: 0; - line-height: 1.3; - text-decoration: none; - font-size: 100%; - list-style: none; -} -.ui-helper-clearfix:before, -.ui-helper-clearfix:after { - content: ""; - display: table; - border-collapse: collapse; -} -.ui-helper-clearfix:after { - clear: both; -} -.ui-helper-clearfix { - min-height: 0; /* support: IE7 */ -} -.ui-helper-zfix { - width: 100%; - height: 100%; - top: 0; - left: 0; - position: absolute; - opacity: 0; - filter:Alpha(Opacity=0); /* support: IE8 */ -} - -.ui-front { - z-index: 100; -} - - -/* Interaction Cues -----------------------------------*/ -.ui-state-disabled { - cursor: default !important; -} - - -/* Icons -----------------------------------*/ - -/* states and images */ -.ui-icon { - display: block; - text-indent: -99999px; - overflow: hidden; - background-repeat: no-repeat; -} - - -/* Misc visuals -----------------------------------*/ - -/* Overlays */ -.ui-widget-overlay { - position: fixed; - top: 0; - left: 0; - width: 100%; - height: 100%; -} -.ui-datepicker { - width: 17em; - padding: .2em .2em 0; - display: none; -} -.ui-datepicker .ui-datepicker-header { - position: relative; - padding: .2em 0; -} -.ui-datepicker .ui-datepicker-prev, -.ui-datepicker .ui-datepicker-next { - position: absolute; - top: 2px; - width: 1.8em; - height: 1.8em; -} -.ui-datepicker .ui-datepicker-prev-hover, -.ui-datepicker .ui-datepicker-next-hover { - top: 1px; -} -.ui-datepicker .ui-datepicker-prev { - left: 2px; -} -.ui-datepicker .ui-datepicker-next { - right: 2px; -} -.ui-datepicker .ui-datepicker-prev-hover { - left: 1px; -} -.ui-datepicker .ui-datepicker-next-hover { - right: 1px; -} -.ui-datepicker .ui-datepicker-prev span, -.ui-datepicker .ui-datepicker-next span { - display: block; - position: absolute; - left: 50%; - margin-left: -8px; - top: 50%; - margin-top: -8px; -} -.ui-datepicker .ui-datepicker-title { - margin: 0 2.3em; - line-height: 1.8em; - text-align: center; -} -.ui-datepicker .ui-datepicker-title select { - font-size: 1em; - margin: 1px 0; -} -.ui-datepicker select.ui-datepicker-month, -.ui-datepicker select.ui-datepicker-year { - width: 45%; -} -.ui-datepicker table { - width: 100%; - font-size: .9em; - border-collapse: collapse; - margin: 0 0 .4em; -} -.ui-datepicker th { - padding: .7em .3em; - text-align: center; - font-weight: bold; - border: 0; -} -.ui-datepicker td { - border: 0; - padding: 1px; -} -.ui-datepicker td span, -.ui-datepicker td a { - display: block; - padding: .2em; - text-align: right; - text-decoration: none; -} -.ui-datepicker .ui-datepicker-buttonpane { - background-image: none; - margin: .7em 0 0 0; - padding: 0 .2em; - border-left: 0; - border-right: 0; - border-bottom: 0; -} -.ui-datepicker .ui-datepicker-buttonpane button { - float: right; - margin: .5em .2em .4em; - cursor: pointer; - padding: .2em .6em .3em .6em; - width: auto; - overflow: visible; -} -.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { - float: left; -} - -/* with multiple calendars */ -.ui-datepicker.ui-datepicker-multi { - width: auto; -} -.ui-datepicker-multi .ui-datepicker-group { - float: left; -} -.ui-datepicker-multi .ui-datepicker-group table { - width: 95%; - margin: 0 auto .4em; -} -.ui-datepicker-multi-2 .ui-datepicker-group { - width: 50%; -} -.ui-datepicker-multi-3 .ui-datepicker-group { - width: 33.3%; -} -.ui-datepicker-multi-4 .ui-datepicker-group { - width: 25%; -} -.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header, -.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { - border-left-width: 0; -} -.ui-datepicker-multi .ui-datepicker-buttonpane { - clear: left; -} -.ui-datepicker-row-break { - clear: both; - width: 100%; - font-size: 0; -} - -/* RTL support */ -.ui-datepicker-rtl { - direction: rtl; -} -.ui-datepicker-rtl .ui-datepicker-prev { - right: 2px; - left: auto; -} -.ui-datepicker-rtl .ui-datepicker-next { - left: 2px; - right: auto; -} -.ui-datepicker-rtl .ui-datepicker-prev:hover { - right: 1px; - left: auto; -} -.ui-datepicker-rtl .ui-datepicker-next:hover { - left: 1px; - right: auto; -} -.ui-datepicker-rtl .ui-datepicker-buttonpane { - clear: right; -} -.ui-datepicker-rtl .ui-datepicker-buttonpane button { - float: left; -} -.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current, -.ui-datepicker-rtl .ui-datepicker-group { - float: right; -} -.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header, -.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { - border-right-width: 0; - border-left-width: 1px; -} diff --git a/css/login.css b/css/login.css index bc4a126a0..e7a56e010 100644 --- a/css/login.css +++ b/css/login.css @@ -1,87 +1,63 @@ -@import url(https://fonts.googleapis.com/css?family=Open+Sans:300,400,700); - -*{margin:0;padding:0;} - -body{ - background:#567; - font-family:'Open Sans',sans-serif; +* +{ + margin:0; + padding:0; } -.button{ - width:100px; - background:#3399cc; - display:block; - margin:0 auto; - margin-top:1%; - padding:10px; - text-align:center; - text-decoration:none; - color:#fff; - cursor:pointer; - transition:background .3s; - -webkit-transition:background .3s; +#logo +{ + margin-top:2%; + margin-bottom:2%; } -.button:hover{ - background:#2288bb; +#login +{ + width:400px; + margin:0 auto; + margin-top:2%; + margin-bottom:2%; + transition:opacity 1s; + -webkit-transition:opacity 1s; } -#login{ - width:400px; - margin:0 auto; - margin-top:8px; - margin-bottom:2%; - transition:opacity 1s; - -webkit-transition:opacity 1s; +#login h1 +{ + background:#3399cc; + padding:20px 0; + font-size:140%; + font-weight:300; + text-align:center; + color:#fff; } -#triangle{ - width:0; - border-top:12x solid transparent; - border-right:12px solid transparent; - border-bottom:12px solid #3399cc; - border-left:12px solid transparent; - margin:0 auto; +form +{ + background:#f0f0f0; + padding:6% 4%; } -#login h1{ - background:#3399cc; - padding:20px 0; - font-size:140%; - font-weight:300; - text-align:center; - color:#fff; +input[type="text"], input[type="password"] +{ + width:100%; + background:#fff; + margin-bottom:4%; + border:1px solid #ccc; + padding:4%; + color:#555; } -form{ - background:#f0f0f0; - padding:6% 4%; +input[type="submit"] +{ + width:100%; + background:#3399cc; + margin-top:4%; + border:0; + padding:4%; + transition:background .3s; + -webkit-transition:background .3s; } -input[type="text"],input[type="password"]{ - width:92%; - background:#fff; - margin-bottom:4%; - border:1px solid #ccc; - padding:4%; - font-family:'Open Sans',sans-serif; - font-size:95%; - color:#555; -} - -input[type="submit"]{ - width:100%; - background:#3399cc; - border:0; - padding:4%; - font-family:'Open Sans',sans-serif; - font-size:100%; - color:#fff; - cursor:pointer; - transition:background .3s; - -webkit-transition:background .3s; -} - -input[type="submit"]:hover{ - background:#2288bb; +input[type="submit"]:hover +{ + background:#2288bb; } \ No newline at end of file diff --git a/css/menubar.css b/css/menubar.css deleted file mode 100644 index a238dc08a..000000000 --- a/css/menubar.css +++ /dev/null @@ -1,93 +0,0 @@ -#menubar -{ - position:relative; - margin:0px; - padding:0px; - background-image: url("../images/menubar/menubar_bg.gif"); - background-repeat: repeat-x; - width:100%; - height:100px; - color:#FFFFFF; - text-align:left; - text-align:center; -} - -#menubar_container -{ - position:relative; - margin:0 auto; - width:960px; - text-align:left; -} - -.menu_item -{ - float:left; - width:65px; - height:100%; - text-align:center; -} - - -#menubar a:link, #menubar a:visited, #menubar a -{ - color:#FFFFFF; - text-decoration:underline; -} - -#menubar a:hover -{ - color:#CCCCCC; - text-decoration:underline; -} - -.menu_item -{ - font-size:11px; -} - -#menubar_company_info -{ - position:absolute; - left:0px; - top:18px; - width:250px; - height:55%; -} - -#company_title -{ - font-size:14px; - font-weight:bold; -} - -#menubar_navigation -{ - position:relative; - width:75%; - left:200px; - top:8px; - height:45%; -} - -#menubar_footer -{ - position:absolute; - top:80px; - left:0px; - height:17%; - padding-top:3px; - font-size:10px; - font-weight:bold; -} - -#menubar_date -{ - position:absolute; - top:80px; - right:0px; - height:17%; - padding-top:3px; - font-size:10px; - font-weight:bold; -} \ No newline at end of file diff --git a/css/ospos.css b/css/ospos.css index bf411b188..c8f85ad22 100644 --- a/css/ospos.css +++ b/css/ospos.css @@ -1,142 +1,115 @@ -@import url(autocomplete.css); -@import url(menubar.css); -@import url(general.css); -@import url(popupbox.css); -@import url(register.css); -@import url(receipt.css); -@import url(reports.css); -@import url(tables.css); -@import url(thickbox.css); -@import url(datepicker.css); -@import url(invoice.css); -@import url(jquery-ui.structure.css); -@import url(jquery-ui.theme.css); -@import url(jquery-ui-timepicker-addon.css); - -body +html, body { - margin:0px; - padding:0px; - background-color:#f7f7f7; - font-family: Arial, sans-serif, "Lucida Grande", "Trebuchet MS", Tahoma, Verdana; - font-size: 0.9em; + height: 100%; } a.none { - text-decoration:none; + text-decoration: none; } - -#content_area_wrapper +.topbar { - position:relative; - width:100%; - background-color:#FFFFFF; - margin:0px; - padding-bottom: 10px; - border-bottom:1px solid #CCCCCC; - text-align:center; - + color: #eee; + font-size: 12px; + background: #182735; + padding: 0.2em; } -#content_area +.navbar { - position:relative; - margin:0 auto; - width:875px; - text-align:left; - + border-radius: 0; +} + +.navbar-default .navbar-nav > .active > a, +.navbar-default .navbar-nav > .active > a:hover, +.navbar-default .navbar-nav > .active > a:focus +{ + color: #2C3E50; + background-color: #FFFFFF; +} + +.navbar .menu-icon +{ + text-align: center; + font-size: 12px; +} + +.navbar .menu-icon img +{ + width: 24px; +} + +.wrapper +{ + font-size: 14px; +} + +.pagination +{ + margin: 0 !important; } #title_bar { - position:relative; - margin-top:10px; - margin-bottom:10px; - width:100%; - height:50px; + position: relative; + width: 100%; + height: 3em; } -#title -{ - position:absolute; - bottom:0px; - left:0px; - font-size:30px; - font-weight:bold; - color:#000000; -} - #page_title { - margin-top:8px; - font-size:30px; - font-weight:bold; - color:#000000; - text-align:center; - + font-size: 22px; + font-family: "Lato", "Helvetica Neue", Helvetica, Arial, sans-serif; + font-weight: 400; } #page_subtitle { - margin-top:8px; - font-size:16px; - font-weight:bold; - color:#000000; - text-align:center; -} - -#new_button, #print_button -{ - position:absolute; - bottom:-5px; - right:0px; -} - -#spinner -{ - float:right; - display:none; + margin-bottom: 0.5em; + font-size: 16px; + font-weight: bold; + text-align: center; } #feedback_bar { - position:fixed; - bottom:0; - left:0; - width:100%; - height:55px; - position:fixed; - opacity: 0; - filter: alpha(opacity=0); - z-index:1; - line-height:3.3; + position: fixed; + bottom: 0; + left: 0; + width: 100%; + z-index: 1; + line-height: 3.3; + text-align: center; } #home_module_list { position: relative; + padding: 2em 0; + text-align: center; } .module_item { - padding: 10px; + min-width: 7em; + display: inline-block; + text-align: center; +} + +.module_item a +{ + display: block; } #config_wrapper { - text-align:center; + text-align: center; } #config_info { - width:93%; - margin:0 auto; - padding:10px; - margin-bottom:30px; - margin-top:10px; - text-align:left; + text-align: left; } #config_info .wide @@ -146,37 +119,56 @@ a.none #footer { - position:relative; - margin-top:25px; - margin-bottom:15px; - text-align:center; - font-size:11px; - color:#777777; - clear:both; - -} - -input#search -{ - padding: 0px; -} - -select#stock_location -{ - border: none; -} - -#select_customer_form input, #select_supplier_form input -{ - width: 95%; -} - -input.quantity, input.discount -{ - width: 40px; + margin-top: 5em; + position: relative; + text-align: center; + font-size: 11px; + color: #777777; + clear: both; } a.rollover img { padding: 3px; } + +button.btn.dropdown-toggle.btn-sm +{ + background-color: white; + color: black; + border: 2px solid #dce4ec; +} + +.dropdown-menu +{ + font-size: 13px; +} + +label.required +{ + color:red; +} + +@media (min-width: 768px) +{ + .navbar-nav > li > a + { + padding: 10px 10px 9px; + } + + .modal-dlg .modal-dialog + { + width: 500px; + } + + .modal-dlg-wide .modal-dialog + { + width: 750px; + } +} + +.modal-body +{ + max-height: calc(100vh - 212px); + overflow-y: auto; +} diff --git a/css/ospos_print.css b/css/ospos_print.css index 18eb39ae5..163272add 100644 --- a/css/ospos_print.css +++ b/css/ospos_print.css @@ -1,74 +1,77 @@ -#receipt_wrapper -{ - /*background-color:#FFFFFF;*/ - font-size:75%; -} +@media print { -#menubar, #footer -{ - display:none; -} + .no-print, .no-print * + { + display: none !important; + } -#content_area -{ - width:100%; -} + #receipt_wrapper + { + /*background-color:#FFFFFF;*/ + font-size:75%; + } -#content_area_wrapper -{ - border:0px; -} + .topbar + { + display:none; + } -#sale_return_policy -{ - width:100%; - text-align:center; -} + #menubar, #footer + { + display:none; + } -.short_name -{ - display:inline; -} + #sale_return_policy + { + width:100%; + text-align:center; + } -#receipt_items td -{ - white-space:nowrap; -} + .short_name + { + display:inline; + } -/* Hide links in table for printing */ -table.innertable -{ - display: table; -} + #receipt_items td + { + white-space:nowrap; + } -table.innertable a -{ - color: #000000; - text-decoration: none; -} + /* Hide links in table for printing */ + table.innertable + { + display: table; + } -table.report a.expand -{ - visibility: hidden; -} + table.innertable a + { + color: #000000; + text-decoration: none; + } -table.report a -{ - color: #000000; - text-decoration: none; -} + table.report a.expand + { + visibility: hidden; + } -table.innertable thead -{ - /*display:none;*/ -} + table.report a + { + color: #000000; + text-decoration: none; + } -.print_show -{ - display:block !important; -} + table.innertable thead + { + /*display:none;*/ + } -.print_hide -{ - display:none !important; + .print_show + { + display:block !important; + } + + .print_hide + { + display:none !important; + } } \ No newline at end of file diff --git a/css/popupbox.css b/css/popupbox.css index 98be4f99f..59bdc14c1 100644 --- a/css/popupbox.css +++ b/css/popupbox.css @@ -6,90 +6,63 @@ font-style: italic; } -#customer_basic_info,#item_basic_info,#item_number_info,#supplier_basic_info,#sale_basic_info +.error_message_box +{ + margin-bottom: 7px; + margin-left: 20px; + color: red; + font-weight: bold; +} + +#customer_basic_info, #item_basic_info, #item_number_info, #supplier_basic_info, #sale_basic_info, #employee_basic_info, #employee_login_info, #employee_permission_info { padding: 5px; } -#scan_item_number.loading -{ - background-image: url(../images/spinner_small.gif); - background-position:center right; - background-repeat:no-repeat; -} - #info_provided_by { - display:none; - font-weight:bold; -} - -#employee_basic_info -{ - float:left; - width:47%; - padding:5px; -} - -#employee_login_info -{ - float:left; - width:47%; - margin-left:5px; - padding:5px; + display: none; + font-weight: bold; } #permission_list { - list-style:none; + list-style: none; } #permission_list li { - padding:5px; + padding: 5px; } #permission_list ul li { - padding-left:20px; + padding-left: 20px; padding-bottom: 0px; - list-style:none; + list-style: none; } #permission_list input { - top:3px; + top: 3px; } -#employee_permission_info -{ - float:left; - width:47%; - margin-left:5px; - padding:5px; -} #employee_permission_info p { - font-weight:bold; + font-weight: bold; } #employee_permission_info span.small { - font-style:italic; - font-size:80%; + font-style: italic; + font-size: 80%; } -.error_message_box -{ - margin-bottom:7px; - margin-left:20px; - color:red; - font-weight:bold; -} #item_kit_items_title { text-align: center; } + #item_kit_items { width: 100%; diff --git a/css/receipt.css b/css/receipt.css index 5573cb5c3..505dddc7c 100644 --- a/css/receipt.css +++ b/css/receipt.css @@ -43,8 +43,7 @@ #receipt_items td { position:relative; - padding:3px; - margin-bottom:5px; + padding:3px; margin-bottom:5px; } @@ -64,7 +63,7 @@ text-align:center; } -#barcode +#receipt_wrapper #barcode { margin-top:10px; text-align:center; @@ -79,4 +78,3 @@ { font-weight: bold; } -} \ No newline at end of file diff --git a/css/register.css b/css/register.css index 9d5f46e87..ae04ff77b 100644 --- a/css/register.css +++ b/css/register.css @@ -1,164 +1,125 @@ #register_wrapper { - float:left; - width:70%; - font-size:13px; + float: left; + width: 70%; + font-size: 13px; } + +#mode_form, #add_item_form +{ + margin: 0; +} + +#mode_form .panel-body, #add_item_form .panel-body +{ + padding: 0.7em; + margin: 0; +} + #mode_form { - position:relative; - background-color:#DDD; - padding: 8px 5px 8px 5px; + background-color: #DDD; } -#show_suspended_sales_button +#mode_form ul, #add_item_form ul { - position:absolute; - top:3px; - right:4px; + list-style: none; + padding: 0; + margin: 0; } -#mode_form span +#mode_form ul li, #add_item_form ul li { - font-weight:bold; + margin-left: 1em; +} + +.first_li +{ + margin-left: 0.2em !important; +} + +#mode_form ul.dropdown-menu.inner, #add_item_form ul.dropdown-menu.inner +{ + margin-left: -1em !important; } #add_item_form { - position:relative; - background-color:#BBBBBB; - width:100%; - padding: 8px 0px 8px 0px; - -} - -#new_item_button_register -{ - position:absolute; - top:3px; - right:4px; -} - -#add_item_form input -{ - border: 1px solid #ccc; - padding: 2px; - -} - -#item_label,#customer_label -{ - font-weight:bold; -} - -#add_item_form label -{ - margin: 0px 5px 0px 5px; + background-color: #BBB; } #register { - position:relative; - width:100%; - padding:0px; - border-collapse:collapse; + padding: 0; + border-collapse: collapse; } #register th { - background-color:#4386a1; - padding:5px; - text-align:center; - color:#FFFFFF; + background-color: #999; + padding: 5px; + text-align: center; + color: #FFF; } #register td { - background-color:#EEEEEE; - padding:3px; - text-align:center; + background-color: #EEE; + padding: 3px; + text-align: center; } #overall_sale { - float:left; - margin-left:4px; - background-color:#BBBBBB; - width:28%; - padding:5px; - font-size:13px; - + width: 28%; + float: left; + margin-left: 0.1em; + padding-bottom: 1em; + padding-top: 1em; + background-color: #BBB; + font-size: 13px; + text-align: center; } -#sale_details +#overall_sale .panel-body { - position:relative; - width:100%; - margin-top:5px; - border-top:2px solid #000; + padding-top: 0; + padding-bottom: 0; } -#finish_sale +#overall_sale .form-group { - position:relative; + margin: 0; +} + +#overall_sale .btn +{ + margin-top: 0.5em; + margin-bottom: 0.5em; +} + +#payment_details, #buttons_sale, #suspended_sales_table +{ + width: 100%; +} + +.sales_table_100 +{ + width: 100%; +} + +#sale_totals, #payment_totals +{ + border-top: 2px solid #000; } #payment_details { - float:left; - width:100%; - margin-top:5px; - border-top:2px solid #000; - background-color:#DDD; - margin-bottom:0px; - clear:both; -} - -#Cancel_sale -{ - float:left; - width:100%; - margin-top:5px; - clear:both; -} -#suspended_sales_table -{ - width:100%; -} - -#credit_card_form fieldset -{ - overflow: auto; - border: 0; - margin: 0; - padding: 0; -} - -#credit_card_form fieldset div -{ - float: left; -} - -#credit_card_form fieldset.centered div -{ - text-align: center; -} - -#credit_card_form label -{ - display: block; - margin-bottom: 5px; -} - -#credit_card_form input.text -{ - border: 1px solid #bfbab4; - margin: 0 4px 8px 0; -} - -#sales_overview -{ - position:absolute; - top:3px; - right:99px; + float: left; + border-top: 2px solid #000; + background-color: #DDD; + margin-top: 0.2em; + padding: 0.5em; + text-align: left; + clear: both; } \ No newline at end of file diff --git a/css/reports.css b/css/reports.css index 88b175a32..3fd3f328a 100644 --- a/css/reports.css +++ b/css/reports.css @@ -2,17 +2,20 @@ { margin-left: 35px; } + #report_date_range_simple, #report_date_range_complex { margin-bottom: 10px; } + .report { font-size: .85em; } + #report_summary { - margin: 0 auto; + margin: 2em 0 auto; text-align: center; } diff --git a/css/tabcontent.css b/css/tabcontent.css deleted file mode 100644 index d49ce8b5f..000000000 --- a/css/tabcontent.css +++ /dev/null @@ -1,70 +0,0 @@ -/* Tab Content - menucool.com */ - -ul.tabs -{ - padding: 7px 0; - font-size: 0; - margin:0; - list-style-type: none; - text-align: left; /*set to left, center, or right to align the tabs as desired*/ -} - -ul.tabs li -{ - display: inline; - margin: 0; - margin-right:3px; /*distance between tabs*/ -} - -ul.tabs li a -{ - font: normal 12px Verdana; - text-decoration: none; - position: relative; - padding: 7px 16px; - border: 1px solid #CCC; - border-bottom-color:#B7B7B7; - color: #000; - background: #F0F0F0 url(../images/tabbg.gif) 0 0 repeat-x; - border-radius: 3px 3px 0 0; - outline:none; -} - -ul.tabs li a:visited -{ - color: #000; -} - -ul.tabs li a:hover -{ - border: 1px solid #B7B7B7; - background-color:#F0F0F0; - background-image:url(../images/tabbg.gif); - background-position:0 -36px; - background-repeat:repeat-x; -} - -ul.tabs li.selected a, ul.tabs li.selected a:hover -{ - position: relative; - top: 0px; - font-weight:bold; - background: white; - border: 1px solid #B7B7B7; - border-bottom-color: white; -} - - -ul.tabs li.selected a:hover -{ - text-decoration: none; -} - - -div.tabcontents -{ - border: 1px solid #B7B7B7; padding: 10px; - background-color:#FFF; - border-radius: 0 3px 3px 3px; - margin-bottom: 20px; -} \ No newline at end of file diff --git a/css/tables.css b/css/tables.css index 4e62bfec1..a0f2983cf 100644 --- a/css/tables.css +++ b/css/tables.css @@ -1,66 +1,60 @@ #table_action_header { - position:relative; - width:100%; - background-color:#EEEEEE; - background-image:url(../images/checkbox_arrow.gif); - height:20px; - border-top:1px solid #CCCCCC; - background-position:5px 10px; - background-repeat:no-repeat; - padding:5px 0px 5px 0px; + position: relative; + width: 100%; + height: 2em; + border: 0; + margin-top: 1em; + margin-left: 0; + background-color: transparent; + background-image: url(../images/checkbox_arrow.gif); + background-position: 0.5em 1.2em; + background-repeat: no-repeat; } #table_action_header ul { - list-style:none; - padding:0px; - margin:0px; - margin-left:15px; + list-style: none; + padding: 0; + margin: 0; + margin-left: 1em; +} + +#table_action_header ul.dropdown-menu.inner +{ + margin-left: -1em !important; } #table_action_header ul li { - margin-left:8px; - margin-right:4px; - + margin-left: 1em; } -#table_action_header ul li span a +#table_action_header ul li label { - background-color:#0a6184; - border:2px solid #DDDDDD; - padding:2px 5px 2px 5px; - -} - -#table_action_header a -{ - text-decoration:none; - color:#FFF; + margin-top: 0.5em; } #table_holder { - position:relative; - margin-bottom:50px; + position: relative; + margin-bottom: 50px; } table.tablesorter { - position:relative; - width:100%; - border-top:3px solid #0a6184; - border-collapse:collapse; + position: relative; + width: 100%; + border: 0; + border-collapse: collapse; } table.tablesorter thead tr th, table.tablesorter tfoot tr th { - color:#FFFFFF; - text-align:left; - background-color:#4386a1; - padding: 0px 5px 0px 5px; - + color: #FFFFFF; + text-align: left; + background-color: #999999; + padding: 8px; } table.tablesorter thead tr .header @@ -76,41 +70,37 @@ table.tablesorter tbody td color: #3D3D3D; background-color: #FFF; vertical-align: top; - padding: 0px 5px 0px 5px; -} - -table.tablesorter tbody td -{ + padding: 8px; border-bottom:1px solid #DDDDDD; } table.tablesorter tbody td.over { - background-color:#CCCCCC; + background-color: #F5F5F5; } table.tablesorter tbody td.selected { - background-color:#BBBBBB; + background-color: #ECECEC; } table.tablesorter thead tr .tablesorter-headerAsc { background-image: url(../images/tables/asc.gif); - background-repeat:no-repeat; + background-repeat: no-repeat; background-position: right; } table.tablesorter thead .tablesorter-headerDesc { background-image: url(../images/tables/desc.gif); - background-repeat:no-repeat; + background-repeat: no-repeat; background-position: right; } table.tablesorter thead tr .headerSortDown, table.tablesorter thead tr .headerSortUp { - background-color: #8dbdd8; + background-color: #555555; } table.innertable @@ -121,7 +111,7 @@ table.innertable table.innertable thead tr th { - background-color: #0a6184; + background-color: #999999; } table.innertable tbody tr td @@ -132,9 +122,4 @@ table.innertable tbody tr td .totals table tr:last-child td { font-weight: bold; -} - -#pagination a, #pagination strong -{ - padding: 2px 3px; } \ No newline at end of file diff --git a/css/thickbox.css b/css/thickbox.css deleted file mode 100644 index 57242c5d4..000000000 --- a/css/thickbox.css +++ /dev/null @@ -1,165 +0,0 @@ -/* ----------------------------------------------------------------------------------------------------------------*/ -/* ---------->>> global settings needed for thickbox <<<-----------------------------------------------------------*/ -/* ----------------------------------------------------------------------------------------------------------------*/ -*{padding: 0; margin: 0;} - -/* ----------------------------------------------------------------------------------------------------------------*/ -/* ---------->>> thickbox specific link and font settings <<<------------------------------------------------------*/ -/* ----------------------------------------------------------------------------------------------------------------*/ -#TB_window { - font: 12px Arial, Helvetica, sans-serif; - color: #333333; -} - -#TB_secondLine { - font: 10px Arial, Helvetica, sans-serif; - color:#666666; -} - -#TB_window a:link {color: #666666;} -#TB_window a:visited {color: #666666;} -#TB_window a:hover {color: #000;} -#TB_window a:active {color: #666666;} -#TB_window a:focus{color: #666666;} - -/* ----------------------------------------------------------------------------------------------------------------*/ -/* ---------->>> thickbox settings <<<-----------------------------------------------------------------------------*/ -/* ----------------------------------------------------------------------------------------------------------------*/ -#TB_overlay { - position: fixed; - z-index:100; - top: 0px; - left: 0px; - height:100%; - width:100%; -} - -.TB_overlayMacFFBGHack {background: url(macFFBgHack.png) repeat;} -.TB_overlayBG { - background-color:#000; - filter:alpha(opacity=75); - -moz-opacity: 0.75; - opacity: 0.75; -} - -* html #TB_overlay { /* ie6 hack */ - position: absolute; - height: expression(document.body.scrollHeight > document.body.offsetHeight ? document.body.scrollHeight : document.body.offsetHeight + 'px'); -} - -#TB_window { - position: fixed; - background: #ffffff; - z-index: 102; - color:#000000; - display:none; - border: 4px solid #525252; - text-align:left; - bottom:10%; - left:50%; -} - -* html #TB_window { /* ie6 hack */ -position: absolute; -margin-top: expression(0 - parseInt(this.offsetHeight / 2) + (TBWindowMargin = document.documentElement && document.documentElement.scrollTop || document.body.scrollTop) + 'px'); -} - -#TB_window img#TB_Image { - display:block; - margin: 15px 0 0 15px; - border-right: 1px solid #ccc; - border-bottom: 1px solid #ccc; - border-top: 1px solid #666; - border-left: 1px solid #666; -} - -#TB_caption{ - height:25px; - padding:7px 30px 10px 25px; - float:left; -} - -#TB_closeWindow{ - height:25px; - padding:11px 25px 10px 0; - float:right; -} - -#TB_closeAjaxWindow{ - padding:7px 10px 5px 0; - margin-bottom:1px; - text-align:right; - float:right; -} - -#TB_ajaxWindowTitle{ - float:left; - padding:7px 0 5px 10px; - margin-bottom:1px; -} - -#TB_title{ - background-color:#e8e8e8; - font-size:1.25em; - font-weight:bold; - height:27px; -} - -#TB_ajaxContent{ - clear:both; - padding:2px 15px 15px 15px; - overflow:auto; - text-align:left; - line-height:1.4em; -} - -#TB_ajaxContent.TB_modal{ - padding:15px; -} - -#TB_ajaxContent p{ - padding:5px 0px 5px 0px; -} - -#TB_load{ - position: fixed; - display:none; - height:13px; - width:208px; - z-index:103; - top: 50%; - left: 50%; - margin: -6px 0 0 -104px; /* -height/2 0 0 -width/2 */ -} - -* html #TB_load { /* ie6 hack */ -position: absolute; -margin-top: expression(0 - parseInt(this.offsetHeight / 2) + (TBWindowMargin = document.documentElement && document.documentElement.scrollTop || document.body.scrollTop) + 'px'); -} - -#TB_HideSelect{ - z-index:99; - position:fixed; - top: 0; - left: 0; - background-color:#fff; - border:none; - filter:alpha(opacity=0); - -moz-opacity: 0; - opacity: 0; - height:100%; - width:100%; -} - -* html #TB_HideSelect { /* ie6 hack */ - position: absolute; - height: expression(document.body.scrollHeight > document.body.offsetHeight ? document.body.scrollHeight : document.body.offsetHeight + 'px'); -} - -#TB_iframeContent{ - clear:both; - border:none; - margin-bottom:-1px; - margin-top:1px; - _margin-bottom:1px; -} diff --git a/database/2.4_to_3.0.sql b/database/2.4_to_3.0.sql new file mode 100644 index 000000000..a7909ccc7 --- /dev/null +++ b/database/2.4_to_3.0.sql @@ -0,0 +1,32 @@ +-- alter quantity fields to be all decimal + +ALTER TABLE `ospos_items` + MODIFY COLUMN `reorder_level` decimal(15,3) NOT NULL DEFAULT '0', + MODIFY COLUMN `receiving_quantity` decimal(15,3) NOT NULL DEFAULT '1'; + +ALTER TABLE `ospos_item_kit_items` + MODIFY COLUMN `quantity` decimal(15,3) NOT NULL; + +ALTER TABLE `ospos_item_quantities` + MODIFY COLUMN `quantity` decimal(15,3) NOT NULL DEFAULT '0'; + +ALTER TABLE `ospos_receivings_items` + MODIFY COLUMN `quantity_purchased` decimal(15,3) NOT NULL DEFAULT '0', + MODIFY COLUMN `receiving_quantity` decimal(15,3) NOT NULL DEFAULT '1'; + +ALTER TABLE `ospos_sales_items` + MODIFY COLUMN `quantity_purchased` decimal(15,3) NOT NULL DEFAULT '0'; + +ALTER TABLE `ospos_sales_suspended_items` + MODIFY COLUMN `quantity_purchased` decimal(15,3) NOT NULL DEFAULT '0'; + +ALTER TABLE `ospos_sales_items_taxes` + MODIFY COLUMN `percent` decimal(15,3) NOT NULL; + +ALTER TABLE `ospos_sales_suspended_items_taxes` + MODIFY COLUMN `percent` decimal(15,3) NOT NULL; + +ALTER TABLE `ospos_items_taxes` + MODIFY COLUMN `percent` decimal(15,3) NOT NULL; + + \ No newline at end of file diff --git a/database/database.sql b/database/database.sql index 7404d8e9d..8f684c1ea 100644 --- a/database/database.sql +++ b/database/database.sql @@ -57,7 +57,10 @@ INSERT INTO `ospos_app_config` (`key`, `value`) VALUES ('show_total_discount', '1'), ('dateformat', 'm/d/Y'), ('timeformat', 'H:i:s'), -('currency_symbol', '$'); +('currency_symbol', '$'), +('decimal_point', '.'), +('currency_decimals', '2'), +('quantity_decimals', '0'); -- -------------------------------------------------------- @@ -164,8 +167,8 @@ CREATE TABLE `ospos_items` ( `description` varchar(255) NOT NULL, `cost_price` decimal(15,2) NOT NULL, `unit_price` decimal(15,2) NOT NULL, - `reorder_level` decimal(15,2) NOT NULL DEFAULT '0', - `receiving_quantity` int(11) NOT NULL DEFAULT '1', + `reorder_level` decimal(15,3) NOT NULL DEFAULT '0', + `receiving_quantity` decimal(15,3) NOT NULL DEFAULT '1', `item_id` int(10) NOT NULL AUTO_INCREMENT, `pic_id` int(10) DEFAULT NULL, `allow_alt_description` tinyint(1) NOT NULL, @@ -236,7 +239,7 @@ CREATE TABLE `ospos_item_kits` ( CREATE TABLE `ospos_item_kit_items` ( `item_kit_id` int(11) NOT NULL, `item_id` int(11) NOT NULL, - `quantity` decimal(15,2) NOT NULL, + `quantity` decimal(15,3) NOT NULL, PRIMARY KEY (`item_kit_id`,`item_id`,`quantity`), KEY `ospos_item_kit_items_ibfk_2` (`item_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; @@ -254,7 +257,7 @@ CREATE TABLE `ospos_item_kit_items` ( CREATE TABLE IF NOT EXISTS `ospos_item_quantities` ( `item_id` int(11) NOT NULL, `location_id` int(11) NOT NULL, - `quantity` int(11) NOT NULL DEFAULT '0', + `quantity` decimal(15,3) NOT NULL DEFAULT '0', PRIMARY KEY (`item_id`,`location_id`), KEY `item_id` (`item_id`), KEY `location_id` (`location_id`) @@ -446,12 +449,12 @@ CREATE TABLE `ospos_receivings_items` ( `description` varchar(30) DEFAULT NULL, `serialnumber` varchar(30) DEFAULT NULL, `line` int(3) NOT NULL, - `quantity_purchased` decimal(15,2) NOT NULL DEFAULT '0', + `quantity_purchased` decimal(15,3) NOT NULL DEFAULT '0', `item_cost_price` decimal(15,2) NOT NULL, `item_unit_price` decimal(15,2) NOT NULL, `discount_percent` decimal(15,2) NOT NULL DEFAULT '0', `item_location` int(11) NOT NULL, - `receiving_quantity` int(11) NOT NULL DEFAULT '1', + `receiving_quantity` decimal(15,3) NOT NULL DEFAULT '1', PRIMARY KEY (`receiving_id`,`item_id`,`line`), KEY `item_id` (`item_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; @@ -498,7 +501,7 @@ CREATE TABLE `ospos_sales_items` ( `description` varchar(30) DEFAULT NULL, `serialnumber` varchar(30) DEFAULT NULL, `line` int(3) NOT NULL DEFAULT '0', - `quantity_purchased` decimal(15,2) NOT NULL DEFAULT '0.00', + `quantity_purchased` decimal(15,3) NOT NULL DEFAULT '0', `item_cost_price` decimal(15,2) NOT NULL, `item_unit_price` decimal(15,2) NOT NULL, `discount_percent` decimal(15,2) NOT NULL DEFAULT '0', @@ -590,7 +593,7 @@ CREATE TABLE `ospos_sales_suspended_items` ( `description` varchar(30) DEFAULT NULL, `serialnumber` varchar(30) DEFAULT NULL, `line` int(3) NOT NULL DEFAULT '0', - `quantity_purchased` decimal(15,2) NOT NULL DEFAULT '0.00', + `quantity_purchased` decimal(15,3) NOT NULL DEFAULT '0', `item_cost_price` decimal(15,2) NOT NULL, `item_unit_price` decimal(15,2) NOT NULL, `discount_percent` decimal(15,2) NOT NULL DEFAULT '0', @@ -702,7 +705,6 @@ CREATE TABLE `ospos_suppliers` ( -- - -- -- Constraints for dumped tables -- diff --git a/database/migrate_phppos_dist.sql b/database/migrate_phppos_dist.sql index 96de768cf..09ceaca22 100644 --- a/database/migrate_phppos_dist.sql +++ b/database/migrate_phppos_dist.sql @@ -57,7 +57,10 @@ INSERT INTO `ospos_app_config` (`key`, `value`) VALUES ('show_total_discount', '1'), ('dateformat', 'm/d/Y'), ('timeformat', 'H:i:s'), -('currency_symbol', '$'); +('currency_symbol', '$'), +('decimal_point', '.'), +('currency_decimals', '2'), +('quantity_decimals', '0'); -- -------------------------------------------------------- @@ -164,8 +167,8 @@ CREATE TABLE `ospos_items` ( `description` varchar(255) NOT NULL, `cost_price` decimal(15,2) NOT NULL, `unit_price` decimal(15,2) NOT NULL, - `reorder_level` decimal(15,2) NOT NULL DEFAULT '0', - `receiving_quantity` int(11) NOT NULL DEFAULT '1', + `reorder_level` decimal(15,3) NOT NULL DEFAULT '0', + `receiving_quantity` decimal(15,3) NOT NULL DEFAULT '1', `item_id` int(10) NOT NULL AUTO_INCREMENT, `pic_id` int(10) DEFAULT NULL, `allow_alt_description` tinyint(1) NOT NULL, @@ -236,7 +239,7 @@ CREATE TABLE `ospos_item_kits` ( CREATE TABLE `ospos_item_kit_items` ( `item_kit_id` int(11) NOT NULL, `item_id` int(11) NOT NULL, - `quantity` decimal(15,2) NOT NULL, + `quantity` decimal(15,3) NOT NULL, PRIMARY KEY (`item_kit_id`,`item_id`,`quantity`), KEY `ospos_item_kit_items_ibfk_2` (`item_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; @@ -254,7 +257,7 @@ CREATE TABLE `ospos_item_kit_items` ( CREATE TABLE IF NOT EXISTS `ospos_item_quantities` ( `item_id` int(11) NOT NULL, `location_id` int(11) NOT NULL, - `quantity` int(11) NOT NULL DEFAULT '0', + `quantity` decimal(15,3) NOT NULL DEFAULT '0', PRIMARY KEY (`item_id`,`location_id`), KEY `item_id` (`item_id`), KEY `location_id` (`location_id`) @@ -446,12 +449,12 @@ CREATE TABLE `ospos_receivings_items` ( `description` varchar(30) DEFAULT NULL, `serialnumber` varchar(30) DEFAULT NULL, `line` int(3) NOT NULL, - `quantity_purchased` decimal(15,2) NOT NULL DEFAULT '0', + `quantity_purchased` decimal(15,3) NOT NULL DEFAULT '0', `item_cost_price` decimal(15,2) NOT NULL, `item_unit_price` decimal(15,2) NOT NULL, `discount_percent` decimal(15,2) NOT NULL DEFAULT '0', `item_location` int(11) NOT NULL, - `receiving_quantity` int(11) NOT NULL DEFAULT '1', + `receiving_quantity` decimal(15,3) NOT NULL DEFAULT '1', PRIMARY KEY (`receiving_id`,`item_id`,`line`), KEY `item_id` (`item_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; @@ -498,7 +501,7 @@ CREATE TABLE `ospos_sales_items` ( `description` varchar(30) DEFAULT NULL, `serialnumber` varchar(30) DEFAULT NULL, `line` int(3) NOT NULL DEFAULT '0', - `quantity_purchased` decimal(15,2) NOT NULL DEFAULT '0.00', + `quantity_purchased` decimal(15,3) NOT NULL DEFAULT '0', `item_cost_price` decimal(15,2) NOT NULL, `item_unit_price` decimal(15,2) NOT NULL, `discount_percent` decimal(15,2) NOT NULL DEFAULT '0', @@ -590,7 +593,7 @@ CREATE TABLE `ospos_sales_suspended_items` ( `description` varchar(30) DEFAULT NULL, `serialnumber` varchar(30) DEFAULT NULL, `line` int(3) NOT NULL DEFAULT '0', - `quantity_purchased` decimal(15,2) NOT NULL DEFAULT '0.00', + `quantity_purchased` decimal(15,3) NOT NULL DEFAULT '0', `item_cost_price` decimal(15,2) NOT NULL, `item_unit_price` decimal(15,2) NOT NULL, `discount_percent` decimal(15,2) NOT NULL DEFAULT '0', @@ -702,7 +705,6 @@ CREATE TABLE `ospos_suppliers` ( -- - -- -- This migration script should be run after creating tables with the regular database script and before applying the constraints. -- diff --git a/database/tables.sql b/database/tables.sql index 5a49247fc..99f094c8a 100644 --- a/database/tables.sql +++ b/database/tables.sql @@ -57,7 +57,10 @@ INSERT INTO `ospos_app_config` (`key`, `value`) VALUES ('show_total_discount', '1'), ('dateformat', 'm/d/Y'), ('timeformat', 'H:i:s'), -('currency_symbol', '$'); +('currency_symbol', '$'), +('decimal_point', '.'), +('currency_decimals', '2'), +('quantity_decimals', '0'); -- -------------------------------------------------------- @@ -164,8 +167,8 @@ CREATE TABLE `ospos_items` ( `description` varchar(255) NOT NULL, `cost_price` decimal(15,2) NOT NULL, `unit_price` decimal(15,2) NOT NULL, - `reorder_level` decimal(15,2) NOT NULL DEFAULT '0', - `receiving_quantity` int(11) NOT NULL DEFAULT '1', + `reorder_level` decimal(15,3) NOT NULL DEFAULT '0', + `receiving_quantity` decimal(15,3) NOT NULL DEFAULT '1', `item_id` int(10) NOT NULL AUTO_INCREMENT, `pic_id` int(10) DEFAULT NULL, `allow_alt_description` tinyint(1) NOT NULL, @@ -200,7 +203,7 @@ CREATE TABLE `ospos_items` ( CREATE TABLE `ospos_items_taxes` ( `item_id` int(10) NOT NULL, `name` varchar(255) NOT NULL, - `percent` decimal(15,2) NOT NULL, + `percent` decimal(15,3) NOT NULL, PRIMARY KEY (`item_id`,`name`,`percent`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; @@ -236,7 +239,7 @@ CREATE TABLE `ospos_item_kits` ( CREATE TABLE `ospos_item_kit_items` ( `item_kit_id` int(11) NOT NULL, `item_id` int(11) NOT NULL, - `quantity` decimal(15,2) NOT NULL, + `quantity` decimal(15,3) NOT NULL, PRIMARY KEY (`item_kit_id`,`item_id`,`quantity`), KEY `ospos_item_kit_items_ibfk_2` (`item_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; @@ -254,7 +257,7 @@ CREATE TABLE `ospos_item_kit_items` ( CREATE TABLE IF NOT EXISTS `ospos_item_quantities` ( `item_id` int(11) NOT NULL, `location_id` int(11) NOT NULL, - `quantity` int(11) NOT NULL DEFAULT '0', + `quantity` decimal(15,3) NOT NULL DEFAULT '0', PRIMARY KEY (`item_id`,`location_id`), KEY `item_id` (`item_id`), KEY `location_id` (`location_id`) @@ -446,12 +449,12 @@ CREATE TABLE `ospos_receivings_items` ( `description` varchar(30) DEFAULT NULL, `serialnumber` varchar(30) DEFAULT NULL, `line` int(3) NOT NULL, - `quantity_purchased` decimal(15,2) NOT NULL DEFAULT '0', + `quantity_purchased` decimal(15,3) NOT NULL DEFAULT '0', `item_cost_price` decimal(15,2) NOT NULL, `item_unit_price` decimal(15,2) NOT NULL, `discount_percent` decimal(15,2) NOT NULL DEFAULT '0', `item_location` int(11) NOT NULL, - `receiving_quantity` int(11) NOT NULL DEFAULT '1', + `receiving_quantity` decimal(15,3) NOT NULL DEFAULT '1', PRIMARY KEY (`receiving_id`,`item_id`,`line`), KEY `item_id` (`item_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; @@ -498,7 +501,7 @@ CREATE TABLE `ospos_sales_items` ( `description` varchar(30) DEFAULT NULL, `serialnumber` varchar(30) DEFAULT NULL, `line` int(3) NOT NULL DEFAULT '0', - `quantity_purchased` decimal(15,2) NOT NULL DEFAULT '0.00', + `quantity_purchased` decimal(15,3) NOT NULL DEFAULT '0', `item_cost_price` decimal(15,2) NOT NULL, `item_unit_price` decimal(15,2) NOT NULL, `discount_percent` decimal(15,2) NOT NULL DEFAULT '0', @@ -525,7 +528,7 @@ CREATE TABLE `ospos_sales_items_taxes` ( `item_id` int(10) NOT NULL, `line` int(3) NOT NULL DEFAULT '0', `name` varchar(255) NOT NULL, - `percent` decimal(15,2) NOT NULL, + `percent` decimal(15,3) NOT NULL, PRIMARY KEY (`sale_id`,`item_id`,`line`,`name`,`percent`), KEY `sale_id` (`sale_id`), KEY `item_id` (`item_id`) @@ -590,7 +593,7 @@ CREATE TABLE `ospos_sales_suspended_items` ( `description` varchar(30) DEFAULT NULL, `serialnumber` varchar(30) DEFAULT NULL, `line` int(3) NOT NULL DEFAULT '0', - `quantity_purchased` decimal(15,2) NOT NULL DEFAULT '0.00', + `quantity_purchased` decimal(15,3) NOT NULL DEFAULT '0', `item_cost_price` decimal(15,2) NOT NULL, `item_unit_price` decimal(15,2) NOT NULL, `discount_percent` decimal(15,2) NOT NULL DEFAULT '0', @@ -616,7 +619,7 @@ CREATE TABLE `ospos_sales_suspended_items_taxes` ( `item_id` int(10) NOT NULL, `line` int(3) NOT NULL DEFAULT '0', `name` varchar(255) NOT NULL, - `percent` decimal(15,2) NOT NULL, + `percent` decimal(15,3) NOT NULL, PRIMARY KEY (`sale_id`,`item_id`,`line`,`name`,`percent`), KEY `item_id` (`item_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; @@ -701,4 +704,3 @@ CREATE TABLE `ospos_suppliers` ( -- Dumping data for table `ospos_suppliers` -- - diff --git a/dist/bootstrap.min.css b/dist/bootstrap.min.css new file mode 100644 index 000000000..ac5afc246 --- /dev/null +++ b/dist/bootstrap.min.css @@ -0,0 +1,11 @@ +@import url("https://fonts.googleapis.com/css?family=Lato:400,700,400italic");/*! + * bootswatch v3.3.6 + * Homepage: http://bootswatch.com + * Copyright 2012-2015 Thomas Park + * Licensed under MIT + * Based on Bootstrap +*//*! + * Bootstrap v3.3.6 (http://getbootstrap.com) + * Copyright 2011-2015 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + *//*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:bold}dfn{font-style:italic}h1{font-size:2em;margin:0.67em 0}mark{background:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-0.5em}sub{bottom:-0.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;height:0}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace, monospace;font-size:1em}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,html input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input{line-height:normal}input[type="checkbox"],input[type="radio"]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:0}input[type="number"]::-webkit-inner-spin-button,input[type="number"]::-webkit-outer-spin-button{height:auto}input[type="search"]{-webkit-appearance:textfield;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance:none}fieldset{border:1px solid #c0c0c0;margin:0 2px;padding:0.35em 0.625em 0.75em}legend{border:0;padding:0}textarea{overflow:auto}optgroup{font-weight:bold}table{border-collapse:collapse;border-spacing:0}td,th{padding:0}/*! Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css */@media print{*,*:before,*:after{background:transparent !important;color:#000 !important;-webkit-box-shadow:none !important;box-shadow:none !important;text-shadow:none !important}a,a:visited{text-decoration:underline}a[href]:after{content:" (" attr(href) ")"}abbr[title]:after{content:" (" attr(title) ")"}a[href^="#"]:after,a[href^="javascript:"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100% !important}p,h2,h3{orphans:3;widows:3}h2,h3{page-break-after:avoid}.navbar{display:none}.btn>.caret,.dropup>.btn>.caret{border-top-color:#000 !important}.label{border:1px solid #000}.table{border-collapse:collapse !important}.table td,.table th{background-color:#fff !important}.table-bordered th,.table-bordered td{border:1px solid #ddd !important}}@font-face{font-family:'Glyphicons Halflings';src:url('../fonts/glyphicons-halflings-regular.eot');src:url('../fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'),url('../fonts/glyphicons-halflings-regular.woff2') format('woff2'),url('../fonts/glyphicons-halflings-regular.woff') format('woff'),url('../fonts/glyphicons-halflings-regular.ttf') format('truetype'),url('../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular') format('svg')}.glyphicon{position:relative;top:1px;display:inline-block;font-family:'Glyphicons Halflings';font-style:normal;font-weight:normal;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.glyphicon-asterisk:before{content:"\002a"}.glyphicon-plus:before{content:"\002b"}.glyphicon-euro:before,.glyphicon-eur:before{content:"\20ac"}.glyphicon-minus:before{content:"\2212"}.glyphicon-cloud:before{content:"\2601"}.glyphicon-envelope:before{content:"\2709"}.glyphicon-pencil:before{content:"\270f"}.glyphicon-glass:before{content:"\e001"}.glyphicon-music:before{content:"\e002"}.glyphicon-search:before{content:"\e003"}.glyphicon-heart:before{content:"\e005"}.glyphicon-star:before{content:"\e006"}.glyphicon-star-empty:before{content:"\e007"}.glyphicon-user:before{content:"\e008"}.glyphicon-film:before{content:"\e009"}.glyphicon-th-large:before{content:"\e010"}.glyphicon-th:before{content:"\e011"}.glyphicon-th-list:before{content:"\e012"}.glyphicon-ok:before{content:"\e013"}.glyphicon-remove:before{content:"\e014"}.glyphicon-zoom-in:before{content:"\e015"}.glyphicon-zoom-out:before{content:"\e016"}.glyphicon-off:before{content:"\e017"}.glyphicon-signal:before{content:"\e018"}.glyphicon-cog:before{content:"\e019"}.glyphicon-trash:before{content:"\e020"}.glyphicon-home:before{content:"\e021"}.glyphicon-file:before{content:"\e022"}.glyphicon-time:before{content:"\e023"}.glyphicon-road:before{content:"\e024"}.glyphicon-download-alt:before{content:"\e025"}.glyphicon-download:before{content:"\e026"}.glyphicon-upload:before{content:"\e027"}.glyphicon-inbox:before{content:"\e028"}.glyphicon-play-circle:before{content:"\e029"}.glyphicon-repeat:before{content:"\e030"}.glyphicon-refresh:before{content:"\e031"}.glyphicon-list-alt:before{content:"\e032"}.glyphicon-lock:before{content:"\e033"}.glyphicon-flag:before{content:"\e034"}.glyphicon-headphones:before{content:"\e035"}.glyphicon-volume-off:before{content:"\e036"}.glyphicon-volume-down:before{content:"\e037"}.glyphicon-volume-up:before{content:"\e038"}.glyphicon-qrcode:before{content:"\e039"}.glyphicon-barcode:before{content:"\e040"}.glyphicon-tag:before{content:"\e041"}.glyphicon-tags:before{content:"\e042"}.glyphicon-book:before{content:"\e043"}.glyphicon-bookmark:before{content:"\e044"}.glyphicon-print:before{content:"\e045"}.glyphicon-camera:before{content:"\e046"}.glyphicon-font:before{content:"\e047"}.glyphicon-bold:before{content:"\e048"}.glyphicon-italic:before{content:"\e049"}.glyphicon-text-height:before{content:"\e050"}.glyphicon-text-width:before{content:"\e051"}.glyphicon-align-left:before{content:"\e052"}.glyphicon-align-center:before{content:"\e053"}.glyphicon-align-right:before{content:"\e054"}.glyphicon-align-justify:before{content:"\e055"}.glyphicon-list:before{content:"\e056"}.glyphicon-indent-left:before{content:"\e057"}.glyphicon-indent-right:before{content:"\e058"}.glyphicon-facetime-video:before{content:"\e059"}.glyphicon-picture:before{content:"\e060"}.glyphicon-map-marker:before{content:"\e062"}.glyphicon-adjust:before{content:"\e063"}.glyphicon-tint:before{content:"\e064"}.glyphicon-edit:before{content:"\e065"}.glyphicon-share:before{content:"\e066"}.glyphicon-check:before{content:"\e067"}.glyphicon-move:before{content:"\e068"}.glyphicon-step-backward:before{content:"\e069"}.glyphicon-fast-backward:before{content:"\e070"}.glyphicon-backward:before{content:"\e071"}.glyphicon-play:before{content:"\e072"}.glyphicon-pause:before{content:"\e073"}.glyphicon-stop:before{content:"\e074"}.glyphicon-forward:before{content:"\e075"}.glyphicon-fast-forward:before{content:"\e076"}.glyphicon-step-forward:before{content:"\e077"}.glyphicon-eject:before{content:"\e078"}.glyphicon-chevron-left:before{content:"\e079"}.glyphicon-chevron-right:before{content:"\e080"}.glyphicon-plus-sign:before{content:"\e081"}.glyphicon-minus-sign:before{content:"\e082"}.glyphicon-remove-sign:before{content:"\e083"}.glyphicon-ok-sign:before{content:"\e084"}.glyphicon-question-sign:before{content:"\e085"}.glyphicon-info-sign:before{content:"\e086"}.glyphicon-screenshot:before{content:"\e087"}.glyphicon-remove-circle:before{content:"\e088"}.glyphicon-ok-circle:before{content:"\e089"}.glyphicon-ban-circle:before{content:"\e090"}.glyphicon-arrow-left:before{content:"\e091"}.glyphicon-arrow-right:before{content:"\e092"}.glyphicon-arrow-up:before{content:"\e093"}.glyphicon-arrow-down:before{content:"\e094"}.glyphicon-share-alt:before{content:"\e095"}.glyphicon-resize-full:before{content:"\e096"}.glyphicon-resize-small:before{content:"\e097"}.glyphicon-exclamation-sign:before{content:"\e101"}.glyphicon-gift:before{content:"\e102"}.glyphicon-leaf:before{content:"\e103"}.glyphicon-fire:before{content:"\e104"}.glyphicon-eye-open:before{content:"\e105"}.glyphicon-eye-close:before{content:"\e106"}.glyphicon-warning-sign:before{content:"\e107"}.glyphicon-plane:before{content:"\e108"}.glyphicon-calendar:before{content:"\e109"}.glyphicon-random:before{content:"\e110"}.glyphicon-comment:before{content:"\e111"}.glyphicon-magnet:before{content:"\e112"}.glyphicon-chevron-up:before{content:"\e113"}.glyphicon-chevron-down:before{content:"\e114"}.glyphicon-retweet:before{content:"\e115"}.glyphicon-shopping-cart:before{content:"\e116"}.glyphicon-folder-close:before{content:"\e117"}.glyphicon-folder-open:before{content:"\e118"}.glyphicon-resize-vertical:before{content:"\e119"}.glyphicon-resize-horizontal:before{content:"\e120"}.glyphicon-hdd:before{content:"\e121"}.glyphicon-bullhorn:before{content:"\e122"}.glyphicon-bell:before{content:"\e123"}.glyphicon-certificate:before{content:"\e124"}.glyphicon-thumbs-up:before{content:"\e125"}.glyphicon-thumbs-down:before{content:"\e126"}.glyphicon-hand-right:before{content:"\e127"}.glyphicon-hand-left:before{content:"\e128"}.glyphicon-hand-up:before{content:"\e129"}.glyphicon-hand-down:before{content:"\e130"}.glyphicon-circle-arrow-right:before{content:"\e131"}.glyphicon-circle-arrow-left:before{content:"\e132"}.glyphicon-circle-arrow-up:before{content:"\e133"}.glyphicon-circle-arrow-down:before{content:"\e134"}.glyphicon-globe:before{content:"\e135"}.glyphicon-wrench:before{content:"\e136"}.glyphicon-tasks:before{content:"\e137"}.glyphicon-filter:before{content:"\e138"}.glyphicon-briefcase:before{content:"\e139"}.glyphicon-fullscreen:before{content:"\e140"}.glyphicon-dashboard:before{content:"\e141"}.glyphicon-paperclip:before{content:"\e142"}.glyphicon-heart-empty:before{content:"\e143"}.glyphicon-link:before{content:"\e144"}.glyphicon-phone:before{content:"\e145"}.glyphicon-pushpin:before{content:"\e146"}.glyphicon-usd:before{content:"\e148"}.glyphicon-gbp:before{content:"\e149"}.glyphicon-sort:before{content:"\e150"}.glyphicon-sort-by-alphabet:before{content:"\e151"}.glyphicon-sort-by-alphabet-alt:before{content:"\e152"}.glyphicon-sort-by-order:before{content:"\e153"}.glyphicon-sort-by-order-alt:before{content:"\e154"}.glyphicon-sort-by-attributes:before{content:"\e155"}.glyphicon-sort-by-attributes-alt:before{content:"\e156"}.glyphicon-unchecked:before{content:"\e157"}.glyphicon-expand:before{content:"\e158"}.glyphicon-collapse-down:before{content:"\e159"}.glyphicon-collapse-up:before{content:"\e160"}.glyphicon-log-in:before{content:"\e161"}.glyphicon-flash:before{content:"\e162"}.glyphicon-log-out:before{content:"\e163"}.glyphicon-new-window:before{content:"\e164"}.glyphicon-record:before{content:"\e165"}.glyphicon-save:before{content:"\e166"}.glyphicon-open:before{content:"\e167"}.glyphicon-saved:before{content:"\e168"}.glyphicon-import:before{content:"\e169"}.glyphicon-export:before{content:"\e170"}.glyphicon-send:before{content:"\e171"}.glyphicon-floppy-disk:before{content:"\e172"}.glyphicon-floppy-saved:before{content:"\e173"}.glyphicon-floppy-remove:before{content:"\e174"}.glyphicon-floppy-save:before{content:"\e175"}.glyphicon-floppy-open:before{content:"\e176"}.glyphicon-credit-card:before{content:"\e177"}.glyphicon-transfer:before{content:"\e178"}.glyphicon-cutlery:before{content:"\e179"}.glyphicon-header:before{content:"\e180"}.glyphicon-compressed:before{content:"\e181"}.glyphicon-earphone:before{content:"\e182"}.glyphicon-phone-alt:before{content:"\e183"}.glyphicon-tower:before{content:"\e184"}.glyphicon-stats:before{content:"\e185"}.glyphicon-sd-video:before{content:"\e186"}.glyphicon-hd-video:before{content:"\e187"}.glyphicon-subtitles:before{content:"\e188"}.glyphicon-sound-stereo:before{content:"\e189"}.glyphicon-sound-dolby:before{content:"\e190"}.glyphicon-sound-5-1:before{content:"\e191"}.glyphicon-sound-6-1:before{content:"\e192"}.glyphicon-sound-7-1:before{content:"\e193"}.glyphicon-copyright-mark:before{content:"\e194"}.glyphicon-registration-mark:before{content:"\e195"}.glyphicon-cloud-download:before{content:"\e197"}.glyphicon-cloud-upload:before{content:"\e198"}.glyphicon-tree-conifer:before{content:"\e199"}.glyphicon-tree-deciduous:before{content:"\e200"}.glyphicon-cd:before{content:"\e201"}.glyphicon-save-file:before{content:"\e202"}.glyphicon-open-file:before{content:"\e203"}.glyphicon-level-up:before{content:"\e204"}.glyphicon-copy:before{content:"\e205"}.glyphicon-paste:before{content:"\e206"}.glyphicon-alert:before{content:"\e209"}.glyphicon-equalizer:before{content:"\e210"}.glyphicon-king:before{content:"\e211"}.glyphicon-queen:before{content:"\e212"}.glyphicon-pawn:before{content:"\e213"}.glyphicon-bishop:before{content:"\e214"}.glyphicon-knight:before{content:"\e215"}.glyphicon-baby-formula:before{content:"\e216"}.glyphicon-tent:before{content:"\26fa"}.glyphicon-blackboard:before{content:"\e218"}.glyphicon-bed:before{content:"\e219"}.glyphicon-apple:before{content:"\f8ff"}.glyphicon-erase:before{content:"\e221"}.glyphicon-hourglass:before{content:"\231b"}.glyphicon-lamp:before{content:"\e223"}.glyphicon-duplicate:before{content:"\e224"}.glyphicon-piggy-bank:before{content:"\e225"}.glyphicon-scissors:before{content:"\e226"}.glyphicon-bitcoin:before{content:"\e227"}.glyphicon-btc:before{content:"\e227"}.glyphicon-xbt:before{content:"\e227"}.glyphicon-yen:before{content:"\00a5"}.glyphicon-jpy:before{content:"\00a5"}.glyphicon-ruble:before{content:"\20bd"}.glyphicon-rub:before{content:"\20bd"}.glyphicon-scale:before{content:"\e230"}.glyphicon-ice-lolly:before{content:"\e231"}.glyphicon-ice-lolly-tasted:before{content:"\e232"}.glyphicon-education:before{content:"\e233"}.glyphicon-option-horizontal:before{content:"\e234"}.glyphicon-option-vertical:before{content:"\e235"}.glyphicon-menu-hamburger:before{content:"\e236"}.glyphicon-modal-window:before{content:"\e237"}.glyphicon-oil:before{content:"\e238"}.glyphicon-grain:before{content:"\e239"}.glyphicon-sunglasses:before{content:"\e240"}.glyphicon-text-size:before{content:"\e241"}.glyphicon-text-color:before{content:"\e242"}.glyphicon-text-background:before{content:"\e243"}.glyphicon-object-align-top:before{content:"\e244"}.glyphicon-object-align-bottom:before{content:"\e245"}.glyphicon-object-align-horizontal:before{content:"\e246"}.glyphicon-object-align-left:before{content:"\e247"}.glyphicon-object-align-vertical:before{content:"\e248"}.glyphicon-object-align-right:before{content:"\e249"}.glyphicon-triangle-right:before{content:"\e250"}.glyphicon-triangle-left:before{content:"\e251"}.glyphicon-triangle-bottom:before{content:"\e252"}.glyphicon-triangle-top:before{content:"\e253"}.glyphicon-console:before{content:"\e254"}.glyphicon-superscript:before{content:"\e255"}.glyphicon-subscript:before{content:"\e256"}.glyphicon-menu-left:before{content:"\e257"}.glyphicon-menu-right:before{content:"\e258"}.glyphicon-menu-down:before{content:"\e259"}.glyphicon-menu-up:before{content:"\e260"}*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}*:before,*:after{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}html{font-size:10px;-webkit-tap-highlight-color:rgba(0,0,0,0)}body{font-family:"Lato","Helvetica Neue",Helvetica,Arial,sans-serif;font-size:15px;line-height:1.42857143;color:#2c3e50;background-color:#ffffff}input,button,select,textarea{font-family:inherit;font-size:inherit;line-height:inherit}a{color:#18bc9c;text-decoration:none}a:hover,a:focus{color:#18bc9c;text-decoration:underline}a:focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}figure{margin:0}img{vertical-align:middle}.img-responsive,.thumbnail>img,.thumbnail a>img,.carousel-inner>.item>img,.carousel-inner>.item>a>img{display:block;max-width:100%;height:auto}.img-rounded{border-radius:6px}.img-thumbnail{padding:4px;line-height:1.42857143;background-color:#ffffff;border:1px solid #ecf0f1;border-radius:4px;-webkit-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out;display:inline-block;max-width:100%;height:auto}.img-circle{border-radius:50%}hr{margin-top:21px;margin-bottom:21px;border:0;border-top:1px solid #ecf0f1}.sr-only{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0, 0, 0, 0);border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;margin:0;overflow:visible;clip:auto}[role="button"]{cursor:pointer}h1,h2,h3,h4,h5,h6,.h1,.h2,.h3,.h4,.h5,.h6{font-family:"Lato","Helvetica Neue",Helvetica,Arial,sans-serif;font-weight:400;line-height:1.1;color:inherit}h1 small,h2 small,h3 small,h4 small,h5 small,h6 small,.h1 small,.h2 small,.h3 small,.h4 small,.h5 small,.h6 small,h1 .small,h2 .small,h3 .small,h4 .small,h5 .small,h6 .small,.h1 .small,.h2 .small,.h3 .small,.h4 .small,.h5 .small,.h6 .small{font-weight:normal;line-height:1;color:#b4bcc2}h1,.h1,h2,.h2,h3,.h3{margin-top:21px;margin-bottom:10.5px}h1 small,.h1 small,h2 small,.h2 small,h3 small,.h3 small,h1 .small,.h1 .small,h2 .small,.h2 .small,h3 .small,.h3 .small{font-size:65%}h4,.h4,h5,.h5,h6,.h6{margin-top:10.5px;margin-bottom:10.5px}h4 small,.h4 small,h5 small,.h5 small,h6 small,.h6 small,h4 .small,.h4 .small,h5 .small,.h5 .small,h6 .small,.h6 .small{font-size:75%}h1,.h1{font-size:39px}h2,.h2{font-size:32px}h3,.h3{font-size:26px}h4,.h4{font-size:19px}h5,.h5{font-size:15px}h6,.h6{font-size:13px}p{margin:0 0 10.5px}.lead{margin-bottom:21px;font-size:17px;font-weight:300;line-height:1.4}@media (min-width:768px){.lead{font-size:22.5px}}small,.small{font-size:86%}mark,.mark{background-color:#f39c12;padding:.2em}.text-left{text-align:left}.text-right{text-align:right}.text-center{text-align:center}.text-justify{text-align:justify}.text-nowrap{white-space:nowrap}.text-lowercase{text-transform:lowercase}.text-uppercase{text-transform:uppercase}.text-capitalize{text-transform:capitalize}.text-muted{color:#b4bcc2}.text-primary{color:#2c3e50}a.text-primary:hover,a.text-primary:focus{color:#1a242f}.text-success{color:#ffffff}a.text-success:hover,a.text-success:focus{color:#e6e6e6}.text-info{color:#ffffff}a.text-info:hover,a.text-info:focus{color:#e6e6e6}.text-warning{color:#ffffff}a.text-warning:hover,a.text-warning:focus{color:#e6e6e6}.text-danger{color:#ffffff}a.text-danger:hover,a.text-danger:focus{color:#e6e6e6}.bg-primary{color:#fff;background-color:#2c3e50}a.bg-primary:hover,a.bg-primary:focus{background-color:#1a242f}.bg-success{background-color:#18bc9c}a.bg-success:hover,a.bg-success:focus{background-color:#128f76}.bg-info{background-color:#3498db}a.bg-info:hover,a.bg-info:focus{background-color:#217dbb}.bg-warning{background-color:#f39c12}a.bg-warning:hover,a.bg-warning:focus{background-color:#c87f0a}.bg-danger{background-color:#e74c3c}a.bg-danger:hover,a.bg-danger:focus{background-color:#d62c1a}.page-header{padding-bottom:9.5px;margin:42px 0 21px;border-bottom:1px solid transparent}ul,ol{margin-top:0;margin-bottom:10.5px}ul ul,ol ul,ul ol,ol ol{margin-bottom:0}.list-unstyled{padding-left:0;list-style:none}.list-inline{padding-left:0;list-style:none;margin-left:-5px}.list-inline>li{display:inline-block;padding-left:5px;padding-right:5px}dl{margin-top:0;margin-bottom:21px}dt,dd{line-height:1.42857143}dt{font-weight:bold}dd{margin-left:0}@media (min-width:768px){.dl-horizontal dt{float:left;width:160px;clear:left;text-align:right;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dl-horizontal dd{margin-left:180px}}abbr[title],abbr[data-original-title]{cursor:help;border-bottom:1px dotted #b4bcc2}.initialism{font-size:90%;text-transform:uppercase}blockquote{padding:10.5px 21px;margin:0 0 21px;font-size:18.75px;border-left:5px solid #ecf0f1}blockquote p:last-child,blockquote ul:last-child,blockquote ol:last-child{margin-bottom:0}blockquote footer,blockquote small,blockquote .small{display:block;font-size:80%;line-height:1.42857143;color:#b4bcc2}blockquote footer:before,blockquote small:before,blockquote .small:before{content:'\2014 \00A0'}.blockquote-reverse,blockquote.pull-right{padding-right:15px;padding-left:0;border-right:5px solid #ecf0f1;border-left:0;text-align:right}.blockquote-reverse footer:before,blockquote.pull-right footer:before,.blockquote-reverse small:before,blockquote.pull-right small:before,.blockquote-reverse .small:before,blockquote.pull-right .small:before{content:''}.blockquote-reverse footer:after,blockquote.pull-right footer:after,.blockquote-reverse small:after,blockquote.pull-right small:after,.blockquote-reverse .small:after,blockquote.pull-right .small:after{content:'\00A0 \2014'}address{margin-bottom:21px;font-style:normal;line-height:1.42857143}code,kbd,pre,samp{font-family:Menlo,Monaco,Consolas,"Courier New",monospace}code{padding:2px 4px;font-size:90%;color:#c7254e;background-color:#f9f2f4;border-radius:4px}kbd{padding:2px 4px;font-size:90%;color:#ffffff;background-color:#333333;border-radius:3px;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,0.25);box-shadow:inset 0 -1px 0 rgba(0,0,0,0.25)}kbd kbd{padding:0;font-size:100%;font-weight:bold;-webkit-box-shadow:none;box-shadow:none}pre{display:block;padding:10px;margin:0 0 10.5px;font-size:14px;line-height:1.42857143;word-break:break-all;word-wrap:break-word;color:#7b8a8b;background-color:#ecf0f1;border:1px solid #cccccc;border-radius:4px}pre code{padding:0;font-size:inherit;color:inherit;white-space:pre-wrap;background-color:transparent;border-radius:0}.pre-scrollable{max-height:340px;overflow-y:scroll}.container{margin-right:auto;margin-left:auto;padding-left:15px;padding-right:15px}@media (min-width:768px){.container{width:750px}}@media (min-width:992px){.container{width:970px}}@media (min-width:1200px){.container{width:1170px}}.container-fluid{margin-right:auto;margin-left:auto;padding-left:15px;padding-right:15px}.row{margin-left:-15px;margin-right:-15px}.col-xs-1,.col-sm-1,.col-md-1,.col-lg-1,.col-xs-2,.col-sm-2,.col-md-2,.col-lg-2,.col-xs-3,.col-sm-3,.col-md-3,.col-lg-3,.col-xs-4,.col-sm-4,.col-md-4,.col-lg-4,.col-xs-5,.col-sm-5,.col-md-5,.col-lg-5,.col-xs-6,.col-sm-6,.col-md-6,.col-lg-6,.col-xs-7,.col-sm-7,.col-md-7,.col-lg-7,.col-xs-8,.col-sm-8,.col-md-8,.col-lg-8,.col-xs-9,.col-sm-9,.col-md-9,.col-lg-9,.col-xs-10,.col-sm-10,.col-md-10,.col-lg-10,.col-xs-11,.col-sm-11,.col-md-11,.col-lg-11,.col-xs-12,.col-sm-12,.col-md-12,.col-lg-12{position:relative;min-height:1px;padding-left:15px;padding-right:15px}.col-xs-1,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9,.col-xs-10,.col-xs-11,.col-xs-12{float:left}.col-xs-12{width:100%}.col-xs-11{width:91.66666667%}.col-xs-10{width:83.33333333%}.col-xs-9{width:75%}.col-xs-8{width:66.66666667%}.col-xs-7{width:58.33333333%}.col-xs-6{width:50%}.col-xs-5{width:41.66666667%}.col-xs-4{width:33.33333333%}.col-xs-3{width:25%}.col-xs-2{width:16.66666667%}.col-xs-1{width:8.33333333%}.col-xs-pull-12{right:100%}.col-xs-pull-11{right:91.66666667%}.col-xs-pull-10{right:83.33333333%}.col-xs-pull-9{right:75%}.col-xs-pull-8{right:66.66666667%}.col-xs-pull-7{right:58.33333333%}.col-xs-pull-6{right:50%}.col-xs-pull-5{right:41.66666667%}.col-xs-pull-4{right:33.33333333%}.col-xs-pull-3{right:25%}.col-xs-pull-2{right:16.66666667%}.col-xs-pull-1{right:8.33333333%}.col-xs-pull-0{right:auto}.col-xs-push-12{left:100%}.col-xs-push-11{left:91.66666667%}.col-xs-push-10{left:83.33333333%}.col-xs-push-9{left:75%}.col-xs-push-8{left:66.66666667%}.col-xs-push-7{left:58.33333333%}.col-xs-push-6{left:50%}.col-xs-push-5{left:41.66666667%}.col-xs-push-4{left:33.33333333%}.col-xs-push-3{left:25%}.col-xs-push-2{left:16.66666667%}.col-xs-push-1{left:8.33333333%}.col-xs-push-0{left:auto}.col-xs-offset-12{margin-left:100%}.col-xs-offset-11{margin-left:91.66666667%}.col-xs-offset-10{margin-left:83.33333333%}.col-xs-offset-9{margin-left:75%}.col-xs-offset-8{margin-left:66.66666667%}.col-xs-offset-7{margin-left:58.33333333%}.col-xs-offset-6{margin-left:50%}.col-xs-offset-5{margin-left:41.66666667%}.col-xs-offset-4{margin-left:33.33333333%}.col-xs-offset-3{margin-left:25%}.col-xs-offset-2{margin-left:16.66666667%}.col-xs-offset-1{margin-left:8.33333333%}.col-xs-offset-0{margin-left:0%}@media (min-width:768px){.col-sm-1,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-sm-10,.col-sm-11,.col-sm-12{float:left}.col-sm-12{width:100%}.col-sm-11{width:91.66666667%}.col-sm-10{width:83.33333333%}.col-sm-9{width:75%}.col-sm-8{width:66.66666667%}.col-sm-7{width:58.33333333%}.col-sm-6{width:50%}.col-sm-5{width:41.66666667%}.col-sm-4{width:33.33333333%}.col-sm-3{width:25%}.col-sm-2{width:16.66666667%}.col-sm-1{width:8.33333333%}.col-sm-pull-12{right:100%}.col-sm-pull-11{right:91.66666667%}.col-sm-pull-10{right:83.33333333%}.col-sm-pull-9{right:75%}.col-sm-pull-8{right:66.66666667%}.col-sm-pull-7{right:58.33333333%}.col-sm-pull-6{right:50%}.col-sm-pull-5{right:41.66666667%}.col-sm-pull-4{right:33.33333333%}.col-sm-pull-3{right:25%}.col-sm-pull-2{right:16.66666667%}.col-sm-pull-1{right:8.33333333%}.col-sm-pull-0{right:auto}.col-sm-push-12{left:100%}.col-sm-push-11{left:91.66666667%}.col-sm-push-10{left:83.33333333%}.col-sm-push-9{left:75%}.col-sm-push-8{left:66.66666667%}.col-sm-push-7{left:58.33333333%}.col-sm-push-6{left:50%}.col-sm-push-5{left:41.66666667%}.col-sm-push-4{left:33.33333333%}.col-sm-push-3{left:25%}.col-sm-push-2{left:16.66666667%}.col-sm-push-1{left:8.33333333%}.col-sm-push-0{left:auto}.col-sm-offset-12{margin-left:100%}.col-sm-offset-11{margin-left:91.66666667%}.col-sm-offset-10{margin-left:83.33333333%}.col-sm-offset-9{margin-left:75%}.col-sm-offset-8{margin-left:66.66666667%}.col-sm-offset-7{margin-left:58.33333333%}.col-sm-offset-6{margin-left:50%}.col-sm-offset-5{margin-left:41.66666667%}.col-sm-offset-4{margin-left:33.33333333%}.col-sm-offset-3{margin-left:25%}.col-sm-offset-2{margin-left:16.66666667%}.col-sm-offset-1{margin-left:8.33333333%}.col-sm-offset-0{margin-left:0%}}@media (min-width:992px){.col-md-1,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-md-10,.col-md-11,.col-md-12{float:left}.col-md-12{width:100%}.col-md-11{width:91.66666667%}.col-md-10{width:83.33333333%}.col-md-9{width:75%}.col-md-8{width:66.66666667%}.col-md-7{width:58.33333333%}.col-md-6{width:50%}.col-md-5{width:41.66666667%}.col-md-4{width:33.33333333%}.col-md-3{width:25%}.col-md-2{width:16.66666667%}.col-md-1{width:8.33333333%}.col-md-pull-12{right:100%}.col-md-pull-11{right:91.66666667%}.col-md-pull-10{right:83.33333333%}.col-md-pull-9{right:75%}.col-md-pull-8{right:66.66666667%}.col-md-pull-7{right:58.33333333%}.col-md-pull-6{right:50%}.col-md-pull-5{right:41.66666667%}.col-md-pull-4{right:33.33333333%}.col-md-pull-3{right:25%}.col-md-pull-2{right:16.66666667%}.col-md-pull-1{right:8.33333333%}.col-md-pull-0{right:auto}.col-md-push-12{left:100%}.col-md-push-11{left:91.66666667%}.col-md-push-10{left:83.33333333%}.col-md-push-9{left:75%}.col-md-push-8{left:66.66666667%}.col-md-push-7{left:58.33333333%}.col-md-push-6{left:50%}.col-md-push-5{left:41.66666667%}.col-md-push-4{left:33.33333333%}.col-md-push-3{left:25%}.col-md-push-2{left:16.66666667%}.col-md-push-1{left:8.33333333%}.col-md-push-0{left:auto}.col-md-offset-12{margin-left:100%}.col-md-offset-11{margin-left:91.66666667%}.col-md-offset-10{margin-left:83.33333333%}.col-md-offset-9{margin-left:75%}.col-md-offset-8{margin-left:66.66666667%}.col-md-offset-7{margin-left:58.33333333%}.col-md-offset-6{margin-left:50%}.col-md-offset-5{margin-left:41.66666667%}.col-md-offset-4{margin-left:33.33333333%}.col-md-offset-3{margin-left:25%}.col-md-offset-2{margin-left:16.66666667%}.col-md-offset-1{margin-left:8.33333333%}.col-md-offset-0{margin-left:0%}}@media (min-width:1200px){.col-lg-1,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-lg-10,.col-lg-11,.col-lg-12{float:left}.col-lg-12{width:100%}.col-lg-11{width:91.66666667%}.col-lg-10{width:83.33333333%}.col-lg-9{width:75%}.col-lg-8{width:66.66666667%}.col-lg-7{width:58.33333333%}.col-lg-6{width:50%}.col-lg-5{width:41.66666667%}.col-lg-4{width:33.33333333%}.col-lg-3{width:25%}.col-lg-2{width:16.66666667%}.col-lg-1{width:8.33333333%}.col-lg-pull-12{right:100%}.col-lg-pull-11{right:91.66666667%}.col-lg-pull-10{right:83.33333333%}.col-lg-pull-9{right:75%}.col-lg-pull-8{right:66.66666667%}.col-lg-pull-7{right:58.33333333%}.col-lg-pull-6{right:50%}.col-lg-pull-5{right:41.66666667%}.col-lg-pull-4{right:33.33333333%}.col-lg-pull-3{right:25%}.col-lg-pull-2{right:16.66666667%}.col-lg-pull-1{right:8.33333333%}.col-lg-pull-0{right:auto}.col-lg-push-12{left:100%}.col-lg-push-11{left:91.66666667%}.col-lg-push-10{left:83.33333333%}.col-lg-push-9{left:75%}.col-lg-push-8{left:66.66666667%}.col-lg-push-7{left:58.33333333%}.col-lg-push-6{left:50%}.col-lg-push-5{left:41.66666667%}.col-lg-push-4{left:33.33333333%}.col-lg-push-3{left:25%}.col-lg-push-2{left:16.66666667%}.col-lg-push-1{left:8.33333333%}.col-lg-push-0{left:auto}.col-lg-offset-12{margin-left:100%}.col-lg-offset-11{margin-left:91.66666667%}.col-lg-offset-10{margin-left:83.33333333%}.col-lg-offset-9{margin-left:75%}.col-lg-offset-8{margin-left:66.66666667%}.col-lg-offset-7{margin-left:58.33333333%}.col-lg-offset-6{margin-left:50%}.col-lg-offset-5{margin-left:41.66666667%}.col-lg-offset-4{margin-left:33.33333333%}.col-lg-offset-3{margin-left:25%}.col-lg-offset-2{margin-left:16.66666667%}.col-lg-offset-1{margin-left:8.33333333%}.col-lg-offset-0{margin-left:0%}}table{background-color:transparent}caption{padding-top:8px;padding-bottom:8px;color:#b4bcc2;text-align:left}th{text-align:left}.table{width:100%;max-width:100%;margin-bottom:21px}.table>thead>tr>th,.table>tbody>tr>th,.table>tfoot>tr>th,.table>thead>tr>td,.table>tbody>tr>td,.table>tfoot>tr>td{padding:8px;line-height:1.42857143;vertical-align:top;border-top:1px solid #ecf0f1}.table>thead>tr>th{vertical-align:bottom;border-bottom:2px solid #ecf0f1}.table>caption+thead>tr:first-child>th,.table>colgroup+thead>tr:first-child>th,.table>thead:first-child>tr:first-child>th,.table>caption+thead>tr:first-child>td,.table>colgroup+thead>tr:first-child>td,.table>thead:first-child>tr:first-child>td{border-top:0}.table>tbody+tbody{border-top:2px solid #ecf0f1}.table .table{background-color:#ffffff}.table-condensed>thead>tr>th,.table-condensed>tbody>tr>th,.table-condensed>tfoot>tr>th,.table-condensed>thead>tr>td,.table-condensed>tbody>tr>td,.table-condensed>tfoot>tr>td{padding:5px}.table-bordered{border:1px solid #ecf0f1}.table-bordered>thead>tr>th,.table-bordered>tbody>tr>th,.table-bordered>tfoot>tr>th,.table-bordered>thead>tr>td,.table-bordered>tbody>tr>td,.table-bordered>tfoot>tr>td{border:1px solid #ecf0f1}.table-bordered>thead>tr>th,.table-bordered>thead>tr>td{border-bottom-width:2px}.table-striped>tbody>tr:nth-of-type(odd){background-color:#f9f9f9}.table-hover>tbody>tr:hover{background-color:#ecf0f1}table col[class*="col-"]{position:static;float:none;display:table-column}table td[class*="col-"],table th[class*="col-"]{position:static;float:none;display:table-cell}.table>thead>tr>td.active,.table>tbody>tr>td.active,.table>tfoot>tr>td.active,.table>thead>tr>th.active,.table>tbody>tr>th.active,.table>tfoot>tr>th.active,.table>thead>tr.active>td,.table>tbody>tr.active>td,.table>tfoot>tr.active>td,.table>thead>tr.active>th,.table>tbody>tr.active>th,.table>tfoot>tr.active>th{background-color:#ecf0f1}.table-hover>tbody>tr>td.active:hover,.table-hover>tbody>tr>th.active:hover,.table-hover>tbody>tr.active:hover>td,.table-hover>tbody>tr:hover>.active,.table-hover>tbody>tr.active:hover>th{background-color:#dde4e6}.table>thead>tr>td.success,.table>tbody>tr>td.success,.table>tfoot>tr>td.success,.table>thead>tr>th.success,.table>tbody>tr>th.success,.table>tfoot>tr>th.success,.table>thead>tr.success>td,.table>tbody>tr.success>td,.table>tfoot>tr.success>td,.table>thead>tr.success>th,.table>tbody>tr.success>th,.table>tfoot>tr.success>th{background-color:#18bc9c}.table-hover>tbody>tr>td.success:hover,.table-hover>tbody>tr>th.success:hover,.table-hover>tbody>tr.success:hover>td,.table-hover>tbody>tr:hover>.success,.table-hover>tbody>tr.success:hover>th{background-color:#15a589}.table>thead>tr>td.info,.table>tbody>tr>td.info,.table>tfoot>tr>td.info,.table>thead>tr>th.info,.table>tbody>tr>th.info,.table>tfoot>tr>th.info,.table>thead>tr.info>td,.table>tbody>tr.info>td,.table>tfoot>tr.info>td,.table>thead>tr.info>th,.table>tbody>tr.info>th,.table>tfoot>tr.info>th{background-color:#3498db}.table-hover>tbody>tr>td.info:hover,.table-hover>tbody>tr>th.info:hover,.table-hover>tbody>tr.info:hover>td,.table-hover>tbody>tr:hover>.info,.table-hover>tbody>tr.info:hover>th{background-color:#258cd1}.table>thead>tr>td.warning,.table>tbody>tr>td.warning,.table>tfoot>tr>td.warning,.table>thead>tr>th.warning,.table>tbody>tr>th.warning,.table>tfoot>tr>th.warning,.table>thead>tr.warning>td,.table>tbody>tr.warning>td,.table>tfoot>tr.warning>td,.table>thead>tr.warning>th,.table>tbody>tr.warning>th,.table>tfoot>tr.warning>th{background-color:#f39c12}.table-hover>tbody>tr>td.warning:hover,.table-hover>tbody>tr>th.warning:hover,.table-hover>tbody>tr.warning:hover>td,.table-hover>tbody>tr:hover>.warning,.table-hover>tbody>tr.warning:hover>th{background-color:#e08e0b}.table>thead>tr>td.danger,.table>tbody>tr>td.danger,.table>tfoot>tr>td.danger,.table>thead>tr>th.danger,.table>tbody>tr>th.danger,.table>tfoot>tr>th.danger,.table>thead>tr.danger>td,.table>tbody>tr.danger>td,.table>tfoot>tr.danger>td,.table>thead>tr.danger>th,.table>tbody>tr.danger>th,.table>tfoot>tr.danger>th{background-color:#e74c3c}.table-hover>tbody>tr>td.danger:hover,.table-hover>tbody>tr>th.danger:hover,.table-hover>tbody>tr.danger:hover>td,.table-hover>tbody>tr:hover>.danger,.table-hover>tbody>tr.danger:hover>th{background-color:#e43725}.table-responsive{overflow-x:auto;min-height:0.01%}@media screen and (max-width:767px){.table-responsive{width:100%;margin-bottom:15.75px;overflow-y:hidden;-ms-overflow-style:-ms-autohiding-scrollbar;border:1px solid #ecf0f1}.table-responsive>.table{margin-bottom:0}.table-responsive>.table>thead>tr>th,.table-responsive>.table>tbody>tr>th,.table-responsive>.table>tfoot>tr>th,.table-responsive>.table>thead>tr>td,.table-responsive>.table>tbody>tr>td,.table-responsive>.table>tfoot>tr>td{white-space:nowrap}.table-responsive>.table-bordered{border:0}.table-responsive>.table-bordered>thead>tr>th:first-child,.table-responsive>.table-bordered>tbody>tr>th:first-child,.table-responsive>.table-bordered>tfoot>tr>th:first-child,.table-responsive>.table-bordered>thead>tr>td:first-child,.table-responsive>.table-bordered>tbody>tr>td:first-child,.table-responsive>.table-bordered>tfoot>tr>td:first-child{border-left:0}.table-responsive>.table-bordered>thead>tr>th:last-child,.table-responsive>.table-bordered>tbody>tr>th:last-child,.table-responsive>.table-bordered>tfoot>tr>th:last-child,.table-responsive>.table-bordered>thead>tr>td:last-child,.table-responsive>.table-bordered>tbody>tr>td:last-child,.table-responsive>.table-bordered>tfoot>tr>td:last-child{border-right:0}.table-responsive>.table-bordered>tbody>tr:last-child>th,.table-responsive>.table-bordered>tfoot>tr:last-child>th,.table-responsive>.table-bordered>tbody>tr:last-child>td,.table-responsive>.table-bordered>tfoot>tr:last-child>td{border-bottom:0}}fieldset{padding:0;margin:0;border:0;min-width:0}legend{display:block;width:100%;padding:0;margin-bottom:21px;font-size:22.5px;line-height:inherit;color:#2c3e50;border:0;border-bottom:1px solid transparent}label{display:inline-block;max-width:100%;margin-bottom:5px;font-weight:bold}input[type="search"]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}input[type="radio"],input[type="checkbox"]{margin:4px 0 0;margin-top:1px \9;line-height:normal}input[type="file"]{display:block}input[type="range"]{display:block;width:100%}select[multiple],select[size]{height:auto}input[type="file"]:focus,input[type="radio"]:focus,input[type="checkbox"]:focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}output{display:block;padding-top:11px;font-size:15px;line-height:1.42857143;color:#2c3e50}.form-control{display:block;width:100%;height:45px;padding:10px 15px;font-size:15px;line-height:1.42857143;color:#2c3e50;background-color:#ffffff;background-image:none;border:1px solid #dce4ec;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-webkit-transition:border-color ease-in-out .15s,-webkit-box-shadow ease-in-out .15s;-o-transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s;transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s}.form-control:focus{border-color:#2c3e50;outline:0;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(44,62,80,0.6);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(44,62,80,0.6)}.form-control::-moz-placeholder{color:#acb6c0;opacity:1}.form-control:-ms-input-placeholder{color:#acb6c0}.form-control::-webkit-input-placeholder{color:#acb6c0}.form-control::-ms-expand{border:0;background-color:transparent}.form-control[disabled],.form-control[readonly],fieldset[disabled] .form-control{background-color:#ecf0f1;opacity:1}.form-control[disabled],fieldset[disabled] .form-control{cursor:not-allowed}textarea.form-control{height:auto}input[type="search"]{-webkit-appearance:none}@media screen and (-webkit-min-device-pixel-ratio:0){input[type="date"].form-control,input[type="time"].form-control,input[type="datetime-local"].form-control,input[type="month"].form-control{line-height:45px}input[type="date"].input-sm,input[type="time"].input-sm,input[type="datetime-local"].input-sm,input[type="month"].input-sm,.input-group-sm input[type="date"],.input-group-sm input[type="time"],.input-group-sm input[type="datetime-local"],.input-group-sm input[type="month"]{line-height:35px}input[type="date"].input-lg,input[type="time"].input-lg,input[type="datetime-local"].input-lg,input[type="month"].input-lg,.input-group-lg input[type="date"],.input-group-lg input[type="time"],.input-group-lg input[type="datetime-local"],.input-group-lg input[type="month"]{line-height:66px}}.form-group{margin-bottom:15px}.radio,.checkbox{position:relative;display:block;margin-top:10px;margin-bottom:10px}.radio label,.checkbox label{min-height:21px;padding-left:20px;margin-bottom:0;font-weight:normal;cursor:pointer}.radio input[type="radio"],.radio-inline input[type="radio"],.checkbox input[type="checkbox"],.checkbox-inline input[type="checkbox"]{position:absolute;margin-left:-20px;margin-top:4px \9}.radio+.radio,.checkbox+.checkbox{margin-top:-5px}.radio-inline,.checkbox-inline{position:relative;display:inline-block;padding-left:20px;margin-bottom:0;vertical-align:middle;font-weight:normal;cursor:pointer}.radio-inline+.radio-inline,.checkbox-inline+.checkbox-inline{margin-top:0;margin-left:10px}input[type="radio"][disabled],input[type="checkbox"][disabled],input[type="radio"].disabled,input[type="checkbox"].disabled,fieldset[disabled] input[type="radio"],fieldset[disabled] input[type="checkbox"]{cursor:not-allowed}.radio-inline.disabled,.checkbox-inline.disabled,fieldset[disabled] .radio-inline,fieldset[disabled] .checkbox-inline{cursor:not-allowed}.radio.disabled label,.checkbox.disabled label,fieldset[disabled] .radio label,fieldset[disabled] .checkbox label{cursor:not-allowed}.form-control-static{padding-top:11px;padding-bottom:11px;margin-bottom:0;min-height:36px}.form-control-static.input-lg,.form-control-static.input-sm{padding-left:0;padding-right:0}.input-sm{height:35px;padding:6px 9px;font-size:13px;line-height:1.5;border-radius:3px}select.input-sm{height:35px;line-height:35px}textarea.input-sm,select[multiple].input-sm{height:auto}.form-group-sm .form-control{height:35px;padding:6px 9px;font-size:13px;line-height:1.5;border-radius:3px}.form-group-sm select.form-control{height:35px;line-height:35px}.form-group-sm textarea.form-control,.form-group-sm select[multiple].form-control{height:auto}.form-group-sm .form-control-static{height:35px;min-height:34px;padding:7px 9px;font-size:13px;line-height:1.5}.input-lg{height:66px;padding:18px 27px;font-size:19px;line-height:1.3333333;border-radius:6px}select.input-lg{height:66px;line-height:66px}textarea.input-lg,select[multiple].input-lg{height:auto}.form-group-lg .form-control{height:66px;padding:18px 27px;font-size:19px;line-height:1.3333333;border-radius:6px}.form-group-lg select.form-control{height:66px;line-height:66px}.form-group-lg textarea.form-control,.form-group-lg select[multiple].form-control{height:auto}.form-group-lg .form-control-static{height:66px;min-height:40px;padding:19px 27px;font-size:19px;line-height:1.3333333}.has-feedback{position:relative}.has-feedback .form-control{padding-right:56.25px}.form-control-feedback{position:absolute;top:0;right:0;z-index:2;display:block;width:45px;height:45px;line-height:45px;text-align:center;pointer-events:none}.input-lg+.form-control-feedback,.input-group-lg+.form-control-feedback,.form-group-lg .form-control+.form-control-feedback{width:66px;height:66px;line-height:66px}.input-sm+.form-control-feedback,.input-group-sm+.form-control-feedback,.form-group-sm .form-control+.form-control-feedback{width:35px;height:35px;line-height:35px}.has-success .help-block,.has-success .control-label,.has-success .radio,.has-success .checkbox,.has-success .radio-inline,.has-success .checkbox-inline,.has-success.radio label,.has-success.checkbox label,.has-success.radio-inline label,.has-success.checkbox-inline label{color:#ffffff}.has-success .form-control{border-color:#ffffff;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.has-success .form-control:focus{border-color:#e6e6e6;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #fff;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #fff}.has-success .input-group-addon{color:#ffffff;border-color:#ffffff;background-color:#18bc9c}.has-success .form-control-feedback{color:#ffffff}.has-warning .help-block,.has-warning .control-label,.has-warning .radio,.has-warning .checkbox,.has-warning .radio-inline,.has-warning .checkbox-inline,.has-warning.radio label,.has-warning.checkbox label,.has-warning.radio-inline label,.has-warning.checkbox-inline label{color:#ffffff}.has-warning .form-control{border-color:#ffffff;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.has-warning .form-control:focus{border-color:#e6e6e6;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #fff;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #fff}.has-warning .input-group-addon{color:#ffffff;border-color:#ffffff;background-color:#f39c12}.has-warning .form-control-feedback{color:#ffffff}.has-error .help-block,.has-error .control-label,.has-error .radio,.has-error .checkbox,.has-error .radio-inline,.has-error .checkbox-inline,.has-error.radio label,.has-error.checkbox label,.has-error.radio-inline label,.has-error.checkbox-inline label{color:#ffffff}.has-error .form-control{border-color:#ffffff;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.has-error .form-control:focus{border-color:#e6e6e6;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #fff;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #fff}.has-error .input-group-addon{color:#ffffff;border-color:#ffffff;background-color:#e74c3c}.has-error .form-control-feedback{color:#ffffff}.has-feedback label~.form-control-feedback{top:26px}.has-feedback label.sr-only~.form-control-feedback{top:0}.help-block{display:block;margin-top:5px;margin-bottom:10px;color:#597ea2}@media (min-width:768px){.form-inline .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.form-inline .form-control{display:inline-block;width:auto;vertical-align:middle}.form-inline .form-control-static{display:inline-block}.form-inline .input-group{display:inline-table;vertical-align:middle}.form-inline .input-group .input-group-addon,.form-inline .input-group .input-group-btn,.form-inline .input-group .form-control{width:auto}.form-inline .input-group>.form-control{width:100%}.form-inline .control-label{margin-bottom:0;vertical-align:middle}.form-inline .radio,.form-inline .checkbox{display:inline-block;margin-top:0;margin-bottom:0;vertical-align:middle}.form-inline .radio label,.form-inline .checkbox label{padding-left:0}.form-inline .radio input[type="radio"],.form-inline .checkbox input[type="checkbox"]{position:relative;margin-left:0}.form-inline .has-feedback .form-control-feedback{top:0}}.form-horizontal .radio,.form-horizontal .checkbox,.form-horizontal .radio-inline,.form-horizontal .checkbox-inline{margin-top:0;margin-bottom:0;padding-top:11px}.form-horizontal .radio,.form-horizontal .checkbox{min-height:32px}.form-horizontal .form-group{margin-left:-15px;margin-right:-15px}@media (min-width:768px){.form-horizontal .control-label{text-align:right;margin-bottom:0;padding-top:11px}}.form-horizontal .has-feedback .form-control-feedback{right:15px}@media (min-width:768px){.form-horizontal .form-group-lg .control-label{padding-top:19px;font-size:19px}}@media (min-width:768px){.form-horizontal .form-group-sm .control-label{padding-top:7px;font-size:13px}}.btn{display:inline-block;margin-bottom:0;font-weight:normal;text-align:center;vertical-align:middle;-ms-touch-action:manipulation;touch-action:manipulation;cursor:pointer;background-image:none;border:1px solid transparent;white-space:nowrap;padding:10px 15px;font-size:15px;line-height:1.42857143;border-radius:4px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.btn:focus,.btn:active:focus,.btn.active:focus,.btn.focus,.btn:active.focus,.btn.active.focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.btn:hover,.btn:focus,.btn.focus{color:#ffffff;text-decoration:none}.btn:active,.btn.active{outline:0;background-image:none;-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,0.125);box-shadow:inset 0 3px 5px rgba(0,0,0,0.125)}.btn.disabled,.btn[disabled],fieldset[disabled] .btn{cursor:not-allowed;opacity:0.65;filter:alpha(opacity=65);-webkit-box-shadow:none;box-shadow:none}a.btn.disabled,fieldset[disabled] a.btn{pointer-events:none}.btn-default{color:#ffffff;background-color:#95a5a6;border-color:#95a5a6}.btn-default:focus,.btn-default.focus{color:#ffffff;background-color:#798d8f;border-color:#566566}.btn-default:hover{color:#ffffff;background-color:#798d8f;border-color:#74898a}.btn-default:active,.btn-default.active,.open>.dropdown-toggle.btn-default{color:#ffffff;background-color:#798d8f;border-color:#74898a}.btn-default:active:hover,.btn-default.active:hover,.open>.dropdown-toggle.btn-default:hover,.btn-default:active:focus,.btn-default.active:focus,.open>.dropdown-toggle.btn-default:focus,.btn-default:active.focus,.btn-default.active.focus,.open>.dropdown-toggle.btn-default.focus{color:#ffffff;background-color:#687b7c;border-color:#566566}.btn-default:active,.btn-default.active,.open>.dropdown-toggle.btn-default{background-image:none}.btn-default.disabled:hover,.btn-default[disabled]:hover,fieldset[disabled] .btn-default:hover,.btn-default.disabled:focus,.btn-default[disabled]:focus,fieldset[disabled] .btn-default:focus,.btn-default.disabled.focus,.btn-default[disabled].focus,fieldset[disabled] .btn-default.focus{background-color:#95a5a6;border-color:#95a5a6}.btn-default .badge{color:#95a5a6;background-color:#ffffff}.btn-primary{color:#ffffff;background-color:#2c3e50;border-color:#2c3e50}.btn-primary:focus,.btn-primary.focus{color:#ffffff;background-color:#1a242f;border-color:#000000}.btn-primary:hover{color:#ffffff;background-color:#1a242f;border-color:#161f29}.btn-primary:active,.btn-primary.active,.open>.dropdown-toggle.btn-primary{color:#ffffff;background-color:#1a242f;border-color:#161f29}.btn-primary:active:hover,.btn-primary.active:hover,.open>.dropdown-toggle.btn-primary:hover,.btn-primary:active:focus,.btn-primary.active:focus,.open>.dropdown-toggle.btn-primary:focus,.btn-primary:active.focus,.btn-primary.active.focus,.open>.dropdown-toggle.btn-primary.focus{color:#ffffff;background-color:#0d1318;border-color:#000000}.btn-primary:active,.btn-primary.active,.open>.dropdown-toggle.btn-primary{background-image:none}.btn-primary.disabled:hover,.btn-primary[disabled]:hover,fieldset[disabled] .btn-primary:hover,.btn-primary.disabled:focus,.btn-primary[disabled]:focus,fieldset[disabled] .btn-primary:focus,.btn-primary.disabled.focus,.btn-primary[disabled].focus,fieldset[disabled] .btn-primary.focus{background-color:#2c3e50;border-color:#2c3e50}.btn-primary .badge{color:#2c3e50;background-color:#ffffff}.btn-success{color:#ffffff;background-color:#18bc9c;border-color:#18bc9c}.btn-success:focus,.btn-success.focus{color:#ffffff;background-color:#128f76;border-color:#0a4b3e}.btn-success:hover{color:#ffffff;background-color:#128f76;border-color:#11866f}.btn-success:active,.btn-success.active,.open>.dropdown-toggle.btn-success{color:#ffffff;background-color:#128f76;border-color:#11866f}.btn-success:active:hover,.btn-success.active:hover,.open>.dropdown-toggle.btn-success:hover,.btn-success:active:focus,.btn-success.active:focus,.open>.dropdown-toggle.btn-success:focus,.btn-success:active.focus,.btn-success.active.focus,.open>.dropdown-toggle.btn-success.focus{color:#ffffff;background-color:#0e6f5c;border-color:#0a4b3e}.btn-success:active,.btn-success.active,.open>.dropdown-toggle.btn-success{background-image:none}.btn-success.disabled:hover,.btn-success[disabled]:hover,fieldset[disabled] .btn-success:hover,.btn-success.disabled:focus,.btn-success[disabled]:focus,fieldset[disabled] .btn-success:focus,.btn-success.disabled.focus,.btn-success[disabled].focus,fieldset[disabled] .btn-success.focus{background-color:#18bc9c;border-color:#18bc9c}.btn-success .badge{color:#18bc9c;background-color:#ffffff}.btn-info{color:#ffffff;background-color:#3498db;border-color:#3498db}.btn-info:focus,.btn-info.focus{color:#ffffff;background-color:#217dbb;border-color:#16527a}.btn-info:hover{color:#ffffff;background-color:#217dbb;border-color:#2077b2}.btn-info:active,.btn-info.active,.open>.dropdown-toggle.btn-info{color:#ffffff;background-color:#217dbb;border-color:#2077b2}.btn-info:active:hover,.btn-info.active:hover,.open>.dropdown-toggle.btn-info:hover,.btn-info:active:focus,.btn-info.active:focus,.open>.dropdown-toggle.btn-info:focus,.btn-info:active.focus,.btn-info.active.focus,.open>.dropdown-toggle.btn-info.focus{color:#ffffff;background-color:#1c699d;border-color:#16527a}.btn-info:active,.btn-info.active,.open>.dropdown-toggle.btn-info{background-image:none}.btn-info.disabled:hover,.btn-info[disabled]:hover,fieldset[disabled] .btn-info:hover,.btn-info.disabled:focus,.btn-info[disabled]:focus,fieldset[disabled] .btn-info:focus,.btn-info.disabled.focus,.btn-info[disabled].focus,fieldset[disabled] .btn-info.focus{background-color:#3498db;border-color:#3498db}.btn-info .badge{color:#3498db;background-color:#ffffff}.btn-warning{color:#ffffff;background-color:#f39c12;border-color:#f39c12}.btn-warning:focus,.btn-warning.focus{color:#ffffff;background-color:#c87f0a;border-color:#7f5006}.btn-warning:hover{color:#ffffff;background-color:#c87f0a;border-color:#be780a}.btn-warning:active,.btn-warning.active,.open>.dropdown-toggle.btn-warning{color:#ffffff;background-color:#c87f0a;border-color:#be780a}.btn-warning:active:hover,.btn-warning.active:hover,.open>.dropdown-toggle.btn-warning:hover,.btn-warning:active:focus,.btn-warning.active:focus,.open>.dropdown-toggle.btn-warning:focus,.btn-warning:active.focus,.btn-warning.active.focus,.open>.dropdown-toggle.btn-warning.focus{color:#ffffff;background-color:#a66908;border-color:#7f5006}.btn-warning:active,.btn-warning.active,.open>.dropdown-toggle.btn-warning{background-image:none}.btn-warning.disabled:hover,.btn-warning[disabled]:hover,fieldset[disabled] .btn-warning:hover,.btn-warning.disabled:focus,.btn-warning[disabled]:focus,fieldset[disabled] .btn-warning:focus,.btn-warning.disabled.focus,.btn-warning[disabled].focus,fieldset[disabled] .btn-warning.focus{background-color:#f39c12;border-color:#f39c12}.btn-warning .badge{color:#f39c12;background-color:#ffffff}.btn-danger{color:#ffffff;background-color:#e74c3c;border-color:#e74c3c}.btn-danger:focus,.btn-danger.focus{color:#ffffff;background-color:#d62c1a;border-color:#921e12}.btn-danger:hover{color:#ffffff;background-color:#d62c1a;border-color:#cd2a19}.btn-danger:active,.btn-danger.active,.open>.dropdown-toggle.btn-danger{color:#ffffff;background-color:#d62c1a;border-color:#cd2a19}.btn-danger:active:hover,.btn-danger.active:hover,.open>.dropdown-toggle.btn-danger:hover,.btn-danger:active:focus,.btn-danger.active:focus,.open>.dropdown-toggle.btn-danger:focus,.btn-danger:active.focus,.btn-danger.active.focus,.open>.dropdown-toggle.btn-danger.focus{color:#ffffff;background-color:#b62516;border-color:#921e12}.btn-danger:active,.btn-danger.active,.open>.dropdown-toggle.btn-danger{background-image:none}.btn-danger.disabled:hover,.btn-danger[disabled]:hover,fieldset[disabled] .btn-danger:hover,.btn-danger.disabled:focus,.btn-danger[disabled]:focus,fieldset[disabled] .btn-danger:focus,.btn-danger.disabled.focus,.btn-danger[disabled].focus,fieldset[disabled] .btn-danger.focus{background-color:#e74c3c;border-color:#e74c3c}.btn-danger .badge{color:#e74c3c;background-color:#ffffff}.btn-link{color:#18bc9c;font-weight:normal;border-radius:0}.btn-link,.btn-link:active,.btn-link.active,.btn-link[disabled],fieldset[disabled] .btn-link{background-color:transparent;-webkit-box-shadow:none;box-shadow:none}.btn-link,.btn-link:hover,.btn-link:focus,.btn-link:active{border-color:transparent}.btn-link:hover,.btn-link:focus{color:#18bc9c;text-decoration:underline;background-color:transparent}.btn-link[disabled]:hover,fieldset[disabled] .btn-link:hover,.btn-link[disabled]:focus,fieldset[disabled] .btn-link:focus{color:#b4bcc2;text-decoration:none}.btn-lg,.btn-group-lg>.btn{padding:18px 27px;font-size:19px;line-height:1.3333333;border-radius:6px}.btn-sm,.btn-group-sm>.btn{padding:6px 9px;font-size:13px;line-height:1.5;border-radius:3px}.btn-xs,.btn-group-xs>.btn{padding:1px 5px;font-size:13px;line-height:1.5;border-radius:3px}.btn-block{display:block;width:100%}.btn-block+.btn-block{margin-top:5px}input[type="submit"].btn-block,input[type="reset"].btn-block,input[type="button"].btn-block{width:100%}.fade{opacity:0;-webkit-transition:opacity 0.15s linear;-o-transition:opacity 0.15s linear;transition:opacity 0.15s linear}.fade.in{opacity:1}.collapse{display:none}.collapse.in{display:block}tr.collapse.in{display:table-row}tbody.collapse.in{display:table-row-group}.collapsing{position:relative;height:0;overflow:hidden;-webkit-transition-property:height, visibility;-o-transition-property:height, visibility;transition-property:height, visibility;-webkit-transition-duration:0.35s;-o-transition-duration:0.35s;transition-duration:0.35s;-webkit-transition-timing-function:ease;-o-transition-timing-function:ease;transition-timing-function:ease}.caret{display:inline-block;width:0;height:0;margin-left:2px;vertical-align:middle;border-top:4px dashed;border-top:4px solid \9;border-right:4px solid transparent;border-left:4px solid transparent}.dropup,.dropdown{position:relative}.dropdown-toggle:focus{outline:0}.dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;display:none;float:left;min-width:160px;padding:5px 0;margin:2px 0 0;list-style:none;font-size:15px;text-align:left;background-color:#ffffff;border:1px solid #cccccc;border:1px solid rgba(0,0,0,0.15);border-radius:4px;-webkit-box-shadow:0 6px 12px rgba(0,0,0,0.175);box-shadow:0 6px 12px rgba(0,0,0,0.175);-webkit-background-clip:padding-box;background-clip:padding-box}.dropdown-menu.pull-right{right:0;left:auto}.dropdown-menu .divider{height:1px;margin:9.5px 0;overflow:hidden;background-color:#e5e5e5}.dropdown-menu>li>a{display:block;padding:3px 20px;clear:both;font-weight:normal;line-height:1.42857143;color:#7b8a8b;white-space:nowrap}.dropdown-menu>li>a:hover,.dropdown-menu>li>a:focus{text-decoration:none;color:#ffffff;background-color:#2c3e50}.dropdown-menu>.active>a,.dropdown-menu>.active>a:hover,.dropdown-menu>.active>a:focus{color:#ffffff;text-decoration:none;outline:0;background-color:#2c3e50}.dropdown-menu>.disabled>a,.dropdown-menu>.disabled>a:hover,.dropdown-menu>.disabled>a:focus{color:#b4bcc2}.dropdown-menu>.disabled>a:hover,.dropdown-menu>.disabled>a:focus{text-decoration:none;background-color:transparent;background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);cursor:not-allowed}.open>.dropdown-menu{display:block}.open>a{outline:0}.dropdown-menu-right{left:auto;right:0}.dropdown-menu-left{left:0;right:auto}.dropdown-header{display:block;padding:3px 20px;font-size:13px;line-height:1.42857143;color:#b4bcc2;white-space:nowrap}.dropdown-backdrop{position:fixed;left:0;right:0;bottom:0;top:0;z-index:990}.pull-right>.dropdown-menu{right:0;left:auto}.dropup .caret,.navbar-fixed-bottom .dropdown .caret{border-top:0;border-bottom:4px dashed;border-bottom:4px solid \9;content:""}.dropup .dropdown-menu,.navbar-fixed-bottom .dropdown .dropdown-menu{top:auto;bottom:100%;margin-bottom:2px}@media (min-width:768px){.navbar-right .dropdown-menu{left:auto;right:0}.navbar-right .dropdown-menu-left{left:0;right:auto}}.btn-group,.btn-group-vertical{position:relative;display:inline-block;vertical-align:middle}.btn-group>.btn,.btn-group-vertical>.btn{position:relative;float:left}.btn-group>.btn:hover,.btn-group-vertical>.btn:hover,.btn-group>.btn:focus,.btn-group-vertical>.btn:focus,.btn-group>.btn:active,.btn-group-vertical>.btn:active,.btn-group>.btn.active,.btn-group-vertical>.btn.active{z-index:2}.btn-group .btn+.btn,.btn-group .btn+.btn-group,.btn-group .btn-group+.btn,.btn-group .btn-group+.btn-group{margin-left:-1px}.btn-toolbar{margin-left:-5px}.btn-toolbar .btn,.btn-toolbar .btn-group,.btn-toolbar .input-group{float:left}.btn-toolbar>.btn,.btn-toolbar>.btn-group,.btn-toolbar>.input-group{margin-left:5px}.btn-group>.btn:not(:first-child):not(:last-child):not(.dropdown-toggle){border-radius:0}.btn-group>.btn:first-child{margin-left:0}.btn-group>.btn:first-child:not(:last-child):not(.dropdown-toggle){border-bottom-right-radius:0;border-top-right-radius:0}.btn-group>.btn:last-child:not(:first-child),.btn-group>.dropdown-toggle:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0}.btn-group>.btn-group{float:left}.btn-group>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group>.btn-group:first-child:not(:last-child)>.btn:last-child,.btn-group>.btn-group:first-child:not(:last-child)>.dropdown-toggle{border-bottom-right-radius:0;border-top-right-radius:0}.btn-group>.btn-group:last-child:not(:first-child)>.btn:first-child{border-bottom-left-radius:0;border-top-left-radius:0}.btn-group .dropdown-toggle:active,.btn-group.open .dropdown-toggle{outline:0}.btn-group>.btn+.dropdown-toggle{padding-left:8px;padding-right:8px}.btn-group>.btn-lg+.dropdown-toggle{padding-left:12px;padding-right:12px}.btn-group.open .dropdown-toggle{-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,0.125);box-shadow:inset 0 3px 5px rgba(0,0,0,0.125)}.btn-group.open .dropdown-toggle.btn-link{-webkit-box-shadow:none;box-shadow:none}.btn .caret{margin-left:0}.btn-lg .caret{border-width:5px 5px 0;border-bottom-width:0}.dropup .btn-lg .caret{border-width:0 5px 5px}.btn-group-vertical>.btn,.btn-group-vertical>.btn-group,.btn-group-vertical>.btn-group>.btn{display:block;float:none;width:100%;max-width:100%}.btn-group-vertical>.btn-group>.btn{float:none}.btn-group-vertical>.btn+.btn,.btn-group-vertical>.btn+.btn-group,.btn-group-vertical>.btn-group+.btn,.btn-group-vertical>.btn-group+.btn-group{margin-top:-1px;margin-left:0}.btn-group-vertical>.btn:not(:first-child):not(:last-child){border-radius:0}.btn-group-vertical>.btn:first-child:not(:last-child){border-top-right-radius:4px;border-top-left-radius:4px;border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn:last-child:not(:first-child){border-top-right-radius:0;border-top-left-radius:0;border-bottom-right-radius:4px;border-bottom-left-radius:4px}.btn-group-vertical>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group-vertical>.btn-group:first-child:not(:last-child)>.btn:last-child,.btn-group-vertical>.btn-group:first-child:not(:last-child)>.dropdown-toggle{border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn-group:last-child:not(:first-child)>.btn:first-child{border-top-right-radius:0;border-top-left-radius:0}.btn-group-justified{display:table;width:100%;table-layout:fixed;border-collapse:separate}.btn-group-justified>.btn,.btn-group-justified>.btn-group{float:none;display:table-cell;width:1%}.btn-group-justified>.btn-group .btn{width:100%}.btn-group-justified>.btn-group .dropdown-menu{left:auto}[data-toggle="buttons"]>.btn input[type="radio"],[data-toggle="buttons"]>.btn-group>.btn input[type="radio"],[data-toggle="buttons"]>.btn input[type="checkbox"],[data-toggle="buttons"]>.btn-group>.btn input[type="checkbox"]{position:absolute;clip:rect(0, 0, 0, 0);pointer-events:none}.input-group{position:relative;display:table;border-collapse:separate}.input-group[class*="col-"]{float:none;padding-left:0;padding-right:0}.input-group .form-control{position:relative;z-index:2;float:left;width:100%;margin-bottom:0}.input-group .form-control:focus{z-index:3}.input-group-lg>.form-control,.input-group-lg>.input-group-addon,.input-group-lg>.input-group-btn>.btn{height:66px;padding:18px 27px;font-size:19px;line-height:1.3333333;border-radius:6px}select.input-group-lg>.form-control,select.input-group-lg>.input-group-addon,select.input-group-lg>.input-group-btn>.btn{height:66px;line-height:66px}textarea.input-group-lg>.form-control,textarea.input-group-lg>.input-group-addon,textarea.input-group-lg>.input-group-btn>.btn,select[multiple].input-group-lg>.form-control,select[multiple].input-group-lg>.input-group-addon,select[multiple].input-group-lg>.input-group-btn>.btn{height:auto}.input-group-sm>.form-control,.input-group-sm>.input-group-addon,.input-group-sm>.input-group-btn>.btn{height:35px;padding:6px 9px;font-size:13px;line-height:1.5;border-radius:3px}select.input-group-sm>.form-control,select.input-group-sm>.input-group-addon,select.input-group-sm>.input-group-btn>.btn{height:35px;line-height:35px}textarea.input-group-sm>.form-control,textarea.input-group-sm>.input-group-addon,textarea.input-group-sm>.input-group-btn>.btn,select[multiple].input-group-sm>.form-control,select[multiple].input-group-sm>.input-group-addon,select[multiple].input-group-sm>.input-group-btn>.btn{height:auto}.input-group-addon,.input-group-btn,.input-group .form-control{display:table-cell}.input-group-addon:not(:first-child):not(:last-child),.input-group-btn:not(:first-child):not(:last-child),.input-group .form-control:not(:first-child):not(:last-child){border-radius:0}.input-group-addon,.input-group-btn{width:1%;white-space:nowrap;vertical-align:middle}.input-group-addon{padding:10px 15px;font-size:15px;font-weight:normal;line-height:1;color:#2c3e50;text-align:center;background-color:#ecf0f1;border:1px solid #dce4ec;border-radius:4px}.input-group-addon.input-sm{padding:6px 9px;font-size:13px;border-radius:3px}.input-group-addon.input-lg{padding:18px 27px;font-size:19px;border-radius:6px}.input-group-addon input[type="radio"],.input-group-addon input[type="checkbox"]{margin-top:0}.input-group .form-control:first-child,.input-group-addon:first-child,.input-group-btn:first-child>.btn,.input-group-btn:first-child>.btn-group>.btn,.input-group-btn:first-child>.dropdown-toggle,.input-group-btn:last-child>.btn:not(:last-child):not(.dropdown-toggle),.input-group-btn:last-child>.btn-group:not(:last-child)>.btn{border-bottom-right-radius:0;border-top-right-radius:0}.input-group-addon:first-child{border-right:0}.input-group .form-control:last-child,.input-group-addon:last-child,.input-group-btn:last-child>.btn,.input-group-btn:last-child>.btn-group>.btn,.input-group-btn:last-child>.dropdown-toggle,.input-group-btn:first-child>.btn:not(:first-child),.input-group-btn:first-child>.btn-group:not(:first-child)>.btn{border-bottom-left-radius:0;border-top-left-radius:0}.input-group-addon:last-child{border-left:0}.input-group-btn{position:relative;font-size:0;white-space:nowrap}.input-group-btn>.btn{position:relative}.input-group-btn>.btn+.btn{margin-left:-1px}.input-group-btn>.btn:hover,.input-group-btn>.btn:focus,.input-group-btn>.btn:active{z-index:2}.input-group-btn:first-child>.btn,.input-group-btn:first-child>.btn-group{margin-right:-1px}.input-group-btn:last-child>.btn,.input-group-btn:last-child>.btn-group{z-index:2;margin-left:-1px}.nav{margin-bottom:0;padding-left:0;list-style:none}.nav>li{position:relative;display:block}.nav>li>a{position:relative;display:block;padding:10px 15px}.nav>li>a:hover,.nav>li>a:focus{text-decoration:none;background-color:#ecf0f1}.nav>li.disabled>a{color:#b4bcc2}.nav>li.disabled>a:hover,.nav>li.disabled>a:focus{color:#b4bcc2;text-decoration:none;background-color:transparent;cursor:not-allowed}.nav .open>a,.nav .open>a:hover,.nav .open>a:focus{background-color:#ecf0f1;border-color:#18bc9c}.nav .nav-divider{height:1px;margin:9.5px 0;overflow:hidden;background-color:#e5e5e5}.nav>li>a>img{max-width:none}.nav-tabs{border-bottom:1px solid #ecf0f1}.nav-tabs>li{float:left;margin-bottom:-1px}.nav-tabs>li>a{margin-right:2px;line-height:1.42857143;border:1px solid transparent;border-radius:4px 4px 0 0}.nav-tabs>li>a:hover{border-color:#ecf0f1 #ecf0f1 #ecf0f1}.nav-tabs>li.active>a,.nav-tabs>li.active>a:hover,.nav-tabs>li.active>a:focus{color:#2c3e50;background-color:#ffffff;border:1px solid #ecf0f1;border-bottom-color:transparent;cursor:default}.nav-tabs.nav-justified{width:100%;border-bottom:0}.nav-tabs.nav-justified>li{float:none}.nav-tabs.nav-justified>li>a{text-align:center;margin-bottom:5px}.nav-tabs.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}@media (min-width:768px){.nav-tabs.nav-justified>li{display:table-cell;width:1%}.nav-tabs.nav-justified>li>a{margin-bottom:0}}.nav-tabs.nav-justified>li>a{margin-right:0;border-radius:4px}.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:hover,.nav-tabs.nav-justified>.active>a:focus{border:1px solid #ecf0f1}@media (min-width:768px){.nav-tabs.nav-justified>li>a{border-bottom:1px solid #ecf0f1;border-radius:4px 4px 0 0}.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:hover,.nav-tabs.nav-justified>.active>a:focus{border-bottom-color:#ffffff}}.nav-pills>li{float:left}.nav-pills>li>a{border-radius:4px}.nav-pills>li+li{margin-left:2px}.nav-pills>li.active>a,.nav-pills>li.active>a:hover,.nav-pills>li.active>a:focus{color:#ffffff;background-color:#2c3e50}.nav-stacked>li{float:none}.nav-stacked>li+li{margin-top:2px;margin-left:0}.nav-justified{width:100%}.nav-justified>li{float:none}.nav-justified>li>a{text-align:center;margin-bottom:5px}.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}@media (min-width:768px){.nav-justified>li{display:table-cell;width:1%}.nav-justified>li>a{margin-bottom:0}}.nav-tabs-justified{border-bottom:0}.nav-tabs-justified>li>a{margin-right:0;border-radius:4px}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:hover,.nav-tabs-justified>.active>a:focus{border:1px solid #ecf0f1}@media (min-width:768px){.nav-tabs-justified>li>a{border-bottom:1px solid #ecf0f1;border-radius:4px 4px 0 0}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:hover,.nav-tabs-justified>.active>a:focus{border-bottom-color:#ffffff}}.tab-content>.tab-pane{display:none}.tab-content>.active{display:block}.nav-tabs .dropdown-menu{margin-top:-1px;border-top-right-radius:0;border-top-left-radius:0}.navbar{position:relative;min-height:60px;margin-bottom:21px;border:1px solid transparent}@media (min-width:768px){.navbar{border-radius:4px}}@media (min-width:768px){.navbar-header{float:left}}.navbar-collapse{overflow-x:visible;padding-right:15px;padding-left:15px;border-top:1px solid transparent;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1);box-shadow:inset 0 1px 0 rgba(255,255,255,0.1);-webkit-overflow-scrolling:touch}.navbar-collapse.in{overflow-y:auto}@media (min-width:768px){.navbar-collapse{width:auto;border-top:0;-webkit-box-shadow:none;box-shadow:none}.navbar-collapse.collapse{display:block !important;height:auto !important;padding-bottom:0;overflow:visible !important}.navbar-collapse.in{overflow-y:visible}.navbar-fixed-top .navbar-collapse,.navbar-static-top .navbar-collapse,.navbar-fixed-bottom .navbar-collapse{padding-left:0;padding-right:0}}.navbar-fixed-top .navbar-collapse,.navbar-fixed-bottom .navbar-collapse{max-height:340px}@media (max-device-width:480px) and (orientation:landscape){.navbar-fixed-top .navbar-collapse,.navbar-fixed-bottom .navbar-collapse{max-height:200px}}.container>.navbar-header,.container-fluid>.navbar-header,.container>.navbar-collapse,.container-fluid>.navbar-collapse{margin-right:-15px;margin-left:-15px}@media (min-width:768px){.container>.navbar-header,.container-fluid>.navbar-header,.container>.navbar-collapse,.container-fluid>.navbar-collapse{margin-right:0;margin-left:0}}.navbar-static-top{z-index:1000;border-width:0 0 1px}@media (min-width:768px){.navbar-static-top{border-radius:0}}.navbar-fixed-top,.navbar-fixed-bottom{position:fixed;right:0;left:0;z-index:1030}@media (min-width:768px){.navbar-fixed-top,.navbar-fixed-bottom{border-radius:0}}.navbar-fixed-top{top:0;border-width:0 0 1px}.navbar-fixed-bottom{bottom:0;margin-bottom:0;border-width:1px 0 0}.navbar-brand{float:left;padding:19.5px 15px;font-size:19px;line-height:21px;height:60px}.navbar-brand:hover,.navbar-brand:focus{text-decoration:none}.navbar-brand>img{display:block}@media (min-width:768px){.navbar>.container .navbar-brand,.navbar>.container-fluid .navbar-brand{margin-left:-15px}}.navbar-toggle{position:relative;float:right;margin-right:15px;padding:9px 10px;margin-top:13px;margin-bottom:13px;background-color:transparent;background-image:none;border:1px solid transparent;border-radius:4px}.navbar-toggle:focus{outline:0}.navbar-toggle .icon-bar{display:block;width:22px;height:2px;border-radius:1px}.navbar-toggle .icon-bar+.icon-bar{margin-top:4px}@media (min-width:768px){.navbar-toggle{display:none}}.navbar-nav{margin:9.75px -15px}.navbar-nav>li>a{padding-top:10px;padding-bottom:10px;line-height:21px}@media (max-width:767px){.navbar-nav .open .dropdown-menu{position:static;float:none;width:auto;margin-top:0;background-color:transparent;border:0;-webkit-box-shadow:none;box-shadow:none}.navbar-nav .open .dropdown-menu>li>a,.navbar-nav .open .dropdown-menu .dropdown-header{padding:5px 15px 5px 25px}.navbar-nav .open .dropdown-menu>li>a{line-height:21px}.navbar-nav .open .dropdown-menu>li>a:hover,.navbar-nav .open .dropdown-menu>li>a:focus{background-image:none}}@media (min-width:768px){.navbar-nav{float:left;margin:0}.navbar-nav>li{float:left}.navbar-nav>li>a{padding-top:19.5px;padding-bottom:19.5px}}.navbar-form{margin-left:-15px;margin-right:-15px;padding:10px 15px;border-top:1px solid transparent;border-bottom:1px solid transparent;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1);box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1);margin-top:7.5px;margin-bottom:7.5px}@media (min-width:768px){.navbar-form .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.navbar-form .form-control{display:inline-block;width:auto;vertical-align:middle}.navbar-form .form-control-static{display:inline-block}.navbar-form .input-group{display:inline-table;vertical-align:middle}.navbar-form .input-group .input-group-addon,.navbar-form .input-group .input-group-btn,.navbar-form .input-group .form-control{width:auto}.navbar-form .input-group>.form-control{width:100%}.navbar-form .control-label{margin-bottom:0;vertical-align:middle}.navbar-form .radio,.navbar-form .checkbox{display:inline-block;margin-top:0;margin-bottom:0;vertical-align:middle}.navbar-form .radio label,.navbar-form .checkbox label{padding-left:0}.navbar-form .radio input[type="radio"],.navbar-form .checkbox input[type="checkbox"]{position:relative;margin-left:0}.navbar-form .has-feedback .form-control-feedback{top:0}}@media (max-width:767px){.navbar-form .form-group{margin-bottom:5px}.navbar-form .form-group:last-child{margin-bottom:0}}@media (min-width:768px){.navbar-form{width:auto;border:0;margin-left:0;margin-right:0;padding-top:0;padding-bottom:0;-webkit-box-shadow:none;box-shadow:none}}.navbar-nav>li>.dropdown-menu{margin-top:0;border-top-right-radius:0;border-top-left-radius:0}.navbar-fixed-bottom .navbar-nav>li>.dropdown-menu{margin-bottom:0;border-top-right-radius:4px;border-top-left-radius:4px;border-bottom-right-radius:0;border-bottom-left-radius:0}.navbar-btn{margin-top:7.5px;margin-bottom:7.5px}.navbar-btn.btn-sm{margin-top:12.5px;margin-bottom:12.5px}.navbar-btn.btn-xs{margin-top:19px;margin-bottom:19px}.navbar-text{margin-top:19.5px;margin-bottom:19.5px}@media (min-width:768px){.navbar-text{float:left;margin-left:15px;margin-right:15px}}@media (min-width:768px){.navbar-left{float:left !important}.navbar-right{float:right !important;margin-right:-15px}.navbar-right~.navbar-right{margin-right:0}}.navbar-default{background-color:#2c3e50;border-color:transparent}.navbar-default .navbar-brand{color:#ffffff}.navbar-default .navbar-brand:hover,.navbar-default .navbar-brand:focus{color:#18bc9c;background-color:transparent}.navbar-default .navbar-text{color:#777777}.navbar-default .navbar-nav>li>a{color:#ffffff}.navbar-default .navbar-nav>li>a:hover,.navbar-default .navbar-nav>li>a:focus{color:#18bc9c;background-color:transparent}.navbar-default .navbar-nav>.active>a,.navbar-default .navbar-nav>.active>a:hover,.navbar-default .navbar-nav>.active>a:focus{color:#ffffff;background-color:#1a242f}.navbar-default .navbar-nav>.disabled>a,.navbar-default .navbar-nav>.disabled>a:hover,.navbar-default .navbar-nav>.disabled>a:focus{color:#cccccc;background-color:transparent}.navbar-default .navbar-toggle{border-color:#1a242f}.navbar-default .navbar-toggle:hover,.navbar-default .navbar-toggle:focus{background-color:#1a242f}.navbar-default .navbar-toggle .icon-bar{background-color:#ffffff}.navbar-default .navbar-collapse,.navbar-default .navbar-form{border-color:transparent}.navbar-default .navbar-nav>.open>a,.navbar-default .navbar-nav>.open>a:hover,.navbar-default .navbar-nav>.open>a:focus{background-color:#1a242f;color:#ffffff}@media (max-width:767px){.navbar-default .navbar-nav .open .dropdown-menu>li>a{color:#ffffff}.navbar-default .navbar-nav .open .dropdown-menu>li>a:hover,.navbar-default .navbar-nav .open .dropdown-menu>li>a:focus{color:#18bc9c;background-color:transparent}.navbar-default .navbar-nav .open .dropdown-menu>.active>a,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:hover,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:focus{color:#ffffff;background-color:#1a242f}.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:hover,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:focus{color:#cccccc;background-color:transparent}}.navbar-default .navbar-link{color:#ffffff}.navbar-default .navbar-link:hover{color:#18bc9c}.navbar-default .btn-link{color:#ffffff}.navbar-default .btn-link:hover,.navbar-default .btn-link:focus{color:#18bc9c}.navbar-default .btn-link[disabled]:hover,fieldset[disabled] .navbar-default .btn-link:hover,.navbar-default .btn-link[disabled]:focus,fieldset[disabled] .navbar-default .btn-link:focus{color:#cccccc}.navbar-inverse{background-color:#18bc9c;border-color:transparent}.navbar-inverse .navbar-brand{color:#ffffff}.navbar-inverse .navbar-brand:hover,.navbar-inverse .navbar-brand:focus{color:#2c3e50;background-color:transparent}.navbar-inverse .navbar-text{color:#ffffff}.navbar-inverse .navbar-nav>li>a{color:#ffffff}.navbar-inverse .navbar-nav>li>a:hover,.navbar-inverse .navbar-nav>li>a:focus{color:#2c3e50;background-color:transparent}.navbar-inverse .navbar-nav>.active>a,.navbar-inverse .navbar-nav>.active>a:hover,.navbar-inverse .navbar-nav>.active>a:focus{color:#ffffff;background-color:#15a589}.navbar-inverse .navbar-nav>.disabled>a,.navbar-inverse .navbar-nav>.disabled>a:hover,.navbar-inverse .navbar-nav>.disabled>a:focus{color:#cccccc;background-color:transparent}.navbar-inverse .navbar-toggle{border-color:#128f76}.navbar-inverse .navbar-toggle:hover,.navbar-inverse .navbar-toggle:focus{background-color:#128f76}.navbar-inverse .navbar-toggle .icon-bar{background-color:#ffffff}.navbar-inverse .navbar-collapse,.navbar-inverse .navbar-form{border-color:#149c82}.navbar-inverse .navbar-nav>.open>a,.navbar-inverse .navbar-nav>.open>a:hover,.navbar-inverse .navbar-nav>.open>a:focus{background-color:#15a589;color:#ffffff}@media (max-width:767px){.navbar-inverse .navbar-nav .open .dropdown-menu>.dropdown-header{border-color:transparent}.navbar-inverse .navbar-nav .open .dropdown-menu .divider{background-color:transparent}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a{color:#ffffff}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:hover,.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:focus{color:#2c3e50;background-color:transparent}.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:hover,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:focus{color:#ffffff;background-color:#15a589}.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:hover,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:focus{color:#cccccc;background-color:transparent}}.navbar-inverse .navbar-link{color:#ffffff}.navbar-inverse .navbar-link:hover{color:#2c3e50}.navbar-inverse .btn-link{color:#ffffff}.navbar-inverse .btn-link:hover,.navbar-inverse .btn-link:focus{color:#2c3e50}.navbar-inverse .btn-link[disabled]:hover,fieldset[disabled] .navbar-inverse .btn-link:hover,.navbar-inverse .btn-link[disabled]:focus,fieldset[disabled] .navbar-inverse .btn-link:focus{color:#cccccc}.breadcrumb{padding:8px 15px;margin-bottom:21px;list-style:none;background-color:#ecf0f1;border-radius:4px}.breadcrumb>li{display:inline-block}.breadcrumb>li+li:before{content:"/\00a0";padding:0 5px;color:#cccccc}.breadcrumb>.active{color:#95a5a6}.pagination{display:inline-block;padding-left:0;margin:21px 0;border-radius:4px}.pagination>li{display:inline}.pagination>li>a,.pagination>li>span{position:relative;float:left;padding:10px 15px;line-height:1.42857143;text-decoration:none;color:#ffffff;background-color:#18bc9c;border:1px solid transparent;margin-left:-1px}.pagination>li:first-child>a,.pagination>li:first-child>span{margin-left:0;border-bottom-left-radius:4px;border-top-left-radius:4px}.pagination>li:last-child>a,.pagination>li:last-child>span{border-bottom-right-radius:4px;border-top-right-radius:4px}.pagination>li>a:hover,.pagination>li>span:hover,.pagination>li>a:focus,.pagination>li>span:focus{z-index:2;color:#ffffff;background-color:#0f7864;border-color:transparent}.pagination>.active>a,.pagination>.active>span,.pagination>.active>a:hover,.pagination>.active>span:hover,.pagination>.active>a:focus,.pagination>.active>span:focus{z-index:3;color:#ffffff;background-color:#0f7864;border-color:transparent;cursor:default}.pagination>.disabled>span,.pagination>.disabled>span:hover,.pagination>.disabled>span:focus,.pagination>.disabled>a,.pagination>.disabled>a:hover,.pagination>.disabled>a:focus{color:#ecf0f1;background-color:#3be6c4;border-color:transparent;cursor:not-allowed}.pagination-lg>li>a,.pagination-lg>li>span{padding:18px 27px;font-size:19px;line-height:1.3333333}.pagination-lg>li:first-child>a,.pagination-lg>li:first-child>span{border-bottom-left-radius:6px;border-top-left-radius:6px}.pagination-lg>li:last-child>a,.pagination-lg>li:last-child>span{border-bottom-right-radius:6px;border-top-right-radius:6px}.pagination-sm>li>a,.pagination-sm>li>span{padding:6px 9px;font-size:13px;line-height:1.5}.pagination-sm>li:first-child>a,.pagination-sm>li:first-child>span{border-bottom-left-radius:3px;border-top-left-radius:3px}.pagination-sm>li:last-child>a,.pagination-sm>li:last-child>span{border-bottom-right-radius:3px;border-top-right-radius:3px}.pager{padding-left:0;margin:21px 0;list-style:none;text-align:center}.pager li{display:inline}.pager li>a,.pager li>span{display:inline-block;padding:5px 14px;background-color:#18bc9c;border:1px solid transparent;border-radius:15px}.pager li>a:hover,.pager li>a:focus{text-decoration:none;background-color:#0f7864}.pager .next>a,.pager .next>span{float:right}.pager .previous>a,.pager .previous>span{float:left}.pager .disabled>a,.pager .disabled>a:hover,.pager .disabled>a:focus,.pager .disabled>span{color:#ffffff;background-color:#18bc9c;cursor:not-allowed}.label{display:inline;padding:.2em .6em .3em;font-size:75%;font-weight:bold;line-height:1;color:#ffffff;text-align:center;white-space:nowrap;vertical-align:baseline;border-radius:.25em}a.label:hover,a.label:focus{color:#ffffff;text-decoration:none;cursor:pointer}.label:empty{display:none}.btn .label{position:relative;top:-1px}.label-default{background-color:#95a5a6}.label-default[href]:hover,.label-default[href]:focus{background-color:#798d8f}.label-primary{background-color:#2c3e50}.label-primary[href]:hover,.label-primary[href]:focus{background-color:#1a242f}.label-success{background-color:#18bc9c}.label-success[href]:hover,.label-success[href]:focus{background-color:#128f76}.label-info{background-color:#3498db}.label-info[href]:hover,.label-info[href]:focus{background-color:#217dbb}.label-warning{background-color:#f39c12}.label-warning[href]:hover,.label-warning[href]:focus{background-color:#c87f0a}.label-danger{background-color:#e74c3c}.label-danger[href]:hover,.label-danger[href]:focus{background-color:#d62c1a}.badge{display:inline-block;min-width:10px;padding:3px 7px;font-size:13px;font-weight:bold;color:#ffffff;line-height:1;vertical-align:middle;white-space:nowrap;text-align:center;background-color:#2c3e50;border-radius:10px}.badge:empty{display:none}.btn .badge{position:relative;top:-1px}.btn-xs .badge,.btn-group-xs>.btn .badge{top:0;padding:1px 5px}a.badge:hover,a.badge:focus{color:#ffffff;text-decoration:none;cursor:pointer}.list-group-item.active>.badge,.nav-pills>.active>a>.badge{color:#2c3e50;background-color:#ffffff}.list-group-item>.badge{float:right}.list-group-item>.badge+.badge{margin-right:5px}.nav-pills>li>a>.badge{margin-left:3px}.jumbotron{padding-top:30px;padding-bottom:30px;margin-bottom:30px;color:inherit;background-color:#ecf0f1}.jumbotron h1,.jumbotron .h1{color:inherit}.jumbotron p{margin-bottom:15px;font-size:23px;font-weight:200}.jumbotron>hr{border-top-color:#cfd9db}.container .jumbotron,.container-fluid .jumbotron{border-radius:6px;padding-left:15px;padding-right:15px}.jumbotron .container{max-width:100%}@media screen and (min-width:768px){.jumbotron{padding-top:48px;padding-bottom:48px}.container .jumbotron,.container-fluid .jumbotron{padding-left:60px;padding-right:60px}.jumbotron h1,.jumbotron .h1{font-size:68px}}.thumbnail{display:block;padding:4px;margin-bottom:21px;line-height:1.42857143;background-color:#ffffff;border:1px solid #ecf0f1;border-radius:4px;-webkit-transition:border .2s ease-in-out;-o-transition:border .2s ease-in-out;transition:border .2s ease-in-out}.thumbnail>img,.thumbnail a>img{margin-left:auto;margin-right:auto}a.thumbnail:hover,a.thumbnail:focus,a.thumbnail.active{border-color:#18bc9c}.thumbnail .caption{padding:9px;color:#2c3e50}.alert{padding:15px;margin-bottom:21px;border:1px solid transparent;border-radius:4px}.alert h4{margin-top:0;color:inherit}.alert .alert-link{font-weight:bold}.alert>p,.alert>ul{margin-bottom:0}.alert>p+p{margin-top:5px}.alert-dismissable,.alert-dismissible{padding-right:35px}.alert-dismissable .close,.alert-dismissible .close{position:relative;top:-2px;right:-21px;color:inherit}.alert-success{background-color:#18bc9c;border-color:#18bc9c;color:#ffffff}.alert-success hr{border-top-color:#15a589}.alert-success .alert-link{color:#e6e6e6}.alert-info{background-color:#3498db;border-color:#3498db;color:#ffffff}.alert-info hr{border-top-color:#258cd1}.alert-info .alert-link{color:#e6e6e6}.alert-warning{background-color:#f39c12;border-color:#f39c12;color:#ffffff}.alert-warning hr{border-top-color:#e08e0b}.alert-warning .alert-link{color:#e6e6e6}.alert-danger{background-color:#e74c3c;border-color:#e74c3c;color:#ffffff}.alert-danger hr{border-top-color:#e43725}.alert-danger .alert-link{color:#e6e6e6}@-webkit-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@-o-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}.progress{overflow:hidden;height:21px;margin-bottom:21px;background-color:#ecf0f1;border-radius:4px;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,0.1);box-shadow:inset 0 1px 2px rgba(0,0,0,0.1)}.progress-bar{float:left;width:0%;height:100%;font-size:13px;line-height:21px;color:#ffffff;text-align:center;background-color:#2c3e50;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,0.15);box-shadow:inset 0 -1px 0 rgba(0,0,0,0.15);-webkit-transition:width 0.6s ease;-o-transition:width 0.6s ease;transition:width 0.6s ease}.progress-striped .progress-bar,.progress-bar-striped{background-image:-webkit-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:-o-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);-webkit-background-size:40px 40px;background-size:40px 40px}.progress.active .progress-bar,.progress-bar.active{-webkit-animation:progress-bar-stripes 2s linear infinite;-o-animation:progress-bar-stripes 2s linear infinite;animation:progress-bar-stripes 2s linear infinite}.progress-bar-success{background-color:#18bc9c}.progress-striped .progress-bar-success{background-image:-webkit-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:-o-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent)}.progress-bar-info{background-color:#3498db}.progress-striped .progress-bar-info{background-image:-webkit-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:-o-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent)}.progress-bar-warning{background-color:#f39c12}.progress-striped .progress-bar-warning{background-image:-webkit-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:-o-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent)}.progress-bar-danger{background-color:#e74c3c}.progress-striped .progress-bar-danger{background-image:-webkit-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:-o-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent)}.media{margin-top:15px}.media:first-child{margin-top:0}.media,.media-body{zoom:1;overflow:hidden}.media-body{width:10000px}.media-object{display:block}.media-object.img-thumbnail{max-width:none}.media-right,.media>.pull-right{padding-left:10px}.media-left,.media>.pull-left{padding-right:10px}.media-left,.media-right,.media-body{display:table-cell;vertical-align:top}.media-middle{vertical-align:middle}.media-bottom{vertical-align:bottom}.media-heading{margin-top:0;margin-bottom:5px}.media-list{padding-left:0;list-style:none}.list-group{margin-bottom:20px;padding-left:0}.list-group-item{position:relative;display:block;padding:10px 15px;margin-bottom:-1px;background-color:#ffffff;border:1px solid #ecf0f1}.list-group-item:first-child{border-top-right-radius:4px;border-top-left-radius:4px}.list-group-item:last-child{margin-bottom:0;border-bottom-right-radius:4px;border-bottom-left-radius:4px}a.list-group-item,button.list-group-item{color:#555555}a.list-group-item .list-group-item-heading,button.list-group-item .list-group-item-heading{color:#333333}a.list-group-item:hover,button.list-group-item:hover,a.list-group-item:focus,button.list-group-item:focus{text-decoration:none;color:#555555;background-color:#ecf0f1}button.list-group-item{width:100%;text-align:left}.list-group-item.disabled,.list-group-item.disabled:hover,.list-group-item.disabled:focus{background-color:#ecf0f1;color:#b4bcc2;cursor:not-allowed}.list-group-item.disabled .list-group-item-heading,.list-group-item.disabled:hover .list-group-item-heading,.list-group-item.disabled:focus .list-group-item-heading{color:inherit}.list-group-item.disabled .list-group-item-text,.list-group-item.disabled:hover .list-group-item-text,.list-group-item.disabled:focus .list-group-item-text{color:#b4bcc2}.list-group-item.active,.list-group-item.active:hover,.list-group-item.active:focus{z-index:2;color:#ffffff;background-color:#2c3e50;border-color:#2c3e50}.list-group-item.active .list-group-item-heading,.list-group-item.active:hover .list-group-item-heading,.list-group-item.active:focus .list-group-item-heading,.list-group-item.active .list-group-item-heading>small,.list-group-item.active:hover .list-group-item-heading>small,.list-group-item.active:focus .list-group-item-heading>small,.list-group-item.active .list-group-item-heading>.small,.list-group-item.active:hover .list-group-item-heading>.small,.list-group-item.active:focus .list-group-item-heading>.small{color:inherit}.list-group-item.active .list-group-item-text,.list-group-item.active:hover .list-group-item-text,.list-group-item.active:focus .list-group-item-text{color:#8aa4be}.list-group-item-success{color:#ffffff;background-color:#18bc9c}a.list-group-item-success,button.list-group-item-success{color:#ffffff}a.list-group-item-success .list-group-item-heading,button.list-group-item-success .list-group-item-heading{color:inherit}a.list-group-item-success:hover,button.list-group-item-success:hover,a.list-group-item-success:focus,button.list-group-item-success:focus{color:#ffffff;background-color:#15a589}a.list-group-item-success.active,button.list-group-item-success.active,a.list-group-item-success.active:hover,button.list-group-item-success.active:hover,a.list-group-item-success.active:focus,button.list-group-item-success.active:focus{color:#fff;background-color:#ffffff;border-color:#ffffff}.list-group-item-info{color:#ffffff;background-color:#3498db}a.list-group-item-info,button.list-group-item-info{color:#ffffff}a.list-group-item-info .list-group-item-heading,button.list-group-item-info .list-group-item-heading{color:inherit}a.list-group-item-info:hover,button.list-group-item-info:hover,a.list-group-item-info:focus,button.list-group-item-info:focus{color:#ffffff;background-color:#258cd1}a.list-group-item-info.active,button.list-group-item-info.active,a.list-group-item-info.active:hover,button.list-group-item-info.active:hover,a.list-group-item-info.active:focus,button.list-group-item-info.active:focus{color:#fff;background-color:#ffffff;border-color:#ffffff}.list-group-item-warning{color:#ffffff;background-color:#f39c12}a.list-group-item-warning,button.list-group-item-warning{color:#ffffff}a.list-group-item-warning .list-group-item-heading,button.list-group-item-warning .list-group-item-heading{color:inherit}a.list-group-item-warning:hover,button.list-group-item-warning:hover,a.list-group-item-warning:focus,button.list-group-item-warning:focus{color:#ffffff;background-color:#e08e0b}a.list-group-item-warning.active,button.list-group-item-warning.active,a.list-group-item-warning.active:hover,button.list-group-item-warning.active:hover,a.list-group-item-warning.active:focus,button.list-group-item-warning.active:focus{color:#fff;background-color:#ffffff;border-color:#ffffff}.list-group-item-danger{color:#ffffff;background-color:#e74c3c}a.list-group-item-danger,button.list-group-item-danger{color:#ffffff}a.list-group-item-danger .list-group-item-heading,button.list-group-item-danger .list-group-item-heading{color:inherit}a.list-group-item-danger:hover,button.list-group-item-danger:hover,a.list-group-item-danger:focus,button.list-group-item-danger:focus{color:#ffffff;background-color:#e43725}a.list-group-item-danger.active,button.list-group-item-danger.active,a.list-group-item-danger.active:hover,button.list-group-item-danger.active:hover,a.list-group-item-danger.active:focus,button.list-group-item-danger.active:focus{color:#fff;background-color:#ffffff;border-color:#ffffff}.list-group-item-heading{margin-top:0;margin-bottom:5px}.list-group-item-text{margin-bottom:0;line-height:1.3}.panel{margin-bottom:21px;background-color:#ffffff;border:1px solid transparent;border-radius:4px;-webkit-box-shadow:0 1px 1px rgba(0,0,0,0.05);box-shadow:0 1px 1px rgba(0,0,0,0.05)}.panel-body{padding:15px}.panel-heading{padding:10px 15px;border-bottom:1px solid transparent;border-top-right-radius:3px;border-top-left-radius:3px}.panel-heading>.dropdown .dropdown-toggle{color:inherit}.panel-title{margin-top:0;margin-bottom:0;font-size:17px;color:inherit}.panel-title>a,.panel-title>small,.panel-title>.small,.panel-title>small>a,.panel-title>.small>a{color:inherit}.panel-footer{padding:10px 15px;background-color:#ecf0f1;border-top:1px solid #ecf0f1;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.list-group,.panel>.panel-collapse>.list-group{margin-bottom:0}.panel>.list-group .list-group-item,.panel>.panel-collapse>.list-group .list-group-item{border-width:1px 0;border-radius:0}.panel>.list-group:first-child .list-group-item:first-child,.panel>.panel-collapse>.list-group:first-child .list-group-item:first-child{border-top:0;border-top-right-radius:3px;border-top-left-radius:3px}.panel>.list-group:last-child .list-group-item:last-child,.panel>.panel-collapse>.list-group:last-child .list-group-item:last-child{border-bottom:0;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.panel-heading+.panel-collapse>.list-group .list-group-item:first-child{border-top-right-radius:0;border-top-left-radius:0}.panel-heading+.list-group .list-group-item:first-child{border-top-width:0}.list-group+.panel-footer{border-top-width:0}.panel>.table,.panel>.table-responsive>.table,.panel>.panel-collapse>.table{margin-bottom:0}.panel>.table caption,.panel>.table-responsive>.table caption,.panel>.panel-collapse>.table caption{padding-left:15px;padding-right:15px}.panel>.table:first-child,.panel>.table-responsive:first-child>.table:first-child{border-top-right-radius:3px;border-top-left-radius:3px}.panel>.table:first-child>thead:first-child>tr:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child{border-top-left-radius:3px;border-top-right-radius:3px}.panel>.table:first-child>thead:first-child>tr:first-child td:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child td:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child td:first-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child td:first-child,.panel>.table:first-child>thead:first-child>tr:first-child th:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child th:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child th:first-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child th:first-child{border-top-left-radius:3px}.panel>.table:first-child>thead:first-child>tr:first-child td:last-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child td:last-child,.panel>.table:first-child>tbody:first-child>tr:first-child td:last-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child td:last-child,.panel>.table:first-child>thead:first-child>tr:first-child th:last-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child th:last-child,.panel>.table:first-child>tbody:first-child>tr:first-child th:last-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child th:last-child{border-top-right-radius:3px}.panel>.table:last-child,.panel>.table-responsive:last-child>.table:last-child{border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.table:last-child>tbody:last-child>tr:last-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child{border-bottom-left-radius:3px;border-bottom-right-radius:3px}.panel>.table:last-child>tbody:last-child>tr:last-child td:first-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child td:first-child,.panel>.table:last-child>tfoot:last-child>tr:last-child td:first-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child td:first-child,.panel>.table:last-child>tbody:last-child>tr:last-child th:first-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child th:first-child,.panel>.table:last-child>tfoot:last-child>tr:last-child th:first-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child th:first-child{border-bottom-left-radius:3px}.panel>.table:last-child>tbody:last-child>tr:last-child td:last-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child td:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child td:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child td:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child th:last-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child th:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child th:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child th:last-child{border-bottom-right-radius:3px}.panel>.panel-body+.table,.panel>.panel-body+.table-responsive,.panel>.table+.panel-body,.panel>.table-responsive+.panel-body{border-top:1px solid #ecf0f1}.panel>.table>tbody:first-child>tr:first-child th,.panel>.table>tbody:first-child>tr:first-child td{border-top:0}.panel>.table-bordered,.panel>.table-responsive>.table-bordered{border:0}.panel>.table-bordered>thead>tr>th:first-child,.panel>.table-responsive>.table-bordered>thead>tr>th:first-child,.panel>.table-bordered>tbody>tr>th:first-child,.panel>.table-responsive>.table-bordered>tbody>tr>th:first-child,.panel>.table-bordered>tfoot>tr>th:first-child,.panel>.table-responsive>.table-bordered>tfoot>tr>th:first-child,.panel>.table-bordered>thead>tr>td:first-child,.panel>.table-responsive>.table-bordered>thead>tr>td:first-child,.panel>.table-bordered>tbody>tr>td:first-child,.panel>.table-responsive>.table-bordered>tbody>tr>td:first-child,.panel>.table-bordered>tfoot>tr>td:first-child,.panel>.table-responsive>.table-bordered>tfoot>tr>td:first-child{border-left:0}.panel>.table-bordered>thead>tr>th:last-child,.panel>.table-responsive>.table-bordered>thead>tr>th:last-child,.panel>.table-bordered>tbody>tr>th:last-child,.panel>.table-responsive>.table-bordered>tbody>tr>th:last-child,.panel>.table-bordered>tfoot>tr>th:last-child,.panel>.table-responsive>.table-bordered>tfoot>tr>th:last-child,.panel>.table-bordered>thead>tr>td:last-child,.panel>.table-responsive>.table-bordered>thead>tr>td:last-child,.panel>.table-bordered>tbody>tr>td:last-child,.panel>.table-responsive>.table-bordered>tbody>tr>td:last-child,.panel>.table-bordered>tfoot>tr>td:last-child,.panel>.table-responsive>.table-bordered>tfoot>tr>td:last-child{border-right:0}.panel>.table-bordered>thead>tr:first-child>td,.panel>.table-responsive>.table-bordered>thead>tr:first-child>td,.panel>.table-bordered>tbody>tr:first-child>td,.panel>.table-responsive>.table-bordered>tbody>tr:first-child>td,.panel>.table-bordered>thead>tr:first-child>th,.panel>.table-responsive>.table-bordered>thead>tr:first-child>th,.panel>.table-bordered>tbody>tr:first-child>th,.panel>.table-responsive>.table-bordered>tbody>tr:first-child>th{border-bottom:0}.panel>.table-bordered>tbody>tr:last-child>td,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>td,.panel>.table-bordered>tfoot>tr:last-child>td,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>td,.panel>.table-bordered>tbody>tr:last-child>th,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>th,.panel>.table-bordered>tfoot>tr:last-child>th,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>th{border-bottom:0}.panel>.table-responsive{border:0;margin-bottom:0}.panel-group{margin-bottom:21px}.panel-group .panel{margin-bottom:0;border-radius:4px}.panel-group .panel+.panel{margin-top:5px}.panel-group .panel-heading{border-bottom:0}.panel-group .panel-heading+.panel-collapse>.panel-body,.panel-group .panel-heading+.panel-collapse>.list-group{border-top:1px solid #ecf0f1}.panel-group .panel-footer{border-top:0}.panel-group .panel-footer+.panel-collapse .panel-body{border-bottom:1px solid #ecf0f1}.panel-default{border-color:#ecf0f1}.panel-default>.panel-heading{color:#2c3e50;background-color:#ecf0f1;border-color:#ecf0f1}.panel-default>.panel-heading+.panel-collapse>.panel-body{border-top-color:#ecf0f1}.panel-default>.panel-heading .badge{color:#ecf0f1;background-color:#2c3e50}.panel-default>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#ecf0f1}.panel-primary{border-color:#2c3e50}.panel-primary>.panel-heading{color:#ffffff;background-color:#2c3e50;border-color:#2c3e50}.panel-primary>.panel-heading+.panel-collapse>.panel-body{border-top-color:#2c3e50}.panel-primary>.panel-heading .badge{color:#2c3e50;background-color:#ffffff}.panel-primary>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#2c3e50}.panel-success{border-color:#18bc9c}.panel-success>.panel-heading{color:#ffffff;background-color:#18bc9c;border-color:#18bc9c}.panel-success>.panel-heading+.panel-collapse>.panel-body{border-top-color:#18bc9c}.panel-success>.panel-heading .badge{color:#18bc9c;background-color:#ffffff}.panel-success>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#18bc9c}.panel-info{border-color:#3498db}.panel-info>.panel-heading{color:#ffffff;background-color:#3498db;border-color:#3498db}.panel-info>.panel-heading+.panel-collapse>.panel-body{border-top-color:#3498db}.panel-info>.panel-heading .badge{color:#3498db;background-color:#ffffff}.panel-info>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#3498db}.panel-warning{border-color:#f39c12}.panel-warning>.panel-heading{color:#ffffff;background-color:#f39c12;border-color:#f39c12}.panel-warning>.panel-heading+.panel-collapse>.panel-body{border-top-color:#f39c12}.panel-warning>.panel-heading .badge{color:#f39c12;background-color:#ffffff}.panel-warning>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#f39c12}.panel-danger{border-color:#e74c3c}.panel-danger>.panel-heading{color:#ffffff;background-color:#e74c3c;border-color:#e74c3c}.panel-danger>.panel-heading+.panel-collapse>.panel-body{border-top-color:#e74c3c}.panel-danger>.panel-heading .badge{color:#e74c3c;background-color:#ffffff}.panel-danger>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#e74c3c}.embed-responsive{position:relative;display:block;height:0;padding:0;overflow:hidden}.embed-responsive .embed-responsive-item,.embed-responsive iframe,.embed-responsive embed,.embed-responsive object,.embed-responsive video{position:absolute;top:0;left:0;bottom:0;height:100%;width:100%;border:0}.embed-responsive-16by9{padding-bottom:56.25%}.embed-responsive-4by3{padding-bottom:75%}.well{min-height:20px;padding:19px;margin-bottom:20px;background-color:#ecf0f1;border:1px solid transparent;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.05);box-shadow:inset 0 1px 1px rgba(0,0,0,0.05)}.well blockquote{border-color:#ddd;border-color:rgba(0,0,0,0.15)}.well-lg{padding:24px;border-radius:6px}.well-sm{padding:9px;border-radius:3px}.close{float:right;font-size:22.5px;font-weight:bold;line-height:1;color:#000000;text-shadow:none;opacity:0.2;filter:alpha(opacity=20)}.close:hover,.close:focus{color:#000000;text-decoration:none;cursor:pointer;opacity:0.5;filter:alpha(opacity=50)}button.close{padding:0;cursor:pointer;background:transparent;border:0;-webkit-appearance:none}.modal-open{overflow:hidden}.modal{display:none;overflow:hidden;position:fixed;top:0;right:0;bottom:0;left:0;z-index:1050;-webkit-overflow-scrolling:touch;outline:0}.modal.fade .modal-dialog{-webkit-transform:translate(0, -25%);-ms-transform:translate(0, -25%);-o-transform:translate(0, -25%);transform:translate(0, -25%);-webkit-transition:-webkit-transform .3s ease-out;-o-transition:-o-transform .3s ease-out;transition:transform .3s ease-out}.modal.in .modal-dialog{-webkit-transform:translate(0, 0);-ms-transform:translate(0, 0);-o-transform:translate(0, 0);transform:translate(0, 0)}.modal-open .modal{overflow-x:hidden;overflow-y:auto}.modal-dialog{position:relative;width:auto;margin:10px}.modal-content{position:relative;background-color:#ffffff;border:1px solid #999999;border:1px solid rgba(0,0,0,0.2);border-radius:6px;-webkit-box-shadow:0 3px 9px rgba(0,0,0,0.5);box-shadow:0 3px 9px rgba(0,0,0,0.5);-webkit-background-clip:padding-box;background-clip:padding-box;outline:0}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1040;background-color:#000000}.modal-backdrop.fade{opacity:0;filter:alpha(opacity=0)}.modal-backdrop.in{opacity:0.5;filter:alpha(opacity=50)}.modal-header{padding:15px;border-bottom:1px solid #e5e5e5}.modal-header .close{margin-top:-2px}.modal-title{margin:0;line-height:1.42857143}.modal-body{position:relative;padding:20px}.modal-footer{padding:20px;text-align:right;border-top:1px solid #e5e5e5}.modal-footer .btn+.btn{margin-left:5px;margin-bottom:0}.modal-footer .btn-group .btn+.btn{margin-left:-1px}.modal-footer .btn-block+.btn-block{margin-left:0}.modal-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}@media (min-width:768px){.modal-dialog{width:600px;margin:30px auto}.modal-content{-webkit-box-shadow:0 5px 15px rgba(0,0,0,0.5);box-shadow:0 5px 15px rgba(0,0,0,0.5)}.modal-sm{width:300px}}@media (min-width:992px){.modal-lg{width:900px}}.tooltip{position:absolute;z-index:1070;display:block;font-family:"Lato","Helvetica Neue",Helvetica,Arial,sans-serif;font-style:normal;font-weight:normal;letter-spacing:normal;line-break:auto;line-height:1.42857143;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;white-space:normal;word-break:normal;word-spacing:normal;word-wrap:normal;font-size:13px;opacity:0;filter:alpha(opacity=0)}.tooltip.in{opacity:0.9;filter:alpha(opacity=90)}.tooltip.top{margin-top:-3px;padding:5px 0}.tooltip.right{margin-left:3px;padding:0 5px}.tooltip.bottom{margin-top:3px;padding:5px 0}.tooltip.left{margin-left:-3px;padding:0 5px}.tooltip-inner{max-width:200px;padding:3px 8px;color:#ffffff;text-align:center;background-color:#000000;border-radius:4px}.tooltip-arrow{position:absolute;width:0;height:0;border-color:transparent;border-style:solid}.tooltip.top .tooltip-arrow{bottom:0;left:50%;margin-left:-5px;border-width:5px 5px 0;border-top-color:#000000}.tooltip.top-left .tooltip-arrow{bottom:0;right:5px;margin-bottom:-5px;border-width:5px 5px 0;border-top-color:#000000}.tooltip.top-right .tooltip-arrow{bottom:0;left:5px;margin-bottom:-5px;border-width:5px 5px 0;border-top-color:#000000}.tooltip.right .tooltip-arrow{top:50%;left:0;margin-top:-5px;border-width:5px 5px 5px 0;border-right-color:#000000}.tooltip.left .tooltip-arrow{top:50%;right:0;margin-top:-5px;border-width:5px 0 5px 5px;border-left-color:#000000}.tooltip.bottom .tooltip-arrow{top:0;left:50%;margin-left:-5px;border-width:0 5px 5px;border-bottom-color:#000000}.tooltip.bottom-left .tooltip-arrow{top:0;right:5px;margin-top:-5px;border-width:0 5px 5px;border-bottom-color:#000000}.tooltip.bottom-right .tooltip-arrow{top:0;left:5px;margin-top:-5px;border-width:0 5px 5px;border-bottom-color:#000000}.popover{position:absolute;top:0;left:0;z-index:1060;display:none;max-width:276px;padding:1px;font-family:"Lato","Helvetica Neue",Helvetica,Arial,sans-serif;font-style:normal;font-weight:normal;letter-spacing:normal;line-break:auto;line-height:1.42857143;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;white-space:normal;word-break:normal;word-spacing:normal;word-wrap:normal;font-size:15px;background-color:#ffffff;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid #cccccc;border:1px solid rgba(0,0,0,0.2);border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,0.2);box-shadow:0 5px 10px rgba(0,0,0,0.2)}.popover.top{margin-top:-10px}.popover.right{margin-left:10px}.popover.bottom{margin-top:10px}.popover.left{margin-left:-10px}.popover-title{margin:0;padding:8px 14px;font-size:15px;background-color:#f7f7f7;border-bottom:1px solid #ebebeb;border-radius:5px 5px 0 0}.popover-content{padding:9px 14px}.popover>.arrow,.popover>.arrow:after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.popover>.arrow{border-width:11px}.popover>.arrow:after{border-width:10px;content:""}.popover.top>.arrow{left:50%;margin-left:-11px;border-bottom-width:0;border-top-color:#999999;border-top-color:rgba(0,0,0,0.25);bottom:-11px}.popover.top>.arrow:after{content:" ";bottom:1px;margin-left:-10px;border-bottom-width:0;border-top-color:#ffffff}.popover.right>.arrow{top:50%;left:-11px;margin-top:-11px;border-left-width:0;border-right-color:#999999;border-right-color:rgba(0,0,0,0.25)}.popover.right>.arrow:after{content:" ";left:1px;bottom:-10px;border-left-width:0;border-right-color:#ffffff}.popover.bottom>.arrow{left:50%;margin-left:-11px;border-top-width:0;border-bottom-color:#999999;border-bottom-color:rgba(0,0,0,0.25);top:-11px}.popover.bottom>.arrow:after{content:" ";top:1px;margin-left:-10px;border-top-width:0;border-bottom-color:#ffffff}.popover.left>.arrow{top:50%;right:-11px;margin-top:-11px;border-right-width:0;border-left-color:#999999;border-left-color:rgba(0,0,0,0.25)}.popover.left>.arrow:after{content:" ";right:1px;border-right-width:0;border-left-color:#ffffff;bottom:-10px}.carousel{position:relative}.carousel-inner{position:relative;overflow:hidden;width:100%}.carousel-inner>.item{display:none;position:relative;-webkit-transition:.6s ease-in-out left;-o-transition:.6s ease-in-out left;transition:.6s ease-in-out left}.carousel-inner>.item>img,.carousel-inner>.item>a>img{line-height:1}@media all and (transform-3d),(-webkit-transform-3d){.carousel-inner>.item{-webkit-transition:-webkit-transform .6s ease-in-out;-o-transition:-o-transform .6s ease-in-out;transition:transform .6s ease-in-out;-webkit-backface-visibility:hidden;backface-visibility:hidden;-webkit-perspective:1000px;perspective:1000px}.carousel-inner>.item.next,.carousel-inner>.item.active.right{-webkit-transform:translate3d(100%, 0, 0);transform:translate3d(100%, 0, 0);left:0}.carousel-inner>.item.prev,.carousel-inner>.item.active.left{-webkit-transform:translate3d(-100%, 0, 0);transform:translate3d(-100%, 0, 0);left:0}.carousel-inner>.item.next.left,.carousel-inner>.item.prev.right,.carousel-inner>.item.active{-webkit-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0);left:0}}.carousel-inner>.active,.carousel-inner>.next,.carousel-inner>.prev{display:block}.carousel-inner>.active{left:0}.carousel-inner>.next,.carousel-inner>.prev{position:absolute;top:0;width:100%}.carousel-inner>.next{left:100%}.carousel-inner>.prev{left:-100%}.carousel-inner>.next.left,.carousel-inner>.prev.right{left:0}.carousel-inner>.active.left{left:-100%}.carousel-inner>.active.right{left:100%}.carousel-control{position:absolute;top:0;left:0;bottom:0;width:15%;opacity:0.5;filter:alpha(opacity=50);font-size:20px;color:#ffffff;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,0.6);background-color:rgba(0,0,0,0)}.carousel-control.left{background-image:-webkit-linear-gradient(left, rgba(0,0,0,0.5) 0, rgba(0,0,0,0.0001) 100%);background-image:-o-linear-gradient(left, rgba(0,0,0,0.5) 0, rgba(0,0,0,0.0001) 100%);background-image:-webkit-gradient(linear, left top, right top, from(rgba(0,0,0,0.5)), to(rgba(0,0,0,0.0001)));background-image:linear-gradient(to right, rgba(0,0,0,0.5) 0, rgba(0,0,0,0.0001) 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000', endColorstr='#00000000', GradientType=1)}.carousel-control.right{left:auto;right:0;background-image:-webkit-linear-gradient(left, rgba(0,0,0,0.0001) 0, rgba(0,0,0,0.5) 100%);background-image:-o-linear-gradient(left, rgba(0,0,0,0.0001) 0, rgba(0,0,0,0.5) 100%);background-image:-webkit-gradient(linear, left top, right top, from(rgba(0,0,0,0.0001)), to(rgba(0,0,0,0.5)));background-image:linear-gradient(to right, rgba(0,0,0,0.0001) 0, rgba(0,0,0,0.5) 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#80000000', GradientType=1)}.carousel-control:hover,.carousel-control:focus{outline:0;color:#ffffff;text-decoration:none;opacity:0.9;filter:alpha(opacity=90)}.carousel-control .icon-prev,.carousel-control .icon-next,.carousel-control .glyphicon-chevron-left,.carousel-control .glyphicon-chevron-right{position:absolute;top:50%;margin-top:-10px;z-index:5;display:inline-block}.carousel-control .icon-prev,.carousel-control .glyphicon-chevron-left{left:50%;margin-left:-10px}.carousel-control .icon-next,.carousel-control .glyphicon-chevron-right{right:50%;margin-right:-10px}.carousel-control .icon-prev,.carousel-control .icon-next{width:20px;height:20px;line-height:1;font-family:serif}.carousel-control .icon-prev:before{content:'\2039'}.carousel-control .icon-next:before{content:'\203a'}.carousel-indicators{position:absolute;bottom:10px;left:50%;z-index:15;width:60%;margin-left:-30%;padding-left:0;list-style:none;text-align:center}.carousel-indicators li{display:inline-block;width:10px;height:10px;margin:1px;text-indent:-999px;border:1px solid #ffffff;border-radius:10px;cursor:pointer;background-color:#000 \9;background-color:rgba(0,0,0,0)}.carousel-indicators .active{margin:0;width:12px;height:12px;background-color:#ffffff}.carousel-caption{position:absolute;left:15%;right:15%;bottom:20px;z-index:10;padding-top:20px;padding-bottom:20px;color:#ffffff;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,0.6)}.carousel-caption .btn{text-shadow:none}@media screen and (min-width:768px){.carousel-control .glyphicon-chevron-left,.carousel-control .glyphicon-chevron-right,.carousel-control .icon-prev,.carousel-control .icon-next{width:30px;height:30px;margin-top:-10px;font-size:30px}.carousel-control .glyphicon-chevron-left,.carousel-control .icon-prev{margin-left:-10px}.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next{margin-right:-10px}.carousel-caption{left:20%;right:20%;padding-bottom:30px}.carousel-indicators{bottom:20px}}.clearfix:before,.clearfix:after,.dl-horizontal dd:before,.dl-horizontal dd:after,.container:before,.container:after,.container-fluid:before,.container-fluid:after,.row:before,.row:after,.form-horizontal .form-group:before,.form-horizontal .form-group:after,.btn-toolbar:before,.btn-toolbar:after,.btn-group-vertical>.btn-group:before,.btn-group-vertical>.btn-group:after,.nav:before,.nav:after,.navbar:before,.navbar:after,.navbar-header:before,.navbar-header:after,.navbar-collapse:before,.navbar-collapse:after,.pager:before,.pager:after,.panel-body:before,.panel-body:after,.modal-header:before,.modal-header:after,.modal-footer:before,.modal-footer:after{content:" ";display:table}.clearfix:after,.dl-horizontal dd:after,.container:after,.container-fluid:after,.row:after,.form-horizontal .form-group:after,.btn-toolbar:after,.btn-group-vertical>.btn-group:after,.nav:after,.navbar:after,.navbar-header:after,.navbar-collapse:after,.pager:after,.panel-body:after,.modal-header:after,.modal-footer:after{clear:both}.center-block{display:block;margin-left:auto;margin-right:auto}.pull-right{float:right !important}.pull-left{float:left !important}.hide{display:none !important}.show{display:block !important}.invisible{visibility:hidden}.text-hide{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.hidden{display:none !important}.affix{position:fixed}@-ms-viewport{width:device-width}.visible-xs,.visible-sm,.visible-md,.visible-lg{display:none !important}.visible-xs-block,.visible-xs-inline,.visible-xs-inline-block,.visible-sm-block,.visible-sm-inline,.visible-sm-inline-block,.visible-md-block,.visible-md-inline,.visible-md-inline-block,.visible-lg-block,.visible-lg-inline,.visible-lg-inline-block{display:none !important}@media (max-width:767px){.visible-xs{display:block !important}table.visible-xs{display:table !important}tr.visible-xs{display:table-row !important}th.visible-xs,td.visible-xs{display:table-cell !important}}@media (max-width:767px){.visible-xs-block{display:block !important}}@media (max-width:767px){.visible-xs-inline{display:inline !important}}@media (max-width:767px){.visible-xs-inline-block{display:inline-block !important}}@media (min-width:768px) and (max-width:991px){.visible-sm{display:block !important}table.visible-sm{display:table !important}tr.visible-sm{display:table-row !important}th.visible-sm,td.visible-sm{display:table-cell !important}}@media (min-width:768px) and (max-width:991px){.visible-sm-block{display:block !important}}@media (min-width:768px) and (max-width:991px){.visible-sm-inline{display:inline !important}}@media (min-width:768px) and (max-width:991px){.visible-sm-inline-block{display:inline-block !important}}@media (min-width:992px) and (max-width:1199px){.visible-md{display:block !important}table.visible-md{display:table !important}tr.visible-md{display:table-row !important}th.visible-md,td.visible-md{display:table-cell !important}}@media (min-width:992px) and (max-width:1199px){.visible-md-block{display:block !important}}@media (min-width:992px) and (max-width:1199px){.visible-md-inline{display:inline !important}}@media (min-width:992px) and (max-width:1199px){.visible-md-inline-block{display:inline-block !important}}@media (min-width:1200px){.visible-lg{display:block !important}table.visible-lg{display:table !important}tr.visible-lg{display:table-row !important}th.visible-lg,td.visible-lg{display:table-cell !important}}@media (min-width:1200px){.visible-lg-block{display:block !important}}@media (min-width:1200px){.visible-lg-inline{display:inline !important}}@media (min-width:1200px){.visible-lg-inline-block{display:inline-block !important}}@media (max-width:767px){.hidden-xs{display:none !important}}@media (min-width:768px) and (max-width:991px){.hidden-sm{display:none !important}}@media (min-width:992px) and (max-width:1199px){.hidden-md{display:none !important}}@media (min-width:1200px){.hidden-lg{display:none !important}}.visible-print{display:none !important}@media print{.visible-print{display:block !important}table.visible-print{display:table !important}tr.visible-print{display:table-row !important}th.visible-print,td.visible-print{display:table-cell !important}}.visible-print-block{display:none !important}@media print{.visible-print-block{display:block !important}}.visible-print-inline{display:none !important}@media print{.visible-print-inline{display:inline !important}}.visible-print-inline-block{display:none !important}@media print{.visible-print-inline-block{display:inline-block !important}}@media print{.hidden-print{display:none !important}}.navbar{border-width:0}.navbar-default .badge{background-color:#fff;color:#2c3e50}.navbar-inverse .badge{background-color:#fff;color:#18bc9c}.navbar-brand{line-height:1}.btn{border-width:2px}.btn:active{-webkit-box-shadow:none;box-shadow:none}.btn-group.open .dropdown-toggle{-webkit-box-shadow:none;box-shadow:none}.text-primary,.text-primary:hover{color:#2c3e50}.text-success,.text-success:hover{color:#18bc9c}.text-danger,.text-danger:hover{color:#e74c3c}.text-warning,.text-warning:hover{color:#f39c12}.text-info,.text-info:hover{color:#3498db}table a:not(.btn),.table a:not(.btn){text-decoration:underline}table .dropdown-menu a,.table .dropdown-menu a{text-decoration:none}table .success,.table .success,table .warning,.table .warning,table .danger,.table .danger,table .info,.table .info{color:#fff}table .success>th>a,.table .success>th>a,table .warning>th>a,.table .warning>th>a,table .danger>th>a,.table .danger>th>a,table .info>th>a,.table .info>th>a,table .success>td>a,.table .success>td>a,table .warning>td>a,.table .warning>td>a,table .danger>td>a,.table .danger>td>a,table .info>td>a,.table .info>td>a,table .success>a,.table .success>a,table .warning>a,.table .warning>a,table .danger>a,.table .danger>a,table .info>a,.table .info>a{color:#fff}table>thead>tr>th,.table>thead>tr>th,table>tbody>tr>th,.table>tbody>tr>th,table>tfoot>tr>th,.table>tfoot>tr>th,table>thead>tr>td,.table>thead>tr>td,table>tbody>tr>td,.table>tbody>tr>td,table>tfoot>tr>td,.table>tfoot>tr>td{border:none}table-bordered>thead>tr>th,.table-bordered>thead>tr>th,table-bordered>tbody>tr>th,.table-bordered>tbody>tr>th,table-bordered>tfoot>tr>th,.table-bordered>tfoot>tr>th,table-bordered>thead>tr>td,.table-bordered>thead>tr>td,table-bordered>tbody>tr>td,.table-bordered>tbody>tr>td,table-bordered>tfoot>tr>td,.table-bordered>tfoot>tr>td{border:1px solid #ecf0f1}.form-control,input{border-width:2px;-webkit-box-shadow:none;box-shadow:none}.form-control:focus,input:focus{-webkit-box-shadow:none;box-shadow:none}.has-warning .help-block,.has-warning .control-label,.has-warning .radio,.has-warning .checkbox,.has-warning .radio-inline,.has-warning .checkbox-inline,.has-warning.radio label,.has-warning.checkbox label,.has-warning.radio-inline label,.has-warning.checkbox-inline label,.has-warning .form-control-feedback{color:#f39c12}.has-warning .form-control,.has-warning .form-control:focus{border:2px solid #f39c12}.has-warning .input-group-addon{border-color:#f39c12}.has-error .help-block,.has-error .control-label,.has-error .radio,.has-error .checkbox,.has-error .radio-inline,.has-error .checkbox-inline,.has-error.radio label,.has-error.checkbox label,.has-error.radio-inline label,.has-error.checkbox-inline label,.has-error .form-control-feedback{color:#e74c3c}.has-error .form-control,.has-error .form-control:focus{border:2px solid #e74c3c}.has-error .input-group-addon{border-color:#e74c3c}.has-success .help-block,.has-success .control-label,.has-success .radio,.has-success .checkbox,.has-success .radio-inline,.has-success .checkbox-inline,.has-success.radio label,.has-success.checkbox label,.has-success.radio-inline label,.has-success.checkbox-inline label,.has-success .form-control-feedback{color:#18bc9c}.has-success .form-control,.has-success .form-control:focus{border:2px solid #18bc9c}.has-success .input-group-addon{border-color:#18bc9c}.nav .open>a,.nav .open>a:hover,.nav .open>a:focus{border-color:transparent}.pager a,.pager a:hover{color:#fff}.pager .disabled>a,.pager .disabled>a:hover,.pager .disabled>a:focus,.pager .disabled>span{background-color:#3be6c4}.close{color:#fff;text-decoration:none;opacity:0.4}.close:hover,.close:focus{color:#fff;opacity:1}.alert .alert-link{color:#fff;text-decoration:underline}.progress{height:10px;-webkit-box-shadow:none;box-shadow:none}.progress .progress-bar{font-size:10px;line-height:10px}.well{-webkit-box-shadow:none;box-shadow:none}a.list-group-item.active,a.list-group-item.active:hover,a.list-group-item.active:focus{border-color:#ecf0f1}a.list-group-item-success.active{background-color:#18bc9c}a.list-group-item-success.active:hover,a.list-group-item-success.active:focus{background-color:#15a589}a.list-group-item-warning.active{background-color:#f39c12}a.list-group-item-warning.active:hover,a.list-group-item-warning.active:focus{background-color:#e08e0b}a.list-group-item-danger.active{background-color:#e74c3c}a.list-group-item-danger.active:hover,a.list-group-item-danger.active:focus{background-color:#e43725}.panel-default .close{color:#2c3e50}.modal .close{color:#2c3e50}.popover{color:#2c3e50} \ No newline at end of file diff --git a/css/jquery-ui.theme.css b/dist/jquery-ui.css similarity index 56% rename from css/jquery-ui.theme.css rename to dist/jquery-ui.css index 317a3b7b0..975aa1bdb 100644 --- a/css/jquery-ui.theme.css +++ b/dist/jquery-ui.css @@ -1,8 +1,8 @@ -/*! jQuery UI - v1.11.4 - 2015-10-16 +/*! jQuery UI - v1.11.3 - 2015-02-12 * http://jqueryui.com -* Includes: core.css, datepicker.css, slider.css, theme.css -* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Trebuchet%20MS%2CTahoma%2CVerdana%2CArial%2Csans-serif&fwDefault=bold&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=f6a828&bgTextureHeader=gloss_wave&bgImgOpacityHeader=35&borderColorHeader=e78f08&fcHeader=ffffff&iconColorHeader=ffffff&bgColorContent=eeeeee&bgTextureContent=highlight_soft&bgImgOpacityContent=100&borderColorContent=dddddd&fcContent=333333&iconColorContent=222222&bgColorDefault=f6f6f6&bgTextureDefault=glass&bgImgOpacityDefault=100&borderColorDefault=cccccc&fcDefault=1c94c4&iconColorDefault=ef8c08&bgColorHover=fdf5ce&bgTextureHover=glass&bgImgOpacityHover=100&borderColorHover=fbcb09&fcHover=c77405&iconColorHover=ef8c08&bgColorActive=ffffff&bgTextureActive=glass&bgImgOpacityActive=65&borderColorActive=fbd850&fcActive=eb8f00&iconColorActive=ef8c08&bgColorHighlight=ffe45c&bgTextureHighlight=highlight_soft&bgImgOpacityHighlight=75&borderColorHighlight=fed22f&fcHighlight=363636&iconColorHighlight=228ef1&bgColorError=b81900&bgTextureError=diagonals_thick&bgImgOpacityError=18&borderColorError=cd0a0a&fcError=ffffff&iconColorError=ffd27a&bgColorOverlay=666666&bgTextureOverlay=diagonals_thick&bgImgOpacityOverlay=20&opacityOverlay=50&bgColorShadow=000000&bgTextureShadow=flat&bgImgOpacityShadow=10&opacityShadow=20&thicknessShadow=5px&offsetTopShadow=-5px&offsetLeftShadow=-5px&cornerRadiusShadow=5px -* Copyright 2015 jQuery Foundation and other contributors; Licensed MIT */ +* Includes: core.css, accordion.css, autocomplete.css, button.css, datepicker.css, dialog.css, draggable.css, menu.css, progressbar.css, resizable.css, selectable.css, selectmenu.css, slider.css, sortable.css, spinner.css, tabs.css, tooltip.css, theme.css +* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Arial%2CHelvetica%2Csans-serif&fsDefault=1em&fwDefault=normal&cornerRadius=3px&bgColorHeader=e9e9e9&bgTextureHeader=flat&borderColorHeader=dddddd&fcHeader=333333&iconColorHeader=444444&bgColorContent=ffffff&bgTextureContent=flat&borderColorContent=dddddd&fcContent=333333&iconColorContent=444444&bgColorDefault=f6f6f6&bgTextureDefault=flat&borderColorDefault=c5c5c5&fcDefault=454545&iconColorDefault=777777&bgColorHover=ededed&bgTextureHover=flat&borderColorHover=cccccc&fcHover=2b2b2b&iconColorHover=555555&bgColorActive=007fff&bgTextureActive=flat&borderColorActive=003eff&fcActive=ffffff&iconColorActive=ffffff&bgColorHighlight=fffa90&bgTextureHighlight=flat&borderColorHighlight=dad55e&fcHighlight=777620&iconColorHighlight=777620&bgColorError=fddfdf&bgTextureError=flat&borderColorError=f1a899&fcError=5f3f3f&iconColorError=cc0000&bgColorOverlay=aaaaaa&bgTextureOverlay=flat&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=666666&bgTextureShadow=flat&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=5px&offsetTopShadow=0px&offsetLeftShadow=0px&cornerRadiusShadow=8px +* Copyright jQuery Foundation and other contributors; Licensed MIT */ /* Layout helpers ----------------------------------*/ @@ -86,6 +86,142 @@ width: 100%; height: 100%; } +.ui-accordion .ui-accordion-header { + display: block; + cursor: pointer; + position: relative; + margin: 2px 0 0 0; + padding: .5em .5em .5em .7em; + min-height: 0; /* support: IE7 */ + font-size: 100%; +} +.ui-accordion .ui-accordion-icons { + padding-left: 2.2em; +} +.ui-accordion .ui-accordion-icons .ui-accordion-icons { + padding-left: 2.2em; +} +.ui-accordion .ui-accordion-header .ui-accordion-header-icon { + position: absolute; + left: .5em; + top: 50%; + margin-top: -8px; +} +.ui-accordion .ui-accordion-content { + padding: 1em 2.2em; + border-top: 0; + overflow: auto; +} +.ui-autocomplete { + position: absolute; + top: 0; + left: 0; + cursor: default; +} +.ui-button { + display: inline-block; + position: relative; + padding: 0; + line-height: normal; + margin-right: .1em; + cursor: pointer; + vertical-align: middle; + text-align: center; + overflow: visible; /* removes extra width in IE */ +} +.ui-button, +.ui-button:link, +.ui-button:visited, +.ui-button:hover, +.ui-button:active { + text-decoration: none; +} +/* to make room for the icon, a width needs to be set here */ +.ui-button-icon-only { + width: 2.2em; +} +/* button elements seem to need a little more width */ +button.ui-button-icon-only { + width: 2.4em; +} +.ui-button-icons-only { + width: 3.4em; +} +button.ui-button-icons-only { + width: 3.7em; +} + +/* button text element */ +.ui-button .ui-button-text { + display: block; + line-height: normal; +} +.ui-button-text-only .ui-button-text { + padding: .4em 1em; +} +.ui-button-icon-only .ui-button-text, +.ui-button-icons-only .ui-button-text { + padding: .4em; + text-indent: -9999999px; +} +.ui-button-text-icon-primary .ui-button-text, +.ui-button-text-icons .ui-button-text { + padding: .4em 1em .4em 2.1em; +} +.ui-button-text-icon-secondary .ui-button-text, +.ui-button-text-icons .ui-button-text { + padding: .4em 2.1em .4em 1em; +} +.ui-button-text-icons .ui-button-text { + padding-left: 2.1em; + padding-right: 2.1em; +} +/* no icon support for input elements, provide padding by default */ +input.ui-button { + padding: .4em 1em; +} + +/* button icon element(s) */ +.ui-button-icon-only .ui-icon, +.ui-button-text-icon-primary .ui-icon, +.ui-button-text-icon-secondary .ui-icon, +.ui-button-text-icons .ui-icon, +.ui-button-icons-only .ui-icon { + position: absolute; + top: 50%; + margin-top: -8px; +} +.ui-button-icon-only .ui-icon { + left: 50%; + margin-left: -8px; +} +.ui-button-text-icon-primary .ui-button-icon-primary, +.ui-button-text-icons .ui-button-icon-primary, +.ui-button-icons-only .ui-button-icon-primary { + left: .5em; +} +.ui-button-text-icon-secondary .ui-button-icon-secondary, +.ui-button-text-icons .ui-button-icon-secondary, +.ui-button-icons-only .ui-button-icon-secondary { + right: .5em; +} + +/* button sets */ +.ui-buttonset { + margin-right: 7px; +} +.ui-buttonset .ui-button { + margin-left: 0; + margin-right: -.3em; +} + +/* workarounds */ +/* reset extra padding in Firefox, see h5bp.com/l */ +input.ui-button::-moz-focus-inner, +button.ui-button::-moz-focus-inner { + border: 0; + padding: 0; +} .ui-datepicker { width: 17em; padding: .2em .2em 0; @@ -251,6 +387,269 @@ border-right-width: 0; border-left-width: 1px; } +.ui-dialog { + overflow: hidden; + position: absolute; + top: 0; + left: 0; + padding: .2em; + outline: 0; +} +.ui-dialog .ui-dialog-titlebar { + padding: .4em 1em; + position: relative; +} +.ui-dialog .ui-dialog-title { + float: left; + margin: .1em 0; + white-space: nowrap; + width: 90%; + overflow: hidden; + text-overflow: ellipsis; +} +.ui-dialog .ui-dialog-titlebar-close { + position: absolute; + right: .3em; + top: 50%; + width: 20px; + margin: -10px 0 0 0; + padding: 1px; + height: 20px; +} +.ui-dialog .ui-dialog-content { + position: relative; + border: 0; + padding: .5em 1em; + background: none; + overflow: auto; +} +.ui-dialog .ui-dialog-buttonpane { + text-align: left; + border-width: 1px 0 0 0; + background-image: none; + margin-top: .5em; + padding: .3em 1em .5em .4em; +} +.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { + float: right; +} +.ui-dialog .ui-dialog-buttonpane button { + margin: .5em .4em .5em 0; + cursor: pointer; +} +.ui-dialog .ui-resizable-se { + width: 12px; + height: 12px; + right: -5px; + bottom: -5px; + background-position: 16px 16px; +} +.ui-draggable .ui-dialog-titlebar { + cursor: move; +} +.ui-draggable-handle { + -ms-touch-action: none; + touch-action: none; +} +.ui-menu { + list-style: none; + padding: 0; + margin: 0; + display: block; + outline: none; +} +.ui-menu .ui-menu { + position: absolute; +} +.ui-menu .ui-menu-item { + position: relative; + margin: 0; + padding: 3px 1em 3px .4em; + cursor: pointer; + min-height: 0; /* support: IE7 */ + /* support: IE10, see #8844 */ + list-style-image: url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"); +} +.ui-menu .ui-menu-divider { + margin: 5px 0; + height: 0; + font-size: 0; + line-height: 0; + border-width: 1px 0 0 0; +} +.ui-menu .ui-state-focus, +.ui-menu .ui-state-active { + margin: -1px; +} + +/* icon support */ +.ui-menu-icons { + position: relative; +} +.ui-menu-icons .ui-menu-item { + padding-left: 2em; +} + +/* left-aligned */ +.ui-menu .ui-icon { + position: absolute; + top: 0; + bottom: 0; + left: .2em; + margin: auto 0; +} + +/* right-aligned */ +.ui-menu .ui-menu-icon { + left: auto; + right: 0; +} +.ui-progressbar { + height: 2em; + text-align: left; + overflow: hidden; +} +.ui-progressbar .ui-progressbar-value { + margin: -1px; + height: 100%; +} +.ui-progressbar .ui-progressbar-overlay { + background: url("data:image/gif;base64,R0lGODlhKAAoAIABAAAAAP///yH/C05FVFNDQVBFMi4wAwEAAAAh+QQJAQABACwAAAAAKAAoAAACkYwNqXrdC52DS06a7MFZI+4FHBCKoDeWKXqymPqGqxvJrXZbMx7Ttc+w9XgU2FB3lOyQRWET2IFGiU9m1frDVpxZZc6bfHwv4c1YXP6k1Vdy292Fb6UkuvFtXpvWSzA+HycXJHUXiGYIiMg2R6W459gnWGfHNdjIqDWVqemH2ekpObkpOlppWUqZiqr6edqqWQAAIfkECQEAAQAsAAAAACgAKAAAApSMgZnGfaqcg1E2uuzDmmHUBR8Qil95hiPKqWn3aqtLsS18y7G1SzNeowWBENtQd+T1JktP05nzPTdJZlR6vUxNWWjV+vUWhWNkWFwxl9VpZRedYcflIOLafaa28XdsH/ynlcc1uPVDZxQIR0K25+cICCmoqCe5mGhZOfeYSUh5yJcJyrkZWWpaR8doJ2o4NYq62lAAACH5BAkBAAEALAAAAAAoACgAAAKVDI4Yy22ZnINRNqosw0Bv7i1gyHUkFj7oSaWlu3ovC8GxNso5fluz3qLVhBVeT/Lz7ZTHyxL5dDalQWPVOsQWtRnuwXaFTj9jVVh8pma9JjZ4zYSj5ZOyma7uuolffh+IR5aW97cHuBUXKGKXlKjn+DiHWMcYJah4N0lYCMlJOXipGRr5qdgoSTrqWSq6WFl2ypoaUAAAIfkECQEAAQAsAAAAACgAKAAAApaEb6HLgd/iO7FNWtcFWe+ufODGjRfoiJ2akShbueb0wtI50zm02pbvwfWEMWBQ1zKGlLIhskiEPm9R6vRXxV4ZzWT2yHOGpWMyorblKlNp8HmHEb/lCXjcW7bmtXP8Xt229OVWR1fod2eWqNfHuMjXCPkIGNileOiImVmCOEmoSfn3yXlJWmoHGhqp6ilYuWYpmTqKUgAAIfkECQEAAQAsAAAAACgAKAAAApiEH6kb58biQ3FNWtMFWW3eNVcojuFGfqnZqSebuS06w5V80/X02pKe8zFwP6EFWOT1lDFk8rGERh1TTNOocQ61Hm4Xm2VexUHpzjymViHrFbiELsefVrn6XKfnt2Q9G/+Xdie499XHd2g4h7ioOGhXGJboGAnXSBnoBwKYyfioubZJ2Hn0RuRZaflZOil56Zp6iioKSXpUAAAh+QQJAQABACwAAAAAKAAoAAACkoQRqRvnxuI7kU1a1UU5bd5tnSeOZXhmn5lWK3qNTWvRdQxP8qvaC+/yaYQzXO7BMvaUEmJRd3TsiMAgswmNYrSgZdYrTX6tSHGZO73ezuAw2uxuQ+BbeZfMxsexY35+/Qe4J1inV0g4x3WHuMhIl2jXOKT2Q+VU5fgoSUI52VfZyfkJGkha6jmY+aaYdirq+lQAACH5BAkBAAEALAAAAAAoACgAAAKWBIKpYe0L3YNKToqswUlvznigd4wiR4KhZrKt9Upqip61i9E3vMvxRdHlbEFiEXfk9YARYxOZZD6VQ2pUunBmtRXo1Lf8hMVVcNl8JafV38aM2/Fu5V16Bn63r6xt97j09+MXSFi4BniGFae3hzbH9+hYBzkpuUh5aZmHuanZOZgIuvbGiNeomCnaxxap2upaCZsq+1kAACH5BAkBAAEALAAAAAAoACgAAAKXjI8By5zf4kOxTVrXNVlv1X0d8IGZGKLnNpYtm8Lr9cqVeuOSvfOW79D9aDHizNhDJidFZhNydEahOaDH6nomtJjp1tutKoNWkvA6JqfRVLHU/QUfau9l2x7G54d1fl995xcIGAdXqMfBNadoYrhH+Mg2KBlpVpbluCiXmMnZ2Sh4GBqJ+ckIOqqJ6LmKSllZmsoq6wpQAAAh+QQJAQABACwAAAAAKAAoAAAClYx/oLvoxuJDkU1a1YUZbJ59nSd2ZXhWqbRa2/gF8Gu2DY3iqs7yrq+xBYEkYvFSM8aSSObE+ZgRl1BHFZNr7pRCavZ5BW2142hY3AN/zWtsmf12p9XxxFl2lpLn1rseztfXZjdIWIf2s5dItwjYKBgo9yg5pHgzJXTEeGlZuenpyPmpGQoKOWkYmSpaSnqKileI2FAAACH5BAkBAAEALAAAAAAoACgAAAKVjB+gu+jG4kORTVrVhRlsnn2dJ3ZleFaptFrb+CXmO9OozeL5VfP99HvAWhpiUdcwkpBH3825AwYdU8xTqlLGhtCosArKMpvfa1mMRae9VvWZfeB2XfPkeLmm18lUcBj+p5dnN8jXZ3YIGEhYuOUn45aoCDkp16hl5IjYJvjWKcnoGQpqyPlpOhr3aElaqrq56Bq7VAAAOw=="); + height: 100%; + filter: alpha(opacity=25); /* support: IE8 */ + opacity: 0.25; +} +.ui-progressbar-indeterminate .ui-progressbar-value { + background-image: none; +} +.ui-resizable { + position: relative; +} +.ui-resizable-handle { + position: absolute; + font-size: 0.1px; + display: block; + -ms-touch-action: none; + touch-action: none; +} +.ui-resizable-disabled .ui-resizable-handle, +.ui-resizable-autohide .ui-resizable-handle { + display: none; +} +.ui-resizable-n { + cursor: n-resize; + height: 7px; + width: 100%; + top: -5px; + left: 0; +} +.ui-resizable-s { + cursor: s-resize; + height: 7px; + width: 100%; + bottom: -5px; + left: 0; +} +.ui-resizable-e { + cursor: e-resize; + width: 7px; + right: -5px; + top: 0; + height: 100%; +} +.ui-resizable-w { + cursor: w-resize; + width: 7px; + left: -5px; + top: 0; + height: 100%; +} +.ui-resizable-se { + cursor: se-resize; + width: 12px; + height: 12px; + right: 1px; + bottom: 1px; +} +.ui-resizable-sw { + cursor: sw-resize; + width: 9px; + height: 9px; + left: -5px; + bottom: -5px; +} +.ui-resizable-nw { + cursor: nw-resize; + width: 9px; + height: 9px; + left: -5px; + top: -5px; +} +.ui-resizable-ne { + cursor: ne-resize; + width: 9px; + height: 9px; + right: -5px; + top: -5px; +} +.ui-selectable { + -ms-touch-action: none; + touch-action: none; +} +.ui-selectable-helper { + position: absolute; + z-index: 100; + border: 1px dotted black; +} +.ui-selectmenu-menu { + padding: 0; + margin: 0; + position: absolute; + top: 0; + left: 0; + display: none; +} +.ui-selectmenu-menu .ui-menu { + overflow: auto; + /* Support: IE7 */ + overflow-x: hidden; + padding-bottom: 1px; +} +.ui-selectmenu-menu .ui-menu .ui-selectmenu-optgroup { + font-size: 1em; + font-weight: bold; + line-height: 1.5; + padding: 2px 0.4em; + margin: 0.5em 0 0 0; + height: auto; + border: 0; +} +.ui-selectmenu-open { + display: block; +} +.ui-selectmenu-button { + display: inline-block; + overflow: hidden; + position: relative; + text-decoration: none; + cursor: pointer; +} +.ui-selectmenu-button span.ui-icon { + right: 0.5em; + left: auto; + margin-top: -8px; + position: absolute; + top: 50%; +} +.ui-selectmenu-button span.ui-selectmenu-text { + text-align: left; + padding: 0.4em 2.1em 0.4em 1em; + display: block; + line-height: 1.4; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} .ui-slider { position: relative; text-align: left; @@ -316,12 +715,123 @@ .ui-slider-vertical .ui-slider-range-max { top: 0; } +.ui-sortable-handle { + -ms-touch-action: none; + touch-action: none; +} +.ui-spinner { + position: relative; + display: inline-block; + overflow: hidden; + padding: 0; + vertical-align: middle; +} +.ui-spinner-input { + border: none; + background: none; + color: inherit; + padding: 0; + margin: .2em 0; + vertical-align: middle; + margin-left: .4em; + margin-right: 22px; +} +.ui-spinner-button { + width: 16px; + height: 50%; + font-size: .5em; + padding: 0; + margin: 0; + text-align: center; + position: absolute; + cursor: default; + display: block; + overflow: hidden; + right: 0; +} +/* more specificity required here to override default borders */ +.ui-spinner a.ui-spinner-button { + border-top: none; + border-bottom: none; + border-right: none; +} +/* vertically center icon */ +.ui-spinner .ui-icon { + position: absolute; + margin-top: -8px; + top: 50%; + left: 0; +} +.ui-spinner-up { + top: 0; +} +.ui-spinner-down { + bottom: 0; +} + +/* TR overrides */ +.ui-spinner .ui-icon-triangle-1-s { + /* need to fix icons sprite */ + background-position: -65px -16px; +} +.ui-tabs { + position: relative;/* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */ + padding: .2em; +} +.ui-tabs .ui-tabs-nav { + margin: 0; + padding: .2em .2em 0; +} +.ui-tabs .ui-tabs-nav li { + list-style: none; + float: left; + position: relative; + top: 0; + margin: 1px .2em 0 0; + border-bottom-width: 0; + padding: 0; + white-space: nowrap; +} +.ui-tabs .ui-tabs-nav .ui-tabs-anchor { + float: left; + padding: .5em 1em; + text-decoration: none; +} +.ui-tabs .ui-tabs-nav li.ui-tabs-active { + margin-bottom: -1px; + padding-bottom: 1px; +} +.ui-tabs .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor, +.ui-tabs .ui-tabs-nav li.ui-state-disabled .ui-tabs-anchor, +.ui-tabs .ui-tabs-nav li.ui-tabs-loading .ui-tabs-anchor { + cursor: text; +} +.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor { + cursor: pointer; +} +.ui-tabs .ui-tabs-panel { + display: block; + border-width: 0; + padding: 1em 1.4em; + background: none; +} +.ui-tooltip { + padding: 8px; + position: absolute; + z-index: 9999; + max-width: 300px; + -webkit-box-shadow: 0 0 5px #aaa; + box-shadow: 0 0 5px #aaa; +} +body .ui-tooltip { + border-width: 2px; +} /* Component containers ----------------------------------*/ .ui-widget { - font-family: Trebuchet MS,Tahoma,Verdana,Arial,sans-serif; - font-size: 1.1em; + font-family: Arial,Helvetica,sans-serif; + font-size: 1em; } .ui-widget .ui-widget { font-size: 1em; @@ -330,25 +840,25 @@ .ui-widget select, .ui-widget textarea, .ui-widget button { - font-family: Trebuchet MS,Tahoma,Verdana,Arial,sans-serif; + font-family: Arial,Helvetica,sans-serif; font-size: 1em; } .ui-widget-content { border: 1px solid #dddddd; - background: #eeeeee url("../images/jquery-ui/ui-bg_highlight-soft_100_eeeeee_1x100.png") 50% top repeat-x; + background: #ffffff; color: #333333; } .ui-widget-content a { color: #333333; } .ui-widget-header { - border: 1px solid #e78f08; - background: #f6a828 url("../images/jquery-ui/ui-bg_gloss-wave_35_f6a828_500x100.png") 50% 50% repeat-x; - color: #ffffff; + border: 1px solid #dddddd; + background: #e9e9e9; + color: #333333; font-weight: bold; } .ui-widget-header a { - color: #ffffff; + color: #333333; } /* Interaction states @@ -356,15 +866,15 @@ .ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { - border: 1px solid #cccccc; - background: #f6f6f6 url("../images/jquery-ui/ui-bg_glass_100_f6f6f6_1x400.png") 50% 50% repeat-x; - font-weight: bold; - color: #1c94c4; + border: 1px solid #c5c5c5; + background: #f6f6f6; + font-weight: normal; + color: #454545; } .ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { - color: #1c94c4; + color: #454545; text-decoration: none; } .ui-state-hover, @@ -373,10 +883,10 @@ .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { - border: 1px solid #fbcb09; - background: #fdf5ce url("../images/jquery-ui/ui-bg_glass_100_fdf5ce_1x400.png") 50% 50% repeat-x; - font-weight: bold; - color: #c77405; + border: 1px solid #cccccc; + background: #ededed; + font-weight: normal; + color: #2b2b2b; } .ui-state-hover a, .ui-state-hover a:hover, @@ -386,21 +896,21 @@ .ui-state-focus a:hover, .ui-state-focus a:link, .ui-state-focus a:visited { - color: #c77405; + color: #2b2b2b; text-decoration: none; } .ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { - border: 1px solid #fbd850; - background: #ffffff url("../images/jquery-ui/ui-bg_glass_65_ffffff_1x400.png") 50% 50% repeat-x; - font-weight: bold; - color: #eb8f00; + border: 1px solid #003eff; + background: #007fff; + font-weight: normal; + color: #ffffff; } .ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { - color: #eb8f00; + color: #ffffff; text-decoration: none; } @@ -409,31 +919,31 @@ .ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight { - border: 1px solid #fed22f; - background: #ffe45c url("../images/jquery-ui/ui-bg_highlight-soft_75_ffe45c_1x100.png") 50% top repeat-x; - color: #363636; + border: 1px solid #dad55e; + background: #fffa90; + color: #777620; } .ui-state-highlight a, .ui-widget-content .ui-state-highlight a, .ui-widget-header .ui-state-highlight a { - color: #363636; + color: #777620; } .ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error { - border: 1px solid #cd0a0a; - background: #b81900 url("../images/jquery-ui/ui-bg_diagonals-thick_18_b81900_40x40.png") 50% 50% repeat; - color: #ffffff; + border: 1px solid #f1a899; + background: #fddfdf; + color: #5f3f3f; } .ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a { - color: #ffffff; + color: #5f3f3f; } .ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text { - color: #ffffff; + color: #5f3f3f; } .ui-priority-primary, .ui-widget-content .ui-priority-primary, @@ -468,27 +978,27 @@ } .ui-icon, .ui-widget-content .ui-icon { - background-image: url("../images/jquery-ui/ui-icons_222222_256x240.png"); + background-image: url("images/ui-icons_444444_256x240.png"); } .ui-widget-header .ui-icon { - background-image: url("../images/jquery-ui/ui-icons_ffffff_256x240.png"); + background-image: url("images/ui-icons_444444_256x240.png"); } .ui-state-default .ui-icon { - background-image: url("../images/jquery-ui/ui-icons_ef8c08_256x240.png"); + background-image: url("images/ui-icons_777777_256x240.png"); } .ui-state-hover .ui-icon, .ui-state-focus .ui-icon { - background-image: url("../images/jquery-ui/ui-icons_ef8c08_256x240.png"); + background-image: url("images/ui-icons_555555_256x240.png"); } .ui-state-active .ui-icon { - background-image: url("../images/jquery-ui/ui-icons_ef8c08_256x240.png"); + background-image: url("images/ui-icons_ffffff_256x240.png"); } .ui-state-highlight .ui-icon { - background-image: url("../images/jquery-ui/ui-icons_228ef1_256x240.png"); + background-image: url("images/ui-icons_777620_256x240.png"); } .ui-state-error .ui-icon, .ui-state-error-text .ui-icon { - background-image: url("../images/jquery-ui/ui-icons_ffd27a_256x240.png"); + background-image: url("images/ui-icons_cc0000_256x240.png"); } /* positioning */ @@ -678,38 +1188,38 @@ .ui-corner-top, .ui-corner-left, .ui-corner-tl { - border-top-left-radius: 4px; + border-top-left-radius: 3px; } .ui-corner-all, .ui-corner-top, .ui-corner-right, .ui-corner-tr { - border-top-right-radius: 4px; + border-top-right-radius: 3px; } .ui-corner-all, .ui-corner-bottom, .ui-corner-left, .ui-corner-bl { - border-bottom-left-radius: 4px; + border-bottom-left-radius: 3px; } .ui-corner-all, .ui-corner-bottom, .ui-corner-right, .ui-corner-br { - border-bottom-right-radius: 4px; + border-bottom-right-radius: 3px; } /* Overlays */ .ui-widget-overlay { - background: #666666 url("../images/jquery-ui/ui-bg_diagonals-thick_20_666666_40x40.png") 50% 50% repeat; - opacity: .5; - filter: Alpha(Opacity=50); /* support: IE8 */ + background: #aaaaaa; + opacity: .3; + filter: Alpha(Opacity=30); /* support: IE8 */ } .ui-widget-shadow { - margin: -5px 0 0 -5px; + margin: 0px 0 0 0px; padding: 5px; - background: #000000 url("../images/jquery-ui/ui-bg_flat_10_000000_40x100.png") 50% 50% repeat-x; - opacity: .2; - filter: Alpha(Opacity=20); /* support: IE8 */ - border-radius: 5px; + background: #666666; + opacity: .3; + filter: Alpha(Opacity=30); /* support: IE8 */ + border-radius: 8px; } diff --git a/dist/opensourcepos.js b/dist/opensourcepos.js index c3428c988..c534aa005 100644 --- a/dist/opensourcepos.js +++ b/dist/opensourcepos.js @@ -1,23672 +1,50912 @@ -/*! - * jQuery JavaScript Library v1.8.3 - * http://jquery.com/ - * - * Includes Sizzle.js - * http://sizzlejs.com/ - * - * Copyright 2012 jQuery Foundation and other contributors - * Released under the MIT license - * http://jquery.org/license - * - * Date: Tue Nov 13 2012 08:20:33 GMT-0500 (Eastern Standard Time) - */ -(function( window, undefined ) { -var - // A central reference to the root jQuery(document) - rootjQuery, - - // The deferred used on DOM ready - readyList, - - // Use the correct document accordingly with window argument (sandbox) - document = window.document, - location = window.location, - navigator = window.navigator, - - // Map over jQuery in case of overwrite - _jQuery = window.jQuery, - - // Map over the $ in case of overwrite - _$ = window.$, - - // Save a reference to some core methods - core_push = Array.prototype.push, - core_slice = Array.prototype.slice, - core_indexOf = Array.prototype.indexOf, - core_toString = Object.prototype.toString, - core_hasOwn = Object.prototype.hasOwnProperty, - core_trim = String.prototype.trim, - - // Define a local copy of jQuery - jQuery = function( selector, context ) { - // The jQuery object is actually just the init constructor 'enhanced' - return new jQuery.fn.init( selector, context, rootjQuery ); - }, - - // Used for matching numbers - core_pnum = /[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source, - - // Used for detecting and trimming whitespace - core_rnotwhite = /\S/, - core_rspace = /\s+/, - - // Make sure we trim BOM and NBSP (here's looking at you, Safari 5.0 and IE) - rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, - - // A simple way to check for HTML strings - // Prioritize #id over to avoid XSS via location.hash (#9521) - rquickExpr = /^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/, - - // Match a standalone tag - rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>|)$/, - - // JSON RegExp - rvalidchars = /^[\],:{}\s]*$/, - rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g, - rvalidescape = /\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g, - rvalidtokens = /"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g, - - // Matches dashed string for camelizing - rmsPrefix = /^-ms-/, - rdashAlpha = /-([\da-z])/gi, - - // Used by jQuery.camelCase as callback to replace() - fcamelCase = function( all, letter ) { - return ( letter + "" ).toUpperCase(); - }, - - // The ready event handler and self cleanup method - DOMContentLoaded = function() { - if ( document.addEventListener ) { - document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false ); - jQuery.ready(); - } else if ( document.readyState === "complete" ) { - // we're here because readyState === "complete" in oldIE - // which is good enough for us to call the dom ready! - document.detachEvent( "onreadystatechange", DOMContentLoaded ); - jQuery.ready(); - } - }, - - // [[Class]] -> type pairs - class2type = {}; - -jQuery.fn = jQuery.prototype = { - constructor: jQuery, - init: function( selector, context, rootjQuery ) { - var match, elem, ret, doc; - - // Handle $(""), $(null), $(undefined), $(false) - if ( !selector ) { - return this; - } - - // Handle $(DOMElement) - if ( selector.nodeType ) { - this.context = this[0] = selector; - this.length = 1; - return this; - } - - // Handle HTML strings - if ( typeof selector === "string" ) { - if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) { - // Assume that strings that start and end with <> are HTML and skip the regex check - match = [ null, selector, null ]; - - } else { - match = rquickExpr.exec( selector ); - } - - // Match html or make sure no context is specified for #id - if ( match && (match[1] || !context) ) { - - // HANDLE: $(html) -> $(array) - if ( match[1] ) { - context = context instanceof jQuery ? context[0] : context; - doc = ( context && context.nodeType ? context.ownerDocument || context : document ); - - // scripts is true for back-compat - selector = jQuery.parseHTML( match[1], doc, true ); - if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) { - this.attr.call( selector, context, true ); - } - - return jQuery.merge( this, selector ); - - // HANDLE: $(#id) - } else { - elem = document.getElementById( match[2] ); - - // Check parentNode to catch when Blackberry 4.6 returns - // nodes that are no longer in the document #6963 - if ( elem && elem.parentNode ) { - // Handle the case where IE and Opera return items - // by name instead of ID - if ( elem.id !== match[2] ) { - return rootjQuery.find( selector ); - } - - // Otherwise, we inject the element directly into the jQuery object - this.length = 1; - this[0] = elem; - } - - this.context = document; - this.selector = selector; - return this; - } - - // HANDLE: $(expr, $(...)) - } else if ( !context || context.jquery ) { - return ( context || rootjQuery ).find( selector ); - - // HANDLE: $(expr, context) - // (which is just equivalent to: $(context).find(expr) - } else { - return this.constructor( context ).find( selector ); - } - - // HANDLE: $(function) - // Shortcut for document ready - } else if ( jQuery.isFunction( selector ) ) { - return rootjQuery.ready( selector ); - } - - if ( selector.selector !== undefined ) { - this.selector = selector.selector; - this.context = selector.context; - } - - return jQuery.makeArray( selector, this ); - }, - - // Start with an empty selector - selector: "", - - // The current version of jQuery being used - jquery: "1.8.3", - - // The default length of a jQuery object is 0 - length: 0, - - // The number of elements contained in the matched element set - size: function() { - return this.length; - }, - - toArray: function() { - return core_slice.call( this ); - }, - - // Get the Nth element in the matched element set OR - // Get the whole matched element set as a clean array - get: function( num ) { - return num == null ? - - // Return a 'clean' array - this.toArray() : - - // Return just the object - ( num < 0 ? this[ this.length + num ] : this[ num ] ); - }, - - // Take an array of elements and push it onto the stack - // (returning the new matched element set) - pushStack: function( elems, name, selector ) { - - // Build a new jQuery matched element set - var ret = jQuery.merge( this.constructor(), elems ); - - // Add the old object onto the stack (as a reference) - ret.prevObject = this; - - ret.context = this.context; - - if ( name === "find" ) { - ret.selector = this.selector + ( this.selector ? " " : "" ) + selector; - } else if ( name ) { - ret.selector = this.selector + "." + name + "(" + selector + ")"; - } - - // Return the newly-formed element set - return ret; - }, - - // Execute a callback for every element in the matched set. - // (You can seed the arguments with an array of args, but this is - // only used internally.) - each: function( callback, args ) { - return jQuery.each( this, callback, args ); - }, - - ready: function( fn ) { - // Add the callback - jQuery.ready.promise().done( fn ); - - return this; - }, - - eq: function( i ) { - i = +i; - return i === -1 ? - this.slice( i ) : - this.slice( i, i + 1 ); - }, - - first: function() { - return this.eq( 0 ); - }, - - last: function() { - return this.eq( -1 ); - }, - - slice: function() { - return this.pushStack( core_slice.apply( this, arguments ), - "slice", core_slice.call(arguments).join(",") ); - }, - - map: function( callback ) { - return this.pushStack( jQuery.map(this, function( elem, i ) { - return callback.call( elem, i, elem ); - })); - }, - - end: function() { - return this.prevObject || this.constructor(null); - }, - - // For internal use only. - // Behaves like an Array's method, not like a jQuery method. - push: core_push, - sort: [].sort, - splice: [].splice -}; - -// Give the init function the jQuery prototype for later instantiation -jQuery.fn.init.prototype = jQuery.fn; - -jQuery.extend = jQuery.fn.extend = function() { - var options, name, src, copy, copyIsArray, clone, - target = arguments[0] || {}, - i = 1, - length = arguments.length, - deep = false; - - // Handle a deep copy situation - if ( typeof target === "boolean" ) { - deep = target; - target = arguments[1] || {}; - // skip the boolean and the target - i = 2; - } - - // Handle case when target is a string or something (possible in deep copy) - if ( typeof target !== "object" && !jQuery.isFunction(target) ) { - target = {}; - } - - // extend jQuery itself if only one argument is passed - if ( length === i ) { - target = this; - --i; - } - - for ( ; i < length; i++ ) { - // Only deal with non-null/undefined values - if ( (options = arguments[ i ]) != null ) { - // Extend the base object - for ( name in options ) { - src = target[ name ]; - copy = options[ name ]; - - // Prevent never-ending loop - if ( target === copy ) { - continue; - } - - // Recurse if we're merging plain objects or arrays - if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) { - if ( copyIsArray ) { - copyIsArray = false; - clone = src && jQuery.isArray(src) ? src : []; - - } else { - clone = src && jQuery.isPlainObject(src) ? src : {}; - } - - // Never move original objects, clone them - target[ name ] = jQuery.extend( deep, clone, copy ); - - // Don't bring in undefined values - } else if ( copy !== undefined ) { - target[ name ] = copy; - } - } - } - } - - // Return the modified object - return target; -}; - -jQuery.extend({ - noConflict: function( deep ) { - if ( window.$ === jQuery ) { - window.$ = _$; - } - - if ( deep && window.jQuery === jQuery ) { - window.jQuery = _jQuery; - } - - return jQuery; - }, - - // Is the DOM ready to be used? Set to true once it occurs. - isReady: false, - - // A counter to track how many items to wait for before - // the ready event fires. See #6781 - readyWait: 1, - - // Hold (or release) the ready event - holdReady: function( hold ) { - if ( hold ) { - jQuery.readyWait++; - } else { - jQuery.ready( true ); - } - }, - - // Handle when the DOM is ready - ready: function( wait ) { - - // Abort if there are pending holds or we're already ready - if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) { - return; - } - - // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). - if ( !document.body ) { - return setTimeout( jQuery.ready, 1 ); - } - - // Remember that the DOM is ready - jQuery.isReady = true; - - // If a normal DOM Ready event fired, decrement, and wait if need be - if ( wait !== true && --jQuery.readyWait > 0 ) { - return; - } - - // If there are functions bound, to execute - readyList.resolveWith( document, [ jQuery ] ); - - // Trigger any bound ready events - if ( jQuery.fn.trigger ) { - jQuery( document ).trigger("ready").off("ready"); - } - }, - - // See test/unit/core.js for details concerning isFunction. - // Since version 1.3, DOM methods and functions like alert - // aren't supported. They return false on IE (#2968). - isFunction: function( obj ) { - return jQuery.type(obj) === "function"; - }, - - isArray: Array.isArray || function( obj ) { - return jQuery.type(obj) === "array"; - }, - - isWindow: function( obj ) { - return obj != null && obj == obj.window; - }, - - isNumeric: function( obj ) { - return !isNaN( parseFloat(obj) ) && isFinite( obj ); - }, - - type: function( obj ) { - return obj == null ? - String( obj ) : - class2type[ core_toString.call(obj) ] || "object"; - }, - - isPlainObject: function( obj ) { - // Must be an Object. - // Because of IE, we also have to check the presence of the constructor property. - // Make sure that DOM nodes and window objects don't pass through, as well - if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) { - return false; - } - - try { - // Not own constructor property must be Object - if ( obj.constructor && - !core_hasOwn.call(obj, "constructor") && - !core_hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) { - return false; - } - } catch ( e ) { - // IE8,9 Will throw exceptions on certain host objects #9897 - return false; - } - - // Own properties are enumerated firstly, so to speed up, - // if last one is own, then all properties are own. - - var key; - for ( key in obj ) {} - - return key === undefined || core_hasOwn.call( obj, key ); - }, - - isEmptyObject: function( obj ) { - var name; - for ( name in obj ) { - return false; - } - return true; - }, - - error: function( msg ) { - throw new Error( msg ); - }, - - // data: string of html - // context (optional): If specified, the fragment will be created in this context, defaults to document - // scripts (optional): If true, will include scripts passed in the html string - parseHTML: function( data, context, scripts ) { - var parsed; - if ( !data || typeof data !== "string" ) { - return null; - } - if ( typeof context === "boolean" ) { - scripts = context; - context = 0; - } - context = context || document; - - // Single tag - if ( (parsed = rsingleTag.exec( data )) ) { - return [ context.createElement( parsed[1] ) ]; - } - - parsed = jQuery.buildFragment( [ data ], context, scripts ? null : [] ); - return jQuery.merge( [], - (parsed.cacheable ? jQuery.clone( parsed.fragment ) : parsed.fragment).childNodes ); - }, - - parseJSON: function( data ) { - if ( !data || typeof data !== "string") { - return null; - } - - // Make sure leading/trailing whitespace is removed (IE can't handle it) - data = jQuery.trim( data ); - - // Attempt to parse using the native JSON parser first - if ( window.JSON && window.JSON.parse ) { - return window.JSON.parse( data ); - } - - // Make sure the incoming data is actual JSON - // Logic borrowed from http://json.org/json2.js - if ( rvalidchars.test( data.replace( rvalidescape, "@" ) - .replace( rvalidtokens, "]" ) - .replace( rvalidbraces, "")) ) { - - return ( new Function( "return " + data ) )(); - - } - jQuery.error( "Invalid JSON: " + data ); - }, - - // Cross-browser xml parsing - parseXML: function( data ) { - var xml, tmp; - if ( !data || typeof data !== "string" ) { - return null; - } - try { - if ( window.DOMParser ) { // Standard - tmp = new DOMParser(); - xml = tmp.parseFromString( data , "text/xml" ); - } else { // IE - xml = new ActiveXObject( "Microsoft.XMLDOM" ); - xml.async = "false"; - xml.loadXML( data ); - } - } catch( e ) { - xml = undefined; - } - if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) { - jQuery.error( "Invalid XML: " + data ); - } - return xml; - }, - - noop: function() {}, - - // Evaluates a script in a global context - // Workarounds based on findings by Jim Driscoll - // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context - globalEval: function( data ) { - if ( data && core_rnotwhite.test( data ) ) { - // We use execScript on Internet Explorer - // We use an anonymous function so that context is window - // rather than jQuery in Firefox - ( window.execScript || function( data ) { - window[ "eval" ].call( window, data ); - } )( data ); - } - }, - - // Convert dashed to camelCase; used by the css and data modules - // Microsoft forgot to hump their vendor prefix (#9572) - camelCase: function( string ) { - return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); - }, - - nodeName: function( elem, name ) { - return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); - }, - - // args is for internal usage only - each: function( obj, callback, args ) { - var name, - i = 0, - length = obj.length, - isObj = length === undefined || jQuery.isFunction( obj ); - - if ( args ) { - if ( isObj ) { - for ( name in obj ) { - if ( callback.apply( obj[ name ], args ) === false ) { - break; - } - } - } else { - for ( ; i < length; ) { - if ( callback.apply( obj[ i++ ], args ) === false ) { - break; - } - } - } - - // A special, fast, case for the most common use of each - } else { - if ( isObj ) { - for ( name in obj ) { - if ( callback.call( obj[ name ], name, obj[ name ] ) === false ) { - break; - } - } - } else { - for ( ; i < length; ) { - if ( callback.call( obj[ i ], i, obj[ i++ ] ) === false ) { - break; - } - } - } - } - - return obj; - }, - - // Use native String.trim function wherever possible - trim: core_trim && !core_trim.call("\uFEFF\xA0") ? - function( text ) { - return text == null ? - "" : - core_trim.call( text ); - } : - - // Otherwise use our own trimming functionality - function( text ) { - return text == null ? - "" : - ( text + "" ).replace( rtrim, "" ); - }, - - // results is for internal usage only - makeArray: function( arr, results ) { - var type, - ret = results || []; - - if ( arr != null ) { - // The window, strings (and functions) also have 'length' - // Tweaked logic slightly to handle Blackberry 4.7 RegExp issues #6930 - type = jQuery.type( arr ); - - if ( arr.length == null || type === "string" || type === "function" || type === "regexp" || jQuery.isWindow( arr ) ) { - core_push.call( ret, arr ); - } else { - jQuery.merge( ret, arr ); - } - } - - return ret; - }, - - inArray: function( elem, arr, i ) { - var len; - - if ( arr ) { - if ( core_indexOf ) { - return core_indexOf.call( arr, elem, i ); - } - - len = arr.length; - i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0; - - for ( ; i < len; i++ ) { - // Skip accessing in sparse arrays - if ( i in arr && arr[ i ] === elem ) { - return i; - } - } - } - - return -1; - }, - - merge: function( first, second ) { - var l = second.length, - i = first.length, - j = 0; - - if ( typeof l === "number" ) { - for ( ; j < l; j++ ) { - first[ i++ ] = second[ j ]; - } - - } else { - while ( second[j] !== undefined ) { - first[ i++ ] = second[ j++ ]; - } - } - - first.length = i; - - return first; - }, - - grep: function( elems, callback, inv ) { - var retVal, - ret = [], - i = 0, - length = elems.length; - inv = !!inv; - - // Go through the array, only saving the items - // that pass the validator function - for ( ; i < length; i++ ) { - retVal = !!callback( elems[ i ], i ); - if ( inv !== retVal ) { - ret.push( elems[ i ] ); - } - } - - return ret; - }, - - // arg is for internal usage only - map: function( elems, callback, arg ) { - var value, key, - ret = [], - i = 0, - length = elems.length, - // jquery objects are treated as arrays - isArray = elems instanceof jQuery || length !== undefined && typeof length === "number" && ( ( length > 0 && elems[ 0 ] && elems[ length -1 ] ) || length === 0 || jQuery.isArray( elems ) ) ; - - // Go through the array, translating each of the items to their - if ( isArray ) { - for ( ; i < length; i++ ) { - value = callback( elems[ i ], i, arg ); - - if ( value != null ) { - ret[ ret.length ] = value; - } - } - - // Go through every key on the object, - } else { - for ( key in elems ) { - value = callback( elems[ key ], key, arg ); - - if ( value != null ) { - ret[ ret.length ] = value; - } - } - } - - // Flatten any nested arrays - return ret.concat.apply( [], ret ); - }, - - // A global GUID counter for objects - guid: 1, - - // Bind a function to a context, optionally partially applying any - // arguments. - proxy: function( fn, context ) { - var tmp, args, proxy; - - if ( typeof context === "string" ) { - tmp = fn[ context ]; - context = fn; - fn = tmp; - } - - // Quick check to determine if target is callable, in the spec - // this throws a TypeError, but we will just return undefined. - if ( !jQuery.isFunction( fn ) ) { - return undefined; - } - - // Simulated bind - args = core_slice.call( arguments, 2 ); - proxy = function() { - return fn.apply( context, args.concat( core_slice.call( arguments ) ) ); - }; - - // Set the guid of unique handler to the same of original handler, so it can be removed - proxy.guid = fn.guid = fn.guid || jQuery.guid++; - - return proxy; - }, - - // Multifunctional method to get and set values of a collection - // The value/s can optionally be executed if it's a function - access: function( elems, fn, key, value, chainable, emptyGet, pass ) { - var exec, - bulk = key == null, - i = 0, - length = elems.length; - - // Sets many values - if ( key && typeof key === "object" ) { - for ( i in key ) { - jQuery.access( elems, fn, i, key[i], 1, emptyGet, value ); - } - chainable = 1; - - // Sets one value - } else if ( value !== undefined ) { - // Optionally, function values get executed if exec is true - exec = pass === undefined && jQuery.isFunction( value ); - - if ( bulk ) { - // Bulk operations only iterate when executing function values - if ( exec ) { - exec = fn; - fn = function( elem, key, value ) { - return exec.call( jQuery( elem ), value ); - }; - - // Otherwise they run against the entire set - } else { - fn.call( elems, value ); - fn = null; - } - } - - if ( fn ) { - for (; i < length; i++ ) { - fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass ); - } - } - - chainable = 1; - } - - return chainable ? - elems : - - // Gets - bulk ? - fn.call( elems ) : - length ? fn( elems[0], key ) : emptyGet; - }, - - now: function() { - return ( new Date() ).getTime(); - } -}); - -jQuery.ready.promise = function( obj ) { - if ( !readyList ) { - - readyList = jQuery.Deferred(); - - // Catch cases where $(document).ready() is called after the browser event has already occurred. - // we once tried to use readyState "interactive" here, but it caused issues like the one - // discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15 - if ( document.readyState === "complete" ) { - // Handle it asynchronously to allow scripts the opportunity to delay ready - setTimeout( jQuery.ready, 1 ); - - // Standards-based browsers support DOMContentLoaded - } else if ( document.addEventListener ) { - // Use the handy event callback - document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false ); - - // A fallback to window.onload, that will always work - window.addEventListener( "load", jQuery.ready, false ); - - // If IE event model is used - } else { - // Ensure firing before onload, maybe late but safe also for iframes - document.attachEvent( "onreadystatechange", DOMContentLoaded ); - - // A fallback to window.onload, that will always work - window.attachEvent( "onload", jQuery.ready ); - - // If IE and not a frame - // continually check to see if the document is ready - var top = false; - - try { - top = window.frameElement == null && document.documentElement; - } catch(e) {} - - if ( top && top.doScroll ) { - (function doScrollCheck() { - if ( !jQuery.isReady ) { - - try { - // Use the trick by Diego Perini - // http://javascript.nwbox.com/IEContentLoaded/ - top.doScroll("left"); - } catch(e) { - return setTimeout( doScrollCheck, 50 ); - } - - // and execute any waiting functions - jQuery.ready(); - } - })(); - } - } - } - return readyList.promise( obj ); -}; - -// Populate the class2type map -jQuery.each("Boolean Number String Function Array Date RegExp Object".split(" "), function(i, name) { - class2type[ "[object " + name + "]" ] = name.toLowerCase(); -}); - -// All jQuery objects should point back to these -rootjQuery = jQuery(document); -// String to Object options format cache -var optionsCache = {}; - -// Convert String-formatted options into Object-formatted ones and store in cache -function createOptions( options ) { - var object = optionsCache[ options ] = {}; - jQuery.each( options.split( core_rspace ), function( _, flag ) { - object[ flag ] = true; - }); - return object; -} - -/* - * Create a callback list using the following parameters: - * - * options: an optional list of space-separated options that will change how - * the callback list behaves or a more traditional option object - * - * By default a callback list will act like an event callback list and can be - * "fired" multiple times. - * - * Possible options: - * - * once: will ensure the callback list can only be fired once (like a Deferred) - * - * memory: will keep track of previous values and will call any callback added - * after the list has been fired right away with the latest "memorized" - * values (like a Deferred) - * - * unique: will ensure a callback can only be added once (no duplicate in the list) - * - * stopOnFalse: interrupt callings when a callback returns false - * - */ -jQuery.Callbacks = function( options ) { - - // Convert options from String-formatted to Object-formatted if needed - // (we check in cache first) - options = typeof options === "string" ? - ( optionsCache[ options ] || createOptions( options ) ) : - jQuery.extend( {}, options ); - - var // Last fire value (for non-forgettable lists) - memory, - // Flag to know if list was already fired - fired, - // Flag to know if list is currently firing - firing, - // First callback to fire (used internally by add and fireWith) - firingStart, - // End of the loop when firing - firingLength, - // Index of currently firing callback (modified by remove if needed) - firingIndex, - // Actual callback list - list = [], - // Stack of fire calls for repeatable lists - stack = !options.once && [], - // Fire callbacks - fire = function( data ) { - memory = options.memory && data; - fired = true; - firingIndex = firingStart || 0; - firingStart = 0; - firingLength = list.length; - firing = true; - for ( ; list && firingIndex < firingLength; firingIndex++ ) { - if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) { - memory = false; // To prevent further calls using add - break; - } - } - firing = false; - if ( list ) { - if ( stack ) { - if ( stack.length ) { - fire( stack.shift() ); - } - } else if ( memory ) { - list = []; - } else { - self.disable(); - } - } - }, - // Actual Callbacks object - self = { - // Add a callback or a collection of callbacks to the list - add: function() { - if ( list ) { - // First, we save the current length - var start = list.length; - (function add( args ) { - jQuery.each( args, function( _, arg ) { - var type = jQuery.type( arg ); - if ( type === "function" ) { - if ( !options.unique || !self.has( arg ) ) { - list.push( arg ); - } - } else if ( arg && arg.length && type !== "string" ) { - // Inspect recursively - add( arg ); - } - }); - })( arguments ); - // Do we need to add the callbacks to the - // current firing batch? - if ( firing ) { - firingLength = list.length; - // With memory, if we're not firing then - // we should call right away - } else if ( memory ) { - firingStart = start; - fire( memory ); - } - } - return this; - }, - // Remove a callback from the list - remove: function() { - if ( list ) { - jQuery.each( arguments, function( _, arg ) { - var index; - while( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) { - list.splice( index, 1 ); - // Handle firing indexes - if ( firing ) { - if ( index <= firingLength ) { - firingLength--; - } - if ( index <= firingIndex ) { - firingIndex--; - } - } - } - }); - } - return this; - }, - // Control if a given callback is in the list - has: function( fn ) { - return jQuery.inArray( fn, list ) > -1; - }, - // Remove all callbacks from the list - empty: function() { - list = []; - return this; - }, - // Have the list do nothing anymore - disable: function() { - list = stack = memory = undefined; - return this; - }, - // Is it disabled? - disabled: function() { - return !list; - }, - // Lock the list in its current state - lock: function() { - stack = undefined; - if ( !memory ) { - self.disable(); - } - return this; - }, - // Is it locked? - locked: function() { - return !stack; - }, - // Call all callbacks with the given context and arguments - fireWith: function( context, args ) { - args = args || []; - args = [ context, args.slice ? args.slice() : args ]; - if ( list && ( !fired || stack ) ) { - if ( firing ) { - stack.push( args ); - } else { - fire( args ); - } - } - return this; - }, - // Call all the callbacks with the given arguments - fire: function() { - self.fireWith( this, arguments ); - return this; - }, - // To know if the callbacks have already been called at least once - fired: function() { - return !!fired; - } - }; - - return self; -}; -jQuery.extend({ - - Deferred: function( func ) { - var tuples = [ - // action, add listener, listener list, final state - [ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ], - [ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ], - [ "notify", "progress", jQuery.Callbacks("memory") ] - ], - state = "pending", - promise = { - state: function() { - return state; - }, - always: function() { - deferred.done( arguments ).fail( arguments ); - return this; - }, - then: function( /* fnDone, fnFail, fnProgress */ ) { - var fns = arguments; - return jQuery.Deferred(function( newDefer ) { - jQuery.each( tuples, function( i, tuple ) { - var action = tuple[ 0 ], - fn = fns[ i ]; - // deferred[ done | fail | progress ] for forwarding actions to newDefer - deferred[ tuple[1] ]( jQuery.isFunction( fn ) ? - function() { - var returned = fn.apply( this, arguments ); - if ( returned && jQuery.isFunction( returned.promise ) ) { - returned.promise() - .done( newDefer.resolve ) - .fail( newDefer.reject ) - .progress( newDefer.notify ); - } else { - newDefer[ action + "With" ]( this === deferred ? newDefer : this, [ returned ] ); - } - } : - newDefer[ action ] - ); - }); - fns = null; - }).promise(); - }, - // Get a promise for this deferred - // If obj is provided, the promise aspect is added to the object - promise: function( obj ) { - return obj != null ? jQuery.extend( obj, promise ) : promise; - } - }, - deferred = {}; - - // Keep pipe for back-compat - promise.pipe = promise.then; - - // Add list-specific methods - jQuery.each( tuples, function( i, tuple ) { - var list = tuple[ 2 ], - stateString = tuple[ 3 ]; - - // promise[ done | fail | progress ] = list.add - promise[ tuple[1] ] = list.add; - - // Handle state - if ( stateString ) { - list.add(function() { - // state = [ resolved | rejected ] - state = stateString; - - // [ reject_list | resolve_list ].disable; progress_list.lock - }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock ); - } - - // deferred[ resolve | reject | notify ] = list.fire - deferred[ tuple[0] ] = list.fire; - deferred[ tuple[0] + "With" ] = list.fireWith; - }); - - // Make the deferred a promise - promise.promise( deferred ); - - // Call given func if any - if ( func ) { - func.call( deferred, deferred ); - } - - // All done! - return deferred; - }, - - // Deferred helper - when: function( subordinate /* , ..., subordinateN */ ) { - var i = 0, - resolveValues = core_slice.call( arguments ), - length = resolveValues.length, - - // the count of uncompleted subordinates - remaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0, - - // the master Deferred. If resolveValues consist of only a single Deferred, just use that. - deferred = remaining === 1 ? subordinate : jQuery.Deferred(), - - // Update function for both resolve and progress values - updateFunc = function( i, contexts, values ) { - return function( value ) { - contexts[ i ] = this; - values[ i ] = arguments.length > 1 ? core_slice.call( arguments ) : value; - if( values === progressValues ) { - deferred.notifyWith( contexts, values ); - } else if ( !( --remaining ) ) { - deferred.resolveWith( contexts, values ); - } - }; - }, - - progressValues, progressContexts, resolveContexts; - - // add listeners to Deferred subordinates; treat others as resolved - if ( length > 1 ) { - progressValues = new Array( length ); - progressContexts = new Array( length ); - resolveContexts = new Array( length ); - for ( ; i < length; i++ ) { - if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) { - resolveValues[ i ].promise() - .done( updateFunc( i, resolveContexts, resolveValues ) ) - .fail( deferred.reject ) - .progress( updateFunc( i, progressContexts, progressValues ) ); - } else { - --remaining; - } - } - } - - // if we're not waiting on anything, resolve the master - if ( !remaining ) { - deferred.resolveWith( resolveContexts, resolveValues ); - } - - return deferred.promise(); - } -}); -jQuery.support = (function() { - - var support, - all, - a, - select, - opt, - input, - fragment, - eventName, - i, - isSupported, - clickFn, - div = document.createElement("div"); - - // Setup - div.setAttribute( "className", "t" ); - div.innerHTML = "
                          a"; - - // Support tests won't run in some limited or non-browser environments - all = div.getElementsByTagName("*"); - a = div.getElementsByTagName("a")[ 0 ]; - if ( !all || !a || !all.length ) { - return {}; - } - - // First batch of tests - select = document.createElement("select"); - opt = select.appendChild( document.createElement("option") ); - input = div.getElementsByTagName("input")[ 0 ]; - - a.style.cssText = "top:1px;float:left;opacity:.5"; - support = { - // IE strips leading whitespace when .innerHTML is used - leadingWhitespace: ( div.firstChild.nodeType === 3 ), - - // Make sure that tbody elements aren't automatically inserted - // IE will insert them into empty tables - tbody: !div.getElementsByTagName("tbody").length, - - // Make sure that link elements get serialized correctly by innerHTML - // This requires a wrapper element in IE - htmlSerialize: !!div.getElementsByTagName("link").length, - - // Get the style information from getAttribute - // (IE uses .cssText instead) - style: /top/.test( a.getAttribute("style") ), - - // Make sure that URLs aren't manipulated - // (IE normalizes it by default) - hrefNormalized: ( a.getAttribute("href") === "/a" ), - - // Make sure that element opacity exists - // (IE uses filter instead) - // Use a regex to work around a WebKit issue. See #5145 - opacity: /^0.5/.test( a.style.opacity ), - - // Verify style float existence - // (IE uses styleFloat instead of cssFloat) - cssFloat: !!a.style.cssFloat, - - // Make sure that if no value is specified for a checkbox - // that it defaults to "on". - // (WebKit defaults to "" instead) - checkOn: ( input.value === "on" ), - - // Make sure that a selected-by-default option has a working selected property. - // (WebKit defaults to false instead of true, IE too, if it's in an optgroup) - optSelected: opt.selected, - - // Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7) - getSetAttribute: div.className !== "t", - - // Tests for enctype support on a form (#6743) - enctype: !!document.createElement("form").enctype, - - // Makes sure cloning an html5 element does not cause problems - // Where outerHTML is undefined, this still works - html5Clone: document.createElement("nav").cloneNode( true ).outerHTML !== "<:nav>", - - // jQuery.support.boxModel DEPRECATED in 1.8 since we don't support Quirks Mode - boxModel: ( document.compatMode === "CSS1Compat" ), - - // Will be defined later - submitBubbles: true, - changeBubbles: true, - focusinBubbles: false, - deleteExpando: true, - noCloneEvent: true, - inlineBlockNeedsLayout: false, - shrinkWrapBlocks: false, - reliableMarginRight: true, - boxSizingReliable: true, - pixelPosition: false - }; - - // Make sure checked status is properly cloned - input.checked = true; - support.noCloneChecked = input.cloneNode( true ).checked; - - // Make sure that the options inside disabled selects aren't marked as disabled - // (WebKit marks them as disabled) - select.disabled = true; - support.optDisabled = !opt.disabled; - - // Test to see if it's possible to delete an expando from an element - // Fails in Internet Explorer - try { - delete div.test; - } catch( e ) { - support.deleteExpando = false; - } - - if ( !div.addEventListener && div.attachEvent && div.fireEvent ) { - div.attachEvent( "onclick", clickFn = function() { - // Cloning a node shouldn't copy over any - // bound event handlers (IE does this) - support.noCloneEvent = false; - }); - div.cloneNode( true ).fireEvent("onclick"); - div.detachEvent( "onclick", clickFn ); - } - - // Check if a radio maintains its value - // after being appended to the DOM - input = document.createElement("input"); - input.value = "t"; - input.setAttribute( "type", "radio" ); - support.radioValue = input.value === "t"; - - input.setAttribute( "checked", "checked" ); - - // #11217 - WebKit loses check when the name is after the checked attribute - input.setAttribute( "name", "t" ); - - div.appendChild( input ); - fragment = document.createDocumentFragment(); - fragment.appendChild( div.lastChild ); - - // WebKit doesn't clone checked state correctly in fragments - support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked; - - // Check if a disconnected checkbox will retain its checked - // value of true after appended to the DOM (IE6/7) - support.appendChecked = input.checked; - - fragment.removeChild( input ); - fragment.appendChild( div ); - - // Technique from Juriy Zaytsev - // http://perfectionkills.com/detecting-event-support-without-browser-sniffing/ - // We only care about the case where non-standard event systems - // are used, namely in IE. Short-circuiting here helps us to - // avoid an eval call (in setAttribute) which can cause CSP - // to go haywire. See: https://developer.mozilla.org/en/Security/CSP - if ( div.attachEvent ) { - for ( i in { - submit: true, - change: true, - focusin: true - }) { - eventName = "on" + i; - isSupported = ( eventName in div ); - if ( !isSupported ) { - div.setAttribute( eventName, "return;" ); - isSupported = ( typeof div[ eventName ] === "function" ); - } - support[ i + "Bubbles" ] = isSupported; - } - } - - // Run tests that need a body at doc ready - jQuery(function() { - var container, div, tds, marginDiv, - divReset = "padding:0;margin:0;border:0;display:block;overflow:hidden;", - body = document.getElementsByTagName("body")[0]; - - if ( !body ) { - // Return for frameset docs that don't have a body - return; - } - - container = document.createElement("div"); - container.style.cssText = "visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px"; - body.insertBefore( container, body.firstChild ); - - // Construct the test element - div = document.createElement("div"); - container.appendChild( div ); - - // Check if table cells still have offsetWidth/Height when they are set - // to display:none and there are still other visible table cells in a - // table row; if so, offsetWidth/Height are not reliable for use when - // determining if an element has been hidden directly using - // display:none (it is still safe to use offsets if a parent element is - // hidden; don safety goggles and see bug #4512 for more information). - // (only IE 8 fails this test) - div.innerHTML = "
                          t
                          "; - tds = div.getElementsByTagName("td"); - tds[ 0 ].style.cssText = "padding:0;margin:0;border:0;display:none"; - isSupported = ( tds[ 0 ].offsetHeight === 0 ); - - tds[ 0 ].style.display = ""; - tds[ 1 ].style.display = "none"; - - // Check if empty table cells still have offsetWidth/Height - // (IE <= 8 fail this test) - support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 ); - - // Check box-sizing and margin behavior - div.innerHTML = ""; - div.style.cssText = "box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;"; - support.boxSizing = ( div.offsetWidth === 4 ); - support.doesNotIncludeMarginInBodyOffset = ( body.offsetTop !== 1 ); - - // NOTE: To any future maintainer, we've window.getComputedStyle - // because jsdom on node.js will break without it. - if ( window.getComputedStyle ) { - support.pixelPosition = ( window.getComputedStyle( div, null ) || {} ).top !== "1%"; - support.boxSizingReliable = ( window.getComputedStyle( div, null ) || { width: "4px" } ).width === "4px"; - - // Check if div with explicit width and no margin-right incorrectly - // gets computed margin-right based on width of container. For more - // info see bug #3333 - // Fails in WebKit before Feb 2011 nightlies - // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right - marginDiv = document.createElement("div"); - marginDiv.style.cssText = div.style.cssText = divReset; - marginDiv.style.marginRight = marginDiv.style.width = "0"; - div.style.width = "1px"; - div.appendChild( marginDiv ); - support.reliableMarginRight = - !parseFloat( ( window.getComputedStyle( marginDiv, null ) || {} ).marginRight ); - } - - if ( typeof div.style.zoom !== "undefined" ) { - // Check if natively block-level elements act like inline-block - // elements when setting their display to 'inline' and giving - // them layout - // (IE < 8 does this) - div.innerHTML = ""; - div.style.cssText = divReset + "width:1px;padding:1px;display:inline;zoom:1"; - support.inlineBlockNeedsLayout = ( div.offsetWidth === 3 ); - - // Check if elements with layout shrink-wrap their children - // (IE 6 does this) - div.style.display = "block"; - div.style.overflow = "visible"; - div.innerHTML = "
                          "; - div.firstChild.style.width = "5px"; - support.shrinkWrapBlocks = ( div.offsetWidth !== 3 ); - - container.style.zoom = 1; - } - - // Null elements to avoid leaks in IE - body.removeChild( container ); - container = div = tds = marginDiv = null; - }); - - // Null elements to avoid leaks in IE - fragment.removeChild( div ); - all = a = select = opt = input = fragment = div = null; - - return support; -})(); -var rbrace = /(?:\{[\s\S]*\}|\[[\s\S]*\])$/, - rmultiDash = /([A-Z])/g; - -jQuery.extend({ - cache: {}, - - deletedIds: [], - - // Remove at next major release (1.9/2.0) - uuid: 0, - - // Unique for each copy of jQuery on the page - // Non-digits removed to match rinlinejQuery - expando: "jQuery" + ( jQuery.fn.jquery + Math.random() ).replace( /\D/g, "" ), - - // The following elements throw uncatchable exceptions if you - // attempt to add expando properties to them. - noData: { - "embed": true, - // Ban all objects except for Flash (which handle expandos) - "object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000", - "applet": true - }, - - hasData: function( elem ) { - elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ]; - return !!elem && !isEmptyDataObject( elem ); - }, - - data: function( elem, name, data, pvt /* Internal Use Only */ ) { - if ( !jQuery.acceptData( elem ) ) { - return; - } - - var thisCache, ret, - internalKey = jQuery.expando, - getByName = typeof name === "string", - - // We have to handle DOM nodes and JS objects differently because IE6-7 - // can't GC object references properly across the DOM-JS boundary - isNode = elem.nodeType, - - // Only DOM nodes need the global jQuery cache; JS object data is - // attached directly to the object so GC can occur automatically - cache = isNode ? jQuery.cache : elem, - - // Only defining an ID for JS objects if its cache already exists allows - // the code to shortcut on the same path as a DOM node with no cache - id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey; - - // Avoid doing any more work than we need to when trying to get data on an - // object that has no data at all - if ( (!id || !cache[id] || (!pvt && !cache[id].data)) && getByName && data === undefined ) { - return; - } - - if ( !id ) { - // Only DOM nodes need a new unique ID for each element since their data - // ends up in the global cache - if ( isNode ) { - elem[ internalKey ] = id = jQuery.deletedIds.pop() || jQuery.guid++; - } else { - id = internalKey; - } - } - - if ( !cache[ id ] ) { - cache[ id ] = {}; - - // Avoids exposing jQuery metadata on plain JS objects when the object - // is serialized using JSON.stringify - if ( !isNode ) { - cache[ id ].toJSON = jQuery.noop; - } - } - - // An object can be passed to jQuery.data instead of a key/value pair; this gets - // shallow copied over onto the existing cache - if ( typeof name === "object" || typeof name === "function" ) { - if ( pvt ) { - cache[ id ] = jQuery.extend( cache[ id ], name ); - } else { - cache[ id ].data = jQuery.extend( cache[ id ].data, name ); - } - } - - thisCache = cache[ id ]; - - // jQuery data() is stored in a separate object inside the object's internal data - // cache in order to avoid key collisions between internal data and user-defined - // data. - if ( !pvt ) { - if ( !thisCache.data ) { - thisCache.data = {}; - } - - thisCache = thisCache.data; - } - - if ( data !== undefined ) { - thisCache[ jQuery.camelCase( name ) ] = data; - } - - // Check for both converted-to-camel and non-converted data property names - // If a data property was specified - if ( getByName ) { - - // First Try to find as-is property data - ret = thisCache[ name ]; - - // Test for null|undefined property data - if ( ret == null ) { - - // Try to find the camelCased property - ret = thisCache[ jQuery.camelCase( name ) ]; - } - } else { - ret = thisCache; - } - - return ret; - }, - - removeData: function( elem, name, pvt /* Internal Use Only */ ) { - if ( !jQuery.acceptData( elem ) ) { - return; - } - - var thisCache, i, l, - - isNode = elem.nodeType, - - // See jQuery.data for more information - cache = isNode ? jQuery.cache : elem, - id = isNode ? elem[ jQuery.expando ] : jQuery.expando; - - // If there is already no cache entry for this object, there is no - // purpose in continuing - if ( !cache[ id ] ) { - return; - } - - if ( name ) { - - thisCache = pvt ? cache[ id ] : cache[ id ].data; - - if ( thisCache ) { - - // Support array or space separated string names for data keys - if ( !jQuery.isArray( name ) ) { - - // try the string as a key before any manipulation - if ( name in thisCache ) { - name = [ name ]; - } else { - - // split the camel cased version by spaces unless a key with the spaces exists - name = jQuery.camelCase( name ); - if ( name in thisCache ) { - name = [ name ]; - } else { - name = name.split(" "); - } - } - } - - for ( i = 0, l = name.length; i < l; i++ ) { - delete thisCache[ name[i] ]; - } - - // If there is no data left in the cache, we want to continue - // and let the cache object itself get destroyed - if ( !( pvt ? isEmptyDataObject : jQuery.isEmptyObject )( thisCache ) ) { - return; - } - } - } - - // See jQuery.data for more information - if ( !pvt ) { - delete cache[ id ].data; - - // Don't destroy the parent cache unless the internal data object - // had been the only thing left in it - if ( !isEmptyDataObject( cache[ id ] ) ) { - return; - } - } - - // Destroy the cache - if ( isNode ) { - jQuery.cleanData( [ elem ], true ); - - // Use delete when supported for expandos or `cache` is not a window per isWindow (#10080) - } else if ( jQuery.support.deleteExpando || cache != cache.window ) { - delete cache[ id ]; - - // When all else fails, null - } else { - cache[ id ] = null; - } - }, - - // For internal use only. - _data: function( elem, name, data ) { - return jQuery.data( elem, name, data, true ); - }, - - // A method for determining if a DOM node can handle the data expando - acceptData: function( elem ) { - var noData = elem.nodeName && jQuery.noData[ elem.nodeName.toLowerCase() ]; - - // nodes accept data unless otherwise specified; rejection can be conditional - return !noData || noData !== true && elem.getAttribute("classid") === noData; - } -}); - -jQuery.fn.extend({ - data: function( key, value ) { - var parts, part, attr, name, l, - elem = this[0], - i = 0, - data = null; - - // Gets all values - if ( key === undefined ) { - if ( this.length ) { - data = jQuery.data( elem ); - - if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) { - attr = elem.attributes; - for ( l = attr.length; i < l; i++ ) { - name = attr[i].name; - - if ( !name.indexOf( "data-" ) ) { - name = jQuery.camelCase( name.substring(5) ); - - dataAttr( elem, name, data[ name ] ); - } - } - jQuery._data( elem, "parsedAttrs", true ); - } - } - - return data; - } - - // Sets multiple values - if ( typeof key === "object" ) { - return this.each(function() { - jQuery.data( this, key ); - }); - } - - parts = key.split( ".", 2 ); - parts[1] = parts[1] ? "." + parts[1] : ""; - part = parts[1] + "!"; - - return jQuery.access( this, function( value ) { - - if ( value === undefined ) { - data = this.triggerHandler( "getData" + part, [ parts[0] ] ); - - // Try to fetch any internally stored data first - if ( data === undefined && elem ) { - data = jQuery.data( elem, key ); - data = dataAttr( elem, key, data ); - } - - return data === undefined && parts[1] ? - this.data( parts[0] ) : - data; - } - - parts[1] = value; - this.each(function() { - var self = jQuery( this ); - - self.triggerHandler( "setData" + part, parts ); - jQuery.data( this, key, value ); - self.triggerHandler( "changeData" + part, parts ); - }); - }, null, value, arguments.length > 1, null, false ); - }, - - removeData: function( key ) { - return this.each(function() { - jQuery.removeData( this, key ); - }); - } -}); - -function dataAttr( elem, key, data ) { - // If nothing was found internally, try to fetch any - // data from the HTML5 data-* attribute - if ( data === undefined && elem.nodeType === 1 ) { - - var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase(); - - data = elem.getAttribute( name ); - - if ( typeof data === "string" ) { - try { - data = data === "true" ? true : - data === "false" ? false : - data === "null" ? null : - // Only convert to a number if it doesn't change the string - +data + "" === data ? +data : - rbrace.test( data ) ? jQuery.parseJSON( data ) : - data; - } catch( e ) {} - - // Make sure we set the data so it isn't changed later - jQuery.data( elem, key, data ); - - } else { - data = undefined; - } - } - - return data; -} - -// checks a cache object for emptiness -function isEmptyDataObject( obj ) { - var name; - for ( name in obj ) { - - // if the public data object is empty, the private is still empty - if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) { - continue; - } - if ( name !== "toJSON" ) { - return false; - } - } - - return true; -} -jQuery.extend({ - queue: function( elem, type, data ) { - var queue; - - if ( elem ) { - type = ( type || "fx" ) + "queue"; - queue = jQuery._data( elem, type ); - - // Speed up dequeue by getting out quickly if this is just a lookup - if ( data ) { - if ( !queue || jQuery.isArray(data) ) { - queue = jQuery._data( elem, type, jQuery.makeArray(data) ); - } else { - queue.push( data ); - } - } - return queue || []; - } - }, - - dequeue: function( elem, type ) { - type = type || "fx"; - - var queue = jQuery.queue( elem, type ), - startLength = queue.length, - fn = queue.shift(), - hooks = jQuery._queueHooks( elem, type ), - next = function() { - jQuery.dequeue( elem, type ); - }; - - // If the fx queue is dequeued, always remove the progress sentinel - if ( fn === "inprogress" ) { - fn = queue.shift(); - startLength--; - } - - if ( fn ) { - - // Add a progress sentinel to prevent the fx queue from being - // automatically dequeued - if ( type === "fx" ) { - queue.unshift( "inprogress" ); - } - - // clear up the last queue stop function - delete hooks.stop; - fn.call( elem, next, hooks ); - } - - if ( !startLength && hooks ) { - hooks.empty.fire(); - } - }, - - // not intended for public consumption - generates a queueHooks object, or returns the current one - _queueHooks: function( elem, type ) { - var key = type + "queueHooks"; - return jQuery._data( elem, key ) || jQuery._data( elem, key, { - empty: jQuery.Callbacks("once memory").add(function() { - jQuery.removeData( elem, type + "queue", true ); - jQuery.removeData( elem, key, true ); - }) - }); - } -}); - -jQuery.fn.extend({ - queue: function( type, data ) { - var setter = 2; - - if ( typeof type !== "string" ) { - data = type; - type = "fx"; - setter--; - } - - if ( arguments.length < setter ) { - return jQuery.queue( this[0], type ); - } - - return data === undefined ? - this : - this.each(function() { - var queue = jQuery.queue( this, type, data ); - - // ensure a hooks for this queue - jQuery._queueHooks( this, type ); - - if ( type === "fx" && queue[0] !== "inprogress" ) { - jQuery.dequeue( this, type ); - } - }); - }, - dequeue: function( type ) { - return this.each(function() { - jQuery.dequeue( this, type ); - }); - }, - // Based off of the plugin by Clint Helfers, with permission. - // http://blindsignals.com/index.php/2009/07/jquery-delay/ - delay: function( time, type ) { - time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time; - type = type || "fx"; - - return this.queue( type, function( next, hooks ) { - var timeout = setTimeout( next, time ); - hooks.stop = function() { - clearTimeout( timeout ); - }; - }); - }, - clearQueue: function( type ) { - return this.queue( type || "fx", [] ); - }, - // Get a promise resolved when queues of a certain type - // are emptied (fx is the type by default) - promise: function( type, obj ) { - var tmp, - count = 1, - defer = jQuery.Deferred(), - elements = this, - i = this.length, - resolve = function() { - if ( !( --count ) ) { - defer.resolveWith( elements, [ elements ] ); - } - }; - - if ( typeof type !== "string" ) { - obj = type; - type = undefined; - } - type = type || "fx"; - - while( i-- ) { - tmp = jQuery._data( elements[ i ], type + "queueHooks" ); - if ( tmp && tmp.empty ) { - count++; - tmp.empty.add( resolve ); - } - } - resolve(); - return defer.promise( obj ); - } -}); -var nodeHook, boolHook, fixSpecified, - rclass = /[\t\r\n]/g, - rreturn = /\r/g, - rtype = /^(?:button|input)$/i, - rfocusable = /^(?:button|input|object|select|textarea)$/i, - rclickable = /^a(?:rea|)$/i, - rboolean = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i, - getSetAttribute = jQuery.support.getSetAttribute; - -jQuery.fn.extend({ - attr: function( name, value ) { - return jQuery.access( this, jQuery.attr, name, value, arguments.length > 1 ); - }, - - removeAttr: function( name ) { - return this.each(function() { - jQuery.removeAttr( this, name ); - }); - }, - - prop: function( name, value ) { - return jQuery.access( this, jQuery.prop, name, value, arguments.length > 1 ); - }, - - removeProp: function( name ) { - name = jQuery.propFix[ name ] || name; - return this.each(function() { - // try/catch handles cases where IE balks (such as removing a property on window) - try { - this[ name ] = undefined; - delete this[ name ]; - } catch( e ) {} - }); - }, - - addClass: function( value ) { - var classNames, i, l, elem, - setClass, c, cl; - - if ( jQuery.isFunction( value ) ) { - return this.each(function( j ) { - jQuery( this ).addClass( value.call(this, j, this.className) ); - }); - } - - if ( value && typeof value === "string" ) { - classNames = value.split( core_rspace ); - - for ( i = 0, l = this.length; i < l; i++ ) { - elem = this[ i ]; - - if ( elem.nodeType === 1 ) { - if ( !elem.className && classNames.length === 1 ) { - elem.className = value; - - } else { - setClass = " " + elem.className + " "; - - for ( c = 0, cl = classNames.length; c < cl; c++ ) { - if ( setClass.indexOf( " " + classNames[ c ] + " " ) < 0 ) { - setClass += classNames[ c ] + " "; - } - } - elem.className = jQuery.trim( setClass ); - } - } - } - } - - return this; - }, - - removeClass: function( value ) { - var removes, className, elem, c, cl, i, l; - - if ( jQuery.isFunction( value ) ) { - return this.each(function( j ) { - jQuery( this ).removeClass( value.call(this, j, this.className) ); - }); - } - if ( (value && typeof value === "string") || value === undefined ) { - removes = ( value || "" ).split( core_rspace ); - - for ( i = 0, l = this.length; i < l; i++ ) { - elem = this[ i ]; - if ( elem.nodeType === 1 && elem.className ) { - - className = (" " + elem.className + " ").replace( rclass, " " ); - - // loop over each item in the removal list - for ( c = 0, cl = removes.length; c < cl; c++ ) { - // Remove until there is nothing to remove, - while ( className.indexOf(" " + removes[ c ] + " ") >= 0 ) { - className = className.replace( " " + removes[ c ] + " " , " " ); - } - } - elem.className = value ? jQuery.trim( className ) : ""; - } - } - } - - return this; - }, - - toggleClass: function( value, stateVal ) { - var type = typeof value, - isBool = typeof stateVal === "boolean"; - - if ( jQuery.isFunction( value ) ) { - return this.each(function( i ) { - jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal ); - }); - } - - return this.each(function() { - if ( type === "string" ) { - // toggle individual class names - var className, - i = 0, - self = jQuery( this ), - state = stateVal, - classNames = value.split( core_rspace ); - - while ( (className = classNames[ i++ ]) ) { - // check each className given, space separated list - state = isBool ? state : !self.hasClass( className ); - self[ state ? "addClass" : "removeClass" ]( className ); - } - - } else if ( type === "undefined" || type === "boolean" ) { - if ( this.className ) { - // store className if set - jQuery._data( this, "__className__", this.className ); - } - - // toggle whole className - this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || ""; - } - }); - }, - - hasClass: function( selector ) { - var className = " " + selector + " ", - i = 0, - l = this.length; - for ( ; i < l; i++ ) { - if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) >= 0 ) { - return true; - } - } - - return false; - }, - - val: function( value ) { - var hooks, ret, isFunction, - elem = this[0]; - - if ( !arguments.length ) { - if ( elem ) { - hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ]; - - if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) { - return ret; - } - - ret = elem.value; - - return typeof ret === "string" ? - // handle most common string cases - ret.replace(rreturn, "") : - // handle cases where value is null/undef or number - ret == null ? "" : ret; - } - - return; - } - - isFunction = jQuery.isFunction( value ); - - return this.each(function( i ) { - var val, - self = jQuery(this); - - if ( this.nodeType !== 1 ) { - return; - } - - if ( isFunction ) { - val = value.call( this, i, self.val() ); - } else { - val = value; - } - - // Treat null/undefined as ""; convert numbers to string - if ( val == null ) { - val = ""; - } else if ( typeof val === "number" ) { - val += ""; - } else if ( jQuery.isArray( val ) ) { - val = jQuery.map(val, function ( value ) { - return value == null ? "" : value + ""; - }); - } - - hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ]; - - // If set returns undefined, fall back to normal setting - if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) { - this.value = val; - } - }); - } -}); - -jQuery.extend({ - valHooks: { - option: { - get: function( elem ) { - // attributes.value is undefined in Blackberry 4.7 but - // uses .value. See #6932 - var val = elem.attributes.value; - return !val || val.specified ? elem.value : elem.text; - } - }, - select: { - get: function( elem ) { - var value, option, - options = elem.options, - index = elem.selectedIndex, - one = elem.type === "select-one" || index < 0, - values = one ? null : [], - max = one ? index + 1 : options.length, - i = index < 0 ? - max : - one ? index : 0; - - // Loop through all the selected options - for ( ; i < max; i++ ) { - option = options[ i ]; - - // oldIE doesn't update selected after form reset (#2551) - if ( ( option.selected || i === index ) && - // Don't return options that are disabled or in a disabled optgroup - ( jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null ) && - ( !option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" ) ) ) { - - // Get the specific value for the option - value = jQuery( option ).val(); - - // We don't need an array for one selects - if ( one ) { - return value; - } - - // Multi-Selects return an array - values.push( value ); - } - } - - return values; - }, - - set: function( elem, value ) { - var values = jQuery.makeArray( value ); - - jQuery(elem).find("option").each(function() { - this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0; - }); - - if ( !values.length ) { - elem.selectedIndex = -1; - } - return values; - } - } - }, - - // Unused in 1.8, left in so attrFn-stabbers won't die; remove in 1.9 - attrFn: {}, - - attr: function( elem, name, value, pass ) { - var ret, hooks, notxml, - nType = elem.nodeType; - - // don't get/set attributes on text, comment and attribute nodes - if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { - return; - } - - if ( pass && jQuery.isFunction( jQuery.fn[ name ] ) ) { - return jQuery( elem )[ name ]( value ); - } - - // Fallback to prop when attributes are not supported - if ( typeof elem.getAttribute === "undefined" ) { - return jQuery.prop( elem, name, value ); - } - - notxml = nType !== 1 || !jQuery.isXMLDoc( elem ); - - // All attributes are lowercase - // Grab necessary hook if one is defined - if ( notxml ) { - name = name.toLowerCase(); - hooks = jQuery.attrHooks[ name ] || ( rboolean.test( name ) ? boolHook : nodeHook ); - } - - if ( value !== undefined ) { - - if ( value === null ) { - jQuery.removeAttr( elem, name ); - return; - - } else if ( hooks && "set" in hooks && notxml && (ret = hooks.set( elem, value, name )) !== undefined ) { - return ret; - - } else { - elem.setAttribute( name, value + "" ); - return value; - } - - } else if ( hooks && "get" in hooks && notxml && (ret = hooks.get( elem, name )) !== null ) { - return ret; - - } else { - - ret = elem.getAttribute( name ); - - // Non-existent attributes return null, we normalize to undefined - return ret === null ? - undefined : - ret; - } - }, - - removeAttr: function( elem, value ) { - var propName, attrNames, name, isBool, - i = 0; - - if ( value && elem.nodeType === 1 ) { - - attrNames = value.split( core_rspace ); - - for ( ; i < attrNames.length; i++ ) { - name = attrNames[ i ]; - - if ( name ) { - propName = jQuery.propFix[ name ] || name; - isBool = rboolean.test( name ); - - // See #9699 for explanation of this approach (setting first, then removal) - // Do not do this for boolean attributes (see #10870) - if ( !isBool ) { - jQuery.attr( elem, name, "" ); - } - elem.removeAttribute( getSetAttribute ? name : propName ); - - // Set corresponding property to false for boolean attributes - if ( isBool && propName in elem ) { - elem[ propName ] = false; - } - } - } - } - }, - - attrHooks: { - type: { - set: function( elem, value ) { - // We can't allow the type property to be changed (since it causes problems in IE) - if ( rtype.test( elem.nodeName ) && elem.parentNode ) { - jQuery.error( "type property can't be changed" ); - } else if ( !jQuery.support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) { - // Setting the type on a radio button after the value resets the value in IE6-9 - // Reset value to it's default in case type is set after value - // This is for element creation - var val = elem.value; - elem.setAttribute( "type", value ); - if ( val ) { - elem.value = val; - } - return value; - } - } - }, - // Use the value property for back compat - // Use the nodeHook for button elements in IE6/7 (#1954) - value: { - get: function( elem, name ) { - if ( nodeHook && jQuery.nodeName( elem, "button" ) ) { - return nodeHook.get( elem, name ); - } - return name in elem ? - elem.value : - null; - }, - set: function( elem, value, name ) { - if ( nodeHook && jQuery.nodeName( elem, "button" ) ) { - return nodeHook.set( elem, value, name ); - } - // Does not return so that setAttribute is also used - elem.value = value; - } - } - }, - - propFix: { - tabindex: "tabIndex", - readonly: "readOnly", - "for": "htmlFor", - "class": "className", - maxlength: "maxLength", - cellspacing: "cellSpacing", - cellpadding: "cellPadding", - rowspan: "rowSpan", - colspan: "colSpan", - usemap: "useMap", - frameborder: "frameBorder", - contenteditable: "contentEditable" - }, - - prop: function( elem, name, value ) { - var ret, hooks, notxml, - nType = elem.nodeType; - - // don't get/set properties on text, comment and attribute nodes - if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { - return; - } - - notxml = nType !== 1 || !jQuery.isXMLDoc( elem ); - - if ( notxml ) { - // Fix name and attach hooks - name = jQuery.propFix[ name ] || name; - hooks = jQuery.propHooks[ name ]; - } - - if ( value !== undefined ) { - if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) { - return ret; - - } else { - return ( elem[ name ] = value ); - } - - } else { - if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) { - return ret; - - } else { - return elem[ name ]; - } - } - }, - - propHooks: { - tabIndex: { - get: function( elem ) { - // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set - // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ - var attributeNode = elem.getAttributeNode("tabindex"); - - return attributeNode && attributeNode.specified ? - parseInt( attributeNode.value, 10 ) : - rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ? - 0 : - undefined; - } - } - } -}); - -// Hook for boolean attributes -boolHook = { - get: function( elem, name ) { - // Align boolean attributes with corresponding properties - // Fall back to attribute presence where some booleans are not supported - var attrNode, - property = jQuery.prop( elem, name ); - return property === true || typeof property !== "boolean" && ( attrNode = elem.getAttributeNode(name) ) && attrNode.nodeValue !== false ? - name.toLowerCase() : - undefined; - }, - set: function( elem, value, name ) { - var propName; - if ( value === false ) { - // Remove boolean attributes when set to false - jQuery.removeAttr( elem, name ); - } else { - // value is true since we know at this point it's type boolean and not false - // Set boolean attributes to the same name and set the DOM property - propName = jQuery.propFix[ name ] || name; - if ( propName in elem ) { - // Only set the IDL specifically if it already exists on the element - elem[ propName ] = true; - } - - elem.setAttribute( name, name.toLowerCase() ); - } - return name; - } -}; - -// IE6/7 do not support getting/setting some attributes with get/setAttribute -if ( !getSetAttribute ) { - - fixSpecified = { - name: true, - id: true, - coords: true - }; - - // Use this for any attribute in IE6/7 - // This fixes almost every IE6/7 issue - nodeHook = jQuery.valHooks.button = { - get: function( elem, name ) { - var ret; - ret = elem.getAttributeNode( name ); - return ret && ( fixSpecified[ name ] ? ret.value !== "" : ret.specified ) ? - ret.value : - undefined; - }, - set: function( elem, value, name ) { - // Set the existing or create a new attribute node - var ret = elem.getAttributeNode( name ); - if ( !ret ) { - ret = document.createAttribute( name ); - elem.setAttributeNode( ret ); - } - return ( ret.value = value + "" ); - } - }; - - // Set width and height to auto instead of 0 on empty string( Bug #8150 ) - // This is for removals - jQuery.each([ "width", "height" ], function( i, name ) { - jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], { - set: function( elem, value ) { - if ( value === "" ) { - elem.setAttribute( name, "auto" ); - return value; - } - } - }); - }); - - // Set contenteditable to false on removals(#10429) - // Setting to empty string throws an error as an invalid value - jQuery.attrHooks.contenteditable = { - get: nodeHook.get, - set: function( elem, value, name ) { - if ( value === "" ) { - value = "false"; - } - nodeHook.set( elem, value, name ); - } - }; -} - - -// Some attributes require a special call on IE -if ( !jQuery.support.hrefNormalized ) { - jQuery.each([ "href", "src", "width", "height" ], function( i, name ) { - jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], { - get: function( elem ) { - var ret = elem.getAttribute( name, 2 ); - return ret === null ? undefined : ret; - } - }); - }); -} - -if ( !jQuery.support.style ) { - jQuery.attrHooks.style = { - get: function( elem ) { - // Return undefined in the case of empty string - // Normalize to lowercase since IE uppercases css property names - return elem.style.cssText.toLowerCase() || undefined; - }, - set: function( elem, value ) { - return ( elem.style.cssText = value + "" ); - } - }; -} - -// Safari mis-reports the default selected property of an option -// Accessing the parent's selectedIndex property fixes it -if ( !jQuery.support.optSelected ) { - jQuery.propHooks.selected = jQuery.extend( jQuery.propHooks.selected, { - get: function( elem ) { - var parent = elem.parentNode; - - if ( parent ) { - parent.selectedIndex; - - // Make sure that it also works with optgroups, see #5701 - if ( parent.parentNode ) { - parent.parentNode.selectedIndex; - } - } - return null; - } - }); -} - -// IE6/7 call enctype encoding -if ( !jQuery.support.enctype ) { - jQuery.propFix.enctype = "encoding"; -} - -// Radios and checkboxes getter/setter -if ( !jQuery.support.checkOn ) { - jQuery.each([ "radio", "checkbox" ], function() { - jQuery.valHooks[ this ] = { - get: function( elem ) { - // Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified - return elem.getAttribute("value") === null ? "on" : elem.value; - } - }; - }); -} -jQuery.each([ "radio", "checkbox" ], function() { - jQuery.valHooks[ this ] = jQuery.extend( jQuery.valHooks[ this ], { - set: function( elem, value ) { - if ( jQuery.isArray( value ) ) { - return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 ); - } - } - }); -}); -var rformElems = /^(?:textarea|input|select)$/i, - rtypenamespace = /^([^\.]*|)(?:\.(.+)|)$/, - rhoverHack = /(?:^|\s)hover(\.\S+|)\b/, - rkeyEvent = /^key/, - rmouseEvent = /^(?:mouse|contextmenu)|click/, - rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, - hoverHack = function( events ) { - return jQuery.event.special.hover ? events : events.replace( rhoverHack, "mouseenter$1 mouseleave$1" ); - }; - -/* - * Helper functions for managing events -- not part of the public interface. - * Props to Dean Edwards' addEvent library for many of the ideas. - */ -jQuery.event = { - - add: function( elem, types, handler, data, selector ) { - - var elemData, eventHandle, events, - t, tns, type, namespaces, handleObj, - handleObjIn, handlers, special; - - // Don't attach events to noData or text/comment nodes (allow plain objects tho) - if ( elem.nodeType === 3 || elem.nodeType === 8 || !types || !handler || !(elemData = jQuery._data( elem )) ) { - return; - } - - // Caller can pass in an object of custom data in lieu of the handler - if ( handler.handler ) { - handleObjIn = handler; - handler = handleObjIn.handler; - selector = handleObjIn.selector; - } - - // Make sure that the handler has a unique ID, used to find/remove it later - if ( !handler.guid ) { - handler.guid = jQuery.guid++; - } - - // Init the element's event structure and main handler, if this is the first - events = elemData.events; - if ( !events ) { - elemData.events = events = {}; - } - eventHandle = elemData.handle; - if ( !eventHandle ) { - elemData.handle = eventHandle = function( e ) { - // Discard the second event of a jQuery.event.trigger() and - // when an event is called after a page has unloaded - return typeof jQuery !== "undefined" && (!e || jQuery.event.triggered !== e.type) ? - jQuery.event.dispatch.apply( eventHandle.elem, arguments ) : - undefined; - }; - // Add elem as a property of the handle fn to prevent a memory leak with IE non-native events - eventHandle.elem = elem; - } - - // Handle multiple events separated by a space - // jQuery(...).bind("mouseover mouseout", fn); - types = jQuery.trim( hoverHack(types) ).split( " " ); - for ( t = 0; t < types.length; t++ ) { - - tns = rtypenamespace.exec( types[t] ) || []; - type = tns[1]; - namespaces = ( tns[2] || "" ).split( "." ).sort(); - - // If event changes its type, use the special event handlers for the changed type - special = jQuery.event.special[ type ] || {}; - - // If selector defined, determine special event api type, otherwise given type - type = ( selector ? special.delegateType : special.bindType ) || type; - - // Update special based on newly reset type - special = jQuery.event.special[ type ] || {}; - - // handleObj is passed to all event handlers - handleObj = jQuery.extend({ - type: type, - origType: tns[1], - data: data, - handler: handler, - guid: handler.guid, - selector: selector, - needsContext: selector && jQuery.expr.match.needsContext.test( selector ), - namespace: namespaces.join(".") - }, handleObjIn ); - - // Init the event handler queue if we're the first - handlers = events[ type ]; - if ( !handlers ) { - handlers = events[ type ] = []; - handlers.delegateCount = 0; - - // Only use addEventListener/attachEvent if the special events handler returns false - if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) { - // Bind the global event handler to the element - if ( elem.addEventListener ) { - elem.addEventListener( type, eventHandle, false ); - - } else if ( elem.attachEvent ) { - elem.attachEvent( "on" + type, eventHandle ); - } - } - } - - if ( special.add ) { - special.add.call( elem, handleObj ); - - if ( !handleObj.handler.guid ) { - handleObj.handler.guid = handler.guid; - } - } - - // Add to the element's handler list, delegates in front - if ( selector ) { - handlers.splice( handlers.delegateCount++, 0, handleObj ); - } else { - handlers.push( handleObj ); - } - - // Keep track of which events have ever been used, for event optimization - jQuery.event.global[ type ] = true; - } - - // Nullify elem to prevent memory leaks in IE - elem = null; - }, - - global: {}, - - // Detach an event or set of events from an element - remove: function( elem, types, handler, selector, mappedTypes ) { - - var t, tns, type, origType, namespaces, origCount, - j, events, special, eventType, handleObj, - elemData = jQuery.hasData( elem ) && jQuery._data( elem ); - - if ( !elemData || !(events = elemData.events) ) { - return; - } - - // Once for each type.namespace in types; type may be omitted - types = jQuery.trim( hoverHack( types || "" ) ).split(" "); - for ( t = 0; t < types.length; t++ ) { - tns = rtypenamespace.exec( types[t] ) || []; - type = origType = tns[1]; - namespaces = tns[2]; - - // Unbind all events (on this namespace, if provided) for the element - if ( !type ) { - for ( type in events ) { - jQuery.event.remove( elem, type + types[ t ], handler, selector, true ); - } - continue; - } - - special = jQuery.event.special[ type ] || {}; - type = ( selector? special.delegateType : special.bindType ) || type; - eventType = events[ type ] || []; - origCount = eventType.length; - namespaces = namespaces ? new RegExp("(^|\\.)" + namespaces.split(".").sort().join("\\.(?:.*\\.|)") + "(\\.|$)") : null; - - // Remove matching events - for ( j = 0; j < eventType.length; j++ ) { - handleObj = eventType[ j ]; - - if ( ( mappedTypes || origType === handleObj.origType ) && - ( !handler || handler.guid === handleObj.guid ) && - ( !namespaces || namespaces.test( handleObj.namespace ) ) && - ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) { - eventType.splice( j--, 1 ); - - if ( handleObj.selector ) { - eventType.delegateCount--; - } - if ( special.remove ) { - special.remove.call( elem, handleObj ); - } - } - } - - // Remove generic event handler if we removed something and no more handlers exist - // (avoids potential for endless recursion during removal of special event handlers) - if ( eventType.length === 0 && origCount !== eventType.length ) { - if ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) { - jQuery.removeEvent( elem, type, elemData.handle ); - } - - delete events[ type ]; - } - } - - // Remove the expando if it's no longer used - if ( jQuery.isEmptyObject( events ) ) { - delete elemData.handle; - - // removeData also checks for emptiness and clears the expando if empty - // so use it instead of delete - jQuery.removeData( elem, "events", true ); - } - }, - - // Events that are safe to short-circuit if no handlers are attached. - // Native DOM events should not be added, they may have inline handlers. - customEvent: { - "getData": true, - "setData": true, - "changeData": true - }, - - trigger: function( event, data, elem, onlyHandlers ) { - // Don't do events on text and comment nodes - if ( elem && (elem.nodeType === 3 || elem.nodeType === 8) ) { - return; - } - - // Event object or event type - var cache, exclusive, i, cur, old, ontype, special, handle, eventPath, bubbleType, - type = event.type || event, - namespaces = []; - - // focus/blur morphs to focusin/out; ensure we're not firing them right now - if ( rfocusMorph.test( type + jQuery.event.triggered ) ) { - return; - } - - if ( type.indexOf( "!" ) >= 0 ) { - // Exclusive events trigger only for the exact event (no namespaces) - type = type.slice(0, -1); - exclusive = true; - } - - if ( type.indexOf( "." ) >= 0 ) { - // Namespaced trigger; create a regexp to match event type in handle() - namespaces = type.split("."); - type = namespaces.shift(); - namespaces.sort(); - } - - if ( (!elem || jQuery.event.customEvent[ type ]) && !jQuery.event.global[ type ] ) { - // No jQuery handlers for this event type, and it can't have inline handlers - return; - } - - // Caller can pass in an Event, Object, or just an event type string - event = typeof event === "object" ? - // jQuery.Event object - event[ jQuery.expando ] ? event : - // Object literal - new jQuery.Event( type, event ) : - // Just the event type (string) - new jQuery.Event( type ); - - event.type = type; - event.isTrigger = true; - event.exclusive = exclusive; - event.namespace = namespaces.join( "." ); - event.namespace_re = event.namespace? new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)") : null; - ontype = type.indexOf( ":" ) < 0 ? "on" + type : ""; - - // Handle a global trigger - if ( !elem ) { - - // TODO: Stop taunting the data cache; remove global events and always attach to document - cache = jQuery.cache; - for ( i in cache ) { - if ( cache[ i ].events && cache[ i ].events[ type ] ) { - jQuery.event.trigger( event, data, cache[ i ].handle.elem, true ); - } - } - return; - } - - // Clean up the event in case it is being reused - event.result = undefined; - if ( !event.target ) { - event.target = elem; - } - - // Clone any incoming data and prepend the event, creating the handler arg list - data = data != null ? jQuery.makeArray( data ) : []; - data.unshift( event ); - - // Allow special events to draw outside the lines - special = jQuery.event.special[ type ] || {}; - if ( special.trigger && special.trigger.apply( elem, data ) === false ) { - return; - } - - // Determine event propagation path in advance, per W3C events spec (#9951) - // Bubble up to document, then to window; watch for a global ownerDocument var (#9724) - eventPath = [[ elem, special.bindType || type ]]; - if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) { - - bubbleType = special.delegateType || type; - cur = rfocusMorph.test( bubbleType + type ) ? elem : elem.parentNode; - for ( old = elem; cur; cur = cur.parentNode ) { - eventPath.push([ cur, bubbleType ]); - old = cur; - } - - // Only add window if we got to document (e.g., not plain obj or detached DOM) - if ( old === (elem.ownerDocument || document) ) { - eventPath.push([ old.defaultView || old.parentWindow || window, bubbleType ]); - } - } - - // Fire handlers on the event path - for ( i = 0; i < eventPath.length && !event.isPropagationStopped(); i++ ) { - - cur = eventPath[i][0]; - event.type = eventPath[i][1]; - - handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" ); - if ( handle ) { - handle.apply( cur, data ); - } - // Note that this is a bare JS function and not a jQuery handler - handle = ontype && cur[ ontype ]; - if ( handle && jQuery.acceptData( cur ) && handle.apply && handle.apply( cur, data ) === false ) { - event.preventDefault(); - } - } - event.type = type; - - // If nobody prevented the default action, do it now - if ( !onlyHandlers && !event.isDefaultPrevented() ) { - - if ( (!special._default || special._default.apply( elem.ownerDocument, data ) === false) && - !(type === "click" && jQuery.nodeName( elem, "a" )) && jQuery.acceptData( elem ) ) { - - // Call a native DOM method on the target with the same name name as the event. - // Can't use an .isFunction() check here because IE6/7 fails that test. - // Don't do default actions on window, that's where global variables be (#6170) - // IE<9 dies on focus/blur to hidden element (#1486) - if ( ontype && elem[ type ] && ((type !== "focus" && type !== "blur") || event.target.offsetWidth !== 0) && !jQuery.isWindow( elem ) ) { - - // Don't re-trigger an onFOO event when we call its FOO() method - old = elem[ ontype ]; - - if ( old ) { - elem[ ontype ] = null; - } - - // Prevent re-triggering of the same event, since we already bubbled it above - jQuery.event.triggered = type; - elem[ type ](); - jQuery.event.triggered = undefined; - - if ( old ) { - elem[ ontype ] = old; - } - } - } - } - - return event.result; - }, - - dispatch: function( event ) { - - // Make a writable jQuery.Event from the native event object - event = jQuery.event.fix( event || window.event ); - - var i, j, cur, ret, selMatch, matched, matches, handleObj, sel, related, - handlers = ( (jQuery._data( this, "events" ) || {} )[ event.type ] || []), - delegateCount = handlers.delegateCount, - args = core_slice.call( arguments ), - run_all = !event.exclusive && !event.namespace, - special = jQuery.event.special[ event.type ] || {}, - handlerQueue = []; - - // Use the fix-ed jQuery.Event rather than the (read-only) native event - args[0] = event; - event.delegateTarget = this; - - // Call the preDispatch hook for the mapped type, and let it bail if desired - if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) { - return; - } - - // Determine handlers that should run if there are delegated events - // Avoid non-left-click bubbling in Firefox (#3861) - if ( delegateCount && !(event.button && event.type === "click") ) { - - for ( cur = event.target; cur != this; cur = cur.parentNode || this ) { - - // Don't process clicks (ONLY) on disabled elements (#6911, #8165, #11382, #11764) - if ( cur.disabled !== true || event.type !== "click" ) { - selMatch = {}; - matches = []; - for ( i = 0; i < delegateCount; i++ ) { - handleObj = handlers[ i ]; - sel = handleObj.selector; - - if ( selMatch[ sel ] === undefined ) { - selMatch[ sel ] = handleObj.needsContext ? - jQuery( sel, this ).index( cur ) >= 0 : - jQuery.find( sel, this, null, [ cur ] ).length; - } - if ( selMatch[ sel ] ) { - matches.push( handleObj ); - } - } - if ( matches.length ) { - handlerQueue.push({ elem: cur, matches: matches }); - } - } - } - } - - // Add the remaining (directly-bound) handlers - if ( handlers.length > delegateCount ) { - handlerQueue.push({ elem: this, matches: handlers.slice( delegateCount ) }); - } - - // Run delegates first; they may want to stop propagation beneath us - for ( i = 0; i < handlerQueue.length && !event.isPropagationStopped(); i++ ) { - matched = handlerQueue[ i ]; - event.currentTarget = matched.elem; - - for ( j = 0; j < matched.matches.length && !event.isImmediatePropagationStopped(); j++ ) { - handleObj = matched.matches[ j ]; - - // Triggered event must either 1) be non-exclusive and have no namespace, or - // 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace). - if ( run_all || (!event.namespace && !handleObj.namespace) || event.namespace_re && event.namespace_re.test( handleObj.namespace ) ) { - - event.data = handleObj.data; - event.handleObj = handleObj; - - ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler ) - .apply( matched.elem, args ); - - if ( ret !== undefined ) { - event.result = ret; - if ( ret === false ) { - event.preventDefault(); - event.stopPropagation(); - } - } - } - } - } - - // Call the postDispatch hook for the mapped type - if ( special.postDispatch ) { - special.postDispatch.call( this, event ); - } - - return event.result; - }, - - // Includes some event props shared by KeyEvent and MouseEvent - // *** attrChange attrName relatedNode srcElement are not normalized, non-W3C, deprecated, will be removed in 1.8 *** - props: "attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "), - - fixHooks: {}, - - keyHooks: { - props: "char charCode key keyCode".split(" "), - filter: function( event, original ) { - - // Add which for key events - if ( event.which == null ) { - event.which = original.charCode != null ? original.charCode : original.keyCode; - } - - return event; - } - }, - - mouseHooks: { - props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "), - filter: function( event, original ) { - var eventDoc, doc, body, - button = original.button, - fromElement = original.fromElement; - - // Calculate pageX/Y if missing and clientX/Y available - if ( event.pageX == null && original.clientX != null ) { - eventDoc = event.target.ownerDocument || document; - doc = eventDoc.documentElement; - body = eventDoc.body; - - event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 ); - event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 ); - } - - // Add relatedTarget, if necessary - if ( !event.relatedTarget && fromElement ) { - event.relatedTarget = fromElement === event.target ? original.toElement : fromElement; - } - - // Add which for click: 1 === left; 2 === middle; 3 === right - // Note: button is not normalized, so don't use it - if ( !event.which && button !== undefined ) { - event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) ); - } - - return event; - } - }, - - fix: function( event ) { - if ( event[ jQuery.expando ] ) { - return event; - } - - // Create a writable copy of the event object and normalize some properties - var i, prop, - originalEvent = event, - fixHook = jQuery.event.fixHooks[ event.type ] || {}, - copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props; - - event = jQuery.Event( originalEvent ); - - for ( i = copy.length; i; ) { - prop = copy[ --i ]; - event[ prop ] = originalEvent[ prop ]; - } - - // Fix target property, if necessary (#1925, IE 6/7/8 & Safari2) - if ( !event.target ) { - event.target = originalEvent.srcElement || document; - } - - // Target should not be a text node (#504, Safari) - if ( event.target.nodeType === 3 ) { - event.target = event.target.parentNode; - } - - // For mouse/key events, metaKey==false if it's undefined (#3368, #11328; IE6/7/8) - event.metaKey = !!event.metaKey; - - return fixHook.filter? fixHook.filter( event, originalEvent ) : event; - }, - - special: { - load: { - // Prevent triggered image.load events from bubbling to window.load - noBubble: true - }, - - focus: { - delegateType: "focusin" - }, - blur: { - delegateType: "focusout" - }, - - beforeunload: { - setup: function( data, namespaces, eventHandle ) { - // We only want to do this special case on windows - if ( jQuery.isWindow( this ) ) { - this.onbeforeunload = eventHandle; - } - }, - - teardown: function( namespaces, eventHandle ) { - if ( this.onbeforeunload === eventHandle ) { - this.onbeforeunload = null; - } - } - } - }, - - simulate: function( type, elem, event, bubble ) { - // Piggyback on a donor event to simulate a different one. - // Fake originalEvent to avoid donor's stopPropagation, but if the - // simulated event prevents default then we do the same on the donor. - var e = jQuery.extend( - new jQuery.Event(), - event, - { type: type, - isSimulated: true, - originalEvent: {} - } - ); - if ( bubble ) { - jQuery.event.trigger( e, null, elem ); - } else { - jQuery.event.dispatch.call( elem, e ); - } - if ( e.isDefaultPrevented() ) { - event.preventDefault(); - } - } -}; - -// Some plugins are using, but it's undocumented/deprecated and will be removed. -// The 1.7 special event interface should provide all the hooks needed now. -jQuery.event.handle = jQuery.event.dispatch; - -jQuery.removeEvent = document.removeEventListener ? - function( elem, type, handle ) { - if ( elem.removeEventListener ) { - elem.removeEventListener( type, handle, false ); - } - } : - function( elem, type, handle ) { - var name = "on" + type; - - if ( elem.detachEvent ) { - - // #8545, #7054, preventing memory leaks for custom events in IE6-8 - // detachEvent needed property on element, by name of that event, to properly expose it to GC - if ( typeof elem[ name ] === "undefined" ) { - elem[ name ] = null; - } - - elem.detachEvent( name, handle ); - } - }; - -jQuery.Event = function( src, props ) { - // Allow instantiation without the 'new' keyword - if ( !(this instanceof jQuery.Event) ) { - return new jQuery.Event( src, props ); - } - - // Event object - if ( src && src.type ) { - this.originalEvent = src; - this.type = src.type; - - // Events bubbling up the document may have been marked as prevented - // by a handler lower down the tree; reflect the correct value. - this.isDefaultPrevented = ( src.defaultPrevented || src.returnValue === false || - src.getPreventDefault && src.getPreventDefault() ) ? returnTrue : returnFalse; - - // Event type - } else { - this.type = src; - } - - // Put explicitly provided properties onto the event object - if ( props ) { - jQuery.extend( this, props ); - } - - // Create a timestamp if incoming event doesn't have one - this.timeStamp = src && src.timeStamp || jQuery.now(); - - // Mark it as fixed - this[ jQuery.expando ] = true; -}; - -function returnFalse() { - return false; -} -function returnTrue() { - return true; -} - -// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding -// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html -jQuery.Event.prototype = { - preventDefault: function() { - this.isDefaultPrevented = returnTrue; - - var e = this.originalEvent; - if ( !e ) { - return; - } - - // if preventDefault exists run it on the original event - if ( e.preventDefault ) { - e.preventDefault(); - - // otherwise set the returnValue property of the original event to false (IE) - } else { - e.returnValue = false; - } - }, - stopPropagation: function() { - this.isPropagationStopped = returnTrue; - - var e = this.originalEvent; - if ( !e ) { - return; - } - // if stopPropagation exists run it on the original event - if ( e.stopPropagation ) { - e.stopPropagation(); - } - // otherwise set the cancelBubble property of the original event to true (IE) - e.cancelBubble = true; - }, - stopImmediatePropagation: function() { - this.isImmediatePropagationStopped = returnTrue; - this.stopPropagation(); - }, - isDefaultPrevented: returnFalse, - isPropagationStopped: returnFalse, - isImmediatePropagationStopped: returnFalse -}; - -// Create mouseenter/leave events using mouseover/out and event-time checks -jQuery.each({ - mouseenter: "mouseover", - mouseleave: "mouseout" -}, function( orig, fix ) { - jQuery.event.special[ orig ] = { - delegateType: fix, - bindType: fix, - - handle: function( event ) { - var ret, - target = this, - related = event.relatedTarget, - handleObj = event.handleObj, - selector = handleObj.selector; - - // For mousenter/leave call the handler if related is outside the target. - // NB: No relatedTarget if the mouse left/entered the browser window - if ( !related || (related !== target && !jQuery.contains( target, related )) ) { - event.type = handleObj.origType; - ret = handleObj.handler.apply( this, arguments ); - event.type = fix; - } - return ret; - } - }; -}); - -// IE submit delegation -if ( !jQuery.support.submitBubbles ) { - - jQuery.event.special.submit = { - setup: function() { - // Only need this for delegated form submit events - if ( jQuery.nodeName( this, "form" ) ) { - return false; - } - - // Lazy-add a submit handler when a descendant form may potentially be submitted - jQuery.event.add( this, "click._submit keypress._submit", function( e ) { - // Node name check avoids a VML-related crash in IE (#9807) - var elem = e.target, - form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.form : undefined; - if ( form && !jQuery._data( form, "_submit_attached" ) ) { - jQuery.event.add( form, "submit._submit", function( event ) { - event._submit_bubble = true; - }); - jQuery._data( form, "_submit_attached", true ); - } - }); - // return undefined since we don't need an event listener - }, - - postDispatch: function( event ) { - // If form was submitted by the user, bubble the event up the tree - if ( event._submit_bubble ) { - delete event._submit_bubble; - if ( this.parentNode && !event.isTrigger ) { - jQuery.event.simulate( "submit", this.parentNode, event, true ); - } - } - }, - - teardown: function() { - // Only need this for delegated form submit events - if ( jQuery.nodeName( this, "form" ) ) { - return false; - } - - // Remove delegated handlers; cleanData eventually reaps submit handlers attached above - jQuery.event.remove( this, "._submit" ); - } - }; -} - -// IE change delegation and checkbox/radio fix -if ( !jQuery.support.changeBubbles ) { - - jQuery.event.special.change = { - - setup: function() { - - if ( rformElems.test( this.nodeName ) ) { - // IE doesn't fire change on a check/radio until blur; trigger it on click - // after a propertychange. Eat the blur-change in special.change.handle. - // This still fires onchange a second time for check/radio after blur. - if ( this.type === "checkbox" || this.type === "radio" ) { - jQuery.event.add( this, "propertychange._change", function( event ) { - if ( event.originalEvent.propertyName === "checked" ) { - this._just_changed = true; - } - }); - jQuery.event.add( this, "click._change", function( event ) { - if ( this._just_changed && !event.isTrigger ) { - this._just_changed = false; - } - // Allow triggered, simulated change events (#11500) - jQuery.event.simulate( "change", this, event, true ); - }); - } - return false; - } - // Delegated event; lazy-add a change handler on descendant inputs - jQuery.event.add( this, "beforeactivate._change", function( e ) { - var elem = e.target; - - if ( rformElems.test( elem.nodeName ) && !jQuery._data( elem, "_change_attached" ) ) { - jQuery.event.add( elem, "change._change", function( event ) { - if ( this.parentNode && !event.isSimulated && !event.isTrigger ) { - jQuery.event.simulate( "change", this.parentNode, event, true ); - } - }); - jQuery._data( elem, "_change_attached", true ); - } - }); - }, - - handle: function( event ) { - var elem = event.target; - - // Swallow native change events from checkbox/radio, we already triggered them above - if ( this !== elem || event.isSimulated || event.isTrigger || (elem.type !== "radio" && elem.type !== "checkbox") ) { - return event.handleObj.handler.apply( this, arguments ); - } - }, - - teardown: function() { - jQuery.event.remove( this, "._change" ); - - return !rformElems.test( this.nodeName ); - } - }; -} - -// Create "bubbling" focus and blur events -if ( !jQuery.support.focusinBubbles ) { - jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) { - - // Attach a single capturing handler while someone wants focusin/focusout - var attaches = 0, - handler = function( event ) { - jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true ); - }; - - jQuery.event.special[ fix ] = { - setup: function() { - if ( attaches++ === 0 ) { - document.addEventListener( orig, handler, true ); - } - }, - teardown: function() { - if ( --attaches === 0 ) { - document.removeEventListener( orig, handler, true ); - } - } - }; - }); -} - -jQuery.fn.extend({ - - on: function( types, selector, data, fn, /*INTERNAL*/ one ) { - var origFn, type; - - // Types can be a map of types/handlers - if ( typeof types === "object" ) { - // ( types-Object, selector, data ) - if ( typeof selector !== "string" ) { // && selector != null - // ( types-Object, data ) - data = data || selector; - selector = undefined; - } - for ( type in types ) { - this.on( type, selector, data, types[ type ], one ); - } - return this; - } - - if ( data == null && fn == null ) { - // ( types, fn ) - fn = selector; - data = selector = undefined; - } else if ( fn == null ) { - if ( typeof selector === "string" ) { - // ( types, selector, fn ) - fn = data; - data = undefined; - } else { - // ( types, data, fn ) - fn = data; - data = selector; - selector = undefined; - } - } - if ( fn === false ) { - fn = returnFalse; - } else if ( !fn ) { - return this; - } - - if ( one === 1 ) { - origFn = fn; - fn = function( event ) { - // Can use an empty set, since event contains the info - jQuery().off( event ); - return origFn.apply( this, arguments ); - }; - // Use same guid so caller can remove using origFn - fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); - } - return this.each( function() { - jQuery.event.add( this, types, fn, data, selector ); - }); - }, - one: function( types, selector, data, fn ) { - return this.on( types, selector, data, fn, 1 ); - }, - off: function( types, selector, fn ) { - var handleObj, type; - if ( types && types.preventDefault && types.handleObj ) { - // ( event ) dispatched jQuery.Event - handleObj = types.handleObj; - jQuery( types.delegateTarget ).off( - handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType, - handleObj.selector, - handleObj.handler - ); - return this; - } - if ( typeof types === "object" ) { - // ( types-object [, selector] ) - for ( type in types ) { - this.off( type, selector, types[ type ] ); - } - return this; - } - if ( selector === false || typeof selector === "function" ) { - // ( types [, fn] ) - fn = selector; - selector = undefined; - } - if ( fn === false ) { - fn = returnFalse; - } - return this.each(function() { - jQuery.event.remove( this, types, fn, selector ); - }); - }, - - bind: function( types, data, fn ) { - return this.on( types, null, data, fn ); - }, - unbind: function( types, fn ) { - return this.off( types, null, fn ); - }, - - live: function( types, data, fn ) { - jQuery( this.context ).on( types, this.selector, data, fn ); - return this; - }, - die: function( types, fn ) { - jQuery( this.context ).off( types, this.selector || "**", fn ); - return this; - }, - - delegate: function( selector, types, data, fn ) { - return this.on( types, selector, data, fn ); - }, - undelegate: function( selector, types, fn ) { - // ( namespace ) or ( selector, types [, fn] ) - return arguments.length === 1 ? this.off( selector, "**" ) : this.off( types, selector || "**", fn ); - }, - - trigger: function( type, data ) { - return this.each(function() { - jQuery.event.trigger( type, data, this ); - }); - }, - triggerHandler: function( type, data ) { - if ( this[0] ) { - return jQuery.event.trigger( type, data, this[0], true ); - } - }, - - toggle: function( fn ) { - // Save reference to arguments for access in closure - var args = arguments, - guid = fn.guid || jQuery.guid++, - i = 0, - toggler = function( event ) { - // Figure out which function to execute - var lastToggle = ( jQuery._data( this, "lastToggle" + fn.guid ) || 0 ) % i; - jQuery._data( this, "lastToggle" + fn.guid, lastToggle + 1 ); - - // Make sure that clicks stop - event.preventDefault(); - - // and execute the function - return args[ lastToggle ].apply( this, arguments ) || false; - }; - - // link all the functions, so any of them can unbind this click handler - toggler.guid = guid; - while ( i < args.length ) { - args[ i++ ].guid = guid; - } - - return this.click( toggler ); - }, - - hover: function( fnOver, fnOut ) { - return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver ); - } -}); - -jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " + - "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + - "change select submit keydown keypress keyup error contextmenu").split(" "), function( i, name ) { - - // Handle event binding - jQuery.fn[ name ] = function( data, fn ) { - if ( fn == null ) { - fn = data; - data = null; - } - - return arguments.length > 0 ? - this.on( name, null, data, fn ) : - this.trigger( name ); - }; - - if ( rkeyEvent.test( name ) ) { - jQuery.event.fixHooks[ name ] = jQuery.event.keyHooks; - } - - if ( rmouseEvent.test( name ) ) { - jQuery.event.fixHooks[ name ] = jQuery.event.mouseHooks; - } -}); -/*! - * Sizzle CSS Selector Engine - * Copyright 2012 jQuery Foundation and other contributors - * Released under the MIT license - * http://sizzlejs.com/ - */ -(function( window, undefined ) { - -var cachedruns, - assertGetIdNotName, - Expr, - getText, - isXML, - contains, - compile, - sortOrder, - hasDuplicate, - outermostContext, - - baseHasDuplicate = true, - strundefined = "undefined", - - expando = ( "sizcache" + Math.random() ).replace( ".", "" ), - - Token = String, - document = window.document, - docElem = document.documentElement, - dirruns = 0, - done = 0, - pop = [].pop, - push = [].push, - slice = [].slice, - // Use a stripped-down indexOf if a native one is unavailable - indexOf = [].indexOf || function( elem ) { - var i = 0, - len = this.length; - for ( ; i < len; i++ ) { - if ( this[i] === elem ) { - return i; - } - } - return -1; - }, - - // Augment a function for special use by Sizzle - markFunction = function( fn, value ) { - fn[ expando ] = value == null || value; - return fn; - }, - - createCache = function() { - var cache = {}, - keys = []; - - return markFunction(function( key, value ) { - // Only keep the most recent entries - if ( keys.push( key ) > Expr.cacheLength ) { - delete cache[ keys.shift() ]; - } - - // Retrieve with (key + " ") to avoid collision with native Object.prototype properties (see Issue #157) - return (cache[ key + " " ] = value); - }, cache ); - }, - - classCache = createCache(), - tokenCache = createCache(), - compilerCache = createCache(), - - // Regex - - // Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace - whitespace = "[\\x20\\t\\r\\n\\f]", - // http://www.w3.org/TR/css3-syntax/#characters - characterEncoding = "(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+", - - // Loosely modeled on CSS identifier characters - // An unquoted value should be a CSS identifier (http://www.w3.org/TR/css3-selectors/#attribute-selectors) - // Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier - identifier = characterEncoding.replace( "w", "w#" ), - - // Acceptable operators http://www.w3.org/TR/selectors/#attribute-selectors - operators = "([*^$|!~]?=)", - attributes = "\\[" + whitespace + "*(" + characterEncoding + ")" + whitespace + - "*(?:" + operators + whitespace + "*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|(" + identifier + ")|)|)" + whitespace + "*\\]", - - // Prefer arguments not in parens/brackets, - // then attribute selectors and non-pseudos (denoted by :), - // then anything else - // These preferences are here to reduce the number of selectors - // needing tokenize in the PSEUDO preFilter - pseudos = ":(" + characterEncoding + ")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|([^()[\\]]*|(?:(?:" + attributes + ")|[^:]|\\\\.)*|.*))\\)|)", - - // For matchExpr.POS and matchExpr.needsContext - pos = ":(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace + - "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", - - // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter - rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ), - - rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ), - rcombinators = new RegExp( "^" + whitespace + "*([\\x20\\t\\r\\n\\f>+~])" + whitespace + "*" ), - rpseudo = new RegExp( pseudos ), - - // Easily-parseable/retrievable ID or TAG or CLASS selectors - rquickExpr = /^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/, - - rnot = /^:not/, - rsibling = /[\x20\t\r\n\f]*[+~]/, - rendsWithNot = /:not\($/, - - rheader = /h\d/i, - rinputs = /input|select|textarea|button/i, - - rbackslash = /\\(?!\\)/g, - - matchExpr = { - "ID": new RegExp( "^#(" + characterEncoding + ")" ), - "CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ), - "NAME": new RegExp( "^\\[name=['\"]?(" + characterEncoding + ")['\"]?\\]" ), - "TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ), - "ATTR": new RegExp( "^" + attributes ), - "PSEUDO": new RegExp( "^" + pseudos ), - "POS": new RegExp( pos, "i" ), - "CHILD": new RegExp( "^:(only|nth|first|last)-child(?:\\(" + whitespace + - "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace + - "*(\\d+)|))" + whitespace + "*\\)|)", "i" ), - // For use in libraries implementing .is() - "needsContext": new RegExp( "^" + whitespace + "*[>+~]|" + pos, "i" ) - }, - - // Support - - // Used for testing something on an element - assert = function( fn ) { - var div = document.createElement("div"); - - try { - return fn( div ); - } catch (e) { - return false; - } finally { - // release memory in IE - div = null; - } - }, - - // Check if getElementsByTagName("*") returns only elements - assertTagNameNoComments = assert(function( div ) { - div.appendChild( document.createComment("") ); - return !div.getElementsByTagName("*").length; - }), - - // Check if getAttribute returns normalized href attributes - assertHrefNotNormalized = assert(function( div ) { - div.innerHTML = ""; - return div.firstChild && typeof div.firstChild.getAttribute !== strundefined && - div.firstChild.getAttribute("href") === "#"; - }), - - // Check if attributes should be retrieved by attribute nodes - assertAttributes = assert(function( div ) { - div.innerHTML = ""; - var type = typeof div.lastChild.getAttribute("multiple"); - // IE8 returns a string for some attributes even when not present - return type !== "boolean" && type !== "string"; - }), - - // Check if getElementsByClassName can be trusted - assertUsableClassName = assert(function( div ) { - // Opera can't find a second classname (in 9.6) - div.innerHTML = ""; - if ( !div.getElementsByClassName || !div.getElementsByClassName("e").length ) { - return false; - } - - // Safari 3.2 caches class attributes and doesn't catch changes - div.lastChild.className = "e"; - return div.getElementsByClassName("e").length === 2; - }), - - // Check if getElementById returns elements by name - // Check if getElementsByName privileges form controls or returns elements by ID - assertUsableName = assert(function( div ) { - // Inject content - div.id = expando + 0; - div.innerHTML = "
                          "; - docElem.insertBefore( div, docElem.firstChild ); - - // Test - var pass = document.getElementsByName && - // buggy browsers will return fewer than the correct 2 - document.getElementsByName( expando ).length === 2 + - // buggy browsers will return more than the correct 0 - document.getElementsByName( expando + 0 ).length; - assertGetIdNotName = !document.getElementById( expando ); - - // Cleanup - docElem.removeChild( div ); - - return pass; - }); - -// If slice is not available, provide a backup -try { - slice.call( docElem.childNodes, 0 )[0].nodeType; -} catch ( e ) { - slice = function( i ) { - var elem, - results = []; - for ( ; (elem = this[i]); i++ ) { - results.push( elem ); - } - return results; - }; -} - -function Sizzle( selector, context, results, seed ) { - results = results || []; - context = context || document; - var match, elem, xml, m, - nodeType = context.nodeType; - - if ( !selector || typeof selector !== "string" ) { - return results; - } - - if ( nodeType !== 1 && nodeType !== 9 ) { - return []; - } - - xml = isXML( context ); - - if ( !xml && !seed ) { - if ( (match = rquickExpr.exec( selector )) ) { - // Speed-up: Sizzle("#ID") - if ( (m = match[1]) ) { - if ( nodeType === 9 ) { - elem = context.getElementById( m ); - // Check parentNode to catch when Blackberry 4.6 returns - // nodes that are no longer in the document #6963 - if ( elem && elem.parentNode ) { - // Handle the case where IE, Opera, and Webkit return items - // by name instead of ID - if ( elem.id === m ) { - results.push( elem ); - return results; - } - } else { - return results; - } - } else { - // Context is not a document - if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) && - contains( context, elem ) && elem.id === m ) { - results.push( elem ); - return results; - } - } - - // Speed-up: Sizzle("TAG") - } else if ( match[2] ) { - push.apply( results, slice.call(context.getElementsByTagName( selector ), 0) ); - return results; - - // Speed-up: Sizzle(".CLASS") - } else if ( (m = match[3]) && assertUsableClassName && context.getElementsByClassName ) { - push.apply( results, slice.call(context.getElementsByClassName( m ), 0) ); - return results; - } - } - } - - // All others - return select( selector.replace( rtrim, "$1" ), context, results, seed, xml ); -} - -Sizzle.matches = function( expr, elements ) { - return Sizzle( expr, null, null, elements ); -}; - -Sizzle.matchesSelector = function( elem, expr ) { - return Sizzle( expr, null, null, [ elem ] ).length > 0; -}; - -// Returns a function to use in pseudos for input types -function createInputPseudo( type ) { - return function( elem ) { - var name = elem.nodeName.toLowerCase(); - return name === "input" && elem.type === type; - }; -} - -// Returns a function to use in pseudos for buttons -function createButtonPseudo( type ) { - return function( elem ) { - var name = elem.nodeName.toLowerCase(); - return (name === "input" || name === "button") && elem.type === type; - }; -} - -// Returns a function to use in pseudos for positionals -function createPositionalPseudo( fn ) { - return markFunction(function( argument ) { - argument = +argument; - return markFunction(function( seed, matches ) { - var j, - matchIndexes = fn( [], seed.length, argument ), - i = matchIndexes.length; - - // Match elements found at the specified indexes - while ( i-- ) { - if ( seed[ (j = matchIndexes[i]) ] ) { - seed[j] = !(matches[j] = seed[j]); - } - } - }); - }); -} - -/** - * Utility function for retrieving the text value of an array of DOM nodes - * @param {Array|Element} elem - */ -getText = Sizzle.getText = function( elem ) { - var node, - ret = "", - i = 0, - nodeType = elem.nodeType; - - if ( nodeType ) { - if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { - // Use textContent for elements - // innerText usage removed for consistency of new lines (see #11153) - if ( typeof elem.textContent === "string" ) { - return elem.textContent; - } else { - // Traverse its children - for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { - ret += getText( elem ); - } - } - } else if ( nodeType === 3 || nodeType === 4 ) { - return elem.nodeValue; - } - // Do not include comment or processing instruction nodes - } else { - - // If no nodeType, this is expected to be an array - for ( ; (node = elem[i]); i++ ) { - // Do not traverse comment nodes - ret += getText( node ); - } - } - return ret; -}; - -isXML = Sizzle.isXML = function( elem ) { - // documentElement is verified for cases where it doesn't yet exist - // (such as loading iframes in IE - #4833) - var documentElement = elem && (elem.ownerDocument || elem).documentElement; - return documentElement ? documentElement.nodeName !== "HTML" : false; -}; - -// Element contains another -contains = Sizzle.contains = docElem.contains ? - function( a, b ) { - var adown = a.nodeType === 9 ? a.documentElement : a, - bup = b && b.parentNode; - return a === bup || !!( bup && bup.nodeType === 1 && adown.contains && adown.contains(bup) ); - } : - docElem.compareDocumentPosition ? - function( a, b ) { - return b && !!( a.compareDocumentPosition( b ) & 16 ); - } : - function( a, b ) { - while ( (b = b.parentNode) ) { - if ( b === a ) { - return true; - } - } - return false; - }; - -Sizzle.attr = function( elem, name ) { - var val, - xml = isXML( elem ); - - if ( !xml ) { - name = name.toLowerCase(); - } - if ( (val = Expr.attrHandle[ name ]) ) { - return val( elem ); - } - if ( xml || assertAttributes ) { - return elem.getAttribute( name ); - } - val = elem.getAttributeNode( name ); - return val ? - typeof elem[ name ] === "boolean" ? - elem[ name ] ? name : null : - val.specified ? val.value : null : - null; -}; - -Expr = Sizzle.selectors = { - - // Can be adjusted by the user - cacheLength: 50, - - createPseudo: markFunction, - - match: matchExpr, - - // IE6/7 return a modified href - attrHandle: assertHrefNotNormalized ? - {} : - { - "href": function( elem ) { - return elem.getAttribute( "href", 2 ); - }, - "type": function( elem ) { - return elem.getAttribute("type"); - } - }, - - find: { - "ID": assertGetIdNotName ? - function( id, context, xml ) { - if ( typeof context.getElementById !== strundefined && !xml ) { - var m = context.getElementById( id ); - // Check parentNode to catch when Blackberry 4.6 returns - // nodes that are no longer in the document #6963 - return m && m.parentNode ? [m] : []; - } - } : - function( id, context, xml ) { - if ( typeof context.getElementById !== strundefined && !xml ) { - var m = context.getElementById( id ); - - return m ? - m.id === id || typeof m.getAttributeNode !== strundefined && m.getAttributeNode("id").value === id ? - [m] : - undefined : - []; - } - }, - - "TAG": assertTagNameNoComments ? - function( tag, context ) { - if ( typeof context.getElementsByTagName !== strundefined ) { - return context.getElementsByTagName( tag ); - } - } : - function( tag, context ) { - var results = context.getElementsByTagName( tag ); - - // Filter out possible comments - if ( tag === "*" ) { - var elem, - tmp = [], - i = 0; - - for ( ; (elem = results[i]); i++ ) { - if ( elem.nodeType === 1 ) { - tmp.push( elem ); - } - } - - return tmp; - } - return results; - }, - - "NAME": assertUsableName && function( tag, context ) { - if ( typeof context.getElementsByName !== strundefined ) { - return context.getElementsByName( name ); - } - }, - - "CLASS": assertUsableClassName && function( className, context, xml ) { - if ( typeof context.getElementsByClassName !== strundefined && !xml ) { - return context.getElementsByClassName( className ); - } - } - }, - - relative: { - ">": { dir: "parentNode", first: true }, - " ": { dir: "parentNode" }, - "+": { dir: "previousSibling", first: true }, - "~": { dir: "previousSibling" } - }, - - preFilter: { - "ATTR": function( match ) { - match[1] = match[1].replace( rbackslash, "" ); - - // Move the given value to match[3] whether quoted or unquoted - match[3] = ( match[4] || match[5] || "" ).replace( rbackslash, "" ); - - if ( match[2] === "~=" ) { - match[3] = " " + match[3] + " "; - } - - return match.slice( 0, 4 ); - }, - - "CHILD": function( match ) { - /* matches from matchExpr["CHILD"] - 1 type (only|nth|...) - 2 argument (even|odd|\d*|\d*n([+-]\d+)?|...) - 3 xn-component of xn+y argument ([+-]?\d*n|) - 4 sign of xn-component - 5 x of xn-component - 6 sign of y-component - 7 y of y-component - */ - match[1] = match[1].toLowerCase(); - - if ( match[1] === "nth" ) { - // nth-child requires argument - if ( !match[2] ) { - Sizzle.error( match[0] ); - } - - // numeric x and y parameters for Expr.filter.CHILD - // remember that false/true cast respectively to 0/1 - match[3] = +( match[3] ? match[4] + (match[5] || 1) : 2 * ( match[2] === "even" || match[2] === "odd" ) ); - match[4] = +( ( match[6] + match[7] ) || match[2] === "odd" ); - - // other types prohibit arguments - } else if ( match[2] ) { - Sizzle.error( match[0] ); - } - - return match; - }, - - "PSEUDO": function( match ) { - var unquoted, excess; - if ( matchExpr["CHILD"].test( match[0] ) ) { - return null; - } - - if ( match[3] ) { - match[2] = match[3]; - } else if ( (unquoted = match[4]) ) { - // Only check arguments that contain a pseudo - if ( rpseudo.test(unquoted) && - // Get excess from tokenize (recursively) - (excess = tokenize( unquoted, true )) && - // advance to the next closing parenthesis - (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) { - - // excess is a negative index - unquoted = unquoted.slice( 0, excess ); - match[0] = match[0].slice( 0, excess ); - } - match[2] = unquoted; - } - - // Return only captures needed by the pseudo filter method (type and argument) - return match.slice( 0, 3 ); - } - }, - - filter: { - "ID": assertGetIdNotName ? - function( id ) { - id = id.replace( rbackslash, "" ); - return function( elem ) { - return elem.getAttribute("id") === id; - }; - } : - function( id ) { - id = id.replace( rbackslash, "" ); - return function( elem ) { - var node = typeof elem.getAttributeNode !== strundefined && elem.getAttributeNode("id"); - return node && node.value === id; - }; - }, - - "TAG": function( nodeName ) { - if ( nodeName === "*" ) { - return function() { return true; }; - } - nodeName = nodeName.replace( rbackslash, "" ).toLowerCase(); - - return function( elem ) { - return elem.nodeName && elem.nodeName.toLowerCase() === nodeName; - }; - }, - - "CLASS": function( className ) { - var pattern = classCache[ expando ][ className + " " ]; - - return pattern || - (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) && - classCache( className, function( elem ) { - return pattern.test( elem.className || (typeof elem.getAttribute !== strundefined && elem.getAttribute("class")) || "" ); - }); - }, - - "ATTR": function( name, operator, check ) { - return function( elem, context ) { - var result = Sizzle.attr( elem, name ); - - if ( result == null ) { - return operator === "!="; - } - if ( !operator ) { - return true; - } - - result += ""; - - return operator === "=" ? result === check : - operator === "!=" ? result !== check : - operator === "^=" ? check && result.indexOf( check ) === 0 : - operator === "*=" ? check && result.indexOf( check ) > -1 : - operator === "$=" ? check && result.substr( result.length - check.length ) === check : - operator === "~=" ? ( " " + result + " " ).indexOf( check ) > -1 : - operator === "|=" ? result === check || result.substr( 0, check.length + 1 ) === check + "-" : - false; - }; - }, - - "CHILD": function( type, argument, first, last ) { - - if ( type === "nth" ) { - return function( elem ) { - var node, diff, - parent = elem.parentNode; - - if ( first === 1 && last === 0 ) { - return true; - } - - if ( parent ) { - diff = 0; - for ( node = parent.firstChild; node; node = node.nextSibling ) { - if ( node.nodeType === 1 ) { - diff++; - if ( elem === node ) { - break; - } - } - } - } - - // Incorporate the offset (or cast to NaN), then check against cycle size - diff -= last; - return diff === first || ( diff % first === 0 && diff / first >= 0 ); - }; - } - - return function( elem ) { - var node = elem; - - switch ( type ) { - case "only": - case "first": - while ( (node = node.previousSibling) ) { - if ( node.nodeType === 1 ) { - return false; - } - } - - if ( type === "first" ) { - return true; - } - - node = elem; - - /* falls through */ - case "last": - while ( (node = node.nextSibling) ) { - if ( node.nodeType === 1 ) { - return false; - } - } - - return true; - } - }; - }, - - "PSEUDO": function( pseudo, argument ) { - // pseudo-class names are case-insensitive - // http://www.w3.org/TR/selectors/#pseudo-classes - // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters - // Remember that setFilters inherits from pseudos - var args, - fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] || - Sizzle.error( "unsupported pseudo: " + pseudo ); - - // The user may use createPseudo to indicate that - // arguments are needed to create the filter function - // just as Sizzle does - if ( fn[ expando ] ) { - return fn( argument ); - } - - // But maintain support for old signatures - if ( fn.length > 1 ) { - args = [ pseudo, pseudo, "", argument ]; - return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ? - markFunction(function( seed, matches ) { - var idx, - matched = fn( seed, argument ), - i = matched.length; - while ( i-- ) { - idx = indexOf.call( seed, matched[i] ); - seed[ idx ] = !( matches[ idx ] = matched[i] ); - } - }) : - function( elem ) { - return fn( elem, 0, args ); - }; - } - - return fn; - } - }, - - pseudos: { - "not": markFunction(function( selector ) { - // Trim the selector passed to compile - // to avoid treating leading and trailing - // spaces as combinators - var input = [], - results = [], - matcher = compile( selector.replace( rtrim, "$1" ) ); - - return matcher[ expando ] ? - markFunction(function( seed, matches, context, xml ) { - var elem, - unmatched = matcher( seed, null, xml, [] ), - i = seed.length; - - // Match elements unmatched by `matcher` - while ( i-- ) { - if ( (elem = unmatched[i]) ) { - seed[i] = !(matches[i] = elem); - } - } - }) : - function( elem, context, xml ) { - input[0] = elem; - matcher( input, null, xml, results ); - return !results.pop(); - }; - }), - - "has": markFunction(function( selector ) { - return function( elem ) { - return Sizzle( selector, elem ).length > 0; - }; - }), - - "contains": markFunction(function( text ) { - return function( elem ) { - return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1; - }; - }), - - "enabled": function( elem ) { - return elem.disabled === false; - }, - - "disabled": function( elem ) { - return elem.disabled === true; - }, - - "checked": function( elem ) { - // In CSS3, :checked should return both checked and selected elements - // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked - var nodeName = elem.nodeName.toLowerCase(); - return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected); - }, - - "selected": function( elem ) { - // Accessing this property makes selected-by-default - // options in Safari work properly - if ( elem.parentNode ) { - elem.parentNode.selectedIndex; - } - - return elem.selected === true; - }, - - "parent": function( elem ) { - return !Expr.pseudos["empty"]( elem ); - }, - - "empty": function( elem ) { - // http://www.w3.org/TR/selectors/#empty-pseudo - // :empty is only affected by element nodes and content nodes(including text(3), cdata(4)), - // not comment, processing instructions, or others - // Thanks to Diego Perini for the nodeName shortcut - // Greater than "@" means alpha characters (specifically not starting with "#" or "?") - var nodeType; - elem = elem.firstChild; - while ( elem ) { - if ( elem.nodeName > "@" || (nodeType = elem.nodeType) === 3 || nodeType === 4 ) { - return false; - } - elem = elem.nextSibling; - } - return true; - }, - - "header": function( elem ) { - return rheader.test( elem.nodeName ); - }, - - "text": function( elem ) { - var type, attr; - // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc) - // use getAttribute instead to test this case - return elem.nodeName.toLowerCase() === "input" && - (type = elem.type) === "text" && - ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === type ); - }, - - // Input types - "radio": createInputPseudo("radio"), - "checkbox": createInputPseudo("checkbox"), - "file": createInputPseudo("file"), - "password": createInputPseudo("password"), - "image": createInputPseudo("image"), - - "submit": createButtonPseudo("submit"), - "reset": createButtonPseudo("reset"), - - "button": function( elem ) { - var name = elem.nodeName.toLowerCase(); - return name === "input" && elem.type === "button" || name === "button"; - }, - - "input": function( elem ) { - return rinputs.test( elem.nodeName ); - }, - - "focus": function( elem ) { - var doc = elem.ownerDocument; - return elem === doc.activeElement && (!doc.hasFocus || doc.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex); - }, - - "active": function( elem ) { - return elem === elem.ownerDocument.activeElement; - }, - - // Positional types - "first": createPositionalPseudo(function() { - return [ 0 ]; - }), - - "last": createPositionalPseudo(function( matchIndexes, length ) { - return [ length - 1 ]; - }), - - "eq": createPositionalPseudo(function( matchIndexes, length, argument ) { - return [ argument < 0 ? argument + length : argument ]; - }), - - "even": createPositionalPseudo(function( matchIndexes, length ) { - for ( var i = 0; i < length; i += 2 ) { - matchIndexes.push( i ); - } - return matchIndexes; - }), - - "odd": createPositionalPseudo(function( matchIndexes, length ) { - for ( var i = 1; i < length; i += 2 ) { - matchIndexes.push( i ); - } - return matchIndexes; - }), - - "lt": createPositionalPseudo(function( matchIndexes, length, argument ) { - for ( var i = argument < 0 ? argument + length : argument; --i >= 0; ) { - matchIndexes.push( i ); - } - return matchIndexes; - }), - - "gt": createPositionalPseudo(function( matchIndexes, length, argument ) { - for ( var i = argument < 0 ? argument + length : argument; ++i < length; ) { - matchIndexes.push( i ); - } - return matchIndexes; - }) - } -}; - -function siblingCheck( a, b, ret ) { - if ( a === b ) { - return ret; - } - - var cur = a.nextSibling; - - while ( cur ) { - if ( cur === b ) { - return -1; - } - - cur = cur.nextSibling; - } - - return 1; -} - -sortOrder = docElem.compareDocumentPosition ? - function( a, b ) { - if ( a === b ) { - hasDuplicate = true; - return 0; - } - - return ( !a.compareDocumentPosition || !b.compareDocumentPosition ? - a.compareDocumentPosition : - a.compareDocumentPosition(b) & 4 - ) ? -1 : 1; - } : - function( a, b ) { - // The nodes are identical, we can exit early - if ( a === b ) { - hasDuplicate = true; - return 0; - - // Fallback to using sourceIndex (in IE) if it's available on both nodes - } else if ( a.sourceIndex && b.sourceIndex ) { - return a.sourceIndex - b.sourceIndex; - } - - var al, bl, - ap = [], - bp = [], - aup = a.parentNode, - bup = b.parentNode, - cur = aup; - - // If the nodes are siblings (or identical) we can do a quick check - if ( aup === bup ) { - return siblingCheck( a, b ); - - // If no parents were found then the nodes are disconnected - } else if ( !aup ) { - return -1; - - } else if ( !bup ) { - return 1; - } - - // Otherwise they're somewhere else in the tree so we need - // to build up a full list of the parentNodes for comparison - while ( cur ) { - ap.unshift( cur ); - cur = cur.parentNode; - } - - cur = bup; - - while ( cur ) { - bp.unshift( cur ); - cur = cur.parentNode; - } - - al = ap.length; - bl = bp.length; - - // Start walking down the tree looking for a discrepancy - for ( var i = 0; i < al && i < bl; i++ ) { - if ( ap[i] !== bp[i] ) { - return siblingCheck( ap[i], bp[i] ); - } - } - - // We ended someplace up the tree so do a sibling check - return i === al ? - siblingCheck( a, bp[i], -1 ) : - siblingCheck( ap[i], b, 1 ); - }; - -// Always assume the presence of duplicates if sort doesn't -// pass them to our comparison function (as in Google Chrome). -[0, 0].sort( sortOrder ); -baseHasDuplicate = !hasDuplicate; - -// Document sorting and removing duplicates -Sizzle.uniqueSort = function( results ) { - var elem, - duplicates = [], - i = 1, - j = 0; - - hasDuplicate = baseHasDuplicate; - results.sort( sortOrder ); - - if ( hasDuplicate ) { - for ( ; (elem = results[i]); i++ ) { - if ( elem === results[ i - 1 ] ) { - j = duplicates.push( i ); - } - } - while ( j-- ) { - results.splice( duplicates[ j ], 1 ); - } - } - - return results; -}; - -Sizzle.error = function( msg ) { - throw new Error( "Syntax error, unrecognized expression: " + msg ); -}; - -function tokenize( selector, parseOnly ) { - var matched, match, tokens, type, - soFar, groups, preFilters, - cached = tokenCache[ expando ][ selector + " " ]; - - if ( cached ) { - return parseOnly ? 0 : cached.slice( 0 ); - } - - soFar = selector; - groups = []; - preFilters = Expr.preFilter; - - while ( soFar ) { - - // Comma and first run - if ( !matched || (match = rcomma.exec( soFar )) ) { - if ( match ) { - // Don't consume trailing commas as valid - soFar = soFar.slice( match[0].length ) || soFar; - } - groups.push( tokens = [] ); - } - - matched = false; - - // Combinators - if ( (match = rcombinators.exec( soFar )) ) { - tokens.push( matched = new Token( match.shift() ) ); - soFar = soFar.slice( matched.length ); - - // Cast descendant combinators to space - matched.type = match[0].replace( rtrim, " " ); - } - - // Filters - for ( type in Expr.filter ) { - if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] || - (match = preFilters[ type ]( match ))) ) { - - tokens.push( matched = new Token( match.shift() ) ); - soFar = soFar.slice( matched.length ); - matched.type = type; - matched.matches = match; - } - } - - if ( !matched ) { - break; - } - } - - // Return the length of the invalid excess - // if we're just parsing - // Otherwise, throw an error or return tokens - return parseOnly ? - soFar.length : - soFar ? - Sizzle.error( selector ) : - // Cache the tokens - tokenCache( selector, groups ).slice( 0 ); -} - -function addCombinator( matcher, combinator, base ) { - var dir = combinator.dir, - checkNonElements = base && combinator.dir === "parentNode", - doneName = done++; - - return combinator.first ? - // Check against closest ancestor/preceding element - function( elem, context, xml ) { - while ( (elem = elem[ dir ]) ) { - if ( checkNonElements || elem.nodeType === 1 ) { - return matcher( elem, context, xml ); - } - } - } : - - // Check against all ancestor/preceding elements - function( elem, context, xml ) { - // We can't set arbitrary data on XML nodes, so they don't benefit from dir caching - if ( !xml ) { - var cache, - dirkey = dirruns + " " + doneName + " ", - cachedkey = dirkey + cachedruns; - while ( (elem = elem[ dir ]) ) { - if ( checkNonElements || elem.nodeType === 1 ) { - if ( (cache = elem[ expando ]) === cachedkey ) { - return elem.sizset; - } else if ( typeof cache === "string" && cache.indexOf(dirkey) === 0 ) { - if ( elem.sizset ) { - return elem; - } - } else { - elem[ expando ] = cachedkey; - if ( matcher( elem, context, xml ) ) { - elem.sizset = true; - return elem; - } - elem.sizset = false; - } - } - } - } else { - while ( (elem = elem[ dir ]) ) { - if ( checkNonElements || elem.nodeType === 1 ) { - if ( matcher( elem, context, xml ) ) { - return elem; - } - } - } - } - }; -} - -function elementMatcher( matchers ) { - return matchers.length > 1 ? - function( elem, context, xml ) { - var i = matchers.length; - while ( i-- ) { - if ( !matchers[i]( elem, context, xml ) ) { - return false; - } - } - return true; - } : - matchers[0]; -} - -function condense( unmatched, map, filter, context, xml ) { - var elem, - newUnmatched = [], - i = 0, - len = unmatched.length, - mapped = map != null; - - for ( ; i < len; i++ ) { - if ( (elem = unmatched[i]) ) { - if ( !filter || filter( elem, context, xml ) ) { - newUnmatched.push( elem ); - if ( mapped ) { - map.push( i ); - } - } - } - } - - return newUnmatched; -} - -function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) { - if ( postFilter && !postFilter[ expando ] ) { - postFilter = setMatcher( postFilter ); - } - if ( postFinder && !postFinder[ expando ] ) { - postFinder = setMatcher( postFinder, postSelector ); - } - return markFunction(function( seed, results, context, xml ) { - var temp, i, elem, - preMap = [], - postMap = [], - preexisting = results.length, - - // Get initial elements from seed or context - elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ), - - // Prefilter to get matcher input, preserving a map for seed-results synchronization - matcherIn = preFilter && ( seed || !selector ) ? - condense( elems, preMap, preFilter, context, xml ) : - elems, - - matcherOut = matcher ? - // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results, - postFinder || ( seed ? preFilter : preexisting || postFilter ) ? - - // ...intermediate processing is necessary - [] : - - // ...otherwise use results directly - results : - matcherIn; - - // Find primary matches - if ( matcher ) { - matcher( matcherIn, matcherOut, context, xml ); - } - - // Apply postFilter - if ( postFilter ) { - temp = condense( matcherOut, postMap ); - postFilter( temp, [], context, xml ); - - // Un-match failing elements by moving them back to matcherIn - i = temp.length; - while ( i-- ) { - if ( (elem = temp[i]) ) { - matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem); - } - } - } - - if ( seed ) { - if ( postFinder || preFilter ) { - if ( postFinder ) { - // Get the final matcherOut by condensing this intermediate into postFinder contexts - temp = []; - i = matcherOut.length; - while ( i-- ) { - if ( (elem = matcherOut[i]) ) { - // Restore matcherIn since elem is not yet a final match - temp.push( (matcherIn[i] = elem) ); - } - } - postFinder( null, (matcherOut = []), temp, xml ); - } - - // Move matched elements from seed to results to keep them synchronized - i = matcherOut.length; - while ( i-- ) { - if ( (elem = matcherOut[i]) && - (temp = postFinder ? indexOf.call( seed, elem ) : preMap[i]) > -1 ) { - - seed[temp] = !(results[temp] = elem); - } - } - } - - // Add elements to results, through postFinder if defined - } else { - matcherOut = condense( - matcherOut === results ? - matcherOut.splice( preexisting, matcherOut.length ) : - matcherOut - ); - if ( postFinder ) { - postFinder( null, results, matcherOut, xml ); - } else { - push.apply( results, matcherOut ); - } - } - }); -} - -function matcherFromTokens( tokens ) { - var checkContext, matcher, j, - len = tokens.length, - leadingRelative = Expr.relative[ tokens[0].type ], - implicitRelative = leadingRelative || Expr.relative[" "], - i = leadingRelative ? 1 : 0, - - // The foundational matcher ensures that elements are reachable from top-level context(s) - matchContext = addCombinator( function( elem ) { - return elem === checkContext; - }, implicitRelative, true ), - matchAnyContext = addCombinator( function( elem ) { - return indexOf.call( checkContext, elem ) > -1; - }, implicitRelative, true ), - matchers = [ function( elem, context, xml ) { - return ( !leadingRelative && ( xml || context !== outermostContext ) ) || ( - (checkContext = context).nodeType ? - matchContext( elem, context, xml ) : - matchAnyContext( elem, context, xml ) ); - } ]; - - for ( ; i < len; i++ ) { - if ( (matcher = Expr.relative[ tokens[i].type ]) ) { - matchers = [ addCombinator( elementMatcher( matchers ), matcher ) ]; - } else { - matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches ); - - // Return special upon seeing a positional matcher - if ( matcher[ expando ] ) { - // Find the next relative operator (if any) for proper handling - j = ++i; - for ( ; j < len; j++ ) { - if ( Expr.relative[ tokens[j].type ] ) { - break; - } - } - return setMatcher( - i > 1 && elementMatcher( matchers ), - i > 1 && tokens.slice( 0, i - 1 ).join("").replace( rtrim, "$1" ), - matcher, - i < j && matcherFromTokens( tokens.slice( i, j ) ), - j < len && matcherFromTokens( (tokens = tokens.slice( j )) ), - j < len && tokens.join("") - ); - } - matchers.push( matcher ); - } - } - - return elementMatcher( matchers ); -} - -function matcherFromGroupMatchers( elementMatchers, setMatchers ) { - var bySet = setMatchers.length > 0, - byElement = elementMatchers.length > 0, - superMatcher = function( seed, context, xml, results, expandContext ) { - var elem, j, matcher, - setMatched = [], - matchedCount = 0, - i = "0", - unmatched = seed && [], - outermost = expandContext != null, - contextBackup = outermostContext, - // We must always have either seed elements or context - elems = seed || byElement && Expr.find["TAG"]( "*", expandContext && context.parentNode || context ), - // Nested matchers should use non-integer dirruns - dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.E); - - if ( outermost ) { - outermostContext = context !== document && context; - cachedruns = superMatcher.el; - } - - // Add elements passing elementMatchers directly to results - for ( ; (elem = elems[i]) != null; i++ ) { - if ( byElement && elem ) { - for ( j = 0; (matcher = elementMatchers[j]); j++ ) { - if ( matcher( elem, context, xml ) ) { - results.push( elem ); - break; - } - } - if ( outermost ) { - dirruns = dirrunsUnique; - cachedruns = ++superMatcher.el; - } - } - - // Track unmatched elements for set filters - if ( bySet ) { - // They will have gone through all possible matchers - if ( (elem = !matcher && elem) ) { - matchedCount--; - } - - // Lengthen the array for every element, matched or not - if ( seed ) { - unmatched.push( elem ); - } - } - } - - // Apply set filters to unmatched elements - matchedCount += i; - if ( bySet && i !== matchedCount ) { - for ( j = 0; (matcher = setMatchers[j]); j++ ) { - matcher( unmatched, setMatched, context, xml ); - } - - if ( seed ) { - // Reintegrate element matches to eliminate the need for sorting - if ( matchedCount > 0 ) { - while ( i-- ) { - if ( !(unmatched[i] || setMatched[i]) ) { - setMatched[i] = pop.call( results ); - } - } - } - - // Discard index placeholder values to get only actual matches - setMatched = condense( setMatched ); - } - - // Add matches to results - push.apply( results, setMatched ); - - // Seedless set matches succeeding multiple successful matchers stipulate sorting - if ( outermost && !seed && setMatched.length > 0 && - ( matchedCount + setMatchers.length ) > 1 ) { - - Sizzle.uniqueSort( results ); - } - } - - // Override manipulation of globals by nested matchers - if ( outermost ) { - dirruns = dirrunsUnique; - outermostContext = contextBackup; - } - - return unmatched; - }; - - superMatcher.el = 0; - return bySet ? - markFunction( superMatcher ) : - superMatcher; -} - -compile = Sizzle.compile = function( selector, group /* Internal Use Only */ ) { - var i, - setMatchers = [], - elementMatchers = [], - cached = compilerCache[ expando ][ selector + " " ]; - - if ( !cached ) { - // Generate a function of recursive functions that can be used to check each element - if ( !group ) { - group = tokenize( selector ); - } - i = group.length; - while ( i-- ) { - cached = matcherFromTokens( group[i] ); - if ( cached[ expando ] ) { - setMatchers.push( cached ); - } else { - elementMatchers.push( cached ); - } - } - - // Cache the compiled function - cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) ); - } - return cached; -}; - -function multipleContexts( selector, contexts, results ) { - var i = 0, - len = contexts.length; - for ( ; i < len; i++ ) { - Sizzle( selector, contexts[i], results ); - } - return results; -} - -function select( selector, context, results, seed, xml ) { - var i, tokens, token, type, find, - match = tokenize( selector ), - j = match.length; - - if ( !seed ) { - // Try to minimize operations if there is only one group - if ( match.length === 1 ) { - - // Take a shortcut and set the context if the root selector is an ID - tokens = match[0] = match[0].slice( 0 ); - if ( tokens.length > 2 && (token = tokens[0]).type === "ID" && - context.nodeType === 9 && !xml && - Expr.relative[ tokens[1].type ] ) { - - context = Expr.find["ID"]( token.matches[0].replace( rbackslash, "" ), context, xml )[0]; - if ( !context ) { - return results; - } - - selector = selector.slice( tokens.shift().length ); - } - - // Fetch a seed set for right-to-left matching - for ( i = matchExpr["POS"].test( selector ) ? -1 : tokens.length - 1; i >= 0; i-- ) { - token = tokens[i]; - - // Abort if we hit a combinator - if ( Expr.relative[ (type = token.type) ] ) { - break; - } - if ( (find = Expr.find[ type ]) ) { - // Search, expanding context for leading sibling combinators - if ( (seed = find( - token.matches[0].replace( rbackslash, "" ), - rsibling.test( tokens[0].type ) && context.parentNode || context, - xml - )) ) { - - // If seed is empty or no tokens remain, we can return early - tokens.splice( i, 1 ); - selector = seed.length && tokens.join(""); - if ( !selector ) { - push.apply( results, slice.call( seed, 0 ) ); - return results; - } - - break; - } - } - } - } - } - - // Compile and execute a filtering function - // Provide `match` to avoid retokenization if we modified the selector above - compile( selector, match )( - seed, - context, - xml, - results, - rsibling.test( selector ) - ); - return results; -} - -if ( document.querySelectorAll ) { - (function() { - var disconnectedMatch, - oldSelect = select, - rescape = /'|\\/g, - rattributeQuotes = /\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g, - - // qSa(:focus) reports false when true (Chrome 21), no need to also add to buggyMatches since matches checks buggyQSA - // A support test would require too much code (would include document ready) - rbuggyQSA = [ ":focus" ], - - // matchesSelector(:active) reports false when true (IE9/Opera 11.5) - // A support test would require too much code (would include document ready) - // just skip matchesSelector for :active - rbuggyMatches = [ ":active" ], - matches = docElem.matchesSelector || - docElem.mozMatchesSelector || - docElem.webkitMatchesSelector || - docElem.oMatchesSelector || - docElem.msMatchesSelector; - - // Build QSA regex - // Regex strategy adopted from Diego Perini - assert(function( div ) { - // Select is set to empty string on purpose - // This is to test IE's treatment of not explictly - // setting a boolean content attribute, - // since its presence should be enough - // http://bugs.jquery.com/ticket/12359 - div.innerHTML = ""; - - // IE8 - Some boolean attributes are not treated correctly - if ( !div.querySelectorAll("[selected]").length ) { - rbuggyQSA.push( "\\[" + whitespace + "*(?:checked|disabled|ismap|multiple|readonly|selected|value)" ); - } - - // Webkit/Opera - :checked should return selected option elements - // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked - // IE8 throws error here (do not put tests after this one) - if ( !div.querySelectorAll(":checked").length ) { - rbuggyQSA.push(":checked"); - } - }); - - assert(function( div ) { - - // Opera 10-12/IE9 - ^= $= *= and empty values - // Should not select anything - div.innerHTML = "

                          "; - if ( div.querySelectorAll("[test^='']").length ) { - rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:\"\"|'')" ); - } - - // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled) - // IE8 throws error here (do not put tests after this one) - div.innerHTML = ""; - if ( !div.querySelectorAll(":enabled").length ) { - rbuggyQSA.push(":enabled", ":disabled"); - } - }); - - // rbuggyQSA always contains :focus, so no need for a length check - rbuggyQSA = /* rbuggyQSA.length && */ new RegExp( rbuggyQSA.join("|") ); - - select = function( selector, context, results, seed, xml ) { - // Only use querySelectorAll when not filtering, - // when this is not xml, - // and when no QSA bugs apply - if ( !seed && !xml && !rbuggyQSA.test( selector ) ) { - var groups, i, - old = true, - nid = expando, - newContext = context, - newSelector = context.nodeType === 9 && selector; - - // qSA works strangely on Element-rooted queries - // We can work around this by specifying an extra ID on the root - // and working up from there (Thanks to Andrew Dupont for the technique) - // IE 8 doesn't work on object elements - if ( context.nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) { - groups = tokenize( selector ); - - if ( (old = context.getAttribute("id")) ) { - nid = old.replace( rescape, "\\$&" ); - } else { - context.setAttribute( "id", nid ); - } - nid = "[id='" + nid + "'] "; - - i = groups.length; - while ( i-- ) { - groups[i] = nid + groups[i].join(""); - } - newContext = rsibling.test( selector ) && context.parentNode || context; - newSelector = groups.join(","); - } - - if ( newSelector ) { - try { - push.apply( results, slice.call( newContext.querySelectorAll( - newSelector - ), 0 ) ); - return results; - } catch(qsaError) { - } finally { - if ( !old ) { - context.removeAttribute("id"); - } - } - } - } - - return oldSelect( selector, context, results, seed, xml ); - }; - - if ( matches ) { - assert(function( div ) { - // Check to see if it's possible to do matchesSelector - // on a disconnected node (IE 9) - disconnectedMatch = matches.call( div, "div" ); - - // This should fail with an exception - // Gecko does not error, returns false instead - try { - matches.call( div, "[test!='']:sizzle" ); - rbuggyMatches.push( "!=", pseudos ); - } catch ( e ) {} - }); - - // rbuggyMatches always contains :active and :focus, so no need for a length check - rbuggyMatches = /* rbuggyMatches.length && */ new RegExp( rbuggyMatches.join("|") ); - - Sizzle.matchesSelector = function( elem, expr ) { - // Make sure that attribute selectors are quoted - expr = expr.replace( rattributeQuotes, "='$1']" ); - - // rbuggyMatches always contains :active, so no need for an existence check - if ( !isXML( elem ) && !rbuggyMatches.test( expr ) && !rbuggyQSA.test( expr ) ) { - try { - var ret = matches.call( elem, expr ); - - // IE 9's matchesSelector returns false on disconnected nodes - if ( ret || disconnectedMatch || - // As well, disconnected nodes are said to be in a document - // fragment in IE 9 - elem.document && elem.document.nodeType !== 11 ) { - return ret; - } - } catch(e) {} - } - - return Sizzle( expr, null, null, [ elem ] ).length > 0; - }; - } - })(); -} - -// Deprecated -Expr.pseudos["nth"] = Expr.pseudos["eq"]; - -// Back-compat -function setFilters() {} -Expr.filters = setFilters.prototype = Expr.pseudos; -Expr.setFilters = new setFilters(); - -// Override sizzle attribute retrieval -Sizzle.attr = jQuery.attr; -jQuery.find = Sizzle; -jQuery.expr = Sizzle.selectors; -jQuery.expr[":"] = jQuery.expr.pseudos; -jQuery.unique = Sizzle.uniqueSort; -jQuery.text = Sizzle.getText; -jQuery.isXMLDoc = Sizzle.isXML; -jQuery.contains = Sizzle.contains; - - -})( window ); -var runtil = /Until$/, - rparentsprev = /^(?:parents|prev(?:Until|All))/, - isSimple = /^.[^:#\[\.,]*$/, - rneedsContext = jQuery.expr.match.needsContext, - // methods guaranteed to produce a unique set when starting from a unique set - guaranteedUnique = { - children: true, - contents: true, - next: true, - prev: true - }; - -jQuery.fn.extend({ - find: function( selector ) { - var i, l, length, n, r, ret, - self = this; - - if ( typeof selector !== "string" ) { - return jQuery( selector ).filter(function() { - for ( i = 0, l = self.length; i < l; i++ ) { - if ( jQuery.contains( self[ i ], this ) ) { - return true; - } - } - }); - } - - ret = this.pushStack( "", "find", selector ); - - for ( i = 0, l = this.length; i < l; i++ ) { - length = ret.length; - jQuery.find( selector, this[i], ret ); - - if ( i > 0 ) { - // Make sure that the results are unique - for ( n = length; n < ret.length; n++ ) { - for ( r = 0; r < length; r++ ) { - if ( ret[r] === ret[n] ) { - ret.splice(n--, 1); - break; - } - } - } - } - } - - return ret; - }, - - has: function( target ) { - var i, - targets = jQuery( target, this ), - len = targets.length; - - return this.filter(function() { - for ( i = 0; i < len; i++ ) { - if ( jQuery.contains( this, targets[i] ) ) { - return true; - } - } - }); - }, - - not: function( selector ) { - return this.pushStack( winnow(this, selector, false), "not", selector); - }, - - filter: function( selector ) { - return this.pushStack( winnow(this, selector, true), "filter", selector ); - }, - - is: function( selector ) { - return !!selector && ( - typeof selector === "string" ? - // If this is a positional/relative selector, check membership in the returned set - // so $("p:first").is("p:last") won't return true for a doc with two "p". - rneedsContext.test( selector ) ? - jQuery( selector, this.context ).index( this[0] ) >= 0 : - jQuery.filter( selector, this ).length > 0 : - this.filter( selector ).length > 0 ); - }, - - closest: function( selectors, context ) { - var cur, - i = 0, - l = this.length, - ret = [], - pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ? - jQuery( selectors, context || this.context ) : - 0; - - for ( ; i < l; i++ ) { - cur = this[i]; - - while ( cur && cur.ownerDocument && cur !== context && cur.nodeType !== 11 ) { - if ( pos ? pos.index(cur) > -1 : jQuery.find.matchesSelector(cur, selectors) ) { - ret.push( cur ); - break; - } - cur = cur.parentNode; - } - } - - ret = ret.length > 1 ? jQuery.unique( ret ) : ret; - - return this.pushStack( ret, "closest", selectors ); - }, - - // Determine the position of an element within - // the matched set of elements - index: function( elem ) { - - // No argument, return index in parent - if ( !elem ) { - return ( this[0] && this[0].parentNode ) ? this.prevAll().length : -1; - } - - // index in selector - if ( typeof elem === "string" ) { - return jQuery.inArray( this[0], jQuery( elem ) ); - } - - // Locate the position of the desired element - return jQuery.inArray( - // If it receives a jQuery object, the first element is used - elem.jquery ? elem[0] : elem, this ); - }, - - add: function( selector, context ) { - var set = typeof selector === "string" ? - jQuery( selector, context ) : - jQuery.makeArray( selector && selector.nodeType ? [ selector ] : selector ), - all = jQuery.merge( this.get(), set ); - - return this.pushStack( isDisconnected( set[0] ) || isDisconnected( all[0] ) ? - all : - jQuery.unique( all ) ); - }, - - addBack: function( selector ) { - return this.add( selector == null ? - this.prevObject : this.prevObject.filter(selector) - ); - } -}); - -jQuery.fn.andSelf = jQuery.fn.addBack; - -// A painfully simple check to see if an element is disconnected -// from a document (should be improved, where feasible). -function isDisconnected( node ) { - return !node || !node.parentNode || node.parentNode.nodeType === 11; -} - -function sibling( cur, dir ) { - do { - cur = cur[ dir ]; - } while ( cur && cur.nodeType !== 1 ); - - return cur; -} - -jQuery.each({ - parent: function( elem ) { - var parent = elem.parentNode; - return parent && parent.nodeType !== 11 ? parent : null; - }, - parents: function( elem ) { - return jQuery.dir( elem, "parentNode" ); - }, - parentsUntil: function( elem, i, until ) { - return jQuery.dir( elem, "parentNode", until ); - }, - next: function( elem ) { - return sibling( elem, "nextSibling" ); - }, - prev: function( elem ) { - return sibling( elem, "previousSibling" ); - }, - nextAll: function( elem ) { - return jQuery.dir( elem, "nextSibling" ); - }, - prevAll: function( elem ) { - return jQuery.dir( elem, "previousSibling" ); - }, - nextUntil: function( elem, i, until ) { - return jQuery.dir( elem, "nextSibling", until ); - }, - prevUntil: function( elem, i, until ) { - return jQuery.dir( elem, "previousSibling", until ); - }, - siblings: function( elem ) { - return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem ); - }, - children: function( elem ) { - return jQuery.sibling( elem.firstChild ); - }, - contents: function( elem ) { - return jQuery.nodeName( elem, "iframe" ) ? - elem.contentDocument || elem.contentWindow.document : - jQuery.merge( [], elem.childNodes ); - } -}, function( name, fn ) { - jQuery.fn[ name ] = function( until, selector ) { - var ret = jQuery.map( this, fn, until ); - - if ( !runtil.test( name ) ) { - selector = until; - } - - if ( selector && typeof selector === "string" ) { - ret = jQuery.filter( selector, ret ); - } - - ret = this.length > 1 && !guaranteedUnique[ name ] ? jQuery.unique( ret ) : ret; - - if ( this.length > 1 && rparentsprev.test( name ) ) { - ret = ret.reverse(); - } - - return this.pushStack( ret, name, core_slice.call( arguments ).join(",") ); - }; -}); - -jQuery.extend({ - filter: function( expr, elems, not ) { - if ( not ) { - expr = ":not(" + expr + ")"; - } - - return elems.length === 1 ? - jQuery.find.matchesSelector(elems[0], expr) ? [ elems[0] ] : [] : - jQuery.find.matches(expr, elems); - }, - - dir: function( elem, dir, until ) { - var matched = [], - cur = elem[ dir ]; - - while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) { - if ( cur.nodeType === 1 ) { - matched.push( cur ); - } - cur = cur[dir]; - } - return matched; - }, - - sibling: function( n, elem ) { - var r = []; - - for ( ; n; n = n.nextSibling ) { - if ( n.nodeType === 1 && n !== elem ) { - r.push( n ); - } - } - - return r; - } -}); - -// Implement the identical functionality for filter and not -function winnow( elements, qualifier, keep ) { - - // Can't pass null or undefined to indexOf in Firefox 4 - // Set to 0 to skip string check - qualifier = qualifier || 0; - - if ( jQuery.isFunction( qualifier ) ) { - return jQuery.grep(elements, function( elem, i ) { - var retVal = !!qualifier.call( elem, i, elem ); - return retVal === keep; - }); - - } else if ( qualifier.nodeType ) { - return jQuery.grep(elements, function( elem, i ) { - return ( elem === qualifier ) === keep; - }); - - } else if ( typeof qualifier === "string" ) { - var filtered = jQuery.grep(elements, function( elem ) { - return elem.nodeType === 1; - }); - - if ( isSimple.test( qualifier ) ) { - return jQuery.filter(qualifier, filtered, !keep); - } else { - qualifier = jQuery.filter( qualifier, filtered ); - } - } - - return jQuery.grep(elements, function( elem, i ) { - return ( jQuery.inArray( elem, qualifier ) >= 0 ) === keep; - }); -} -function createSafeFragment( document ) { - var list = nodeNames.split( "|" ), - safeFrag = document.createDocumentFragment(); - - if ( safeFrag.createElement ) { - while ( list.length ) { - safeFrag.createElement( - list.pop() - ); - } - } - return safeFrag; -} - -var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|" + - "header|hgroup|mark|meter|nav|output|progress|section|summary|time|video", - rinlinejQuery = / jQuery\d+="(?:null|\d+)"/g, - rleadingWhitespace = /^\s+/, - rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi, - rtagName = /<([\w:]+)/, - rtbody = /]", "i"), - rcheckableType = /^(?:checkbox|radio)$/, - // checked="checked" or checked - rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i, - rscriptType = /\/(java|ecma)script/i, - rcleanScript = /^\s*\s*$/g, - wrapMap = { - option: [ 1, "" ], - legend: [ 1, "
                          ", "
                          " ], - thead: [ 1, "", "
                          " ], - tr: [ 2, "", "
                          " ], - td: [ 3, "", "
                          " ], - col: [ 2, "", "
                          " ], - area: [ 1, "", "" ], - _default: [ 0, "", "" ] - }, - safeFragment = createSafeFragment( document ), - fragmentDiv = safeFragment.appendChild( document.createElement("div") ); - -wrapMap.optgroup = wrapMap.option; -wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; -wrapMap.th = wrapMap.td; - -// IE6-8 can't serialize link, script, style, or any html5 (NoScope) tags, -// unless wrapped in a div with non-breaking characters in front of it. -if ( !jQuery.support.htmlSerialize ) { - wrapMap._default = [ 1, "X
                          ", "
                          " ]; -} - -jQuery.fn.extend({ - text: function( value ) { - return jQuery.access( this, function( value ) { - return value === undefined ? - jQuery.text( this ) : - this.empty().append( ( this[0] && this[0].ownerDocument || document ).createTextNode( value ) ); - }, null, value, arguments.length ); - }, - - wrapAll: function( html ) { - if ( jQuery.isFunction( html ) ) { - return this.each(function(i) { - jQuery(this).wrapAll( html.call(this, i) ); - }); - } - - if ( this[0] ) { - // The elements to wrap the target around - var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true); - - if ( this[0].parentNode ) { - wrap.insertBefore( this[0] ); - } - - wrap.map(function() { - var elem = this; - - while ( elem.firstChild && elem.firstChild.nodeType === 1 ) { - elem = elem.firstChild; - } - - return elem; - }).append( this ); - } - - return this; - }, - - wrapInner: function( html ) { - if ( jQuery.isFunction( html ) ) { - return this.each(function(i) { - jQuery(this).wrapInner( html.call(this, i) ); - }); - } - - return this.each(function() { - var self = jQuery( this ), - contents = self.contents(); - - if ( contents.length ) { - contents.wrapAll( html ); - - } else { - self.append( html ); - } - }); - }, - - wrap: function( html ) { - var isFunction = jQuery.isFunction( html ); - - return this.each(function(i) { - jQuery( this ).wrapAll( isFunction ? html.call(this, i) : html ); - }); - }, - - unwrap: function() { - return this.parent().each(function() { - if ( !jQuery.nodeName( this, "body" ) ) { - jQuery( this ).replaceWith( this.childNodes ); - } - }).end(); - }, - - append: function() { - return this.domManip(arguments, true, function( elem ) { - if ( this.nodeType === 1 || this.nodeType === 11 ) { - this.appendChild( elem ); - } - }); - }, - - prepend: function() { - return this.domManip(arguments, true, function( elem ) { - if ( this.nodeType === 1 || this.nodeType === 11 ) { - this.insertBefore( elem, this.firstChild ); - } - }); - }, - - before: function() { - if ( !isDisconnected( this[0] ) ) { - return this.domManip(arguments, false, function( elem ) { - this.parentNode.insertBefore( elem, this ); - }); - } - - if ( arguments.length ) { - var set = jQuery.clean( arguments ); - return this.pushStack( jQuery.merge( set, this ), "before", this.selector ); - } - }, - - after: function() { - if ( !isDisconnected( this[0] ) ) { - return this.domManip(arguments, false, function( elem ) { - this.parentNode.insertBefore( elem, this.nextSibling ); - }); - } - - if ( arguments.length ) { - var set = jQuery.clean( arguments ); - return this.pushStack( jQuery.merge( this, set ), "after", this.selector ); - } - }, - - // keepData is for internal use only--do not document - remove: function( selector, keepData ) { - var elem, - i = 0; - - for ( ; (elem = this[i]) != null; i++ ) { - if ( !selector || jQuery.filter( selector, [ elem ] ).length ) { - if ( !keepData && elem.nodeType === 1 ) { - jQuery.cleanData( elem.getElementsByTagName("*") ); - jQuery.cleanData( [ elem ] ); - } - - if ( elem.parentNode ) { - elem.parentNode.removeChild( elem ); - } - } - } - - return this; - }, - - empty: function() { - var elem, - i = 0; - - for ( ; (elem = this[i]) != null; i++ ) { - // Remove element nodes and prevent memory leaks - if ( elem.nodeType === 1 ) { - jQuery.cleanData( elem.getElementsByTagName("*") ); - } - - // Remove any remaining nodes - while ( elem.firstChild ) { - elem.removeChild( elem.firstChild ); - } - } - - return this; - }, - - clone: function( dataAndEvents, deepDataAndEvents ) { - dataAndEvents = dataAndEvents == null ? false : dataAndEvents; - deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; - - return this.map( function () { - return jQuery.clone( this, dataAndEvents, deepDataAndEvents ); - }); - }, - - html: function( value ) { - return jQuery.access( this, function( value ) { - var elem = this[0] || {}, - i = 0, - l = this.length; - - if ( value === undefined ) { - return elem.nodeType === 1 ? - elem.innerHTML.replace( rinlinejQuery, "" ) : - undefined; - } - - // See if we can take a shortcut and just use innerHTML - if ( typeof value === "string" && !rnoInnerhtml.test( value ) && - ( jQuery.support.htmlSerialize || !rnoshimcache.test( value ) ) && - ( jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value ) ) && - !wrapMap[ ( rtagName.exec( value ) || ["", ""] )[1].toLowerCase() ] ) { - - value = value.replace( rxhtmlTag, "<$1>" ); - - try { - for (; i < l; i++ ) { - // Remove element nodes and prevent memory leaks - elem = this[i] || {}; - if ( elem.nodeType === 1 ) { - jQuery.cleanData( elem.getElementsByTagName( "*" ) ); - elem.innerHTML = value; - } - } - - elem = 0; - - // If using innerHTML throws an exception, use the fallback method - } catch(e) {} - } - - if ( elem ) { - this.empty().append( value ); - } - }, null, value, arguments.length ); - }, - - replaceWith: function( value ) { - if ( !isDisconnected( this[0] ) ) { - // Make sure that the elements are removed from the DOM before they are inserted - // this can help fix replacing a parent with child elements - if ( jQuery.isFunction( value ) ) { - return this.each(function(i) { - var self = jQuery(this), old = self.html(); - self.replaceWith( value.call( this, i, old ) ); - }); - } - - if ( typeof value !== "string" ) { - value = jQuery( value ).detach(); - } - - return this.each(function() { - var next = this.nextSibling, - parent = this.parentNode; - - jQuery( this ).remove(); - - if ( next ) { - jQuery(next).before( value ); - } else { - jQuery(parent).append( value ); - } - }); - } - - return this.length ? - this.pushStack( jQuery(jQuery.isFunction(value) ? value() : value), "replaceWith", value ) : - this; - }, - - detach: function( selector ) { - return this.remove( selector, true ); - }, - - domManip: function( args, table, callback ) { - - // Flatten any nested arrays - args = [].concat.apply( [], args ); - - var results, first, fragment, iNoClone, - i = 0, - value = args[0], - scripts = [], - l = this.length; - - // We can't cloneNode fragments that contain checked, in WebKit - if ( !jQuery.support.checkClone && l > 1 && typeof value === "string" && rchecked.test( value ) ) { - return this.each(function() { - jQuery(this).domManip( args, table, callback ); - }); - } - - if ( jQuery.isFunction(value) ) { - return this.each(function(i) { - var self = jQuery(this); - args[0] = value.call( this, i, table ? self.html() : undefined ); - self.domManip( args, table, callback ); - }); - } - - if ( this[0] ) { - results = jQuery.buildFragment( args, this, scripts ); - fragment = results.fragment; - first = fragment.firstChild; - - if ( fragment.childNodes.length === 1 ) { - fragment = first; - } - - if ( first ) { - table = table && jQuery.nodeName( first, "tr" ); - - // Use the original fragment for the last item instead of the first because it can end up - // being emptied incorrectly in certain situations (#8070). - // Fragments from the fragment cache must always be cloned and never used in place. - for ( iNoClone = results.cacheable || l - 1; i < l; i++ ) { - callback.call( - table && jQuery.nodeName( this[i], "table" ) ? - findOrAppend( this[i], "tbody" ) : - this[i], - i === iNoClone ? - fragment : - jQuery.clone( fragment, true, true ) - ); - } - } - - // Fix #11809: Avoid leaking memory - fragment = first = null; - - if ( scripts.length ) { - jQuery.each( scripts, function( i, elem ) { - if ( elem.src ) { - if ( jQuery.ajax ) { - jQuery.ajax({ - url: elem.src, - type: "GET", - dataType: "script", - async: false, - global: false, - "throws": true - }); - } else { - jQuery.error("no ajax"); - } - } else { - jQuery.globalEval( ( elem.text || elem.textContent || elem.innerHTML || "" ).replace( rcleanScript, "" ) ); - } - - if ( elem.parentNode ) { - elem.parentNode.removeChild( elem ); - } - }); - } - } - - return this; - } -}); - -function findOrAppend( elem, tag ) { - return elem.getElementsByTagName( tag )[0] || elem.appendChild( elem.ownerDocument.createElement( tag ) ); -} - -function cloneCopyEvent( src, dest ) { - - if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) { - return; - } - - var type, i, l, - oldData = jQuery._data( src ), - curData = jQuery._data( dest, oldData ), - events = oldData.events; - - if ( events ) { - delete curData.handle; - curData.events = {}; - - for ( type in events ) { - for ( i = 0, l = events[ type ].length; i < l; i++ ) { - jQuery.event.add( dest, type, events[ type ][ i ] ); - } - } - } - - // make the cloned public data object a copy from the original - if ( curData.data ) { - curData.data = jQuery.extend( {}, curData.data ); - } -} - -function cloneFixAttributes( src, dest ) { - var nodeName; - - // We do not need to do anything for non-Elements - if ( dest.nodeType !== 1 ) { - return; - } - - // clearAttributes removes the attributes, which we don't want, - // but also removes the attachEvent events, which we *do* want - if ( dest.clearAttributes ) { - dest.clearAttributes(); - } - - // mergeAttributes, in contrast, only merges back on the - // original attributes, not the events - if ( dest.mergeAttributes ) { - dest.mergeAttributes( src ); - } - - nodeName = dest.nodeName.toLowerCase(); - - if ( nodeName === "object" ) { - // IE6-10 improperly clones children of object elements using classid. - // IE10 throws NoModificationAllowedError if parent is null, #12132. - if ( dest.parentNode ) { - dest.outerHTML = src.outerHTML; - } - - // This path appears unavoidable for IE9. When cloning an object - // element in IE9, the outerHTML strategy above is not sufficient. - // If the src has innerHTML and the destination does not, - // copy the src.innerHTML into the dest.innerHTML. #10324 - if ( jQuery.support.html5Clone && (src.innerHTML && !jQuery.trim(dest.innerHTML)) ) { - dest.innerHTML = src.innerHTML; - } - - } else if ( nodeName === "input" && rcheckableType.test( src.type ) ) { - // IE6-8 fails to persist the checked state of a cloned checkbox - // or radio button. Worse, IE6-7 fail to give the cloned element - // a checked appearance if the defaultChecked value isn't also set - - dest.defaultChecked = dest.checked = src.checked; - - // IE6-7 get confused and end up setting the value of a cloned - // checkbox/radio button to an empty string instead of "on" - if ( dest.value !== src.value ) { - dest.value = src.value; - } - - // IE6-8 fails to return the selected option to the default selected - // state when cloning options - } else if ( nodeName === "option" ) { - dest.selected = src.defaultSelected; - - // IE6-8 fails to set the defaultValue to the correct value when - // cloning other types of input fields - } else if ( nodeName === "input" || nodeName === "textarea" ) { - dest.defaultValue = src.defaultValue; - - // IE blanks contents when cloning scripts - } else if ( nodeName === "script" && dest.text !== src.text ) { - dest.text = src.text; - } - - // Event data gets referenced instead of copied if the expando - // gets copied too - dest.removeAttribute( jQuery.expando ); -} - -jQuery.buildFragment = function( args, context, scripts ) { - var fragment, cacheable, cachehit, - first = args[ 0 ]; - - // Set context from what may come in as undefined or a jQuery collection or a node - // Updated to fix #12266 where accessing context[0] could throw an exception in IE9/10 & - // also doubles as fix for #8950 where plain objects caused createDocumentFragment exception - context = context || document; - context = !context.nodeType && context[0] || context; - context = context.ownerDocument || context; - - // Only cache "small" (1/2 KB) HTML strings that are associated with the main document - // Cloning options loses the selected state, so don't cache them - // IE 6 doesn't like it when you put or elements in a fragment - // Also, WebKit does not clone 'checked' attributes on cloneNode, so don't cache - // Lastly, IE6,7,8 will not correctly reuse cached fragments that were created from unknown elems #10501 - if ( args.length === 1 && typeof first === "string" && first.length < 512 && context === document && - first.charAt(0) === "<" && !rnocache.test( first ) && - (jQuery.support.checkClone || !rchecked.test( first )) && - (jQuery.support.html5Clone || !rnoshimcache.test( first )) ) { - - // Mark cacheable and look for a hit - cacheable = true; - fragment = jQuery.fragments[ first ]; - cachehit = fragment !== undefined; - } - - if ( !fragment ) { - fragment = context.createDocumentFragment(); - jQuery.clean( args, context, fragment, scripts ); - - // Update the cache, but only store false - // unless this is a second parsing of the same content - if ( cacheable ) { - jQuery.fragments[ first ] = cachehit && fragment; - } - } - - return { fragment: fragment, cacheable: cacheable }; -}; - -jQuery.fragments = {}; - -jQuery.each({ - appendTo: "append", - prependTo: "prepend", - insertBefore: "before", - insertAfter: "after", - replaceAll: "replaceWith" -}, function( name, original ) { - jQuery.fn[ name ] = function( selector ) { - var elems, - i = 0, - ret = [], - insert = jQuery( selector ), - l = insert.length, - parent = this.length === 1 && this[0].parentNode; - - if ( (parent == null || parent && parent.nodeType === 11 && parent.childNodes.length === 1) && l === 1 ) { - insert[ original ]( this[0] ); - return this; - } else { - for ( ; i < l; i++ ) { - elems = ( i > 0 ? this.clone(true) : this ).get(); - jQuery( insert[i] )[ original ]( elems ); - ret = ret.concat( elems ); - } - - return this.pushStack( ret, name, insert.selector ); - } - }; -}); - -function getAll( elem ) { - if ( typeof elem.getElementsByTagName !== "undefined" ) { - return elem.getElementsByTagName( "*" ); - - } else if ( typeof elem.querySelectorAll !== "undefined" ) { - return elem.querySelectorAll( "*" ); - - } else { - return []; - } -} - -// Used in clean, fixes the defaultChecked property -function fixDefaultChecked( elem ) { - if ( rcheckableType.test( elem.type ) ) { - elem.defaultChecked = elem.checked; - } -} - -jQuery.extend({ - clone: function( elem, dataAndEvents, deepDataAndEvents ) { - var srcElements, - destElements, - i, - clone; - - if ( jQuery.support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test( "<" + elem.nodeName + ">" ) ) { - clone = elem.cloneNode( true ); - - // IE<=8 does not properly clone detached, unknown element nodes - } else { - fragmentDiv.innerHTML = elem.outerHTML; - fragmentDiv.removeChild( clone = fragmentDiv.firstChild ); - } - - if ( (!jQuery.support.noCloneEvent || !jQuery.support.noCloneChecked) && - (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) { - // IE copies events bound via attachEvent when using cloneNode. - // Calling detachEvent on the clone will also remove the events - // from the original. In order to get around this, we use some - // proprietary methods to clear the events. Thanks to MooTools - // guys for this hotness. - - cloneFixAttributes( elem, clone ); - - // Using Sizzle here is crazy slow, so we use getElementsByTagName instead - srcElements = getAll( elem ); - destElements = getAll( clone ); - - // Weird iteration because IE will replace the length property - // with an element if you are cloning the body and one of the - // elements on the page has a name or id of "length" - for ( i = 0; srcElements[i]; ++i ) { - // Ensure that the destination node is not null; Fixes #9587 - if ( destElements[i] ) { - cloneFixAttributes( srcElements[i], destElements[i] ); - } - } - } - - // Copy the events from the original to the clone - if ( dataAndEvents ) { - cloneCopyEvent( elem, clone ); - - if ( deepDataAndEvents ) { - srcElements = getAll( elem ); - destElements = getAll( clone ); - - for ( i = 0; srcElements[i]; ++i ) { - cloneCopyEvent( srcElements[i], destElements[i] ); - } - } - } - - srcElements = destElements = null; - - // Return the cloned set - return clone; - }, - - clean: function( elems, context, fragment, scripts ) { - var i, j, elem, tag, wrap, depth, div, hasBody, tbody, len, handleScript, jsTags, - safe = context === document && safeFragment, - ret = []; - - // Ensure that context is a document - if ( !context || typeof context.createDocumentFragment === "undefined" ) { - context = document; - } - - // Use the already-created safe fragment if context permits - for ( i = 0; (elem = elems[i]) != null; i++ ) { - if ( typeof elem === "number" ) { - elem += ""; - } - - if ( !elem ) { - continue; - } - - // Convert html string into DOM nodes - if ( typeof elem === "string" ) { - if ( !rhtml.test( elem ) ) { - elem = context.createTextNode( elem ); - } else { - // Ensure a safe container in which to render the html - safe = safe || createSafeFragment( context ); - div = context.createElement("div"); - safe.appendChild( div ); - - // Fix "XHTML"-style tags in all browsers - elem = elem.replace(rxhtmlTag, "<$1>"); - - // Go to html and back, then peel off extra wrappers - tag = ( rtagName.exec( elem ) || ["", ""] )[1].toLowerCase(); - wrap = wrapMap[ tag ] || wrapMap._default; - depth = wrap[0]; - div.innerHTML = wrap[1] + elem + wrap[2]; - - // Move to the right depth - while ( depth-- ) { - div = div.lastChild; - } - - // Remove IE's autoinserted from table fragments - if ( !jQuery.support.tbody ) { - - // String was a , *may* have spurious - hasBody = rtbody.test(elem); - tbody = tag === "table" && !hasBody ? - div.firstChild && div.firstChild.childNodes : - - // String was a bare or - wrap[1] === "
                          " && !hasBody ? - div.childNodes : - []; - - for ( j = tbody.length - 1; j >= 0 ; --j ) { - if ( jQuery.nodeName( tbody[ j ], "tbody" ) && !tbody[ j ].childNodes.length ) { - tbody[ j ].parentNode.removeChild( tbody[ j ] ); - } - } - } - - // IE completely kills leading whitespace when innerHTML is used - if ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) { - div.insertBefore( context.createTextNode( rleadingWhitespace.exec(elem)[0] ), div.firstChild ); - } - - elem = div.childNodes; - - // Take out of fragment container (we need a fresh div each time) - div.parentNode.removeChild( div ); - } - } - - if ( elem.nodeType ) { - ret.push( elem ); - } else { - jQuery.merge( ret, elem ); - } - } - - // Fix #11356: Clear elements from safeFragment - if ( div ) { - elem = div = safe = null; - } - - // Reset defaultChecked for any radios and checkboxes - // about to be appended to the DOM in IE 6/7 (#8060) - if ( !jQuery.support.appendChecked ) { - for ( i = 0; (elem = ret[i]) != null; i++ ) { - if ( jQuery.nodeName( elem, "input" ) ) { - fixDefaultChecked( elem ); - } else if ( typeof elem.getElementsByTagName !== "undefined" ) { - jQuery.grep( elem.getElementsByTagName("input"), fixDefaultChecked ); - } - } - } - - // Append elements to a provided document fragment - if ( fragment ) { - // Special handling of each script element - handleScript = function( elem ) { - // Check if we consider it executable - if ( !elem.type || rscriptType.test( elem.type ) ) { - // Detach the script and store it in the scripts array (if provided) or the fragment - // Return truthy to indicate that it has been handled - return scripts ? - scripts.push( elem.parentNode ? elem.parentNode.removeChild( elem ) : elem ) : - fragment.appendChild( elem ); - } - }; - - for ( i = 0; (elem = ret[i]) != null; i++ ) { - // Check if we're done after handling an executable script - if ( !( jQuery.nodeName( elem, "script" ) && handleScript( elem ) ) ) { - // Append to fragment and handle embedded scripts - fragment.appendChild( elem ); - if ( typeof elem.getElementsByTagName !== "undefined" ) { - // handleScript alters the DOM, so use jQuery.merge to ensure snapshot iteration - jsTags = jQuery.grep( jQuery.merge( [], elem.getElementsByTagName("script") ), handleScript ); - - // Splice the scripts into ret after their former ancestor and advance our index beyond them - ret.splice.apply( ret, [i + 1, 0].concat( jsTags ) ); - i += jsTags.length; - } - } - } - } - - return ret; - }, - - cleanData: function( elems, /* internal */ acceptData ) { - var data, id, elem, type, - i = 0, - internalKey = jQuery.expando, - cache = jQuery.cache, - deleteExpando = jQuery.support.deleteExpando, - special = jQuery.event.special; - - for ( ; (elem = elems[i]) != null; i++ ) { - - if ( acceptData || jQuery.acceptData( elem ) ) { - - id = elem[ internalKey ]; - data = id && cache[ id ]; - - if ( data ) { - if ( data.events ) { - for ( type in data.events ) { - if ( special[ type ] ) { - jQuery.event.remove( elem, type ); - - // This is a shortcut to avoid jQuery.event.remove's overhead - } else { - jQuery.removeEvent( elem, type, data.handle ); - } - } - } - - // Remove cache only if it was not already removed by jQuery.event.remove - if ( cache[ id ] ) { - - delete cache[ id ]; - - // IE does not allow us to delete expando properties from nodes, - // nor does it have a removeAttribute function on Document nodes; - // we must handle all of these cases - if ( deleteExpando ) { - delete elem[ internalKey ]; - - } else if ( elem.removeAttribute ) { - elem.removeAttribute( internalKey ); - - } else { - elem[ internalKey ] = null; - } - - jQuery.deletedIds.push( id ); - } - } - } - } - } -}); -// Limit scope pollution from any deprecated API -(function() { - -var matched, browser; - -// Use of jQuery.browser is frowned upon. -// More details: http://api.jquery.com/jQuery.browser -// jQuery.uaMatch maintained for back-compat -jQuery.uaMatch = function( ua ) { - ua = ua.toLowerCase(); - - var match = /(chrome)[ \/]([\w.]+)/.exec( ua ) || - /(webkit)[ \/]([\w.]+)/.exec( ua ) || - /(opera)(?:.*version|)[ \/]([\w.]+)/.exec( ua ) || - /(msie) ([\w.]+)/.exec( ua ) || - ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec( ua ) || - []; - - return { - browser: match[ 1 ] || "", - version: match[ 2 ] || "0" - }; -}; - -matched = jQuery.uaMatch( navigator.userAgent ); -browser = {}; - -if ( matched.browser ) { - browser[ matched.browser ] = true; - browser.version = matched.version; -} - -// Chrome is Webkit, but Webkit is also Safari. -if ( browser.chrome ) { - browser.webkit = true; -} else if ( browser.webkit ) { - browser.safari = true; -} - -jQuery.browser = browser; - -jQuery.sub = function() { - function jQuerySub( selector, context ) { - return new jQuerySub.fn.init( selector, context ); - } - jQuery.extend( true, jQuerySub, this ); - jQuerySub.superclass = this; - jQuerySub.fn = jQuerySub.prototype = this(); - jQuerySub.fn.constructor = jQuerySub; - jQuerySub.sub = this.sub; - jQuerySub.fn.init = function init( selector, context ) { - if ( context && context instanceof jQuery && !(context instanceof jQuerySub) ) { - context = jQuerySub( context ); - } - - return jQuery.fn.init.call( this, selector, context, rootjQuerySub ); - }; - jQuerySub.fn.init.prototype = jQuerySub.fn; - var rootjQuerySub = jQuerySub(document); - return jQuerySub; -}; - -})(); -var curCSS, iframe, iframeDoc, - ralpha = /alpha\([^)]*\)/i, - ropacity = /opacity=([^)]*)/, - rposition = /^(top|right|bottom|left)$/, - // swappable if display is none or starts with table except "table", "table-cell", or "table-caption" - // see here for display values: https://developer.mozilla.org/en-US/docs/CSS/display - rdisplayswap = /^(none|table(?!-c[ea]).+)/, - rmargin = /^margin/, - rnumsplit = new RegExp( "^(" + core_pnum + ")(.*)$", "i" ), - rnumnonpx = new RegExp( "^(" + core_pnum + ")(?!px)[a-z%]+$", "i" ), - rrelNum = new RegExp( "^([-+])=(" + core_pnum + ")", "i" ), - elemdisplay = { BODY: "block" }, - - cssShow = { position: "absolute", visibility: "hidden", display: "block" }, - cssNormalTransform = { - letterSpacing: 0, - fontWeight: 400 - }, - - cssExpand = [ "Top", "Right", "Bottom", "Left" ], - cssPrefixes = [ "Webkit", "O", "Moz", "ms" ], - - eventsToggle = jQuery.fn.toggle; - -// return a css property mapped to a potentially vendor prefixed property -function vendorPropName( style, name ) { - - // shortcut for names that are not vendor prefixed - if ( name in style ) { - return name; - } - - // check for vendor prefixed names - var capName = name.charAt(0).toUpperCase() + name.slice(1), - origName = name, - i = cssPrefixes.length; - - while ( i-- ) { - name = cssPrefixes[ i ] + capName; - if ( name in style ) { - return name; - } - } - - return origName; -} - -function isHidden( elem, el ) { - elem = el || elem; - return jQuery.css( elem, "display" ) === "none" || !jQuery.contains( elem.ownerDocument, elem ); -} - -function showHide( elements, show ) { - var elem, display, - values = [], - index = 0, - length = elements.length; - - for ( ; index < length; index++ ) { - elem = elements[ index ]; - if ( !elem.style ) { - continue; - } - values[ index ] = jQuery._data( elem, "olddisplay" ); - if ( show ) { - // Reset the inline display of this element to learn if it is - // being hidden by cascaded rules or not - if ( !values[ index ] && elem.style.display === "none" ) { - elem.style.display = ""; - } - - // Set elements which have been overridden with display: none - // in a stylesheet to whatever the default browser style is - // for such an element - if ( elem.style.display === "" && isHidden( elem ) ) { - values[ index ] = jQuery._data( elem, "olddisplay", css_defaultDisplay(elem.nodeName) ); - } - } else { - display = curCSS( elem, "display" ); - - if ( !values[ index ] && display !== "none" ) { - jQuery._data( elem, "olddisplay", display ); - } - } - } - - // Set the display of most of the elements in a second loop - // to avoid the constant reflow - for ( index = 0; index < length; index++ ) { - elem = elements[ index ]; - if ( !elem.style ) { - continue; - } - if ( !show || elem.style.display === "none" || elem.style.display === "" ) { - elem.style.display = show ? values[ index ] || "" : "none"; - } - } - - return elements; -} - -jQuery.fn.extend({ - css: function( name, value ) { - return jQuery.access( this, function( elem, name, value ) { - return value !== undefined ? - jQuery.style( elem, name, value ) : - jQuery.css( elem, name ); - }, name, value, arguments.length > 1 ); - }, - show: function() { - return showHide( this, true ); - }, - hide: function() { - return showHide( this ); - }, - toggle: function( state, fn2 ) { - var bool = typeof state === "boolean"; - - if ( jQuery.isFunction( state ) && jQuery.isFunction( fn2 ) ) { - return eventsToggle.apply( this, arguments ); - } - - return this.each(function() { - if ( bool ? state : isHidden( this ) ) { - jQuery( this ).show(); - } else { - jQuery( this ).hide(); - } - }); - } -}); - -jQuery.extend({ - // Add in style property hooks for overriding the default - // behavior of getting and setting a style property - cssHooks: { - opacity: { - get: function( elem, computed ) { - if ( computed ) { - // We should always get a number back from opacity - var ret = curCSS( elem, "opacity" ); - return ret === "" ? "1" : ret; - - } - } - } - }, - - // Exclude the following css properties to add px - cssNumber: { - "fillOpacity": true, - "fontWeight": true, - "lineHeight": true, - "opacity": true, - "orphans": true, - "widows": true, - "zIndex": true, - "zoom": true - }, - - // Add in properties whose names you wish to fix before - // setting or getting the value - cssProps: { - // normalize float css property - "float": jQuery.support.cssFloat ? "cssFloat" : "styleFloat" - }, - - // Get and set the style property on a DOM Node - style: function( elem, name, value, extra ) { - // Don't set styles on text and comment nodes - if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) { - return; - } - - // Make sure that we're working with the right name - var ret, type, hooks, - origName = jQuery.camelCase( name ), - style = elem.style; - - name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( style, origName ) ); - - // gets hook for the prefixed version - // followed by the unprefixed version - hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; - - // Check if we're setting a value - if ( value !== undefined ) { - type = typeof value; - - // convert relative number strings (+= or -=) to relative numbers. #7345 - if ( type === "string" && (ret = rrelNum.exec( value )) ) { - value = ( ret[1] + 1 ) * ret[2] + parseFloat( jQuery.css( elem, name ) ); - // Fixes bug #9237 - type = "number"; - } - - // Make sure that NaN and null values aren't set. See: #7116 - if ( value == null || type === "number" && isNaN( value ) ) { - return; - } - - // If a number was passed in, add 'px' to the (except for certain CSS properties) - if ( type === "number" && !jQuery.cssNumber[ origName ] ) { - value += "px"; - } - - // If a hook was provided, use that value, otherwise just set the specified value - if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value, extra )) !== undefined ) { - // Wrapped to prevent IE from throwing errors when 'invalid' values are provided - // Fixes bug #5509 - try { - style[ name ] = value; - } catch(e) {} - } - - } else { - // If a hook was provided get the non-computed value from there - if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) { - return ret; - } - - // Otherwise just get the value from the style object - return style[ name ]; - } - }, - - css: function( elem, name, numeric, extra ) { - var val, num, hooks, - origName = jQuery.camelCase( name ); - - // Make sure that we're working with the right name - name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( elem.style, origName ) ); - - // gets hook for the prefixed version - // followed by the unprefixed version - hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; - - // If a hook was provided get the computed value from there - if ( hooks && "get" in hooks ) { - val = hooks.get( elem, true, extra ); - } - - // Otherwise, if a way to get the computed value exists, use that - if ( val === undefined ) { - val = curCSS( elem, name ); - } - - //convert "normal" to computed value - if ( val === "normal" && name in cssNormalTransform ) { - val = cssNormalTransform[ name ]; - } - - // Return, converting to number if forced or a qualifier was provided and val looks numeric - if ( numeric || extra !== undefined ) { - num = parseFloat( val ); - return numeric || jQuery.isNumeric( num ) ? num || 0 : val; - } - return val; - }, - - // A method for quickly swapping in/out CSS properties to get correct calculations - swap: function( elem, options, callback ) { - var ret, name, - old = {}; - - // Remember the old values, and insert the new ones - for ( name in options ) { - old[ name ] = elem.style[ name ]; - elem.style[ name ] = options[ name ]; - } - - ret = callback.call( elem ); - - // Revert the old values - for ( name in options ) { - elem.style[ name ] = old[ name ]; - } - - return ret; - } -}); - -// NOTE: To any future maintainer, we've window.getComputedStyle -// because jsdom on node.js will break without it. -if ( window.getComputedStyle ) { - curCSS = function( elem, name ) { - var ret, width, minWidth, maxWidth, - computed = window.getComputedStyle( elem, null ), - style = elem.style; - - if ( computed ) { - - // getPropertyValue is only needed for .css('filter') in IE9, see #12537 - ret = computed.getPropertyValue( name ) || computed[ name ]; - - if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) { - ret = jQuery.style( elem, name ); - } - - // A tribute to the "awesome hack by Dean Edwards" - // Chrome < 17 and Safari 5.0 uses "computed value" instead of "used value" for margin-right - // Safari 5.1.7 (at least) returns percentage for a larger set of values, but width seems to be reliably pixels - // this is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values - if ( rnumnonpx.test( ret ) && rmargin.test( name ) ) { - width = style.width; - minWidth = style.minWidth; - maxWidth = style.maxWidth; - - style.minWidth = style.maxWidth = style.width = ret; - ret = computed.width; - - style.width = width; - style.minWidth = minWidth; - style.maxWidth = maxWidth; - } - } - - return ret; - }; -} else if ( document.documentElement.currentStyle ) { - curCSS = function( elem, name ) { - var left, rsLeft, - ret = elem.currentStyle && elem.currentStyle[ name ], - style = elem.style; - - // Avoid setting ret to empty string here - // so we don't default to auto - if ( ret == null && style && style[ name ] ) { - ret = style[ name ]; - } - - // From the awesome hack by Dean Edwards - // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291 - - // If we're not dealing with a regular pixel number - // but a number that has a weird ending, we need to convert it to pixels - // but not position css attributes, as those are proportional to the parent element instead - // and we can't measure the parent instead because it might trigger a "stacking dolls" problem - if ( rnumnonpx.test( ret ) && !rposition.test( name ) ) { - - // Remember the original values - left = style.left; - rsLeft = elem.runtimeStyle && elem.runtimeStyle.left; - - // Put in the new values to get a computed value out - if ( rsLeft ) { - elem.runtimeStyle.left = elem.currentStyle.left; - } - style.left = name === "fontSize" ? "1em" : ret; - ret = style.pixelLeft + "px"; - - // Revert the changed values - style.left = left; - if ( rsLeft ) { - elem.runtimeStyle.left = rsLeft; - } - } - - return ret === "" ? "auto" : ret; - }; -} - -function setPositiveNumber( elem, value, subtract ) { - var matches = rnumsplit.exec( value ); - return matches ? - Math.max( 0, matches[ 1 ] - ( subtract || 0 ) ) + ( matches[ 2 ] || "px" ) : - value; -} - -function augmentWidthOrHeight( elem, name, extra, isBorderBox ) { - var i = extra === ( isBorderBox ? "border" : "content" ) ? - // If we already have the right measurement, avoid augmentation - 4 : - // Otherwise initialize for horizontal or vertical properties - name === "width" ? 1 : 0, - - val = 0; - - for ( ; i < 4; i += 2 ) { - // both box models exclude margin, so add it if we want it - if ( extra === "margin" ) { - // we use jQuery.css instead of curCSS here - // because of the reliableMarginRight CSS hook! - val += jQuery.css( elem, extra + cssExpand[ i ], true ); - } - - // From this point on we use curCSS for maximum performance (relevant in animations) - if ( isBorderBox ) { - // border-box includes padding, so remove it if we want content - if ( extra === "content" ) { - val -= parseFloat( curCSS( elem, "padding" + cssExpand[ i ] ) ) || 0; - } - - // at this point, extra isn't border nor margin, so remove border - if ( extra !== "margin" ) { - val -= parseFloat( curCSS( elem, "border" + cssExpand[ i ] + "Width" ) ) || 0; - } - } else { - // at this point, extra isn't content, so add padding - val += parseFloat( curCSS( elem, "padding" + cssExpand[ i ] ) ) || 0; - - // at this point, extra isn't content nor padding, so add border - if ( extra !== "padding" ) { - val += parseFloat( curCSS( elem, "border" + cssExpand[ i ] + "Width" ) ) || 0; - } - } - } - - return val; -} - -function getWidthOrHeight( elem, name, extra ) { - - // Start with offset property, which is equivalent to the border-box value - var val = name === "width" ? elem.offsetWidth : elem.offsetHeight, - valueIsBorderBox = true, - isBorderBox = jQuery.support.boxSizing && jQuery.css( elem, "boxSizing" ) === "border-box"; - - // some non-html elements return undefined for offsetWidth, so check for null/undefined - // svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285 - // MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668 - if ( val <= 0 || val == null ) { - // Fall back to computed then uncomputed css if necessary - val = curCSS( elem, name ); - if ( val < 0 || val == null ) { - val = elem.style[ name ]; - } - - // Computed unit is not pixels. Stop here and return. - if ( rnumnonpx.test(val) ) { - return val; - } - - // we need the check for style in case a browser which returns unreliable values - // for getComputedStyle silently falls back to the reliable elem.style - valueIsBorderBox = isBorderBox && ( jQuery.support.boxSizingReliable || val === elem.style[ name ] ); - - // Normalize "", auto, and prepare for extra - val = parseFloat( val ) || 0; - } - - // use the active box-sizing model to add/subtract irrelevant styles - return ( val + - augmentWidthOrHeight( - elem, - name, - extra || ( isBorderBox ? "border" : "content" ), - valueIsBorderBox - ) - ) + "px"; -} - - -// Try to determine the default display value of an element -function css_defaultDisplay( nodeName ) { - if ( elemdisplay[ nodeName ] ) { - return elemdisplay[ nodeName ]; - } - - var elem = jQuery( "<" + nodeName + ">" ).appendTo( document.body ), - display = elem.css("display"); - elem.remove(); - - // If the simple way fails, - // get element's real default display by attaching it to a temp iframe - if ( display === "none" || display === "" ) { - // Use the already-created iframe if possible - iframe = document.body.appendChild( - iframe || jQuery.extend( document.createElement("iframe"), { - frameBorder: 0, - width: 0, - height: 0 - }) - ); - - // Create a cacheable copy of the iframe document on first call. - // IE and Opera will allow us to reuse the iframeDoc without re-writing the fake HTML - // document to it; WebKit & Firefox won't allow reusing the iframe document. - if ( !iframeDoc || !iframe.createElement ) { - iframeDoc = ( iframe.contentWindow || iframe.contentDocument ).document; - iframeDoc.write(""); - iframeDoc.close(); - } - - elem = iframeDoc.body.appendChild( iframeDoc.createElement(nodeName) ); - - display = curCSS( elem, "display" ); - document.body.removeChild( iframe ); - } - - // Store the correct default display - elemdisplay[ nodeName ] = display; - - return display; -} - -jQuery.each([ "height", "width" ], function( i, name ) { - jQuery.cssHooks[ name ] = { - get: function( elem, computed, extra ) { - if ( computed ) { - // certain elements can have dimension info if we invisibly show them - // however, it must have a current display style that would benefit from this - if ( elem.offsetWidth === 0 && rdisplayswap.test( curCSS( elem, "display" ) ) ) { - return jQuery.swap( elem, cssShow, function() { - return getWidthOrHeight( elem, name, extra ); - }); - } else { - return getWidthOrHeight( elem, name, extra ); - } - } - }, - - set: function( elem, value, extra ) { - return setPositiveNumber( elem, value, extra ? - augmentWidthOrHeight( - elem, - name, - extra, - jQuery.support.boxSizing && jQuery.css( elem, "boxSizing" ) === "border-box" - ) : 0 - ); - } - }; -}); - -if ( !jQuery.support.opacity ) { - jQuery.cssHooks.opacity = { - get: function( elem, computed ) { - // IE uses filters for opacity - return ropacity.test( (computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "" ) ? - ( 0.01 * parseFloat( RegExp.$1 ) ) + "" : - computed ? "1" : ""; - }, - - set: function( elem, value ) { - var style = elem.style, - currentStyle = elem.currentStyle, - opacity = jQuery.isNumeric( value ) ? "alpha(opacity=" + value * 100 + ")" : "", - filter = currentStyle && currentStyle.filter || style.filter || ""; - - // IE has trouble with opacity if it does not have layout - // Force it by setting the zoom level - style.zoom = 1; - - // if setting opacity to 1, and no other filters exist - attempt to remove filter attribute #6652 - if ( value >= 1 && jQuery.trim( filter.replace( ralpha, "" ) ) === "" && - style.removeAttribute ) { - - // Setting style.filter to null, "" & " " still leave "filter:" in the cssText - // if "filter:" is present at all, clearType is disabled, we want to avoid this - // style.removeAttribute is IE Only, but so apparently is this code path... - style.removeAttribute( "filter" ); - - // if there there is no filter style applied in a css rule, we are done - if ( currentStyle && !currentStyle.filter ) { - return; - } - } - - // otherwise, set new filter values - style.filter = ralpha.test( filter ) ? - filter.replace( ralpha, opacity ) : - filter + " " + opacity; - } - }; -} - -// These hooks cannot be added until DOM ready because the support test -// for it is not run until after DOM ready -jQuery(function() { - if ( !jQuery.support.reliableMarginRight ) { - jQuery.cssHooks.marginRight = { - get: function( elem, computed ) { - // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right - // Work around by temporarily setting element display to inline-block - return jQuery.swap( elem, { "display": "inline-block" }, function() { - if ( computed ) { - return curCSS( elem, "marginRight" ); - } - }); - } - }; - } - - // Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084 - // getComputedStyle returns percent when specified for top/left/bottom/right - // rather than make the css module depend on the offset module, we just check for it here - if ( !jQuery.support.pixelPosition && jQuery.fn.position ) { - jQuery.each( [ "top", "left" ], function( i, prop ) { - jQuery.cssHooks[ prop ] = { - get: function( elem, computed ) { - if ( computed ) { - var ret = curCSS( elem, prop ); - // if curCSS returns percentage, fallback to offset - return rnumnonpx.test( ret ) ? jQuery( elem ).position()[ prop ] + "px" : ret; - } - } - }; - }); - } - -}); - -if ( jQuery.expr && jQuery.expr.filters ) { - jQuery.expr.filters.hidden = function( elem ) { - return ( elem.offsetWidth === 0 && elem.offsetHeight === 0 ) || (!jQuery.support.reliableHiddenOffsets && ((elem.style && elem.style.display) || curCSS( elem, "display" )) === "none"); - }; - - jQuery.expr.filters.visible = function( elem ) { - return !jQuery.expr.filters.hidden( elem ); - }; -} - -// These hooks are used by animate to expand properties -jQuery.each({ - margin: "", - padding: "", - border: "Width" -}, function( prefix, suffix ) { - jQuery.cssHooks[ prefix + suffix ] = { - expand: function( value ) { - var i, - - // assumes a single number if not a string - parts = typeof value === "string" ? value.split(" ") : [ value ], - expanded = {}; - - for ( i = 0; i < 4; i++ ) { - expanded[ prefix + cssExpand[ i ] + suffix ] = - parts[ i ] || parts[ i - 2 ] || parts[ 0 ]; - } - - return expanded; - } - }; - - if ( !rmargin.test( prefix ) ) { - jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber; - } -}); -var r20 = /%20/g, - rbracket = /\[\]$/, - rCRLF = /\r?\n/g, - rinput = /^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i, - rselectTextarea = /^(?:select|textarea)/i; - -jQuery.fn.extend({ - serialize: function() { - return jQuery.param( this.serializeArray() ); - }, - serializeArray: function() { - return this.map(function(){ - return this.elements ? jQuery.makeArray( this.elements ) : this; - }) - .filter(function(){ - return this.name && !this.disabled && - ( this.checked || rselectTextarea.test( this.nodeName ) || - rinput.test( this.type ) ); - }) - .map(function( i, elem ){ - var val = jQuery( this ).val(); - - return val == null ? - null : - jQuery.isArray( val ) ? - jQuery.map( val, function( val, i ){ - return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; - }) : - { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; - }).get(); - } -}); - -//Serialize an array of form elements or a set of -//key/values into a query string -jQuery.param = function( a, traditional ) { - var prefix, - s = [], - add = function( key, value ) { - // If value is a function, invoke it and return its value - value = jQuery.isFunction( value ) ? value() : ( value == null ? "" : value ); - s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value ); - }; - - // Set traditional to true for jQuery <= 1.3.2 behavior. - if ( traditional === undefined ) { - traditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional; - } - - // If an array was passed in, assume that it is an array of form elements. - if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) { - // Serialize the form elements - jQuery.each( a, function() { - add( this.name, this.value ); - }); - - } else { - // If traditional, encode the "old" way (the way 1.3.2 or older - // did it), otherwise encode params recursively. - for ( prefix in a ) { - buildParams( prefix, a[ prefix ], traditional, add ); - } - } - - // Return the resulting serialization - return s.join( "&" ).replace( r20, "+" ); -}; - -function buildParams( prefix, obj, traditional, add ) { - var name; - - if ( jQuery.isArray( obj ) ) { - // Serialize array item. - jQuery.each( obj, function( i, v ) { - if ( traditional || rbracket.test( prefix ) ) { - // Treat each array item as a scalar. - add( prefix, v ); - - } else { - // If array item is non-scalar (array or object), encode its - // numeric index to resolve deserialization ambiguity issues. - // Note that rack (as of 1.0.0) can't currently deserialize - // nested arrays properly, and attempting to do so may cause - // a server error. Possible fixes are to modify rack's - // deserialization algorithm or to provide an option or flag - // to force array serialization to be shallow. - buildParams( prefix + "[" + ( typeof v === "object" ? i : "" ) + "]", v, traditional, add ); - } - }); - - } else if ( !traditional && jQuery.type( obj ) === "object" ) { - // Serialize object item. - for ( name in obj ) { - buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add ); - } - - } else { - // Serialize scalar item. - add( prefix, obj ); - } -} -var - // Document location - ajaxLocParts, - ajaxLocation, - - rhash = /#.*$/, - rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, // IE leaves an \r character at EOL - // #7653, #8125, #8152: local protocol detection - rlocalProtocol = /^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/, - rnoContent = /^(?:GET|HEAD)$/, - rprotocol = /^\/\//, - rquery = /\?/, - rscript = /)<[^<]*)*<\/script>/gi, - rts = /([?&])_=[^&]*/, - rurl = /^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/, - - // Keep a copy of the old load method - _load = jQuery.fn.load, - - /* Prefilters - * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example) - * 2) These are called: - * - BEFORE asking for a transport - * - AFTER param serialization (s.data is a string if s.processData is true) - * 3) key is the dataType - * 4) the catchall symbol "*" can be used - * 5) execution will start with transport dataType and THEN continue down to "*" if needed - */ - prefilters = {}, - - /* Transports bindings - * 1) key is the dataType - * 2) the catchall symbol "*" can be used - * 3) selection will start with transport dataType and THEN go to "*" if needed - */ - transports = {}, - - // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression - allTypes = ["*/"] + ["*"]; - -// #8138, IE may throw an exception when accessing -// a field from window.location if document.domain has been set -try { - ajaxLocation = location.href; -} catch( e ) { - // Use the href attribute of an A element - // since IE will modify it given document.location - ajaxLocation = document.createElement( "a" ); - ajaxLocation.href = ""; - ajaxLocation = ajaxLocation.href; -} - -// Segment location into parts -ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || []; - -// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport -function addToPrefiltersOrTransports( structure ) { - - // dataTypeExpression is optional and defaults to "*" - return function( dataTypeExpression, func ) { - - if ( typeof dataTypeExpression !== "string" ) { - func = dataTypeExpression; - dataTypeExpression = "*"; - } - - var dataType, list, placeBefore, - dataTypes = dataTypeExpression.toLowerCase().split( core_rspace ), - i = 0, - length = dataTypes.length; - - if ( jQuery.isFunction( func ) ) { - // For each dataType in the dataTypeExpression - for ( ; i < length; i++ ) { - dataType = dataTypes[ i ]; - // We control if we're asked to add before - // any existing element - placeBefore = /^\+/.test( dataType ); - if ( placeBefore ) { - dataType = dataType.substr( 1 ) || "*"; - } - list = structure[ dataType ] = structure[ dataType ] || []; - // then we add to the structure accordingly - list[ placeBefore ? "unshift" : "push" ]( func ); - } - } - }; -} - -// Base inspection function for prefilters and transports -function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR, - dataType /* internal */, inspected /* internal */ ) { - - dataType = dataType || options.dataTypes[ 0 ]; - inspected = inspected || {}; - - inspected[ dataType ] = true; - - var selection, - list = structure[ dataType ], - i = 0, - length = list ? list.length : 0, - executeOnly = ( structure === prefilters ); - - for ( ; i < length && ( executeOnly || !selection ); i++ ) { - selection = list[ i ]( options, originalOptions, jqXHR ); - // If we got redirected to another dataType - // we try there if executing only and not done already - if ( typeof selection === "string" ) { - if ( !executeOnly || inspected[ selection ] ) { - selection = undefined; - } else { - options.dataTypes.unshift( selection ); - selection = inspectPrefiltersOrTransports( - structure, options, originalOptions, jqXHR, selection, inspected ); - } - } - } - // If we're only executing or nothing was selected - // we try the catchall dataType if not done already - if ( ( executeOnly || !selection ) && !inspected[ "*" ] ) { - selection = inspectPrefiltersOrTransports( - structure, options, originalOptions, jqXHR, "*", inspected ); - } - // unnecessary when only executing (prefilters) - // but it'll be ignored by the caller in that case - return selection; -} - -// A special extend for ajax options -// that takes "flat" options (not to be deep extended) -// Fixes #9887 -function ajaxExtend( target, src ) { - var key, deep, - flatOptions = jQuery.ajaxSettings.flatOptions || {}; - for ( key in src ) { - if ( src[ key ] !== undefined ) { - ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ]; - } - } - if ( deep ) { - jQuery.extend( true, target, deep ); - } -} - -jQuery.fn.load = function( url, params, callback ) { - if ( typeof url !== "string" && _load ) { - return _load.apply( this, arguments ); - } - - // Don't do a request if no elements are being requested - if ( !this.length ) { - return this; - } - - var selector, type, response, - self = this, - off = url.indexOf(" "); - - if ( off >= 0 ) { - selector = url.slice( off, url.length ); - url = url.slice( 0, off ); - } - - // If it's a function - if ( jQuery.isFunction( params ) ) { - - // We assume that it's the callback - callback = params; - params = undefined; - - // Otherwise, build a param string - } else if ( params && typeof params === "object" ) { - type = "POST"; - } - - // Request the remote document - jQuery.ajax({ - url: url, - - // if "type" variable is undefined, then "GET" method will be used - type: type, - dataType: "html", - data: params, - complete: function( jqXHR, status ) { - if ( callback ) { - self.each( callback, response || [ jqXHR.responseText, status, jqXHR ] ); - } - } - }).done(function( responseText ) { - - // Save response for use in complete callback - response = arguments; - - // See if a selector was specified - self.html( selector ? - - // Create a dummy div to hold the results - jQuery("
                          ") - - // inject the contents of the document in, removing the scripts - // to avoid any 'Permission Denied' errors in IE - .append( responseText.replace( rscript, "" ) ) - - // Locate the specified elements - .find( selector ) : - - // If not, just inject the full result - responseText ); - - }); - - return this; -}; - -// Attach a bunch of functions for handling common AJAX events -jQuery.each( "ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split( " " ), function( i, o ){ - jQuery.fn[ o ] = function( f ){ - return this.on( o, f ); - }; -}); - -jQuery.each( [ "get", "post" ], function( i, method ) { - jQuery[ method ] = function( url, data, callback, type ) { - // shift arguments if data argument was omitted - if ( jQuery.isFunction( data ) ) { - type = type || callback; - callback = data; - data = undefined; - } - - return jQuery.ajax({ - type: method, - url: url, - data: data, - success: callback, - dataType: type - }); - }; -}); - -jQuery.extend({ - - getScript: function( url, callback ) { - return jQuery.get( url, undefined, callback, "script" ); - }, - - getJSON: function( url, data, callback ) { - return jQuery.get( url, data, callback, "json" ); - }, - - // Creates a full fledged settings object into target - // with both ajaxSettings and settings fields. - // If target is omitted, writes into ajaxSettings. - ajaxSetup: function( target, settings ) { - if ( settings ) { - // Building a settings object - ajaxExtend( target, jQuery.ajaxSettings ); - } else { - // Extending ajaxSettings - settings = target; - target = jQuery.ajaxSettings; - } - ajaxExtend( target, settings ); - return target; - }, - - ajaxSettings: { - url: ajaxLocation, - isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ), - global: true, - type: "GET", - contentType: "application/x-www-form-urlencoded; charset=UTF-8", - processData: true, - async: true, - /* - timeout: 0, - data: null, - dataType: null, - username: null, - password: null, - cache: null, - throws: false, - traditional: false, - headers: {}, - */ - - accepts: { - xml: "application/xml, text/xml", - html: "text/html", - text: "text/plain", - json: "application/json, text/javascript", - "*": allTypes - }, - - contents: { - xml: /xml/, - html: /html/, - json: /json/ - }, - - responseFields: { - xml: "responseXML", - text: "responseText" - }, - - // List of data converters - // 1) key format is "source_type destination_type" (a single space in-between) - // 2) the catchall symbol "*" can be used for source_type - converters: { - - // Convert anything to text - "* text": window.String, - - // Text to html (true = no transformation) - "text html": true, - - // Evaluate text as a json expression - "text json": jQuery.parseJSON, - - // Parse text as xml - "text xml": jQuery.parseXML - }, - - // For options that shouldn't be deep extended: - // you can add your own custom options here if - // and when you create one that shouldn't be - // deep extended (see ajaxExtend) - flatOptions: { - context: true, - url: true - } - }, - - ajaxPrefilter: addToPrefiltersOrTransports( prefilters ), - ajaxTransport: addToPrefiltersOrTransports( transports ), - - // Main method - ajax: function( url, options ) { - - // If url is an object, simulate pre-1.5 signature - if ( typeof url === "object" ) { - options = url; - url = undefined; - } - - // Force options to be an object - options = options || {}; - - var // ifModified key - ifModifiedKey, - // Response headers - responseHeadersString, - responseHeaders, - // transport - transport, - // timeout handle - timeoutTimer, - // Cross-domain detection vars - parts, - // To know if global events are to be dispatched - fireGlobals, - // Loop variable - i, - // Create the final options object - s = jQuery.ajaxSetup( {}, options ), - // Callbacks context - callbackContext = s.context || s, - // Context for global events - // It's the callbackContext if one was provided in the options - // and if it's a DOM node or a jQuery collection - globalEventContext = callbackContext !== s && - ( callbackContext.nodeType || callbackContext instanceof jQuery ) ? - jQuery( callbackContext ) : jQuery.event, - // Deferreds - deferred = jQuery.Deferred(), - completeDeferred = jQuery.Callbacks( "once memory" ), - // Status-dependent callbacks - statusCode = s.statusCode || {}, - // Headers (they are sent all at once) - requestHeaders = {}, - requestHeadersNames = {}, - // The jqXHR state - state = 0, - // Default abort message - strAbort = "canceled", - // Fake xhr - jqXHR = { - - readyState: 0, - - // Caches the header - setRequestHeader: function( name, value ) { - if ( !state ) { - var lname = name.toLowerCase(); - name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name; - requestHeaders[ name ] = value; - } - return this; - }, - - // Raw string - getAllResponseHeaders: function() { - return state === 2 ? responseHeadersString : null; - }, - - // Builds headers hashtable if needed - getResponseHeader: function( key ) { - var match; - if ( state === 2 ) { - if ( !responseHeaders ) { - responseHeaders = {}; - while( ( match = rheaders.exec( responseHeadersString ) ) ) { - responseHeaders[ match[1].toLowerCase() ] = match[ 2 ]; - } - } - match = responseHeaders[ key.toLowerCase() ]; - } - return match === undefined ? null : match; - }, - - // Overrides response content-type header - overrideMimeType: function( type ) { - if ( !state ) { - s.mimeType = type; - } - return this; - }, - - // Cancel the request - abort: function( statusText ) { - statusText = statusText || strAbort; - if ( transport ) { - transport.abort( statusText ); - } - done( 0, statusText ); - return this; - } - }; - - // Callback for when everything is done - // It is defined here because jslint complains if it is declared - // at the end of the function (which would be more logical and readable) - function done( status, nativeStatusText, responses, headers ) { - var isSuccess, success, error, response, modified, - statusText = nativeStatusText; - - // Called once - if ( state === 2 ) { - return; - } - - // State is "done" now - state = 2; - - // Clear timeout if it exists - if ( timeoutTimer ) { - clearTimeout( timeoutTimer ); - } - - // Dereference transport for early garbage collection - // (no matter how long the jqXHR object will be used) - transport = undefined; - - // Cache response headers - responseHeadersString = headers || ""; - - // Set readyState - jqXHR.readyState = status > 0 ? 4 : 0; - - // Get response data - if ( responses ) { - response = ajaxHandleResponses( s, jqXHR, responses ); - } - - // If successful, handle type chaining - if ( status >= 200 && status < 300 || status === 304 ) { - - // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. - if ( s.ifModified ) { - - modified = jqXHR.getResponseHeader("Last-Modified"); - if ( modified ) { - jQuery.lastModified[ ifModifiedKey ] = modified; - } - modified = jqXHR.getResponseHeader("Etag"); - if ( modified ) { - jQuery.etag[ ifModifiedKey ] = modified; - } - } - - // If not modified - if ( status === 304 ) { - - statusText = "notmodified"; - isSuccess = true; - - // If we have data - } else { - - isSuccess = ajaxConvert( s, response ); - statusText = isSuccess.state; - success = isSuccess.data; - error = isSuccess.error; - isSuccess = !error; - } - } else { - // We extract error from statusText - // then normalize statusText and status for non-aborts - error = statusText; - if ( !statusText || status ) { - statusText = "error"; - if ( status < 0 ) { - status = 0; - } - } - } - - // Set data for the fake xhr object - jqXHR.status = status; - jqXHR.statusText = ( nativeStatusText || statusText ) + ""; - - // Success/Error - if ( isSuccess ) { - deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] ); - } else { - deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] ); - } - - // Status-dependent callbacks - jqXHR.statusCode( statusCode ); - statusCode = undefined; - - if ( fireGlobals ) { - globalEventContext.trigger( "ajax" + ( isSuccess ? "Success" : "Error" ), - [ jqXHR, s, isSuccess ? success : error ] ); - } - - // Complete - completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] ); - - if ( fireGlobals ) { - globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] ); - // Handle the global AJAX counter - if ( !( --jQuery.active ) ) { - jQuery.event.trigger( "ajaxStop" ); - } - } - } - - // Attach deferreds - deferred.promise( jqXHR ); - jqXHR.success = jqXHR.done; - jqXHR.error = jqXHR.fail; - jqXHR.complete = completeDeferred.add; - - // Status-dependent callbacks - jqXHR.statusCode = function( map ) { - if ( map ) { - var tmp; - if ( state < 2 ) { - for ( tmp in map ) { - statusCode[ tmp ] = [ statusCode[tmp], map[tmp] ]; - } - } else { - tmp = map[ jqXHR.status ]; - jqXHR.always( tmp ); - } - } - return this; - }; - - // Remove hash character (#7531: and string promotion) - // Add protocol if not provided (#5866: IE7 issue with protocol-less urls) - // We also use the url parameter if available - s.url = ( ( url || s.url ) + "" ).replace( rhash, "" ).replace( rprotocol, ajaxLocParts[ 1 ] + "//" ); - - // Extract dataTypes list - s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().split( core_rspace ); - - // A cross-domain request is in order when we have a protocol:host:port mismatch - if ( s.crossDomain == null ) { - parts = rurl.exec( s.url.toLowerCase() ); - s.crossDomain = !!( parts && - ( parts[ 1 ] !== ajaxLocParts[ 1 ] || parts[ 2 ] !== ajaxLocParts[ 2 ] || - ( parts[ 3 ] || ( parts[ 1 ] === "http:" ? 80 : 443 ) ) != - ( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? 80 : 443 ) ) ) - ); - } - - // Convert data if not already a string - if ( s.data && s.processData && typeof s.data !== "string" ) { - s.data = jQuery.param( s.data, s.traditional ); - } - - // Apply prefilters - inspectPrefiltersOrTransports( prefilters, s, options, jqXHR ); - - // If request was aborted inside a prefilter, stop there - if ( state === 2 ) { - return jqXHR; - } - - // We can fire global events as of now if asked to - fireGlobals = s.global; - - // Uppercase the type - s.type = s.type.toUpperCase(); - - // Determine if request has content - s.hasContent = !rnoContent.test( s.type ); - - // Watch for a new set of requests - if ( fireGlobals && jQuery.active++ === 0 ) { - jQuery.event.trigger( "ajaxStart" ); - } - - // More options handling for requests with no content - if ( !s.hasContent ) { - - // If data is available, append data to url - if ( s.data ) { - s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.data; - // #9682: remove data so that it's not used in an eventual retry - delete s.data; - } - - // Get ifModifiedKey before adding the anti-cache parameter - ifModifiedKey = s.url; - - // Add anti-cache in url if needed - if ( s.cache === false ) { - - var ts = jQuery.now(), - // try replacing _= if it is there - ret = s.url.replace( rts, "$1_=" + ts ); - - // if nothing was replaced, add timestamp to the end - s.url = ret + ( ( ret === s.url ) ? ( rquery.test( s.url ) ? "&" : "?" ) + "_=" + ts : "" ); - } - } - - // Set the correct header, if data is being sent - if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) { - jqXHR.setRequestHeader( "Content-Type", s.contentType ); - } - - // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. - if ( s.ifModified ) { - ifModifiedKey = ifModifiedKey || s.url; - if ( jQuery.lastModified[ ifModifiedKey ] ) { - jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ ifModifiedKey ] ); - } - if ( jQuery.etag[ ifModifiedKey ] ) { - jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ ifModifiedKey ] ); - } - } - - // Set the Accepts header for the server, depending on the dataType - jqXHR.setRequestHeader( - "Accept", - s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ? - s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) : - s.accepts[ "*" ] - ); - - // Check for headers option - for ( i in s.headers ) { - jqXHR.setRequestHeader( i, s.headers[ i ] ); - } - - // Allow custom headers/mimetypes and early abort - if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) { - // Abort if not done already and return - return jqXHR.abort(); - - } - - // aborting is no longer a cancellation - strAbort = "abort"; - - // Install callbacks on deferreds - for ( i in { success: 1, error: 1, complete: 1 } ) { - jqXHR[ i ]( s[ i ] ); - } - - // Get transport - transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR ); - - // If no transport, we auto-abort - if ( !transport ) { - done( -1, "No Transport" ); - } else { - jqXHR.readyState = 1; - // Send global event - if ( fireGlobals ) { - globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] ); - } - // Timeout - if ( s.async && s.timeout > 0 ) { - timeoutTimer = setTimeout( function(){ - jqXHR.abort( "timeout" ); - }, s.timeout ); - } - - try { - state = 1; - transport.send( requestHeaders, done ); - } catch (e) { - // Propagate exception as error if not done - if ( state < 2 ) { - done( -1, e ); - // Simply rethrow otherwise - } else { - throw e; - } - } - } - - return jqXHR; - }, - - // Counter for holding the number of active queries - active: 0, - - // Last-Modified header cache for next request - lastModified: {}, - etag: {} - -}); - -/* Handles responses to an ajax request: - * - sets all responseXXX fields accordingly - * - finds the right dataType (mediates between content-type and expected dataType) - * - returns the corresponding response - */ -function ajaxHandleResponses( s, jqXHR, responses ) { - - var ct, type, finalDataType, firstDataType, - contents = s.contents, - dataTypes = s.dataTypes, - responseFields = s.responseFields; - - // Fill responseXXX fields - for ( type in responseFields ) { - if ( type in responses ) { - jqXHR[ responseFields[type] ] = responses[ type ]; - } - } - - // Remove auto dataType and get content-type in the process - while( dataTypes[ 0 ] === "*" ) { - dataTypes.shift(); - if ( ct === undefined ) { - ct = s.mimeType || jqXHR.getResponseHeader( "content-type" ); - } - } - - // Check if we're dealing with a known content-type - if ( ct ) { - for ( type in contents ) { - if ( contents[ type ] && contents[ type ].test( ct ) ) { - dataTypes.unshift( type ); - break; - } - } - } - - // Check to see if we have a response for the expected dataType - if ( dataTypes[ 0 ] in responses ) { - finalDataType = dataTypes[ 0 ]; - } else { - // Try convertible dataTypes - for ( type in responses ) { - if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) { - finalDataType = type; - break; - } - if ( !firstDataType ) { - firstDataType = type; - } - } - // Or just use first one - finalDataType = finalDataType || firstDataType; - } - - // If we found a dataType - // We add the dataType to the list if needed - // and return the corresponding response - if ( finalDataType ) { - if ( finalDataType !== dataTypes[ 0 ] ) { - dataTypes.unshift( finalDataType ); - } - return responses[ finalDataType ]; - } -} - -// Chain conversions given the request and the original response -function ajaxConvert( s, response ) { - - var conv, conv2, current, tmp, - // Work with a copy of dataTypes in case we need to modify it for conversion - dataTypes = s.dataTypes.slice(), - prev = dataTypes[ 0 ], - converters = {}, - i = 0; - - // Apply the dataFilter if provided - if ( s.dataFilter ) { - response = s.dataFilter( response, s.dataType ); - } - - // Create converters map with lowercased keys - if ( dataTypes[ 1 ] ) { - for ( conv in s.converters ) { - converters[ conv.toLowerCase() ] = s.converters[ conv ]; - } - } - - // Convert to each sequential dataType, tolerating list modification - for ( ; (current = dataTypes[++i]); ) { - - // There's only work to do if current dataType is non-auto - if ( current !== "*" ) { - - // Convert response if prev dataType is non-auto and differs from current - if ( prev !== "*" && prev !== current ) { - - // Seek a direct converter - conv = converters[ prev + " " + current ] || converters[ "* " + current ]; - - // If none found, seek a pair - if ( !conv ) { - for ( conv2 in converters ) { - - // If conv2 outputs current - tmp = conv2.split(" "); - if ( tmp[ 1 ] === current ) { - - // If prev can be converted to accepted input - conv = converters[ prev + " " + tmp[ 0 ] ] || - converters[ "* " + tmp[ 0 ] ]; - if ( conv ) { - // Condense equivalence converters - if ( conv === true ) { - conv = converters[ conv2 ]; - - // Otherwise, insert the intermediate dataType - } else if ( converters[ conv2 ] !== true ) { - current = tmp[ 0 ]; - dataTypes.splice( i--, 0, current ); - } - - break; - } - } - } - } - - // Apply converter (if not an equivalence) - if ( conv !== true ) { - - // Unless errors are allowed to bubble, catch and return them - if ( conv && s["throws"] ) { - response = conv( response ); - } else { - try { - response = conv( response ); - } catch ( e ) { - return { state: "parsererror", error: conv ? e : "No conversion from " + prev + " to " + current }; - } - } - } - } - - // Update prev for next iteration - prev = current; - } - } - - return { state: "success", data: response }; -} -var oldCallbacks = [], - rquestion = /\?/, - rjsonp = /(=)\?(?=&|$)|\?\?/, - nonce = jQuery.now(); - -// Default jsonp settings -jQuery.ajaxSetup({ - jsonp: "callback", - jsonpCallback: function() { - var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce++ ) ); - this[ callback ] = true; - return callback; - } -}); - -// Detect, normalize options and install callbacks for jsonp requests -jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) { - - var callbackName, overwritten, responseContainer, - data = s.data, - url = s.url, - hasCallback = s.jsonp !== false, - replaceInUrl = hasCallback && rjsonp.test( url ), - replaceInData = hasCallback && !replaceInUrl && typeof data === "string" && - !( s.contentType || "" ).indexOf("application/x-www-form-urlencoded") && - rjsonp.test( data ); - - // Handle iff the expected data type is "jsonp" or we have a parameter to set - if ( s.dataTypes[ 0 ] === "jsonp" || replaceInUrl || replaceInData ) { - - // Get callback name, remembering preexisting value associated with it - callbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ? - s.jsonpCallback() : - s.jsonpCallback; - overwritten = window[ callbackName ]; - - // Insert callback into url or form data - if ( replaceInUrl ) { - s.url = url.replace( rjsonp, "$1" + callbackName ); - } else if ( replaceInData ) { - s.data = data.replace( rjsonp, "$1" + callbackName ); - } else if ( hasCallback ) { - s.url += ( rquestion.test( url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName; - } - - // Use data converter to retrieve json after script execution - s.converters["script json"] = function() { - if ( !responseContainer ) { - jQuery.error( callbackName + " was not called" ); - } - return responseContainer[ 0 ]; - }; - - // force json dataType - s.dataTypes[ 0 ] = "json"; - - // Install callback - window[ callbackName ] = function() { - responseContainer = arguments; - }; - - // Clean-up function (fires after converters) - jqXHR.always(function() { - // Restore preexisting value - window[ callbackName ] = overwritten; - - // Save back as free - if ( s[ callbackName ] ) { - // make sure that re-using the options doesn't screw things around - s.jsonpCallback = originalSettings.jsonpCallback; - - // save the callback name for future use - oldCallbacks.push( callbackName ); - } - - // Call if it was a function and we have a response - if ( responseContainer && jQuery.isFunction( overwritten ) ) { - overwritten( responseContainer[ 0 ] ); - } - - responseContainer = overwritten = undefined; - }); - - // Delegate to script - return "script"; - } -}); -// Install script dataType -jQuery.ajaxSetup({ - accepts: { - script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript" - }, - contents: { - script: /javascript|ecmascript/ - }, - converters: { - "text script": function( text ) { - jQuery.globalEval( text ); - return text; - } - } -}); - -// Handle cache's special case and global -jQuery.ajaxPrefilter( "script", function( s ) { - if ( s.cache === undefined ) { - s.cache = false; - } - if ( s.crossDomain ) { - s.type = "GET"; - s.global = false; - } -}); - -// Bind script tag hack transport -jQuery.ajaxTransport( "script", function(s) { - - // This transport only deals with cross domain requests - if ( s.crossDomain ) { - - var script, - head = document.head || document.getElementsByTagName( "head" )[0] || document.documentElement; - - return { - - send: function( _, callback ) { - - script = document.createElement( "script" ); - - script.async = "async"; - - if ( s.scriptCharset ) { - script.charset = s.scriptCharset; - } - - script.src = s.url; - - // Attach handlers for all browsers - script.onload = script.onreadystatechange = function( _, isAbort ) { - - if ( isAbort || !script.readyState || /loaded|complete/.test( script.readyState ) ) { - - // Handle memory leak in IE - script.onload = script.onreadystatechange = null; - - // Remove the script - if ( head && script.parentNode ) { - head.removeChild( script ); - } - - // Dereference the script - script = undefined; - - // Callback if not abort - if ( !isAbort ) { - callback( 200, "success" ); - } - } - }; - // Use insertBefore instead of appendChild to circumvent an IE6 bug. - // This arises when a base node is used (#2709 and #4378). - head.insertBefore( script, head.firstChild ); - }, - - abort: function() { - if ( script ) { - script.onload( 0, 1 ); - } - } - }; - } -}); -var xhrCallbacks, - // #5280: Internet Explorer will keep connections alive if we don't abort on unload - xhrOnUnloadAbort = window.ActiveXObject ? function() { - // Abort all pending requests - for ( var key in xhrCallbacks ) { - xhrCallbacks[ key ]( 0, 1 ); - } - } : false, - xhrId = 0; - -// Functions to create xhrs -function createStandardXHR() { - try { - return new window.XMLHttpRequest(); - } catch( e ) {} -} - -function createActiveXHR() { - try { - return new window.ActiveXObject( "Microsoft.XMLHTTP" ); - } catch( e ) {} -} - -// Create the request object -// (This is still attached to ajaxSettings for backward compatibility) -jQuery.ajaxSettings.xhr = window.ActiveXObject ? - /* Microsoft failed to properly - * implement the XMLHttpRequest in IE7 (can't request local files), - * so we use the ActiveXObject when it is available - * Additionally XMLHttpRequest can be disabled in IE7/IE8 so - * we need a fallback. - */ - function() { - return !this.isLocal && createStandardXHR() || createActiveXHR(); - } : - // For all other browsers, use the standard XMLHttpRequest object - createStandardXHR; - -// Determine support properties -(function( xhr ) { - jQuery.extend( jQuery.support, { - ajax: !!xhr, - cors: !!xhr && ( "withCredentials" in xhr ) - }); -})( jQuery.ajaxSettings.xhr() ); - -// Create transport if the browser can provide an xhr -if ( jQuery.support.ajax ) { - - jQuery.ajaxTransport(function( s ) { - // Cross domain only allowed if supported through XMLHttpRequest - if ( !s.crossDomain || jQuery.support.cors ) { - - var callback; - - return { - send: function( headers, complete ) { - - // Get a new xhr - var handle, i, - xhr = s.xhr(); - - // Open the socket - // Passing null username, generates a login popup on Opera (#2865) - if ( s.username ) { - xhr.open( s.type, s.url, s.async, s.username, s.password ); - } else { - xhr.open( s.type, s.url, s.async ); - } - - // Apply custom fields if provided - if ( s.xhrFields ) { - for ( i in s.xhrFields ) { - xhr[ i ] = s.xhrFields[ i ]; - } - } - - // Override mime type if needed - if ( s.mimeType && xhr.overrideMimeType ) { - xhr.overrideMimeType( s.mimeType ); - } - - // X-Requested-With header - // For cross-domain requests, seeing as conditions for a preflight are - // akin to a jigsaw puzzle, we simply never set it to be sure. - // (it can always be set on a per-request basis or even using ajaxSetup) - // For same-domain requests, won't change header if already provided. - if ( !s.crossDomain && !headers["X-Requested-With"] ) { - headers[ "X-Requested-With" ] = "XMLHttpRequest"; - } - - // Need an extra try/catch for cross domain requests in Firefox 3 - try { - for ( i in headers ) { - xhr.setRequestHeader( i, headers[ i ] ); - } - } catch( _ ) {} - - // Do send the request - // This may raise an exception which is actually - // handled in jQuery.ajax (so no try/catch here) - xhr.send( ( s.hasContent && s.data ) || null ); - - // Listener - callback = function( _, isAbort ) { - - var status, - statusText, - responseHeaders, - responses, - xml; - - // Firefox throws exceptions when accessing properties - // of an xhr when a network error occurred - // http://helpful.knobs-dials.com/index.php/Component_returned_failure_code:_0x80040111_(NS_ERROR_NOT_AVAILABLE) - try { - - // Was never called and is aborted or complete - if ( callback && ( isAbort || xhr.readyState === 4 ) ) { - - // Only called once - callback = undefined; - - // Do not keep as active anymore - if ( handle ) { - xhr.onreadystatechange = jQuery.noop; - if ( xhrOnUnloadAbort ) { - delete xhrCallbacks[ handle ]; - } - } - - // If it's an abort - if ( isAbort ) { - // Abort it manually if needed - if ( xhr.readyState !== 4 ) { - xhr.abort(); - } - } else { - status = xhr.status; - responseHeaders = xhr.getAllResponseHeaders(); - responses = {}; - xml = xhr.responseXML; - - // Construct response list - if ( xml && xml.documentElement /* #4958 */ ) { - responses.xml = xml; - } - - // When requesting binary data, IE6-9 will throw an exception - // on any attempt to access responseText (#11426) - try { - responses.text = xhr.responseText; - } catch( e ) { - } - - // Firefox throws an exception when accessing - // statusText for faulty cross-domain requests - try { - statusText = xhr.statusText; - } catch( e ) { - // We normalize with Webkit giving an empty statusText - statusText = ""; - } - - // Filter status for non standard behaviors - - // If the request is local and we have data: assume a success - // (success with no data won't get notified, that's the best we - // can do given current implementations) - if ( !status && s.isLocal && !s.crossDomain ) { - status = responses.text ? 200 : 404; - // IE - #1450: sometimes returns 1223 when it should be 204 - } else if ( status === 1223 ) { - status = 204; - } - } - } - } catch( firefoxAccessException ) { - if ( !isAbort ) { - complete( -1, firefoxAccessException ); - } - } - - // Call complete if needed - if ( responses ) { - complete( status, statusText, responses, responseHeaders ); - } - }; - - if ( !s.async ) { - // if we're in sync mode we fire the callback - callback(); - } else if ( xhr.readyState === 4 ) { - // (IE6 & IE7) if it's in cache and has been - // retrieved directly we need to fire the callback - setTimeout( callback, 0 ); - } else { - handle = ++xhrId; - if ( xhrOnUnloadAbort ) { - // Create the active xhrs callbacks list if needed - // and attach the unload handler - if ( !xhrCallbacks ) { - xhrCallbacks = {}; - jQuery( window ).unload( xhrOnUnloadAbort ); - } - // Add to list of active xhrs callbacks - xhrCallbacks[ handle ] = callback; - } - xhr.onreadystatechange = callback; - } - }, - - abort: function() { - if ( callback ) { - callback(0,1); - } - } - }; - } - }); -} -var fxNow, timerId, - rfxtypes = /^(?:toggle|show|hide)$/, - rfxnum = new RegExp( "^(?:([-+])=|)(" + core_pnum + ")([a-z%]*)$", "i" ), - rrun = /queueHooks$/, - animationPrefilters = [ defaultPrefilter ], - tweeners = { - "*": [function( prop, value ) { - var end, unit, - tween = this.createTween( prop, value ), - parts = rfxnum.exec( value ), - target = tween.cur(), - start = +target || 0, - scale = 1, - maxIterations = 20; - - if ( parts ) { - end = +parts[2]; - unit = parts[3] || ( jQuery.cssNumber[ prop ] ? "" : "px" ); - - // We need to compute starting value - if ( unit !== "px" && start ) { - // Iteratively approximate from a nonzero starting point - // Prefer the current property, because this process will be trivial if it uses the same units - // Fallback to end or a simple constant - start = jQuery.css( tween.elem, prop, true ) || end || 1; - - do { - // If previous iteration zeroed out, double until we get *something* - // Use a string for doubling factor so we don't accidentally see scale as unchanged below - scale = scale || ".5"; - - // Adjust and apply - start = start / scale; - jQuery.style( tween.elem, prop, start + unit ); - - // Update scale, tolerating zero or NaN from tween.cur() - // And breaking the loop if scale is unchanged or perfect, or if we've just had enough - } while ( scale !== (scale = tween.cur() / target) && scale !== 1 && --maxIterations ); - } - - tween.unit = unit; - tween.start = start; - // If a +=/-= token was provided, we're doing a relative animation - tween.end = parts[1] ? start + ( parts[1] + 1 ) * end : end; - } - return tween; - }] - }; - -// Animations created synchronously will run synchronously -function createFxNow() { - setTimeout(function() { - fxNow = undefined; - }, 0 ); - return ( fxNow = jQuery.now() ); -} - -function createTweens( animation, props ) { - jQuery.each( props, function( prop, value ) { - var collection = ( tweeners[ prop ] || [] ).concat( tweeners[ "*" ] ), - index = 0, - length = collection.length; - for ( ; index < length; index++ ) { - if ( collection[ index ].call( animation, prop, value ) ) { - - // we're done with this property - return; - } - } - }); -} - -function Animation( elem, properties, options ) { - var result, - index = 0, - tweenerIndex = 0, - length = animationPrefilters.length, - deferred = jQuery.Deferred().always( function() { - // don't match elem in the :animated selector - delete tick.elem; - }), - tick = function() { - var currentTime = fxNow || createFxNow(), - remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ), - // archaic crash bug won't allow us to use 1 - ( 0.5 || 0 ) (#12497) - temp = remaining / animation.duration || 0, - percent = 1 - temp, - index = 0, - length = animation.tweens.length; - - for ( ; index < length ; index++ ) { - animation.tweens[ index ].run( percent ); - } - - deferred.notifyWith( elem, [ animation, percent, remaining ]); - - if ( percent < 1 && length ) { - return remaining; - } else { - deferred.resolveWith( elem, [ animation ] ); - return false; - } - }, - animation = deferred.promise({ - elem: elem, - props: jQuery.extend( {}, properties ), - opts: jQuery.extend( true, { specialEasing: {} }, options ), - originalProperties: properties, - originalOptions: options, - startTime: fxNow || createFxNow(), - duration: options.duration, - tweens: [], - createTween: function( prop, end, easing ) { - var tween = jQuery.Tween( elem, animation.opts, prop, end, - animation.opts.specialEasing[ prop ] || animation.opts.easing ); - animation.tweens.push( tween ); - return tween; - }, - stop: function( gotoEnd ) { - var index = 0, - // if we are going to the end, we want to run all the tweens - // otherwise we skip this part - length = gotoEnd ? animation.tweens.length : 0; - - for ( ; index < length ; index++ ) { - animation.tweens[ index ].run( 1 ); - } - - // resolve when we played the last frame - // otherwise, reject - if ( gotoEnd ) { - deferred.resolveWith( elem, [ animation, gotoEnd ] ); - } else { - deferred.rejectWith( elem, [ animation, gotoEnd ] ); - } - return this; - } - }), - props = animation.props; - - propFilter( props, animation.opts.specialEasing ); - - for ( ; index < length ; index++ ) { - result = animationPrefilters[ index ].call( animation, elem, props, animation.opts ); - if ( result ) { - return result; - } - } - - createTweens( animation, props ); - - if ( jQuery.isFunction( animation.opts.start ) ) { - animation.opts.start.call( elem, animation ); - } - - jQuery.fx.timer( - jQuery.extend( tick, { - anim: animation, - queue: animation.opts.queue, - elem: elem - }) - ); - - // attach callbacks from options - return animation.progress( animation.opts.progress ) - .done( animation.opts.done, animation.opts.complete ) - .fail( animation.opts.fail ) - .always( animation.opts.always ); -} - -function propFilter( props, specialEasing ) { - var index, name, easing, value, hooks; - - // camelCase, specialEasing and expand cssHook pass - for ( index in props ) { - name = jQuery.camelCase( index ); - easing = specialEasing[ name ]; - value = props[ index ]; - if ( jQuery.isArray( value ) ) { - easing = value[ 1 ]; - value = props[ index ] = value[ 0 ]; - } - - if ( index !== name ) { - props[ name ] = value; - delete props[ index ]; - } - - hooks = jQuery.cssHooks[ name ]; - if ( hooks && "expand" in hooks ) { - value = hooks.expand( value ); - delete props[ name ]; - - // not quite $.extend, this wont overwrite keys already present. - // also - reusing 'index' from above because we have the correct "name" - for ( index in value ) { - if ( !( index in props ) ) { - props[ index ] = value[ index ]; - specialEasing[ index ] = easing; - } - } - } else { - specialEasing[ name ] = easing; - } - } -} - -jQuery.Animation = jQuery.extend( Animation, { - - tweener: function( props, callback ) { - if ( jQuery.isFunction( props ) ) { - callback = props; - props = [ "*" ]; - } else { - props = props.split(" "); - } - - var prop, - index = 0, - length = props.length; - - for ( ; index < length ; index++ ) { - prop = props[ index ]; - tweeners[ prop ] = tweeners[ prop ] || []; - tweeners[ prop ].unshift( callback ); - } - }, - - prefilter: function( callback, prepend ) { - if ( prepend ) { - animationPrefilters.unshift( callback ); - } else { - animationPrefilters.push( callback ); - } - } -}); - -function defaultPrefilter( elem, props, opts ) { - var index, prop, value, length, dataShow, toggle, tween, hooks, oldfire, - anim = this, - style = elem.style, - orig = {}, - handled = [], - hidden = elem.nodeType && isHidden( elem ); - - // handle queue: false promises - if ( !opts.queue ) { - hooks = jQuery._queueHooks( elem, "fx" ); - if ( hooks.unqueued == null ) { - hooks.unqueued = 0; - oldfire = hooks.empty.fire; - hooks.empty.fire = function() { - if ( !hooks.unqueued ) { - oldfire(); - } - }; - } - hooks.unqueued++; - - anim.always(function() { - // doing this makes sure that the complete handler will be called - // before this completes - anim.always(function() { - hooks.unqueued--; - if ( !jQuery.queue( elem, "fx" ).length ) { - hooks.empty.fire(); - } - }); - }); - } - - // height/width overflow pass - if ( elem.nodeType === 1 && ( "height" in props || "width" in props ) ) { - // Make sure that nothing sneaks out - // Record all 3 overflow attributes because IE does not - // change the overflow attribute when overflowX and - // overflowY are set to the same value - opts.overflow = [ style.overflow, style.overflowX, style.overflowY ]; - - // Set display property to inline-block for height/width - // animations on inline elements that are having width/height animated - if ( jQuery.css( elem, "display" ) === "inline" && - jQuery.css( elem, "float" ) === "none" ) { - - // inline-level elements accept inline-block; - // block-level elements need to be inline with layout - if ( !jQuery.support.inlineBlockNeedsLayout || css_defaultDisplay( elem.nodeName ) === "inline" ) { - style.display = "inline-block"; - - } else { - style.zoom = 1; - } - } - } - - if ( opts.overflow ) { - style.overflow = "hidden"; - if ( !jQuery.support.shrinkWrapBlocks ) { - anim.done(function() { - style.overflow = opts.overflow[ 0 ]; - style.overflowX = opts.overflow[ 1 ]; - style.overflowY = opts.overflow[ 2 ]; - }); - } - } - - - // show/hide pass - for ( index in props ) { - value = props[ index ]; - if ( rfxtypes.exec( value ) ) { - delete props[ index ]; - toggle = toggle || value === "toggle"; - if ( value === ( hidden ? "hide" : "show" ) ) { - continue; - } - handled.push( index ); - } - } - - length = handled.length; - if ( length ) { - dataShow = jQuery._data( elem, "fxshow" ) || jQuery._data( elem, "fxshow", {} ); - if ( "hidden" in dataShow ) { - hidden = dataShow.hidden; - } - - // store state if its toggle - enables .stop().toggle() to "reverse" - if ( toggle ) { - dataShow.hidden = !hidden; - } - if ( hidden ) { - jQuery( elem ).show(); - } else { - anim.done(function() { - jQuery( elem ).hide(); - }); - } - anim.done(function() { - var prop; - jQuery.removeData( elem, "fxshow", true ); - for ( prop in orig ) { - jQuery.style( elem, prop, orig[ prop ] ); - } - }); - for ( index = 0 ; index < length ; index++ ) { - prop = handled[ index ]; - tween = anim.createTween( prop, hidden ? dataShow[ prop ] : 0 ); - orig[ prop ] = dataShow[ prop ] || jQuery.style( elem, prop ); - - if ( !( prop in dataShow ) ) { - dataShow[ prop ] = tween.start; - if ( hidden ) { - tween.end = tween.start; - tween.start = prop === "width" || prop === "height" ? 1 : 0; - } - } - } - } -} - -function Tween( elem, options, prop, end, easing ) { - return new Tween.prototype.init( elem, options, prop, end, easing ); -} -jQuery.Tween = Tween; - -Tween.prototype = { - constructor: Tween, - init: function( elem, options, prop, end, easing, unit ) { - this.elem = elem; - this.prop = prop; - this.easing = easing || "swing"; - this.options = options; - this.start = this.now = this.cur(); - this.end = end; - this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" ); - }, - cur: function() { - var hooks = Tween.propHooks[ this.prop ]; - - return hooks && hooks.get ? - hooks.get( this ) : - Tween.propHooks._default.get( this ); - }, - run: function( percent ) { - var eased, - hooks = Tween.propHooks[ this.prop ]; - - if ( this.options.duration ) { - this.pos = eased = jQuery.easing[ this.easing ]( - percent, this.options.duration * percent, 0, 1, this.options.duration - ); - } else { - this.pos = eased = percent; - } - this.now = ( this.end - this.start ) * eased + this.start; - - if ( this.options.step ) { - this.options.step.call( this.elem, this.now, this ); - } - - if ( hooks && hooks.set ) { - hooks.set( this ); - } else { - Tween.propHooks._default.set( this ); - } - return this; - } -}; - -Tween.prototype.init.prototype = Tween.prototype; - -Tween.propHooks = { - _default: { - get: function( tween ) { - var result; - - if ( tween.elem[ tween.prop ] != null && - (!tween.elem.style || tween.elem.style[ tween.prop ] == null) ) { - return tween.elem[ tween.prop ]; - } - - // passing any value as a 4th parameter to .css will automatically - // attempt a parseFloat and fallback to a string if the parse fails - // so, simple values such as "10px" are parsed to Float. - // complex values such as "rotate(1rad)" are returned as is. - result = jQuery.css( tween.elem, tween.prop, false, "" ); - // Empty strings, null, undefined and "auto" are converted to 0. - return !result || result === "auto" ? 0 : result; - }, - set: function( tween ) { - // use step hook for back compat - use cssHook if its there - use .style if its - // available and use plain properties where available - if ( jQuery.fx.step[ tween.prop ] ) { - jQuery.fx.step[ tween.prop ]( tween ); - } else if ( tween.elem.style && ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null || jQuery.cssHooks[ tween.prop ] ) ) { - jQuery.style( tween.elem, tween.prop, tween.now + tween.unit ); - } else { - tween.elem[ tween.prop ] = tween.now; - } - } - } -}; - -// Remove in 2.0 - this supports IE8's panic based approach -// to setting things on disconnected nodes - -Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = { - set: function( tween ) { - if ( tween.elem.nodeType && tween.elem.parentNode ) { - tween.elem[ tween.prop ] = tween.now; - } - } -}; - -jQuery.each([ "toggle", "show", "hide" ], function( i, name ) { - var cssFn = jQuery.fn[ name ]; - jQuery.fn[ name ] = function( speed, easing, callback ) { - return speed == null || typeof speed === "boolean" || - // special check for .toggle( handler, handler, ... ) - ( !i && jQuery.isFunction( speed ) && jQuery.isFunction( easing ) ) ? - cssFn.apply( this, arguments ) : - this.animate( genFx( name, true ), speed, easing, callback ); - }; -}); - -jQuery.fn.extend({ - fadeTo: function( speed, to, easing, callback ) { - - // show any hidden elements after setting opacity to 0 - return this.filter( isHidden ).css( "opacity", 0 ).show() - - // animate to the value specified - .end().animate({ opacity: to }, speed, easing, callback ); - }, - animate: function( prop, speed, easing, callback ) { - var empty = jQuery.isEmptyObject( prop ), - optall = jQuery.speed( speed, easing, callback ), - doAnimation = function() { - // Operate on a copy of prop so per-property easing won't be lost - var anim = Animation( this, jQuery.extend( {}, prop ), optall ); - - // Empty animations resolve immediately - if ( empty ) { - anim.stop( true ); - } - }; - - return empty || optall.queue === false ? - this.each( doAnimation ) : - this.queue( optall.queue, doAnimation ); - }, - stop: function( type, clearQueue, gotoEnd ) { - var stopQueue = function( hooks ) { - var stop = hooks.stop; - delete hooks.stop; - stop( gotoEnd ); - }; - - if ( typeof type !== "string" ) { - gotoEnd = clearQueue; - clearQueue = type; - type = undefined; - } - if ( clearQueue && type !== false ) { - this.queue( type || "fx", [] ); - } - - return this.each(function() { - var dequeue = true, - index = type != null && type + "queueHooks", - timers = jQuery.timers, - data = jQuery._data( this ); - - if ( index ) { - if ( data[ index ] && data[ index ].stop ) { - stopQueue( data[ index ] ); - } - } else { - for ( index in data ) { - if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) { - stopQueue( data[ index ] ); - } - } - } - - for ( index = timers.length; index--; ) { - if ( timers[ index ].elem === this && (type == null || timers[ index ].queue === type) ) { - timers[ index ].anim.stop( gotoEnd ); - dequeue = false; - timers.splice( index, 1 ); - } - } - - // start the next in the queue if the last step wasn't forced - // timers currently will call their complete callbacks, which will dequeue - // but only if they were gotoEnd - if ( dequeue || !gotoEnd ) { - jQuery.dequeue( this, type ); - } - }); - } -}); - -// Generate parameters to create a standard animation -function genFx( type, includeWidth ) { - var which, - attrs = { height: type }, - i = 0; - - // if we include width, step value is 1 to do all cssExpand values, - // if we don't include width, step value is 2 to skip over Left and Right - includeWidth = includeWidth? 1 : 0; - for( ; i < 4 ; i += 2 - includeWidth ) { - which = cssExpand[ i ]; - attrs[ "margin" + which ] = attrs[ "padding" + which ] = type; - } - - if ( includeWidth ) { - attrs.opacity = attrs.width = type; - } - - return attrs; -} - -// Generate shortcuts for custom animations -jQuery.each({ - slideDown: genFx("show"), - slideUp: genFx("hide"), - slideToggle: genFx("toggle"), - fadeIn: { opacity: "show" }, - fadeOut: { opacity: "hide" }, - fadeToggle: { opacity: "toggle" } -}, function( name, props ) { - jQuery.fn[ name ] = function( speed, easing, callback ) { - return this.animate( props, speed, easing, callback ); - }; -}); - -jQuery.speed = function( speed, easing, fn ) { - var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : { - complete: fn || !fn && easing || - jQuery.isFunction( speed ) && speed, - duration: speed, - easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing - }; - - opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration : - opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default; - - // normalize opt.queue - true/undefined/null -> "fx" - if ( opt.queue == null || opt.queue === true ) { - opt.queue = "fx"; - } - - // Queueing - opt.old = opt.complete; - - opt.complete = function() { - if ( jQuery.isFunction( opt.old ) ) { - opt.old.call( this ); - } - - if ( opt.queue ) { - jQuery.dequeue( this, opt.queue ); - } - }; - - return opt; -}; - -jQuery.easing = { - linear: function( p ) { - return p; - }, - swing: function( p ) { - return 0.5 - Math.cos( p*Math.PI ) / 2; - } -}; - -jQuery.timers = []; -jQuery.fx = Tween.prototype.init; -jQuery.fx.tick = function() { - var timer, - timers = jQuery.timers, - i = 0; - - fxNow = jQuery.now(); - - for ( ; i < timers.length; i++ ) { - timer = timers[ i ]; - // Checks the timer has not already been removed - if ( !timer() && timers[ i ] === timer ) { - timers.splice( i--, 1 ); - } - } - - if ( !timers.length ) { - jQuery.fx.stop(); - } - fxNow = undefined; -}; - -jQuery.fx.timer = function( timer ) { - if ( timer() && jQuery.timers.push( timer ) && !timerId ) { - timerId = setInterval( jQuery.fx.tick, jQuery.fx.interval ); - } -}; - -jQuery.fx.interval = 13; - -jQuery.fx.stop = function() { - clearInterval( timerId ); - timerId = null; -}; - -jQuery.fx.speeds = { - slow: 600, - fast: 200, - // Default speed - _default: 400 -}; - -// Back Compat <1.8 extension point -jQuery.fx.step = {}; - -if ( jQuery.expr && jQuery.expr.filters ) { - jQuery.expr.filters.animated = function( elem ) { - return jQuery.grep(jQuery.timers, function( fn ) { - return elem === fn.elem; - }).length; - }; -} -var rroot = /^(?:body|html)$/i; - -jQuery.fn.offset = function( options ) { - if ( arguments.length ) { - return options === undefined ? - this : - this.each(function( i ) { - jQuery.offset.setOffset( this, options, i ); - }); - } - - var docElem, body, win, clientTop, clientLeft, scrollTop, scrollLeft, - box = { top: 0, left: 0 }, - elem = this[ 0 ], - doc = elem && elem.ownerDocument; - - if ( !doc ) { - return; - } - - if ( (body = doc.body) === elem ) { - return jQuery.offset.bodyOffset( elem ); - } - - docElem = doc.documentElement; - - // Make sure it's not a disconnected DOM node - if ( !jQuery.contains( docElem, elem ) ) { - return box; - } - - // If we don't have gBCR, just use 0,0 rather than error - // BlackBerry 5, iOS 3 (original iPhone) - if ( typeof elem.getBoundingClientRect !== "undefined" ) { - box = elem.getBoundingClientRect(); - } - win = getWindow( doc ); - clientTop = docElem.clientTop || body.clientTop || 0; - clientLeft = docElem.clientLeft || body.clientLeft || 0; - scrollTop = win.pageYOffset || docElem.scrollTop; - scrollLeft = win.pageXOffset || docElem.scrollLeft; - return { - top: box.top + scrollTop - clientTop, - left: box.left + scrollLeft - clientLeft - }; -}; - -jQuery.offset = { - - bodyOffset: function( body ) { - var top = body.offsetTop, - left = body.offsetLeft; - - if ( jQuery.support.doesNotIncludeMarginInBodyOffset ) { - top += parseFloat( jQuery.css(body, "marginTop") ) || 0; - left += parseFloat( jQuery.css(body, "marginLeft") ) || 0; - } - - return { top: top, left: left }; - }, - - setOffset: function( elem, options, i ) { - var position = jQuery.css( elem, "position" ); - - // set position first, in-case top/left are set even on static elem - if ( position === "static" ) { - elem.style.position = "relative"; - } - - var curElem = jQuery( elem ), - curOffset = curElem.offset(), - curCSSTop = jQuery.css( elem, "top" ), - curCSSLeft = jQuery.css( elem, "left" ), - calculatePosition = ( position === "absolute" || position === "fixed" ) && jQuery.inArray("auto", [curCSSTop, curCSSLeft]) > -1, - props = {}, curPosition = {}, curTop, curLeft; - - // need to be able to calculate position if either top or left is auto and position is either absolute or fixed - if ( calculatePosition ) { - curPosition = curElem.position(); - curTop = curPosition.top; - curLeft = curPosition.left; - } else { - curTop = parseFloat( curCSSTop ) || 0; - curLeft = parseFloat( curCSSLeft ) || 0; - } - - if ( jQuery.isFunction( options ) ) { - options = options.call( elem, i, curOffset ); - } - - if ( options.top != null ) { - props.top = ( options.top - curOffset.top ) + curTop; - } - if ( options.left != null ) { - props.left = ( options.left - curOffset.left ) + curLeft; - } - - if ( "using" in options ) { - options.using.call( elem, props ); - } else { - curElem.css( props ); - } - } -}; - - -jQuery.fn.extend({ - - position: function() { - if ( !this[0] ) { - return; - } - - var elem = this[0], - - // Get *real* offsetParent - offsetParent = this.offsetParent(), - - // Get correct offsets - offset = this.offset(), - parentOffset = rroot.test(offsetParent[0].nodeName) ? { top: 0, left: 0 } : offsetParent.offset(); - - // Subtract element margins - // note: when an element has margin: auto the offsetLeft and marginLeft - // are the same in Safari causing offset.left to incorrectly be 0 - offset.top -= parseFloat( jQuery.css(elem, "marginTop") ) || 0; - offset.left -= parseFloat( jQuery.css(elem, "marginLeft") ) || 0; - - // Add offsetParent borders - parentOffset.top += parseFloat( jQuery.css(offsetParent[0], "borderTopWidth") ) || 0; - parentOffset.left += parseFloat( jQuery.css(offsetParent[0], "borderLeftWidth") ) || 0; - - // Subtract the two offsets - return { - top: offset.top - parentOffset.top, - left: offset.left - parentOffset.left - }; - }, - - offsetParent: function() { - return this.map(function() { - var offsetParent = this.offsetParent || document.body; - while ( offsetParent && (!rroot.test(offsetParent.nodeName) && jQuery.css(offsetParent, "position") === "static") ) { - offsetParent = offsetParent.offsetParent; - } - return offsetParent || document.body; - }); - } -}); - - -// Create scrollLeft and scrollTop methods -jQuery.each( {scrollLeft: "pageXOffset", scrollTop: "pageYOffset"}, function( method, prop ) { - var top = /Y/.test( prop ); - - jQuery.fn[ method ] = function( val ) { - return jQuery.access( this, function( elem, method, val ) { - var win = getWindow( elem ); - - if ( val === undefined ) { - return win ? (prop in win) ? win[ prop ] : - win.document.documentElement[ method ] : - elem[ method ]; - } - - if ( win ) { - win.scrollTo( - !top ? val : jQuery( win ).scrollLeft(), - top ? val : jQuery( win ).scrollTop() - ); - - } else { - elem[ method ] = val; - } - }, method, val, arguments.length, null ); - }; -}); - -function getWindow( elem ) { - return jQuery.isWindow( elem ) ? - elem : - elem.nodeType === 9 ? - elem.defaultView || elem.parentWindow : - false; -} -// Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods -jQuery.each( { Height: "height", Width: "width" }, function( name, type ) { - jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name }, function( defaultExtra, funcName ) { - // margin is only for outerHeight, outerWidth - jQuery.fn[ funcName ] = function( margin, value ) { - var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ), - extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" ); - - return jQuery.access( this, function( elem, type, value ) { - var doc; - - if ( jQuery.isWindow( elem ) ) { - // As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there - // isn't a whole lot we can do. See pull request at this URL for discussion: - // https://github.com/jquery/jquery/pull/764 - return elem.document.documentElement[ "client" + name ]; - } - - // Get document width or height - if ( elem.nodeType === 9 ) { - doc = elem.documentElement; - - // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height], whichever is greatest - // unfortunately, this causes bug #3838 in IE6/8 only, but there is currently no good, small way to fix it. - return Math.max( - elem.body[ "scroll" + name ], doc[ "scroll" + name ], - elem.body[ "offset" + name ], doc[ "offset" + name ], - doc[ "client" + name ] - ); - } - - return value === undefined ? - // Get width or height on the element, requesting but not forcing parseFloat - jQuery.css( elem, type, value, extra ) : - - // Set width or height on the element - jQuery.style( elem, type, value, extra ); - }, type, chainable ? margin : undefined, chainable, null ); - }; - }); -}); -// Expose jQuery to the global object -window.jQuery = window.$ = jQuery; - -// Expose jQuery as an AMD module, but only for AMD loaders that -// understand the issues with loading multiple versions of jQuery -// in a page that all might call define(). The loader will indicate -// they have special allowances for multiple jQuery versions by -// specifying define.amd.jQuery = true. Register as a named module, -// since jQuery can be concatenated with other files that may use define, -// but not use a proper concatenation script that understands anonymous -// AMD modules. A named AMD is safest and most robust way to register. -// Lowercase jquery is used because AMD module names are derived from -// file names, and jQuery is normally delivered in a lowercase file name. -// Do this after creating the global so that if an AMD module wants to call -// noConflict to hide this version of jQuery, it will work. -if ( typeof define === "function" && define.amd && define.amd.jQuery ) { - define( "jquery", [], function () { return jQuery; } ); -} - -})( window ); -;/*! jQuery UI - v1.11.4 - 2015-10-16 - * http://jqueryui.com - * Includes: core.js, widget.js, mouse.js, position.js, datepicker.js, slider.js, tooltip.js - * Copyright 2015 jQuery Foundation and other contributors; Licensed MIT */ - -(function( factory ) { - if ( typeof define === "function" && define.amd ) { - - // AMD. Register as an anonymous module. - define([ "jquery" ], factory ); - } else { - - // Browser globals - factory( jQuery ); - } -}(function( $ ) { - /*! - * jQuery UI Core 1.11.4 - * http://jqueryui.com - * - * Copyright jQuery Foundation and other contributors - * Released under the MIT license. - * http://jquery.org/license - * - * http://api.jqueryui.com/category/ui-core/ - */ - - -// $.ui might exist from components with no dependencies, e.g., $.ui.position - $.ui = $.ui || {}; - - $.extend( $.ui, { - version: "1.11.4", - - keyCode: { - BACKSPACE: 8, - COMMA: 188, - DELETE: 46, - DOWN: 40, - END: 35, - ENTER: 13, - ESCAPE: 27, - HOME: 36, - LEFT: 37, - PAGE_DOWN: 34, - PAGE_UP: 33, - PERIOD: 190, - RIGHT: 39, - SPACE: 32, - TAB: 9, - UP: 38 - } - }); - -// plugins - $.fn.extend({ - scrollParent: function( includeHidden ) { - var position = this.css( "position" ), - excludeStaticParent = position === "absolute", - overflowRegex = includeHidden ? /(auto|scroll|hidden)/ : /(auto|scroll)/, - scrollParent = this.parents().filter( function() { - var parent = $( this ); - if ( excludeStaticParent && parent.css( "position" ) === "static" ) { - return false; - } - return overflowRegex.test( parent.css( "overflow" ) + parent.css( "overflow-y" ) + parent.css( "overflow-x" ) ); - }).eq( 0 ); - - return position === "fixed" || !scrollParent.length ? $( this[ 0 ].ownerDocument || document ) : scrollParent; - }, - - uniqueId: (function() { - var uuid = 0; - - return function() { - return this.each(function() { - if ( !this.id ) { - this.id = "ui-id-" + ( ++uuid ); - } - }); - }; - })(), - - removeUniqueId: function() { - return this.each(function() { - if ( /^ui-id-\d+$/.test( this.id ) ) { - $( this ).removeAttr( "id" ); - } - }); - } - }); - -// selectors - function focusable( element, isTabIndexNotNaN ) { - var map, mapName, img, - nodeName = element.nodeName.toLowerCase(); - if ( "area" === nodeName ) { - map = element.parentNode; - mapName = map.name; - if ( !element.href || !mapName || map.nodeName.toLowerCase() !== "map" ) { - return false; - } - img = $( "img[usemap='#" + mapName + "']" )[ 0 ]; - return !!img && visible( img ); - } - return ( /^(input|select|textarea|button|object)$/.test( nodeName ) ? - !element.disabled : - "a" === nodeName ? - element.href || isTabIndexNotNaN : - isTabIndexNotNaN) && - // the element and all of its ancestors must be visible - visible( element ); - } - - function visible( element ) { - return $.expr.filters.visible( element ) && - !$( element ).parents().addBack().filter(function() { - return $.css( this, "visibility" ) === "hidden"; - }).length; - } - - $.extend( $.expr[ ":" ], { - data: $.expr.createPseudo ? - $.expr.createPseudo(function( dataName ) { - return function( elem ) { - return !!$.data( elem, dataName ); - }; - }) : - // support: jQuery <1.8 - function( elem, i, match ) { - return !!$.data( elem, match[ 3 ] ); - }, - - focusable: function( element ) { - return focusable( element, !isNaN( $.attr( element, "tabindex" ) ) ); - }, - - tabbable: function( element ) { - var tabIndex = $.attr( element, "tabindex" ), - isTabIndexNaN = isNaN( tabIndex ); - return ( isTabIndexNaN || tabIndex >= 0 ) && focusable( element, !isTabIndexNaN ); - } - }); - -// support: jQuery <1.8 - if ( !$( "" ).outerWidth( 1 ).jquery ) { - $.each( [ "Width", "Height" ], function( i, name ) { - var side = name === "Width" ? [ "Left", "Right" ] : [ "Top", "Bottom" ], - type = name.toLowerCase(), - orig = { - innerWidth: $.fn.innerWidth, - innerHeight: $.fn.innerHeight, - outerWidth: $.fn.outerWidth, - outerHeight: $.fn.outerHeight - }; - - function reduce( elem, size, border, margin ) { - $.each( side, function() { - size -= parseFloat( $.css( elem, "padding" + this ) ) || 0; - if ( border ) { - size -= parseFloat( $.css( elem, "border" + this + "Width" ) ) || 0; - } - if ( margin ) { - size -= parseFloat( $.css( elem, "margin" + this ) ) || 0; - } - }); - return size; - } - - $.fn[ "inner" + name ] = function( size ) { - if ( size === undefined ) { - return orig[ "inner" + name ].call( this ); - } - - return this.each(function() { - $( this ).css( type, reduce( this, size ) + "px" ); - }); - }; - - $.fn[ "outer" + name] = function( size, margin ) { - if ( typeof size !== "number" ) { - return orig[ "outer" + name ].call( this, size ); - } - - return this.each(function() { - $( this).css( type, reduce( this, size, true, margin ) + "px" ); - }); - }; - }); - } - -// support: jQuery <1.8 - if ( !$.fn.addBack ) { - $.fn.addBack = function( selector ) { - return this.add( selector == null ? - this.prevObject : this.prevObject.filter( selector ) - ); - }; - } - -// support: jQuery 1.6.1, 1.6.2 (http://bugs.jquery.com/ticket/9413) - if ( $( "" ).data( "a-b", "a" ).removeData( "a-b" ).data( "a-b" ) ) { - $.fn.removeData = (function( removeData ) { - return function( key ) { - if ( arguments.length ) { - return removeData.call( this, $.camelCase( key ) ); - } else { - return removeData.call( this ); - } - }; - })( $.fn.removeData ); - } - -// deprecated - $.ui.ie = !!/msie [\w.]+/.exec( navigator.userAgent.toLowerCase() ); - - $.fn.extend({ - focus: (function( orig ) { - return function( delay, fn ) { - return typeof delay === "number" ? - this.each(function() { - var elem = this; - setTimeout(function() { - $( elem ).focus(); - if ( fn ) { - fn.call( elem ); - } - }, delay ); - }) : - orig.apply( this, arguments ); - }; - })( $.fn.focus ), - - disableSelection: (function() { - var eventType = "onselectstart" in document.createElement( "div" ) ? - "selectstart" : - "mousedown"; - - return function() { - return this.bind( eventType + ".ui-disableSelection", function( event ) { - event.preventDefault(); - }); - }; - })(), - - enableSelection: function() { - return this.unbind( ".ui-disableSelection" ); - }, - - zIndex: function( zIndex ) { - if ( zIndex !== undefined ) { - return this.css( "zIndex", zIndex ); - } - - if ( this.length ) { - var elem = $( this[ 0 ] ), position, value; - while ( elem.length && elem[ 0 ] !== document ) { - // Ignore z-index if position is set to a value where z-index is ignored by the browser - // This makes behavior of this function consistent across browsers - // WebKit always returns auto if the element is positioned - position = elem.css( "position" ); - if ( position === "absolute" || position === "relative" || position === "fixed" ) { - // IE returns 0 when zIndex is not specified - // other browsers return a string - // we ignore the case of nested elements with an explicit value of 0 - //
                          - value = parseInt( elem.css( "zIndex" ), 10 ); - if ( !isNaN( value ) && value !== 0 ) { - return value; - } - } - elem = elem.parent(); - } - } - - return 0; - } - }); - -// $.ui.plugin is deprecated. Use $.widget() extensions instead. - $.ui.plugin = { - add: function( module, option, set ) { - var i, - proto = $.ui[ module ].prototype; - for ( i in set ) { - proto.plugins[ i ] = proto.plugins[ i ] || []; - proto.plugins[ i ].push( [ option, set[ i ] ] ); - } - }, - call: function( instance, name, args, allowDisconnected ) { - var i, - set = instance.plugins[ name ]; - - if ( !set ) { - return; - } - - if ( !allowDisconnected && ( !instance.element[ 0 ].parentNode || instance.element[ 0 ].parentNode.nodeType === 11 ) ) { - return; - } - - for ( i = 0; i < set.length; i++ ) { - if ( instance.options[ set[ i ][ 0 ] ] ) { - set[ i ][ 1 ].apply( instance.element, args ); - } - } - } - }; - - - /*! - * jQuery UI Widget 1.11.4 - * http://jqueryui.com - * - * Copyright jQuery Foundation and other contributors - * Released under the MIT license. - * http://jquery.org/license - * - * http://api.jqueryui.com/jQuery.widget/ - */ - - - var widget_uuid = 0, - widget_slice = Array.prototype.slice; - - $.cleanData = (function( orig ) { - return function( elems ) { - var events, elem, i; - for ( i = 0; (elem = elems[i]) != null; i++ ) { - try { - - // Only trigger remove when necessary to save time - events = $._data( elem, "events" ); - if ( events && events.remove ) { - $( elem ).triggerHandler( "remove" ); - } - - // http://bugs.jquery.com/ticket/8235 - } catch ( e ) {} - } - orig( elems ); - }; - })( $.cleanData ); - - $.widget = function( name, base, prototype ) { - var fullName, existingConstructor, constructor, basePrototype, - // proxiedPrototype allows the provided prototype to remain unmodified - // so that it can be used as a mixin for multiple widgets (#8876) - proxiedPrototype = {}, - namespace = name.split( "." )[ 0 ]; - - name = name.split( "." )[ 1 ]; - fullName = namespace + "-" + name; - - if ( !prototype ) { - prototype = base; - base = $.Widget; - } - - // create selector for plugin - $.expr[ ":" ][ fullName.toLowerCase() ] = function( elem ) { - return !!$.data( elem, fullName ); - }; - - $[ namespace ] = $[ namespace ] || {}; - existingConstructor = $[ namespace ][ name ]; - constructor = $[ namespace ][ name ] = function( options, element ) { - // allow instantiation without "new" keyword - if ( !this._createWidget ) { - return new constructor( options, element ); - } - - // allow instantiation without initializing for simple inheritance - // must use "new" keyword (the code above always passes args) - if ( arguments.length ) { - this._createWidget( options, element ); - } - }; - // extend with the existing constructor to carry over any static properties - $.extend( constructor, existingConstructor, { - version: prototype.version, - // copy the object used to create the prototype in case we need to - // redefine the widget later - _proto: $.extend( {}, prototype ), - // track widgets that inherit from this widget in case this widget is - // redefined after a widget inherits from it - _childConstructors: [] - }); - - basePrototype = new base(); - // we need to make the options hash a property directly on the new instance - // otherwise we'll modify the options hash on the prototype that we're - // inheriting from - basePrototype.options = $.widget.extend( {}, basePrototype.options ); - $.each( prototype, function( prop, value ) { - if ( !$.isFunction( value ) ) { - proxiedPrototype[ prop ] = value; - return; - } - proxiedPrototype[ prop ] = (function() { - var _super = function() { - return base.prototype[ prop ].apply( this, arguments ); - }, - _superApply = function( args ) { - return base.prototype[ prop ].apply( this, args ); - }; - return function() { - var __super = this._super, - __superApply = this._superApply, - returnValue; - - this._super = _super; - this._superApply = _superApply; - - returnValue = value.apply( this, arguments ); - - this._super = __super; - this._superApply = __superApply; - - return returnValue; - }; - })(); - }); - constructor.prototype = $.widget.extend( basePrototype, { - // TODO: remove support for widgetEventPrefix - // always use the name + a colon as the prefix, e.g., draggable:start - // don't prefix for widgets that aren't DOM-based - widgetEventPrefix: existingConstructor ? (basePrototype.widgetEventPrefix || name) : name - }, proxiedPrototype, { - constructor: constructor, - namespace: namespace, - widgetName: name, - widgetFullName: fullName - }); - - // If this widget is being redefined then we need to find all widgets that - // are inheriting from it and redefine all of them so that they inherit from - // the new version of this widget. We're essentially trying to replace one - // level in the prototype chain. - if ( existingConstructor ) { - $.each( existingConstructor._childConstructors, function( i, child ) { - var childPrototype = child.prototype; - - // redefine the child widget using the same prototype that was - // originally used, but inherit from the new version of the base - $.widget( childPrototype.namespace + "." + childPrototype.widgetName, constructor, child._proto ); - }); - // remove the list of existing child constructors from the old constructor - // so the old child constructors can be garbage collected - delete existingConstructor._childConstructors; - } else { - base._childConstructors.push( constructor ); - } - - $.widget.bridge( name, constructor ); - - return constructor; - }; - - $.widget.extend = function( target ) { - var input = widget_slice.call( arguments, 1 ), - inputIndex = 0, - inputLength = input.length, - key, - value; - for ( ; inputIndex < inputLength; inputIndex++ ) { - for ( key in input[ inputIndex ] ) { - value = input[ inputIndex ][ key ]; - if ( input[ inputIndex ].hasOwnProperty( key ) && value !== undefined ) { - // Clone objects - if ( $.isPlainObject( value ) ) { - target[ key ] = $.isPlainObject( target[ key ] ) ? - $.widget.extend( {}, target[ key ], value ) : - // Don't extend strings, arrays, etc. with objects - $.widget.extend( {}, value ); - // Copy everything else by reference - } else { - target[ key ] = value; - } - } - } - } - return target; - }; - - $.widget.bridge = function( name, object ) { - var fullName = object.prototype.widgetFullName || name; - $.fn[ name ] = function( options ) { - var isMethodCall = typeof options === "string", - args = widget_slice.call( arguments, 1 ), - returnValue = this; - - if ( isMethodCall ) { - this.each(function() { - var methodValue, - instance = $.data( this, fullName ); - if ( options === "instance" ) { - returnValue = instance; - return false; - } - if ( !instance ) { - return $.error( "cannot call methods on " + name + " prior to initialization; " + - "attempted to call method '" + options + "'" ); - } - if ( !$.isFunction( instance[options] ) || options.charAt( 0 ) === "_" ) { - return $.error( "no such method '" + options + "' for " + name + " widget instance" ); - } - methodValue = instance[ options ].apply( instance, args ); - if ( methodValue !== instance && methodValue !== undefined ) { - returnValue = methodValue && methodValue.jquery ? - returnValue.pushStack( methodValue.get() ) : - methodValue; - return false; - } - }); - } else { - - // Allow multiple hashes to be passed on init - if ( args.length ) { - options = $.widget.extend.apply( null, [ options ].concat(args) ); - } - - this.each(function() { - var instance = $.data( this, fullName ); - if ( instance ) { - instance.option( options || {} ); - if ( instance._init ) { - instance._init(); - } - } else { - $.data( this, fullName, new object( options, this ) ); - } - }); - } - - return returnValue; - }; - }; - - $.Widget = function( /* options, element */ ) {}; - $.Widget._childConstructors = []; - - $.Widget.prototype = { - widgetName: "widget", - widgetEventPrefix: "", - defaultElement: "
                          ", - options: { - disabled: false, - - // callbacks - create: null - }, - _createWidget: function( options, element ) { - element = $( element || this.defaultElement || this )[ 0 ]; - this.element = $( element ); - this.uuid = widget_uuid++; - this.eventNamespace = "." + this.widgetName + this.uuid; - - this.bindings = $(); - this.hoverable = $(); - this.focusable = $(); - - if ( element !== this ) { - $.data( element, this.widgetFullName, this ); - this._on( true, this.element, { - remove: function( event ) { - if ( event.target === element ) { - this.destroy(); - } - } - }); - this.document = $( element.style ? - // element within the document - element.ownerDocument : - // element is window or document - element.document || element ); - this.window = $( this.document[0].defaultView || this.document[0].parentWindow ); - } - - this.options = $.widget.extend( {}, - this.options, - this._getCreateOptions(), - options ); - - this._create(); - this._trigger( "create", null, this._getCreateEventData() ); - this._init(); - }, - _getCreateOptions: $.noop, - _getCreateEventData: $.noop, - _create: $.noop, - _init: $.noop, - - destroy: function() { - this._destroy(); - // we can probably remove the unbind calls in 2.0 - // all event bindings should go through this._on() - this.element - .unbind( this.eventNamespace ) - .removeData( this.widgetFullName ) - // support: jquery <1.6.3 - // http://bugs.jquery.com/ticket/9413 - .removeData( $.camelCase( this.widgetFullName ) ); - this.widget() - .unbind( this.eventNamespace ) - .removeAttr( "aria-disabled" ) - .removeClass( - this.widgetFullName + "-disabled " + - "ui-state-disabled" ); - - // clean up events and states - this.bindings.unbind( this.eventNamespace ); - this.hoverable.removeClass( "ui-state-hover" ); - this.focusable.removeClass( "ui-state-focus" ); - }, - _destroy: $.noop, - - widget: function() { - return this.element; - }, - - option: function( key, value ) { - var options = key, - parts, - curOption, - i; - - if ( arguments.length === 0 ) { - // don't return a reference to the internal hash - return $.widget.extend( {}, this.options ); - } - - if ( typeof key === "string" ) { - // handle nested keys, e.g., "foo.bar" => { foo: { bar: ___ } } - options = {}; - parts = key.split( "." ); - key = parts.shift(); - if ( parts.length ) { - curOption = options[ key ] = $.widget.extend( {}, this.options[ key ] ); - for ( i = 0; i < parts.length - 1; i++ ) { - curOption[ parts[ i ] ] = curOption[ parts[ i ] ] || {}; - curOption = curOption[ parts[ i ] ]; - } - key = parts.pop(); - if ( arguments.length === 1 ) { - return curOption[ key ] === undefined ? null : curOption[ key ]; - } - curOption[ key ] = value; - } else { - if ( arguments.length === 1 ) { - return this.options[ key ] === undefined ? null : this.options[ key ]; - } - options[ key ] = value; - } - } - - this._setOptions( options ); - - return this; - }, - _setOptions: function( options ) { - var key; - - for ( key in options ) { - this._setOption( key, options[ key ] ); - } - - return this; - }, - _setOption: function( key, value ) { - this.options[ key ] = value; - - if ( key === "disabled" ) { - this.widget() - .toggleClass( this.widgetFullName + "-disabled", !!value ); - - // If the widget is becoming disabled, then nothing is interactive - if ( value ) { - this.hoverable.removeClass( "ui-state-hover" ); - this.focusable.removeClass( "ui-state-focus" ); - } - } - - return this; - }, - - enable: function() { - return this._setOptions({ disabled: false }); - }, - disable: function() { - return this._setOptions({ disabled: true }); - }, - - _on: function( suppressDisabledCheck, element, handlers ) { - var delegateElement, - instance = this; - - // no suppressDisabledCheck flag, shuffle arguments - if ( typeof suppressDisabledCheck !== "boolean" ) { - handlers = element; - element = suppressDisabledCheck; - suppressDisabledCheck = false; - } - - // no element argument, shuffle and use this.element - if ( !handlers ) { - handlers = element; - element = this.element; - delegateElement = this.widget(); - } else { - element = delegateElement = $( element ); - this.bindings = this.bindings.add( element ); - } - - $.each( handlers, function( event, handler ) { - function handlerProxy() { - // allow widgets to customize the disabled handling - // - disabled as an array instead of boolean - // - disabled class as method for disabling individual parts - if ( !suppressDisabledCheck && - ( instance.options.disabled === true || - $( this ).hasClass( "ui-state-disabled" ) ) ) { - return; - } - return ( typeof handler === "string" ? instance[ handler ] : handler ) - .apply( instance, arguments ); - } - - // copy the guid so direct unbinding works - if ( typeof handler !== "string" ) { - handlerProxy.guid = handler.guid = - handler.guid || handlerProxy.guid || $.guid++; - } - - var match = event.match( /^([\w:-]*)\s*(.*)$/ ), - eventName = match[1] + instance.eventNamespace, - selector = match[2]; - if ( selector ) { - delegateElement.delegate( selector, eventName, handlerProxy ); - } else { - element.bind( eventName, handlerProxy ); - } - }); - }, - - _off: function( element, eventName ) { - eventName = (eventName || "").split( " " ).join( this.eventNamespace + " " ) + - this.eventNamespace; - element.unbind( eventName ).undelegate( eventName ); - - // Clear the stack to avoid memory leaks (#10056) - this.bindings = $( this.bindings.not( element ).get() ); - this.focusable = $( this.focusable.not( element ).get() ); - this.hoverable = $( this.hoverable.not( element ).get() ); - }, - - _delay: function( handler, delay ) { - function handlerProxy() { - return ( typeof handler === "string" ? instance[ handler ] : handler ) - .apply( instance, arguments ); - } - var instance = this; - return setTimeout( handlerProxy, delay || 0 ); - }, - - _hoverable: function( element ) { - this.hoverable = this.hoverable.add( element ); - this._on( element, { - mouseenter: function( event ) { - $( event.currentTarget ).addClass( "ui-state-hover" ); - }, - mouseleave: function( event ) { - $( event.currentTarget ).removeClass( "ui-state-hover" ); - } - }); - }, - - _focusable: function( element ) { - this.focusable = this.focusable.add( element ); - this._on( element, { - focusin: function( event ) { - $( event.currentTarget ).addClass( "ui-state-focus" ); - }, - focusout: function( event ) { - $( event.currentTarget ).removeClass( "ui-state-focus" ); - } - }); - }, - - _trigger: function( type, event, data ) { - var prop, orig, - callback = this.options[ type ]; - - data = data || {}; - event = $.Event( event ); - event.type = ( type === this.widgetEventPrefix ? - type : - this.widgetEventPrefix + type ).toLowerCase(); - // the original event may come from any element - // so we need to reset the target on the new event - event.target = this.element[ 0 ]; - - // copy original event properties over to the new event - orig = event.originalEvent; - if ( orig ) { - for ( prop in orig ) { - if ( !( prop in event ) ) { - event[ prop ] = orig[ prop ]; - } - } - } - - this.element.trigger( event, data ); - return !( $.isFunction( callback ) && - callback.apply( this.element[0], [ event ].concat( data ) ) === false || - event.isDefaultPrevented() ); - } - }; - - $.each( { show: "fadeIn", hide: "fadeOut" }, function( method, defaultEffect ) { - $.Widget.prototype[ "_" + method ] = function( element, options, callback ) { - if ( typeof options === "string" ) { - options = { effect: options }; - } - var hasOptions, - effectName = !options ? - method : - options === true || typeof options === "number" ? - defaultEffect : - options.effect || defaultEffect; - options = options || {}; - if ( typeof options === "number" ) { - options = { duration: options }; - } - hasOptions = !$.isEmptyObject( options ); - options.complete = callback; - if ( options.delay ) { - element.delay( options.delay ); - } - if ( hasOptions && $.effects && $.effects.effect[ effectName ] ) { - element[ method ]( options ); - } else if ( effectName !== method && element[ effectName ] ) { - element[ effectName ]( options.duration, options.easing, callback ); - } else { - element.queue(function( next ) { - $( this )[ method ](); - if ( callback ) { - callback.call( element[ 0 ] ); - } - next(); - }); - } - }; - }); - - var widget = $.widget; - - - /*! - * jQuery UI Mouse 1.11.4 - * http://jqueryui.com - * - * Copyright jQuery Foundation and other contributors - * Released under the MIT license. - * http://jquery.org/license - * - * http://api.jqueryui.com/mouse/ - */ - - - var mouseHandled = false; - $( document ).mouseup( function() { - mouseHandled = false; - }); - - var mouse = $.widget("ui.mouse", { - version: "1.11.4", - options: { - cancel: "input,textarea,button,select,option", - distance: 1, - delay: 0 - }, - _mouseInit: function() { - var that = this; - - this.element - .bind("mousedown." + this.widgetName, function(event) { - return that._mouseDown(event); - }) - .bind("click." + this.widgetName, function(event) { - if (true === $.data(event.target, that.widgetName + ".preventClickEvent")) { - $.removeData(event.target, that.widgetName + ".preventClickEvent"); - event.stopImmediatePropagation(); - return false; - } - }); - - this.started = false; - }, - - // TODO: make sure destroying one instance of mouse doesn't mess with - // other instances of mouse - _mouseDestroy: function() { - this.element.unbind("." + this.widgetName); - if ( this._mouseMoveDelegate ) { - this.document - .unbind("mousemove." + this.widgetName, this._mouseMoveDelegate) - .unbind("mouseup." + this.widgetName, this._mouseUpDelegate); - } - }, - - _mouseDown: function(event) { - // don't let more than one widget handle mouseStart - if ( mouseHandled ) { - return; - } - - this._mouseMoved = false; - - // we may have missed mouseup (out of window) - (this._mouseStarted && this._mouseUp(event)); - - this._mouseDownEvent = event; - - var that = this, - btnIsLeft = (event.which === 1), - // event.target.nodeName works around a bug in IE 8 with - // disabled inputs (#7620) - elIsCancel = (typeof this.options.cancel === "string" && event.target.nodeName ? $(event.target).closest(this.options.cancel).length : false); - if (!btnIsLeft || elIsCancel || !this._mouseCapture(event)) { - return true; - } - - this.mouseDelayMet = !this.options.delay; - if (!this.mouseDelayMet) { - this._mouseDelayTimer = setTimeout(function() { - that.mouseDelayMet = true; - }, this.options.delay); - } - - if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) { - this._mouseStarted = (this._mouseStart(event) !== false); - if (!this._mouseStarted) { - event.preventDefault(); - return true; - } - } - - // Click event may never have fired (Gecko & Opera) - if (true === $.data(event.target, this.widgetName + ".preventClickEvent")) { - $.removeData(event.target, this.widgetName + ".preventClickEvent"); - } - - // these delegates are required to keep context - this._mouseMoveDelegate = function(event) { - return that._mouseMove(event); - }; - this._mouseUpDelegate = function(event) { - return that._mouseUp(event); - }; - - this.document - .bind( "mousemove." + this.widgetName, this._mouseMoveDelegate ) - .bind( "mouseup." + this.widgetName, this._mouseUpDelegate ); - - event.preventDefault(); - - mouseHandled = true; - return true; - }, - - _mouseMove: function(event) { - // Only check for mouseups outside the document if you've moved inside the document - // at least once. This prevents the firing of mouseup in the case of IE<9, which will - // fire a mousemove event if content is placed under the cursor. See #7778 - // Support: IE <9 - if ( this._mouseMoved ) { - // IE mouseup check - mouseup happened when mouse was out of window - if ($.ui.ie && ( !document.documentMode || document.documentMode < 9 ) && !event.button) { - return this._mouseUp(event); - - // Iframe mouseup check - mouseup occurred in another document - } else if ( !event.which ) { - return this._mouseUp( event ); - } - } - - if ( event.which || event.button ) { - this._mouseMoved = true; - } - - if (this._mouseStarted) { - this._mouseDrag(event); - return event.preventDefault(); - } - - if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) { - this._mouseStarted = - (this._mouseStart(this._mouseDownEvent, event) !== false); - (this._mouseStarted ? this._mouseDrag(event) : this._mouseUp(event)); - } - - return !this._mouseStarted; - }, - - _mouseUp: function(event) { - this.document - .unbind( "mousemove." + this.widgetName, this._mouseMoveDelegate ) - .unbind( "mouseup." + this.widgetName, this._mouseUpDelegate ); - - if (this._mouseStarted) { - this._mouseStarted = false; - - if (event.target === this._mouseDownEvent.target) { - $.data(event.target, this.widgetName + ".preventClickEvent", true); - } - - this._mouseStop(event); - } - - mouseHandled = false; - return false; - }, - - _mouseDistanceMet: function(event) { - return (Math.max( - Math.abs(this._mouseDownEvent.pageX - event.pageX), - Math.abs(this._mouseDownEvent.pageY - event.pageY) - ) >= this.options.distance - ); - }, - - _mouseDelayMet: function(/* event */) { - return this.mouseDelayMet; - }, - - // These are placeholder methods, to be overriden by extending plugin - _mouseStart: function(/* event */) {}, - _mouseDrag: function(/* event */) {}, - _mouseStop: function(/* event */) {}, - _mouseCapture: function(/* event */) { return true; } - }); - - - /*! - * jQuery UI Position 1.11.4 - * http://jqueryui.com - * - * Copyright jQuery Foundation and other contributors - * Released under the MIT license. - * http://jquery.org/license - * - * http://api.jqueryui.com/position/ - */ - - (function() { - - $.ui = $.ui || {}; - - var cachedScrollbarWidth, supportsOffsetFractions, - max = Math.max, - abs = Math.abs, - round = Math.round, - rhorizontal = /left|center|right/, - rvertical = /top|center|bottom/, - roffset = /[\+\-]\d+(\.[\d]+)?%?/, - rposition = /^\w+/, - rpercent = /%$/, - _position = $.fn.position; - - function getOffsets( offsets, width, height ) { - return [ - parseFloat( offsets[ 0 ] ) * ( rpercent.test( offsets[ 0 ] ) ? width / 100 : 1 ), - parseFloat( offsets[ 1 ] ) * ( rpercent.test( offsets[ 1 ] ) ? height / 100 : 1 ) - ]; - } - - function parseCss( element, property ) { - return parseInt( $.css( element, property ), 10 ) || 0; - } - - function getDimensions( elem ) { - var raw = elem[0]; - if ( raw.nodeType === 9 ) { - return { - width: elem.width(), - height: elem.height(), - offset: { top: 0, left: 0 } - }; - } - if ( $.isWindow( raw ) ) { - return { - width: elem.width(), - height: elem.height(), - offset: { top: elem.scrollTop(), left: elem.scrollLeft() } - }; - } - if ( raw.preventDefault ) { - return { - width: 0, - height: 0, - offset: { top: raw.pageY, left: raw.pageX } - }; - } - return { - width: elem.outerWidth(), - height: elem.outerHeight(), - offset: elem.offset() - }; - } - - $.position = { - scrollbarWidth: function() { - if ( cachedScrollbarWidth !== undefined ) { - return cachedScrollbarWidth; - } - var w1, w2, - div = $( "
                          " ), - innerDiv = div.children()[0]; - - $( "body" ).append( div ); - w1 = innerDiv.offsetWidth; - div.css( "overflow", "scroll" ); - - w2 = innerDiv.offsetWidth; - - if ( w1 === w2 ) { - w2 = div[0].clientWidth; - } - - div.remove(); - - return (cachedScrollbarWidth = w1 - w2); - }, - getScrollInfo: function( within ) { - var overflowX = within.isWindow || within.isDocument ? "" : - within.element.css( "overflow-x" ), - overflowY = within.isWindow || within.isDocument ? "" : - within.element.css( "overflow-y" ), - hasOverflowX = overflowX === "scroll" || - ( overflowX === "auto" && within.width < within.element[0].scrollWidth ), - hasOverflowY = overflowY === "scroll" || - ( overflowY === "auto" && within.height < within.element[0].scrollHeight ); - return { - width: hasOverflowY ? $.position.scrollbarWidth() : 0, - height: hasOverflowX ? $.position.scrollbarWidth() : 0 - }; - }, - getWithinInfo: function( element ) { - var withinElement = $( element || window ), - isWindow = $.isWindow( withinElement[0] ), - isDocument = !!withinElement[ 0 ] && withinElement[ 0 ].nodeType === 9; - return { - element: withinElement, - isWindow: isWindow, - isDocument: isDocument, - offset: withinElement.offset() || { left: 0, top: 0 }, - scrollLeft: withinElement.scrollLeft(), - scrollTop: withinElement.scrollTop(), - - // support: jQuery 1.6.x - // jQuery 1.6 doesn't support .outerWidth/Height() on documents or windows - width: isWindow || isDocument ? withinElement.width() : withinElement.outerWidth(), - height: isWindow || isDocument ? withinElement.height() : withinElement.outerHeight() - }; - } - }; - - $.fn.position = function( options ) { - if ( !options || !options.of ) { - return _position.apply( this, arguments ); - } - - // make a copy, we don't want to modify arguments - options = $.extend( {}, options ); - - var atOffset, targetWidth, targetHeight, targetOffset, basePosition, dimensions, - target = $( options.of ), - within = $.position.getWithinInfo( options.within ), - scrollInfo = $.position.getScrollInfo( within ), - collision = ( options.collision || "flip" ).split( " " ), - offsets = {}; - - dimensions = getDimensions( target ); - if ( target[0].preventDefault ) { - // force left top to allow flipping - options.at = "left top"; - } - targetWidth = dimensions.width; - targetHeight = dimensions.height; - targetOffset = dimensions.offset; - // clone to reuse original targetOffset later - basePosition = $.extend( {}, targetOffset ); - - // force my and at to have valid horizontal and vertical positions - // if a value is missing or invalid, it will be converted to center - $.each( [ "my", "at" ], function() { - var pos = ( options[ this ] || "" ).split( " " ), - horizontalOffset, - verticalOffset; - - if ( pos.length === 1) { - pos = rhorizontal.test( pos[ 0 ] ) ? - pos.concat( [ "center" ] ) : - rvertical.test( pos[ 0 ] ) ? - [ "center" ].concat( pos ) : - [ "center", "center" ]; - } - pos[ 0 ] = rhorizontal.test( pos[ 0 ] ) ? pos[ 0 ] : "center"; - pos[ 1 ] = rvertical.test( pos[ 1 ] ) ? pos[ 1 ] : "center"; - - // calculate offsets - horizontalOffset = roffset.exec( pos[ 0 ] ); - verticalOffset = roffset.exec( pos[ 1 ] ); - offsets[ this ] = [ - horizontalOffset ? horizontalOffset[ 0 ] : 0, - verticalOffset ? verticalOffset[ 0 ] : 0 - ]; - - // reduce to just the positions without the offsets - options[ this ] = [ - rposition.exec( pos[ 0 ] )[ 0 ], - rposition.exec( pos[ 1 ] )[ 0 ] - ]; - }); - - // normalize collision option - if ( collision.length === 1 ) { - collision[ 1 ] = collision[ 0 ]; - } - - if ( options.at[ 0 ] === "right" ) { - basePosition.left += targetWidth; - } else if ( options.at[ 0 ] === "center" ) { - basePosition.left += targetWidth / 2; - } - - if ( options.at[ 1 ] === "bottom" ) { - basePosition.top += targetHeight; - } else if ( options.at[ 1 ] === "center" ) { - basePosition.top += targetHeight / 2; - } - - atOffset = getOffsets( offsets.at, targetWidth, targetHeight ); - basePosition.left += atOffset[ 0 ]; - basePosition.top += atOffset[ 1 ]; - - return this.each(function() { - var collisionPosition, using, - elem = $( this ), - elemWidth = elem.outerWidth(), - elemHeight = elem.outerHeight(), - marginLeft = parseCss( this, "marginLeft" ), - marginTop = parseCss( this, "marginTop" ), - collisionWidth = elemWidth + marginLeft + parseCss( this, "marginRight" ) + scrollInfo.width, - collisionHeight = elemHeight + marginTop + parseCss( this, "marginBottom" ) + scrollInfo.height, - position = $.extend( {}, basePosition ), - myOffset = getOffsets( offsets.my, elem.outerWidth(), elem.outerHeight() ); - - if ( options.my[ 0 ] === "right" ) { - position.left -= elemWidth; - } else if ( options.my[ 0 ] === "center" ) { - position.left -= elemWidth / 2; - } - - if ( options.my[ 1 ] === "bottom" ) { - position.top -= elemHeight; - } else if ( options.my[ 1 ] === "center" ) { - position.top -= elemHeight / 2; - } - - position.left += myOffset[ 0 ]; - position.top += myOffset[ 1 ]; - - // if the browser doesn't support fractions, then round for consistent results - if ( !supportsOffsetFractions ) { - position.left = round( position.left ); - position.top = round( position.top ); - } - - collisionPosition = { - marginLeft: marginLeft, - marginTop: marginTop - }; - - $.each( [ "left", "top" ], function( i, dir ) { - if ( $.ui.position[ collision[ i ] ] ) { - $.ui.position[ collision[ i ] ][ dir ]( position, { - targetWidth: targetWidth, - targetHeight: targetHeight, - elemWidth: elemWidth, - elemHeight: elemHeight, - collisionPosition: collisionPosition, - collisionWidth: collisionWidth, - collisionHeight: collisionHeight, - offset: [ atOffset[ 0 ] + myOffset[ 0 ], atOffset [ 1 ] + myOffset[ 1 ] ], - my: options.my, - at: options.at, - within: within, - elem: elem - }); - } - }); - - if ( options.using ) { - // adds feedback as second argument to using callback, if present - using = function( props ) { - var left = targetOffset.left - position.left, - right = left + targetWidth - elemWidth, - top = targetOffset.top - position.top, - bottom = top + targetHeight - elemHeight, - feedback = { - target: { - element: target, - left: targetOffset.left, - top: targetOffset.top, - width: targetWidth, - height: targetHeight - }, - element: { - element: elem, - left: position.left, - top: position.top, - width: elemWidth, - height: elemHeight - }, - horizontal: right < 0 ? "left" : left > 0 ? "right" : "center", - vertical: bottom < 0 ? "top" : top > 0 ? "bottom" : "middle" - }; - if ( targetWidth < elemWidth && abs( left + right ) < targetWidth ) { - feedback.horizontal = "center"; - } - if ( targetHeight < elemHeight && abs( top + bottom ) < targetHeight ) { - feedback.vertical = "middle"; - } - if ( max( abs( left ), abs( right ) ) > max( abs( top ), abs( bottom ) ) ) { - feedback.important = "horizontal"; - } else { - feedback.important = "vertical"; - } - options.using.call( this, props, feedback ); - }; - } - - elem.offset( $.extend( position, { using: using } ) ); - }); - }; - - $.ui.position = { - fit: { - left: function( position, data ) { - var within = data.within, - withinOffset = within.isWindow ? within.scrollLeft : within.offset.left, - outerWidth = within.width, - collisionPosLeft = position.left - data.collisionPosition.marginLeft, - overLeft = withinOffset - collisionPosLeft, - overRight = collisionPosLeft + data.collisionWidth - outerWidth - withinOffset, - newOverRight; - - // element is wider than within - if ( data.collisionWidth > outerWidth ) { - // element is initially over the left side of within - if ( overLeft > 0 && overRight <= 0 ) { - newOverRight = position.left + overLeft + data.collisionWidth - outerWidth - withinOffset; - position.left += overLeft - newOverRight; - // element is initially over right side of within - } else if ( overRight > 0 && overLeft <= 0 ) { - position.left = withinOffset; - // element is initially over both left and right sides of within - } else { - if ( overLeft > overRight ) { - position.left = withinOffset + outerWidth - data.collisionWidth; - } else { - position.left = withinOffset; - } - } - // too far left -> align with left edge - } else if ( overLeft > 0 ) { - position.left += overLeft; - // too far right -> align with right edge - } else if ( overRight > 0 ) { - position.left -= overRight; - // adjust based on position and margin - } else { - position.left = max( position.left - collisionPosLeft, position.left ); - } - }, - top: function( position, data ) { - var within = data.within, - withinOffset = within.isWindow ? within.scrollTop : within.offset.top, - outerHeight = data.within.height, - collisionPosTop = position.top - data.collisionPosition.marginTop, - overTop = withinOffset - collisionPosTop, - overBottom = collisionPosTop + data.collisionHeight - outerHeight - withinOffset, - newOverBottom; - - // element is taller than within - if ( data.collisionHeight > outerHeight ) { - // element is initially over the top of within - if ( overTop > 0 && overBottom <= 0 ) { - newOverBottom = position.top + overTop + data.collisionHeight - outerHeight - withinOffset; - position.top += overTop - newOverBottom; - // element is initially over bottom of within - } else if ( overBottom > 0 && overTop <= 0 ) { - position.top = withinOffset; - // element is initially over both top and bottom of within - } else { - if ( overTop > overBottom ) { - position.top = withinOffset + outerHeight - data.collisionHeight; - } else { - position.top = withinOffset; - } - } - // too far up -> align with top - } else if ( overTop > 0 ) { - position.top += overTop; - // too far down -> align with bottom edge - } else if ( overBottom > 0 ) { - position.top -= overBottom; - // adjust based on position and margin - } else { - position.top = max( position.top - collisionPosTop, position.top ); - } - } - }, - flip: { - left: function( position, data ) { - var within = data.within, - withinOffset = within.offset.left + within.scrollLeft, - outerWidth = within.width, - offsetLeft = within.isWindow ? within.scrollLeft : within.offset.left, - collisionPosLeft = position.left - data.collisionPosition.marginLeft, - overLeft = collisionPosLeft - offsetLeft, - overRight = collisionPosLeft + data.collisionWidth - outerWidth - offsetLeft, - myOffset = data.my[ 0 ] === "left" ? - -data.elemWidth : - data.my[ 0 ] === "right" ? - data.elemWidth : - 0, - atOffset = data.at[ 0 ] === "left" ? - data.targetWidth : - data.at[ 0 ] === "right" ? - -data.targetWidth : - 0, - offset = -2 * data.offset[ 0 ], - newOverRight, - newOverLeft; - - if ( overLeft < 0 ) { - newOverRight = position.left + myOffset + atOffset + offset + data.collisionWidth - outerWidth - withinOffset; - if ( newOverRight < 0 || newOverRight < abs( overLeft ) ) { - position.left += myOffset + atOffset + offset; - } - } else if ( overRight > 0 ) { - newOverLeft = position.left - data.collisionPosition.marginLeft + myOffset + atOffset + offset - offsetLeft; - if ( newOverLeft > 0 || abs( newOverLeft ) < overRight ) { - position.left += myOffset + atOffset + offset; - } - } - }, - top: function( position, data ) { - var within = data.within, - withinOffset = within.offset.top + within.scrollTop, - outerHeight = within.height, - offsetTop = within.isWindow ? within.scrollTop : within.offset.top, - collisionPosTop = position.top - data.collisionPosition.marginTop, - overTop = collisionPosTop - offsetTop, - overBottom = collisionPosTop + data.collisionHeight - outerHeight - offsetTop, - top = data.my[ 1 ] === "top", - myOffset = top ? - -data.elemHeight : - data.my[ 1 ] === "bottom" ? - data.elemHeight : - 0, - atOffset = data.at[ 1 ] === "top" ? - data.targetHeight : - data.at[ 1 ] === "bottom" ? - -data.targetHeight : - 0, - offset = -2 * data.offset[ 1 ], - newOverTop, - newOverBottom; - if ( overTop < 0 ) { - newOverBottom = position.top + myOffset + atOffset + offset + data.collisionHeight - outerHeight - withinOffset; - if ( newOverBottom < 0 || newOverBottom < abs( overTop ) ) { - position.top += myOffset + atOffset + offset; - } - } else if ( overBottom > 0 ) { - newOverTop = position.top - data.collisionPosition.marginTop + myOffset + atOffset + offset - offsetTop; - if ( newOverTop > 0 || abs( newOverTop ) < overBottom ) { - position.top += myOffset + atOffset + offset; - } - } - } - }, - flipfit: { - left: function() { - $.ui.position.flip.left.apply( this, arguments ); - $.ui.position.fit.left.apply( this, arguments ); - }, - top: function() { - $.ui.position.flip.top.apply( this, arguments ); - $.ui.position.fit.top.apply( this, arguments ); - } - } - }; - -// fraction support test - (function() { - var testElement, testElementParent, testElementStyle, offsetLeft, i, - body = document.getElementsByTagName( "body" )[ 0 ], - div = document.createElement( "div" ); - - //Create a "fake body" for testing based on method used in jQuery.support - testElement = document.createElement( body ? "div" : "body" ); - testElementStyle = { - visibility: "hidden", - width: 0, - height: 0, - border: 0, - margin: 0, - background: "none" - }; - if ( body ) { - $.extend( testElementStyle, { - position: "absolute", - left: "-1000px", - top: "-1000px" - }); - } - for ( i in testElementStyle ) { - testElement.style[ i ] = testElementStyle[ i ]; - } - testElement.appendChild( div ); - testElementParent = body || document.documentElement; - testElementParent.insertBefore( testElement, testElementParent.firstChild ); - - div.style.cssText = "position: absolute; left: 10.7432222px;"; - - offsetLeft = $( div ).offset().left; - supportsOffsetFractions = offsetLeft > 10 && offsetLeft < 11; - - testElement.innerHTML = ""; - testElementParent.removeChild( testElement ); - })(); - - })(); - - var position = $.ui.position; - - - /*! - * jQuery UI Datepicker 1.11.4 - * http://jqueryui.com - * - * Copyright jQuery Foundation and other contributors - * Released under the MIT license. - * http://jquery.org/license - * - * http://api.jqueryui.com/datepicker/ - */ - - - $.extend($.ui, { datepicker: { version: "1.11.4" } }); - - var datepicker_instActive; - - function datepicker_getZindex( elem ) { - var position, value; - while ( elem.length && elem[ 0 ] !== document ) { - // Ignore z-index if position is set to a value where z-index is ignored by the browser - // This makes behavior of this function consistent across browsers - // WebKit always returns auto if the element is positioned - position = elem.css( "position" ); - if ( position === "absolute" || position === "relative" || position === "fixed" ) { - // IE returns 0 when zIndex is not specified - // other browsers return a string - // we ignore the case of nested elements with an explicit value of 0 - //
                          - value = parseInt( elem.css( "zIndex" ), 10 ); - if ( !isNaN( value ) && value !== 0 ) { - return value; - } - } - elem = elem.parent(); - } - - return 0; - } - /* Date picker manager. - Use the singleton instance of this class, $.datepicker, to interact with the date picker. - Settings for (groups of) date pickers are maintained in an instance object, - allowing multiple different settings on the same page. */ - - function Datepicker() { - this._curInst = null; // The current instance in use - this._keyEvent = false; // If the last event was a key event - this._disabledInputs = []; // List of date picker inputs that have been disabled - this._datepickerShowing = false; // True if the popup picker is showing , false if not - this._inDialog = false; // True if showing within a "dialog", false if not - this._mainDivId = "ui-datepicker-div"; // The ID of the main datepicker division - this._inlineClass = "ui-datepicker-inline"; // The name of the inline marker class - this._appendClass = "ui-datepicker-append"; // The name of the append marker class - this._triggerClass = "ui-datepicker-trigger"; // The name of the trigger marker class - this._dialogClass = "ui-datepicker-dialog"; // The name of the dialog marker class - this._disableClass = "ui-datepicker-disabled"; // The name of the disabled covering marker class - this._unselectableClass = "ui-datepicker-unselectable"; // The name of the unselectable cell marker class - this._currentClass = "ui-datepicker-current-day"; // The name of the current day marker class - this._dayOverClass = "ui-datepicker-days-cell-over"; // The name of the day hover marker class - this.regional = []; // Available regional settings, indexed by language code - this.regional[""] = { // Default regional settings - closeText: "Done", // Display text for close link - prevText: "Prev", // Display text for previous month link - nextText: "Next", // Display text for next month link - currentText: "Today", // Display text for current month link - monthNames: ["January","February","March","April","May","June", - "July","August","September","October","November","December"], // Names of months for drop-down and formatting - monthNamesShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], // For formatting - dayNames: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], // For formatting - dayNamesShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], // For formatting - dayNamesMin: ["Su","Mo","Tu","We","Th","Fr","Sa"], // Column headings for days starting at Sunday - weekHeader: "Wk", // Column header for week of the year - dateFormat: "mm/dd/yy", // See format options on parseDate - firstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ... - isRTL: false, // True if right-to-left language, false if left-to-right - showMonthAfterYear: false, // True if the year select precedes month, false for month then year - yearSuffix: "" // Additional text to append to the year in the month headers - }; - this._defaults = { // Global defaults for all the date picker instances - showOn: "focus", // "focus" for popup on focus, - // "button" for trigger button, or "both" for either - showAnim: "fadeIn", // Name of jQuery animation for popup - showOptions: {}, // Options for enhanced animations - defaultDate: null, // Used when field is blank: actual date, - // +/-number for offset from today, null for today - appendText: "", // Display text following the input box, e.g. showing the format - buttonText: "...", // Text for trigger button - buttonImage: "", // URL for trigger button image - buttonImageOnly: false, // True if the image appears alone, false if it appears on a button - hideIfNoPrevNext: false, // True to hide next/previous month links - // if not applicable, false to just disable them - navigationAsDateFormat: false, // True if date formatting applied to prev/today/next links - gotoCurrent: false, // True if today link goes back to current selection instead - changeMonth: false, // True if month can be selected directly, false if only prev/next - changeYear: false, // True if year can be selected directly, false if only prev/next - yearRange: "c-10:c+10", // Range of years to display in drop-down, - // either relative to today's year (-nn:+nn), relative to currently displayed year - // (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n) - showOtherMonths: false, // True to show dates in other months, false to leave blank - selectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable - showWeek: false, // True to show week of the year, false to not show it - calculateWeek: this.iso8601Week, // How to calculate the week of the year, - // takes a Date and returns the number of the week for it - shortYearCutoff: "+10", // Short year values < this are in the current century, - // > this are in the previous century, - // string value starting with "+" for current year + value - minDate: null, // The earliest selectable date, or null for no limit - maxDate: null, // The latest selectable date, or null for no limit - duration: "fast", // Duration of display/closure - beforeShowDay: null, // Function that takes a date and returns an array with - // [0] = true if selectable, false if not, [1] = custom CSS class name(s) or "", - // [2] = cell title (optional), e.g. $.datepicker.noWeekends - beforeShow: null, // Function that takes an input field and - // returns a set of custom settings for the date picker - onSelect: null, // Define a callback function when a date is selected - onChangeMonthYear: null, // Define a callback function when the month or year is changed - onClose: null, // Define a callback function when the datepicker is closed - numberOfMonths: 1, // Number of months to show at a time - showCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0) - stepMonths: 1, // Number of months to step back/forward - stepBigMonths: 12, // Number of months to step back/forward for the big links - altField: "", // Selector for an alternate field to store selected dates into - altFormat: "", // The date format to use for the alternate field - constrainInput: true, // The input is constrained by the current date format - showButtonPanel: false, // True to show button panel, false to not show it - autoSize: false, // True to size the input for the date format, false to leave as is - disabled: false // The initial disabled state - }; - $.extend(this._defaults, this.regional[""]); - this.regional.en = $.extend( true, {}, this.regional[ "" ]); - this.regional[ "en-US" ] = $.extend( true, {}, this.regional.en ); - this.dpDiv = datepicker_bindHover($("
                          ")); - } - - $.extend(Datepicker.prototype, { - /* Class name added to elements to indicate already configured with a date picker. */ - markerClassName: "hasDatepicker", - - //Keep track of the maximum number of rows displayed (see #7043) - maxRows: 4, - - // TODO rename to "widget" when switching to widget factory - _widgetDatepicker: function() { - return this.dpDiv; - }, - - /* Override the default settings for all instances of the date picker. - * @param settings object - the new settings to use as defaults (anonymous object) - * @return the manager object - */ - setDefaults: function(settings) { - datepicker_extendRemove(this._defaults, settings || {}); - return this; - }, - - /* Attach the date picker to a jQuery selection. - * @param target element - the target input field or division or span - * @param settings object - the new settings to use for this date picker instance (anonymous) - */ - _attachDatepicker: function(target, settings) { - var nodeName, inline, inst; - nodeName = target.nodeName.toLowerCase(); - inline = (nodeName === "div" || nodeName === "span"); - if (!target.id) { - this.uuid += 1; - target.id = "dp" + this.uuid; - } - inst = this._newInst($(target), inline); - inst.settings = $.extend({}, settings || {}); - if (nodeName === "input") { - this._connectDatepicker(target, inst); - } else if (inline) { - this._inlineDatepicker(target, inst); - } - }, - - /* Create a new instance object. */ - _newInst: function(target, inline) { - var id = target[0].id.replace(/([^A-Za-z0-9_\-])/g, "\\\\$1"); // escape jQuery meta chars - return {id: id, input: target, // associated target - selectedDay: 0, selectedMonth: 0, selectedYear: 0, // current selection - drawMonth: 0, drawYear: 0, // month being drawn - inline: inline, // is datepicker inline or not - dpDiv: (!inline ? this.dpDiv : // presentation div - datepicker_bindHover($("
                          ")))}; - }, - - /* Attach the date picker to an input field. */ - _connectDatepicker: function(target, inst) { - var input = $(target); - inst.append = $([]); - inst.trigger = $([]); - if (input.hasClass(this.markerClassName)) { - return; - } - this._attachments(input, inst); - input.addClass(this.markerClassName).keydown(this._doKeyDown). - keypress(this._doKeyPress).keyup(this._doKeyUp); - this._autoSize(inst); - $.data(target, "datepicker", inst); - //If disabled option is true, disable the datepicker once it has been attached to the input (see ticket #5665) - if( inst.settings.disabled ) { - this._disableDatepicker( target ); - } - }, - - /* Make attachments based on settings. */ - _attachments: function(input, inst) { - var showOn, buttonText, buttonImage, - appendText = this._get(inst, "appendText"), - isRTL = this._get(inst, "isRTL"); - - if (inst.append) { - inst.append.remove(); - } - if (appendText) { - inst.append = $("" + appendText + ""); - input[isRTL ? "before" : "after"](inst.append); - } - - input.unbind("focus", this._showDatepicker); - - if (inst.trigger) { - inst.trigger.remove(); - } - - showOn = this._get(inst, "showOn"); - if (showOn === "focus" || showOn === "both") { // pop-up date picker when in the marked field - input.focus(this._showDatepicker); - } - if (showOn === "button" || showOn === "both") { // pop-up date picker when button clicked - buttonText = this._get(inst, "buttonText"); - buttonImage = this._get(inst, "buttonImage"); - inst.trigger = $(this._get(inst, "buttonImageOnly") ? - $("").addClass(this._triggerClass). - attr({ src: buttonImage, alt: buttonText, title: buttonText }) : - $("").addClass(this._triggerClass). - html(!buttonImage ? buttonText : $("").attr( - { src:buttonImage, alt:buttonText, title:buttonText }))); - input[isRTL ? "before" : "after"](inst.trigger); - inst.trigger.click(function() { - if ($.datepicker._datepickerShowing && $.datepicker._lastInput === input[0]) { - $.datepicker._hideDatepicker(); - } else if ($.datepicker._datepickerShowing && $.datepicker._lastInput !== input[0]) { - $.datepicker._hideDatepicker(); - $.datepicker._showDatepicker(input[0]); - } else { - $.datepicker._showDatepicker(input[0]); - } - return false; - }); - } - }, - - /* Apply the maximum length for the date format. */ - _autoSize: function(inst) { - if (this._get(inst, "autoSize") && !inst.inline) { - var findMax, max, maxI, i, - date = new Date(2009, 12 - 1, 20), // Ensure double digits - dateFormat = this._get(inst, "dateFormat"); - - if (dateFormat.match(/[DM]/)) { - findMax = function(names) { - max = 0; - maxI = 0; - for (i = 0; i < names.length; i++) { - if (names[i].length > max) { - max = names[i].length; - maxI = i; - } - } - return maxI; - }; - date.setMonth(findMax(this._get(inst, (dateFormat.match(/MM/) ? - "monthNames" : "monthNamesShort")))); - date.setDate(findMax(this._get(inst, (dateFormat.match(/DD/) ? - "dayNames" : "dayNamesShort"))) + 20 - date.getDay()); - } - inst.input.attr("size", this._formatDate(inst, date).length); - } - }, - - /* Attach an inline date picker to a div. */ - _inlineDatepicker: function(target, inst) { - var divSpan = $(target); - if (divSpan.hasClass(this.markerClassName)) { - return; - } - divSpan.addClass(this.markerClassName).append(inst.dpDiv); - $.data(target, "datepicker", inst); - this._setDate(inst, this._getDefaultDate(inst), true); - this._updateDatepicker(inst); - this._updateAlternate(inst); - //If disabled option is true, disable the datepicker before showing it (see ticket #5665) - if( inst.settings.disabled ) { - this._disableDatepicker( target ); - } - // Set display:block in place of inst.dpDiv.show() which won't work on disconnected elements - // http://bugs.jqueryui.com/ticket/7552 - A Datepicker created on a detached div has zero height - inst.dpDiv.css( "display", "block" ); - }, - - /* Pop-up the date picker in a "dialog" box. - * @param input element - ignored - * @param date string or Date - the initial date to display - * @param onSelect function - the function to call when a date is selected - * @param settings object - update the dialog date picker instance's settings (anonymous object) - * @param pos int[2] - coordinates for the dialog's position within the screen or - * event - with x/y coordinates or - * leave empty for default (screen centre) - * @return the manager object - */ - _dialogDatepicker: function(input, date, onSelect, settings, pos) { - var id, browserWidth, browserHeight, scrollX, scrollY, - inst = this._dialogInst; // internal instance - - if (!inst) { - this.uuid += 1; - id = "dp" + this.uuid; - this._dialogInput = $(""); - this._dialogInput.keydown(this._doKeyDown); - $("body").append(this._dialogInput); - inst = this._dialogInst = this._newInst(this._dialogInput, false); - inst.settings = {}; - $.data(this._dialogInput[0], "datepicker", inst); - } - datepicker_extendRemove(inst.settings, settings || {}); - date = (date && date.constructor === Date ? this._formatDate(inst, date) : date); - this._dialogInput.val(date); - - this._pos = (pos ? (pos.length ? pos : [pos.pageX, pos.pageY]) : null); - if (!this._pos) { - browserWidth = document.documentElement.clientWidth; - browserHeight = document.documentElement.clientHeight; - scrollX = document.documentElement.scrollLeft || document.body.scrollLeft; - scrollY = document.documentElement.scrollTop || document.body.scrollTop; - this._pos = // should use actual width/height below - [(browserWidth / 2) - 100 + scrollX, (browserHeight / 2) - 150 + scrollY]; - } - - // move input on screen for focus, but hidden behind dialog - this._dialogInput.css("left", (this._pos[0] + 20) + "px").css("top", this._pos[1] + "px"); - inst.settings.onSelect = onSelect; - this._inDialog = true; - this.dpDiv.addClass(this._dialogClass); - this._showDatepicker(this._dialogInput[0]); - if ($.blockUI) { - $.blockUI(this.dpDiv); - } - $.data(this._dialogInput[0], "datepicker", inst); - return this; - }, - - /* Detach a datepicker from its control. - * @param target element - the target input field or division or span - */ - _destroyDatepicker: function(target) { - var nodeName, - $target = $(target), - inst = $.data(target, "datepicker"); - - if (!$target.hasClass(this.markerClassName)) { - return; - } - - nodeName = target.nodeName.toLowerCase(); - $.removeData(target, "datepicker"); - if (nodeName === "input") { - inst.append.remove(); - inst.trigger.remove(); - $target.removeClass(this.markerClassName). - unbind("focus", this._showDatepicker). - unbind("keydown", this._doKeyDown). - unbind("keypress", this._doKeyPress). - unbind("keyup", this._doKeyUp); - } else if (nodeName === "div" || nodeName === "span") { - $target.removeClass(this.markerClassName).empty(); - } - - if ( datepicker_instActive === inst ) { - datepicker_instActive = null; - } - }, - - /* Enable the date picker to a jQuery selection. - * @param target element - the target input field or division or span - */ - _enableDatepicker: function(target) { - var nodeName, inline, - $target = $(target), - inst = $.data(target, "datepicker"); - - if (!$target.hasClass(this.markerClassName)) { - return; - } - - nodeName = target.nodeName.toLowerCase(); - if (nodeName === "input") { - target.disabled = false; - inst.trigger.filter("button"). - each(function() { this.disabled = false; }).end(). - filter("img").css({opacity: "1.0", cursor: ""}); - } else if (nodeName === "div" || nodeName === "span") { - inline = $target.children("." + this._inlineClass); - inline.children().removeClass("ui-state-disabled"); - inline.find("select.ui-datepicker-month, select.ui-datepicker-year"). - prop("disabled", false); - } - this._disabledInputs = $.map(this._disabledInputs, - function(value) { return (value === target ? null : value); }); // delete entry - }, - - /* Disable the date picker to a jQuery selection. - * @param target element - the target input field or division or span - */ - _disableDatepicker: function(target) { - var nodeName, inline, - $target = $(target), - inst = $.data(target, "datepicker"); - - if (!$target.hasClass(this.markerClassName)) { - return; - } - - nodeName = target.nodeName.toLowerCase(); - if (nodeName === "input") { - target.disabled = true; - inst.trigger.filter("button"). - each(function() { this.disabled = true; }).end(). - filter("img").css({opacity: "0.5", cursor: "default"}); - } else if (nodeName === "div" || nodeName === "span") { - inline = $target.children("." + this._inlineClass); - inline.children().addClass("ui-state-disabled"); - inline.find("select.ui-datepicker-month, select.ui-datepicker-year"). - prop("disabled", true); - } - this._disabledInputs = $.map(this._disabledInputs, - function(value) { return (value === target ? null : value); }); // delete entry - this._disabledInputs[this._disabledInputs.length] = target; - }, - - /* Is the first field in a jQuery collection disabled as a datepicker? - * @param target element - the target input field or division or span - * @return boolean - true if disabled, false if enabled - */ - _isDisabledDatepicker: function(target) { - if (!target) { - return false; - } - for (var i = 0; i < this._disabledInputs.length; i++) { - if (this._disabledInputs[i] === target) { - return true; - } - } - return false; - }, - - /* Retrieve the instance data for the target control. - * @param target element - the target input field or division or span - * @return object - the associated instance data - * @throws error if a jQuery problem getting data - */ - _getInst: function(target) { - try { - return $.data(target, "datepicker"); - } - catch (err) { - throw "Missing instance data for this datepicker"; - } - }, - - /* Update or retrieve the settings for a date picker attached to an input field or division. - * @param target element - the target input field or division or span - * @param name object - the new settings to update or - * string - the name of the setting to change or retrieve, - * when retrieving also "all" for all instance settings or - * "defaults" for all global defaults - * @param value any - the new value for the setting - * (omit if above is an object or to retrieve a value) - */ - _optionDatepicker: function(target, name, value) { - var settings, date, minDate, maxDate, - inst = this._getInst(target); - - if (arguments.length === 2 && typeof name === "string") { - return (name === "defaults" ? $.extend({}, $.datepicker._defaults) : - (inst ? (name === "all" ? $.extend({}, inst.settings) : - this._get(inst, name)) : null)); - } - - settings = name || {}; - if (typeof name === "string") { - settings = {}; - settings[name] = value; - } - - if (inst) { - if (this._curInst === inst) { - this._hideDatepicker(); - } - - date = this._getDateDatepicker(target, true); - minDate = this._getMinMaxDate(inst, "min"); - maxDate = this._getMinMaxDate(inst, "max"); - datepicker_extendRemove(inst.settings, settings); - // reformat the old minDate/maxDate values if dateFormat changes and a new minDate/maxDate isn't provided - if (minDate !== null && settings.dateFormat !== undefined && settings.minDate === undefined) { - inst.settings.minDate = this._formatDate(inst, minDate); - } - if (maxDate !== null && settings.dateFormat !== undefined && settings.maxDate === undefined) { - inst.settings.maxDate = this._formatDate(inst, maxDate); - } - if ( "disabled" in settings ) { - if ( settings.disabled ) { - this._disableDatepicker(target); - } else { - this._enableDatepicker(target); - } - } - this._attachments($(target), inst); - this._autoSize(inst); - this._setDate(inst, date); - this._updateAlternate(inst); - this._updateDatepicker(inst); - } - }, - - // change method deprecated - _changeDatepicker: function(target, name, value) { - this._optionDatepicker(target, name, value); - }, - - /* Redraw the date picker attached to an input field or division. - * @param target element - the target input field or division or span - */ - _refreshDatepicker: function(target) { - var inst = this._getInst(target); - if (inst) { - this._updateDatepicker(inst); - } - }, - - /* Set the dates for a jQuery selection. - * @param target element - the target input field or division or span - * @param date Date - the new date - */ - _setDateDatepicker: function(target, date) { - var inst = this._getInst(target); - if (inst) { - this._setDate(inst, date); - this._updateDatepicker(inst); - this._updateAlternate(inst); - } - }, - - /* Get the date(s) for the first entry in a jQuery selection. - * @param target element - the target input field or division or span - * @param noDefault boolean - true if no default date is to be used - * @return Date - the current date - */ - _getDateDatepicker: function(target, noDefault) { - var inst = this._getInst(target); - if (inst && !inst.inline) { - this._setDateFromField(inst, noDefault); - } - return (inst ? this._getDate(inst) : null); - }, - - /* Handle keystrokes. */ - _doKeyDown: function(event) { - var onSelect, dateStr, sel, - inst = $.datepicker._getInst(event.target), - handled = true, - isRTL = inst.dpDiv.is(".ui-datepicker-rtl"); - - inst._keyEvent = true; - if ($.datepicker._datepickerShowing) { - switch (event.keyCode) { - case 9: $.datepicker._hideDatepicker(); - handled = false; - break; // hide on tab out - case 13: sel = $("td." + $.datepicker._dayOverClass + ":not(." + - $.datepicker._currentClass + ")", inst.dpDiv); - if (sel[0]) { - $.datepicker._selectDay(event.target, inst.selectedMonth, inst.selectedYear, sel[0]); - } - - onSelect = $.datepicker._get(inst, "onSelect"); - if (onSelect) { - dateStr = $.datepicker._formatDate(inst); - - // trigger custom callback - onSelect.apply((inst.input ? inst.input[0] : null), [dateStr, inst]); - } else { - $.datepicker._hideDatepicker(); - } - - return false; // don't submit the form - case 27: $.datepicker._hideDatepicker(); - break; // hide on escape - case 33: $.datepicker._adjustDate(event.target, (event.ctrlKey ? - -$.datepicker._get(inst, "stepBigMonths") : - -$.datepicker._get(inst, "stepMonths")), "M"); - break; // previous month/year on page up/+ ctrl - case 34: $.datepicker._adjustDate(event.target, (event.ctrlKey ? - +$.datepicker._get(inst, "stepBigMonths") : - +$.datepicker._get(inst, "stepMonths")), "M"); - break; // next month/year on page down/+ ctrl - case 35: if (event.ctrlKey || event.metaKey) { - $.datepicker._clearDate(event.target); - } - handled = event.ctrlKey || event.metaKey; - break; // clear on ctrl or command +end - case 36: if (event.ctrlKey || event.metaKey) { - $.datepicker._gotoToday(event.target); - } - handled = event.ctrlKey || event.metaKey; - break; // current on ctrl or command +home - case 37: if (event.ctrlKey || event.metaKey) { - $.datepicker._adjustDate(event.target, (isRTL ? +1 : -1), "D"); - } - handled = event.ctrlKey || event.metaKey; - // -1 day on ctrl or command +left - if (event.originalEvent.altKey) { - $.datepicker._adjustDate(event.target, (event.ctrlKey ? - -$.datepicker._get(inst, "stepBigMonths") : - -$.datepicker._get(inst, "stepMonths")), "M"); - } - // next month/year on alt +left on Mac - break; - case 38: if (event.ctrlKey || event.metaKey) { - $.datepicker._adjustDate(event.target, -7, "D"); - } - handled = event.ctrlKey || event.metaKey; - break; // -1 week on ctrl or command +up - case 39: if (event.ctrlKey || event.metaKey) { - $.datepicker._adjustDate(event.target, (isRTL ? -1 : +1), "D"); - } - handled = event.ctrlKey || event.metaKey; - // +1 day on ctrl or command +right - if (event.originalEvent.altKey) { - $.datepicker._adjustDate(event.target, (event.ctrlKey ? - +$.datepicker._get(inst, "stepBigMonths") : - +$.datepicker._get(inst, "stepMonths")), "M"); - } - // next month/year on alt +right - break; - case 40: if (event.ctrlKey || event.metaKey) { - $.datepicker._adjustDate(event.target, +7, "D"); - } - handled = event.ctrlKey || event.metaKey; - break; // +1 week on ctrl or command +down - default: handled = false; - } - } else if (event.keyCode === 36 && event.ctrlKey) { // display the date picker on ctrl+home - $.datepicker._showDatepicker(this); - } else { - handled = false; - } - - if (handled) { - event.preventDefault(); - event.stopPropagation(); - } - }, - - /* Filter entered characters - based on date format. */ - _doKeyPress: function(event) { - var chars, chr, - inst = $.datepicker._getInst(event.target); - - if ($.datepicker._get(inst, "constrainInput")) { - chars = $.datepicker._possibleChars($.datepicker._get(inst, "dateFormat")); - chr = String.fromCharCode(event.charCode == null ? event.keyCode : event.charCode); - return event.ctrlKey || event.metaKey || (chr < " " || !chars || chars.indexOf(chr) > -1); - } - }, - - /* Synchronise manual entry and field/alternate field. */ - _doKeyUp: function(event) { - var date, - inst = $.datepicker._getInst(event.target); - - if (inst.input.val() !== inst.lastVal) { - try { - date = $.datepicker.parseDate($.datepicker._get(inst, "dateFormat"), - (inst.input ? inst.input.val() : null), - $.datepicker._getFormatConfig(inst)); - - if (date) { // only if valid - $.datepicker._setDateFromField(inst); - $.datepicker._updateAlternate(inst); - $.datepicker._updateDatepicker(inst); - } - } - catch (err) { - } - } - return true; - }, - - /* Pop-up the date picker for a given input field. - * If false returned from beforeShow event handler do not show. - * @param input element - the input field attached to the date picker or - * event - if triggered by focus - */ - _showDatepicker: function(input) { - input = input.target || input; - if (input.nodeName.toLowerCase() !== "input") { // find from button/image trigger - input = $("input", input.parentNode)[0]; - } - - if ($.datepicker._isDisabledDatepicker(input) || $.datepicker._lastInput === input) { // already here - return; - } - - var inst, beforeShow, beforeShowSettings, isFixed, - offset, showAnim, duration; - - inst = $.datepicker._getInst(input); - if ($.datepicker._curInst && $.datepicker._curInst !== inst) { - $.datepicker._curInst.dpDiv.stop(true, true); - if ( inst && $.datepicker._datepickerShowing ) { - $.datepicker._hideDatepicker( $.datepicker._curInst.input[0] ); - } - } - - beforeShow = $.datepicker._get(inst, "beforeShow"); - beforeShowSettings = beforeShow ? beforeShow.apply(input, [input, inst]) : {}; - if(beforeShowSettings === false){ - return; - } - datepicker_extendRemove(inst.settings, beforeShowSettings); - - inst.lastVal = null; - $.datepicker._lastInput = input; - $.datepicker._setDateFromField(inst); - - if ($.datepicker._inDialog) { // hide cursor - input.value = ""; - } - if (!$.datepicker._pos) { // position below input - $.datepicker._pos = $.datepicker._findPos(input); - $.datepicker._pos[1] += input.offsetHeight; // add the height - } - - isFixed = false; - $(input).parents().each(function() { - isFixed |= $(this).css("position") === "fixed"; - return !isFixed; - }); - - offset = {left: $.datepicker._pos[0], top: $.datepicker._pos[1]}; - $.datepicker._pos = null; - //to avoid flashes on Firefox - inst.dpDiv.empty(); - // determine sizing offscreen - inst.dpDiv.css({position: "absolute", display: "block", top: "-1000px"}); - $.datepicker._updateDatepicker(inst); - // fix width for dynamic number of date pickers - // and adjust position before showing - offset = $.datepicker._checkOffset(inst, offset, isFixed); - inst.dpDiv.css({position: ($.datepicker._inDialog && $.blockUI ? - "static" : (isFixed ? "fixed" : "absolute")), display: "none", - left: offset.left + "px", top: offset.top + "px"}); - - if (!inst.inline) { - showAnim = $.datepicker._get(inst, "showAnim"); - duration = $.datepicker._get(inst, "duration"); - inst.dpDiv.css( "z-index", datepicker_getZindex( $( input ) ) + 1 ); - $.datepicker._datepickerShowing = true; - - if ( $.effects && $.effects.effect[ showAnim ] ) { - inst.dpDiv.show(showAnim, $.datepicker._get(inst, "showOptions"), duration); - } else { - inst.dpDiv[showAnim || "show"](showAnim ? duration : null); - } - - if ( $.datepicker._shouldFocusInput( inst ) ) { - inst.input.focus(); - } - - $.datepicker._curInst = inst; - } - }, - - /* Generate the date picker content. */ - _updateDatepicker: function(inst) { - this.maxRows = 4; //Reset the max number of rows being displayed (see #7043) - datepicker_instActive = inst; // for delegate hover events - inst.dpDiv.empty().append(this._generateHTML(inst)); - this._attachHandlers(inst); - - var origyearshtml, - numMonths = this._getNumberOfMonths(inst), - cols = numMonths[1], - width = 17, - activeCell = inst.dpDiv.find( "." + this._dayOverClass + " a" ); - - if ( activeCell.length > 0 ) { - datepicker_handleMouseover.apply( activeCell.get( 0 ) ); - } - - inst.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""); - if (cols > 1) { - inst.dpDiv.addClass("ui-datepicker-multi-" + cols).css("width", (width * cols) + "em"); - } - inst.dpDiv[(numMonths[0] !== 1 || numMonths[1] !== 1 ? "add" : "remove") + - "Class"]("ui-datepicker-multi"); - inst.dpDiv[(this._get(inst, "isRTL") ? "add" : "remove") + - "Class"]("ui-datepicker-rtl"); - - if (inst === $.datepicker._curInst && $.datepicker._datepickerShowing && $.datepicker._shouldFocusInput( inst ) ) { - inst.input.focus(); - } - - // deffered render of the years select (to avoid flashes on Firefox) - if( inst.yearshtml ){ - origyearshtml = inst.yearshtml; - setTimeout(function(){ - //assure that inst.yearshtml didn't change. - if( origyearshtml === inst.yearshtml && inst.yearshtml ){ - inst.dpDiv.find("select.ui-datepicker-year:first").replaceWith(inst.yearshtml); - } - origyearshtml = inst.yearshtml = null; - }, 0); - } - }, - - // #6694 - don't focus the input if it's already focused - // this breaks the change event in IE - // Support: IE and jQuery <1.9 - _shouldFocusInput: function( inst ) { - return inst.input && inst.input.is( ":visible" ) && !inst.input.is( ":disabled" ) && !inst.input.is( ":focus" ); - }, - - /* Check positioning to remain on screen. */ - _checkOffset: function(inst, offset, isFixed) { - var dpWidth = inst.dpDiv.outerWidth(), - dpHeight = inst.dpDiv.outerHeight(), - inputWidth = inst.input ? inst.input.outerWidth() : 0, - inputHeight = inst.input ? inst.input.outerHeight() : 0, - viewWidth = document.documentElement.clientWidth + (isFixed ? 0 : $(document).scrollLeft()), - viewHeight = document.documentElement.clientHeight + (isFixed ? 0 : $(document).scrollTop()); - - offset.left -= (this._get(inst, "isRTL") ? (dpWidth - inputWidth) : 0); - offset.left -= (isFixed && offset.left === inst.input.offset().left) ? $(document).scrollLeft() : 0; - offset.top -= (isFixed && offset.top === (inst.input.offset().top + inputHeight)) ? $(document).scrollTop() : 0; - - // now check if datepicker is showing outside window viewport - move to a better place if so. - offset.left -= Math.min(offset.left, (offset.left + dpWidth > viewWidth && viewWidth > dpWidth) ? - Math.abs(offset.left + dpWidth - viewWidth) : 0); - offset.top -= Math.min(offset.top, (offset.top + dpHeight > viewHeight && viewHeight > dpHeight) ? - Math.abs(dpHeight + inputHeight) : 0); - - return offset; - }, - - /* Find an object's position on the screen. */ - _findPos: function(obj) { - var position, - inst = this._getInst(obj), - isRTL = this._get(inst, "isRTL"); - - while (obj && (obj.type === "hidden" || obj.nodeType !== 1 || $.expr.filters.hidden(obj))) { - obj = obj[isRTL ? "previousSibling" : "nextSibling"]; - } - - position = $(obj).offset(); - return [position.left, position.top]; - }, - - /* Hide the date picker from view. - * @param input element - the input field attached to the date picker - */ - _hideDatepicker: function(input) { - var showAnim, duration, postProcess, onClose, - inst = this._curInst; - - if (!inst || (input && inst !== $.data(input, "datepicker"))) { - return; - } - - if (this._datepickerShowing) { - showAnim = this._get(inst, "showAnim"); - duration = this._get(inst, "duration"); - postProcess = function() { - $.datepicker._tidyDialog(inst); - }; - - // DEPRECATED: after BC for 1.8.x $.effects[ showAnim ] is not needed - if ( $.effects && ( $.effects.effect[ showAnim ] || $.effects[ showAnim ] ) ) { - inst.dpDiv.hide(showAnim, $.datepicker._get(inst, "showOptions"), duration, postProcess); - } else { - inst.dpDiv[(showAnim === "slideDown" ? "slideUp" : - (showAnim === "fadeIn" ? "fadeOut" : "hide"))]((showAnim ? duration : null), postProcess); - } - - if (!showAnim) { - postProcess(); - } - this._datepickerShowing = false; - - onClose = this._get(inst, "onClose"); - if (onClose) { - onClose.apply((inst.input ? inst.input[0] : null), [(inst.input ? inst.input.val() : ""), inst]); - } - - this._lastInput = null; - if (this._inDialog) { - this._dialogInput.css({ position: "absolute", left: "0", top: "-100px" }); - if ($.blockUI) { - $.unblockUI(); - $("body").append(this.dpDiv); - } - } - this._inDialog = false; - } - }, - - /* Tidy up after a dialog display. */ - _tidyDialog: function(inst) { - inst.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar"); - }, - - /* Close date picker if clicked elsewhere. */ - _checkExternalClick: function(event) { - if (!$.datepicker._curInst) { - return; - } - - var $target = $(event.target), - inst = $.datepicker._getInst($target[0]); - - if ( ( ( $target[0].id !== $.datepicker._mainDivId && - $target.parents("#" + $.datepicker._mainDivId).length === 0 && - !$target.hasClass($.datepicker.markerClassName) && - !$target.closest("." + $.datepicker._triggerClass).length && - $.datepicker._datepickerShowing && !($.datepicker._inDialog && $.blockUI) ) ) || - ( $target.hasClass($.datepicker.markerClassName) && $.datepicker._curInst !== inst ) ) { - $.datepicker._hideDatepicker(); - } - }, - - /* Adjust one of the date sub-fields. */ - _adjustDate: function(id, offset, period) { - var target = $(id), - inst = this._getInst(target[0]); - - if (this._isDisabledDatepicker(target[0])) { - return; - } - this._adjustInstDate(inst, offset + - (period === "M" ? this._get(inst, "showCurrentAtPos") : 0), // undo positioning - period); - this._updateDatepicker(inst); - }, - - /* Action for current link. */ - _gotoToday: function(id) { - var date, - target = $(id), - inst = this._getInst(target[0]); - - if (this._get(inst, "gotoCurrent") && inst.currentDay) { - inst.selectedDay = inst.currentDay; - inst.drawMonth = inst.selectedMonth = inst.currentMonth; - inst.drawYear = inst.selectedYear = inst.currentYear; - } else { - date = new Date(); - inst.selectedDay = date.getDate(); - inst.drawMonth = inst.selectedMonth = date.getMonth(); - inst.drawYear = inst.selectedYear = date.getFullYear(); - } - this._notifyChange(inst); - this._adjustDate(target); - }, - - /* Action for selecting a new month/year. */ - _selectMonthYear: function(id, select, period) { - var target = $(id), - inst = this._getInst(target[0]); - - inst["selected" + (period === "M" ? "Month" : "Year")] = - inst["draw" + (period === "M" ? "Month" : "Year")] = - parseInt(select.options[select.selectedIndex].value,10); - - this._notifyChange(inst); - this._adjustDate(target); - }, - - /* Action for selecting a day. */ - _selectDay: function(id, month, year, td) { - var inst, - target = $(id); - - if ($(td).hasClass(this._unselectableClass) || this._isDisabledDatepicker(target[0])) { - return; - } - - inst = this._getInst(target[0]); - inst.selectedDay = inst.currentDay = $("a", td).html(); - inst.selectedMonth = inst.currentMonth = month; - inst.selectedYear = inst.currentYear = year; - this._selectDate(id, this._formatDate(inst, - inst.currentDay, inst.currentMonth, inst.currentYear)); - }, - - /* Erase the input field and hide the date picker. */ - _clearDate: function(id) { - var target = $(id); - this._selectDate(target, ""); - }, - - /* Update the input field with the selected date. */ - _selectDate: function(id, dateStr) { - var onSelect, - target = $(id), - inst = this._getInst(target[0]); - - dateStr = (dateStr != null ? dateStr : this._formatDate(inst)); - if (inst.input) { - inst.input.val(dateStr); - } - this._updateAlternate(inst); - - onSelect = this._get(inst, "onSelect"); - if (onSelect) { - onSelect.apply((inst.input ? inst.input[0] : null), [dateStr, inst]); // trigger custom callback - } else if (inst.input) { - inst.input.trigger("change"); // fire the change event - } - - if (inst.inline){ - this._updateDatepicker(inst); - } else { - this._hideDatepicker(); - this._lastInput = inst.input[0]; - if (typeof(inst.input[0]) !== "object") { - inst.input.focus(); // restore focus - } - this._lastInput = null; - } - }, - - /* Update any alternate field to synchronise with the main field. */ - _updateAlternate: function(inst) { - var altFormat, date, dateStr, - altField = this._get(inst, "altField"); - - if (altField) { // update alternate field too - altFormat = this._get(inst, "altFormat") || this._get(inst, "dateFormat"); - date = this._getDate(inst); - dateStr = this.formatDate(altFormat, date, this._getFormatConfig(inst)); - $(altField).each(function() { $(this).val(dateStr); }); - } - }, - - /* Set as beforeShowDay function to prevent selection of weekends. - * @param date Date - the date to customise - * @return [boolean, string] - is this date selectable?, what is its CSS class? - */ - noWeekends: function(date) { - var day = date.getDay(); - return [(day > 0 && day < 6), ""]; - }, - - /* Set as calculateWeek to determine the week of the year based on the ISO 8601 definition. - * @param date Date - the date to get the week for - * @return number - the number of the week within the year that contains this date - */ - iso8601Week: function(date) { - var time, - checkDate = new Date(date.getTime()); - - // Find Thursday of this week starting on Monday - checkDate.setDate(checkDate.getDate() + 4 - (checkDate.getDay() || 7)); - - time = checkDate.getTime(); - checkDate.setMonth(0); // Compare with Jan 1 - checkDate.setDate(1); - return Math.floor(Math.round((time - checkDate) / 86400000) / 7) + 1; - }, - - /* Parse a string value into a date object. - * See formatDate below for the possible formats. - * - * @param format string - the expected format of the date - * @param value string - the date in the above format - * @param settings Object - attributes include: - * shortYearCutoff number - the cutoff year for determining the century (optional) - * dayNamesShort string[7] - abbreviated names of the days from Sunday (optional) - * dayNames string[7] - names of the days from Sunday (optional) - * monthNamesShort string[12] - abbreviated names of the months (optional) - * monthNames string[12] - names of the months (optional) - * @return Date - the extracted date value or null if value is blank - */ - parseDate: function (format, value, settings) { - if (format == null || value == null) { - throw "Invalid arguments"; - } - - value = (typeof value === "object" ? value.toString() : value + ""); - if (value === "") { - return null; - } - - var iFormat, dim, extra, - iValue = 0, - shortYearCutoffTemp = (settings ? settings.shortYearCutoff : null) || this._defaults.shortYearCutoff, - shortYearCutoff = (typeof shortYearCutoffTemp !== "string" ? shortYearCutoffTemp : - new Date().getFullYear() % 100 + parseInt(shortYearCutoffTemp, 10)), - dayNamesShort = (settings ? settings.dayNamesShort : null) || this._defaults.dayNamesShort, - dayNames = (settings ? settings.dayNames : null) || this._defaults.dayNames, - monthNamesShort = (settings ? settings.monthNamesShort : null) || this._defaults.monthNamesShort, - monthNames = (settings ? settings.monthNames : null) || this._defaults.monthNames, - year = -1, - month = -1, - day = -1, - doy = -1, - literal = false, - date, - // Check whether a format character is doubled - lookAhead = function(match) { - var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) === match); - if (matches) { - iFormat++; - } - return matches; - }, - // Extract a number from the string value - getNumber = function(match) { - var isDoubled = lookAhead(match), - size = (match === "@" ? 14 : (match === "!" ? 20 : - (match === "y" && isDoubled ? 4 : (match === "o" ? 3 : 2)))), - minSize = (match === "y" ? size : 1), - digits = new RegExp("^\\d{" + minSize + "," + size + "}"), - num = value.substring(iValue).match(digits); - if (!num) { - throw "Missing number at position " + iValue; - } - iValue += num[0].length; - return parseInt(num[0], 10); - }, - // Extract a name from the string value and convert to an index - getName = function(match, shortNames, longNames) { - var index = -1, - names = $.map(lookAhead(match) ? longNames : shortNames, function (v, k) { - return [ [k, v] ]; - }).sort(function (a, b) { - return -(a[1].length - b[1].length); - }); - - $.each(names, function (i, pair) { - var name = pair[1]; - if (value.substr(iValue, name.length).toLowerCase() === name.toLowerCase()) { - index = pair[0]; - iValue += name.length; - return false; - } - }); - if (index !== -1) { - return index + 1; - } else { - throw "Unknown name at position " + iValue; - } - }, - // Confirm that a literal character matches the string value - checkLiteral = function() { - if (value.charAt(iValue) !== format.charAt(iFormat)) { - throw "Unexpected literal at position " + iValue; - } - iValue++; - }; - - for (iFormat = 0; iFormat < format.length; iFormat++) { - if (literal) { - if (format.charAt(iFormat) === "'" && !lookAhead("'")) { - literal = false; - } else { - checkLiteral(); - } - } else { - switch (format.charAt(iFormat)) { - case "d": - day = getNumber("d"); - break; - case "D": - getName("D", dayNamesShort, dayNames); - break; - case "o": - doy = getNumber("o"); - break; - case "m": - month = getNumber("m"); - break; - case "M": - month = getName("M", monthNamesShort, monthNames); - break; - case "y": - year = getNumber("y"); - break; - case "@": - date = new Date(getNumber("@")); - year = date.getFullYear(); - month = date.getMonth() + 1; - day = date.getDate(); - break; - case "!": - date = new Date((getNumber("!") - this._ticksTo1970) / 10000); - year = date.getFullYear(); - month = date.getMonth() + 1; - day = date.getDate(); - break; - case "'": - if (lookAhead("'")){ - checkLiteral(); - } else { - literal = true; - } - break; - default: - checkLiteral(); - } - } - } - - if (iValue < value.length){ - extra = value.substr(iValue); - if (!/^\s+/.test(extra)) { - throw "Extra/unparsed characters found in date: " + extra; - } - } - - if (year === -1) { - year = new Date().getFullYear(); - } else if (year < 100) { - year += new Date().getFullYear() - new Date().getFullYear() % 100 + - (year <= shortYearCutoff ? 0 : -100); - } - - if (doy > -1) { - month = 1; - day = doy; - do { - dim = this._getDaysInMonth(year, month - 1); - if (day <= dim) { - break; - } - month++; - day -= dim; - } while (true); - } - - date = this._daylightSavingAdjust(new Date(year, month - 1, day)); - if (date.getFullYear() !== year || date.getMonth() + 1 !== month || date.getDate() !== day) { - throw "Invalid date"; // E.g. 31/02/00 - } - return date; - }, - - /* Standard date formats. */ - ATOM: "yy-mm-dd", // RFC 3339 (ISO 8601) - COOKIE: "D, dd M yy", - ISO_8601: "yy-mm-dd", - RFC_822: "D, d M y", - RFC_850: "DD, dd-M-y", - RFC_1036: "D, d M y", - RFC_1123: "D, d M yy", - RFC_2822: "D, d M yy", - RSS: "D, d M y", // RFC 822 - TICKS: "!", - TIMESTAMP: "@", - W3C: "yy-mm-dd", // ISO 8601 - - _ticksTo1970: (((1970 - 1) * 365 + Math.floor(1970 / 4) - Math.floor(1970 / 100) + - Math.floor(1970 / 400)) * 24 * 60 * 60 * 10000000), - - /* Format a date object into a string value. - * The format can be combinations of the following: - * d - day of month (no leading zero) - * dd - day of month (two digit) - * o - day of year (no leading zeros) - * oo - day of year (three digit) - * D - day name short - * DD - day name long - * m - month of year (no leading zero) - * mm - month of year (two digit) - * M - month name short - * MM - month name long - * y - year (two digit) - * yy - year (four digit) - * @ - Unix timestamp (ms since 01/01/1970) - * ! - Windows ticks (100ns since 01/01/0001) - * "..." - literal text - * '' - single quote - * - * @param format string - the desired format of the date - * @param date Date - the date value to format - * @param settings Object - attributes include: - * dayNamesShort string[7] - abbreviated names of the days from Sunday (optional) - * dayNames string[7] - names of the days from Sunday (optional) - * monthNamesShort string[12] - abbreviated names of the months (optional) - * monthNames string[12] - names of the months (optional) - * @return string - the date in the above format - */ - formatDate: function (format, date, settings) { - if (!date) { - return ""; - } - - var iFormat, - dayNamesShort = (settings ? settings.dayNamesShort : null) || this._defaults.dayNamesShort, - dayNames = (settings ? settings.dayNames : null) || this._defaults.dayNames, - monthNamesShort = (settings ? settings.monthNamesShort : null) || this._defaults.monthNamesShort, - monthNames = (settings ? settings.monthNames : null) || this._defaults.monthNames, - // Check whether a format character is doubled - lookAhead = function(match) { - var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) === match); - if (matches) { - iFormat++; - } - return matches; - }, - // Format a number, with leading zero if necessary - formatNumber = function(match, value, len) { - var num = "" + value; - if (lookAhead(match)) { - while (num.length < len) { - num = "0" + num; - } - } - return num; - }, - // Format a name, short or long as requested - formatName = function(match, value, shortNames, longNames) { - return (lookAhead(match) ? longNames[value] : shortNames[value]); - }, - output = "", - literal = false; - - if (date) { - for (iFormat = 0; iFormat < format.length; iFormat++) { - if (literal) { - if (format.charAt(iFormat) === "'" && !lookAhead("'")) { - literal = false; - } else { - output += format.charAt(iFormat); - } - } else { - switch (format.charAt(iFormat)) { - case "d": - output += formatNumber("d", date.getDate(), 2); - break; - case "D": - output += formatName("D", date.getDay(), dayNamesShort, dayNames); - break; - case "o": - output += formatNumber("o", - Math.round((new Date(date.getFullYear(), date.getMonth(), date.getDate()).getTime() - new Date(date.getFullYear(), 0, 0).getTime()) / 86400000), 3); - break; - case "m": - output += formatNumber("m", date.getMonth() + 1, 2); - break; - case "M": - output += formatName("M", date.getMonth(), monthNamesShort, monthNames); - break; - case "y": - output += (lookAhead("y") ? date.getFullYear() : - (date.getYear() % 100 < 10 ? "0" : "") + date.getYear() % 100); - break; - case "@": - output += date.getTime(); - break; - case "!": - output += date.getTime() * 10000 + this._ticksTo1970; - break; - case "'": - if (lookAhead("'")) { - output += "'"; - } else { - literal = true; - } - break; - default: - output += format.charAt(iFormat); - } - } - } - } - return output; - }, - - /* Extract all possible characters from the date format. */ - _possibleChars: function (format) { - var iFormat, - chars = "", - literal = false, - // Check whether a format character is doubled - lookAhead = function(match) { - var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) === match); - if (matches) { - iFormat++; - } - return matches; - }; - - for (iFormat = 0; iFormat < format.length; iFormat++) { - if (literal) { - if (format.charAt(iFormat) === "'" && !lookAhead("'")) { - literal = false; - } else { - chars += format.charAt(iFormat); - } - } else { - switch (format.charAt(iFormat)) { - case "d": case "m": case "y": case "@": - chars += "0123456789"; - break; - case "D": case "M": - return null; // Accept anything - case "'": - if (lookAhead("'")) { - chars += "'"; - } else { - literal = true; - } - break; - default: - chars += format.charAt(iFormat); - } - } - } - return chars; - }, - - /* Get a setting value, defaulting if necessary. */ - _get: function(inst, name) { - return inst.settings[name] !== undefined ? - inst.settings[name] : this._defaults[name]; - }, - - /* Parse existing date and initialise date picker. */ - _setDateFromField: function(inst, noDefault) { - if (inst.input.val() === inst.lastVal) { - return; - } - - var dateFormat = this._get(inst, "dateFormat"), - dates = inst.lastVal = inst.input ? inst.input.val() : null, - defaultDate = this._getDefaultDate(inst), - date = defaultDate, - settings = this._getFormatConfig(inst); - - try { - date = this.parseDate(dateFormat, dates, settings) || defaultDate; - } catch (event) { - dates = (noDefault ? "" : dates); - } - inst.selectedDay = date.getDate(); - inst.drawMonth = inst.selectedMonth = date.getMonth(); - inst.drawYear = inst.selectedYear = date.getFullYear(); - inst.currentDay = (dates ? date.getDate() : 0); - inst.currentMonth = (dates ? date.getMonth() : 0); - inst.currentYear = (dates ? date.getFullYear() : 0); - this._adjustInstDate(inst); - }, - - /* Retrieve the default date shown on opening. */ - _getDefaultDate: function(inst) { - return this._restrictMinMax(inst, - this._determineDate(inst, this._get(inst, "defaultDate"), new Date())); - }, - - /* A date may be specified as an exact value or a relative one. */ - _determineDate: function(inst, date, defaultDate) { - var offsetNumeric = function(offset) { - var date = new Date(); - date.setDate(date.getDate() + offset); - return date; - }, - offsetString = function(offset) { - try { - return $.datepicker.parseDate($.datepicker._get(inst, "dateFormat"), - offset, $.datepicker._getFormatConfig(inst)); - } - catch (e) { - // Ignore - } - - var date = (offset.toLowerCase().match(/^c/) ? - $.datepicker._getDate(inst) : null) || new Date(), - year = date.getFullYear(), - month = date.getMonth(), - day = date.getDate(), - pattern = /([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g, - matches = pattern.exec(offset); - - while (matches) { - switch (matches[2] || "d") { - case "d" : case "D" : - day += parseInt(matches[1],10); break; - case "w" : case "W" : - day += parseInt(matches[1],10) * 7; break; - case "m" : case "M" : - month += parseInt(matches[1],10); - day = Math.min(day, $.datepicker._getDaysInMonth(year, month)); - break; - case "y": case "Y" : - year += parseInt(matches[1],10); - day = Math.min(day, $.datepicker._getDaysInMonth(year, month)); - break; - } - matches = pattern.exec(offset); - } - return new Date(year, month, day); - }, - newDate = (date == null || date === "" ? defaultDate : (typeof date === "string" ? offsetString(date) : - (typeof date === "number" ? (isNaN(date) ? defaultDate : offsetNumeric(date)) : new Date(date.getTime())))); - - newDate = (newDate && newDate.toString() === "Invalid Date" ? defaultDate : newDate); - if (newDate) { - newDate.setHours(0); - newDate.setMinutes(0); - newDate.setSeconds(0); - newDate.setMilliseconds(0); - } - return this._daylightSavingAdjust(newDate); - }, - - /* Handle switch to/from daylight saving. - * Hours may be non-zero on daylight saving cut-over: - * > 12 when midnight changeover, but then cannot generate - * midnight datetime, so jump to 1AM, otherwise reset. - * @param date (Date) the date to check - * @return (Date) the corrected date - */ - _daylightSavingAdjust: function(date) { - if (!date) { - return null; - } - date.setHours(date.getHours() > 12 ? date.getHours() + 2 : 0); - return date; - }, - - /* Set the date(s) directly. */ - _setDate: function(inst, date, noChange) { - var clear = !date, - origMonth = inst.selectedMonth, - origYear = inst.selectedYear, - newDate = this._restrictMinMax(inst, this._determineDate(inst, date, new Date())); - - inst.selectedDay = inst.currentDay = newDate.getDate(); - inst.drawMonth = inst.selectedMonth = inst.currentMonth = newDate.getMonth(); - inst.drawYear = inst.selectedYear = inst.currentYear = newDate.getFullYear(); - if ((origMonth !== inst.selectedMonth || origYear !== inst.selectedYear) && !noChange) { - this._notifyChange(inst); - } - this._adjustInstDate(inst); - if (inst.input) { - inst.input.val(clear ? "" : this._formatDate(inst)); - } - }, - - /* Retrieve the date(s) directly. */ - _getDate: function(inst) { - var startDate = (!inst.currentYear || (inst.input && inst.input.val() === "") ? null : - this._daylightSavingAdjust(new Date( - inst.currentYear, inst.currentMonth, inst.currentDay))); - return startDate; - }, - - /* Attach the onxxx handlers. These are declared statically so - * they work with static code transformers like Caja. - */ - _attachHandlers: function(inst) { - var stepMonths = this._get(inst, "stepMonths"), - id = "#" + inst.id.replace( /\\\\/g, "\\" ); - inst.dpDiv.find("[data-handler]").map(function () { - var handler = { - prev: function () { - $.datepicker._adjustDate(id, -stepMonths, "M"); - }, - next: function () { - $.datepicker._adjustDate(id, +stepMonths, "M"); - }, - hide: function () { - $.datepicker._hideDatepicker(); - }, - today: function () { - $.datepicker._gotoToday(id); - }, - selectDay: function () { - $.datepicker._selectDay(id, +this.getAttribute("data-month"), +this.getAttribute("data-year"), this); - return false; - }, - selectMonth: function () { - $.datepicker._selectMonthYear(id, this, "M"); - return false; - }, - selectYear: function () { - $.datepicker._selectMonthYear(id, this, "Y"); - return false; - } - }; - $(this).bind(this.getAttribute("data-event"), handler[this.getAttribute("data-handler")]); - }); - }, - - /* Generate the HTML for the current state of the date picker. */ - _generateHTML: function(inst) { - var maxDraw, prevText, prev, nextText, next, currentText, gotoDate, - controls, buttonPanel, firstDay, showWeek, dayNames, dayNamesMin, - monthNames, monthNamesShort, beforeShowDay, showOtherMonths, - selectOtherMonths, defaultDate, html, dow, row, group, col, selectedDate, - cornerClass, calender, thead, day, daysInMonth, leadDays, curRows, numRows, - printDate, dRow, tbody, daySettings, otherMonth, unselectable, - tempDate = new Date(), - today = this._daylightSavingAdjust( - new Date(tempDate.getFullYear(), tempDate.getMonth(), tempDate.getDate())), // clear time - isRTL = this._get(inst, "isRTL"), - showButtonPanel = this._get(inst, "showButtonPanel"), - hideIfNoPrevNext = this._get(inst, "hideIfNoPrevNext"), - navigationAsDateFormat = this._get(inst, "navigationAsDateFormat"), - numMonths = this._getNumberOfMonths(inst), - showCurrentAtPos = this._get(inst, "showCurrentAtPos"), - stepMonths = this._get(inst, "stepMonths"), - isMultiMonth = (numMonths[0] !== 1 || numMonths[1] !== 1), - currentDate = this._daylightSavingAdjust((!inst.currentDay ? new Date(9999, 9, 9) : - new Date(inst.currentYear, inst.currentMonth, inst.currentDay))), - minDate = this._getMinMaxDate(inst, "min"), - maxDate = this._getMinMaxDate(inst, "max"), - drawMonth = inst.drawMonth - showCurrentAtPos, - drawYear = inst.drawYear; - - if (drawMonth < 0) { - drawMonth += 12; - drawYear--; - } - if (maxDate) { - maxDraw = this._daylightSavingAdjust(new Date(maxDate.getFullYear(), - maxDate.getMonth() - (numMonths[0] * numMonths[1]) + 1, maxDate.getDate())); - maxDraw = (minDate && maxDraw < minDate ? minDate : maxDraw); - while (this._daylightSavingAdjust(new Date(drawYear, drawMonth, 1)) > maxDraw) { - drawMonth--; - if (drawMonth < 0) { - drawMonth = 11; - drawYear--; - } - } - } - inst.drawMonth = drawMonth; - inst.drawYear = drawYear; - - prevText = this._get(inst, "prevText"); - prevText = (!navigationAsDateFormat ? prevText : this.formatDate(prevText, - this._daylightSavingAdjust(new Date(drawYear, drawMonth - stepMonths, 1)), - this._getFormatConfig(inst))); - - prev = (this._canAdjustMonth(inst, -1, drawYear, drawMonth) ? - "
                          " + prevText + "" : - (hideIfNoPrevNext ? "" : "" + prevText + "")); - - nextText = this._get(inst, "nextText"); - nextText = (!navigationAsDateFormat ? nextText : this.formatDate(nextText, - this._daylightSavingAdjust(new Date(drawYear, drawMonth + stepMonths, 1)), - this._getFormatConfig(inst))); - - next = (this._canAdjustMonth(inst, +1, drawYear, drawMonth) ? - "" + nextText + "" : - (hideIfNoPrevNext ? "" : "" + nextText + "")); - - currentText = this._get(inst, "currentText"); - gotoDate = (this._get(inst, "gotoCurrent") && inst.currentDay ? currentDate : today); - currentText = (!navigationAsDateFormat ? currentText : - this.formatDate(currentText, gotoDate, this._getFormatConfig(inst))); - - controls = (!inst.inline ? "" : ""); - - buttonPanel = (showButtonPanel) ? "
                          " + (isRTL ? controls : "") + - (this._isInRange(inst, gotoDate) ? "" : "") + (isRTL ? "" : controls) + "
                          " : ""; - - firstDay = parseInt(this._get(inst, "firstDay"),10); - firstDay = (isNaN(firstDay) ? 0 : firstDay); - - showWeek = this._get(inst, "showWeek"); - dayNames = this._get(inst, "dayNames"); - dayNamesMin = this._get(inst, "dayNamesMin"); - monthNames = this._get(inst, "monthNames"); - monthNamesShort = this._get(inst, "monthNamesShort"); - beforeShowDay = this._get(inst, "beforeShowDay"); - showOtherMonths = this._get(inst, "showOtherMonths"); - selectOtherMonths = this._get(inst, "selectOtherMonths"); - defaultDate = this._getDefaultDate(inst); - html = ""; - dow; - for (row = 0; row < numMonths[0]; row++) { - group = ""; - this.maxRows = 4; - for (col = 0; col < numMonths[1]; col++) { - selectedDate = this._daylightSavingAdjust(new Date(drawYear, drawMonth, inst.selectedDay)); - cornerClass = " ui-corner-all"; - calender = ""; - if (isMultiMonth) { - calender += "
                          "; - } - calender += "
                          " + - (/all|left/.test(cornerClass) && row === 0 ? (isRTL ? next : prev) : "") + - (/all|right/.test(cornerClass) && row === 0 ? (isRTL ? prev : next) : "") + - this._generateMonthYearHeader(inst, drawMonth, drawYear, minDate, maxDate, - row > 0 || col > 0, monthNames, monthNamesShort) + // draw month headers - "
                          " + - ""; - thead = (showWeek ? "" : ""); - for (dow = 0; dow < 7; dow++) { // days of the week - day = (dow + firstDay) % 7; - thead += ""; - } - calender += thead + ""; - daysInMonth = this._getDaysInMonth(drawYear, drawMonth); - if (drawYear === inst.selectedYear && drawMonth === inst.selectedMonth) { - inst.selectedDay = Math.min(inst.selectedDay, daysInMonth); - } - leadDays = (this._getFirstDayOfMonth(drawYear, drawMonth) - firstDay + 7) % 7; - curRows = Math.ceil((leadDays + daysInMonth) / 7); // calculate the number of rows to generate - numRows = (isMultiMonth ? this.maxRows > curRows ? this.maxRows : curRows : curRows); //If multiple months, use the higher number of rows (see #7043) - this.maxRows = numRows; - printDate = this._daylightSavingAdjust(new Date(drawYear, drawMonth, 1 - leadDays)); - for (dRow = 0; dRow < numRows; dRow++) { // create date picker rows - calender += ""; - tbody = (!showWeek ? "" : ""); - for (dow = 0; dow < 7; dow++) { // create date picker days - daySettings = (beforeShowDay ? - beforeShowDay.apply((inst.input ? inst.input[0] : null), [printDate]) : [true, ""]); - otherMonth = (printDate.getMonth() !== drawMonth); - unselectable = (otherMonth && !selectOtherMonths) || !daySettings[0] || - (minDate && printDate < minDate) || (maxDate && printDate > maxDate); - tbody += ""; // display selectable date - printDate.setDate(printDate.getDate() + 1); - printDate = this._daylightSavingAdjust(printDate); - } - calender += tbody + ""; - } - drawMonth++; - if (drawMonth > 11) { - drawMonth = 0; - drawYear++; - } - calender += "
                          " + this._get(inst, "weekHeader") + "= 5 ? " class='ui-datepicker-week-end'" : "") + ">" + - "" + dayNamesMin[day] + "
                          " + - this._get(inst, "calculateWeek")(printDate) + "" + // actions - (otherMonth && !showOtherMonths ? " " : // display for other months - (unselectable ? "" + printDate.getDate() + "" : "" + printDate.getDate() + "")) + "
                          " + (isMultiMonth ? "" + - ((numMonths[0] > 0 && col === numMonths[1]-1) ? "
                          " : "") : ""); - group += calender; - } - html += group; - } - html += buttonPanel; - inst._keyEvent = false; - return html; - }, - - /* Generate the month and year header. */ - _generateMonthYearHeader: function(inst, drawMonth, drawYear, minDate, maxDate, - secondary, monthNames, monthNamesShort) { - - var inMinYear, inMaxYear, month, years, thisYear, determineYear, year, endYear, - changeMonth = this._get(inst, "changeMonth"), - changeYear = this._get(inst, "changeYear"), - showMonthAfterYear = this._get(inst, "showMonthAfterYear"), - html = "
                          ", - monthHtml = ""; - - // month selection - if (secondary || !changeMonth) { - monthHtml += "" + monthNames[drawMonth] + ""; - } else { - inMinYear = (minDate && minDate.getFullYear() === drawYear); - inMaxYear = (maxDate && maxDate.getFullYear() === drawYear); - monthHtml += ""; - } - - if (!showMonthAfterYear) { - html += monthHtml + (secondary || !(changeMonth && changeYear) ? " " : ""); - } - - // year selection - if ( !inst.yearshtml ) { - inst.yearshtml = ""; - if (secondary || !changeYear) { - html += "" + drawYear + ""; - } else { - // determine range of years to display - years = this._get(inst, "yearRange").split(":"); - thisYear = new Date().getFullYear(); - determineYear = function(value) { - var year = (value.match(/c[+\-].*/) ? drawYear + parseInt(value.substring(1), 10) : - (value.match(/[+\-].*/) ? thisYear + parseInt(value, 10) : - parseInt(value, 10))); - return (isNaN(year) ? thisYear : year); - }; - year = determineYear(years[0]); - endYear = Math.max(year, determineYear(years[1] || "")); - year = (minDate ? Math.max(year, minDate.getFullYear()) : year); - endYear = (maxDate ? Math.min(endYear, maxDate.getFullYear()) : endYear); - inst.yearshtml += ""; - - html += inst.yearshtml; - inst.yearshtml = null; - } - } - - html += this._get(inst, "yearSuffix"); - if (showMonthAfterYear) { - html += (secondary || !(changeMonth && changeYear) ? " " : "") + monthHtml; - } - html += "
                          "; // Close datepicker_header - return html; - }, - - /* Adjust one of the date sub-fields. */ - _adjustInstDate: function(inst, offset, period) { - var year = inst.drawYear + (period === "Y" ? offset : 0), - month = inst.drawMonth + (period === "M" ? offset : 0), - day = Math.min(inst.selectedDay, this._getDaysInMonth(year, month)) + (period === "D" ? offset : 0), - date = this._restrictMinMax(inst, this._daylightSavingAdjust(new Date(year, month, day))); - - inst.selectedDay = date.getDate(); - inst.drawMonth = inst.selectedMonth = date.getMonth(); - inst.drawYear = inst.selectedYear = date.getFullYear(); - if (period === "M" || period === "Y") { - this._notifyChange(inst); - } - }, - - /* Ensure a date is within any min/max bounds. */ - _restrictMinMax: function(inst, date) { - var minDate = this._getMinMaxDate(inst, "min"), - maxDate = this._getMinMaxDate(inst, "max"), - newDate = (minDate && date < minDate ? minDate : date); - return (maxDate && newDate > maxDate ? maxDate : newDate); - }, - - /* Notify change of month/year. */ - _notifyChange: function(inst) { - var onChange = this._get(inst, "onChangeMonthYear"); - if (onChange) { - onChange.apply((inst.input ? inst.input[0] : null), - [inst.selectedYear, inst.selectedMonth + 1, inst]); - } - }, - - /* Determine the number of months to show. */ - _getNumberOfMonths: function(inst) { - var numMonths = this._get(inst, "numberOfMonths"); - return (numMonths == null ? [1, 1] : (typeof numMonths === "number" ? [1, numMonths] : numMonths)); - }, - - /* Determine the current maximum date - ensure no time components are set. */ - _getMinMaxDate: function(inst, minMax) { - return this._determineDate(inst, this._get(inst, minMax + "Date"), null); - }, - - /* Find the number of days in a given month. */ - _getDaysInMonth: function(year, month) { - return 32 - this._daylightSavingAdjust(new Date(year, month, 32)).getDate(); - }, - - /* Find the day of the week of the first of a month. */ - _getFirstDayOfMonth: function(year, month) { - return new Date(year, month, 1).getDay(); - }, - - /* Determines if we should allow a "next/prev" month display change. */ - _canAdjustMonth: function(inst, offset, curYear, curMonth) { - var numMonths = this._getNumberOfMonths(inst), - date = this._daylightSavingAdjust(new Date(curYear, - curMonth + (offset < 0 ? offset : numMonths[0] * numMonths[1]), 1)); - - if (offset < 0) { - date.setDate(this._getDaysInMonth(date.getFullYear(), date.getMonth())); - } - return this._isInRange(inst, date); - }, - - /* Is the given date in the accepted range? */ - _isInRange: function(inst, date) { - var yearSplit, currentYear, - minDate = this._getMinMaxDate(inst, "min"), - maxDate = this._getMinMaxDate(inst, "max"), - minYear = null, - maxYear = null, - years = this._get(inst, "yearRange"); - if (years){ - yearSplit = years.split(":"); - currentYear = new Date().getFullYear(); - minYear = parseInt(yearSplit[0], 10); - maxYear = parseInt(yearSplit[1], 10); - if ( yearSplit[0].match(/[+\-].*/) ) { - minYear += currentYear; - } - if ( yearSplit[1].match(/[+\-].*/) ) { - maxYear += currentYear; - } - } - - return ((!minDate || date.getTime() >= minDate.getTime()) && - (!maxDate || date.getTime() <= maxDate.getTime()) && - (!minYear || date.getFullYear() >= minYear) && - (!maxYear || date.getFullYear() <= maxYear)); - }, - - /* Provide the configuration settings for formatting/parsing. */ - _getFormatConfig: function(inst) { - var shortYearCutoff = this._get(inst, "shortYearCutoff"); - shortYearCutoff = (typeof shortYearCutoff !== "string" ? shortYearCutoff : - new Date().getFullYear() % 100 + parseInt(shortYearCutoff, 10)); - return {shortYearCutoff: shortYearCutoff, - dayNamesShort: this._get(inst, "dayNamesShort"), dayNames: this._get(inst, "dayNames"), - monthNamesShort: this._get(inst, "monthNamesShort"), monthNames: this._get(inst, "monthNames")}; - }, - - /* Format the given date for display. */ - _formatDate: function(inst, day, month, year) { - if (!day) { - inst.currentDay = inst.selectedDay; - inst.currentMonth = inst.selectedMonth; - inst.currentYear = inst.selectedYear; - } - var date = (day ? (typeof day === "object" ? day : - this._daylightSavingAdjust(new Date(year, month, day))) : - this._daylightSavingAdjust(new Date(inst.currentYear, inst.currentMonth, inst.currentDay))); - return this.formatDate(this._get(inst, "dateFormat"), date, this._getFormatConfig(inst)); - } - }); - - /* - * Bind hover events for datepicker elements. - * Done via delegate so the binding only occurs once in the lifetime of the parent div. - * Global datepicker_instActive, set by _updateDatepicker allows the handlers to find their way back to the active picker. - */ - function datepicker_bindHover(dpDiv) { - var selector = "button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a"; - return dpDiv.delegate(selector, "mouseout", function() { - $(this).removeClass("ui-state-hover"); - if (this.className.indexOf("ui-datepicker-prev") !== -1) { - $(this).removeClass("ui-datepicker-prev-hover"); - } - if (this.className.indexOf("ui-datepicker-next") !== -1) { - $(this).removeClass("ui-datepicker-next-hover"); - } - }) - .delegate( selector, "mouseover", datepicker_handleMouseover ); - } - - function datepicker_handleMouseover() { - if (!$.datepicker._isDisabledDatepicker( datepicker_instActive.inline? datepicker_instActive.dpDiv.parent()[0] : datepicker_instActive.input[0])) { - $(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"); - $(this).addClass("ui-state-hover"); - if (this.className.indexOf("ui-datepicker-prev") !== -1) { - $(this).addClass("ui-datepicker-prev-hover"); - } - if (this.className.indexOf("ui-datepicker-next") !== -1) { - $(this).addClass("ui-datepicker-next-hover"); - } - } - } - - /* jQuery extend now ignores nulls! */ - function datepicker_extendRemove(target, props) { - $.extend(target, props); - for (var name in props) { - if (props[name] == null) { - target[name] = props[name]; - } - } - return target; - } - - /* Invoke the datepicker functionality. - @param options string - a command, optionally followed by additional parameters or - Object - settings for attaching new datepicker functionality - @return jQuery object */ - $.fn.datepicker = function(options){ - - /* Verify an empty collection wasn't passed - Fixes #6976 */ - if ( !this.length ) { - return this; - } - - /* Initialise the date picker. */ - if (!$.datepicker.initialized) { - $(document).mousedown($.datepicker._checkExternalClick); - $.datepicker.initialized = true; - } - - /* Append datepicker main container to body if not exist. */ - if ($("#"+$.datepicker._mainDivId).length === 0) { - $("body").append($.datepicker.dpDiv); - } - - var otherArgs = Array.prototype.slice.call(arguments, 1); - if (typeof options === "string" && (options === "isDisabled" || options === "getDate" || options === "widget")) { - return $.datepicker["_" + options + "Datepicker"]. - apply($.datepicker, [this[0]].concat(otherArgs)); - } - if (options === "option" && arguments.length === 2 && typeof arguments[1] === "string") { - return $.datepicker["_" + options + "Datepicker"]. - apply($.datepicker, [this[0]].concat(otherArgs)); - } - return this.each(function() { - typeof options === "string" ? - $.datepicker["_" + options + "Datepicker"]. - apply($.datepicker, [this].concat(otherArgs)) : - $.datepicker._attachDatepicker(this, options); - }); - }; - - $.datepicker = new Datepicker(); // singleton instance - $.datepicker.initialized = false; - $.datepicker.uuid = new Date().getTime(); - $.datepicker.version = "1.11.4"; - - var datepicker = $.datepicker; - - - /*! - * jQuery UI Slider 1.11.4 - * http://jqueryui.com - * - * Copyright jQuery Foundation and other contributors - * Released under the MIT license. - * http://jquery.org/license - * - * http://api.jqueryui.com/slider/ - */ - - - var slider = $.widget( "ui.slider", $.ui.mouse, { - version: "1.11.4", - widgetEventPrefix: "slide", - - options: { - animate: false, - distance: 0, - max: 100, - min: 0, - orientation: "horizontal", - range: false, - step: 1, - value: 0, - values: null, - - // callbacks - change: null, - slide: null, - start: null, - stop: null - }, - - // number of pages in a slider - // (how many times can you page up/down to go through the whole range) - numPages: 5, - - _create: function() { - this._keySliding = false; - this._mouseSliding = false; - this._animateOff = true; - this._handleIndex = null; - this._detectOrientation(); - this._mouseInit(); - this._calculateNewMax(); - - this.element - .addClass( "ui-slider" + - " ui-slider-" + this.orientation + - " ui-widget" + - " ui-widget-content" + - " ui-corner-all"); - - this._refresh(); - this._setOption( "disabled", this.options.disabled ); - - this._animateOff = false; - }, - - _refresh: function() { - this._createRange(); - this._createHandles(); - this._setupEvents(); - this._refreshValue(); - }, - - _createHandles: function() { - var i, handleCount, - options = this.options, - existingHandles = this.element.find( ".ui-slider-handle" ).addClass( "ui-state-default ui-corner-all" ), - handle = "", - handles = []; - - handleCount = ( options.values && options.values.length ) || 1; - - if ( existingHandles.length > handleCount ) { - existingHandles.slice( handleCount ).remove(); - existingHandles = existingHandles.slice( 0, handleCount ); - } - - for ( i = existingHandles.length; i < handleCount; i++ ) { - handles.push( handle ); - } - - this.handles = existingHandles.add( $( handles.join( "" ) ).appendTo( this.element ) ); - - this.handle = this.handles.eq( 0 ); - - this.handles.each(function( i ) { - $( this ).data( "ui-slider-handle-index", i ); - }); - }, - - _createRange: function() { - var options = this.options, - classes = ""; - - if ( options.range ) { - if ( options.range === true ) { - if ( !options.values ) { - options.values = [ this._valueMin(), this._valueMin() ]; - } else if ( options.values.length && options.values.length !== 2 ) { - options.values = [ options.values[0], options.values[0] ]; - } else if ( $.isArray( options.values ) ) { - options.values = options.values.slice(0); - } - } - - if ( !this.range || !this.range.length ) { - this.range = $( "
                          " ) - .appendTo( this.element ); - - classes = "ui-slider-range" + - // note: this isn't the most fittingly semantic framework class for this element, - // but worked best visually with a variety of themes - " ui-widget-header ui-corner-all"; - } else { - this.range.removeClass( "ui-slider-range-min ui-slider-range-max" ) - // Handle range switching from true to min/max - .css({ - "left": "", - "bottom": "" - }); - } - - this.range.addClass( classes + - ( ( options.range === "min" || options.range === "max" ) ? " ui-slider-range-" + options.range : "" ) ); - } else { - if ( this.range ) { - this.range.remove(); - } - this.range = null; - } - }, - - _setupEvents: function() { - this._off( this.handles ); - this._on( this.handles, this._handleEvents ); - this._hoverable( this.handles ); - this._focusable( this.handles ); - }, - - _destroy: function() { - this.handles.remove(); - if ( this.range ) { - this.range.remove(); - } - - this.element - .removeClass( "ui-slider" + - " ui-slider-horizontal" + - " ui-slider-vertical" + - " ui-widget" + - " ui-widget-content" + - " ui-corner-all" ); - - this._mouseDestroy(); - }, - - _mouseCapture: function( event ) { - var position, normValue, distance, closestHandle, index, allowed, offset, mouseOverHandle, - that = this, - o = this.options; - - if ( o.disabled ) { - return false; - } - - this.elementSize = { - width: this.element.outerWidth(), - height: this.element.outerHeight() - }; - this.elementOffset = this.element.offset(); - - position = { x: event.pageX, y: event.pageY }; - normValue = this._normValueFromMouse( position ); - distance = this._valueMax() - this._valueMin() + 1; - this.handles.each(function( i ) { - var thisDistance = Math.abs( normValue - that.values(i) ); - if (( distance > thisDistance ) || - ( distance === thisDistance && - (i === that._lastChangedValue || that.values(i) === o.min ))) { - distance = thisDistance; - closestHandle = $( this ); - index = i; - } - }); - - allowed = this._start( event, index ); - if ( allowed === false ) { - return false; - } - this._mouseSliding = true; - - this._handleIndex = index; - - closestHandle - .addClass( "ui-state-active" ) - .focus(); - - offset = closestHandle.offset(); - mouseOverHandle = !$( event.target ).parents().addBack().is( ".ui-slider-handle" ); - this._clickOffset = mouseOverHandle ? { left: 0, top: 0 } : { - left: event.pageX - offset.left - ( closestHandle.width() / 2 ), - top: event.pageY - offset.top - - ( closestHandle.height() / 2 ) - - ( parseInt( closestHandle.css("borderTopWidth"), 10 ) || 0 ) - - ( parseInt( closestHandle.css("borderBottomWidth"), 10 ) || 0) + - ( parseInt( closestHandle.css("marginTop"), 10 ) || 0) - }; - - if ( !this.handles.hasClass( "ui-state-hover" ) ) { - this._slide( event, index, normValue ); - } - this._animateOff = true; - return true; - }, - - _mouseStart: function() { - return true; - }, - - _mouseDrag: function( event ) { - var position = { x: event.pageX, y: event.pageY }, - normValue = this._normValueFromMouse( position ); - - this._slide( event, this._handleIndex, normValue ); - - return false; - }, - - _mouseStop: function( event ) { - this.handles.removeClass( "ui-state-active" ); - this._mouseSliding = false; - - this._stop( event, this._handleIndex ); - this._change( event, this._handleIndex ); - - this._handleIndex = null; - this._clickOffset = null; - this._animateOff = false; - - return false; - }, - - _detectOrientation: function() { - this.orientation = ( this.options.orientation === "vertical" ) ? "vertical" : "horizontal"; - }, - - _normValueFromMouse: function( position ) { - var pixelTotal, - pixelMouse, - percentMouse, - valueTotal, - valueMouse; - - if ( this.orientation === "horizontal" ) { - pixelTotal = this.elementSize.width; - pixelMouse = position.x - this.elementOffset.left - ( this._clickOffset ? this._clickOffset.left : 0 ); - } else { - pixelTotal = this.elementSize.height; - pixelMouse = position.y - this.elementOffset.top - ( this._clickOffset ? this._clickOffset.top : 0 ); - } - - percentMouse = ( pixelMouse / pixelTotal ); - if ( percentMouse > 1 ) { - percentMouse = 1; - } - if ( percentMouse < 0 ) { - percentMouse = 0; - } - if ( this.orientation === "vertical" ) { - percentMouse = 1 - percentMouse; - } - - valueTotal = this._valueMax() - this._valueMin(); - valueMouse = this._valueMin() + percentMouse * valueTotal; - - return this._trimAlignValue( valueMouse ); - }, - - _start: function( event, index ) { - var uiHash = { - handle: this.handles[ index ], - value: this.value() - }; - if ( this.options.values && this.options.values.length ) { - uiHash.value = this.values( index ); - uiHash.values = this.values(); - } - return this._trigger( "start", event, uiHash ); - }, - - _slide: function( event, index, newVal ) { - var otherVal, - newValues, - allowed; - - if ( this.options.values && this.options.values.length ) { - otherVal = this.values( index ? 0 : 1 ); - - if ( ( this.options.values.length === 2 && this.options.range === true ) && - ( ( index === 0 && newVal > otherVal) || ( index === 1 && newVal < otherVal ) ) - ) { - newVal = otherVal; - } - - if ( newVal !== this.values( index ) ) { - newValues = this.values(); - newValues[ index ] = newVal; - // A slide can be canceled by returning false from the slide callback - allowed = this._trigger( "slide", event, { - handle: this.handles[ index ], - value: newVal, - values: newValues - } ); - otherVal = this.values( index ? 0 : 1 ); - if ( allowed !== false ) { - this.values( index, newVal ); - } - } - } else { - if ( newVal !== this.value() ) { - // A slide can be canceled by returning false from the slide callback - allowed = this._trigger( "slide", event, { - handle: this.handles[ index ], - value: newVal - } ); - if ( allowed !== false ) { - this.value( newVal ); - } - } - } - }, - - _stop: function( event, index ) { - var uiHash = { - handle: this.handles[ index ], - value: this.value() - }; - if ( this.options.values && this.options.values.length ) { - uiHash.value = this.values( index ); - uiHash.values = this.values(); - } - - this._trigger( "stop", event, uiHash ); - }, - - _change: function( event, index ) { - if ( !this._keySliding && !this._mouseSliding ) { - var uiHash = { - handle: this.handles[ index ], - value: this.value() - }; - if ( this.options.values && this.options.values.length ) { - uiHash.value = this.values( index ); - uiHash.values = this.values(); - } - - //store the last changed value index for reference when handles overlap - this._lastChangedValue = index; - - this._trigger( "change", event, uiHash ); - } - }, - - value: function( newValue ) { - if ( arguments.length ) { - this.options.value = this._trimAlignValue( newValue ); - this._refreshValue(); - this._change( null, 0 ); - return; - } - - return this._value(); - }, - - values: function( index, newValue ) { - var vals, - newValues, - i; - - if ( arguments.length > 1 ) { - this.options.values[ index ] = this._trimAlignValue( newValue ); - this._refreshValue(); - this._change( null, index ); - return; - } - - if ( arguments.length ) { - if ( $.isArray( arguments[ 0 ] ) ) { - vals = this.options.values; - newValues = arguments[ 0 ]; - for ( i = 0; i < vals.length; i += 1 ) { - vals[ i ] = this._trimAlignValue( newValues[ i ] ); - this._change( null, i ); - } - this._refreshValue(); - } else { - if ( this.options.values && this.options.values.length ) { - return this._values( index ); - } else { - return this.value(); - } - } - } else { - return this._values(); - } - }, - - _setOption: function( key, value ) { - var i, - valsLength = 0; - - if ( key === "range" && this.options.range === true ) { - if ( value === "min" ) { - this.options.value = this._values( 0 ); - this.options.values = null; - } else if ( value === "max" ) { - this.options.value = this._values( this.options.values.length - 1 ); - this.options.values = null; - } - } - - if ( $.isArray( this.options.values ) ) { - valsLength = this.options.values.length; - } - - if ( key === "disabled" ) { - this.element.toggleClass( "ui-state-disabled", !!value ); - } - - this._super( key, value ); - - switch ( key ) { - case "orientation": - this._detectOrientation(); - this.element - .removeClass( "ui-slider-horizontal ui-slider-vertical" ) - .addClass( "ui-slider-" + this.orientation ); - this._refreshValue(); - - // Reset positioning from previous orientation - this.handles.css( value === "horizontal" ? "bottom" : "left", "" ); - break; - case "value": - this._animateOff = true; - this._refreshValue(); - this._change( null, 0 ); - this._animateOff = false; - break; - case "values": - this._animateOff = true; - this._refreshValue(); - for ( i = 0; i < valsLength; i += 1 ) { - this._change( null, i ); - } - this._animateOff = false; - break; - case "step": - case "min": - case "max": - this._animateOff = true; - this._calculateNewMax(); - this._refreshValue(); - this._animateOff = false; - break; - case "range": - this._animateOff = true; - this._refresh(); - this._animateOff = false; - break; - } - }, - - //internal value getter - // _value() returns value trimmed by min and max, aligned by step - _value: function() { - var val = this.options.value; - val = this._trimAlignValue( val ); - - return val; - }, - - //internal values getter - // _values() returns array of values trimmed by min and max, aligned by step - // _values( index ) returns single value trimmed by min and max, aligned by step - _values: function( index ) { - var val, - vals, - i; - - if ( arguments.length ) { - val = this.options.values[ index ]; - val = this._trimAlignValue( val ); - - return val; - } else if ( this.options.values && this.options.values.length ) { - // .slice() creates a copy of the array - // this copy gets trimmed by min and max and then returned - vals = this.options.values.slice(); - for ( i = 0; i < vals.length; i += 1) { - vals[ i ] = this._trimAlignValue( vals[ i ] ); - } - - return vals; - } else { - return []; - } - }, - - // returns the step-aligned value that val is closest to, between (inclusive) min and max - _trimAlignValue: function( val ) { - if ( val <= this._valueMin() ) { - return this._valueMin(); - } - if ( val >= this._valueMax() ) { - return this._valueMax(); - } - var step = ( this.options.step > 0 ) ? this.options.step : 1, - valModStep = (val - this._valueMin()) % step, - alignValue = val - valModStep; - - if ( Math.abs(valModStep) * 2 >= step ) { - alignValue += ( valModStep > 0 ) ? step : ( -step ); - } - - // Since JavaScript has problems with large floats, round - // the final value to 5 digits after the decimal point (see #4124) - return parseFloat( alignValue.toFixed(5) ); - }, - - _calculateNewMax: function() { - var max = this.options.max, - min = this._valueMin(), - step = this.options.step, - aboveMin = Math.floor( ( +( max - min ).toFixed( this._precision() ) ) / step ) * step; - max = aboveMin + min; - this.max = parseFloat( max.toFixed( this._precision() ) ); - }, - - _precision: function() { - var precision = this._precisionOf( this.options.step ); - if ( this.options.min !== null ) { - precision = Math.max( precision, this._precisionOf( this.options.min ) ); - } - return precision; - }, - - _precisionOf: function( num ) { - var str = num.toString(), - decimal = str.indexOf( "." ); - return decimal === -1 ? 0 : str.length - decimal - 1; - }, - - _valueMin: function() { - return this.options.min; - }, - - _valueMax: function() { - return this.max; - }, - - _refreshValue: function() { - var lastValPercent, valPercent, value, valueMin, valueMax, - oRange = this.options.range, - o = this.options, - that = this, - animate = ( !this._animateOff ) ? o.animate : false, - _set = {}; - - if ( this.options.values && this.options.values.length ) { - this.handles.each(function( i ) { - valPercent = ( that.values(i) - that._valueMin() ) / ( that._valueMax() - that._valueMin() ) * 100; - _set[ that.orientation === "horizontal" ? "left" : "bottom" ] = valPercent + "%"; - $( this ).stop( 1, 1 )[ animate ? "animate" : "css" ]( _set, o.animate ); - if ( that.options.range === true ) { - if ( that.orientation === "horizontal" ) { - if ( i === 0 ) { - that.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { left: valPercent + "%" }, o.animate ); - } - if ( i === 1 ) { - that.range[ animate ? "animate" : "css" ]( { width: ( valPercent - lastValPercent ) + "%" }, { queue: false, duration: o.animate } ); - } - } else { - if ( i === 0 ) { - that.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { bottom: ( valPercent ) + "%" }, o.animate ); - } - if ( i === 1 ) { - that.range[ animate ? "animate" : "css" ]( { height: ( valPercent - lastValPercent ) + "%" }, { queue: false, duration: o.animate } ); - } - } - } - lastValPercent = valPercent; - }); - } else { - value = this.value(); - valueMin = this._valueMin(); - valueMax = this._valueMax(); - valPercent = ( valueMax !== valueMin ) ? - ( value - valueMin ) / ( valueMax - valueMin ) * 100 : - 0; - _set[ this.orientation === "horizontal" ? "left" : "bottom" ] = valPercent + "%"; - this.handle.stop( 1, 1 )[ animate ? "animate" : "css" ]( _set, o.animate ); - - if ( oRange === "min" && this.orientation === "horizontal" ) { - this.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { width: valPercent + "%" }, o.animate ); - } - if ( oRange === "max" && this.orientation === "horizontal" ) { - this.range[ animate ? "animate" : "css" ]( { width: ( 100 - valPercent ) + "%" }, { queue: false, duration: o.animate } ); - } - if ( oRange === "min" && this.orientation === "vertical" ) { - this.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { height: valPercent + "%" }, o.animate ); - } - if ( oRange === "max" && this.orientation === "vertical" ) { - this.range[ animate ? "animate" : "css" ]( { height: ( 100 - valPercent ) + "%" }, { queue: false, duration: o.animate } ); - } - } - }, - - _handleEvents: { - keydown: function( event ) { - var allowed, curVal, newVal, step, - index = $( event.target ).data( "ui-slider-handle-index" ); - - switch ( event.keyCode ) { - case $.ui.keyCode.HOME: - case $.ui.keyCode.END: - case $.ui.keyCode.PAGE_UP: - case $.ui.keyCode.PAGE_DOWN: - case $.ui.keyCode.UP: - case $.ui.keyCode.RIGHT: - case $.ui.keyCode.DOWN: - case $.ui.keyCode.LEFT: - event.preventDefault(); - if ( !this._keySliding ) { - this._keySliding = true; - $( event.target ).addClass( "ui-state-active" ); - allowed = this._start( event, index ); - if ( allowed === false ) { - return; - } - } - break; - } - - step = this.options.step; - if ( this.options.values && this.options.values.length ) { - curVal = newVal = this.values( index ); - } else { - curVal = newVal = this.value(); - } - - switch ( event.keyCode ) { - case $.ui.keyCode.HOME: - newVal = this._valueMin(); - break; - case $.ui.keyCode.END: - newVal = this._valueMax(); - break; - case $.ui.keyCode.PAGE_UP: - newVal = this._trimAlignValue( - curVal + ( ( this._valueMax() - this._valueMin() ) / this.numPages ) - ); - break; - case $.ui.keyCode.PAGE_DOWN: - newVal = this._trimAlignValue( - curVal - ( (this._valueMax() - this._valueMin()) / this.numPages ) ); - break; - case $.ui.keyCode.UP: - case $.ui.keyCode.RIGHT: - if ( curVal === this._valueMax() ) { - return; - } - newVal = this._trimAlignValue( curVal + step ); - break; - case $.ui.keyCode.DOWN: - case $.ui.keyCode.LEFT: - if ( curVal === this._valueMin() ) { - return; - } - newVal = this._trimAlignValue( curVal - step ); - break; - } - - this._slide( event, index, newVal ); - }, - keyup: function( event ) { - var index = $( event.target ).data( "ui-slider-handle-index" ); - - if ( this._keySliding ) { - this._keySliding = false; - this._stop( event, index ); - this._change( event, index ); - $( event.target ).removeClass( "ui-state-active" ); - } - } - } - }); - - - /*! - * jQuery UI Tooltip 1.11.4 - * http://jqueryui.com - * - * Copyright jQuery Foundation and other contributors - * Released under the MIT license. - * http://jquery.org/license - * - * http://api.jqueryui.com/tooltip/ - */ - - - var tooltip = $.widget( "ui.tooltip", { - version: "1.11.4", - options: { - content: function() { - // support: IE<9, Opera in jQuery <1.7 - // .text() can't accept undefined, so coerce to a string - var title = $( this ).attr( "title" ) || ""; - // Escape title, since we're going from an attribute to raw HTML - return $( "" ).text( title ).html(); - }, - hide: true, - // Disabled elements have inconsistent behavior across browsers (#8661) - items: "[title]:not([disabled])", - position: { - my: "left top+15", - at: "left bottom", - collision: "flipfit flip" - }, - show: true, - tooltipClass: null, - track: false, - - // callbacks - close: null, - open: null - }, - - _addDescribedBy: function( elem, id ) { - var describedby = (elem.attr( "aria-describedby" ) || "").split( /\s+/ ); - describedby.push( id ); - elem - .data( "ui-tooltip-id", id ) - .attr( "aria-describedby", $.trim( describedby.join( " " ) ) ); - }, - - _removeDescribedBy: function( elem ) { - var id = elem.data( "ui-tooltip-id" ), - describedby = (elem.attr( "aria-describedby" ) || "").split( /\s+/ ), - index = $.inArray( id, describedby ); - - if ( index !== -1 ) { - describedby.splice( index, 1 ); - } - - elem.removeData( "ui-tooltip-id" ); - describedby = $.trim( describedby.join( " " ) ); - if ( describedby ) { - elem.attr( "aria-describedby", describedby ); - } else { - elem.removeAttr( "aria-describedby" ); - } - }, - - _create: function() { - this._on({ - mouseover: "open", - focusin: "open" - }); - - // IDs of generated tooltips, needed for destroy - this.tooltips = {}; - - // IDs of parent tooltips where we removed the title attribute - this.parents = {}; - - if ( this.options.disabled ) { - this._disable(); - } - - // Append the aria-live region so tooltips announce correctly - this.liveRegion = $( "
                          " ) - .attr({ - role: "log", - "aria-live": "assertive", - "aria-relevant": "additions" - }) - .addClass( "ui-helper-hidden-accessible" ) - .appendTo( this.document[ 0 ].body ); - }, - - _setOption: function( key, value ) { - var that = this; - - if ( key === "disabled" ) { - this[ value ? "_disable" : "_enable" ](); - this.options[ key ] = value; - // disable element style changes - return; - } - - this._super( key, value ); - - if ( key === "content" ) { - $.each( this.tooltips, function( id, tooltipData ) { - that._updateContent( tooltipData.element ); - }); - } - }, - - _disable: function() { - var that = this; - - // close open tooltips - $.each( this.tooltips, function( id, tooltipData ) { - var event = $.Event( "blur" ); - event.target = event.currentTarget = tooltipData.element[ 0 ]; - that.close( event, true ); - }); - - // remove title attributes to prevent native tooltips - this.element.find( this.options.items ).addBack().each(function() { - var element = $( this ); - if ( element.is( "[title]" ) ) { - element - .data( "ui-tooltip-title", element.attr( "title" ) ) - .removeAttr( "title" ); - } - }); - }, - - _enable: function() { - // restore title attributes - this.element.find( this.options.items ).addBack().each(function() { - var element = $( this ); - if ( element.data( "ui-tooltip-title" ) ) { - element.attr( "title", element.data( "ui-tooltip-title" ) ); - } - }); - }, - - open: function( event ) { - var that = this, - target = $( event ? event.target : this.element ) - // we need closest here due to mouseover bubbling, - // but always pointing at the same event target - .closest( this.options.items ); - - // No element to show a tooltip for or the tooltip is already open - if ( !target.length || target.data( "ui-tooltip-id" ) ) { - return; - } - - if ( target.attr( "title" ) ) { - target.data( "ui-tooltip-title", target.attr( "title" ) ); - } - - target.data( "ui-tooltip-open", true ); - - // kill parent tooltips, custom or native, for hover - if ( event && event.type === "mouseover" ) { - target.parents().each(function() { - var parent = $( this ), - blurEvent; - if ( parent.data( "ui-tooltip-open" ) ) { - blurEvent = $.Event( "blur" ); - blurEvent.target = blurEvent.currentTarget = this; - that.close( blurEvent, true ); - } - if ( parent.attr( "title" ) ) { - parent.uniqueId(); - that.parents[ this.id ] = { - element: this, - title: parent.attr( "title" ) - }; - parent.attr( "title", "" ); - } - }); - } - - this._registerCloseHandlers( event, target ); - this._updateContent( target, event ); - }, - - _updateContent: function( target, event ) { - var content, - contentOption = this.options.content, - that = this, - eventType = event ? event.type : null; - - if ( typeof contentOption === "string" ) { - return this._open( event, target, contentOption ); - } - - content = contentOption.call( target[0], function( response ) { - - // IE may instantly serve a cached response for ajax requests - // delay this call to _open so the other call to _open runs first - that._delay(function() { - - // Ignore async response if tooltip was closed already - if ( !target.data( "ui-tooltip-open" ) ) { - return; - } - - // jQuery creates a special event for focusin when it doesn't - // exist natively. To improve performance, the native event - // object is reused and the type is changed. Therefore, we can't - // rely on the type being correct after the event finished - // bubbling, so we set it back to the previous value. (#8740) - if ( event ) { - event.type = eventType; - } - this._open( event, target, response ); - }); - }); - if ( content ) { - this._open( event, target, content ); - } - }, - - _open: function( event, target, content ) { - var tooltipData, tooltip, delayedShow, a11yContent, - positionOption = $.extend( {}, this.options.position ); - - if ( !content ) { - return; - } - - // Content can be updated multiple times. If the tooltip already - // exists, then just update the content and bail. - tooltipData = this._find( target ); - if ( tooltipData ) { - tooltipData.tooltip.find( ".ui-tooltip-content" ).html( content ); - return; - } - - // if we have a title, clear it to prevent the native tooltip - // we have to check first to avoid defining a title if none exists - // (we don't want to cause an element to start matching [title]) - // - // We use removeAttr only for key events, to allow IE to export the correct - // accessible attributes. For mouse events, set to empty string to avoid - // native tooltip showing up (happens only when removing inside mouseover). - if ( target.is( "[title]" ) ) { - if ( event && event.type === "mouseover" ) { - target.attr( "title", "" ); - } else { - target.removeAttr( "title" ); - } - } - - tooltipData = this._tooltip( target ); - tooltip = tooltipData.tooltip; - this._addDescribedBy( target, tooltip.attr( "id" ) ); - tooltip.find( ".ui-tooltip-content" ).html( content ); - - // Support: Voiceover on OS X, JAWS on IE <= 9 - // JAWS announces deletions even when aria-relevant="additions" - // Voiceover will sometimes re-read the entire log region's contents from the beginning - this.liveRegion.children().hide(); - if ( content.clone ) { - a11yContent = content.clone(); - a11yContent.removeAttr( "id" ).find( "[id]" ).removeAttr( "id" ); - } else { - a11yContent = content; - } - $( "
                          " ).html( a11yContent ).appendTo( this.liveRegion ); - - function position( event ) { - positionOption.of = event; - if ( tooltip.is( ":hidden" ) ) { - return; - } - tooltip.position( positionOption ); - } - if ( this.options.track && event && /^mouse/.test( event.type ) ) { - this._on( this.document, { - mousemove: position - }); - // trigger once to override element-relative positioning - position( event ); - } else { - tooltip.position( $.extend({ - of: target - }, this.options.position ) ); - } - - tooltip.hide(); - - this._show( tooltip, this.options.show ); - // Handle tracking tooltips that are shown with a delay (#8644). As soon - // as the tooltip is visible, position the tooltip using the most recent - // event. - if ( this.options.show && this.options.show.delay ) { - delayedShow = this.delayedShow = setInterval(function() { - if ( tooltip.is( ":visible" ) ) { - position( positionOption.of ); - clearInterval( delayedShow ); - } - }, $.fx.interval ); - } - - this._trigger( "open", event, { tooltip: tooltip } ); - }, - - _registerCloseHandlers: function( event, target ) { - var events = { - keyup: function( event ) { - if ( event.keyCode === $.ui.keyCode.ESCAPE ) { - var fakeEvent = $.Event(event); - fakeEvent.currentTarget = target[0]; - this.close( fakeEvent, true ); - } - } - }; - - // Only bind remove handler for delegated targets. Non-delegated - // tooltips will handle this in destroy. - if ( target[ 0 ] !== this.element[ 0 ] ) { - events.remove = function() { - this._removeTooltip( this._find( target ).tooltip ); - }; - } - - if ( !event || event.type === "mouseover" ) { - events.mouseleave = "close"; - } - if ( !event || event.type === "focusin" ) { - events.focusout = "close"; - } - this._on( true, target, events ); - }, - - close: function( event ) { - var tooltip, - that = this, - target = $( event ? event.currentTarget : this.element ), - tooltipData = this._find( target ); - - // The tooltip may already be closed - if ( !tooltipData ) { - - // We set ui-tooltip-open immediately upon open (in open()), but only set the - // additional data once there's actually content to show (in _open()). So even if the - // tooltip doesn't have full data, we always remove ui-tooltip-open in case we're in - // the period between open() and _open(). - target.removeData( "ui-tooltip-open" ); - return; - } - - tooltip = tooltipData.tooltip; - - // disabling closes the tooltip, so we need to track when we're closing - // to avoid an infinite loop in case the tooltip becomes disabled on close - if ( tooltipData.closing ) { - return; - } - - // Clear the interval for delayed tracking tooltips - clearInterval( this.delayedShow ); - - // only set title if we had one before (see comment in _open()) - // If the title attribute has changed since open(), don't restore - if ( target.data( "ui-tooltip-title" ) && !target.attr( "title" ) ) { - target.attr( "title", target.data( "ui-tooltip-title" ) ); - } - - this._removeDescribedBy( target ); - - tooltipData.hiding = true; - tooltip.stop( true ); - this._hide( tooltip, this.options.hide, function() { - that._removeTooltip( $( this ) ); - }); - - target.removeData( "ui-tooltip-open" ); - this._off( target, "mouseleave focusout keyup" ); - - // Remove 'remove' binding only on delegated targets - if ( target[ 0 ] !== this.element[ 0 ] ) { - this._off( target, "remove" ); - } - this._off( this.document, "mousemove" ); - - if ( event && event.type === "mouseleave" ) { - $.each( this.parents, function( id, parent ) { - $( parent.element ).attr( "title", parent.title ); - delete that.parents[ id ]; - }); - } - - tooltipData.closing = true; - this._trigger( "close", event, { tooltip: tooltip } ); - if ( !tooltipData.hiding ) { - tooltipData.closing = false; - } - }, - - _tooltip: function( element ) { - var tooltip = $( "
                          " ) - .attr( "role", "tooltip" ) - .addClass( "ui-tooltip ui-widget ui-corner-all ui-widget-content " + - ( this.options.tooltipClass || "" ) ), - id = tooltip.uniqueId().attr( "id" ); - - $( "
                          " ) - .addClass( "ui-tooltip-content" ) - .appendTo( tooltip ); - - tooltip.appendTo( this.document[0].body ); - - return this.tooltips[ id ] = { - element: element, - tooltip: tooltip - }; - }, - - _find: function( target ) { - var id = target.data( "ui-tooltip-id" ); - return id ? this.tooltips[ id ] : null; - }, - - _removeTooltip: function( tooltip ) { - tooltip.remove(); - delete this.tooltips[ tooltip.attr( "id" ) ]; - }, - - _destroy: function() { - var that = this; - - // close open tooltips - $.each( this.tooltips, function( id, tooltipData ) { - // Delegate to close method to handle common cleanup - var event = $.Event( "blur" ), - element = tooltipData.element; - event.target = event.currentTarget = element[ 0 ]; - that.close( event, true ); - - // Remove immediately; destroying an open tooltip doesn't use the - // hide animation - $( "#" + id ).remove(); - - // Restore the title - if ( element.data( "ui-tooltip-title" ) ) { - // If the title attribute has changed since open(), don't restore - if ( !element.attr( "title" ) ) { - element.attr( "title", element.data( "ui-tooltip-title" ) ); - } - element.removeData( "ui-tooltip-title" ); - } - }); - this.liveRegion.remove(); - } - }); - - - -}));;/*! jQuery Timepicker Addon - v1.5.3 - 2015-04-19 -* http://trentrichardson.com/examples/timepicker -* Copyright (c) 2015 Trent Richardson; Licensed MIT */ -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['jquery', 'jquery.ui'], factory); - } else { - factory(jQuery); - } -}(function ($) { - - /* - * Lets not redefine timepicker, Prevent "Uncaught RangeError: Maximum call stack size exceeded" - */ - $.ui.timepicker = $.ui.timepicker || {}; - if ($.ui.timepicker.version) { - return; - } - - /* - * Extend jQueryUI, get it started with our version number - */ - $.extend($.ui, { - timepicker: { - version: "1.5.3" - } - }); - - /* - * Timepicker manager. - * Use the singleton instance of this class, $.timepicker, to interact with the time picker. - * Settings for (groups of) time pickers are maintained in an instance object, - * allowing multiple different settings on the same page. - */ - var Timepicker = function () { - this.regional = []; // Available regional settings, indexed by language code - this.regional[''] = { // Default regional settings - currentText: 'Now', - closeText: 'Done', - amNames: ['AM', 'A'], - pmNames: ['PM', 'P'], - timeFormat: 'HH:mm', - timeSuffix: '', - timeOnlyTitle: 'Choose Time', - timeText: 'Time', - hourText: 'Hour', - minuteText: 'Minute', - secondText: 'Second', - millisecText: 'Millisecond', - microsecText: 'Microsecond', - timezoneText: 'Time Zone', - isRTL: false - }; - this._defaults = { // Global defaults for all the datetime picker instances - showButtonPanel: true, - timeOnly: false, - timeOnlyShowDate: false, - showHour: null, - showMinute: null, - showSecond: null, - showMillisec: null, - showMicrosec: null, - showTimezone: null, - showTime: true, - stepHour: 1, - stepMinute: 1, - stepSecond: 1, - stepMillisec: 1, - stepMicrosec: 1, - hour: 0, - minute: 0, - second: 0, - millisec: 0, - microsec: 0, - timezone: null, - hourMin: 0, - minuteMin: 0, - secondMin: 0, - millisecMin: 0, - microsecMin: 0, - hourMax: 23, - minuteMax: 59, - secondMax: 59, - millisecMax: 999, - microsecMax: 999, - minDateTime: null, - maxDateTime: null, - maxTime: null, - minTime: null, - onSelect: null, - hourGrid: 0, - minuteGrid: 0, - secondGrid: 0, - millisecGrid: 0, - microsecGrid: 0, - alwaysSetTime: true, - separator: ' ', - altFieldTimeOnly: true, - altTimeFormat: null, - altSeparator: null, - altTimeSuffix: null, - altRedirectFocus: true, - pickerTimeFormat: null, - pickerTimeSuffix: null, - showTimepicker: true, - timezoneList: null, - addSliderAccess: false, - sliderAccessArgs: null, - controlType: 'slider', - oneLine: false, - defaultValue: null, - parse: 'strict', - afterInject: null - }; - $.extend(this._defaults, this.regional['']); - }; - - $.extend(Timepicker.prototype, { - $input: null, - $altInput: null, - $timeObj: null, - inst: null, - hour_slider: null, - minute_slider: null, - second_slider: null, - millisec_slider: null, - microsec_slider: null, - timezone_select: null, - maxTime: null, - minTime: null, - hour: 0, - minute: 0, - second: 0, - millisec: 0, - microsec: 0, - timezone: null, - hourMinOriginal: null, - minuteMinOriginal: null, - secondMinOriginal: null, - millisecMinOriginal: null, - microsecMinOriginal: null, - hourMaxOriginal: null, - minuteMaxOriginal: null, - secondMaxOriginal: null, - millisecMaxOriginal: null, - microsecMaxOriginal: null, - ampm: '', - formattedDate: '', - formattedTime: '', - formattedDateTime: '', - timezoneList: null, - units: ['hour', 'minute', 'second', 'millisec', 'microsec'], - support: {}, - control: null, - - /* - * Override the default settings for all instances of the time picker. - * @param {Object} settings object - the new settings to use as defaults (anonymous object) - * @return {Object} the manager object - */ - setDefaults: function (settings) { - extendRemove(this._defaults, settings || {}); - return this; - }, - - /* - * Create a new Timepicker instance - */ - _newInst: function ($input, opts) { - var tp_inst = new Timepicker(), - inlineSettings = {}, - fns = {}, - overrides, i; - - for (var attrName in this._defaults) { - if (this._defaults.hasOwnProperty(attrName)) { - var attrValue = $input.attr('time:' + attrName); - if (attrValue) { - try { - inlineSettings[attrName] = eval(attrValue); - } catch (err) { - inlineSettings[attrName] = attrValue; - } - } - } - } - - overrides = { - beforeShow: function (input, dp_inst) { - if ($.isFunction(tp_inst._defaults.evnts.beforeShow)) { - return tp_inst._defaults.evnts.beforeShow.call($input[0], input, dp_inst, tp_inst); - } - }, - onChangeMonthYear: function (year, month, dp_inst) { - // Update the time as well : this prevents the time from disappearing from the $input field. - // tp_inst._updateDateTime(dp_inst); - if ($.isFunction(tp_inst._defaults.evnts.onChangeMonthYear)) { - tp_inst._defaults.evnts.onChangeMonthYear.call($input[0], year, month, dp_inst, tp_inst); - } - }, - onClose: function (dateText, dp_inst) { - if (tp_inst.timeDefined === true && $input.val() !== '') { - tp_inst._updateDateTime(dp_inst); - } - if ($.isFunction(tp_inst._defaults.evnts.onClose)) { - tp_inst._defaults.evnts.onClose.call($input[0], dateText, dp_inst, tp_inst); - } - } - }; - for (i in overrides) { - if (overrides.hasOwnProperty(i)) { - fns[i] = opts[i] || null; - } - } - - tp_inst._defaults = $.extend({}, this._defaults, inlineSettings, opts, overrides, { - evnts: fns, - timepicker: tp_inst // add timepicker as a property of datepicker: $.datepicker._get(dp_inst, 'timepicker'); - }); - tp_inst.amNames = $.map(tp_inst._defaults.amNames, function (val) { - return val.toUpperCase(); - }); - tp_inst.pmNames = $.map(tp_inst._defaults.pmNames, function (val) { - return val.toUpperCase(); - }); - - // detect which units are supported - tp_inst.support = detectSupport( - tp_inst._defaults.timeFormat + - (tp_inst._defaults.pickerTimeFormat ? tp_inst._defaults.pickerTimeFormat : '') + - (tp_inst._defaults.altTimeFormat ? tp_inst._defaults.altTimeFormat : '')); - - // controlType is string - key to our this._controls - if (typeof(tp_inst._defaults.controlType) === 'string') { - if (tp_inst._defaults.controlType === 'slider' && typeof($.ui.slider) === 'undefined') { - tp_inst._defaults.controlType = 'select'; - } - tp_inst.control = tp_inst._controls[tp_inst._defaults.controlType]; - } - // controlType is an object and must implement create, options, value methods - else { - tp_inst.control = tp_inst._defaults.controlType; - } - - // prep the timezone options - var timezoneList = [-720, -660, -600, -570, -540, -480, -420, -360, -300, -270, -240, -210, -180, -120, -60, - 0, 60, 120, 180, 210, 240, 270, 300, 330, 345, 360, 390, 420, 480, 525, 540, 570, 600, 630, 660, 690, 720, 765, 780, 840]; - if (tp_inst._defaults.timezoneList !== null) { - timezoneList = tp_inst._defaults.timezoneList; - } - var tzl = timezoneList.length, tzi = 0, tzv = null; - if (tzl > 0 && typeof timezoneList[0] !== 'object') { - for (; tzi < tzl; tzi++) { - tzv = timezoneList[tzi]; - timezoneList[tzi] = { value: tzv, label: $.timepicker.timezoneOffsetString(tzv, tp_inst.support.iso8601) }; - } - } - tp_inst._defaults.timezoneList = timezoneList; - - // set the default units - tp_inst.timezone = tp_inst._defaults.timezone !== null ? $.timepicker.timezoneOffsetNumber(tp_inst._defaults.timezone) : - ((new Date()).getTimezoneOffset() * -1); - tp_inst.hour = tp_inst._defaults.hour < tp_inst._defaults.hourMin ? tp_inst._defaults.hourMin : - tp_inst._defaults.hour > tp_inst._defaults.hourMax ? tp_inst._defaults.hourMax : tp_inst._defaults.hour; - tp_inst.minute = tp_inst._defaults.minute < tp_inst._defaults.minuteMin ? tp_inst._defaults.minuteMin : - tp_inst._defaults.minute > tp_inst._defaults.minuteMax ? tp_inst._defaults.minuteMax : tp_inst._defaults.minute; - tp_inst.second = tp_inst._defaults.second < tp_inst._defaults.secondMin ? tp_inst._defaults.secondMin : - tp_inst._defaults.second > tp_inst._defaults.secondMax ? tp_inst._defaults.secondMax : tp_inst._defaults.second; - tp_inst.millisec = tp_inst._defaults.millisec < tp_inst._defaults.millisecMin ? tp_inst._defaults.millisecMin : - tp_inst._defaults.millisec > tp_inst._defaults.millisecMax ? tp_inst._defaults.millisecMax : tp_inst._defaults.millisec; - tp_inst.microsec = tp_inst._defaults.microsec < tp_inst._defaults.microsecMin ? tp_inst._defaults.microsecMin : - tp_inst._defaults.microsec > tp_inst._defaults.microsecMax ? tp_inst._defaults.microsecMax : tp_inst._defaults.microsec; - tp_inst.ampm = ''; - tp_inst.$input = $input; - - if (tp_inst._defaults.altField) { - tp_inst.$altInput = $(tp_inst._defaults.altField); - if (tp_inst._defaults.altRedirectFocus === true) { - tp_inst.$altInput.css({ - cursor: 'pointer' - }).focus(function () { - $input.trigger("focus"); - }); - } - } - - if (tp_inst._defaults.minDate === 0 || tp_inst._defaults.minDateTime === 0) { - tp_inst._defaults.minDate = new Date(); - } - if (tp_inst._defaults.maxDate === 0 || tp_inst._defaults.maxDateTime === 0) { - tp_inst._defaults.maxDate = new Date(); - } - - // datepicker needs minDate/maxDate, timepicker needs minDateTime/maxDateTime.. - if (tp_inst._defaults.minDate !== undefined && tp_inst._defaults.minDate instanceof Date) { - tp_inst._defaults.minDateTime = new Date(tp_inst._defaults.minDate.getTime()); - } - if (tp_inst._defaults.minDateTime !== undefined && tp_inst._defaults.minDateTime instanceof Date) { - tp_inst._defaults.minDate = new Date(tp_inst._defaults.minDateTime.getTime()); - } - if (tp_inst._defaults.maxDate !== undefined && tp_inst._defaults.maxDate instanceof Date) { - tp_inst._defaults.maxDateTime = new Date(tp_inst._defaults.maxDate.getTime()); - } - if (tp_inst._defaults.maxDateTime !== undefined && tp_inst._defaults.maxDateTime instanceof Date) { - tp_inst._defaults.maxDate = new Date(tp_inst._defaults.maxDateTime.getTime()); - } - tp_inst.$input.bind('focus', function () { - tp_inst._onFocus(); - }); - - return tp_inst; - }, - - /* - * add our sliders to the calendar - */ - _addTimePicker: function (dp_inst) { - var currDT = $.trim((this.$altInput && this._defaults.altFieldTimeOnly) ? this.$input.val() + ' ' + this.$altInput.val() : this.$input.val()); - - this.timeDefined = this._parseTime(currDT); - this._limitMinMaxDateTime(dp_inst, false); - this._injectTimePicker(); - this._afterInject(); - }, - - /* - * parse the time string from input value or _setTime - */ - _parseTime: function (timeString, withDate) { - if (!this.inst) { - this.inst = $.datepicker._getInst(this.$input[0]); - } - - if (withDate || !this._defaults.timeOnly) { - var dp_dateFormat = $.datepicker._get(this.inst, 'dateFormat'); - try { - var parseRes = parseDateTimeInternal(dp_dateFormat, this._defaults.timeFormat, timeString, $.datepicker._getFormatConfig(this.inst), this._defaults); - if (!parseRes.timeObj) { - return false; - } - $.extend(this, parseRes.timeObj); - } catch (err) { - $.timepicker.log("Error parsing the date/time string: " + err + - "\ndate/time string = " + timeString + - "\ntimeFormat = " + this._defaults.timeFormat + - "\ndateFormat = " + dp_dateFormat); - return false; - } - return true; - } else { - var timeObj = $.datepicker.parseTime(this._defaults.timeFormat, timeString, this._defaults); - if (!timeObj) { - return false; - } - $.extend(this, timeObj); - return true; - } - }, - - /* - * Handle callback option after injecting timepicker - */ - _afterInject: function() { - var o = this.inst.settings; - if ($.isFunction(o.afterInject)) { - o.afterInject.call(this); - } - }, - - /* - * generate and inject html for timepicker into ui datepicker - */ - _injectTimePicker: function () { - var $dp = this.inst.dpDiv, - o = this.inst.settings, - tp_inst = this, - litem = '', - uitem = '', - show = null, - max = {}, - gridSize = {}, - size = null, - i = 0, - l = 0; - - // Prevent displaying twice - if ($dp.find("div.ui-timepicker-div").length === 0 && o.showTimepicker) { - var noDisplay = ' ui_tpicker_unit_hide', - html = '
                          ' + '
                          ' + o.timeText + '
                          ' + - '
                          '; - - // Create the markup - for (i = 0, l = this.units.length; i < l; i++) { - litem = this.units[i]; - uitem = litem.substr(0, 1).toUpperCase() + litem.substr(1); - show = o['show' + uitem] !== null ? o['show' + uitem] : this.support[litem]; - - // Added by Peter Medeiros: - // - Figure out what the hour/minute/second max should be based on the step values. - // - Example: if stepMinute is 15, then minMax is 45. - max[litem] = parseInt((o[litem + 'Max'] - ((o[litem + 'Max'] - o[litem + 'Min']) % o['step' + uitem])), 10); - gridSize[litem] = 0; - - html += '
                          ' + o[litem + 'Text'] + '
                          ' + - '
                          '; - - if (show && o[litem + 'Grid'] > 0) { - html += '
                          '; - - if (litem === 'hour') { - for (var h = o[litem + 'Min']; h <= max[litem]; h += parseInt(o[litem + 'Grid'], 10)) { - gridSize[litem]++; - var tmph = $.datepicker.formatTime(this.support.ampm ? 'hht' : 'HH', {hour: h}, o); - html += ''; - } - } - else { - for (var m = o[litem + 'Min']; m <= max[litem]; m += parseInt(o[litem + 'Grid'], 10)) { - gridSize[litem]++; - html += ''; - } - } - - html += '
                          ' + tmph + '' + ((m < 10) ? '0' : '') + m + '
                          '; - } - html += '
                          '; - } - - // Timezone - var showTz = o.showTimezone !== null ? o.showTimezone : this.support.timezone; - html += '
                          ' + o.timezoneText + '
                          '; - html += '
                          '; - - // Create the elements from string - html += '
                          '; - var $tp = $(html); - - // if we only want time picker... - if (o.timeOnly === true) { - $tp.prepend('
                          ' + '
                          ' + o.timeOnlyTitle + '
                          ' + '
                          '); - $dp.find('.ui-datepicker-header, .ui-datepicker-calendar').hide(); - } - - // add sliders, adjust grids, add events - for (i = 0, l = tp_inst.units.length; i < l; i++) { - litem = tp_inst.units[i]; - uitem = litem.substr(0, 1).toUpperCase() + litem.substr(1); - show = o['show' + uitem] !== null ? o['show' + uitem] : this.support[litem]; - - // add the slider - tp_inst[litem + '_slider'] = tp_inst.control.create(tp_inst, $tp.find('.ui_tpicker_' + litem + '_slider'), litem, tp_inst[litem], o[litem + 'Min'], max[litem], o['step' + uitem]); - - // adjust the grid and add click event - if (show && o[litem + 'Grid'] > 0) { - size = 100 * gridSize[litem] * o[litem + 'Grid'] / (max[litem] - o[litem + 'Min']); - $tp.find('.ui_tpicker_' + litem + ' table').css({ - width: size + "%", - marginLeft: o.isRTL ? '0' : ((size / (-2 * gridSize[litem])) + "%"), - marginRight: o.isRTL ? ((size / (-2 * gridSize[litem])) + "%") : '0', - borderCollapse: 'collapse' - }).find("td").click(function (e) { - var $t = $(this), - h = $t.html(), - n = parseInt(h.replace(/[^0-9]/g), 10), - ap = h.replace(/[^apm]/ig), - f = $t.data('for'); // loses scope, so we use data-for - - if (f === 'hour') { - if (ap.indexOf('p') !== -1 && n < 12) { - n += 12; - } - else { - if (ap.indexOf('a') !== -1 && n === 12) { - n = 0; - } - } - } - - tp_inst.control.value(tp_inst, tp_inst[f + '_slider'], litem, n); - - tp_inst._onTimeChange(); - tp_inst._onSelectHandler(); - }).css({ - cursor: 'pointer', - width: (100 / gridSize[litem]) + '%', - textAlign: 'center', - overflow: 'hidden' - }); - } // end if grid > 0 - } // end for loop - - // Add timezone options - this.timezone_select = $tp.find('.ui_tpicker_timezone').append('').find("select"); - $.fn.append.apply(this.timezone_select, - $.map(o.timezoneList, function (val, idx) { - return $("
                          ") - .hide() - .addClass(options.resultsClass) - .css("position", "absolute") - .appendTo(document.body); - - list = $("